diff --git a/.cvsignore b/.cvsignore index a73a969e5ff..07be49647ed 100644 --- a/.cvsignore +++ b/.cvsignore @@ -30,3 +30,4 @@ Makefile lost+found update.out update.sourceware +autom4te.cache diff --git a/COPYING.LIBGLOSS b/COPYING.LIBGLOSS index d6f99e51f6e..db0ab5ea1ad 100644 --- a/COPYING.LIBGLOSS +++ b/COPYING.LIBGLOSS @@ -1,101 +1,52 @@ The libgloss subdirectory is a collection of software from several sources. -Each have their own copyrights embedded in each file that they concern. -(1) University of California, Berkeley +Each file may have its own copyright/license that is embedded in the source +file. Unless otherwise noted in the body of the source file(s), the following copyright +notices will apply to the contents of the libgloss subdirectory: -[1a] +(1) Red Hat Incorporated -Copyright (c) 1990 The Regents of the University of California. +Copyright (c) 1994-2006 Red Hat, Inc. All rights reserved. + +This copyrighted material is made available to anyone wishing to use, modify, +copy, or redistribute it subject to the terms and conditions of the BSD +License. This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties +of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license +is available at http://www.opensource.org/licenses. Any Red Hat trademarks that +are incorporated in the source code or documentation are not subject to the BSD +License and may only be used or replicated with the express permission of +Red Hat, Inc. + +(2) University of California, Berkeley + +Copyright (c) 1981-2000 The Regents of the University of California. All rights reserved. -Redistribution and use in source and binary forms are permitted -provided that the above copyright notice and this paragraph are -duplicated in all such forms and that any documentation, -and other materials related to such distribution and use -acknowledge that the software was developed -by the University of California, Berkeley. The name of the -University may not be used to endorse or promote products derived -from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: -[1b] + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the University nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. -Copyright (c) 1991, 2000 The Regents of the University of California. -All rights reserved. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -[1c] - -Copyright (c) 1991, 1998, 2001 The Regents of the University of California. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. [rescinded 22 July 1999] -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------- - Please note that in some of the above alternate licenses, there is a - statement regarding that acknowledgement must be made in any - advertising materials for products using the code. This restriction - no longer applies due to the following license change: - - ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change - - In some cases the defunct clause has been removed in modified newlib code and - in some cases, the clause has been left as-is. -------------------------------------------------------------- - -(2) DJ Delorie +(3) DJ Delorie Copyright (C) 1993 DJ Delorie All rights reserved. @@ -107,7 +58,7 @@ duplicated in all such forms. This file is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -(3) GPL (fr30 directory only) +(4) GPL (fr30 directory only) Copyright (C) 1998 Free Software Foundation, Inc. Contributed by Cygnus Solutions. @@ -129,7 +80,7 @@ along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -(4) Advanced Micro Devices +(5) Advanced Micro Devices Copyright 1989, 1990 Advanced Micro Devices, Inc. @@ -155,7 +106,7 @@ Mail Stop 573 Austin, TX 78741 800-292-9263 -(5) Array Technology Corporation and MIPS (mips/lsi33k-stub.h) +(6) Array Technology Corporation and MIPS (mips/lsi33k-stub.h) COPYRIGHT (C) 1991, 1992 ARRAY TECHNOLOGY CORPORATION All Rights Reserved @@ -166,9 +117,8 @@ disclosure is subject to the terms of a separate license agreement. Copyright 1985 by MIPS Computer Systems, Inc. -(6) University of Utah and the Computer Systems Laboratory (CSL) - [applies only to hppa*-*-pro* targets] - +(7) University of Utah and the Computer Systems Laboratory (CSL) + [applies only to hppa*-*-pro* targets] Copyright (c) 1990,1994 The University of Utah and the Computer Systems Laboratory (CSL). All rights reserved. @@ -187,22 +137,22 @@ ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. CSL requests users of this software to return to csl-dist@cs.utah.edu any improvements that they make and grant CSL redistribution rights. -(7) Sun Microsystems +(8) Sun Microsystems Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. Developed at SunPro, a Sun Microsystems, Inc. business. Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice -is preserved. +software is freely granted, provided that this notice is preserved. -(8) Hewlett Packard +(9) Hewlett Packard (c) Copyright 1986 HEWLETT-PACKARD COMPANY To anyone who acknowledges that this file is provided "AS IS" without any express or implied warranty: - permission to use, copy, modify, and distribute this file + +permission to use, copy, modify, and distribute this file for any purpose is hereby granted without fee, provided that the above copyright notice and this notice appears in all copies, and that the name of Hewlett-Packard Company not be @@ -211,7 +161,7 @@ of the software without specific, written prior permission. Hewlett-Packard Company makes no representations about the suitability of this software for any purpose. -(9) Hans-Peter Nilsson +(10) Hans-Peter Nilsson Copyright (C) 2001 Hans-Peter Nilsson @@ -224,74 +174,33 @@ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -(10) No Copyright +(11) IBM Corp. spu processor (only spu-* targets) -THIS SOFTWARE IS NOT COPYRIGHTED +(C) Copyright IBM Corp. 2005, 2006 -(11) Cygnus Support / Cygnus Solutions - -Copyright (c) 1995, 1996, 1997, 1998, 1999 Cygnus Support - -The authors hereby grant permission to use, copy, modify, distribute, -and license this software and its documentation for any purpose, provided -that existing copyright notices are retained in all copies and that this -notice is included verbatim in any distributions. No written agreement, -license, or royalty fee is required for any of the authorized uses. -Modifications to this software may be copyrighted by their authors -and need not follow the licensing terms described here, provided that -the new terms are clearly indicated on the first page of each file where -they apply. - ---------------------------------------------------------------- - Please note that the copyright above may be used with the name - Cygnus Solutions instead of Cygnus Support. Both names should - be considered interchangeable. These copyrights are now owned - by Red Hat Incorporated. ---------------------------------------------------------------- - -(12) Red Hat Incorporated - -Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. - -The authors hereby grant permission to use, copy, modify, distribute, -and license this software and its documentation for any purpose, provided -that existing copyright notices are retained in all copies and that this -notice is included verbatim in any distributions. No written agreement, -license, or royalty fee is required for any of the authorized uses. -Modifications to this software may be copyrighted by their authors -and need not follow the licensing terms described here, provided that -the new terms are clearly indicated on the first page of each file where -they apply. - -(13) Default copyright - -Unless otherwise stated in each remaining libgloss file, the remaining -files in the libgloss subdirectory are governed by the following copyright. - -Copyright (c) 1994, 1997, 2001, 2002 Red Hat Incorporated. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. + * Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + * Neither the name of IBM nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. - The name of Red Hat Incorporated may not be used to endorse - or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/COPYING.NEWLIB b/COPYING.NEWLIB index 141ca017ee0..72721a32b17 100644 --- a/COPYING.NEWLIB +++ b/COPYING.NEWLIB @@ -1,197 +1,53 @@ The newlib subdirectory is a collection of software from several sources. + Each file may have its own copyright/license that is embedded in the source -file. +file. Unless otherwise noted in the body of the source file(s), the following copyright +notices will apply to the contents of the newlib subdirectory: -This list documents those licenses which are more restrictive than -a BSD-like license or require the copyright notice -to be duplicated in documentation and/or other materials associated with -the distribution. Certain licenses documented here only apply to -specific targets. Certain clauses only apply if you are building the -code as part of your binary. +(1) Red Hat Incorporated -Note that this list may omit certain licenses that -only pertain to the copying/modifying of the individual source code. -If you are distributing the source code, then you do not need to -worry about these omitted licenses, so long as you do not modify the -copyright information already in place. +Copyright (c) 1994-2006 Red Hat, Inc. All rights reserved. -(1) University of California, Berkeley +This copyrighted material is made available to anyone wishing to use, +modify, copy, or redistribute it subject to the terms and conditions +of the BSD License. This program is distributed in the hope that +it will be useful, but WITHOUT ANY WARRANTY expressed or implied, +including the implied warranties of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. A copy of this license is available at +http://www.opensource.org/licenses. Any Red Hat trademarks that are +incorporated in the source code or documentation are not subject to +the BSD License and may only be used or replicated with the express +permission of Red Hat, Inc. -[1a] +(2) University of California, Berkeley -Copyright (c) 1990 The Regents of the University of California. +Copyright (c) 1981-2000 The Regents of the University of California. All rights reserved. -Redistribution and use in source and binary forms are permitted -provided that the above copyright notice and this paragraph are -duplicated in all such forms and that any documentation, -and other materials related to such distribution and use -acknowledge that the software was developed -by the University of California, Berkeley. The name of the -University may not be used to endorse or promote products derived -from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: -[1b] + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. -Copyright (c) 1990 The Regents of the University of California. -All rights reserved. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. -Redistribution and use in source and binary forms are permitted -provided that the above copyright notice and this paragraph are -duplicated in all such forms and that any documentation, -advertising materials, and other materials related to such -distribution and use acknowledge that the software was developed -by the University of California, Berkeley. The name of the -University may not be used to endorse or promote products derived -from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - -[1c] - -Copyright (c) 1981, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 -The Regents of the University of California. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -[1d] - -Copyright (c) 1988, 1990, 1993 Regents of the University of California. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -[1e] - -Copyright (c) 1982, 1986, 1989, 1991, 1993, 1994 -The Regents of the University of California. All rights reserved. -(c) UNIX System Laboratories, Inc. -All or some portions of this file are derived from material licensed -to the University of California by American Telephone and Telegraph -Co. or Unix System Laboratories, Inc. and are reproduced herein with -the permission of UNIX System Laboratories, Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -[1f] - -Copyright (c) 1987, 1988, 2000 Regents of the University of California. -All rights reserved. - -Redistribution and use in source and binary forms are permitted -provided that: (1) source distributions retain this entire copyright -notice and comment, and (2) distributions including binaries display -the following acknowledgement: ``This product includes software -developed by the University of California, Berkeley and its contributors'' -in the documentation or other materials provided with the distribution -and in all advertising materials mentioning features or use of this -software. Neither the name of the University nor the names of its -contributors may be used to endorse or promote products derived -from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - -------------------------------------------------------------- - Please note that in some of the above alternate licenses, there is a - statement regarding that acknowledgement must be made in any - advertising materials for products using the code. This restriction - no longer applies due to the following license change: - - ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change - - In some cases the defunct clause has been removed in modified newlib code and - in some cases, the clause has been left as-is. -------------------------------------------------------------- - -(2) Cygwin (cygwin targets only) - -Copyright 2001 Red Hat, Inc. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. - -(3) David M. Gay at AT&T +(3) David M. Gay (AT&T 1991, Lucent 1998) The author of this software is David M. Gay. @@ -208,6 +64,33 @@ WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. +------------------------------------------------------------------- + +The author of this software is David M. Gay. + +Copyright (C) 1998-2001 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + + (4) Advanced Micro Devices Copyright 1989, 1990 Advanced Micro Devices, Inc. @@ -253,8 +136,7 @@ Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. Developed at SunPro, a Sun Microsystems, Inc. business. Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice -is preserved. +software is freely granted, provided that this notice is preserved. (8) Hewlett Packard @@ -335,7 +217,7 @@ provided this notice is not removed or altered. All other rights are reserved by SuperH. SUPERH MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO -THIS SOFTWARE. IN NO EVENT SHALL SUPERH BE LIABLE FOR INDIRECT, SPECIAL, +THIS SOFTWARE. IN NO EVENT SHALL SUPERH BE LIABLE FOR INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR USE OF THIS SOFTWARE. @@ -351,7 +233,7 @@ USA (13) Royal Institute of Technology -Copyright (c) 1999 Kungliga Tekniska Hgskolan +Copyright (c) 1999 Kungliga Tekniska Högskolan (Royal Institute of Technology, Stockholm, Sweden). All rights reserved. @@ -530,8 +412,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -(20) DJ Delorie (i386) - +(20) DJ Delorie (i386) Copyright (C) 1991 DJ Delorie All rights reserved. @@ -544,8 +425,7 @@ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. (21) Free Software Foundation LGPL License (*-linux* targets only) - Copyright (C) 1990-1999, 2000, 2001 - Free Software Foundation, Inc. + Copyright (C) 1990-1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Mark Kettenis , 1997. @@ -572,7 +452,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 @@ -698,7 +578,7 @@ SUCH DAMAGE. iconv (Charset Conversion Library) v2.0 -(27) Artem Bityuckiy (--enable-newlib-iconv) +(28) Artem Bityuckiy (--enable-newlib-iconv) Copyright (c) 2003, Artem B. Bityuckiy, SoftMine Corporation. Rights transferred to Franklin Electronic Publishers. @@ -724,37 +604,37 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -(28) Red Hat Incorporated +(29) IBM, Sony, Toshiba (only spu-* targets) -Unless otherwise stated in each remaining newlib file, the remaining -files in the newlib subdirectory default to the following copyright. -It should be noted that Red Hat Incorporated now owns copyrights -belonging to Cygnus Solutions and Cygnus Support. + (C) Copyright 2001,2006, + International Business Machines Corporation, + Sony Computer Entertainment, Incorporated, + Toshiba Corporation, -Copyright (c) 1994, 1997, 2001, 2002, 2003, 2004, 2005 Red Hat Incorporated. -All rights reserved. + All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the names of the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. - The name of Red Hat Incorporated may not be used to endorse - or promote products derived from this software without specific - prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/ChangeLog b/ChangeLog index 1d6afc2e0f1..dbb7644376b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,691 @@ +2007-06-29 Bernd Schmidt + + * configure.ac: Don't add target-libmudflap to noconfigdirs for + uclinux and linux-uclibc targets. + * configure: Regenerate. + +2007-06-28 DJ Delorie + + * configure.ac (arm*-*-linux-gnueabi): Don't build libgloss if we're + not building newlib. + * configure: Regenerated. + +2007-06-22 Daniel Jacobowitz + + * src-release (DEVO_SUPPORT): Correct typos. + +2007-06-18 Daniel Jacobowitz + + * Makefile.def: Add dependency from configure-gdb to all-bfd. + * Makefile.in: Regenerated. + +2007-06-14 Paolo Bonzini + + * Makefile.tpl (cleanstrap): Don't delete the toplevel Makefile. + (distclean-stage[+id+]): Possibly delete stage_last. + * Makefile.in: Regenerate. + +2007-06-07 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2007-06-07 Ben Elliston + + * Makefile.tpl: Fix spelling error. + * Makefile.in: Regenerate. + +2007-06-04 Paolo Bonzini + + Sync with gcc: + 2007-05-30 Jakub Jelinek + + PR bootstrap/29382 + * configure.ac: Don't use -fkeep-inline-functions for GCC < 3.3.1. + * configure: Rebuilt. + +2007-06-01 Steve Ellcey + + * libtool.m4 (LT_CMD_MAX_LEN): Try using getconf to set + lt_cv_sys_max_cmd_len. + +2007-05-31 Paolo Bonzini + + * ltgcc.m4: Update from GCC. + +2007-05-25 Andreas Tobler + + * ltmain.sh: Fix Darwin verstring, remove ${wl}. + +2007-05-24 Steve Ellcey + + * ltmain.sh: Update from GCC. + * libtool.m4: Update from GCC. + * ltsugar.m4: New. Update from GCC. + * ltversion.m4: New. Update from GCC. + * ltoptions.m4: New. Update from GCC. + * ltconfig: Remove. + * ltcf-c.sh: Remove. + * ltcf-cxx.sh: Remove. + * ltcf-gcj.sh: Remove. + * src-release: Update with new libtool file list. + +2007-05-16 Paolo Bonzini + + * Makefile.def (bootstrap_stage): Replace stage_make_flags with + stage_cflags. + * Makefile.tpl (POSTSTAGE1_HOST_EXPORTS, POSTSTAGE1_FLAGS_TO_PASS): + Remove CFLAGS/LIBCFLAGS. + (configure-stage[+id+]-[+prefix+][+module+], + all-stage[+id+]-[+prefix+][+module+]): Pass it from [+stage_cflags+]. + * Makefile.in: Regenerate. + +2007-04-14 Steve Ellcey + + * config-ml.in: Update from GCC. + +2007-04-09 Daniel Jacobowitz + + * src-release (do-proto-toplev): Process the support directories before + the tool directory. + +2007-03-21 Richard Sandiford + + * configure.ac (TOPLEVEL_CONFIGURE_ARGUMENTS): Fix m4 quoting + of glob. Quote arguments with single quotes too. + * configure: Regenerate. + +2007-03-12 Brooks Moses + + * Makefile.def (fixincludes): Remove unneeded "missing" lines. + * Makefile.in: Regenerate + +2007-03-07 Andreas Schwab + + * configure: Regenerate. + +2007-03-01 Brooks Moses + + * configure.ac: Add "--with-pdfdir" configure option, + which defines pdfdir variable. + * Makefile.def (target=fixincludes): Add install-pdf to + missing targets. + (recursive_targets): Add install-pdf target. + (flags_to_pass): Add pdfdir. + * Makefile.tpl: Add pdfdir handling, add do-install-pdf + target. + * configure: Regenerate + * Makefile.in: Regenerate + +2007-02-28 Eric Christopher + + Revert: + 2006-12-07 Mike Stump + + * Makefile.def (dependencies): Add dependency for + install-target-libssp and install-target-libgomp on + install-gcc. + * Makefile.in: Regenerate. + +2007-02-27 Matt Kraai + + * configure: Regenerate. + * configure.ac: Move statements after variable declarations. + +2007-02-19 Joseph Myers + + * configure.ac: Adjust for loop syntax. + * configure: Regenerate. + +2007-02-18 Alexandre Oliva + + * configure: Rebuilt. + +2007-02-18 Alexandre Oliva + + * configure.ac: Drop multiple occurrences of --enable-languages, + and fix its quoting. + * configure: Rebuilt. + +2007-02-17 Mark Mitchell + Nathan Sidwell + Vladimir Prus + + * configure.ac (TOPLEVEL_CONFIGURE_ARGUMENTS): Fix quoting. + * configure: Regenerate. + +2007-02-13 Daniel Jacobowitz + + * configure.ac (target_libraries): Move libgcc before libiberty. + * configure: Regenerated. + +2007-02-13 Paolo Bonzini + + * configure: Regenerate again? + +2007-02-13 Paolo Bonzini + + * configure: Reapply PR30748 fix which was lost in the previous commit. + +2007-02-13 Daniel Jacobowitz + Paolo Bonzini + + PR bootstrap/30753 + * configure.ac: Remove obsolete build / host tests. Use AC_PROG_CC + unconditionally. Use AC_PROG_CXX. Use ACX_TOOL_DIRS to find $prefix. + * configure: Regenerated. + +2007-02-10 Paolo Bonzini + + * configure: Regenerate. + +2007-02-09 Daniel Jacobowitz + + PR bootstrap/30748 + * configure.ac: Correct syntax for Solaris ksh. + * configure: Regenerated. + +2007-02-09 Paolo Bonzini + + * Makefile.def: Sync with GCC. + * Makefile.tpl: Sync with GCC. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2007-02-09 Daniel Jacobowitz + + * Makefile.tpl (build_alias, host_alias, target_alias): Use + noncanonical equivalents. + * configure.in: Rename to... + * configure.ac: ...this. Update AC_PREREQ. Prevent error for + AS_FOR_TARGET. Set build_noncanonical, host_noncanonical, and + target_noncanonical. Use them. Rewrite removal of configure + arguments for autoconf 2.59. Discard variable settings. Force + program_transform_name for native tools. + + * Makefile.in: Regenerated. + * configure: Regenerated with autoconf 2.59. + + * src-release (DEVO_SUPPORT, do-proto-toplev): Expect configure.ac. + +2007-02-08 Jeff Johnston + + * COPYING.LIBGLOSS: Reformat default Red Hat + license to fit within 80 columns. + * COPYING.NEWLIB: Ditto. + +2007-02-05 Dave Brolley + + * Contribute the following changes: + 2006-11-28 DJ Delorie + + * configure.in: Fix typo for mep's target_makefile_frag. + * configure: Regenerated. + + 2005-04-22 Richard Sandiford + + * configure.in (mep*): Add -mlibrary to FLAGS_FOR_TARGET. + * configure: Regenerate. + + 2001-09-19 DJ Delorie + + * configure.in (target_makefile_frag): use mt-mep + + 2001-06-12 Don Howard + + * configure.in: Remove gdb from MeP skip list. + + 2001-04-05 DJ Delorie + + * configure.in (noconfigdirs): Remove gcc from MeP skip list. + + 2001-03-20 Ben Elliston + + * configure.in (noconfigdirs): Add gcc and gdb for MeP. + + 2001-03-19 Ben Elliston + + * config.sub (mep, mep-*): Add. + +2007-01-31 Andreas Schwab + + * Makefile.tpl (LDFLAGS): Substitute it. + * Makefile.in: Regenerate. + +2007-01-11 Paolo Bonzini + + * configure.in: Change == to = in test command. + * configure: Regenerate. + +2007-01-11 Paolo Bonzini + Nick Clifton + Kaveh R. Ghazi + + * configure.in (build_configargs, host_configargs, target_configargs): + Remove build/host/target parameters. + (host_libs): Add gmp and mpfr. + (GMP tests): Reorganize to allow in-tree GMP/MPFR. + * Makefile.def (gmp, mpfr): New. + (gcc): Remove target. + * Makefile.tpl (build_os, build_vendor, host_os, host_vendor, + target_os, target_vendor): New. + (configure): Add host_alias/target_alias arguments. Adjust invocations. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2007-01-11 Matt Fago + + * configure.in: Try to link to functions only in mpfr 2.2.x + to improve robustness of configure tests. + * configure: Regenerate. + +2007-01-08 Kai Tietz + + * configure.in: Add support for an x86_64-mingw* target. + * configure: Regenerate. + +2007-01-05 Daniel Jacobowitz + + * Makefile.tpl (all-target): Correct @if conditional for target + modules. + * configure.in: Omit libiberty if building only target libgcc. + * configure, Makefile.in: Regenerated. + +2007-01-04 Paolo Bonzini + + * configure.in: Use DEV-PHASE to detect the default for --enable-werror. + * configure: Regenerate. + +2007-01-03 Daniel Jacobowitz + + * Makefile.def (target_modules): Add libgcc. + (lang_env_dependencies): Remove default items. Use no_c and no_gcc. + * Makefile.tpl (clean-target-libgcc): Delete. + (configure-target-[+module+]): Emit --disable-bootstrap dependencies + on gcc even for bootstrapped modules. Rewrite handling of + lang_env_dependencies to loop over target_modules. + * configure.in (target_libraries): Add target-libgcc. + * Makefile.in, configure: Regenerated. + +2006-12-29 Paolo Bonzini + + Sync with gcc: + 2006-12-29 Paolo Bonzini + + * configure.in: Reorganize recognition of languages. Add + --enable-stage1-languages. Show supported languages for the chosen + target rather than all recognized languages. + * configure: Regenerate. + + 2006-12-29 Paolo Bonzini + + * Makefile.tpl (GCC_STRAP_TARGETS, all-prebootstrap): Remove. + * Makefile.in: Regenerate. + + 2006-12-29 Kaveh R. Ghazi + + * configure.in: Warn that MPFR 2.2.0 is buggy. + * configure: Regenerate. + +2006-12-27 Ian Lance Taylor + + * configure.in: When removing Makefiles to force a reconfigure, also + remove prev-DIR*/Makefile. + * configure: Regenerate. + +2006-12-23 Kazu Hirata + + * config.bfd: Recognize fido. + +2006-12-19 Paolo Bonzini + + Sync with gcc: + + 2006-12-19 Paolo Bonzini + + * configure.in: Remove "$build" case for powerpc-*-darwin* since + it only affects bootstrap and could be tested on "$host" as well. + * configure: Regenerate. + * config/mh-ppc-darwin: Add to the stage1 cflags here. + + 2006-12-19 Paolo Bonzini + + PR bootstrap/29544 + * Makefile.def (flags_to_pass): Add STAGE1_CHECKING. + (bootstrap_stage): Add STAGE1_CHECKING to stage1 configure flags, + move here comment from Makefile.tpl. + * Makefile.tpl: Move some definitions higher in the file. + (STAGE1_CHECKING): New. + * configure.in: Add --enable-stage1-checking. + * configure: Regenerate. + * Makefile.in: Regenerate. + + 2006-12-03 Kaveh R. Ghazi + + * configure.in: Update error message for missing GMP/MPFR. + + * configure: Regenerate. + + 2006-12-02 Kaveh R. Ghazi + + * configure.in: Update MPFR version in error message. + + * configure: Regenerate. + + 2006-11-26 Kaveh R. Ghazi + + * configure.in (--with-mpfr-dir, --with-gmp-dir): Remove flags. + (--with-mpfr-include, --with-mpfr-lib, --with-gmp-include, + --with-gmp-lib): New flags. + + * configure: Regenerate. + +2006-12-12 Andreas Tobler + + PR bootstrap/30134 + * configure.in: Correct x86 darwin support for libjava to powerpc + and i?86 only. + * configure: Regenerate. + +2006-12-11 Alan Modra + + * configure.in: Handle spu makefile frag. + * Makefile.tpl (MAINT): Define + (MAINTAINER_MODE_FALSE, MAINTAINER_MODE_TRUE): Define. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2006-12-11 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2006-12-11 Ben Elliston + + * configure.in: Sync with GCC (spu-*-*). + * configure: Sync with GCC. + +2006-12-07 Mike Stump + + * Makefile.def (dependencies): Add dependency for + install-target-libssp and install-target-libgomp on + install-gcc. + * Makefile.in: Regenerate. + +2006-11-16 Paolo Bonzini + + * Makefile.tpl (clean-target-libgcc): Test for gcc Makefile presence. + (unstage): Test for stage_last presence. + + PR bootstrap/29802 + * Makefile.tpl (POSTSTAGE1_FLAGS_TO_PASS): Add HOST_SUBDIR in STAGE_PREFIX. + * Makefile.in: Regenerate. + +2006-11-14 DJ Delorie + + * Makefile.tpl (clean-stage*): Sync with GCC (clean). + * Makefile.in: Sync with GCC. + * configure.in: Sync with GCC (mpfr, gmp). + * configure: Sync with GCC. + +2006-11-08 Jie Zhang + + * configure.in: Remove target-libgloss from noconfigdirs for + bfin-*-*. + * configure: Regenerated. + +2006-10-27 Jeff Johnston + + * COPYING.NEWLIB: Add spu license. + * COPYING.LIBGLOSS: Ditto. + +2006-10-17 Brooks Moses + + * Makefile.def: Added pdf target handling. + * Makefile.tpl: Added pdf target handling. + * Makefile.in: Regenerated. + +2006-10-11 Jeff Johnston + + * COPYING.NEWLIB: Updated. + * COPYING.LIBGLOSS: Ditto. + +2006-09-27 Dave Brolley + + * configure.in (RUNTEST): Look for 'runtest' in the source tree by using + $s instead of $r. + * configure: Regenerated. + +2006-09-26 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2006-09-20 Thiemo Seufer + + * configure.in: Remove redundant handling of mips*-dec-bsd*. Likewise + for mipstx39-*-*. Disable libgloss for mips64*-*-linux*. + * configure: Regenerate. + +2006-08-30 Corinna Vinschen + + * configure.in: Never build newlib for a Mingw host. + Never build newlib as Mingw target library. + Test the existence of winsup/cygwin for building a Cygwin newlib, + rather than just winsup. + Add winsup/mingw and winsup/w32api paths to FLAGS_FOR_TARGET if + building a Mingw target. + * configure: Regenerate. + +2006-08-15 Thiemo Seufer + Nigel Stephens + David Ung + + * config.sub: Add support for sde as alias of mipsisa32-sde-elf. + +2006-07-25 Paolo Bonzini + + Sync from GCC: + 2006-07-04 Eric Botcazou + + PR bootstrap/18058 + * configure.in: Add -fkeep-inline-functions to CFLAGS for stage 1 + if the bootstrap compiler is a GCC version that supports it. + * configure: Regenerate. + +2006-07-22 Daniel Jacobowitz + + * configure.in: Allow mingw32 and cygwin targets to build cross-gdb. + * configure: Regenerated. + +2006-07-18 Paolo Bonzini + + * Makefile.tpl (configure-stageN-MODULE): Pass --with-build-libsubdir + for stages after the first. + +2006-07-17 Jakub Jelinek + + * Makefile.def: Add dependencies for configure-opcodes + on configure-intl and all-opcodes on all-intl. + * Makefile.in: Regenerated. + +2006-07-04 Peter O'Gorman + + * ltconfig: chmod 644 before ranlib during install. + +2006-07-03 Paolo Bonzini + + * configure.in: Fix thinkos in previous check-in. + * configure: Regenerate. + +2006-07-03 Paolo Bonzini + + Sync from gcc: + + 2007-07-03 Paolo Bonzini + + PR other/27063 + * configure.in: Test subdir_requires and give an appropriate + error message. + * configure: Regenerate. + + 2006-06-16 Rainer Orth + + PR target/27540 + * configure.in: Only enable libgomp on IRIX 6. + * configure: Regenerate. + +2006-06-20 David Ayers + + PR bootstrap/28072 + * configure.in: Add target-boehm-gc to noconfigdirs depending on + whether target-libjava is being configured instead of whether the + java front end is enabled. + * configure: Regenerate. + +2006-06-15 Mark Shinwell + + * include/elf/arm.h: Correct names of R_ARM_LDC_G{0,1,2} + to R_ARM_LDC_SB_G{0,1,2} respectively. + +2006-06-15 Paolo Bonzini + + * Makefile.tpl (POSTSTAGE1_HOST_EXPORTS): Export CFLAGS and LDFLAGS + too. + * Makefile.in: Regenerate. + +2006-06-13 John David Anglin + + Sync from gcc: + + 2006-06-12 John David Anglin + * configure.in: Don't enable libgomp on hpux10. + * configure: Rebuilt. + +2006-06-13 David Ayers + + Sync from gcc: + + 2006-06-12 David Ayers + + PR bootstrap/27963 + PR target/19970 + * configure.in: Remove target-boehm-gc from noconfigdirs where + ${libgcj} is specified. + * configure: Regenerate. + +2006-06-08 Jeff Johnston + + Sync from gcc: + + 2005-01-12 David Edelsohn + Andreas Schwab + + PR bootstrap/18033 + * config-ml.in: Eval option if surrounded by single quotes. + +2006-06-07 Carlos O'Donell + + Sync from gcc: + + 2006-06-06 David Ayers + + PR libobjc/13946 + * Makefile.def: Add dependencies for libobjc which boehm-gc. + * Makefile.in: Regenerate. + * configure.in: Add --enable-objc-gc at toplevel and have it + enable boehm-gc for Objective-C. + Remove target-boehm-gc from libgcj. + Add target-boehm-gc to target_libraries. + Add target-boehm-gc to noconfigdirs where ${libgcj} + is specified. + Assert that boehm-gc is supported when requested for Objective-C. + Only build boehm-gc if needed either for Java or Objective-C. + * configure: Regenerate. + + 2006-06-05 Paolo Bonzini + + PR 27674 + * Makefile.tpl (configure-[+prefix+][+module+], + all-[+prefix+][+module+]): Depend on stage_current if bootstrapping. + Remove rule to unstage bootstrapped modules. + (stage_current): New. + * Makefile.in: Regenerate. + + 2006-05-20 John David Anglin + Andreas Tobler + + * configure.in: Enable libgcj for hppa*-hp-hpux11*. + * configure: Rebuilt. + + Revert + 2006-01-31 Richard Guenther + Paolo Bonzini + + * Makefile.def (target_modules): Add libgcc-math target module. + * configure.in (target_libraries): Add libgcc-math target library. + (--enable-libgcc-math): New configure switch. + * Makefile.in: Re-generate. + * configure: Re-generate. + +2006-06-05 Jeff Johnston + + * config-ml.in: Alter CCASFLAGS to include special + multilib options the same as is done for CFLAGS. + +2006-05-31 Daniel Jacobowitz + + * Makefile.def: Added dependencies from sim and gdb on intl, and + added configure dependencies to everything with an all dependency + on intl. + * gettext.m4: Removed. + * src-release (DEVO_SUPPORT): Don't mention gettext.m4. + (GDB_SUPPORT_DIRS): Add intl. + * Makefile.in: Regenerated. + +2006-05-25 Daniel Jacobowitz + + * src-release (DEVO_SUPPORT): Add config.rpath. + +2006-05-25 Paolo Bonzini + + * Makefile.def (bfd, opcodes): Fix lib_path. + * Makefile.tpl (POSTSTAGE1_FLAGS_TO_PASS): Replace ADAC with ADAFLAGS. + (restrap): Move under "@if gcc-bootstrap". Fix typo. + * Makefile.in: Regenerate. + +2006-05-24 Mark Shinwell + + * configure.in: Enable gprof for cross builds. + * configure: Regenerate. + 2006-05-17 Daniel Jacobowitz * src-release (MAKEINFOFLAGS): Define. (do-proto-toplev): Pass MAKEINFOFLAGS to submakes. +2006-05-14 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2006-05-12 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2006-05-04 Steve Ellcey + + * blt, iwidgets, mmalloc: Remove directories. + +2006-05-01 DJ Delorie + + * configure.in: Restore CFLAGS if GMP isn't present. + * configure: Regenerate. + +2006-04-18 DJ Delorie + + * configure.in (m32c): Build libstdc++-v3. Pass flags to + reference libgloss so that libssp can be built in a combined + tree. + * configure: Regenerate. + 2006-04-10 Ben Elliston * contrib: Remove directory. @@ -35,7 +718,7 @@ * configure: Regenerate. 2006-02-21 Rafael Avila de Espindola - + * Makefile.tpl (BUILD_CONFIGDIRS): Remove. (TARGET_CONFIGDIRS): Remove. * configure.in: Remove AC_SUBST(target_configdirs). @@ -105,7 +788,7 @@ 2006-02-14 Paolo Bonzini Andreas Schwab - + * configure: Regenerate. 2006-01-16 Paolo Bonzini @@ -117,7 +800,7 @@ 2006-01-16 Nick Clifton - * config.sub, config.guess: Sync from config repository. + * config.sub, config.guess: Sync from config repository. 2006-01-05 Alexandre Oliva @@ -397,7 +1080,7 @@ CONFIGURED_LIPO_FOR_TARGET, CONFIGURED_STRIP_FOR_TARGET. * Makefile.in: Regenerate. * configure: Regenerate. - + 2005-09-19 David Edelsohn * configure.in (powerpc-*-aix*): Add target-libssp to noconfigdirs. @@ -464,7 +1147,7 @@ 2005-07-27 Mark Mitchell * Makefile.tpl (EXTRA_TARGET_FLAGS): Set LDFLAGS=LDFLAGS_FOR_TARGET. - * Makefile.def (flags_to_pass): Add LDFLAGS_FOR_TARGET. + * Makefile.def (flags_to_pass): Add LDFLAGS_FOR_TARGET. * Makefile.in: Regenerated. 2005-07-26 Mark Mitchell @@ -489,7 +1172,7 @@ * configure.in: Add cases for Renesas m32c. * configure: Regenerated. - + 2005-07-14 Kelley Cook * COPYING, compile, config-ml.in, config.guess, @@ -604,7 +1287,7 @@ 2005-05-19 Paul Brook - * configure.in: Rewrite misleading error message when requested + * configure.in: Rewrite misleading error message when requested language cannot be built. * configure: Regenerate. diff --git a/MAINTAINERS b/MAINTAINERS index b2077e7c26a..6c5f732805e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -47,15 +47,15 @@ gdb/; readline/; sim/; GDB's part of include/ include/ See binutils/, gdb/, sid/, gcc/, libiberty/ etc. -libiberty/; libiberty's part of include/ +intl/; config.rhost; libiberty/; libiberty's part of include/ gcc: http://gcc.gnu.org Changes need to be done in tandem with the official GCC sources or submitted to the master file maintainer and brought - in via a merge. Note: approved patches in gcc's libiberty - are automatically approved in this libiberty also; feel free - to merge them yourself if needed sooner than the next merge. - Otherwise, changes are automatically merged, usually within - a day. + in via a merge. Note: approved patches in gcc's libiberty or + intl are automatically approved in this libiberty and intl also; + feel free to merge them yourself if needed sooner than the next + merge. Otherwise, changes are automatically merged, usually + within a day. ltconfig; ltmain.sh; ltcf-*.sh libtool: http://www.gnu.org/software/libtool/ @@ -99,7 +99,7 @@ winsup/ See also winsup/MAINTAINERS. config-ml.in; makefile.vms; mkdep; setup.com; -etc/; intl/; utils/; +etc/; utils/; Any global maintainer can approve changes to these files and directories. diff --git a/Makefile.def b/Makefile.def index 4c58ab5a71f..3d2c6eeeb44 100644 --- a/Makefile.def +++ b/Makefile.def @@ -30,15 +30,14 @@ build_modules= { module= byacc; }; build_modules= { module= flex; }; build_modules= { module= m4; }; build_modules= { module= texinfo; }; -build_modules= { module= fixincludes; - extra_configure_args='--target=$(target)'; }; +build_modules= { module= fixincludes; }; host_modules= { module= ash; }; host_modules= { module= autoconf; }; host_modules= { module= automake; }; host_modules= { module= bash; }; -host_modules= { module= bfd; lib_path=.; bootstrap=true; }; -host_modules= { module= opcodes; lib_path=.; bootstrap=true; }; +host_modules= { module= bfd; lib_path=.libs; bootstrap=true; }; +host_modules= { module= opcodes; lib_path=.libs; bootstrap=true; }; host_modules= { module= binutils; bootstrap=true; }; host_modules= { module= bison; no_check_cross= true; }; host_modules= { module= byacc; no_check_cross= true; }; @@ -52,18 +51,23 @@ host_modules= { module= fileutils; }; host_modules= { module= findutils; }; host_modules= { module= find; }; host_modules= { module= fixincludes; - missing= info; - missing= dvi; - missing= TAGS; - missing= install-info; - missing= installcheck; }; + missing= TAGS; }; host_modules= { module= flex; no_check_cross= true; }; host_modules= { module= gas; bootstrap=true; }; host_modules= { module= gcc; bootstrap=true; - target="`if [ -f stage_last ]; then echo quickstrap ; else echo all; fi`"; extra_make_flags="$(EXTRA_GCC_FLAGS)"; }; host_modules= { module= gawk; }; host_modules= { module= gettext; }; +host_modules= { module= gmp; lib_path=.libs; bootstrap=true; + extra_configure_flags='--disable-shared'; + no_install= true; + host="none-${host_vendor}-${host_os}"; + target="none-${host_vendor}-${host_os}"; }; +host_modules= { module= mpfr; lib_path=.libs; bootstrap=true; + extra_configure_flags='--disable-shared --with-gmp-build=$$r/$(HOST_SUBDIR)/gmp'; + no_install= true; + host="none-${host_vendor}-${host_os}"; + target="none-${host_vendor}-${host_os}"; }; host_modules= { module= gnuserv; }; host_modules= { module= gprof; }; host_modules= { module= gzip; }; @@ -117,8 +121,8 @@ host_modules= { module= gnattools; }; target_modules = { module= libstdc++-v3; lib_path=.libs; raw_cxx=true; }; target_modules = { module= libmudflap; lib_path=.libs; }; target_modules = { module= libssp; lib_path=.libs; }; -target_modules = { module= libgcc-math; lib_path=.libs; }; target_modules = { module= newlib; }; +target_modules = { module= libgcc; bootstrap=true; no_check=true; }; target_modules = { module= libgfortran; }; target_modules = { module= libobjc; }; target_modules = { module= libtermcap; no_check=true; @@ -148,6 +152,8 @@ recursive_targets = { make_target= info; depend=configure; }; recursive_targets = { make_target= dvi; depend=configure; }; +recursive_targets = { make_target= pdf; + depend=configure; }; recursive_targets = { make_target= html; depend=configure; }; recursive_targets = { make_target= TAGS; @@ -155,6 +161,9 @@ recursive_targets = { make_target= TAGS; recursive_targets = { make_target= install-info; depend=configure; depend=info; }; +recursive_targets = { make_target= install-pdf; + depend=configure; + depend=pdf; }; recursive_targets = { make_target= install-html; depend=configure; depend=html; }; @@ -178,6 +187,7 @@ flags_to_pass = { flag= includedir ; }; flags_to_pass = { flag= datarootdir ; }; flags_to_pass = { flag= docdir ; }; flags_to_pass = { flag= infodir ; }; +flags_to_pass = { flag= pdfdir ; }; flags_to_pass = { flag= htmldir ; }; flags_to_pass = { flag= libdir ; }; flags_to_pass = { flag= libexecdir ; }; @@ -224,7 +234,10 @@ flags_to_pass = { flag= LDFLAGS ; }; flags_to_pass = { flag= LIBCFLAGS ; }; flags_to_pass = { flag= LIBCXXFLAGS ; }; flags_to_pass = { flag= STAGE1_CFLAGS ; }; +flags_to_pass = { flag= STAGE1_CHECKING ; }; flags_to_pass = { flag= STAGE1_LANGUAGES ; }; +flags_to_pass = { flag= GNATBIND ; }; +flags_to_pass = { flag= GNATMAKE ; }; // Target tools flags_to_pass = { flag= AR_FOR_TARGET ; }; @@ -271,7 +284,9 @@ dependencies = { module=configure-gcc; on=all-binutils; }; dependencies = { module=configure-gcc; on=all-gas; }; dependencies = { module=configure-gcc; on=all-ld; }; dependencies = { module=all-gcc; on=all-libiberty; hard=true; }; +dependencies = { module=all-gcc; on=all-gmp; }; dependencies = { module=all-gcc; on=all-intl; }; +dependencies = { module=all-gcc; on=all-mpfr; }; dependencies = { module=all-gcc; on=all-build-texinfo; }; dependencies = { module=all-gcc; on=all-build-bison; }; dependencies = { module=all-gcc; on=all-build-byacc; }; @@ -294,11 +309,15 @@ dependencies = { module=all-fixincludes; on=all-libiberty; }; dependencies = { module=all-gnattools; on=all-target-libada; }; +dependencies = { module=configure-mpfr; on=all-gmp; }; + // Host modules specific to gdb. +dependencies = { module=configure-gdb; on=configure-intl; }; dependencies = { module=configure-gdb; on=configure-sim; }; +dependencies = { module=configure-gdb; on=all-bfd; }; +dependencies = { module=all-gdb; on=all-intl; }; dependencies = { module=all-gdb; on=all-libiberty; }; dependencies = { module=all-gdb; on=all-opcodes; }; -dependencies = { module=all-gdb; on=all-bfd; }; dependencies = { module=all-gdb; on=all-readline; }; dependencies = { module=all-gdb; on=all-build-bison; }; dependencies = { module=all-gdb; on=all-build-byacc; }; @@ -312,9 +331,11 @@ dependencies = { module=all-libgui; on=all-itcl; }; // Host modules specific to binutils. dependencies = { module=configure-bfd; on=configure-libiberty; hard=true; }; +dependencies = { module=configure-bfd; on=configure-intl; }; dependencies = { module=all-bfd; on=all-libiberty; }; dependencies = { module=all-bfd; on=all-intl; }; +dependencies = { module=configure-binutils; on=configure-intl; }; dependencies = { module=all-binutils; on=all-libiberty; }; dependencies = { module=all-binutils; on=all-opcodes; }; dependencies = { module=all-binutils; on=all-bfd; }; @@ -331,14 +352,17 @@ dependencies = { module=install-binutils; on=install-opcodes; }; // libopcodes depends on libbfd dependencies = { module=install-opcodes; on=install-bfd; }; +dependencies = { module=configure-gas; on=configure-intl; }; dependencies = { module=all-gas; on=all-libiberty; }; dependencies = { module=all-gas; on=all-opcodes; }; dependencies = { module=all-gas; on=all-bfd; }; dependencies = { module=all-gas; on=all-intl; }; +dependencies = { module=configure-gprof; on=configure-intl; }; dependencies = { module=all-gprof; on=all-libiberty; }; dependencies = { module=all-gprof; on=all-bfd; }; dependencies = { module=all-gprof; on=all-opcodes; }; dependencies = { module=all-gprof; on=all-intl; }; +dependencies = { module=configure-ld; on=configure-intl; }; dependencies = { module=all-ld; on=all-libiberty; }; dependencies = { module=all-ld; on=all-bfd; }; dependencies = { module=all-ld; on=all-opcodes; }; @@ -347,8 +371,10 @@ dependencies = { module=all-ld; on=all-build-byacc; }; dependencies = { module=all-ld; on=all-build-flex; }; dependencies = { module=all-ld; on=all-intl; }; +dependencies = { module=configure-opcodes; on=configure-intl; }; dependencies = { module=all-opcodes; on=all-bfd; }; dependencies = { module=all-opcodes; on=all-libiberty; }; +dependencies = { module=all-opcodes; on=all-intl; }; // Other host modules in the 'src' repository. dependencies = { module=all-dejagnu; on=all-tcl; }; @@ -378,6 +404,8 @@ dependencies = { module=all-sid; on=all-tk; }; dependencies = { module=install-sid; on=install-tcl; }; dependencies = { module=install-sid; on=install-tk; }; +dependencies = { module=configure-sim; on=configure-intl; }; +dependencies = { module=all-sim; on=all-intl; }; dependencies = { module=all-sim; on=all-libiberty; }; dependencies = { module=all-sim; on=all-bfd; }; dependencies = { module=all-sim; on=all-opcodes; }; @@ -425,18 +453,17 @@ dependencies = { module=all-tar; on=all-build-texinfo; }; dependencies = { module=all-uudecode; on=all-build-texinfo; }; // Target modules. These can also have dependencies on the language -// environment (e.g. on libstdc++). -lang_env_dependencies = { module=boehm-gc; }; +// environment (e.g. on libstdc++). By default target modules depend +// on libgcc and newlib/libgloss. lang_env_dependencies = { module=gperf; cxx=true; }; -lang_env_dependencies = { module=libada; }; -lang_env_dependencies = { module=libgfortran; }; -lang_env_dependencies = { module=libffi; }; lang_env_dependencies = { module=libjava; cxx=true; }; -lang_env_dependencies = { module=libmudflap; }; -lang_env_dependencies = { module=libobjc; }; -lang_env_dependencies = { module=libssp; }; -lang_env_dependencies = { module=libstdc++-v3; }; -lang_env_dependencies = { module=zlib; }; +lang_env_dependencies = { module=newlib; no_c=true; }; +lang_env_dependencies = { module=libgloss; no_c=true; }; +lang_env_dependencies = { module=libgcc; no_gcc=true; no_c=true; }; +// libiberty does not depend on newlib or libgloss because it must be +// built newlib on some targets (e.g. Cygwin). It still needs +// a dependency on libgcc for native targets to configure. +lang_env_dependencies = { module=libiberty; no_c=true; }; dependencies = { module=configure-target-boehm-gc; on=configure-target-qthreads; }; dependencies = { module=configure-target-fastjar; on=configure-target-zlib; }; @@ -451,7 +478,9 @@ dependencies = { module=all-target-libjava; on=all-target-zlib; }; dependencies = { module=all-target-libjava; on=all-target-boehm-gc; }; dependencies = { module=all-target-libjava; on=all-target-qthreads; }; dependencies = { module=all-target-libjava; on=all-target-libffi; }; +dependencies = { module=configure-target-libobjc; on=configure-target-boehm-gc; }; dependencies = { module=all-target-libobjc; on=all-target-libiberty; }; +dependencies = { module=all-target-libobjc; on=all-target-boehm-gc; }; dependencies = { module=all-target-libstdc++-v3; on=all-target-libiberty; }; // Target modules in the 'src' repository. @@ -468,33 +497,40 @@ dependencies = { module=all-target-winsup; on=all-target-libtermcap; }; // Toplevel bootstrap bootstrap_stage = { id=1 ; - stage_configure_flags='--disable-intermodule \ + + // * We force-disable intermodule optimizations, even if + // --enable-intermodule was passed, since the installed compiler + // probably can't handle them. Luckily, autoconf always respects + // the last argument when conflicting --enable arguments are passed. + // * Likewise, we force-disable coverage flags, since the installed + // compiler probably has never heard of them. + stage_configure_flags='--disable-intermodule $(STAGE1_CHECKING) \ --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)"' ; - stage_make_flags='CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)"' ; }; + stage_cflags='$(STAGE1_CFLAGS)' ; }; bootstrap_stage = { id=2 ; prev=1 ; bootstrap_target=bootstrap2 ; stage_configure_flags="@stage2_werror_flag@" ; - stage_make_flags="" ; }; + stage_cflags="$(BOOT_CFLAGS)" ; }; bootstrap_stage = { id=3 ; prev=2 ; lean=1 ; compare_target=compare ; bootstrap_target=bootstrap ; cleanstrap_target=cleanstrap ; stage_configure_flags="@stage2_werror_flag@" ; - stage_make_flags="" ; }; + stage_cflags="$(BOOT_CFLAGS)" ; }; bootstrap_stage = { id=4 ; prev=3 ; lean=2 ; compare_target=compare3 ; bootstrap_target=bootstrap4 ; stage_configure_flags="@stage2_werror_flag@" ; - stage_make_flags="" ; }; + stage_cflags="$(BOOT_CFLAGS)" ; }; bootstrap_stage = { id=profile ; prev=1 ; stage_configure_flags="@stage2_werror_flag@" ; - stage_make_flags='CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"' ; }; + stage_cflags='$(BOOT_CFLAGS) -fprofile-generate' ; }; bootstrap_stage = { id=feedback ; prev=profile ; bootstrap_target=profiledbootstrap ; stage_configure_flags="@stage2_werror_flag@" ; - stage_make_flags='CFLAGS="$(BOOT_CFLAGS) -fprofile-use"' ; }; + stage_cflags='$(BOOT_CFLAGS) -fprofile-use' ; }; diff --git a/Makefile.in b/Makefile.in index 2d0da2e7c3c..e34410cf18b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -25,11 +25,17 @@ # ------------------------------- VPATH=@srcdir@ -build_alias=@build_alias@ +build_alias=@build_noncanonical@ +build_vendor=@build_vendor@ +build_os=@build_os@ build=@build@ -host_alias=@host_alias@ +host_alias=@host_noncanonical@ +host_vendor=@host_vendor@ +host_os=@host_os@ host=@host@ -target_alias=@target_alias@ +target_alias=@target_noncanonical@ +target_vendor=@target_vendor@ +target_os=@target_os@ target=@target@ program_transform_name = @program_transform_name@ @@ -52,6 +58,7 @@ oldincludedir = @oldincludedir@ infodir = @infodir@ datarootdir = @datarootdir@ docdir = @docdir@ +pdfdir = @pdfdir@ htmldir = @htmldir@ mandir = @mandir@ man1dir = $(mandir)/man1 @@ -70,6 +77,9 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_DATA = @INSTALL_DATA@ LN = @LN@ LN_S = @LN_S@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ # ------------------------------------------------- # Miscellaneous non-standard autoconf-set variables @@ -177,7 +187,8 @@ POSTSTAGE1_HOST_EXPORTS = \ CC_FOR_BUILD="$(STAGE_CC_WRAPPER) \ $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \ -B$$r/$(HOST_SUBDIR)/prev-gcc/ \ - -B$(build_tooldir)/bin/"; export CC_FOR_BUILD; + -B$(build_tooldir)/bin/"; export CC_FOR_BUILD; \ + LDFLAGS="$(BOOT_LDFLAGS)"; export LDFLAGS; # Target libraries are put under this directory: TARGET_SUBDIR = @target_subdir@ @@ -285,13 +296,26 @@ RANLIB = @RANLIB@ STRIP = @STRIP@ WINDRES = @WINDRES@ +GNATBIND = @GNATBIND@ +GNATMAKE = @GNATMAKE@ + CFLAGS = @CFLAGS@ -LDFLAGS = +LDFLAGS = @LDFLAGS@ LIBCFLAGS = $(CFLAGS) CXXFLAGS = @CXXFLAGS@ LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates PICFLAG = +# Only build the C compiler for stage1, because that is the only one that +# we can guarantee will build with the native compiler, and also it is the +# only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS), +# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them +# overrideable (for a bootstrap build stage1 also builds gcc.info). + +STAGE1_CFLAGS=@stage1_cflags@ +STAGE1_CHECKING=@stage1_checking@ +STAGE1_LANGUAGES=@stage1_languages@ + # ----------------------------------------------- # Programs producing files for the TARGET machine # ----------------------------------------------- @@ -354,7 +378,7 @@ all: # This is the list of directories that may be needed in RPATH_ENVVAR # so that prorgams built for the target machine work. -TARGET_LIB_PATH = $(TARGET_LIB_PATH_libstdc++-v3)$(TARGET_LIB_PATH_libmudflap)$(TARGET_LIB_PATH_libssp)$(TARGET_LIB_PATH_libgcc-math)$(TARGET_LIB_PATH_libgomp)$(HOST_LIB_PATH_gcc) +TARGET_LIB_PATH = $(TARGET_LIB_PATH_libstdc++-v3)$(TARGET_LIB_PATH_libmudflap)$(TARGET_LIB_PATH_libssp)$(TARGET_LIB_PATH_libgomp)$(HOST_LIB_PATH_gcc) @if target-libstdc++-v3 TARGET_LIB_PATH_libstdc++-v3 = $$r/$(TARGET_SUBDIR)/libstdc++-v3/.libs: @@ -368,10 +392,6 @@ TARGET_LIB_PATH_libmudflap = $$r/$(TARGET_SUBDIR)/libmudflap/.libs: TARGET_LIB_PATH_libssp = $$r/$(TARGET_SUBDIR)/libssp/.libs: @endif target-libssp -@if target-libgcc-math -TARGET_LIB_PATH_libgcc-math = $$r/$(TARGET_SUBDIR)/libgcc-math/.libs: -@endif target-libgcc-math - @if target-libgomp TARGET_LIB_PATH_libgomp = $$r/$(TARGET_SUBDIR)/libgomp/.libs: @endif target-libgomp @@ -380,7 +400,7 @@ TARGET_LIB_PATH_libgomp = $$r/$(TARGET_SUBDIR)/libgomp/.libs: # This is the list of directories that may be needed in RPATH_ENVVAR # so that programs built for the host machine work. -HOST_LIB_PATH = $(HOST_LIB_PATH_bfd)$(HOST_LIB_PATH_opcodes) +HOST_LIB_PATH = $(HOST_LIB_PATH_bfd)$(HOST_LIB_PATH_opcodes)$(HOST_LIB_PATH_gmp)$(HOST_LIB_PATH_mpfr) # Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch @if gcc @@ -390,14 +410,24 @@ HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc:$$r/$(HOST_SUBDIR)/prev-gcc: @if bfd HOST_LIB_PATH_bfd = \ - $$r/$(HOST_SUBDIR)/bfd/.:$$r/$(HOST_SUBDIR)/prev-bfd/.: + $$r/$(HOST_SUBDIR)/bfd/.libs:$$r/$(HOST_SUBDIR)/prev-bfd/.libs: @endif bfd @if opcodes HOST_LIB_PATH_opcodes = \ - $$r/$(HOST_SUBDIR)/opcodes/.:$$r/$(HOST_SUBDIR)/prev-opcodes/.: + $$r/$(HOST_SUBDIR)/opcodes/.libs:$$r/$(HOST_SUBDIR)/prev-opcodes/.libs: @endif opcodes +@if gmp +HOST_LIB_PATH_gmp = \ + $$r/$(HOST_SUBDIR)/gmp/.libs:$$r/$(HOST_SUBDIR)/prev-gmp/.libs: +@endif gmp + +@if mpfr +HOST_LIB_PATH_mpfr = \ + $$r/$(HOST_SUBDIR)/mpfr/.libs:$$r/$(HOST_SUBDIR)/prev-mpfr/.libs: +@endif mpfr + # Flags to pass down to all sub-makes. BASE_FLAGS_TO_PASS = \ @@ -411,6 +441,7 @@ BASE_FLAGS_TO_PASS = \ "datarootdir=$(datarootdir)" \ "docdir=$(docdir)" \ "infodir=$(infodir)" \ + "pdfdir=$(pdfdir)" \ "htmldir=$(htmldir)" \ "libdir=$(libdir)" \ "libexecdir=$(libexecdir)" \ @@ -453,7 +484,10 @@ BASE_FLAGS_TO_PASS = \ "LIBCFLAGS=$(LIBCFLAGS)" \ "LIBCXXFLAGS=$(LIBCXXFLAGS)" \ "STAGE1_CFLAGS=$(STAGE1_CFLAGS)" \ + "STAGE1_CHECKING=$(STAGE1_CHECKING)" \ "STAGE1_LANGUAGES=$(STAGE1_LANGUAGES)" \ + "GNATBIND=$(GNATBIND)" \ + "GNATMAKE=$(GNATMAKE)" \ "AR_FOR_TARGET=$(AR_FOR_TARGET)" \ "AS_FOR_TARGET=$(AS_FOR_TARGET)" \ "CC_FOR_TARGET=$(CC_FOR_TARGET)" \ @@ -512,6 +546,14 @@ X11_FLAGS_TO_PASS = \ 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \ 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)' +# Flags to pass to stage2 and later makes. + +POSTSTAGE1_FLAGS_TO_PASS = \ + CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \ + GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind" \ + LDFLAGS="$(BOOT_LDFLAGS)" \ + "`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" + # Flags to pass down to makes which are built with the target environment. # The double $ decreases the length of the command line; those variables # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. The @@ -577,6 +619,8 @@ configure-host: \ maybe-configure-gcc \ maybe-configure-gawk \ maybe-configure-gettext \ + maybe-configure-gmp \ + maybe-configure-mpfr \ maybe-configure-gnuserv \ maybe-configure-gprof \ maybe-configure-gzip \ @@ -626,8 +670,8 @@ configure-target: \ maybe-configure-target-libstdc++-v3 \ maybe-configure-target-libmudflap \ maybe-configure-target-libssp \ - maybe-configure-target-libgcc-math \ maybe-configure-target-newlib \ + maybe-configure-target-libgcc \ maybe-configure-target-libgfortran \ maybe-configure-target-libobjc \ maybe-configure-target-libtermcap \ @@ -709,6 +753,12 @@ all-host: maybe-all-gcc @endif gcc-no-bootstrap all-host: maybe-all-gawk all-host: maybe-all-gettext +@if gmp-no-bootstrap +all-host: maybe-all-gmp +@endif gmp-no-bootstrap +@if mpfr-no-bootstrap +all-host: maybe-all-mpfr +@endif mpfr-no-bootstrap all-host: maybe-all-gnuserv all-host: maybe-all-gprof all-host: maybe-all-gzip @@ -771,8 +821,10 @@ all-host: maybe-all-gnattools all-target: maybe-all-target-libstdc++-v3 all-target: maybe-all-target-libmudflap all-target: maybe-all-target-libssp -all-target: maybe-all-target-libgcc-math all-target: maybe-all-target-newlib +@if target-libgcc-no-bootstrap +all-target: maybe-all-target-libgcc +@endif target-libgcc-no-bootstrap all-target: maybe-all-target-libgfortran all-target: maybe-all-target-libobjc all-target: maybe-all-target-libtermcap @@ -830,6 +882,8 @@ info-host: maybe-info-gas info-host: maybe-info-gcc info-host: maybe-info-gawk info-host: maybe-info-gettext +info-host: maybe-info-gmp +info-host: maybe-info-mpfr info-host: maybe-info-gnuserv info-host: maybe-info-gprof info-host: maybe-info-gzip @@ -880,8 +934,8 @@ info-host: maybe-info-gnattools info-target: maybe-info-target-libstdc++-v3 info-target: maybe-info-target-libmudflap info-target: maybe-info-target-libssp -info-target: maybe-info-target-libgcc-math info-target: maybe-info-target-newlib +info-target: maybe-info-target-libgcc info-target: maybe-info-target-libgfortran info-target: maybe-info-target-libobjc info-target: maybe-info-target-libtermcap @@ -934,6 +988,8 @@ dvi-host: maybe-dvi-gas dvi-host: maybe-dvi-gcc dvi-host: maybe-dvi-gawk dvi-host: maybe-dvi-gettext +dvi-host: maybe-dvi-gmp +dvi-host: maybe-dvi-mpfr dvi-host: maybe-dvi-gnuserv dvi-host: maybe-dvi-gprof dvi-host: maybe-dvi-gzip @@ -984,8 +1040,8 @@ dvi-host: maybe-dvi-gnattools dvi-target: maybe-dvi-target-libstdc++-v3 dvi-target: maybe-dvi-target-libmudflap dvi-target: maybe-dvi-target-libssp -dvi-target: maybe-dvi-target-libgcc-math dvi-target: maybe-dvi-target-newlib +dvi-target: maybe-dvi-target-libgcc dvi-target: maybe-dvi-target-libgfortran dvi-target: maybe-dvi-target-libobjc dvi-target: maybe-dvi-target-libtermcap @@ -1003,6 +1059,112 @@ dvi-target: maybe-dvi-target-rda dvi-target: maybe-dvi-target-libada dvi-target: maybe-dvi-target-libgomp +.PHONY: do-pdf +do-pdf: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) pdf-host \ + pdf-target + + +.PHONY: pdf-host + +pdf-host: maybe-pdf-ash +pdf-host: maybe-pdf-autoconf +pdf-host: maybe-pdf-automake +pdf-host: maybe-pdf-bash +pdf-host: maybe-pdf-bfd +pdf-host: maybe-pdf-opcodes +pdf-host: maybe-pdf-binutils +pdf-host: maybe-pdf-bison +pdf-host: maybe-pdf-byacc +pdf-host: maybe-pdf-bzip2 +pdf-host: maybe-pdf-dejagnu +pdf-host: maybe-pdf-diff +pdf-host: maybe-pdf-dosutils +pdf-host: maybe-pdf-etc +pdf-host: maybe-pdf-fastjar +pdf-host: maybe-pdf-fileutils +pdf-host: maybe-pdf-findutils +pdf-host: maybe-pdf-find +pdf-host: maybe-pdf-fixincludes +pdf-host: maybe-pdf-flex +pdf-host: maybe-pdf-gas +pdf-host: maybe-pdf-gcc +pdf-host: maybe-pdf-gawk +pdf-host: maybe-pdf-gettext +pdf-host: maybe-pdf-gmp +pdf-host: maybe-pdf-mpfr +pdf-host: maybe-pdf-gnuserv +pdf-host: maybe-pdf-gprof +pdf-host: maybe-pdf-gzip +pdf-host: maybe-pdf-hello +pdf-host: maybe-pdf-indent +pdf-host: maybe-pdf-intl +pdf-host: maybe-pdf-tcl +pdf-host: maybe-pdf-itcl +pdf-host: maybe-pdf-ld +pdf-host: maybe-pdf-libcpp +pdf-host: maybe-pdf-libdecnumber +pdf-host: maybe-pdf-libgui +pdf-host: maybe-pdf-libiberty +pdf-host: maybe-pdf-libtool +pdf-host: maybe-pdf-m4 +pdf-host: maybe-pdf-make +pdf-host: maybe-pdf-mmalloc +pdf-host: maybe-pdf-patch +pdf-host: maybe-pdf-perl +pdf-host: maybe-pdf-prms +pdf-host: maybe-pdf-rcs +pdf-host: maybe-pdf-readline +pdf-host: maybe-pdf-release +pdf-host: maybe-pdf-recode +pdf-host: maybe-pdf-sed +pdf-host: maybe-pdf-send-pr +pdf-host: maybe-pdf-shellutils +pdf-host: maybe-pdf-sid +pdf-host: maybe-pdf-sim +pdf-host: maybe-pdf-tar +pdf-host: maybe-pdf-texinfo +pdf-host: maybe-pdf-textutils +pdf-host: maybe-pdf-time +pdf-host: maybe-pdf-uudecode +pdf-host: maybe-pdf-wdiff +pdf-host: maybe-pdf-zip +pdf-host: maybe-pdf-zlib +pdf-host: maybe-pdf-gdb +pdf-host: maybe-pdf-expect +pdf-host: maybe-pdf-guile +pdf-host: maybe-pdf-tk +pdf-host: maybe-pdf-libtermcap +pdf-host: maybe-pdf-utils +pdf-host: maybe-pdf-gnattools + +.PHONY: pdf-target + +pdf-target: maybe-pdf-target-libstdc++-v3 +pdf-target: maybe-pdf-target-libmudflap +pdf-target: maybe-pdf-target-libssp +pdf-target: maybe-pdf-target-newlib +pdf-target: maybe-pdf-target-libgcc +pdf-target: maybe-pdf-target-libgfortran +pdf-target: maybe-pdf-target-libobjc +pdf-target: maybe-pdf-target-libtermcap +pdf-target: maybe-pdf-target-winsup +pdf-target: maybe-pdf-target-libgloss +pdf-target: maybe-pdf-target-libiberty +pdf-target: maybe-pdf-target-gperf +pdf-target: maybe-pdf-target-examples +pdf-target: maybe-pdf-target-libffi +pdf-target: maybe-pdf-target-libjava +pdf-target: maybe-pdf-target-zlib +pdf-target: maybe-pdf-target-boehm-gc +pdf-target: maybe-pdf-target-qthreads +pdf-target: maybe-pdf-target-rda +pdf-target: maybe-pdf-target-libada +pdf-target: maybe-pdf-target-libgomp + .PHONY: do-html do-html: @: $(MAKE); $(unstage) @@ -1038,6 +1200,8 @@ html-host: maybe-html-gas html-host: maybe-html-gcc html-host: maybe-html-gawk html-host: maybe-html-gettext +html-host: maybe-html-gmp +html-host: maybe-html-mpfr html-host: maybe-html-gnuserv html-host: maybe-html-gprof html-host: maybe-html-gzip @@ -1088,8 +1252,8 @@ html-host: maybe-html-gnattools html-target: maybe-html-target-libstdc++-v3 html-target: maybe-html-target-libmudflap html-target: maybe-html-target-libssp -html-target: maybe-html-target-libgcc-math html-target: maybe-html-target-newlib +html-target: maybe-html-target-libgcc html-target: maybe-html-target-libgfortran html-target: maybe-html-target-libobjc html-target: maybe-html-target-libtermcap @@ -1142,6 +1306,8 @@ TAGS-host: maybe-TAGS-gas TAGS-host: maybe-TAGS-gcc TAGS-host: maybe-TAGS-gawk TAGS-host: maybe-TAGS-gettext +TAGS-host: maybe-TAGS-gmp +TAGS-host: maybe-TAGS-mpfr TAGS-host: maybe-TAGS-gnuserv TAGS-host: maybe-TAGS-gprof TAGS-host: maybe-TAGS-gzip @@ -1192,8 +1358,8 @@ TAGS-host: maybe-TAGS-gnattools TAGS-target: maybe-TAGS-target-libstdc++-v3 TAGS-target: maybe-TAGS-target-libmudflap TAGS-target: maybe-TAGS-target-libssp -TAGS-target: maybe-TAGS-target-libgcc-math TAGS-target: maybe-TAGS-target-newlib +TAGS-target: maybe-TAGS-target-libgcc TAGS-target: maybe-TAGS-target-libgfortran TAGS-target: maybe-TAGS-target-libobjc TAGS-target: maybe-TAGS-target-libtermcap @@ -1246,6 +1412,8 @@ install-info-host: maybe-install-info-gas install-info-host: maybe-install-info-gcc install-info-host: maybe-install-info-gawk install-info-host: maybe-install-info-gettext +install-info-host: maybe-install-info-gmp +install-info-host: maybe-install-info-mpfr install-info-host: maybe-install-info-gnuserv install-info-host: maybe-install-info-gprof install-info-host: maybe-install-info-gzip @@ -1296,8 +1464,8 @@ install-info-host: maybe-install-info-gnattools install-info-target: maybe-install-info-target-libstdc++-v3 install-info-target: maybe-install-info-target-libmudflap install-info-target: maybe-install-info-target-libssp -install-info-target: maybe-install-info-target-libgcc-math install-info-target: maybe-install-info-target-newlib +install-info-target: maybe-install-info-target-libgcc install-info-target: maybe-install-info-target-libgfortran install-info-target: maybe-install-info-target-libobjc install-info-target: maybe-install-info-target-libtermcap @@ -1315,6 +1483,112 @@ install-info-target: maybe-install-info-target-rda install-info-target: maybe-install-info-target-libada install-info-target: maybe-install-info-target-libgomp +.PHONY: do-install-pdf +do-install-pdf: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) install-pdf-host \ + install-pdf-target + + +.PHONY: install-pdf-host + +install-pdf-host: maybe-install-pdf-ash +install-pdf-host: maybe-install-pdf-autoconf +install-pdf-host: maybe-install-pdf-automake +install-pdf-host: maybe-install-pdf-bash +install-pdf-host: maybe-install-pdf-bfd +install-pdf-host: maybe-install-pdf-opcodes +install-pdf-host: maybe-install-pdf-binutils +install-pdf-host: maybe-install-pdf-bison +install-pdf-host: maybe-install-pdf-byacc +install-pdf-host: maybe-install-pdf-bzip2 +install-pdf-host: maybe-install-pdf-dejagnu +install-pdf-host: maybe-install-pdf-diff +install-pdf-host: maybe-install-pdf-dosutils +install-pdf-host: maybe-install-pdf-etc +install-pdf-host: maybe-install-pdf-fastjar +install-pdf-host: maybe-install-pdf-fileutils +install-pdf-host: maybe-install-pdf-findutils +install-pdf-host: maybe-install-pdf-find +install-pdf-host: maybe-install-pdf-fixincludes +install-pdf-host: maybe-install-pdf-flex +install-pdf-host: maybe-install-pdf-gas +install-pdf-host: maybe-install-pdf-gcc +install-pdf-host: maybe-install-pdf-gawk +install-pdf-host: maybe-install-pdf-gettext +install-pdf-host: maybe-install-pdf-gmp +install-pdf-host: maybe-install-pdf-mpfr +install-pdf-host: maybe-install-pdf-gnuserv +install-pdf-host: maybe-install-pdf-gprof +install-pdf-host: maybe-install-pdf-gzip +install-pdf-host: maybe-install-pdf-hello +install-pdf-host: maybe-install-pdf-indent +install-pdf-host: maybe-install-pdf-intl +install-pdf-host: maybe-install-pdf-tcl +install-pdf-host: maybe-install-pdf-itcl +install-pdf-host: maybe-install-pdf-ld +install-pdf-host: maybe-install-pdf-libcpp +install-pdf-host: maybe-install-pdf-libdecnumber +install-pdf-host: maybe-install-pdf-libgui +install-pdf-host: maybe-install-pdf-libiberty +install-pdf-host: maybe-install-pdf-libtool +install-pdf-host: maybe-install-pdf-m4 +install-pdf-host: maybe-install-pdf-make +install-pdf-host: maybe-install-pdf-mmalloc +install-pdf-host: maybe-install-pdf-patch +install-pdf-host: maybe-install-pdf-perl +install-pdf-host: maybe-install-pdf-prms +install-pdf-host: maybe-install-pdf-rcs +install-pdf-host: maybe-install-pdf-readline +install-pdf-host: maybe-install-pdf-release +install-pdf-host: maybe-install-pdf-recode +install-pdf-host: maybe-install-pdf-sed +install-pdf-host: maybe-install-pdf-send-pr +install-pdf-host: maybe-install-pdf-shellutils +install-pdf-host: maybe-install-pdf-sid +install-pdf-host: maybe-install-pdf-sim +install-pdf-host: maybe-install-pdf-tar +install-pdf-host: maybe-install-pdf-texinfo +install-pdf-host: maybe-install-pdf-textutils +install-pdf-host: maybe-install-pdf-time +install-pdf-host: maybe-install-pdf-uudecode +install-pdf-host: maybe-install-pdf-wdiff +install-pdf-host: maybe-install-pdf-zip +install-pdf-host: maybe-install-pdf-zlib +install-pdf-host: maybe-install-pdf-gdb +install-pdf-host: maybe-install-pdf-expect +install-pdf-host: maybe-install-pdf-guile +install-pdf-host: maybe-install-pdf-tk +install-pdf-host: maybe-install-pdf-libtermcap +install-pdf-host: maybe-install-pdf-utils +install-pdf-host: maybe-install-pdf-gnattools + +.PHONY: install-pdf-target + +install-pdf-target: maybe-install-pdf-target-libstdc++-v3 +install-pdf-target: maybe-install-pdf-target-libmudflap +install-pdf-target: maybe-install-pdf-target-libssp +install-pdf-target: maybe-install-pdf-target-newlib +install-pdf-target: maybe-install-pdf-target-libgcc +install-pdf-target: maybe-install-pdf-target-libgfortran +install-pdf-target: maybe-install-pdf-target-libobjc +install-pdf-target: maybe-install-pdf-target-libtermcap +install-pdf-target: maybe-install-pdf-target-winsup +install-pdf-target: maybe-install-pdf-target-libgloss +install-pdf-target: maybe-install-pdf-target-libiberty +install-pdf-target: maybe-install-pdf-target-gperf +install-pdf-target: maybe-install-pdf-target-examples +install-pdf-target: maybe-install-pdf-target-libffi +install-pdf-target: maybe-install-pdf-target-libjava +install-pdf-target: maybe-install-pdf-target-zlib +install-pdf-target: maybe-install-pdf-target-boehm-gc +install-pdf-target: maybe-install-pdf-target-qthreads +install-pdf-target: maybe-install-pdf-target-rda +install-pdf-target: maybe-install-pdf-target-libada +install-pdf-target: maybe-install-pdf-target-libgomp + .PHONY: do-install-html do-install-html: @: $(MAKE); $(unstage) @@ -1350,6 +1624,8 @@ install-html-host: maybe-install-html-gas install-html-host: maybe-install-html-gcc install-html-host: maybe-install-html-gawk install-html-host: maybe-install-html-gettext +install-html-host: maybe-install-html-gmp +install-html-host: maybe-install-html-mpfr install-html-host: maybe-install-html-gnuserv install-html-host: maybe-install-html-gprof install-html-host: maybe-install-html-gzip @@ -1400,8 +1676,8 @@ install-html-host: maybe-install-html-gnattools install-html-target: maybe-install-html-target-libstdc++-v3 install-html-target: maybe-install-html-target-libmudflap install-html-target: maybe-install-html-target-libssp -install-html-target: maybe-install-html-target-libgcc-math install-html-target: maybe-install-html-target-newlib +install-html-target: maybe-install-html-target-libgcc install-html-target: maybe-install-html-target-libgfortran install-html-target: maybe-install-html-target-libobjc install-html-target: maybe-install-html-target-libtermcap @@ -1454,6 +1730,8 @@ installcheck-host: maybe-installcheck-gas installcheck-host: maybe-installcheck-gcc installcheck-host: maybe-installcheck-gawk installcheck-host: maybe-installcheck-gettext +installcheck-host: maybe-installcheck-gmp +installcheck-host: maybe-installcheck-mpfr installcheck-host: maybe-installcheck-gnuserv installcheck-host: maybe-installcheck-gprof installcheck-host: maybe-installcheck-gzip @@ -1504,8 +1782,8 @@ installcheck-host: maybe-installcheck-gnattools installcheck-target: maybe-installcheck-target-libstdc++-v3 installcheck-target: maybe-installcheck-target-libmudflap installcheck-target: maybe-installcheck-target-libssp -installcheck-target: maybe-installcheck-target-libgcc-math installcheck-target: maybe-installcheck-target-newlib +installcheck-target: maybe-installcheck-target-libgcc installcheck-target: maybe-installcheck-target-libgfortran installcheck-target: maybe-installcheck-target-libobjc installcheck-target: maybe-installcheck-target-libtermcap @@ -1558,6 +1836,8 @@ mostlyclean-host: maybe-mostlyclean-gas mostlyclean-host: maybe-mostlyclean-gcc mostlyclean-host: maybe-mostlyclean-gawk mostlyclean-host: maybe-mostlyclean-gettext +mostlyclean-host: maybe-mostlyclean-gmp +mostlyclean-host: maybe-mostlyclean-mpfr mostlyclean-host: maybe-mostlyclean-gnuserv mostlyclean-host: maybe-mostlyclean-gprof mostlyclean-host: maybe-mostlyclean-gzip @@ -1608,8 +1888,8 @@ mostlyclean-host: maybe-mostlyclean-gnattools mostlyclean-target: maybe-mostlyclean-target-libstdc++-v3 mostlyclean-target: maybe-mostlyclean-target-libmudflap mostlyclean-target: maybe-mostlyclean-target-libssp -mostlyclean-target: maybe-mostlyclean-target-libgcc-math mostlyclean-target: maybe-mostlyclean-target-newlib +mostlyclean-target: maybe-mostlyclean-target-libgcc mostlyclean-target: maybe-mostlyclean-target-libgfortran mostlyclean-target: maybe-mostlyclean-target-libobjc mostlyclean-target: maybe-mostlyclean-target-libtermcap @@ -1662,6 +1942,8 @@ clean-host: maybe-clean-gas clean-host: maybe-clean-gcc clean-host: maybe-clean-gawk clean-host: maybe-clean-gettext +clean-host: maybe-clean-gmp +clean-host: maybe-clean-mpfr clean-host: maybe-clean-gnuserv clean-host: maybe-clean-gprof clean-host: maybe-clean-gzip @@ -1712,8 +1994,8 @@ clean-host: maybe-clean-gnattools clean-target: maybe-clean-target-libstdc++-v3 clean-target: maybe-clean-target-libmudflap clean-target: maybe-clean-target-libssp -clean-target: maybe-clean-target-libgcc-math clean-target: maybe-clean-target-newlib +clean-target: maybe-clean-target-libgcc clean-target: maybe-clean-target-libgfortran clean-target: maybe-clean-target-libobjc clean-target: maybe-clean-target-libtermcap @@ -1766,6 +2048,8 @@ distclean-host: maybe-distclean-gas distclean-host: maybe-distclean-gcc distclean-host: maybe-distclean-gawk distclean-host: maybe-distclean-gettext +distclean-host: maybe-distclean-gmp +distclean-host: maybe-distclean-mpfr distclean-host: maybe-distclean-gnuserv distclean-host: maybe-distclean-gprof distclean-host: maybe-distclean-gzip @@ -1816,8 +2100,8 @@ distclean-host: maybe-distclean-gnattools distclean-target: maybe-distclean-target-libstdc++-v3 distclean-target: maybe-distclean-target-libmudflap distclean-target: maybe-distclean-target-libssp -distclean-target: maybe-distclean-target-libgcc-math distclean-target: maybe-distclean-target-newlib +distclean-target: maybe-distclean-target-libgcc distclean-target: maybe-distclean-target-libgfortran distclean-target: maybe-distclean-target-libobjc distclean-target: maybe-distclean-target-libtermcap @@ -1870,6 +2154,8 @@ maintainer-clean-host: maybe-maintainer-clean-gas maintainer-clean-host: maybe-maintainer-clean-gcc maintainer-clean-host: maybe-maintainer-clean-gawk maintainer-clean-host: maybe-maintainer-clean-gettext +maintainer-clean-host: maybe-maintainer-clean-gmp +maintainer-clean-host: maybe-maintainer-clean-mpfr maintainer-clean-host: maybe-maintainer-clean-gnuserv maintainer-clean-host: maybe-maintainer-clean-gprof maintainer-clean-host: maybe-maintainer-clean-gzip @@ -1920,8 +2206,8 @@ maintainer-clean-host: maybe-maintainer-clean-gnattools maintainer-clean-target: maybe-maintainer-clean-target-libstdc++-v3 maintainer-clean-target: maybe-maintainer-clean-target-libmudflap maintainer-clean-target: maybe-maintainer-clean-target-libssp -maintainer-clean-target: maybe-maintainer-clean-target-libgcc-math maintainer-clean-target: maybe-maintainer-clean-target-newlib +maintainer-clean-target: maybe-maintainer-clean-target-libgcc maintainer-clean-target: maybe-maintainer-clean-target-libgfortran maintainer-clean-target: maybe-maintainer-clean-target-libobjc maintainer-clean-target: maybe-maintainer-clean-target-libtermcap @@ -1942,12 +2228,14 @@ maintainer-clean-target: maybe-maintainer-clean-target-libgomp # Here are the targets which correspond to the do-X targets. -.PHONY: info installcheck dvi html install-info install-html +.PHONY: info installcheck dvi pdf html +.PHONY: install-info install-pdf install-html .PHONY: clean distclean mostlyclean maintainer-clean realclean .PHONY: local-clean local-distclean local-maintainer-clean info: do-info installcheck: do-installcheck dvi: do-dvi +pdf: do-pdf html: do-html # Make sure makeinfo is built before we do a `make info', if we're @@ -1960,6 +2248,8 @@ install-info: do-install-info dir.info $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \ else true ; fi +install-pdf: do-install-pdf + install-html: do-install-html local-clean: @@ -1992,11 +2282,6 @@ maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean maintainer-clean: local-distclean realclean: maintainer-clean -# Extra dependency for clean-target, owing to the mixed nature of gcc. -clean-target: clean-target-libgcc -clean-target-libgcc: - test ! -d gcc || (cd gcc && $(MAKE) $@) - # Check target. .PHONY: check do-check @@ -2029,6 +2314,8 @@ check-host: \ maybe-check-gcc \ maybe-check-gawk \ maybe-check-gettext \ + maybe-check-gmp \ + maybe-check-mpfr \ maybe-check-gnuserv \ maybe-check-gprof \ maybe-check-gzip \ @@ -2079,8 +2366,8 @@ check-target: \ maybe-check-target-libstdc++-v3 \ maybe-check-target-libmudflap \ maybe-check-target-libssp \ - maybe-check-target-libgcc-math \ maybe-check-target-newlib \ + maybe-check-target-libgcc \ maybe-check-target-libgfortran \ maybe-check-target-libobjc \ maybe-check-target-libtermcap \ @@ -2159,6 +2446,8 @@ install-host-nogcc: \ maybe-install-gas \ maybe-install-gawk \ maybe-install-gettext \ + maybe-install-gmp \ + maybe-install-mpfr \ maybe-install-gnuserv \ maybe-install-gprof \ maybe-install-gzip \ @@ -2230,6 +2519,8 @@ install-host: \ maybe-install-gcc \ maybe-install-gawk \ maybe-install-gettext \ + maybe-install-gmp \ + maybe-install-mpfr \ maybe-install-gnuserv \ maybe-install-gprof \ maybe-install-gzip \ @@ -2280,8 +2571,8 @@ install-target: \ maybe-install-target-libstdc++-v3 \ maybe-install-target-libmudflap \ maybe-install-target-libssp \ - maybe-install-target-libgcc-math \ maybe-install-target-newlib \ + maybe-install-target-libgcc \ maybe-install-target-libgfortran \ maybe-install-target-libobjc \ maybe-install-target-libtermcap \ @@ -2365,6 +2656,9 @@ TAGS: do-TAGS .PHONY: configure-build-libiberty maybe-configure-build-libiberty maybe-configure-build-libiberty: +@if gcc-bootstrap +configure-build-libiberty: stage_current +@endif gcc-bootstrap @if build-libiberty maybe-configure-build-libiberty: configure-build-libiberty configure-build-libiberty: @@ -2385,7 +2679,8 @@ configure-build-libiberty: libsrcdir="$$s/libiberty"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ + $(BUILD_CONFIGARGS) --build=${build_alias} --host=${build_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif build-libiberty @@ -2395,6 +2690,9 @@ configure-build-libiberty: .PHONY: all-build-libiberty maybe-all-build-libiberty maybe-all-build-libiberty: +@if gcc-bootstrap +all-build-libiberty: stage_current +@endif gcc-bootstrap @if build-libiberty TARGET-build-libiberty=all maybe-all-build-libiberty: all-build-libiberty @@ -2413,6 +2711,9 @@ all-build-libiberty: configure-build-libiberty .PHONY: configure-build-bison maybe-configure-build-bison maybe-configure-build-bison: +@if gcc-bootstrap +configure-build-bison: stage_current +@endif gcc-bootstrap @if build-bison maybe-configure-build-bison: configure-build-bison configure-build-bison: @@ -2433,7 +2734,8 @@ configure-build-bison: libsrcdir="$$s/bison"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ + $(BUILD_CONFIGARGS) --build=${build_alias} --host=${build_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif build-bison @@ -2443,6 +2745,9 @@ configure-build-bison: .PHONY: all-build-bison maybe-all-build-bison maybe-all-build-bison: +@if gcc-bootstrap +all-build-bison: stage_current +@endif gcc-bootstrap @if build-bison TARGET-build-bison=all maybe-all-build-bison: all-build-bison @@ -2461,6 +2766,9 @@ all-build-bison: configure-build-bison .PHONY: configure-build-byacc maybe-configure-build-byacc maybe-configure-build-byacc: +@if gcc-bootstrap +configure-build-byacc: stage_current +@endif gcc-bootstrap @if build-byacc maybe-configure-build-byacc: configure-build-byacc configure-build-byacc: @@ -2481,7 +2789,8 @@ configure-build-byacc: libsrcdir="$$s/byacc"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ + $(BUILD_CONFIGARGS) --build=${build_alias} --host=${build_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif build-byacc @@ -2491,6 +2800,9 @@ configure-build-byacc: .PHONY: all-build-byacc maybe-all-build-byacc maybe-all-build-byacc: +@if gcc-bootstrap +all-build-byacc: stage_current +@endif gcc-bootstrap @if build-byacc TARGET-build-byacc=all maybe-all-build-byacc: all-build-byacc @@ -2509,6 +2821,9 @@ all-build-byacc: configure-build-byacc .PHONY: configure-build-flex maybe-configure-build-flex maybe-configure-build-flex: +@if gcc-bootstrap +configure-build-flex: stage_current +@endif gcc-bootstrap @if build-flex maybe-configure-build-flex: configure-build-flex configure-build-flex: @@ -2529,7 +2844,8 @@ configure-build-flex: libsrcdir="$$s/flex"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ + $(BUILD_CONFIGARGS) --build=${build_alias} --host=${build_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif build-flex @@ -2539,6 +2855,9 @@ configure-build-flex: .PHONY: all-build-flex maybe-all-build-flex maybe-all-build-flex: +@if gcc-bootstrap +all-build-flex: stage_current +@endif gcc-bootstrap @if build-flex TARGET-build-flex=all maybe-all-build-flex: all-build-flex @@ -2557,6 +2876,9 @@ all-build-flex: configure-build-flex .PHONY: configure-build-m4 maybe-configure-build-m4 maybe-configure-build-m4: +@if gcc-bootstrap +configure-build-m4: stage_current +@endif gcc-bootstrap @if build-m4 maybe-configure-build-m4: configure-build-m4 configure-build-m4: @@ -2577,7 +2899,8 @@ configure-build-m4: libsrcdir="$$s/m4"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ + $(BUILD_CONFIGARGS) --build=${build_alias} --host=${build_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif build-m4 @@ -2587,6 +2910,9 @@ configure-build-m4: .PHONY: all-build-m4 maybe-all-build-m4 maybe-all-build-m4: +@if gcc-bootstrap +all-build-m4: stage_current +@endif gcc-bootstrap @if build-m4 TARGET-build-m4=all maybe-all-build-m4: all-build-m4 @@ -2605,6 +2931,9 @@ all-build-m4: configure-build-m4 .PHONY: configure-build-texinfo maybe-configure-build-texinfo maybe-configure-build-texinfo: +@if gcc-bootstrap +configure-build-texinfo: stage_current +@endif gcc-bootstrap @if build-texinfo maybe-configure-build-texinfo: configure-build-texinfo configure-build-texinfo: @@ -2625,7 +2954,8 @@ configure-build-texinfo: libsrcdir="$$s/texinfo"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ + $(BUILD_CONFIGARGS) --build=${build_alias} --host=${build_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif build-texinfo @@ -2635,6 +2965,9 @@ configure-build-texinfo: .PHONY: all-build-texinfo maybe-all-build-texinfo maybe-all-build-texinfo: +@if gcc-bootstrap +all-build-texinfo: stage_current +@endif gcc-bootstrap @if build-texinfo TARGET-build-texinfo=all maybe-all-build-texinfo: all-build-texinfo @@ -2653,6 +2986,9 @@ all-build-texinfo: configure-build-texinfo .PHONY: configure-build-fixincludes maybe-configure-build-fixincludes maybe-configure-build-fixincludes: +@if gcc-bootstrap +configure-build-fixincludes: stage_current +@endif gcc-bootstrap @if build-fixincludes maybe-configure-build-fixincludes: configure-build-fixincludes configure-build-fixincludes: @@ -2673,7 +3009,8 @@ configure-build-fixincludes: libsrcdir="$$s/fixincludes"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ + $(BUILD_CONFIGARGS) --build=${build_alias} --host=${build_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif build-fixincludes @@ -2683,6 +3020,9 @@ configure-build-fixincludes: .PHONY: all-build-fixincludes maybe-all-build-fixincludes maybe-all-build-fixincludes: +@if gcc-bootstrap +all-build-fixincludes: stage_current +@endif gcc-bootstrap @if build-fixincludes TARGET-build-fixincludes=all maybe-all-build-fixincludes: all-build-fixincludes @@ -2706,6 +3046,9 @@ all-build-fixincludes: configure-build-fixincludes .PHONY: configure-ash maybe-configure-ash maybe-configure-ash: +@if gcc-bootstrap +configure-ash: stage_current +@endif gcc-bootstrap @if ash maybe-configure-ash: configure-ash configure-ash: @@ -2725,7 +3068,8 @@ configure-ash: srcdiroption="--srcdir=$${topdir}/ash"; \ libsrcdir="$$s/ash"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif ash @@ -2735,6 +3079,9 @@ configure-ash: .PHONY: all-ash maybe-all-ash maybe-all-ash: +@if gcc-bootstrap +all-ash: stage_current +@endif gcc-bootstrap @if ash TARGET-ash=all maybe-all-ash: all-ash @@ -2780,7 +3127,7 @@ install-ash: installdirs @endif ash -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-ash info-ash maybe-info-ash: @@ -2834,6 +3181,32 @@ dvi-ash: \ @endif ash +.PHONY: maybe-pdf-ash pdf-ash +maybe-pdf-ash: +@if ash +maybe-pdf-ash: pdf-ash + +pdf-ash: \ + configure-ash + @: $(MAKE); $(unstage) + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in ash" ; \ + (cd $(HOST_SUBDIR)/ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif ash + .PHONY: maybe-html-ash html-ash maybe-html-ash: @if ash @@ -2913,6 +3286,33 @@ install-info-ash: \ @endif ash +.PHONY: maybe-install-pdf-ash install-pdf-ash +maybe-install-pdf-ash: +@if ash +maybe-install-pdf-ash: install-pdf-ash + +install-pdf-ash: \ + configure-ash \ + pdf-ash + @: $(MAKE); $(unstage) + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in ash" ; \ + (cd $(HOST_SUBDIR)/ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif ash + .PHONY: maybe-install-html-ash install-html-ash maybe-install-html-ash: @if ash @@ -3070,6 +3470,9 @@ maintainer-clean-ash: .PHONY: configure-autoconf maybe-configure-autoconf maybe-configure-autoconf: +@if gcc-bootstrap +configure-autoconf: stage_current +@endif gcc-bootstrap @if autoconf maybe-configure-autoconf: configure-autoconf configure-autoconf: @@ -3089,7 +3492,8 @@ configure-autoconf: srcdiroption="--srcdir=$${topdir}/autoconf"; \ libsrcdir="$$s/autoconf"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif autoconf @@ -3099,6 +3503,9 @@ configure-autoconf: .PHONY: all-autoconf maybe-all-autoconf maybe-all-autoconf: +@if gcc-bootstrap +all-autoconf: stage_current +@endif gcc-bootstrap @if autoconf TARGET-autoconf=all maybe-all-autoconf: all-autoconf @@ -3144,7 +3551,7 @@ install-autoconf: installdirs @endif autoconf -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-autoconf info-autoconf maybe-info-autoconf: @@ -3198,6 +3605,32 @@ dvi-autoconf: \ @endif autoconf +.PHONY: maybe-pdf-autoconf pdf-autoconf +maybe-pdf-autoconf: +@if autoconf +maybe-pdf-autoconf: pdf-autoconf + +pdf-autoconf: \ + configure-autoconf + @: $(MAKE); $(unstage) + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in autoconf" ; \ + (cd $(HOST_SUBDIR)/autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif autoconf + .PHONY: maybe-html-autoconf html-autoconf maybe-html-autoconf: @if autoconf @@ -3277,6 +3710,33 @@ install-info-autoconf: \ @endif autoconf +.PHONY: maybe-install-pdf-autoconf install-pdf-autoconf +maybe-install-pdf-autoconf: +@if autoconf +maybe-install-pdf-autoconf: install-pdf-autoconf + +install-pdf-autoconf: \ + configure-autoconf \ + pdf-autoconf + @: $(MAKE); $(unstage) + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in autoconf" ; \ + (cd $(HOST_SUBDIR)/autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif autoconf + .PHONY: maybe-install-html-autoconf install-html-autoconf maybe-install-html-autoconf: @if autoconf @@ -3434,6 +3894,9 @@ maintainer-clean-autoconf: .PHONY: configure-automake maybe-configure-automake maybe-configure-automake: +@if gcc-bootstrap +configure-automake: stage_current +@endif gcc-bootstrap @if automake maybe-configure-automake: configure-automake configure-automake: @@ -3453,7 +3916,8 @@ configure-automake: srcdiroption="--srcdir=$${topdir}/automake"; \ libsrcdir="$$s/automake"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif automake @@ -3463,6 +3927,9 @@ configure-automake: .PHONY: all-automake maybe-all-automake maybe-all-automake: +@if gcc-bootstrap +all-automake: stage_current +@endif gcc-bootstrap @if automake TARGET-automake=all maybe-all-automake: all-automake @@ -3508,7 +3975,7 @@ install-automake: installdirs @endif automake -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-automake info-automake maybe-info-automake: @@ -3562,6 +4029,32 @@ dvi-automake: \ @endif automake +.PHONY: maybe-pdf-automake pdf-automake +maybe-pdf-automake: +@if automake +maybe-pdf-automake: pdf-automake + +pdf-automake: \ + configure-automake + @: $(MAKE); $(unstage) + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in automake" ; \ + (cd $(HOST_SUBDIR)/automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif automake + .PHONY: maybe-html-automake html-automake maybe-html-automake: @if automake @@ -3641,6 +4134,33 @@ install-info-automake: \ @endif automake +.PHONY: maybe-install-pdf-automake install-pdf-automake +maybe-install-pdf-automake: +@if automake +maybe-install-pdf-automake: install-pdf-automake + +install-pdf-automake: \ + configure-automake \ + pdf-automake + @: $(MAKE); $(unstage) + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in automake" ; \ + (cd $(HOST_SUBDIR)/automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif automake + .PHONY: maybe-install-html-automake install-html-automake maybe-install-html-automake: @if automake @@ -3798,6 +4318,9 @@ maintainer-clean-automake: .PHONY: configure-bash maybe-configure-bash maybe-configure-bash: +@if gcc-bootstrap +configure-bash: stage_current +@endif gcc-bootstrap @if bash maybe-configure-bash: configure-bash configure-bash: @@ -3817,7 +4340,8 @@ configure-bash: srcdiroption="--srcdir=$${topdir}/bash"; \ libsrcdir="$$s/bash"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif bash @@ -3827,6 +4351,9 @@ configure-bash: .PHONY: all-bash maybe-all-bash maybe-all-bash: +@if gcc-bootstrap +all-bash: stage_current +@endif gcc-bootstrap @if bash TARGET-bash=all maybe-all-bash: all-bash @@ -3872,7 +4399,7 @@ install-bash: installdirs @endif bash -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-bash info-bash maybe-info-bash: @@ -3926,6 +4453,32 @@ dvi-bash: \ @endif bash +.PHONY: maybe-pdf-bash pdf-bash +maybe-pdf-bash: +@if bash +maybe-pdf-bash: pdf-bash + +pdf-bash: \ + configure-bash + @: $(MAKE); $(unstage) + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in bash" ; \ + (cd $(HOST_SUBDIR)/bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif bash + .PHONY: maybe-html-bash html-bash maybe-html-bash: @if bash @@ -4005,6 +4558,33 @@ install-info-bash: \ @endif bash +.PHONY: maybe-install-pdf-bash install-pdf-bash +maybe-install-pdf-bash: +@if bash +maybe-install-pdf-bash: install-pdf-bash + +install-pdf-bash: \ + configure-bash \ + pdf-bash + @: $(MAKE); $(unstage) + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in bash" ; \ + (cd $(HOST_SUBDIR)/bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif bash + .PHONY: maybe-install-html-bash install-html-bash maybe-install-html-bash: @if bash @@ -4162,14 +4742,12 @@ maintainer-clean-bash: .PHONY: configure-bfd maybe-configure-bfd maybe-configure-bfd: +@if gcc-bootstrap +configure-bfd: stage_current +@endif gcc-bootstrap @if bfd maybe-configure-bfd: configure-bfd configure-bfd: -@endif bfd -@if bfd-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif bfd-bootstrap -@if bfd @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ @@ -4185,7 +4763,8 @@ configure-bfd: srcdiroption="--srcdir=$${topdir}/bfd"; \ libsrcdir="$$s/bfd"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif bfd @@ -4202,6 +4781,8 @@ configure-stage1-bfd: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/bfd ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ cd $(HOST_SUBDIR)/bfd || exit 1; \ @@ -4213,8 +4794,10 @@ configure-stage1-bfd: srcdiroption="--srcdir=$${topdir}/bfd"; \ libsrcdir="$$s/bfd"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif bfd-bootstrap .PHONY: configure-stage2-bfd maybe-configure-stage2-bfd @@ -4229,6 +4812,8 @@ configure-stage2-bfd: test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/bfd ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ cd $(HOST_SUBDIR)/bfd || exit 1; \ @@ -4240,7 +4825,9 @@ configure-stage2-bfd: srcdiroption="--srcdir=$${topdir}/bfd"; \ libsrcdir="$$s/bfd"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif bfd-bootstrap @@ -4256,6 +4843,8 @@ configure-stage3-bfd: test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/bfd ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ cd $(HOST_SUBDIR)/bfd || exit 1; \ @@ -4267,7 +4856,9 @@ configure-stage3-bfd: srcdiroption="--srcdir=$${topdir}/bfd"; \ libsrcdir="$$s/bfd"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif bfd-bootstrap @@ -4283,6 +4874,8 @@ configure-stage4-bfd: test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/bfd ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ cd $(HOST_SUBDIR)/bfd || exit 1; \ @@ -4294,7 +4887,9 @@ configure-stage4-bfd: srcdiroption="--srcdir=$${topdir}/bfd"; \ libsrcdir="$$s/bfd"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif bfd-bootstrap @@ -4310,6 +4905,8 @@ configure-stageprofile-bfd: test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/bfd ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ cd $(HOST_SUBDIR)/bfd || exit 1; \ @@ -4321,7 +4918,9 @@ configure-stageprofile-bfd: srcdiroption="--srcdir=$${topdir}/bfd"; \ libsrcdir="$$s/bfd"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif bfd-bootstrap @@ -4337,6 +4936,8 @@ configure-stagefeedback-bfd: test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/bfd ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ cd $(HOST_SUBDIR)/bfd || exit 1; \ @@ -4348,7 +4949,9 @@ configure-stagefeedback-bfd: srcdiroption="--srcdir=$${topdir}/bfd"; \ libsrcdir="$$s/bfd"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif bfd-bootstrap @@ -4358,15 +4961,13 @@ configure-stagefeedback-bfd: .PHONY: all-bfd maybe-all-bfd maybe-all-bfd: +@if gcc-bootstrap +all-bfd: stage_current +@endif gcc-bootstrap @if bfd TARGET-bfd=all maybe-all-bfd: all-bfd all-bfd: configure-bfd -@endif bfd -@if bfd-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif bfd-bootstrap -@if bfd @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -4390,18 +4991,22 @@ all-stage1-bfd: configure-stage1-bfd s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ $(TARGET-stage1-bfd) maybe-clean-stage1-bfd: clean-stage1-bfd clean-stage1: clean-stage1-bfd clean-stage1-bfd: - @[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-bfd/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-bfd/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/bfd && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean + clean @endif bfd-bootstrap @@ -4420,19 +5025,23 @@ all-stage2-bfd: configure-stage2-bfd $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage2-bfd) maybe-clean-stage2-bfd: clean-stage2-bfd clean-stage2: clean-stage2-bfd clean-stage2-bfd: - @[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-bfd/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-bfd/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/bfd && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif bfd-bootstrap @@ -4451,19 +5060,23 @@ all-stage3-bfd: configure-stage3-bfd $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage3-bfd) maybe-clean-stage3-bfd: clean-stage3-bfd clean-stage3: clean-stage3-bfd clean-stage3-bfd: - @[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-bfd/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-bfd/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/bfd && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif bfd-bootstrap @@ -4482,19 +5095,23 @@ all-stage4-bfd: configure-stage4-bfd $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage4-bfd) maybe-clean-stage4-bfd: clean-stage4-bfd clean-stage4: clean-stage4-bfd clean-stage4-bfd: - @[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-bfd/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-bfd/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/bfd && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif bfd-bootstrap @@ -4513,19 +5130,23 @@ all-stageprofile-bfd: configure-stageprofile-bfd $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stageprofile-bfd) maybe-clean-stageprofile-bfd: clean-stageprofile-bfd clean-stageprofile: clean-stageprofile-bfd clean-stageprofile-bfd: - @[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-bfd/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-bfd/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/bfd && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean + clean @endif bfd-bootstrap @@ -4544,19 +5165,23 @@ all-stagefeedback-bfd: configure-stagefeedback-bfd $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stagefeedback-bfd) maybe-clean-stagefeedback-bfd: clean-stagefeedback-bfd clean-stagefeedback: clean-stagefeedback-bfd clean-stagefeedback-bfd: - @[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-bfd/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-bfd/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/bfd && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean + clean @endif bfd-bootstrap @@ -4593,7 +5218,7 @@ install-bfd: installdirs @endif bfd -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-bfd info-bfd maybe-info-bfd: @@ -4645,6 +5270,31 @@ dvi-bfd: \ @endif bfd +.PHONY: maybe-pdf-bfd pdf-bfd +maybe-pdf-bfd: +@if bfd +maybe-pdf-bfd: pdf-bfd + +pdf-bfd: \ + configure-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in bfd" ; \ + (cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif bfd + .PHONY: maybe-html-bfd html-bfd maybe-html-bfd: @if bfd @@ -4721,6 +5371,32 @@ install-info-bfd: \ @endif bfd +.PHONY: maybe-install-pdf-bfd install-pdf-bfd +maybe-install-pdf-bfd: +@if bfd +maybe-install-pdf-bfd: install-pdf-bfd + +install-pdf-bfd: \ + configure-bfd \ + pdf-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in bfd" ; \ + (cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif bfd + .PHONY: maybe-install-html-bfd install-html-bfd maybe-install-html-bfd: @if bfd @@ -4872,14 +5548,12 @@ maintainer-clean-bfd: .PHONY: configure-opcodes maybe-configure-opcodes maybe-configure-opcodes: +@if gcc-bootstrap +configure-opcodes: stage_current +@endif gcc-bootstrap @if opcodes maybe-configure-opcodes: configure-opcodes configure-opcodes: -@endif opcodes -@if opcodes-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif opcodes-bootstrap -@if opcodes @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ @@ -4895,7 +5569,8 @@ configure-opcodes: srcdiroption="--srcdir=$${topdir}/opcodes"; \ libsrcdir="$$s/opcodes"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif opcodes @@ -4912,6 +5587,8 @@ configure-stage1-opcodes: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/opcodes ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ cd $(HOST_SUBDIR)/opcodes || exit 1; \ @@ -4923,8 +5600,10 @@ configure-stage1-opcodes: srcdiroption="--srcdir=$${topdir}/opcodes"; \ libsrcdir="$$s/opcodes"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif opcodes-bootstrap .PHONY: configure-stage2-opcodes maybe-configure-stage2-opcodes @@ -4939,6 +5618,8 @@ configure-stage2-opcodes: test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/opcodes ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ cd $(HOST_SUBDIR)/opcodes || exit 1; \ @@ -4950,7 +5631,9 @@ configure-stage2-opcodes: srcdiroption="--srcdir=$${topdir}/opcodes"; \ libsrcdir="$$s/opcodes"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif opcodes-bootstrap @@ -4966,6 +5649,8 @@ configure-stage3-opcodes: test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/opcodes ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ cd $(HOST_SUBDIR)/opcodes || exit 1; \ @@ -4977,7 +5662,9 @@ configure-stage3-opcodes: srcdiroption="--srcdir=$${topdir}/opcodes"; \ libsrcdir="$$s/opcodes"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif opcodes-bootstrap @@ -4993,6 +5680,8 @@ configure-stage4-opcodes: test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/opcodes ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ cd $(HOST_SUBDIR)/opcodes || exit 1; \ @@ -5004,7 +5693,9 @@ configure-stage4-opcodes: srcdiroption="--srcdir=$${topdir}/opcodes"; \ libsrcdir="$$s/opcodes"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif opcodes-bootstrap @@ -5020,6 +5711,8 @@ configure-stageprofile-opcodes: test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/opcodes ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ cd $(HOST_SUBDIR)/opcodes || exit 1; \ @@ -5031,7 +5724,9 @@ configure-stageprofile-opcodes: srcdiroption="--srcdir=$${topdir}/opcodes"; \ libsrcdir="$$s/opcodes"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif opcodes-bootstrap @@ -5047,6 +5742,8 @@ configure-stagefeedback-opcodes: test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/opcodes ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ cd $(HOST_SUBDIR)/opcodes || exit 1; \ @@ -5058,7 +5755,9 @@ configure-stagefeedback-opcodes: srcdiroption="--srcdir=$${topdir}/opcodes"; \ libsrcdir="$$s/opcodes"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif opcodes-bootstrap @@ -5068,15 +5767,13 @@ configure-stagefeedback-opcodes: .PHONY: all-opcodes maybe-all-opcodes maybe-all-opcodes: +@if gcc-bootstrap +all-opcodes: stage_current +@endif gcc-bootstrap @if opcodes TARGET-opcodes=all maybe-all-opcodes: all-opcodes all-opcodes: configure-opcodes -@endif opcodes -@if opcodes-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif opcodes-bootstrap -@if opcodes @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -5100,18 +5797,22 @@ all-stage1-opcodes: configure-stage1-opcodes s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ $(TARGET-stage1-opcodes) maybe-clean-stage1-opcodes: clean-stage1-opcodes clean-stage1: clean-stage1-opcodes clean-stage1-opcodes: - @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-opcodes/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-opcodes/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/opcodes && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean + clean @endif opcodes-bootstrap @@ -5130,19 +5831,23 @@ all-stage2-opcodes: configure-stage2-opcodes $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage2-opcodes) maybe-clean-stage2-opcodes: clean-stage2-opcodes clean-stage2: clean-stage2-opcodes clean-stage2-opcodes: - @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-opcodes/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-opcodes/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/opcodes && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif opcodes-bootstrap @@ -5161,19 +5866,23 @@ all-stage3-opcodes: configure-stage3-opcodes $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage3-opcodes) maybe-clean-stage3-opcodes: clean-stage3-opcodes clean-stage3: clean-stage3-opcodes clean-stage3-opcodes: - @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-opcodes/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-opcodes/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/opcodes && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif opcodes-bootstrap @@ -5192,19 +5901,23 @@ all-stage4-opcodes: configure-stage4-opcodes $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage4-opcodes) maybe-clean-stage4-opcodes: clean-stage4-opcodes clean-stage4: clean-stage4-opcodes clean-stage4-opcodes: - @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-opcodes/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-opcodes/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/opcodes && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif opcodes-bootstrap @@ -5223,19 +5936,23 @@ all-stageprofile-opcodes: configure-stageprofile-opcodes $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stageprofile-opcodes) maybe-clean-stageprofile-opcodes: clean-stageprofile-opcodes clean-stageprofile: clean-stageprofile-opcodes clean-stageprofile-opcodes: - @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-opcodes/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-opcodes/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/opcodes && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean + clean @endif opcodes-bootstrap @@ -5254,19 +5971,23 @@ all-stagefeedback-opcodes: configure-stagefeedback-opcodes $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stagefeedback-opcodes) maybe-clean-stagefeedback-opcodes: clean-stagefeedback-opcodes clean-stagefeedback: clean-stagefeedback-opcodes clean-stagefeedback-opcodes: - @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-opcodes/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-opcodes/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/opcodes && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean + clean @endif opcodes-bootstrap @@ -5303,7 +6024,7 @@ install-opcodes: installdirs @endif opcodes -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-opcodes info-opcodes maybe-info-opcodes: @@ -5355,6 +6076,31 @@ dvi-opcodes: \ @endif opcodes +.PHONY: maybe-pdf-opcodes pdf-opcodes +maybe-pdf-opcodes: +@if opcodes +maybe-pdf-opcodes: pdf-opcodes + +pdf-opcodes: \ + configure-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in opcodes" ; \ + (cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif opcodes + .PHONY: maybe-html-opcodes html-opcodes maybe-html-opcodes: @if opcodes @@ -5431,6 +6177,32 @@ install-info-opcodes: \ @endif opcodes +.PHONY: maybe-install-pdf-opcodes install-pdf-opcodes +maybe-install-pdf-opcodes: +@if opcodes +maybe-install-pdf-opcodes: install-pdf-opcodes + +install-pdf-opcodes: \ + configure-opcodes \ + pdf-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in opcodes" ; \ + (cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif opcodes + .PHONY: maybe-install-html-opcodes install-html-opcodes maybe-install-html-opcodes: @if opcodes @@ -5582,14 +6354,12 @@ maintainer-clean-opcodes: .PHONY: configure-binutils maybe-configure-binutils maybe-configure-binutils: +@if gcc-bootstrap +configure-binutils: stage_current +@endif gcc-bootstrap @if binutils maybe-configure-binutils: configure-binutils configure-binutils: -@endif binutils -@if binutils-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif binutils-bootstrap -@if binutils @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ @@ -5605,7 +6375,8 @@ configure-binutils: srcdiroption="--srcdir=$${topdir}/binutils"; \ libsrcdir="$$s/binutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif binutils @@ -5622,6 +6393,8 @@ configure-stage1-binutils: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/binutils ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ cd $(HOST_SUBDIR)/binutils || exit 1; \ @@ -5633,8 +6406,10 @@ configure-stage1-binutils: srcdiroption="--srcdir=$${topdir}/binutils"; \ libsrcdir="$$s/binutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif binutils-bootstrap .PHONY: configure-stage2-binutils maybe-configure-stage2-binutils @@ -5649,6 +6424,8 @@ configure-stage2-binutils: test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/binutils ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ cd $(HOST_SUBDIR)/binutils || exit 1; \ @@ -5660,7 +6437,9 @@ configure-stage2-binutils: srcdiroption="--srcdir=$${topdir}/binutils"; \ libsrcdir="$$s/binutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif binutils-bootstrap @@ -5676,6 +6455,8 @@ configure-stage3-binutils: test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/binutils ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ cd $(HOST_SUBDIR)/binutils || exit 1; \ @@ -5687,7 +6468,9 @@ configure-stage3-binutils: srcdiroption="--srcdir=$${topdir}/binutils"; \ libsrcdir="$$s/binutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif binutils-bootstrap @@ -5703,6 +6486,8 @@ configure-stage4-binutils: test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/binutils ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ cd $(HOST_SUBDIR)/binutils || exit 1; \ @@ -5714,7 +6499,9 @@ configure-stage4-binutils: srcdiroption="--srcdir=$${topdir}/binutils"; \ libsrcdir="$$s/binutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif binutils-bootstrap @@ -5730,6 +6517,8 @@ configure-stageprofile-binutils: test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/binutils ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ cd $(HOST_SUBDIR)/binutils || exit 1; \ @@ -5741,7 +6530,9 @@ configure-stageprofile-binutils: srcdiroption="--srcdir=$${topdir}/binutils"; \ libsrcdir="$$s/binutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif binutils-bootstrap @@ -5757,6 +6548,8 @@ configure-stagefeedback-binutils: test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/binutils ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ cd $(HOST_SUBDIR)/binutils || exit 1; \ @@ -5768,7 +6561,9 @@ configure-stagefeedback-binutils: srcdiroption="--srcdir=$${topdir}/binutils"; \ libsrcdir="$$s/binutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif binutils-bootstrap @@ -5778,15 +6573,13 @@ configure-stagefeedback-binutils: .PHONY: all-binutils maybe-all-binutils maybe-all-binutils: +@if gcc-bootstrap +all-binutils: stage_current +@endif gcc-bootstrap @if binutils TARGET-binutils=all maybe-all-binutils: all-binutils all-binutils: configure-binutils -@endif binutils -@if binutils-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif binutils-bootstrap -@if binutils @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -5810,18 +6603,22 @@ all-stage1-binutils: configure-stage1-binutils s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ $(TARGET-stage1-binutils) maybe-clean-stage1-binutils: clean-stage1-binutils clean-stage1: clean-stage1-binutils clean-stage1-binutils: - @[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-binutils/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-binutils/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/binutils && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean + clean @endif binutils-bootstrap @@ -5840,19 +6637,23 @@ all-stage2-binutils: configure-stage2-binutils $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage2-binutils) maybe-clean-stage2-binutils: clean-stage2-binutils clean-stage2: clean-stage2-binutils clean-stage2-binutils: - @[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-binutils/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-binutils/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/binutils && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif binutils-bootstrap @@ -5871,19 +6672,23 @@ all-stage3-binutils: configure-stage3-binutils $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage3-binutils) maybe-clean-stage3-binutils: clean-stage3-binutils clean-stage3: clean-stage3-binutils clean-stage3-binutils: - @[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-binutils/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-binutils/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/binutils && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif binutils-bootstrap @@ -5902,19 +6707,23 @@ all-stage4-binutils: configure-stage4-binutils $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage4-binutils) maybe-clean-stage4-binutils: clean-stage4-binutils clean-stage4: clean-stage4-binutils clean-stage4-binutils: - @[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-binutils/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-binutils/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/binutils && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif binutils-bootstrap @@ -5933,19 +6742,23 @@ all-stageprofile-binutils: configure-stageprofile-binutils $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stageprofile-binutils) maybe-clean-stageprofile-binutils: clean-stageprofile-binutils clean-stageprofile: clean-stageprofile-binutils clean-stageprofile-binutils: - @[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-binutils/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-binutils/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/binutils && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean + clean @endif binutils-bootstrap @@ -5964,19 +6777,23 @@ all-stagefeedback-binutils: configure-stagefeedback-binutils $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stagefeedback-binutils) maybe-clean-stagefeedback-binutils: clean-stagefeedback-binutils clean-stagefeedback: clean-stagefeedback-binutils clean-stagefeedback-binutils: - @[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-binutils/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-binutils/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/binutils && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean + clean @endif binutils-bootstrap @@ -6013,7 +6830,7 @@ install-binutils: installdirs @endif binutils -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-binutils info-binutils maybe-info-binutils: @@ -6065,6 +6882,31 @@ dvi-binutils: \ @endif binutils +.PHONY: maybe-pdf-binutils pdf-binutils +maybe-pdf-binutils: +@if binutils +maybe-pdf-binutils: pdf-binutils + +pdf-binutils: \ + configure-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in binutils" ; \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif binutils + .PHONY: maybe-html-binutils html-binutils maybe-html-binutils: @if binutils @@ -6141,6 +6983,32 @@ install-info-binutils: \ @endif binutils +.PHONY: maybe-install-pdf-binutils install-pdf-binutils +maybe-install-pdf-binutils: +@if binutils +maybe-install-pdf-binutils: install-pdf-binutils + +install-pdf-binutils: \ + configure-binutils \ + pdf-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in binutils" ; \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif binutils + .PHONY: maybe-install-html-binutils install-html-binutils maybe-install-html-binutils: @if binutils @@ -6292,6 +7160,9 @@ maintainer-clean-binutils: .PHONY: configure-bison maybe-configure-bison maybe-configure-bison: +@if gcc-bootstrap +configure-bison: stage_current +@endif gcc-bootstrap @if bison maybe-configure-bison: configure-bison configure-bison: @@ -6311,7 +7182,8 @@ configure-bison: srcdiroption="--srcdir=$${topdir}/bison"; \ libsrcdir="$$s/bison"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif bison @@ -6321,6 +7193,9 @@ configure-bison: .PHONY: all-bison maybe-all-bison maybe-all-bison: +@if gcc-bootstrap +all-bison: stage_current +@endif gcc-bootstrap @if bison TARGET-bison=all maybe-all-bison: all-bison @@ -6369,7 +7244,7 @@ install-bison: installdirs @endif bison -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-bison info-bison maybe-info-bison: @@ -6423,6 +7298,32 @@ dvi-bison: \ @endif bison +.PHONY: maybe-pdf-bison pdf-bison +maybe-pdf-bison: +@if bison +maybe-pdf-bison: pdf-bison + +pdf-bison: \ + configure-bison + @: $(MAKE); $(unstage) + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in bison" ; \ + (cd $(HOST_SUBDIR)/bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif bison + .PHONY: maybe-html-bison html-bison maybe-html-bison: @if bison @@ -6502,6 +7403,33 @@ install-info-bison: \ @endif bison +.PHONY: maybe-install-pdf-bison install-pdf-bison +maybe-install-pdf-bison: +@if bison +maybe-install-pdf-bison: install-pdf-bison + +install-pdf-bison: \ + configure-bison \ + pdf-bison + @: $(MAKE); $(unstage) + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in bison" ; \ + (cd $(HOST_SUBDIR)/bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif bison + .PHONY: maybe-install-html-bison install-html-bison maybe-install-html-bison: @if bison @@ -6659,6 +7587,9 @@ maintainer-clean-bison: .PHONY: configure-byacc maybe-configure-byacc maybe-configure-byacc: +@if gcc-bootstrap +configure-byacc: stage_current +@endif gcc-bootstrap @if byacc maybe-configure-byacc: configure-byacc configure-byacc: @@ -6678,7 +7609,8 @@ configure-byacc: srcdiroption="--srcdir=$${topdir}/byacc"; \ libsrcdir="$$s/byacc"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif byacc @@ -6688,6 +7620,9 @@ configure-byacc: .PHONY: all-byacc maybe-all-byacc maybe-all-byacc: +@if gcc-bootstrap +all-byacc: stage_current +@endif gcc-bootstrap @if byacc TARGET-byacc=all maybe-all-byacc: all-byacc @@ -6736,7 +7671,7 @@ install-byacc: installdirs @endif byacc -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-byacc info-byacc maybe-info-byacc: @@ -6790,6 +7725,32 @@ dvi-byacc: \ @endif byacc +.PHONY: maybe-pdf-byacc pdf-byacc +maybe-pdf-byacc: +@if byacc +maybe-pdf-byacc: pdf-byacc + +pdf-byacc: \ + configure-byacc + @: $(MAKE); $(unstage) + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in byacc" ; \ + (cd $(HOST_SUBDIR)/byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif byacc + .PHONY: maybe-html-byacc html-byacc maybe-html-byacc: @if byacc @@ -6869,6 +7830,33 @@ install-info-byacc: \ @endif byacc +.PHONY: maybe-install-pdf-byacc install-pdf-byacc +maybe-install-pdf-byacc: +@if byacc +maybe-install-pdf-byacc: install-pdf-byacc + +install-pdf-byacc: \ + configure-byacc \ + pdf-byacc + @: $(MAKE); $(unstage) + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in byacc" ; \ + (cd $(HOST_SUBDIR)/byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif byacc + .PHONY: maybe-install-html-byacc install-html-byacc maybe-install-html-byacc: @if byacc @@ -7026,6 +8014,9 @@ maintainer-clean-byacc: .PHONY: configure-bzip2 maybe-configure-bzip2 maybe-configure-bzip2: +@if gcc-bootstrap +configure-bzip2: stage_current +@endif gcc-bootstrap @if bzip2 maybe-configure-bzip2: configure-bzip2 configure-bzip2: @@ -7045,7 +8036,8 @@ configure-bzip2: srcdiroption="--srcdir=$${topdir}/bzip2"; \ libsrcdir="$$s/bzip2"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif bzip2 @@ -7055,6 +8047,9 @@ configure-bzip2: .PHONY: all-bzip2 maybe-all-bzip2 maybe-all-bzip2: +@if gcc-bootstrap +all-bzip2: stage_current +@endif gcc-bootstrap @if bzip2 TARGET-bzip2=all maybe-all-bzip2: all-bzip2 @@ -7100,7 +8095,7 @@ install-bzip2: installdirs @endif bzip2 -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-bzip2 info-bzip2 maybe-info-bzip2: @@ -7154,6 +8149,32 @@ dvi-bzip2: \ @endif bzip2 +.PHONY: maybe-pdf-bzip2 pdf-bzip2 +maybe-pdf-bzip2: +@if bzip2 +maybe-pdf-bzip2: pdf-bzip2 + +pdf-bzip2: \ + configure-bzip2 + @: $(MAKE); $(unstage) + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in bzip2" ; \ + (cd $(HOST_SUBDIR)/bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif bzip2 + .PHONY: maybe-html-bzip2 html-bzip2 maybe-html-bzip2: @if bzip2 @@ -7233,6 +8254,33 @@ install-info-bzip2: \ @endif bzip2 +.PHONY: maybe-install-pdf-bzip2 install-pdf-bzip2 +maybe-install-pdf-bzip2: +@if bzip2 +maybe-install-pdf-bzip2: install-pdf-bzip2 + +install-pdf-bzip2: \ + configure-bzip2 \ + pdf-bzip2 + @: $(MAKE); $(unstage) + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in bzip2" ; \ + (cd $(HOST_SUBDIR)/bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif bzip2 + .PHONY: maybe-install-html-bzip2 install-html-bzip2 maybe-install-html-bzip2: @if bzip2 @@ -7390,6 +8438,9 @@ maintainer-clean-bzip2: .PHONY: configure-dejagnu maybe-configure-dejagnu maybe-configure-dejagnu: +@if gcc-bootstrap +configure-dejagnu: stage_current +@endif gcc-bootstrap @if dejagnu maybe-configure-dejagnu: configure-dejagnu configure-dejagnu: @@ -7409,7 +8460,8 @@ configure-dejagnu: srcdiroption="--srcdir=$${topdir}/dejagnu"; \ libsrcdir="$$s/dejagnu"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif dejagnu @@ -7419,6 +8471,9 @@ configure-dejagnu: .PHONY: all-dejagnu maybe-all-dejagnu maybe-all-dejagnu: +@if gcc-bootstrap +all-dejagnu: stage_current +@endif gcc-bootstrap @if dejagnu TARGET-dejagnu=all maybe-all-dejagnu: all-dejagnu @@ -7464,7 +8519,7 @@ install-dejagnu: installdirs @endif dejagnu -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-dejagnu info-dejagnu maybe-info-dejagnu: @@ -7518,6 +8573,32 @@ dvi-dejagnu: \ @endif dejagnu +.PHONY: maybe-pdf-dejagnu pdf-dejagnu +maybe-pdf-dejagnu: +@if dejagnu +maybe-pdf-dejagnu: pdf-dejagnu + +pdf-dejagnu: \ + configure-dejagnu + @: $(MAKE); $(unstage) + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in dejagnu" ; \ + (cd $(HOST_SUBDIR)/dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif dejagnu + .PHONY: maybe-html-dejagnu html-dejagnu maybe-html-dejagnu: @if dejagnu @@ -7597,6 +8678,33 @@ install-info-dejagnu: \ @endif dejagnu +.PHONY: maybe-install-pdf-dejagnu install-pdf-dejagnu +maybe-install-pdf-dejagnu: +@if dejagnu +maybe-install-pdf-dejagnu: install-pdf-dejagnu + +install-pdf-dejagnu: \ + configure-dejagnu \ + pdf-dejagnu + @: $(MAKE); $(unstage) + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in dejagnu" ; \ + (cd $(HOST_SUBDIR)/dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif dejagnu + .PHONY: maybe-install-html-dejagnu install-html-dejagnu maybe-install-html-dejagnu: @if dejagnu @@ -7754,6 +8862,9 @@ maintainer-clean-dejagnu: .PHONY: configure-diff maybe-configure-diff maybe-configure-diff: +@if gcc-bootstrap +configure-diff: stage_current +@endif gcc-bootstrap @if diff maybe-configure-diff: configure-diff configure-diff: @@ -7773,7 +8884,8 @@ configure-diff: srcdiroption="--srcdir=$${topdir}/diff"; \ libsrcdir="$$s/diff"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif diff @@ -7783,6 +8895,9 @@ configure-diff: .PHONY: all-diff maybe-all-diff maybe-all-diff: +@if gcc-bootstrap +all-diff: stage_current +@endif gcc-bootstrap @if diff TARGET-diff=all maybe-all-diff: all-diff @@ -7828,7 +8943,7 @@ install-diff: installdirs @endif diff -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-diff info-diff maybe-info-diff: @@ -7882,6 +8997,32 @@ dvi-diff: \ @endif diff +.PHONY: maybe-pdf-diff pdf-diff +maybe-pdf-diff: +@if diff +maybe-pdf-diff: pdf-diff + +pdf-diff: \ + configure-diff + @: $(MAKE); $(unstage) + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in diff" ; \ + (cd $(HOST_SUBDIR)/diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif diff + .PHONY: maybe-html-diff html-diff maybe-html-diff: @if diff @@ -7961,6 +9102,33 @@ install-info-diff: \ @endif diff +.PHONY: maybe-install-pdf-diff install-pdf-diff +maybe-install-pdf-diff: +@if diff +maybe-install-pdf-diff: install-pdf-diff + +install-pdf-diff: \ + configure-diff \ + pdf-diff + @: $(MAKE); $(unstage) + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in diff" ; \ + (cd $(HOST_SUBDIR)/diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif diff + .PHONY: maybe-install-html-diff install-html-diff maybe-install-html-diff: @if diff @@ -8118,6 +9286,9 @@ maintainer-clean-diff: .PHONY: configure-dosutils maybe-configure-dosutils maybe-configure-dosutils: +@if gcc-bootstrap +configure-dosutils: stage_current +@endif gcc-bootstrap @if dosutils maybe-configure-dosutils: configure-dosutils configure-dosutils: @@ -8137,7 +9308,8 @@ configure-dosutils: srcdiroption="--srcdir=$${topdir}/dosutils"; \ libsrcdir="$$s/dosutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif dosutils @@ -8147,6 +9319,9 @@ configure-dosutils: .PHONY: all-dosutils maybe-all-dosutils maybe-all-dosutils: +@if gcc-bootstrap +all-dosutils: stage_current +@endif gcc-bootstrap @if dosutils TARGET-dosutils=all maybe-all-dosutils: all-dosutils @@ -8186,7 +9361,7 @@ install-dosutils: installdirs @endif dosutils -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-dosutils info-dosutils maybe-info-dosutils: @@ -8240,6 +9415,32 @@ dvi-dosutils: \ @endif dosutils +.PHONY: maybe-pdf-dosutils pdf-dosutils +maybe-pdf-dosutils: +@if dosutils +maybe-pdf-dosutils: pdf-dosutils + +pdf-dosutils: \ + configure-dosutils + @: $(MAKE); $(unstage) + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in dosutils" ; \ + (cd $(HOST_SUBDIR)/dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif dosutils + .PHONY: maybe-html-dosutils html-dosutils maybe-html-dosutils: @if dosutils @@ -8319,6 +9520,33 @@ install-info-dosutils: \ @endif dosutils +.PHONY: maybe-install-pdf-dosutils install-pdf-dosutils +maybe-install-pdf-dosutils: +@if dosutils +maybe-install-pdf-dosutils: install-pdf-dosutils + +install-pdf-dosutils: \ + configure-dosutils \ + pdf-dosutils + @: $(MAKE); $(unstage) + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in dosutils" ; \ + (cd $(HOST_SUBDIR)/dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif dosutils + .PHONY: maybe-install-html-dosutils install-html-dosutils maybe-install-html-dosutils: @if dosutils @@ -8476,6 +9704,9 @@ maintainer-clean-dosutils: .PHONY: configure-etc maybe-configure-etc maybe-configure-etc: +@if gcc-bootstrap +configure-etc: stage_current +@endif gcc-bootstrap @if etc maybe-configure-etc: configure-etc configure-etc: @@ -8495,7 +9726,8 @@ configure-etc: srcdiroption="--srcdir=$${topdir}/etc"; \ libsrcdir="$$s/etc"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif etc @@ -8505,6 +9737,9 @@ configure-etc: .PHONY: all-etc maybe-all-etc maybe-all-etc: +@if gcc-bootstrap +all-etc: stage_current +@endif gcc-bootstrap @if etc TARGET-etc=all maybe-all-etc: all-etc @@ -8550,7 +9785,7 @@ install-etc: installdirs @endif etc -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-etc info-etc maybe-info-etc: @@ -8604,6 +9839,32 @@ dvi-etc: \ @endif etc +.PHONY: maybe-pdf-etc pdf-etc +maybe-pdf-etc: +@if etc +maybe-pdf-etc: pdf-etc + +pdf-etc: \ + configure-etc + @: $(MAKE); $(unstage) + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in etc" ; \ + (cd $(HOST_SUBDIR)/etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif etc + .PHONY: maybe-html-etc html-etc maybe-html-etc: @if etc @@ -8683,6 +9944,33 @@ install-info-etc: \ @endif etc +.PHONY: maybe-install-pdf-etc install-pdf-etc +maybe-install-pdf-etc: +@if etc +maybe-install-pdf-etc: install-pdf-etc + +install-pdf-etc: \ + configure-etc \ + pdf-etc + @: $(MAKE); $(unstage) + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in etc" ; \ + (cd $(HOST_SUBDIR)/etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif etc + .PHONY: maybe-install-html-etc install-html-etc maybe-install-html-etc: @if etc @@ -8840,6 +10128,9 @@ maintainer-clean-etc: .PHONY: configure-fastjar maybe-configure-fastjar maybe-configure-fastjar: +@if gcc-bootstrap +configure-fastjar: stage_current +@endif gcc-bootstrap @if fastjar maybe-configure-fastjar: configure-fastjar configure-fastjar: @@ -8859,7 +10150,8 @@ configure-fastjar: srcdiroption="--srcdir=$${topdir}/fastjar"; \ libsrcdir="$$s/fastjar"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif fastjar @@ -8869,6 +10161,9 @@ configure-fastjar: .PHONY: all-fastjar maybe-all-fastjar maybe-all-fastjar: +@if gcc-bootstrap +all-fastjar: stage_current +@endif gcc-bootstrap @if fastjar TARGET-fastjar=all maybe-all-fastjar: all-fastjar @@ -8917,7 +10212,7 @@ install-fastjar: installdirs @endif fastjar -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-fastjar info-fastjar maybe-info-fastjar: @@ -8971,6 +10266,32 @@ dvi-fastjar: \ @endif fastjar +.PHONY: maybe-pdf-fastjar pdf-fastjar +maybe-pdf-fastjar: +@if fastjar +maybe-pdf-fastjar: pdf-fastjar + +pdf-fastjar: \ + configure-fastjar + @: $(MAKE); $(unstage) + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in fastjar" ; \ + (cd $(HOST_SUBDIR)/fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif fastjar + .PHONY: maybe-html-fastjar html-fastjar maybe-html-fastjar: @if fastjar @@ -9050,6 +10371,33 @@ install-info-fastjar: \ @endif fastjar +.PHONY: maybe-install-pdf-fastjar install-pdf-fastjar +maybe-install-pdf-fastjar: +@if fastjar +maybe-install-pdf-fastjar: install-pdf-fastjar + +install-pdf-fastjar: \ + configure-fastjar \ + pdf-fastjar + @: $(MAKE); $(unstage) + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in fastjar" ; \ + (cd $(HOST_SUBDIR)/fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif fastjar + .PHONY: maybe-install-html-fastjar install-html-fastjar maybe-install-html-fastjar: @if fastjar @@ -9207,6 +10555,9 @@ maintainer-clean-fastjar: .PHONY: configure-fileutils maybe-configure-fileutils maybe-configure-fileutils: +@if gcc-bootstrap +configure-fileutils: stage_current +@endif gcc-bootstrap @if fileutils maybe-configure-fileutils: configure-fileutils configure-fileutils: @@ -9226,7 +10577,8 @@ configure-fileutils: srcdiroption="--srcdir=$${topdir}/fileutils"; \ libsrcdir="$$s/fileutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif fileutils @@ -9236,6 +10588,9 @@ configure-fileutils: .PHONY: all-fileutils maybe-all-fileutils maybe-all-fileutils: +@if gcc-bootstrap +all-fileutils: stage_current +@endif gcc-bootstrap @if fileutils TARGET-fileutils=all maybe-all-fileutils: all-fileutils @@ -9281,7 +10636,7 @@ install-fileutils: installdirs @endif fileutils -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-fileutils info-fileutils maybe-info-fileutils: @@ -9335,6 +10690,32 @@ dvi-fileutils: \ @endif fileutils +.PHONY: maybe-pdf-fileutils pdf-fileutils +maybe-pdf-fileutils: +@if fileutils +maybe-pdf-fileutils: pdf-fileutils + +pdf-fileutils: \ + configure-fileutils + @: $(MAKE); $(unstage) + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in fileutils" ; \ + (cd $(HOST_SUBDIR)/fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif fileutils + .PHONY: maybe-html-fileutils html-fileutils maybe-html-fileutils: @if fileutils @@ -9414,6 +10795,33 @@ install-info-fileutils: \ @endif fileutils +.PHONY: maybe-install-pdf-fileutils install-pdf-fileutils +maybe-install-pdf-fileutils: +@if fileutils +maybe-install-pdf-fileutils: install-pdf-fileutils + +install-pdf-fileutils: \ + configure-fileutils \ + pdf-fileutils + @: $(MAKE); $(unstage) + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in fileutils" ; \ + (cd $(HOST_SUBDIR)/fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif fileutils + .PHONY: maybe-install-html-fileutils install-html-fileutils maybe-install-html-fileutils: @if fileutils @@ -9571,6 +10979,9 @@ maintainer-clean-fileutils: .PHONY: configure-findutils maybe-configure-findutils maybe-configure-findutils: +@if gcc-bootstrap +configure-findutils: stage_current +@endif gcc-bootstrap @if findutils maybe-configure-findutils: configure-findutils configure-findutils: @@ -9590,7 +11001,8 @@ configure-findutils: srcdiroption="--srcdir=$${topdir}/findutils"; \ libsrcdir="$$s/findutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif findutils @@ -9600,6 +11012,9 @@ configure-findutils: .PHONY: all-findutils maybe-all-findutils maybe-all-findutils: +@if gcc-bootstrap +all-findutils: stage_current +@endif gcc-bootstrap @if findutils TARGET-findutils=all maybe-all-findutils: all-findutils @@ -9645,7 +11060,7 @@ install-findutils: installdirs @endif findutils -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-findutils info-findutils maybe-info-findutils: @@ -9699,6 +11114,32 @@ dvi-findutils: \ @endif findutils +.PHONY: maybe-pdf-findutils pdf-findutils +maybe-pdf-findutils: +@if findutils +maybe-pdf-findutils: pdf-findutils + +pdf-findutils: \ + configure-findutils + @: $(MAKE); $(unstage) + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in findutils" ; \ + (cd $(HOST_SUBDIR)/findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif findutils + .PHONY: maybe-html-findutils html-findutils maybe-html-findutils: @if findutils @@ -9778,6 +11219,33 @@ install-info-findutils: \ @endif findutils +.PHONY: maybe-install-pdf-findutils install-pdf-findutils +maybe-install-pdf-findutils: +@if findutils +maybe-install-pdf-findutils: install-pdf-findutils + +install-pdf-findutils: \ + configure-findutils \ + pdf-findutils + @: $(MAKE); $(unstage) + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in findutils" ; \ + (cd $(HOST_SUBDIR)/findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif findutils + .PHONY: maybe-install-html-findutils install-html-findutils maybe-install-html-findutils: @if findutils @@ -9935,6 +11403,9 @@ maintainer-clean-findutils: .PHONY: configure-find maybe-configure-find maybe-configure-find: +@if gcc-bootstrap +configure-find: stage_current +@endif gcc-bootstrap @if find maybe-configure-find: configure-find configure-find: @@ -9954,7 +11425,8 @@ configure-find: srcdiroption="--srcdir=$${topdir}/find"; \ libsrcdir="$$s/find"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif find @@ -9964,6 +11436,9 @@ configure-find: .PHONY: all-find maybe-all-find maybe-all-find: +@if gcc-bootstrap +all-find: stage_current +@endif gcc-bootstrap @if find TARGET-find=all maybe-all-find: all-find @@ -10009,7 +11484,7 @@ install-find: installdirs @endif find -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-find info-find maybe-info-find: @@ -10063,6 +11538,32 @@ dvi-find: \ @endif find +.PHONY: maybe-pdf-find pdf-find +maybe-pdf-find: +@if find +maybe-pdf-find: pdf-find + +pdf-find: \ + configure-find + @: $(MAKE); $(unstage) + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in find" ; \ + (cd $(HOST_SUBDIR)/find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif find + .PHONY: maybe-html-find html-find maybe-html-find: @if find @@ -10142,6 +11643,33 @@ install-info-find: \ @endif find +.PHONY: maybe-install-pdf-find install-pdf-find +maybe-install-pdf-find: +@if find +maybe-install-pdf-find: install-pdf-find + +install-pdf-find: \ + configure-find \ + pdf-find + @: $(MAKE); $(unstage) + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in find" ; \ + (cd $(HOST_SUBDIR)/find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif find + .PHONY: maybe-install-html-find install-html-find maybe-install-html-find: @if find @@ -10299,6 +11827,9 @@ maintainer-clean-find: .PHONY: configure-fixincludes maybe-configure-fixincludes maybe-configure-fixincludes: +@if gcc-bootstrap +configure-fixincludes: stage_current +@endif gcc-bootstrap @if fixincludes maybe-configure-fixincludes: configure-fixincludes configure-fixincludes: @@ -10318,7 +11849,8 @@ configure-fixincludes: srcdiroption="--srcdir=$${topdir}/fixincludes"; \ libsrcdir="$$s/fixincludes"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif fixincludes @@ -10328,6 +11860,9 @@ configure-fixincludes: .PHONY: all-fixincludes maybe-all-fixincludes maybe-all-fixincludes: +@if gcc-bootstrap +all-fixincludes: stage_current +@endif gcc-bootstrap @if fixincludes TARGET-fixincludes=all maybe-all-fixincludes: all-fixincludes @@ -10373,15 +11908,31 @@ install-fixincludes: installdirs @endif fixincludes -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-fixincludes info-fixincludes maybe-info-fixincludes: @if fixincludes maybe-info-fixincludes: info-fixincludes -# fixincludes doesn't support info. -info-fixincludes: +info-fixincludes: \ + configure-fixincludes + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 @endif fixincludes @@ -10390,8 +11941,50 @@ maybe-dvi-fixincludes: @if fixincludes maybe-dvi-fixincludes: dvi-fixincludes -# fixincludes doesn't support dvi. -dvi-fixincludes: +dvi-fixincludes: \ + configure-fixincludes + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + +@endif fixincludes + +.PHONY: maybe-pdf-fixincludes pdf-fixincludes +maybe-pdf-fixincludes: +@if fixincludes +maybe-pdf-fixincludes: pdf-fixincludes + +pdf-fixincludes: \ + configure-fixincludes + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 @endif fixincludes @@ -10436,8 +12029,52 @@ maybe-install-info-fixincludes: @if fixincludes maybe-install-info-fixincludes: install-info-fixincludes -# fixincludes doesn't support install-info. -install-info-fixincludes: +install-info-fixincludes: \ + configure-fixincludes \ + info-fixincludes + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + +@endif fixincludes + +.PHONY: maybe-install-pdf-fixincludes install-pdf-fixincludes +maybe-install-pdf-fixincludes: +@if fixincludes +maybe-install-pdf-fixincludes: install-pdf-fixincludes + +install-pdf-fixincludes: \ + configure-fixincludes \ + pdf-fixincludes + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 @endif fixincludes @@ -10473,8 +12110,24 @@ maybe-installcheck-fixincludes: @if fixincludes maybe-installcheck-fixincludes: installcheck-fixincludes -# fixincludes doesn't support installcheck. -installcheck-fixincludes: +installcheck-fixincludes: \ + configure-fixincludes + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 @endif fixincludes @@ -10582,6 +12235,9 @@ maintainer-clean-fixincludes: .PHONY: configure-flex maybe-configure-flex maybe-configure-flex: +@if gcc-bootstrap +configure-flex: stage_current +@endif gcc-bootstrap @if flex maybe-configure-flex: configure-flex configure-flex: @@ -10601,7 +12257,8 @@ configure-flex: srcdiroption="--srcdir=$${topdir}/flex"; \ libsrcdir="$$s/flex"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif flex @@ -10611,6 +12268,9 @@ configure-flex: .PHONY: all-flex maybe-all-flex maybe-all-flex: +@if gcc-bootstrap +all-flex: stage_current +@endif gcc-bootstrap @if flex TARGET-flex=all maybe-all-flex: all-flex @@ -10659,7 +12319,7 @@ install-flex: installdirs @endif flex -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-flex info-flex maybe-info-flex: @@ -10713,6 +12373,32 @@ dvi-flex: \ @endif flex +.PHONY: maybe-pdf-flex pdf-flex +maybe-pdf-flex: +@if flex +maybe-pdf-flex: pdf-flex + +pdf-flex: \ + configure-flex + @: $(MAKE); $(unstage) + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in flex" ; \ + (cd $(HOST_SUBDIR)/flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif flex + .PHONY: maybe-html-flex html-flex maybe-html-flex: @if flex @@ -10792,6 +12478,33 @@ install-info-flex: \ @endif flex +.PHONY: maybe-install-pdf-flex install-pdf-flex +maybe-install-pdf-flex: +@if flex +maybe-install-pdf-flex: install-pdf-flex + +install-pdf-flex: \ + configure-flex \ + pdf-flex + @: $(MAKE); $(unstage) + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in flex" ; \ + (cd $(HOST_SUBDIR)/flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif flex + .PHONY: maybe-install-html-flex install-html-flex maybe-install-html-flex: @if flex @@ -10949,14 +12662,12 @@ maintainer-clean-flex: .PHONY: configure-gas maybe-configure-gas maybe-configure-gas: +@if gcc-bootstrap +configure-gas: stage_current +@endif gcc-bootstrap @if gas maybe-configure-gas: configure-gas configure-gas: -@endif gas -@if gas-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif gas-bootstrap -@if gas @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ @@ -10972,7 +12683,8 @@ configure-gas: srcdiroption="--srcdir=$${topdir}/gas"; \ libsrcdir="$$s/gas"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif gas @@ -10989,6 +12701,8 @@ configure-stage1-gas: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/gas ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ cd $(HOST_SUBDIR)/gas || exit 1; \ @@ -11000,8 +12714,10 @@ configure-stage1-gas: srcdiroption="--srcdir=$${topdir}/gas"; \ libsrcdir="$$s/gas"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif gas-bootstrap .PHONY: configure-stage2-gas maybe-configure-stage2-gas @@ -11016,6 +12732,8 @@ configure-stage2-gas: test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/gas ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ cd $(HOST_SUBDIR)/gas || exit 1; \ @@ -11027,7 +12745,9 @@ configure-stage2-gas: srcdiroption="--srcdir=$${topdir}/gas"; \ libsrcdir="$$s/gas"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif gas-bootstrap @@ -11043,6 +12763,8 @@ configure-stage3-gas: test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/gas ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ cd $(HOST_SUBDIR)/gas || exit 1; \ @@ -11054,7 +12776,9 @@ configure-stage3-gas: srcdiroption="--srcdir=$${topdir}/gas"; \ libsrcdir="$$s/gas"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif gas-bootstrap @@ -11070,6 +12794,8 @@ configure-stage4-gas: test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/gas ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ cd $(HOST_SUBDIR)/gas || exit 1; \ @@ -11081,7 +12807,9 @@ configure-stage4-gas: srcdiroption="--srcdir=$${topdir}/gas"; \ libsrcdir="$$s/gas"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif gas-bootstrap @@ -11097,6 +12825,8 @@ configure-stageprofile-gas: test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/gas ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ cd $(HOST_SUBDIR)/gas || exit 1; \ @@ -11108,7 +12838,9 @@ configure-stageprofile-gas: srcdiroption="--srcdir=$${topdir}/gas"; \ libsrcdir="$$s/gas"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif gas-bootstrap @@ -11124,6 +12856,8 @@ configure-stagefeedback-gas: test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/gas ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ cd $(HOST_SUBDIR)/gas || exit 1; \ @@ -11135,7 +12869,9 @@ configure-stagefeedback-gas: srcdiroption="--srcdir=$${topdir}/gas"; \ libsrcdir="$$s/gas"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif gas-bootstrap @@ -11145,15 +12881,13 @@ configure-stagefeedback-gas: .PHONY: all-gas maybe-all-gas maybe-all-gas: +@if gcc-bootstrap +all-gas: stage_current +@endif gcc-bootstrap @if gas TARGET-gas=all maybe-all-gas: all-gas all-gas: configure-gas -@endif gas -@if gas-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif gas-bootstrap -@if gas @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -11177,18 +12911,22 @@ all-stage1-gas: configure-stage1-gas s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ $(TARGET-stage1-gas) maybe-clean-stage1-gas: clean-stage1-gas clean-stage1: clean-stage1-gas clean-stage1-gas: - @[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-gas/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-gas/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/gas && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean + clean @endif gas-bootstrap @@ -11207,19 +12945,23 @@ all-stage2-gas: configure-stage2-gas $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage2-gas) maybe-clean-stage2-gas: clean-stage2-gas clean-stage2: clean-stage2-gas clean-stage2-gas: - @[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-gas/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-gas/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/gas && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif gas-bootstrap @@ -11238,19 +12980,23 @@ all-stage3-gas: configure-stage3-gas $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage3-gas) maybe-clean-stage3-gas: clean-stage3-gas clean-stage3: clean-stage3-gas clean-stage3-gas: - @[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-gas/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-gas/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/gas && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif gas-bootstrap @@ -11269,19 +13015,23 @@ all-stage4-gas: configure-stage4-gas $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage4-gas) maybe-clean-stage4-gas: clean-stage4-gas clean-stage4: clean-stage4-gas clean-stage4-gas: - @[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-gas/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-gas/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/gas && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif gas-bootstrap @@ -11300,19 +13050,23 @@ all-stageprofile-gas: configure-stageprofile-gas $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stageprofile-gas) maybe-clean-stageprofile-gas: clean-stageprofile-gas clean-stageprofile: clean-stageprofile-gas clean-stageprofile-gas: - @[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-gas/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-gas/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/gas && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean + clean @endif gas-bootstrap @@ -11331,19 +13085,23 @@ all-stagefeedback-gas: configure-stagefeedback-gas $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stagefeedback-gas) maybe-clean-stagefeedback-gas: clean-stagefeedback-gas clean-stagefeedback: clean-stagefeedback-gas clean-stagefeedback-gas: - @[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-gas/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-gas/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/gas && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean + clean @endif gas-bootstrap @@ -11380,7 +13138,7 @@ install-gas: installdirs @endif gas -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-gas info-gas maybe-info-gas: @@ -11432,6 +13190,31 @@ dvi-gas: \ @endif gas +.PHONY: maybe-pdf-gas pdf-gas +maybe-pdf-gas: +@if gas +maybe-pdf-gas: pdf-gas + +pdf-gas: \ + configure-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gas" ; \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif gas + .PHONY: maybe-html-gas html-gas maybe-html-gas: @if gas @@ -11508,6 +13291,32 @@ install-info-gas: \ @endif gas +.PHONY: maybe-install-pdf-gas install-pdf-gas +maybe-install-pdf-gas: +@if gas +maybe-install-pdf-gas: install-pdf-gas + +install-pdf-gas: \ + configure-gas \ + pdf-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gas" ; \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif gas + .PHONY: maybe-install-html-gas install-html-gas maybe-install-html-gas: @if gas @@ -11659,14 +13468,12 @@ maintainer-clean-gas: .PHONY: configure-gcc maybe-configure-gcc maybe-configure-gcc: +@if gcc-bootstrap +configure-gcc: stage_current +@endif gcc-bootstrap @if gcc maybe-configure-gcc: configure-gcc configure-gcc: -@endif gcc -@if gcc-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif gcc-bootstrap -@if gcc @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ @@ -11682,7 +13489,8 @@ configure-gcc: srcdiroption="--srcdir=$${topdir}/gcc"; \ libsrcdir="$$s/gcc"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif gcc @@ -11699,6 +13507,8 @@ configure-stage1-gcc: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/gcc ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ cd $(HOST_SUBDIR)/gcc || exit 1; \ @@ -11710,8 +13520,10 @@ configure-stage1-gcc: srcdiroption="--srcdir=$${topdir}/gcc"; \ libsrcdir="$$s/gcc"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif gcc-bootstrap .PHONY: configure-stage2-gcc maybe-configure-stage2-gcc @@ -11726,6 +13538,8 @@ configure-stage2-gcc: test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/gcc ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ cd $(HOST_SUBDIR)/gcc || exit 1; \ @@ -11737,7 +13551,9 @@ configure-stage2-gcc: srcdiroption="--srcdir=$${topdir}/gcc"; \ libsrcdir="$$s/gcc"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif gcc-bootstrap @@ -11753,6 +13569,8 @@ configure-stage3-gcc: test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/gcc ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ cd $(HOST_SUBDIR)/gcc || exit 1; \ @@ -11764,7 +13582,9 @@ configure-stage3-gcc: srcdiroption="--srcdir=$${topdir}/gcc"; \ libsrcdir="$$s/gcc"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif gcc-bootstrap @@ -11780,6 +13600,8 @@ configure-stage4-gcc: test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/gcc ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ cd $(HOST_SUBDIR)/gcc || exit 1; \ @@ -11791,7 +13613,9 @@ configure-stage4-gcc: srcdiroption="--srcdir=$${topdir}/gcc"; \ libsrcdir="$$s/gcc"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif gcc-bootstrap @@ -11807,6 +13631,8 @@ configure-stageprofile-gcc: test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/gcc ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ cd $(HOST_SUBDIR)/gcc || exit 1; \ @@ -11818,7 +13644,9 @@ configure-stageprofile-gcc: srcdiroption="--srcdir=$${topdir}/gcc"; \ libsrcdir="$$s/gcc"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif gcc-bootstrap @@ -11834,6 +13662,8 @@ configure-stagefeedback-gcc: test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/gcc ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ cd $(HOST_SUBDIR)/gcc || exit 1; \ @@ -11845,7 +13675,9 @@ configure-stagefeedback-gcc: srcdiroption="--srcdir=$${topdir}/gcc"; \ libsrcdir="$$s/gcc"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif gcc-bootstrap @@ -11855,15 +13687,13 @@ configure-stagefeedback-gcc: .PHONY: all-gcc maybe-all-gcc maybe-all-gcc: -@if gcc -TARGET-gcc=`if [ -f stage_last ]; then echo quickstrap ; else echo all; fi` -maybe-all-gcc: all-gcc -all-gcc: configure-gcc -@endif gcc @if gcc-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi +all-gcc: stage_current @endif gcc-bootstrap @if gcc +TARGET-gcc=all +maybe-all-gcc: all-gcc +all-gcc: configure-gcc @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -11887,18 +13717,22 @@ all-stage1-gcc: configure-stage1-gcc s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" $(EXTRA_GCC_FLAGS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" $(EXTRA_GCC_FLAGS) \ $(TARGET-stage1-gcc) maybe-clean-stage1-gcc: clean-stage1-gcc clean-stage1: clean-stage1-gcc clean-stage1-gcc: - @[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-gcc/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-gcc/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/gcc && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" $(EXTRA_GCC_FLAGS) clean + $(EXTRA_GCC_FLAGS) clean @endif gcc-bootstrap @@ -11917,19 +13751,23 @@ all-stage2-gcc: configure-stage2-gcc $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ $(TARGET-stage2-gcc) maybe-clean-stage2-gcc: clean-stage2-gcc clean-stage2: clean-stage2-gcc clean-stage2-gcc: - @[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-gcc/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-gcc/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/gcc && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - $(EXTRA_GCC_FLAGS) clean + $(EXTRA_GCC_FLAGS) clean @endif gcc-bootstrap @@ -11948,19 +13786,23 @@ all-stage3-gcc: configure-stage3-gcc $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ $(TARGET-stage3-gcc) maybe-clean-stage3-gcc: clean-stage3-gcc clean-stage3: clean-stage3-gcc clean-stage3-gcc: - @[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-gcc/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-gcc/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/gcc && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - $(EXTRA_GCC_FLAGS) clean + $(EXTRA_GCC_FLAGS) clean @endif gcc-bootstrap @@ -11979,19 +13821,23 @@ all-stage4-gcc: configure-stage4-gcc $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ $(TARGET-stage4-gcc) maybe-clean-stage4-gcc: clean-stage4-gcc clean-stage4: clean-stage4-gcc clean-stage4-gcc: - @[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-gcc/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-gcc/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/gcc && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - $(EXTRA_GCC_FLAGS) clean + $(EXTRA_GCC_FLAGS) clean @endif gcc-bootstrap @@ -12010,19 +13856,23 @@ all-stageprofile-gcc: configure-stageprofile-gcc $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(EXTRA_GCC_FLAGS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ $(TARGET-stageprofile-gcc) maybe-clean-stageprofile-gcc: clean-stageprofile-gcc clean-stageprofile: clean-stageprofile-gcc clean-stageprofile-gcc: - @[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-gcc/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-gcc/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/gcc && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(EXTRA_GCC_FLAGS) clean + $(EXTRA_GCC_FLAGS) clean @endif gcc-bootstrap @@ -12041,19 +13891,23 @@ all-stagefeedback-gcc: configure-stagefeedback-gcc $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(EXTRA_GCC_FLAGS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ $(TARGET-stagefeedback-gcc) maybe-clean-stagefeedback-gcc: clean-stagefeedback-gcc clean-stagefeedback: clean-stagefeedback-gcc clean-stagefeedback-gcc: - @[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-gcc/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-gcc/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/gcc && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(EXTRA_GCC_FLAGS) clean + $(EXTRA_GCC_FLAGS) clean @endif gcc-bootstrap @@ -12090,7 +13944,7 @@ install-gcc: installdirs @endif gcc -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-gcc info-gcc maybe-info-gcc: @@ -12142,6 +13996,31 @@ dvi-gcc: \ @endif gcc +.PHONY: maybe-pdf-gcc pdf-gcc +maybe-pdf-gcc: +@if gcc +maybe-pdf-gcc: pdf-gcc + +pdf-gcc: \ + configure-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gcc" ; \ + (cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif gcc + .PHONY: maybe-html-gcc html-gcc maybe-html-gcc: @if gcc @@ -12218,6 +14097,32 @@ install-info-gcc: \ @endif gcc +.PHONY: maybe-install-pdf-gcc install-pdf-gcc +maybe-install-pdf-gcc: +@if gcc +maybe-install-pdf-gcc: install-pdf-gcc + +install-pdf-gcc: \ + configure-gcc \ + pdf-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gcc" ; \ + (cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif gcc + .PHONY: maybe-install-html-gcc install-html-gcc maybe-install-html-gcc: @if gcc @@ -12369,6 +14274,9 @@ maintainer-clean-gcc: .PHONY: configure-gawk maybe-configure-gawk maybe-configure-gawk: +@if gcc-bootstrap +configure-gawk: stage_current +@endif gcc-bootstrap @if gawk maybe-configure-gawk: configure-gawk configure-gawk: @@ -12388,7 +14296,8 @@ configure-gawk: srcdiroption="--srcdir=$${topdir}/gawk"; \ libsrcdir="$$s/gawk"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif gawk @@ -12398,6 +14307,9 @@ configure-gawk: .PHONY: all-gawk maybe-all-gawk maybe-all-gawk: +@if gcc-bootstrap +all-gawk: stage_current +@endif gcc-bootstrap @if gawk TARGET-gawk=all maybe-all-gawk: all-gawk @@ -12443,7 +14355,7 @@ install-gawk: installdirs @endif gawk -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-gawk info-gawk maybe-info-gawk: @@ -12497,6 +14409,32 @@ dvi-gawk: \ @endif gawk +.PHONY: maybe-pdf-gawk pdf-gawk +maybe-pdf-gawk: +@if gawk +maybe-pdf-gawk: pdf-gawk + +pdf-gawk: \ + configure-gawk + @: $(MAKE); $(unstage) + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gawk" ; \ + (cd $(HOST_SUBDIR)/gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif gawk + .PHONY: maybe-html-gawk html-gawk maybe-html-gawk: @if gawk @@ -12576,6 +14514,33 @@ install-info-gawk: \ @endif gawk +.PHONY: maybe-install-pdf-gawk install-pdf-gawk +maybe-install-pdf-gawk: +@if gawk +maybe-install-pdf-gawk: install-pdf-gawk + +install-pdf-gawk: \ + configure-gawk \ + pdf-gawk + @: $(MAKE); $(unstage) + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gawk" ; \ + (cd $(HOST_SUBDIR)/gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif gawk + .PHONY: maybe-install-html-gawk install-html-gawk maybe-install-html-gawk: @if gawk @@ -12733,6 +14698,9 @@ maintainer-clean-gawk: .PHONY: configure-gettext maybe-configure-gettext maybe-configure-gettext: +@if gcc-bootstrap +configure-gettext: stage_current +@endif gcc-bootstrap @if gettext maybe-configure-gettext: configure-gettext configure-gettext: @@ -12752,7 +14720,8 @@ configure-gettext: srcdiroption="--srcdir=$${topdir}/gettext"; \ libsrcdir="$$s/gettext"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif gettext @@ -12762,6 +14731,9 @@ configure-gettext: .PHONY: all-gettext maybe-all-gettext maybe-all-gettext: +@if gcc-bootstrap +all-gettext: stage_current +@endif gcc-bootstrap @if gettext TARGET-gettext=all maybe-all-gettext: all-gettext @@ -12807,7 +14779,7 @@ install-gettext: installdirs @endif gettext -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-gettext info-gettext maybe-info-gettext: @@ -12861,6 +14833,32 @@ dvi-gettext: \ @endif gettext +.PHONY: maybe-pdf-gettext pdf-gettext +maybe-pdf-gettext: +@if gettext +maybe-pdf-gettext: pdf-gettext + +pdf-gettext: \ + configure-gettext + @: $(MAKE); $(unstage) + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gettext" ; \ + (cd $(HOST_SUBDIR)/gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif gettext + .PHONY: maybe-html-gettext html-gettext maybe-html-gettext: @if gettext @@ -12940,6 +14938,33 @@ install-info-gettext: \ @endif gettext +.PHONY: maybe-install-pdf-gettext install-pdf-gettext +maybe-install-pdf-gettext: +@if gettext +maybe-install-pdf-gettext: install-pdf-gettext + +install-pdf-gettext: \ + configure-gettext \ + pdf-gettext + @: $(MAKE); $(unstage) + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gettext" ; \ + (cd $(HOST_SUBDIR)/gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif gettext + .PHONY: maybe-install-html-gettext install-html-gettext maybe-install-html-gettext: @if gettext @@ -13095,8 +15120,1611 @@ maintainer-clean-gettext: +.PHONY: configure-gmp maybe-configure-gmp +maybe-configure-gmp: +@if gcc-bootstrap +configure-gmp: stage_current +@endif gcc-bootstrap +@if gmp +maybe-configure-gmp: configure-gmp +configure-gmp: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/gmp; \ + cd "$(HOST_SUBDIR)/gmp" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gmp"; \ + libsrcdir="$$s/gmp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} --disable-shared \ + || exit 1 +@endif gmp + + + +.PHONY: configure-stage1-gmp maybe-configure-stage1-gmp +maybe-configure-stage1-gmp: +@if gmp-bootstrap +maybe-configure-stage1-gmp: configure-stage1-gmp +configure-stage1-gmp: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gmp"; \ + libsrcdir="$$s/gmp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" --disable-shared +@endif gmp-bootstrap + +.PHONY: configure-stage2-gmp maybe-configure-stage2-gmp +maybe-configure-stage2-gmp: +@if gmp-bootstrap +maybe-configure-stage2-gmp: configure-stage2-gmp +configure-stage2-gmp: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gmp"; \ + libsrcdir="$$s/gmp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ --disable-shared +@endif gmp-bootstrap + +.PHONY: configure-stage3-gmp maybe-configure-stage3-gmp +maybe-configure-stage3-gmp: +@if gmp-bootstrap +maybe-configure-stage3-gmp: configure-stage3-gmp +configure-stage3-gmp: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gmp"; \ + libsrcdir="$$s/gmp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ --disable-shared +@endif gmp-bootstrap + +.PHONY: configure-stage4-gmp maybe-configure-stage4-gmp +maybe-configure-stage4-gmp: +@if gmp-bootstrap +maybe-configure-stage4-gmp: configure-stage4-gmp +configure-stage4-gmp: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gmp"; \ + libsrcdir="$$s/gmp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ --disable-shared +@endif gmp-bootstrap + +.PHONY: configure-stageprofile-gmp maybe-configure-stageprofile-gmp +maybe-configure-stageprofile-gmp: +@if gmp-bootstrap +maybe-configure-stageprofile-gmp: configure-stageprofile-gmp +configure-stageprofile-gmp: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gmp"; \ + libsrcdir="$$s/gmp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ --disable-shared +@endif gmp-bootstrap + +.PHONY: configure-stagefeedback-gmp maybe-configure-stagefeedback-gmp +maybe-configure-stagefeedback-gmp: +@if gmp-bootstrap +maybe-configure-stagefeedback-gmp: configure-stagefeedback-gmp +configure-stagefeedback-gmp: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gmp"; \ + libsrcdir="$$s/gmp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ --disable-shared +@endif gmp-bootstrap + + + + + +.PHONY: all-gmp maybe-all-gmp +maybe-all-gmp: +@if gcc-bootstrap +all-gmp: stage_current +@endif gcc-bootstrap +@if gmp +TARGET-gmp=all +maybe-all-gmp: all-gmp +all-gmp: configure-gmp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gmp)) +@endif gmp + + + +.PHONY: all-stage1-gmp maybe-all-stage1-gmp +.PHONY: clean-stage1-gmp maybe-clean-stage1-gmp +maybe-all-stage1-gmp: +maybe-clean-stage1-gmp: +@if gmp-bootstrap +maybe-all-stage1-gmp: all-stage1-gmp +all-stage1: all-stage1-gmp +TARGET-stage1-gmp = $(TARGET-gmp) +all-stage1-gmp: configure-stage1-gmp + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(TARGET-stage1-gmp) + +maybe-clean-stage1-gmp: clean-stage1-gmp +clean-stage1: clean-stage1-gmp +clean-stage1-gmp: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/gmp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-gmp/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + clean +@endif gmp-bootstrap + + +.PHONY: all-stage2-gmp maybe-all-stage2-gmp +.PHONY: clean-stage2-gmp maybe-clean-stage2-gmp +maybe-all-stage2-gmp: +maybe-clean-stage2-gmp: +@if gmp-bootstrap +maybe-all-stage2-gmp: all-stage2-gmp +all-stage2: all-stage2-gmp +TARGET-stage2-gmp = $(TARGET-gmp) +all-stage2-gmp: configure-stage2-gmp + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage2-gmp) + +maybe-clean-stage2-gmp: clean-stage2-gmp +clean-stage2: clean-stage2-gmp +clean-stage2-gmp: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/gmp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-gmp/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gmp-bootstrap + + +.PHONY: all-stage3-gmp maybe-all-stage3-gmp +.PHONY: clean-stage3-gmp maybe-clean-stage3-gmp +maybe-all-stage3-gmp: +maybe-clean-stage3-gmp: +@if gmp-bootstrap +maybe-all-stage3-gmp: all-stage3-gmp +all-stage3: all-stage3-gmp +TARGET-stage3-gmp = $(TARGET-gmp) +all-stage3-gmp: configure-stage3-gmp + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage3-gmp) + +maybe-clean-stage3-gmp: clean-stage3-gmp +clean-stage3: clean-stage3-gmp +clean-stage3-gmp: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/gmp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-gmp/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gmp-bootstrap + + +.PHONY: all-stage4-gmp maybe-all-stage4-gmp +.PHONY: clean-stage4-gmp maybe-clean-stage4-gmp +maybe-all-stage4-gmp: +maybe-clean-stage4-gmp: +@if gmp-bootstrap +maybe-all-stage4-gmp: all-stage4-gmp +all-stage4: all-stage4-gmp +TARGET-stage4-gmp = $(TARGET-gmp) +all-stage4-gmp: configure-stage4-gmp + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage4-gmp) + +maybe-clean-stage4-gmp: clean-stage4-gmp +clean-stage4: clean-stage4-gmp +clean-stage4-gmp: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/gmp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-gmp/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gmp-bootstrap + + +.PHONY: all-stageprofile-gmp maybe-all-stageprofile-gmp +.PHONY: clean-stageprofile-gmp maybe-clean-stageprofile-gmp +maybe-all-stageprofile-gmp: +maybe-clean-stageprofile-gmp: +@if gmp-bootstrap +maybe-all-stageprofile-gmp: all-stageprofile-gmp +all-stageprofile: all-stageprofile-gmp +TARGET-stageprofile-gmp = $(TARGET-gmp) +all-stageprofile-gmp: configure-stageprofile-gmp + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageprofile-gmp) + +maybe-clean-stageprofile-gmp: clean-stageprofile-gmp +clean-stageprofile: clean-stageprofile-gmp +clean-stageprofile-gmp: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/gmp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-gmp/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gmp-bootstrap + + +.PHONY: all-stagefeedback-gmp maybe-all-stagefeedback-gmp +.PHONY: clean-stagefeedback-gmp maybe-clean-stagefeedback-gmp +maybe-all-stagefeedback-gmp: +maybe-clean-stagefeedback-gmp: +@if gmp-bootstrap +maybe-all-stagefeedback-gmp: all-stagefeedback-gmp +all-stagefeedback: all-stagefeedback-gmp +TARGET-stagefeedback-gmp = $(TARGET-gmp) +all-stagefeedback-gmp: configure-stagefeedback-gmp + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stagefeedback-gmp) + +maybe-clean-stagefeedback-gmp: clean-stagefeedback-gmp +clean-stagefeedback: clean-stagefeedback-gmp +clean-stagefeedback-gmp: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/gmp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-gmp/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gmp-bootstrap + + + + + +.PHONY: check-gmp maybe-check-gmp +maybe-check-gmp: +@if gmp +maybe-check-gmp: check-gmp + +check-gmp: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif gmp + +.PHONY: install-gmp maybe-install-gmp +maybe-install-gmp: +@if gmp +maybe-install-gmp: install-gmp + +install-gmp: + +@endif gmp + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-gmp info-gmp +maybe-info-gmp: +@if gmp +maybe-info-gmp: info-gmp + +info-gmp: \ + configure-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-dvi-gmp dvi-gmp +maybe-dvi-gmp: +@if gmp +maybe-dvi-gmp: dvi-gmp + +dvi-gmp: \ + configure-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-pdf-gmp pdf-gmp +maybe-pdf-gmp: +@if gmp +maybe-pdf-gmp: pdf-gmp + +pdf-gmp: \ + configure-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-html-gmp html-gmp +maybe-html-gmp: +@if gmp +maybe-html-gmp: html-gmp + +html-gmp: \ + configure-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + html) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-TAGS-gmp TAGS-gmp +maybe-TAGS-gmp: +@if gmp +maybe-TAGS-gmp: TAGS-gmp + +TAGS-gmp: \ + configure-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-install-info-gmp install-info-gmp +maybe-install-info-gmp: +@if gmp +maybe-install-info-gmp: install-info-gmp + +install-info-gmp: \ + configure-gmp \ + info-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-install-pdf-gmp install-pdf-gmp +maybe-install-pdf-gmp: +@if gmp +maybe-install-pdf-gmp: install-pdf-gmp + +install-pdf-gmp: \ + configure-gmp \ + pdf-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-install-html-gmp install-html-gmp +maybe-install-html-gmp: +@if gmp +maybe-install-html-gmp: install-html-gmp + +install-html-gmp: \ + configure-gmp \ + html-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-html) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-installcheck-gmp installcheck-gmp +maybe-installcheck-gmp: +@if gmp +maybe-installcheck-gmp: installcheck-gmp + +installcheck-gmp: \ + configure-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-mostlyclean-gmp mostlyclean-gmp +maybe-mostlyclean-gmp: +@if gmp +maybe-mostlyclean-gmp: mostlyclean-gmp + +mostlyclean-gmp: + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-clean-gmp clean-gmp +maybe-clean-gmp: +@if gmp +maybe-clean-gmp: clean-gmp + +clean-gmp: + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-distclean-gmp distclean-gmp +maybe-distclean-gmp: +@if gmp +maybe-distclean-gmp: distclean-gmp + +distclean-gmp: + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-maintainer-clean-gmp maintainer-clean-gmp +maybe-maintainer-clean-gmp: +@if gmp +maybe-maintainer-clean-gmp: maintainer-clean-gmp + +maintainer-clean-gmp: + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + +@endif gmp + + + +.PHONY: configure-mpfr maybe-configure-mpfr +maybe-configure-mpfr: +@if gcc-bootstrap +configure-mpfr: stage_current +@endif gcc-bootstrap +@if mpfr +maybe-configure-mpfr: configure-mpfr +configure-mpfr: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/mpfr; \ + cd "$(HOST_SUBDIR)/mpfr" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpfr"; \ + libsrcdir="$$s/mpfr"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} --disable-shared --with-gmp-build=$$r/$(HOST_SUBDIR)/gmp \ + || exit 1 +@endif mpfr + + + +.PHONY: configure-stage1-mpfr maybe-configure-stage1-mpfr +maybe-configure-stage1-mpfr: +@if mpfr-bootstrap +maybe-configure-stage1-mpfr: configure-stage1-mpfr +configure-stage1-mpfr: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpfr"; \ + libsrcdir="$$s/mpfr"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" --disable-shared --with-gmp-build=$$r/$(HOST_SUBDIR)/gmp +@endif mpfr-bootstrap + +.PHONY: configure-stage2-mpfr maybe-configure-stage2-mpfr +maybe-configure-stage2-mpfr: +@if mpfr-bootstrap +maybe-configure-stage2-mpfr: configure-stage2-mpfr +configure-stage2-mpfr: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpfr"; \ + libsrcdir="$$s/mpfr"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ --disable-shared --with-gmp-build=$$r/$(HOST_SUBDIR)/gmp +@endif mpfr-bootstrap + +.PHONY: configure-stage3-mpfr maybe-configure-stage3-mpfr +maybe-configure-stage3-mpfr: +@if mpfr-bootstrap +maybe-configure-stage3-mpfr: configure-stage3-mpfr +configure-stage3-mpfr: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpfr"; \ + libsrcdir="$$s/mpfr"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ --disable-shared --with-gmp-build=$$r/$(HOST_SUBDIR)/gmp +@endif mpfr-bootstrap + +.PHONY: configure-stage4-mpfr maybe-configure-stage4-mpfr +maybe-configure-stage4-mpfr: +@if mpfr-bootstrap +maybe-configure-stage4-mpfr: configure-stage4-mpfr +configure-stage4-mpfr: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpfr"; \ + libsrcdir="$$s/mpfr"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ --disable-shared --with-gmp-build=$$r/$(HOST_SUBDIR)/gmp +@endif mpfr-bootstrap + +.PHONY: configure-stageprofile-mpfr maybe-configure-stageprofile-mpfr +maybe-configure-stageprofile-mpfr: +@if mpfr-bootstrap +maybe-configure-stageprofile-mpfr: configure-stageprofile-mpfr +configure-stageprofile-mpfr: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpfr"; \ + libsrcdir="$$s/mpfr"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ --disable-shared --with-gmp-build=$$r/$(HOST_SUBDIR)/gmp +@endif mpfr-bootstrap + +.PHONY: configure-stagefeedback-mpfr maybe-configure-stagefeedback-mpfr +maybe-configure-stagefeedback-mpfr: +@if mpfr-bootstrap +maybe-configure-stagefeedback-mpfr: configure-stagefeedback-mpfr +configure-stagefeedback-mpfr: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpfr"; \ + libsrcdir="$$s/mpfr"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ --disable-shared --with-gmp-build=$$r/$(HOST_SUBDIR)/gmp +@endif mpfr-bootstrap + + + + + +.PHONY: all-mpfr maybe-all-mpfr +maybe-all-mpfr: +@if gcc-bootstrap +all-mpfr: stage_current +@endif gcc-bootstrap +@if mpfr +TARGET-mpfr=all +maybe-all-mpfr: all-mpfr +all-mpfr: configure-mpfr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) $(TARGET-mpfr)) +@endif mpfr + + + +.PHONY: all-stage1-mpfr maybe-all-stage1-mpfr +.PHONY: clean-stage1-mpfr maybe-clean-stage1-mpfr +maybe-all-stage1-mpfr: +maybe-clean-stage1-mpfr: +@if mpfr-bootstrap +maybe-all-stage1-mpfr: all-stage1-mpfr +all-stage1: all-stage1-mpfr +TARGET-stage1-mpfr = $(TARGET-mpfr) +all-stage1-mpfr: configure-stage1-mpfr + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(TARGET-stage1-mpfr) + +maybe-clean-stage1-mpfr: clean-stage1-mpfr +clean-stage1: clean-stage1-mpfr +clean-stage1-mpfr: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/mpfr/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-mpfr/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + clean +@endif mpfr-bootstrap + + +.PHONY: all-stage2-mpfr maybe-all-stage2-mpfr +.PHONY: clean-stage2-mpfr maybe-clean-stage2-mpfr +maybe-all-stage2-mpfr: +maybe-clean-stage2-mpfr: +@if mpfr-bootstrap +maybe-all-stage2-mpfr: all-stage2-mpfr +all-stage2: all-stage2-mpfr +TARGET-stage2-mpfr = $(TARGET-mpfr) +all-stage2-mpfr: configure-stage2-mpfr + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage2-mpfr) + +maybe-clean-stage2-mpfr: clean-stage2-mpfr +clean-stage2: clean-stage2-mpfr +clean-stage2-mpfr: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/mpfr/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-mpfr/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif mpfr-bootstrap + + +.PHONY: all-stage3-mpfr maybe-all-stage3-mpfr +.PHONY: clean-stage3-mpfr maybe-clean-stage3-mpfr +maybe-all-stage3-mpfr: +maybe-clean-stage3-mpfr: +@if mpfr-bootstrap +maybe-all-stage3-mpfr: all-stage3-mpfr +all-stage3: all-stage3-mpfr +TARGET-stage3-mpfr = $(TARGET-mpfr) +all-stage3-mpfr: configure-stage3-mpfr + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage3-mpfr) + +maybe-clean-stage3-mpfr: clean-stage3-mpfr +clean-stage3: clean-stage3-mpfr +clean-stage3-mpfr: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/mpfr/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-mpfr/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif mpfr-bootstrap + + +.PHONY: all-stage4-mpfr maybe-all-stage4-mpfr +.PHONY: clean-stage4-mpfr maybe-clean-stage4-mpfr +maybe-all-stage4-mpfr: +maybe-clean-stage4-mpfr: +@if mpfr-bootstrap +maybe-all-stage4-mpfr: all-stage4-mpfr +all-stage4: all-stage4-mpfr +TARGET-stage4-mpfr = $(TARGET-mpfr) +all-stage4-mpfr: configure-stage4-mpfr + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage4-mpfr) + +maybe-clean-stage4-mpfr: clean-stage4-mpfr +clean-stage4: clean-stage4-mpfr +clean-stage4-mpfr: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/mpfr/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-mpfr/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif mpfr-bootstrap + + +.PHONY: all-stageprofile-mpfr maybe-all-stageprofile-mpfr +.PHONY: clean-stageprofile-mpfr maybe-clean-stageprofile-mpfr +maybe-all-stageprofile-mpfr: +maybe-clean-stageprofile-mpfr: +@if mpfr-bootstrap +maybe-all-stageprofile-mpfr: all-stageprofile-mpfr +all-stageprofile: all-stageprofile-mpfr +TARGET-stageprofile-mpfr = $(TARGET-mpfr) +all-stageprofile-mpfr: configure-stageprofile-mpfr + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageprofile-mpfr) + +maybe-clean-stageprofile-mpfr: clean-stageprofile-mpfr +clean-stageprofile: clean-stageprofile-mpfr +clean-stageprofile-mpfr: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/mpfr/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-mpfr/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif mpfr-bootstrap + + +.PHONY: all-stagefeedback-mpfr maybe-all-stagefeedback-mpfr +.PHONY: clean-stagefeedback-mpfr maybe-clean-stagefeedback-mpfr +maybe-all-stagefeedback-mpfr: +maybe-clean-stagefeedback-mpfr: +@if mpfr-bootstrap +maybe-all-stagefeedback-mpfr: all-stagefeedback-mpfr +all-stagefeedback: all-stagefeedback-mpfr +TARGET-stagefeedback-mpfr = $(TARGET-mpfr) +all-stagefeedback-mpfr: configure-stagefeedback-mpfr + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stagefeedback-mpfr) + +maybe-clean-stagefeedback-mpfr: clean-stagefeedback-mpfr +clean-stagefeedback: clean-stagefeedback-mpfr +clean-stagefeedback-mpfr: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/mpfr/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-mpfr/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif mpfr-bootstrap + + + + + +.PHONY: check-mpfr maybe-check-mpfr +maybe-check-mpfr: +@if mpfr +maybe-check-mpfr: check-mpfr + +check-mpfr: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif mpfr + +.PHONY: install-mpfr maybe-install-mpfr +maybe-install-mpfr: +@if mpfr +maybe-install-mpfr: install-mpfr + +install-mpfr: + +@endif mpfr + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-mpfr info-mpfr +maybe-info-mpfr: +@if mpfr +maybe-info-mpfr: info-mpfr + +info-mpfr: \ + configure-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-dvi-mpfr dvi-mpfr +maybe-dvi-mpfr: +@if mpfr +maybe-dvi-mpfr: dvi-mpfr + +dvi-mpfr: \ + configure-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-pdf-mpfr pdf-mpfr +maybe-pdf-mpfr: +@if mpfr +maybe-pdf-mpfr: pdf-mpfr + +pdf-mpfr: \ + configure-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-html-mpfr html-mpfr +maybe-html-mpfr: +@if mpfr +maybe-html-mpfr: html-mpfr + +html-mpfr: \ + configure-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + html) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-TAGS-mpfr TAGS-mpfr +maybe-TAGS-mpfr: +@if mpfr +maybe-TAGS-mpfr: TAGS-mpfr + +TAGS-mpfr: \ + configure-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-install-info-mpfr install-info-mpfr +maybe-install-info-mpfr: +@if mpfr +maybe-install-info-mpfr: install-info-mpfr + +install-info-mpfr: \ + configure-mpfr \ + info-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-install-pdf-mpfr install-pdf-mpfr +maybe-install-pdf-mpfr: +@if mpfr +maybe-install-pdf-mpfr: install-pdf-mpfr + +install-pdf-mpfr: \ + configure-mpfr \ + pdf-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-install-html-mpfr install-html-mpfr +maybe-install-html-mpfr: +@if mpfr +maybe-install-html-mpfr: install-html-mpfr + +install-html-mpfr: \ + configure-mpfr \ + html-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-html) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-installcheck-mpfr installcheck-mpfr +maybe-installcheck-mpfr: +@if mpfr +maybe-installcheck-mpfr: installcheck-mpfr + +installcheck-mpfr: \ + configure-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-mostlyclean-mpfr mostlyclean-mpfr +maybe-mostlyclean-mpfr: +@if mpfr +maybe-mostlyclean-mpfr: mostlyclean-mpfr + +mostlyclean-mpfr: + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-clean-mpfr clean-mpfr +maybe-clean-mpfr: +@if mpfr +maybe-clean-mpfr: clean-mpfr + +clean-mpfr: + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-distclean-mpfr distclean-mpfr +maybe-distclean-mpfr: +@if mpfr +maybe-distclean-mpfr: distclean-mpfr + +distclean-mpfr: + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-maintainer-clean-mpfr maintainer-clean-mpfr +maybe-maintainer-clean-mpfr: +@if mpfr +maybe-maintainer-clean-mpfr: maintainer-clean-mpfr + +maintainer-clean-mpfr: + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + +@endif mpfr + + + .PHONY: configure-gnuserv maybe-configure-gnuserv maybe-configure-gnuserv: +@if gcc-bootstrap +configure-gnuserv: stage_current +@endif gcc-bootstrap @if gnuserv maybe-configure-gnuserv: configure-gnuserv configure-gnuserv: @@ -13116,7 +16744,8 @@ configure-gnuserv: srcdiroption="--srcdir=$${topdir}/gnuserv"; \ libsrcdir="$$s/gnuserv"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif gnuserv @@ -13126,6 +16755,9 @@ configure-gnuserv: .PHONY: all-gnuserv maybe-all-gnuserv maybe-all-gnuserv: +@if gcc-bootstrap +all-gnuserv: stage_current +@endif gcc-bootstrap @if gnuserv TARGET-gnuserv=all maybe-all-gnuserv: all-gnuserv @@ -13171,7 +16803,7 @@ install-gnuserv: installdirs @endif gnuserv -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-gnuserv info-gnuserv maybe-info-gnuserv: @@ -13225,6 +16857,32 @@ dvi-gnuserv: \ @endif gnuserv +.PHONY: maybe-pdf-gnuserv pdf-gnuserv +maybe-pdf-gnuserv: +@if gnuserv +maybe-pdf-gnuserv: pdf-gnuserv + +pdf-gnuserv: \ + configure-gnuserv + @: $(MAKE); $(unstage) + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gnuserv" ; \ + (cd $(HOST_SUBDIR)/gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif gnuserv + .PHONY: maybe-html-gnuserv html-gnuserv maybe-html-gnuserv: @if gnuserv @@ -13304,6 +16962,33 @@ install-info-gnuserv: \ @endif gnuserv +.PHONY: maybe-install-pdf-gnuserv install-pdf-gnuserv +maybe-install-pdf-gnuserv: +@if gnuserv +maybe-install-pdf-gnuserv: install-pdf-gnuserv + +install-pdf-gnuserv: \ + configure-gnuserv \ + pdf-gnuserv + @: $(MAKE); $(unstage) + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gnuserv" ; \ + (cd $(HOST_SUBDIR)/gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif gnuserv + .PHONY: maybe-install-html-gnuserv install-html-gnuserv maybe-install-html-gnuserv: @if gnuserv @@ -13461,6 +17146,9 @@ maintainer-clean-gnuserv: .PHONY: configure-gprof maybe-configure-gprof maybe-configure-gprof: +@if gcc-bootstrap +configure-gprof: stage_current +@endif gcc-bootstrap @if gprof maybe-configure-gprof: configure-gprof configure-gprof: @@ -13480,7 +17168,8 @@ configure-gprof: srcdiroption="--srcdir=$${topdir}/gprof"; \ libsrcdir="$$s/gprof"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif gprof @@ -13490,6 +17179,9 @@ configure-gprof: .PHONY: all-gprof maybe-all-gprof maybe-all-gprof: +@if gcc-bootstrap +all-gprof: stage_current +@endif gcc-bootstrap @if gprof TARGET-gprof=all maybe-all-gprof: all-gprof @@ -13535,7 +17227,7 @@ install-gprof: installdirs @endif gprof -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-gprof info-gprof maybe-info-gprof: @@ -13589,6 +17281,32 @@ dvi-gprof: \ @endif gprof +.PHONY: maybe-pdf-gprof pdf-gprof +maybe-pdf-gprof: +@if gprof +maybe-pdf-gprof: pdf-gprof + +pdf-gprof: \ + configure-gprof + @: $(MAKE); $(unstage) + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gprof" ; \ + (cd $(HOST_SUBDIR)/gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif gprof + .PHONY: maybe-html-gprof html-gprof maybe-html-gprof: @if gprof @@ -13668,6 +17386,33 @@ install-info-gprof: \ @endif gprof +.PHONY: maybe-install-pdf-gprof install-pdf-gprof +maybe-install-pdf-gprof: +@if gprof +maybe-install-pdf-gprof: install-pdf-gprof + +install-pdf-gprof: \ + configure-gprof \ + pdf-gprof + @: $(MAKE); $(unstage) + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gprof" ; \ + (cd $(HOST_SUBDIR)/gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif gprof + .PHONY: maybe-install-html-gprof install-html-gprof maybe-install-html-gprof: @if gprof @@ -13825,6 +17570,9 @@ maintainer-clean-gprof: .PHONY: configure-gzip maybe-configure-gzip maybe-configure-gzip: +@if gcc-bootstrap +configure-gzip: stage_current +@endif gcc-bootstrap @if gzip maybe-configure-gzip: configure-gzip configure-gzip: @@ -13844,7 +17592,8 @@ configure-gzip: srcdiroption="--srcdir=$${topdir}/gzip"; \ libsrcdir="$$s/gzip"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif gzip @@ -13854,6 +17603,9 @@ configure-gzip: .PHONY: all-gzip maybe-all-gzip maybe-all-gzip: +@if gcc-bootstrap +all-gzip: stage_current +@endif gcc-bootstrap @if gzip TARGET-gzip=all maybe-all-gzip: all-gzip @@ -13899,7 +17651,7 @@ install-gzip: installdirs @endif gzip -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-gzip info-gzip maybe-info-gzip: @@ -13953,6 +17705,32 @@ dvi-gzip: \ @endif gzip +.PHONY: maybe-pdf-gzip pdf-gzip +maybe-pdf-gzip: +@if gzip +maybe-pdf-gzip: pdf-gzip + +pdf-gzip: \ + configure-gzip + @: $(MAKE); $(unstage) + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gzip" ; \ + (cd $(HOST_SUBDIR)/gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif gzip + .PHONY: maybe-html-gzip html-gzip maybe-html-gzip: @if gzip @@ -14032,6 +17810,33 @@ install-info-gzip: \ @endif gzip +.PHONY: maybe-install-pdf-gzip install-pdf-gzip +maybe-install-pdf-gzip: +@if gzip +maybe-install-pdf-gzip: install-pdf-gzip + +install-pdf-gzip: \ + configure-gzip \ + pdf-gzip + @: $(MAKE); $(unstage) + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gzip" ; \ + (cd $(HOST_SUBDIR)/gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif gzip + .PHONY: maybe-install-html-gzip install-html-gzip maybe-install-html-gzip: @if gzip @@ -14189,6 +17994,9 @@ maintainer-clean-gzip: .PHONY: configure-hello maybe-configure-hello maybe-configure-hello: +@if gcc-bootstrap +configure-hello: stage_current +@endif gcc-bootstrap @if hello maybe-configure-hello: configure-hello configure-hello: @@ -14208,7 +18016,8 @@ configure-hello: srcdiroption="--srcdir=$${topdir}/hello"; \ libsrcdir="$$s/hello"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif hello @@ -14218,6 +18027,9 @@ configure-hello: .PHONY: all-hello maybe-all-hello maybe-all-hello: +@if gcc-bootstrap +all-hello: stage_current +@endif gcc-bootstrap @if hello TARGET-hello=all maybe-all-hello: all-hello @@ -14263,7 +18075,7 @@ install-hello: installdirs @endif hello -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-hello info-hello maybe-info-hello: @@ -14317,6 +18129,32 @@ dvi-hello: \ @endif hello +.PHONY: maybe-pdf-hello pdf-hello +maybe-pdf-hello: +@if hello +maybe-pdf-hello: pdf-hello + +pdf-hello: \ + configure-hello + @: $(MAKE); $(unstage) + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in hello" ; \ + (cd $(HOST_SUBDIR)/hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif hello + .PHONY: maybe-html-hello html-hello maybe-html-hello: @if hello @@ -14396,6 +18234,33 @@ install-info-hello: \ @endif hello +.PHONY: maybe-install-pdf-hello install-pdf-hello +maybe-install-pdf-hello: +@if hello +maybe-install-pdf-hello: install-pdf-hello + +install-pdf-hello: \ + configure-hello \ + pdf-hello + @: $(MAKE); $(unstage) + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in hello" ; \ + (cd $(HOST_SUBDIR)/hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif hello + .PHONY: maybe-install-html-hello install-html-hello maybe-install-html-hello: @if hello @@ -14553,6 +18418,9 @@ maintainer-clean-hello: .PHONY: configure-indent maybe-configure-indent maybe-configure-indent: +@if gcc-bootstrap +configure-indent: stage_current +@endif gcc-bootstrap @if indent maybe-configure-indent: configure-indent configure-indent: @@ -14572,7 +18440,8 @@ configure-indent: srcdiroption="--srcdir=$${topdir}/indent"; \ libsrcdir="$$s/indent"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif indent @@ -14582,6 +18451,9 @@ configure-indent: .PHONY: all-indent maybe-all-indent maybe-all-indent: +@if gcc-bootstrap +all-indent: stage_current +@endif gcc-bootstrap @if indent TARGET-indent=all maybe-all-indent: all-indent @@ -14627,7 +18499,7 @@ install-indent: installdirs @endif indent -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-indent info-indent maybe-info-indent: @@ -14681,6 +18553,32 @@ dvi-indent: \ @endif indent +.PHONY: maybe-pdf-indent pdf-indent +maybe-pdf-indent: +@if indent +maybe-pdf-indent: pdf-indent + +pdf-indent: \ + configure-indent + @: $(MAKE); $(unstage) + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in indent" ; \ + (cd $(HOST_SUBDIR)/indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif indent + .PHONY: maybe-html-indent html-indent maybe-html-indent: @if indent @@ -14760,6 +18658,33 @@ install-info-indent: \ @endif indent +.PHONY: maybe-install-pdf-indent install-pdf-indent +maybe-install-pdf-indent: +@if indent +maybe-install-pdf-indent: install-pdf-indent + +install-pdf-indent: \ + configure-indent \ + pdf-indent + @: $(MAKE); $(unstage) + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in indent" ; \ + (cd $(HOST_SUBDIR)/indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif indent + .PHONY: maybe-install-html-indent install-html-indent maybe-install-html-indent: @if indent @@ -14917,14 +18842,12 @@ maintainer-clean-indent: .PHONY: configure-intl maybe-configure-intl maybe-configure-intl: +@if gcc-bootstrap +configure-intl: stage_current +@endif gcc-bootstrap @if intl maybe-configure-intl: configure-intl configure-intl: -@endif intl -@if intl-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif intl-bootstrap -@if intl @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ @@ -14940,7 +18863,8 @@ configure-intl: srcdiroption="--srcdir=$${topdir}/intl"; \ libsrcdir="$$s/intl"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif intl @@ -14957,6 +18881,8 @@ configure-stage1-intl: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/intl ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ cd $(HOST_SUBDIR)/intl || exit 1; \ @@ -14968,8 +18894,10 @@ configure-stage1-intl: srcdiroption="--srcdir=$${topdir}/intl"; \ libsrcdir="$$s/intl"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif intl-bootstrap .PHONY: configure-stage2-intl maybe-configure-stage2-intl @@ -14984,6 +18912,8 @@ configure-stage2-intl: test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/intl ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ cd $(HOST_SUBDIR)/intl || exit 1; \ @@ -14995,7 +18925,9 @@ configure-stage2-intl: srcdiroption="--srcdir=$${topdir}/intl"; \ libsrcdir="$$s/intl"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif intl-bootstrap @@ -15011,6 +18943,8 @@ configure-stage3-intl: test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/intl ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ cd $(HOST_SUBDIR)/intl || exit 1; \ @@ -15022,7 +18956,9 @@ configure-stage3-intl: srcdiroption="--srcdir=$${topdir}/intl"; \ libsrcdir="$$s/intl"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif intl-bootstrap @@ -15038,6 +18974,8 @@ configure-stage4-intl: test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/intl ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ cd $(HOST_SUBDIR)/intl || exit 1; \ @@ -15049,7 +18987,9 @@ configure-stage4-intl: srcdiroption="--srcdir=$${topdir}/intl"; \ libsrcdir="$$s/intl"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif intl-bootstrap @@ -15065,6 +19005,8 @@ configure-stageprofile-intl: test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/intl ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ cd $(HOST_SUBDIR)/intl || exit 1; \ @@ -15076,7 +19018,9 @@ configure-stageprofile-intl: srcdiroption="--srcdir=$${topdir}/intl"; \ libsrcdir="$$s/intl"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif intl-bootstrap @@ -15092,6 +19036,8 @@ configure-stagefeedback-intl: test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/intl ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ cd $(HOST_SUBDIR)/intl || exit 1; \ @@ -15103,7 +19049,9 @@ configure-stagefeedback-intl: srcdiroption="--srcdir=$${topdir}/intl"; \ libsrcdir="$$s/intl"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif intl-bootstrap @@ -15113,15 +19061,13 @@ configure-stagefeedback-intl: .PHONY: all-intl maybe-all-intl maybe-all-intl: +@if gcc-bootstrap +all-intl: stage_current +@endif gcc-bootstrap @if intl TARGET-intl=all maybe-all-intl: all-intl all-intl: configure-intl -@endif intl -@if intl-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif intl-bootstrap -@if intl @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -15145,18 +19091,22 @@ all-stage1-intl: configure-stage1-intl s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ $(TARGET-stage1-intl) maybe-clean-stage1-intl: clean-stage1-intl clean-stage1: clean-stage1-intl clean-stage1-intl: - @[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-intl/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-intl/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/intl && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean + clean @endif intl-bootstrap @@ -15175,19 +19125,23 @@ all-stage2-intl: configure-stage2-intl $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage2-intl) maybe-clean-stage2-intl: clean-stage2-intl clean-stage2: clean-stage2-intl clean-stage2-intl: - @[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-intl/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-intl/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/intl && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif intl-bootstrap @@ -15206,19 +19160,23 @@ all-stage3-intl: configure-stage3-intl $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage3-intl) maybe-clean-stage3-intl: clean-stage3-intl clean-stage3: clean-stage3-intl clean-stage3-intl: - @[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-intl/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-intl/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/intl && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif intl-bootstrap @@ -15237,19 +19195,23 @@ all-stage4-intl: configure-stage4-intl $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage4-intl) maybe-clean-stage4-intl: clean-stage4-intl clean-stage4: clean-stage4-intl clean-stage4-intl: - @[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-intl/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-intl/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/intl && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif intl-bootstrap @@ -15268,19 +19230,23 @@ all-stageprofile-intl: configure-stageprofile-intl $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stageprofile-intl) maybe-clean-stageprofile-intl: clean-stageprofile-intl clean-stageprofile: clean-stageprofile-intl clean-stageprofile-intl: - @[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-intl/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-intl/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/intl && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean + clean @endif intl-bootstrap @@ -15299,19 +19265,23 @@ all-stagefeedback-intl: configure-stagefeedback-intl $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stagefeedback-intl) maybe-clean-stagefeedback-intl: clean-stagefeedback-intl clean-stagefeedback: clean-stagefeedback-intl clean-stagefeedback-intl: - @[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-intl/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-intl/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/intl && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean + clean @endif intl-bootstrap @@ -15348,7 +19318,7 @@ install-intl: installdirs @endif intl -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-intl info-intl maybe-info-intl: @@ -15400,6 +19370,31 @@ dvi-intl: \ @endif intl +.PHONY: maybe-pdf-intl pdf-intl +maybe-pdf-intl: +@if intl +maybe-pdf-intl: pdf-intl + +pdf-intl: \ + configure-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in intl" ; \ + (cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif intl + .PHONY: maybe-html-intl html-intl maybe-html-intl: @if intl @@ -15476,6 +19471,32 @@ install-info-intl: \ @endif intl +.PHONY: maybe-install-pdf-intl install-pdf-intl +maybe-install-pdf-intl: +@if intl +maybe-install-pdf-intl: install-pdf-intl + +install-pdf-intl: \ + configure-intl \ + pdf-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in intl" ; \ + (cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif intl + .PHONY: maybe-install-html-intl install-html-intl maybe-install-html-intl: @if intl @@ -15627,6 +19648,9 @@ maintainer-clean-intl: .PHONY: configure-tcl maybe-configure-tcl maybe-configure-tcl: +@if gcc-bootstrap +configure-tcl: stage_current +@endif gcc-bootstrap @if tcl maybe-configure-tcl: configure-tcl configure-tcl: @@ -15646,7 +19670,8 @@ configure-tcl: srcdiroption="--srcdir=$${topdir}/tcl"; \ libsrcdir="$$s/tcl"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif tcl @@ -15656,6 +19681,9 @@ configure-tcl: .PHONY: all-tcl maybe-all-tcl maybe-all-tcl: +@if gcc-bootstrap +all-tcl: stage_current +@endif gcc-bootstrap @if tcl TARGET-tcl=all maybe-all-tcl: all-tcl @@ -15701,7 +19729,7 @@ install-tcl: installdirs @endif tcl -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-tcl info-tcl maybe-info-tcl: @@ -15755,6 +19783,32 @@ dvi-tcl: \ @endif tcl +.PHONY: maybe-pdf-tcl pdf-tcl +maybe-pdf-tcl: +@if tcl +maybe-pdf-tcl: pdf-tcl + +pdf-tcl: \ + configure-tcl + @: $(MAKE); $(unstage) + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in tcl" ; \ + (cd $(HOST_SUBDIR)/tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif tcl + .PHONY: maybe-html-tcl html-tcl maybe-html-tcl: @if tcl @@ -15834,6 +19888,33 @@ install-info-tcl: \ @endif tcl +.PHONY: maybe-install-pdf-tcl install-pdf-tcl +maybe-install-pdf-tcl: +@if tcl +maybe-install-pdf-tcl: install-pdf-tcl + +install-pdf-tcl: \ + configure-tcl \ + pdf-tcl + @: $(MAKE); $(unstage) + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in tcl" ; \ + (cd $(HOST_SUBDIR)/tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif tcl + .PHONY: maybe-install-html-tcl install-html-tcl maybe-install-html-tcl: @if tcl @@ -15976,6 +20057,9 @@ maintainer-clean-tcl: .PHONY: configure-itcl maybe-configure-itcl maybe-configure-itcl: +@if gcc-bootstrap +configure-itcl: stage_current +@endif gcc-bootstrap @if itcl maybe-configure-itcl: configure-itcl configure-itcl: @@ -15995,7 +20079,8 @@ configure-itcl: srcdiroption="--srcdir=$${topdir}/itcl"; \ libsrcdir="$$s/itcl"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif itcl @@ -16005,6 +20090,9 @@ configure-itcl: .PHONY: all-itcl maybe-all-itcl maybe-all-itcl: +@if gcc-bootstrap +all-itcl: stage_current +@endif gcc-bootstrap @if itcl TARGET-itcl=all maybe-all-itcl: all-itcl @@ -16050,7 +20138,7 @@ install-itcl: installdirs @endif itcl -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-itcl info-itcl maybe-info-itcl: @@ -16104,6 +20192,32 @@ dvi-itcl: \ @endif itcl +.PHONY: maybe-pdf-itcl pdf-itcl +maybe-pdf-itcl: +@if itcl +maybe-pdf-itcl: pdf-itcl + +pdf-itcl: \ + configure-itcl + @: $(MAKE); $(unstage) + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in itcl" ; \ + (cd $(HOST_SUBDIR)/itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif itcl + .PHONY: maybe-html-itcl html-itcl maybe-html-itcl: @if itcl @@ -16183,6 +20297,33 @@ install-info-itcl: \ @endif itcl +.PHONY: maybe-install-pdf-itcl install-pdf-itcl +maybe-install-pdf-itcl: +@if itcl +maybe-install-pdf-itcl: install-pdf-itcl + +install-pdf-itcl: \ + configure-itcl \ + pdf-itcl + @: $(MAKE); $(unstage) + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in itcl" ; \ + (cd $(HOST_SUBDIR)/itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif itcl + .PHONY: maybe-install-html-itcl install-html-itcl maybe-install-html-itcl: @if itcl @@ -16340,14 +20481,12 @@ maintainer-clean-itcl: .PHONY: configure-ld maybe-configure-ld maybe-configure-ld: +@if gcc-bootstrap +configure-ld: stage_current +@endif gcc-bootstrap @if ld maybe-configure-ld: configure-ld configure-ld: -@endif ld -@if ld-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif ld-bootstrap -@if ld @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ @@ -16363,7 +20502,8 @@ configure-ld: srcdiroption="--srcdir=$${topdir}/ld"; \ libsrcdir="$$s/ld"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif ld @@ -16380,6 +20520,8 @@ configure-stage1-ld: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/ld ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ cd $(HOST_SUBDIR)/ld || exit 1; \ @@ -16391,8 +20533,10 @@ configure-stage1-ld: srcdiroption="--srcdir=$${topdir}/ld"; \ libsrcdir="$$s/ld"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif ld-bootstrap .PHONY: configure-stage2-ld maybe-configure-stage2-ld @@ -16407,6 +20551,8 @@ configure-stage2-ld: test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/ld ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ cd $(HOST_SUBDIR)/ld || exit 1; \ @@ -16418,7 +20564,9 @@ configure-stage2-ld: srcdiroption="--srcdir=$${topdir}/ld"; \ libsrcdir="$$s/ld"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif ld-bootstrap @@ -16434,6 +20582,8 @@ configure-stage3-ld: test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/ld ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ cd $(HOST_SUBDIR)/ld || exit 1; \ @@ -16445,7 +20595,9 @@ configure-stage3-ld: srcdiroption="--srcdir=$${topdir}/ld"; \ libsrcdir="$$s/ld"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif ld-bootstrap @@ -16461,6 +20613,8 @@ configure-stage4-ld: test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/ld ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ cd $(HOST_SUBDIR)/ld || exit 1; \ @@ -16472,7 +20626,9 @@ configure-stage4-ld: srcdiroption="--srcdir=$${topdir}/ld"; \ libsrcdir="$$s/ld"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif ld-bootstrap @@ -16488,6 +20644,8 @@ configure-stageprofile-ld: test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/ld ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ cd $(HOST_SUBDIR)/ld || exit 1; \ @@ -16499,7 +20657,9 @@ configure-stageprofile-ld: srcdiroption="--srcdir=$${topdir}/ld"; \ libsrcdir="$$s/ld"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif ld-bootstrap @@ -16515,6 +20675,8 @@ configure-stagefeedback-ld: test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/ld ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ cd $(HOST_SUBDIR)/ld || exit 1; \ @@ -16526,7 +20688,9 @@ configure-stagefeedback-ld: srcdiroption="--srcdir=$${topdir}/ld"; \ libsrcdir="$$s/ld"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif ld-bootstrap @@ -16536,15 +20700,13 @@ configure-stagefeedback-ld: .PHONY: all-ld maybe-all-ld maybe-all-ld: +@if gcc-bootstrap +all-ld: stage_current +@endif gcc-bootstrap @if ld TARGET-ld=all maybe-all-ld: all-ld all-ld: configure-ld -@endif ld -@if ld-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif ld-bootstrap -@if ld @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -16568,18 +20730,22 @@ all-stage1-ld: configure-stage1-ld s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ $(TARGET-stage1-ld) maybe-clean-stage1-ld: clean-stage1-ld clean-stage1: clean-stage1-ld clean-stage1-ld: - @[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-ld/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-ld/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/ld && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean + clean @endif ld-bootstrap @@ -16598,19 +20764,23 @@ all-stage2-ld: configure-stage2-ld $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage2-ld) maybe-clean-stage2-ld: clean-stage2-ld clean-stage2: clean-stage2-ld clean-stage2-ld: - @[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-ld/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-ld/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/ld && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif ld-bootstrap @@ -16629,19 +20799,23 @@ all-stage3-ld: configure-stage3-ld $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage3-ld) maybe-clean-stage3-ld: clean-stage3-ld clean-stage3: clean-stage3-ld clean-stage3-ld: - @[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-ld/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-ld/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/ld && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif ld-bootstrap @@ -16660,19 +20834,23 @@ all-stage4-ld: configure-stage4-ld $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage4-ld) maybe-clean-stage4-ld: clean-stage4-ld clean-stage4: clean-stage4-ld clean-stage4-ld: - @[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-ld/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-ld/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/ld && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif ld-bootstrap @@ -16691,19 +20869,23 @@ all-stageprofile-ld: configure-stageprofile-ld $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stageprofile-ld) maybe-clean-stageprofile-ld: clean-stageprofile-ld clean-stageprofile: clean-stageprofile-ld clean-stageprofile-ld: - @[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-ld/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-ld/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/ld && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean + clean @endif ld-bootstrap @@ -16722,19 +20904,23 @@ all-stagefeedback-ld: configure-stagefeedback-ld $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stagefeedback-ld) maybe-clean-stagefeedback-ld: clean-stagefeedback-ld clean-stagefeedback: clean-stagefeedback-ld clean-stagefeedback-ld: - @[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-ld/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-ld/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/ld && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean + clean @endif ld-bootstrap @@ -16771,7 +20957,7 @@ install-ld: installdirs @endif ld -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-ld info-ld maybe-info-ld: @@ -16823,6 +21009,31 @@ dvi-ld: \ @endif ld +.PHONY: maybe-pdf-ld pdf-ld +maybe-pdf-ld: +@if ld +maybe-pdf-ld: pdf-ld + +pdf-ld: \ + configure-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in ld" ; \ + (cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif ld + .PHONY: maybe-html-ld html-ld maybe-html-ld: @if ld @@ -16899,6 +21110,32 @@ install-info-ld: \ @endif ld +.PHONY: maybe-install-pdf-ld install-pdf-ld +maybe-install-pdf-ld: +@if ld +maybe-install-pdf-ld: install-pdf-ld + +install-pdf-ld: \ + configure-ld \ + pdf-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in ld" ; \ + (cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif ld + .PHONY: maybe-install-html-ld install-html-ld maybe-install-html-ld: @if ld @@ -17050,14 +21287,12 @@ maintainer-clean-ld: .PHONY: configure-libcpp maybe-configure-libcpp maybe-configure-libcpp: +@if gcc-bootstrap +configure-libcpp: stage_current +@endif gcc-bootstrap @if libcpp maybe-configure-libcpp: configure-libcpp configure-libcpp: -@endif libcpp -@if libcpp-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif libcpp-bootstrap -@if libcpp @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ @@ -17073,7 +21308,8 @@ configure-libcpp: srcdiroption="--srcdir=$${topdir}/libcpp"; \ libsrcdir="$$s/libcpp"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif libcpp @@ -17090,6 +21326,8 @@ configure-stage1-libcpp: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/libcpp ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ cd $(HOST_SUBDIR)/libcpp || exit 1; \ @@ -17101,8 +21339,10 @@ configure-stage1-libcpp: srcdiroption="--srcdir=$${topdir}/libcpp"; \ libsrcdir="$$s/libcpp"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif libcpp-bootstrap .PHONY: configure-stage2-libcpp maybe-configure-stage2-libcpp @@ -17117,6 +21357,8 @@ configure-stage2-libcpp: test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/libcpp ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ cd $(HOST_SUBDIR)/libcpp || exit 1; \ @@ -17128,7 +21370,9 @@ configure-stage2-libcpp: srcdiroption="--srcdir=$${topdir}/libcpp"; \ libsrcdir="$$s/libcpp"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libcpp-bootstrap @@ -17144,6 +21388,8 @@ configure-stage3-libcpp: test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/libcpp ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ cd $(HOST_SUBDIR)/libcpp || exit 1; \ @@ -17155,7 +21401,9 @@ configure-stage3-libcpp: srcdiroption="--srcdir=$${topdir}/libcpp"; \ libsrcdir="$$s/libcpp"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libcpp-bootstrap @@ -17171,6 +21419,8 @@ configure-stage4-libcpp: test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/libcpp ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ cd $(HOST_SUBDIR)/libcpp || exit 1; \ @@ -17182,7 +21432,9 @@ configure-stage4-libcpp: srcdiroption="--srcdir=$${topdir}/libcpp"; \ libsrcdir="$$s/libcpp"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libcpp-bootstrap @@ -17198,6 +21450,8 @@ configure-stageprofile-libcpp: test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/libcpp ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ cd $(HOST_SUBDIR)/libcpp || exit 1; \ @@ -17209,7 +21463,9 @@ configure-stageprofile-libcpp: srcdiroption="--srcdir=$${topdir}/libcpp"; \ libsrcdir="$$s/libcpp"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libcpp-bootstrap @@ -17225,6 +21481,8 @@ configure-stagefeedback-libcpp: test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/libcpp ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ cd $(HOST_SUBDIR)/libcpp || exit 1; \ @@ -17236,7 +21494,9 @@ configure-stagefeedback-libcpp: srcdiroption="--srcdir=$${topdir}/libcpp"; \ libsrcdir="$$s/libcpp"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libcpp-bootstrap @@ -17246,15 +21506,13 @@ configure-stagefeedback-libcpp: .PHONY: all-libcpp maybe-all-libcpp maybe-all-libcpp: +@if gcc-bootstrap +all-libcpp: stage_current +@endif gcc-bootstrap @if libcpp TARGET-libcpp=all maybe-all-libcpp: all-libcpp all-libcpp: configure-libcpp -@endif libcpp -@if libcpp-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif libcpp-bootstrap -@if libcpp @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -17278,18 +21536,22 @@ all-stage1-libcpp: configure-stage1-libcpp s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ $(TARGET-stage1-libcpp) maybe-clean-stage1-libcpp: clean-stage1-libcpp clean-stage1: clean-stage1-libcpp clean-stage1-libcpp: - @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-libcpp/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-libcpp/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/libcpp && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean + clean @endif libcpp-bootstrap @@ -17308,19 +21570,23 @@ all-stage2-libcpp: configure-stage2-libcpp $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage2-libcpp) maybe-clean-stage2-libcpp: clean-stage2-libcpp clean-stage2: clean-stage2-libcpp clean-stage2-libcpp: - @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-libcpp/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-libcpp/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/libcpp && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif libcpp-bootstrap @@ -17339,19 +21605,23 @@ all-stage3-libcpp: configure-stage3-libcpp $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage3-libcpp) maybe-clean-stage3-libcpp: clean-stage3-libcpp clean-stage3: clean-stage3-libcpp clean-stage3-libcpp: - @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-libcpp/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-libcpp/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/libcpp && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif libcpp-bootstrap @@ -17370,19 +21640,23 @@ all-stage4-libcpp: configure-stage4-libcpp $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage4-libcpp) maybe-clean-stage4-libcpp: clean-stage4-libcpp clean-stage4: clean-stage4-libcpp clean-stage4-libcpp: - @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-libcpp/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-libcpp/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/libcpp && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif libcpp-bootstrap @@ -17401,19 +21675,23 @@ all-stageprofile-libcpp: configure-stageprofile-libcpp $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stageprofile-libcpp) maybe-clean-stageprofile-libcpp: clean-stageprofile-libcpp clean-stageprofile: clean-stageprofile-libcpp clean-stageprofile-libcpp: - @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-libcpp/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-libcpp/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/libcpp && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean + clean @endif libcpp-bootstrap @@ -17432,19 +21710,23 @@ all-stagefeedback-libcpp: configure-stagefeedback-libcpp $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stagefeedback-libcpp) maybe-clean-stagefeedback-libcpp: clean-stagefeedback-libcpp clean-stagefeedback: clean-stagefeedback-libcpp clean-stagefeedback-libcpp: - @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-libcpp/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-libcpp/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/libcpp && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean + clean @endif libcpp-bootstrap @@ -17481,7 +21763,7 @@ install-libcpp: installdirs @endif libcpp -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-libcpp info-libcpp maybe-info-libcpp: @@ -17533,6 +21815,31 @@ dvi-libcpp: \ @endif libcpp +.PHONY: maybe-pdf-libcpp pdf-libcpp +maybe-pdf-libcpp: +@if libcpp +maybe-pdf-libcpp: pdf-libcpp + +pdf-libcpp: \ + configure-libcpp + @[ -f ./libcpp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in libcpp" ; \ + (cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif libcpp + .PHONY: maybe-html-libcpp html-libcpp maybe-html-libcpp: @if libcpp @@ -17609,6 +21916,32 @@ install-info-libcpp: \ @endif libcpp +.PHONY: maybe-install-pdf-libcpp install-pdf-libcpp +maybe-install-pdf-libcpp: +@if libcpp +maybe-install-pdf-libcpp: install-pdf-libcpp + +install-pdf-libcpp: \ + configure-libcpp \ + pdf-libcpp + @[ -f ./libcpp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in libcpp" ; \ + (cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif libcpp + .PHONY: maybe-install-html-libcpp install-html-libcpp maybe-install-html-libcpp: @if libcpp @@ -17760,14 +22093,12 @@ maintainer-clean-libcpp: .PHONY: configure-libdecnumber maybe-configure-libdecnumber maybe-configure-libdecnumber: +@if gcc-bootstrap +configure-libdecnumber: stage_current +@endif gcc-bootstrap @if libdecnumber maybe-configure-libdecnumber: configure-libdecnumber configure-libdecnumber: -@endif libdecnumber -@if libdecnumber-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif libdecnumber-bootstrap -@if libdecnumber @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ @@ -17783,7 +22114,8 @@ configure-libdecnumber: srcdiroption="--srcdir=$${topdir}/libdecnumber"; \ libsrcdir="$$s/libdecnumber"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif libdecnumber @@ -17800,6 +22132,8 @@ configure-stage1-libdecnumber: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/libdecnumber ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ @@ -17811,8 +22145,10 @@ configure-stage1-libdecnumber: srcdiroption="--srcdir=$${topdir}/libdecnumber"; \ libsrcdir="$$s/libdecnumber"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif libdecnumber-bootstrap .PHONY: configure-stage2-libdecnumber maybe-configure-stage2-libdecnumber @@ -17827,6 +22163,8 @@ configure-stage2-libdecnumber: test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/libdecnumber ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ @@ -17838,7 +22176,9 @@ configure-stage2-libdecnumber: srcdiroption="--srcdir=$${topdir}/libdecnumber"; \ libsrcdir="$$s/libdecnumber"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libdecnumber-bootstrap @@ -17854,6 +22194,8 @@ configure-stage3-libdecnumber: test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/libdecnumber ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ @@ -17865,7 +22207,9 @@ configure-stage3-libdecnumber: srcdiroption="--srcdir=$${topdir}/libdecnumber"; \ libsrcdir="$$s/libdecnumber"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libdecnumber-bootstrap @@ -17881,6 +22225,8 @@ configure-stage4-libdecnumber: test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/libdecnumber ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ @@ -17892,7 +22238,9 @@ configure-stage4-libdecnumber: srcdiroption="--srcdir=$${topdir}/libdecnumber"; \ libsrcdir="$$s/libdecnumber"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libdecnumber-bootstrap @@ -17908,6 +22256,8 @@ configure-stageprofile-libdecnumber: test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/libdecnumber ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ @@ -17919,7 +22269,9 @@ configure-stageprofile-libdecnumber: srcdiroption="--srcdir=$${topdir}/libdecnumber"; \ libsrcdir="$$s/libdecnumber"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libdecnumber-bootstrap @@ -17935,6 +22287,8 @@ configure-stagefeedback-libdecnumber: test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/libdecnumber ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ @@ -17946,7 +22300,9 @@ configure-stagefeedback-libdecnumber: srcdiroption="--srcdir=$${topdir}/libdecnumber"; \ libsrcdir="$$s/libdecnumber"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libdecnumber-bootstrap @@ -17956,15 +22312,13 @@ configure-stagefeedback-libdecnumber: .PHONY: all-libdecnumber maybe-all-libdecnumber maybe-all-libdecnumber: +@if gcc-bootstrap +all-libdecnumber: stage_current +@endif gcc-bootstrap @if libdecnumber TARGET-libdecnumber=all maybe-all-libdecnumber: all-libdecnumber all-libdecnumber: configure-libdecnumber -@endif libdecnumber -@if libdecnumber-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif libdecnumber-bootstrap -@if libdecnumber @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -17988,18 +22342,22 @@ all-stage1-libdecnumber: configure-stage1-libdecnumber s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libdecnumber && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ $(TARGET-stage1-libdecnumber) maybe-clean-stage1-libdecnumber: clean-stage1-libdecnumber clean-stage1: clean-stage1-libdecnumber clean-stage1-libdecnumber: - @[ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-libdecnumber/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-libdecnumber/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/libdecnumber && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean + clean @endif libdecnumber-bootstrap @@ -18018,19 +22376,23 @@ all-stage2-libdecnumber: configure-stage2-libdecnumber $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libdecnumber && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage2-libdecnumber) maybe-clean-stage2-libdecnumber: clean-stage2-libdecnumber clean-stage2: clean-stage2-libdecnumber clean-stage2-libdecnumber: - @[ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-libdecnumber/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-libdecnumber/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/libdecnumber && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif libdecnumber-bootstrap @@ -18049,19 +22411,23 @@ all-stage3-libdecnumber: configure-stage3-libdecnumber $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libdecnumber && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage3-libdecnumber) maybe-clean-stage3-libdecnumber: clean-stage3-libdecnumber clean-stage3: clean-stage3-libdecnumber clean-stage3-libdecnumber: - @[ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-libdecnumber/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-libdecnumber/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/libdecnumber && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif libdecnumber-bootstrap @@ -18080,19 +22446,23 @@ all-stage4-libdecnumber: configure-stage4-libdecnumber $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libdecnumber && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage4-libdecnumber) maybe-clean-stage4-libdecnumber: clean-stage4-libdecnumber clean-stage4: clean-stage4-libdecnumber clean-stage4-libdecnumber: - @[ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-libdecnumber/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-libdecnumber/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/libdecnumber && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif libdecnumber-bootstrap @@ -18111,19 +22481,23 @@ all-stageprofile-libdecnumber: configure-stageprofile-libdecnumber $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libdecnumber && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stageprofile-libdecnumber) maybe-clean-stageprofile-libdecnumber: clean-stageprofile-libdecnumber clean-stageprofile: clean-stageprofile-libdecnumber clean-stageprofile-libdecnumber: - @[ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-libdecnumber/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-libdecnumber/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/libdecnumber && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean + clean @endif libdecnumber-bootstrap @@ -18142,19 +22516,23 @@ all-stagefeedback-libdecnumber: configure-stagefeedback-libdecnumber $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libdecnumber && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stagefeedback-libdecnumber) maybe-clean-stagefeedback-libdecnumber: clean-stagefeedback-libdecnumber clean-stagefeedback: clean-stagefeedback-libdecnumber clean-stagefeedback-libdecnumber: - @[ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-libdecnumber/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-libdecnumber/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/libdecnumber && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean + clean @endif libdecnumber-bootstrap @@ -18191,7 +22569,7 @@ install-libdecnumber: installdirs @endif libdecnumber -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-libdecnumber info-libdecnumber maybe-info-libdecnumber: @@ -18243,6 +22621,31 @@ dvi-libdecnumber: \ @endif libdecnumber +.PHONY: maybe-pdf-libdecnumber pdf-libdecnumber +maybe-pdf-libdecnumber: +@if libdecnumber +maybe-pdf-libdecnumber: pdf-libdecnumber + +pdf-libdecnumber: \ + configure-libdecnumber + @[ -f ./libdecnumber/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in libdecnumber" ; \ + (cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif libdecnumber + .PHONY: maybe-html-libdecnumber html-libdecnumber maybe-html-libdecnumber: @if libdecnumber @@ -18319,6 +22722,32 @@ install-info-libdecnumber: \ @endif libdecnumber +.PHONY: maybe-install-pdf-libdecnumber install-pdf-libdecnumber +maybe-install-pdf-libdecnumber: +@if libdecnumber +maybe-install-pdf-libdecnumber: install-pdf-libdecnumber + +install-pdf-libdecnumber: \ + configure-libdecnumber \ + pdf-libdecnumber + @[ -f ./libdecnumber/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in libdecnumber" ; \ + (cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif libdecnumber + .PHONY: maybe-install-html-libdecnumber install-html-libdecnumber maybe-install-html-libdecnumber: @if libdecnumber @@ -18470,6 +22899,9 @@ maintainer-clean-libdecnumber: .PHONY: configure-libgui maybe-configure-libgui maybe-configure-libgui: +@if gcc-bootstrap +configure-libgui: stage_current +@endif gcc-bootstrap @if libgui maybe-configure-libgui: configure-libgui configure-libgui: @@ -18489,7 +22921,8 @@ configure-libgui: srcdiroption="--srcdir=$${topdir}/libgui"; \ libsrcdir="$$s/libgui"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif libgui @@ -18499,6 +22932,9 @@ configure-libgui: .PHONY: all-libgui maybe-all-libgui maybe-all-libgui: +@if gcc-bootstrap +all-libgui: stage_current +@endif gcc-bootstrap @if libgui TARGET-libgui=all maybe-all-libgui: all-libgui @@ -18544,7 +22980,7 @@ install-libgui: installdirs @endif libgui -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-libgui info-libgui maybe-info-libgui: @@ -18598,6 +23034,32 @@ dvi-libgui: \ @endif libgui +.PHONY: maybe-pdf-libgui pdf-libgui +maybe-pdf-libgui: +@if libgui +maybe-pdf-libgui: pdf-libgui + +pdf-libgui: \ + configure-libgui + @: $(MAKE); $(unstage) + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in libgui" ; \ + (cd $(HOST_SUBDIR)/libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif libgui + .PHONY: maybe-html-libgui html-libgui maybe-html-libgui: @if libgui @@ -18677,6 +23139,33 @@ install-info-libgui: \ @endif libgui +.PHONY: maybe-install-pdf-libgui install-pdf-libgui +maybe-install-pdf-libgui: +@if libgui +maybe-install-pdf-libgui: install-pdf-libgui + +install-pdf-libgui: \ + configure-libgui \ + pdf-libgui + @: $(MAKE); $(unstage) + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in libgui" ; \ + (cd $(HOST_SUBDIR)/libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif libgui + .PHONY: maybe-install-html-libgui install-html-libgui maybe-install-html-libgui: @if libgui @@ -18834,14 +23323,12 @@ maintainer-clean-libgui: .PHONY: configure-libiberty maybe-configure-libiberty maybe-configure-libiberty: +@if gcc-bootstrap +configure-libiberty: stage_current +@endif gcc-bootstrap @if libiberty maybe-configure-libiberty: configure-libiberty configure-libiberty: -@endif libiberty -@if libiberty-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif libiberty-bootstrap -@if libiberty @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ @@ -18857,7 +23344,8 @@ configure-libiberty: srcdiroption="--srcdir=$${topdir}/libiberty"; \ libsrcdir="$$s/libiberty"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif libiberty @@ -18874,6 +23362,8 @@ configure-stage1-libiberty: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/libiberty ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ cd $(HOST_SUBDIR)/libiberty || exit 1; \ @@ -18885,8 +23375,10 @@ configure-stage1-libiberty: srcdiroption="--srcdir=$${topdir}/libiberty"; \ libsrcdir="$$s/libiberty"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif libiberty-bootstrap .PHONY: configure-stage2-libiberty maybe-configure-stage2-libiberty @@ -18901,6 +23393,8 @@ configure-stage2-libiberty: test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/libiberty ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ cd $(HOST_SUBDIR)/libiberty || exit 1; \ @@ -18912,7 +23406,9 @@ configure-stage2-libiberty: srcdiroption="--srcdir=$${topdir}/libiberty"; \ libsrcdir="$$s/libiberty"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libiberty-bootstrap @@ -18928,6 +23424,8 @@ configure-stage3-libiberty: test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/libiberty ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ cd $(HOST_SUBDIR)/libiberty || exit 1; \ @@ -18939,7 +23437,9 @@ configure-stage3-libiberty: srcdiroption="--srcdir=$${topdir}/libiberty"; \ libsrcdir="$$s/libiberty"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libiberty-bootstrap @@ -18955,6 +23455,8 @@ configure-stage4-libiberty: test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/libiberty ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ cd $(HOST_SUBDIR)/libiberty || exit 1; \ @@ -18966,7 +23468,9 @@ configure-stage4-libiberty: srcdiroption="--srcdir=$${topdir}/libiberty"; \ libsrcdir="$$s/libiberty"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libiberty-bootstrap @@ -18982,6 +23486,8 @@ configure-stageprofile-libiberty: test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/libiberty ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ cd $(HOST_SUBDIR)/libiberty || exit 1; \ @@ -18993,7 +23499,9 @@ configure-stageprofile-libiberty: srcdiroption="--srcdir=$${topdir}/libiberty"; \ libsrcdir="$$s/libiberty"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libiberty-bootstrap @@ -19009,6 +23517,8 @@ configure-stagefeedback-libiberty: test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/libiberty ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ cd $(HOST_SUBDIR)/libiberty || exit 1; \ @@ -19020,7 +23530,9 @@ configure-stagefeedback-libiberty: srcdiroption="--srcdir=$${topdir}/libiberty"; \ libsrcdir="$$s/libiberty"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libiberty-bootstrap @@ -19030,15 +23542,13 @@ configure-stagefeedback-libiberty: .PHONY: all-libiberty maybe-all-libiberty maybe-all-libiberty: +@if gcc-bootstrap +all-libiberty: stage_current +@endif gcc-bootstrap @if libiberty TARGET-libiberty=all maybe-all-libiberty: all-libiberty all-libiberty: configure-libiberty -@endif libiberty -@if libiberty-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif libiberty-bootstrap -@if libiberty @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -19062,18 +23572,22 @@ all-stage1-libiberty: configure-stage1-libiberty s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ $(TARGET-stage1-libiberty) maybe-clean-stage1-libiberty: clean-stage1-libiberty clean-stage1: clean-stage1-libiberty clean-stage1-libiberty: - @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-libiberty/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-libiberty/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/libiberty && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean + clean @endif libiberty-bootstrap @@ -19092,19 +23606,23 @@ all-stage2-libiberty: configure-stage2-libiberty $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage2-libiberty) maybe-clean-stage2-libiberty: clean-stage2-libiberty clean-stage2: clean-stage2-libiberty clean-stage2-libiberty: - @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-libiberty/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-libiberty/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/libiberty && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif libiberty-bootstrap @@ -19123,19 +23641,23 @@ all-stage3-libiberty: configure-stage3-libiberty $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage3-libiberty) maybe-clean-stage3-libiberty: clean-stage3-libiberty clean-stage3: clean-stage3-libiberty clean-stage3-libiberty: - @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-libiberty/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-libiberty/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/libiberty && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif libiberty-bootstrap @@ -19154,19 +23676,23 @@ all-stage4-libiberty: configure-stage4-libiberty $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage4-libiberty) maybe-clean-stage4-libiberty: clean-stage4-libiberty clean-stage4: clean-stage4-libiberty clean-stage4-libiberty: - @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-libiberty/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-libiberty/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/libiberty && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif libiberty-bootstrap @@ -19185,19 +23711,23 @@ all-stageprofile-libiberty: configure-stageprofile-libiberty $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stageprofile-libiberty) maybe-clean-stageprofile-libiberty: clean-stageprofile-libiberty clean-stageprofile: clean-stageprofile-libiberty clean-stageprofile-libiberty: - @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-libiberty/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-libiberty/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/libiberty && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean + clean @endif libiberty-bootstrap @@ -19216,19 +23746,23 @@ all-stagefeedback-libiberty: configure-stagefeedback-libiberty $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stagefeedback-libiberty) maybe-clean-stagefeedback-libiberty: clean-stagefeedback-libiberty clean-stagefeedback: clean-stagefeedback-libiberty clean-stagefeedback-libiberty: - @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-libiberty/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-libiberty/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/libiberty && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean + clean @endif libiberty-bootstrap @@ -19265,7 +23799,7 @@ install-libiberty: installdirs @endif libiberty -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-libiberty info-libiberty maybe-info-libiberty: @@ -19317,6 +23851,31 @@ dvi-libiberty: \ @endif libiberty +.PHONY: maybe-pdf-libiberty pdf-libiberty +maybe-pdf-libiberty: +@if libiberty +maybe-pdf-libiberty: pdf-libiberty + +pdf-libiberty: \ + configure-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in libiberty" ; \ + (cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif libiberty + .PHONY: maybe-html-libiberty html-libiberty maybe-html-libiberty: @if libiberty @@ -19393,6 +23952,32 @@ install-info-libiberty: \ @endif libiberty +.PHONY: maybe-install-pdf-libiberty install-pdf-libiberty +maybe-install-pdf-libiberty: +@if libiberty +maybe-install-pdf-libiberty: install-pdf-libiberty + +install-pdf-libiberty: \ + configure-libiberty \ + pdf-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in libiberty" ; \ + (cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif libiberty + .PHONY: maybe-install-html-libiberty install-html-libiberty maybe-install-html-libiberty: @if libiberty @@ -19544,6 +24129,9 @@ maintainer-clean-libiberty: .PHONY: configure-libtool maybe-configure-libtool maybe-configure-libtool: +@if gcc-bootstrap +configure-libtool: stage_current +@endif gcc-bootstrap @if libtool maybe-configure-libtool: configure-libtool configure-libtool: @@ -19563,7 +24151,8 @@ configure-libtool: srcdiroption="--srcdir=$${topdir}/libtool"; \ libsrcdir="$$s/libtool"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif libtool @@ -19573,6 +24162,9 @@ configure-libtool: .PHONY: all-libtool maybe-all-libtool maybe-all-libtool: +@if gcc-bootstrap +all-libtool: stage_current +@endif gcc-bootstrap @if libtool TARGET-libtool=all maybe-all-libtool: all-libtool @@ -19618,7 +24210,7 @@ install-libtool: installdirs @endif libtool -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-libtool info-libtool maybe-info-libtool: @@ -19672,6 +24264,32 @@ dvi-libtool: \ @endif libtool +.PHONY: maybe-pdf-libtool pdf-libtool +maybe-pdf-libtool: +@if libtool +maybe-pdf-libtool: pdf-libtool + +pdf-libtool: \ + configure-libtool + @: $(MAKE); $(unstage) + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in libtool" ; \ + (cd $(HOST_SUBDIR)/libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif libtool + .PHONY: maybe-html-libtool html-libtool maybe-html-libtool: @if libtool @@ -19751,6 +24369,33 @@ install-info-libtool: \ @endif libtool +.PHONY: maybe-install-pdf-libtool install-pdf-libtool +maybe-install-pdf-libtool: +@if libtool +maybe-install-pdf-libtool: install-pdf-libtool + +install-pdf-libtool: \ + configure-libtool \ + pdf-libtool + @: $(MAKE); $(unstage) + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in libtool" ; \ + (cd $(HOST_SUBDIR)/libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif libtool + .PHONY: maybe-install-html-libtool install-html-libtool maybe-install-html-libtool: @if libtool @@ -19908,6 +24553,9 @@ maintainer-clean-libtool: .PHONY: configure-m4 maybe-configure-m4 maybe-configure-m4: +@if gcc-bootstrap +configure-m4: stage_current +@endif gcc-bootstrap @if m4 maybe-configure-m4: configure-m4 configure-m4: @@ -19927,7 +24575,8 @@ configure-m4: srcdiroption="--srcdir=$${topdir}/m4"; \ libsrcdir="$$s/m4"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif m4 @@ -19937,6 +24586,9 @@ configure-m4: .PHONY: all-m4 maybe-all-m4 maybe-all-m4: +@if gcc-bootstrap +all-m4: stage_current +@endif gcc-bootstrap @if m4 TARGET-m4=all maybe-all-m4: all-m4 @@ -19982,7 +24634,7 @@ install-m4: installdirs @endif m4 -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-m4 info-m4 maybe-info-m4: @@ -20036,6 +24688,32 @@ dvi-m4: \ @endif m4 +.PHONY: maybe-pdf-m4 pdf-m4 +maybe-pdf-m4: +@if m4 +maybe-pdf-m4: pdf-m4 + +pdf-m4: \ + configure-m4 + @: $(MAKE); $(unstage) + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in m4" ; \ + (cd $(HOST_SUBDIR)/m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif m4 + .PHONY: maybe-html-m4 html-m4 maybe-html-m4: @if m4 @@ -20115,6 +24793,33 @@ install-info-m4: \ @endif m4 +.PHONY: maybe-install-pdf-m4 install-pdf-m4 +maybe-install-pdf-m4: +@if m4 +maybe-install-pdf-m4: install-pdf-m4 + +install-pdf-m4: \ + configure-m4 \ + pdf-m4 + @: $(MAKE); $(unstage) + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in m4" ; \ + (cd $(HOST_SUBDIR)/m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif m4 + .PHONY: maybe-install-html-m4 install-html-m4 maybe-install-html-m4: @if m4 @@ -20272,6 +24977,9 @@ maintainer-clean-m4: .PHONY: configure-make maybe-configure-make maybe-configure-make: +@if gcc-bootstrap +configure-make: stage_current +@endif gcc-bootstrap @if make maybe-configure-make: configure-make configure-make: @@ -20291,7 +24999,8 @@ configure-make: srcdiroption="--srcdir=$${topdir}/make"; \ libsrcdir="$$s/make"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif make @@ -20301,6 +25010,9 @@ configure-make: .PHONY: all-make maybe-all-make maybe-all-make: +@if gcc-bootstrap +all-make: stage_current +@endif gcc-bootstrap @if make TARGET-make=all maybe-all-make: all-make @@ -20346,7 +25058,7 @@ install-make: installdirs @endif make -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-make info-make maybe-info-make: @@ -20400,6 +25112,32 @@ dvi-make: \ @endif make +.PHONY: maybe-pdf-make pdf-make +maybe-pdf-make: +@if make +maybe-pdf-make: pdf-make + +pdf-make: \ + configure-make + @: $(MAKE); $(unstage) + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in make" ; \ + (cd $(HOST_SUBDIR)/make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif make + .PHONY: maybe-html-make html-make maybe-html-make: @if make @@ -20479,6 +25217,33 @@ install-info-make: \ @endif make +.PHONY: maybe-install-pdf-make install-pdf-make +maybe-install-pdf-make: +@if make +maybe-install-pdf-make: install-pdf-make + +install-pdf-make: \ + configure-make \ + pdf-make + @: $(MAKE); $(unstage) + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in make" ; \ + (cd $(HOST_SUBDIR)/make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif make + .PHONY: maybe-install-html-make install-html-make maybe-install-html-make: @if make @@ -20636,6 +25401,9 @@ maintainer-clean-make: .PHONY: configure-mmalloc maybe-configure-mmalloc maybe-configure-mmalloc: +@if gcc-bootstrap +configure-mmalloc: stage_current +@endif gcc-bootstrap @if mmalloc maybe-configure-mmalloc: configure-mmalloc configure-mmalloc: @@ -20655,7 +25423,8 @@ configure-mmalloc: srcdiroption="--srcdir=$${topdir}/mmalloc"; \ libsrcdir="$$s/mmalloc"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif mmalloc @@ -20665,6 +25434,9 @@ configure-mmalloc: .PHONY: all-mmalloc maybe-all-mmalloc maybe-all-mmalloc: +@if gcc-bootstrap +all-mmalloc: stage_current +@endif gcc-bootstrap @if mmalloc TARGET-mmalloc=all maybe-all-mmalloc: all-mmalloc @@ -20704,7 +25476,7 @@ install-mmalloc: installdirs @endif mmalloc -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-mmalloc info-mmalloc maybe-info-mmalloc: @@ -20758,6 +25530,32 @@ dvi-mmalloc: \ @endif mmalloc +.PHONY: maybe-pdf-mmalloc pdf-mmalloc +maybe-pdf-mmalloc: +@if mmalloc +maybe-pdf-mmalloc: pdf-mmalloc + +pdf-mmalloc: \ + configure-mmalloc + @: $(MAKE); $(unstage) + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in mmalloc" ; \ + (cd $(HOST_SUBDIR)/mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif mmalloc + .PHONY: maybe-html-mmalloc html-mmalloc maybe-html-mmalloc: @if mmalloc @@ -20837,6 +25635,33 @@ install-info-mmalloc: \ @endif mmalloc +.PHONY: maybe-install-pdf-mmalloc install-pdf-mmalloc +maybe-install-pdf-mmalloc: +@if mmalloc +maybe-install-pdf-mmalloc: install-pdf-mmalloc + +install-pdf-mmalloc: \ + configure-mmalloc \ + pdf-mmalloc + @: $(MAKE); $(unstage) + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in mmalloc" ; \ + (cd $(HOST_SUBDIR)/mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif mmalloc + .PHONY: maybe-install-html-mmalloc install-html-mmalloc maybe-install-html-mmalloc: @if mmalloc @@ -20994,6 +25819,9 @@ maintainer-clean-mmalloc: .PHONY: configure-patch maybe-configure-patch maybe-configure-patch: +@if gcc-bootstrap +configure-patch: stage_current +@endif gcc-bootstrap @if patch maybe-configure-patch: configure-patch configure-patch: @@ -21013,7 +25841,8 @@ configure-patch: srcdiroption="--srcdir=$${topdir}/patch"; \ libsrcdir="$$s/patch"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif patch @@ -21023,6 +25852,9 @@ configure-patch: .PHONY: all-patch maybe-all-patch maybe-all-patch: +@if gcc-bootstrap +all-patch: stage_current +@endif gcc-bootstrap @if patch TARGET-patch=all maybe-all-patch: all-patch @@ -21068,7 +25900,7 @@ install-patch: installdirs @endif patch -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-patch info-patch maybe-info-patch: @@ -21122,6 +25954,32 @@ dvi-patch: \ @endif patch +.PHONY: maybe-pdf-patch pdf-patch +maybe-pdf-patch: +@if patch +maybe-pdf-patch: pdf-patch + +pdf-patch: \ + configure-patch + @: $(MAKE); $(unstage) + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in patch" ; \ + (cd $(HOST_SUBDIR)/patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif patch + .PHONY: maybe-html-patch html-patch maybe-html-patch: @if patch @@ -21201,6 +26059,33 @@ install-info-patch: \ @endif patch +.PHONY: maybe-install-pdf-patch install-pdf-patch +maybe-install-pdf-patch: +@if patch +maybe-install-pdf-patch: install-pdf-patch + +install-pdf-patch: \ + configure-patch \ + pdf-patch + @: $(MAKE); $(unstage) + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in patch" ; \ + (cd $(HOST_SUBDIR)/patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif patch + .PHONY: maybe-install-html-patch install-html-patch maybe-install-html-patch: @if patch @@ -21358,6 +26243,9 @@ maintainer-clean-patch: .PHONY: configure-perl maybe-configure-perl maybe-configure-perl: +@if gcc-bootstrap +configure-perl: stage_current +@endif gcc-bootstrap @if perl maybe-configure-perl: configure-perl configure-perl: @@ -21377,7 +26265,8 @@ configure-perl: srcdiroption="--srcdir=$${topdir}/perl"; \ libsrcdir="$$s/perl"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif perl @@ -21387,6 +26276,9 @@ configure-perl: .PHONY: all-perl maybe-all-perl maybe-all-perl: +@if gcc-bootstrap +all-perl: stage_current +@endif gcc-bootstrap @if perl TARGET-perl=all maybe-all-perl: all-perl @@ -21432,7 +26324,7 @@ install-perl: installdirs @endif perl -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-perl info-perl maybe-info-perl: @@ -21486,6 +26378,32 @@ dvi-perl: \ @endif perl +.PHONY: maybe-pdf-perl pdf-perl +maybe-pdf-perl: +@if perl +maybe-pdf-perl: pdf-perl + +pdf-perl: \ + configure-perl + @: $(MAKE); $(unstage) + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in perl" ; \ + (cd $(HOST_SUBDIR)/perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif perl + .PHONY: maybe-html-perl html-perl maybe-html-perl: @if perl @@ -21565,6 +26483,33 @@ install-info-perl: \ @endif perl +.PHONY: maybe-install-pdf-perl install-pdf-perl +maybe-install-pdf-perl: +@if perl +maybe-install-pdf-perl: install-pdf-perl + +install-pdf-perl: \ + configure-perl \ + pdf-perl + @: $(MAKE); $(unstage) + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in perl" ; \ + (cd $(HOST_SUBDIR)/perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif perl + .PHONY: maybe-install-html-perl install-html-perl maybe-install-html-perl: @if perl @@ -21722,6 +26667,9 @@ maintainer-clean-perl: .PHONY: configure-prms maybe-configure-prms maybe-configure-prms: +@if gcc-bootstrap +configure-prms: stage_current +@endif gcc-bootstrap @if prms maybe-configure-prms: configure-prms configure-prms: @@ -21741,7 +26689,8 @@ configure-prms: srcdiroption="--srcdir=$${topdir}/prms"; \ libsrcdir="$$s/prms"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif prms @@ -21751,6 +26700,9 @@ configure-prms: .PHONY: all-prms maybe-all-prms maybe-all-prms: +@if gcc-bootstrap +all-prms: stage_current +@endif gcc-bootstrap @if prms TARGET-prms=all maybe-all-prms: all-prms @@ -21796,7 +26748,7 @@ install-prms: installdirs @endif prms -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-prms info-prms maybe-info-prms: @@ -21850,6 +26802,32 @@ dvi-prms: \ @endif prms +.PHONY: maybe-pdf-prms pdf-prms +maybe-pdf-prms: +@if prms +maybe-pdf-prms: pdf-prms + +pdf-prms: \ + configure-prms + @: $(MAKE); $(unstage) + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in prms" ; \ + (cd $(HOST_SUBDIR)/prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif prms + .PHONY: maybe-html-prms html-prms maybe-html-prms: @if prms @@ -21929,6 +26907,33 @@ install-info-prms: \ @endif prms +.PHONY: maybe-install-pdf-prms install-pdf-prms +maybe-install-pdf-prms: +@if prms +maybe-install-pdf-prms: install-pdf-prms + +install-pdf-prms: \ + configure-prms \ + pdf-prms + @: $(MAKE); $(unstage) + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in prms" ; \ + (cd $(HOST_SUBDIR)/prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif prms + .PHONY: maybe-install-html-prms install-html-prms maybe-install-html-prms: @if prms @@ -22086,6 +27091,9 @@ maintainer-clean-prms: .PHONY: configure-rcs maybe-configure-rcs maybe-configure-rcs: +@if gcc-bootstrap +configure-rcs: stage_current +@endif gcc-bootstrap @if rcs maybe-configure-rcs: configure-rcs configure-rcs: @@ -22105,7 +27113,8 @@ configure-rcs: srcdiroption="--srcdir=$${topdir}/rcs"; \ libsrcdir="$$s/rcs"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif rcs @@ -22115,6 +27124,9 @@ configure-rcs: .PHONY: all-rcs maybe-all-rcs maybe-all-rcs: +@if gcc-bootstrap +all-rcs: stage_current +@endif gcc-bootstrap @if rcs TARGET-rcs=all maybe-all-rcs: all-rcs @@ -22160,7 +27172,7 @@ install-rcs: installdirs @endif rcs -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-rcs info-rcs maybe-info-rcs: @@ -22214,6 +27226,32 @@ dvi-rcs: \ @endif rcs +.PHONY: maybe-pdf-rcs pdf-rcs +maybe-pdf-rcs: +@if rcs +maybe-pdf-rcs: pdf-rcs + +pdf-rcs: \ + configure-rcs + @: $(MAKE); $(unstage) + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in rcs" ; \ + (cd $(HOST_SUBDIR)/rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif rcs + .PHONY: maybe-html-rcs html-rcs maybe-html-rcs: @if rcs @@ -22293,6 +27331,33 @@ install-info-rcs: \ @endif rcs +.PHONY: maybe-install-pdf-rcs install-pdf-rcs +maybe-install-pdf-rcs: +@if rcs +maybe-install-pdf-rcs: install-pdf-rcs + +install-pdf-rcs: \ + configure-rcs \ + pdf-rcs + @: $(MAKE); $(unstage) + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in rcs" ; \ + (cd $(HOST_SUBDIR)/rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif rcs + .PHONY: maybe-install-html-rcs install-html-rcs maybe-install-html-rcs: @if rcs @@ -22450,6 +27515,9 @@ maintainer-clean-rcs: .PHONY: configure-readline maybe-configure-readline maybe-configure-readline: +@if gcc-bootstrap +configure-readline: stage_current +@endif gcc-bootstrap @if readline maybe-configure-readline: configure-readline configure-readline: @@ -22469,7 +27537,8 @@ configure-readline: srcdiroption="--srcdir=$${topdir}/readline"; \ libsrcdir="$$s/readline"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif readline @@ -22479,6 +27548,9 @@ configure-readline: .PHONY: all-readline maybe-all-readline maybe-all-readline: +@if gcc-bootstrap +all-readline: stage_current +@endif gcc-bootstrap @if readline TARGET-readline=all maybe-all-readline: all-readline @@ -22524,7 +27596,7 @@ install-readline: installdirs @endif readline -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-readline info-readline maybe-info-readline: @@ -22578,6 +27650,32 @@ dvi-readline: \ @endif readline +.PHONY: maybe-pdf-readline pdf-readline +maybe-pdf-readline: +@if readline +maybe-pdf-readline: pdf-readline + +pdf-readline: \ + configure-readline + @: $(MAKE); $(unstage) + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in readline" ; \ + (cd $(HOST_SUBDIR)/readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif readline + .PHONY: maybe-html-readline html-readline maybe-html-readline: @if readline @@ -22657,6 +27755,33 @@ install-info-readline: \ @endif readline +.PHONY: maybe-install-pdf-readline install-pdf-readline +maybe-install-pdf-readline: +@if readline +maybe-install-pdf-readline: install-pdf-readline + +install-pdf-readline: \ + configure-readline \ + pdf-readline + @: $(MAKE); $(unstage) + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in readline" ; \ + (cd $(HOST_SUBDIR)/readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif readline + .PHONY: maybe-install-html-readline install-html-readline maybe-install-html-readline: @if readline @@ -22814,6 +27939,9 @@ maintainer-clean-readline: .PHONY: configure-release maybe-configure-release maybe-configure-release: +@if gcc-bootstrap +configure-release: stage_current +@endif gcc-bootstrap @if release maybe-configure-release: configure-release configure-release: @@ -22833,7 +27961,8 @@ configure-release: srcdiroption="--srcdir=$${topdir}/release"; \ libsrcdir="$$s/release"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif release @@ -22843,6 +27972,9 @@ configure-release: .PHONY: all-release maybe-all-release maybe-all-release: +@if gcc-bootstrap +all-release: stage_current +@endif gcc-bootstrap @if release TARGET-release=all maybe-all-release: all-release @@ -22876,7 +28008,7 @@ install-release: @endif release -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-release info-release maybe-info-release: @@ -22930,6 +28062,32 @@ dvi-release: \ @endif release +.PHONY: maybe-pdf-release pdf-release +maybe-pdf-release: +@if release +maybe-pdf-release: pdf-release + +pdf-release: \ + configure-release + @: $(MAKE); $(unstage) + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in release" ; \ + (cd $(HOST_SUBDIR)/release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif release + .PHONY: maybe-html-release html-release maybe-html-release: @if release @@ -23009,6 +28167,33 @@ install-info-release: \ @endif release +.PHONY: maybe-install-pdf-release install-pdf-release +maybe-install-pdf-release: +@if release +maybe-install-pdf-release: install-pdf-release + +install-pdf-release: \ + configure-release \ + pdf-release + @: $(MAKE); $(unstage) + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in release" ; \ + (cd $(HOST_SUBDIR)/release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif release + .PHONY: maybe-install-html-release install-html-release maybe-install-html-release: @if release @@ -23166,6 +28351,9 @@ maintainer-clean-release: .PHONY: configure-recode maybe-configure-recode maybe-configure-recode: +@if gcc-bootstrap +configure-recode: stage_current +@endif gcc-bootstrap @if recode maybe-configure-recode: configure-recode configure-recode: @@ -23185,7 +28373,8 @@ configure-recode: srcdiroption="--srcdir=$${topdir}/recode"; \ libsrcdir="$$s/recode"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif recode @@ -23195,6 +28384,9 @@ configure-recode: .PHONY: all-recode maybe-all-recode maybe-all-recode: +@if gcc-bootstrap +all-recode: stage_current +@endif gcc-bootstrap @if recode TARGET-recode=all maybe-all-recode: all-recode @@ -23240,7 +28432,7 @@ install-recode: installdirs @endif recode -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-recode info-recode maybe-info-recode: @@ -23294,6 +28486,32 @@ dvi-recode: \ @endif recode +.PHONY: maybe-pdf-recode pdf-recode +maybe-pdf-recode: +@if recode +maybe-pdf-recode: pdf-recode + +pdf-recode: \ + configure-recode + @: $(MAKE); $(unstage) + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in recode" ; \ + (cd $(HOST_SUBDIR)/recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif recode + .PHONY: maybe-html-recode html-recode maybe-html-recode: @if recode @@ -23373,6 +28591,33 @@ install-info-recode: \ @endif recode +.PHONY: maybe-install-pdf-recode install-pdf-recode +maybe-install-pdf-recode: +@if recode +maybe-install-pdf-recode: install-pdf-recode + +install-pdf-recode: \ + configure-recode \ + pdf-recode + @: $(MAKE); $(unstage) + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in recode" ; \ + (cd $(HOST_SUBDIR)/recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif recode + .PHONY: maybe-install-html-recode install-html-recode maybe-install-html-recode: @if recode @@ -23530,6 +28775,9 @@ maintainer-clean-recode: .PHONY: configure-sed maybe-configure-sed maybe-configure-sed: +@if gcc-bootstrap +configure-sed: stage_current +@endif gcc-bootstrap @if sed maybe-configure-sed: configure-sed configure-sed: @@ -23549,7 +28797,8 @@ configure-sed: srcdiroption="--srcdir=$${topdir}/sed"; \ libsrcdir="$$s/sed"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif sed @@ -23559,6 +28808,9 @@ configure-sed: .PHONY: all-sed maybe-all-sed maybe-all-sed: +@if gcc-bootstrap +all-sed: stage_current +@endif gcc-bootstrap @if sed TARGET-sed=all maybe-all-sed: all-sed @@ -23604,7 +28856,7 @@ install-sed: installdirs @endif sed -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-sed info-sed maybe-info-sed: @@ -23658,6 +28910,32 @@ dvi-sed: \ @endif sed +.PHONY: maybe-pdf-sed pdf-sed +maybe-pdf-sed: +@if sed +maybe-pdf-sed: pdf-sed + +pdf-sed: \ + configure-sed + @: $(MAKE); $(unstage) + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in sed" ; \ + (cd $(HOST_SUBDIR)/sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif sed + .PHONY: maybe-html-sed html-sed maybe-html-sed: @if sed @@ -23737,6 +29015,33 @@ install-info-sed: \ @endif sed +.PHONY: maybe-install-pdf-sed install-pdf-sed +maybe-install-pdf-sed: +@if sed +maybe-install-pdf-sed: install-pdf-sed + +install-pdf-sed: \ + configure-sed \ + pdf-sed + @: $(MAKE); $(unstage) + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in sed" ; \ + (cd $(HOST_SUBDIR)/sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif sed + .PHONY: maybe-install-html-sed install-html-sed maybe-install-html-sed: @if sed @@ -23894,6 +29199,9 @@ maintainer-clean-sed: .PHONY: configure-send-pr maybe-configure-send-pr maybe-configure-send-pr: +@if gcc-bootstrap +configure-send-pr: stage_current +@endif gcc-bootstrap @if send-pr maybe-configure-send-pr: configure-send-pr configure-send-pr: @@ -23913,7 +29221,8 @@ configure-send-pr: srcdiroption="--srcdir=$${topdir}/send-pr"; \ libsrcdir="$$s/send-pr"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif send-pr @@ -23923,6 +29232,9 @@ configure-send-pr: .PHONY: all-send-pr maybe-all-send-pr maybe-all-send-pr: +@if gcc-bootstrap +all-send-pr: stage_current +@endif gcc-bootstrap @if send-pr TARGET-send-pr=all maybe-all-send-pr: all-send-pr @@ -23968,7 +29280,7 @@ install-send-pr: installdirs @endif send-pr -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-send-pr info-send-pr maybe-info-send-pr: @@ -24022,6 +29334,32 @@ dvi-send-pr: \ @endif send-pr +.PHONY: maybe-pdf-send-pr pdf-send-pr +maybe-pdf-send-pr: +@if send-pr +maybe-pdf-send-pr: pdf-send-pr + +pdf-send-pr: \ + configure-send-pr + @: $(MAKE); $(unstage) + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in send-pr" ; \ + (cd $(HOST_SUBDIR)/send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif send-pr + .PHONY: maybe-html-send-pr html-send-pr maybe-html-send-pr: @if send-pr @@ -24101,6 +29439,33 @@ install-info-send-pr: \ @endif send-pr +.PHONY: maybe-install-pdf-send-pr install-pdf-send-pr +maybe-install-pdf-send-pr: +@if send-pr +maybe-install-pdf-send-pr: install-pdf-send-pr + +install-pdf-send-pr: \ + configure-send-pr \ + pdf-send-pr + @: $(MAKE); $(unstage) + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in send-pr" ; \ + (cd $(HOST_SUBDIR)/send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif send-pr + .PHONY: maybe-install-html-send-pr install-html-send-pr maybe-install-html-send-pr: @if send-pr @@ -24258,6 +29623,9 @@ maintainer-clean-send-pr: .PHONY: configure-shellutils maybe-configure-shellutils maybe-configure-shellutils: +@if gcc-bootstrap +configure-shellutils: stage_current +@endif gcc-bootstrap @if shellutils maybe-configure-shellutils: configure-shellutils configure-shellutils: @@ -24277,7 +29645,8 @@ configure-shellutils: srcdiroption="--srcdir=$${topdir}/shellutils"; \ libsrcdir="$$s/shellutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif shellutils @@ -24287,6 +29656,9 @@ configure-shellutils: .PHONY: all-shellutils maybe-all-shellutils maybe-all-shellutils: +@if gcc-bootstrap +all-shellutils: stage_current +@endif gcc-bootstrap @if shellutils TARGET-shellutils=all maybe-all-shellutils: all-shellutils @@ -24332,7 +29704,7 @@ install-shellutils: installdirs @endif shellutils -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-shellutils info-shellutils maybe-info-shellutils: @@ -24386,6 +29758,32 @@ dvi-shellutils: \ @endif shellutils +.PHONY: maybe-pdf-shellutils pdf-shellutils +maybe-pdf-shellutils: +@if shellutils +maybe-pdf-shellutils: pdf-shellutils + +pdf-shellutils: \ + configure-shellutils + @: $(MAKE); $(unstage) + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in shellutils" ; \ + (cd $(HOST_SUBDIR)/shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif shellutils + .PHONY: maybe-html-shellutils html-shellutils maybe-html-shellutils: @if shellutils @@ -24465,6 +29863,33 @@ install-info-shellutils: \ @endif shellutils +.PHONY: maybe-install-pdf-shellutils install-pdf-shellutils +maybe-install-pdf-shellutils: +@if shellutils +maybe-install-pdf-shellutils: install-pdf-shellutils + +install-pdf-shellutils: \ + configure-shellutils \ + pdf-shellutils + @: $(MAKE); $(unstage) + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in shellutils" ; \ + (cd $(HOST_SUBDIR)/shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif shellutils + .PHONY: maybe-install-html-shellutils install-html-shellutils maybe-install-html-shellutils: @if shellutils @@ -24622,6 +30047,9 @@ maintainer-clean-shellutils: .PHONY: configure-sid maybe-configure-sid maybe-configure-sid: +@if gcc-bootstrap +configure-sid: stage_current +@endif gcc-bootstrap @if sid maybe-configure-sid: configure-sid configure-sid: @@ -24641,7 +30069,8 @@ configure-sid: srcdiroption="--srcdir=$${topdir}/sid"; \ libsrcdir="$$s/sid"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif sid @@ -24651,6 +30080,9 @@ configure-sid: .PHONY: all-sid maybe-all-sid maybe-all-sid: +@if gcc-bootstrap +all-sid: stage_current +@endif gcc-bootstrap @if sid TARGET-sid=all maybe-all-sid: all-sid @@ -24696,7 +30128,7 @@ install-sid: installdirs @endif sid -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-sid info-sid maybe-info-sid: @@ -24750,6 +30182,32 @@ dvi-sid: \ @endif sid +.PHONY: maybe-pdf-sid pdf-sid +maybe-pdf-sid: +@if sid +maybe-pdf-sid: pdf-sid + +pdf-sid: \ + configure-sid + @: $(MAKE); $(unstage) + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in sid" ; \ + (cd $(HOST_SUBDIR)/sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif sid + .PHONY: maybe-html-sid html-sid maybe-html-sid: @if sid @@ -24829,6 +30287,33 @@ install-info-sid: \ @endif sid +.PHONY: maybe-install-pdf-sid install-pdf-sid +maybe-install-pdf-sid: +@if sid +maybe-install-pdf-sid: install-pdf-sid + +install-pdf-sid: \ + configure-sid \ + pdf-sid + @: $(MAKE); $(unstage) + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in sid" ; \ + (cd $(HOST_SUBDIR)/sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif sid + .PHONY: maybe-install-html-sid install-html-sid maybe-install-html-sid: @if sid @@ -24986,6 +30471,9 @@ maintainer-clean-sid: .PHONY: configure-sim maybe-configure-sim maybe-configure-sim: +@if gcc-bootstrap +configure-sim: stage_current +@endif gcc-bootstrap @if sim maybe-configure-sim: configure-sim configure-sim: @@ -25005,7 +30493,8 @@ configure-sim: srcdiroption="--srcdir=$${topdir}/sim"; \ libsrcdir="$$s/sim"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif sim @@ -25015,6 +30504,9 @@ configure-sim: .PHONY: all-sim maybe-all-sim maybe-all-sim: +@if gcc-bootstrap +all-sim: stage_current +@endif gcc-bootstrap @if sim TARGET-sim=all maybe-all-sim: all-sim @@ -25060,7 +30552,7 @@ install-sim: installdirs @endif sim -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-sim info-sim maybe-info-sim: @@ -25114,6 +30606,32 @@ dvi-sim: \ @endif sim +.PHONY: maybe-pdf-sim pdf-sim +maybe-pdf-sim: +@if sim +maybe-pdf-sim: pdf-sim + +pdf-sim: \ + configure-sim + @: $(MAKE); $(unstage) + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in sim" ; \ + (cd $(HOST_SUBDIR)/sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif sim + .PHONY: maybe-html-sim html-sim maybe-html-sim: @if sim @@ -25193,6 +30711,33 @@ install-info-sim: \ @endif sim +.PHONY: maybe-install-pdf-sim install-pdf-sim +maybe-install-pdf-sim: +@if sim +maybe-install-pdf-sim: install-pdf-sim + +install-pdf-sim: \ + configure-sim \ + pdf-sim + @: $(MAKE); $(unstage) + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in sim" ; \ + (cd $(HOST_SUBDIR)/sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif sim + .PHONY: maybe-install-html-sim install-html-sim maybe-install-html-sim: @if sim @@ -25350,6 +30895,9 @@ maintainer-clean-sim: .PHONY: configure-tar maybe-configure-tar maybe-configure-tar: +@if gcc-bootstrap +configure-tar: stage_current +@endif gcc-bootstrap @if tar maybe-configure-tar: configure-tar configure-tar: @@ -25369,7 +30917,8 @@ configure-tar: srcdiroption="--srcdir=$${topdir}/tar"; \ libsrcdir="$$s/tar"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif tar @@ -25379,6 +30928,9 @@ configure-tar: .PHONY: all-tar maybe-all-tar maybe-all-tar: +@if gcc-bootstrap +all-tar: stage_current +@endif gcc-bootstrap @if tar TARGET-tar=all maybe-all-tar: all-tar @@ -25424,7 +30976,7 @@ install-tar: installdirs @endif tar -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-tar info-tar maybe-info-tar: @@ -25478,6 +31030,32 @@ dvi-tar: \ @endif tar +.PHONY: maybe-pdf-tar pdf-tar +maybe-pdf-tar: +@if tar +maybe-pdf-tar: pdf-tar + +pdf-tar: \ + configure-tar + @: $(MAKE); $(unstage) + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in tar" ; \ + (cd $(HOST_SUBDIR)/tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif tar + .PHONY: maybe-html-tar html-tar maybe-html-tar: @if tar @@ -25557,6 +31135,33 @@ install-info-tar: \ @endif tar +.PHONY: maybe-install-pdf-tar install-pdf-tar +maybe-install-pdf-tar: +@if tar +maybe-install-pdf-tar: install-pdf-tar + +install-pdf-tar: \ + configure-tar \ + pdf-tar + @: $(MAKE); $(unstage) + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in tar" ; \ + (cd $(HOST_SUBDIR)/tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif tar + .PHONY: maybe-install-html-tar install-html-tar maybe-install-html-tar: @if tar @@ -25714,6 +31319,9 @@ maintainer-clean-tar: .PHONY: configure-texinfo maybe-configure-texinfo maybe-configure-texinfo: +@if gcc-bootstrap +configure-texinfo: stage_current +@endif gcc-bootstrap @if texinfo maybe-configure-texinfo: configure-texinfo configure-texinfo: @@ -25733,7 +31341,8 @@ configure-texinfo: srcdiroption="--srcdir=$${topdir}/texinfo"; \ libsrcdir="$$s/texinfo"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif texinfo @@ -25743,6 +31352,9 @@ configure-texinfo: .PHONY: all-texinfo maybe-all-texinfo maybe-all-texinfo: +@if gcc-bootstrap +all-texinfo: stage_current +@endif gcc-bootstrap @if texinfo TARGET-texinfo=all maybe-all-texinfo: all-texinfo @@ -25782,7 +31394,7 @@ install-texinfo: @endif texinfo -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-texinfo info-texinfo maybe-info-texinfo: @@ -25836,6 +31448,32 @@ dvi-texinfo: \ @endif texinfo +.PHONY: maybe-pdf-texinfo pdf-texinfo +maybe-pdf-texinfo: +@if texinfo +maybe-pdf-texinfo: pdf-texinfo + +pdf-texinfo: \ + configure-texinfo + @: $(MAKE); $(unstage) + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in texinfo" ; \ + (cd $(HOST_SUBDIR)/texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif texinfo + .PHONY: maybe-html-texinfo html-texinfo maybe-html-texinfo: @if texinfo @@ -25915,6 +31553,33 @@ install-info-texinfo: \ @endif texinfo +.PHONY: maybe-install-pdf-texinfo install-pdf-texinfo +maybe-install-pdf-texinfo: +@if texinfo +maybe-install-pdf-texinfo: install-pdf-texinfo + +install-pdf-texinfo: \ + configure-texinfo \ + pdf-texinfo + @: $(MAKE); $(unstage) + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in texinfo" ; \ + (cd $(HOST_SUBDIR)/texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif texinfo + .PHONY: maybe-install-html-texinfo install-html-texinfo maybe-install-html-texinfo: @if texinfo @@ -26072,6 +31737,9 @@ maintainer-clean-texinfo: .PHONY: configure-textutils maybe-configure-textutils maybe-configure-textutils: +@if gcc-bootstrap +configure-textutils: stage_current +@endif gcc-bootstrap @if textutils maybe-configure-textutils: configure-textutils configure-textutils: @@ -26091,7 +31759,8 @@ configure-textutils: srcdiroption="--srcdir=$${topdir}/textutils"; \ libsrcdir="$$s/textutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif textutils @@ -26101,6 +31770,9 @@ configure-textutils: .PHONY: all-textutils maybe-all-textutils maybe-all-textutils: +@if gcc-bootstrap +all-textutils: stage_current +@endif gcc-bootstrap @if textutils TARGET-textutils=all maybe-all-textutils: all-textutils @@ -26146,7 +31818,7 @@ install-textutils: installdirs @endif textutils -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-textutils info-textutils maybe-info-textutils: @@ -26200,6 +31872,32 @@ dvi-textutils: \ @endif textutils +.PHONY: maybe-pdf-textutils pdf-textutils +maybe-pdf-textutils: +@if textutils +maybe-pdf-textutils: pdf-textutils + +pdf-textutils: \ + configure-textutils + @: $(MAKE); $(unstage) + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in textutils" ; \ + (cd $(HOST_SUBDIR)/textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif textutils + .PHONY: maybe-html-textutils html-textutils maybe-html-textutils: @if textutils @@ -26279,6 +31977,33 @@ install-info-textutils: \ @endif textutils +.PHONY: maybe-install-pdf-textutils install-pdf-textutils +maybe-install-pdf-textutils: +@if textutils +maybe-install-pdf-textutils: install-pdf-textutils + +install-pdf-textutils: \ + configure-textutils \ + pdf-textutils + @: $(MAKE); $(unstage) + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in textutils" ; \ + (cd $(HOST_SUBDIR)/textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif textutils + .PHONY: maybe-install-html-textutils install-html-textutils maybe-install-html-textutils: @if textutils @@ -26436,6 +32161,9 @@ maintainer-clean-textutils: .PHONY: configure-time maybe-configure-time maybe-configure-time: +@if gcc-bootstrap +configure-time: stage_current +@endif gcc-bootstrap @if time maybe-configure-time: configure-time configure-time: @@ -26455,7 +32183,8 @@ configure-time: srcdiroption="--srcdir=$${topdir}/time"; \ libsrcdir="$$s/time"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif time @@ -26465,6 +32194,9 @@ configure-time: .PHONY: all-time maybe-all-time maybe-all-time: +@if gcc-bootstrap +all-time: stage_current +@endif gcc-bootstrap @if time TARGET-time=all maybe-all-time: all-time @@ -26510,7 +32242,7 @@ install-time: installdirs @endif time -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-time info-time maybe-info-time: @@ -26564,6 +32296,32 @@ dvi-time: \ @endif time +.PHONY: maybe-pdf-time pdf-time +maybe-pdf-time: +@if time +maybe-pdf-time: pdf-time + +pdf-time: \ + configure-time + @: $(MAKE); $(unstage) + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in time" ; \ + (cd $(HOST_SUBDIR)/time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif time + .PHONY: maybe-html-time html-time maybe-html-time: @if time @@ -26643,6 +32401,33 @@ install-info-time: \ @endif time +.PHONY: maybe-install-pdf-time install-pdf-time +maybe-install-pdf-time: +@if time +maybe-install-pdf-time: install-pdf-time + +install-pdf-time: \ + configure-time \ + pdf-time + @: $(MAKE); $(unstage) + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in time" ; \ + (cd $(HOST_SUBDIR)/time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif time + .PHONY: maybe-install-html-time install-html-time maybe-install-html-time: @if time @@ -26800,6 +32585,9 @@ maintainer-clean-time: .PHONY: configure-uudecode maybe-configure-uudecode maybe-configure-uudecode: +@if gcc-bootstrap +configure-uudecode: stage_current +@endif gcc-bootstrap @if uudecode maybe-configure-uudecode: configure-uudecode configure-uudecode: @@ -26819,7 +32607,8 @@ configure-uudecode: srcdiroption="--srcdir=$${topdir}/uudecode"; \ libsrcdir="$$s/uudecode"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif uudecode @@ -26829,6 +32618,9 @@ configure-uudecode: .PHONY: all-uudecode maybe-all-uudecode maybe-all-uudecode: +@if gcc-bootstrap +all-uudecode: stage_current +@endif gcc-bootstrap @if uudecode TARGET-uudecode=all maybe-all-uudecode: all-uudecode @@ -26874,7 +32666,7 @@ install-uudecode: installdirs @endif uudecode -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-uudecode info-uudecode maybe-info-uudecode: @@ -26928,6 +32720,32 @@ dvi-uudecode: \ @endif uudecode +.PHONY: maybe-pdf-uudecode pdf-uudecode +maybe-pdf-uudecode: +@if uudecode +maybe-pdf-uudecode: pdf-uudecode + +pdf-uudecode: \ + configure-uudecode + @: $(MAKE); $(unstage) + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in uudecode" ; \ + (cd $(HOST_SUBDIR)/uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif uudecode + .PHONY: maybe-html-uudecode html-uudecode maybe-html-uudecode: @if uudecode @@ -27007,6 +32825,33 @@ install-info-uudecode: \ @endif uudecode +.PHONY: maybe-install-pdf-uudecode install-pdf-uudecode +maybe-install-pdf-uudecode: +@if uudecode +maybe-install-pdf-uudecode: install-pdf-uudecode + +install-pdf-uudecode: \ + configure-uudecode \ + pdf-uudecode + @: $(MAKE); $(unstage) + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in uudecode" ; \ + (cd $(HOST_SUBDIR)/uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif uudecode + .PHONY: maybe-install-html-uudecode install-html-uudecode maybe-install-html-uudecode: @if uudecode @@ -27164,6 +33009,9 @@ maintainer-clean-uudecode: .PHONY: configure-wdiff maybe-configure-wdiff maybe-configure-wdiff: +@if gcc-bootstrap +configure-wdiff: stage_current +@endif gcc-bootstrap @if wdiff maybe-configure-wdiff: configure-wdiff configure-wdiff: @@ -27183,7 +33031,8 @@ configure-wdiff: srcdiroption="--srcdir=$${topdir}/wdiff"; \ libsrcdir="$$s/wdiff"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif wdiff @@ -27193,6 +33042,9 @@ configure-wdiff: .PHONY: all-wdiff maybe-all-wdiff maybe-all-wdiff: +@if gcc-bootstrap +all-wdiff: stage_current +@endif gcc-bootstrap @if wdiff TARGET-wdiff=all maybe-all-wdiff: all-wdiff @@ -27238,7 +33090,7 @@ install-wdiff: installdirs @endif wdiff -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-wdiff info-wdiff maybe-info-wdiff: @@ -27292,6 +33144,32 @@ dvi-wdiff: \ @endif wdiff +.PHONY: maybe-pdf-wdiff pdf-wdiff +maybe-pdf-wdiff: +@if wdiff +maybe-pdf-wdiff: pdf-wdiff + +pdf-wdiff: \ + configure-wdiff + @: $(MAKE); $(unstage) + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in wdiff" ; \ + (cd $(HOST_SUBDIR)/wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif wdiff + .PHONY: maybe-html-wdiff html-wdiff maybe-html-wdiff: @if wdiff @@ -27371,6 +33249,33 @@ install-info-wdiff: \ @endif wdiff +.PHONY: maybe-install-pdf-wdiff install-pdf-wdiff +maybe-install-pdf-wdiff: +@if wdiff +maybe-install-pdf-wdiff: install-pdf-wdiff + +install-pdf-wdiff: \ + configure-wdiff \ + pdf-wdiff + @: $(MAKE); $(unstage) + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in wdiff" ; \ + (cd $(HOST_SUBDIR)/wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif wdiff + .PHONY: maybe-install-html-wdiff install-html-wdiff maybe-install-html-wdiff: @if wdiff @@ -27528,6 +33433,9 @@ maintainer-clean-wdiff: .PHONY: configure-zip maybe-configure-zip maybe-configure-zip: +@if gcc-bootstrap +configure-zip: stage_current +@endif gcc-bootstrap @if zip maybe-configure-zip: configure-zip configure-zip: @@ -27547,7 +33455,8 @@ configure-zip: srcdiroption="--srcdir=$${topdir}/zip"; \ libsrcdir="$$s/zip"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif zip @@ -27557,6 +33466,9 @@ configure-zip: .PHONY: all-zip maybe-all-zip maybe-all-zip: +@if gcc-bootstrap +all-zip: stage_current +@endif gcc-bootstrap @if zip TARGET-zip=all maybe-all-zip: all-zip @@ -27605,7 +33517,7 @@ install-zip: installdirs @endif zip -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-zip info-zip maybe-info-zip: @@ -27659,6 +33571,32 @@ dvi-zip: \ @endif zip +.PHONY: maybe-pdf-zip pdf-zip +maybe-pdf-zip: +@if zip +maybe-pdf-zip: pdf-zip + +pdf-zip: \ + configure-zip + @: $(MAKE); $(unstage) + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in zip" ; \ + (cd $(HOST_SUBDIR)/zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif zip + .PHONY: maybe-html-zip html-zip maybe-html-zip: @if zip @@ -27738,6 +33676,33 @@ install-info-zip: \ @endif zip +.PHONY: maybe-install-pdf-zip install-pdf-zip +maybe-install-pdf-zip: +@if zip +maybe-install-pdf-zip: install-pdf-zip + +install-pdf-zip: \ + configure-zip \ + pdf-zip + @: $(MAKE); $(unstage) + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in zip" ; \ + (cd $(HOST_SUBDIR)/zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif zip + .PHONY: maybe-install-html-zip install-html-zip maybe-install-html-zip: @if zip @@ -27895,14 +33860,12 @@ maintainer-clean-zip: .PHONY: configure-zlib maybe-configure-zlib maybe-configure-zlib: +@if gcc-bootstrap +configure-zlib: stage_current +@endif gcc-bootstrap @if zlib maybe-configure-zlib: configure-zlib configure-zlib: -@endif zlib -@if zlib-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif zlib-bootstrap -@if zlib @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ @@ -27918,7 +33881,8 @@ configure-zlib: srcdiroption="--srcdir=$${topdir}/zlib"; \ libsrcdir="$$s/zlib"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif zlib @@ -27935,6 +33899,8 @@ configure-stage1-zlib: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/zlib ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ cd $(HOST_SUBDIR)/zlib || exit 1; \ @@ -27946,8 +33912,10 @@ configure-stage1-zlib: srcdiroption="--srcdir=$${topdir}/zlib"; \ libsrcdir="$$s/zlib"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif zlib-bootstrap .PHONY: configure-stage2-zlib maybe-configure-stage2-zlib @@ -27962,6 +33930,8 @@ configure-stage2-zlib: test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/zlib ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ cd $(HOST_SUBDIR)/zlib || exit 1; \ @@ -27973,7 +33943,9 @@ configure-stage2-zlib: srcdiroption="--srcdir=$${topdir}/zlib"; \ libsrcdir="$$s/zlib"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif zlib-bootstrap @@ -27989,6 +33961,8 @@ configure-stage3-zlib: test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/zlib ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ cd $(HOST_SUBDIR)/zlib || exit 1; \ @@ -28000,7 +33974,9 @@ configure-stage3-zlib: srcdiroption="--srcdir=$${topdir}/zlib"; \ libsrcdir="$$s/zlib"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif zlib-bootstrap @@ -28016,6 +33992,8 @@ configure-stage4-zlib: test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/zlib ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ cd $(HOST_SUBDIR)/zlib || exit 1; \ @@ -28027,7 +34005,9 @@ configure-stage4-zlib: srcdiroption="--srcdir=$${topdir}/zlib"; \ libsrcdir="$$s/zlib"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif zlib-bootstrap @@ -28043,6 +34023,8 @@ configure-stageprofile-zlib: test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/zlib ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ cd $(HOST_SUBDIR)/zlib || exit 1; \ @@ -28054,7 +34036,9 @@ configure-stageprofile-zlib: srcdiroption="--srcdir=$${topdir}/zlib"; \ libsrcdir="$$s/zlib"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif zlib-bootstrap @@ -28070,6 +34054,8 @@ configure-stagefeedback-zlib: test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/zlib ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ cd $(HOST_SUBDIR)/zlib || exit 1; \ @@ -28081,7 +34067,9 @@ configure-stagefeedback-zlib: srcdiroption="--srcdir=$${topdir}/zlib"; \ libsrcdir="$$s/zlib"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif zlib-bootstrap @@ -28091,15 +34079,13 @@ configure-stagefeedback-zlib: .PHONY: all-zlib maybe-all-zlib maybe-all-zlib: +@if gcc-bootstrap +all-zlib: stage_current +@endif gcc-bootstrap @if zlib TARGET-zlib=all maybe-all-zlib: all-zlib all-zlib: configure-zlib -@endif zlib -@if zlib-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif zlib-bootstrap -@if zlib @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -28123,18 +34109,22 @@ all-stage1-zlib: configure-stage1-zlib s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ $(TARGET-stage1-zlib) maybe-clean-stage1-zlib: clean-stage1-zlib clean-stage1: clean-stage1-zlib clean-stage1-zlib: - @[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-zlib/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-zlib/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/zlib && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean + clean @endif zlib-bootstrap @@ -28153,19 +34143,23 @@ all-stage2-zlib: configure-stage2-zlib $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage2-zlib) maybe-clean-stage2-zlib: clean-stage2-zlib clean-stage2: clean-stage2-zlib clean-stage2-zlib: - @[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-zlib/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-zlib/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/zlib && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif zlib-bootstrap @@ -28184,19 +34178,23 @@ all-stage3-zlib: configure-stage3-zlib $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage3-zlib) maybe-clean-stage3-zlib: clean-stage3-zlib clean-stage3: clean-stage3-zlib clean-stage3-zlib: - @[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-zlib/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-zlib/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/zlib && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif zlib-bootstrap @@ -28215,19 +34213,23 @@ all-stage4-zlib: configure-stage4-zlib $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage4-zlib) maybe-clean-stage4-zlib: clean-stage4-zlib clean-stage4: clean-stage4-zlib clean-stage4-zlib: - @[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-zlib/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-zlib/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/zlib && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif zlib-bootstrap @@ -28246,19 +34248,23 @@ all-stageprofile-zlib: configure-stageprofile-zlib $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stageprofile-zlib) maybe-clean-stageprofile-zlib: clean-stageprofile-zlib clean-stageprofile: clean-stageprofile-zlib clean-stageprofile-zlib: - @[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-zlib/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-zlib/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/zlib && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean + clean @endif zlib-bootstrap @@ -28277,19 +34283,23 @@ all-stagefeedback-zlib: configure-stagefeedback-zlib $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stagefeedback-zlib) maybe-clean-stagefeedback-zlib: clean-stagefeedback-zlib clean-stagefeedback: clean-stagefeedback-zlib clean-stagefeedback-zlib: - @[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-zlib/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-zlib/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/zlib && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean + clean @endif zlib-bootstrap @@ -28314,7 +34324,7 @@ install-zlib: @endif zlib -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-zlib info-zlib maybe-info-zlib: @@ -28366,6 +34376,31 @@ dvi-zlib: \ @endif zlib +.PHONY: maybe-pdf-zlib pdf-zlib +maybe-pdf-zlib: +@if zlib +maybe-pdf-zlib: pdf-zlib + +pdf-zlib: \ + configure-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in zlib" ; \ + (cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif zlib + .PHONY: maybe-html-zlib html-zlib maybe-html-zlib: @if zlib @@ -28442,6 +34477,32 @@ install-info-zlib: \ @endif zlib +.PHONY: maybe-install-pdf-zlib install-pdf-zlib +maybe-install-pdf-zlib: +@if zlib +maybe-install-pdf-zlib: install-pdf-zlib + +install-pdf-zlib: \ + configure-zlib \ + pdf-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in zlib" ; \ + (cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif zlib + .PHONY: maybe-install-html-zlib install-html-zlib maybe-install-html-zlib: @if zlib @@ -28593,6 +34654,9 @@ maintainer-clean-zlib: .PHONY: configure-gdb maybe-configure-gdb maybe-configure-gdb: +@if gcc-bootstrap +configure-gdb: stage_current +@endif gcc-bootstrap @if gdb maybe-configure-gdb: configure-gdb configure-gdb: @@ -28612,7 +34676,8 @@ configure-gdb: srcdiroption="--srcdir=$${topdir}/gdb"; \ libsrcdir="$$s/gdb"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif gdb @@ -28622,6 +34687,9 @@ configure-gdb: .PHONY: all-gdb maybe-all-gdb maybe-all-gdb: +@if gcc-bootstrap +all-gdb: stage_current +@endif gcc-bootstrap @if gdb TARGET-gdb=all maybe-all-gdb: all-gdb @@ -28667,7 +34735,7 @@ install-gdb: installdirs @endif gdb -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-gdb info-gdb maybe-info-gdb: @@ -28721,6 +34789,32 @@ dvi-gdb: \ @endif gdb +.PHONY: maybe-pdf-gdb pdf-gdb +maybe-pdf-gdb: +@if gdb +maybe-pdf-gdb: pdf-gdb + +pdf-gdb: \ + configure-gdb + @: $(MAKE); $(unstage) + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gdb" ; \ + (cd $(HOST_SUBDIR)/gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif gdb + .PHONY: maybe-html-gdb html-gdb maybe-html-gdb: @if gdb @@ -28800,6 +34894,33 @@ install-info-gdb: \ @endif gdb +.PHONY: maybe-install-pdf-gdb install-pdf-gdb +maybe-install-pdf-gdb: +@if gdb +maybe-install-pdf-gdb: install-pdf-gdb + +install-pdf-gdb: \ + configure-gdb \ + pdf-gdb + @: $(MAKE); $(unstage) + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gdb" ; \ + (cd $(HOST_SUBDIR)/gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif gdb + .PHONY: maybe-install-html-gdb install-html-gdb maybe-install-html-gdb: @if gdb @@ -28957,6 +35078,9 @@ maintainer-clean-gdb: .PHONY: configure-expect maybe-configure-expect maybe-configure-expect: +@if gcc-bootstrap +configure-expect: stage_current +@endif gcc-bootstrap @if expect maybe-configure-expect: configure-expect configure-expect: @@ -28976,7 +35100,8 @@ configure-expect: srcdiroption="--srcdir=$${topdir}/expect"; \ libsrcdir="$$s/expect"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif expect @@ -28986,6 +35111,9 @@ configure-expect: .PHONY: all-expect maybe-all-expect maybe-all-expect: +@if gcc-bootstrap +all-expect: stage_current +@endif gcc-bootstrap @if expect TARGET-expect=all maybe-all-expect: all-expect @@ -29031,7 +35159,7 @@ install-expect: installdirs @endif expect -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-expect info-expect maybe-info-expect: @@ -29085,6 +35213,32 @@ dvi-expect: \ @endif expect +.PHONY: maybe-pdf-expect pdf-expect +maybe-pdf-expect: +@if expect +maybe-pdf-expect: pdf-expect + +pdf-expect: \ + configure-expect + @: $(MAKE); $(unstage) + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in expect" ; \ + (cd $(HOST_SUBDIR)/expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif expect + .PHONY: maybe-html-expect html-expect maybe-html-expect: @if expect @@ -29164,6 +35318,33 @@ install-info-expect: \ @endif expect +.PHONY: maybe-install-pdf-expect install-pdf-expect +maybe-install-pdf-expect: +@if expect +maybe-install-pdf-expect: install-pdf-expect + +install-pdf-expect: \ + configure-expect \ + pdf-expect + @: $(MAKE); $(unstage) + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in expect" ; \ + (cd $(HOST_SUBDIR)/expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif expect + .PHONY: maybe-install-html-expect install-html-expect maybe-install-html-expect: @if expect @@ -29321,6 +35502,9 @@ maintainer-clean-expect: .PHONY: configure-guile maybe-configure-guile maybe-configure-guile: +@if gcc-bootstrap +configure-guile: stage_current +@endif gcc-bootstrap @if guile maybe-configure-guile: configure-guile configure-guile: @@ -29340,7 +35524,8 @@ configure-guile: srcdiroption="--srcdir=$${topdir}/guile"; \ libsrcdir="$$s/guile"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif guile @@ -29350,6 +35535,9 @@ configure-guile: .PHONY: all-guile maybe-all-guile maybe-all-guile: +@if gcc-bootstrap +all-guile: stage_current +@endif gcc-bootstrap @if guile TARGET-guile=all maybe-all-guile: all-guile @@ -29395,7 +35583,7 @@ install-guile: installdirs @endif guile -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-guile info-guile maybe-info-guile: @@ -29449,6 +35637,32 @@ dvi-guile: \ @endif guile +.PHONY: maybe-pdf-guile pdf-guile +maybe-pdf-guile: +@if guile +maybe-pdf-guile: pdf-guile + +pdf-guile: \ + configure-guile + @: $(MAKE); $(unstage) + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in guile" ; \ + (cd $(HOST_SUBDIR)/guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif guile + .PHONY: maybe-html-guile html-guile maybe-html-guile: @if guile @@ -29528,6 +35742,33 @@ install-info-guile: \ @endif guile +.PHONY: maybe-install-pdf-guile install-pdf-guile +maybe-install-pdf-guile: +@if guile +maybe-install-pdf-guile: install-pdf-guile + +install-pdf-guile: \ + configure-guile \ + pdf-guile + @: $(MAKE); $(unstage) + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in guile" ; \ + (cd $(HOST_SUBDIR)/guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif guile + .PHONY: maybe-install-html-guile install-html-guile maybe-install-html-guile: @if guile @@ -29685,6 +35926,9 @@ maintainer-clean-guile: .PHONY: configure-tk maybe-configure-tk maybe-configure-tk: +@if gcc-bootstrap +configure-tk: stage_current +@endif gcc-bootstrap @if tk maybe-configure-tk: configure-tk configure-tk: @@ -29704,7 +35948,8 @@ configure-tk: srcdiroption="--srcdir=$${topdir}/tk"; \ libsrcdir="$$s/tk"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif tk @@ -29714,6 +35959,9 @@ configure-tk: .PHONY: all-tk maybe-all-tk maybe-all-tk: +@if gcc-bootstrap +all-tk: stage_current +@endif gcc-bootstrap @if tk TARGET-tk=all maybe-all-tk: all-tk @@ -29759,7 +36007,7 @@ install-tk: installdirs @endif tk -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-tk info-tk maybe-info-tk: @@ -29813,6 +36061,32 @@ dvi-tk: \ @endif tk +.PHONY: maybe-pdf-tk pdf-tk +maybe-pdf-tk: +@if tk +maybe-pdf-tk: pdf-tk + +pdf-tk: \ + configure-tk + @: $(MAKE); $(unstage) + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in tk" ; \ + (cd $(HOST_SUBDIR)/tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif tk + .PHONY: maybe-html-tk html-tk maybe-html-tk: @if tk @@ -29892,6 +36166,33 @@ install-info-tk: \ @endif tk +.PHONY: maybe-install-pdf-tk install-pdf-tk +maybe-install-pdf-tk: +@if tk +maybe-install-pdf-tk: install-pdf-tk + +install-pdf-tk: \ + configure-tk \ + pdf-tk + @: $(MAKE); $(unstage) + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in tk" ; \ + (cd $(HOST_SUBDIR)/tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif tk + .PHONY: maybe-install-html-tk install-html-tk maybe-install-html-tk: @if tk @@ -30049,6 +36350,9 @@ maintainer-clean-tk: .PHONY: configure-libtermcap maybe-configure-libtermcap maybe-configure-libtermcap: +@if gcc-bootstrap +configure-libtermcap: stage_current +@endif gcc-bootstrap @if libtermcap maybe-configure-libtermcap: configure-libtermcap configure-libtermcap: @@ -30068,7 +36372,8 @@ configure-libtermcap: srcdiroption="--srcdir=$${topdir}/libtermcap"; \ libsrcdir="$$s/libtermcap"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif libtermcap @@ -30078,6 +36383,9 @@ configure-libtermcap: .PHONY: all-libtermcap maybe-all-libtermcap maybe-all-libtermcap: +@if gcc-bootstrap +all-libtermcap: stage_current +@endif gcc-bootstrap @if libtermcap TARGET-libtermcap=all maybe-all-libtermcap: all-libtermcap @@ -30117,7 +36425,7 @@ install-libtermcap: installdirs @endif libtermcap -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-libtermcap info-libtermcap maybe-info-libtermcap: @@ -30171,6 +36479,32 @@ dvi-libtermcap: \ @endif libtermcap +.PHONY: maybe-pdf-libtermcap pdf-libtermcap +maybe-pdf-libtermcap: +@if libtermcap +maybe-pdf-libtermcap: pdf-libtermcap + +pdf-libtermcap: \ + configure-libtermcap + @: $(MAKE); $(unstage) + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in libtermcap" ; \ + (cd $(HOST_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif libtermcap + .PHONY: maybe-html-libtermcap html-libtermcap maybe-html-libtermcap: @if libtermcap @@ -30250,6 +36584,33 @@ install-info-libtermcap: \ @endif libtermcap +.PHONY: maybe-install-pdf-libtermcap install-pdf-libtermcap +maybe-install-pdf-libtermcap: +@if libtermcap +maybe-install-pdf-libtermcap: install-pdf-libtermcap + +install-pdf-libtermcap: \ + configure-libtermcap \ + pdf-libtermcap + @: $(MAKE); $(unstage) + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in libtermcap" ; \ + (cd $(HOST_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif libtermcap + .PHONY: maybe-install-html-libtermcap install-html-libtermcap maybe-install-html-libtermcap: @if libtermcap @@ -30347,6 +36708,9 @@ maintainer-clean-libtermcap: .PHONY: configure-utils maybe-configure-utils maybe-configure-utils: +@if gcc-bootstrap +configure-utils: stage_current +@endif gcc-bootstrap @if utils maybe-configure-utils: configure-utils configure-utils: @@ -30366,7 +36730,8 @@ configure-utils: srcdiroption="--srcdir=$${topdir}/utils"; \ libsrcdir="$$s/utils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif utils @@ -30376,6 +36741,9 @@ configure-utils: .PHONY: all-utils maybe-all-utils maybe-all-utils: +@if gcc-bootstrap +all-utils: stage_current +@endif gcc-bootstrap @if utils TARGET-utils=all maybe-all-utils: all-utils @@ -30415,7 +36783,7 @@ install-utils: installdirs @endif utils -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-utils info-utils maybe-info-utils: @@ -30469,6 +36837,32 @@ dvi-utils: \ @endif utils +.PHONY: maybe-pdf-utils pdf-utils +maybe-pdf-utils: +@if utils +maybe-pdf-utils: pdf-utils + +pdf-utils: \ + configure-utils + @: $(MAKE); $(unstage) + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in utils" ; \ + (cd $(HOST_SUBDIR)/utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif utils + .PHONY: maybe-html-utils html-utils maybe-html-utils: @if utils @@ -30548,6 +36942,33 @@ install-info-utils: \ @endif utils +.PHONY: maybe-install-pdf-utils install-pdf-utils +maybe-install-pdf-utils: +@if utils +maybe-install-pdf-utils: install-pdf-utils + +install-pdf-utils: \ + configure-utils \ + pdf-utils + @: $(MAKE); $(unstage) + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in utils" ; \ + (cd $(HOST_SUBDIR)/utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif utils + .PHONY: maybe-install-html-utils install-html-utils maybe-install-html-utils: @if utils @@ -30705,6 +37126,9 @@ maintainer-clean-utils: .PHONY: configure-gnattools maybe-configure-gnattools maybe-configure-gnattools: +@if gcc-bootstrap +configure-gnattools: stage_current +@endif gcc-bootstrap @if gnattools maybe-configure-gnattools: configure-gnattools configure-gnattools: @@ -30724,7 +37148,8 @@ configure-gnattools: srcdiroption="--srcdir=$${topdir}/gnattools"; \ libsrcdir="$$s/gnattools"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif gnattools @@ -30734,6 +37159,9 @@ configure-gnattools: .PHONY: all-gnattools maybe-all-gnattools maybe-all-gnattools: +@if gcc-bootstrap +all-gnattools: stage_current +@endif gcc-bootstrap @if gnattools TARGET-gnattools=all maybe-all-gnattools: all-gnattools @@ -30779,7 +37207,7 @@ install-gnattools: installdirs @endif gnattools -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-gnattools info-gnattools maybe-info-gnattools: @@ -30833,6 +37261,32 @@ dvi-gnattools: \ @endif gnattools +.PHONY: maybe-pdf-gnattools pdf-gnattools +maybe-pdf-gnattools: +@if gnattools +maybe-pdf-gnattools: pdf-gnattools + +pdf-gnattools: \ + configure-gnattools + @: $(MAKE); $(unstage) + @[ -f ./gnattools/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gnattools" ; \ + (cd $(HOST_SUBDIR)/gnattools && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif gnattools + .PHONY: maybe-html-gnattools html-gnattools maybe-html-gnattools: @if gnattools @@ -30912,6 +37366,33 @@ install-info-gnattools: \ @endif gnattools +.PHONY: maybe-install-pdf-gnattools install-pdf-gnattools +maybe-install-pdf-gnattools: +@if gnattools +maybe-install-pdf-gnattools: install-pdf-gnattools + +install-pdf-gnattools: \ + configure-gnattools \ + pdf-gnattools + @: $(MAKE); $(unstage) + @[ -f ./gnattools/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gnattools" ; \ + (cd $(HOST_SUBDIR)/gnattools && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif gnattools + .PHONY: maybe-install-html-gnattools install-html-gnattools maybe-install-html-gnattools: @if gnattools @@ -31076,6 +37557,9 @@ maintainer-clean-gnattools: .PHONY: configure-target-libstdc++-v3 maybe-configure-target-libstdc++-v3 maybe-configure-target-libstdc++-v3: +@if gcc-bootstrap +configure-target-libstdc++-v3: stage_current +@endif gcc-bootstrap @if target-libstdc++-v3 maybe-configure-target-libstdc++-v3: configure-target-libstdc++-v3 configure-target-libstdc++-v3: @@ -31109,7 +37593,8 @@ configure-target-libstdc++-v3: libsrcdir="$$s/libstdc++-v3"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libstdc++-v3 @@ -31119,6 +37604,9 @@ configure-target-libstdc++-v3: .PHONY: all-target-libstdc++-v3 maybe-all-target-libstdc++-v3 maybe-all-target-libstdc++-v3: +@if gcc-bootstrap +all-target-libstdc++-v3: stage_current +@endif gcc-bootstrap @if target-libstdc++-v3 TARGET-target-libstdc++-v3=all maybe-all-target-libstdc++-v3: all-target-libstdc++-v3 @@ -31165,7 +37653,7 @@ install-target-libstdc++-v3: installdirs @endif target-libstdc++-v3 -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libstdc++-v3 info-target-libstdc++-v3 maybe-info-target-libstdc++-v3: @@ -31219,6 +37707,32 @@ dvi-target-libstdc++-v3: \ @endif target-libstdc++-v3 +.PHONY: maybe-pdf-target-libstdc++-v3 pdf-target-libstdc++-v3 +maybe-pdf-target-libstdc++-v3: +@if target-libstdc++-v3 +maybe-pdf-target-libstdc++-v3: pdf-target-libstdc++-v3 + +pdf-target-libstdc++-v3: \ + configure-target-libstdc++-v3 + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libstdc++-v3 + .PHONY: maybe-html-target-libstdc++-v3 html-target-libstdc++-v3 maybe-html-target-libstdc++-v3: @if target-libstdc++-v3 @@ -31298,6 +37812,33 @@ install-info-target-libstdc++-v3: \ @endif target-libstdc++-v3 +.PHONY: maybe-install-pdf-target-libstdc++-v3 install-pdf-target-libstdc++-v3 +maybe-install-pdf-target-libstdc++-v3: +@if target-libstdc++-v3 +maybe-install-pdf-target-libstdc++-v3: install-pdf-target-libstdc++-v3 + +install-pdf-target-libstdc++-v3: \ + configure-target-libstdc++-v3 \ + pdf-target-libstdc++-v3 + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libstdc++-v3 + .PHONY: maybe-install-html-target-libstdc++-v3 install-html-target-libstdc++-v3 maybe-install-html-target-libstdc++-v3: @if target-libstdc++-v3 @@ -31457,6 +37998,9 @@ maintainer-clean-target-libstdc++-v3: .PHONY: configure-target-libmudflap maybe-configure-target-libmudflap maybe-configure-target-libmudflap: +@if gcc-bootstrap +configure-target-libmudflap: stage_current +@endif gcc-bootstrap @if target-libmudflap maybe-configure-target-libmudflap: configure-target-libmudflap configure-target-libmudflap: @@ -31490,7 +38034,8 @@ configure-target-libmudflap: libsrcdir="$$s/libmudflap"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libmudflap @@ -31500,6 +38045,9 @@ configure-target-libmudflap: .PHONY: all-target-libmudflap maybe-all-target-libmudflap maybe-all-target-libmudflap: +@if gcc-bootstrap +all-target-libmudflap: stage_current +@endif gcc-bootstrap @if target-libmudflap TARGET-target-libmudflap=all maybe-all-target-libmudflap: all-target-libmudflap @@ -31546,7 +38094,7 @@ install-target-libmudflap: installdirs @endif target-libmudflap -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libmudflap info-target-libmudflap maybe-info-target-libmudflap: @@ -31600,6 +38148,32 @@ dvi-target-libmudflap: \ @endif target-libmudflap +.PHONY: maybe-pdf-target-libmudflap pdf-target-libmudflap +maybe-pdf-target-libmudflap: +@if target-libmudflap +maybe-pdf-target-libmudflap: pdf-target-libmudflap + +pdf-target-libmudflap: \ + configure-target-libmudflap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libmudflap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libmudflap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libmudflap + .PHONY: maybe-html-target-libmudflap html-target-libmudflap maybe-html-target-libmudflap: @if target-libmudflap @@ -31679,6 +38253,33 @@ install-info-target-libmudflap: \ @endif target-libmudflap +.PHONY: maybe-install-pdf-target-libmudflap install-pdf-target-libmudflap +maybe-install-pdf-target-libmudflap: +@if target-libmudflap +maybe-install-pdf-target-libmudflap: install-pdf-target-libmudflap + +install-pdf-target-libmudflap: \ + configure-target-libmudflap \ + pdf-target-libmudflap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libmudflap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libmudflap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libmudflap + .PHONY: maybe-install-html-target-libmudflap install-html-target-libmudflap maybe-install-html-target-libmudflap: @if target-libmudflap @@ -31838,6 +38439,9 @@ maintainer-clean-target-libmudflap: .PHONY: configure-target-libssp maybe-configure-target-libssp maybe-configure-target-libssp: +@if gcc-bootstrap +configure-target-libssp: stage_current +@endif gcc-bootstrap @if target-libssp maybe-configure-target-libssp: configure-target-libssp configure-target-libssp: @@ -31871,7 +38475,8 @@ configure-target-libssp: libsrcdir="$$s/libssp"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libssp @@ -31881,6 +38486,9 @@ configure-target-libssp: .PHONY: all-target-libssp maybe-all-target-libssp maybe-all-target-libssp: +@if gcc-bootstrap +all-target-libssp: stage_current +@endif gcc-bootstrap @if target-libssp TARGET-target-libssp=all maybe-all-target-libssp: all-target-libssp @@ -31927,7 +38535,7 @@ install-target-libssp: installdirs @endif target-libssp -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libssp info-target-libssp maybe-info-target-libssp: @@ -31981,6 +38589,32 @@ dvi-target-libssp: \ @endif target-libssp +.PHONY: maybe-pdf-target-libssp pdf-target-libssp +maybe-pdf-target-libssp: +@if target-libssp +maybe-pdf-target-libssp: pdf-target-libssp + +pdf-target-libssp: \ + configure-target-libssp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libssp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libssp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libssp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libssp + .PHONY: maybe-html-target-libssp html-target-libssp maybe-html-target-libssp: @if target-libssp @@ -32060,6 +38694,33 @@ install-info-target-libssp: \ @endif target-libssp +.PHONY: maybe-install-pdf-target-libssp install-pdf-target-libssp +maybe-install-pdf-target-libssp: +@if target-libssp +maybe-install-pdf-target-libssp: install-pdf-target-libssp + +install-pdf-target-libssp: \ + configure-target-libssp \ + pdf-target-libssp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libssp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libssp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libssp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libssp + .PHONY: maybe-install-html-target-libssp install-html-target-libssp maybe-install-html-target-libssp: @if target-libssp @@ -32217,389 +38878,11 @@ maintainer-clean-target-libssp: -.PHONY: configure-target-libgcc-math maybe-configure-target-libgcc-math -maybe-configure-target-libgcc-math: -@if target-libgcc-math -maybe-configure-target-libgcc-math: configure-target-libgcc-math -configure-target-libgcc-math: - @: $(MAKE); $(unstage) - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - echo "Checking multilib configuration for libgcc-math..."; \ - $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc-math ; \ - $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc-math/multilib.tmp 2> /dev/null ; \ - if test -r $(TARGET_SUBDIR)/libgcc-math/multilib.out; then \ - if cmp -s $(TARGET_SUBDIR)/libgcc-math/multilib.tmp $(TARGET_SUBDIR)/libgcc-math/multilib.out; then \ - rm -f $(TARGET_SUBDIR)/libgcc-math/multilib.tmp; \ - else \ - rm -f $(TARGET_SUBDIR)/libgcc-math/Makefile; \ - mv $(TARGET_SUBDIR)/libgcc-math/multilib.tmp $(TARGET_SUBDIR)/libgcc-math/multilib.out; \ - fi; \ - else \ - mv $(TARGET_SUBDIR)/libgcc-math/multilib.tmp $(TARGET_SUBDIR)/libgcc-math/multilib.out; \ - fi; \ - test ! -f $(TARGET_SUBDIR)/libgcc-math/Makefile || exit 0; \ - $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc-math ; \ - $(NORMAL_TARGET_EXPORTS) \ - echo Configuring in $(TARGET_SUBDIR)/libgcc-math; \ - cd "$(TARGET_SUBDIR)/libgcc-math" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(TARGET_SUBDIR)/libgcc-math/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/libgcc-math"; \ - libsrcdir="$$s/libgcc-math"; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - || exit 1 -@endif target-libgcc-math - - - - - -.PHONY: all-target-libgcc-math maybe-all-target-libgcc-math -maybe-all-target-libgcc-math: -@if target-libgcc-math -TARGET-target-libgcc-math=all -maybe-all-target-libgcc-math: all-target-libgcc-math -all-target-libgcc-math: configure-target-libgcc-math - @: $(MAKE); $(unstage) - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libgcc-math)) -@endif target-libgcc-math - - - - - -.PHONY: check-target-libgcc-math maybe-check-target-libgcc-math -maybe-check-target-libgcc-math: -@if target-libgcc-math -maybe-check-target-libgcc-math: check-target-libgcc-math - -check-target-libgcc-math: - @: $(MAKE); $(unstage) - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) check) - -@endif target-libgcc-math - -.PHONY: install-target-libgcc-math maybe-install-target-libgcc-math -maybe-install-target-libgcc-math: -@if target-libgcc-math -maybe-install-target-libgcc-math: install-target-libgcc-math - -install-target-libgcc-math: installdirs - @: $(MAKE); $(unstage) - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) install) - -@endif target-libgcc-math - -# Other targets (info, dvi, etc.) - -.PHONY: maybe-info-target-libgcc-math info-target-libgcc-math -maybe-info-target-libgcc-math: -@if target-libgcc-math -maybe-info-target-libgcc-math: info-target-libgcc-math - -info-target-libgcc-math: \ - configure-target-libgcc-math - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing info in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - info) \ - || exit 1 - -@endif target-libgcc-math - -.PHONY: maybe-dvi-target-libgcc-math dvi-target-libgcc-math -maybe-dvi-target-libgcc-math: -@if target-libgcc-math -maybe-dvi-target-libgcc-math: dvi-target-libgcc-math - -dvi-target-libgcc-math: \ - configure-target-libgcc-math - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing dvi in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - dvi) \ - || exit 1 - -@endif target-libgcc-math - -.PHONY: maybe-html-target-libgcc-math html-target-libgcc-math -maybe-html-target-libgcc-math: -@if target-libgcc-math -maybe-html-target-libgcc-math: html-target-libgcc-math - -html-target-libgcc-math: \ - configure-target-libgcc-math - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing html in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - html) \ - || exit 1 - -@endif target-libgcc-math - -.PHONY: maybe-TAGS-target-libgcc-math TAGS-target-libgcc-math -maybe-TAGS-target-libgcc-math: -@if target-libgcc-math -maybe-TAGS-target-libgcc-math: TAGS-target-libgcc-math - -TAGS-target-libgcc-math: \ - configure-target-libgcc-math - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing TAGS in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - TAGS) \ - || exit 1 - -@endif target-libgcc-math - -.PHONY: maybe-install-info-target-libgcc-math install-info-target-libgcc-math -maybe-install-info-target-libgcc-math: -@if target-libgcc-math -maybe-install-info-target-libgcc-math: install-info-target-libgcc-math - -install-info-target-libgcc-math: \ - configure-target-libgcc-math \ - info-target-libgcc-math - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing install-info in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - install-info) \ - || exit 1 - -@endif target-libgcc-math - -.PHONY: maybe-install-html-target-libgcc-math install-html-target-libgcc-math -maybe-install-html-target-libgcc-math: -@if target-libgcc-math -maybe-install-html-target-libgcc-math: install-html-target-libgcc-math - -install-html-target-libgcc-math: \ - configure-target-libgcc-math \ - html-target-libgcc-math - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing install-html in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - install-html) \ - || exit 1 - -@endif target-libgcc-math - -.PHONY: maybe-installcheck-target-libgcc-math installcheck-target-libgcc-math -maybe-installcheck-target-libgcc-math: -@if target-libgcc-math -maybe-installcheck-target-libgcc-math: installcheck-target-libgcc-math - -installcheck-target-libgcc-math: \ - configure-target-libgcc-math - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing installcheck in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - installcheck) \ - || exit 1 - -@endif target-libgcc-math - -.PHONY: maybe-mostlyclean-target-libgcc-math mostlyclean-target-libgcc-math -maybe-mostlyclean-target-libgcc-math: -@if target-libgcc-math -maybe-mostlyclean-target-libgcc-math: mostlyclean-target-libgcc-math - -mostlyclean-target-libgcc-math: - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing mostlyclean in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - mostlyclean) \ - || exit 1 - -@endif target-libgcc-math - -.PHONY: maybe-clean-target-libgcc-math clean-target-libgcc-math -maybe-clean-target-libgcc-math: -@if target-libgcc-math -maybe-clean-target-libgcc-math: clean-target-libgcc-math - -clean-target-libgcc-math: - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing clean in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - clean) \ - || exit 1 - -@endif target-libgcc-math - -.PHONY: maybe-distclean-target-libgcc-math distclean-target-libgcc-math -maybe-distclean-target-libgcc-math: -@if target-libgcc-math -maybe-distclean-target-libgcc-math: distclean-target-libgcc-math - -distclean-target-libgcc-math: - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing distclean in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - distclean) \ - || exit 1 - -@endif target-libgcc-math - -.PHONY: maybe-maintainer-clean-target-libgcc-math maintainer-clean-target-libgcc-math -maybe-maintainer-clean-target-libgcc-math: -@if target-libgcc-math -maybe-maintainer-clean-target-libgcc-math: maintainer-clean-target-libgcc-math - -maintainer-clean-target-libgcc-math: - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - maintainer-clean) \ - || exit 1 - -@endif target-libgcc-math - - - - - .PHONY: configure-target-newlib maybe-configure-target-newlib maybe-configure-target-newlib: +@if gcc-bootstrap +configure-target-newlib: stage_current +@endif gcc-bootstrap @if target-newlib maybe-configure-target-newlib: configure-target-newlib configure-target-newlib: @@ -32633,7 +38916,8 @@ configure-target-newlib: libsrcdir="$$s/newlib"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-newlib @@ -32643,6 +38927,9 @@ configure-target-newlib: .PHONY: all-target-newlib maybe-all-target-newlib maybe-all-target-newlib: +@if gcc-bootstrap +all-target-newlib: stage_current +@endif gcc-bootstrap @if target-newlib TARGET-target-newlib=all maybe-all-target-newlib: all-target-newlib @@ -32689,7 +38976,7 @@ install-target-newlib: installdirs @endif target-newlib -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-newlib info-target-newlib maybe-info-target-newlib: @@ -32743,6 +39030,32 @@ dvi-target-newlib: \ @endif target-newlib +.PHONY: maybe-pdf-target-newlib pdf-target-newlib +maybe-pdf-target-newlib: +@if target-newlib +maybe-pdf-target-newlib: pdf-target-newlib + +pdf-target-newlib: \ + configure-target-newlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-newlib + .PHONY: maybe-html-target-newlib html-target-newlib maybe-html-target-newlib: @if target-newlib @@ -32822,6 +39135,33 @@ install-info-target-newlib: \ @endif target-newlib +.PHONY: maybe-install-pdf-target-newlib install-pdf-target-newlib +maybe-install-pdf-target-newlib: +@if target-newlib +maybe-install-pdf-target-newlib: install-pdf-target-newlib + +install-pdf-target-newlib: \ + configure-target-newlib \ + pdf-target-newlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-newlib + .PHONY: maybe-install-html-target-newlib install-html-target-newlib maybe-install-html-target-newlib: @if target-newlib @@ -32979,8 +39319,914 @@ maintainer-clean-target-newlib: +.PHONY: configure-target-libgcc maybe-configure-target-libgcc +maybe-configure-target-libgcc: +@if gcc-bootstrap +configure-target-libgcc: stage_current +@endif gcc-bootstrap +@if target-libgcc +maybe-configure-target-libgcc: configure-target-libgcc +configure-target-libgcc: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libgcc..."; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + $(NORMAL_TARGET_EXPORTS) \ + echo Configuring in $(TARGET_SUBDIR)/libgcc; \ + cd "$(TARGET_SUBDIR)/libgcc" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgcc"; \ + libsrcdir="$$s/libgcc"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif target-libgcc + + + +.PHONY: configure-stage1-target-libgcc maybe-configure-stage1-target-libgcc +maybe-configure-stage1-target-libgcc: +@if target-libgcc-bootstrap +maybe-configure-stage1-target-libgcc: configure-stage1-target-libgcc +configure-stage1-target-libgcc: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libgcc..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgcc"; \ + libsrcdir="$$s/libgcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" +@endif target-libgcc-bootstrap + +.PHONY: configure-stage2-target-libgcc maybe-configure-stage2-target-libgcc +maybe-configure-stage2-target-libgcc: +@if target-libgcc-bootstrap +maybe-configure-stage2-target-libgcc: configure-stage2-target-libgcc +configure-stage2-target-libgcc: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libgcc..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgcc"; \ + libsrcdir="$$s/libgcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ +@endif target-libgcc-bootstrap + +.PHONY: configure-stage3-target-libgcc maybe-configure-stage3-target-libgcc +maybe-configure-stage3-target-libgcc: +@if target-libgcc-bootstrap +maybe-configure-stage3-target-libgcc: configure-stage3-target-libgcc +configure-stage3-target-libgcc: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libgcc..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgcc"; \ + libsrcdir="$$s/libgcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ +@endif target-libgcc-bootstrap + +.PHONY: configure-stage4-target-libgcc maybe-configure-stage4-target-libgcc +maybe-configure-stage4-target-libgcc: +@if target-libgcc-bootstrap +maybe-configure-stage4-target-libgcc: configure-stage4-target-libgcc +configure-stage4-target-libgcc: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libgcc..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgcc"; \ + libsrcdir="$$s/libgcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ +@endif target-libgcc-bootstrap + +.PHONY: configure-stageprofile-target-libgcc maybe-configure-stageprofile-target-libgcc +maybe-configure-stageprofile-target-libgcc: +@if target-libgcc-bootstrap +maybe-configure-stageprofile-target-libgcc: configure-stageprofile-target-libgcc +configure-stageprofile-target-libgcc: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libgcc..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ + echo Configuring stage profile in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgcc"; \ + libsrcdir="$$s/libgcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ +@endif target-libgcc-bootstrap + +.PHONY: configure-stagefeedback-target-libgcc maybe-configure-stagefeedback-target-libgcc +maybe-configure-stagefeedback-target-libgcc: +@if target-libgcc-bootstrap +maybe-configure-stagefeedback-target-libgcc: configure-stagefeedback-target-libgcc +configure-stagefeedback-target-libgcc: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libgcc..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgcc"; \ + libsrcdir="$$s/libgcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ +@endif target-libgcc-bootstrap + + + + + +.PHONY: all-target-libgcc maybe-all-target-libgcc +maybe-all-target-libgcc: +@if gcc-bootstrap +all-target-libgcc: stage_current +@endif gcc-bootstrap +@if target-libgcc +TARGET-target-libgcc=all +maybe-all-target-libgcc: all-target-libgcc +all-target-libgcc: configure-target-libgcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libgcc)) +@endif target-libgcc + + + +.PHONY: all-stage1-target-libgcc maybe-all-stage1-target-libgcc +.PHONY: clean-stage1-target-libgcc maybe-clean-stage1-target-libgcc +maybe-all-stage1-target-libgcc: +maybe-clean-stage1-target-libgcc: +@if target-libgcc-bootstrap +maybe-all-stage1-target-libgcc: all-stage1-target-libgcc +all-stage1: all-stage1-target-libgcc +TARGET-stage1-target-libgcc = $(TARGET-target-libgcc) +all-stage1-target-libgcc: configure-stage1-target-libgcc + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(TARGET-stage1-target-libgcc) + +maybe-clean-stage1-target-libgcc: clean-stage1-target-libgcc +clean-stage1: clean-stage1-target-libgcc +clean-stage1-target-libgcc: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stage1-libgcc/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + clean +@endif target-libgcc-bootstrap + + +.PHONY: all-stage2-target-libgcc maybe-all-stage2-target-libgcc +.PHONY: clean-stage2-target-libgcc maybe-clean-stage2-target-libgcc +maybe-all-stage2-target-libgcc: +maybe-clean-stage2-target-libgcc: +@if target-libgcc-bootstrap +maybe-all-stage2-target-libgcc: all-stage2-target-libgcc +all-stage2: all-stage2-target-libgcc +TARGET-stage2-target-libgcc = $(TARGET-target-libgcc) +all-stage2-target-libgcc: configure-stage2-target-libgcc + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" \ + $(TARGET-stage2-target-libgcc) + +maybe-clean-stage2-target-libgcc: clean-stage2-target-libgcc +clean-stage2: clean-stage2-target-libgcc +clean-stage2-target-libgcc: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stage2-libgcc/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + \ + clean +@endif target-libgcc-bootstrap + + +.PHONY: all-stage3-target-libgcc maybe-all-stage3-target-libgcc +.PHONY: clean-stage3-target-libgcc maybe-clean-stage3-target-libgcc +maybe-all-stage3-target-libgcc: +maybe-clean-stage3-target-libgcc: +@if target-libgcc-bootstrap +maybe-all-stage3-target-libgcc: all-stage3-target-libgcc +all-stage3: all-stage3-target-libgcc +TARGET-stage3-target-libgcc = $(TARGET-target-libgcc) +all-stage3-target-libgcc: configure-stage3-target-libgcc + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" \ + $(TARGET-stage3-target-libgcc) + +maybe-clean-stage3-target-libgcc: clean-stage3-target-libgcc +clean-stage3: clean-stage3-target-libgcc +clean-stage3-target-libgcc: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stage3-libgcc/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + \ + clean +@endif target-libgcc-bootstrap + + +.PHONY: all-stage4-target-libgcc maybe-all-stage4-target-libgcc +.PHONY: clean-stage4-target-libgcc maybe-clean-stage4-target-libgcc +maybe-all-stage4-target-libgcc: +maybe-clean-stage4-target-libgcc: +@if target-libgcc-bootstrap +maybe-all-stage4-target-libgcc: all-stage4-target-libgcc +all-stage4: all-stage4-target-libgcc +TARGET-stage4-target-libgcc = $(TARGET-target-libgcc) +all-stage4-target-libgcc: configure-stage4-target-libgcc + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" \ + $(TARGET-stage4-target-libgcc) + +maybe-clean-stage4-target-libgcc: clean-stage4-target-libgcc +clean-stage4: clean-stage4-target-libgcc +clean-stage4-target-libgcc: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stage4-libgcc/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + \ + clean +@endif target-libgcc-bootstrap + + +.PHONY: all-stageprofile-target-libgcc maybe-all-stageprofile-target-libgcc +.PHONY: clean-stageprofile-target-libgcc maybe-clean-stageprofile-target-libgcc +maybe-all-stageprofile-target-libgcc: +maybe-clean-stageprofile-target-libgcc: +@if target-libgcc-bootstrap +maybe-all-stageprofile-target-libgcc: all-stageprofile-target-libgcc +all-stageprofile: all-stageprofile-target-libgcc +TARGET-stageprofile-target-libgcc = $(TARGET-target-libgcc) +all-stageprofile-target-libgcc: configure-stageprofile-target-libgcc + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(TARGET-stageprofile-target-libgcc) + +maybe-clean-stageprofile-target-libgcc: clean-stageprofile-target-libgcc +clean-stageprofile: clean-stageprofile-target-libgcc +clean-stageprofile-target-libgcc: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stageprofile-libgcc/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + \ + clean +@endif target-libgcc-bootstrap + + +.PHONY: all-stagefeedback-target-libgcc maybe-all-stagefeedback-target-libgcc +.PHONY: clean-stagefeedback-target-libgcc maybe-clean-stagefeedback-target-libgcc +maybe-all-stagefeedback-target-libgcc: +maybe-clean-stagefeedback-target-libgcc: +@if target-libgcc-bootstrap +maybe-all-stagefeedback-target-libgcc: all-stagefeedback-target-libgcc +all-stagefeedback: all-stagefeedback-target-libgcc +TARGET-stagefeedback-target-libgcc = $(TARGET-target-libgcc) +all-stagefeedback-target-libgcc: configure-stagefeedback-target-libgcc + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(TARGET-stagefeedback-target-libgcc) + +maybe-clean-stagefeedback-target-libgcc: clean-stagefeedback-target-libgcc +clean-stagefeedback: clean-stagefeedback-target-libgcc +clean-stagefeedback-target-libgcc: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stagefeedback-libgcc/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + \ + clean +@endif target-libgcc-bootstrap + + + + + + +.PHONY: check-target-libgcc maybe-check-target-libgcc +maybe-check-target-libgcc: +@if target-libgcc +maybe-check-target-libgcc: check-target-libgcc + +# Dummy target for uncheckable module. +check-target-libgcc: + +@endif target-libgcc + +.PHONY: install-target-libgcc maybe-install-target-libgcc +maybe-install-target-libgcc: +@if target-libgcc +maybe-install-target-libgcc: install-target-libgcc + +install-target-libgcc: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + +@endif target-libgcc + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-target-libgcc info-target-libgcc +maybe-info-target-libgcc: +@if target-libgcc +maybe-info-target-libgcc: info-target-libgcc + +info-target-libgcc: \ + configure-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing info in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-dvi-target-libgcc dvi-target-libgcc +maybe-dvi-target-libgcc: +@if target-libgcc +maybe-dvi-target-libgcc: dvi-target-libgcc + +dvi-target-libgcc: \ + configure-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-pdf-target-libgcc pdf-target-libgcc +maybe-pdf-target-libgcc: +@if target-libgcc +maybe-pdf-target-libgcc: pdf-target-libgcc + +pdf-target-libgcc: \ + configure-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-html-target-libgcc html-target-libgcc +maybe-html-target-libgcc: +@if target-libgcc +maybe-html-target-libgcc: html-target-libgcc + +html-target-libgcc: \ + configure-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing html in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + html) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-TAGS-target-libgcc TAGS-target-libgcc +maybe-TAGS-target-libgcc: +@if target-libgcc +maybe-TAGS-target-libgcc: TAGS-target-libgcc + +TAGS-target-libgcc: \ + configure-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-install-info-target-libgcc install-info-target-libgcc +maybe-install-info-target-libgcc: +@if target-libgcc +maybe-install-info-target-libgcc: install-info-target-libgcc + +install-info-target-libgcc: \ + configure-target-libgcc \ + info-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-install-pdf-target-libgcc install-pdf-target-libgcc +maybe-install-pdf-target-libgcc: +@if target-libgcc +maybe-install-pdf-target-libgcc: install-pdf-target-libgcc + +install-pdf-target-libgcc: \ + configure-target-libgcc \ + pdf-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-install-html-target-libgcc install-html-target-libgcc +maybe-install-html-target-libgcc: +@if target-libgcc +maybe-install-html-target-libgcc: install-html-target-libgcc + +install-html-target-libgcc: \ + configure-target-libgcc \ + html-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-html in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-html) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-installcheck-target-libgcc installcheck-target-libgcc +maybe-installcheck-target-libgcc: +@if target-libgcc +maybe-installcheck-target-libgcc: installcheck-target-libgcc + +installcheck-target-libgcc: \ + configure-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-mostlyclean-target-libgcc mostlyclean-target-libgcc +maybe-mostlyclean-target-libgcc: +@if target-libgcc +maybe-mostlyclean-target-libgcc: mostlyclean-target-libgcc + +mostlyclean-target-libgcc: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-clean-target-libgcc clean-target-libgcc +maybe-clean-target-libgcc: +@if target-libgcc +maybe-clean-target-libgcc: clean-target-libgcc + +clean-target-libgcc: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing clean in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-distclean-target-libgcc distclean-target-libgcc +maybe-distclean-target-libgcc: +@if target-libgcc +maybe-distclean-target-libgcc: distclean-target-libgcc + +distclean-target-libgcc: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-maintainer-clean-target-libgcc maintainer-clean-target-libgcc +maybe-maintainer-clean-target-libgcc: +@if target-libgcc +maybe-maintainer-clean-target-libgcc: maintainer-clean-target-libgcc + +maintainer-clean-target-libgcc: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + +@endif target-libgcc + + + + + .PHONY: configure-target-libgfortran maybe-configure-target-libgfortran maybe-configure-target-libgfortran: +@if gcc-bootstrap +configure-target-libgfortran: stage_current +@endif gcc-bootstrap @if target-libgfortran maybe-configure-target-libgfortran: configure-target-libgfortran configure-target-libgfortran: @@ -33014,7 +40260,8 @@ configure-target-libgfortran: libsrcdir="$$s/libgfortran"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libgfortran @@ -33024,6 +40271,9 @@ configure-target-libgfortran: .PHONY: all-target-libgfortran maybe-all-target-libgfortran maybe-all-target-libgfortran: +@if gcc-bootstrap +all-target-libgfortran: stage_current +@endif gcc-bootstrap @if target-libgfortran TARGET-target-libgfortran=all maybe-all-target-libgfortran: all-target-libgfortran @@ -33070,7 +40320,7 @@ install-target-libgfortran: installdirs @endif target-libgfortran -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libgfortran info-target-libgfortran maybe-info-target-libgfortran: @@ -33124,6 +40374,32 @@ dvi-target-libgfortran: \ @endif target-libgfortran +.PHONY: maybe-pdf-target-libgfortran pdf-target-libgfortran +maybe-pdf-target-libgfortran: +@if target-libgfortran +maybe-pdf-target-libgfortran: pdf-target-libgfortran + +pdf-target-libgfortran: \ + configure-target-libgfortran + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libgfortran" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgfortran && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libgfortran + .PHONY: maybe-html-target-libgfortran html-target-libgfortran maybe-html-target-libgfortran: @if target-libgfortran @@ -33203,6 +40479,33 @@ install-info-target-libgfortran: \ @endif target-libgfortran +.PHONY: maybe-install-pdf-target-libgfortran install-pdf-target-libgfortran +maybe-install-pdf-target-libgfortran: +@if target-libgfortran +maybe-install-pdf-target-libgfortran: install-pdf-target-libgfortran + +install-pdf-target-libgfortran: \ + configure-target-libgfortran \ + pdf-target-libgfortran + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libgfortran" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgfortran && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libgfortran + .PHONY: maybe-install-html-target-libgfortran install-html-target-libgfortran maybe-install-html-target-libgfortran: @if target-libgfortran @@ -33362,6 +40665,9 @@ maintainer-clean-target-libgfortran: .PHONY: configure-target-libobjc maybe-configure-target-libobjc maybe-configure-target-libobjc: +@if gcc-bootstrap +configure-target-libobjc: stage_current +@endif gcc-bootstrap @if target-libobjc maybe-configure-target-libobjc: configure-target-libobjc configure-target-libobjc: @@ -33395,7 +40701,8 @@ configure-target-libobjc: libsrcdir="$$s/libobjc"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libobjc @@ -33405,6 +40712,9 @@ configure-target-libobjc: .PHONY: all-target-libobjc maybe-all-target-libobjc maybe-all-target-libobjc: +@if gcc-bootstrap +all-target-libobjc: stage_current +@endif gcc-bootstrap @if target-libobjc TARGET-target-libobjc=all maybe-all-target-libobjc: all-target-libobjc @@ -33451,7 +40761,7 @@ install-target-libobjc: installdirs @endif target-libobjc -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libobjc info-target-libobjc maybe-info-target-libobjc: @@ -33505,6 +40815,32 @@ dvi-target-libobjc: \ @endif target-libobjc +.PHONY: maybe-pdf-target-libobjc pdf-target-libobjc +maybe-pdf-target-libobjc: +@if target-libobjc +maybe-pdf-target-libobjc: pdf-target-libobjc + +pdf-target-libobjc: \ + configure-target-libobjc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libobjc + .PHONY: maybe-html-target-libobjc html-target-libobjc maybe-html-target-libobjc: @if target-libobjc @@ -33584,6 +40920,33 @@ install-info-target-libobjc: \ @endif target-libobjc +.PHONY: maybe-install-pdf-target-libobjc install-pdf-target-libobjc +maybe-install-pdf-target-libobjc: +@if target-libobjc +maybe-install-pdf-target-libobjc: install-pdf-target-libobjc + +install-pdf-target-libobjc: \ + configure-target-libobjc \ + pdf-target-libobjc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libobjc + .PHONY: maybe-install-html-target-libobjc install-html-target-libobjc maybe-install-html-target-libobjc: @if target-libobjc @@ -33743,6 +41106,9 @@ maintainer-clean-target-libobjc: .PHONY: configure-target-libtermcap maybe-configure-target-libtermcap maybe-configure-target-libtermcap: +@if gcc-bootstrap +configure-target-libtermcap: stage_current +@endif gcc-bootstrap @if target-libtermcap maybe-configure-target-libtermcap: configure-target-libtermcap configure-target-libtermcap: @@ -33776,7 +41142,8 @@ configure-target-libtermcap: libsrcdir="$$s/libtermcap"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libtermcap @@ -33786,6 +41153,9 @@ configure-target-libtermcap: .PHONY: all-target-libtermcap maybe-all-target-libtermcap maybe-all-target-libtermcap: +@if gcc-bootstrap +all-target-libtermcap: stage_current +@endif gcc-bootstrap @if target-libtermcap TARGET-target-libtermcap=all maybe-all-target-libtermcap: all-target-libtermcap @@ -33827,7 +41197,7 @@ install-target-libtermcap: installdirs @endif target-libtermcap -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libtermcap info-target-libtermcap maybe-info-target-libtermcap: @@ -33881,6 +41251,32 @@ dvi-target-libtermcap: \ @endif target-libtermcap +.PHONY: maybe-pdf-target-libtermcap pdf-target-libtermcap +maybe-pdf-target-libtermcap: +@if target-libtermcap +maybe-pdf-target-libtermcap: pdf-target-libtermcap + +pdf-target-libtermcap: \ + configure-target-libtermcap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libtermcap + .PHONY: maybe-html-target-libtermcap html-target-libtermcap maybe-html-target-libtermcap: @if target-libtermcap @@ -33960,6 +41356,33 @@ install-info-target-libtermcap: \ @endif target-libtermcap +.PHONY: maybe-install-pdf-target-libtermcap install-pdf-target-libtermcap +maybe-install-pdf-target-libtermcap: +@if target-libtermcap +maybe-install-pdf-target-libtermcap: install-pdf-target-libtermcap + +install-pdf-target-libtermcap: \ + configure-target-libtermcap \ + pdf-target-libtermcap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libtermcap + .PHONY: maybe-install-html-target-libtermcap install-html-target-libtermcap maybe-install-html-target-libtermcap: @if target-libtermcap @@ -34059,6 +41482,9 @@ maintainer-clean-target-libtermcap: .PHONY: configure-target-winsup maybe-configure-target-winsup maybe-configure-target-winsup: +@if gcc-bootstrap +configure-target-winsup: stage_current +@endif gcc-bootstrap @if target-winsup maybe-configure-target-winsup: configure-target-winsup configure-target-winsup: @@ -34092,7 +41518,8 @@ configure-target-winsup: libsrcdir="$$s/winsup"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-winsup @@ -34102,6 +41529,9 @@ configure-target-winsup: .PHONY: all-target-winsup maybe-all-target-winsup maybe-all-target-winsup: +@if gcc-bootstrap +all-target-winsup: stage_current +@endif gcc-bootstrap @if target-winsup TARGET-target-winsup=all maybe-all-target-winsup: all-target-winsup @@ -34148,7 +41578,7 @@ install-target-winsup: installdirs @endif target-winsup -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-winsup info-target-winsup maybe-info-target-winsup: @@ -34202,6 +41632,32 @@ dvi-target-winsup: \ @endif target-winsup +.PHONY: maybe-pdf-target-winsup pdf-target-winsup +maybe-pdf-target-winsup: +@if target-winsup +maybe-pdf-target-winsup: pdf-target-winsup + +pdf-target-winsup: \ + configure-target-winsup + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-winsup + .PHONY: maybe-html-target-winsup html-target-winsup maybe-html-target-winsup: @if target-winsup @@ -34281,6 +41737,33 @@ install-info-target-winsup: \ @endif target-winsup +.PHONY: maybe-install-pdf-target-winsup install-pdf-target-winsup +maybe-install-pdf-target-winsup: +@if target-winsup +maybe-install-pdf-target-winsup: install-pdf-target-winsup + +install-pdf-target-winsup: \ + configure-target-winsup \ + pdf-target-winsup + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-winsup + .PHONY: maybe-install-html-target-winsup install-html-target-winsup maybe-install-html-target-winsup: @if target-winsup @@ -34440,6 +41923,9 @@ maintainer-clean-target-winsup: .PHONY: configure-target-libgloss maybe-configure-target-libgloss maybe-configure-target-libgloss: +@if gcc-bootstrap +configure-target-libgloss: stage_current +@endif gcc-bootstrap @if target-libgloss maybe-configure-target-libgloss: configure-target-libgloss configure-target-libgloss: @@ -34473,7 +41959,8 @@ configure-target-libgloss: libsrcdir="$$s/libgloss"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libgloss @@ -34483,6 +41970,9 @@ configure-target-libgloss: .PHONY: all-target-libgloss maybe-all-target-libgloss maybe-all-target-libgloss: +@if gcc-bootstrap +all-target-libgloss: stage_current +@endif gcc-bootstrap @if target-libgloss TARGET-target-libgloss=all maybe-all-target-libgloss: all-target-libgloss @@ -34524,7 +42014,7 @@ install-target-libgloss: installdirs @endif target-libgloss -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libgloss info-target-libgloss maybe-info-target-libgloss: @@ -34578,6 +42068,32 @@ dvi-target-libgloss: \ @endif target-libgloss +.PHONY: maybe-pdf-target-libgloss pdf-target-libgloss +maybe-pdf-target-libgloss: +@if target-libgloss +maybe-pdf-target-libgloss: pdf-target-libgloss + +pdf-target-libgloss: \ + configure-target-libgloss + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libgloss + .PHONY: maybe-html-target-libgloss html-target-libgloss maybe-html-target-libgloss: @if target-libgloss @@ -34657,6 +42173,33 @@ install-info-target-libgloss: \ @endif target-libgloss +.PHONY: maybe-install-pdf-target-libgloss install-pdf-target-libgloss +maybe-install-pdf-target-libgloss: +@if target-libgloss +maybe-install-pdf-target-libgloss: install-pdf-target-libgloss + +install-pdf-target-libgloss: \ + configure-target-libgloss \ + pdf-target-libgloss + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libgloss + .PHONY: maybe-install-html-target-libgloss install-html-target-libgloss maybe-install-html-target-libgloss: @if target-libgloss @@ -34816,6 +42359,9 @@ maintainer-clean-target-libgloss: .PHONY: configure-target-libiberty maybe-configure-target-libiberty maybe-configure-target-libiberty: +@if gcc-bootstrap +configure-target-libiberty: stage_current +@endif gcc-bootstrap @if target-libiberty maybe-configure-target-libiberty: configure-target-libiberty configure-target-libiberty: @@ -34849,7 +42395,8 @@ configure-target-libiberty: libsrcdir="$$s/libiberty"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libiberty @@ -34859,6 +42406,9 @@ configure-target-libiberty: .PHONY: all-target-libiberty maybe-all-target-libiberty maybe-all-target-libiberty: +@if gcc-bootstrap +all-target-libiberty: stage_current +@endif gcc-bootstrap @if target-libiberty TARGET-target-libiberty=all maybe-all-target-libiberty: all-target-libiberty @@ -34905,7 +42455,7 @@ install-target-libiberty: installdirs @endif target-libiberty -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libiberty info-target-libiberty maybe-info-target-libiberty: @@ -34959,6 +42509,32 @@ dvi-target-libiberty: \ @endif target-libiberty +.PHONY: maybe-pdf-target-libiberty pdf-target-libiberty +maybe-pdf-target-libiberty: +@if target-libiberty +maybe-pdf-target-libiberty: pdf-target-libiberty + +pdf-target-libiberty: \ + configure-target-libiberty + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libiberty + .PHONY: maybe-html-target-libiberty html-target-libiberty maybe-html-target-libiberty: @if target-libiberty @@ -35038,6 +42614,33 @@ install-info-target-libiberty: \ @endif target-libiberty +.PHONY: maybe-install-pdf-target-libiberty install-pdf-target-libiberty +maybe-install-pdf-target-libiberty: +@if target-libiberty +maybe-install-pdf-target-libiberty: install-pdf-target-libiberty + +install-pdf-target-libiberty: \ + configure-target-libiberty \ + pdf-target-libiberty + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libiberty + .PHONY: maybe-install-html-target-libiberty install-html-target-libiberty maybe-install-html-target-libiberty: @if target-libiberty @@ -35197,6 +42800,9 @@ maintainer-clean-target-libiberty: .PHONY: configure-target-gperf maybe-configure-target-gperf maybe-configure-target-gperf: +@if gcc-bootstrap +configure-target-gperf: stage_current +@endif gcc-bootstrap @if target-gperf maybe-configure-target-gperf: configure-target-gperf configure-target-gperf: @@ -35230,7 +42836,8 @@ configure-target-gperf: libsrcdir="$$s/gperf"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-gperf @@ -35240,6 +42847,9 @@ configure-target-gperf: .PHONY: all-target-gperf maybe-all-target-gperf maybe-all-target-gperf: +@if gcc-bootstrap +all-target-gperf: stage_current +@endif gcc-bootstrap @if target-gperf TARGET-target-gperf=all maybe-all-target-gperf: all-target-gperf @@ -35286,7 +42896,7 @@ install-target-gperf: installdirs @endif target-gperf -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-gperf info-target-gperf maybe-info-target-gperf: @@ -35340,6 +42950,32 @@ dvi-target-gperf: \ @endif target-gperf +.PHONY: maybe-pdf-target-gperf pdf-target-gperf +maybe-pdf-target-gperf: +@if target-gperf +maybe-pdf-target-gperf: pdf-target-gperf + +pdf-target-gperf: \ + configure-target-gperf + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-gperf + .PHONY: maybe-html-target-gperf html-target-gperf maybe-html-target-gperf: @if target-gperf @@ -35419,6 +43055,33 @@ install-info-target-gperf: \ @endif target-gperf +.PHONY: maybe-install-pdf-target-gperf install-pdf-target-gperf +maybe-install-pdf-target-gperf: +@if target-gperf +maybe-install-pdf-target-gperf: install-pdf-target-gperf + +install-pdf-target-gperf: \ + configure-target-gperf \ + pdf-target-gperf + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-gperf + .PHONY: maybe-install-html-target-gperf install-html-target-gperf maybe-install-html-target-gperf: @if target-gperf @@ -35578,6 +43241,9 @@ maintainer-clean-target-gperf: .PHONY: configure-target-examples maybe-configure-target-examples maybe-configure-target-examples: +@if gcc-bootstrap +configure-target-examples: stage_current +@endif gcc-bootstrap @if target-examples maybe-configure-target-examples: configure-target-examples configure-target-examples: @@ -35611,7 +43277,8 @@ configure-target-examples: libsrcdir="$$s/examples"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-examples @@ -35621,6 +43288,9 @@ configure-target-examples: .PHONY: all-target-examples maybe-all-target-examples maybe-all-target-examples: +@if gcc-bootstrap +all-target-examples: stage_current +@endif gcc-bootstrap @if target-examples TARGET-target-examples=all maybe-all-target-examples: all-target-examples @@ -35657,7 +43327,7 @@ install-target-examples: @endif target-examples -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-examples info-target-examples maybe-info-target-examples: @@ -35711,6 +43381,32 @@ dvi-target-examples: \ @endif target-examples +.PHONY: maybe-pdf-target-examples pdf-target-examples +maybe-pdf-target-examples: +@if target-examples +maybe-pdf-target-examples: pdf-target-examples + +pdf-target-examples: \ + configure-target-examples + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-examples + .PHONY: maybe-html-target-examples html-target-examples maybe-html-target-examples: @if target-examples @@ -35790,6 +43486,33 @@ install-info-target-examples: \ @endif target-examples +.PHONY: maybe-install-pdf-target-examples install-pdf-target-examples +maybe-install-pdf-target-examples: +@if target-examples +maybe-install-pdf-target-examples: install-pdf-target-examples + +install-pdf-target-examples: \ + configure-target-examples \ + pdf-target-examples + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-examples + .PHONY: maybe-install-html-target-examples install-html-target-examples maybe-install-html-target-examples: @if target-examples @@ -35949,6 +43672,9 @@ maintainer-clean-target-examples: .PHONY: configure-target-libffi maybe-configure-target-libffi maybe-configure-target-libffi: +@if gcc-bootstrap +configure-target-libffi: stage_current +@endif gcc-bootstrap @if target-libffi maybe-configure-target-libffi: configure-target-libffi configure-target-libffi: @@ -35982,7 +43708,8 @@ configure-target-libffi: libsrcdir="$$s/libffi"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libffi @@ -35992,6 +43719,9 @@ configure-target-libffi: .PHONY: all-target-libffi maybe-all-target-libffi maybe-all-target-libffi: +@if gcc-bootstrap +all-target-libffi: stage_current +@endif gcc-bootstrap @if target-libffi TARGET-target-libffi=all maybe-all-target-libffi: all-target-libffi @@ -36038,7 +43768,7 @@ install-target-libffi: installdirs @endif target-libffi -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libffi info-target-libffi maybe-info-target-libffi: @@ -36092,6 +43822,32 @@ dvi-target-libffi: \ @endif target-libffi +.PHONY: maybe-pdf-target-libffi pdf-target-libffi +maybe-pdf-target-libffi: +@if target-libffi +maybe-pdf-target-libffi: pdf-target-libffi + +pdf-target-libffi: \ + configure-target-libffi + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libffi + .PHONY: maybe-html-target-libffi html-target-libffi maybe-html-target-libffi: @if target-libffi @@ -36171,6 +43927,33 @@ install-info-target-libffi: \ @endif target-libffi +.PHONY: maybe-install-pdf-target-libffi install-pdf-target-libffi +maybe-install-pdf-target-libffi: +@if target-libffi +maybe-install-pdf-target-libffi: install-pdf-target-libffi + +install-pdf-target-libffi: \ + configure-target-libffi \ + pdf-target-libffi + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libffi + .PHONY: maybe-install-html-target-libffi install-html-target-libffi maybe-install-html-target-libffi: @if target-libffi @@ -36330,6 +44113,9 @@ maintainer-clean-target-libffi: .PHONY: configure-target-libjava maybe-configure-target-libjava maybe-configure-target-libjava: +@if gcc-bootstrap +configure-target-libjava: stage_current +@endif gcc-bootstrap @if target-libjava maybe-configure-target-libjava: configure-target-libjava configure-target-libjava: @@ -36363,7 +44149,8 @@ configure-target-libjava: libsrcdir="$$s/libjava"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libjava @@ -36373,6 +44160,9 @@ configure-target-libjava: .PHONY: all-target-libjava maybe-all-target-libjava maybe-all-target-libjava: +@if gcc-bootstrap +all-target-libjava: stage_current +@endif gcc-bootstrap @if target-libjava TARGET-target-libjava=all maybe-all-target-libjava: all-target-libjava @@ -36419,7 +44209,7 @@ install-target-libjava: installdirs @endif target-libjava -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libjava info-target-libjava maybe-info-target-libjava: @@ -36473,6 +44263,32 @@ dvi-target-libjava: \ @endif target-libjava +.PHONY: maybe-pdf-target-libjava pdf-target-libjava +maybe-pdf-target-libjava: +@if target-libjava +maybe-pdf-target-libjava: pdf-target-libjava + +pdf-target-libjava: \ + configure-target-libjava + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libjava + .PHONY: maybe-html-target-libjava html-target-libjava maybe-html-target-libjava: @if target-libjava @@ -36552,6 +44368,33 @@ install-info-target-libjava: \ @endif target-libjava +.PHONY: maybe-install-pdf-target-libjava install-pdf-target-libjava +maybe-install-pdf-target-libjava: +@if target-libjava +maybe-install-pdf-target-libjava: install-pdf-target-libjava + +install-pdf-target-libjava: \ + configure-target-libjava \ + pdf-target-libjava + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libjava + .PHONY: maybe-install-html-target-libjava install-html-target-libjava maybe-install-html-target-libjava: @if target-libjava @@ -36711,6 +44554,9 @@ maintainer-clean-target-libjava: .PHONY: configure-target-zlib maybe-configure-target-zlib maybe-configure-target-zlib: +@if gcc-bootstrap +configure-target-zlib: stage_current +@endif gcc-bootstrap @if target-zlib maybe-configure-target-zlib: configure-target-zlib configure-target-zlib: @@ -36744,7 +44590,8 @@ configure-target-zlib: libsrcdir="$$s/zlib"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-zlib @@ -36754,6 +44601,9 @@ configure-target-zlib: .PHONY: all-target-zlib maybe-all-target-zlib maybe-all-target-zlib: +@if gcc-bootstrap +all-target-zlib: stage_current +@endif gcc-bootstrap @if target-zlib TARGET-target-zlib=all maybe-all-target-zlib: all-target-zlib @@ -36800,7 +44650,7 @@ install-target-zlib: installdirs @endif target-zlib -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-zlib info-target-zlib maybe-info-target-zlib: @@ -36854,6 +44704,32 @@ dvi-target-zlib: \ @endif target-zlib +.PHONY: maybe-pdf-target-zlib pdf-target-zlib +maybe-pdf-target-zlib: +@if target-zlib +maybe-pdf-target-zlib: pdf-target-zlib + +pdf-target-zlib: \ + configure-target-zlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-zlib + .PHONY: maybe-html-target-zlib html-target-zlib maybe-html-target-zlib: @if target-zlib @@ -36933,6 +44809,33 @@ install-info-target-zlib: \ @endif target-zlib +.PHONY: maybe-install-pdf-target-zlib install-pdf-target-zlib +maybe-install-pdf-target-zlib: +@if target-zlib +maybe-install-pdf-target-zlib: install-pdf-target-zlib + +install-pdf-target-zlib: \ + configure-target-zlib \ + pdf-target-zlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-zlib + .PHONY: maybe-install-html-target-zlib install-html-target-zlib maybe-install-html-target-zlib: @if target-zlib @@ -37092,6 +44995,9 @@ maintainer-clean-target-zlib: .PHONY: configure-target-boehm-gc maybe-configure-target-boehm-gc maybe-configure-target-boehm-gc: +@if gcc-bootstrap +configure-target-boehm-gc: stage_current +@endif gcc-bootstrap @if target-boehm-gc maybe-configure-target-boehm-gc: configure-target-boehm-gc configure-target-boehm-gc: @@ -37125,7 +45031,8 @@ configure-target-boehm-gc: libsrcdir="$$s/boehm-gc"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-boehm-gc @@ -37135,6 +45042,9 @@ configure-target-boehm-gc: .PHONY: all-target-boehm-gc maybe-all-target-boehm-gc maybe-all-target-boehm-gc: +@if gcc-bootstrap +all-target-boehm-gc: stage_current +@endif gcc-bootstrap @if target-boehm-gc TARGET-target-boehm-gc=all maybe-all-target-boehm-gc: all-target-boehm-gc @@ -37181,7 +45091,7 @@ install-target-boehm-gc: installdirs @endif target-boehm-gc -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-boehm-gc info-target-boehm-gc maybe-info-target-boehm-gc: @@ -37235,6 +45145,32 @@ dvi-target-boehm-gc: \ @endif target-boehm-gc +.PHONY: maybe-pdf-target-boehm-gc pdf-target-boehm-gc +maybe-pdf-target-boehm-gc: +@if target-boehm-gc +maybe-pdf-target-boehm-gc: pdf-target-boehm-gc + +pdf-target-boehm-gc: \ + configure-target-boehm-gc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-boehm-gc + .PHONY: maybe-html-target-boehm-gc html-target-boehm-gc maybe-html-target-boehm-gc: @if target-boehm-gc @@ -37314,6 +45250,33 @@ install-info-target-boehm-gc: \ @endif target-boehm-gc +.PHONY: maybe-install-pdf-target-boehm-gc install-pdf-target-boehm-gc +maybe-install-pdf-target-boehm-gc: +@if target-boehm-gc +maybe-install-pdf-target-boehm-gc: install-pdf-target-boehm-gc + +install-pdf-target-boehm-gc: \ + configure-target-boehm-gc \ + pdf-target-boehm-gc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-boehm-gc + .PHONY: maybe-install-html-target-boehm-gc install-html-target-boehm-gc maybe-install-html-target-boehm-gc: @if target-boehm-gc @@ -37473,6 +45436,9 @@ maintainer-clean-target-boehm-gc: .PHONY: configure-target-qthreads maybe-configure-target-qthreads maybe-configure-target-qthreads: +@if gcc-bootstrap +configure-target-qthreads: stage_current +@endif gcc-bootstrap @if target-qthreads maybe-configure-target-qthreads: configure-target-qthreads configure-target-qthreads: @@ -37506,7 +45472,8 @@ configure-target-qthreads: libsrcdir="$$s/qthreads"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-qthreads @@ -37516,6 +45483,9 @@ configure-target-qthreads: .PHONY: all-target-qthreads maybe-all-target-qthreads maybe-all-target-qthreads: +@if gcc-bootstrap +all-target-qthreads: stage_current +@endif gcc-bootstrap @if target-qthreads TARGET-target-qthreads=all maybe-all-target-qthreads: all-target-qthreads @@ -37562,7 +45532,7 @@ install-target-qthreads: installdirs @endif target-qthreads -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-qthreads info-target-qthreads maybe-info-target-qthreads: @@ -37616,6 +45586,32 @@ dvi-target-qthreads: \ @endif target-qthreads +.PHONY: maybe-pdf-target-qthreads pdf-target-qthreads +maybe-pdf-target-qthreads: +@if target-qthreads +maybe-pdf-target-qthreads: pdf-target-qthreads + +pdf-target-qthreads: \ + configure-target-qthreads + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-qthreads + .PHONY: maybe-html-target-qthreads html-target-qthreads maybe-html-target-qthreads: @if target-qthreads @@ -37695,6 +45691,33 @@ install-info-target-qthreads: \ @endif target-qthreads +.PHONY: maybe-install-pdf-target-qthreads install-pdf-target-qthreads +maybe-install-pdf-target-qthreads: +@if target-qthreads +maybe-install-pdf-target-qthreads: install-pdf-target-qthreads + +install-pdf-target-qthreads: \ + configure-target-qthreads \ + pdf-target-qthreads + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-qthreads + .PHONY: maybe-install-html-target-qthreads install-html-target-qthreads maybe-install-html-target-qthreads: @if target-qthreads @@ -37854,6 +45877,9 @@ maintainer-clean-target-qthreads: .PHONY: configure-target-rda maybe-configure-target-rda maybe-configure-target-rda: +@if gcc-bootstrap +configure-target-rda: stage_current +@endif gcc-bootstrap @if target-rda maybe-configure-target-rda: configure-target-rda configure-target-rda: @@ -37887,7 +45913,8 @@ configure-target-rda: libsrcdir="$$s/rda"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-rda @@ -37897,6 +45924,9 @@ configure-target-rda: .PHONY: all-target-rda maybe-all-target-rda maybe-all-target-rda: +@if gcc-bootstrap +all-target-rda: stage_current +@endif gcc-bootstrap @if target-rda TARGET-target-rda=all maybe-all-target-rda: all-target-rda @@ -37943,7 +45973,7 @@ install-target-rda: installdirs @endif target-rda -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-rda info-target-rda maybe-info-target-rda: @@ -37997,6 +46027,32 @@ dvi-target-rda: \ @endif target-rda +.PHONY: maybe-pdf-target-rda pdf-target-rda +maybe-pdf-target-rda: +@if target-rda +maybe-pdf-target-rda: pdf-target-rda + +pdf-target-rda: \ + configure-target-rda + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-rda + .PHONY: maybe-html-target-rda html-target-rda maybe-html-target-rda: @if target-rda @@ -38076,6 +46132,33 @@ install-info-target-rda: \ @endif target-rda +.PHONY: maybe-install-pdf-target-rda install-pdf-target-rda +maybe-install-pdf-target-rda: +@if target-rda +maybe-install-pdf-target-rda: install-pdf-target-rda + +install-pdf-target-rda: \ + configure-target-rda \ + pdf-target-rda + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-rda + .PHONY: maybe-install-html-target-rda install-html-target-rda maybe-install-html-target-rda: @if target-rda @@ -38235,6 +46318,9 @@ maintainer-clean-target-rda: .PHONY: configure-target-libada maybe-configure-target-libada maybe-configure-target-libada: +@if gcc-bootstrap +configure-target-libada: stage_current +@endif gcc-bootstrap @if target-libada maybe-configure-target-libada: configure-target-libada configure-target-libada: @@ -38268,7 +46354,8 @@ configure-target-libada: libsrcdir="$$s/libada"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libada @@ -38278,6 +46365,9 @@ configure-target-libada: .PHONY: all-target-libada maybe-all-target-libada maybe-all-target-libada: +@if gcc-bootstrap +all-target-libada: stage_current +@endif gcc-bootstrap @if target-libada TARGET-target-libada=all maybe-all-target-libada: all-target-libada @@ -38324,7 +46414,7 @@ install-target-libada: installdirs @endif target-libada -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libada info-target-libada maybe-info-target-libada: @@ -38378,6 +46468,32 @@ dvi-target-libada: \ @endif target-libada +.PHONY: maybe-pdf-target-libada pdf-target-libada +maybe-pdf-target-libada: +@if target-libada +maybe-pdf-target-libada: pdf-target-libada + +pdf-target-libada: \ + configure-target-libada + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libada + .PHONY: maybe-html-target-libada html-target-libada maybe-html-target-libada: @if target-libada @@ -38457,6 +46573,33 @@ install-info-target-libada: \ @endif target-libada +.PHONY: maybe-install-pdf-target-libada install-pdf-target-libada +maybe-install-pdf-target-libada: +@if target-libada +maybe-install-pdf-target-libada: install-pdf-target-libada + +install-pdf-target-libada: \ + configure-target-libada \ + pdf-target-libada + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libada + .PHONY: maybe-install-html-target-libada install-html-target-libada maybe-install-html-target-libada: @if target-libada @@ -38616,6 +46759,9 @@ maintainer-clean-target-libada: .PHONY: configure-target-libgomp maybe-configure-target-libgomp maybe-configure-target-libgomp: +@if gcc-bootstrap +configure-target-libgomp: stage_current +@endif gcc-bootstrap @if target-libgomp maybe-configure-target-libgomp: configure-target-libgomp configure-target-libgomp: @@ -38649,7 +46795,8 @@ configure-target-libgomp: libsrcdir="$$s/libgomp"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libgomp @@ -38659,6 +46806,9 @@ configure-target-libgomp: .PHONY: all-target-libgomp maybe-all-target-libgomp maybe-all-target-libgomp: +@if gcc-bootstrap +all-target-libgomp: stage_current +@endif gcc-bootstrap @if target-libgomp TARGET-target-libgomp=all maybe-all-target-libgomp: all-target-libgomp @@ -38705,7 +46855,7 @@ install-target-libgomp: installdirs @endif target-libgomp -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libgomp info-target-libgomp maybe-info-target-libgomp: @@ -38759,6 +46909,32 @@ dvi-target-libgomp: \ @endif target-libgomp +.PHONY: maybe-pdf-target-libgomp pdf-target-libgomp +maybe-pdf-target-libgomp: +@if target-libgomp +maybe-pdf-target-libgomp: pdf-target-libgomp + +pdf-target-libgomp: \ + configure-target-libgomp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libgomp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libgomp + .PHONY: maybe-html-target-libgomp html-target-libgomp maybe-html-target-libgomp: @if target-libgomp @@ -38838,6 +47014,33 @@ install-info-target-libgomp: \ @endif target-libgomp +.PHONY: maybe-install-pdf-target-libgomp install-pdf-target-libgomp +maybe-install-pdf-target-libgomp: +@if target-libgomp +maybe-install-pdf-target-libgomp: install-pdf-target-libgomp + +install-pdf-target-libgomp: \ + configure-target-libgomp \ + pdf-target-libgomp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libgomp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libgomp + .PHONY: maybe-install-html-target-libgomp install-html-target-libgomp maybe-install-html-target-libgomp: @if target-libgomp @@ -38998,60 +47201,6 @@ maintainer-clean-target-libgomp: # ---------- @if gcc-no-bootstrap -# GCC has some more recursive targets, which trigger the old -# (but still current, until the toplevel bootstrap project -# is finished) compiler bootstrapping rules. - -GCC_STRAP_TARGETS = bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap -.PHONY: $(GCC_STRAP_TARGETS) -$(GCC_STRAP_TARGETS): all-prebootstrap configure-gcc - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - echo "Bootstrapping the compiler"; \ - $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,:[ :]*,:,g;s,^[ :]*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ - cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@ - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - case "$@" in \ - *bootstrap4-lean ) \ - msg="Comparing stage3 and stage4 of the compiler"; \ - compare=compare3-lean ;; \ - *bootstrap4 ) \ - msg="Comparing stage3 and stage4 of the compiler"; \ - compare=compare3 ;; \ - *-lean ) \ - msg="Comparing stage2 and stage3 of the compiler"; \ - compare=compare-lean ;; \ - * ) \ - msg="Comparing stage2 and stage3 of the compiler"; \ - compare=compare ;; \ - esac; \ - $(HOST_EXPORTS) \ - echo "$$msg"; \ - cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ - echo "Building runtime libraries"; \ - $(MAKE) $(RECURSE_FLAGS_TO_PASS) all - -profiledbootstrap: all-prebootstrap configure-gcc - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,:[ :]*,:,g;s,^[ :]*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ - echo "Bootstrapping training compiler"; \ - cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stageprofile_build - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - echo "Building feedback based compiler"; \ - cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stagefeedback_build - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ - echo "Building runtime libraries"; \ - $(MAKE) $(RECURSE_FLAGS_TO_PASS) all - .PHONY: cross cross: all-build all-gas all-ld @r=`${PWD_COMMAND}`; export r; \ @@ -39121,7 +47270,7 @@ stage = : current_stage = "" @if gcc-bootstrap -unstage = [ -f stage_current ] || $(MAKE) `cat stage_last`-start +unstage = if [ -f stage_last ]; then [ -f stage_current ] || $(MAKE) `cat stage_last`-start || exit 1; else :; fi stage = if [ -f stage_current ]; then $(MAKE) `cat stage_current`-end || exit 1; else :; fi current_stage = "`cat stage_current 2> /dev/null`" @endif gcc-bootstrap @@ -39149,36 +47298,9 @@ LEAN = false # 'touch' doesn't work right on some platforms. STAMP = echo timestamp > -# Only build the C compiler for stage1, because that is the only one that -# we can guarantee will build with the native compiler, and also it is the -# only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS), -# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them -# overrideable (for a bootstrap build stage1 also builds gcc.info). - -STAGE1_CFLAGS=@stage1_cflags@ -STAGE1_LANGUAGES=@stage1_languages@ - # We only want to compare .o files, so set this! objext = .o -# Flags to pass to stage2 and later makes. -POSTSTAGE1_FLAGS_TO_PASS = \ - CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \ - STAGE_PREFIX=$$r/prev-gcc/ \ - CFLAGS="$(BOOT_CFLAGS)" \ - LIBCFLAGS="$(BOOT_CFLAGS)" \ - LDFLAGS="$(BOOT_LDFLAGS)" \ - ADAC="\$$(CC)" - -# For stage 1: -# * We force-disable intermodule optimizations, even if -# --enable-intermodule was passed, since the installed compiler probably -# can't handle them. Luckily, autoconf always respects -# the last argument when conflicting --enable arguments are passed. -# * Likewise, we force-disable coverage flags, since the installed compiler -# probably has never heard of them. -# * We build only C (and possibly Ada). - .PHONY: stage1-start stage1-end @@ -39212,6 +47334,16 @@ stage1-start:: mkdir stage1-gcc; \ mv stage1-gcc gcc @endif gcc +@if gmp + @cd $(HOST_SUBDIR); [ -d stage1-gmp ] || \ + mkdir stage1-gmp; \ + mv stage1-gmp gmp +@endif gmp +@if mpfr + @cd $(HOST_SUBDIR); [ -d stage1-mpfr ] || \ + mkdir stage1-mpfr; \ + mv stage1-mpfr mpfr +@endif mpfr @if intl @cd $(HOST_SUBDIR); [ -d stage1-intl ] || \ mkdir stage1-intl; \ @@ -39272,6 +47404,16 @@ stage1-end:: cd $(HOST_SUBDIR); mv gcc stage1-gcc ; \ fi @endif gcc +@if gmp + @if test -d $(HOST_SUBDIR)/gmp ; then \ + cd $(HOST_SUBDIR); mv gmp stage1-gmp ; \ + fi +@endif gmp +@if mpfr + @if test -d $(HOST_SUBDIR)/mpfr ; then \ + cd $(HOST_SUBDIR); mv mpfr stage1-mpfr ; \ + fi +@endif mpfr @if intl @if test -d $(HOST_SUBDIR)/intl ; then \ cd $(HOST_SUBDIR); mv intl stage1-intl ; \ @@ -39307,7 +47449,7 @@ stage1-end:: fi rm -f stage_current -# Bubble a bugfix through all the stages up to stage 1. They are +# Bubble a bug fix through all the stages up to stage 1. They are # remade, but not reconfigured. The next stage (if any) will not be # reconfigured as well. .PHONY: stage1-bubble @@ -39336,6 +47478,7 @@ do-clean: clean-stage1 .PHONY: distclean-stage1 distclean-stage1:: @: $(MAKE); $(stage) + @test "`cat stage_last`" != stage1 || rm -f stage_last rm -rf stage1-* @@ -39379,6 +47522,18 @@ stage2-start:: mv stage2-gcc gcc ; \ mv stage1-gcc prev-gcc || test -f stage1-lean @endif gcc +@if gmp + @cd $(HOST_SUBDIR); [ -d stage2-gmp ] || \ + mkdir stage2-gmp; \ + mv stage2-gmp gmp ; \ + mv stage1-gmp prev-gmp || test -f stage1-lean +@endif gmp +@if mpfr + @cd $(HOST_SUBDIR); [ -d stage2-mpfr ] || \ + mkdir stage2-mpfr; \ + mv stage2-mpfr mpfr ; \ + mv stage1-mpfr prev-mpfr || test -f stage1-lean +@endif mpfr @if intl @cd $(HOST_SUBDIR); [ -d stage2-intl ] || \ mkdir stage2-intl; \ @@ -39451,6 +47606,18 @@ stage2-end:: mv prev-gcc stage1-gcc ; : ; \ fi @endif gcc +@if gmp + @if test -d $(HOST_SUBDIR)/gmp ; then \ + cd $(HOST_SUBDIR); mv gmp stage2-gmp ; \ + mv prev-gmp stage1-gmp ; : ; \ + fi +@endif gmp +@if mpfr + @if test -d $(HOST_SUBDIR)/mpfr ; then \ + cd $(HOST_SUBDIR); mv mpfr stage2-mpfr ; \ + mv prev-mpfr stage1-mpfr ; : ; \ + fi +@endif mpfr @if intl @if test -d $(HOST_SUBDIR)/intl ; then \ cd $(HOST_SUBDIR); mv intl stage2-intl ; \ @@ -39493,7 +47660,7 @@ stage2-end:: fi rm -f stage_current -# Bubble a bugfix through all the stages up to stage 2. They are +# Bubble a bug fix through all the stages up to stage 2. They are # remade, but not reconfigured. The next stage (if any) will not be # reconfigured as well. .PHONY: stage2-bubble @@ -39543,6 +47710,7 @@ distclean-stage1:: distclean-stage2 .PHONY: distclean-stage2 distclean-stage2:: @: $(MAKE); $(stage) + @test "`cat stage_last`" != stage2 || rm -f stage_last rm -rf stage2-* @@ -39586,6 +47754,18 @@ stage3-start:: mv stage3-gcc gcc ; \ mv stage2-gcc prev-gcc || test -f stage2-lean @endif gcc +@if gmp + @cd $(HOST_SUBDIR); [ -d stage3-gmp ] || \ + mkdir stage3-gmp; \ + mv stage3-gmp gmp ; \ + mv stage2-gmp prev-gmp || test -f stage2-lean +@endif gmp +@if mpfr + @cd $(HOST_SUBDIR); [ -d stage3-mpfr ] || \ + mkdir stage3-mpfr; \ + mv stage3-mpfr mpfr ; \ + mv stage2-mpfr prev-mpfr || test -f stage2-lean +@endif mpfr @if intl @cd $(HOST_SUBDIR); [ -d stage3-intl ] || \ mkdir stage3-intl; \ @@ -39658,6 +47838,18 @@ stage3-end:: mv prev-gcc stage2-gcc ; : ; \ fi @endif gcc +@if gmp + @if test -d $(HOST_SUBDIR)/gmp ; then \ + cd $(HOST_SUBDIR); mv gmp stage3-gmp ; \ + mv prev-gmp stage2-gmp ; : ; \ + fi +@endif gmp +@if mpfr + @if test -d $(HOST_SUBDIR)/mpfr ; then \ + cd $(HOST_SUBDIR); mv mpfr stage3-mpfr ; \ + mv prev-mpfr stage2-mpfr ; : ; \ + fi +@endif mpfr @if intl @if test -d $(HOST_SUBDIR)/intl ; then \ cd $(HOST_SUBDIR); mv intl stage3-intl ; \ @@ -39700,7 +47892,7 @@ stage3-end:: fi rm -f stage_current -# Bubble a bugfix through all the stages up to stage 3. They are +# Bubble a bug fix through all the stages up to stage 3. They are # remade, but not reconfigured. The next stage (if any) will not be # reconfigured as well. .PHONY: stage3-bubble @@ -39793,11 +47985,20 @@ distclean-stage2:: distclean-stage3 .PHONY: distclean-stage3 distclean-stage3:: @: $(MAKE); $(stage) + @test "`cat stage_last`" != stage3 || rm -f stage_last rm -rf stage3-* compare .PHONY: cleanstrap -cleanstrap: distclean bootstrap +cleanstrap: do-distclean local-clean + echo stage3 > stage_final + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage3-bubble + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target @endif gcc-bootstrap @@ -39839,6 +48040,18 @@ stage4-start:: mv stage4-gcc gcc ; \ mv stage3-gcc prev-gcc || test -f stage3-lean @endif gcc +@if gmp + @cd $(HOST_SUBDIR); [ -d stage4-gmp ] || \ + mkdir stage4-gmp; \ + mv stage4-gmp gmp ; \ + mv stage3-gmp prev-gmp || test -f stage3-lean +@endif gmp +@if mpfr + @cd $(HOST_SUBDIR); [ -d stage4-mpfr ] || \ + mkdir stage4-mpfr; \ + mv stage4-mpfr mpfr ; \ + mv stage3-mpfr prev-mpfr || test -f stage3-lean +@endif mpfr @if intl @cd $(HOST_SUBDIR); [ -d stage4-intl ] || \ mkdir stage4-intl; \ @@ -39911,6 +48124,18 @@ stage4-end:: mv prev-gcc stage3-gcc ; : ; \ fi @endif gcc +@if gmp + @if test -d $(HOST_SUBDIR)/gmp ; then \ + cd $(HOST_SUBDIR); mv gmp stage4-gmp ; \ + mv prev-gmp stage3-gmp ; : ; \ + fi +@endif gmp +@if mpfr + @if test -d $(HOST_SUBDIR)/mpfr ; then \ + cd $(HOST_SUBDIR); mv mpfr stage4-mpfr ; \ + mv prev-mpfr stage3-mpfr ; : ; \ + fi +@endif mpfr @if intl @if test -d $(HOST_SUBDIR)/intl ; then \ cd $(HOST_SUBDIR); mv intl stage4-intl ; \ @@ -39953,7 +48178,7 @@ stage4-end:: fi rm -f stage_current -# Bubble a bugfix through all the stages up to stage 4. They are +# Bubble a bug fix through all the stages up to stage 4. They are # remade, but not reconfigured. The next stage (if any) will not be # reconfigured as well. .PHONY: stage4-bubble @@ -40046,6 +48271,7 @@ distclean-stage3:: distclean-stage4 .PHONY: distclean-stage4 distclean-stage4:: @: $(MAKE); $(stage) + @test "`cat stage_last`" != stage4 || rm -f stage_last rm -rf stage4-* compare3 @@ -40089,6 +48315,18 @@ stageprofile-start:: mv stageprofile-gcc gcc ; \ mv stage1-gcc prev-gcc || test -f stage1-lean @endif gcc +@if gmp + @cd $(HOST_SUBDIR); [ -d stageprofile-gmp ] || \ + mkdir stageprofile-gmp; \ + mv stageprofile-gmp gmp ; \ + mv stage1-gmp prev-gmp || test -f stage1-lean +@endif gmp +@if mpfr + @cd $(HOST_SUBDIR); [ -d stageprofile-mpfr ] || \ + mkdir stageprofile-mpfr; \ + mv stageprofile-mpfr mpfr ; \ + mv stage1-mpfr prev-mpfr || test -f stage1-lean +@endif mpfr @if intl @cd $(HOST_SUBDIR); [ -d stageprofile-intl ] || \ mkdir stageprofile-intl; \ @@ -40161,6 +48399,18 @@ stageprofile-end:: mv prev-gcc stage1-gcc ; : ; \ fi @endif gcc +@if gmp + @if test -d $(HOST_SUBDIR)/gmp ; then \ + cd $(HOST_SUBDIR); mv gmp stageprofile-gmp ; \ + mv prev-gmp stage1-gmp ; : ; \ + fi +@endif gmp +@if mpfr + @if test -d $(HOST_SUBDIR)/mpfr ; then \ + cd $(HOST_SUBDIR); mv mpfr stageprofile-mpfr ; \ + mv prev-mpfr stage1-mpfr ; : ; \ + fi +@endif mpfr @if intl @if test -d $(HOST_SUBDIR)/intl ; then \ cd $(HOST_SUBDIR); mv intl stageprofile-intl ; \ @@ -40203,7 +48453,7 @@ stageprofile-end:: fi rm -f stage_current -# Bubble a bugfix through all the stages up to stage profile. They are +# Bubble a bug fix through all the stages up to stage profile. They are # remade, but not reconfigured. The next stage (if any) will not be # reconfigured as well. .PHONY: stageprofile-bubble @@ -40232,6 +48482,7 @@ distclean-stage1:: distclean-stageprofile .PHONY: distclean-stageprofile distclean-stageprofile:: @: $(MAKE); $(stage) + @test "`cat stage_last`" != stageprofile || rm -f stage_last rm -rf stageprofile-* @@ -40275,6 +48526,18 @@ stagefeedback-start:: mv stagefeedback-gcc gcc ; \ mv stageprofile-gcc prev-gcc || test -f stageprofile-lean @endif gcc +@if gmp + @cd $(HOST_SUBDIR); [ -d stagefeedback-gmp ] || \ + mkdir stagefeedback-gmp; \ + mv stagefeedback-gmp gmp ; \ + mv stageprofile-gmp prev-gmp || test -f stageprofile-lean +@endif gmp +@if mpfr + @cd $(HOST_SUBDIR); [ -d stagefeedback-mpfr ] || \ + mkdir stagefeedback-mpfr; \ + mv stagefeedback-mpfr mpfr ; \ + mv stageprofile-mpfr prev-mpfr || test -f stageprofile-lean +@endif mpfr @if intl @cd $(HOST_SUBDIR); [ -d stagefeedback-intl ] || \ mkdir stagefeedback-intl; \ @@ -40347,6 +48610,18 @@ stagefeedback-end:: mv prev-gcc stageprofile-gcc ; : ; \ fi @endif gcc +@if gmp + @if test -d $(HOST_SUBDIR)/gmp ; then \ + cd $(HOST_SUBDIR); mv gmp stagefeedback-gmp ; \ + mv prev-gmp stageprofile-gmp ; : ; \ + fi +@endif gmp +@if mpfr + @if test -d $(HOST_SUBDIR)/mpfr ; then \ + cd $(HOST_SUBDIR); mv mpfr stagefeedback-mpfr ; \ + mv prev-mpfr stageprofile-mpfr ; : ; \ + fi +@endif mpfr @if intl @if test -d $(HOST_SUBDIR)/intl ; then \ cd $(HOST_SUBDIR); mv intl stagefeedback-intl ; \ @@ -40389,7 +48664,7 @@ stagefeedback-end:: fi rm -f stage_current -# Bubble a bugfix through all the stages up to stage feedback. They are +# Bubble a bug fix through all the stages up to stage feedback. They are # remade, but not reconfigured. The next stage (if any) will not be # reconfigured as well. .PHONY: stagefeedback-bubble @@ -40439,6 +48714,7 @@ distclean-stageprofile:: distclean-stagefeedback .PHONY: distclean-stagefeedback distclean-stagefeedback:: @: $(MAKE); $(stage) + @test "`cat stage_last`" != stagefeedback || rm -f stage_last rm -rf stagefeedback-* @@ -40466,13 +48742,18 @@ do-distclean: distclean-stage1 # not work as a dependency, just as the minimum necessary to avoid errors. stage_last: $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage1-bubble -@endif gcc-bootstrap + +# Same as unstage, but not phony and defaulting to stage1-start. We place +# it in the dependency so that for example `make -j3 all-gcc' works. +stage_current: + @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi .PHONY: restrap restrap: @: $(MAKE); $(stage) - rm -rf stage1-$(TARGET_SUBDIR) stage2 stage3 stage4 stageprofile stagefeedback + rm -rf stage1-$(TARGET_SUBDIR) stage2-* stage3-* stage4-* stageprofile-* stagefeedback-* $(MAKE) $(RECURSE_FLAGS_TO_PASS) all +@endif gcc-bootstrap # -------------------------------------- # Dependencies between different modules @@ -40483,8 +48764,13 @@ restrap: configure-target-libstdc++-v3: stage_last configure-target-libmudflap: stage_last configure-target-libssp: stage_last -configure-target-libgcc-math: stage_last configure-target-newlib: stage_last +configure-stage1-target-libgcc: maybe-all-stage1-gcc +configure-stage2-target-libgcc: maybe-all-stage2-gcc +configure-stage3-target-libgcc: maybe-all-stage3-gcc +configure-stage4-target-libgcc: maybe-all-stage4-gcc +configure-stageprofile-target-libgcc: maybe-all-stageprofile-gcc +configure-stagefeedback-target-libgcc: maybe-all-stagefeedback-gcc configure-target-libgfortran: stage_last configure-target-libobjc: stage_last configure-target-libtermcap: stage_last @@ -40507,8 +48793,8 @@ configure-target-libgomp: stage_last configure-target-libstdc++-v3: maybe-all-gcc configure-target-libmudflap: maybe-all-gcc configure-target-libssp: maybe-all-gcc -configure-target-libgcc-math: maybe-all-gcc configure-target-newlib: maybe-all-gcc +configure-target-libgcc: maybe-all-gcc configure-target-libgfortran: maybe-all-gcc configure-target-libobjc: maybe-all-gcc configure-target-libtermcap: maybe-all-gcc @@ -40528,42 +48814,6 @@ configure-target-libgomp: maybe-all-gcc @endif gcc-no-bootstrap - -configure-target-boehm-gc: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-gperf: maybe-all-target-newlib maybe-all-target-libgloss -configure-target-gperf: maybe-all-target-libstdc++-v3 - -configure-target-libada: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-libgfortran: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-libffi: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-libjava: maybe-all-target-newlib maybe-all-target-libgloss -configure-target-libjava: maybe-all-target-libstdc++-v3 - -configure-target-libmudflap: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-libobjc: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-libssp: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-libstdc++-v3: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-zlib: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-examples: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-libtermcap: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-rda: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-winsup: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-qthreads: maybe-all-target-newlib maybe-all-target-libgloss - - # There are two types of dependencies here: 'hard' dependencies, where one # module simply won't build without the other; and 'soft' dependencies, where # if the depended-on module is missing, the depending module will do without @@ -40630,6 +48880,14 @@ all-stage3-gcc: all-stage3-libiberty all-stage4-gcc: all-stage4-libiberty all-stageprofile-gcc: all-stageprofile-libiberty all-stagefeedback-gcc: all-stagefeedback-libiberty +all-gcc: maybe-all-gmp + +all-stage1-gcc: maybe-all-stage1-gmp +all-stage2-gcc: maybe-all-stage2-gmp +all-stage3-gcc: maybe-all-stage3-gmp +all-stage4-gcc: maybe-all-stage4-gmp +all-stageprofile-gcc: maybe-all-stageprofile-gmp +all-stagefeedback-gcc: maybe-all-stagefeedback-gmp all-gcc: maybe-all-intl all-stage1-gcc: maybe-all-stage1-intl @@ -40638,6 +48896,14 @@ all-stage3-gcc: maybe-all-stage3-intl all-stage4-gcc: maybe-all-stage4-intl all-stageprofile-gcc: maybe-all-stageprofile-intl all-stagefeedback-gcc: maybe-all-stagefeedback-intl +all-gcc: maybe-all-mpfr + +all-stage1-gcc: maybe-all-stage1-mpfr +all-stage2-gcc: maybe-all-stage2-mpfr +all-stage3-gcc: maybe-all-stage3-mpfr +all-stage4-gcc: maybe-all-stage4-mpfr +all-stageprofile-gcc: maybe-all-stageprofile-mpfr +all-stagefeedback-gcc: maybe-all-stagefeedback-mpfr all-gcc: maybe-all-build-texinfo all-stage1-gcc: maybe-all-build-texinfo @@ -40646,7 +48912,6 @@ all-stage3-gcc: maybe-all-build-texinfo all-stage4-gcc: maybe-all-build-texinfo all-stageprofile-gcc: maybe-all-build-texinfo all-stagefeedback-gcc: maybe-all-build-texinfo -all-prebootstrap: maybe-all-build-texinfo all-gcc: maybe-all-build-bison all-stage1-gcc: maybe-all-build-bison @@ -40655,7 +48920,6 @@ all-stage3-gcc: maybe-all-build-bison all-stage4-gcc: maybe-all-build-bison all-stageprofile-gcc: maybe-all-build-bison all-stagefeedback-gcc: maybe-all-build-bison -all-prebootstrap: maybe-all-build-bison all-gcc: maybe-all-build-byacc all-stage1-gcc: maybe-all-build-byacc @@ -40664,7 +48928,6 @@ all-stage3-gcc: maybe-all-build-byacc all-stage4-gcc: maybe-all-build-byacc all-stageprofile-gcc: maybe-all-build-byacc all-stagefeedback-gcc: maybe-all-build-byacc -all-prebootstrap: maybe-all-build-byacc all-gcc: maybe-all-build-flex all-stage1-gcc: maybe-all-build-flex @@ -40673,7 +48936,6 @@ all-stage3-gcc: maybe-all-build-flex all-stage4-gcc: maybe-all-build-flex all-stageprofile-gcc: maybe-all-build-flex all-stagefeedback-gcc: maybe-all-build-flex -all-prebootstrap: maybe-all-build-flex all-gcc: maybe-all-build-libiberty all-stage1-gcc: maybe-all-build-libiberty @@ -40682,7 +48944,6 @@ all-stage3-gcc: maybe-all-build-libiberty all-stage4-gcc: maybe-all-build-libiberty all-stageprofile-gcc: maybe-all-build-libiberty all-stagefeedback-gcc: maybe-all-build-libiberty -all-prebootstrap: maybe-all-build-libiberty all-gcc: maybe-all-build-fixincludes all-stage1-gcc: maybe-all-build-fixincludes @@ -40691,7 +48952,6 @@ all-stage3-gcc: maybe-all-build-fixincludes all-stage4-gcc: maybe-all-build-fixincludes all-stageprofile-gcc: maybe-all-build-fixincludes all-stagefeedback-gcc: maybe-all-build-fixincludes -all-prebootstrap: maybe-all-build-fixincludes all-gcc: maybe-all-zlib all-stage1-gcc: maybe-all-stage1-zlib @@ -40760,10 +49020,20 @@ all-stageprofile-libcpp: maybe-all-stageprofile-intl all-stagefeedback-libcpp: maybe-all-stagefeedback-intl all-fixincludes: maybe-all-libiberty all-gnattools: maybe-all-target-libada +configure-mpfr: maybe-all-gmp + +configure-stage1-mpfr: maybe-all-stage1-gmp +configure-stage2-mpfr: maybe-all-stage2-gmp +configure-stage3-mpfr: maybe-all-stage3-gmp +configure-stage4-mpfr: maybe-all-stage4-gmp +configure-stageprofile-mpfr: maybe-all-stageprofile-gmp +configure-stagefeedback-mpfr: maybe-all-stagefeedback-gmp +configure-gdb: maybe-configure-intl configure-gdb: maybe-configure-sim +configure-gdb: maybe-all-bfd +all-gdb: maybe-all-intl all-gdb: maybe-all-libiberty all-gdb: maybe-all-opcodes -all-gdb: maybe-all-bfd all-gdb: maybe-all-readline all-gdb: maybe-all-build-bison all-gdb: maybe-all-build-byacc @@ -40781,6 +49051,14 @@ configure-stage3-bfd: configure-stage3-libiberty configure-stage4-bfd: configure-stage4-libiberty configure-stageprofile-bfd: configure-stageprofile-libiberty configure-stagefeedback-bfd: configure-stagefeedback-libiberty +configure-bfd: maybe-configure-intl + +configure-stage1-bfd: maybe-configure-stage1-intl +configure-stage2-bfd: maybe-configure-stage2-intl +configure-stage3-bfd: maybe-configure-stage3-intl +configure-stage4-bfd: maybe-configure-stage4-intl +configure-stageprofile-bfd: maybe-configure-stageprofile-intl +configure-stagefeedback-bfd: maybe-configure-stagefeedback-intl all-bfd: maybe-all-libiberty all-stage1-bfd: maybe-all-stage1-libiberty @@ -40797,6 +49075,14 @@ all-stage3-bfd: maybe-all-stage3-intl all-stage4-bfd: maybe-all-stage4-intl all-stageprofile-bfd: maybe-all-stageprofile-intl all-stagefeedback-bfd: maybe-all-stagefeedback-intl +configure-binutils: maybe-configure-intl + +configure-stage1-binutils: maybe-configure-stage1-intl +configure-stage2-binutils: maybe-configure-stage2-intl +configure-stage3-binutils: maybe-configure-stage3-intl +configure-stage4-binutils: maybe-configure-stage4-intl +configure-stageprofile-binutils: maybe-configure-stageprofile-intl +configure-stagefeedback-binutils: maybe-configure-stagefeedback-intl all-binutils: maybe-all-libiberty all-stage1-binutils: maybe-all-stage1-libiberty @@ -40829,7 +49115,6 @@ all-stage3-binutils: maybe-all-build-flex all-stage4-binutils: maybe-all-build-flex all-stageprofile-binutils: maybe-all-build-flex all-stagefeedback-binutils: maybe-all-build-flex -all-prebootstrap: maybe-all-build-flex all-binutils: maybe-all-build-bison all-stage1-binutils: maybe-all-build-bison @@ -40838,7 +49123,6 @@ all-stage3-binutils: maybe-all-build-bison all-stage4-binutils: maybe-all-build-bison all-stageprofile-binutils: maybe-all-build-bison all-stagefeedback-binutils: maybe-all-build-bison -all-prebootstrap: maybe-all-build-bison all-binutils: maybe-all-build-byacc all-stage1-binutils: maybe-all-build-byacc @@ -40847,7 +49131,6 @@ all-stage3-binutils: maybe-all-build-byacc all-stage4-binutils: maybe-all-build-byacc all-stageprofile-binutils: maybe-all-build-byacc all-stagefeedback-binutils: maybe-all-build-byacc -all-prebootstrap: maybe-all-build-byacc all-binutils: maybe-all-intl all-stage1-binutils: maybe-all-stage1-intl @@ -40858,6 +49141,14 @@ all-stageprofile-binutils: maybe-all-stageprofile-intl all-stagefeedback-binutils: maybe-all-stagefeedback-intl install-binutils: maybe-install-opcodes install-opcodes: maybe-install-bfd +configure-gas: maybe-configure-intl + +configure-stage1-gas: maybe-configure-stage1-intl +configure-stage2-gas: maybe-configure-stage2-intl +configure-stage3-gas: maybe-configure-stage3-intl +configure-stage4-gas: maybe-configure-stage4-intl +configure-stageprofile-gas: maybe-configure-stageprofile-intl +configure-stagefeedback-gas: maybe-configure-stagefeedback-intl all-gas: maybe-all-libiberty all-stage1-gas: maybe-all-stage1-libiberty @@ -40890,10 +49181,19 @@ all-stage3-gas: maybe-all-stage3-intl all-stage4-gas: maybe-all-stage4-intl all-stageprofile-gas: maybe-all-stageprofile-intl all-stagefeedback-gas: maybe-all-stagefeedback-intl +configure-gprof: maybe-configure-intl all-gprof: maybe-all-libiberty all-gprof: maybe-all-bfd all-gprof: maybe-all-opcodes all-gprof: maybe-all-intl +configure-ld: maybe-configure-intl + +configure-stage1-ld: maybe-configure-stage1-intl +configure-stage2-ld: maybe-configure-stage2-intl +configure-stage3-ld: maybe-configure-stage3-intl +configure-stage4-ld: maybe-configure-stage4-intl +configure-stageprofile-ld: maybe-configure-stageprofile-intl +configure-stagefeedback-ld: maybe-configure-stagefeedback-intl all-ld: maybe-all-libiberty all-stage1-ld: maybe-all-stage1-libiberty @@ -40926,7 +49226,6 @@ all-stage3-ld: maybe-all-build-bison all-stage4-ld: maybe-all-build-bison all-stageprofile-ld: maybe-all-build-bison all-stagefeedback-ld: maybe-all-build-bison -all-prebootstrap: maybe-all-build-bison all-ld: maybe-all-build-byacc all-stage1-ld: maybe-all-build-byacc @@ -40935,7 +49234,6 @@ all-stage3-ld: maybe-all-build-byacc all-stage4-ld: maybe-all-build-byacc all-stageprofile-ld: maybe-all-build-byacc all-stagefeedback-ld: maybe-all-build-byacc -all-prebootstrap: maybe-all-build-byacc all-ld: maybe-all-build-flex all-stage1-ld: maybe-all-build-flex @@ -40944,7 +49242,6 @@ all-stage3-ld: maybe-all-build-flex all-stage4-ld: maybe-all-build-flex all-stageprofile-ld: maybe-all-build-flex all-stagefeedback-ld: maybe-all-build-flex -all-prebootstrap: maybe-all-build-flex all-ld: maybe-all-intl all-stage1-ld: maybe-all-stage1-intl @@ -40953,6 +49250,14 @@ all-stage3-ld: maybe-all-stage3-intl all-stage4-ld: maybe-all-stage4-intl all-stageprofile-ld: maybe-all-stageprofile-intl all-stagefeedback-ld: maybe-all-stagefeedback-intl +configure-opcodes: maybe-configure-intl + +configure-stage1-opcodes: maybe-configure-stage1-intl +configure-stage2-opcodes: maybe-configure-stage2-intl +configure-stage3-opcodes: maybe-configure-stage3-intl +configure-stage4-opcodes: maybe-configure-stage4-intl +configure-stageprofile-opcodes: maybe-configure-stageprofile-intl +configure-stagefeedback-opcodes: maybe-configure-stagefeedback-intl all-opcodes: maybe-all-bfd all-stage1-opcodes: maybe-all-stage1-bfd @@ -40969,6 +49274,14 @@ all-stage3-opcodes: maybe-all-stage3-libiberty all-stage4-opcodes: maybe-all-stage4-libiberty all-stageprofile-opcodes: maybe-all-stageprofile-libiberty all-stagefeedback-opcodes: maybe-all-stagefeedback-libiberty +all-opcodes: maybe-all-intl + +all-stage1-opcodes: maybe-all-stage1-intl +all-stage2-opcodes: maybe-all-stage2-intl +all-stage3-opcodes: maybe-all-stage3-intl +all-stage4-opcodes: maybe-all-stage4-intl +all-stageprofile-opcodes: maybe-all-stageprofile-intl +all-stagefeedback-opcodes: maybe-all-stagefeedback-intl all-dejagnu: maybe-all-tcl all-dejagnu: maybe-all-expect all-dejagnu: maybe-all-tk @@ -40990,6 +49303,8 @@ all-sid: maybe-all-tcl all-sid: maybe-all-tk install-sid: maybe-install-tcl install-sid: maybe-install-tk +configure-sim: maybe-configure-intl +all-sim: maybe-all-intl all-sim: maybe-all-libiberty all-sim: maybe-all-bfd all-sim: maybe-all-opcodes @@ -41044,29 +49359,88 @@ all-target-libjava: maybe-all-target-zlib all-target-libjava: maybe-all-target-boehm-gc all-target-libjava: maybe-all-target-qthreads all-target-libjava: maybe-all-target-libffi +configure-target-libobjc: maybe-configure-target-boehm-gc all-target-libobjc: maybe-all-target-libiberty +all-target-libobjc: maybe-all-target-boehm-gc all-target-libstdc++-v3: maybe-all-target-libiberty all-target-libgloss: maybe-configure-target-newlib all-target-winsup: maybe-all-target-libiberty all-target-winsup: maybe-all-target-libtermcap -# Non-toplevel bootstrap rules must depend on several packages, to be built -# before gcc. Another wart that will go away, hopefully soon. -@if gcc-no-bootstrap +# Dependencies for target modules on other target modules are +# described by lang_env_dependencies; the defaults apply to anything +# not mentioned there. -all-prebootstrap: maybe-all-bfd -all-prebootstrap: maybe-all-opcodes -all-prebootstrap: maybe-all-binutils -all-prebootstrap: maybe-all-gas -all-prebootstrap: maybe-all-intl -all-prebootstrap: maybe-all-ld -all-prebootstrap: maybe-all-libcpp -all-prebootstrap: maybe-all-libdecnumber -all-prebootstrap: maybe-all-libiberty -all-prebootstrap: maybe-all-zlib + +@if gcc-bootstrap +@endif gcc-bootstrap + +@if gcc-no-bootstrap +configure-target-libstdc++-v3: maybe-all-target-libgcc +configure-target-libmudflap: maybe-all-target-libgcc +configure-target-libssp: maybe-all-target-libgcc +configure-target-newlib: maybe-all-target-libgcc +configure-target-libgfortran: maybe-all-target-libgcc +configure-target-libobjc: maybe-all-target-libgcc +configure-target-libtermcap: maybe-all-target-libgcc +configure-target-winsup: maybe-all-target-libgcc +configure-target-libgloss: maybe-all-target-libgcc +configure-target-libiberty: maybe-all-target-libgcc +configure-target-gperf: maybe-all-target-libgcc +configure-target-examples: maybe-all-target-libgcc +configure-target-libffi: maybe-all-target-libgcc +configure-target-libjava: maybe-all-target-libgcc +configure-target-zlib: maybe-all-target-libgcc +configure-target-boehm-gc: maybe-all-target-libgcc +configure-target-qthreads: maybe-all-target-libgcc +configure-target-rda: maybe-all-target-libgcc +configure-target-libada: maybe-all-target-libgcc +configure-target-libgomp: maybe-all-target-libgcc @endif gcc-no-bootstrap + +configure-target-libstdc++-v3: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libmudflap: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libssp: maybe-all-target-newlib maybe-all-target-libgloss + + + +configure-target-libgfortran: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libobjc: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libtermcap: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-winsup: maybe-all-target-newlib maybe-all-target-libgloss + + + +configure-target-gperf: maybe-all-target-newlib maybe-all-target-libgloss +configure-target-gperf: maybe-all-target-libstdc++-v3 + +configure-target-examples: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libffi: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libjava: maybe-all-target-newlib maybe-all-target-libgloss +configure-target-libjava: maybe-all-target-libstdc++-v3 + +configure-target-zlib: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-boehm-gc: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-qthreads: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-rda: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libada: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libgomp: maybe-all-target-newlib maybe-all-target-libgloss + + CONFIGURE_GDB_TK = @CONFIGURE_GDB_TK@ GDB_TK = @GDB_TK@ INSTALL_GDB_TK = @INSTALL_GDB_TK@ @@ -41097,7 +49471,7 @@ config.status: configure # Rebuilding configure. AUTOCONF = autoconf -$(srcdir)/configure: @MAINT@ $(srcdir)/configure.in $(srcdir)/config/acx.m4 +$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4 cd $(srcdir) && $(AUTOCONF) # ------------------------------ diff --git a/Makefile.tpl b/Makefile.tpl index b83d8d5abd9..6164a4164c6 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -28,11 +28,17 @@ in # ------------------------------- VPATH=@srcdir@ -build_alias=@build_alias@ +build_alias=@build_noncanonical@ +build_vendor=@build_vendor@ +build_os=@build_os@ build=@build@ -host_alias=@host_alias@ +host_alias=@host_noncanonical@ +host_vendor=@host_vendor@ +host_os=@host_os@ host=@host@ -target_alias=@target_alias@ +target_alias=@target_noncanonical@ +target_vendor=@target_vendor@ +target_os=@target_os@ target=@target@ program_transform_name = @program_transform_name@ @@ -55,6 +61,7 @@ oldincludedir = @oldincludedir@ infodir = @infodir@ datarootdir = @datarootdir@ docdir = @docdir@ +pdfdir = @pdfdir@ htmldir = @htmldir@ mandir = @mandir@ man1dir = $(mandir)/man1 @@ -73,6 +80,9 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_DATA = @INSTALL_DATA@ LN = @LN@ LN_S = @LN_S@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ # ------------------------------------------------- # Miscellaneous non-standard autoconf-set variables @@ -180,7 +190,8 @@ POSTSTAGE1_HOST_EXPORTS = \ CC_FOR_BUILD="$(STAGE_CC_WRAPPER) \ $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \ -B$$r/$(HOST_SUBDIR)/prev-gcc/ \ - -B$(build_tooldir)/bin/"; export CC_FOR_BUILD; + -B$(build_tooldir)/bin/"; export CC_FOR_BUILD; \ + LDFLAGS="$(BOOT_LDFLAGS)"; export LDFLAGS; # Target libraries are put under this directory: TARGET_SUBDIR = @target_subdir@ @@ -288,13 +299,26 @@ RANLIB = @RANLIB@ STRIP = @STRIP@ WINDRES = @WINDRES@ +GNATBIND = @GNATBIND@ +GNATMAKE = @GNATMAKE@ + CFLAGS = @CFLAGS@ -LDFLAGS = +LDFLAGS = @LDFLAGS@ LIBCFLAGS = $(CFLAGS) CXXFLAGS = @CXXFLAGS@ LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates PICFLAG = +# Only build the C compiler for stage1, because that is the only one that +# we can guarantee will build with the native compiler, and also it is the +# only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS), +# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them +# overrideable (for a bootstrap build stage1 also builds gcc.info). + +STAGE1_CFLAGS=@stage1_cflags@ +STAGE1_CHECKING=@stage1_checking@ +STAGE1_LANGUAGES=@stage1_languages@ + # ----------------------------------------------- # Programs producing files for the TARGET machine # ----------------------------------------------- @@ -426,6 +450,14 @@ X11_FLAGS_TO_PASS = \ 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \ 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)' +# Flags to pass to stage2 and later makes. + +POSTSTAGE1_FLAGS_TO_PASS = \ + CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \ + GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind" \ + LDFLAGS="$(BOOT_LDFLAGS)" \ + "`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" + # Flags to pass down to makes which are built with the target environment. # The double $ decreases the length of the command line; those variables # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. The @@ -506,9 +538,10 @@ all-host: maybe-all-[+module+][+ IF bootstrap +] .PHONY: all-target [+ FOR target_modules +][+ IF bootstrap +] -@if [+module+]-no-bootstrap[+ ENDIF bootstrap +] +@if target-[+module+]-no-bootstrap[+ ENDIF bootstrap +] all-target: maybe-all-target-[+module+][+ IF bootstrap +] -@endif [+module+]-no-bootstrap[+ ENDIF bootstrap +][+ ENDFOR target_modules +] +@endif target-[+module+]-no-bootstrap[+ + ENDIF bootstrap +][+ ENDFOR target_modules +] # Do a target for all the subdirectories. A ``make do-X'' will do a # ``make X'' in all subdirectories (because, in general, there is a @@ -535,12 +568,14 @@ do-[+make_target+]: # Here are the targets which correspond to the do-X targets. -.PHONY: info installcheck dvi html install-info install-html +.PHONY: info installcheck dvi pdf html +.PHONY: install-info install-pdf install-html .PHONY: clean distclean mostlyclean maintainer-clean realclean .PHONY: local-clean local-distclean local-maintainer-clean info: do-info installcheck: do-installcheck dvi: do-dvi +pdf: do-pdf html: do-html # Make sure makeinfo is built before we do a `make info', if we're @@ -553,6 +588,8 @@ install-info: do-install-info dir.info $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \ else true ; fi +install-pdf: do-install-pdf + install-html: do-install-html local-clean: @@ -585,11 +622,6 @@ maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean maintainer-clean: local-distclean realclean: maintainer-clean -# Extra dependency for clean-target, owing to the mixed nature of gcc. -clean-target: clean-target-libgcc -clean-target-libgcc: - test ! -d gcc || (cd gcc && $(MAKE) $@) - # Check target. .PHONY: check do-check @@ -720,14 +752,12 @@ TAGS: do-TAGS [+ DEFINE configure +] .PHONY: configure-[+prefix+][+module+] maybe-configure-[+prefix+][+module+] maybe-configure-[+prefix+][+module+]: +@if gcc-bootstrap +configure-[+prefix+][+module+]: stage_current +@endif gcc-bootstrap @if [+prefix+][+module+] maybe-configure-[+prefix+][+module+]: configure-[+prefix+][+module+] -configure-[+prefix+][+module+]: [+ IF bootstrap +] -@endif [+prefix+][+module+] -@if [+prefix+][+module+]-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif [+prefix+][+module+]-bootstrap -@if [+prefix+][+module+][+ ELSE bootstrap +] +configure-[+prefix+][+module+]: [+ IF bootstrap +][+ ELSE +] @: $(MAKE); $(unstage)[+ ENDIF bootstrap +] @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ @@ -759,7 +789,8 @@ configure-[+prefix+][+module+]: [+ IF bootstrap +] libsrcdir="$$s/[+module+]"; \ [+ IF no-config-site +]rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file [+ ENDIF +]$(SHELL) $${libsrcdir}/configure \ - [+args+] $${srcdiroption} [+extra_configure_flags+] \ + [+args+] --build=${build_alias} --host=[+host_alias+] \ + --target=[+target_alias+] $${srcdiroption} [+extra_configure_flags+] \ || exit 1 @endif [+prefix+][+module+] @@ -790,6 +821,8 @@ configure-stage[+id+]-[+prefix+][+module+]: [+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \ [+exports+][+ IF prev +] \ [+poststage1_exports+][+ ENDIF prev +] \ + CFLAGS="[+stage_cflags+]"; export CFLAGS; \ + LIBCFLAGS="[+stage_cflags+]"; export LIBCFLAGS; \ echo Configuring stage [+id+] in [+subdir+]/[+module+] ; \ $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] ; \ cd [+subdir+]/[+module+] || exit 1; \ @@ -801,7 +834,9 @@ configure-stage[+id+]-[+prefix+][+module+]: srcdiroption="--srcdir=$${topdir}/[+module+]"; \ libsrcdir="$$s/[+module+]"; \ $(SHELL) $${libsrcdir}/configure \ - [+args+] $${srcdiroption} \ + [+args+] --build=${build_alias} --host=[+host_alias+] \ + --target=[+target_alias+] $${srcdiroption} \ + [+ IF prev +]--with-build-libsubdir=$(HOST_SUBDIR)[+ ENDIF prev +] \ [+stage_configure_flags+] [+extra_configure_flags+] @endif [+prefix+][+module+]-bootstrap [+ ENDFOR bootstrap_stage +] @@ -811,16 +846,14 @@ configure-stage[+id+]-[+prefix+][+module+]: [+ DEFINE all +] .PHONY: all-[+prefix+][+module+] maybe-all-[+prefix+][+module+] maybe-all-[+prefix+][+module+]: +@if gcc-bootstrap +all-[+prefix+][+module+]: stage_current +@endif gcc-bootstrap @if [+prefix+][+module+] TARGET-[+prefix+][+module+]=[+ - IF target +][+target+][+ ELSE +]all[+ ENDIF target +] + IF all_target +][+all_target+][+ ELSE +]all[+ ENDIF all_target +] maybe-all-[+prefix+][+module+]: all-[+prefix+][+module+] -all-[+prefix+][+module+]: configure-[+prefix+][+module+][+ IF bootstrap +] -@endif [+prefix+][+module+] -@if [+prefix+][+module+]-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif [+prefix+][+module+]-bootstrap -@if [+prefix+][+module+][+ ELSE bootstrap +] +all-[+prefix+][+module+]: configure-[+prefix+][+module+][+ IF bootstrap +][+ ELSE +] @: $(MAKE); $(unstage)[+ ENDIF bootstrap +] @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ @@ -846,21 +879,25 @@ all-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+] [+exports+][+ IF prev +] \ [+poststage1_exports+][+ ENDIF prev +] \ cd [+subdir+]/[+module+] && \ - $(MAKE) [+args+] [+ IF prev - +][+poststage1_args+][+ ENDIF prev - +] [+stage_make_flags+] [+extra_make_flags+] \ + $(MAKE) [+args+] \ + CFLAGS="[+stage_cflags+]" LIBCFLAGS="[+stage_cflags+]" [+ + IF prev +][+poststage1_args+][+ ENDIF prev + +] [+extra_make_flags+] \ $(TARGET-stage[+id+]-[+prefix+][+module+]) maybe-clean-stage[+id+]-[+prefix+][+module+]: clean-stage[+id+]-[+prefix+][+module+] clean-stage[+id+]: clean-stage[+id+]-[+prefix+][+module+] clean-stage[+id+]-[+prefix+][+module+]: - @[ -f [+subdir+]/[+module+]/Makefile ] || [ -f [+subdir+]/stage[+id+]-[+module+]/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start; \ + @if [ $(current_stage) = stage[+id+] ]; then \ + [ -f [+subdir+]/[+module+]/Makefile ] || exit 0; \ + else \ + [ -f [+subdir+]/stage[+id+]-[+module+]/Makefile ] || exit 0; \ + $(MAKE) stage[+id+]-start; \ + fi; \ cd [+subdir+]/[+module+] && \ $(MAKE) [+args+] [+ IF prev +] \ [+poststage1_args+] [+ ENDIF prev +] \ - [+stage_make_flags+] [+extra_make_flags+] clean + [+extra_make_flags+] clean @endif [+prefix+][+module+]-bootstrap [+ ENDFOR bootstrap_stage +] @@ -872,6 +909,8 @@ clean-stage[+id+]-[+prefix+][+module+]: # -------------------------------------- [+ FOR build_modules +] [+ configure prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)" + host_alias=(get "host" "${build_alias}") + target_alias=(get "target" "${target_alias}") args="$(BUILD_CONFIGARGS)" no-config-site=true +] [+ all prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)" +] @@ -884,6 +923,8 @@ clean-stage[+id+]-[+prefix+][+module+]: [+ configure prefix="" subdir="$(HOST_SUBDIR)" exports="$(HOST_EXPORTS)" poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)" + host_alias=(get "host" "${host_alias}") + target_alias=(get "target" "${target_alias}") args="$(HOST_CONFIGARGS)" +] [+ all prefix="" subdir="$(HOST_SUBDIR)" @@ -937,7 +978,7 @@ install-[+module+]: installdirs [+ ENDIF no_install +] @endif [+module+] -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) [+ FOR recursive_targets +] .PHONY: maybe-[+make_target+]-[+module+] [+make_target+]-[+module+] maybe-[+make_target+]-[+module+]: @@ -981,6 +1022,8 @@ maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+] [+ configure prefix="target-" subdir="$(TARGET_SUBDIR)" check_multilibs=true exports="$(RAW_CXX_TARGET_EXPORTS)" + host_alias=(get "host" "${target_alias}") + target_alias=(get "target" "${target_alias}") args="$(TARGET_CONFIGARGS)" no-config-site=true +] [+ all prefix="target-" subdir="$(TARGET_SUBDIR)" @@ -990,6 +1033,8 @@ maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+] [+ configure prefix="target-" subdir="$(TARGET_SUBDIR)" check_multilibs=true exports="$(NORMAL_TARGET_EXPORTS)" + host_alias=(get "host" "${target_alias}") + target_alias=(get "target" "${target_alias}") args="$(TARGET_CONFIGARGS)" no-config-site=true +] [+ all prefix="target-" subdir="$(TARGET_SUBDIR)" @@ -1045,7 +1090,7 @@ ENDIF raw_cxx +] [+ ENDIF no_install +] @endif target-[+module+] -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) [+ FOR recursive_targets +] .PHONY: maybe-[+make_target+]-target-[+module+] [+make_target+]-target-[+module+] maybe-[+make_target+]-target-[+module+]: @@ -1089,60 +1134,6 @@ ENDIF raw_cxx +] # ---------- @if gcc-no-bootstrap -# GCC has some more recursive targets, which trigger the old -# (but still current, until the toplevel bootstrap project -# is finished) compiler bootstrapping rules. - -GCC_STRAP_TARGETS = bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap -.PHONY: $(GCC_STRAP_TARGETS) -$(GCC_STRAP_TARGETS): all-prebootstrap configure-gcc - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - echo "Bootstrapping the compiler"; \ - $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,:[ :]*,:,g;s,^[ :]*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ - cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@ - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - case "$@" in \ - *bootstrap4-lean ) \ - msg="Comparing stage3 and stage4 of the compiler"; \ - compare=compare3-lean ;; \ - *bootstrap4 ) \ - msg="Comparing stage3 and stage4 of the compiler"; \ - compare=compare3 ;; \ - *-lean ) \ - msg="Comparing stage2 and stage3 of the compiler"; \ - compare=compare-lean ;; \ - * ) \ - msg="Comparing stage2 and stage3 of the compiler"; \ - compare=compare ;; \ - esac; \ - $(HOST_EXPORTS) \ - echo "$$msg"; \ - cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ - echo "Building runtime libraries"; \ - $(MAKE) $(RECURSE_FLAGS_TO_PASS) all - -profiledbootstrap: all-prebootstrap configure-gcc - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,:[ :]*,:,g;s,^[ :]*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ - echo "Bootstrapping training compiler"; \ - cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stageprofile_build - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - echo "Building feedback based compiler"; \ - cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stagefeedback_build - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ - echo "Building runtime libraries"; \ - $(MAKE) $(RECURSE_FLAGS_TO_PASS) all - .PHONY: cross cross: all-build all-gas all-ld @r=`${PWD_COMMAND}`; export r; \ @@ -1212,7 +1203,7 @@ stage = : current_stage = "" @if gcc-bootstrap -unstage = [ -f stage_current ] || $(MAKE) `cat stage_last`-start +unstage = if [ -f stage_last ]; then [ -f stage_current ] || $(MAKE) `cat stage_last`-start || exit 1; else :; fi stage = if [ -f stage_current ]; then $(MAKE) `cat stage_current`-end || exit 1; else :; fi current_stage = "`cat stage_current 2> /dev/null`" @endif gcc-bootstrap @@ -1240,36 +1231,9 @@ LEAN = false # 'touch' doesn't work right on some platforms. STAMP = echo timestamp > -# Only build the C compiler for stage1, because that is the only one that -# we can guarantee will build with the native compiler, and also it is the -# only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS), -# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them -# overrideable (for a bootstrap build stage1 also builds gcc.info). - -STAGE1_CFLAGS=@stage1_cflags@ -STAGE1_LANGUAGES=@stage1_languages@ - # We only want to compare .o files, so set this! objext = .o -# Flags to pass to stage2 and later makes. -POSTSTAGE1_FLAGS_TO_PASS = \ - CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \ - STAGE_PREFIX=$$r/prev-gcc/ \ - CFLAGS="$(BOOT_CFLAGS)" \ - LIBCFLAGS="$(BOOT_CFLAGS)" \ - LDFLAGS="$(BOOT_LDFLAGS)" \ - ADAC="\$$(CC)" - -# For stage 1: -# * We force-disable intermodule optimizations, even if -# --enable-intermodule was passed, since the installed compiler probably -# can't handle them. Luckily, autoconf always respects -# the last argument when conflicting --enable arguments are passed. -# * Likewise, we force-disable coverage flags, since the installed compiler -# probably has never heard of them. -# * We build only C (and possibly Ada). - [+ FOR bootstrap-stage +] .PHONY: stage[+id+]-start stage[+id+]-end @@ -1303,7 +1267,7 @@ stage[+id+]-end:: [+ FOR host_modules +][+ IF bootstrap +] fi rm -f stage_current -# Bubble a bugfix through all the stages up to stage [+id+]. They are +# Bubble a bug fix through all the stages up to stage [+id+]. They are # remade, but not reconfigured. The next stage (if any) will not be # reconfigured as well. .PHONY: stage[+id+]-bubble @@ -1397,12 +1361,21 @@ do-clean: clean-stage[+id+] .PHONY: distclean-stage[+id+] distclean-stage[+id+]:: @: $(MAKE); $(stage) + @test "`cat stage_last`" != stage[+id+] || rm -f stage_last rm -rf stage[+id+]-* [+ IF compare-target +][+compare-target+] [+ ENDIF compare-target +] [+ IF cleanstrap-target +] .PHONY: [+cleanstrap-target+] -[+cleanstrap-target+]: distclean [+bootstrap-target+] +[+cleanstrap-target+]: do-distclean local-clean + echo stage[+id+] > stage_final + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage[+id+]-bubble + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target [+ ENDIF cleanstrap-target +] @endif gcc-bootstrap @@ -1428,14 +1401,19 @@ do-distclean: distclean-stage1 # not work as a dependency, just as the minimum necessary to avoid errors. stage_last: $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage1-bubble -@endif gcc-bootstrap + +# Same as unstage, but not phony and defaulting to stage1-start. We place +# it in the dependency so that for example `make -j3 all-gcc' works. +stage_current: + @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi .PHONY: restrap restrap: @: $(MAKE); $(stage) rm -rf stage1-$(TARGET_SUBDIR) [+ FOR bootstrap-stage +][+ IF prev - +]stage[+id+] [+ ENDIF prev +][+ ENDFOR bootstrap-stage +] + +]stage[+id+]-* [+ ENDIF prev +][+ ENDFOR bootstrap-stage +] $(MAKE) $(RECURSE_FLAGS_TO_PASS) all +@endif gcc-bootstrap # -------------------------------------- # Dependencies between different modules @@ -1450,18 +1428,12 @@ configure-target-[+module+]: stage_last[+ ENDIF bootstrap +][+ ENDFOR target_modules +] @endif gcc-bootstrap -@if gcc-no-bootstrap[+ FOR target_modules +][+ IF bootstrap - +][+ ELSE +] +@if gcc-no-bootstrap[+ FOR target_modules +] configure-target-[+module+]: maybe-all-gcc[+ - ENDIF bootstrap +][+ ENDFOR target_modules +] + ENDFOR target_modules +] @endif gcc-no-bootstrap -[+ FOR lang_env_dependencies +] -configure-target-[+module+]: maybe-all-target-newlib maybe-all-target-libgloss -[+ IF cxx +]configure-target-[+module+]: maybe-all-target-libstdc++-v3 -[+ ENDIF cxx +][+ ENDFOR lang_env_dependencies +] - # There are two types of dependencies here: 'hard' dependencies, where one # module simply won't build without the other; and 'soft' dependencies, where # if the depended-on module is missing, the depending module will do without @@ -1550,7 +1522,6 @@ configure-target-[+module+]: maybe-all-target-newlib maybe-all-target-libgloss +][+ FOR bootstrap_stage +] [+ (make-dep (dep-stage) "") +][+ ENDFOR bootstrap_stage +] -all-prebootstrap: [+ (dep-target "" "on" (exist? "hard")) +] [+ == "bootstrap" +][+ FOR bootstrap_stage +] [+ (make-dep (dep-stage) (dep-stage)) +][+ @@ -1558,17 +1529,48 @@ all-prebootstrap: [+ (dep-target "" "on" (exist? "hard")) +] [+ ESAC +][+ ENDFOR dependencies +] -# Non-toplevel bootstrap rules must depend on several packages, to be built -# before gcc. Another wart that will go away, hopefully soon. -@if gcc-no-bootstrap -[+ FOR host_modules +][+ - IF (and (not (= (get "module") "gcc")) - (hash-ref boot-modules (get "module"))) +] -all-prebootstrap: maybe-all-[+module+][+ - ENDIF +][+ -ENDFOR host_modules +] +# Dependencies for target modules on other target modules are +# described by lang_env_dependencies; the defaults apply to anything +# not mentioned there. +[+ + ;; Predicate for whether LANG was specified in lang_env_dependencies. + (define lang-dep (lambda (lang) + (hash-ref lang-env-deps (string-append (get "module") "-" lang)))) + + ;; Build the hash table we will need. + (define lang-env-deps (make-hash-table 7)) ++][+ FOR lang_env_dependencies +][+ + (if (exist? "cxx") + (hash-create-handle! lang-env-deps + (string-append (get "module") "-" "cxx") #t)) + + (if (exist? "no_c") + (hash-create-handle! lang-env-deps + (string-append (get "module") "-" "no_c") #t)) + + (if (exist? "no_gcc") + (hash-create-handle! lang-env-deps + (string-append (get "module") "-" "no_gcc") #t)) + "" +][+ ENDFOR lang_env_dependencies +] + +@if gcc-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_gcc")) + +][+ IF bootstrap +][+ FOR bootstrap_stage +] +configure-stage[+id+]-target-[+module+]: maybe-all-stage[+id+]-target-libgcc[+ + ENDFOR +][+ ENDIF bootstrap +][+ ENDIF +][+ ENDFOR target_modules +] +@endif gcc-bootstrap + +@if gcc-no-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_gcc")) +] +configure-target-[+module+]: maybe-all-target-libgcc[+ + ENDIF +][+ ENDFOR target_modules +] @endif gcc-no-bootstrap +[+ FOR target_modules +][+ IF (not (lang-dep "no_c")) +] +configure-target-[+module+]: maybe-all-target-newlib maybe-all-target-libgloss[+ + ENDIF +][+ IF (lang-dep "cxx") +] +configure-target-[+module+]: maybe-all-target-libstdc++-v3[+ + ENDIF +] +[+ ENDFOR target_modules +] + CONFIGURE_GDB_TK = @CONFIGURE_GDB_TK@ GDB_TK = @GDB_TK@ INSTALL_GDB_TK = @INSTALL_GDB_TK@ @@ -1599,7 +1601,7 @@ config.status: configure # Rebuilding configure. AUTOCONF = autoconf -$(srcdir)/configure: @MAINT@ $(srcdir)/configure.in $(srcdir)/config/acx.m4 +$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4 cd $(srcdir) && $(AUTOCONF) # ------------------------------ diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 5bb5bb2a600..e006595f969 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,1359 +1,1788 @@ -2006-12-11 Eric Botcazou +2007-07-02 Joseph Myers - * elflink.c (bfd_elf_gc_sections): Also search for corresponding - sections with .gnu.linkonce.t. prefix. + * elfxx-mips.c (mips_elf_calculate_relocation): Handle + R_MIPS_TLS_DTPREL32 and R_MIPS_TLS_DTPREL64. + * elf64-mips.c (mips_elf64_howto_table_rela): Support + R_MIPS_TLS_DTPREL64. -2006-08-08 Nick Clifton +2007-07-02 Alan Modra - PR binutils/2724 - * coffcode.h (coff_new_section_hook): Only modify the section - symbol of sections which were created by the user. - -2006-07-19 Alan Modra - - * bfd-in.h (enum notice_asneeded_action): Define. - * bfd-in2.h: Regenerate. - * elflink.c (elf_link_add_object_symbols): Call linker "notice" - function with NULL name for as-needed handling. - -2006-07-12 Matthew R. Dempsky - - * cpu-m68k.c (bfd_m68k_compatible): Handle CPU32. - -2006-06-23 Daniel Jacobowitz - - * Makefile.am: Clear RELEASE. - * Makefile.in: Regenerated. - -2006-06-23 Daniel Jacobowitz - - * configure.in: Update version to 2.17. - * Makefile.am: Set RELEASE. - * configure, Makefile.in: Regenerated. - -2006-06-12 Daniel Jacobowitz - - * configure.in: Update version to 2.16.94. - * configure: Regenerated. - -2006-06-11 Richard Sandiford - Thiemo Seufer - - * elfxx-mips.c (mips_elf_link_hash_table): Add function_stub_size. - (STUB_ORI): New macro. - (STUB_LI16U): Fix formatting. - (MIPS_FUNCTION_STUB_SIZE): Delete. - (MIPS_FUNCTION_STUB_MAX_SIZE): Likewise. - (MIPS_FUNCTION_STUB_NORMAL_SIZE): New macro. - (MIPS_FUNCTION_STUB_BIG_SIZE): Likewise. - (_bfd_mips_elf_adjust_dynamic_symbol): Use htab->function_stub_size - instead of MIPS_FUNCTION_STUB_SIZE. - (count_section_dynsyms): New function, split out from - _bfd_mips_elf_final_link. - (_bfd_mips_elf_always_size_sections): Get a worst-case estimate - of the number of dynamic symbols needed and use it to set up - function_stub_size. Use function_stub_size rather than - MIPS_FUNCTION_STUB_SIZE to determine the size of the stub section. - Use 16-byte stubs for 0x10000 dynamic symbols. - (_bfd_mips_elf_size_dynamic_sections): Use htab->function_stub_size - instead of MIPS_FUNCTION_STUB_SIZE. Fix formatting. - (_bfd_mips_elf_finish_dynamic_symbol): Likewise. Change the - size of the stub buffer from MIPS_FUNCTION_STUB_MAX_SIZE to - MIPS_FUNCTION_STUB_BIG_SIZE. Tweak the check for unhandled dynindxes. - Use MIPS_FUNCTION_STUB_BIG_SIZE rather than a hard-coded 20. - Use STUB_ORI rather than STUB_LI16U for big stubs. - (_bfd_mips_elf_link_hash_table_create): Initialize function_stub_size. - (_bfd_mips_elf_final_link): Use count_section_dynsyms. - -2006-06-08 David Daney - - * elfxx-mips.c (STUB_LI16): Removed. - (STUB_LUI): New macro. - (STUB_LI16U): Ditto. - (STUB_LI16S): Ditto. - (MIPS_FUNCTION_STUB_SIZE): Rewrote to take info parameter. - (_bfd_mips_elf_adjust_dynamic_symbol): Pass info parameter to - MIPS_FUNCTION_STUB_SIZE. - (_bfd_mips_elf_always_size_sections): Ditto. - (_bfd_mips_elf_size_dynamic_sections): Ditto. - (_bfd_mips_elf_finish_dynamic_sections): Ditto. - (_bfd_mips_elf_finish_dynamic_symbol): Rewrote stub generation - to allow larger symbol table indexes. - -2006-06-07 Joseph S. Myers - - * po/Make-in (pdf, ps): New dummy targets. - -2006-06-01 Daniel Jacobowitz - - Backport: - 2006-05-23 H.J. Lu - PR ld/2655 - PR ld/2657 - * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Properly - update CIE/FDE length. Don't pad to the section alignment. - -2006-05-30 Nick Clifton - - * po/es.po: Updated Spanish translation. - -2006-05-23 Alan Modra - - * elf64-ppc.c (compare_symbols): Prefer strong dynamic global - function syms over other syms. - -2006-05-22 Daniel Jacobowitz - - * elflink.c (_bfd_elf_add_dynamic_entry): Remove DT_TEXTREL - check. - (bfd_elf_final_link): Add a late DT_TEXTREL check. - * elfxx-mips.c (MIPS_ELF_READONLY_SECTION): Define. - (mips_elf_create_dynamic_relocation): Set DF_TEXTREL. - (_bfd_mips_elf_check_relocs): Delete MIPS_READONLY_SECTION. - Use MIPS_ELF_READONLY_SECTION. - (_bfd_mips_elf_size_dynamic_sections): Clear DF_TEXTREL after - creating DT_TEXTREL. - (_bfd_mips_elf_finish_dynamic_sections): Clear textrel markers - if no text relocations were generated. - -2006-05-17 Daniel Jacobowitz - - * configure.in: Update version to 2.16.93. - * configure: Regenerated. - -2006-05-17 Alan Modra - - * elflink.c (elf_gc_sweep): Don't specially keep non-alloc, - non-load sections if they have relocs. - -2006-05-16 Andreas Schwab - - * aoutf1.h (struct external_sparc_core): Declare c_regs as struct - regs instead of an array of int. - (struct external_solaris_bcp_core): Likewise. - (swapcore_sun3): Use offsetof instead of computing the offset - manually. - (swapcore_sparc): Likewise. Simplify reference to c_regs. - (swapcore_solaris_bcp): Likewise. - -2006-05-15 Alan Modra - - PR 2658 - * elf32-ppc.c (ppc_elf_relax_section): Don't segfault on non-pic - -shared link. - -2006-05-11 Michael Matz - - * elflink.c (match_group_member): Correctly iterate group - members. - -2006-05-11 Nick Clifton - - PR ld/2607 - * elfcode.h (valid_section_index_p): New function: Checks for a - valid section index. Allows indicies in the range SHN_LOPROC to - SHN_HIOS. - (elf_object_p): Use valid_section_index_p. - -2006-05-11 Nick Clifton - - PR ld/2257 - * elfcode.h (elf_object_p): Allow files with corrupt e_shstrndx - fields to still be handled as ELF files. - -2006-05-10 Alan Modra - - PR 2342 - * elflink.c (_bfd_elf_default_action_discarded): Revert 2006-02-16. - -2006-05-10 Alan Modra - - * elf64-ppc.c (ppc64_elf_tls_optimize): Only optimize - R_PPC64_TPREL64 and R_PPC64_DTPMOD64 relocs when they are in - the .toc and referenced by a TLS code sequence. - (ppc64_elf_edit_toc): Cater for the unlikely situation that - .toc is the first section in a file. - -2006-05-03 Kaz Kojima - - PR binutils/2584 - * tekhex.c (getvalue): Change return type to bfd_boolean and - add the new parameter. Return false if the unexpected character - is found. - (getsym): Likewise. - (first_phase): Change return type to bfd_boolean and return - false if the unexpected character is found. Replace abort - with returning false. - (pass_over): Change return type to bfd_boolean and the type of - the second argument to bfd_boolean (*) (bfd *, int, char *). - Return false if FUNC returns false. - (tekhex_object_p): Return NULL if pass_over fails. - -2006-05-02 Paul Brook - - * elf32-arm.c (elf32_arm_final_link_relocate): Set thumb funciton bit - for R_ARM_REL32. - -2006-04-27 Alan Modra - - * coff-rs6000.c (xcoff_write_archive_contents_old): Warning fix. - -2006-04-16 Daniel Jacobowitz - - * configure.in: Update version to 2.16.92. - * configure: Regenerated. - -2006-04-16 Daniel Jacobowitz - - * po/SRC-POTFILES.in: Regenerated. - -2006-04-14 David Heine - - * elf32-xtensa.c (build_reloc_opcodes): New. - (compute_text_actions): Use it to decode opcodes outside inner loop. - (check_section_ebb_pcrels_fit): Add "reloc_opcodes" argument, and if - it is set, use it to get the opcodes for relocations. - (move_shared_literal): Adjust call to check_section_ebb_pcrels_fit. - -2006-04-08 H.J. Lu - - PR ld/2513 - * elf32-i386.c (GOT_TLS_MASK): New macro for tls_type. - (GOT_TLS_IE_IE): Likewise. - (GOT_TLS_IE_GD): Likewise. - (GOT_TLS_IE_MASK): Likewise. - (elf_i386_check_relocs): For global symbols, set GOT_TLS_IE_GD - and GOT_TLS_IE_IE for R_386_TLS_GD and R_386_TLS_IE - respectively. - (allocate_dynrelocs): If both GOT_TLS_IE_IE and GOT_TLS_IE_GD - are set, treat tls_type as GOT_TLS_IE_BOTH. - (elf_i386_relocate_section): Likewise. - -2006-04-07 Randolph Chung - - * elf64-hppa.c (elf64_hppa_grok_prstatus): New function. - (elf64_hppa_grok_psinfo): Likewise. - (elf_backend_grok_pstatus, elf_backend_grok_psinfo): Define. - -2006-04-06 DJ Delorie - - * elf32-m32c.c (m32c_elf_relocate_section): Generate a symbol for - each plt entry we create. - -2006-04-06 Carlos O'Donell - - * po/Make-in: Add install-html target. - * Makefile.am: Rename docdir to bfddocdir. Add datarootdir, docdir - htmldir. Add install-html and install-html-recursive targets. + * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. - * configure.in: AC_SUBST for datarootdir, docdir and htmldir. - * configure: Regenerate. + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + * po/bfd.pot: Regenerate. -2006-04-06 H.J. Lu +2007-07-02 Alan Modra - * elfxx-ia64.c (elfNN_ia64_relax_section): Skip unneeded passes - with the skip_relax_pass_0 and skip_relax_pass_1 bits in the - section structure. + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Tidy + symsec != NULL tests. -2006-04-05 Bernd Schmidt +2007-07-02 Alan Modra - * elf32-bfin.c (bfinfdpic_relocs_info_hash): Sprinkle casts to - eliminate warnings. + PR 4712 + * elf.c (assign_file_positions_for_load_sections): Adjust lma + by p_vaddr_offset. -2006-04-05 H.J. Lu - James E Wilson +2007-06-30 H.J. Lu - PR ld/2442 - * elfxx-ia64.c (elfNN_ia64_dyn_sym_info): Remove next. - (elfNN_ia64_local_hash_entry): Add count, sorted_count and - size. - (elfNN_ia64_link_hash_entry): Likewise. - (elfNN_ia64_new_elf_hash_entry): Initialize count, sorted_count - and size. - (elfNN_ia64_hash_copy_indirect): Updated elfNN_ia64_dyn_sym_info - processing. - (elfNN_ia64_hash_hide_symbol): Likewise. - (elfNN_ia64_global_dyn_sym_thunk): Likewise. - (elfNN_ia64_local_dyn_sym_thunk): Likewise. - (elfNN_ia64_global_dyn_info_free): New function. - (elfNN_ia64_local_dyn_info_free): Likewise. - (elfNN_ia64_hash_table_free): Free local and global - elfNN_ia64_dyn_sym_info. - (addend_compare): New function. - (sort_dyn_sym_info): Likewise. - (get_dyn_sym_info): Updated to use binary search for addend. - (elfNN_ia64_check_relocs): Scan relocations to create dynamic - relocation arrays first. + * aclocal.m4: Regenerated. + * Makefile.in: Likewise. -2006-04-05 Bernd Schmidt +2007-06-29 Joseph Myers - * elf32-bfin.c (_bfin_create_got_section): Don't generate a _gp - symbol. + * elf32-ppc.c (ppc_elf_merge_obj_attributes): New. + (ppc_elf_merge_private_bfd_data): Call it. -2006-04-05 H.J. Lu +2007-06-29 Joseph Myers - PR ld/2411 - * elflink.c (check_dynsym): New. - (elf_link_output_extsym): Use it. - (bfd_elf_final_link): Likewise. + * elfxx-mips.c (mips_elf_merge_obj_attributes): New. + (_bfd_mips_elf_merge_private_bfd_data): Call it. -2006-04-05 H.J. Lu +2007-06-29 Joseph Myers - PR ld/2404 - * elflink.c (_bfd_elf_merge_symbol): Skip the default indirect - symbol from the dynamic definition with the default version if - its type and the type of existing regular definition mismatch. - -2006-04-05 Richard Sandiford - Daniel Jacobowitz - - * config.bfd (sparc-*-vxworks*): New stanza. - * configure.in (bfd_elf32_sparc_vxworks_vec): New stanza. - (bfd_elf32_sparc_vec, bfd_elf64_sparc_vec): Add elf-vxworks.lo. - * configure: Regenerate. - * elf32-sparc.c: Include elf-vxworks.h. - (elf32_sparc_vxworks_link_hash_table_create: New. - (elf32_sparc_vxworks_final_write_processing): New. - (TARGET_BIG_SYM): Override for VxWorks. - (TARGET_BIG_NAME, ELF_MINPAGESIZE): Likewise. - (bfd_elf32_bfd_link_hash_table_create): Likewise. - (elf_backend_want_got_plt, elf_backend_plt_readonly): Likewise. - (elf_backend_got_header_size, elf_backend_add_symbol_hook): Likewise. - (elf_backend_link_output_symbol_hook): Likewise. - (elf_backend_emit_relocs): Likewise. - (elf_backend_final_write_processing, elf32_bed): Likewise. - * elfxx-sparc.c: Include libiberty.h and elf-vxworks.h. - (sparc_vxworks_exec_plt0_entry, sparc_vxworks_exec_plt_entry): New. - (sparc_vxworks_shared_plt0_entry, sparc_vxworks_shared_plt_entry): New. - (_bfd_sparc_elf_link_hash_table_create): Don't initialize - build_plt_entry here. - (create_got_section): Initialize sgotplt for VxWorks. - (_bfd_sparc_elf_create_dynamic_sections): Initialize build_plt_entry, - plt_header_size and plt_entry_size, with new VxWorks-specific settings. - Call elf_vxworks_create_dynamic_sections for VxWorks. - (allocate_dynrelocs): Use plt_header_size and plt_entry_size. - Allocate room for .got.plt and .rela.plt.unloaded entries on VxWorks. - (_bfd_sparc_elf_size_dynamic_sections): Don't allocate a nop in .plt - for VxWorks. Check for the .got.plt section. - (sparc_vxworks_build_plt_entry): New function. - (_bfd_sparc_elf_finish_dynamic_symbol): Add handling of VxWorks PLTs. - Don't make _GLOBAL_OFFSET_TABLE_ and _PROCEDURE_LINKAGE_TABLE_ - absolute on VxWorks. - (sparc32_finish_dyn): Add special handling for DT_RELASZ - and DT_PLTGOT on VxWorks. - (sparc_vxworks_finish_exec_plt): New. - (sparc_vxworks_finish_shared_plt): New. - (_bfd_sparc_elf_finish_dynamic_sections): Call them. - Use plt_header_size and plt_entry_size. - * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add is_vxworks, - srelplt2, sgotplt, plt_header_size and plt_entry_size fields. - * Makefile.am (elfxx-sparc.lo): Depend on elf-vxworks.h. - (elf32-sparc.lo): Likewise. + * elf-attrs.c: New. + * Makefile.am (BFD32_BACKENDS): Add elf-attrs.lo. + (BFD32_BACKENDS_CFILES): Add elf-attrs.c. + (elf-attrs.lo): Generate dependencies. * Makefile.in: Regenerate. - * targets.c (bfd_elf32_sparc_vxworks_vec): Declare. - (_bfd_target_vector): Add a pointer to it. - -2006-03-30 Ben Elliston - - PR ld/2267 - * elflink.c (elf_fixup_link_order): Ensure `elfsec' is not a - special section number that exceeds the number of ELF sections - (eg. SHN_MIPS_SCOMMON). - -2006-03-27 Richard Sandiford - - * elfxx-mips.c (mips_got_entry): Add more commentary. - (mips_elf_local_got_index): Use the hash table entry to record - the GOT index of forced-local symbols. - (mips_elf_initialize_tls_index): Rearrange code. Store the index - in either the hash table entry or the mips_got_entry, not both. - Add more commentary. - (mips_elf_multi_got): Make sure the g->next is nonnull when calling - mips_elf_initialize_tls_index. - -2006-03-25 Bernd Schmidt - - * elf32-bfin.c (bfd_const_reloc, bfd_oper_reloc, bfin_push_reloc, - RELOC_STACK_SIZE, reloc_stack, reloc_stack_tos, is_reloc_stack_empty, - reloc_stack_push, reloc_stack_pop, reloc_stack_operate, - bfin_areloc_howto_table): Delete. All - uses deleted as well. - (bfin_reloc_map): Delete all stack relocs. - (bfin_info_to_howto, bfin_bfd_reloc_type_lookup, - bfin_reloc_type_lookup): Don't support them. - (bfin_relocate_section): Don't try to handle them. - - * config.bfd (bfin-*-*): Add bfd_elf32_bfinfdpic_vec. - * configure.in: Likewise. + * configure.in (elf): Add elf-attrs.lo. * configure: Regenerate. - * elf32-bfin.c: Include "elf/dwarf2.h" and "hashtab.h". - (BFIN_RELOC_MAX): Now 0x21. - (bfin_howto_table, bfin_reloc_map): Add FD-PIC relocs. - (bfd_elf32_bfinfdpic_vec): Declare. - (IS_FDPIC): New macro. - (struct bfinfdpic_elf_link_hash_table): New struct. - (bfinfdpic_hash_table, bfinfdpic_got_section, - bfinfdpic_gotrel_section, bfinfdpic_gotfixup_section, - bfinfdpic_plt_setion, bfinfdpic_pltrel_section, - bfinfdpic_relocs_info, bfinfdpic_got_initial_offset, - bfinfdpic_plt_initial_offset): Accessor macros for it. - (BFINFDPIC_SYM_LOCAL, BFINFDPIC_FUNCDESC_LOCAL): New macros. - (struct bfinfdpic_relocs_info): New struct. - (LZPLT_RESOLVER_EXTRA, LZPLT_NORMAL_SIZE, LZPLT_ENTRIES, - BFINFDPIC_LZPLT_BLOCK_SIZE, BFINFDPIC_LZPLT_RESOLV_LOC, - DEFAULT_STACK_SIZE): New macros. - (bfinfdpic_elf_link_hash_table_create, bfinfdpic_relocs_info_hash, - bfinfdpic_relocs_info_eq, bfinfdpics_relocs_info_find, - bfinfdpic_relocs_info_for_global, bfinfdpic_relocs_info_for_local, - bfinfdpic_pic_merge_early_relocs_info, _bfinfdpic_add_dyn_reloc, - _bfinfdpic_add_rofixup, _bfinfdpic_osec_to_segment, - _bfinfdpic_osec_readonly_p, bfinfdpic_relocate_section, - bfinfdpic_check_relocs, bfinfdpic_gc_sweep_hook, - _bfinfdpic_link_omit_section_dynsym, _bfin_create_got_section, - elf32_bfinfdpic_create_dynamic_sections, _bfinfdpic_get_fd_entry, - _bfinfdpic_compute_got_alloc_data, _bfinfdpic_get_got_entry, - _bfinfdpic_assign_got_entries, _bfinfdpic_assign_plt_entries, - _bfinfdpic_resolve_final_relocs_info, - elf32_bfinfdpic_size_dynamic_sections, - elf32_bfinfdpic_always_size_sections, - elf32_bfinfdpic_modify_segment_map, - _bfinfdpic_count_got_plt_entries, - elf32_bfinfdpic_finish_dynamic_sections, - elf32_bfinfdpic_adjust_dynamic_symbol, - elf32_bfinfdpic_finish_dynamic_symbol, - elf32_bfinfdpic_elf_use_relative_eh_frame, - elf32_bfinfdpic_elf_encode_eh_address, - elf32_bfin_object_p, bfin_elf_copy_private_bfd_data, - elf32_bfinfdpic_copy_private_bfd_data, - (struct _bfinfdpic_dynamic_got_info, - struct _bfinfdpic_dynamic_got_plt_info): New structs. - (elf32_bfin_print_private_bfd_data): Print PIC flags. - (elf32_bfin_merge_private_bfd_data): Extend to support FD-PIC. - (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, elf32_bed, - elf_backend_got_header_size, bfd_elf32_bfd_link_hash_table_create, - elf_backend_always_size_sectinos, elf_backend_modify_segment_map, - bfd_elf32_bfd_copy_private_bfd_data, - elf_backend_create_dynamic_sections, elf_backend_adjust_dynamic_symbol, - elf_backend_size_dynamic_sections, elf_backend_finish_dynamic_symbol, - elf_backend_finish_dynamic_sections, elf_backend_relocate_section, - elf_backend_can_make_relative_eh_frame, elf_backend_check_relocs, - elf_backend_can_make_ldsa_relative_eh_frame, elf_backend_may_use_rel_p, - elf_backend_may_use_rela_p, elf_backend_default_use_rela_p, - elf_backend_omit_section_dynsym): Redefine these macros and include - "elf32-target.h" again to create the elf32-bfinfdpic target. - * reloc.c (BFD_RELOC_BFIN_GOT17M4, BFD_RELOC_BFIN_GOTHI, - BFD_RELOC_BFIN_GOTLO, BFD_RELOC_BFIN_FUNCDESC, - BFD_RELOC_BFIN_FUNCDESC_GOT17M4, BFD_RELOC_BFIN_FUNCDESC_GOTHI, - BFD_RELOC_BFIN_FUNCDESC_GOTLO, BFD_RELOC_BFIN_FUNCDESC_VALUE, - BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4, BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI, - BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO, BFD_RELOC_BFIN_GOTOFFHI, - BFD_RELOC_BFIN_GOTOFFLO): New. - * targets.c (bfd_elf32_bfinfdpic_vec): New bfd_target. - (_bfd_target_vector): Add it. - * bfd-in2.h: Regenerate. - * libbfd.h: Regenerate. + * elf-bfd.h (struct elf_backend_data): Add entries for object + attributes. + (NUM_KNOWN_OBJ_ATTRIBUTES, obj_attribute, obj_attribute_list, + OBJ_ATTR_PROC, OBJ_ATTR_GNU, OBJ_ATTR_FIRST, OBJ_ATTR_LAST, + Tag_NULL, Tag_File, Tag_Section, Tag_Symbol, Tag_compatibility): + New. + (struct elf_obj_tdata): Add entries for object attributes. + (elf_known_obj_attributes, elf_other_obj_attributes, + elf_known_obj_attributes_proc, elf_other_obj_attributes_proc): + New. + (bfd_elf_obj_attr_size, bfd_elf_set_obj_attr_contents, + bfd_elf_get_obj_attr_int, bfd_elf_add_obj_attr_int, + bfd_elf_add_proc_attr_int, bfd_elf_add_obj_attr_string, + bfd_elf_add_proc_attr_string, bfd_elf_add_obj_attr_compat, + bfd_elf_add_proc_attr_compat, _bfd_elf_attr_strdup, + _bfd_elf_copy_obj_attributes, _bfd_elf_obj_attrs_arg_type, + _bfd_elf_parse_attributes, _bfd_elf_merge_object_attributes): New. + * elf.c (_bfd_elf_copy_private_bfd_data): Copy object attributes. + (bfd_section_from_shdr): Handle attributes sections. + * elflink.c (bfd_elf_final_link): Handle attributes sections. + * elfxx-target.h (elf_backend_obj_attrs_vendor, + elf_backend_obj_attrs_section, elf_backend_obj_attrs_arg_type, + elf_backend_obj_attrs_section_type): New. + (elfNN_bed): Update. + * elf32-arm.c (NUM_KNOWN_ATTRIBUTES, aeabi_attribute, + aeabi_attribute_list): Remove. + (struct elf32_arm_obj_tdata): Remove object attributes fields. + (check_use_blx, bfd_elf32_arm_set_vfp11_fix, using_thumb2, + elf32_arm_copy_private_bfd_data, elf32_arm_merge_eabi_attributes): + Update for new object attributes interfaces. + (uleb128_size, is_default_attr, eabi_attr_size, + elf32_arm_eabi_attr_size, write_uleb128, write_eabi_attribute, + elf32_arm_set_eabi_attr_contents, elf32_arm_bfd_final_link, + elf32_arm_new_eabi_attr, elf32_arm_get_eabi_attr_int, + elf32_arm_add_eabi_attr_int, attr_strdup, + elf32_arm_add_eabi_attr_string, elf32_arm_add_eabi_attr_compat, + copy_eabi_attributes, elf32_arm_parse_attributes): Remove. Moved + to generic code in elf-attrs.c. + (elf32_arm_obj_attrs_arg_type): New. + (elf32_arm_fake_sections): Do not handle .ARM.attributes. + (elf32_arm_section_from_shdr): Do not handle SHT_ARM_ATTRIBUTES. + (bfd_elf32_bfd_final_link): Remove. + (elf_backend_obj_attrs_vendor, elf_backend_obj_attrs_section, + elf_backend_obj_attrs_arg_type, + elf_backend_obj_attrs_section_type): New. + * elf32-bfin.c (bfin_elf_copy_private_bfd_data): Copy object + attributes. + * elf32-frv.c (frv_elf_copy_private_bfd_data): Likewise. + * elf32-iq2000.c (iq2000_elf_copy_private_bfd_data): Likewise. + * elf32-mep.c (mep_elf_copy_private_bfd_data): Likewise. + * elf32-mt.c (mt_elf_copy_private_bfd_data): Likewise. + * elf32-sh.c (sh_elf_copy_private_data): Likewise. + * elf64-sh64.c (sh_elf64_copy_private_data_internal): Likewise. -2006-03-25 Richard Sandiford +2007-06-29 Paul Brook - * cpu-m68k.c (bfd_m68k_compatible): Treat ISA A+ and ISA B code as - incompatible. Likewise MAC and EMAC code. - * elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Use - bfd_get_compatible to set the new bfd architecture. Rely on it - to detect incompatibilities. + * elf32-arm.c (bfd_elf32_arm_process_before_allocation): Suppress + call veneers for call relocations against undefined symbols. + (elf32_arm_final_link_relocate): Turn call to undefined symbol + into a jump to the next instruction. -2006-03-22 Bob Wilson +2007-06-29 Michael Snyder - * elf32-xtensa.c (xtensa_read_table_entries): Remove assertion that - rel->r_addend is zero. + * bfd.c (bfd_demangle): Plug memory leak (Coverity). -2006-03-22 Richard Sandiford +2007-06-29 M R Swami Reddy - * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Fix type - of "loc". + * Makefile.am: Add cr16 related entry + * Makefile.in: Regenerate + * archures.c: Add bfd_cr16_arch + * bfd-in2.h: Regenerate + * config.bfd: Add cr16-elf + * configure.in: Add bfd_elf32_cr16_vec + * configure: Regenerate. + * targets.c: Added cr16 related information + * cpu-cr16.c: New file. + * elf32-cr16.c: New file. + * reloc.c: Added cr16 relocs. -2006-03-22 Richard Sandiford - Daniel Jacobowitz - Phil Edwards - Zack Weinberg - Mark Mitchell - Nathan Sidwell +2007-06-29 Alan Modra - * bfd-in2.h: Regenerate. - * config.bfd (mips*-*-vxworks*, mips*el-*-vxworks*): New stanzas. - * configure.in (bfd_elf32_bigmips_vxworks_vec): New stanza. - (bfd_elf32_littlemips_vxworks_vec): Likewise. - (bfd_elf32_bigmips_vec): Add elf-vxworks.lo. - (bfd_elf32_littlemips_vec): Likewise. - (bfd_elf32_nbigmips_vec): Likewise. - (bfd_elf32_nlittlemips_vec): Likewise. - (bfd_elf32_ntradbigmips_vec): Likewise. - (bfd_elf32_ntradlittlemips_vec): Likewise. - (bfd_elf32_tradbigmips_vec): Likewise. - (bfd_elf32_tradlittlemips_vec): Likewise. - (bfd_elf64_bigmips_vec): Likewise. - (bfd_elf64_littlemips_vec): Likewise. - (bfd_elf64_tradbigmips_vec): Likewise. - (bfd_elf64_tradlittlemips_vec): Likewise. - * elf32-mips.c: Include elf-vxworks.h. - (mips_info_to_howto_rel): Use elf_backend_mips_rtype_to_howto - instead of calling mips_elf32_rtype_to_howto directly. - (mips_vxworks_copy_howto_rela): New reloc howto. - (mips_vxworks_jump_slot_howto_rela): Likewise. - (mips_vxworks_bfd_reloc_type_lookup): New function. - (mips_vxworks_rtype_to_howto): Likewise. - (mips_vxworks_final_write_processing): Likewise. - (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Override for VxWorks. - (TARGET_BIG_SYM, TARGET_BIG_NAME, elf_bed, ELF_MAXPAGESIZE): Likewise. - (elf_backend_want_got_plt): Likewise. - (elf_backend_want_plt_sym): Likewise. - (elf_backend_got_symbol_offset): Likewise. - (elf_backend_want_dynbss): Likewise. - (elf_backend_may_use_rel_p): Likewise. - (elf_backend_may_use_rela_p): Likewise. - (elf_backend_default_use_rela_p): Likewise. - (elf_backend_got_header_size: Likewise. - (elf_backend_plt_readonly): Likewise. - (bfd_elf32_bfd_reloc_type_lookup): Likewise. - (elf_backend_mips_rtype_to_howto): Likewise. - (elf_backend_adjust_dynamic_symbol): Likewise. - (elf_backend_finish_dynamic_symbol): Likewise. - (bfd_elf32_bfd_link_hash_table_create): Likewise. - (elf_backend_add_symbol_hook): Likewise. - (elf_backend_link_output_symbol_hook): Likewise. - (elf_backend_emit_relocs): Likewise. - (elf_backend_final_write_processing: Likewise. - (elf_backend_additional_program_headers): Likewise. - (elf_backend_modify_segment_map): Likewise. - (elf_backend_symbol_processing): Likewise. - * elfxx-mips.c: Include elf-vxworks.h. - (mips_elf_link_hash_entry): Add is_relocation_target and - is_branch_target fields. - (mips_elf_link_hash_table): Add is_vxworks, srelbss, sdynbss, srelplt, - srelplt2, sgotplt, splt, plt_header_size and plt_entry_size fields. - (MIPS_ELF_RELA_SIZE, MIPS_ELF_REL_DYN_NAME): New macros. - (MIPS_RESERVED_GOTNO): Take a mips_elf_link_hash_table argument. - Return 3 for VxWorks. - (ELF_MIPS_GP_OFFSET): Change the argument from a bfd to a - mips_elf_link_hash_table. Return 0 for VxWorks. - (MIPS_ELF_GOT_MAX_SIZE): Change the argument from a bfd to a - mips_elf_link_hash_table. Update the call to ELF_MIPS_GP_OFFSET. - (mips_vxworks_exec_plt0_entry): New variable. - (mips_vxworks_exec_plt_entry): Likewise. - (mips_vxworks_shared_plt0_entry): Likewise. - (mips_vxworks_shared_plt_entry): Likewise. - (mips_elf_link_hash_newfunc): Initialize the new hash_entry fields. - (mips_elf_rel_dyn_section): Change the bfd argument to a - mips_elf_link_hash_table. Use MIPS_ELF_REL_DYN_NAME to get - the name of the section. - (mips_elf_initialize_tls_slots): Update the call to - mips_elf_rel_dyn_section. - (mips_elf_gotplt_index): New function. - (mips_elf_local_got_index): Add an input_section argument. - Update the call to mips_elf_create_local_got_entry. - (mips_elf_got_page): Likewise. - (mips_elf_got16_entry): Likewise. - (mips_elf_create_local_got_entry): Add bfd_link_info and input_section - arguments. Create dynamic relocations for each entry on VxWorks. - (mips_elf_merge_gots): Update the use of MIPS_ELF_GOT_MAX_SIZE. - (mips_elf_multi_got): Update the uses of MIPS_ELF_GOT_MAX_SIZE - and MIPS_RESERVED_GOTNO. - (mips_elf_create_got_section): Update the uses of - MIPS_ELF_GOT_MAX_SIZE. Create .got.plt on VxWorks. - (is_gott_symbol): New function. - (mips_elf_calculate_relocation): Use a dynobj local variable. - Update the calls to mips_elf_local_got_index, mips_elf_got16_entry and - mips_elf_got_page_entry. Set G to the .got.plt entry when calculating - VxWorks R_MIPS_CALL* relocations. Calculate and use G for all GOT - relocations on VxWorks. Add dynamic relocations for references - to the VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols. Don't - create dynamic relocations for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 - in VxWorks executables. - (mips_elf_allocate_dynamic_relocations): Add a bfd_link_info argument. - Use MIPS_ELF_RELA_SIZE to calculate the size of a VxWorks entry. - Don't allocate a null entry on VxWorks. - (mips_elf_create_dynamic_relocation): Update the call to - mips_elf_rel_dyn_section. Use absolute rather than relative - relocations for VxWorks, and make them RELA rather than REL. - (_bfd_mips_elf_create_dynamic_sections): Don't make .dynamic - read-only on VxWorks. Update the call to mips_elf_rel_dyn_section. - Create the .plt, .rela.plt, .dynbss and .rela.bss sections on - VxWorks. Likewise create the _PROCEDURE_LINKAGE_TABLE symbol. - Call elf_vxworks_create_dynamic_sections for VxWorks and - initialize the plt_header_size and plt_entry_size fields. - (_bfd_mips_elf_check_relocs): Don't allow GOT relocations to be - used in VxWorks executables. Don't allocate dynamic relocations - for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 in VxWorks executables. - Set is_relocation_target for each symbol referenced by a relocation. - Allocate .rela.dyn entries for relocations against the special - VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols. Create GOT - entries for all VxWorks R_MIPS_GOT16 relocations. Don't allocate - a global GOT entry for symbols mentioned in VxWorks R_MIPS_CALL*, - R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 relocations. Update the calls - to mips_elf_rel_dyn_section and mips_elf_allocate_dynamic_relocations. - Set is_branch_target for symbols mentioned in R_MIPS_PC16 or R_MIPS_26 - relocations. Don't set no_fn_stub on VxWorks. - (_bfd_mips_elf_adjust_dynamic_symbol): Update the call to - mips_elf_allocate_dynamic_relocations. - (_bfd_mips_vxworks_adjust_dynamic_symbol): New function. - (_bfd_mips_elf_always_size_sections): Do not allocate GOT page - entries for VxWorks, and do not create multiple GOTs. - (_bfd_mips_elf_size_dynamic_sections): Use MIPS_ELF_REL_DYN_NAME. - Handle .got specially for VxWorks. Update the uses of - MIPS_RESERVED_GOTNO and mips_elf_allocate_dynamic_relocations. - Check for sgotplt and splt. Allocate the .rel(a).dyn contents last, - once its final size is known. Set DF_TEXTREL for VxWorks. Add - DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL, DT_PLTRELSZ and DT_JMPREL - tags on VxWorks. Do not add the MIPS-specific tags for VxWorks. - (_bfd_mips_vxworks_finish_dynamic_symbol): New function. - (mips_vxworks_finish_exec_plt): Likewise. - (mips_vxworks_finish_shared_plt): Likewise. - (_bfd_mips_elf_finish_dynamic_sections): Remove an unncessary call - to mips_elf_rel_dyn_section. Use a VxWorks-specific value of - DT_PLTGOT. Handle DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL, - DT_PLTRELSZ and DT_JMPREL. Update the uses of MIPS_RESERVED_GOTNO - and mips_elf_rel_dyn_section. Use a different GOT header for - VxWorks. Don't sort .rela.dyn on VxWorks. Finish the PLT on VxWorks. - (_bfd_mips_elf_link_hash_table_create): Initialize the new - mips_elf_link_hash_table fields. - (_bfd_mips_vxworks_link_hash_table_create): New function. - (_bfd_mips_elf_final_link): Set the GP value to _GLOBAL_OFFSET_TABLE_ - on VxWorks. Update the call to ELF_MIPS_GP_OFFSET. - * elfxx-mips.h (_bfd_mips_vxworks_adjust_dynamic_symbol): Declare. - (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise. - (_bfd_mips_vxworks_link_hash_table_create): Likewise. - * libbfd.h: Regenerate. - * Makefile.am (elfxx-mips.lo): Depend on elf-vxworks.h. - (elf32-mips.lo): Likewise. - * Makefile.in: Regenerate. - * reloc.c (BFD_RELOC_MIPS_COPY, BFD_RELOC_MIPS_JUMP_SLOT): Declare. - * targets.c (bfd_elf32_bigmips_vxworks_vec): Declare. - (bfd_elf32_littlemips_vxworks_vec): Likewise. - (_bfd_target_vector): Add entries for them. + * elflink.c (_bfd_elf_link_assign_sym_version): Improve error + message for undefined version nodes. + (elf_gc_sweep): Don't warn when zero size sections are + removed. -2006-03-19 John David Anglin +2007-06-29 Nathan Froyd - * elf64-hppa.c (elf64_hppa_special_sections): Change flags for .tbss - section from SHF_PARISC_WEAKORDER to SHF_HP_TLS. - (elf_backend_special_sections): Remove #undef. + * elf32-ppc.c (ppc_elf_info_to_howto): Check for invalid relocation + types. -2006-03-18 John David Anglin +2007-06-29 Alan Modra - * elf64-hppa.c (allocate_global_data_opd): Don't create an OPD entry - for undefined weak symbols. + * elf32-spu.c (spu_elf_fake_sections): New function. + (elf_backend_fake_sections): Define. -2006-03-17 Daniel Jacobowitz +2007-06-29 Alan Modra - PR ld/2462 - * elflink.c (bfd_elf_final_link): Remove - bed->elf_backend_emit_relocs from emit_relocs. + * elf.c (assign_file_positions_for_load_sections): Use elf + section header sh_size rather than bfd section size, simplifying + .tbss handling. -2006-03-17 Alexandre Oliva +2007-06-29 Alan Modra - * elf32-ppc.c (ppc_elf_relocate_section): Copy addend from - first relocation to the second when relaxing TLS GD to LE; - zero it out when relaxing to IE. + PR ld/4701 + * elf.c (assign_file_positions_for_load_sections): Ensure bss + segments meet gABI alignment requirements. Don't allocate + file space for bss sections in a segment also containing file + or program headers. -2006-03-17 Alan Modra +2007-06-27 Alan Modra - PR 2434 - * elflink.c (elf_link_add_object_symbols): Save and restore - warning sym's linked sym. - -2006-03-16 Alan Modra - - PR 2434 - * elflink.c (struct elf_smash_syms_data, elf_smash_syms): Delete. - (elf_link_add_object_symbols): Delete unnecessary locals. Rename - hash_table -> htab. Formatting. Save entire symbol table - before loading as-needed syms, and restore afterwards if lib not - needed. Use bfd_hash_allocate rather than bfd_alloc for sym - name. Free some buffers earlier. - * bfd-in.h (struct bfd_hash_table): Add entsize. - (bfd_hash_table_init, bfd_hash_table_init_n): Adjust prototype. - * elf-bfd.h (_bfd_elf_link_hash_table_init): Likewise - * hash.c (bfd_hash_table_init_n): Add entsize param, save to - hash table. - (bfd_hash_table_init): Add param, adjust calls. - * aoutx.h: Adjust all hash_table_init functions and calls. - * bfd.c: Likewise. - * coff-arm.c: Likewise. - * coff-h8300.c: Likewise. - * coff-ppc.c: Likewise. - * cofflink.c: Likewise. + * bfd.c (struct bfd): Rename "next" to "archive_next". + * archive.c: Rename uses throughout file. + * archive64.c: Likewise. + * coff-rs6000.c: Likewise. * ecoff.c: Likewise. - * ecofflink.c: Likewise. - * elf-m10300.c: Likewise. - * elf-strtab.c: Likewise. - * elf.c: Likewise. - * elf32-arm.c: Likewise. - * elf32-bfin.c: Likewise. - * elf32-cris.c: Likewise. - * elf32-frv.c: Likewise. - * elf32-hppa.c: Likewise. - * elf32-i386.c: Likewise. - * elf32-m32r.c: Likewise. - * elf32-m68hc1x.c: Likewise. - * elf32-m68k.c: Likewise. - * elf32-ppc.c: Likewise. - * elf32-s390.c: Likewise. - * elf32-sh.c: Likewise. - * elf32-vax.c: Likewise. - * elf64-alpha.c: Likewise. - * elf64-hppa.c: Likewise. - * elf64-ppc.c: Likewise. - * elf64-s390.c: Likewise. - * elf64-sh64.c: Likewise. - * elf64-x86-64.c: Likewise. - * elfxx-ia64.c: Likewise. - * elfxx-mips.c: Likewise. - * elfxx-sparc.c: Likewise. - * i386linux.c: Likewise. - * libaout.h: Likewise. - * libbfd-in.h: Likewise. - * libcoff-in.h: Likewise. - * linker.c: Likewise. - * m68klinux.c: Likewise. - * merge.c: Likewise. - * opncls.c: Likewise. - * pdp11.c: Likewise. - * sparclinux.c: Likewise. - * stabs.c: Likewise. - * sunos.c: Likewise. - * vms.c: Likewise. - * xcofflink.c: Likewise. - * section.c (struct section_hash_entry): Move to.. - * libbfd-in.h: ..here. - * Makefile.am: Run "make dep-am" - * Makefile.in: Regenerate. + * som.c: Likewise. * bfd-in2.h: Regenerate. - * libbfd.h: Regenerate. - * libcoff.h: Regenerate. -2006-03-16 Alan Modra + * elf32-ppc.c (ppc_elf_select_plt_layout): Properly iterate over + input bfds. + * elf32-spu.c (spu_elf_create_sections): Likewise. - * elf32-ppc.c (ppc_elf_check_relocs): REL24 and REL14 relocs - against __GLOBAL_OFFSET_TABLE__ need never be dynamic. Tweak - last change to REL32 relocs so that they are counted as - possibly dynamic as per REL24 and REL14. +2007-06-26 H.J. Lu -2006-03-16 Alan Modra + * dwarf2.c (find_line): New. Contains the duplicated code from: + (_bfd_dwarf2_find_nearest_line): Use it. + (_bfd_dwarf2_find_line): Use it. - * elf32-ppc.c (ppc_elf_check_relocs): Don't fall into REL24 - checks from REL32. +2007-06-26 Joseph Myers -2006-03-15 Ben Elliston + * elf32-arm.c (copy_eabi_attributes): Copy type of attributes. - * elf32-arm.c (elf32_arm_merge_eabi_attributes): Iterate over all - in_list elements, not just the first. - -2006-03-14 Richard Sandiford +2007-06-25 Richard Sandiford - * elf32-mips.c (mips_elf_adjust_addend): New function, mostly split - out from... - (_bfd_mips_elf_relocate_section): ...here. Use it to adjust r_addend - for final links too. + * elfxx-mips.c (mips_elf_calculate_relocation): Allow local stubs + to be used for calls from MIPS16 code. -2006-03-13 Richard Sandiford +2007-06-23 Andreas Schwab - * elfxx-mips.c (mips_elf_create_got_section): Initialize hgot. - -2006-03-11 H.J. Lu - - PR ld/2443 - * dwarf2.c (concat_filename): Don't issue an error if file is - 0. - -2006-03-10 Paul Brook - - * elf32-arm.c (INTERWORK_FLAG): Handle EABIv5. - (elf32_arm_print_private_bfd_data): Ditto. - -2006-03-09 Paul Brook - - * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Recognise additional - mapping symbols. - -2006-03-09 Khem Raj - - * elf32-arm.c(elf32_arm_finish_dynamic_sections): Use unsigned - char type. - -2006-03-08 H.J. Lu - - * elfxx-ia64.c (elfNN_ia64_choose_gp): Properly choose gp. - -2006-03-07 Richard Sandiford - Daniel Jacobowitz - Zack Weinberg - Nathan Sidwell - Paul Brook - Ricardo Anguiano - Phil Edwards - - * configure.in (bfd_elf32_bigarm_vec): Include elf-vxworks.lo. - (bfd_elf32_bigarm_symbian_vec): Likewise. - (bfd_elf32_bigarm_vxworks_vec): Likewise. - (bfd_elf32_littlearm_vec): Likewise. - (bfd_elf32_littlearm_symbian_vec): Likewise. - (bfd_elf32_littlearm_vxworks_vec): Likewise. + * configure.in (--with-separate-debug-dir): New option. * configure: Regenerate. - * elf32-arm.c: Include libiberty.h and elf-vxworks.h. - (RELOC_SECTION, RELOC_SIZE, SWAP_RELOC_IN, SWAP_RELOC_OUT): New macros. - (elf32_arm_vxworks_bed): Add forward declaration. - (elf32_arm_howto_table_1): Fix the masks for R_ASM_ABS12. - (elf32_arm_vxworks_exec_plt0_entry): New table. - (elf32_arm_vxworks_exec_plt_entry): Likewise. - (elf32_arm_vxworks_shared_plt_entry): Likewise. - (elf32_arm_link_hash_table): Add vxworks_p and srelplt2 fields. - (reloc_section_p): New function. - (create_got_section): Use RELOC_SECTION. - (elf32_arm_create_dynamic_sections): Likewise. Call - elf_vxworks_create_dynamic_sections for VxWorks targets. - Choose between the two possible values of plt_header_size - and plt_entry_size. - (elf32_arm_link_hash_table_create): Initialize vxworks_p and srelplt2. - (elf32_arm_abs12_reloc): New function. - (elf32_arm_final_link_relocate): Call it. Allow the creation of - dynamic R_ARM_ABS12 relocs on VxWorks. Use reloc_section_p, - RELOC_SIZE, SWAP_RELOC_OUT and RELOC_SECTION. Initialize the - r_addend fields of relocs. On rela targets, skip any code that - adjusts in-place addends. When using _bfd_link_final_relocate - to perform a final relocation, pass rel->r_addend as the addend - argument. - (elf32_arm_merge_private_bfd_data): If one of the bfds is a VxWorks - object, ignore flags that are not standard on VxWorks. - (elf32_arm_check_relocs): Allow the creation of dynamic R_ARM_ABS12 - relocs on VxWorks. Use reloc_section_p. - (elf32_arm_adjust_dynamic_symbol): Use RELOC_SECTION and RELOC_SIZE. - (allocate_dynrelocs): Use RELOC_SIZE. Account for the size of - .rela.plt.unloaded relocs on VxWorks targets. - (elf32_arm_size_dynamic_sections): Use RELOC_SIZE. Check for - .rela.plt.unloaded as well as .rel(a).plt. Add DT_RELA* tags - instead of DT_REL* tags on RELA targets. - (elf32_arm_finish_dynamic_symbol): Use RELOC_SECTION, RELOC_SIZE - and SWAP_RELOC_OUT. Initialize r_addend fields. Handle VxWorks - PLT entries. Do not make _GLOBAL_OFFSET_TABLE_ absolute on VxWorks. - (elf32_arm_finish_dynamic_sections): Use RELOC_SECTION, RELOC_SIZE - and SWAP_RELOC_OUT. Initialize r_addend fields. Handle DT_RELASZ - like DT_RELSZ. Handle the VxWorks form of initial PLT entry. - Correct the .rela.plt.unreloaded symbol indexes. - (elf32_arm_output_symbol_hook): Call the VxWorks version of this - hook on VxWorks targets. - (elf32_arm_vxworks_link_hash_table_create): Set vxworks_p to true. - Minor formatting tweak. - (elf32_arm_vxworks_final_write_processing): New function. - (elf_backend_add_symbol_hook): Override for VxWorks and reset - for Symbian. - (elf_backend_final_write_processing): Likewise. - (elf_backend_emit_relocs): Likewise. - (elf_backend_want_plt_sym): Likewise. - (ELF_MAXPAGESIZE): Likewise. - (elf_backend_may_use_rel_p): Minor formatting tweak. - (elf_backend_may_use_rela_p): Likewise. - (elf_backend_default_use_rela_p): Likewise. - (elf_backend_rela_normal): Likewise. - * Makefile.in (elf32-arm.lo): Depend on elf-vxworks.h. - -2006-03-06 Nathan Sidwell - - * archures.c (bfd_mach_mcf_isa_a_nodiv, bfd_mach_mcf_isa_b_nousp): - New. Adjust other variants. - (bfd_default_scan): Update. - * bfd-in2.h: Rebuilt. - * cpu-m68k.c: Adjust. - (bfd_m68k_compatible): New. Use it for architectures. - * elf32-m68k.c (elf32_m68k_object_p): Adjust. - (elf32_m68k_merge_private_bfd_data): Adjust. Correct isa-a/b - mismatch. - (elf32_m68k_print_private_bfd_data): Adjust. - * ieee.c (ieee_write_processor): Adjust. - -2006-03-06 Alan Modra - - * dwarf2.c: Formatting. - (add_line_info): Remove outer loop. - -2006-03-05 H.J. Lu - Alan Modra - - PR binutils/2338 - * dwarf2.c (loadable_section): New struct. - (dwarf2_debug): Add loadable_section_count and - loadable_sections. - (new_line_sorts_after): New. - (add_line_info): Use new_line_sorts_after to compare line - addresses. - (check_function_name): Removed. - (unset_sections): New. - (place_sections): New. - (_bfd_dwarf2_find_nearest_line): Updated. Call place_sections - and unset_sections on relocatable files. + * Makefile.am (dwarf2.lo): Add rule to pass DEBUGDIR. + * Makefile.in: Regenerate. + * dwarf2.c (_bfd_dwarf2_find_nearest_line): Pass DEBUGDIR to + bfd_follow_gnu_debuglink. (_bfd_dwarf2_find_line): Likewise. -2006-03-03 Nick Clifton +2007-06-22 Nick Clifton - * cpu-avr.c: Update to ISO-C90 formatting. - * elf32-avr.c: Likewise. + * dwarf2.c: Add support for reading in debug information via a + .gnu_debuglink section: + (struct dwarf2_debug): Add bfd field to record the bfd containing + the debug info. + (parse_comp_unit): Remove ABFD parameter. Instead use the bfd + field in the dwarf2_debug structure. + (_bfd_dwarf2_find_nearest_line): If a debug info section could not + be found in the current bfd call bfd_follow_gnu_debuglink to see + if another file contains the debug information. If it does, open + it and continue. + (_bfd_dwarf2_find_line): Likewise. -2006-03-03 Bjoern Haase +2007-06-19 H.J. Lu - * elf32-avr.c (avr_reloc_map): Insert BFD_RELOC_AVR_MS8_LDI - and R_AVR_MS8_LDI - (bfd_elf_avr_final_write_processing): Set - EF_AVR_LINKRELAX_PREPARED in e_flags field. - (elf32_avr_relax_section): New function. - (elf32_avr_relax_delete_bytes): New function. - (elf32_avr_get_relocated_section_contents): New function. - (avr_pc_wrap_around): New function. - (avr_relative_distance_considering_wrap_around): New function. - (avr_final_link_relocate): Handle negative int8t_t immediate for R_AVR_LDI. - * reloc.c: Add BFD_RELOC_AVR_MS8_LDI and BFD_RELOC_AVR_LDI_NEG - * libbfd.h: Regenerate. - * bfd-in2.h: Regenerate. + PR ld/4590 + * elfxx-ia64.c (sort_dyn_sym_info): Keep the valid got_offset + when removing duplicated entries. + (get_dyn_sym_info): Initialize the got_offset field to -1. + Update call to sort_dyn_sym_info. + (elfNN_ia64_relocate_section): Call sort_dyn_sym_info to sort + array of addend and remove duplicates. -2006-03-02 DJ Delorie +2007-06-18 H.J. Lu - * elf32-m32c.c (m32c_offset_for_reloc): Fix local symbol - calculations. + * libpei.h (_bfd_XXi_final_link_postscript): Remove + duplication. + (bfd_target_pei_p): New. + (bfd_target_pei_arch): New + (bfd_target_efi_p): Likewise. + (bfd_target_efi_arch): New + (bfd_pe_executable_p): Use bfd_target_pei_p and + bfd_target_efi_p. -2006-03-02 Richard Sandiford + * peicode.h (arch_type): New enum. + (pe_arch): New function. + (pe_bfd_object_p): Don't match PE/EFI target with EFI/PE file + if there is an EFI/PE target. - * elf32-ppc.c (is_ppc_elf_target): Return true if the target is - bfd_elf32_powerpc_vxworks_vec. +2007-06-14 H.J. Lu -2006-03-02 Nick Clifton + * Makefile.am (ACLOCAL_AMFLAGS): Add -I . -I ../config. - * elf32-m32c.c (m32c_elf_relax_section): Initialise 'gap'. + * acinclude.m4: Don't include m4 files. Remove libtool + kludge. -2006-03-02 Richard Sandiford + * Makefile.in: Regenerated. + * aclocal.m4: Likewise. + * configure: Likewise. - * elf32-i386.c (elf_i386_create_dynamic_sections): Use - elf_vxworks_create_dynamic_sections. - (elf_i386_size_dynamic_sections): Remove VxWorks GOT and PLT - symbol handling. - * elf32-ppc.c (ppc_elf_create_dynamic_sections): Use - elf_vxworks_create_dynamic_sections. - (ppc_elf_size_dynamic_sections): Remove VxWorks GOT and PLT - symbol handling. - * elf-vxworks.c (elf_vxworks_create_dynamic_sections): New function. - * elf-vxworks.h (elf_vxworks_create_dynamic_sections): Declare. +2007-06-11 Sterling Augustine + Bob Wilson -2006-03-02 Richard Sandiford + * elf32-xtensa.c (extend_ebb_bounds_forward): Use renamed + XTENSA_PROP_NO_TRANSFORM flag instead of XTENSA_PROP_INSN_NO_TRANSFORM. + (extend_ebb_bounds_backward, compute_text_actions): Likewise. + (compute_ebb_proposed_actions, coalesce_shared_literal): Likewise. + (xtensa_get_property_predef_flags): Likewise. + (compute_removed_literals): Pass new arguments to is_removable_literal. + (is_removable_literal): Add sec, prop_table and ptblsize arguments. + Do not remove literal if the NO_TRANSFORM property flag is set. - * elf32-i386.c (elf_i386_vxworks_link_output_symbol_hook): Delete. - (elf_backend_link_output_symbol_hook): Use - elf_vxworks_link_output_symbol_hook instead. - * elf32-ppc.c (elf_i386_vxworks_link_output_symbol_hook): Delete. - (elf_backend_link_output_symbol_hook): Use - elf_vxworks_link_output_symbol_hook instead. - * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Provide the - same interface as elf_backend_link_output_symbol_hook. - * elf-vxworks.h (elf_vxworks_link_output_symbol_hook): Update - prototype accordingly. +2007-05-31 Richard Sandiford -2006-03-02 Richard Sandiford + * elfxx-mips.c (mips_elf_initialize_tls_index): When processing a + type (3) single-GOT entry, read tls_type from the hash table entry + rather than the GOT entry. - * elf32-ppc.c (ppc_elf_plt_type): New enumeration. - (ppc_elf_link_hash_table): Replace old_got and new_got with - plt_type and can_use_new_plt. - (ppc_elf_create_dynamic_sections): Add SEC_HAS_CONTENTS, - SEC_LOAD and SEC_READONLY to the VxWorks .plt flags. - (ppc_elf_check_relocs): Set can_use_new_plt instead of new_plt. - Move from plt_type == PLT_UNSET to PLT_OLD instead of setting old_plt. - (ppc_elf_select_plt_layout): Move from plt_type == PLT_UNSET to - either plt_type == PLT_OLD or plt_type == PLT_NEW. Assert that - this function should not be called for VxWorks targets. - (ppc_elf_tls_setup): Use plt_type instead of old_got. - (allocate_got): Likewise. Rearrange so that max_before_header - is only used for PLT_OLD and PLT_NEW. - (allocate_dynrelocs): Use plt_type instead of old_got and is_vxworks. - (ppc_elf_size_dynamic_sections): Likewise. - (ppc_elf_relax_section): Likewise. - (ppc_elf_relocate_section): Likewise. - (ppc_elf_finish_dynamic_symbol): Likewise. - (ppc_elf_vxworks_link_hash_table_create): Initialize plt_type. +2007-06-01 Alan Modra -2006-02-28 Richard Sandiford + * simple.c (bfd_simple_get_relocated_section_contents): Init + input_bfds_tail. - * elf32-i386.c (elf_i386_link_hash_table): Add next_tls_desc_index. - (elf_i386_link_hash_table_create): Initialize it. - (elf_i386_compute_jump_table_size): Use it instead of - srelplt->reloc_count. - (allocate_dynrelocs): Likewise. - (elf_i386_size_dynamic_sections): Likewise. - (elf_i386_relocate_section): Likewise. - -2006-02-27 Jakub Jelinek +2007-05-30 Alan Modra - * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Handle S flag. - (_bfd_elf_write_section_eh_frame): Likewise. + * elf.c (elf_fake_sections): Adjust test for SHT_NOBITS sections + created by objcopy --only-keep-debug. + (_bfd_elf_init_private_section_data): Only change elf_section_type + if it is SHT_NULL. -2006-02-27 Carlos O'Donell + * elf.c (assign_file_positions_for_load_sections): Correct sh_type + to SHT_NOBITS earlier. Base actions in rest of function on sh_type + and sh_flags instead of bfd section flags. Delete voff and code + keeping nobits segments aligned. - * po/Make-in: Add html target. +2007-05-25 Eric Christopher -2006-02-27 Richard Sandiford + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): + Check that sym_sec isn't NULL before accessing. - * elf-m10300.c (_bfd_mn10300_elf_finish_dynamic_symbol): Use the - cached hgot entry to check for _GLOBAL_OFFSET_TABLE_. - * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Likewise. - * elf32-bfin.c (bfin_finish_dynamic_symbol): Likewise. - * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise. - * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise. - * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise. - * elf32-m32r.c (m32r_elf_finish_dynamic_symbol): Likewise. - * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): Likewise. - * elf32-sh.c (sh_elf_finish_dynamic_symbol): Likewise. - * elf32-vax.c (elf_vax_finish_dynamic_symbol): Likewise. - * elf32-xtensa.c (elf_xtensa_finish_dynamic_symbol): Likewise. - * elf64-sh64.c (sh64_elf64_finish_dynamic_symbol): Likewise. - * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Likewise. - * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Likewise. - * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise. Also use - the cached hplt entry to check for _PROCEDURE_LINKAGE_TABLE_. - * elf64-alpha.c (elf64_alpha_finish_dynamic_symbol): Likewise. - * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise. - * elfxx-ia64.c (elfNN_ia64_finish_dynamic_symbol): Likewise. - * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise. +2007-05-24 Steve Ellcey -2006-02-25 Richard Sandiford - - * elf-bfd.h (elf_link_hash_table): Add hplt field. - * elflink.c (_bfd_elf_create_dynamic_sections): Initialize it. - * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Likewise. - * elf32-frv.c (_frv_create_got_section): Likewise. - * elf32-m32r.c (m32r_elf_create_dynamic_sections): Likewise. - * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise. - * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise. - * elf64-sh64.c (sh64_elf64_create_dynamic_sections): Likewise. - * elf32-i386.c (elf_i386_link_hash_table): Remove hgot and hplt. - (elf_i386_link_hash_table_create): Don't initialize them. - (elf_i386_size_dynamic_sections): Use the generic ELF hplt and - hgot fields. - (elf_i386_finish_dynamic_symbol): Likewise. - * elf32-ppc.c (ppc_elf_link_hash_table): Remove hplt. - (ppc_elf_size_dynamic_sections): Use the generic ELF hplt fields. - (ppc_elf_finish_dynamic_symbol): Likewise. - -2006-02-24 DJ Delorie - - * elf32-m32c.c (m32c_elf_howto_table): Add relaxation relocs. - (m32c_elf_relocate_section): Don't relocate them. - (compare_reloc): New. - (relax_reloc): Remove. - (m32c_offset_for_reloc): New. - (m16c_addr_encodings): New. - (m16c_jmpaddr_encodings): New. - (m32c_addr_encodings): New. - (m32c_elf_relax_section): Relax jumps and address displacements. - (m32c_elf_relax_delete_bytes): Adjust for internal syms. Fix up - short jumps. - - * reloc.c: Add m32c relax relocs. - * libbfd.h: Regenerate. - * bfd-in2.h: Regenerate. - -2006-02-24 H.J. Lu - - PR ld/2218 - * elf-bfd.h (elf_backend_data): Add elf_backend_fixup_symbol. - (_bfd_elf_link_hash_fixup_symbol): New. - - * elflink.c (_bfd_elf_link_hash_fixup_symbol): New. - (_bfd_elf_fix_symbol_flags): Call elf_backend_fixup_symbol if - it isn't NULL. - - * elfxx-ia64.c (elf_backend_fixup_symbol): Defined. - - * elfxx-target.h (elf_backend_fixup_symbol): New. - (elfNN_bed): Initialize elf_backend_fixup_symbol. - -2006-02-23 H.J. Lu - - * cpu-ia64-opc.c (ins_immu5b): New. - (ext_immu5b): Likewise. - (elf64_ia64_operands): Add IMMU5b. - -2006-02-21 Alan Modra - - PR ld/2218 - * elf32-arm.c (allocate_dynrelocs): Ensure undef weak sym in pie - is dynamic. - * elf32-hppa.c (allocate_dynrelocs): Likewise. - * elf32-i386.c (allocate_dynrelocs): Likewise. - * elf32-s390.c (allocate_dynrelocs): Likewise. - * elf32-sh.c (allocate_dynrelocs): Likewise. - * elf64-s390.c (allocate_dynrelocs): Likewise. - * elf64-x86-64.c (allocate_dynrelocs): Likewise. - * elf32-m32r.c (allocate_dynrelocs): Likewise. Discard relocs - on undef weak with non-default visibility too. - * elfxx-sparc.c (allocate_dynrelocs): Ditto. - -2006-02-21 Alan Modra - - * bfd.c: (_bfd_default_error_handler): Don't call abort on - error, instead call _exit. - (_bfd_abort): Call _exit not xexit. - -2006-02-17 Kevin Buettner - - * elf32-frv.c (elf32_frv_grok_prstatus, elf32_frv_grok_psinfo): - New functions. - * elf_backend_grok_prstatus, elf_backend_grok_psinfo): Define. - -2006-02-17 Shrirang Khisti - Anil Paranjape - Shilin Shakti - - * Makefile.am: Add xc16x related entry - * Makefile.in: Regenerate - * archures.c: Add bfd_xc16x_arch - * bfd-in2.h: Regenerate - * config.bfd: Add xc16x-*-elf - * configure.in: Add bfd_elf32_xc16x_vec + * Makefile.in: Regnerate. * configure: Regenerate. - * targets.c: Added xc16x related information - * cpu-xc16x.c: New file - * reloc.c: Add new relocations specific to xc16x: - BFD_RELOC_XC16X_PAG, BFD_RELOC_XC16X_POF, BFD_RELOC_XC16X_SEG, - BFD_RELOC_XC16X_SOF - * elf32-xc16x.c: New file. + * aclocal.m4: Regenerate. + * doc/Makefile.in: Regenerate. -2006-02-17 Alan Modra +2007-05-22 Paul Brook - * elf32-ppc.c (allocate_dynrelocs): Tweak undef weak handling. - * elf64-ppc.c (allocate_dynrelocs): Likewise. + * elf32-arm.c (output_arch_syminfo): Replace plt_shndx and plt_offset + with sec and sec_shndx. + (elf32_arm_ouput_plt_map_sym): Use them. + (elf32_arm_output_arch_local_syms): Output mapping symbols for + interworking glue. -2006-02-17 Alan Modra +2007-05-18 Paul Brook - PR ld/2218 - * elf64-ppc.c (allocate_dynrelocs): Ensure undef weak sym is - dynamic. - (ppc64_elf_relocate_section): Check output reloc section size. - * elf32-ppc.c (allocate_dynrelocs): Simplify undef weak test. + * elf32-arm.c (ARM2THUMB_V5_STATIC_GLUE_SIZE): Define. + (a2t1v5_ldr_insn, a2t1v5_ldr_insn): New. + (record_arm_to_thumb_glue): Add v5t non-pic glue. + (elf32_arm_create_thumb_stub): Ditto. -2006-02-16 H.J. Lu +2007-05-16 H.J. Lu + Alan Modra - PR ld/2322 - * elf.c (get_segment_type): New function. - (_bfd_elf_print_private_bfd_data): Use it. - (print_segment_map): New function. - (assign_file_positions_for_segments): Call print_segment_map - when there are not enough room for program headers. + * elflink.c (_bfd_elf_adjust_dynamic_copy): Align dynamic bss + section to the minimum alignment. -2006-02-16 Nick Hudson +2007-05-15 H.J. Lu + Alan Modra - * config.bfd (mips*el-*-netbsd*, mips*-*-netbsd*): Use - traditional MIPS ELF targets. + PR ld/4504 + * elf-bfd.h (_bfd_elf_adjust_dynamic_copy): New. + * elflink.c (_bfd_elf_adjust_dynamic_copy): New. -2006-02-15 H.J. Lu + * elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Call + _bfd_elf_adjust_dynamic_copy to adjust for the copy in dynamic + bss section. + * elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise. + * elf32-cris.c (elf_cris_adjust_dynamic_symbol): Likewise. + * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise. + * elf32-i370.c (i370_elf_adjust_dynamic_symbol): Likewise. + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Likewise. + * elf32-m32r.c (m32r_elf_adjust_dynamic_symbol): Likewise. + * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise. + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise. + * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise. + * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Likewise. + * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise. + * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise. + * elf64-sh64.c (sh64_elf64_adjust_dynamic_symbol): Likewise. + * elf64-x86-64.c (elf64_x86_64_adjust_dynamic_symbol): Likewise. + * elfxx-mips.c (_bfd_mips_vxworks_adjust_dynamic_symbol): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise. - PR binutils/2338 - * dwarf2.c (check_function_name): New function. - (_bfd_dwarf2_find_nearest_line): Use check_function_name to - check if function is correct. +2007-05-15 Richard Sandiford -2006-02-16 Alan Modra + * elfxx-mips.c (mips_elf_create_local_got_entry): Remove + input_section argument. Create .rela.dyn relocations against + symbol 0 rather than the section symbol. + (mips_elf_local_got_index): Remove input_section argument. + Update call to mips_elf_create_local_got_entry. + (mips_elf_got_page, mips_elf_got16_entry): Likewise. + (mips_elf_calculate_relocation): Update calls to + mips_elf_local_got_index, mips_elf_got16_entry and mips_elf_got_page. - * elflink.c (_bfd_elf_default_action_discarded): Return 0 for - debug sections. - (elf_link_input_bfd): Adjust comments. +2007-05-15 Mark Shinwell -2006-02-10 H.J. Lu + * elf32-arm.c (elf32_arm_final_link_relocate): Correctly + handle the Thumb-2 JUMP19 relocation. - * elf.c (copy_private_bfd_data): Minor update. +2007-05-15 Alan Modra -2006-02-10 H.J. Lu + PR 4479 + * elf.c (elf_fake_sections): Don't allow backend to change + SHT_NOBITS if called for strip/objcopy --only-keep-debug. + * elfxx-mips.c (_bfd_mips_elf_fake_sections): Remove similar + fix from here. - PR binutils/2258 - * elf.c (copy_private_bfd_data): Renamed to ... - (rewrite_elf_program_header): This. - (copy_elf_program_header): New function. - (copy_private_bfd_data): Likewise. +2007-05-14 Alan Modra -2006-02-07 Nathan Sidwell + * elf.c (bfd_elf_string_from_elf_section): Return NULL on + invalid shstrndx. + (bfd_elf_get_str_section): Likewise. - * archures.c (bfd_mach_mcf5200, bfd_mach_mcf5206e, - bfd_mach_mcf5307, bfd_mach_mcf5407, bfd_mach_mcf528x, - bfd_mach_mcfv4e, bfd_mach_mcf521x, bfd_mach_mcf5249, - bfd_mach_mcf547x, bfd_mach_mcf548x): Remove. - (bfd_mach_mcf_isa_a, bfd_mach_mcf_isa_a_div, - bfd_mach_mcf_isa_a_div_mac, bfd_mach_mcf_isa_a_div_emac, - bfd_mach_mcf_isa_aplus, bfd_mach_mcf_isa_aplus_mac, - bfd_mach_mcf_isa_aplus_emac, bfd_mach_mcf_isa_aplus_usp, - bfd_mach_mcf_isa_aplus_usp_mac, bfd_mach_mcf_isa_aplus_usp_emac, - bfd_mach_mcf_isa_b, bfd_mach_mcf_isa_b_mac, bfd_mach_mcf_isa_b_emac, - bfd_mach_mcf_isa_b_usp_float, bfd_mach_mcf_isa_b_usp_float_mac, - bfd_mach_mcf_isa_b_usp_float_emac): New. - (bfd_default_scan): Update coldfire mapping. - * bfd-in.h (bfd_m68k_mach_to_features, - bfd_m68k_features_to_mach): Declare. - * bfd-in2.h: Rebuilt. - * cpu-m68k.c (arch_info_struct): Add new coldfire machines, - adjust legacy names. - (m68k_arch_features): New. - (bfd_m68k_mach_to_features, - bfd_m68k_features_to_mach): Define. - * elf32-m68k.c (elf32_m68k_object_p): New. - (elf32_m68k_merge_private_bfd_data): Merge the CF EF flags. - (elf32_m68k_print_private_bfd_data): Print the CF EF flags. - (elf_backend_object_p): Define. - * ieee.c (ieee_write_processor): Update coldfire machines. - * libbfd.h: Rebuilt. +2007-05-12 Alan Modra -2006-02-06 Steve Ellcey + PR 4497 + * elf-eh-frame.c (struct cie): Add "local_personality". Make + "personality" a union. + (cie_eq): Compare local_personality too. Adjust personality + comparison. + (_bfd_elf_discard_section_eh_frame): Check binding on personality + reloc sym to allow for bad symtab. Use stashed local syms rather + than reading personality local sym. Handle discarded sections. - * elfxx-ia64.c (elfNN_ia64_fake_sections): Set SHF_IA_64_HP_TLS - if SHF_TLS is set. +2007-05-12 Alan Modra -2006-02-05 Arnold Metselaar + * elf32-spu.c (elf_howto_table): Add howto for R_SPU_ADDR16X. - * coff-z80.c (r_imm24): New howto. - (rtype2howto): New case R_IMM24. - (coff_z80_reloc_type_lookup): New case BFD_RELOC_24. - (extra_case): Use bfd_get_8 for R_IMM8, new case R_IMM24. +2007-05-11 Alan Modra -2006-02-04 Richard Sandiford + * elf32-ppc.h (ppc_elf_select_plt_layout): Update prototype. + (enum ppc_elf_plt_type): Move from.. + * elf32-ppc.c: ..here. + (struct ppc_elf_obj_tdata): Add makes_plt_call and has_rel16. + (struct ppc_elf_link_hash_table): Reorder. Add old_bfd. Delete + can_use_new_plt. Make is_vxworks a bitfield. + (ppc_elf_link_hash_table_create): Don't clear is_vxworks (again). + (ppc_elf_check_relocs): Update setting of reloc flags. Set old_bfd. + (ppc_elf_select_plt_layout): Modify parameters. Use bfd reloc + flags to better detect object files needing old bss-style plt. + Allow secure plt to be used without rel16 relocs being detected. + Warn if secure plt request cannot be allowed. - * elfxx-mips.c (mips_elf_initialize_tls_index): If a TLS symbol - has already been assigned a GOT index, copy that index to the - current hash table entry. +2007-05-11 Alan Modra -2006-02-01 Eric Botcazou + * reloc.c (BFD_RELOC_SPU_PPU32, BFD_RELOC_SPU_PPU64): Define. + * elf-bfd.h (struct elf_backend_data): Change return type of + elf_backend_relocate_section to int. + * elf32-spu.c (elf_howto_table): Add howtos for R_SPU_PPU32 and + R_SPU_PPU64. + (spu_elf_bfd_to_reloc_type): Convert new relocs. + (spu_elf_count_relocs): New function. + (elf_backend_count_relocs): Define. + (spu_elf_relocate_section): Arrange to emit R_SPU_PPU32 and + R_SPU_PPU64 relocs. + * elflink.c (elf_link_input_bfd): Emit relocs if relocate_section + returns 2. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. - * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass - for call-to-undefweak reloc overflow. +2007-05-10 Richard Sandiford -2006-01-31 Eric Botcazou + * elf32-arm.c (elf32_arm_check_relocs): Don't create PLT entries + for R_ARM_ABS12 relocs. + (elf32_arm_finish_dynamic_symbol): Fix the loop that creates + non-shared VxWorks PLT entries. - * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass - for 32-bit relocs overflow. +2007-05-11 Alan Modra -2006-01-27 Paul Brook + PR 4454 + * elf-eh-frame.c (struct cie): Make "personality" a bfd_vma. + (_bfd_elf_discard_section_eh_frame): Handle local syms on + personality relocation. - * elf32-arm.c (elf32_arm_get_symbol_type): Allow STT_TLS thumb - objects. +2007-05-10 Richard Sandiford -2006-01-18 Alexandre Oliva + * elf.c (assign_file_positions_for_load_sections): Use p_memsz + rather than p_filesz to calculate the LMA of the end of a segment. - Introduce TLS descriptors for i386 and x86_64. - * reloc.c (BFD_RELOC_386_TLS_GOTDESC, BFD_RELOC_386_TLS_DESC, - BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_X86_64_GOTPC32_TLSDESC, - BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_TLSDESC_CALL): New. - * libbfd.h, bfd-in2.h: Rebuilt. - * elf32-i386.c (elf_howto_table): New relocations. - (R_386_tls): Adjust. - (elf_i386_reloc_type_lookup): Map new relocations. - (GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P): New macros. - (GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): New macros. - (struct elf_i386_link_hash_entry): Add tlsdesc_got field. - (struct elf_i386_obj_tdata): Add local_tlsdesc_gotent field. - (elf_i386_local_tlsdesc_gotent): New macro. - (struct elf_i386_link_hash_table): Add sgotplt_jump_table_size. - (elf_i386_compute_jump_table_size): New macro. - (link_hash_newfunc): Initialize tlsdesc_got. - (elf_i386_link_hash_table_create): Set sgotplt_jump_table_size. - (elf_i386_tls_transition): Handle R_386_TLS_GOTDESC and - R_386_TLS_DESC_CALL. - (elf_i386_check_relocs): Likewise. Allocate space for - local_tlsdesc_gotent. - (elf_i386_gc_sweep_hook): Handle R_386_TLS_GOTDESC and - R_386_TLS_DESC_CALL. - (allocate_dynrelocs): Count function PLT relocations. Reserve - space for TLS descriptors and relocations. - (elf_i386_size_dynamic_sections): Reserve space for TLS - descriptors and relocations. Set up sgotplt_jump_table_size. - Don't zero reloc_count in srelplt. - (elf_i386_always_size_sections): New. Set up _TLS_MODULE_BASE_. - (elf_i386_relocate_section): Handle R_386_TLS_GOTDESC and - R_386_TLS_DESC_CALL. - (elf_i386_finish_dynamic_symbol): Use GOT_TLS_GD_ANY_P. - (elf_backend_always_size_sections): Define. - * elf64-x86-64.c (x86_64_elf_howto): Add R_X86_64_GOTPC32_TLSDESC, - R_X86_64_TLSDESC, R_X86_64_TLSDESC_CALL. - (R_X86_64_standard): Adjust. - (x86_64_reloc_map): Map new relocs. - (elf64_x86_64_rtype_to_howto): New, split out of... - (elf64_x86_64_info_to_howto): ... this function, and... - (elf64_x86_64_reloc_type_lookup): ... use it to map elf_reloc_val. - (GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P): New macros. - (GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): New macros. - (struct elf64_x86_64_link_hash_entry): Add tlsdesc_got field. - (struct elf64_x86_64_obj_tdata): Add local_tlsdesc_gotent field. - (elf64_x86_64_local_tlsdesc_gotent): New macro. - (struct elf64_x86_64_link_hash_table): Add tlsdesc_plt, - tlsdesc_got and sgotplt_jump_table_size fields. - (elf64_x86_64_compute_jump_table_size): New macro. - (link_hash_newfunc): Initialize tlsdesc_got. - (elf64_x86_64_link_hash_table_create): Initialize new fields. - (elf64_x86_64_tls_transition): Handle R_X86_64_GOTPC32_TLSDESC and - R_X86_64_TLSDESC_CALL. - (elf64_x86_64_check_relocs): Likewise. Allocate space for - local_tlsdesc_gotent. - (elf64_x86_64_gc_sweep_hook): Handle R_X86_64_GOTPC32_TLSDESC and - R_X86_64_TLSDESC_CALL. - (allocate_dynrelocs): Count function PLT relocations. Reserve - space for TLS descriptors and relocations. - (elf64_x86_64_size_dynamic_sections): Reserve space for TLS - descriptors and relocations. Set up sgotplt_jump_table_size, - tlsdesc_plt and tlsdesc_got. Make room for them. Don't zero - reloc_count in srelplt. Add dynamic entries for DT_TLSDESC_PLT - and DT_TLSDESC_GOT. - (elf64_x86_64_always_size_sections): New. Set up - _TLS_MODULE_BASE_. - (elf64_x86_64_relocate_section): Handle R_386_TLS_GOTDESC and - R_386_TLS_DESC_CALL. - (elf64_x86_64_finish_dynamic_symbol): Use GOT_TLS_GD_ANY_P. - (elf64_x86_64_finish_dynamic_sections): Set DT_TLSDESC_PLT and - DT_TLSDESC_GOT. Set up TLS descriptor lazy resolver PLT entry. - (elf_backend_always_size_sections): Define. +2007-05-10 Jakub Jelinek -2006-01-17 H.J. Lu + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Don't do copyreloc + processing if symbol is defined in the executable. - PR binutils/2096 - * dwarf2.c (comp_unit_contains_address): Update comment. - (_bfd_dwarf2_find_nearest_line): Use section's vma, instead of - lma. Return TRUE only if both comp_unit_contains_address and - comp_unit_find_nearest_line return TRUE. - (_bfd_dwarf2_find_line): Use section's vma, instead of lma. +2007-05-10 Alexandre Oliva -2006-01-18 Alan Modra + * elf32-frv.c (_frvfdpic_check_discarded_relocs): New. + (frvfdpic_elf_discard_info): New. + (elf_backend_discard_info): Define for FDPIC. - * elf-bfd.h (struct elf_backend_data): Add gc_mark_dynamic_ref. - (bfd_elf_gc_mark_dynamic_ref_symbol): Declare. - * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Rename from - elf_gc_mark_dynamic_ref_symbol. Make global. - (bfd_elf_gc_sections): Call bed->gc_mark_dynamic_ref. - * elfxx-target.h (elf_backend_gc_mark_dynamic_ref): Define. +2007-05-09 Mark Shinwell + + * elf32-arm.c (bfd_elf32_arm_vfp11_erratum_scan): Don't + attempt to scan if the bfd doesn't correspond to an ELF image. + (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise. + +2007-05-08 Alexandre Oliva + + * elf32-frv.c (elf32_frv_relocate_section): Discard dynamic relocs + for which _bfd_elf_section_offset returns -1. + +2007-05-08 Alan Modra + + * elf32-spu.c (spu_elf_size_stubs): Use "void *" for psyms. + (mark_functions_via_relocs): Likewise. + +2007-05-07 Alan Modra + + * elflink.c (bfd_elf_final_link): Correct reloc handling for + elf_backend_count_relocs. + (bfd_elf_discard_info): Print an error if we can't read syms. + +2007-05-07 Alan Modra + + * elf32-spu.c (spu_elf_reloc_type_lookup): Return NULL on + invalid reloc code. + (spu_elf_gc_mark_hook, spu_elf_section_processing): Delete functions. + (elf_backend_gc_mark_hook, elf_backend_section_processing): Don't + define. + +2007-05-07 Alan Modra + + * elf.c (assign_file_positions_for_load_sections): Don't check + core segment. + +2007-05-04 H.J. Lu + + * elflink.c (elf_link_sort_relocs): Return if both .rela.dyn + and .rel.dyn aren't present. + +2007-05-04 Nick Clifton + + * elflink.c (elf_link_sort_relocs): If both .rela.dyn and .rel.dyn + sections are present examine the indirect sections in an attempt + to compute the correct relocation size. If there is any + ambiguity, produce an error and refuse to sort. + +2007-05-03 Sandra Loosemore + + * elf32-arm.c (allocate_dynrelocs): Fix typo in comment. + +2007-05-03 Vincent Riviere + Nick Clifton + + PR gas/3041 + * aoutx.h (swap_std_reloc_out): Treat relocs against weak symbols + in the same way as relocs against external symbols. + +2007-05-02 Alan Modra + + * elf.c (assign_file_positions_for_load_sections): Set sh_offset + here. Set sh_type to SHT_NOBITS if we won't be allocating + file space. Don't bump p_memsz for non-alloc sections. Adjust + section-in-segment check. + (assign_file_positions_for_non_load_sections): Don't set sh_offset + here for sections that have already been handled above. + +2007-04-30 Alan Modra + + * elf32-spu.c (struct spu_link_hash_table): Add stack_analysis + and emit_stack_syms bitfields. + (get_sym_h): Read all symbols if stack analysis will be done. + (spu_elf_create_sections): Add stack_analysis and emit_stack_syms + params, and stash in hash table. + (is_hint): Split off from.. + (is_branch): ..here. Adjust callers. + (spu_elf_size_stubs): Add stack_analysis param. Arrange to read + and keep all syms. + (write_one_stub): Fix mem leak. + (find_function_stack_adjust): New function. + (sort_syms_syms, sort_syms_psecs): New vars. + (sort_syms): New function. + (struct call_info, struct function_info): New. + (struct spu_elf_stack_info): New. + (alloc_stack_info, maybe_insert_function, func_name): New functions. + (is_nop, insns_at_end, check_function_ranges): Likewise. + (find_function, insert_callee, mark_functions_via_relocs): Likewise. + (pasted_function, interesting_section, discover_functions): Likewise. + (mark_non_root, call_graph_traverse, build_call_tree): Likewise. + (sum_stack, spu_elf_stack_analysis, spu_elf_final_link): Likewise. + (bfd_elf32_bfd_final_link): Define. + * elf32-spu.h (struct _spu_elf_section_data): Add stack_info field. + (spu_elf_create_sections, spu_elf_size_stubs): Update prototypes. + +2007-04-28 Sergey Rogozhkin + + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Don't access + memory which we might not own. + +2007-04-27 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_make_sym_local): Restore deleted function. + (elf_xtensa_hide_symbol, elf_backend_hide_symbol): Likewise. + (elf_xtensa_allocate_dynrelocs): Use elf_xtensa_make_sym_local. + +2007-04-27 Bob Wilson + + * elf32-xtensa.c (xtensa_read_table_entries): Step through table + contents and relocs in parallel. + +2007-04-27 Bob Wilson + + * elf32-xtensa.c (relax_property_section): Remove extra irel increment. + +2007-04-27 Alan Modra + + * cpu-rs6000.c: Write Mimi's name in ASCII. + * coff-rs6000.c: Likewise. + * rs6000-core.c: Likewise. + +2007-04-27 Alan Modra + + * sysdep.h: Include config.h first. + Many files: Include sysdep.h before bfd.h. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2007-04-25 Alan Modra + + * sysdep.h: Revert last change. + +2007-04-24 Nick Clifton + + * coffcode.h (coff_slurp_reloc_table): Initialise dst.r_offset. + * coff-m68k.c (m68kcoff_rtype_to_howto): Initialize relent.howto. + +2007-04-24 Alan Modra + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Warn if + eh_frame_hdr table won't be created. + +2007-04-24 Alan Modra + + * acinclude.m4: Include config/stdint.m4. + * configure.in: Invoke GCC_HEADER_STDINT. + * sysdep.h: Don't include ansidecl.h here. + * configure: Regenerate. + * config.in: Regenerate. + * Makefile.in: Regenerate. + +2007-04-23 Nathan Sidwell + + * archures.c (bfd_mach_mcf_isa_c, bfd_mach_mcf_isa_c_mac, + bfd_mach_mcf_isa_c_emac): New. + * elf32-m68k.c (ISAC_PLT_ENTRY_SIZE, elf_isac_plt0_entry, + elf_isac_plt_entry, elf_isac_plt_info): New. + (elf32_m68k_object_p): Add ISA_C. + (elf32_m68k_print_private_bfd_data): Print ISA_C. + (elf32_m68k_get_plt_info): Detect ISA_C. + * cpu-m68k.c (arch_info): Add ISAC. + (m68k_arch_features): Likewise, + (bfd_m68k_compatible): ISAs B & C are not compatible. + +2007-04-21 Nick Clifton + + * ecoff.c (_bfd_ecoff_write_armap): Initialise rehash. + (ecoff_link_add_archive_symbols): Likewise. + * coff-m68k.c (m68kcoff_common_addend_rtype_to_howto): Initialise + relent.howto. + * ieee.c (parse_int): Initialise x. + (must_parse_int): Initialise result. + (ieee_slurp_external_symbols): Initialise value. + +2007-04-21 Alan Modra + + * config.bfd (spu-*-elf): Delete targ_selvecs. + +2007-04-19 Nick Clifton + + * coffcode.h (coff_rtype_to_howto): Initialise genrel.howto. + +2007-04-19 Alan Modra + + * bfd.c (bfd_demangle): New function. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + +2007-04-18 Matthias Klose + + * Makefile.am (libbfd_la_LDFLAGS): Use bfd soversion. + (bfdver.h): Use the date in non-release builds for the soversion. + * Makefile.in: Regenerate. + +2007-04-17 Paul Brook + + * elf.c (_bfd_elf_is_function_type): New function. + * elflink.c (_bfd_elf_merge_symbol): Use bed->is_function_type. + (_bfd_elf_dynamic_symbol_p, _bfd_elf_symbol_refs_local_p, + is_global_data_symbol_definition, elf_link_add_object_symbols): Ditto. + * elf-bfd.h (elf_backend_data): Add is_function_type. + (_bfd_elf_is_function_type): Add prototype. + * elfxx-target.h (elf_backend_is_function_type): Add default + definition. + (elfNN_bed): Add elf_backend_is_function_type. + * elf32-arm.c (elf32_arm_is_function_type): New function. + (elf_backend_is_function_type): Define. + +2007-04-17 Daniel Jacobowitz + + * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Put + DT_MIPS_RLD_MAP before DT_DEBUG again. + +2007-04-14 Steve Ellcey + + * Makefile.am: Add ACLOCAL_AMFLAGS. + * configure.in: Change macro call order. + * Makefile.in: Regnerate. + * doc/Makefile.in: Regenerate. + * configure: Regenerate. + +2007-04-14 Jakub Jelinek + + * elflink.c (bfd_elf_final_link): Don't free symbuf for + non-elf input bfds. + (bfd_elf_size_dynamic_sections): Don't access elf_section_data + for non-elf input bfds. + +2007-04-12 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Don't add + DT_MIPS_RTLD_MAP for PIEs. + +2007-04-12 Richard Sandiford + + * elfxx-mips.c (mips_elf_calculate_relocation): Set DT_TEXTREL + when creating a __GOTT_BASE__ or __GOTT_INDEX__ relocation + in a read-only section. + (_bfd_mips_elf_check_relocs): Likewise. + +2007-04-12 Bob Wilson + + * elf32-xtensa.c (xtensa_is_insntable_section): New. + (xtensa_is_proptable_section): New. + (elf_xtensa_discard_info_for_section): Handle "full" .xt.prop property + tables with 12-byte entries, as well as tables with 8-byte entries. + Sort the relocations before examining them. + (relax_property_section): Use xtensa_is_proptable_section and + xtensa_is_littable_section. Rewrite code for combining table entries + to be more robust in case of unexpected relocations. Do not set offset + of unused relocations to less than zero. + (xtensa_is_property_section): Use other functions instead of + duplicating section name comparisons. + (xtensa_is_littable_section): Use CONST_STRNEQ for ".gnu.linkonce.p.". + (xtensa_get_property_predef_flags): Use xtensa_is_insntable_section. + +2007-04-12 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_gc_mark_hook): Don't follow references + from Xtensa property sections. + +2007-04-12 Alan Modra + + * elf32-spu.c (needs_ovl_stub): Test that spu_elf_section_data + is non-NULL before dereferencing. + +2007-04-11 Nathan Sidwell + + * elf-vxworks.c (elf_vxworks_emit_relocs): Remap weakdef PLT slot + relocs too. + +2007-04-10 Richard Henderson + + * elf64-alpha.c (struct alpha_elf_link_hash_table): Add relax_trip. + (elf64_alpha_size_got_sections): Remove unused something_changed local. + (elf64_alpha_size_plt_section): Return void. + (elf64_alpha_size_rela_got_section): Likewise. + (elf64_alpha_relax_section): Only regenerate got+plt if the + relax_trip counter has changed. + +2007-04-09 Daniel Jacobowitz + + * Makefile.am (bfdver.h): Do not generate doc/bfdver.texi. + * doc/Makefile.am (DOCFILES): Add bfdver.texi. + (bfdver.texi): New rule. + * Makefile.in, doc/Makefile.in: Regenerated. + +2007-04-03 Matt Thomas + + * elf32-vax.c (elf_vax_relocate_section): Do not emit a PCREL reloc + in a shared object if it is not in a CODE section or if it is against + a section symbol. This allows DWARF2 to use pcrel format. + +2007-04-05 H.J. Lu + + PR ld/4304 + * elflink.c (bfd_elf_final_link): Call einfo callback in + bfd_link_info instead of _bfd_error_handler for DT_TEXTREL + warning. + +2007-04-05 Alan Modra + + * elf32-spu.c (spu_elf_output_symbol_hook): New function. + (elf_backend_link_output_symbol_hook): Define. + +2007-04-02 Nick Clifton + + PR binutils/4292 + * bfd.c (bfd_fprintf_vma): Do not print addresses of 32-bit + targets as 64-bit values, even if running on a 64-bit host. + * coffgen.c (coff_print_symbol): Likewise. + +2007-03-29 Nick Clifton + + PR binutils/4110 + * elf.c (IS_VALID_GROUP_SECTION_HEADER): New macro. + (setup_group): Use it. Report corrupt group section headers. + (bfd_section_from_shdr): Use new macro. Replace constant 4 with + GRP_ENTRY_SIZE. Cope with NULLs in the group section table. + (elf_fake_section): Replace constant 4 with GRP_ENTRY_SIZE. + +2007-03-29 Alan Modra + + PR ld/4267 + * elflink.c (evaluate_complex_relocation_symbols): Use bfd_vma + for rel->r_info values. + (bfd_elf_perform_complex_relocation): Likewise. + * elf32-ppc.c (allocate_dynrelocs): Set plt.offset to -1 for + unused entries. Don't clear plt.plist in loop. + +2007-03-28 Richard Sandiford + + * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove append_rela. + * elfxx-sparc.c (sparc_elf_append_rela_64, sparc_elf_append_rela_32): + Merge into... + (sparc_elf_append_rela): ...this new function. + (SPARC_ELF_APPEND_RELA): Delete. + (_bfd_sparc_elf_link_hash_table_create): Don't initialize + the deleted append_rela field. + (_bfd_sparc_elf_relocate_section): Use sparc_elf_append_rela + instead of SPARC_ELF_APPEND_RELA. + (_bfd_sparc_elf_finish_dynamic_symbol): Likewise. Use the + elf_size_info structure to find the size of a RELA entry and + the associated swap-out function. + (sparc64_finish_dyn, sparc64_finish_dyn): Merge into... + (sparc_finish_dyn): ...this new function. + (_bfd_sparc_elf_finish_dynamic_sections): Update calls accordingly. + +2007-03-28 Richard Sandiford + Phil Edwards + + * doc/bfd.texinfo: Put the contents after the title page rather + than at the end of the document. + +2007-03-27 Andreas Schwab + + * elfxx-ia64.c (elf_backend_default_execstack): Define to 0. + +2007-03-26 H.J. Lu + + * configure: Regenerated. + +2007-03-26 Alan Modra + + * elf32-spu.c (struct stubarr): Add stub_hash_table and err fields. + (allocate_spuear_stubs): New function. + (spu_elf_size_stubs): Call allocate_spuear_stubs. + +2007-03-26 Alan Modra + + * aout-adobe.c (aout_32_bfd_reloc_name_lookup): Define. + * aout-arm.c (MY_bfd_reloc_name_lookup): Define. + (MY (bfd_reloc_name_lookup)): New function. + * aout-ns32k.c (MY (bfd_reloc_name_lookup)): New function. + * aout-target.h (NAME (aout, reloc_name_lookup)): Declare. + (MY_bfd_reloc_name_lookup): Define. + * aout-tic30.c (tic30_aout_reloc_name_lookup): New function. + (MY_bfd_reloc_name_lookup): Define. + * aoutx.h (NAME (aout, reloc_type_lookup)): Don't declare. + (NAME (aout, reloc_name_lookup)): New function. + * bout.c (b_out_bfd_reloc_name_lookup): New function. + * coff-alpha.c (alpha_bfd_reloc_name_lookup): New function. + (_bfd_ecoff_bfd_reloc_name_lookup): Define. + * coff-arm.c (coff_arm_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-i386.c (coff_bfd_reloc_name_lookup): Define. + (coff_i386_reloc_name_lookup): New function. + * coff-i860.c (coff_i860_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-i960.c (coff_i960_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-m68k.c (m68k_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-maxq.c (maxq_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-mcore.c (mcore_coff_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-mips.c (mips_bfd_reloc_name_lookup): New function. + (_bfd_ecoff_bfd_reloc_name_lookup): Define. + * coff-ppc.c (ppc_coff_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-rs6000.c (coff_bfd_reloc_name_lookup): Define. + (_bfd_xcoff_reloc_name_lookup): New function. + (rs6000coff_vec, pmac_xcoff_vec): Init new field. + * coff-sh.c (coff_bfd_reloc_name_lookup): Define. + (sh_coff_reloc_name_lookup): New function. + * coff-sparc.c (coff_sparc_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-tic30.c (coff_bfd_reloc_name_lookup): Define. + (tic30_coff_reloc_name_lookup): New function. + * coff-tic4x.c (coff_bfd_reloc_name_lookup): Define. + (tic4x_coff_reloc_name_lookup): New function. + * coff-tic54x.c (coff_bfd_reloc_name_lookup): Define. + (tic54x_coff_reloc_name_lookup): New function. + * coff-x86_64.c (coff_bfd_reloc_name_lookup): Define. + (coff_amd64_reloc_name_lookup): New function. + * coff-z80.c (coff_z80_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-z8k.c (coff_z8k_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff64-rs6000.c (coff_bfd_reloc_name_lookup): Define. + (xcoff64_reloc_name_lookup): New function. + (rs6000coff64_vec, aix5coff64_vec): Init new field. + * coffcode.h (coff_bfd_reloc_name_lookup): Define. + * elf-hppa.h (elf_hppa_reloc_name_lookup): New function. + * elf-m10200.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf-m10300.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-arc.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-arm.c (elf32_arm_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-avr.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-bfin.c (bfin_bfd_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-cr16c.c (elf_cr16c_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-cris.c (cris_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-crx.c (elf_crx_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-d10v.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-d30v.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-dlx.c (elf32_dlx_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-fr30.c (fr30_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-frv.c (frv_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-gen.c (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-h8300.c (elf32_h8_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-hppa.c (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-i370.c (i370_elf_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-i386.c (elf_i386_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-i860.c (elf32_i860_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-i960.c (elf32_i960_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-ip2k.c (ip2k_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-iq2000.c (iq2000_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-m32c.c (m32c_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-m32r.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-m68hc11.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-m68hc12.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-m68k.c (reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-m88k.c (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-mcore.c (mcore_elf_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-mep.c (mep_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-mips.c (bfd_elf32_bfd_reloc_name_lookup): New function. + (mips_vxworks_bfd_reloc_name_lookup): Likewise. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-msp430.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-mt.c (mt_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-openrisc.c (openrisc_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-or32.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-pj.c (pj_elf_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-ppc.c (ppc_elf_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-s390.c (elf_s390_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-score.c (elf32_score_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-sh.c (sh_elf_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-sparc.c (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-spu.c (spu_elf_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-v850.c (v850_elf_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-vax.c (reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-xc16x.c (xc16x_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-xstormy16.c (xstormy16_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-xtensa.c (elf_xtensa_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf64-alpha.c (elf64_alpha_bfd_reloc_name_lookup): New function. + (bfd_elf64_bfd_reloc_name_lookup): Define. + * elf64-gen.c (bfd_elf64_bfd_reloc_name_lookup): Define. + * elf64-hppa.c (bfd_elf64_bfd_reloc_name_lookup): Define. + * elf64-mips.c (bfd_elf64_bfd_reloc_name_lookup): New function. + * elf64-mmix.c (bfd_elf64_bfd_reloc_name_lookup): New function. + * elf64-ppc.c (ppc64_elf_reloc_name_lookup): New function. + (bfd_elf64_bfd_reloc_name_lookup): Define. + * elf64-s390.c (elf_s390_reloc_name_lookup): New function. + (bfd_elf64_bfd_reloc_name_lookup): Define. + * elf64-sh64.c (sh_elf64_reloc_name_lookup): New function. + (bfd_elf64_bfd_reloc_name_lookup): Define. + * elf64-sparc.c (bfd_elf64_bfd_reloc_name_lookup): Define. + * elf64-x86-64.c (elf64_x86_64_reloc_name_lookup): New function. + (bfd_elf64_bfd_reloc_name_lookup): Define. + * elfn32-mips.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elfxx-ia64.c (elfNN_ia64_reloc_name_lookup): New function. + (bfd_elfNN_bfd_reloc_name_lookup): Define. + * elfxx-sparc.c (_bfd_sparc_elf_reloc_name_lookup): New function. + * elfxx-sparc.h (_bfd_sparc_elf_reloc_name_lookup): Declare. + * i386msdos.c (msdos_bfd_reloc_name_lookup): Define. + * i386os9k.c (aout_32_bfd_reloc_name_lookup): Define. + * ieee.c (ieee_bfd_reloc_name_lookup): Define. + * libaout.h (NAME (aout, reloc_name_lookup)): Declare. + * libbfd-in.h (_bfd_norelocs_bfd_reloc_name_lookup): Declare. + * mipsbsd.c (MY_bfd_reloc_name_lookup): Define. + (MY(reloc_type_lookup)): Rename from MY(reloc_howto_type_lookup). + (MY(reloc_name_lookup)): New function. + * nlm-target.h (nlm_bfd_reloc_name_lookup): Define. + * oasys.c (oasys_bfd_reloc_name_lookup): Define. + * pdp11.c (NAME (aout, reloc_name_lookup)): New function. + * pe-mips.c (coff_mips_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * reloc.c (bfd_reloc_name_lookup): New function. + * riscix.c (riscix_reloc_name_lookup): New function. + (MY_bfd_reloc_name_lookup): Define. + * som.c (som_bfd_reloc_name_lookup): New function. + * targets.c (struct bfd_target): Add reloc_name_lookup. + (BFD_JUMP_TABLE_RELOCS): Add NAME##_bfd_reloc_name_lookup. + * versados.c (versados_bfd_reloc_name_lookup): Define. + * vms.c (vms_bfd_reloc_name_lookup): New function. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2007-03-26 Thiemo Seufer + + PR ld/4208 + * elfxx-mips.c (mips_elf_next_relocation): Don't signal an error if no + matching relocation is found. + (_bfd_mips_elf_relocate_section): Only warn about missing relocations. + +2007-03-23 H.J. Lu + + * configure: Regenerated. + +2007-03-23 Joseph Myers + + * configure.in: Use ACX_PKGVERSION and ACX_BUGURL. + * configure: Regenerate. + +2007-03-23 Alan Modra + + * elf32-spu.c (spu_stub_name): Don't put input section in stub name. + Remove input_sec param. Adjust all calls. + (write_one_stub): Adjust stub symbol. + (needs_ovl_stub): New function, extracted from.. + (spu_elf_size_stubs): ..here. + (spu_elf_relocate_section): Use needs_ovl_stub. + +2007-03-22 Joseph Myers + + * Makefile.am (bfdver.h): Only set VERSION_PACKAGE in bfdver.texi + if nonempty. + * configure.in (REPORT_BUGS_TO): Do not use "URL:" prefix. + * Makefile.in, configure, doc/Makefile.in: Regenerate. + +2007-03-22 H.J. Lu + + PR ld/4210 + * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Use the virtual + address and virtual size of the last section for the image + size. + +2007-03-22 H.J. Lu + + PR ld/4007 + * elf.c (assign_file_positions_for_load_sections): Check if + all sections are in the segment. + +2007-03-20 H.J. Lu + + PR ld/4208 + * elfxx-mips.c (_bfd_mips_elf_relocate_section): Report missing + matching LO16 relocation for HI16 relocation. + +2007-03-20 Paul Brook + + * bfd-in.h (bfd_elf32_arm_set_target_relocs): Update prototype. + * bfd-in2.h: Regenerate. + * elf32-arm.c (elf32_arm_link_hash_table): Add pic_veneer. + (record_arm_to_thumb_glue): Use globals->pic_veneer. + (elf32_arm_create_thumb_stub): Ditto. + (bfd_elf32_arm_set_target_relocs): Set globals->pic_veneer. + +2007-03-18 Mark Shinwell + + * bfd-in.h (bfd_elf32_arm_set_target_relocs): Add "bfd *" + argument and extra last argument. + * bfd-in2.h: Regenerate. + * elf32-arm.c (elf32_arm_obj_tdata): Add no_enum_size_warning + member. + (bfd_elf32_arm_set_target_relocs): Add "bfd *" argument and + extra last argument. Set no_enum_size_warning appropriately. + (elf32_arm_merge_eabi_attributes): Improve enum sizes + diagnostic, suppressing it when no_enum_size_warning dictates. + +2007-03-20 Nick Clifton + + PR binutils/3535 + * elf.c (copy_private_bfd_data): Widen the scope of Solaris + specific conditions that need the program headers to be + rewritten. + +2007-03-19 H.J. Lu + + * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Store Magic, + MajorLinkerVersion, MinorLinkerVersion, SizeOfCode, + SizeOfInitializedData, SizeOfUninitializedData, + AddressOfEntryPoint, BaseOfCode and BaseOfData in internal + extra PE a.out header. + (IMAGE_NT_OPTIONAL_HDR_MAGIC): Defined as 0x10b if not defined. + (IMAGE_NT_OPTIONAL_HDR64_MAGIC): Defined as 0x20b if not + defined. + (IMAGE_NT_OPTIONAL_HDRROM_MAGIC): Defined as 0x107 if not + defined. + (_bfd_XX_print_private_bfd_data_common): Also print Magic, + MajorLinkerVersion, MinorLinkerVersion, SizeOfCode, + SizeOfInitializedData, SizeOfUninitializedData, + AddressOfEntryPoint, BaseOfCode and BaseOfData from internal + extra PE a.out header. + +2007-03-18 H.J. Lu + + * targets.c (_bfd_target_vector): Add bfd_efi_app_x86_64_vec + only if BFD64 is defined. + +2007-03-17 Alan Modra + + * elf32-spu.c (spu_elf_size_stubs): Always use an overlay stub + on setjmp calls. + +2007-03-15 H.J. Lu + + * doc/Makefile.in: Regenerated. + +2007-03-15 H.J. Lu + + * Makefile.am (bfdver.h): Substitute report_bugs_to. Also + create doc/bfdver.texi. + * Makefile.in: Regenerated. + + * configure.in (--with-bugurl): New option. + * configure: Regenerated. + + * version.h (REPORT_BUGS_TO): New. + +2007-03-13 H.J. Lu + + PR binutils/3826 + * elf-bfd.h (elf_backend_data): Add elf_osabi. + (_bfd_elf_set_osabi): New. + + * elf.c (_bfd_elf_set_osabi): New. + + * elf32-hppa.c (elf32_hppa_post_process_headers): Removed. + (elf_backend_post_process_headers): Defined with + _bfd_elf_set_osabi. + (ELF_OSABI): Properly defined for each target. + + * elf32-i370.c (i370_elf_post_process_headers): Removed. + (ELF_OSABI): Defined. + (elf_backend_post_process_headers): Defined with + _bfd_elf_set_osabi. + + * elf32-i386.c (ELF_OSABI): Defined to ELFOSABI_FREEBSD for + freebsd. + (elf_i386_post_process_headers): Set EI_OSABI with elf_osabi. + + * elf32-msp430.c (elf32_msp430_post_process_headers): Removed. + (ELF_OSABI): Defined. + (elf_backend_post_process_headers): Defined with + _bfd_elf_set_osabi. + + * elf64-alpha.c (ELF_OSABI): Defined to ELFOSABI_FREEBSD for + freebsd. + (elf64_alpha_fbsd_post_process_headers): Set EI_OSABI with + elf_osabi. + + * elf64-hppa.c (elf64_hppa_post_process_headers): Set EI_OSABI + with elf_osabi. + (ELF_OSABI): Properly defined for each target. + (elf_backend_post_process_headers): Defined with + _bfd_elf_set_osabi for Linux. + + * elf64-sparc.c (elf64_sparc_fbsd_post_process_headers): Removed. + (ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd. + (elf_backend_post_process_headers): Defined with + _bfd_elf_set_osabi. + + * elf64-x86-64.c (elf64_x86_64_fbsd_post_process_headers): Removed. + (ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd. + (elf_backend_post_process_headers): Defined with + _bfd_elf_set_osabi. + + * elfcode.h (elf_object_p): Match the ELFOSABI_NONE ELF target + with any ELF target of the compatible machine for which we do not + have a specific backend. + + * elfxx-ia64.c (elfNN_hpux_post_process_headers): Set EI_OSABI + with elf_osabi. + + * elfxx-target.h (ELF_OSABI): Default to ELFOSABI_NONE. + (elfNN_bed): Initialize elf_osabi with ELF_OSABI. + +2007-03-08 Alan Modra + + * elf32-v850.c (v850_elf_link_output_symbol_hook): Clean out + V850_OTHER_* bits. + +2007-03-08 Alan Modra + + * Makefile.am (BFD64_BACKENDS): Add efi-app-x86_64.lo. + (BFD64_BACKENDS_CFILES): Add efi-app-x86_64.c. + Run "make dep-am". + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2007-03-07 H.J. Lu + + * config.bfd (x86_64-*-freebsd*): Add bfd_efi_app_x86_64_vec. + (x86_64-*-kfreebsd*-gnu): Likewise. + (x86_64-*-netbsd*): Likewise. + (x86_64-*-openbsd*): Likewise. + (x86_64-*-linux-*): Likewise. + + * configure.in: Support bfd_efi_app_x86_64_vec. + * configure: Regenerated. + + * efi-app-x86_64.c: New file. + + * targets.c (bfd_efi_app_x86_64_vec): New. + (_bfd_target_vector): Add bfd_efi_app_x86_64_vec. + +2007-03-07 Kai Tietz + + * reloc.c (bfd_generic_get_relocated_section_contents): Remove + const for type reloc_howto_type. + +2007-03-07 Alan Modra + + PR 3958 + * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): No error on relocatable link. + (elf_discarded_section): Move.. + * bfd-in.h: ..to here. + * bfd-in2.h: Regenerate. + * elflink.c (elf_link_input_bfd): Don't zap relocs against symbols + from discarded sections before relocate_section has done its job. + * reloc.c (bfd_generic_get_relocated_section_contents): Handle + relocs against symbols from discarded sections. + * elf-hppa.h (elf_hppa_howto_table): Set size. Set dst_mask on + SECREL32. + (elf_hppa_relocate_section): Handle relocatable link after setting + sec, sym, h etc. for final link. Squash error messages for + relocatable link. Clear section contents for relocs against + symbols in discarded sections, and zero reloc. Remove existing + zero r_symndx code. + * elf-m10200.c (mn10200_elf_relocate_section): Likewise. + * elf-m10300.c (mn10300_elf_relocate_section): Likewise. + * elf32-arm.c (elf32_arm_relocate_section): Likewise. + * elf32-avr.c (elf32_avr_relocate_section): Likewise. + * elf32-bfin.c (bfinfdpic_relocate_section): Likewise. + (bfin_relocate_section): Likewise. + * elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-crx.c (elf32_crx_relocate_section): Likewise. + * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. + * elf32-fr30.c (fr30_elf_relocate_section): Likewise. + * elf32-frv.c (elf32_frv_relocate_section): Likewise. + * elf32-h8300.c (elf32_h8_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf32-i860.c (elf32_i860_relocate_section): Likewise. + * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. + * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise. + * elf32-m32c.c (m32c_elf_relocate_section): Likewise. + * elf32-m32r.c (m32r_elf_relocate_section): Likewise. + * elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-mep.c (mep_elf_relocate_section): Likewise. + * elf32-msp430.c (elf32_msp430_relocate_section): Likewise. + * elf32-mt.c (mt_elf_relocate_section): Likewise. + * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-score.c (_bfd_score_elf_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf32-spu.c (spu_elf_relocate_section): Likewise. + * elf32-v850.c (v850_elf_relocate_section): Likewise. + * elf32-vax.c (elf_vax_relocate_section): Likewise. + * elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. + * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section_r): Likewise. + (elf64_alpha_relocate_section): Likewise. + * elf64-mmix.c (mmix_elf_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sh64.c (sh_elf64_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. + * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise. + + * elf32-arm.c (elf32_arm_relocate_section): Always adjust section + symbols for relocatable link. Don't use always-zero st_value. + (elf_backend_rela_normal): Don't define. + * elf32-bfin.c (bfinfdpic_relocate_section): Use + RELOC_FOR_GLOBAL_SYMBOL. + * elf32-frv.c (elf32_frv_relocate_section): Likewise. + * elf32-d10v.c (elf32_d10v_relocate_section): Combine SEC_MERGE + section symbol adjustments with same for relocatable link. + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf32-m68hc1x.c (m68hc11_get_relocation_value): Move.. + (elf32_m68hc11_check_relocs): ..to here. + * elf32-score.c (score_elf_final_link_relocate): Remove zero + r_symndx code. + * elfxx-mips.c (mips_elf_calculate_relocation): Likewise. + +2007-03-07 Alan Modra + + PR 4144 + * elf.c (assign_file_positions_for_load_sections): Don't + adjust p_memsz for !SEC_LOAD section vma modulo page size. + Instead, use the same lma based adjustment for SEC_LOAD + sections. + +2007-03-01 Bob Wilson + + * elf32-xtensa.c (analyze_relocations): Zero src_count if not relaxing. + (find_relaxable_sections): Do not increment src_count for unknown + opcodes. Decode only once instead of calling is_l32r_relocation. + (compute_text_actions): Remove unused no_insn_move flag. Assert that + src_next matches src_count in relax_info. + +2007-03-01 Joseph Myers + + * Makefile.am (bfdver.h): Use "." not " " between version number + and date. + * Makefile.in: Regenerate. + * configure.in (PKGVERSION): Default to "(GNU Binutils) ". + * configure: Regenerate. + +2007-02-28 Nathan Sidwell + + * config.bfd (sh-*-uclinux, sh[12]-*-uclinux): New stanza. + +2007-02-27 Alan Modra + + * elf32-spu.h (struct _ovl_stream): Make "start" and "end" const. + * elf32-spu.c (ovl_mgr_pread): Add const to casts. + +2007-02-23 Carlos O'Donell + + * dwarf2.c (_bfd_dwarf2_find_nearest_line): Assume 32-bit + DWARF even with 64-bit addresses. + (_bfd_dwarf2_find_nearest_line): Likewise. + +2007-02-23 Nick Clifton + + PR binutils/3535 + * elf.c (copy_private_bfd_data): Always rewrite the program + headers when a Solaris interpreter segment is involved. + +2007-02-22 Paul Brook + + * elflink.c (gc_mark_hook_fn): Remove. + (_bfd_elf_gc_mark): Rename gc_mark_hook_fn to elf_gc_mark_hook_fn. + (bfd_elf_gc_sections): Ditto. Call gc_mark_extra_sections. + * elf-bfd.h (elf_gc_mark_hook_fn): Define. + (elf_backend_data): Add gc_mark_extra_sections. + * elfxx-target.h (elf_backend_gc_mark_extra_sections): Provide default + definition. + (elfNN_bed): Add elf_backend_gc_mark_extra_sections. + * elf32-arm.c (elf32_arm_gc_mark_extra_sections): New function. + (elf_backend_gc_mark_extra_sections): Define. + +2007-02-21 Nick Clifton + + * elf.c (_bfd_elf_map_sections_to_segments): If the + override_segment_assignment callback is defined then call it. + +2007-02-21 Alan Modra + + * elf32-spu.c (spu_elf_size_stubs): Correct order of warning args. + +2007-02-19 Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): Remove + translation marker from untranslatable strings. + +2007-02-19 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add default_execstack. + * elflink.c (bfd_elf_size_dynamic_sections): Heed default_execstack. + * elfxx-target.h (elf_backend_default_execstack): Define to 1. (elfNN_bed): Init new field. - * elf64-ppc.c (elf_backend_gc_mark_dynamic_ref): Define. - (ppc64_elf_gc_mark_dynamic_ref): New function. + * elf64-ppc.c (elf_backend_default_execstack): Define to 0. -2006-01-17 Alan Modra +2007-02-17 Mark Mitchell + Nathan Sidwell + Vladimir Prus - * elf64-ppc.c (ppc64_elf_gc_mark_hook): Don't hang forever in loop. + * configure.in (--with-pkgversion): New option. + * configure: Regenerate. + * Makefile.am (bfdver.h): Substitute for @bfd_version_package@. + * Makefile.in: Regenerate. + * version.h (BFD_VERSION_STRING): Define using + @bfd_version_package@. -2006-01-17 Nick Clifton +2007-02-16 Carlos O'Donell - PR binutils/2159 - * elf.c (elfcore_write_pstatus): Add ATTRIBUTE_UNUSED to unused - parameters. + * elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): + Print EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_XGOT + and EF_MIPS_UCODE. -2006-01-11 Nick Clifton +2007-02-15 Alan Modra - * elf32-arm.c (elf32_arm_output_symbol_hook): Install new entry - into the newly (re)allocated map array. + * libbfd-in.h (_bfd_norelocs_get_reloc_upper_bound): Don't define, + declare. + (_bfd_norelocs_canonicalize_reloc): Likewise. + * libbfd.h: Regenerate. + * libbfd.c (_bfd_norelocs_get_reloc_upper_bound): New function. + (_bfd_norelocs_canonicalize_reloc): Likewise. + * binary.c (binary_bfd_reloc_type_lookup): Don't define. + (binary_get_reloc_upper_bound, binary_canonicalize_reloc): Likewise. + (binary_vec): Use _bfd_norelocs in BFD_JUMP_TABLE_RELOCS. + * ihex.c: Similarly. + * mach-o-target.c: Similarly. + * mach-o.c: Similarly. + * mmo.c: Similarly. + * pef.c: Similarly. + * ppcboot.c: Similarly. + * srec.c: Similarly. + * xsym.c: Similarly. -2006-01-09 Alexis Wilke +2007-02-14 H.J. Lu - * peXXigen.c (tbl): Add comma after "HIGH3ADJ". + PR ld/3953 + * elflink.c (_bfd_elf_add_default_symbol): Check warning symbol + when adding default symbol. -2006-01-01 Jakub Jelinek +2007-02-13 Alan Modra - * elf64-ppc.c (ppc64_elf_action_discarded): Return 0 - for .toc1 section. + * elf64-ppc.c (create_linkage_sections): Use section ".branch_lt" + for branch lookup table. -For older changes see ChangeLog-2005 +2007-02-12 Alan Modra + + * elf64-ppc.c (create_linkage_sections): Don't create + .rela.rodata.brlt for --emit-relocs. + (ppc_build_one_stub): Create relocs for brlt --emit-relocs here. + (ppc_size_one_stub): Count them. Simplify test of stub type + when counting stub relocs. Set SEC_RELOC too. + (ppc64_elf_size_stubs): Clear reloc_count and SEC_RELOC. + (ppc64_elf_finish_dynamic_sections): Output brlt relocs. + +2007-02-12 Alan Modra + + * elflink.c (evaluate_complex_relocation_symbols): Ignore relocs + with a zero symbol index. + +2007-02-12 Alan Modra + + * elflink.c (bfd_elf_discard_info): Tidy setting of "eh". + +2007-02-05 Dave Brolley + Stan Cox + + PR ld/3972 + * elflink.c (elf_link_input_bfd): Always setup finfo->internal_syms. + +2007-02-05 Dave Brolley + Richard Sandiford + Stan Cox + Nick Clifton + DJ Delorie + Frank Ch. Eigler + Ben Elliston + Richard Henderson + + * Makefile.am (ALL_MACHINES): Add cpu-mep.lo. + (ALL_MACHINES_CFILES): Add CPU_MEP.c. + (BFD32_BACKENDS): Add elf32-mep.lo. + (BFD32_BACKENDS_CFILES): Add elf32-mep.c. + (cpu-mep.lo,elf32-mep.lo): New targets. + * archures.c (bfd_arch_mep): New enumerator. + (bfd_mach_mep, bfd_mach_mep_h1): New macros. + (bfd_mep_arch): New external variable. + (bfd_archures_list): Add bfd_mep_arch. + * config.bfd: Support mep-*-elf. + * configure.in: Support bfd_elf32_mep_vec and bfd_elf32_mep_little_vec. + * reloc.c (BFD_RELOC_MEP_*): New relocation numbers. + * targets.c (bfd_elf32_mep_vec,bfd_elf32_mep_little_vec): New extern + declarations. + (_bfd_target_vector): Add bfd_elf32_mep_vec and + bfd_elf32_mep_little_vec. + * mep-relocs.pl: New file. + * cpu-mep.c: New file. + * elf32-mep.c: New file. + * bfd-in2.h: Regenerate. + * po/POTFILES.in: Regenerate. + * libbfd.h: Regenerate. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2007-02-05 Dave Brolley + + * elflink.c (evaluate_complex_relocation_symbols): Check for + STT_SRELC for global symbols. + (perform_complex_relocations): Renamed to + perform_complex_relocation and now examines only one relocation. + (elf_link_input_bfd): Don't call perform_complex_relocations. + * elf-bfd.h (bfd_elf_perform_complex_relocation_: New prototype. + * elf32-mep.c (mep_elf_howto_table): Add R_RELC. + (OD,OS,OU): #undefs corrected to N, S and U repectively. + (mep_reloc_type_lookup): Handle BFD_RELOC_RELC. + (complex_reloc_installation_howto): Removed. + (mep_info_to_howto_rela): Remove special case for r_type==0xff. + (mep_elf_relocate_section): Call bfd_elf_perform_complex_relocation. + +2007-02-05 Dave Brolley + Richard Sandiford + DJ Delorie + Graydon Hoare + Nick Clifton + Jeff Holcomb + Frank Ch. Eigler + + * elf-bfd.h (bfd_elf_perform_complex_relocations): New prototype. + * elf.c (swap_out_syms): Handle BSF_RELC and BSF_SRELC. + * elfcode.h (elf_slurp_symbol_table): Handle STT_RELC and STT_SRELC. + * elflink.c (set_symbolValue): New static function. + (resolve_symbol): Likewise. + (resolve_section): Likewise. + (undefined_reference): Likewise. + (eval_symbol): Likewise. + (evaluate_complex_relocation_symbols): Likewise. + (put_value): Likewise. + (get_value): Likewise. + (decode_complex_addend): + (bfd_elf_perform_complex_relocation): New function. + (elf_link_input_bfd): Call evaluate_complex_relocation_symbols. + * reloc.c (BFD_RELOC_RELC): New relocation number. + * syms.c (BSF_RELC,BSF_SRELC): New macros. + +2007-02-05 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_make_sym_local): Delete. + (elf_xtensa_hide_symbol, elf_backend_hide_symbol): Delete. + (elf_xtensa_fix_refcounts, elf_xtensa_allocate_plt_size) + (elf_xtensa_allocate_got_size): Replace these with... + (elf_xtensa_allocate_dynrelocs): ...this new function. + (elf_xtensa_size_dynamic_sections): Use it. + +2007-02-05 Bob Wilson + + * elf32-xtensa.c (elf_howto_table) + : + Set src_mask to zero. + : Likewise. Also fix dst_mask. + : Set pcrel_offset to TRUE. + +2007-02-02 Bob Wilson + + * elf32-xtensa.c (xtensa_elf_dynamic_symbol_p): Renamed to... + (elf_xtensa_dynamic_symbol_p): ...this. + +2007-02-02 Bob Wilson + + * elf32-xtensa.c (plt_reloc_count): Move into link hash table. + (struct elf_xtensa_link_hash_table): New. + (elf_xtensa_hash_table): New. + (elf_xtensa_link_hash_table_create): New. + (elf_xtensa_check_relocs): Update plt_reloc_count references. + Update arguments to add_extra_plt_sections. + (elf_xtensa_create_dynamic_sections): Record new sections in the hash + table. Update for plt_reloc_count and add_extra_plt_sections. + (add_extra_plt_sections, elf_xtensa_create_plt_entry): Replace dynobj + argument with link info. Update calls to elf_xtensa_get_plt_section + and elf_xtensa_get_gotplt_section. + (elf_xtensa_allocate_local_got_size, elf_xtensa_size_dynamic_sections) + (elf_xtensa_relocate_section, elf_xtensa_finish_dynamic_sections) + (elf_xtensa_discard_info_for_section, shrink_dynamic_reloc_sections) + (relax_property_section): Get sections from the hash table and update + function calls. + (elf_xtensa_get_plt_section, elf_xtensa_get_gotplt_section): Replace + dynobj argument with link info. Get sections for first plt chunk from + the hash table. + (bfd_elf32_bfd_link_hash_table_create): Define. + +2007-02-02 Jakub Jelinek + + * elf-bfd.h (struct elf_obj_tdata): Change symbuf type to void *. + * elf.c (struct elf_symbuf_symbol, struct elf_symbuf_head): New types. + (struct elf_symbol): Change first member into union. + (elf_sort_elf_symbol): Compare pointers to internal syms rather than + internal syms. Only compare st_shndx fields. + (elf_create_symbuf): New function. + (bfd_elf_match_symbols_in_sections): Use it. If symbufs are available + for bfds, use a binary search, otherwise don't qsort symbols + unnecessarily only to select which symbols are for the particular + shndx. + +2007-02-01 Nick Clifton + + PR ld/3852 + * elf.c (_bfd_elf_link_hash_table_init): Initialize all the fields + in the elf_link_hash_table structure. + +2007-02-01 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add elf_backend_write_core_note. + * elfxx-target.h (elf_backend_write_core_note): Define and use. + * elf.c (elfcore_write_prpsinfo): Call the above. Add support for + 32-bit core note on 64-bit target. + (elfcore_write_prstatus): Likewise. + (elfcore_write_lwpstatus): Make note_name const. + (elfcore_write_prfpreg): Likewise. + (elfcore_write_pstatus): Add support for 32-bit core note on 64-bit + target. + * elf32-ppc.c (ppc_elf_write_core_note): New function. + (elf_backend_write_core_note): Define. + * elf64-ppc.c (ppc64_elf_write_core_note): New function. + (elf_backend_write_core_note): Define. + +2007-01-31 H.J. Lu + + * elf32-cris.c (INCLUDED_TARGET_FILE): Removed. + (elf32_bed): Defined for elf32-us-cris. + + * elf64-sh64.c (elf64_bed): Defined for Linux. + (INCLUDED_TARGET_FILE): Removed. + + * elfxx-target.h (elfNN_bed): Always define. Don't check + INCLUDED_TARGET_FILE. + +2007-01-31 DJ Delorie + + * elf-m10300.c (mn10300_elf_relocate_section): Clarify the warning + message for dangerous relocs, special case the common user error. + +2007-01-30 H.J. Lu + + * elf.c (copy_elf_program_header): Start from the first section + in a segment and stop when all sections in a segment are + accounted for. + +2007-01-29 Julian Brown + + * bfd-in2.h: Regenerate. + * bfd-in.h (bfd_arm_vfp11_fix): New enum. Specify how VFP11 + instruction scanning should be done. + (bfd_elf32_arm_init_maps, bfd_elf32_arm_vfp11_erratum_scan) + (bfd_elf32_arm_vfp11_fix_veneer_locations): Add prototypes. + (bfd_elf32_arm_set_target_relocs): Add vfp11 fix type argument to + prototype. + * elf-bfd.h (elf_backend_write_section): Add struct bfd_link_info + argument. + * elf32-arm.c (VFP11_ERRATUM_VENEER_SECTION_NAME) + (VFP11_ERRATUM_VENEER_ENTRY_NAME): Define macros. + (elf32_vfp11_erratum_type): New enum. + (elf32_vfp11_erratum_list): New struct. List of veneers or jumps to + veneers. + (_arm_elf_section_data): Add mapsize, erratumcount, erratumlist. + (elf32_arm_link_hash_table): Add vfp11_erratum_glue_size, + vfp11_fix and num_vfp11_fixes fields. + (elf32_arm_link_hash_table_create): Initialise vfp11_fix, + vfp11_erratum_glue_size, num_vfp11_fixes fields. + (VFP11_ERRATUM_VENEER_SIZE): Define. Size of an (ARM) veneer. + (bfd_elf32_arm_allocate_interworking_sections): Initialise erratum + glue section. + (elf32_arm_section_map_add): Add an code/data mapping symbol entry + to a section's map. + (record_vfp11_erratum_veneer): Create a single veneer, and its + associated symbols. + (bfd_elf32_arm_add_glue_sections_to_bfd): Add vfp11 erratum glue. + (bfd_elf32_arm_init_maps): Initialise mapping symbol table for input + BFDs. + (bfd_elf32_arm_set_vfp11_fix): Set the type of erratum workaround + required. + (bfd_arm_vfp11_pipe): Define VFP11 instruction pipes. + (bfd_arm_vfp11_regno): Recode a register number from a VFP11 insn. + (bfd_arm_vfp11_write_mask): Update write mask according to coded + register number. + (bfd_arm_vfp11_antidependency): New function. + (bfd_arm_vfp11_insn_decode): Decode a VFP11 insn. + (elf32_arm_compare_mapping): Declare. + (bfd_elf32_arm_vfp11_erratum_scan): Scan the sections of an input + BFD for potential erratum-triggering insns. Record results. + (bfd_elf32_arm_vfp11_fix_veneer_locations): Find out where veneers + and branches to veneers have been placed in virtual memory after + layout. + (bfd_elf32_arm_set_target_relocs): Set vfp11_fix field in global + hash table. + (elf32_arm_output_symbol_hook): Remove. + (elf32_arm_write_section): Output veneers, and branches to veneers. + Use maps from input sections, not output sections, for code + byte-swapping. + * elf32-ppc.c (ppc_elf_write_section): Add dummy link_info argument. + * elf32-score.c (_bfd_score_elf_write_section): Likewise. + * elfxx-mips.c (_bfd_mips_elf_write_section): Likewise. + * elfxx-mips.h (_bfd_mips_elf_write_section): Likewise. + +2007-01-27 H.J. Lu + + * elf64-hppa.c (elf64_bed): Defined for HPUX and Linux. + (INCLUDED_TARGET_FILE): Removed. + +2007-01-27 Mike Frysinger + + * elf32-hppa.c (elf32_bed): Define for hpux, linux and netbsd. + (INCLUDED_TARGET_FILE): Remove. + +2007-01-25 DJ Delorie + + * elf32-m32c.c (m32c_elf_howto_table): Don't complain about + R_M32C_16 or R_M32C_24 relocs. + +2007-01-25 Nick Clifton + + PR binutils/3874 + * elf32-avr.c (avr_link_hash_table): Check to make sure that the + hash table was created by elf32_avr_link_hash_table_create before + using it. + (elf32_avr_link_hash_newfunc): New function. Just pass the call + through to _bfd_elf_link_hash_newfunc. + (elf32_avr_link_hash_table_create): Use + elf32_avr_link_hash_newfunc instead of + _bfd_elf_link_hash_newfunc. + (elf32_avr_relocate_section): Check for the hash table pointer + being NULL. + (elf32_avr_relax_section, avr_build_one_stub, + elf32_avr_setup_params, get_local_syms, elf32_avr_size_stubs, + elf32_avr_build_stubs): Likewise. + +2007-01-16 H.J. Lu + + PR ld/3831 + * elf-bfd.h (bfd_elf_link_mark_dynamic_symbol): Add an + argument, Elf_Internal_Sym *. + + * elflink.c (bfd_elf_link_mark_dynamic_symbol): Mark a data + symbol dynamic if info->dynamic_data is TRUE. + (bfd_elf_record_link_assignment): Updated call to + bfd_elf_record_link_assignment. + (_bfd_elf_merge_symbol): Likewise. Always call + bfd_elf_link_mark_dynamic_symbol. + +2007-01-12 H.J. Lu + + * Makefile.am (BFD_LIBS): Removed. + * Makefile.in: Regenerated. + +2007-01-11 H.J. Lu + + PR binutils/3631 + * Makefile.am (OFILES): Add @bfd64_libs@. + (libbfd_la_SOURCES): Remove $(BFD64_LIBS_CFILES). + * Makefile.in: Regenerated. + + * configure.in (bfd_libs): Replaced by ... + (bfd64_libs): This. + * configure: Regenerated. + +2007-01-11 Nathan Sidwell + + * elf.c (assign_file_positions_for_load_sections): We can + require fewer phdrs than expected. + +2007-01-08 Kazu Hirata + + * archures.c (bfd_mach_cpu32_fido): Rename to bfd_mach_fido. + * bfd-in2.h: Regenerate. + * cpu-m68k.c (arch_info_struct): Use bfd_mach_fido instead of + bfd_mach_cpu32_fido. + (m68k_arch_features): Use fido_a instead of cpu32. + (bfd_m68k_compatible): Reject the combination of Fido and + ColdFire. Accept the combination of CPU32 and Fido with a + warning. + * elf32-m68k.c (elf32_m68k_object_p, + elf32_m68k_merge_private_bfd_data, + elf32_m68k_print_private_bfd_data): Treat Fido as an + architecture by itself. + +2007-01-08 Kai Tietz + + * config.bfd: Renamed target x86_64-*-mingw64 to x86_64-*-mingw*. + +2007-01-05 Jakub Jelinek + + * texhex.c (first_phase): Don't fall through into the default + case. + (pass_over): Replace abort () calls with return FALSE. Fix + buffer overflow. + +2007-01-04 Jie Zhang + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't set + SEC_EXCLUDE on zero size .eh_frame. + +For older changes see ChangeLog-2006 Local Variables: mode: change-log diff --git a/bfd/ChangeLog-0203 b/bfd/ChangeLog-0203 index f99029a87ae..1b1abb149da 100644 --- a/bfd/ChangeLog-0203 +++ b/bfd/ChangeLog-0203 @@ -858,7 +858,7 @@ Bernardo Innocenti * archures.c: Add MCF528x (MCFv4) support. - * bfd/cpu-m68k.c (arch_info_struct): Likewise. + * cpu-m68k.c (arch_info_struct): Likewise. * bfd-in2.h: Regenerate. 2003-10-20 Andrew Cagney @@ -1953,10 +1953,10 @@ 2003-07-12 Jeff Baker - * bfd/config.bfd (__QNXTARGET__): Define for Neutrino architectures. - * bfd/elf32-arm.h (ELF_MAXPAGESIZE): Set to 4k for Neutrino. - * bfd/elf32-sh.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino. - * bfd/elf32-ppc.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino. + * config.bfd (__QNXTARGET__): Define for Neutrino architectures. + * elf32-arm.h (ELF_MAXPAGESIZE): Set to 4k for Neutrino. + * elf32-sh.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino. + * elf32-ppc.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino. 2003-07-12 Jeff Muizelaar @@ -2196,13 +2196,13 @@ 2003-07-09 Richard Sandiford - * bfd/elfxx-mips.c (mips_elf_create_dynamic_relocation): Treat + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Treat forced-local symbols like other locals. Don't create relocations against STN_UNDEF in irix objects. 2003-07-09 Richard Sandiford - * bfd/elfxx-mips.c (mips_elf_create_dynamic_relocation): In SGI- + * elfxx-mips.c (mips_elf_create_dynamic_relocation): In SGI- compatible objects, add the values of defined external symbols to the addend. diff --git a/bfd/ChangeLog-2004 b/bfd/ChangeLog-2004 index fa2f1adf316..0c470961646 100644 --- a/bfd/ChangeLog-2004 +++ b/bfd/ChangeLog-2004 @@ -283,7 +283,7 @@ 2004-11-13 Paul Brook - * bfd/elf32-arm.c (elf32_arm_final_link_relocate): Resolve + * elf32-arm.c (elf32_arm_final_link_relocate): Resolve R_ARM_PREL31 relocations to PLT entries. (elf32_arm_relocate_section, elf32_arm_gc_sweep_hook): Ditto. (elf32_arm_check_relocs): Ditto. @@ -1248,7 +1248,7 @@ * bfd-in.h (bfd_elf32_arm_set_target_relocs): Add prototype. (bfd_elf32_arm_process_before_allocation): Update prototype. * bfd-in2.h: Regenerate. - * bfd/elf32-arm.h (elf32_arm_link_hash_table): Add target2_reloc. + * elf32-arm.h (elf32_arm_link_hash_table): Add target2_reloc. (elf32_arm_link_hash_table_create): Set it. (bfd_elf32_arm_process_before_allocation): Remove target1_is_rel. (bfd_elf32_arm_set_target_relocs): New function. @@ -3017,7 +3017,7 @@ 2004-06-07 Daniel Jacobowitz From: Albert Chin-A-Young - * bfd/elf-bfd.h (struct eh_cie_fde): Convert unsigned char bitfields + * elf-bfd.h (struct eh_cie_fde): Convert unsigned char bitfields to unsigned int. 2004-05-29 H.J. Lu diff --git a/bfd/ChangeLog-2005 b/bfd/ChangeLog-2005 index f2372786355..95746fc1c2d 100644 --- a/bfd/ChangeLog-2005 +++ b/bfd/ChangeLog-2005 @@ -1899,7 +1899,7 @@ 2005-06-27 Carlos O'Donell - * bfd/elf32-hppa.c (struct elf32_hppa_stub_hash_entry): + * elf32-hppa.c (struct elf32_hppa_stub_hash_entry): Use bh_root, and hh. (struct elf32_hppa_link_hash_entry): Use eh, and hsh_cache. (struct elf32_hppa_dyn_reloc_entry): Use hdh_next. @@ -1936,7 +1936,7 @@ 2005-06-21 Carlos O'Donell - * bfd/elf32-hppa.c (hppa_elf_hash_entry): Define. + * elf32-hppa.c (hppa_elf_hash_entry): Define. (hppa_stub_hash_entry): Define. (stub_hash_newfunc): Rename variables. (hppa_link_hash_newfunc): Likewise. @@ -2504,7 +2504,7 @@ 2005-05-20 Daniel Jacobowitz - * bfd/elf32-ppc.c (struct ppc_elf_link_hash_entry): Add new field + * elf32-ppc.c (struct ppc_elf_link_hash_entry): Add new field has_sda_refs. (ppc_elf_copy_indirect_symbol): Copy has_sda_refs. (ppc_elf_check_relocs): Set has_sda_refs. @@ -5202,7 +5202,7 @@ 2005-01-07 Jakub Jelinek - * bfd/elf.c (INCLUDE_SECTION_IN_SEGMENT): Don't put empty sections into + * elf.c (INCLUDE_SECTION_IN_SEGMENT): Don't put empty sections into PT_DYNAMIC segment, unless .dynamic. 2005-01-06 Paul Brook diff --git a/bfd/ChangeLog-2006 b/bfd/ChangeLog-2006 new file mode 100644 index 00000000000..82216d69382 --- /dev/null +++ b/bfd/ChangeLog-2006 @@ -0,0 +1,3601 @@ +2006-12-31 H.J. Lu + + * bfd.c (bfd_record_phdr): Call bfd_zalloc instead of bfd_alloc + to allocate elf_segment_map. + +2006-12-29 H.J. Lu + + * elflink.c (elf_link_add_object_symbols): Remember the symbol + size only if it is defined. + +2006-12-25 Kazu Hirata + + * archures.c (bfd_mach_cpu32_fido): New. + (bfd_mach_mcf_isa_a_nodiv, bfd_mach_mcf_isa_a, + bfd_mach_mcf_isa_a_mac, bfd_mach_mcf_isa_a_emac, + bfd_mach_mcf_isa_aplus, bfd_mach_mcf_isa_aplus_mac, + bfd_mach_mcf_isa_aplus_emac, bfd_mach_mcf_isa_b_nousp, + bfd_mach_mcf_isa_b_nousp_mac, bfd_mach_mcf_isa_b_nousp_emac, + bfd_mach_mcf_isa_b, bfd_mach_mcf_isa_b_mac, + bfd_mach_mcf_isa_b_emac, bfd_mach_mcf_isa_b_float, + bfd_mach_mcf_isa_b_float_mac, bfd_mach_mcf_isa_b_float_emac): + Increment the defined values. + * bfd-in2.h: Regenerate. + * cpu-m68k.c (arch_info_struct): Add en entry for + bfd_mach_cpu32_fido. + * elf32-m68k.c (elf32_m68k_object_p): Handle + EF_M68K_CPU32_FIDO_A. + (elf32_m68k_merge_private_bfd_data): Use EF_M68K_CPU32_MASK. + (elf32_m68k_print_private_bfd_data): Handle + EF_M68K_CPU32_FIDO_A. + +2006-12-25 Mei Ligang + + * elf32-score.c (score_elf_got_lo16_reloc): Change some variables + type from unsigned to signed. + (score_elf_final_link_relocate): Fix bugs of handling relocation + type R_SCORE_GOT15, R_SCORE_GOT_LO16, and R_SCORE_REL32. + (_bfd_score_elf_relocate_section): Handle R_SCORE_GOT_LO16 + specially. + +2006-12-23 Jakub Jelinek + + * elf-bfd.h (struct elf_backend_data): Add as_needed_cleanup hook. + * elfxx-target.h (elf_backend_as_needed_cleanup): Define. + (elfNN_bed): Add as_needed_cleanup hook. + * elflink.c (elf_link_add_object_symbols): Call it when reverting + hash table changes for unneeded --as-needed input. + * elf64-ppc64.c (elf_backend_as_needed_cleanup): Define. + (ppc64_elf_as_needed_cleanup): New function. + +2006-12-19 Kazu Hirata + + * elf32-m68k.c (elf32_m68k_object_p, + elf32_m68k_print_private_bfd_data): Use EF_M68K_ARCH_MASK to + extract architecture mask. + +2006-12-19 Nathan Sidwell + + * elf.c (assign_file_positions_for_load_sections): Adjust p_vaddr + by p_vaddr_offset. Copy alignment & use if it is valid. + (rewrite_elf_program_headers): Cope with leading padding in a + segment that does not contain file or program headers. + (copy_elf_program_header): Likewise. + +2006-12-15 Mark Kettenis + + * config.bfd: (sh*-*-openbsd*): Add target. + * configure.in (sh*-*-openbsd*): Set COREFILE to netbsd-core.lo. + * configure: Regenerate. + +2006-12-15 Alan Modra + + * opncls.c (bfd_openr_iovec): Add "stat" parameter. + (struct opncls): Add "stat" field. + (opncls_bstat): Call vec->stat. + * bfd-in2.h: Regenerate. + * elf32-spu.c (spu_elf_open_builtin_lib): Adjust. + +2006-12-14 Alan Modra + + * elf-bfd.h (struct bfd_elf_section_data): Clarify sec_group + and next_in_group usage. + +2006-12-14 Alan Modra + + PR 3704 + * bfdio.c (bfd_bread): Don't read past end of archive elements. + +2006-12-12 Daniel Jacobowitz + + * doc/Makefile.am (bfd_TEXINFOS): Set. + (bfd.info bfd.dvi bfd.html): Delete rule. + * doc/Makefile.in: Regenerated. + +2006-12-11 Daniel Jacobowitz + + * configure.in: Define GENINSRC_NEVER. + * doc/Makefile.am (bfd.info): Remove srcdir prefix. + (MAINTAINERCLEANFILES): Add info file. + (DISTCLEANFILES): Pretend to add info file. + * po/Make-in (.po.gmo): Put gmo files in objdir. + * configure, Makefile.in, doc/Makefile.in: Regenerated. + +2006-12-11 Eric Botcazou + + * elflink.c (bfd_elf_gc_sections): Also search for corresponding + sections with .gnu.linkonce.t. prefix. + +2006-12-07 Kazu Hirata + + * elf32-m68k.c: Update uses of EF_M68K_*. + +2006-12-07 H.J. Lu + + PR ld/3666 + * elflink.c (elf_link_add_object_symbols): Keep symbol + visibility for symbols from discarded section. + +2006-12-06 Alan Modra + + * elf64-alpha.c (elf64_alpha_merge_symbol_attribute): New function. + (elf_backend_merge_symbol_attribute): Define. + +2006-12-04 Jan Beulich + + * elflink.c (_bfd_elf_link_create_dynamic_sections): Don't create + .eh_frame_hdr section from here anymore. + (bfd_elf_size_dynamic_sections): Call _bfd_elf_maybe_strip_eh_frame_hdr + a little earlier. + +2006-12-01 H.J. Lu + + PR binutils/3609 + * elf.c (rewrite_elf_program_header): Preserve segment physical + address in the output segment if the first section in the + corresponding input segment is null. + +2006-12-01 Nick Clifton + + PR 3609 + * elf.c (rewrite_elf_program_header): Do not use the first_section + pointer if it is null. + +2006-11-29 Paul Brook + + * elf32-arm.c (elf32_arm_to_thumb_export_stub): Assert that output + section is present. + (allocate_dynrelocs): Only add export stub for symbols defined in + this object. + +2006-11-29 Paul Brook + + * elf32-arm.c (elf32_arm_to_thumb_export_stub): Assert that output + section is present. + (allocate_dynrelocs): Only add export stub for symbols defined in + this object. + +2006-11-29 Paul Brook + Julian Brown + + * elf32-arm.c (copy_eabi_attributes): Correct starting offset. + (elf32_arm_merge_eabi_attributes): Mark output as initialized. + Only set Tag_CPU_name and Tag_ABI_PCS_R9_use if input attribute + is present. + +2006-11-27 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_special_sections): Add .xtensa.info. + +2006-11-24 H.J. Lu + + * elf.c (IS_SECTION_IN_INPUT_SEGMENT): New. + (INCLUDE_SECTION_IN_SEGMENT): Use IS_SECTION_IN_INPUT_SEGMENT. + (rewrite_elf_program_header): Don't preserve segment physical + address in the output segment if the first section in the + corresponding input segment is removed. + +2006-11-22 Alan Modra + + * pef.c (bfd_pef_make_empty_symbol): Delete function. Define instead. + * xsym.c (bfd_sym_make_empty_symbol): Likewise. + * xsym.h (bfd_sym_make_empty_symbol): Delete. + +2006-11-21 Greg McGary + + * elf32-ppc.c (ppc_elf_relocate_section): Fixup D field + at proper offset in little-endian mode. + * elf64-ppc.c (ppc_elf_relocate_section): Likewise. + +2006-11-21 Jakub Jelinek + + * elf-eh-frame.c (struct cie): New type. + (cie_compare): Removed. + (cie_eq, cie_hash, cie_compute_hash): New functions. + (_bfd_elf_discard_section_eh_frame): Rewrite not to rely on FDEs + pointing only to last CIE and allow merging of any duplicate CIEs, + not just duplicate consecutive CIEs. + (_bfd_elf_discard_section_eh_frame_hdr): Delete cies hash table. + * elf-bfd.h (struct cie_header, struct cie): Removed. + (struct eh_frame_sec_info): Remove alloced field. + (struct eh_frame_hdr_info): Remove last_cie, last_cie_sec + and last_cie_inf fields. Add cies field. + +2006-11-20 Alan Modra + + * bfd-in.h (struct stat): Don't typedef. + * bfdio.c (bfd_get_size): Return a file_ptr. + * cisco-core.c (cisco_core_file_validate): Use bfd_size_type for nread. + * mmo.c (mmo_scan): Use file_ptr for curpos. + * trad-core.c (trad_unix_core): Don't cast statbuf.st_size to + unsigned long. + * bfd-in2.h: Regenerate. + +2006-11-20 Alan Modra + + PR 3532 + * bfd-in.h (struct bfd_hash_table): Reorganize. Add "frozen". + * hash.c (bfd_hash_table_init_n): Init frozen. + (bfd_hash_lookup): Don't grow if frozen. + (bfd_hash_traverse): Freeze hash table during traversal. + * bfd-in2.h: Regenerate. + +2006-11-18 Alan Modra + + * elflink.c (_bfd_elf_check_kept_section): Test for kept group + section. Save result of checks in kept_section. + (_bfd_elf_section_already_linked): Tidy. Correct comments. + Ignore all group member sections. Handle special matching of + single-member groups against linkonce sections via their group + section. When such a match is found, set kept_section to the + group member section rather than to the group. + +2006-11-14 Phil Lello + + * peXXigen.c: Updates for PE/COFF V8.0, and clarification + (dir_names): Added CLR Runtime Header to dir_names[]. + (_bfd_XX_print_private_bfd_data_common): Added EFI_ROM and XBOX + subsystem names + (_bfd_XXi_swap_aouthdr_in, _bfd_XXi_swap_aouthdr_out) + (pe_print_idata, pe_print_edata) + (_bfd_XX_bfd_copy_private_bfd_data_common) + (_bfd_XXi_final_link_postscript): Use #DEFINEs for index into + DataDirectory. + +2006-11-13 Daniel Jacobowitz + + * bfd-in.h (bfd_elf32_arm_process_before_allocation): Update + prototype. + (bfd_elf32_arm_set_byteswap_code): New prototype. + * bfd-in2.h: Regenerate. + * elf32-arm.c (bfd_elf32_arm_process_before_allocation): Don't take + byteswap_code as an argument. Revert 2006-11-01 change. + (bfd_elf32_arm_set_byteswap_code): New. + (elf32_arm_size_dynamic_sections): Call + bfd_elf32_arm_process_before_allocation. + +2006-11-10 Thiemo Seufer + + * config.bfd (mips*el-sde-elf*, mips*-sde-elf*): Drop ECOFF support + for SDE configs. + +2006-11-10 Nick Clifton + + * config.bfd: Move previously obsoleted targets to the REMOVED + list. + Add maxq-*-coff to the obsolete list. + +2006-11-10 Pedro Alves + + * pe-arm-wince.c (LOCAL_LABEL_PREFIX): Define as ".". + * pei-arm-wince.c (LOCAL_LABEL_PREFIX): Likewise. + * coff-arm.c (LOCAL_LABEL_PREFIX): Only define if not defined before. + +2006-11-07 Daniel Jacobowitz + + * elf32-arm.c (find_thumb_glue): Add ERROR_MESSAGE argument; set it + on error. + (find_arm_glue): Likewise. + (elf32_thumb_to_arm_stub, elf32_arm_create_thumb_stub) + (elf32_arm_to_thumb_stub, elf32_arm_final_link_relocate): Add + ERROR_MESSAGE argument and pass it through. + (elf32_arm_to_thumb_export_stub): Update. + (elf32_arm_relocate_section): Use ERROR_MESSAGE and reloc_dangerous. + +2006-11-07 Alan Modra + + * elf64-ppc.c (enum _ppc64_sec_type): New. + (struct _ppc64_elf_section_data): Move "t_symndx" into opd union, + and rename fields. Add sec_type and has_14bit_branch. + (struct ppc_link_hash_table): Remove has_14bit_branch. + (get_opd_info, get_tls_mask, ppc64_elf_edit_opd): Adjust. + (ppc64_elf_relocate_section): Likewise. + (ppc64_elf_check_relocs): Likewise. Set per-section has_14bit_branch. + (ppc64_elf_size_stubs): Don't set default group size here. + (group_sections): Instead do so here, and group sections using + their individual requirements. + +2006-11-07 Alan Modra + + * elf64-ppc.c (struct ppc64_elf_obj_tdata): Remove "has_dotsym" + and union. + (struct ppc_link_hash_entry): Add "next_dot_sym". + (struct ppc_link_hash_table): Add "dot_syms". + (link_hash_newfunc): Make list of syms starting with a dot. + (ppc_get_stub_entry, adjust_opd_syms): Adjust. + (ppc64_elf_add_symbol_hook): Don't set has_dotsym. + (struct add_symbol_adjust_data): Delete. + (add_symbol_adjust): Simplify params and return. + (ppc64_elf_check_directives): Just process the "dot_syms" lists, + not all syms. + +2006-11-02 Daniel Jacobowitz + + * libbfd-in.h (_bfd_clear_contents): New prototype. + * reloc.c (_bfd_clear_contents): New. + * libbfd.h: Regenerated. + + * elf32-arm.c (elf32_arm_final_link_relocate): Use + _bfd_clear_contents. + * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise. + + * elfxx-ia64.c (elfNN_ia64_relocate_section): Set value to + zero for discarded symbols. + * elfxx-mips.c (mips_elf_calculate_relocation): Likewise. + +2006-11-01 Thiemo Seufer + David Ung + + * elf-bfd.h (local_call_stubs): New member. + * elfxx-mips.c (FN_STUB_P, CALL_STUB_P, CALL_FP_STUB_P): New macros. + (mips_elf_calculate_relocation): Handle local mips16 call stubs. + (mips16_stub_section_p): Rename from mips_elf_stub_section_p, use + the new stub macros. + (_bfd_mips_elf_check_relocs): Handle call stubs for code which + mixes mips16 and mips32 functions. Use mips16_stub_section_p. Mark + used stubs with SEC_KEEP. Use the new stub macros. + +2006-11-01 Alan Modra + + * elf32-arm.c (bfd_elf32_arm_process_before_allocation): Correct + check for PLT usage. + +2006-11-01 Daniel Jacobowitz + + * elfxx-mips.c (mips_elf_merge_gots): Always use maxcnt. + +2006-10-31 Alan Modra + + * elf.c (elfcore_write_note): Pad note descriptor to 4-byte + boundary. Tidy. Comment. + +2006-10-30 H.J. Lu + + PR ld/3111 + * elf-bfd.h (elf_obj_tdata): Add symbuf. + (_bfd_elf_section_already_linked): Add struct bfd_link_info *. + (_bfd_elf_check_kept_section): Likewise. + (bfd_elf_match_symbols_in_sections): Likewise. + + * elf.c (assign_section_numbers): Updated to add + struct bfd_link_info *. + (bfd_elf_match_symbols_in_sections): Updated. Cache symbol + buffer if info->reduce_memory_overheads is false. + + * elflink.c (match_group_member): Updated to add + struct bfd_link_info *. + (_bfd_elf_check_kept_section): Likewise. + (elf_link_input_bfd): Likewise. + (_bfd_elf_section_already_linked): Likewise. + (bfd_elf_final_link): Free symbol buffer if + info->reduce_memory_overheads is false. + + * libbfd-in.h (_bfd_nolink_section_already_linked): Add + struct bfd_link_info *. + (_bfd_generic_section_already_linked): Likewise. + * libbfd.h: Regenerated. + + * linker.c (bfd_section_already_linked): Add + struct bfd_link_info *. + (_bfd_generic_section_already_linked): Likewise. + * targets.c (bfd_target): Add struct bfd_link_info * to + _section_already_linked. + * bfd-in2.h: Regenerated. + +2006-10-30 Alan Modra + + * bfd.c (bfd_error_type): Add bfd_error_on_input. + (input_bfd, input_error): New static vars. + (bfd_set_error): Handle bfd_error_on_input. + (bfd_errmsg): Likewise. + (bfd_perror): Simplify. + * archive.c (_bfd_write_archive_contents): Report errors on input. + * bfd-in2.h: Regenerate. + +2006-10-30 Alan Modra + + * elf.c (elfcore_write_note): Pad to 4-byte boundary. + +2006-10-28 Richard Sandiford + + * elf32-mips.c (elf_mips_howto_table_rel): Add R_MIPS_GLOB_DAT. + * elfn32-mips.c (elf_mips_howto_table_rel): Likewise. + (elf_mips_howto_table_rela): Likewise. + * elf64-mips.c (mips_elf64_howto_table_rel): Likewise. + (mips_elf64_howto_table_rela): Likewise. + +2006-10-26 H.J. Lu + + * elf.c (_bfd_elf_init_private_section_data): Assert output + section ELF type instead of check if it is SHT_NULL. Copy + OS/PROC specific flags from input section to output section. + +2006-10-27 Alan Modra + + * section.c (SEC_KEEP): Update comment. + * bfd-in2.h: Regenerate. + * elflink.c (bfd_elf_gc_sections): Ignore SEC_EXCLUDE sections. + * merge.c (_bfd_merge_sections): Set SEC_KEEP on excluded sections. + * stabs.c (_bfd_discard_section_stabs): Likewise. + (_bfd_link_section_stabs): Likewise. Simplify abs_section check. + +2006-10-26 Ben Elliston + + * reloc.c (_bfd_relocate_contents): Remove explicit case 0. + + * elf.c (bfd_section_from_shdr): Remove extraneous breaks. + * targets.c (find_target): Remove extraneous break. + +2006-10-26 Ben Elliston + + * coff-maxq.c (coff_maxq20_reloc): Remove unused variable `howto'. + (struct maxq_reloc_map): Unused; remove. + (maxq_reloc_map): Likewise. + (maxq_reloc_type_lookup): Remove loop over maxq_reloc_map. + +2006-10-26 Ben Elliston + + * elf.c (bfd_elf_set_dyn_lib_class): Change second argument type + from int to enum dynamic_lib_link_class lib_class. + * bfd-in.h (bfd_elf_set_dyn_lib_class): Likewise. + * bfd-in2.h: Regenerate. + +2006-10-25 Alan Modra + Trevor Smigiel + Yukishige Shibata + Nobuhisa Fujinami + Takeaki Fukuoka + + * cpu-spu.c: New file. + * elf32-spu.c: New file. + * elf32-spu.h: New file. + * archures.c: Add SPU support. + * config.bfd: Likewise. + * configure.in: Likewise. + * reloc.c: Likewise. + * targets.c: Likewise. + * Makefile.am: Likewise. Run "make dep-am". + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * Makefile.in: Regenerate. + * configure: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2006-10-23 Alan Modra + + * elf64-ppc.c (ppc64_elf_edit_opd): Clarify comment. + +2006-10-23 Alan Modra + + * elf32-score.c: Formatting. + (elf_backend_omit_section_dynsym): Define. + (score_elf_create_dynamic_relocation): Remove code copied from mips. + Don't use section syms in dynamic relocs. Remove unused param. + (score_elf_final_link_relocate): Remove unused param. + +2006-10-23 Alan Modra + + * linker.c (fix_syms): Choose best of previous and next + section based on section flags and vma. + +2006-10-21 Kaz Kojima + + * elf32-sh64.c (sh64_elf_merge_symbol_attribute): Do merging + only when the non visibility part of st_other is non-zero. + * elf64-sh64.c (sh64_elf64_merge_symbol_attribute): Likewise. + +2006-10-20 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Don't extend + PT_DYNAMIC on GNU/Linux targets. + +2006-10-20 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Make the + size of .rel.dyn reflect the value of DT_RELSZ. + +2006-10-20 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_additional_program_headers): Allocate + a PT_NULL header for dynamic objects. + (_bfd_mips_elf_modify_segment_map): Add it. + +2006-10-19 Mei Ligang + + * elf32-score.c (score_elf_rel_dyn_section): Replace + bfd_make_section with bfd_make_section_with_flags. + (_bfd_score_elf_create_dynamic_sections): Ditto. + (score_elf_create_got_section): Ditto. + (score_elf_final_link_relocate): Delete referrence to + EF_SCORE_HASENTRY. + +2006-10-19 Richard Sandiford + + * elfxx-mips.c (sort_dynamic_relocs): Sort relocations against the + same symbol by increasing r_offset. + (sort_dynamic_relocs_64): Likewise. Fix comparisons between very + large and very small symbol indexes. + +2006-10-19 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Add DT_DEBUG + and DT_MIPS_RLD_MAP tags for position-independent executables. + Do not add DT_DEBUG to shared libraries for any MIPS target. + +2006-10-18 H.J. Lu + + PR ld/3290 + * elflink.c (elf_link_add_object_symbols): Hide definitions in + debug sections. + +2006-10-19 Alan Modra + + * elf32-arm.c (bfd_elf32_arm_allocate_interworking_sect): Check, + don't set, glue section size. + (record_arm_to_thumb_glue): Set glue section size here. + (record_thumb_to_arm_glue): Likewise. + (bfd_elf32_arm_add_glue_sections_to_bfd): Formatting. + (bfd_elf32_arm_process_before_allocation): Ignore exluded sections. + +2006-10-18 Roy Marples + + * elf64-sparc.c: Add FreeBSD support. + (elf64_sparc_fbsd_post_process_headers): New function. + * targets.c (_bfd_target_vector): Add bfd_elf64_sparc_freebsd_vec. + * config.bfd (sparc64-*-freebsd*): Set targ_defvec to bfd_elf64_sparc_freebsd_vec. + * configure.in: Add entry for bfd_elf64_sparc_freebsd_vec. + * configure: Regenerate. + +2006-10-17 Mark Shinwell + + * elf32-arm.c (elf32_arm_final_link_relocate): Add support for + R_ARM_MOVW_BREL_NC, R_ARM_MOVW_BREL, R_ARM_MOVT_BREL, + R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVW_BREL and + R_ARM_THM_MOVT_BREL relocations. + +2006-10-17 Mark Shinwell + + * elf32-arm.c (elf32_arm_howto_table_1): Change offset for + R_THM_CALL to 25 and remove FIXME comment. + (using_thumb2): New function. + (elf32_arm_final_link_relocate): Cope with Thumb-2 BL encoding. + +2006-10-17 Mark Shinwell + + * elf32-arm.c (elf32_arm_final_link_relocate): Add cases + for R_ARM_ABS32_NOI and R_ARM_REL32_NOI. + (elf32_arm_gc_sweep_hook): Likewise. + (elf32_arm_check_relocs): Likewise. + (allocate_dynrelocs): Likewise. + +2006-10-17 Alan Modra + + * elf-bfd.h (struct elf_link_hash_table): Reorder. Add + text_index_section and data_index_section. + (struct elf_backend_data): Add elf_backend_init_index_section. + (_bfd_elf_init_1_index_section): Declare. + (_bfd_elf_init_2_index_sections): Declare. + * elfxx-target.h (elf_backend_init_index_section): Define. + (elfNN_bed): Init new field. + * elflink.c (_bfd_elf_link_omit_section_dynsym): Keep first tls + section and text_index_section plus data_index_section. + (_bfd_elf_link_renumber_dynsyms): Clear dynindx on omitted sections. + (_bfd_elf_init_1_index_section): New function. + (_bfd_elf_init_2_index_sections): New function. + (bfd_elf_size_dynsym_hash_dynstr): Call elf_backend_init_index_section. + (elf_link_input_bfd): When emitting relocs, use text_index_section + and data_index_section for removed sections. + * elf-m10300.c (elf_backend_omit_section_dynsym): Define. + * elf32-i386.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-xstormy16.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-mmix.c: Likewise. + * elf64-sh64.c: Likewise. + * elfxx-ia64.c: Likewise. + * elf32-arm.c (elf32_arm_final_link_relocate): Use text_index_section + and data_index_section sym for relocs against sections with no dynamic + section sym. + (elf_backend_init_index_section): Define. + * elf32-cris.c: Similarly. + * elf32-hppa.c: Similarly. + * elf32-i370.c: Similarly. + * elf32-m68k.c: Similarly. + * elf32-mips.c: Similarly. + * elf32-ppc.c: Similarly. + * elf32-s390.c: Similarly. + * elf32-sparc.c: Similarly. + * elf32-vax.c: Similarly. + * elf64-mips.c: Similarly. + * elf64-ppc.c: Similarly. + * elf64-s390.c: Similarly. + * elf64-sparc.c: Similarly. + * elf64-x86-64.c: Similarly. + * elfn32-mips.c: Similarly. + * elfxx-mips.c: Similarly. + * elfxx-sparc.c: Similarly. + * linker.c (fix_syms): Base symbols in removed sections on + previous section in preference to using absolute section. + +2006-10-16 Andreas Schwab + + * elfxx-ia64.c (addend_compare): Properly compute return value. + +2006-10-15 H.J. Lu + + PR ld/3314 + * elf.c (assign_file_positions_for_non_load_sections): Don't + page align empty SHF_ALLOC sections. + +2006-10-13 Jakub Jelinek + + * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_sections): Set + .plt sh_entsize to 0 if plt header size isn't multiple of + plt entry size or for 32-bit which adds a nop insn at the + end of the .plt section. + +2006-10-12 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_action_discarded): New. + (elf_backend_action_discarded): Define. + +2006-10-11 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_relocate_section): Return after + unresolvable relocation error. + (elf_xtensa_finish_dynamic_symbol): Set value of undefined, weak + symbols to zero. + +2006-10-10 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Add DT_DEBUG + for PIE executables. + +2006-10-03 Jakub Jelinek + + * elf-bfd.h (struct eh_cie_fde): Add set_loc pointer. + * elf-eh-frame.c (skip_cfa_op): Fix handling of DW_CFA_advance_loc. + Handle DW_CFA_{remember,restore}_state, DW_CFA_GNU_window_save, + DW_CFA_val_{offset{,_sf},expression}. + (skip_non_nops): Record number of DW_CFA_set_loc ops. + (_bfd_elf_discard_section_eh_frame): Require skip_non_nops recognizes + all ops. If there are any DW_CFA_set_loc ops and they are pcrel + or going to be pcrel, compute set_loc array. + (_bfd_elf_eh_frame_section_offset): If make_relative, kill relocations + against DW_CFA_set_loc operands. + (_bfd_elf_write_section_eh_frame): Handle DW_CFA_set_loc adjusting. + +2006-10-02 Daniel Jacobowitz + + * elflink.c (_bfd_elf_merge_symbol): Discard references to TLS + symbols from the --just-syms file. + +2006-10-01 Alan Modra + + * elf64-ppc.c (ppc64_elf_build_stubs): Test glink size for + existence of PLT. + +2006-09-29 H.J. Lu + + PR ld/3283 + * elf64-x86-64.c (elf64_x86_64_relocate_section): Don't ignore + relocation overflow on branches to undefweaks. + +2006-09-29 Alan Modra + + * po/BLD-POTFILES.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2006-09-29 Danny Smith + + PR 3276 + * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte + alignment for .data$, .rdata$ and .text$ sections so that sse + and sse2 code will work for linkonce sections too. + * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise. + +2006-09-28 Alan Modra + + * elflink.c (_bfd_elf_gc_mark_hook): New function. + * elf-bfd.h (_bfd_elf_gc_mark_hook): Declare. + * elfxx-target.h (elf_backend_gc_mark_hook): Default to above. + * elf-m10300.c (mn10300_elf_gc_mark_hook): Use _bfd_elf_gc_mark_hook. + * elf32-arm.c (elf32_arm_gc_mark_hook): Likewise. + * elf32-cris.c (cris_elf_gc_mark_hook): Likewise. + * elf32-hppa.c (elf32_hppa_gc_mark_hook): Likewise. + * elf32-i386.c (elf_i386_gc_mark_hook): Likewise. + * elf32-m32r.c (m32r_elf_gc_mark_hook): Likewise. + * elf32-m68k.c (elf_m68k_gc_mark_hook): Likewise. + * elf32-mcore.c (mcore_elf_gc_mark_hook): Likewise. + * elf32-ppc.c (ppc_elf_gc_mark_hook): Likewise. + * elf32-s390.c (elf_s390_gc_mark_hook): Likewise. + * elf32-score.c (_bfd_score_elf_gc_mark_hook): Likewise. + * elf32-sh.c (sh_elf_gc_mark_hook): Likewise. + * elf32-vax.c (elf_vax_gc_mark_hook): Likewise. + * elf32-xtensa.c (elf_xtensa_gc_mark_hook): Likewise. + * elf64-mmix.c (mmix_elf_gc_mark_hook): Likewise. + * elf64-s390.c (elf_s390_gc_mark_hook): Likewise. + * elf64-x86-64.c (elf64_x86_64_gc_mark_hook): Likewise. + * elfxx-mips.c (_bfd_mips_elf_gc_mark_hook): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_gc_mark_hook): Likewise. + * elf32-bfin.c (bfin_gc_mark_hook): Likewise. + (bfinfdpic_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define for elf32-bfinfdpic. + * elf32-d10v.c (elf32_d10v_gc_mark_hook): Use _bfd_elf_gc_mark_hook. + (elf32_d10v_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-fr30.c (fr30_elf_gc_mark_hook): Use _bfd_elf_gc_mark_hook. + (fr30_elf_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-frv.c (elf32_frv_gc_mark_hook): Use _bfd_elf_gc_mark_hook. + (elf32_frv_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-iq2000.c (iq2000_elf_gc_mark_hook): Use _bfd_elf_gc_mark_hook. + (iq2000_elf_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Use + _bfd_elf_gc_mark_hook. + (openrisc_elf_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-v850.c (v850_elf_gc_mark_hook): Use _bfd_elf_gc_mark_hook. + (v850_elf_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-xstormy16.c (xstormy16_elf_gc_mark_hook): Use + _bfd_elf_gc_mark_hook. + (xstormy16_elf_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf64-sh64.c (sh_elf64_gc_mark_hook): Use _bfd_elf_gc_mark_hook. + (sh_elf64_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-avr.c (elf32_avr_gc_mark_hook): Delete. + (elf32_avr_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + * elf32-cr16c.c (elf32_cr16c_gc_mark_hook): Delete. + (elf32_cr16c_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + * elf32-crx.c (elf32_crx_gc_mark_hook): Delete. + (elf32_crx_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + * elf32-h8300.c (elf32_h8_gc_mark_hook): Delete. + (elf32_h8_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + * elf32-ip2k.c (ip2k_elf_gc_mark_hook): Delete. + (ip2k_elf_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + * elf32-m32c.c (m32c_elf_gc_mark_hook, m32c_elf_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + * elf32-m68hc11.c (elf_backend_gc_mark_hook): Don't define. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-m68hc12.c (elf_backend_gc_mark_hook): Don't define. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-m68hc1x.c (elf32_m68hc11_gc_mark_hook): Delete. + (elf32_m68hc11_gc_sweep_hook): Delete. + * elf32-m68hc1x.h (elf32_m68hc11_gc_mark_hook): Delete. + (elf32_m68hc11_gc_sweep_hook): Delete. + * elf32-msp430.c (elf32_msp430_gc_mark_hook): Delete. + (elf32_msp430_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + * elf32-mt.c (mt_elf_gc_mark_hook, mt_elf_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + +2006-09-25 Pedro Alves + + * bfd-in.h (CONST_STRNCPY) : Delete. + (LITSTRCPY) : New. + (LITMEMCPY) : New. + * bfd-in2.h : Regenerate. + * elflink.c (bfd_elf_gc_sections) : Use LITMEMCPY. Don't manually + calculate string lengths. + * nlmcode.h (nlm_swap_auxiliary_headers_in) : Use LITMEMCPY. + +2006-09-26 H.J. Lu + + PR ld/3223 + PR ld/3267 + * elf.c (assign_file_positions_for_non_load_sections): Don't + warn zero size allocated sections. + +2006-09-27 Alan Modra + + * elf32-score.c (_bfd_score_elf_relocate_section): Move assignment + to "name" so that compiler realizes it is never uninitialized. + Use bfd_elf_sym_name. + +2006-09-26 H.J. Lu + + PR binutils/3262 + * elf.c (rewrite_elf_program_header): Use bfd_zalloc instead of + bfd_alloc to allocate segment map. + (copy_elf_program_header): Likewise. + +2006-09-26 Mark Shinwell + Joseph Myers + Ian Lance Taylor + Ben Elliston + + * archures.c: Add definition for bfd_mach_arm_iWMMXt2. + * cpu-arm.c (processors): Add bfd_mach_arm_iWMMXt2. + (arch_info_struct, bfd_arm_update_notes): Likewise. + (architectures): Likewise. + (bfd_arm_merge_machines): Check for iWMMXt2. + * bfd-in2.h: Rebuild. + +2006-09-24 H.J. Lu + + * configure: Regenerated. + +2006-09-22 Alan Modra + + * elfcode.h (elf_swap_symbol_in): Return bfd_boolean. Don't abort + on error. + * elf-bfd.h (elf_size_info ): Adjust decl. + (bfd_elf32_swap_symbol_in, bfd_elf64_swap_symbol_in): Likewise. + * elf.c (bfd_elf_get_elf_syms): Test return of swap_symbol_in, + and report error. + * elf32-arm.c (elf32_arm_swap_symbol_in): Return bfd_boolean. + +2006-09-20 Martin Schwidefsky + + * elf32-s390.c (elf_s390_relocate_section): Remove check for code + section in LD to LE linker relaxation for R_390_TLS_LDO32. + * elf64-s390.c (elf_s390_relocate_section): Likewise for + R_390_TLS_LDO64. + +2006-09-20 Kai Tietz + + * configure.in: Added new target-vectors x86_64coff_vec, + x86_64pe_vec, and x86_64pei_vec. + * configure: Regenerate. + * config.bfd: Adjusted x86_64 target architecture detection. + * bfd.c: Add for new target "coff-x86-64" + (bfd_get_sign_extend): Add target vector idents for pe-x86-64. and pei-x86-64. + * coff-x86_64.c: Add new file for x86_64 (AMD64) coff support. + * libpei.h: Adjustments for COFF_WITH_pex64. + * coffcode.h: Add for new target machine, architecture, signature, and internal + signature handler. + * Makefile.am: Add new files to target-all and define make-rule for pex64igen.c + * Makefile.in: Regenerate. + * pe-x86_64.c: Add for new target "pe-x86-64". + * pei-x86_64.c: Add for new target "pei-x86-64". + * peicode.h: Adjusts for new targets. + (coff_swap_filehdr_out): Set for this target to + _bfd_pex64_only_swap_filehdr_out. + (SIZEOF_IDATA4): Define it as 8 byte size for this target. + (SIZEOF_IDATA5): Define it as 8 byte size for this target. + (jump_table jtab): Add for AMD64MAGIC. + (pe_ILF_build_a_bfd): Adjusts for new size of SIZEOF_IDATA4 and SIZE_IDATA5. + (pe_ILF_object_p): Add coff image-file signature to internal + signature translation. + * peXXigen.c: Adjust proper include of target coff-header and + introduced target specific code + (COFF_WITH_pex64): New macro for this target. + (pe_print_idata): New dumping method for import section of PE+ files. + * targets.c: Add new target vectors declarations for x86_64 coff targets. + * coffcode.h: Support code to support the x86_64 PE magic number. + * coff-x86_64.c: New file. + +2006-09-17 Hans-Peter Nilsson + + * elf.c (special_sections_s): Revert last STRING_COMMA_LEN change + for .stabstr entry, explain why. + +2006-09-17 Anton Blanchard + Alan Modra + + * dwarf2.c (concat_filename): Apply DW_AT_comp_dir if dir table + entry isn't absolute. + +2006-09-17 Mei Ligang + + * cpu-score.c: New file. + * elf32-score.c: New file. + * config.bfd: Add Score target. + * Makefile.am: Add Score files. + * Makefile.in: Regenerate. + * archures.c: Add Score architecture. + * reloc.c: Add Score relocs. + * targets.c: Add Score target vectors. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * configure.in: Add Score target. + * configure: Regenerate. + +2006-09-16 Nick Clifton + Pedro Alves + + * bfd-in.h (STRING_COMMA_LEN): New macro. Takes one constant + string as its argument and emits the string followed by a comma + and then the length of the string. + (CONST_STRNEQ): New macro. Checks to see if a variable string + has a constant string as its initial characters. + (CONST_STRNCPY): New macro. Copies a constant string to the start + of a variable string. + * bfd-in2.h: Regenerate. + * archive.c: Make use of the new macros. + * archive64.c: Likewise. + * bfd.c: Likewise. + * coff-ppc.c: Likewise. + * coff-stgo32.c: Likewise. + * coffcode.h: Likewise. + * cofflink.c: Likewise. + * cpu-i960.c: Likewise. + * dwarf2.c: Likewise. + * ecoff.c: Likewise. + * elf-m10300.c: Likewise. + * elf.c: Likewise. + * elf32-arm.c: Likewise. + * elf32-bfin.c: Likewise. + * elf32-cris.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-iq2000.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68hc11.c: Likewise. + * elf32-m68hc12.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh-symbian.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sh64.c: Likewise. + * elf32-v850.c: Likewise. + * elf32-vax.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-mmix.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sh64.c: Likewise. + * elf64-x86-64.c: Likewise. + * elflink.c: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + * elfxx-sparc.c: Likewise. + * hpux-core.c: Likewise. + * i386linux.c: Likewise. + * ieee.c: Likewise. + * libpei.h: Likewise. + * linker.c: Likewise. + * m68klinux.c: Likewise. + * mmo.c: Likewise. + * nlmcode.h: Likewise. + * osf-core.c: Likewise. + * pef.c: Likewise. + * som.c: Likewise. + * sparclinux.c: Likewise. + * vms-hdr.c: Likewise. + +2006-09-14 Alan Modra + + PR 3181 + * elf.c (_bfd_elf_copy_private_header_data): Fix group members + that have had their SHT_GROUP section removed. + +2006-09-12 H.J. Lu + + PR ld/3197 + * elflink.c (elf_link_output_extsym): Compute bucket only if + needed. + +2006-09-10 H.J. Lu + + PR binutils/3186 + * elf.c (_bfd_elf_make_section_from_shdr): Correct length of + "gnu.linkonce.wi.". + +2006-09-08 Vladimir Prus + + * elf32-arm.c (elf32_arm_swap_symbol_out): Remove + unconditional setting of low bit for Thumb symbol + mistakenly left behind after check for external + symbols was added. Fix comment typo. + +2006-09-07 H.J. Lu + + * elf-bfd.h (elf_link_hash_entry): Add a dynamic field. + (bfd_elf_link_mark_dynamic_symbol): New. + (SYMBOLIC_BIND): New. + + * elf32-i386.c (elf_i386_check_relocs): Replace info->symbolic + with SYMBOLIC_BIND (info, h). + (elf_i386_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise. + (elf64_x86_64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_check_relocs): Likewise. + + * elflink.c (bfd_elf_link_mark_dynamic_symbol): New. + (bfd_elf_record_link_assignment): Call + bfd_elf_link_mark_dynamic_symbol on new entry. + (_bfd_elf_merge_symbol): Likewise. + (_bfd_elf_export_symbol): Return if the symbol isn't exported. + (_bfd_elf_fix_symbol_flags): Replace info->symbolic with + SYMBOLIC_BIND (info, h). + (_bfd_elf_dynamic_symbol_p): Likewise. + (_bfd_elf_symbol_refs_local_p): Likewise. + (bfd_elf_size_dynamic_sections): Updated. + +2006-09-05 Bibo Mao + + PR binutils/3171 + * coffcode.h (coff_write_object_contents): Set the optional + header magic number to PE32PMAGIC instead of ZMAGIC for ia64. + +2006-09-04 Mark Shinwell + + * elf32-arm.c (elf32_arm_howto_table_1): Adjust entries for + R_ARM_THM_ALU_PREL_11_0 and R_ARM_THM_PC12 relocations. + (elf32_arm_final_link_relocate): Handle R_ARM_THM_ALU_PREL_11_0 + and R_ARM_THM_PC12 relocations. + +2006-08-24 Bob Wilson + + * elf32-xtensa.c (xtensa_get_property_section_name): Delete. + (xtensa_get_property_section): New. + (xtensa_read_table_entries): Use xtensa_get_property_section. + (relax_property_section, xtensa_get_property_predef_flags): Handle + group name suffixes in property section names. + (match_section_group): New. + +2006-08-23 Frediano Ziglio + + * archive.c (hpux_uid_gid_encode): Fix thinko decrementing "cnt" + variable. + +2006-08-22 Daniel Jacobowitz + + * elf32-arm.c (elf32_arm_copy_indirect_symbol): Only copy + plt_thumb_refcount from indirect symbols. + +2006-08-22 Alan Modra + + * elf32-ppc.c (ppc_elf_relocate_section): Correct GOT and PLT HA + reloc handling. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + +2006-08-21 Mark Shinwell + + * elf32-arm.c (elf32_arm_link_hash_table): Correct typo in + comment for target1_is_rel. + +2006-08-21 Pedro Alves + + * Makefile.am: Add rules to build pe-arm-wince.lo + and pei-arm-wince.lo objects. + * Makefile.in: Regenerate. + * pe-arm-wince.c: New file. + * pei-arm-wince.c: New file. + * pei-arm.c: Remove ARM_WINCE block. + * pe-arm.c: Remove ARM_WINCE block. Rename + bfd_arm_pe_allocate_interworking_sections, + bfd_arm_pe_get_bfd_for_interworking, and + bfd_arm_pe_process_before_allocation to + bfd_armpe_allocate_interworking_sections, + bfd_armpe_get_bfd_for_interworking, and + bfd_armpe_process_before_allocation. Move them before + including bfd.h. + * bfd.c: ARM wince bfd format names were renamed. Adjust. + * coff-arm.c [ARM_WINCE]: Adjust so Windows CE doesn't end up + with unexpected/conflicting relocs. + * targets.c: The arm-wince-pe target got its own new vector. + Adjust. + * config.bfd: Likewise. + * configure.in: Likewise. + * configure: Regenerate. + +2006-08-18 Paul Brook + + * elf32-arm.c (elf32_arm_link_hash_entry): Add export_glue. + (elf32_arm_link_hash_newfunc): Initialize export_glue. + (record_arm_to_thumb_glue): Return stub symbol. + (elf32_arm_create_thumb_stub): New function. + (elf32_arm_to_thumb_stub): Use it. + (elf32_arm_to_thumb_export_stub): New function. + (elf32_arm_begin_write_processing): New function. + (allocate_dynrelocs): Allocate Arm stubs. + (elf_backend_begin_write_processing): Define. + (elf32_arm_symbian_begin_write_processing): Remove ATTRIBUTE_UNUSED. + Call elf32_arm_begin_write_processing. + +2006-08-17 Alan Modra + + * elf64-ppc.c (create_linkage_sections): Align .glink to 8 bytes. + (ppc64_elf_build_stubs): Use new lazy linking stub. + +2006-08-17 Alan Modra + + * elf64-ppc.c (ppc64_elf_size_stubs): Ignore non-code sections. + +2006-08-16 H.J. Lu + + PR ld/3015 + * elf.c (get_program_header_size): Add a PT_GNU_RELRO segment + only if there is a PT_DYNAMIC segment. + (_bfd_elf_map_sections_to_segments): Likewise. + (assign_file_positions_for_load_sections): Set PT_GNU_RELRO + segment alignment to 1. + +2006-08-15 Thiemo Seufer + Nigel Stephens + + * elf32-mips.c, elf64-mips.c, elfn32-mips.c + (elf_backend_merge_symbol_attribute): Define. + * elflink.c (elf_link_add_object_symbols): Merge only the ELF + visibility flags. + * elfxx-mips.c (_bfd_mips_elf_merge_symbol_attribute): New function. + +2006-08-15 Thiemo Seufer + Nigel Stephens + David Ung + + * config.bfd: Add configurations for mips*el-sde-elf* and + mips*-sde-elf*. + +2006-08-14 DJ Delorie + + * elf-m10300.c (elf32_mn10300_link_hash_entry): Add value. + (elf32_mn10300_count_hash_table_entries): New. + (elf32_mn10300_list_hash_table_entries): New. + (sort_by_value): New. + (mn10300_elf_relax_section): Don't skip data sections; restrict + code-specific tests to code-specific areas so that potential + indirect calls can be detected. Check for multiple local symbols + at the same address and merge their flags. + (elf32_mn10300_link_hash_newfunc): Initialize value. + +2006-08-14 Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_symbol_processing, + _bfd_mips_elf_add_symbol_hook): Don't try to place small common TLS + symbols in .scommon. + +2006-08-11 Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Set + sh_entsize only when sgot was already initialized. + +2006-08-08 DJ Delorie + + * elf32-sh.c (sh_elf_relax_section): Allow for branches across + non-moving .align directives. Preserve any DIR32 offset when + converting bsr's to jsr's. + +2006-08-08 Alan Modra + + * elf64-ppc.c (ppc64_elf_build_stubs): Clear relbrlt reloc_count + after stubs have been built. + +2006-08-07 Nick Clifton + + * elf32-sh.c (vxworks_object_p): Only check for vxworks target + vectors if they are going to be created. + +2006-08-07 Nick Clifton + + * configure.in (bfd_elf32_shnbsd_vec): Fix typo. + * configure: Regenerate. + +2006-08-07 Nick Clifton + + * coff-arm.c (coff_arm_rtype_to_howto): Only check for ARM_SECREL + relocation types if the target is ARM_WINCE. + +2006-08-05 Pedro Alves + + * bfd.c (bfd_get_sign_extend_vma): Add cases for pe-arm-little + and pei-arm-little. + * coff-arm.c (coff_arm_rtype_to_howto) [COFF_WITH_PE]: Handle + ARM_SECREL. + (coff_arm_reloc_type_lookup): Map BFD_RELOC_32_SECREL to + ARM_SECREL. + * pe-arm.c [COFF_SECTION_ALIGNMENT_ENTRIES]: Define. + * pei-arm.c [TARGET_UNDERSCORE]: Define for ARM_WINCE like in + pe-arm.c. + [COFF_SECTION_ALIGNMENT_ENTRIES]: Define. + +2006-08-04 Marcelo Tosatti + + * elflink.c (elf_gc_sweep): If info.print_gc_sections is true, + list removed sections to stderr. + +2006-08-04 Richard Sandiford + Kazu Hirata + Phil Edwards + Nathan Sidwell + + * config.bfd (sh-*-vxworks): Use bfd_elf32_shvxworks_vec and + bfd_elf32_shlvxworks_vec. + * configure.in (bfd_elf32_sh64_vec): Add elf-vxworks.lo. + (bfd_elf32_sh64l_vec, bfd_elf32_sh64lin_vec): Likewise. + (bfd_elf32_sh64blin_vec, bfd_elf32_sh64lnbsd_vec): Likewise. + (bfd_elf32_sh64nbsd_vec, bfd_elf32_sh_vec): Likewise. + (bfd_elf32_shblin_vec, bfd_elf32_shl_vec): Likewise. + (bfd_elf32_shl_symbian_vec, bfd_elf32_shlin_vec): Likewise. + (bfd_elf32_shlnbsd_vec, bfd_elf32_shnbsd_vec): Likewise. + (bfd_elf32_shlvxworks_vec, bfd_elf32_shvxworks_vec): New stanzas. + * configure: Regenerate. + * Makefile.am: Regenerate dependencies. + * Makefile.in: Regenerate. + * elf-vxworks.c (elf_vxworks_gott_symbol_p): New function. + (elf_vxworks_add_symbol_hook): Use it. + (elf_vxworks_link_output_symbol_hook): Likewise. Use the hash + table entry to check for weak undefined symbols and to obtain + the original bfd. + (elf_vxworks_emit_relocs): Use target_index instead of this_idx. + * elf32-sh-relocs.h: New file, split from elf32-sh.c. + (R_SH_DIR32): Use SH_PARTIAL32 for the partial_inplace field, + SH_SRC_MASK32 for the src_mask field, and SH_ELF_RELOC for the + special_function field. + (R_SH_REL32): Use SH_PARTIAL32 and SH_SRC_MASK32 here too. + (R_SH_REL32, R_SH_TLS_GD_32, R_SH_TLS_LD_32): Likewise. + (R_SH_TLS_LDO_32, R_SH_TLS_IE_32, R_SH_TLS_LE_32): Likewise. + (R_SH_TLS_DTPMOD32, R_SH_TLS_DTPOFF32, R_SH_TLS_TPOFF32): Likewise. + (R_SH_GOT32, R_SH_PLT32, R_SH_COPY, R_SH_GLOB_DAT): Likewise. + (R_SH_JMP_SLOT, R_SH_RELATIVE, R_SH_GOTOFF, R_SH_GOTPC): Likewise. + (SH_PARTIAL32, SH_SRC_MASK32, SH_ELF_RELOC): Undefine at end of file. + * elf32-sh.c: Include elf32-vxworks.h. + (MINUS_ONE): Define. + (sh_elf_howto_table): Include elf32-sh-relocs.h with SH_PARTIAL32 + set to TRUE, SH_SRC_MASK32 set to 0xffffffff, and SH_ELF_RELOC set + to sh_elf_reloc. + (sh_vxworks_howto_table): New variable. Include elf32-sh-relocs.h + with SH_PARTIAL32 set to FALSE, SH_SRC_MASK32 set to 0, and + SH_ELF_RELOC set to bfd_elf_generic_reloc. + (vxworks_object_p, get_howto_table): New functions. + (sh_elf_reloc_type_lookup): Fix typo. Use get_howto_table. + (sh_elf_info_to_howto): Use get_howto_table. + (sh_elf_relax_section): Honor the partial_inplace field of the + R_SH_DIR32 howto. + (sh_elf_relax_delete_bytes): Likewise. + (elf_sh_plt_info): New structure. + (PLT_ENTRY_SIZE): Replace both definitions with... + (ELF_PLT_ENTRY_SIZE): ...this new macro, with separate definitions for + INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA. + (elf_sh_plt0_entry_be): Update sizes of both definitions accordingly. + (elf_sh_plt0_entry_le): Likewise. + (elf_sh_plt_entry_be, elf_sh_plt_entry_le): Likewise. + (elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le): Likewise. + (elf_sh_plts): New structure, with separate definitions for + INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA. + (elf_sh_plt0_entry): Delete both definitions. + (elf_sh_plt_entry, elf_sh_pic_plt_entry): Likewise. + (elf_sh_sizeof_plt, elf_sh_plt_plt0_offset): Likewise. + (elf_sh_plt_temp_offset, elf_sh_plt_symbol_offset): Likewise. + (elf_sh_plt_reloc_offset): Likewise. + (movi_shori_putval): Delete in favor of... + (install_plt_field): ...this new function, with separate definitions + for INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA. + (get_plt_info): New function, with separate definitions + for INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA. + (elf_sh_plt0_linker_offset, elf_sh_plt0_gotid_offset): Delete. + (VXWORKS_PLT_HEADER_SIZE, VXWORKS_PLT_ENTRY_SIZE): New macros. + (vxworks_sh_plt0_entry_be, vxworks_sh_plt0_entry_le): New constants. + (vxworks_sh_plt_entry_be, vxworks_sh_plt_entry_le): Likewise. + (vxworks_sh_pic_plt_entry_be, vxworks_sh_pic_plt_entry_le): Likewise. + (get_plt_index, get_plt_offset): New functions. + (elf_sh_link_hash_table): Add srelplt2, plt_info and vxworks_p fields. + (sh_elf_link_hash_table_create): Initialize them. + (sh_elf_create_dynamic_sections): Call + elf_vxworks_create_dynamic_sections for VxWorks. + (allocate_dynrelocs): Use htab->plt_info to get the size of PLT + entries. Allocate relocation entries in .rela.plt.unloaded if + generating a VxWorks executable. + (sh_elf_always_size_sections): New function. + (sh_elf_size_dynamic_sections): Extend .rela.plt handling to + .rela.plt.unloaded. + (sh_elf_relocate_section): Use get_howto_table. Honor + partial_inplace when calculating the addend for dynamic + relocations. Use get_plt_index. + (sh_elf_finish_dynamic_symbol): Use get_plt_index, install_plt_field + and htab->plt_info. Fill in the bra .plt offset for VxWorks + executables. Populate .rela.plt.unloaded. Do not make + _GLOBAL_OFFSET_TABLE_ absolute on VxWorks. + (sh_elf_finish_dynamic_sections): Use install_plt_field and + htab->plt_info. Handle cases where there is no special PLT header. + Populate the first relocation in .rela.plt.unloaded and fix up + the remaining entries. + (sh_elf_plt_sym_val): Use get_plt_info. + (elf_backend_always_size_sections): Define. + (TARGET_BIG_SYM, TARGET_BIG_NAME): Override for VxWorks. + (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Likewise. + (elf32_bed, elf_backend_want_plt_sym): Likewise. + (elf_symbol_leading_char, elf_backend_want_got_underscore): Likewise. + (elf_backend_grok_prstatus, elf_backend_grok_psinfo): Likewise. + (elf_backend_add_symbol_hook): Likewise. + (elf_backend_link_output_symbol_hook): Likewise. + (elf_backend_emit_relocs): Likewise. + (elf_backend_final_write_processing): Likewise. + (ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): Likewise. + * targets.c (bfd_elf32_shlvxworks_vec): Declare. + (bfd_elf32_shvxworks_vec): Likewise. + (_bfd_target_vector): Include bfd_elf32_shlvxworks_vec and + bfd_elf32_shvxworks_vec. + +2006-08-02 Mark Kettenis + + * configure.in (arm-*-openbsd*): Set COREFILE to netbsd-core.lo. + * configure: Regenerate. + +2006-08-02 Petr Salinger + + PR binutils/2983 + * elf64-x86-64.c: Add FreeBSD support. + (elf64_x86_64_fbsd_post_process_headers): New function. + * targets.c (_bfd_target_vector): Add bfd_elf64_x86_64_freebsd_vec. + * config.bfd (x64_64-*-freebsd*): Add bfd_elf64_x86_64_freebsd_vec + to the targ_selvecs. + * configure.in: Add entry for bfd_elf64_x86_64_freebsd_vec. + * configure: Regenerate. + +2006-07-26 Andreas Schwab + + * elfxx-ia64.c (elfNN_ia64_choose_gp): Use rawsize if set. + +2006-07-26 Alan Modra + + * elf.c (elf_modify_segment_map): Delete empty PT_LOAD segments. + * elf32-xtensa.c (elf_xtensa_modify_segment_map): Delete. + (define elf_backend_modify_segment_map): Don't define. + +2006-07-25 Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Allow + linking of objects for compatible machine types. + +2006-07-25 Thiemo Seufer + + * elfxx-mips.c (mips_elf_next_relocation): Tighten check to test + also for same symbol. + +2006-07-25 Thiemo Seufer + + * elfxx-mips.c (mips_elf_calculate_relocation): Remove magic constant. + +2006-07-24 Michael Wetherell + + * elf.c (bfd_section_from_shdr): Reject unrecognised OS-specific + sections only if the SHF_OS_NONCONFORMING flag is present. + +2006-07-24 Nick Clifton + + PR ld/2729 + * peXXigen.c (_bfd_XXi_final_link_postscript): Check for the + existance of output sections before putting their entries into the + DataDictionary. + +2006-07-20 Thiemo Seufer + + * elf32-mips.c (mips16_jump_reloc): Remove function. + (elf_mips16_howto_table_rel): Use _bfd_mips_elf_generic_reloc + instead of mips16_jump_reloc. + * elf64_mips.c, wlfn32-mips.c (mips16_jump_reloc): Remove function. + (elf_mips16_howto_table_rel, elf_mips16_howto_table_rela): Use + _bfd_mips_elf_generic_reloc instead of mips16_jump_reloc. + +2006-07-19 Alan Modra + + * bfd-in.h (enum notice_asneeded_action): Define. + * bfd-in2.h: Regenerate. + * elflink.c (elf_link_add_object_symbols): Call linker "notice" + function with NULL name for as-needed handling. + +2006-07-18 Paul Brook + + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * reloc.c: Add BFD_RELOC_ARM_T32_ADD_IMM. + +2006-07-18 Nick Clifton + + * elfxx-mips.c (_bfd_mips_elf_common_definition): New function. + Consider SHN_MIPS_ACOMMON and SHN_MIPS_SCOMMON as being common + sections. + * elfxx-mips.h (_bfd_mips_elf_common_definition): Prototype. + +2006-07-14 Jakub Jelinek + + * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Fix cinfo.shift2 value. + +2006-07-14 Mark Kettenis + + * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Move declarations + to the start of a block. + +2006-07-13 Nick Clifton + + * coff-sh.c (_bfd_sh_align_load_span): Catch sh_insn_info() + returning a NULL value. + +2006-07-12 H.J. Lu + + PR ld/2884 + * elflink.c (_bfd_elf_merge_symbol): Copy the symbol info from + the old versioned dynamic definition to the new one with + non-default visibility. Hide the symbol if it is hidden or + internal. + +2006-07-12 Matthew R. Dempsky + + * cpu-m68k.c (bfd_m68k_compatible): Handle CPU32. + +2006-07-10 Jakub Jelinek + + * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_GNU_HASH. + (bfd_section_from_shdr, elf_fake_sections, assign_section_numbers): + Handle SHT_GNU_HASH. + (special_sections_g): Include .gnu.hash section. + (bfd_elf_gnu_hash): New function. + * elf-bfd.h (bfd_elf_gnu_hash, _bfd_elf_hash_symbol): New prototypes. + (struct elf_backend_data): Add elf_hash_symbol method. + * elflink.c (_bfd_elf_link_create_dynamic_sections): Create .hash + only if info->emit_hash, create .gnu.hash section if + info->emit_gnu_hash. + (struct collect_gnu_hash_codes): New type. + (elf_collect_gnu_hash_codes, elf_renumber_gnu_hash_syms, + _bfd_elf_hash_symbol): New functions. + (compute_bucket_count): Don't compute HASHCODES array, instead add + that and NSYMS as arguments. Use bed->s->sizeof_hash_entry + instead of bed->s->arch_size / 8. Fix .hash size estimation. + When not optimizing, use the number of hashed symbols rather than + dynsymcount. + (bfd_elf_size_dynamic_sections): Only add DT_HASH if info->emit_hash, + and ADD DT_GNU_HASH if info->emit_gnu_hash. + (bfd_elf_size_dynsym_hash_dynstr): Size .hash only if info->emit_hash, + adjust compute_bucket_count caller. Create and populate .gnu.hash + section if info->emit_gnu_hash. + (elf_link_output_extsym): Only populate .hash section if + finfo->hash_sec != NULL. + (bfd_elf_final_link): Adjust assertion. Handle DT_GNU_HASH. + * elfxx-target.h (elf_backend_hash_symbol): Define if not yet defined. + (elfNN_bed): Add elf_backend_hash_symbol. + * elf64-x86-64.c (elf64_x86_64_hash_symbol): New function. + (elf_backend_hash_symbol): Define. + * elf32-i386.c (elf_i386_hash_symbol): New function. + (elf_backend_hash_symbol): Define. + +2006-07-05 Nick Clifton + + PR ld/2659 + * cofflink.c (_bfd_coff_link_input_bfd): Fix selection of aux + entry when multiple definitions of a symbol are encountered. + +2006-06-30 H.J. Lu + + * elf32-i386.c (elf_i386_relocate_section): Use xchg %ax,%ax + instead of 2 nops. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + (elf64_x86_64_plt0_entry): Use nopl 0(%rax) instead of 4 nops. + +2006-06-29 Jakub Jelinek + + PR ld/2513 + * elf32-i386.c (GOT_TLS_MASK, GOT_TLS_IE_IE, GOT_TLS_IE_GD, + GOT_TLS_IE_MASK, elf_i386_check_relocs, allocate_dynrelocs): Revert + 2006-04-08 changes. + (elf_i386_relocate_section): Likewise. For GD->IE transition + change subl into addl whenever tls_type is GOT_TLS_IE_POS. + +2006-06-23 Alan Modra + + PR ld/2754 + * elf.c (bfd_elf_mkobject): Don't alloc if already done. Set + program_header_size to -1. + (_bfd_elf_map_sections_to_segments): Adjust program_header_size check. + (assign_file_positions_for_load_sections ): Likewise. + (_bfd_elf_sizeof_headers): Use saved program_header_size if + available. + * elf32-arm.c (elf32_arm_mkobject): Call bfd_elf_mkobject, don't + alloc if already done. + * elf32-i386.c (elf_i386_mkobject): Likewise. + * elf32-ppc.c (ppc_elf_mkobject): Likewise. + * elf32-s390.c (elf_s390_mkobject): Likewise. + * elf32-sh.c (sh_elf_mkobject): Likewise. + * elf64-alpha.c (elf64_alpha_mkobject): Likewise. + * elf64-ppc.c (ppc64_elf_mkobject): Likewise. + * elf64-s390.c (elf_s390_mkobject): Likewise. + * elf64-x86-64.c (elf64_x86_64_mkobject): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_mkobject): Likewise. + +2006-06-20 Jakub Jelinek + + * elflink.c (elf_link_add_object_symbols): Don't create .tcommon + section for relocatable link. + +2006-06-21 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add + elf_backend_modify_program_headers. + * elfxx-target.h (elf_backend_modify_program_headers): Define. + (elfNN_bed): Init new field. + * elf.c (elf_modify_segment_map): Remove comment. + (assign_file_positions_for_load_sections): Only call + elf_modify_segment_map for objcopy/strip. + (assign_file_positions_except_relocs): Call + elf_backend_modify_program_headers. + * elf32-frv.c (elf32_frvfdpic_always_size_sections): Don't make + .stack section. + (elf32_frvfdpic_modify_segment_map): Delete. + (elf32_frvfdpic_modify_program_headers): New. + (elf_backend_modify_segment_map): Don't define. + (elf_backend_modify_program_headers): Define. + * elf32-bfin.c (elf32_bfinfdpic_always_size_sections): Don't make + .stack section. + (elf32_bfinfdpic_modify_segment_map): Delete. + (elf32_bfinfdpic_modify_program_headers): New. + (elf_backend_modify_segment_map): Don't define. + (elf_backend_modify_program_headers): Define. + * elfxx-ia64.c (elfNN_ia64_modify_program_headers): New function. + Split out from.. + (elfNN_ia64_modify_segment_map): ..here. + (elf_backend_modify_program_headers): Define. + +2006-06-20 Jakub Jelinek + + * bfd.c (bfd_record_phdr): Clear p_align and p_align_valid fields. + * elf.c (_bfd_elf_link_hash_table_init): Clear hplt field. + +2006-06-20 Alan Modra + + * elf-bfd.h: Formatting. + (_bfd_elf_map_sections_to_segments): Declare. + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame_hdr): Don't + clear program_header_size. + * elf.c (get_program_header_size): Move. Don't use or set saved + program_header_size here. + (elf_modify_segment_map): New function. Split out from.. + (assign_file_positions_for_load_sections): ..here. Assert + header size is correct. Remove dead code. + (_bfd_elf_map_sections_to_segments): Rename from + map_sections_to_segments. Make global. Use get_program_header_size + when we need estimate of header size. Call elf_modify_segment_map. + Set program_header_size. + (print_segment_map): Delete. + (_bfd_elf_sizeof_headers): If segment_map available, get the + actual size. + * elf32-arm.c (elf32_arm_symbian_modify_segment_map): Make safe + for calling more than once. + * elf32-bfin.c (elf32_bfinfdpic_modify_segment_map): Likewise. + * elf32-frv.c (elf32_frvfdpic_modify_segment_map): Likewise. + * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Likewise. + * elf32-i370.c (elf_backend_add_symbol_hook): Delete. + (elf_backend_additional_program_headers): Delete. + (elf_backend_modify_segment_map): Delete. + * elf64-hppa.c (elf64_hppa_modify_segment_map): Convert to ISO C. + * elfxx-ia64.c (elfNN_ia64_modify_segment_map): Likewise. + * doc/bfdint.texi: Delete SIZEOF_HEADERS difficulties. + +2006-06-19 Vladimir Prus + + * elf32-arm.c (elf32_arm_swap_symbol_out): Don't set low + bit for undefined symbols. + +2006-06-19 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add bfd_link_info pointer + parameter. + (_bfd_elf_sizeof_headers): Replace bfd_boolean param with + bfd_link_info pointer. + * targets.c (struct bfd_target <_bfd_sizeof_headers>): Likewise. + * bfd.c (bfd_sizeof_headers): Tweak param name. + * aout-adobe.c (aout_adobe_sizeof_headers): Adjust. + * aoutx.h (NAME (aout, sizeof_headers)): Adjust. + * binary.c (binary_sizeof_headers): Adjust. + * bout.c (b_out_sizeof_headers): Adjust. + * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Adjust. + * coff64-rs6000.c (xcoff64_sizeof_headers): Adjust. + * coffgen.c (coff_sizeof_headers): Adjust. + * ecoff.c (_bfd_ecoff_sizeof_headers): Adjust. + (ecoff_compute_section_file_positions): Adjust. + (_bfd_ecoff_write_object_contents): Adjust. + * elf.c (get_program_header_size, _bfd_elf_sizeof_headers): Adjust. + * elf32-arm.c (elf32_arm_additional_program_headers): Adjust. + * elf32-i370.c (elf_backend_additional_program_headers): Adjust. + * elf32-ppc.c (ppc_elf_additional_program_headers): Adjust. + * elf64-hppa.c (elf64_hppa_additional_program_headers): Adjust. + * elf64-x86-64.c (elf64_x86_64_additional_program_headers): Adjust. + * elfxx-ia64.c (elfNN_ia64_additional_program_headers): Adjust. + * elfxx-mips.c (_bfd_mips_elf_additional_program_headers): Adjust. + * elfxx-mips.h (_bfd_mips_elf_additional_program_headers): Adjust. + * i386msdos.c: Convert to ISO C. + (msdos_sizeof_headers): Adjust. + * i386os9k.c: Convert to ISO C. + (os9k_sizeof_headers): Adjust. + * ieee.c (ieee_sizeof_headers): Adjust. + * ihex.c (ihex_sizeof_headers): Adjust. + * libaout.h (NAME (aout, sizeof_headers)): Adjust. + * libbfd-in.h (_bfd_nolink_sizeof_headers): Adjust. + * libcoff-in.h (coff_sizeof_headers): Adjust. + * libecoff.h (_bfd_ecoff_sizeof_headers): Adjust. + * mach-o.c (bfd_mach_o_sizeof_headers): Adjust. + * mmo.c (mmo_sizeof_headers): Adjust. + * oasys.c (oasys_sizeof_headers): Adjust. + * pdp11.c (NAME (aout, sizeof_headers)): Adjust. + * pef.c (bfd_pef_sizeof_headers): Adjust. + * ppcboot.c (ppcboot_sizeof_headers): Adjust. + * som.c (som_sizeof_headers): Adjust. + * srec.c (srec_sizeof_headers): Adjust. + * tekhex.c (tekhex_sizeof_headers): Adjust. + * versados.c (versados_sizeof_headers): Adjust. + * vms.c (vms_sizeof_headers): Adjust. + * xcoff-target.h (_bfd_xcoff_sizeof_headers): Adjust. + * xsym.c (bfd_sym_sizeof_headers): Adjust. + * xsym.h (bfd_sym_sizeof_headers): Adjust. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + +2006-06-15 Mark Shinwell + + * bfd-in2.h: Regenerate. + * elf32-arm.c (R_ARM_ALU_PC_G0_NC, R_ARM_ALU_PC_G0, + R_ARM_ALU_PC_G1_NC, R_ARM_ALU_PC_G1, R_ARM_ALU_PC_G2, + R_ARM_LDR_PC_G1, R_ARM_LDR_PC_G2, R_ARM_LDRS_PC_G0, + R_ARM_LDRS_PC_G1, R_ARM_LDRS_PC_G2, R_ARM_LDC_PC_G0, + R_ARM_LDC_PC_G1, R_ARM_LDC_PC_G2, R_ARM_ALU_SB_G0_NC, + R_ARM_ALU_SB_G0, R_ARM_ALU_SB_G1_NC, R_ARM_ALU_SB_G1, + R_ARM_ALU_SB_G2, R_ARM_LDR_SB_G0, R_ARM_LDR_SB_G1, + R_ARM_LDR_SB_G2, R_ARM_LDRS_SB_G0, R_ARM_LDRS_SB_G1, + R_ARM_LDRS_SB_G2, R_ARM_LDC_SB_G0, R_ARM_LDC_SB_G1, + R_ARM_LDC_SB_G2): New relocation types. + (R_ARM_PC13): Rename to AAELF name R_ARM_LDR_PC_G0 and + adjust HOWTO entry to be consistent with R_ARM_LDR_PC_G1 + and friends. + (elf32_arm_howto_table_3): Delete; contents merged into + elf32_arm_howto_table_2. + (elf32_arm_howto_from_type): Adjust correspondingly. + (elf32_arm_reloc_map): Extend with the above relocations. + (calculate_group_reloc_mask): New function. + (identify_add_or_sub): New function. + (elf32_arm_final_link_relocate): Support for the above + relocations. + * reloc.c: Add enumeration entries for BFD_RELOC_ARM_... + codes to correspond to the above relocations. + +2006-06-14 Richard Sandiford + + * elf32-m68k.c (elf_m68k_plt_info): New structure. + (elf_m68k_plt0_entry): Add R_68K_PC32-style in-place addends. + (elf_m68k_plt_entry): Likewise. + (elf_m68k_plt_info): New table. + (CFV4E_PLT_ENTRY_SIZE): Rename to... + (ISAB_PLT_ENTRY_SIZE): ...this. + (CFV4E_FLAG): Delete. + (elf_cfv4e_plt0_entry): Rename to... + (elf_isab_plt0_entry): ...this. Adjust comments. Use (-6,%pc,%d0) + for the second instruction too. + (elf_cfv4e_plt_entry): Rename to... + (elf_isab_plt_entry): ...this. Adjust comments and use (-6,%pc,%d0). + (elf_isab_plt_info): New table. + (CPU32_FLAG): Delete. + (PLT_CPU32_ENTRY_SIZE): Rename to... + (CPU32_PLT_ENTRY_SIZE): ...this. + (elf_cpu32_plt0_entry): Update bounds accordingly. Add R_68K_PC32- + style in-place addends. + (elf_cpu32_plt_entry): Likewise. + (elf_cpu32_plt_info): New table. + (elf_m68k_link_hash_table): Add a plt_info field. + (elf_m68k_link_hash_table_create): Initialize it. + (elf_m68k_get_plt_info): New function. + (elf_m68k_always_size_sections): Likewise. + (elf_m68k_adjust_dynamic_symbol): Use the plt_info hash table field. + (elf_m68k_install_pc32): New function. + (elf_m68k_finish_dynamic_symbol): Factor code using plt_info and + elf_m68k_install_pc32. + (elf_m68k_finish_dynamic_sections): Likewise. + (elf_m68k_plt_sym_val): Use elf_m68k_get_plt_info. + (elf_backend_always_size_sections): Define. + +2006-06-14 Alan Modra + + * elflink.c (elf_link_add_object_symbols): Save and restore + struct bfd_hash_table table, size and count fields for + as-needed libs. + +2006-06-12 Thiemo Seufer + + * elf32-mips.c: Expand comment about ABI-mandated pagesize values. + (ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): define in a more obvious way. + * elf64-mips.c, elfn32-mips.c (ELF_MAXPAGESIZE): Fix value for IRIX6. + Delete old comments. + (ELF_COMMONPAGESIZE): Define in a more obvious way. + +2006-06-12 Nick Clifton + + PR binutils/2735 + * elflink.c (elf_link_add_object_symbols): Fix the warning message + about mismatched alignments to allow for the case where the common + alignment has been deduced from the section alignment. + * bfd.c (_bfd_default_error_handler): Update comment to explain + why bfd and asection varargs are out of order. Explicitly catch + and abort on NULL bfd and asection arguments. + +2006-06-11 Richard Sandiford + Thiemo Seufer + + * elfxx-mips.c (mips_elf_link_hash_table): Add function_stub_size. + (STUB_ORI): New macro. + (STUB_LI16U): Fix formatting. + (MIPS_FUNCTION_STUB_SIZE): Delete. + (MIPS_FUNCTION_STUB_MAX_SIZE): Likewise. + (MIPS_FUNCTION_STUB_NORMAL_SIZE): New macro. + (MIPS_FUNCTION_STUB_BIG_SIZE): Likewise. + (_bfd_mips_elf_adjust_dynamic_symbol): Use htab->function_stub_size + instead of MIPS_FUNCTION_STUB_SIZE. + (count_section_dynsyms): New function, split out from + _bfd_mips_elf_final_link. + (_bfd_mips_elf_always_size_sections): Get a worst-case estimate + of the number of dynamic symbols needed and use it to set up + function_stub_size. Use function_stub_size rather than + MIPS_FUNCTION_STUB_SIZE to determine the size of the stub section. + Use 16-byte stubs for 0x10000 dynamic symbols. + (_bfd_mips_elf_size_dynamic_sections): Use htab->function_stub_size + instead of MIPS_FUNCTION_STUB_SIZE. Fix formatting. + (_bfd_mips_elf_finish_dynamic_symbol): Likewise. Change the + size of the stub buffer from MIPS_FUNCTION_STUB_MAX_SIZE to + MIPS_FUNCTION_STUB_BIG_SIZE. Tweak the check for unhandled dynindxes. + Use MIPS_FUNCTION_STUB_BIG_SIZE rather than a hard-coded 20. + Use STUB_ORI rather than STUB_LI16U for big stubs. + (_bfd_mips_elf_link_hash_table_create): Initialize function_stub_size. + (_bfd_mips_elf_final_link): Use count_section_dynsyms. + +2006-06-09 David Ung + + * bfd/elfxx-mips.c (mips_elf_calculate_relocation): Fix mode for stub + calling relocations. + +2006-06-08 David Daney + + * elfxx-mips.c (STUB_LI16): Removed. + (STUB_LUI): New macro. + (STUB_LI16U): Ditto. + (STUB_LI16S): Ditto. + (MIPS_FUNCTION_STUB_SIZE): Rewrote to take info parameter. + (_bfd_mips_elf_adjust_dynamic_symbol): Pass info parameter to + MIPS_FUNCTION_STUB_SIZE. + (_bfd_mips_elf_always_size_sections): Ditto. + (_bfd_mips_elf_size_dynamic_sections): Ditto. + (_bfd_mips_elf_finish_dynamic_sections): Ditto. + (_bfd_mips_elf_finish_dynamic_symbol): Rewrote stub generation + to allow larger symbol table indexes. + +2006-06-07 Joseph S. Myers + + * po/Make-in (pdf, ps): New dummy targets. + +2006-06-06 Alan Modra + + * hash.c (bfd_hash_lookup): Correct stray line. + + * elf.c (_bfd_elf_init_private_section_data): Comment typo. + (elfcore_grok_nto_status): Use long instead of pid_t. + (elfcore_grok_nto_regs, elfcore_grok_nto_note): Likewise. + +2006-06-05 Daniel Jacobowitz + + * po/Make-in (top_builddir): Define. + +2006-06-05 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * config.in: Regenerate. + +2006-06-02 Alan Modra + H.J. Lu + + PR ld/2723 + * elflink.c (bfd_elf_final_link): Don't output section symbols + for special ELF sections. + +2006-06-01 Alan Modra + + * stabs.c (_bfd_link_section_stabs): Use bfd_make_section*_with_flags + instead of bfd_make_section*. + * aix386-core.c: Likewise. + * aix5ppc-core.c: Likewise. + * aout-adobe.c: Likewise. + * aoutf1.h: Likewise. + * binary.c: Likewise. + * cisco-core.c: Likewise. + * coff-arm.c: Likewise. + * coff-h8300.c: Likewise. + * elf.c: Likewise. + * elf32-bfin.c: Likewise. + * elf32-m32c.c: Likewise. + * hppabsd-core.c: Likewise. + * hpux-core.c: Likewise. + * i386linux.c: Likewise. + * ieee.c: Likewise. + * ihex.c: Likewise. + * irix-core.c: Likewise. + * lynx-core.c: Likewise. + * m68klinux.c: Likewise. + * mach-o.c: Likewise. + * netbsd-core.c: Likewise. + * nlmcode.h: Likewise. + * opncls.c: Likewise. + * osf-core.c: Likewise. + * peXXigen.c: Likewise. + * ppcboot.c: Likewise. + * ptrace-core.c: Likewise. + * rs6000-core.c: Likewise. + * sco5-core.c: Likewise. + * sparclinux.c: Likewise. + * srec.c: Likewise. + * sunos.c: Likewise. + * trad-core.c: Likewise. + * xcofflink.c: Likewise. + * xsym.c: Likewise. + +2006-05-31 Daniel Jacobowitz + + * Makefile.am (INCLUDES): Use @INCINTL@. + * acinclude.m4: Include new gettext macros. + * configure.in: Use ZW_GNU_GETTEXT_SISTER_DIR and AM_PO_SUBDIRS. + Manually substitute POFILES and GMOFILES. + * Makefile.in, aclocal.m4, configure, doc/Makefile.in: Regenerated. + +2006-05-30 H.J. Lu + + * bfd.c (bfd_emul_get_maxpagesize): New. + (bfd_elf_set_pagesize): Likewise. + (bfd_emul_set_maxpagesize): Likewise. + (bfd_emul_get_commonpagesize): Likewise. + (bfd_emul_set_commonpagesize): Likewise. + * bfd-in2.h: Regenerated. + + * elf-bfd.h (elf_backend_data): Add commonpagesize. + (xvec_get_elf_backend_data): New. + (get_elf_backend_data): Use xvec_get_elf_backend_data. + + * elf32-arm.c (elf32_arm_vxworks_bed): Remove const. + * elfxx-target.h (elfNN_bed): Likewise. + + * elf32-arm.c (ELF_COMMONPAGESIZE): Defined. + * elf32-mips.c (ELF_COMMONPAGESIZE): Likewise. + * elf32-ppc.c (ELF_COMMONPAGESIZE): Likewise. + * elf32-sh.c (ELF_COMMONPAGESIZE): Likewise. + * elf32-sh64.c (ELF_COMMONPAGESIZE): Likewise. + * elf32-sparc.c (ELF_COMMONPAGESIZE): Likewise. + * elf64-alpha.c (ELF_COMMONPAGESIZE): Likewise. + * elf64-ppc.c (ELF_COMMONPAGESIZE): Likewise. + * elf64-sparc.c (ELF_COMMONPAGESIZE): Likewise. + * elf64-x86-64.c (ELF_COMMONPAGESIZE): Likewise. + * elfn32-mips.c (ELF_COMMONPAGESIZE): Likewise. + * elfxx-ia64.c (ELF_COMMONPAGESIZE): Likewise. + + * elfxx-target.h (ELF_COMMONPAGESIZE): Define if not defined. + (elfNN_bed): Initialize commonpagesize with ELF_COMMONPAGESIZE. + + * targets.c (bfd_find_target): Support NULL abfd. + +2006-05-30 Nick Clifton + + * po/es.po: Updated Spanish translation. + +2006-05-27 Alan Modra + H.J. Lu + + * elf.c (assign_file_positions_for_load_sections): Retrieve + maxpagesize from m->p_align if it is valid. Set p_vaddr, + p_paddr and p_align earlier. Revert 2006-05-19 change to p_align. + (copy_elf_program_header): Copy p_align. Set p_align_valid. + +2006-05-26 H.J. Lu + + * elf64-x86-64.c (ELF_MINPAGESIZE): Changed to 0x1000. + +2006-05-25 H.J. Lu + + * elf64-x86-64.c (ELF_MINPAGESIZE): Set to 0x100000. + +2006-05-25 H.J. Lu + + * elf64-x86-64.c (ELF_MAXPAGESIZE): Updated to 0x200000. + +2006-05-26 Alan Modra + + * elf.c (sym_is_global): Return a bfd_boolean. + (ignore_section_sym): New function. + (elf_map_symbols): Use ignore_section_sym to discard some syms. + (_bfd_elf_symbol_from_bfd_symbol): Ensure section belongs to + bfd before using elf_section_syms. + +2006-05-25 H.J. Lu + + * config.bfd: (sh-*-linux*): Treat as 64bit target. + (sh*l*-*-netbsdelf*): Likewise. + (sh-*-netbsdelf*): Likewise. + (shl*-*-elf*): Likewise. + (sh[1234]l*-*-elf*): Likewise. + (sh3el*-*-elf*): Likewise. + (shl*-*-kaos*): Likewise. + (sh-*-elf*): Likewise. + (sh[1234]*-elf*): Likewise. + (sh-*-rtems*): Likewise. + (sh-*-kaos*): Likewise. + +2006-05-24 H.J. Lu + + PR ld/1485 + * config.bfd: Set want64 to true if 64bit bfd is used. + (sh-*-linux*): Use targ64_selvecs for 64bit targets. + (sh*l*-*-netbsdelf*): Likewise. + (sh-*-netbsdelf*): Likewise. + (shl*-*-elf*): Likewise. + (sh[1234]l*-*-elf*): Likewise. + (sh3el*-*-elf*): Likewise. + (shl*-*-kaos*): Likewise. + (sh-*-elf*): Likewise. + (sh[1234]*-elf*): Likewise. + (sh-*-rtems*): Likewise. + (sh-*-kaos*): Likewise. + +2006-05-24 Paul Brook + + * elf-bfd.h (elf_backend_data): Add elf_backend_output_arch_local_syms + * elf32-arm.c (output_arch_syminfo): Define. + (elf32_arm_ouput_plt_map_sym, elf32_arm_output_plt_map, + elf32_arm_output_arch_local_syms): New functions. + (elf_backend_output_arch_local_syms): Define. + * elflink.c (bfd_elf_final_link): Call + elf_backend_output_arch_local_syms. + * elfxx-target.h (elf_backend_output_arch_local_syms): Provide default + definition. + (elfNN_bed): Add elf_backend_output_arch_local_syms. + +2006-05-24 Paul Brook + + * elf32-arm.c (put_arm_insn, put_thumb_insn): New functions. + (elf32_thumb_to_arm_stub, elf32_arm_to_thumb_stub, + elf32_arm_finish_dynamic_symbol): Use them. + +2006-05-24 Carlos O'Donell + Randolph Chung + + * elf-hppa.h (reloc_hppa_howto_table): Check bitfield for + TPREL21L/TPREL14R relocations. Handle LTOFF_TP14R relocations. + Add handling for TLS relocations. + (elf_hpp_reloc_final_type): Handle TLS relocs. + * elf32-hppa.c: Add authors for cleanup and TLS support. + (hppa_elf_local_got_tls_type, hh_name, eh_name): Define. + (elf32_hppa_link_hash_entry): Add tls_type. + (elf32_hppa_link_hash_table): Add tld_ldm_got. + (hppa_link_has_newfunc): Set tls_type. + (elf32_hppa_link_hash_table_create): Set tls_ldm_got refcount. + (hppa_stub_name): Use hh_name macro. + (elf32_hppa_copy_indirect_symbol): Copy TLS information. + (elf32_hppa_check_relocs): Call elf32_hppa_optimized_tls_reloc. + Handle TLS relocs. + (elf32_hppa_gc_sweep_hook): Likewise. + (allocate_dynrelocs): Handle TLS relocs. + (elf32_hppa_size_dynamic_sections): Count space required by TLS + relocs. Use hh_name macro. + (dtpoff_base): New function. + (tpoff): Likewise. + (elf32_hppa_optimized_tls_reloc): Likewise. + (final_link_relocate): Handle TLS relocs. + (elf32_hppa_relocate_section): Handle TLS relocs. Use eh_name + and hh_name macros. + (elf32_hppa_finish_dynamic_symbol): Setup TLS got entries. Use + hh_name and eh_name macros. + (elf32_hppa_reloc_type_clas): Handle TLS relocs. + +2006-05-24 Bjoern Haase + + * archures.c: Add bfd_mach_avr6. + * cpu-avr.c: Likewise. + * reloc.c (BFD_RELOC_AVR_LO8_LDI_GS, BFD_RELOC_AVR_HI8_LDI_GS): + New relocations. + * libbfd.h: Regenerate. + * bfd-in2.h:Regenerate. + * elf32-avr.h: New file. Protoypes for functions accessed from ld. + * elf32-avr.c: Add elf32-avr.h to include list. + (elf32_avr_stub_hash_entry): New function. + (elf32_avr_link_hash_table): New struct. + (avr_link_hash_table): Likewise. + (avr_stub_hash_entry): Likewise. + (avr_stub_hash_lookup): New function. + (stub_hash_newfunc): New function. + (elf32_avr_link_hash_table_create): New function. + (elf32_avr_link_hash_table_free): New function. + (avr_get_stub_addr): New function. + (debug_relax, debug_stubs): Add new global variables controlling + debugging printout to stdout. + (avr_pc_wrap_around): Change the type to bfd_vma. + (avr_replace_call_ret_sequences): Add a new variable controling + linkrelax optimizations. + (avr_stub_is_required_for_16_bit_reloc): New function. + (avr_final_link_relocate): + Add linker hash table to parameter list. Use stub addr. if necessary. + (elf32_avr_relocate_section): + Add linker hashtable to parameter list of avr_final_link_relocate. + (bfd_elf_avr_final_write_processing): Add support for bfd_mach_avr6. + (elf32_avr_object_p): Add support for E_AVR_MACH_AVR6. + (elf32_avr_relax_delete_bytes): + Iterate over all sections of a bfd when adjusting relocs addends. + (elf32_avr_relax_section): + Evaluate avr_replace_call_ret_sequences and recalculate the size of + stub section. + (avr_stub_name): New function. + (avr_get_stub_entry): New function. + (avr_add_stub): New function. + (avr_build_one_stub): New function. + (avr_size_one_stub): New function. + (elf32_avr_setup_params): New function. + (elf32_avr_setup_section_lists): New function. + (get_local_syms): New function. + (elf32_avr_size_stubs): New function. + (bfd_elf32_bfd_link_hash_table_create): New function. + (bfd_elf32_bfd_link_hash_table_free): New function. + +2006-05-23 H.J. Lu + + PR ld/2655 + PR ld/2657 + * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Properly + update CIE/FDE length. Don't pad to the section alignment. + +2006-05-23 Jie Zhang + + * elf32-bfin.c (bfinfdpic_relocate_section): Clear reloc for + deteted entries in .eh_frame section. + +2006-05-23 Jie Zhang + + * elf32-bfin.c (bfin_check_relocs): Use __GLOBAL_OFFSET_TABLE_ + instead of _GLOBAL_OFFSET_TABLE_. + (bfin_relocate_section): Ditto. + (_bfin_create_got_section): Ditto. + (elf32_bfinfdpic_create_dynamic_sections): Use + __PROCEDURE_LINKAGE_TABLE_ instead of _PROCEDURE_LINKAGE_TABLE_. + (bfin_finish_dynamic_symbol): Use __DYNAMIC instead of _DYNAMIC. + +2006-05-23 Alan Modra + + * elf64-ppc.c (compare_symbols): Prefer strong dynamic global + function syms over other syms. + +2006-05-22 Daniel Jacobowitz + + * elflink.c (_bfd_elf_add_dynamic_entry): Remove DT_TEXTREL + check. + (bfd_elf_final_link): Add a late DT_TEXTREL check. + * elfxx-mips.c (MIPS_ELF_READONLY_SECTION): Define. + (mips_elf_create_dynamic_relocation): Set DF_TEXTREL. + (_bfd_mips_elf_check_relocs): Delete MIPS_READONLY_SECTION. + Use MIPS_ELF_READONLY_SECTION. + (_bfd_mips_elf_size_dynamic_sections): Clear DF_TEXTREL after + creating DT_TEXTREL. + (_bfd_mips_elf_finish_dynamic_sections): Clear textrel markers + if no text relocations were generated. + +2006-05-19 H.J. Lu + + * elfxx-ia64.c (ELF_MAXPAGESIZE): Fix a typo in comment. + +2006-05-19 Alan Modra + + * elf.c (elf_fake_sections): Formatting. + (assign_file_positions_for_load_sections): Only add SEC_ALLOC + sections to p_memsz. Remove hack for PT_NOTE sections. Allow + section alignment to increase p_align for PT_LOAD. + (assign_file_positions_for_non_load_sections): Remove ARM BPABI + hack for PT_DYNAMIC. Instead, set p_filesz for all segments + other than PT_LOAD, and PT_NOTE in core. + +2006-05-17 Alan Modra + + * elf.c (assign_file_positions_for_segments): Split into.. + (assign_file_positions_for_load_sections): ..this, and.. + (assign_file_positions_for_non_load_sections): ..this new function,.. + (assign_file_positions_except_relocs): ..writing program headers here. + +2006-05-17 Alan Modra + + * elflink.c (elf_gc_sweep): Don't specially keep non-alloc, + non-load sections if they have relocs. + +2006-05-15 Paul Brook + + * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Rename ... + (bfd_is_arm_special_symbol_name): ... to this. Add type argument. + Check symbol name is of specified type. + * elf32-arm.c (elf32_arm_is_target_special_symbol, + arm_elf_find_function, elf32_arm_output_symbol_hook): Use + bfd_is_arm_special_symbol_name. + * bfd-in.h (BFD_ARM_SPECIAL_SYM_TYPE_MAP, + BFD_ARM_SPECIAL_SYM_TYPE_TAG, BFD_ARM_SPECIAL_SYM_TYPE_OTHER, + BFD_ARM_SPECIAL_SYM_TYPE_ANY): Define. + (bfd_is_arm_mapping_symbol_name): Remove prototype. + (bfd_is_arm_special_symbol_name): Add prototype. + * bfd-in2.h: Regenerate. + +2006-05-15 David Heine + Bob Wilson + + * elf32-xtensa.c (check_loop_aligned): Fix reversed check for + undefined opcode. Clean up assertions. + (narrow_instruction, widen_instruction): Remove "do_it" parameters. + Factor most of the code into separate functions.... + (can_narrow_instruction, can_widen_instruction): New. + (prev_instr_is_a_loop): New. + (compute_ebb_proposed_actions): Combine error handling code for + decode errors. Replace call to insn_decode_len with inline code. + Use can_narrow_instruction and can_widen_instruction. Handle errors + from call to xtensa_opcode_is_loop. + (relax_section): Adjust calls to narrow_instruction and + widen_instruction. + +2006-05-15 Alan Modra + + PR 2658 + * elf32-ppc.c (ppc_elf_relax_section): Don't segfault on non-pic + -shared link. + +2006-05-11 Michael Matz + + * elflink.c (match_group_member): Correctly iterate group + members. + +2006-05-11 Paul Brook + + * elf32-arm.c (elf32_arm_reloc_map): Add MOVW and MOVT relocs. + (elf32_arm_final_link_relocate): Handle MOVW and MOVT relocs. + (elf32_arm_gc_sweep_hook, elf32_arm_check_relocs): Ditto. + * reloc.c: Ditto. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + +2006-05-11 Mike Bland + + * elf.c (_bfd_elf_init_private_section_data): Don't change + section type if already set. + +2006-05-10 Nick Clifton + + PR ld/2607 + * elfcode.h (valid_section_index_p): New function: Checks for a + valid section index. Allows indicies in the range SHN_LOPROC to + SHN_HIOS. + (elf_object_p): Use valid_section_index_p. + +2006-05-11 Pedro Alves + + * coff-arm.c (ARM_26D, ARM_32, ARM_RVA_32, ARM_SECTION, + ARM_SECREL): Mark WinCE versions of these relocs as partial + inplace. + (coff_arm_relocate_section): Adjust addend for WinCE. + +2006-05-10 Alan Modra + + PR 2342 + * elflink.c (_bfd_elf_default_action_discarded): Revert 2006-02-16. + +2006-05-09 Nick Clifton + + * coffcode.h (coff_write_relocs): Produce an error message if a an + out-of-range symbol index is detected in a reloc. + +2006-05-09 Ben Elliston + + * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Remove unused + local variable `dynobj'. + +2006-05-05 Bjoern Haase + + * elf32-avr.c (elf32_avr_relax_delete_bytes): Iterate over all + of the bfd's sections for the reloc-addend adjustments. + +2006-05-05 Martin Schwidefsky + + * elf32-s390.c (invalid_tls_insn): Call bfd_set_error. + (elf_s390_relocate_section): Add code to do the GD->LE and + LD->LE TLS linker optimizations if a brasl instruction is used + for the __tls_get_offset function call. + * elf64-s390.c (invalid_tls_insn): Call bfd_set_error. + +2006-05-05 Alan Modra + + * elf64-ppc.c (ppc64_elf_tls_optimize): Only optimize + R_PPC64_TPREL64 and R_PPC64_DTPMOD64 relocs when they are in + the .toc and referenced by a TLS code sequence. + (ppc64_elf_edit_toc): Cater for the unlikely situation that + .toc is the first section in a file. + +2006-05-04 Andreas Schwab + + * aoutf1.h (struct external_sparc_core): Declare c_regs as struct + regs instead of an array of int. + (struct external_solaris_bcp_core): Likewise. + (swapcore_sun3): Use offsetof instead of computing the offset + manually. + (swapcore_sparc): Likewise. Simplify reference to c_regs. + (swapcore_solaris_bcp): Likewise. + +2006-05-04 Daniel Jacobowitz + + * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Adjust handling + for missing GOTs. + +2006-05-04 Daniel Jacobowitz + + * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Accept more + mapping symbols. + +2006-05-04 Ben Elliston + + * coff-or32.c (bfd_section_from_shdr): Remove unused local + variable `ptr'. + * cofflink.c (process_embedded_commands): Remove unused local + variables `had_read' and `had_shared'. + * ecofflink.c (bfd_ecoff_debug_accumulate): Remove unused local + variable `fdr_adr'. + * ihex.c (ihex_read_section): Remove unused local variable `addr'. + +2006-05-03 Alan Modra + + * libbfd-in.h (_bfd_generic_new_section_hook): Declare. + * section.c (bfd_abs_symbol, bfd_com_symbol): Delete. + (bfd_und_symbol, bfd_ind_symbol): Delete. + (BFD_FAKE_SECTION): Remove SYM_PTR param, set symbol_ptr_ptr to + &SEC.symbol. + (STD_SECTION): Adjust. + (_bfd_generic_new_section_hook): New function, extracted from.. + (bfd_section_init): ..here. + (bfd_make_section_old_way): Call new_section_hook for abs, com, + und and ind sections. + * elf.c (_bfd_elf_large_com_section): Adjust. + * aoutx.h (new_section_hook): Call _bfd_generic_new_section_hook. + * pdp11.c (new_section_hook): Likewise. + * coffcode.h (coff_new_section_hook): Likewise. + * ecoff.c (_bfd_ecoff_new_section_hook): Likewise. + * elf.c (_bfd_elf_new_section_hook): Likewise. + * vms.c (vms_new_section_hook): Likwise. + * elf32-arm.c (elf32_arm_new_section_hook): Check used_by_bfd isn't + already set. + * elf32-sh64.c (sh64_elf_new_section_hook): Likewise. + * elf32-xtensa.c (elf_xtensa_new_section_hook): Likewise. + * elf64-mmix.c (mmix_elf_new_section_hook): Likewise. + * elf64-ppc.c (ppc64_elf_new_section_hook): Likewise. + * elfxx-mips.c (_bfd_mips_elf_new_section_hook): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_new_section_hook): Likewise. + * ieee.c (ieee_new_section_hook): Likewise. Call + _bfd_generic_new_section_hook too. + * mmo.c (mmo_new_section_hook): Likewise. + * oasys.c (oasys_new_section_hook): Likewise. + * som.c (som_new_section_hook): Likewise. + * coff-w65.c (reloc_processing): Don't use bfd_abs_symbol. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2006-05-03 Alan Modra + + * hash.c (DEFAULT_SIZE): Revert last change. + (higher_prime_number): Correct test for no larger prime. Don't + abort on error, instead return 0. Depopulate primes[]. + (bfd_hash_lookup): If we overflow size, refuse to grow table. + +2006-05-02 Paul Brook + + * elf32-arm.c (elf32_arm_final_link_relocate): Set thumb funciton bit + for R_ARM_REL32. + +2006-05-02 Ben Elliston + + * archive.c (bfd_generic_archive_p): Remove unused local variable + `fail'. + * dwarf2.c (decode_line_info): Remove unused local variable + `basic_block'. + * elfcode.h (elf_slurp_reloc_table_from_section): Remove unused + local variable `s'. + * tekhex.c (tekhex_write_object_contents): Remove unused local + variable `bytes_written'. + * aout-ns32k.c (MY_swap_std_reloc_out): Remove unused local + variable `r_addend'. + * elf32-dlx.c (dlx_rtype_to_howto): Remove breaks after returns. + * elfxx-mips.c (_bfd_elf_mips_mach): Remove breaks after returns. + (_bfd_ns32k_relocate_contents): Remove break after return. + * elf.c (bfd_section_from_shdr): Remove breaks after returns. + +2006-05-02 Nick Clifton + + * elf32-sh-symbian.c: Rename local define DEBUG to SYMBIAN_DEBUG + in order to avoid conflicts with the global DEBUG define. + +2006-05-02 Alan Modra + + * dwarf2.c: Formatting. + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Simplify + output section check. + * elf32-i370.c: Warning fixes inside #ifdef DEBUG. + * elf32-m32c.c: Similarly. + * elf32-ppc.c: Similarly. + * elf32-v850.c: Similarly. + * nlm32-sparc.c: Similarly. + * elfcode.h: Similarly. + (elf_symbol_flags): Delete. + * elflink.c (elf_link_input_bfd): Comment typo. + +2006-05-01 DJ Delorie + + * bfd-in.h (bfd_hash_table): Add count field. + * bfd-in2.h: Regenerate. + * hash.c (higher_prime_number): New. + (bfd_hash_table_inint_n): Init count field. + (bfd_hash_lookup): Grow table as needed. + +2006-04-27 Kaz Kojima + + PR binutils/2584 + * tekhex.c (getvalue): Change return type to bfd_boolean and + add the new parameter. Return false if the unexpected character + is found. + (getsym): Likewise. + (first_phase): Change return type to bfd_boolean and return + false if the unexpected character is found. Replace abort + with returning false. + (pass_over): Change return type to bfd_boolean and the type of + the second argument to bfd_boolean (*) (bfd *, int, char *). + Return false if FUNC returns false. + (tekhex_object_p): Return NULL if pass_over fails. + +2006-04-27 Alan Modra + + * coff-rs6000.c (xcoff_write_archive_contents_old): Warning fix. + +2006-04-26 H.J. Lu + + PR binutils/2593 + * elf.c (_bfd_elf_new_section_hook): Don't set section ELF type + and flags if its BFD flags have been set. + (_bfd_elf_init_private_section_data): Don't copy the output ELF + section type from input if it has been set to something + different. + +2006-04-25 H.J. Lu + + PR binutils/2467 + * elf.c (_bfd_elf_close_and_cleanup): Check elf_tdata (abfd) + is NULL first. + + * elf32-arm.c (elf32_arm_close_and_cleanup): Check if + abfd->sections is NULL. + (elf32_arm_bfd_free_cached_info): New. + (bfd_elf32_bfd_free_cached_info): Defined. + + * elfxx-target.h (bfd_elfNN_bfd_free_cached_info): Default it + to _bfd_free_cached_info. + + * libbfd-in.h (_bfd_free_cached_info): New. + * libbfd: Regenerated. + + * opncls.c (_bfd_delete_bfd): Check if abfd->memory is NULL. + (_bfd_free_cached_info): New. + +2006-04-21 Alan Modra + + * elf.c (assign_file_positions_except_relocs): Move code setting + file position of non-loaded sections.. + (assign_file_positions_for_segments): ..to here. + +2006-04-20 H.J. Lu + + PR ld/2537 + * elf.c (bfd_section_from_shdr): Allow sections reserved for + applications. Issue an error on sections we don't know how + to handle. + +2006-04-19 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2006-04-19 Alan Modra + + * warning.m4 (--enable-werror): Format help message. + (--enable-build-warnings): Likewise. + * configure: Regenerate. + +2006-04-18 Nick Clifton + + PR 2257 + * elfcode.h (elf_object_p): Allow files with corrupt e_shstrndx + fields to still be handled as ELF files. + +2006-04-16 Daniel Jacobowitz + + * po/SRC-POTFILES.in: Regenerated. + +2006-04-16 Daniel Jacobowitz + + * configure.in: Update version to 2.17.50. + * configure: Regenerated. + +2006-04-14 David Heine + + * elf32-xtensa.c (build_reloc_opcodes): New. + (compute_text_actions): Use it to decode opcodes outside inner loop. + (check_section_ebb_pcrels_fit): Add "reloc_opcodes" argument, and if + it is set, use it to get the opcodes for relocations. + (move_shared_literal): Adjust call to check_section_ebb_pcrels_fit. + +2006-04-08 H.J. Lu + + PR ld/2513 + * elf32-i386.c (GOT_TLS_MASK): New macro for tls_type. + (GOT_TLS_IE_IE): Likewise. + (GOT_TLS_IE_GD): Likewise. + (GOT_TLS_IE_MASK): Likewise. + (elf_i386_check_relocs): For global symbols, set GOT_TLS_IE_GD + and GOT_TLS_IE_IE for R_386_TLS_GD and R_386_TLS_IE + respectively. + (allocate_dynrelocs): If both GOT_TLS_IE_IE and GOT_TLS_IE_GD + are set, treat tls_type as GOT_TLS_IE_BOTH. + (elf_i386_relocate_section): Likewise. + +2006-04-07 Randolph Chung + + * elf64-hppa.c (elf64_hppa_grok_prstatus): New function. + (elf64_hppa_grok_psinfo): Likewise. + (elf_backend_grok_pstatus, elf_backend_grok_psinfo): Define. + +2006-04-06 DJ Delorie + + * elf32-m32c.c (m32c_elf_relocate_section): Generate a symbol for + each plt entry we create. + +2006-04-06 Carlos O'Donell + + * po/Make-in: Add install-html target. + * Makefile.am: Rename docdir to bfddocdir. Add datarootdir, docdir + htmldir. Add install-html and install-html-recursive targets. + * Makefile.in: Regenerate. + * configure.in: AC_SUBST for datarootdir, docdir and htmldir. + * configure: Regenerate. + +2006-04-06 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relax_section): Skip unneeded passes + with the skip_relax_pass_0 and skip_relax_pass_1 bits in the + section structure. + +2006-04-05 Bernd Schmidt + + * elf32-bfin.c (bfinfdpic_relocs_info_hash): Sprinkle casts to + eliminate warnings. + +2006-04-05 H.J. Lu + James E Wilson + + PR ld/2442 + * elfxx-ia64.c (elfNN_ia64_dyn_sym_info): Remove next. + (elfNN_ia64_local_hash_entry): Add count, sorted_count and + size. + (elfNN_ia64_link_hash_entry): Likewise. + (elfNN_ia64_new_elf_hash_entry): Initialize count, sorted_count + and size. + (elfNN_ia64_hash_copy_indirect): Updated elfNN_ia64_dyn_sym_info + processing. + (elfNN_ia64_hash_hide_symbol): Likewise. + (elfNN_ia64_global_dyn_sym_thunk): Likewise. + (elfNN_ia64_local_dyn_sym_thunk): Likewise. + (elfNN_ia64_global_dyn_info_free): New function. + (elfNN_ia64_local_dyn_info_free): Likewise. + (elfNN_ia64_hash_table_free): Free local and global + elfNN_ia64_dyn_sym_info. + (addend_compare): New function. + (sort_dyn_sym_info): Likewise. + (get_dyn_sym_info): Updated to use binary search for addend. + (elfNN_ia64_check_relocs): Scan relocations to create dynamic + relocation arrays first. + +2006-04-05 Bernd Schmidt + + * elf32-bfin.c (_bfin_create_got_section): Don't generate a _gp + symbol. + +2006-04-05 H.J. Lu + + PR ld/2411 + * elflink.c (check_dynsym): New. + (elf_link_output_extsym): Use it. + (bfd_elf_final_link): Likewise. + +2006-04-05 H.J. Lu + + PR ld/2404 + * elflink.c (_bfd_elf_merge_symbol): Skip the default indirect + symbol from the dynamic definition with the default version if + its type and the type of existing regular definition mismatch. + +2006-04-05 Richard Sandiford + Daniel Jacobowitz + + * config.bfd (sparc-*-vxworks*): New stanza. + * configure.in (bfd_elf32_sparc_vxworks_vec): New stanza. + (bfd_elf32_sparc_vec, bfd_elf64_sparc_vec): Add elf-vxworks.lo. + * configure: Regenerate. + * elf32-sparc.c: Include elf-vxworks.h. + (elf32_sparc_vxworks_link_hash_table_create: New. + (elf32_sparc_vxworks_final_write_processing): New. + (TARGET_BIG_SYM): Override for VxWorks. + (TARGET_BIG_NAME, ELF_MINPAGESIZE): Likewise. + (bfd_elf32_bfd_link_hash_table_create): Likewise. + (elf_backend_want_got_plt, elf_backend_plt_readonly): Likewise. + (elf_backend_got_header_size, elf_backend_add_symbol_hook): Likewise. + (elf_backend_link_output_symbol_hook): Likewise. + (elf_backend_emit_relocs): Likewise. + (elf_backend_final_write_processing, elf32_bed): Likewise. + * elfxx-sparc.c: Include libiberty.h and elf-vxworks.h. + (sparc_vxworks_exec_plt0_entry, sparc_vxworks_exec_plt_entry): New. + (sparc_vxworks_shared_plt0_entry, sparc_vxworks_shared_plt_entry): New. + (_bfd_sparc_elf_link_hash_table_create): Don't initialize + build_plt_entry here. + (create_got_section): Initialize sgotplt for VxWorks. + (_bfd_sparc_elf_create_dynamic_sections): Initialize build_plt_entry, + plt_header_size and plt_entry_size, with new VxWorks-specific settings. + Call elf_vxworks_create_dynamic_sections for VxWorks. + (allocate_dynrelocs): Use plt_header_size and plt_entry_size. + Allocate room for .got.plt and .rela.plt.unloaded entries on VxWorks. + (_bfd_sparc_elf_size_dynamic_sections): Don't allocate a nop in .plt + for VxWorks. Check for the .got.plt section. + (sparc_vxworks_build_plt_entry): New function. + (_bfd_sparc_elf_finish_dynamic_symbol): Add handling of VxWorks PLTs. + Don't make _GLOBAL_OFFSET_TABLE_ and _PROCEDURE_LINKAGE_TABLE_ + absolute on VxWorks. + (sparc32_finish_dyn): Add special handling for DT_RELASZ + and DT_PLTGOT on VxWorks. + (sparc_vxworks_finish_exec_plt): New. + (sparc_vxworks_finish_shared_plt): New. + (_bfd_sparc_elf_finish_dynamic_sections): Call them. + Use plt_header_size and plt_entry_size. + * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add is_vxworks, + srelplt2, sgotplt, plt_header_size and plt_entry_size fields. + * Makefile.am (elfxx-sparc.lo): Depend on elf-vxworks.h. + (elf32-sparc.lo): Likewise. + * Makefile.in: Regenerate. + * targets.c (bfd_elf32_sparc_vxworks_vec): Declare. + (_bfd_target_vector): Add a pointer to it. + +2006-03-30 Ben Elliston + + PR ld/2267 + * elflink.c (elf_fixup_link_order): Ensure `elfsec' is not a + special section number that exceeds the number of ELF sections + (eg. SHN_MIPS_SCOMMON). + +2006-03-27 Richard Sandiford + + * elfxx-mips.c (mips_got_entry): Add more commentary. + (mips_elf_local_got_index): Use the hash table entry to record + the GOT index of forced-local symbols. + (mips_elf_initialize_tls_index): Rearrange code. Store the index + in either the hash table entry or the mips_got_entry, not both. + Add more commentary. + (mips_elf_multi_got): Make sure the g->next is nonnull when calling + mips_elf_initialize_tls_index. + +2006-03-25 Bernd Schmidt + + * elf32-bfin.c (bfd_const_reloc, bfd_oper_reloc, bfin_push_reloc, + RELOC_STACK_SIZE, reloc_stack, reloc_stack_tos, is_reloc_stack_empty, + reloc_stack_push, reloc_stack_pop, reloc_stack_operate, + bfin_areloc_howto_table): Delete. All + uses deleted as well. + (bfin_reloc_map): Delete all stack relocs. + (bfin_info_to_howto, bfin_bfd_reloc_type_lookup, + bfin_reloc_type_lookup): Don't support them. + (bfin_relocate_section): Don't try to handle them. + + * config.bfd (bfin-*-*): Add bfd_elf32_bfinfdpic_vec. + * configure.in: Likewise. + * configure: Regenerate. + * elf32-bfin.c: Include "elf/dwarf2.h" and "hashtab.h". + (BFIN_RELOC_MAX): Now 0x21. + (bfin_howto_table, bfin_reloc_map): Add FD-PIC relocs. + (bfd_elf32_bfinfdpic_vec): Declare. + (IS_FDPIC): New macro. + (struct bfinfdpic_elf_link_hash_table): New struct. + (bfinfdpic_hash_table, bfinfdpic_got_section, + bfinfdpic_gotrel_section, bfinfdpic_gotfixup_section, + bfinfdpic_plt_setion, bfinfdpic_pltrel_section, + bfinfdpic_relocs_info, bfinfdpic_got_initial_offset, + bfinfdpic_plt_initial_offset): Accessor macros for it. + (BFINFDPIC_SYM_LOCAL, BFINFDPIC_FUNCDESC_LOCAL): New macros. + (struct bfinfdpic_relocs_info): New struct. + (LZPLT_RESOLVER_EXTRA, LZPLT_NORMAL_SIZE, LZPLT_ENTRIES, + BFINFDPIC_LZPLT_BLOCK_SIZE, BFINFDPIC_LZPLT_RESOLV_LOC, + DEFAULT_STACK_SIZE): New macros. + (bfinfdpic_elf_link_hash_table_create, bfinfdpic_relocs_info_hash, + bfinfdpic_relocs_info_eq, bfinfdpics_relocs_info_find, + bfinfdpic_relocs_info_for_global, bfinfdpic_relocs_info_for_local, + bfinfdpic_pic_merge_early_relocs_info, _bfinfdpic_add_dyn_reloc, + _bfinfdpic_add_rofixup, _bfinfdpic_osec_to_segment, + _bfinfdpic_osec_readonly_p, bfinfdpic_relocate_section, + bfinfdpic_check_relocs, bfinfdpic_gc_sweep_hook, + _bfinfdpic_link_omit_section_dynsym, _bfin_create_got_section, + elf32_bfinfdpic_create_dynamic_sections, _bfinfdpic_get_fd_entry, + _bfinfdpic_compute_got_alloc_data, _bfinfdpic_get_got_entry, + _bfinfdpic_assign_got_entries, _bfinfdpic_assign_plt_entries, + _bfinfdpic_resolve_final_relocs_info, + elf32_bfinfdpic_size_dynamic_sections, + elf32_bfinfdpic_always_size_sections, + elf32_bfinfdpic_modify_segment_map, + _bfinfdpic_count_got_plt_entries, + elf32_bfinfdpic_finish_dynamic_sections, + elf32_bfinfdpic_adjust_dynamic_symbol, + elf32_bfinfdpic_finish_dynamic_symbol, + elf32_bfinfdpic_elf_use_relative_eh_frame, + elf32_bfinfdpic_elf_encode_eh_address, + elf32_bfin_object_p, bfin_elf_copy_private_bfd_data, + elf32_bfinfdpic_copy_private_bfd_data, + (struct _bfinfdpic_dynamic_got_info, + struct _bfinfdpic_dynamic_got_plt_info): New structs. + (elf32_bfin_print_private_bfd_data): Print PIC flags. + (elf32_bfin_merge_private_bfd_data): Extend to support FD-PIC. + (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, elf32_bed, + elf_backend_got_header_size, bfd_elf32_bfd_link_hash_table_create, + elf_backend_always_size_sectinos, elf_backend_modify_segment_map, + bfd_elf32_bfd_copy_private_bfd_data, + elf_backend_create_dynamic_sections, elf_backend_adjust_dynamic_symbol, + elf_backend_size_dynamic_sections, elf_backend_finish_dynamic_symbol, + elf_backend_finish_dynamic_sections, elf_backend_relocate_section, + elf_backend_can_make_relative_eh_frame, elf_backend_check_relocs, + elf_backend_can_make_ldsa_relative_eh_frame, elf_backend_may_use_rel_p, + elf_backend_may_use_rela_p, elf_backend_default_use_rela_p, + elf_backend_omit_section_dynsym): Redefine these macros and include + "elf32-target.h" again to create the elf32-bfinfdpic target. + * reloc.c (BFD_RELOC_BFIN_GOT17M4, BFD_RELOC_BFIN_GOTHI, + BFD_RELOC_BFIN_GOTLO, BFD_RELOC_BFIN_FUNCDESC, + BFD_RELOC_BFIN_FUNCDESC_GOT17M4, BFD_RELOC_BFIN_FUNCDESC_GOTHI, + BFD_RELOC_BFIN_FUNCDESC_GOTLO, BFD_RELOC_BFIN_FUNCDESC_VALUE, + BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4, BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI, + BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO, BFD_RELOC_BFIN_GOTOFFHI, + BFD_RELOC_BFIN_GOTOFFLO): New. + * targets.c (bfd_elf32_bfinfdpic_vec): New bfd_target. + (_bfd_target_vector): Add it. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2006-03-25 Richard Sandiford + + * cpu-m68k.c (bfd_m68k_compatible): Treat ISA A+ and ISA B code as + incompatible. Likewise MAC and EMAC code. + * elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Use + bfd_get_compatible to set the new bfd architecture. Rely on it + to detect incompatibilities. + +2006-03-23 Michael Matz + + * reloc.c: Add BFD_RELOC_X86_64_GOT64, BFD_RELOC_X86_64_GOTPCREL64, + BFD_RELOC_X86_64_GOTPC64, BFD_RELOC_X86_64_GOTPLT64, + BFD_RELOC_X86_64_PLTOFF64. + * bfd-in2.h: Regenerated. + * libbfd.h: Regenerated. + * elf64-x86-64.c (x86_64_elf_howto_table): Correct comment. + Add howtos for above relocs. + (x86_64_reloc_map): Add mappings for new relocs. + (elf64_x86_64_check_relocs): R_X86_64_GOT64, R_X86_64_GOTPCREL64, + R_X86_64_GOTPLT64 need a got entry. R_X86_64_GOTPLT64 also a PLT + entry. R_X86_64_GOTPC64 needs a .got section. R_X86_64_PLTOFF64 + needs a PLT entry. + (elf64_x86_64_gc_sweep_hook): Reflect changes from + elf64_x86_64_check_relocs for the new relocs. + (elf64_x86_64_relocate_section): Handle new relocs. + +2006-03-22 Bob Wilson + + * elf32-xtensa.c (xtensa_read_table_entries): Remove assertion that + rel->r_addend is zero. + +2006-03-22 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Fix type + of "loc". + +2006-03-22 Richard Sandiford + Daniel Jacobowitz + Phil Edwards + Zack Weinberg + Mark Mitchell + Nathan Sidwell + + * bfd-in2.h: Regenerate. + * config.bfd (mips*-*-vxworks*, mips*el-*-vxworks*): New stanzas. + * configure.in (bfd_elf32_bigmips_vxworks_vec): New stanza. + (bfd_elf32_littlemips_vxworks_vec): Likewise. + (bfd_elf32_bigmips_vec): Add elf-vxworks.lo. + (bfd_elf32_littlemips_vec): Likewise. + (bfd_elf32_nbigmips_vec): Likewise. + (bfd_elf32_nlittlemips_vec): Likewise. + (bfd_elf32_ntradbigmips_vec): Likewise. + (bfd_elf32_ntradlittlemips_vec): Likewise. + (bfd_elf32_tradbigmips_vec): Likewise. + (bfd_elf32_tradlittlemips_vec): Likewise. + (bfd_elf64_bigmips_vec): Likewise. + (bfd_elf64_littlemips_vec): Likewise. + (bfd_elf64_tradbigmips_vec): Likewise. + (bfd_elf64_tradlittlemips_vec): Likewise. + * elf32-mips.c: Include elf-vxworks.h. + (mips_info_to_howto_rel): Use elf_backend_mips_rtype_to_howto + instead of calling mips_elf32_rtype_to_howto directly. + (mips_vxworks_copy_howto_rela): New reloc howto. + (mips_vxworks_jump_slot_howto_rela): Likewise. + (mips_vxworks_bfd_reloc_type_lookup): New function. + (mips_vxworks_rtype_to_howto): Likewise. + (mips_vxworks_final_write_processing): Likewise. + (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Override for VxWorks. + (TARGET_BIG_SYM, TARGET_BIG_NAME, elf_bed, ELF_MAXPAGESIZE): Likewise. + (elf_backend_want_got_plt): Likewise. + (elf_backend_want_plt_sym): Likewise. + (elf_backend_got_symbol_offset): Likewise. + (elf_backend_want_dynbss): Likewise. + (elf_backend_may_use_rel_p): Likewise. + (elf_backend_may_use_rela_p): Likewise. + (elf_backend_default_use_rela_p): Likewise. + (elf_backend_got_header_size: Likewise. + (elf_backend_plt_readonly): Likewise. + (bfd_elf32_bfd_reloc_type_lookup): Likewise. + (elf_backend_mips_rtype_to_howto): Likewise. + (elf_backend_adjust_dynamic_symbol): Likewise. + (elf_backend_finish_dynamic_symbol): Likewise. + (bfd_elf32_bfd_link_hash_table_create): Likewise. + (elf_backend_add_symbol_hook): Likewise. + (elf_backend_link_output_symbol_hook): Likewise. + (elf_backend_emit_relocs): Likewise. + (elf_backend_final_write_processing: Likewise. + (elf_backend_additional_program_headers): Likewise. + (elf_backend_modify_segment_map): Likewise. + (elf_backend_symbol_processing): Likewise. + * elfxx-mips.c: Include elf-vxworks.h. + (mips_elf_link_hash_entry): Add is_relocation_target and + is_branch_target fields. + (mips_elf_link_hash_table): Add is_vxworks, srelbss, sdynbss, srelplt, + srelplt2, sgotplt, splt, plt_header_size and plt_entry_size fields. + (MIPS_ELF_RELA_SIZE, MIPS_ELF_REL_DYN_NAME): New macros. + (MIPS_RESERVED_GOTNO): Take a mips_elf_link_hash_table argument. + Return 3 for VxWorks. + (ELF_MIPS_GP_OFFSET): Change the argument from a bfd to a + mips_elf_link_hash_table. Return 0 for VxWorks. + (MIPS_ELF_GOT_MAX_SIZE): Change the argument from a bfd to a + mips_elf_link_hash_table. Update the call to ELF_MIPS_GP_OFFSET. + (mips_vxworks_exec_plt0_entry): New variable. + (mips_vxworks_exec_plt_entry): Likewise. + (mips_vxworks_shared_plt0_entry): Likewise. + (mips_vxworks_shared_plt_entry): Likewise. + (mips_elf_link_hash_newfunc): Initialize the new hash_entry fields. + (mips_elf_rel_dyn_section): Change the bfd argument to a + mips_elf_link_hash_table. Use MIPS_ELF_REL_DYN_NAME to get + the name of the section. + (mips_elf_initialize_tls_slots): Update the call to + mips_elf_rel_dyn_section. + (mips_elf_gotplt_index): New function. + (mips_elf_local_got_index): Add an input_section argument. + Update the call to mips_elf_create_local_got_entry. + (mips_elf_got_page): Likewise. + (mips_elf_got16_entry): Likewise. + (mips_elf_create_local_got_entry): Add bfd_link_info and input_section + arguments. Create dynamic relocations for each entry on VxWorks. + (mips_elf_merge_gots): Update the use of MIPS_ELF_GOT_MAX_SIZE. + (mips_elf_multi_got): Update the uses of MIPS_ELF_GOT_MAX_SIZE + and MIPS_RESERVED_GOTNO. + (mips_elf_create_got_section): Update the uses of + MIPS_ELF_GOT_MAX_SIZE. Create .got.plt on VxWorks. + (is_gott_symbol): New function. + (mips_elf_calculate_relocation): Use a dynobj local variable. + Update the calls to mips_elf_local_got_index, mips_elf_got16_entry and + mips_elf_got_page_entry. Set G to the .got.plt entry when calculating + VxWorks R_MIPS_CALL* relocations. Calculate and use G for all GOT + relocations on VxWorks. Add dynamic relocations for references + to the VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols. Don't + create dynamic relocations for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 + in VxWorks executables. + (mips_elf_allocate_dynamic_relocations): Add a bfd_link_info argument. + Use MIPS_ELF_RELA_SIZE to calculate the size of a VxWorks entry. + Don't allocate a null entry on VxWorks. + (mips_elf_create_dynamic_relocation): Update the call to + mips_elf_rel_dyn_section. Use absolute rather than relative + relocations for VxWorks, and make them RELA rather than REL. + (_bfd_mips_elf_create_dynamic_sections): Don't make .dynamic + read-only on VxWorks. Update the call to mips_elf_rel_dyn_section. + Create the .plt, .rela.plt, .dynbss and .rela.bss sections on + VxWorks. Likewise create the _PROCEDURE_LINKAGE_TABLE symbol. + Call elf_vxworks_create_dynamic_sections for VxWorks and + initialize the plt_header_size and plt_entry_size fields. + (_bfd_mips_elf_check_relocs): Don't allow GOT relocations to be + used in VxWorks executables. Don't allocate dynamic relocations + for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 in VxWorks executables. + Set is_relocation_target for each symbol referenced by a relocation. + Allocate .rela.dyn entries for relocations against the special + VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols. Create GOT + entries for all VxWorks R_MIPS_GOT16 relocations. Don't allocate + a global GOT entry for symbols mentioned in VxWorks R_MIPS_CALL*, + R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 relocations. Update the calls + to mips_elf_rel_dyn_section and mips_elf_allocate_dynamic_relocations. + Set is_branch_target for symbols mentioned in R_MIPS_PC16 or R_MIPS_26 + relocations. Don't set no_fn_stub on VxWorks. + (_bfd_mips_elf_adjust_dynamic_symbol): Update the call to + mips_elf_allocate_dynamic_relocations. + (_bfd_mips_vxworks_adjust_dynamic_symbol): New function. + (_bfd_mips_elf_always_size_sections): Do not allocate GOT page + entries for VxWorks, and do not create multiple GOTs. + (_bfd_mips_elf_size_dynamic_sections): Use MIPS_ELF_REL_DYN_NAME. + Handle .got specially for VxWorks. Update the uses of + MIPS_RESERVED_GOTNO and mips_elf_allocate_dynamic_relocations. + Check for sgotplt and splt. Allocate the .rel(a).dyn contents last, + once its final size is known. Set DF_TEXTREL for VxWorks. Add + DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL, DT_PLTRELSZ and DT_JMPREL + tags on VxWorks. Do not add the MIPS-specific tags for VxWorks. + (_bfd_mips_vxworks_finish_dynamic_symbol): New function. + (mips_vxworks_finish_exec_plt): Likewise. + (mips_vxworks_finish_shared_plt): Likewise. + (_bfd_mips_elf_finish_dynamic_sections): Remove an unncessary call + to mips_elf_rel_dyn_section. Use a VxWorks-specific value of + DT_PLTGOT. Handle DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL, + DT_PLTRELSZ and DT_JMPREL. Update the uses of MIPS_RESERVED_GOTNO + and mips_elf_rel_dyn_section. Use a different GOT header for + VxWorks. Don't sort .rela.dyn on VxWorks. Finish the PLT on VxWorks. + (_bfd_mips_elf_link_hash_table_create): Initialize the new + mips_elf_link_hash_table fields. + (_bfd_mips_vxworks_link_hash_table_create): New function. + (_bfd_mips_elf_final_link): Set the GP value to _GLOBAL_OFFSET_TABLE_ + on VxWorks. Update the call to ELF_MIPS_GP_OFFSET. + * elfxx-mips.h (_bfd_mips_vxworks_adjust_dynamic_symbol): Declare. + (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise. + (_bfd_mips_vxworks_link_hash_table_create): Likewise. + * libbfd.h: Regenerate. + * Makefile.am (elfxx-mips.lo): Depend on elf-vxworks.h. + (elf32-mips.lo): Likewise. + * Makefile.in: Regenerate. + * reloc.c (BFD_RELOC_MIPS_COPY, BFD_RELOC_MIPS_JUMP_SLOT): Declare. + * targets.c (bfd_elf32_bigmips_vxworks_vec): Declare. + (bfd_elf32_littlemips_vxworks_vec): Likewise. + (_bfd_target_vector): Add entries for them. + +2006-03-19 John David Anglin + + * elf64-hppa.c (elf64_hppa_special_sections): Change flags for .tbss + section from SHF_PARISC_WEAKORDER to SHF_HP_TLS. + (elf_backend_special_sections): Remove #undef. + +2006-03-18 John David Anglin + + * elf64-hppa.c (allocate_global_data_opd): Don't create an OPD entry + for undefined weak symbols. + +2006-03-17 Daniel Jacobowitz + + PR ld/2462 + * elflink.c (bfd_elf_final_link): Remove + bed->elf_backend_emit_relocs from emit_relocs. + +2006-03-17 Alexandre Oliva + + * elf32-ppc.c (ppc_elf_relocate_section): Copy addend from + first relocation to the second when relaxing TLS GD to LE; + zero it out when relaxing to IE. + +2006-03-17 Alan Modra + + PR 2434 + * elflink.c (elf_link_add_object_symbols): Save and restore + warning sym's linked sym. + +2006-03-16 Alan Modra + + PR 2434 + * elflink.c (struct elf_smash_syms_data, elf_smash_syms): Delete. + (elf_link_add_object_symbols): Delete unnecessary locals. Rename + hash_table -> htab. Formatting. Save entire symbol table + before loading as-needed syms, and restore afterwards if lib not + needed. Use bfd_hash_allocate rather than bfd_alloc for sym + name. Free some buffers earlier. + * bfd-in.h (struct bfd_hash_table): Add entsize. + (bfd_hash_table_init, bfd_hash_table_init_n): Adjust prototype. + * elf-bfd.h (_bfd_elf_link_hash_table_init): Likewise + * hash.c (bfd_hash_table_init_n): Add entsize param, save to + hash table. + (bfd_hash_table_init): Add param, adjust calls. + * aoutx.h: Adjust all hash_table_init functions and calls. + * bfd.c: Likewise. + * coff-arm.c: Likewise. + * coff-h8300.c: Likewise. + * coff-ppc.c: Likewise. + * cofflink.c: Likewise. + * ecoff.c: Likewise. + * ecofflink.c: Likewise. + * elf-m10300.c: Likewise. + * elf-strtab.c: Likewise. + * elf.c: Likewise. + * elf32-arm.c: Likewise. + * elf32-bfin.c: Likewise. + * elf32-cris.c: Likewise. + * elf32-frv.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68hc1x.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-vax.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sh64.c: Likewise. + * elf64-x86-64.c: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + * elfxx-sparc.c: Likewise. + * i386linux.c: Likewise. + * libaout.h: Likewise. + * libbfd-in.h: Likewise. + * libcoff-in.h: Likewise. + * linker.c: Likewise. + * m68klinux.c: Likewise. + * merge.c: Likewise. + * opncls.c: Likewise. + * pdp11.c: Likewise. + * sparclinux.c: Likewise. + * stabs.c: Likewise. + * sunos.c: Likewise. + * vms.c: Likewise. + * xcofflink.c: Likewise. + * section.c (struct section_hash_entry): Move to.. + * libbfd-in.h: ..here. + * Makefile.am: Run "make dep-am" + * Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + +2006-03-16 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): REL24 and REL14 relocs + against __GLOBAL_OFFSET_TABLE__ need never be dynamic. Tweak + last change to REL32 relocs so that they are counted as + possibly dynamic as per REL24 and REL14. + +2006-03-16 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): Don't fall into REL24 + checks from REL32. + +2006-03-15 Ben Elliston + + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Iterate over all + in_list elements, not just the first. + +2006-03-14 Richard Sandiford + + * elf32-mips.c (mips_elf_adjust_addend): New function, mostly split + out from... + (_bfd_mips_elf_relocate_section): ...here. Use it to adjust r_addend + for final links too. + +2006-03-13 Richard Sandiford + + * elfxx-mips.c (mips_elf_create_got_section): Initialize hgot. + +2006-03-11 H.J. Lu + + PR ld/2443 + * dwarf2.c (concat_filename): Don't issue an error if file is 0. + +2006-03-10 Paul Brook + + * elf32-arm.c (INTERWORK_FLAG): Handle EABIv5. + (elf32_arm_print_private_bfd_data): Ditto. + +2006-03-09 Paul Brook + + * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Recognise additional + mapping symbols. + +2006-03-09 Khem Raj + + * elf32-arm.c(elf32_arm_finish_dynamic_sections): Use unsigned + char type. + +2006-03-08 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_choose_gp): Properly choose gp. + +2006-03-07 Richard Sandiford + Daniel Jacobowitz + Zack Weinberg + Nathan Sidwell + Paul Brook + Ricardo Anguiano + Phil Edwards + + * configure.in (bfd_elf32_bigarm_vec): Include elf-vxworks.lo. + (bfd_elf32_bigarm_symbian_vec): Likewise. + (bfd_elf32_bigarm_vxworks_vec): Likewise. + (bfd_elf32_littlearm_vec): Likewise. + (bfd_elf32_littlearm_symbian_vec): Likewise. + (bfd_elf32_littlearm_vxworks_vec): Likewise. + * configure: Regenerate. + * elf32-arm.c: Include libiberty.h and elf-vxworks.h. + (RELOC_SECTION, RELOC_SIZE, SWAP_RELOC_IN, SWAP_RELOC_OUT): New macros. + (elf32_arm_vxworks_bed): Add forward declaration. + (elf32_arm_howto_table_1): Fix the masks for R_ASM_ABS12. + (elf32_arm_vxworks_exec_plt0_entry): New table. + (elf32_arm_vxworks_exec_plt_entry): Likewise. + (elf32_arm_vxworks_shared_plt_entry): Likewise. + (elf32_arm_link_hash_table): Add vxworks_p and srelplt2 fields. + (reloc_section_p): New function. + (create_got_section): Use RELOC_SECTION. + (elf32_arm_create_dynamic_sections): Likewise. Call + elf_vxworks_create_dynamic_sections for VxWorks targets. + Choose between the two possible values of plt_header_size + and plt_entry_size. + (elf32_arm_link_hash_table_create): Initialize vxworks_p and srelplt2. + (elf32_arm_abs12_reloc): New function. + (elf32_arm_final_link_relocate): Call it. Allow the creation of + dynamic R_ARM_ABS12 relocs on VxWorks. Use reloc_section_p, + RELOC_SIZE, SWAP_RELOC_OUT and RELOC_SECTION. Initialize the + r_addend fields of relocs. On rela targets, skip any code that + adjusts in-place addends. When using _bfd_link_final_relocate + to perform a final relocation, pass rel->r_addend as the addend + argument. + (elf32_arm_merge_private_bfd_data): If one of the bfds is a VxWorks + object, ignore flags that are not standard on VxWorks. + (elf32_arm_check_relocs): Allow the creation of dynamic R_ARM_ABS12 + relocs on VxWorks. Use reloc_section_p. + (elf32_arm_adjust_dynamic_symbol): Use RELOC_SECTION and RELOC_SIZE. + (allocate_dynrelocs): Use RELOC_SIZE. Account for the size of + .rela.plt.unloaded relocs on VxWorks targets. + (elf32_arm_size_dynamic_sections): Use RELOC_SIZE. Check for + .rela.plt.unloaded as well as .rel(a).plt. Add DT_RELA* tags + instead of DT_REL* tags on RELA targets. + (elf32_arm_finish_dynamic_symbol): Use RELOC_SECTION, RELOC_SIZE + and SWAP_RELOC_OUT. Initialize r_addend fields. Handle VxWorks + PLT entries. Do not make _GLOBAL_OFFSET_TABLE_ absolute on VxWorks. + (elf32_arm_finish_dynamic_sections): Use RELOC_SECTION, RELOC_SIZE + and SWAP_RELOC_OUT. Initialize r_addend fields. Handle DT_RELASZ + like DT_RELSZ. Handle the VxWorks form of initial PLT entry. + Correct the .rela.plt.unreloaded symbol indexes. + (elf32_arm_output_symbol_hook): Call the VxWorks version of this + hook on VxWorks targets. + (elf32_arm_vxworks_link_hash_table_create): Set vxworks_p to true. + Minor formatting tweak. + (elf32_arm_vxworks_final_write_processing): New function. + (elf_backend_add_symbol_hook): Override for VxWorks and reset + for Symbian. + (elf_backend_final_write_processing): Likewise. + (elf_backend_emit_relocs): Likewise. + (elf_backend_want_plt_sym): Likewise. + (ELF_MAXPAGESIZE): Likewise. + (elf_backend_may_use_rel_p): Minor formatting tweak. + (elf_backend_may_use_rela_p): Likewise. + (elf_backend_default_use_rela_p): Likewise. + (elf_backend_rela_normal): Likewise. + * Makefile.in (elf32-arm.lo): Depend on elf-vxworks.h. + +2006-03-06 Nathan Sidwell + + * archures.c (bfd_mach_mcf_isa_a_nodiv, bfd_mach_mcf_isa_b_nousp): + New. Adjust other variants. + (bfd_default_scan): Update. + * bfd-in2.h: Rebuilt. + * cpu-m68k.c: Adjust. + (bfd_m68k_compatible): New. Use it for architectures. + * elf32-m68k.c (elf32_m68k_object_p): Adjust. + (elf32_m68k_merge_private_bfd_data): Adjust. Correct isa-a/b + mismatch. + (elf32_m68k_print_private_bfd_data): Adjust. + * ieee.c (ieee_write_processor): Adjust. + +2006-03-06 Alan Modra + + * dwarf2.c: Formatting. + (add_line_info): Remove outer loop. + +2006-03-05 H.J. Lu + Alan Modra + + PR binutils/2338 + * dwarf2.c (loadable_section): New struct. + (dwarf2_debug): Add loadable_section_count and + loadable_sections. + (new_line_sorts_after): New. + (add_line_info): Use new_line_sorts_after to compare line + addresses. + (check_function_name): Removed. + (unset_sections): New. + (place_sections): New. + (_bfd_dwarf2_find_nearest_line): Updated. Call place_sections + and unset_sections on relocatable files. + (_bfd_dwarf2_find_line): Likewise. + +2006-03-03 Nick Clifton + + * cpu-avr.c: Update to ISO-C90 formatting. + * elf32-avr.c: Likewise. + +2006-03-03 Bjoern Haase + + * elf32-avr.c (avr_reloc_map): Insert BFD_RELOC_AVR_MS8_LDI + and R_AVR_MS8_LDI + (bfd_elf_avr_final_write_processing): Set + EF_AVR_LINKRELAX_PREPARED in e_flags field. + (elf32_avr_relax_section): New function. + (elf32_avr_relax_delete_bytes): New function. + (elf32_avr_get_relocated_section_contents): New function. + (avr_pc_wrap_around): New function. + (avr_relative_distance_considering_wrap_around): New function. + (avr_final_link_relocate): Handle negative int8t_t immediate for R_AVR_LDI. + * reloc.c: Add BFD_RELOC_AVR_MS8_LDI and BFD_RELOC_AVR_LDI_NEG + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2006-03-02 DJ Delorie + + * elf32-m32c.c (m32c_offset_for_reloc): Fix local symbol + calculations. + +2006-03-02 Richard Sandiford + + * elf32-ppc.c (is_ppc_elf_target): Return true if the target is + bfd_elf32_powerpc_vxworks_vec. + +2006-03-02 Nick Clifton + + * elf32-m32c.c (m32c_elf_relax_section): Initialise 'gap'. + +2006-03-02 Richard Sandiford + + * elf32-i386.c (elf_i386_create_dynamic_sections): Use + elf_vxworks_create_dynamic_sections. + (elf_i386_size_dynamic_sections): Remove VxWorks GOT and PLT + symbol handling. + * elf32-ppc.c (ppc_elf_create_dynamic_sections): Use + elf_vxworks_create_dynamic_sections. + (ppc_elf_size_dynamic_sections): Remove VxWorks GOT and PLT + symbol handling. + * elf-vxworks.c (elf_vxworks_create_dynamic_sections): New function. + * elf-vxworks.h (elf_vxworks_create_dynamic_sections): Declare. + +2006-03-02 Richard Sandiford + + * elf32-i386.c (elf_i386_vxworks_link_output_symbol_hook): Delete. + (elf_backend_link_output_symbol_hook): Use + elf_vxworks_link_output_symbol_hook instead. + * elf32-ppc.c (elf_i386_vxworks_link_output_symbol_hook): Delete. + (elf_backend_link_output_symbol_hook): Use + elf_vxworks_link_output_symbol_hook instead. + * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Provide the + same interface as elf_backend_link_output_symbol_hook. + * elf-vxworks.h (elf_vxworks_link_output_symbol_hook): Update + prototype accordingly. + +2006-03-02 Richard Sandiford + + * elf32-ppc.c (ppc_elf_plt_type): New enumeration. + (ppc_elf_link_hash_table): Replace old_got and new_got with + plt_type and can_use_new_plt. + (ppc_elf_create_dynamic_sections): Add SEC_HAS_CONTENTS, + SEC_LOAD and SEC_READONLY to the VxWorks .plt flags. + (ppc_elf_check_relocs): Set can_use_new_plt instead of new_plt. + Move from plt_type == PLT_UNSET to PLT_OLD instead of setting old_plt. + (ppc_elf_select_plt_layout): Move from plt_type == PLT_UNSET to + either plt_type == PLT_OLD or plt_type == PLT_NEW. Assert that + this function should not be called for VxWorks targets. + (ppc_elf_tls_setup): Use plt_type instead of old_got. + (allocate_got): Likewise. Rearrange so that max_before_header + is only used for PLT_OLD and PLT_NEW. + (allocate_dynrelocs): Use plt_type instead of old_got and is_vxworks. + (ppc_elf_size_dynamic_sections): Likewise. + (ppc_elf_relax_section): Likewise. + (ppc_elf_relocate_section): Likewise. + (ppc_elf_finish_dynamic_symbol): Likewise. + (ppc_elf_vxworks_link_hash_table_create): Initialize plt_type. + +2006-02-28 Richard Sandiford + + * elf32-i386.c (elf_i386_link_hash_table): Add next_tls_desc_index. + (elf_i386_link_hash_table_create): Initialize it. + (elf_i386_compute_jump_table_size): Use it instead of + srelplt->reloc_count. + (allocate_dynrelocs): Likewise. + (elf_i386_size_dynamic_sections): Likewise. + (elf_i386_relocate_section): Likewise. + +2006-02-27 Jakub Jelinek + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Handle S flag. + (_bfd_elf_write_section_eh_frame): Likewise. + +2006-02-27 Carlos O'Donell + + * po/Make-in: Add html target. + +2006-02-27 Richard Sandiford + + * elf-m10300.c (_bfd_mn10300_elf_finish_dynamic_symbol): Use the + cached hgot entry to check for _GLOBAL_OFFSET_TABLE_. + * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Likewise. + * elf32-bfin.c (bfin_finish_dynamic_symbol): Likewise. + * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise. + * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise. + * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise. + * elf32-m32r.c (m32r_elf_finish_dynamic_symbol): Likewise. + * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): Likewise. + * elf32-sh.c (sh_elf_finish_dynamic_symbol): Likewise. + * elf32-vax.c (elf_vax_finish_dynamic_symbol): Likewise. + * elf32-xtensa.c (elf_xtensa_finish_dynamic_symbol): Likewise. + * elf64-sh64.c (sh64_elf64_finish_dynamic_symbol): Likewise. + * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Likewise. + * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Likewise. + * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise. Also use + the cached hplt entry to check for _PROCEDURE_LINKAGE_TABLE_. + * elf64-alpha.c (elf64_alpha_finish_dynamic_symbol): Likewise. + * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise. + * elfxx-ia64.c (elfNN_ia64_finish_dynamic_symbol): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise. + +2006-02-25 Richard Sandiford + + * elf-bfd.h (elf_link_hash_table): Add hplt field. + * elflink.c (_bfd_elf_create_dynamic_sections): Initialize it. + * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Likewise. + * elf32-frv.c (_frv_create_got_section): Likewise. + * elf32-m32r.c (m32r_elf_create_dynamic_sections): Likewise. + * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise. + * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise. + * elf64-sh64.c (sh64_elf64_create_dynamic_sections): Likewise. + * elf32-i386.c (elf_i386_link_hash_table): Remove hgot and hplt. + (elf_i386_link_hash_table_create): Don't initialize them. + (elf_i386_size_dynamic_sections): Use the generic ELF hplt and + hgot fields. + (elf_i386_finish_dynamic_symbol): Likewise. + * elf32-ppc.c (ppc_elf_link_hash_table): Remove hplt. + (ppc_elf_size_dynamic_sections): Use the generic ELF hplt fields. + (ppc_elf_finish_dynamic_symbol): Likewise. + +2006-02-24 DJ Delorie + + * elf32-m32c.c (m32c_elf_howto_table): Add relaxation relocs. + (m32c_elf_relocate_section): Don't relocate them. + (compare_reloc): New. + (relax_reloc): Remove. + (m32c_offset_for_reloc): New. + (m16c_addr_encodings): New. + (m16c_jmpaddr_encodings): New. + (m32c_addr_encodings): New. + (m32c_elf_relax_section): Relax jumps and address displacements. + (m32c_elf_relax_delete_bytes): Adjust for internal syms. Fix up + short jumps. + + * reloc.c: Add m32c relax relocs. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2006-02-24 H.J. Lu + + PR ld/2218 + * elf-bfd.h (elf_backend_data): Add elf_backend_fixup_symbol. + (_bfd_elf_link_hash_fixup_symbol): New. + + * elflink.c (_bfd_elf_link_hash_fixup_symbol): New. + (_bfd_elf_fix_symbol_flags): Call elf_backend_fixup_symbol if + it isn't NULL. + + * elfxx-ia64.c (elf_backend_fixup_symbol): Defined. + + * elfxx-target.h (elf_backend_fixup_symbol): New. + (elfNN_bed): Initialize elf_backend_fixup_symbol. + +2006-02-23 H.J. Lu + + * cpu-ia64-opc.c (ins_immu5b): New. + (ext_immu5b): Likewise. + (elf64_ia64_operands): Add IMMU5b. + +2006-02-21 Alan Modra + + PR ld/2218 + * elf32-arm.c (allocate_dynrelocs): Ensure undef weak sym in pie + is dynamic. + * elf32-hppa.c (allocate_dynrelocs): Likewise. + * elf32-i386.c (allocate_dynrelocs): Likewise. + * elf32-s390.c (allocate_dynrelocs): Likewise. + * elf32-sh.c (allocate_dynrelocs): Likewise. + * elf64-s390.c (allocate_dynrelocs): Likewise. + * elf64-x86-64.c (allocate_dynrelocs): Likewise. + * elf32-m32r.c (allocate_dynrelocs): Likewise. Discard relocs + on undef weak with non-default visibility too. + * elfxx-sparc.c (allocate_dynrelocs): Ditto. + +2006-02-21 Alan Modra + + * bfd.c: (_bfd_default_error_handler): Don't call abort on + error, instead call _exit. + (_bfd_abort): Call _exit not xexit. + +2006-02-17 Kevin Buettner + + * elf32-frv.c (elf32_frv_grok_prstatus, elf32_frv_grok_psinfo): + New functions. + * elf_backend_grok_prstatus, elf_backend_grok_psinfo): Define. + +2006-02-17 Shrirang Khisti + Anil Paranjape + Shilin Shakti + + * Makefile.am: Add xc16x related entry + * Makefile.in: Regenerate + * archures.c: Add bfd_xc16x_arch + * bfd-in2.h: Regenerate + * config.bfd: Add xc16x-*-elf + * configure.in: Add bfd_elf32_xc16x_vec + * configure: Regenerate. + * targets.c: Added xc16x related information + * cpu-xc16x.c: New file + * reloc.c: Add new relocations specific to xc16x: + BFD_RELOC_XC16X_PAG, BFD_RELOC_XC16X_POF, BFD_RELOC_XC16X_SEG, + BFD_RELOC_XC16X_SOF + * elf32-xc16x.c: New file. + +2006-02-17 Alan Modra + + * elf32-ppc.c (allocate_dynrelocs): Tweak undef weak handling. + * elf64-ppc.c (allocate_dynrelocs): Likewise. + +2006-02-17 Alan Modra + + PR ld/2218 + * elf64-ppc.c (allocate_dynrelocs): Ensure undef weak sym is + dynamic. + (ppc64_elf_relocate_section): Check output reloc section size. + * elf32-ppc.c (allocate_dynrelocs): Simplify undef weak test. + +2006-02-16 H.J. Lu + + PR ld/2322 + * elf.c (get_segment_type): New function. + (_bfd_elf_print_private_bfd_data): Use it. + (print_segment_map): New function. + (assign_file_positions_for_segments): Call print_segment_map + when there are not enough room for program headers. + +2006-02-16 Nick Hudson + + * config.bfd (mips*el-*-netbsd*, mips*-*-netbsd*): Use + traditional MIPS ELF targets. + +2006-02-15 H.J. Lu + + PR binutils/2338 + * dwarf2.c (check_function_name): New function. + (_bfd_dwarf2_find_nearest_line): Use check_function_name to + check if function is correct. + +2006-02-16 Alan Modra + + * elflink.c (_bfd_elf_default_action_discarded): Return 0 for + debug sections. + (elf_link_input_bfd): Adjust comments. + +2006-02-10 H.J. Lu + + * elf.c (copy_private_bfd_data): Minor update. + +2006-02-10 H.J. Lu + + PR binutils/2258 + * elf.c (copy_private_bfd_data): Renamed to ... + (rewrite_elf_program_header): This. + (copy_elf_program_header): New function. + (copy_private_bfd_data): Likewise. + +2006-02-07 Nathan Sidwell + + * archures.c (bfd_mach_mcf5200, bfd_mach_mcf5206e, + bfd_mach_mcf5307, bfd_mach_mcf5407, bfd_mach_mcf528x, + bfd_mach_mcfv4e, bfd_mach_mcf521x, bfd_mach_mcf5249, + bfd_mach_mcf547x, bfd_mach_mcf548x): Remove. + (bfd_mach_mcf_isa_a, bfd_mach_mcf_isa_a_div, + bfd_mach_mcf_isa_a_div_mac, bfd_mach_mcf_isa_a_div_emac, + bfd_mach_mcf_isa_aplus, bfd_mach_mcf_isa_aplus_mac, + bfd_mach_mcf_isa_aplus_emac, bfd_mach_mcf_isa_aplus_usp, + bfd_mach_mcf_isa_aplus_usp_mac, bfd_mach_mcf_isa_aplus_usp_emac, + bfd_mach_mcf_isa_b, bfd_mach_mcf_isa_b_mac, bfd_mach_mcf_isa_b_emac, + bfd_mach_mcf_isa_b_usp_float, bfd_mach_mcf_isa_b_usp_float_mac, + bfd_mach_mcf_isa_b_usp_float_emac): New. + (bfd_default_scan): Update coldfire mapping. + * bfd-in.h (bfd_m68k_mach_to_features, + bfd_m68k_features_to_mach): Declare. + * bfd-in2.h: Rebuilt. + * cpu-m68k.c (arch_info_struct): Add new coldfire machines, + adjust legacy names. + (m68k_arch_features): New. + (bfd_m68k_mach_to_features, + bfd_m68k_features_to_mach): Define. + * elf32-m68k.c (elf32_m68k_object_p): New. + (elf32_m68k_merge_private_bfd_data): Merge the CF EF flags. + (elf32_m68k_print_private_bfd_data): Print the CF EF flags. + (elf_backend_object_p): Define. + * ieee.c (ieee_write_processor): Update coldfire machines. + * libbfd.h: Rebuilt. + +2006-02-06 Steve Ellcey + + * elfxx-ia64.c (elfNN_ia64_fake_sections): Set SHF_IA_64_HP_TLS + if SHF_TLS is set. + +2006-02-05 Arnold Metselaar + + * coff-z80.c (r_imm24): New howto. + (rtype2howto): New case R_IMM24. + (coff_z80_reloc_type_lookup): New case BFD_RELOC_24. + (extra_case): Use bfd_get_8 for R_IMM8, new case R_IMM24. + +2006-02-04 Richard Sandiford + + * elfxx-mips.c (mips_elf_initialize_tls_index): If a TLS symbol + has already been assigned a GOT index, copy that index to the + current hash table entry. + +2006-02-01 Eric Botcazou + + * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass + for call-to-undefweak reloc overflow. + +2006-01-31 Eric Botcazou + + * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass + for 32-bit relocs overflow. + +2006-01-27 Paul Brook + + * elf32-arm.c (elf32_arm_get_symbol_type): Allow STT_TLS thumb + objects. + +2006-01-18 Alexandre Oliva + + Introduce TLS descriptors for i386 and x86_64. + * reloc.c (BFD_RELOC_386_TLS_GOTDESC, BFD_RELOC_386_TLS_DESC, + BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_X86_64_GOTPC32_TLSDESC, + BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_TLSDESC_CALL): New. + * libbfd.h, bfd-in2.h: Rebuilt. + * elf32-i386.c (elf_howto_table): New relocations. + (R_386_tls): Adjust. + (elf_i386_reloc_type_lookup): Map new relocations. + (GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P): New macros. + (GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): New macros. + (struct elf_i386_link_hash_entry): Add tlsdesc_got field. + (struct elf_i386_obj_tdata): Add local_tlsdesc_gotent field. + (elf_i386_local_tlsdesc_gotent): New macro. + (struct elf_i386_link_hash_table): Add sgotplt_jump_table_size. + (elf_i386_compute_jump_table_size): New macro. + (link_hash_newfunc): Initialize tlsdesc_got. + (elf_i386_link_hash_table_create): Set sgotplt_jump_table_size. + (elf_i386_tls_transition): Handle R_386_TLS_GOTDESC and + R_386_TLS_DESC_CALL. + (elf_i386_check_relocs): Likewise. Allocate space for + local_tlsdesc_gotent. + (elf_i386_gc_sweep_hook): Handle R_386_TLS_GOTDESC and + R_386_TLS_DESC_CALL. + (allocate_dynrelocs): Count function PLT relocations. Reserve + space for TLS descriptors and relocations. + (elf_i386_size_dynamic_sections): Reserve space for TLS + descriptors and relocations. Set up sgotplt_jump_table_size. + Don't zero reloc_count in srelplt. + (elf_i386_always_size_sections): New. Set up _TLS_MODULE_BASE_. + (elf_i386_relocate_section): Handle R_386_TLS_GOTDESC and + R_386_TLS_DESC_CALL. + (elf_i386_finish_dynamic_symbol): Use GOT_TLS_GD_ANY_P. + (elf_backend_always_size_sections): Define. + * elf64-x86-64.c (x86_64_elf_howto): Add R_X86_64_GOTPC32_TLSDESC, + R_X86_64_TLSDESC, R_X86_64_TLSDESC_CALL. + (R_X86_64_standard): Adjust. + (x86_64_reloc_map): Map new relocs. + (elf64_x86_64_rtype_to_howto): New, split out of... + (elf64_x86_64_info_to_howto): ... this function, and... + (elf64_x86_64_reloc_type_lookup): ... use it to map elf_reloc_val. + (GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P): New macros. + (GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): New macros. + (struct elf64_x86_64_link_hash_entry): Add tlsdesc_got field. + (struct elf64_x86_64_obj_tdata): Add local_tlsdesc_gotent field. + (elf64_x86_64_local_tlsdesc_gotent): New macro. + (struct elf64_x86_64_link_hash_table): Add tlsdesc_plt, + tlsdesc_got and sgotplt_jump_table_size fields. + (elf64_x86_64_compute_jump_table_size): New macro. + (link_hash_newfunc): Initialize tlsdesc_got. + (elf64_x86_64_link_hash_table_create): Initialize new fields. + (elf64_x86_64_tls_transition): Handle R_X86_64_GOTPC32_TLSDESC and + R_X86_64_TLSDESC_CALL. + (elf64_x86_64_check_relocs): Likewise. Allocate space for + local_tlsdesc_gotent. + (elf64_x86_64_gc_sweep_hook): Handle R_X86_64_GOTPC32_TLSDESC and + R_X86_64_TLSDESC_CALL. + (allocate_dynrelocs): Count function PLT relocations. Reserve + space for TLS descriptors and relocations. + (elf64_x86_64_size_dynamic_sections): Reserve space for TLS + descriptors and relocations. Set up sgotplt_jump_table_size, + tlsdesc_plt and tlsdesc_got. Make room for them. Don't zero + reloc_count in srelplt. Add dynamic entries for DT_TLSDESC_PLT + and DT_TLSDESC_GOT. + (elf64_x86_64_always_size_sections): New. Set up + _TLS_MODULE_BASE_. + (elf64_x86_64_relocate_section): Handle R_386_TLS_GOTDESC and + R_386_TLS_DESC_CALL. + (elf64_x86_64_finish_dynamic_symbol): Use GOT_TLS_GD_ANY_P. + (elf64_x86_64_finish_dynamic_sections): Set DT_TLSDESC_PLT and + DT_TLSDESC_GOT. Set up TLS descriptor lazy resolver PLT entry. + (elf_backend_always_size_sections): Define. + +2006-01-17 H.J. Lu + + PR binutils/2096 + * dwarf2.c (comp_unit_contains_address): Update comment. + (_bfd_dwarf2_find_nearest_line): Use section's vma, instead of + lma. Return TRUE only if both comp_unit_contains_address and + comp_unit_find_nearest_line return TRUE. + (_bfd_dwarf2_find_line): Use section's vma, instead of lma. + +2006-01-18 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add gc_mark_dynamic_ref. + (bfd_elf_gc_mark_dynamic_ref_symbol): Declare. + * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Rename from + elf_gc_mark_dynamic_ref_symbol. Make global. + (bfd_elf_gc_sections): Call bed->gc_mark_dynamic_ref. + * elfxx-target.h (elf_backend_gc_mark_dynamic_ref): Define. + (elfNN_bed): Init new field. + * elf64-ppc.c (elf_backend_gc_mark_dynamic_ref): Define. + (ppc64_elf_gc_mark_dynamic_ref): New function. + +2006-01-17 Alan Modra + + * elf64-ppc.c (ppc64_elf_gc_mark_hook): Don't hang forever in loop. + +2006-01-17 Nick Clifton + + PR binutils/2159 + * elf.c (elfcore_write_pstatus): Add ATTRIBUTE_UNUSED to unused + parameters. + +2006-01-11 Nick Clifton + + * elf32-arm.c (elf32_arm_output_symbol_hook): Install new entry + into the newly (re)allocated map array. + +2006-01-09 Alexis Wilke + + * peXXigen.c (tbl): Add comma after "HIGH3ADJ". + +2006-01-01 Jakub Jelinek + + * elf64-ppc.c (ppc64_elf_action_discarded): Return 0 + for .toc1 section. + +For older changes see ChangeLog-2005 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/bfd/Makefile.am b/bfd/Makefile.am index 77278a832a1..48919af759b 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -1,6 +1,7 @@ ## Process this file with automake to generate Makefile.in AUTOMAKE_OPTIONS = 1.9 cygnus +ACLOCAL_AMFLAGS = -I . -I .. -I ../config # Uncomment the following line when doing a release. # RELEASE=y @@ -63,6 +64,7 @@ ALL_MACHINES = \ cpu-arm.lo \ cpu-avr.lo \ cpu-bfin.lo \ + cpu-cr16.lo \ cpu-cr16c.lo \ cpu-cris.lo \ cpu-crx.lo \ @@ -91,6 +93,7 @@ ALL_MACHINES = \ cpu-m10300.lo \ cpu-maxq.lo \ cpu-mcore.lo \ + cpu-mep.lo \ cpu-mips.lo \ cpu-mmix.lo \ cpu-mt.lo \ @@ -103,8 +106,10 @@ ALL_MACHINES = \ cpu-powerpc.lo \ cpu-rs6000.lo \ cpu-s390.lo \ + cpu-score.lo \ cpu-sh.lo \ cpu-sparc.lo \ + cpu-spu.lo \ cpu-tic30.lo \ cpu-tic4x.lo \ cpu-tic54x.lo \ @@ -125,6 +130,7 @@ ALL_MACHINES_CFILES = \ cpu-arm.c \ cpu-avr.c \ cpu-bfin.c \ + cpu-cr16.c \ cpu-cris.c \ cpu-cr16c.c \ cpu-crx.c \ @@ -153,6 +159,7 @@ ALL_MACHINES_CFILES = \ cpu-m10300.c \ cpu-maxq.c \ cpu-mcore.c \ + cpu-mep.c \ cpu-mips.c \ cpu-mmix.c \ cpu-mt.c \ @@ -165,8 +172,10 @@ ALL_MACHINES_CFILES = \ cpu-powerpc.c \ cpu-rs6000.c \ cpu-s390.c \ + cpu-score.c \ cpu-sh.c \ cpu-sparc.c \ + cpu-spu.c \ cpu-tic30.c \ cpu-tic4x.c \ cpu-tic54x.c \ @@ -235,6 +244,7 @@ BFD32_BACKENDS = \ elf32-arm.lo \ elf32-avr.lo \ elf32-bfin.lo \ + elf32-cr16.lo \ elf32-cr16c.lo \ elf32-cris.lo \ elf32-crx.lo \ @@ -262,6 +272,7 @@ BFD32_BACKENDS = \ elf-m10200.lo \ elf-m10300.lo \ elf32-mcore.lo \ + elf32-mep.lo \ elfxx-mips.lo \ elf32-mips.lo \ elf32-mt.lo \ @@ -271,12 +282,14 @@ BFD32_BACKENDS = \ elf32-pj.lo \ elf32-ppc.lo \ elf32-s390.lo \ + elf32-score.lo \ elf32-sh.lo \ elf32-sh-symbian.lo \ elf32-sh64.lo \ elf32-sh64-com.lo \ elfxx-sparc.lo \ elf32-sparc.lo \ + elf32-spu.lo \ elf32-v850.lo \ elf32-vax.lo \ elf32-xstormy16.lo \ @@ -284,6 +297,7 @@ BFD32_BACKENDS = \ elf32-xc16x.lo \ elf32.lo \ elflink.lo \ + elf-attrs.lo \ elf-strtab.lo \ elf-eh-frame.lo \ elf-vxworks.lo \ @@ -323,6 +337,8 @@ BFD32_BACKENDS = \ pef.lo \ pe-arm.lo \ pei-arm.lo \ + pe-arm-wince.lo \ + pei-arm-wince.lo \ pe-i386.lo \ pei-i386.lo \ pe-mcore.lo \ @@ -407,6 +423,7 @@ BFD32_BACKENDS_CFILES = \ elf32-arm.c \ elf32-avr.c \ elf32-bfin.c \ + elf32-cr16.c \ elf32-cr16c.c \ elf32-cris.c \ elf32-crx.c \ @@ -434,6 +451,7 @@ BFD32_BACKENDS_CFILES = \ elf-m10200.c \ elf-m10300.c \ elf32-mcore.c \ + elf32-mep.c \ elfxx-mips.c \ elf32-mips.c \ elf32-mt.c \ @@ -445,10 +463,12 @@ BFD32_BACKENDS_CFILES = \ elf32-sh64.c \ elf32-sh64-com.c \ elf32-s390.c \ + elf32-score.c \ elf32-sh.c \ elf32-sh-symbian.c \ elfxx-sparc.c \ elf32-sparc.c \ + elf32-spu.c \ elf32-v850.c \ elf32-vax.c \ elf32-xstormy16.c \ @@ -456,6 +476,7 @@ BFD32_BACKENDS_CFILES = \ elf32-xc16x.c \ elf32.c \ elflink.c \ + elf-attrs.c \ elf-strtab.c \ elf-eh-frame.c \ elf-vxworks.c \ @@ -495,6 +516,8 @@ BFD32_BACKENDS_CFILES = \ pef.c \ pe-arm.c \ pei-arm.c \ + pe-arm-wince.c \ + pei-arm-wince.c \ pe-i386.c \ pei-i386.c \ pe-mcore.c \ @@ -538,6 +561,7 @@ BFD64_BACKENDS = \ coff64-rs6000.lo \ demo64.lo \ efi-app-ia64.lo \ + efi-app-x86_64.lo \ elf64-x86-64.lo \ elf64-alpha.lo \ elf64-hppa.lo \ @@ -555,7 +579,11 @@ BFD64_BACKENDS = \ mmo.lo \ nlm32-alpha.lo \ nlm64.lo \ - pepigen.lo + coff-x86_64.lo \ + pe-x86_64.lo \ + pei-x86_64.lo \ + pepigen.lo \ + pex64igen.lo BFD64_BACKENDS_CFILES = \ aix5ppc-core.c \ @@ -564,6 +592,7 @@ BFD64_BACKENDS_CFILES = \ coff64-rs6000.c \ demo64.c \ efi-app-ia64.c \ + efi-app-x86_64.c \ elf64-x86-64.c \ elf64-alpha.c \ elf64-hppa.c \ @@ -578,7 +607,10 @@ BFD64_BACKENDS_CFILES = \ elf64.c \ mmo.c \ nlm32-alpha.c \ - nlm64.c + nlm64.c \ + coff-x86_64.c \ + pe-x86_64.c \ + pei-x86_64.c OPTIONAL_BACKENDS = \ aix386-core.lo \ @@ -612,11 +644,10 @@ CONFIG_STATUS_DEPENDENCIES = \ WORDSIZE = @wordsize@ ALL_BACKENDS = @all_backends@ BFD_BACKENDS = @bfd_backends@ -BFD_LIBS = @bfd_libs@ BFD_MACHINES = @bfd_machines@ TDEFAULTS = @tdefaults@ -INCLUDES = @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) -I$(srcdir)/../intl -I../intl +INCLUDES = @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) @INCINTL@ # C source files that correspond to .o's. SOURCE_CFILES = \ @@ -628,7 +659,7 @@ SOURCE_CFILES = \ $(OPTIONAL_BACKENDS_CFILES) BUILD_CFILES = \ - elf32-ia64.c elf64-ia64.c peigen.c pepigen.c + elf32-ia64.c elf64-ia64.c peigen.c pepigen.c pex64igen.c CFILES = $(SOURCE_CFILES) $(BUILD_CFILES) @@ -698,7 +729,8 @@ install-html-recursive: # BFD_BACKENDS Routines the configured targets need. # BFD_MACHINES Architecture-specific routines the configured targets need. # COREFILE Core file routines for a native configuration -OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@ +# bfd64_libs Routines for 64bit support +OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@ @bfd64_libs@ stamp-ofiles: Makefile rm -f tofiles @@ -715,10 +747,12 @@ stamp-ofiles: Makefile ofiles: stamp-ofiles ; @true -libbfd_la_SOURCES = $(BFD32_LIBS_CFILES) $(BFD64_LIBS_CFILES) +# Since BFD64_LIBS is optional and we can't have substitution in +# libbfd_la_SOURCES, we put BFD64_LIBS in OFILES instead. +libbfd_la_SOURCES = $(BFD32_LIBS_CFILES) libbfd_la_DEPENDENCIES = $(OFILES) ofiles libbfd_la_LIBADD = `cat ofiles` @WIN32LIBADD@ -libbfd_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@ +libbfd_la_LDFLAGS = -release `cat libtool-soversion` @WIN32LDFLAGS@ # libtool will build .libs/libbfd.a. We create libbfd.a in the build # directory so that we don't have to convert all the programs that use @@ -756,6 +790,9 @@ targets.lo: targets.c Makefile archures.lo: archures.c Makefile $(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/archures.c +dwarf2.lo: dwarf2.c Makefile + $(LIBTOOL) --mode=compile $(COMPILE) -c -DDEBUGDIR=\"$(DEBUGDIR)\" $(srcdir)/dwarf2.c + elf32-target.h : elfxx-target.h rm -f elf32-target.h sed -e s/NN/32/g < $(srcdir)/elfxx-target.h > elf32-target.new @@ -786,6 +823,11 @@ pepigen.c : peXXigen.c sed -e s/XX/pep/g < $(srcdir)/peXXigen.c > pepigen.new mv -f pepigen.new pepigen.c +pex64igen.c: peXXigen.c + rm -f pex64igen.c + sed -e s/XX/pex64/g < $(srcdir)/peXXigen.c > pex64igen.new + mv -f pex64igen.new pex64igen.c + BFD_H_DEPS= $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h LOCAL_H_DEPS= libbfd.h sysdep.h config.h $(BFD32_LIBS) \ @@ -929,17 +971,26 @@ MOSTLYCLEANFILES = ofiles stamp-ofiles CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \ stmp-bin2-h stmp-lbfd-h stmp-lcoff-h -DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) +DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) libtool-soversion bfdver.h: $(srcdir)/version.h $(srcdir)/Makefile.in @echo "creating $@" @bfd_version=`echo "$(VERSION)" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ bfd_version_string="\"$(VERSION)\"" ;\ + bfd_soversion="$(VERSION)" ;\ + bfd_version_package="\"$(PKGVERSION)\"" ;\ + report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\ if test "x$(RELEASE)" = x ; then \ bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\ - bfd_version_string="\"$(VERSION) $${bfd_version_date}\"" ;\ + bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\ + bfd_soversion="$(VERSION).$${bfd_version_date}" ;\ fi ;\ - sed -e "s/@bfd_version@/$$bfd_version/" -e "s/@bfd_version_string@/$$bfd_version_string/" < $(srcdir)/version.h > $@ + sed -e "s,@bfd_version@,$$bfd_version," \ + -e "s,@bfd_version_string@,$$bfd_version_string," \ + -e "s,@bfd_version_package@,$$bfd_version_package," \ + -e "s,@report_bugs_to@,$$report_bugs_to," \ + < $(srcdir)/version.h > $@; \ + echo "$${bfd_soversion}" > libtool-soversion # What appears below is generated by a hacked mkdep using gcc -MM. @@ -950,11 +1001,12 @@ archive.lo: archive.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ $(INCDIR)/safe-ctype.h archures.lo: archures.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/safe-ctype.h -bfd.lo: bfd.c bfdver.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h libcoff.h \ - libecoff.h $(INCDIR)/coff/ecoff.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h +bfd.lo: bfd.c $(INCDIR)/filenames.h bfdver.h $(INCDIR)/libiberty.h \ + $(INCDIR)/demangle.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/sym.h libcoff.h libecoff.h $(INCDIR)/coff/ecoff.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h bfdio.lo: bfdio.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h bfdwin.lo: bfdwin.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cache.lo: cache.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ @@ -1008,6 +1060,7 @@ cpu-arm.lo: cpu-arm.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/libiberty.h cpu-avr.lo: cpu-avr.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-bfin.lo: cpu-bfin.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +cpu-cr16.lo: cpu-cr16.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-cris.lo: cpu-cris.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-cr16c.lo: cpu-cr16c.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-crx.lo: cpu-crx.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h @@ -1040,6 +1093,7 @@ cpu-m10200.lo: cpu-m10200.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-maxq.lo: cpu-maxq.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +cpu-mep.lo: cpu-mep.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-mmix.lo: cpu-mmix.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-mt.lo: cpu-mt.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h @@ -1055,9 +1109,11 @@ cpu-powerpc.lo: cpu-powerpc.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h cpu-rs6000.lo: cpu-rs6000.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-s390.lo: cpu-s390.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +cpu-score.lo: cpu-score.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(srcdir)/../opcodes/sh-opc.h cpu-sparc.lo: cpu-sparc.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +cpu-spu.lo: cpu-spu.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-tic30.lo: cpu-tic30.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-tic4x.lo: cpu-tic4x.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-tic54x.lo: cpu-tic54x.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h @@ -1127,7 +1183,8 @@ coff-arm.lo: coff-arm.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \ - coff-m68k.c $(INCDIR)/hashtab.h libcoff.h $(INCDIR)/bfdlink.h \ + coff-m68k.c $(INCDIR)/hashtab.h $(INCDIR)/coff/m68k.h \ + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/bfdlink.h genlink.h $(INCDIR)/coff/h8300.h \ @@ -1197,7 +1254,7 @@ coff-tic54x.lo: coff-tic54x.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic54x.h \ $(INCDIR)/coff/ti.h $(INCDIR)/coff/internal.h libcoff.h \ coffcode.h coffswap.h -coff-tic80.lo: coff-tic80.c $(INCDIR)/bfdlink.h $(INCDIR)/filenames.h \ +coff-tic80.lo: coff-tic80.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h $(INCDIR)/coff/tic80.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h coff-u68k.lo: coff-u68k.c coff-m68k.c $(INCDIR)/filenames.h \ @@ -1260,11 +1317,16 @@ elf32-arm.lo: elf32-arm.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h + $(INCDIR)/elf/reloc-macros.h elf32-avr.h elf32-target.h elf32-bfin.lo: elf32-bfin.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/bfin.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/elf/dwarf2.h \ + elf32-target.h +elf32-cr16.lo: elf32-cr16.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/elf/cr16.h $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-cr16c.lo: elf32-cr16c.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/cr16c.h \ $(INCDIR)/elf/reloc-macros.h elf-bfd.h $(INCDIR)/elf/common.h \ @@ -1378,19 +1440,24 @@ elf32-mcore.lo: elf32-mcore.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/mcore.h \ $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-mep.lo: elf32-mep.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mep.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ + elf32-target.h elfxx-mips.lo: elfxx-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/libiberty.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ elfxx-mips.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h elf-vxworks.h + elf-vxworks.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ + $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfxx-mips.h \ - $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h elf-vxworks.h \ + $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \ - ecoffswap.h elf32-target.h elf-vxworks.h + ecoffswap.h elf32-target.h elf32-mt.lo: elf32-mt.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mt.h \ @@ -1422,9 +1489,9 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \ - elf32-sh64.h elf32-sh.c $(INCDIR)/hashtab.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ - $(srcdir)/../opcodes/sh-opc.h elf32-target.h + elf32-sh64.h elf32-sh.c $(INCDIR)/hashtab.h elf-vxworks.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ + $(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h elf32-sh64-com.lo: elf32-sh64-com.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ @@ -1434,27 +1501,36 @@ elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h \ $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-score.lo: elf32-score.c $(INCDIR)/filenames.h \ + $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/score.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ - $(srcdir)/../opcodes/sh-opc.h elf32-target.h + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf-vxworks.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ + $(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h elf32-sh-symbian.lo: elf32-sh-symbian.c elf32-sh.c \ $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/libiberty.h $(srcdir)/../opcodes/sh-opc.h \ - elf32-target.h + $(INCDIR)/elf/external.h elf-vxworks.h $(INCDIR)/elf/sh.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ + $(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h elfxx-sparc.lo: elfxx-sparc.c $(INCDIR)/filenames.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \ - elfxx-sparc.h elf-vxworks.h + $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/sparc.h elfxx-sparc.h elf-vxworks.h elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \ - elfxx-sparc.h elf32-target.h elf-vxworks.h + elfxx-sparc.h elf-vxworks.h elf32-target.h +elf32-spu.lo: elf32-spu.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/spu.h \ + $(INCDIR)/elf/reloc-macros.h elf32-spu.h elf32-target.h elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h \ @@ -1486,6 +1562,9 @@ elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/libiberty.h $(INCDIR)/objalloc.h +elf-attrs.lo: elf-attrs.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf-strtab.lo: elf-strtab.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h @@ -1570,7 +1649,7 @@ m88kopenbsd.lo: m88kopenbsd.c netbsd.h $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h libaout.h $(INCDIR)/bfdlink.h aout-target.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ $(INCDIR)/aout/ar.h -mach-o.lo: mach-o.c mach-o.h $(INCDIR)/filenames.h \ +mach-o.lo: mach-o.c $(INCDIR)/filenames.h mach-o.h \ $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h mach-o-target.c mipsbsd.lo: mipsbsd.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ @@ -1610,8 +1689,8 @@ pdp11.lo: pdp11.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ $(INCDIR)/safe-ctype.h -pef.lo: pef.c $(INCDIR)/safe-ctype.h pef.h pef-traceback.h \ - $(INCDIR)/filenames.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h +pef.lo: pef.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ + pef.h pef-traceback.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h pe-arm.lo: pe-arm.c $(INCDIR)/filenames.h coff-arm.c \ $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ @@ -1620,6 +1699,16 @@ pei-arm.lo: pei-arm.c $(INCDIR)/filenames.h coff-arm.c \ $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h +pe-arm-wince.lo: pe-arm-wince.c pe-arm.c $(INCDIR)/filenames.h \ + coff-arm.c $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +pei-arm-wince.lo: pei-arm-wince.c pei-arm.c $(INCDIR)/filenames.h \ + coff-arm.c $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h pe-i386.lo: pe-i386.c $(INCDIR)/filenames.h coff-i386.c \ $(INCDIR)/hashtab.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ @@ -1662,7 +1751,7 @@ pei-mips.lo: pei-mips.c $(INCDIR)/filenames.h pe-mips.c \ $(INCDIR)/hashtab.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -ppcboot.lo: ppcboot.c $(INCDIR)/safe-ctype.h $(INCDIR)/filenames.h \ +ppcboot.lo: ppcboot.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/hashtab.h reloc16.lo: reloc16.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/bfdlink.h genlink.h $(INCDIR)/coff/internal.h \ @@ -1703,7 +1792,7 @@ vms.lo: vms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h vms.h vms-gsd.lo: vms-gsd.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h vms.h -vms-hdr.lo: vms-hdr.c bfdver.h $(INCDIR)/filenames.h \ +vms-hdr.lo: vms-hdr.c $(INCDIR)/filenames.h bfdver.h \ $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/hashtab.h \ vms.h vms-misc.lo: vms-misc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ @@ -1713,12 +1802,12 @@ vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h \ libcoff.h libxcoff.h -xsym.lo: xsym.c xsym.h $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +xsym.lo: xsym.c $(INCDIR)/filenames.h xsym.h $(INCDIR)/hashtab.h xtensa-isa.lo: xtensa-isa.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/xtensa-isa.h $(INCDIR)/xtensa-isa-internal.h xtensa-modules.lo: xtensa-modules.c $(INCDIR)/xtensa-isa.h \ $(INCDIR)/xtensa-isa-internal.h -aix5ppc-core.lo: aix5ppc-core.c +aix5ppc-core.lo: aix5ppc-core.c $(INCDIR)/filenames.h aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/hashtab.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h @@ -1740,6 +1829,11 @@ efi-app-ia64.lo: efi-app-ia64.c $(INCDIR)/filenames.h \ $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ peicode.h libpei.h +efi-app-x86_64.lo: efi-app-x86_64.c $(INCDIR)/filenames.h \ + coff-x86_64.c $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h \ + coffcode.h peicode.h libpei.h elf64-x86-64.lo: elf64-x86-64.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/x86-64.h \ @@ -1808,6 +1902,21 @@ nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \ nlm64.lo: nlm64.c nlmcode.h $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ $(INCDIR)/nlm/external.h +coff-x86_64.lo: coff-x86_64.c $(INCDIR)/filenames.h \ + $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h coffcode.h \ + coffswap.h +pe-x86_64.lo: pe-x86_64.c $(INCDIR)/filenames.h coff-x86_64.c \ + $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h coffcode.h \ + peicode.h libpei.h +pei-x86_64.lo: pei-x86_64.c $(INCDIR)/filenames.h coff-x86_64.c \ + $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h coffcode.h \ + peicode.h libpei.h aix386-core.lo: aix386-core.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h @@ -1824,16 +1933,19 @@ elf32-ia64.lo: elf32-ia64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h \ $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h \ - elf32-target.h + $(INCDIR)/hashtab.h elf32-target.h elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h \ $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h \ - elf64-target.h + $(INCDIR)/hashtab.h elf64-target.h peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h pepigen.lo: pepigen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/ia64.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h +pex64igen.lo: pex64igen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 8ed90563561..8f4580e1821 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -15,8 +15,6 @@ @SET_MAKE@ -SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -49,10 +47,17 @@ DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub README \ $(srcdir)/../config.sub subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/../config/acx.m4 $(top_srcdir)/../bfd/bfd.m4 \ - $(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/../gettext.m4 $(top_srcdir)/configure.in +am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/depstand.m4 \ + $(top_srcdir)/../config/gettext-sister.m4 \ + $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/nls.m4 $(top_srcdir)/../config/po.m4 \ + $(top_srcdir)/../config/progtest.m4 \ + $(top_srcdir)/../config/stdint.m4 $(top_srcdir)/../libtool.m4 \ + $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ + $(top_srcdir)/../ltversion.m4 $(top_srcdir)/bfd.m4 \ + $(top_srcdir)/warning.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -80,19 +85,18 @@ am__objects_1 = archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo \ opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo \ linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo \ stab-syms.lo merge.lo dwarf2.lo simple.lo -am__objects_2 = archive64.lo -am_libbfd_la_OBJECTS = $(am__objects_1) $(am__objects_2) +am_libbfd_la_OBJECTS = $(am__objects_1) libbfd_la_OBJECTS = $(am_libbfd_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I. depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -105,7 +109,6 @@ ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) ACLOCAL = @ACLOCAL@ -ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ @@ -131,20 +134,24 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DEBUGDIR = @DEBUGDIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@ -GMOFILES = @GMOFILES@ +FGREP = @FGREP@ +GENCAT = @GENCAT@ +GENINSRC_NEVER_FALSE = @GENINSRC_NEVER_FALSE@ +GENINSRC_NEVER_TRUE = @GENINSRC_NEVER_TRUE@ GMSGFMT = @GMSGFMT@ -GT_NO = @GT_NO@ -GT_YES = @GT_YES@ +GREP = @GREP@ HDEFINES = @HDEFINES@ -INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +INCINTL = @INCINTL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_LIBBFD_FALSE = @INSTALL_LIBBFD_FALSE@ INSTALL_LIBBFD_TRUE = @INSTALL_LIBBFD_TRUE@ @@ -152,10 +159,10 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ -INTLDEPS = @INTLDEPS@ -INTLLIBS = @INTLLIBS@ -INTLOBJS = @INTLOBJS@ +LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBINTL = @LIBINTL@ +LIBINTL_DEP = @LIBINTL_DEP@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -167,6 +174,8 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ NO_WERROR = @NO_WERROR@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ @@ -176,14 +185,16 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POFILES = @POFILES@ +PKGVERSION = @PKGVERSION@ POSUB = @POSUB@ RANLIB = @RANLIB@ +REPORT_BUGS_TEXI = @REPORT_BUGS_TEXI@ +REPORT_BUGS_TO = @REPORT_BUGS_TO@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TDEFINES = @TDEFINES@ -USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ @@ -192,6 +203,7 @@ WIN32LIBADD = @WIN32LIBADD@ XGETTEXT = @XGETTEXT@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ all_backends = @all_backends@ @@ -202,10 +214,10 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +bfd64_libs = @bfd64_libs@ bfd_backends = @bfd_backends@ bfd_default_target_size = @bfd_default_target_size@ bfd_file_ptr = @bfd_file_ptr@ -bfd_libs = @bfd_libs@ bfd_machines = @bfd_machines@ bfd_ufile_ptr = @bfd_ufile_ptr@ bfdincludedir = @bfdincludedir@ @@ -230,10 +242,10 @@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -l = @l@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -251,6 +263,7 @@ target_vendor = @target_vendor@ tdefaults = @tdefaults@ wordsize = @wordsize@ AUTOMAKE_OPTIONS = 1.9 cygnus +ACLOCAL_AMFLAGS = -I . -I .. -I ../config # Uncomment the following line when doing a release. # RELEASE=y @@ -299,6 +312,7 @@ ALL_MACHINES = \ cpu-arm.lo \ cpu-avr.lo \ cpu-bfin.lo \ + cpu-cr16.lo \ cpu-cr16c.lo \ cpu-cris.lo \ cpu-crx.lo \ @@ -327,6 +341,7 @@ ALL_MACHINES = \ cpu-m10300.lo \ cpu-maxq.lo \ cpu-mcore.lo \ + cpu-mep.lo \ cpu-mips.lo \ cpu-mmix.lo \ cpu-mt.lo \ @@ -339,8 +354,10 @@ ALL_MACHINES = \ cpu-powerpc.lo \ cpu-rs6000.lo \ cpu-s390.lo \ + cpu-score.lo \ cpu-sh.lo \ cpu-sparc.lo \ + cpu-spu.lo \ cpu-tic30.lo \ cpu-tic4x.lo \ cpu-tic54x.lo \ @@ -361,6 +378,7 @@ ALL_MACHINES_CFILES = \ cpu-arm.c \ cpu-avr.c \ cpu-bfin.c \ + cpu-cr16.c \ cpu-cris.c \ cpu-cr16c.c \ cpu-crx.c \ @@ -389,6 +407,7 @@ ALL_MACHINES_CFILES = \ cpu-m10300.c \ cpu-maxq.c \ cpu-mcore.c \ + cpu-mep.c \ cpu-mips.c \ cpu-mmix.c \ cpu-mt.c \ @@ -401,8 +420,10 @@ ALL_MACHINES_CFILES = \ cpu-powerpc.c \ cpu-rs6000.c \ cpu-s390.c \ + cpu-score.c \ cpu-sh.c \ cpu-sparc.c \ + cpu-spu.c \ cpu-tic30.c \ cpu-tic4x.c \ cpu-tic54x.c \ @@ -472,6 +493,7 @@ BFD32_BACKENDS = \ elf32-arm.lo \ elf32-avr.lo \ elf32-bfin.lo \ + elf32-cr16.lo \ elf32-cr16c.lo \ elf32-cris.lo \ elf32-crx.lo \ @@ -499,6 +521,7 @@ BFD32_BACKENDS = \ elf-m10200.lo \ elf-m10300.lo \ elf32-mcore.lo \ + elf32-mep.lo \ elfxx-mips.lo \ elf32-mips.lo \ elf32-mt.lo \ @@ -508,12 +531,14 @@ BFD32_BACKENDS = \ elf32-pj.lo \ elf32-ppc.lo \ elf32-s390.lo \ + elf32-score.lo \ elf32-sh.lo \ elf32-sh-symbian.lo \ elf32-sh64.lo \ elf32-sh64-com.lo \ elfxx-sparc.lo \ elf32-sparc.lo \ + elf32-spu.lo \ elf32-v850.lo \ elf32-vax.lo \ elf32-xstormy16.lo \ @@ -521,6 +546,7 @@ BFD32_BACKENDS = \ elf32-xc16x.lo \ elf32.lo \ elflink.lo \ + elf-attrs.lo \ elf-strtab.lo \ elf-eh-frame.lo \ elf-vxworks.lo \ @@ -560,6 +586,8 @@ BFD32_BACKENDS = \ pef.lo \ pe-arm.lo \ pei-arm.lo \ + pe-arm-wince.lo \ + pei-arm-wince.lo \ pe-i386.lo \ pei-i386.lo \ pe-mcore.lo \ @@ -644,6 +672,7 @@ BFD32_BACKENDS_CFILES = \ elf32-arm.c \ elf32-avr.c \ elf32-bfin.c \ + elf32-cr16.c \ elf32-cr16c.c \ elf32-cris.c \ elf32-crx.c \ @@ -671,6 +700,7 @@ BFD32_BACKENDS_CFILES = \ elf-m10200.c \ elf-m10300.c \ elf32-mcore.c \ + elf32-mep.c \ elfxx-mips.c \ elf32-mips.c \ elf32-mt.c \ @@ -682,10 +712,12 @@ BFD32_BACKENDS_CFILES = \ elf32-sh64.c \ elf32-sh64-com.c \ elf32-s390.c \ + elf32-score.c \ elf32-sh.c \ elf32-sh-symbian.c \ elfxx-sparc.c \ elf32-sparc.c \ + elf32-spu.c \ elf32-v850.c \ elf32-vax.c \ elf32-xstormy16.c \ @@ -693,6 +725,7 @@ BFD32_BACKENDS_CFILES = \ elf32-xc16x.c \ elf32.c \ elflink.c \ + elf-attrs.c \ elf-strtab.c \ elf-eh-frame.c \ elf-vxworks.c \ @@ -732,6 +765,8 @@ BFD32_BACKENDS_CFILES = \ pef.c \ pe-arm.c \ pei-arm.c \ + pe-arm-wince.c \ + pei-arm-wince.c \ pe-i386.c \ pei-i386.c \ pe-mcore.c \ @@ -776,6 +811,7 @@ BFD64_BACKENDS = \ coff64-rs6000.lo \ demo64.lo \ efi-app-ia64.lo \ + efi-app-x86_64.lo \ elf64-x86-64.lo \ elf64-alpha.lo \ elf64-hppa.lo \ @@ -793,7 +829,11 @@ BFD64_BACKENDS = \ mmo.lo \ nlm32-alpha.lo \ nlm64.lo \ - pepigen.lo + coff-x86_64.lo \ + pe-x86_64.lo \ + pei-x86_64.lo \ + pepigen.lo \ + pex64igen.lo BFD64_BACKENDS_CFILES = \ aix5ppc-core.c \ @@ -802,6 +842,7 @@ BFD64_BACKENDS_CFILES = \ coff64-rs6000.c \ demo64.c \ efi-app-ia64.c \ + efi-app-x86_64.c \ elf64-x86-64.c \ elf64-alpha.c \ elf64-hppa.c \ @@ -816,7 +857,10 @@ BFD64_BACKENDS_CFILES = \ elf64.c \ mmo.c \ nlm32-alpha.c \ - nlm64.c + nlm64.c \ + coff-x86_64.c \ + pe-x86_64.c \ + pei-x86_64.c OPTIONAL_BACKENDS = \ aix386-core.lo \ @@ -852,10 +896,9 @@ CONFIG_STATUS_DEPENDENCIES = \ WORDSIZE = @wordsize@ ALL_BACKENDS = @all_backends@ BFD_BACKENDS = @bfd_backends@ -BFD_LIBS = @bfd_libs@ BFD_MACHINES = @bfd_machines@ TDEFAULTS = @tdefaults@ -INCLUDES = @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) -I$(srcdir)/../intl -I../intl +INCLUDES = @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) @INCINTL@ # C source files that correspond to .o's. SOURCE_CFILES = \ @@ -867,7 +910,7 @@ SOURCE_CFILES = \ $(OPTIONAL_BACKENDS_CFILES) BUILD_CFILES = \ - elf32-ia64.c elf64-ia64.c peigen.c pepigen.c + elf32-ia64.c elf64-ia64.c peigen.c pepigen.c pex64igen.c CFILES = $(SOURCE_CFILES) $(BUILD_CFILES) SOURCE_HFILES = \ @@ -892,11 +935,15 @@ BLD_POTFILES = $(BUILD_CFILES) $(BUILD_HFILES) # BFD_BACKENDS Routines the configured targets need. # BFD_MACHINES Architecture-specific routines the configured targets need. # COREFILE Core file routines for a native configuration -OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@ -libbfd_la_SOURCES = $(BFD32_LIBS_CFILES) $(BFD64_LIBS_CFILES) +# bfd64_libs Routines for 64bit support +OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@ @bfd64_libs@ + +# Since BFD64_LIBS is optional and we can't have substitution in +# libbfd_la_SOURCES, we put BFD64_LIBS in OFILES instead. +libbfd_la_SOURCES = $(BFD32_LIBS_CFILES) libbfd_la_DEPENDENCIES = $(OFILES) ofiles libbfd_la_LIBADD = `cat ofiles` @WIN32LIBADD@ -libbfd_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@ +libbfd_la_LDFLAGS = -release `cat libtool-soversion` @WIN32LDFLAGS@ # libtool will build .libs/libbfd.a. We create libbfd.a in the build # directory so that we don't have to convert all the programs that use @@ -919,7 +966,7 @@ MOSTLYCLEANFILES = ofiles stamp-ofiles CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \ stmp-bin2-h stmp-lbfd-h stmp-lcoff-h -DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) +DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) libtool-soversion all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -931,15 +978,15 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ - cd $(srcdir) && $(AUTOMAKE) --foreign \ + echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus '; \ + cd $(srcdir) && $(AUTOMAKE) --cygnus \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile + $(AUTOMAKE) --cygnus Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -1340,6 +1387,9 @@ targets.lo: targets.c Makefile archures.lo: archures.c Makefile $(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/archures.c +dwarf2.lo: dwarf2.c Makefile + $(LIBTOOL) --mode=compile $(COMPILE) -c -DDEBUGDIR=\"$(DEBUGDIR)\" $(srcdir)/dwarf2.c + elf32-target.h : elfxx-target.h rm -f elf32-target.h sed -e s/NN/32/g < $(srcdir)/elfxx-target.h > elf32-target.new @@ -1369,6 +1419,11 @@ pepigen.c : peXXigen.c rm -f pepigen.c sed -e s/XX/pep/g < $(srcdir)/peXXigen.c > pepigen.new mv -f pepigen.new pepigen.c + +pex64igen.c: peXXigen.c + rm -f pex64igen.c + sed -e s/XX/pex64/g < $(srcdir)/peXXigen.c > pex64igen.new + mv -f pex64igen.new pex64igen.c $(BFD32_LIBS) \ $(BFD64_LIBS) \ $(ALL_MACHINES) \ @@ -1501,11 +1556,20 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/Makefile.in @echo "creating $@" @bfd_version=`echo "$(VERSION)" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ bfd_version_string="\"$(VERSION)\"" ;\ + bfd_soversion="$(VERSION)" ;\ + bfd_version_package="\"$(PKGVERSION)\"" ;\ + report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\ if test "x$(RELEASE)" = x ; then \ bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\ - bfd_version_string="\"$(VERSION) $${bfd_version_date}\"" ;\ + bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\ + bfd_soversion="$(VERSION).$${bfd_version_date}" ;\ fi ;\ - sed -e "s/@bfd_version@/$$bfd_version/" -e "s/@bfd_version_string@/$$bfd_version_string/" < $(srcdir)/version.h > $@ + sed -e "s,@bfd_version@,$$bfd_version," \ + -e "s,@bfd_version_string@,$$bfd_version_string," \ + -e "s,@bfd_version_package@,$$bfd_version_package," \ + -e "s,@report_bugs_to@,$$report_bugs_to," \ + < $(srcdir)/version.h > $@; \ + echo "$${bfd_soversion}" > libtool-soversion # What appears below is generated by a hacked mkdep using gcc -MM. @@ -1516,11 +1580,12 @@ archive.lo: archive.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ $(INCDIR)/safe-ctype.h archures.lo: archures.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/safe-ctype.h -bfd.lo: bfd.c bfdver.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h libcoff.h \ - libecoff.h $(INCDIR)/coff/ecoff.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h +bfd.lo: bfd.c $(INCDIR)/filenames.h bfdver.h $(INCDIR)/libiberty.h \ + $(INCDIR)/demangle.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/sym.h libcoff.h libecoff.h $(INCDIR)/coff/ecoff.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h bfdio.lo: bfdio.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h bfdwin.lo: bfdwin.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cache.lo: cache.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ @@ -1574,6 +1639,7 @@ cpu-arm.lo: cpu-arm.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/libiberty.h cpu-avr.lo: cpu-avr.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-bfin.lo: cpu-bfin.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +cpu-cr16.lo: cpu-cr16.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-cris.lo: cpu-cris.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-cr16c.lo: cpu-cr16c.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-crx.lo: cpu-crx.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h @@ -1606,6 +1672,7 @@ cpu-m10200.lo: cpu-m10200.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-maxq.lo: cpu-maxq.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +cpu-mep.lo: cpu-mep.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-mmix.lo: cpu-mmix.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-mt.lo: cpu-mt.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h @@ -1621,9 +1688,11 @@ cpu-powerpc.lo: cpu-powerpc.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h cpu-rs6000.lo: cpu-rs6000.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-s390.lo: cpu-s390.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +cpu-score.lo: cpu-score.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(srcdir)/../opcodes/sh-opc.h cpu-sparc.lo: cpu-sparc.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +cpu-spu.lo: cpu-spu.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-tic30.lo: cpu-tic30.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-tic4x.lo: cpu-tic4x.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-tic54x.lo: cpu-tic54x.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h @@ -1693,7 +1762,8 @@ coff-arm.lo: coff-arm.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \ - coff-m68k.c $(INCDIR)/hashtab.h libcoff.h $(INCDIR)/bfdlink.h \ + coff-m68k.c $(INCDIR)/hashtab.h $(INCDIR)/coff/m68k.h \ + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/bfdlink.h genlink.h $(INCDIR)/coff/h8300.h \ @@ -1763,7 +1833,7 @@ coff-tic54x.lo: coff-tic54x.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic54x.h \ $(INCDIR)/coff/ti.h $(INCDIR)/coff/internal.h libcoff.h \ coffcode.h coffswap.h -coff-tic80.lo: coff-tic80.c $(INCDIR)/bfdlink.h $(INCDIR)/filenames.h \ +coff-tic80.lo: coff-tic80.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h $(INCDIR)/coff/tic80.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h coff-u68k.lo: coff-u68k.c coff-m68k.c $(INCDIR)/filenames.h \ @@ -1826,11 +1896,16 @@ elf32-arm.lo: elf32-arm.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h + $(INCDIR)/elf/reloc-macros.h elf32-avr.h elf32-target.h elf32-bfin.lo: elf32-bfin.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/bfin.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/elf/dwarf2.h \ + elf32-target.h +elf32-cr16.lo: elf32-cr16.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/elf/cr16.h $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-cr16c.lo: elf32-cr16c.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/cr16c.h \ $(INCDIR)/elf/reloc-macros.h elf-bfd.h $(INCDIR)/elf/common.h \ @@ -1944,19 +2019,24 @@ elf32-mcore.lo: elf32-mcore.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/mcore.h \ $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-mep.lo: elf32-mep.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mep.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ + elf32-target.h elfxx-mips.lo: elfxx-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/libiberty.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ elfxx-mips.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h elf-vxworks.h + elf-vxworks.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ + $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfxx-mips.h \ - $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h elf-vxworks.h \ + $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \ - ecoffswap.h elf32-target.h elf-vxworks.h + ecoffswap.h elf32-target.h elf32-mt.lo: elf32-mt.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mt.h \ @@ -1988,9 +2068,9 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \ - elf32-sh64.h elf32-sh.c $(INCDIR)/hashtab.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ - $(srcdir)/../opcodes/sh-opc.h elf32-target.h + elf32-sh64.h elf32-sh.c $(INCDIR)/hashtab.h elf-vxworks.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ + $(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h elf32-sh64-com.lo: elf32-sh64-com.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ @@ -2000,27 +2080,36 @@ elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h \ $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-score.lo: elf32-score.c $(INCDIR)/filenames.h \ + $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/score.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ - $(srcdir)/../opcodes/sh-opc.h elf32-target.h + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf-vxworks.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ + $(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h elf32-sh-symbian.lo: elf32-sh-symbian.c elf32-sh.c \ $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/libiberty.h $(srcdir)/../opcodes/sh-opc.h \ - elf32-target.h + $(INCDIR)/elf/external.h elf-vxworks.h $(INCDIR)/elf/sh.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ + $(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h elfxx-sparc.lo: elfxx-sparc.c $(INCDIR)/filenames.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \ - elfxx-sparc.h elf-vxworks.h + $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/sparc.h elfxx-sparc.h elf-vxworks.h elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \ - elfxx-sparc.h elf32-target.h elf-vxworks.h + elfxx-sparc.h elf-vxworks.h elf32-target.h +elf32-spu.lo: elf32-spu.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/spu.h \ + $(INCDIR)/elf/reloc-macros.h elf32-spu.h elf32-target.h elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h \ @@ -2052,6 +2141,9 @@ elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/libiberty.h $(INCDIR)/objalloc.h +elf-attrs.lo: elf-attrs.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf-strtab.lo: elf-strtab.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h @@ -2136,7 +2228,7 @@ m88kopenbsd.lo: m88kopenbsd.c netbsd.h $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h libaout.h $(INCDIR)/bfdlink.h aout-target.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ $(INCDIR)/aout/ar.h -mach-o.lo: mach-o.c mach-o.h $(INCDIR)/filenames.h \ +mach-o.lo: mach-o.c $(INCDIR)/filenames.h mach-o.h \ $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h mach-o-target.c mipsbsd.lo: mipsbsd.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ @@ -2176,8 +2268,8 @@ pdp11.lo: pdp11.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ $(INCDIR)/safe-ctype.h -pef.lo: pef.c $(INCDIR)/safe-ctype.h pef.h pef-traceback.h \ - $(INCDIR)/filenames.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h +pef.lo: pef.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ + pef.h pef-traceback.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h pe-arm.lo: pe-arm.c $(INCDIR)/filenames.h coff-arm.c \ $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ @@ -2186,6 +2278,16 @@ pei-arm.lo: pei-arm.c $(INCDIR)/filenames.h coff-arm.c \ $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h +pe-arm-wince.lo: pe-arm-wince.c pe-arm.c $(INCDIR)/filenames.h \ + coff-arm.c $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +pei-arm-wince.lo: pei-arm-wince.c pei-arm.c $(INCDIR)/filenames.h \ + coff-arm.c $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h pe-i386.lo: pe-i386.c $(INCDIR)/filenames.h coff-i386.c \ $(INCDIR)/hashtab.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ @@ -2228,7 +2330,7 @@ pei-mips.lo: pei-mips.c $(INCDIR)/filenames.h pe-mips.c \ $(INCDIR)/hashtab.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -ppcboot.lo: ppcboot.c $(INCDIR)/safe-ctype.h $(INCDIR)/filenames.h \ +ppcboot.lo: ppcboot.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/hashtab.h reloc16.lo: reloc16.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/bfdlink.h genlink.h $(INCDIR)/coff/internal.h \ @@ -2269,7 +2371,7 @@ vms.lo: vms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h vms.h vms-gsd.lo: vms-gsd.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h vms.h -vms-hdr.lo: vms-hdr.c bfdver.h $(INCDIR)/filenames.h \ +vms-hdr.lo: vms-hdr.c $(INCDIR)/filenames.h bfdver.h \ $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/hashtab.h \ vms.h vms-misc.lo: vms-misc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ @@ -2279,12 +2381,12 @@ vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h \ libcoff.h libxcoff.h -xsym.lo: xsym.c xsym.h $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +xsym.lo: xsym.c $(INCDIR)/filenames.h xsym.h $(INCDIR)/hashtab.h xtensa-isa.lo: xtensa-isa.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/xtensa-isa.h $(INCDIR)/xtensa-isa-internal.h xtensa-modules.lo: xtensa-modules.c $(INCDIR)/xtensa-isa.h \ $(INCDIR)/xtensa-isa-internal.h -aix5ppc-core.lo: aix5ppc-core.c +aix5ppc-core.lo: aix5ppc-core.c $(INCDIR)/filenames.h aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/hashtab.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h @@ -2306,6 +2408,11 @@ efi-app-ia64.lo: efi-app-ia64.c $(INCDIR)/filenames.h \ $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ peicode.h libpei.h +efi-app-x86_64.lo: efi-app-x86_64.c $(INCDIR)/filenames.h \ + coff-x86_64.c $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h \ + coffcode.h peicode.h libpei.h elf64-x86-64.lo: elf64-x86-64.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/x86-64.h \ @@ -2374,6 +2481,21 @@ nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \ nlm64.lo: nlm64.c nlmcode.h $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ $(INCDIR)/nlm/external.h +coff-x86_64.lo: coff-x86_64.c $(INCDIR)/filenames.h \ + $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h coffcode.h \ + coffswap.h +pe-x86_64.lo: pe-x86_64.c $(INCDIR)/filenames.h coff-x86_64.c \ + $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h coffcode.h \ + peicode.h libpei.h +pei-x86_64.lo: pei-x86_64.c $(INCDIR)/filenames.h coff-x86_64.c \ + $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h coffcode.h \ + peicode.h libpei.h aix386-core.lo: aix386-core.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h @@ -2390,18 +2512,21 @@ elf32-ia64.lo: elf32-ia64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h \ $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h \ - elf32-target.h + $(INCDIR)/hashtab.h elf32-target.h elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h \ $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h \ - elf64-target.h + $(INCDIR)/hashtab.h elf64-target.h peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h pepigen.lo: pepigen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/ia64.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h +pex64igen.lo: pex64igen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/bfd/acinclude.m4 b/bfd/acinclude.m4 index 95e3d4a702d..cd4fd55be6c 100644 --- a/bfd/acinclude.m4 +++ b/bfd/acinclude.m4 @@ -1,7 +1,3 @@ -sinclude(../config/acx.m4) -sinclude(../bfd/bfd.m4) -sinclude(../bfd/warning.m4) - dnl See whether we need to use fopen-bin.h rather than fopen-same.h. AC_DEFUN([BFD_BINARY_FOPEN], [AC_REQUIRE([AC_CANONICAL_TARGET]) @@ -45,22 +41,6 @@ else fi AC_SUBST(EXEEXT_FOR_BUILD)])dnl -sinclude(../libtool.m4) -dnl The lines below arrange for aclocal not to bring libtool.m4 -dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake -dnl to add a definition of LIBTOOL to Makefile.in. -ifelse(yes,no,[ -AC_DEFUN([AM_PROG_LIBTOOL],) -AC_DEFUN([AM_DISABLE_SHARED],) -AC_SUBST(LIBTOOL) -]) - -sinclude(../gettext.m4) -ifelse(yes,no,[ -AC_DEFUN([CY_WITH_NLS],) -AC_SUBST(INTLLIBS) -]) - AC_DEFUN([AM_INSTALL_LIBBFD], [AC_MSG_CHECKING([whether to install libbfd]) AC_ARG_ENABLE(install-libbfd, diff --git a/bfd/aclocal.m4 b/bfd/aclocal.m4 index d5f315805a9..9dfea067fbf 100644 --- a/bfd/aclocal.m4 +++ b/bfd/aclocal.m4 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.9.5 -*- Autoconf -*- +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005 Free Software Foundation, Inc. @@ -28,7 +28,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.9.5])]) + [AM_AUTOMAKE_VERSION([1.9.6])]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -480,27 +480,6 @@ AC_DEFUN([AM_PROG_INSTALL_SH], install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering @@ -889,4 +868,18 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR +m4_include([../config/acx.m4]) +m4_include([../config/depstand.m4]) +m4_include([../config/gettext-sister.m4]) +m4_include([../config/lead-dot.m4]) +m4_include([../config/nls.m4]) +m4_include([../config/po.m4]) +m4_include([../config/progtest.m4]) +m4_include([../config/stdint.m4]) +m4_include([../libtool.m4]) +m4_include([../ltoptions.m4]) +m4_include([../ltsugar.m4]) +m4_include([../ltversion.m4]) +m4_include([bfd.m4]) +m4_include([warning.m4]) m4_include([acinclude.m4]) diff --git a/bfd/aix386-core.c b/bfd/aix386-core.c index 17a0290e354..7730011a64f 100644 --- a/bfd/aix386-core.c +++ b/bfd/aix386-core.c @@ -2,7 +2,7 @@ This was based on trad-core.c, which was written by John Gilmore of Cygnus Support. Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1996, 1998, 1999, 2000, - 2001, 2002, 2004 + 2001, 2002, 2004, 2006, 2007 Free Software Foundation, Inc. Written by Minh Tran-Le . Converted to back end form by Ian Lance Taylor . @@ -23,8 +23,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/i386.h" #include "coff/internal.h" @@ -80,6 +80,7 @@ aix386_core_file_p (abfd) struct trad_core_struct coredata; struct corehdr internal_core; } *mergem; + flagword flags; amt = sizeof (longbuf); if (bfd_bread ((PTR) longbuf, amt, abfd) != amt) @@ -117,11 +118,12 @@ aix386_core_file_p (abfd) core_hdr (abfd) = core; /* Create the sections. */ - core_regsec (abfd) = bfd_make_section_anyway (abfd, ".reg"); + flags = SEC_HAS_CONTENTS; + core_regsec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".reg", + flags); if (core_regsec (abfd) == NULL) goto loser; - core_regsec (abfd)->flags = SEC_HAS_CONTENTS; core_regsec (abfd)->size = sizeof (core->cd_regs); core_regsec (abfd)->vma = (bfd_vma) -1; @@ -129,12 +131,13 @@ aix386_core_file_p (abfd) core_regsec (abfd)->filepos = (file_ptr) offsetof (struct corehdr, cd_regs[0]); - core_reg2sec (abfd) = bfd_make_section_anyway (abfd, ".reg2"); + flags = SEC_HAS_CONTENTS; + core_reg2sec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".reg2", + flags); if (core_reg2sec (abfd) == NULL) /* bfd_release frees everything allocated after it's arg. */ goto loser; - core_reg2sec (abfd)->flags = SEC_HAS_CONTENTS; core_reg2sec (abfd)->size = sizeof (core->cd_fpregs); core_reg2sec (abfd)->vma = (bfd_vma) -1; core_reg2sec (abfd)->filepos = @@ -175,11 +178,12 @@ aix386_core_file_p (abfd) flags = SEC_ALLOC + SEC_HAS_CONTENTS; break; } - core_section (abfd, n) = bfd_make_section_anyway (abfd, sname); + core_section (abfd, n) = bfd_make_section_anyway_with_flags (abfd, + sname, + flags); if (core_section (abfd, n) == NULL) goto loser; - core_section (abfd, n)->flags = flags; core_section (abfd, n)->size = core->cd_segs[i].cs_len; core_section (abfd, n)->vma = core->cd_segs[i].cs_address; core_section (abfd, n)->filepos = core->cd_segs[i].cs_offset; diff --git a/bfd/aix5ppc-core.c b/bfd/aix5ppc-core.c index ee2a223d9e5..ef1447b946f 100644 --- a/bfd/aix5ppc-core.c +++ b/bfd/aix5ppc-core.c @@ -1,5 +1,5 @@ /* IBM RS/6000 "XCOFF" back-end for BFD. - Copyright 2001, 2002, 2003, 2004, 2005 + Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Tom Rix Contributed by Red Hat Inc. @@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "sysdep.h" #include "bfd.h" const bfd_target *xcoff64_core_p (bfd *); @@ -30,7 +31,6 @@ int xcoff64_core_file_failing_signal (bfd *); #ifdef AIX_5_CORE -#include "sysdep.h" #include "libbfd.h" /* Aix 5.1 system include file. */ @@ -56,6 +56,7 @@ xcoff64_core_p (bfd *abfd) bfd_size_type i; struct vm_infox vminfo; const bfd_target *return_value = NULL; + flagword flags; /* Get the header. */ if (bfd_seek (abfd, 0, SEEK_SET) != 0) @@ -117,21 +118,21 @@ xcoff64_core_p (bfd *abfd) abfd->tdata.any = new_core_hdr; /* .stack section. */ - sec = bfd_make_section_anyway (abfd, ".stack"); + flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS; + sec = bfd_make_section_anyway_with_flags (abfd, ".stack", flags); if (NULL == sec) return return_value; - sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS; sec->size = core.c_size; sec->vma = core.c_stackorg; sec->filepos = core.c_stack; /* .reg section for all registers. */ - sec = bfd_make_section_anyway (abfd, ".reg"); + flags = SEC_HAS_CONTENTS | SEC_IN_MEMORY; + sec = bfd_make_section_anyway_with_flags (abfd, ".reg", flags); if (NULL == sec) return return_value; - sec->flags = SEC_HAS_CONTENTS | SEC_IN_MEMORY; sec->size = sizeof (struct __context64); sec->vma = 0; sec->filepos = 0; @@ -141,11 +142,11 @@ xcoff64_core_p (bfd *abfd) To actually find out how long this section is in this particular core dump would require going down the whole list of struct ld_info's. See if we can just fake it. */ - sec = bfd_make_section_anyway (abfd, ".ldinfo"); + flags = SEC_HAS_CONTENTS; + sec = bfd_make_section_anyway_with_flags (abfd, ".ldinfo", flags); if (NULL == sec) return return_value; - sec->flags = SEC_HAS_CONTENTS; sec->size = core.c_lsize; sec->vma = 0; sec->filepos = core.c_loader; @@ -155,11 +156,11 @@ xcoff64_core_p (bfd *abfd) regions. */ /* .data section from executable. */ - sec = bfd_make_section_anyway (abfd, ".data"); + flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS; + sec = bfd_make_section_anyway_with_flags (abfd, ".data", flags); if (NULL == sec) return return_value; - sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS; sec->size = core.c_datasize; sec->vma = core.c_dataorg; sec->filepos = core.c_data; @@ -178,11 +179,11 @@ xcoff64_core_p (bfd *abfd) if (ldinfo.ldinfo_core) { - sec = bfd_make_section_anyway (abfd, ".data"); + flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS; + sec = bfd_make_section_anyway_with_flags (abfd, ".data", flags); if (NULL == sec) return return_value; - sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS; sec->size = ldinfo.ldinfo_datasize; sec->vma = ldinfo.ldinfo_dataorg; sec->filepos = ldinfo.ldinfo_core; @@ -206,11 +207,11 @@ xcoff64_core_p (bfd *abfd) if (vminfo.vminfo_offset) { - sec = bfd_make_section_anyway (abfd, ".vmdata"); + flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS; + sec = bfd_make_section_anyway_with_flags (abfd, ".vmdata", flags); if (NULL == sec) return return_value; - sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS; sec->size = vminfo.vminfo_size; sec->vma = vminfo.vminfo_addr; sec->filepos = vminfo.vminfo_offset; diff --git a/bfd/aout-adobe.c b/bfd/aout-adobe.c index 93182f7ad85..203738ebb40 100644 --- a/bfd/aout-adobe.c +++ b/bfd/aout-adobe.c @@ -1,6 +1,6 @@ /* BFD back-end for a.out.adobe binaries. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005 + 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. Based on bout.c. @@ -20,8 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "aout/adobe.h" #include "aout/stab_gnu.h" @@ -132,7 +132,7 @@ aout_adobe_callback (bfd *abfd) /* First one is called ".text" or whatever; subsequent ones are ".text1", ".text2", ... */ bfd_set_error (bfd_error_no_error); - sect = bfd_make_section (abfd, section_name); + sect = bfd_make_section_with_flags (abfd, section_name, flags); trynum = 0; while (!sect) @@ -141,7 +141,7 @@ aout_adobe_callback (bfd *abfd) /* Some other error -- slide into the sunset. */ return NULL; sprintf (try_again, "%s%d", section_name, ++trynum); - sect = bfd_make_section (abfd, try_again); + sect = bfd_make_section_with_flags (abfd, try_again, flags); } /* Fix the name, if it is a sprintf'd name. */ @@ -155,8 +155,6 @@ aout_adobe_callback (bfd *abfd) sect->name = newname; } - /* Now set the section's attributes. */ - bfd_set_section_flags (abfd, sect, flags); /* Assumed big-endian. */ sect->size = ((ext->e_size[0] << 8) | ext->e_size[1] << 8 @@ -443,7 +441,7 @@ aout_adobe_set_arch_mach (bfd *abfd, static int aout_adobe_sizeof_headers (bfd *ignore_abfd ATTRIBUTE_UNUSED, - bfd_boolean ignore ATTRIBUTE_UNUSED) + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return sizeof (struct internal_exec); } @@ -452,6 +450,7 @@ aout_adobe_sizeof_headers (bfd *ignore_abfd ATTRIBUTE_UNUSED, #define aout_32_bfd_make_debug_symbol ((asymbol *(*) (bfd *, void *, unsigned long)) bfd_nullvoidptr) #define aout_32_bfd_reloc_type_lookup ((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr) +#define aout_32_bfd_reloc_name_lookup ((reloc_howto_type *(*) (bfd *, const char *)) bfd_nullvoidptr) #define aout_32_close_and_cleanup aout_32_bfd_free_cached_info #define aout_32_set_arch_mach aout_adobe_set_arch_mach #define aout_32_set_section_contents aout_adobe_set_section_contents diff --git a/bfd/aout-arm.c b/bfd/aout-arm.c index d8834a4f331..4b0d42c1aca 100644 --- a/bfd/aout-arm.c +++ b/bfd/aout-arm.c @@ -1,6 +1,6 @@ /* BFD back-end for raw ARM a.out binaries. - Copyright 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 - Free Software Foundation, Inc. + Copyright 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, + 2007 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" /* Avoid multiple definitions from aoutx if supporting standard a.out as well as our own. */ @@ -50,6 +50,7 @@ #define N_MAGIC(x) ((x).a_info & ~07200) #define MY_bfd_reloc_type_lookup aoutarm_bfd_reloc_type_lookup +#define MY_bfd_reloc_name_lookup aoutarm_bfd_reloc_name_lookup #include "libaout.h" #include "aout/aout64.h" @@ -317,6 +318,22 @@ MY (bfd_reloc_type_lookup) (bfd *abfd, } } +static reloc_howto_type * +MY (bfd_reloc_name_lookup) (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (MY (howto_table)) / sizeof (MY (howto_table)[0]); + i++) + if (MY (howto_table)[i].name != NULL + && strcasecmp (MY (howto_table)[i].name, r_name) == 0) + return &MY (howto_table)[i]; + + return NULL; +} + #define MY_swap_std_reloc_in MY (swap_std_reloc_in) #define MY_swap_std_reloc_out MY (swap_std_reloc_out) #define MY_get_section_contents _bfd_generic_get_section_contents diff --git a/bfd/aout-ns32k.c b/bfd/aout-ns32k.c index cc9f06d8dab..46eac5c1ccd 100644 --- a/bfd/aout-ns32k.c +++ b/bfd/aout-ns32k.c @@ -1,6 +1,6 @@ /* BFD back-end for ns32k a.out-ish binaries. Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1998, 1999, 2000, 2001, - 2002, 2003, 2005 Free Software Foundation, Inc. + 2002, 2003, 2005, 2007 Free Software Foundation, Inc. Contributed by Ian Dall (idall@eleceng.adelaide.edu.au). This file is part of BFD, the Binary File Descriptor library. @@ -28,8 +28,9 @@ the tokens. */ #define MYNS(OP) CONCAT2 (ns32kaout_,OP) -reloc_howto_type * MYNS (bfd_reloc_type_lookup) (bfd * abfd, bfd_reloc_code_real_type); -bfd_boolean MYNS (write_object_contents) (bfd *abfd); +reloc_howto_type * MYNS (bfd_reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); +reloc_howto_type * MYNS (bfd_reloc_name_lookup) (bfd *, const char *); +bfd_boolean MYNS (write_object_contents) (bfd *); /* Avoid multiple definitions from aoutx if supporting standard a.out format(s) as well as this one. */ @@ -246,6 +247,22 @@ MY (bfd_reloc_type_lookup) (bfd *abfd, bfd_reloc_code_real_type code) #undef ENTRY } +reloc_howto_type * +MY (bfd_reloc_name_lookup) (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (MY (howto_table)) / sizeof (MY (howto_table)[0]); + i++) + if (MY (howto_table)[i].name != NULL + && strcasecmp (MY (howto_table)[i].name, r_name) == 0) + return &MY (howto_table)[i]; + + return NULL; +} + static void MY_swap_std_reloc_in (bfd *abfd, struct reloc_std_external *bytes, @@ -274,11 +291,8 @@ MY_swap_std_reloc_out (bfd *abfd, int r_index; asymbol *sym = *(g->sym_ptr_ptr); int r_extern; - unsigned int r_addend; asection *output_section = sym->section->output_section; - r_addend = g->addend + (*(g->sym_ptr_ptr))->section->output_section->vma; - /* Name was clobbered by aout_write_syms to be symbol index. */ /* If this relocation is relative to a symbol then set the @@ -341,7 +355,6 @@ _bfd_ns32k_relocate_contents (reloc_howto_type *howto, case 2: return _bfd_relocate_contents (howto, input_bfd, relocation, location); - break; default: return bfd_reloc_notsupported; } diff --git a/bfd/aout-target.h b/bfd/aout-target.h index 5a30eda7414..3e5fa910170 100644 --- a/bfd/aout-target.h +++ b/bfd/aout-target.h @@ -1,6 +1,6 @@ /* Define a target vector and some small routines for a variant of a.out. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 + 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -29,6 +29,7 @@ #endif extern reloc_howto_type * NAME (aout, reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); +extern reloc_howto_type * NAME (aout, reloc_name_lookup) (bfd *, const char *); /* Set parameters about this a.out file that are machine-dependent. This routine is called from some_aout_object_p just before it returns. */ @@ -494,6 +495,9 @@ MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info) #ifndef MY_bfd_reloc_type_lookup #define MY_bfd_reloc_type_lookup NAME (aout, reloc_type_lookup) #endif +#ifndef MY_bfd_reloc_name_lookup +#define MY_bfd_reloc_name_lookup NAME (aout, reloc_name_lookup) +#endif #ifndef MY_bfd_make_debug_symbol #define MY_bfd_make_debug_symbol 0 #endif diff --git a/bfd/aout-tic30.c b/bfd/aout-tic30.c index 0feb99decb1..6e8be1ee9a0 100644 --- a/bfd/aout-tic30.c +++ b/bfd/aout-tic30.c @@ -1,5 +1,5 @@ /* BFD back-end for TMS320C30 a.out binaries. - Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au) @@ -35,8 +35,8 @@ #define TARGETNAME "a.out-tic30" #define NAME(x,y) CONCAT3 (tic30_aout,_32_,y) -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libaout.h" #include "aout/aout64.h" #include "aout/stab_gnu.h" @@ -270,6 +270,23 @@ tic30_aout_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, } } +static reloc_howto_type * +tic30_aout_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (tic30_aout_howto_table) + / sizeof (tic30_aout_howto_table[0])); + i++) + if (tic30_aout_howto_table[i].name != NULL + && strcasecmp (tic30_aout_howto_table[i].name, r_name) == 0) + return &tic30_aout_howto_table[i]; + + return NULL; +} + static reloc_howto_type * tic30_aout_reloc_howto (bfd *abfd, struct reloc_std_external *relocs, @@ -936,6 +953,9 @@ tic30_aout_set_arch_mach (bfd *abfd, #ifndef MY_bfd_reloc_type_lookup #define MY_bfd_reloc_type_lookup tic30_aout_reloc_type_lookup #endif +#ifndef MY_bfd_reloc_name_lookup +#define MY_bfd_reloc_name_lookup tic30_aout_reloc_name_lookup +#endif #ifndef MY_bfd_make_debug_symbol #define MY_bfd_make_debug_symbol 0 #endif diff --git a/bfd/aoutf1.h b/bfd/aoutf1.h index cba4fbbeff9..0353bfdc3f2 100644 --- a/bfd/aoutf1.h +++ b/bfd/aoutf1.h @@ -1,6 +1,6 @@ /* A.out "format 1" file handling code for BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, - 2001, 2002, 2003, 2004, 2005, 2006 + 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -20,8 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "aout/sun4.h" @@ -566,6 +566,7 @@ sunos4_core_file_p (bfd *abfd) struct internal_sunos_core internal_sunos_core; char external_core[1]; } *mergem; + flagword flags; if (bfd_bread ((void *) longbuf, (bfd_size_type) sizeof (longbuf), abfd) != sizeof (longbuf)) @@ -627,28 +628,31 @@ sunos4_core_file_p (bfd *abfd) abfd->tdata.sun_core_data->hdr = core; /* Create the sections. */ - core_stacksec (abfd) = bfd_make_section_anyway (abfd, ".stack"); + flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; + core_stacksec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".stack", + flags); if (core_stacksec (abfd) == NULL) /* bfd_release frees everything allocated after it's arg. */ goto loser; - core_datasec (abfd) = bfd_make_section_anyway (abfd, ".data"); + flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; + core_datasec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".data", + flags); if (core_datasec (abfd) == NULL) goto loser; - core_regsec (abfd) = bfd_make_section_anyway (abfd, ".reg"); + flags = SEC_HAS_CONTENTS; + core_regsec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".reg", + flags); if (core_regsec (abfd) == NULL) goto loser; - core_reg2sec (abfd) = bfd_make_section_anyway (abfd, ".reg2"); + flags = SEC_HAS_CONTENTS; + core_reg2sec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".reg2", + flags); if (core_reg2sec (abfd) == NULL) goto loser; - core_stacksec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; - core_datasec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; - core_regsec (abfd)->flags = SEC_HAS_CONTENTS; - core_reg2sec (abfd)->flags = SEC_HAS_CONTENTS; - core_stacksec (abfd)->size = core->c_ssize; core_datasec (abfd)->size = core->c_dsize; core_regsec (abfd)->size = core->c_regs_size; diff --git a/bfd/aoutx.h b/bfd/aoutx.h index 7dce07240ff..09331aa0ca2 100644 --- a/bfd/aoutx.h +++ b/bfd/aoutx.h @@ -1,6 +1,6 @@ /* BFD semi-generic back-end for a.out binaries. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -118,8 +118,8 @@ DESCRIPTION #define KEEPIT udata.i -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "safe-ctype.h" #include "bfdlink.h" @@ -129,8 +129,6 @@ DESCRIPTION #include "aout/stab_gnu.h" #include "aout/ar.h" -reloc_howto_type * NAME (aout, reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); - /* SUBSECTION Relocations @@ -319,6 +317,31 @@ NAME (aout, reloc_type_lookup) (bfd *abfd, bfd_reloc_code_real_type code) } } +reloc_howto_type * +NAME (aout, reloc_name_lookup) (bfd *abfd, const char *r_name) +{ + unsigned int i, size; + reloc_howto_type *howto_table; + + if (obj_reloc_entry_size (abfd) == RELOC_EXT_SIZE) + { + howto_table = howto_table_ext; + size = sizeof (howto_table_ext) / sizeof (howto_table_ext[0]); + } + else + { + howto_table = howto_table_std; + size = sizeof (howto_table_std) / sizeof (howto_table_std[0]); + } + + for (i = 0; i < size; i++) + if (howto_table[i].name != NULL + && strcasecmp (howto_table[i].name, r_name) == 0) + return &howto_table[i]; + + return NULL; +} + /* SUBSECTION Internal entry points @@ -1193,26 +1216,21 @@ NAME (aout, new_section_hook) (bfd *abfd, asection *newsect) { obj_textsec (abfd)= newsect; newsect->target_index = N_TEXT; - return TRUE; } - - if (obj_datasec (abfd) == NULL && !strcmp (newsect->name, ".data")) + else if (obj_datasec (abfd) == NULL && !strcmp (newsect->name, ".data")) { obj_datasec (abfd) = newsect; newsect->target_index = N_DATA; - return TRUE; } - - if (obj_bsssec (abfd) == NULL && !strcmp (newsect->name, ".bss")) + else if (obj_bsssec (abfd) == NULL && !strcmp (newsect->name, ".bss")) { obj_bsssec (abfd) = newsect; newsect->target_index = N_BSS; - return TRUE; } } /* We allow more than three sections internally. */ - return TRUE; + return _bfd_generic_new_section_hook (abfd, newsect); } bfd_boolean @@ -1934,7 +1952,10 @@ NAME (aout, swap_std_reloc_out) (bfd *abfd, if (bfd_is_com_section (output_section) || bfd_is_abs_section (output_section) - || bfd_is_und_section (output_section)) + || bfd_is_und_section (output_section) + /* PR gas/3041 a.out relocs against weak symbols + must be treated as if they were against externs. */ + || (sym->flags & BSF_WEAK)) { if (bfd_abs_section_ptr->symbol == sym) { @@ -2785,7 +2806,8 @@ NAME (aout, find_nearest_line) (bfd *abfd, } int -NAME (aout, sizeof_headers) (bfd *abfd, bfd_boolean execable ATTRIBUTE_UNUSED) +NAME (aout, sizeof_headers) (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return adata (abfd).exec_bytes_size; } diff --git a/bfd/archive.c b/bfd/archive.c index 5a12f01f7cc..053ad47dfdd 100644 --- a/bfd/archive.c +++ b/bfd/archive.c @@ -1,6 +1,6 @@ /* BFD back-end for archive files (libraries). Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault. @@ -129,8 +129,8 @@ SUBSECTION " 18 " - Long name 18 characters long, extended pseudo-BSD. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libiberty.h" #include "libbfd.h" #include "aout/ar.h" @@ -666,10 +666,7 @@ bfd_generic_archive_p (bfd *abfd) first = bfd_openr_next_archived_file (abfd, NULL); if (first != NULL) { - bfd_boolean fail; - first->target_defaulted = FALSE; - fail = FALSE; if (bfd_check_format (first, bfd_object) && first->xvec != abfd->xvec) { @@ -915,12 +912,12 @@ bfd_slurp_armap (bfd *abfd) if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0) return FALSE; - if (!strncmp (nextname, "__.SYMDEF ", 16) - || !strncmp (nextname, "__.SYMDEF/ ", 16)) /* old Linux archives */ + if (CONST_STRNEQ (nextname, "__.SYMDEF ") + || CONST_STRNEQ (nextname, "__.SYMDEF/ ")) /* Old Linux archives. */ return do_slurp_bsd_armap (abfd); - else if (!strncmp (nextname, "/ ", 16)) + else if (CONST_STRNEQ (nextname, "/ ")) return do_slurp_coff_armap (abfd); - else if (!strncmp (nextname, "/SYM64/ ", 16)) + else if (CONST_STRNEQ (nextname, "/SYM64/ ")) { /* 64bit ELF (Irix 6) archive. */ #ifdef BFD64 @@ -966,11 +963,11 @@ bfd_slurp_bsd_armap_f2 (bfd *abfd) if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0) return FALSE; - if (!strncmp (nextname, "__.SYMDEF ", 16) - || !strncmp (nextname, "__.SYMDEF/ ", 16)) /* Old Linux archives. */ + if (CONST_STRNEQ (nextname, "__.SYMDEF ") + || CONST_STRNEQ (nextname, "__.SYMDEF/ ")) /* Old Linux archives. */ return do_slurp_bsd_armap (abfd); - if (strncmp (nextname, "/ ", 16)) + if (! CONST_STRNEQ (nextname, "/ ")) { bfd_has_map (abfd) = FALSE; return TRUE; @@ -1066,8 +1063,8 @@ _bfd_slurp_extended_name_table (bfd *abfd) if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0) return FALSE; - if (strncmp (nextname, "ARFILENAMES/ ", 16) != 0 && - strncmp (nextname, "// ", 16) != 0) + if (! CONST_STRNEQ (nextname, "ARFILENAMES/ ") + && ! CONST_STRNEQ (nextname, "// ")) { bfd_ardata (abfd)->extended_names = NULL; bfd_ardata (abfd)->extended_names_size = 0; @@ -1237,7 +1234,9 @@ _bfd_construct_extended_name_table (bfd *abfd, *tablen = 0; /* Figure out how long the table should be. */ - for (current = abfd->archive_head; current != NULL; current = current->next) + for (current = abfd->archive_head; + current != NULL; + current = current->archive_next) { const char *normal; unsigned int thislen; @@ -1289,8 +1288,9 @@ _bfd_construct_extended_name_table (bfd *abfd, *tablen = total_namelen; strptr = *tabloc; - for (current = abfd->archive_head; current != NULL; current = - current->next) + for (current = abfd->archive_head; + current != NULL; + current = current->archive_next) { const char *normal; unsigned int thislen; @@ -1339,7 +1339,7 @@ hpux_uid_gid_encode (char str[6], long int id) str[5] = '@' + (id & 3); id >>= 2; - for (cnt = 4; cnt >= 0; ++cnt, id >>= 6) + for (cnt = 4; cnt >= 0; --cnt, id >>= 6) str[cnt] = ' ' + (id & 0x3f); } #endif /* HPUX_LARGE_AR_IDS */ @@ -1640,7 +1640,9 @@ _bfd_write_archive_contents (bfd *arch) /* Verify the viability of all entries; if any of them live in the filesystem (as opposed to living in an archive open for input) then construct a fresh ar_hdr for them. */ - for (current = arch->archive_head; current; current = current->next) + for (current = arch->archive_head; + current != NULL; + current = current->archive_next) { /* This check is checking the bfds for the objects we're reading from (which are usually either an object file or archive on @@ -1650,14 +1652,14 @@ _bfd_write_archive_contents (bfd *arch) if (bfd_write_p (current)) { bfd_set_error (bfd_error_invalid_operation); - return FALSE; + goto input_err; } if (!current->arelt_data) { current->arelt_data = bfd_ar_hdr_from_filesystem (arch, current->filename, current); if (!current->arelt_data) - return FALSE; + goto input_err; /* Put in the file name. */ BFD_SEND (arch, _bfd_truncate_arname, @@ -1708,7 +1710,9 @@ _bfd_write_archive_contents (bfd *arch) } } - for (current = arch->archive_head; current; current = current->next) + for (current = arch->archive_head; + current != NULL; + current = current->archive_next) { char buffer[DEFAULT_BUFFERSIZE]; unsigned int remaining = arelt_size (current); @@ -1719,7 +1723,7 @@ _bfd_write_archive_contents (bfd *arch) != sizeof (*hdr)) return FALSE; if (bfd_seek (current, (file_ptr) 0, SEEK_SET) != 0) - return FALSE; + goto input_err; while (remaining) { unsigned int amt = DEFAULT_BUFFERSIZE; @@ -1729,8 +1733,8 @@ _bfd_write_archive_contents (bfd *arch) if (bfd_bread (buffer, amt, current) != amt) { if (bfd_get_error () != bfd_error_system_call) - bfd_set_error (bfd_error_malformed_archive); - return FALSE; + bfd_set_error (bfd_error_file_truncated); + goto input_err; } if (bfd_bwrite (buffer, amt, arch) != amt) return FALSE; @@ -1763,6 +1767,10 @@ _bfd_write_archive_contents (bfd *arch) } return TRUE; + + input_err: + bfd_set_error (bfd_error_on_input, current, bfd_get_error ()); + return FALSE; } /* Note that the namidx for the first symbol is 0. */ @@ -1801,12 +1809,12 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength) /* Drop all the files called __.SYMDEF, we're going to make our own. */ while (arch->archive_head && strcmp (arch->archive_head->filename, "__.SYMDEF") == 0) - arch->archive_head = arch->archive_head->next; + arch->archive_head = arch->archive_head->archive_next; /* Map over each element. */ for (current = arch->archive_head; current != NULL; - current = current->next, elt_no++) + current = current->archive_next, elt_no++) { if (bfd_check_format (current, bfd_object) && (bfd_get_file_flags (current) & HAS_SYMS) != 0) @@ -1963,7 +1971,7 @@ bsd_write_armap (bfd *arch, { firstreal += arelt_size (current) + sizeof (struct ar_hdr); firstreal += firstreal % 2; - current = current->next; + current = current->archive_next; } while (current != map[count].u.abfd); } @@ -2133,7 +2141,7 @@ coff_write_armap (bfd *arch, archive_member_file_ptr += arelt_size (current) + sizeof (struct ar_hdr); /* Remember aboout the even alignment. */ archive_member_file_ptr += archive_member_file_ptr % 2; - current = current->next; + current = current->archive_next; } /* Now write the strings themselves. */ diff --git a/bfd/archive64.c b/bfd/archive64.c index 3b28f853c21..5e2bf1198c2 100644 --- a/bfd/archive64.c +++ b/bfd/archive64.c @@ -1,30 +1,30 @@ /* MIPS-specific support for 64-bit ELF - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2007 Free Software Foundation, Inc. Ian Lance Taylor, Cygnus Support Linker support added by Mark Mitchell, CodeSourcery, LLC. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -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 2 of the License, or -(at your option) any later version. + 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 2 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. + 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. */ + 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. */ /* This file supports the 64-bit (MIPS) ELF archives. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "aout/ar.h" @@ -65,10 +65,10 @@ bfd_elf64_archive_slurp_armap (bfd *abfd) return FALSE; /* Archives with traditional armaps are still permitted. */ - if (strncmp (nextname, "/ ", 16) == 0) + if (CONST_STRNEQ (nextname, "/ ")) return bfd_slurp_armap (abfd); - if (strncmp (nextname, "/SYM64/ ", 16) != 0) + if (! CONST_STRNEQ (nextname, "/SYM64/ ")) { bfd_has_map (abfd) = FALSE; return TRUE; @@ -215,7 +215,7 @@ bfd_elf64_archive_write_armap (bfd *arch, + sizeof (struct ar_hdr)); /* remember about the even alignment */ archive_member_file_ptr += archive_member_file_ptr % 2; - current = current->next; + current = current->archive_next; } /* now write the strings themselves */ diff --git a/bfd/archures.c b/bfd/archures.c index f4080a63a46..df4e788b79e 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -1,6 +1,6 @@ /* BFD library support routines for architectures. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Hacked by John Gilmore and Steve Chamberlain of Cygnus Support. @@ -20,8 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "safe-ctype.h" @@ -80,22 +80,26 @@ DESCRIPTION .#define bfd_mach_m68040 6 .#define bfd_mach_m68060 7 .#define bfd_mach_cpu32 8 -.#define bfd_mach_mcf_isa_a_nodiv 9 -.#define bfd_mach_mcf_isa_a 10 -.#define bfd_mach_mcf_isa_a_mac 11 -.#define bfd_mach_mcf_isa_a_emac 12 -.#define bfd_mach_mcf_isa_aplus 13 -.#define bfd_mach_mcf_isa_aplus_mac 14 -.#define bfd_mach_mcf_isa_aplus_emac 15 -.#define bfd_mach_mcf_isa_b_nousp 16 -.#define bfd_mach_mcf_isa_b_nousp_mac 17 -.#define bfd_mach_mcf_isa_b_nousp_emac 18 -.#define bfd_mach_mcf_isa_b 19 -.#define bfd_mach_mcf_isa_b_mac 20 -.#define bfd_mach_mcf_isa_b_emac 21 -.#define bfd_mach_mcf_isa_b_float 22 -.#define bfd_mach_mcf_isa_b_float_mac 23 -.#define bfd_mach_mcf_isa_b_float_emac 24 +.#define bfd_mach_fido 9 +.#define bfd_mach_mcf_isa_a_nodiv 10 +.#define bfd_mach_mcf_isa_a 11 +.#define bfd_mach_mcf_isa_a_mac 12 +.#define bfd_mach_mcf_isa_a_emac 13 +.#define bfd_mach_mcf_isa_aplus 14 +.#define bfd_mach_mcf_isa_aplus_mac 15 +.#define bfd_mach_mcf_isa_aplus_emac 16 +.#define bfd_mach_mcf_isa_b_nousp 17 +.#define bfd_mach_mcf_isa_b_nousp_mac 18 +.#define bfd_mach_mcf_isa_b_nousp_emac 19 +.#define bfd_mach_mcf_isa_b 20 +.#define bfd_mach_mcf_isa_b_mac 21 +.#define bfd_mach_mcf_isa_b_emac 22 +.#define bfd_mach_mcf_isa_b_float 23 +.#define bfd_mach_mcf_isa_b_float_mac 24 +.#define bfd_mach_mcf_isa_b_float_emac 25 +.#define bfd_mach_mcf_isa_c 26 +.#define bfd_mach_mcf_isa_c_mac 27 +.#define bfd_mach_mcf_isa_c_emac 28 . bfd_arch_vax, {* DEC Vax *} . bfd_arch_i960, {* Intel 960 *} . {* The order of the following is important. @@ -136,6 +140,8 @@ DESCRIPTION .{* Nonzero if MACH is a 64 bit sparc architecture. *} .#define bfd_mach_sparc_64bit_p(mach) \ . ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) +. bfd_arch_spu, {* PowerPC SPU *} +.#define bfd_mach_spu 256 . bfd_arch_mips, {* MIPS Rxxxx *} .#define bfd_mach_mips3000 3000 .#define bfd_mach_mips3900 3900 @@ -273,6 +279,7 @@ DESCRIPTION .#define bfd_mach_arm_XScale 10 .#define bfd_mach_arm_ep9312 11 .#define bfd_mach_arm_iWMMXt 12 +.#define bfd_mach_arm_iWMMXt2 13 . bfd_arch_ns32k, {* National Semiconductors ns32000 *} . bfd_arch_w65, {* WDC 65816 *} . bfd_arch_tic30, {* Texas Instruments TMS320C30 *} @@ -314,6 +321,9 @@ DESCRIPTION .#define bfd_mach_fr500 500 .#define bfd_mach_fr550 550 . bfd_arch_mcore, +. bfd_arch_mep, +.#define bfd_mach_mep 1 +.#define bfd_mach_mep_h1 0x6831 . bfd_arch_ia64, {* HP/Intel ia64 *} .#define bfd_mach_ia64_elf64 64 .#define bfd_mach_ia64_elf32 32 @@ -334,8 +344,11 @@ DESCRIPTION .#define bfd_mach_avr3 3 .#define bfd_mach_avr4 4 .#define bfd_mach_avr5 5 +.#define bfd_mach_avr6 6 . bfd_arch_bfin, {* ADI Blackfin *} .#define bfd_mach_bfin 1 +. bfd_arch_cr16, {* National Semiconductor CompactRISC (ie CR16). *} +.#define bfd_mach_cr16 1 . bfd_arch_cr16c, {* National Semiconductor CompactRISC. *} .#define bfd_mach_cr16c 1 . bfd_arch_crx, {* National Semiconductor CRX. *} @@ -347,6 +360,7 @@ DESCRIPTION . bfd_arch_s390, {* IBM s390 *} .#define bfd_mach_s390_31 31 .#define bfd_mach_s390_64 64 +. bfd_arch_score, {* Sunplus score *} . bfd_arch_openrisc, {* OpenRISC *} . bfd_arch_mmix, {* Donald Knuth's educational processor. *} . bfd_arch_xstormy16, @@ -424,6 +438,7 @@ extern const bfd_arch_info_type bfd_arc_arch; extern const bfd_arch_info_type bfd_arm_arch; extern const bfd_arch_info_type bfd_avr_arch; extern const bfd_arch_info_type bfd_bfin_arch; +extern const bfd_arch_info_type bfd_cr16_arch; extern const bfd_arch_info_type bfd_cr16c_arch; extern const bfd_arch_info_type bfd_cris_arch; extern const bfd_arch_info_type bfd_crx_arch; @@ -450,6 +465,7 @@ extern const bfd_arch_info_type bfd_m68k_arch; extern const bfd_arch_info_type bfd_m88k_arch; extern const bfd_arch_info_type bfd_maxq_arch; extern const bfd_arch_info_type bfd_mcore_arch; +extern const bfd_arch_info_type bfd_mep_arch; extern const bfd_arch_info_type bfd_mips_arch; extern const bfd_arch_info_type bfd_mmix_arch; extern const bfd_arch_info_type bfd_mn10200_arch; @@ -465,8 +481,10 @@ extern const bfd_arch_info_type bfd_powerpc_archs[]; #define bfd_powerpc_arch bfd_powerpc_archs[0] extern const bfd_arch_info_type bfd_rs6000_arch; extern const bfd_arch_info_type bfd_s390_arch; +extern const bfd_arch_info_type bfd_score_arch; extern const bfd_arch_info_type bfd_sh_arch; extern const bfd_arch_info_type bfd_sparc_arch; +extern const bfd_arch_info_type bfd_spu_arch; extern const bfd_arch_info_type bfd_tic30_arch; extern const bfd_arch_info_type bfd_tic4x_arch; extern const bfd_arch_info_type bfd_tic54x_arch; @@ -491,6 +509,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_arm_arch, &bfd_avr_arch, &bfd_bfin_arch, + &bfd_cr16_arch, &bfd_cr16c_arch, &bfd_cris_arch, &bfd_crx_arch, @@ -517,6 +536,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_m88k_arch, &bfd_maxq_arch, &bfd_mcore_arch, + &bfd_mep_arch, &bfd_mips_arch, &bfd_mmix_arch, &bfd_mn10200_arch, @@ -530,8 +550,10 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_powerpc_arch, &bfd_rs6000_arch, &bfd_s390_arch, + &bfd_score_arch, &bfd_sh_arch, &bfd_sparc_arch, + &bfd_spu_arch, &bfd_tic30_arch, &bfd_tic4x_arch, &bfd_tic54x_arch, diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index 33b649d0585..617aa07ec55 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -1,7 +1,7 @@ /* Main header file for the bfd library -- portable access to object files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -43,6 +43,30 @@ extern "C" { #endif #endif +/* This is a utility macro to handle the situation where the code + wants to place a constant string into the code, followed by a + comma and then the length of the string. Doing this by hand + is error prone, so using this macro is safer. The macro will + also safely handle the case where a NULL is passed as the arg. */ +#define STRING_COMMA_LEN(STR) (STR), ((STR) ? sizeof (STR) - 1 : 0) +/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro + to create the arguments to another macro, since the preprocessor + will mis-count the number of arguments to the outer macro (by not + evaluating STRING_COMMA_LEN and so missing the comma). This is a + problem for example when trying to use STRING_COMMA_LEN to build + the arguments to the strncmp() macro. Hence this alternative + definition of strncmp is provided here. + + Note - these macros do NOT work if STR2 is not a constant string. */ +#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) + /* strcpy() can have a similar problem, but since we know we are + copying a constant string, we can use memcpy which will be faster + since there is no need to check for a NUL byte inside STR. We + can also save time if we do not need to copy the terminating NUL. */ +#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1) +#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) + + /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have been selected with --enable-targets, or if --enable-64-bit-bfd. */ @@ -326,7 +350,15 @@ typedef struct bfd_section *sec_ptr; (((sec)->rawsize ? (sec)->rawsize : (sec)->size) \ / bfd_octets_per_byte (bfd)) -typedef struct stat stat_type; +/* Return TRUE if section has been discarded. */ +#define elf_discarded_section(sec) \ + (!bfd_is_abs_section (sec) \ + && bfd_is_abs_section ((sec)->output_section) \ + && (sec)->sec_info_type != ELF_INFO_TYPE_MERGE \ + && (sec)->sec_info_type != ELF_INFO_TYPE_JUST_SYMS) + +/* Forward define. */ +struct stat; typedef enum bfd_print_symbol { @@ -374,10 +406,6 @@ struct bfd_hash_table { /* The hash array. */ struct bfd_hash_entry **table; - /* The number of slots in the hash table. */ - unsigned int size; - /* The size of elements. */ - unsigned int entsize; /* A function used to create new elements in the hash table. The first entry is itself a pointer to an element. When this function is first invoked, this pointer will be NULL. However, @@ -390,6 +418,14 @@ struct bfd_hash_table /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; + /* The number of slots in the hash table. */ + unsigned int size; + /* The number of entries in the hash table. */ + unsigned int count; + /* The size of elements. */ + unsigned int entsize; + /* If non-zero, don't grow the hash table. */ + unsigned int frozen:1; }; /* Initialize a hash table. */ @@ -660,7 +696,7 @@ extern void bfd_elf_set_dt_needed_name extern const char *bfd_elf_get_dt_soname (bfd *); extern void bfd_elf_set_dyn_lib_class - (bfd *, int); + (bfd *, enum dynamic_lib_link_class); extern int bfd_elf_get_dyn_lib_class (bfd *); extern struct bfd_link_needed_list *bfd_elf_get_runpath_list @@ -817,6 +853,27 @@ extern bfd_boolean bfd_coff_set_symbol_class extern bfd_boolean bfd_m68k_coff_create_embedded_relocs (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); +/* ARM VFP11 erratum workaround support. */ +typedef enum +{ + BFD_ARM_VFP11_FIX_DEFAULT, + BFD_ARM_VFP11_FIX_NONE, + BFD_ARM_VFP11_FIX_SCALAR, + BFD_ARM_VFP11_FIX_VECTOR +} bfd_arm_vfp11_fix; + +extern void bfd_elf32_arm_init_maps + (bfd *); + +extern void bfd_elf32_arm_set_vfp11_fix + (bfd *, struct bfd_link_info *); + +extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan + (bfd *, struct bfd_link_info *); + +extern void bfd_elf32_arm_vfp11_fix_veneer_locations + (bfd *, struct bfd_link_info *); + /* ARM Interworking support. Called from linker. */ extern bfd_boolean bfd_arm_allocate_interworking_sections (struct bfd_link_info *); @@ -842,10 +899,11 @@ extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections (struct bfd_link_info *); extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); + (bfd *, struct bfd_link_info *); void bfd_elf32_arm_set_target_relocs - (struct bfd_link_info *, int, char *, int, int); + (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, + int, int); extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking (bfd *, struct bfd_link_info *); @@ -854,8 +912,14 @@ extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd (bfd *, struct bfd_link_info *); /* ELF ARM mapping symbol support */ -extern bfd_boolean bfd_is_arm_mapping_symbol_name - (const char * name); +#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) +#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) +#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) +#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) +extern bfd_boolean bfd_is_arm_special_symbol_name + (const char * name, int type); + +extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); /* ARM Note section processing. */ extern bfd_boolean bfd_arm_merge_machines diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index ddcda2377df..8ea1cdd3b18 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -8,7 +8,7 @@ /* Main header file for the bfd library -- portable access to object files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -50,6 +50,30 @@ extern "C" { #endif #endif +/* This is a utility macro to handle the situation where the code + wants to place a constant string into the code, followed by a + comma and then the length of the string. Doing this by hand + is error prone, so using this macro is safer. The macro will + also safely handle the case where a NULL is passed as the arg. */ +#define STRING_COMMA_LEN(STR) (STR), ((STR) ? sizeof (STR) - 1 : 0) +/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro + to create the arguments to another macro, since the preprocessor + will mis-count the number of arguments to the outer macro (by not + evaluating STRING_COMMA_LEN and so missing the comma). This is a + problem for example when trying to use STRING_COMMA_LEN to build + the arguments to the strncmp() macro. Hence this alternative + definition of strncmp is provided here. + + Note - these macros do NOT work if STR2 is not a constant string. */ +#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) + /* strcpy() can have a similar problem, but since we know we are + copying a constant string, we can use memcpy which will be faster + since there is no need to check for a NUL byte inside STR. We + can also save time if we do not need to copy the terminating NUL. */ +#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1) +#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) + + /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have been selected with --enable-targets, or if --enable-64-bit-bfd. */ @@ -333,7 +357,15 @@ typedef struct bfd_section *sec_ptr; (((sec)->rawsize ? (sec)->rawsize : (sec)->size) \ / bfd_octets_per_byte (bfd)) -typedef struct stat stat_type; +/* Return TRUE if section has been discarded. */ +#define elf_discarded_section(sec) \ + (!bfd_is_abs_section (sec) \ + && bfd_is_abs_section ((sec)->output_section) \ + && (sec)->sec_info_type != ELF_INFO_TYPE_MERGE \ + && (sec)->sec_info_type != ELF_INFO_TYPE_JUST_SYMS) + +/* Forward define. */ +struct stat; typedef enum bfd_print_symbol { @@ -381,10 +413,6 @@ struct bfd_hash_table { /* The hash array. */ struct bfd_hash_entry **table; - /* The number of slots in the hash table. */ - unsigned int size; - /* The size of elements. */ - unsigned int entsize; /* A function used to create new elements in the hash table. The first entry is itself a pointer to an element. When this function is first invoked, this pointer will be NULL. However, @@ -397,6 +425,14 @@ struct bfd_hash_table /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; + /* The number of slots in the hash table. */ + unsigned int size; + /* The number of entries in the hash table. */ + unsigned int count; + /* The size of elements. */ + unsigned int entsize; + /* If non-zero, don't grow the hash table. */ + unsigned int frozen:1; }; /* Initialize a hash table. */ @@ -667,7 +703,7 @@ extern void bfd_elf_set_dt_needed_name extern const char *bfd_elf_get_dt_soname (bfd *); extern void bfd_elf_set_dyn_lib_class - (bfd *, int); + (bfd *, enum dynamic_lib_link_class); extern int bfd_elf_get_dyn_lib_class (bfd *); extern struct bfd_link_needed_list *bfd_elf_get_runpath_list @@ -824,6 +860,27 @@ extern bfd_boolean bfd_coff_set_symbol_class extern bfd_boolean bfd_m68k_coff_create_embedded_relocs (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); +/* ARM VFP11 erratum workaround support. */ +typedef enum +{ + BFD_ARM_VFP11_FIX_DEFAULT, + BFD_ARM_VFP11_FIX_NONE, + BFD_ARM_VFP11_FIX_SCALAR, + BFD_ARM_VFP11_FIX_VECTOR +} bfd_arm_vfp11_fix; + +extern void bfd_elf32_arm_init_maps + (bfd *); + +extern void bfd_elf32_arm_set_vfp11_fix + (bfd *, struct bfd_link_info *); + +extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan + (bfd *, struct bfd_link_info *); + +extern void bfd_elf32_arm_vfp11_fix_veneer_locations + (bfd *, struct bfd_link_info *); + /* ARM Interworking support. Called from linker. */ extern bfd_boolean bfd_arm_allocate_interworking_sections (struct bfd_link_info *); @@ -849,10 +906,11 @@ extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections (struct bfd_link_info *); extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); + (bfd *, struct bfd_link_info *); void bfd_elf32_arm_set_target_relocs - (struct bfd_link_info *, int, char *, int, int); + (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, + int, int); extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking (bfd *, struct bfd_link_info *); @@ -861,8 +919,14 @@ extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd (bfd *, struct bfd_link_info *); /* ELF ARM mapping symbol support */ -extern bfd_boolean bfd_is_arm_mapping_symbol_name - (const char * name); +#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) +#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) +#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) +#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) +extern bfd_boolean bfd_is_arm_special_symbol_name + (const char * name, int type); + +extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); /* ARM Note section processing. */ extern bfd_boolean bfd_arm_merge_machines @@ -935,7 +999,10 @@ bfd *bfd_openr_iovec (const char *filename, const char *target, file_ptr nbytes, file_ptr offset), int (*close) (struct bfd *nbfd, - void *stream)); + void *stream), + int (*stat) (struct bfd *abfd, + void *stream, + struct stat *sb)); bfd *bfd_openw (const char *filename, const char *target); @@ -1076,7 +1143,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -long bfd_get_size (bfd *abfd); +file_ptr bfd_get_size (bfd *abfd); /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ @@ -1225,7 +1292,9 @@ typedef struct bfd_section else up the line will take care of it later. */ #define SEC_LINKER_CREATED 0x200000 - /* This section should not be subject to garbage collection. */ + /* This section should not be subject to garbage collection. + Also set to inform the linker that this section should not be + listed in the link map as discarded. */ #define SEC_KEEP 0x400000 /* This section contains "short" data, and should be placed @@ -1471,11 +1540,6 @@ extern asection bfd_ind_section; || ((SEC) == bfd_com_section_ptr) \ || ((SEC) == bfd_ind_section_ptr)) -extern const struct bfd_symbol * const bfd_abs_symbol; -extern const struct bfd_symbol * const bfd_com_symbol; -extern const struct bfd_symbol * const bfd_und_symbol; -extern const struct bfd_symbol * const bfd_ind_symbol; - /* Macros to handle insertion and deletion of a bfd's sections. These only handle the list pointers, ie. do not adjust section_count, target_index etc. */ @@ -1566,7 +1630,7 @@ extern const struct bfd_symbol * const bfd_ind_symbol; #define bfd_section_removed_from_list(ABFD, S) \ ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, SYM_PTR, NAME, IDX) \ +#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ @@ -1597,11 +1661,8 @@ extern const struct bfd_symbol * const bfd_ind_symbol; /* target_index, used_by_bfd, constructor_chain, owner, */ \ 0, NULL, NULL, NULL, \ \ - /* symbol, */ \ - (struct bfd_symbol *) SYM, \ - \ - /* symbol_ptr_ptr, */ \ - (struct bfd_symbol **) SYM_PTR, \ + /* symbol, symbol_ptr_ptr, */ \ + (struct bfd_symbol *) SYM, &SEC.symbol, \ \ /* map_head, map_tail */ \ { NULL }, { NULL } \ @@ -1683,22 +1744,26 @@ enum bfd_architecture #define bfd_mach_m68040 6 #define bfd_mach_m68060 7 #define bfd_mach_cpu32 8 -#define bfd_mach_mcf_isa_a_nodiv 9 -#define bfd_mach_mcf_isa_a 10 -#define bfd_mach_mcf_isa_a_mac 11 -#define bfd_mach_mcf_isa_a_emac 12 -#define bfd_mach_mcf_isa_aplus 13 -#define bfd_mach_mcf_isa_aplus_mac 14 -#define bfd_mach_mcf_isa_aplus_emac 15 -#define bfd_mach_mcf_isa_b_nousp 16 -#define bfd_mach_mcf_isa_b_nousp_mac 17 -#define bfd_mach_mcf_isa_b_nousp_emac 18 -#define bfd_mach_mcf_isa_b 19 -#define bfd_mach_mcf_isa_b_mac 20 -#define bfd_mach_mcf_isa_b_emac 21 -#define bfd_mach_mcf_isa_b_float 22 -#define bfd_mach_mcf_isa_b_float_mac 23 -#define bfd_mach_mcf_isa_b_float_emac 24 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 bfd_arch_vax, /* DEC Vax */ bfd_arch_i960, /* Intel 960 */ /* The order of the following is important. @@ -1739,6 +1804,8 @@ enum bfd_architecture /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) + bfd_arch_spu, /* PowerPC SPU */ +#define bfd_mach_spu 256 bfd_arch_mips, /* MIPS Rxxxx */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 @@ -1876,6 +1943,7 @@ enum bfd_architecture #define bfd_mach_arm_XScale 10 #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 +#define bfd_mach_arm_iWMMXt2 13 bfd_arch_ns32k, /* National Semiconductors ns32000 */ bfd_arch_w65, /* WDC 65816 */ bfd_arch_tic30, /* Texas Instruments TMS320C30 */ @@ -1917,6 +1985,9 @@ enum bfd_architecture #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 bfd_arch_mcore, + bfd_arch_mep, +#define bfd_mach_mep 1 +#define bfd_mach_mep_h1 0x6831 bfd_arch_ia64, /* HP/Intel ia64 */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 @@ -1937,8 +2008,11 @@ enum bfd_architecture #define bfd_mach_avr3 3 #define bfd_mach_avr4 4 #define bfd_mach_avr5 5 +#define bfd_mach_avr6 6 bfd_arch_bfin, /* ADI Blackfin */ #define bfd_mach_bfin 1 + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ +#define bfd_mach_cr16 1 bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ #define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ @@ -1950,6 +2024,7 @@ enum bfd_architecture bfd_arch_s390, /* IBM s390 */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 + bfd_arch_score, /* Sunplus score */ bfd_arch_openrisc, /* OpenRISC */ bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, @@ -2427,6 +2502,22 @@ relocation types already defined. */ BFD_RELOC_SPARC_TLS_TPOFF32, BFD_RELOC_SPARC_TLS_TPOFF64, +/* SPU Relocations. */ + BFD_RELOC_SPU_IMM7, + BFD_RELOC_SPU_IMM8, + BFD_RELOC_SPU_IMM10, + BFD_RELOC_SPU_IMM10W, + BFD_RELOC_SPU_IMM16, + BFD_RELOC_SPU_IMM16W, + BFD_RELOC_SPU_IMM18, + BFD_RELOC_SPU_PCREL9a, + BFD_RELOC_SPU_PCREL9b, + BFD_RELOC_SPU_PCREL16, + BFD_RELOC_SPU_LO16, + BFD_RELOC_SPU_HI16, + BFD_RELOC_SPU_PPU32, + BFD_RELOC_SPU_PPU64, + /* Alpha ECOFF and ELF relocations. Some of these treat the symbol or "addend" in some special way. For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when @@ -2909,6 +3000,16 @@ pc-relative or some form of GOT-indirect relocation. */ /* 31-bit PC relative address. */ BFD_RELOC_ARM_PREL31, +/* Low and High halfword relocations for MOVW and MOVT instructions. */ + BFD_RELOC_ARM_MOVW, + BFD_RELOC_ARM_MOVT, + BFD_RELOC_ARM_MOVW_PCREL, + BFD_RELOC_ARM_MOVT_PCREL, + BFD_RELOC_ARM_THUMB_MOVW, + BFD_RELOC_ARM_THUMB_MOVT, + BFD_RELOC_ARM_THUMB_MOVW_PCREL, + BFD_RELOC_ARM_THUMB_MOVT_PCREL, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -2928,11 +3029,42 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_TLS_IE32, BFD_RELOC_ARM_TLS_LE32, +/* ARM group relocations. */ + BFD_RELOC_ARM_ALU_PC_G0_NC, + BFD_RELOC_ARM_ALU_PC_G0, + BFD_RELOC_ARM_ALU_PC_G1_NC, + BFD_RELOC_ARM_ALU_PC_G1, + BFD_RELOC_ARM_ALU_PC_G2, + BFD_RELOC_ARM_LDR_PC_G0, + BFD_RELOC_ARM_LDR_PC_G1, + BFD_RELOC_ARM_LDR_PC_G2, + BFD_RELOC_ARM_LDRS_PC_G0, + BFD_RELOC_ARM_LDRS_PC_G1, + BFD_RELOC_ARM_LDRS_PC_G2, + BFD_RELOC_ARM_LDC_PC_G0, + BFD_RELOC_ARM_LDC_PC_G1, + BFD_RELOC_ARM_LDC_PC_G2, + BFD_RELOC_ARM_ALU_SB_G0_NC, + BFD_RELOC_ARM_ALU_SB_G0, + BFD_RELOC_ARM_ALU_SB_G1_NC, + BFD_RELOC_ARM_ALU_SB_G1, + BFD_RELOC_ARM_ALU_SB_G2, + BFD_RELOC_ARM_LDR_SB_G0, + BFD_RELOC_ARM_LDR_SB_G1, + BFD_RELOC_ARM_LDR_SB_G2, + BFD_RELOC_ARM_LDRS_SB_G0, + BFD_RELOC_ARM_LDRS_SB_G1, + BFD_RELOC_ARM_LDRS_SB_G2, + BFD_RELOC_ARM_LDC_SB_G0, + BFD_RELOC_ARM_LDC_SB_G1, + BFD_RELOC_ARM_LDC_SB_G2, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, BFD_RELOC_ARM_ADRL_IMMEDIATE, BFD_RELOC_ARM_T32_IMMEDIATE, + BFD_RELOC_ARM_T32_ADD_IMM, BFD_RELOC_ARM_T32_IMM12, BFD_RELOC_ARM_T32_ADD_PC12, BFD_RELOC_ARM_SHIFT_IMM, @@ -3446,6 +3578,29 @@ short offset into 11 bits. */ BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2, BFD_RELOC_MCORE_RVA, +/* Toshiba Media Processor Relocations. */ + BFD_RELOC_MEP_8, + BFD_RELOC_MEP_16, + BFD_RELOC_MEP_32, + BFD_RELOC_MEP_PCREL8A2, + BFD_RELOC_MEP_PCREL12A2, + BFD_RELOC_MEP_PCREL17A2, + BFD_RELOC_MEP_PCREL24A2, + BFD_RELOC_MEP_PCABS24A2, + BFD_RELOC_MEP_LOW16, + BFD_RELOC_MEP_HI16U, + BFD_RELOC_MEP_HI16S, + BFD_RELOC_MEP_GPREL, + BFD_RELOC_MEP_TPREL, + BFD_RELOC_MEP_TPREL7, + BFD_RELOC_MEP_TPREL7A2, + BFD_RELOC_MEP_TPREL7A4, + BFD_RELOC_MEP_UIMM24, + BFD_RELOC_MEP_ADDR24A4, + BFD_RELOC_MEP_GNU_VTINHERIT, + BFD_RELOC_MEP_GNU_VTENTRY, + + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -3545,10 +3700,22 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, +/* This is a 16 bit reloc for the AVR that stores 8 bit value +(command address) into 8 bit immediate value of LDI insn. If the address +is beyond the 128k boundary, the linker inserts a jump stub for this reloc +in the lower 128k. */ + BFD_RELOC_AVR_LO8_LDI_GS, + /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit of command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_HI8_LDI_PM, +/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit +of command address) into 8 bit immediate value of LDI insn. If the address +is beyond the 128k boundary, the linker inserts a jump stub for this reloc +below 128k. */ + BFD_RELOC_AVR_HI8_LDI_GS, + /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit of command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_HH8_LDI_PM, @@ -3689,6 +3856,31 @@ instructions */ BFD_RELOC_390_GOTPLT20, BFD_RELOC_390_TLS_GOTIE20, +/* Score relocations */ + BFD_RELOC_SCORE_DUMMY1, + +/* Low 16 bit for load/store */ + BFD_RELOC_SCORE_GPREL15, + +/* This is a 24-bit reloc with the right 1 bit assumed to be 0 */ + BFD_RELOC_SCORE_DUMMY2, + BFD_RELOC_SCORE_JMP, + +/* This is a 19-bit reloc with the right 1 bit assumed to be 0 */ + BFD_RELOC_SCORE_BRANCH, + +/* This is a 11-bit reloc with the right 1 bit assumed to be 0 */ + BFD_RELOC_SCORE16_JMP, + +/* This is a 8-bit reloc with the right 1 bit assumed to be 0 */ + BFD_RELOC_SCORE16_BRANCH, + +/* Undocumented Score relocs */ + BFD_RELOC_SCORE_GOT15, + BFD_RELOC_SCORE_GOT_LO16, + BFD_RELOC_SCORE_CALL15, + BFD_RELOC_SCORE_DUMMY_HI16, + /* Scenix IP2K - 9-bit register number / data address */ BFD_RELOC_IP2K_FR9, @@ -3913,6 +4105,35 @@ This is the 5 bits of a value. */ BFD_RELOC_16C_IMM32, BFD_RELOC_16C_IMM32_C, +/* NS CR16 Relocations. */ + BFD_RELOC_CR16_NUM8, + BFD_RELOC_CR16_NUM16, + BFD_RELOC_CR16_NUM32, + BFD_RELOC_CR16_NUM32a, + BFD_RELOC_CR16_REGREL0, + BFD_RELOC_CR16_REGREL4, + BFD_RELOC_CR16_REGREL4a, + BFD_RELOC_CR16_REGREL14, + BFD_RELOC_CR16_REGREL14a, + BFD_RELOC_CR16_REGREL16, + BFD_RELOC_CR16_REGREL20, + BFD_RELOC_CR16_REGREL20a, + BFD_RELOC_CR16_ABS20, + BFD_RELOC_CR16_ABS24, + BFD_RELOC_CR16_IMM4, + BFD_RELOC_CR16_IMM8, + BFD_RELOC_CR16_IMM16, + BFD_RELOC_CR16_IMM20, + BFD_RELOC_CR16_IMM24, + BFD_RELOC_CR16_IMM32, + BFD_RELOC_CR16_IMM32a, + BFD_RELOC_CR16_DISP4, + BFD_RELOC_CR16_DISP8, + BFD_RELOC_CR16_DISP16, + BFD_RELOC_CR16_DISP20, + BFD_RELOC_CR16_DISP24, + BFD_RELOC_CR16_DISP24a, + /* NS CRX Relocations. */ BFD_RELOC_CRX_REL4, BFD_RELOC_CRX_REL8, @@ -4026,6 +4247,10 @@ This is the 5 bits of a value. */ BFD_RELOC_XSTORMY16_24, BFD_RELOC_XSTORMY16_FPTR16, +/* Self-describing complex relocations. */ + BFD_RELOC_RELC, + + /* Infineon Relocations. */ BFD_RELOC_XC16X_PAG, BFD_RELOC_XC16X_POF, @@ -4163,6 +4388,8 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); +reloc_howto_type *bfd_reloc_name_lookup + (bfd *abfd, const char *reloc_name); const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code); @@ -4275,6 +4502,14 @@ typedef struct bfd_symbol /* This symbol is thread local. Used in ELF. */ #define BSF_THREAD_LOCAL 0x40000 + /* This symbol represents a complex relocation expression, + with the expression tree serialized in the symbol name. */ +#define BSF_RELC 0x80000 + + /* This symbol represents a signed complex relocation expression, + with the expression tree serialized in the symbol name. */ +#define BSF_SRELC 0x100000 + flagword flags; /* A pointer to the section to which this symbol is @@ -4442,7 +4677,7 @@ struct bfd /* Stuff only useful for archives. */ void *arelt_data; struct bfd *my_archive; /* The containing archive BFD. */ - struct bfd *next; /* The next BFD in the archive. */ + struct bfd *archive_next; /* The next BFD in the archive. */ struct bfd *archive_head; /* The first BFD in the archive. */ bfd_boolean has_armap; @@ -4524,13 +4759,14 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_on_input, bfd_error_invalid_error_code } bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag); +void bfd_set_error (bfd_error_type error_tag, ...); const char *bfd_errmsg (bfd_error_type error_tag); @@ -4585,8 +4821,8 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) -#define bfd_sizeof_headers(abfd, reloc) \ - BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) +#define bfd_sizeof_headers(abfd, info) \ + BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ @@ -4694,6 +4930,16 @@ void bfd_preserve_restore (bfd *, struct bfd_preserve *); void bfd_preserve_finish (bfd *, struct bfd_preserve *); +bfd_vma bfd_emul_get_maxpagesize (const char *); + +void bfd_emul_set_maxpagesize (const char *, bfd_vma); + +bfd_vma bfd_emul_get_commonpagesize (const char *); + +void bfd_emul_set_commonpagesize (const char *, bfd_vma); + +char *bfd_demangle (bfd *, const char *, int); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -4992,7 +5238,8 @@ typedef struct bfd_target #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ - NAME##_bfd_reloc_type_lookup + NAME##_bfd_reloc_type_lookup, \ + NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); long (*_bfd_canonicalize_reloc) @@ -5000,6 +5247,9 @@ typedef struct bfd_target /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); + reloc_howto_type * + (*reloc_name_lookup) (bfd *, const char *); + /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ @@ -5028,7 +5278,7 @@ typedef struct bfd_target NAME##_bfd_discard_group, \ NAME##_section_already_linked \ - int (*_bfd_sizeof_headers) (bfd *, bfd_boolean); + int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, bfd_boolean, struct bfd_symbol **); @@ -5071,7 +5321,8 @@ typedef struct bfd_target /* Check if SEC has been already linked during a reloceatable or final link. */ - void (*_section_already_linked) (bfd *, struct bfd_section *); + void (*_section_already_linked) (bfd *, struct bfd_section *, + struct bfd_link_info *); /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ @@ -5131,10 +5382,11 @@ bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec)) -void bfd_section_already_linked (bfd *abfd, asection *sec); +void bfd_section_already_linked (bfd *abfd, asection *sec, + struct bfd_link_info *info); -#define bfd_section_already_linked(abfd, sec) \ - BFD_SEND (abfd, _section_already_linked, (abfd, sec)) +#define bfd_section_already_linked(abfd, sec, info) \ + BFD_SEND (abfd, _section_already_linked, (abfd, sec, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents diff --git a/bfd/bfd.c b/bfd/bfd.c index 733f6ee0272..510df0ab27f 100644 --- a/bfd/bfd.c +++ b/bfd/bfd.c @@ -1,6 +1,6 @@ /* Generic BFD library interface and support routines. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -139,7 +139,7 @@ CODE_FRAGMENT . {* Stuff only useful for archives. *} . void *arelt_data; . struct bfd *my_archive; {* The containing archive BFD. *} -. struct bfd *next; {* The next BFD in the archive. *} +. struct bfd *archive_next; {* The next BFD in the archive. *} . struct bfd *archive_head; {* The first BFD in the archive. *} . bfd_boolean has_armap; . @@ -202,11 +202,12 @@ CODE_FRAGMENT . */ -#include "bfd.h" -#include "bfdver.h" #include "sysdep.h" #include +#include "bfd.h" +#include "bfdver.h" #include "libiberty.h" +#include "demangle.h" #include "safe-ctype.h" #include "bfdlink.h" #include "libbfd.h" @@ -271,6 +272,7 @@ CODE_FRAGMENT . bfd_error_bad_value, . bfd_error_file_truncated, . bfd_error_file_too_big, +. bfd_error_on_input, . bfd_error_invalid_error_code .} .bfd_error_type; @@ -278,6 +280,8 @@ CODE_FRAGMENT */ static bfd_error_type bfd_error = bfd_error_no_error; +static bfd *input_bfd = NULL; +static bfd_error_type input_error = bfd_error_no_error; const char *const bfd_errmsgs[] = { @@ -300,6 +304,7 @@ const char *const bfd_errmsgs[] = N_("Bad value"), N_("File truncated"), N_("File too big"), + N_("Error reading %s: %s"), N_("#") }; @@ -325,16 +330,32 @@ FUNCTION bfd_set_error SYNOPSIS - void bfd_set_error (bfd_error_type error_tag); + void bfd_set_error (bfd_error_type error_tag, ...); DESCRIPTION Set the BFD error condition to be @var{error_tag}. + If @var{error_tag} is bfd_error_on_input, then this function + takes two more parameters, the input bfd where the error + occurred, and the bfd_error_type error. */ void -bfd_set_error (bfd_error_type error_tag) +bfd_set_error (bfd_error_type error_tag, ...) { bfd_error = error_tag; + if (error_tag == bfd_error_on_input) + { + /* This is an error that occurred during bfd_close when + writing an archive, but on one of the input files. */ + va_list ap; + + va_start (ap, error_tag); + input_bfd = va_arg (ap, bfd *); + input_error = va_arg (ap, int); + if (input_error >= bfd_error_on_input) + abort (); + va_end (ap); + } } /* @@ -355,6 +376,19 @@ bfd_errmsg (bfd_error_type error_tag) #ifndef errno extern int errno; #endif + if (error_tag == bfd_error_on_input) + { + char *buf; + const char *msg = bfd_errmsg (input_error); + + if (asprintf (&buf, _(bfd_errmsgs [error_tag]), input_bfd->filename, msg) + != -1) + return buf; + + /* Ick, what to do on out of memory? */ + return msg; + } + if (error_tag == bfd_error_system_call) return xstrerror (errno); @@ -382,16 +416,10 @@ DESCRIPTION void bfd_perror (const char *message) { - if (bfd_get_error () == bfd_error_system_call) - /* Must be a system error then. */ - perror ((char *) message); + if (message == NULL || *message == '\0') + fprintf (stderr, "%s\n", bfd_errmsg (bfd_get_error ())); else - { - if (message == NULL || *message == '\0') - fprintf (stderr, "%s\n", bfd_errmsg (bfd_get_error ())); - else - fprintf (stderr, "%s: %s\n", message, bfd_errmsg (bfd_get_error ())); - } + fprintf (stderr, "%s: %s\n", message, bfd_errmsg (bfd_get_error ())); } /* @@ -419,6 +447,23 @@ static const char *_bfd_error_program_name; %A section name from section. For group components, print group name too. %B file name from bfd. For archive components, prints archive too. + + Note - because these two extra format specifiers require special handling + they are scanned for and processed in this function, before calling + vfprintf. This means that the *arguments* for these format specifiers + must be the first ones in the variable argument list, regardless of where + the specifiers appear in the format string. Thus for example calling + this function with a format string of: + + "blah %s blah %A blah %d blah %B" + + would involve passing the arguments as: + + "blah %s blah %A blah %d blah %B", + asection_for_the_%A, + bfd_for_the_%B, + string_for_the_%s, + integer_for_the_%d); */ void @@ -483,7 +528,11 @@ _bfd_default_error_handler (const char *fmt, ...) if (p[1] == 'B') { bfd *abfd = va_arg (ap, bfd *); - if (abfd->my_archive) + + if (abfd == NULL) + /* Invoking %B with a null bfd pointer is an internal error. */ + abort (); + else if (abfd->my_archive) snprintf (bufp, avail, "%s(%s)", abfd->my_archive->filename, abfd->filename); else @@ -492,10 +541,14 @@ _bfd_default_error_handler (const char *fmt, ...) else { asection *sec = va_arg (ap, asection *); - bfd *abfd = sec->owner; + bfd *abfd; const char *group = NULL; struct coff_comdat_info *ci; + if (sec == NULL) + /* Invoking %A with a null section pointer is an internal error. */ + abort (); + abfd = sec->owner; if (abfd != NULL && bfd_get_flavour (abfd) == bfd_target_elf_flavour && elf_next_in_group (sec) != NULL @@ -851,14 +904,16 @@ bfd_get_sign_extend_vma (bfd *abfd) name = bfd_get_target (abfd); - /* Return a proper value for DJGPP & PE COFF (x86 COFF variants). + /* Return a proper value for DJGPP & PE COFF. This function is required for DWARF2 support, but there is no place to store this information in the COFF back end. Should enough other COFF targets add support for DWARF2, a place will have to be found. Until then, this hack will do. */ - if (strncmp (name, "coff-go32", sizeof ("coff-go32") - 1) == 0 + if (CONST_STRNEQ (name, "coff-go32") || strcmp (name, "pe-i386") == 0 - || strcmp (name, "pei-i386") == 0) + || strcmp (name, "pei-i386") == 0 + || strcmp (name, "pe-arm-wince-little") == 0 + || strcmp (name, "pei-arm-wince-little") == 0) return 1; bfd_set_error (bfd_error_wrong_format); @@ -1158,8 +1213,8 @@ FUNCTION DESCRIPTION The following functions exist but have not yet been documented. -.#define bfd_sizeof_headers(abfd, reloc) \ -. BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) +.#define bfd_sizeof_headers(abfd, info) \ +. BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) . .#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ . BFD_SEND (abfd, _bfd_find_nearest_line, \ @@ -1298,11 +1353,10 @@ bfd_record_phdr (bfd *abfd, amt = sizeof (struct elf_segment_map); amt += ((bfd_size_type) count - 1) * sizeof (asection *); - m = bfd_alloc (abfd, amt); + m = bfd_zalloc (abfd, amt); if (m == NULL) return FALSE; - m->next = NULL; m->p_type = type; m->p_flags = flags; m->p_paddr = at; @@ -1335,6 +1389,15 @@ bfd_fprintf_vma (bfd *abfd, void *stream, bfd_vma value) { if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) get_elf_backend_data (abfd)->elf_backend_fprintf_vma (abfd, stream, value); +#ifdef BFD64 + /* fprintf_vma() on a 64-bit enabled host will always print a 64-bit + value, but really we want to display the address in the target's + address size. Since we do not have a field in the bfd structure + to tell us this, we take a guess, based on the target's name. */ + else if (strstr (bfd_get_target (abfd), "64") == NULL + && strcmp (bfd_get_target (abfd), "mmo") != 0) + fprintf ((FILE *) stream, "%08lx", (unsigned long) (value & 0xffffffff)); +#endif else fprintf_vma ((FILE *) stream, value); } @@ -1513,3 +1576,212 @@ bfd_preserve_finish (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_preserve *preserve) objalloc. */ bfd_hash_table_free (&preserve->section_htab); } + +/* +FUNCTION + bfd_emul_get_maxpagesize + +SYNOPSIS + bfd_vma bfd_emul_get_maxpagesize (const char *); + +DESCRIPTION + Returns the maximum page size, in bytes, as determined by + emulation. + +RETURNS + Returns the maximum page size in bytes for ELF, abort + otherwise. +*/ + +bfd_vma +bfd_emul_get_maxpagesize (const char *emul) +{ + const bfd_target *target; + + target = bfd_find_target (emul, NULL); + if (target != NULL + && target->flavour == bfd_target_elf_flavour) + return xvec_get_elf_backend_data (target)->maxpagesize; + + abort (); + return 0; +} + +static void +bfd_elf_set_pagesize (const bfd_target *target, bfd_vma size, + int offset, const bfd_target *orig_target) +{ + if (target->flavour == bfd_target_elf_flavour) + { + const struct elf_backend_data *bed; + + bed = xvec_get_elf_backend_data (target); + *((bfd_vma *) ((char *) bed + offset)) = size; + } + + if (target->alternative_target + && target->alternative_target != orig_target) + bfd_elf_set_pagesize (target->alternative_target, size, offset, + orig_target); +} + +/* +FUNCTION + bfd_emul_set_maxpagesize + +SYNOPSIS + void bfd_emul_set_maxpagesize (const char *, bfd_vma); + +DESCRIPTION + For ELF, set the maximum page size for the emulation. It is + a no-op for other formats. + +*/ + +void +bfd_emul_set_maxpagesize (const char *emul, bfd_vma size) +{ + const bfd_target *target; + + target = bfd_find_target (emul, NULL); + if (target) + bfd_elf_set_pagesize (target, size, + offsetof (struct elf_backend_data, + maxpagesize), target); +} + +/* +FUNCTION + bfd_emul_get_commonpagesize + +SYNOPSIS + bfd_vma bfd_emul_get_commonpagesize (const char *); + +DESCRIPTION + Returns the common page size, in bytes, as determined by + emulation. + +RETURNS + Returns the common page size in bytes for ELF, abort otherwise. +*/ + +bfd_vma +bfd_emul_get_commonpagesize (const char *emul) +{ + const bfd_target *target; + + target = bfd_find_target (emul, NULL); + if (target != NULL + && target->flavour == bfd_target_elf_flavour) + return xvec_get_elf_backend_data (target)->commonpagesize; + + abort (); + return 0; +} + +/* +FUNCTION + bfd_emul_set_commonpagesize + +SYNOPSIS + void bfd_emul_set_commonpagesize (const char *, bfd_vma); + +DESCRIPTION + For ELF, set the common page size for the emulation. It is + a no-op for other formats. + +*/ + +void +bfd_emul_set_commonpagesize (const char *emul, bfd_vma size) +{ + const bfd_target *target; + + target = bfd_find_target (emul, NULL); + if (target) + bfd_elf_set_pagesize (target, size, + offsetof (struct elf_backend_data, + commonpagesize), target); +} + +/* +FUNCTION + bfd_demangle + +SYNOPSIS + char *bfd_demangle (bfd *, const char *, int); + +DESCRIPTION + Wrapper around cplus_demangle. Strips leading underscores and + other such chars that would otherwise confuse the demangler. + If passed a g++ v3 ABI mangled name, returns a buffer allocated + with malloc holding the demangled name. Returns NULL otherwise + and on memory alloc failure. +*/ + +char * +bfd_demangle (bfd *abfd, const char *name, int options) +{ + char *res, *alloc; + const char *pre, *suf; + size_t pre_len; + + if (abfd != NULL + && *name != '\0' + && bfd_get_symbol_leading_char (abfd) == *name) + ++name; + + /* This is a hack for better error reporting on XCOFF, PowerPC64-ELF + or the MS PE format. These formats have a number of leading '.'s + on at least some symbols, so we remove all dots to avoid + confusing the demangler. */ + pre = name; + while (*name == '.' || *name == '$') + ++name; + pre_len = name - pre; + + /* Strip off @plt and suchlike too. */ + alloc = NULL; + suf = strchr (name, '@'); + if (suf != NULL) + { + alloc = bfd_malloc (suf - name + 1); + if (alloc == NULL) + return NULL; + memcpy (alloc, name, suf - name); + alloc[suf - name] = '\0'; + name = alloc; + } + + res = cplus_demangle (name, options); + + if (alloc != NULL) + free (alloc); + + if (res == NULL) + return NULL; + + /* Put back any prefix or suffix. */ + if (pre_len != 0 || suf != NULL) + { + size_t len; + size_t suf_len; + char *final; + + len = strlen (res); + if (suf == NULL) + suf = res + len; + suf_len = strlen (suf) + 1; + final = bfd_malloc (pre_len + len + suf_len); + if (final != NULL) + { + memcpy (final, pre, pre_len); + memcpy (final + pre_len, res, len); + memcpy (final + pre_len + len, suf, suf_len); + } + free (res); + res = final; + } + + return res; +} diff --git a/bfd/bfdio.c b/bfd/bfdio.c index 22ea886b5cb..0df25c3baf8 100644 --- a/bfd/bfdio.c +++ b/bfd/bfdio.c @@ -1,7 +1,7 @@ /* Low-level I/O routines for BFDs. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -23,12 +23,10 @@ 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 #include "bfd.h" #include "libbfd.h" -#include - #ifndef S_IXUSR #define S_IXUSR 0100 /* Execute by owner. */ #endif @@ -116,6 +114,15 @@ bfd_bread (void *ptr, bfd_size_type size, bfd *abfd) { size_t nread; + /* If this is an archive element, don't read past the end of + this element. */ + if (abfd->arelt_data != NULL) + { + size_t maxbytes = ((struct areltdata *) abfd->arelt_data)->parsed_size; + if (size > maxbytes) + size = maxbytes; + } + if ((abfd->flags & BFD_IN_MEMORY) != 0) { struct bfd_in_memory *bim; @@ -401,7 +408,7 @@ FUNCTION bfd_get_size SYNOPSIS - long bfd_get_size (bfd *abfd); + file_ptr bfd_get_size (bfd *abfd); DESCRIPTION Return the file size (as read from file system) for the file @@ -429,7 +436,7 @@ DESCRIPTION size reasonable?". */ -long +file_ptr bfd_get_size (bfd *abfd) { struct stat buf; diff --git a/bfd/binary.c b/bfd/binary.c index 458626f02a3..b5347dd4ba4 100644 --- a/bfd/binary.c +++ b/bfd/binary.c @@ -1,6 +1,6 @@ /* BFD back-end for binary objects. Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support, This file is part of BFD, the Binary File Descriptor library. @@ -32,8 +32,8 @@ the file. objcopy cooperates by specially setting the start address to zero by default. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "safe-ctype.h" #include "libbfd.h" @@ -63,6 +63,7 @@ binary_object_p (bfd *abfd) { struct stat statbuf; asection *sec; + flagword flags; if (abfd->target_defaulted) { @@ -80,10 +81,10 @@ binary_object_p (bfd *abfd) } /* One data section. */ - sec = bfd_make_section (abfd, ".data"); + flags = SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_HAS_CONTENTS; + sec = bfd_make_section_with_flags (abfd, ".data", flags); if (sec == NULL) return NULL; - sec->flags = SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_HAS_CONTENTS; sec->vma = 0; sec->size = statbuf.st_size; sec->filepos = 0; @@ -220,9 +221,6 @@ binary_get_symbol_info (bfd *ignore_abfd ATTRIBUTE_UNUSED, #define binary_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define binary_read_minisymbols _bfd_generic_read_minisymbols #define binary_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol -#define binary_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup -#define binary_get_reloc_upper_bound ((long (*) (bfd *, asection *)) bfd_0l) -#define binary_canonicalize_reloc ((long (*) (bfd *, asection *, arelent **, asymbol **)) bfd_0l) #define binary_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) /* Set the architecture of a binary file. */ @@ -305,7 +303,7 @@ binary_set_section_contents (bfd *abfd, static int binary_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, - bfd_boolean exec ATTRIBUTE_UNUSED) + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return 0; } @@ -367,7 +365,7 @@ const bfd_target binary_vec = BFD_JUMP_TABLE_CORE (_bfd_nocore), BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), BFD_JUMP_TABLE_SYMBOLS (binary), - BFD_JUMP_TABLE_RELOCS (binary), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), BFD_JUMP_TABLE_WRITE (binary), BFD_JUMP_TABLE_LINK (binary), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), diff --git a/bfd/bout.c b/bfd/bout.c index 5102ba77622..fe132129d67 100644 --- a/bfd/bout.c +++ b/bfd/bout.c @@ -1,6 +1,6 @@ /* BFD back-end for Intel 960 b.out binaries. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -20,8 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" #include "genlink.h" @@ -635,7 +635,8 @@ callj_callback (bfd *abfd, } static reloc_howto_type * -b_out_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real_type code) +b_out_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) { switch (code) { @@ -651,6 +652,20 @@ b_out_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real_typ } } +static reloc_howto_type * +b_out_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + if (strcasecmp (howto_reloc_callj.name, r_name) == 0) + return &howto_reloc_callj; + if (strcasecmp (howto_reloc_abs32.name, r_name) == 0) + return &howto_reloc_abs32; + if (strcasecmp (howto_reloc_pcrel24.name, r_name) == 0) + return &howto_reloc_pcrel24; + + return NULL; +} + /* Allocate enough room for all the reloc entries, plus pointers to them all. */ static bfd_boolean @@ -990,7 +1005,8 @@ b_out_set_arch_mach (bfd *abfd, } static int -b_out_sizeof_headers (bfd *ignore_abfd ATTRIBUTE_UNUSED, bfd_boolean ignore ATTRIBUTE_UNUSED) +b_out_sizeof_headers (bfd *ignore_abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return sizeof (struct external_exec); } diff --git a/bfd/cache.c b/bfd/cache.c index 6db6a6b4d56..5252cc9d132 100644 --- a/bfd/cache.c +++ b/bfd/cache.c @@ -1,7 +1,7 @@ /* BFD library -- caching of file descriptors. Copyright 1990, 1991, 1992, 1993, 1994, 1996, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support (steve@cygnus.com). @@ -40,8 +40,8 @@ SUBSECTION Caching functions */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libiberty.h" diff --git a/bfd/cf-i386lynx.c b/bfd/cf-i386lynx.c index 45e699e0b63..d28a3026010 100644 --- a/bfd/cf-i386lynx.c +++ b/bfd/cf-i386lynx.c @@ -1,5 +1,5 @@ /* BFD back-end for Intel 386 COFF LynxOS files. - Copyright 1993, 1994, 1995 Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 2007 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #define TARGET_SYM i386lynx_coff_vec #define TARGET_NAME "coff-i386-lynx" diff --git a/bfd/cisco-core.c b/bfd/cisco-core.c index b7f735b59de..dfa3a1f28bc 100644 --- a/bfd/cisco-core.c +++ b/bfd/cisco-core.c @@ -1,5 +1,5 @@ /* BFD back-end for CISCO crash dumps. - Copyright 1994, 1997, 1999, 2000, 2001, 2002, 2004 + Copyright 1994, 1997, 1999, 2000, 2001, 2002, 2004, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" /* core_file_failing_signal returns a host signal (this probably should be fixed). */ @@ -88,13 +88,14 @@ cisco_core_file_validate (abfd, crash_info_loc) char buf[4]; unsigned int crashinfo_offset; crashinfo_external crashinfo; - int nread; + bfd_size_type nread; unsigned int magic; unsigned int version; unsigned int rambase; sec_ptr asect; struct stat statbuf; bfd_size_type amt; + flagword flags; if (bfd_seek (abfd, (file_ptr) crash_info_loc, SEEK_SET) != 0) return NULL; @@ -241,10 +242,10 @@ cisco_core_file_validate (abfd, crash_info_loc) /* Create a ".data" section that maps the entire file, which is essentially a dump of the target system's RAM. */ - asect = bfd_make_section_anyway (abfd, ".data"); + flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS; + asect = bfd_make_section_anyway_with_flags (abfd, ".data", flags); if (asect == NULL) goto error_return; - asect->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS; /* The size of memory is the size of the core file itself. */ asect->size = statbuf.st_size; asect->vma = rambase; @@ -253,10 +254,10 @@ cisco_core_file_validate (abfd, crash_info_loc) /* Create a ".crash" section to allow access to the saved crash information. */ - asect = bfd_make_section_anyway (abfd, ".crash"); + flags = SEC_HAS_CONTENTS; + asect = bfd_make_section_anyway_with_flags (abfd, ".crash", flags); if (asect == NULL) goto error_return; - asect->flags = SEC_HAS_CONTENTS; asect->vma = 0; asect->filepos = crashinfo_offset; asect->size = sizeof (crashinfo); @@ -264,10 +265,9 @@ cisco_core_file_validate (abfd, crash_info_loc) /* Create a ".reg" section to allow access to the saved registers. */ - asect = bfd_make_section_anyway (abfd, ".reg"); + asect = bfd_make_section_anyway_with_flags (abfd, ".reg", flags); if (asect == NULL) goto error_return; - asect->flags = SEC_HAS_CONTENTS; asect->vma = 0; asect->filepos = bfd_get_32 (abfd, crashinfo.registers) - rambase; /* Since we don't know the exact size of the saved register info, diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c index d9b890502d3..dcb182bff9b 100644 --- a/bfd/coff-alpha.c +++ b/bfd/coff-alpha.c @@ -1,6 +1,6 @@ /* BFD back-end for ALPHA Extended-Coff files. Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Modified from coff-mips.c by Steve Chamberlain and Ian Lance Taylor . @@ -20,8 +20,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "coff/internal.h" @@ -1244,6 +1244,22 @@ alpha_bfd_reloc_type_lookup (abfd, code) return &alpha_howto_table[alpha_type]; } + +static reloc_howto_type * +alpha_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (alpha_howto_table) / sizeof (alpha_howto_table[0]); + i++) + if (alpha_howto_table[i].name != NULL + && strcasecmp (alpha_howto_table[i].name, r_name) == 0) + return &alpha_howto_table[i]; + + return NULL; +} /* A helper routine for alpha_relocate_section which converts an external reloc when generating relocatable output. Returns the @@ -2361,6 +2377,8 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data = /* Looking up a reloc type is Alpha specific. */ #define _bfd_ecoff_bfd_reloc_type_lookup alpha_bfd_reloc_type_lookup +#define _bfd_ecoff_bfd_reloc_name_lookup \ + alpha_bfd_reloc_name_lookup /* So is getting relocated section contents. */ #define _bfd_ecoff_bfd_get_relocated_section_contents \ diff --git a/bfd/coff-apollo.c b/bfd/coff-apollo.c index 2fe1b3e5567..171a62f4300 100644 --- a/bfd/coff-apollo.c +++ b/bfd/coff-apollo.c @@ -1,6 +1,6 @@ /* BFD back-end for Apollo 68000 COFF binaries. - Copyright 1990, 1991, 1992, 1993, 1994, 1999, 2000, 2001, 2002, 2003 - Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1993, 1994, 1999, 2000, 2001, 2002, 2003, + 2007 Free Software Foundation, Inc. By Troy Rollo (troy@cbme.unsw.edu.au) Based on m68k standard COFF version Written by Cygnus Support. @@ -20,8 +20,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/apollo.h" #include "coff/internal.h" diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c index 6b83dc7af7f..28cd4e736ea 100644 --- a/bfd/coff-arm.c +++ b/bfd/coff-arm.c @@ -1,6 +1,6 @@ /* BFD back-end for ARM COFF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -20,8 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/arm.h" #include "coff/internal.h" @@ -163,6 +163,19 @@ coff_arm_reloc (bfd *abfd, /* These most certainly belong somewhere else. Just had to get rid of the manifest constants in the code. */ + +#ifdef ARM_WINCE + +#define ARM_26D 0 +#define ARM_32 1 +#define ARM_RVA32 2 +#define ARM_26 3 +#define ARM_THUMB12 4 +#define ARM_SECTION 14 +#define ARM_SECREL 15 + +#else + #define ARM_8 0 #define ARM_16 1 #define ARM_32 2 @@ -179,20 +192,6 @@ coff_arm_reloc (bfd *abfd, #define ARM_THUMB12 13 #define ARM_THUMB23 14 -#ifdef ARM_WINCE -#undef ARM_32 -#undef ARM_RVA32 -#undef ARM_26 -#undef ARM_THUMB12 -#undef ARM_26D - -#define ARM_26D 0 -#define ARM_32 1 -#define ARM_RVA32 2 -#define ARM_26 3 -#define ARM_THUMB12 4 -#define ARM_SECTION 14 -#define ARM_SECREL 15 #endif static bfd_reloc_status_type aoutarm_fix_pcrel_26_done @@ -220,7 +219,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = complain_overflow_dont, aoutarm_fix_pcrel_26_done, "ARM_26D", - FALSE, + TRUE, /* partial_inplace. */ 0x00ffffff, 0x0, PCRELOFFSET), @@ -233,7 +232,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = complain_overflow_bitfield, coff_arm_reloc, "ARM_32", - FALSE, + TRUE, /* partial_inplace. */ 0xffffffff, 0xffffffff, PCRELOFFSET), @@ -246,7 +245,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = complain_overflow_bitfield, coff_arm_reloc, "ARM_RVA32", - FALSE, + TRUE, /* partial_inplace. */ 0xffffffff, 0xffffffff, PCRELOFFSET), @@ -294,7 +293,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = complain_overflow_bitfield, coff_arm_reloc, "ARM_SECTION", - FALSE, + TRUE, /* partial_inplace. */ 0x0000ffff, 0x0000ffff, PCRELOFFSET), @@ -307,7 +306,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = complain_overflow_bitfield, coff_arm_reloc, "ARM_SECREL", - FALSE, + TRUE, /* partial_inplace. */ 0xffffffff, 0xffffffff, PCRELOFFSET), @@ -539,6 +538,32 @@ coff_arm_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED, if (rel->r_type == ARM_RVA32) *addendp -= pe_data (sec->output_section->owner)->pe_opthdr.ImageBase; +#if defined COFF_WITH_PE && defined ARM_WINCE + if (rel->r_type == ARM_SECREL) + { + bfd_vma osect_vma; + + if (h && (h->type == bfd_link_hash_defined + || h->type == bfd_link_hash_defweak)) + osect_vma = h->root.u.def.section->output_section->vma; + else + { + asection *sec; + int i; + + /* Sigh, the only way to get the section to offset against + is to find it the hard way. */ + + for (sec = abfd->sections, i = 1; i < sym->n_scnum; i++) + sec = sec->next; + + osect_vma = sec->output_section->vma; + } + + *addendp -= osect_vma; + } +#endif + return howto; } @@ -808,6 +833,7 @@ coff_arm_reloc_type_lookup (bfd * abfd, bfd_reloc_code_real_type code) ASTD (BFD_RELOC_RVA, ARM_RVA32); ASTD (BFD_RELOC_ARM_PCREL_BRANCH, ARM_26); ASTD (BFD_RELOC_THUMB_PCREL_BRANCH12, ARM_THUMB12); + ASTD (BFD_RELOC_32_SECREL, ARM_SECREL); #else ASTD (BFD_RELOC_8, ARM_8); ASTD (BFD_RELOC_16, ARM_16); @@ -827,6 +853,23 @@ coff_arm_reloc_type_lookup (bfd * abfd, bfd_reloc_code_real_type code) } } +static reloc_howto_type * +coff_arm_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (aoutarm_std_reloc_howto) + / sizeof (aoutarm_std_reloc_howto[0])); + i++) + if (aoutarm_std_reloc_howto[i].name != NULL + && strcasecmp (aoutarm_std_reloc_howto[i].name, r_name) == 0) + return &aoutarm_std_reloc_howto[i]; + + return NULL; +} + #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER 2 #define COFF_PAGE_SIZE 0x1000 @@ -1209,12 +1252,14 @@ coff_arm_relocate_section (bfd *output_bfd, generation of bl's instruction offset. */ addend -= 8; #endif - howto = &fake_arm26_reloc; + howto = & fake_arm26_reloc; } #ifdef ARM_WINCE /* MS ARM-CE makes the reloc relative to the opcode's pc, not the next opcode's pc, so is off by one. */ + if (howto->pc_relative && !info->relocatable) + addend -= 8; #endif /* If we are doing a relocatable link, then we can just ignore @@ -1938,12 +1983,11 @@ bfd_arm_get_bfd_for_interworking (bfd * abfd, if (sec == NULL) { - flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY; - - sec = bfd_make_section (abfd, ARM2THUMB_GLUE_SECTION_NAME); - + flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY + | SEC_CODE | SEC_READONLY); + sec = bfd_make_section_with_flags (abfd, ARM2THUMB_GLUE_SECTION_NAME, + flags); if (sec == NULL - || ! bfd_set_section_flags (abfd, sec, flags) || ! bfd_set_section_alignment (abfd, sec, 2)) return FALSE; } @@ -1952,12 +1996,12 @@ bfd_arm_get_bfd_for_interworking (bfd * abfd, if (sec == NULL) { - flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY; - - sec = bfd_make_section (abfd, THUMB2ARM_GLUE_SECTION_NAME); + flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY + | SEC_CODE | SEC_READONLY); + sec = bfd_make_section_with_flags (abfd, THUMB2ARM_GLUE_SECTION_NAME, + flags); if (sec == NULL - || ! bfd_set_section_flags (abfd, sec, flags) || ! bfd_set_section_alignment (abfd, sec, 2)) return FALSE; } @@ -2085,6 +2129,7 @@ bfd_arm_process_before_allocation (bfd * abfd, #endif /* ! defined (COFF_IMAGE_WITH_PE) */ #define coff_bfd_reloc_type_lookup coff_arm_reloc_type_lookup +#define coff_bfd_reloc_name_lookup coff_arm_reloc_name_lookup #define coff_relocate_section coff_arm_relocate_section #define coff_bfd_is_local_label_name coff_arm_is_local_label_name #define coff_adjust_symndx coff_arm_adjust_symndx @@ -2397,7 +2442,9 @@ Warning: Clearing the interworking flag of %B because non-interworking code in % /* Note: the definitions here of LOCAL_LABEL_PREFIX and USER_LABEL_PREIFX *must* match the definitions in gcc/config/arm/{coff|semi|aout}.h. */ +#ifndef LOCAL_LABEL_PREFIX #define LOCAL_LABEL_PREFIX "" +#endif #ifndef USER_LABEL_PREFIX #define USER_LABEL_PREFIX "_" #endif diff --git a/bfd/coff-aux.c b/bfd/coff-aux.c index e22d85566a6..f28a9483fd5 100644 --- a/bfd/coff-aux.c +++ b/bfd/coff-aux.c @@ -1,5 +1,5 @@ /* BFD back-end for Apple M68K COFF A/UX 3.x files. - Copyright 1996, 1997, 2000, 2002 Free Software Foundation, Inc. + Copyright 1996, 1997, 2000, 2002, 2007 Free Software Foundation, Inc. Written by Richard Henderson . This file is part of BFD, the Binary File Descriptor library. @@ -37,8 +37,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define COFF_COMMON_ADDEND -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" static bfd_boolean coff_m68k_aux_link_add_one_symbol PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, diff --git a/bfd/coff-h8300.c b/bfd/coff-h8300.c index 9c858e1ef1e..99c0a5a9832 100644 --- a/bfd/coff-h8300.c +++ b/bfd/coff-h8300.c @@ -1,6 +1,6 @@ /* BFD back-end for Renesas H8/300 COFF binaries. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Steve Chamberlain, . @@ -20,8 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" #include "genlink.h" @@ -1276,12 +1276,12 @@ h8300_bfd_link_add_symbols (bfd *abfd, struct bfd_link_info *info) /* Make sure the appropriate flags are set, including SEC_IN_MEMORY. */ flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_READONLY); - htab->vectors_sec = bfd_make_section (abfd, ".vectors"); + htab->vectors_sec = bfd_make_section_with_flags (abfd, ".vectors", + flags); /* If the section wasn't created, or we couldn't set the flags, quit quickly now, rather than dying a painful death later. */ - if (!htab->vectors_sec - || !bfd_set_section_flags (abfd, htab->vectors_sec, flags)) + if (!htab->vectors_sec) return FALSE; /* Also create the vector hash table. */ diff --git a/bfd/coff-h8500.c b/bfd/coff-h8500.c index e9c878d820a..7297fe68933 100644 --- a/bfd/coff-h8500.c +++ b/bfd/coff-h8500.c @@ -1,6 +1,6 @@ /* BFD back-end for Renesas H8/500 COFF binaries. - Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2004, + 2005, 2007 Free Software Foundation, Inc. Contributed by Cygnus Support. Written by Steve Chamberlain, . @@ -20,8 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" #include "coff/h8500.h" diff --git a/bfd/coff-i386.c b/bfd/coff-i386.c index 0d71cd00065..81d38001233 100644 --- a/bfd/coff-i386.c +++ b/bfd/coff-i386.c @@ -1,6 +1,6 @@ /* BFD back-end for Intel 386 COFF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004 + 2000, 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -20,8 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/i386.h" @@ -546,6 +546,7 @@ coff_i386_rtype_to_howto (abfd, sec, rel, h, sym, addendp) } #define coff_bfd_reloc_type_lookup coff_i386_reloc_type_lookup +#define coff_bfd_reloc_name_lookup coff_i386_reloc_name_lookup static reloc_howto_type * coff_i386_reloc_type_lookup (abfd, code) @@ -578,6 +579,20 @@ coff_i386_reloc_type_lookup (abfd, code) } } +static reloc_howto_type * +coff_i386_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; i < sizeof (howto_table) / sizeof (howto_table[0]); i++) + if (howto_table[i].name != NULL + && strcasecmp (howto_table[i].name, r_name) == 0) + return &howto_table[i]; + + return NULL; +} + #define coff_rtype_to_howto coff_i386_rtype_to_howto #ifdef TARGET_UNDERSCORE diff --git a/bfd/coff-i860.c b/bfd/coff-i860.c index 723e823f1c7..53e0fd199ea 100644 --- a/bfd/coff-i860.c +++ b/bfd/coff-i860.c @@ -1,6 +1,6 @@ /* BFD back-end for Intel i860 COFF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Created mostly by substituting "860" for "386" in coff-i386.c Harry Dolan , October 1995 @@ -20,8 +20,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/i860.h" @@ -555,6 +555,20 @@ coff_i860_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, } } +static reloc_howto_type * +coff_i860_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; i < sizeof (howto_table) / sizeof (howto_table[0]); i++) + if (howto_table[i].name != NULL + && strcasecmp (howto_table[i].name, r_name) == 0) + return &howto_table[i]; + + return NULL; +} + /* This is called from coff_slurp_reloc_table for each relocation entry. This special handling is due to the `PAIR' relocation which has a different meaning for the `r_symndx' field. */ @@ -620,6 +634,7 @@ i860_reloc_processing (arelent *cache_ptr, struct internal_reloc *dst, #define coff_rtype_to_howto coff_i860_rtype_to_howto #define coff_bfd_reloc_type_lookup coff_i860_reloc_type_lookup +#define coff_bfd_reloc_name_lookup coff_i860_reloc_name_lookup #define RELOC_PROCESSING(relent, reloc, symbols, abfd, section) \ i860_reloc_processing (relent, reloc, symbols, abfd, section) diff --git a/bfd/coff-i960.c b/bfd/coff-i960.c index 741e15d41ea..e83fbac774e 100644 --- a/bfd/coff-i960.c +++ b/bfd/coff-i960.c @@ -1,6 +1,6 @@ /* BFD back-end for Intel 960 COFF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001, - 2002, 2003, 2004 Free Software Foundation, Inc. + 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -22,8 +22,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define I960 1 #define BADMAG(x) I960BADMAG(x) -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/i960.h" #include "coff/internal.h" @@ -296,6 +296,20 @@ coff_i960_reloc_type_lookup (abfd, code) } } +static reloc_howto_type * +coff_i960_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + if (strcasecmp (howto_optcall.name, r_name) == 0) + return &howto_optcall; + if (strcasecmp (howto_rellong.name, r_name) == 0) + return &howto_rellong; + if (strcasecmp (howto_iprmed.name, r_name) == 0) + return &howto_iprmed; + + return NULL; +} + /* The real code is in coffcode.h */ #define RTYPE2HOWTO(cache_ptr, dst) \ @@ -613,6 +627,7 @@ coff_i960_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp) #define coff_adjust_symndx coff_i960_adjust_symndx #define coff_bfd_reloc_type_lookup coff_i960_reloc_type_lookup +#define coff_bfd_reloc_name_lookup coff_i960_reloc_name_lookup #include "coffcode.h" diff --git a/bfd/coff-ia64.c b/bfd/coff-ia64.c index 1e3b3440f2e..32702a8f6ff 100644 --- a/bfd/coff-ia64.c +++ b/bfd/coff-ia64.c @@ -1,5 +1,5 @@ /* BFD back-end for HP/Intel IA-64 COFF files. - Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2007 Free Software Foundation, Inc. Contributed by David Mosberger This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/ia64.h" #include "coff/internal.h" diff --git a/bfd/coff-m68k.c b/bfd/coff-m68k.c index d389a4ff1e0..b0633498357 100644 --- a/bfd/coff-m68k.c +++ b/bfd/coff-m68k.c @@ -1,6 +1,6 @@ /* BFD back-end for Motorola 68000 COFF binaries. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, - 2000, 2001, 2002, 2003, 2005 + 2000, 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -20,8 +20,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/m68k.h" #include "coff/internal.h" @@ -91,6 +91,7 @@ m68k_coff_is_local_label_name (abfd, name) #define m68k_rtype2howto _bfd_m68kcoff_rtype2howto #define m68k_howto2rtype _bfd_m68kcoff_howto2rtype #define m68k_reloc_type_lookup _bfd_m68kcoff_reloc_type_lookup +#define m68k_reloc_name_lookup _bfd_m68kcoff_reloc_name_lookup #endif #ifdef ONLY_DECLARE_RELOCS @@ -123,6 +124,8 @@ extern void m68k_rtype2howto PARAMS ((arelent *internal, int relocentry)); extern int m68k_howto2rtype PARAMS ((reloc_howto_type *)); extern reloc_howto_type *m68k_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); +extern reloc_howto_type *m68k_reloc_name_lookup + PARAMS ((bfd *, const char *)); #else #ifdef STATIC_RELOCS @@ -132,6 +135,7 @@ extern reloc_howto_type *m68k_reloc_type_lookup #endif STAT_REL reloc_howto_type * m68k_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); +STAT_REL reloc_howto_type * m68k_reloc_name_lookup PARAMS ((bfd *, const char *)); STAT_REL int m68k_howto2rtype PARAMS ((reloc_howto_type *)); STAT_REL void m68k_rtype2howto PARAMS ((arelent *, int)); @@ -198,6 +202,22 @@ m68k_reloc_type_lookup (abfd, code) /*NOTREACHED*/ } +STAT_REL reloc_howto_type * +m68k_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (m68kcoff_howto_table) / sizeof (m68kcoff_howto_table[0]); + i++) + if (m68kcoff_howto_table[i].name != NULL + && strcasecmp (m68kcoff_howto_table[i].name, r_name) == 0) + return &m68kcoff_howto_table[i]; + + return NULL; +} + #endif /* not ONLY_DECLARE_RELOCS */ #define RTYPE2HOWTO(internal, relocentry) \ @@ -207,6 +227,7 @@ m68k_reloc_type_lookup (abfd, code) external.r_type = m68k_howto2rtype (internal) #define coff_bfd_reloc_type_lookup m68k_reloc_type_lookup +#define coff_bfd_reloc_name_lookup m68k_reloc_name_lookup #ifndef COFF_COMMON_ADDEND #ifndef coff_rtype_to_howto @@ -230,11 +251,12 @@ m68kcoff_rtype_to_howto (abfd, sec, rel, h, sym, addendp) arelent relent; reloc_howto_type *howto; + relent.howto = NULL; RTYPE2HOWTO (&relent, rel); howto = relent.howto; - if (howto->pc_relative) + if (howto != NULL && howto->pc_relative) *addendp += sec->vma; return howto; @@ -390,6 +412,7 @@ m68kcoff_common_addend_rtype_to_howto (abfd, sec, rel, h, sym, addendp) arelent relent; reloc_howto_type *howto; + relent.howto = NULL; RTYPE2HOWTO (&relent, rel); howto = relent.howto; diff --git a/bfd/coff-m88k.c b/bfd/coff-m88k.c index 422798b1af4..101cdcb738e 100644 --- a/bfd/coff-m88k.c +++ b/bfd/coff-m88k.c @@ -1,7 +1,6 @@ /* BFD back-end for Motorola 88000 COFF "Binary Compatibility Standard" files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 1999, 2000, - 2001, 2002, 2003 - Free Software Foundation, Inc. + 2001, 2002, 2003, 2007 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -21,8 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #define M88 1 /* Customize various include files */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/m88k.h" #include "coff/internal.h" diff --git a/bfd/coff-maxq.c b/bfd/coff-maxq.c index 6414cb9c206..b3881d323a1 100644 --- a/bfd/coff-maxq.c +++ b/bfd/coff-maxq.c @@ -1,5 +1,5 @@ /* BFD back-end for MAXQ COFF binaries. - Copyright 2004 Free Software Foundation, Inc. + Copyright 2004, 2007 Free Software Foundation, Inc. Contributed by Vineet Sharma (vineets@noida.hcltech.com) Inderpreet S. (inderpreetb@noida.hcltech.com) @@ -22,8 +22,8 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/maxq.h" #include "coff/internal.h" @@ -82,7 +82,6 @@ coff_maxq20_reloc (bfd * abfd, bfd * output_bfd ATTRIBUTE_UNUSED, char ** error_message ATTRIBUTE_UNUSED) { - reloc_howto_type *howto = NULL; unsigned char *addr = NULL; unsigned long x = 0; long call_addr = 0; @@ -96,7 +95,6 @@ coff_maxq20_reloc (bfd * abfd, if (data && reloc_entry) { - howto = reloc_entry->howto; addr = (unsigned char *) data + reloc_entry->address; call_addr = call_addr - call_addr; call_addr = get_symbol_value (symbol_in); @@ -374,69 +372,56 @@ static reloc_howto_type howto_table[] = EMPTY_HOWTO (10), }; -/* Map BFD reloc types to MAXQ COFF reloc types. */ - -typedef struct maxq_reloc_map -{ - bfd_reloc_code_real_type bfd_reloc_val; - unsigned int maxq_reloc_val; - reloc_howto_type * table; -} -reloc_map; - -static const reloc_map maxq_reloc_map[] = -{ - {BFD_RELOC_16_PCREL_S2, SHORT_JUMP, howto_table}, - {BFD_RELOC_16, LONG_JUMP, howto_table}, -}; - static reloc_howto_type * maxq_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real_type code) +{ + switch (code) + { + /* SHORT JUMP */ + case BFD_RELOC_16_PCREL_S2: + return howto_table + 3; + + /* INTERSEGMENT JUMP */ + case BFD_RELOC_24: + return howto_table + 4; + + /* BYTE RELOC */ + case BFD_RELOC_8: + return howto_table + 7; + + /* WORD RELOC */ + case BFD_RELOC_16: + return howto_table + 5; + + /* LONG RELOC */ + case BFD_RELOC_32: + return howto_table + 2; + + /* LONG JUMP */ + case BFD_RELOC_14: + return howto_table + 6; + + default: + return NULL; + } +} + +static reloc_howto_type * +maxq_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) { unsigned int i; - for (i = 0; i < ARRAY_SIZE (maxq_reloc_map); i++) - { - const reloc_map *entry; - - entry = maxq_reloc_map + i; - - switch (code) - { - /* SHORT JUMP */ - case BFD_RELOC_16_PCREL_S2: - return howto_table + 3; - - /* INTERSEGMENT JUMP */ - case BFD_RELOC_24: - return howto_table + 4; - - /* BYTE RELOC */ - case BFD_RELOC_8: - return howto_table + 7; - - /* WORD RELOC */ - case BFD_RELOC_16: - return howto_table + 5; - - /* LONG RELOC */ - case BFD_RELOC_32: - return howto_table + 2; - - /* LONG JUMP */ - case BFD_RELOC_14: - return howto_table + 6; - - default: - return NULL; - } - } + for (i = 0; i < sizeof (howto_table) / sizeof (howto_table[0]); i++) + if (howto_table[i].name != NULL + && strcasecmp (howto_table[i].name, r_name) == 0) + return &howto_table[i]; return NULL; } #define coff_bfd_reloc_type_lookup maxq_reloc_type_lookup +#define coff_bfd_reloc_name_lookup maxq_reloc_name_lookup /* Perform any necessary magic to the addend in a reloc entry. */ #define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \ diff --git a/bfd/coff-mcore.c b/bfd/coff-mcore.c index 08935fd6297..291474cbec9 100644 --- a/bfd/coff-mcore.c +++ b/bfd/coff-mcore.c @@ -1,5 +1,5 @@ /* BFD back-end for Motorola MCore COFF/PE - Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ along with this program; if not, write to the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/mcore.h" #include "coff/internal.h" @@ -283,9 +283,25 @@ mcore_coff_reloc_type_lookup (abfd, code) } /*NOTREACHED*/ } - #undef HOW2MAP +static reloc_howto_type * +mcore_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (mcore_coff_howto_table) + / sizeof (mcore_coff_howto_table[0])); + i++) + if (mcore_coff_howto_table[i].name != NULL + && strcasecmp (mcore_coff_howto_table[i].name, r_name) == 0) + return &mcore_coff_howto_table[i]; + + return NULL; +} + #define RTYPE2HOWTO(cache_ptr, dst) \ (cache_ptr)->howto = mcore_coff_howto_table + (dst)->r_type; @@ -538,6 +554,7 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section, /* We use the special COFF backend linker, with our own special touch. */ #define coff_bfd_reloc_type_lookup mcore_coff_reloc_type_lookup +#define coff_bfd_reloc_name_lookup mcore_coff_reloc_name_lookup #define coff_relocate_section coff_mcore_relocate_section #define coff_rtype_to_howto coff_mcore_rtype_to_howto diff --git a/bfd/coff-mips.c b/bfd/coff-mips.c index 34b072c4138..d5dafc7bf35 100644 --- a/bfd/coff-mips.c +++ b/bfd/coff-mips.c @@ -1,6 +1,6 @@ /* BFD back-end for MIPS Extended-Coff files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004 + 2000, 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Original version by Per Bothner. Full support added by Ian Lance Taylor, ian@cygnus.com. @@ -21,8 +21,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "coff/internal.h" @@ -769,6 +769,22 @@ mips_bfd_reloc_type_lookup (abfd, code) return &mips_howto_table[mips_type]; } + +static reloc_howto_type * +mips_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (mips_howto_table) / sizeof (mips_howto_table[0]); + i++) + if (mips_howto_table[i].name != NULL + && strcasecmp (mips_howto_table[i].name, r_name) == 0) + return &mips_howto_table[i]; + + return NULL; +} /* A helper routine for mips_relocate_section which handles the REFHI relocations. The REFHI relocation must be followed by a REFLO @@ -1375,6 +1391,7 @@ static const struct ecoff_backend_data mips_ecoff_backend_data = /* Looking up a reloc type is MIPS specific. */ #define _bfd_ecoff_bfd_reloc_type_lookup mips_bfd_reloc_type_lookup +#define _bfd_ecoff_bfd_reloc_name_lookup mips_bfd_reloc_name_lookup /* Getting relocated section contents is generic. */ #define _bfd_ecoff_bfd_get_relocated_section_contents \ diff --git a/bfd/coff-or32.c b/bfd/coff-or32.c index c8f0fe03601..077e8f6bab2 100644 --- a/bfd/coff-or32.c +++ b/bfd/coff-or32.c @@ -1,5 +1,5 @@ /* BFD back-end for OpenRISC 1000 COFF binaries. - Copyright 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Ivan Guzvinec This file is part of BFD, the Binary File Descriptor library. @@ -20,8 +20,8 @@ #define OR32 1 -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/or32.h" #include "coff/internal.h" @@ -317,11 +317,7 @@ reloc_processing (relent,reloc, symbols, abfd, section) } else { - asymbol *ptr; relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx]; - - ptr = *(relent->sym_ptr_ptr); - relent->addend = 0; relent->address-= section->vma; diff --git a/bfd/coff-pmac.c b/bfd/coff-pmac.c index 5e508673845..49ceb5241b0 100644 --- a/bfd/coff-pmac.c +++ b/bfd/coff-pmac.c @@ -1,5 +1,5 @@ /* BFD back-end for Apple et al PowerPC Mac "XCOFF" files. - Copyright 1995, 2000, 2001 Free Software Foundation, Inc. + Copyright 1995, 2000, 2001, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -24,8 +24,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define TARGET_SYM pmac_xcoff_vec #define TARGET_NAME "xcoff-powermac" -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/internal.h" #include "coff/rs6000.h" diff --git a/bfd/coff-ppc.c b/bfd/coff-ppc.c index b4427936933..72ade4e8ad2 100644 --- a/bfd/coff-ppc.c +++ b/bfd/coff-ppc.c @@ -1,6 +1,6 @@ /* BFD back-end for PowerPC Microsoft Portable Executable files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Original version pieced together by Kim Knuttila (krk@cygnus.com) @@ -33,9 +33,8 @@ - dlltool will not produce correct output in some .reloc cases, and will not produce the right glue code for dll function calls. */ -#include "bfd.h" #include "sysdep.h" - +#include "bfd.h" #include "libbfd.h" #include "coff/powerpc.h" @@ -1332,7 +1331,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, DUMP_RELOC2 (howto->name, rel); - if (strncmp(".idata$2",input_section->name,8) == 0 && first_thunk_address == 0) + if (CONST_STRNEQ (input_section->name, ".idata$2") && first_thunk_address == 0) { /* Set magic values. */ int idata5offset; @@ -1961,8 +1960,23 @@ ppc_coff_reloc_type_lookup (abfd, code) return NULL; } } - #undef HOW2MAP + +static reloc_howto_type * +ppc_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (ppc_coff_howto_table) / sizeof (ppc_coff_howto_table[0]); + i++) + if (ppc_coff_howto_table[i].name != NULL + && strcasecmp (ppc_coff_howto_table[i].name, r_name) == 0) + return &ppc_coff_howto_table[i]; + + return NULL; +} /* Tailor coffcode.h -- macro heaven. */ @@ -1971,6 +1985,7 @@ ppc_coff_reloc_type_lookup (abfd, code) /* We use the special COFF backend linker, with our own special touch. */ #define coff_bfd_reloc_type_lookup ppc_coff_reloc_type_lookup +#define coff_bfd_reloc_name_lookup ppc_coff_reloc_name_lookup #define coff_rtype_to_howto coff_ppc_rtype_to_howto #define coff_relocate_section coff_ppc_relocate_section #define coff_bfd_final_link ppc_bfd_coff_final_link diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index 951587f99b1..f446f497306 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -1,12 +1,7 @@ /* BFD back-end for IBM RS/6000 "XCOFF" files. - Copyright 1990-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 1990-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. - FIXME: Can someone provide a transliteration of this name into ASCII? - Using the following chars caused a compiler warning on HIUX (so I replaced - them with octal escapes), and isn't useful without an understanding of what - character set it is. - Written by Metin G. Ozisik, Mimi Ph\373\364ng-Th\345o V\365, - and John Gilmore. + Written by Metin G. Ozisik, Mimi Phuong-Thao Vo, and John Gilmore. Archive support from Damon A. Permezel. Contributed by IBM Corporation and Cygnus Support. @@ -26,8 +21,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "coff/internal.h" @@ -59,7 +54,7 @@ extern bfd_boolean _bfd_xcoff_write_armap extern bfd_boolean _bfd_xcoff_write_archive_contents PARAMS ((bfd *)); extern int _bfd_xcoff_sizeof_headers - PARAMS ((bfd *, bfd_boolean)); + PARAMS ((bfd *, struct bfd_link_info *)); extern void _bfd_xcoff_swap_sym_in PARAMS ((bfd *, PTR, PTR)); extern unsigned int _bfd_xcoff_swap_sym_out @@ -98,6 +93,7 @@ void xcoff_rtype2howto #define coff_bfd_copy_private_bfd_data _bfd_xcoff_copy_private_bfd_data #define coff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name #define coff_bfd_reloc_type_lookup _bfd_xcoff_reloc_type_lookup +#define coff_bfd_reloc_name_lookup _bfd_xcoff_reloc_name_lookup #ifdef AIX_CORE extern const bfd_target * rs6000coff_core_p PARAMS ((bfd *abfd)); @@ -1051,6 +1047,21 @@ _bfd_xcoff_reloc_type_lookup (abfd, code) } } +static reloc_howto_type * +_bfd_xcoff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (xcoff_howto_table) / sizeof (xcoff_howto_table[0]); + i++) + if (xcoff_howto_table[i].name != NULL + && strcasecmp (xcoff_howto_table[i].name, r_name) == 0) + return &xcoff_howto_table[i]; + + return NULL; +} /* XCOFF archive support. The original version of this code was by Damon A. Permezel. It was enhanced to permit cross support, and @@ -1638,7 +1649,7 @@ xcoff_write_armap_old (abfd, elength, map, orl_count, stridx) + SXCOFFARFMAG + arelt_size (sub)); fileoff = (fileoff + 1) &~ 1; - sub = sub->next; + sub = sub->archive_next; } for (i = 0; i < orl_count; i++) @@ -1809,7 +1820,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) } i++; } - current_bfd = current_bfd->next; + current_bfd = current_bfd->archive_next; if (current_bfd != NULL) arch_info = bfd_get_arch_info (current_bfd); } @@ -1913,7 +1924,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) + SXCOFFARFMAG + arelt_size (current_bfd)); fileoff += fileoff & 1; - current_bfd = current_bfd->next; + current_bfd = current_bfd->archive_next; if (current_bfd != NULL) arch_info = bfd_get_arch_info (current_bfd); } @@ -1934,7 +1945,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) } i++; } - current_bfd = current_bfd->next; + current_bfd = current_bfd->archive_next; if (current_bfd != NULL) arch_info = bfd_get_arch_info (current_bfd); } @@ -2009,7 +2020,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) + SXCOFFARFMAG + arelt_size (current_bfd)); fileoff += fileoff & 1; - current_bfd = current_bfd->next; + current_bfd = current_bfd->archive_next; if (current_bfd != NULL) arch_info = bfd_get_arch_info (current_bfd); } @@ -2030,7 +2041,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) } i++; } - current_bfd = current_bfd->next; + current_bfd = current_bfd->archive_next; if (current_bfd != NULL) arch_info = bfd_get_arch_info (current_bfd); } @@ -2089,7 +2100,7 @@ xcoff_write_archive_contents_old (abfd) count = 0; total_namlen = 0; - for (sub = abfd->archive_head; sub != NULL; sub = sub->next) + for (sub = abfd->archive_head; sub != NULL; sub = sub->archive_next) { ++count; total_namlen += strlen (normalize_filename (sub)) + 1; @@ -2105,7 +2116,9 @@ xcoff_write_archive_contents_old (abfd) hasobjects = FALSE; prevoff = 0; nextoff = SIZEOF_AR_FILE_HDR; - for (sub = abfd->archive_head, i = 0; sub != NULL; sub = sub->next, i++) + for (sub = abfd->archive_head, i = 0; + sub != NULL; + sub = sub->archive_next, i++) { const char *name; bfd_size_type namlen; @@ -2253,7 +2266,7 @@ xcoff_write_archive_contents_old (abfd) abfd) != XCOFFARMAG_ELEMENT_SIZE) return FALSE; } - for (sub = abfd->archive_head; sub != NULL; sub = sub->next) + for (sub = abfd->archive_head; sub != NULL; sub = sub->archive_next) { const char *name; bfd_size_type namlen; @@ -2323,7 +2336,7 @@ xcoff_write_archive_contents_big (abfd) hasobjects = FALSE; for (current_bfd = abfd->archive_head, count = 0, total_namlen = 0; current_bfd != NULL; - current_bfd = current_bfd->next, count++) + current_bfd = current_bfd->archive_next, count++) { total_namlen += strlen (normalize_filename (current_bfd)) + 1; @@ -2345,7 +2358,7 @@ xcoff_write_archive_contents_big (abfd) nextoff = SIZEOF_AR_FILE_HDR_BIG; for (current_bfd = abfd->archive_head, i = 0; current_bfd != NULL; - current_bfd = current_bfd->next, i++) + current_bfd = current_bfd->archive_next, i++) { const char *name; bfd_size_type namlen; @@ -2512,8 +2525,9 @@ xcoff_write_archive_contents_big (abfd) offsets = NULL; } - for (current_bfd = abfd->archive_head; current_bfd != NULL; - current_bfd = current_bfd->next) + for (current_bfd = abfd->archive_head; + current_bfd != NULL; + current_bfd = current_bfd->archive_next) { const char *name; size_t namlen; @@ -2573,9 +2587,8 @@ _bfd_xcoff_write_archive_contents (abfd) always uses an a.out header. */ int -_bfd_xcoff_sizeof_headers (abfd, reloc) - bfd *abfd; - bfd_boolean reloc ATTRIBUTE_UNUSED; +_bfd_xcoff_sizeof_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { int size; @@ -4179,6 +4192,7 @@ const bfd_target rs6000coff_vec = coff_get_reloc_upper_bound, coff_canonicalize_reloc, _bfd_xcoff_reloc_type_lookup, + _bfd_xcoff_reloc_name_lookup, /* Write */ coff_set_arch_mach, @@ -4429,6 +4443,7 @@ const bfd_target pmac_xcoff_vec = coff_get_reloc_upper_bound, coff_canonicalize_reloc, _bfd_xcoff_reloc_type_lookup, + _bfd_xcoff_reloc_name_lookup, /* Write */ coff_set_arch_mach, diff --git a/bfd/coff-sh.c b/bfd/coff-sh.c index fcfee718982..3734fb37912 100644 --- a/bfd/coff-sh.c +++ b/bfd/coff-sh.c @@ -1,6 +1,6 @@ /* BFD back-end for Renesas Super-H COFF binaries. Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Cygnus Support. Written by Steve Chamberlain, . Relaxing code written by Ian Lance Taylor, . @@ -21,8 +21,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libiberty.h" #include "libbfd.h" #include "bfdlink.h" @@ -494,6 +494,7 @@ static const struct shcoff_reloc_map sh_reloc_map[] = /* Given a BFD reloc code, return the howto structure for the corresponding SH PE reloc. */ #define coff_bfd_reloc_type_lookup sh_coff_reloc_type_lookup +#define coff_bfd_reloc_name_lookup sh_coff_reloc_name_lookup static reloc_howto_type * sh_coff_reloc_type_lookup (abfd, code) @@ -510,6 +511,20 @@ sh_coff_reloc_type_lookup (abfd, code) return NULL; } +static reloc_howto_type * +sh_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; i < sizeof (sh_coff_howtos) / sizeof (sh_coff_howtos[0]); i++) + if (sh_coff_howtos[i].name != NULL + && strcasecmp (sh_coff_howtos[i].name, r_name) == 0) + return &sh_coff_howtos[i]; + + return NULL; +} + /* This macro is used in coffcode.h to get the howto corresponding to an internal reloc. */ @@ -2510,8 +2525,9 @@ _bfd_sh_align_load_span (abfd, sec, contents, swap, relocs, next2_insn = bfd_get_16 (abfd, contents + i + 4); next2_op = sh_insn_info (next2_insn); - if ((next2_op->flags & (LOAD | STORE)) == 0 - && sh_load_use (insn, op, next2_insn, next2_op)) + if (next2_op == NULL + || ((next2_op->flags & (LOAD | STORE)) == 0 + && sh_load_use (insn, op, next2_insn, next2_op))) ok = FALSE; } diff --git a/bfd/coff-sparc.c b/bfd/coff-sparc.c index 0236f525e66..236c7bfd4e3 100644 --- a/bfd/coff-sparc.c +++ b/bfd/coff-sparc.c @@ -1,6 +1,6 @@ /* BFD back-end for Sparc COFF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001, - 2002, 2003, 2005 Free Software Foundation, Inc. + 2002, 2003, 2005, 2007 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/sparc.h" #include "coff/internal.h" @@ -158,6 +158,24 @@ coff_sparc_reloc_type_lookup (abfd, code) } #define coff_bfd_reloc_type_lookup coff_sparc_reloc_type_lookup +static reloc_howto_type * +coff_sparc_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (coff_sparc_howto_table) + / sizeof (coff_sparc_howto_table[0])); + i++) + if (coff_sparc_howto_table[i].name != NULL + && strcasecmp (coff_sparc_howto_table[i].name, r_name) == 0) + return &coff_sparc_howto_table[i]; + + return NULL; +} +#define coff_bfd_reloc_name_lookup coff_sparc_reloc_name_lookup + static void rtype2howto (cache_ptr, dst) arelent *cache_ptr; diff --git a/bfd/coff-stgo32.c b/bfd/coff-stgo32.c index 3c5fdbb6e80..61f18f0c1f3 100644 --- a/bfd/coff-stgo32.c +++ b/bfd/coff-stgo32.c @@ -1,5 +1,5 @@ /* BFD back-end for Intel 386 COFF files (DJGPP variant with a stub). - Copyright 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2006 Free Software Foundation, Inc. Written by Robert Hoehne. This file is part of BFD, the Binary File Descriptor library. @@ -354,7 +354,7 @@ create_go32_stub (abfd) close (f); goto stub_end; } - if (memcmp (magic, "go32stub", 8) != 0) + if (! CONST_STRNEQ (magic, "go32stub")) { close (f); goto stub_end; diff --git a/bfd/coff-tic30.c b/bfd/coff-tic30.c index b1ff5dbdfbf..dd97b2f8abb 100644 --- a/bfd/coff-tic30.c +++ b/bfd/coff-tic30.c @@ -1,5 +1,6 @@ /* BFD back-end for TMS320C30 coff binaries. - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002, 2007 + Free Software Foundation, Inc. Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au) This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +20,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" #include "coff/tic30.h" @@ -52,6 +53,7 @@ reloc_howto_type tic30_coff_howto_table[] = #ifndef coff_bfd_reloc_type_lookup #define coff_bfd_reloc_type_lookup tic30_coff_reloc_type_lookup +#define coff_bfd_reloc_name_lookup tic30_coff_reloc_name_lookup /* For the case statement use the code values used in tc_gen_reloc to map to the howto table entries that match those in both the aout @@ -80,6 +82,23 @@ tic30_coff_reloc_type_lookup (abfd, code) } } +static reloc_howto_type * +tic30_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (tic30_coff_howto_table) + / sizeof (tic30_coff_howto_table[0])); + i++) + if (tic30_coff_howto_table[i].name != NULL + && strcasecmp (tic30_coff_howto_table[i].name, r_name) == 0) + return &tic30_coff_howto_table[i]; + + return NULL; +} + #endif /* Turn a howto into a reloc number. */ diff --git a/bfd/coff-tic4x.c b/bfd/coff-tic4x.c index 1e95411e9e6..110fe1c1295 100644 --- a/bfd/coff-tic4x.c +++ b/bfd/coff-tic4x.c @@ -1,5 +1,5 @@ /* BFD back-end for TMS320C4X coff binaries. - Copyright 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2005 + Copyright 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz) @@ -21,8 +21,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" #include "coff/tic4x.h" @@ -117,6 +117,8 @@ reloc_howto_type tic4x_howto_table[] = #undef coff_bfd_reloc_type_lookup #define coff_bfd_reloc_type_lookup tic4x_coff_reloc_type_lookup +#undef coff_bfd_reloc_name_lookup +#define coff_bfd_reloc_name_lookup tic4x_coff_reloc_name_lookup /* For the case statement use the code values used tc_gen_reloc (defined in bfd/reloc.c) to map to the howto table entries. */ @@ -150,6 +152,21 @@ tic4x_coff_reloc_type_lookup (abfd, code) return NULL; } +static reloc_howto_type * +tic4x_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (tic4x_howto_table) / sizeof (tic4x_howto_table[0]); + i++) + if (tic4x_howto_table[i].name != NULL + && strcasecmp (tic4x_howto_table[i].name, r_name) == 0) + return &tic4x_howto_table[i]; + + return NULL; +} /* Code to turn a r_type into a howto ptr, uses the above howto table. Called after some initial checking by the tic4x_rtype_to_howto fn diff --git a/bfd/coff-tic54x.c b/bfd/coff-tic54x.c index f16fe899671..6b3e686b57b 100644 --- a/bfd/coff-tic54x.c +++ b/bfd/coff-tic54x.c @@ -1,5 +1,5 @@ /* BFD back-end for TMS320C54X coff binaries. - Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Timothy Wall (twall@cygnus.com) @@ -20,8 +20,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" #include "coff/tic54x.h" @@ -229,6 +229,7 @@ reloc_howto_type tic54x_howto_table[] = }; #define coff_bfd_reloc_type_lookup tic54x_coff_reloc_type_lookup +#define coff_bfd_reloc_name_lookup tic54x_coff_reloc_name_lookup /* For the case statement use the code values used tc_gen_reloc (defined in bfd/reloc.c) to map to the howto table entries. */ @@ -259,6 +260,22 @@ tic54x_coff_reloc_type_lookup (abfd, code) } } +static reloc_howto_type * +tic54x_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (tic54x_howto_table) / sizeof (tic54x_howto_table[0]); + i++) + if (tic54x_howto_table[i].name != NULL + && strcasecmp (tic54x_howto_table[i].name, r_name) == 0) + return &tic54x_howto_table[i]; + + return NULL; +} + /* Code to turn a r_type into a howto ptr, uses the above howto table. Called after some initial checking by the tic54x_rtype_to_howto fn below. */ diff --git a/bfd/coff-tic80.c b/bfd/coff-tic80.c index ec9cbeef59a..3fcedd7e605 100644 --- a/bfd/coff-tic80.c +++ b/bfd/coff-tic80.c @@ -1,5 +1,5 @@ /* BFD back-end for Texas Instruments TMS320C80 Multimedia Video Processor (MVP). - Copyright 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Fred Fish (fnf@cygnus.com) @@ -24,9 +24,9 @@ along with this program; if not, write to the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "sysdep.h" #include "bfd.h" #include "bfdlink.h" -#include "sysdep.h" #include "libbfd.h" #ifdef _CONST /* Newlib-based hosts define _CONST as a STDC-safe alias for const, diff --git a/bfd/coff-w65.c b/bfd/coff-w65.c index 7a1cfb73928..ce8f1dc2bca 100644 --- a/bfd/coff-w65.c +++ b/bfd/coff-w65.c @@ -1,6 +1,6 @@ /* BFD back-end for WDC 65816 COFF binaries. - Copyright 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2006, 2007 Free Software Foundation, Inc. Written by Steve Chamberlain, . This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" #include "coff/w65.h" @@ -105,7 +105,7 @@ reloc_processing (relent, reloc, symbols, abfd, section) if (((int) reloc->r_symndx) > 0) relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx]; else - relent->sym_ptr_ptr = (asymbol **)&(bfd_abs_symbol); + relent->sym_ptr_ptr = (asymbol **) bfd_abs_section_ptr->symbol_ptr_ptr; relent->addend = reloc->r_offset; diff --git a/bfd/coff-we32k.c b/bfd/coff-we32k.c index a488e2dc644..e7b0b5c0330 100644 --- a/bfd/coff-we32k.c +++ b/bfd/coff-we32k.c @@ -1,5 +1,5 @@ /* BFD back-end for we32k COFF files. - Copyright 1992, 1993, 1994, 1999, 2000, 2002, 2003 + Copyright 1992, 1993, 1994, 1999, 2000, 2002, 2003, 2007 Free Software Foundation, Inc. Contributed by Brendan Kehoe (brendan@cs.widener.edu). @@ -19,8 +19,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/we32k.h" #include "coff/internal.h" diff --git a/bfd/coff-x86_64.c b/bfd/coff-x86_64.c new file mode 100644 index 00000000000..a30349f1608 --- /dev/null +++ b/bfd/coff-x86_64.c @@ -0,0 +1,783 @@ +/* BFD back-end for AMD 64 COFF files. + Copyright 2006, 2007 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + 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 2 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. + + Written by Kai Tietz, OneVision Software GmbH&CoKg. */ + +#ifndef COFF_WITH_pex64 +#define COFF_WITH_pex64 +#endif + +#include "sysdep.h" +#include "bfd.h" +#include "libbfd.h" +#include "coff/x86_64.h" +#include "coff/internal.h" +#include "coff/pe.h" +#include "libcoff.h" +#include "libiberty.h" + +#define BADMAG(x) AMD64BADMAG(x) + +#ifdef COFF_WITH_pex64 +# undef AOUTSZ +# define AOUTSZ PEPAOUTSZ +# define PEAOUTHDR PEPAOUTHDR +#endif + +#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2) + +/* The page size is a guess based on ELF. */ + +#define COFF_PAGE_SIZE 0x1000 + +/* For some reason when using AMD COFF the value stored in the .text + section for a reference to a common symbol is the value itself plus + any desired offset. Ian Taylor, Cygnus Support. */ + +/* If we are producing relocatable output, we need to do some + adjustments to the object file that are not done by the + bfd_perform_relocation function. This function is called by every + reloc type to make any required adjustments. */ + +static bfd_reloc_status_type +coff_amd64_reloc (bfd *abfd, + arelent *reloc_entry, + asymbol *symbol, + void * data, + asection *input_section ATTRIBUTE_UNUSED, + bfd *output_bfd, + char **error_message ATTRIBUTE_UNUSED) +{ + symvalue diff; + +#if !defined(COFF_WITH_PE) + if (output_bfd == NULL) + return bfd_reloc_continue; +#endif + + if (bfd_is_com_section (symbol->section)) + { +#if !defined(COFF_WITH_PE) + /* We are relocating a common symbol. The current value in the + object file is ORIG + OFFSET, where ORIG is the value of the + common symbol as seen by the object file when it was compiled + (this may be zero if the symbol was undefined) and OFFSET is + the offset into the common symbol (normally zero, but may be + non-zero when referring to a field in a common structure). + ORIG is the negative of reloc_entry->addend, which is set by + the CALC_ADDEND macro below. We want to replace the value in + the object file with NEW + OFFSET, where NEW is the value of + the common symbol which we are going to put in the final + object file. NEW is symbol->value. */ + diff = symbol->value + reloc_entry->addend; +#else + /* In PE mode, we do not offset the common symbol. */ + diff = reloc_entry->addend; +#endif + } + else + { + /* For some reason bfd_perform_relocation always effectively + ignores the addend for a COFF target when producing + relocatable output. This seems to be always wrong for 386 + COFF, so we handle the addend here instead. */ +#if defined(COFF_WITH_PE) + if (output_bfd == NULL) + { + reloc_howto_type *howto = reloc_entry->howto; + + /* Although PC relative relocations are very similar between + PE and non-PE formats, but they are off by 1 << howto->size + bytes. For the external relocation, PE is very different + from others. See md_apply_fix3 () in gas/config/tc-amd64.c. + When we link PE and non-PE object files together to + generate a non-PE executable, we have to compensate it + here. */ + if(howto->pc_relative && howto->pcrel_offset) + diff = -(1 << howto->size); + else if(symbol->flags & BSF_WEAK) + diff = reloc_entry->addend - symbol->value; + else + diff = -reloc_entry->addend; + } + else +#endif + diff = reloc_entry->addend; + } + +#if defined(COFF_WITH_PE) + /* FIXME: How should this case be handled? */ + if (reloc_entry->howto->type == R_AMD64_IMAGEBASE + && output_bfd != NULL + && bfd_get_flavour (output_bfd) == bfd_target_coff_flavour) + diff -= pe_data (output_bfd)->pe_opthdr.ImageBase; +#endif + +#define DOIT(x) \ + x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + diff) & howto->dst_mask)) + + if (diff != 0) + { + reloc_howto_type *howto = reloc_entry->howto; + unsigned char *addr = (unsigned char *) data + reloc_entry->address; + + switch (howto->size) + { + case 0: + { + char x = bfd_get_8 (abfd, addr); + DOIT (x); + bfd_put_8 (abfd, x, addr); + } + break; + + case 1: + { + short x = bfd_get_16 (abfd, addr); + DOIT (x); + bfd_put_16 (abfd, (bfd_vma) x, addr); + } + break; + + case 2: + { + long x = bfd_get_32 (abfd, addr); + DOIT (x); + bfd_put_32 (abfd, (bfd_vma) x, addr); + } + break; + case 4: + { + long long x = bfd_get_64 (abfd, addr); + DOIT (x); + bfd_put_64 (abfd, (bfd_vma) x, addr); + } + break; + + default: + abort (); + } + } + + /* Now let bfd_perform_relocation finish everything up. */ + return bfd_reloc_continue; +} + +#if defined(COFF_WITH_PE) +/* Return TRUE if this relocation should appear in the output .reloc + section. */ + +static bfd_boolean +in_reloc_p (bfd *abfd ATTRIBUTE_UNUSED, reloc_howto_type *howto) +{ + return ! howto->pc_relative && howto->type != R_AMD64_IMAGEBASE; +} +#endif /* COFF_WITH_PE */ + +#ifndef PCRELOFFSET +#define PCRELOFFSET TRUE +#endif + +static reloc_howto_type howto_table[] = +{ + EMPTY_HOWTO (0), + HOWTO (R_AMD64_DIR64, /* type 1*/ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long, 4 = long long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + coff_amd64_reloc, /* special_function */ + "R_X86_64_64", /* name */ + TRUE, /* partial_inplace */ + 0xffffffffffffffffll, /* src_mask */ + 0xffffffffffffffffll, /* dst_mask */ + TRUE), /* pcrel_offset */ + HOWTO (R_AMD64_DIR32, /* type 2 */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + coff_amd64_reloc, /* special_function */ + "R_X86_64_32", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + /* PE IMAGE_REL_AMD64_ADDR32NB relocation (3). */ + HOWTO (R_AMD64_IMAGEBASE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + coff_amd64_reloc, /* special_function */ + "rva32", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* 32-bit longword PC relative relocation (4). */ + HOWTO (R_AMD64_PCRLONG, /* type 4 */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + coff_amd64_reloc, /* special_function */ + "R_X86_64_PC32", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + PCRELOFFSET), /* pcrel_offset */ + + HOWTO (R_AMD64_PCRLONG_1, /* type 5 */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + coff_amd64_reloc, /* special_function */ + "DISP32+1", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + PCRELOFFSET), /* pcrel_offset */ + HOWTO (R_AMD64_PCRLONG_2, /* type 6 */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + coff_amd64_reloc, /* special_function */ + "DISP32+2", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + PCRELOFFSET), /* pcrel_offset */ + HOWTO (R_AMD64_PCRLONG_3, /* type 7 */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + coff_amd64_reloc, /* special_function */ + "DISP32+3", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + PCRELOFFSET), /* pcrel_offset */ + HOWTO (R_AMD64_PCRLONG_4, /* type 8 */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + coff_amd64_reloc, /* special_function */ + "DISP32+4", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + PCRELOFFSET), /* pcrel_offset */ + HOWTO (R_AMD64_PCRLONG_5, /* type 9 */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + coff_amd64_reloc, /* special_function */ + "DISP32+5", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + PCRELOFFSET), /* pcrel_offset */ + EMPTY_HOWTO (10), /* R_AMD64_SECTION 10 */ +#if defined(COFF_WITH_PE) + /* 32-bit longword section relative relocation (11). */ + HOWTO (R_AMD64_SECREL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + coff_amd64_reloc, /* special_function */ + "secrel32", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ +#else + EMPTY_HOWTO (11), +#endif + EMPTY_HOWTO (12), + EMPTY_HOWTO (13), +#ifndef DONT_EXTEND_AMD64 + HOWTO (R_AMD64_PCRQUAD, + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + coff_amd64_reloc, /* special_function */ + "R_X86_64_PC64", /* name */ + TRUE, /* partial_inplace */ + 0xffffffffffffffffll, /* src_mask */ + 0xffffffffffffffffll, /* dst_mask */ + PCRELOFFSET), /* pcrel_offset */ +#else + EMPTY_HOWTO (14), +#endif + /* Byte relocation (15). */ + HOWTO (R_RELBYTE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + coff_amd64_reloc, /* special_function */ + "R_X86_64_8", /* name */ + TRUE, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + PCRELOFFSET), /* pcrel_offset */ + /* 16-bit word relocation (16). */ + HOWTO (R_RELWORD, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + coff_amd64_reloc, /* special_function */ + "R_X86_64_16", /* name */ + TRUE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + PCRELOFFSET), /* pcrel_offset */ + /* 32-bit longword relocation (17). */ + HOWTO (R_RELLONG, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + coff_amd64_reloc, /* special_function */ + "R_X86_64_32S", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + PCRELOFFSET), /* pcrel_offset */ + /* Byte PC relative relocation (18). */ + HOWTO (R_PCRBYTE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + coff_amd64_reloc, /* special_function */ + "R_X86_64_PC8", /* name */ + TRUE, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + PCRELOFFSET), /* pcrel_offset */ + /* 16-bit word PC relative relocation (19). */ + HOWTO (R_PCRWORD, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + coff_amd64_reloc, /* special_function */ + "R_X86_64_PC16", /* name */ + TRUE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + PCRELOFFSET), /* pcrel_offset */ + /* 32-bit longword PC relative relocation (20). */ + HOWTO (R_PCRLONG, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + coff_amd64_reloc, /* special_function */ + "R_X86_64_PC32", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + PCRELOFFSET) /* pcrel_offset */ +}; + +/* Turn a howto into a reloc nunmber */ + +#define SELECT_RELOC(x,howto) { x.r_type = howto->type; } +#define I386 1 /* Customize coffcode.h */ +#define AMD64 1 + +#define RTYPE2HOWTO(cache_ptr, dst) \ + ((cache_ptr)->howto = \ + ((dst)->r_type < ARRAY_SIZE (howto_table)) \ + ? howto_table + (dst)->r_type \ + : NULL) + +/* For 386 COFF a STYP_NOLOAD | STYP_BSS section is part of a shared + library. On some other COFF targets STYP_BSS is normally + STYP_NOLOAD. */ +#define BSS_NOLOAD_IS_SHARED_LIBRARY + +/* Compute the addend of a reloc. If the reloc is to a common symbol, + the object file contains the value of the common symbol. By the + time this is called, the linker may be using a different symbol + from a different object file with a different value. Therefore, we + hack wildly to locate the original symbol from this file so that we + can make the correct adjustment. This macro sets coffsym to the + symbol from the original file, and uses it to set the addend value + correctly. If this is not a common symbol, the usual addend + calculation is done, except that an additional tweak is needed for + PC relative relocs. + FIXME: This macro refers to symbols and asect; these are from the + calling function, not the macro arguments. */ + +#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) \ + { \ + coff_symbol_type *coffsym = NULL; \ + \ + if (ptr && bfd_asymbol_bfd (ptr) != abfd) \ + coffsym = (obj_symbols (abfd) \ + + (cache_ptr->sym_ptr_ptr - symbols)); \ + else if (ptr) \ + coffsym = coff_symbol_from (abfd, ptr); \ + \ + if (coffsym != NULL \ + && coffsym->native->u.syment.n_scnum == 0) \ + cache_ptr->addend = - coffsym->native->u.syment.n_value; \ + else if (ptr && bfd_asymbol_bfd (ptr) == abfd \ + && ptr->section != NULL) \ + cache_ptr->addend = - (ptr->section->vma + ptr->value); \ + else \ + cache_ptr->addend = 0; \ + if (ptr && howto_table[reloc.r_type].pc_relative) \ + cache_ptr->addend += asect->vma; \ + } + +/* We use the special COFF backend linker. For normal AMD64 COFF, we + can use the generic relocate_section routine. For PE, we need our + own routine. */ + +#if !defined(COFF_WITH_PE) + +#define coff_relocate_section _bfd_coff_generic_relocate_section + +#else /* COFF_WITH_PE */ + +/* The PE relocate section routine. The only difference between this + and the regular routine is that we don't want to do anything for a + relocatable link. */ + +static bfd_boolean +coff_pe_amd64_relocate_section (bfd *output_bfd, + struct bfd_link_info *info, + bfd *input_bfd, + asection *input_section, + bfd_byte *contents, + struct internal_reloc *relocs, + struct internal_syment *syms, + asection **sections) +{ + if (info->relocatable) + return TRUE; + + return _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd,input_section, contents,relocs, syms, sections); +} + +#define coff_relocate_section coff_pe_amd64_relocate_section + +#endif /* COFF_WITH_PE */ + +/* Convert an rtype to howto for the COFF backend linker. */ + +static reloc_howto_type * +coff_amd64_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED, + asection *sec, + struct internal_reloc *rel, + struct coff_link_hash_entry *h, + struct internal_syment *sym, + bfd_vma *addendp) +{ + reloc_howto_type *howto; + + if (rel->r_type > ARRAY_SIZE (howto_table)) + { + bfd_set_error (bfd_error_bad_value); + return NULL; + } + if (rel->r_type >= R_AMD64_PCRLONG_1 && rel->r_type <= R_AMD64_PCRLONG_5) + { + rel->r_vaddr += (bfd_vma)(rel->r_type-R_AMD64_PCRLONG); + rel->r_type = R_AMD64_PCRLONG; + } + howto = howto_table + rel->r_type; + +#if defined(COFF_WITH_PE) + /* Cancel out code in _bfd_coff_generic_relocate_section. */ + *addendp = 0; +#endif + + if (howto->pc_relative) + *addendp += sec->vma; + + if (sym != NULL && sym->n_scnum == 0 && sym->n_value != 0) + { + /* This is a common symbol. The section contents include the + size (sym->n_value) as an addend. The relocate_section + function will be adding in the final value of the symbol. We + need to subtract out the current size in order to get the + correct result. */ + BFD_ASSERT (h != NULL); + +#if !defined(COFF_WITH_PE) + /* I think we *do* want to bypass this. If we don't, I have + seen some data parameters get the wrong relocation address. + If I link two versions with and without this section bypassed + and then do a binary comparison, the addresses which are + different can be looked up in the map. The case in which + this section has been bypassed has addresses which correspond + to values I can find in the map. */ + *addendp -= sym->n_value; +#endif + } + +#if !defined(COFF_WITH_PE) + /* If the output symbol is common (in which case this must be a + relocatable link), we need to add in the final size of the + common symbol. */ + if (h != NULL && h->root.type == bfd_link_hash_common) + *addendp += h->root.u.c.size; +#endif + +#if defined(COFF_WITH_PE) + if (howto->pc_relative) + { + *addendp -= 4; + + /* If the symbol is defined, then the generic code is going to + add back the symbol value in order to cancel out an + adjustment it made to the addend. However, we set the addend + to 0 at the start of this function. We need to adjust here, + to avoid the adjustment the generic code will make. FIXME: + This is getting a bit hackish. */ + if (sym != NULL && sym->n_scnum != 0) + *addendp -= sym->n_value; + } + + if (rel->r_type == R_AMD64_IMAGEBASE + && (bfd_get_flavour (sec->output_section->owner) == bfd_target_coff_flavour)) + *addendp -= pe_data (sec->output_section->owner)->pe_opthdr.ImageBase; + + if (rel->r_type == R_AMD64_SECREL) + { + bfd_vma osect_vma; + + if (h && (h->type == bfd_link_hash_defined || h->type == bfd_link_hash_defweak)) + osect_vma = h->root.u.def.section->output_section->vma; + else + { + asection *sec; + int i; + + /* Sigh, the only way to get the section to offset against + is to find it the hard way. */ + for (sec = abfd->sections, i = 1; i < sym->n_scnum; i++) + sec = sec->next; + + osect_vma = sec->output_section->vma; + } + + *addendp -= osect_vma; + } +#endif + + return howto; +} + +#define coff_bfd_reloc_type_lookup coff_amd64_reloc_type_lookup +#define coff_bfd_reloc_name_lookup coff_amd64_reloc_name_lookup + +static reloc_howto_type * +coff_amd64_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real_type code) +{ + switch (code) + { + case BFD_RELOC_RVA: + return howto_table + R_AMD64_IMAGEBASE; + case BFD_RELOC_32: + return howto_table + R_AMD64_DIR32; + case BFD_RELOC_64: + return howto_table + R_AMD64_DIR64; + case BFD_RELOC_64_PCREL: +#ifndef DONT_EXTEND_AMD64 + return howto_table + R_AMD64_PCRQUAD; +#else + /* Fall through. */ +#endif + case BFD_RELOC_32_PCREL: + return howto_table + R_AMD64_PCRLONG; + case BFD_RELOC_X86_64_32S: + return howto_table + R_RELLONG; + case BFD_RELOC_16: + return howto_table + R_RELWORD; + case BFD_RELOC_16_PCREL: + return howto_table + R_PCRWORD; + case BFD_RELOC_8: + return howto_table + R_RELBYTE; + case BFD_RELOC_8_PCREL: + return howto_table + R_PCRBYTE; +#if defined(COFF_WITH_PE) + case BFD_RELOC_32_SECREL: + return howto_table + R_AMD64_SECREL; +#endif + default: + BFD_FAIL (); + return 0; + } +} + +static reloc_howto_type * +coff_amd64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; i < sizeof (howto_table) / sizeof (howto_table[0]); i++) + if (howto_table[i].name != NULL + && strcasecmp (howto_table[i].name, r_name) == 0) + return &howto_table[i]; + + return NULL; +} + +#define coff_rtype_to_howto coff_amd64_rtype_to_howto + +#ifdef TARGET_UNDERSCORE + +/* If amd64 gcc uses underscores for symbol names, then it does not use + a leading dot for local labels, so if TARGET_UNDERSCORE is defined + we treat all symbols starting with L as local. */ + +static bfd_boolean +coff_amd64_is_local_label_name (bfd *abfd, const char *name) +{ + if (name[0] == 'L') + return TRUE; + + return _bfd_coff_is_local_label_name (abfd, name); +} + +#define coff_bfd_is_local_label_name coff_amd64_is_local_label_name + +#endif /* TARGET_UNDERSCORE */ + +#include "coffcode.h" + +#ifdef PE +#define amd64coff_object_p pe_bfd_object_p +#else +#define amd64coff_object_p coff_object_p +#endif + +const bfd_target +#ifdef TARGET_SYM + TARGET_SYM = +#else + x86_64coff_vec = +#endif +{ +#ifdef TARGET_NAME + TARGET_NAME, +#else + "coff-x86-64", /* Name. */ +#endif + bfd_target_coff_flavour, + BFD_ENDIAN_LITTLE, /* Data byte order is little. */ + BFD_ENDIAN_LITTLE, /* Header byte order is little. */ + + (HAS_RELOC | EXEC_P | /* Object flags. */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), + + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* Section flags. */ +#if defined(COFF_WITH_PE) + | SEC_LINK_ONCE | SEC_LINK_DUPLICATES | SEC_READONLY +#endif + | SEC_CODE | SEC_DATA), + +#ifdef TARGET_UNDERSCORE + TARGET_UNDERSCORE, /* Leading underscore. */ +#else + 0, /* Leading underscore. */ +#endif + '/', /* Ar_pad_char. */ + 15, /* Ar_max_namelen. */ + + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Data. */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Hdrs. */ + + /* Note that we allow an object file to be treated as a core file as well. */ + { _bfd_dummy_target, amd64coff_object_p, /* BFD_check_format. */ + bfd_generic_archive_p, amd64coff_object_p }, + { bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format. */ + bfd_false }, + { bfd_false, coff_write_object_contents, /* bfd_write_contents. */ + _bfd_write_archive_contents, bfd_false }, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + + NULL, + + COFF_SWAP_TABLE +}; diff --git a/bfd/coff-z80.c b/bfd/coff-z80.c index 512c2b8677e..cb5a0e3dd1a 100644 --- a/bfd/coff-z80.c +++ b/bfd/coff-z80.c @@ -1,5 +1,5 @@ /* BFD back-end for Zilog Z80 COFF binaries. - Copyright 2005 Free Software Foundation, Inc. + Copyright 2005, 2007 Free Software Foundation, Inc. Contributed by Arnold Metselaar This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" #include "coff/z80.h" @@ -123,6 +123,26 @@ coff_z80_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, } } +static reloc_howto_type * +coff_z80_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + if (strcasecmp (r_imm8.name, r_name) == 0) + return &r_imm8; + if (strcasecmp (r_imm16.name, r_name) == 0) + return &r_imm16; + if (strcasecmp (r_imm24.name, r_name) == 0) + return &r_imm24; + if (strcasecmp (r_imm32.name, r_name) == 0) + return &r_imm32; + if (strcasecmp (r_jr.name, r_name) == 0) + return &r_jr; + if (strcasecmp (r_off8.name, r_name) == 0) + return &r_off8; + + return NULL; +} + /* Perform any necessary magic to the addend in a reloc entry. */ #define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \ @@ -248,6 +268,7 @@ extra_case (bfd *in_abfd, #define coff_reloc16_extra_cases extra_case #define coff_bfd_reloc_type_lookup coff_z80_reloc_type_lookup +#define coff_bfd_reloc_name_lookup coff_z80_reloc_name_lookup #include "coffcode.h" diff --git a/bfd/coff-z8k.c b/bfd/coff-z8k.c index 8fc2f169239..fb07db3a6e5 100644 --- a/bfd/coff-z8k.c +++ b/bfd/coff-z8k.c @@ -1,6 +1,6 @@ /* BFD back-end for Zilog Z800n COFF binaries. Copyright 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, - 2004, 2005 Free Software Foundation, Inc. + 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Cygnus Support. Written by Steve Chamberlain, . @@ -20,8 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" #include "coff/z8k.h" @@ -135,6 +135,30 @@ coff_z8k_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, } } +static reloc_howto_type * +coff_z8k_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + if (strcasecmp (r_imm8.name, r_name) == 0) + return &r_imm8; + if (strcasecmp (r_da.name, r_name) == 0) + return &r_da; + if (strcasecmp (r_imm32.name, r_name) == 0) + return &r_imm32; + if (strcasecmp (r_jr.name, r_name) == 0) + return &r_jr; + if (strcasecmp (r_rel16.name, r_name) == 0) + return &r_rel16; + if (strcasecmp (r_disp7.name, r_name) == 0) + return &r_disp7; + if (strcasecmp (r_callr.name, r_name) == 0) + return &r_callr; + if (strcasecmp (r_imm4l.name, r_name) == 0) + return &r_imm4l; + + return NULL; +} + /* Perform any necessary magic to the addend in a reloc entry. */ #define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \ @@ -345,6 +369,7 @@ extra_case (bfd *in_abfd, #define coff_reloc16_extra_cases extra_case #define coff_bfd_reloc_type_lookup coff_z8k_reloc_type_lookup +#define coff_bfd_reloc_name_lookup coff_z8k_reloc_name_lookup #include "coffcode.h" diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c index e0aa87ef677..5e0804f00fc 100644 --- a/bfd/coff64-rs6000.c +++ b/bfd/coff64-rs6000.c @@ -1,5 +1,5 @@ /* BFD back-end for IBM RS/6000 "XCOFF64" files. - Copyright 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written Clinton Popetz. Contributed by Cygnus Support. @@ -20,8 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "coff/internal.h" @@ -127,7 +127,7 @@ extern bfd_boolean _bfd_xcoff_write_armap extern bfd_boolean _bfd_xcoff_write_archive_contents PARAMS ((bfd *)); extern int _bfd_xcoff_sizeof_headers - PARAMS ((bfd *, bfd_boolean)); + PARAMS ((bfd *, struct bfd_link_info *)); extern void _bfd_xcoff_swap_sym_in PARAMS ((bfd *, PTR, PTR)); extern unsigned int _bfd_xcoff_swap_sym_out @@ -161,7 +161,7 @@ static const bfd_target *xcoff64_archive_p static bfd *xcoff64_openr_next_archived_file PARAMS ((bfd *, bfd *)); static int xcoff64_sizeof_headers - PARAMS ((bfd *, bfd_boolean)); + PARAMS ((bfd *, struct bfd_link_info *)); static asection *xcoff64_create_csect_from_smclas PARAMS ((bfd *, union internal_auxent *, const char *)); static bfd_boolean xcoff64_is_lineno_count_overflow @@ -237,6 +237,7 @@ bfd_boolean (*xcoff64_calculate_relocation[XCOFF_MAX_CALCULATE_RELOCATION]) #define coff_bfd_copy_private_bfd_data _bfd_xcoff_copy_private_bfd_data #define coff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name #define coff_bfd_reloc_type_lookup xcoff64_reloc_type_lookup +#define coff_bfd_reloc_name_lookup xcoff64_reloc_name_lookup #ifdef AIX_CORE extern const bfd_target * rs6000coff_core_p PARAMS ((bfd *abfd)); @@ -1843,6 +1844,22 @@ xcoff64_reloc_type_lookup (abfd, code) } } +static reloc_howto_type * +xcoff64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (xcoff64_howto_table) / sizeof (xcoff64_howto_table[0]); + i++) + if (xcoff64_howto_table[i].name != NULL + && strcasecmp (xcoff64_howto_table[i].name, r_name) == 0) + return &xcoff64_howto_table[i]; + + return NULL; +} + /* Read in the armap of an XCOFF archive. */ static bfd_boolean @@ -2056,9 +2073,8 @@ xcoff64_openr_next_archived_file (archive, last_file) always uses an a.out header. */ static int -xcoff64_sizeof_headers (abfd, reloc) - bfd *abfd; - bfd_boolean reloc ATTRIBUTE_UNUSED; +xcoff64_sizeof_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { int size; @@ -2726,6 +2742,7 @@ const bfd_target rs6000coff64_vec = coff_get_reloc_upper_bound, coff_canonicalize_reloc, xcoff64_reloc_type_lookup, + xcoff64_reloc_name_lookup, /* Write */ coff_set_arch_mach, @@ -2977,6 +2994,7 @@ const bfd_target aix5coff64_vec = coff_get_reloc_upper_bound, coff_canonicalize_reloc, xcoff64_reloc_type_lookup, + xcoff64_reloc_name_lookup, /* Write */ coff_set_arch_mach, diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 256732c314d..a2aac5f63b4 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -1,6 +1,6 @@ /* Support for the generic parts of most COFF variants, for BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -427,7 +427,7 @@ sec_to_styp_flags (const char *sec_name, flagword sec_flags) styp_flags = STYP_LIT; #endif /* _LIT */ } - else if (!strncmp (sec_name, DOT_DEBUG, sizeof (DOT_DEBUG) - 1)) + else if (CONST_STRNEQ (sec_name, DOT_DEBUG)) { /* Handle the XCOFF debug section and DWARF2 debug sections. */ if (!sec_name[6]) @@ -435,12 +435,12 @@ sec_to_styp_flags (const char *sec_name, flagword sec_flags) else styp_flags = STYP_DEBUG_INFO; } - else if (!strncmp (sec_name, ".stab", 5)) + else if (CONST_STRNEQ (sec_name, ".stab")) { styp_flags = STYP_DEBUG_INFO; } #ifdef COFF_LONG_SECTION_NAMES - else if (!strncmp (sec_name, GNU_LINKONCE_WI, sizeof (GNU_LINKONCE_WI) - 1)) + else if (CONST_STRNEQ (sec_name, GNU_LINKONCE_WI)) { styp_flags = STYP_DEBUG_INFO; } @@ -529,8 +529,8 @@ sec_to_styp_flags (const char *sec_name, flagword sec_flags) but there are more IMAGE_SCN_* flags. */ /* FIXME: There is no gas syntax to specify the debug section flag. */ - if (strncmp (sec_name, DOT_DEBUG, sizeof (DOT_DEBUG) - 1) == 0 - || strncmp (sec_name, GNU_LINKONCE_WI, sizeof (GNU_LINKONCE_WI) - 1) == 0) + if (CONST_STRNEQ (sec_name, DOT_DEBUG) + || CONST_STRNEQ (sec_name, GNU_LINKONCE_WI)) sec_flags = SEC_DEBUGGING; /* skip LOAD */ @@ -674,14 +674,14 @@ styp_to_sec_flags (bfd *abfd ATTRIBUTE_UNUSED, #endif sec_flags |= SEC_ALLOC; } - else if (strncmp (name, DOT_DEBUG, sizeof (DOT_DEBUG) - 1) == 0 + else if (CONST_STRNEQ (name, DOT_DEBUG) #ifdef _COMMENT || strcmp (name, _COMMENT) == 0 #endif #ifdef COFF_LONG_SECTION_NAMES - || strncmp (name, GNU_LINKONCE_WI, sizeof (GNU_LINKONCE_WI) - 1) == 0 + || CONST_STRNEQ (name, GNU_LINKONCE_WI) #endif - || strncmp (name, ".stab", 5) == 0) + || CONST_STRNEQ (name, ".stab")) { #ifdef COFF_PAGE_SIZE sec_flags |= SEC_DEBUGGING; @@ -715,7 +715,7 @@ styp_to_sec_flags (bfd *abfd ATTRIBUTE_UNUSED, The symbols will be defined as weak, so that multiple definitions are permitted. The GNU linker extension is to actually discard all but one of the sections. */ - if (strncmp (name, ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) == 0) + if (CONST_STRNEQ (name, ".gnu.linkonce")) sec_flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD; #endif @@ -1071,7 +1071,7 @@ styp_to_sec_flags (bfd *abfd, /* The MS PE spec sets the DISCARDABLE flag on .reloc sections but we do not want them to be labelled as debug section, since then strip would remove them. */ - if (strncmp (name, ".reloc", sizeof ".reloc" - 1) != 0) + if (! CONST_STRNEQ (name, ".reloc")) sec_flags |= SEC_DEBUGGING; break; case IMAGE_SCN_MEM_SHARED: @@ -1126,7 +1126,7 @@ styp_to_sec_flags (bfd *abfd, The symbols will be defined as weak, so that multiple definitions are permitted. The GNU linker extension is to actually discard all but one of the sections. */ - if (strncmp (name, ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) == 0) + if (CONST_STRNEQ (name, ".gnu.linkonce")) sec_flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD; #endif @@ -1546,6 +1546,9 @@ static const unsigned int coff_section_alignment_table_size = static bfd_boolean coff_new_section_hook (bfd * abfd, asection * section) { + combined_entry_type *native; + bfd_size_type amt; + section->alignment_power = COFF_DEFAULT_SECTION_ALIGNMENT_POWER; #ifdef RS6000COFF_C @@ -1557,34 +1560,31 @@ coff_new_section_hook (bfd * abfd, asection * section) section->alignment_power = bfd_xcoff_data_align_power (abfd); #endif - /* PR binutils/2724: Only real sections have a symbol that - has the coff_symbol_type structure allocated for it. */ - if (! bfd_is_const_section (section)) - { - combined_entry_type *native; - bfd_size_type amt; + /* Set up the section symbol. */ + if (!_bfd_generic_new_section_hook (abfd, section)) + return FALSE; - /* Allocate aux records for section symbols, to store size and - related info. + /* Allocate aux records for section symbols, to store size and + related info. - @@ The 10 is a guess at a plausible maximum number of aux entries - (but shouldn't be a constant). */ - amt = sizeof (combined_entry_type) * 10; - native = bfd_zalloc (abfd, amt); - if (native == NULL) - return FALSE; + @@ The 10 is a guess at a plausible maximum number of aux entries + (but shouldn't be a constant). */ + amt = sizeof (combined_entry_type) * 10; + native = bfd_zalloc (abfd, amt); + if (native == NULL) + return FALSE; - /* We don't need to set up n_name, n_value, or n_scnum in the native - symbol information, since they'll be overridden by the BFD symbol - anyhow. However, we do need to set the type and storage class, - in case this symbol winds up getting written out. The value 0 - for n_numaux is already correct. */ - native->u.syment.n_type = T_NULL; - native->u.syment.n_sclass = C_STAT; + /* We don't need to set up n_name, n_value, or n_scnum in the native + symbol information, since they'll be overridden by the BFD symbol + anyhow. However, we do need to set the type and storage class, + in case this symbol winds up getting written out. The value 0 + for n_numaux is already correct. */ + + native->u.syment.n_type = T_NULL; + native->u.syment.n_sclass = C_STAT; + + coffsymbol (section->symbol)->native = native; - coffsymbol (section->symbol)->native = native; - } - coff_set_custom_section_alignment (abfd, section, coff_section_alignment_table, coff_section_alignment_table_size); @@ -1882,11 +1882,17 @@ coff_set_arch_mach_hook (bfd *abfd, void * filehdr) #ifdef I386MAGIC case I386MAGIC: case I386PTXMAGIC: - case I386AIXMAGIC: /* Danbury PS/2 AIX C Compiler */ - case LYNXCOFFMAGIC: /* shadows the m68k Lynx number below, sigh */ + case I386AIXMAGIC: /* Danbury PS/2 AIX C Compiler. */ + case LYNXCOFFMAGIC: /* Shadows the m68k Lynx number below, sigh. */ arch = bfd_arch_i386; break; #endif +#ifdef AMD64MAGIC + case AMD64MAGIC: + arch = bfd_arch_i386; + machine = bfd_mach_x86_64; + break; +#endif #ifdef IA64MAGIC case IA64MAGIC: arch = bfd_arch_ia64; @@ -2532,11 +2538,15 @@ coff_write_relocs (bfd * abfd, int first_undef) else { n.r_symndx = get_index ((*(q->sym_ptr_ptr))); - /* Take notice if the symbol reloc points to a symbol - we don't have in our symbol table. What should we - do for this?? */ + /* Check to see if the symbol reloc points to a symbol + we don't have in our symbol table. */ if (n.r_symndx > obj_conv_table_size (abfd)) - abort (); + { + bfd_set_error (bfd_error_bad_value); + _bfd_error_handler (_("%B: reloc against a non-existant symbol index: %ld"), + abfd, n.r_symndx); + return FALSE; + } } } @@ -2717,12 +2727,17 @@ coff_set_flags (bfd * abfd, return TRUE; #endif -#ifdef I386MAGIC +#if defined(I386MAGIC) || defined(AMD64MAGIC) case bfd_arch_i386: +#if defined(I386MAGIC) *magicp = I386MAGIC; -#ifdef LYNXOS +#endif +#if defined LYNXOS /* Just overwrite the usual value if we're doing Lynx. */ *magicp = LYNXCOFFMAGIC; +#endif +#if defined AMD64MAGIC + *magicp = AMD64MAGIC; #endif return TRUE; #endif @@ -3755,6 +3770,7 @@ coff_write_object_contents (bfd * abfd) internal_f.f_flags |= IMAGE_FILE_LARGE_ADDRESS_AWARE; #endif +#ifndef COFF_WITH_pex64 #ifdef COFF_WITH_PE internal_f.f_flags |= IMAGE_FILE_32BIT_MACHINE; #else @@ -3763,6 +3779,7 @@ coff_write_object_contents (bfd * abfd) else internal_f.f_flags |= F_AR32W; #endif +#endif #ifdef TI_TARGET_ID /* Target id is used in TI COFF v1 and later; COFF0 won't use this field, @@ -3856,16 +3873,18 @@ coff_write_object_contents (bfd * abfd) #if defined(I386) #define __A_MAGIC_SET__ -#if defined(LYNXOS) +#if defined LYNXOS internal_a.magic = LYNXCOFFMAGIC; -#else /* LYNXOS */ +#elif defined AMD64 + internal_a.magic = IMAGE_NT_OPTIONAL_HDR64_MAGIC; +#else internal_a.magic = ZMAGIC; -#endif /* LYNXOS */ +#endif #endif /* I386 */ #if defined(IA64) #define __A_MAGIC_SET__ - internal_a.magic = ZMAGIC; + internal_a.magic = PE32PMAGIC; #endif /* IA64 */ #if defined(SPARC) @@ -4851,6 +4870,7 @@ coff_slurp_reloc_table (bfd * abfd, sec_ptr asect, asymbol ** symbols) cache_ptr = reloc_cache + idx; src = native_relocs + idx; + dst.r_offset = 0; coff_swap_reloc_in (abfd, src, &dst); #ifdef RELOC_PROCESSING @@ -4931,6 +4951,7 @@ coff_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED, { arelent genrel; + genrel.howto = NULL; RTYPE2HOWTO (&genrel, rel); return genrel.howto; } @@ -5314,6 +5335,9 @@ static const bfd_coff_backend_data ticoff1_swap_table = #ifndef coff_bfd_reloc_type_lookup #define coff_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup #endif +#ifndef coff_bfd_reloc_name_lookup +#define coff_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup +#endif #ifndef coff_bfd_get_relocated_section_contents #define coff_bfd_get_relocated_section_contents \ diff --git a/bfd/coffgen.c b/bfd/coffgen.c index c541e6a590e..8884a7f14db 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -1,6 +1,6 @@ /* Support for the generic parts of COFF, for BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 + 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -37,8 +37,8 @@ Those functions may not use any COFF specific information, such as coff_data (abfd). */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/internal.h" #include "libcoff.h" @@ -1901,7 +1901,16 @@ coff_print_symbol (bfd *abfd, combined->u.syment.n_type, combined->u.syment.n_sclass, combined->u.syment.n_numaux); - fprintf_vma (file, val); +#ifdef BFD64 + /* fprintf_vma() on a 64-bit enabled host will always print a 64-bit + value, but really we want to display the address in the target's + address size. Since we do not have a field in the bfd structure + to tell us this, we take a guess, based on the target's name. */ + if (strstr (bfd_get_target (abfd), "64") == NULL) + fprintf (file, "%08lx", (unsigned long) (val & 0xffffffff)); + else +#endif + fprintf_vma (file, val); fprintf (file, " %s", symbol->name); for (aux = 0; aux < combined->u.syment.n_numaux; aux++) @@ -2238,11 +2247,11 @@ coff_find_inliner_info (bfd *abfd, } int -coff_sizeof_headers (bfd *abfd, bfd_boolean reloc) +coff_sizeof_headers (bfd *abfd, struct bfd_link_info *info) { size_t size; - if (! reloc) + if (!info->relocatable) size = bfd_coff_filhsz (abfd) + bfd_coff_aoutsz (abfd); else size = bfd_coff_filhsz (abfd); diff --git a/bfd/cofflink.c b/bfd/cofflink.c index a1f6684bb61..1ed7107fc1d 100644 --- a/bfd/cofflink.c +++ b/bfd/cofflink.c @@ -1,6 +1,6 @@ /* COFF specific linker code. Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -21,8 +21,8 @@ /* This file contains the COFF backend linker code. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "coff/internal.h" @@ -232,7 +232,7 @@ coff_link_check_ar_symbols (bfd *abfd, /* Auto import. */ if (!h && info->pei386_auto_import - && !strncmp (name,"__imp_", 6)) + && CONST_STRNEQ (name, "__imp_")) h = bfd_link_hash_lookup (info->hash, name + 6, FALSE, FALSE, TRUE); /* We are only interested in symbols that are currently @@ -439,7 +439,7 @@ coff_link_add_symbols (bfd *abfd, || classification == COFF_SYMBOL_PE_SECTION) && coff_section_data (abfd, section) != NULL && coff_section_data (abfd, section)->comdat != NULL - && strncmp (name, "??_", 3) == 0 + && CONST_STRNEQ (name, "??_") && strcmp (name, coff_section_data (abfd, section)->comdat->name) == 0) { if (*sym_hash == NULL) @@ -583,7 +583,7 @@ coff_link_add_symbols (bfd *abfd, asection *stab; for (stab = abfd->sections; stab; stab = stab->next) - if (strncmp (".stab", stab->name, 5) == 0 + if (CONST_STRNEQ (stab->name, ".stab") && (!stab->name[5] || (stab->name[5] == '.' && ISDIGIT (stab->name[6])))) { @@ -1232,16 +1232,14 @@ process_embedded_commands (bfd *output_bfd, s++; continue; } - if (strncmp (s, "-attr", 5) == 0) + if (CONST_STRNEQ (s, "-attr")) { char *name; char *attribs; asection *asec; int loop = 1; int had_write = 0; - int had_read = 0; int had_exec= 0; - int had_shared= 0; s += 5; s = get_name (s, &name); @@ -1255,10 +1253,8 @@ process_embedded_commands (bfd *output_bfd, had_write = 1; break; case 'R': - had_read = 1; break; case 'S': - had_shared = 1; break; case 'X': had_exec = 1; @@ -1276,11 +1272,11 @@ process_embedded_commands (bfd *output_bfd, asec->flags |= SEC_READONLY; } } - else if (strncmp (s,"-heap", 5) == 0) - s = dores_com (s+5, output_bfd, 1); + else if (CONST_STRNEQ (s, "-heap")) + s = dores_com (s + 5, output_bfd, 1); - else if (strncmp (s,"-stack", 6) == 0) - s = dores_com (s+6, output_bfd, 0); + else if (CONST_STRNEQ (s, "-stack")) + s = dores_com (s + 6, output_bfd, 0); else s++; @@ -1925,6 +1921,7 @@ _bfd_coff_link_input_bfd (struct coff_final_link_info *finfo, bfd *input_bfd) generate two symbols with the same name, but only one will have aux entries. */ BFD_ASSERT (isymp->n_numaux == 0 + || h->numaux == 0 || h->numaux == isymp->n_numaux); } @@ -1940,7 +1937,7 @@ _bfd_coff_link_input_bfd (struct coff_final_link_info *finfo, bfd *input_bfd) union internal_auxent aux; union internal_auxent *auxp; - if (h != NULL) + if (h != NULL && h->aux != NULL && (h->numaux > i)) auxp = h->aux + i; else { diff --git a/bfd/config.bfd b/bfd/config.bfd index 4fd72c1c152..10b0b948157 100755 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -31,12 +31,7 @@ targ_underscore=no # Catch obsolete configurations. case $targ in - m68*-apple-aux* | \ - m68*-apollo-* | \ - m68*-bull-sysv* | \ - m68*-*-rtemscoff* | \ - i960-*-rtems* | \ - or32-*-rtems* | \ + maxq-*-coff | \ null) if test "x$enable_obsolete" != xyes; then echo "*** Configuration $targ is obsolete." >&2 @@ -48,6 +43,12 @@ case $targ in esac case $targ in + m68*-apple-aux* | \ + m68*-apollo-* | \ + m68*-bull-sysv* | \ + m68*-*-rtemscoff* | \ + i960-*-rtems* | \ + or32-*-rtems* | \ m68*-*-lynxos* | \ sparc-*-lynxos* | \ vax-*-vms* | \ @@ -75,9 +76,11 @@ bfin*) targ_archs=bfd_bfin_arch ;; c30*) targ_archs=bfd_tic30_arch ;; c4x*) targ_archs=bfd_tic4x_arch ;; c54x*) targ_archs=bfd_tic54x_arch ;; +cr16*) targ_archs=bfd_cr16_arch ;; crisv32) targ_archs=bfd_cris_arch ;; crx*) targ_archs=bfd_crx_arch ;; dlx*) targ_archs=bfd_dlx_arch ;; +fido*) targ_archs=bfd_m68k_arch ;; hppa*) targ_archs=bfd_hppa_arch ;; i[3-7]86) targ_archs=bfd_i386_arch ;; i370) targ_archs=bfd_i370_arch ;; @@ -95,10 +98,11 @@ rs6000) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;; s390*) targ_archs=bfd_s390_arch ;; sh*) targ_archs=bfd_sh_arch ;; sparc*) targ_archs=bfd_sparc_arch ;; +spu*) targ_archs=bfd_spu_arch ;; strongarm*) targ_archs=bfd_arm_arch ;; thumb*) targ_archs=bfd_arm_arch ;; v850*) targ_archs=bfd_v850_arch ;; -x86_64) targ_archs=bfd_i386_arch ;; +x86_64*) targ_archs=bfd_i386_arch ;; xscale*) targ_archs=bfd_arm_arch ;; xtensa*) targ_archs=bfd_xtensa_arch ;; z80|r800) targ_archs=bfd_z80_arch ;; @@ -137,6 +141,7 @@ case "${targ}" in alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) targ_defvec=bfd_elf64_alpha_freebsd_vec targ_selvecs=ecoffalpha_little_vec + want64=true # FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling. case "${targ}" in alpha*-*-freebsd3* | alpha*-*-freebsd4 | alpha*-*-freebsd4.0*) @@ -146,36 +151,49 @@ case "${targ}" in alpha*-*-netbsd* | alpha*-*-openbsd*) targ_defvec=bfd_elf64_alpha_vec targ_selvecs=ecoffalpha_little_vec + want64=true ;; alpha*-*-netware*) targ_defvec=ecoffalpha_little_vec targ_selvecs=nlm32_alpha_vec + want64=true ;; alpha*-*-linuxecoff*) targ_defvec=ecoffalpha_little_vec targ_selvecs=bfd_elf64_alpha_vec + want64=true ;; alpha*-*-linux-* | alpha*-*-elf*) targ_defvec=bfd_elf64_alpha_vec targ_selvecs=ecoffalpha_little_vec + want64=true ;; alpha*-*-*vms*) targ_defvec=vms_alpha_vec + want64=true ;; alpha*-*-*) targ_defvec=ecoffalpha_little_vec + want64=true ;; ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu) targ_defvec=bfd_elf64_ia64_little_vec targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec" + want64=true ;; ia64*-*-hpux*) targ_defvec=bfd_elf32_ia64_hpux_big_vec targ_selvecs="bfd_elf64_ia64_hpux_big_vec" + want64=true ;; - sparc64-*-freebsd* | sparc64-*-netbsd* | sparc64-*-openbsd* | sparc64-*-kfreebsd*-gnu) + sparc64-*-freebsd* | sparc64-*-kfreebsd*-gnu) + targ_defvec=bfd_elf64_sparc_freebsd_vec + targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec" + ;; + sparc64-*-netbsd* | sparc64-*-openbsd*) targ_defvec=bfd_elf64_sparc_vec targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec" + want64=true ;; #endif /* BFD64 */ @@ -215,8 +233,8 @@ case "${targ}" in targ_cflags=-DARM_COFF_BUGFIX ;; arm-wince-pe | arm-*-wince) - targ_defvec=armpe_little_vec - targ_selvecs="armpe_little_vec armpe_big_vec armpei_little_vec armpei_big_vec" + targ_defvec=arm_wince_pe_little_vec + targ_selvecs="arm_wince_pe_little_vec arm_wince_pe_big_vec arm_wince_pei_little_vec arm_wince_pei_big_vec" targ_underscore=no targ_cflags="-DARM_WINCE -DARM_COFF_BUGFIX" ;; @@ -336,6 +354,11 @@ case "${targ}" in targ_underscore=yes ;; + cr16-*-elf*) + targ_defvec=bfd_elf32_cr16_vec + targ_underscore=yes + ;; + cr16c-*-elf*) targ_defvec=bfd_elf32_cr16c_vec targ_underscore=yes @@ -365,6 +388,11 @@ case "${targ}" in targ_defvec=bfd_elf32_d30v_vec ;; + fido-*-elf* ) + targ_defvec=bfd_elf32_m68k_vec + targ_selvecs="m68kcoff_vec ieee_vec" + ;; + fr30-*-elf) targ_defvec=bfd_elf32_fr30_vec ;; @@ -403,11 +431,13 @@ case "${targ}" in hppa*64*-*-linux-*) targ_defvec=bfd_elf64_hppa_linux_vec targ_selvecs=bfd_elf64_hppa_vec + want64=true ;; hppa*64*-*-hpux11*) targ_defvec=bfd_elf64_hppa_vec targ_selvecs=bfd_elf64_hppa_linux_vec targ_cflags=-DHPUX_LARGE_AR_IDS + want64=true ;; #endif @@ -549,18 +579,28 @@ case "${targ}" in x86_64-*-elf*) targ_defvec=bfd_elf64_x86_64_vec targ_selvecs="bfd_elf32_i386_vec i386coff_vec" + want64=true ;; x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) - targ_defvec=bfd_elf64_x86_64_vec - targ_selvecs="bfd_elf32_i386_vec i386coff_vec bfd_efi_app_ia32_vec" + targ_defvec=bfd_elf64_x86_64_freebsd_vec + targ_selvecs="bfd_elf32_i386_freebsd_vec i386coff_vec bfd_efi_app_ia32_vec bfd_efi_app_x86_64_vec bfd_elf32_i386_vec bfd_elf64_x86_64_vec" + want64=true ;; x86_64-*-netbsd* | x86_64-*-openbsd*) targ_defvec=bfd_elf64_x86_64_vec - targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec" + targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec bfd_efi_app_x86_64_vec" + want64=true ;; x86_64-*-linux-*) targ_defvec=bfd_elf64_x86_64_vec - targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec" + targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec bfd_efi_app_x86_64_vec" + want64=true + ;; + x86_64-*-mingw*) + targ_defvec=x86_64pe_vec + targ_selvecs="x86_64pe_vec x86_64pei_vec x86_64coff_vec bfd_elf64_x86_64_vec" + want64=true + targ_underscore=yes ;; #endif i[3-7]86-*-lynxos*) @@ -640,7 +680,7 @@ case "${targ}" in targ_selvecs="b_out_vec_big_host icoff_little_vec icoff_big_vec ieee_vec" targ_underscore=yes ;; - i960-*-vxworks5.* | i960-*-coff* | i960-*-sysv* | i960-*-rtems*) + i960-*-vxworks5.* | i960-*-coff* | i960-*-sysv*) targ_defvec=icoff_little_vec targ_selvecs="icoff_big_vec b_out_vec_little_host b_out_vec_big_host ieee_vec" targ_underscore=yes @@ -671,17 +711,14 @@ case "${targ}" in targ_defvec=bfd_elf32_m32rlelin_vec targ_selvecs="bfd_elf32_m32rlin_vec bfd_elf32_m32rlelin_vec" ;; - m32r*-*-linux*) targ_defvec=bfd_elf32_m32rlin_vec targ_selvecs="bfd_elf32_m32rlin_vec bfd_elf32_m32rlelin_vec" ;; - m32r*le-*-*) targ_defvec=bfd_elf32_m32rle_vec targ_selvecs="bfd_elf32_m32r_vec bfd_elf32_m32rle_vec" ;; - m32r-*-*) targ_defvec=bfd_elf32_m32r_vec ;; @@ -695,13 +732,6 @@ case "${targ}" in targ_selvecs="bfd_elf32_m68hc11_vec bfd_elf32_m68hc12_vec" ;; - m68*-apollo-*) - targ_defvec=apollocoff_vec - ;; - m68*-bull-sysv*) - targ_defvec=m68kcoffun_vec - targ_underscore=yes - ;; m68*-motorola-sysv*) targ_defvec=m68ksysvcoff_vec ;; @@ -717,10 +747,6 @@ case "${targ}" in targ_selvecs="cisco_core_big_vec ieee_vec" targ_underscore=yes ;; - m68*-*-rtemscoff*) - targ_defvec=m68kcoff_vec - targ_selvecs="m68kcoff_vec versados_vec ieee_vec aout0_big_vec" - ;; m68*-*-elf* | m68*-*-sysv4* | m68*-*-uclinux*) targ_defvec=bfd_elf32_m68k_vec targ_selvecs="m68kcoff_vec ieee_vec" @@ -784,9 +810,6 @@ case "${targ}" in targ_defvec=bfd_elf32_m68k_vec targ_selvecs=m68kcoff_vec ;; - m68*-apple-aux*) - targ_defvec=m68kaux_coff_vec - ;; m68*-*-psos*) targ_defvec=bfd_elf32_m68k_vec targ_selvecs=ieee_vec @@ -823,6 +846,11 @@ case "${targ}" in targ_selvecs="mcore_pe_big_vec mcore_pe_little_vec mcore_pei_big_vec mcore_pei_little_vec" ;; + mep-*-elf) + targ_defvec=bfd_elf32_mep_vec + targ_selvecs=bfd_elf32_mep_little_vec + ;; + mips*-big-*) targ_defvec=ecoff_big_vec targ_selvecs=ecoff_little_vec @@ -847,6 +875,7 @@ case "${targ}" in mips*-*-irix6*) targ_defvec=bfd_elf32_nbigmips_vec targ_selvecs="bfd_elf32_nlittlemips_vec bfd_elf32_bigmips_vec bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec" + want64=true ;; #endif mips*-*-irix5*) @@ -873,12 +902,24 @@ case "${targ}" in mips*el-*-vxworks*) targ_defvec=bfd_elf32_littlemips_vxworks_vec targ_selvecs="bfd_elf32_littlemips_vec bfd_elf32_bigmips_vxworks_vec bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec" + want64=true ;; mips*-*-vxworks*) targ_defvec=bfd_elf32_bigmips_vxworks_vec targ_selvecs="bfd_elf32_bigmips_vec bfd_elf32_littlemips_vxworks_vec bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec" + want64=true ;; #endif + mips*el-sde-elf*) + targ_defvec=bfd_elf32_tradlittlemips_vec + targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec" + want64=true + ;; + mips*-sde-elf*) + targ_defvec=bfd_elf32_tradbigmips_vec + targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec" + want64=true + ;; mips*el-*-elf* | mips*el-*-vxworks* | mips*-*-chorus*) targ_defvec=bfd_elf32_littlemips_vec targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec" @@ -895,6 +936,7 @@ case "${targ}" in mips64*-*-openbsd*) targ_defvec=bfd_elf64_tradbigmips_vec targ_selvecs="bfd_elf32_ntradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec" + want64=true ;; #endif mips*el-*-openbsd*) @@ -909,10 +951,12 @@ case "${targ}" in mips64*el-*-linux*) targ_defvec=bfd_elf32_ntradlittlemips_vec targ_selvecs="bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec" + want64=true ;; mips64*-*-linux*) targ_defvec=bfd_elf32_ntradbigmips_vec targ_selvecs="bfd_elf32_ntradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec" + want64=true ;; #endif mips*el-*-linux*) @@ -929,6 +973,7 @@ case "${targ}" in mmix-*-*) targ_defvec=bfd_elf64_mmix_vec targ_selvecs=bfd_mmo_vec + want64=true ;; #endif mn10200-*-*) @@ -961,7 +1006,7 @@ case "${targ}" in targ_defvec=bfd_elf32_openrisc_vec ;; - or32-*-coff | or32-*-rtems* ) + or32-*-coff) targ_defvec=or32coff_big_vec targ_underscore=yes ;; @@ -1026,15 +1071,18 @@ case "${targ}" in powerpc64-*-aix*) targ_defvec=rs6000coff64_vec targ_selvecs=rs6000coff_vec + want64=true ;; powerpc64-*-elf* | powerpc-*-elf64* | powerpc64-*-linux* | \ powerpc64-*-*bsd*) targ_defvec=bfd_elf64_powerpc_vec targ_selvecs="bfd_elf64_powerpcle_vec bfd_elf32_powerpc_vec bfd_elf32_powerpcle_vec rs6000coff_vec rs6000coff64_vec" + want64=true ;; powerpc64le-*-elf* | powerpcle-*-elf64*) targ_defvec=bfd_elf64_powerpcle_vec targ_selvecs="bfd_elf64_powerpc_vec bfd_elf32_powerpcle_vec bfd_elf32_powerpc_vec rs6000coff_vec rs6000coff64_vec" + want64=true ;; #endif powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \ @@ -1099,40 +1147,49 @@ case "${targ}" in s390x-*-linux*) targ_defvec=bfd_elf64_s390_vec targ_selvecs=bfd_elf32_s390_vec + want64=true ;; s390x-*-tpf*) targ_defvec=bfd_elf64_s390_vec + want64=true ;; #endif + score*-*-elf*) + targ_defvec=bfd_elf32_bigscore_vec + targ_selvecs=bfd_elf32_littlescore_vec + ;; + #ifdef BFD64 sh64l*-*-elf*) targ_defvec=bfd_elf32_sh64l_vec targ_selvecs="bfd_elf32_sh64_vec bfd_elf64_sh64l_vec bfd_elf64_sh64_vec bfd_elf32_shl_vec bfd_elf32_sh_vec" targ_underscore=yes + want64=true ;; sh64-*-elf*) targ_defvec=bfd_elf32_sh64_vec targ_selvecs="bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec bfd_elf32_sh_vec bfd_elf32_shl_vec" targ_underscore=yes + want64=true ;; sh64eb-*-linux*) targ_defvec=bfd_elf32_sh64blin_vec targ_selvecs="bfd_elf32_sh64lin_vec bfd_elf64_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf32_shblin_vec bfd_elf32_shlin_vec" + want64=true ;; sh64-*-linux*) targ_defvec=bfd_elf32_sh64lin_vec targ_selvecs="bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec bfd_elf32_shlin_vec bfd_elf32_shblin_vec" + want64=true + ;; + sh-*-linux*) + targ_defvec=bfd_elf32_shblin_vec + targ_selvecs="bfd_elf32_shlin_vec bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec" + want64=true ;; #endif /* BFD64 */ - sh-*-linux*) - targ_defvec=bfd_elf32_shblin_vec - targ_selvecs=bfd_elf32_shlin_vec -#ifdef BFD64 - targ_selvecs="${targ_selvecs} bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec" -#endif - ;; sh*eb-*-linux*) targ_defvec=bfd_elf32_shblin_vec targ_selvecs=bfd_elf32_shlin_vec @@ -1142,40 +1199,49 @@ case "${targ}" in targ_selvecs=bfd_elf32_shblin_vec ;; + sh-*-uclinux* | sh[12]-*-uclinux*) + targ_defvec=bfd_elf32_sh_vec + targ_selvecs="bfd_elf32_shblin_vec bfd_elf32_shlin_vec" +#ifdef BFD64 + targ_selvecs="${targ_selvecs} bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec" +#endif + ;; + #ifdef BFD64 sh5le-*-netbsd*) targ_defvec=bfd_elf32_sh64lnbsd_vec targ_selvecs="bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec bfd_elf32_shnbsd_vec bfd_elf32_shlnbsd_vec" + want64=true ;; sh5-*-netbsd*) targ_defvec=bfd_elf32_sh64nbsd_vec targ_selvecs="bfd_elf32_sh64lnbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec bfd_elf32_shnbsd_vec bfd_elf32_shlnbsd_vec" + want64=true ;; sh64le-*-netbsd*) targ_defvec=bfd_elf64_sh64lnbsd_vec targ_selvecs="bfd_elf64_sh64nbsd_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf32_shnbsd_vec bfd_elf32_shlnbsd_vec" + want64=true ;; sh64-*-netbsd*) targ_defvec=bfd_elf64_sh64nbsd_vec targ_selvecs="bfd_elf64_sh64lnbsd_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf32_shnbsd_vec bfd_elf32_shlnbsd_vec" + want64=true ;; -#endif sh*l*-*-netbsdelf*) targ_defvec=bfd_elf32_shlnbsd_vec - targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec" -#ifdef BFD64 - targ_selvecs="${targ_selvecs} bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec" -#endif + targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec" + want64=true ;; sh-*-netbsdelf*) targ_defvec=bfd_elf32_shnbsd_vec - targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec" -#ifdef BFD64 - targ_selvecs="${targ_selvecs} bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec" -#endif + targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec" + want64=true ;; +#endif + sh*-*-netbsdelf*) targ_defvec=bfd_elf32_shnbsd_vec targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec" @@ -1185,40 +1251,48 @@ case "${targ}" in targ_selvecs="shlcoff_vec shlcoff_small_vec" targ_underscore=yes ;; + +#ifdef BFD64 shl*-*-elf* | sh[1234]l*-*-elf* | sh3el*-*-elf* | shl*-*-kaos*) targ_defvec=bfd_elf32_shl_vec - targ_selvecs="bfd_elf32_sh_vec shlcoff_vec shcoff_vec shlcoff_small_vec shcoff_small_vec" -#ifdef BFD64 - targ_selvecs="${targ_selvecs} bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec" -#endif + targ_selvecs="bfd_elf32_sh_vec shlcoff_vec shcoff_vec shlcoff_small_vec shcoff_small_vec bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec" targ_underscore=yes + want64=true ;; +#endif + sh-*-rtemscoff*) targ_defvec=shcoff_vec targ_selvecs="shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec" targ_underscore=yes ;; + +#ifdef BFD64 sh-*-elf* | sh[1234]*-elf* | sh-*-rtems* | sh-*-kaos*) targ_defvec=bfd_elf32_sh_vec - targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec" -#ifdef BFD64 - targ_selvecs="${targ_selvecs} bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec" -#endif + targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec" targ_underscore=yes + want64=true ;; +#endif + sh-*-nto*) targ_defvec=bfd_elf32_sh_vec targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec" targ_underscore=yes ;; + sh*-*-openbsd*) + targ_defvec=bfd_elf32_shlnbsd_vec + targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec" + ;; sh-*-pe) targ_defvec=shlpe_vec targ_selvecs="shlpe_vec shlpei_vec" targ_underscore=yes ;; sh-*-vxworks) - targ_defvec=bfd_elf32_sh_vec - targ_selvecs="bfd_elf32_shl_vec" + targ_defvec=bfd_elf32_shvxworks_vec + targ_selvecs="bfd_elf32_shlvxworks_vec" # FIXME None of the following are actually used on this target, but # they're necessary for coff-sh.c (which is unconditionally used) to be # compiled correctly. @@ -1279,6 +1353,7 @@ case "${targ}" in sparc-*-solaris2* | sparcv9-*-solaris2* | sparc64-*-solaris2*) targ_defvec=bfd_elf32_sparc_vec targ_selvecs="bfd_elf64_sparc_vec sunos_big_vec" + want64=true ;; #endif sparc-*-sysv4*) @@ -1296,14 +1371,17 @@ case "${targ}" in sparc64-*-aout*) targ_defvec=sunos_big_vec targ_underscore=yes + want64=true ;; sparc64-*-linux-*) targ_defvec=bfd_elf64_sparc_vec targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec" + want64=true ;; sparc64-*-elf*) targ_defvec=bfd_elf64_sparc_vec targ_selvecs=bfd_elf32_sparc_vec + want64=true ;; #endif /* BFD64 */ sparc*-*-coff*) @@ -1318,6 +1396,10 @@ case "${targ}" in targ_underscore=yes ;; + spu-*-elf) + targ_defvec=bfd_elf32_spu_vec + ;; + #if HAVE_host_aout_vec tahoe-*-*) targ_defvec=host_aout_vec diff --git a/bfd/config.in b/bfd/config.in index 6c738257d98..aa91dd69888 100644 --- a/bfd/config.in +++ b/bfd/config.in @@ -1,29 +1,9 @@ /* config.in. Generated from configure.in by autoheader. */ -/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP - systems. This function is required for `alloca.c' support on those systems. - */ -#undef CRAY_STACKSEG_END - -/* Define to 1 if using `alloca.c'. */ -#undef C_ALLOCA - -/* Define to 1 if NLS is requested */ +/* Define to 1 if translation of program messages to the user's native + language is requested. */ #undef ENABLE_NLS -/* Define to 1 if you have `alloca', as a function or macro. */ -#undef HAVE_ALLOCA - -/* Define to 1 if you have and it should be used (not on Ultrix). - */ -#undef HAVE_ALLOCA_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ARGZ_H - -/* Define to 1 if you have the `dcgettext' function. */ -#undef HAVE_DCGETTEXT - /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #undef HAVE_DECL_BASENAME @@ -83,6 +63,9 @@ */ #undef HAVE_DIRENT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + /* Define to 1 if you have the `fcntl' function. */ #undef HAVE_FCNTL @@ -107,33 +90,18 @@ /* Define to 1 if you have the `ftello64' function. */ #undef HAVE_FTELLO64 -/* Define to 1 if you have the `getcwd' function. */ -#undef HAVE_GETCWD - /* Define to 1 if you have the `getgid' function. */ #undef HAVE_GETGID /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE -/* Define as 1 if you have gettext and don't want to use GNU gettext. */ -#undef HAVE_GETTEXT - /* Define to 1 if you have the `getuid' function. */ #undef HAVE_GETUID /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define if your locale.h file contains LC_MESSAGES. */ -#undef HAVE_LC_MESSAGES - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LOCALE_H - /* Define if has lwpstatus_t. */ #undef HAVE_LWPSTATUS_T @@ -149,9 +117,6 @@ /* Define to 1 if you have the `madvise' function. */ #undef HAVE_MADVISE -/* Define to 1 if you have the header file. */ -#undef HAVE_MALLOC_H - /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H @@ -161,15 +126,9 @@ /* Define to 1 if you have the `mprotect' function. */ #undef HAVE_MPROTECT -/* Define to 1 if you have the `munmap' function. */ -#undef HAVE_MUNMAP - /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H -/* Define to 1 if you have the header file. */ -#undef HAVE_NL_TYPES_H - /* Define if has prpsinfo32_t. */ #undef HAVE_PRPSINFO32_T @@ -200,21 +159,12 @@ /* Define if has pstatus_t. */ #undef HAVE_PSTATUS_T -/* Define to 1 if you have the `putenv' function. */ -#undef HAVE_PUTENV - /* Define if has pxstatus_t. */ #undef HAVE_PXSTATUS_T -/* Define to 1 if you have the `setenv' function. */ -#undef HAVE_SETENV - /* Define to 1 if you have the `setitimer' function. */ #undef HAVE_SETITIMER -/* Define to 1 if you have the `setlocale' function. */ -#undef HAVE_SETLOCALE - /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H @@ -224,15 +174,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H -/* Define if you have the stpcpy function */ -#undef HAVE_STPCPY - -/* Define to 1 if you have the `strcasecmp' function. */ -#undef HAVE_STRCASECMP - -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR - /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H @@ -259,9 +200,6 @@ */ #undef HAVE_SYS_NDIR_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PARAM_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PROCFS_H @@ -280,20 +218,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H -/* Define to 1 if you have the header file. */ -#undef HAVE_VALUES_H - /* Define if has win32_pstatus_t. */ #undef HAVE_WIN32_PSTATUS_T -/* Define to 1 if you have the `__argz_count' function. */ -#undef HAVE___ARGZ_COUNT - -/* Define to 1 if you have the `__argz_next' function. */ -#undef HAVE___ARGZ_NEXT - -/* Define to 1 if you have the `__argz_stringify' function. */ -#undef HAVE___ARGZ_STRINGIFY +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR /* Name of package */ #undef PACKAGE @@ -313,6 +243,12 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION +/* The size of a `char', as computed by sizeof. */ +#undef SIZEOF_CHAR + +/* The size of a `int', as computed by sizeof. */ +#undef SIZEOF_INT + /* The size of a `long', as computed by sizeof. */ #undef SIZEOF_LONG @@ -322,13 +258,11 @@ /* The size of a `off_t', as computed by sizeof. */ #undef SIZEOF_OFF_T -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ -#undef STACK_DIRECTION +/* The size of a `short', as computed by sizeof. */ +#undef SIZEOF_SHORT + +/* The size of a `void *', as computed by sizeof. */ +#undef SIZEOF_VOID_P /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS @@ -358,18 +292,3 @@ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#undef inline -#endif - -/* Define to `long' if does not define. */ -#undef off_t - -/* Define to `unsigned' if does not define. */ -#undef size_t diff --git a/bfd/configure b/bfd/configure index af6c22b5a66..3cff895158f 100755 --- a/bfd/configure +++ b/bfd/configure @@ -241,6 +241,155 @@ IFS=" $as_nl" $as_unset CDPATH + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +$* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. @@ -309,7 +458,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE AR ac_ct_AR RANLIB ac_ct_RANLIB LN_S LIBTOOL WARN_CFLAGS NO_WERROR MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT INSTALL_LIBBFD_TRUE INSTALL_LIBBFD_FALSE host_noncanonical target_noncanonical bfdlibdir bfdincludedir CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l HDEFINES BFD_HOST_64BIT_LONG BFD_HOST_LONG_LONG BFD_HOST_64_BIT_DEFINED BFD_HOST_64_BIT BFD_HOST_U_64_BIT CC_FOR_BUILD EXEEXT_FOR_BUILD COREFILE COREFLAG WIN32LDFLAGS WIN32LIBADD TDEFINES wordsize bfd_libs all_backends bfd_backends bfd_machines bfd_default_target_size bfd_file_ptr bfd_ufile_ptr tdefaults datarootdir docdir htmldir LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE AR ac_ct_AR RANLIB ac_ct_RANLIB LIBTOOL SED EGREP FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S lt_ECHO CPP DEBUGDIR PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI WARN_CFLAGS NO_WERROR MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT GENINSRC_NEVER_TRUE GENINSRC_NEVER_FALSE INSTALL_LIBBFD_TRUE INSTALL_LIBBFD_FALSE host_noncanonical target_noncanonical bfdlibdir bfdincludedir USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT MKINSTALLDIRS MSGFMT MSGMERGE HDEFINES BFD_HOST_64BIT_LONG BFD_HOST_LONG_LONG BFD_HOST_64_BIT_DEFINED BFD_HOST_64_BIT BFD_HOST_U_64_BIT CC_FOR_BUILD EXEEXT_FOR_BUILD COREFILE COREFLAG WIN32LDFLAGS WIN32LIBADD TDEFINES wordsize bfd64_libs all_backends bfd_backends bfd_machines bfd_default_target_size bfd_file_ptr bfd_ufile_ptr tdefaults datarootdir docdir htmldir LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -852,16 +1001,19 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors - --enable-shared=PKGS build shared libraries default=no - --enable-static=PKGS build static libraries default=yes - --enable-fast-install=PKGS optimize for fast installation default=yes + --enable-shared[=PKGS] + build shared libraries [default=no] + --enable-static[=PKGS] + build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) --enable-targets alternative target configurations --enable-commonbfdlib build shared BFD/opcodes/libiberty library --enable-secureplt Default to creating read-only plt entries - --enable-werror treat compile warnings as errors - --enable-build-warnings Enable build-time compiler warnings + --enable-werror treat compile warnings as errors + --enable-build-warnings enable build-time compiler warnings --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-install-libbfd controls installation of libbfd and related headers @@ -870,10 +1022,16 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-gnu-ld assume the C compiler uses GNU ld default=no - --with-pic try to use only PIC/non-PIC objects default=use both + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-mmap try using mmap for BFD input files if available - --with-included-gettext use the GNU gettext library included here + --with-separate-debug-dir=DIR + Look for global separate debug info in DIR + [default=LIBDIR/debug] + --with-pkgversion=PKG Use PKG in the version string in place of "GNU + Binutils" + --with-bugurl=URL Direct users to URL to report a bug Some influential environment variables: CC C compiler command @@ -2836,7 +2994,7 @@ fi # Define the identity of the package. PACKAGE=bfd - VERSION=2.17 + VERSION=2.17.50 cat >>confdefs.h <<_ACEOF @@ -3240,1302 +3398,33 @@ fi if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} -case $enableval in -yes) enable_shared=yes ;; -no) enable_shared=no ;; -*) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac -else - enable_shared=no -fi; - -# Check whether --enable-static or --disable-static was given. -if test "${enable_static+set}" = set; then - enableval="$enable_static" - p=${PACKAGE-default} -case $enableval in -yes) enable_static=yes ;; -no) enable_static=no ;; -*) - enable_static=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac -else - enable_static=yes -fi; -# Check whether --enable-fast-install or --disable-fast-install was given. -if test "${enable_fast_install+set}" = set; then - enableval="$enable_fast_install" - p=${PACKAGE-default} -case $enableval in -yes) enable_fast_install=yes ;; -no) enable_fast_install=no ;; -*) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac -else - enable_fast_install=yes -fi; - -# Check whether --with-gnu-ld or --without-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi; -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by GCC" >&5 -echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 -else - echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 -fi -if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" -else - lt_cv_path_LD="$LD" # Let the user override the test with a path. -fi -fi - -LD="$lt_cv_path_LD" -if test -n "$LD"; then - echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 -if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then - lt_cv_prog_gnu_ld=yes -else - lt_cv_prog_gnu_ld=no -fi -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 -with_gnu_ld=$lt_cv_prog_gnu_ld - - -echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 -echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 -if test "${lt_cv_ld_reload_flag+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_ld_reload_flag='-r' -fi -echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 -reload_flag=$lt_cv_ld_reload_flag -test -n "$reload_flag" && reload_flag=" $reload_flag" - -echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 -echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 -if test "${lt_cv_path_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/${ac_tool_prefix}nm - if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then - lt_cv_path_NM="$tmp_nm -B" - break - elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - lt_cv_path_NM="$tmp_nm -p" - break - else - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - fi - fi - done - IFS="$ac_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi -fi - -NM="$lt_cv_path_NM" -echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6 - -echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else - echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6 -fi - -echo "$as_me:$LINENO: checking how to recognise dependant libraries" >&5 -echo $ECHO_N "checking how to recognise dependant libraries... $ECHO_C" >&6 -if test "${lt_cv_deplibs_check_method+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [regex]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given egrep regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi4*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin* | mingw* |pw32*) - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - # this will be overwritten by pass_all, but leave it in just in case - lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' - lt_cv_file_magic_cmd='/usr/bin/file -L' - case "$host_os" in - rhapsody* | darwin1.012) - lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System' - ;; - *) # Darwin 1.3 on - lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' - ;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | kfreebsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20*|hpux11*) - case $host_cpu in - hppa*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - esac - ;; - -irix5* | irix6*) - case $host_os in - irix5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" - ;; - *) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" - ;; - esac - lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux-gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$' - fi - ;; - -newsos6) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -osf3* | osf4* | osf5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' - lt_cv_file_magic_test_file=/shlib/libc.so - lt_cv_deplibs_check_method=pass_all - ;; - -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - lt_cv_file_magic_test_file=/lib/libc.so - ;; - -sysv5uw[78]* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - esac - ;; -esac - -fi -echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method - - - - -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! - -# find the maximum length of command line arguments -echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 -echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 -if test "${lt_cv_sys_max_cmd_len+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for *BSD - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - esac - -fi - -if test -n "$lt_cv_sys_max_cmd_len" ; then - echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 -echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 -else - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 -fi - - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MAGIC_CMD in - /*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; - ?:/*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. - ;; - *) - ac_save_MAGIC_CMD="$MAGIC_CMD" - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="/usr/bin:$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$ac_save_ifs" - MAGIC_CMD="$ac_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - echo "$as_me:$LINENO: checking for file" >&5 -echo $ECHO_N "checking for file... $ECHO_C" >&6 -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MAGIC_CMD in - /*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; - ?:/*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. - ;; - *) - ac_save_MAGIC_CMD="$MAGIC_CMD" - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="/usr/bin:$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$ac_save_ifs" - MAGIC_CMD="$ac_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - RANLIB=$ac_ct_RANLIB -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - STRIP=$ac_ct_STRIP -else - STRIP="$ac_cv_prog_STRIP" -fi - - -# Check for any special flags to pass to ltconfig. -libtool_flags="--cache-file=$cache_file" -test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" -test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" -test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" -test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc" -test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" - - -# Check whether --enable-libtool-lock or --disable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then - enableval="$enable_libtool_lock" - -fi; -test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" -test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" - - -# Check whether --with-pic or --without-pic was given. -if test "${with_pic+set}" = set; then - withval="$with_pic" - pic_mode="$withval" -else - pic_mode=default -fi; -test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic" -test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -*-*-irix6*) - # Find out which ABI we are using. - echo '#line 4035 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case "`/usr/bin/file conftest.o`" in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case "`/usr/bin/file conftest.o`" in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 -if test "${lt_cv_cc_needs_belf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - lt_cv_cc_needs_belf=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -lt_cv_cc_needs_belf=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 -echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; - - -esac - - -# Save cache, so that ltconfig can load it -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -{ - (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" ;; - esac; -} | - sed ' - t clear - : clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -# Actually configure libtool. ac_aux_dir is where install-sh is found. -AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ -MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ -LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \ -AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \ -objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \ -deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \ -${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ -$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \ -|| { { echo "$as_me:$LINENO: error: libtool configure failed" >&5 -echo "$as_me: error: libtool configure failed" >&2;} - { (exit 1); exit 1; }; } - -# Reload cache, that may have been modified by ltconfig -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; esac - fi else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - -# Redirect the config.log output again, so that the ltconfig log is not -# clobbered by the next message. -exec 5>>./config.log - - - - - - - -# Check whether --enable-64-bit-bfd or --disable-64-bit-bfd was given. -if test "${enable_64_bit_bfd+set}" = set; then - enableval="$enable_64_bit_bfd" - case "${enableval}" in - yes) want64=true ;; - no) want64=false ;; - *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for 64-bit-bfd option" >&5 -echo "$as_me: error: bad value ${enableval} for 64-bit-bfd option" >&2;} - { (exit 1); exit 1; }; } ;; -esac -else - want64=false -fi; # Check whether --enable-targets or --disable-targets was given. -if test "${enable_targets+set}" = set; then - enableval="$enable_targets" - case "${enableval}" in - yes | "") { { echo "$as_me:$LINENO: error: enable-targets option must specify target names or 'all'" >&5 -echo "$as_me: error: enable-targets option must specify target names or 'all'" >&2;} - { (exit 1); exit 1; }; } - ;; - no) enable_targets= ;; - *) enable_targets=$enableval ;; -esac -fi; # Check whether --enable-commonbfdlib or --disable-commonbfdlib was given. -if test "${enable_commonbfdlib+set}" = set; then - enableval="$enable_commonbfdlib" - case "${enableval}" in - yes) commonbfdlib=true ;; - no) commonbfdlib=false ;; - *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for BFD commonbfdlib option" >&5 -echo "$as_me: error: bad value ${enableval} for BFD commonbfdlib option" >&2;} - { (exit 1); exit 1; }; } ;; -esac -fi; -# Check whether --with-mmap or --without-mmap was given. -if test "${with_mmap+set}" = set; then - withval="$with_mmap" - case "${withval}" in - yes) want_mmap=true ;; - no) want_mmap=false ;; - *) { { echo "$as_me:$LINENO: error: bad value ${withval} for BFD with-mmap option" >&5 -echo "$as_me: error: bad value ${withval} for BFD with-mmap option" >&2;} - { (exit 1); exit 1; }; } ;; -esac -else - want_mmap=false -fi; -# Check whether --enable-secureplt or --disable-secureplt was given. -if test "${enable_secureplt+set}" = set; then - enableval="$enable_secureplt" - case "${enableval}" in - yes) use_secureplt=true ;; - no) use_secureplt=false ;; - *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for secureplt option" >&5 -echo "$as_me: error: bad value ${enableval} for secureplt option" >&2;} - { (exit 1); exit 1; }; } ;; -esac -else - use_secureplt=false -fi; if test $use_secureplt = true; then - -cat >>confdefs.h <<\_ACEOF -#define USE_SECUREPLT 1 -_ACEOF - -fi - - -GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" - -# Check whether --enable-werror or --disable-werror was given. -if test "${enable_werror+set}" = set; then - enableval="$enable_werror" - case "${enableval}" in - yes | y) ERROR_ON_WARNING="yes" ;; - no | n) ERROR_ON_WARNING="no" ;; - *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-werror" >&5 -echo "$as_me: error: bad value ${enableval} for --enable-werror" >&2;} - { (exit 1); exit 1; }; } ;; - esac + enable_shared=no fi; -# Enable -Werror by default when using gcc -if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then - ERROR_ON_WARNING=yes -fi - -NO_WERROR= -if test "${ERROR_ON_WARNING}" = yes ; then - GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" - NO_WERROR="-Wno-error" -fi - -if test "${GCC}" = yes ; then - WARN_CFLAGS="${GCC_WARN_CFLAGS}" -fi - -# Check whether --enable-build-warnings or --disable-build-warnings was given. -if test "${enable_build_warnings+set}" = set; then - enableval="$enable_build_warnings" - case "${enableval}" in - yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; - no) if test "${GCC}" = yes ; then - WARN_CFLAGS="-w" - fi;; - ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; - *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; - *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; -esac -fi; - -if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then - echo "Setting warning flags = $WARN_CFLAGS" 6>&1 -fi - - - - - - ac_config_headers="$ac_config_headers config.h:config.in" - - -if test -z "$target" ; then - { { echo "$as_me:$LINENO: error: Unrecognized target system type; please check config.sub." >&5 -echo "$as_me: error: Unrecognized target system type; please check config.sub." >&2;} - { (exit 1); exit 1; }; } -fi - -echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 -echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 - # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then - enableval="$enable_maintainer_mode" - USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=no -fi; - echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 -echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 - - -if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - - MAINT=$MAINTAINER_MODE_TRUE - - - case ${build_alias} in - "") build_noncanonical=${build} ;; - *) build_noncanonical=${build_alias} ;; -esac - - case ${host_alias} in - "") host_noncanonical=${build_noncanonical} ;; - *) host_noncanonical=${host_alias} ;; -esac - - case ${target_alias} in - "") target_noncanonical=${host_noncanonical} ;; - *) target_noncanonical=${target_alias} ;; -esac - -echo "$as_me:$LINENO: checking whether to install libbfd" >&5 -echo $ECHO_N "checking whether to install libbfd... $ECHO_C" >&6 - # Check whether --enable-install-libbfd or --disable-install-libbfd was given. -if test "${enable_install_libbfd+set}" = set; then - enableval="$enable_install_libbfd" - install_libbfd_p=$enableval -else - if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then - install_libbfd_p=yes - else - install_libbfd_p=no - fi -fi; - echo "$as_me:$LINENO: result: $install_libbfd_p" >&5 -echo "${ECHO_T}$install_libbfd_p" >&6 - - -if test $install_libbfd_p = yes; then - INSTALL_LIBBFD_TRUE= - INSTALL_LIBBFD_FALSE='#' -else - INSTALL_LIBBFD_TRUE='#' - INSTALL_LIBBFD_FALSE= -fi - - # Need _noncanonical variables for this. - - - - - # libbfd.a is a host library containing target dependent code - bfdlibdir='$(libdir)' - bfdincludedir='$(includedir)' - if test "${host}" != "${target}"; then - bfdlibdir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/lib' - bfdincludedir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/include' - fi -host64=false -target64=false -bfd_default_target_size=32 -# host stuff: ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -5273,7 +4162,1149 @@ _ACEOF -ALL_LINGUAS="fr tr ja es sv da zh_CN ro rw vi" + + +macro_version='2.1a' +macro_revision='1.2435' + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Set options + +enable_dlopen=no + + +enable_win32_dll=no + + + +# Check whether --enable-static or --disable-static was given. +if test "${enable_static+set}" = set; then + enableval="$enable_static" + p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi; + + + + + + + + + +# Check whether --with-pic or --without-pic was given. +if test "${with_pic+set}" = set; then + withval="$with_pic" + pic_mode="$withval" +else + pic_mode=default +fi; + +test -z "$pic_mode" && pic_mode=default + + + + + + + +# Check whether --enable-fast-install or --disable-fast-install was given. +if test "${enable_fast_install+set}" = set; then + enableval="$enable_fast_install" + p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi; + + + + + + + + +echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done + +fi + +SED=$lt_cv_path_SED + +echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6 + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +echo "$as_me:$LINENO: checking for fgrep" >&5 +echo $ECHO_N "checking for fgrep... $ECHO_C" >&6 +if test "${ac_cv_prog_fgrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo 'ab*c' | (grep -F 'ab*c') >/dev/null 2>&1 + then ac_cv_prog_fgrep='grep -F' + else ac_cv_prog_fgrep='fgrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_fgrep" >&5 +echo "${ECHO_T}$ac_cv_prog_fgrep" >&6 + FGREP=$ac_cv_prog_fgrep + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi; +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + + +echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5 +echo $ECHO_N "checking for BSD- or MS-compatible name lister (nm)... $ECHO_C" >&6 +if test "${lt_cv_path_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi +fi +echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6 +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$ac_tool_prefix"; then + for ac_prog in "dumpbin -symbols" "link -dump -symbols" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_DUMPBIN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + echo "$as_me:$LINENO: result: $DUMPBIN" >&5 +echo "${ECHO_T}$DUMPBIN" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in "dumpbin -symbols" "link -dump -symbols" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 +echo "${ECHO_T}$ac_ct_DUMPBIN" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_DUMPBIN" && break +done +test -n "$ac_ct_DUMPBIN" || ac_ct_DUMPBIN=":" + + DUMPBIN=$ac_ct_DUMPBIN +fi + + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 +echo $ECHO_N "checking the name lister ($NM) interface... $ECHO_C" >&6 +if test "${lt_cv_nm_interface+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:4668: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:4671: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:4674: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 +echo "${ECHO_T}$lt_cv_nm_interface" >&6 + +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + +# find the maximum length of command line arguments +echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`getconf ARG_MAX 2> /dev/null` + if test -n $lt_cv_sys_max_cmd_len; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 +else + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 +echo $ECHO_N "checking whether the shell understands some XSI constructs... $ECHO_C" >&6 +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, ) >/dev/null 2>&1 \ + && xsi_shell=yes +echo "$as_me:$LINENO: result: $xsi_shell" >&5 +echo "${ECHO_T}$xsi_shell" >&6 + + +echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 +echo $ECHO_N "checking whether the shell understands \"+=\"... $ECHO_C" >&6 +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +echo "$as_me:$LINENO: result: $lt_shell_append" >&5 +echo "${ECHO_T}$lt_shell_append" >&6 + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 +if test "${lt_cv_ld_reload_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_ld_reload_flag='-r' +fi +echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + + +echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 +echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6 +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AR=$ac_ct_AR +else + AR="$ac_cv_prog_AR" +fi + +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 @@ -5354,6 +5385,533 @@ else RANLIB="$ac_cv_prog_RANLIB" fi +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6 +else + echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6 +fi + + + + + + + + + + + + + + + + + +# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval="$enable_libtool_lock" + +fi; +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 5729 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 +if test "${lt_cv_cc_needs_belf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + lt_cv_cc_needs_belf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +lt_cv_cc_needs_belf=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -5589,21 +6147,6 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep - - echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then @@ -5770,184 +6313,6 @@ _ACEOF fi -echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 -if test "${ac_cv_c_const+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset x; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *ccp; - char **p; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - ccp = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++ccp; - p = (char**) ccp; - ccp = (char const *const *) p; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - } -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_const=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_c_const=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6 -if test $ac_cv_c_const = no; then - -cat >>confdefs.h <<\_ACEOF -#define const -_ACEOF - -fi - -echo "$as_me:$LINENO: checking for inline" >&5 -echo $ECHO_N "checking for inline... $ECHO_C" >&6 -if test "${ac_cv_c_inline+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif - -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_inline=$ac_kw; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done - -fi -echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 -echo "${ECHO_T}$ac_cv_c_inline" >&6 - - -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac - # On IRIX 5.3, sys/types and inttypes.h are conflicting. @@ -6020,9 +6385,13 @@ fi done -echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6 -if test "${ac_cv_type_off_t+set}" = set; then + +for ac_header in dlfcn.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -6032,16 +6401,8 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -int -main () -{ -if ((off_t *) 0) - return 0; -if (sizeof (off_t)) - return 0; - ; - return 0; -} + +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -6065,1106 +6426,1378 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_type_off_t=yes + eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_off_t=no +eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6 -if test $ac_cv_type_off_t = yes; then - : +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6 +if test "${lt_cv_objdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$lt_cv_objdir" >&6 +objdir=$lt_cv_objdir + + + + cat >>confdefs.h <<_ACEOF -#define off_t long +#define LT_OBJDIR "$lt_cv_objdir/" _ACEOF -fi -echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6 -if test "${ac_cv_type_size_t+set}" = set; then + + + + + + + + + + + + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((size_t *) 0) - return 0; -if (sizeof (size_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_size_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 -ac_cv_type_size_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6 -if test $ac_cv_type_size_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned -_ACEOF - -fi - -# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works -# for constant arguments. Useless! -echo "$as_me:$LINENO: checking for working alloca.h" >&5 -echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 -if test "${ac_cv_working_alloca_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -char *p = (char *) alloca (2 * sizeof (int)); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_working_alloca_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_working_alloca_h=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 -echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 -if test $ac_cv_working_alloca_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA_H 1 -_ACEOF - -fi - -echo "$as_me:$LINENO: checking for alloca" >&5 -echo $ECHO_N "checking for alloca... $ECHO_C" >&6 -if test "${ac_cv_func_alloca_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER -# include -# define alloca _alloca -# else -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -# endif -#endif - -int -main () -{ -char *p = (char *) alloca (1); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_alloca_works=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_alloca_works=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 -echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 - -if test $ac_cv_func_alloca_works = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA 1 -_ACEOF - -else - # The SVR3 libPW and SVR4 libucb both contain incompatible functions -# that cause trouble. Some versions do not even contain alloca or -# contain a buggy version. If you still want to use their alloca, -# use ar to extract alloca.o from them instead of compiling alloca.c. - -ALLOCA=alloca.$ac_objext - -cat >>confdefs.h <<\_ACEOF -#define C_ALLOCA 1 -_ACEOF - - -echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 -echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 -if test "${ac_cv_os_cray+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if defined(CRAY) && ! defined(CRAY2) -webecray -#else -wenotbecray -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then - ac_cv_os_cray=yes -else - ac_cv_os_cray=no -fi -rm -f conftest* - -fi -echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 -echo "${ECHO_T}$ac_cv_os_cray" >&6 -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - -cat >>confdefs.h <<_ACEOF -#define CRAY_STACKSEG_END $ac_func -_ACEOF - - break -fi +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org +_LT_EOF + fi ;; + esac + fi + break + fi done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac fi -echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 -echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 -if test "${ac_cv_c_stack_direction+set}" = set; then +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$cross_compiling" = yes; then - ac_cv_c_stack_direction=0 + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -find_stack_direction () -{ - static char *addr = 0; - auto char dummy; - if (addr == 0) - { - addr = &dummy; - return find_stack_direction (); - } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + else - return (&dummy > addr) ? 1 : -1; -} - -int -main () -{ - exit (find_stack_direction () < 0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_stack_direction=1 -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_stack_direction=-1 -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 -echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 - -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -_ACEOF - - -fi - - - -for ac_header in stdlib.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= + MAGIC_CMD=: fi -else - ac_cpp_err=yes fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:6829: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:6833: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* - ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + if test "$host_cpu" = m68k; then + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + fi + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic='-qnocommon' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6 + + + + + + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + lt_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7151: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:7155: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works=yes + fi + fi + $RM conftest* fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 + +if test x"$lt_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi fi -done -for ac_func in getpagesize -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func + lt_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works=yes + fi + else + lt_prog_compiler_static_works=yes + fi + fi + $RM conftest* + LDFLAGS="$save_LDFLAGS" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" +if test x"$lt_prog_compiler_static_works" = xyes; then + : else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" + lt_prog_compiler_static= fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF -fi -done -echo "$as_me:$LINENO: checking for working mmap" >&5 -echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 -if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then + + + + + + echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$cross_compiling" = yes; then - ac_cv_func_mmap_fixed_mapped=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -/* malloc might have been renamed as rpl_malloc. */ -#undef malloc + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext -/* Thanks to Mike Haertel and Jim Avera for this test. - Here is a matrix of mmap possibilities: - mmap private not fixed - mmap private fixed at somewhere currently unmapped - mmap private fixed at somewhere already mapped - mmap shared not fixed - mmap shared fixed at somewhere currently unmapped - mmap shared fixed at somewhere already mapped - For private mappings, we should verify that changes cannot be read() - back from the file, nor mmap's back from the file at a different - address. (There have been systems where private was not correctly - implemented like the infamous i386 svr4.0, and systems where the - VM page cache was not coherent with the file system buffer cache - like early versions of FreeBSD and possibly contemporary NetBSD.) - For shared mappings, we should conversely verify that changes get - propagated back to all the places they're supposed to be. - - Grep wants private fixed already mapped. - The main things grep needs to know about mmap are: - * does it exist and is it safe to write into the mmap'd area - * how to use it (BSD variants) */ - -#include -#include - -#if !STDC_HEADERS && !HAVE_STDLIB_H -char *malloc (); -#endif - -/* This mess was copied from the GNU getpagesize.h. */ -#if !HAVE_GETPAGESIZE -/* Assume that all systems that can run configure have sys/param.h. */ -# if !HAVE_SYS_PARAM_H -# define HAVE_SYS_PARAM_H 1 -# endif - -# ifdef _SC_PAGESIZE -# define getpagesize() sysconf(_SC_PAGESIZE) -# else /* no _SC_PAGESIZE */ -# if HAVE_SYS_PARAM_H -# include -# ifdef EXEC_PAGESIZE -# define getpagesize() EXEC_PAGESIZE -# else /* no EXEC_PAGESIZE */ -# ifdef NBPG -# define getpagesize() NBPG * CLSIZE -# ifndef CLSIZE -# define CLSIZE 1 -# endif /* no CLSIZE */ -# else /* no NBPG */ -# ifdef NBPC -# define getpagesize() NBPC -# else /* no NBPC */ -# ifdef PAGESIZE -# define getpagesize() PAGESIZE -# endif /* PAGESIZE */ -# endif /* no NBPC */ -# endif /* no NBPG */ -# endif /* no EXEC_PAGESIZE */ -# else /* no HAVE_SYS_PARAM_H */ -# define getpagesize() 8192 /* punt totally */ -# endif /* no HAVE_SYS_PARAM_H */ -# endif /* no _SC_PAGESIZE */ - -#endif /* no HAVE_GETPAGESIZE */ - -int -main () -{ - char *data, *data2, *data3; - int i, pagesize; - int fd; - - pagesize = getpagesize (); - - /* First, make a file with some known garbage in it. */ - data = (char *) malloc (pagesize); - if (!data) - exit (1); - for (i = 0; i < pagesize; ++i) - *(data + i) = rand (); - umask (0); - fd = creat ("conftest.mmap", 0600); - if (fd < 0) - exit (1); - if (write (fd, data, pagesize) != pagesize) - exit (1); - close (fd); - - /* Next, try to mmap the file at a fixed address which already has - something else allocated at it. If we can, also make sure that - we see the same garbage. */ - fd = open ("conftest.mmap", O_RDWR); - if (fd < 0) - exit (1); - data2 = (char *) malloc (2 * pagesize); - if (!data2) - exit (1); - data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); - if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_FIXED, fd, 0L)) - exit (1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data2 + i)) - exit (1); - - /* Finally, make sure that changes to the mapped area do not - percolate back to the file as seen by read(). (This is a bug on - some variants of i386 svr4.0.) */ - for (i = 0; i < pagesize; ++i) - *(data2 + i) = *(data2 + i) + 1; - data3 = (char *) malloc (pagesize); - if (!data3) - exit (1); - if (read (fd, data3, pagesize) != pagesize) - exit (1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data3 + i)) - exit (1); - close (fd); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_mmap_fixed_mapped=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_mmap_fixed_mapped=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 -echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 -if test $ac_cv_func_mmap_fixed_mapped = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MMAP 1 -_ACEOF + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7256: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:7260: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* fi -rm -f conftest.mmap +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 - - - - - -for ac_header in argz.h limits.h locale.h nl_types.h malloc.h string.h \ -unistd.h values.h sys/param.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7311: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:7315: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* -ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn fi else - ac_cpp_err=yes + need_locks=no fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes + + + + + echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + openbsd*) + with_gnu_ld=no + ;; + esac -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' -fi + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac -done + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. +_LT_EOF + fi + ;; + amigaos*) + if test "$host_cpu" = m68k; then + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + fi + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs=no + ;; + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + gnu* | linux* | tpf* | k*bsd*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + *) + tmp_sharedflag='-shared' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs=no + fi + ;; -for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \ -__argz_count __argz_stringify __argz_next -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif int main () { -return f != $ac_func; + ; return 0; } @@ -7191,84 +7824,49 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -fi -done - - - if test "${ac_cv_func_stpcpy+set}" != "set"; then - -for ac_func in stpcpy -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif int main () { -return f != $ac_func; + ; return 0; } @@ -7295,55 +7893,277 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -fi -done + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; - fi - if test "${ac_cv_func_stpcpy}" = "yes"; then + amigaos*) + if test "$host_cpu" = m68k; then + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + fi + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; -cat >>confdefs.h <<\_ACEOF -#define HAVE_STPCPY 1 -_ACEOF + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; - fi + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; - if test $ac_cv_header_locale_h = yes; then - echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 -echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6 -if test "${am_cv_val_LC_MESSAGES+set}" = set; then + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[012]) + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + ;; + esac + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + if test "$GCC" = yes ; then + if test "${lt_cv_apple_cc_single_mod+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -return LC_MESSAGES - ; - return 0; -} + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi-module to the + # link flags. + echo "int foo(void){return 1;}" > conftest.c + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib ${wl}-single_module conftest.c + if test -f libconftest.dylib; then + lt_cv_apple_cc_single_mod=yes + rm libconftest.dylib + fi + rm conftest.$ac_ext + fi +fi + + output_verbose_link_cmd=echo + if test "X$lt_cv_apple_cc_single_mod" = Xyes ; then + archive_cmds='$CC -dynamiclib $single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + archive_expsym_cmds='sed "s,^,_," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $single_module -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + archive_expsym_cmds='sed "s,^,_," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + module_expsym_cmds='sed -e "s,^,_," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd=echo + archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`$ECHO $rpath/$soname` $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed "s,^,_," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed "s,^,_," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat >conftest.$ac_ext <<_ACEOF +int foo(void) {} _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 @@ -7367,386 +8187,2677 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - am_cv_val_LC_MESSAGES=yes + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -am_cv_val_LC_MESSAGES=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5 -echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6 - if test $am_cv_val_LC_MESSAGES = yes; then + LDFLAGS="$save_LDFLAGS" + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; -cat >>confdefs.h <<\_ACEOF -#define HAVE_LC_MESSAGES 1 -_ACEOF + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac fi fi - echo "$as_me:$LINENO: checking whether NLS is requested" >&5 + +echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6 +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6 + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +withGCC=$GCC +if test "$withGCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + if test "$host_cpu" = m68k; then + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + else + dynamic_linker=no + fi + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $withGCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[3-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir"; then + shlibpath_overrides_runpath=yes +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$hardcode_action" >&6 + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shl_load) || defined (__stub___shl_load) +choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dlopen) || defined (__stub___dlopen) +choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main () +{ +dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line 10108 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +_LT_EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line 10208 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +_LT_EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 + + echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 + + echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6 + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + +# Check whether --enable-64-bit-bfd or --disable-64-bit-bfd was given. +if test "${enable_64_bit_bfd+set}" = set; then + enableval="$enable_64_bit_bfd" + case "${enableval}" in + yes) want64=true ;; + no) want64=false ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for 64-bit-bfd option" >&5 +echo "$as_me: error: bad value ${enableval} for 64-bit-bfd option" >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + want64=false +fi; # Check whether --enable-targets or --disable-targets was given. +if test "${enable_targets+set}" = set; then + enableval="$enable_targets" + case "${enableval}" in + yes | "") { { echo "$as_me:$LINENO: error: enable-targets option must specify target names or 'all'" >&5 +echo "$as_me: error: enable-targets option must specify target names or 'all'" >&2;} + { (exit 1); exit 1; }; } + ;; + no) enable_targets= ;; + *) enable_targets=$enableval ;; +esac +fi; # Check whether --enable-commonbfdlib or --disable-commonbfdlib was given. +if test "${enable_commonbfdlib+set}" = set; then + enableval="$enable_commonbfdlib" + case "${enableval}" in + yes) commonbfdlib=true ;; + no) commonbfdlib=false ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for BFD commonbfdlib option" >&5 +echo "$as_me: error: bad value ${enableval} for BFD commonbfdlib option" >&2;} + { (exit 1); exit 1; }; } ;; +esac +fi; +# Check whether --with-mmap or --without-mmap was given. +if test "${with_mmap+set}" = set; then + withval="$with_mmap" + case "${withval}" in + yes) want_mmap=true ;; + no) want_mmap=false ;; + *) { { echo "$as_me:$LINENO: error: bad value ${withval} for BFD with-mmap option" >&5 +echo "$as_me: error: bad value ${withval} for BFD with-mmap option" >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + want_mmap=false +fi; +# Check whether --enable-secureplt or --disable-secureplt was given. +if test "${enable_secureplt+set}" = set; then + enableval="$enable_secureplt" + case "${enableval}" in + yes) use_secureplt=true ;; + no) use_secureplt=false ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for secureplt option" >&5 +echo "$as_me: error: bad value ${enableval} for secureplt option" >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + use_secureplt=false +fi; if test $use_secureplt = true; then + +cat >>confdefs.h <<\_ACEOF +#define USE_SECUREPLT 1 +_ACEOF + +fi + +DEBUGDIR=${libdir}/debug + + +# Check whether --with-separate-debug-dir or --without-separate-debug-dir was given. +if test "${with_separate_debug_dir+set}" = set; then + withval="$with_separate_debug_dir" + DEBUGDIR="${withval}" +fi; + + + + +# Check whether --with-pkgversion or --without-pkgversion was given. +if test "${with_pkgversion+set}" = set; then + withval="$with_pkgversion" + case "$withval" in + yes) { { echo "$as_me:$LINENO: error: package version not specified" >&5 +echo "$as_me: error: package version not specified" >&2;} + { (exit 1); exit 1; }; } ;; + no) PKGVERSION= ;; + *) PKGVERSION="($withval) " ;; + esac +else + PKGVERSION="(GNU Binutils) " + +fi; + + + + +# Check whether --with-bugurl or --without-bugurl was given. +if test "${with_bugurl+set}" = set; then + withval="$with_bugurl" + case "$withval" in + yes) { { echo "$as_me:$LINENO: error: bug URL not specified" >&5 +echo "$as_me: error: bug URL not specified" >&2;} + { (exit 1); exit 1; }; } ;; + no) BUGURL= + ;; + *) BUGURL="$withval" + ;; + esac +else + BUGURL="http://www.sourceware.org/bugzilla/" + +fi; + case ${BUGURL} in + "") + REPORT_BUGS_TO= + REPORT_BUGS_TEXI= + ;; + *) + REPORT_BUGS_TO="<$BUGURL>" + REPORT_BUGS_TEXI=@uref{`echo "$BUGURL" | sed 's/@/@@/g'`} + ;; + esac; + + + + + +GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" + +# Check whether --enable-werror or --disable-werror was given. +if test "${enable_werror+set}" = set; then + enableval="$enable_werror" + case "${enableval}" in + yes | y) ERROR_ON_WARNING="yes" ;; + no | n) ERROR_ON_WARNING="no" ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-werror" >&5 +echo "$as_me: error: bad value ${enableval} for --enable-werror" >&2;} + { (exit 1); exit 1; }; } ;; + esac +fi; + +# Enable -Werror by default when using gcc +if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then + ERROR_ON_WARNING=yes +fi + +NO_WERROR= +if test "${ERROR_ON_WARNING}" = yes ; then + GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" + NO_WERROR="-Wno-error" +fi + +if test "${GCC}" = yes ; then + WARN_CFLAGS="${GCC_WARN_CFLAGS}" +fi + +# Check whether --enable-build-warnings or --disable-build-warnings was given. +if test "${enable_build_warnings+set}" = set; then + enableval="$enable_build_warnings" + case "${enableval}" in + yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; + no) if test "${GCC}" = yes ; then + WARN_CFLAGS="-w" + fi;; + ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` + WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; + *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` + WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; + *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; +esac +fi; + +if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then + echo "Setting warning flags = $WARN_CFLAGS" 6>&1 +fi + + + + + + ac_config_headers="$ac_config_headers config.h:config.in" + + +if test -z "$target" ; then + { { echo "$as_me:$LINENO: error: Unrecognized target system type; please check config.sub." >&5 +echo "$as_me: error: Unrecognized target system type; please check config.sub." >&2;} + { (exit 1); exit 1; }; } +fi + +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi; + echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + + +if false; then + GENINSRC_NEVER_TRUE= + GENINSRC_NEVER_FALSE='#' +else + GENINSRC_NEVER_TRUE='#' + GENINSRC_NEVER_FALSE= +fi + + case ${build_alias} in + "") build_noncanonical=${build} ;; + *) build_noncanonical=${build_alias} ;; +esac + + case ${host_alias} in + "") host_noncanonical=${build_noncanonical} ;; + *) host_noncanonical=${host_alias} ;; +esac + + case ${target_alias} in + "") target_noncanonical=${host_noncanonical} ;; + *) target_noncanonical=${target_alias} ;; +esac + +echo "$as_me:$LINENO: checking whether to install libbfd" >&5 +echo $ECHO_N "checking whether to install libbfd... $ECHO_C" >&6 + # Check whether --enable-install-libbfd or --disable-install-libbfd was given. +if test "${enable_install_libbfd+set}" = set; then + enableval="$enable_install_libbfd" + install_libbfd_p=$enableval +else + if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then + install_libbfd_p=yes + else + install_libbfd_p=no + fi +fi; + echo "$as_me:$LINENO: result: $install_libbfd_p" >&5 +echo "${ECHO_T}$install_libbfd_p" >&6 + + +if test $install_libbfd_p = yes; then + INSTALL_LIBBFD_TRUE= + INSTALL_LIBBFD_FALSE='#' +else + INSTALL_LIBBFD_TRUE='#' + INSTALL_LIBBFD_FALSE= +fi + + # Need _noncanonical variables for this. + + + + + # libbfd.a is a host library containing target dependent code + bfdlibdir='$(libdir)' + bfdincludedir='$(includedir)' + if test "${host}" != "${target}"; then + bfdlibdir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/lib' + bfdincludedir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/include' + fi + + + + + + +host64=false +target64=false +bfd_default_target_size=32 + +# host stuff: + +ALL_LINGUAS="fr tr ja es sv da zh_CN ro rw vi" +# If we haven't got the data from the intl directory, +# assume NLS is disabled. +USE_NLS=no +LIBINTL= +LIBINTL_DEP= +INCINTL= +XGETTEXT= +GMSGFMT= +POSUB= + +if test -f ../intl/config.intl; then + . ../intl/config.intl +fi +echo "$as_me:$LINENO: checking whether NLS is requested" >&5 echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 - # Check whether --enable-nls or --disable-nls was given. +if test x"$USE_NLS" != xyes; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_NLS 1 +_ACEOF + + + echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 +echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 + # Look for .po and .gmo files in the source directory. + CATALOGS= + XLINGUAS= + for cat in $srcdir/po/*.gmo $srcdir/po/*.po; do + # If there aren't any .gmo files the shell will give us the + # literal string "../path/to/srcdir/po/*.gmo" which has to be + # weeded out. + case "$cat" in *\**) + continue;; + esac + # The quadruple backslash is collapsed to a double backslash + # by the backticks, then collapsed again by the double quotes, + # leaving us with one backslash in the sed expression (right + # before the dot that mustn't act as a wildcard). + cat=`echo $cat | sed -e "s!$srcdir/po/!!" -e "s!\\\\.po!.gmo!"` + lang=`echo $cat | sed -e "s!\\\\.gmo!!"` + # The user is allowed to set LINGUAS to a list of languages to + # install catalogs for. If it's empty that means "all of them." + if test "x$LINGUAS" = x; then + CATALOGS="$CATALOGS $cat" + XLINGUAS="$XLINGUAS $lang" + else + case "$LINGUAS" in *$lang*) + CATALOGS="$CATALOGS $cat" + XLINGUAS="$XLINGUAS $lang" + ;; + esac + fi + done + LINGUAS="$XLINGUAS" + echo "$as_me:$LINENO: result: $LINGUAS" >&5 +echo "${ECHO_T}$LINGUAS" >&6 + + + DATADIRNAME=share + + INSTOBJEXT=.mo + + GENCAT=gencat + + CATOBJEXT=.gmo + +fi + + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + case "$ac_aux_dir" in + /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; + *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; + esac + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + + + + echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 + # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" USE_NLS=$enableval else USE_NLS=yes fi; - echo "$as_me:$LINENO: result: $USE_NLS" >&5 + echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6 - USE_INCLUDED_LIBINTL=no - if test "$USE_NLS" = "yes"; then - echo "$as_me:$LINENO: checking whether included gettext is requested" >&5 -echo $ECHO_N "checking whether included gettext is requested... $ECHO_C" >&6 -# Check whether --with-included-gettext or --without-included-gettext was given. -if test "${with_included_gettext+set}" = set; then - withval="$with_included_gettext" - nls_cv_force_use_gnu_gettext=$withval -else - nls_cv_force_use_gnu_gettext=no -fi; - echo "$as_me:$LINENO: result: $nls_cv_force_use_gnu_gettext" >&5 -echo "${ECHO_T}$nls_cv_force_use_gnu_gettext" >&6 - nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" - if test "$nls_cv_force_use_gnu_gettext" != "yes"; then - nls_cv_header_intl= - nls_cv_header_libgt= - CATOBJEXT= - if test "${ac_cv_header_libintl_h+set}" = set; then - echo "$as_me:$LINENO: checking for libintl.h" >&5 -echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6 -if test "${ac_cv_header_libintl_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 -echo "${ECHO_T}$ac_cv_header_libintl_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking libintl.h usability" >&5 -echo $ECHO_N "checking libintl.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking libintl.h presence" >&5 -echo $ECHO_N "checking libintl.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' else - ac_cpp_err= + PATH_SEPARATOR=: fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" else - ac_cpp_err=yes + ac_executable_p="test -f" fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +rm -f conf$$.file - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: libintl.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: libintl.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: libintl.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: libintl.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: libintl.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: libintl.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for libintl.h" >&5 -echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6 -if test "${ac_cv_header_libintl_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_libintl_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 -echo "${ECHO_T}$ac_cv_header_libintl_h" >&6 - -fi -if test $ac_cv_header_libintl_h = yes; then - echo "$as_me:$LINENO: checking for gettext in libc" >&5 -echo $ECHO_N "checking for gettext in libc... $ECHO_C" >&6 -if test "${gt_cv_func_gettext_libc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -return (int) gettext ("") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gt_cv_func_gettext_libc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gt_cv_func_gettext_libc=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $gt_cv_func_gettext_libc" >&5 -echo "${ECHO_T}$gt_cv_func_gettext_libc" >&6 - - if test "$gt_cv_func_gettext_libc" != "yes"; then - echo "$as_me:$LINENO: checking for bindtextdomain in -lintl" >&5 -echo $ECHO_N "checking for bindtextdomain in -lintl... $ECHO_C" >&6 -if test "${ac_cv_lib_intl_bindtextdomain+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lintl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char bindtextdomain (); -int -main () -{ -bindtextdomain (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_intl_bindtextdomain=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_intl_bindtextdomain=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_intl_bindtextdomain" >&5 -echo "${ECHO_T}$ac_cv_lib_intl_bindtextdomain" >&6 -if test $ac_cv_lib_intl_bindtextdomain = yes; then - echo "$as_me:$LINENO: checking for gettext in libintl" >&5 -echo $ECHO_N "checking for gettext in libintl... $ECHO_C" >&6 -if test "${gt_cv_func_gettext_libintl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -return (int) gettext ("") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gt_cv_func_gettext_libintl=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gt_cv_func_gettext_libintl=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $gt_cv_func_gettext_libintl" >&5 -echo "${ECHO_T}$gt_cv_func_gettext_libintl" >&6 -fi - - fi - - if test "$gt_cv_func_gettext_libc" = "yes" \ - || test "$gt_cv_func_gettext_libintl" = "yes"; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_GETTEXT 1 -_ACEOF - - # Extract the first word of "msgfmt", so it can be a program name with args. +# Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -7754,308 +10865,31 @@ if test "${ac_cv_path_MSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in - /*) - ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then - ac_cv_path_MSGFMT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" - ;; -esac -fi -MSGFMT="$ac_cv_path_MSGFMT" -if test -n "$MSGFMT"; then - echo "$as_me:$LINENO: result: $MSGFMT" >&5 -echo "${ECHO_T}$MSGFMT" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - if test "$MSGFMT" != "no"; then - -for ac_func in dcgettext -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - # Extract the first word of "gmsgfmt", so it can be a program name with args. -set dummy gmsgfmt; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_GMSGFMT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $GMSGFMT in [\\/]* | ?:[\\/]*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. - ;; + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" - ;; -esac -fi -GMSGFMT=$ac_cv_path_GMSGFMT - -if test -n "$GMSGFMT"; then - echo "$as_me:$LINENO: result: $GMSGFMT" >&5 -echo "${ECHO_T}$GMSGFMT" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - # Extract the first word of "xgettext", so it can be a program name with args. -set dummy xgettext; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_XGETTEXT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case "$XGETTEXT" in - /*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then - ac_cv_path_XGETTEXT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" - ;; -esac -fi -XGETTEXT="$ac_cv_path_XGETTEXT" -if test -n "$XGETTEXT"; then - echo "$as_me:$LINENO: result: $XGETTEXT" >&5 -echo "${ECHO_T}$XGETTEXT" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -extern int _nl_msg_cat_cntr; - return _nl_msg_cat_cntr - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - CATOBJEXT=.gmo - DATADIRNAME=share -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -CATOBJEXT=.mo - DATADIRNAME=lib -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - INSTOBJEXT=.mo - fi - fi - -fi - - - - - if test x"$CATOBJEXT" = x && test -d $srcdir/../intl; then - # Neither gettext nor catgets in included in the C library. - # Fall back on GNU gettext library (assuming it is present). - nls_cv_use_gnu_gettext=yes + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi fi - fi - - if test "$nls_cv_use_gnu_gettext" = "yes"; then - INTLOBJS="\$(GETTOBJS)" - # Extract the first word of "msgfmt", so it can be a program name with args. -set dummy msgfmt; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_MSGFMT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case "$MSGFMT" in - /*) - ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then - ac_cv_path_MSGFMT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="msgfmt" - ;; + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" -if test -n "$MSGFMT"; then +if test "$MSGFMT" != ":"; then echo "$as_me:$LINENO: result: $MSGFMT" >&5 echo "${ECHO_T}$MSGFMT" >&6 else @@ -8063,7 +10897,7 @@ else echo "${ECHO_T}no" >&6 fi - # Extract the first word of "gmsgfmt", so it can be a program name with args. + # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -8103,7 +10937,37 @@ else echo "${ECHO_T}no" >&6 fi - # Extract the first word of "xgettext", so it can be a program name with args. + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -8111,27 +10975,31 @@ if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in - /*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then - ac_cv_path_XGETTEXT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" - ;; + ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" -if test -n "$XGETTEXT"; then +if test "$XGETTEXT" != ":"; then echo "$as_me:$LINENO: result: $XGETTEXT" >&5 echo "${ECHO_T}$XGETTEXT" >&6 else @@ -8139,284 +11007,105 @@ else echo "${ECHO_T}no" >&6 fi - - USE_INCLUDED_LIBINTL=yes - CATOBJEXT=.gmo - INSTOBJEXT=.mo - DATADIRNAME=share - INTLDEPS='$(top_builddir)/../intl/libintl.a' - INTLLIBS=$INTLDEPS - LIBS=`echo $LIBS | sed -e 's/-lintl//'` - nls_cv_header_intl=libintl.h - nls_cv_header_libgt=libgettext.h - fi - - if test "$XGETTEXT" != ":"; then - if $XGETTEXT --omit-header /dev/null 2> /dev/null; then - : ; - else - echo "$as_me:$LINENO: result: found xgettext programs is not GNU xgettext; ignore it" >&5 -echo "${ECHO_T}found xgettext programs is not GNU xgettext; ignore it" >&6 - XGETTEXT=":" - fi - fi - - # We need to process the po/ directory. - POSUB=po - else - DATADIRNAME=share - nls_cv_header_intl=libintl.h - nls_cv_header_libgt=libgettext.h - fi - - # If this is used in GNU gettext we have to set USE_NLS to `yes' - # because some of the sources are only built for this goal. - if test "$PACKAGE" = gettext; then - USE_NLS=yes - USE_INCLUDED_LIBINTL=yes - fi - - for lang in $ALL_LINGUAS; do - GMOFILES="$GMOFILES $lang.gmo" - POFILES="$POFILES $lang.po" - done + rm -f messages.po - - - - - - - - - - - if test "x$CATOBJEXT" != "x"; then - -cat >>confdefs.h <<\_ACEOF -#define ENABLE_NLS 1 -_ACEOF - - fi - - - if test "x$CATOBJEXT" != "x"; then - if test "x$ALL_LINGUAS" = "x"; then - LINGUAS= - else - echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 -echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 - NEW_LINGUAS= - for lang in ${LINGUAS=$ALL_LINGUAS}; do - case "$ALL_LINGUAS" in - *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; - esac - done - LINGUAS=$NEW_LINGUAS - echo "$as_me:$LINENO: result: $LINGUAS" >&5 -echo "${ECHO_T}$LINGUAS" >&6 - fi - - if test -n "$LINGUAS"; then - for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done - fi - fi - - if test $ac_cv_header_locale_h = yes; then - INCLUDE_LOCALE_H="#include " - else - INCLUDE_LOCALE_H="\ -/* The system does not provide the header . Take care yourself. */" - fi - - - if test -f $srcdir/po2tbl.sed.in; then - if test "$CATOBJEXT" = ".cat"; then - if test "${ac_cv_header_linux_version_h+set}" = set; then - echo "$as_me:$LINENO: checking for linux/version.h" >&5 -echo $ECHO_N "checking for linux/version.h... $ECHO_C" >&6 -if test "${ac_cv_header_linux_version_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_linux_version_h" >&5 -echo "${ECHO_T}$ac_cv_header_linux_version_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking linux/version.h usability" >&5 -echo $ECHO_N "checking linux/version.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking linux/version.h presence" >&5 -echo $ECHO_N "checking linux/version.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' else - ac_cpp_err= + PATH_SEPARATOR=: fi -else - ac_cpp_err=yes + rm -f conf$$.sh fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no + ac_executable_p="test -f" fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +rm -f conf$$.file -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: linux/version.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: linux/version.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: linux/version.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes +# Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MSGMERGE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case "$MSGMERGE" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: linux/version.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: linux/version.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: linux/version.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: linux/version.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: linux/version.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: linux/version.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: linux/version.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac -echo "$as_me:$LINENO: checking for linux/version.h" >&5 -echo $ECHO_N "checking for linux/version.h... $ECHO_C" >&6 -if test "${ac_cv_header_linux_version_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + echo "$as_me:$LINENO: result: $MSGMERGE" >&5 +echo "${ECHO_T}$MSGMERGE" >&6 else - ac_cv_header_linux_version_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_linux_version_h" >&5 -echo "${ECHO_T}$ac_cv_header_linux_version_h" >&6 - -fi -if test $ac_cv_header_linux_version_h = yes; then - msgformat=linux -else - msgformat=xopen + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi + if test "$GMSGFMT" != ":"; then + if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && + (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` + echo "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 +echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6 + GMSGFMT=":" + fi + fi - sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed - fi - sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ - $srcdir/po2tbl.sed.in > po2tbl.sed - fi + if test "$XGETTEXT" != ":"; then + if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 +echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6 + XGETTEXT=":" + fi + rm -f messages.po + fi - if test "$PACKAGE" = "gettext"; then - GT_NO="#NO#" - GT_YES= - else - GT_NO= - GT_YES="#YES#" - fi + ac_config_commands="$ac_config_commands default-1" - MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs" - - - l= - - - if test -f $srcdir/po/POTFILES.in; then - test -d po || mkdir po - if test "x$srcdir" != "x."; then - if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then - posrcprefix="$srcdir/" - else - posrcprefix="../$srcdir/" - fi - else - posrcprefix="../" - fi - rm -f po/POTFILES - sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ - < $srcdir/po/POTFILES.in > po/POTFILES - fi - - # Permit host specific settings. . ${srcdir}/configure.host @@ -9760,6 +12449,2853 @@ fi done + + +inttype_headers=`echo inttypes.h sys/inttypes.h | sed -e 's/,/ /g'` + +acx_cv_header_stdint=stddef.h +acx_cv_header_stdint_kind="(already complete)" +for i in stdint.h $inttype_headers; do + unset ac_cv_type_uintptr_t + unset ac_cv_type_uintmax_t + unset ac_cv_type_int_least32_t + unset ac_cv_type_int_fast32_t + unset ac_cv_type_uint64_t + echo $ECHO_N "looking for a compliant stdint.h in $i, $ECHO_C" >&6 + echo "$as_me:$LINENO: checking for uintmax_t" >&5 +echo $ECHO_N "checking for uintmax_t... $ECHO_C" >&6 +if test "${ac_cv_type_uintmax_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include <$i> + +int +main () +{ +if ((uintmax_t *) 0) + return 0; +if (sizeof (uintmax_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uintmax_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uintmax_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uintmax_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintmax_t" >&6 +if test $ac_cv_type_uintmax_t = yes; then + acx_cv_header_stdint=$i +else + continue +fi + + echo "$as_me:$LINENO: checking for uintptr_t" >&5 +echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6 +if test "${ac_cv_type_uintptr_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include <$i> + +int +main () +{ +if ((uintptr_t *) 0) + return 0; +if (sizeof (uintptr_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uintptr_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uintptr_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6 +if test $ac_cv_type_uintptr_t = yes; then + : +else + acx_cv_header_stdint_kind="(mostly complete)" +fi + + echo "$as_me:$LINENO: checking for int_least32_t" >&5 +echo $ECHO_N "checking for int_least32_t... $ECHO_C" >&6 +if test "${ac_cv_type_int_least32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include <$i> + +int +main () +{ +if ((int_least32_t *) 0) + return 0; +if (sizeof (int_least32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int_least32_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int_least32_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int_least32_t" >&5 +echo "${ECHO_T}$ac_cv_type_int_least32_t" >&6 +if test $ac_cv_type_int_least32_t = yes; then + : +else + acx_cv_header_stdint_kind="(mostly complete)" +fi + + echo "$as_me:$LINENO: checking for int_fast32_t" >&5 +echo $ECHO_N "checking for int_fast32_t... $ECHO_C" >&6 +if test "${ac_cv_type_int_fast32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include <$i> + +int +main () +{ +if ((int_fast32_t *) 0) + return 0; +if (sizeof (int_fast32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int_fast32_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int_fast32_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int_fast32_t" >&5 +echo "${ECHO_T}$ac_cv_type_int_fast32_t" >&6 +if test $ac_cv_type_int_fast32_t = yes; then + : +else + acx_cv_header_stdint_kind="(mostly complete)" +fi + + echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include <$i> + +int +main () +{ +if ((uint64_t *) 0) + return 0; +if (sizeof (uint64_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint64_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint64_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 +if test $ac_cv_type_uint64_t = yes; then + : +else + acx_cv_header_stdint_kind="(lacks uint64_t)" +fi + + break +done +if test "$acx_cv_header_stdint" = stddef.h; then + acx_cv_header_stdint_kind="(lacks uintmax_t)" + for i in stdint.h $inttype_headers; do + unset ac_cv_type_uintptr_t + unset ac_cv_type_uint32_t + unset ac_cv_type_uint64_t + echo $ECHO_N "looking for an incomplete stdint.h in $i, $ECHO_C" >&6 + echo "$as_me:$LINENO: checking for uint32_t" >&5 +echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include <$i> + +int +main () +{ +if ((uint32_t *) 0) + return 0; +if (sizeof (uint32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint32_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint32_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint32_t" >&6 +if test $ac_cv_type_uint32_t = yes; then + acx_cv_header_stdint=$i +else + continue +fi + + echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include <$i> + +int +main () +{ +if ((uint64_t *) 0) + return 0; +if (sizeof (uint64_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint64_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint64_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 + + echo "$as_me:$LINENO: checking for uintptr_t" >&5 +echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6 +if test "${ac_cv_type_uintptr_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include <$i> + +int +main () +{ +if ((uintptr_t *) 0) + return 0; +if (sizeof (uintptr_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uintptr_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uintptr_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6 + + break + done +fi +if test "$acx_cv_header_stdint" = stddef.h; then + acx_cv_header_stdint_kind="(u_intXX_t style)" + for i in sys/types.h $inttype_headers; do + unset ac_cv_type_u_int32_t + unset ac_cv_type_u_int64_t + echo $ECHO_N "looking for u_intXX_t types in $i, $ECHO_C" >&6 + echo "$as_me:$LINENO: checking for u_int32_t" >&5 +echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include <$i> + +int +main () +{ +if ((u_int32_t *) 0) + return 0; +if (sizeof (u_int32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int32_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_u_int32_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 +if test $ac_cv_type_u_int32_t = yes; then + acx_cv_header_stdint=$i +else + continue +fi + + echo "$as_me:$LINENO: checking for u_int64_t" >&5 +echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include <$i> + +int +main () +{ +if ((u_int64_t *) 0) + return 0; +if (sizeof (u_int64_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int64_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_u_int64_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6 + + break + done +fi +if test "$acx_cv_header_stdint" = stddef.h; then + acx_cv_header_stdint_kind="(using manual detection)" +fi + +test -z "$ac_cv_type_uintptr_t" && ac_cv_type_uintptr_t=no +test -z "$ac_cv_type_uint64_t" && ac_cv_type_uint64_t=no +test -z "$ac_cv_type_u_int64_t" && ac_cv_type_u_int64_t=no +test -z "$ac_cv_type_int_least32_t" && ac_cv_type_int_least32_t=no +test -z "$ac_cv_type_int_fast32_t" && ac_cv_type_int_fast32_t=no + +# ----------------- Summarize what we found so far + +echo "$as_me:$LINENO: checking what to include in bfd_stdint.h" >&5 +echo $ECHO_N "checking what to include in bfd_stdint.h... $ECHO_C" >&6 + +case `$as_basename bfd_stdint.h || +$as_expr X/bfd_stdint.h : '.*/\([^/][^/]*\)/*$' \| \ + Xbfd_stdint.h : 'X\(//\)$' \| \ + Xbfd_stdint.h : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/bfd_stdint.h | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` in + stdint.h) { echo "$as_me:$LINENO: WARNING: are you sure you want it there?" >&5 +echo "$as_me: WARNING: are you sure you want it there?" >&2;} ;; + inttypes.h) { echo "$as_me:$LINENO: WARNING: are you sure you want it there?" >&5 +echo "$as_me: WARNING: are you sure you want it there?" >&2;} ;; + *) ;; +esac + +echo "$as_me:$LINENO: result: $acx_cv_header_stdint $acx_cv_header_stdint_kind" >&5 +echo "${ECHO_T}$acx_cv_header_stdint $acx_cv_header_stdint_kind" >&6 + +# ----------------- done included file, check C basic types -------- + +# Lacking an uintptr_t? Test size of void * +case "$acx_cv_header_stdint:$ac_cv_type_uintptr_t" in + stddef.h:* | *:no) echo "$as_me:$LINENO: checking for void *" >&5 +echo $ECHO_N "checking for void *... $ECHO_C" >&6 +if test "${ac_cv_type_void_p+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((void * *) 0) + return 0; +if (sizeof (void *)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_void_p=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_void_p=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 +echo "${ECHO_T}$ac_cv_type_void_p" >&6 + +echo "$as_me:$LINENO: checking size of void *" >&5 +echo $ECHO_N "checking size of void *... $ECHO_C" >&6 +if test "${ac_cv_sizeof_void_p+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_void_p" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (void *))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_void_p=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (void *), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +long longval () { return (long) (sizeof (void *)); } +unsigned long ulongval () { return (long) (sizeof (void *)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (void *))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (void *)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (void *)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_void_p=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (void *), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_void_p=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_VOID_P $ac_cv_sizeof_void_p +_ACEOF + + ;; +esac + +# Lacking an uint64_t? Test size of long +case "$acx_cv_header_stdint:$ac_cv_type_uint64_t:$ac_cv_type_u_int64_t" in + stddef.h:*:* | *:no:no) echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6 +if test "${ac_cv_type_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((long *) 0) + return 0; +if (sizeof (long)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_long=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6 + +echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6 +if test "${ac_cv_sizeof_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_long" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_long=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +long longval () { return (long) (sizeof (long)); } +unsigned long ulongval () { return (long) (sizeof (long)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (long))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (long)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (long)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_long=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_long=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + ;; +esac + +if test $acx_cv_header_stdint = stddef.h; then + # Lacking a good header? Test size of everything and deduce all types. + echo "$as_me:$LINENO: checking for int" >&5 +echo $ECHO_N "checking for int... $ECHO_C" >&6 +if test "${ac_cv_type_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((int *) 0) + return 0; +if (sizeof (int)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 +echo "${ECHO_T}$ac_cv_type_int" >&6 + +echo "$as_me:$LINENO: checking size of int" >&5 +echo $ECHO_N "checking size of int... $ECHO_C" >&6 +if test "${ac_cv_sizeof_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_int" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_int=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +long longval () { return (long) (sizeof (int)); } +unsigned long ulongval () { return (long) (sizeof (int)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (int))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (int)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (int)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_int=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_int=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + + echo "$as_me:$LINENO: checking for short" >&5 +echo $ECHO_N "checking for short... $ECHO_C" >&6 +if test "${ac_cv_type_short+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((short *) 0) + return 0; +if (sizeof (short)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_short=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_short=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 +echo "${ECHO_T}$ac_cv_type_short" >&6 + +echo "$as_me:$LINENO: checking size of short" >&5 +echo $ECHO_N "checking size of short... $ECHO_C" >&6 +if test "${ac_cv_sizeof_short+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_short" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_short=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +long longval () { return (long) (sizeof (short)); } +unsigned long ulongval () { return (long) (sizeof (short)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (short))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (short)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (short)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_short=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_short=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 +echo "${ECHO_T}$ac_cv_sizeof_short" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SHORT $ac_cv_sizeof_short +_ACEOF + + + echo "$as_me:$LINENO: checking for char" >&5 +echo $ECHO_N "checking for char... $ECHO_C" >&6 +if test "${ac_cv_type_char+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((char *) 0) + return 0; +if (sizeof (char)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_char=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_char=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5 +echo "${ECHO_T}$ac_cv_type_char" >&6 + +echo "$as_me:$LINENO: checking size of char" >&5 +echo $ECHO_N "checking size of char... $ECHO_C" >&6 +if test "${ac_cv_sizeof_char+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_char" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (char))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (char))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (char))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_char=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (char), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +long longval () { return (long) (sizeof (char)); } +unsigned long ulongval () { return (long) (sizeof (char)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (char))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (char)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (char)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_char=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (char), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_char=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5 +echo "${ECHO_T}$ac_cv_sizeof_char" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_CHAR $ac_cv_sizeof_char +_ACEOF + + + + echo "$as_me:$LINENO: checking for type equivalent to int8_t" >&5 +echo $ECHO_N "checking for type equivalent to int8_t... $ECHO_C" >&6 + case "$ac_cv_sizeof_char" in + 1) acx_cv_type_int8_t=char ;; + *) { { echo "$as_me:$LINENO: error: no 8-bit type" >&5 +echo "$as_me: error: no 8-bit type" >&2;} + { (exit please report a bug); exit please report a bug; }; } + esac + echo "$as_me:$LINENO: result: $acx_cv_type_int8_t" >&5 +echo "${ECHO_T}$acx_cv_type_int8_t" >&6 + + echo "$as_me:$LINENO: checking for type equivalent to int16_t" >&5 +echo $ECHO_N "checking for type equivalent to int16_t... $ECHO_C" >&6 + case "$ac_cv_sizeof_int:$ac_cv_sizeof_short" in + 2:*) acx_cv_type_int16_t=int ;; + *:2) acx_cv_type_int16_t=short ;; + *) { { echo "$as_me:$LINENO: error: no 16-bit type" >&5 +echo "$as_me: error: no 16-bit type" >&2;} + { (exit please report a bug); exit please report a bug; }; } + esac + echo "$as_me:$LINENO: result: $acx_cv_type_int16_t" >&5 +echo "${ECHO_T}$acx_cv_type_int16_t" >&6 + + echo "$as_me:$LINENO: checking for type equivalent to int32_t" >&5 +echo $ECHO_N "checking for type equivalent to int32_t... $ECHO_C" >&6 + case "$ac_cv_sizeof_int:$ac_cv_sizeof_long" in + 4:*) acx_cv_type_int32_t=int ;; + *:4) acx_cv_type_int32_t=long ;; + *) { { echo "$as_me:$LINENO: error: no 32-bit type" >&5 +echo "$as_me: error: no 32-bit type" >&2;} + { (exit please report a bug); exit please report a bug; }; } + esac + echo "$as_me:$LINENO: result: $acx_cv_type_int32_t" >&5 +echo "${ECHO_T}$acx_cv_type_int32_t" >&6 +fi + +# These tests are here to make the output prettier + +if test "$ac_cv_type_uint64_t" != yes && test "$ac_cv_type_u_int64_t" != yes; then + case "$ac_cv_sizeof_long" in + 8) acx_cv_type_int64_t=long ;; + esac + echo "$as_me:$LINENO: checking for type equivalent to int64_t" >&5 +echo $ECHO_N "checking for type equivalent to int64_t... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: ${acx_cv_type_int64_t-'using preprocessor symbols'}" >&5 +echo "${ECHO_T}${acx_cv_type_int64_t-'using preprocessor symbols'}" >&6 +fi + +# Now we can use the above types + +if test "$ac_cv_type_uintptr_t" != yes; then + echo "$as_me:$LINENO: checking for type equivalent to intptr_t" >&5 +echo $ECHO_N "checking for type equivalent to intptr_t... $ECHO_C" >&6 + case $ac_cv_sizeof_void_p in + 2) acx_cv_type_intptr_t=int16_t ;; + 4) acx_cv_type_intptr_t=int32_t ;; + 8) acx_cv_type_intptr_t=int64_t ;; + *) { { echo "$as_me:$LINENO: error: no equivalent for intptr_t" >&5 +echo "$as_me: error: no equivalent for intptr_t" >&2;} + { (exit please report a bug); exit please report a bug; }; } + esac + echo "$as_me:$LINENO: result: $acx_cv_type_intptr_t" >&5 +echo "${ECHO_T}$acx_cv_type_intptr_t" >&6 +fi + +# ----------------- done all checks, emit header ------------- + ac_config_commands="$ac_config_commands bfd_stdint.h" + + + echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then @@ -11467,7 +17003,9 @@ if test "${target}" = "${host}"; then alpha*-*-*) COREFILE=osf-core.lo ;; arm-*-freebsd* | arm-*-kfreebsd*-gnu) COREFILE='' ;; - arm-*-netbsd*) COREFILE=netbsd-core.lo ;; + arm-*-netbsd* | arm-*-openbsd*) + COREFILE=netbsd-core.lo + ;; arm-*-riscix) COREFILE=trad-core.lo ;; hppa*-*-hpux*) COREFILE=hpux-core.lo ;; hppa*-*-hiux*) COREFILE=hpux-core.lo ;; @@ -11674,7 +17212,9 @@ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext powerpc-*-netbsd*) COREFILE=netbsd-core.lo ;; powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;; s390*-*-*) COREFILE=trad-core.lo ;; - sh*-*-netbsd*) COREFILE=netbsd-core.lo ;; + sh*-*-netbsd* | sh*-*-openbsd*) + COREFILE=netbsd-core.lo + ;; sparc-*-netbsd* | sparc*-*-openbsd*) COREFILE=netbsd-core.lo ;; @@ -13038,7 +18578,7 @@ selarchs="$f" # Target backend .o files. tb= -elf="elf.lo elflink.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo" +elf="elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo" for vec in $selvecs do @@ -13057,6 +18597,10 @@ do arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pe_big_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pe_little_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pei_big_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pei_little_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;; armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;; armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;; armnetbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;; @@ -13067,6 +18611,7 @@ do b_out_vec_big_host) tb="$tb bout.lo aout32.lo" ;; b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;; bfd_efi_app_ia32_vec) tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;; + bfd_efi_app_x86_64_vec) tb="$tb efi-app-x86_64.lo pex64igen.lo cofflink.lo" ;target_size=64;; bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;; bfd_elf32_am33lin_vec) tb="$tb elf32-am33lin.lo elf32.lo $elf" ;; bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;; @@ -13082,6 +18627,7 @@ do bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_bigmips_vxworks_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; + bfd_elf32_cr16_vec) tb="$tb elf32-cr16.lo elf32.lo $elf" ;; bfd_elf32_cr16c_vec) tb="$tb elf32-cr16c.lo elf32.lo $elf" ;; bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; bfd_elf32_crx_vec) tb="$tb elf32-crx.lo elf32.lo $elf" ;; @@ -13127,6 +18673,8 @@ do bfd_elf32_m88k_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;; bfd_elf32_mcore_big_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; + bfd_elf32_mep_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;; + bfd_elf32_mep_little_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;; bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;; bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;; bfd_elf32_mt_vec) tb="$tb elf32-mt.lo elf32.lo $elf" ;; @@ -13143,24 +18691,29 @@ do bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; bfd_elf32_powerpc_vxworks_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; bfd_elf32_s390_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;; + bfd_elf32_bigscore_vec) tb="$tb elf32-score.lo elf32.lo $elf" ;; + bfd_elf32_littlescore_vec) tb="$tb elf32-score.lo elf32.lo $elf" ;; # FIXME: We include cofflink.lo not because it's needed for # bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec # which needs it but does not list it. Should be fixed in right place. - bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf32_sh64lin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf32_sh64blin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; - bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; - bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; - bfd_elf32_shblin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; - bfd_elf32_shl_symbian_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf32.lo $elf coff-sh.lo" ;; - bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64lin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64blin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;; + bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;; + bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shblin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shl_symbian_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shlvxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shvxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;; bfd_elf32_sparc_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;; + bfd_elf32_spu_vec) tb="$tb elf32-spu.lo elf32.lo $elf" ;; bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_us_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; @@ -13192,8 +18745,10 @@ do bfd_elf64_sh64lnbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; bfd_elf64_sh64nbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_sparc_freebsd_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf64_x86_64_freebsd_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;; bfd_mmo_vec) tb="$tb mmo.lo" target_size=64 ;; bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; @@ -13216,6 +18771,7 @@ do i386aout_vec) tb="$tb i386aout.lo aout32.lo" ;; i386bsd_vec) tb="$tb i386bsd.lo aout32.lo" ;; i386coff_vec) tb="$tb coff-i386.lo cofflink.lo" ;; + x86_64coff_vec) tb="$tb coff-x86_64.lo cofflink.lo"; target_size=64 ;; i386dynix_vec) tb="$tb i386dynix.lo aout32.lo" ;; i386freebsd_vec) tb="$tb i386freebsd.lo aout32.lo" ;; i386linux_vec) tb="$tb i386linux.lo aout32.lo" ;; @@ -13227,6 +18783,8 @@ do i386os9k_vec) tb="$tb i386os9k.lo aout32.lo" ;; i386pe_vec) tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;; i386pei_vec) tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;; + x86_64pe_vec) tb="$tb pe-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;; + x86_64pei_vec) tb="$tb pei-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;; i860coff_vec) tb="$tb coff-i860.lo cofflink.lo" ;; icoff_big_vec) tb="$tb coff-i960.lo cofflink.lo" ;; icoff_little_vec) tb="$tb coff-i960.lo cofflink.lo" ;; @@ -13379,7 +18937,7 @@ fi # all_targets is true case ${host64}-${target64}-${want64} in *true*) wordsize=64 - bfd_libs='$(BFD64_LIBS) $(BFD32_LIBS)' + bfd64_libs='$(BFD64_LIBS)' all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)' if test $BFD_HOST_64_BIT_DEFINED = 0; then { echo "$as_me:$LINENO: WARNING: You have requested a 64 bit BFD configuration, but" >&5 @@ -13420,7 +18978,6 @@ echo "$as_me: error: A newer version of gcc is needed for the requested 64-bit B ;; false-false-false) wordsize=32 - bfd_libs='$(BFD32_LIBS)' all_backends='$(BFD32_BACKENDS)' ;; esac @@ -14524,6 +20081,7 @@ esac rm -f doc/config.status ac_config_files="$ac_config_files Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in" + ac_config_commands="$ac_config_commands default" @@ -14643,6 +20201,13 @@ echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${GENINSRC_NEVER_TRUE}" && test -z "${GENINSRC_NEVER_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"GENINSRC_NEVER\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"GENINSRC_NEVER\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi if test -z "${INSTALL_LIBBFD_TRUE}" && test -z "${INSTALL_LIBBFD_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"INSTALL_LIBBFD\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -15086,6 +20651,272 @@ cat >>$CONFIG_STATUS <<_ACEOF AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' +macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' +macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' +enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' +pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' +host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' +host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' +host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' +build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' +build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' +build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' +SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' +Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' +GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' +EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' +FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' +LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' +NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' +LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' +ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' +exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' +lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' +reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' +AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' +STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' +RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' +compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' +GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' +objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' +SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' +ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' +need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' +libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' +version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' +runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' +libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' +soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' +old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' +striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +AR \ +AR_FLAGS \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +SHELL \ +ECHO \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_wl \ +lt_prog_compiler_pic \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_flag_spec_ld \ +hardcode_libdir_separator \ +fix_srcfile_path \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` + ;; +esac + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + +# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it + # from automake. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + + +GCC="$GCC" +CC="$CC" +acx_cv_header_stdint="$acx_cv_header_stdint" +acx_cv_type_int8_t="$acx_cv_type_int8_t" +acx_cv_type_int16_t="$acx_cv_type_int16_t" +acx_cv_type_int32_t="$acx_cv_type_int32_t" +acx_cv_type_int64_t="$acx_cv_type_int64_t" +acx_cv_type_intptr_t="$acx_cv_type_intptr_t" +ac_cv_type_uintmax_t="$ac_cv_type_uintmax_t" +ac_cv_type_uintptr_t="$ac_cv_type_uintptr_t" +ac_cv_type_uint64_t="$ac_cv_type_uint64_t" +ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t" +ac_cv_type_u_int32_t="$ac_cv_type_u_int32_t" +ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t" +ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t" +ac_cv_sizeof_void_p="$ac_cv_sizeof_void_p" + + + _ACEOF @@ -15100,6 +20931,9 @@ do "bfd-in3.h" ) CONFIG_FILES="$CONFIG_FILES bfd-in3.h:bfd-in2.h" ;; "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in:po/Make-in" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool" ) CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; + "bfd_stdint.h" ) CONFIG_COMMANDS="$CONFIG_COMMANDS bfd_stdint.h" ;; "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 @@ -15241,42 +21075,50 @@ s,@AR@,$AR,;t t s,@ac_ct_AR@,$ac_ct_AR,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@LN_S@,$LN_S,;t t s,@LIBTOOL@,$LIBTOOL,;t t +s,@SED@,$SED,;t t +s,@EGREP@,$EGREP,;t t +s,@FGREP@,$FGREP,;t t +s,@GREP@,$GREP,;t t +s,@LD@,$LD,;t t +s,@DUMPBIN@,$DUMPBIN,;t t +s,@ac_ct_DUMPBIN@,$ac_ct_DUMPBIN,;t t +s,@NM@,$NM,;t t +s,@LN_S@,$LN_S,;t t +s,@lt_ECHO@,$lt_ECHO,;t t +s,@CPP@,$CPP,;t t +s,@DEBUGDIR@,$DEBUGDIR,;t t +s,@PKGVERSION@,$PKGVERSION,;t t +s,@REPORT_BUGS_TO@,$REPORT_BUGS_TO,;t t +s,@REPORT_BUGS_TEXI@,$REPORT_BUGS_TEXI,;t t s,@WARN_CFLAGS@,$WARN_CFLAGS,;t t s,@NO_WERROR@,$NO_WERROR,;t t s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t s,@MAINT@,$MAINT,;t t +s,@GENINSRC_NEVER_TRUE@,$GENINSRC_NEVER_TRUE,;t t +s,@GENINSRC_NEVER_FALSE@,$GENINSRC_NEVER_FALSE,;t t s,@INSTALL_LIBBFD_TRUE@,$INSTALL_LIBBFD_TRUE,;t t s,@INSTALL_LIBBFD_FALSE@,$INSTALL_LIBBFD_FALSE,;t t s,@host_noncanonical@,$host_noncanonical,;t t s,@target_noncanonical@,$target_noncanonical,;t t s,@bfdlibdir@,$bfdlibdir,;t t s,@bfdincludedir@,$bfdincludedir,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@ALLOCA@,$ALLOCA,;t t s,@USE_NLS@,$USE_NLS,;t t -s,@MSGFMT@,$MSGFMT,;t t -s,@GMSGFMT@,$GMSGFMT,;t t +s,@LIBINTL@,$LIBINTL,;t t +s,@LIBINTL_DEP@,$LIBINTL_DEP,;t t +s,@INCINTL@,$INCINTL,;t t s,@XGETTEXT@,$XGETTEXT,;t t -s,@USE_INCLUDED_LIBINTL@,$USE_INCLUDED_LIBINTL,;t t -s,@CATALOGS@,$CATALOGS,;t t -s,@CATOBJEXT@,$CATOBJEXT,;t t -s,@DATADIRNAME@,$DATADIRNAME,;t t -s,@GMOFILES@,$GMOFILES,;t t -s,@INSTOBJEXT@,$INSTOBJEXT,;t t -s,@INTLDEPS@,$INTLDEPS,;t t -s,@INTLLIBS@,$INTLLIBS,;t t -s,@INTLOBJS@,$INTLOBJS,;t t -s,@POFILES@,$POFILES,;t t +s,@GMSGFMT@,$GMSGFMT,;t t s,@POSUB@,$POSUB,;t t -s,@INCLUDE_LOCALE_H@,$INCLUDE_LOCALE_H,;t t -s,@GT_NO@,$GT_NO,;t t -s,@GT_YES@,$GT_YES,;t t +s,@CATALOGS@,$CATALOGS,;t t +s,@DATADIRNAME@,$DATADIRNAME,;t t +s,@INSTOBJEXT@,$INSTOBJEXT,;t t +s,@GENCAT@,$GENCAT,;t t +s,@CATOBJEXT@,$CATOBJEXT,;t t s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t -s,@l@,$l,;t t +s,@MSGFMT@,$MSGFMT,;t t +s,@MSGMERGE@,$MSGMERGE,;t t s,@HDEFINES@,$HDEFINES,;t t s,@BFD_HOST_64BIT_LONG@,$BFD_HOST_64BIT_LONG,;t t s,@BFD_HOST_LONG_LONG@,$BFD_HOST_LONG_LONG,;t t @@ -15291,7 +21133,7 @@ s,@WIN32LDFLAGS@,$WIN32LDFLAGS,;t t s,@WIN32LIBADD@,$WIN32LIBADD,;t t s,@TDEFINES@,$TDEFINES,;t t s,@wordsize@,$wordsize,;t t -s,@bfd_libs@,$bfd_libs,;t t +s,@bfd64_libs@,$bfd64_libs,;t t s,@all_backends@,$all_backends,;t t s,@bfd_backends@,$bfd_backends,;t t s,@bfd_machines@,$bfd_machines,;t t @@ -15986,7 +21828,1002 @@ echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} done done ;; - default ) sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' -e '/BLD-POTFILES =/r po/BLD-POTFILES' po/Makefile.in > po/Makefile ;; + libtool ) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me (GNU $PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007 Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# 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 2 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, a copy can be downloaded from +# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that does not interpret backslashes. +ECHO=$lt_ECHO + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[^=]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=\$$1\$2" +} +_LT_EOF + ;; + esac + + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + default-1 ) + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assigment from automake. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + GMOFILES= + UPDATEPOFILES= + DUMMYPOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done ;; + bfd_stdint.h ) +if test "$GCC" = yes; then + echo "/* generated for " `$CC --version | sed 1q` "*/" > tmp-stdint.h +else + echo "/* generated for $CC */" > tmp-stdint.h +fi + +sed 's/^ *//' >> tmp-stdint.h < +EOF + +if test "$acx_cv_header_stdint" != stdint.h; then + echo "#include " >> tmp-stdint.h +fi +if test "$acx_cv_header_stdint" != stddef.h; then + echo "#include <$acx_cv_header_stdint>" >> tmp-stdint.h +fi + +sed 's/^ *//' >> tmp-stdint.h <> tmp-stdint.h <> tmp-stdint.h <> tmp-stdint.h <> tmp-stdint.h <> tmp-stdint.h <> tmp-stdint.h <> tmp-stdint.h <= 199901L + #ifndef _INT64_T + #define _INT64_T + #ifndef __int64_t_defined + typedef long long int64_t; + #endif + #endif + #ifndef _UINT64_T + #define _UINT64_T + typedef unsigned long long uint64_t; + #endif + + #elif defined __GNUC__ && defined (__STDC__) && __STDC__-0 + /* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and + does not implement __extension__. But that compiler doesn't define + __GNUC_MINOR__. */ + # if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__) + # define __extension__ + # endif + + # ifndef _INT64_T + # define _INT64_T + __extension__ typedef long long int64_t; + # endif + # ifndef _UINT64_T + # define _UINT64_T + __extension__ typedef unsigned long long uint64_t; + # endif + + #elif !defined __STRICT_ANSI__ + # if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ + + # ifndef _INT64_T + # define _INT64_T + typedef __int64 int64_t; + # endif + # ifndef _UINT64_T + # define _UINT64_T + typedef unsigned __int64 uint64_t; + # endif + # endif /* compiler */ + + #endif /* ANSI version */ +EOF +fi + +# ------------- done int64_t types, emit intptr types ------------ +if test "$ac_cv_type_uintptr_t" != yes; then + sed 's/^ *//' >> tmp-stdint.h <> tmp-stdint.h <> tmp-stdint.h <> tmp-stdint.h <> tmp-stdint.h < po/Makefile ;; esac done _ACEOF diff --git a/bfd/configure.in b/bfd/configure.in index 212f96142fd..1ea98ae0259 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -8,7 +8,7 @@ AC_CONFIG_SRCDIR([libbfd.c]) AC_CANONICAL_TARGET AC_ISC_POSIX -AM_INIT_AUTOMAKE(bfd, 2.17) +AM_INIT_AUTOMAKE(bfd, 2.17.50) dnl These must be called before AM_PROG_LIBTOOL, because it may want dnl to call AC_CHECK_PROG. @@ -19,7 +19,10 @@ dnl Default to a non shared library. This may be overridden by the dnl configure option --enable-shared. AM_DISABLE_SHARED -AM_PROG_LIBTOOL +AC_PROG_CC +AC_GNU_SOURCE + +AC_PROG_LIBTOOL AC_ARG_ENABLE(64-bit-bfd, [ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)], @@ -63,6 +66,17 @@ if test $use_secureplt = true; then [Define if we should default to creating read-only plt entries]) fi +DEBUGDIR=${libdir}/debug + +AC_ARG_WITH(separate-debug-dir, + AS_HELP_STRING([--with-separate-debug-dir=DIR], + [Look for global separate debug info in DIR [[default=LIBDIR/debug]]]), +[DEBUGDIR="${withval}"]) +AC_SUBST(DEBUGDIR) + +ACX_PKGVERSION([GNU Binutils]) +ACX_BUGURL([http://www.sourceware.org/bugzilla/]) + AM_BINUTILS_WARNINGS AM_CONFIG_HEADER(config.h:config.in) @@ -72,6 +86,7 @@ if test -z "$target" ; then fi AM_MAINTAINER_MODE +AM_CONDITIONAL(GENINSRC_NEVER, false) AM_INSTALL_LIBBFD AC_EXEEXT @@ -81,11 +96,9 @@ bfd_default_target_size=32 # host stuff: -AC_PROG_CC -AC_GNU_SOURCE - ALL_LINGUAS="fr tr ja es sv da zh_CN ro rw vi" -CY_GNU_GETTEXT +ZW_GNU_GETTEXT_SISTER_DIR +AM_PO_SUBDIRS # Permit host specific settings. . ${srcdir}/configure.host @@ -135,6 +148,7 @@ BFD_CC_FOR_BUILD AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h) AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h) +GCC_HEADER_STDINT(bfd_stdint.h) AC_HEADER_TIME AC_HEADER_DIRENT ACX_HEADER_STRING @@ -178,7 +192,9 @@ if test "${target}" = "${host}"; then alpha*-*-*) COREFILE=osf-core.lo ;; arm-*-freebsd* | arm-*-kfreebsd*-gnu) COREFILE='' ;; - arm-*-netbsd*) COREFILE=netbsd-core.lo ;; + arm-*-netbsd* | arm-*-openbsd*) + COREFILE=netbsd-core.lo + ;; arm-*-riscix) COREFILE=trad-core.lo ;; hppa*-*-hpux*) COREFILE=hpux-core.lo ;; hppa*-*-hiux*) COREFILE=hpux-core.lo ;; @@ -361,7 +377,9 @@ changequote([,])dnl powerpc-*-netbsd*) COREFILE=netbsd-core.lo ;; powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;; s390*-*-*) COREFILE=trad-core.lo ;; - sh*-*-netbsd*) COREFILE=netbsd-core.lo ;; + sh*-*-netbsd* | sh*-*-openbsd*) + COREFILE=netbsd-core.lo + ;; sparc-*-netbsd* | sparc*-*-openbsd*) COREFILE=netbsd-core.lo ;; @@ -551,7 +569,7 @@ selarchs="$f" # Target backend .o files. tb= -elf="elf.lo elflink.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo" +elf="elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo" for vec in $selvecs do @@ -570,6 +588,10 @@ do arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pe_big_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pe_little_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pei_big_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pei_little_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;; armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;; armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;; armnetbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;; @@ -580,6 +602,7 @@ do b_out_vec_big_host) tb="$tb bout.lo aout32.lo" ;; b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;; bfd_efi_app_ia32_vec) tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;; + bfd_efi_app_x86_64_vec) tb="$tb efi-app-x86_64.lo pex64igen.lo cofflink.lo" ;target_size=64;; bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;; bfd_elf32_am33lin_vec) tb="$tb elf32-am33lin.lo elf32.lo $elf" ;; bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;; @@ -595,6 +618,7 @@ do bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_bigmips_vxworks_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; + bfd_elf32_cr16_vec) tb="$tb elf32-cr16.lo elf32.lo $elf" ;; bfd_elf32_cr16c_vec) tb="$tb elf32-cr16c.lo elf32.lo $elf" ;; bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; bfd_elf32_crx_vec) tb="$tb elf32-crx.lo elf32.lo $elf" ;; @@ -640,6 +664,8 @@ do bfd_elf32_m88k_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;; bfd_elf32_mcore_big_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; + bfd_elf32_mep_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;; + bfd_elf32_mep_little_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;; bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;; bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;; bfd_elf32_mt_vec) tb="$tb elf32-mt.lo elf32.lo $elf" ;; @@ -656,24 +682,29 @@ do bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; bfd_elf32_powerpc_vxworks_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; bfd_elf32_s390_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;; + bfd_elf32_bigscore_vec) tb="$tb elf32-score.lo elf32.lo $elf" ;; + bfd_elf32_littlescore_vec) tb="$tb elf32-score.lo elf32.lo $elf" ;; # FIXME: We include cofflink.lo not because it's needed for # bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec # which needs it but does not list it. Should be fixed in right place. - bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf32_sh64lin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf32_sh64blin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; - bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; - bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; - bfd_elf32_shblin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; - bfd_elf32_shl_symbian_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf32.lo $elf coff-sh.lo" ;; - bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64lin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64blin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;; + bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;; + bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shblin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shl_symbian_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shlvxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shvxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;; bfd_elf32_sparc_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;; + bfd_elf32_spu_vec) tb="$tb elf32-spu.lo elf32.lo $elf" ;; bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_us_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; @@ -705,8 +736,10 @@ do bfd_elf64_sh64lnbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; bfd_elf64_sh64nbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_sparc_freebsd_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf64_x86_64_freebsd_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;; bfd_mmo_vec) tb="$tb mmo.lo" target_size=64 ;; bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; @@ -729,6 +762,7 @@ do i386aout_vec) tb="$tb i386aout.lo aout32.lo" ;; i386bsd_vec) tb="$tb i386bsd.lo aout32.lo" ;; i386coff_vec) tb="$tb coff-i386.lo cofflink.lo" ;; + x86_64coff_vec) tb="$tb coff-x86_64.lo cofflink.lo"; target_size=64 ;; i386dynix_vec) tb="$tb i386dynix.lo aout32.lo" ;; i386freebsd_vec) tb="$tb i386freebsd.lo aout32.lo" ;; i386linux_vec) tb="$tb i386linux.lo aout32.lo" ;; @@ -740,6 +774,8 @@ do i386os9k_vec) tb="$tb i386os9k.lo aout32.lo" ;; i386pe_vec) tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;; i386pei_vec) tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;; + x86_64pe_vec) tb="$tb pe-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;; + x86_64pei_vec) tb="$tb pei-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;; i860coff_vec) tb="$tb coff-i860.lo cofflink.lo" ;; icoff_big_vec) tb="$tb coff-i960.lo cofflink.lo" ;; icoff_little_vec) tb="$tb coff-i960.lo cofflink.lo" ;; @@ -890,7 +926,7 @@ fi # all_targets is true case ${host64}-${target64}-${want64} in *true*) wordsize=64 - bfd_libs='$(BFD64_LIBS) $(BFD32_LIBS)' + bfd64_libs='$(BFD64_LIBS)' all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)' if test $BFD_HOST_64_BIT_DEFINED = 0; then AC_MSG_WARN([You have requested a 64 bit BFD configuration, but]) @@ -911,13 +947,12 @@ case ${host64}-${target64}-${want64} in ;; false-false-false) wordsize=32 - bfd_libs='$(BFD32_LIBS)' all_backends='$(BFD32_BACKENDS)' ;; esac AC_SUBST(wordsize) -AC_SUBST(bfd_libs) +AC_SUBST(bfd64_libs) AC_SUBST(all_backends) AC_SUBST(bfd_backends) AC_SUBST(bfd_machines) @@ -962,7 +997,28 @@ esac rm -f doc/config.status AC_CONFIG_FILES([Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in]) -AC_CONFIG_COMMANDS([default],[[sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' -e '/BLD-POTFILES =/r po/BLD-POTFILES' po/Makefile.in > po/Makefile]],[[]]) + +dnl We need this duplication, even though we use AM_PO_SUBDIRS, because of +dnl our two separate POTFILES. Yuck. +AC_CONFIG_COMMANDS([default], +[[ +case "$srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; +esac +POFILES= +GMOFILES= +for lang in dummy $OBSOLETE_ALL_LINGUAS; do + if test $lang != dummy; then + POFILES="$POFILES $srcdirpre$lang.po" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + fi +done +sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' \ + -e '/BLD-POTFILES =/r po/BLD-POTFILES' \ + -e "s,@POFILES@,$POFILES," \ + -e "s,@GMOFILES@,$GMOFILES," \ + po/Makefile.in > po/Makefile]],[[]]) dnl Required by html and install-html AC_SUBST(datarootdir) diff --git a/bfd/corefile.c b/bfd/corefile.c index 602de911a2c..58cd7f613f6 100644 --- a/bfd/corefile.c +++ b/bfd/corefile.c @@ -1,6 +1,6 @@ /* Core file generic interface routines for BFD. - Copyright 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2002, 2003, 2005 - Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2002, 2003, 2005, + 2007 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -30,8 +30,8 @@ DESCRIPTION These are functions pertaining to core files. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" /* diff --git a/bfd/cpu-alpha.c b/bfd/cpu-alpha.c index 48b748d9f36..db7abfbdb29 100644 --- a/bfd/cpu-alpha.c +++ b/bfd/cpu-alpha.c @@ -1,5 +1,5 @@ /* BFD support for the Alpha architecture. - Copyright 1992, 1993, 1998, 2000, 2002, 2003 + Copyright 1992, 1993, 1998, 2000, 2002, 2003, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #define N(BITS_WORD, BITS_ADDR, NUMBER, PRINT, DEFAULT, NEXT) \ diff --git a/bfd/cpu-arc.c b/bfd/cpu-arc.c index ef97da0eda2..bf9a739149f 100644 --- a/bfd/cpu-arc.c +++ b/bfd/cpu-arc.c @@ -1,5 +1,6 @@ /* BFD support for the ARC processor - Copyright 1994, 1995, 1997, 2001, 2002 Free Software Foundation, Inc. + Copyright 1994, 1995, 1997, 2001, 2002, 2007 + Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +19,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #define ARC(mach, print_name, default_p, next) \ diff --git a/bfd/cpu-arm.c b/bfd/cpu-arm.c index a28a1f9e8fc..a44b98395ee 100644 --- a/bfd/cpu-arm.c +++ b/bfd/cpu-arm.c @@ -1,5 +1,5 @@ /* BFD support for the ARM processor - Copyright 1994, 1997, 1999, 2000, 2002, 2003, 2004, 2005 + Copyright 1994, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) @@ -19,8 +19,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libiberty.h" @@ -92,7 +92,8 @@ processors[] = { bfd_mach_arm_4, "strongarm1100" }, { bfd_mach_arm_XScale, "xscale" }, { bfd_mach_arm_ep9312, "ep9312" }, - { bfd_mach_arm_iWMMXt, "iwmmxt" } + { bfd_mach_arm_iWMMXt, "iwmmxt" }, + { bfd_mach_arm_iWMMXt2, "iwmmxt2" } }; static bfd_boolean @@ -137,7 +138,8 @@ static const bfd_arch_info_type arch_info_struct[] = N (bfd_mach_arm_5TE, "armv5te", FALSE, & arch_info_struct[9]), N (bfd_mach_arm_XScale, "xscale", FALSE, & arch_info_struct[10]), N (bfd_mach_arm_ep9312, "ep9312", FALSE, & arch_info_struct[11]), - N (bfd_mach_arm_iWMMXt,"iwmmxt", FALSE, NULL) + N (bfd_mach_arm_iWMMXt, "iwmmxt", FALSE, & arch_info_struct[12]), + N (bfd_mach_arm_iWMMXt2, "iwmmxt2", FALSE, NULL) }; const bfd_arch_info_type bfd_arm_arch = @@ -179,7 +181,9 @@ bfd_arm_merge_machines (bfd *ibfd, bfd *obfd) Intel XScale binary, since these architecture have co-processors which will not both be present on the same physical hardware. */ else if (in == bfd_mach_arm_ep9312 - && (out == bfd_mach_arm_XScale || out == bfd_mach_arm_iWMMXt)) + && (out == bfd_mach_arm_XScale + || out == bfd_mach_arm_iWMMXt + || out == bfd_mach_arm_iWMMXt2)) { _bfd_error_handler (_("\ ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale"), @@ -188,7 +192,9 @@ ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale"), return FALSE; } else if (out == bfd_mach_arm_ep9312 - && (in == bfd_mach_arm_XScale || in == bfd_mach_arm_iWMMXt)) + && (in == bfd_mach_arm_XScale + || in == bfd_mach_arm_iWMMXt + || in == bfd_mach_arm_iWMMXt2)) { _bfd_error_handler (_("\ ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale"), @@ -309,6 +315,7 @@ bfd_arm_update_notes (bfd *abfd, const char *note_section) case bfd_mach_arm_XScale: expected = "XScale"; break; case bfd_mach_arm_ep9312: expected = "ep9312"; break; case bfd_mach_arm_iWMMXt: expected = "iWMMXt"; break; + case bfd_mach_arm_iWMMXt2: expected = "iWMMXt2"; break; } if (strcmp (arch_string, expected) != 0) @@ -355,7 +362,8 @@ architectures[] = { "armv5te", bfd_mach_arm_5TE }, { "XScale", bfd_mach_arm_XScale }, { "ep9312", bfd_mach_arm_ep9312 }, - { "iWMMXt", bfd_mach_arm_iWMMXt } + { "iWMMXt", bfd_mach_arm_iWMMXt }, + { "iWMMXt2", bfd_mach_arm_iWMMXt2 } }; /* Extract the machine number stored in a note section. */ @@ -402,14 +410,22 @@ bfd_arm_get_mach_from_notes (bfd *abfd, const char *note_section) } bfd_boolean -bfd_is_arm_mapping_symbol_name (const char * name) +bfd_is_arm_special_symbol_name (const char * name, int type) { /* The ARM compiler outputs several obsolete forms. Recognize them - in addition to the standard $a, $t and $d. */ - return (name != NULL) - && (name[0] == '$') - && ((name[1] == 'a') || (name[1] == 't') || (name[1] == 'd') - || (name[1] == 'm') || (name[1] == 'f') || (name[1] == 'p')) - && (name[2] == 0 || name[2] == '.'); + in addition to the standard $a, $t and $d. We are somewhat loose + in what we accept here, since the full set is not documented. */ + if (!name || name[0] != '$') + return FALSE; + if (name[1] == 'a' || name[1] == 't' || name[1] == 'd') + type &= BFD_ARM_SPECIAL_SYM_TYPE_MAP; + else if (name[1] == 'm' || name[1] == 'f' || name[1] == 'p') + type &= BFD_ARM_SPECIAL_SYM_TYPE_TAG; + else if (name[1] >= 'a' && name[1] <= 'z') + type &= BFD_ARM_SPECIAL_SYM_TYPE_OTHER; + else + return FALSE; + + return (type != 0 && (name[2] == 0 || name[2] == '.')); } diff --git a/bfd/cpu-avr.c b/bfd/cpu-avr.c index 4c8c193f616..82b282ac22f 100644 --- a/bfd/cpu-avr.c +++ b/bfd/cpu-avr.c @@ -1,5 +1,5 @@ /* BFD library support routines for the AVR architecture. - Copyright 1999, 2000, 2002, 2006 Free Software Foundation, Inc. + Copyright 1999, 2000, 2002, 2006, 2007 Free Software Foundation, Inc. Contributed by Denis Chertykov This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" /* This routine is provided two arch_infos and works out which AVR @@ -82,7 +82,10 @@ static const bfd_arch_info_type arch_info_struct[] = N (16, bfd_mach_avr4, "avr:4", FALSE, & arch_info_struct[4]), /* ATmega161, ATmega163, ATmega32, AT94K. */ - N (22, bfd_mach_avr5, "avr:5", FALSE, NULL) + N (22, bfd_mach_avr5, "avr:5", FALSE, & arch_info_struct[5]), + + /* ATmega256x. */ + N (22, bfd_mach_avr6, "avr:6", FALSE, NULL) }; const bfd_arch_info_type bfd_avr_arch = diff --git a/bfd/cpu-bfin.c b/bfd/cpu-bfin.c index 6de6757a9a8..e30ee37d08c 100644 --- a/bfd/cpu-bfin.c +++ b/bfd/cpu-bfin.c @@ -1,6 +1,6 @@ /* BFD Support for the ADI Blackfin processor. - Copyright 2005 Free Software Foundation, Inc. + Copyright 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_bfin_arch = diff --git a/bfd/cpu-cr16.c b/bfd/cpu-cr16.c new file mode 100644 index 00000000000..5695f0eda87 --- /dev/null +++ b/bfd/cpu-cr16.c @@ -0,0 +1,40 @@ +/* BFD support for the CR16 processor. + Copyright 2007 Free Software Foundation, Inc. + Written by M R Swami Reddy + + This file is part of BFD, the Binary File Descriptor library. + + 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 2 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 "libbfd.h" + + +const bfd_arch_info_type bfd_cr16_arch = + { + 16, /* 16 bits in a word. */ + 32, /* 32 bits in an address. */ + 8, /* 8 bits in a byte. */ + bfd_arch_cr16, /* enum bfd_architecture arch. */ + bfd_mach_cr16, + "cr16", /* Arch name. */ + "cr16", /* Printable name. */ + 1, /* Unsigned int section alignment power. */ + TRUE, /* The one and only. */ + bfd_default_compatible, + bfd_default_scan , + 0, + }; diff --git a/bfd/cpu-cr16c.c b/bfd/cpu-cr16c.c index 1ab39ed6fec..08eea01a84e 100644 --- a/bfd/cpu-cr16c.c +++ b/bfd/cpu-cr16c.c @@ -1,5 +1,5 @@ /* BFD support for the CR16C processor. - Copyright 2004 Free Software Foundation, Inc. + Copyright 2004, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_cr16c_arch = diff --git a/bfd/cpu-cris.c b/bfd/cpu-cris.c index e89d74b5055..0e6c24d32f8 100644 --- a/bfd/cpu-cris.c +++ b/bfd/cpu-cris.c @@ -1,5 +1,6 @@ /* BFD support for the Axis CRIS architecture. - Copyright 2000, 2002, 2004, 2005 Free Software Foundation, Inc. + Copyright 2000, 2002, 2004, 2005, 2007 + Free Software Foundation, Inc. Contributed by Axis Communications AB. Written by Hans-Peter Nilsson. @@ -19,8 +20,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" /* This routine is provided two arch_infos and returns the lowest common diff --git a/bfd/cpu-crx.c b/bfd/cpu-crx.c index 9605dd578f4..855d2e6d9aa 100644 --- a/bfd/cpu-crx.c +++ b/bfd/cpu-crx.c @@ -1,5 +1,5 @@ /* BFD support for the CRX processor. - Copyright 2004 Free Software Foundation, Inc. + Copyright 2004, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" diff --git a/bfd/cpu-d10v.c b/bfd/cpu-d10v.c index 18061a13797..77ca6ff4974 100644 --- a/bfd/cpu-d10v.c +++ b/bfd/cpu-d10v.c @@ -1,5 +1,6 @@ /* BFD support for the D10V processor - Copyright 1996, 1999, 2000, 2002, 2005 Free Software Foundation, Inc. + Copyright 1996, 1999, 2000, 2002, 2005, 2007 + Free Software Foundation, Inc. Contributed by Martin Hunt (hunt@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +20,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" static const bfd_arch_info_type d10v_ts3_info = diff --git a/bfd/cpu-d30v.c b/bfd/cpu-d30v.c index 5346cb3219f..cec22428b22 100644 --- a/bfd/cpu-d30v.c +++ b/bfd/cpu-d30v.c @@ -1,5 +1,5 @@ /* BFD support for the Mitsubishi D30V processor - Copyright 1997, 2002, 2005 Free Software Foundation, Inc. + Copyright 1997, 2002, 2005, 2007 Free Software Foundation, Inc. Contributed by Martin Hunt (hunt@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_d30v_arch = diff --git a/bfd/cpu-dlx.c b/bfd/cpu-dlx.c index d4771cae7a7..f71ed098bef 100644 --- a/bfd/cpu-dlx.c +++ b/bfd/cpu-dlx.c @@ -1,5 +1,5 @@ /* BFD support for the DLX Microprocessor architecture. - Copyright 2002 Free Software Foundation, Inc. + Copyright 2002, 2007 Free Software Foundation, Inc. Hacked by Kuang Hwa Lin This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_dlx_arch = diff --git a/bfd/cpu-fr30.c b/bfd/cpu-fr30.c index 585d820b84a..fd3057436d6 100644 --- a/bfd/cpu-fr30.c +++ b/bfd/cpu-fr30.c @@ -1,5 +1,5 @@ /* BFD support for the FR30 processor. - Copyright 1998, 2002 Free Software Foundation, Inc. + Copyright 1998, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_fr30_arch = diff --git a/bfd/cpu-frv.c b/bfd/cpu-frv.c index f80066b9bba..4d803095c78 100644 --- a/bfd/cpu-frv.c +++ b/bfd/cpu-frv.c @@ -1,5 +1,5 @@ /* BFD support for the FRV processor. - Copyright 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright 2002, 2003, 2004, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #define FRV_ARCH(MACHINE, NAME, DEFAULT, NEXT) \ diff --git a/bfd/cpu-h8300.c b/bfd/cpu-h8300.c index e7a2bf263ea..cb9d0d8715b 100644 --- a/bfd/cpu-h8300.c +++ b/bfd/cpu-h8300.c @@ -1,6 +1,6 @@ /* BFD library support routines for the Renesas H8/300 architecture. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 2000, 2001, 2002, - 2003, 2004 Free Software Foundation, Inc. + 2003, 2004, 2007 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" static bfd_boolean diff --git a/bfd/cpu-h8500.c b/bfd/cpu-h8500.c index 11193275eec..78788aec66a 100644 --- a/bfd/cpu-h8500.c +++ b/bfd/cpu-h8500.c @@ -1,5 +1,5 @@ /* BFD library support routines for the H8/500 architecture. - Copyright 1993, 1995, 1999, 2000, 2001, 2002, 2003, 2005 + Copyright 1993, 1995, 1999, 2000, 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support. @@ -19,8 +19,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" static bfd_boolean scan_mach diff --git a/bfd/cpu-hppa.c b/bfd/cpu-hppa.c index de9d1f43b27..b11ce8d94b2 100644 --- a/bfd/cpu-hppa.c +++ b/bfd/cpu-hppa.c @@ -1,5 +1,5 @@ /* BFD support for the HP Precision Architecture architecture. - Copyright 1992, 1995, 1998, 1999, 2000, 2002, 2003 + Copyright 1992, 1995, 1998, 1999, 2000, 2002, 2003, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" static const bfd_arch_info_type bfd_hppa10_arch = diff --git a/bfd/cpu-i370.c b/bfd/cpu-i370.c index d7d712f3ff9..1fa97580602 100644 --- a/bfd/cpu-i370.c +++ b/bfd/cpu-i370.c @@ -1,5 +1,5 @@ /* BFD i370 CPU definition - Copyright 1994, 1995, 1996, 1998, 1999, 2000, 2002, 2005 + Copyright 1994, 1995, 1996, 1998, 1999, 2000, 2002, 2005, 2007 Free Software Foundation, Inc. Contributed by Ian Lance Taylor, Cygnus Support. Hacked by Linas Vepstas in 1998, 1999 @@ -21,8 +21,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" static const bfd_arch_info_type arch_info_struct[] = diff --git a/bfd/cpu-i386.c b/bfd/cpu-i386.c index 8886c47d0a0..339c7d99400 100644 --- a/bfd/cpu-i386.c +++ b/bfd/cpu-i386.c @@ -1,5 +1,5 @@ /* BFD support for the Intel 386 architecture. - Copyright 1992, 1994, 1995, 1996, 1998, 2000, 2001, 2002, 2004 + Copyright 1992, 1994, 1995, 1996, 1998, 2000, 2001, 2002, 2004, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_x86_64_arch_intel_syntax = diff --git a/bfd/cpu-i860.c b/bfd/cpu-i860.c index 33262fe553d..df38ddfc9ba 100644 --- a/bfd/cpu-i860.c +++ b/bfd/cpu-i860.c @@ -1,5 +1,6 @@ /* BFD support for the Intel 860 architecture. - Copyright 1992, 1995, 2000, 2002 Free Software Foundation, Inc. + Copyright 1992, 1995, 2000, 2002, 2007 + Free Software Foundation, Inc. Created mostly by substituting "860" for "386" in cpu-i386.c Harry Dolan , October 1995 @@ -19,8 +20,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_i860_arch = diff --git a/bfd/cpu-i960.c b/bfd/cpu-i960.c index 7a9be7ca640..3569aac789d 100644 --- a/bfd/cpu-i960.c +++ b/bfd/cpu-i960.c @@ -1,26 +1,26 @@ /* BFD library support routines for the i960 architecture. - Copyright 1990, 1991, 1993, 1994, 1996, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + Copyright 1990, 1991, 1993, 1994, 1996, 1999, 2000, 2001, 2002, 2006, + 2007 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -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 2 of the License, or -(at your option) any later version. + 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 2 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. + 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. */ + 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" static bfd_boolean scan_960_mach @@ -57,7 +57,7 @@ scan_960_mach (ap, string) } /* In some bfds the cpu-id is written as "80960KA", "80960KB", "80960CA" or "80960MC". */ - else if (strncmp ("80960", string, 5) == 0) + else if (CONST_STRNEQ (string, "80960")) { string += 5; diff --git a/bfd/cpu-ia64.c b/bfd/cpu-ia64.c index e172f5a85f2..a38d24de41b 100644 --- a/bfd/cpu-ia64.c +++ b/bfd/cpu-ia64.c @@ -1,5 +1,5 @@ /* BFD support for the ia64 architecture. - Copyright 1998, 1999, 2000, 2002 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2002, 2007 Free Software Foundation, Inc. Contributed by David Mosberger-Tang This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_ia64_elf32_arch = diff --git a/bfd/cpu-ip2k.c b/bfd/cpu-ip2k.c index a03df757af6..9e303d744c5 100644 --- a/bfd/cpu-ip2k.c +++ b/bfd/cpu-ip2k.c @@ -1,5 +1,5 @@ /* BFD support for the Scenix IP2xxx processor. - Copyright 2000, 2002 Free Software Foundation, Inc. + Copyright 2000, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_ip2k_nonext_arch = diff --git a/bfd/cpu-iq2000.c b/bfd/cpu-iq2000.c index c3331db05be..ace95e2780e 100644 --- a/bfd/cpu-iq2000.c +++ b/bfd/cpu-iq2000.c @@ -1,5 +1,5 @@ /* BFD support for the Vitesse IQ2000 processor. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" static const bfd_arch_info_type arch_info_struct[] = diff --git a/bfd/cpu-m10200.c b/bfd/cpu-m10200.c index 6f511113906..d3d596f2d34 100644 --- a/bfd/cpu-m10200.c +++ b/bfd/cpu-m10200.c @@ -1,5 +1,5 @@ /* BFD support for the Matsushita 10200 processor - Copyright 1996, 1997, 2002 Free Software Foundation, Inc. + Copyright 1996, 1997, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_mn10200_arch = diff --git a/bfd/cpu-m10300.c b/bfd/cpu-m10300.c index c417928d83f..7aece6e69d7 100644 --- a/bfd/cpu-m10300.c +++ b/bfd/cpu-m10300.c @@ -1,5 +1,5 @@ /* BFD support for the Matsushita 10300 processor - Copyright 1996, 1997, 1999, 2000, 2002, 2003 + Copyright 1996, 1997, 1999, 2000, 2002, 2003, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_am33_2_arch = diff --git a/bfd/cpu-m32c.c b/bfd/cpu-m32c.c index e60b746ffc2..f61ff980f63 100644 --- a/bfd/cpu-m32c.c +++ b/bfd/cpu-m32c.c @@ -1,5 +1,5 @@ /* BFD support for the M16C/M32C processors. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" static const bfd_arch_info_type arch_info_struct[] = diff --git a/bfd/cpu-m32r.c b/bfd/cpu-m32r.c index 0b5c8dafcda..dbc742a1c10 100644 --- a/bfd/cpu-m32r.c +++ b/bfd/cpu-m32r.c @@ -1,5 +1,6 @@ /* BFD support for the M32R processor. - Copyright 1996, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. + Copyright 1996, 1999, 2000, 2002, 2003, 2007 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #define N(number, print, default, next) \ diff --git a/bfd/cpu-m68hc11.c b/bfd/cpu-m68hc11.c index 386d2480de6..e293a2cf5dc 100644 --- a/bfd/cpu-m68hc11.c +++ b/bfd/cpu-m68hc11.c @@ -1,5 +1,5 @@ /* BFD support for the Motorola 68HC11 processor - Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_m68hc11_arch = diff --git a/bfd/cpu-m68hc12.c b/bfd/cpu-m68hc12.c index 43520a1028f..52c4f2f23e6 100644 --- a/bfd/cpu-m68hc12.c +++ b/bfd/cpu-m68hc12.c @@ -1,5 +1,5 @@ /* BFD support for the Motorola 68HC12 processor - Copyright 1999, 2000, 2002, 2003 Free Software Foundation, Inc. + Copyright 1999, 2000, 2002, 2003, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_m68hc12s_arch = diff --git a/bfd/cpu-m68k.c b/bfd/cpu-m68k.c index 5be4aa047cc..07abf9da130 100644 --- a/bfd/cpu-m68k.c +++ b/bfd/cpu-m68k.c @@ -1,6 +1,6 @@ /* BFD library support routines for architectures. Copyright 1990, 1991, 1992, 1993, 1994, 1997, 1998, 2000, 2001, 2002, - 2003, 2004, 2006 Free Software Foundation, Inc. + 2003, 2004, 2006, 2007 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "opcode/m68k.h" @@ -41,53 +41,60 @@ static const bfd_arch_info_type arch_info_struct[] = N(bfd_mach_m68040, "m68k:68040", FALSE, &arch_info_struct[6]), N(bfd_mach_m68060, "m68k:68060", FALSE, &arch_info_struct[7]), N(bfd_mach_cpu32, "m68k:cpu32", FALSE, &arch_info_struct[8]), + N(bfd_mach_fido, "m68k:fido", FALSE, &arch_info_struct[9]), /* Various combinations of CF architecture features */ N(bfd_mach_mcf_isa_a_nodiv, "m68k:isa-a:nodiv", - FALSE, &arch_info_struct[9]), - N(bfd_mach_mcf_isa_a, "m68k:isa-a", FALSE, &arch_info_struct[10]), - N(bfd_mach_mcf_isa_a_mac, "m68k:isa-a:mac", + N(bfd_mach_mcf_isa_a, "m68k:isa-a", FALSE, &arch_info_struct[11]), - N(bfd_mach_mcf_isa_a_emac, "m68k:isa-a:emac", + N(bfd_mach_mcf_isa_a_mac, "m68k:isa-a:mac", FALSE, &arch_info_struct[12]), - N(bfd_mach_mcf_isa_aplus, "m68k:isa-aplus", + N(bfd_mach_mcf_isa_a_emac, "m68k:isa-a:emac", FALSE, &arch_info_struct[13]), - N(bfd_mach_mcf_isa_aplus_mac, "m68k:isa-aplus:mac", + N(bfd_mach_mcf_isa_aplus, "m68k:isa-aplus", FALSE, &arch_info_struct[14]), - N(bfd_mach_mcf_isa_aplus_emac, "m68k:isa-aplus:emac", + N(bfd_mach_mcf_isa_aplus_mac, "m68k:isa-aplus:mac", FALSE, &arch_info_struct[15]), - N(bfd_mach_mcf_isa_b_nousp, "m68k:isa-b:nousp", + N(bfd_mach_mcf_isa_aplus_emac, "m68k:isa-aplus:emac", FALSE, &arch_info_struct[16]), - N(bfd_mach_mcf_isa_b_nousp_mac, "m68k:isa-b:nousp:mac", + N(bfd_mach_mcf_isa_b_nousp, "m68k:isa-b:nousp", FALSE, &arch_info_struct[17]), - N(bfd_mach_mcf_isa_b_nousp_emac, "m68k:isa-b:nousp:emac", + N(bfd_mach_mcf_isa_b_nousp_mac, "m68k:isa-b:nousp:mac", FALSE, &arch_info_struct[18]), - N(bfd_mach_mcf_isa_b, "m68k:isa-b", + N(bfd_mach_mcf_isa_b_nousp_emac, "m68k:isa-b:nousp:emac", FALSE, &arch_info_struct[19]), - N(bfd_mach_mcf_isa_b_mac, "m68k:isa-b:mac", + N(bfd_mach_mcf_isa_b, "m68k:isa-b", FALSE, &arch_info_struct[20]), - N(bfd_mach_mcf_isa_b_emac, "m68k:isa-b:emac", + N(bfd_mach_mcf_isa_b_mac, "m68k:isa-b:mac", FALSE, &arch_info_struct[21]), - N(bfd_mach_mcf_isa_b_float, "m68k:isa-b:float", + N(bfd_mach_mcf_isa_b_emac, "m68k:isa-b:emac", FALSE, &arch_info_struct[22]), - N(bfd_mach_mcf_isa_b_float_mac, "m68k:isa-b:float:mac", + N(bfd_mach_mcf_isa_b_float, "m68k:isa-b:float", FALSE, &arch_info_struct[23]), - N(bfd_mach_mcf_isa_b_float_emac, "m68k:isa-b:float:emac", + N(bfd_mach_mcf_isa_b_float_mac, "m68k:isa-b:float:mac", FALSE, &arch_info_struct[24]), + N(bfd_mach_mcf_isa_b_float_emac, "m68k:isa-b:float:emac", + FALSE, &arch_info_struct[25]), + N(bfd_mach_mcf_isa_c, "m68k:isa-c", + FALSE, &arch_info_struct[26]), + N(bfd_mach_mcf_isa_c_mac, "m68k:isa-c:mac", + FALSE, &arch_info_struct[27]), + N(bfd_mach_mcf_isa_c_emac, "m68k:isa-c:emac", + FALSE, &arch_info_struct[28]), /* Legacy names for CF architectures */ - N(bfd_mach_mcf_isa_a_nodiv, "m68k:5200", FALSE, &arch_info_struct[25]), - N(bfd_mach_mcf_isa_a_mac,"m68k:5206e", FALSE, &arch_info_struct[26]), - N(bfd_mach_mcf_isa_a_mac, "m68k:5307", FALSE, &arch_info_struct[27]), - N(bfd_mach_mcf_isa_b_nousp_mac, "m68k:5407", FALSE, &arch_info_struct[28]), - N(bfd_mach_mcf_isa_aplus_emac, "m68k:528x", FALSE, &arch_info_struct[29]), - N(bfd_mach_mcf_isa_aplus_emac, "m68k:521x", FALSE, &arch_info_struct[30]), - N(bfd_mach_mcf_isa_a_emac, "m68k:5249", FALSE, &arch_info_struct[31]), + N(bfd_mach_mcf_isa_a_nodiv, "m68k:5200", FALSE, &arch_info_struct[29]), + N(bfd_mach_mcf_isa_a_mac,"m68k:5206e", FALSE, &arch_info_struct[30]), + N(bfd_mach_mcf_isa_a_mac, "m68k:5307", FALSE, &arch_info_struct[31]), + N(bfd_mach_mcf_isa_b_nousp_mac, "m68k:5407", FALSE, &arch_info_struct[32]), + N(bfd_mach_mcf_isa_aplus_emac, "m68k:528x", FALSE, &arch_info_struct[33]), + N(bfd_mach_mcf_isa_aplus_emac, "m68k:521x", FALSE, &arch_info_struct[34]), + N(bfd_mach_mcf_isa_a_emac, "m68k:5249", FALSE, &arch_info_struct[35]), N(bfd_mach_mcf_isa_b_float_emac, "m68k:547x", - FALSE, &arch_info_struct[32]), + FALSE, &arch_info_struct[36]), N(bfd_mach_mcf_isa_b_float_emac, "m68k:548x", - FALSE, &arch_info_struct[33]), + FALSE, &arch_info_struct[37]), N(bfd_mach_mcf_isa_b_float_emac, "m68k:cfv4e", FALSE, 0), }; @@ -107,6 +114,7 @@ static const unsigned m68k_arch_features[] = m68040|m68881|m68851, m68060|m68881|m68851, cpu32|m68881, + fido_a|m68881, mcfisa_a, mcfisa_a|mcfhwdiv, mcfisa_a|mcfhwdiv|mcfmac, @@ -123,6 +131,9 @@ static const unsigned m68k_arch_features[] = mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp|cfloat, mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp|cfloat|mcfmac, mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp|cfloat|mcfemac, + mcfisa_a|mcfhwdiv|mcfisa_c|mcfusp, + mcfisa_a|mcfhwdiv|mcfisa_c|mcfusp|mcfmac, + mcfisa_a|mcfhwdiv|mcfisa_c|mcfusp|mcfemac, }; /* Return the count of bits set in MASK */ @@ -202,24 +213,48 @@ bfd_m68k_compatible (const bfd_arch_info_type *a, if (a->mach <= bfd_mach_m68060 && b->mach <= bfd_mach_m68060) /* Merge m68k machine. */ return a->mach > b->mach ? a : b; - else if (a->mach == bfd_mach_cpu32 && b->mach == bfd_mach_cpu32) - /* CPU32 is compatible with itself. */ - return a; - else if (a->mach >= bfd_mach_mcf_isa_a_nodiv - && b->mach >= bfd_mach_mcf_isa_a_nodiv) + else if (a->mach >= bfd_mach_cpu32 && b->mach >= bfd_mach_cpu32) { - /* Merge cf machine. */ + /* Merge the machine features. */ unsigned features = (bfd_m68k_mach_to_features (a->mach) | bfd_m68k_mach_to_features (b->mach)); + /* CPU32 and Coldfire are incompatible. */ + if ((~features & (cpu32 | mcfisa_a)) == 0) + return NULL; + + /* Fido and Coldfire are incompatible. */ + if ((~features & (fido_a | mcfisa_a)) == 0) + return NULL; + /* ISA A+ and ISA B are incompatible. */ if ((~features & (mcfisa_aa | mcfisa_b)) == 0) return NULL; + /* ISA B and ISA C are incompatible. */ + if ((~features & (mcfisa_b | mcfisa_c)) == 0) + return NULL; + /* MAC and EMAC code cannot be merged. */ if ((~features & (mcfmac | mcfemac)) == 0) return NULL; + /* CPU32 is compatible with Fido except that Fido does not + support tbl instructions. Warn when the user wants to mix + the two. */ + if ((a->mach == bfd_mach_cpu32 && b->mach == bfd_mach_fido) + || (a->mach == bfd_mach_fido && b->mach == bfd_mach_cpu32)) + { + static int cpu32_fido_mix_warning; + if (!cpu32_fido_mix_warning) + { + cpu32_fido_mix_warning = 1; + (*_bfd_error_handler) ("warning: linking CPU32 objects with fido objects"); + } + return bfd_lookup_arch (a->arch, + bfd_m68k_features_to_mach (fido_a | m68881)); + } + return bfd_lookup_arch (a->arch, bfd_m68k_features_to_mach (features)); } else diff --git a/bfd/cpu-m88k.c b/bfd/cpu-m88k.c index 394b42ec5d0..ce0dbb4ee01 100644 --- a/bfd/cpu-m88k.c +++ b/bfd/cpu-m88k.c @@ -1,5 +1,6 @@ /* bfd back-end for m88k support - Copyright 1990, 1991, 1994, 2000, 2002 Free Software Foundation, Inc. + Copyright 1990, 1991, 1994, 2000, 2002, 2007 + Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +19,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_m88k_arch = diff --git a/bfd/cpu-maxq.c b/bfd/cpu-maxq.c index 523ef888616..adf2d8d1926 100644 --- a/bfd/cpu-maxq.c +++ b/bfd/cpu-maxq.c @@ -1,5 +1,5 @@ /* BFD support for the MAXQ20/10 architecture. - Copyright 2004, 2005 Free Software Foundation, Inc. + Copyright 2004, 2005, 2007 Free Software Foundation, Inc. Written by Vineet Sharma(vineets@noida.hcltech.com) Inderpreet Singh(inderpreetb@noida.hcltech.com) @@ -20,8 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" /* MAXQ Archtecture info. */ diff --git a/bfd/cpu-mcore.c b/bfd/cpu-mcore.c index 949fa430c46..8957224725b 100644 --- a/bfd/cpu-mcore.c +++ b/bfd/cpu-mcore.c @@ -1,5 +1,5 @@ /* BFD library support routines for Motorola's MCore architecture - Copyright 1993, 1999, 2000, 2002 Free Software Foundation, Inc. + Copyright 1993, 1999, 2000, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_mcore_arch = diff --git a/bfd/cpu-mep.c b/bfd/cpu-mep.c new file mode 100644 index 00000000000..d5ee1d67b42 --- /dev/null +++ b/bfd/cpu-mep.c @@ -0,0 +1,28 @@ +/* BFD support for the Toshiba Media Engine Processor. + Copyright (C) 2001, 2002, 2004, 2007 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + 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 2 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 "libbfd.h" + +#define MA(x, n, def, y) { 32, 32, 8, bfd_arch_mep, x, "mep", n, \ + 2, def, bfd_default_compatible, bfd_default_scan, y } + +static const bfd_arch_info_type bfd_h1_arch = MA (bfd_mach_mep_h1, "h1", FALSE, NULL); +const bfd_arch_info_type bfd_mep_arch = MA (bfd_mach_mep, "mep", TRUE, & bfd_h1_arch); diff --git a/bfd/cpu-mips.c b/bfd/cpu-mips.c index 5f4dccafbb7..f4783790c95 100644 --- a/bfd/cpu-mips.c +++ b/bfd/cpu-mips.c @@ -1,6 +1,6 @@ /* bfd back-end for mips support Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001, - 2002, 2003, 2004 Free Software Foundation, Inc. + 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" static const bfd_arch_info_type *mips_compatible diff --git a/bfd/cpu-mmix.c b/bfd/cpu-mmix.c index fc0e875c78b..712713707a2 100644 --- a/bfd/cpu-mmix.c +++ b/bfd/cpu-mmix.c @@ -1,5 +1,5 @@ /* BFD library support routines for MMIX. - Copyright 2001, 2002 Free Software Foundation, Inc. + Copyright 2001, 2002, 2007 Free Software Foundation, Inc. Contributed by Hans-Peter Nilsson (hp@bitrange.com) This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type diff --git a/bfd/cpu-msp430.c b/bfd/cpu-msp430.c index 18e371667d6..f7f369a355d 100644 --- a/bfd/cpu-msp430.c +++ b/bfd/cpu-msp430.c @@ -1,5 +1,5 @@ /* BFD library support routines for the MSP architecture. - Copyright (C) 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc. Contributed by Dmitry Diky This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" static const bfd_arch_info_type *compatible diff --git a/bfd/cpu-mt.c b/bfd/cpu-mt.c index 43b442aee9f..4d07c4347c4 100644 --- a/bfd/cpu-mt.c +++ b/bfd/cpu-mt.c @@ -1,5 +1,5 @@ /* BFD support for the Morpho Technologies MT processor. - Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type arch_info_struct[] = diff --git a/bfd/cpu-ns32k.c b/bfd/cpu-ns32k.c index f7e2f1197e3..447b26fe981 100644 --- a/bfd/cpu-ns32k.c +++ b/bfd/cpu-ns32k.c @@ -1,6 +1,6 @@ /* BFD support for the ns32k architecture. Copyright 1990, 1991, 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005 Free Software Foundation, Inc. + 2004, 2005, 2007 Free Software Foundation, Inc. Almost totally rewritten by Ian Dall from initial work by Andrew Cagney. @@ -20,8 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "ns32k.h" diff --git a/bfd/cpu-openrisc.c b/bfd/cpu-openrisc.c index bf26d51c50a..a6de202371b 100644 --- a/bfd/cpu-openrisc.c +++ b/bfd/cpu-openrisc.c @@ -1,5 +1,5 @@ /* BFD support for the OpenRISC architecture. - Copyright 2001, 2002 Free Software Foundation, Inc. + Copyright 2001, 2002, 2007 Free Software Foundation, Inc. Contributed by Johan Rydberg, jrydberg@opencores.org This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #define N(BITS_WORD, BITS_ADDR, NUMBER, PRINT, DEFAULT, NEXT) \ diff --git a/bfd/cpu-or32.c b/bfd/cpu-or32.c index 41c218b0ffd..ddb79240a6b 100644 --- a/bfd/cpu-or32.c +++ b/bfd/cpu-or32.c @@ -1,5 +1,5 @@ /* BFD support for the OpenRISC 1000 architecture. - Copyright 2002 Free Software Foundation, Inc. + Copyright 2002, 2007 Free Software Foundation, Inc. Contributed by Ivan Guzvinec This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_or32_arch = diff --git a/bfd/cpu-pdp11.c b/bfd/cpu-pdp11.c index 98efd4d3344..7609c8ebb0a 100644 --- a/bfd/cpu-pdp11.c +++ b/bfd/cpu-pdp11.c @@ -1,5 +1,5 @@ /* BFD back-end for PDP-11 support. - Copyright 2001, 2002 Free Software Foundation, Inc. + Copyright 2001, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_pdp11_arch = diff --git a/bfd/cpu-pj.c b/bfd/cpu-pj.c index 60f0303116e..6972ceb6539 100644 --- a/bfd/cpu-pj.c +++ b/bfd/cpu-pj.c @@ -1,5 +1,5 @@ /* BFD library support routines for the Pico Java architecture. - Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2007 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Transmeta. sac@pobox.com This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_pj_arch = diff --git a/bfd/cpu-powerpc.c b/bfd/cpu-powerpc.c index 2584d651162..e3583306129 100644 --- a/bfd/cpu-powerpc.c +++ b/bfd/cpu-powerpc.c @@ -1,5 +1,5 @@ /* BFD PowerPC CPU definition - Copyright 1994, 1995, 1996, 2000, 2001, 2002, 2003 + Copyright 1994, 1995, 1996, 2000, 2001, 2002, 2003, 2007 Free Software Foundation, Inc. Contributed by Ian Lance Taylor, Cygnus Support. @@ -19,8 +19,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" /* The common PowerPC architecture is compatible with the RS/6000. */ diff --git a/bfd/cpu-rs6000.c b/bfd/cpu-rs6000.c index 43c7be7539f..4ed1d71e1a9 100644 --- a/bfd/cpu-rs6000.c +++ b/bfd/cpu-rs6000.c @@ -1,11 +1,7 @@ /* BFD back-end for rs6000 support - Copyright 1990, 1991, 1993, 1995, 2000, 2002, 2003 + Copyright 1990, 1991, 1993, 1995, 2000, 2002, 2003, 2007 Free Software Foundation, Inc. - FIXME: Can someone provide a transliteration of this name into ASCII? - Using the following chars caused a compiler warning on HIUX (so I replaced - them with octal escapes), and isn't useful without an understanding of what - character set it is. - Written by Mimi Ph\373\364ng-Th\345o V\365 of IBM + Written by Mimi Phuong-Thao Vo of IBM and John Gilmore of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -24,8 +20,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" /* The RS/6000 architecture is compatible with the PowerPC common diff --git a/bfd/cpu-s390.c b/bfd/cpu-s390.c index e7c714f26dc..b385a9c6bdb 100644 --- a/bfd/cpu-s390.c +++ b/bfd/cpu-s390.c @@ -1,5 +1,5 @@ /* BFD support for the s390 processor. - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2007 Free Software Foundation, Inc. Contributed by Carl B. Pedersen and Martin Schwidefsky. This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_s390_64_arch = diff --git a/bfd/cpu-score.c b/bfd/cpu-score.c new file mode 100644 index 00000000000..90d3113bd66 --- /dev/null +++ b/bfd/cpu-score.c @@ -0,0 +1,51 @@ +/* BFD support for the score processor + Copyright 2006, 2007 Free Software Foundation, Inc. + Contributed by + Mei Ligang (ligang@sunnorth.com.cn) + Pei-Lin Tsai (pltsai@sunplus.com) + + This file is part of BFD, the Binary File Descriptor library. + + 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 2 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 "libbfd.h" + +const bfd_arch_info_type +bfd_score_arch = +{ + 32, /* There's 32 bits_per_word. */ + 32, /* There's 32 bits_per_address. */ + 8, /* There's 8 bits_per_byte. */ + bfd_arch_score, /* One of enum bfd_architecture, defined + in archures.c and provided in + generated header files. */ + 0, /* Only 1 machine, but #255 for + historical reasons. */ + "score", /* The arch_name. */ + "score", /* The printable name is the same. */ + 4, /* Section alignment power; each section + is aligned to (only) 2^4 bytes. */ + TRUE, /* This is the default "machine", since + there's only one. */ + bfd_default_compatible, /* A default function for testing + "machine" compatibility of two + bfd_arch_info_type. */ + bfd_default_scan, /* Check if an bfd_arch_info_type is a + match. */ + NULL /* Pointer to next bfd_arch_info_type in + the same family. */ +}; diff --git a/bfd/cpu-sh.c b/bfd/cpu-sh.c index 531431c1dcd..4aa99c18e49 100644 --- a/bfd/cpu-sh.c +++ b/bfd/cpu-sh.c @@ -1,6 +1,6 @@ /* BFD library support routines for the Renesas / SuperH SH architecture. - Copyright 1993, 1994, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, + 2007 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "../opcodes/sh-opc.h" diff --git a/bfd/cpu-sparc.c b/bfd/cpu-sparc.c index 42153269a24..35a109e2c49 100644 --- a/bfd/cpu-sparc.c +++ b/bfd/cpu-sparc.c @@ -1,5 +1,5 @@ /* BFD support for the SPARC architecture. - Copyright 1992, 1995, 1996, 1998, 2000, 2002 + Copyright 1992, 1995, 1996, 1998, 2000, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" static const bfd_arch_info_type arch_info_struct[] = diff --git a/bfd/cpu-spu.c b/bfd/cpu-spu.c new file mode 100644 index 00000000000..540a19fa71b --- /dev/null +++ b/bfd/cpu-spu.c @@ -0,0 +1,54 @@ +/* Copyright 2006, 2007 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + 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 2 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 "libbfd.h" + + +static const bfd_arch_info_type * +spu_compatible (const bfd_arch_info_type *a, const bfd_arch_info_type *b) +{ + BFD_ASSERT (a->arch == bfd_arch_spu); + switch (b->arch) + { + default: + return NULL; + case bfd_arch_spu: + return bfd_default_compatible (a, b); + } + /*NOTREACHED*/ +} + +const bfd_arch_info_type bfd_spu_arch[] = +{ + { + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_spu, /* architecture */ + bfd_mach_spu, /* machine */ + "spu", /* architecture name */ + "spu:256K", /* printable name */ + 3, /* aligned power */ + TRUE, /* the default machine for the architecture */ + spu_compatible, /* the spu is only compatible with itself, see above */ + bfd_default_scan, + 0, /* next -- there are none! */ + } +}; diff --git a/bfd/cpu-tic30.c b/bfd/cpu-tic30.c index 29e6f3be12d..8506b41a84a 100644 --- a/bfd/cpu-tic30.c +++ b/bfd/cpu-tic30.c @@ -1,5 +1,5 @@ /* BFD support for the Texas Instruments TMS320C30 architecture. - Copyright 1998, 2002 Free Software Foundation, Inc. + Copyright 1998, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_tic30_arch = diff --git a/bfd/cpu-tic4x.c b/bfd/cpu-tic4x.c index 8ff88839db2..dfcfe161241 100644 --- a/bfd/cpu-tic4x.c +++ b/bfd/cpu-tic4x.c @@ -1,5 +1,5 @@ /* bfd back-end for TMS320C[34]x support - Copyright 1996, 1997, 2002, 2003 Free Software Foundation, Inc. + Copyright 1996, 1997, 2002, 2003, 2007 Free Software Foundation, Inc. Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz) @@ -19,8 +19,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" static bfd_boolean tic4x_scan diff --git a/bfd/cpu-tic54x.c b/bfd/cpu-tic54x.c index debfe6929d6..f3f6d3287ab 100644 --- a/bfd/cpu-tic54x.c +++ b/bfd/cpu-tic54x.c @@ -1,5 +1,5 @@ /* BFD support for the Texas Instruments TMS320C54X architecture. - Copyright 1999, 2000, 2002 Free Software Foundation, Inc. + Copyright 1999, 2000, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_tic54x_arch = diff --git a/bfd/cpu-tic80.c b/bfd/cpu-tic80.c index 7dca8c7cf0c..88bf0a11958 100644 --- a/bfd/cpu-tic80.c +++ b/bfd/cpu-tic80.c @@ -1,5 +1,5 @@ /* bfd back-end for TI TMS320C80 (MVP) support - Copyright 1996, 2002 Free Software Foundation, Inc. + Copyright 1996, 2002, 2007 Free Software Foundation, Inc. Written by Fred Fish at Cygnus support (fnf@cygnus.com) This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_tic80_arch = diff --git a/bfd/cpu-v850.c b/bfd/cpu-v850.c index 5a776ddbe06..30d3a7dd797 100644 --- a/bfd/cpu-v850.c +++ b/bfd/cpu-v850.c @@ -1,5 +1,5 @@ /* BFD support for the NEC V850 processor - Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003 + Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "safe-ctype.h" diff --git a/bfd/cpu-vax.c b/bfd/cpu-vax.c index 1af84a62451..cea4e98cf1d 100644 --- a/bfd/cpu-vax.c +++ b/bfd/cpu-vax.c @@ -1,5 +1,6 @@ /* bfd back-end for vax support - Copyright 1990, 1991, 1994, 2000, 2002 Free Software Foundation, Inc. + Copyright 1990, 1991, 1994, 2000, 2002, 2007 + Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +19,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_vax_arch = diff --git a/bfd/cpu-w65.c b/bfd/cpu-w65.c index 82e485f9236..1acaf32939f 100644 --- a/bfd/cpu-w65.c +++ b/bfd/cpu-w65.c @@ -1,5 +1,6 @@ /* BFD library support routines for the WDC 65816 architecture. - Copyright 1995, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1995, 1999, 2000, 2001, 2002, 2007 + Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +19,8 @@ You w65ould 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" static bfd_boolean scan_mach diff --git a/bfd/cpu-we32k.c b/bfd/cpu-we32k.c index c0e7ab637dd..2aab22e27cf 100644 --- a/bfd/cpu-we32k.c +++ b/bfd/cpu-we32k.c @@ -1,5 +1,5 @@ /* bfd back-end for we32k support - Copyright 1992, 2000, 2002 Free Software Foundation, Inc. + Copyright 1992, 2000, 2002, 2007 Free Software Foundation, Inc. Contributed by Brendan Kehoe (brendan@cs.widener.edu). This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_we32k_arch = diff --git a/bfd/cpu-xc16x.c b/bfd/cpu-xc16x.c index 11569003629..b173107b9b6 100644 --- a/bfd/cpu-xc16x.c +++ b/bfd/cpu-xc16x.c @@ -1,5 +1,5 @@ /* BFD support for the Infineon XC16X Microcontroller. - Copyright 2006 Free Software Foundation, Inc. + Copyright 2006, 2007 Free Software Foundation, Inc. Contributed by KPIT Cummins Infosystems This file is part of BFD, the Binary File Descriptor library. @@ -20,8 +20,8 @@ Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type xc16xs_info_struct = diff --git a/bfd/cpu-xstormy16.c b/bfd/cpu-xstormy16.c index 62c5302222d..b2be98b70b6 100644 --- a/bfd/cpu-xstormy16.c +++ b/bfd/cpu-xstormy16.c @@ -1,5 +1,5 @@ /* BFD support for the XSTORMY16 processor. - Copyright 2001, 2002 Free Software Foundation, Inc. + Copyright 2001, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_xstormy16_arch = diff --git a/bfd/cpu-xtensa.c b/bfd/cpu-xtensa.c index 797143194a9..59f37fb0eb7 100644 --- a/bfd/cpu-xtensa.c +++ b/bfd/cpu-xtensa.c @@ -1,5 +1,5 @@ /* BFD support for the Xtensa processor. - Copyright 2003 Free Software Foundation, Inc. + Copyright 2003, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_xtensa_arch = diff --git a/bfd/cpu-z80.c b/bfd/cpu-z80.c index 3fd6fd48176..f106afbd805 100644 --- a/bfd/cpu-z80.c +++ b/bfd/cpu-z80.c @@ -1,5 +1,5 @@ /* BFD library support routines for the Z80 architecture. - Copyright 2005 Free Software Foundation, Inc. + Copyright 2005, 2007 Free Software Foundation, Inc. Contributed by Arnold Metselaar This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_z80_arch; diff --git a/bfd/cpu-z8k.c b/bfd/cpu-z8k.c index 043bbc50dce..4d47b4e974a 100644 --- a/bfd/cpu-z8k.c +++ b/bfd/cpu-z8k.c @@ -1,5 +1,5 @@ /* BFD library support routines for the Z800n architecture. - Copyright 1992, 1993, 1994, 2000, 2001, 2002, 2003 + Copyright 1992, 1993, 1994, 2000, 2001, 2002, 2003, 2007 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support. @@ -19,8 +19,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" /* This routine is provided two arch_infos and returns whether diff --git a/bfd/doc/ChangeLog b/bfd/doc/ChangeLog index 7909268f98b..6b96b613d13 100644 --- a/bfd/doc/ChangeLog +++ b/bfd/doc/ChangeLog @@ -1,7 +1,56 @@ +2007-07-02 Alan Modra + + * Makefile.in: Regenerate. + +2007-06-30 H.J. Lu + + * Makefile.in: Likewise. + +2007-06-14 H.J. Lu + + * Makefile.in: Regenerated. + +2007-05-22 Nick Clifton + + * bfd.texinfo: Use @copying around the copyright notice. + * bfdint.texi: Likewise. + +2007-05-21 Nick Clifton + + * bfdint.texi: Add GNU Free Documentation License notice. + +2007-04-24 Alan Modra + + * Makefile.in: Regenerate. + +2007-02-17 Mark Mitchell + Nathan Sidwell + Vladimir Prus + + * Makefile.in: Regenerate. + +2006-07-24 Ralk Wildenhues + + * bfd..texinfo: Fix spelling mistakes. + * bfdint.texinfo: Likewise. + +2006-07-18 Nigel Stephens + + * bfd.texinfo: Add @section for "What to Put Where". + 2006-06-07 Joseph S. Myers * bfd.texinfo: Remove local @tex code. +2006-06-05 Alan Modra + + * Makefile.in: Regenerate. + +2006-05-11 Carlos O'Donell + + * bfd.texinfo: Rename "Index" to "BFD Index" + 2006-04-06 Carlos O'Donell * Makefile.am: Add install-html and install-html-am targets. diff --git a/bfd/doc/Makefile.am b/bfd/doc/Makefile.am index 6d221faad4a..6ff434a6e7e 100644 --- a/bfd/doc/Makefile.am +++ b/bfd/doc/Makefile.am @@ -8,7 +8,8 @@ DOCFILES = aoutx.texi archive.texi archures.texi \ libbfd.texi bfdwin.texi bfdio.texi \ opncls.texi reloc.texi section.texi \ syms.texi targets.texi init.texi hash.texi linker.texi \ - mmo.texi + mmo.texi \ + bfdver.texi PROTOS = archive.p archures.p bfd.p \ core.p format.p \ @@ -51,6 +52,7 @@ SRCIPROT = $(srcdir)/../cache.c $(srcdir)/../libbfd.c \ TEXIDIR = $(srcdir)/../../texinfo/fsf info_TEXINFOS = bfd.texinfo +bfd_TEXINFOS = $(DOCFILES) bfdsumm.texi MKDOC = chew$(EXEEXT_FOR_BUILD) @@ -68,8 +70,6 @@ chew.o: chew.c protos: libbfd.h libcoff.h bfd.h -$(srcdir)/bfd.info bfd.dvi bfd.html: $(DOCFILES) bfdsumm.texi bfd.texinfo - # We can't replace these rules with an implicit rule, because # makes without VPATH support couldn't find the .h files in `..'. @@ -274,6 +274,17 @@ bfd.h: $(BFD_H_DEP) echo "#endif" >> $@ echo "#endif" >> $@ +bfdver.texi: $(srcdir)/Makefile.in + @echo "creating $@"; \ + echo "@set VERSION $(VERSION)" > bfdver.texi; \ + if [ -n "$(PKGVERSION)" ]; then \ + echo "@set VERSION_PACKAGE $(PKGVERSION)" >> bfdver.texi; \ + fi; \ + echo "@set UPDATED `date '+%B %Y'`" >> bfdver.texi; \ + if [ -n "$(REPORT_BUGS_TEXI)" ]; then \ + echo "@set BUGURL $(REPORT_BUGS_TEXI)" >> bfdver.texi; \ + fi + noinst_TEXINFOS = bfdint.texi MOSTLYCLEANFILES = $(MKDOC) *.o @@ -309,6 +320,11 @@ install-html-am: $(HTMLS) fi; \ done +MAINTAINERCLEANFILES += bfd.info - - +# Automake 1.9 will only build info files in the objdir if they are +# mentioned in DISTCLEANFILES. It doesn't have to be unconditional, +# though, so we use a bogus condition. +if GENINSRC_NEVER +DISTCLEANFILES += bfd.info +endif diff --git a/bfd/doc/Makefile.in b/bfd/doc/Makefile.in index ad81061ec7b..02b15d0dbe3 100644 --- a/bfd/doc/Makefile.in +++ b/bfd/doc/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -36,13 +36,26 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ + +# Automake 1.9 will only build info files in the objdir if they are +# mentioned in DISTCLEANFILES. It doesn't have to be unconditional, +# though, so we use a bogus condition. +@GENINSRC_NEVER_TRUE@am__append_1 = bfd.info subdir = doc -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(bfd_TEXINFOS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/../config/acx.m4 $(top_srcdir)/../bfd/bfd.m4 \ - $(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/../gettext.m4 $(top_srcdir)/configure.in +am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/depstand.m4 \ + $(top_srcdir)/../config/gettext-sister.m4 \ + $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/nls.m4 $(top_srcdir)/../config/po.m4 \ + $(top_srcdir)/../config/progtest.m4 \ + $(top_srcdir)/../config/stdint.m4 $(top_srcdir)/../libtool.m4 \ + $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ + $(top_srcdir)/../ltversion.m4 $(top_srcdir)/bfd.m4 \ + $(top_srcdir)/warning.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs @@ -51,7 +64,7 @@ CONFIG_CLEAN_FILES = depcomp = am__depfiles_maybe = SOURCES = -INFO_DEPS = $(srcdir)/bfd.info +INFO_DEPS = bfd.info TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex am__TEXINFO_TEX_DIR = $(top_srcdir)/../texinfo DVIS = bfd.dvi @@ -69,7 +82,6 @@ MAKEINFOHTML = $(MAKEINFO) --html AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) DVIPS = dvips ACLOCAL = @ACLOCAL@ -ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ @@ -95,20 +107,24 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DEBUGDIR = @DEBUGDIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@ -GMOFILES = @GMOFILES@ +FGREP = @FGREP@ +GENCAT = @GENCAT@ +GENINSRC_NEVER_FALSE = @GENINSRC_NEVER_FALSE@ +GENINSRC_NEVER_TRUE = @GENINSRC_NEVER_TRUE@ GMSGFMT = @GMSGFMT@ -GT_NO = @GT_NO@ -GT_YES = @GT_YES@ +GREP = @GREP@ HDEFINES = @HDEFINES@ -INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +INCINTL = @INCINTL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_LIBBFD_FALSE = @INSTALL_LIBBFD_FALSE@ INSTALL_LIBBFD_TRUE = @INSTALL_LIBBFD_TRUE@ @@ -116,10 +132,10 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ -INTLDEPS = @INTLDEPS@ -INTLLIBS = @INTLLIBS@ -INTLOBJS = @INTLOBJS@ +LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBINTL = @LIBINTL@ +LIBINTL_DEP = @LIBINTL_DEP@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -131,6 +147,8 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ NO_WERROR = @NO_WERROR@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ @@ -140,14 +158,16 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POFILES = @POFILES@ +PKGVERSION = @PKGVERSION@ POSUB = @POSUB@ RANLIB = @RANLIB@ +REPORT_BUGS_TEXI = @REPORT_BUGS_TEXI@ +REPORT_BUGS_TO = @REPORT_BUGS_TO@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TDEFINES = @TDEFINES@ -USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ @@ -156,6 +176,7 @@ WIN32LIBADD = @WIN32LIBADD@ XGETTEXT = @XGETTEXT@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ all_backends = @all_backends@ @@ -166,10 +187,10 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +bfd64_libs = @bfd64_libs@ bfd_backends = @bfd_backends@ bfd_default_target_size = @bfd_default_target_size@ bfd_file_ptr = @bfd_file_ptr@ -bfd_libs = @bfd_libs@ bfd_machines = @bfd_machines@ bfd_ufile_ptr = @bfd_ufile_ptr@ bfdincludedir = @bfdincludedir@ @@ -194,10 +215,10 @@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -l = @l@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -221,7 +242,8 @@ DOCFILES = aoutx.texi archive.texi archures.texi \ libbfd.texi bfdwin.texi bfdio.texi \ opncls.texi reloc.texi section.texi \ syms.texi targets.texi init.texi hash.texi linker.texi \ - mmo.texi + mmo.texi \ + bfdver.texi PROTOS = archive.p archures.p bfd.p \ core.p format.p \ @@ -263,6 +285,7 @@ SRCIPROT = $(srcdir)/../cache.c $(srcdir)/../libbfd.c \ TEXIDIR = $(srcdir)/../../texinfo/fsf info_TEXINFOS = bfd.texinfo +bfd_TEXINFOS = $(DOCFILES) bfdsumm.texi MKDOC = chew$(EXEEXT_FOR_BUILD) INCLUDES = -I.. -I$(srcdir)/.. -I$(srcdir)/../../include \ -I$(srcdir)/../../intl -I../../intl @@ -314,13 +337,14 @@ BFD_H_DEP = \ noinst_TEXINFOS = bfdint.texi MOSTLYCLEANFILES = $(MKDOC) *.o CLEANFILES = *.p *.ip -DISTCLEANFILES = bfd.?? bfd.??? bfd.h libbfd.h libcoff.h texput.log -MAINTAINERCLEANFILES = $(DOCFILES) +DISTCLEANFILES = bfd.?? bfd.??? bfd.h libbfd.h libcoff.h texput.log \ + $(am__append_1) +MAINTAINERCLEANFILES = $(DOCFILES) bfd.info html__strip_dir = `echo $$p | sed -e 's|^.*/||'`; all: all-am .SUFFIXES: -.SUFFIXES: .dvi .html .info .pdf .ps .texinfo +.SUFFIXES: .dvi .ps $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -330,9 +354,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus doc/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign doc/Makefile + $(AUTOMAKE) --cygnus doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -360,40 +384,38 @@ clean-libtool: distclean-libtool: -rm -f libtool -.texinfo.info: +bfd.info: bfd.texinfo $(bfd_TEXINFOS) restore=: && backupdir="$(am__leading_dot)am$$$$" && \ - am__cwd=`pwd` && cd $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ - for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ - if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ - done; \ - cd "$$am__cwd"; \ + if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ + for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ + if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ + done; \ + else :; fi && \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $@ $<; \ + -o $@ `test -f 'bfd.texinfo' || echo '$(srcdir)/'`bfd.texinfo; \ then \ rc=0; \ - cd $(srcdir); \ else \ rc=$$?; \ - cd $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc -.texinfo.dvi: +bfd.dvi: bfd.texinfo $(bfd_TEXINFOS) TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2DVI) $< + $(TEXI2DVI) -o $@ `test -f 'bfd.texinfo' || echo '$(srcdir)/'`bfd.texinfo -.texinfo.pdf: +bfd.pdf: bfd.texinfo $(bfd_TEXINFOS) TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2PDF) $< + $(TEXI2PDF) -o $@ `test -f 'bfd.texinfo' || echo '$(srcdir)/'`bfd.texinfo -.texinfo.html: +bfd.html: bfd.texinfo $(bfd_TEXINFOS) rm -rf $(@:.html=.htp) if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $(@:.html=.htp) $<; \ + -o $(@:.html=.htp) `test -f 'bfd.texinfo' || echo '$(srcdir)/'`bfd.texinfo; \ then \ rm -rf $@; \ if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ @@ -403,11 +425,8 @@ distclean-libtool: rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ exit 1; \ fi -$(srcdir)/bfd.info: bfd.texinfo -bfd.dvi: bfd.texinfo -bfd.pdf: bfd.texinfo -bfd.html: bfd.texinfo .dvi.ps: + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ $(DVIPS) -o $@ $< uninstall-info-am: @@ -600,8 +619,6 @@ chew.o: chew.c protos: libbfd.h libcoff.h bfd.h -$(srcdir)/bfd.info bfd.dvi bfd.html: $(DOCFILES) bfdsumm.texi bfd.texinfo - # We can't replace these rules with an implicit rule, because # makes without VPATH support couldn't find the .h files in `..'. @@ -762,6 +779,17 @@ bfd.h: $(BFD_H_DEP) echo "#endif" >> $@ echo "#endif" >> $@ +bfdver.texi: $(srcdir)/Makefile.in + @echo "creating $@"; \ + echo "@set VERSION $(VERSION)" > bfdver.texi; \ + if [ -n "$(PKGVERSION)" ]; then \ + echo "@set VERSION_PACKAGE $(PKGVERSION)" >> bfdver.texi; \ + fi; \ + echo "@set UPDATED `date '+%B %Y'`" >> bfdver.texi; \ + if [ -n "$(REPORT_BUGS_TEXI)" ]; then \ + echo "@set BUGURL $(REPORT_BUGS_TEXI)" >> bfdver.texi; \ + fi + # We want install to imply install-info as per GNU standards, despite the # cygnus option. install: install-info diff --git a/bfd/doc/aoutx.texi b/bfd/doc/aoutx.texi deleted file mode 100644 index 7cf9787f106..00000000000 --- a/bfd/doc/aoutx.texi +++ /dev/null @@ -1,213 +0,0 @@ -@section a.out backends - - -@strong{Description}@* -BFD supports a number of different flavours of a.out format, -though the major differences are only the sizes of the -structures on disk, and the shape of the relocation -information. - -The support is split into a basic support file @file{aoutx.h} -and other files which derive functions from the base. One -derivation file is @file{aoutf1.h} (for a.out flavour 1), and -adds to the basic a.out functions support for sun3, sun4, 386 -and 29k a.out files, to create a target jump vector for a -specific target. - -This information is further split out into more specific files -for each machine, including @file{sunos.c} for sun3 and sun4, -@file{newsos3.c} for the Sony NEWS, and @file{demo64.c} for a -demonstration of a 64 bit a.out format. - -The base file @file{aoutx.h} defines general mechanisms for -reading and writing records to and from disk and various -other methods which BFD requires. It is included by -@file{aout32.c} and @file{aout64.c} to form the names -@code{aout_32_swap_exec_header_in}, @code{aout_64_swap_exec_header_in}, etc. - -As an example, this is what goes on to make the back end for a -sun4, from @file{aout32.c}: - -@example - #define ARCH_SIZE 32 - #include "aoutx.h" -@end example - -Which exports names: - -@example - ... - aout_32_canonicalize_reloc - aout_32_find_nearest_line - aout_32_get_lineno - aout_32_get_reloc_upper_bound - ... -@end example - -from @file{sunos.c}: - -@example - #define TARGET_NAME "a.out-sunos-big" - #define VECNAME sunos_big_vec - #include "aoutf1.h" -@end example - -requires all the names from @file{aout32.c}, and produces the jump vector - -@example - sunos_big_vec -@end example - -The file @file{host-aout.c} is a special case. It is for a large set -of hosts that use ``more or less standard'' a.out files, and -for which cross-debugging is not interesting. It uses the -standard 32-bit a.out support routines, but determines the -file offsets and addresses of the text, data, and BSS -sections, the machine architecture and machine type, and the -entry point address, in a host-dependent manner. Once these -values have been determined, generic code is used to handle -the object file. - -When porting it to run on a new system, you must supply: - -@example - HOST_PAGE_SIZE - HOST_SEGMENT_SIZE - HOST_MACHINE_ARCH (optional) - HOST_MACHINE_MACHINE (optional) - HOST_TEXT_START_ADDR - HOST_STACK_END_ADDR -@end example - -in the file @file{../include/sys/h-@var{XXX}.h} (for your host). These -values, plus the structures and macros defined in @file{a.out.h} on -your host system, will produce a BFD target that will access -ordinary a.out files on your host. To configure a new machine -to use @file{host-aout.c}, specify: - -@example - TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec - TDEPFILES= host-aout.o trad-core.o -@end example - -in the @file{config/@var{XXX}.mt} file, and modify @file{configure.in} -to use the -@file{@var{XXX}.mt} file (by setting "@code{bfd_target=XXX}") when your -configuration is selected. - -@subsection Relocations - - -@strong{Description}@* -The file @file{aoutx.h} provides for both the @emph{standard} -and @emph{extended} forms of a.out relocation records. - -The standard records contain only an -address, a symbol index, and a type field. The extended records -(used on 29ks and sparcs) also have a full integer for an -addend. - -@subsection Internal entry points - - -@strong{Description}@* -@file{aoutx.h} exports several routines for accessing the -contents of an a.out file, which are gathered and exported in -turn by various format specific files (eg sunos.c). - -@findex aout_@var{size}_swap_exec_header_in -@subsubsection @code{aout_@var{size}_swap_exec_header_in} -@strong{Synopsis} -@example -void aout_@var{size}_swap_exec_header_in, - (bfd *abfd, - struct external_exec *bytes, - struct internal_exec *execp); -@end example -@strong{Description}@* -Swap the information in an executable header @var{raw_bytes} taken -from a raw byte stream memory image into the internal exec header -structure @var{execp}. - -@findex aout_@var{size}_swap_exec_header_out -@subsubsection @code{aout_@var{size}_swap_exec_header_out} -@strong{Synopsis} -@example -void aout_@var{size}_swap_exec_header_out - (bfd *abfd, - struct internal_exec *execp, - struct external_exec *raw_bytes); -@end example -@strong{Description}@* -Swap the information in an internal exec header structure -@var{execp} into the buffer @var{raw_bytes} ready for writing to disk. - -@findex aout_@var{size}_some_aout_object_p -@subsubsection @code{aout_@var{size}_some_aout_object_p} -@strong{Synopsis} -@example -const bfd_target *aout_@var{size}_some_aout_object_p - (bfd *abfd, - struct internal_exec *execp, - const bfd_target *(*callback_to_real_object_p) (bfd *)); -@end example -@strong{Description}@* -Some a.out variant thinks that the file open in @var{abfd} -checking is an a.out file. Do some more checking, and set up -for access if it really is. Call back to the calling -environment's "finish up" function just before returning, to -handle any last-minute setup. - -@findex aout_@var{size}_mkobject -@subsubsection @code{aout_@var{size}_mkobject} -@strong{Synopsis} -@example -bfd_boolean aout_@var{size}_mkobject, (bfd *abfd); -@end example -@strong{Description}@* -Initialize BFD @var{abfd} for use with a.out files. - -@findex aout_@var{size}_machine_type -@subsubsection @code{aout_@var{size}_machine_type} -@strong{Synopsis} -@example -enum machine_type aout_@var{size}_machine_type - (enum bfd_architecture arch, - unsigned long machine, - bfd_boolean *unknown); -@end example -@strong{Description}@* -Keep track of machine architecture and machine type for -a.out's. Return the @code{machine_type} for a particular -architecture and machine, or @code{M_UNKNOWN} if that exact architecture -and machine can't be represented in a.out format. - -If the architecture is understood, machine type 0 (default) -is always understood. - -@findex aout_@var{size}_set_arch_mach -@subsubsection @code{aout_@var{size}_set_arch_mach} -@strong{Synopsis} -@example -bfd_boolean aout_@var{size}_set_arch_mach, - (bfd *, - enum bfd_architecture arch, - unsigned long machine); -@end example -@strong{Description}@* -Set the architecture and the machine of the BFD @var{abfd} to the -values @var{arch} and @var{machine}. Verify that @var{abfd}'s format -can support the architecture required. - -@findex aout_@var{size}_new_section_hook -@subsubsection @code{aout_@var{size}_new_section_hook} -@strong{Synopsis} -@example -bfd_boolean aout_@var{size}_new_section_hook, - (bfd *abfd, - asection *newsect); -@end example -@strong{Description}@* -Called by the BFD in response to a @code{bfd_make_section} -request. - diff --git a/bfd/doc/archive.texi b/bfd/doc/archive.texi deleted file mode 100644 index 3d0a97d4b82..00000000000 --- a/bfd/doc/archive.texi +++ /dev/null @@ -1,99 +0,0 @@ -@section Archives - - -@strong{Description}@* -An archive (or library) is just another BFD. It has a symbol -table, although there's not much a user program will do with it. - -The big difference between an archive BFD and an ordinary BFD -is that the archive doesn't have sections. Instead it has a -chain of BFDs that are considered its contents. These BFDs can -be manipulated like any other. The BFDs contained in an -archive opened for reading will all be opened for reading. You -may put either input or output BFDs into an archive opened for -output; they will be handled correctly when the archive is closed. - -Use @code{bfd_openr_next_archived_file} to step through -the contents of an archive opened for input. You don't -have to read the entire archive if you don't want -to! Read it until you find what you want. - -Archive contents of output BFDs are chained through the -@code{next} pointer in a BFD. The first one is findable through -the @code{archive_head} slot of the archive. Set it with -@code{bfd_set_archive_head} (q.v.). A given BFD may be in only one -open output archive at a time. - -As expected, the BFD archive code is more general than the -archive code of any given environment. BFD archives may -contain files of different formats (e.g., a.out and coff) and -even different architectures. You may even place archives -recursively into archives! - -This can cause unexpected confusion, since some archive -formats are more expressive than others. For instance, Intel -COFF archives can preserve long filenames; SunOS a.out archives -cannot. If you move a file from the first to the second -format and back again, the filename may be truncated. -Likewise, different a.out environments have different -conventions as to how they truncate filenames, whether they -preserve directory names in filenames, etc. When -interoperating with native tools, be sure your files are -homogeneous. - -Beware: most of these formats do not react well to the -presence of spaces in filenames. We do the best we can, but -can't always handle this case due to restrictions in the format of -archives. Many Unix utilities are braindead in regards to -spaces and such in filenames anyway, so this shouldn't be much -of a restriction. - -Archives are supported in BFD in @code{archive.c}. - -@subsection Archive functions - - -@findex bfd_get_next_mapent -@subsubsection @code{bfd_get_next_mapent} -@strong{Synopsis} -@example -symindex bfd_get_next_mapent - (bfd *abfd, symindex previous, carsym **sym); -@end example -@strong{Description}@* -Step through archive @var{abfd}'s symbol table (if it -has one). Successively update @var{sym} with the next symbol's -information, returning that symbol's (internal) index into the -symbol table. - -Supply @code{BFD_NO_MORE_SYMBOLS} as the @var{previous} entry to get -the first one; returns @code{BFD_NO_MORE_SYMBOLS} when you've already -got the last one. - -A @code{carsym} is a canonical archive symbol. The only -user-visible element is its name, a null-terminated string. - -@findex bfd_set_archive_head -@subsubsection @code{bfd_set_archive_head} -@strong{Synopsis} -@example -bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head); -@end example -@strong{Description}@* -Set the head of the chain of -BFDs contained in the archive @var{output} to @var{new_head}. - -@findex bfd_openr_next_archived_file -@subsubsection @code{bfd_openr_next_archived_file} -@strong{Synopsis} -@example -bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous); -@end example -@strong{Description}@* -Provided a BFD, @var{archive}, containing an archive and NULL, open -an input BFD on the first contained element and returns that. -Subsequent calls should pass -the archive and the previous return value to return a created -BFD to the next contained element. NULL is returned when there -are no more. - diff --git a/bfd/doc/archures.texi b/bfd/doc/archures.texi deleted file mode 100644 index bf72179dad3..00000000000 --- a/bfd/doc/archures.texi +++ /dev/null @@ -1,585 +0,0 @@ -@section Architectures -BFD keeps one atom in a BFD describing the -architecture of the data attached to the BFD: a pointer to a -@code{bfd_arch_info_type}. - -Pointers to structures can be requested independently of a BFD -so that an architecture's information can be interrogated -without access to an open BFD. - -The architecture information is provided by each architecture package. -The set of default architectures is selected by the macro -@code{SELECT_ARCHITECTURES}. This is normally set up in the -@file{config/@var{target}.mt} file of your choice. If the name is not -defined, then all the architectures supported are included. - -When BFD starts up, all the architectures are called with an -initialize method. It is up to the architecture back end to -insert as many items into the list of architectures as it wants to; -generally this would be one for each machine and one for the -default case (an item with a machine field of 0). - -BFD's idea of an architecture is implemented in @file{archures.c}. - -@subsection bfd_architecture - - -@strong{Description}@* -This enum gives the object file's CPU architecture, in a -global sense---i.e., what processor family does it belong to? -Another field indicates which processor within -the family is in use. The machine gives a number which -distinguishes different versions of the architecture, -containing, for example, 2 and 3 for Intel i960 KA and i960 KB, -and 68020 and 68030 for Motorola 68020 and 68030. -@example -enum bfd_architecture -@{ - bfd_arch_unknown, /* File arch not known. */ - bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_mcf_isa_a_nodiv 9 -#define bfd_mach_mcf_isa_a 10 -#define bfd_mach_mcf_isa_a_mac 11 -#define bfd_mach_mcf_isa_a_emac 12 -#define bfd_mach_mcf_isa_aplus 13 -#define bfd_mach_mcf_isa_aplus_mac 14 -#define bfd_mach_mcf_isa_aplus_emac 15 -#define bfd_mach_mcf_isa_b_nousp 16 -#define bfd_mach_mcf_isa_b_nousp_mac 17 -#define bfd_mach_mcf_isa_b_nousp_emac 18 -#define bfd_mach_mcf_isa_b 19 -#define bfd_mach_mcf_isa_b_mac 20 -#define bfd_mach_mcf_isa_b_emac 21 -#define bfd_mach_mcf_isa_b_float 22 -#define bfd_mach_mcf_isa_b_float_mac 23 -#define bfd_mach_mcf_isa_b_float_emac 24 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ - -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 - - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ -#define bfd_mach_sparc 1 -/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ -#define bfd_mach_sparc_sparclet 2 -#define bfd_mach_sparc_sparclite 3 -#define bfd_mach_sparc_v8plus 4 -#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */ -#define bfd_mach_sparc_sparclite_le 6 -#define bfd_mach_sparc_v9 7 -#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ -#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ -#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ -/* Nonzero if MACH has the v9 instruction set. */ -#define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ - && (mach) != bfd_mach_sparc_sparclite_le) -/* Nonzero if MACH is a 64 bit sparc architecture. */ -#define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_mips, /* MIPS Rxxxx */ -#define bfd_mach_mips3000 3000 -#define bfd_mach_mips3900 3900 -#define bfd_mach_mips4000 4000 -#define bfd_mach_mips4010 4010 -#define bfd_mach_mips4100 4100 -#define bfd_mach_mips4111 4111 -#define bfd_mach_mips4120 4120 -#define bfd_mach_mips4300 4300 -#define bfd_mach_mips4400 4400 -#define bfd_mach_mips4600 4600 -#define bfd_mach_mips4650 4650 -#define bfd_mach_mips5000 5000 -#define bfd_mach_mips5400 5400 -#define bfd_mach_mips5500 5500 -#define bfd_mach_mips6000 6000 -#define bfd_mach_mips7000 7000 -#define bfd_mach_mips8000 8000 -#define bfd_mach_mips9000 9000 -#define bfd_mach_mips10000 10000 -#define bfd_mach_mips12000 12000 -#define bfd_mach_mips16 16 -#define bfd_mach_mips5 5 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ -#define bfd_mach_mipsisa32 32 -#define bfd_mach_mipsisa32r2 33 -#define bfd_mach_mipsisa64 64 -#define bfd_mach_mipsisa64r2 65 - bfd_arch_i386, /* Intel 386 */ -#define bfd_mach_i386_i386 1 -#define bfd_mach_i386_i8086 2 -#define bfd_mach_i386_i386_intel_syntax 3 -#define bfd_mach_x86_64 64 -#define bfd_mach_x86_64_intel_syntax 65 - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ - bfd_arch_powerpc, /* PowerPC */ -#define bfd_mach_ppc 32 -#define bfd_mach_ppc64 64 -#define bfd_mach_ppc_403 403 -#define bfd_mach_ppc_403gc 4030 -#define bfd_mach_ppc_505 505 -#define bfd_mach_ppc_601 601 -#define bfd_mach_ppc_602 602 -#define bfd_mach_ppc_603 603 -#define bfd_mach_ppc_ec603e 6031 -#define bfd_mach_ppc_604 604 -#define bfd_mach_ppc_620 620 -#define bfd_mach_ppc_630 630 -#define bfd_mach_ppc_750 750 -#define bfd_mach_ppc_860 860 -#define bfd_mach_ppc_a35 35 -#define bfd_mach_ppc_rs64ii 642 -#define bfd_mach_ppc_rs64iii 643 -#define bfd_mach_ppc_7400 7400 -#define bfd_mach_ppc_e500 500 - bfd_arch_rs6000, /* IBM RS/6000 */ -#define bfd_mach_rs6k 6000 -#define bfd_mach_rs6k_rs1 6001 -#define bfd_mach_rs6k_rsc 6003 -#define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ -#define bfd_mach_hppa10 10 -#define bfd_mach_hppa11 11 -#define bfd_mach_hppa20 20 -#define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ -#define bfd_mach_d10v 1 -#define bfd_mach_d10v_ts2 2 -#define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ -#define bfd_mach_m6812_default 0 -#define bfd_mach_m6812 1 -#define bfd_mach_m6812s 2 - bfd_arch_z8k, /* Zilog Z8000 */ -#define bfd_mach_z8001 1 -#define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b -#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 - bfd_arch_arm, /* Advanced Risc Machines ARM. */ -#define bfd_mach_arm_unknown 0 -#define bfd_mach_arm_2 1 -#define bfd_mach_arm_2a 2 -#define bfd_mach_arm_3 3 -#define bfd_mach_arm_3M 4 -#define bfd_mach_arm_4 5 -#define bfd_mach_arm_4T 6 -#define bfd_mach_arm_5 7 -#define bfd_mach_arm_5T 8 -#define bfd_mach_arm_5TE 9 -#define bfd_mach_arm_XScale 10 -#define bfd_mach_arm_ep9312 11 -#define bfd_mach_arm_iWMMXt 12 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ -#define bfd_mach_tic3x 30 -#define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ -#define bfd_mach_v850 1 -#define bfd_mach_v850e 'E' -#define bfd_mach_v850e1 '1' - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ -#define bfd_mach_m32r 1 /* For backwards compatibility. */ -#define bfd_mach_m32rx 'x' -#define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 -#define bfd_mach_am33 330 -#define bfd_mach_am33_2 332 - bfd_arch_fr30, -#define bfd_mach_fr30 0x46523330 - bfd_arch_frv, -#define bfd_mach_frv 1 -#define bfd_mach_frvsimple 2 -#define bfd_mach_fr300 300 -#define bfd_mach_fr400 400 -#define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ -#define bfd_mach_fr500 500 -#define bfd_mach_fr550 550 - bfd_arch_mcore, - bfd_arch_ia64, /* HP/Intel ia64 */ -#define bfd_mach_ia64_elf64 64 -#define bfd_mach_ia64_elf32 32 - bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ -#define bfd_mach_ip2022 1 -#define bfd_mach_ip2022ext 2 - bfd_arch_iq2000, /* Vitesse IQ2000. */ -#define bfd_mach_iq2000 1 -#define bfd_mach_iq10 2 - bfd_arch_mt, -#define bfd_mach_ms1 1 -#define bfd_mach_mrisc2 2 -#define bfd_mach_ms2 3 - bfd_arch_pj, - bfd_arch_avr, /* Atmel AVR microcontrollers. */ -#define bfd_mach_avr1 1 -#define bfd_mach_avr2 2 -#define bfd_mach_avr3 3 -#define bfd_mach_avr4 4 -#define bfd_mach_avr5 5 - bfd_arch_bfin, /* ADI Blackfin */ -#define bfd_mach_bfin 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 - bfd_arch_crx, /* National Semiconductor CRX. */ -#define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ -#define bfd_mach_cris_v0_v10 255 -#define bfd_mach_cris_v32 32 -#define bfd_mach_cris_v10_v32 1032 - bfd_arch_s390, /* IBM s390 */ -#define bfd_mach_s390_31 31 -#define bfd_mach_s390_64 64 - bfd_arch_openrisc, /* OpenRISC */ - bfd_arch_mmix, /* Donald Knuth's educational processor. */ - bfd_arch_xstormy16, -#define bfd_mach_xstormy16 1 - bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ -#define bfd_mach_xc16x 1 -#define bfd_mach_xc16xl 2 -#define bfd_mach_xc16xs 3 - bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ -#define bfd_mach_xtensa 1 - bfd_arch_maxq, /* Dallas MAXQ 10/20 */ -#define bfd_mach_maxq10 10 -#define bfd_mach_maxq20 20 - bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_last - @}; -@end example - -@subsection bfd_arch_info - - -@strong{Description}@* -This structure contains information on architectures for use -within BFD. -@example - -typedef struct bfd_arch_info -@{ - int bits_per_word; - int bits_per_address; - int bits_per_byte; - enum bfd_architecture arch; - unsigned long mach; - const char *arch_name; - const char *printable_name; - unsigned int section_align_power; - /* TRUE if this is the default machine for the architecture. - The default arch should be the first entry for an arch so that - all the entries for that arch can be accessed via @code{next}. */ - bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); - - bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); - - const struct bfd_arch_info *next; -@} -bfd_arch_info_type; - -@end example - -@findex bfd_printable_name -@subsubsection @code{bfd_printable_name} -@strong{Synopsis} -@example -const char *bfd_printable_name (bfd *abfd); -@end example -@strong{Description}@* -Return a printable string representing the architecture and machine -from the pointer to the architecture info structure. - -@findex bfd_scan_arch -@subsubsection @code{bfd_scan_arch} -@strong{Synopsis} -@example -const bfd_arch_info_type *bfd_scan_arch (const char *string); -@end example -@strong{Description}@* -Figure out if BFD supports any cpu which could be described with -the name @var{string}. Return a pointer to an @code{arch_info} -structure if a machine is found, otherwise NULL. - -@findex bfd_arch_list -@subsubsection @code{bfd_arch_list} -@strong{Synopsis} -@example -const char **bfd_arch_list (void); -@end example -@strong{Description}@* -Return a freshly malloced NULL-terminated vector of the names -of all the valid BFD architectures. Do not modify the names. - -@findex bfd_arch_get_compatible -@subsubsection @code{bfd_arch_get_compatible} -@strong{Synopsis} -@example -const bfd_arch_info_type *bfd_arch_get_compatible - (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns); -@end example -@strong{Description}@* -Determine whether two BFDs' architectures and machine types -are compatible. Calculates the lowest common denominator -between the two architectures and machine types implied by -the BFDs and returns a pointer to an @code{arch_info} structure -describing the compatible machine. - -@findex bfd_default_arch_struct -@subsubsection @code{bfd_default_arch_struct} -@strong{Description}@* -The @code{bfd_default_arch_struct} is an item of -@code{bfd_arch_info_type} which has been initialized to a fairly -generic state. A BFD starts life by pointing to this -structure, until the correct back end has determined the real -architecture of the file. -@example -extern const bfd_arch_info_type bfd_default_arch_struct; -@end example - -@findex bfd_set_arch_info -@subsubsection @code{bfd_set_arch_info} -@strong{Synopsis} -@example -void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -@end example -@strong{Description}@* -Set the architecture info of @var{abfd} to @var{arg}. - -@findex bfd_default_set_arch_mach -@subsubsection @code{bfd_default_set_arch_mach} -@strong{Synopsis} -@example -bfd_boolean bfd_default_set_arch_mach - (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -@end example -@strong{Description}@* -Set the architecture and machine type in BFD @var{abfd} -to @var{arch} and @var{mach}. Find the correct -pointer to a structure and insert it into the @code{arch_info} -pointer. - -@findex bfd_get_arch -@subsubsection @code{bfd_get_arch} -@strong{Synopsis} -@example -enum bfd_architecture bfd_get_arch (bfd *abfd); -@end example -@strong{Description}@* -Return the enumerated type which describes the BFD @var{abfd}'s -architecture. - -@findex bfd_get_mach -@subsubsection @code{bfd_get_mach} -@strong{Synopsis} -@example -unsigned long bfd_get_mach (bfd *abfd); -@end example -@strong{Description}@* -Return the long type which describes the BFD @var{abfd}'s -machine. - -@findex bfd_arch_bits_per_byte -@subsubsection @code{bfd_arch_bits_per_byte} -@strong{Synopsis} -@example -unsigned int bfd_arch_bits_per_byte (bfd *abfd); -@end example -@strong{Description}@* -Return the number of bits in one of the BFD @var{abfd}'s -architecture's bytes. - -@findex bfd_arch_bits_per_address -@subsubsection @code{bfd_arch_bits_per_address} -@strong{Synopsis} -@example -unsigned int bfd_arch_bits_per_address (bfd *abfd); -@end example -@strong{Description}@* -Return the number of bits in one of the BFD @var{abfd}'s -architecture's addresses. - -@findex bfd_default_compatible -@subsubsection @code{bfd_default_compatible} -@strong{Synopsis} -@example -const bfd_arch_info_type *bfd_default_compatible - (const bfd_arch_info_type *a, const bfd_arch_info_type *b); -@end example -@strong{Description}@* -The default function for testing for compatibility. - -@findex bfd_default_scan -@subsubsection @code{bfd_default_scan} -@strong{Synopsis} -@example -bfd_boolean bfd_default_scan - (const struct bfd_arch_info *info, const char *string); -@end example -@strong{Description}@* -The default function for working out whether this is an -architecture hit and a machine hit. - -@findex bfd_get_arch_info -@subsubsection @code{bfd_get_arch_info} -@strong{Synopsis} -@example -const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); -@end example -@strong{Description}@* -Return the architecture info struct in @var{abfd}. - -@findex bfd_lookup_arch -@subsubsection @code{bfd_lookup_arch} -@strong{Synopsis} -@example -const bfd_arch_info_type *bfd_lookup_arch - (enum bfd_architecture arch, unsigned long machine); -@end example -@strong{Description}@* -Look for the architecture info structure which matches the -arguments @var{arch} and @var{machine}. A machine of 0 matches the -machine/architecture structure which marks itself as the -default. - -@findex bfd_printable_arch_mach -@subsubsection @code{bfd_printable_arch_mach} -@strong{Synopsis} -@example -const char *bfd_printable_arch_mach - (enum bfd_architecture arch, unsigned long machine); -@end example -@strong{Description}@* -Return a printable string representing the architecture and -machine type. - -This routine is depreciated. - -@findex bfd_octets_per_byte -@subsubsection @code{bfd_octets_per_byte} -@strong{Synopsis} -@example -unsigned int bfd_octets_per_byte (bfd *abfd); -@end example -@strong{Description}@* -Return the number of octets (8-bit quantities) per target byte -(minimum addressable unit). In most cases, this will be one, but some -DSP targets have 16, 32, or even 48 bits per byte. - -@findex bfd_arch_mach_octets_per_byte -@subsubsection @code{bfd_arch_mach_octets_per_byte} -@strong{Synopsis} -@example -unsigned int bfd_arch_mach_octets_per_byte - (enum bfd_architecture arch, unsigned long machine); -@end example -@strong{Description}@* -See bfd_octets_per_byte. - -This routine is provided for those cases where a bfd * is not -available - diff --git a/bfd/doc/bfd.info b/bfd/doc/bfd.info deleted file mode 100644 index 14f4c2cdedd..00000000000 --- a/bfd/doc/bfd.info +++ /dev/null @@ -1,10305 +0,0 @@ -This is ../.././bfd/doc/bfd.info, produced by makeinfo version 4.8 from -../.././bfd/doc/bfd.texinfo. - -START-INFO-DIR-ENTRY -* Bfd: (bfd). The Binary File Descriptor library. -END-INFO-DIR-ENTRY - - This file documents the BFD library. - - Copyright (C) 1991, 2000, 2001, 2003 Free Software Foundation, Inc. - - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.1 - or any later version published by the Free Software Foundation; - with no Invariant Sections, with no Front-Cover Texts, and with no - Back-Cover Texts. A copy of the license is included in the -section entitled "GNU Free Documentation License". - - -File: bfd.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir) - - This file documents the binary file descriptor library libbfd. - -* Menu: - -* Overview:: Overview of BFD -* BFD front end:: BFD front end -* BFD back ends:: BFD back ends -* GNU Free Documentation License:: GNU Free Documentation License -* Index:: Index - - -File: bfd.info, Node: Overview, Next: BFD front end, Prev: Top, Up: Top - -1 Introduction -************** - -BFD is a package which allows applications to use the same routines to -operate on object files whatever the object file format. A new object -file format can be supported simply by creating a new BFD back end and -adding it to the library. - - BFD is split into two parts: the front end, and the back ends (one -for each object file format). - * The front end of BFD provides the interface to the user. It manages - memory and various canonical data structures. The front end also - decides which back end to use and when to call back end routines. - - * The back ends provide BFD its view of the real world. Each back - end provides a set of calls which the BFD front end can use to - maintain its canonical form. The back ends also may keep around - information for their own use, for greater efficiency. - -* Menu: - -* History:: History -* How It Works:: How It Works -* What BFD Version 2 Can Do:: What BFD Version 2 Can Do - - -File: bfd.info, Node: History, Next: How It Works, Prev: Overview, Up: Overview - -1.1 History -=========== - -One spur behind BFD was the desire, on the part of the GNU 960 team at -Intel Oregon, for interoperability of applications on their COFF and -b.out file formats. Cygnus was providing GNU support for the team, and -was contracted to provide the required functionality. - - The name came from a conversation David Wallace was having with -Richard Stallman about the library: RMS said that it would be quite -hard--David said "BFD". Stallman was right, but the name stuck. - - At the same time, Ready Systems wanted much the same thing, but for -different object file formats: IEEE-695, Oasys, Srecords, a.out and 68k -coff. - - BFD was first implemented by members of Cygnus Support; Steve -Chamberlain (`sac@cygnus.com'), John Gilmore (`gnu@cygnus.com'), K. -Richard Pixley (`rich@cygnus.com') and David Henkel-Wallace -(`gumby@cygnus.com'). - - -File: bfd.info, Node: How It Works, Next: What BFD Version 2 Can Do, Prev: History, Up: Overview - -1.2 How To Use BFD -================== - -To use the library, include `bfd.h' and link with `libbfd.a'. - - BFD provides a common interface to the parts of an object file for a -calling application. - - When an application sucessfully opens a target file (object, -archive, or whatever), a pointer to an internal structure is returned. -This pointer points to a structure called `bfd', described in `bfd.h'. -Our convention is to call this pointer a BFD, and instances of it -within code `abfd'. All operations on the target object file are -applied as methods to the BFD. The mapping is defined within `bfd.h' -in a set of macros, all beginning with `bfd_' to reduce namespace -pollution. - - For example, this sequence does what you would probably expect: -return the number of sections in an object file attached to a BFD -`abfd'. - - #include "bfd.h" - - unsigned int number_of_sections (abfd) - bfd *abfd; - { - return bfd_count_sections (abfd); - } - - The abstraction used within BFD is that an object file has: - - * a header, - - * a number of sections containing raw data (*note Sections::), - - * a set of relocations (*note Relocations::), and - - * some symbol information (*note Symbols::). - Also, BFDs opened for archives have the additional attribute of an -index and contain subordinate BFDs. This approach is fine for a.out and -coff, but loses efficiency when applied to formats such as S-records and -IEEE-695. - - -File: bfd.info, Node: What BFD Version 2 Can Do, Prev: How It Works, Up: Overview - -1.3 What BFD Version 2 Can Do -============================= - -When an object file is opened, BFD subroutines automatically determine -the format of the input object file. They then build a descriptor in -memory with pointers to routines that will be used to access elements of -the object file's data structures. - - As different information from the object files is required, BFD -reads from different sections of the file and processes them. For -example, a very common operation for the linker is processing symbol -tables. Each BFD back end provides a routine for converting between -the object file's representation of symbols and an internal canonical -format. When the linker asks for the symbol table of an object file, it -calls through a memory pointer to the routine from the relevant BFD -back end which reads and converts the table into a canonical form. The -linker then operates upon the canonical form. When the link is finished -and the linker writes the output file's symbol table, another BFD back -end routine is called to take the newly created symbol table and -convert it into the chosen output format. - -* Menu: - -* BFD information loss:: Information Loss -* Canonical format:: The BFD canonical object-file format - - -File: bfd.info, Node: BFD information loss, Next: Canonical format, Up: What BFD Version 2 Can Do - -1.3.1 Information Loss ----------------------- - -_Information can be lost during output._ The output formats supported -by BFD do not provide identical facilities, and information which can -be described in one form has nowhere to go in another format. One -example of this is alignment information in `b.out'. There is nowhere -in an `a.out' format file to store alignment information on the -contained data, so when a file is linked from `b.out' and an `a.out' -image is produced, alignment information will not propagate to the -output file. (The linker will still use the alignment information -internally, so the link is performed correctly). - - Another example is COFF section names. COFF files may contain an -unlimited number of sections, each one with a textual section name. If -the target of the link is a format which does not have many sections -(e.g., `a.out') or has sections without names (e.g., the Oasys format), -the link cannot be done simply. You can circumvent this problem by -describing the desired input-to-output section mapping with the linker -command language. - - _Information can be lost during canonicalization._ The BFD internal -canonical form of the external formats is not exhaustive; there are -structures in input formats for which there is no direct representation -internally. This means that the BFD back ends cannot maintain all -possible data richness through the transformation between external to -internal and back to external formats. - - This limitation is only a problem when an application reads one -format and writes another. Each BFD back end is responsible for -maintaining as much data as possible, and the internal BFD canonical -form has structures which are opaque to the BFD core, and exported only -to the back ends. When a file is read in one format, the canonical form -is generated for BFD and the application. At the same time, the back -end saves away any information which may otherwise be lost. If the data -is then written back in the same format, the back end routine will be -able to use the canonical form provided by the BFD core as well as the -information it prepared earlier. Since there is a great deal of -commonality between back ends, there is no information lost when -linking or copying big endian COFF to little endian COFF, or `a.out' to -`b.out'. When a mixture of formats is linked, the information is only -lost from the files whose format differs from the destination. - - -File: bfd.info, Node: Canonical format, Prev: BFD information loss, Up: What BFD Version 2 Can Do - -1.3.2 The BFD canonical object-file format ------------------------------------------- - -The greatest potential for loss of information occurs when there is the -least overlap between the information provided by the source format, -that stored by the canonical format, and that needed by the destination -format. A brief description of the canonical form may help you -understand which kinds of data you can count on preserving across -conversions. - -_files_ - Information stored on a per-file basis includes target machine - architecture, particular implementation format type, a demand - pageable bit, and a write protected bit. Information like Unix - magic numbers is not stored here--only the magic numbers' meaning, - so a `ZMAGIC' file would have both the demand pageable bit and the - write protected text bit set. The byte order of the target is - stored on a per-file basis, so that big- and little-endian object - files may be used with one another. - -_sections_ - Each section in the input file contains the name of the section, - the section's original address in the object file, size and - alignment information, various flags, and pointers into other BFD - data structures. - -_symbols_ - Each symbol contains a pointer to the information for the object - file which originally defined it, its name, its value, and various - flag bits. When a BFD back end reads in a symbol table, it - relocates all symbols to make them relative to the base of the - section where they were defined. Doing this ensures that each - symbol points to its containing section. Each symbol also has a - varying amount of hidden private data for the BFD back end. Since - the symbol points to the original file, the private data format - for that symbol is accessible. `ld' can operate on a collection - of symbols of wildly different formats without problems. - - Normal global and simple local symbols are maintained on output, - so an output file (no matter its format) will retain symbols - pointing to functions and to global, static, and common variables. - Some symbol information is not worth retaining; in `a.out', type - information is stored in the symbol table as long symbol names. - This information would be useless to most COFF debuggers; the - linker has command line switches to allow users to throw it away. - - There is one word of type information within the symbol, so if the - format supports symbol type information within symbols (for - example, COFF, IEEE, Oasys) and the type is simple enough to fit - within one word (nearly everything but aggregates), the - information will be preserved. - -_relocation level_ - Each canonical BFD relocation record contains a pointer to the - symbol to relocate to, the offset of the data to relocate, the - section the data is in, and a pointer to a relocation type - descriptor. Relocation is performed by passing messages through - the relocation type descriptor and the symbol pointer. Therefore, - relocations can be performed on output data using a relocation - method that is only available in one of the input formats. For - instance, Oasys provides a byte relocation format. A relocation - record requesting this relocation type would point indirectly to a - routine to perform this, so the relocation may be performed on a - byte being written to a 68k COFF file, even though 68k COFF has no - such relocation type. - -_line numbers_ - Object formats can contain, for debugging purposes, some form of - mapping between symbols, source line numbers, and addresses in the - output file. These addresses have to be relocated along with the - symbol information. Each symbol with an associated list of line - number records points to the first record of the list. The head - of a line number list consists of a pointer to the symbol, which - allows finding out the address of the function whose line number - is being described. The rest of the list is made up of pairs: - offsets into the section and line numbers. Any format which can - simply derive this information can pass it successfully between - formats (COFF, IEEE and Oasys). - - -File: bfd.info, Node: BFD front end, Next: BFD back ends, Prev: Overview, Up: Top - -2 BFD Front End -*************** - -2.1 `typedef bfd' -================= - -A BFD has type `bfd'; objects of this type are the cornerstone of any -application using BFD. Using BFD consists of making references though -the BFD and to data in the BFD. - - Here is the structure that defines the type `bfd'. It contains the -major data about the file and pointers to the rest of the data. - - - struct bfd - { - /* A unique identifier of the BFD */ - unsigned int id; - - /* The filename the application opened the BFD with. */ - const char *filename; - - /* A pointer to the target jump table. */ - const struct bfd_target *xvec; - - /* The IOSTREAM, and corresponding IO vector that provide access - to the file backing the BFD. */ - void *iostream; - const struct bfd_iovec *iovec; - - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - bfd_boolean cacheable; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - bfd_boolean target_defaulted; - - /* The caching routines use these to maintain a - least-recently-used list of BFDs. */ - struct bfd *lru_prev, *lru_next; - - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ - ufile_ptr where; - - /* ... and here: (``once'' means at least once). */ - bfd_boolean opened_once; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - bfd_boolean mtime_set; - - /* File modified time, if mtime_set is TRUE. */ - long mtime; - - /* Reserved for an unimplemented file locking extension. */ - int ifd; - - /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; - - /* The direction with which the BFD was opened. */ - enum bfd_direction - { - no_direction = 0, - read_direction = 1, - write_direction = 2, - both_direction = 3 - } - direction; - - /* Format_specific flags. */ - flagword flags; - - /* Currently my_archive is tested before adding origin to - anything. I believe that this can become always an add of - origin, with origin set to 0 for non archive files. */ - ufile_ptr origin; - - /* Remember when output has begun, to stop strange things - from happening. */ - bfd_boolean output_has_begun; - - /* A hash table for section names. */ - struct bfd_hash_table section_htab; - - /* Pointer to linked list of sections. */ - struct bfd_section *sections; - - /* The last section on the section list. */ - struct bfd_section *section_last; - - /* The number of sections. */ - unsigned int section_count; - - /* Stuff only useful for object files: - The start address. */ - bfd_vma start_address; - - /* Used for input and output. */ - unsigned int symcount; - - /* Symbol table for output BFD (with symcount entries). */ - struct bfd_symbol **outsymbols; - - /* Used for slurped dynamic symbol tables. */ - unsigned int dynsymcount; - - /* Pointer to structure which contains architecture information. */ - const struct bfd_arch_info *arch_info; - - /* Flag set if symbols from this BFD should not be exported. */ - bfd_boolean no_export; - - /* Stuff only useful for archives. */ - void *arelt_data; - struct bfd *my_archive; /* The containing archive BFD. */ - struct bfd *next; /* The next BFD in the archive. */ - struct bfd *archive_head; /* The first BFD in the archive. */ - bfd_boolean has_armap; - - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; - - /* Used by the back end to hold private data. */ - union - { - struct aout_data_struct *aout_data; - struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; - struct coff_tdata *coff_obj_data; - struct pe_tdata *pe_obj_data; - struct xcoff_tdata *xcoff_obj_data; - struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; - struct srec_data_struct *srec_data; - struct ihex_data_struct *ihex_data; - struct tekhex_data_struct *tekhex_data; - struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; - struct mmo_data_struct *mmo_data; - struct sun_core_struct *sun_core_data; - struct sco5_core_struct *sco5_core_data; - struct trad_core_struct *trad_core_data; - struct som_data_struct *som_data; - struct hpux_core_struct *hpux_core_data; - struct hppabsd_core_struct *hppabsd_core_data; - struct sgi_core_struct *sgi_core_data; - struct lynx_core_struct *lynx_core_data; - struct osf_core_struct *osf_core_data; - struct cisco_core_struct *cisco_core_data; - struct versados_data_struct *versados_data; - struct netbsd_core_struct *netbsd_core_data; - struct mach_o_data_struct *mach_o_data; - struct mach_o_fat_data_struct *mach_o_fat_data; - struct bfd_pef_data_struct *pef_data; - struct bfd_pef_xlib_data_struct *pef_xlib_data; - struct bfd_sym_data_struct *sym_data; - void *any; - } - tdata; - - /* Used by the application to hold private data. */ - void *usrdata; - - /* Where all the allocated stuff under this BFD goes. This is a - struct objalloc *, but we use void * to avoid requiring the inclusion - of objalloc.h. */ - void *memory; - }; - -2.2 Error reporting -=================== - -Most BFD functions return nonzero on success (check their individual -documentation for precise semantics). On an error, they call -`bfd_set_error' to set an error condition that callers can check by -calling `bfd_get_error'. If that returns `bfd_error_system_call', then -check `errno'. - - The easiest way to report a BFD error to the user is to use -`bfd_perror'. - -2.2.1 Type `bfd_error_type' ---------------------------- - -The values returned by `bfd_get_error' are defined by the enumerated -type `bfd_error_type'. - - - typedef enum bfd_error - { - bfd_error_no_error = 0, - bfd_error_system_call, - bfd_error_invalid_target, - bfd_error_wrong_format, - bfd_error_wrong_object_format, - bfd_error_invalid_operation, - bfd_error_no_memory, - bfd_error_no_symbols, - bfd_error_no_armap, - bfd_error_no_more_archived_files, - bfd_error_malformed_archive, - bfd_error_file_not_recognized, - bfd_error_file_ambiguously_recognized, - bfd_error_no_contents, - bfd_error_nonrepresentable_section, - bfd_error_no_debug_section, - bfd_error_bad_value, - bfd_error_file_truncated, - bfd_error_file_too_big, - bfd_error_invalid_error_code - } - bfd_error_type; - -2.2.1.1 `bfd_get_error' -....................... - -*Synopsis* - bfd_error_type bfd_get_error (void); - *Description* -Return the current BFD error condition. - -2.2.1.2 `bfd_set_error' -....................... - -*Synopsis* - void bfd_set_error (bfd_error_type error_tag); - *Description* -Set the BFD error condition to be ERROR_TAG. - -2.2.1.3 `bfd_errmsg' -.................... - -*Synopsis* - const char *bfd_errmsg (bfd_error_type error_tag); - *Description* -Return a string describing the error ERROR_TAG, or the system error if -ERROR_TAG is `bfd_error_system_call'. - -2.2.1.4 `bfd_perror' -.................... - -*Synopsis* - void bfd_perror (const char *message); - *Description* -Print to the standard error stream a string describing the last BFD -error that occurred, or the last system error if the last BFD error was -a system call failure. If MESSAGE is non-NULL and non-empty, the error -string printed is preceded by MESSAGE, a colon, and a space. It is -followed by a newline. - -2.2.2 BFD error handler ------------------------ - -Some BFD functions want to print messages describing the problem. They -call a BFD error handler function. This function may be overridden by -the program. - - The BFD error handler acts like printf. - - - typedef void (*bfd_error_handler_type) (const char *, ...); - -2.2.2.1 `bfd_set_error_handler' -............................... - -*Synopsis* - bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); - *Description* -Set the BFD error handler function. Returns the previous function. - -2.2.2.2 `bfd_set_error_program_name' -.................................... - -*Synopsis* - void bfd_set_error_program_name (const char *); - *Description* -Set the program name to use when printing a BFD error. This is printed -before the error message followed by a colon and space. The string -must not be changed after it is passed to this function. - -2.2.2.3 `bfd_get_error_handler' -............................... - -*Synopsis* - bfd_error_handler_type bfd_get_error_handler (void); - *Description* -Return the BFD error handler function. - -2.3 Miscellaneous -================= - -2.3.1 Miscellaneous functions ------------------------------ - -2.3.1.1 `bfd_get_reloc_upper_bound' -................................... - -*Synopsis* - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); - *Description* -Return the number of bytes required to store the relocation information -associated with section SECT attached to bfd ABFD. If an error occurs, -return -1. - -2.3.1.2 `bfd_canonicalize_reloc' -................................ - -*Synopsis* - long bfd_canonicalize_reloc - (bfd *abfd, asection *sec, arelent **loc, asymbol **syms); - *Description* -Call the back end associated with the open BFD ABFD and translate the -external form of the relocation information attached to SEC into the -internal canonical form. Place the table into memory at LOC, which has -been preallocated, usually by a call to `bfd_get_reloc_upper_bound'. -Returns the number of relocs, or -1 on error. - - The SYMS table is also needed for horrible internal magic reasons. - -2.3.1.3 `bfd_set_reloc' -....................... - -*Synopsis* - void bfd_set_reloc - (bfd *abfd, asection *sec, arelent **rel, unsigned int count); - *Description* -Set the relocation pointer and count within section SEC to the values -REL and COUNT. The argument ABFD is ignored. - -2.3.1.4 `bfd_set_file_flags' -............................ - -*Synopsis* - bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); - *Description* -Set the flag word in the BFD ABFD to the value FLAGS. - - Possible errors are: - * `bfd_error_wrong_format' - The target bfd was not of object format. - - * `bfd_error_invalid_operation' - The target bfd was open for - reading. - - * `bfd_error_invalid_operation' - The flag word contained a bit - which was not applicable to the type of file. E.g., an attempt - was made to set the `D_PAGED' bit on a BFD format which does not - support demand paging. - -2.3.1.5 `bfd_get_arch_size' -........................... - -*Synopsis* - int bfd_get_arch_size (bfd *abfd); - *Description* -Returns the architecture address size, in bits, as determined by the -object file's format. For ELF, this information is included in the -header. - - *Returns* -Returns the arch size in bits if known, `-1' otherwise. - -2.3.1.6 `bfd_get_sign_extend_vma' -................................. - -*Synopsis* - int bfd_get_sign_extend_vma (bfd *abfd); - *Description* -Indicates if the target architecture "naturally" sign extends an -address. Some architectures implicitly sign extend address values when -they are converted to types larger than the size of an address. For -instance, bfd_get_start_address() will return an address sign extended -to fill a bfd_vma when this is the case. - - *Returns* -Returns `1' if the target architecture is known to sign extend -addresses, `0' if the target architecture is known to not sign extend -addresses, and `-1' otherwise. - -2.3.1.7 `bfd_set_start_address' -............................... - -*Synopsis* - bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma); - *Description* -Make VMA the entry point of output BFD ABFD. - - *Returns* -Returns `TRUE' on success, `FALSE' otherwise. - -2.3.1.8 `bfd_get_gp_size' -......................... - -*Synopsis* - unsigned int bfd_get_gp_size (bfd *abfd); - *Description* -Return the maximum size of objects to be optimized using the GP -register under MIPS ECOFF. This is typically set by the `-G' argument -to the compiler, assembler or linker. - -2.3.1.9 `bfd_set_gp_size' -......................... - -*Synopsis* - void bfd_set_gp_size (bfd *abfd, unsigned int i); - *Description* -Set the maximum size of objects to be optimized using the GP register -under ECOFF or MIPS ELF. This is typically set by the `-G' argument to -the compiler, assembler or linker. - -2.3.1.10 `bfd_scan_vma' -....................... - -*Synopsis* - bfd_vma bfd_scan_vma (const char *string, const char **end, int base); - *Description* -Convert, like `strtoul', a numerical expression STRING into a `bfd_vma' -integer, and return that integer. (Though without as many bells and -whistles as `strtoul'.) The expression is assumed to be unsigned -(i.e., positive). If given a BASE, it is used as the base for -conversion. A base of 0 causes the function to interpret the string in -hex if a leading "0x" or "0X" is found, otherwise in octal if a leading -zero is found, otherwise in decimal. - - If the value would overflow, the maximum `bfd_vma' value is returned. - -2.3.1.11 `bfd_copy_private_header_data' -....................................... - -*Synopsis* - bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); - *Description* -Copy private BFD header information from the BFD IBFD to the the BFD -OBFD. This copies information that may require sections to exist, but -does not require symbol tables. Return `true' on success, `false' on -error. Possible error returns are: - - * `bfd_error_no_memory' - Not enough memory exists to create private - data for OBFD. - - #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) - -2.3.1.12 `bfd_copy_private_bfd_data' -.................................... - -*Synopsis* - bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); - *Description* -Copy private BFD information from the BFD IBFD to the the BFD OBFD. -Return `TRUE' on success, `FALSE' on error. Possible error returns are: - - * `bfd_error_no_memory' - Not enough memory exists to create private - data for OBFD. - - #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) - -2.3.1.13 `bfd_merge_private_bfd_data' -..................................... - -*Synopsis* - bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - *Description* -Merge private BFD information from the BFD IBFD to the the output file -BFD OBFD when linking. Return `TRUE' on success, `FALSE' on error. -Possible error returns are: - - * `bfd_error_no_memory' - Not enough memory exists to create private - data for OBFD. - - #define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) - -2.3.1.14 `bfd_set_private_flags' -................................ - -*Synopsis* - bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); - *Description* -Set private BFD flag information in the BFD ABFD. Return `TRUE' on -success, `FALSE' on error. Possible error returns are: - - * `bfd_error_no_memory' - Not enough memory exists to create private - data for OBFD. - - #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) - -2.3.1.15 `Other functions' -.......................... - -*Description* -The following functions exist but have not yet been documented. - #define bfd_sizeof_headers(abfd, reloc) \ - BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) - - #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ - BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) - - #define bfd_find_line(abfd, syms, sym, file, line) \ - BFD_SEND (abfd, _bfd_find_line, \ - (abfd, syms, sym, file, line)) - - #define bfd_find_inliner_info(abfd, file, func, line) \ - BFD_SEND (abfd, _bfd_find_inliner_info, \ - (abfd, file, func, line)) - - #define bfd_debug_info_start(abfd) \ - BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) - - #define bfd_debug_info_end(abfd) \ - BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) - - #define bfd_debug_info_accumulate(abfd, section) \ - BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) - - #define bfd_stat_arch_elt(abfd, stat) \ - BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) - - #define bfd_update_armap_timestamp(abfd) \ - BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd)) - - #define bfd_set_arch_mach(abfd, arch, mach)\ - BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) - - #define bfd_relax_section(abfd, section, link_info, again) \ - BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again)) - - #define bfd_gc_sections(abfd, link_info) \ - BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info)) - - #define bfd_merge_sections(abfd, link_info) \ - BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info)) - - #define bfd_is_group_section(abfd, sec) \ - BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) - - #define bfd_discard_group(abfd, sec) \ - BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) - - #define bfd_link_hash_table_create(abfd) \ - BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) - - #define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - - #define bfd_link_add_symbols(abfd, info) \ - BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) - - #define bfd_link_just_syms(abfd, sec, info) \ - BFD_SEND (abfd, _bfd_link_just_syms, (sec, info)) - - #define bfd_final_link(abfd, info) \ - BFD_SEND (abfd, _bfd_final_link, (abfd, info)) - - #define bfd_free_cached_info(abfd) \ - BFD_SEND (abfd, _bfd_free_cached_info, (abfd)) - - #define bfd_get_dynamic_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd)) - - #define bfd_print_private_bfd_data(abfd, file)\ - BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file)) - - #define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \ - BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols)) - - #define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \ - BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \ - dyncount, dynsyms, ret)) - - #define bfd_get_dynamic_reloc_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd)) - - #define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \ - BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms)) - - extern bfd_byte *bfd_get_relocated_section_contents - (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, - bfd_boolean, asymbol **); - -2.3.1.16 `bfd_alt_mach_code' -............................ - -*Synopsis* - bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); - *Description* -When more than one machine code number is available for the same -machine type, this function can be used to switch between the preferred -one (alternative == 0) and any others. Currently, only ELF supports -this feature, with up to two alternate machine codes. - - struct bfd_preserve - { - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; - }; - -2.3.1.17 `bfd_preserve_save' -............................ - -*Synopsis* - bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - *Description* -When testing an object for compatibility with a particular target -back-end, the back-end object_p function needs to set up certain fields -in the bfd on successfully recognizing the object. This typically -happens in a piecemeal fashion, with failures possible at many points. -On failure, the bfd is supposed to be restored to its initial state, -which is virtually impossible. However, restoring a subset of the bfd -state works in practice. This function stores the subset and -reinitializes the bfd. - -2.3.1.18 `bfd_preserve_restore' -............................... - -*Synopsis* - void bfd_preserve_restore (bfd *, struct bfd_preserve *); - *Description* -This function restores bfd state saved by bfd_preserve_save. If MARKER -is non-NULL in struct bfd_preserve then that block and all subsequently -bfd_alloc'd memory is freed. - -2.3.1.19 `bfd_preserve_finish' -.............................. - -*Synopsis* - void bfd_preserve_finish (bfd *, struct bfd_preserve *); - *Description* -This function should be called when the bfd state saved by -bfd_preserve_save is no longer needed. ie. when the back-end object_p -function returns with success. - -2.3.1.20 `struct bfd_iovec' -........................... - -*Description* -The `struct bfd_iovec' contains the internal file I/O class. Each -`BFD' has an instance of this class and all file I/O is routed through -it (it is assumed that the instance implements all methods listed -below). - struct bfd_iovec - { - /* To avoid problems with macros, a "b" rather than "f" - prefix is prepended to each method name. */ - /* Attempt to read/write NBYTES on ABFD's IOSTREAM storing/fetching - bytes starting at PTR. Return the number of bytes actually - transfered (a read past end-of-file returns less than NBYTES), - or -1 (setting `bfd_error') if an error occurs. */ - file_ptr (*bread) (struct bfd *abfd, void *ptr, file_ptr nbytes); - file_ptr (*bwrite) (struct bfd *abfd, const void *ptr, - file_ptr nbytes); - /* Return the current IOSTREAM file offset, or -1 (setting `bfd_error' - if an error occurs. */ - file_ptr (*btell) (struct bfd *abfd); - /* For the following, on successful completion a value of 0 is returned. - Otherwise, a value of -1 is returned (and `bfd_error' is set). */ - int (*bseek) (struct bfd *abfd, file_ptr offset, int whence); - int (*bclose) (struct bfd *abfd); - int (*bflush) (struct bfd *abfd); - int (*bstat) (struct bfd *abfd, struct stat *sb); - }; - -2.3.1.21 `bfd_get_mtime' -........................ - -*Synopsis* - long bfd_get_mtime (bfd *abfd); - *Description* -Return the file modification time (as read from the file system, or -from the archive header for archive members). - -2.3.1.22 `bfd_get_size' -....................... - -*Synopsis* - long bfd_get_size (bfd *abfd); - *Description* -Return the file size (as read from file system) for the file associated -with BFD ABFD. - - The initial motivation for, and use of, this routine is not so we -can get the exact size of the object the BFD applies to, since that -might not be generally possible (archive members for example). It -would be ideal if someone could eventually modify it so that such -results were guaranteed. - - Instead, we want to ask questions like "is this NNN byte sized -object I'm about to try read from file offset YYY reasonable?" As as -example of where we might do this, some object formats use string -tables for which the first `sizeof (long)' bytes of the table contain -the size of the table itself, including the size bytes. If an -application tries to read what it thinks is one of these string tables, -without some way to validate the size, and for some reason the size is -wrong (byte swapping error, wrong location for the string table, etc.), -the only clue is likely to be a read error when it tries to read the -table, or a "virtual memory exhausted" error when it tries to allocate -15 bazillon bytes of space for the 15 bazillon byte table it is about -to read. This function at least allows us to answer the question, "is -the size reasonable?". - -* Menu: - -* Memory Usage:: -* Initialization:: -* Sections:: -* Symbols:: -* Archives:: -* Formats:: -* Relocations:: -* Core Files:: -* Targets:: -* Architectures:: -* Opening and Closing:: -* Internal:: -* File Caching:: -* Linker Functions:: -* Hash Tables:: - - -File: bfd.info, Node: Memory Usage, Next: Initialization, Prev: BFD front end, Up: BFD front end - -2.4 Memory Usage -================ - -BFD keeps all of its internal structures in obstacks. There is one -obstack per open BFD file, into which the current state is stored. When -a BFD is closed, the obstack is deleted, and so everything which has -been allocated by BFD for the closing file is thrown away. - - BFD does not free anything created by an application, but pointers -into `bfd' structures become invalid on a `bfd_close'; for example, -after a `bfd_close' the vector passed to `bfd_canonicalize_symtab' is -still around, since it has been allocated by the application, but the -data that it pointed to are lost. - - The general rule is to not close a BFD until all operations dependent -upon data from the BFD have been completed, or all the data from within -the file has been copied. To help with the management of memory, there -is a function (`bfd_alloc_size') which returns the number of bytes in -obstacks associated with the supplied BFD. This could be used to select -the greediest open BFD, close it to reclaim the memory, perform some -operation and reopen the BFD again, to get a fresh copy of the data -structures. - - -File: bfd.info, Node: Initialization, Next: Sections, Prev: Memory Usage, Up: BFD front end - -2.5 Initialization -================== - -2.5.1 Initialization functions ------------------------------- - -These are the functions that handle initializing a BFD. - -2.5.1.1 `bfd_init' -.................. - -*Synopsis* - void bfd_init (void); - *Description* -This routine must be called before any other BFD function to initialize -magical internal data structures. - - -File: bfd.info, Node: Sections, Next: Symbols, Prev: Initialization, Up: BFD front end - -2.6 Sections -============ - -The raw data contained within a BFD is maintained through the section -abstraction. A single BFD may have any number of sections. It keeps -hold of them by pointing to the first; each one points to the next in -the list. - - Sections are supported in BFD in `section.c'. - -* Menu: - -* Section Input:: -* Section Output:: -* typedef asection:: -* section prototypes:: - - -File: bfd.info, Node: Section Input, Next: Section Output, Prev: Sections, Up: Sections - -2.6.1 Section input -------------------- - -When a BFD is opened for reading, the section structures are created -and attached to the BFD. - - Each section has a name which describes the section in the outside -world--for example, `a.out' would contain at least three sections, -called `.text', `.data' and `.bss'. - - Names need not be unique; for example a COFF file may have several -sections named `.data'. - - Sometimes a BFD will contain more than the "natural" number of -sections. A back end may attach other sections containing constructor -data, or an application may add a section (using `bfd_make_section') to -the sections attached to an already open BFD. For example, the linker -creates an extra section `COMMON' for each input file's BFD to hold -information about common storage. - - The raw data is not necessarily read in when the section descriptor -is created. Some targets may leave the data in place until a -`bfd_get_section_contents' call is made. Other back ends may read in -all the data at once. For example, an S-record file has to be read -once to determine the size of the data. An IEEE-695 file doesn't -contain raw data in sections, but data and relocation expressions -intermixed, so the data area has to be parsed to get out the data and -relocations. - - -File: bfd.info, Node: Section Output, Next: typedef asection, Prev: Section Input, Up: Sections - -2.6.2 Section output --------------------- - -To write a new object style BFD, the various sections to be written -have to be created. They are attached to the BFD in the same way as -input sections; data is written to the sections using -`bfd_set_section_contents'. - - Any program that creates or combines sections (e.g., the assembler -and linker) must use the `asection' fields `output_section' and -`output_offset' to indicate the file sections to which each section -must be written. (If the section is being created from scratch, -`output_section' should probably point to the section itself and -`output_offset' should probably be zero.) - - The data to be written comes from input sections attached (via -`output_section' pointers) to the output sections. The output section -structure can be considered a filter for the input section: the output -section determines the vma of the output data and the name, but the -input section determines the offset into the output section of the data -to be written. - - E.g., to create a section "O", starting at 0x100, 0x123 long, -containing two subsections, "A" at offset 0x0 (i.e., at vma 0x100) and -"B" at offset 0x20 (i.e., at vma 0x120) the `asection' structures would -look like: - - section name "A" - output_offset 0x00 - size 0x20 - output_section -----------> section name "O" - | vma 0x100 - section name "B" | size 0x123 - output_offset 0x20 | - size 0x103 | - output_section --------| - -2.6.3 Link orders ------------------ - -The data within a section is stored in a "link_order". These are much -like the fixups in `gas'. The link_order abstraction allows a section -to grow and shrink within itself. - - A link_order knows how big it is, and which is the next link_order -and where the raw data for it is; it also points to a list of -relocations which apply to it. - - The link_order is used by the linker to perform relaxing on final -code. The compiler creates code which is as big as necessary to make -it work without relaxing, and the user can select whether to relax. -Sometimes relaxing takes a lot of time. The linker runs around the -relocations to see if any are attached to data which can be shrunk, if -so it does it on a link_order by link_order basis. - - -File: bfd.info, Node: typedef asection, Next: section prototypes, Prev: Section Output, Up: Sections - -2.6.4 typedef asection ----------------------- - -Here is the section structure: - - - typedef struct bfd_section - { - /* The name of the section; the name isn't a copy, the pointer is - the same as that passed to bfd_make_section. */ - const char *name; - - /* A unique sequence number. */ - int id; - - /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; - - /* The next section in the list belonging to the BFD, or NULL. */ - struct bfd_section *next; - - /* The previous section in the list belonging to the BFD, or NULL. */ - struct bfd_section *prev; - - /* The field flags contains attributes of the section. Some - flags are read in from the object file, and some are - synthesized from other information. */ - flagword flags; - - #define SEC_NO_FLAGS 0x000 - - /* Tells the OS to allocate space for this section when loading. - This is clear for a section containing debug information only. */ - #define SEC_ALLOC 0x001 - - /* Tells the OS to load the section from the file when loading. - This is clear for a .bss section. */ - #define SEC_LOAD 0x002 - - /* The section contains data still to be relocated, so there is - some relocation information too. */ - #define SEC_RELOC 0x004 - - /* A signal to the OS that the section contains read only data. */ - #define SEC_READONLY 0x008 - - /* The section contains code only. */ - #define SEC_CODE 0x010 - - /* The section contains data only. */ - #define SEC_DATA 0x020 - - /* The section will reside in ROM. */ - #define SEC_ROM 0x040 - - /* The section contains constructor information. This section - type is used by the linker to create lists of constructors and - destructors used by `g++'. When a back end sees a symbol - which should be used in a constructor list, it creates a new - section for the type of name (e.g., `__CTOR_LIST__'), attaches - the symbol to it, and builds a relocation. To build the lists - of constructors, all the linker has to do is catenate all the - sections called `__CTOR_LIST__' and relocate the data - contained within - exactly the operations it would peform on - standard data. */ - #define SEC_CONSTRUCTOR 0x080 - - /* The section has contents - a data section could be - `SEC_ALLOC' | `SEC_HAS_CONTENTS'; a debug section could be - `SEC_HAS_CONTENTS' */ - #define SEC_HAS_CONTENTS 0x100 - - /* An instruction to the linker to not output the section - even if it has information which would normally be written. */ - #define SEC_NEVER_LOAD 0x200 - - /* The section contains thread local data. */ - #define SEC_THREAD_LOCAL 0x400 - - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ - #define SEC_HAS_GOT_REF 0x800 - - /* The section contains common symbols (symbols may be defined - multiple times, the value of a symbol is the amount of - space it requires, and the largest symbol value is the one - used). Most targets have exactly one of these (which we - translate to bfd_com_section_ptr), but ECOFF has two. */ - #define SEC_IS_COMMON 0x1000 - - /* The section contains only debugging information. For - example, this is set for ELF .debug and .stab sections. - strip tests this flag to see if a section can be - discarded. */ - #define SEC_DEBUGGING 0x2000 - - /* The contents of this section are held in memory pointed to - by the contents field. This is checked by bfd_get_section_contents, - and the data is retrieved from memory if appropriate. */ - #define SEC_IN_MEMORY 0x4000 - - /* The contents of this section are to be excluded by the - linker for executable and shared objects unless those - objects are to be further relocated. */ - #define SEC_EXCLUDE 0x8000 - - /* The contents of this section are to be sorted based on the sum of - the symbol and addend values specified by the associated relocation - entries. Entries without associated relocation entries will be - appended to the end of the section in an unspecified order. */ - #define SEC_SORT_ENTRIES 0x10000 - - /* When linking, duplicate sections of the same name should be - discarded, rather than being combined into a single section as - is usually done. This is similar to how common symbols are - handled. See SEC_LINK_DUPLICATES below. */ - #define SEC_LINK_ONCE 0x20000 - - /* If SEC_LINK_ONCE is set, this bitfield describes how the linker - should handle duplicate sections. */ - #define SEC_LINK_DUPLICATES 0x40000 - - /* This value for SEC_LINK_DUPLICATES means that duplicate - sections with the same name should simply be discarded. */ - #define SEC_LINK_DUPLICATES_DISCARD 0x0 - - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if there are any duplicate sections, although - it should still only link one copy. */ - #define SEC_LINK_DUPLICATES_ONE_ONLY 0x80000 - - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if any duplicate sections are a different size. */ - #define SEC_LINK_DUPLICATES_SAME_SIZE 0x100000 - - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if any duplicate sections contain different - contents. */ - #define SEC_LINK_DUPLICATES_SAME_CONTENTS \ - (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE) - - /* This section was created by the linker as part of dynamic - relocation or other arcane processing. It is skipped when - going through the first-pass output, trusting that someone - else up the line will take care of it later. */ - #define SEC_LINKER_CREATED 0x200000 - - /* This section should not be subject to garbage collection. */ - #define SEC_KEEP 0x400000 - - /* This section contains "short" data, and should be placed - "near" the GP. */ - #define SEC_SMALL_DATA 0x800000 - - /* Attempt to merge identical entities in the section. - Entity size is given in the entsize field. */ - #define SEC_MERGE 0x1000000 - - /* If given with SEC_MERGE, entities to merge are zero terminated - strings where entsize specifies character size instead of fixed - size entries. */ - #define SEC_STRINGS 0x2000000 - - /* This section contains data about section groups. */ - #define SEC_GROUP 0x4000000 - - /* The section is a COFF shared library section. This flag is - only for the linker. If this type of section appears in - the input file, the linker must copy it to the output file - without changing the vma or size. FIXME: Although this - was originally intended to be general, it really is COFF - specific (and the flag was renamed to indicate this). It - might be cleaner to have some more general mechanism to - allow the back end to control what the linker does with - sections. */ - #define SEC_COFF_SHARED_LIBRARY 0x10000000 - - /* This section contains data which may be shared with other - executables or shared objects. This is for COFF only. */ - #define SEC_COFF_SHARED 0x20000000 - - /* When a section with this flag is being linked, then if the size of - the input section is less than a page, it should not cross a page - boundary. If the size of the input section is one page or more, - it should be aligned on a page boundary. This is for TI - TMS320C54X only. */ - #define SEC_TIC54X_BLOCK 0x40000000 - - /* Conditionally link this section; do not link if there are no - references found to any symbol in the section. This is for TI - TMS320C54X only. */ - #define SEC_TIC54X_CLINK 0x80000000 - - /* End of section flags. */ - - /* Some internal packed boolean fields. */ - - /* See the vma field. */ - unsigned int user_set_vma : 1; - - /* A mark flag used by some of the linker backends. */ - unsigned int linker_mark : 1; - - /* Another mark flag used by some of the linker backends. Set for - output sections that have an input section. */ - unsigned int linker_has_input : 1; - - /* Mark flags used by some linker backends for garbage collection. */ - unsigned int gc_mark : 1; - unsigned int gc_mark_from_eh : 1; - - /* The following flags are used by the ELF linker. */ - - /* Mark sections which have been allocated to segments. */ - unsigned int segment_mark : 1; - - /* Type of sec_info information. */ - unsigned int sec_info_type:3; - #define ELF_INFO_TYPE_NONE 0 - #define ELF_INFO_TYPE_STABS 1 - #define ELF_INFO_TYPE_MERGE 2 - #define ELF_INFO_TYPE_EH_FRAME 3 - #define ELF_INFO_TYPE_JUST_SYMS 4 - - /* Nonzero if this section uses RELA relocations, rather than REL. */ - unsigned int use_rela_p:1; - - /* Bits used by various backends. The generic code doesn't touch - these fields. */ - - /* Nonzero if this section has TLS related relocations. */ - unsigned int has_tls_reloc:1; - - /* Nonzero if this section has a gp reloc. */ - unsigned int has_gp_reloc:1; - - /* Nonzero if this section needs the relax finalize pass. */ - unsigned int need_finalize_relax:1; - - /* Whether relocations have been processed. */ - unsigned int reloc_done : 1; - - /* End of internal packed boolean fields. */ - - /* The virtual memory address of the section - where it will be - at run time. The symbols are relocated against this. The - user_set_vma flag is maintained by bfd; if it's not set, the - backend can assign addresses (for example, in `a.out', where - the default address for `.data' is dependent on the specific - target and various flags). */ - bfd_vma vma; - - /* The load address of the section - where it would be in a - rom image; really only used for writing section header - information. */ - bfd_vma lma; - - /* The size of the section in octets, as it will be output. - Contains a value even if the section has no contents (e.g., the - size of `.bss'). */ - bfd_size_type size; - - /* For input sections, the original size on disk of the section, in - octets. This field is used by the linker relaxation code. It is - currently only set for sections where the linker relaxation scheme - doesn't cache altered section and reloc contents (stabs, eh_frame, - SEC_MERGE, some coff relaxing targets), and thus the original size - needs to be kept to read the section multiple times. - For output sections, rawsize holds the section size calculated on - a previous linker relaxation pass. */ - bfd_size_type rawsize; - - /* If this section is going to be output, then this value is the - offset in *bytes* into the output section of the first byte in the - input section (byte ==> smallest addressable unit on the - target). In most cases, if this was going to start at the - 100th octet (8-bit quantity) in the output section, this value - would be 100. However, if the target byte size is 16 bits - (bfd_octets_per_byte is "2"), this value would be 50. */ - bfd_vma output_offset; - - /* The output section through which to map on output. */ - struct bfd_section *output_section; - - /* The alignment requirement of the section, as an exponent of 2 - - e.g., 3 aligns to 2^3 (or 8). */ - unsigned int alignment_power; - - /* If an input section, a pointer to a vector of relocation - records for the data in this section. */ - struct reloc_cache_entry *relocation; - - /* If an output section, a pointer to a vector of pointers to - relocation records for the data in this section. */ - struct reloc_cache_entry **orelocation; - - /* The number of relocation records in one of the above. */ - unsigned reloc_count; - - /* Information below is back end specific - and not always used - or updated. */ - - /* File position of section data. */ - file_ptr filepos; - - /* File position of relocation info. */ - file_ptr rel_filepos; - - /* File position of line data. */ - file_ptr line_filepos; - - /* Pointer to data for applications. */ - void *userdata; - - /* If the SEC_IN_MEMORY flag is set, this points to the actual - contents. */ - unsigned char *contents; - - /* Attached line number information. */ - alent *lineno; - - /* Number of line number records. */ - unsigned int lineno_count; - - /* Entity size for merging purposes. */ - unsigned int entsize; - - /* Points to the kept section if this section is a link-once section, - and is discarded. */ - struct bfd_section *kept_section; - - /* When a section is being output, this value changes as more - linenumbers are written out. */ - file_ptr moving_line_filepos; - - /* What the section number is in the target world. */ - int target_index; - - void *used_by_bfd; - - /* If this is a constructor section then here is a list of the - relocations created to relocate items within it. */ - struct relent_chain *constructor_chain; - - /* The BFD which owns the section. */ - bfd *owner; - - /* A symbol which points at this section only. */ - struct bfd_symbol *symbol; - struct bfd_symbol **symbol_ptr_ptr; - - /* Early in the link process, map_head and map_tail are used to build - a list of input sections attached to an output section. Later, - output sections use these fields for a list of bfd_link_order - structs. */ - union { - struct bfd_link_order *link_order; - struct bfd_section *s; - } map_head, map_tail; - } asection; - - /* These sections are global, and are managed by BFD. The application - and target back end are not permitted to change the values in - these sections. New code should use the section_ptr macros rather - than referring directly to the const sections. The const sections - may eventually vanish. */ - #define BFD_ABS_SECTION_NAME "*ABS*" - #define BFD_UND_SECTION_NAME "*UND*" - #define BFD_COM_SECTION_NAME "*COM*" - #define BFD_IND_SECTION_NAME "*IND*" - - /* The absolute section. */ - extern asection bfd_abs_section; - #define bfd_abs_section_ptr ((asection *) &bfd_abs_section) - #define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) - /* Pointer to the undefined section. */ - extern asection bfd_und_section; - #define bfd_und_section_ptr ((asection *) &bfd_und_section) - #define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) - /* Pointer to the common section. */ - extern asection bfd_com_section; - #define bfd_com_section_ptr ((asection *) &bfd_com_section) - /* Pointer to the indirect section. */ - extern asection bfd_ind_section; - #define bfd_ind_section_ptr ((asection *) &bfd_ind_section) - #define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) - - #define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) - - extern const struct bfd_symbol * const bfd_abs_symbol; - extern const struct bfd_symbol * const bfd_com_symbol; - extern const struct bfd_symbol * const bfd_und_symbol; - extern const struct bfd_symbol * const bfd_ind_symbol; - - /* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ - #define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) - #define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) - #define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) - #define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) - #define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) - #define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) - - #define BFD_FAKE_SECTION(SEC, FLAGS, SYM, SYM_PTR, NAME, IDX) \ - /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ - \ - /* linker_mark, linker_has_input, gc_mark, gc_mark_from_eh, */ \ - 0, 0, 1, 0, \ - \ - /* segment_mark, sec_info_type, use_rela_p, has_tls_reloc, */ \ - 0, 0, 0, 0, \ - \ - /* has_gp_reloc, need_finalize_relax, reloc_done, */ \ - 0, 0, 0, \ - \ - /* vma, lma, size, rawsize */ \ - 0, 0, 0, 0, \ - \ - /* output_offset, output_section, alignment_power, */ \ - 0, (struct bfd_section *) &SEC, 0, \ - \ - /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \ - NULL, NULL, 0, 0, 0, \ - \ - /* line_filepos, userdata, contents, lineno, lineno_count, */ \ - 0, NULL, NULL, NULL, 0, \ - \ - /* entsize, kept_section, moving_line_filepos, */ \ - 0, NULL, 0, \ - \ - /* target_index, used_by_bfd, constructor_chain, owner, */ \ - 0, NULL, NULL, NULL, \ - \ - /* symbol, */ \ - (struct bfd_symbol *) SYM, \ - \ - /* symbol_ptr_ptr, */ \ - (struct bfd_symbol **) SYM_PTR, \ - \ - /* map_head, map_tail */ \ - { NULL }, { NULL } \ - } - - -File: bfd.info, Node: section prototypes, Prev: typedef asection, Up: Sections - -2.6.5 Section prototypes ------------------------- - -These are the functions exported by the section handling part of BFD. - -2.6.5.1 `bfd_section_list_clear' -................................ - -*Synopsis* - void bfd_section_list_clear (bfd *); - *Description* -Clears the section list, and also resets the section count and hash -table entries. - -2.6.5.2 `bfd_get_section_by_name' -................................. - -*Synopsis* - asection *bfd_get_section_by_name (bfd *abfd, const char *name); - *Description* -Run through ABFD and return the one of the `asection's whose name -matches NAME, otherwise `NULL'. *Note Sections::, for more information. - - This should only be used in special cases; the normal way to process -all sections of a given name is to use `bfd_map_over_sections' and -`strcmp' on the name (or better yet, base it on the section flags or -something else) for each section. - -2.6.5.3 `bfd_get_section_by_name_if' -.................................... - -*Synopsis* - asection *bfd_get_section_by_name_if - (bfd *abfd, - const char *name, - bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj), - void *obj); - *Description* -Call the provided function FUNC for each section attached to the BFD -ABFD whose name matches NAME, passing OBJ as an argument. The function -will be called as if by - - func (abfd, the_section, obj); - - It returns the first section for which FUNC returns true, otherwise -`NULL'. - -2.6.5.4 `bfd_get_unique_section_name' -..................................... - -*Synopsis* - char *bfd_get_unique_section_name - (bfd *abfd, const char *templat, int *count); - *Description* -Invent a section name that is unique in ABFD by tacking a dot and a -digit suffix onto the original TEMPLAT. If COUNT is non-NULL, then it -specifies the first number tried as a suffix to generate a unique name. -The value pointed to by COUNT will be incremented in this case. - -2.6.5.5 `bfd_make_section_old_way' -.................................. - -*Synopsis* - asection *bfd_make_section_old_way (bfd *abfd, const char *name); - *Description* -Create a new empty section called NAME and attach it to the end of the -chain of sections for the BFD ABFD. An attempt to create a section with -a name which is already in use returns its pointer without changing the -section chain. - - It has the funny name since this is the way it used to be before it -was rewritten.... - - Possible errors are: - * `bfd_error_invalid_operation' - If output has already started for - this BFD. - - * `bfd_error_no_memory' - If memory allocation fails. - -2.6.5.6 `bfd_make_section_anyway_with_flags' -............................................ - -*Synopsis* - asection *bfd_make_section_anyway_with_flags - (bfd *abfd, const char *name, flagword flags); - *Description* -Create a new empty section called NAME and attach it to the end of the -chain of sections for ABFD. Create a new section even if there is -already a section with that name. Also set the attributes of the new -section to the value FLAGS. - - Return `NULL' and set `bfd_error' on error; possible errors are: - * `bfd_error_invalid_operation' - If output has already started for - ABFD. - - * `bfd_error_no_memory' - If memory allocation fails. - -2.6.5.7 `bfd_make_section_anyway' -................................. - -*Synopsis* - asection *bfd_make_section_anyway (bfd *abfd, const char *name); - *Description* -Create a new empty section called NAME and attach it to the end of the -chain of sections for ABFD. Create a new section even if there is -already a section with that name. - - Return `NULL' and set `bfd_error' on error; possible errors are: - * `bfd_error_invalid_operation' - If output has already started for - ABFD. - - * `bfd_error_no_memory' - If memory allocation fails. - -2.6.5.8 `bfd_make_section_with_flags' -..................................... - -*Synopsis* - asection *bfd_make_section_with_flags - (bfd *, const char *name, flagword flags); - *Description* -Like `bfd_make_section_anyway', but return `NULL' (without calling -bfd_set_error ()) without changing the section chain if there is -already a section named NAME. Also set the attributes of the new -section to the value FLAGS. If there is an error, return `NULL' and set -`bfd_error'. - -2.6.5.9 `bfd_make_section' -.......................... - -*Synopsis* - asection *bfd_make_section (bfd *, const char *name); - *Description* -Like `bfd_make_section_anyway', but return `NULL' (without calling -bfd_set_error ()) without changing the section chain if there is -already a section named NAME. If there is an error, return `NULL' and -set `bfd_error'. - -2.6.5.10 `bfd_set_section_flags' -................................ - -*Synopsis* - bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); - *Description* -Set the attributes of the section SEC in the BFD ABFD to the value -FLAGS. Return `TRUE' on success, `FALSE' on error. Possible error -returns are: - - * `bfd_error_invalid_operation' - The section cannot have one or - more of the attributes requested. For example, a .bss section in - `a.out' may not have the `SEC_HAS_CONTENTS' field set. - -2.6.5.11 `bfd_map_over_sections' -................................ - -*Synopsis* - void bfd_map_over_sections - (bfd *abfd, - void (*func) (bfd *abfd, asection *sect, void *obj), - void *obj); - *Description* -Call the provided function FUNC for each section attached to the BFD -ABFD, passing OBJ as an argument. The function will be called as if by - - func (abfd, the_section, obj); - - This is the preferred method for iterating over sections; an -alternative would be to use a loop: - - section *p; - for (p = abfd->sections; p != NULL; p = p->next) - func (abfd, p, ...) - -2.6.5.12 `bfd_sections_find_if' -............................... - -*Synopsis* - asection *bfd_sections_find_if - (bfd *abfd, - bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), - void *obj); - *Description* -Call the provided function OPERATION for each section attached to the -BFD ABFD, passing OBJ as an argument. The function will be called as if -by - - operation (abfd, the_section, obj); - - It returns the first section for which OPERATION returns true. - -2.6.5.13 `bfd_set_section_size' -............................... - -*Synopsis* - bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); - *Description* -Set SEC to the size VAL. If the operation is ok, then `TRUE' is -returned, else `FALSE'. - - Possible error returns: - * `bfd_error_invalid_operation' - Writing has started to the BFD, so - setting the size is invalid. - -2.6.5.14 `bfd_set_section_contents' -................................... - -*Synopsis* - bfd_boolean bfd_set_section_contents - (bfd *abfd, asection *section, const void *data, - file_ptr offset, bfd_size_type count); - *Description* -Sets the contents of the section SECTION in BFD ABFD to the data -starting in memory at DATA. The data is written to the output section -starting at offset OFFSET for COUNT octets. - - Normally `TRUE' is returned, else `FALSE'. Possible error returns -are: - * `bfd_error_no_contents' - The output section does not have the - `SEC_HAS_CONTENTS' attribute, so nothing can be written to it. - - * and some more too - This routine is front end to the back end function -`_bfd_set_section_contents'. - -2.6.5.15 `bfd_get_section_contents' -................................... - -*Synopsis* - bfd_boolean bfd_get_section_contents - (bfd *abfd, asection *section, void *location, file_ptr offset, - bfd_size_type count); - *Description* -Read data from SECTION in BFD ABFD into memory starting at LOCATION. -The data is read at an offset of OFFSET from the start of the input -section, and is read for COUNT bytes. - - If the contents of a constructor with the `SEC_CONSTRUCTOR' flag set -are requested or if the section does not have the `SEC_HAS_CONTENTS' -flag set, then the LOCATION is filled with zeroes. If no errors occur, -`TRUE' is returned, else `FALSE'. - -2.6.5.16 `bfd_malloc_and_get_section' -..................................... - -*Synopsis* - bfd_boolean bfd_malloc_and_get_section - (bfd *abfd, asection *section, bfd_byte **buf); - *Description* -Read all data from SECTION in BFD ABFD into a buffer, *BUF, malloc'd by -this function. - -2.6.5.17 `bfd_copy_private_section_data' -........................................ - -*Synopsis* - bfd_boolean bfd_copy_private_section_data - (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); - *Description* -Copy private section information from ISEC in the BFD IBFD to the -section OSEC in the BFD OBFD. Return `TRUE' on success, `FALSE' on -error. Possible error returns are: - - * `bfd_error_no_memory' - Not enough memory exists to create private - data for OSEC. - - #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) - -2.6.5.18 `bfd_generic_is_group_section' -....................................... - -*Synopsis* - bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); - *Description* -Returns TRUE if SEC is a member of a group. - -2.6.5.19 `bfd_generic_discard_group' -.................................... - -*Synopsis* - bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); - *Description* -Remove all members of GROUP from the output. - - -File: bfd.info, Node: Symbols, Next: Archives, Prev: Sections, Up: BFD front end - -2.7 Symbols -=========== - -BFD tries to maintain as much symbol information as it can when it -moves information from file to file. BFD passes information to -applications though the `asymbol' structure. When the application -requests the symbol table, BFD reads the table in the native form and -translates parts of it into the internal format. To maintain more than -the information passed to applications, some targets keep some -information "behind the scenes" in a structure only the particular back -end knows about. For example, the coff back end keeps the original -symbol table structure as well as the canonical structure when a BFD is -read in. On output, the coff back end can reconstruct the output symbol -table so that no information is lost, even information unique to coff -which BFD doesn't know or understand. If a coff symbol table were read, -but were written through an a.out back end, all the coff specific -information would be lost. The symbol table of a BFD is not necessarily -read in until a canonicalize request is made. Then the BFD back end -fills in a table provided by the application with pointers to the -canonical information. To output symbols, the application provides BFD -with a table of pointers to pointers to `asymbol's. This allows -applications like the linker to output a symbol as it was read, since -the "behind the scenes" information will be still available. - -* Menu: - -* Reading Symbols:: -* Writing Symbols:: -* Mini Symbols:: -* typedef asymbol:: -* symbol handling functions:: - - -File: bfd.info, Node: Reading Symbols, Next: Writing Symbols, Prev: Symbols, Up: Symbols - -2.7.1 Reading symbols ---------------------- - -There are two stages to reading a symbol table from a BFD: allocating -storage, and the actual reading process. This is an excerpt from an -application which reads the symbol table: - - long storage_needed; - asymbol **symbol_table; - long number_of_symbols; - long i; - - storage_needed = bfd_get_symtab_upper_bound (abfd); - - if (storage_needed < 0) - FAIL - - if (storage_needed == 0) - return; - - symbol_table = xmalloc (storage_needed); - ... - number_of_symbols = - bfd_canonicalize_symtab (abfd, symbol_table); - - if (number_of_symbols < 0) - FAIL - - for (i = 0; i < number_of_symbols; i++) - process_symbol (symbol_table[i]); - - All storage for the symbols themselves is in an objalloc connected -to the BFD; it is freed when the BFD is closed. - - -File: bfd.info, Node: Writing Symbols, Next: Mini Symbols, Prev: Reading Symbols, Up: Symbols - -2.7.2 Writing symbols ---------------------- - -Writing of a symbol table is automatic when a BFD open for writing is -closed. The application attaches a vector of pointers to pointers to -symbols to the BFD being written, and fills in the symbol count. The -close and cleanup code reads through the table provided and performs -all the necessary operations. The BFD output code must always be -provided with an "owned" symbol: one which has come from another BFD, -or one which has been created using `bfd_make_empty_symbol'. Here is an -example showing the creation of a symbol table with only one element: - - #include "bfd.h" - int main (void) - { - bfd *abfd; - asymbol *ptrs[2]; - asymbol *new; - - abfd = bfd_openw ("foo","a.out-sunos-big"); - bfd_set_format (abfd, bfd_object); - new = bfd_make_empty_symbol (abfd); - new->name = "dummy_symbol"; - new->section = bfd_make_section_old_way (abfd, ".text"); - new->flags = BSF_GLOBAL; - new->value = 0x12345; - - ptrs[0] = new; - ptrs[1] = 0; - - bfd_set_symtab (abfd, ptrs, 1); - bfd_close (abfd); - return 0; - } - - ./makesym - nm foo - 00012345 A dummy_symbol - - Many formats cannot represent arbitrary symbol information; for -instance, the `a.out' object format does not allow an arbitrary number -of sections. A symbol pointing to a section which is not one of -`.text', `.data' or `.bss' cannot be described. - - -File: bfd.info, Node: Mini Symbols, Next: typedef asymbol, Prev: Writing Symbols, Up: Symbols - -2.7.3 Mini Symbols ------------------- - -Mini symbols provide read-only access to the symbol table. They use -less memory space, but require more time to access. They can be useful -for tools like nm or objdump, which may have to handle symbol tables of -extremely large executables. - - The `bfd_read_minisymbols' function will read the symbols into -memory in an internal form. It will return a `void *' pointer to a -block of memory, a symbol count, and the size of each symbol. The -pointer is allocated using `malloc', and should be freed by the caller -when it is no longer needed. - - The function `bfd_minisymbol_to_symbol' will take a pointer to a -minisymbol, and a pointer to a structure returned by -`bfd_make_empty_symbol', and return a `asymbol' structure. The return -value may or may not be the same as the value from -`bfd_make_empty_symbol' which was passed in. - - -File: bfd.info, Node: typedef asymbol, Next: symbol handling functions, Prev: Mini Symbols, Up: Symbols - -2.7.4 typedef asymbol ---------------------- - -An `asymbol' has the form: - - - typedef struct bfd_symbol - { - /* A pointer to the BFD which owns the symbol. This information - is necessary so that a back end can work out what additional - information (invisible to the application writer) is carried - with the symbol. - - This field is *almost* redundant, since you can use section->owner - instead, except that some symbols point to the global sections - bfd_{abs,com,und}_section. This could be fixed by making - these globals be per-bfd (or per-target-flavor). FIXME. */ - struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ - - /* The text of the symbol. The name is left alone, and not copied; the - application may not alter it. */ - const char *name; - - /* The value of the symbol. This really should be a union of a - numeric value with a pointer, since some flags indicate that - a pointer to another symbol is stored here. */ - symvalue value; - - /* Attributes of a symbol. */ - #define BSF_NO_FLAGS 0x00 - - /* The symbol has local scope; `static' in `C'. The value - is the offset into the section of the data. */ - #define BSF_LOCAL 0x01 - - /* The symbol has global scope; initialized data in `C'. The - value is the offset into the section of the data. */ - #define BSF_GLOBAL 0x02 - - /* The symbol has global scope and is exported. The value is - the offset into the section of the data. */ - #define BSF_EXPORT BSF_GLOBAL /* No real difference. */ - - /* A normal C symbol would be one of: - `BSF_LOCAL', `BSF_FORT_COMM', `BSF_UNDEFINED' or - `BSF_GLOBAL'. */ - - /* The symbol is a debugging record. The value has an arbitrary - meaning, unless BSF_DEBUGGING_RELOC is also set. */ - #define BSF_DEBUGGING 0x08 - - /* The symbol denotes a function entry point. Used in ELF, - perhaps others someday. */ - #define BSF_FUNCTION 0x10 - - /* Used by the linker. */ - #define BSF_KEEP 0x20 - #define BSF_KEEP_G 0x40 - - /* A weak global symbol, overridable without warnings by - a regular global symbol of the same name. */ - #define BSF_WEAK 0x80 - - /* This symbol was created to point to a section, e.g. ELF's - STT_SECTION symbols. */ - #define BSF_SECTION_SYM 0x100 - - /* The symbol used to be a common symbol, but now it is - allocated. */ - #define BSF_OLD_COMMON 0x200 - - /* The default value for common data. */ - #define BFD_FORT_COMM_DEFAULT_VALUE 0 - - /* In some files the type of a symbol sometimes alters its - location in an output file - ie in coff a `ISFCN' symbol - which is also `C_EXT' symbol appears where it was - declared and not at the end of a section. This bit is set - by the target BFD part to convey this information. */ - #define BSF_NOT_AT_END 0x400 - - /* Signal that the symbol is the label of constructor section. */ - #define BSF_CONSTRUCTOR 0x800 - - /* Signal that the symbol is a warning symbol. The name is a - warning. The name of the next symbol is the one to warn about; - if a reference is made to a symbol with the same name as the next - symbol, a warning is issued by the linker. */ - #define BSF_WARNING 0x1000 - - /* Signal that the symbol is indirect. This symbol is an indirect - pointer to the symbol with the same name as the next symbol. */ - #define BSF_INDIRECT 0x2000 - - /* BSF_FILE marks symbols that contain a file name. This is used - for ELF STT_FILE symbols. */ - #define BSF_FILE 0x4000 - - /* Symbol is from dynamic linking information. */ - #define BSF_DYNAMIC 0x8000 - - /* The symbol denotes a data object. Used in ELF, and perhaps - others someday. */ - #define BSF_OBJECT 0x10000 - - /* This symbol is a debugging symbol. The value is the offset - into the section of the data. BSF_DEBUGGING should be set - as well. */ - #define BSF_DEBUGGING_RELOC 0x20000 - - /* This symbol is thread local. Used in ELF. */ - #define BSF_THREAD_LOCAL 0x40000 - - flagword flags; - - /* A pointer to the section to which this symbol is - relative. This will always be non NULL, there are special - sections for undefined and absolute symbols. */ - struct bfd_section *section; - - /* Back end special data. */ - union - { - void *p; - bfd_vma i; - } - udata; - } - asymbol; - - -File: bfd.info, Node: symbol handling functions, Prev: typedef asymbol, Up: Symbols - -2.7.5 Symbol handling functions -------------------------------- - -2.7.5.1 `bfd_get_symtab_upper_bound' -.................................... - -*Description* -Return the number of bytes required to store a vector of pointers to -`asymbols' for all the symbols in the BFD ABFD, including a terminal -NULL pointer. If there are no symbols in the BFD, then return 0. If an -error occurs, return -1. - #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) - -2.7.5.2 `bfd_is_local_label' -............................ - -*Synopsis* - bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); - *Description* -Return TRUE if the given symbol SYM in the BFD ABFD is a compiler -generated local label, else return FALSE. - -2.7.5.3 `bfd_is_local_label_name' -................................. - -*Synopsis* - bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); - *Description* -Return TRUE if a symbol with the name NAME in the BFD ABFD is a -compiler generated local label, else return FALSE. This just checks -whether the name has the form of a local label. - #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) - -2.7.5.4 `bfd_is_target_special_symbol' -...................................... - -*Synopsis* - bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); - *Description* -Return TRUE iff a symbol SYM in the BFD ABFD is something special to -the particular target represented by the BFD. Such symbols should -normally not be mentioned to the user. - #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) - -2.7.5.5 `bfd_canonicalize_symtab' -................................. - -*Description* -Read the symbols from the BFD ABFD, and fills in the vector LOCATION -with pointers to the symbols and a trailing NULL. Return the actual -number of symbol pointers, not including the NULL. - #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) - -2.7.5.6 `bfd_set_symtab' -........................ - -*Synopsis* - bfd_boolean bfd_set_symtab - (bfd *abfd, asymbol **location, unsigned int count); - *Description* -Arrange that when the output BFD ABFD is closed, the table LOCATION of -COUNT pointers to symbols will be written. - -2.7.5.7 `bfd_print_symbol_vandf' -................................ - -*Synopsis* - void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); - *Description* -Print the value and flags of the SYMBOL supplied to the stream FILE. - -2.7.5.8 `bfd_make_empty_symbol' -............................... - -*Description* -Create a new `asymbol' structure for the BFD ABFD and return a pointer -to it. - - This routine is necessary because each back end has private -information surrounding the `asymbol'. Building your own `asymbol' and -pointing to it will not create the private information, and will cause -problems later on. - #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) - -2.7.5.9 `_bfd_generic_make_empty_symbol' -........................................ - -*Synopsis* - asymbol *_bfd_generic_make_empty_symbol (bfd *); - *Description* -Create a new `asymbol' structure for the BFD ABFD and return a pointer -to it. Used by core file routines, binary back-end and anywhere else -where no private info is needed. - -2.7.5.10 `bfd_make_debug_symbol' -................................ - -*Description* -Create a new `asymbol' structure for the BFD ABFD, to be used as a -debugging symbol. Further details of its use have yet to be worked out. - #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) - -2.7.5.11 `bfd_decode_symclass' -.............................. - -*Description* -Return a character corresponding to the symbol class of SYMBOL, or '?' -for an unknown class. - - *Synopsis* - int bfd_decode_symclass (asymbol *symbol); - -2.7.5.12 `bfd_is_undefined_symclass' -.................................... - -*Description* -Returns non-zero if the class symbol returned by bfd_decode_symclass -represents an undefined symbol. Returns zero otherwise. - - *Synopsis* - bfd_boolean bfd_is_undefined_symclass (int symclass); - -2.7.5.13 `bfd_symbol_info' -.......................... - -*Description* -Fill in the basic info about symbol that nm needs. Additional info may -be added by the back-ends after calling this function. - - *Synopsis* - void bfd_symbol_info (asymbol *symbol, symbol_info *ret); - -2.7.5.14 `bfd_copy_private_symbol_data' -....................................... - -*Synopsis* - bfd_boolean bfd_copy_private_symbol_data - (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); - *Description* -Copy private symbol information from ISYM in the BFD IBFD to the symbol -OSYM in the BFD OBFD. Return `TRUE' on success, `FALSE' on error. -Possible error returns are: - - * `bfd_error_no_memory' - Not enough memory exists to create private - data for OSEC. - - #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) - - -File: bfd.info, Node: Archives, Next: Formats, Prev: Symbols, Up: BFD front end - -2.8 Archives -============ - -*Description* -An archive (or library) is just another BFD. It has a symbol table, -although there's not much a user program will do with it. - - The big difference between an archive BFD and an ordinary BFD is -that the archive doesn't have sections. Instead it has a chain of BFDs -that are considered its contents. These BFDs can be manipulated like -any other. The BFDs contained in an archive opened for reading will -all be opened for reading. You may put either input or output BFDs -into an archive opened for output; they will be handled correctly when -the archive is closed. - - Use `bfd_openr_next_archived_file' to step through the contents of -an archive opened for input. You don't have to read the entire archive -if you don't want to! Read it until you find what you want. - - Archive contents of output BFDs are chained through the `next' -pointer in a BFD. The first one is findable through the `archive_head' -slot of the archive. Set it with `bfd_set_archive_head' (q.v.). A -given BFD may be in only one open output archive at a time. - - As expected, the BFD archive code is more general than the archive -code of any given environment. BFD archives may contain files of -different formats (e.g., a.out and coff) and even different -architectures. You may even place archives recursively into archives! - - This can cause unexpected confusion, since some archive formats are -more expressive than others. For instance, Intel COFF archives can -preserve long filenames; SunOS a.out archives cannot. If you move a -file from the first to the second format and back again, the filename -may be truncated. Likewise, different a.out environments have different -conventions as to how they truncate filenames, whether they preserve -directory names in filenames, etc. When interoperating with native -tools, be sure your files are homogeneous. - - Beware: most of these formats do not react well to the presence of -spaces in filenames. We do the best we can, but can't always handle -this case due to restrictions in the format of archives. Many Unix -utilities are braindead in regards to spaces and such in filenames -anyway, so this shouldn't be much of a restriction. - - Archives are supported in BFD in `archive.c'. - -2.8.1 Archive functions ------------------------ - -2.8.1.1 `bfd_get_next_mapent' -............................. - -*Synopsis* - symindex bfd_get_next_mapent - (bfd *abfd, symindex previous, carsym **sym); - *Description* -Step through archive ABFD's symbol table (if it has one). Successively -update SYM with the next symbol's information, returning that symbol's -(internal) index into the symbol table. - - Supply `BFD_NO_MORE_SYMBOLS' as the PREVIOUS entry to get the first -one; returns `BFD_NO_MORE_SYMBOLS' when you've already got the last one. - - A `carsym' is a canonical archive symbol. The only user-visible -element is its name, a null-terminated string. - -2.8.1.2 `bfd_set_archive_head' -.............................. - -*Synopsis* - bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head); - *Description* -Set the head of the chain of BFDs contained in the archive OUTPUT to -NEW_HEAD. - -2.8.1.3 `bfd_openr_next_archived_file' -...................................... - -*Synopsis* - bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous); - *Description* -Provided a BFD, ARCHIVE, containing an archive and NULL, open an input -BFD on the first contained element and returns that. Subsequent calls -should pass the archive and the previous return value to return a -created BFD to the next contained element. NULL is returned when there -are no more. - - -File: bfd.info, Node: Formats, Next: Relocations, Prev: Archives, Up: BFD front end - -2.9 File formats -================ - -A format is a BFD concept of high level file contents type. The formats -supported by BFD are: - - * `bfd_object' - The BFD may contain data, symbols, relocations and debug info. - - * `bfd_archive' - The BFD contains other BFDs and an optional index. - - * `bfd_core' - The BFD contains the result of an executable core dump. - -2.9.1 File format functions ---------------------------- - -2.9.1.1 `bfd_check_format' -.......................... - -*Synopsis* - bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); - *Description* -Verify if the file attached to the BFD ABFD is compatible with the -format FORMAT (i.e., one of `bfd_object', `bfd_archive' or `bfd_core'). - - If the BFD has been set to a specific target before the call, only -the named target and format combination is checked. If the target has -not been set, or has been set to `default', then all the known target -backends is interrogated to determine a match. If the default target -matches, it is used. If not, exactly one target must recognize the -file, or an error results. - - The function returns `TRUE' on success, otherwise `FALSE' with one -of the following error codes: - - * `bfd_error_invalid_operation' - if `format' is not one of - `bfd_object', `bfd_archive' or `bfd_core'. - - * `bfd_error_system_call' - if an error occured during a read - even - some file mismatches can cause bfd_error_system_calls. - - * `file_not_recognised' - none of the backends recognised the file - format. - - * `bfd_error_file_ambiguously_recognized' - more than one backend - recognised the file format. - -2.9.1.2 `bfd_check_format_matches' -.................................. - -*Synopsis* - bfd_boolean bfd_check_format_matches - (bfd *abfd, bfd_format format, char ***matching); - *Description* -Like `bfd_check_format', except when it returns FALSE with `bfd_errno' -set to `bfd_error_file_ambiguously_recognized'. In that case, if -MATCHING is not NULL, it will be filled in with a NULL-terminated list -of the names of the formats that matched, allocated with `malloc'. -Then the user may choose a format and try again. - - When done with the list that MATCHING points to, the caller should -free it. - -2.9.1.3 `bfd_set_format' -........................ - -*Synopsis* - bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); - *Description* -This function sets the file format of the BFD ABFD to the format -FORMAT. If the target set in the BFD does not support the format -requested, the format is invalid, or the BFD is not open for writing, -then an error occurs. - -2.9.1.4 `bfd_format_string' -........................... - -*Synopsis* - const char *bfd_format_string (bfd_format format); - *Description* -Return a pointer to a const string `invalid', `object', `archive', -`core', or `unknown', depending upon the value of FORMAT. - - -File: bfd.info, Node: Relocations, Next: Core Files, Prev: Formats, Up: BFD front end - -2.10 Relocations -================ - -BFD maintains relocations in much the same way it maintains symbols: -they are left alone until required, then read in en-masse and -translated into an internal form. A common routine -`bfd_perform_relocation' acts upon the canonical form to do the fixup. - - Relocations are maintained on a per section basis, while symbols are -maintained on a per BFD basis. - - All that a back end has to do to fit the BFD interface is to create -a `struct reloc_cache_entry' for each relocation in a particular -section, and fill in the right bits of the structures. - -* Menu: - -* typedef arelent:: -* howto manager:: - - -File: bfd.info, Node: typedef arelent, Next: howto manager, Prev: Relocations, Up: Relocations - -2.10.1 typedef arelent ----------------------- - -This is the structure of a relocation entry: - - - typedef enum bfd_reloc_status - { - /* No errors detected. */ - bfd_reloc_ok, - - /* The relocation was performed, but there was an overflow. */ - bfd_reloc_overflow, - - /* The address to relocate was not within the section supplied. */ - bfd_reloc_outofrange, - - /* Used by special functions. */ - bfd_reloc_continue, - - /* Unsupported relocation size requested. */ - bfd_reloc_notsupported, - - /* Unused. */ - bfd_reloc_other, - - /* The symbol to relocate against was undefined. */ - bfd_reloc_undefined, - - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ - bfd_reloc_dangerous - } - bfd_reloc_status_type; - - - typedef struct reloc_cache_entry - { - /* A pointer into the canonical table of pointers. */ - struct bfd_symbol **sym_ptr_ptr; - - /* offset in section. */ - bfd_size_type address; - - /* addend for relocation value. */ - bfd_vma addend; - - /* Pointer to how to perform the required relocation. */ - reloc_howto_type *howto; - - } - arelent; - *Description* -Here is a description of each of the fields within an `arelent': - - * `sym_ptr_ptr' - The symbol table pointer points to a pointer to the symbol -associated with the relocation request. It is the pointer into the -table returned by the back end's `canonicalize_symtab' action. *Note -Symbols::. The symbol is referenced through a pointer to a pointer so -that tools like the linker can fix up all the symbols of the same name -by modifying only one pointer. The relocation routine looks in the -symbol and uses the base of the section the symbol is attached to and -the value of the symbol as the initial relocation offset. If the symbol -pointer is zero, then the section provided is looked up. - - * `address' - The `address' field gives the offset in bytes from the base of the -section data which owns the relocation record to the first byte of -relocatable information. The actual data relocated will be relative to -this point; for example, a relocation type which modifies the bottom -two bytes of a four byte word would not touch the first byte pointed to -in a big endian world. - - * `addend' - The `addend' is a value provided by the back end to be added (!) to -the relocation offset. Its interpretation is dependent upon the howto. -For example, on the 68k the code: - - char foo[]; - main() - { - return foo[0x12345678]; - } - - Could be compiled into: - - linkw fp,#-4 - moveb @#12345678,d0 - extbl d0 - unlk fp - rts - - This could create a reloc pointing to `foo', but leave the offset in -the data, something like: - - RELOCATION RECORDS FOR [.text]: - offset type value - 00000006 32 _foo - - 00000000 4e56 fffc ; linkw fp,#-4 - 00000004 1039 1234 5678 ; moveb @#12345678,d0 - 0000000a 49c0 ; extbl d0 - 0000000c 4e5e ; unlk fp - 0000000e 4e75 ; rts - - Using coff and an 88k, some instructions don't have enough space in -them to represent the full address range, and pointers have to be -loaded in two parts. So you'd get something like: - - or.u r13,r0,hi16(_foo+0x12345678) - ld.b r2,r13,lo16(_foo+0x12345678) - jmp r1 - - This should create two relocs, both pointing to `_foo', and with -0x12340000 in their addend field. The data would consist of: - - RELOCATION RECORDS FOR [.text]: - offset type value - 00000002 HVRT16 _foo+0x12340000 - 00000006 LVRT16 _foo+0x12340000 - - 00000000 5da05678 ; or.u r13,r0,0x5678 - 00000004 1c4d5678 ; ld.b r2,r13,0x5678 - 00000008 f400c001 ; jmp r1 - - The relocation routine digs out the value from the data, adds it to -the addend to get the original offset, and then adds the value of -`_foo'. Note that all 32 bits have to be kept around somewhere, to cope -with carry from bit 15 to bit 16. - - One further example is the sparc and the a.out format. The sparc has -a similar problem to the 88k, in that some instructions don't have room -for an entire offset, but on the sparc the parts are created in odd -sized lumps. The designers of the a.out format chose to not use the -data within the section for storing part of the offset; all the offset -is kept within the reloc. Anything in the data should be ignored. - - save %sp,-112,%sp - sethi %hi(_foo+0x12345678),%g2 - ldsb [%g2+%lo(_foo+0x12345678)],%i0 - ret - restore - - Both relocs contain a pointer to `foo', and the offsets contain junk. - - RELOCATION RECORDS FOR [.text]: - offset type value - 00000004 HI22 _foo+0x12345678 - 00000008 LO10 _foo+0x12345678 - - 00000000 9de3bf90 ; save %sp,-112,%sp - 00000004 05000000 ; sethi %hi(_foo+0),%g2 - 00000008 f048a000 ; ldsb [%g2+%lo(_foo+0)],%i0 - 0000000c 81c7e008 ; ret - 00000010 81e80000 ; restore - - * `howto' - The `howto' field can be imagined as a relocation instruction. It is -a pointer to a structure which contains information on what to do with -all of the other information in the reloc record and data section. A -back end would normally have a relocation instruction set and turn -relocations into pointers to the correct structure on input - but it -would be possible to create each howto field on demand. - -2.10.1.1 `enum complain_overflow' -................................. - -Indicates what sort of overflow checking should be done when performing -a relocation. - - - enum complain_overflow - { - /* Do not complain on overflow. */ - complain_overflow_dont, - - /* Complain if the value overflows when considered as a signed - number one bit larger than the field. ie. A bitfield of N bits - is allowed to represent -2**n to 2**n-1. */ - complain_overflow_bitfield, - - /* Complain if the value overflows when considered as a signed - number. */ - complain_overflow_signed, - - /* Complain if the value overflows when considered as an - unsigned number. */ - complain_overflow_unsigned - }; - -2.10.1.2 `reloc_howto_type' -........................... - -The `reloc_howto_type' is a structure which contains all the -information that libbfd needs to know to tie up a back end's data. - - struct bfd_symbol; /* Forward declaration. */ - - struct reloc_howto_struct - { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ - unsigned int type; - - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; - - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; - - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; - - /* Notes that the relocation is relative to the location in the - data section of the addend. The relocation function will - subtract from the relocation value the address of the location - being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; - - /* What type of overflow error should be checked for when - relocating. */ - enum complain_overflow complain_on_overflow; - - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); - - /* The textual name of the relocation type. */ - char *name; - - /* Some formats record a relocation addend in the section contents - rather than with the relocation. For ELF formats this is the - distinction between USE_REL and USE_RELA (though the code checks - for USE_REL == 1/0). The value of this field is TRUE if the - addend is recorded with the section contents; when performing a - partial link (ld -r) the section contents (the data) will be - modified. The value of this field is FALSE if addends are - recorded with the relocation (in arelent.addend); when performing - a partial link the relocation will be modified. - All relocations for all ELF USE_RELA targets should set this field - to FALSE (values of TRUE should be looked on with suspicion). - However, the converse is not true: not all relocations of all ELF - USE_REL targets set this field to TRUE. Why this is so is peculiar - to each particular target. For relocs that aren't used in partial - links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; - - /* When some formats create PC relative instructions, they leave - the value of the pc of the place being relocated in the offset - slot of the instruction, so that a PC relative relocation can - be made just by adding in an ordinary offset (e.g., sun3 a.out). - Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; - }; - -2.10.1.3 `The HOWTO Macro' -.......................... - -*Description* -The HOWTO define is horrible and will go away. - #define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } - - *Description* -And will be replaced with the totally magic way. But for the moment, we -are compatible, so do it this way. - #define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - - *Description* -This is used to fill in an empty howto entry in an array. - #define EMPTY_HOWTO(C) \ - HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ - NULL, FALSE, 0, 0, FALSE) - - *Description* -Helper routine to turn a symbol into a relocation value. - #define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - -2.10.1.4 `bfd_get_reloc_size' -............................. - -*Synopsis* - unsigned int bfd_get_reloc_size (reloc_howto_type *); - *Description* -For a reloc_howto_type that operates on a fixed number of bytes, this -returns the number of bytes operated on. - -2.10.1.5 `arelent_chain' -........................ - -*Description* -How relocs are tied together in an `asection': - typedef struct relent_chain - { - arelent relent; - struct relent_chain *next; - } - arelent_chain; - -2.10.1.6 `bfd_check_overflow' -............................. - -*Synopsis* - bfd_reloc_status_type bfd_check_overflow - (enum complain_overflow how, - unsigned int bitsize, - unsigned int rightshift, - unsigned int addrsize, - bfd_vma relocation); - *Description* -Perform overflow checking on RELOCATION which has BITSIZE significant -bits and will be shifted right by RIGHTSHIFT bits, on a machine with -addresses containing ADDRSIZE significant bits. The result is either of -`bfd_reloc_ok' or `bfd_reloc_overflow'. - -2.10.1.7 `bfd_perform_relocation' -................................. - -*Synopsis* - bfd_reloc_status_type bfd_perform_relocation - (bfd *abfd, - arelent *reloc_entry, - void *data, - asection *input_section, - bfd *output_bfd, - char **error_message); - *Description* -If OUTPUT_BFD is supplied to this function, the generated image will be -relocatable; the relocations are copied to the output file after they -have been changed to reflect the new state of the world. There are two -ways of reflecting the results of partial linkage in an output file: by -modifying the output data in place, and by modifying the relocation -record. Some native formats (e.g., basic a.out and basic coff) have no -way of specifying an addend in the relocation type, so the addend has -to go in the output data. This is no big deal since in these formats -the output data slot will always be big enough for the addend. Complex -reloc types with addends were invented to solve just this problem. The -ERROR_MESSAGE argument is set to an error message if this return -`bfd_reloc_dangerous'. - -2.10.1.8 `bfd_install_relocation' -................................. - -*Synopsis* - bfd_reloc_status_type bfd_install_relocation - (bfd *abfd, - arelent *reloc_entry, - void *data, bfd_vma data_start, - asection *input_section, - char **error_message); - *Description* -This looks remarkably like `bfd_perform_relocation', except it does not -expect that the section contents have been filled in. I.e., it's -suitable for use when creating, rather than applying a relocation. - - For now, this function should be considered reserved for the -assembler. - - -File: bfd.info, Node: howto manager, Prev: typedef arelent, Up: Relocations - -2.10.2 The howto manager ------------------------- - -When an application wants to create a relocation, but doesn't know what -the target machine might call it, it can find out by using this bit of -code. - -2.10.2.1 `bfd_reloc_code_type' -.............................. - -*Description* -The insides of a reloc code. The idea is that, eventually, there will -be one enumerator for every type of relocation we ever do. Pass one of -these values to `bfd_reloc_type_lookup', and it'll return a howto -pointer. - - This does mean that the application must determine the correct -enumerator value; you can't get a howto pointer from a random set of -attributes. - - Here are the possible values for `enum bfd_reloc_code_real': - - -- : BFD_RELOC_64 - -- : BFD_RELOC_32 - -- : BFD_RELOC_26 - -- : BFD_RELOC_24 - -- : BFD_RELOC_16 - -- : BFD_RELOC_14 - -- : BFD_RELOC_8 - Basic absolute relocations of N bits. - - -- : BFD_RELOC_64_PCREL - -- : BFD_RELOC_32_PCREL - -- : BFD_RELOC_24_PCREL - -- : BFD_RELOC_16_PCREL - -- : BFD_RELOC_12_PCREL - -- : BFD_RELOC_8_PCREL - PC-relative relocations. Sometimes these are relative to the - address of the relocation itself; sometimes they are relative to - the start of the section containing the relocation. It depends on - the specific target. - - The 24-bit relocation is used in some Intel 960 configurations. - - -- : BFD_RELOC_32_SECREL - Section relative relocations. Some targets need this for DWARF2. - - -- : BFD_RELOC_32_GOT_PCREL - -- : BFD_RELOC_16_GOT_PCREL - -- : BFD_RELOC_8_GOT_PCREL - -- : BFD_RELOC_32_GOTOFF - -- : BFD_RELOC_16_GOTOFF - -- : BFD_RELOC_LO16_GOTOFF - -- : BFD_RELOC_HI16_GOTOFF - -- : BFD_RELOC_HI16_S_GOTOFF - -- : BFD_RELOC_8_GOTOFF - -- : BFD_RELOC_64_PLT_PCREL - -- : BFD_RELOC_32_PLT_PCREL - -- : BFD_RELOC_24_PLT_PCREL - -- : BFD_RELOC_16_PLT_PCREL - -- : BFD_RELOC_8_PLT_PCREL - -- : BFD_RELOC_64_PLTOFF - -- : BFD_RELOC_32_PLTOFF - -- : BFD_RELOC_16_PLTOFF - -- : BFD_RELOC_LO16_PLTOFF - -- : BFD_RELOC_HI16_PLTOFF - -- : BFD_RELOC_HI16_S_PLTOFF - -- : BFD_RELOC_8_PLTOFF - For ELF. - - -- : BFD_RELOC_68K_GLOB_DAT - -- : BFD_RELOC_68K_JMP_SLOT - -- : BFD_RELOC_68K_RELATIVE - Relocations used by 68K ELF. - - -- : BFD_RELOC_32_BASEREL - -- : BFD_RELOC_16_BASEREL - -- : BFD_RELOC_LO16_BASEREL - -- : BFD_RELOC_HI16_BASEREL - -- : BFD_RELOC_HI16_S_BASEREL - -- : BFD_RELOC_8_BASEREL - -- : BFD_RELOC_RVA - Linkage-table relative. - - -- : BFD_RELOC_8_FFnn - Absolute 8-bit relocation, but used to form an address like 0xFFnn. - - -- : BFD_RELOC_32_PCREL_S2 - -- : BFD_RELOC_16_PCREL_S2 - -- : BFD_RELOC_23_PCREL_S2 - These PC-relative relocations are stored as word displacements - - i.e., byte displacements shifted right two bits. The 30-bit word - displacement (<<32_PCREL_S2>> - 32 bits, shifted 2) is used on the - SPARC. (SPARC tools generally refer to this as <>.) The - signed 16-bit displacement is used on the MIPS, and the 23-bit - displacement is used on the Alpha. - - -- : BFD_RELOC_HI22 - -- : BFD_RELOC_LO10 - High 22 bits and low 10 bits of 32-bit value, placed into lower - bits of the target word. These are used on the SPARC. - - -- : BFD_RELOC_GPREL16 - -- : BFD_RELOC_GPREL32 - For systems that allocate a Global Pointer register, these are - displacements off that register. These relocation types are - handled specially, because the value the register will have is - decided relatively late. - - -- : BFD_RELOC_I960_CALLJ - Reloc types used for i960/b.out. - - -- : BFD_RELOC_NONE - -- : BFD_RELOC_SPARC_WDISP22 - -- : BFD_RELOC_SPARC22 - -- : BFD_RELOC_SPARC13 - -- : BFD_RELOC_SPARC_GOT10 - -- : BFD_RELOC_SPARC_GOT13 - -- : BFD_RELOC_SPARC_GOT22 - -- : BFD_RELOC_SPARC_PC10 - -- : BFD_RELOC_SPARC_PC22 - -- : BFD_RELOC_SPARC_WPLT30 - -- : BFD_RELOC_SPARC_COPY - -- : BFD_RELOC_SPARC_GLOB_DAT - -- : BFD_RELOC_SPARC_JMP_SLOT - -- : BFD_RELOC_SPARC_RELATIVE - -- : BFD_RELOC_SPARC_UA16 - -- : BFD_RELOC_SPARC_UA32 - -- : BFD_RELOC_SPARC_UA64 - SPARC ELF relocations. There is probably some overlap with other - relocation types already defined. - - -- : BFD_RELOC_SPARC_BASE13 - -- : BFD_RELOC_SPARC_BASE22 - I think these are specific to SPARC a.out (e.g., Sun 4). - - -- : BFD_RELOC_SPARC_64 - -- : BFD_RELOC_SPARC_10 - -- : BFD_RELOC_SPARC_11 - -- : BFD_RELOC_SPARC_OLO10 - -- : BFD_RELOC_SPARC_HH22 - -- : BFD_RELOC_SPARC_HM10 - -- : BFD_RELOC_SPARC_LM22 - -- : BFD_RELOC_SPARC_PC_HH22 - -- : BFD_RELOC_SPARC_PC_HM10 - -- : BFD_RELOC_SPARC_PC_LM22 - -- : BFD_RELOC_SPARC_WDISP16 - -- : BFD_RELOC_SPARC_WDISP19 - -- : BFD_RELOC_SPARC_7 - -- : BFD_RELOC_SPARC_6 - -- : BFD_RELOC_SPARC_5 - -- : BFD_RELOC_SPARC_DISP64 - -- : BFD_RELOC_SPARC_PLT32 - -- : BFD_RELOC_SPARC_PLT64 - -- : BFD_RELOC_SPARC_HIX22 - -- : BFD_RELOC_SPARC_LOX10 - -- : BFD_RELOC_SPARC_H44 - -- : BFD_RELOC_SPARC_M44 - -- : BFD_RELOC_SPARC_L44 - -- : BFD_RELOC_SPARC_REGISTER - SPARC64 relocations - - -- : BFD_RELOC_SPARC_REV32 - SPARC little endian relocation - - -- : BFD_RELOC_SPARC_TLS_GD_HI22 - -- : BFD_RELOC_SPARC_TLS_GD_LO10 - -- : BFD_RELOC_SPARC_TLS_GD_ADD - -- : BFD_RELOC_SPARC_TLS_GD_CALL - -- : BFD_RELOC_SPARC_TLS_LDM_HI22 - -- : BFD_RELOC_SPARC_TLS_LDM_LO10 - -- : BFD_RELOC_SPARC_TLS_LDM_ADD - -- : BFD_RELOC_SPARC_TLS_LDM_CALL - -- : BFD_RELOC_SPARC_TLS_LDO_HIX22 - -- : BFD_RELOC_SPARC_TLS_LDO_LOX10 - -- : BFD_RELOC_SPARC_TLS_LDO_ADD - -- : BFD_RELOC_SPARC_TLS_IE_HI22 - -- : BFD_RELOC_SPARC_TLS_IE_LO10 - -- : BFD_RELOC_SPARC_TLS_IE_LD - -- : BFD_RELOC_SPARC_TLS_IE_LDX - -- : BFD_RELOC_SPARC_TLS_IE_ADD - -- : BFD_RELOC_SPARC_TLS_LE_HIX22 - -- : BFD_RELOC_SPARC_TLS_LE_LOX10 - -- : BFD_RELOC_SPARC_TLS_DTPMOD32 - -- : BFD_RELOC_SPARC_TLS_DTPMOD64 - -- : BFD_RELOC_SPARC_TLS_DTPOFF32 - -- : BFD_RELOC_SPARC_TLS_DTPOFF64 - -- : BFD_RELOC_SPARC_TLS_TPOFF32 - -- : BFD_RELOC_SPARC_TLS_TPOFF64 - SPARC TLS relocations - - -- : BFD_RELOC_ALPHA_GPDISP_HI16 - Alpha ECOFF and ELF relocations. Some of these treat the symbol or - "addend" in some special way. For GPDISP_HI16 ("gpdisp") - relocations, the symbol is ignored when writing; when reading, it - will be the absolute section symbol. The addend is the - displacement in bytes of the "lda" instruction from the "ldah" - instruction (which is at the address of this reloc). - - -- : BFD_RELOC_ALPHA_GPDISP_LO16 - For GPDISP_LO16 ("ignore") relocations, the symbol is handled as - with GPDISP_HI16 relocs. The addend is ignored when writing the - relocations out, and is filled in with the file's GP value on - reading, for convenience. - - -- : BFD_RELOC_ALPHA_GPDISP - The ELF GPDISP relocation is exactly the same as the GPDISP_HI16 - relocation except that there is no accompanying GPDISP_LO16 - relocation. - - -- : BFD_RELOC_ALPHA_LITERAL - -- : BFD_RELOC_ALPHA_ELF_LITERAL - -- : BFD_RELOC_ALPHA_LITUSE - The Alpha LITERAL/LITUSE relocs are produced by a symbol reference; - the assembler turns it into a LDQ instruction to load the address - of the symbol, and then fills in a register in the real - instruction. - - The LITERAL reloc, at the LDQ instruction, refers to the .lita - section symbol. The addend is ignored when writing, but is filled - in with the file's GP value on reading, for convenience, as with - the GPDISP_LO16 reloc. - - The ELF_LITERAL reloc is somewhere between 16_GOTOFF and - GPDISP_LO16. It should refer to the symbol to be referenced, as - with 16_GOTOFF, but it generates output not based on the position - within the .got section, but relative to the GP value chosen for - the file during the final link stage. - - The LITUSE reloc, on the instruction using the loaded address, - gives information to the linker that it might be able to use to - optimize away some literal section references. The symbol is - ignored (read as the absolute section symbol), and the "addend" - indicates the type of instruction using the register: 1 - "memory" - fmt insn 2 - byte-manipulation (byte offset reg) 3 - jsr (target - of branch) - - -- : BFD_RELOC_ALPHA_HINT - The HINT relocation indicates a value that should be filled into - the "hint" field of a jmp/jsr/ret instruction, for possible branch- - prediction logic which may be provided on some processors. - - -- : BFD_RELOC_ALPHA_LINKAGE - The LINKAGE relocation outputs a linkage pair in the object file, - which is filled by the linker. - - -- : BFD_RELOC_ALPHA_CODEADDR - The CODEADDR relocation outputs a STO_CA in the object file, which - is filled by the linker. - - -- : BFD_RELOC_ALPHA_GPREL_HI16 - -- : BFD_RELOC_ALPHA_GPREL_LO16 - The GPREL_HI/LO relocations together form a 32-bit offset from the - GP register. - - -- : BFD_RELOC_ALPHA_BRSGP - Like BFD_RELOC_23_PCREL_S2, except that the source and target must - share a common GP, and the target address is adjusted for - STO_ALPHA_STD_GPLOAD. - - -- : BFD_RELOC_ALPHA_TLSGD - -- : BFD_RELOC_ALPHA_TLSLDM - -- : BFD_RELOC_ALPHA_DTPMOD64 - -- : BFD_RELOC_ALPHA_GOTDTPREL16 - -- : BFD_RELOC_ALPHA_DTPREL64 - -- : BFD_RELOC_ALPHA_DTPREL_HI16 - -- : BFD_RELOC_ALPHA_DTPREL_LO16 - -- : BFD_RELOC_ALPHA_DTPREL16 - -- : BFD_RELOC_ALPHA_GOTTPREL16 - -- : BFD_RELOC_ALPHA_TPREL64 - -- : BFD_RELOC_ALPHA_TPREL_HI16 - -- : BFD_RELOC_ALPHA_TPREL_LO16 - -- : BFD_RELOC_ALPHA_TPREL16 - Alpha thread-local storage relocations. - - -- : BFD_RELOC_MIPS_JMP - Bits 27..2 of the relocation address shifted right 2 bits; simple - reloc otherwise. - - -- : BFD_RELOC_MIPS16_JMP - The MIPS16 jump instruction. - - -- : BFD_RELOC_MIPS16_GPREL - MIPS16 GP relative reloc. - - -- : BFD_RELOC_HI16 - High 16 bits of 32-bit value; simple reloc. - - -- : BFD_RELOC_HI16_S - High 16 bits of 32-bit value but the low 16 bits will be sign - extended and added to form the final result. If the low 16 bits - form a negative number, we need to add one to the high value to - compensate for the borrow when the low bits are added. - - -- : BFD_RELOC_LO16 - Low 16 bits. - - -- : BFD_RELOC_HI16_PCREL - High 16 bits of 32-bit pc-relative value - - -- : BFD_RELOC_HI16_S_PCREL - High 16 bits of 32-bit pc-relative value, adjusted - - -- : BFD_RELOC_LO16_PCREL - Low 16 bits of pc-relative value - - -- : BFD_RELOC_MIPS16_HI16 - MIPS16 high 16 bits of 32-bit value. - - -- : BFD_RELOC_MIPS16_HI16_S - MIPS16 high 16 bits of 32-bit value but the low 16 bits will be - sign extended and added to form the final result. If the low 16 - bits form a negative number, we need to add one to the high value - to compensate for the borrow when the low bits are added. - - -- : BFD_RELOC_MIPS16_LO16 - MIPS16 low 16 bits. - - -- : BFD_RELOC_MIPS_LITERAL - Relocation against a MIPS literal section. - - -- : BFD_RELOC_MIPS_GOT16 - -- : BFD_RELOC_MIPS_CALL16 - -- : BFD_RELOC_MIPS_GOT_HI16 - -- : BFD_RELOC_MIPS_GOT_LO16 - -- : BFD_RELOC_MIPS_CALL_HI16 - -- : BFD_RELOC_MIPS_CALL_LO16 - -- : BFD_RELOC_MIPS_SUB - -- : BFD_RELOC_MIPS_GOT_PAGE - -- : BFD_RELOC_MIPS_GOT_OFST - -- : BFD_RELOC_MIPS_GOT_DISP - -- : BFD_RELOC_MIPS_SHIFT5 - -- : BFD_RELOC_MIPS_SHIFT6 - -- : BFD_RELOC_MIPS_INSERT_A - -- : BFD_RELOC_MIPS_INSERT_B - -- : BFD_RELOC_MIPS_DELETE - -- : BFD_RELOC_MIPS_HIGHEST - -- : BFD_RELOC_MIPS_HIGHER - -- : BFD_RELOC_MIPS_SCN_DISP - -- : BFD_RELOC_MIPS_REL16 - -- : BFD_RELOC_MIPS_RELGOT - -- : BFD_RELOC_MIPS_JALR - -- : BFD_RELOC_MIPS_TLS_DTPMOD32 - -- : BFD_RELOC_MIPS_TLS_DTPREL32 - -- : BFD_RELOC_MIPS_TLS_DTPMOD64 - -- : BFD_RELOC_MIPS_TLS_DTPREL64 - -- : BFD_RELOC_MIPS_TLS_GD - -- : BFD_RELOC_MIPS_TLS_LDM - -- : BFD_RELOC_MIPS_TLS_DTPREL_HI16 - -- : BFD_RELOC_MIPS_TLS_DTPREL_LO16 - -- : BFD_RELOC_MIPS_TLS_GOTTPREL - -- : BFD_RELOC_MIPS_TLS_TPREL32 - -- : BFD_RELOC_MIPS_TLS_TPREL64 - -- : BFD_RELOC_MIPS_TLS_TPREL_HI16 - -- : BFD_RELOC_MIPS_TLS_TPREL_LO16 - MIPS ELF relocations. - - -- : BFD_RELOC_MIPS_COPY - -- : BFD_RELOC_MIPS_JUMP_SLOT - MIPS ELF relocations (VxWorks extensions). - - -- : BFD_RELOC_FRV_LABEL16 - -- : BFD_RELOC_FRV_LABEL24 - -- : BFD_RELOC_FRV_LO16 - -- : BFD_RELOC_FRV_HI16 - -- : BFD_RELOC_FRV_GPREL12 - -- : BFD_RELOC_FRV_GPRELU12 - -- : BFD_RELOC_FRV_GPREL32 - -- : BFD_RELOC_FRV_GPRELHI - -- : BFD_RELOC_FRV_GPRELLO - -- : BFD_RELOC_FRV_GOT12 - -- : BFD_RELOC_FRV_GOTHI - -- : BFD_RELOC_FRV_GOTLO - -- : BFD_RELOC_FRV_FUNCDESC - -- : BFD_RELOC_FRV_FUNCDESC_GOT12 - -- : BFD_RELOC_FRV_FUNCDESC_GOTHI - -- : BFD_RELOC_FRV_FUNCDESC_GOTLO - -- : BFD_RELOC_FRV_FUNCDESC_VALUE - -- : BFD_RELOC_FRV_FUNCDESC_GOTOFF12 - -- : BFD_RELOC_FRV_FUNCDESC_GOTOFFHI - -- : BFD_RELOC_FRV_FUNCDESC_GOTOFFLO - -- : BFD_RELOC_FRV_GOTOFF12 - -- : BFD_RELOC_FRV_GOTOFFHI - -- : BFD_RELOC_FRV_GOTOFFLO - -- : BFD_RELOC_FRV_GETTLSOFF - -- : BFD_RELOC_FRV_TLSDESC_VALUE - -- : BFD_RELOC_FRV_GOTTLSDESC12 - -- : BFD_RELOC_FRV_GOTTLSDESCHI - -- : BFD_RELOC_FRV_GOTTLSDESCLO - -- : BFD_RELOC_FRV_TLSMOFF12 - -- : BFD_RELOC_FRV_TLSMOFFHI - -- : BFD_RELOC_FRV_TLSMOFFLO - -- : BFD_RELOC_FRV_GOTTLSOFF12 - -- : BFD_RELOC_FRV_GOTTLSOFFHI - -- : BFD_RELOC_FRV_GOTTLSOFFLO - -- : BFD_RELOC_FRV_TLSOFF - -- : BFD_RELOC_FRV_TLSDESC_RELAX - -- : BFD_RELOC_FRV_GETTLSOFF_RELAX - -- : BFD_RELOC_FRV_TLSOFF_RELAX - -- : BFD_RELOC_FRV_TLSMOFF - Fujitsu Frv Relocations. - - -- : BFD_RELOC_MN10300_GOTOFF24 - This is a 24bit GOT-relative reloc for the mn10300. - - -- : BFD_RELOC_MN10300_GOT32 - This is a 32bit GOT-relative reloc for the mn10300, offset by two - bytes in the instruction. - - -- : BFD_RELOC_MN10300_GOT24 - This is a 24bit GOT-relative reloc for the mn10300, offset by two - bytes in the instruction. - - -- : BFD_RELOC_MN10300_GOT16 - This is a 16bit GOT-relative reloc for the mn10300, offset by two - bytes in the instruction. - - -- : BFD_RELOC_MN10300_COPY - Copy symbol at runtime. - - -- : BFD_RELOC_MN10300_GLOB_DAT - Create GOT entry. - - -- : BFD_RELOC_MN10300_JMP_SLOT - Create PLT entry. - - -- : BFD_RELOC_MN10300_RELATIVE - Adjust by program base. - - -- : BFD_RELOC_386_GOT32 - -- : BFD_RELOC_386_PLT32 - -- : BFD_RELOC_386_COPY - -- : BFD_RELOC_386_GLOB_DAT - -- : BFD_RELOC_386_JUMP_SLOT - -- : BFD_RELOC_386_RELATIVE - -- : BFD_RELOC_386_GOTOFF - -- : BFD_RELOC_386_GOTPC - -- : BFD_RELOC_386_TLS_TPOFF - -- : BFD_RELOC_386_TLS_IE - -- : BFD_RELOC_386_TLS_GOTIE - -- : BFD_RELOC_386_TLS_LE - -- : BFD_RELOC_386_TLS_GD - -- : BFD_RELOC_386_TLS_LDM - -- : BFD_RELOC_386_TLS_LDO_32 - -- : BFD_RELOC_386_TLS_IE_32 - -- : BFD_RELOC_386_TLS_LE_32 - -- : BFD_RELOC_386_TLS_DTPMOD32 - -- : BFD_RELOC_386_TLS_DTPOFF32 - -- : BFD_RELOC_386_TLS_TPOFF32 - -- : BFD_RELOC_386_TLS_GOTDESC - -- : BFD_RELOC_386_TLS_DESC_CALL - -- : BFD_RELOC_386_TLS_DESC - i386/elf relocations - - -- : BFD_RELOC_X86_64_GOT32 - -- : BFD_RELOC_X86_64_PLT32 - -- : BFD_RELOC_X86_64_COPY - -- : BFD_RELOC_X86_64_GLOB_DAT - -- : BFD_RELOC_X86_64_JUMP_SLOT - -- : BFD_RELOC_X86_64_RELATIVE - -- : BFD_RELOC_X86_64_GOTPCREL - -- : BFD_RELOC_X86_64_32S - -- : BFD_RELOC_X86_64_DTPMOD64 - -- : BFD_RELOC_X86_64_DTPOFF64 - -- : BFD_RELOC_X86_64_TPOFF64 - -- : BFD_RELOC_X86_64_TLSGD - -- : BFD_RELOC_X86_64_TLSLD - -- : BFD_RELOC_X86_64_DTPOFF32 - -- : BFD_RELOC_X86_64_GOTTPOFF - -- : BFD_RELOC_X86_64_TPOFF32 - -- : BFD_RELOC_X86_64_GOTOFF64 - -- : BFD_RELOC_X86_64_GOTPC32 - -- : BFD_RELOC_X86_64_GOT64 - -- : BFD_RELOC_X86_64_GOTPCREL64 - -- : BFD_RELOC_X86_64_GOTPC64 - -- : BFD_RELOC_X86_64_GOTPLT64 - -- : BFD_RELOC_X86_64_PLTOFF64 - -- : BFD_RELOC_X86_64_GOTPC32_TLSDESC - -- : BFD_RELOC_X86_64_TLSDESC_CALL - -- : BFD_RELOC_X86_64_TLSDESC - x86-64/elf relocations - - -- : BFD_RELOC_NS32K_IMM_8 - -- : BFD_RELOC_NS32K_IMM_16 - -- : BFD_RELOC_NS32K_IMM_32 - -- : BFD_RELOC_NS32K_IMM_8_PCREL - -- : BFD_RELOC_NS32K_IMM_16_PCREL - -- : BFD_RELOC_NS32K_IMM_32_PCREL - -- : BFD_RELOC_NS32K_DISP_8 - -- : BFD_RELOC_NS32K_DISP_16 - -- : BFD_RELOC_NS32K_DISP_32 - -- : BFD_RELOC_NS32K_DISP_8_PCREL - -- : BFD_RELOC_NS32K_DISP_16_PCREL - -- : BFD_RELOC_NS32K_DISP_32_PCREL - ns32k relocations - - -- : BFD_RELOC_PDP11_DISP_8_PCREL - -- : BFD_RELOC_PDP11_DISP_6_PCREL - PDP11 relocations - - -- : BFD_RELOC_PJ_CODE_HI16 - -- : BFD_RELOC_PJ_CODE_LO16 - -- : BFD_RELOC_PJ_CODE_DIR16 - -- : BFD_RELOC_PJ_CODE_DIR32 - -- : BFD_RELOC_PJ_CODE_REL16 - -- : BFD_RELOC_PJ_CODE_REL32 - Picojava relocs. Not all of these appear in object files. - - -- : BFD_RELOC_PPC_B26 - -- : BFD_RELOC_PPC_BA26 - -- : BFD_RELOC_PPC_TOC16 - -- : BFD_RELOC_PPC_B16 - -- : BFD_RELOC_PPC_B16_BRTAKEN - -- : BFD_RELOC_PPC_B16_BRNTAKEN - -- : BFD_RELOC_PPC_BA16 - -- : BFD_RELOC_PPC_BA16_BRTAKEN - -- : BFD_RELOC_PPC_BA16_BRNTAKEN - -- : BFD_RELOC_PPC_COPY - -- : BFD_RELOC_PPC_GLOB_DAT - -- : BFD_RELOC_PPC_JMP_SLOT - -- : BFD_RELOC_PPC_RELATIVE - -- : BFD_RELOC_PPC_LOCAL24PC - -- : BFD_RELOC_PPC_EMB_NADDR32 - -- : BFD_RELOC_PPC_EMB_NADDR16 - -- : BFD_RELOC_PPC_EMB_NADDR16_LO - -- : BFD_RELOC_PPC_EMB_NADDR16_HI - -- : BFD_RELOC_PPC_EMB_NADDR16_HA - -- : BFD_RELOC_PPC_EMB_SDAI16 - -- : BFD_RELOC_PPC_EMB_SDA2I16 - -- : BFD_RELOC_PPC_EMB_SDA2REL - -- : BFD_RELOC_PPC_EMB_SDA21 - -- : BFD_RELOC_PPC_EMB_MRKREF - -- : BFD_RELOC_PPC_EMB_RELSEC16 - -- : BFD_RELOC_PPC_EMB_RELST_LO - -- : BFD_RELOC_PPC_EMB_RELST_HI - -- : BFD_RELOC_PPC_EMB_RELST_HA - -- : BFD_RELOC_PPC_EMB_BIT_FLD - -- : BFD_RELOC_PPC_EMB_RELSDA - -- : BFD_RELOC_PPC64_HIGHER - -- : BFD_RELOC_PPC64_HIGHER_S - -- : BFD_RELOC_PPC64_HIGHEST - -- : BFD_RELOC_PPC64_HIGHEST_S - -- : BFD_RELOC_PPC64_TOC16_LO - -- : BFD_RELOC_PPC64_TOC16_HI - -- : BFD_RELOC_PPC64_TOC16_HA - -- : BFD_RELOC_PPC64_TOC - -- : BFD_RELOC_PPC64_PLTGOT16 - -- : BFD_RELOC_PPC64_PLTGOT16_LO - -- : BFD_RELOC_PPC64_PLTGOT16_HI - -- : BFD_RELOC_PPC64_PLTGOT16_HA - -- : BFD_RELOC_PPC64_ADDR16_DS - -- : BFD_RELOC_PPC64_ADDR16_LO_DS - -- : BFD_RELOC_PPC64_GOT16_DS - -- : BFD_RELOC_PPC64_GOT16_LO_DS - -- : BFD_RELOC_PPC64_PLT16_LO_DS - -- : BFD_RELOC_PPC64_SECTOFF_DS - -- : BFD_RELOC_PPC64_SECTOFF_LO_DS - -- : BFD_RELOC_PPC64_TOC16_DS - -- : BFD_RELOC_PPC64_TOC16_LO_DS - -- : BFD_RELOC_PPC64_PLTGOT16_DS - -- : BFD_RELOC_PPC64_PLTGOT16_LO_DS - Power(rs6000) and PowerPC relocations. - - -- : BFD_RELOC_PPC_TLS - -- : BFD_RELOC_PPC_DTPMOD - -- : BFD_RELOC_PPC_TPREL16 - -- : BFD_RELOC_PPC_TPREL16_LO - -- : BFD_RELOC_PPC_TPREL16_HI - -- : BFD_RELOC_PPC_TPREL16_HA - -- : BFD_RELOC_PPC_TPREL - -- : BFD_RELOC_PPC_DTPREL16 - -- : BFD_RELOC_PPC_DTPREL16_LO - -- : BFD_RELOC_PPC_DTPREL16_HI - -- : BFD_RELOC_PPC_DTPREL16_HA - -- : BFD_RELOC_PPC_DTPREL - -- : BFD_RELOC_PPC_GOT_TLSGD16 - -- : BFD_RELOC_PPC_GOT_TLSGD16_LO - -- : BFD_RELOC_PPC_GOT_TLSGD16_HI - -- : BFD_RELOC_PPC_GOT_TLSGD16_HA - -- : BFD_RELOC_PPC_GOT_TLSLD16 - -- : BFD_RELOC_PPC_GOT_TLSLD16_LO - -- : BFD_RELOC_PPC_GOT_TLSLD16_HI - -- : BFD_RELOC_PPC_GOT_TLSLD16_HA - -- : BFD_RELOC_PPC_GOT_TPREL16 - -- : BFD_RELOC_PPC_GOT_TPREL16_LO - -- : BFD_RELOC_PPC_GOT_TPREL16_HI - -- : BFD_RELOC_PPC_GOT_TPREL16_HA - -- : BFD_RELOC_PPC_GOT_DTPREL16 - -- : BFD_RELOC_PPC_GOT_DTPREL16_LO - -- : BFD_RELOC_PPC_GOT_DTPREL16_HI - -- : BFD_RELOC_PPC_GOT_DTPREL16_HA - -- : BFD_RELOC_PPC64_TPREL16_DS - -- : BFD_RELOC_PPC64_TPREL16_LO_DS - -- : BFD_RELOC_PPC64_TPREL16_HIGHER - -- : BFD_RELOC_PPC64_TPREL16_HIGHERA - -- : BFD_RELOC_PPC64_TPREL16_HIGHEST - -- : BFD_RELOC_PPC64_TPREL16_HIGHESTA - -- : BFD_RELOC_PPC64_DTPREL16_DS - -- : BFD_RELOC_PPC64_DTPREL16_LO_DS - -- : BFD_RELOC_PPC64_DTPREL16_HIGHER - -- : BFD_RELOC_PPC64_DTPREL16_HIGHERA - -- : BFD_RELOC_PPC64_DTPREL16_HIGHEST - -- : BFD_RELOC_PPC64_DTPREL16_HIGHESTA - PowerPC and PowerPC64 thread-local storage relocations. - - -- : BFD_RELOC_I370_D12 - IBM 370/390 relocations - - -- : BFD_RELOC_CTOR - The type of reloc used to build a constructor table - at the moment - probably a 32 bit wide absolute relocation, but the target can - choose. It generally does map to one of the other relocation - types. - - -- : BFD_RELOC_ARM_PCREL_BRANCH - ARM 26 bit pc-relative branch. The lowest two bits must be zero - and are not stored in the instruction. - - -- : BFD_RELOC_ARM_PCREL_BLX - ARM 26 bit pc-relative branch. The lowest bit must be zero and is - not stored in the instruction. The 2nd lowest bit comes from a 1 - bit field in the instruction. - - -- : BFD_RELOC_THUMB_PCREL_BLX - Thumb 22 bit pc-relative branch. The lowest bit must be zero and - is not stored in the instruction. The 2nd lowest bit comes from a - 1 bit field in the instruction. - - -- : BFD_RELOC_ARM_PCREL_CALL - ARM 26-bit pc-relative branch for an unconditional BL or BLX - instruction. - - -- : BFD_RELOC_ARM_PCREL_JUMP - ARM 26-bit pc-relative branch for B or conditional BL instruction. - - -- : BFD_RELOC_THUMB_PCREL_BRANCH7 - -- : BFD_RELOC_THUMB_PCREL_BRANCH9 - -- : BFD_RELOC_THUMB_PCREL_BRANCH12 - -- : BFD_RELOC_THUMB_PCREL_BRANCH20 - -- : BFD_RELOC_THUMB_PCREL_BRANCH23 - -- : BFD_RELOC_THUMB_PCREL_BRANCH25 - Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The - lowest bit must be zero and is not stored in the instruction. - Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an - "nn" one smaller in all cases. Note further that BRANCH23 - corresponds to R_ARM_THM_CALL. - - -- : BFD_RELOC_ARM_OFFSET_IMM - 12-bit immediate offset, used in ARM-format ldr and str - instructions. - - -- : BFD_RELOC_ARM_THUMB_OFFSET - 5-bit immediate offset, used in Thumb-format ldr and str - instructions. - - -- : BFD_RELOC_ARM_TARGET1 - Pc-relative or absolute relocation depending on target. Used for - entries in .init_array sections. - - -- : BFD_RELOC_ARM_ROSEGREL32 - Read-only segment base relative address. - - -- : BFD_RELOC_ARM_SBREL32 - Data segment base relative address. - - -- : BFD_RELOC_ARM_TARGET2 - This reloc is used for references to RTTI data from exception - handling tables. The actual definition depends on the target. It - may be a pc-relative or some form of GOT-indirect relocation. - - -- : BFD_RELOC_ARM_PREL31 - 31-bit PC relative address. - - -- : BFD_RELOC_ARM_JUMP_SLOT - -- : BFD_RELOC_ARM_GLOB_DAT - -- : BFD_RELOC_ARM_GOT32 - -- : BFD_RELOC_ARM_PLT32 - -- : BFD_RELOC_ARM_RELATIVE - -- : BFD_RELOC_ARM_GOTOFF - -- : BFD_RELOC_ARM_GOTPC - Relocations for setting up GOTs and PLTs for shared libraries. - - -- : BFD_RELOC_ARM_TLS_GD32 - -- : BFD_RELOC_ARM_TLS_LDO32 - -- : BFD_RELOC_ARM_TLS_LDM32 - -- : BFD_RELOC_ARM_TLS_DTPOFF32 - -- : BFD_RELOC_ARM_TLS_DTPMOD32 - -- : BFD_RELOC_ARM_TLS_TPOFF32 - -- : BFD_RELOC_ARM_TLS_IE32 - -- : BFD_RELOC_ARM_TLS_LE32 - ARM thread-local storage relocations. - - -- : BFD_RELOC_ARM_IMMEDIATE - -- : BFD_RELOC_ARM_ADRL_IMMEDIATE - -- : BFD_RELOC_ARM_T32_IMMEDIATE - -- : BFD_RELOC_ARM_T32_IMM12 - -- : BFD_RELOC_ARM_T32_ADD_PC12 - -- : BFD_RELOC_ARM_SHIFT_IMM - -- : BFD_RELOC_ARM_SMC - -- : BFD_RELOC_ARM_SWI - -- : BFD_RELOC_ARM_MULTI - -- : BFD_RELOC_ARM_CP_OFF_IMM - -- : BFD_RELOC_ARM_CP_OFF_IMM_S2 - -- : BFD_RELOC_ARM_T32_CP_OFF_IMM - -- : BFD_RELOC_ARM_T32_CP_OFF_IMM_S2 - -- : BFD_RELOC_ARM_ADR_IMM - -- : BFD_RELOC_ARM_LDR_IMM - -- : BFD_RELOC_ARM_LITERAL - -- : BFD_RELOC_ARM_IN_POOL - -- : BFD_RELOC_ARM_OFFSET_IMM8 - -- : BFD_RELOC_ARM_T32_OFFSET_U8 - -- : BFD_RELOC_ARM_T32_OFFSET_IMM - -- : BFD_RELOC_ARM_HWLITERAL - -- : BFD_RELOC_ARM_THUMB_ADD - -- : BFD_RELOC_ARM_THUMB_IMM - -- : BFD_RELOC_ARM_THUMB_SHIFT - These relocs are only used within the ARM assembler. They are not - (at present) written to any object files. - - -- : BFD_RELOC_SH_PCDISP8BY2 - -- : BFD_RELOC_SH_PCDISP12BY2 - -- : BFD_RELOC_SH_IMM3 - -- : BFD_RELOC_SH_IMM3U - -- : BFD_RELOC_SH_DISP12 - -- : BFD_RELOC_SH_DISP12BY2 - -- : BFD_RELOC_SH_DISP12BY4 - -- : BFD_RELOC_SH_DISP12BY8 - -- : BFD_RELOC_SH_DISP20 - -- : BFD_RELOC_SH_DISP20BY8 - -- : BFD_RELOC_SH_IMM4 - -- : BFD_RELOC_SH_IMM4BY2 - -- : BFD_RELOC_SH_IMM4BY4 - -- : BFD_RELOC_SH_IMM8 - -- : BFD_RELOC_SH_IMM8BY2 - -- : BFD_RELOC_SH_IMM8BY4 - -- : BFD_RELOC_SH_PCRELIMM8BY2 - -- : BFD_RELOC_SH_PCRELIMM8BY4 - -- : BFD_RELOC_SH_SWITCH16 - -- : BFD_RELOC_SH_SWITCH32 - -- : BFD_RELOC_SH_USES - -- : BFD_RELOC_SH_COUNT - -- : BFD_RELOC_SH_ALIGN - -- : BFD_RELOC_SH_CODE - -- : BFD_RELOC_SH_DATA - -- : BFD_RELOC_SH_LABEL - -- : BFD_RELOC_SH_LOOP_START - -- : BFD_RELOC_SH_LOOP_END - -- : BFD_RELOC_SH_COPY - -- : BFD_RELOC_SH_GLOB_DAT - -- : BFD_RELOC_SH_JMP_SLOT - -- : BFD_RELOC_SH_RELATIVE - -- : BFD_RELOC_SH_GOTPC - -- : BFD_RELOC_SH_GOT_LOW16 - -- : BFD_RELOC_SH_GOT_MEDLOW16 - -- : BFD_RELOC_SH_GOT_MEDHI16 - -- : BFD_RELOC_SH_GOT_HI16 - -- : BFD_RELOC_SH_GOTPLT_LOW16 - -- : BFD_RELOC_SH_GOTPLT_MEDLOW16 - -- : BFD_RELOC_SH_GOTPLT_MEDHI16 - -- : BFD_RELOC_SH_GOTPLT_HI16 - -- : BFD_RELOC_SH_PLT_LOW16 - -- : BFD_RELOC_SH_PLT_MEDLOW16 - -- : BFD_RELOC_SH_PLT_MEDHI16 - -- : BFD_RELOC_SH_PLT_HI16 - -- : BFD_RELOC_SH_GOTOFF_LOW16 - -- : BFD_RELOC_SH_GOTOFF_MEDLOW16 - -- : BFD_RELOC_SH_GOTOFF_MEDHI16 - -- : BFD_RELOC_SH_GOTOFF_HI16 - -- : BFD_RELOC_SH_GOTPC_LOW16 - -- : BFD_RELOC_SH_GOTPC_MEDLOW16 - -- : BFD_RELOC_SH_GOTPC_MEDHI16 - -- : BFD_RELOC_SH_GOTPC_HI16 - -- : BFD_RELOC_SH_COPY64 - -- : BFD_RELOC_SH_GLOB_DAT64 - -- : BFD_RELOC_SH_JMP_SLOT64 - -- : BFD_RELOC_SH_RELATIVE64 - -- : BFD_RELOC_SH_GOT10BY4 - -- : BFD_RELOC_SH_GOT10BY8 - -- : BFD_RELOC_SH_GOTPLT10BY4 - -- : BFD_RELOC_SH_GOTPLT10BY8 - -- : BFD_RELOC_SH_GOTPLT32 - -- : BFD_RELOC_SH_SHMEDIA_CODE - -- : BFD_RELOC_SH_IMMU5 - -- : BFD_RELOC_SH_IMMS6 - -- : BFD_RELOC_SH_IMMS6BY32 - -- : BFD_RELOC_SH_IMMU6 - -- : BFD_RELOC_SH_IMMS10 - -- : BFD_RELOC_SH_IMMS10BY2 - -- : BFD_RELOC_SH_IMMS10BY4 - -- : BFD_RELOC_SH_IMMS10BY8 - -- : BFD_RELOC_SH_IMMS16 - -- : BFD_RELOC_SH_IMMU16 - -- : BFD_RELOC_SH_IMM_LOW16 - -- : BFD_RELOC_SH_IMM_LOW16_PCREL - -- : BFD_RELOC_SH_IMM_MEDLOW16 - -- : BFD_RELOC_SH_IMM_MEDLOW16_PCREL - -- : BFD_RELOC_SH_IMM_MEDHI16 - -- : BFD_RELOC_SH_IMM_MEDHI16_PCREL - -- : BFD_RELOC_SH_IMM_HI16 - -- : BFD_RELOC_SH_IMM_HI16_PCREL - -- : BFD_RELOC_SH_PT_16 - -- : BFD_RELOC_SH_TLS_GD_32 - -- : BFD_RELOC_SH_TLS_LD_32 - -- : BFD_RELOC_SH_TLS_LDO_32 - -- : BFD_RELOC_SH_TLS_IE_32 - -- : BFD_RELOC_SH_TLS_LE_32 - -- : BFD_RELOC_SH_TLS_DTPMOD32 - -- : BFD_RELOC_SH_TLS_DTPOFF32 - -- : BFD_RELOC_SH_TLS_TPOFF32 - Renesas / SuperH SH relocs. Not all of these appear in object - files. - - -- : BFD_RELOC_ARC_B22_PCREL - ARC Cores relocs. ARC 22 bit pc-relative branch. The lowest two - bits must be zero and are not stored in the instruction. The high - 20 bits are installed in bits 26 through 7 of the instruction. - - -- : BFD_RELOC_ARC_B26 - ARC 26 bit absolute branch. The lowest two bits must be zero and - are not stored in the instruction. The high 24 bits are installed - in bits 23 through 0. - - -- : BFD_RELOC_BFIN_16_IMM - ADI Blackfin 16 bit immediate absolute reloc. - - -- : BFD_RELOC_BFIN_16_HIGH - ADI Blackfin 16 bit immediate absolute reloc higher 16 bits. - - -- : BFD_RELOC_BFIN_4_PCREL - ADI Blackfin 'a' part of LSETUP. - - -- : BFD_RELOC_BFIN_5_PCREL - ADI Blackfin. - - -- : BFD_RELOC_BFIN_16_LOW - ADI Blackfin 16 bit immediate absolute reloc lower 16 bits. - - -- : BFD_RELOC_BFIN_10_PCREL - ADI Blackfin. - - -- : BFD_RELOC_BFIN_11_PCREL - ADI Blackfin 'b' part of LSETUP. - - -- : BFD_RELOC_BFIN_12_PCREL_JUMP - ADI Blackfin. - - -- : BFD_RELOC_BFIN_12_PCREL_JUMP_S - ADI Blackfin Short jump, pcrel. - - -- : BFD_RELOC_BFIN_24_PCREL_CALL_X - ADI Blackfin Call.x not implemented. - - -- : BFD_RELOC_BFIN_24_PCREL_JUMP_L - ADI Blackfin Long Jump pcrel. - - -- : BFD_RELOC_BFIN_GOT17M4 - -- : BFD_RELOC_BFIN_GOTHI - -- : BFD_RELOC_BFIN_GOTLO - -- : BFD_RELOC_BFIN_FUNCDESC - -- : BFD_RELOC_BFIN_FUNCDESC_GOT17M4 - -- : BFD_RELOC_BFIN_FUNCDESC_GOTHI - -- : BFD_RELOC_BFIN_FUNCDESC_GOTLO - -- : BFD_RELOC_BFIN_FUNCDESC_VALUE - -- : BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4 - -- : BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI - -- : BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO - -- : BFD_RELOC_BFIN_GOTOFF17M4 - -- : BFD_RELOC_BFIN_GOTOFFHI - -- : BFD_RELOC_BFIN_GOTOFFLO - ADI Blackfin FD-PIC relocations. - - -- : BFD_RELOC_BFIN_GOT - ADI Blackfin GOT relocation. - - -- : BFD_RELOC_BFIN_PLTPC - ADI Blackfin PLTPC relocation. - - -- : BFD_ARELOC_BFIN_PUSH - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_CONST - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_ADD - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_SUB - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_MULT - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_DIV - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_MOD - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_LSHIFT - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_RSHIFT - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_AND - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_OR - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_XOR - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_LAND - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_LOR - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_LEN - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_NEG - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_COMP - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_PAGE - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_HWPAGE - ADI Blackfin arithmetic relocation. - - -- : BFD_ARELOC_BFIN_ADDR - ADI Blackfin arithmetic relocation. - - -- : BFD_RELOC_D10V_10_PCREL_R - Mitsubishi D10V relocs. This is a 10-bit reloc with the right 2 - bits assumed to be 0. - - -- : BFD_RELOC_D10V_10_PCREL_L - Mitsubishi D10V relocs. This is a 10-bit reloc with the right 2 - bits assumed to be 0. This is the same as the previous reloc - except it is in the left container, i.e., shifted left 15 bits. - - -- : BFD_RELOC_D10V_18 - This is an 18-bit reloc with the right 2 bits assumed to be 0. - - -- : BFD_RELOC_D10V_18_PCREL - This is an 18-bit reloc with the right 2 bits assumed to be 0. - - -- : BFD_RELOC_D30V_6 - Mitsubishi D30V relocs. This is a 6-bit absolute reloc. - - -- : BFD_RELOC_D30V_9_PCREL - This is a 6-bit pc-relative reloc with the right 3 bits assumed to - be 0. - - -- : BFD_RELOC_D30V_9_PCREL_R - This is a 6-bit pc-relative reloc with the right 3 bits assumed to - be 0. Same as the previous reloc but on the right side of the - container. - - -- : BFD_RELOC_D30V_15 - This is a 12-bit absolute reloc with the right 3 bitsassumed to be - 0. - - -- : BFD_RELOC_D30V_15_PCREL - This is a 12-bit pc-relative reloc with the right 3 bits assumed - to be 0. - - -- : BFD_RELOC_D30V_15_PCREL_R - This is a 12-bit pc-relative reloc with the right 3 bits assumed - to be 0. Same as the previous reloc but on the right side of the - container. - - -- : BFD_RELOC_D30V_21 - This is an 18-bit absolute reloc with the right 3 bits assumed to - be 0. - - -- : BFD_RELOC_D30V_21_PCREL - This is an 18-bit pc-relative reloc with the right 3 bits assumed - to be 0. - - -- : BFD_RELOC_D30V_21_PCREL_R - This is an 18-bit pc-relative reloc with the right 3 bits assumed - to be 0. Same as the previous reloc but on the right side of the - container. - - -- : BFD_RELOC_D30V_32 - This is a 32-bit absolute reloc. - - -- : BFD_RELOC_D30V_32_PCREL - This is a 32-bit pc-relative reloc. - - -- : BFD_RELOC_DLX_HI16_S - DLX relocs - - -- : BFD_RELOC_DLX_LO16 - DLX relocs - - -- : BFD_RELOC_DLX_JMP26 - DLX relocs - - -- : BFD_RELOC_M32C_HI8 - -- : BFD_RELOC_M32C_RL_JUMP - -- : BFD_RELOC_M32C_RL_1ADDR - -- : BFD_RELOC_M32C_RL_2ADDR - Renesas M16C/M32C Relocations. - - -- : BFD_RELOC_M32R_24 - Renesas M32R (formerly Mitsubishi M32R) relocs. This is a 24 bit - absolute address. - - -- : BFD_RELOC_M32R_10_PCREL - This is a 10-bit pc-relative reloc with the right 2 bits assumed - to be 0. - - -- : BFD_RELOC_M32R_18_PCREL - This is an 18-bit reloc with the right 2 bits assumed to be 0. - - -- : BFD_RELOC_M32R_26_PCREL - This is a 26-bit reloc with the right 2 bits assumed to be 0. - - -- : BFD_RELOC_M32R_HI16_ULO - This is a 16-bit reloc containing the high 16 bits of an address - used when the lower 16 bits are treated as unsigned. - - -- : BFD_RELOC_M32R_HI16_SLO - This is a 16-bit reloc containing the high 16 bits of an address - used when the lower 16 bits are treated as signed. - - -- : BFD_RELOC_M32R_LO16 - This is a 16-bit reloc containing the lower 16 bits of an address. - - -- : BFD_RELOC_M32R_SDA16 - This is a 16-bit reloc containing the small data area offset for - use in add3, load, and store instructions. - - -- : BFD_RELOC_M32R_GOT24 - -- : BFD_RELOC_M32R_26_PLTREL - -- : BFD_RELOC_M32R_COPY - -- : BFD_RELOC_M32R_GLOB_DAT - -- : BFD_RELOC_M32R_JMP_SLOT - -- : BFD_RELOC_M32R_RELATIVE - -- : BFD_RELOC_M32R_GOTOFF - -- : BFD_RELOC_M32R_GOTOFF_HI_ULO - -- : BFD_RELOC_M32R_GOTOFF_HI_SLO - -- : BFD_RELOC_M32R_GOTOFF_LO - -- : BFD_RELOC_M32R_GOTPC24 - -- : BFD_RELOC_M32R_GOT16_HI_ULO - -- : BFD_RELOC_M32R_GOT16_HI_SLO - -- : BFD_RELOC_M32R_GOT16_LO - -- : BFD_RELOC_M32R_GOTPC_HI_ULO - -- : BFD_RELOC_M32R_GOTPC_HI_SLO - -- : BFD_RELOC_M32R_GOTPC_LO - For PIC. - - -- : BFD_RELOC_V850_9_PCREL - This is a 9-bit reloc - - -- : BFD_RELOC_V850_22_PCREL - This is a 22-bit reloc - - -- : BFD_RELOC_V850_SDA_16_16_OFFSET - This is a 16 bit offset from the short data area pointer. - - -- : BFD_RELOC_V850_SDA_15_16_OFFSET - This is a 16 bit offset (of which only 15 bits are used) from the - short data area pointer. - - -- : BFD_RELOC_V850_ZDA_16_16_OFFSET - This is a 16 bit offset from the zero data area pointer. - - -- : BFD_RELOC_V850_ZDA_15_16_OFFSET - This is a 16 bit offset (of which only 15 bits are used) from the - zero data area pointer. - - -- : BFD_RELOC_V850_TDA_6_8_OFFSET - This is an 8 bit offset (of which only 6 bits are used) from the - tiny data area pointer. - - -- : BFD_RELOC_V850_TDA_7_8_OFFSET - This is an 8bit offset (of which only 7 bits are used) from the - tiny data area pointer. - - -- : BFD_RELOC_V850_TDA_7_7_OFFSET - This is a 7 bit offset from the tiny data area pointer. - - -- : BFD_RELOC_V850_TDA_16_16_OFFSET - This is a 16 bit offset from the tiny data area pointer. - - -- : BFD_RELOC_V850_TDA_4_5_OFFSET - This is a 5 bit offset (of which only 4 bits are used) from the - tiny data area pointer. - - -- : BFD_RELOC_V850_TDA_4_4_OFFSET - This is a 4 bit offset from the tiny data area pointer. - - -- : BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET - This is a 16 bit offset from the short data area pointer, with the - bits placed non-contiguously in the instruction. - - -- : BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET - This is a 16 bit offset from the zero data area pointer, with the - bits placed non-contiguously in the instruction. - - -- : BFD_RELOC_V850_CALLT_6_7_OFFSET - This is a 6 bit offset from the call table base pointer. - - -- : BFD_RELOC_V850_CALLT_16_16_OFFSET - This is a 16 bit offset from the call table base pointer. - - -- : BFD_RELOC_V850_LONGCALL - Used for relaxing indirect function calls. - - -- : BFD_RELOC_V850_LONGJUMP - Used for relaxing indirect jumps. - - -- : BFD_RELOC_V850_ALIGN - Used to maintain alignment whilst relaxing. - - -- : BFD_RELOC_V850_LO16_SPLIT_OFFSET - This is a variation of BFD_RELOC_LO16 that can be used in v850e - ld.bu instructions. - - -- : BFD_RELOC_MN10300_32_PCREL - This is a 32bit pcrel reloc for the mn10300, offset by two bytes - in the instruction. - - -- : BFD_RELOC_MN10300_16_PCREL - This is a 16bit pcrel reloc for the mn10300, offset by two bytes - in the instruction. - - -- : BFD_RELOC_TIC30_LDP - This is a 8bit DP reloc for the tms320c30, where the most - significant 8 bits of a 24 bit word are placed into the least - significant 8 bits of the opcode. - - -- : BFD_RELOC_TIC54X_PARTLS7 - This is a 7bit reloc for the tms320c54x, where the least - significant 7 bits of a 16 bit word are placed into the least - significant 7 bits of the opcode. - - -- : BFD_RELOC_TIC54X_PARTMS9 - This is a 9bit DP reloc for the tms320c54x, where the most - significant 9 bits of a 16 bit word are placed into the least - significant 9 bits of the opcode. - - -- : BFD_RELOC_TIC54X_23 - This is an extended address 23-bit reloc for the tms320c54x. - - -- : BFD_RELOC_TIC54X_16_OF_23 - This is a 16-bit reloc for the tms320c54x, where the least - significant 16 bits of a 23-bit extended address are placed into - the opcode. - - -- : BFD_RELOC_TIC54X_MS7_OF_23 - This is a reloc for the tms320c54x, where the most significant 7 - bits of a 23-bit extended address are placed into the opcode. - - -- : BFD_RELOC_FR30_48 - This is a 48 bit reloc for the FR30 that stores 32 bits. - - -- : BFD_RELOC_FR30_20 - This is a 32 bit reloc for the FR30 that stores 20 bits split up - into two sections. - - -- : BFD_RELOC_FR30_6_IN_4 - This is a 16 bit reloc for the FR30 that stores a 6 bit word - offset in 4 bits. - - -- : BFD_RELOC_FR30_8_IN_8 - This is a 16 bit reloc for the FR30 that stores an 8 bit byte - offset into 8 bits. - - -- : BFD_RELOC_FR30_9_IN_8 - This is a 16 bit reloc for the FR30 that stores a 9 bit short - offset into 8 bits. - - -- : BFD_RELOC_FR30_10_IN_8 - This is a 16 bit reloc for the FR30 that stores a 10 bit word - offset into 8 bits. - - -- : BFD_RELOC_FR30_9_PCREL - This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative - short offset into 8 bits. - - -- : BFD_RELOC_FR30_12_PCREL - This is a 16 bit reloc for the FR30 that stores a 12 bit pc - relative short offset into 11 bits. - - -- : BFD_RELOC_MCORE_PCREL_IMM8BY4 - -- : BFD_RELOC_MCORE_PCREL_IMM11BY2 - -- : BFD_RELOC_MCORE_PCREL_IMM4BY2 - -- : BFD_RELOC_MCORE_PCREL_32 - -- : BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2 - -- : BFD_RELOC_MCORE_RVA - Motorola Mcore relocations. - - -- : BFD_RELOC_MMIX_GETA - -- : BFD_RELOC_MMIX_GETA_1 - -- : BFD_RELOC_MMIX_GETA_2 - -- : BFD_RELOC_MMIX_GETA_3 - These are relocations for the GETA instruction. - - -- : BFD_RELOC_MMIX_CBRANCH - -- : BFD_RELOC_MMIX_CBRANCH_J - -- : BFD_RELOC_MMIX_CBRANCH_1 - -- : BFD_RELOC_MMIX_CBRANCH_2 - -- : BFD_RELOC_MMIX_CBRANCH_3 - These are relocations for a conditional branch instruction. - - -- : BFD_RELOC_MMIX_PUSHJ - -- : BFD_RELOC_MMIX_PUSHJ_1 - -- : BFD_RELOC_MMIX_PUSHJ_2 - -- : BFD_RELOC_MMIX_PUSHJ_3 - -- : BFD_RELOC_MMIX_PUSHJ_STUBBABLE - These are relocations for the PUSHJ instruction. - - -- : BFD_RELOC_MMIX_JMP - -- : BFD_RELOC_MMIX_JMP_1 - -- : BFD_RELOC_MMIX_JMP_2 - -- : BFD_RELOC_MMIX_JMP_3 - These are relocations for the JMP instruction. - - -- : BFD_RELOC_MMIX_ADDR19 - This is a relocation for a relative address as in a GETA - instruction or a branch. - - -- : BFD_RELOC_MMIX_ADDR27 - This is a relocation for a relative address as in a JMP - instruction. - - -- : BFD_RELOC_MMIX_REG_OR_BYTE - This is a relocation for an instruction field that may be a general - register or a value 0..255. - - -- : BFD_RELOC_MMIX_REG - This is a relocation for an instruction field that may be a general - register. - - -- : BFD_RELOC_MMIX_BASE_PLUS_OFFSET - This is a relocation for two instruction fields holding a register - and an offset, the equivalent of the relocation. - - -- : BFD_RELOC_MMIX_LOCAL - This relocation is an assertion that the expression is not - allocated as a global register. It does not modify contents. - - -- : BFD_RELOC_AVR_7_PCREL - This is a 16 bit reloc for the AVR that stores 8 bit pc relative - short offset into 7 bits. - - -- : BFD_RELOC_AVR_13_PCREL - This is a 16 bit reloc for the AVR that stores 13 bit pc relative - short offset into 12 bits. - - -- : BFD_RELOC_AVR_16_PM - This is a 16 bit reloc for the AVR that stores 17 bit value - (usually program memory address) into 16 bits. - - -- : BFD_RELOC_AVR_LO8_LDI - This is a 16 bit reloc for the AVR that stores 8 bit value (usually - data memory address) into 8 bit immediate value of LDI insn. - - -- : BFD_RELOC_AVR_HI8_LDI - This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 - bit of data memory address) into 8 bit immediate value of LDI insn. - - -- : BFD_RELOC_AVR_HH8_LDI - This is a 16 bit reloc for the AVR that stores 8 bit value (most - high 8 bit of program memory address) into 8 bit immediate value - of LDI insn. - - -- : BFD_RELOC_AVR_MS8_LDI - This is a 16 bit reloc for the AVR that stores 8 bit value (most - high 8 bit of 32 bit value) into 8 bit immediate value of LDI insn. - - -- : BFD_RELOC_AVR_LO8_LDI_NEG - This is a 16 bit reloc for the AVR that stores negated 8 bit value - (usually data memory address) into 8 bit immediate value of SUBI - insn. - - -- : BFD_RELOC_AVR_HI8_LDI_NEG - This is a 16 bit reloc for the AVR that stores negated 8 bit value - (high 8 bit of data memory address) into 8 bit immediate value of - SUBI insn. - - -- : BFD_RELOC_AVR_HH8_LDI_NEG - This is a 16 bit reloc for the AVR that stores negated 8 bit value - (most high 8 bit of program memory address) into 8 bit immediate - value of LDI or SUBI insn. - - -- : BFD_RELOC_AVR_MS8_LDI_NEG - This is a 16 bit reloc for the AVR that stores negated 8 bit value - (msb of 32 bit value) into 8 bit immediate value of LDI insn. - - -- : BFD_RELOC_AVR_LO8_LDI_PM - This is a 16 bit reloc for the AVR that stores 8 bit value (usually - command address) into 8 bit immediate value of LDI insn. - - -- : BFD_RELOC_AVR_HI8_LDI_PM - This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 - bit of command address) into 8 bit immediate value of LDI insn. - - -- : BFD_RELOC_AVR_HH8_LDI_PM - This is a 16 bit reloc for the AVR that stores 8 bit value (most - high 8 bit of command address) into 8 bit immediate value of LDI - insn. - - -- : BFD_RELOC_AVR_LO8_LDI_PM_NEG - This is a 16 bit reloc for the AVR that stores negated 8 bit value - (usually command address) into 8 bit immediate value of SUBI insn. - - -- : BFD_RELOC_AVR_HI8_LDI_PM_NEG - This is a 16 bit reloc for the AVR that stores negated 8 bit value - (high 8 bit of 16 bit command address) into 8 bit immediate value - of SUBI insn. - - -- : BFD_RELOC_AVR_HH8_LDI_PM_NEG - This is a 16 bit reloc for the AVR that stores negated 8 bit value - (high 6 bit of 22 bit command address) into 8 bit immediate value - of SUBI insn. - - -- : BFD_RELOC_AVR_CALL - This is a 32 bit reloc for the AVR that stores 23 bit value into - 22 bits. - - -- : BFD_RELOC_AVR_LDI - This is a 16 bit reloc for the AVR that stores all needed bits for - absolute addressing with ldi with overflow check to linktime - - -- : BFD_RELOC_AVR_6 - This is a 6 bit reloc for the AVR that stores offset for ldd/std - instructions - - -- : BFD_RELOC_AVR_6_ADIW - This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw - instructions - - -- : BFD_RELOC_390_12 - Direct 12 bit. - - -- : BFD_RELOC_390_GOT12 - 12 bit GOT offset. - - -- : BFD_RELOC_390_PLT32 - 32 bit PC relative PLT address. - - -- : BFD_RELOC_390_COPY - Copy symbol at runtime. - - -- : BFD_RELOC_390_GLOB_DAT - Create GOT entry. - - -- : BFD_RELOC_390_JMP_SLOT - Create PLT entry. - - -- : BFD_RELOC_390_RELATIVE - Adjust by program base. - - -- : BFD_RELOC_390_GOTPC - 32 bit PC relative offset to GOT. - - -- : BFD_RELOC_390_GOT16 - 16 bit GOT offset. - - -- : BFD_RELOC_390_PC16DBL - PC relative 16 bit shifted by 1. - - -- : BFD_RELOC_390_PLT16DBL - 16 bit PC rel. PLT shifted by 1. - - -- : BFD_RELOC_390_PC32DBL - PC relative 32 bit shifted by 1. - - -- : BFD_RELOC_390_PLT32DBL - 32 bit PC rel. PLT shifted by 1. - - -- : BFD_RELOC_390_GOTPCDBL - 32 bit PC rel. GOT shifted by 1. - - -- : BFD_RELOC_390_GOT64 - 64 bit GOT offset. - - -- : BFD_RELOC_390_PLT64 - 64 bit PC relative PLT address. - - -- : BFD_RELOC_390_GOTENT - 32 bit rel. offset to GOT entry. - - -- : BFD_RELOC_390_GOTOFF64 - 64 bit offset to GOT. - - -- : BFD_RELOC_390_GOTPLT12 - 12-bit offset to symbol-entry within GOT, with PLT handling. - - -- : BFD_RELOC_390_GOTPLT16 - 16-bit offset to symbol-entry within GOT, with PLT handling. - - -- : BFD_RELOC_390_GOTPLT32 - 32-bit offset to symbol-entry within GOT, with PLT handling. - - -- : BFD_RELOC_390_GOTPLT64 - 64-bit offset to symbol-entry within GOT, with PLT handling. - - -- : BFD_RELOC_390_GOTPLTENT - 32-bit rel. offset to symbol-entry within GOT, with PLT handling. - - -- : BFD_RELOC_390_PLTOFF16 - 16-bit rel. offset from the GOT to a PLT entry. - - -- : BFD_RELOC_390_PLTOFF32 - 32-bit rel. offset from the GOT to a PLT entry. - - -- : BFD_RELOC_390_PLTOFF64 - 64-bit rel. offset from the GOT to a PLT entry. - - -- : BFD_RELOC_390_TLS_LOAD - -- : BFD_RELOC_390_TLS_GDCALL - -- : BFD_RELOC_390_TLS_LDCALL - -- : BFD_RELOC_390_TLS_GD32 - -- : BFD_RELOC_390_TLS_GD64 - -- : BFD_RELOC_390_TLS_GOTIE12 - -- : BFD_RELOC_390_TLS_GOTIE32 - -- : BFD_RELOC_390_TLS_GOTIE64 - -- : BFD_RELOC_390_TLS_LDM32 - -- : BFD_RELOC_390_TLS_LDM64 - -- : BFD_RELOC_390_TLS_IE32 - -- : BFD_RELOC_390_TLS_IE64 - -- : BFD_RELOC_390_TLS_IEENT - -- : BFD_RELOC_390_TLS_LE32 - -- : BFD_RELOC_390_TLS_LE64 - -- : BFD_RELOC_390_TLS_LDO32 - -- : BFD_RELOC_390_TLS_LDO64 - -- : BFD_RELOC_390_TLS_DTPMOD - -- : BFD_RELOC_390_TLS_DTPOFF - -- : BFD_RELOC_390_TLS_TPOFF - s390 tls relocations. - - -- : BFD_RELOC_390_20 - -- : BFD_RELOC_390_GOT20 - -- : BFD_RELOC_390_GOTPLT20 - -- : BFD_RELOC_390_TLS_GOTIE20 - Long displacement extension. - - -- : BFD_RELOC_IP2K_FR9 - Scenix IP2K - 9-bit register number / data address - - -- : BFD_RELOC_IP2K_BANK - Scenix IP2K - 4-bit register/data bank number - - -- : BFD_RELOC_IP2K_ADDR16CJP - Scenix IP2K - low 13 bits of instruction word address - - -- : BFD_RELOC_IP2K_PAGE3 - Scenix IP2K - high 3 bits of instruction word address - - -- : BFD_RELOC_IP2K_LO8DATA - -- : BFD_RELOC_IP2K_HI8DATA - -- : BFD_RELOC_IP2K_EX8DATA - Scenix IP2K - ext/low/high 8 bits of data address - - -- : BFD_RELOC_IP2K_LO8INSN - -- : BFD_RELOC_IP2K_HI8INSN - Scenix IP2K - low/high 8 bits of instruction word address - - -- : BFD_RELOC_IP2K_PC_SKIP - Scenix IP2K - even/odd PC modifier to modify snb pcl.0 - - -- : BFD_RELOC_IP2K_TEXT - Scenix IP2K - 16 bit word address in text section. - - -- : BFD_RELOC_IP2K_FR_OFFSET - Scenix IP2K - 7-bit sp or dp offset - - -- : BFD_RELOC_VPE4KMATH_DATA - -- : BFD_RELOC_VPE4KMATH_INSN - Scenix VPE4K coprocessor - data/insn-space addressing - - -- : BFD_RELOC_VTABLE_INHERIT - -- : BFD_RELOC_VTABLE_ENTRY - These two relocations are used by the linker to determine which of - the entries in a C++ virtual function table are actually used. - When the -gc-sections option is given, the linker will zero out - the entries that are not used, so that the code for those - functions need not be included in the output. - - VTABLE_INHERIT is a zero-space relocation used to describe to the - linker the inheritance tree of a C++ virtual function table. The - relocation's symbol should be the parent class' vtable, and the - relocation should be located at the child vtable. - - VTABLE_ENTRY is a zero-space relocation that describes the use of a - virtual function table entry. The reloc's symbol should refer to - the table of the class mentioned in the code. Off of that base, - an offset describes the entry that is being used. For Rela hosts, - this offset is stored in the reloc's addend. For Rel hosts, we - are forced to put this offset in the reloc's section offset. - - -- : BFD_RELOC_IA64_IMM14 - -- : BFD_RELOC_IA64_IMM22 - -- : BFD_RELOC_IA64_IMM64 - -- : BFD_RELOC_IA64_DIR32MSB - -- : BFD_RELOC_IA64_DIR32LSB - -- : BFD_RELOC_IA64_DIR64MSB - -- : BFD_RELOC_IA64_DIR64LSB - -- : BFD_RELOC_IA64_GPREL22 - -- : BFD_RELOC_IA64_GPREL64I - -- : BFD_RELOC_IA64_GPREL32MSB - -- : BFD_RELOC_IA64_GPREL32LSB - -- : BFD_RELOC_IA64_GPREL64MSB - -- : BFD_RELOC_IA64_GPREL64LSB - -- : BFD_RELOC_IA64_LTOFF22 - -- : BFD_RELOC_IA64_LTOFF64I - -- : BFD_RELOC_IA64_PLTOFF22 - -- : BFD_RELOC_IA64_PLTOFF64I - -- : BFD_RELOC_IA64_PLTOFF64MSB - -- : BFD_RELOC_IA64_PLTOFF64LSB - -- : BFD_RELOC_IA64_FPTR64I - -- : BFD_RELOC_IA64_FPTR32MSB - -- : BFD_RELOC_IA64_FPTR32LSB - -- : BFD_RELOC_IA64_FPTR64MSB - -- : BFD_RELOC_IA64_FPTR64LSB - -- : BFD_RELOC_IA64_PCREL21B - -- : BFD_RELOC_IA64_PCREL21BI - -- : BFD_RELOC_IA64_PCREL21M - -- : BFD_RELOC_IA64_PCREL21F - -- : BFD_RELOC_IA64_PCREL22 - -- : BFD_RELOC_IA64_PCREL60B - -- : BFD_RELOC_IA64_PCREL64I - -- : BFD_RELOC_IA64_PCREL32MSB - -- : BFD_RELOC_IA64_PCREL32LSB - -- : BFD_RELOC_IA64_PCREL64MSB - -- : BFD_RELOC_IA64_PCREL64LSB - -- : BFD_RELOC_IA64_LTOFF_FPTR22 - -- : BFD_RELOC_IA64_LTOFF_FPTR64I - -- : BFD_RELOC_IA64_LTOFF_FPTR32MSB - -- : BFD_RELOC_IA64_LTOFF_FPTR32LSB - -- : BFD_RELOC_IA64_LTOFF_FPTR64MSB - -- : BFD_RELOC_IA64_LTOFF_FPTR64LSB - -- : BFD_RELOC_IA64_SEGREL32MSB - -- : BFD_RELOC_IA64_SEGREL32LSB - -- : BFD_RELOC_IA64_SEGREL64MSB - -- : BFD_RELOC_IA64_SEGREL64LSB - -- : BFD_RELOC_IA64_SECREL32MSB - -- : BFD_RELOC_IA64_SECREL32LSB - -- : BFD_RELOC_IA64_SECREL64MSB - -- : BFD_RELOC_IA64_SECREL64LSB - -- : BFD_RELOC_IA64_REL32MSB - -- : BFD_RELOC_IA64_REL32LSB - -- : BFD_RELOC_IA64_REL64MSB - -- : BFD_RELOC_IA64_REL64LSB - -- : BFD_RELOC_IA64_LTV32MSB - -- : BFD_RELOC_IA64_LTV32LSB - -- : BFD_RELOC_IA64_LTV64MSB - -- : BFD_RELOC_IA64_LTV64LSB - -- : BFD_RELOC_IA64_IPLTMSB - -- : BFD_RELOC_IA64_IPLTLSB - -- : BFD_RELOC_IA64_COPY - -- : BFD_RELOC_IA64_LTOFF22X - -- : BFD_RELOC_IA64_LDXMOV - -- : BFD_RELOC_IA64_TPREL14 - -- : BFD_RELOC_IA64_TPREL22 - -- : BFD_RELOC_IA64_TPREL64I - -- : BFD_RELOC_IA64_TPREL64MSB - -- : BFD_RELOC_IA64_TPREL64LSB - -- : BFD_RELOC_IA64_LTOFF_TPREL22 - -- : BFD_RELOC_IA64_DTPMOD64MSB - -- : BFD_RELOC_IA64_DTPMOD64LSB - -- : BFD_RELOC_IA64_LTOFF_DTPMOD22 - -- : BFD_RELOC_IA64_DTPREL14 - -- : BFD_RELOC_IA64_DTPREL22 - -- : BFD_RELOC_IA64_DTPREL64I - -- : BFD_RELOC_IA64_DTPREL32MSB - -- : BFD_RELOC_IA64_DTPREL32LSB - -- : BFD_RELOC_IA64_DTPREL64MSB - -- : BFD_RELOC_IA64_DTPREL64LSB - -- : BFD_RELOC_IA64_LTOFF_DTPREL22 - Intel IA64 Relocations. - - -- : BFD_RELOC_M68HC11_HI8 - Motorola 68HC11 reloc. This is the 8 bit high part of an absolute - address. - - -- : BFD_RELOC_M68HC11_LO8 - Motorola 68HC11 reloc. This is the 8 bit low part of an absolute - address. - - -- : BFD_RELOC_M68HC11_3B - Motorola 68HC11 reloc. This is the 3 bit of a value. - - -- : BFD_RELOC_M68HC11_RL_JUMP - Motorola 68HC11 reloc. This reloc marks the beginning of a - jump/call instruction. It is used for linker relaxation to - correctly identify beginning of instruction and change some - branches to use PC-relative addressing mode. - - -- : BFD_RELOC_M68HC11_RL_GROUP - Motorola 68HC11 reloc. This reloc marks a group of several - instructions that gcc generates and for which the linker - relaxation pass can modify and/or remove some of them. - - -- : BFD_RELOC_M68HC11_LO16 - Motorola 68HC11 reloc. This is the 16-bit lower part of an - address. It is used for 'call' instruction to specify the symbol - address without any special transformation (due to memory bank - window). - - -- : BFD_RELOC_M68HC11_PAGE - Motorola 68HC11 reloc. This is a 8-bit reloc that specifies the - page number of an address. It is used by 'call' instruction to - specify the page number of the symbol. - - -- : BFD_RELOC_M68HC11_24 - Motorola 68HC11 reloc. This is a 24-bit reloc that represents the - address with a 16-bit value and a 8-bit page number. The symbol - address is transformed to follow the 16K memory bank of 68HC12 - (seen as mapped in the window). - - -- : BFD_RELOC_M68HC12_5B - Motorola 68HC12 reloc. This is the 5 bits of a value. - - -- : BFD_RELOC_16C_NUM08 - -- : BFD_RELOC_16C_NUM08_C - -- : BFD_RELOC_16C_NUM16 - -- : BFD_RELOC_16C_NUM16_C - -- : BFD_RELOC_16C_NUM32 - -- : BFD_RELOC_16C_NUM32_C - -- : BFD_RELOC_16C_DISP04 - -- : BFD_RELOC_16C_DISP04_C - -- : BFD_RELOC_16C_DISP08 - -- : BFD_RELOC_16C_DISP08_C - -- : BFD_RELOC_16C_DISP16 - -- : BFD_RELOC_16C_DISP16_C - -- : BFD_RELOC_16C_DISP24 - -- : BFD_RELOC_16C_DISP24_C - -- : BFD_RELOC_16C_DISP24a - -- : BFD_RELOC_16C_DISP24a_C - -- : BFD_RELOC_16C_REG04 - -- : BFD_RELOC_16C_REG04_C - -- : BFD_RELOC_16C_REG04a - -- : BFD_RELOC_16C_REG04a_C - -- : BFD_RELOC_16C_REG14 - -- : BFD_RELOC_16C_REG14_C - -- : BFD_RELOC_16C_REG16 - -- : BFD_RELOC_16C_REG16_C - -- : BFD_RELOC_16C_REG20 - -- : BFD_RELOC_16C_REG20_C - -- : BFD_RELOC_16C_ABS20 - -- : BFD_RELOC_16C_ABS20_C - -- : BFD_RELOC_16C_ABS24 - -- : BFD_RELOC_16C_ABS24_C - -- : BFD_RELOC_16C_IMM04 - -- : BFD_RELOC_16C_IMM04_C - -- : BFD_RELOC_16C_IMM16 - -- : BFD_RELOC_16C_IMM16_C - -- : BFD_RELOC_16C_IMM20 - -- : BFD_RELOC_16C_IMM20_C - -- : BFD_RELOC_16C_IMM24 - -- : BFD_RELOC_16C_IMM24_C - -- : BFD_RELOC_16C_IMM32 - -- : BFD_RELOC_16C_IMM32_C - NS CR16C Relocations. - - -- : BFD_RELOC_CRX_REL4 - -- : BFD_RELOC_CRX_REL8 - -- : BFD_RELOC_CRX_REL8_CMP - -- : BFD_RELOC_CRX_REL16 - -- : BFD_RELOC_CRX_REL24 - -- : BFD_RELOC_CRX_REL32 - -- : BFD_RELOC_CRX_REGREL12 - -- : BFD_RELOC_CRX_REGREL22 - -- : BFD_RELOC_CRX_REGREL28 - -- : BFD_RELOC_CRX_REGREL32 - -- : BFD_RELOC_CRX_ABS16 - -- : BFD_RELOC_CRX_ABS32 - -- : BFD_RELOC_CRX_NUM8 - -- : BFD_RELOC_CRX_NUM16 - -- : BFD_RELOC_CRX_NUM32 - -- : BFD_RELOC_CRX_IMM16 - -- : BFD_RELOC_CRX_IMM32 - -- : BFD_RELOC_CRX_SWITCH8 - -- : BFD_RELOC_CRX_SWITCH16 - -- : BFD_RELOC_CRX_SWITCH32 - NS CRX Relocations. - - -- : BFD_RELOC_CRIS_BDISP8 - -- : BFD_RELOC_CRIS_UNSIGNED_5 - -- : BFD_RELOC_CRIS_SIGNED_6 - -- : BFD_RELOC_CRIS_UNSIGNED_6 - -- : BFD_RELOC_CRIS_SIGNED_8 - -- : BFD_RELOC_CRIS_UNSIGNED_8 - -- : BFD_RELOC_CRIS_SIGNED_16 - -- : BFD_RELOC_CRIS_UNSIGNED_16 - -- : BFD_RELOC_CRIS_LAPCQ_OFFSET - -- : BFD_RELOC_CRIS_UNSIGNED_4 - These relocs are only used within the CRIS assembler. They are not - (at present) written to any object files. - - -- : BFD_RELOC_CRIS_COPY - -- : BFD_RELOC_CRIS_GLOB_DAT - -- : BFD_RELOC_CRIS_JUMP_SLOT - -- : BFD_RELOC_CRIS_RELATIVE - Relocs used in ELF shared libraries for CRIS. - - -- : BFD_RELOC_CRIS_32_GOT - 32-bit offset to symbol-entry within GOT. - - -- : BFD_RELOC_CRIS_16_GOT - 16-bit offset to symbol-entry within GOT. - - -- : BFD_RELOC_CRIS_32_GOTPLT - 32-bit offset to symbol-entry within GOT, with PLT handling. - - -- : BFD_RELOC_CRIS_16_GOTPLT - 16-bit offset to symbol-entry within GOT, with PLT handling. - - -- : BFD_RELOC_CRIS_32_GOTREL - 32-bit offset to symbol, relative to GOT. - - -- : BFD_RELOC_CRIS_32_PLT_GOTREL - 32-bit offset to symbol with PLT entry, relative to GOT. - - -- : BFD_RELOC_CRIS_32_PLT_PCREL - 32-bit offset to symbol with PLT entry, relative to this - relocation. - - -- : BFD_RELOC_860_COPY - -- : BFD_RELOC_860_GLOB_DAT - -- : BFD_RELOC_860_JUMP_SLOT - -- : BFD_RELOC_860_RELATIVE - -- : BFD_RELOC_860_PC26 - -- : BFD_RELOC_860_PLT26 - -- : BFD_RELOC_860_PC16 - -- : BFD_RELOC_860_LOW0 - -- : BFD_RELOC_860_SPLIT0 - -- : BFD_RELOC_860_LOW1 - -- : BFD_RELOC_860_SPLIT1 - -- : BFD_RELOC_860_LOW2 - -- : BFD_RELOC_860_SPLIT2 - -- : BFD_RELOC_860_LOW3 - -- : BFD_RELOC_860_LOGOT0 - -- : BFD_RELOC_860_SPGOT0 - -- : BFD_RELOC_860_LOGOT1 - -- : BFD_RELOC_860_SPGOT1 - -- : BFD_RELOC_860_LOGOTOFF0 - -- : BFD_RELOC_860_SPGOTOFF0 - -- : BFD_RELOC_860_LOGOTOFF1 - -- : BFD_RELOC_860_SPGOTOFF1 - -- : BFD_RELOC_860_LOGOTOFF2 - -- : BFD_RELOC_860_LOGOTOFF3 - -- : BFD_RELOC_860_LOPC - -- : BFD_RELOC_860_HIGHADJ - -- : BFD_RELOC_860_HAGOT - -- : BFD_RELOC_860_HAGOTOFF - -- : BFD_RELOC_860_HAPC - -- : BFD_RELOC_860_HIGH - -- : BFD_RELOC_860_HIGOT - -- : BFD_RELOC_860_HIGOTOFF - Intel i860 Relocations. - - -- : BFD_RELOC_OPENRISC_ABS_26 - -- : BFD_RELOC_OPENRISC_REL_26 - OpenRISC Relocations. - - -- : BFD_RELOC_H8_DIR16A8 - -- : BFD_RELOC_H8_DIR16R8 - -- : BFD_RELOC_H8_DIR24A8 - -- : BFD_RELOC_H8_DIR24R8 - -- : BFD_RELOC_H8_DIR32A16 - H8 elf Relocations. - - -- : BFD_RELOC_XSTORMY16_REL_12 - -- : BFD_RELOC_XSTORMY16_12 - -- : BFD_RELOC_XSTORMY16_24 - -- : BFD_RELOC_XSTORMY16_FPTR16 - Sony Xstormy16 Relocations. - - -- : BFD_RELOC_XC16X_PAG - -- : BFD_RELOC_XC16X_POF - -- : BFD_RELOC_XC16X_SEG - -- : BFD_RELOC_XC16X_SOF - Infineon Relocations. - - -- : BFD_RELOC_VAX_GLOB_DAT - -- : BFD_RELOC_VAX_JMP_SLOT - -- : BFD_RELOC_VAX_RELATIVE - Relocations used by VAX ELF. - - -- : BFD_RELOC_MT_PC16 - Morpho MT - 16 bit immediate relocation. - - -- : BFD_RELOC_MT_HI16 - Morpho MT - Hi 16 bits of an address. - - -- : BFD_RELOC_MT_LO16 - Morpho MT - Low 16 bits of an address. - - -- : BFD_RELOC_MT_GNU_VTINHERIT - Morpho MT - Used to tell the linker which vtable entries are used. - - -- : BFD_RELOC_MT_GNU_VTENTRY - Morpho MT - Used to tell the linker which vtable entries are used. - - -- : BFD_RELOC_MT_PCINSN8 - Morpho MT - 8 bit immediate relocation. - - -- : BFD_RELOC_MSP430_10_PCREL - -- : BFD_RELOC_MSP430_16_PCREL - -- : BFD_RELOC_MSP430_16 - -- : BFD_RELOC_MSP430_16_PCREL_BYTE - -- : BFD_RELOC_MSP430_16_BYTE - -- : BFD_RELOC_MSP430_2X_PCREL - -- : BFD_RELOC_MSP430_RL_PCREL - msp430 specific relocation codes - - -- : BFD_RELOC_IQ2000_OFFSET_16 - -- : BFD_RELOC_IQ2000_OFFSET_21 - -- : BFD_RELOC_IQ2000_UHI16 - IQ2000 Relocations. - - -- : BFD_RELOC_XTENSA_RTLD - Special Xtensa relocation used only by PLT entries in ELF shared - objects to indicate that the runtime linker should set the value - to one of its own internal functions or data structures. - - -- : BFD_RELOC_XTENSA_GLOB_DAT - -- : BFD_RELOC_XTENSA_JMP_SLOT - -- : BFD_RELOC_XTENSA_RELATIVE - Xtensa relocations for ELF shared objects. - - -- : BFD_RELOC_XTENSA_PLT - Xtensa relocation used in ELF object files for symbols that may - require PLT entries. Otherwise, this is just a generic 32-bit - relocation. - - -- : BFD_RELOC_XTENSA_DIFF8 - -- : BFD_RELOC_XTENSA_DIFF16 - -- : BFD_RELOC_XTENSA_DIFF32 - Xtensa relocations to mark the difference of two local symbols. - These are only needed to support linker relaxation and can be - ignored when not relaxing. The field is set to the value of the - difference assuming no relaxation. The relocation encodes the - position of the first symbol so the linker can determine whether - to adjust the field value. - - -- : BFD_RELOC_XTENSA_SLOT0_OP - -- : BFD_RELOC_XTENSA_SLOT1_OP - -- : BFD_RELOC_XTENSA_SLOT2_OP - -- : BFD_RELOC_XTENSA_SLOT3_OP - -- : BFD_RELOC_XTENSA_SLOT4_OP - -- : BFD_RELOC_XTENSA_SLOT5_OP - -- : BFD_RELOC_XTENSA_SLOT6_OP - -- : BFD_RELOC_XTENSA_SLOT7_OP - -- : BFD_RELOC_XTENSA_SLOT8_OP - -- : BFD_RELOC_XTENSA_SLOT9_OP - -- : BFD_RELOC_XTENSA_SLOT10_OP - -- : BFD_RELOC_XTENSA_SLOT11_OP - -- : BFD_RELOC_XTENSA_SLOT12_OP - -- : BFD_RELOC_XTENSA_SLOT13_OP - -- : BFD_RELOC_XTENSA_SLOT14_OP - Generic Xtensa relocations for instruction operands. Only the slot - number is encoded in the relocation. The relocation applies to the - last PC-relative immediate operand, or if there are no PC-relative - immediates, to the last immediate operand. - - -- : BFD_RELOC_XTENSA_SLOT0_ALT - -- : BFD_RELOC_XTENSA_SLOT1_ALT - -- : BFD_RELOC_XTENSA_SLOT2_ALT - -- : BFD_RELOC_XTENSA_SLOT3_ALT - -- : BFD_RELOC_XTENSA_SLOT4_ALT - -- : BFD_RELOC_XTENSA_SLOT5_ALT - -- : BFD_RELOC_XTENSA_SLOT6_ALT - -- : BFD_RELOC_XTENSA_SLOT7_ALT - -- : BFD_RELOC_XTENSA_SLOT8_ALT - -- : BFD_RELOC_XTENSA_SLOT9_ALT - -- : BFD_RELOC_XTENSA_SLOT10_ALT - -- : BFD_RELOC_XTENSA_SLOT11_ALT - -- : BFD_RELOC_XTENSA_SLOT12_ALT - -- : BFD_RELOC_XTENSA_SLOT13_ALT - -- : BFD_RELOC_XTENSA_SLOT14_ALT - Alternate Xtensa relocations. Only the slot is encoded in the - relocation. The meaning of these relocations is opcode-specific. - - -- : BFD_RELOC_XTENSA_OP0 - -- : BFD_RELOC_XTENSA_OP1 - -- : BFD_RELOC_XTENSA_OP2 - Xtensa relocations for backward compatibility. These have all been - replaced by BFD_RELOC_XTENSA_SLOT0_OP. - - -- : BFD_RELOC_XTENSA_ASM_EXPAND - Xtensa relocation to mark that the assembler expanded the - instructions from an original target. The expansion size is - encoded in the reloc size. - - -- : BFD_RELOC_XTENSA_ASM_SIMPLIFY - Xtensa relocation to mark that the linker should simplify - assembler-expanded instructions. This is commonly used internally - by the linker after analysis of a BFD_RELOC_XTENSA_ASM_EXPAND. - - -- : BFD_RELOC_Z80_DISP8 - 8 bit signed offset in (ix+d) or (iy+d). - - -- : BFD_RELOC_Z8K_DISP7 - DJNZ offset. - - -- : BFD_RELOC_Z8K_CALLR - CALR offset. - - -- : BFD_RELOC_Z8K_IMM4L - 4 bit value. - - - typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; - -2.10.2.2 `bfd_reloc_type_lookup' -................................ - -*Synopsis* - reloc_howto_type *bfd_reloc_type_lookup - (bfd *abfd, bfd_reloc_code_real_type code); - *Description* -Return a pointer to a howto structure which, when invoked, will perform -the relocation CODE on data from the architecture noted. - -2.10.2.3 `bfd_default_reloc_type_lookup' -........................................ - -*Synopsis* - reloc_howto_type *bfd_default_reloc_type_lookup - (bfd *abfd, bfd_reloc_code_real_type code); - *Description* -Provides a default relocation lookup routine for any architecture. - -2.10.2.4 `bfd_get_reloc_code_name' -.................................. - -*Synopsis* - const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code); - *Description* -Provides a printable name for the supplied relocation code. Useful -mainly for printing error messages. - -2.10.2.5 `bfd_generic_relax_section' -.................................... - -*Synopsis* - bfd_boolean bfd_generic_relax_section - (bfd *abfd, - asection *section, - struct bfd_link_info *, - bfd_boolean *); - *Description* -Provides default handling for relaxing for back ends which don't do -relaxing. - -2.10.2.6 `bfd_generic_gc_sections' -.................................. - -*Synopsis* - bfd_boolean bfd_generic_gc_sections - (bfd *, struct bfd_link_info *); - *Description* -Provides default handling for relaxing for back ends which don't do -section gc - i.e., does nothing. - -2.10.2.7 `bfd_generic_merge_sections' -..................................... - -*Synopsis* - bfd_boolean bfd_generic_merge_sections - (bfd *, struct bfd_link_info *); - *Description* -Provides default handling for SEC_MERGE section merging for back ends -which don't have SEC_MERGE support - i.e., does nothing. - -2.10.2.8 `bfd_generic_get_relocated_section_contents' -..................................................... - -*Synopsis* - bfd_byte *bfd_generic_get_relocated_section_contents - (bfd *abfd, - struct bfd_link_info *link_info, - struct bfd_link_order *link_order, - bfd_byte *data, - bfd_boolean relocatable, - asymbol **symbols); - *Description* -Provides default handling of relocation effort for back ends which -can't be bothered to do it efficiently. - - -File: bfd.info, Node: Core Files, Next: Targets, Prev: Relocations, Up: BFD front end - -2.11 Core files -=============== - -2.11.1 Core file functions --------------------------- - -*Description* -These are functions pertaining to core files. - -2.11.1.1 `bfd_core_file_failing_command' -........................................ - -*Synopsis* - const char *bfd_core_file_failing_command (bfd *abfd); - *Description* -Return a read-only string explaining which program was running when it -failed and produced the core file ABFD. - -2.11.1.2 `bfd_core_file_failing_signal' -....................................... - -*Synopsis* - int bfd_core_file_failing_signal (bfd *abfd); - *Description* -Returns the signal number which caused the core dump which generated -the file the BFD ABFD is attached to. - -2.11.1.3 `core_file_matches_executable_p' -......................................... - -*Synopsis* - bfd_boolean core_file_matches_executable_p - (bfd *core_bfd, bfd *exec_bfd); - *Description* -Return `TRUE' if the core file attached to CORE_BFD was generated by a -run of the executable file attached to EXEC_BFD, `FALSE' otherwise. - -2.11.1.4 `generic_core_file_matches_executable_p' -................................................. - -*Synopsis* - bfd_boolean generic_core_file_matches_executable_p - (bfd *core_bfd, bfd *exec_bfd); - *Description* -Return TRUE if the core file attached to CORE_BFD was generated by a -run of the executable file attached to EXEC_BFD. The match is based on -executable basenames only. - - Note: When not able to determine the core file failing command or -the executable name, we still return TRUE even though we're not sure -that core file and executable match. This is to avoid generating a -false warning in situations where we really don't know whether they -match or not. - - -File: bfd.info, Node: Targets, Next: Architectures, Prev: Core Files, Up: BFD front end - -2.12 Targets -============ - -*Description* -Each port of BFD to a different machine requires the creation of a -target back end. All the back end provides to the root part of BFD is a -structure containing pointers to functions which perform certain low -level operations on files. BFD translates the applications's requests -through a pointer into calls to the back end routines. - - When a file is opened with `bfd_openr', its format and target are -unknown. BFD uses various mechanisms to determine how to interpret the -file. The operations performed are: - - * Create a BFD by calling the internal routine `_bfd_new_bfd', then - call `bfd_find_target' with the target string supplied to - `bfd_openr' and the new BFD pointer. - - * If a null target string was provided to `bfd_find_target', look up - the environment variable `GNUTARGET' and use that as the target - string. - - * If the target string is still `NULL', or the target string is - `default', then use the first item in the target vector as the - target type, and set `target_defaulted' in the BFD to cause - `bfd_check_format' to loop through all the targets. *Note - bfd_target::. *Note Formats::. - - * Otherwise, inspect the elements in the target vector one by one, - until a match on target name is found. When found, use it. - - * Otherwise return the error `bfd_error_invalid_target' to - `bfd_openr'. - - * `bfd_openr' attempts to open the file using `bfd_open_file', and - returns the BFD. - Once the BFD has been opened and the target selected, the file -format may be determined. This is done by calling `bfd_check_format' on -the BFD with a suggested format. If `target_defaulted' has been set, -each possible target type is tried to see if it recognizes the -specified format. `bfd_check_format' returns `TRUE' when the caller -guesses right. - -* Menu: - -* bfd_target:: - - -File: bfd.info, Node: bfd_target, Prev: Targets, Up: Targets - -2.12.1 bfd_target ------------------ - -*Description* -This structure contains everything that BFD knows about a target. It -includes things like its byte order, name, and which routines to call -to do various operations. - - Every BFD points to a target structure with its `xvec' member. - - The macros below are used to dispatch to functions through the -`bfd_target' vector. They are used in a number of macros further down -in `bfd.h', and are also used when calling various routines by hand -inside the BFD implementation. The ARGLIST argument must be -parenthesized; it contains all the arguments to the called function. - - They make the documentation (more) unpleasant to read, so if someone -wants to fix this and not break the above, please do. - #define BFD_SEND(bfd, message, arglist) \ - ((*((bfd)->xvec->message)) arglist) - - #ifdef DEBUG_BFD_SEND - #undef BFD_SEND - #define BFD_SEND(bfd, message, arglist) \ - (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ - ((*((bfd)->xvec->message)) arglist) : \ - (bfd_assert (__FILE__,__LINE__), NULL)) - #endif - For operations which index on the BFD format: - #define BFD_SEND_FMT(bfd, message, arglist) \ - (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) - - #ifdef DEBUG_BFD_SEND - #undef BFD_SEND_FMT - #define BFD_SEND_FMT(bfd, message, arglist) \ - (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ - (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \ - (bfd_assert (__FILE__,__LINE__), NULL)) - #endif - This is the structure which defines the type of BFD this is. The -`xvec' member of the struct `bfd' itself points here. Each module that -implements access to a different target under BFD, defines one of these. - - FIXME, these names should be rationalised with the names of the -entry points which call them. Too bad we can't have one macro to define -them both! - enum bfd_flavour - { - bfd_target_unknown_flavour, - bfd_target_aout_flavour, - bfd_target_coff_flavour, - bfd_target_ecoff_flavour, - bfd_target_xcoff_flavour, - bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, - bfd_target_tekhex_flavour, - bfd_target_srec_flavour, - bfd_target_ihex_flavour, - bfd_target_som_flavour, - bfd_target_os9k_flavour, - bfd_target_versados_flavour, - bfd_target_msdos_flavour, - bfd_target_ovax_flavour, - bfd_target_evax_flavour, - bfd_target_mmo_flavour, - bfd_target_mach_o_flavour, - bfd_target_pef_flavour, - bfd_target_pef_xlib_flavour, - bfd_target_sym_flavour - }; - - enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN }; - - /* Forward declaration. */ - typedef struct bfd_link_info _bfd_link_info; - - typedef struct bfd_target - { - /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; - - /* The "flavour" of a back end is a general indication about - the contents of a file. */ - enum bfd_flavour flavour; - - /* The order of bytes within the data area of a file. */ - enum bfd_endian byteorder; - - /* The order of bytes within the header parts of a file. */ - enum bfd_endian header_byteorder; - - /* A mask of all the flags which an executable may have set - - from the set `BFD_NO_FLAGS', `HAS_RELOC', ...`D_PAGED'. */ - flagword object_flags; - - /* A mask of all the flags which a section may have set - from - the set `SEC_NO_FLAGS', `SEC_ALLOC', ...`SET_NEVER_LOAD'. */ - flagword section_flags; - - /* The character normally found at the front of a symbol. - (if any), perhaps `_'. */ - char symbol_leading_char; - - /* The pad character for file names within an archive header. */ - char ar_pad_char; - - /* The maximum number of characters in an archive header. */ - unsigned short ar_max_namelen; - - /* Entries for byte swapping for data. These are different from the - other entry points, since they don't take a BFD as the first argument. - Certain other handlers could do the same. */ - bfd_uint64_t (*bfd_getx64) (const void *); - bfd_int64_t (*bfd_getx_signed_64) (const void *); - void (*bfd_putx64) (bfd_uint64_t, void *); - bfd_vma (*bfd_getx32) (const void *); - bfd_signed_vma (*bfd_getx_signed_32) (const void *); - void (*bfd_putx32) (bfd_vma, void *); - bfd_vma (*bfd_getx16) (const void *); - bfd_signed_vma (*bfd_getx_signed_16) (const void *); - void (*bfd_putx16) (bfd_vma, void *); - - /* Byte swapping for the headers. */ - bfd_uint64_t (*bfd_h_getx64) (const void *); - bfd_int64_t (*bfd_h_getx_signed_64) (const void *); - void (*bfd_h_putx64) (bfd_uint64_t, void *); - bfd_vma (*bfd_h_getx32) (const void *); - bfd_signed_vma (*bfd_h_getx_signed_32) (const void *); - void (*bfd_h_putx32) (bfd_vma, void *); - bfd_vma (*bfd_h_getx16) (const void *); - bfd_signed_vma (*bfd_h_getx_signed_16) (const void *); - void (*bfd_h_putx16) (bfd_vma, void *); - - /* Format dependent routines: these are vectors of entry points - within the target vector structure, one for each format to check. */ - - /* Check the format of a file being read. Return a `bfd_target *' or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); - - /* Set the format of a file being written. */ - bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); - - /* Write cached information into a file being written, at `bfd_close'. */ - bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *); - The general target vector. These vectors are initialized using the -BFD_JUMP_TABLE macros. - - /* Generic entry points. */ - #define BFD_JUMP_TABLE_GENERIC(NAME) \ - NAME##_close_and_cleanup, \ - NAME##_bfd_free_cached_info, \ - NAME##_new_section_hook, \ - NAME##_get_section_contents, \ - NAME##_get_section_contents_in_window - - /* Called when the BFD is being closed to do any necessary cleanup. */ - bfd_boolean (*_close_and_cleanup) (bfd *); - /* Ask the BFD to free all cached information. */ - bfd_boolean (*_bfd_free_cached_info) (bfd *); - /* Called when a new section is created. */ - bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); - /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); - - /* Entry points to copy private data. */ - #define BFD_JUMP_TABLE_COPY(NAME) \ - NAME##_bfd_copy_private_bfd_data, \ - NAME##_bfd_merge_private_bfd_data, \ - _bfd_generic_init_private_section_data, \ - NAME##_bfd_copy_private_section_data, \ - NAME##_bfd_copy_private_symbol_data, \ - NAME##_bfd_copy_private_header_data, \ - NAME##_bfd_set_private_flags, \ - NAME##_bfd_print_private_bfd_data - - /* Called to copy BFD general private data from one object file - to another. */ - bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); - /* Called to merge BFD general private data from one object file - to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); - /* Called to initialize BFD private section data from one object file - to another. */ - #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); - /* Called to copy BFD private section data from one object file - to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); - /* Called to copy BFD private symbol data from one symbol - to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); - /* Called to copy BFD private header data from one object file - to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); - /* Called to set private backend flags. */ - bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); - - /* Called to print private BFD data. */ - bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *); - - /* Core file entry points. */ - #define BFD_JUMP_TABLE_CORE(NAME) \ - NAME##_core_file_failing_command, \ - NAME##_core_file_failing_signal, \ - NAME##_core_file_matches_executable_p - - char * (*_core_file_failing_command) (bfd *); - int (*_core_file_failing_signal) (bfd *); - bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *); - - /* Archive entry points. */ - #define BFD_JUMP_TABLE_ARCHIVE(NAME) \ - NAME##_slurp_armap, \ - NAME##_slurp_extended_name_table, \ - NAME##_construct_extended_name_table, \ - NAME##_truncate_arname, \ - NAME##_write_armap, \ - NAME##_read_ar_hdr, \ - NAME##_openr_next_archived_file, \ - NAME##_get_elt_at_index, \ - NAME##_generic_stat_arch_elt, \ - NAME##_update_armap_timestamp - - bfd_boolean (*_bfd_slurp_armap) (bfd *); - bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); - void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); - void * (*_bfd_read_ar_hdr_fn) (bfd *); - bfd * (*openr_next_archived_file) (bfd *, bfd *); - #define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) - bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); - int (*_bfd_stat_arch_elt) (bfd *, struct stat *); - bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); - - /* Entry points used for symbols. */ - #define BFD_JUMP_TABLE_SYMBOLS(NAME) \ - NAME##_get_symtab_upper_bound, \ - NAME##_canonicalize_symtab, \ - NAME##_make_empty_symbol, \ - NAME##_print_symbol, \ - NAME##_get_symbol_info, \ - NAME##_bfd_is_local_label_name, \ - NAME##_bfd_is_target_special_symbol, \ - NAME##_get_lineno, \ - NAME##_find_nearest_line, \ - _bfd_generic_find_line, \ - NAME##_find_inliner_info, \ - NAME##_bfd_make_debug_symbol, \ - NAME##_read_minisymbols, \ - NAME##_minisymbol_to_symbol - - long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); - struct bfd_symbol * - (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); - #define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); - #define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) - bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); - bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); - alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); - bfd_boolean (*_bfd_find_inliner_info) - (bfd *, const char **, const char **, unsigned int *); - /* Back-door to allow format-aware applications to create debug symbols - while using BFD for everything else. Currently used by the assembler - when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); - #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); - #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); - - /* Routines for relocs. */ - #define BFD_JUMP_TABLE_RELOCS(NAME) \ - NAME##_get_reloc_upper_bound, \ - NAME##_canonicalize_reloc, \ - NAME##_bfd_reloc_type_lookup - - long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); - /* See documentation on reloc types. */ - reloc_howto_type * - (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); - - /* Routines used when writing an object file. */ - #define BFD_JUMP_TABLE_WRITE(NAME) \ - NAME##_set_arch_mach, \ - NAME##_set_section_contents - - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); - - /* Routines used by the linker. */ - #define BFD_JUMP_TABLE_LINK(NAME) \ - NAME##_sizeof_headers, \ - NAME##_bfd_get_relocated_section_contents, \ - NAME##_bfd_relax_section, \ - NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ - NAME##_bfd_link_add_symbols, \ - NAME##_bfd_link_just_syms, \ - NAME##_bfd_final_link, \ - NAME##_bfd_link_split_section, \ - NAME##_bfd_gc_sections, \ - NAME##_bfd_merge_sections, \ - NAME##_bfd_is_group_section, \ - NAME##_bfd_discard_group, \ - NAME##_section_already_linked \ - - int (*_bfd_sizeof_headers) (bfd *, bfd_boolean); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); - - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); - - /* Create a hash table for the linker. Different backends store - different information in this table. */ - struct bfd_link_hash_table * - (*_bfd_link_hash_table_create) (bfd *); - - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - - /* Add symbols from this object file into the hash table. */ - bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); - - /* Indicate that we are only retrieving symbol values from this section. */ - void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - - /* Do a link based on the link_order structures attached to each - section of the BFD. */ - bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *); - - /* Should this section be split up into smaller pieces during linking. */ - bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); - - /* Remove sections that are not referenced from the output. */ - bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); - - /* Attempt to merge SEC_MERGE sections. */ - bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); - - /* Is this section a member of a group? */ - bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); - - /* Discard members of a group. */ - bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); - - /* Check if SEC has been already linked during a reloceatable or - final link. */ - void (*_section_already_linked) (bfd *, struct bfd_section *); - - /* Routines to handle dynamic symbols and relocs. */ - #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ - NAME##_get_dynamic_symtab_upper_bound, \ - NAME##_canonicalize_dynamic_symtab, \ - NAME##_get_synthetic_symtab, \ - NAME##_get_dynamic_reloc_upper_bound, \ - NAME##_canonicalize_dynamic_reloc - - /* Get the amount of memory required to hold the dynamic symbols. */ - long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); - /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); - /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); - /* Get the amount of memory required to hold the dynamic relocs. */ - long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); - /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); - A pointer to an alternative bfd_target in case the current one is not -satisfactory. This can happen when the target cpu supports both big -and little endian code, and target chosen by the linker has the wrong -endianness. The function open_output() in ld/ldlang.c uses this field -to find an alternative output format that is suitable. - /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; - - /* Data for use by back-end routines, which isn't - generic enough to belong in this structure. */ - const void *backend_data; - - } bfd_target; - -2.12.1.1 `bfd_set_default_target' -................................. - -*Synopsis* - bfd_boolean bfd_set_default_target (const char *name); - *Description* -Set the default target vector to use when recognizing a BFD. This -takes the name of the target, which may be a BFD target name or a -configuration triplet. - -2.12.1.2 `bfd_find_target' -.......................... - -*Synopsis* - const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); - *Description* -Return a pointer to the transfer vector for the object target named -TARGET_NAME. If TARGET_NAME is `NULL', choose the one in the -environment variable `GNUTARGET'; if that is null or not defined, then -choose the first entry in the target list. Passing in the string -"default" or setting the environment variable to "default" will cause -the first entry in the target list to be returned, and -"target_defaulted" will be set in the BFD. This causes -`bfd_check_format' to loop over all the targets to find the one that -matches the file being read. - -2.12.1.3 `bfd_target_list' -.......................... - -*Synopsis* - const char ** bfd_target_list (void); - *Description* -Return a freshly malloced NULL-terminated vector of the names of all -the valid BFD targets. Do not modify the names. - -2.12.1.4 `bfd_seach_for_target' -............................... - -*Synopsis* - const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); - *Description* -Return a pointer to the first transfer vector in the list of transfer -vectors maintained by BFD that produces a non-zero result when passed -to the function SEARCH_FUNC. The parameter DATA is passed, unexamined, -to the search function. - - -File: bfd.info, Node: Architectures, Next: Opening and Closing, Prev: Targets, Up: BFD front end - -2.13 Architectures -================== - -BFD keeps one atom in a BFD describing the architecture of the data -attached to the BFD: a pointer to a `bfd_arch_info_type'. - - Pointers to structures can be requested independently of a BFD so -that an architecture's information can be interrogated without access -to an open BFD. - - The architecture information is provided by each architecture -package. The set of default architectures is selected by the macro -`SELECT_ARCHITECTURES'. This is normally set up in the -`config/TARGET.mt' file of your choice. If the name is not defined, -then all the architectures supported are included. - - When BFD starts up, all the architectures are called with an -initialize method. It is up to the architecture back end to insert as -many items into the list of architectures as it wants to; generally -this would be one for each machine and one for the default case (an -item with a machine field of 0). - - BFD's idea of an architecture is implemented in `archures.c'. - -2.13.1 bfd_architecture ------------------------ - -*Description* -This enum gives the object file's CPU architecture, in a global -sense--i.e., what processor family does it belong to? Another field -indicates which processor within the family is in use. The machine -gives a number which distinguishes different versions of the -architecture, containing, for example, 2 and 3 for Intel i960 KA and -i960 KB, and 68020 and 68030 for Motorola 68020 and 68030. - enum bfd_architecture - { - bfd_arch_unknown, /* File arch not known. */ - bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ - #define bfd_mach_m68000 1 - #define bfd_mach_m68008 2 - #define bfd_mach_m68010 3 - #define bfd_mach_m68020 4 - #define bfd_mach_m68030 5 - #define bfd_mach_m68040 6 - #define bfd_mach_m68060 7 - #define bfd_mach_cpu32 8 - #define bfd_mach_mcf_isa_a_nodiv 9 - #define bfd_mach_mcf_isa_a 10 - #define bfd_mach_mcf_isa_a_mac 11 - #define bfd_mach_mcf_isa_a_emac 12 - #define bfd_mach_mcf_isa_aplus 13 - #define bfd_mach_mcf_isa_aplus_mac 14 - #define bfd_mach_mcf_isa_aplus_emac 15 - #define bfd_mach_mcf_isa_b_nousp 16 - #define bfd_mach_mcf_isa_b_nousp_mac 17 - #define bfd_mach_mcf_isa_b_nousp_emac 18 - #define bfd_mach_mcf_isa_b 19 - #define bfd_mach_mcf_isa_b_mac 20 - #define bfd_mach_mcf_isa_b_emac 21 - #define bfd_mach_mcf_isa_b_float 22 - #define bfd_mach_mcf_isa_b_float_mac 23 - #define bfd_mach_mcf_isa_b_float_emac 24 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ - - #define bfd_mach_i960_core 1 - #define bfd_mach_i960_ka_sa 2 - #define bfd_mach_i960_kb_sb 3 - #define bfd_mach_i960_mc 4 - #define bfd_mach_i960_xa 5 - #define bfd_mach_i960_ca 6 - #define bfd_mach_i960_jx 7 - #define bfd_mach_i960_hx 8 - - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ - #define bfd_mach_sparc 1 - /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ - #define bfd_mach_sparc_sparclet 2 - #define bfd_mach_sparc_sparclite 3 - #define bfd_mach_sparc_v8plus 4 - #define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */ - #define bfd_mach_sparc_sparclite_le 6 - #define bfd_mach_sparc_v9 7 - #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ - #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ - #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ - /* Nonzero if MACH has the v9 instruction set. */ - #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ - && (mach) != bfd_mach_sparc_sparclite_le) - /* Nonzero if MACH is a 64 bit sparc architecture. */ - #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_mips, /* MIPS Rxxxx */ - #define bfd_mach_mips3000 3000 - #define bfd_mach_mips3900 3900 - #define bfd_mach_mips4000 4000 - #define bfd_mach_mips4010 4010 - #define bfd_mach_mips4100 4100 - #define bfd_mach_mips4111 4111 - #define bfd_mach_mips4120 4120 - #define bfd_mach_mips4300 4300 - #define bfd_mach_mips4400 4400 - #define bfd_mach_mips4600 4600 - #define bfd_mach_mips4650 4650 - #define bfd_mach_mips5000 5000 - #define bfd_mach_mips5400 5400 - #define bfd_mach_mips5500 5500 - #define bfd_mach_mips6000 6000 - #define bfd_mach_mips7000 7000 - #define bfd_mach_mips8000 8000 - #define bfd_mach_mips9000 9000 - #define bfd_mach_mips10000 10000 - #define bfd_mach_mips12000 12000 - #define bfd_mach_mips16 16 - #define bfd_mach_mips5 5 - #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ - #define bfd_mach_mipsisa32 32 - #define bfd_mach_mipsisa32r2 33 - #define bfd_mach_mipsisa64 64 - #define bfd_mach_mipsisa64r2 65 - bfd_arch_i386, /* Intel 386 */ - #define bfd_mach_i386_i386 1 - #define bfd_mach_i386_i8086 2 - #define bfd_mach_i386_i386_intel_syntax 3 - #define bfd_mach_x86_64 64 - #define bfd_mach_x86_64_intel_syntax 65 - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ - #define bfd_mach_h8300 1 - #define bfd_mach_h8300h 2 - #define bfd_mach_h8300s 3 - #define bfd_mach_h8300hn 4 - #define bfd_mach_h8300sn 5 - #define bfd_mach_h8300sx 6 - #define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ - bfd_arch_powerpc, /* PowerPC */ - #define bfd_mach_ppc 32 - #define bfd_mach_ppc64 64 - #define bfd_mach_ppc_403 403 - #define bfd_mach_ppc_403gc 4030 - #define bfd_mach_ppc_505 505 - #define bfd_mach_ppc_601 601 - #define bfd_mach_ppc_602 602 - #define bfd_mach_ppc_603 603 - #define bfd_mach_ppc_ec603e 6031 - #define bfd_mach_ppc_604 604 - #define bfd_mach_ppc_620 620 - #define bfd_mach_ppc_630 630 - #define bfd_mach_ppc_750 750 - #define bfd_mach_ppc_860 860 - #define bfd_mach_ppc_a35 35 - #define bfd_mach_ppc_rs64ii 642 - #define bfd_mach_ppc_rs64iii 643 - #define bfd_mach_ppc_7400 7400 - #define bfd_mach_ppc_e500 500 - bfd_arch_rs6000, /* IBM RS/6000 */ - #define bfd_mach_rs6k 6000 - #define bfd_mach_rs6k_rs1 6001 - #define bfd_mach_rs6k_rsc 6003 - #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ - #define bfd_mach_hppa10 10 - #define bfd_mach_hppa11 11 - #define bfd_mach_hppa20 20 - #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ - #define bfd_mach_d10v 1 - #define bfd_mach_d10v_ts2 2 - #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ - #define bfd_mach_m6812_default 0 - #define bfd_mach_m6812 1 - #define bfd_mach_m6812s 2 - bfd_arch_z8k, /* Zilog Z8000 */ - #define bfd_mach_z8001 1 - #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ - #define bfd_mach_sh 1 - #define bfd_mach_sh2 0x20 - #define bfd_mach_sh_dsp 0x2d - #define bfd_mach_sh2a 0x2a - #define bfd_mach_sh2a_nofpu 0x2b - #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 - #define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 - #define bfd_mach_sh2a_or_sh4 0x2a3 - #define bfd_mach_sh2a_or_sh3e 0x2a4 - #define bfd_mach_sh2e 0x2e - #define bfd_mach_sh3 0x30 - #define bfd_mach_sh3_nommu 0x31 - #define bfd_mach_sh3_dsp 0x3d - #define bfd_mach_sh3e 0x3e - #define bfd_mach_sh4 0x40 - #define bfd_mach_sh4_nofpu 0x41 - #define bfd_mach_sh4_nommu_nofpu 0x42 - #define bfd_mach_sh4a 0x4a - #define bfd_mach_sh4a_nofpu 0x4b - #define bfd_mach_sh4al_dsp 0x4d - #define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ - #define bfd_mach_alpha_ev4 0x10 - #define bfd_mach_alpha_ev5 0x20 - #define bfd_mach_alpha_ev6 0x30 - bfd_arch_arm, /* Advanced Risc Machines ARM. */ - #define bfd_mach_arm_unknown 0 - #define bfd_mach_arm_2 1 - #define bfd_mach_arm_2a 2 - #define bfd_mach_arm_3 3 - #define bfd_mach_arm_3M 4 - #define bfd_mach_arm_4 5 - #define bfd_mach_arm_4T 6 - #define bfd_mach_arm_5 7 - #define bfd_mach_arm_5T 8 - #define bfd_mach_arm_5TE 9 - #define bfd_mach_arm_XScale 10 - #define bfd_mach_arm_ep9312 11 - #define bfd_mach_arm_iWMMXt 12 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ - #define bfd_mach_tic3x 30 - #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ - #define bfd_mach_v850 1 - #define bfd_mach_v850e 'E' - #define bfd_mach_v850e1 '1' - bfd_arch_arc, /* ARC Cores */ - #define bfd_mach_arc_5 5 - #define bfd_mach_arc_6 6 - #define bfd_mach_arc_7 7 - #define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ - #define bfd_mach_m16c 0x75 - #define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ - #define bfd_mach_m32r 1 /* For backwards compatibility. */ - #define bfd_mach_m32rx 'x' - #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ - #define bfd_mach_mn10300 300 - #define bfd_mach_am33 330 - #define bfd_mach_am33_2 332 - bfd_arch_fr30, - #define bfd_mach_fr30 0x46523330 - bfd_arch_frv, - #define bfd_mach_frv 1 - #define bfd_mach_frvsimple 2 - #define bfd_mach_fr300 300 - #define bfd_mach_fr400 400 - #define bfd_mach_fr450 450 - #define bfd_mach_frvtomcat 499 /* fr500 prototype */ - #define bfd_mach_fr500 500 - #define bfd_mach_fr550 550 - bfd_arch_mcore, - bfd_arch_ia64, /* HP/Intel ia64 */ - #define bfd_mach_ia64_elf64 64 - #define bfd_mach_ia64_elf32 32 - bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ - #define bfd_mach_ip2022 1 - #define bfd_mach_ip2022ext 2 - bfd_arch_iq2000, /* Vitesse IQ2000. */ - #define bfd_mach_iq2000 1 - #define bfd_mach_iq10 2 - bfd_arch_mt, - #define bfd_mach_ms1 1 - #define bfd_mach_mrisc2 2 - #define bfd_mach_ms2 3 - bfd_arch_pj, - bfd_arch_avr, /* Atmel AVR microcontrollers. */ - #define bfd_mach_avr1 1 - #define bfd_mach_avr2 2 - #define bfd_mach_avr3 3 - #define bfd_mach_avr4 4 - #define bfd_mach_avr5 5 - bfd_arch_bfin, /* ADI Blackfin */ - #define bfd_mach_bfin 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ - #define bfd_mach_cr16c 1 - bfd_arch_crx, /* National Semiconductor CRX. */ - #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ - #define bfd_mach_cris_v0_v10 255 - #define bfd_mach_cris_v32 32 - #define bfd_mach_cris_v10_v32 1032 - bfd_arch_s390, /* IBM s390 */ - #define bfd_mach_s390_31 31 - #define bfd_mach_s390_64 64 - bfd_arch_openrisc, /* OpenRISC */ - bfd_arch_mmix, /* Donald Knuth's educational processor. */ - bfd_arch_xstormy16, - #define bfd_mach_xstormy16 1 - bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ - #define bfd_mach_msp11 11 - #define bfd_mach_msp110 110 - #define bfd_mach_msp12 12 - #define bfd_mach_msp13 13 - #define bfd_mach_msp14 14 - #define bfd_mach_msp15 15 - #define bfd_mach_msp16 16 - #define bfd_mach_msp21 21 - #define bfd_mach_msp31 31 - #define bfd_mach_msp32 32 - #define bfd_mach_msp33 33 - #define bfd_mach_msp41 41 - #define bfd_mach_msp42 42 - #define bfd_mach_msp43 43 - #define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ - #define bfd_mach_xc16x 1 - #define bfd_mach_xc16xl 2 - #define bfd_mach_xc16xs 3 - bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ - #define bfd_mach_xtensa 1 - bfd_arch_maxq, /* Dallas MAXQ 10/20 */ - #define bfd_mach_maxq10 10 - #define bfd_mach_maxq20 20 - bfd_arch_z80, - #define bfd_mach_z80strict 1 /* No undocumented opcodes. */ - #define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ - #define bfd_mach_z80full 7 /* All undocumented instructions. */ - #define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_last - }; - -2.13.2 bfd_arch_info --------------------- - -*Description* -This structure contains information on architectures for use within BFD. - - typedef struct bfd_arch_info - { - int bits_per_word; - int bits_per_address; - int bits_per_byte; - enum bfd_architecture arch; - unsigned long mach; - const char *arch_name; - const char *printable_name; - unsigned int section_align_power; - /* TRUE if this is the default machine for the architecture. - The default arch should be the first entry for an arch so that - all the entries for that arch can be accessed via `next'. */ - bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); - - bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); - - const struct bfd_arch_info *next; - } - bfd_arch_info_type; - -2.13.2.1 `bfd_printable_name' -............................. - -*Synopsis* - const char *bfd_printable_name (bfd *abfd); - *Description* -Return a printable string representing the architecture and machine -from the pointer to the architecture info structure. - -2.13.2.2 `bfd_scan_arch' -........................ - -*Synopsis* - const bfd_arch_info_type *bfd_scan_arch (const char *string); - *Description* -Figure out if BFD supports any cpu which could be described with the -name STRING. Return a pointer to an `arch_info' structure if a machine -is found, otherwise NULL. - -2.13.2.3 `bfd_arch_list' -........................ - -*Synopsis* - const char **bfd_arch_list (void); - *Description* -Return a freshly malloced NULL-terminated vector of the names of all -the valid BFD architectures. Do not modify the names. - -2.13.2.4 `bfd_arch_get_compatible' -.................................. - -*Synopsis* - const bfd_arch_info_type *bfd_arch_get_compatible - (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns); - *Description* -Determine whether two BFDs' architectures and machine types are -compatible. Calculates the lowest common denominator between the two -architectures and machine types implied by the BFDs and returns a -pointer to an `arch_info' structure describing the compatible machine. - -2.13.2.5 `bfd_default_arch_struct' -.................................. - -*Description* -The `bfd_default_arch_struct' is an item of `bfd_arch_info_type' which -has been initialized to a fairly generic state. A BFD starts life by -pointing to this structure, until the correct back end has determined -the real architecture of the file. - extern const bfd_arch_info_type bfd_default_arch_struct; - -2.13.2.6 `bfd_set_arch_info' -............................ - -*Synopsis* - void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); - *Description* -Set the architecture info of ABFD to ARG. - -2.13.2.7 `bfd_default_set_arch_mach' -.................................... - -*Synopsis* - bfd_boolean bfd_default_set_arch_mach - (bfd *abfd, enum bfd_architecture arch, unsigned long mach); - *Description* -Set the architecture and machine type in BFD ABFD to ARCH and MACH. -Find the correct pointer to a structure and insert it into the -`arch_info' pointer. - -2.13.2.8 `bfd_get_arch' -....................... - -*Synopsis* - enum bfd_architecture bfd_get_arch (bfd *abfd); - *Description* -Return the enumerated type which describes the BFD ABFD's architecture. - -2.13.2.9 `bfd_get_mach' -....................... - -*Synopsis* - unsigned long bfd_get_mach (bfd *abfd); - *Description* -Return the long type which describes the BFD ABFD's machine. - -2.13.2.10 `bfd_arch_bits_per_byte' -.................................. - -*Synopsis* - unsigned int bfd_arch_bits_per_byte (bfd *abfd); - *Description* -Return the number of bits in one of the BFD ABFD's architecture's bytes. - -2.13.2.11 `bfd_arch_bits_per_address' -..................................... - -*Synopsis* - unsigned int bfd_arch_bits_per_address (bfd *abfd); - *Description* -Return the number of bits in one of the BFD ABFD's architecture's -addresses. - -2.13.2.12 `bfd_default_compatible' -.................................. - -*Synopsis* - const bfd_arch_info_type *bfd_default_compatible - (const bfd_arch_info_type *a, const bfd_arch_info_type *b); - *Description* -The default function for testing for compatibility. - -2.13.2.13 `bfd_default_scan' -............................ - -*Synopsis* - bfd_boolean bfd_default_scan - (const struct bfd_arch_info *info, const char *string); - *Description* -The default function for working out whether this is an architecture -hit and a machine hit. - -2.13.2.14 `bfd_get_arch_info' -............................. - -*Synopsis* - const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); - *Description* -Return the architecture info struct in ABFD. - -2.13.2.15 `bfd_lookup_arch' -........................... - -*Synopsis* - const bfd_arch_info_type *bfd_lookup_arch - (enum bfd_architecture arch, unsigned long machine); - *Description* -Look for the architecture info structure which matches the arguments -ARCH and MACHINE. A machine of 0 matches the machine/architecture -structure which marks itself as the default. - -2.13.2.16 `bfd_printable_arch_mach' -................................... - -*Synopsis* - const char *bfd_printable_arch_mach - (enum bfd_architecture arch, unsigned long machine); - *Description* -Return a printable string representing the architecture and machine -type. - - This routine is depreciated. - -2.13.2.17 `bfd_octets_per_byte' -............................... - -*Synopsis* - unsigned int bfd_octets_per_byte (bfd *abfd); - *Description* -Return the number of octets (8-bit quantities) per target byte (minimum -addressable unit). In most cases, this will be one, but some DSP -targets have 16, 32, or even 48 bits per byte. - -2.13.2.18 `bfd_arch_mach_octets_per_byte' -......................................... - -*Synopsis* - unsigned int bfd_arch_mach_octets_per_byte - (enum bfd_architecture arch, unsigned long machine); - *Description* -See bfd_octets_per_byte. - - This routine is provided for those cases where a bfd * is not -available - - -File: bfd.info, Node: Opening and Closing, Next: Internal, Prev: Architectures, Up: BFD front end - -2.14 Opening and closing BFDs -============================= - -2.14.1 Functions for opening and closing ----------------------------------------- - -2.14.1.1 `bfd_fopen' -.................... - -*Synopsis* - bfd *bfd_fopen (const char *filename, const char *target, - const char *mode, int fd); - *Description* -Open the file FILENAME with the target TARGET. Return a pointer to the -created BFD. If FD is not -1, then `fdopen' is used to open the file; -otherwise, `fopen' is used. MODE is passed directly to `fopen' or -`fdopen'. - - Calls `bfd_find_target', so TARGET is interpreted as by that -function. - - The new BFD is marked as cacheable iff FD is -1. - - If `NULL' is returned then an error has occured. Possible errors -are `bfd_error_no_memory', `bfd_error_invalid_target' or `system_call' -error. - -2.14.1.2 `bfd_openr' -.................... - -*Synopsis* - bfd *bfd_openr (const char *filename, const char *target); - *Description* -Open the file FILENAME (using `fopen') with the target TARGET. Return -a pointer to the created BFD. - - Calls `bfd_find_target', so TARGET is interpreted as by that -function. - - If `NULL' is returned then an error has occured. Possible errors -are `bfd_error_no_memory', `bfd_error_invalid_target' or `system_call' -error. - -2.14.1.3 `bfd_fdopenr' -...................... - -*Synopsis* - bfd *bfd_fdopenr (const char *filename, const char *target, int fd); - *Description* -`bfd_fdopenr' is to `bfd_fopenr' much like `fdopen' is to `fopen'. It -opens a BFD on a file already described by the FD supplied. - - When the file is later `bfd_close'd, the file descriptor will be -closed. If the caller desires that this file descriptor be cached by -BFD (opened as needed, closed as needed to free descriptors for other -opens), with the supplied FD used as an initial file descriptor (but -subject to closure at any time), call bfd_set_cacheable(bfd, 1) on the -returned BFD. The default is to assume no caching; the file descriptor -will remain open until `bfd_close', and will not be affected by BFD -operations on other files. - - Possible errors are `bfd_error_no_memory', -`bfd_error_invalid_target' and `bfd_error_system_call'. - -2.14.1.4 `bfd_openstreamr' -.......................... - -*Synopsis* - bfd *bfd_openstreamr (const char *, const char *, void *); - *Description* -Open a BFD for read access on an existing stdio stream. When the BFD -is passed to `bfd_close', the stream will be closed. - -2.14.1.5 `bfd_openr_iovec' -.......................... - -*Synopsis* - bfd *bfd_openr_iovec (const char *filename, const char *target, - void *(*open) (struct bfd *nbfd, - void *open_closure), - void *open_closure, - file_ptr (*pread) (struct bfd *nbfd, - void *stream, - void *buf, - file_ptr nbytes, - file_ptr offset), - int (*close) (struct bfd *nbfd, - void *stream)); - *Description* -Create and return a BFD backed by a read-only STREAM. The STREAM is -created using OPEN, accessed using PREAD and destroyed using CLOSE. - - Calls `bfd_find_target', so TARGET is interpreted as by that -function. - - Calls OPEN (which can call `bfd_zalloc' and `bfd_get_filename') to -obtain the read-only stream backing the BFD. OPEN either succeeds -returning the non-`NULL' STREAM, or fails returning `NULL' (setting -`bfd_error'). - - Calls PREAD to request NBYTES of data from STREAM starting at OFFSET -(e.g., via a call to `bfd_read'). PREAD either succeeds returning the -number of bytes read (which can be less than NBYTES when end-of-file), -or fails returning -1 (setting `bfd_error'). - - Calls CLOSE when the BFD is later closed using `bfd_close'. CLOSE -either succeeds returning 0, or fails returning -1 (setting -`bfd_error'). - - If `bfd_openr_iovec' returns `NULL' then an error has occurred. -Possible errors are `bfd_error_no_memory', `bfd_error_invalid_target' -and `bfd_error_system_call'. - -2.14.1.6 `bfd_openw' -.................... - -*Synopsis* - bfd *bfd_openw (const char *filename, const char *target); - *Description* -Create a BFD, associated with file FILENAME, using the file format -TARGET, and return a pointer to it. - - Possible errors are `bfd_error_system_call', `bfd_error_no_memory', -`bfd_error_invalid_target'. - -2.14.1.7 `bfd_close' -.................... - -*Synopsis* - bfd_boolean bfd_close (bfd *abfd); - *Description* -Close a BFD. If the BFD was open for writing, then pending operations -are completed and the file written out and closed. If the created file -is executable, then `chmod' is called to mark it as such. - - All memory attached to the BFD is released. - - The file descriptor associated with the BFD is closed (even if it -was passed in to BFD by `bfd_fdopenr'). - - *Returns* -`TRUE' is returned if all is ok, otherwise `FALSE'. - -2.14.1.8 `bfd_close_all_done' -............................. - -*Synopsis* - bfd_boolean bfd_close_all_done (bfd *); - *Description* -Close a BFD. Differs from `bfd_close' since it does not complete any -pending operations. This routine would be used if the application had -just used BFD for swapping and didn't want to use any of the writing -code. - - If the created file is executable, then `chmod' is called to mark it -as such. - - All memory attached to the BFD is released. - - *Returns* -`TRUE' is returned if all is ok, otherwise `FALSE'. - -2.14.1.9 `bfd_create' -..................... - -*Synopsis* - bfd *bfd_create (const char *filename, bfd *templ); - *Description* -Create a new BFD in the manner of `bfd_openw', but without opening a -file. The new BFD takes the target from the target used by TEMPLATE. -The format is always set to `bfd_object'. - -2.14.1.10 `bfd_make_writable' -............................. - -*Synopsis* - bfd_boolean bfd_make_writable (bfd *abfd); - *Description* -Takes a BFD as created by `bfd_create' and converts it into one like as -returned by `bfd_openw'. It does this by converting the BFD to -BFD_IN_MEMORY. It's assumed that you will call `bfd_make_readable' on -this bfd later. - - *Returns* -`TRUE' is returned if all is ok, otherwise `FALSE'. - -2.14.1.11 `bfd_make_readable' -............................. - -*Synopsis* - bfd_boolean bfd_make_readable (bfd *abfd); - *Description* -Takes a BFD as created by `bfd_create' and `bfd_make_writable' and -converts it into one like as returned by `bfd_openr'. It does this by -writing the contents out to the memory buffer, then reversing the -direction. - - *Returns* -`TRUE' is returned if all is ok, otherwise `FALSE'. - -2.14.1.12 `bfd_alloc' -..................... - -*Synopsis* - void *bfd_alloc (bfd *abfd, bfd_size_type wanted); - *Description* -Allocate a block of WANTED bytes of memory attached to `abfd' and -return a pointer to it. - -2.14.1.13 `bfd_alloc2' -...................... - -*Synopsis* - void *bfd_alloc2 (bfd *abfd, bfd_size_type nmemb, bfd_size_type size); - *Description* -Allocate a block of NMEMB elements of SIZE bytes each of memory -attached to `abfd' and return a pointer to it. - -2.14.1.14 `bfd_zalloc' -...................... - -*Synopsis* - void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); - *Description* -Allocate a block of WANTED bytes of zeroed memory attached to `abfd' -and return a pointer to it. - -2.14.1.15 `bfd_zalloc2' -....................... - -*Synopsis* - void *bfd_zalloc2 (bfd *abfd, bfd_size_type nmemb, bfd_size_type size); - *Description* -Allocate a block of NMEMB elements of SIZE bytes each of zeroed memory -attached to `abfd' and return a pointer to it. - -2.14.1.16 `bfd_calc_gnu_debuglink_crc32' -........................................ - -*Synopsis* - unsigned long bfd_calc_gnu_debuglink_crc32 - (unsigned long crc, const unsigned char *buf, bfd_size_type len); - *Description* -Computes a CRC value as used in the .gnu_debuglink section. Advances -the previously computed CRC value by computing and adding in the crc32 -for LEN bytes of BUF. - - *Returns* -Return the updated CRC32 value. - -2.14.1.17 `get_debug_link_info' -............................... - -*Synopsis* - char *get_debug_link_info (bfd *abfd, unsigned long *crc32_out); - *Description* -fetch the filename and CRC32 value for any separate debuginfo -associated with ABFD. Return NULL if no such info found, otherwise -return filename and update CRC32_OUT. - -2.14.1.18 `separate_debug_file_exists' -...................................... - -*Synopsis* - bfd_boolean separate_debug_file_exists - (char *name, unsigned long crc32); - *Description* -Checks to see if NAME is a file and if its contents match CRC32. - -2.14.1.19 `find_separate_debug_file' -.................................... - -*Synopsis* - char *find_separate_debug_file (bfd *abfd); - *Description* -Searches ABFD for a reference to separate debugging information, scans -various locations in the filesystem, including the file tree rooted at -DEBUG_FILE_DIRECTORY, and returns a filename of such debugging -information if the file is found and has matching CRC32. Returns NULL -if no reference to debugging file exists, or file cannot be found. - -2.14.1.20 `bfd_follow_gnu_debuglink' -.................................... - -*Synopsis* - char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); - *Description* -Takes a BFD and searches it for a .gnu_debuglink section. If this -section is found, it examines the section for the name and checksum of -a '.debug' file containing auxiliary debugging information. It then -searches the filesystem for this .debug file in some standard -locations, including the directory tree rooted at DIR, and if found -returns the full filename. - - If DIR is NULL, it will search a default path configured into libbfd -at build time. [XXX this feature is not currently implemented]. - - *Returns* -`NULL' on any errors or failure to locate the .debug file, otherwise a -pointer to a heap-allocated string containing the filename. The caller -is responsible for freeing this string. - -2.14.1.21 `bfd_create_gnu_debuglink_section' -............................................ - -*Synopsis* - struct bfd_section *bfd_create_gnu_debuglink_section - (bfd *abfd, const char *filename); - *Description* -Takes a BFD and adds a .gnu_debuglink section to it. The section is -sized to be big enough to contain a link to the specified FILENAME. - - *Returns* -A pointer to the new section is returned if all is ok. Otherwise -`NULL' is returned and bfd_error is set. - -2.14.1.22 `bfd_fill_in_gnu_debuglink_section' -............................................. - -*Synopsis* - bfd_boolean bfd_fill_in_gnu_debuglink_section - (bfd *abfd, struct bfd_section *sect, const char *filename); - *Description* -Takes a BFD and containing a .gnu_debuglink section SECT and fills in -the contents of the section to contain a link to the specified -FILENAME. The filename should be relative to the current directory. - - *Returns* -`TRUE' is returned if all is ok. Otherwise `FALSE' is returned and -bfd_error is set. - - -File: bfd.info, Node: Internal, Next: File Caching, Prev: Opening and Closing, Up: BFD front end - -2.15 Implementation details -=========================== - -2.15.1 Internal functions -------------------------- - -*Description* -These routines are used within BFD. They are not intended for export, -but are documented here for completeness. - -2.15.1.1 `bfd_write_bigendian_4byte_int' -........................................ - -*Synopsis* - bfd_boolean bfd_write_bigendian_4byte_int (bfd *, unsigned int); - *Description* -Write a 4 byte integer I to the output BFD ABFD, in big endian order -regardless of what else is going on. This is useful in archives. - -2.15.1.2 `bfd_put_size' -....................... - -2.15.1.3 `bfd_get_size' -....................... - -*Description* -These macros as used for reading and writing raw data in sections; each -access (except for bytes) is vectored through the target format of the -BFD and mangled accordingly. The mangling performs any necessary endian -translations and removes alignment restrictions. Note that types -accepted and returned by these macros are identical so they can be -swapped around in macros--for example, `libaout.h' defines `GET_WORD' -to either `bfd_get_32' or `bfd_get_64'. - - In the put routines, VAL must be a `bfd_vma'. If we are on a system -without prototypes, the caller is responsible for making sure that is -true, with a cast if necessary. We don't cast them in the macro -definitions because that would prevent `lint' or `gcc -Wall' from -detecting sins such as passing a pointer. To detect calling these with -less than a `bfd_vma', use `gcc -Wconversion' on a host with 64 bit -`bfd_vma''s. - - /* Byte swapping macros for user section data. */ - - #define bfd_put_8(abfd, val, ptr) \ - ((void) (*((unsigned char *) (ptr)) = (val) & 0xff)) - #define bfd_put_signed_8 \ - bfd_put_8 - #define bfd_get_8(abfd, ptr) \ - (*(unsigned char *) (ptr) & 0xff) - #define bfd_get_signed_8(abfd, ptr) \ - (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) - - #define bfd_put_16(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) - #define bfd_put_signed_16 \ - bfd_put_16 - #define bfd_get_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx16, (ptr)) - #define bfd_get_signed_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) - - #define bfd_put_32(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) - #define bfd_put_signed_32 \ - bfd_put_32 - #define bfd_get_32(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx32, (ptr)) - #define bfd_get_signed_32(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx_signed_32, (ptr)) - - #define bfd_put_64(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_putx64, ((val), (ptr))) - #define bfd_put_signed_64 \ - bfd_put_64 - #define bfd_get_64(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx64, (ptr)) - #define bfd_get_signed_64(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) - - #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ - : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ - : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ - : (bits) == 64 ? bfd_get_64 (abfd, ptr) \ - : (abort (), (bfd_vma) - 1)) - - #define bfd_put(bits, abfd, val, ptr) \ - ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ - : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ - : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ - : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \ - : (abort (), (void) 0)) - -2.15.1.4 `bfd_h_put_size' -......................... - -*Description* -These macros have the same function as their `bfd_get_x' brethren, -except that they are used for removing information for the header -records of object files. Believe it or not, some object files keep -their header records in big endian order and their data in little -endian order. - - /* Byte swapping macros for file header data. */ - - #define bfd_h_put_8(abfd, val, ptr) \ - bfd_put_8 (abfd, val, ptr) - #define bfd_h_put_signed_8(abfd, val, ptr) \ - bfd_put_8 (abfd, val, ptr) - #define bfd_h_get_8(abfd, ptr) \ - bfd_get_8 (abfd, ptr) - #define bfd_h_get_signed_8(abfd, ptr) \ - bfd_get_signed_8 (abfd, ptr) - - #define bfd_h_put_16(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_h_putx16, (val, ptr)) - #define bfd_h_put_signed_16 \ - bfd_h_put_16 - #define bfd_h_get_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx16, (ptr)) - #define bfd_h_get_signed_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr)) - - #define bfd_h_put_32(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_h_putx32, (val, ptr)) - #define bfd_h_put_signed_32 \ - bfd_h_put_32 - #define bfd_h_get_32(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx32, (ptr)) - #define bfd_h_get_signed_32(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr)) - - #define bfd_h_put_64(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_h_putx64, (val, ptr)) - #define bfd_h_put_signed_64 \ - bfd_h_put_64 - #define bfd_h_get_64(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx64, (ptr)) - #define bfd_h_get_signed_64(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr)) - - /* Aliases for the above, which should eventually go away. */ - - #define H_PUT_64 bfd_h_put_64 - #define H_PUT_32 bfd_h_put_32 - #define H_PUT_16 bfd_h_put_16 - #define H_PUT_8 bfd_h_put_8 - #define H_PUT_S64 bfd_h_put_signed_64 - #define H_PUT_S32 bfd_h_put_signed_32 - #define H_PUT_S16 bfd_h_put_signed_16 - #define H_PUT_S8 bfd_h_put_signed_8 - #define H_GET_64 bfd_h_get_64 - #define H_GET_32 bfd_h_get_32 - #define H_GET_16 bfd_h_get_16 - #define H_GET_8 bfd_h_get_8 - #define H_GET_S64 bfd_h_get_signed_64 - #define H_GET_S32 bfd_h_get_signed_32 - #define H_GET_S16 bfd_h_get_signed_16 - #define H_GET_S8 bfd_h_get_signed_8 - -2.15.1.5 `bfd_log2' -................... - -*Synopsis* - unsigned int bfd_log2 (bfd_vma x); - *Description* -Return the log base 2 of the value supplied, rounded up. E.g., an X of -1025 returns 11. A X of 0 returns 0. - - -File: bfd.info, Node: File Caching, Next: Linker Functions, Prev: Internal, Up: BFD front end - -2.16 File caching -================= - -The file caching mechanism is embedded within BFD and allows the -application to open as many BFDs as it wants without regard to the -underlying operating system's file descriptor limit (often as low as 20 -open files). The module in `cache.c' maintains a least recently used -list of `BFD_CACHE_MAX_OPEN' files, and exports the name -`bfd_cache_lookup', which runs around and makes sure that the required -BFD is open. If not, then it chooses a file to close, closes it and -opens the one wanted, returning its file handle. - -2.16.1 Caching functions ------------------------- - -2.16.1.1 `bfd_cache_init' -......................... - -*Synopsis* - bfd_boolean bfd_cache_init (bfd *abfd); - *Description* -Add a newly opened BFD to the cache. - -2.16.1.2 `bfd_cache_close' -.......................... - -*Synopsis* - bfd_boolean bfd_cache_close (bfd *abfd); - *Description* -Remove the BFD ABFD from the cache. If the attached file is open, then -close it too. - - *Returns* -`FALSE' is returned if closing the file fails, `TRUE' is returned if -all is well. - -2.16.1.3 `bfd_cache_close_all' -.............................. - -*Synopsis* - bfd_boolean bfd_cache_close_all (void); - *Description* -Remove all BFDs from the cache. If the attached file is open, then -close it too. - - *Returns* -`FALSE' is returned if closing one of the file fails, `TRUE' is -returned if all is well. - -2.16.1.4 `bfd_open_file' -........................ - -*Synopsis* - FILE* bfd_open_file (bfd *abfd); - *Description* -Call the OS to open a file for ABFD. Return the `FILE *' (possibly -`NULL') that results from this operation. Set up the BFD so that -future accesses know the file is open. If the `FILE *' returned is -`NULL', then it won't have been put in the cache, so it won't have to -be removed from it. - - -File: bfd.info, Node: Linker Functions, Next: Hash Tables, Prev: File Caching, Up: BFD front end - -2.17 Linker Functions -===================== - -The linker uses three special entry points in the BFD target vector. -It is not necessary to write special routines for these entry points -when creating a new BFD back end, since generic versions are provided. -However, writing them can speed up linking and make it use -significantly less runtime memory. - - The first routine creates a hash table used by the other routines. -The second routine adds the symbols from an object file to the hash -table. The third routine takes all the object files and links them -together to create the output file. These routines are designed so -that the linker proper does not need to know anything about the symbols -in the object files that it is linking. The linker merely arranges the -sections as directed by the linker script and lets BFD handle the -details of symbols and relocs. - - The second routine and third routines are passed a pointer to a -`struct bfd_link_info' structure (defined in `bfdlink.h') which holds -information relevant to the link, including the linker hash table -(which was created by the first routine) and a set of callback -functions to the linker proper. - - The generic linker routines are in `linker.c', and use the header -file `genlink.h'. As of this writing, the only back ends which have -implemented versions of these routines are a.out (in `aoutx.h') and -ECOFF (in `ecoff.c'). The a.out routines are used as examples -throughout this section. - -* Menu: - -* Creating a Linker Hash Table:: -* Adding Symbols to the Hash Table:: -* Performing the Final Link:: - - -File: bfd.info, Node: Creating a Linker Hash Table, Next: Adding Symbols to the Hash Table, Prev: Linker Functions, Up: Linker Functions - -2.17.1 Creating a linker hash table ------------------------------------ - -The linker routines must create a hash table, which must be derived -from `struct bfd_link_hash_table' described in `bfdlink.c'. *Note Hash -Tables::, for information on how to create a derived hash table. This -entry point is called using the target vector of the linker output file. - - The `_bfd_link_hash_table_create' entry point must allocate and -initialize an instance of the desired hash table. If the back end does -not require any additional information to be stored with the entries in -the hash table, the entry point may simply create a `struct -bfd_link_hash_table'. Most likely, however, some additional -information will be needed. - - For example, with each entry in the hash table the a.out linker -keeps the index the symbol has in the final output file (this index -number is used so that when doing a relocatable link the symbol index -used in the output file can be quickly filled in when copying over a -reloc). The a.out linker code defines the required structures and -functions for a hash table derived from `struct bfd_link_hash_table'. -The a.out linker hash table is created by the function -`NAME(aout,link_hash_table_create)'; it simply allocates space for the -hash table, initializes it, and returns a pointer to it. - - When writing the linker routines for a new back end, you will -generally not know exactly which fields will be required until you have -finished. You should simply create a new hash table which defines no -additional fields, and then simply add fields as they become necessary. - - -File: bfd.info, Node: Adding Symbols to the Hash Table, Next: Performing the Final Link, Prev: Creating a Linker Hash Table, Up: Linker Functions - -2.17.2 Adding symbols to the hash table ---------------------------------------- - -The linker proper will call the `_bfd_link_add_symbols' entry point for -each object file or archive which is to be linked (typically these are -the files named on the command line, but some may also come from the -linker script). The entry point is responsible for examining the file. -For an object file, BFD must add any relevant symbol information to -the hash table. For an archive, BFD must determine which elements of -the archive should be used and adding them to the link. - - The a.out version of this entry point is -`NAME(aout,link_add_symbols)'. - -* Menu: - -* Differing file formats:: -* Adding symbols from an object file:: -* Adding symbols from an archive:: - - -File: bfd.info, Node: Differing file formats, Next: Adding symbols from an object file, Prev: Adding Symbols to the Hash Table, Up: Adding Symbols to the Hash Table - -2.17.2.1 Differing file formats -............................... - -Normally all the files involved in a link will be of the same format, -but it is also possible to link together different format object files, -and the back end must support that. The `_bfd_link_add_symbols' entry -point is called via the target vector of the file to be added. This -has an important consequence: the function may not assume that the hash -table is the type created by the corresponding -`_bfd_link_hash_table_create' vector. All the `_bfd_link_add_symbols' -function can assume about the hash table is that it is derived from -`struct bfd_link_hash_table'. - - Sometimes the `_bfd_link_add_symbols' function must store some -information in the hash table entry to be used by the `_bfd_final_link' -function. In such a case the `creator' field of the hash table must be -checked to make sure that the hash table was created by an object file -of the same format. - - The `_bfd_final_link' routine must be prepared to handle a hash -entry without any extra information added by the -`_bfd_link_add_symbols' function. A hash entry without extra -information will also occur when the linker script directs the linker -to create a symbol. Note that, regardless of how a hash table entry is -added, all the fields will be initialized to some sort of null value by -the hash table entry initialization function. - - See `ecoff_link_add_externals' for an example of how to check the -`creator' field before saving information (in this case, the ECOFF -external symbol debugging information) in a hash table entry. - - -File: bfd.info, Node: Adding symbols from an object file, Next: Adding symbols from an archive, Prev: Differing file formats, Up: Adding Symbols to the Hash Table - -2.17.2.2 Adding symbols from an object file -........................................... - -When the `_bfd_link_add_symbols' routine is passed an object file, it -must add all externally visible symbols in that object file to the hash -table. The actual work of adding the symbol to the hash table is -normally handled by the function `_bfd_generic_link_add_one_symbol'. -The `_bfd_link_add_symbols' routine is responsible for reading all the -symbols from the object file and passing the correct information to -`_bfd_generic_link_add_one_symbol'. - - The `_bfd_link_add_symbols' routine should not use -`bfd_canonicalize_symtab' to read the symbols. The point of providing -this routine is to avoid the overhead of converting the symbols into -generic `asymbol' structures. - - `_bfd_generic_link_add_one_symbol' handles the details of combining -common symbols, warning about multiple definitions, and so forth. It -takes arguments which describe the symbol to add, notably symbol flags, -a section, and an offset. The symbol flags include such things as -`BSF_WEAK' or `BSF_INDIRECT'. The section is a section in the object -file, or something like `bfd_und_section_ptr' for an undefined symbol -or `bfd_com_section_ptr' for a common symbol. - - If the `_bfd_final_link' routine is also going to need to read the -symbol information, the `_bfd_link_add_symbols' routine should save it -somewhere attached to the object file BFD. However, the information -should only be saved if the `keep_memory' field of the `info' argument -is TRUE, so that the `-no-keep-memory' linker switch is effective. - - The a.out function which adds symbols from an object file is -`aout_link_add_object_symbols', and most of the interesting work is in -`aout_link_add_symbols'. The latter saves pointers to the hash tables -entries created by `_bfd_generic_link_add_one_symbol' indexed by symbol -number, so that the `_bfd_final_link' routine does not have to call the -hash table lookup routine to locate the entry. - - -File: bfd.info, Node: Adding symbols from an archive, Prev: Adding symbols from an object file, Up: Adding Symbols to the Hash Table - -2.17.2.3 Adding symbols from an archive -....................................... - -When the `_bfd_link_add_symbols' routine is passed an archive, it must -look through the symbols defined by the archive and decide which -elements of the archive should be included in the link. For each such -element it must call the `add_archive_element' linker callback, and it -must add the symbols from the object file to the linker hash table. - - In most cases the work of looking through the symbols in the archive -should be done by the `_bfd_generic_link_add_archive_symbols' function. -This function builds a hash table from the archive symbol table and -looks through the list of undefined symbols to see which elements -should be included. `_bfd_generic_link_add_archive_symbols' is passed -a function to call to make the final decision about adding an archive -element to the link and to do the actual work of adding the symbols to -the linker hash table. - - The function passed to `_bfd_generic_link_add_archive_symbols' must -read the symbols of the archive element and decide whether the archive -element should be included in the link. If the element is to be -included, the `add_archive_element' linker callback routine must be -called with the element as an argument, and the elements symbols must -be added to the linker hash table just as though the element had itself -been passed to the `_bfd_link_add_symbols' function. - - When the a.out `_bfd_link_add_symbols' function receives an archive, -it calls `_bfd_generic_link_add_archive_symbols' passing -`aout_link_check_archive_element' as the function argument. -`aout_link_check_archive_element' calls `aout_link_check_ar_symbols'. -If the latter decides to add the element (an element is only added if -it provides a real, non-common, definition for a previously undefined -or common symbol) it calls the `add_archive_element' callback and then -`aout_link_check_archive_element' calls `aout_link_add_symbols' to -actually add the symbols to the linker hash table. - - The ECOFF back end is unusual in that it does not normally call -`_bfd_generic_link_add_archive_symbols', because ECOFF archives already -contain a hash table of symbols. The ECOFF back end searches the -archive itself to avoid the overhead of creating a new hash table. - - -File: bfd.info, Node: Performing the Final Link, Prev: Adding Symbols to the Hash Table, Up: Linker Functions - -2.17.3 Performing the final link --------------------------------- - -When all the input files have been processed, the linker calls the -`_bfd_final_link' entry point of the output BFD. This routine is -responsible for producing the final output file, which has several -aspects. It must relocate the contents of the input sections and copy -the data into the output sections. It must build an output symbol -table including any local symbols from the input files and the global -symbols from the hash table. When producing relocatable output, it must -modify the input relocs and write them into the output file. There may -also be object format dependent work to be done. - - The linker will also call the `write_object_contents' entry point -when the BFD is closed. The two entry points must work together in -order to produce the correct output file. - - The details of how this works are inevitably dependent upon the -specific object file format. The a.out `_bfd_final_link' routine is -`NAME(aout,final_link)'. - -* Menu: - -* Information provided by the linker:: -* Relocating the section contents:: -* Writing the symbol table:: - - -File: bfd.info, Node: Information provided by the linker, Next: Relocating the section contents, Prev: Performing the Final Link, Up: Performing the Final Link - -2.17.3.1 Information provided by the linker -........................................... - -Before the linker calls the `_bfd_final_link' entry point, it sets up -some data structures for the function to use. - - The `input_bfds' field of the `bfd_link_info' structure will point -to a list of all the input files included in the link. These files are -linked through the `link_next' field of the `bfd' structure. - - Each section in the output file will have a list of `link_order' -structures attached to the `map_head.link_order' field (the -`link_order' structure is defined in `bfdlink.h'). These structures -describe how to create the contents of the output section in terms of -the contents of various input sections, fill constants, and, -eventually, other types of information. They also describe relocs that -must be created by the BFD backend, but do not correspond to any input -file; this is used to support -Ur, which builds constructors while -generating a relocatable object file. - - -File: bfd.info, Node: Relocating the section contents, Next: Writing the symbol table, Prev: Information provided by the linker, Up: Performing the Final Link - -2.17.3.2 Relocating the section contents -........................................ - -The `_bfd_final_link' function should look through the `link_order' -structures attached to each section of the output file. Each -`link_order' structure should either be handled specially, or it should -be passed to the function `_bfd_default_link_order' which will do the -right thing (`_bfd_default_link_order' is defined in `linker.c'). - - For efficiency, a `link_order' of type `bfd_indirect_link_order' -whose associated section belongs to a BFD of the same format as the -output BFD must be handled specially. This type of `link_order' -describes part of an output section in terms of a section belonging to -one of the input files. The `_bfd_final_link' function should read the -contents of the section and any associated relocs, apply the relocs to -the section contents, and write out the modified section contents. If -performing a relocatable link, the relocs themselves must also be -modified and written out. - - The functions `_bfd_relocate_contents' and -`_bfd_final_link_relocate' provide some general support for performing -the actual relocations, notably overflow checking. Their arguments -include information about the symbol the relocation is against and a -`reloc_howto_type' argument which describes the relocation to perform. -These functions are defined in `reloc.c'. - - The a.out function which handles reading, relocating, and writing -section contents is `aout_link_input_section'. The actual relocation -is done in `aout_link_input_section_std' and -`aout_link_input_section_ext'. - - -File: bfd.info, Node: Writing the symbol table, Prev: Relocating the section contents, Up: Performing the Final Link - -2.17.3.3 Writing the symbol table -................................. - -The `_bfd_final_link' function must gather all the symbols in the input -files and write them out. It must also write out all the symbols in -the global hash table. This must be controlled by the `strip' and -`discard' fields of the `bfd_link_info' structure. - - The local symbols of the input files will not have been entered into -the linker hash table. The `_bfd_final_link' routine must consider -each input file and include the symbols in the output file. It may be -convenient to do this when looking through the `link_order' structures, -or it may be done by stepping through the `input_bfds' list. - - The `_bfd_final_link' routine must also traverse the global hash -table to gather all the externally visible symbols. It is possible -that most of the externally visible symbols may be written out when -considering the symbols of each input file, but it is still necessary -to traverse the hash table since the linker script may have defined -some symbols that are not in any of the input files. - - The `strip' field of the `bfd_link_info' structure controls which -symbols are written out. The possible values are listed in -`bfdlink.h'. If the value is `strip_some', then the `keep_hash' field -of the `bfd_link_info' structure is a hash table of symbols to keep; -each symbol should be looked up in this hash table, and only symbols -which are present should be included in the output file. - - If the `strip' field of the `bfd_link_info' structure permits local -symbols to be written out, the `discard' field is used to further -controls which local symbols are included in the output file. If the -value is `discard_l', then all local symbols which begin with a certain -prefix are discarded; this is controlled by the -`bfd_is_local_label_name' entry point. - - The a.out backend handles symbols by calling -`aout_link_write_symbols' on each input BFD and then traversing the -global hash table with the function `aout_link_write_other_symbol'. It -builds a string table while writing out the symbols, which is written -to the output file at the end of `NAME(aout,final_link)'. - -2.17.3.4 `bfd_link_split_section' -................................. - -*Synopsis* - bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); - *Description* -Return nonzero if SEC should be split during a reloceatable or final -link. - #define bfd_link_split_section(abfd, sec) \ - BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec)) - -2.17.3.5 `bfd_section_already_linked' -..................................... - -*Synopsis* - void bfd_section_already_linked (bfd *abfd, asection *sec); - *Description* -Check if SEC has been already linked during a reloceatable or final -link. - #define bfd_section_already_linked(abfd, sec) \ - BFD_SEND (abfd, _section_already_linked, (abfd, sec)) - - -File: bfd.info, Node: Hash Tables, Prev: Linker Functions, Up: BFD front end - -2.18 Hash Tables -================ - -BFD provides a simple set of hash table functions. Routines are -provided to initialize a hash table, to free a hash table, to look up a -string in a hash table and optionally create an entry for it, and to -traverse a hash table. There is currently no routine to delete an -string from a hash table. - - The basic hash table does not permit any data to be stored with a -string. However, a hash table is designed to present a base class from -which other types of hash tables may be derived. These derived types -may store additional information with the string. Hash tables were -implemented in this way, rather than simply providing a data pointer in -a hash table entry, because they were designed for use by the linker -back ends. The linker may create thousands of hash table entries, and -the overhead of allocating private data and storing and following -pointers becomes noticeable. - - The basic hash table code is in `hash.c'. - -* Menu: - -* Creating and Freeing a Hash Table:: -* Looking Up or Entering a String:: -* Traversing a Hash Table:: -* Deriving a New Hash Table Type:: - - -File: bfd.info, Node: Creating and Freeing a Hash Table, Next: Looking Up or Entering a String, Prev: Hash Tables, Up: Hash Tables - -2.18.1 Creating and freeing a hash table ----------------------------------------- - -To create a hash table, create an instance of a `struct bfd_hash_table' -(defined in `bfd.h') and call `bfd_hash_table_init' (if you know -approximately how many entries you will need, the function -`bfd_hash_table_init_n', which takes a SIZE argument, may be used). -`bfd_hash_table_init' returns `FALSE' if some sort of error occurs. - - The function `bfd_hash_table_init' take as an argument a function to -use to create new entries. For a basic hash table, use the function -`bfd_hash_newfunc'. *Note Deriving a New Hash Table Type::, for why -you would want to use a different value for this argument. - - `bfd_hash_table_init' will create an objalloc which will be used to -allocate new entries. You may allocate memory on this objalloc using -`bfd_hash_allocate'. - - Use `bfd_hash_table_free' to free up all the memory that has been -allocated for a hash table. This will not free up the `struct -bfd_hash_table' itself, which you must provide. - - Use `bfd_hash_set_default_size' to set the default size of hash -table to use. - - -File: bfd.info, Node: Looking Up or Entering a String, Next: Traversing a Hash Table, Prev: Creating and Freeing a Hash Table, Up: Hash Tables - -2.18.2 Looking up or entering a string --------------------------------------- - -The function `bfd_hash_lookup' is used both to look up a string in the -hash table and to create a new entry. - - If the CREATE argument is `FALSE', `bfd_hash_lookup' will look up a -string. If the string is found, it will returns a pointer to a `struct -bfd_hash_entry'. If the string is not found in the table -`bfd_hash_lookup' will return `NULL'. You should not modify any of the -fields in the returns `struct bfd_hash_entry'. - - If the CREATE argument is `TRUE', the string will be entered into -the hash table if it is not already there. Either way a pointer to a -`struct bfd_hash_entry' will be returned, either to the existing -structure or to a newly created one. In this case, a `NULL' return -means that an error occurred. - - If the CREATE argument is `TRUE', and a new entry is created, the -COPY argument is used to decide whether to copy the string onto the -hash table objalloc or not. If COPY is passed as `FALSE', you must be -careful not to deallocate or modify the string as long as the hash table -exists. - - -File: bfd.info, Node: Traversing a Hash Table, Next: Deriving a New Hash Table Type, Prev: Looking Up or Entering a String, Up: Hash Tables - -2.18.3 Traversing a hash table ------------------------------- - -The function `bfd_hash_traverse' may be used to traverse a hash table, -calling a function on each element. The traversal is done in a random -order. - - `bfd_hash_traverse' takes as arguments a function and a generic -`void *' pointer. The function is called with a hash table entry (a -`struct bfd_hash_entry *') and the generic pointer passed to -`bfd_hash_traverse'. The function must return a `boolean' value, which -indicates whether to continue traversing the hash table. If the -function returns `FALSE', `bfd_hash_traverse' will stop the traversal -and return immediately. - - -File: bfd.info, Node: Deriving a New Hash Table Type, Prev: Traversing a Hash Table, Up: Hash Tables - -2.18.4 Deriving a new hash table type -------------------------------------- - -Many uses of hash tables want to store additional information which -each entry in the hash table. Some also find it convenient to store -additional information with the hash table itself. This may be done -using a derived hash table. - - Since C is not an object oriented language, creating a derived hash -table requires sticking together some boilerplate routines with a few -differences specific to the type of hash table you want to create. - - An example of a derived hash table is the linker hash table. The -structures for this are defined in `bfdlink.h'. The functions are in -`linker.c'. - - You may also derive a hash table from an already derived hash table. -For example, the a.out linker backend code uses a hash table derived -from the linker hash table. - -* Menu: - -* Define the Derived Structures:: -* Write the Derived Creation Routine:: -* Write Other Derived Routines:: - - -File: bfd.info, Node: Define the Derived Structures, Next: Write the Derived Creation Routine, Prev: Deriving a New Hash Table Type, Up: Deriving a New Hash Table Type - -2.18.4.1 Define the derived structures -...................................... - -You must define a structure for an entry in the hash table, and a -structure for the hash table itself. - - The first field in the structure for an entry in the hash table must -be of the type used for an entry in the hash table you are deriving -from. If you are deriving from a basic hash table this is `struct -bfd_hash_entry', which is defined in `bfd.h'. The first field in the -structure for the hash table itself must be of the type of the hash -table you are deriving from itself. If you are deriving from a basic -hash table, this is `struct bfd_hash_table'. - - For example, the linker hash table defines `struct -bfd_link_hash_entry' (in `bfdlink.h'). The first field, `root', is of -type `struct bfd_hash_entry'. Similarly, the first field in `struct -bfd_link_hash_table', `table', is of type `struct bfd_hash_table'. - - -File: bfd.info, Node: Write the Derived Creation Routine, Next: Write Other Derived Routines, Prev: Define the Derived Structures, Up: Deriving a New Hash Table Type - -2.18.4.2 Write the derived creation routine -........................................... - -You must write a routine which will create and initialize an entry in -the hash table. This routine is passed as the function argument to -`bfd_hash_table_init'. - - In order to permit other hash tables to be derived from the hash -table you are creating, this routine must be written in a standard way. - - The first argument to the creation routine is a pointer to a hash -table entry. This may be `NULL', in which case the routine should -allocate the right amount of space. Otherwise the space has already -been allocated by a hash table type derived from this one. - - After allocating space, the creation routine must call the creation -routine of the hash table type it is derived from, passing in a pointer -to the space it just allocated. This will initialize any fields used -by the base hash table. - - Finally the creation routine must initialize any local fields for -the new hash table type. - - Here is a boilerplate example of a creation routine. FUNCTION_NAME -is the name of the routine. ENTRY_TYPE is the type of an entry in the -hash table you are creating. BASE_NEWFUNC is the name of the creation -routine of the hash table type your hash table is derived from. - - struct bfd_hash_entry * - FUNCTION_NAME (struct bfd_hash_entry *entry, - struct bfd_hash_table *table, - const char *string) - { - struct ENTRY_TYPE *ret = (ENTRY_TYPE *) entry; - - /* Allocate the structure if it has not already been allocated by a - derived class. */ - if (ret == NULL) - { - ret = bfd_hash_allocate (table, sizeof (* ret)); - if (ret == NULL) - return NULL; - } - - /* Call the allocation method of the base class. */ - ret = ((ENTRY_TYPE *) - BASE_NEWFUNC ((struct bfd_hash_entry *) ret, table, string)); - - /* Initialize the local fields here. */ - - return (struct bfd_hash_entry *) ret; - } - *Description* -The creation routine for the linker hash table, which is in `linker.c', -looks just like this example. FUNCTION_NAME is -`_bfd_link_hash_newfunc'. ENTRY_TYPE is `struct bfd_link_hash_entry'. -BASE_NEWFUNC is `bfd_hash_newfunc', the creation routine for a basic -hash table. - - `_bfd_link_hash_newfunc' also initializes the local fields in a -linker hash table entry: `type', `written' and `next'. - - -File: bfd.info, Node: Write Other Derived Routines, Prev: Write the Derived Creation Routine, Up: Deriving a New Hash Table Type - -2.18.4.3 Write other derived routines -..................................... - -You will want to write other routines for your new hash table, as well. - - You will want an initialization routine which calls the -initialization routine of the hash table you are deriving from and -initializes any other local fields. For the linker hash table, this is -`_bfd_link_hash_table_init' in `linker.c'. - - You will want a lookup routine which calls the lookup routine of the -hash table you are deriving from and casts the result. The linker hash -table uses `bfd_link_hash_lookup' in `linker.c' (this actually takes an -additional argument which it uses to decide how to return the looked up -value). - - You may want a traversal routine. This should just call the -traversal routine of the hash table you are deriving from with -appropriate casts. The linker hash table uses `bfd_link_hash_traverse' -in `linker.c'. - - These routines may simply be defined as macros. For example, the -a.out backend linker hash table, which is derived from the linker hash -table, uses macros for the lookup and traversal routines. These are -`aout_link_hash_lookup' and `aout_link_hash_traverse' in aoutx.h. - - -File: bfd.info, Node: BFD back ends, Next: GNU Free Documentation License, Prev: BFD front end, Up: Top - -3 BFD back ends -*************** - -* Menu: - -* What to Put Where:: -* aout :: a.out backends -* coff :: coff backends -* elf :: elf backends -* mmo :: mmo backend - - -File: bfd.info, Node: What to Put Where, Next: aout, Prev: BFD back ends, Up: BFD back ends - - All of BFD lives in one directory. - - -File: bfd.info, Node: aout, Next: coff, Prev: What to Put Where, Up: BFD back ends - -3.1 a.out backends -================== - -*Description* -BFD supports a number of different flavours of a.out format, though the -major differences are only the sizes of the structures on disk, and the -shape of the relocation information. - - The support is split into a basic support file `aoutx.h' and other -files which derive functions from the base. One derivation file is -`aoutf1.h' (for a.out flavour 1), and adds to the basic a.out functions -support for sun3, sun4, 386 and 29k a.out files, to create a target -jump vector for a specific target. - - This information is further split out into more specific files for -each machine, including `sunos.c' for sun3 and sun4, `newsos3.c' for -the Sony NEWS, and `demo64.c' for a demonstration of a 64 bit a.out -format. - - The base file `aoutx.h' defines general mechanisms for reading and -writing records to and from disk and various other methods which BFD -requires. It is included by `aout32.c' and `aout64.c' to form the names -`aout_32_swap_exec_header_in', `aout_64_swap_exec_header_in', etc. - - As an example, this is what goes on to make the back end for a sun4, -from `aout32.c': - - #define ARCH_SIZE 32 - #include "aoutx.h" - - Which exports names: - - ... - aout_32_canonicalize_reloc - aout_32_find_nearest_line - aout_32_get_lineno - aout_32_get_reloc_upper_bound - ... - - from `sunos.c': - - #define TARGET_NAME "a.out-sunos-big" - #define VECNAME sunos_big_vec - #include "aoutf1.h" - - requires all the names from `aout32.c', and produces the jump vector - - sunos_big_vec - - The file `host-aout.c' is a special case. It is for a large set of -hosts that use "more or less standard" a.out files, and for which -cross-debugging is not interesting. It uses the standard 32-bit a.out -support routines, but determines the file offsets and addresses of the -text, data, and BSS sections, the machine architecture and machine -type, and the entry point address, in a host-dependent manner. Once -these values have been determined, generic code is used to handle the -object file. - - When porting it to run on a new system, you must supply: - - HOST_PAGE_SIZE - HOST_SEGMENT_SIZE - HOST_MACHINE_ARCH (optional) - HOST_MACHINE_MACHINE (optional) - HOST_TEXT_START_ADDR - HOST_STACK_END_ADDR - - in the file `../include/sys/h-XXX.h' (for your host). These values, -plus the structures and macros defined in `a.out.h' on your host -system, will produce a BFD target that will access ordinary a.out files -on your host. To configure a new machine to use `host-aout.c', specify: - - TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec - TDEPFILES= host-aout.o trad-core.o - - in the `config/XXX.mt' file, and modify `configure.in' to use the -`XXX.mt' file (by setting "`bfd_target=XXX'") when your configuration -is selected. - -3.1.1 Relocations ------------------ - -*Description* -The file `aoutx.h' provides for both the _standard_ and _extended_ -forms of a.out relocation records. - - The standard records contain only an address, a symbol index, and a -type field. The extended records (used on 29ks and sparcs) also have a -full integer for an addend. - -3.1.2 Internal entry points ---------------------------- - -*Description* -`aoutx.h' exports several routines for accessing the contents of an -a.out file, which are gathered and exported in turn by various format -specific files (eg sunos.c). - -3.1.2.1 `aout_SIZE_swap_exec_header_in' -....................................... - -*Synopsis* - void aout_SIZE_swap_exec_header_in, - (bfd *abfd, - struct external_exec *bytes, - struct internal_exec *execp); - *Description* -Swap the information in an executable header RAW_BYTES taken from a raw -byte stream memory image into the internal exec header structure EXECP. - -3.1.2.2 `aout_SIZE_swap_exec_header_out' -........................................ - -*Synopsis* - void aout_SIZE_swap_exec_header_out - (bfd *abfd, - struct internal_exec *execp, - struct external_exec *raw_bytes); - *Description* -Swap the information in an internal exec header structure EXECP into -the buffer RAW_BYTES ready for writing to disk. - -3.1.2.3 `aout_SIZE_some_aout_object_p' -...................................... - -*Synopsis* - const bfd_target *aout_SIZE_some_aout_object_p - (bfd *abfd, - struct internal_exec *execp, - const bfd_target *(*callback_to_real_object_p) (bfd *)); - *Description* -Some a.out variant thinks that the file open in ABFD checking is an -a.out file. Do some more checking, and set up for access if it really -is. Call back to the calling environment's "finish up" function just -before returning, to handle any last-minute setup. - -3.1.2.4 `aout_SIZE_mkobject' -............................ - -*Synopsis* - bfd_boolean aout_SIZE_mkobject, (bfd *abfd); - *Description* -Initialize BFD ABFD for use with a.out files. - -3.1.2.5 `aout_SIZE_machine_type' -................................ - -*Synopsis* - enum machine_type aout_SIZE_machine_type - (enum bfd_architecture arch, - unsigned long machine, - bfd_boolean *unknown); - *Description* -Keep track of machine architecture and machine type for a.out's. Return -the `machine_type' for a particular architecture and machine, or -`M_UNKNOWN' if that exact architecture and machine can't be represented -in a.out format. - - If the architecture is understood, machine type 0 (default) is -always understood. - -3.1.2.6 `aout_SIZE_set_arch_mach' -................................. - -*Synopsis* - bfd_boolean aout_SIZE_set_arch_mach, - (bfd *, - enum bfd_architecture arch, - unsigned long machine); - *Description* -Set the architecture and the machine of the BFD ABFD to the values ARCH -and MACHINE. Verify that ABFD's format can support the architecture -required. - -3.1.2.7 `aout_SIZE_new_section_hook' -.................................... - -*Synopsis* - bfd_boolean aout_SIZE_new_section_hook, - (bfd *abfd, - asection *newsect); - *Description* -Called by the BFD in response to a `bfd_make_section' request. - - -File: bfd.info, Node: coff, Next: elf, Prev: aout, Up: BFD back ends - -3.2 coff backends -================= - -BFD supports a number of different flavours of coff format. The major -differences between formats are the sizes and alignments of fields in -structures on disk, and the occasional extra field. - - Coff in all its varieties is implemented with a few common files and -a number of implementation specific files. For example, The 88k bcs -coff format is implemented in the file `coff-m88k.c'. This file -`#include's `coff/m88k.h' which defines the external structure of the -coff format for the 88k, and `coff/internal.h' which defines the -internal structure. `coff-m88k.c' also defines the relocations used by -the 88k format *Note Relocations::. - - The Intel i960 processor version of coff is implemented in -`coff-i960.c'. This file has the same structure as `coff-m88k.c', -except that it includes `coff/i960.h' rather than `coff-m88k.h'. - -3.2.1 Porting to a new version of coff --------------------------------------- - -The recommended method is to select from the existing implementations -the version of coff which is most like the one you want to use. For -example, we'll say that i386 coff is the one you select, and that your -coff flavour is called foo. Copy `i386coff.c' to `foocoff.c', copy -`../include/coff/i386.h' to `../include/coff/foo.h', and add the lines -to `targets.c' and `Makefile.in' so that your new back end is used. -Alter the shapes of the structures in `../include/coff/foo.h' so that -they match what you need. You will probably also have to add `#ifdef's -to the code in `coff/internal.h' and `coffcode.h' if your version of -coff is too wild. - - You can verify that your new BFD backend works quite simply by -building `objdump' from the `binutils' directory, and making sure that -its version of what's going on and your host system's idea (assuming it -has the pretty standard coff dump utility, usually called `att-dump' or -just `dump') are the same. Then clean up your code, and send what -you've done to Cygnus. Then your stuff will be in the next release, and -you won't have to keep integrating it. - -3.2.2 How the coff backend works --------------------------------- - -3.2.2.1 File layout -................... - -The Coff backend is split into generic routines that are applicable to -any Coff target and routines that are specific to a particular target. -The target-specific routines are further split into ones which are -basically the same for all Coff targets except that they use the -external symbol format or use different values for certain constants. - - The generic routines are in `coffgen.c'. These routines work for -any Coff target. They use some hooks into the target specific code; -the hooks are in a `bfd_coff_backend_data' structure, one of which -exists for each target. - - The essentially similar target-specific routines are in -`coffcode.h'. This header file includes executable C code. The -various Coff targets first include the appropriate Coff header file, -make any special defines that are needed, and then include `coffcode.h'. - - Some of the Coff targets then also have additional routines in the -target source file itself. - - For example, `coff-i960.c' includes `coff/internal.h' and -`coff/i960.h'. It then defines a few constants, such as `I960', and -includes `coffcode.h'. Since the i960 has complex relocation types, -`coff-i960.c' also includes some code to manipulate the i960 relocs. -This code is not in `coffcode.h' because it would not be used by any -other target. - -3.2.2.2 Bit twiddling -..................... - -Each flavour of coff supported in BFD has its own header file -describing the external layout of the structures. There is also an -internal description of the coff layout, in `coff/internal.h'. A major -function of the coff backend is swapping the bytes and twiddling the -bits to translate the external form of the structures into the normal -internal form. This is all performed in the `bfd_swap'_thing_direction -routines. Some elements are different sizes between different versions -of coff; it is the duty of the coff version specific include file to -override the definitions of various packing routines in `coffcode.h'. -E.g., the size of line number entry in coff is sometimes 16 bits, and -sometimes 32 bits. `#define'ing `PUT_LNSZ_LNNO' and `GET_LNSZ_LNNO' -will select the correct one. No doubt, some day someone will find a -version of coff which has a varying field size not catered to at the -moment. To port BFD, that person will have to add more `#defines'. -Three of the bit twiddling routines are exported to `gdb'; -`coff_swap_aux_in', `coff_swap_sym_in' and `coff_swap_lineno_in'. `GDB' -reads the symbol table on its own, but uses BFD to fix things up. More -of the bit twiddlers are exported for `gas'; `coff_swap_aux_out', -`coff_swap_sym_out', `coff_swap_lineno_out', `coff_swap_reloc_out', -`coff_swap_filehdr_out', `coff_swap_aouthdr_out', -`coff_swap_scnhdr_out'. `Gas' currently keeps track of all the symbol -table and reloc drudgery itself, thereby saving the internal BFD -overhead, but uses BFD to swap things on the way out, making cross -ports much safer. Doing so also allows BFD (and thus the linker) to -use the same header files as `gas', which makes one avenue to disaster -disappear. - -3.2.2.3 Symbol reading -...................... - -The simple canonical form for symbols used by BFD is not rich enough to -keep all the information available in a coff symbol table. The back end -gets around this problem by keeping the original symbol table around, -"behind the scenes". - - When a symbol table is requested (through a call to -`bfd_canonicalize_symtab'), a request gets through to -`coff_get_normalized_symtab'. This reads the symbol table from the coff -file and swaps all the structures inside into the internal form. It -also fixes up all the pointers in the table (represented in the file by -offsets from the first symbol in the table) into physical pointers to -elements in the new internal table. This involves some work since the -meanings of fields change depending upon context: a field that is a -pointer to another structure in the symbol table at one moment may be -the size in bytes of a structure at the next. Another pass is made -over the table. All symbols which mark file names (`C_FILE' symbols) -are modified so that the internal string points to the value in the -auxent (the real filename) rather than the normal text associated with -the symbol (`".file"'). - - At this time the symbol names are moved around. Coff stores all -symbols less than nine characters long physically within the symbol -table; longer strings are kept at the end of the file in the string -table. This pass moves all strings into memory and replaces them with -pointers to the strings. - - The symbol table is massaged once again, this time to create the -canonical table used by the BFD application. Each symbol is inspected -in turn, and a decision made (using the `sclass' field) about the -various flags to set in the `asymbol'. *Note Symbols::. The generated -canonical table shares strings with the hidden internal symbol table. - - Any linenumbers are read from the coff file too, and attached to the -symbols which own the functions the linenumbers belong to. - -3.2.2.4 Symbol writing -...................... - -Writing a symbol to a coff file which didn't come from a coff file will -lose any debugging information. The `asymbol' structure remembers the -BFD from which the symbol was taken, and on output the back end makes -sure that the same destination target as source target is present. - - When the symbols have come from a coff file then all the debugging -information is preserved. - - Symbol tables are provided for writing to the back end in a vector -of pointers to pointers. This allows applications like the linker to -accumulate and output large symbol tables without having to do too much -byte copying. - - This function runs through the provided symbol table and patches -each symbol marked as a file place holder (`C_FILE') to point to the -next file place holder in the list. It also marks each `offset' field -in the list with the offset from the first symbol of the current symbol. - - Another function of this procedure is to turn the canonical value -form of BFD into the form used by coff. Internally, BFD expects symbol -values to be offsets from a section base; so a symbol physically at -0x120, but in a section starting at 0x100, would have the value 0x20. -Coff expects symbols to contain their final value, so symbols have -their values changed at this point to reflect their sum with their -owning section. This transformation uses the `output_section' field of -the `asymbol''s `asection' *Note Sections::. - - * `coff_mangle_symbols' - This routine runs though the provided symbol table and uses the -offsets generated by the previous pass and the pointers generated when -the symbol table was read in to create the structured hierarchy -required by coff. It changes each pointer to a symbol into the index -into the symbol table of the asymbol. - - * `coff_write_symbols' - This routine runs through the symbol table and patches up the -symbols from their internal form into the coff way, calls the bit -twiddlers, and writes out the table to the file. - -3.2.2.5 `coff_symbol_type' -.......................... - -*Description* -The hidden information for an `asymbol' is described in a -`combined_entry_type': - - - typedef struct coff_ptr_struct - { - /* Remembers the offset from the first symbol in the file for - this symbol. Generated by coff_renumber_symbols. */ - unsigned int offset; - - /* Should the value of this symbol be renumbered. Used for - XCOFF C_BSTAT symbols. Set by coff_slurp_symbol_table. */ - unsigned int fix_value : 1; - - /* Should the tag field of this symbol be renumbered. - Created by coff_pointerize_aux. */ - unsigned int fix_tag : 1; - - /* Should the endidx field of this symbol be renumbered. - Created by coff_pointerize_aux. */ - unsigned int fix_end : 1; - - /* Should the x_csect.x_scnlen field be renumbered. - Created by coff_pointerize_aux. */ - unsigned int fix_scnlen : 1; - - /* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the - index into the line number entries. Set by coff_slurp_symbol_table. */ - unsigned int fix_line : 1; - - /* The container for the symbol structure as read and translated - from the file. */ - union - { - union internal_auxent auxent; - struct internal_syment syment; - } u; - } combined_entry_type; - - - /* Each canonical asymbol really looks like this: */ - - typedef struct coff_symbol_struct - { - /* The actual symbol which the rest of BFD works with */ - asymbol symbol; - - /* A pointer to the hidden information for this symbol */ - combined_entry_type *native; - - /* A pointer to the linenumber information for this symbol */ - struct lineno_cache_entry *lineno; - - /* Have the line numbers been relocated yet ? */ - bfd_boolean done_lineno; - } coff_symbol_type; - -3.2.2.6 `bfd_coff_backend_data' -............................... - - /* COFF symbol classifications. */ - - enum coff_symbol_classification - { - /* Global symbol. */ - COFF_SYMBOL_GLOBAL, - /* Common symbol. */ - COFF_SYMBOL_COMMON, - /* Undefined symbol. */ - COFF_SYMBOL_UNDEFINED, - /* Local symbol. */ - COFF_SYMBOL_LOCAL, - /* PE section symbol. */ - COFF_SYMBOL_PE_SECTION - }; -Special entry points for gdb to swap in coff symbol table parts: - typedef struct - { - void (*_bfd_coff_swap_aux_in) - (bfd *, void *, int, int, int, int, void *); - - void (*_bfd_coff_swap_sym_in) - (bfd *, void *, void *); - - void (*_bfd_coff_swap_lineno_in) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_aux_out) - (bfd *, void *, int, int, int, int, void *); - - unsigned int (*_bfd_coff_swap_sym_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_lineno_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_reloc_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_filehdr_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_aouthdr_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_scnhdr_out) - (bfd *, void *, void *); - - unsigned int _bfd_filhsz; - unsigned int _bfd_aoutsz; - unsigned int _bfd_scnhsz; - unsigned int _bfd_symesz; - unsigned int _bfd_auxesz; - unsigned int _bfd_relsz; - unsigned int _bfd_linesz; - unsigned int _bfd_filnmlen; - bfd_boolean _bfd_coff_long_filenames; - bfd_boolean _bfd_coff_long_section_names; - unsigned int _bfd_coff_default_section_alignment_power; - bfd_boolean _bfd_coff_force_symnames_in_strings; - unsigned int _bfd_coff_debug_string_prefix_length; - - void (*_bfd_coff_swap_filehdr_in) - (bfd *, void *, void *); - - void (*_bfd_coff_swap_aouthdr_in) - (bfd *, void *, void *); - - void (*_bfd_coff_swap_scnhdr_in) - (bfd *, void *, void *); - - void (*_bfd_coff_swap_reloc_in) - (bfd *abfd, void *, void *); - - bfd_boolean (*_bfd_coff_bad_format_hook) - (bfd *, void *); - - bfd_boolean (*_bfd_coff_set_arch_mach_hook) - (bfd *, void *); - - void * (*_bfd_coff_mkobject_hook) - (bfd *, void *, void *); - - bfd_boolean (*_bfd_styp_to_sec_flags_hook) - (bfd *, void *, const char *, asection *, flagword *); - - void (*_bfd_set_alignment_hook) - (bfd *, asection *, void *); - - bfd_boolean (*_bfd_coff_slurp_symbol_table) - (bfd *); - - bfd_boolean (*_bfd_coff_symname_in_debug) - (bfd *, struct internal_syment *); - - bfd_boolean (*_bfd_coff_pointerize_aux_hook) - (bfd *, combined_entry_type *, combined_entry_type *, - unsigned int, combined_entry_type *); - - bfd_boolean (*_bfd_coff_print_aux) - (bfd *, FILE *, combined_entry_type *, combined_entry_type *, - combined_entry_type *, unsigned int); - - void (*_bfd_coff_reloc16_extra_cases) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *, - bfd_byte *, unsigned int *, unsigned int *); - - int (*_bfd_coff_reloc16_estimate) - (bfd *, asection *, arelent *, unsigned int, - struct bfd_link_info *); - - enum coff_symbol_classification (*_bfd_coff_classify_symbol) - (bfd *, struct internal_syment *); - - bfd_boolean (*_bfd_coff_compute_section_file_positions) - (bfd *); - - bfd_boolean (*_bfd_coff_start_final_link) - (bfd *, struct bfd_link_info *); - - bfd_boolean (*_bfd_coff_relocate_section) - (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, - struct internal_reloc *, struct internal_syment *, asection **); - - reloc_howto_type *(*_bfd_coff_rtype_to_howto) - (bfd *, asection *, struct internal_reloc *, - struct coff_link_hash_entry *, struct internal_syment *, - bfd_vma *); - - bfd_boolean (*_bfd_coff_adjust_symndx) - (bfd *, struct bfd_link_info *, bfd *, asection *, - struct internal_reloc *, bfd_boolean *); - - bfd_boolean (*_bfd_coff_link_add_one_symbol) - (struct bfd_link_info *, bfd *, const char *, flagword, - asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean, - struct bfd_link_hash_entry **); - - bfd_boolean (*_bfd_coff_link_output_has_begun) - (bfd *, struct coff_final_link_info *); - - bfd_boolean (*_bfd_coff_final_link_postscript) - (bfd *, struct coff_final_link_info *); - - } bfd_coff_backend_data; - - #define coff_backend_info(abfd) \ - ((bfd_coff_backend_data *) (abfd)->xvec->backend_data) - - #define bfd_coff_swap_aux_in(a,e,t,c,ind,num,i) \ - ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i)) - - #define bfd_coff_swap_sym_in(a,e,i) \ - ((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i)) - - #define bfd_coff_swap_lineno_in(a,e,i) \ - ((coff_backend_info ( a)->_bfd_coff_swap_lineno_in) (a,e,i)) - - #define bfd_coff_swap_reloc_out(abfd, i, o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_out) (abfd, i, o)) - - #define bfd_coff_swap_lineno_out(abfd, i, o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o)) - - #define bfd_coff_swap_aux_out(a,i,t,c,ind,num,o) \ - ((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o)) - - #define bfd_coff_swap_sym_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o)) - - #define bfd_coff_swap_scnhdr_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_out) (abfd, i, o)) - - #define bfd_coff_swap_filehdr_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_out) (abfd, i, o)) - - #define bfd_coff_swap_aouthdr_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_out) (abfd, i, o)) - - #define bfd_coff_filhsz(abfd) (coff_backend_info (abfd)->_bfd_filhsz) - #define bfd_coff_aoutsz(abfd) (coff_backend_info (abfd)->_bfd_aoutsz) - #define bfd_coff_scnhsz(abfd) (coff_backend_info (abfd)->_bfd_scnhsz) - #define bfd_coff_symesz(abfd) (coff_backend_info (abfd)->_bfd_symesz) - #define bfd_coff_auxesz(abfd) (coff_backend_info (abfd)->_bfd_auxesz) - #define bfd_coff_relsz(abfd) (coff_backend_info (abfd)->_bfd_relsz) - #define bfd_coff_linesz(abfd) (coff_backend_info (abfd)->_bfd_linesz) - #define bfd_coff_filnmlen(abfd) (coff_backend_info (abfd)->_bfd_filnmlen) - #define bfd_coff_long_filenames(abfd) \ - (coff_backend_info (abfd)->_bfd_coff_long_filenames) - #define bfd_coff_long_section_names(abfd) \ - (coff_backend_info (abfd)->_bfd_coff_long_section_names) - #define bfd_coff_default_section_alignment_power(abfd) \ - (coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power) - #define bfd_coff_swap_filehdr_in(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o)) - - #define bfd_coff_swap_aouthdr_in(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_in) (abfd, i, o)) - - #define bfd_coff_swap_scnhdr_in(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_in) (abfd, i, o)) - - #define bfd_coff_swap_reloc_in(abfd, i, o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_in) (abfd, i, o)) - - #define bfd_coff_bad_format_hook(abfd, filehdr) \ - ((coff_backend_info (abfd)->_bfd_coff_bad_format_hook) (abfd, filehdr)) - - #define bfd_coff_set_arch_mach_hook(abfd, filehdr)\ - ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr)) - #define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\ - ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook)\ - (abfd, filehdr, aouthdr)) - - #define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section, flags_ptr)\ - ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\ - (abfd, scnhdr, name, section, flags_ptr)) - - #define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\ - ((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr)) - - #define bfd_coff_slurp_symbol_table(abfd)\ - ((coff_backend_info (abfd)->_bfd_coff_slurp_symbol_table) (abfd)) - - #define bfd_coff_symname_in_debug(abfd, sym)\ - ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym)) - - #define bfd_coff_force_symnames_in_strings(abfd)\ - (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings) - - #define bfd_coff_debug_string_prefix_length(abfd)\ - (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length) - - #define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\ - ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ - (abfd, file, base, symbol, aux, indaux)) - - #define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order,\ - reloc, data, src_ptr, dst_ptr)\ - ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\ - (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)) - - #define bfd_coff_reloc16_estimate(abfd, section, reloc, shrink, link_info)\ - ((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\ - (abfd, section, reloc, shrink, link_info)) - - #define bfd_coff_classify_symbol(abfd, sym)\ - ((coff_backend_info (abfd)->_bfd_coff_classify_symbol)\ - (abfd, sym)) - - #define bfd_coff_compute_section_file_positions(abfd)\ - ((coff_backend_info (abfd)->_bfd_coff_compute_section_file_positions)\ - (abfd)) - - #define bfd_coff_start_final_link(obfd, info)\ - ((coff_backend_info (obfd)->_bfd_coff_start_final_link)\ - (obfd, info)) - #define bfd_coff_relocate_section(obfd,info,ibfd,o,con,rel,isyms,secs)\ - ((coff_backend_info (ibfd)->_bfd_coff_relocate_section)\ - (obfd, info, ibfd, o, con, rel, isyms, secs)) - #define bfd_coff_rtype_to_howto(abfd, sec, rel, h, sym, addendp)\ - ((coff_backend_info (abfd)->_bfd_coff_rtype_to_howto)\ - (abfd, sec, rel, h, sym, addendp)) - #define bfd_coff_adjust_symndx(obfd, info, ibfd, sec, rel, adjustedp)\ - ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\ - (obfd, info, ibfd, sec, rel, adjustedp)) - #define bfd_coff_link_add_one_symbol(info, abfd, name, flags, section,\ - value, string, cp, coll, hashp)\ - ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\ - (info, abfd, name, flags, section, value, string, cp, coll, hashp)) - - #define bfd_coff_link_output_has_begun(a,p) \ - ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a, p)) - #define bfd_coff_final_link_postscript(a,p) \ - ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a, p)) - -3.2.2.7 Writing relocations -........................... - -To write relocations, the back end steps though the canonical -relocation table and create an `internal_reloc'. The symbol index to -use is removed from the `offset' field in the symbol table supplied. -The address comes directly from the sum of the section base address and -the relocation offset; the type is dug directly from the howto field. -Then the `internal_reloc' is swapped into the shape of an -`external_reloc' and written out to disk. - -3.2.2.8 Reading linenumbers -........................... - -Creating the linenumber table is done by reading in the entire coff -linenumber table, and creating another table for internal use. - - A coff linenumber table is structured so that each function is -marked as having a line number of 0. Each line within the function is -an offset from the first line in the function. The base of the line -number information for the table is stored in the symbol associated -with the function. - - Note: The PE format uses line number 0 for a flag indicating a new -source file. - - The information is copied from the external to the internal table, -and each symbol which marks a function is marked by pointing its... - - How does this work ? - -3.2.2.9 Reading relocations -........................... - -Coff relocations are easily transformed into the internal BFD form -(`arelent'). - - Reading a coff relocation table is done in the following stages: - - * Read the entire coff relocation table into memory. - - * Process each relocation in turn; first swap it from the external - to the internal form. - - * Turn the symbol referenced in the relocation's symbol index into a - pointer into the canonical symbol table. This table is the same - as the one returned by a call to `bfd_canonicalize_symtab'. The - back end will call that routine and save the result if a - canonicalization hasn't been done. - - * The reloc index is turned into a pointer to a howto structure, in - a back end specific way. For instance, the 386 and 960 use the - `r_type' to directly produce an index into a howto table vector; - the 88k subtracts a number from the `r_type' field and creates an - addend field. - - -File: bfd.info, Node: elf, Next: mmo, Prev: coff, Up: BFD back ends - -3.3 ELF backends -================ - -BFD support for ELF formats is being worked on. Currently, the best -supported back ends are for sparc and i386 (running svr4 or Solaris 2). - - Documentation of the internals of the support code still needs to be -written. The code is changing quickly enough that we haven't bothered -yet. - -3.3.0.1 `bfd_elf_find_section' -.............................. - -*Synopsis* - struct elf_internal_shdr *bfd_elf_find_section (bfd *abfd, char *name); - *Description* -Helper functions for GDB to locate the string tables. Since BFD hides -string tables from callers, GDB needs to use an internal hook to find -them. Sun's .stabstr, in particular, isn't even pointed to by the -.stab section, so ordinary mechanisms wouldn't work to find it, even if -we had some. - - -File: bfd.info, Node: mmo, Prev: elf, Up: BFD back ends - -3.4 mmo backend -=============== - -The mmo object format is used exclusively together with Professor -Donald E. Knuth's educational 64-bit processor MMIX. The simulator -`mmix' which is available at -`http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz' -understands this format. That package also includes a combined -assembler and linker called `mmixal'. The mmo format has no advantages -feature-wise compared to e.g. ELF. It is a simple non-relocatable -object format with no support for archives or debugging information, -except for symbol value information and line numbers (which is not yet -implemented in BFD). See -`http://www-cs-faculty.stanford.edu/~knuth/mmix.html' for more -information about MMIX. The ELF format is used for intermediate object -files in the BFD implementation. - -* Menu: - -* File layout:: -* Symbol-table:: -* mmo section mapping:: - - -File: bfd.info, Node: File layout, Next: Symbol-table, Prev: mmo, Up: mmo - -3.4.1 File layout ------------------ - -The mmo file contents is not partitioned into named sections as with -e.g. ELF. Memory areas is formed by specifying the location of the -data that follows. Only the memory area `0x0000...00' to `0x01ff...ff' -is executable, so it is used for code (and constants) and the area -`0x2000...00' to `0x20ff...ff' is used for writable data. *Note mmo -section mapping::. - - There is provision for specifying "special data" of 65536 different -types. We use type 80 (decimal), arbitrarily chosen the same as the -ELF `e_machine' number for MMIX, filling it with section information -normally found in ELF objects. *Note mmo section mapping::. - - Contents is entered as 32-bit words, xor:ed over previous contents, -always zero-initialized. A word that starts with the byte `0x98' forms -a command called a `lopcode', where the next byte distinguished between -the thirteen lopcodes. The two remaining bytes, called the `Y' and `Z' -fields, or the `YZ' field (a 16-bit big-endian number), are used for -various purposes different for each lopcode. As documented in -`http://www-cs-faculty.stanford.edu/~knuth/mmixal-intro.ps.gz', the -lopcodes are: - -`lop_quote' - 0x98000001. The next word is contents, regardless of whether it - starts with 0x98 or not. - -`lop_loc' - 0x9801YYZZ, where `Z' is 1 or 2. This is a location directive, - setting the location for the next data to the next 32-bit word - (for Z = 1) or 64-bit word (for Z = 2), plus Y * 2^56. Normally - `Y' is 0 for the text segment and 2 for the data segment. - -`lop_skip' - 0x9802YYZZ. Increase the current location by `YZ' bytes. - -`lop_fixo' - 0x9803YYZZ, where `Z' is 1 or 2. Store the current location as 64 - bits into the location pointed to by the next 32-bit (Z = 1) or - 64-bit (Z = 2) word, plus Y * 2^56. - -`lop_fixr' - 0x9804YYZZ. `YZ' is stored into the current location plus 2 - 4 * - YZ. - -`lop_fixrx' - 0x980500ZZ. `Z' is 16 or 24. A value `L' derived from the - following 32-bit word are used in a manner similar to `YZ' in - lop_fixr: it is xor:ed into the current location minus 4 * L. The - first byte of the word is 0 or 1. If it is 1, then L = (LOWEST 24 - BITS OF WORD) - 2^Z, if 0, then L = (LOWEST 24 BITS OF WORD). - -`lop_file' - 0x9806YYZZ. `Y' is the file number, `Z' is count of 32-bit words. - Set the file number to `Y' and the line counter to 0. The next Z - * 4 bytes contain the file name, padded with zeros if the count is - not a multiple of four. The same `Y' may occur multiple times, - but `Z' must be 0 for all but the first occurrence. - -`lop_line' - 0x9807YYZZ. `YZ' is the line number. Together with lop_file, it - forms the source location for the next 32-bit word. Note that for - each non-lopcode 32-bit word, line numbers are assumed incremented - by one. - -`lop_spec' - 0x9808YYZZ. `YZ' is the type number. Data until the next lopcode - other than lop_quote forms special data of type `YZ'. *Note mmo - section mapping::. - - Other types than 80, (or type 80 with a content that does not - parse) is stored in sections named `.MMIX.spec_data.N' where N is - the `YZ'-type. The flags for such a sections say not to allocate - or load the data. The vma is 0. Contents of multiple occurrences - of special data N is concatenated to the data of the previous - lop_spec Ns. The location in data or code at which the lop_spec - occurred is lost. - -`lop_pre' - 0x980901ZZ. The first lopcode in a file. The `Z' field forms the - length of header information in 32-bit words, where the first word - tells the time in seconds since `00:00:00 GMT Jan 1 1970'. - -`lop_post' - 0x980a00ZZ. Z > 32. This lopcode follows after all - content-generating lopcodes in a program. The `Z' field denotes - the value of `rG' at the beginning of the program. The following - 256 - Z big-endian 64-bit words are loaded into global registers - `$G' ... `$255'. - -`lop_stab' - 0x980b0000. The next-to-last lopcode in a program. Must follow - immediately after the lop_post lopcode and its data. After this - lopcode follows all symbols in a compressed format (*note - Symbol-table::). - -`lop_end' - 0x980cYYZZ. The last lopcode in a program. It must follow the - lop_stab lopcode and its data. The `YZ' field contains the number - of 32-bit words of symbol table information after the preceding - lop_stab lopcode. - - Note that the lopcode "fixups"; `lop_fixr', `lop_fixrx' and -`lop_fixo' are not generated by BFD, but are handled. They are -generated by `mmixal'. - - This trivial one-label, one-instruction file: - - :Main TRAP 1,2,3 - - can be represented this way in mmo: - - 0x98090101 - lop_pre, one 32-bit word with timestamp. - - 0x98010002 - lop_loc, text segment, using a 64-bit address. - Note that mmixal does not emit this for the file above. - 0x00000000 - Address, high 32 bits. - 0x00000000 - Address, low 32 bits. - 0x98060002 - lop_file, 2 32-bit words for file-name. - 0x74657374 - "test" - 0x2e730000 - ".s\0\0" - 0x98070001 - lop_line, line 1. - 0x00010203 - TRAP 1,2,3 - 0x980a00ff - lop_post, setting $255 to 0. - 0x00000000 - 0x00000000 - 0x980b0000 - lop_stab for ":Main" = 0, serial 1. - 0x203a4040 *Note Symbol-table::. - 0x10404020 - 0x4d206120 - 0x69016e00 - 0x81000000 - 0x980c0005 - lop_end; symbol table contained five 32-bit words. - - -File: bfd.info, Node: Symbol-table, Next: mmo section mapping, Prev: File layout, Up: mmo - -3.4.2 Symbol table format -------------------------- - -From mmixal.w (or really, the generated mmixal.tex) in -`http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz'): -"Symbols are stored and retrieved by means of a `ternary search trie', -following ideas of Bentley and Sedgewick. (See ACM-SIAM Symp. on -Discrete Algorithms `8' (1997), 360-369; R.Sedgewick, `Algorithms in C' -(Reading, Mass. Addison-Wesley, 1998), `15.4'.) Each trie node stores -a character, and there are branches to subtries for the cases where a -given character is less than, equal to, or greater than the character -in the trie. There also is a pointer to a symbol table entry if a -symbol ends at the current node." - - So it's a tree encoded as a stream of bytes. The stream of bytes -acts on a single virtual global symbol, adding and removing characters -and signalling complete symbol points. Here, we read the stream and -create symbols at the completion points. - - First, there's a control byte `m'. If any of the listed bits in `m' -is nonzero, we execute what stands at the right, in the listed order: - - (MMO3_LEFT) - 0x40 - Traverse left trie. - (Read a new command byte and recurse.) - - (MMO3_SYMBITS) - 0x2f - Read the next byte as a character and store it in the - current character position; increment character position. - Test the bits of `m': - - (MMO3_WCHAR) - 0x80 - The character is 16-bit (so read another byte, - merge into current character. - - (MMO3_TYPEBITS) - 0xf - We have a complete symbol; parse the type, value - and serial number and do what should be done - with a symbol. The type and length information - is in j = (m & 0xf). - - (MMO3_REGQUAL_BITS) - j == 0xf: A register variable. The following - byte tells which register. - j <= 8: An absolute symbol. Read j bytes as the - big-endian number the symbol equals. - A j = 2 with two zero bytes denotes an - unknown symbol. - j > 8: As with j <= 8, but add (0x20 << 56) - to the value in the following j - 8 - bytes. - - Then comes the serial number, as a variant of - uleb128, but better named ubeb128: - Read bytes and shift the previous value left 7 - (multiply by 128). Add in the new byte, repeat - until a byte has bit 7 set. The serial number - is the computed value minus 128. - - (MMO3_MIDDLE) - 0x20 - Traverse middle trie. (Read a new command byte - and recurse.) Decrement character position. - - (MMO3_RIGHT) - 0x10 - Traverse right trie. (Read a new command byte and - recurse.) - - Let's look again at the `lop_stab' for the trivial file (*note File -layout::). - - 0x980b0000 - lop_stab for ":Main" = 0, serial 1. - 0x203a4040 - 0x10404020 - 0x4d206120 - 0x69016e00 - 0x81000000 - - This forms the trivial trie (note that the path between ":" and "M" -is redundant): - - 203a ":" - 40 / - 40 / - 10 \ - 40 / - 40 / - 204d "M" - 2061 "a" - 2069 "i" - 016e "n" is the last character in a full symbol, and - with a value represented in one byte. - 00 The value is 0. - 81 The serial number is 1. - - -File: bfd.info, Node: mmo section mapping, Prev: Symbol-table, Up: mmo - -3.4.3 mmo section mapping -------------------------- - -The implementation in BFD uses special data type 80 (decimal) to -encapsulate and describe named sections, containing e.g. debug -information. If needed, any datum in the encapsulation will be quoted -using lop_quote. First comes a 32-bit word holding the number of -32-bit words containing the zero-terminated zero-padded segment name. -After the name there's a 32-bit word holding flags describing the -section type. Then comes a 64-bit big-endian word with the section -length (in bytes), then another with the section start address. -Depending on the type of section, the contents might follow, -zero-padded to 32-bit boundary. For a loadable section (such as data -or code), the contents might follow at some later point, not -necessarily immediately, as a lop_loc with the same start address as in -the section description, followed by the contents. This in effect -forms a descriptor that must be emitted before the actual contents. -Sections described this way must not overlap. - - For areas that don't have such descriptors, synthetic sections are -formed by BFD. Consecutive contents in the two memory areas -`0x0000...00' to `0x01ff...ff' and `0x2000...00' to `0x20ff...ff' are -entered in sections named `.text' and `.data' respectively. If an area -is not otherwise described, but would together with a neighboring lower -area be less than `0x40000000' bytes long, it is joined with the lower -area and the gap is zero-filled. For other cases, a new section is -formed, named `.MMIX.sec.N'. Here, N is a number, a running count -through the mmo file, starting at 0. - - A loadable section specified as: - - .section secname,"ax" - TETRA 1,2,3,4,-1,-2009 - BYTE 80 - - and linked to address `0x4', is represented by the sequence: - - 0x98080050 - lop_spec 80 - 0x00000002 - two 32-bit words for the section name - 0x7365636e - "secn" - 0x616d6500 - "ame\0" - 0x00000033 - flags CODE, READONLY, LOAD, ALLOC - 0x00000000 - high 32 bits of section length - 0x0000001c - section length is 28 bytes; 6 * 4 + 1 + alignment to 32 bits - 0x00000000 - high 32 bits of section address - 0x00000004 - section address is 4 - 0x98010002 - 64 bits with address of following data - 0x00000000 - high 32 bits of address - 0x00000004 - low 32 bits: data starts at address 4 - 0x00000001 - 1 - 0x00000002 - 2 - 0x00000003 - 3 - 0x00000004 - 4 - 0xffffffff - -1 - 0xfffff827 - -2009 - 0x50000000 - 80 as a byte, padded with zeros. - - Note that the lop_spec wrapping does not include the section -contents. Compare this to a non-loaded section specified as: - - .section thirdsec - TETRA 200001,100002 - BYTE 38,40 - - This, when linked to address `0x200000000000001c', is represented by: - - 0x98080050 - lop_spec 80 - 0x00000002 - two 32-bit words for the section name - 0x7365636e - "thir" - 0x616d6500 - "dsec" - 0x00000010 - flag READONLY - 0x00000000 - high 32 bits of section length - 0x0000000c - section length is 12 bytes; 2 * 4 + 2 + alignment to 32 bits - 0x20000000 - high 32 bits of address - 0x0000001c - low 32 bits of address 0x200000000000001c - 0x00030d41 - 200001 - 0x000186a2 - 100002 - 0x26280000 - 38, 40 as bytes, padded with zeros - - For the latter example, the section contents must not be loaded in -memory, and is therefore specified as part of the special data. The -address is usually unimportant but might provide information for e.g. -the DWARF 2 debugging format. - - -File: bfd.info, Node: GNU Free Documentation License, Next: Index, Prev: BFD back ends, Up: Top - -Appendix A GNU Free Documentation License -***************************************** - - Version 1.1, March 2000 - - Copyright (C) 2000, 2003 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - 0. PREAMBLE - - The purpose of this License is to make a manual, textbook, or other - written document "free" in the sense of freedom: to assure everyone - the effective freedom to copy and redistribute it, with or without - modifying it, either commercially or noncommercially. Secondarily, - this License preserves for the author and publisher a way to get - credit for their work, while not being considered responsible for - modifications made by others. - - This License is a kind of "copyleft", which means that derivative - works of the document must themselves be free in the same sense. - It complements the GNU General Public License, which is a copyleft - license designed for free software. - - We have designed this License in order to use it for manuals for - free software, because free software needs free documentation: a - free program should come with manuals providing the same freedoms - that the software does. But this License is not limited to - software manuals; it can be used for any textual work, regardless - of subject matter or whether it is published as a printed book. - We recommend this License principally for works whose purpose is - instruction or reference. - - - 1. APPLICABILITY AND DEFINITIONS - - This License applies to any manual or other work that contains a - notice placed by the copyright holder saying it can be distributed - under the terms of this License. The "Document", below, refers to - any such manual or work. Any member of the public is a licensee, - and is addressed as "you." - - A "Modified Version" of the Document means any work containing the - Document or a portion of it, either copied verbatim, or with - modifications and/or translated into another language. - - A "Secondary Section" is a named appendix or a front-matter - section of the Document that deals exclusively with the - relationship of the publishers or authors of the Document to the - Document's overall subject (or to related matters) and contains - nothing that could fall directly within that overall subject. - (For example, if the Document is in part a textbook of - mathematics, a Secondary Section may not explain any mathematics.) - The relationship could be a matter of historical connection with - the subject or with related matters, or of legal, commercial, - philosophical, ethical or political position regarding them. - - The "Invariant Sections" are certain Secondary Sections whose - titles are designated, as being those of Invariant Sections, in - the notice that says that the Document is released under this - License. - - The "Cover Texts" are certain short passages of text that are - listed, as Front-Cover Texts or Back-Cover Texts, in the notice - that says that the Document is released under this License. - - A "Transparent" copy of the Document means a machine-readable copy, - represented in a format whose specification is available to the - general public, whose contents can be viewed and edited directly - and straightforwardly with generic text editors or (for images - composed of pixels) generic paint programs or (for drawings) some - widely available drawing editor, and that is suitable for input to - text formatters or for automatic translation to a variety of - formats suitable for input to text formatters. A copy made in an - otherwise Transparent file format whose markup has been designed - to thwart or discourage subsequent modification by readers is not - Transparent. A copy that is not "Transparent" is called "Opaque." - - Examples of suitable formats for Transparent copies include plain - ASCII without markup, Texinfo input format, LaTeX input format, - SGML or XML using a publicly available DTD, and - standard-conforming simple HTML designed for human modification. - Opaque formats include PostScript, PDF, proprietary formats that - can be read and edited only by proprietary word processors, SGML - or XML for which the DTD and/or processing tools are not generally - available, and the machine-generated HTML produced by some word - processors for output purposes only. - - The "Title Page" means, for a printed book, the title page itself, - plus such following pages as are needed to hold, legibly, the - material this License requires to appear in the title page. For - works in formats which do not have any title page as such, "Title - Page" means the text near the most prominent appearance of the - work's title, preceding the beginning of the body of the text. - - 2. VERBATIM COPYING - - You may copy and distribute the Document in any medium, either - commercially or noncommercially, provided that this License, the - copyright notices, and the license notice saying this License - applies to the Document are reproduced in all copies, and that you - add no other conditions whatsoever to those of this License. You - may not use technical measures to obstruct or control the reading - or further copying of the copies you make or distribute. However, - you may accept compensation in exchange for copies. If you - distribute a large enough number of copies you must also follow - the conditions in section 3. - - You may also lend copies, under the same conditions stated above, - and you may publicly display copies. - - 3. COPYING IN QUANTITY - - If you publish printed copies of the Document numbering more than - 100, and the Document's license notice requires Cover Texts, you - must enclose the copies in covers that carry, clearly and legibly, - all these Cover Texts: Front-Cover Texts on the front cover, and - Back-Cover Texts on the back cover. Both covers must also clearly - and legibly identify you as the publisher of these copies. The - front cover must present the full title with all words of the - title equally prominent and visible. You may add other material - on the covers in addition. Copying with changes limited to the - covers, as long as they preserve the title of the Document and - satisfy these conditions, can be treated as verbatim copying in - other respects. - - If the required texts for either cover are too voluminous to fit - legibly, you should put the first ones listed (as many as fit - reasonably) on the actual cover, and continue the rest onto - adjacent pages. - - If you publish or distribute Opaque copies of the Document - numbering more than 100, you must either include a - machine-readable Transparent copy along with each Opaque copy, or - state in or with each Opaque copy a publicly-accessible - computer-network location containing a complete Transparent copy - of the Document, free of added material, which the general - network-using public has access to download anonymously at no - charge using public-standard network protocols. If you use the - latter option, you must take reasonably prudent steps, when you - begin distribution of Opaque copies in quantity, to ensure that - this Transparent copy will remain thus accessible at the stated - location until at least one year after the last time you - distribute an Opaque copy (directly or through your agents or - retailers) of that edition to the public. - - It is requested, but not required, that you contact the authors of - the Document well before redistributing any large number of - copies, to give them a chance to provide you with an updated - version of the Document. - - 4. MODIFICATIONS - - You may copy and distribute a Modified Version of the Document - under the conditions of sections 2 and 3 above, provided that you - release the Modified Version under precisely this License, with - the Modified Version filling the role of the Document, thus - licensing distribution and modification of the Modified Version to - whoever possesses a copy of it. In addition, you must do these - things in the Modified Version: - - A. Use in the Title Page (and on the covers, if any) a title - distinct from that of the Document, and from those of previous - versions (which should, if there were any, be listed in the - History section of the Document). You may use the same title - as a previous version if the original publisher of that version - gives permission. - B. List on the Title Page, as authors, one or more persons or - entities responsible for authorship of the modifications in the - Modified Version, together with at least five of the principal - authors of the Document (all of its principal authors, if it - has less than five). - C. State on the Title page the name of the publisher of the - Modified Version, as the publisher. - D. Preserve all the copyright notices of the Document. - E. Add an appropriate copyright notice for your modifications - adjacent to the other copyright notices. - F. Include, immediately after the copyright notices, a license - notice giving the public permission to use the Modified Version - under the terms of this License, in the form shown in the - Addendum below. - G. Preserve in that license notice the full lists of Invariant - Sections and required Cover Texts given in the Document's - license notice. - H. Include an unaltered copy of this License. - I. Preserve the section entitled "History", and its title, and add - to it an item stating at least the title, year, new authors, and - publisher of the Modified Version as given on the Title Page. - If there is no section entitled "History" in the Document, - create one stating the title, year, authors, and publisher of - the Document as given on its Title Page, then add an item - describing the Modified Version as stated in the previous - sentence. - J. Preserve the network location, if any, given in the Document for - public access to a Transparent copy of the Document, and - likewise the network locations given in the Document for - previous versions it was based on. These may be placed in the - "History" section. You may omit a network location for a work - that was published at least four years before the Document - itself, or if the original publisher of the version it refers - to gives permission. - K. In any section entitled "Acknowledgements" or "Dedications", - preserve the section's title, and preserve in the section all the - substance and tone of each of the contributor acknowledgements - and/or dedications given therein. - L. Preserve all the Invariant Sections of the Document, - unaltered in their text and in their titles. Section numbers - or the equivalent are not considered part of the section titles. - M. Delete any section entitled "Endorsements." Such a section - may not be included in the Modified Version. - N. Do not retitle any existing section as "Endorsements" or to - conflict in title with any Invariant Section. - - If the Modified Version includes new front-matter sections or - appendices that qualify as Secondary Sections and contain no - material copied from the Document, you may at your option - designate some or all of these sections as invariant. To do this, - add their titles to the list of Invariant Sections in the Modified - Version's license notice. These titles must be distinct from any - other section titles. - - You may add a section entitled "Endorsements", provided it contains - nothing but endorsements of your Modified Version by various - parties-for example, statements of peer review or that the text has - been approved by an organization as the authoritative definition - of a standard. - - You may add a passage of up to five words as a Front-Cover Text, - and a passage of up to 25 words as a Back-Cover Text, to the end - of the list of Cover Texts in the Modified Version. Only one - passage of Front-Cover Text and one of Back-Cover Text may be - added by (or through arrangements made by) any one entity. If the - Document already includes a cover text for the same cover, - previously added by you or by arrangement made by the same entity - you are acting on behalf of, you may not add another; but you may - replace the old one, on explicit permission from the previous - publisher that added the old one. - - The author(s) and publisher(s) of the Document do not by this - License give permission to use their names for publicity for or to - assert or imply endorsement of any Modified Version. - - 5. COMBINING DOCUMENTS - - You may combine the Document with other documents released under - this License, under the terms defined in section 4 above for - modified versions, provided that you include in the combination - all of the Invariant Sections of all of the original documents, - unmodified, and list them all as Invariant Sections of your - combined work in its license notice. - - The combined work need only contain one copy of this License, and - multiple identical Invariant Sections may be replaced with a single - copy. If there are multiple Invariant Sections with the same name - but different contents, make the title of each such section unique - by adding at the end of it, in parentheses, the name of the - original author or publisher of that section if known, or else a - unique number. Make the same adjustment to the section titles in - the list of Invariant Sections in the license notice of the - combined work. - - In the combination, you must combine any sections entitled - "History" in the various original documents, forming one section - entitled "History"; likewise combine any sections entitled - "Acknowledgements", and any sections entitled "Dedications." You - must delete all sections entitled "Endorsements." - - 6. COLLECTIONS OF DOCUMENTS - - You may make a collection consisting of the Document and other - documents released under this License, and replace the individual - copies of this License in the various documents with a single copy - that is included in the collection, provided that you follow the - rules of this License for verbatim copying of each of the - documents in all other respects. - - You may extract a single document from such a collection, and - distribute it individually under this License, provided you insert - a copy of this License into the extracted document, and follow - this License in all other respects regarding verbatim copying of - that document. - - 7. AGGREGATION WITH INDEPENDENT WORKS - - A compilation of the Document or its derivatives with other - separate and independent documents or works, in or on a volume of - a storage or distribution medium, does not as a whole count as a - Modified Version of the Document, provided no compilation - copyright is claimed for the compilation. Such a compilation is - called an "aggregate", and this License does not apply to the - other self-contained works thus compiled with the Document, on - account of their being thus compiled, if they are not themselves - derivative works of the Document. - - If the Cover Text requirement of section 3 is applicable to these - copies of the Document, then if the Document is less than one - quarter of the entire aggregate, the Document's Cover Texts may be - placed on covers that surround only the Document within the - aggregate. Otherwise they must appear on covers around the whole - aggregate. - - 8. TRANSLATION - - Translation is considered a kind of modification, so you may - distribute translations of the Document under the terms of section - 4. Replacing Invariant Sections with translations requires special - permission from their copyright holders, but you may include - translations of some or all Invariant Sections in addition to the - original versions of these Invariant Sections. You may include a - translation of this License provided that you also include the - original English version of this License. In case of a - disagreement between the translation and the original English - version of this License, the original English version will prevail. - - 9. TERMINATION - - You may not copy, modify, sublicense, or distribute the Document - except as expressly provided for under this License. Any other - attempt to copy, modify, sublicense or distribute the Document is - void, and will automatically terminate your rights under this - License. However, parties who have received copies, or rights, - from you under this License will not have their licenses - terminated so long as such parties remain in full compliance. - - 10. FUTURE REVISIONS OF THIS LICENSE - - The Free Software Foundation may publish new, revised versions of - the GNU Free Documentation License from time to time. Such new - versions will be similar in spirit to the present version, but may - differ in detail to address new problems or concerns. See - http://www.gnu.org/copyleft/. - - Each version of the License is given a distinguishing version - number. If the Document specifies that a particular numbered - version of this License "or any later version" applies to it, you - have the option of following the terms and conditions either of - that specified version or of any later version that has been - published (not as a draft) by the Free Software Foundation. If - the Document does not specify a version number of this License, - you may choose any version ever published (not as a draft) by the - Free Software Foundation. - - -ADDENDUM: How to use this License for your documents -==================================================== - -To use this License in a document you have written, include a copy of -the License in the document and put the following copyright and license -notices just after the title page: - - Copyright (C) YEAR YOUR NAME. - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.1 - or any later version published by the Free Software Foundation; - with the Invariant Sections being LIST THEIR TITLES, with the - Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. - A copy of the license is included in the section entitled "GNU - Free Documentation License." - - If you have no Invariant Sections, write "with no Invariant Sections" -instead of saying which ones are invariant. If you have no Front-Cover -Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being -LIST"; likewise for Back-Cover Texts. - - If your document contains nontrivial examples of program code, we -recommend releasing these examples in parallel under your choice of -free software license, such as the GNU General Public License, to -permit their use in free software. - - -File: bfd.info, Node: Index, Prev: GNU Free Documentation License, Up: Top - -Index -***** - -[index] -* Menu: - -* _bfd_final_link_relocate: Relocating the section contents. - (line 22) -* _bfd_generic_link_add_archive_symbols: Adding symbols from an archive. - (line 12) -* _bfd_generic_link_add_one_symbol: Adding symbols from an object file. - (line 19) -* _bfd_generic_make_empty_symbol: symbol handling functions. - (line 92) -* _bfd_link_add_symbols in target vector: Adding Symbols to the Hash Table. - (line 6) -* _bfd_link_final_link in target vector: Performing the Final Link. - (line 6) -* _bfd_link_hash_table_create in target vector: Creating a Linker Hash Table. - (line 6) -* _bfd_relocate_contents: Relocating the section contents. - (line 22) -* aout_SIZE_machine_type: aout. (line 147) -* aout_SIZE_mkobject: aout. (line 139) -* aout_SIZE_new_section_hook: aout. (line 177) -* aout_SIZE_set_arch_mach: aout. (line 164) -* aout_SIZE_some_aout_object_p: aout. (line 125) -* aout_SIZE_swap_exec_header_in: aout. (line 101) -* aout_SIZE_swap_exec_header_out: aout. (line 113) -* arelent_chain: typedef arelent. (line 339) -* BFD: Overview. (line 6) -* BFD canonical format: Canonical format. (line 11) -* bfd_alloc: Opening and Closing. - (line 203) -* bfd_alloc2: Opening and Closing. - (line 212) -* bfd_alt_mach_code: BFD front end. (line 599) -* bfd_arch_bits_per_address: Architectures. (line 476) -* bfd_arch_bits_per_byte: Architectures. (line 468) -* bfd_arch_get_compatible: Architectures. (line 411) -* bfd_arch_list: Architectures. (line 402) -* bfd_arch_mach_octets_per_byte: Architectures. (line 545) -* BFD_ARELOC_BFIN_ADD: howto manager. (line 887) -* BFD_ARELOC_BFIN_ADDR: howto manager. (line 938) -* BFD_ARELOC_BFIN_AND: howto manager. (line 908) -* BFD_ARELOC_BFIN_COMP: howto manager. (line 929) -* BFD_ARELOC_BFIN_CONST: howto manager. (line 884) -* BFD_ARELOC_BFIN_DIV: howto manager. (line 896) -* BFD_ARELOC_BFIN_HWPAGE: howto manager. (line 935) -* BFD_ARELOC_BFIN_LAND: howto manager. (line 917) -* BFD_ARELOC_BFIN_LEN: howto manager. (line 923) -* BFD_ARELOC_BFIN_LOR: howto manager. (line 920) -* BFD_ARELOC_BFIN_LSHIFT: howto manager. (line 902) -* BFD_ARELOC_BFIN_MOD: howto manager. (line 899) -* BFD_ARELOC_BFIN_MULT: howto manager. (line 893) -* BFD_ARELOC_BFIN_NEG: howto manager. (line 926) -* BFD_ARELOC_BFIN_OR: howto manager. (line 911) -* BFD_ARELOC_BFIN_PAGE: howto manager. (line 932) -* BFD_ARELOC_BFIN_PUSH: howto manager. (line 881) -* BFD_ARELOC_BFIN_RSHIFT: howto manager. (line 905) -* BFD_ARELOC_BFIN_SUB: howto manager. (line 890) -* BFD_ARELOC_BFIN_XOR: howto manager. (line 914) -* bfd_cache_close: File Caching. (line 26) -* bfd_cache_close_all: File Caching. (line 39) -* bfd_cache_init: File Caching. (line 18) -* bfd_calc_gnu_debuglink_crc32: Opening and Closing. - (line 239) -* bfd_canonicalize_reloc: BFD front end. (line 318) -* bfd_canonicalize_symtab: symbol handling functions. - (line 50) -* bfd_check_format: Formats. (line 21) -* bfd_check_format_matches: Formats. (line 52) -* bfd_check_overflow: typedef arelent. (line 351) -* bfd_close: Opening and Closing. - (line 128) -* bfd_close_all_done: Opening and Closing. - (line 146) -* bfd_coff_backend_data: coff. (line 246) -* bfd_copy_private_bfd_data: BFD front end. (line 457) -* bfd_copy_private_header_data: BFD front end. (line 439) -* bfd_copy_private_section_data: section prototypes. (line 255) -* bfd_copy_private_symbol_data: symbol handling functions. - (line 140) -* bfd_core_file_failing_command: Core Files. (line 12) -* bfd_core_file_failing_signal: Core Files. (line 21) -* bfd_create: Opening and Closing. - (line 165) -* bfd_create_gnu_debuglink_section: Opening and Closing. - (line 305) -* bfd_decode_symclass: symbol handling functions. - (line 111) -* bfd_default_arch_struct: Architectures. (line 423) -* bfd_default_compatible: Architectures. (line 485) -* bfd_default_reloc_type_lookup: howto manager. (line 1931) -* bfd_default_scan: Architectures. (line 494) -* bfd_default_set_arch_mach: Architectures. (line 441) -* bfd_elf_find_section: elf. (line 13) -* bfd_errmsg: BFD front end. (line 243) -* bfd_fdopenr: Opening and Closing. - (line 46) -* bfd_fill_in_gnu_debuglink_section: Opening and Closing. - (line 319) -* bfd_find_target: bfd_target. (line 434) -* bfd_follow_gnu_debuglink: Opening and Closing. - (line 284) -* bfd_fopen: Opening and Closing. - (line 9) -* bfd_format_string: Formats. (line 79) -* bfd_generic_discard_group: section prototypes. (line 281) -* bfd_generic_gc_sections: howto manager. (line 1962) -* bfd_generic_get_relocated_section_contents: howto manager. (line 1982) -* bfd_generic_is_group_section: section prototypes. (line 273) -* bfd_generic_merge_sections: howto manager. (line 1972) -* bfd_generic_relax_section: howto manager. (line 1949) -* bfd_get_arch: Architectures. (line 452) -* bfd_get_arch_info: Architectures. (line 504) -* bfd_get_arch_size: BFD front end. (line 362) -* bfd_get_error: BFD front end. (line 226) -* bfd_get_error_handler: BFD front end. (line 294) -* bfd_get_gp_size: BFD front end. (line 403) -* bfd_get_mach: Architectures. (line 460) -* bfd_get_mtime: BFD front end. (line 687) -* bfd_get_next_mapent: Archives. (line 52) -* bfd_get_reloc_code_name: howto manager. (line 1940) -* bfd_get_reloc_size: typedef arelent. (line 330) -* bfd_get_reloc_upper_bound: BFD front end. (line 308) -* bfd_get_section_by_name: section prototypes. (line 17) -* bfd_get_section_by_name_if: section prototypes. (line 31) -* bfd_get_section_contents: section prototypes. (line 228) -* bfd_get_sign_extend_vma: BFD front end. (line 375) -* bfd_get_size <1>: Internal. (line 25) -* bfd_get_size: BFD front end. (line 696) -* bfd_get_symtab_upper_bound: symbol handling functions. - (line 6) -* bfd_get_unique_section_name: section prototypes. (line 50) -* bfd_h_put_size: Internal. (line 97) -* bfd_hash_allocate: Creating and Freeing a Hash Table. - (line 17) -* bfd_hash_lookup: Looking Up or Entering a String. - (line 6) -* bfd_hash_newfunc: Creating and Freeing a Hash Table. - (line 12) -* bfd_hash_set_default_size: Creating and Freeing a Hash Table. - (line 25) -* bfd_hash_table_free: Creating and Freeing a Hash Table. - (line 21) -* bfd_hash_table_init: Creating and Freeing a Hash Table. - (line 6) -* bfd_hash_table_init_n: Creating and Freeing a Hash Table. - (line 6) -* bfd_hash_traverse: Traversing a Hash Table. - (line 6) -* bfd_init: Initialization. (line 11) -* bfd_install_relocation: typedef arelent. (line 392) -* bfd_is_local_label: symbol handling functions. - (line 17) -* bfd_is_local_label_name: symbol handling functions. - (line 26) -* bfd_is_target_special_symbol: symbol handling functions. - (line 38) -* bfd_is_undefined_symclass: symbol handling functions. - (line 120) -* bfd_link_split_section: Writing the symbol table. - (line 44) -* bfd_log2: Internal. (line 164) -* bfd_lookup_arch: Architectures. (line 512) -* bfd_make_debug_symbol: symbol handling functions. - (line 102) -* bfd_make_empty_symbol: symbol handling functions. - (line 78) -* bfd_make_readable: Opening and Closing. - (line 189) -* bfd_make_section: section prototypes. (line 129) -* bfd_make_section_anyway: section prototypes. (line 100) -* bfd_make_section_anyway_with_flags: section prototypes. (line 82) -* bfd_make_section_old_way: section prototypes. (line 62) -* bfd_make_section_with_flags: section prototypes. (line 116) -* bfd_make_writable: Opening and Closing. - (line 175) -* bfd_malloc_and_get_section: section prototypes. (line 245) -* bfd_map_over_sections: section prototypes. (line 155) -* bfd_merge_private_bfd_data: BFD front end. (line 473) -* bfd_octets_per_byte: Architectures. (line 535) -* bfd_open_file: File Caching. (line 52) -* bfd_openr: Opening and Closing. - (line 30) -* bfd_openr_iovec: Opening and Closing. - (line 76) -* bfd_openr_next_archived_file: Archives. (line 78) -* bfd_openstreamr: Opening and Closing. - (line 67) -* bfd_openw: Opening and Closing. - (line 116) -* bfd_perform_relocation: typedef arelent. (line 367) -* bfd_perror: BFD front end. (line 252) -* bfd_preserve_finish: BFD front end. (line 647) -* bfd_preserve_restore: BFD front end. (line 637) -* bfd_preserve_save: BFD front end. (line 621) -* bfd_print_symbol_vandf: symbol handling functions. - (line 70) -* bfd_printable_arch_mach: Architectures. (line 523) -* bfd_printable_name: Architectures. (line 383) -* bfd_put_size: Internal. (line 22) -* BFD_RELOC_12_PCREL: howto manager. (line 39) -* BFD_RELOC_14: howto manager. (line 31) -* BFD_RELOC_16: howto manager. (line 30) -* BFD_RELOC_16_BASEREL: howto manager. (line 80) -* BFD_RELOC_16_GOT_PCREL: howto manager. (line 52) -* BFD_RELOC_16_GOTOFF: howto manager. (line 55) -* BFD_RELOC_16_PCREL: howto manager. (line 38) -* BFD_RELOC_16_PCREL_S2: howto manager. (line 92) -* BFD_RELOC_16_PLT_PCREL: howto manager. (line 63) -* BFD_RELOC_16_PLTOFF: howto manager. (line 67) -* BFD_RELOC_16C_ABS20: howto manager. (line 1655) -* BFD_RELOC_16C_ABS20_C: howto manager. (line 1656) -* BFD_RELOC_16C_ABS24: howto manager. (line 1657) -* BFD_RELOC_16C_ABS24_C: howto manager. (line 1658) -* BFD_RELOC_16C_DISP04: howto manager. (line 1635) -* BFD_RELOC_16C_DISP04_C: howto manager. (line 1636) -* BFD_RELOC_16C_DISP08: howto manager. (line 1637) -* BFD_RELOC_16C_DISP08_C: howto manager. (line 1638) -* BFD_RELOC_16C_DISP16: howto manager. (line 1639) -* BFD_RELOC_16C_DISP16_C: howto manager. (line 1640) -* BFD_RELOC_16C_DISP24: howto manager. (line 1641) -* BFD_RELOC_16C_DISP24_C: howto manager. (line 1642) -* BFD_RELOC_16C_DISP24a: howto manager. (line 1643) -* BFD_RELOC_16C_DISP24a_C: howto manager. (line 1644) -* BFD_RELOC_16C_IMM04: howto manager. (line 1659) -* BFD_RELOC_16C_IMM04_C: howto manager. (line 1660) -* BFD_RELOC_16C_IMM16: howto manager. (line 1661) -* BFD_RELOC_16C_IMM16_C: howto manager. (line 1662) -* BFD_RELOC_16C_IMM20: howto manager. (line 1663) -* BFD_RELOC_16C_IMM20_C: howto manager. (line 1664) -* BFD_RELOC_16C_IMM24: howto manager. (line 1665) -* BFD_RELOC_16C_IMM24_C: howto manager. (line 1666) -* BFD_RELOC_16C_IMM32: howto manager. (line 1667) -* BFD_RELOC_16C_IMM32_C: howto manager. (line 1668) -* BFD_RELOC_16C_NUM08: howto manager. (line 1629) -* BFD_RELOC_16C_NUM08_C: howto manager. (line 1630) -* BFD_RELOC_16C_NUM16: howto manager. (line 1631) -* BFD_RELOC_16C_NUM16_C: howto manager. (line 1632) -* BFD_RELOC_16C_NUM32: howto manager. (line 1633) -* BFD_RELOC_16C_NUM32_C: howto manager. (line 1634) -* BFD_RELOC_16C_REG04: howto manager. (line 1645) -* BFD_RELOC_16C_REG04_C: howto manager. (line 1646) -* BFD_RELOC_16C_REG04a: howto manager. (line 1647) -* BFD_RELOC_16C_REG04a_C: howto manager. (line 1648) -* BFD_RELOC_16C_REG14: howto manager. (line 1649) -* BFD_RELOC_16C_REG14_C: howto manager. (line 1650) -* BFD_RELOC_16C_REG16: howto manager. (line 1651) -* BFD_RELOC_16C_REG16_C: howto manager. (line 1652) -* BFD_RELOC_16C_REG20: howto manager. (line 1653) -* BFD_RELOC_16C_REG20_C: howto manager. (line 1654) -* BFD_RELOC_23_PCREL_S2: howto manager. (line 93) -* BFD_RELOC_24: howto manager. (line 29) -* BFD_RELOC_24_PCREL: howto manager. (line 37) -* BFD_RELOC_24_PLT_PCREL: howto manager. (line 62) -* BFD_RELOC_26: howto manager. (line 28) -* BFD_RELOC_32: howto manager. (line 27) -* BFD_RELOC_32_BASEREL: howto manager. (line 79) -* BFD_RELOC_32_GOT_PCREL: howto manager. (line 51) -* BFD_RELOC_32_GOTOFF: howto manager. (line 54) -* BFD_RELOC_32_PCREL: howto manager. (line 36) -* BFD_RELOC_32_PCREL_S2: howto manager. (line 91) -* BFD_RELOC_32_PLT_PCREL: howto manager. (line 61) -* BFD_RELOC_32_PLTOFF: howto manager. (line 66) -* BFD_RELOC_32_SECREL: howto manager. (line 48) -* BFD_RELOC_386_COPY: howto manager. (line 435) -* BFD_RELOC_386_GLOB_DAT: howto manager. (line 436) -* BFD_RELOC_386_GOT32: howto manager. (line 433) -* BFD_RELOC_386_GOTOFF: howto manager. (line 439) -* BFD_RELOC_386_GOTPC: howto manager. (line 440) -* BFD_RELOC_386_JUMP_SLOT: howto manager. (line 437) -* BFD_RELOC_386_PLT32: howto manager. (line 434) -* BFD_RELOC_386_RELATIVE: howto manager. (line 438) -* BFD_RELOC_386_TLS_DESC: howto manager. (line 455) -* BFD_RELOC_386_TLS_DESC_CALL: howto manager. (line 454) -* BFD_RELOC_386_TLS_DTPMOD32: howto manager. (line 450) -* BFD_RELOC_386_TLS_DTPOFF32: howto manager. (line 451) -* BFD_RELOC_386_TLS_GD: howto manager. (line 445) -* BFD_RELOC_386_TLS_GOTDESC: howto manager. (line 453) -* BFD_RELOC_386_TLS_GOTIE: howto manager. (line 443) -* BFD_RELOC_386_TLS_IE: howto manager. (line 442) -* BFD_RELOC_386_TLS_IE_32: howto manager. (line 448) -* BFD_RELOC_386_TLS_LDM: howto manager. (line 446) -* BFD_RELOC_386_TLS_LDO_32: howto manager. (line 447) -* BFD_RELOC_386_TLS_LE: howto manager. (line 444) -* BFD_RELOC_386_TLS_LE_32: howto manager. (line 449) -* BFD_RELOC_386_TLS_TPOFF: howto manager. (line 441) -* BFD_RELOC_386_TLS_TPOFF32: howto manager. (line 452) -* BFD_RELOC_390_12: howto manager. (line 1346) -* BFD_RELOC_390_20: howto manager. (line 1446) -* BFD_RELOC_390_COPY: howto manager. (line 1355) -* BFD_RELOC_390_GLOB_DAT: howto manager. (line 1358) -* BFD_RELOC_390_GOT12: howto manager. (line 1349) -* BFD_RELOC_390_GOT16: howto manager. (line 1370) -* BFD_RELOC_390_GOT20: howto manager. (line 1447) -* BFD_RELOC_390_GOT64: howto manager. (line 1388) -* BFD_RELOC_390_GOTENT: howto manager. (line 1394) -* BFD_RELOC_390_GOTOFF64: howto manager. (line 1397) -* BFD_RELOC_390_GOTPC: howto manager. (line 1367) -* BFD_RELOC_390_GOTPCDBL: howto manager. (line 1385) -* BFD_RELOC_390_GOTPLT12: howto manager. (line 1400) -* BFD_RELOC_390_GOTPLT16: howto manager. (line 1403) -* BFD_RELOC_390_GOTPLT20: howto manager. (line 1448) -* BFD_RELOC_390_GOTPLT32: howto manager. (line 1406) -* BFD_RELOC_390_GOTPLT64: howto manager. (line 1409) -* BFD_RELOC_390_GOTPLTENT: howto manager. (line 1412) -* BFD_RELOC_390_JMP_SLOT: howto manager. (line 1361) -* BFD_RELOC_390_PC16DBL: howto manager. (line 1373) -* BFD_RELOC_390_PC32DBL: howto manager. (line 1379) -* BFD_RELOC_390_PLT16DBL: howto manager. (line 1376) -* BFD_RELOC_390_PLT32: howto manager. (line 1352) -* BFD_RELOC_390_PLT32DBL: howto manager. (line 1382) -* BFD_RELOC_390_PLT64: howto manager. (line 1391) -* BFD_RELOC_390_PLTOFF16: howto manager. (line 1415) -* BFD_RELOC_390_PLTOFF32: howto manager. (line 1418) -* BFD_RELOC_390_PLTOFF64: howto manager. (line 1421) -* BFD_RELOC_390_RELATIVE: howto manager. (line 1364) -* BFD_RELOC_390_TLS_DTPMOD: howto manager. (line 1441) -* BFD_RELOC_390_TLS_DTPOFF: howto manager. (line 1442) -* BFD_RELOC_390_TLS_GD32: howto manager. (line 1427) -* BFD_RELOC_390_TLS_GD64: howto manager. (line 1428) -* BFD_RELOC_390_TLS_GDCALL: howto manager. (line 1425) -* BFD_RELOC_390_TLS_GOTIE12: howto manager. (line 1429) -* BFD_RELOC_390_TLS_GOTIE20: howto manager. (line 1449) -* BFD_RELOC_390_TLS_GOTIE32: howto manager. (line 1430) -* BFD_RELOC_390_TLS_GOTIE64: howto manager. (line 1431) -* BFD_RELOC_390_TLS_IE32: howto manager. (line 1434) -* BFD_RELOC_390_TLS_IE64: howto manager. (line 1435) -* BFD_RELOC_390_TLS_IEENT: howto manager. (line 1436) -* BFD_RELOC_390_TLS_LDCALL: howto manager. (line 1426) -* BFD_RELOC_390_TLS_LDM32: howto manager. (line 1432) -* BFD_RELOC_390_TLS_LDM64: howto manager. (line 1433) -* BFD_RELOC_390_TLS_LDO32: howto manager. (line 1439) -* BFD_RELOC_390_TLS_LDO64: howto manager. (line 1440) -* BFD_RELOC_390_TLS_LE32: howto manager. (line 1437) -* BFD_RELOC_390_TLS_LE64: howto manager. (line 1438) -* BFD_RELOC_390_TLS_LOAD: howto manager. (line 1424) -* BFD_RELOC_390_TLS_TPOFF: howto manager. (line 1443) -* BFD_RELOC_64: howto manager. (line 26) -* BFD_RELOC_64_PCREL: howto manager. (line 35) -* BFD_RELOC_64_PLT_PCREL: howto manager. (line 60) -* BFD_RELOC_64_PLTOFF: howto manager. (line 65) -* BFD_RELOC_68K_GLOB_DAT: howto manager. (line 74) -* BFD_RELOC_68K_JMP_SLOT: howto manager. (line 75) -* BFD_RELOC_68K_RELATIVE: howto manager. (line 76) -* BFD_RELOC_8: howto manager. (line 32) -* BFD_RELOC_860_COPY: howto manager. (line 1734) -* BFD_RELOC_860_GLOB_DAT: howto manager. (line 1735) -* BFD_RELOC_860_HAGOT: howto manager. (line 1760) -* BFD_RELOC_860_HAGOTOFF: howto manager. (line 1761) -* BFD_RELOC_860_HAPC: howto manager. (line 1762) -* BFD_RELOC_860_HIGH: howto manager. (line 1763) -* BFD_RELOC_860_HIGHADJ: howto manager. (line 1759) -* BFD_RELOC_860_HIGOT: howto manager. (line 1764) -* BFD_RELOC_860_HIGOTOFF: howto manager. (line 1765) -* BFD_RELOC_860_JUMP_SLOT: howto manager. (line 1736) -* BFD_RELOC_860_LOGOT0: howto manager. (line 1748) -* BFD_RELOC_860_LOGOT1: howto manager. (line 1750) -* BFD_RELOC_860_LOGOTOFF0: howto manager. (line 1752) -* BFD_RELOC_860_LOGOTOFF1: howto manager. (line 1754) -* BFD_RELOC_860_LOGOTOFF2: howto manager. (line 1756) -* BFD_RELOC_860_LOGOTOFF3: howto manager. (line 1757) -* BFD_RELOC_860_LOPC: howto manager. (line 1758) -* BFD_RELOC_860_LOW0: howto manager. (line 1741) -* BFD_RELOC_860_LOW1: howto manager. (line 1743) -* BFD_RELOC_860_LOW2: howto manager. (line 1745) -* BFD_RELOC_860_LOW3: howto manager. (line 1747) -* BFD_RELOC_860_PC16: howto manager. (line 1740) -* BFD_RELOC_860_PC26: howto manager. (line 1738) -* BFD_RELOC_860_PLT26: howto manager. (line 1739) -* BFD_RELOC_860_RELATIVE: howto manager. (line 1737) -* BFD_RELOC_860_SPGOT0: howto manager. (line 1749) -* BFD_RELOC_860_SPGOT1: howto manager. (line 1751) -* BFD_RELOC_860_SPGOTOFF0: howto manager. (line 1753) -* BFD_RELOC_860_SPGOTOFF1: howto manager. (line 1755) -* BFD_RELOC_860_SPLIT0: howto manager. (line 1742) -* BFD_RELOC_860_SPLIT1: howto manager. (line 1744) -* BFD_RELOC_860_SPLIT2: howto manager. (line 1746) -* BFD_RELOC_8_BASEREL: howto manager. (line 84) -* BFD_RELOC_8_FFnn: howto manager. (line 88) -* BFD_RELOC_8_GOT_PCREL: howto manager. (line 53) -* BFD_RELOC_8_GOTOFF: howto manager. (line 59) -* BFD_RELOC_8_PCREL: howto manager. (line 40) -* BFD_RELOC_8_PLT_PCREL: howto manager. (line 64) -* BFD_RELOC_8_PLTOFF: howto manager. (line 71) -* BFD_RELOC_ALPHA_BRSGP: howto manager. (line 259) -* BFD_RELOC_ALPHA_CODEADDR: howto manager. (line 250) -* BFD_RELOC_ALPHA_DTPMOD64: howto manager. (line 266) -* BFD_RELOC_ALPHA_DTPREL16: howto manager. (line 271) -* BFD_RELOC_ALPHA_DTPREL64: howto manager. (line 268) -* BFD_RELOC_ALPHA_DTPREL_HI16: howto manager. (line 269) -* BFD_RELOC_ALPHA_DTPREL_LO16: howto manager. (line 270) -* BFD_RELOC_ALPHA_ELF_LITERAL: howto manager. (line 215) -* BFD_RELOC_ALPHA_GOTDTPREL16: howto manager. (line 267) -* BFD_RELOC_ALPHA_GOTTPREL16: howto manager. (line 272) -* BFD_RELOC_ALPHA_GPDISP: howto manager. (line 209) -* BFD_RELOC_ALPHA_GPDISP_HI16: howto manager. (line 195) -* BFD_RELOC_ALPHA_GPDISP_LO16: howto manager. (line 203) -* BFD_RELOC_ALPHA_GPREL_HI16: howto manager. (line 254) -* BFD_RELOC_ALPHA_GPREL_LO16: howto manager. (line 255) -* BFD_RELOC_ALPHA_HINT: howto manager. (line 241) -* BFD_RELOC_ALPHA_LINKAGE: howto manager. (line 246) -* BFD_RELOC_ALPHA_LITERAL: howto manager. (line 214) -* BFD_RELOC_ALPHA_LITUSE: howto manager. (line 216) -* BFD_RELOC_ALPHA_TLSGD: howto manager. (line 264) -* BFD_RELOC_ALPHA_TLSLDM: howto manager. (line 265) -* BFD_RELOC_ALPHA_TPREL16: howto manager. (line 276) -* BFD_RELOC_ALPHA_TPREL64: howto manager. (line 273) -* BFD_RELOC_ALPHA_TPREL_HI16: howto manager. (line 274) -* BFD_RELOC_ALPHA_TPREL_LO16: howto manager. (line 275) -* BFD_RELOC_ARC_B22_PCREL: howto manager. (line 816) -* BFD_RELOC_ARC_B26: howto manager. (line 821) -* BFD_RELOC_ARM_ADR_IMM: howto manager. (line 709) -* BFD_RELOC_ARM_ADRL_IMMEDIATE: howto manager. (line 697) -* BFD_RELOC_ARM_CP_OFF_IMM: howto manager. (line 705) -* BFD_RELOC_ARM_CP_OFF_IMM_S2: howto manager. (line 706) -* BFD_RELOC_ARM_GLOB_DAT: howto manager. (line 678) -* BFD_RELOC_ARM_GOT32: howto manager. (line 679) -* BFD_RELOC_ARM_GOTOFF: howto manager. (line 682) -* BFD_RELOC_ARM_GOTPC: howto manager. (line 683) -* BFD_RELOC_ARM_HWLITERAL: howto manager. (line 716) -* BFD_RELOC_ARM_IMMEDIATE: howto manager. (line 696) -* BFD_RELOC_ARM_IN_POOL: howto manager. (line 712) -* BFD_RELOC_ARM_JUMP_SLOT: howto manager. (line 677) -* BFD_RELOC_ARM_LDR_IMM: howto manager. (line 710) -* BFD_RELOC_ARM_LITERAL: howto manager. (line 711) -* BFD_RELOC_ARM_MULTI: howto manager. (line 704) -* BFD_RELOC_ARM_OFFSET_IMM: howto manager. (line 651) -* BFD_RELOC_ARM_OFFSET_IMM8: howto manager. (line 713) -* BFD_RELOC_ARM_PCREL_BLX: howto manager. (line 622) -* BFD_RELOC_ARM_PCREL_BRANCH: howto manager. (line 618) -* BFD_RELOC_ARM_PCREL_CALL: howto manager. (line 632) -* BFD_RELOC_ARM_PCREL_JUMP: howto manager. (line 636) -* BFD_RELOC_ARM_PLT32: howto manager. (line 680) -* BFD_RELOC_ARM_PREL31: howto manager. (line 674) -* BFD_RELOC_ARM_RELATIVE: howto manager. (line 681) -* BFD_RELOC_ARM_ROSEGREL32: howto manager. (line 663) -* BFD_RELOC_ARM_SBREL32: howto manager. (line 666) -* BFD_RELOC_ARM_SHIFT_IMM: howto manager. (line 701) -* BFD_RELOC_ARM_SMC: howto manager. (line 702) -* BFD_RELOC_ARM_SWI: howto manager. (line 703) -* BFD_RELOC_ARM_T32_ADD_PC12: howto manager. (line 700) -* BFD_RELOC_ARM_T32_CP_OFF_IMM: howto manager. (line 707) -* BFD_RELOC_ARM_T32_CP_OFF_IMM_S2: howto manager. (line 708) -* BFD_RELOC_ARM_T32_IMM12: howto manager. (line 699) -* BFD_RELOC_ARM_T32_IMMEDIATE: howto manager. (line 698) -* BFD_RELOC_ARM_T32_OFFSET_IMM: howto manager. (line 715) -* BFD_RELOC_ARM_T32_OFFSET_U8: howto manager. (line 714) -* BFD_RELOC_ARM_TARGET1: howto manager. (line 659) -* BFD_RELOC_ARM_TARGET2: howto manager. (line 669) -* BFD_RELOC_ARM_THUMB_ADD: howto manager. (line 717) -* BFD_RELOC_ARM_THUMB_IMM: howto manager. (line 718) -* BFD_RELOC_ARM_THUMB_OFFSET: howto manager. (line 655) -* BFD_RELOC_ARM_THUMB_SHIFT: howto manager. (line 719) -* BFD_RELOC_ARM_TLS_DTPMOD32: howto manager. (line 690) -* BFD_RELOC_ARM_TLS_DTPOFF32: howto manager. (line 689) -* BFD_RELOC_ARM_TLS_GD32: howto manager. (line 686) -* BFD_RELOC_ARM_TLS_IE32: howto manager. (line 692) -* BFD_RELOC_ARM_TLS_LDM32: howto manager. (line 688) -* BFD_RELOC_ARM_TLS_LDO32: howto manager. (line 687) -* BFD_RELOC_ARM_TLS_LE32: howto manager. (line 693) -* BFD_RELOC_ARM_TLS_TPOFF32: howto manager. (line 691) -* BFD_RELOC_AVR_13_PCREL: howto manager. (line 1259) -* BFD_RELOC_AVR_16_PM: howto manager. (line 1263) -* BFD_RELOC_AVR_6: howto manager. (line 1338) -* BFD_RELOC_AVR_6_ADIW: howto manager. (line 1342) -* BFD_RELOC_AVR_7_PCREL: howto manager. (line 1255) -* BFD_RELOC_AVR_CALL: howto manager. (line 1330) -* BFD_RELOC_AVR_HH8_LDI: howto manager. (line 1275) -* BFD_RELOC_AVR_HH8_LDI_NEG: howto manager. (line 1294) -* BFD_RELOC_AVR_HH8_LDI_PM: howto manager. (line 1311) -* BFD_RELOC_AVR_HH8_LDI_PM_NEG: howto manager. (line 1325) -* BFD_RELOC_AVR_HI8_LDI: howto manager. (line 1271) -* BFD_RELOC_AVR_HI8_LDI_NEG: howto manager. (line 1289) -* BFD_RELOC_AVR_HI8_LDI_PM: howto manager. (line 1307) -* BFD_RELOC_AVR_HI8_LDI_PM_NEG: howto manager. (line 1320) -* BFD_RELOC_AVR_LDI: howto manager. (line 1334) -* BFD_RELOC_AVR_LO8_LDI: howto manager. (line 1267) -* BFD_RELOC_AVR_LO8_LDI_NEG: howto manager. (line 1284) -* BFD_RELOC_AVR_LO8_LDI_PM: howto manager. (line 1303) -* BFD_RELOC_AVR_LO8_LDI_PM_NEG: howto manager. (line 1316) -* BFD_RELOC_AVR_MS8_LDI: howto manager. (line 1280) -* BFD_RELOC_AVR_MS8_LDI_NEG: howto manager. (line 1299) -* BFD_RELOC_BFIN_10_PCREL: howto manager. (line 841) -* BFD_RELOC_BFIN_11_PCREL: howto manager. (line 844) -* BFD_RELOC_BFIN_12_PCREL_JUMP: howto manager. (line 847) -* BFD_RELOC_BFIN_12_PCREL_JUMP_S: howto manager. (line 850) -* BFD_RELOC_BFIN_16_HIGH: howto manager. (line 829) -* BFD_RELOC_BFIN_16_IMM: howto manager. (line 826) -* BFD_RELOC_BFIN_16_LOW: howto manager. (line 838) -* BFD_RELOC_BFIN_24_PCREL_CALL_X: howto manager. (line 853) -* BFD_RELOC_BFIN_24_PCREL_JUMP_L: howto manager. (line 856) -* BFD_RELOC_BFIN_4_PCREL: howto manager. (line 832) -* BFD_RELOC_BFIN_5_PCREL: howto manager. (line 835) -* BFD_RELOC_BFIN_FUNCDESC: howto manager. (line 862) -* BFD_RELOC_BFIN_FUNCDESC_GOT17M4: howto manager. (line 863) -* BFD_RELOC_BFIN_FUNCDESC_GOTHI: howto manager. (line 864) -* BFD_RELOC_BFIN_FUNCDESC_GOTLO: howto manager. (line 865) -* BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4: howto manager. (line 867) -* BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI: howto manager. (line 868) -* BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO: howto manager. (line 869) -* BFD_RELOC_BFIN_FUNCDESC_VALUE: howto manager. (line 866) -* BFD_RELOC_BFIN_GOT: howto manager. (line 875) -* BFD_RELOC_BFIN_GOT17M4: howto manager. (line 859) -* BFD_RELOC_BFIN_GOTHI: howto manager. (line 860) -* BFD_RELOC_BFIN_GOTLO: howto manager. (line 861) -* BFD_RELOC_BFIN_GOTOFF17M4: howto manager. (line 870) -* BFD_RELOC_BFIN_GOTOFFHI: howto manager. (line 871) -* BFD_RELOC_BFIN_GOTOFFLO: howto manager. (line 872) -* BFD_RELOC_BFIN_PLTPC: howto manager. (line 878) -* bfd_reloc_code_type: howto manager. (line 10) -* BFD_RELOC_CRIS_16_GOT: howto manager. (line 1715) -* BFD_RELOC_CRIS_16_GOTPLT: howto manager. (line 1721) -* BFD_RELOC_CRIS_32_GOT: howto manager. (line 1712) -* BFD_RELOC_CRIS_32_GOTPLT: howto manager. (line 1718) -* BFD_RELOC_CRIS_32_GOTREL: howto manager. (line 1724) -* BFD_RELOC_CRIS_32_PLT_GOTREL: howto manager. (line 1727) -* BFD_RELOC_CRIS_32_PLT_PCREL: howto manager. (line 1730) -* BFD_RELOC_CRIS_BDISP8: howto manager. (line 1693) -* BFD_RELOC_CRIS_COPY: howto manager. (line 1706) -* BFD_RELOC_CRIS_GLOB_DAT: howto manager. (line 1707) -* BFD_RELOC_CRIS_JUMP_SLOT: howto manager. (line 1708) -* BFD_RELOC_CRIS_LAPCQ_OFFSET: howto manager. (line 1701) -* BFD_RELOC_CRIS_RELATIVE: howto manager. (line 1709) -* BFD_RELOC_CRIS_SIGNED_16: howto manager. (line 1699) -* BFD_RELOC_CRIS_SIGNED_6: howto manager. (line 1695) -* BFD_RELOC_CRIS_SIGNED_8: howto manager. (line 1697) -* BFD_RELOC_CRIS_UNSIGNED_16: howto manager. (line 1700) -* BFD_RELOC_CRIS_UNSIGNED_4: howto manager. (line 1702) -* BFD_RELOC_CRIS_UNSIGNED_5: howto manager. (line 1694) -* BFD_RELOC_CRIS_UNSIGNED_6: howto manager. (line 1696) -* BFD_RELOC_CRIS_UNSIGNED_8: howto manager. (line 1698) -* BFD_RELOC_CRX_ABS16: howto manager. (line 1681) -* BFD_RELOC_CRX_ABS32: howto manager. (line 1682) -* BFD_RELOC_CRX_IMM16: howto manager. (line 1686) -* BFD_RELOC_CRX_IMM32: howto manager. (line 1687) -* BFD_RELOC_CRX_NUM16: howto manager. (line 1684) -* BFD_RELOC_CRX_NUM32: howto manager. (line 1685) -* BFD_RELOC_CRX_NUM8: howto manager. (line 1683) -* BFD_RELOC_CRX_REGREL12: howto manager. (line 1677) -* BFD_RELOC_CRX_REGREL22: howto manager. (line 1678) -* BFD_RELOC_CRX_REGREL28: howto manager. (line 1679) -* BFD_RELOC_CRX_REGREL32: howto manager. (line 1680) -* BFD_RELOC_CRX_REL16: howto manager. (line 1674) -* BFD_RELOC_CRX_REL24: howto manager. (line 1675) -* BFD_RELOC_CRX_REL32: howto manager. (line 1676) -* BFD_RELOC_CRX_REL4: howto manager. (line 1671) -* BFD_RELOC_CRX_REL8: howto manager. (line 1672) -* BFD_RELOC_CRX_REL8_CMP: howto manager. (line 1673) -* BFD_RELOC_CRX_SWITCH16: howto manager. (line 1689) -* BFD_RELOC_CRX_SWITCH32: howto manager. (line 1690) -* BFD_RELOC_CRX_SWITCH8: howto manager. (line 1688) -* BFD_RELOC_CTOR: howto manager. (line 612) -* BFD_RELOC_D10V_10_PCREL_L: howto manager. (line 945) -* BFD_RELOC_D10V_10_PCREL_R: howto manager. (line 941) -* BFD_RELOC_D10V_18: howto manager. (line 950) -* BFD_RELOC_D10V_18_PCREL: howto manager. (line 953) -* BFD_RELOC_D30V_15: howto manager. (line 968) -* BFD_RELOC_D30V_15_PCREL: howto manager. (line 972) -* BFD_RELOC_D30V_15_PCREL_R: howto manager. (line 976) -* BFD_RELOC_D30V_21: howto manager. (line 981) -* BFD_RELOC_D30V_21_PCREL: howto manager. (line 985) -* BFD_RELOC_D30V_21_PCREL_R: howto manager. (line 989) -* BFD_RELOC_D30V_32: howto manager. (line 994) -* BFD_RELOC_D30V_32_PCREL: howto manager. (line 997) -* BFD_RELOC_D30V_6: howto manager. (line 956) -* BFD_RELOC_D30V_9_PCREL: howto manager. (line 959) -* BFD_RELOC_D30V_9_PCREL_R: howto manager. (line 963) -* BFD_RELOC_DLX_HI16_S: howto manager. (line 1000) -* BFD_RELOC_DLX_JMP26: howto manager. (line 1006) -* BFD_RELOC_DLX_LO16: howto manager. (line 1003) -* BFD_RELOC_FR30_10_IN_8: howto manager. (line 1185) -* BFD_RELOC_FR30_12_PCREL: howto manager. (line 1193) -* BFD_RELOC_FR30_20: howto manager. (line 1169) -* BFD_RELOC_FR30_48: howto manager. (line 1166) -* BFD_RELOC_FR30_6_IN_4: howto manager. (line 1173) -* BFD_RELOC_FR30_8_IN_8: howto manager. (line 1177) -* BFD_RELOC_FR30_9_IN_8: howto manager. (line 1181) -* BFD_RELOC_FR30_9_PCREL: howto manager. (line 1189) -* BFD_RELOC_FRV_FUNCDESC: howto manager. (line 377) -* BFD_RELOC_FRV_FUNCDESC_GOT12: howto manager. (line 378) -* BFD_RELOC_FRV_FUNCDESC_GOTHI: howto manager. (line 379) -* BFD_RELOC_FRV_FUNCDESC_GOTLO: howto manager. (line 380) -* BFD_RELOC_FRV_FUNCDESC_GOTOFF12: howto manager. (line 382) -* BFD_RELOC_FRV_FUNCDESC_GOTOFFHI: howto manager. (line 383) -* BFD_RELOC_FRV_FUNCDESC_GOTOFFLO: howto manager. (line 384) -* BFD_RELOC_FRV_FUNCDESC_VALUE: howto manager. (line 381) -* BFD_RELOC_FRV_GETTLSOFF: howto manager. (line 388) -* BFD_RELOC_FRV_GETTLSOFF_RELAX: howto manager. (line 401) -* BFD_RELOC_FRV_GOT12: howto manager. (line 374) -* BFD_RELOC_FRV_GOTHI: howto manager. (line 375) -* BFD_RELOC_FRV_GOTLO: howto manager. (line 376) -* BFD_RELOC_FRV_GOTOFF12: howto manager. (line 385) -* BFD_RELOC_FRV_GOTOFFHI: howto manager. (line 386) -* BFD_RELOC_FRV_GOTOFFLO: howto manager. (line 387) -* BFD_RELOC_FRV_GOTTLSDESC12: howto manager. (line 390) -* BFD_RELOC_FRV_GOTTLSDESCHI: howto manager. (line 391) -* BFD_RELOC_FRV_GOTTLSDESCLO: howto manager. (line 392) -* BFD_RELOC_FRV_GOTTLSOFF12: howto manager. (line 396) -* BFD_RELOC_FRV_GOTTLSOFFHI: howto manager. (line 397) -* BFD_RELOC_FRV_GOTTLSOFFLO: howto manager. (line 398) -* BFD_RELOC_FRV_GPREL12: howto manager. (line 369) -* BFD_RELOC_FRV_GPREL32: howto manager. (line 371) -* BFD_RELOC_FRV_GPRELHI: howto manager. (line 372) -* BFD_RELOC_FRV_GPRELLO: howto manager. (line 373) -* BFD_RELOC_FRV_GPRELU12: howto manager. (line 370) -* BFD_RELOC_FRV_HI16: howto manager. (line 368) -* BFD_RELOC_FRV_LABEL16: howto manager. (line 365) -* BFD_RELOC_FRV_LABEL24: howto manager. (line 366) -* BFD_RELOC_FRV_LO16: howto manager. (line 367) -* BFD_RELOC_FRV_TLSDESC_RELAX: howto manager. (line 400) -* BFD_RELOC_FRV_TLSDESC_VALUE: howto manager. (line 389) -* BFD_RELOC_FRV_TLSMOFF: howto manager. (line 403) -* BFD_RELOC_FRV_TLSMOFF12: howto manager. (line 393) -* BFD_RELOC_FRV_TLSMOFFHI: howto manager. (line 394) -* BFD_RELOC_FRV_TLSMOFFLO: howto manager. (line 395) -* BFD_RELOC_FRV_TLSOFF: howto manager. (line 399) -* BFD_RELOC_FRV_TLSOFF_RELAX: howto manager. (line 402) -* BFD_RELOC_GPREL16: howto manager. (line 106) -* BFD_RELOC_GPREL32: howto manager. (line 107) -* BFD_RELOC_H8_DIR16A8: howto manager. (line 1772) -* BFD_RELOC_H8_DIR16R8: howto manager. (line 1773) -* BFD_RELOC_H8_DIR24A8: howto manager. (line 1774) -* BFD_RELOC_H8_DIR24R8: howto manager. (line 1775) -* BFD_RELOC_H8_DIR32A16: howto manager. (line 1776) -* BFD_RELOC_HI16: howto manager. (line 289) -* BFD_RELOC_HI16_BASEREL: howto manager. (line 82) -* BFD_RELOC_HI16_GOTOFF: howto manager. (line 57) -* BFD_RELOC_HI16_PCREL: howto manager. (line 301) -* BFD_RELOC_HI16_PLTOFF: howto manager. (line 69) -* BFD_RELOC_HI16_S: howto manager. (line 292) -* BFD_RELOC_HI16_S_BASEREL: howto manager. (line 83) -* BFD_RELOC_HI16_S_GOTOFF: howto manager. (line 58) -* BFD_RELOC_HI16_S_PCREL: howto manager. (line 304) -* BFD_RELOC_HI16_S_PLTOFF: howto manager. (line 70) -* BFD_RELOC_HI22: howto manager. (line 101) -* BFD_RELOC_I370_D12: howto manager. (line 609) -* BFD_RELOC_I960_CALLJ: howto manager. (line 113) -* BFD_RELOC_IA64_COPY: howto manager. (line 1565) -* BFD_RELOC_IA64_DIR32LSB: howto manager. (line 1510) -* BFD_RELOC_IA64_DIR32MSB: howto manager. (line 1509) -* BFD_RELOC_IA64_DIR64LSB: howto manager. (line 1512) -* BFD_RELOC_IA64_DIR64MSB: howto manager. (line 1511) -* BFD_RELOC_IA64_DTPMOD64LSB: howto manager. (line 1575) -* BFD_RELOC_IA64_DTPMOD64MSB: howto manager. (line 1574) -* BFD_RELOC_IA64_DTPREL14: howto manager. (line 1577) -* BFD_RELOC_IA64_DTPREL22: howto manager. (line 1578) -* BFD_RELOC_IA64_DTPREL32LSB: howto manager. (line 1581) -* BFD_RELOC_IA64_DTPREL32MSB: howto manager. (line 1580) -* BFD_RELOC_IA64_DTPREL64I: howto manager. (line 1579) -* BFD_RELOC_IA64_DTPREL64LSB: howto manager. (line 1583) -* BFD_RELOC_IA64_DTPREL64MSB: howto manager. (line 1582) -* BFD_RELOC_IA64_FPTR32LSB: howto manager. (line 1527) -* BFD_RELOC_IA64_FPTR32MSB: howto manager. (line 1526) -* BFD_RELOC_IA64_FPTR64I: howto manager. (line 1525) -* BFD_RELOC_IA64_FPTR64LSB: howto manager. (line 1529) -* BFD_RELOC_IA64_FPTR64MSB: howto manager. (line 1528) -* BFD_RELOC_IA64_GPREL22: howto manager. (line 1513) -* BFD_RELOC_IA64_GPREL32LSB: howto manager. (line 1516) -* BFD_RELOC_IA64_GPREL32MSB: howto manager. (line 1515) -* BFD_RELOC_IA64_GPREL64I: howto manager. (line 1514) -* BFD_RELOC_IA64_GPREL64LSB: howto manager. (line 1518) -* BFD_RELOC_IA64_GPREL64MSB: howto manager. (line 1517) -* BFD_RELOC_IA64_IMM14: howto manager. (line 1506) -* BFD_RELOC_IA64_IMM22: howto manager. (line 1507) -* BFD_RELOC_IA64_IMM64: howto manager. (line 1508) -* BFD_RELOC_IA64_IPLTLSB: howto manager. (line 1564) -* BFD_RELOC_IA64_IPLTMSB: howto manager. (line 1563) -* BFD_RELOC_IA64_LDXMOV: howto manager. (line 1567) -* BFD_RELOC_IA64_LTOFF22: howto manager. (line 1519) -* BFD_RELOC_IA64_LTOFF22X: howto manager. (line 1566) -* BFD_RELOC_IA64_LTOFF64I: howto manager. (line 1520) -* BFD_RELOC_IA64_LTOFF_DTPMOD22: howto manager. (line 1576) -* BFD_RELOC_IA64_LTOFF_DTPREL22: howto manager. (line 1584) -* BFD_RELOC_IA64_LTOFF_FPTR22: howto manager. (line 1541) -* BFD_RELOC_IA64_LTOFF_FPTR32LSB: howto manager. (line 1544) -* BFD_RELOC_IA64_LTOFF_FPTR32MSB: howto manager. (line 1543) -* BFD_RELOC_IA64_LTOFF_FPTR64I: howto manager. (line 1542) -* BFD_RELOC_IA64_LTOFF_FPTR64LSB: howto manager. (line 1546) -* BFD_RELOC_IA64_LTOFF_FPTR64MSB: howto manager. (line 1545) -* BFD_RELOC_IA64_LTOFF_TPREL22: howto manager. (line 1573) -* BFD_RELOC_IA64_LTV32LSB: howto manager. (line 1560) -* BFD_RELOC_IA64_LTV32MSB: howto manager. (line 1559) -* BFD_RELOC_IA64_LTV64LSB: howto manager. (line 1562) -* BFD_RELOC_IA64_LTV64MSB: howto manager. (line 1561) -* BFD_RELOC_IA64_PCREL21B: howto manager. (line 1530) -* BFD_RELOC_IA64_PCREL21BI: howto manager. (line 1531) -* BFD_RELOC_IA64_PCREL21F: howto manager. (line 1533) -* BFD_RELOC_IA64_PCREL21M: howto manager. (line 1532) -* BFD_RELOC_IA64_PCREL22: howto manager. (line 1534) -* BFD_RELOC_IA64_PCREL32LSB: howto manager. (line 1538) -* BFD_RELOC_IA64_PCREL32MSB: howto manager. (line 1537) -* BFD_RELOC_IA64_PCREL60B: howto manager. (line 1535) -* BFD_RELOC_IA64_PCREL64I: howto manager. (line 1536) -* BFD_RELOC_IA64_PCREL64LSB: howto manager. (line 1540) -* BFD_RELOC_IA64_PCREL64MSB: howto manager. (line 1539) -* BFD_RELOC_IA64_PLTOFF22: howto manager. (line 1521) -* BFD_RELOC_IA64_PLTOFF64I: howto manager. (line 1522) -* BFD_RELOC_IA64_PLTOFF64LSB: howto manager. (line 1524) -* BFD_RELOC_IA64_PLTOFF64MSB: howto manager. (line 1523) -* BFD_RELOC_IA64_REL32LSB: howto manager. (line 1556) -* BFD_RELOC_IA64_REL32MSB: howto manager. (line 1555) -* BFD_RELOC_IA64_REL64LSB: howto manager. (line 1558) -* BFD_RELOC_IA64_REL64MSB: howto manager. (line 1557) -* BFD_RELOC_IA64_SECREL32LSB: howto manager. (line 1552) -* BFD_RELOC_IA64_SECREL32MSB: howto manager. (line 1551) -* BFD_RELOC_IA64_SECREL64LSB: howto manager. (line 1554) -* BFD_RELOC_IA64_SECREL64MSB: howto manager. (line 1553) -* BFD_RELOC_IA64_SEGREL32LSB: howto manager. (line 1548) -* BFD_RELOC_IA64_SEGREL32MSB: howto manager. (line 1547) -* BFD_RELOC_IA64_SEGREL64LSB: howto manager. (line 1550) -* BFD_RELOC_IA64_SEGREL64MSB: howto manager. (line 1549) -* BFD_RELOC_IA64_TPREL14: howto manager. (line 1568) -* BFD_RELOC_IA64_TPREL22: howto manager. (line 1569) -* BFD_RELOC_IA64_TPREL64I: howto manager. (line 1570) -* BFD_RELOC_IA64_TPREL64LSB: howto manager. (line 1572) -* BFD_RELOC_IA64_TPREL64MSB: howto manager. (line 1571) -* BFD_RELOC_IP2K_ADDR16CJP: howto manager. (line 1458) -* BFD_RELOC_IP2K_BANK: howto manager. (line 1455) -* BFD_RELOC_IP2K_EX8DATA: howto manager. (line 1466) -* BFD_RELOC_IP2K_FR9: howto manager. (line 1452) -* BFD_RELOC_IP2K_FR_OFFSET: howto manager. (line 1479) -* BFD_RELOC_IP2K_HI8DATA: howto manager. (line 1465) -* BFD_RELOC_IP2K_HI8INSN: howto manager. (line 1470) -* BFD_RELOC_IP2K_LO8DATA: howto manager. (line 1464) -* BFD_RELOC_IP2K_LO8INSN: howto manager. (line 1469) -* BFD_RELOC_IP2K_PAGE3: howto manager. (line 1461) -* BFD_RELOC_IP2K_PC_SKIP: howto manager. (line 1473) -* BFD_RELOC_IP2K_TEXT: howto manager. (line 1476) -* BFD_RELOC_IQ2000_OFFSET_16: howto manager. (line 1823) -* BFD_RELOC_IQ2000_OFFSET_21: howto manager. (line 1824) -* BFD_RELOC_IQ2000_UHI16: howto manager. (line 1825) -* BFD_RELOC_LO10: howto manager. (line 102) -* BFD_RELOC_LO16: howto manager. (line 298) -* BFD_RELOC_LO16_BASEREL: howto manager. (line 81) -* BFD_RELOC_LO16_GOTOFF: howto manager. (line 56) -* BFD_RELOC_LO16_PCREL: howto manager. (line 307) -* BFD_RELOC_LO16_PLTOFF: howto manager. (line 68) -* BFD_RELOC_M32C_HI8: howto manager. (line 1009) -* BFD_RELOC_M32C_RL_1ADDR: howto manager. (line 1011) -* BFD_RELOC_M32C_RL_2ADDR: howto manager. (line 1012) -* BFD_RELOC_M32C_RL_JUMP: howto manager. (line 1010) -* BFD_RELOC_M32R_10_PCREL: howto manager. (line 1019) -* BFD_RELOC_M32R_18_PCREL: howto manager. (line 1023) -* BFD_RELOC_M32R_24: howto manager. (line 1015) -* BFD_RELOC_M32R_26_PCREL: howto manager. (line 1026) -* BFD_RELOC_M32R_26_PLTREL: howto manager. (line 1045) -* BFD_RELOC_M32R_COPY: howto manager. (line 1046) -* BFD_RELOC_M32R_GLOB_DAT: howto manager. (line 1047) -* BFD_RELOC_M32R_GOT16_HI_SLO: howto manager. (line 1056) -* BFD_RELOC_M32R_GOT16_HI_ULO: howto manager. (line 1055) -* BFD_RELOC_M32R_GOT16_LO: howto manager. (line 1057) -* BFD_RELOC_M32R_GOT24: howto manager. (line 1044) -* BFD_RELOC_M32R_GOTOFF: howto manager. (line 1050) -* BFD_RELOC_M32R_GOTOFF_HI_SLO: howto manager. (line 1052) -* BFD_RELOC_M32R_GOTOFF_HI_ULO: howto manager. (line 1051) -* BFD_RELOC_M32R_GOTOFF_LO: howto manager. (line 1053) -* BFD_RELOC_M32R_GOTPC24: howto manager. (line 1054) -* BFD_RELOC_M32R_GOTPC_HI_SLO: howto manager. (line 1059) -* BFD_RELOC_M32R_GOTPC_HI_ULO: howto manager. (line 1058) -* BFD_RELOC_M32R_GOTPC_LO: howto manager. (line 1060) -* BFD_RELOC_M32R_HI16_SLO: howto manager. (line 1033) -* BFD_RELOC_M32R_HI16_ULO: howto manager. (line 1029) -* BFD_RELOC_M32R_JMP_SLOT: howto manager. (line 1048) -* BFD_RELOC_M32R_LO16: howto manager. (line 1037) -* BFD_RELOC_M32R_RELATIVE: howto manager. (line 1049) -* BFD_RELOC_M32R_SDA16: howto manager. (line 1040) -* BFD_RELOC_M68HC11_24: howto manager. (line 1620) -* BFD_RELOC_M68HC11_3B: howto manager. (line 1595) -* BFD_RELOC_M68HC11_HI8: howto manager. (line 1587) -* BFD_RELOC_M68HC11_LO16: howto manager. (line 1609) -* BFD_RELOC_M68HC11_LO8: howto manager. (line 1591) -* BFD_RELOC_M68HC11_PAGE: howto manager. (line 1615) -* BFD_RELOC_M68HC11_RL_GROUP: howto manager. (line 1604) -* BFD_RELOC_M68HC11_RL_JUMP: howto manager. (line 1598) -* BFD_RELOC_M68HC12_5B: howto manager. (line 1626) -* BFD_RELOC_MCORE_PCREL_32: howto manager. (line 1200) -* BFD_RELOC_MCORE_PCREL_IMM11BY2: howto manager. (line 1198) -* BFD_RELOC_MCORE_PCREL_IMM4BY2: howto manager. (line 1199) -* BFD_RELOC_MCORE_PCREL_IMM8BY4: howto manager. (line 1197) -* BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2: howto manager. (line 1201) -* BFD_RELOC_MCORE_RVA: howto manager. (line 1202) -* BFD_RELOC_MIPS16_GPREL: howto manager. (line 286) -* BFD_RELOC_MIPS16_HI16: howto manager. (line 310) -* BFD_RELOC_MIPS16_HI16_S: howto manager. (line 313) -* BFD_RELOC_MIPS16_JMP: howto manager. (line 283) -* BFD_RELOC_MIPS16_LO16: howto manager. (line 319) -* BFD_RELOC_MIPS_CALL16: howto manager. (line 326) -* BFD_RELOC_MIPS_CALL_HI16: howto manager. (line 329) -* BFD_RELOC_MIPS_CALL_LO16: howto manager. (line 330) -* BFD_RELOC_MIPS_COPY: howto manager. (line 361) -* BFD_RELOC_MIPS_DELETE: howto manager. (line 339) -* BFD_RELOC_MIPS_GOT16: howto manager. (line 325) -* BFD_RELOC_MIPS_GOT_DISP: howto manager. (line 334) -* BFD_RELOC_MIPS_GOT_HI16: howto manager. (line 327) -* BFD_RELOC_MIPS_GOT_LO16: howto manager. (line 328) -* BFD_RELOC_MIPS_GOT_OFST: howto manager. (line 333) -* BFD_RELOC_MIPS_GOT_PAGE: howto manager. (line 332) -* BFD_RELOC_MIPS_HIGHER: howto manager. (line 341) -* BFD_RELOC_MIPS_HIGHEST: howto manager. (line 340) -* BFD_RELOC_MIPS_INSERT_A: howto manager. (line 337) -* BFD_RELOC_MIPS_INSERT_B: howto manager. (line 338) -* BFD_RELOC_MIPS_JALR: howto manager. (line 345) -* BFD_RELOC_MIPS_JMP: howto manager. (line 279) -* BFD_RELOC_MIPS_JUMP_SLOT: howto manager. (line 362) -* BFD_RELOC_MIPS_LITERAL: howto manager. (line 322) -* BFD_RELOC_MIPS_REL16: howto manager. (line 343) -* BFD_RELOC_MIPS_RELGOT: howto manager. (line 344) -* BFD_RELOC_MIPS_SCN_DISP: howto manager. (line 342) -* BFD_RELOC_MIPS_SHIFT5: howto manager. (line 335) -* BFD_RELOC_MIPS_SHIFT6: howto manager. (line 336) -* BFD_RELOC_MIPS_SUB: howto manager. (line 331) -* BFD_RELOC_MIPS_TLS_DTPMOD32: howto manager. (line 346) -* BFD_RELOC_MIPS_TLS_DTPMOD64: howto manager. (line 348) -* BFD_RELOC_MIPS_TLS_DTPREL32: howto manager. (line 347) -* BFD_RELOC_MIPS_TLS_DTPREL64: howto manager. (line 349) -* BFD_RELOC_MIPS_TLS_DTPREL_HI16: howto manager. (line 352) -* BFD_RELOC_MIPS_TLS_DTPREL_LO16: howto manager. (line 353) -* BFD_RELOC_MIPS_TLS_GD: howto manager. (line 350) -* BFD_RELOC_MIPS_TLS_GOTTPREL: howto manager. (line 354) -* BFD_RELOC_MIPS_TLS_LDM: howto manager. (line 351) -* BFD_RELOC_MIPS_TLS_TPREL32: howto manager. (line 355) -* BFD_RELOC_MIPS_TLS_TPREL64: howto manager. (line 356) -* BFD_RELOC_MIPS_TLS_TPREL_HI16: howto manager. (line 357) -* BFD_RELOC_MIPS_TLS_TPREL_LO16: howto manager. (line 358) -* BFD_RELOC_MMIX_ADDR19: howto manager. (line 1231) -* BFD_RELOC_MMIX_ADDR27: howto manager. (line 1235) -* BFD_RELOC_MMIX_BASE_PLUS_OFFSET: howto manager. (line 1247) -* BFD_RELOC_MMIX_CBRANCH: howto manager. (line 1211) -* BFD_RELOC_MMIX_CBRANCH_1: howto manager. (line 1213) -* BFD_RELOC_MMIX_CBRANCH_2: howto manager. (line 1214) -* BFD_RELOC_MMIX_CBRANCH_3: howto manager. (line 1215) -* BFD_RELOC_MMIX_CBRANCH_J: howto manager. (line 1212) -* BFD_RELOC_MMIX_GETA: howto manager. (line 1205) -* BFD_RELOC_MMIX_GETA_1: howto manager. (line 1206) -* BFD_RELOC_MMIX_GETA_2: howto manager. (line 1207) -* BFD_RELOC_MMIX_GETA_3: howto manager. (line 1208) -* BFD_RELOC_MMIX_JMP: howto manager. (line 1225) -* BFD_RELOC_MMIX_JMP_1: howto manager. (line 1226) -* BFD_RELOC_MMIX_JMP_2: howto manager. (line 1227) -* BFD_RELOC_MMIX_JMP_3: howto manager. (line 1228) -* BFD_RELOC_MMIX_LOCAL: howto manager. (line 1251) -* BFD_RELOC_MMIX_PUSHJ: howto manager. (line 1218) -* BFD_RELOC_MMIX_PUSHJ_1: howto manager. (line 1219) -* BFD_RELOC_MMIX_PUSHJ_2: howto manager. (line 1220) -* BFD_RELOC_MMIX_PUSHJ_3: howto manager. (line 1221) -* BFD_RELOC_MMIX_PUSHJ_STUBBABLE: howto manager. (line 1222) -* BFD_RELOC_MMIX_REG: howto manager. (line 1243) -* BFD_RELOC_MMIX_REG_OR_BYTE: howto manager. (line 1239) -* BFD_RELOC_MN10300_16_PCREL: howto manager. (line 1135) -* BFD_RELOC_MN10300_32_PCREL: howto manager. (line 1131) -* BFD_RELOC_MN10300_COPY: howto manager. (line 421) -* BFD_RELOC_MN10300_GLOB_DAT: howto manager. (line 424) -* BFD_RELOC_MN10300_GOT16: howto manager. (line 417) -* BFD_RELOC_MN10300_GOT24: howto manager. (line 413) -* BFD_RELOC_MN10300_GOT32: howto manager. (line 409) -* BFD_RELOC_MN10300_GOTOFF24: howto manager. (line 406) -* BFD_RELOC_MN10300_JMP_SLOT: howto manager. (line 427) -* BFD_RELOC_MN10300_RELATIVE: howto manager. (line 430) -* BFD_RELOC_MSP430_10_PCREL: howto manager. (line 1814) -* BFD_RELOC_MSP430_16: howto manager. (line 1816) -* BFD_RELOC_MSP430_16_BYTE: howto manager. (line 1818) -* BFD_RELOC_MSP430_16_PCREL: howto manager. (line 1815) -* BFD_RELOC_MSP430_16_PCREL_BYTE: howto manager. (line 1817) -* BFD_RELOC_MSP430_2X_PCREL: howto manager. (line 1819) -* BFD_RELOC_MSP430_RL_PCREL: howto manager. (line 1820) -* BFD_RELOC_MT_GNU_VTENTRY: howto manager. (line 1808) -* BFD_RELOC_MT_GNU_VTINHERIT: howto manager. (line 1805) -* BFD_RELOC_MT_HI16: howto manager. (line 1799) -* BFD_RELOC_MT_LO16: howto manager. (line 1802) -* BFD_RELOC_MT_PC16: howto manager. (line 1796) -* BFD_RELOC_MT_PCINSN8: howto manager. (line 1811) -* BFD_RELOC_NONE: howto manager. (line 116) -* BFD_RELOC_NS32K_DISP_16: howto manager. (line 493) -* BFD_RELOC_NS32K_DISP_16_PCREL: howto manager. (line 496) -* BFD_RELOC_NS32K_DISP_32: howto manager. (line 494) -* BFD_RELOC_NS32K_DISP_32_PCREL: howto manager. (line 497) -* BFD_RELOC_NS32K_DISP_8: howto manager. (line 492) -* BFD_RELOC_NS32K_DISP_8_PCREL: howto manager. (line 495) -* BFD_RELOC_NS32K_IMM_16: howto manager. (line 487) -* BFD_RELOC_NS32K_IMM_16_PCREL: howto manager. (line 490) -* BFD_RELOC_NS32K_IMM_32: howto manager. (line 488) -* BFD_RELOC_NS32K_IMM_32_PCREL: howto manager. (line 491) -* BFD_RELOC_NS32K_IMM_8: howto manager. (line 486) -* BFD_RELOC_NS32K_IMM_8_PCREL: howto manager. (line 489) -* BFD_RELOC_OPENRISC_ABS_26: howto manager. (line 1768) -* BFD_RELOC_OPENRISC_REL_26: howto manager. (line 1769) -* BFD_RELOC_PDP11_DISP_6_PCREL: howto manager. (line 501) -* BFD_RELOC_PDP11_DISP_8_PCREL: howto manager. (line 500) -* BFD_RELOC_PJ_CODE_DIR16: howto manager. (line 506) -* BFD_RELOC_PJ_CODE_DIR32: howto manager. (line 507) -* BFD_RELOC_PJ_CODE_HI16: howto manager. (line 504) -* BFD_RELOC_PJ_CODE_LO16: howto manager. (line 505) -* BFD_RELOC_PJ_CODE_REL16: howto manager. (line 508) -* BFD_RELOC_PJ_CODE_REL32: howto manager. (line 509) -* BFD_RELOC_PPC64_ADDR16_DS: howto manager. (line 554) -* BFD_RELOC_PPC64_ADDR16_LO_DS: howto manager. (line 555) -* BFD_RELOC_PPC64_DTPREL16_DS: howto manager. (line 601) -* BFD_RELOC_PPC64_DTPREL16_HIGHER: howto manager. (line 603) -* BFD_RELOC_PPC64_DTPREL16_HIGHERA: howto manager. (line 604) -* BFD_RELOC_PPC64_DTPREL16_HIGHEST: howto manager. (line 605) -* BFD_RELOC_PPC64_DTPREL16_HIGHESTA: howto manager. (line 606) -* BFD_RELOC_PPC64_DTPREL16_LO_DS: howto manager. (line 602) -* BFD_RELOC_PPC64_GOT16_DS: howto manager. (line 556) -* BFD_RELOC_PPC64_GOT16_LO_DS: howto manager. (line 557) -* BFD_RELOC_PPC64_HIGHER: howto manager. (line 542) -* BFD_RELOC_PPC64_HIGHER_S: howto manager. (line 543) -* BFD_RELOC_PPC64_HIGHEST: howto manager. (line 544) -* BFD_RELOC_PPC64_HIGHEST_S: howto manager. (line 545) -* BFD_RELOC_PPC64_PLT16_LO_DS: howto manager. (line 558) -* BFD_RELOC_PPC64_PLTGOT16: howto manager. (line 550) -* BFD_RELOC_PPC64_PLTGOT16_DS: howto manager. (line 563) -* BFD_RELOC_PPC64_PLTGOT16_HA: howto manager. (line 553) -* BFD_RELOC_PPC64_PLTGOT16_HI: howto manager. (line 552) -* BFD_RELOC_PPC64_PLTGOT16_LO: howto manager. (line 551) -* BFD_RELOC_PPC64_PLTGOT16_LO_DS: howto manager. (line 564) -* BFD_RELOC_PPC64_SECTOFF_DS: howto manager. (line 559) -* BFD_RELOC_PPC64_SECTOFF_LO_DS: howto manager. (line 560) -* BFD_RELOC_PPC64_TOC: howto manager. (line 549) -* BFD_RELOC_PPC64_TOC16_DS: howto manager. (line 561) -* BFD_RELOC_PPC64_TOC16_HA: howto manager. (line 548) -* BFD_RELOC_PPC64_TOC16_HI: howto manager. (line 547) -* BFD_RELOC_PPC64_TOC16_LO: howto manager. (line 546) -* BFD_RELOC_PPC64_TOC16_LO_DS: howto manager. (line 562) -* BFD_RELOC_PPC64_TPREL16_DS: howto manager. (line 595) -* BFD_RELOC_PPC64_TPREL16_HIGHER: howto manager. (line 597) -* BFD_RELOC_PPC64_TPREL16_HIGHERA: howto manager. (line 598) -* BFD_RELOC_PPC64_TPREL16_HIGHEST: howto manager. (line 599) -* BFD_RELOC_PPC64_TPREL16_HIGHESTA: howto manager. (line 600) -* BFD_RELOC_PPC64_TPREL16_LO_DS: howto manager. (line 596) -* BFD_RELOC_PPC_B16: howto manager. (line 515) -* BFD_RELOC_PPC_B16_BRNTAKEN: howto manager. (line 517) -* BFD_RELOC_PPC_B16_BRTAKEN: howto manager. (line 516) -* BFD_RELOC_PPC_B26: howto manager. (line 512) -* BFD_RELOC_PPC_BA16: howto manager. (line 518) -* BFD_RELOC_PPC_BA16_BRNTAKEN: howto manager. (line 520) -* BFD_RELOC_PPC_BA16_BRTAKEN: howto manager. (line 519) -* BFD_RELOC_PPC_BA26: howto manager. (line 513) -* BFD_RELOC_PPC_COPY: howto manager. (line 521) -* BFD_RELOC_PPC_DTPMOD: howto manager. (line 568) -* BFD_RELOC_PPC_DTPREL: howto manager. (line 578) -* BFD_RELOC_PPC_DTPREL16: howto manager. (line 574) -* BFD_RELOC_PPC_DTPREL16_HA: howto manager. (line 577) -* BFD_RELOC_PPC_DTPREL16_HI: howto manager. (line 576) -* BFD_RELOC_PPC_DTPREL16_LO: howto manager. (line 575) -* BFD_RELOC_PPC_EMB_BIT_FLD: howto manager. (line 540) -* BFD_RELOC_PPC_EMB_MRKREF: howto manager. (line 535) -* BFD_RELOC_PPC_EMB_NADDR16: howto manager. (line 527) -* BFD_RELOC_PPC_EMB_NADDR16_HA: howto manager. (line 530) -* BFD_RELOC_PPC_EMB_NADDR16_HI: howto manager. (line 529) -* BFD_RELOC_PPC_EMB_NADDR16_LO: howto manager. (line 528) -* BFD_RELOC_PPC_EMB_NADDR32: howto manager. (line 526) -* BFD_RELOC_PPC_EMB_RELSDA: howto manager. (line 541) -* BFD_RELOC_PPC_EMB_RELSEC16: howto manager. (line 536) -* BFD_RELOC_PPC_EMB_RELST_HA: howto manager. (line 539) -* BFD_RELOC_PPC_EMB_RELST_HI: howto manager. (line 538) -* BFD_RELOC_PPC_EMB_RELST_LO: howto manager. (line 537) -* BFD_RELOC_PPC_EMB_SDA21: howto manager. (line 534) -* BFD_RELOC_PPC_EMB_SDA2I16: howto manager. (line 532) -* BFD_RELOC_PPC_EMB_SDA2REL: howto manager. (line 533) -* BFD_RELOC_PPC_EMB_SDAI16: howto manager. (line 531) -* BFD_RELOC_PPC_GLOB_DAT: howto manager. (line 522) -* BFD_RELOC_PPC_GOT_DTPREL16: howto manager. (line 591) -* BFD_RELOC_PPC_GOT_DTPREL16_HA: howto manager. (line 594) -* BFD_RELOC_PPC_GOT_DTPREL16_HI: howto manager. (line 593) -* BFD_RELOC_PPC_GOT_DTPREL16_LO: howto manager. (line 592) -* BFD_RELOC_PPC_GOT_TLSGD16: howto manager. (line 579) -* BFD_RELOC_PPC_GOT_TLSGD16_HA: howto manager. (line 582) -* BFD_RELOC_PPC_GOT_TLSGD16_HI: howto manager. (line 581) -* BFD_RELOC_PPC_GOT_TLSGD16_LO: howto manager. (line 580) -* BFD_RELOC_PPC_GOT_TLSLD16: howto manager. (line 583) -* BFD_RELOC_PPC_GOT_TLSLD16_HA: howto manager. (line 586) -* BFD_RELOC_PPC_GOT_TLSLD16_HI: howto manager. (line 585) -* BFD_RELOC_PPC_GOT_TLSLD16_LO: howto manager. (line 584) -* BFD_RELOC_PPC_GOT_TPREL16: howto manager. (line 587) -* BFD_RELOC_PPC_GOT_TPREL16_HA: howto manager. (line 590) -* BFD_RELOC_PPC_GOT_TPREL16_HI: howto manager. (line 589) -* BFD_RELOC_PPC_GOT_TPREL16_LO: howto manager. (line 588) -* BFD_RELOC_PPC_JMP_SLOT: howto manager. (line 523) -* BFD_RELOC_PPC_LOCAL24PC: howto manager. (line 525) -* BFD_RELOC_PPC_RELATIVE: howto manager. (line 524) -* BFD_RELOC_PPC_TLS: howto manager. (line 567) -* BFD_RELOC_PPC_TOC16: howto manager. (line 514) -* BFD_RELOC_PPC_TPREL: howto manager. (line 573) -* BFD_RELOC_PPC_TPREL16: howto manager. (line 569) -* BFD_RELOC_PPC_TPREL16_HA: howto manager. (line 572) -* BFD_RELOC_PPC_TPREL16_HI: howto manager. (line 571) -* BFD_RELOC_PPC_TPREL16_LO: howto manager. (line 570) -* BFD_RELOC_RVA: howto manager. (line 85) -* BFD_RELOC_SH_ALIGN: howto manager. (line 745) -* BFD_RELOC_SH_CODE: howto manager. (line 746) -* BFD_RELOC_SH_COPY: howto manager. (line 751) -* BFD_RELOC_SH_COPY64: howto manager. (line 776) -* BFD_RELOC_SH_COUNT: howto manager. (line 744) -* BFD_RELOC_SH_DATA: howto manager. (line 747) -* BFD_RELOC_SH_DISP12: howto manager. (line 727) -* BFD_RELOC_SH_DISP12BY2: howto manager. (line 728) -* BFD_RELOC_SH_DISP12BY4: howto manager. (line 729) -* BFD_RELOC_SH_DISP12BY8: howto manager. (line 730) -* BFD_RELOC_SH_DISP20: howto manager. (line 731) -* BFD_RELOC_SH_DISP20BY8: howto manager. (line 732) -* BFD_RELOC_SH_GLOB_DAT: howto manager. (line 752) -* BFD_RELOC_SH_GLOB_DAT64: howto manager. (line 777) -* BFD_RELOC_SH_GOT10BY4: howto manager. (line 780) -* BFD_RELOC_SH_GOT10BY8: howto manager. (line 781) -* BFD_RELOC_SH_GOT_HI16: howto manager. (line 759) -* BFD_RELOC_SH_GOT_LOW16: howto manager. (line 756) -* BFD_RELOC_SH_GOT_MEDHI16: howto manager. (line 758) -* BFD_RELOC_SH_GOT_MEDLOW16: howto manager. (line 757) -* BFD_RELOC_SH_GOTOFF_HI16: howto manager. (line 771) -* BFD_RELOC_SH_GOTOFF_LOW16: howto manager. (line 768) -* BFD_RELOC_SH_GOTOFF_MEDHI16: howto manager. (line 770) -* BFD_RELOC_SH_GOTOFF_MEDLOW16: howto manager. (line 769) -* BFD_RELOC_SH_GOTPC: howto manager. (line 755) -* BFD_RELOC_SH_GOTPC_HI16: howto manager. (line 775) -* BFD_RELOC_SH_GOTPC_LOW16: howto manager. (line 772) -* BFD_RELOC_SH_GOTPC_MEDHI16: howto manager. (line 774) -* BFD_RELOC_SH_GOTPC_MEDLOW16: howto manager. (line 773) -* BFD_RELOC_SH_GOTPLT10BY4: howto manager. (line 782) -* BFD_RELOC_SH_GOTPLT10BY8: howto manager. (line 783) -* BFD_RELOC_SH_GOTPLT32: howto manager. (line 784) -* BFD_RELOC_SH_GOTPLT_HI16: howto manager. (line 763) -* BFD_RELOC_SH_GOTPLT_LOW16: howto manager. (line 760) -* BFD_RELOC_SH_GOTPLT_MEDHI16: howto manager. (line 762) -* BFD_RELOC_SH_GOTPLT_MEDLOW16: howto manager. (line 761) -* BFD_RELOC_SH_IMM3: howto manager. (line 725) -* BFD_RELOC_SH_IMM3U: howto manager. (line 726) -* BFD_RELOC_SH_IMM4: howto manager. (line 733) -* BFD_RELOC_SH_IMM4BY2: howto manager. (line 734) -* BFD_RELOC_SH_IMM4BY4: howto manager. (line 735) -* BFD_RELOC_SH_IMM8: howto manager. (line 736) -* BFD_RELOC_SH_IMM8BY2: howto manager. (line 737) -* BFD_RELOC_SH_IMM8BY4: howto manager. (line 738) -* BFD_RELOC_SH_IMM_HI16: howto manager. (line 802) -* BFD_RELOC_SH_IMM_HI16_PCREL: howto manager. (line 803) -* BFD_RELOC_SH_IMM_LOW16: howto manager. (line 796) -* BFD_RELOC_SH_IMM_LOW16_PCREL: howto manager. (line 797) -* BFD_RELOC_SH_IMM_MEDHI16: howto manager. (line 800) -* BFD_RELOC_SH_IMM_MEDHI16_PCREL: howto manager. (line 801) -* BFD_RELOC_SH_IMM_MEDLOW16: howto manager. (line 798) -* BFD_RELOC_SH_IMM_MEDLOW16_PCREL: howto manager. (line 799) -* BFD_RELOC_SH_IMMS10: howto manager. (line 790) -* BFD_RELOC_SH_IMMS10BY2: howto manager. (line 791) -* BFD_RELOC_SH_IMMS10BY4: howto manager. (line 792) -* BFD_RELOC_SH_IMMS10BY8: howto manager. (line 793) -* BFD_RELOC_SH_IMMS16: howto manager. (line 794) -* BFD_RELOC_SH_IMMS6: howto manager. (line 787) -* BFD_RELOC_SH_IMMS6BY32: howto manager. (line 788) -* BFD_RELOC_SH_IMMU16: howto manager. (line 795) -* BFD_RELOC_SH_IMMU5: howto manager. (line 786) -* BFD_RELOC_SH_IMMU6: howto manager. (line 789) -* BFD_RELOC_SH_JMP_SLOT: howto manager. (line 753) -* BFD_RELOC_SH_JMP_SLOT64: howto manager. (line 778) -* BFD_RELOC_SH_LABEL: howto manager. (line 748) -* BFD_RELOC_SH_LOOP_END: howto manager. (line 750) -* BFD_RELOC_SH_LOOP_START: howto manager. (line 749) -* BFD_RELOC_SH_PCDISP12BY2: howto manager. (line 724) -* BFD_RELOC_SH_PCDISP8BY2: howto manager. (line 723) -* BFD_RELOC_SH_PCRELIMM8BY2: howto manager. (line 739) -* BFD_RELOC_SH_PCRELIMM8BY4: howto manager. (line 740) -* BFD_RELOC_SH_PLT_HI16: howto manager. (line 767) -* BFD_RELOC_SH_PLT_LOW16: howto manager. (line 764) -* BFD_RELOC_SH_PLT_MEDHI16: howto manager. (line 766) -* BFD_RELOC_SH_PLT_MEDLOW16: howto manager. (line 765) -* BFD_RELOC_SH_PT_16: howto manager. (line 804) -* BFD_RELOC_SH_RELATIVE: howto manager. (line 754) -* BFD_RELOC_SH_RELATIVE64: howto manager. (line 779) -* BFD_RELOC_SH_SHMEDIA_CODE: howto manager. (line 785) -* BFD_RELOC_SH_SWITCH16: howto manager. (line 741) -* BFD_RELOC_SH_SWITCH32: howto manager. (line 742) -* BFD_RELOC_SH_TLS_DTPMOD32: howto manager. (line 810) -* BFD_RELOC_SH_TLS_DTPOFF32: howto manager. (line 811) -* BFD_RELOC_SH_TLS_GD_32: howto manager. (line 805) -* BFD_RELOC_SH_TLS_IE_32: howto manager. (line 808) -* BFD_RELOC_SH_TLS_LD_32: howto manager. (line 806) -* BFD_RELOC_SH_TLS_LDO_32: howto manager. (line 807) -* BFD_RELOC_SH_TLS_LE_32: howto manager. (line 809) -* BFD_RELOC_SH_TLS_TPOFF32: howto manager. (line 812) -* BFD_RELOC_SH_USES: howto manager. (line 743) -* BFD_RELOC_SPARC13: howto manager. (line 119) -* BFD_RELOC_SPARC22: howto manager. (line 118) -* BFD_RELOC_SPARC_10: howto manager. (line 141) -* BFD_RELOC_SPARC_11: howto manager. (line 142) -* BFD_RELOC_SPARC_5: howto manager. (line 154) -* BFD_RELOC_SPARC_6: howto manager. (line 153) -* BFD_RELOC_SPARC_64: howto manager. (line 140) -* BFD_RELOC_SPARC_7: howto manager. (line 152) -* BFD_RELOC_SPARC_BASE13: howto manager. (line 136) -* BFD_RELOC_SPARC_BASE22: howto manager. (line 137) -* BFD_RELOC_SPARC_COPY: howto manager. (line 126) -* BFD_RELOC_SPARC_DISP64: howto manager. (line 155) -* BFD_RELOC_SPARC_GLOB_DAT: howto manager. (line 127) -* BFD_RELOC_SPARC_GOT10: howto manager. (line 120) -* BFD_RELOC_SPARC_GOT13: howto manager. (line 121) -* BFD_RELOC_SPARC_GOT22: howto manager. (line 122) -* BFD_RELOC_SPARC_H44: howto manager. (line 160) -* BFD_RELOC_SPARC_HH22: howto manager. (line 144) -* BFD_RELOC_SPARC_HIX22: howto manager. (line 158) -* BFD_RELOC_SPARC_HM10: howto manager. (line 145) -* BFD_RELOC_SPARC_JMP_SLOT: howto manager. (line 128) -* BFD_RELOC_SPARC_L44: howto manager. (line 162) -* BFD_RELOC_SPARC_LM22: howto manager. (line 146) -* BFD_RELOC_SPARC_LOX10: howto manager. (line 159) -* BFD_RELOC_SPARC_M44: howto manager. (line 161) -* BFD_RELOC_SPARC_OLO10: howto manager. (line 143) -* BFD_RELOC_SPARC_PC10: howto manager. (line 123) -* BFD_RELOC_SPARC_PC22: howto manager. (line 124) -* BFD_RELOC_SPARC_PC_HH22: howto manager. (line 147) -* BFD_RELOC_SPARC_PC_HM10: howto manager. (line 148) -* BFD_RELOC_SPARC_PC_LM22: howto manager. (line 149) -* BFD_RELOC_SPARC_PLT32: howto manager. (line 156) -* BFD_RELOC_SPARC_PLT64: howto manager. (line 157) -* BFD_RELOC_SPARC_REGISTER: howto manager. (line 163) -* BFD_RELOC_SPARC_RELATIVE: howto manager. (line 129) -* BFD_RELOC_SPARC_REV32: howto manager. (line 166) -* BFD_RELOC_SPARC_TLS_DTPMOD32: howto manager. (line 187) -* BFD_RELOC_SPARC_TLS_DTPMOD64: howto manager. (line 188) -* BFD_RELOC_SPARC_TLS_DTPOFF32: howto manager. (line 189) -* BFD_RELOC_SPARC_TLS_DTPOFF64: howto manager. (line 190) -* BFD_RELOC_SPARC_TLS_GD_ADD: howto manager. (line 171) -* BFD_RELOC_SPARC_TLS_GD_CALL: howto manager. (line 172) -* BFD_RELOC_SPARC_TLS_GD_HI22: howto manager. (line 169) -* BFD_RELOC_SPARC_TLS_GD_LO10: howto manager. (line 170) -* BFD_RELOC_SPARC_TLS_IE_ADD: howto manager. (line 184) -* BFD_RELOC_SPARC_TLS_IE_HI22: howto manager. (line 180) -* BFD_RELOC_SPARC_TLS_IE_LD: howto manager. (line 182) -* BFD_RELOC_SPARC_TLS_IE_LDX: howto manager. (line 183) -* BFD_RELOC_SPARC_TLS_IE_LO10: howto manager. (line 181) -* BFD_RELOC_SPARC_TLS_LDM_ADD: howto manager. (line 175) -* BFD_RELOC_SPARC_TLS_LDM_CALL: howto manager. (line 176) -* BFD_RELOC_SPARC_TLS_LDM_HI22: howto manager. (line 173) -* BFD_RELOC_SPARC_TLS_LDM_LO10: howto manager. (line 174) -* BFD_RELOC_SPARC_TLS_LDO_ADD: howto manager. (line 179) -* BFD_RELOC_SPARC_TLS_LDO_HIX22: howto manager. (line 177) -* BFD_RELOC_SPARC_TLS_LDO_LOX10: howto manager. (line 178) -* BFD_RELOC_SPARC_TLS_LE_HIX22: howto manager. (line 185) -* BFD_RELOC_SPARC_TLS_LE_LOX10: howto manager. (line 186) -* BFD_RELOC_SPARC_TLS_TPOFF32: howto manager. (line 191) -* BFD_RELOC_SPARC_TLS_TPOFF64: howto manager. (line 192) -* BFD_RELOC_SPARC_UA16: howto manager. (line 130) -* BFD_RELOC_SPARC_UA32: howto manager. (line 131) -* BFD_RELOC_SPARC_UA64: howto manager. (line 132) -* BFD_RELOC_SPARC_WDISP16: howto manager. (line 150) -* BFD_RELOC_SPARC_WDISP19: howto manager. (line 151) -* BFD_RELOC_SPARC_WDISP22: howto manager. (line 117) -* BFD_RELOC_SPARC_WPLT30: howto manager. (line 125) -* BFD_RELOC_THUMB_PCREL_BLX: howto manager. (line 627) -* BFD_RELOC_THUMB_PCREL_BRANCH12: howto manager. (line 641) -* BFD_RELOC_THUMB_PCREL_BRANCH20: howto manager. (line 642) -* BFD_RELOC_THUMB_PCREL_BRANCH23: howto manager. (line 643) -* BFD_RELOC_THUMB_PCREL_BRANCH25: howto manager. (line 644) -* BFD_RELOC_THUMB_PCREL_BRANCH7: howto manager. (line 639) -* BFD_RELOC_THUMB_PCREL_BRANCH9: howto manager. (line 640) -* BFD_RELOC_TIC30_LDP: howto manager. (line 1139) -* BFD_RELOC_TIC54X_16_OF_23: howto manager. (line 1157) -* BFD_RELOC_TIC54X_23: howto manager. (line 1154) -* BFD_RELOC_TIC54X_MS7_OF_23: howto manager. (line 1162) -* BFD_RELOC_TIC54X_PARTLS7: howto manager. (line 1144) -* BFD_RELOC_TIC54X_PARTMS9: howto manager. (line 1149) -* bfd_reloc_type_lookup: howto manager. (line 1920) -* BFD_RELOC_V850_22_PCREL: howto manager. (line 1066) -* BFD_RELOC_V850_9_PCREL: howto manager. (line 1063) -* BFD_RELOC_V850_ALIGN: howto manager. (line 1124) -* BFD_RELOC_V850_CALLT_16_16_OFFSET: howto manager. (line 1115) -* BFD_RELOC_V850_CALLT_6_7_OFFSET: howto manager. (line 1112) -* BFD_RELOC_V850_LO16_SPLIT_OFFSET: howto manager. (line 1127) -* BFD_RELOC_V850_LONGCALL: howto manager. (line 1118) -* BFD_RELOC_V850_LONGJUMP: howto manager. (line 1121) -* BFD_RELOC_V850_SDA_15_16_OFFSET: howto manager. (line 1072) -* BFD_RELOC_V850_SDA_16_16_OFFSET: howto manager. (line 1069) -* BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET: howto manager. (line 1104) -* BFD_RELOC_V850_TDA_16_16_OFFSET: howto manager. (line 1094) -* BFD_RELOC_V850_TDA_4_4_OFFSET: howto manager. (line 1101) -* BFD_RELOC_V850_TDA_4_5_OFFSET: howto manager. (line 1097) -* BFD_RELOC_V850_TDA_6_8_OFFSET: howto manager. (line 1083) -* BFD_RELOC_V850_TDA_7_7_OFFSET: howto manager. (line 1091) -* BFD_RELOC_V850_TDA_7_8_OFFSET: howto manager. (line 1087) -* BFD_RELOC_V850_ZDA_15_16_OFFSET: howto manager. (line 1079) -* BFD_RELOC_V850_ZDA_16_16_OFFSET: howto manager. (line 1076) -* BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET: howto manager. (line 1108) -* BFD_RELOC_VAX_GLOB_DAT: howto manager. (line 1791) -* BFD_RELOC_VAX_JMP_SLOT: howto manager. (line 1792) -* BFD_RELOC_VAX_RELATIVE: howto manager. (line 1793) -* BFD_RELOC_VPE4KMATH_DATA: howto manager. (line 1482) -* BFD_RELOC_VPE4KMATH_INSN: howto manager. (line 1483) -* BFD_RELOC_VTABLE_ENTRY: howto manager. (line 1487) -* BFD_RELOC_VTABLE_INHERIT: howto manager. (line 1486) -* BFD_RELOC_X86_64_32S: howto manager. (line 465) -* BFD_RELOC_X86_64_COPY: howto manager. (line 460) -* BFD_RELOC_X86_64_DTPMOD64: howto manager. (line 466) -* BFD_RELOC_X86_64_DTPOFF32: howto manager. (line 471) -* BFD_RELOC_X86_64_DTPOFF64: howto manager. (line 467) -* BFD_RELOC_X86_64_GLOB_DAT: howto manager. (line 461) -* BFD_RELOC_X86_64_GOT32: howto manager. (line 458) -* BFD_RELOC_X86_64_GOT64: howto manager. (line 476) -* BFD_RELOC_X86_64_GOTOFF64: howto manager. (line 474) -* BFD_RELOC_X86_64_GOTPC32: howto manager. (line 475) -* BFD_RELOC_X86_64_GOTPC32_TLSDESC: howto manager. (line 481) -* BFD_RELOC_X86_64_GOTPC64: howto manager. (line 478) -* BFD_RELOC_X86_64_GOTPCREL: howto manager. (line 464) -* BFD_RELOC_X86_64_GOTPCREL64: howto manager. (line 477) -* BFD_RELOC_X86_64_GOTPLT64: howto manager. (line 479) -* BFD_RELOC_X86_64_GOTTPOFF: howto manager. (line 472) -* BFD_RELOC_X86_64_JUMP_SLOT: howto manager. (line 462) -* BFD_RELOC_X86_64_PLT32: howto manager. (line 459) -* BFD_RELOC_X86_64_PLTOFF64: howto manager. (line 480) -* BFD_RELOC_X86_64_RELATIVE: howto manager. (line 463) -* BFD_RELOC_X86_64_TLSDESC: howto manager. (line 483) -* BFD_RELOC_X86_64_TLSDESC_CALL: howto manager. (line 482) -* BFD_RELOC_X86_64_TLSGD: howto manager. (line 469) -* BFD_RELOC_X86_64_TLSLD: howto manager. (line 470) -* BFD_RELOC_X86_64_TPOFF32: howto manager. (line 473) -* BFD_RELOC_X86_64_TPOFF64: howto manager. (line 468) -* BFD_RELOC_XC16X_PAG: howto manager. (line 1785) -* BFD_RELOC_XC16X_POF: howto manager. (line 1786) -* BFD_RELOC_XC16X_SEG: howto manager. (line 1787) -* BFD_RELOC_XC16X_SOF: howto manager. (line 1788) -* BFD_RELOC_XSTORMY16_12: howto manager. (line 1780) -* BFD_RELOC_XSTORMY16_24: howto manager. (line 1781) -* BFD_RELOC_XSTORMY16_FPTR16: howto manager. (line 1782) -* BFD_RELOC_XSTORMY16_REL_12: howto manager. (line 1779) -* BFD_RELOC_XTENSA_ASM_EXPAND: howto manager. (line 1897) -* BFD_RELOC_XTENSA_ASM_SIMPLIFY: howto manager. (line 1902) -* BFD_RELOC_XTENSA_DIFF16: howto manager. (line 1844) -* BFD_RELOC_XTENSA_DIFF32: howto manager. (line 1845) -* BFD_RELOC_XTENSA_DIFF8: howto manager. (line 1843) -* BFD_RELOC_XTENSA_GLOB_DAT: howto manager. (line 1833) -* BFD_RELOC_XTENSA_JMP_SLOT: howto manager. (line 1834) -* BFD_RELOC_XTENSA_OP0: howto manager. (line 1891) -* BFD_RELOC_XTENSA_OP1: howto manager. (line 1892) -* BFD_RELOC_XTENSA_OP2: howto manager. (line 1893) -* BFD_RELOC_XTENSA_PLT: howto manager. (line 1838) -* BFD_RELOC_XTENSA_RELATIVE: howto manager. (line 1835) -* BFD_RELOC_XTENSA_RTLD: howto manager. (line 1828) -* BFD_RELOC_XTENSA_SLOT0_ALT: howto manager. (line 1873) -* BFD_RELOC_XTENSA_SLOT0_OP: howto manager. (line 1853) -* BFD_RELOC_XTENSA_SLOT10_ALT: howto manager. (line 1883) -* BFD_RELOC_XTENSA_SLOT10_OP: howto manager. (line 1863) -* BFD_RELOC_XTENSA_SLOT11_ALT: howto manager. (line 1884) -* BFD_RELOC_XTENSA_SLOT11_OP: howto manager. (line 1864) -* BFD_RELOC_XTENSA_SLOT12_ALT: howto manager. (line 1885) -* BFD_RELOC_XTENSA_SLOT12_OP: howto manager. (line 1865) -* BFD_RELOC_XTENSA_SLOT13_ALT: howto manager. (line 1886) -* BFD_RELOC_XTENSA_SLOT13_OP: howto manager. (line 1866) -* BFD_RELOC_XTENSA_SLOT14_ALT: howto manager. (line 1887) -* BFD_RELOC_XTENSA_SLOT14_OP: howto manager. (line 1867) -* BFD_RELOC_XTENSA_SLOT1_ALT: howto manager. (line 1874) -* BFD_RELOC_XTENSA_SLOT1_OP: howto manager. (line 1854) -* BFD_RELOC_XTENSA_SLOT2_ALT: howto manager. (line 1875) -* BFD_RELOC_XTENSA_SLOT2_OP: howto manager. (line 1855) -* BFD_RELOC_XTENSA_SLOT3_ALT: howto manager. (line 1876) -* BFD_RELOC_XTENSA_SLOT3_OP: howto manager. (line 1856) -* BFD_RELOC_XTENSA_SLOT4_ALT: howto manager. (line 1877) -* BFD_RELOC_XTENSA_SLOT4_OP: howto manager. (line 1857) -* BFD_RELOC_XTENSA_SLOT5_ALT: howto manager. (line 1878) -* BFD_RELOC_XTENSA_SLOT5_OP: howto manager. (line 1858) -* BFD_RELOC_XTENSA_SLOT6_ALT: howto manager. (line 1879) -* BFD_RELOC_XTENSA_SLOT6_OP: howto manager. (line 1859) -* BFD_RELOC_XTENSA_SLOT7_ALT: howto manager. (line 1880) -* BFD_RELOC_XTENSA_SLOT7_OP: howto manager. (line 1860) -* BFD_RELOC_XTENSA_SLOT8_ALT: howto manager. (line 1881) -* BFD_RELOC_XTENSA_SLOT8_OP: howto manager. (line 1861) -* BFD_RELOC_XTENSA_SLOT9_ALT: howto manager. (line 1882) -* BFD_RELOC_XTENSA_SLOT9_OP: howto manager. (line 1862) -* BFD_RELOC_Z80_DISP8: howto manager. (line 1907) -* BFD_RELOC_Z8K_CALLR: howto manager. (line 1913) -* BFD_RELOC_Z8K_DISP7: howto manager. (line 1910) -* BFD_RELOC_Z8K_IMM4L: howto manager. (line 1916) -* bfd_scan_arch: Architectures. (line 392) -* bfd_scan_vma: BFD front end. (line 423) -* bfd_seach_for_target: bfd_target. (line 459) -* bfd_section_already_linked: Writing the symbol table. - (line 55) -* bfd_section_list_clear: section prototypes. (line 8) -* bfd_sections_find_if: section prototypes. (line 176) -* bfd_set_arch_info: Architectures. (line 433) -* bfd_set_archive_head: Archives. (line 69) -* bfd_set_default_target: bfd_target. (line 424) -* bfd_set_error: BFD front end. (line 235) -* bfd_set_error_handler: BFD front end. (line 275) -* bfd_set_error_program_name: BFD front end. (line 284) -* bfd_set_file_flags: BFD front end. (line 343) -* bfd_set_format: Formats. (line 68) -* bfd_set_gp_size: BFD front end. (line 413) -* bfd_set_private_flags: BFD front end. (line 490) -* bfd_set_reloc: BFD front end. (line 333) -* bfd_set_section_contents: section prototypes. (line 207) -* bfd_set_section_flags: section prototypes. (line 140) -* bfd_set_section_size: section prototypes. (line 193) -* bfd_set_start_address: BFD front end. (line 392) -* bfd_set_symtab: symbol handling functions. - (line 60) -* bfd_symbol_info: symbol handling functions. - (line 130) -* bfd_target_list: bfd_target. (line 450) -* bfd_write_bigendian_4byte_int: Internal. (line 13) -* bfd_zalloc: Opening and Closing. - (line 221) -* bfd_zalloc2: Opening and Closing. - (line 230) -* coff_symbol_type: coff. (line 186) -* core_file_matches_executable_p: Core Files. (line 30) -* find_separate_debug_file: Opening and Closing. - (line 272) -* generic_core_file_matches_executable_p: Core Files. (line 40) -* get_debug_link_info: Opening and Closing. - (line 253) -* Hash tables: Hash Tables. (line 6) -* internal object-file format: Canonical format. (line 11) -* Linker: Linker Functions. (line 6) -* Other functions: BFD front end. (line 505) -* separate_debug_file_exists: Opening and Closing. - (line 263) -* struct bfd_iovec: BFD front end. (line 657) -* target vector (_bfd_final_link): Performing the Final Link. - (line 6) -* target vector (_bfd_link_add_symbols): Adding Symbols to the Hash Table. - (line 6) -* target vector (_bfd_link_hash_table_create): Creating a Linker Hash Table. - (line 6) -* The HOWTO Macro: typedef arelent. (line 291) -* what is it?: Overview. (line 6) - - - -Tag Table: -Node: Top724 -Node: Overview1056 -Node: History2107 -Node: How It Works3053 -Node: What BFD Version 2 Can Do4595 -Node: BFD information loss5910 -Node: Canonical format8442 -Node: BFD front end12814 -Node: Memory Usage38428 -Node: Initialization39656 -Node: Sections40115 -Node: Section Input40598 -Node: Section Output41963 -Node: typedef asection44449 -Node: section prototypes69406 -Node: Symbols79086 -Node: Reading Symbols80681 -Node: Writing Symbols81788 -Node: Mini Symbols83497 -Node: typedef asymbol84471 -Node: symbol handling functions89389 -Node: Archives94731 -Node: Formats98457 -Node: Relocations101405 -Node: typedef arelent102132 -Node: howto manager117943 -Node: Core Files180223 -Node: Targets182040 -Node: bfd_target184010 -Node: Architectures204090 -Node: Opening and Closing225522 -Node: Internal236524 -Node: File Caching242857 -Node: Linker Functions244771 -Node: Creating a Linker Hash Table246444 -Node: Adding Symbols to the Hash Table248182 -Node: Differing file formats249082 -Node: Adding symbols from an object file250830 -Node: Adding symbols from an archive252981 -Node: Performing the Final Link255395 -Node: Information provided by the linker256637 -Node: Relocating the section contents257791 -Node: Writing the symbol table259542 -Node: Hash Tables262535 -Node: Creating and Freeing a Hash Table263733 -Node: Looking Up or Entering a String264983 -Node: Traversing a Hash Table266236 -Node: Deriving a New Hash Table Type267025 -Node: Define the Derived Structures268091 -Node: Write the Derived Creation Routine269172 -Node: Write Other Derived Routines271796 -Node: BFD back ends273111 -Node: What to Put Where273381 -Node: aout273519 -Node: coff279837 -Node: elf304314 -Node: mmo305177 -Node: File layout306105 -Node: Symbol-table311752 -Node: mmo section mapping315521 -Node: GNU Free Documentation License319173 -Node: Index338898 - -End Tag Table diff --git a/bfd/doc/bfd.texinfo b/bfd/doc/bfd.texinfo index 432e0526449..04b4266e651 100644 --- a/bfd/doc/bfd.texinfo +++ b/bfd/doc/bfd.texinfo @@ -1,7 +1,7 @@ \input texinfo.tex @setfilename bfd.info @c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1997, 2000, -@c 2001, 2002, 2003 +@c 2001, 2002, 2003, 2006, 2007 @c Free Software Foundation, Inc. @c @synindex fn cp @@ -14,26 +14,29 @@ END-INFO-DIR-ENTRY @end format @end ifinfo -@ifinfo +@copying This file documents the BFD library. -Copyright (C) 1991, 2000, 2001, 2003 Free Software Foundation, Inc. +Copyright @copyright{} 1991, 2000, 2001, 2003, 2006, 2007 Free Software Foundation, Inc. - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.1 - or any later version published by the Free Software Foundation; - with no Invariant Sections, with no Front-Cover Texts, and with no - Back-Cover Texts. A copy of the license is included in the - section entitled ``GNU Free Documentation License''. +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 or +any later version published by the Free Software Foundation; with the +Invariant Sections being ``GNU General Public License'' and ``Funding +Free Software'', the Front-Cover texts being (a) (see below), and with +the Back-Cover Texts being (b) (see below). A copy of the license is +included in the section entitled ``GNU Free Documentation License''. -@ignore -Permission is granted to process this file through Tex and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). +(a) The FSF's Front-Cover Text is: -@end ignore -@end ifinfo + A GNU Manual + +(b) The FSF's Back-Cover Text is: + + You have freedom to copy and modify this GNU Manual, like GNU + software. Copies published by the Free Software Foundation raise + funds for GNU development. +@end copying @iftex @c@finalout @setchapternewpage on @@ -43,7 +46,7 @@ notice identical to this one except for the removal of this paragraph @title{libbfd} @subtitle{The Binary File Descriptor Library} @sp 1 -@subtitle First Edition---BFD version < 3.0 % Since no product is stable berfore version 3.0 :-) +@subtitle First Edition---BFD version < 3.0 % Since no product is stable before version 3.0 :-) @subtitle Original Document Created: April 1991 @author {Steve Chamberlain} @author {Cygnus Support} @@ -62,7 +65,7 @@ notice identical to this one except for the removal of this paragraph @end tex @vskip 0pt plus 1filll -Copyright @copyright{} 1991, 2001, 2003 Free Software Foundation, Inc. +Copyright @copyright{} 1991, 2001, 2003, 2006 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 @@ -73,6 +76,7 @@ Copyright @copyright{} 1991, 2001, 2003 Free Software Foundation, Inc. @end titlepage @end iftex +@contents @node Top, Overview, (dir), (dir) @ifinfo @@ -84,7 +88,7 @@ This file documents the binary file descriptor library libbfd. * BFD front end:: BFD front end * BFD back ends:: BFD back ends * GNU Free Documentation License:: GNU Free Documentation License -* Index:: Index +* BFD Index:: BFD Index @end menu @node Overview, BFD front end, Top, Top @@ -144,7 +148,7 @@ To use the library, include @file{bfd.h} and link with @file{libbfd.a}. BFD provides a common interface to the parts of an object file for a calling application. -When an application sucessfully opens a target file (object, archive, or +When an application successfully opens a target file (object, archive, or whatever), a pointer to an internal structure is returned. This pointer points to a structure called @code{bfd}, described in @file{bfd.h}. Our convention is to call this pointer a BFD, and @@ -294,6 +298,7 @@ structures. @end ignore @end menu @node What to Put Where, aout, BFD back ends, BFD back ends +@section What to Put Where All of BFD lives in one directory. @node aout, coff, What to Put Where, BFD back ends @@ -310,11 +315,11 @@ All of BFD lives in one directory. @node mmo, , elf, BFD back ends @include mmo.texi -@node GNU Free Documentation License, Index, BFD back ends, Top +@node GNU Free Documentation License, BFD Index, BFD back ends, Top @include fdl.texi -@node Index, , GNU Free Documentation License, Top -@unnumbered Index +@node BFD Index, , GNU Free Documentation License, Top +@unnumbered BFD Index @printindex cp @tex @@ -332,5 +337,4 @@ All of BFD lives in one directory. % Blame: doc@cygnus.com, 28mar91. @end tex -@contents @bye diff --git a/bfd/doc/bfdint.texi b/bfd/doc/bfdint.texi index 98826fd5206..b7e7c548e6a 100644 --- a/bfd/doc/bfdint.texi +++ b/bfd/doc/bfdint.texi @@ -1,6 +1,6 @@ \input texinfo @c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, -@c 2000, 2001, 2002, 2003, 2004 +@c 2000, 2001, 2002, 2003, 2004, 2006, 2007 @c Free Software Foundation, Inc. @setfilename bfdint.info @@ -13,6 +13,33 @@ @page @end iftex +@copying +This file documents the internals of the BFD library. + +Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, +1996, 1998, 2000, 2001, 2002, 2003, 2004, 2006, 2007 +Free Software Foundation, Inc. +Contributed by Cygnus Support. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 or +any later version published by the Free Software Foundation; with the +Invariant Sections being ``GNU General Public License'' and ``Funding +Free Software'', the Front-Cover texts being (a) (see below), and with +the Back-Cover Texts being (b) (see below). A copy of the license is +included in the section entitled ``GNU Free Documentation License''. + +(a) The FSF's Front-Cover Text is: + + A GNU Manual + +(b) The FSF's Back-Cover Text is: + + You have freedom to copy and modify this GNU Manual, like GNU + software. Copies published by the Free Software Foundation raise + funds for GNU development. +@end copying + @node Top @top BFD Internals @raisesections @@ -189,7 +216,7 @@ and handle it using the special hooks. In some cases there is also implicit information which BFD can not represent. For example, the MIPS processor distinguishes small and -large symbols, and requires that all small symbls be within 32K of the +large symbols, and requires that all small symbols be within 32K of the GP register. This means that the MIPS assembler must be able to mark variables as either small or large, and the MIPS linker must know to put small symbols within range of the GP register. Since BFD can not @@ -230,7 +257,7 @@ Follow the GNU coding standards. Avoid global variables. We ideally want BFD to be fully reentrant, so that it can be used in multiple threads. All uses of global or static variables interfere with that. Initialized constant variables are OK, -and they should be explicitly marked with const. Instead of global +and they should be explicitly marked with @samp{const}. Instead of global variables, use data attached to a BFD or to a linker hash table. @item @@ -1391,7 +1418,7 @@ constants used by the generic support. @subsection ELF sections and segments The ELF ABI permits a file to have either sections or segments or both. -Relocateable object files conventionally have only sections. +Relocatable object files conventionally have only sections. Executables conventionally have both. Core files conventionally have only program segments. @@ -1744,23 +1771,6 @@ support. The processor function hooks and constants are ad hoc and need better documentation. -When a linker script uses @samp{SIZEOF_HEADERS}, the ELF backend must -guess at the number of program segments which will be required, in -@samp{get_program_header_size}. This is because the linker calls -@samp{bfd_sizeof_headers} before it knows all the section addresses and -sizes. The ELF backend may later discover, when creating program -segments, that more program segments are required. This is currently -reported as an error in @samp{assign_file_positions_for_segments}. - -In practice this makes it difficult to use @samp{SIZEOF_HEADERS} except -with a carefully defined linker script. Unfortunately, -@samp{SIZEOF_HEADERS} is required for fast program loading on a native -system, since it permits the initial code section to appear on the same -page as the program segments, saving a page read when the program starts -running. Fortunately, native systems permit careful definition of the -linker script. Still, ideally it would be possible to use relaxation to -compute the number of program segments. - @node BFD glossary @section BFD glossary @cindex glossary for bfd diff --git a/bfd/doc/bfdio.texi b/bfd/doc/bfdio.texi deleted file mode 100644 index eb7e31df9d0..00000000000 --- a/bfd/doc/bfdio.texi +++ /dev/null @@ -1,72 +0,0 @@ -@findex struct bfd_iovec -@subsubsection @code{struct bfd_iovec} -@strong{Description}@* -The @code{struct bfd_iovec} contains the internal file I/O class. -Each @code{BFD} has an instance of this class and all file I/O is -routed through it (it is assumed that the instance implements -all methods listed below). -@example -struct bfd_iovec -@{ - /* To avoid problems with macros, a "b" rather than "f" - prefix is prepended to each method name. */ - /* Attempt to read/write NBYTES on ABFD's IOSTREAM storing/fetching - bytes starting at PTR. Return the number of bytes actually - transfered (a read past end-of-file returns less than NBYTES), - or -1 (setting @code{bfd_error}) if an error occurs. */ - file_ptr (*bread) (struct bfd *abfd, void *ptr, file_ptr nbytes); - file_ptr (*bwrite) (struct bfd *abfd, const void *ptr, - file_ptr nbytes); - /* Return the current IOSTREAM file offset, or -1 (setting @code{bfd_error} - if an error occurs. */ - file_ptr (*btell) (struct bfd *abfd); - /* For the following, on successful completion a value of 0 is returned. - Otherwise, a value of -1 is returned (and @code{bfd_error} is set). */ - int (*bseek) (struct bfd *abfd, file_ptr offset, int whence); - int (*bclose) (struct bfd *abfd); - int (*bflush) (struct bfd *abfd); - int (*bstat) (struct bfd *abfd, struct stat *sb); -@}; -@end example - -@findex bfd_get_mtime -@subsubsection @code{bfd_get_mtime} -@strong{Synopsis} -@example -long bfd_get_mtime (bfd *abfd); -@end example -@strong{Description}@* -Return the file modification time (as read from the file system, or -from the archive header for archive members). - -@findex bfd_get_size -@subsubsection @code{bfd_get_size} -@strong{Synopsis} -@example -long bfd_get_size (bfd *abfd); -@end example -@strong{Description}@* -Return the file size (as read from file system) for the file -associated with BFD @var{abfd}. - -The initial motivation for, and use of, this routine is not -so we can get the exact size of the object the BFD applies to, since -that might not be generally possible (archive members for example). -It would be ideal if someone could eventually modify -it so that such results were guaranteed. - -Instead, we want to ask questions like "is this NNN byte sized -object I'm about to try read from file offset YYY reasonable?" -As as example of where we might do this, some object formats -use string tables for which the first @code{sizeof (long)} bytes of the -table contain the size of the table itself, including the size bytes. -If an application tries to read what it thinks is one of these -string tables, without some way to validate the size, and for -some reason the size is wrong (byte swapping error, wrong location -for the string table, etc.), the only clue is likely to be a read -error when it tries to read the table, or a "virtual memory -exhausted" error when it tries to allocate 15 bazillon bytes -of space for the 15 bazillon byte table it is about to read. -This function at least allows us to answer the question, "is the -size reasonable?". - diff --git a/bfd/doc/bfdt.texi b/bfd/doc/bfdt.texi deleted file mode 100644 index a22fe3861d9..00000000000 --- a/bfd/doc/bfdt.texi +++ /dev/null @@ -1,721 +0,0 @@ -@section @code{typedef bfd} -A BFD has type @code{bfd}; objects of this type are the -cornerstone of any application using BFD. Using BFD -consists of making references though the BFD and to data in the BFD. - -Here is the structure that defines the type @code{bfd}. It -contains the major data about the file and pointers -to the rest of the data. - - -@example - -struct bfd -@{ - /* A unique identifier of the BFD */ - unsigned int id; - - /* The filename the application opened the BFD with. */ - const char *filename; - - /* A pointer to the target jump table. */ - const struct bfd_target *xvec; - - /* The IOSTREAM, and corresponding IO vector that provide access - to the file backing the BFD. */ - void *iostream; - const struct bfd_iovec *iovec; - - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - bfd_boolean cacheable; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - bfd_boolean target_defaulted; - - /* The caching routines use these to maintain a - least-recently-used list of BFDs. */ - struct bfd *lru_prev, *lru_next; - - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ - ufile_ptr where; - - /* ... and here: (``once'' means at least once). */ - bfd_boolean opened_once; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - bfd_boolean mtime_set; - - /* File modified time, if mtime_set is TRUE. */ - long mtime; - - /* Reserved for an unimplemented file locking extension. */ - int ifd; - - /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; - - /* The direction with which the BFD was opened. */ - enum bfd_direction - @{ - no_direction = 0, - read_direction = 1, - write_direction = 2, - both_direction = 3 - @} - direction; - - /* Format_specific flags. */ - flagword flags; - - /* Currently my_archive is tested before adding origin to - anything. I believe that this can become always an add of - origin, with origin set to 0 for non archive files. */ - ufile_ptr origin; - - /* Remember when output has begun, to stop strange things - from happening. */ - bfd_boolean output_has_begun; - - /* A hash table for section names. */ - struct bfd_hash_table section_htab; - - /* Pointer to linked list of sections. */ - struct bfd_section *sections; - - /* The last section on the section list. */ - struct bfd_section *section_last; - - /* The number of sections. */ - unsigned int section_count; - - /* Stuff only useful for object files: - The start address. */ - bfd_vma start_address; - - /* Used for input and output. */ - unsigned int symcount; - - /* Symbol table for output BFD (with symcount entries). */ - struct bfd_symbol **outsymbols; - - /* Used for slurped dynamic symbol tables. */ - unsigned int dynsymcount; - - /* Pointer to structure which contains architecture information. */ - const struct bfd_arch_info *arch_info; - - /* Flag set if symbols from this BFD should not be exported. */ - bfd_boolean no_export; - - /* Stuff only useful for archives. */ - void *arelt_data; - struct bfd *my_archive; /* The containing archive BFD. */ - struct bfd *next; /* The next BFD in the archive. */ - struct bfd *archive_head; /* The first BFD in the archive. */ - bfd_boolean has_armap; - - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; - - /* Used by the back end to hold private data. */ - union - @{ - struct aout_data_struct *aout_data; - struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; - struct coff_tdata *coff_obj_data; - struct pe_tdata *pe_obj_data; - struct xcoff_tdata *xcoff_obj_data; - struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; - struct srec_data_struct *srec_data; - struct ihex_data_struct *ihex_data; - struct tekhex_data_struct *tekhex_data; - struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; - struct mmo_data_struct *mmo_data; - struct sun_core_struct *sun_core_data; - struct sco5_core_struct *sco5_core_data; - struct trad_core_struct *trad_core_data; - struct som_data_struct *som_data; - struct hpux_core_struct *hpux_core_data; - struct hppabsd_core_struct *hppabsd_core_data; - struct sgi_core_struct *sgi_core_data; - struct lynx_core_struct *lynx_core_data; - struct osf_core_struct *osf_core_data; - struct cisco_core_struct *cisco_core_data; - struct versados_data_struct *versados_data; - struct netbsd_core_struct *netbsd_core_data; - struct mach_o_data_struct *mach_o_data; - struct mach_o_fat_data_struct *mach_o_fat_data; - struct bfd_pef_data_struct *pef_data; - struct bfd_pef_xlib_data_struct *pef_xlib_data; - struct bfd_sym_data_struct *sym_data; - void *any; - @} - tdata; - - /* Used by the application to hold private data. */ - void *usrdata; - - /* Where all the allocated stuff under this BFD goes. This is a - struct objalloc *, but we use void * to avoid requiring the inclusion - of objalloc.h. */ - void *memory; -@}; - -@end example -@section Error reporting -Most BFD functions return nonzero on success (check their -individual documentation for precise semantics). On an error, -they call @code{bfd_set_error} to set an error condition that callers -can check by calling @code{bfd_get_error}. -If that returns @code{bfd_error_system_call}, then check -@code{errno}. - -The easiest way to report a BFD error to the user is to -use @code{bfd_perror}. - -@subsection Type @code{bfd_error_type} -The values returned by @code{bfd_get_error} are defined by the -enumerated type @code{bfd_error_type}. - - -@example - -typedef enum bfd_error -@{ - bfd_error_no_error = 0, - bfd_error_system_call, - bfd_error_invalid_target, - bfd_error_wrong_format, - bfd_error_wrong_object_format, - bfd_error_invalid_operation, - bfd_error_no_memory, - bfd_error_no_symbols, - bfd_error_no_armap, - bfd_error_no_more_archived_files, - bfd_error_malformed_archive, - bfd_error_file_not_recognized, - bfd_error_file_ambiguously_recognized, - bfd_error_no_contents, - bfd_error_nonrepresentable_section, - bfd_error_no_debug_section, - bfd_error_bad_value, - bfd_error_file_truncated, - bfd_error_file_too_big, - bfd_error_invalid_error_code -@} -bfd_error_type; - -@end example -@findex bfd_get_error -@subsubsection @code{bfd_get_error} -@strong{Synopsis} -@example -bfd_error_type bfd_get_error (void); -@end example -@strong{Description}@* -Return the current BFD error condition. - -@findex bfd_set_error -@subsubsection @code{bfd_set_error} -@strong{Synopsis} -@example -void bfd_set_error (bfd_error_type error_tag); -@end example -@strong{Description}@* -Set the BFD error condition to be @var{error_tag}. - -@findex bfd_errmsg -@subsubsection @code{bfd_errmsg} -@strong{Synopsis} -@example -const char *bfd_errmsg (bfd_error_type error_tag); -@end example -@strong{Description}@* -Return a string describing the error @var{error_tag}, or -the system error if @var{error_tag} is @code{bfd_error_system_call}. - -@findex bfd_perror -@subsubsection @code{bfd_perror} -@strong{Synopsis} -@example -void bfd_perror (const char *message); -@end example -@strong{Description}@* -Print to the standard error stream a string describing the -last BFD error that occurred, or the last system error if -the last BFD error was a system call failure. If @var{message} -is non-NULL and non-empty, the error string printed is preceded -by @var{message}, a colon, and a space. It is followed by a newline. - -@subsection BFD error handler -Some BFD functions want to print messages describing the -problem. They call a BFD error handler function. This -function may be overridden by the program. - -The BFD error handler acts like printf. - - -@example - -typedef void (*bfd_error_handler_type) (const char *, ...); - -@end example -@findex bfd_set_error_handler -@subsubsection @code{bfd_set_error_handler} -@strong{Synopsis} -@example -bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); -@end example -@strong{Description}@* -Set the BFD error handler function. Returns the previous -function. - -@findex bfd_set_error_program_name -@subsubsection @code{bfd_set_error_program_name} -@strong{Synopsis} -@example -void bfd_set_error_program_name (const char *); -@end example -@strong{Description}@* -Set the program name to use when printing a BFD error. This -is printed before the error message followed by a colon and -space. The string must not be changed after it is passed to -this function. - -@findex bfd_get_error_handler -@subsubsection @code{bfd_get_error_handler} -@strong{Synopsis} -@example -bfd_error_handler_type bfd_get_error_handler (void); -@end example -@strong{Description}@* -Return the BFD error handler function. - -@section Miscellaneous - - -@subsection Miscellaneous functions - - -@findex bfd_get_reloc_upper_bound -@subsubsection @code{bfd_get_reloc_upper_bound} -@strong{Synopsis} -@example -long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); -@end example -@strong{Description}@* -Return the number of bytes required to store the -relocation information associated with section @var{sect} -attached to bfd @var{abfd}. If an error occurs, return -1. - -@findex bfd_canonicalize_reloc -@subsubsection @code{bfd_canonicalize_reloc} -@strong{Synopsis} -@example -long bfd_canonicalize_reloc - (bfd *abfd, asection *sec, arelent **loc, asymbol **syms); -@end example -@strong{Description}@* -Call the back end associated with the open BFD -@var{abfd} and translate the external form of the relocation -information attached to @var{sec} into the internal canonical -form. Place the table into memory at @var{loc}, which has -been preallocated, usually by a call to -@code{bfd_get_reloc_upper_bound}. Returns the number of relocs, or --1 on error. - -The @var{syms} table is also needed for horrible internal magic -reasons. - -@findex bfd_set_reloc -@subsubsection @code{bfd_set_reloc} -@strong{Synopsis} -@example -void bfd_set_reloc - (bfd *abfd, asection *sec, arelent **rel, unsigned int count); -@end example -@strong{Description}@* -Set the relocation pointer and count within -section @var{sec} to the values @var{rel} and @var{count}. -The argument @var{abfd} is ignored. - -@findex bfd_set_file_flags -@subsubsection @code{bfd_set_file_flags} -@strong{Synopsis} -@example -bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); -@end example -@strong{Description}@* -Set the flag word in the BFD @var{abfd} to the value @var{flags}. - -Possible errors are: -@itemize @bullet - -@item -@code{bfd_error_wrong_format} - The target bfd was not of object format. -@item -@code{bfd_error_invalid_operation} - The target bfd was open for reading. -@item -@code{bfd_error_invalid_operation} - -The flag word contained a bit which was not applicable to the -type of file. E.g., an attempt was made to set the @code{D_PAGED} bit -on a BFD format which does not support demand paging. -@end itemize - -@findex bfd_get_arch_size -@subsubsection @code{bfd_get_arch_size} -@strong{Synopsis} -@example -int bfd_get_arch_size (bfd *abfd); -@end example -@strong{Description}@* -Returns the architecture address size, in bits, as determined -by the object file's format. For ELF, this information is -included in the header. - -@strong{Returns}@* -Returns the arch size in bits if known, @code{-1} otherwise. - -@findex bfd_get_sign_extend_vma -@subsubsection @code{bfd_get_sign_extend_vma} -@strong{Synopsis} -@example -int bfd_get_sign_extend_vma (bfd *abfd); -@end example -@strong{Description}@* -Indicates if the target architecture "naturally" sign extends -an address. Some architectures implicitly sign extend address -values when they are converted to types larger than the size -of an address. For instance, bfd_get_start_address() will -return an address sign extended to fill a bfd_vma when this is -the case. - -@strong{Returns}@* -Returns @code{1} if the target architecture is known to sign -extend addresses, @code{0} if the target architecture is known to -not sign extend addresses, and @code{-1} otherwise. - -@findex bfd_set_start_address -@subsubsection @code{bfd_set_start_address} -@strong{Synopsis} -@example -bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma); -@end example -@strong{Description}@* -Make @var{vma} the entry point of output BFD @var{abfd}. - -@strong{Returns}@* -Returns @code{TRUE} on success, @code{FALSE} otherwise. - -@findex bfd_get_gp_size -@subsubsection @code{bfd_get_gp_size} -@strong{Synopsis} -@example -unsigned int bfd_get_gp_size (bfd *abfd); -@end example -@strong{Description}@* -Return the maximum size of objects to be optimized using the GP -register under MIPS ECOFF. This is typically set by the @code{-G} -argument to the compiler, assembler or linker. - -@findex bfd_set_gp_size -@subsubsection @code{bfd_set_gp_size} -@strong{Synopsis} -@example -void bfd_set_gp_size (bfd *abfd, unsigned int i); -@end example -@strong{Description}@* -Set the maximum size of objects to be optimized using the GP -register under ECOFF or MIPS ELF. This is typically set by -the @code{-G} argument to the compiler, assembler or linker. - -@findex bfd_scan_vma -@subsubsection @code{bfd_scan_vma} -@strong{Synopsis} -@example -bfd_vma bfd_scan_vma (const char *string, const char **end, int base); -@end example -@strong{Description}@* -Convert, like @code{strtoul}, a numerical expression -@var{string} into a @code{bfd_vma} integer, and return that integer. -(Though without as many bells and whistles as @code{strtoul}.) -The expression is assumed to be unsigned (i.e., positive). -If given a @var{base}, it is used as the base for conversion. -A base of 0 causes the function to interpret the string -in hex if a leading "0x" or "0X" is found, otherwise -in octal if a leading zero is found, otherwise in decimal. - -If the value would overflow, the maximum @code{bfd_vma} value is -returned. - -@findex bfd_copy_private_header_data -@subsubsection @code{bfd_copy_private_header_data} -@strong{Synopsis} -@example -bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); -@end example -@strong{Description}@* -Copy private BFD header information from the BFD @var{ibfd} to the -the BFD @var{obfd}. This copies information that may require -sections to exist, but does not require symbol tables. Return -@code{true} on success, @code{false} on error. -Possible error returns are: - -@itemize @bullet - -@item -@code{bfd_error_no_memory} - -Not enough memory exists to create private data for @var{obfd}. -@end itemize -@example -#define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) -@end example - -@findex bfd_copy_private_bfd_data -@subsubsection @code{bfd_copy_private_bfd_data} -@strong{Synopsis} -@example -bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); -@end example -@strong{Description}@* -Copy private BFD information from the BFD @var{ibfd} to the -the BFD @var{obfd}. Return @code{TRUE} on success, @code{FALSE} on error. -Possible error returns are: - -@itemize @bullet - -@item -@code{bfd_error_no_memory} - -Not enough memory exists to create private data for @var{obfd}. -@end itemize -@example -#define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -@end example - -@findex bfd_merge_private_bfd_data -@subsubsection @code{bfd_merge_private_bfd_data} -@strong{Synopsis} -@example -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); -@end example -@strong{Description}@* -Merge private BFD information from the BFD @var{ibfd} to the -the output file BFD @var{obfd} when linking. Return @code{TRUE} -on success, @code{FALSE} on error. Possible error returns are: - -@itemize @bullet - -@item -@code{bfd_error_no_memory} - -Not enough memory exists to create private data for @var{obfd}. -@end itemize -@example -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) -@end example - -@findex bfd_set_private_flags -@subsubsection @code{bfd_set_private_flags} -@strong{Synopsis} -@example -bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); -@end example -@strong{Description}@* -Set private BFD flag information in the BFD @var{abfd}. -Return @code{TRUE} on success, @code{FALSE} on error. Possible error -returns are: - -@itemize @bullet - -@item -@code{bfd_error_no_memory} - -Not enough memory exists to create private data for @var{obfd}. -@end itemize -@example -#define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) -@end example - -@findex Other functions -@subsubsection @code{Other functions} -@strong{Description}@* -The following functions exist but have not yet been documented. -@example -#define bfd_sizeof_headers(abfd, reloc) \ - BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) - -#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ - BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) - -#define bfd_find_line(abfd, syms, sym, file, line) \ - BFD_SEND (abfd, _bfd_find_line, \ - (abfd, syms, sym, file, line)) - -#define bfd_find_inliner_info(abfd, file, func, line) \ - BFD_SEND (abfd, _bfd_find_inliner_info, \ - (abfd, file, func, line)) - -#define bfd_debug_info_start(abfd) \ - BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) - -#define bfd_debug_info_end(abfd) \ - BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) - -#define bfd_debug_info_accumulate(abfd, section) \ - BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) - -#define bfd_stat_arch_elt(abfd, stat) \ - BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) - -#define bfd_update_armap_timestamp(abfd) \ - BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd)) - -#define bfd_set_arch_mach(abfd, arch, mach)\ - BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) - -#define bfd_relax_section(abfd, section, link_info, again) \ - BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again)) - -#define bfd_gc_sections(abfd, link_info) \ - BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info)) - -#define bfd_merge_sections(abfd, link_info) \ - BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info)) - -#define bfd_is_group_section(abfd, sec) \ - BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) - -#define bfd_discard_group(abfd, sec) \ - BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) - -#define bfd_link_hash_table_create(abfd) \ - BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) - -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - -#define bfd_link_add_symbols(abfd, info) \ - BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) - -#define bfd_link_just_syms(abfd, sec, info) \ - BFD_SEND (abfd, _bfd_link_just_syms, (sec, info)) - -#define bfd_final_link(abfd, info) \ - BFD_SEND (abfd, _bfd_final_link, (abfd, info)) - -#define bfd_free_cached_info(abfd) \ - BFD_SEND (abfd, _bfd_free_cached_info, (abfd)) - -#define bfd_get_dynamic_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd)) - -#define bfd_print_private_bfd_data(abfd, file)\ - BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file)) - -#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \ - BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols)) - -#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \ - BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \ - dyncount, dynsyms, ret)) - -#define bfd_get_dynamic_reloc_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd)) - -#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \ - BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms)) - -extern bfd_byte *bfd_get_relocated_section_contents - (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, - bfd_boolean, asymbol **); - -@end example - -@findex bfd_alt_mach_code -@subsubsection @code{bfd_alt_mach_code} -@strong{Synopsis} -@example -bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -@end example -@strong{Description}@* -When more than one machine code number is available for the -same machine type, this function can be used to switch between -the preferred one (alternative == 0) and any others. Currently, -only ELF supports this feature, with up to two alternate -machine codes. - - -@example -struct bfd_preserve -@{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -@}; - -@end example -@findex bfd_preserve_save -@subsubsection @code{bfd_preserve_save} -@strong{Synopsis} -@example -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); -@end example -@strong{Description}@* -When testing an object for compatibility with a particular -target back-end, the back-end object_p function needs to set -up certain fields in the bfd on successfully recognizing the -object. This typically happens in a piecemeal fashion, with -failures possible at many points. On failure, the bfd is -supposed to be restored to its initial state, which is -virtually impossible. However, restoring a subset of the bfd -state works in practice. This function stores the subset and -reinitializes the bfd. - -@findex bfd_preserve_restore -@subsubsection @code{bfd_preserve_restore} -@strong{Synopsis} -@example -void bfd_preserve_restore (bfd *, struct bfd_preserve *); -@end example -@strong{Description}@* -This function restores bfd state saved by bfd_preserve_save. -If MARKER is non-NULL in struct bfd_preserve then that block -and all subsequently bfd_alloc'd memory is freed. - -@findex bfd_preserve_finish -@subsubsection @code{bfd_preserve_finish} -@strong{Synopsis} -@example -void bfd_preserve_finish (bfd *, struct bfd_preserve *); -@end example -@strong{Description}@* -This function should be called when the bfd state saved by -bfd_preserve_save is no longer needed. ie. when the back-end -object_p function returns with success. - diff --git a/bfd/doc/bfdwin.texi b/bfd/doc/bfdwin.texi deleted file mode 100644 index b1fd7d5bed6..00000000000 --- a/bfd/doc/bfdwin.texi +++ /dev/null @@ -1,2 +0,0 @@ -@findex -@subsubsection @code{} diff --git a/bfd/doc/cache.texi b/bfd/doc/cache.texi deleted file mode 100644 index 5820a2a6a1d..00000000000 --- a/bfd/doc/cache.texi +++ /dev/null @@ -1,65 +0,0 @@ -@section File caching -The file caching mechanism is embedded within BFD and allows -the application to open as many BFDs as it wants without -regard to the underlying operating system's file descriptor -limit (often as low as 20 open files). The module in -@code{cache.c} maintains a least recently used list of -@code{BFD_CACHE_MAX_OPEN} files, and exports the name -@code{bfd_cache_lookup}, which runs around and makes sure that -the required BFD is open. If not, then it chooses a file to -close, closes it and opens the one wanted, returning its file -handle. - -@subsection Caching functions - - -@findex bfd_cache_init -@subsubsection @code{bfd_cache_init} -@strong{Synopsis} -@example -bfd_boolean bfd_cache_init (bfd *abfd); -@end example -@strong{Description}@* -Add a newly opened BFD to the cache. - -@findex bfd_cache_close -@subsubsection @code{bfd_cache_close} -@strong{Synopsis} -@example -bfd_boolean bfd_cache_close (bfd *abfd); -@end example -@strong{Description}@* -Remove the BFD @var{abfd} from the cache. If the attached file is open, -then close it too. - -@strong{Returns}@* -@code{FALSE} is returned if closing the file fails, @code{TRUE} is -returned if all is well. - -@findex bfd_cache_close_all -@subsubsection @code{bfd_cache_close_all} -@strong{Synopsis} -@example -bfd_boolean bfd_cache_close_all (void); -@end example -@strong{Description}@* -Remove all BFDs from the cache. If the attached file is open, -then close it too. - -@strong{Returns}@* -@code{FALSE} is returned if closing one of the file fails, @code{TRUE} is -returned if all is well. - -@findex bfd_open_file -@subsubsection @code{bfd_open_file} -@strong{Synopsis} -@example -FILE* bfd_open_file (bfd *abfd); -@end example -@strong{Description}@* -Call the OS to open a file for @var{abfd}. Return the @code{FILE *} -(possibly @code{NULL}) that results from this operation. Set up the -BFD so that future accesses know the file is open. If the @code{FILE *} -returned is @code{NULL}, then it won't have been put in the -cache, so it won't have to be removed from it. - diff --git a/bfd/doc/coffcode.texi b/bfd/doc/coffcode.texi deleted file mode 100644 index 6689009c081..00000000000 --- a/bfd/doc/coffcode.texi +++ /dev/null @@ -1,608 +0,0 @@ -@section coff backends -BFD supports a number of different flavours of coff format. -The major differences between formats are the sizes and -alignments of fields in structures on disk, and the occasional -extra field. - -Coff in all its varieties is implemented with a few common -files and a number of implementation specific files. For -example, The 88k bcs coff format is implemented in the file -@file{coff-m88k.c}. This file @code{#include}s -@file{coff/m88k.h} which defines the external structure of the -coff format for the 88k, and @file{coff/internal.h} which -defines the internal structure. @file{coff-m88k.c} also -defines the relocations used by the 88k format -@xref{Relocations}. - -The Intel i960 processor version of coff is implemented in -@file{coff-i960.c}. This file has the same structure as -@file{coff-m88k.c}, except that it includes @file{coff/i960.h} -rather than @file{coff-m88k.h}. - -@subsection Porting to a new version of coff -The recommended method is to select from the existing -implementations the version of coff which is most like the one -you want to use. For example, we'll say that i386 coff is -the one you select, and that your coff flavour is called foo. -Copy @file{i386coff.c} to @file{foocoff.c}, copy -@file{../include/coff/i386.h} to @file{../include/coff/foo.h}, -and add the lines to @file{targets.c} and @file{Makefile.in} -so that your new back end is used. Alter the shapes of the -structures in @file{../include/coff/foo.h} so that they match -what you need. You will probably also have to add -@code{#ifdef}s to the code in @file{coff/internal.h} and -@file{coffcode.h} if your version of coff is too wild. - -You can verify that your new BFD backend works quite simply by -building @file{objdump} from the @file{binutils} directory, -and making sure that its version of what's going on and your -host system's idea (assuming it has the pretty standard coff -dump utility, usually called @code{att-dump} or just -@code{dump}) are the same. Then clean up your code, and send -what you've done to Cygnus. Then your stuff will be in the -next release, and you won't have to keep integrating it. - -@subsection How the coff backend works - - -@subsubsection File layout -The Coff backend is split into generic routines that are -applicable to any Coff target and routines that are specific -to a particular target. The target-specific routines are -further split into ones which are basically the same for all -Coff targets except that they use the external symbol format -or use different values for certain constants. - -The generic routines are in @file{coffgen.c}. These routines -work for any Coff target. They use some hooks into the target -specific code; the hooks are in a @code{bfd_coff_backend_data} -structure, one of which exists for each target. - -The essentially similar target-specific routines are in -@file{coffcode.h}. This header file includes executable C code. -The various Coff targets first include the appropriate Coff -header file, make any special defines that are needed, and -then include @file{coffcode.h}. - -Some of the Coff targets then also have additional routines in -the target source file itself. - -For example, @file{coff-i960.c} includes -@file{coff/internal.h} and @file{coff/i960.h}. It then -defines a few constants, such as @code{I960}, and includes -@file{coffcode.h}. Since the i960 has complex relocation -types, @file{coff-i960.c} also includes some code to -manipulate the i960 relocs. This code is not in -@file{coffcode.h} because it would not be used by any other -target. - -@subsubsection Bit twiddling -Each flavour of coff supported in BFD has its own header file -describing the external layout of the structures. There is also -an internal description of the coff layout, in -@file{coff/internal.h}. A major function of the -coff backend is swapping the bytes and twiddling the bits to -translate the external form of the structures into the normal -internal form. This is all performed in the -@code{bfd_swap}_@i{thing}_@i{direction} routines. Some -elements are different sizes between different versions of -coff; it is the duty of the coff version specific include file -to override the definitions of various packing routines in -@file{coffcode.h}. E.g., the size of line number entry in coff is -sometimes 16 bits, and sometimes 32 bits. @code{#define}ing -@code{PUT_LNSZ_LNNO} and @code{GET_LNSZ_LNNO} will select the -correct one. No doubt, some day someone will find a version of -coff which has a varying field size not catered to at the -moment. To port BFD, that person will have to add more @code{#defines}. -Three of the bit twiddling routines are exported to -@code{gdb}; @code{coff_swap_aux_in}, @code{coff_swap_sym_in} -and @code{coff_swap_lineno_in}. @code{GDB} reads the symbol -table on its own, but uses BFD to fix things up. More of the -bit twiddlers are exported for @code{gas}; -@code{coff_swap_aux_out}, @code{coff_swap_sym_out}, -@code{coff_swap_lineno_out}, @code{coff_swap_reloc_out}, -@code{coff_swap_filehdr_out}, @code{coff_swap_aouthdr_out}, -@code{coff_swap_scnhdr_out}. @code{Gas} currently keeps track -of all the symbol table and reloc drudgery itself, thereby -saving the internal BFD overhead, but uses BFD to swap things -on the way out, making cross ports much safer. Doing so also -allows BFD (and thus the linker) to use the same header files -as @code{gas}, which makes one avenue to disaster disappear. - -@subsubsection Symbol reading -The simple canonical form for symbols used by BFD is not rich -enough to keep all the information available in a coff symbol -table. The back end gets around this problem by keeping the original -symbol table around, "behind the scenes". - -When a symbol table is requested (through a call to -@code{bfd_canonicalize_symtab}), a request gets through to -@code{coff_get_normalized_symtab}. This reads the symbol table from -the coff file and swaps all the structures inside into the -internal form. It also fixes up all the pointers in the table -(represented in the file by offsets from the first symbol in -the table) into physical pointers to elements in the new -internal table. This involves some work since the meanings of -fields change depending upon context: a field that is a -pointer to another structure in the symbol table at one moment -may be the size in bytes of a structure at the next. Another -pass is made over the table. All symbols which mark file names -(@code{C_FILE} symbols) are modified so that the internal -string points to the value in the auxent (the real filename) -rather than the normal text associated with the symbol -(@code{".file"}). - -At this time the symbol names are moved around. Coff stores -all symbols less than nine characters long physically -within the symbol table; longer strings are kept at the end of -the file in the string table. This pass moves all strings -into memory and replaces them with pointers to the strings. - -The symbol table is massaged once again, this time to create -the canonical table used by the BFD application. Each symbol -is inspected in turn, and a decision made (using the -@code{sclass} field) about the various flags to set in the -@code{asymbol}. @xref{Symbols}. The generated canonical table -shares strings with the hidden internal symbol table. - -Any linenumbers are read from the coff file too, and attached -to the symbols which own the functions the linenumbers belong to. - -@subsubsection Symbol writing -Writing a symbol to a coff file which didn't come from a coff -file will lose any debugging information. The @code{asymbol} -structure remembers the BFD from which the symbol was taken, and on -output the back end makes sure that the same destination target as -source target is present. - -When the symbols have come from a coff file then all the -debugging information is preserved. - -Symbol tables are provided for writing to the back end in a -vector of pointers to pointers. This allows applications like -the linker to accumulate and output large symbol tables -without having to do too much byte copying. - -This function runs through the provided symbol table and -patches each symbol marked as a file place holder -(@code{C_FILE}) to point to the next file place holder in the -list. It also marks each @code{offset} field in the list with -the offset from the first symbol of the current symbol. - -Another function of this procedure is to turn the canonical -value form of BFD into the form used by coff. Internally, BFD -expects symbol values to be offsets from a section base; so a -symbol physically at 0x120, but in a section starting at -0x100, would have the value 0x20. Coff expects symbols to -contain their final value, so symbols have their values -changed at this point to reflect their sum with their owning -section. This transformation uses the -@code{output_section} field of the @code{asymbol}'s -@code{asection} @xref{Sections}. - -@itemize @bullet - -@item -@code{coff_mangle_symbols} -@end itemize -This routine runs though the provided symbol table and uses -the offsets generated by the previous pass and the pointers -generated when the symbol table was read in to create the -structured hierarchy required by coff. It changes each pointer -to a symbol into the index into the symbol table of the asymbol. - -@itemize @bullet - -@item -@code{coff_write_symbols} -@end itemize -This routine runs through the symbol table and patches up the -symbols from their internal form into the coff way, calls the -bit twiddlers, and writes out the table to the file. - -@findex coff_symbol_type -@subsubsection @code{coff_symbol_type} -@strong{Description}@* -The hidden information for an @code{asymbol} is described in a -@code{combined_entry_type}: - - -@example - -typedef struct coff_ptr_struct -@{ - /* Remembers the offset from the first symbol in the file for - this symbol. Generated by coff_renumber_symbols. */ - unsigned int offset; - - /* Should the value of this symbol be renumbered. Used for - XCOFF C_BSTAT symbols. Set by coff_slurp_symbol_table. */ - unsigned int fix_value : 1; - - /* Should the tag field of this symbol be renumbered. - Created by coff_pointerize_aux. */ - unsigned int fix_tag : 1; - - /* Should the endidx field of this symbol be renumbered. - Created by coff_pointerize_aux. */ - unsigned int fix_end : 1; - - /* Should the x_csect.x_scnlen field be renumbered. - Created by coff_pointerize_aux. */ - unsigned int fix_scnlen : 1; - - /* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the - index into the line number entries. Set by coff_slurp_symbol_table. */ - unsigned int fix_line : 1; - - /* The container for the symbol structure as read and translated - from the file. */ - union - @{ - union internal_auxent auxent; - struct internal_syment syment; - @} u; -@} combined_entry_type; - - -/* Each canonical asymbol really looks like this: */ - -typedef struct coff_symbol_struct -@{ - /* The actual symbol which the rest of BFD works with */ - asymbol symbol; - - /* A pointer to the hidden information for this symbol */ - combined_entry_type *native; - - /* A pointer to the linenumber information for this symbol */ - struct lineno_cache_entry *lineno; - - /* Have the line numbers been relocated yet ? */ - bfd_boolean done_lineno; -@} coff_symbol_type; -@end example -@findex bfd_coff_backend_data -@subsubsection @code{bfd_coff_backend_data} - -@example -/* COFF symbol classifications. */ - -enum coff_symbol_classification -@{ - /* Global symbol. */ - COFF_SYMBOL_GLOBAL, - /* Common symbol. */ - COFF_SYMBOL_COMMON, - /* Undefined symbol. */ - COFF_SYMBOL_UNDEFINED, - /* Local symbol. */ - COFF_SYMBOL_LOCAL, - /* PE section symbol. */ - COFF_SYMBOL_PE_SECTION -@}; - -@end example -Special entry points for gdb to swap in coff symbol table parts: -@example -typedef struct -@{ - void (*_bfd_coff_swap_aux_in) - (bfd *, void *, int, int, int, int, void *); - - void (*_bfd_coff_swap_sym_in) - (bfd *, void *, void *); - - void (*_bfd_coff_swap_lineno_in) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_aux_out) - (bfd *, void *, int, int, int, int, void *); - - unsigned int (*_bfd_coff_swap_sym_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_lineno_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_reloc_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_filehdr_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_aouthdr_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_scnhdr_out) - (bfd *, void *, void *); - - unsigned int _bfd_filhsz; - unsigned int _bfd_aoutsz; - unsigned int _bfd_scnhsz; - unsigned int _bfd_symesz; - unsigned int _bfd_auxesz; - unsigned int _bfd_relsz; - unsigned int _bfd_linesz; - unsigned int _bfd_filnmlen; - bfd_boolean _bfd_coff_long_filenames; - bfd_boolean _bfd_coff_long_section_names; - unsigned int _bfd_coff_default_section_alignment_power; - bfd_boolean _bfd_coff_force_symnames_in_strings; - unsigned int _bfd_coff_debug_string_prefix_length; - - void (*_bfd_coff_swap_filehdr_in) - (bfd *, void *, void *); - - void (*_bfd_coff_swap_aouthdr_in) - (bfd *, void *, void *); - - void (*_bfd_coff_swap_scnhdr_in) - (bfd *, void *, void *); - - void (*_bfd_coff_swap_reloc_in) - (bfd *abfd, void *, void *); - - bfd_boolean (*_bfd_coff_bad_format_hook) - (bfd *, void *); - - bfd_boolean (*_bfd_coff_set_arch_mach_hook) - (bfd *, void *); - - void * (*_bfd_coff_mkobject_hook) - (bfd *, void *, void *); - - bfd_boolean (*_bfd_styp_to_sec_flags_hook) - (bfd *, void *, const char *, asection *, flagword *); - - void (*_bfd_set_alignment_hook) - (bfd *, asection *, void *); - - bfd_boolean (*_bfd_coff_slurp_symbol_table) - (bfd *); - - bfd_boolean (*_bfd_coff_symname_in_debug) - (bfd *, struct internal_syment *); - - bfd_boolean (*_bfd_coff_pointerize_aux_hook) - (bfd *, combined_entry_type *, combined_entry_type *, - unsigned int, combined_entry_type *); - - bfd_boolean (*_bfd_coff_print_aux) - (bfd *, FILE *, combined_entry_type *, combined_entry_type *, - combined_entry_type *, unsigned int); - - void (*_bfd_coff_reloc16_extra_cases) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *, - bfd_byte *, unsigned int *, unsigned int *); - - int (*_bfd_coff_reloc16_estimate) - (bfd *, asection *, arelent *, unsigned int, - struct bfd_link_info *); - - enum coff_symbol_classification (*_bfd_coff_classify_symbol) - (bfd *, struct internal_syment *); - - bfd_boolean (*_bfd_coff_compute_section_file_positions) - (bfd *); - - bfd_boolean (*_bfd_coff_start_final_link) - (bfd *, struct bfd_link_info *); - - bfd_boolean (*_bfd_coff_relocate_section) - (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, - struct internal_reloc *, struct internal_syment *, asection **); - - reloc_howto_type *(*_bfd_coff_rtype_to_howto) - (bfd *, asection *, struct internal_reloc *, - struct coff_link_hash_entry *, struct internal_syment *, - bfd_vma *); - - bfd_boolean (*_bfd_coff_adjust_symndx) - (bfd *, struct bfd_link_info *, bfd *, asection *, - struct internal_reloc *, bfd_boolean *); - - bfd_boolean (*_bfd_coff_link_add_one_symbol) - (struct bfd_link_info *, bfd *, const char *, flagword, - asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean, - struct bfd_link_hash_entry **); - - bfd_boolean (*_bfd_coff_link_output_has_begun) - (bfd *, struct coff_final_link_info *); - - bfd_boolean (*_bfd_coff_final_link_postscript) - (bfd *, struct coff_final_link_info *); - -@} bfd_coff_backend_data; - -#define coff_backend_info(abfd) \ - ((bfd_coff_backend_data *) (abfd)->xvec->backend_data) - -#define bfd_coff_swap_aux_in(a,e,t,c,ind,num,i) \ - ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i)) - -#define bfd_coff_swap_sym_in(a,e,i) \ - ((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i)) - -#define bfd_coff_swap_lineno_in(a,e,i) \ - ((coff_backend_info ( a)->_bfd_coff_swap_lineno_in) (a,e,i)) - -#define bfd_coff_swap_reloc_out(abfd, i, o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_out) (abfd, i, o)) - -#define bfd_coff_swap_lineno_out(abfd, i, o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o)) - -#define bfd_coff_swap_aux_out(a,i,t,c,ind,num,o) \ - ((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o)) - -#define bfd_coff_swap_sym_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o)) - -#define bfd_coff_swap_scnhdr_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_out) (abfd, i, o)) - -#define bfd_coff_swap_filehdr_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_out) (abfd, i, o)) - -#define bfd_coff_swap_aouthdr_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_out) (abfd, i, o)) - -#define bfd_coff_filhsz(abfd) (coff_backend_info (abfd)->_bfd_filhsz) -#define bfd_coff_aoutsz(abfd) (coff_backend_info (abfd)->_bfd_aoutsz) -#define bfd_coff_scnhsz(abfd) (coff_backend_info (abfd)->_bfd_scnhsz) -#define bfd_coff_symesz(abfd) (coff_backend_info (abfd)->_bfd_symesz) -#define bfd_coff_auxesz(abfd) (coff_backend_info (abfd)->_bfd_auxesz) -#define bfd_coff_relsz(abfd) (coff_backend_info (abfd)->_bfd_relsz) -#define bfd_coff_linesz(abfd) (coff_backend_info (abfd)->_bfd_linesz) -#define bfd_coff_filnmlen(abfd) (coff_backend_info (abfd)->_bfd_filnmlen) -#define bfd_coff_long_filenames(abfd) \ - (coff_backend_info (abfd)->_bfd_coff_long_filenames) -#define bfd_coff_long_section_names(abfd) \ - (coff_backend_info (abfd)->_bfd_coff_long_section_names) -#define bfd_coff_default_section_alignment_power(abfd) \ - (coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power) -#define bfd_coff_swap_filehdr_in(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o)) - -#define bfd_coff_swap_aouthdr_in(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_in) (abfd, i, o)) - -#define bfd_coff_swap_scnhdr_in(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_in) (abfd, i, o)) - -#define bfd_coff_swap_reloc_in(abfd, i, o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_in) (abfd, i, o)) - -#define bfd_coff_bad_format_hook(abfd, filehdr) \ - ((coff_backend_info (abfd)->_bfd_coff_bad_format_hook) (abfd, filehdr)) - -#define bfd_coff_set_arch_mach_hook(abfd, filehdr)\ - ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr)) -#define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\ - ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook)\ - (abfd, filehdr, aouthdr)) - -#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section, flags_ptr)\ - ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\ - (abfd, scnhdr, name, section, flags_ptr)) - -#define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\ - ((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr)) - -#define bfd_coff_slurp_symbol_table(abfd)\ - ((coff_backend_info (abfd)->_bfd_coff_slurp_symbol_table) (abfd)) - -#define bfd_coff_symname_in_debug(abfd, sym)\ - ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym)) - -#define bfd_coff_force_symnames_in_strings(abfd)\ - (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings) - -#define bfd_coff_debug_string_prefix_length(abfd)\ - (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length) - -#define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\ - ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ - (abfd, file, base, symbol, aux, indaux)) - -#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order,\ - reloc, data, src_ptr, dst_ptr)\ - ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\ - (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)) - -#define bfd_coff_reloc16_estimate(abfd, section, reloc, shrink, link_info)\ - ((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\ - (abfd, section, reloc, shrink, link_info)) - -#define bfd_coff_classify_symbol(abfd, sym)\ - ((coff_backend_info (abfd)->_bfd_coff_classify_symbol)\ - (abfd, sym)) - -#define bfd_coff_compute_section_file_positions(abfd)\ - ((coff_backend_info (abfd)->_bfd_coff_compute_section_file_positions)\ - (abfd)) - -#define bfd_coff_start_final_link(obfd, info)\ - ((coff_backend_info (obfd)->_bfd_coff_start_final_link)\ - (obfd, info)) -#define bfd_coff_relocate_section(obfd,info,ibfd,o,con,rel,isyms,secs)\ - ((coff_backend_info (ibfd)->_bfd_coff_relocate_section)\ - (obfd, info, ibfd, o, con, rel, isyms, secs)) -#define bfd_coff_rtype_to_howto(abfd, sec, rel, h, sym, addendp)\ - ((coff_backend_info (abfd)->_bfd_coff_rtype_to_howto)\ - (abfd, sec, rel, h, sym, addendp)) -#define bfd_coff_adjust_symndx(obfd, info, ibfd, sec, rel, adjustedp)\ - ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\ - (obfd, info, ibfd, sec, rel, adjustedp)) -#define bfd_coff_link_add_one_symbol(info, abfd, name, flags, section,\ - value, string, cp, coll, hashp)\ - ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\ - (info, abfd, name, flags, section, value, string, cp, coll, hashp)) - -#define bfd_coff_link_output_has_begun(a,p) \ - ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a, p)) -#define bfd_coff_final_link_postscript(a,p) \ - ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a, p)) - -@end example -@subsubsection Writing relocations -To write relocations, the back end steps though the -canonical relocation table and create an -@code{internal_reloc}. The symbol index to use is removed from -the @code{offset} field in the symbol table supplied. The -address comes directly from the sum of the section base -address and the relocation offset; the type is dug directly -from the howto field. Then the @code{internal_reloc} is -swapped into the shape of an @code{external_reloc} and written -out to disk. - -@subsubsection Reading linenumbers -Creating the linenumber table is done by reading in the entire -coff linenumber table, and creating another table for internal use. - -A coff linenumber table is structured so that each function -is marked as having a line number of 0. Each line within the -function is an offset from the first line in the function. The -base of the line number information for the table is stored in -the symbol associated with the function. - -Note: The PE format uses line number 0 for a flag indicating a -new source file. - -The information is copied from the external to the internal -table, and each symbol which marks a function is marked by -pointing its... - -How does this work ? - -@subsubsection Reading relocations -Coff relocations are easily transformed into the internal BFD form -(@code{arelent}). - -Reading a coff relocation table is done in the following stages: - -@itemize @bullet - -@item -Read the entire coff relocation table into memory. - -@item -Process each relocation in turn; first swap it from the -external to the internal form. - -@item -Turn the symbol referenced in the relocation's symbol index -into a pointer into the canonical symbol table. -This table is the same as the one returned by a call to -@code{bfd_canonicalize_symtab}. The back end will call that -routine and save the result if a canonicalization hasn't been done. - -@item -The reloc index is turned into a pointer to a howto -structure, in a back end specific way. For instance, the 386 -and 960 use the @code{r_type} to directly produce an index -into a howto table vector; the 88k subtracts a number from the -@code{r_type} field and creates an addend field. -@end itemize - diff --git a/bfd/doc/core.texi b/bfd/doc/core.texi deleted file mode 100644 index 1f09445ef76..00000000000 --- a/bfd/doc/core.texi +++ /dev/null @@ -1,60 +0,0 @@ -@section Core files - - -@subsection Core file functions - - -@strong{Description}@* -These are functions pertaining to core files. - -@findex bfd_core_file_failing_command -@subsubsection @code{bfd_core_file_failing_command} -@strong{Synopsis} -@example -const char *bfd_core_file_failing_command (bfd *abfd); -@end example -@strong{Description}@* -Return a read-only string explaining which program was running -when it failed and produced the core file @var{abfd}. - -@findex bfd_core_file_failing_signal -@subsubsection @code{bfd_core_file_failing_signal} -@strong{Synopsis} -@example -int bfd_core_file_failing_signal (bfd *abfd); -@end example -@strong{Description}@* -Returns the signal number which caused the core dump which -generated the file the BFD @var{abfd} is attached to. - -@findex core_file_matches_executable_p -@subsubsection @code{core_file_matches_executable_p} -@strong{Synopsis} -@example -bfd_boolean core_file_matches_executable_p - (bfd *core_bfd, bfd *exec_bfd); -@end example -@strong{Description}@* -Return @code{TRUE} if the core file attached to @var{core_bfd} -was generated by a run of the executable file attached to -@var{exec_bfd}, @code{FALSE} otherwise. - -@findex generic_core_file_matches_executable_p -@subsubsection @code{generic_core_file_matches_executable_p} -@strong{Synopsis} -@example -bfd_boolean generic_core_file_matches_executable_p - (bfd *core_bfd, bfd *exec_bfd); -@end example -@strong{Description}@* -Return TRUE if the core file attached to @var{core_bfd} -was generated by a run of the executable file attached -to @var{exec_bfd}. The match is based on executable -basenames only. - -Note: When not able to determine the core file failing -command or the executable name, we still return TRUE even -though we're not sure that core file and executable match. -This is to avoid generating a false warning in situations -where we really don't know whether they match or not. - diff --git a/bfd/doc/elf.texi b/bfd/doc/elf.texi deleted file mode 100644 index 4f9434cf69d..00000000000 --- a/bfd/doc/elf.texi +++ /dev/null @@ -1,22 +0,0 @@ -@section ELF backends -BFD support for ELF formats is being worked on. -Currently, the best supported back ends are for sparc and i386 -(running svr4 or Solaris 2). - -Documentation of the internals of the support code still needs -to be written. The code is changing quickly enough that we -haven't bothered yet. - -@findex bfd_elf_find_section -@subsubsection @code{bfd_elf_find_section} -@strong{Synopsis} -@example -struct elf_internal_shdr *bfd_elf_find_section (bfd *abfd, char *name); -@end example -@strong{Description}@* -Helper functions for GDB to locate the string tables. -Since BFD hides string tables from callers, GDB needs to use an -internal hook to find them. Sun's .stabstr, in particular, -isn't even pointed to by the .stab section, so ordinary -mechanisms wouldn't work to find it, even if we had some. - diff --git a/bfd/doc/format.texi b/bfd/doc/format.texi deleted file mode 100644 index 9674acff440..00000000000 --- a/bfd/doc/format.texi +++ /dev/null @@ -1,112 +0,0 @@ -@section File formats -A format is a BFD concept of high level file contents type. The -formats supported by BFD are: - -@itemize @bullet - -@item -@code{bfd_object} -@end itemize -The BFD may contain data, symbols, relocations and debug info. - -@itemize @bullet - -@item -@code{bfd_archive} -@end itemize -The BFD contains other BFDs and an optional index. - -@itemize @bullet - -@item -@code{bfd_core} -@end itemize -The BFD contains the result of an executable core dump. - -@subsection File format functions - - -@findex bfd_check_format -@subsubsection @code{bfd_check_format} -@strong{Synopsis} -@example -bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); -@end example -@strong{Description}@* -Verify if the file attached to the BFD @var{abfd} is compatible -with the format @var{format} (i.e., one of @code{bfd_object}, -@code{bfd_archive} or @code{bfd_core}). - -If the BFD has been set to a specific target before the -call, only the named target and format combination is -checked. If the target has not been set, or has been set to -@code{default}, then all the known target backends is -interrogated to determine a match. If the default target -matches, it is used. If not, exactly one target must recognize -the file, or an error results. - -The function returns @code{TRUE} on success, otherwise @code{FALSE} -with one of the following error codes: - -@itemize @bullet - -@item -@code{bfd_error_invalid_operation} - -if @code{format} is not one of @code{bfd_object}, @code{bfd_archive} or -@code{bfd_core}. - -@item -@code{bfd_error_system_call} - -if an error occured during a read - even some file mismatches -can cause bfd_error_system_calls. - -@item -@code{file_not_recognised} - -none of the backends recognised the file format. - -@item -@code{bfd_error_file_ambiguously_recognized} - -more than one backend recognised the file format. -@end itemize - -@findex bfd_check_format_matches -@subsubsection @code{bfd_check_format_matches} -@strong{Synopsis} -@example -bfd_boolean bfd_check_format_matches - (bfd *abfd, bfd_format format, char ***matching); -@end example -@strong{Description}@* -Like @code{bfd_check_format}, except when it returns FALSE with -@code{bfd_errno} set to @code{bfd_error_file_ambiguously_recognized}. In that -case, if @var{matching} is not NULL, it will be filled in with -a NULL-terminated list of the names of the formats that matched, -allocated with @code{malloc}. -Then the user may choose a format and try again. - -When done with the list that @var{matching} points to, the caller -should free it. - -@findex bfd_set_format -@subsubsection @code{bfd_set_format} -@strong{Synopsis} -@example -bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); -@end example -@strong{Description}@* -This function sets the file format of the BFD @var{abfd} to the -format @var{format}. If the target set in the BFD does not -support the format requested, the format is invalid, or the BFD -is not open for writing, then an error occurs. - -@findex bfd_format_string -@subsubsection @code{bfd_format_string} -@strong{Synopsis} -@example -const char *bfd_format_string (bfd_format format); -@end example -@strong{Description}@* -Return a pointer to a const string -@code{invalid}, @code{object}, @code{archive}, @code{core}, or @code{unknown}, -depending upon the value of @var{format}. - diff --git a/bfd/doc/hash.texi b/bfd/doc/hash.texi deleted file mode 100644 index 88d9585cc40..00000000000 --- a/bfd/doc/hash.texi +++ /dev/null @@ -1,247 +0,0 @@ -@section Hash Tables -@cindex Hash tables -BFD provides a simple set of hash table functions. Routines -are provided to initialize a hash table, to free a hash table, -to look up a string in a hash table and optionally create an -entry for it, and to traverse a hash table. There is -currently no routine to delete an string from a hash table. - -The basic hash table does not permit any data to be stored -with a string. However, a hash table is designed to present a -base class from which other types of hash tables may be -derived. These derived types may store additional information -with the string. Hash tables were implemented in this way, -rather than simply providing a data pointer in a hash table -entry, because they were designed for use by the linker back -ends. The linker may create thousands of hash table entries, -and the overhead of allocating private data and storing and -following pointers becomes noticeable. - -The basic hash table code is in @code{hash.c}. - -@menu -* Creating and Freeing a Hash Table:: -* Looking Up or Entering a String:: -* Traversing a Hash Table:: -* Deriving a New Hash Table Type:: -@end menu - -@node Creating and Freeing a Hash Table, Looking Up or Entering a String, Hash Tables, Hash Tables -@subsection Creating and freeing a hash table -@findex bfd_hash_table_init -@findex bfd_hash_table_init_n -To create a hash table, create an instance of a @code{struct -bfd_hash_table} (defined in @code{bfd.h}) and call -@code{bfd_hash_table_init} (if you know approximately how many -entries you will need, the function @code{bfd_hash_table_init_n}, -which takes a @var{size} argument, may be used). -@code{bfd_hash_table_init} returns @code{FALSE} if some sort of -error occurs. - -@findex bfd_hash_newfunc -The function @code{bfd_hash_table_init} take as an argument a -function to use to create new entries. For a basic hash -table, use the function @code{bfd_hash_newfunc}. @xref{Deriving -a New Hash Table Type}, for why you would want to use a -different value for this argument. - -@findex bfd_hash_allocate -@code{bfd_hash_table_init} will create an objalloc which will be -used to allocate new entries. You may allocate memory on this -objalloc using @code{bfd_hash_allocate}. - -@findex bfd_hash_table_free -Use @code{bfd_hash_table_free} to free up all the memory that has -been allocated for a hash table. This will not free up the -@code{struct bfd_hash_table} itself, which you must provide. - -@findex bfd_hash_set_default_size -Use @code{bfd_hash_set_default_size} to set the default size of -hash table to use. - -@node Looking Up or Entering a String, Traversing a Hash Table, Creating and Freeing a Hash Table, Hash Tables -@subsection Looking up or entering a string -@findex bfd_hash_lookup -The function @code{bfd_hash_lookup} is used both to look up a -string in the hash table and to create a new entry. - -If the @var{create} argument is @code{FALSE}, @code{bfd_hash_lookup} -will look up a string. If the string is found, it will -returns a pointer to a @code{struct bfd_hash_entry}. If the -string is not found in the table @code{bfd_hash_lookup} will -return @code{NULL}. You should not modify any of the fields in -the returns @code{struct bfd_hash_entry}. - -If the @var{create} argument is @code{TRUE}, the string will be -entered into the hash table if it is not already there. -Either way a pointer to a @code{struct bfd_hash_entry} will be -returned, either to the existing structure or to a newly -created one. In this case, a @code{NULL} return means that an -error occurred. - -If the @var{create} argument is @code{TRUE}, and a new entry is -created, the @var{copy} argument is used to decide whether to -copy the string onto the hash table objalloc or not. If -@var{copy} is passed as @code{FALSE}, you must be careful not to -deallocate or modify the string as long as the hash table -exists. - -@node Traversing a Hash Table, Deriving a New Hash Table Type, Looking Up or Entering a String, Hash Tables -@subsection Traversing a hash table -@findex bfd_hash_traverse -The function @code{bfd_hash_traverse} may be used to traverse a -hash table, calling a function on each element. The traversal -is done in a random order. - -@code{bfd_hash_traverse} takes as arguments a function and a -generic @code{void *} pointer. The function is called with a -hash table entry (a @code{struct bfd_hash_entry *}) and the -generic pointer passed to @code{bfd_hash_traverse}. The function -must return a @code{boolean} value, which indicates whether to -continue traversing the hash table. If the function returns -@code{FALSE}, @code{bfd_hash_traverse} will stop the traversal and -return immediately. - -@node Deriving a New Hash Table Type, , Traversing a Hash Table, Hash Tables -@subsection Deriving a new hash table type -Many uses of hash tables want to store additional information -which each entry in the hash table. Some also find it -convenient to store additional information with the hash table -itself. This may be done using a derived hash table. - -Since C is not an object oriented language, creating a derived -hash table requires sticking together some boilerplate -routines with a few differences specific to the type of hash -table you want to create. - -An example of a derived hash table is the linker hash table. -The structures for this are defined in @code{bfdlink.h}. The -functions are in @code{linker.c}. - -You may also derive a hash table from an already derived hash -table. For example, the a.out linker backend code uses a hash -table derived from the linker hash table. - -@menu -* Define the Derived Structures:: -* Write the Derived Creation Routine:: -* Write Other Derived Routines:: -@end menu - -@node Define the Derived Structures, Write the Derived Creation Routine, Deriving a New Hash Table Type, Deriving a New Hash Table Type -@subsubsection Define the derived structures -You must define a structure for an entry in the hash table, -and a structure for the hash table itself. - -The first field in the structure for an entry in the hash -table must be of the type used for an entry in the hash table -you are deriving from. If you are deriving from a basic hash -table this is @code{struct bfd_hash_entry}, which is defined in -@code{bfd.h}. The first field in the structure for the hash -table itself must be of the type of the hash table you are -deriving from itself. If you are deriving from a basic hash -table, this is @code{struct bfd_hash_table}. - -For example, the linker hash table defines @code{struct -bfd_link_hash_entry} (in @code{bfdlink.h}). The first field, -@code{root}, is of type @code{struct bfd_hash_entry}. Similarly, -the first field in @code{struct bfd_link_hash_table}, @code{table}, -is of type @code{struct bfd_hash_table}. - -@node Write the Derived Creation Routine, Write Other Derived Routines, Define the Derived Structures, Deriving a New Hash Table Type -@subsubsection Write the derived creation routine -You must write a routine which will create and initialize an -entry in the hash table. This routine is passed as the -function argument to @code{bfd_hash_table_init}. - -In order to permit other hash tables to be derived from the -hash table you are creating, this routine must be written in a -standard way. - -The first argument to the creation routine is a pointer to a -hash table entry. This may be @code{NULL}, in which case the -routine should allocate the right amount of space. Otherwise -the space has already been allocated by a hash table type -derived from this one. - -After allocating space, the creation routine must call the -creation routine of the hash table type it is derived from, -passing in a pointer to the space it just allocated. This -will initialize any fields used by the base hash table. - -Finally the creation routine must initialize any local fields -for the new hash table type. - -Here is a boilerplate example of a creation routine. -@var{function_name} is the name of the routine. -@var{entry_type} is the type of an entry in the hash table you -are creating. @var{base_newfunc} is the name of the creation -routine of the hash table type your hash table is derived -from. - - -@example -struct bfd_hash_entry * -@var{function_name} (struct bfd_hash_entry *entry, - struct bfd_hash_table *table, - const char *string) -@{ - struct @var{entry_type} *ret = (@var{entry_type} *) entry; - - /* Allocate the structure if it has not already been allocated by a - derived class. */ - if (ret == NULL) - @{ - ret = bfd_hash_allocate (table, sizeof (* ret)); - if (ret == NULL) - return NULL; - @} - - /* Call the allocation method of the base class. */ - ret = ((@var{entry_type} *) - @var{base_newfunc} ((struct bfd_hash_entry *) ret, table, string)); - - /* Initialize the local fields here. */ - - return (struct bfd_hash_entry *) ret; -@} -@end example -@strong{Description}@* -The creation routine for the linker hash table, which is in -@code{linker.c}, looks just like this example. -@var{function_name} is @code{_bfd_link_hash_newfunc}. -@var{entry_type} is @code{struct bfd_link_hash_entry}. -@var{base_newfunc} is @code{bfd_hash_newfunc}, the creation -routine for a basic hash table. - -@code{_bfd_link_hash_newfunc} also initializes the local fields -in a linker hash table entry: @code{type}, @code{written} and -@code{next}. - -@node Write Other Derived Routines, , Write the Derived Creation Routine, Deriving a New Hash Table Type -@subsubsection Write other derived routines -You will want to write other routines for your new hash table, -as well. - -You will want an initialization routine which calls the -initialization routine of the hash table you are deriving from -and initializes any other local fields. For the linker hash -table, this is @code{_bfd_link_hash_table_init} in @code{linker.c}. - -You will want a lookup routine which calls the lookup routine -of the hash table you are deriving from and casts the result. -The linker hash table uses @code{bfd_link_hash_lookup} in -@code{linker.c} (this actually takes an additional argument which -it uses to decide how to return the looked up value). - -You may want a traversal routine. This should just call the -traversal routine of the hash table you are deriving from with -appropriate casts. The linker hash table uses -@code{bfd_link_hash_traverse} in @code{linker.c}. - -These routines may simply be defined as macros. For example, -the a.out backend linker hash table, which is derived from the -linker hash table, uses macros for the lookup and traversal -routines. These are @code{aout_link_hash_lookup} and -@code{aout_link_hash_traverse} in aoutx.h. - diff --git a/bfd/doc/init.texi b/bfd/doc/init.texi deleted file mode 100644 index ab735f8e986..00000000000 --- a/bfd/doc/init.texi +++ /dev/null @@ -1,16 +0,0 @@ -@section Initialization - - -@subsection Initialization functions -These are the functions that handle initializing a BFD. - -@findex bfd_init -@subsubsection @code{bfd_init} -@strong{Synopsis} -@example -void bfd_init (void); -@end example -@strong{Description}@* -This routine must be called before any other BFD function to -initialize magical internal data structures. - diff --git a/bfd/doc/libbfd.texi b/bfd/doc/libbfd.texi deleted file mode 100644 index fef6e0e842e..00000000000 --- a/bfd/doc/libbfd.texi +++ /dev/null @@ -1,179 +0,0 @@ -@section Implementation details - - -@subsection Internal functions - - -@strong{Description}@* -These routines are used within BFD. -They are not intended for export, but are documented here for -completeness. - -@findex bfd_write_bigendian_4byte_int -@subsubsection @code{bfd_write_bigendian_4byte_int} -@strong{Synopsis} -@example -bfd_boolean bfd_write_bigendian_4byte_int (bfd *, unsigned int); -@end example -@strong{Description}@* -Write a 4 byte integer @var{i} to the output BFD @var{abfd}, in big -endian order regardless of what else is going on. This is useful in -archives. - -@findex bfd_put_size -@subsubsection @code{bfd_put_size} -@findex bfd_get_size -@subsubsection @code{bfd_get_size} -@strong{Description}@* -These macros as used for reading and writing raw data in -sections; each access (except for bytes) is vectored through -the target format of the BFD and mangled accordingly. The -mangling performs any necessary endian translations and -removes alignment restrictions. Note that types accepted and -returned by these macros are identical so they can be swapped -around in macros---for example, @file{libaout.h} defines @code{GET_WORD} -to either @code{bfd_get_32} or @code{bfd_get_64}. - -In the put routines, @var{val} must be a @code{bfd_vma}. If we are on a -system without prototypes, the caller is responsible for making -sure that is true, with a cast if necessary. We don't cast -them in the macro definitions because that would prevent @code{lint} -or @code{gcc -Wall} from detecting sins such as passing a pointer. -To detect calling these with less than a @code{bfd_vma}, use -@code{gcc -Wconversion} on a host with 64 bit @code{bfd_vma}'s. -@example - -/* Byte swapping macros for user section data. */ - -#define bfd_put_8(abfd, val, ptr) \ - ((void) (*((unsigned char *) (ptr)) = (val) & 0xff)) -#define bfd_put_signed_8 \ - bfd_put_8 -#define bfd_get_8(abfd, ptr) \ - (*(unsigned char *) (ptr) & 0xff) -#define bfd_get_signed_8(abfd, ptr) \ - (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) - -#define bfd_put_16(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) -#define bfd_put_signed_16 \ - bfd_put_16 -#define bfd_get_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx16, (ptr)) -#define bfd_get_signed_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) - -#define bfd_put_32(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) -#define bfd_put_signed_32 \ - bfd_put_32 -#define bfd_get_32(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx32, (ptr)) -#define bfd_get_signed_32(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx_signed_32, (ptr)) - -#define bfd_put_64(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_putx64, ((val), (ptr))) -#define bfd_put_signed_64 \ - bfd_put_64 -#define bfd_get_64(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx64, (ptr)) -#define bfd_get_signed_64(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) - -#define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ - : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ - : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ - : (bits) == 64 ? bfd_get_64 (abfd, ptr) \ - : (abort (), (bfd_vma) - 1)) - -#define bfd_put(bits, abfd, val, ptr) \ - ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ - : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ - : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ - : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \ - : (abort (), (void) 0)) - -@end example - -@findex bfd_h_put_size -@subsubsection @code{bfd_h_put_size} -@strong{Description}@* -These macros have the same function as their @code{bfd_get_x} -brethren, except that they are used for removing information -for the header records of object files. Believe it or not, -some object files keep their header records in big endian -order and their data in little endian order. -@example - -/* Byte swapping macros for file header data. */ - -#define bfd_h_put_8(abfd, val, ptr) \ - bfd_put_8 (abfd, val, ptr) -#define bfd_h_put_signed_8(abfd, val, ptr) \ - bfd_put_8 (abfd, val, ptr) -#define bfd_h_get_8(abfd, ptr) \ - bfd_get_8 (abfd, ptr) -#define bfd_h_get_signed_8(abfd, ptr) \ - bfd_get_signed_8 (abfd, ptr) - -#define bfd_h_put_16(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_h_putx16, (val, ptr)) -#define bfd_h_put_signed_16 \ - bfd_h_put_16 -#define bfd_h_get_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx16, (ptr)) -#define bfd_h_get_signed_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr)) - -#define bfd_h_put_32(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_h_putx32, (val, ptr)) -#define bfd_h_put_signed_32 \ - bfd_h_put_32 -#define bfd_h_get_32(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx32, (ptr)) -#define bfd_h_get_signed_32(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr)) - -#define bfd_h_put_64(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_h_putx64, (val, ptr)) -#define bfd_h_put_signed_64 \ - bfd_h_put_64 -#define bfd_h_get_64(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx64, (ptr)) -#define bfd_h_get_signed_64(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr)) - -/* Aliases for the above, which should eventually go away. */ - -#define H_PUT_64 bfd_h_put_64 -#define H_PUT_32 bfd_h_put_32 -#define H_PUT_16 bfd_h_put_16 -#define H_PUT_8 bfd_h_put_8 -#define H_PUT_S64 bfd_h_put_signed_64 -#define H_PUT_S32 bfd_h_put_signed_32 -#define H_PUT_S16 bfd_h_put_signed_16 -#define H_PUT_S8 bfd_h_put_signed_8 -#define H_GET_64 bfd_h_get_64 -#define H_GET_32 bfd_h_get_32 -#define H_GET_16 bfd_h_get_16 -#define H_GET_8 bfd_h_get_8 -#define H_GET_S64 bfd_h_get_signed_64 -#define H_GET_S32 bfd_h_get_signed_32 -#define H_GET_S16 bfd_h_get_signed_16 -#define H_GET_S8 bfd_h_get_signed_8 - - -@end example - -@findex bfd_log2 -@subsubsection @code{bfd_log2} -@strong{Synopsis} -@example -unsigned int bfd_log2 (bfd_vma x); -@end example -@strong{Description}@* -Return the log base 2 of the value supplied, rounded up. E.g., an -@var{x} of 1025 returns 11. A @var{x} of 0 returns 0. - diff --git a/bfd/doc/linker.texi b/bfd/doc/linker.texi deleted file mode 100644 index 8a55006a187..00000000000 --- a/bfd/doc/linker.texi +++ /dev/null @@ -1,380 +0,0 @@ -@section Linker Functions -@cindex Linker -The linker uses three special entry points in the BFD target -vector. It is not necessary to write special routines for -these entry points when creating a new BFD back end, since -generic versions are provided. However, writing them can -speed up linking and make it use significantly less runtime -memory. - -The first routine creates a hash table used by the other -routines. The second routine adds the symbols from an object -file to the hash table. The third routine takes all the -object files and links them together to create the output -file. These routines are designed so that the linker proper -does not need to know anything about the symbols in the object -files that it is linking. The linker merely arranges the -sections as directed by the linker script and lets BFD handle -the details of symbols and relocs. - -The second routine and third routines are passed a pointer to -a @code{struct bfd_link_info} structure (defined in -@code{bfdlink.h}) which holds information relevant to the link, -including the linker hash table (which was created by the -first routine) and a set of callback functions to the linker -proper. - -The generic linker routines are in @code{linker.c}, and use the -header file @code{genlink.h}. As of this writing, the only back -ends which have implemented versions of these routines are -a.out (in @code{aoutx.h}) and ECOFF (in @code{ecoff.c}). The a.out -routines are used as examples throughout this section. - -@menu -* Creating a Linker Hash Table:: -* Adding Symbols to the Hash Table:: -* Performing the Final Link:: -@end menu - -@node Creating a Linker Hash Table, Adding Symbols to the Hash Table, Linker Functions, Linker Functions -@subsection Creating a linker hash table -@cindex _bfd_link_hash_table_create in target vector -@cindex target vector (_bfd_link_hash_table_create) -The linker routines must create a hash table, which must be -derived from @code{struct bfd_link_hash_table} described in -@code{bfdlink.c}. @xref{Hash Tables}, for information on how to -create a derived hash table. This entry point is called using -the target vector of the linker output file. - -The @code{_bfd_link_hash_table_create} entry point must allocate -and initialize an instance of the desired hash table. If the -back end does not require any additional information to be -stored with the entries in the hash table, the entry point may -simply create a @code{struct bfd_link_hash_table}. Most likely, -however, some additional information will be needed. - -For example, with each entry in the hash table the a.out -linker keeps the index the symbol has in the final output file -(this index number is used so that when doing a relocatable -link the symbol index used in the output file can be quickly -filled in when copying over a reloc). The a.out linker code -defines the required structures and functions for a hash table -derived from @code{struct bfd_link_hash_table}. The a.out linker -hash table is created by the function -@code{NAME(aout,link_hash_table_create)}; it simply allocates -space for the hash table, initializes it, and returns a -pointer to it. - -When writing the linker routines for a new back end, you will -generally not know exactly which fields will be required until -you have finished. You should simply create a new hash table -which defines no additional fields, and then simply add fields -as they become necessary. - -@node Adding Symbols to the Hash Table, Performing the Final Link, Creating a Linker Hash Table, Linker Functions -@subsection Adding symbols to the hash table -@cindex _bfd_link_add_symbols in target vector -@cindex target vector (_bfd_link_add_symbols) -The linker proper will call the @code{_bfd_link_add_symbols} -entry point for each object file or archive which is to be -linked (typically these are the files named on the command -line, but some may also come from the linker script). The -entry point is responsible for examining the file. For an -object file, BFD must add any relevant symbol information to -the hash table. For an archive, BFD must determine which -elements of the archive should be used and adding them to the -link. - -The a.out version of this entry point is -@code{NAME(aout,link_add_symbols)}. - -@menu -* Differing file formats:: -* Adding symbols from an object file:: -* Adding symbols from an archive:: -@end menu - -@node Differing file formats, Adding symbols from an object file, Adding Symbols to the Hash Table, Adding Symbols to the Hash Table -@subsubsection Differing file formats -Normally all the files involved in a link will be of the same -format, but it is also possible to link together different -format object files, and the back end must support that. The -@code{_bfd_link_add_symbols} entry point is called via the target -vector of the file to be added. This has an important -consequence: the function may not assume that the hash table -is the type created by the corresponding -@code{_bfd_link_hash_table_create} vector. All the -@code{_bfd_link_add_symbols} function can assume about the hash -table is that it is derived from @code{struct -bfd_link_hash_table}. - -Sometimes the @code{_bfd_link_add_symbols} function must store -some information in the hash table entry to be used by the -@code{_bfd_final_link} function. In such a case the @code{creator} -field of the hash table must be checked to make sure that the -hash table was created by an object file of the same format. - -The @code{_bfd_final_link} routine must be prepared to handle a -hash entry without any extra information added by the -@code{_bfd_link_add_symbols} function. A hash entry without -extra information will also occur when the linker script -directs the linker to create a symbol. Note that, regardless -of how a hash table entry is added, all the fields will be -initialized to some sort of null value by the hash table entry -initialization function. - -See @code{ecoff_link_add_externals} for an example of how to -check the @code{creator} field before saving information (in this -case, the ECOFF external symbol debugging information) in a -hash table entry. - -@node Adding symbols from an object file, Adding symbols from an archive, Differing file formats, Adding Symbols to the Hash Table -@subsubsection Adding symbols from an object file -When the @code{_bfd_link_add_symbols} routine is passed an object -file, it must add all externally visible symbols in that -object file to the hash table. The actual work of adding the -symbol to the hash table is normally handled by the function -@code{_bfd_generic_link_add_one_symbol}. The -@code{_bfd_link_add_symbols} routine is responsible for reading -all the symbols from the object file and passing the correct -information to @code{_bfd_generic_link_add_one_symbol}. - -The @code{_bfd_link_add_symbols} routine should not use -@code{bfd_canonicalize_symtab} to read the symbols. The point of -providing this routine is to avoid the overhead of converting -the symbols into generic @code{asymbol} structures. - -@findex _bfd_generic_link_add_one_symbol -@code{_bfd_generic_link_add_one_symbol} handles the details of -combining common symbols, warning about multiple definitions, -and so forth. It takes arguments which describe the symbol to -add, notably symbol flags, a section, and an offset. The -symbol flags include such things as @code{BSF_WEAK} or -@code{BSF_INDIRECT}. The section is a section in the object -file, or something like @code{bfd_und_section_ptr} for an undefined -symbol or @code{bfd_com_section_ptr} for a common symbol. - -If the @code{_bfd_final_link} routine is also going to need to -read the symbol information, the @code{_bfd_link_add_symbols} -routine should save it somewhere attached to the object file -BFD. However, the information should only be saved if the -@code{keep_memory} field of the @code{info} argument is TRUE, so -that the @code{-no-keep-memory} linker switch is effective. - -The a.out function which adds symbols from an object file is -@code{aout_link_add_object_symbols}, and most of the interesting -work is in @code{aout_link_add_symbols}. The latter saves -pointers to the hash tables entries created by -@code{_bfd_generic_link_add_one_symbol} indexed by symbol number, -so that the @code{_bfd_final_link} routine does not have to call -the hash table lookup routine to locate the entry. - -@node Adding symbols from an archive, , Adding symbols from an object file, Adding Symbols to the Hash Table -@subsubsection Adding symbols from an archive -When the @code{_bfd_link_add_symbols} routine is passed an -archive, it must look through the symbols defined by the -archive and decide which elements of the archive should be -included in the link. For each such element it must call the -@code{add_archive_element} linker callback, and it must add the -symbols from the object file to the linker hash table. - -@findex _bfd_generic_link_add_archive_symbols -In most cases the work of looking through the symbols in the -archive should be done by the -@code{_bfd_generic_link_add_archive_symbols} function. This -function builds a hash table from the archive symbol table and -looks through the list of undefined symbols to see which -elements should be included. -@code{_bfd_generic_link_add_archive_symbols} is passed a function -to call to make the final decision about adding an archive -element to the link and to do the actual work of adding the -symbols to the linker hash table. - -The function passed to -@code{_bfd_generic_link_add_archive_symbols} must read the -symbols of the archive element and decide whether the archive -element should be included in the link. If the element is to -be included, the @code{add_archive_element} linker callback -routine must be called with the element as an argument, and -the elements symbols must be added to the linker hash table -just as though the element had itself been passed to the -@code{_bfd_link_add_symbols} function. - -When the a.out @code{_bfd_link_add_symbols} function receives an -archive, it calls @code{_bfd_generic_link_add_archive_symbols} -passing @code{aout_link_check_archive_element} as the function -argument. @code{aout_link_check_archive_element} calls -@code{aout_link_check_ar_symbols}. If the latter decides to add -the element (an element is only added if it provides a real, -non-common, definition for a previously undefined or common -symbol) it calls the @code{add_archive_element} callback and then -@code{aout_link_check_archive_element} calls -@code{aout_link_add_symbols} to actually add the symbols to the -linker hash table. - -The ECOFF back end is unusual in that it does not normally -call @code{_bfd_generic_link_add_archive_symbols}, because ECOFF -archives already contain a hash table of symbols. The ECOFF -back end searches the archive itself to avoid the overhead of -creating a new hash table. - -@node Performing the Final Link, , Adding Symbols to the Hash Table, Linker Functions -@subsection Performing the final link -@cindex _bfd_link_final_link in target vector -@cindex target vector (_bfd_final_link) -When all the input files have been processed, the linker calls -the @code{_bfd_final_link} entry point of the output BFD. This -routine is responsible for producing the final output file, -which has several aspects. It must relocate the contents of -the input sections and copy the data into the output sections. -It must build an output symbol table including any local -symbols from the input files and the global symbols from the -hash table. When producing relocatable output, it must -modify the input relocs and write them into the output file. -There may also be object format dependent work to be done. - -The linker will also call the @code{write_object_contents} entry -point when the BFD is closed. The two entry points must work -together in order to produce the correct output file. - -The details of how this works are inevitably dependent upon -the specific object file format. The a.out -@code{_bfd_final_link} routine is @code{NAME(aout,final_link)}. - -@menu -* Information provided by the linker:: -* Relocating the section contents:: -* Writing the symbol table:: -@end menu - -@node Information provided by the linker, Relocating the section contents, Performing the Final Link, Performing the Final Link -@subsubsection Information provided by the linker -Before the linker calls the @code{_bfd_final_link} entry point, -it sets up some data structures for the function to use. - -The @code{input_bfds} field of the @code{bfd_link_info} structure -will point to a list of all the input files included in the -link. These files are linked through the @code{link_next} field -of the @code{bfd} structure. - -Each section in the output file will have a list of -@code{link_order} structures attached to the @code{map_head.link_order} -field (the @code{link_order} structure is defined in -@code{bfdlink.h}). These structures describe how to create the -contents of the output section in terms of the contents of -various input sections, fill constants, and, eventually, other -types of information. They also describe relocs that must be -created by the BFD backend, but do not correspond to any input -file; this is used to support -Ur, which builds constructors -while generating a relocatable object file. - -@node Relocating the section contents, Writing the symbol table, Information provided by the linker, Performing the Final Link -@subsubsection Relocating the section contents -The @code{_bfd_final_link} function should look through the -@code{link_order} structures attached to each section of the -output file. Each @code{link_order} structure should either be -handled specially, or it should be passed to the function -@code{_bfd_default_link_order} which will do the right thing -(@code{_bfd_default_link_order} is defined in @code{linker.c}). - -For efficiency, a @code{link_order} of type -@code{bfd_indirect_link_order} whose associated section belongs -to a BFD of the same format as the output BFD must be handled -specially. This type of @code{link_order} describes part of an -output section in terms of a section belonging to one of the -input files. The @code{_bfd_final_link} function should read the -contents of the section and any associated relocs, apply the -relocs to the section contents, and write out the modified -section contents. If performing a relocatable link, the -relocs themselves must also be modified and written out. - -@findex _bfd_relocate_contents -@findex _bfd_final_link_relocate -The functions @code{_bfd_relocate_contents} and -@code{_bfd_final_link_relocate} provide some general support for -performing the actual relocations, notably overflow checking. -Their arguments include information about the symbol the -relocation is against and a @code{reloc_howto_type} argument -which describes the relocation to perform. These functions -are defined in @code{reloc.c}. - -The a.out function which handles reading, relocating, and -writing section contents is @code{aout_link_input_section}. The -actual relocation is done in @code{aout_link_input_section_std} -and @code{aout_link_input_section_ext}. - -@node Writing the symbol table, , Relocating the section contents, Performing the Final Link -@subsubsection Writing the symbol table -The @code{_bfd_final_link} function must gather all the symbols -in the input files and write them out. It must also write out -all the symbols in the global hash table. This must be -controlled by the @code{strip} and @code{discard} fields of the -@code{bfd_link_info} structure. - -The local symbols of the input files will not have been -entered into the linker hash table. The @code{_bfd_final_link} -routine must consider each input file and include the symbols -in the output file. It may be convenient to do this when -looking through the @code{link_order} structures, or it may be -done by stepping through the @code{input_bfds} list. - -The @code{_bfd_final_link} routine must also traverse the global -hash table to gather all the externally visible symbols. It -is possible that most of the externally visible symbols may be -written out when considering the symbols of each input file, -but it is still necessary to traverse the hash table since the -linker script may have defined some symbols that are not in -any of the input files. - -The @code{strip} field of the @code{bfd_link_info} structure -controls which symbols are written out. The possible values -are listed in @code{bfdlink.h}. If the value is @code{strip_some}, -then the @code{keep_hash} field of the @code{bfd_link_info} -structure is a hash table of symbols to keep; each symbol -should be looked up in this hash table, and only symbols which -are present should be included in the output file. - -If the @code{strip} field of the @code{bfd_link_info} structure -permits local symbols to be written out, the @code{discard} field -is used to further controls which local symbols are included -in the output file. If the value is @code{discard_l}, then all -local symbols which begin with a certain prefix are discarded; -this is controlled by the @code{bfd_is_local_label_name} entry point. - -The a.out backend handles symbols by calling -@code{aout_link_write_symbols} on each input BFD and then -traversing the global hash table with the function -@code{aout_link_write_other_symbol}. It builds a string table -while writing out the symbols, which is written to the output -file at the end of @code{NAME(aout,final_link)}. - -@findex bfd_link_split_section -@subsubsection @code{bfd_link_split_section} -@strong{Synopsis} -@example -bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); -@end example -@strong{Description}@* -Return nonzero if @var{sec} should be split during a -reloceatable or final link. -@example -#define bfd_link_split_section(abfd, sec) \ - BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec)) - -@end example - -@findex bfd_section_already_linked -@subsubsection @code{bfd_section_already_linked} -@strong{Synopsis} -@example -void bfd_section_already_linked (bfd *abfd, asection *sec); -@end example -@strong{Description}@* -Check if @var{sec} has been already linked during a reloceatable -or final link. -@example -#define bfd_section_already_linked(abfd, sec) \ - BFD_SEND (abfd, _section_already_linked, (abfd, sec)) - -@end example - diff --git a/bfd/doc/mmo.texi b/bfd/doc/mmo.texi deleted file mode 100644 index b0d726aad9c..00000000000 --- a/bfd/doc/mmo.texi +++ /dev/null @@ -1,365 +0,0 @@ -@section mmo backend -The mmo object format is used exclusively together with Professor -Donald E.@: Knuth's educational 64-bit processor MMIX. The simulator -@command{mmix} which is available at -@url{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz} -understands this format. That package also includes a combined -assembler and linker called @command{mmixal}. The mmo format has -no advantages feature-wise compared to e.g. ELF. It is a simple -non-relocatable object format with no support for archives or -debugging information, except for symbol value information and -line numbers (which is not yet implemented in BFD). See -@url{http://www-cs-faculty.stanford.edu/~knuth/mmix.html} for more -information about MMIX. The ELF format is used for intermediate -object files in the BFD implementation. - -@c We want to xref the symbol table node. A feature in "chew" -@c requires that "commands" do not contain spaces in the -@c arguments. Hence the hyphen in "Symbol-table". -@menu -* File layout:: -* Symbol-table:: -* mmo section mapping:: -@end menu - -@node File layout, Symbol-table, mmo, mmo -@subsection File layout -The mmo file contents is not partitioned into named sections as -with e.g.@: ELF. Memory areas is formed by specifying the -location of the data that follows. Only the memory area -@samp{0x0000@dots{}00} to @samp{0x01ff@dots{}ff} is executable, so -it is used for code (and constants) and the area -@samp{0x2000@dots{}00} to @samp{0x20ff@dots{}ff} is used for -writable data. @xref{mmo section mapping}. - -There is provision for specifying ``special data'' of 65536 -different types. We use type 80 (decimal), arbitrarily chosen the -same as the ELF @code{e_machine} number for MMIX, filling it with -section information normally found in ELF objects. @xref{mmo -section mapping}. - -Contents is entered as 32-bit words, xor:ed over previous -contents, always zero-initialized. A word that starts with the -byte @samp{0x98} forms a command called a @samp{lopcode}, where -the next byte distinguished between the thirteen lopcodes. The -two remaining bytes, called the @samp{Y} and @samp{Z} fields, or -the @samp{YZ} field (a 16-bit big-endian number), are used for -various purposes different for each lopcode. As documented in -@url{http://www-cs-faculty.stanford.edu/~knuth/mmixal-intro.ps.gz}, -the lopcodes are: - -@table @code -@item lop_quote -0x98000001. The next word is contents, regardless of whether it -starts with 0x98 or not. - -@item lop_loc -0x9801YYZZ, where @samp{Z} is 1 or 2. This is a location -directive, setting the location for the next data to the next -32-bit word (for @math{Z = 1}) or 64-bit word (for @math{Z = 2}), -plus @math{Y * 2^56}. Normally @samp{Y} is 0 for the text segment -and 2 for the data segment. - -@item lop_skip -0x9802YYZZ. Increase the current location by @samp{YZ} bytes. - -@item lop_fixo -0x9803YYZZ, where @samp{Z} is 1 or 2. Store the current location -as 64 bits into the location pointed to by the next 32-bit -(@math{Z = 1}) or 64-bit (@math{Z = 2}) word, plus @math{Y * -2^56}. - -@item lop_fixr -0x9804YYZZ. @samp{YZ} is stored into the current location plus -@math{2 - 4 * YZ}. - -@item lop_fixrx -0x980500ZZ. @samp{Z} is 16 or 24. A value @samp{L} derived from -the following 32-bit word are used in a manner similar to -@samp{YZ} in lop_fixr: it is xor:ed into the current location -minus @math{4 * L}. The first byte of the word is 0 or 1. If it -is 1, then @math{L = (@var{lowest 24 bits of word}) - 2^Z}, if 0, -then @math{L = (@var{lowest 24 bits of word})}. - -@item lop_file -0x9806YYZZ. @samp{Y} is the file number, @samp{Z} is count of -32-bit words. Set the file number to @samp{Y} and the line -counter to 0. The next @math{Z * 4} bytes contain the file name, -padded with zeros if the count is not a multiple of four. The -same @samp{Y} may occur multiple times, but @samp{Z} must be 0 for -all but the first occurrence. - -@item lop_line -0x9807YYZZ. @samp{YZ} is the line number. Together with -lop_file, it forms the source location for the next 32-bit word. -Note that for each non-lopcode 32-bit word, line numbers are -assumed incremented by one. - -@item lop_spec -0x9808YYZZ. @samp{YZ} is the type number. Data until the next -lopcode other than lop_quote forms special data of type @samp{YZ}. -@xref{mmo section mapping}. - -Other types than 80, (or type 80 with a content that does not -parse) is stored in sections named @code{.MMIX.spec_data.@var{n}} -where @var{n} is the @samp{YZ}-type. The flags for such a -sections say not to allocate or load the data. The vma is 0. -Contents of multiple occurrences of special data @var{n} is -concatenated to the data of the previous lop_spec @var{n}s. The -location in data or code at which the lop_spec occurred is lost. - -@item lop_pre -0x980901ZZ. The first lopcode in a file. The @samp{Z} field forms the -length of header information in 32-bit words, where the first word -tells the time in seconds since @samp{00:00:00 GMT Jan 1 1970}. - -@item lop_post -0x980a00ZZ. @math{Z > 32}. This lopcode follows after all -content-generating lopcodes in a program. The @samp{Z} field -denotes the value of @samp{rG} at the beginning of the program. -The following @math{256 - Z} big-endian 64-bit words are loaded -into global registers @samp{$G} @dots{} @samp{$255}. - -@item lop_stab -0x980b0000. The next-to-last lopcode in a program. Must follow -immediately after the lop_post lopcode and its data. After this -lopcode follows all symbols in a compressed format -(@pxref{Symbol-table}). - -@item lop_end -0x980cYYZZ. The last lopcode in a program. It must follow the -lop_stab lopcode and its data. The @samp{YZ} field contains the -number of 32-bit words of symbol table information after the -preceding lop_stab lopcode. -@end table - -Note that the lopcode "fixups"; @code{lop_fixr}, @code{lop_fixrx} and -@code{lop_fixo} are not generated by BFD, but are handled. They are -generated by @code{mmixal}. - -This trivial one-label, one-instruction file: - -@example - :Main TRAP 1,2,3 -@end example - -can be represented this way in mmo: - -@example - 0x98090101 - lop_pre, one 32-bit word with timestamp. - - 0x98010002 - lop_loc, text segment, using a 64-bit address. - Note that mmixal does not emit this for the file above. - 0x00000000 - Address, high 32 bits. - 0x00000000 - Address, low 32 bits. - 0x98060002 - lop_file, 2 32-bit words for file-name. - 0x74657374 - "test" - 0x2e730000 - ".s\0\0" - 0x98070001 - lop_line, line 1. - 0x00010203 - TRAP 1,2,3 - 0x980a00ff - lop_post, setting $255 to 0. - 0x00000000 - 0x00000000 - 0x980b0000 - lop_stab for ":Main" = 0, serial 1. - 0x203a4040 @xref{Symbol-table}. - 0x10404020 - 0x4d206120 - 0x69016e00 - 0x81000000 - 0x980c0005 - lop_end; symbol table contained five 32-bit words. -@end example -@node Symbol-table, mmo section mapping, File layout, mmo -@subsection Symbol table format -From mmixal.w (or really, the generated mmixal.tex) in -@url{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz}): -``Symbols are stored and retrieved by means of a @samp{ternary -search trie}, following ideas of Bentley and Sedgewick. (See -ACM--SIAM Symp.@: on Discrete Algorithms @samp{8} (1997), 360--369; -R.@:Sedgewick, @samp{Algorithms in C} (Reading, Mass.@: -Addison--Wesley, 1998), @samp{15.4}.) Each trie node stores a -character, and there are branches to subtries for the cases where -a given character is less than, equal to, or greater than the -character in the trie. There also is a pointer to a symbol table -entry if a symbol ends at the current node.'' - -So it's a tree encoded as a stream of bytes. The stream of bytes -acts on a single virtual global symbol, adding and removing -characters and signalling complete symbol points. Here, we read -the stream and create symbols at the completion points. - -First, there's a control byte @code{m}. If any of the listed bits -in @code{m} is nonzero, we execute what stands at the right, in -the listed order: - -@example - (MMO3_LEFT) - 0x40 - Traverse left trie. - (Read a new command byte and recurse.) - - (MMO3_SYMBITS) - 0x2f - Read the next byte as a character and store it in the - current character position; increment character position. - Test the bits of @code{m}: - - (MMO3_WCHAR) - 0x80 - The character is 16-bit (so read another byte, - merge into current character. - - (MMO3_TYPEBITS) - 0xf - We have a complete symbol; parse the type, value - and serial number and do what should be done - with a symbol. The type and length information - is in j = (m & 0xf). - - (MMO3_REGQUAL_BITS) - j == 0xf: A register variable. The following - byte tells which register. - j <= 8: An absolute symbol. Read j bytes as the - big-endian number the symbol equals. - A j = 2 with two zero bytes denotes an - unknown symbol. - j > 8: As with j <= 8, but add (0x20 << 56) - to the value in the following j - 8 - bytes. - - Then comes the serial number, as a variant of - uleb128, but better named ubeb128: - Read bytes and shift the previous value left 7 - (multiply by 128). Add in the new byte, repeat - until a byte has bit 7 set. The serial number - is the computed value minus 128. - - (MMO3_MIDDLE) - 0x20 - Traverse middle trie. (Read a new command byte - and recurse.) Decrement character position. - - (MMO3_RIGHT) - 0x10 - Traverse right trie. (Read a new command byte and - recurse.) -@end example - -Let's look again at the @code{lop_stab} for the trivial file -(@pxref{File layout}). - -@example - 0x980b0000 - lop_stab for ":Main" = 0, serial 1. - 0x203a4040 - 0x10404020 - 0x4d206120 - 0x69016e00 - 0x81000000 -@end example - -This forms the trivial trie (note that the path between ``:'' and -``M'' is redundant): - -@example - 203a ":" - 40 / - 40 / - 10 \ - 40 / - 40 / - 204d "M" - 2061 "a" - 2069 "i" - 016e "n" is the last character in a full symbol, and - with a value represented in one byte. - 00 The value is 0. - 81 The serial number is 1. -@end example - -@node mmo section mapping, , Symbol-table, mmo -@subsection mmo section mapping -The implementation in BFD uses special data type 80 (decimal) to -encapsulate and describe named sections, containing e.g.@: debug -information. If needed, any datum in the encapsulation will be -quoted using lop_quote. First comes a 32-bit word holding the -number of 32-bit words containing the zero-terminated zero-padded -segment name. After the name there's a 32-bit word holding flags -describing the section type. Then comes a 64-bit big-endian word -with the section length (in bytes), then another with the section -start address. Depending on the type of section, the contents -might follow, zero-padded to 32-bit boundary. For a loadable -section (such as data or code), the contents might follow at some -later point, not necessarily immediately, as a lop_loc with the -same start address as in the section description, followed by the -contents. This in effect forms a descriptor that must be emitted -before the actual contents. Sections described this way must not -overlap. - -For areas that don't have such descriptors, synthetic sections are -formed by BFD. Consecutive contents in the two memory areas -@samp{0x0000@dots{}00} to @samp{0x01ff@dots{}ff} and -@samp{0x2000@dots{}00} to @samp{0x20ff@dots{}ff} are entered in -sections named @code{.text} and @code{.data} respectively. If an area -is not otherwise described, but would together with a neighboring -lower area be less than @samp{0x40000000} bytes long, it is joined -with the lower area and the gap is zero-filled. For other cases, -a new section is formed, named @code{.MMIX.sec.@var{n}}. Here, -@var{n} is a number, a running count through the mmo file, -starting at 0. - -A loadable section specified as: - -@example - .section secname,"ax" - TETRA 1,2,3,4,-1,-2009 - BYTE 80 -@end example - -and linked to address @samp{0x4}, is represented by the sequence: - -@example - 0x98080050 - lop_spec 80 - 0x00000002 - two 32-bit words for the section name - 0x7365636e - "secn" - 0x616d6500 - "ame\0" - 0x00000033 - flags CODE, READONLY, LOAD, ALLOC - 0x00000000 - high 32 bits of section length - 0x0000001c - section length is 28 bytes; 6 * 4 + 1 + alignment to 32 bits - 0x00000000 - high 32 bits of section address - 0x00000004 - section address is 4 - 0x98010002 - 64 bits with address of following data - 0x00000000 - high 32 bits of address - 0x00000004 - low 32 bits: data starts at address 4 - 0x00000001 - 1 - 0x00000002 - 2 - 0x00000003 - 3 - 0x00000004 - 4 - 0xffffffff - -1 - 0xfffff827 - -2009 - 0x50000000 - 80 as a byte, padded with zeros. -@end example - -Note that the lop_spec wrapping does not include the section -contents. Compare this to a non-loaded section specified as: - -@example - .section thirdsec - TETRA 200001,100002 - BYTE 38,40 -@end example - -This, when linked to address @samp{0x200000000000001c}, is -represented by: - -@example - 0x98080050 - lop_spec 80 - 0x00000002 - two 32-bit words for the section name - 0x7365636e - "thir" - 0x616d6500 - "dsec" - 0x00000010 - flag READONLY - 0x00000000 - high 32 bits of section length - 0x0000000c - section length is 12 bytes; 2 * 4 + 2 + alignment to 32 bits - 0x20000000 - high 32 bits of address - 0x0000001c - low 32 bits of address 0x200000000000001c - 0x00030d41 - 200001 - 0x000186a2 - 100002 - 0x26280000 - 38, 40 as bytes, padded with zeros -@end example - -For the latter example, the section contents must not be -loaded in memory, and is therefore specified as part of the -special data. The address is usually unimportant but might -provide information for e.g.@: the DWARF 2 debugging format. diff --git a/bfd/doc/opncls.texi b/bfd/doc/opncls.texi deleted file mode 100644 index 6b47adfbb45..00000000000 --- a/bfd/doc/opncls.texi +++ /dev/null @@ -1,365 +0,0 @@ -@section Opening and closing BFDs - - -@subsection Functions for opening and closing - - -@findex bfd_fopen -@subsubsection @code{bfd_fopen} -@strong{Synopsis} -@example -bfd *bfd_fopen (const char *filename, const char *target, - const char *mode, int fd); -@end example -@strong{Description}@* -Open the file @var{filename} with the target @var{target}. -Return a pointer to the created BFD. If @var{fd} is not -1, -then @code{fdopen} is used to open the file; otherwise, @code{fopen} -is used. @var{mode} is passed directly to @code{fopen} or -@code{fdopen}. - -Calls @code{bfd_find_target}, so @var{target} is interpreted as by -that function. - -The new BFD is marked as cacheable iff @var{fd} is -1. - -If @code{NULL} is returned then an error has occured. Possible errors -are @code{bfd_error_no_memory}, @code{bfd_error_invalid_target} or -@code{system_call} error. - -@findex bfd_openr -@subsubsection @code{bfd_openr} -@strong{Synopsis} -@example -bfd *bfd_openr (const char *filename, const char *target); -@end example -@strong{Description}@* -Open the file @var{filename} (using @code{fopen}) with the target -@var{target}. Return a pointer to the created BFD. - -Calls @code{bfd_find_target}, so @var{target} is interpreted as by -that function. - -If @code{NULL} is returned then an error has occured. Possible errors -are @code{bfd_error_no_memory}, @code{bfd_error_invalid_target} or -@code{system_call} error. - -@findex bfd_fdopenr -@subsubsection @code{bfd_fdopenr} -@strong{Synopsis} -@example -bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -@end example -@strong{Description}@* -@code{bfd_fdopenr} is to @code{bfd_fopenr} much like @code{fdopen} is to -@code{fopen}. It opens a BFD on a file already described by the -@var{fd} supplied. - -When the file is later @code{bfd_close}d, the file descriptor will -be closed. If the caller desires that this file descriptor be -cached by BFD (opened as needed, closed as needed to free -descriptors for other opens), with the supplied @var{fd} used as -an initial file descriptor (but subject to closure at any time), -call bfd_set_cacheable(bfd, 1) on the returned BFD. The default -is to assume no caching; the file descriptor will remain open -until @code{bfd_close}, and will not be affected by BFD operations -on other files. - -Possible errors are @code{bfd_error_no_memory}, -@code{bfd_error_invalid_target} and @code{bfd_error_system_call}. - -@findex bfd_openstreamr -@subsubsection @code{bfd_openstreamr} -@strong{Synopsis} -@example -bfd *bfd_openstreamr (const char *, const char *, void *); -@end example -@strong{Description}@* -Open a BFD for read access on an existing stdio stream. When -the BFD is passed to @code{bfd_close}, the stream will be closed. - -@findex bfd_openr_iovec -@subsubsection @code{bfd_openr_iovec} -@strong{Synopsis} -@example -bfd *bfd_openr_iovec (const char *filename, const char *target, - void *(*open) (struct bfd *nbfd, - void *open_closure), - void *open_closure, - file_ptr (*pread) (struct bfd *nbfd, - void *stream, - void *buf, - file_ptr nbytes, - file_ptr offset), - int (*close) (struct bfd *nbfd, - void *stream)); -@end example -@strong{Description}@* -Create and return a BFD backed by a read-only @var{stream}. -The @var{stream} is created using @var{open}, accessed using -@var{pread} and destroyed using @var{close}. - -Calls @code{bfd_find_target}, so @var{target} is interpreted as by -that function. - -Calls @var{open} (which can call @code{bfd_zalloc} and -@code{bfd_get_filename}) to obtain the read-only stream backing -the BFD. @var{open} either succeeds returning the -non-@code{NULL} @var{stream}, or fails returning @code{NULL} -(setting @code{bfd_error}). - -Calls @var{pread} to request @var{nbytes} of data from -@var{stream} starting at @var{offset} (e.g., via a call to -@code{bfd_read}). @var{pread} either succeeds returning the -number of bytes read (which can be less than @var{nbytes} when -end-of-file), or fails returning -1 (setting @code{bfd_error}). - -Calls @var{close} when the BFD is later closed using -@code{bfd_close}. @var{close} either succeeds returning 0, or -fails returning -1 (setting @code{bfd_error}). - -If @code{bfd_openr_iovec} returns @code{NULL} then an error has -occurred. Possible errors are @code{bfd_error_no_memory}, -@code{bfd_error_invalid_target} and @code{bfd_error_system_call}. - -@findex bfd_openw -@subsubsection @code{bfd_openw} -@strong{Synopsis} -@example -bfd *bfd_openw (const char *filename, const char *target); -@end example -@strong{Description}@* -Create a BFD, associated with file @var{filename}, using the -file format @var{target}, and return a pointer to it. - -Possible errors are @code{bfd_error_system_call}, @code{bfd_error_no_memory}, -@code{bfd_error_invalid_target}. - -@findex bfd_close -@subsubsection @code{bfd_close} -@strong{Synopsis} -@example -bfd_boolean bfd_close (bfd *abfd); -@end example -@strong{Description}@* -Close a BFD. If the BFD was open for writing, then pending -operations are completed and the file written out and closed. -If the created file is executable, then @code{chmod} is called -to mark it as such. - -All memory attached to the BFD is released. - -The file descriptor associated with the BFD is closed (even -if it was passed in to BFD by @code{bfd_fdopenr}). - -@strong{Returns}@* -@code{TRUE} is returned if all is ok, otherwise @code{FALSE}. - -@findex bfd_close_all_done -@subsubsection @code{bfd_close_all_done} -@strong{Synopsis} -@example -bfd_boolean bfd_close_all_done (bfd *); -@end example -@strong{Description}@* -Close a BFD. Differs from @code{bfd_close} since it does not -complete any pending operations. This routine would be used -if the application had just used BFD for swapping and didn't -want to use any of the writing code. - -If the created file is executable, then @code{chmod} is called -to mark it as such. - -All memory attached to the BFD is released. - -@strong{Returns}@* -@code{TRUE} is returned if all is ok, otherwise @code{FALSE}. - -@findex bfd_create -@subsubsection @code{bfd_create} -@strong{Synopsis} -@example -bfd *bfd_create (const char *filename, bfd *templ); -@end example -@strong{Description}@* -Create a new BFD in the manner of @code{bfd_openw}, but without -opening a file. The new BFD takes the target from the target -used by @var{template}. The format is always set to @code{bfd_object}. - -@findex bfd_make_writable -@subsubsection @code{bfd_make_writable} -@strong{Synopsis} -@example -bfd_boolean bfd_make_writable (bfd *abfd); -@end example -@strong{Description}@* -Takes a BFD as created by @code{bfd_create} and converts it -into one like as returned by @code{bfd_openw}. It does this -by converting the BFD to BFD_IN_MEMORY. It's assumed that -you will call @code{bfd_make_readable} on this bfd later. - -@strong{Returns}@* -@code{TRUE} is returned if all is ok, otherwise @code{FALSE}. - -@findex bfd_make_readable -@subsubsection @code{bfd_make_readable} -@strong{Synopsis} -@example -bfd_boolean bfd_make_readable (bfd *abfd); -@end example -@strong{Description}@* -Takes a BFD as created by @code{bfd_create} and -@code{bfd_make_writable} and converts it into one like as -returned by @code{bfd_openr}. It does this by writing the -contents out to the memory buffer, then reversing the -direction. - -@strong{Returns}@* -@code{TRUE} is returned if all is ok, otherwise @code{FALSE}. - -@findex bfd_alloc -@subsubsection @code{bfd_alloc} -@strong{Synopsis} -@example -void *bfd_alloc (bfd *abfd, bfd_size_type wanted); -@end example -@strong{Description}@* -Allocate a block of @var{wanted} bytes of memory attached to -@code{abfd} and return a pointer to it. - -@findex bfd_alloc2 -@subsubsection @code{bfd_alloc2} -@strong{Synopsis} -@example -void *bfd_alloc2 (bfd *abfd, bfd_size_type nmemb, bfd_size_type size); -@end example -@strong{Description}@* -Allocate a block of @var{nmemb} elements of @var{size} bytes each -of memory attached to @code{abfd} and return a pointer to it. - -@findex bfd_zalloc -@subsubsection @code{bfd_zalloc} -@strong{Synopsis} -@example -void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); -@end example -@strong{Description}@* -Allocate a block of @var{wanted} bytes of zeroed memory -attached to @code{abfd} and return a pointer to it. - -@findex bfd_zalloc2 -@subsubsection @code{bfd_zalloc2} -@strong{Synopsis} -@example -void *bfd_zalloc2 (bfd *abfd, bfd_size_type nmemb, bfd_size_type size); -@end example -@strong{Description}@* -Allocate a block of @var{nmemb} elements of @var{size} bytes each -of zeroed memory attached to @code{abfd} and return a pointer to it. - -@findex bfd_calc_gnu_debuglink_crc32 -@subsubsection @code{bfd_calc_gnu_debuglink_crc32} -@strong{Synopsis} -@example -unsigned long bfd_calc_gnu_debuglink_crc32 - (unsigned long crc, const unsigned char *buf, bfd_size_type len); -@end example -@strong{Description}@* -Computes a CRC value as used in the .gnu_debuglink section. -Advances the previously computed @var{crc} value by computing -and adding in the crc32 for @var{len} bytes of @var{buf}. - -@strong{Returns}@* -Return the updated CRC32 value. - -@findex get_debug_link_info -@subsubsection @code{get_debug_link_info} -@strong{Synopsis} -@example -char *get_debug_link_info (bfd *abfd, unsigned long *crc32_out); -@end example -@strong{Description}@* -fetch the filename and CRC32 value for any separate debuginfo -associated with @var{abfd}. Return NULL if no such info found, -otherwise return filename and update @var{crc32_out}. - -@findex separate_debug_file_exists -@subsubsection @code{separate_debug_file_exists} -@strong{Synopsis} -@example -bfd_boolean separate_debug_file_exists - (char *name, unsigned long crc32); -@end example -@strong{Description}@* -Checks to see if @var{name} is a file and if its contents -match @var{crc32}. - -@findex find_separate_debug_file -@subsubsection @code{find_separate_debug_file} -@strong{Synopsis} -@example -char *find_separate_debug_file (bfd *abfd); -@end example -@strong{Description}@* -Searches @var{abfd} for a reference to separate debugging -information, scans various locations in the filesystem, including -the file tree rooted at @var{debug_file_directory}, and returns a -filename of such debugging information if the file is found and has -matching CRC32. Returns NULL if no reference to debugging file -exists, or file cannot be found. - -@findex bfd_follow_gnu_debuglink -@subsubsection @code{bfd_follow_gnu_debuglink} -@strong{Synopsis} -@example -char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); -@end example -@strong{Description}@* -Takes a BFD and searches it for a .gnu_debuglink section. If this -section is found, it examines the section for the name and checksum -of a '.debug' file containing auxiliary debugging information. It -then searches the filesystem for this .debug file in some standard -locations, including the directory tree rooted at @var{dir}, and if -found returns the full filename. - -If @var{dir} is NULL, it will search a default path configured into -libbfd at build time. [XXX this feature is not currently -implemented]. - -@strong{Returns}@* -@code{NULL} on any errors or failure to locate the .debug file, -otherwise a pointer to a heap-allocated string containing the -filename. The caller is responsible for freeing this string. - -@findex bfd_create_gnu_debuglink_section -@subsubsection @code{bfd_create_gnu_debuglink_section} -@strong{Synopsis} -@example -struct bfd_section *bfd_create_gnu_debuglink_section - (bfd *abfd, const char *filename); -@end example -@strong{Description}@* -Takes a @var{BFD} and adds a .gnu_debuglink section to it. The section is sized -to be big enough to contain a link to the specified @var{filename}. - -@strong{Returns}@* -A pointer to the new section is returned if all is ok. Otherwise @code{NULL} is -returned and bfd_error is set. - -@findex bfd_fill_in_gnu_debuglink_section -@subsubsection @code{bfd_fill_in_gnu_debuglink_section} -@strong{Synopsis} -@example -bfd_boolean bfd_fill_in_gnu_debuglink_section - (bfd *abfd, struct bfd_section *sect, const char *filename); -@end example -@strong{Description}@* -Takes a @var{BFD} and containing a .gnu_debuglink section @var{SECT} -and fills in the contents of the section to contain a link to the -specified @var{filename}. The filename should be relative to the -current directory. - -@strong{Returns}@* -@code{TRUE} is returned if all is ok. Otherwise @code{FALSE} is returned -and bfd_error is set. - diff --git a/bfd/doc/reloc.texi b/bfd/doc/reloc.texi deleted file mode 100644 index 0540be86255..00000000000 --- a/bfd/doc/reloc.texi +++ /dev/null @@ -1,2494 +0,0 @@ -@section Relocations -BFD maintains relocations in much the same way it maintains -symbols: they are left alone until required, then read in -en-masse and translated into an internal form. A common -routine @code{bfd_perform_relocation} acts upon the -canonical form to do the fixup. - -Relocations are maintained on a per section basis, -while symbols are maintained on a per BFD basis. - -All that a back end has to do to fit the BFD interface is to create -a @code{struct reloc_cache_entry} for each relocation -in a particular section, and fill in the right bits of the structures. - -@menu -* typedef arelent:: -* howto manager:: -@end menu - - -@node typedef arelent, howto manager, Relocations, Relocations -@subsection typedef arelent -This is the structure of a relocation entry: - - -@example - -typedef enum bfd_reloc_status -@{ - /* No errors detected. */ - bfd_reloc_ok, - - /* The relocation was performed, but there was an overflow. */ - bfd_reloc_overflow, - - /* The address to relocate was not within the section supplied. */ - bfd_reloc_outofrange, - - /* Used by special functions. */ - bfd_reloc_continue, - - /* Unsupported relocation size requested. */ - bfd_reloc_notsupported, - - /* Unused. */ - bfd_reloc_other, - - /* The symbol to relocate against was undefined. */ - bfd_reloc_undefined, - - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ - bfd_reloc_dangerous - @} - bfd_reloc_status_type; - - -typedef struct reloc_cache_entry -@{ - /* A pointer into the canonical table of pointers. */ - struct bfd_symbol **sym_ptr_ptr; - - /* offset in section. */ - bfd_size_type address; - - /* addend for relocation value. */ - bfd_vma addend; - - /* Pointer to how to perform the required relocation. */ - reloc_howto_type *howto; - -@} -arelent; - -@end example -@strong{Description}@* -Here is a description of each of the fields within an @code{arelent}: - -@itemize @bullet - -@item -@code{sym_ptr_ptr} -@end itemize -The symbol table pointer points to a pointer to the symbol -associated with the relocation request. It is the pointer -into the table returned by the back end's -@code{canonicalize_symtab} action. @xref{Symbols}. The symbol is -referenced through a pointer to a pointer so that tools like -the linker can fix up all the symbols of the same name by -modifying only one pointer. The relocation routine looks in -the symbol and uses the base of the section the symbol is -attached to and the value of the symbol as the initial -relocation offset. If the symbol pointer is zero, then the -section provided is looked up. - -@itemize @bullet - -@item -@code{address} -@end itemize -The @code{address} field gives the offset in bytes from the base of -the section data which owns the relocation record to the first -byte of relocatable information. The actual data relocated -will be relative to this point; for example, a relocation -type which modifies the bottom two bytes of a four byte word -would not touch the first byte pointed to in a big endian -world. - -@itemize @bullet - -@item -@code{addend} -@end itemize -The @code{addend} is a value provided by the back end to be added (!) -to the relocation offset. Its interpretation is dependent upon -the howto. For example, on the 68k the code: - -@example - char foo[]; - main() - @{ - return foo[0x12345678]; - @} -@end example - -Could be compiled into: - -@example - linkw fp,#-4 - moveb @@#12345678,d0 - extbl d0 - unlk fp - rts -@end example - -This could create a reloc pointing to @code{foo}, but leave the -offset in the data, something like: - -@example -RELOCATION RECORDS FOR [.text]: -offset type value -00000006 32 _foo - -00000000 4e56 fffc ; linkw fp,#-4 -00000004 1039 1234 5678 ; moveb @@#12345678,d0 -0000000a 49c0 ; extbl d0 -0000000c 4e5e ; unlk fp -0000000e 4e75 ; rts -@end example - -Using coff and an 88k, some instructions don't have enough -space in them to represent the full address range, and -pointers have to be loaded in two parts. So you'd get something like: - -@example - or.u r13,r0,hi16(_foo+0x12345678) - ld.b r2,r13,lo16(_foo+0x12345678) - jmp r1 -@end example - -This should create two relocs, both pointing to @code{_foo}, and with -0x12340000 in their addend field. The data would consist of: - -@example -RELOCATION RECORDS FOR [.text]: -offset type value -00000002 HVRT16 _foo+0x12340000 -00000006 LVRT16 _foo+0x12340000 - -00000000 5da05678 ; or.u r13,r0,0x5678 -00000004 1c4d5678 ; ld.b r2,r13,0x5678 -00000008 f400c001 ; jmp r1 -@end example - -The relocation routine digs out the value from the data, adds -it to the addend to get the original offset, and then adds the -value of @code{_foo}. Note that all 32 bits have to be kept around -somewhere, to cope with carry from bit 15 to bit 16. - -One further example is the sparc and the a.out format. The -sparc has a similar problem to the 88k, in that some -instructions don't have room for an entire offset, but on the -sparc the parts are created in odd sized lumps. The designers of -the a.out format chose to not use the data within the section -for storing part of the offset; all the offset is kept within -the reloc. Anything in the data should be ignored. - -@example - save %sp,-112,%sp - sethi %hi(_foo+0x12345678),%g2 - ldsb [%g2+%lo(_foo+0x12345678)],%i0 - ret - restore -@end example - -Both relocs contain a pointer to @code{foo}, and the offsets -contain junk. - -@example -RELOCATION RECORDS FOR [.text]: -offset type value -00000004 HI22 _foo+0x12345678 -00000008 LO10 _foo+0x12345678 - -00000000 9de3bf90 ; save %sp,-112,%sp -00000004 05000000 ; sethi %hi(_foo+0),%g2 -00000008 f048a000 ; ldsb [%g2+%lo(_foo+0)],%i0 -0000000c 81c7e008 ; ret -00000010 81e80000 ; restore -@end example - -@itemize @bullet - -@item -@code{howto} -@end itemize -The @code{howto} field can be imagined as a -relocation instruction. It is a pointer to a structure which -contains information on what to do with all of the other -information in the reloc record and data section. A back end -would normally have a relocation instruction set and turn -relocations into pointers to the correct structure on input - -but it would be possible to create each howto field on demand. - -@subsubsection @code{enum complain_overflow} -Indicates what sort of overflow checking should be done when -performing a relocation. - - -@example - -enum complain_overflow -@{ - /* Do not complain on overflow. */ - complain_overflow_dont, - - /* Complain if the value overflows when considered as a signed - number one bit larger than the field. ie. A bitfield of N bits - is allowed to represent -2**n to 2**n-1. */ - complain_overflow_bitfield, - - /* Complain if the value overflows when considered as a signed - number. */ - complain_overflow_signed, - - /* Complain if the value overflows when considered as an - unsigned number. */ - complain_overflow_unsigned -@}; -@end example -@subsubsection @code{reloc_howto_type} -The @code{reloc_howto_type} is a structure which contains all the -information that libbfd needs to know to tie up a back end's data. - - -@example -struct bfd_symbol; /* Forward declaration. */ - -struct reloc_howto_struct -@{ - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ - unsigned int type; - - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; - - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; - - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; - - /* Notes that the relocation is relative to the location in the - data section of the addend. The relocation function will - subtract from the relocation value the address of the location - being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; - - /* What type of overflow error should be checked for when - relocating. */ - enum complain_overflow complain_on_overflow; - - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); - - /* The textual name of the relocation type. */ - char *name; - - /* Some formats record a relocation addend in the section contents - rather than with the relocation. For ELF formats this is the - distinction between USE_REL and USE_RELA (though the code checks - for USE_REL == 1/0). The value of this field is TRUE if the - addend is recorded with the section contents; when performing a - partial link (ld -r) the section contents (the data) will be - modified. The value of this field is FALSE if addends are - recorded with the relocation (in arelent.addend); when performing - a partial link the relocation will be modified. - All relocations for all ELF USE_RELA targets should set this field - to FALSE (values of TRUE should be looked on with suspicion). - However, the converse is not true: not all relocations of all ELF - USE_REL targets set this field to TRUE. Why this is so is peculiar - to each particular target. For relocs that aren't used in partial - links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; - - /* When some formats create PC relative instructions, they leave - the value of the pc of the place being relocated in the offset - slot of the instruction, so that a PC relative relocation can - be made just by adding in an ordinary offset (e.g., sun3 a.out). - Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; -@}; - -@end example -@findex The HOWTO Macro -@subsubsection @code{The HOWTO Macro} -@strong{Description}@* -The HOWTO define is horrible and will go away. -@example -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - @{ (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC @} -@end example - -@strong{Description}@* -And will be replaced with the totally magic way. But for the -moment, we are compatible, so do it this way. -@example -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - -@end example - -@strong{Description}@* -This is used to fill in an empty howto entry in an array. -@example -#define EMPTY_HOWTO(C) \ - HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ - NULL, FALSE, 0, 0, FALSE) - -@end example - -@strong{Description}@* -Helper routine to turn a symbol into a relocation value. -@example -#define HOWTO_PREPARE(relocation, symbol) \ - @{ \ - if (symbol != NULL) \ - @{ \ - if (bfd_is_com_section (symbol->section)) \ - @{ \ - relocation = 0; \ - @} \ - else \ - @{ \ - relocation = symbol->value; \ - @} \ - @} \ - @} - -@end example - -@findex bfd_get_reloc_size -@subsubsection @code{bfd_get_reloc_size} -@strong{Synopsis} -@example -unsigned int bfd_get_reloc_size (reloc_howto_type *); -@end example -@strong{Description}@* -For a reloc_howto_type that operates on a fixed number of bytes, -this returns the number of bytes operated on. - -@findex arelent_chain -@subsubsection @code{arelent_chain} -@strong{Description}@* -How relocs are tied together in an @code{asection}: -@example -typedef struct relent_chain -@{ - arelent relent; - struct relent_chain *next; -@} -arelent_chain; - -@end example - -@findex bfd_check_overflow -@subsubsection @code{bfd_check_overflow} -@strong{Synopsis} -@example -bfd_reloc_status_type bfd_check_overflow - (enum complain_overflow how, - unsigned int bitsize, - unsigned int rightshift, - unsigned int addrsize, - bfd_vma relocation); -@end example -@strong{Description}@* -Perform overflow checking on @var{relocation} which has -@var{bitsize} significant bits and will be shifted right by -@var{rightshift} bits, on a machine with addresses containing -@var{addrsize} significant bits. The result is either of -@code{bfd_reloc_ok} or @code{bfd_reloc_overflow}. - -@findex bfd_perform_relocation -@subsubsection @code{bfd_perform_relocation} -@strong{Synopsis} -@example -bfd_reloc_status_type bfd_perform_relocation - (bfd *abfd, - arelent *reloc_entry, - void *data, - asection *input_section, - bfd *output_bfd, - char **error_message); -@end example -@strong{Description}@* -If @var{output_bfd} is supplied to this function, the -generated image will be relocatable; the relocations are -copied to the output file after they have been changed to -reflect the new state of the world. There are two ways of -reflecting the results of partial linkage in an output file: -by modifying the output data in place, and by modifying the -relocation record. Some native formats (e.g., basic a.out and -basic coff) have no way of specifying an addend in the -relocation type, so the addend has to go in the output data. -This is no big deal since in these formats the output data -slot will always be big enough for the addend. Complex reloc -types with addends were invented to solve just this problem. -The @var{error_message} argument is set to an error message if -this return @code{bfd_reloc_dangerous}. - -@findex bfd_install_relocation -@subsubsection @code{bfd_install_relocation} -@strong{Synopsis} -@example -bfd_reloc_status_type bfd_install_relocation - (bfd *abfd, - arelent *reloc_entry, - void *data, bfd_vma data_start, - asection *input_section, - char **error_message); -@end example -@strong{Description}@* -This looks remarkably like @code{bfd_perform_relocation}, except it -does not expect that the section contents have been filled in. -I.e., it's suitable for use when creating, rather than applying -a relocation. - -For now, this function should be considered reserved for the -assembler. - - -@node howto manager, , typedef arelent, Relocations -@subsection The howto manager -When an application wants to create a relocation, but doesn't -know what the target machine might call it, it can find out by -using this bit of code. - -@findex bfd_reloc_code_type -@subsubsection @code{bfd_reloc_code_type} -@strong{Description}@* -The insides of a reloc code. The idea is that, eventually, there -will be one enumerator for every type of relocation we ever do. -Pass one of these values to @code{bfd_reloc_type_lookup}, and it'll -return a howto pointer. - -This does mean that the application must determine the correct -enumerator value; you can't get a howto pointer from a random set -of attributes. - -Here are the possible values for @code{enum bfd_reloc_code_real}: - -@deffn {} BFD_RELOC_64 -@deffnx {} BFD_RELOC_32 -@deffnx {} BFD_RELOC_26 -@deffnx {} BFD_RELOC_24 -@deffnx {} BFD_RELOC_16 -@deffnx {} BFD_RELOC_14 -@deffnx {} BFD_RELOC_8 -Basic absolute relocations of N bits. -@end deffn -@deffn {} BFD_RELOC_64_PCREL -@deffnx {} BFD_RELOC_32_PCREL -@deffnx {} BFD_RELOC_24_PCREL -@deffnx {} BFD_RELOC_16_PCREL -@deffnx {} BFD_RELOC_12_PCREL -@deffnx {} BFD_RELOC_8_PCREL -PC-relative relocations. Sometimes these are relative to the address -of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. -@end deffn -@deffn {} BFD_RELOC_32_SECREL -Section relative relocations. Some targets need this for DWARF2. -@end deffn -@deffn {} BFD_RELOC_32_GOT_PCREL -@deffnx {} BFD_RELOC_16_GOT_PCREL -@deffnx {} BFD_RELOC_8_GOT_PCREL -@deffnx {} BFD_RELOC_32_GOTOFF -@deffnx {} BFD_RELOC_16_GOTOFF -@deffnx {} BFD_RELOC_LO16_GOTOFF -@deffnx {} BFD_RELOC_HI16_GOTOFF -@deffnx {} BFD_RELOC_HI16_S_GOTOFF -@deffnx {} BFD_RELOC_8_GOTOFF -@deffnx {} BFD_RELOC_64_PLT_PCREL -@deffnx {} BFD_RELOC_32_PLT_PCREL -@deffnx {} BFD_RELOC_24_PLT_PCREL -@deffnx {} BFD_RELOC_16_PLT_PCREL -@deffnx {} BFD_RELOC_8_PLT_PCREL -@deffnx {} BFD_RELOC_64_PLTOFF -@deffnx {} BFD_RELOC_32_PLTOFF -@deffnx {} BFD_RELOC_16_PLTOFF -@deffnx {} BFD_RELOC_LO16_PLTOFF -@deffnx {} BFD_RELOC_HI16_PLTOFF -@deffnx {} BFD_RELOC_HI16_S_PLTOFF -@deffnx {} BFD_RELOC_8_PLTOFF -For ELF. -@end deffn -@deffn {} BFD_RELOC_68K_GLOB_DAT -@deffnx {} BFD_RELOC_68K_JMP_SLOT -@deffnx {} BFD_RELOC_68K_RELATIVE -Relocations used by 68K ELF. -@end deffn -@deffn {} BFD_RELOC_32_BASEREL -@deffnx {} BFD_RELOC_16_BASEREL -@deffnx {} BFD_RELOC_LO16_BASEREL -@deffnx {} BFD_RELOC_HI16_BASEREL -@deffnx {} BFD_RELOC_HI16_S_BASEREL -@deffnx {} BFD_RELOC_8_BASEREL -@deffnx {} BFD_RELOC_RVA -Linkage-table relative. -@end deffn -@deffn {} BFD_RELOC_8_FFnn -Absolute 8-bit relocation, but used to form an address like 0xFFnn. -@end deffn -@deffn {} BFD_RELOC_32_PCREL_S2 -@deffnx {} BFD_RELOC_16_PCREL_S2 -@deffnx {} BFD_RELOC_23_PCREL_S2 -These PC-relative relocations are stored as word displacements -- -i.e., byte displacements shifted right two bits. The 30-bit word -displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the -SPARC. (SPARC tools generally refer to this as <>.) The -signed 16-bit displacement is used on the MIPS, and the 23-bit -displacement is used on the Alpha. -@end deffn -@deffn {} BFD_RELOC_HI22 -@deffnx {} BFD_RELOC_LO10 -High 22 bits and low 10 bits of 32-bit value, placed into lower bits of -the target word. These are used on the SPARC. -@end deffn -@deffn {} BFD_RELOC_GPREL16 -@deffnx {} BFD_RELOC_GPREL32 -For systems that allocate a Global Pointer register, these are -displacements off that register. These relocation types are -handled specially, because the value the register will have is -decided relatively late. -@end deffn -@deffn {} BFD_RELOC_I960_CALLJ -Reloc types used for i960/b.out. -@end deffn -@deffn {} BFD_RELOC_NONE -@deffnx {} BFD_RELOC_SPARC_WDISP22 -@deffnx {} BFD_RELOC_SPARC22 -@deffnx {} BFD_RELOC_SPARC13 -@deffnx {} BFD_RELOC_SPARC_GOT10 -@deffnx {} BFD_RELOC_SPARC_GOT13 -@deffnx {} BFD_RELOC_SPARC_GOT22 -@deffnx {} BFD_RELOC_SPARC_PC10 -@deffnx {} BFD_RELOC_SPARC_PC22 -@deffnx {} BFD_RELOC_SPARC_WPLT30 -@deffnx {} BFD_RELOC_SPARC_COPY -@deffnx {} BFD_RELOC_SPARC_GLOB_DAT -@deffnx {} BFD_RELOC_SPARC_JMP_SLOT -@deffnx {} BFD_RELOC_SPARC_RELATIVE -@deffnx {} BFD_RELOC_SPARC_UA16 -@deffnx {} BFD_RELOC_SPARC_UA32 -@deffnx {} BFD_RELOC_SPARC_UA64 -SPARC ELF relocations. There is probably some overlap with other -relocation types already defined. -@end deffn -@deffn {} BFD_RELOC_SPARC_BASE13 -@deffnx {} BFD_RELOC_SPARC_BASE22 -I think these are specific to SPARC a.out (e.g., Sun 4). -@end deffn -@deffn {} BFD_RELOC_SPARC_64 -@deffnx {} BFD_RELOC_SPARC_10 -@deffnx {} BFD_RELOC_SPARC_11 -@deffnx {} BFD_RELOC_SPARC_OLO10 -@deffnx {} BFD_RELOC_SPARC_HH22 -@deffnx {} BFD_RELOC_SPARC_HM10 -@deffnx {} BFD_RELOC_SPARC_LM22 -@deffnx {} BFD_RELOC_SPARC_PC_HH22 -@deffnx {} BFD_RELOC_SPARC_PC_HM10 -@deffnx {} BFD_RELOC_SPARC_PC_LM22 -@deffnx {} BFD_RELOC_SPARC_WDISP16 -@deffnx {} BFD_RELOC_SPARC_WDISP19 -@deffnx {} BFD_RELOC_SPARC_7 -@deffnx {} BFD_RELOC_SPARC_6 -@deffnx {} BFD_RELOC_SPARC_5 -@deffnx {} BFD_RELOC_SPARC_DISP64 -@deffnx {} BFD_RELOC_SPARC_PLT32 -@deffnx {} BFD_RELOC_SPARC_PLT64 -@deffnx {} BFD_RELOC_SPARC_HIX22 -@deffnx {} BFD_RELOC_SPARC_LOX10 -@deffnx {} BFD_RELOC_SPARC_H44 -@deffnx {} BFD_RELOC_SPARC_M44 -@deffnx {} BFD_RELOC_SPARC_L44 -@deffnx {} BFD_RELOC_SPARC_REGISTER -SPARC64 relocations -@end deffn -@deffn {} BFD_RELOC_SPARC_REV32 -SPARC little endian relocation -@end deffn -@deffn {} BFD_RELOC_SPARC_TLS_GD_HI22 -@deffnx {} BFD_RELOC_SPARC_TLS_GD_LO10 -@deffnx {} BFD_RELOC_SPARC_TLS_GD_ADD -@deffnx {} BFD_RELOC_SPARC_TLS_GD_CALL -@deffnx {} BFD_RELOC_SPARC_TLS_LDM_HI22 -@deffnx {} BFD_RELOC_SPARC_TLS_LDM_LO10 -@deffnx {} BFD_RELOC_SPARC_TLS_LDM_ADD -@deffnx {} BFD_RELOC_SPARC_TLS_LDM_CALL -@deffnx {} BFD_RELOC_SPARC_TLS_LDO_HIX22 -@deffnx {} BFD_RELOC_SPARC_TLS_LDO_LOX10 -@deffnx {} BFD_RELOC_SPARC_TLS_LDO_ADD -@deffnx {} BFD_RELOC_SPARC_TLS_IE_HI22 -@deffnx {} BFD_RELOC_SPARC_TLS_IE_LO10 -@deffnx {} BFD_RELOC_SPARC_TLS_IE_LD -@deffnx {} BFD_RELOC_SPARC_TLS_IE_LDX -@deffnx {} BFD_RELOC_SPARC_TLS_IE_ADD -@deffnx {} BFD_RELOC_SPARC_TLS_LE_HIX22 -@deffnx {} BFD_RELOC_SPARC_TLS_LE_LOX10 -@deffnx {} BFD_RELOC_SPARC_TLS_DTPMOD32 -@deffnx {} BFD_RELOC_SPARC_TLS_DTPMOD64 -@deffnx {} BFD_RELOC_SPARC_TLS_DTPOFF32 -@deffnx {} BFD_RELOC_SPARC_TLS_DTPOFF64 -@deffnx {} BFD_RELOC_SPARC_TLS_TPOFF32 -@deffnx {} BFD_RELOC_SPARC_TLS_TPOFF64 -SPARC TLS relocations -@end deffn -@deffn {} BFD_RELOC_ALPHA_GPDISP_HI16 -Alpha ECOFF and ELF relocations. Some of these treat the symbol or -"addend" in some special way. -For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when -writing; when reading, it will be the absolute section symbol. The -addend is the displacement in bytes of the "lda" instruction from -the "ldah" instruction (which is at the address of this reloc). -@end deffn -@deffn {} BFD_RELOC_ALPHA_GPDISP_LO16 -For GPDISP_LO16 ("ignore") relocations, the symbol is handled as -with GPDISP_HI16 relocs. The addend is ignored when writing the -relocations out, and is filled in with the file's GP value on -reading, for convenience. -@end deffn -@deffn {} BFD_RELOC_ALPHA_GPDISP -The ELF GPDISP relocation is exactly the same as the GPDISP_HI16 -relocation except that there is no accompanying GPDISP_LO16 -relocation. -@end deffn -@deffn {} BFD_RELOC_ALPHA_LITERAL -@deffnx {} BFD_RELOC_ALPHA_ELF_LITERAL -@deffnx {} BFD_RELOC_ALPHA_LITUSE -The Alpha LITERAL/LITUSE relocs are produced by a symbol reference; -the assembler turns it into a LDQ instruction to load the address of -the symbol, and then fills in a register in the real instruction. - -The LITERAL reloc, at the LDQ instruction, refers to the .lita -section symbol. The addend is ignored when writing, but is filled -in with the file's GP value on reading, for convenience, as with the -GPDISP_LO16 reloc. - -The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16. -It should refer to the symbol to be referenced, as with 16_GOTOFF, -but it generates output not based on the position within the .got -section, but relative to the GP value chosen for the file during the -final link stage. - -The LITUSE reloc, on the instruction using the loaded address, gives -information to the linker that it might be able to use to optimize -away some literal section references. The symbol is ignored (read -as the absolute section symbol), and the "addend" indicates the type -of instruction using the register: -1 - "memory" fmt insn -2 - byte-manipulation (byte offset reg) -3 - jsr (target of branch) -@end deffn -@deffn {} BFD_RELOC_ALPHA_HINT -The HINT relocation indicates a value that should be filled into the -"hint" field of a jmp/jsr/ret instruction, for possible branch- -prediction logic which may be provided on some processors. -@end deffn -@deffn {} BFD_RELOC_ALPHA_LINKAGE -The LINKAGE relocation outputs a linkage pair in the object file, -which is filled by the linker. -@end deffn -@deffn {} BFD_RELOC_ALPHA_CODEADDR -The CODEADDR relocation outputs a STO_CA in the object file, -which is filled by the linker. -@end deffn -@deffn {} BFD_RELOC_ALPHA_GPREL_HI16 -@deffnx {} BFD_RELOC_ALPHA_GPREL_LO16 -The GPREL_HI/LO relocations together form a 32-bit offset from the -GP register. -@end deffn -@deffn {} BFD_RELOC_ALPHA_BRSGP -Like BFD_RELOC_23_PCREL_S2, except that the source and target must -share a common GP, and the target address is adjusted for -STO_ALPHA_STD_GPLOAD. -@end deffn -@deffn {} BFD_RELOC_ALPHA_TLSGD -@deffnx {} BFD_RELOC_ALPHA_TLSLDM -@deffnx {} BFD_RELOC_ALPHA_DTPMOD64 -@deffnx {} BFD_RELOC_ALPHA_GOTDTPREL16 -@deffnx {} BFD_RELOC_ALPHA_DTPREL64 -@deffnx {} BFD_RELOC_ALPHA_DTPREL_HI16 -@deffnx {} BFD_RELOC_ALPHA_DTPREL_LO16 -@deffnx {} BFD_RELOC_ALPHA_DTPREL16 -@deffnx {} BFD_RELOC_ALPHA_GOTTPREL16 -@deffnx {} BFD_RELOC_ALPHA_TPREL64 -@deffnx {} BFD_RELOC_ALPHA_TPREL_HI16 -@deffnx {} BFD_RELOC_ALPHA_TPREL_LO16 -@deffnx {} BFD_RELOC_ALPHA_TPREL16 -Alpha thread-local storage relocations. -@end deffn -@deffn {} BFD_RELOC_MIPS_JMP -Bits 27..2 of the relocation address shifted right 2 bits; -simple reloc otherwise. -@end deffn -@deffn {} BFD_RELOC_MIPS16_JMP -The MIPS16 jump instruction. -@end deffn -@deffn {} BFD_RELOC_MIPS16_GPREL -MIPS16 GP relative reloc. -@end deffn -@deffn {} BFD_RELOC_HI16 -High 16 bits of 32-bit value; simple reloc. -@end deffn -@deffn {} BFD_RELOC_HI16_S -High 16 bits of 32-bit value but the low 16 bits will be sign -extended and added to form the final result. If the low 16 -bits form a negative number, we need to add one to the high value -to compensate for the borrow when the low bits are added. -@end deffn -@deffn {} BFD_RELOC_LO16 -Low 16 bits. -@end deffn -@deffn {} BFD_RELOC_HI16_PCREL -High 16 bits of 32-bit pc-relative value -@end deffn -@deffn {} BFD_RELOC_HI16_S_PCREL -High 16 bits of 32-bit pc-relative value, adjusted -@end deffn -@deffn {} BFD_RELOC_LO16_PCREL -Low 16 bits of pc-relative value -@end deffn -@deffn {} BFD_RELOC_MIPS16_HI16 -MIPS16 high 16 bits of 32-bit value. -@end deffn -@deffn {} BFD_RELOC_MIPS16_HI16_S -MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign -extended and added to form the final result. If the low 16 -bits form a negative number, we need to add one to the high value -to compensate for the borrow when the low bits are added. -@end deffn -@deffn {} BFD_RELOC_MIPS16_LO16 -MIPS16 low 16 bits. -@end deffn -@deffn {} BFD_RELOC_MIPS_LITERAL -Relocation against a MIPS literal section. -@end deffn -@deffn {} BFD_RELOC_MIPS_GOT16 -@deffnx {} BFD_RELOC_MIPS_CALL16 -@deffnx {} BFD_RELOC_MIPS_GOT_HI16 -@deffnx {} BFD_RELOC_MIPS_GOT_LO16 -@deffnx {} BFD_RELOC_MIPS_CALL_HI16 -@deffnx {} BFD_RELOC_MIPS_CALL_LO16 -@deffnx {} BFD_RELOC_MIPS_SUB -@deffnx {} BFD_RELOC_MIPS_GOT_PAGE -@deffnx {} BFD_RELOC_MIPS_GOT_OFST -@deffnx {} BFD_RELOC_MIPS_GOT_DISP -@deffnx {} BFD_RELOC_MIPS_SHIFT5 -@deffnx {} BFD_RELOC_MIPS_SHIFT6 -@deffnx {} BFD_RELOC_MIPS_INSERT_A -@deffnx {} BFD_RELOC_MIPS_INSERT_B -@deffnx {} BFD_RELOC_MIPS_DELETE -@deffnx {} BFD_RELOC_MIPS_HIGHEST -@deffnx {} BFD_RELOC_MIPS_HIGHER -@deffnx {} BFD_RELOC_MIPS_SCN_DISP -@deffnx {} BFD_RELOC_MIPS_REL16 -@deffnx {} BFD_RELOC_MIPS_RELGOT -@deffnx {} BFD_RELOC_MIPS_JALR -@deffnx {} BFD_RELOC_MIPS_TLS_DTPMOD32 -@deffnx {} BFD_RELOC_MIPS_TLS_DTPREL32 -@deffnx {} BFD_RELOC_MIPS_TLS_DTPMOD64 -@deffnx {} BFD_RELOC_MIPS_TLS_DTPREL64 -@deffnx {} BFD_RELOC_MIPS_TLS_GD -@deffnx {} BFD_RELOC_MIPS_TLS_LDM -@deffnx {} BFD_RELOC_MIPS_TLS_DTPREL_HI16 -@deffnx {} BFD_RELOC_MIPS_TLS_DTPREL_LO16 -@deffnx {} BFD_RELOC_MIPS_TLS_GOTTPREL -@deffnx {} BFD_RELOC_MIPS_TLS_TPREL32 -@deffnx {} BFD_RELOC_MIPS_TLS_TPREL64 -@deffnx {} BFD_RELOC_MIPS_TLS_TPREL_HI16 -@deffnx {} BFD_RELOC_MIPS_TLS_TPREL_LO16 -MIPS ELF relocations. -@end deffn -@deffn {} BFD_RELOC_MIPS_COPY -@deffnx {} BFD_RELOC_MIPS_JUMP_SLOT -MIPS ELF relocations (VxWorks extensions). -@end deffn -@deffn {} BFD_RELOC_FRV_LABEL16 -@deffnx {} BFD_RELOC_FRV_LABEL24 -@deffnx {} BFD_RELOC_FRV_LO16 -@deffnx {} BFD_RELOC_FRV_HI16 -@deffnx {} BFD_RELOC_FRV_GPREL12 -@deffnx {} BFD_RELOC_FRV_GPRELU12 -@deffnx {} BFD_RELOC_FRV_GPREL32 -@deffnx {} BFD_RELOC_FRV_GPRELHI -@deffnx {} BFD_RELOC_FRV_GPRELLO -@deffnx {} BFD_RELOC_FRV_GOT12 -@deffnx {} BFD_RELOC_FRV_GOTHI -@deffnx {} BFD_RELOC_FRV_GOTLO -@deffnx {} BFD_RELOC_FRV_FUNCDESC -@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOT12 -@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOTHI -@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOTLO -@deffnx {} BFD_RELOC_FRV_FUNCDESC_VALUE -@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOTOFF12 -@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOTOFFHI -@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOTOFFLO -@deffnx {} BFD_RELOC_FRV_GOTOFF12 -@deffnx {} BFD_RELOC_FRV_GOTOFFHI -@deffnx {} BFD_RELOC_FRV_GOTOFFLO -@deffnx {} BFD_RELOC_FRV_GETTLSOFF -@deffnx {} BFD_RELOC_FRV_TLSDESC_VALUE -@deffnx {} BFD_RELOC_FRV_GOTTLSDESC12 -@deffnx {} BFD_RELOC_FRV_GOTTLSDESCHI -@deffnx {} BFD_RELOC_FRV_GOTTLSDESCLO -@deffnx {} BFD_RELOC_FRV_TLSMOFF12 -@deffnx {} BFD_RELOC_FRV_TLSMOFFHI -@deffnx {} BFD_RELOC_FRV_TLSMOFFLO -@deffnx {} BFD_RELOC_FRV_GOTTLSOFF12 -@deffnx {} BFD_RELOC_FRV_GOTTLSOFFHI -@deffnx {} BFD_RELOC_FRV_GOTTLSOFFLO -@deffnx {} BFD_RELOC_FRV_TLSOFF -@deffnx {} BFD_RELOC_FRV_TLSDESC_RELAX -@deffnx {} BFD_RELOC_FRV_GETTLSOFF_RELAX -@deffnx {} BFD_RELOC_FRV_TLSOFF_RELAX -@deffnx {} BFD_RELOC_FRV_TLSMOFF -Fujitsu Frv Relocations. -@end deffn -@deffn {} BFD_RELOC_MN10300_GOTOFF24 -This is a 24bit GOT-relative reloc for the mn10300. -@end deffn -@deffn {} BFD_RELOC_MN10300_GOT32 -This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes -in the instruction. -@end deffn -@deffn {} BFD_RELOC_MN10300_GOT24 -This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes -in the instruction. -@end deffn -@deffn {} BFD_RELOC_MN10300_GOT16 -This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes -in the instruction. -@end deffn -@deffn {} BFD_RELOC_MN10300_COPY -Copy symbol at runtime. -@end deffn -@deffn {} BFD_RELOC_MN10300_GLOB_DAT -Create GOT entry. -@end deffn -@deffn {} BFD_RELOC_MN10300_JMP_SLOT -Create PLT entry. -@end deffn -@deffn {} BFD_RELOC_MN10300_RELATIVE -Adjust by program base. -@end deffn -@deffn {} BFD_RELOC_386_GOT32 -@deffnx {} BFD_RELOC_386_PLT32 -@deffnx {} BFD_RELOC_386_COPY -@deffnx {} BFD_RELOC_386_GLOB_DAT -@deffnx {} BFD_RELOC_386_JUMP_SLOT -@deffnx {} BFD_RELOC_386_RELATIVE -@deffnx {} BFD_RELOC_386_GOTOFF -@deffnx {} BFD_RELOC_386_GOTPC -@deffnx {} BFD_RELOC_386_TLS_TPOFF -@deffnx {} BFD_RELOC_386_TLS_IE -@deffnx {} BFD_RELOC_386_TLS_GOTIE -@deffnx {} BFD_RELOC_386_TLS_LE -@deffnx {} BFD_RELOC_386_TLS_GD -@deffnx {} BFD_RELOC_386_TLS_LDM -@deffnx {} BFD_RELOC_386_TLS_LDO_32 -@deffnx {} BFD_RELOC_386_TLS_IE_32 -@deffnx {} BFD_RELOC_386_TLS_LE_32 -@deffnx {} BFD_RELOC_386_TLS_DTPMOD32 -@deffnx {} BFD_RELOC_386_TLS_DTPOFF32 -@deffnx {} BFD_RELOC_386_TLS_TPOFF32 -@deffnx {} BFD_RELOC_386_TLS_GOTDESC -@deffnx {} BFD_RELOC_386_TLS_DESC_CALL -@deffnx {} BFD_RELOC_386_TLS_DESC -i386/elf relocations -@end deffn -@deffn {} BFD_RELOC_X86_64_GOT32 -@deffnx {} BFD_RELOC_X86_64_PLT32 -@deffnx {} BFD_RELOC_X86_64_COPY -@deffnx {} BFD_RELOC_X86_64_GLOB_DAT -@deffnx {} BFD_RELOC_X86_64_JUMP_SLOT -@deffnx {} BFD_RELOC_X86_64_RELATIVE -@deffnx {} BFD_RELOC_X86_64_GOTPCREL -@deffnx {} BFD_RELOC_X86_64_32S -@deffnx {} BFD_RELOC_X86_64_DTPMOD64 -@deffnx {} BFD_RELOC_X86_64_DTPOFF64 -@deffnx {} BFD_RELOC_X86_64_TPOFF64 -@deffnx {} BFD_RELOC_X86_64_TLSGD -@deffnx {} BFD_RELOC_X86_64_TLSLD -@deffnx {} BFD_RELOC_X86_64_DTPOFF32 -@deffnx {} BFD_RELOC_X86_64_GOTTPOFF -@deffnx {} BFD_RELOC_X86_64_TPOFF32 -@deffnx {} BFD_RELOC_X86_64_GOTOFF64 -@deffnx {} BFD_RELOC_X86_64_GOTPC32 -@deffnx {} BFD_RELOC_X86_64_GOT64 -@deffnx {} BFD_RELOC_X86_64_GOTPCREL64 -@deffnx {} BFD_RELOC_X86_64_GOTPC64 -@deffnx {} BFD_RELOC_X86_64_GOTPLT64 -@deffnx {} BFD_RELOC_X86_64_PLTOFF64 -@deffnx {} BFD_RELOC_X86_64_GOTPC32_TLSDESC -@deffnx {} BFD_RELOC_X86_64_TLSDESC_CALL -@deffnx {} BFD_RELOC_X86_64_TLSDESC -x86-64/elf relocations -@end deffn -@deffn {} BFD_RELOC_NS32K_IMM_8 -@deffnx {} BFD_RELOC_NS32K_IMM_16 -@deffnx {} BFD_RELOC_NS32K_IMM_32 -@deffnx {} BFD_RELOC_NS32K_IMM_8_PCREL -@deffnx {} BFD_RELOC_NS32K_IMM_16_PCREL -@deffnx {} BFD_RELOC_NS32K_IMM_32_PCREL -@deffnx {} BFD_RELOC_NS32K_DISP_8 -@deffnx {} BFD_RELOC_NS32K_DISP_16 -@deffnx {} BFD_RELOC_NS32K_DISP_32 -@deffnx {} BFD_RELOC_NS32K_DISP_8_PCREL -@deffnx {} BFD_RELOC_NS32K_DISP_16_PCREL -@deffnx {} BFD_RELOC_NS32K_DISP_32_PCREL -ns32k relocations -@end deffn -@deffn {} BFD_RELOC_PDP11_DISP_8_PCREL -@deffnx {} BFD_RELOC_PDP11_DISP_6_PCREL -PDP11 relocations -@end deffn -@deffn {} BFD_RELOC_PJ_CODE_HI16 -@deffnx {} BFD_RELOC_PJ_CODE_LO16 -@deffnx {} BFD_RELOC_PJ_CODE_DIR16 -@deffnx {} BFD_RELOC_PJ_CODE_DIR32 -@deffnx {} BFD_RELOC_PJ_CODE_REL16 -@deffnx {} BFD_RELOC_PJ_CODE_REL32 -Picojava relocs. Not all of these appear in object files. -@end deffn -@deffn {} BFD_RELOC_PPC_B26 -@deffnx {} BFD_RELOC_PPC_BA26 -@deffnx {} BFD_RELOC_PPC_TOC16 -@deffnx {} BFD_RELOC_PPC_B16 -@deffnx {} BFD_RELOC_PPC_B16_BRTAKEN -@deffnx {} BFD_RELOC_PPC_B16_BRNTAKEN -@deffnx {} BFD_RELOC_PPC_BA16 -@deffnx {} BFD_RELOC_PPC_BA16_BRTAKEN -@deffnx {} BFD_RELOC_PPC_BA16_BRNTAKEN -@deffnx {} BFD_RELOC_PPC_COPY -@deffnx {} BFD_RELOC_PPC_GLOB_DAT -@deffnx {} BFD_RELOC_PPC_JMP_SLOT -@deffnx {} BFD_RELOC_PPC_RELATIVE -@deffnx {} BFD_RELOC_PPC_LOCAL24PC -@deffnx {} BFD_RELOC_PPC_EMB_NADDR32 -@deffnx {} BFD_RELOC_PPC_EMB_NADDR16 -@deffnx {} BFD_RELOC_PPC_EMB_NADDR16_LO -@deffnx {} BFD_RELOC_PPC_EMB_NADDR16_HI -@deffnx {} BFD_RELOC_PPC_EMB_NADDR16_HA -@deffnx {} BFD_RELOC_PPC_EMB_SDAI16 -@deffnx {} BFD_RELOC_PPC_EMB_SDA2I16 -@deffnx {} BFD_RELOC_PPC_EMB_SDA2REL -@deffnx {} BFD_RELOC_PPC_EMB_SDA21 -@deffnx {} BFD_RELOC_PPC_EMB_MRKREF -@deffnx {} BFD_RELOC_PPC_EMB_RELSEC16 -@deffnx {} BFD_RELOC_PPC_EMB_RELST_LO -@deffnx {} BFD_RELOC_PPC_EMB_RELST_HI -@deffnx {} BFD_RELOC_PPC_EMB_RELST_HA -@deffnx {} BFD_RELOC_PPC_EMB_BIT_FLD -@deffnx {} BFD_RELOC_PPC_EMB_RELSDA -@deffnx {} BFD_RELOC_PPC64_HIGHER -@deffnx {} BFD_RELOC_PPC64_HIGHER_S -@deffnx {} BFD_RELOC_PPC64_HIGHEST -@deffnx {} BFD_RELOC_PPC64_HIGHEST_S -@deffnx {} BFD_RELOC_PPC64_TOC16_LO -@deffnx {} BFD_RELOC_PPC64_TOC16_HI -@deffnx {} BFD_RELOC_PPC64_TOC16_HA -@deffnx {} BFD_RELOC_PPC64_TOC -@deffnx {} BFD_RELOC_PPC64_PLTGOT16 -@deffnx {} BFD_RELOC_PPC64_PLTGOT16_LO -@deffnx {} BFD_RELOC_PPC64_PLTGOT16_HI -@deffnx {} BFD_RELOC_PPC64_PLTGOT16_HA -@deffnx {} BFD_RELOC_PPC64_ADDR16_DS -@deffnx {} BFD_RELOC_PPC64_ADDR16_LO_DS -@deffnx {} BFD_RELOC_PPC64_GOT16_DS -@deffnx {} BFD_RELOC_PPC64_GOT16_LO_DS -@deffnx {} BFD_RELOC_PPC64_PLT16_LO_DS -@deffnx {} BFD_RELOC_PPC64_SECTOFF_DS -@deffnx {} BFD_RELOC_PPC64_SECTOFF_LO_DS -@deffnx {} BFD_RELOC_PPC64_TOC16_DS -@deffnx {} BFD_RELOC_PPC64_TOC16_LO_DS -@deffnx {} BFD_RELOC_PPC64_PLTGOT16_DS -@deffnx {} BFD_RELOC_PPC64_PLTGOT16_LO_DS -Power(rs6000) and PowerPC relocations. -@end deffn -@deffn {} BFD_RELOC_PPC_TLS -@deffnx {} BFD_RELOC_PPC_DTPMOD -@deffnx {} BFD_RELOC_PPC_TPREL16 -@deffnx {} BFD_RELOC_PPC_TPREL16_LO -@deffnx {} BFD_RELOC_PPC_TPREL16_HI -@deffnx {} BFD_RELOC_PPC_TPREL16_HA -@deffnx {} BFD_RELOC_PPC_TPREL -@deffnx {} BFD_RELOC_PPC_DTPREL16 -@deffnx {} BFD_RELOC_PPC_DTPREL16_LO -@deffnx {} BFD_RELOC_PPC_DTPREL16_HI -@deffnx {} BFD_RELOC_PPC_DTPREL16_HA -@deffnx {} BFD_RELOC_PPC_DTPREL -@deffnx {} BFD_RELOC_PPC_GOT_TLSGD16 -@deffnx {} BFD_RELOC_PPC_GOT_TLSGD16_LO -@deffnx {} BFD_RELOC_PPC_GOT_TLSGD16_HI -@deffnx {} BFD_RELOC_PPC_GOT_TLSGD16_HA -@deffnx {} BFD_RELOC_PPC_GOT_TLSLD16 -@deffnx {} BFD_RELOC_PPC_GOT_TLSLD16_LO -@deffnx {} BFD_RELOC_PPC_GOT_TLSLD16_HI -@deffnx {} BFD_RELOC_PPC_GOT_TLSLD16_HA -@deffnx {} BFD_RELOC_PPC_GOT_TPREL16 -@deffnx {} BFD_RELOC_PPC_GOT_TPREL16_LO -@deffnx {} BFD_RELOC_PPC_GOT_TPREL16_HI -@deffnx {} BFD_RELOC_PPC_GOT_TPREL16_HA -@deffnx {} BFD_RELOC_PPC_GOT_DTPREL16 -@deffnx {} BFD_RELOC_PPC_GOT_DTPREL16_LO -@deffnx {} BFD_RELOC_PPC_GOT_DTPREL16_HI -@deffnx {} BFD_RELOC_PPC_GOT_DTPREL16_HA -@deffnx {} BFD_RELOC_PPC64_TPREL16_DS -@deffnx {} BFD_RELOC_PPC64_TPREL16_LO_DS -@deffnx {} BFD_RELOC_PPC64_TPREL16_HIGHER -@deffnx {} BFD_RELOC_PPC64_TPREL16_HIGHERA -@deffnx {} BFD_RELOC_PPC64_TPREL16_HIGHEST -@deffnx {} BFD_RELOC_PPC64_TPREL16_HIGHESTA -@deffnx {} BFD_RELOC_PPC64_DTPREL16_DS -@deffnx {} BFD_RELOC_PPC64_DTPREL16_LO_DS -@deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGHER -@deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGHERA -@deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGHEST -@deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGHESTA -PowerPC and PowerPC64 thread-local storage relocations. -@end deffn -@deffn {} BFD_RELOC_I370_D12 -IBM 370/390 relocations -@end deffn -@deffn {} BFD_RELOC_CTOR -The type of reloc used to build a constructor table - at the moment -probably a 32 bit wide absolute relocation, but the target can choose. -It generally does map to one of the other relocation types. -@end deffn -@deffn {} BFD_RELOC_ARM_PCREL_BRANCH -ARM 26 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. -@end deffn -@deffn {} BFD_RELOC_ARM_PCREL_BLX -ARM 26 bit pc-relative branch. The lowest bit must be zero and is -not stored in the instruction. The 2nd lowest bit comes from a 1 bit -field in the instruction. -@end deffn -@deffn {} BFD_RELOC_THUMB_PCREL_BLX -Thumb 22 bit pc-relative branch. The lowest bit must be zero and is -not stored in the instruction. The 2nd lowest bit comes from a 1 bit -field in the instruction. -@end deffn -@deffn {} BFD_RELOC_ARM_PCREL_CALL -ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction. -@end deffn -@deffn {} BFD_RELOC_ARM_PCREL_JUMP -ARM 26-bit pc-relative branch for B or conditional BL instruction. -@end deffn -@deffn {} BFD_RELOC_THUMB_PCREL_BRANCH7 -@deffnx {} BFD_RELOC_THUMB_PCREL_BRANCH9 -@deffnx {} BFD_RELOC_THUMB_PCREL_BRANCH12 -@deffnx {} BFD_RELOC_THUMB_PCREL_BRANCH20 -@deffnx {} BFD_RELOC_THUMB_PCREL_BRANCH23 -@deffnx {} BFD_RELOC_THUMB_PCREL_BRANCH25 -Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. -The lowest bit must be zero and is not stored in the instruction. -Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an -"nn" one smaller in all cases. Note further that BRANCH23 -corresponds to R_ARM_THM_CALL. -@end deffn -@deffn {} BFD_RELOC_ARM_OFFSET_IMM -12-bit immediate offset, used in ARM-format ldr and str instructions. -@end deffn -@deffn {} BFD_RELOC_ARM_THUMB_OFFSET -5-bit immediate offset, used in Thumb-format ldr and str instructions. -@end deffn -@deffn {} BFD_RELOC_ARM_TARGET1 -Pc-relative or absolute relocation depending on target. Used for -entries in .init_array sections. -@end deffn -@deffn {} BFD_RELOC_ARM_ROSEGREL32 -Read-only segment base relative address. -@end deffn -@deffn {} BFD_RELOC_ARM_SBREL32 -Data segment base relative address. -@end deffn -@deffn {} BFD_RELOC_ARM_TARGET2 -This reloc is used for references to RTTI data from exception handling -tables. The actual definition depends on the target. It may be a -pc-relative or some form of GOT-indirect relocation. -@end deffn -@deffn {} BFD_RELOC_ARM_PREL31 -31-bit PC relative address. -@end deffn -@deffn {} BFD_RELOC_ARM_JUMP_SLOT -@deffnx {} BFD_RELOC_ARM_GLOB_DAT -@deffnx {} BFD_RELOC_ARM_GOT32 -@deffnx {} BFD_RELOC_ARM_PLT32 -@deffnx {} BFD_RELOC_ARM_RELATIVE -@deffnx {} BFD_RELOC_ARM_GOTOFF -@deffnx {} BFD_RELOC_ARM_GOTPC -Relocations for setting up GOTs and PLTs for shared libraries. -@end deffn -@deffn {} BFD_RELOC_ARM_TLS_GD32 -@deffnx {} BFD_RELOC_ARM_TLS_LDO32 -@deffnx {} BFD_RELOC_ARM_TLS_LDM32 -@deffnx {} BFD_RELOC_ARM_TLS_DTPOFF32 -@deffnx {} BFD_RELOC_ARM_TLS_DTPMOD32 -@deffnx {} BFD_RELOC_ARM_TLS_TPOFF32 -@deffnx {} BFD_RELOC_ARM_TLS_IE32 -@deffnx {} BFD_RELOC_ARM_TLS_LE32 -ARM thread-local storage relocations. -@end deffn -@deffn {} BFD_RELOC_ARM_IMMEDIATE -@deffnx {} BFD_RELOC_ARM_ADRL_IMMEDIATE -@deffnx {} BFD_RELOC_ARM_T32_IMMEDIATE -@deffnx {} BFD_RELOC_ARM_T32_IMM12 -@deffnx {} BFD_RELOC_ARM_T32_ADD_PC12 -@deffnx {} BFD_RELOC_ARM_SHIFT_IMM -@deffnx {} BFD_RELOC_ARM_SMC -@deffnx {} BFD_RELOC_ARM_SWI -@deffnx {} BFD_RELOC_ARM_MULTI -@deffnx {} BFD_RELOC_ARM_CP_OFF_IMM -@deffnx {} BFD_RELOC_ARM_CP_OFF_IMM_S2 -@deffnx {} BFD_RELOC_ARM_T32_CP_OFF_IMM -@deffnx {} BFD_RELOC_ARM_T32_CP_OFF_IMM_S2 -@deffnx {} BFD_RELOC_ARM_ADR_IMM -@deffnx {} BFD_RELOC_ARM_LDR_IMM -@deffnx {} BFD_RELOC_ARM_LITERAL -@deffnx {} BFD_RELOC_ARM_IN_POOL -@deffnx {} BFD_RELOC_ARM_OFFSET_IMM8 -@deffnx {} BFD_RELOC_ARM_T32_OFFSET_U8 -@deffnx {} BFD_RELOC_ARM_T32_OFFSET_IMM -@deffnx {} BFD_RELOC_ARM_HWLITERAL -@deffnx {} BFD_RELOC_ARM_THUMB_ADD -@deffnx {} BFD_RELOC_ARM_THUMB_IMM -@deffnx {} BFD_RELOC_ARM_THUMB_SHIFT -These relocs are only used within the ARM assembler. They are not -(at present) written to any object files. -@end deffn -@deffn {} BFD_RELOC_SH_PCDISP8BY2 -@deffnx {} BFD_RELOC_SH_PCDISP12BY2 -@deffnx {} BFD_RELOC_SH_IMM3 -@deffnx {} BFD_RELOC_SH_IMM3U -@deffnx {} BFD_RELOC_SH_DISP12 -@deffnx {} BFD_RELOC_SH_DISP12BY2 -@deffnx {} BFD_RELOC_SH_DISP12BY4 -@deffnx {} BFD_RELOC_SH_DISP12BY8 -@deffnx {} BFD_RELOC_SH_DISP20 -@deffnx {} BFD_RELOC_SH_DISP20BY8 -@deffnx {} BFD_RELOC_SH_IMM4 -@deffnx {} BFD_RELOC_SH_IMM4BY2 -@deffnx {} BFD_RELOC_SH_IMM4BY4 -@deffnx {} BFD_RELOC_SH_IMM8 -@deffnx {} BFD_RELOC_SH_IMM8BY2 -@deffnx {} BFD_RELOC_SH_IMM8BY4 -@deffnx {} BFD_RELOC_SH_PCRELIMM8BY2 -@deffnx {} BFD_RELOC_SH_PCRELIMM8BY4 -@deffnx {} BFD_RELOC_SH_SWITCH16 -@deffnx {} BFD_RELOC_SH_SWITCH32 -@deffnx {} BFD_RELOC_SH_USES -@deffnx {} BFD_RELOC_SH_COUNT -@deffnx {} BFD_RELOC_SH_ALIGN -@deffnx {} BFD_RELOC_SH_CODE -@deffnx {} BFD_RELOC_SH_DATA -@deffnx {} BFD_RELOC_SH_LABEL -@deffnx {} BFD_RELOC_SH_LOOP_START -@deffnx {} BFD_RELOC_SH_LOOP_END -@deffnx {} BFD_RELOC_SH_COPY -@deffnx {} BFD_RELOC_SH_GLOB_DAT -@deffnx {} BFD_RELOC_SH_JMP_SLOT -@deffnx {} BFD_RELOC_SH_RELATIVE -@deffnx {} BFD_RELOC_SH_GOTPC -@deffnx {} BFD_RELOC_SH_GOT_LOW16 -@deffnx {} BFD_RELOC_SH_GOT_MEDLOW16 -@deffnx {} BFD_RELOC_SH_GOT_MEDHI16 -@deffnx {} BFD_RELOC_SH_GOT_HI16 -@deffnx {} BFD_RELOC_SH_GOTPLT_LOW16 -@deffnx {} BFD_RELOC_SH_GOTPLT_MEDLOW16 -@deffnx {} BFD_RELOC_SH_GOTPLT_MEDHI16 -@deffnx {} BFD_RELOC_SH_GOTPLT_HI16 -@deffnx {} BFD_RELOC_SH_PLT_LOW16 -@deffnx {} BFD_RELOC_SH_PLT_MEDLOW16 -@deffnx {} BFD_RELOC_SH_PLT_MEDHI16 -@deffnx {} BFD_RELOC_SH_PLT_HI16 -@deffnx {} BFD_RELOC_SH_GOTOFF_LOW16 -@deffnx {} BFD_RELOC_SH_GOTOFF_MEDLOW16 -@deffnx {} BFD_RELOC_SH_GOTOFF_MEDHI16 -@deffnx {} BFD_RELOC_SH_GOTOFF_HI16 -@deffnx {} BFD_RELOC_SH_GOTPC_LOW16 -@deffnx {} BFD_RELOC_SH_GOTPC_MEDLOW16 -@deffnx {} BFD_RELOC_SH_GOTPC_MEDHI16 -@deffnx {} BFD_RELOC_SH_GOTPC_HI16 -@deffnx {} BFD_RELOC_SH_COPY64 -@deffnx {} BFD_RELOC_SH_GLOB_DAT64 -@deffnx {} BFD_RELOC_SH_JMP_SLOT64 -@deffnx {} BFD_RELOC_SH_RELATIVE64 -@deffnx {} BFD_RELOC_SH_GOT10BY4 -@deffnx {} BFD_RELOC_SH_GOT10BY8 -@deffnx {} BFD_RELOC_SH_GOTPLT10BY4 -@deffnx {} BFD_RELOC_SH_GOTPLT10BY8 -@deffnx {} BFD_RELOC_SH_GOTPLT32 -@deffnx {} BFD_RELOC_SH_SHMEDIA_CODE -@deffnx {} BFD_RELOC_SH_IMMU5 -@deffnx {} BFD_RELOC_SH_IMMS6 -@deffnx {} BFD_RELOC_SH_IMMS6BY32 -@deffnx {} BFD_RELOC_SH_IMMU6 -@deffnx {} BFD_RELOC_SH_IMMS10 -@deffnx {} BFD_RELOC_SH_IMMS10BY2 -@deffnx {} BFD_RELOC_SH_IMMS10BY4 -@deffnx {} BFD_RELOC_SH_IMMS10BY8 -@deffnx {} BFD_RELOC_SH_IMMS16 -@deffnx {} BFD_RELOC_SH_IMMU16 -@deffnx {} BFD_RELOC_SH_IMM_LOW16 -@deffnx {} BFD_RELOC_SH_IMM_LOW16_PCREL -@deffnx {} BFD_RELOC_SH_IMM_MEDLOW16 -@deffnx {} BFD_RELOC_SH_IMM_MEDLOW16_PCREL -@deffnx {} BFD_RELOC_SH_IMM_MEDHI16 -@deffnx {} BFD_RELOC_SH_IMM_MEDHI16_PCREL -@deffnx {} BFD_RELOC_SH_IMM_HI16 -@deffnx {} BFD_RELOC_SH_IMM_HI16_PCREL -@deffnx {} BFD_RELOC_SH_PT_16 -@deffnx {} BFD_RELOC_SH_TLS_GD_32 -@deffnx {} BFD_RELOC_SH_TLS_LD_32 -@deffnx {} BFD_RELOC_SH_TLS_LDO_32 -@deffnx {} BFD_RELOC_SH_TLS_IE_32 -@deffnx {} BFD_RELOC_SH_TLS_LE_32 -@deffnx {} BFD_RELOC_SH_TLS_DTPMOD32 -@deffnx {} BFD_RELOC_SH_TLS_DTPOFF32 -@deffnx {} BFD_RELOC_SH_TLS_TPOFF32 -Renesas / SuperH SH relocs. Not all of these appear in object files. -@end deffn -@deffn {} BFD_RELOC_ARC_B22_PCREL -ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. -@end deffn -@deffn {} BFD_RELOC_ARC_B26 -ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. -@end deffn -@deffn {} BFD_RELOC_BFIN_16_IMM -ADI Blackfin 16 bit immediate absolute reloc. -@end deffn -@deffn {} BFD_RELOC_BFIN_16_HIGH -ADI Blackfin 16 bit immediate absolute reloc higher 16 bits. -@end deffn -@deffn {} BFD_RELOC_BFIN_4_PCREL -ADI Blackfin 'a' part of LSETUP. -@end deffn -@deffn {} BFD_RELOC_BFIN_5_PCREL -ADI Blackfin. -@end deffn -@deffn {} BFD_RELOC_BFIN_16_LOW -ADI Blackfin 16 bit immediate absolute reloc lower 16 bits. -@end deffn -@deffn {} BFD_RELOC_BFIN_10_PCREL -ADI Blackfin. -@end deffn -@deffn {} BFD_RELOC_BFIN_11_PCREL -ADI Blackfin 'b' part of LSETUP. -@end deffn -@deffn {} BFD_RELOC_BFIN_12_PCREL_JUMP -ADI Blackfin. -@end deffn -@deffn {} BFD_RELOC_BFIN_12_PCREL_JUMP_S -ADI Blackfin Short jump, pcrel. -@end deffn -@deffn {} BFD_RELOC_BFIN_24_PCREL_CALL_X -ADI Blackfin Call.x not implemented. -@end deffn -@deffn {} BFD_RELOC_BFIN_24_PCREL_JUMP_L -ADI Blackfin Long Jump pcrel. -@end deffn -@deffn {} BFD_RELOC_BFIN_GOT17M4 -@deffnx {} BFD_RELOC_BFIN_GOTHI -@deffnx {} BFD_RELOC_BFIN_GOTLO -@deffnx {} BFD_RELOC_BFIN_FUNCDESC -@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOT17M4 -@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOTHI -@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOTLO -@deffnx {} BFD_RELOC_BFIN_FUNCDESC_VALUE -@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4 -@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI -@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO -@deffnx {} BFD_RELOC_BFIN_GOTOFF17M4 -@deffnx {} BFD_RELOC_BFIN_GOTOFFHI -@deffnx {} BFD_RELOC_BFIN_GOTOFFLO -ADI Blackfin FD-PIC relocations. -@end deffn -@deffn {} BFD_RELOC_BFIN_GOT -ADI Blackfin GOT relocation. -@end deffn -@deffn {} BFD_RELOC_BFIN_PLTPC -ADI Blackfin PLTPC relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_PUSH -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_CONST -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_ADD -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_SUB -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_MULT -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_DIV -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_MOD -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_LSHIFT -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_RSHIFT -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_AND -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_OR -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_XOR -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_LAND -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_LOR -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_LEN -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_NEG -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_COMP -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_PAGE -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_HWPAGE -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_ADDR -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_RELOC_D10V_10_PCREL_R -Mitsubishi D10V relocs. -This is a 10-bit reloc with the right 2 bits -assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D10V_10_PCREL_L -Mitsubishi D10V relocs. -This is a 10-bit reloc with the right 2 bits -assumed to be 0. This is the same as the previous reloc -except it is in the left container, i.e., -shifted left 15 bits. -@end deffn -@deffn {} BFD_RELOC_D10V_18 -This is an 18-bit reloc with the right 2 bits -assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D10V_18_PCREL -This is an 18-bit reloc with the right 2 bits -assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D30V_6 -Mitsubishi D30V relocs. -This is a 6-bit absolute reloc. -@end deffn -@deffn {} BFD_RELOC_D30V_9_PCREL -This is a 6-bit pc-relative reloc with -the right 3 bits assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D30V_9_PCREL_R -This is a 6-bit pc-relative reloc with -the right 3 bits assumed to be 0. Same -as the previous reloc but on the right side -of the container. -@end deffn -@deffn {} BFD_RELOC_D30V_15 -This is a 12-bit absolute reloc with the -right 3 bitsassumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D30V_15_PCREL -This is a 12-bit pc-relative reloc with -the right 3 bits assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D30V_15_PCREL_R -This is a 12-bit pc-relative reloc with -the right 3 bits assumed to be 0. Same -as the previous reloc but on the right side -of the container. -@end deffn -@deffn {} BFD_RELOC_D30V_21 -This is an 18-bit absolute reloc with -the right 3 bits assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D30V_21_PCREL -This is an 18-bit pc-relative reloc with -the right 3 bits assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D30V_21_PCREL_R -This is an 18-bit pc-relative reloc with -the right 3 bits assumed to be 0. Same -as the previous reloc but on the right side -of the container. -@end deffn -@deffn {} BFD_RELOC_D30V_32 -This is a 32-bit absolute reloc. -@end deffn -@deffn {} BFD_RELOC_D30V_32_PCREL -This is a 32-bit pc-relative reloc. -@end deffn -@deffn {} BFD_RELOC_DLX_HI16_S -DLX relocs -@end deffn -@deffn {} BFD_RELOC_DLX_LO16 -DLX relocs -@end deffn -@deffn {} BFD_RELOC_DLX_JMP26 -DLX relocs -@end deffn -@deffn {} BFD_RELOC_M32C_HI8 -@deffnx {} BFD_RELOC_M32C_RL_JUMP -@deffnx {} BFD_RELOC_M32C_RL_1ADDR -@deffnx {} BFD_RELOC_M32C_RL_2ADDR -Renesas M16C/M32C Relocations. -@end deffn -@deffn {} BFD_RELOC_M32R_24 -Renesas M32R (formerly Mitsubishi M32R) relocs. -This is a 24 bit absolute address. -@end deffn -@deffn {} BFD_RELOC_M32R_10_PCREL -This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_M32R_18_PCREL -This is an 18-bit reloc with the right 2 bits assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_M32R_26_PCREL -This is a 26-bit reloc with the right 2 bits assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_M32R_HI16_ULO -This is a 16-bit reloc containing the high 16 bits of an address -used when the lower 16 bits are treated as unsigned. -@end deffn -@deffn {} BFD_RELOC_M32R_HI16_SLO -This is a 16-bit reloc containing the high 16 bits of an address -used when the lower 16 bits are treated as signed. -@end deffn -@deffn {} BFD_RELOC_M32R_LO16 -This is a 16-bit reloc containing the lower 16 bits of an address. -@end deffn -@deffn {} BFD_RELOC_M32R_SDA16 -This is a 16-bit reloc containing the small data area offset for use in -add3, load, and store instructions. -@end deffn -@deffn {} BFD_RELOC_M32R_GOT24 -@deffnx {} BFD_RELOC_M32R_26_PLTREL -@deffnx {} BFD_RELOC_M32R_COPY -@deffnx {} BFD_RELOC_M32R_GLOB_DAT -@deffnx {} BFD_RELOC_M32R_JMP_SLOT -@deffnx {} BFD_RELOC_M32R_RELATIVE -@deffnx {} BFD_RELOC_M32R_GOTOFF -@deffnx {} BFD_RELOC_M32R_GOTOFF_HI_ULO -@deffnx {} BFD_RELOC_M32R_GOTOFF_HI_SLO -@deffnx {} BFD_RELOC_M32R_GOTOFF_LO -@deffnx {} BFD_RELOC_M32R_GOTPC24 -@deffnx {} BFD_RELOC_M32R_GOT16_HI_ULO -@deffnx {} BFD_RELOC_M32R_GOT16_HI_SLO -@deffnx {} BFD_RELOC_M32R_GOT16_LO -@deffnx {} BFD_RELOC_M32R_GOTPC_HI_ULO -@deffnx {} BFD_RELOC_M32R_GOTPC_HI_SLO -@deffnx {} BFD_RELOC_M32R_GOTPC_LO -For PIC. -@end deffn -@deffn {} BFD_RELOC_V850_9_PCREL -This is a 9-bit reloc -@end deffn -@deffn {} BFD_RELOC_V850_22_PCREL -This is a 22-bit reloc -@end deffn -@deffn {} BFD_RELOC_V850_SDA_16_16_OFFSET -This is a 16 bit offset from the short data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_SDA_15_16_OFFSET -This is a 16 bit offset (of which only 15 bits are used) from the -short data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_ZDA_16_16_OFFSET -This is a 16 bit offset from the zero data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_ZDA_15_16_OFFSET -This is a 16 bit offset (of which only 15 bits are used) from the -zero data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_TDA_6_8_OFFSET -This is an 8 bit offset (of which only 6 bits are used) from the -tiny data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_TDA_7_8_OFFSET -This is an 8bit offset (of which only 7 bits are used) from the tiny -data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_TDA_7_7_OFFSET -This is a 7 bit offset from the tiny data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_TDA_16_16_OFFSET -This is a 16 bit offset from the tiny data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_TDA_4_5_OFFSET -This is a 5 bit offset (of which only 4 bits are used) from the tiny -data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_TDA_4_4_OFFSET -This is a 4 bit offset from the tiny data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET -This is a 16 bit offset from the short data area pointer, with the -bits placed non-contiguously in the instruction. -@end deffn -@deffn {} BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET -This is a 16 bit offset from the zero data area pointer, with the -bits placed non-contiguously in the instruction. -@end deffn -@deffn {} BFD_RELOC_V850_CALLT_6_7_OFFSET -This is a 6 bit offset from the call table base pointer. -@end deffn -@deffn {} BFD_RELOC_V850_CALLT_16_16_OFFSET -This is a 16 bit offset from the call table base pointer. -@end deffn -@deffn {} BFD_RELOC_V850_LONGCALL -Used for relaxing indirect function calls. -@end deffn -@deffn {} BFD_RELOC_V850_LONGJUMP -Used for relaxing indirect jumps. -@end deffn -@deffn {} BFD_RELOC_V850_ALIGN -Used to maintain alignment whilst relaxing. -@end deffn -@deffn {} BFD_RELOC_V850_LO16_SPLIT_OFFSET -This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu -instructions. -@end deffn -@deffn {} BFD_RELOC_MN10300_32_PCREL -This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the -instruction. -@end deffn -@deffn {} BFD_RELOC_MN10300_16_PCREL -This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the -instruction. -@end deffn -@deffn {} BFD_RELOC_TIC30_LDP -This is a 8bit DP reloc for the tms320c30, where the most -significant 8 bits of a 24 bit word are placed into the least -significant 8 bits of the opcode. -@end deffn -@deffn {} BFD_RELOC_TIC54X_PARTLS7 -This is a 7bit reloc for the tms320c54x, where the least -significant 7 bits of a 16 bit word are placed into the least -significant 7 bits of the opcode. -@end deffn -@deffn {} BFD_RELOC_TIC54X_PARTMS9 -This is a 9bit DP reloc for the tms320c54x, where the most -significant 9 bits of a 16 bit word are placed into the least -significant 9 bits of the opcode. -@end deffn -@deffn {} BFD_RELOC_TIC54X_23 -This is an extended address 23-bit reloc for the tms320c54x. -@end deffn -@deffn {} BFD_RELOC_TIC54X_16_OF_23 -This is a 16-bit reloc for the tms320c54x, where the least -significant 16 bits of a 23-bit extended address are placed into -the opcode. -@end deffn -@deffn {} BFD_RELOC_TIC54X_MS7_OF_23 -This is a reloc for the tms320c54x, where the most -significant 7 bits of a 23-bit extended address are placed into -the opcode. -@end deffn -@deffn {} BFD_RELOC_FR30_48 -This is a 48 bit reloc for the FR30 that stores 32 bits. -@end deffn -@deffn {} BFD_RELOC_FR30_20 -This is a 32 bit reloc for the FR30 that stores 20 bits split up into -two sections. -@end deffn -@deffn {} BFD_RELOC_FR30_6_IN_4 -This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in -4 bits. -@end deffn -@deffn {} BFD_RELOC_FR30_8_IN_8 -This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset -into 8 bits. -@end deffn -@deffn {} BFD_RELOC_FR30_9_IN_8 -This is a 16 bit reloc for the FR30 that stores a 9 bit short offset -into 8 bits. -@end deffn -@deffn {} BFD_RELOC_FR30_10_IN_8 -This is a 16 bit reloc for the FR30 that stores a 10 bit word offset -into 8 bits. -@end deffn -@deffn {} BFD_RELOC_FR30_9_PCREL -This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative -short offset into 8 bits. -@end deffn -@deffn {} BFD_RELOC_FR30_12_PCREL -This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative -short offset into 11 bits. -@end deffn -@deffn {} BFD_RELOC_MCORE_PCREL_IMM8BY4 -@deffnx {} BFD_RELOC_MCORE_PCREL_IMM11BY2 -@deffnx {} BFD_RELOC_MCORE_PCREL_IMM4BY2 -@deffnx {} BFD_RELOC_MCORE_PCREL_32 -@deffnx {} BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2 -@deffnx {} BFD_RELOC_MCORE_RVA -Motorola Mcore relocations. -@end deffn -@deffn {} BFD_RELOC_MMIX_GETA -@deffnx {} BFD_RELOC_MMIX_GETA_1 -@deffnx {} BFD_RELOC_MMIX_GETA_2 -@deffnx {} BFD_RELOC_MMIX_GETA_3 -These are relocations for the GETA instruction. -@end deffn -@deffn {} BFD_RELOC_MMIX_CBRANCH -@deffnx {} BFD_RELOC_MMIX_CBRANCH_J -@deffnx {} BFD_RELOC_MMIX_CBRANCH_1 -@deffnx {} BFD_RELOC_MMIX_CBRANCH_2 -@deffnx {} BFD_RELOC_MMIX_CBRANCH_3 -These are relocations for a conditional branch instruction. -@end deffn -@deffn {} BFD_RELOC_MMIX_PUSHJ -@deffnx {} BFD_RELOC_MMIX_PUSHJ_1 -@deffnx {} BFD_RELOC_MMIX_PUSHJ_2 -@deffnx {} BFD_RELOC_MMIX_PUSHJ_3 -@deffnx {} BFD_RELOC_MMIX_PUSHJ_STUBBABLE -These are relocations for the PUSHJ instruction. -@end deffn -@deffn {} BFD_RELOC_MMIX_JMP -@deffnx {} BFD_RELOC_MMIX_JMP_1 -@deffnx {} BFD_RELOC_MMIX_JMP_2 -@deffnx {} BFD_RELOC_MMIX_JMP_3 -These are relocations for the JMP instruction. -@end deffn -@deffn {} BFD_RELOC_MMIX_ADDR19 -This is a relocation for a relative address as in a GETA instruction or -a branch. -@end deffn -@deffn {} BFD_RELOC_MMIX_ADDR27 -This is a relocation for a relative address as in a JMP instruction. -@end deffn -@deffn {} BFD_RELOC_MMIX_REG_OR_BYTE -This is a relocation for an instruction field that may be a general -register or a value 0..255. -@end deffn -@deffn {} BFD_RELOC_MMIX_REG -This is a relocation for an instruction field that may be a general -register. -@end deffn -@deffn {} BFD_RELOC_MMIX_BASE_PLUS_OFFSET -This is a relocation for two instruction fields holding a register and -an offset, the equivalent of the relocation. -@end deffn -@deffn {} BFD_RELOC_MMIX_LOCAL -This relocation is an assertion that the expression is not allocated as -a global register. It does not modify contents. -@end deffn -@deffn {} BFD_RELOC_AVR_7_PCREL -This is a 16 bit reloc for the AVR that stores 8 bit pc relative -short offset into 7 bits. -@end deffn -@deffn {} BFD_RELOC_AVR_13_PCREL -This is a 16 bit reloc for the AVR that stores 13 bit pc relative -short offset into 12 bits. -@end deffn -@deffn {} BFD_RELOC_AVR_16_PM -This is a 16 bit reloc for the AVR that stores 17 bit value (usually -program memory address) into 16 bits. -@end deffn -@deffn {} BFD_RELOC_AVR_LO8_LDI -This is a 16 bit reloc for the AVR that stores 8 bit value (usually -data memory address) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HI8_LDI -This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit -of data memory address) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HH8_LDI -This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit -of program memory address) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_MS8_LDI -This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit -of 32 bit value) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_LO8_LDI_NEG -This is a 16 bit reloc for the AVR that stores negated 8 bit value -(usually data memory address) into 8 bit immediate value of SUBI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HI8_LDI_NEG -This is a 16 bit reloc for the AVR that stores negated 8 bit value -(high 8 bit of data memory address) into 8 bit immediate value of -SUBI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HH8_LDI_NEG -This is a 16 bit reloc for the AVR that stores negated 8 bit value -(most high 8 bit of program memory address) into 8 bit immediate value -of LDI or SUBI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_MS8_LDI_NEG -This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb -of 32 bit value) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_LO8_LDI_PM -This is a 16 bit reloc for the AVR that stores 8 bit value (usually -command address) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HI8_LDI_PM -This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit -of command address) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HH8_LDI_PM -This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit -of command address) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_LO8_LDI_PM_NEG -This is a 16 bit reloc for the AVR that stores negated 8 bit value -(usually command address) into 8 bit immediate value of SUBI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HI8_LDI_PM_NEG -This is a 16 bit reloc for the AVR that stores negated 8 bit value -(high 8 bit of 16 bit command address) into 8 bit immediate value -of SUBI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HH8_LDI_PM_NEG -This is a 16 bit reloc for the AVR that stores negated 8 bit value -(high 6 bit of 22 bit command address) into 8 bit immediate -value of SUBI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_CALL -This is a 32 bit reloc for the AVR that stores 23 bit value -into 22 bits. -@end deffn -@deffn {} BFD_RELOC_AVR_LDI -This is a 16 bit reloc for the AVR that stores all needed bits -for absolute addressing with ldi with overflow check to linktime -@end deffn -@deffn {} BFD_RELOC_AVR_6 -This is a 6 bit reloc for the AVR that stores offset for ldd/std -instructions -@end deffn -@deffn {} BFD_RELOC_AVR_6_ADIW -This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw -instructions -@end deffn -@deffn {} BFD_RELOC_390_12 -Direct 12 bit. -@end deffn -@deffn {} BFD_RELOC_390_GOT12 -12 bit GOT offset. -@end deffn -@deffn {} BFD_RELOC_390_PLT32 -32 bit PC relative PLT address. -@end deffn -@deffn {} BFD_RELOC_390_COPY -Copy symbol at runtime. -@end deffn -@deffn {} BFD_RELOC_390_GLOB_DAT -Create GOT entry. -@end deffn -@deffn {} BFD_RELOC_390_JMP_SLOT -Create PLT entry. -@end deffn -@deffn {} BFD_RELOC_390_RELATIVE -Adjust by program base. -@end deffn -@deffn {} BFD_RELOC_390_GOTPC -32 bit PC relative offset to GOT. -@end deffn -@deffn {} BFD_RELOC_390_GOT16 -16 bit GOT offset. -@end deffn -@deffn {} BFD_RELOC_390_PC16DBL -PC relative 16 bit shifted by 1. -@end deffn -@deffn {} BFD_RELOC_390_PLT16DBL -16 bit PC rel. PLT shifted by 1. -@end deffn -@deffn {} BFD_RELOC_390_PC32DBL -PC relative 32 bit shifted by 1. -@end deffn -@deffn {} BFD_RELOC_390_PLT32DBL -32 bit PC rel. PLT shifted by 1. -@end deffn -@deffn {} BFD_RELOC_390_GOTPCDBL -32 bit PC rel. GOT shifted by 1. -@end deffn -@deffn {} BFD_RELOC_390_GOT64 -64 bit GOT offset. -@end deffn -@deffn {} BFD_RELOC_390_PLT64 -64 bit PC relative PLT address. -@end deffn -@deffn {} BFD_RELOC_390_GOTENT -32 bit rel. offset to GOT entry. -@end deffn -@deffn {} BFD_RELOC_390_GOTOFF64 -64 bit offset to GOT. -@end deffn -@deffn {} BFD_RELOC_390_GOTPLT12 -12-bit offset to symbol-entry within GOT, with PLT handling. -@end deffn -@deffn {} BFD_RELOC_390_GOTPLT16 -16-bit offset to symbol-entry within GOT, with PLT handling. -@end deffn -@deffn {} BFD_RELOC_390_GOTPLT32 -32-bit offset to symbol-entry within GOT, with PLT handling. -@end deffn -@deffn {} BFD_RELOC_390_GOTPLT64 -64-bit offset to symbol-entry within GOT, with PLT handling. -@end deffn -@deffn {} BFD_RELOC_390_GOTPLTENT -32-bit rel. offset to symbol-entry within GOT, with PLT handling. -@end deffn -@deffn {} BFD_RELOC_390_PLTOFF16 -16-bit rel. offset from the GOT to a PLT entry. -@end deffn -@deffn {} BFD_RELOC_390_PLTOFF32 -32-bit rel. offset from the GOT to a PLT entry. -@end deffn -@deffn {} BFD_RELOC_390_PLTOFF64 -64-bit rel. offset from the GOT to a PLT entry. -@end deffn -@deffn {} BFD_RELOC_390_TLS_LOAD -@deffnx {} BFD_RELOC_390_TLS_GDCALL -@deffnx {} BFD_RELOC_390_TLS_LDCALL -@deffnx {} BFD_RELOC_390_TLS_GD32 -@deffnx {} BFD_RELOC_390_TLS_GD64 -@deffnx {} BFD_RELOC_390_TLS_GOTIE12 -@deffnx {} BFD_RELOC_390_TLS_GOTIE32 -@deffnx {} BFD_RELOC_390_TLS_GOTIE64 -@deffnx {} BFD_RELOC_390_TLS_LDM32 -@deffnx {} BFD_RELOC_390_TLS_LDM64 -@deffnx {} BFD_RELOC_390_TLS_IE32 -@deffnx {} BFD_RELOC_390_TLS_IE64 -@deffnx {} BFD_RELOC_390_TLS_IEENT -@deffnx {} BFD_RELOC_390_TLS_LE32 -@deffnx {} BFD_RELOC_390_TLS_LE64 -@deffnx {} BFD_RELOC_390_TLS_LDO32 -@deffnx {} BFD_RELOC_390_TLS_LDO64 -@deffnx {} BFD_RELOC_390_TLS_DTPMOD -@deffnx {} BFD_RELOC_390_TLS_DTPOFF -@deffnx {} BFD_RELOC_390_TLS_TPOFF -s390 tls relocations. -@end deffn -@deffn {} BFD_RELOC_390_20 -@deffnx {} BFD_RELOC_390_GOT20 -@deffnx {} BFD_RELOC_390_GOTPLT20 -@deffnx {} BFD_RELOC_390_TLS_GOTIE20 -Long displacement extension. -@end deffn -@deffn {} BFD_RELOC_IP2K_FR9 -Scenix IP2K - 9-bit register number / data address -@end deffn -@deffn {} BFD_RELOC_IP2K_BANK -Scenix IP2K - 4-bit register/data bank number -@end deffn -@deffn {} BFD_RELOC_IP2K_ADDR16CJP -Scenix IP2K - low 13 bits of instruction word address -@end deffn -@deffn {} BFD_RELOC_IP2K_PAGE3 -Scenix IP2K - high 3 bits of instruction word address -@end deffn -@deffn {} BFD_RELOC_IP2K_LO8DATA -@deffnx {} BFD_RELOC_IP2K_HI8DATA -@deffnx {} BFD_RELOC_IP2K_EX8DATA -Scenix IP2K - ext/low/high 8 bits of data address -@end deffn -@deffn {} BFD_RELOC_IP2K_LO8INSN -@deffnx {} BFD_RELOC_IP2K_HI8INSN -Scenix IP2K - low/high 8 bits of instruction word address -@end deffn -@deffn {} BFD_RELOC_IP2K_PC_SKIP -Scenix IP2K - even/odd PC modifier to modify snb pcl.0 -@end deffn -@deffn {} BFD_RELOC_IP2K_TEXT -Scenix IP2K - 16 bit word address in text section. -@end deffn -@deffn {} BFD_RELOC_IP2K_FR_OFFSET -Scenix IP2K - 7-bit sp or dp offset -@end deffn -@deffn {} BFD_RELOC_VPE4KMATH_DATA -@deffnx {} BFD_RELOC_VPE4KMATH_INSN -Scenix VPE4K coprocessor - data/insn-space addressing -@end deffn -@deffn {} BFD_RELOC_VTABLE_INHERIT -@deffnx {} BFD_RELOC_VTABLE_ENTRY -These two relocations are used by the linker to determine which of -the entries in a C++ virtual function table are actually used. When -the --gc-sections option is given, the linker will zero out the entries -that are not used, so that the code for those functions need not be -included in the output. - -VTABLE_INHERIT is a zero-space relocation used to describe to the -linker the inheritance tree of a C++ virtual function table. The -relocation's symbol should be the parent class' vtable, and the -relocation should be located at the child vtable. - -VTABLE_ENTRY is a zero-space relocation that describes the use of a -virtual function table entry. The reloc's symbol should refer to the -table of the class mentioned in the code. Off of that base, an offset -describes the entry that is being used. For Rela hosts, this offset -is stored in the reloc's addend. For Rel hosts, we are forced to put -this offset in the reloc's section offset. -@end deffn -@deffn {} BFD_RELOC_IA64_IMM14 -@deffnx {} BFD_RELOC_IA64_IMM22 -@deffnx {} BFD_RELOC_IA64_IMM64 -@deffnx {} BFD_RELOC_IA64_DIR32MSB -@deffnx {} BFD_RELOC_IA64_DIR32LSB -@deffnx {} BFD_RELOC_IA64_DIR64MSB -@deffnx {} BFD_RELOC_IA64_DIR64LSB -@deffnx {} BFD_RELOC_IA64_GPREL22 -@deffnx {} BFD_RELOC_IA64_GPREL64I -@deffnx {} BFD_RELOC_IA64_GPREL32MSB -@deffnx {} BFD_RELOC_IA64_GPREL32LSB -@deffnx {} BFD_RELOC_IA64_GPREL64MSB -@deffnx {} BFD_RELOC_IA64_GPREL64LSB -@deffnx {} BFD_RELOC_IA64_LTOFF22 -@deffnx {} BFD_RELOC_IA64_LTOFF64I -@deffnx {} BFD_RELOC_IA64_PLTOFF22 -@deffnx {} BFD_RELOC_IA64_PLTOFF64I -@deffnx {} BFD_RELOC_IA64_PLTOFF64MSB -@deffnx {} BFD_RELOC_IA64_PLTOFF64LSB -@deffnx {} BFD_RELOC_IA64_FPTR64I -@deffnx {} BFD_RELOC_IA64_FPTR32MSB -@deffnx {} BFD_RELOC_IA64_FPTR32LSB -@deffnx {} BFD_RELOC_IA64_FPTR64MSB -@deffnx {} BFD_RELOC_IA64_FPTR64LSB -@deffnx {} BFD_RELOC_IA64_PCREL21B -@deffnx {} BFD_RELOC_IA64_PCREL21BI -@deffnx {} BFD_RELOC_IA64_PCREL21M -@deffnx {} BFD_RELOC_IA64_PCREL21F -@deffnx {} BFD_RELOC_IA64_PCREL22 -@deffnx {} BFD_RELOC_IA64_PCREL60B -@deffnx {} BFD_RELOC_IA64_PCREL64I -@deffnx {} BFD_RELOC_IA64_PCREL32MSB -@deffnx {} BFD_RELOC_IA64_PCREL32LSB -@deffnx {} BFD_RELOC_IA64_PCREL64MSB -@deffnx {} BFD_RELOC_IA64_PCREL64LSB -@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR22 -@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR64I -@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR32MSB -@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR32LSB -@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR64MSB -@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR64LSB -@deffnx {} BFD_RELOC_IA64_SEGREL32MSB -@deffnx {} BFD_RELOC_IA64_SEGREL32LSB -@deffnx {} BFD_RELOC_IA64_SEGREL64MSB -@deffnx {} BFD_RELOC_IA64_SEGREL64LSB -@deffnx {} BFD_RELOC_IA64_SECREL32MSB -@deffnx {} BFD_RELOC_IA64_SECREL32LSB -@deffnx {} BFD_RELOC_IA64_SECREL64MSB -@deffnx {} BFD_RELOC_IA64_SECREL64LSB -@deffnx {} BFD_RELOC_IA64_REL32MSB -@deffnx {} BFD_RELOC_IA64_REL32LSB -@deffnx {} BFD_RELOC_IA64_REL64MSB -@deffnx {} BFD_RELOC_IA64_REL64LSB -@deffnx {} BFD_RELOC_IA64_LTV32MSB -@deffnx {} BFD_RELOC_IA64_LTV32LSB -@deffnx {} BFD_RELOC_IA64_LTV64MSB -@deffnx {} BFD_RELOC_IA64_LTV64LSB -@deffnx {} BFD_RELOC_IA64_IPLTMSB -@deffnx {} BFD_RELOC_IA64_IPLTLSB -@deffnx {} BFD_RELOC_IA64_COPY -@deffnx {} BFD_RELOC_IA64_LTOFF22X -@deffnx {} BFD_RELOC_IA64_LDXMOV -@deffnx {} BFD_RELOC_IA64_TPREL14 -@deffnx {} BFD_RELOC_IA64_TPREL22 -@deffnx {} BFD_RELOC_IA64_TPREL64I -@deffnx {} BFD_RELOC_IA64_TPREL64MSB -@deffnx {} BFD_RELOC_IA64_TPREL64LSB -@deffnx {} BFD_RELOC_IA64_LTOFF_TPREL22 -@deffnx {} BFD_RELOC_IA64_DTPMOD64MSB -@deffnx {} BFD_RELOC_IA64_DTPMOD64LSB -@deffnx {} BFD_RELOC_IA64_LTOFF_DTPMOD22 -@deffnx {} BFD_RELOC_IA64_DTPREL14 -@deffnx {} BFD_RELOC_IA64_DTPREL22 -@deffnx {} BFD_RELOC_IA64_DTPREL64I -@deffnx {} BFD_RELOC_IA64_DTPREL32MSB -@deffnx {} BFD_RELOC_IA64_DTPREL32LSB -@deffnx {} BFD_RELOC_IA64_DTPREL64MSB -@deffnx {} BFD_RELOC_IA64_DTPREL64LSB -@deffnx {} BFD_RELOC_IA64_LTOFF_DTPREL22 -Intel IA64 Relocations. -@end deffn -@deffn {} BFD_RELOC_M68HC11_HI8 -Motorola 68HC11 reloc. -This is the 8 bit high part of an absolute address. -@end deffn -@deffn {} BFD_RELOC_M68HC11_LO8 -Motorola 68HC11 reloc. -This is the 8 bit low part of an absolute address. -@end deffn -@deffn {} BFD_RELOC_M68HC11_3B -Motorola 68HC11 reloc. -This is the 3 bit of a value. -@end deffn -@deffn {} BFD_RELOC_M68HC11_RL_JUMP -Motorola 68HC11 reloc. -This reloc marks the beginning of a jump/call instruction. -It is used for linker relaxation to correctly identify beginning -of instruction and change some branches to use PC-relative -addressing mode. -@end deffn -@deffn {} BFD_RELOC_M68HC11_RL_GROUP -Motorola 68HC11 reloc. -This reloc marks a group of several instructions that gcc generates -and for which the linker relaxation pass can modify and/or remove -some of them. -@end deffn -@deffn {} BFD_RELOC_M68HC11_LO16 -Motorola 68HC11 reloc. -This is the 16-bit lower part of an address. It is used for 'call' -instruction to specify the symbol address without any special -transformation (due to memory bank window). -@end deffn -@deffn {} BFD_RELOC_M68HC11_PAGE -Motorola 68HC11 reloc. -This is a 8-bit reloc that specifies the page number of an address. -It is used by 'call' instruction to specify the page number of -the symbol. -@end deffn -@deffn {} BFD_RELOC_M68HC11_24 -Motorola 68HC11 reloc. -This is a 24-bit reloc that represents the address with a 16-bit -value and a 8-bit page number. The symbol address is transformed -to follow the 16K memory bank of 68HC12 (seen as mapped in the window). -@end deffn -@deffn {} BFD_RELOC_M68HC12_5B -Motorola 68HC12 reloc. -This is the 5 bits of a value. -@end deffn -@deffn {} BFD_RELOC_16C_NUM08 -@deffnx {} BFD_RELOC_16C_NUM08_C -@deffnx {} BFD_RELOC_16C_NUM16 -@deffnx {} BFD_RELOC_16C_NUM16_C -@deffnx {} BFD_RELOC_16C_NUM32 -@deffnx {} BFD_RELOC_16C_NUM32_C -@deffnx {} BFD_RELOC_16C_DISP04 -@deffnx {} BFD_RELOC_16C_DISP04_C -@deffnx {} BFD_RELOC_16C_DISP08 -@deffnx {} BFD_RELOC_16C_DISP08_C -@deffnx {} BFD_RELOC_16C_DISP16 -@deffnx {} BFD_RELOC_16C_DISP16_C -@deffnx {} BFD_RELOC_16C_DISP24 -@deffnx {} BFD_RELOC_16C_DISP24_C -@deffnx {} BFD_RELOC_16C_DISP24a -@deffnx {} BFD_RELOC_16C_DISP24a_C -@deffnx {} BFD_RELOC_16C_REG04 -@deffnx {} BFD_RELOC_16C_REG04_C -@deffnx {} BFD_RELOC_16C_REG04a -@deffnx {} BFD_RELOC_16C_REG04a_C -@deffnx {} BFD_RELOC_16C_REG14 -@deffnx {} BFD_RELOC_16C_REG14_C -@deffnx {} BFD_RELOC_16C_REG16 -@deffnx {} BFD_RELOC_16C_REG16_C -@deffnx {} BFD_RELOC_16C_REG20 -@deffnx {} BFD_RELOC_16C_REG20_C -@deffnx {} BFD_RELOC_16C_ABS20 -@deffnx {} BFD_RELOC_16C_ABS20_C -@deffnx {} BFD_RELOC_16C_ABS24 -@deffnx {} BFD_RELOC_16C_ABS24_C -@deffnx {} BFD_RELOC_16C_IMM04 -@deffnx {} BFD_RELOC_16C_IMM04_C -@deffnx {} BFD_RELOC_16C_IMM16 -@deffnx {} BFD_RELOC_16C_IMM16_C -@deffnx {} BFD_RELOC_16C_IMM20 -@deffnx {} BFD_RELOC_16C_IMM20_C -@deffnx {} BFD_RELOC_16C_IMM24 -@deffnx {} BFD_RELOC_16C_IMM24_C -@deffnx {} BFD_RELOC_16C_IMM32 -@deffnx {} BFD_RELOC_16C_IMM32_C -NS CR16C Relocations. -@end deffn -@deffn {} BFD_RELOC_CRX_REL4 -@deffnx {} BFD_RELOC_CRX_REL8 -@deffnx {} BFD_RELOC_CRX_REL8_CMP -@deffnx {} BFD_RELOC_CRX_REL16 -@deffnx {} BFD_RELOC_CRX_REL24 -@deffnx {} BFD_RELOC_CRX_REL32 -@deffnx {} BFD_RELOC_CRX_REGREL12 -@deffnx {} BFD_RELOC_CRX_REGREL22 -@deffnx {} BFD_RELOC_CRX_REGREL28 -@deffnx {} BFD_RELOC_CRX_REGREL32 -@deffnx {} BFD_RELOC_CRX_ABS16 -@deffnx {} BFD_RELOC_CRX_ABS32 -@deffnx {} BFD_RELOC_CRX_NUM8 -@deffnx {} BFD_RELOC_CRX_NUM16 -@deffnx {} BFD_RELOC_CRX_NUM32 -@deffnx {} BFD_RELOC_CRX_IMM16 -@deffnx {} BFD_RELOC_CRX_IMM32 -@deffnx {} BFD_RELOC_CRX_SWITCH8 -@deffnx {} BFD_RELOC_CRX_SWITCH16 -@deffnx {} BFD_RELOC_CRX_SWITCH32 -NS CRX Relocations. -@end deffn -@deffn {} BFD_RELOC_CRIS_BDISP8 -@deffnx {} BFD_RELOC_CRIS_UNSIGNED_5 -@deffnx {} BFD_RELOC_CRIS_SIGNED_6 -@deffnx {} BFD_RELOC_CRIS_UNSIGNED_6 -@deffnx {} BFD_RELOC_CRIS_SIGNED_8 -@deffnx {} BFD_RELOC_CRIS_UNSIGNED_8 -@deffnx {} BFD_RELOC_CRIS_SIGNED_16 -@deffnx {} BFD_RELOC_CRIS_UNSIGNED_16 -@deffnx {} BFD_RELOC_CRIS_LAPCQ_OFFSET -@deffnx {} BFD_RELOC_CRIS_UNSIGNED_4 -These relocs are only used within the CRIS assembler. They are not -(at present) written to any object files. -@end deffn -@deffn {} BFD_RELOC_CRIS_COPY -@deffnx {} BFD_RELOC_CRIS_GLOB_DAT -@deffnx {} BFD_RELOC_CRIS_JUMP_SLOT -@deffnx {} BFD_RELOC_CRIS_RELATIVE -Relocs used in ELF shared libraries for CRIS. -@end deffn -@deffn {} BFD_RELOC_CRIS_32_GOT -32-bit offset to symbol-entry within GOT. -@end deffn -@deffn {} BFD_RELOC_CRIS_16_GOT -16-bit offset to symbol-entry within GOT. -@end deffn -@deffn {} BFD_RELOC_CRIS_32_GOTPLT -32-bit offset to symbol-entry within GOT, with PLT handling. -@end deffn -@deffn {} BFD_RELOC_CRIS_16_GOTPLT -16-bit offset to symbol-entry within GOT, with PLT handling. -@end deffn -@deffn {} BFD_RELOC_CRIS_32_GOTREL -32-bit offset to symbol, relative to GOT. -@end deffn -@deffn {} BFD_RELOC_CRIS_32_PLT_GOTREL -32-bit offset to symbol with PLT entry, relative to GOT. -@end deffn -@deffn {} BFD_RELOC_CRIS_32_PLT_PCREL -32-bit offset to symbol with PLT entry, relative to this relocation. -@end deffn -@deffn {} BFD_RELOC_860_COPY -@deffnx {} BFD_RELOC_860_GLOB_DAT -@deffnx {} BFD_RELOC_860_JUMP_SLOT -@deffnx {} BFD_RELOC_860_RELATIVE -@deffnx {} BFD_RELOC_860_PC26 -@deffnx {} BFD_RELOC_860_PLT26 -@deffnx {} BFD_RELOC_860_PC16 -@deffnx {} BFD_RELOC_860_LOW0 -@deffnx {} BFD_RELOC_860_SPLIT0 -@deffnx {} BFD_RELOC_860_LOW1 -@deffnx {} BFD_RELOC_860_SPLIT1 -@deffnx {} BFD_RELOC_860_LOW2 -@deffnx {} BFD_RELOC_860_SPLIT2 -@deffnx {} BFD_RELOC_860_LOW3 -@deffnx {} BFD_RELOC_860_LOGOT0 -@deffnx {} BFD_RELOC_860_SPGOT0 -@deffnx {} BFD_RELOC_860_LOGOT1 -@deffnx {} BFD_RELOC_860_SPGOT1 -@deffnx {} BFD_RELOC_860_LOGOTOFF0 -@deffnx {} BFD_RELOC_860_SPGOTOFF0 -@deffnx {} BFD_RELOC_860_LOGOTOFF1 -@deffnx {} BFD_RELOC_860_SPGOTOFF1 -@deffnx {} BFD_RELOC_860_LOGOTOFF2 -@deffnx {} BFD_RELOC_860_LOGOTOFF3 -@deffnx {} BFD_RELOC_860_LOPC -@deffnx {} BFD_RELOC_860_HIGHADJ -@deffnx {} BFD_RELOC_860_HAGOT -@deffnx {} BFD_RELOC_860_HAGOTOFF -@deffnx {} BFD_RELOC_860_HAPC -@deffnx {} BFD_RELOC_860_HIGH -@deffnx {} BFD_RELOC_860_HIGOT -@deffnx {} BFD_RELOC_860_HIGOTOFF -Intel i860 Relocations. -@end deffn -@deffn {} BFD_RELOC_OPENRISC_ABS_26 -@deffnx {} BFD_RELOC_OPENRISC_REL_26 -OpenRISC Relocations. -@end deffn -@deffn {} BFD_RELOC_H8_DIR16A8 -@deffnx {} BFD_RELOC_H8_DIR16R8 -@deffnx {} BFD_RELOC_H8_DIR24A8 -@deffnx {} BFD_RELOC_H8_DIR24R8 -@deffnx {} BFD_RELOC_H8_DIR32A16 -H8 elf Relocations. -@end deffn -@deffn {} BFD_RELOC_XSTORMY16_REL_12 -@deffnx {} BFD_RELOC_XSTORMY16_12 -@deffnx {} BFD_RELOC_XSTORMY16_24 -@deffnx {} BFD_RELOC_XSTORMY16_FPTR16 -Sony Xstormy16 Relocations. -@end deffn -@deffn {} BFD_RELOC_XC16X_PAG -@deffnx {} BFD_RELOC_XC16X_POF -@deffnx {} BFD_RELOC_XC16X_SEG -@deffnx {} BFD_RELOC_XC16X_SOF -Infineon Relocations. -@end deffn -@deffn {} BFD_RELOC_VAX_GLOB_DAT -@deffnx {} BFD_RELOC_VAX_JMP_SLOT -@deffnx {} BFD_RELOC_VAX_RELATIVE -Relocations used by VAX ELF. -@end deffn -@deffn {} BFD_RELOC_MT_PC16 -Morpho MT - 16 bit immediate relocation. -@end deffn -@deffn {} BFD_RELOC_MT_HI16 -Morpho MT - Hi 16 bits of an address. -@end deffn -@deffn {} BFD_RELOC_MT_LO16 -Morpho MT - Low 16 bits of an address. -@end deffn -@deffn {} BFD_RELOC_MT_GNU_VTINHERIT -Morpho MT - Used to tell the linker which vtable entries are used. -@end deffn -@deffn {} BFD_RELOC_MT_GNU_VTENTRY -Morpho MT - Used to tell the linker which vtable entries are used. -@end deffn -@deffn {} BFD_RELOC_MT_PCINSN8 -Morpho MT - 8 bit immediate relocation. -@end deffn -@deffn {} BFD_RELOC_MSP430_10_PCREL -@deffnx {} BFD_RELOC_MSP430_16_PCREL -@deffnx {} BFD_RELOC_MSP430_16 -@deffnx {} BFD_RELOC_MSP430_16_PCREL_BYTE -@deffnx {} BFD_RELOC_MSP430_16_BYTE -@deffnx {} BFD_RELOC_MSP430_2X_PCREL -@deffnx {} BFD_RELOC_MSP430_RL_PCREL -msp430 specific relocation codes -@end deffn -@deffn {} BFD_RELOC_IQ2000_OFFSET_16 -@deffnx {} BFD_RELOC_IQ2000_OFFSET_21 -@deffnx {} BFD_RELOC_IQ2000_UHI16 -IQ2000 Relocations. -@end deffn -@deffn {} BFD_RELOC_XTENSA_RTLD -Special Xtensa relocation used only by PLT entries in ELF shared -objects to indicate that the runtime linker should set the value -to one of its own internal functions or data structures. -@end deffn -@deffn {} BFD_RELOC_XTENSA_GLOB_DAT -@deffnx {} BFD_RELOC_XTENSA_JMP_SLOT -@deffnx {} BFD_RELOC_XTENSA_RELATIVE -Xtensa relocations for ELF shared objects. -@end deffn -@deffn {} BFD_RELOC_XTENSA_PLT -Xtensa relocation used in ELF object files for symbols that may require -PLT entries. Otherwise, this is just a generic 32-bit relocation. -@end deffn -@deffn {} BFD_RELOC_XTENSA_DIFF8 -@deffnx {} BFD_RELOC_XTENSA_DIFF16 -@deffnx {} BFD_RELOC_XTENSA_DIFF32 -Xtensa relocations to mark the difference of two local symbols. -These are only needed to support linker relaxation and can be ignored -when not relaxing. The field is set to the value of the difference -assuming no relaxation. The relocation encodes the position of the -first symbol so the linker can determine whether to adjust the field -value. -@end deffn -@deffn {} BFD_RELOC_XTENSA_SLOT0_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT1_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT2_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT3_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT4_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT5_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT6_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT7_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT8_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT9_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT10_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT11_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT12_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT13_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT14_OP -Generic Xtensa relocations for instruction operands. Only the slot -number is encoded in the relocation. The relocation applies to the -last PC-relative immediate operand, or if there are no PC-relative -immediates, to the last immediate operand. -@end deffn -@deffn {} BFD_RELOC_XTENSA_SLOT0_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT1_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT2_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT3_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT4_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT5_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT6_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT7_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT8_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT9_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT10_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT11_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT12_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT13_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT14_ALT -Alternate Xtensa relocations. Only the slot is encoded in the -relocation. The meaning of these relocations is opcode-specific. -@end deffn -@deffn {} BFD_RELOC_XTENSA_OP0 -@deffnx {} BFD_RELOC_XTENSA_OP1 -@deffnx {} BFD_RELOC_XTENSA_OP2 -Xtensa relocations for backward compatibility. These have all been -replaced by BFD_RELOC_XTENSA_SLOT0_OP. -@end deffn -@deffn {} BFD_RELOC_XTENSA_ASM_EXPAND -Xtensa relocation to mark that the assembler expanded the -instructions from an original target. The expansion size is -encoded in the reloc size. -@end deffn -@deffn {} BFD_RELOC_XTENSA_ASM_SIMPLIFY -Xtensa relocation to mark that the linker should simplify -assembler-expanded instructions. This is commonly used -internally by the linker after analysis of a -BFD_RELOC_XTENSA_ASM_EXPAND. -@end deffn -@deffn {} BFD_RELOC_Z80_DISP8 -8 bit signed offset in (ix+d) or (iy+d). -@end deffn -@deffn {} BFD_RELOC_Z8K_DISP7 -DJNZ offset. -@end deffn -@deffn {} BFD_RELOC_Z8K_CALLR -CALR offset. -@end deffn -@deffn {} BFD_RELOC_Z8K_IMM4L -4 bit value. -@end deffn - -@example - -typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; -@end example -@findex bfd_reloc_type_lookup -@subsubsection @code{bfd_reloc_type_lookup} -@strong{Synopsis} -@example -reloc_howto_type *bfd_reloc_type_lookup - (bfd *abfd, bfd_reloc_code_real_type code); -@end example -@strong{Description}@* -Return a pointer to a howto structure which, when -invoked, will perform the relocation @var{code} on data from the -architecture noted. - -@findex bfd_default_reloc_type_lookup -@subsubsection @code{bfd_default_reloc_type_lookup} -@strong{Synopsis} -@example -reloc_howto_type *bfd_default_reloc_type_lookup - (bfd *abfd, bfd_reloc_code_real_type code); -@end example -@strong{Description}@* -Provides a default relocation lookup routine for any architecture. - -@findex bfd_get_reloc_code_name -@subsubsection @code{bfd_get_reloc_code_name} -@strong{Synopsis} -@example -const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code); -@end example -@strong{Description}@* -Provides a printable name for the supplied relocation code. -Useful mainly for printing error messages. - -@findex bfd_generic_relax_section -@subsubsection @code{bfd_generic_relax_section} -@strong{Synopsis} -@example -bfd_boolean bfd_generic_relax_section - (bfd *abfd, - asection *section, - struct bfd_link_info *, - bfd_boolean *); -@end example -@strong{Description}@* -Provides default handling for relaxing for back ends which -don't do relaxing. - -@findex bfd_generic_gc_sections -@subsubsection @code{bfd_generic_gc_sections} -@strong{Synopsis} -@example -bfd_boolean bfd_generic_gc_sections - (bfd *, struct bfd_link_info *); -@end example -@strong{Description}@* -Provides default handling for relaxing for back ends which -don't do section gc -- i.e., does nothing. - -@findex bfd_generic_merge_sections -@subsubsection @code{bfd_generic_merge_sections} -@strong{Synopsis} -@example -bfd_boolean bfd_generic_merge_sections - (bfd *, struct bfd_link_info *); -@end example -@strong{Description}@* -Provides default handling for SEC_MERGE section merging for back ends -which don't have SEC_MERGE support -- i.e., does nothing. - -@findex bfd_generic_get_relocated_section_contents -@subsubsection @code{bfd_generic_get_relocated_section_contents} -@strong{Synopsis} -@example -bfd_byte *bfd_generic_get_relocated_section_contents - (bfd *abfd, - struct bfd_link_info *link_info, - struct bfd_link_order *link_order, - bfd_byte *data, - bfd_boolean relocatable, - asymbol **symbols); -@end example -@strong{Description}@* -Provides default handling of relocation effort for back ends -which can't be bothered to do it efficiently. - diff --git a/bfd/doc/section.texi b/bfd/doc/section.texi deleted file mode 100644 index 4347679ef49..00000000000 --- a/bfd/doc/section.texi +++ /dev/null @@ -1,989 +0,0 @@ -@section Sections -The raw data contained within a BFD is maintained through the -section abstraction. A single BFD may have any number of -sections. It keeps hold of them by pointing to the first; -each one points to the next in the list. - -Sections are supported in BFD in @code{section.c}. - -@menu -* Section Input:: -* Section Output:: -* typedef asection:: -* section prototypes:: -@end menu - -@node Section Input, Section Output, Sections, Sections -@subsection Section input -When a BFD is opened for reading, the section structures are -created and attached to the BFD. - -Each section has a name which describes the section in the -outside world---for example, @code{a.out} would contain at least -three sections, called @code{.text}, @code{.data} and @code{.bss}. - -Names need not be unique; for example a COFF file may have several -sections named @code{.data}. - -Sometimes a BFD will contain more than the ``natural'' number of -sections. A back end may attach other sections containing -constructor data, or an application may add a section (using -@code{bfd_make_section}) to the sections attached to an already open -BFD. For example, the linker creates an extra section -@code{COMMON} for each input file's BFD to hold information about -common storage. - -The raw data is not necessarily read in when -the section descriptor is created. Some targets may leave the -data in place until a @code{bfd_get_section_contents} call is -made. Other back ends may read in all the data at once. For -example, an S-record file has to be read once to determine the -size of the data. An IEEE-695 file doesn't contain raw data in -sections, but data and relocation expressions intermixed, so -the data area has to be parsed to get out the data and -relocations. - -@node Section Output, typedef asection, Section Input, Sections -@subsection Section output -To write a new object style BFD, the various sections to be -written have to be created. They are attached to the BFD in -the same way as input sections; data is written to the -sections using @code{bfd_set_section_contents}. - -Any program that creates or combines sections (e.g., the assembler -and linker) must use the @code{asection} fields @code{output_section} and -@code{output_offset} to indicate the file sections to which each -section must be written. (If the section is being created from -scratch, @code{output_section} should probably point to the section -itself and @code{output_offset} should probably be zero.) - -The data to be written comes from input sections attached -(via @code{output_section} pointers) to -the output sections. The output section structure can be -considered a filter for the input section: the output section -determines the vma of the output data and the name, but the -input section determines the offset into the output section of -the data to be written. - -E.g., to create a section "O", starting at 0x100, 0x123 long, -containing two subsections, "A" at offset 0x0 (i.e., at vma -0x100) and "B" at offset 0x20 (i.e., at vma 0x120) the @code{asection} -structures would look like: - -@example - section name "A" - output_offset 0x00 - size 0x20 - output_section -----------> section name "O" - | vma 0x100 - section name "B" | size 0x123 - output_offset 0x20 | - size 0x103 | - output_section --------| -@end example - -@subsection Link orders -The data within a section is stored in a @dfn{link_order}. -These are much like the fixups in @code{gas}. The link_order -abstraction allows a section to grow and shrink within itself. - -A link_order knows how big it is, and which is the next -link_order and where the raw data for it is; it also points to -a list of relocations which apply to it. - -The link_order is used by the linker to perform relaxing on -final code. The compiler creates code which is as big as -necessary to make it work without relaxing, and the user can -select whether to relax. Sometimes relaxing takes a lot of -time. The linker runs around the relocations to see if any -are attached to data which can be shrunk, if so it does it on -a link_order by link_order basis. - - -@node typedef asection, section prototypes, Section Output, Sections -@subsection typedef asection -Here is the section structure: - - -@example - -typedef struct bfd_section -@{ - /* The name of the section; the name isn't a copy, the pointer is - the same as that passed to bfd_make_section. */ - const char *name; - - /* A unique sequence number. */ - int id; - - /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; - - /* The next section in the list belonging to the BFD, or NULL. */ - struct bfd_section *next; - - /* The previous section in the list belonging to the BFD, or NULL. */ - struct bfd_section *prev; - - /* The field flags contains attributes of the section. Some - flags are read in from the object file, and some are - synthesized from other information. */ - flagword flags; - -#define SEC_NO_FLAGS 0x000 - - /* Tells the OS to allocate space for this section when loading. - This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 - - /* Tells the OS to load the section from the file when loading. - This is clear for a .bss section. */ -#define SEC_LOAD 0x002 - - /* The section contains data still to be relocated, so there is - some relocation information too. */ -#define SEC_RELOC 0x004 - - /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 - - /* The section contains code only. */ -#define SEC_CODE 0x010 - - /* The section contains data only. */ -#define SEC_DATA 0x020 - - /* The section will reside in ROM. */ -#define SEC_ROM 0x040 - - /* The section contains constructor information. This section - type is used by the linker to create lists of constructors and - destructors used by @code{g++}. When a back end sees a symbol - which should be used in a constructor list, it creates a new - section for the type of name (e.g., @code{__CTOR_LIST__}), attaches - the symbol to it, and builds a relocation. To build the lists - of constructors, all the linker has to do is catenate all the - sections called @code{__CTOR_LIST__} and relocate the data - contained within - exactly the operations it would peform on - standard data. */ -#define SEC_CONSTRUCTOR 0x080 - - /* The section has contents - a data section could be - @code{SEC_ALLOC} | @code{SEC_HAS_CONTENTS}; a debug section could be - @code{SEC_HAS_CONTENTS} */ -#define SEC_HAS_CONTENTS 0x100 - - /* An instruction to the linker to not output the section - even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 - - /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 - - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 - - /* The section contains common symbols (symbols may be defined - multiple times, the value of a symbol is the amount of - space it requires, and the largest symbol value is the one - used). Most targets have exactly one of these (which we - translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 - - /* The section contains only debugging information. For - example, this is set for ELF .debug and .stab sections. - strip tests this flag to see if a section can be - discarded. */ -#define SEC_DEBUGGING 0x2000 - - /* The contents of this section are held in memory pointed to - by the contents field. This is checked by bfd_get_section_contents, - and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 - - /* The contents of this section are to be excluded by the - linker for executable and shared objects unless those - objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 - - /* The contents of this section are to be sorted based on the sum of - the symbol and addend values specified by the associated relocation - entries. Entries without associated relocation entries will be - appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 - - /* When linking, duplicate sections of the same name should be - discarded, rather than being combined into a single section as - is usually done. This is similar to how common symbols are - handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 - - /* If SEC_LINK_ONCE is set, this bitfield describes how the linker - should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0x40000 - - /* This value for SEC_LINK_DUPLICATES means that duplicate - sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 - - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if there are any duplicate sections, although - it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x80000 - - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if any duplicate sections are a different size. */ -#define SEC_LINK_DUPLICATES_SAME_SIZE 0x100000 - - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if any duplicate sections contain different - contents. */ -#define SEC_LINK_DUPLICATES_SAME_CONTENTS \ - (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE) - - /* This section was created by the linker as part of dynamic - relocation or other arcane processing. It is skipped when - going through the first-pass output, trusting that someone - else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x200000 - - /* This section should not be subject to garbage collection. */ -#define SEC_KEEP 0x400000 - - /* This section contains "short" data, and should be placed - "near" the GP. */ -#define SEC_SMALL_DATA 0x800000 - - /* Attempt to merge identical entities in the section. - Entity size is given in the entsize field. */ -#define SEC_MERGE 0x1000000 - - /* If given with SEC_MERGE, entities to merge are zero terminated - strings where entsize specifies character size instead of fixed - size entries. */ -#define SEC_STRINGS 0x2000000 - - /* This section contains data about section groups. */ -#define SEC_GROUP 0x4000000 - - /* The section is a COFF shared library section. This flag is - only for the linker. If this type of section appears in - the input file, the linker must copy it to the output file - without changing the vma or size. FIXME: Although this - was originally intended to be general, it really is COFF - specific (and the flag was renamed to indicate this). It - might be cleaner to have some more general mechanism to - allow the back end to control what the linker does with - sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x10000000 - - /* This section contains data which may be shared with other - executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x20000000 - - /* When a section with this flag is being linked, then if the size of - the input section is less than a page, it should not cross a page - boundary. If the size of the input section is one page or more, - it should be aligned on a page boundary. This is for TI - TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x40000000 - - /* Conditionally link this section; do not link if there are no - references found to any symbol in the section. This is for TI - TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x80000000 - - /* End of section flags. */ - - /* Some internal packed boolean fields. */ - - /* See the vma field. */ - unsigned int user_set_vma : 1; - - /* A mark flag used by some of the linker backends. */ - unsigned int linker_mark : 1; - - /* Another mark flag used by some of the linker backends. Set for - output sections that have an input section. */ - unsigned int linker_has_input : 1; - - /* Mark flags used by some linker backends for garbage collection. */ - unsigned int gc_mark : 1; - unsigned int gc_mark_from_eh : 1; - - /* The following flags are used by the ELF linker. */ - - /* Mark sections which have been allocated to segments. */ - unsigned int segment_mark : 1; - - /* Type of sec_info information. */ - unsigned int sec_info_type:3; -#define ELF_INFO_TYPE_NONE 0 -#define ELF_INFO_TYPE_STABS 1 -#define ELF_INFO_TYPE_MERGE 2 -#define ELF_INFO_TYPE_EH_FRAME 3 -#define ELF_INFO_TYPE_JUST_SYMS 4 - - /* Nonzero if this section uses RELA relocations, rather than REL. */ - unsigned int use_rela_p:1; - - /* Bits used by various backends. The generic code doesn't touch - these fields. */ - - /* Nonzero if this section has TLS related relocations. */ - unsigned int has_tls_reloc:1; - - /* Nonzero if this section has a gp reloc. */ - unsigned int has_gp_reloc:1; - - /* Nonzero if this section needs the relax finalize pass. */ - unsigned int need_finalize_relax:1; - - /* Whether relocations have been processed. */ - unsigned int reloc_done : 1; - - /* End of internal packed boolean fields. */ - - /* The virtual memory address of the section - where it will be - at run time. The symbols are relocated against this. The - user_set_vma flag is maintained by bfd; if it's not set, the - backend can assign addresses (for example, in @code{a.out}, where - the default address for @code{.data} is dependent on the specific - target and various flags). */ - bfd_vma vma; - - /* The load address of the section - where it would be in a - rom image; really only used for writing section header - information. */ - bfd_vma lma; - - /* The size of the section in octets, as it will be output. - Contains a value even if the section has no contents (e.g., the - size of @code{.bss}). */ - bfd_size_type size; - - /* For input sections, the original size on disk of the section, in - octets. This field is used by the linker relaxation code. It is - currently only set for sections where the linker relaxation scheme - doesn't cache altered section and reloc contents (stabs, eh_frame, - SEC_MERGE, some coff relaxing targets), and thus the original size - needs to be kept to read the section multiple times. - For output sections, rawsize holds the section size calculated on - a previous linker relaxation pass. */ - bfd_size_type rawsize; - - /* If this section is going to be output, then this value is the - offset in *bytes* into the output section of the first byte in the - input section (byte ==> smallest addressable unit on the - target). In most cases, if this was going to start at the - 100th octet (8-bit quantity) in the output section, this value - would be 100. However, if the target byte size is 16 bits - (bfd_octets_per_byte is "2"), this value would be 50. */ - bfd_vma output_offset; - - /* The output section through which to map on output. */ - struct bfd_section *output_section; - - /* The alignment requirement of the section, as an exponent of 2 - - e.g., 3 aligns to 2^3 (or 8). */ - unsigned int alignment_power; - - /* If an input section, a pointer to a vector of relocation - records for the data in this section. */ - struct reloc_cache_entry *relocation; - - /* If an output section, a pointer to a vector of pointers to - relocation records for the data in this section. */ - struct reloc_cache_entry **orelocation; - - /* The number of relocation records in one of the above. */ - unsigned reloc_count; - - /* Information below is back end specific - and not always used - or updated. */ - - /* File position of section data. */ - file_ptr filepos; - - /* File position of relocation info. */ - file_ptr rel_filepos; - - /* File position of line data. */ - file_ptr line_filepos; - - /* Pointer to data for applications. */ - void *userdata; - - /* If the SEC_IN_MEMORY flag is set, this points to the actual - contents. */ - unsigned char *contents; - - /* Attached line number information. */ - alent *lineno; - - /* Number of line number records. */ - unsigned int lineno_count; - - /* Entity size for merging purposes. */ - unsigned int entsize; - - /* Points to the kept section if this section is a link-once section, - and is discarded. */ - struct bfd_section *kept_section; - - /* When a section is being output, this value changes as more - linenumbers are written out. */ - file_ptr moving_line_filepos; - - /* What the section number is in the target world. */ - int target_index; - - void *used_by_bfd; - - /* If this is a constructor section then here is a list of the - relocations created to relocate items within it. */ - struct relent_chain *constructor_chain; - - /* The BFD which owns the section. */ - bfd *owner; - - /* A symbol which points at this section only. */ - struct bfd_symbol *symbol; - struct bfd_symbol **symbol_ptr_ptr; - - /* Early in the link process, map_head and map_tail are used to build - a list of input sections attached to an output section. Later, - output sections use these fields for a list of bfd_link_order - structs. */ - union @{ - struct bfd_link_order *link_order; - struct bfd_section *s; - @} map_head, map_tail; -@} asection; - -/* These sections are global, and are managed by BFD. The application - and target back end are not permitted to change the values in - these sections. New code should use the section_ptr macros rather - than referring directly to the const sections. The const sections - may eventually vanish. */ -#define BFD_ABS_SECTION_NAME "*ABS*" -#define BFD_UND_SECTION_NAME "*UND*" -#define BFD_COM_SECTION_NAME "*COM*" -#define BFD_IND_SECTION_NAME "*IND*" - -/* The absolute section. */ -extern asection bfd_abs_section; -#define bfd_abs_section_ptr ((asection *) &bfd_abs_section) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -/* Pointer to the undefined section. */ -extern asection bfd_und_section; -#define bfd_und_section_ptr ((asection *) &bfd_und_section) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -/* Pointer to the common section. */ -extern asection bfd_com_section; -#define bfd_com_section_ptr ((asection *) &bfd_com_section) -/* Pointer to the indirect section. */ -extern asection bfd_ind_section; -#define bfd_ind_section_ptr ((asection *) &bfd_ind_section) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) - -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) - -extern const struct bfd_symbol * const bfd_abs_symbol; -extern const struct bfd_symbol * const bfd_com_symbol; -extern const struct bfd_symbol * const bfd_und_symbol; -extern const struct bfd_symbol * const bfd_ind_symbol; - -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - @{ \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - @} \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - @{ \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - @{ \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - @} \ - else \ - @{ \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - @} \ - _abfd->section_last = _s; \ - @} \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - @{ \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - @{ \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - @} \ - else \ - @{ \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - @} \ - _abfd->sections = _s; \ - @} \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - @{ \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - @} \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - @{ \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - @} \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) - -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, SYM_PTR, NAME, IDX) \ - /* name, id, index, next, prev, flags, user_set_vma, */ \ - @{ NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ - \ - /* linker_mark, linker_has_input, gc_mark, gc_mark_from_eh, */ \ - 0, 0, 1, 0, \ - \ - /* segment_mark, sec_info_type, use_rela_p, has_tls_reloc, */ \ - 0, 0, 0, 0, \ - \ - /* has_gp_reloc, need_finalize_relax, reloc_done, */ \ - 0, 0, 0, \ - \ - /* vma, lma, size, rawsize */ \ - 0, 0, 0, 0, \ - \ - /* output_offset, output_section, alignment_power, */ \ - 0, (struct bfd_section *) &SEC, 0, \ - \ - /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \ - NULL, NULL, 0, 0, 0, \ - \ - /* line_filepos, userdata, contents, lineno, lineno_count, */ \ - 0, NULL, NULL, NULL, 0, \ - \ - /* entsize, kept_section, moving_line_filepos, */ \ - 0, NULL, 0, \ - \ - /* target_index, used_by_bfd, constructor_chain, owner, */ \ - 0, NULL, NULL, NULL, \ - \ - /* symbol, */ \ - (struct bfd_symbol *) SYM, \ - \ - /* symbol_ptr_ptr, */ \ - (struct bfd_symbol **) SYM_PTR, \ - \ - /* map_head, map_tail */ \ - @{ NULL @}, @{ NULL @} \ - @} - -@end example - -@node section prototypes, , typedef asection, Sections -@subsection Section prototypes -These are the functions exported by the section handling part of BFD. - -@findex bfd_section_list_clear -@subsubsection @code{bfd_section_list_clear} -@strong{Synopsis} -@example -void bfd_section_list_clear (bfd *); -@end example -@strong{Description}@* -Clears the section list, and also resets the section count and -hash table entries. - -@findex bfd_get_section_by_name -@subsubsection @code{bfd_get_section_by_name} -@strong{Synopsis} -@example -asection *bfd_get_section_by_name (bfd *abfd, const char *name); -@end example -@strong{Description}@* -Run through @var{abfd} and return the one of the -@code{asection}s whose name matches @var{name}, otherwise @code{NULL}. -@xref{Sections}, for more information. - -This should only be used in special cases; the normal way to process -all sections of a given name is to use @code{bfd_map_over_sections} and -@code{strcmp} on the name (or better yet, base it on the section flags -or something else) for each section. - -@findex bfd_get_section_by_name_if -@subsubsection @code{bfd_get_section_by_name_if} -@strong{Synopsis} -@example -asection *bfd_get_section_by_name_if - (bfd *abfd, - const char *name, - bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj), - void *obj); -@end example -@strong{Description}@* -Call the provided function @var{func} for each section -attached to the BFD @var{abfd} whose name matches @var{name}, -passing @var{obj} as an argument. The function will be called -as if by - -@example - func (abfd, the_section, obj); -@end example - -It returns the first section for which @var{func} returns true, -otherwise @code{NULL}. - -@findex bfd_get_unique_section_name -@subsubsection @code{bfd_get_unique_section_name} -@strong{Synopsis} -@example -char *bfd_get_unique_section_name - (bfd *abfd, const char *templat, int *count); -@end example -@strong{Description}@* -Invent a section name that is unique in @var{abfd} by tacking -a dot and a digit suffix onto the original @var{templat}. If -@var{count} is non-NULL, then it specifies the first number -tried as a suffix to generate a unique name. The value -pointed to by @var{count} will be incremented in this case. - -@findex bfd_make_section_old_way -@subsubsection @code{bfd_make_section_old_way} -@strong{Synopsis} -@example -asection *bfd_make_section_old_way (bfd *abfd, const char *name); -@end example -@strong{Description}@* -Create a new empty section called @var{name} -and attach it to the end of the chain of sections for the -BFD @var{abfd}. An attempt to create a section with a name which -is already in use returns its pointer without changing the -section chain. - -It has the funny name since this is the way it used to be -before it was rewritten.... - -Possible errors are: -@itemize @bullet - -@item -@code{bfd_error_invalid_operation} - -If output has already started for this BFD. -@item -@code{bfd_error_no_memory} - -If memory allocation fails. -@end itemize - -@findex bfd_make_section_anyway_with_flags -@subsubsection @code{bfd_make_section_anyway_with_flags} -@strong{Synopsis} -@example -asection *bfd_make_section_anyway_with_flags - (bfd *abfd, const char *name, flagword flags); -@end example -@strong{Description}@* -Create a new empty section called @var{name} and attach it to the end of -the chain of sections for @var{abfd}. Create a new section even if there -is already a section with that name. Also set the attributes of the -new section to the value @var{flags}. - -Return @code{NULL} and set @code{bfd_error} on error; possible errors are: -@itemize @bullet - -@item -@code{bfd_error_invalid_operation} - If output has already started for @var{abfd}. -@item -@code{bfd_error_no_memory} - If memory allocation fails. -@end itemize - -@findex bfd_make_section_anyway -@subsubsection @code{bfd_make_section_anyway} -@strong{Synopsis} -@example -asection *bfd_make_section_anyway (bfd *abfd, const char *name); -@end example -@strong{Description}@* -Create a new empty section called @var{name} and attach it to the end of -the chain of sections for @var{abfd}. Create a new section even if there -is already a section with that name. - -Return @code{NULL} and set @code{bfd_error} on error; possible errors are: -@itemize @bullet - -@item -@code{bfd_error_invalid_operation} - If output has already started for @var{abfd}. -@item -@code{bfd_error_no_memory} - If memory allocation fails. -@end itemize - -@findex bfd_make_section_with_flags -@subsubsection @code{bfd_make_section_with_flags} -@strong{Synopsis} -@example -asection *bfd_make_section_with_flags - (bfd *, const char *name, flagword flags); -@end example -@strong{Description}@* -Like @code{bfd_make_section_anyway}, but return @code{NULL} (without calling -bfd_set_error ()) without changing the section chain if there is already a -section named @var{name}. Also set the attributes of the new section to -the value @var{flags}. If there is an error, return @code{NULL} and set -@code{bfd_error}. - -@findex bfd_make_section -@subsubsection @code{bfd_make_section} -@strong{Synopsis} -@example -asection *bfd_make_section (bfd *, const char *name); -@end example -@strong{Description}@* -Like @code{bfd_make_section_anyway}, but return @code{NULL} (without calling -bfd_set_error ()) without changing the section chain if there is already a -section named @var{name}. If there is an error, return @code{NULL} and set -@code{bfd_error}. - -@findex bfd_set_section_flags -@subsubsection @code{bfd_set_section_flags} -@strong{Synopsis} -@example -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); -@end example -@strong{Description}@* -Set the attributes of the section @var{sec} in the BFD -@var{abfd} to the value @var{flags}. Return @code{TRUE} on success, -@code{FALSE} on error. Possible error returns are: - -@itemize @bullet - -@item -@code{bfd_error_invalid_operation} - -The section cannot have one or more of the attributes -requested. For example, a .bss section in @code{a.out} may not -have the @code{SEC_HAS_CONTENTS} field set. -@end itemize - -@findex bfd_map_over_sections -@subsubsection @code{bfd_map_over_sections} -@strong{Synopsis} -@example -void bfd_map_over_sections - (bfd *abfd, - void (*func) (bfd *abfd, asection *sect, void *obj), - void *obj); -@end example -@strong{Description}@* -Call the provided function @var{func} for each section -attached to the BFD @var{abfd}, passing @var{obj} as an -argument. The function will be called as if by - -@example - func (abfd, the_section, obj); -@end example - -This is the preferred method for iterating over sections; an -alternative would be to use a loop: - -@example - section *p; - for (p = abfd->sections; p != NULL; p = p->next) - func (abfd, p, ...) -@end example - -@findex bfd_sections_find_if -@subsubsection @code{bfd_sections_find_if} -@strong{Synopsis} -@example -asection *bfd_sections_find_if - (bfd *abfd, - bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), - void *obj); -@end example -@strong{Description}@* -Call the provided function @var{operation} for each section -attached to the BFD @var{abfd}, passing @var{obj} as an -argument. The function will be called as if by - -@example - operation (abfd, the_section, obj); -@end example - -It returns the first section for which @var{operation} returns true. - -@findex bfd_set_section_size -@subsubsection @code{bfd_set_section_size} -@strong{Synopsis} -@example -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); -@end example -@strong{Description}@* -Set @var{sec} to the size @var{val}. If the operation is -ok, then @code{TRUE} is returned, else @code{FALSE}. - -Possible error returns: -@itemize @bullet - -@item -@code{bfd_error_invalid_operation} - -Writing has started to the BFD, so setting the size is invalid. -@end itemize - -@findex bfd_set_section_contents -@subsubsection @code{bfd_set_section_contents} -@strong{Synopsis} -@example -bfd_boolean bfd_set_section_contents - (bfd *abfd, asection *section, const void *data, - file_ptr offset, bfd_size_type count); -@end example -@strong{Description}@* -Sets the contents of the section @var{section} in BFD -@var{abfd} to the data starting in memory at @var{data}. The -data is written to the output section starting at offset -@var{offset} for @var{count} octets. - -Normally @code{TRUE} is returned, else @code{FALSE}. Possible error -returns are: -@itemize @bullet - -@item -@code{bfd_error_no_contents} - -The output section does not have the @code{SEC_HAS_CONTENTS} -attribute, so nothing can be written to it. -@item -and some more too -@end itemize -This routine is front end to the back end function -@code{_bfd_set_section_contents}. - -@findex bfd_get_section_contents -@subsubsection @code{bfd_get_section_contents} -@strong{Synopsis} -@example -bfd_boolean bfd_get_section_contents - (bfd *abfd, asection *section, void *location, file_ptr offset, - bfd_size_type count); -@end example -@strong{Description}@* -Read data from @var{section} in BFD @var{abfd} -into memory starting at @var{location}. The data is read at an -offset of @var{offset} from the start of the input section, -and is read for @var{count} bytes. - -If the contents of a constructor with the @code{SEC_CONSTRUCTOR} -flag set are requested or if the section does not have the -@code{SEC_HAS_CONTENTS} flag set, then the @var{location} is filled -with zeroes. If no errors occur, @code{TRUE} is returned, else -@code{FALSE}. - -@findex bfd_malloc_and_get_section -@subsubsection @code{bfd_malloc_and_get_section} -@strong{Synopsis} -@example -bfd_boolean bfd_malloc_and_get_section - (bfd *abfd, asection *section, bfd_byte **buf); -@end example -@strong{Description}@* -Read all data from @var{section} in BFD @var{abfd} -into a buffer, *@var{buf}, malloc'd by this function. - -@findex bfd_copy_private_section_data -@subsubsection @code{bfd_copy_private_section_data} -@strong{Synopsis} -@example -bfd_boolean bfd_copy_private_section_data - (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); -@end example -@strong{Description}@* -Copy private section information from @var{isec} in the BFD -@var{ibfd} to the section @var{osec} in the BFD @var{obfd}. -Return @code{TRUE} on success, @code{FALSE} on error. Possible error -returns are: - -@itemize @bullet - -@item -@code{bfd_error_no_memory} - -Not enough memory exists to create private data for @var{osec}. -@end itemize -@example -#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) -@end example - -@findex bfd_generic_is_group_section -@subsubsection @code{bfd_generic_is_group_section} -@strong{Synopsis} -@example -bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); -@end example -@strong{Description}@* -Returns TRUE if @var{sec} is a member of a group. - -@findex bfd_generic_discard_group -@subsubsection @code{bfd_generic_discard_group} -@strong{Synopsis} -@example -bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); -@end example -@strong{Description}@* -Remove all members of @var{group} from the output. - diff --git a/bfd/doc/syms.texi b/bfd/doc/syms.texi deleted file mode 100644 index dc56bbc7e1b..00000000000 --- a/bfd/doc/syms.texi +++ /dev/null @@ -1,461 +0,0 @@ -@section Symbols -BFD tries to maintain as much symbol information as it can when -it moves information from file to file. BFD passes information -to applications though the @code{asymbol} structure. When the -application requests the symbol table, BFD reads the table in -the native form and translates parts of it into the internal -format. To maintain more than the information passed to -applications, some targets keep some information ``behind the -scenes'' in a structure only the particular back end knows -about. For example, the coff back end keeps the original -symbol table structure as well as the canonical structure when -a BFD is read in. On output, the coff back end can reconstruct -the output symbol table so that no information is lost, even -information unique to coff which BFD doesn't know or -understand. If a coff symbol table were read, but were written -through an a.out back end, all the coff specific information -would be lost. The symbol table of a BFD -is not necessarily read in until a canonicalize request is -made. Then the BFD back end fills in a table provided by the -application with pointers to the canonical information. To -output symbols, the application provides BFD with a table of -pointers to pointers to @code{asymbol}s. This allows applications -like the linker to output a symbol as it was read, since the ``behind -the scenes'' information will be still available. -@menu -* Reading Symbols:: -* Writing Symbols:: -* Mini Symbols:: -* typedef asymbol:: -* symbol handling functions:: -@end menu - -@node Reading Symbols, Writing Symbols, Symbols, Symbols -@subsection Reading symbols -There are two stages to reading a symbol table from a BFD: -allocating storage, and the actual reading process. This is an -excerpt from an application which reads the symbol table: - -@example - long storage_needed; - asymbol **symbol_table; - long number_of_symbols; - long i; - - storage_needed = bfd_get_symtab_upper_bound (abfd); - - if (storage_needed < 0) - FAIL - - if (storage_needed == 0) - return; - - symbol_table = xmalloc (storage_needed); - ... - number_of_symbols = - bfd_canonicalize_symtab (abfd, symbol_table); - - if (number_of_symbols < 0) - FAIL - - for (i = 0; i < number_of_symbols; i++) - process_symbol (symbol_table[i]); -@end example - -All storage for the symbols themselves is in an objalloc -connected to the BFD; it is freed when the BFD is closed. - -@node Writing Symbols, Mini Symbols, Reading Symbols, Symbols -@subsection Writing symbols -Writing of a symbol table is automatic when a BFD open for -writing is closed. The application attaches a vector of -pointers to pointers to symbols to the BFD being written, and -fills in the symbol count. The close and cleanup code reads -through the table provided and performs all the necessary -operations. The BFD output code must always be provided with an -``owned'' symbol: one which has come from another BFD, or one -which has been created using @code{bfd_make_empty_symbol}. Here is an -example showing the creation of a symbol table with only one element: - -@example - #include "bfd.h" - int main (void) - @{ - bfd *abfd; - asymbol *ptrs[2]; - asymbol *new; - - abfd = bfd_openw ("foo","a.out-sunos-big"); - bfd_set_format (abfd, bfd_object); - new = bfd_make_empty_symbol (abfd); - new->name = "dummy_symbol"; - new->section = bfd_make_section_old_way (abfd, ".text"); - new->flags = BSF_GLOBAL; - new->value = 0x12345; - - ptrs[0] = new; - ptrs[1] = 0; - - bfd_set_symtab (abfd, ptrs, 1); - bfd_close (abfd); - return 0; - @} - - ./makesym - nm foo - 00012345 A dummy_symbol -@end example - -Many formats cannot represent arbitrary symbol information; for -instance, the @code{a.out} object format does not allow an -arbitrary number of sections. A symbol pointing to a section -which is not one of @code{.text}, @code{.data} or @code{.bss} cannot -be described. - -@node Mini Symbols, typedef asymbol, Writing Symbols, Symbols -@subsection Mini Symbols -Mini symbols provide read-only access to the symbol table. -They use less memory space, but require more time to access. -They can be useful for tools like nm or objdump, which may -have to handle symbol tables of extremely large executables. - -The @code{bfd_read_minisymbols} function will read the symbols -into memory in an internal form. It will return a @code{void *} -pointer to a block of memory, a symbol count, and the size of -each symbol. The pointer is allocated using @code{malloc}, and -should be freed by the caller when it is no longer needed. - -The function @code{bfd_minisymbol_to_symbol} will take a pointer -to a minisymbol, and a pointer to a structure returned by -@code{bfd_make_empty_symbol}, and return a @code{asymbol} structure. -The return value may or may not be the same as the value from -@code{bfd_make_empty_symbol} which was passed in. - - -@node typedef asymbol, symbol handling functions, Mini Symbols, Symbols -@subsection typedef asymbol -An @code{asymbol} has the form: - - -@example - -typedef struct bfd_symbol -@{ - /* A pointer to the BFD which owns the symbol. This information - is necessary so that a back end can work out what additional - information (invisible to the application writer) is carried - with the symbol. - - This field is *almost* redundant, since you can use section->owner - instead, except that some symbols point to the global sections - bfd_@{abs,com,und@}_section. This could be fixed by making - these globals be per-bfd (or per-target-flavor). FIXME. */ - struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ - - /* The text of the symbol. The name is left alone, and not copied; the - application may not alter it. */ - const char *name; - - /* The value of the symbol. This really should be a union of a - numeric value with a pointer, since some flags indicate that - a pointer to another symbol is stored here. */ - symvalue value; - - /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 - - /* The symbol has local scope; @code{static} in @code{C}. The value - is the offset into the section of the data. */ -#define BSF_LOCAL 0x01 - - /* The symbol has global scope; initialized data in @code{C}. The - value is the offset into the section of the data. */ -#define BSF_GLOBAL 0x02 - - /* The symbol has global scope and is exported. The value is - the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ - - /* A normal C symbol would be one of: - @code{BSF_LOCAL}, @code{BSF_FORT_COMM}, @code{BSF_UNDEFINED} or - @code{BSF_GLOBAL}. */ - - /* The symbol is a debugging record. The value has an arbitrary - meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING 0x08 - - /* The symbol denotes a function entry point. Used in ELF, - perhaps others someday. */ -#define BSF_FUNCTION 0x10 - - /* Used by the linker. */ -#define BSF_KEEP 0x20 -#define BSF_KEEP_G 0x40 - - /* A weak global symbol, overridable without warnings by - a regular global symbol of the same name. */ -#define BSF_WEAK 0x80 - - /* This symbol was created to point to a section, e.g. ELF's - STT_SECTION symbols. */ -#define BSF_SECTION_SYM 0x100 - - /* The symbol used to be a common symbol, but now it is - allocated. */ -#define BSF_OLD_COMMON 0x200 - - /* The default value for common data. */ -#define BFD_FORT_COMM_DEFAULT_VALUE 0 - - /* In some files the type of a symbol sometimes alters its - location in an output file - ie in coff a @code{ISFCN} symbol - which is also @code{C_EXT} symbol appears where it was - declared and not at the end of a section. This bit is set - by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END 0x400 - - /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR 0x800 - - /* Signal that the symbol is a warning symbol. The name is a - warning. The name of the next symbol is the one to warn about; - if a reference is made to a symbol with the same name as the next - symbol, a warning is issued by the linker. */ -#define BSF_WARNING 0x1000 - - /* Signal that the symbol is indirect. This symbol is an indirect - pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT 0x2000 - - /* BSF_FILE marks symbols that contain a file name. This is used - for ELF STT_FILE symbols. */ -#define BSF_FILE 0x4000 - - /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC 0x8000 - - /* The symbol denotes a data object. Used in ELF, and perhaps - others someday. */ -#define BSF_OBJECT 0x10000 - - /* This symbol is a debugging symbol. The value is the offset - into the section of the data. BSF_DEBUGGING should be set - as well. */ -#define BSF_DEBUGGING_RELOC 0x20000 - - /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL 0x40000 - - flagword flags; - - /* A pointer to the section to which this symbol is - relative. This will always be non NULL, there are special - sections for undefined and absolute symbols. */ - struct bfd_section *section; - - /* Back end special data. */ - union - @{ - void *p; - bfd_vma i; - @} - udata; -@} -asymbol; - -@end example - -@node symbol handling functions, , typedef asymbol, Symbols -@subsection Symbol handling functions - - -@findex bfd_get_symtab_upper_bound -@subsubsection @code{bfd_get_symtab_upper_bound} -@strong{Description}@* -Return the number of bytes required to store a vector of pointers -to @code{asymbols} for all the symbols in the BFD @var{abfd}, -including a terminal NULL pointer. If there are no symbols in -the BFD, then return 0. If an error occurs, return -1. -@example -#define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) - -@end example - -@findex bfd_is_local_label -@subsubsection @code{bfd_is_local_label} -@strong{Synopsis} -@example -bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); -@end example -@strong{Description}@* -Return TRUE if the given symbol @var{sym} in the BFD @var{abfd} is -a compiler generated local label, else return FALSE. - -@findex bfd_is_local_label_name -@subsubsection @code{bfd_is_local_label_name} -@strong{Synopsis} -@example -bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); -@end example -@strong{Description}@* -Return TRUE if a symbol with the name @var{name} in the BFD -@var{abfd} is a compiler generated local label, else return -FALSE. This just checks whether the name has the form of a -local label. -@example -#define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) - -@end example - -@findex bfd_is_target_special_symbol -@subsubsection @code{bfd_is_target_special_symbol} -@strong{Synopsis} -@example -bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); -@end example -@strong{Description}@* -Return TRUE iff a symbol @var{sym} in the BFD @var{abfd} is something -special to the particular target represented by the BFD. Such symbols -should normally not be mentioned to the user. -@example -#define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) - -@end example - -@findex bfd_canonicalize_symtab -@subsubsection @code{bfd_canonicalize_symtab} -@strong{Description}@* -Read the symbols from the BFD @var{abfd}, and fills in -the vector @var{location} with pointers to the symbols and -a trailing NULL. -Return the actual number of symbol pointers, not -including the NULL. -@example -#define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) - -@end example - -@findex bfd_set_symtab -@subsubsection @code{bfd_set_symtab} -@strong{Synopsis} -@example -bfd_boolean bfd_set_symtab - (bfd *abfd, asymbol **location, unsigned int count); -@end example -@strong{Description}@* -Arrange that when the output BFD @var{abfd} is closed, -the table @var{location} of @var{count} pointers to symbols -will be written. - -@findex bfd_print_symbol_vandf -@subsubsection @code{bfd_print_symbol_vandf} -@strong{Synopsis} -@example -void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); -@end example -@strong{Description}@* -Print the value and flags of the @var{symbol} supplied to the -stream @var{file}. - -@findex bfd_make_empty_symbol -@subsubsection @code{bfd_make_empty_symbol} -@strong{Description}@* -Create a new @code{asymbol} structure for the BFD @var{abfd} -and return a pointer to it. - -This routine is necessary because each back end has private -information surrounding the @code{asymbol}. Building your own -@code{asymbol} and pointing to it will not create the private -information, and will cause problems later on. -@example -#define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) - -@end example - -@findex _bfd_generic_make_empty_symbol -@subsubsection @code{_bfd_generic_make_empty_symbol} -@strong{Synopsis} -@example -asymbol *_bfd_generic_make_empty_symbol (bfd *); -@end example -@strong{Description}@* -Create a new @code{asymbol} structure for the BFD @var{abfd} -and return a pointer to it. Used by core file routines, -binary back-end and anywhere else where no private info -is needed. - -@findex bfd_make_debug_symbol -@subsubsection @code{bfd_make_debug_symbol} -@strong{Description}@* -Create a new @code{asymbol} structure for the BFD @var{abfd}, -to be used as a debugging symbol. Further details of its use have -yet to be worked out. -@example -#define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) - -@end example - -@findex bfd_decode_symclass -@subsubsection @code{bfd_decode_symclass} -@strong{Description}@* -Return a character corresponding to the symbol -class of @var{symbol}, or '?' for an unknown class. - -@strong{Synopsis} -@example -int bfd_decode_symclass (asymbol *symbol); -@end example -@findex bfd_is_undefined_symclass -@subsubsection @code{bfd_is_undefined_symclass} -@strong{Description}@* -Returns non-zero if the class symbol returned by -bfd_decode_symclass represents an undefined symbol. -Returns zero otherwise. - -@strong{Synopsis} -@example -bfd_boolean bfd_is_undefined_symclass (int symclass); -@end example -@findex bfd_symbol_info -@subsubsection @code{bfd_symbol_info} -@strong{Description}@* -Fill in the basic info about symbol that nm needs. -Additional info may be added by the back-ends after -calling this function. - -@strong{Synopsis} -@example -void bfd_symbol_info (asymbol *symbol, symbol_info *ret); -@end example -@findex bfd_copy_private_symbol_data -@subsubsection @code{bfd_copy_private_symbol_data} -@strong{Synopsis} -@example -bfd_boolean bfd_copy_private_symbol_data - (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); -@end example -@strong{Description}@* -Copy private symbol information from @var{isym} in the BFD -@var{ibfd} to the symbol @var{osym} in the BFD @var{obfd}. -Return @code{TRUE} on success, @code{FALSE} on error. Possible error -returns are: - -@itemize @bullet - -@item -@code{bfd_error_no_memory} - -Not enough memory exists to create private data for @var{osec}. -@end itemize -@example -#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) - -@end example - diff --git a/bfd/doc/targets.texi b/bfd/doc/targets.texi deleted file mode 100644 index a85c8491108..00000000000 --- a/bfd/doc/targets.texi +++ /dev/null @@ -1,551 +0,0 @@ -@section Targets - - -@strong{Description}@* -Each port of BFD to a different machine requires the creation -of a target back end. All the back end provides to the root -part of BFD is a structure containing pointers to functions -which perform certain low level operations on files. BFD -translates the applications's requests through a pointer into -calls to the back end routines. - -When a file is opened with @code{bfd_openr}, its format and -target are unknown. BFD uses various mechanisms to determine -how to interpret the file. The operations performed are: - -@itemize @bullet - -@item -Create a BFD by calling the internal routine -@code{_bfd_new_bfd}, then call @code{bfd_find_target} with the -target string supplied to @code{bfd_openr} and the new BFD pointer. - -@item -If a null target string was provided to @code{bfd_find_target}, -look up the environment variable @code{GNUTARGET} and use -that as the target string. - -@item -If the target string is still @code{NULL}, or the target string is -@code{default}, then use the first item in the target vector -as the target type, and set @code{target_defaulted} in the BFD to -cause @code{bfd_check_format} to loop through all the targets. -@xref{bfd_target}. @xref{Formats}. - -@item -Otherwise, inspect the elements in the target vector -one by one, until a match on target name is found. When found, -use it. - -@item -Otherwise return the error @code{bfd_error_invalid_target} to -@code{bfd_openr}. - -@item -@code{bfd_openr} attempts to open the file using -@code{bfd_open_file}, and returns the BFD. -@end itemize -Once the BFD has been opened and the target selected, the file -format may be determined. This is done by calling -@code{bfd_check_format} on the BFD with a suggested format. -If @code{target_defaulted} has been set, each possible target -type is tried to see if it recognizes the specified format. -@code{bfd_check_format} returns @code{TRUE} when the caller guesses right. -@menu -* bfd_target:: -@end menu - -@node bfd_target, , Targets, Targets - -@subsection bfd_target - - -@strong{Description}@* -This structure contains everything that BFD knows about a -target. It includes things like its byte order, name, and which -routines to call to do various operations. - -Every BFD points to a target structure with its @code{xvec} -member. - -The macros below are used to dispatch to functions through the -@code{bfd_target} vector. They are used in a number of macros further -down in @file{bfd.h}, and are also used when calling various -routines by hand inside the BFD implementation. The @var{arglist} -argument must be parenthesized; it contains all the arguments -to the called function. - -They make the documentation (more) unpleasant to read, so if -someone wants to fix this and not break the above, please do. -@example -#define BFD_SEND(bfd, message, arglist) \ - ((*((bfd)->xvec->message)) arglist) - -#ifdef DEBUG_BFD_SEND -#undef BFD_SEND -#define BFD_SEND(bfd, message, arglist) \ - (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ - ((*((bfd)->xvec->message)) arglist) : \ - (bfd_assert (__FILE__,__LINE__), NULL)) -#endif -@end example -For operations which index on the BFD format: -@example -#define BFD_SEND_FMT(bfd, message, arglist) \ - (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) - -#ifdef DEBUG_BFD_SEND -#undef BFD_SEND_FMT -#define BFD_SEND_FMT(bfd, message, arglist) \ - (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ - (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \ - (bfd_assert (__FILE__,__LINE__), NULL)) -#endif - -@end example -This is the structure which defines the type of BFD this is. The -@code{xvec} member of the struct @code{bfd} itself points here. Each -module that implements access to a different target under BFD, -defines one of these. - -FIXME, these names should be rationalised with the names of -the entry points which call them. Too bad we can't have one -macro to define them both! -@example -enum bfd_flavour -@{ - bfd_target_unknown_flavour, - bfd_target_aout_flavour, - bfd_target_coff_flavour, - bfd_target_ecoff_flavour, - bfd_target_xcoff_flavour, - bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, - bfd_target_tekhex_flavour, - bfd_target_srec_flavour, - bfd_target_ihex_flavour, - bfd_target_som_flavour, - bfd_target_os9k_flavour, - bfd_target_versados_flavour, - bfd_target_msdos_flavour, - bfd_target_ovax_flavour, - bfd_target_evax_flavour, - bfd_target_mmo_flavour, - bfd_target_mach_o_flavour, - bfd_target_pef_flavour, - bfd_target_pef_xlib_flavour, - bfd_target_sym_flavour -@}; - -enum bfd_endian @{ BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN @}; - -/* Forward declaration. */ -typedef struct bfd_link_info _bfd_link_info; - -typedef struct bfd_target -@{ - /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; - - /* The "flavour" of a back end is a general indication about - the contents of a file. */ - enum bfd_flavour flavour; - - /* The order of bytes within the data area of a file. */ - enum bfd_endian byteorder; - - /* The order of bytes within the header parts of a file. */ - enum bfd_endian header_byteorder; - - /* A mask of all the flags which an executable may have set - - from the set @code{BFD_NO_FLAGS}, @code{HAS_RELOC}, ...@code{D_PAGED}. */ - flagword object_flags; - - /* A mask of all the flags which a section may have set - from - the set @code{SEC_NO_FLAGS}, @code{SEC_ALLOC}, ...@code{SET_NEVER_LOAD}. */ - flagword section_flags; - - /* The character normally found at the front of a symbol. - (if any), perhaps `_'. */ - char symbol_leading_char; - - /* The pad character for file names within an archive header. */ - char ar_pad_char; - - /* The maximum number of characters in an archive header. */ - unsigned short ar_max_namelen; - - /* Entries for byte swapping for data. These are different from the - other entry points, since they don't take a BFD as the first argument. - Certain other handlers could do the same. */ - bfd_uint64_t (*bfd_getx64) (const void *); - bfd_int64_t (*bfd_getx_signed_64) (const void *); - void (*bfd_putx64) (bfd_uint64_t, void *); - bfd_vma (*bfd_getx32) (const void *); - bfd_signed_vma (*bfd_getx_signed_32) (const void *); - void (*bfd_putx32) (bfd_vma, void *); - bfd_vma (*bfd_getx16) (const void *); - bfd_signed_vma (*bfd_getx_signed_16) (const void *); - void (*bfd_putx16) (bfd_vma, void *); - - /* Byte swapping for the headers. */ - bfd_uint64_t (*bfd_h_getx64) (const void *); - bfd_int64_t (*bfd_h_getx_signed_64) (const void *); - void (*bfd_h_putx64) (bfd_uint64_t, void *); - bfd_vma (*bfd_h_getx32) (const void *); - bfd_signed_vma (*bfd_h_getx_signed_32) (const void *); - void (*bfd_h_putx32) (bfd_vma, void *); - bfd_vma (*bfd_h_getx16) (const void *); - bfd_signed_vma (*bfd_h_getx_signed_16) (const void *); - void (*bfd_h_putx16) (bfd_vma, void *); - - /* Format dependent routines: these are vectors of entry points - within the target vector structure, one for each format to check. */ - - /* Check the format of a file being read. Return a @code{bfd_target *} or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); - - /* Set the format of a file being written. */ - bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); - - /* Write cached information into a file being written, at @code{bfd_close}. */ - bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *); - -@end example -The general target vector. These vectors are initialized using the -BFD_JUMP_TABLE macros. -@example - - /* Generic entry points. */ -#define BFD_JUMP_TABLE_GENERIC(NAME) \ - NAME##_close_and_cleanup, \ - NAME##_bfd_free_cached_info, \ - NAME##_new_section_hook, \ - NAME##_get_section_contents, \ - NAME##_get_section_contents_in_window - - /* Called when the BFD is being closed to do any necessary cleanup. */ - bfd_boolean (*_close_and_cleanup) (bfd *); - /* Ask the BFD to free all cached information. */ - bfd_boolean (*_bfd_free_cached_info) (bfd *); - /* Called when a new section is created. */ - bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); - /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); - - /* Entry points to copy private data. */ -#define BFD_JUMP_TABLE_COPY(NAME) \ - NAME##_bfd_copy_private_bfd_data, \ - NAME##_bfd_merge_private_bfd_data, \ - _bfd_generic_init_private_section_data, \ - NAME##_bfd_copy_private_section_data, \ - NAME##_bfd_copy_private_symbol_data, \ - NAME##_bfd_copy_private_header_data, \ - NAME##_bfd_set_private_flags, \ - NAME##_bfd_print_private_bfd_data - - /* Called to copy BFD general private data from one object file - to another. */ - bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); - /* Called to merge BFD general private data from one object file - to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); - /* Called to initialize BFD private section data from one object file - to another. */ -#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); - /* Called to copy BFD private section data from one object file - to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); - /* Called to copy BFD private symbol data from one symbol - to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); - /* Called to copy BFD private header data from one object file - to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); - /* Called to set private backend flags. */ - bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); - - /* Called to print private BFD data. */ - bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *); - - /* Core file entry points. */ -#define BFD_JUMP_TABLE_CORE(NAME) \ - NAME##_core_file_failing_command, \ - NAME##_core_file_failing_signal, \ - NAME##_core_file_matches_executable_p - - char * (*_core_file_failing_command) (bfd *); - int (*_core_file_failing_signal) (bfd *); - bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *); - - /* Archive entry points. */ -#define BFD_JUMP_TABLE_ARCHIVE(NAME) \ - NAME##_slurp_armap, \ - NAME##_slurp_extended_name_table, \ - NAME##_construct_extended_name_table, \ - NAME##_truncate_arname, \ - NAME##_write_armap, \ - NAME##_read_ar_hdr, \ - NAME##_openr_next_archived_file, \ - NAME##_get_elt_at_index, \ - NAME##_generic_stat_arch_elt, \ - NAME##_update_armap_timestamp - - bfd_boolean (*_bfd_slurp_armap) (bfd *); - bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); - void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); - void * (*_bfd_read_ar_hdr_fn) (bfd *); - bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) - bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); - int (*_bfd_stat_arch_elt) (bfd *, struct stat *); - bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); - - /* Entry points used for symbols. */ -#define BFD_JUMP_TABLE_SYMBOLS(NAME) \ - NAME##_get_symtab_upper_bound, \ - NAME##_canonicalize_symtab, \ - NAME##_make_empty_symbol, \ - NAME##_print_symbol, \ - NAME##_get_symbol_info, \ - NAME##_bfd_is_local_label_name, \ - NAME##_bfd_is_target_special_symbol, \ - NAME##_get_lineno, \ - NAME##_find_nearest_line, \ - _bfd_generic_find_line, \ - NAME##_find_inliner_info, \ - NAME##_bfd_make_debug_symbol, \ - NAME##_read_minisymbols, \ - NAME##_minisymbol_to_symbol - - long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); - struct bfd_symbol * - (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) - bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); - bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); - alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); - bfd_boolean (*_bfd_find_inliner_info) - (bfd *, const char **, const char **, unsigned int *); - /* Back-door to allow format-aware applications to create debug symbols - while using BFD for everything else. Currently used by the assembler - when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); -#define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); -#define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); - - /* Routines for relocs. */ -#define BFD_JUMP_TABLE_RELOCS(NAME) \ - NAME##_get_reloc_upper_bound, \ - NAME##_canonicalize_reloc, \ - NAME##_bfd_reloc_type_lookup - - long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); - /* See documentation on reloc types. */ - reloc_howto_type * - (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); - - /* Routines used when writing an object file. */ -#define BFD_JUMP_TABLE_WRITE(NAME) \ - NAME##_set_arch_mach, \ - NAME##_set_section_contents - - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); - - /* Routines used by the linker. */ -#define BFD_JUMP_TABLE_LINK(NAME) \ - NAME##_sizeof_headers, \ - NAME##_bfd_get_relocated_section_contents, \ - NAME##_bfd_relax_section, \ - NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ - NAME##_bfd_link_add_symbols, \ - NAME##_bfd_link_just_syms, \ - NAME##_bfd_final_link, \ - NAME##_bfd_link_split_section, \ - NAME##_bfd_gc_sections, \ - NAME##_bfd_merge_sections, \ - NAME##_bfd_is_group_section, \ - NAME##_bfd_discard_group, \ - NAME##_section_already_linked \ - - int (*_bfd_sizeof_headers) (bfd *, bfd_boolean); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); - - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); - - /* Create a hash table for the linker. Different backends store - different information in this table. */ - struct bfd_link_hash_table * - (*_bfd_link_hash_table_create) (bfd *); - - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - - /* Add symbols from this object file into the hash table. */ - bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); - - /* Indicate that we are only retrieving symbol values from this section. */ - void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - - /* Do a link based on the link_order structures attached to each - section of the BFD. */ - bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *); - - /* Should this section be split up into smaller pieces during linking. */ - bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); - - /* Remove sections that are not referenced from the output. */ - bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); - - /* Attempt to merge SEC_MERGE sections. */ - bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); - - /* Is this section a member of a group? */ - bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); - - /* Discard members of a group. */ - bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); - - /* Check if SEC has been already linked during a reloceatable or - final link. */ - void (*_section_already_linked) (bfd *, struct bfd_section *); - - /* Routines to handle dynamic symbols and relocs. */ -#define BFD_JUMP_TABLE_DYNAMIC(NAME) \ - NAME##_get_dynamic_symtab_upper_bound, \ - NAME##_canonicalize_dynamic_symtab, \ - NAME##_get_synthetic_symtab, \ - NAME##_get_dynamic_reloc_upper_bound, \ - NAME##_canonicalize_dynamic_reloc - - /* Get the amount of memory required to hold the dynamic symbols. */ - long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); - /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); - /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); - /* Get the amount of memory required to hold the dynamic relocs. */ - long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); - /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); - -@end example -A pointer to an alternative bfd_target in case the current one is not -satisfactory. This can happen when the target cpu supports both big -and little endian code, and target chosen by the linker has the wrong -endianness. The function open_output() in ld/ldlang.c uses this field -to find an alternative output format that is suitable. -@example - /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; - - /* Data for use by back-end routines, which isn't - generic enough to belong in this structure. */ - const void *backend_data; - -@} bfd_target; - -@end example - -@findex bfd_set_default_target -@subsubsection @code{bfd_set_default_target} -@strong{Synopsis} -@example -bfd_boolean bfd_set_default_target (const char *name); -@end example -@strong{Description}@* -Set the default target vector to use when recognizing a BFD. -This takes the name of the target, which may be a BFD target -name or a configuration triplet. - -@findex bfd_find_target -@subsubsection @code{bfd_find_target} -@strong{Synopsis} -@example -const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); -@end example -@strong{Description}@* -Return a pointer to the transfer vector for the object target -named @var{target_name}. If @var{target_name} is @code{NULL}, choose the -one in the environment variable @code{GNUTARGET}; if that is null or not -defined, then choose the first entry in the target list. -Passing in the string "default" or setting the environment -variable to "default" will cause the first entry in the target -list to be returned, and "target_defaulted" will be set in the -BFD. This causes @code{bfd_check_format} to loop over all the -targets to find the one that matches the file being read. - -@findex bfd_target_list -@subsubsection @code{bfd_target_list} -@strong{Synopsis} -@example -const char ** bfd_target_list (void); -@end example -@strong{Description}@* -Return a freshly malloced NULL-terminated -vector of the names of all the valid BFD targets. Do not -modify the names. - -@findex bfd_seach_for_target -@subsubsection @code{bfd_seach_for_target} -@strong{Synopsis} -@example -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); -@end example -@strong{Description}@* -Return a pointer to the first transfer vector in the list of -transfer vectors maintained by BFD that produces a non-zero -result when passed to the function @var{search_func}. The -parameter @var{data} is passed, unexamined, to the search -function. - diff --git a/bfd/dwarf1.c b/bfd/dwarf1.c index 5d6c1e359e5..d722df37152 100644 --- a/bfd/dwarf1.c +++ b/bfd/dwarf1.c @@ -1,5 +1,5 @@ /* DWARF 1 find nearest line (_bfd_dwarf1_find_nearest_line). - Copyright 1998, 1999, 2000, 2001, 2002, 2004, 2005 + Copyright 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com). @@ -20,8 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libiberty.h" #include "libbfd.h" #include "elf-bfd.h" diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index ae68d188681..411a7154b5e 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -1,6 +1,6 @@ /* DWARF 2 support. Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Adapted from gdb/dwarf2read.c by Gavin Koch of Cygnus Solutions (gavin@cygnus.com). @@ -29,8 +29,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libiberty.h" #include "libbfd.h" #include "elf-bfd.h" @@ -93,8 +93,10 @@ struct dwarf2_debug /* Pointer to the end of the .debug_info section memory buffer. */ bfd_byte *info_ptr_end; - /* Pointer to the section and address of the beginning of the - section. */ + /* Pointer to the bfd, section and address of the beginning of the + section. The bfd might be different than expected because of + gnu_debuglink sections. */ + bfd * bfd; asection *sec; bfd_byte *sec_info_ptr; @@ -874,24 +876,45 @@ concat_filename (struct line_info_table *table, unsigned int file) filename = table->files[file - 1].name; - if (! IS_ABSOLUTE_PATH (filename)) + if (!IS_ABSOLUTE_PATH (filename)) { - char *dirname = (table->files[file - 1].dir - ? table->dirs[table->files[file - 1].dir - 1] - : table->comp_dir); + char *dirname = NULL; + char *subdirname = NULL; + char *name; + size_t len; - /* Not all tools set DW_AT_comp_dir, so dirname may be unknown. - The best we can do is return the filename part. */ - if (dirname != NULL) + if (table->files[file - 1].dir) + subdirname = table->dirs[table->files[file - 1].dir - 1]; + + if (!subdirname || !IS_ABSOLUTE_PATH (subdirname)) + dirname = table->comp_dir; + + if (!dirname) { - unsigned int len = strlen (dirname) + strlen (filename) + 2; - char * name; + dirname = subdirname; + subdirname = NULL; + } + if (!dirname) + return strdup (filename); + + len = strlen (dirname) + strlen (filename) + 2; + + if (subdirname) + { + len += strlen (subdirname) + 1; + name = bfd_malloc (len); + if (name) + sprintf (name, "%s/%s/%s", dirname, subdirname, filename); + } + else + { name = bfd_malloc (len); if (name) sprintf (name, "%s/%s", dirname, filename); - return name; } + + return name; } return strdup (filename); @@ -1117,7 +1140,6 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash) unsigned int line = 1; unsigned int column = 0; int is_stmt = lh.default_is_stmt; - int basic_block = 0; int end_sequence = 0; /* eraxxon@alumni.rice.edu: Against the DWARF2 specs, some compilers generate address sequences that are wildly out of @@ -1142,7 +1164,6 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash) line += lh.line_base + (adj_opcode % lh.line_range); /* Append row to matrix using current values. */ add_line_info (table, address, filename, line, column, 0); - basic_block = 1; if (address < low_pc) low_pc = address; if (address > high_pc) @@ -1214,7 +1235,6 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash) break; case DW_LNS_copy: add_line_info (table, address, filename, line, column, 0); - basic_block = 0; if (address < low_pc) low_pc = address; if (address > high_pc) @@ -1250,7 +1270,6 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash) is_stmt = (!is_stmt); break; case DW_LNS_set_basic_block: - basic_block = 1; break; case DW_LNS_const_add_pc: address += lh.minimum_instruction_length @@ -1625,7 +1644,7 @@ read_rangelist (struct comp_unit *unit, struct arange *arange, bfd_uint64_t offs if (low_pc == -1UL && high_pc != -1UL) base_address = high_pc; else - arange_add (unit->abfd, arange, base_address + low_pc, base_address + high_pc); + arange_add (unit->abfd, arange, base_address + low_pc, base_address + high_pc); } } @@ -1871,8 +1890,7 @@ scan_unit_for_symbols (struct comp_unit *unit) to get to the line number information for the compilation unit. */ static struct comp_unit * -parse_comp_unit (bfd *abfd, - struct dwarf2_debug *stash, +parse_comp_unit (struct dwarf2_debug *stash, bfd_vma unit_length, bfd_byte *info_ptr_unit, unsigned int offset_size) @@ -1890,6 +1908,7 @@ parse_comp_unit (bfd *abfd, bfd_size_type amt; bfd_vma low_pc = 0; bfd_vma high_pc = 0; + bfd *abfd = stash->bfd; version = read_2_bytes (abfd, info_ptr); info_ptr += 2; @@ -2175,17 +2194,14 @@ find_debug_info (bfd *abfd, asection *after_sec) { asection * msec; - if (after_sec) - msec = after_sec->next; - else - msec = abfd->sections; + msec = after_sec != NULL ? after_sec->next : abfd->sections; while (msec) { if (strcmp (msec->name, DWARF2_DEBUG_INFO) == 0) return msec; - if (strncmp (msec->name, GNU_LINKONCE_INFO, strlen (GNU_LINKONCE_INFO)) == 0) + if (CONST_STRNEQ (msec->name, GNU_LINKONCE_INFO)) return msec; msec = msec->next; @@ -2285,11 +2301,293 @@ place_sections (bfd *abfd, struct dwarf2_debug *stash) return TRUE; } -/* The DWARF2 version of find_nearest_line. Return TRUE if the line - is found without error. ADDR_SIZE is the number of bytes in the - initial .debug_info length field and in the abbreviation offset. - You may use zero to indicate that the default value should be - used. */ +/* Find the source code location of SYMBOL. If SYMBOL is NULL + then find the nearest source code location corresponding to + the address SECTION + OFFSET. + Returns TRUE if the line is found without error and fills in + FILENAME_PTR and LINENUMBER_PTR. In the case where SYMBOL was + NULL the FUNCTIONNAME_PTR is also filled in. + SYMBOLS contains the symbol table for ABFD. + ADDR_SIZE is the number of bytes in the initial .debug_info length + field and in the abbreviation offset, or zero to indicate that the + default value should be used. */ + +static bfd_boolean +find_line (bfd *abfd, + asection *section, + bfd_vma offset, + asymbol *symbol, + asymbol **symbols, + const char **filename_ptr, + const char **functionname_ptr, + unsigned int *linenumber_ptr, + unsigned int addr_size, + void **pinfo) +{ + /* Read each compilation unit from the section .debug_info, and check + to see if it contains the address we are searching for. If yes, + lookup the address, and return the line number info. If no, go + on to the next compilation unit. + + We keep a list of all the previously read compilation units, and + a pointer to the next un-read compilation unit. Check the + previously read units before reading more. */ + struct dwarf2_debug *stash; + /* What address are we looking for? */ + bfd_vma addr; + struct comp_unit* each; + bfd_vma found = FALSE; + bfd_boolean do_line; + + stash = *pinfo; + + if (! stash) + { + bfd_size_type amt = sizeof (struct dwarf2_debug); + + stash = bfd_zalloc (abfd, amt); + if (! stash) + return FALSE; + } + + /* In a relocatable file, 2 functions may have the same address. + We change the section vma so that they won't overlap. */ + if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0) + { + if (! place_sections (abfd, stash)) + return FALSE; + } + + do_line = (section == NULL + && offset == 0 + && functionname_ptr == NULL + && symbol != NULL); + if (do_line) + { + addr = symbol->value; + section = bfd_get_section (symbol); + } + else if (section != NULL + && functionname_ptr != NULL + && symbol == NULL) + addr = offset; + else + abort (); + + if (section->output_section) + addr += section->output_section->vma + section->output_offset; + else + addr += section->vma; + *filename_ptr = NULL; + *functionname_ptr = NULL; + *linenumber_ptr = 0; + + if (! *pinfo) + { + bfd *debug_bfd; + bfd_size_type total_size; + asection *msec; + + *pinfo = stash; + + msec = find_debug_info (abfd, NULL); + if (msec == NULL) + { + char * debug_filename = bfd_follow_gnu_debuglink (abfd, DEBUGDIR); + + if (debug_filename == NULL) + /* No dwarf2 info, and no gnu_debuglink to follow. + Note that at this point the stash has been allocated, but + contains zeros. This lets future calls to this function + fail more quickly. */ + goto done; + + if ((debug_bfd = bfd_openr (debug_filename, NULL)) == NULL + || ! bfd_check_format (debug_bfd, bfd_object) + || (msec = find_debug_info (debug_bfd, NULL)) == NULL) + { + if (debug_bfd) + bfd_close (debug_bfd); + /* FIXME: Should we report our failure to follow the debuglink ? */ + free (debug_filename); + goto done; + } + } + else + debug_bfd = abfd; + + /* There can be more than one DWARF2 info section in a BFD these days. + Read them all in and produce one large stash. We do this in two + passes - in the first pass we just accumulate the section sizes. + In the second pass we read in the section's contents. The allows + us to avoid reallocing the data as we add sections to the stash. */ + for (total_size = 0; msec; msec = find_debug_info (debug_bfd, msec)) + total_size += msec->size; + + stash->info_ptr = bfd_alloc (debug_bfd, total_size); + if (stash->info_ptr == NULL) + goto done; + + stash->info_ptr_end = stash->info_ptr; + + for (msec = find_debug_info (debug_bfd, NULL); + msec; + msec = find_debug_info (debug_bfd, msec)) + { + bfd_size_type size; + bfd_size_type start; + + size = msec->size; + if (size == 0) + continue; + + start = stash->info_ptr_end - stash->info_ptr; + + if ((bfd_simple_get_relocated_section_contents + (debug_bfd, msec, stash->info_ptr + start, symbols)) == NULL) + continue; + + stash->info_ptr_end = stash->info_ptr + start + size; + } + + BFD_ASSERT (stash->info_ptr_end == stash->info_ptr + total_size); + + stash->sec = find_debug_info (debug_bfd, NULL); + stash->sec_info_ptr = stash->info_ptr; + stash->syms = symbols; + stash->bfd = debug_bfd; + } + + /* A null info_ptr indicates that there is no dwarf2 info + (or that an error occured while setting up the stash). */ + if (! stash->info_ptr) + goto done; + + stash->inliner_chain = NULL; + + /* Check the previously read comp. units first. */ + for (each = stash->all_comp_units; each; each = each->next_unit) + { + if (do_line) + found = (((symbol->flags & BSF_FUNCTION) == 0 + || comp_unit_contains_address (each, addr)) + && comp_unit_find_line (each, symbol, addr, + filename_ptr, linenumber_ptr, + stash)); + else + found = (comp_unit_contains_address (each, addr) + && comp_unit_find_nearest_line (each, addr, + filename_ptr, + functionname_ptr, + linenumber_ptr, + stash)); + if (found) + goto done; + } + + /* The DWARF2 spec says that the initial length field, and the + offset of the abbreviation table, should both be 4-byte values. + However, some compilers do things differently. */ + if (addr_size == 0) + addr_size = 4; + BFD_ASSERT (addr_size == 4 || addr_size == 8); + + /* Read each remaining comp. units checking each as they are read. */ + while (stash->info_ptr < stash->info_ptr_end) + { + bfd_vma length; + unsigned int offset_size = addr_size; + bfd_byte *info_ptr_unit = stash->info_ptr; + + length = read_4_bytes (stash->bfd, stash->info_ptr); + /* A 0xffffff length is the DWARF3 way of indicating + we use 64-bit offsets, instead of 32-bit offsets. */ + if (length == 0xffffffff) + { + offset_size = 8; + length = read_8_bytes (stash->bfd, stash->info_ptr + 4); + stash->info_ptr += 12; + } + /* A zero length is the IRIX way of indicating 64-bit offsets, + mostly because the 64-bit length will generally fit in 32 + bits, and the endianness helps. */ + else if (length == 0) + { + offset_size = 8; + length = read_4_bytes (stash->bfd, stash->info_ptr + 4); + stash->info_ptr += 8; + } + /* In the absence of the hints above, we assume 32-bit DWARF2 + offsets even for targets with 64-bit addresses, because: + a) most of the time these targets will not have generated + more than 2Gb of debug info and so will not need 64-bit + offsets, + and + b) if they do use 64-bit offsets but they are not using + the size hints that are tested for above then they are + not conforming to the DWARF3 standard anyway. */ + else if (addr_size == 8) + { + offset_size = 4; + stash->info_ptr += 4; + } + else + stash->info_ptr += 4; + + if (length > 0) + { + each = parse_comp_unit (stash, length, info_ptr_unit, + offset_size); + stash->info_ptr += length; + + if ((bfd_vma) (stash->info_ptr - stash->sec_info_ptr) + == stash->sec->size) + { + stash->sec = find_debug_info (stash->bfd, stash->sec); + stash->sec_info_ptr = stash->info_ptr; + } + + if (each) + { + each->next_unit = stash->all_comp_units; + stash->all_comp_units = each; + + /* DW_AT_low_pc and DW_AT_high_pc are optional for + compilation units. If we don't have them (i.e., + unit->high == 0), we need to consult the line info + table to see if a compilation unit contains the given + address. */ + if (do_line) + found = (((symbol->flags & BSF_FUNCTION) == 0 + || each->arange.high == 0 + || comp_unit_contains_address (each, addr)) + && comp_unit_find_line (each, symbol, addr, + filename_ptr, + linenumber_ptr, + stash)); + else + found = ((each->arange.high == 0 + || comp_unit_contains_address (each, addr)) + && comp_unit_find_nearest_line (each, addr, + filename_ptr, + functionname_ptr, + linenumber_ptr, + stash)); + if (found) + goto done; + } + } + } + +done: + if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0) + unset_sections (stash); + + return found; +} + +/* The DWARF2 version of find_nearest_line. + Return TRUE if the line is found without error. */ bfd_boolean _bfd_dwarf2_find_nearest_line (bfd *abfd, @@ -2302,214 +2600,13 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd, unsigned int addr_size, void **pinfo) { - /* Read each compilation unit from the section .debug_info, and check - to see if it contains the address we are searching for. If yes, - lookup the address, and return the line number info. If no, go - on to the next compilation unit. - - We keep a list of all the previously read compilation units, and - a pointer to the next un-read compilation unit. Check the - previously read units before reading more. */ - struct dwarf2_debug *stash; - - /* What address are we looking for? */ - bfd_vma addr; - - struct comp_unit* each; - - bfd_vma found = FALSE; - - stash = *pinfo; - - if (! stash) - { - bfd_size_type amt = sizeof (struct dwarf2_debug); - - stash = bfd_zalloc (abfd, amt); - if (! stash) - return FALSE; - } - - /* In a relocatable file, 2 functions may have the same address. - We change the section vma so that they won't overlap. */ - if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0) - { - if (! place_sections (abfd, stash)) - return FALSE; - } - - addr = offset; - if (section->output_section) - addr += section->output_section->vma + section->output_offset; - else - addr += section->vma; - *filename_ptr = NULL; - *functionname_ptr = NULL; - *linenumber_ptr = 0; - - /* The DWARF2 spec says that the initial length field, and the - offset of the abbreviation table, should both be 4-byte values. - However, some compilers do things differently. */ - if (addr_size == 0) - addr_size = 4; - BFD_ASSERT (addr_size == 4 || addr_size == 8); - - if (! *pinfo) - { - bfd_size_type total_size; - asection *msec; - - *pinfo = stash; - - msec = find_debug_info (abfd, NULL); - if (! msec) - /* No dwarf2 info. Note that at this point the stash - has been allocated, but contains zeros, this lets - future calls to this function fail quicker. */ - goto done; - - /* There can be more than one DWARF2 info section in a BFD these days. - Read them all in and produce one large stash. We do this in two - passes - in the first pass we just accumulate the section sizes. - In the second pass we read in the section's contents. The allows - us to avoid reallocing the data as we add sections to the stash. */ - for (total_size = 0; msec; msec = find_debug_info (abfd, msec)) - total_size += msec->size; - - stash->info_ptr = bfd_alloc (abfd, total_size); - if (stash->info_ptr == NULL) - goto done; - - stash->info_ptr_end = stash->info_ptr; - - for (msec = find_debug_info (abfd, NULL); - msec; - msec = find_debug_info (abfd, msec)) - { - bfd_size_type size; - bfd_size_type start; - - size = msec->size; - if (size == 0) - continue; - - start = stash->info_ptr_end - stash->info_ptr; - - if ((bfd_simple_get_relocated_section_contents - (abfd, msec, stash->info_ptr + start, symbols)) == NULL) - continue; - - stash->info_ptr_end = stash->info_ptr + start + size; - } - - BFD_ASSERT (stash->info_ptr_end == stash->info_ptr + total_size); - - stash->sec = find_debug_info (abfd, NULL); - stash->sec_info_ptr = stash->info_ptr; - stash->syms = symbols; - } - - /* A null info_ptr indicates that there is no dwarf2 info - (or that an error occured while setting up the stash). */ - if (! stash->info_ptr) - goto done; - - stash->inliner_chain = NULL; - - /* Check the previously read comp. units first. */ - for (each = stash->all_comp_units; each; each = each->next_unit) - if (comp_unit_contains_address (each, addr) - && comp_unit_find_nearest_line (each, addr, filename_ptr, - functionname_ptr, - linenumber_ptr, stash)) - { - found = TRUE; - goto done; - } - - /* Read each remaining comp. units checking each as they are read. */ - while (stash->info_ptr < stash->info_ptr_end) - { - bfd_vma length; - unsigned int offset_size = addr_size; - bfd_byte *info_ptr_unit = stash->info_ptr; - - length = read_4_bytes (abfd, stash->info_ptr); - /* A 0xffffff length is the DWARF3 way of indicating we use - 64-bit offsets, instead of 32-bit offsets. */ - if (length == 0xffffffff) - { - offset_size = 8; - length = read_8_bytes (abfd, stash->info_ptr + 4); - stash->info_ptr += 12; - } - /* A zero length is the IRIX way of indicating 64-bit offsets, - mostly because the 64-bit length will generally fit in 32 - bits, and the endianness helps. */ - else if (length == 0) - { - offset_size = 8; - length = read_4_bytes (abfd, stash->info_ptr + 4); - stash->info_ptr += 8; - } - /* In the absence of the hints above, we assume addr_size-sized - offsets, for backward-compatibility with pre-DWARF3 64-bit - platforms. */ - else if (addr_size == 8) - { - length = read_8_bytes (abfd, stash->info_ptr); - stash->info_ptr += 8; - } - else - stash->info_ptr += 4; - - if (length > 0) - { - each = parse_comp_unit (abfd, stash, length, info_ptr_unit, - offset_size); - stash->info_ptr += length; - - if ((bfd_vma) (stash->info_ptr - stash->sec_info_ptr) - == stash->sec->size) - { - stash->sec = find_debug_info (abfd, stash->sec); - stash->sec_info_ptr = stash->info_ptr; - } - - if (each) - { - each->next_unit = stash->all_comp_units; - stash->all_comp_units = each; - - /* DW_AT_low_pc and DW_AT_high_pc are optional for - compilation units. If we don't have them (i.e., - unit->high == 0), we need to consult the line info - table to see if a compilation unit contains the given - address. */ - if ((each->arange.high == 0 - || comp_unit_contains_address (each, addr)) - && comp_unit_find_nearest_line (each, addr, - filename_ptr, - functionname_ptr, - linenumber_ptr, - stash)) - { - found = TRUE; - goto done; - } - } - } - } - -done: - if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0) - unset_sections (stash); - - return found; + return find_line (abfd, section, offset, NULL, symbols, filename_ptr, + functionname_ptr, linenumber_ptr, addr_size, + pinfo); } -/* The DWARF2 version of find_line. Return TRUE if the line is found - without error. */ +/* The DWARF2 version of find_line. + Return TRUE if the line is found without error. */ bfd_boolean _bfd_dwarf2_find_line (bfd *abfd, @@ -2520,213 +2617,9 @@ _bfd_dwarf2_find_line (bfd *abfd, unsigned int addr_size, void **pinfo) { - /* Read each compilation unit from the section .debug_info, and check - to see if it contains the address we are searching for. If yes, - lookup the address, and return the line number info. If no, go - on to the next compilation unit. - - We keep a list of all the previously read compilation units, and - a pointer to the next un-read compilation unit. Check the - previously read units before reading more. */ - struct dwarf2_debug *stash; - - /* What address are we looking for? */ - bfd_vma addr; - - struct comp_unit* each; - - asection *section; - - bfd_boolean found = FALSE; - - section = bfd_get_section (symbol); - - stash = *pinfo; - - if (! stash) - { - bfd_size_type amt = sizeof (struct dwarf2_debug); - - stash = bfd_zalloc (abfd, amt); - if (! stash) - return FALSE; - } - - /* In a relocatable file, 2 functions may have the same address. - We change the section vma so that they won't overlap. */ - if (!stash && (abfd->flags & (EXEC_P | DYNAMIC)) == 0) - { - if (! place_sections (abfd, stash)) - return FALSE; - } - - addr = symbol->value; - if (section->output_section) - addr += section->output_section->vma + section->output_offset; - else - addr += section->vma; - - *filename_ptr = NULL; - *filename_ptr = NULL; - *linenumber_ptr = 0; - - if (! *pinfo) - { - bfd_size_type total_size; - asection *msec; - - *pinfo = stash; - - msec = find_debug_info (abfd, NULL); - if (! msec) - /* No dwarf2 info. Note that at this point the stash - has been allocated, but contains zeros, this lets - future calls to this function fail quicker. */ - goto done; - - /* There can be more than one DWARF2 info section in a BFD these days. - Read them all in and produce one large stash. We do this in two - passes - in the first pass we just accumulate the section sizes. - In the second pass we read in the section's contents. The allows - us to avoid reallocing the data as we add sections to the stash. */ - for (total_size = 0; msec; msec = find_debug_info (abfd, msec)) - total_size += msec->size; - - stash->info_ptr = bfd_alloc (abfd, total_size); - if (stash->info_ptr == NULL) - goto done; - - stash->info_ptr_end = stash->info_ptr; - - for (msec = find_debug_info (abfd, NULL); - msec; - msec = find_debug_info (abfd, msec)) - { - bfd_size_type size; - bfd_size_type start; - - size = msec->size; - if (size == 0) - continue; - - start = stash->info_ptr_end - stash->info_ptr; - - if ((bfd_simple_get_relocated_section_contents - (abfd, msec, stash->info_ptr + start, symbols)) == NULL) - continue; - - stash->info_ptr_end = stash->info_ptr + start + size; - } - - BFD_ASSERT (stash->info_ptr_end == stash->info_ptr + total_size); - - stash->sec = find_debug_info (abfd, NULL); - stash->sec_info_ptr = stash->info_ptr; - stash->syms = symbols; - } - - /* A null info_ptr indicates that there is no dwarf2 info - (or that an error occured while setting up the stash). */ - if (! stash->info_ptr) - goto done; - - stash->inliner_chain = NULL; - - /* Check the previously read comp. units first. */ - for (each = stash->all_comp_units; each; each = each->next_unit) - if ((symbol->flags & BSF_FUNCTION) == 0 - || comp_unit_contains_address (each, addr)) - { - found = comp_unit_find_line (each, symbol, addr, filename_ptr, - linenumber_ptr, stash); - if (found) - goto done; - } - - /* The DWARF2 spec says that the initial length field, and the - offset of the abbreviation table, should both be 4-byte values. - However, some compilers do things differently. */ - if (addr_size == 0) - addr_size = 4; - BFD_ASSERT (addr_size == 4 || addr_size == 8); - - /* Read each remaining comp. units checking each as they are read. */ - while (stash->info_ptr < stash->info_ptr_end) - { - bfd_vma length; - unsigned int offset_size = addr_size; - bfd_byte *info_ptr_unit = stash->info_ptr; - - length = read_4_bytes (abfd, stash->info_ptr); - /* A 0xffffff length is the DWARF3 way of indicating we use - 64-bit offsets, instead of 32-bit offsets. */ - if (length == 0xffffffff) - { - offset_size = 8; - length = read_8_bytes (abfd, stash->info_ptr + 4); - stash->info_ptr += 12; - } - /* A zero length is the IRIX way of indicating 64-bit offsets, - mostly because the 64-bit length will generally fit in 32 - bits, and the endianness helps. */ - else if (length == 0) - { - offset_size = 8; - length = read_4_bytes (abfd, stash->info_ptr + 4); - stash->info_ptr += 8; - } - /* In the absence of the hints above, we assume addr_size-sized - offsets, for backward-compatibility with pre-DWARF3 64-bit - platforms. */ - else if (addr_size == 8) - { - length = read_8_bytes (abfd, stash->info_ptr); - stash->info_ptr += 8; - } - else - stash->info_ptr += 4; - - if (length > 0) - { - each = parse_comp_unit (abfd, stash, length, info_ptr_unit, - offset_size); - stash->info_ptr += length; - - if ((bfd_vma) (stash->info_ptr - stash->sec_info_ptr) - == stash->sec->size) - { - stash->sec = find_debug_info (abfd, stash->sec); - stash->sec_info_ptr = stash->info_ptr; - } - - if (each) - { - each->next_unit = stash->all_comp_units; - stash->all_comp_units = each; - - /* DW_AT_low_pc and DW_AT_high_pc are optional for - compilation units. If we don't have them (i.e., - unit->high == 0), we need to consult the line info - table to see if a compilation unit contains the given - address. */ - found = (((symbol->flags & BSF_FUNCTION) == 0 - || each->arange.high <= 0 - || comp_unit_contains_address (each, addr)) - && comp_unit_find_line (each, symbol, addr, - filename_ptr, - linenumber_ptr, - stash)); - if (found) - goto done; - } - } - } - -done: - if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0) - unset_sections (stash); - - return found; + return find_line (abfd, NULL, 0, symbol, symbols, filename_ptr, + NULL, linenumber_ptr, addr_size, + pinfo); } bfd_boolean @@ -2742,17 +2635,18 @@ _bfd_dwarf2_find_inliner_info (bfd *abfd ATTRIBUTE_UNUSED, if (stash) { struct funcinfo *func = stash->inliner_chain; + if (func && func->caller_func) { *filename_ptr = func->caller_file; *functionname_ptr = func->caller_func->name; *linenumber_ptr = func->caller_line; stash->inliner_chain = func->caller_func; - return (TRUE); + return TRUE; } } - return (FALSE); + return FALSE; } void diff --git a/bfd/ecoff.c b/bfd/ecoff.c index 75e1cc2a398..45cdb1ddb43 100644 --- a/bfd/ecoff.c +++ b/bfd/ecoff.c @@ -1,6 +1,6 @@ /* Generic ECOFF (Extended-COFF) routines. Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Original version by Per Bothner. Full support added by Ian Lance Taylor, ian@cygnus.com. @@ -20,8 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "aout/ar.h" @@ -140,8 +140,7 @@ _bfd_ecoff_mkobject_hook (bfd *abfd, void * filehdr, void * aouthdr) /* Initialize a new section. */ bfd_boolean -_bfd_ecoff_new_section_hook (bfd *abfd ATTRIBUTE_UNUSED, - asection *section) +_bfd_ecoff_new_section_hook (bfd *abfd, asection *section) { unsigned int i; static struct @@ -181,7 +180,7 @@ _bfd_ecoff_new_section_hook (bfd *abfd ATTRIBUTE_UNUSED, uncertain about .init on some systems and I don't know how shared libraries work. */ - return TRUE; + return _bfd_generic_new_section_hook (abfd, section); } /* Determine the machine architecture and type. This is called from @@ -1863,7 +1862,8 @@ _bfd_ecoff_set_arch_mach (bfd *abfd, /* Get the size of the section headers. */ int -_bfd_ecoff_sizeof_headers (bfd *abfd, bfd_boolean reloc ATTRIBUTE_UNUSED) +_bfd_ecoff_sizeof_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { asection *current; int c; @@ -1937,7 +1937,7 @@ ecoff_compute_section_file_positions (bfd *abfd) const bfd_vma round = ecoff_backend (abfd)->round; bfd_size_type amt; - sofar = _bfd_ecoff_sizeof_headers (abfd, FALSE); + sofar = _bfd_ecoff_sizeof_headers (abfd, NULL); file_sofar = sofar; /* Sort the sections by VMA. */ @@ -2358,7 +2358,7 @@ _bfd_ecoff_write_object_contents (bfd *abfd) } if ((abfd->flags & D_PAGED) != 0) - text_size = _bfd_ecoff_sizeof_headers (abfd, FALSE); + text_size = _bfd_ecoff_sizeof_headers (abfd, NULL); else text_size = 0; text_start = 0; @@ -2861,7 +2861,7 @@ _bfd_ecoff_slurp_armap (bfd *abfd) bfd_slurp_armap, but that seems inappropriate since no other target uses this format. Instead, we check directly for a COFF armap. */ - if (strneq (nextname, "/ ", 16)) + if (CONST_STRNEQ (nextname, "/ ")) return bfd_slurp_armap (abfd); /* See if the first element is an armap. */ @@ -3087,7 +3087,7 @@ _bfd_ecoff_write_armap (bfd *abfd, last_elt = current; for (i = 0; i < orl_count; i++) { - unsigned int hash, rehash; + unsigned int hash, rehash = 0; /* Advance firstreal to the file position of this archive element. */ @@ -3097,7 +3097,7 @@ _bfd_ecoff_write_armap (bfd *abfd, { firstreal += arelt_size (current) + sizeof (struct ar_hdr); firstreal += firstreal % 2; - current = current->next; + current = current->archive_next; } while (current != map[i].u.abfd); } @@ -3757,7 +3757,7 @@ ecoff_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info) while (*pundef != NULL) { struct bfd_link_hash_entry *h; - unsigned int hash, rehash; + unsigned int hash, rehash = 0; unsigned int file_offset; const char *name; bfd *element; diff --git a/bfd/ecofflink.c b/bfd/ecofflink.c index 4246e94f393..8ee68e06625 100644 --- a/bfd/ecofflink.c +++ b/bfd/ecofflink.c @@ -1,6 +1,6 @@ /* Routines to link ECOFF debugging information. Copyright 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support, . This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "objalloc.h" @@ -782,7 +782,6 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, fdr_ptr += fdr_add, i++) { FDR fdr; - bfd_vma fdr_adr; bfd_byte *sym_out; bfd_byte *lraw_src; bfd_byte *lraw_end; @@ -799,8 +798,6 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, else (*input_swap->swap_fdr_in) (input_bfd, (PTR) fdr_ptr, &fdr); - fdr_adr = fdr.adr; - /* FIXME: It is conceivable that this FDR points to the .init or .fini section, in which case this will not do the right thing. */ diff --git a/bfd/efi-app-ia32.c b/bfd/efi-app-ia32.c index b186f907ce6..06ed8059870 100644 --- a/bfd/efi-app-ia32.c +++ b/bfd/efi-app-ia32.c @@ -1,5 +1,5 @@ /* BFD back-end for Intel IA-32 EFI application files. - Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2007 Free Software Foundation, Inc. Contributed by David Mosberger This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #define TARGET_SYM bfd_efi_app_ia32_vec #define TARGET_NAME "efi-app-ia32" diff --git a/bfd/efi-app-ia64.c b/bfd/efi-app-ia64.c index c2a77aca55b..b60ca738eda 100644 --- a/bfd/efi-app-ia64.c +++ b/bfd/efi-app-ia64.c @@ -1,5 +1,5 @@ /* BFD back-end for HP/Intel IA-64 EFI application files. - Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2007 Free Software Foundation, Inc. Contributed by David Mosberger This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #define TARGET_SYM bfd_efi_app_ia64_vec #define TARGET_NAME "efi-app-ia64" diff --git a/bfd/efi-app-x86_64.c b/bfd/efi-app-x86_64.c new file mode 100644 index 00000000000..130ba540997 --- /dev/null +++ b/bfd/efi-app-x86_64.c @@ -0,0 +1,34 @@ +/* BFD back-end for Intel64 UEFI application files. + Copyright 2007 Free Software Foundation, Inc. + +This file is part of BFD, the Binary File Descriptor library. + +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 2 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" + +#define TARGET_SYM bfd_efi_app_x86_64_vec +#define TARGET_NAME "efi-app-x86_64" +#define COFF_IMAGE_WITH_PE +#define COFF_WITH_PE +#define COFF_WITH_pep +#define PCRELOFFSET TRUE +#define TARGET_UNDERSCORE '_' +#define COFF_LONG_SECTION_NAMES +#define PEI_TARGET_SUBSYSTEM IMAGE_SUBSYSTEM_EFI_APPLICATION +#define PEI_FORCE_MINIMUM_ALIGNMENT + +#include "coff-x86_64.c" diff --git a/bfd/elf-attrs.c b/bfd/elf-attrs.c new file mode 100644 index 00000000000..d1a64f4bed9 --- /dev/null +++ b/bfd/elf-attrs.c @@ -0,0 +1,628 @@ +/* ELF attributes support (based on ARM EABI attributes). + Copyright 2005, 2006, 2007 + Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + 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 2 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 "elf-bfd.h" + +/* Return the number of bytes needed by I in uleb128 format. */ +static int +uleb128_size (unsigned int i) +{ + int size; + size = 1; + while (i >= 0x80) + { + i >>= 7; + size++; + } + return size; +} + +/* Return TRUE if the attribute has the default value (0/""). */ +static bfd_boolean +is_default_attr (obj_attribute *attr) +{ + if ((attr->type & 1) && attr->i != 0) + return FALSE; + if ((attr->type & 2) && attr->s && *attr->s) + return FALSE; + + return TRUE; +} + +/* Return the size of a single attribute. */ +static bfd_vma +obj_attr_size (int tag, obj_attribute *attr) +{ + bfd_vma size; + + if (is_default_attr (attr)) + return 0; + + size = uleb128_size (tag); + if (attr->type & 1) + size += uleb128_size (attr->i); + if (attr->type & 2) + size += strlen ((char *)attr->s) + 1; + return size; +} + +/* Return the vendor name for a given object attributes section. */ +static const char * +vendor_obj_attr_name (bfd *abfd, int vendor) +{ + return (vendor == OBJ_ATTR_PROC + ? get_elf_backend_data (abfd)->obj_attrs_vendor + : "gnu"); +} + +/* Return the size of the object attributes section for VENDOR + (OBJ_ATTR_PROC or OBJ_ATTR_GNU), or 0 if there are no attributes + for that vendor to record and the vendor is OBJ_ATTR_GNU. */ +static bfd_vma +vendor_obj_attr_size (bfd *abfd, int vendor) +{ + bfd_vma size; + obj_attribute *attr; + obj_attribute_list *list; + int i; + const char *vendor_name = vendor_obj_attr_name (abfd, vendor); + + if (!vendor_name) + return 0; + + attr = elf_known_obj_attributes (abfd)[vendor]; + size = 0; + for (i = 4; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++) + size += obj_attr_size (i, &attr[i]); + + for (list = elf_other_obj_attributes (abfd)[vendor]; + list; + list = list->next) + size += obj_attr_size (list->tag, &list->attr); + + /* NUL 0x1 */ + return ((size || vendor == OBJ_ATTR_PROC) + ? size + 10 + strlen (vendor_name) + : 0); +} + +/* Return the size of the object attributes section. */ +bfd_vma +bfd_elf_obj_attr_size (bfd *abfd) +{ + bfd_vma size; + + size = vendor_obj_attr_size (abfd, OBJ_ATTR_PROC); + size += vendor_obj_attr_size (abfd, OBJ_ATTR_GNU); + + /* 'A' */ + return (size ? size + 1 : 0); +} + +/* Write VAL in uleb128 format to P, returning a pointer to the + following byte. */ +static bfd_byte * +write_uleb128 (bfd_byte *p, unsigned int val) +{ + bfd_byte c; + do + { + c = val & 0x7f; + val >>= 7; + if (val) + c |= 0x80; + *(p++) = c; + } + while (val); + return p; +} + +/* Write attribute ATTR to butter P, and return a pointer to the following + byte. */ +static bfd_byte * +write_obj_attribute (bfd_byte *p, int tag, obj_attribute *attr) +{ + /* Suppress default entries. */ + if (is_default_attr (attr)) + return p; + + p = write_uleb128 (p, tag); + if (attr->type & 1) + p = write_uleb128 (p, attr->i); + if (attr->type & 2) + { + int len; + + len = strlen (attr->s) + 1; + memcpy (p, attr->s, len); + p += len; + } + + return p; +} + +/* Write the contents of the object attributes section (length SIZE) + for VENDOR to CONTENTS. */ +static void +vendor_set_obj_attr_contents (bfd *abfd, bfd_byte *contents, bfd_vma size, + int vendor) +{ + bfd_byte *p; + obj_attribute *attr; + obj_attribute_list *list; + int i; + const char *vendor_name = vendor_obj_attr_name (abfd, vendor); + size_t vendor_length = strlen (vendor_name) + 1; + + p = contents; + bfd_put_32 (abfd, size, p); + p += 4; + memcpy (p, vendor_name, vendor_length); + p += vendor_length; + *(p++) = Tag_File; + bfd_put_32 (abfd, size - 4 - vendor_length, p); + p += 4; + + attr = elf_known_obj_attributes (abfd)[vendor]; + for (i = 4; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++) + p = write_obj_attribute (p, i, &attr[i]); + + for (list = elf_other_obj_attributes (abfd)[vendor]; + list; + list = list->next) + p = write_obj_attribute (p, list->tag, &list->attr); +} + +/* Write the contents of the object attributes section to CONTENTS. */ +void +bfd_elf_set_obj_attr_contents (bfd *abfd, bfd_byte *contents, bfd_vma size) +{ + bfd_byte *p; + int vendor; + bfd_vma my_size; + + p = contents; + *(p++) = 'A'; + my_size = 1; + for (vendor = OBJ_ATTR_FIRST; vendor <= OBJ_ATTR_LAST; vendor++) + { + bfd_vma vendor_size = vendor_obj_attr_size (abfd, vendor); + if (vendor_size) + vendor_set_obj_attr_contents (abfd, p, vendor_size, vendor); + p += vendor_size; + my_size += vendor_size; + } + + if (size != my_size) + abort (); +} + +/* Allocate/find an object attribute. */ +static obj_attribute * +elf_new_obj_attr (bfd *abfd, int vendor, int tag) +{ + obj_attribute *attr; + obj_attribute_list *list; + obj_attribute_list *p; + obj_attribute_list **lastp; + + + if (tag < NUM_KNOWN_OBJ_ATTRIBUTES) + { + /* Knwon tags are preallocated. */ + attr = &elf_known_obj_attributes (abfd)[vendor][tag]; + } + else + { + /* Create a new tag. */ + list = (obj_attribute_list *) + bfd_alloc (abfd, sizeof (obj_attribute_list)); + memset (list, 0, sizeof (obj_attribute_list)); + list->tag = tag; + /* Keep the tag list in order. */ + lastp = &elf_other_obj_attributes (abfd)[vendor]; + for (p = *lastp; p; p = p->next) + { + if (tag < p->tag) + break; + lastp = &p->next; + } + list->next = *lastp; + *lastp = list; + attr = &list->attr; + } + + return attr; +} + +/* Return the value of an integer object attribute. */ +int +bfd_elf_get_obj_attr_int (bfd *abfd, int vendor, int tag) +{ + obj_attribute_list *p; + + if (tag < NUM_KNOWN_OBJ_ATTRIBUTES) + { + /* Knwon tags are preallocated. */ + return elf_known_obj_attributes (abfd)[vendor][tag].i; + } + else + { + for (p = elf_other_obj_attributes (abfd)[vendor]; + p; + p = p->next) + { + if (tag == p->tag) + return p->attr.i; + if (tag < p->tag) + break; + } + return 0; + } +} + +/* Add an integer object attribute. */ +void +bfd_elf_add_obj_attr_int (bfd *abfd, int vendor, int tag, unsigned int i) +{ + obj_attribute *attr; + + attr = elf_new_obj_attr (abfd, vendor, tag); + attr->type = 1; + attr->i = i; +} + +/* Duplicate an object attribute string value. */ +char * +_bfd_elf_attr_strdup (bfd *abfd, const char * s) +{ + char * p; + int len; + + len = strlen (s) + 1; + p = (char *) bfd_alloc (abfd, len); + return memcpy (p, s, len); +} + +/* Add a string object attribute. */ +void +bfd_elf_add_obj_attr_string (bfd *abfd, int vendor, int tag, const char *s) +{ + obj_attribute *attr; + + attr = elf_new_obj_attr (abfd, vendor, tag); + attr->type = 2; + attr->s = _bfd_elf_attr_strdup (abfd, s); +} + +/* Add a Tag_compatibility object attribute. */ +void +bfd_elf_add_obj_attr_compat (bfd *abfd, int vendor, unsigned int i, + const char *s) +{ + obj_attribute_list *list; + obj_attribute_list *p; + obj_attribute_list **lastp; + + list = (obj_attribute_list *) + bfd_alloc (abfd, sizeof (obj_attribute_list)); + memset (list, 0, sizeof (obj_attribute_list)); + list->tag = Tag_compatibility; + list->attr.type = 3; + list->attr.i = i; + list->attr.s = _bfd_elf_attr_strdup (abfd, s); + + lastp = &elf_other_obj_attributes (abfd)[vendor]; + for (p = *lastp; p; p = p->next) + { + int cmp; + if (p->tag != Tag_compatibility) + break; + cmp = strcmp(s, p->attr.s); + if (cmp < 0 || (cmp == 0 && i < p->attr.i)) + break; + lastp = &p->next; + } + list->next = *lastp; + *lastp = list; +} + +/* Copy the object attributes from IBFD to OBFD. */ +void +_bfd_elf_copy_obj_attributes (bfd *ibfd, bfd *obfd) +{ + obj_attribute *in_attr; + obj_attribute *out_attr; + obj_attribute_list *list; + int i; + int vendor; + + for (vendor = OBJ_ATTR_FIRST; vendor <= OBJ_ATTR_LAST; vendor++) + { + in_attr = &elf_known_obj_attributes (ibfd)[vendor][4]; + out_attr = &elf_known_obj_attributes (obfd)[vendor][4]; + for (i = 4; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++) + { + out_attr->type = in_attr->type; + out_attr->i = in_attr->i; + if (in_attr->s && *in_attr->s) + out_attr->s = _bfd_elf_attr_strdup (obfd, in_attr->s); + in_attr++; + out_attr++; + } + + for (list = elf_other_obj_attributes (ibfd)[vendor]; + list; + list = list->next) + { + in_attr = &list->attr; + switch (in_attr->type) + { + case 1: + bfd_elf_add_obj_attr_int (obfd, vendor, list->tag, in_attr->i); + break; + case 2: + bfd_elf_add_obj_attr_string (obfd, vendor, list->tag, + in_attr->s); + break; + case 3: + bfd_elf_add_obj_attr_compat (obfd, vendor, in_attr->i, + in_attr->s); + break; + default: + abort (); + } + } + } +} + +/* Determine whether a GNU object attribute tag takes an integer, a + string or both. */ +static int +gnu_obj_attrs_arg_type (int tag) +{ + /* Except for Tag_compatibility, for GNU attributes we follow the + same rule ARM ones > 32 follow: odd-numbered tags take strings + and even-numbered tags take integers. In addition, tag & 2 is + nonzero for architecture-independent tags and zero for + architecture-dependent ones. */ + if (tag == Tag_compatibility) + return 3; + else + return (tag & 1) != 0 ? 2 : 1; +} + +/* Determine what arguments an attribute tag takes. */ +int +_bfd_elf_obj_attrs_arg_type (bfd *abfd, int vendor, int tag) +{ + switch (vendor) + { + case OBJ_ATTR_PROC: + return get_elf_backend_data (abfd)->obj_attrs_arg_type (tag); + break; + case OBJ_ATTR_GNU: + return gnu_obj_attrs_arg_type (tag); + break; + default: + abort (); + } +} + +/* Parse an object attributes section. */ +void +_bfd_elf_parse_attributes (bfd *abfd, Elf_Internal_Shdr * hdr) +{ + bfd_byte *contents; + bfd_byte *p; + bfd_vma len; + const char *std_section; + + contents = bfd_malloc (hdr->sh_size); + if (!contents) + return; + if (!bfd_get_section_contents (abfd, hdr->bfd_section, contents, 0, + hdr->sh_size)) + { + free (contents); + return; + } + p = contents; + std_section = get_elf_backend_data (abfd)->obj_attrs_vendor; + if (*(p++) == 'A') + { + len = hdr->sh_size - 1; + while (len > 0) + { + int namelen; + bfd_vma section_len; + int vendor; + + section_len = bfd_get_32 (abfd, p); + p += 4; + if (section_len > len) + section_len = len; + len -= section_len; + namelen = strlen ((char *)p) + 1; + section_len -= namelen + 4; + if (std_section && strcmp ((char *)p, std_section) == 0) + vendor = OBJ_ATTR_PROC; + else if (strcmp ((char *)p, "gnu") == 0) + vendor = OBJ_ATTR_GNU; + else + { + /* Other vendor section. Ignore it. */ + p += namelen + section_len; + continue; + } + + p += namelen; + while (section_len > 0) + { + int tag; + unsigned int n; + unsigned int val; + bfd_vma subsection_len; + bfd_byte *end; + + tag = read_unsigned_leb128 (abfd, p, &n); + p += n; + subsection_len = bfd_get_32 (abfd, p); + p += 4; + if (subsection_len > section_len) + subsection_len = section_len; + section_len -= subsection_len; + subsection_len -= n + 4; + end = p + subsection_len; + switch (tag) + { + case Tag_File: + while (p < end) + { + int type; + + tag = read_unsigned_leb128 (abfd, p, &n); + p += n; + type = _bfd_elf_obj_attrs_arg_type (abfd, vendor, tag); + switch (type) + { + case 3: + val = read_unsigned_leb128 (abfd, p, &n); + p += n; + bfd_elf_add_obj_attr_compat (abfd, vendor, val, + (char *)p); + p += strlen ((char *)p) + 1; + break; + case 2: + bfd_elf_add_obj_attr_string (abfd, vendor, tag, + (char *)p); + p += strlen ((char *)p) + 1; + break; + case 1: + val = read_unsigned_leb128 (abfd, p, &n); + p += n; + bfd_elf_add_obj_attr_int (abfd, vendor, tag, val); + break; + default: + abort (); + } + } + break; + case Tag_Section: + case Tag_Symbol: + /* Don't have anywhere convenient to attach these. + Fall through for now. */ + default: + /* Ignore things we don't kow about. */ + p += subsection_len; + subsection_len = 0; + break; + } + } + } + } + free (contents); +} + +/* Merge common object attributes from IBFD into OBFD. Raise an error + if there are conflicting attributes. Any processor-specific + attributes have already been merged. This must be called from the + bfd_elfNN_bfd_merge_private_bfd_data hook for each individual + target, along with any target-specific merging. Because there are + no common attributes other than Tag_compatibility at present, and + non-"gnu" Tag_compatibility is not expected in "gnu" sections, this + is not presently called for targets without their own + attributes. */ + +bfd_boolean +_bfd_elf_merge_object_attributes (bfd *ibfd, bfd *obfd) +{ + obj_attribute *in_attr; + obj_attribute *out_attr; + obj_attribute_list *in_list; + obj_attribute_list *out_list; + int vendor; + + /* The only common attribute is currently Tag_compatibility, + accepted in both processor and "gnu" sections. */ + for (vendor = OBJ_ATTR_FIRST; vendor <= OBJ_ATTR_LAST; vendor++) + { + in_list = elf_other_obj_attributes (ibfd)[vendor]; + out_list = elf_other_obj_attributes (ibfd)[vendor]; + while (in_list && in_list->tag == Tag_compatibility) + { + in_attr = &in_list->attr; + if (in_attr->i == 0) + continue; + if (in_attr->i == 1 && strcmp (in_attr->s, "gnu") != 0) + { + _bfd_error_handler + (_("ERROR: %B: Must be processed by '%s' toolchain"), + ibfd, in_attr->s); + return FALSE; + } + if (!out_list || out_list->tag != Tag_compatibility + || strcmp (in_attr->s, out_list->attr.s) != 0) + { + /* Add this compatibility tag to the output. */ + bfd_elf_add_proc_attr_compat (obfd, in_attr->i, in_attr->s); + continue; + } + out_attr = &out_list->attr; + /* Check all the input tags with the same identifier. */ + for (;;) + { + if (out_list->tag != Tag_compatibility + || in_attr->i != out_attr->i + || strcmp (in_attr->s, out_attr->s) != 0) + { + _bfd_error_handler + (_("ERROR: %B: Incompatible object tag '%s':%d"), + ibfd, in_attr->s, in_attr->i); + return FALSE; + } + in_list = in_list->next; + if (in_list->tag != Tag_compatibility + || strcmp (in_attr->s, in_list->attr.s) != 0) + break; + in_attr = &in_list->attr; + out_list = out_list->next; + if (out_list) + out_attr = &out_list->attr; + } + + /* Check the output doesn't have extra tags with this identifier. */ + if (out_list && out_list->tag == Tag_compatibility + && strcmp (in_attr->s, out_list->attr.s) == 0) + { + _bfd_error_handler + (_("ERROR: %B: Incompatible object tag '%s':%d"), + ibfd, in_attr->s, out_list->attr.i); + return FALSE; + } + } + } + + return TRUE; +} diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 3fba1c228f0..f4c3a0a3203 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1,6 +1,6 @@ /* BFD back-end data structures for ELF files. Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -155,6 +155,8 @@ struct elf_link_hash_entry unsigned int hidden : 1; /* Symbol was forced to local scope due to a version script file. */ unsigned int forced_local : 1; + /* Symbol was forced to be dynamic due to a version script file. */ + unsigned int dynamic : 1; /* Symbol was marked during garbage collection. */ unsigned int mark : 1; /* Symbol is referenced by a non-GOT/non-PLT relocation. This is @@ -259,31 +261,6 @@ struct elf_link_loaded_list }; /* Structures used by the eh_frame optimization code. */ -struct cie_header -{ - unsigned int length; - unsigned int id; -}; - -struct cie -{ - struct cie_header hdr; - unsigned char version; - char augmentation[20]; - bfd_vma code_align; - bfd_signed_vma data_align; - bfd_vma ra_column; - bfd_vma augmentation_size; - struct elf_link_hash_entry *personality; - unsigned char per_encoding; - unsigned char lsda_encoding; - unsigned char fde_encoding; - unsigned char initial_insn_length; - unsigned char make_relative; - unsigned char make_lsda_relative; - unsigned char initial_instructions[50]; -}; - struct eh_cie_fde { /* For FDEs, this points to the CIE used. */ @@ -302,12 +279,12 @@ struct eh_cie_fde unsigned int make_lsda_relative : 1; unsigned int need_lsda_relative : 1; unsigned int per_encoding_relative : 1; + unsigned int *set_loc; }; struct eh_frame_sec_info { unsigned int count; - unsigned int alloced; struct eh_cie_fde entry[1]; }; @@ -317,11 +294,11 @@ struct eh_frame_array_ent bfd_vma fde; }; +struct htab; + struct eh_frame_hdr_info { - struct cie last_cie; - asection *last_cie_sec; - struct eh_cie_fde *last_cie_inf; + struct htab *cies; asection *hdr_sec; unsigned int fde_count, array_count; struct eh_frame_array_ent *array; @@ -342,6 +319,10 @@ struct elf_link_hash_table when linking against or generating a shared object. */ bfd_boolean dynamic_sections_created; + /* True if this target has relocatable executables, so needs dynamic + section symbols. */ + bfd_boolean is_relocatable_executable; + /* The BFD used to hold special sections created by the linker. This will be the first BFD found which requires these sections to be created. */ @@ -375,6 +356,12 @@ struct elf_link_hash_table included in the link. */ struct bfd_link_needed_list *needed; + /* Sections in the output bfd that provides a section symbol + to be used by relocations emitted against local symbols. + Most targets will not use data_index_section. */ + asection *text_index_section; + asection *data_index_section; + /* The _GLOBAL_OFFSET_TABLE_ symbol. */ struct elf_link_hash_entry *hgot; @@ -403,10 +390,6 @@ struct elf_link_hash_table /* A linked list of BFD's loaded in the link. */ struct elf_link_loaded_list *loaded; - - /* True if this target has relocatable executables, so needs dynamic - section symbols. */ - bfd_boolean is_relocatable_executable; }; /* Look up an entry in an ELF linker hash table. */ @@ -466,7 +449,7 @@ struct elf_size_info { (*write_shdrs_and_ehdr) (bfd *); void (*write_relocs) (bfd *, asection *, void *); - void (*swap_symbol_in) + bfd_boolean (*swap_symbol_in) (bfd *, const void *, const void *, Elf_Internal_Sym *); void (*swap_symbol_out) (bfd *, const Elf_Internal_Sym *, void *, void *); @@ -555,6 +538,10 @@ enum action_discarded PRETEND = 2 }; +typedef asection * (*elf_gc_mark_hook_fn) + (asection *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *); + struct elf_backend_data { /* The architecture for this backend. */ @@ -563,6 +550,9 @@ struct elf_backend_data /* The ELF machine code (EM_xxxx) for this backend. */ int elf_machine_code; + /* EI_OSABI. */ + int elf_osabi; + /* The maximum page size for this backend. */ bfd_vma maxpagesize; @@ -571,6 +561,9 @@ struct elf_backend_data pages at least this large. May be smaller than maxpagesize. */ bfd_vma minpagesize; + /* The common page size for this backend. */ + bfd_vma commonpagesize; + /* The BFD flags applied to sections created for dynamic linking. */ flagword dynamic_sec_flags; @@ -725,6 +718,13 @@ struct elf_backend_data bfd_boolean (*check_directives) (bfd *abfd, struct bfd_link_info *info); + /* The AS_NEEDED_CLEANUP function is called once per --as-needed + input file that was not needed by the add_symbols phase of the + ELF backend linker. The function must undo any target specific + changes in the symbol hash table. */ + bfd_boolean (*as_needed_cleanup) + (bfd *abfd, struct bfd_link_info *info); + /* The ADJUST_DYNAMIC_SYMBOL function is called by the ELF backend linker for every symbol which is defined by a dynamic object and referenced by a regular object. This is called after all the @@ -760,6 +760,11 @@ struct elf_backend_data bfd_boolean (*elf_backend_size_dynamic_sections) (bfd *output_bfd, struct bfd_link_info *info); + /* Set TEXT_INDEX_SECTION and DATA_INDEX_SECTION, the output sections + we keep to use as a base for relocs and symbols. */ + void (*elf_backend_init_index_section) + (bfd *output_bfd, struct bfd_link_info *info); + /* The RELOCATE_SECTION function is called by the ELF backend linker to handle the relocations for a section. @@ -787,8 +792,11 @@ struct elf_backend_data STB_LOCAL/STT_SECTION symbols specially. The output symbol is going to be the section symbol corresponding to the output section, which means that the addend must be adjusted - accordingly. */ - bfd_boolean (*elf_backend_relocate_section) + accordingly. + + Returns FALSE on error, TRUE on success, 2 if successful and + relocations should be written for this section. */ + int (*elf_backend_relocate_section) (bfd *output_bfd, struct bfd_link_info *info, bfd *input_bfd, asection *input_section, bfd_byte *contents, Elf_Internal_Rela *relocs, Elf_Internal_Sym *local_syms, asection **local_sections); @@ -826,13 +834,18 @@ struct elf_backend_data return the number of additional program segments which this BFD will need. It should return -1 on error. */ int (*elf_backend_additional_program_headers) - (bfd *); + (bfd *, struct bfd_link_info *); /* This function is called to modify an existing segment map in a backend specific fashion. */ bfd_boolean (*elf_backend_modify_segment_map) (bfd *, struct bfd_link_info *); + /* This function is called to modify program headers just before + they are written. */ + bfd_boolean (*elf_backend_modify_program_headers) + (bfd *, struct bfd_link_info *); + /* This function is called during section garbage collection to mark sections that define global symbols. */ bfd_boolean (*gc_mark_dynamic_ref) @@ -840,9 +853,12 @@ struct elf_backend_data /* This function is called during section gc to discover the section a particular relocation refers to. */ - asection * (*gc_mark_hook) - (asection *sec, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *h, Elf_Internal_Sym *); + elf_gc_mark_hook_fn gc_mark_hook; + + /* This function, if defined, is called after the first gc marking pass + to allow the backend to mark additional sections. */ + bfd_boolean (*gc_mark_extra_sections) + (struct bfd_link_info *info, elf_gc_mark_hook_fn gc_mark_hook); /* This function, if defined, is called during the sweep phase of gc in order that a backend might update any data structures it might @@ -865,8 +881,16 @@ struct elf_backend_data /* This function, if defined, is called after all local symbols and global symbols converted to locals are emitted into the symtab - section. It allows the backend to emit special global symbols + section. It allows the backend to emit special local symbols not handled in the hash table. */ + bfd_boolean (*elf_backend_output_arch_local_syms) + (bfd *, struct bfd_link_info *, void *, + bfd_boolean (*) (void *, const char *, Elf_Internal_Sym *, asection *, + struct elf_link_hash_entry *)); + + /* This function, if defined, is called after all symbols are emitted + into the symtab section. It allows the backend to emit special + global symbols not handled in the hash table. */ bfd_boolean (*elf_backend_output_arch_syms) (bfd *, struct bfd_link_info *, void *, bfd_boolean (*) (void *, const char *, Elf_Internal_Sym *, asection *, @@ -913,15 +937,19 @@ struct elf_backend_data (asection *, Elf_Internal_Rela *); /* This function, if defined, is called when an NT_PRSTATUS note is found - in a core file. */ + in a core file. */ bfd_boolean (*elf_backend_grok_prstatus) (bfd *, Elf_Internal_Note *); /* This function, if defined, is called when an NT_PSINFO or NT_PRPSINFO - note is found in a core file. */ + note is found in a core file. */ bfd_boolean (*elf_backend_grok_psinfo) (bfd *, Elf_Internal_Note *); + /* This function, if defined, is called to write a note to a corefile. */ + char *(*elf_backend_write_core_note) + (bfd *abfd, char *buf, int *bufsiz, int note_type, ...); + /* Functions to print VMAs. Special code to handle 64 bit ELF files. */ void (* elf_backend_sprintf_vma) (bfd *, char *, bfd_vma); @@ -974,7 +1002,7 @@ struct elf_backend_data /* This function, if defined, may write out the given section. Returns TRUE if it did so and FALSE if the caller should. */ bfd_boolean (*elf_backend_write_section) - (bfd *, asection *, bfd_byte *); + (bfd *, struct bfd_link_info *, asection *, bfd_byte *); /* The level of IRIX compatibility we're striving for. MIPS ELF specific function. */ @@ -1022,6 +1050,12 @@ struct elf_backend_data bfd_boolean *, bfd_boolean *, bfd *, asection **); + /* Return TRUE if symbol should be hashed in the `.gnu.hash' section. */ + bfd_boolean (*elf_hash_symbol) (struct elf_link_hash_entry *); + + /* Return TRUE if type is a function symbol type. */ + bfd_boolean (*is_function_type) (unsigned int type); + /* Used to handle bad SHF_LINK_ORDER input. */ bfd_error_handler_type link_order_error_handler; @@ -1041,6 +1075,19 @@ struct elf_backend_data so-called reserved entries on some systems. */ bfd_vma got_header_size; + /* The vendor name to use for a processor-standard attributes section. */ + const char *obj_attrs_vendor; + + /* The section name to use for a processor-standard attributes section. */ + const char *obj_attrs_section; + + /* Return 1, 2 or 3 to indicate what type of arguments a + processor-specific tag takes. */ + int (*obj_attrs_arg_type) (int); + + /* The section type to use for an attributes section. */ + unsigned int obj_attrs_section_type; + /* This is TRUE if the linker should act like collect and gather global constructors and destructors by name. This is TRUE for MIPS ELF because the Irix 5 tools can not handle the .init @@ -1088,10 +1135,17 @@ struct elf_backend_data unsigned can_refcount : 1; unsigned want_got_sym : 1; unsigned want_dynbss : 1; - /* Targets which do not support physical addressing often require - that the p_paddr field in the section header to be set to zero. - This field indicates whether this behavior is required. */ + + /* Targets which do not support physical addressing often require + that the p_paddr field in the section header to be set to zero. + This field indicates whether this behavior is required. */ unsigned want_p_paddr_set_to_zero : 1; + + /* True if an object file lacking a .note.GNU-stack section + should be assumed to be requesting exec stack. At least one + other file in the link needs to have a .note.GNU-stack section + for a PT_GNU_STACK segment to be created. */ + unsigned default_execstack : 1; }; /* Information stored for each BFD section in an ELF file. This @@ -1160,12 +1214,12 @@ struct bfd_elf_section_data struct bfd_symbol *id; } group; - /* Optional information about section group; NULL if it doesn't - belongs to any section group. */ + /* For a member of a group, points to the SHT_GROUP section. + NULL for the SHT_GROUP section itself and non-group sections. */ asection *sec_group; - /* A linked list of sections in the group. Circular when used by - the linker. */ + /* A linked list of member sections in the group. Circular when used by + the linker. For the SHT_GROUP section, points at first member. */ asection *next_in_group; /* A pointer used for various section optimizations. */ @@ -1181,15 +1235,11 @@ struct bfd_elf_section_data #define elf_next_in_group(sec) (elf_section_data(sec)->next_in_group) #define elf_sec_group(sec) (elf_section_data(sec)->sec_group) -/* Return TRUE if section has been discarded. */ -#define elf_discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != ELF_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != ELF_INFO_TYPE_JUST_SYMS) +#define xvec_get_elf_backend_data(xvec) \ + ((struct elf_backend_data *) (xvec)->backend_data) #define get_elf_backend_data(abfd) \ - ((const struct elf_backend_data *) (abfd)->xvec->backend_data) + xvec_get_elf_backend_data ((abfd)->xvec) /* This struct is used to pass information to routines called via elf_link_hash_traverse which must return failure. */ @@ -1231,6 +1281,46 @@ struct elf_find_verdep_info bfd_boolean failed; }; +/* The maximum number of known object attributes for any target. */ +#define NUM_KNOWN_OBJ_ATTRIBUTES 32 + +/* The value of an object attribute. type & 1 indicates whether there + is an integer value; type & 2 indicates whether there is a string + value. */ + +typedef struct obj_attribute +{ + int type; + unsigned int i; + char *s; +} obj_attribute; + +typedef struct obj_attribute_list +{ + struct obj_attribute_list *next; + int tag; + obj_attribute attr; +} obj_attribute_list; + +/* Object attributes may either be defined by the processor ABI, index + OBJ_ATTR_PROC in the *_obj_attributes arrays, or be GNU-specific + (and possibly also processor-specific), index OBJ_ATTR_GNU. */ +#define OBJ_ATTR_PROC 0 +#define OBJ_ATTR_GNU 1 +#define OBJ_ATTR_FIRST OBJ_ATTR_PROC +#define OBJ_ATTR_LAST OBJ_ATTR_GNU + +/* The following object attribute tags are taken as generic, for all + targets and for "gnu" where there is no target standard. */ +enum +{ + Tag_NULL = 0, + Tag_File = 1, + Tag_Section = 2, + Tag_Symbol = 3, + Tag_compatibility = 32 +}; + /* Some private data is stashed away for future use using the tdata pointer in the bfd structure. */ @@ -1317,6 +1407,7 @@ struct elf_obj_tdata MIPS ELF linker. FIXME: We should figure out some way to only include this field for a MIPS ELF target. */ asection **local_stubs; + asection **local_call_stubs; /* Used to determine if PT_GNU_EH_FRAME segment header should be created. */ @@ -1368,6 +1459,12 @@ struct elf_obj_tdata /* Used to determine if the e_flags field has been initialized */ bfd_boolean flags_init; + + /* Symbol buffer. */ + void *symbuf; + + obj_attribute known_obj_attributes[2][NUM_KNOWN_OBJ_ATTRIBUTES]; + obj_attribute_list *other_obj_attributes[2]; }; #define elf_tdata(bfd) ((bfd) -> tdata.elf_obj_data) @@ -1397,6 +1494,12 @@ struct elf_obj_tdata #define elf_dyn_lib_class(bfd) (elf_tdata(bfd) -> dyn_lib_class) #define elf_bad_symtab(bfd) (elf_tdata(bfd) -> bad_symtab) #define elf_flags_init(bfd) (elf_tdata(bfd) -> flags_init) +#define elf_known_obj_attributes(bfd) (elf_tdata (bfd) -> known_obj_attributes) +#define elf_other_obj_attributes(bfd) (elf_tdata (bfd) -> other_obj_attributes) +#define elf_known_obj_attributes_proc(bfd) \ + (elf_known_obj_attributes (bfd) [OBJ_ATTR_PROC]) +#define elf_other_obj_attributes_proc(bfd) \ + (elf_other_obj_attributes (bfd) [OBJ_ATTR_PROC]) extern void _bfd_elf_swap_verdef_in (bfd *, const Elf_External_Verdef *, Elf_Internal_Verdef *); @@ -1462,6 +1565,8 @@ extern bfd_vma _bfd_elf_section_offset extern unsigned long bfd_elf_hash (const char *); +extern unsigned long bfd_elf_gnu_hash + (const char *); extern bfd_reloc_status_type bfd_elf_generic_reloc (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); @@ -1500,11 +1605,11 @@ extern bfd_boolean _bfd_elf_match_sections_by_type extern bfd_boolean bfd_elf_is_group_section (bfd *, const struct bfd_section *); extern void _bfd_elf_section_already_linked - (bfd *, struct bfd_section *); + (bfd *, struct bfd_section *, struct bfd_link_info *); extern void bfd_elf_set_group_contents (bfd *, asection *, void *); extern asection *_bfd_elf_check_kept_section - (asection *); + (asection *, struct bfd_link_info *); extern void _bfd_elf_link_just_syms (asection *, struct bfd_link_info *); extern bfd_boolean _bfd_elf_copy_private_header_data @@ -1562,7 +1667,7 @@ extern bfd_boolean _bfd_elf_find_inliner_info #define _bfd_elf_read_minisymbols _bfd_generic_read_minisymbols #define _bfd_elf_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol extern int _bfd_elf_sizeof_headers - (bfd *, bfd_boolean); + (bfd *, struct bfd_link_info *); extern bfd_boolean _bfd_elf_new_section_hook (bfd *, asection *); extern bfd_boolean _bfd_elf_init_reloc_shdr @@ -1632,6 +1737,8 @@ extern bfd_boolean _bfd_elf_merge_symbol struct elf_link_hash_entry **, bfd_boolean *, bfd_boolean *, bfd_boolean *, bfd_boolean *); +extern bfd_boolean _bfd_elf_hash_symbol (struct elf_link_hash_entry *); + extern bfd_boolean _bfd_elf_add_default_symbol (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, const char *, Elf_Internal_Sym *, asection **, bfd_vma *, @@ -1668,6 +1775,10 @@ extern bfd_boolean _bfd_elf_create_got_section (bfd *, struct bfd_link_info *); extern struct elf_link_hash_entry *_bfd_elf_define_linkage_sym (bfd *, struct bfd_link_info *, asection *, const char *); +extern void _bfd_elf_init_1_index_section + (bfd *, struct bfd_link_info *); +extern void _bfd_elf_init_2_index_sections + (bfd *, struct bfd_link_info *); extern bfd_boolean _bfd_elfcore_make_pseudosection (bfd *, char *, size_t, ufile_ptr); @@ -1690,6 +1801,9 @@ extern bfd_boolean _bfd_elf_fix_symbol_flags extern bfd_boolean _bfd_elf_adjust_dynamic_symbol (struct elf_link_hash_entry *, void *); +extern bfd_boolean _bfd_elf_adjust_dynamic_copy + (struct elf_link_hash_entry *, asection *); + extern bfd_boolean _bfd_elf_link_sec_merge_syms (struct elf_link_hash_entry *, void *); @@ -1700,11 +1814,23 @@ extern bfd_boolean _bfd_elf_symbol_refs_local_p (struct elf_link_hash_entry *, struct bfd_link_info *, bfd_boolean); extern bfd_boolean bfd_elf_match_symbols_in_sections - (asection *sec1, asection *sec2); + (asection *, asection *, struct bfd_link_info *); + +extern void bfd_elf_perform_complex_relocation + (bfd * output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info * info, + bfd * input_bfd, + asection * input_section, + bfd_byte * contents, + Elf_Internal_Rela * rel, + Elf_Internal_Sym * local_syms, + asection ** local_sections); extern bfd_boolean _bfd_elf_setup_sections (bfd *); +extern void _bfd_elf_set_osabi (bfd * , struct bfd_link_info *); + extern const bfd_target *bfd_elf32_object_p (bfd *); extern const bfd_target *bfd_elf32_core_file_p @@ -1716,7 +1842,7 @@ extern int bfd_elf32_core_file_failing_signal extern bfd_boolean bfd_elf32_core_file_matches_executable_p (bfd *, bfd *); -extern void bfd_elf32_swap_symbol_in +extern bfd_boolean bfd_elf32_swap_symbol_in (bfd *, const void *, const void *, Elf_Internal_Sym *); extern void bfd_elf32_swap_symbol_out (bfd *, const Elf_Internal_Sym *, void *, void *); @@ -1758,7 +1884,7 @@ extern int bfd_elf64_core_file_failing_signal extern bfd_boolean bfd_elf64_core_file_matches_executable_p (bfd *, bfd *); -extern void bfd_elf64_swap_symbol_in +extern bfd_boolean bfd_elf64_swap_symbol_in (bfd *, const void *, const void *, Elf_Internal_Sym *); extern void bfd_elf64_swap_symbol_out (bfd *, const Elf_Internal_Sym *, void *, void *); @@ -1802,6 +1928,10 @@ extern bfd_boolean bfd_elf_link_record_dynamic_symbol extern int bfd_elf_link_record_local_dynamic_symbol (struct bfd_link_info *, bfd *, long); +extern void bfd_elf_link_mark_dynamic_symbol + (struct bfd_link_info *, struct elf_link_hash_entry *, + Elf_Internal_Sym *); + extern bfd_boolean _bfd_elf_close_and_cleanup (bfd *); @@ -1836,6 +1966,10 @@ extern bfd_boolean bfd_elf_gc_record_vtinherit extern bfd_boolean bfd_elf_gc_record_vtentry (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma); +extern asection *_bfd_elf_gc_mark_hook + (asection *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *); + extern bfd_boolean _bfd_elf_gc_mark (struct bfd_link_info *, asection *, asection * (*) (asection *, struct bfd_link_info *, Elf_Internal_Rela *, @@ -1850,10 +1984,14 @@ extern bfd_boolean bfd_elf_gc_common_final_link extern bfd_boolean bfd_elf_reloc_symbol_deleted_p (bfd_vma, void *); -extern struct elf_segment_map * -_bfd_elf_make_dynamic_segment +extern struct elf_segment_map * _bfd_elf_make_dynamic_segment (bfd *, asection *); +extern bfd_boolean _bfd_elf_map_sections_to_segments + (bfd *, struct bfd_link_info *); + +extern bfd_boolean _bfd_elf_is_function_type (unsigned int); + /* Exported interface for writing elf corefile notes. */ extern char *elfcore_write_note (bfd *, char *, int *, const char *, int, const void *, int); @@ -1877,6 +2015,26 @@ extern bfd *_bfd_elf64_bfd_from_remote_memory (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, int (*target_read_memory) (bfd_vma, bfd_byte *, int)); +extern bfd_vma bfd_elf_obj_attr_size (bfd *); +extern void bfd_elf_set_obj_attr_contents (bfd *, bfd_byte *, bfd_vma); +extern int bfd_elf_get_obj_attr_int (bfd *, int, int); +extern void bfd_elf_add_obj_attr_int (bfd *, int, int, unsigned int); +#define bfd_elf_add_proc_attr_int(BFD, TAG, VALUE) \ + bfd_elf_add_obj_attr_int ((BFD), OBJ_ATTR_PROC, (TAG), (VALUE)) +extern void bfd_elf_add_obj_attr_string (bfd *, int, int, const char *); +#define bfd_elf_add_proc_attr_string(BFD, TAG, VALUE) \ + bfd_elf_add_obj_attr_string ((BFD), OBJ_ATTR_PROC, (TAG), (VALUE)) +extern void bfd_elf_add_obj_attr_compat (bfd *, int, unsigned int, + const char *); +#define bfd_elf_add_proc_attr_compat(BFD, INTVAL, STRVAL) \ + bfd_elf_add_obj_attr_compat ((BFD), OBJ_ATTR_PROC, (INTVAL), (STRVAL)) + +extern char *_bfd_elf_attr_strdup (bfd *, const char *); +extern void _bfd_elf_copy_obj_attributes (bfd *, bfd *); +extern int _bfd_elf_obj_attrs_arg_type (bfd *, int, int); +extern void _bfd_elf_parse_attributes (bfd *, Elf_Internal_Shdr *); +extern bfd_boolean _bfd_elf_merge_object_attributes (bfd *, bfd *); + /* Large common section. */ extern asection _bfd_elf_large_com_section; @@ -1936,7 +2094,7 @@ extern bfd_boolean _sh_elf_set_mach_from_flags else if (info->unresolved_syms_in_objects == RM_IGNORE \ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) \ ; \ - else \ + else if (!info->relocatable) \ { \ bfd_boolean err; \ err = (info->unresolved_syms_in_objects == RM_GENERATE_ERROR \ @@ -1952,4 +2110,9 @@ extern bfd_boolean _sh_elf_set_mach_from_flags } \ while (0) +/* Will a symbol be bound to the the definition within the shared + library, if any. */ +#define SYMBOLIC_BIND(INFO, H) \ + ((INFO)->symbolic || ((INFO)->dynamic && !(H)->dynamic)) + #endif /* _LIBELF_H_ */ diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c index 5100e72938d..092c2c57ec3 100644 --- a/bfd/elf-eh-frame.c +++ b/bfd/elf-eh-frame.c @@ -1,5 +1,6 @@ /* .eh_frame section optimization. - Copyright 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Written by Jakub Jelinek . This file is part of BFD, the Binary File Descriptor library. @@ -18,14 +19,42 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/dwarf2.h" #define EH_FRAME_HDR_SIZE 8 +struct cie +{ + unsigned int length; + unsigned int hash; + unsigned char version; + unsigned char local_personality; + char augmentation[20]; + bfd_vma code_align; + bfd_signed_vma data_align; + bfd_vma ra_column; + bfd_vma augmentation_size; + union { + struct elf_link_hash_entry *h; + bfd_vma val; + } personality; + asection *output_sec; + struct eh_cie_fde *cie_inf; + unsigned char per_encoding; + unsigned char lsda_encoding; + unsigned char fde_encoding; + unsigned char initial_insn_length; + unsigned char make_relative; + unsigned char make_lsda_relative; + unsigned char initial_instructions[50]; +}; + + + /* If *ITER hasn't reached END yet, read the next byte into *RESULT and move onto the next byte. Return true on success. */ @@ -180,20 +209,27 @@ write_value (bfd *abfd, bfd_byte *buf, bfd_vma value, int width) } } -/* Return zero if C1 and C2 CIEs can be merged. */ +/* Return one if C1 and C2 CIEs can be merged. */ -static -int cie_compare (struct cie *c1, struct cie *c2) +static int +cie_eq (const void *e1, const void *e2) { - if (c1->hdr.length == c2->hdr.length + const struct cie *c1 = e1; + const struct cie *c2 = e2; + + if (c1->hash == c2->hash + && c1->length == c2->length && c1->version == c2->version + && c1->local_personality == c2->local_personality && strcmp (c1->augmentation, c2->augmentation) == 0 && strcmp (c1->augmentation, "eh") != 0 && c1->code_align == c2->code_align && c1->data_align == c2->data_align && c1->ra_column == c2->ra_column && c1->augmentation_size == c2->augmentation_size - && c1->personality == c2->personality + && memcmp (&c1->personality, &c2->personality, + sizeof (c1->personality)) == 0 + && c1->output_sec == c2->output_sec && c1->per_encoding == c2->per_encoding && c1->lsda_encoding == c2->lsda_encoding && c1->fde_encoding == c2->fde_encoding @@ -201,9 +237,38 @@ int cie_compare (struct cie *c1, struct cie *c2) && memcmp (c1->initial_instructions, c2->initial_instructions, c1->initial_insn_length) == 0) - return 0; + return 1; - return 1; + return 0; +} + +static hashval_t +cie_hash (const void *e) +{ + const struct cie *c = e; + return c->hash; +} + +static hashval_t +cie_compute_hash (struct cie *c) +{ + hashval_t h = 0; + h = iterative_hash_object (c->length, h); + h = iterative_hash_object (c->version, h); + h = iterative_hash (c->augmentation, strlen (c->augmentation) + 1, h); + h = iterative_hash_object (c->code_align, h); + h = iterative_hash_object (c->data_align, h); + h = iterative_hash_object (c->ra_column, h); + h = iterative_hash_object (c->augmentation_size, h); + h = iterative_hash_object (c->personality, h); + h = iterative_hash_object (c->output_sec, h); + h = iterative_hash_object (c->per_encoding, h); + h = iterative_hash_object (c->lsda_encoding, h); + h = iterative_hash_object (c->fde_encoding, h); + h = iterative_hash_object (c->initial_insn_length, h); + h = iterative_hash (c->initial_instructions, c->initial_insn_length, h); + c->hash = h; + return h; } /* Return the number of extra bytes that we'll be inserting into @@ -273,11 +338,14 @@ skip_cfa_op (bfd_byte **iter, bfd_byte *end, unsigned int encoded_ptr_width) if (!read_byte (iter, end, &op)) return FALSE; - switch (op & 0x80 ? op & 0xc0 : op) + switch (op & 0xc0 ? op & 0xc0 : op) { case DW_CFA_nop: case DW_CFA_advance_loc: case DW_CFA_restore: + case DW_CFA_remember_state: + case DW_CFA_restore_state: + case DW_CFA_GNU_window_save: /* No arguments. */ return TRUE; @@ -292,6 +360,8 @@ skip_cfa_op (bfd_byte **iter, bfd_byte *end, unsigned int encoded_ptr_width) /* One leb128 argument. */ return skip_leb128 (iter, end); + case DW_CFA_val_offset: + case DW_CFA_val_offset_sf: case DW_CFA_offset_extended: case DW_CFA_register: case DW_CFA_def_cfa: @@ -308,6 +378,7 @@ skip_cfa_op (bfd_byte **iter, bfd_byte *end, unsigned int encoded_ptr_width) && skip_bytes (iter, end, length)); case DW_CFA_expression: + case DW_CFA_val_expression: /* A leb128 followed by a variable-length argument. */ return (skip_leb128 (iter, end) && read_uleb128 (iter, end, &length) @@ -339,7 +410,8 @@ skip_cfa_op (bfd_byte **iter, bfd_byte *end, unsigned int encoded_ptr_width) ENCODED_PTR_WIDTH is as for skip_cfa_op. */ static bfd_byte * -skip_non_nops (bfd_byte *buf, bfd_byte *end, unsigned int encoded_ptr_width) +skip_non_nops (bfd_byte *buf, bfd_byte *end, unsigned int encoded_ptr_width, + unsigned int *set_loc_count) { bfd_byte *last; @@ -349,6 +421,8 @@ skip_non_nops (bfd_byte *buf, bfd_byte *end, unsigned int encoded_ptr_width) buf++; else { + if (*buf == DW_CFA_set_loc) + ++*set_loc_count; if (!skip_cfa_op (&buf, end, encoded_ptr_width)) return 0; last = buf; @@ -374,15 +448,24 @@ _bfd_elf_discard_section_eh_frame while (0) bfd_byte *ehbuf = NULL, *buf; - bfd_byte *last_cie, *last_fde; - struct eh_cie_fde *ent, *last_cie_inf, *this_inf; - struct cie_header hdr; - struct cie cie; + bfd_byte *last_fde; + struct eh_cie_fde *ent, *this_inf; + unsigned int hdr_length, hdr_id; + struct extended_cie + { + struct cie cie; + unsigned int offset; + unsigned int usage_count; + unsigned int entry; + } *ecies = NULL, *ecie; + unsigned int ecie_count = 0, ecie_alloced = 0; + struct cie *cie; struct elf_link_hash_table *htab; struct eh_frame_hdr_info *hdr_info; struct eh_frame_sec_info *sec_info = NULL; - unsigned int cie_usage_count, offset; + unsigned int offset; unsigned int ptr_size; + unsigned int entry_alloced; if (sec->size == 0) { @@ -390,8 +473,7 @@ _bfd_elf_discard_section_eh_frame return FALSE; } - if ((sec->output_section != NULL - && bfd_is_abs_section (sec->output_section))) + if (bfd_is_abs_section (sec->output_section)) { /* At least one of the sections is being discarded from the link, so we should just ignore them. */ @@ -401,6 +483,9 @@ _bfd_elf_discard_section_eh_frame htab = elf_hash_table (info); hdr_info = &htab->eh_info; + if (hdr_info->cies == NULL && !info->relocatable) + hdr_info->cies = htab_try_create (1, cie_hash, cie_eq, free); + /* Read the frame unwind information from abfd. */ REQUIRE (bfd_malloc_and_get_section (abfd, sec, &ehbuf)); @@ -423,15 +508,11 @@ _bfd_elf_discard_section_eh_frame REQUIRE (ptr_size != 0); buf = ehbuf; - last_cie = NULL; - last_cie_inf = NULL; - memset (&cie, 0, sizeof (cie)); - cie_usage_count = 0; sec_info = bfd_zmalloc (sizeof (struct eh_frame_sec_info) + 99 * sizeof (struct eh_cie_fde)); REQUIRE (sec_info); - sec_info->alloced = 100; + entry_alloced = 100; #define ENSURE_NO_RELOCS(buf) \ REQUIRE (!(cookie->rel < cookie->relend \ @@ -454,118 +535,84 @@ _bfd_elf_discard_section_eh_frame for (;;) { char *aug; - bfd_byte *start, *end, *insns; + bfd_byte *start, *end, *insns, *insns_end; bfd_size_type length; + unsigned int set_loc_count; - if (sec_info->count == sec_info->alloced) + if (sec_info->count == entry_alloced) { - struct eh_cie_fde *old_entry = sec_info->entry; sec_info = bfd_realloc (sec_info, sizeof (struct eh_frame_sec_info) - + ((sec_info->alloced + 99) + + ((entry_alloced + 99) * sizeof (struct eh_cie_fde))); REQUIRE (sec_info); - memset (&sec_info->entry[sec_info->alloced], 0, + memset (&sec_info->entry[entry_alloced], 0, 100 * sizeof (struct eh_cie_fde)); - sec_info->alloced += 100; - - /* Now fix any pointers into the array. */ - if (last_cie_inf >= old_entry - && last_cie_inf < old_entry + sec_info->count) - last_cie_inf = sec_info->entry + (last_cie_inf - old_entry); + entry_alloced += 100; } this_inf = sec_info->entry + sec_info->count; last_fde = buf; - /* If we are at the end of the section, we still need to decide - on whether to output or discard last encountered CIE (if any). */ + if ((bfd_size_type) (buf - ehbuf) == sec->size) + break; + + /* Read the length of the entry. */ + REQUIRE (skip_bytes (&buf, ehbuf + sec->size, 4)); + hdr_length = bfd_get_32 (abfd, buf - 4); + + /* 64-bit .eh_frame is not supported. */ + REQUIRE (hdr_length != 0xffffffff); + + /* The CIE/FDE must be fully contained in this input section. */ + REQUIRE ((bfd_size_type) (buf - ehbuf) + hdr_length <= sec->size); + end = buf + hdr_length; + + this_inf->offset = last_fde - ehbuf; + this_inf->size = 4 + hdr_length; + + if (hdr_length == 0) { - hdr.length = 0; - hdr.id = (unsigned int) -1; - end = buf; - } - else - { - /* Read the length of the entry. */ - REQUIRE (skip_bytes (&buf, ehbuf + sec->size, 4)); - hdr.length = bfd_get_32 (abfd, buf - 4); - - /* 64-bit .eh_frame is not supported. */ - REQUIRE (hdr.length != 0xffffffff); - - /* The CIE/FDE must be fully contained in this input section. */ - REQUIRE ((bfd_size_type) (buf - ehbuf) + hdr.length <= sec->size); - end = buf + hdr.length; - - this_inf->offset = last_fde - ehbuf; - this_inf->size = 4 + hdr.length; - - if (hdr.length == 0) - { - /* A zero-length CIE should only be found at the end of - the section. */ - REQUIRE ((bfd_size_type) (buf - ehbuf) == sec->size); - ENSURE_NO_RELOCS (buf); - sec_info->count++; - /* Now just finish last encountered CIE processing and break - the loop. */ - hdr.id = (unsigned int) -1; - } - else - { - REQUIRE (skip_bytes (&buf, end, 4)); - hdr.id = bfd_get_32 (abfd, buf - 4); - REQUIRE (hdr.id != (unsigned int) -1); - } + /* A zero-length CIE should only be found at the end of + the section. */ + REQUIRE ((bfd_size_type) (buf - ehbuf) == sec->size); + ENSURE_NO_RELOCS (buf); + sec_info->count++; + break; } - if (hdr.id == 0 || hdr.id == (unsigned int) -1) + REQUIRE (skip_bytes (&buf, end, 4)); + hdr_id = bfd_get_32 (abfd, buf - 4); + + if (hdr_id == 0) { unsigned int initial_insn_length; /* CIE */ - if (last_cie != NULL) - { - /* Now check if this CIE is identical to the last CIE, - in which case we can remove it provided we adjust - all FDEs. Also, it can be removed if we have removed - all FDEs using it. */ - if ((!info->relocatable - && hdr_info->last_cie_sec - && (sec->output_section - == hdr_info->last_cie_sec->output_section) - && cie_compare (&cie, &hdr_info->last_cie) == 0) - || cie_usage_count == 0) - last_cie_inf->removed = 1; - else - { - hdr_info->last_cie = cie; - hdr_info->last_cie_sec = sec; - last_cie_inf->make_relative = cie.make_relative; - last_cie_inf->make_lsda_relative = cie.make_lsda_relative; - last_cie_inf->per_encoding_relative - = (cie.per_encoding & 0x70) == DW_EH_PE_pcrel; - } - } - - if (hdr.id == (unsigned int) -1) - break; - - last_cie_inf = this_inf; this_inf->cie = 1; - cie_usage_count = 0; - memset (&cie, 0, sizeof (cie)); - cie.hdr = hdr; - REQUIRE (read_byte (&buf, end, &cie.version)); + if (ecie_count == ecie_alloced) + { + ecies = bfd_realloc (ecies, + (ecie_alloced + 20) * sizeof (*ecies)); + REQUIRE (ecies); + memset (&ecies[ecie_alloced], 0, 20 * sizeof (*ecies)); + ecie_alloced += 20; + } + + cie = &ecies[ecie_count].cie; + ecies[ecie_count].offset = this_inf->offset; + ecies[ecie_count++].entry = sec_info->count; + cie->length = hdr_length; + start = buf; + REQUIRE (read_byte (&buf, end, &cie->version)); /* Cannot handle unknown versions. */ - REQUIRE (cie.version == 1 || cie.version == 3); - REQUIRE (strlen ((char *) buf) < sizeof (cie.augmentation)); + REQUIRE (cie->version == 1 || cie->version == 3); + REQUIRE (strlen ((char *) buf) < sizeof (cie->augmentation)); - strcpy (cie.augmentation, (char *) buf); + strcpy (cie->augmentation, (char *) buf); buf = (bfd_byte *) strchr ((char *) buf, '\0') + 1; ENSURE_NO_RELOCS (buf); if (buf[0] == 'e' && buf[1] == 'h') @@ -577,26 +624,26 @@ _bfd_elf_discard_section_eh_frame REQUIRE (skip_bytes (&buf, end, ptr_size)); SKIP_RELOCS (buf); } - REQUIRE (read_uleb128 (&buf, end, &cie.code_align)); - REQUIRE (read_sleb128 (&buf, end, &cie.data_align)); - if (cie.version == 1) + REQUIRE (read_uleb128 (&buf, end, &cie->code_align)); + REQUIRE (read_sleb128 (&buf, end, &cie->data_align)); + if (cie->version == 1) { REQUIRE (buf < end); - cie.ra_column = *buf++; + cie->ra_column = *buf++; } else - REQUIRE (read_uleb128 (&buf, end, &cie.ra_column)); + REQUIRE (read_uleb128 (&buf, end, &cie->ra_column)); ENSURE_NO_RELOCS (buf); - cie.lsda_encoding = DW_EH_PE_omit; - cie.fde_encoding = DW_EH_PE_omit; - cie.per_encoding = DW_EH_PE_omit; - aug = cie.augmentation; + cie->lsda_encoding = DW_EH_PE_omit; + cie->fde_encoding = DW_EH_PE_omit; + cie->per_encoding = DW_EH_PE_omit; + aug = cie->augmentation; if (aug[0] != 'e' || aug[1] != 'h') { if (*aug == 'z') { aug++; - REQUIRE (read_uleb128 (&buf, end, &cie.augmentation_size)); + REQUIRE (read_uleb128 (&buf, end, &cie->augmentation_size)); ENSURE_NO_RELOCS (buf); } @@ -604,14 +651,14 @@ _bfd_elf_discard_section_eh_frame switch (*aug++) { case 'L': - REQUIRE (read_byte (&buf, end, &cie.lsda_encoding)); + REQUIRE (read_byte (&buf, end, &cie->lsda_encoding)); ENSURE_NO_RELOCS (buf); - REQUIRE (get_DW_EH_PE_width (cie.lsda_encoding, ptr_size)); + REQUIRE (get_DW_EH_PE_width (cie->lsda_encoding, ptr_size)); break; case 'R': - REQUIRE (read_byte (&buf, end, &cie.fde_encoding)); + REQUIRE (read_byte (&buf, end, &cie->fde_encoding)); ENSURE_NO_RELOCS (buf); - REQUIRE (get_DW_EH_PE_width (cie.fde_encoding, ptr_size)); + REQUIRE (get_DW_EH_PE_width (cie->fde_encoding, ptr_size)); break; case 'S': break; @@ -619,18 +666,17 @@ _bfd_elf_discard_section_eh_frame { int per_width; - REQUIRE (read_byte (&buf, end, &cie.per_encoding)); - per_width = get_DW_EH_PE_width (cie.per_encoding, + REQUIRE (read_byte (&buf, end, &cie->per_encoding)); + per_width = get_DW_EH_PE_width (cie->per_encoding, ptr_size); REQUIRE (per_width); - if ((cie.per_encoding & 0xf0) == DW_EH_PE_aligned) + if ((cie->per_encoding & 0xf0) == DW_EH_PE_aligned) { length = -(buf - ehbuf) & (per_width - 1); REQUIRE (skip_bytes (&buf, end, length)); } ENSURE_NO_RELOCS (buf); - /* Ensure we have a reloc here, against - a global symbol. */ + /* Ensure we have a reloc here. */ if (GET_RELOC (buf) != NULL) { unsigned long r_symndx; @@ -641,7 +687,9 @@ _bfd_elf_discard_section_eh_frame else #endif r_symndx = ELF32_R_SYM (cookie->rel->r_info); - if (r_symndx >= cookie->locsymcount) + if (r_symndx >= cookie->locsymcount + || ELF_ST_BIND (cookie->locsyms[r_symndx] + .st_info) != STB_LOCAL) { struct elf_link_hash_entry *h; @@ -653,14 +701,39 @@ _bfd_elf_discard_section_eh_frame h = (struct elf_link_hash_entry *) h->root.u.i.link; - cie.personality = h; + cie->personality.h = h; } + else + { + Elf_Internal_Sym *sym; + asection *sym_sec; + bfd_vma val; + + sym = &cookie->locsyms[r_symndx]; + sym_sec = (bfd_section_from_elf_index + (abfd, sym->st_shndx)); + if (sym_sec != NULL) + { + if (sym_sec->kept_section != NULL) + sym_sec = sym_sec->kept_section; + if (sym_sec->output_section != NULL) + { + val = (sym->st_value + + sym_sec->output_offset + + sym_sec->output_section->vma); + cie->personality.val = val; + cie->local_personality = 1; + } + } + } + /* Cope with MIPS-style composite relocations. */ do cookie->rel++; while (GET_RELOC (buf) != NULL); } REQUIRE (skip_bytes (&buf, end, per_width)); + REQUIRE (cie->local_personality || cie->personality.h); } break; default: @@ -676,18 +749,18 @@ _bfd_elf_discard_section_eh_frame ->elf_backend_can_make_relative_eh_frame (abfd, info, sec))) { - if ((cie.fde_encoding & 0xf0) == DW_EH_PE_absptr) - cie.make_relative = 1; + if ((cie->fde_encoding & 0xf0) == DW_EH_PE_absptr) + cie->make_relative = 1; /* If the CIE doesn't already have an 'R' entry, it's fairly easy to add one, provided that there's no aligned data after the augmentation string. */ - else if (cie.fde_encoding == DW_EH_PE_omit - && (cie.per_encoding & 0xf0) != DW_EH_PE_aligned) + else if (cie->fde_encoding == DW_EH_PE_omit + && (cie->per_encoding & 0xf0) != DW_EH_PE_aligned) { - if (*cie.augmentation == 0) + if (*cie->augmentation == 0) this_inf->add_augmentation_size = 1; this_inf->add_fde_encoding = 1; - cie.make_relative = 1; + cie->make_relative = 1; } } @@ -695,30 +768,36 @@ _bfd_elf_discard_section_eh_frame && (get_elf_backend_data (abfd) ->elf_backend_can_make_lsda_relative_eh_frame (abfd, info, sec)) - && (cie.lsda_encoding & 0xf0) == DW_EH_PE_absptr) - cie.make_lsda_relative = 1; + && (cie->lsda_encoding & 0xf0) == DW_EH_PE_absptr) + cie->make_lsda_relative = 1; /* If FDE encoding was not specified, it defaults to DW_EH_absptr. */ - if (cie.fde_encoding == DW_EH_PE_omit) - cie.fde_encoding = DW_EH_PE_absptr; + if (cie->fde_encoding == DW_EH_PE_omit) + cie->fde_encoding = DW_EH_PE_absptr; initial_insn_length = end - buf; - if (initial_insn_length <= 50) + if (initial_insn_length <= sizeof (cie->initial_instructions)) { - cie.initial_insn_length = initial_insn_length; - memcpy (cie.initial_instructions, buf, initial_insn_length); + cie->initial_insn_length = initial_insn_length; + memcpy (cie->initial_instructions, buf, initial_insn_length); } insns = buf; buf += initial_insn_length; ENSURE_NO_RELOCS (buf); - last_cie = last_fde; } else { - /* Ensure this FDE uses the last CIE encountered. */ - REQUIRE (last_cie); - REQUIRE (hdr.id == (unsigned int) (buf - 4 - last_cie)); + /* Find the corresponding CIE. */ + unsigned int cie_offset = this_inf->offset + 4 - hdr_id; + for (ecie = ecies; ecie < ecies + ecie_count; ++ecie) + if (cie_offset == ecie->offset) + break; + + /* Ensure this FDE references one of the CIEs in this input + section. */ + REQUIRE (ecie != ecies + ecie_count); + cie = &ecie->cie; ENSURE_NO_RELOCS (buf); REQUIRE (GET_RELOC (buf)); @@ -730,26 +809,31 @@ _bfd_elf_discard_section_eh_frame else { if (info->shared - && (((cie.fde_encoding & 0xf0) == DW_EH_PE_absptr - && cie.make_relative == 0) - || (cie.fde_encoding & 0xf0) == DW_EH_PE_aligned)) + && (((cie->fde_encoding & 0xf0) == DW_EH_PE_absptr + && cie->make_relative == 0) + || (cie->fde_encoding & 0xf0) == DW_EH_PE_aligned)) { /* If a shared library uses absolute pointers which we cannot turn into PC relative, don't create the binary search table, since it is affected by runtime relocations. */ hdr_info->table = FALSE; + (*info->callbacks->einfo) + (_("%P: fde encoding in %B(%A) prevents .eh_frame_hdr" + " table being created.\n"), abfd, sec); } - cie_usage_count++; + ecie->usage_count++; hdr_info->fde_count++; + this_inf->cie_inf = (void *) (ecie - ecies); } + /* Skip the initial location and address range. */ start = buf; - length = get_DW_EH_PE_width (cie.fde_encoding, ptr_size); + length = get_DW_EH_PE_width (cie->fde_encoding, ptr_size); REQUIRE (skip_bytes (&buf, end, 2 * length)); /* Skip the augmentation size, if present. */ - if (cie.augmentation[0] == 'z') + if (cie->augmentation[0] == 'z') REQUIRE (read_uleb128 (&buf, end, &length)); else length = 0; @@ -757,12 +841,12 @@ _bfd_elf_discard_section_eh_frame /* Of the supported augmentation characters above, only 'L' adds augmentation data to the FDE. This code would need to be adjusted if any future augmentations do the same thing. */ - if (cie.lsda_encoding != DW_EH_PE_omit) + if (cie->lsda_encoding != DW_EH_PE_omit) { this_inf->lsda_offset = buf - start; /* If there's no 'z' augmentation, we don't know where the CFA insns begin. Assume no padding. */ - if (cie.augmentation[0] != 'z') + if (cie->augmentation[0] != 'z') length = end - buf; } @@ -770,57 +854,131 @@ _bfd_elf_discard_section_eh_frame REQUIRE (skip_bytes (&buf, end, length)); insns = buf; - buf = last_fde + 4 + hdr.length; + buf = last_fde + 4 + hdr_length; SKIP_RELOCS (buf); } /* Try to interpret the CFA instructions and find the first padding nop. Shrink this_inf's size so that it doesn't - including the padding. */ - length = get_DW_EH_PE_width (cie.fde_encoding, ptr_size); - insns = skip_non_nops (insns, end, length); - if (insns != 0) - this_inf->size -= end - insns; + include the padding. */ + length = get_DW_EH_PE_width (cie->fde_encoding, ptr_size); + set_loc_count = 0; + insns_end = skip_non_nops (insns, end, length, &set_loc_count); + /* If we don't understand the CFA instructions, we can't know + what needs to be adjusted there. */ + if (insns_end == NULL + /* For the time being we don't support DW_CFA_set_loc in + CIE instructions. */ + || (set_loc_count && this_inf->cie)) + goto free_no_table; + this_inf->size -= end - insns_end; + if (insns_end != end && this_inf->cie) + { + cie->initial_insn_length -= end - insns_end; + cie->length -= end - insns_end; + } + if (set_loc_count + && ((cie->fde_encoding & 0xf0) == DW_EH_PE_pcrel + || cie->make_relative)) + { + unsigned int cnt; + bfd_byte *p; - this_inf->fde_encoding = cie.fde_encoding; - this_inf->lsda_encoding = cie.lsda_encoding; + this_inf->set_loc = bfd_malloc ((set_loc_count + 1) + * sizeof (unsigned int)); + REQUIRE (this_inf->set_loc); + this_inf->set_loc[0] = set_loc_count; + p = insns; + cnt = 0; + while (p < end) + { + if (*p == DW_CFA_set_loc) + this_inf->set_loc[++cnt] = p + 1 - start; + REQUIRE (skip_cfa_op (&p, end, length)); + } + } + + this_inf->fde_encoding = cie->fde_encoding; + this_inf->lsda_encoding = cie->lsda_encoding; sec_info->count++; } elf_section_data (sec)->sec_info = sec_info; sec->sec_info_type = ELF_INFO_TYPE_EH_FRAME; + /* Look at all CIEs in this section and determine which can be + removed as unused, which can be merged with previous duplicate + CIEs and which need to be kept. */ + for (ecie = ecies; ecie < ecies + ecie_count; ++ecie) + { + if (ecie->usage_count == 0) + { + sec_info->entry[ecie->entry].removed = 1; + continue; + } + ecie->cie.output_sec = sec->output_section; + ecie->cie.cie_inf = sec_info->entry + ecie->entry; + cie_compute_hash (&ecie->cie); + if (hdr_info->cies != NULL) + { + void **loc = htab_find_slot_with_hash (hdr_info->cies, &ecie->cie, + ecie->cie.hash, INSERT); + if (loc != NULL) + { + if (*loc != HTAB_EMPTY_ENTRY) + { + sec_info->entry[ecie->entry].removed = 1; + ecie->cie.cie_inf = ((struct cie *) *loc)->cie_inf; + continue; + } + + *loc = malloc (sizeof (struct cie)); + if (*loc == NULL) + *loc = HTAB_DELETED_ENTRY; + else + memcpy (*loc, &ecie->cie, sizeof (struct cie)); + } + } + ecie->cie.cie_inf->make_relative = ecie->cie.make_relative; + ecie->cie.cie_inf->make_lsda_relative = ecie->cie.make_lsda_relative; + ecie->cie.cie_inf->per_encoding_relative + = (ecie->cie.per_encoding & 0x70) == DW_EH_PE_pcrel; + } + /* Ok, now we can assign new offsets. */ offset = 0; - last_cie_inf = hdr_info->last_cie_inf; for (ent = sec_info->entry; ent < sec_info->entry + sec_info->count; ++ent) if (!ent->removed) { - if (ent->cie) - last_cie_inf = ent; - else - ent->cie_inf = last_cie_inf; + if (!ent->cie) + { + ecie = ecies + (unsigned long) ent->cie_inf; + ent->cie_inf = ecie->cie.cie_inf; + } ent->new_offset = offset; offset += size_of_output_cie_fde (ent, ptr_size); } - hdr_info->last_cie_inf = last_cie_inf; /* Resize the sec as needed. */ sec->rawsize = sec->size; sec->size = offset; - if (sec->size == 0) - sec->flags |= SEC_EXCLUDE; free (ehbuf); + if (ecies) + free (ecies); return offset != sec->rawsize; free_no_table: + (*info->callbacks->einfo) + (_("%P: error in %B(%A); no .eh_frame_hdr table will be created.\n"), + abfd, sec); if (ehbuf) free (ehbuf); if (sec_info) free (sec_info); + if (ecies) + free (ecies); hdr_info->table = FALSE; - hdr_info->last_cie.hdr.length = 0; return FALSE; #undef REQUIRE @@ -839,6 +997,13 @@ _bfd_elf_discard_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info) htab = elf_hash_table (info); hdr_info = &htab->eh_info; + + if (hdr_info->cies != NULL) + { + htab_delete (hdr_info->cies); + hdr_info->cies = NULL; + } + sec = hdr_info->hdr_sec; if (sec == NULL) return FALSE; @@ -847,8 +1012,6 @@ _bfd_elf_discard_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info) if (hdr_info->table) sec->size += 4 + hdr_info->fde_count * 8; - /* Request program headers to be recalculated. */ - elf_tdata (abfd)->program_header_size = 0; elf_tdata (abfd)->eh_frame_hdr = sec; return TRUE; } @@ -968,6 +1131,23 @@ _bfd_elf_eh_frame_section_offset (bfd *output_bfd ATTRIBUTE_UNUSED, return (bfd_vma) -2; } + /* If converting to DW_EH_PE_pcrel, there will be no need for run-time + relocation against DW_CFA_set_loc's arguments. */ + if (sec_info->entry[mid].set_loc + && (sec_info->entry[mid].cie + ? sec_info->entry[mid].make_relative + : sec_info->entry[mid].cie_inf->make_relative) + && (offset >= sec_info->entry[mid].offset + 8 + + sec_info->entry[mid].set_loc[1])) + { + unsigned int cnt; + + for (cnt = 1; cnt <= sec_info->entry[mid].set_loc[0]; cnt++) + if (offset == sec_info->entry[mid].offset + 8 + + sec_info->entry[mid].set_loc[cnt]) + return (bfd_vma) -2; + } + if (hdr_info->offsets_adjusted) offset -= sec->output_offset; /* Any new augmentation bytes go before the first relocation. */ @@ -1192,6 +1372,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, /* FDE */ bfd_vma value, address; unsigned int width; + bfd_byte *start; /* Skip length. */ buf += 4; @@ -1228,6 +1409,8 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, write_value (abfd, buf, value, width); } + start = buf; + if (hdr_info) { hdr_info->array[hdr_info->array_count].initial_loc = address; @@ -1260,12 +1443,42 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, memmove (buf + 1, buf, end - buf); *buf = 0; } + + if (ent->set_loc) + { + /* Adjust DW_CFA_set_loc. */ + unsigned int cnt, width; + bfd_vma new_offset; + + width = get_DW_EH_PE_width (ent->fde_encoding, ptr_size); + new_offset = ent->new_offset + 8 + + extra_augmentation_string_bytes (ent) + + extra_augmentation_data_bytes (ent); + + for (cnt = 1; cnt <= ent->set_loc[0]; cnt++) + { + bfd_vma value; + buf = start + ent->set_loc[cnt]; + + value = read_value (abfd, buf, width, + get_DW_EH_PE_signed (ent->fde_encoding)); + if (!value) + continue; + + if ((ent->fde_encoding & 0xf0) == DW_EH_PE_pcrel) + value += ent->offset + 8 - new_offset; + if (ent->cie_inf->make_relative) + value -= sec->output_section->vma + new_offset + + ent->set_loc[cnt]; + write_value (abfd, buf, value, width); + } + } } } /* We don't align the section to its section alignment since the runtime library only expects all CIE/FDE records aligned at - the pointer size. _bfd_elf_discard_section_eh_frame should + the pointer size. _bfd_elf_discard_section_eh_frame should have padded CIE/FDE records to multiple of pointer size with size_of_output_cie_fde. */ if ((sec->size % ptr_size) != 0) diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h index c4ad5ad712e..e676e27fef3 100644 --- a/bfd/elf-hppa.h +++ b/bfd/elf-hppa.h @@ -1,22 +1,22 @@ /* Common code for PA ELF implementations. - Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -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 2 of the License, or -(at your option) any later version. + 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 2 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. + 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. */ + 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. */ #define ELF_HOWTO_TABLE_SIZE R_PARISC_UNIMPLEMENTED + 1 @@ -27,30 +27,20 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. external constraints require 32 or 64 bit specific code. We remap the definitions/functions as necessary here. */ #if ARCH_SIZE == 64 -#define ELF_R_TYPE(X) ELF64_R_TYPE(X) -#define ELF_R_SYM(X) ELF64_R_SYM(X) -#define elf_hppa_reloc_final_type elf64_hppa_reloc_final_type -#define _bfd_elf_hppa_gen_reloc_type _bfd_elf64_hppa_gen_reloc_type -#define elf_hppa_relocate_section elf64_hppa_relocate_section -#define elf_hppa_final_link elf64_hppa_final_link +#define ELF_R_TYPE(X) ELF64_R_TYPE(X) +#define ELF_R_SYM(X) ELF64_R_SYM(X) +#define elf_hppa_reloc_final_type elf64_hppa_reloc_final_type +#define _bfd_elf_hppa_gen_reloc_type _bfd_elf64_hppa_gen_reloc_type +#define elf_hppa_relocate_section elf64_hppa_relocate_section +#define elf_hppa_final_link elf64_hppa_final_link #endif #if ARCH_SIZE == 32 -#define ELF_R_TYPE(X) ELF32_R_TYPE(X) -#define ELF_R_SYM(X) ELF32_R_SYM(X) -#define elf_hppa_reloc_final_type elf32_hppa_reloc_final_type -#define _bfd_elf_hppa_gen_reloc_type _bfd_elf32_hppa_gen_reloc_type -#define elf_hppa_relocate_section elf32_hppa_relocate_section -#define elf_hppa_final_link elf32_hppa_final_link -#endif - -#if ARCH_SIZE == 64 -static bfd_reloc_status_type elf_hppa_final_link_relocate - (Elf_Internal_Rela *, bfd *, bfd *, asection *, bfd_byte *, bfd_vma, - struct bfd_link_info *, asection *, struct elf_link_hash_entry *, - struct elf64_hppa_dyn_hash_entry *); - -static int elf_hppa_relocate_insn - (int, int, unsigned int); +#define ELF_R_TYPE(X) ELF32_R_TYPE(X) +#define ELF_R_SYM(X) ELF32_R_SYM(X) +#define elf_hppa_reloc_final_type elf32_hppa_reloc_final_type +#define _bfd_elf_hppa_gen_reloc_type _bfd_elf32_hppa_gen_reloc_type +#define elf_hppa_relocate_section elf32_hppa_relocate_section +#define elf_hppa_final_link elf32_hppa_final_link #endif /* ELF/PA relocation howto entries. */ @@ -64,58 +54,58 @@ static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] = _bfd_stab_section_find_nearest_line. */ { R_PARISC_DIR32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR32", FALSE, 0, 0xffffffff, FALSE }, - { R_PARISC_DIR21L, 0, 0, 21, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DIR21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR21L", FALSE, 0, 0, FALSE }, - { R_PARISC_DIR17R, 0, 0, 17, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DIR17R, 0, 2, 17, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR17R", FALSE, 0, 0, FALSE }, - { R_PARISC_DIR17F, 0, 0, 17, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DIR17F, 0, 2, 17, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR17F", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_DIR14R, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DIR14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR14R", FALSE, 0, 0, FALSE }, - { R_PARISC_DIR14F, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DIR14F, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR14F", FALSE, 0, 0, FALSE }, /* 8 */ - { R_PARISC_PCREL12F, 0, 0, 12, TRUE, 0, complain_overflow_bitfield, + { R_PARISC_PCREL12F, 0, 2, 12, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL12F", FALSE, 0, 0, FALSE }, - { R_PARISC_PCREL32, 0, 0, 32, TRUE, 0, complain_overflow_bitfield, + { R_PARISC_PCREL32, 0, 2, 32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL32", FALSE, 0, 0, FALSE }, - { R_PARISC_PCREL21L, 0, 0, 21, TRUE, 0, complain_overflow_bitfield, + { R_PARISC_PCREL21L, 0, 2, 21, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL21L", FALSE, 0, 0, FALSE }, - { R_PARISC_PCREL17R, 0, 0, 17, TRUE, 0, complain_overflow_bitfield, + { R_PARISC_PCREL17R, 0, 2, 17, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL17R", FALSE, 0, 0, FALSE }, - { R_PARISC_PCREL17F, 0, 0, 17, TRUE, 0, complain_overflow_bitfield, + { R_PARISC_PCREL17F, 0, 2, 17, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL17F", FALSE, 0, 0, FALSE }, - { R_PARISC_PCREL17C, 0, 0, 17, TRUE, 0, complain_overflow_bitfield, + { R_PARISC_PCREL17C, 0, 2, 17, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL17C", FALSE, 0, 0, FALSE }, - { R_PARISC_PCREL14R, 0, 0, 14, TRUE, 0, complain_overflow_bitfield, + { R_PARISC_PCREL14R, 0, 2, 14, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL14R", FALSE, 0, 0, FALSE }, - { R_PARISC_PCREL14F, 0, 0, 14, TRUE, 0, complain_overflow_bitfield, + { R_PARISC_PCREL14F, 0, 2, 14, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL14F", FALSE, 0, 0, FALSE }, /* 16 */ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_DPREL21L, 0, 0, 21, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DPREL21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL21L", FALSE, 0, 0, FALSE }, - { R_PARISC_DPREL14WR, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DPREL14WR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL14WR", FALSE, 0, 0, FALSE }, - { R_PARISC_DPREL14DR, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DPREL14DR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL14DR", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_DPREL14R, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DPREL14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL14R", FALSE, 0, 0, FALSE }, - { R_PARISC_DPREL14F, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DPREL14F, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL14F", FALSE, 0, 0, FALSE }, /* 24 */ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_DLTREL21L, 0, 0, 21, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DLTREL21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL21L", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, @@ -123,16 +113,16 @@ static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] = bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_DLTREL14R, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DLTREL14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL14R", FALSE, 0, 0, FALSE }, - { R_PARISC_DLTREL14F, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DLTREL14F, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL14F", FALSE, 0, 0, FALSE }, /* 32 */ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_DLTIND21L, 0, 0, 21, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DLTIND21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND21L", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, @@ -140,33 +130,33 @@ static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] = bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_DLTIND14R, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DLTIND14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND14R", FALSE, 0, 0, FALSE }, - { R_PARISC_DLTIND14F, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DLTIND14F, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND14F", FALSE, 0, 0, FALSE }, /* 40 */ { R_PARISC_SETBASE, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SETBASE", FALSE, 0, 0, FALSE }, - { R_PARISC_SECREL32, 0, 0, 32, FALSE, 0, complain_overflow_bitfield, - bfd_elf_generic_reloc, "R_PARISC_SECREL32", FALSE, 0, 0, FALSE }, - { R_PARISC_BASEREL21L, 0, 0, 21, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_SECREL32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_SECREL32", FALSE, 0, 0xffffffff, FALSE }, + { R_PARISC_BASEREL21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL21L", FALSE, 0, 0, FALSE }, - { R_PARISC_BASEREL17R, 0, 0, 17, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_BASEREL17R, 0, 2, 17, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL17R", FALSE, 0, 0, FALSE }, - { R_PARISC_BASEREL17F, 0, 0, 17, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_BASEREL17F, 0, 2, 17, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL17F", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_BASEREL14R, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_BASEREL14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL14R", FALSE, 0, 0, FALSE }, - { R_PARISC_BASEREL14F, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_BASEREL14F, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL14F", FALSE, 0, 0, FALSE }, /* 48 */ { R_PARISC_SEGBASE, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SEGBASE", FALSE, 0, 0, FALSE }, - { R_PARISC_SEGREL32, 0, 0, 32, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_SEGREL32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SEGREL32", FALSE, 0, 0, FALSE }, - { R_PARISC_PLTOFF21L, 0, 0, 21, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_PLTOFF21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF21L", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, @@ -174,16 +164,16 @@ static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] = bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_PLTOFF14R, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_PLTOFF14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF14R", FALSE, 0, 0, FALSE }, - { R_PARISC_PLTOFF14F, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_PLTOFF14F, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF14F", FALSE, 0, 0, FALSE }, /* 56 */ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_LTOFF_FPTR32, 0, 0, 32, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_LTOFF_FPTR32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR32", FALSE, 0, 0, FALSE }, - { R_PARISC_LTOFF_FPTR21L, 0, 0, 21, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_LTOFF_FPTR21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR21L", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, @@ -191,16 +181,16 @@ static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] = bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_LTOFF_FPTR14R, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_LTOFF_FPTR14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14R", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, /* 64 */ - { R_PARISC_FPTR64, 0, 0, 64, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_FPTR64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_FPTR64", FALSE, 0, 0, FALSE }, - { R_PARISC_PLABEL32, 0, 0, 32, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_PLABEL32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLABEL32", FALSE, 0, 0, FALSE }, - { R_PARISC_PLABEL21L, 0, 0, 21, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_PLABEL21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLABEL21L", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, @@ -208,86 +198,86 @@ static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] = bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_PLABEL14R, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_PLABEL14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLABEL14R", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, /* 72 */ - { R_PARISC_PCREL64, 0, 0, 64, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_PCREL64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL64", FALSE, 0, 0, FALSE }, - { R_PARISC_PCREL22C, 0, 0, 22, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_PCREL22C, 0, 2, 22, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL22C", FALSE, 0, 0, FALSE }, - { R_PARISC_PCREL22F, 0, 0, 22, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_PCREL22F, 0, 2, 22, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL22F", FALSE, 0, 0, FALSE }, - { R_PARISC_PCREL14WR, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_PCREL14WR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL14WR", FALSE, 0, 0, FALSE }, - { R_PARISC_PCREL14DR, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_PCREL14DR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL14DR", FALSE, 0, 0, FALSE }, - { R_PARISC_PCREL16F, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_PCREL16F, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL16F", FALSE, 0, 0, FALSE }, - { R_PARISC_PCREL16WF, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_PCREL16WF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL16WF", FALSE, 0, 0, FALSE }, - { R_PARISC_PCREL16DF, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_PCREL16DF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL16DF", FALSE, 0, 0, FALSE }, /* 80 */ - { R_PARISC_DIR64, 0, 0, 64, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DIR64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR64", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_DIR14WR, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DIR14WR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR14WR", FALSE, 0, 0, FALSE }, - { R_PARISC_DIR14DR, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DIR14DR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR14DR", FALSE, 0, 0, FALSE }, - { R_PARISC_DIR16F, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DIR16F, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR16F", FALSE, 0, 0, FALSE }, - { R_PARISC_DIR16WF, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DIR16WF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR16WF", FALSE, 0, 0, FALSE }, - { R_PARISC_DIR16DF, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DIR16DF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR16DF", FALSE, 0, 0, FALSE }, /* 88 */ - { R_PARISC_GPREL64, 0, 0, 64, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_GPREL64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_GPREL64", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_DLTREL14WR, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DLTREL14WR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL14WR", FALSE, 0, 0, FALSE }, - { R_PARISC_DLTREL14DR, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DLTREL14DR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL14DR", FALSE, 0, 0, FALSE }, - { R_PARISC_GPREL16F, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_GPREL16F, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_GPREL16F", FALSE, 0, 0, FALSE }, - { R_PARISC_GPREL16WF, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_GPREL16WF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_GPREL16WF", FALSE, 0, 0, FALSE }, - { R_PARISC_GPREL16DF, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_GPREL16DF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_GPREL16DF", FALSE, 0, 0, FALSE }, /* 96 */ - { R_PARISC_LTOFF64, 0, 0, 64, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_LTOFF64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF64", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_DLTIND14WR, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DLTIND14WR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND14WR", FALSE, 0, 0, FALSE }, - { R_PARISC_DLTIND14DR, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_DLTIND14DR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND14DR", FALSE, 0, 0, FALSE }, - { R_PARISC_LTOFF16F, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_LTOFF16F, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF16F", FALSE, 0, 0, FALSE }, - { R_PARISC_LTOFF16WF, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_LTOFF16WF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF16DF", FALSE, 0, 0, FALSE }, - { R_PARISC_LTOFF16DF, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_LTOFF16DF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF16DF", FALSE, 0, 0, FALSE }, /* 104 */ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_BASEREL14WR, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_BASEREL14WR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL14WR", FALSE, 0, 0, FALSE }, - { R_PARISC_BASEREL14DR, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_BASEREL14DR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL14DR", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, @@ -298,38 +288,38 @@ static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] = { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, /* 112 */ - { R_PARISC_SEGREL64, 0, 0, 64, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_SEGREL64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SEGREL64", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_PLTOFF14WR, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_PLTOFF14WR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF14WR", FALSE, 0, 0, FALSE }, - { R_PARISC_PLTOFF14DR, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_PLTOFF14DR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF14DR", FALSE, 0, 0, FALSE }, - { R_PARISC_PLTOFF16F, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_PLTOFF16F, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF16F", FALSE, 0, 0, FALSE }, - { R_PARISC_PLTOFF16WF, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_PLTOFF16WF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF16WF", FALSE, 0, 0, FALSE }, - { R_PARISC_PLTOFF16DF, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_PLTOFF16DF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF16DF", FALSE, 0, 0, FALSE }, /* 120 */ - { R_PARISC_LTOFF_FPTR64, 0, 0, 64, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_LTOFF_FPTR64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_LTOFF_FPTR14WR, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_LTOFF_FPTR14WR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14WR", FALSE, 0, 0, FALSE }, - { R_PARISC_LTOFF_FPTR14DR, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_LTOFF_FPTR14DR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14DR", FALSE, 0, 0, FALSE }, - { R_PARISC_LTOFF_FPTR16F, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_LTOFF_FPTR16F, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR16F", FALSE, 0, 0, FALSE }, - { R_PARISC_LTOFF_FPTR16WF, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_LTOFF_FPTR16WF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR16WF", FALSE, 0, 0, FALSE }, - { R_PARISC_LTOFF_FPTR16DF, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_LTOFF_FPTR16DF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, /* 128 */ { R_PARISC_COPY, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, @@ -385,9 +375,9 @@ static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] = /* 152 */ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_TPREL32, 0, 0, 32, FALSE, 0, complain_overflow_dont, + { R_PARISC_TPREL32, 0, 2, 32, FALSE, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_PARISC_TPREL32", FALSE, 0, 0, FALSE }, - { R_PARISC_TPREL21L, 0, 0, 21, FALSE, 0, complain_overflow_dont, + { R_PARISC_TPREL21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL21L", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, @@ -395,7 +385,7 @@ static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] = bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_TPREL14R, 0, 0, 14, FALSE, 0, complain_overflow_dont, + { R_PARISC_TPREL14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL14R", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, @@ -404,7 +394,7 @@ static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] = bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_LTOFF_TP21L, 0, 0, 21, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_LTOFF_TP21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP21L", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, @@ -412,9 +402,9 @@ static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] = bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_LTOFF_TP14R, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, - bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_LTOFF_TP14F, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_LTOFF_TP14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14R", FALSE, 0, 0, FALSE }, + { R_PARISC_LTOFF_TP14F, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14F", FALSE, 0, 0, FALSE }, /* 168 */ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, @@ -519,44 +509,69 @@ static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] = { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, /* 216 */ - { R_PARISC_TPREL64, 0, 0, 64, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_TPREL64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL64", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_TPREL14WR, 0, 0, 14, FALSE, 0, complain_overflow_dont, + { R_PARISC_TPREL14WR, 0, 2, 14, FALSE, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_PARISC_TPREL14WR", FALSE, 0, 0, FALSE }, - { R_PARISC_TPREL14DR, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_TPREL14DR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL14DR", FALSE, 0, 0, FALSE }, - { R_PARISC_TPREL16F, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_TPREL16F, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL16F", FALSE, 0, 0, FALSE }, - { R_PARISC_TPREL16WF, 0, 0, 16, FALSE, 0, complain_overflow_dont, + { R_PARISC_TPREL16WF, 0, 2, 16, FALSE, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_PARISC_TPREL16WF", FALSE, 0, 0, FALSE }, - { R_PARISC_TPREL16DF, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_TPREL16DF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL16DF", FALSE, 0, 0, FALSE }, /* 224 */ - { R_PARISC_LTOFF_TP64, 0, 0, 64, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_LTOFF_TP64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP64", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE }, - { R_PARISC_LTOFF_TP14WR, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_LTOFF_TP14WR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14WR", FALSE, 0, 0, FALSE }, - { R_PARISC_LTOFF_TP14DR, 0, 0, 14, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_LTOFF_TP14DR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14DR", FALSE, 0, 0, FALSE }, - { R_PARISC_LTOFF_TP16F, 0, 0, 16, FALSE, 0, complain_overflow_dont, + { R_PARISC_LTOFF_TP16F, 0, 2, 16, FALSE, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16F", FALSE, 0, 0, FALSE }, - { R_PARISC_LTOFF_TP16WF, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_LTOFF_TP16WF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16WF", FALSE, 0, 0, FALSE }, - { R_PARISC_LTOFF_TP16DF, 0, 0, 16, FALSE, 0, complain_overflow_bitfield, + { R_PARISC_LTOFF_TP16DF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16DF", FALSE, 0, 0, FALSE }, /* 232 */ { R_PARISC_GNU_VTENTRY, 0, 0, 0, FALSE, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_PARISC_GNU_VTENTRY", FALSE, 0, 0, FALSE }, { R_PARISC_GNU_VTINHERIT, 0, 0, 0, FALSE, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_PARISC_GNU_VTINHERIT", FALSE, 0, 0, FALSE }, + { R_PARISC_TLS_GD21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_TLS_GD21L", FALSE, 0, 0, FALSE }, + { R_PARISC_TLS_GD14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_TLS_GD14R", FALSE, 0, 0, FALSE }, + { R_PARISC_TLS_GDCALL, 0, 0, 0, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_TLS_GDCALL", FALSE, 0, 0, FALSE }, + { R_PARISC_TLS_LDM21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_TLS_LDM21L", FALSE, 0, 0, FALSE }, + { R_PARISC_TLS_LDM14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_TLS_LDM14R", FALSE, 0, 0, FALSE }, + { R_PARISC_TLS_LDMCALL, 0, 0, 0, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_TLS_LDMCALL", FALSE, 0, 0, FALSE }, + /* 240 */ + { R_PARISC_TLS_LDO21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_TLS_LDO21L", FALSE, 0, 0, FALSE }, + { R_PARISC_TLS_LDO14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_TLS_LDO14R", FALSE, 0, 0, FALSE }, + { R_PARISC_TLS_DTPMOD32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_TLS_DTPMOD32", FALSE, 0, 0, FALSE }, + { R_PARISC_TLS_DTPMOD64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_TLS_DTPMOD64", FALSE, 0, 0, FALSE }, + { R_PARISC_TLS_DTPOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_TLS_DTPOFF32", FALSE, 0, 0, FALSE }, + { R_PARISC_TLS_DTPOFF64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_TLS_DTPOFF64", FALSE, 0, 0, FALSE }, }; #define OFFSET_14R_FROM_21L 4 @@ -578,9 +593,9 @@ elf_hppa_reloc_final_type (bfd *abfd, for PA ELF. */ switch (base_type) { - /* We have been using generic relocation types. However, that may not - really make sense. Anyway, we need to support both R_PARISC_DIR64 - and R_PARISC_DIR32 here. */ + /* We have been using generic relocation types. However, that may not + really make sense. Anyway, we need to support both R_PARISC_DIR64 + and R_PARISC_DIR32 here. */ case R_PARISC_DIR32: case R_PARISC_DIR64: case R_HPPA_ABS_CALL: @@ -701,11 +716,11 @@ elf_hppa_reloc_final_type (bfd *abfd, case e_rsel: case e_rrsel: case e_rdsel: - /* R_PARISC_DLTREL14R for elf64, R_PARISC_DPREL14R for elf32 */ + /* R_PARISC_DLTREL14R for elf64, R_PARISC_DPREL14R for elf32. */ final_type = base_type + OFFSET_14R_FROM_21L; break; case e_fsel: - /* R_PARISC_DLTREL14F for elf64, R_PARISC_DPREL14F for elf32 */ + /* R_PARISC_DLTREL14F for elf64, R_PARISC_DPREL14F for elf32. */ final_type = base_type + OFFSET_14F_FROM_21L; break; default: @@ -721,7 +736,7 @@ elf_hppa_reloc_final_type (bfd *abfd, case e_ldsel: case e_nlsel: case e_nlrsel: - /* R_PARISC_DLTREL21L for elf64, R_PARISC_DPREL21L for elf32 */ + /* R_PARISC_DLTREL21L for elf64, R_PARISC_DPREL21L for elf32. */ final_type = base_type; break; default: @@ -838,6 +853,82 @@ elf_hppa_reloc_final_type (bfd *abfd, } break; + case R_PARISC_TLS_GD21L: + switch (field) + { + case e_ltsel: + case e_lrsel: + final_type = R_PARISC_TLS_GD21L; + break; + case e_rtsel: + case e_rrsel: + final_type = R_PARISC_TLS_GD14R; + break; + default: + return R_PARISC_NONE; + } + break; + + case R_PARISC_TLS_LDM21L: + switch (field) + { + case e_ltsel: + case e_lrsel: + final_type = R_PARISC_TLS_LDM21L; + break; + case e_rtsel: + case e_rrsel: + final_type = R_PARISC_TLS_LDM14R; + break; + default: + return R_PARISC_NONE; + } + break; + + case R_PARISC_TLS_LDO21L: + switch (field) + { + case e_lrsel: + final_type = R_PARISC_TLS_LDO21L; + break; + case e_rrsel: + final_type = R_PARISC_TLS_LDO14R; + break; + default: + return R_PARISC_NONE; + } + break; + + case R_PARISC_TLS_IE21L: + switch (field) + { + case e_ltsel: + case e_lrsel: + final_type = R_PARISC_TLS_IE21L; + break; + case e_rtsel: + case e_rrsel: + final_type = R_PARISC_TLS_IE14R; + break; + default: + return R_PARISC_NONE; + } + break; + + case R_PARISC_TLS_LE21L: + switch (field) + { + case e_lrsel: + final_type = R_PARISC_TLS_LE21L; + break; + case e_rrsel: + final_type = R_PARISC_TLS_LE14R; + break; + default: + return R_PARISC_NONE; + } + break; + case R_PARISC_GNU_VTENTRY: case R_PARISC_GNU_VTINHERIT: case R_PARISC_SEGREL32: @@ -906,7 +997,7 @@ elf_hppa_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc) { - BFD_ASSERT (ELF_R_TYPE(elf_reloc->r_info) + BFD_ASSERT (ELF_R_TYPE (elf_reloc->r_info) < (unsigned int) R_PARISC_UNIMPLEMENTED); bfd_reloc->howto = &elf_hppa_howto_table[ELF_R_TYPE (elf_reloc->r_info)]; } @@ -926,13 +1017,29 @@ elf_hppa_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +elf_hppa_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (elf_hppa_howto_table) / sizeof (elf_hppa_howto_table[0]); + i++) + if (elf_hppa_howto_table[i].name != NULL + && strcasecmp (elf_hppa_howto_table[i].name, r_name) == 0) + return &elf_hppa_howto_table[i]; + + return NULL; +} + /* Return TRUE if SYM represents a local label symbol. */ static bfd_boolean elf_hppa_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED, const char *name) { if (name[0] == 'L' && name[1] == '$') - return 1; + return TRUE; return _bfd_elf_is_local_label_name (abfd, name); } @@ -950,6 +1057,7 @@ elf_hppa_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec) { int indx; asection *asec; + #if ARCH_SIZE == 64 hdr->sh_type = SHT_LOPROC + 1; #else @@ -1030,7 +1138,8 @@ hppa_unwind_entry_compare (const void *a, const void *b) return av < bv ? -1 : av > bv ? 1 : 0; } -static bfd_boolean elf_hppa_sort_unwind (bfd *abfd) +static bfd_boolean +elf_hppa_sort_unwind (bfd *abfd) { asection *s; @@ -1315,208 +1424,116 @@ elf_hppa_final_link (bfd *abfd, struct bfd_link_info *info) return retval; } -/* Relocate an HPPA ELF section. */ +/* Relocate the given INSN. VALUE should be the actual value we want + to insert into the instruction, ie by this point we should not be + concerned with computing an offset relative to the DLT, PC, etc. + Instead this routine is meant to handle the bit manipulations needed + to insert the relocation into the given instruction. */ -static bfd_boolean -elf_hppa_relocate_section (bfd *output_bfd, - struct bfd_link_info *info, - bfd *input_bfd, - asection *input_section, - bfd_byte *contents, - Elf_Internal_Rela *relocs, - Elf_Internal_Sym *local_syms, - asection **local_sections) +static int +elf_hppa_relocate_insn (int insn, int sym_value, unsigned int r_type) { - Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Rela *rel; - Elf_Internal_Rela *relend; - struct elf64_hppa_link_hash_table *hppa_info; - - if (info->relocatable) - return TRUE; - - hppa_info = elf64_hppa_hash_table (info); - symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; - - rel = relocs; - relend = relocs + input_section->reloc_count; - for (; rel < relend; rel++) + switch (r_type) { - int r_type; - reloc_howto_type *howto = elf_hppa_howto_table + ELF_R_TYPE (rel->r_info); - unsigned long r_symndx; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; - asection *sym_sec; - bfd_vma relocation; - bfd_reloc_status_type r; - const char *dyn_name; - char *dynh_buf = NULL; - size_t dynh_buflen = 0; - struct elf64_hppa_dyn_hash_entry *dyn_h = NULL; + /* This is any 22 bit branch. In PA2.0 syntax it corresponds to + the "B" instruction. */ + case R_PARISC_PCREL22F: + case R_PARISC_PCREL22C: + return (insn & ~0x3ff1ffd) | re_assemble_22 (sym_value); - r_type = ELF_R_TYPE (rel->r_info); - if (r_type < 0 || r_type >= (int) R_PARISC_UNIMPLEMENTED) - { - bfd_set_error (bfd_error_bad_value); - return FALSE; - } + /* This is any 12 bit branch. */ + case R_PARISC_PCREL12F: + return (insn & ~0x1ffd) | re_assemble_12 (sym_value); - /* This is a final link. */ - r_symndx = ELF_R_SYM (rel->r_info); - h = NULL; - sym = NULL; - sym_sec = NULL; - if (r_symndx < symtab_hdr->sh_info) - { - /* This is a local symbol. */ - sym = local_syms + r_symndx; - sym_sec = local_sections[r_symndx]; - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sym_sec, rel); + /* This is any 17 bit branch. In PA2.0 syntax it also corresponds + to the "B" instruction as well as BE. */ + case R_PARISC_PCREL17F: + case R_PARISC_DIR17F: + case R_PARISC_DIR17R: + case R_PARISC_PCREL17C: + case R_PARISC_PCREL17R: + return (insn & ~0x1f1ffd) | re_assemble_17 (sym_value); - /* If this symbol has an entry in the PA64 dynamic hash - table, then get it. */ - dyn_name = get_dyn_name (input_bfd, h, rel, - &dynh_buf, &dynh_buflen); - dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table, - dyn_name, FALSE, FALSE); + /* ADDIL or LDIL instructions. */ + case R_PARISC_DLTREL21L: + case R_PARISC_DLTIND21L: + case R_PARISC_LTOFF_FPTR21L: + case R_PARISC_PCREL21L: + case R_PARISC_LTOFF_TP21L: + case R_PARISC_DPREL21L: + case R_PARISC_PLTOFF21L: + case R_PARISC_DIR21L: + return (insn & ~0x1fffff) | re_assemble_21 (sym_value); - } - else - { - /* This is not a local symbol. */ - long indx; + /* LDO and integer loads/stores with 14 bit displacements. */ + case R_PARISC_DLTREL14R: + case R_PARISC_DLTREL14F: + case R_PARISC_DLTIND14R: + case R_PARISC_DLTIND14F: + case R_PARISC_LTOFF_FPTR14R: + case R_PARISC_PCREL14R: + case R_PARISC_PCREL14F: + case R_PARISC_LTOFF_TP14R: + case R_PARISC_LTOFF_TP14F: + case R_PARISC_DPREL14R: + case R_PARISC_DPREL14F: + case R_PARISC_PLTOFF14R: + case R_PARISC_PLTOFF14F: + case R_PARISC_DIR14R: + case R_PARISC_DIR14F: + return (insn & ~0x3fff) | low_sign_unext (sym_value, 14); - indx = r_symndx - symtab_hdr->sh_info; - h = elf_sym_hashes (input_bfd)[indx]; - while (h->root.type == bfd_link_hash_indirect - || h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - { - sym_sec = h->root.u.def.section; + /* PA2.0W LDO and integer loads/stores with 16 bit displacements. */ + case R_PARISC_LTOFF_FPTR16F: + case R_PARISC_PCREL16F: + case R_PARISC_LTOFF_TP16F: + case R_PARISC_GPREL16F: + case R_PARISC_PLTOFF16F: + case R_PARISC_DIR16F: + case R_PARISC_LTOFF16F: + return (insn & ~0xffff) | re_assemble_16 (sym_value); - /* If this symbol has an entry in the PA64 dynamic hash - table, then get it. */ - dyn_name = get_dyn_name (input_bfd, h, rel, - &dynh_buf, &dynh_buflen); - dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table, - dyn_name, FALSE, FALSE); + /* Doubleword loads and stores with a 14 bit displacement. */ + case R_PARISC_DLTREL14DR: + case R_PARISC_DLTIND14DR: + case R_PARISC_LTOFF_FPTR14DR: + case R_PARISC_LTOFF_FPTR16DF: + case R_PARISC_PCREL14DR: + case R_PARISC_PCREL16DF: + case R_PARISC_LTOFF_TP14DR: + case R_PARISC_LTOFF_TP16DF: + case R_PARISC_DPREL14DR: + case R_PARISC_GPREL16DF: + case R_PARISC_PLTOFF14DR: + case R_PARISC_PLTOFF16DF: + case R_PARISC_DIR14DR: + case R_PARISC_DIR16DF: + case R_PARISC_LTOFF16DF: + return (insn & ~0x3ff1) | (((sym_value & 0x2000) >> 13) + | ((sym_value & 0x1ff8) << 1)); - /* If we have a relocation against a symbol defined in a - shared library and we have not created an entry in the - PA64 dynamic symbol hash table for it, then we lose. */ - if (sym_sec->output_section == NULL && dyn_h == NULL) - { - (*_bfd_error_handler) - (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"), - input_bfd, - input_section, - (long) rel->r_offset, - howto->name, - h->root.root.string); - relocation = 0; - } - else if (sym_sec->output_section) - relocation = (h->root.u.def.value - + sym_sec->output_offset - + sym_sec->output_section->vma); - /* Value will be provided via one of the offsets in the - dyn_h hash table entry. */ - else - relocation = 0; - } - else if (info->unresolved_syms_in_objects == RM_IGNORE - && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - { - /* If this symbol has an entry in the PA64 dynamic hash - table, then get it. */ - dyn_name = get_dyn_name (input_bfd, h, rel, - &dynh_buf, &dynh_buflen); - dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table, - dyn_name, FALSE, FALSE); + /* Floating point single word load/store instructions. */ + case R_PARISC_DLTREL14WR: + case R_PARISC_DLTIND14WR: + case R_PARISC_LTOFF_FPTR14WR: + case R_PARISC_LTOFF_FPTR16WF: + case R_PARISC_PCREL14WR: + case R_PARISC_PCREL16WF: + case R_PARISC_LTOFF_TP14WR: + case R_PARISC_LTOFF_TP16WF: + case R_PARISC_DPREL14WR: + case R_PARISC_GPREL16WF: + case R_PARISC_PLTOFF14WR: + case R_PARISC_PLTOFF16WF: + case R_PARISC_DIR16WF: + case R_PARISC_DIR14WR: + case R_PARISC_LTOFF16WF: + return (insn & ~0x3ff9) | (((sym_value & 0x2000) >> 13) + | ((sym_value & 0x1ffc) << 1)); - if (dyn_h == NULL) - { - (*_bfd_error_handler) - (_("%B(%A): warning: unresolvable relocation against symbol `%s'"), - input_bfd, input_section, h->root.root.string); - } - relocation = 0; - } - else if (h->root.type == bfd_link_hash_undefweak) - { - dyn_name = get_dyn_name (input_bfd, h, rel, - &dynh_buf, &dynh_buflen); - dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table, - dyn_name, FALSE, FALSE); - - if (dyn_h == NULL) - { - (*_bfd_error_handler) - (_("%B(%A): warning: unresolvable relocation against symbol `%s'"), - input_bfd, input_section, h->root.root.string); - } - relocation = 0; - } - else - { - /* Ignore dynamic loader defined symbols. */ - if (elf_hppa_is_dynamic_loader_symbol (h->root.root.string)) - relocation = 0; - else - { - if (!((*info->callbacks->undefined_symbol) - (info, h->root.root.string, input_bfd, - input_section, rel->r_offset, - (info->unresolved_syms_in_objects == RM_GENERATE_ERROR - || ELF_ST_VISIBILITY (h->other))))) - return FALSE; - break; - } - } - } - - r = elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, - input_section, contents, - relocation, info, sym_sec, - h, dyn_h); - - if (r != bfd_reloc_ok) - { - switch (r) - { - default: - abort (); - case bfd_reloc_overflow: - { - const char *sym_name; - - if (h != NULL) - sym_name = NULL; - else - { - sym_name = bfd_elf_string_from_elf_section (input_bfd, - symtab_hdr->sh_link, - sym->st_name); - if (sym_name == NULL) - return FALSE; - if (*sym_name == '\0') - sym_name = bfd_section_name (input_bfd, sym_sec); - } - - if (!((*info->callbacks->reloc_overflow) - (info, (h ? &h->root : NULL), sym_name, - howto->name, (bfd_vma) 0, input_bfd, - input_section, rel->r_offset))) - return FALSE; - } - break; - } - } + default: + return insn; } - return TRUE; } /* Compute the value for a relocation (REL) during a final link stage, @@ -1806,10 +1823,8 @@ elf_hppa_final_link_relocate (Elf_Internal_Rela *rel, value = hppa_field_adjust (value, addend, e_rrsel); if (r_type == R_PARISC_DIR17R || r_type == R_PARISC_DIR17F) - { - /* All branches are implicitly shifted by 2 places. */ - value >>= 2; - } + /* All branches are implicitly shifted by 2 places. */ + value >>= 2; insn = elf_hppa_relocate_insn (insn, (int) value, r_type); break; @@ -2081,115 +2096,212 @@ elf_hppa_final_link_relocate (Elf_Internal_Rela *rel, return bfd_reloc_ok; } -/* Relocate the given INSN. VALUE should be the actual value we want - to insert into the instruction, ie by this point we should not be - concerned with computing an offset relative to the DLT, PC, etc. - Instead this routine is meant to handle the bit manipulations needed - to insert the relocation into the given instruction. */ +/* Relocate an HPPA ELF section. */ -static int -elf_hppa_relocate_insn (int insn, int sym_value, unsigned int r_type) +static bfd_boolean +elf_hppa_relocate_section (bfd *output_bfd, + struct bfd_link_info *info, + bfd *input_bfd, + asection *input_section, + bfd_byte *contents, + Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, + asection **local_sections) { - switch (r_type) + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Rela *rel; + Elf_Internal_Rela *relend; + struct elf64_hppa_link_hash_table *hppa_info; + + hppa_info = elf64_hppa_hash_table (info); + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + + rel = relocs; + relend = relocs + input_section->reloc_count; + for (; rel < relend; rel++) { - /* This is any 22 bit branch. In PA2.0 syntax it corresponds to - the "B" instruction. */ - case R_PARISC_PCREL22F: - case R_PARISC_PCREL22C: - return (insn & ~0x3ff1ffd) | re_assemble_22 (sym_value); + int r_type; + reloc_howto_type *howto = elf_hppa_howto_table + ELF_R_TYPE (rel->r_info); + unsigned long r_symndx; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; + asection *sym_sec; + bfd_vma relocation; + bfd_reloc_status_type r; + const char *dyn_name; + char *dynh_buf = NULL; + size_t dynh_buflen = 0; + struct elf64_hppa_dyn_hash_entry *dyn_h = NULL; - /* This is any 12 bit branch. */ - case R_PARISC_PCREL12F: - return (insn & ~0x1ffd) | re_assemble_12 (sym_value); + r_type = ELF_R_TYPE (rel->r_info); + if (r_type < 0 || r_type >= (int) R_PARISC_UNIMPLEMENTED) + { + bfd_set_error (bfd_error_bad_value); + return FALSE; + } - /* This is any 17 bit branch. In PA2.0 syntax it also corresponds - to the "B" instruction as well as BE. */ - case R_PARISC_PCREL17F: - case R_PARISC_DIR17F: - case R_PARISC_DIR17R: - case R_PARISC_PCREL17C: - case R_PARISC_PCREL17R: - return (insn & ~0x1f1ffd) | re_assemble_17 (sym_value); + /* This is a final link. */ + r_symndx = ELF_R_SYM (rel->r_info); + h = NULL; + sym = NULL; + sym_sec = NULL; + if (r_symndx < symtab_hdr->sh_info) + { + /* This is a local symbol. */ + sym = local_syms + r_symndx; + sym_sec = local_sections[r_symndx]; + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sym_sec, rel); - /* ADDIL or LDIL instructions. */ - case R_PARISC_DLTREL21L: - case R_PARISC_DLTIND21L: - case R_PARISC_LTOFF_FPTR21L: - case R_PARISC_PCREL21L: - case R_PARISC_LTOFF_TP21L: - case R_PARISC_DPREL21L: - case R_PARISC_PLTOFF21L: - case R_PARISC_DIR21L: - return (insn & ~0x1fffff) | re_assemble_21 (sym_value); + /* If this symbol has an entry in the PA64 dynamic hash + table, then get it. */ + dyn_name = get_dyn_name (input_bfd, h, rel, + &dynh_buf, &dynh_buflen); + dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table, + dyn_name, FALSE, FALSE); - /* LDO and integer loads/stores with 14 bit displacements. */ - case R_PARISC_DLTREL14R: - case R_PARISC_DLTREL14F: - case R_PARISC_DLTIND14R: - case R_PARISC_DLTIND14F: - case R_PARISC_LTOFF_FPTR14R: - case R_PARISC_PCREL14R: - case R_PARISC_PCREL14F: - case R_PARISC_LTOFF_TP14R: - case R_PARISC_LTOFF_TP14F: - case R_PARISC_DPREL14R: - case R_PARISC_DPREL14F: - case R_PARISC_PLTOFF14R: - case R_PARISC_PLTOFF14F: - case R_PARISC_DIR14R: - case R_PARISC_DIR14F: - return (insn & ~0x3fff) | low_sign_unext (sym_value, 14); + } + else + { + /* This is not a local symbol. */ + long indx; - /* PA2.0W LDO and integer loads/stores with 16 bit displacements. */ - case R_PARISC_LTOFF_FPTR16F: - case R_PARISC_PCREL16F: - case R_PARISC_LTOFF_TP16F: - case R_PARISC_GPREL16F: - case R_PARISC_PLTOFF16F: - case R_PARISC_DIR16F: - case R_PARISC_LTOFF16F: - return (insn & ~0xffff) | re_assemble_16 (sym_value); + relocation = 0; + indx = r_symndx - symtab_hdr->sh_info; + h = elf_sym_hashes (input_bfd)[indx]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + sym_sec = h->root.u.def.section; - /* Doubleword loads and stores with a 14 bit displacement. */ - case R_PARISC_DLTREL14DR: - case R_PARISC_DLTIND14DR: - case R_PARISC_LTOFF_FPTR14DR: - case R_PARISC_LTOFF_FPTR16DF: - case R_PARISC_PCREL14DR: - case R_PARISC_PCREL16DF: - case R_PARISC_LTOFF_TP14DR: - case R_PARISC_LTOFF_TP16DF: - case R_PARISC_DPREL14DR: - case R_PARISC_GPREL16DF: - case R_PARISC_PLTOFF14DR: - case R_PARISC_PLTOFF16DF: - case R_PARISC_DIR14DR: - case R_PARISC_DIR16DF: - case R_PARISC_LTOFF16DF: - return (insn & ~0x3ff1) | (((sym_value & 0x2000) >> 13) - | ((sym_value & 0x1ff8) << 1)); + /* If this symbol has an entry in the PA64 dynamic hash + table, then get it. */ + dyn_name = get_dyn_name (input_bfd, h, rel, + &dynh_buf, &dynh_buflen); + dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table, + dyn_name, FALSE, FALSE); - /* Floating point single word load/store instructions. */ - case R_PARISC_DLTREL14WR: - case R_PARISC_DLTIND14WR: - case R_PARISC_LTOFF_FPTR14WR: - case R_PARISC_LTOFF_FPTR16WF: - case R_PARISC_PCREL14WR: - case R_PARISC_PCREL16WF: - case R_PARISC_LTOFF_TP14WR: - case R_PARISC_LTOFF_TP16WF: - case R_PARISC_DPREL14WR: - case R_PARISC_GPREL16WF: - case R_PARISC_PLTOFF14WR: - case R_PARISC_PLTOFF16WF: - case R_PARISC_DIR16WF: - case R_PARISC_DIR14WR: - case R_PARISC_LTOFF16WF: - return (insn & ~0x3ff9) | (((sym_value & 0x2000) >> 13) - | ((sym_value & 0x1ffc) << 1)); + /* If we have a relocation against a symbol defined in a + shared library and we have not created an entry in the + PA64 dynamic symbol hash table for it, then we lose. */ + if (!info->relocatable + && sym_sec->output_section == NULL && dyn_h == NULL) + { + (*_bfd_error_handler) + (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"), + input_bfd, + input_section, + (long) rel->r_offset, + howto->name, + h->root.root.string); + } + else if (sym_sec->output_section) + relocation = (h->root.u.def.value + + sym_sec->output_offset + + sym_sec->output_section->vma); + } + else if (info->unresolved_syms_in_objects == RM_IGNORE + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) + { + /* If this symbol has an entry in the PA64 dynamic hash + table, then get it. */ + dyn_name = get_dyn_name (input_bfd, h, rel, + &dynh_buf, &dynh_buflen); + dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table, + dyn_name, FALSE, FALSE); - default: - return insn; + if (!info->relocatable && dyn_h == NULL) + { + (*_bfd_error_handler) + (_("%B(%A): warning: unresolvable relocation against symbol `%s'"), + input_bfd, input_section, h->root.root.string); + } + } + else if (h->root.type == bfd_link_hash_undefweak) + { + dyn_name = get_dyn_name (input_bfd, h, rel, + &dynh_buf, &dynh_buflen); + dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table, + dyn_name, FALSE, FALSE); + + if (!info->relocatable && dyn_h == NULL) + { + (*_bfd_error_handler) + (_("%B(%A): warning: unresolvable relocation against symbol `%s'"), + input_bfd, input_section, h->root.root.string); + } + } + else if (!info->relocatable) + { + /* Ignore dynamic loader defined symbols. */ + if (!elf_hppa_is_dynamic_loader_symbol (h->root.root.string)) + { + if (!((*info->callbacks->undefined_symbol) + (info, h->root.root.string, input_bfd, + input_section, rel->r_offset, + (info->unresolved_syms_in_objects == RM_GENERATE_ERROR + || ELF_ST_VISIBILITY (h->other))))) + return FALSE; + break; + } + } + } + + if (sym_sec != NULL && elf_discarded_section (sym_sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + + r = elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, + input_section, contents, + relocation, info, sym_sec, + h, dyn_h); + + if (r != bfd_reloc_ok) + { + switch (r) + { + default: + abort (); + case bfd_reloc_overflow: + { + const char *sym_name; + + if (h != NULL) + sym_name = NULL; + else + { + sym_name = bfd_elf_string_from_elf_section (input_bfd, + symtab_hdr->sh_link, + sym->st_name); + if (sym_name == NULL) + return FALSE; + if (*sym_name == '\0') + sym_name = bfd_section_name (input_bfd, sym_sec); + } + + if (!((*info->callbacks->reloc_overflow) + (info, (h ? &h->root : NULL), sym_name, + howto->name, (bfd_vma) 0, input_bfd, + input_section, rel->r_offset))) + return FALSE; + } + break; + } + } } + return TRUE; } -#endif + +#endif /* ARCH_SIZE == 64 */ diff --git a/bfd/elf-m10200.c b/bfd/elf-m10200.c index a39e4389d07..8189239f463 100644 --- a/bfd/elf-m10200.c +++ b/bfd/elf-m10200.c @@ -1,5 +1,5 @@ /* Matsushita 10200 specific support for 32-bit ELF - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" @@ -207,6 +207,23 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code) return NULL; } +static reloc_howto_type * +bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (elf_mn10200_howto_table) + / sizeof (elf_mn10200_howto_table[0])); + i++) + if (elf_mn10200_howto_table[i].name != NULL + && strcasecmp (elf_mn10200_howto_table[i].name, r_name) == 0) + return &elf_mn10200_howto_table[i]; + + return NULL; +} + /* Set the howto pointer for an MN10200 ELF reloc. */ static void @@ -343,9 +360,6 @@ mn10200_elf_relocate_section (output_bfd, info, input_bfd, input_section, struct elf_link_hash_entry **sym_hashes; Elf_Internal_Rela *rel, *relend; - if (info->relocatable) - return TRUE; - symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -385,6 +399,20 @@ mn10200_elf_relocate_section (output_bfd, info, input_bfd, input_section, unresolved_reloc, warned); } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + r = mn10200_elf_final_link_relocate (howto, input_bfd, output_bfd, input_section, contents, rel->r_offset, diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c index 509f2a102e3..992b2a4961f 100644 --- a/bfd/elf-m10300.c +++ b/bfd/elf-m10300.c @@ -1,25 +1,25 @@ /* Matsushita 10300 specific support for 32-bit ELF Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006 Free Software Foundation, Inc. + 2006, 2007 Free Software Foundation, Inc. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -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 2 of the License, or -(at your option) any later version. + 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 2 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. + 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. */ + 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/mn10300.h" @@ -85,6 +85,9 @@ struct elf32_mn10300_link_hash_entry { prologue deleted. */ #define MN10300_DELETED_PROLOGUE_BYTES 0x2 unsigned char flags; + + /* Calculated value. */ + bfd_vma value; }; /* We derive a hash table from the main elf linker hash table so @@ -131,9 +134,6 @@ static void mn10300_info_to_howto static bfd_boolean mn10300_elf_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); -static asection *mn10300_elf_gc_mark_hook - PARAMS ((asection *, struct bfd_link_info *info, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *)); static bfd_boolean mn10300_elf_relax_delete_bytes PARAMS ((bfd *, asection *, bfd_vma, int)); static bfd_boolean mn10300_elf_symbol_address_p @@ -637,6 +637,23 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code) return NULL; } +static reloc_howto_type * +bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (elf_mn10300_howto_table) + / sizeof (elf_mn10300_howto_table[0])); + i++) + if (elf_mn10300_howto_table[i].name != NULL + && strcasecmp (elf_mn10300_howto_table[i].name, r_name) == 0) + return &elf_mn10300_howto_table[i]; + + return NULL; +} + /* Set the howto pointer for an MN10300 ELF reloc. */ static void @@ -883,7 +900,7 @@ mn10300_elf_check_relocs (abfd, info, sec, relocs) if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (abfd, sec), name + 5) == 0); @@ -919,40 +936,21 @@ mn10300_elf_check_relocs (abfd, info, sec, relocs) relocation. */ static asection * -mn10300_elf_gc_mark_hook (sec, info, rel, h, sym) - asection *sec; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +mn10300_elf_gc_mark_hook (asection *sec, + struct bfd_link_info *info, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_MN10300_GNU_VTINHERIT: - case R_MN10300_GNU_VTENTRY: - break; + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_MN10300_GNU_VTINHERIT: + case R_MN10300_GNU_VTENTRY: + return NULL; + } - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Perform a relocation as part of a final link. */ @@ -1033,7 +1031,7 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd, if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (input_bfd, input_section), name + 5) == 0); @@ -1381,9 +1379,6 @@ mn10300_elf_relocate_section (output_bfd, info, input_bfd, input_section, struct elf_link_hash_entry **sym_hashes; Elf_Internal_Rela *rel, *relend; - if (info->relocatable) - return TRUE; - symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -1459,7 +1454,7 @@ mn10300_elf_relocate_section (output_bfd, info, input_bfd, input_section, obscure cases sec->output_section will be NULL. */ relocation = 0; - else if (unresolved_reloc) + else if (!info->relocatable && unresolved_reloc) (*_bfd_error_handler) (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"), input_bfd, @@ -1469,6 +1464,20 @@ mn10300_elf_relocate_section (output_bfd, info, input_bfd, input_section, h->root.root.root.string); } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + r = mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd, input_section, contents, rel->r_offset, @@ -1518,7 +1527,12 @@ mn10300_elf_relocate_section (output_bfd, info, input_bfd, input_section, goto common_error; case bfd_reloc_dangerous: - msg = _("internal error: dangerous error"); + if (r_type == R_MN10300_PCREL32) + msg = _("error: inappropriate relocation type for shared" + " library (did you forget -fpic?)"); + else + msg = _("internal error: suspicious relocation type used" + " in shared library"); goto common_error; default: @@ -1602,6 +1616,42 @@ elf32_mn10300_finish_hash_table_entry (gen_entry, in_args) return TRUE; } +/* Used to count hash table entries. */ +static bfd_boolean +elf32_mn10300_count_hash_table_entries (struct bfd_hash_entry *gen_entry ATTRIBUTE_UNUSED, + PTR in_args) +{ + int *count = (int *)in_args; + + (*count) ++; + return TRUE; +} + +/* Used to enumerate hash table entries into a linear array. */ +static bfd_boolean +elf32_mn10300_list_hash_table_entries (struct bfd_hash_entry *gen_entry, + PTR in_args) +{ + struct bfd_hash_entry ***ptr = (struct bfd_hash_entry ***) in_args; + + **ptr = gen_entry; + (*ptr) ++; + return TRUE; +} + +/* Used to sort the array created by the above. */ +static int +sort_by_value (const void *va, const void *vb) +{ + struct elf32_mn10300_link_hash_entry *a + = *(struct elf32_mn10300_link_hash_entry **)va; + struct elf32_mn10300_link_hash_entry *b + = *(struct elf32_mn10300_link_hash_entry **)vb; + + return a->value - b->value; +} + + /* This function handles relaxing for the mn10300. There are quite a few relaxing opportunities available on the mn10300: @@ -1697,9 +1747,10 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) char *new_name; /* If there's nothing to do in this section, skip it. */ - if (! (((section->flags & SEC_RELOC) != 0 - && section->reloc_count != 0) - || (section->flags & SEC_CODE) != 0)) + if (! ((section->flags & SEC_RELOC) != 0 + && section->reloc_count != 0)) + continue; + if ((section->flags & SEC_ALLOC) == 0) continue; /* Get cached copy of section contents if it exists. */ @@ -1802,13 +1853,17 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) elf_sym_hashes (input_bfd)[r_index]; } - /* If this is not a "call" instruction, then we - should convert "call" instructions to "calls" - instructions. */ - code = bfd_get_8 (input_bfd, - contents + irel->r_offset - 1); - if (code != 0xdd && code != 0xcd) - hash->flags |= MN10300_CONVERT_CALL_TO_CALLS; + sym_name = hash->root.root.root.string; + if ((section->flags & SEC_CODE) != 0) + { + /* If this is not a "call" instruction, then we + should convert "call" instructions to "calls" + instructions. */ + code = bfd_get_8 (input_bfd, + contents + irel->r_offset - 1); + if (code != 0xdd && code != 0xcd) + hash->flags |= MN10300_CONVERT_CALL_TO_CALLS; + } /* If this is a jump/call, then bump the direct_calls counter. Else force "call" to @@ -1901,6 +1956,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) free (new_name); compute_function_info (input_bfd, hash, isym->st_value, contents); + hash->value = isym->st_value; } } @@ -1962,6 +2018,44 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) elf32_mn10300_finish_hash_table_entry, link_info); + { + /* This section of code collects all our local symbols, sorts + them by value, and looks for multiple symbols referring to + the same address. For those symbols, the flags are merged. + At this point, the only flag that can be set is + MN10300_CONVERT_CALL_TO_CALLS, so we simply OR the flags + together. */ + int static_count = 0, i; + struct elf32_mn10300_link_hash_entry **entries; + struct elf32_mn10300_link_hash_entry **ptr; + + elf32_mn10300_link_hash_traverse (hash_table->static_hash_table, + elf32_mn10300_count_hash_table_entries, + &static_count); + + entries = (struct elf32_mn10300_link_hash_entry **) + bfd_malloc (static_count * sizeof (struct elf32_mn10300_link_hash_entry *)); + + ptr = entries; + elf32_mn10300_link_hash_traverse (hash_table->static_hash_table, + elf32_mn10300_list_hash_table_entries, + &ptr); + + qsort (entries, static_count, sizeof(entries[0]), sort_by_value); + + for (i=0; ivalue && entries[i]->value == entries[i+1]->value) + { + int v = entries[i]->flags; + int j; + for (j=i+1; jvalue == entries[i]->value; j++) + v |= entries[j]->flags; + for (j=i; jvalue == entries[i]->value; j++) + entries[j]->flags = v; + i = j-1; + } + } + /* All entries in the hash table are fully initialized. */ hash_table->flags |= MN10300_HASH_ENTRIES_INITIALIZED; @@ -2795,8 +2889,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) into a 16bit immediate, displacement or absolute address. */ if (ELF32_R_TYPE (irel->r_info) == (int) R_MN10300_32 || ELF32_R_TYPE (irel->r_info) == (int) R_MN10300_GOT32 - || ELF32_R_TYPE (irel->r_info) == (int) R_MN10300_GOTOFF32 - || ELF32_R_TYPE (irel->r_info) == (int) R_MN10300_GOTPC32) + || ELF32_R_TYPE (irel->r_info) == (int) R_MN10300_GOTOFF32) { bfd_vma value = symval; @@ -3677,6 +3770,7 @@ elf32_mn10300_link_hash_newfunc (entry, table, string) ret->movm_args = 0; ret->movm_stack_size = 0; ret->flags = 0; + ret->value = 0; } return (struct bfd_hash_entry *) ret; @@ -4002,7 +4096,6 @@ _bfd_mn10300_elf_adjust_dynamic_symbol (info, h) { bfd * dynobj; asection * s; - unsigned int power_of_two; dynobj = elf_hash_table (info)->dynobj; @@ -4142,28 +4235,7 @@ _bfd_mn10300_elf_adjust_dynamic_symbol (info, h) h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 3) - power_of_two = 3; - - /* Apply the required alignment. */ - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (dynobj, s)) - { - if (! bfd_set_section_alignment (dynobj, s, power_of_two)) - return FALSE; - } - - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Set the sizes of the dynamic sections. */ @@ -4227,7 +4299,7 @@ _bfd_mn10300_elf_size_dynamic_sections (output_bfd, info) /* Remember whether there is a PLT. */ plt = s->size != 0; } - else if (strncmp (name, ".rela", 5) == 0) + else if (CONST_STRNEQ (name, ".rela")) { if (s->size != 0) { @@ -4260,7 +4332,7 @@ _bfd_mn10300_elf_size_dynamic_sections (output_bfd, info) s->reloc_count = 0; } } - else if (strncmp (name, ".got", 4) != 0 + else if (! CONST_STRNEQ (name, ".got") && strcmp (name, ".dynbss") != 0) /* It's not one of our sections, so don't allocate space. */ continue; @@ -4695,6 +4767,8 @@ _bfd_mn10300_elf_reloc_type_class (const Elf_Internal_Rela *rela) _bfd_mn10300_elf_adjust_dynamic_symbol #define elf_backend_size_dynamic_sections \ _bfd_mn10300_elf_size_dynamic_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_finish_dynamic_symbol \ _bfd_mn10300_elf_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections \ diff --git a/bfd/elf-strtab.c b/bfd/elf-strtab.c index a0ce1d79ea8..f5d6db1c10c 100644 --- a/bfd/elf-strtab.c +++ b/bfd/elf-strtab.c @@ -1,5 +1,6 @@ /* ELF strtab with GC and suffix merging support. - Copyright 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003, 2005, 2006, 2007 + Free Software Foundation, Inc. Written by Jakub Jelinek . This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +19,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "hashtab.h" diff --git a/bfd/elf-vxworks.c b/bfd/elf-vxworks.c index 90e620a9055..7b0d5909097 100644 --- a/bfd/elf-vxworks.c +++ b/bfd/elf-vxworks.c @@ -1,5 +1,5 @@ /* VxWorks support for ELF - Copyright 2005 Free Software Foundation, Inc. + Copyright 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -20,15 +20,34 @@ /* This file provides routines used by all VxWorks targets. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf-vxworks.h" +/* Return true if symbol NAME, as defined by ABFD, is one of the special + __GOTT_BASE__ or __GOTT_INDEX__ symbols. */ + +static bfd_boolean +elf_vxworks_gott_symbol_p (bfd *abfd, const char *name) +{ + char leading; + + leading = bfd_get_symbol_leading_char (abfd); + if (leading) + { + if (*name != leading) + return FALSE; + name++; + } + return (strcmp (name, "__GOTT_BASE__") == 0 + || strcmp (name, "__GOTT_INDEX__") == 0); +} + /* Tweak magic VxWorks symbols as they are loaded. */ bfd_boolean -elf_vxworks_add_symbol_hook (bfd *abfd ATTRIBUTE_UNUSED, +elf_vxworks_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, Elf_Internal_Sym *sym, const char **namep, @@ -45,8 +64,7 @@ elf_vxworks_add_symbol_hook (bfd *abfd ATTRIBUTE_UNUSED, This transformation will be undone in elf_i386_vxworks_link_output_symbol_hook. */ if ((info->shared || abfd->flags & DYNAMIC) - && (strcmp (*namep, "__GOTT_INDEX__") == 0 - || strcmp (*namep, "__GOTT_BASE__") == 0)) + && elf_vxworks_gott_symbol_p (abfd, *namep)) { sym->st_info = ELF_ST_INFO (STB_WEAK, ELF_ST_TYPE (sym->st_info)); *flagsp |= BSF_WEAK; @@ -114,16 +132,12 @@ elf_vxworks_link_output_symbol_hook (struct bfd_link_info *info const char *name, Elf_Internal_Sym *sym, asection *input_sec ATTRIBUTE_UNUSED, - struct elf_link_hash_entry *h - ATTRIBUTE_UNUSED) + struct elf_link_hash_entry *h) { - /* Ignore the first dummy symbol. */ - if (!name) - return TRUE; - /* Reverse the effects of the hack in elf_vxworks_add_symbol_hook. */ - if (strcmp (name, "__GOTT_INDEX__") == 0 - || strcmp (name, "__GOTT_BASE__") == 0) + if (h + && h->root.type == bfd_link_hash_undefweak + && elf_vxworks_gott_symbol_p (h->root.u.undef.abfd, name)) sym->st_info = ELF_ST_INFO (STB_GLOBAL, ELF_ST_TYPE (sym->st_info)); return TRUE; @@ -156,7 +170,8 @@ elf_vxworks_emit_relocs (bfd *output_bfd, && *rel_hash && (*rel_hash)->def_dynamic && !(*rel_hash)->def_regular - && (*rel_hash)->root.type == bfd_link_hash_defined + && ((*rel_hash)->root.type == bfd_link_hash_defined + || (*rel_hash)->root.type == bfd_link_hash_defweak) && (*rel_hash)->root.u.def.section->output_section != NULL) { /* This is a relocation from an executable or shared library @@ -171,8 +186,7 @@ elf_vxworks_emit_relocs (bfd *output_bfd, for (j = 0; j < bed->s->int_rels_per_ext_rel; j++) { asection *sec = (*rel_hash)->root.u.def.section; - int this_idx = - elf_section_data (sec->output_section)->this_idx; + int this_idx = sec->output_section->target_index; irela[j].r_info = ELF32_R_INFO (this_idx, ELF32_R_TYPE (irela[j].r_info)); diff --git a/bfd/elf.c b/bfd/elf.c index 9e48f66e90f..ab5c23f711a 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -1,7 +1,7 @@ /* ELF executable support for BFD. Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -33,8 +33,8 @@ SECTION /* For sparc64-cross-sparc32. */ #define _SYSCALL32 -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #define ARCH_SIZE 0 @@ -206,16 +206,32 @@ bfd_elf_hash (const char *namearg) return h & 0xffffffff; } +/* DT_GNU_HASH hash function. Do not change this function; you will + cause invalid hash tables to be generated. */ + +unsigned long +bfd_elf_gnu_hash (const char *namearg) +{ + const unsigned char *name = (const unsigned char *) namearg; + unsigned long h = 5381; + unsigned char ch; + + while ((ch = *name++) != '\0') + h = (h << 5) + h + ch; + return h & 0xffffffff; +} + bfd_boolean bfd_elf_mkobject (bfd *abfd) { - /* This just does initialization. */ - /* coff_mkobject zalloc's space for tdata.coff_obj_data ... */ - elf_tdata (abfd) = bfd_zalloc (abfd, sizeof (struct elf_obj_tdata)); - if (elf_tdata (abfd) == 0) - return FALSE; - /* Since everything is done at close time, do we need any - initialization? */ + if (abfd->tdata.any == NULL) + { + abfd->tdata.any = bfd_zalloc (abfd, sizeof (struct elf_obj_tdata)); + if (abfd->tdata.any == NULL) + return FALSE; + } + + elf_tdata (abfd)->program_header_size = (bfd_size_type) -1; return TRUE; } @@ -236,7 +252,9 @@ bfd_elf_get_str_section (bfd *abfd, unsigned int shindex) bfd_size_type shstrtabsize; i_shdrp = elf_elfsections (abfd); - if (i_shdrp == 0 || i_shdrp[shindex] == 0) + if (i_shdrp == 0 + || shindex >= elf_numsections (abfd) + || i_shdrp[shindex] == 0) return NULL; shstrtab = i_shdrp[shindex]->contents; @@ -275,6 +293,9 @@ bfd_elf_string_from_elf_section (bfd *abfd, if (strindex == 0) return ""; + if (elf_elfsections (abfd) == NULL || shindex >= elf_numsections (abfd)) + return NULL; + hdr = elf_elfsections (abfd)[shindex]; if (hdr->contents == NULL @@ -384,7 +405,15 @@ bfd_elf_get_elf_syms (bfd *ibfd, for (esym = extsym_buf, isym = intsym_buf, shndx = extshndx_buf; isym < isymend; esym += extsym_size, isym++, shndx = shndx != NULL ? shndx + 1 : NULL) - (*bed->s->swap_symbol_in) (ibfd, esym, shndx, isym); + if (!(*bed->s->swap_symbol_in) (ibfd, esym, shndx, isym)) + { + symoffset += (esym - (bfd_byte *) extsym_buf) / extsym_size; + (*_bfd_error_handler) (_("%B symbol number %lu references " + "nonexistent SHT_SYMTAB_SHNDX section"), + ibfd, (unsigned long) symoffset); + intsym_buf = NULL; + goto out; + } out: if (alloc_ext != NULL) @@ -477,10 +506,18 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) section with just a flag word (ie. sh_size is 4), ignore it. */ shnum = elf_numsections (abfd); num_group = 0; + +#define IS_VALID_GROUP_SECTION_HEADER(shdr) \ + ( (shdr)->sh_type == SHT_GROUP \ + && (shdr)->sh_size >= (2 * GRP_ENTRY_SIZE) \ + && (shdr)->sh_entsize == GRP_ENTRY_SIZE \ + && ((shdr)->sh_size % GRP_ENTRY_SIZE) == 0) + for (i = 0; i < shnum; i++) { Elf_Internal_Shdr *shdr = elf_elfsections (abfd)[i]; - if (shdr->sh_type == SHT_GROUP && shdr->sh_size >= 8) + + if (IS_VALID_GROUP_SECTION_HEADER (shdr)) num_group += 1; } @@ -505,7 +542,8 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) for (i = 0; i < shnum; i++) { Elf_Internal_Shdr *shdr = elf_elfsections (abfd)[i]; - if (shdr->sh_type == SHT_GROUP && shdr->sh_size >= 8) + + if (IS_VALID_GROUP_SECTION_HEADER (shdr)) { unsigned char *src; Elf_Internal_Group *dest; @@ -519,8 +557,18 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) amt = shdr->sh_size * sizeof (*dest) / 4; shdr->contents = bfd_alloc2 (abfd, shdr->sh_size, sizeof (*dest) / 4); - if (shdr->contents == NULL - || bfd_seek (abfd, shdr->sh_offset, SEEK_SET) != 0 + /* PR binutils/4110: Handle corrupt group headers. */ + if (shdr->contents == NULL) + { + _bfd_error_handler + (_("%B: Corrupt size field in group section header: 0x%lx"), abfd, shdr->sh_size); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + memset (shdr->contents, 0, amt); + + if (bfd_seek (abfd, shdr->sh_offset, SEEK_SET) != 0 || (bfd_bread (shdr->contents, shdr->sh_size, abfd) != shdr->sh_size)) return FALSE; @@ -800,24 +848,24 @@ _bfd_elf_make_section_from_shdr (bfd *abfd, int len; } debug_sections [] = { - { "debug", 5 }, /* 'd' */ + { STRING_COMMA_LEN ("debug") }, /* 'd' */ { NULL, 0 }, /* 'e' */ { NULL, 0 }, /* 'f' */ - { "gnu.linkonce.wi.", 17 }, /* 'g' */ + { STRING_COMMA_LEN ("gnu.linkonce.wi.") }, /* 'g' */ { NULL, 0 }, /* 'h' */ { NULL, 0 }, /* 'i' */ { NULL, 0 }, /* 'j' */ { NULL, 0 }, /* 'k' */ - { "line", 4 }, /* 'l' */ + { STRING_COMMA_LEN ("line") }, /* 'l' */ { NULL, 0 }, /* 'm' */ { NULL, 0 }, /* 'n' */ { NULL, 0 }, /* 'o' */ { NULL, 0 }, /* 'p' */ { NULL, 0 }, /* 'q' */ { NULL, 0 }, /* 'r' */ - { "stab", 4 } /* 's' */ + { STRING_COMMA_LEN ("stab") } /* 's' */ }; - + if (name [0] == '.') { int i = name [1] - 'd'; @@ -836,7 +884,7 @@ _bfd_elf_make_section_from_shdr (bfd *abfd, The symbols will be defined as weak, so that multiple definitions are permitted. The GNU linker extension is to actually discard all but one of the sections. */ - if (strncmp (name, ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) == 0 + if (CONST_STRNEQ (name, ".gnu.linkonce") && elf_next_in_group (newsect) == NULL) flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD; @@ -854,8 +902,8 @@ _bfd_elf_make_section_from_shdr (bfd *abfd, unsigned int i; /* Look through the phdrs to see if we need to adjust the lma. - If all the p_paddr fields are zero, we ignore them, since - some ELF linkers produce such output. */ + If all the p_paddr fields are zero, we ignore them, since + some ELF linkers produce such output. */ phdr = elf_tdata (abfd)->phdr; for (i = 0; i < elf_elfheader (abfd)->e_phnum; i++, phdr++) { @@ -876,9 +924,9 @@ _bfd_elf_make_section_from_shdr (bfd *abfd, refuse to set the LMA if it was 0. This is wrong though, as a perfectly valid initialised segment can have a p_paddr of zero. Some architectures, eg ARM, - place special significance on the address 0 and - executables need to be able to have a segment which - covers this address. */ + place special significance on the address 0 and + executables need to be able to have a segment which + covers this address. */ if (phdr->p_type == PT_LOAD && (bfd_vma) hdr->sh_offset >= phdr->p_offset && (hdr->sh_offset + hdr->sh_size @@ -1065,6 +1113,10 @@ _bfd_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd) elf_gp (obfd) = elf_gp (ibfd); elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; elf_flags_init (obfd) = TRUE; + + /* Copy object attributes. */ + _bfd_elf_copy_obj_attributes (ibfd, obfd); + return TRUE; } @@ -1239,6 +1291,7 @@ _bfd_elf_print_private_bfd_data (bfd *abfd, void *farg) case DT_AUXILIARY: name = "AUXILIARY"; stringp = TRUE; break; case DT_USED: name = "USED"; break; case DT_FILTER: name = "FILTER"; stringp = TRUE; break; + case DT_GNU_HASH: name = "GNU_HASH"; break; } fprintf (f, " %-11s ", name); @@ -1472,9 +1525,9 @@ _bfd_elf_link_hash_newfunc (struct bfd_hash_entry *entry, memset (&ret->size, 0, (sizeof (struct elf_link_hash_entry) - offsetof (struct elf_link_hash_entry, size))); /* Assume that we have been called by a non-ELF symbol reader. - This flag is then reset by the code which reads an ELF input - file. This ensures that a symbol created by a non-ELF symbol - reader will have the flag set correctly. */ + This flag is then reset by the code which reads an ELF input + file. This ensures that a symbol created by a non-ELF symbol + reader will have the flag set correctly. */ ret->non_elf = 1; } @@ -1567,27 +1620,13 @@ _bfd_elf_link_hash_table_init bfd_boolean ret; int can_refcount = get_elf_backend_data (abfd)->can_refcount; - table->dynamic_sections_created = FALSE; - table->dynobj = NULL; + memset (table, 0, sizeof * table); table->init_got_refcount.refcount = can_refcount - 1; table->init_plt_refcount.refcount = can_refcount - 1; table->init_got_offset.offset = -(bfd_vma) 1; table->init_plt_offset.offset = -(bfd_vma) 1; /* The first dynamic symbol is a dummy. */ table->dynsymcount = 1; - table->dynstr = NULL; - table->bucketcount = 0; - table->needed = NULL; - table->hgot = NULL; - table->merge_info = NULL; - memset (&table->stab_info, 0, sizeof (table->stab_info)); - memset (&table->eh_info, 0, sizeof (table->eh_info)); - table->dynlocal = NULL; - table->runpath = NULL; - table->tls_sec = NULL; - table->tls_size = 0; - table->loaded = NULL; - table->is_relocatable_executable = FALSE; ret = _bfd_link_hash_table_init (&table->root, abfd, newfunc, entsize); table->root.type = bfd_link_elf_hash_table; @@ -1642,7 +1681,7 @@ bfd_elf_get_dyn_lib_class (bfd *abfd) } void -bfd_elf_set_dyn_lib_class (bfd *abfd, int lib_class) +bfd_elf_set_dyn_lib_class (bfd *abfd, enum dynamic_lib_link_class lib_class) { if (bfd_get_flavour (abfd) == bfd_target_elf_flavour && bfd_get_format (abfd) == bfd_object) @@ -1822,6 +1861,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) case SHT_FINI_ARRAY: /* .fini_array section. */ case SHT_PREINIT_ARRAY: /* .preinit_array section. */ case SHT_GNU_LIBLIST: /* .gnu.liblist section. */ + case SHT_GNU_HASH: /* .gnu.hash section. */ return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); case SHT_DYNAMIC: /* Dynamic linking information. */ @@ -1873,11 +1913,11 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) abfd->flags |= HAS_SYMS; /* Sometimes a shared object will map in the symbol table. If - SHF_ALLOC is set, and this is a shared object, then we also - treat this section as a BFD section. We can not base the - decision purely on SHF_ALLOC, because that flag is sometimes - set in a relocatable object file, which would confuse the - linker. */ + SHF_ALLOC is set, and this is a shared object, then we also + treat this section as a BFD section. We can not base the + decision purely on SHF_ALLOC, because that flag is sometimes + set in a relocatable object file, which would confuse the + linker. */ if ((hdr->sh_flags & SHF_ALLOC) != 0 && (abfd->flags & DYNAMIC) != 0 && ! _bfd_elf_make_section_from_shdr (abfd, hdr, name, @@ -2099,13 +2139,11 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) abfd->flags |= HAS_RELOC; return TRUE; } - break; case SHT_GNU_verdef: elf_dynverdef (abfd) = shindex; elf_tdata (abfd)->dynverdef_hdr = *hdr; return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); - break; case SHT_GNU_versym: if (hdr->sh_entsize != sizeof (Elf_External_Versym)) @@ -2113,13 +2151,11 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) elf_dynversym (abfd) = shindex; elf_tdata (abfd)->dynversym_hdr = *hdr; return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); - break; case SHT_GNU_verneed: elf_dynverref (abfd) = shindex; elf_tdata (abfd)->dynverref_hdr = *hdr; return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); - break; case SHT_SHLIB: return TRUE; @@ -2128,7 +2164,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) /* We need a BFD section for objcopy and relocatable linking, and it's handy to have the signature available as the section name. */ - if (hdr->sh_entsize != GRP_ENTRY_SIZE) + if (! IS_VALID_GROUP_SECTION_HEADER (hdr)) return FALSE; name = group_signature (abfd, hdr); if (name == NULL) @@ -2138,7 +2174,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) if (hdr->contents != NULL) { Elf_Internal_Group *idx = (Elf_Internal_Group *) hdr->contents; - unsigned int n_elt = hdr->sh_size / 4; + unsigned int n_elt = hdr->sh_size / GRP_ENTRY_SIZE; asection *s; if (idx->flags & GRP_COMDAT) @@ -2148,19 +2184,78 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) /* We try to keep the same section order as it comes in. */ idx += n_elt; while (--n_elt != 0) - if ((s = (--idx)->shdr->bfd_section) != NULL - && elf_next_in_group (s) != NULL) - { - elf_next_in_group (hdr->bfd_section) = s; - break; - } + { + --idx; + + if (idx->shdr != NULL + && (s = idx->shdr->bfd_section) != NULL + && elf_next_in_group (s) != NULL) + { + elf_next_in_group (hdr->bfd_section) = s; + break; + } + } } break; default: + /* Possibly an attributes section. */ + if (hdr->sh_type == SHT_GNU_ATTRIBUTES + || hdr->sh_type == bed->obj_attrs_section_type) + { + if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex)) + return FALSE; + _bfd_elf_parse_attributes (abfd, hdr); + return TRUE; + } + /* Check for any processor-specific section types. */ - return bed->elf_backend_section_from_shdr (abfd, hdr, name, - shindex); + if (bed->elf_backend_section_from_shdr (abfd, hdr, name, shindex)) + return TRUE; + + if (hdr->sh_type >= SHT_LOUSER && hdr->sh_type <= SHT_HIUSER) + { + if ((hdr->sh_flags & SHF_ALLOC) != 0) + /* FIXME: How to properly handle allocated section reserved + for applications? */ + (*_bfd_error_handler) + (_("%B: don't know how to handle allocated, application " + "specific section `%s' [0x%8x]"), + abfd, name, hdr->sh_type); + else + /* Allow sections reserved for applications. */ + return _bfd_elf_make_section_from_shdr (abfd, hdr, name, + shindex); + } + else if (hdr->sh_type >= SHT_LOPROC + && hdr->sh_type <= SHT_HIPROC) + /* FIXME: We should handle this section. */ + (*_bfd_error_handler) + (_("%B: don't know how to handle processor specific section " + "`%s' [0x%8x]"), + abfd, name, hdr->sh_type); + else if (hdr->sh_type >= SHT_LOOS && hdr->sh_type <= SHT_HIOS) + { + /* Unrecognised OS-specific sections. */ + if ((hdr->sh_flags & SHF_OS_NONCONFORMING) != 0) + /* SHF_OS_NONCONFORMING indicates that special knowledge is + required to correctly process the section and the file should + be rejected with an error message. */ + (*_bfd_error_handler) + (_("%B: don't know how to handle OS specific section " + "`%s' [0x%8x]"), + abfd, name, hdr->sh_type); + else + /* Otherwise it should be processed. */ + return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); + } + else + /* FIXME: We should handle this section. */ + (*_bfd_error_handler) + (_("%B: don't know how to handle section `%s' [0x%8x]"), + abfd, name, hdr->sh_type); + + return FALSE; } return TRUE; @@ -2220,108 +2315,111 @@ bfd_section_from_elf_index (bfd *abfd, unsigned int index) static const struct bfd_elf_special_section special_sections_b[] = { - { ".bss", 4, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".bss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_c[] = { - { ".comment", 8, 0, SHT_PROGBITS, 0 }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".comment"), 0, SHT_PROGBITS, 0 }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_d[] = { - { ".data", 5, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".data1", 6, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".debug", 6, 0, SHT_PROGBITS, 0 }, - { ".debug_line", 11, 0, SHT_PROGBITS, 0 }, - { ".debug_info", 11, 0, SHT_PROGBITS, 0 }, - { ".debug_abbrev", 13, 0, SHT_PROGBITS, 0 }, - { ".debug_aranges", 14, 0, SHT_PROGBITS, 0 }, - { ".dynamic", 8, 0, SHT_DYNAMIC, SHF_ALLOC }, - { ".dynstr", 7, 0, SHT_STRTAB, SHF_ALLOC }, - { ".dynsym", 7, 0, SHT_DYNSYM, SHF_ALLOC }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".data"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".data1"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".debug"), 0, SHT_PROGBITS, 0 }, + { STRING_COMMA_LEN (".debug_line"), 0, SHT_PROGBITS, 0 }, + { STRING_COMMA_LEN (".debug_info"), 0, SHT_PROGBITS, 0 }, + { STRING_COMMA_LEN (".debug_abbrev"), 0, SHT_PROGBITS, 0 }, + { STRING_COMMA_LEN (".debug_aranges"), 0, SHT_PROGBITS, 0 }, + { STRING_COMMA_LEN (".dynamic"), 0, SHT_DYNAMIC, SHF_ALLOC }, + { STRING_COMMA_LEN (".dynstr"), 0, SHT_STRTAB, SHF_ALLOC }, + { STRING_COMMA_LEN (".dynsym"), 0, SHT_DYNSYM, SHF_ALLOC }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_f[] = { - { ".fini", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, - { ".fini_array", 11, 0, SHT_FINI_ARRAY, SHF_ALLOC + SHF_WRITE }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".fini"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, + { STRING_COMMA_LEN (".fini_array"), 0, SHT_FINI_ARRAY, SHF_ALLOC + SHF_WRITE }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_g[] = { - { ".gnu.linkonce.b",15, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, - { ".got", 4, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".gnu.version", 12, 0, SHT_GNU_versym, 0 }, - { ".gnu.version_d", 14, 0, SHT_GNU_verdef, 0 }, - { ".gnu.version_r", 14, 0, SHT_GNU_verneed, 0 }, - { ".gnu.liblist", 12, 0, SHT_GNU_LIBLIST, SHF_ALLOC }, - { ".gnu.conflict", 13, 0, SHT_RELA, SHF_ALLOC }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".gnu.linkonce.b"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".got"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".gnu.version"), 0, SHT_GNU_versym, 0 }, + { STRING_COMMA_LEN (".gnu.version_d"), 0, SHT_GNU_verdef, 0 }, + { STRING_COMMA_LEN (".gnu.version_r"), 0, SHT_GNU_verneed, 0 }, + { STRING_COMMA_LEN (".gnu.liblist"), 0, SHT_GNU_LIBLIST, SHF_ALLOC }, + { STRING_COMMA_LEN (".gnu.conflict"), 0, SHT_RELA, SHF_ALLOC }, + { STRING_COMMA_LEN (".gnu.hash"), 0, SHT_GNU_HASH, SHF_ALLOC }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_h[] = { - { ".hash", 5, 0, SHT_HASH, SHF_ALLOC }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".hash"), 0, SHT_HASH, SHF_ALLOC }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_i[] = { - { ".init", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, - { ".init_array", 11, 0, SHT_INIT_ARRAY, SHF_ALLOC + SHF_WRITE }, - { ".interp", 7, 0, SHT_PROGBITS, 0 }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".init"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, + { STRING_COMMA_LEN (".init_array"), 0, SHT_INIT_ARRAY, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".interp"), 0, SHT_PROGBITS, 0 }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_l[] = { - { ".line", 5, 0, SHT_PROGBITS, 0 }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".line"), 0, SHT_PROGBITS, 0 }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_n[] = { - { ".note.GNU-stack",15, 0, SHT_PROGBITS, 0 }, - { ".note", 5, -1, SHT_NOTE, 0 }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".note.GNU-stack"), 0, SHT_PROGBITS, 0 }, + { STRING_COMMA_LEN (".note"), -1, SHT_NOTE, 0 }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_p[] = { - { ".preinit_array", 14, 0, SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_WRITE }, - { ".plt", 4, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".preinit_array"), 0, SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".plt"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_r[] = { - { ".rodata", 7, -2, SHT_PROGBITS, SHF_ALLOC }, - { ".rodata1", 8, 0, SHT_PROGBITS, SHF_ALLOC }, - { ".rela", 5, -1, SHT_RELA, 0 }, - { ".rel", 4, -1, SHT_REL, 0 }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".rodata"), -2, SHT_PROGBITS, SHF_ALLOC }, + { STRING_COMMA_LEN (".rodata1"), 0, SHT_PROGBITS, SHF_ALLOC }, + { STRING_COMMA_LEN (".rela"), -1, SHT_RELA, 0 }, + { STRING_COMMA_LEN (".rel"), -1, SHT_REL, 0 }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_s[] = { - { ".shstrtab", 9, 0, SHT_STRTAB, 0 }, - { ".strtab", 7, 0, SHT_STRTAB, 0 }, - { ".symtab", 7, 0, SHT_SYMTAB, 0 }, - { ".stabstr", 5, 3, SHT_STRTAB, 0 }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".shstrtab"), 0, SHT_STRTAB, 0 }, + { STRING_COMMA_LEN (".strtab"), 0, SHT_STRTAB, 0 }, + { STRING_COMMA_LEN (".symtab"), 0, SHT_SYMTAB, 0 }, + /* See struct bfd_elf_special_section declaration for the semantics of + this special case where .prefix_length != strlen (.prefix). */ + { ".stabstr", 5, 3, SHT_STRTAB, 0 }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_t[] = { - { ".text", 5, -2, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, - { ".tbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS }, - { ".tdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".text"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, + { STRING_COMMA_LEN (".tbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS }, + { STRING_COMMA_LEN (".tdata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section *special_sections[] = @@ -2452,10 +2550,13 @@ _bfd_elf_new_section_hook (bfd *abfd, asection *sec) bed = get_elf_backend_data (abfd); sec->use_rela_p = bed->default_use_rela_p; - /* When we read a file, we don't need section type and flags unless - it is a linker created section. They will be overridden in - _bfd_elf_make_section_from_shdr anyway. */ - if (abfd->direction != read_direction + /* When we read a file, we don't need to set ELF section type and + flags. They will be overridden in _bfd_elf_make_section_from_shdr + anyway. We will set ELF section type and flags for all linker + created sections. If user specifies BFD section flags, we will + set ELF section type and flags based on BFD section flags in + elf_fake_sections. */ + if ((!sec->flags && abfd->direction != read_direction) || (sec->flags & SEC_LINKER_CREATED) != 0) { ssect = (*bed->get_sec_type_attr) (abfd, sec); @@ -2466,7 +2567,7 @@ _bfd_elf_new_section_hook (bfd *abfd, asection *sec) } } - return TRUE; + return _bfd_generic_new_section_hook (abfd, sec); } /* Create a new bfd section from an ELF program header. @@ -2657,11 +2758,12 @@ elf_fake_sections (bfd *abfd, asection *asect, void *failedptrarg) const struct elf_backend_data *bed = get_elf_backend_data (abfd); bfd_boolean *failedptr = failedptrarg; Elf_Internal_Shdr *this_hdr; + unsigned int sh_type; if (*failedptr) { /* We already failed; just get out of the bfd_map_over_sections - loop. */ + loop. */ return; } @@ -2700,8 +2802,8 @@ elf_fake_sections (bfd *abfd, asection *asect, void *failedptrarg) if ((asect->flags & SEC_GROUP) != 0) this_hdr->sh_type = SHT_GROUP; else if ((asect->flags & SEC_ALLOC) != 0 - && (((asect->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0) - || (asect->flags & SEC_NEVER_LOAD) != 0)) + && (((asect->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0) + || (asect->flags & SEC_NEVER_LOAD) != 0)) this_hdr->sh_type = SHT_NOBITS; else this_hdr->sh_type = SHT_PROGBITS; @@ -2750,8 +2852,8 @@ elf_fake_sections (bfd *abfd, asection *asect, void *failedptrarg) case SHT_GNU_verdef: this_hdr->sh_entsize = 0; /* objcopy or strip will copy over sh_info, but may not set - cverdefs. The linker will set cverdefs, but sh_info will be - zero. */ + cverdefs. The linker will set cverdefs, but sh_info will be + zero. */ if (this_hdr->sh_info == 0) this_hdr->sh_info = elf_tdata (abfd)->cverdefs; else @@ -2762,8 +2864,8 @@ elf_fake_sections (bfd *abfd, asection *asect, void *failedptrarg) case SHT_GNU_verneed: this_hdr->sh_entsize = 0; /* objcopy or strip will copy over sh_info, but may not set - cverrefs. The linker will set cverrefs, but sh_info will be - zero. */ + cverrefs. The linker will set cverrefs, but sh_info will be + zero. */ if (this_hdr->sh_info == 0) this_hdr->sh_info = elf_tdata (abfd)->cverrefs; else @@ -2772,7 +2874,11 @@ elf_fake_sections (bfd *abfd, asection *asect, void *failedptrarg) break; case SHT_GROUP: - this_hdr->sh_entsize = 4; + this_hdr->sh_entsize = GRP_ENTRY_SIZE; + break; + + case SHT_GNU_HASH: + this_hdr->sh_entsize = bed->s->arch_size == 64 ? 0 : 4; break; } @@ -2810,10 +2916,18 @@ elf_fake_sections (bfd *abfd, asection *asect, void *failedptrarg) } /* Check for processor-specific section types. */ + sh_type = this_hdr->sh_type; if (bed->elf_backend_fake_sections && !(*bed->elf_backend_fake_sections) (abfd, this_hdr, asect)) *failedptr = TRUE; + if (sh_type == SHT_NOBITS && asect->size != 0) + { + /* Don't change the header type from NOBITS if we are being + called for objcopy --only-keep-debug. */ + this_hdr->sh_type = sh_type; + } + /* If the section has relocs, set up a section header for the SHT_REL[A] section. If two relocation sections are required for this section, it is up to the processor-specific back-end to @@ -2935,14 +3049,14 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) d = elf_section_data (sec); if (d->this_hdr.sh_type == SHT_GROUP) - { + { if (sec->flags & SEC_LINKER_CREATED) { /* Remove the linker created SHT_GROUP sections. */ bfd_section_list_remove (abfd, sec); abfd->section_count--; } - else + else { if (section_number == SHN_LORESERVE) section_number += SHN_HIRESERVE + 1 - SHN_LORESERVE; @@ -3096,7 +3210,7 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) s, s->owner); /* Point to the kept section if it has the same size as the discarded one. */ - kept = _bfd_elf_check_kept_section (s); + kept = _bfd_elf_check_kept_section (s, link_info); if (kept == NULL) { bfd_set_error (bfd_error_bad_value); @@ -3129,7 +3243,7 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) The Intel C compiler generates SHT_IA_64_UNWIND with SHF_LINK_ORDER. But it doesn't set the sh_link or sh_info fields. Hence we could get the situation - where s is NULL. */ + where s is NULL. */ const struct elf_backend_data *bed = get_elf_backend_data (abfd); if (bed->link_order_error_handler) @@ -3169,7 +3283,7 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) string section. We look for a section with the same name but without the trailing ``str'', and set its sh_link field to point to this section. */ - if (strncmp (sec->name, ".stab", sizeof ".stab" - 1) == 0 + if (CONST_STRNEQ (sec->name, ".stab") && strcmp (sec->name + strlen (sec->name) - 3, "str") == 0) { size_t len; @@ -3209,9 +3323,8 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) case SHT_GNU_LIBLIST: /* sh_link is the section header index of the prelink library - list - used for the dynamic entries, or the symbol table, or the - version strings. */ + list used for the dynamic entries, or the symbol table, or + the version strings. */ s = bfd_get_section_by_name (abfd, (sec->flags & SEC_ALLOC) ? ".dynstr" : ".gnu.libstr"); if (s != NULL) @@ -3219,6 +3332,7 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) break; case SHT_HASH: + case SHT_GNU_HASH: case SHT_GNU_versym: /* sh_link is the section header index of the symbol table this hash table or version table is for. */ @@ -3244,7 +3358,7 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) /* Map symbol from it's internal number to the external number, moving all local symbols to be at the head of the list. */ -static int +static bfd_boolean sym_is_global (bfd *abfd, asymbol *sym) { /* If the backend has a special mapping, use it. */ @@ -3257,6 +3371,20 @@ sym_is_global (bfd *abfd, asymbol *sym) || bfd_is_com_section (bfd_get_section (sym))); } +/* Don't output section symbols for sections that are not going to be + output. Also, don't output section symbols for reloc and other + special sections. */ + +static bfd_boolean +ignore_section_sym (bfd *abfd, asymbol *sym) +{ + return ((sym->flags & BSF_SECTION_SYM) != 0 + && (sym->value != 0 + || (sym->section->owner != abfd + && (sym->section->output_section->owner != abfd + || sym->section->output_offset != 0)))); +} + static bfd_boolean elf_map_symbols (bfd *abfd) { @@ -3297,51 +3425,29 @@ elf_map_symbols (bfd *abfd) asymbol *sym = syms[idx]; if ((sym->flags & BSF_SECTION_SYM) != 0 - && sym->value == 0) + && !ignore_section_sym (abfd, sym)) { - asection *sec; + asection *sec = sym->section; - sec = sym->section; + if (sec->owner != abfd) + sec = sec->output_section; - if (sec->owner != NULL) - { - if (sec->owner != abfd) - { - if (sec->output_offset != 0) - continue; - - sec = sec->output_section; - - /* Empty sections in the input files may have had a - section symbol created for them. (See the comment - near the end of _bfd_generic_link_output_symbols in - linker.c). If the linker script discards such - sections then we will reach this point. Since we know - that we cannot avoid this case, we detect it and skip - the abort and the assignment to the sect_syms array. - To reproduce this particular case try running the - linker testsuite test ld-scripts/weak.exp for an ELF - port that uses the generic linker. */ - if (sec->owner == NULL) - continue; - - BFD_ASSERT (sec->owner == abfd); - } - sect_syms[sec->index] = syms[idx]; - } + sect_syms[sec->index] = syms[idx]; } } /* Classify all of the symbols. */ for (idx = 0; idx < symcount; idx++) { + if (ignore_section_sym (abfd, syms[idx])) + continue; if (!sym_is_global (abfd, syms[idx])) num_locals++; else num_globals++; } - /* We will be adding a section symbol for each BFD section. Most normal + /* We will be adding a section symbol for each normal BFD section. Most sections will already have a section symbol in outsymbols, but eg. SHT_GROUP sections will not, and we need the section symbol mapped at least in that case. */ @@ -3367,6 +3473,8 @@ elf_map_symbols (bfd *abfd) asymbol *sym = syms[idx]; unsigned int i; + if (ignore_section_sym (abfd, sym)) + continue; if (!sym_is_global (abfd, sym)) i = num_locals2++; else @@ -3518,7 +3626,7 @@ _bfd_elf_compute_section_file_positions (bfd *abfd, elf_tdata (abfd)->next_file_pos = off; /* Now that we know where the .strtab section goes, write it - out. */ + out. */ if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) != 0 || ! _bfd_stringtab_emit (abfd, strtab)) return FALSE; @@ -3530,6 +3638,90 @@ _bfd_elf_compute_section_file_positions (bfd *abfd, return TRUE; } +/* Make an initial estimate of the size of the program header. If we + get the number wrong here, we'll redo section placement. */ + +static bfd_size_type +get_program_header_size (bfd *abfd, struct bfd_link_info *info) +{ + size_t segs; + asection *s; + const struct elf_backend_data *bed; + + /* Assume we will need exactly two PT_LOAD segments: one for text + and one for data. */ + segs = 2; + + s = bfd_get_section_by_name (abfd, ".interp"); + if (s != NULL && (s->flags & SEC_LOAD) != 0) + { + /* If we have a loadable interpreter section, we need a + PT_INTERP segment. In this case, assume we also need a + PT_PHDR segment, although that may not be true for all + targets. */ + segs += 2; + } + + if (bfd_get_section_by_name (abfd, ".dynamic") != NULL) + { + /* We need a PT_DYNAMIC segment. */ + ++segs; + + if (elf_tdata (abfd)->relro) + { + /* We need a PT_GNU_RELRO segment only when there is a + PT_DYNAMIC segment. */ + ++segs; + } + } + + if (elf_tdata (abfd)->eh_frame_hdr) + { + /* We need a PT_GNU_EH_FRAME segment. */ + ++segs; + } + + if (elf_tdata (abfd)->stack_flags) + { + /* We need a PT_GNU_STACK segment. */ + ++segs; + } + + for (s = abfd->sections; s != NULL; s = s->next) + { + if ((s->flags & SEC_LOAD) != 0 + && CONST_STRNEQ (s->name, ".note")) + { + /* We need a PT_NOTE segment. */ + ++segs; + } + } + + for (s = abfd->sections; s != NULL; s = s->next) + { + if (s->flags & SEC_THREAD_LOCAL) + { + /* We need a PT_TLS segment. */ + ++segs; + break; + } + } + + /* Let the backend count up any program headers it might need. */ + bed = get_elf_backend_data (abfd); + if (bed->elf_backend_additional_program_headers) + { + int a; + + a = (*bed->elf_backend_additional_program_headers) (abfd, info); + if (a == -1) + abort (); + segs += a; + } + + return segs * bed->s->sizeof_phdr; +} + /* Create a mapping from a set of sections to a program segment. */ static struct elf_segment_map * @@ -3580,363 +3772,421 @@ _bfd_elf_make_dynamic_segment (bfd *abfd, asection *dynsec) m->p_type = PT_DYNAMIC; m->count = 1; m->sections[0] = dynsec; - + return m; } +/* Possibly add or remove segments from the segment map. */ + +static bfd_boolean +elf_modify_segment_map (bfd *abfd, struct bfd_link_info *info) +{ + struct elf_segment_map **m; + const struct elf_backend_data *bed; + + /* The placement algorithm assumes that non allocated sections are + not in PT_LOAD segments. We ensure this here by removing such + sections from the segment map. We also remove excluded + sections. Finally, any PT_LOAD segment without sections is + removed. */ + m = &elf_tdata (abfd)->segment_map; + while (*m) + { + unsigned int i, new_count; + + for (new_count = 0, i = 0; i < (*m)->count; i++) + { + if (((*m)->sections[i]->flags & SEC_EXCLUDE) == 0 + && (((*m)->sections[i]->flags & SEC_ALLOC) != 0 + || (*m)->p_type != PT_LOAD)) + { + (*m)->sections[new_count] = (*m)->sections[i]; + new_count++; + } + } + (*m)->count = new_count; + + if ((*m)->p_type == PT_LOAD && (*m)->count == 0) + *m = (*m)->next; + else + m = &(*m)->next; + } + + bed = get_elf_backend_data (abfd); + if (bed->elf_backend_modify_segment_map != NULL) + { + if (!(*bed->elf_backend_modify_segment_map) (abfd, info)) + return FALSE; + } + + return TRUE; +} + /* Set up a mapping from BFD sections to program segments. */ -static bfd_boolean -map_sections_to_segments (bfd *abfd) +bfd_boolean +_bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info) { - asection **sections = NULL; - asection *s; - unsigned int i; unsigned int count; - struct elf_segment_map *mfirst; - struct elf_segment_map **pm; struct elf_segment_map *m; - asection *last_hdr; - bfd_vma last_size; - unsigned int phdr_index; - bfd_vma maxpagesize; - asection **hdrpp; - bfd_boolean phdr_in_segment = TRUE; - bfd_boolean writable; - int tls_count = 0; - asection *first_tls = NULL; - asection *dynsec, *eh_frame_hdr; - bfd_size_type amt; + asection **sections = NULL; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); - if (elf_tdata (abfd)->segment_map != NULL) - return TRUE; - - if (bfd_count_sections (abfd) == 0) - return TRUE; - - /* Select the allocated sections, and sort them. */ - - sections = bfd_malloc2 (bfd_count_sections (abfd), sizeof (asection *)); - if (sections == NULL) - goto error_return; - - i = 0; - for (s = abfd->sections; s != NULL; s = s->next) + if (elf_tdata (abfd)->segment_map == NULL + && bfd_count_sections (abfd) != 0) { - if ((s->flags & SEC_ALLOC) != 0) - { - sections[i] = s; - ++i; - } - } - BFD_ASSERT (i <= bfd_count_sections (abfd)); - count = i; + asection *s; + unsigned int i; + struct elf_segment_map *mfirst; + struct elf_segment_map **pm; + asection *last_hdr; + bfd_vma last_size; + unsigned int phdr_index; + bfd_vma maxpagesize; + asection **hdrpp; + bfd_boolean phdr_in_segment = TRUE; + bfd_boolean writable; + int tls_count = 0; + asection *first_tls = NULL; + asection *dynsec, *eh_frame_hdr; + bfd_size_type amt; - qsort (sections, (size_t) count, sizeof (asection *), elf_sort_sections); + /* Select the allocated sections, and sort them. */ - /* Build the mapping. */ - - mfirst = NULL; - pm = &mfirst; - - /* If we have a .interp section, then create a PT_PHDR segment for - the program headers and a PT_INTERP segment for the .interp - section. */ - s = bfd_get_section_by_name (abfd, ".interp"); - if (s != NULL && (s->flags & SEC_LOAD) != 0) - { - amt = sizeof (struct elf_segment_map); - m = bfd_zalloc (abfd, amt); - if (m == NULL) - goto error_return; - m->next = NULL; - m->p_type = PT_PHDR; - /* FIXME: UnixWare and Solaris set PF_X, Irix 5 does not. */ - m->p_flags = PF_R | PF_X; - m->p_flags_valid = 1; - m->includes_phdrs = 1; - - *pm = m; - pm = &m->next; - - amt = sizeof (struct elf_segment_map); - m = bfd_zalloc (abfd, amt); - if (m == NULL) - goto error_return; - m->next = NULL; - m->p_type = PT_INTERP; - m->count = 1; - m->sections[0] = s; - - *pm = m; - pm = &m->next; - } - - /* Look through the sections. We put sections in the same program - segment when the start of the second section can be placed within - a few bytes of the end of the first section. */ - last_hdr = NULL; - last_size = 0; - phdr_index = 0; - maxpagesize = get_elf_backend_data (abfd)->maxpagesize; - writable = FALSE; - dynsec = bfd_get_section_by_name (abfd, ".dynamic"); - if (dynsec != NULL - && (dynsec->flags & SEC_LOAD) == 0) - dynsec = NULL; - - /* Deal with -Ttext or something similar such that the first section - is not adjacent to the program headers. This is an - approximation, since at this point we don't know exactly how many - program headers we will need. */ - if (count > 0) - { - bfd_size_type phdr_size; - - phdr_size = elf_tdata (abfd)->program_header_size; - if (phdr_size == 0) - phdr_size = get_elf_backend_data (abfd)->s->sizeof_phdr; - if ((abfd->flags & D_PAGED) == 0 - || sections[0]->lma < phdr_size - || sections[0]->lma % maxpagesize < phdr_size % maxpagesize) - phdr_in_segment = FALSE; - } - - for (i = 0, hdrpp = sections; i < count; i++, hdrpp++) - { - asection *hdr; - bfd_boolean new_segment; - - hdr = *hdrpp; - - /* See if this section and the last one will fit in the same - segment. */ - - if (last_hdr == NULL) - { - /* If we don't have a segment yet, then we don't need a new - one (we build the last one after this loop). */ - new_segment = FALSE; - } - else if (last_hdr->lma - last_hdr->vma != hdr->lma - hdr->vma) - { - /* If this section has a different relation between the - virtual address and the load address, then we need a new - segment. */ - new_segment = TRUE; - } - else if (BFD_ALIGN (last_hdr->lma + last_size, maxpagesize) - < BFD_ALIGN (hdr->lma, maxpagesize)) - { - /* If putting this section in this segment would force us to - skip a page in the segment, then we need a new segment. */ - new_segment = TRUE; - } - else if ((last_hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) == 0 - && (hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) != 0) - { - /* We don't want to put a loadable section after a - nonloadable section in the same segment. - Consider .tbss sections as loadable for this purpose. */ - new_segment = TRUE; - } - else if ((abfd->flags & D_PAGED) == 0) - { - /* If the file is not demand paged, which means that we - don't require the sections to be correctly aligned in the - file, then there is no other reason for a new segment. */ - new_segment = FALSE; - } - else if (! writable - && (hdr->flags & SEC_READONLY) == 0 - && (((last_hdr->lma + last_size - 1) - & ~(maxpagesize - 1)) - != (hdr->lma & ~(maxpagesize - 1)))) - { - /* We don't want to put a writable section in a read only - segment, unless they are on the same page in memory - anyhow. We already know that the last section does not - bring us past the current section on the page, so the - only case in which the new section is not on the same - page as the previous section is when the previous section - ends precisely on a page boundary. */ - new_segment = TRUE; - } - else - { - /* Otherwise, we can use the same segment. */ - new_segment = FALSE; - } - - if (! new_segment) - { - if ((hdr->flags & SEC_READONLY) == 0) - writable = TRUE; - last_hdr = hdr; - /* .tbss sections effectively have zero size. */ - if ((hdr->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) != SEC_THREAD_LOCAL) - last_size = hdr->size; - else - last_size = 0; - continue; - } - - /* We need a new program segment. We must create a new program - header holding all the sections from phdr_index until hdr. */ - - m = make_mapping (abfd, sections, phdr_index, i, phdr_in_segment); - if (m == NULL) + sections = bfd_malloc2 (bfd_count_sections (abfd), sizeof (asection *)); + if (sections == NULL) goto error_return; - *pm = m; - pm = &m->next; + i = 0; + for (s = abfd->sections; s != NULL; s = s->next) + { + if ((s->flags & SEC_ALLOC) != 0) + { + sections[i] = s; + ++i; + } + } + BFD_ASSERT (i <= bfd_count_sections (abfd)); + count = i; - if ((hdr->flags & SEC_READONLY) == 0) - writable = TRUE; - else - writable = FALSE; + qsort (sections, (size_t) count, sizeof (asection *), elf_sort_sections); - last_hdr = hdr; - /* .tbss sections effectively have zero size. */ - if ((hdr->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) != SEC_THREAD_LOCAL) - last_size = hdr->size; - else - last_size = 0; - phdr_index = i; - phdr_in_segment = FALSE; - } + /* Build the mapping. */ - /* Create a final PT_LOAD program segment. */ - if (last_hdr != NULL) - { - m = make_mapping (abfd, sections, phdr_index, i, phdr_in_segment); - if (m == NULL) - goto error_return; + mfirst = NULL; + pm = &mfirst; - *pm = m; - pm = &m->next; - } - - /* If there is a .dynamic section, throw in a PT_DYNAMIC segment. */ - if (dynsec != NULL) - { - m = _bfd_elf_make_dynamic_segment (abfd, dynsec); - if (m == NULL) - goto error_return; - *pm = m; - pm = &m->next; - } - - /* For each loadable .note section, add a PT_NOTE segment. We don't - use bfd_get_section_by_name, because if we link together - nonloadable .note sections and loadable .note sections, we will - generate two .note sections in the output file. FIXME: Using - names for section types is bogus anyhow. */ - for (s = abfd->sections; s != NULL; s = s->next) - { - if ((s->flags & SEC_LOAD) != 0 - && strncmp (s->name, ".note", 5) == 0) + /* If we have a .interp section, then create a PT_PHDR segment for + the program headers and a PT_INTERP segment for the .interp + section. */ + s = bfd_get_section_by_name (abfd, ".interp"); + if (s != NULL && (s->flags & SEC_LOAD) != 0) { amt = sizeof (struct elf_segment_map); m = bfd_zalloc (abfd, amt); if (m == NULL) goto error_return; m->next = NULL; - m->p_type = PT_NOTE; + m->p_type = PT_PHDR; + /* FIXME: UnixWare and Solaris set PF_X, Irix 5 does not. */ + m->p_flags = PF_R | PF_X; + m->p_flags_valid = 1; + m->includes_phdrs = 1; + + *pm = m; + pm = &m->next; + + amt = sizeof (struct elf_segment_map); + m = bfd_zalloc (abfd, amt); + if (m == NULL) + goto error_return; + m->next = NULL; + m->p_type = PT_INTERP; m->count = 1; m->sections[0] = s; *pm = m; pm = &m->next; } - if (s->flags & SEC_THREAD_LOCAL) - { - if (! tls_count) - first_tls = s; - tls_count++; - } - } - /* If there are any SHF_TLS output sections, add PT_TLS segment. */ - if (tls_count > 0) - { - int i; + /* Look through the sections. We put sections in the same program + segment when the start of the second section can be placed within + a few bytes of the end of the first section. */ + last_hdr = NULL; + last_size = 0; + phdr_index = 0; + maxpagesize = bed->maxpagesize; + writable = FALSE; + dynsec = bfd_get_section_by_name (abfd, ".dynamic"); + if (dynsec != NULL + && (dynsec->flags & SEC_LOAD) == 0) + dynsec = NULL; - amt = sizeof (struct elf_segment_map); - amt += (tls_count - 1) * sizeof (asection *); - m = bfd_zalloc (abfd, amt); - if (m == NULL) - goto error_return; - m->next = NULL; - m->p_type = PT_TLS; - m->count = tls_count; - /* Mandated PF_R. */ - m->p_flags = PF_R; - m->p_flags_valid = 1; - for (i = 0; i < tls_count; ++i) + /* Deal with -Ttext or something similar such that the first section + is not adjacent to the program headers. This is an + approximation, since at this point we don't know exactly how many + program headers we will need. */ + if (count > 0) { - BFD_ASSERT (first_tls->flags & SEC_THREAD_LOCAL); - m->sections[i] = first_tls; - first_tls = first_tls->next; + bfd_size_type phdr_size = elf_tdata (abfd)->program_header_size; + + if (phdr_size == (bfd_size_type) -1) + phdr_size = get_program_header_size (abfd, info); + if ((abfd->flags & D_PAGED) == 0 + || sections[0]->lma < phdr_size + || sections[0]->lma % maxpagesize < phdr_size % maxpagesize) + phdr_in_segment = FALSE; } - *pm = m; - pm = &m->next; + for (i = 0, hdrpp = sections; i < count; i++, hdrpp++) + { + asection *hdr; + bfd_boolean new_segment; + + hdr = *hdrpp; + + /* See if this section and the last one will fit in the same + segment. */ + + if (last_hdr == NULL) + { + /* If we don't have a segment yet, then we don't need a new + one (we build the last one after this loop). */ + new_segment = FALSE; + } + else if (last_hdr->lma - last_hdr->vma != hdr->lma - hdr->vma) + { + /* If this section has a different relation between the + virtual address and the load address, then we need a new + segment. */ + new_segment = TRUE; + } + else if (BFD_ALIGN (last_hdr->lma + last_size, maxpagesize) + < BFD_ALIGN (hdr->lma, maxpagesize)) + { + /* If putting this section in this segment would force us to + skip a page in the segment, then we need a new segment. */ + new_segment = TRUE; + } + else if ((last_hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) == 0 + && (hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) != 0) + { + /* We don't want to put a loadable section after a + nonloadable section in the same segment. + Consider .tbss sections as loadable for this purpose. */ + new_segment = TRUE; + } + else if ((abfd->flags & D_PAGED) == 0) + { + /* If the file is not demand paged, which means that we + don't require the sections to be correctly aligned in the + file, then there is no other reason for a new segment. */ + new_segment = FALSE; + } + else if (! writable + && (hdr->flags & SEC_READONLY) == 0 + && (((last_hdr->lma + last_size - 1) + & ~(maxpagesize - 1)) + != (hdr->lma & ~(maxpagesize - 1)))) + { + /* We don't want to put a writable section in a read only + segment, unless they are on the same page in memory + anyhow. We already know that the last section does not + bring us past the current section on the page, so the + only case in which the new section is not on the same + page as the previous section is when the previous section + ends precisely on a page boundary. */ + new_segment = TRUE; + } + else + { + /* Otherwise, we can use the same segment. */ + new_segment = FALSE; + } + + /* Allow interested parties a chance to override our decision. */ + if (last_hdr && info->callbacks->override_segment_assignment) + new_segment = info->callbacks->override_segment_assignment (info, abfd, hdr, last_hdr, new_segment); + + if (! new_segment) + { + if ((hdr->flags & SEC_READONLY) == 0) + writable = TRUE; + last_hdr = hdr; + /* .tbss sections effectively have zero size. */ + if ((hdr->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) + != SEC_THREAD_LOCAL) + last_size = hdr->size; + else + last_size = 0; + continue; + } + + /* We need a new program segment. We must create a new program + header holding all the sections from phdr_index until hdr. */ + + m = make_mapping (abfd, sections, phdr_index, i, phdr_in_segment); + if (m == NULL) + goto error_return; + + *pm = m; + pm = &m->next; + + if ((hdr->flags & SEC_READONLY) == 0) + writable = TRUE; + else + writable = FALSE; + + last_hdr = hdr; + /* .tbss sections effectively have zero size. */ + if ((hdr->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) != SEC_THREAD_LOCAL) + last_size = hdr->size; + else + last_size = 0; + phdr_index = i; + phdr_in_segment = FALSE; + } + + /* Create a final PT_LOAD program segment. */ + if (last_hdr != NULL) + { + m = make_mapping (abfd, sections, phdr_index, i, phdr_in_segment); + if (m == NULL) + goto error_return; + + *pm = m; + pm = &m->next; + } + + /* If there is a .dynamic section, throw in a PT_DYNAMIC segment. */ + if (dynsec != NULL) + { + m = _bfd_elf_make_dynamic_segment (abfd, dynsec); + if (m == NULL) + goto error_return; + *pm = m; + pm = &m->next; + } + + /* For each loadable .note section, add a PT_NOTE segment. We don't + use bfd_get_section_by_name, because if we link together + nonloadable .note sections and loadable .note sections, we will + generate two .note sections in the output file. FIXME: Using + names for section types is bogus anyhow. */ + for (s = abfd->sections; s != NULL; s = s->next) + { + if ((s->flags & SEC_LOAD) != 0 + && CONST_STRNEQ (s->name, ".note")) + { + amt = sizeof (struct elf_segment_map); + m = bfd_zalloc (abfd, amt); + if (m == NULL) + goto error_return; + m->next = NULL; + m->p_type = PT_NOTE; + m->count = 1; + m->sections[0] = s; + + *pm = m; + pm = &m->next; + } + if (s->flags & SEC_THREAD_LOCAL) + { + if (! tls_count) + first_tls = s; + tls_count++; + } + } + + /* If there are any SHF_TLS output sections, add PT_TLS segment. */ + if (tls_count > 0) + { + int i; + + amt = sizeof (struct elf_segment_map); + amt += (tls_count - 1) * sizeof (asection *); + m = bfd_zalloc (abfd, amt); + if (m == NULL) + goto error_return; + m->next = NULL; + m->p_type = PT_TLS; + m->count = tls_count; + /* Mandated PF_R. */ + m->p_flags = PF_R; + m->p_flags_valid = 1; + for (i = 0; i < tls_count; ++i) + { + BFD_ASSERT (first_tls->flags & SEC_THREAD_LOCAL); + m->sections[i] = first_tls; + first_tls = first_tls->next; + } + + *pm = m; + pm = &m->next; + } + + /* If there is a .eh_frame_hdr section, throw in a PT_GNU_EH_FRAME + segment. */ + eh_frame_hdr = elf_tdata (abfd)->eh_frame_hdr; + if (eh_frame_hdr != NULL + && (eh_frame_hdr->output_section->flags & SEC_LOAD) != 0) + { + amt = sizeof (struct elf_segment_map); + m = bfd_zalloc (abfd, amt); + if (m == NULL) + goto error_return; + m->next = NULL; + m->p_type = PT_GNU_EH_FRAME; + m->count = 1; + m->sections[0] = eh_frame_hdr->output_section; + + *pm = m; + pm = &m->next; + } + + if (elf_tdata (abfd)->stack_flags) + { + amt = sizeof (struct elf_segment_map); + m = bfd_zalloc (abfd, amt); + if (m == NULL) + goto error_return; + m->next = NULL; + m->p_type = PT_GNU_STACK; + m->p_flags = elf_tdata (abfd)->stack_flags; + m->p_flags_valid = 1; + + *pm = m; + pm = &m->next; + } + + if (dynsec != NULL && elf_tdata (abfd)->relro) + { + /* We make a PT_GNU_RELRO segment only when there is a + PT_DYNAMIC segment. */ + amt = sizeof (struct elf_segment_map); + m = bfd_zalloc (abfd, amt); + if (m == NULL) + goto error_return; + m->next = NULL; + m->p_type = PT_GNU_RELRO; + m->p_flags = PF_R; + m->p_flags_valid = 1; + + *pm = m; + pm = &m->next; + } + + free (sections); + elf_tdata (abfd)->segment_map = mfirst; } - /* If there is a .eh_frame_hdr section, throw in a PT_GNU_EH_FRAME - segment. */ - eh_frame_hdr = elf_tdata (abfd)->eh_frame_hdr; - if (eh_frame_hdr != NULL - && (eh_frame_hdr->output_section->flags & SEC_LOAD) != 0) - { - amt = sizeof (struct elf_segment_map); - m = bfd_zalloc (abfd, amt); - if (m == NULL) - goto error_return; - m->next = NULL; - m->p_type = PT_GNU_EH_FRAME; - m->count = 1; - m->sections[0] = eh_frame_hdr->output_section; + if (!elf_modify_segment_map (abfd, info)) + return FALSE; - *pm = m; - pm = &m->next; - } + for (count = 0, m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + ++count; + elf_tdata (abfd)->program_header_size = count * bed->s->sizeof_phdr; - if (elf_tdata (abfd)->stack_flags) - { - amt = sizeof (struct elf_segment_map); - m = bfd_zalloc (abfd, amt); - if (m == NULL) - goto error_return; - m->next = NULL; - m->p_type = PT_GNU_STACK; - m->p_flags = elf_tdata (abfd)->stack_flags; - m->p_flags_valid = 1; - - *pm = m; - pm = &m->next; - } - - if (elf_tdata (abfd)->relro) - { - amt = sizeof (struct elf_segment_map); - m = bfd_zalloc (abfd, amt); - if (m == NULL) - goto error_return; - m->next = NULL; - m->p_type = PT_GNU_RELRO; - m->p_flags = PF_R; - m->p_flags_valid = 1; - - *pm = m; - pm = &m->next; - } - - free (sections); - sections = NULL; - - elf_tdata (abfd)->segment_map = mfirst; return TRUE; error_return: @@ -4023,7 +4273,7 @@ elf_sort_sections (const void *arg1, const void *arg2) adjustment = vma_offset + bed->maxpagesize - off_offset; else adjustment = vma_offset - off_offset; - + which can can be collapsed into the expression below. */ static file_ptr @@ -4032,154 +4282,69 @@ vma_page_aligned_bias (bfd_vma vma, ufile_ptr off, bfd_vma maxpagesize) return ((vma - off) % maxpagesize); } -static void -print_segment_map (bfd *abfd) -{ - struct elf_segment_map *m; - unsigned int i, j; - - fprintf (stderr, _(" Section to Segment mapping:\n")); - fprintf (stderr, _(" Segment Sections...\n")); - - for (i= 0, m = elf_tdata (abfd)->segment_map; - m != NULL; - i++, m = m->next) - { - const char *pt = get_segment_type (m->p_type); - char buf[32]; - - if (pt == NULL) - { - if (m->p_type >= PT_LOPROC && m->p_type <= PT_HIPROC) - sprintf (buf, "LOPROC+%7.7x", - (unsigned int) (m->p_type - PT_LOPROC)); - else if (m->p_type >= PT_LOOS && m->p_type <= PT_HIOS) - sprintf (buf, "LOOS+%7.7x", - (unsigned int) (m->p_type - PT_LOOS)); - else - snprintf (buf, sizeof (buf), "%8.8x", - (unsigned int) m->p_type); - pt = buf; - } - fprintf (stderr, " %2.2d: %14.14s: ", i, pt); - for (j = 0; j < m->count; j++) - fprintf (stderr, "%s ", m->sections [j]->name); - putc ('\n',stderr); - } -} - /* Assign file positions to the sections based on the mapping from sections to segments. This function also sets up some fields in - the file header, and writes out the program headers. */ + the file header. */ static bfd_boolean -assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) +assign_file_positions_for_load_sections (bfd *abfd, + struct bfd_link_info *link_info) { const struct elf_backend_data *bed = get_elf_backend_data (abfd); - unsigned int count; struct elf_segment_map *m; - unsigned int alloc; Elf_Internal_Phdr *phdrs; - file_ptr off, voff; - bfd_vma filehdr_vaddr, filehdr_paddr; - bfd_vma phdrs_vaddr, phdrs_paddr; Elf_Internal_Phdr *p; + file_ptr off; + bfd_size_type maxpagesize; + unsigned int alloc; + unsigned int i, j; - if (elf_tdata (abfd)->segment_map == NULL) - { - if (! map_sections_to_segments (abfd)) - return FALSE; - } - else - { - /* The placement algorithm assumes that non allocated sections are - not in PT_LOAD segments. We ensure this here by removing such - sections from the segment map. We also remove excluded - sections. */ - for (m = elf_tdata (abfd)->segment_map; - m != NULL; - m = m->next) - { - unsigned int new_count; - unsigned int i; + if (link_info == NULL + && !elf_modify_segment_map (abfd, link_info)) + return FALSE; - new_count = 0; - for (i = 0; i < m->count; i ++) - { - if ((m->sections[i]->flags & SEC_EXCLUDE) == 0 - && ((m->sections[i]->flags & SEC_ALLOC) != 0 - || m->p_type != PT_LOAD)) - { - if (i != new_count) - m->sections[new_count] = m->sections[i]; - - new_count ++; - } - } - - if (new_count != m->count) - m->count = new_count; - } - } - - if (bed->elf_backend_modify_segment_map) - { - if (! (*bed->elf_backend_modify_segment_map) (abfd, link_info)) - return FALSE; - } - - count = 0; + alloc = 0; for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) - ++count; + ++alloc; elf_elfheader (abfd)->e_phoff = bed->s->sizeof_ehdr; elf_elfheader (abfd)->e_phentsize = bed->s->sizeof_phdr; - elf_elfheader (abfd)->e_phnum = count; + elf_elfheader (abfd)->e_phnum = alloc; - if (count == 0) + if (elf_tdata (abfd)->program_header_size == (bfd_size_type) -1) + elf_tdata (abfd)->program_header_size = alloc * bed->s->sizeof_phdr; + else + BFD_ASSERT (elf_tdata (abfd)->program_header_size + >= alloc * bed->s->sizeof_phdr); + + if (alloc == 0) { elf_tdata (abfd)->next_file_pos = bed->s->sizeof_ehdr; return TRUE; } - /* If we already counted the number of program segments, make sure - that we allocated enough space. This happens when SIZEOF_HEADERS - is used in a linker script. */ - alloc = elf_tdata (abfd)->program_header_size / bed->s->sizeof_phdr; - if (alloc != 0 && count > alloc) - { - ((*_bfd_error_handler) - (_("%B: Not enough room for program headers (allocated %u, need %u)"), - abfd, alloc, count)); - print_segment_map (abfd); - bfd_set_error (bfd_error_bad_value); - return FALSE; - } - - if (alloc == 0) - alloc = count; - phdrs = bfd_alloc2 (abfd, alloc, sizeof (Elf_Internal_Phdr)); + elf_tdata (abfd)->phdr = phdrs; if (phdrs == NULL) return FALSE; + maxpagesize = 1; + if ((abfd->flags & D_PAGED) != 0) + maxpagesize = bed->maxpagesize; + off = bed->s->sizeof_ehdr; off += alloc * bed->s->sizeof_phdr; - filehdr_vaddr = 0; - filehdr_paddr = 0; - phdrs_vaddr = 0; - phdrs_paddr = 0; - - for (m = elf_tdata (abfd)->segment_map, p = phdrs; + for (m = elf_tdata (abfd)->segment_map, p = phdrs, j = 0; m != NULL; - m = m->next, p++) + m = m->next, p++, j++) { - unsigned int i; asection **secpp; + bfd_vma off_adjust; + bfd_boolean no_contents; /* If elf_segment_map is not from map_sections_to_segments, the - sections may not be correctly ordered. NOTE: sorting should + sections may not be correctly ordered. NOTE: sorting should not be done to the PT_NOTE section of a corefile, which may contain several pseudo-sections artificially created by bfd. Sorting these pseudo-sections breaks things badly. */ @@ -4193,58 +4358,109 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) number of sections with contents contributing to both p_filesz and p_memsz, followed by a number of sections with no contents that just contribute to p_memsz. In this loop, OFF tracks next - available file offset for PT_LOAD and PT_NOTE segments. VOFF is - an adjustment we use for segments that have no file contents - but need zero filled memory allocation. */ - voff = 0; + available file offset for PT_LOAD and PT_NOTE segments. */ p->p_type = m->p_type; p->p_flags = m->p_flags; + if (m->count == 0) + p->p_vaddr = 0; + else + p->p_vaddr = m->sections[0]->vma - m->p_vaddr_offset; + + if (m->p_paddr_valid) + p->p_paddr = m->p_paddr; + else if (m->count == 0) + p->p_paddr = 0; + else + p->p_paddr = m->sections[0]->lma - m->p_vaddr_offset; + + if (p->p_type == PT_LOAD + && (abfd->flags & D_PAGED) != 0) + { + /* p_align in demand paged PT_LOAD segments effectively stores + the maximum page size. When copying an executable with + objcopy, we set m->p_align from the input file. Use this + value for maxpagesize rather than bed->maxpagesize, which + may be different. Note that we use maxpagesize for PT_TLS + segment alignment later in this function, so we are relying + on at least one PT_LOAD segment appearing before a PT_TLS + segment. */ + if (m->p_align_valid) + maxpagesize = m->p_align; + + p->p_align = maxpagesize; + } + else if (m->count == 0) + p->p_align = 1 << bed->s->log_file_align; + else if (m->p_align_valid) + p->p_align = m->p_align; + else + p->p_align = 0; + + no_contents = FALSE; + off_adjust = 0; if (p->p_type == PT_LOAD && m->count > 0) { bfd_size_type align; - bfd_vma adjust; unsigned int align_power = 0; - for (i = 0, secpp = m->sections; i < m->count; i++, secpp++) + if (m->p_align_valid) + align = p->p_align; + else { - unsigned int secalign; - - secalign = bfd_get_section_alignment (abfd, *secpp); - if (secalign > align_power) - align_power = secalign; - } - align = (bfd_size_type) 1 << align_power; - - if ((abfd->flags & D_PAGED) != 0 && bed->maxpagesize > align) - align = bed->maxpagesize; - - adjust = vma_page_aligned_bias (m->sections[0]->vma, off, align); - off += adjust; - if (adjust != 0 - && !m->includes_filehdr - && !m->includes_phdrs - && (ufile_ptr) off >= align) - { - /* If the first section isn't loadable, the same holds for - any other sections. Since the segment won't need file - space, we can make p_offset overlap some prior segment. - However, .tbss is special. If a segment starts with - .tbss, we need to look at the next section to decide - whether the segment has any loadable sections. */ - i = 0; - while ((m->sections[i]->flags & SEC_LOAD) == 0) + for (i = 0, secpp = m->sections; i < m->count; i++, secpp++) { - if ((m->sections[i]->flags & SEC_THREAD_LOCAL) == 0 - || ++i >= m->count) - { - off -= adjust; - voff = adjust - align; - break; - } + unsigned int secalign; + + secalign = bfd_get_section_alignment (abfd, *secpp); + if (secalign > align_power) + align_power = secalign; + } + align = (bfd_size_type) 1 << align_power; + if (align < maxpagesize) + align = maxpagesize; + } + + for (i = 0; i < m->count; i++) + if ((m->sections[i]->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0) + /* If we aren't making room for this section, then + it must be SHT_NOBITS regardless of what we've + set via struct bfd_elf_special_section. */ + elf_section_type (m->sections[i]) = SHT_NOBITS; + + /* Find out whether this segment contains any loadable + sections. If the first section isn't loadable, the same + holds for any other sections. */ + i = 0; + while (elf_section_type (m->sections[i]) == SHT_NOBITS) + { + /* If a segment starts with .tbss, we need to look + at the next section to decide whether the segment + has any loadable sections. */ + if ((elf_section_flags (m->sections[i]) & SHF_TLS) == 0 + || ++i >= m->count) + { + no_contents = TRUE; + break; } } + + off_adjust = vma_page_aligned_bias (m->sections[0]->vma, off, align); + off += off_adjust; + if (no_contents) + { + /* We shouldn't need to align the segment on disk since + the segment doesn't need file space, but the gABI + arguably requires the alignment and glibc ld.so + checks it. So to comply with the alignment + requirement but not waste file space, we adjust + p_offset for just this segment. (OFF_ADJUST is + subtracted from OFF later.) This may put p_offset + past the end of file, but that shouldn't matter. */ + } + else + off_adjust = 0; } /* Make sure the .dynamic section is the first section in the PT_DYNAMIC segment. */ @@ -4259,35 +4475,14 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) return FALSE; } - if (m->count == 0) - p->p_vaddr = 0; - else - p->p_vaddr = m->sections[0]->vma; - - if (m->p_paddr_valid) - p->p_paddr = m->p_paddr; - else if (m->count == 0) - p->p_paddr = 0; - else - p->p_paddr = m->sections[0]->lma; - - if (p->p_type == PT_LOAD - && (abfd->flags & D_PAGED) != 0) - p->p_align = bed->maxpagesize; - else if (m->count == 0) - p->p_align = 1 << bed->s->log_file_align; - else - p->p_align = 0; - p->p_offset = 0; p->p_filesz = 0; p->p_memsz = 0; if (m->includes_filehdr) { - if (! m->p_flags_valid) + if (!m->p_flags_valid) p->p_flags |= PF_R; - p->p_offset = 0; p->p_filesz = bed->s->sizeof_ehdr; p->p_memsz = bed->s->sizeof_ehdr; if (m->count > 0) @@ -4304,30 +4499,17 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) } p->p_vaddr -= off; - if (! m->p_paddr_valid) + if (!m->p_paddr_valid) p->p_paddr -= off; } - if (p->p_type == PT_LOAD) - { - filehdr_vaddr = p->p_vaddr; - filehdr_paddr = p->p_paddr; - } } if (m->includes_phdrs) { - if (! m->p_flags_valid) + if (!m->p_flags_valid) p->p_flags |= PF_R; - if (m->includes_filehdr) - { - if (p->p_type == PT_LOAD) - { - phdrs_vaddr = p->p_vaddr + bed->s->sizeof_ehdr; - phdrs_paddr = p->p_paddr + bed->s->sizeof_ehdr; - } - } - else + if (!m->includes_filehdr) { p->p_offset = bed->s->sizeof_ehdr; @@ -4335,17 +4517,9 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) { BFD_ASSERT (p->p_type == PT_LOAD); p->p_vaddr -= off - p->p_offset; - if (! m->p_paddr_valid) + if (!m->p_paddr_valid) p->p_paddr -= off - p->p_offset; } - - if (p->p_type == PT_LOAD) - { - phdrs_vaddr = p->p_vaddr; - phdrs_paddr = p->p_paddr; - } - else - phdrs_vaddr = bed->maxpagesize + bed->s->sizeof_ehdr; } p->p_filesz += alloc * bed->s->sizeof_phdr; @@ -4355,36 +4529,44 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) if (p->p_type == PT_LOAD || (p->p_type == PT_NOTE && bfd_get_format (abfd) == bfd_core)) { - if (! m->includes_filehdr && ! m->includes_phdrs) - p->p_offset = off + voff; + if (!m->includes_filehdr && !m->includes_phdrs) + p->p_offset = off; else { file_ptr adjust; adjust = off - (p->p_offset + p->p_filesz); - p->p_filesz += adjust; + if (!no_contents) + p->p_filesz += adjust; p->p_memsz += adjust; } } + /* Set up p_filesz, p_memsz, p_align and p_flags from the section + maps. Set filepos for sections in PT_LOAD segments, and in + core files, for sections in PT_NOTE segments. + assign_file_positions_for_non_load_sections will set filepos + for other sections and update p_filesz for other segments. */ for (i = 0, secpp = m->sections; i < m->count; i++, secpp++) { asection *sec; - flagword flags; bfd_size_type align; + Elf_Internal_Shdr *this_hdr; sec = *secpp; - flags = sec->flags; - align = 1 << bfd_get_section_alignment (abfd, sec); + this_hdr = &elf_section_data (sec)->this_hdr; + align = (bfd_size_type) 1 << bfd_get_section_alignment (abfd, sec); if (p->p_type == PT_LOAD || p->p_type == PT_TLS) { - bfd_signed_vma adjust; + bfd_signed_vma adjust = sec->lma - (p->p_paddr + p->p_memsz); - if ((flags & SEC_LOAD) != 0) + if (this_hdr->sh_type != SHT_NOBITS + || ((this_hdr->sh_flags & SHF_ALLOC) != 0 + && ((this_hdr->sh_flags & SHF_TLS) == 0 + || p->p_type == PT_TLS))) { - adjust = sec->lma - (p->p_paddr + p->p_filesz); if (adjust < 0) { (*_bfd_error_handler) @@ -4392,24 +4574,13 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) abfd, sec, (unsigned long) sec->lma); adjust = 0; } - off += adjust; - p->p_filesz += adjust; - p->p_memsz += adjust; - } - /* .tbss is special. It doesn't contribute to p_memsz of - normal segments. */ - else if ((flags & SEC_THREAD_LOCAL) == 0 - || p->p_type == PT_TLS) - { - /* The section VMA must equal the file position - modulo the page size. */ - bfd_size_type page = align; - if ((abfd->flags & D_PAGED) != 0 && bed->maxpagesize > page) - page = bed->maxpagesize; - adjust = vma_page_aligned_bias (sec->vma, - p->p_vaddr + p->p_memsz, - page); p->p_memsz += adjust; + + if (this_hdr->sh_type != SHT_NOBITS) + { + off += adjust; + p->p_filesz += adjust; + } } } @@ -4419,9 +4590,9 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) everything. */ if (i == 0) { - sec->filepos = off; - off += sec->size; - p->p_filesz = sec->size; + this_hdr->sh_offset = sec->filepos = off; + off += this_hdr->sh_size; + p->p_filesz = this_hdr->sh_size; p->p_memsz = 0; p->p_align = 1; } @@ -4438,96 +4609,200 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) { if (p->p_type == PT_LOAD) { - sec->filepos = off; - /* FIXME: The SEC_HAS_CONTENTS test here dates back to - 1997, and the exact reason for it isn't clear. One - plausible explanation is that it is to work around - a problem we have with linker scripts using data - statements in NOLOAD sections. I don't think it - makes a great deal of sense to have such a section - assigned to a PT_LOAD segment, but apparently - people do this. The data statement results in a - bfd_data_link_order being built, and these need - section contents to write into. Eventually, we get - to _bfd_elf_write_object_contents which writes any - section with contents to the output. Make room - here for the write, so that following segments are - not trashed. */ - if ((flags & SEC_LOAD) != 0 - || (flags & SEC_HAS_CONTENTS) != 0) - off += sec->size; + this_hdr->sh_offset = sec->filepos = off; + if (this_hdr->sh_type != SHT_NOBITS) + off += this_hdr->sh_size; } - if ((flags & SEC_LOAD) != 0) + if (this_hdr->sh_type != SHT_NOBITS) { - p->p_filesz += sec->size; - p->p_memsz += sec->size; + p->p_filesz += this_hdr->sh_size; + /* A load section without SHF_ALLOC is something like + a note section in a PT_NOTE segment. These take + file space but are not loaded into memory. */ + if ((this_hdr->sh_flags & SHF_ALLOC) != 0) + p->p_memsz += this_hdr->sh_size; } - /* PR ld/594: Sections in note segments which are not loaded - contribute to the file size but not the in-memory size. */ - else if (p->p_type == PT_NOTE - && (flags & SEC_HAS_CONTENTS) != 0) - p->p_filesz += sec->size; - - /* .tbss is special. It doesn't contribute to p_memsz of - normal segments. */ - else if ((flags & SEC_THREAD_LOCAL) == 0 - || p->p_type == PT_TLS) - p->p_memsz += sec->size; - - if (p->p_type == PT_TLS - && sec->size == 0 - && (sec->flags & SEC_HAS_CONTENTS) == 0) + else if ((this_hdr->sh_flags & SHF_ALLOC) != 0) { - struct bfd_link_order *o = sec->map_tail.link_order; - if (o != NULL) - p->p_memsz += o->offset + o->size; + if (p->p_type == PT_TLS) + p->p_memsz += this_hdr->sh_size; + + /* .tbss is special. It doesn't contribute to p_memsz of + normal segments. */ + else if ((this_hdr->sh_flags & SHF_TLS) == 0) + p->p_memsz += this_hdr->sh_size; } - if (align > p->p_align - && (p->p_type != PT_LOAD || (abfd->flags & D_PAGED) == 0)) + if (p->p_type == PT_GNU_RELRO) + p->p_align = 1; + else if (align > p->p_align + && !m->p_align_valid + && (p->p_type != PT_LOAD + || (abfd->flags & D_PAGED) == 0)) p->p_align = align; } - if (! m->p_flags_valid) + if (!m->p_flags_valid) { p->p_flags |= PF_R; - if ((flags & SEC_CODE) != 0) + if ((this_hdr->sh_flags & SHF_EXECINSTR) != 0) p->p_flags |= PF_X; - if ((flags & SEC_READONLY) == 0) + if ((this_hdr->sh_flags & SHF_WRITE) != 0) p->p_flags |= PF_W; } } + off -= off_adjust; + + /* Check that all sections are in a PT_LOAD segment. + Don't check funky gdb generated core files. */ + if (p->p_type == PT_LOAD && bfd_get_format (abfd) != bfd_core) + for (i = 0, secpp = m->sections; i < m->count; i++, secpp++) + { + Elf_Internal_Shdr *this_hdr; + asection *sec; + + sec = *secpp; + this_hdr = &(elf_section_data(sec)->this_hdr); + if (this_hdr->sh_size != 0 + && !ELF_IS_SECTION_IN_SEGMENT_FILE (this_hdr, p)) + { + (*_bfd_error_handler) + (_("%B: section `%A' can't be allocated in segment %d"), + abfd, sec, j); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + } + } + + elf_tdata (abfd)->next_file_pos = off; + return TRUE; +} + +/* Assign file positions for the other sections. */ + +static bfd_boolean +assign_file_positions_for_non_load_sections (bfd *abfd, + struct bfd_link_info *link_info) +{ + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + Elf_Internal_Shdr **i_shdrpp; + Elf_Internal_Shdr **hdrpp; + Elf_Internal_Phdr *phdrs; + Elf_Internal_Phdr *p; + struct elf_segment_map *m; + bfd_vma filehdr_vaddr, filehdr_paddr; + bfd_vma phdrs_vaddr, phdrs_paddr; + file_ptr off; + unsigned int num_sec; + unsigned int i; + unsigned int count; + + i_shdrpp = elf_elfsections (abfd); + num_sec = elf_numsections (abfd); + off = elf_tdata (abfd)->next_file_pos; + for (i = 1, hdrpp = i_shdrpp + 1; i < num_sec; i++, hdrpp++) + { + struct elf_obj_tdata *tdata = elf_tdata (abfd); + Elf_Internal_Shdr *hdr; + + hdr = *hdrpp; + if (hdr->bfd_section != NULL + && (hdr->bfd_section->filepos != 0 + || (hdr->sh_type == SHT_NOBITS + && hdr->contents == NULL))) + BFD_ASSERT (hdr->sh_offset == hdr->bfd_section->filepos); + else if ((hdr->sh_flags & SHF_ALLOC) != 0) + { + if (hdr->sh_size != 0) + ((*_bfd_error_handler) + (_("%B: warning: allocated section `%s' not in segment"), + abfd, + (hdr->bfd_section == NULL + ? "*unknown*" + : hdr->bfd_section->name))); + /* We don't need to page align empty sections. */ + if ((abfd->flags & D_PAGED) != 0 && hdr->sh_size != 0) + off += vma_page_aligned_bias (hdr->sh_addr, off, + bed->maxpagesize); + else + off += vma_page_aligned_bias (hdr->sh_addr, off, + hdr->sh_addralign); + off = _bfd_elf_assign_file_position_for_section (hdr, off, + FALSE); + } + else if (((hdr->sh_type == SHT_REL || hdr->sh_type == SHT_RELA) + && hdr->bfd_section == NULL) + || hdr == i_shdrpp[tdata->symtab_section] + || hdr == i_shdrpp[tdata->symtab_shndx_section] + || hdr == i_shdrpp[tdata->strtab_section]) + hdr->sh_offset = -1; + else + off = _bfd_elf_assign_file_position_for_section (hdr, off, TRUE); + + if (i == SHN_LORESERVE - 1) + { + i += SHN_HIRESERVE + 1 - SHN_LORESERVE; + hdrpp += SHN_HIRESERVE + 1 - SHN_LORESERVE; + } } /* Now that we have set the section file positions, we can set up the file positions for the non PT_LOAD segments. */ + count = 0; + filehdr_vaddr = 0; + filehdr_paddr = 0; + phdrs_vaddr = bed->maxpagesize + bed->s->sizeof_ehdr; + phdrs_paddr = 0; + phdrs = elf_tdata (abfd)->phdr; for (m = elf_tdata (abfd)->segment_map, p = phdrs; m != NULL; m = m->next, p++) { - if (p->p_type != PT_LOAD && m->count > 0) - { - BFD_ASSERT (! m->includes_filehdr && ! m->includes_phdrs); - /* If the section has not yet been assigned a file position, - do so now. The ARM BPABI requires that .dynamic section - not be marked SEC_ALLOC because it is not part of any - PT_LOAD segment, so it will not be processed above. */ - if (p->p_type == PT_DYNAMIC && m->sections[0]->filepos == 0) - { - unsigned int i; - Elf_Internal_Shdr ** const i_shdrpp = elf_elfsections (abfd); + ++count; + if (p->p_type != PT_LOAD) + continue; - i = 1; - while (i_shdrpp[i]->bfd_section != m->sections[0]) - ++i; - off = (_bfd_elf_assign_file_position_for_section - (i_shdrpp[i], off, TRUE)); - p->p_filesz = m->sections[0]->size; - } - p->p_offset = m->sections[0]->filepos; + if (m->includes_filehdr) + { + filehdr_vaddr = p->p_vaddr; + filehdr_paddr = p->p_paddr; } - if (m->count == 0) + if (m->includes_phdrs) + { + phdrs_vaddr = p->p_vaddr; + phdrs_paddr = p->p_paddr; + if (m->includes_filehdr) + { + phdrs_vaddr += bed->s->sizeof_ehdr; + phdrs_paddr += bed->s->sizeof_ehdr; + } + } + } + + for (m = elf_tdata (abfd)->segment_map, p = phdrs; + m != NULL; + m = m->next, p++) + { + if (m->count != 0) + { + if (p->p_type != PT_LOAD + && (p->p_type != PT_NOTE || bfd_get_format (abfd) != bfd_core)) + { + Elf_Internal_Shdr *hdr; + BFD_ASSERT (!m->includes_filehdr && !m->includes_phdrs); + + hdr = &elf_section_data (m->sections[m->count - 1])->this_hdr; + p->p_filesz = (m->sections[m->count - 1]->filepos + - m->sections[0]->filepos); + if (hdr->sh_type != SHT_NOBITS) + p->p_filesz += hdr->sh_size; + + p->p_offset = m->sections[0]->filepos; + } + } + else { if (m->includes_filehdr) { @@ -4550,8 +4825,8 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) if (lp->p_type == PT_LOAD && lp->p_vaddr <= link_info->relro_end && lp->p_vaddr >= link_info->relro_start - && lp->p_vaddr + lp->p_filesz - >= link_info->relro_end) + && (lp->p_vaddr + lp->p_filesz + >= link_info->relro_end)) break; } @@ -4575,131 +4850,11 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) } } - /* Clear out any program headers we allocated but did not use. */ - for (; count < alloc; count++, p++) - { - memset (p, 0, sizeof *p); - p->p_type = PT_NULL; - } - - elf_tdata (abfd)->phdr = phdrs; - elf_tdata (abfd)->next_file_pos = off; - /* Write out the program headers. */ - if (bfd_seek (abfd, (bfd_signed_vma) bed->s->sizeof_ehdr, SEEK_SET) != 0 - || bed->s->write_out_phdrs (abfd, phdrs, alloc) != 0) - return FALSE; - return TRUE; } -/* Get the size of the program header. - - If this is called by the linker before any of the section VMA's are set, it - can't calculate the correct value for a strange memory layout. This only - happens when SIZEOF_HEADERS is used in a linker script. In this case, - SORTED_HDRS is NULL and we assume the normal scenario of one text and one - data segment (exclusive of .interp and .dynamic). - - ??? User written scripts must either not use SIZEOF_HEADERS, or assume there - will be two segments. */ - -static bfd_size_type -get_program_header_size (bfd *abfd) -{ - size_t segs; - asection *s; - const struct elf_backend_data *bed = get_elf_backend_data (abfd); - - /* We can't return a different result each time we're called. */ - if (elf_tdata (abfd)->program_header_size != 0) - return elf_tdata (abfd)->program_header_size; - - if (elf_tdata (abfd)->segment_map != NULL) - { - struct elf_segment_map *m; - - segs = 0; - for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) - ++segs; - elf_tdata (abfd)->program_header_size = segs * bed->s->sizeof_phdr; - return elf_tdata (abfd)->program_header_size; - } - - /* Assume we will need exactly two PT_LOAD segments: one for text - and one for data. */ - segs = 2; - - s = bfd_get_section_by_name (abfd, ".interp"); - if (s != NULL && (s->flags & SEC_LOAD) != 0) - { - /* If we have a loadable interpreter section, we need a - PT_INTERP segment. In this case, assume we also need a - PT_PHDR segment, although that may not be true for all - targets. */ - segs += 2; - } - - if (bfd_get_section_by_name (abfd, ".dynamic") != NULL) - { - /* We need a PT_DYNAMIC segment. */ - ++segs; - } - - if (elf_tdata (abfd)->eh_frame_hdr) - { - /* We need a PT_GNU_EH_FRAME segment. */ - ++segs; - } - - if (elf_tdata (abfd)->stack_flags) - { - /* We need a PT_GNU_STACK segment. */ - ++segs; - } - - if (elf_tdata (abfd)->relro) - { - /* We need a PT_GNU_RELRO segment. */ - ++segs; - } - - for (s = abfd->sections; s != NULL; s = s->next) - { - if ((s->flags & SEC_LOAD) != 0 - && strncmp (s->name, ".note", 5) == 0) - { - /* We need a PT_NOTE segment. */ - ++segs; - } - } - - for (s = abfd->sections; s != NULL; s = s->next) - { - if (s->flags & SEC_THREAD_LOCAL) - { - /* We need a PT_TLS segment. */ - ++segs; - break; - } - } - - /* Let the backend count up any program headers it might need. */ - if (bed->elf_backend_additional_program_headers) - { - int a; - - a = (*bed->elf_backend_additional_program_headers) (abfd); - if (a == -1) - abort (); - segs += a; - } - - elf_tdata (abfd)->program_header_size = segs * bed->s->sizeof_phdr; - return elf_tdata (abfd)->program_header_size; -} - /* Work out the file positions of all the sections. This is called by _bfd_elf_compute_section_file_positions. All the section sizes and VMAs must be known before this is called. @@ -4718,16 +4873,16 @@ static bfd_boolean assign_file_positions_except_relocs (bfd *abfd, struct bfd_link_info *link_info) { - struct elf_obj_tdata * const tdata = elf_tdata (abfd); - Elf_Internal_Ehdr * const i_ehdrp = elf_elfheader (abfd); - Elf_Internal_Shdr ** const i_shdrpp = elf_elfsections (abfd); - unsigned int num_sec = elf_numsections (abfd); + struct elf_obj_tdata *tdata = elf_tdata (abfd); + Elf_Internal_Ehdr *i_ehdrp = elf_elfheader (abfd); file_ptr off; const struct elf_backend_data *bed = get_elf_backend_data (abfd); if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0 && bfd_get_format (abfd) != bfd_core) { + Elf_Internal_Shdr ** const i_shdrpp = elf_elfsections (abfd); + unsigned int num_sec = elf_numsections (abfd); Elf_Internal_Shdr **hdrpp; unsigned int i; @@ -4762,57 +4917,30 @@ assign_file_positions_except_relocs (bfd *abfd, } else { - unsigned int i; - Elf_Internal_Shdr **hdrpp; + unsigned int alloc; /* Assign file positions for the loaded sections based on the - assignment of sections to segments. */ - if (! assign_file_positions_for_segments (abfd, link_info)) + assignment of sections to segments. */ + if (!assign_file_positions_for_load_sections (abfd, link_info)) return FALSE; - /* Assign file positions for the other sections. */ + /* And for non-load sections. */ + if (!assign_file_positions_for_non_load_sections (abfd, link_info)) + return FALSE; - off = elf_tdata (abfd)->next_file_pos; - for (i = 1, hdrpp = i_shdrpp + 1; i < num_sec; i++, hdrpp++) + if (bed->elf_backend_modify_program_headers != NULL) { - Elf_Internal_Shdr *hdr; - - hdr = *hdrpp; - if (hdr->bfd_section != NULL - && hdr->bfd_section->filepos != 0) - hdr->sh_offset = hdr->bfd_section->filepos; - else if ((hdr->sh_flags & SHF_ALLOC) != 0) - { - ((*_bfd_error_handler) - (_("%B: warning: allocated section `%s' not in segment"), - abfd, - (hdr->bfd_section == NULL - ? "*unknown*" - : hdr->bfd_section->name))); - if ((abfd->flags & D_PAGED) != 0) - off += vma_page_aligned_bias (hdr->sh_addr, off, - bed->maxpagesize); - else - off += vma_page_aligned_bias (hdr->sh_addr, off, - hdr->sh_addralign); - off = _bfd_elf_assign_file_position_for_section (hdr, off, - FALSE); - } - else if (((hdr->sh_type == SHT_REL || hdr->sh_type == SHT_RELA) - && hdr->bfd_section == NULL) - || hdr == i_shdrpp[tdata->symtab_section] - || hdr == i_shdrpp[tdata->symtab_shndx_section] - || hdr == i_shdrpp[tdata->strtab_section]) - hdr->sh_offset = -1; - else - off = _bfd_elf_assign_file_position_for_section (hdr, off, TRUE); - - if (i == SHN_LORESERVE - 1) - { - i += SHN_HIRESERVE + 1 - SHN_LORESERVE; - hdrpp += SHN_HIRESERVE + 1 - SHN_LORESERVE; - } + if (!(*bed->elf_backend_modify_program_headers) (abfd, link_info)) + return FALSE; } + + /* Write out the program headers. */ + alloc = tdata->program_header_size / bed->s->sizeof_phdr; + if (bfd_seek (abfd, (bfd_signed_vma) bed->s->sizeof_ehdr, SEEK_SET) != 0 + || bed->s->write_out_phdrs (abfd, tdata->phdr, alloc) != 0) + return FALSE; + + off = tdata->next_file_pos; } /* Place the section headers. */ @@ -4820,7 +4948,7 @@ assign_file_positions_except_relocs (bfd *abfd, i_ehdrp->e_shoff = off; off += i_ehdrp->e_shnum * i_ehdrp->e_shentsize; - elf_tdata (abfd)->next_file_pos = off; + tdata->next_file_pos = off; return TRUE; } @@ -4987,7 +5115,7 @@ _bfd_elf_write_object_contents (bfd *abfd) /* Write out the section header names. */ if (elf_shstrtab (abfd) != NULL && (bfd_seek (abfd, elf_tdata (abfd)->shstrtab_hdr.sh_offset, SEEK_SET) != 0 - || ! _bfd_elf_strtab_emit (abfd, elf_shstrtab (abfd)))) + || !_bfd_elf_strtab_emit (abfd, elf_shstrtab (abfd)))) return FALSE; if (bed->elf_backend_final_write_processing) @@ -5059,13 +5187,14 @@ _bfd_elf_symbol_from_bfd_symbol (bfd *abfd, asymbol **asym_ptr_ptr) && (flags & BSF_SECTION_SYM) && asym_ptr->section) { + asection *sec; int indx; - if (asym_ptr->section->output_section != NULL) - indx = asym_ptr->section->output_section->index; - else - indx = asym_ptr->section->index; - if (indx < elf_num_section_syms (abfd) + sec = asym_ptr->section; + if (sec->owner != abfd && sec->output_section != NULL) + sec = sec->output_section; + if (sec->owner == abfd + && (indx = sec->index) < elf_num_section_syms (abfd) && elf_section_syms (abfd)[indx] != NULL) asym_ptr->udata.i = elf_section_syms (abfd)[indx]->udata.i; } @@ -5075,7 +5204,7 @@ _bfd_elf_symbol_from_bfd_symbol (bfd *abfd, asymbol **asym_ptr_ptr) if (idx == 0) { /* This case can occur when using --strip-symbol on a symbol - which is used in a relocation entry. */ + which is used in a relocation entry. */ (*_bfd_error_handler) (_("%B: symbol `%s' required but not present"), abfd, bfd_asymbol_name (asym_ptr)); @@ -5154,7 +5283,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) && bfd_get_format (ibfd) == bfd_core \ && s->vma == 0 && s->lma == 0 \ && (bfd_vma) s->filepos >= p->p_offset \ - && ((bfd_vma) s->filepos + s->size \ + && ((bfd_vma) s->filepos + s->size \ <= p->p_offset + p->p_filesz)) /* The complicated case when p_vaddr is 0 is to handle the Solaris @@ -5168,13 +5297,13 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) && (s->flags & SEC_HAS_CONTENTS) != 0 \ && s->size > 0 \ && (bfd_vma) s->filepos >= p->p_offset \ - && ((bfd_vma) s->filepos + s->size \ + && ((bfd_vma) s->filepos + s->size \ <= p->p_offset + p->p_filesz)) /* Decide if the given section should be included in the given segment. A section will be included if: 1. It is within the address space of the segment -- we use the LMA - if that is set for the segment and the VMA otherwise, + if that is set for the segment and the VMA otherwise, 2. It is an allocated segment, 3. There is an output section associated with it, 4. The section has not already been allocated to a previous segment. @@ -5182,14 +5311,13 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) 6. PT_TLS segment includes only SHF_TLS sections. 7. SHF_TLS sections are only in PT_TLS or PT_LOAD segments. 8. PT_DYNAMIC should not contain empty sections at the beginning - (with the possible exception of .dynamic). */ -#define INCLUDE_SECTION_IN_SEGMENT(section, segment, bed) \ + (with the possible exception of .dynamic). */ +#define IS_SECTION_IN_INPUT_SEGMENT(section, segment, bed) \ ((((segment->p_paddr \ ? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr) \ : IS_CONTAINED_BY_VMA (section, segment)) \ && (section->flags & SEC_ALLOC) != 0) \ || IS_COREFILE_NOTE (segment, section)) \ - && section->output_section != NULL \ && segment->p_type != PT_GNU_STACK \ && (segment->p_type != PT_TLS \ || (section->flags & SEC_THREAD_LOCAL)) \ @@ -5199,12 +5327,18 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) && (segment->p_type != PT_DYNAMIC \ || SECTION_SIZE (section, segment) > 0 \ || (segment->p_paddr \ - ? segment->p_paddr != section->lma \ - : segment->p_vaddr != section->vma) \ + ? segment->p_paddr != section->lma \ + : segment->p_vaddr != section->vma) \ || (strcmp (bfd_get_section_name (ibfd, section), ".dynamic") \ - == 0)) \ + == 0)) \ && ! section->segment_mark) +/* If the output section of a section in the input segment is NULL, + it is removed from the corresponding output segment. */ +#define INCLUDE_SECTION_IN_SEGMENT(section, segment, bed) \ + (IS_SECTION_IN_INPUT_SEGMENT (section, segment, bed) \ + && section->output_section != NULL) + /* Returns TRUE iff seg1 starts after the end of seg2. */ #define SEGMENT_AFTER_SEGMENT(seg1, seg2, field) \ (seg1->field >= SEGMENT_END (seg2, seg2->field)) @@ -5217,9 +5351,9 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) LMA. */ #define SEGMENT_OVERLAPS(seg1, seg2) \ ( !(SEGMENT_AFTER_SEGMENT (seg1, seg2, p_vaddr) \ - || SEGMENT_AFTER_SEGMENT (seg2, seg1, p_vaddr)) \ + || SEGMENT_AFTER_SEGMENT (seg2, seg1, p_vaddr)) \ && !(SEGMENT_AFTER_SEGMENT (seg1, seg2, p_paddr) \ - || SEGMENT_AFTER_SEGMENT (seg2, seg1, p_paddr))) + || SEGMENT_AFTER_SEGMENT (seg2, seg1, p_paddr))) /* Initialise the segment mark field. */ for (section = ibfd->sections; section != NULL; section = section->next) @@ -5262,7 +5396,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) if (segment2->p_vaddr < segment->p_vaddr) { /* Extend SEGMENT2 to include SEGMENT and then delete - SEGMENT. */ + SEGMENT. */ extra_length = SEGMENT_END (segment, segment->p_vaddr) - SEGMENT_END (segment2, segment2->p_vaddr); @@ -5283,7 +5417,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) else { /* Extend SEGMENT to include SEGMENT2 and then delete - SEGMENT2. */ + SEGMENT2. */ extra_length = SEGMENT_END (segment2, segment2->p_vaddr) - SEGMENT_END (segment, segment->p_vaddr); @@ -5312,22 +5446,33 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) bfd_vma suggested_lma; unsigned int j; bfd_size_type amt; + asection * first_section; if (segment->p_type == PT_NULL) continue; + first_section = NULL; /* Compute how many sections might be placed into this segment. */ for (section = ibfd->sections, section_count = 0; section != NULL; section = section->next) - if (INCLUDE_SECTION_IN_SEGMENT (section, segment, bed)) - ++section_count; + { + /* Find the first section in the input segment, which may be + removed from the corresponding output segment. */ + if (IS_SECTION_IN_INPUT_SEGMENT (section, segment, bed)) + { + if (first_section == NULL) + first_section = section; + if (section->output_section != NULL) + ++section_count; + } + } /* Allocate a segment map big enough to contain all of the sections we have selected. */ amt = sizeof (struct elf_segment_map); amt += ((bfd_size_type) section_count - 1) * sizeof (asection *); - map = bfd_alloc (obfd, amt); + map = bfd_zalloc (obfd, amt); if (map == NULL) return FALSE; @@ -5337,8 +5482,15 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) map->p_type = segment->p_type; map->p_flags = segment->p_flags; map->p_flags_valid = 1; - map->p_paddr = segment->p_paddr; - map->p_paddr_valid = 1; + + /* If the first section in the input segment is removed, there is + no need to preserve segment physical address in the corresponding + output segment. */ + if (!first_section || first_section->output_section != NULL) + { + map->p_paddr = segment->p_paddr; + map->p_paddr_valid = 1; + } /* Determine if this segment contains the ELF file header and if it contains the program headers themselves. */ @@ -5455,8 +5607,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) if (IS_CONTAINED_BY_LMA (output_section, segment, map->p_paddr) || IS_COREFILE_NOTE (segment, section) || (bed->want_p_paddr_set_to_zero && - IS_CONTAINED_BY_VMA (output_section, segment)) - ) + IS_CONTAINED_BY_VMA (output_section, segment))) { if (matching_lma == 0) matching_lma = output_section->lma; @@ -5485,6 +5636,13 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) *pointer_to_map = map; pointer_to_map = &map->next; + if (matching_lma != map->p_paddr + && !map->includes_filehdr && !map->includes_phdrs) + /* There is some padding before the first section in the + segment. So, we must account for that in the output + segment's vma. */ + map->p_vaddr_offset = matching_lma - map->p_paddr; + free (sections); continue; } @@ -5668,6 +5826,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) #undef IS_CONTAINED_BY_LMA #undef IS_COREFILE_NOTE #undef IS_SOLARIS_PT_INTERP +#undef IS_SECTION_IN_INPUT_SEGMENT #undef INCLUDE_SECTION_IN_SEGMENT #undef SEGMENT_AFTER_SEGMENT #undef SEGMENT_OVERLAPS @@ -5702,6 +5861,7 @@ copy_elf_program_header (bfd *ibfd, bfd *obfd) unsigned int section_count; bfd_size_type amt; Elf_Internal_Shdr *this_hdr; + asection *first_section = NULL; /* FIXME: Do we need to copy PT_NULL segment? */ if (segment->p_type == PT_NULL) @@ -5714,7 +5874,11 @@ copy_elf_program_header (bfd *ibfd, bfd *obfd) { this_hdr = &(elf_section_data(section)->this_hdr); if (ELF_IS_SECTION_IN_SEGMENT_FILE (this_hdr, segment)) - section_count++; + { + if (!first_section) + first_section = section; + section_count++; + } } /* Allocate a segment map big enough to contain @@ -5722,7 +5886,7 @@ copy_elf_program_header (bfd *ibfd, bfd *obfd) amt = sizeof (struct elf_segment_map); if (section_count != 0) amt += ((bfd_size_type) section_count - 1) * sizeof (asection *); - map = bfd_alloc (obfd, amt); + map = bfd_zalloc (obfd, amt); if (map == NULL) return FALSE; @@ -5734,6 +5898,9 @@ copy_elf_program_header (bfd *ibfd, bfd *obfd) map->p_flags_valid = 1; map->p_paddr = segment->p_paddr; map->p_paddr_valid = 1; + map->p_align = segment->p_align; + map->p_align_valid = 1; + map->p_vaddr_offset = 0; /* Determine if this segment contains the ELF file header and if it contains the program headers themselves. */ @@ -5753,17 +5920,26 @@ copy_elf_program_header (bfd *ibfd, bfd *obfd) phdr_included = TRUE; } + if (!map->includes_phdrs && !map->includes_filehdr) + /* There is some other padding before the first section. */ + map->p_vaddr_offset = ((first_section ? first_section->lma : 0) + - segment->p_paddr); + if (section_count != 0) { unsigned int isec = 0; - for (section = ibfd->sections; + for (section = first_section; section != NULL; section = section->next) { this_hdr = &(elf_section_data(section)->this_hdr); if (ELF_IS_SECTION_IN_SEGMENT_FILE (this_hdr, segment)) - map->sections[isec++] = section->output_section; + { + map->sections[isec++] = section->output_section; + if (isec == section_count) + break; + } } } @@ -5791,8 +5967,8 @@ copy_private_bfd_data (bfd *ibfd, bfd *obfd) if (ibfd->xvec == obfd->xvec) { - /* Check if any sections in the input BFD covered by ELF program - header are changed. */ + /* Check to see if any sections in the input BFD + covered by ELF program header have changed. */ Elf_Internal_Phdr *segment; asection *section, *osec; unsigned int i, num_segments; @@ -5808,6 +5984,15 @@ copy_private_bfd_data (bfd *ibfd, bfd *obfd) i < num_segments; i++, segment++) { + /* PR binutils/3535. The Solaris linker always sets the p_paddr + and p_memsz fields of special segments (DYNAMIC, INTERP) to 0 + which severly confuses things, so always regenerate the segment + map in this case. */ + if (segment->p_paddr == 0 + && segment->p_memsz == 0 + && (segment->p_type == PT_INTERP || segment->p_type == PT_DYNAMIC)) + goto rewrite; + for (section = ibfd->sections; section != NULL; section = section->next) { @@ -5835,7 +6020,7 @@ copy_private_bfd_data (bfd *ibfd, bfd *obfd) } } - /* Check to see if any output section doesn't come from the + /* Check to see if any output section do not come from the input BFD. */ for (section = obfd->sections; section != NULL; section = section->next) @@ -5870,16 +6055,22 @@ _bfd_elf_init_private_section_data (bfd *ibfd, || obfd->xvec->flavour != bfd_target_elf_flavour) return TRUE; - /* FIXME: What if the output ELF section type has been set to - something different? */ - if (elf_section_type (osec) == SHT_NULL) + /* Don't copy the output ELF section type from input if the + output BFD section flags have been set to something different. + elf_fake_sections will set ELF section type based on BFD + section flags. */ + if (elf_section_type (osec) == SHT_NULL + && (osec->flags == isec->flags || !osec->flags)) elf_section_type (osec) = elf_section_type (isec); + /* FIXME: Is this correct for all OS/PROC specific flags? */ + elf_section_flags (osec) |= (elf_section_flags (isec) + & (SHF_MASKOS | SHF_MASKPROC)); + /* Set things up for objcopy and relocatable link. The output SHT_GROUP section will have its elf_next_in_group pointing back to the input group members. Ignore linker created group section. See elfNN_ia64_object_p in elfxx-ia64.c. */ - if (need_group) { if (elf_sec_group (isec) == NULL @@ -5944,6 +6135,8 @@ _bfd_elf_copy_private_section_data (bfd *ibfd, bfd_boolean _bfd_elf_copy_private_header_data (bfd *ibfd, bfd *obfd) { + asection *isec; + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) return TRUE; @@ -5959,6 +6152,27 @@ _bfd_elf_copy_private_header_data (bfd *ibfd, bfd *obfd) return FALSE; } + /* _bfd_elf_copy_private_section_data copied over the SHF_GROUP flag + but this might be wrong if we deleted the group section. */ + for (isec = ibfd->sections; isec != NULL; isec = isec->next) + if (elf_section_type (isec) == SHT_GROUP + && isec->output_section == NULL) + { + asection *first = elf_next_in_group (isec); + asection *s = first; + while (s != NULL) + { + if (s->output_section != NULL) + { + elf_section_flags (s->output_section) &= ~SHF_GROUP; + elf_group_name (s->output_section) = NULL; + } + s = elf_next_in_group (s); + if (s == first) + break; + } + } + return TRUE; } @@ -6231,6 +6445,10 @@ Unable to find equivalent output section for symbol '%s' from section '%s'"), type = STT_FUNC; else if ((flags & BSF_OBJECT) != 0) type = STT_OBJECT; + else if ((flags & BSF_RELC) != 0) + type = STT_RELC; + else if ((flags & BSF_SRELC) != 0) + type = STT_SRELC; else type = STT_NOTYPE; @@ -7029,13 +7247,31 @@ _bfd_elf_find_inliner_info (bfd *abfd, } int -_bfd_elf_sizeof_headers (bfd *abfd, bfd_boolean reloc) +_bfd_elf_sizeof_headers (bfd *abfd, struct bfd_link_info *info) { - int ret; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + int ret = bed->s->sizeof_ehdr; + + if (!info->relocatable) + { + bfd_size_type phdr_size = elf_tdata (abfd)->program_header_size; + + if (phdr_size == (bfd_size_type) -1) + { + struct elf_segment_map *m; + + phdr_size = 0; + for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + phdr_size += bed->s->sizeof_phdr; + + if (phdr_size == 0) + phdr_size = get_program_header_size (abfd, info); + } + + elf_tdata (abfd)->program_header_size = phdr_size; + ret += phdr_size; + } - ret = get_elf_backend_data (abfd)->s->sizeof_ehdr; - if (! reloc) - ret += get_program_header_size (abfd); return ret; } @@ -7171,7 +7407,7 @@ _bfd_elf_close_and_cleanup (bfd *abfd) { if (bfd_get_format (abfd) == bfd_object) { - if (elf_shstrtab (abfd) != NULL) + if (elf_tdata (abfd) != NULL && elf_shstrtab (abfd) != NULL) _bfd_elf_strtab_free (elf_shstrtab (abfd)); _bfd_dwarf2_cleanup_debug_info (abfd); } @@ -7225,13 +7461,12 @@ elfcore_maybe_make_sect (bfd *abfd, char *name, asection *sect) if (bfd_get_section_by_name (abfd, name) != NULL) return TRUE; - sect2 = bfd_make_section (abfd, name); + sect2 = bfd_make_section_with_flags (abfd, name, sect->flags); if (sect2 == NULL) return FALSE; sect2->size = sect->size; sect2->filepos = sect->filepos; - sect2->flags = sect->flags; sect2->alignment_power = sect->alignment_power; return TRUE; } @@ -7263,12 +7498,12 @@ _bfd_elfcore_make_pseudosection (bfd *abfd, return FALSE; memcpy (threaded_name, buf, len); - sect = bfd_make_section_anyway (abfd, threaded_name); + sect = bfd_make_section_anyway_with_flags (abfd, threaded_name, + SEC_HAS_CONTENTS); if (sect == NULL) return FALSE; sect->size = size; sect->filepos = filepos; - sect->flags = SEC_HAS_CONTENTS; sect->alignment_power = 2; return elfcore_maybe_make_sect (abfd, name, sect); @@ -7547,7 +7782,7 @@ elfcore_grok_lwpstatus (bfd *abfd, Elf_Internal_Note *note) return FALSE; memcpy (name, buf, len); - sect = bfd_make_section_anyway (abfd, name); + sect = bfd_make_section_anyway_with_flags (abfd, name, SEC_HAS_CONTENTS); if (sect == NULL) return FALSE; @@ -7562,7 +7797,6 @@ elfcore_grok_lwpstatus (bfd *abfd, Elf_Internal_Note *note) sect->filepos = note->descpos + offsetof (lwpstatus_t, pr_reg); #endif - sect->flags = SEC_HAS_CONTENTS; sect->alignment_power = 2; if (!elfcore_maybe_make_sect (abfd, ".reg", sect)) @@ -7577,7 +7811,7 @@ elfcore_grok_lwpstatus (bfd *abfd, Elf_Internal_Note *note) return FALSE; memcpy (name, buf, len); - sect = bfd_make_section_anyway (abfd, name); + sect = bfd_make_section_anyway_with_flags (abfd, name, SEC_HAS_CONTENTS); if (sect == NULL) return FALSE; @@ -7592,7 +7826,6 @@ elfcore_grok_lwpstatus (bfd *abfd, Elf_Internal_Note *note) sect->filepos = note->descpos + offsetof (lwpstatus_t, pr_fpreg); #endif - sect->flags = SEC_HAS_CONTENTS; sect->alignment_power = 2; return elfcore_maybe_make_sect (abfd, ".reg2", sect); @@ -7633,7 +7866,7 @@ elfcore_grok_win32pstatus (bfd *abfd, Elf_Internal_Note *note) memcpy (name, buf, len); - sect = bfd_make_section_anyway (abfd, name); + sect = bfd_make_section_anyway_with_flags (abfd, name, SEC_HAS_CONTENTS); if (sect == NULL) return FALSE; @@ -7641,7 +7874,6 @@ elfcore_grok_win32pstatus (bfd *abfd, Elf_Internal_Note *note) sect->filepos = (note->descpos + offsetof (struct win32_pstatus, data.thread_info.thread_context)); - sect->flags = SEC_HAS_CONTENTS; sect->alignment_power = 2; if (pstatus.data.thread_info.is_active_thread) @@ -7661,14 +7893,13 @@ elfcore_grok_win32pstatus (bfd *abfd, Elf_Internal_Note *note) memcpy (name, buf, len); - sect = bfd_make_section_anyway (abfd, name); + sect = bfd_make_section_anyway_with_flags (abfd, name, SEC_HAS_CONTENTS); if (sect == NULL) return FALSE; sect->size = note->descsz; sect->filepos = note->descpos; - sect->flags = SEC_HAS_CONTENTS; sect->alignment_power = 2; break; @@ -7738,13 +7969,13 @@ elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note) case NT_AUXV: { - asection *sect = bfd_make_section_anyway (abfd, ".auxv"); + asection *sect = bfd_make_section_anyway_with_flags (abfd, ".auxv", + SEC_HAS_CONTENTS); if (sect == NULL) return FALSE; sect->size = note->descsz; sect->filepos = note->descpos; - sect->flags = SEC_HAS_CONTENTS; sect->alignment_power = 1 + bfd_get_arch_size (abfd) / 32; return TRUE; @@ -7769,7 +8000,6 @@ elfcore_netbsd_get_lwpid (Elf_Internal_Note *note, int *lwpidp) static bfd_boolean elfcore_grok_netbsd_procinfo (bfd *abfd, Elf_Internal_Note *note) { - /* Signal number at offset 0x08. */ elf_tdata (abfd)->core_signal = bfd_h_get_32 (abfd, (bfd_byte *) note->descdata + 0x08); @@ -7797,9 +8027,9 @@ elfcore_grok_netbsd_note (bfd *abfd, Elf_Internal_Note *note) if (note->type == NT_NETBSDCORE_PROCINFO) { /* NetBSD-specific core "procinfo". Note that we expect to - find this note before any of the others, which is fine, - since the kernel writes this note out first when it - creates a core file. */ + find this note before any of the others, which is fine, + since the kernel writes this note out first when it + creates a core file. */ return elfcore_grok_netbsd_procinfo (abfd, note); } @@ -7815,44 +8045,44 @@ elfcore_grok_netbsd_note (bfd *abfd, Elf_Internal_Note *note) switch (bfd_get_arch (abfd)) { - /* On the Alpha, SPARC (32-bit and 64-bit), PT_GETREGS == mach+0 and - PT_GETFPREGS == mach+2. */ + /* On the Alpha, SPARC (32-bit and 64-bit), PT_GETREGS == mach+0 and + PT_GETFPREGS == mach+2. */ case bfd_arch_alpha: case bfd_arch_sparc: switch (note->type) - { - case NT_NETBSDCORE_FIRSTMACH+0: - return elfcore_make_note_pseudosection (abfd, ".reg", note); + { + case NT_NETBSDCORE_FIRSTMACH+0: + return elfcore_make_note_pseudosection (abfd, ".reg", note); - case NT_NETBSDCORE_FIRSTMACH+2: - return elfcore_make_note_pseudosection (abfd, ".reg2", note); + case NT_NETBSDCORE_FIRSTMACH+2: + return elfcore_make_note_pseudosection (abfd, ".reg2", note); - default: - return TRUE; - } + default: + return TRUE; + } - /* On all other arch's, PT_GETREGS == mach+1 and - PT_GETFPREGS == mach+3. */ + /* On all other arch's, PT_GETREGS == mach+1 and + PT_GETFPREGS == mach+3. */ default: switch (note->type) - { - case NT_NETBSDCORE_FIRSTMACH+1: - return elfcore_make_note_pseudosection (abfd, ".reg", note); + { + case NT_NETBSDCORE_FIRSTMACH+1: + return elfcore_make_note_pseudosection (abfd, ".reg", note); - case NT_NETBSDCORE_FIRSTMACH+3: - return elfcore_make_note_pseudosection (abfd, ".reg2", note); + case NT_NETBSDCORE_FIRSTMACH+3: + return elfcore_make_note_pseudosection (abfd, ".reg2", note); - default: - return TRUE; - } + default: + return TRUE; + } } /* NOTREACHED */ } static bfd_boolean -elfcore_grok_nto_status (bfd *abfd, Elf_Internal_Note *note, pid_t *tid) +elfcore_grok_nto_status (bfd *abfd, Elf_Internal_Note *note, long *tid) { void *ddata = note->descdata; char buf[100]; @@ -7884,20 +8114,19 @@ elfcore_grok_nto_status (bfd *abfd, Elf_Internal_Note *note, pid_t *tid) elf_tdata (abfd)->core_lwpid = *tid; /* Make a ".qnx_core_status/%d" section. */ - sprintf (buf, ".qnx_core_status/%ld", (long) *tid); + sprintf (buf, ".qnx_core_status/%ld", *tid); name = bfd_alloc (abfd, strlen (buf) + 1); if (name == NULL) return FALSE; strcpy (name, buf); - sect = bfd_make_section_anyway (abfd, name); + sect = bfd_make_section_anyway_with_flags (abfd, name, SEC_HAS_CONTENTS); if (sect == NULL) return FALSE; sect->size = note->descsz; sect->filepos = note->descpos; - sect->flags = SEC_HAS_CONTENTS; sect->alignment_power = 2; return (elfcore_maybe_make_sect (abfd, ".qnx_core_status", sect)); @@ -7906,7 +8135,7 @@ elfcore_grok_nto_status (bfd *abfd, Elf_Internal_Note *note, pid_t *tid) static bfd_boolean elfcore_grok_nto_regs (bfd *abfd, Elf_Internal_Note *note, - pid_t tid, + long tid, char *base) { char buf[100]; @@ -7914,20 +8143,19 @@ elfcore_grok_nto_regs (bfd *abfd, asection *sect; /* Make a "(base)/%d" section. */ - sprintf (buf, "%s/%ld", base, (long) tid); + sprintf (buf, "%s/%ld", base, tid); name = bfd_alloc (abfd, strlen (buf) + 1); if (name == NULL) return FALSE; strcpy (name, buf); - sect = bfd_make_section_anyway (abfd, name); + sect = bfd_make_section_anyway_with_flags (abfd, name, SEC_HAS_CONTENTS); if (sect == NULL) return FALSE; sect->size = note->descsz; sect->filepos = note->descpos; - sect->flags = SEC_HAS_CONTENTS; sect->alignment_power = 2; /* This is the current thread. */ @@ -7948,7 +8176,7 @@ elfcore_grok_nto_note (bfd *abfd, Elf_Internal_Note *note) /* Every GREG section has a STATUS section before it. Store the tid from the previous call to pass down to the next gregs function. */ - static pid_t tid = 1; + static long tid = 1; switch (note->type) { @@ -7968,45 +8196,42 @@ elfcore_grok_nto_note (bfd *abfd, Elf_Internal_Note *note) /* Function: elfcore_write_note Inputs: - buffer to hold note + buffer to hold note, and current size of buffer name of note type of note data for note size of data for note + Writes note to end of buffer. ELF64 notes are written exactly as + for ELF32, despite the current (as of 2006) ELF gabi specifying + that they ought to have 8-byte namesz and descsz field, and have + 8-byte alignment. Other writers, eg. Linux kernel, do the same. + Return: - End of buffer containing note. */ + Pointer to realloc'd buffer, *BUFSIZ updated. */ char * -elfcore_write_note (bfd *abfd, +elfcore_write_note (bfd *abfd, char *buf, - int *bufsiz, + int *bufsiz, const char *name, - int type, + int type, const void *input, - int size) + int size) { Elf_External_Note *xnp; size_t namesz; - size_t pad; size_t newspace; - char *p, *dest; + char *dest; namesz = 0; - pad = 0; if (name != NULL) - { - const struct elf_backend_data *bed; + namesz = strlen (name) + 1; - namesz = strlen (name) + 1; - bed = get_elf_backend_data (abfd); - pad = -namesz & ((1 << bed->s->log_file_align) - 1); - } + newspace = 12 + ((namesz + 3) & -4) + ((size + 3) & -4); - newspace = 12 + namesz + pad + size; - - p = realloc (buf, *bufsiz + newspace); - dest = p + *bufsiz; + buf = realloc (buf, *bufsiz + newspace); + dest = buf + *bufsiz; *bufsiz += newspace; xnp = (Elf_External_Note *) dest; H_PUT_32 (abfd, namesz, xnp->namesz); @@ -8017,14 +8242,20 @@ elfcore_write_note (bfd *abfd, { memcpy (dest, name, namesz); dest += namesz; - while (pad != 0) + while (namesz & 3) { *dest++ = '\0'; - --pad; + ++namesz; } } memcpy (dest, input, size); - return p; + dest += size; + while (size & 3) + { + *dest++ = '\0'; + ++size; + } + return buf; } #if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T) @@ -8035,22 +8266,52 @@ elfcore_write_prpsinfo (bfd *abfd, const char *fname, const char *psargs) { - int note_type; - char *note_name = "CORE"; + const char *note_name = "CORE"; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); -#if defined (HAVE_PSINFO_T) - psinfo_t data; - note_type = NT_PSINFO; + if (bed->elf_backend_write_core_note != NULL) + { + char *ret; + ret = (*bed->elf_backend_write_core_note) (abfd, buf, bufsiz, + NT_PRPSINFO, fname, psargs); + if (ret != NULL) + return ret; + } + +#if defined (HAVE_PRPSINFO32_T) || defined (HAVE_PSINFO32_T) + if (bed->s->elfclass == ELFCLASS32) + { +#if defined (HAVE_PSINFO32_T) + psinfo32_t data; + int note_type = NT_PSINFO; #else - prpsinfo_t data; - note_type = NT_PRPSINFO; + prpsinfo32_t data; + int note_type = NT_PRPSINFO; #endif - memset (&data, 0, sizeof (data)); - strncpy (data.pr_fname, fname, sizeof (data.pr_fname)); - strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs)); - return elfcore_write_note (abfd, buf, bufsiz, - note_name, note_type, &data, sizeof (data)); + memset (&data, 0, sizeof (data)); + strncpy (data.pr_fname, fname, sizeof (data.pr_fname)); + strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs)); + return elfcore_write_note (abfd, buf, bufsiz, + note_name, note_type, &data, sizeof (data)); + } + else +#endif + { +#if defined (HAVE_PSINFO_T) + psinfo_t data; + int note_type = NT_PSINFO; +#else + prpsinfo_t data; + int note_type = NT_PRPSINFO; +#endif + + memset (&data, 0, sizeof (data)); + strncpy (data.pr_fname, fname, sizeof (data.pr_fname)); + strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs)); + return elfcore_write_note (abfd, buf, bufsiz, + note_name, note_type, &data, sizeof (data)); + } } #endif /* PSINFO_T or PRPSINFO_T */ @@ -8063,15 +8324,43 @@ elfcore_write_prstatus (bfd *abfd, int cursig, const void *gregs) { - prstatus_t prstat; - char *note_name = "CORE"; + const char *note_name = "CORE"; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); - memset (&prstat, 0, sizeof (prstat)); - prstat.pr_pid = pid; - prstat.pr_cursig = cursig; - memcpy (&prstat.pr_reg, gregs, sizeof (prstat.pr_reg)); - return elfcore_write_note (abfd, buf, bufsiz, - note_name, NT_PRSTATUS, &prstat, sizeof (prstat)); + if (bed->elf_backend_write_core_note != NULL) + { + char *ret; + ret = (*bed->elf_backend_write_core_note) (abfd, buf, bufsiz, + NT_PRSTATUS, + pid, cursig, gregs); + if (ret != NULL) + return ret; + } + +#if defined (HAVE_PRSTATUS32_T) + if (bed->s->elfclass == ELFCLASS32) + { + prstatus32_t prstat; + + memset (&prstat, 0, sizeof (prstat)); + prstat.pr_pid = pid; + prstat.pr_cursig = cursig; + memcpy (&prstat.pr_reg, gregs, sizeof (prstat.pr_reg)); + return elfcore_write_note (abfd, buf, bufsiz, note_name, + NT_PRSTATUS, &prstat, sizeof (prstat)); + } + else +#endif + { + prstatus_t prstat; + + memset (&prstat, 0, sizeof (prstat)); + prstat.pr_pid = pid; + prstat.pr_cursig = cursig; + memcpy (&prstat.pr_reg, gregs, sizeof (prstat.pr_reg)); + return elfcore_write_note (abfd, buf, bufsiz, note_name, + NT_PRSTATUS, &prstat, sizeof (prstat)); + } } #endif /* HAVE_PRSTATUS_T */ @@ -8085,7 +8374,7 @@ elfcore_write_lwpstatus (bfd *abfd, const void *gregs) { lwpstatus_t lwpstat; - char *note_name = "CORE"; + const char *note_name = "CORE"; memset (&lwpstat, 0, sizeof (lwpstat)); lwpstat.pr_lwpid = pid >> 16; @@ -8115,14 +8404,31 @@ elfcore_write_pstatus (bfd *abfd, int cursig ATTRIBUTE_UNUSED, const void *gregs ATTRIBUTE_UNUSED) { - pstatus_t pstat; - char *note_name = "CORE"; + const char *note_name = "CORE"; +#if defined (HAVE_PSTATUS32_T) + const struct elf_backend_data *bed = get_elf_backend_data (abfd); - memset (&pstat, 0, sizeof (pstat)); - pstat.pr_pid = pid & 0xffff; - buf = elfcore_write_note (abfd, buf, bufsiz, note_name, - NT_PSTATUS, &pstat, sizeof (pstat)); - return buf; + if (bed->s->elfclass == ELFCLASS32) + { + pstatus32_t pstat; + + memset (&pstat, 0, sizeof (pstat)); + pstat.pr_pid = pid & 0xffff; + buf = elfcore_write_note (abfd, buf, bufsiz, note_name, + NT_PSTATUS, &pstat, sizeof (pstat)); + return buf; + } + else +#endif + { + pstatus_t pstat; + + memset (&pstat, 0, sizeof (pstat)); + pstat.pr_pid = pid & 0xffff; + buf = elfcore_write_note (abfd, buf, bufsiz, note_name, + NT_PSTATUS, &pstat, sizeof (pstat)); + return buf; + } } #endif /* HAVE_PSTATUS_T */ @@ -8133,7 +8439,7 @@ elfcore_write_prfpreg (bfd *abfd, const void *fpregs, int size) { - char *note_name = "CORE"; + const char *note_name = "CORE"; return elfcore_write_note (abfd, buf, bufsiz, note_name, NT_FPREGSET, fpregs, size); } @@ -8189,21 +8495,21 @@ elfcore_read_notes (bfd *abfd, file_ptr offset, bfd_size_type size) in.descdata = in.namedata + BFD_ALIGN (in.namesz, 4); in.descpos = offset + (in.descdata - buf); - if (strncmp (in.namedata, "NetBSD-CORE", 11) == 0) - { - if (! elfcore_grok_netbsd_note (abfd, &in)) - goto error; - } - else if (strncmp (in.namedata, "QNX", 3) == 0) + if (CONST_STRNEQ (in.namedata, "NetBSD-CORE")) + { + if (! elfcore_grok_netbsd_note (abfd, &in)) + goto error; + } + else if (CONST_STRNEQ (in.namedata, "QNX")) { if (! elfcore_grok_nto_note (abfd, &in)) goto error; } else - { - if (! elfcore_grok_note (abfd, &in)) - goto error; - } + { + if (! elfcore_grok_note (abfd, &in)) + goto error; + } p = in.descdata + BFD_ALIGN (in.descsz, 4); } @@ -8509,39 +8815,41 @@ _bfd_elf_get_synthetic_symtab (bfd *abfd, return n; } -/* Sort symbol by binding and section. We want to put definitions - sorted by section at the beginning. */ +struct elf_symbuf_symbol +{ + unsigned long st_name; /* Symbol name, index in string tbl */ + unsigned char st_info; /* Type and binding attributes */ + unsigned char st_other; /* Visibilty, and target specific */ +}; + +struct elf_symbuf_head +{ + struct elf_symbuf_symbol *ssym; + bfd_size_type count; + unsigned int st_shndx; +}; + +struct elf_symbol +{ + union + { + Elf_Internal_Sym *isym; + struct elf_symbuf_symbol *ssym; + } u; + const char *name; +}; + +/* Sort references to symbols by ascending section number. */ static int elf_sort_elf_symbol (const void *arg1, const void *arg2) { - const Elf_Internal_Sym *s1; - const Elf_Internal_Sym *s2; - int shndx; + const Elf_Internal_Sym *s1 = *(const Elf_Internal_Sym **) arg1; + const Elf_Internal_Sym *s2 = *(const Elf_Internal_Sym **) arg2; - /* Make sure that undefined symbols are at the end. */ - s1 = (const Elf_Internal_Sym *) arg1; - if (s1->st_shndx == SHN_UNDEF) - return 1; - s2 = (const Elf_Internal_Sym *) arg2; - if (s2->st_shndx == SHN_UNDEF) - return -1; - - /* Sorted by section index. */ - shndx = s1->st_shndx - s2->st_shndx; - if (shndx != 0) - return shndx; - - /* Sorted by binding. */ - return ELF_ST_BIND (s1->st_info) - ELF_ST_BIND (s2->st_info); + return s1->st_shndx - s2->st_shndx; } -struct elf_symbol -{ - Elf_Internal_Sym *sym; - const char *name; -}; - static int elf_sym_name_compare (const void *arg1, const void *arg2) { @@ -8550,20 +8858,79 @@ elf_sym_name_compare (const void *arg1, const void *arg2) return strcmp (s1->name, s2->name); } +static struct elf_symbuf_head * +elf_create_symbuf (bfd_size_type symcount, Elf_Internal_Sym *isymbuf) +{ + Elf_Internal_Sym **ind, **indbufend, **indbuf + = bfd_malloc2 (symcount, sizeof (*indbuf)); + struct elf_symbuf_symbol *ssym; + struct elf_symbuf_head *ssymbuf, *ssymhead; + bfd_size_type i, shndx_count; + + if (indbuf == NULL) + return NULL; + + for (ind = indbuf, i = 0; i < symcount; i++) + if (isymbuf[i].st_shndx != SHN_UNDEF) + *ind++ = &isymbuf[i]; + indbufend = ind; + + qsort (indbuf, indbufend - indbuf, sizeof (Elf_Internal_Sym *), + elf_sort_elf_symbol); + + shndx_count = 0; + if (indbufend > indbuf) + for (ind = indbuf, shndx_count++; ind < indbufend - 1; ind++) + if (ind[0]->st_shndx != ind[1]->st_shndx) + shndx_count++; + + ssymbuf = bfd_malloc ((shndx_count + 1) * sizeof (*ssymbuf) + + (indbufend - indbuf) * sizeof (*ssymbuf)); + if (ssymbuf == NULL) + { + free (indbuf); + return NULL; + } + + ssym = (struct elf_symbuf_symbol *) (ssymbuf + shndx_count); + ssymbuf->ssym = NULL; + ssymbuf->count = shndx_count; + ssymbuf->st_shndx = 0; + for (ssymhead = ssymbuf, ind = indbuf; ind < indbufend; ssym++, ind++) + { + if (ind == indbuf || ssymhead->st_shndx != (*ind)->st_shndx) + { + ssymhead++; + ssymhead->ssym = ssym; + ssymhead->count = 0; + ssymhead->st_shndx = (*ind)->st_shndx; + } + ssym->st_name = (*ind)->st_name; + ssym->st_info = (*ind)->st_info; + ssym->st_other = (*ind)->st_other; + ssymhead->count++; + } + BFD_ASSERT ((bfd_size_type) (ssymhead - ssymbuf) == shndx_count); + + free (indbuf); + return ssymbuf; +} + /* Check if 2 sections define the same set of local and global symbols. */ bfd_boolean -bfd_elf_match_symbols_in_sections (asection *sec1, asection *sec2) +bfd_elf_match_symbols_in_sections (asection *sec1, asection *sec2, + struct bfd_link_info *info) { bfd *bfd1, *bfd2; const struct elf_backend_data *bed1, *bed2; Elf_Internal_Shdr *hdr1, *hdr2; bfd_size_type symcount1, symcount2; Elf_Internal_Sym *isymbuf1, *isymbuf2; - Elf_Internal_Sym *isymstart1 = NULL, *isymstart2 = NULL, *isym; - Elf_Internal_Sym *isymend; - struct elf_symbol *symp, *symtable1 = NULL, *symtable2 = NULL; + struct elf_symbuf_head *ssymbuf1, *ssymbuf2; + Elf_Internal_Sym *isym, *isymend; + struct elf_symbol *symtable1 = NULL, *symtable2 = NULL; bfd_size_type count1, count2, i; int shndx1, shndx2; bfd_boolean result; @@ -8573,10 +8940,8 @@ bfd_elf_match_symbols_in_sections (asection *sec1, asection *sec2) /* If both are .gnu.linkonce sections, they have to have the same section name. */ - if (strncmp (sec1->name, ".gnu.linkonce", - sizeof ".gnu.linkonce" - 1) == 0 - && strncmp (sec2->name, ".gnu.linkonce", - sizeof ".gnu.linkonce" - 1) == 0) + if (CONST_STRNEQ (sec1->name, ".gnu.linkonce") + && CONST_STRNEQ (sec2->name, ".gnu.linkonce")) return strcmp (sec1->name + sizeof ".gnu.linkonce", sec2->name + sizeof ".gnu.linkonce") == 0; @@ -8612,84 +8977,155 @@ bfd_elf_match_symbols_in_sections (asection *sec1, asection *sec2) if (symcount1 == 0 || symcount2 == 0) return FALSE; - isymbuf1 = bfd_elf_get_elf_syms (bfd1, hdr1, symcount1, 0, - NULL, NULL, NULL); - isymbuf2 = bfd_elf_get_elf_syms (bfd2, hdr2, symcount2, 0, - NULL, NULL, NULL); - result = FALSE; - if (isymbuf1 == NULL || isymbuf2 == NULL) - goto done; + isymbuf1 = NULL; + isymbuf2 = NULL; + ssymbuf1 = elf_tdata (bfd1)->symbuf; + ssymbuf2 = elf_tdata (bfd2)->symbuf; - /* Sort symbols by binding and section. Global definitions are at - the beginning. */ - qsort (isymbuf1, symcount1, sizeof (Elf_Internal_Sym), - elf_sort_elf_symbol); - qsort (isymbuf2, symcount2, sizeof (Elf_Internal_Sym), - elf_sort_elf_symbol); + if (ssymbuf1 == NULL) + { + isymbuf1 = bfd_elf_get_elf_syms (bfd1, hdr1, symcount1, 0, + NULL, NULL, NULL); + if (isymbuf1 == NULL) + goto done; + + if (!info->reduce_memory_overheads) + elf_tdata (bfd1)->symbuf = ssymbuf1 + = elf_create_symbuf (symcount1, isymbuf1); + } + + if (ssymbuf1 == NULL || ssymbuf2 == NULL) + { + isymbuf2 = bfd_elf_get_elf_syms (bfd2, hdr2, symcount2, 0, + NULL, NULL, NULL); + if (isymbuf2 == NULL) + goto done; + + if (ssymbuf1 != NULL && !info->reduce_memory_overheads) + elf_tdata (bfd2)->symbuf = ssymbuf2 + = elf_create_symbuf (symcount2, isymbuf2); + } + + if (ssymbuf1 != NULL && ssymbuf2 != NULL) + { + /* Optimized faster version. */ + bfd_size_type lo, hi, mid; + struct elf_symbol *symp; + struct elf_symbuf_symbol *ssym, *ssymend; + + lo = 0; + hi = ssymbuf1->count; + ssymbuf1++; + count1 = 0; + while (lo < hi) + { + mid = (lo + hi) / 2; + if ((unsigned int) shndx1 < ssymbuf1[mid].st_shndx) + hi = mid; + else if ((unsigned int) shndx1 > ssymbuf1[mid].st_shndx) + lo = mid + 1; + else + { + count1 = ssymbuf1[mid].count; + ssymbuf1 += mid; + break; + } + } + + lo = 0; + hi = ssymbuf2->count; + ssymbuf2++; + count2 = 0; + while (lo < hi) + { + mid = (lo + hi) / 2; + if ((unsigned int) shndx2 < ssymbuf2[mid].st_shndx) + hi = mid; + else if ((unsigned int) shndx2 > ssymbuf2[mid].st_shndx) + lo = mid + 1; + else + { + count2 = ssymbuf2[mid].count; + ssymbuf2 += mid; + break; + } + } + + if (count1 == 0 || count2 == 0 || count1 != count2) + goto done; + + symtable1 = bfd_malloc (count1 * sizeof (struct elf_symbol)); + symtable2 = bfd_malloc (count2 * sizeof (struct elf_symbol)); + if (symtable1 == NULL || symtable2 == NULL) + goto done; + + symp = symtable1; + for (ssym = ssymbuf1->ssym, ssymend = ssym + count1; + ssym < ssymend; ssym++, symp++) + { + symp->u.ssym = ssym; + symp->name = bfd_elf_string_from_elf_section (bfd1, + hdr1->sh_link, + ssym->st_name); + } + + symp = symtable2; + for (ssym = ssymbuf2->ssym, ssymend = ssym + count2; + ssym < ssymend; ssym++, symp++) + { + symp->u.ssym = ssym; + symp->name = bfd_elf_string_from_elf_section (bfd2, + hdr2->sh_link, + ssym->st_name); + } + + /* Sort symbol by name. */ + qsort (symtable1, count1, sizeof (struct elf_symbol), + elf_sym_name_compare); + qsort (symtable2, count1, sizeof (struct elf_symbol), + elf_sym_name_compare); + + for (i = 0; i < count1; i++) + /* Two symbols must have the same binding, type and name. */ + if (symtable1 [i].u.ssym->st_info != symtable2 [i].u.ssym->st_info + || symtable1 [i].u.ssym->st_other != symtable2 [i].u.ssym->st_other + || strcmp (symtable1 [i].name, symtable2 [i].name) != 0) + goto done; + + result = TRUE; + goto done; + } + + symtable1 = bfd_malloc (symcount1 * sizeof (struct elf_symbol)); + symtable2 = bfd_malloc (symcount2 * sizeof (struct elf_symbol)); + if (symtable1 == NULL || symtable2 == NULL) + goto done; /* Count definitions in the section. */ count1 = 0; - for (isym = isymbuf1, isymend = isym + symcount1; - isym < isymend; isym++) - { - if (isym->st_shndx == (unsigned int) shndx1) - { - if (count1 == 0) - isymstart1 = isym; - count1++; - } - - if (count1 && isym->st_shndx != (unsigned int) shndx1) - break; - } + for (isym = isymbuf1, isymend = isym + symcount1; isym < isymend; isym++) + if (isym->st_shndx == (unsigned int) shndx1) + symtable1[count1++].u.isym = isym; count2 = 0; - for (isym = isymbuf2, isymend = isym + symcount2; - isym < isymend; isym++) - { - if (isym->st_shndx == (unsigned int) shndx2) - { - if (count2 == 0) - isymstart2 = isym; - count2++; - } - - if (count2 && isym->st_shndx != (unsigned int) shndx2) - break; - } + for (isym = isymbuf2, isymend = isym + symcount2; isym < isymend; isym++) + if (isym->st_shndx == (unsigned int) shndx2) + symtable2[count2++].u.isym = isym; if (count1 == 0 || count2 == 0 || count1 != count2) goto done; - symtable1 = bfd_malloc (count1 * sizeof (struct elf_symbol)); - symtable2 = bfd_malloc (count1 * sizeof (struct elf_symbol)); + for (i = 0; i < count1; i++) + symtable1[i].name + = bfd_elf_string_from_elf_section (bfd1, hdr1->sh_link, + symtable1[i].u.isym->st_name); - if (symtable1 == NULL || symtable2 == NULL) - goto done; + for (i = 0; i < count2; i++) + symtable2[i].name + = bfd_elf_string_from_elf_section (bfd2, hdr2->sh_link, + symtable2[i].u.isym->st_name); - symp = symtable1; - for (isym = isymstart1, isymend = isym + count1; - isym < isymend; isym++) - { - symp->sym = isym; - symp->name = bfd_elf_string_from_elf_section (bfd1, - hdr1->sh_link, - isym->st_name); - symp++; - } - - symp = symtable2; - for (isym = isymstart2, isymend = isym + count1; - isym < isymend; isym++) - { - symp->sym = isym; - symp->name = bfd_elf_string_from_elf_section (bfd2, - hdr2->sh_link, - isym->st_name); - symp++; - } - /* Sort symbol by name. */ qsort (symtable1, count1, sizeof (struct elf_symbol), elf_sym_name_compare); @@ -8698,8 +9134,8 @@ bfd_elf_match_symbols_in_sections (asection *sec1, asection *sec2) for (i = 0; i < count1; i++) /* Two symbols must have the same binding, type and name. */ - if (symtable1 [i].sym->st_info != symtable2 [i].sym->st_info - || symtable1 [i].sym->st_other != symtable2 [i].sym->st_other + if (symtable1 [i].u.isym->st_info != symtable2 [i].u.isym->st_info + || symtable1 [i].u.isym->st_other != symtable2 [i].u.isym->st_other || strcmp (symtable1 [i].name, symtable2 [i].name) != 0) goto done; @@ -8721,8 +9157,7 @@ done: /* It is only used by x86-64 so far. */ asection _bfd_elf_large_com_section = BFD_FAKE_SECTION (_bfd_elf_large_com_section, - SEC_IS_COMMON, NULL, NULL, "LARGE_COMMON", - 0); + SEC_IS_COMMON, NULL, "LARGE_COMMON", 0); /* Return TRUE if 2 section types are compatible. */ @@ -8738,3 +9173,25 @@ _bfd_elf_match_sections_by_type (bfd *abfd, const asection *asec, return elf_section_type (asec) == elf_section_type (bsec); } + +void +_bfd_elf_set_osabi (bfd * abfd, + struct bfd_link_info * link_info ATTRIBUTE_UNUSED) +{ + Elf_Internal_Ehdr * i_ehdrp; /* ELF file header, internal form. */ + + i_ehdrp = elf_elfheader (abfd); + + i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi; +} + + +/* Return TRUE for ELF symbol types that represent functions. + This is the default version of this function, which is sufficient for + most targets. It returns true if TYPE is STT_FUNC. */ + +bfd_boolean +_bfd_elf_is_function_type (unsigned int type) +{ + return (type == STT_FUNC); +} diff --git a/bfd/elf32-am33lin.c b/bfd/elf32-am33lin.c index 81f1975f3fe..781e9526bb9 100644 --- a/bfd/elf32-am33lin.c +++ b/bfd/elf32-am33lin.c @@ -1,5 +1,5 @@ /* Matsushita AM33/2.0 support for 32-bit GNU/Linux ELF - Copyright 2003, 2005 + Copyright 2003, 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "elf-bfd.h" #include "elf/mn10300.h" diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c index a6011bdb32d..58d63010783 100644 --- a/bfd/elf32-arc.c +++ b/bfd/elf32-arc.c @@ -1,5 +1,5 @@ /* ARC-specific support for 32-bit ELF - Copyright 1994, 1995, 1997, 1999, 2001, 2002, 2005 + Copyright 1994, 1995, 1997, 1999, 2001, 2002, 2005, 2007 Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). @@ -20,8 +20,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/arc.h" @@ -147,6 +147,22 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (elf_arc_howto_table) / sizeof (elf_arc_howto_table[0]); + i++) + if (elf_arc_howto_table[i].name != NULL + && strcasecmp (elf_arc_howto_table[i].name, r_name) == 0) + return &elf_arc_howto_table[i]; + + return NULL; +} + /* Set the howto pointer for an ARC ELF reloc. */ static void diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index f64f5d6feee..85ed8d7d6fb 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -1,5 +1,5 @@ /* 32-bit ELF support for ARM - Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libiberty.h" #include "libbfd.h" #include "elf-bfd.h" @@ -62,7 +62,7 @@ #define ARM_ELF_ABI_VERSION 0 #define ARM_ELF_OS_ABI_VERSION ELFOSABI_ARM -static const struct elf_backend_data elf32_arm_vxworks_bed; +static struct elf_backend_data elf32_arm_vxworks_bed; /* Note: code such as elf32_arm_reloc_type_lookup expect to use e.g. R_ARM_PC24 as an index into this, and find the R_ARM_PC24 HOWTO @@ -130,19 +130,19 @@ static reloc_howto_type elf32_arm_howto_table_1[] = TRUE), /* pcrel_offset */ /* 8 bit absolute - R_ARM_LDR_PC_G0 in AAELF */ - HOWTO (R_ARM_PC13, /* type */ + HOWTO (R_ARM_LDR_PC_G0, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - FALSE, /* pc_relative */ + 32, /* bitsize */ + TRUE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_bitfield,/* complain_on_overflow */ + complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_ARM_PC13", /* name */ + "R_ARM_LDR_PC_G0", /* name */ FALSE, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ - FALSE), /* pcrel_offset */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ /* 16 bit absolute */ HOWTO (R_ARM_ABS16, /* type */ @@ -217,11 +217,10 @@ static reloc_howto_type elf32_arm_howto_table_1[] = 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ - /* FIXME: Has two more bits of offset in Thumb32. */ HOWTO (R_ARM_THM_CALL, /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ - 23, /* bitsize */ + 25, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ @@ -835,12 +834,12 @@ static reloc_howto_type elf32_arm_howto_table_1[] = 13, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_signed,/* complain_on_overflow */ + complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_THM_ALU_PREL_11_0",/* name */ FALSE, /* partial_inplace */ - 0x040070ff, /* src_mask */ - 0x040070ff, /* dst_mask */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_ARM_THM_PC12, /* type */ @@ -849,12 +848,12 @@ static reloc_howto_type elf32_arm_howto_table_1[] = 13, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_signed,/* complain_on_overflow */ + complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_THM_PC12", /* name */ FALSE, /* partial_inplace */ - 0x040070ff, /* src_mask */ - 0x040070ff, /* dst_mask */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_ARM_ABS32_NOI, /* type */ @@ -884,13 +883,389 @@ static reloc_howto_type elf32_arm_howto_table_1[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ -}; -/* Relocations 57 .. 83 are the "group relocations" which we do not - support. */ + /* Group relocations. */ + + HOWTO (R_ARM_ALU_PC_G0_NC, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ALU_PC_G0_NC", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_ALU_PC_G0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ALU_PC_G0", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_ALU_PC_G1_NC, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ALU_PC_G1_NC", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_ALU_PC_G1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ALU_PC_G1", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_ALU_PC_G2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ALU_PC_G2", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDR_PC_G1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDR_PC_G1", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDR_PC_G2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDR_PC_G2", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDRS_PC_G0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDRS_PC_G0", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDRS_PC_G1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDRS_PC_G1", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDRS_PC_G2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDRS_PC_G2", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDC_PC_G0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDC_PC_G0", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDC_PC_G1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDC_PC_G1", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDC_PC_G2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDC_PC_G2", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_ALU_SB_G0_NC, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ALU_SB_G0_NC", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_ALU_SB_G0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ALU_SB_G0", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_ALU_SB_G1_NC, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ALU_SB_G1_NC", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_ALU_SB_G1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ALU_SB_G1", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_ALU_SB_G2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ALU_SB_G2", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDR_SB_G0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDR_SB_G0", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDR_SB_G1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDR_SB_G1", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDR_SB_G2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDR_SB_G2", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDRS_SB_G0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDRS_SB_G0", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDRS_SB_G1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDRS_SB_G1", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDRS_SB_G2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDRS_SB_G2", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDC_SB_G0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDC_SB_G0", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDC_SB_G1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDC_SB_G1", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDC_SB_G2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDC_SB_G2", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* End of group relocations. */ -static reloc_howto_type elf32_arm_howto_table_2[] = -{ HOWTO (R_ARM_MOVW_BREL_NC, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -1230,7 +1605,7 @@ static reloc_howto_type elf32_arm_howto_table_2[] = 249-255 extended, currently unused, relocations: */ -static reloc_howto_type elf32_arm_howto_table_3[4] = +static reloc_howto_type elf32_arm_howto_table_2[4] = { HOWTO (R_ARM_RREL32, /* type */ 0, /* rightshift */ @@ -1295,13 +1670,9 @@ elf32_arm_howto_from_type (unsigned int r_type) if (r_type < NUM_ELEM (elf32_arm_howto_table_1)) return &elf32_arm_howto_table_1[r_type]; - if (r_type >= R_ARM_MOVW_BREL_NC - && r_type < R_ARM_MOVW_BREL_NC + NUM_ELEM (elf32_arm_howto_table_2)) - return &elf32_arm_howto_table_2[r_type - R_ARM_MOVW_BREL_NC]; - if (r_type >= R_ARM_RREL32 && r_type < R_ARM_RREL32 + NUM_ELEM (elf32_arm_howto_table_2)) - return &elf32_arm_howto_table_3[r_type - R_ARM_RREL32]; + return &elf32_arm_howto_table_2[r_type - R_ARM_RREL32]; return NULL; } @@ -1366,6 +1737,42 @@ static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] = {BFD_RELOC_ARM_TLS_LE32, R_ARM_TLS_LE32}, {BFD_RELOC_VTABLE_INHERIT, R_ARM_GNU_VTINHERIT}, {BFD_RELOC_VTABLE_ENTRY, R_ARM_GNU_VTENTRY}, + {BFD_RELOC_ARM_MOVW, R_ARM_MOVW_ABS_NC}, + {BFD_RELOC_ARM_MOVT, R_ARM_MOVT_ABS}, + {BFD_RELOC_ARM_MOVW_PCREL, R_ARM_MOVW_PREL_NC}, + {BFD_RELOC_ARM_MOVT_PCREL, R_ARM_MOVT_PREL}, + {BFD_RELOC_ARM_THUMB_MOVW, R_ARM_THM_MOVW_ABS_NC}, + {BFD_RELOC_ARM_THUMB_MOVT, R_ARM_THM_MOVT_ABS}, + {BFD_RELOC_ARM_THUMB_MOVW_PCREL, R_ARM_THM_MOVW_PREL_NC}, + {BFD_RELOC_ARM_THUMB_MOVT_PCREL, R_ARM_THM_MOVT_PREL}, + {BFD_RELOC_ARM_ALU_PC_G0_NC, R_ARM_ALU_PC_G0_NC}, + {BFD_RELOC_ARM_ALU_PC_G0, R_ARM_ALU_PC_G0}, + {BFD_RELOC_ARM_ALU_PC_G1_NC, R_ARM_ALU_PC_G1_NC}, + {BFD_RELOC_ARM_ALU_PC_G1, R_ARM_ALU_PC_G1}, + {BFD_RELOC_ARM_ALU_PC_G2, R_ARM_ALU_PC_G2}, + {BFD_RELOC_ARM_LDR_PC_G0, R_ARM_LDR_PC_G0}, + {BFD_RELOC_ARM_LDR_PC_G1, R_ARM_LDR_PC_G1}, + {BFD_RELOC_ARM_LDR_PC_G2, R_ARM_LDR_PC_G2}, + {BFD_RELOC_ARM_LDRS_PC_G0, R_ARM_LDRS_PC_G0}, + {BFD_RELOC_ARM_LDRS_PC_G1, R_ARM_LDRS_PC_G1}, + {BFD_RELOC_ARM_LDRS_PC_G2, R_ARM_LDRS_PC_G2}, + {BFD_RELOC_ARM_LDC_PC_G0, R_ARM_LDC_PC_G0}, + {BFD_RELOC_ARM_LDC_PC_G1, R_ARM_LDC_PC_G1}, + {BFD_RELOC_ARM_LDC_PC_G2, R_ARM_LDC_PC_G2}, + {BFD_RELOC_ARM_ALU_SB_G0_NC, R_ARM_ALU_SB_G0_NC}, + {BFD_RELOC_ARM_ALU_SB_G0, R_ARM_ALU_SB_G0}, + {BFD_RELOC_ARM_ALU_SB_G1_NC, R_ARM_ALU_SB_G1_NC}, + {BFD_RELOC_ARM_ALU_SB_G1, R_ARM_ALU_SB_G1}, + {BFD_RELOC_ARM_ALU_SB_G2, R_ARM_ALU_SB_G2}, + {BFD_RELOC_ARM_LDR_SB_G0, R_ARM_LDR_SB_G0}, + {BFD_RELOC_ARM_LDR_SB_G1, R_ARM_LDR_SB_G1}, + {BFD_RELOC_ARM_LDR_SB_G2, R_ARM_LDR_SB_G2}, + {BFD_RELOC_ARM_LDRS_SB_G0, R_ARM_LDRS_SB_G0}, + {BFD_RELOC_ARM_LDRS_SB_G1, R_ARM_LDRS_SB_G1}, + {BFD_RELOC_ARM_LDRS_SB_G2, R_ARM_LDRS_SB_G2}, + {BFD_RELOC_ARM_LDC_SB_G0, R_ARM_LDC_SB_G0}, + {BFD_RELOC_ARM_LDC_SB_G1, R_ARM_LDC_SB_G1}, + {BFD_RELOC_ARM_LDC_SB_G2, R_ARM_LDC_SB_G2} }; static reloc_howto_type * @@ -1380,6 +1787,31 @@ elf32_arm_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +elf32_arm_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (elf32_arm_howto_table_1) + / sizeof (elf32_arm_howto_table_1[0])); + i++) + if (elf32_arm_howto_table_1[i].name != NULL + && strcasecmp (elf32_arm_howto_table_1[i].name, r_name) == 0) + return &elf32_arm_howto_table_1[i]; + + for (i = 0; + i < (sizeof (elf32_arm_howto_table_2) + / sizeof (elf32_arm_howto_table_2[0])); + i++) + if (elf32_arm_howto_table_2[i].name != NULL + && strcasecmp (elf32_arm_howto_table_2[i].name, r_name) == 0) + return &elf32_arm_howto_table_2[i]; + + return NULL; +} + /* Support for core dump NOTE sections */ static bfd_boolean elf32_arm_nabi_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) @@ -1468,6 +1900,9 @@ typedef unsigned short int insn16; #define ARM2THUMB_GLUE_SECTION_NAME ".glue_7" #define ARM2THUMB_GLUE_ENTRY_NAME "__%s_from_arm" +#define VFP11_ERRATUM_VENEER_SECTION_NAME ".vfp11_veneer" +#define VFP11_ERRATUM_VENEER_ENTRY_NAME "__vfp11_veneer_%x" + /* The name of the dynamic interpreter. This is put in the .interp section. */ #define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" @@ -1580,11 +2015,46 @@ typedef struct elf32_elf_section_map } elf32_arm_section_map; +/* Information about a VFP11 erratum veneer, or a branch to such a veneer. */ + +typedef enum +{ + VFP11_ERRATUM_BRANCH_TO_ARM_VENEER, + VFP11_ERRATUM_BRANCH_TO_THUMB_VENEER, + VFP11_ERRATUM_ARM_VENEER, + VFP11_ERRATUM_THUMB_VENEER +} +elf32_vfp11_erratum_type; + +typedef struct elf32_vfp11_erratum_list +{ + struct elf32_vfp11_erratum_list *next; + bfd_vma vma; + union + { + struct + { + struct elf32_vfp11_erratum_list *veneer; + unsigned int vfp_insn; + } b; + struct + { + struct elf32_vfp11_erratum_list *branch; + unsigned int id; + } v; + } u; + elf32_vfp11_erratum_type type; +} +elf32_vfp11_erratum_list; + typedef struct _arm_elf_section_data { struct bfd_elf_section_data elf; unsigned int mapcount; + unsigned int mapsize; elf32_arm_section_map *map; + unsigned int erratumcount; + elf32_vfp11_erratum_list *erratumlist; } _arm_elf_section_data; @@ -1594,22 +2064,6 @@ _arm_elf_section_data; /* The size of the thread control block. */ #define TCB_SIZE 8 -#define NUM_KNOWN_ATTRIBUTES 32 - -typedef struct aeabi_attribute -{ - int type; - unsigned int i; - char *s; -} aeabi_attribute; - -typedef struct aeabi_attribute_list -{ - struct aeabi_attribute_list *next; - int tag; - aeabi_attribute attr; -} aeabi_attribute_list; - struct elf32_arm_obj_tdata { struct elf_obj_tdata root; @@ -1617,8 +2071,8 @@ struct elf32_arm_obj_tdata /* tls_type for each local got entry. */ char *local_got_tls_type; - aeabi_attribute known_eabi_attributes[NUM_KNOWN_ATTRIBUTES]; - aeabi_attribute_list *other_eabi_attributes; + /* Zero to warn when linking objects with incompatible enum sizes. */ + int no_enum_size_warning; }; #define elf32_arm_tdata(abfd) \ @@ -1630,11 +2084,14 @@ struct elf32_arm_obj_tdata static bfd_boolean elf32_arm_mkobject (bfd *abfd) { - bfd_size_type amt = sizeof (struct elf32_arm_obj_tdata); - abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) - return FALSE; - return TRUE; + { + bfd_size_type amt = sizeof (struct elf32_arm_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + } + return bfd_elf_mkobject (abfd); } /* The ARM linker needs to keep track of the number of relocs that it @@ -1681,6 +2138,10 @@ struct elf32_arm_link_hash_entry #define GOT_TLS_GD 2 #define GOT_TLS_IE 4 unsigned char tls_type; + + /* The symbol marking the real symbol location for exported thumb + symbols with Arm stubs. */ + struct elf_link_hash_entry *export_glue; }; /* Traverse an arm ELF linker hash table. */ @@ -1706,6 +2167,10 @@ struct elf32_arm_link_hash_table /* The size in bytes of the section containing the ARM-to-Thumb glue. */ bfd_size_type arm_glue_size; + /* The size in bytes of the section containing glue for VFP11 erratum + veneers. */ + bfd_size_type vfp11_erratum_glue_size; + /* An arbitrary input BFD chosen to hold the glue sections. */ bfd * bfd_of_glue_owner; @@ -1713,7 +2178,7 @@ struct elf32_arm_link_hash_table int byteswap_code; /* Zero if R_ARM_TARGET1 means R_ARM_ABS32. - Nonzero if R_ARM_TARGET1 means R_ARM_ABS32. */ + Nonzero if R_ARM_TARGET1 means R_ARM_REL32. */ int target1_is_rel; /* The relocation to use for R_ARM_TARGET2 relocations. */ @@ -1725,6 +2190,16 @@ struct elf32_arm_link_hash_table /* Nonzero if the ARM/Thumb BLX instructions are available for use. */ int use_blx; + /* What sort of code sequences we should look for which may trigger the + VFP11 denorm erratum. */ + bfd_arm_vfp11_fix vfp11_fix; + + /* Global counter for the number of fixes we have emitted. */ + int num_vfp11_fixes; + + /* Nonzero to force PIC branch veneers. */ + int pic_veneer; + /* The number of bytes in the initial entry in the PLT. */ bfd_size_type plt_header_size; @@ -1792,6 +2267,7 @@ elf32_arm_link_hash_newfunc (struct bfd_hash_entry * entry, ret->tls_type = GOT_UNKNOWN; ret->plt_thumb_refcount = 0; ret->plt_got_offset = -1; + ret->export_glue = NULL; } return (struct bfd_hash_entry *) ret; @@ -1805,9 +2281,9 @@ reloc_section_p (struct elf32_arm_link_hash_table *htab, const char *name, asection *s) { if (htab->use_rel) - return strncmp (name, ".rel", 4) == 0 && strcmp (s->name, name + 4) == 0; + return CONST_STRNEQ (name, ".rel") && strcmp (s->name, name + 4) == 0; else - return strncmp (name, ".rela", 5) == 0 && strcmp (s->name, name + 5) == 0; + return CONST_STRNEQ (name, ".rela") && strcmp (s->name, name + 5) == 0; } /* Create .got, .gotplt, and .rel(a).got sections in DYNOBJ, and set up @@ -1940,15 +2416,17 @@ elf32_arm_copy_indirect_symbol (struct bfd_link_info *info, eind->relocs_copied = NULL; } - /* Copy over PLT info. */ - edir->plt_thumb_refcount += eind->plt_thumb_refcount; - eind->plt_thumb_refcount = 0; - - if (ind->root.type == bfd_link_hash_indirect - && dir->got.refcount <= 0) + if (ind->root.type == bfd_link_hash_indirect) { - edir->tls_type = eind->tls_type; - eind->tls_type = GOT_UNKNOWN; + /* Copy over PLT info. */ + edir->plt_thumb_refcount += eind->plt_thumb_refcount; + eind->plt_thumb_refcount = 0; + + if (dir->got.refcount <= 0) + { + edir->tls_type = eind->tls_type; + eind->tls_type = GOT_UNKNOWN; + } } _bfd_elf_link_hash_copy_indirect (info, dir, ind); @@ -1984,6 +2462,9 @@ elf32_arm_link_hash_table_create (bfd *abfd) ret->srelplt2 = NULL; ret->thumb_glue_size = 0; ret->arm_glue_size = 0; + ret->vfp11_fix = BFD_ARM_VFP11_FIX_NONE; + ret->vfp11_erratum_glue_size = 0; + ret->num_vfp11_fixes = 0; ret->bfd_of_glue_owner = NULL; ret->byteswap_code = 0; ret->target1_is_rel = 0; @@ -2012,7 +2493,7 @@ elf32_arm_link_hash_table_create (bfd *abfd) static struct elf_link_hash_entry * find_thumb_glue (struct bfd_link_info *link_info, const char *name, - bfd *input_bfd) + char **error_message) { char *tmp_name; struct elf_link_hash_entry *hash; @@ -2032,9 +2513,8 @@ find_thumb_glue (struct bfd_link_info *link_info, (&(hash_table)->root, tmp_name, FALSE, FALSE, TRUE); if (hash == NULL) - /* xgettext:c-format */ - (*_bfd_error_handler) (_("%B: unable to find THUMB glue '%s' for `%s'"), - input_bfd, tmp_name, name); + asprintf (error_message, _("unable to find THUMB glue '%s' for '%s'"), + tmp_name, name); free (tmp_name); @@ -2046,7 +2526,7 @@ find_thumb_glue (struct bfd_link_info *link_info, static struct elf_link_hash_entry * find_arm_glue (struct bfd_link_info *link_info, const char *name, - bfd *input_bfd) + char **error_message) { char *tmp_name; struct elf_link_hash_entry *myh; @@ -2066,9 +2546,8 @@ find_arm_glue (struct bfd_link_info *link_info, (&(hash_table)->root, tmp_name, FALSE, FALSE, TRUE); if (myh == NULL) - /* xgettext:c-format */ - (*_bfd_error_handler) (_("%B: unable to find ARM glue '%s' for `%s'"), - input_bfd, tmp_name, name); + asprintf (error_message, _("unable to find ARM glue '%s' for '%s'"), + tmp_name, name); free (tmp_name); @@ -2084,6 +2563,13 @@ find_arm_glue (struct bfd_link_info *link_info, __func_addr: .word func @ behave as if you saw a ARM_32 reloc. + (v5t static images) + .arm + __func_from_arm: + ldr pc, __func_addr + __func_addr: + .word func @ behave as if you saw a ARM_32 reloc. + (relocatable images) .arm __func_from_arm: @@ -2099,6 +2585,10 @@ static const insn32 a2t1_ldr_insn = 0xe59fc000; static const insn32 a2t2_bx_r12_insn = 0xe12fff1c; static const insn32 a2t3_func_addr_insn = 0x00000001; +#define ARM2THUMB_V5_STATIC_GLUE_SIZE 8 +static const insn32 a2t1v5_ldr_insn = 0xe51ff004; +static const insn32 a2t2v5_func_addr_insn = 0x00000001; + #define ARM2THUMB_PIC_GLUE_SIZE 16 static const insn32 a2t1p_ldr_insn = 0xe59fc004; static const insn32 a2t2p_add_pc_insn = 0xe08cc00f; @@ -2125,6 +2615,8 @@ static const insn16 t2a1_bx_pc_insn = 0x4778; static const insn16 t2a2_noop_insn = 0x46c0; static const insn32 t2a3_b_insn = 0xea000000; +#define VFP11_ERRATUM_VENEER_SIZE 8 + #ifndef ELFARM_NABI_C_INCLUDED bfd_boolean bfd_elf32_arm_allocate_interworking_sections (struct bfd_link_info * info) @@ -2148,7 +2640,7 @@ bfd_elf32_arm_allocate_interworking_sections (struct bfd_link_info * info) foo = bfd_alloc (globals->bfd_of_glue_owner, globals->arm_glue_size); - s->size = globals->arm_glue_size; + BFD_ASSERT (s->size == globals->arm_glue_size); s->contents = foo; } @@ -2163,14 +2655,32 @@ bfd_elf32_arm_allocate_interworking_sections (struct bfd_link_info * info) foo = bfd_alloc (globals->bfd_of_glue_owner, globals->thumb_glue_size); - s->size = globals->thumb_glue_size; + BFD_ASSERT (s->size == globals->thumb_glue_size); + s->contents = foo; + } + + if (globals->vfp11_erratum_glue_size != 0) + { + BFD_ASSERT (globals->bfd_of_glue_owner != NULL); + + s = bfd_get_section_by_name + (globals->bfd_of_glue_owner, VFP11_ERRATUM_VENEER_SECTION_NAME); + + BFD_ASSERT (s != NULL); + + foo = bfd_alloc (globals->bfd_of_glue_owner, + globals->vfp11_erratum_glue_size); + + BFD_ASSERT (s->size == globals->vfp11_erratum_glue_size); s->contents = foo; } return TRUE; } -static void +/* Allocate space and symbols for calling a Thumb function from Arm mode. + returns the symbol identifying teh stub. */ +static struct elf_link_hash_entry * record_arm_to_thumb_glue (struct bfd_link_info * link_info, struct elf_link_hash_entry * h) { @@ -2181,6 +2691,7 @@ record_arm_to_thumb_glue (struct bfd_link_info * link_info, struct bfd_link_hash_entry * bh; struct elf32_arm_link_hash_table * globals; bfd_vma val; + bfd_size_type size; globals = elf32_arm_hash_table (link_info); @@ -2205,7 +2716,7 @@ record_arm_to_thumb_glue (struct bfd_link_info * link_info, { /* We've already seen this guy. */ free (tmp_name); - return; + return myh; } /* The only trick here is using hash_table->arm_glue_size as the value. @@ -2223,12 +2734,18 @@ record_arm_to_thumb_glue (struct bfd_link_info * link_info, free (tmp_name); - if ((link_info->shared || globals->root.is_relocatable_executable)) - globals->arm_glue_size += ARM2THUMB_PIC_GLUE_SIZE; + if (link_info->shared || globals->root.is_relocatable_executable + || globals->pic_veneer) + size = ARM2THUMB_PIC_GLUE_SIZE; + else if (globals->use_blx) + size = ARM2THUMB_V5_STATIC_GLUE_SIZE; else - globals->arm_glue_size += ARM2THUMB_STATIC_GLUE_SIZE; + size = ARM2THUMB_STATIC_GLUE_SIZE; - return; + s->size += size; + globals->arm_glue_size += size; + + return myh; } static void @@ -2302,11 +2819,162 @@ record_thumb_to_arm_glue (struct bfd_link_info *link_info, free (tmp_name); + s->size += THUMB2ARM_GLUE_SIZE; hash_table->thumb_glue_size += THUMB2ARM_GLUE_SIZE; return; } + +/* Add an entry to the code/data map for section SEC. */ + +static void +elf32_arm_section_map_add (asection *sec, char type, bfd_vma vma) +{ + struct _arm_elf_section_data *sec_data = elf32_arm_section_data (sec); + unsigned int newidx; + + if (sec_data->map == NULL) + { + sec_data->map = bfd_malloc (sizeof (elf32_arm_section_map)); + sec_data->mapcount = 0; + sec_data->mapsize = 1; + } + + newidx = sec_data->mapcount++; + + if (sec_data->mapcount > sec_data->mapsize) + { + sec_data->mapsize *= 2; + sec_data->map = bfd_realloc (sec_data->map, sec_data->mapsize + * sizeof (elf32_arm_section_map)); + } + + sec_data->map[newidx].vma = vma; + sec_data->map[newidx].type = type; +} + + +/* Record information about a VFP11 denorm-erratum veneer. Only ARM-mode + veneers are handled for now. */ + +static bfd_vma +record_vfp11_erratum_veneer (struct bfd_link_info *link_info, + elf32_vfp11_erratum_list *branch, + bfd *branch_bfd, + asection *branch_sec, + unsigned int offset) +{ + asection *s; + struct elf32_arm_link_hash_table *hash_table; + char *tmp_name; + struct elf_link_hash_entry *myh; + struct bfd_link_hash_entry *bh; + bfd_vma val; + struct _arm_elf_section_data *sec_data; + int errcount; + elf32_vfp11_erratum_list *newerr; + + hash_table = elf32_arm_hash_table (link_info); + + BFD_ASSERT (hash_table != NULL); + BFD_ASSERT (hash_table->bfd_of_glue_owner != NULL); + + s = bfd_get_section_by_name + (hash_table->bfd_of_glue_owner, VFP11_ERRATUM_VENEER_SECTION_NAME); + + sec_data = elf32_arm_section_data (s); + + BFD_ASSERT (s != NULL); + + tmp_name = bfd_malloc ((bfd_size_type) strlen + (VFP11_ERRATUM_VENEER_ENTRY_NAME) + 10); + + BFD_ASSERT (tmp_name); + + sprintf (tmp_name, VFP11_ERRATUM_VENEER_ENTRY_NAME, + hash_table->num_vfp11_fixes); + + myh = elf_link_hash_lookup + (&(hash_table)->root, tmp_name, FALSE, FALSE, FALSE); + + BFD_ASSERT (myh == NULL); + + bh = NULL; + val = hash_table->vfp11_erratum_glue_size; + _bfd_generic_link_add_one_symbol (link_info, hash_table->bfd_of_glue_owner, + tmp_name, BSF_FUNCTION | BSF_LOCAL, s, val, + NULL, TRUE, FALSE, &bh); + + myh = (struct elf_link_hash_entry *) bh; + myh->type = ELF_ST_INFO (STB_LOCAL, STT_FUNC); + myh->forced_local = 1; + + /* Link veneer back to calling location. */ + errcount = ++(sec_data->erratumcount); + newerr = bfd_zmalloc (sizeof (elf32_vfp11_erratum_list)); + + newerr->type = VFP11_ERRATUM_ARM_VENEER; + newerr->vma = -1; + newerr->u.v.branch = branch; + newerr->u.v.id = hash_table->num_vfp11_fixes; + branch->u.b.veneer = newerr; + + newerr->next = sec_data->erratumlist; + sec_data->erratumlist = newerr; + + /* A symbol for the return from the veneer. */ + sprintf (tmp_name, VFP11_ERRATUM_VENEER_ENTRY_NAME "_r", + hash_table->num_vfp11_fixes); + + myh = elf_link_hash_lookup + (&(hash_table)->root, tmp_name, FALSE, FALSE, FALSE); + + if (myh != NULL) + abort (); + + bh = NULL; + val = offset + 4; + _bfd_generic_link_add_one_symbol (link_info, branch_bfd, tmp_name, BSF_LOCAL, + branch_sec, val, NULL, TRUE, FALSE, &bh); + + myh = (struct elf_link_hash_entry *) bh; + myh->type = ELF_ST_INFO (STB_LOCAL, STT_FUNC); + myh->forced_local = 1; + + free (tmp_name); + + /* Generate a mapping symbol for the veneer section, and explicitly add an + entry for that symbol to the code/data map for the section. */ + if (hash_table->vfp11_erratum_glue_size == 0) + { + bh = NULL; + /* FIXME: Creates an ARM symbol. Thumb mode will need attention if it + ever requires this erratum fix. */ + _bfd_generic_link_add_one_symbol (link_info, + hash_table->bfd_of_glue_owner, "$a", + BSF_LOCAL, s, 0, NULL, + TRUE, FALSE, &bh); + + myh = (struct elf_link_hash_entry *) bh; + myh->type = ELF_ST_INFO (STB_LOCAL, STT_NOTYPE); + myh->forced_local = 1; + + /* The elf32_arm_init_maps function only cares about symbols from input + BFDs. We must make a note of this generated mapping symbol + ourselves so that code byteswapping works properly in + elf32_arm_write_section. */ + elf32_arm_section_map_add (s, 'a', 0); + } + + s->size += VFP11_ERRATUM_VENEER_SIZE; + hash_table->vfp11_erratum_glue_size += VFP11_ERRATUM_VENEER_SIZE; + hash_table->num_vfp11_fixes++; + + /* The offset of the veneer. */ + return val; +} + /* Add the glue sections to ABFD. This function is called from the linker scripts in ld/emultempl/{armelf}.em. */ @@ -2329,7 +2997,8 @@ bfd_elf32_arm_add_glue_sections_to_bfd (bfd *abfd, /* Note: we do not include the flag SEC_LINKER_CREATED, as this will prevent elf_link_input_bfd() from processing the contents of this section. */ - flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY; + flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY + | SEC_CODE | SEC_READONLY); sec = bfd_make_section_with_flags (abfd, ARM2THUMB_GLUE_SECTION_NAME, @@ -2348,8 +3017,8 @@ bfd_elf32_arm_add_glue_sections_to_bfd (bfd *abfd, if (sec == NULL) { - flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY - | SEC_CODE | SEC_READONLY; + flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY + | SEC_CODE | SEC_READONLY); sec = bfd_make_section_with_flags (abfd, THUMB2ARM_GLUE_SECTION_NAME, @@ -2362,6 +3031,24 @@ bfd_elf32_arm_add_glue_sections_to_bfd (bfd *abfd, sec->gc_mark = 1; } + sec = bfd_get_section_by_name (abfd, VFP11_ERRATUM_VENEER_SECTION_NAME); + + if (sec == NULL) + { + flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY + | SEC_CODE | SEC_READONLY); + + sec = bfd_make_section_with_flags (abfd, + VFP11_ERRATUM_VENEER_SECTION_NAME, + flags); + + if (sec == NULL + || !bfd_set_section_alignment (abfd, sec, 2)) + return FALSE; + + sec->gc_mark = 1; + } + return TRUE; } @@ -2397,14 +3084,14 @@ bfd_elf32_arm_get_bfd_for_interworking (bfd *abfd, struct bfd_link_info *info) static void check_use_blx(struct elf32_arm_link_hash_table *globals) { - if (elf32_arm_get_eabi_attr_int (globals->obfd, Tag_CPU_arch) > 2) + if (bfd_elf_get_obj_attr_int (globals->obfd, OBJ_ATTR_PROC, + Tag_CPU_arch) > 2) globals->use_blx = 1; } bfd_boolean bfd_elf32_arm_process_before_allocation (bfd *abfd, - struct bfd_link_info *link_info, - int byteswap_code) + struct bfd_link_info *link_info) { Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Rela *internal_relocs = NULL; @@ -2427,13 +3114,12 @@ bfd_elf32_arm_process_before_allocation (bfd *abfd, BFD_ASSERT (globals != NULL); BFD_ASSERT (globals->bfd_of_glue_owner != NULL); - if (byteswap_code && !bfd_big_endian (abfd)) + if (globals->byteswap_code && !bfd_big_endian (abfd)) { _bfd_error_handler (_("%B: BE8 images only valid in big-endian mode."), abfd); return FALSE; } - globals->byteswap_code = byteswap_code; /* Rummage around all the relocs and map the glue vectors. */ sec = abfd->sections; @@ -2446,6 +3132,9 @@ bfd_elf32_arm_process_before_allocation (bfd *abfd, if (sec->reloc_count == 0) continue; + if ((sec->flags & SEC_EXCLUDE) != 0) + continue; + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; /* Load the relocs. */ @@ -2529,7 +3218,8 @@ bfd_elf32_arm_process_before_allocation (bfd *abfd, /* This one is a call from thumb code. We look up the target of the call. If it is not a thumb target, we insert glue. */ - if (ELF_ST_TYPE (h->type) != STT_ARM_TFUNC && !globals->use_blx) + if (ELF_ST_TYPE (h->type) != STT_ARM_TFUNC && !globals->use_blx + && h->root.type != bfd_link_hash_undefweak) record_thumb_to_arm_glue (link_info, h); break; @@ -2564,14 +3254,654 @@ error_return: #endif +/* Initialise maps of ARM/Thumb/data for input BFDs. */ + +void +bfd_elf32_arm_init_maps (bfd *abfd) +{ + Elf_Internal_Sym *isymbuf; + Elf_Internal_Shdr *hdr; + unsigned int i, localsyms; + + if ((abfd->flags & DYNAMIC) != 0) + return; + + hdr = &elf_tdata (abfd)->symtab_hdr; + localsyms = hdr->sh_info; + + /* Obtain a buffer full of symbols for this BFD. The hdr->sh_info field + should contain the number of local symbols, which should come before any + global symbols. Mapping symbols are always local. */ + isymbuf = bfd_elf_get_elf_syms (abfd, hdr, localsyms, 0, NULL, NULL, + NULL); + + /* No internal symbols read? Skip this BFD. */ + if (isymbuf == NULL) + return; + + for (i = 0; i < localsyms; i++) + { + Elf_Internal_Sym *isym = &isymbuf[i]; + asection *sec = bfd_section_from_elf_index (abfd, isym->st_shndx); + const char *name; + + if (sec != NULL + && ELF_ST_BIND (isym->st_info) == STB_LOCAL) + { + name = bfd_elf_string_from_elf_section (abfd, + hdr->sh_link, isym->st_name); + + if (bfd_is_arm_special_symbol_name (name, + BFD_ARM_SPECIAL_SYM_TYPE_MAP)) + elf32_arm_section_map_add (sec, name[1], isym->st_value); + } + } +} + + +void +bfd_elf32_arm_set_vfp11_fix (bfd *obfd, struct bfd_link_info *link_info) +{ + struct elf32_arm_link_hash_table *globals = elf32_arm_hash_table (link_info); + obj_attribute *out_attr = elf_known_obj_attributes_proc (obfd); + + /* We assume that ARMv7+ does not need the VFP11 denorm erratum fix. */ + if (out_attr[Tag_CPU_arch].i >= TAG_CPU_ARCH_V7) + { + switch (globals->vfp11_fix) + { + case BFD_ARM_VFP11_FIX_DEFAULT: + case BFD_ARM_VFP11_FIX_NONE: + globals->vfp11_fix = BFD_ARM_VFP11_FIX_NONE; + break; + + default: + /* Give a warning, but do as the user requests anyway. */ + (*_bfd_error_handler) (_("%B: warning: selected VFP11 erratum " + "workaround is not necessary for target architecture"), obfd); + } + } + else if (globals->vfp11_fix == BFD_ARM_VFP11_FIX_DEFAULT) + /* For earlier architectures, we might need the workaround, but do not + enable it by default. If users is running with broken hardware, they + must enable the erratum fix explicitly. */ + globals->vfp11_fix = BFD_ARM_VFP11_FIX_NONE; +} + + +enum bfd_arm_vfp11_pipe { + VFP11_FMAC, + VFP11_LS, + VFP11_DS, + VFP11_BAD +}; + +/* Return a VFP register number. This is encoded as RX:X for single-precision + registers, or X:RX for double-precision registers, where RX is the group of + four bits in the instruction encoding and X is the single extension bit. + RX and X fields are specified using their lowest (starting) bit. The return + value is: + + 0...31: single-precision registers s0...s31 + 32...63: double-precision registers d0...d31. + + Although X should be zero for VFP11 (encoding d0...d15 only), we might + encounter VFP3 instructions, so we allow the full range for DP registers. */ + +static unsigned int +bfd_arm_vfp11_regno (unsigned int insn, bfd_boolean is_double, unsigned int rx, + unsigned int x) +{ + if (is_double) + return (((insn >> rx) & 0xf) | (((insn >> x) & 1) << 4)) + 32; + else + return (((insn >> rx) & 0xf) << 1) | ((insn >> x) & 1); +} + +/* Set bits in *WMASK according to a register number REG as encoded by + bfd_arm_vfp11_regno(). Ignore d16-d31. */ + +static void +bfd_arm_vfp11_write_mask (unsigned int *wmask, unsigned int reg) +{ + if (reg < 32) + *wmask |= 1 << reg; + else if (reg < 48) + *wmask |= 3 << ((reg - 32) * 2); +} + +/* Return TRUE if WMASK overwrites anything in REGS. */ + +static bfd_boolean +bfd_arm_vfp11_antidependency (unsigned int wmask, int *regs, int numregs) +{ + int i; + + for (i = 0; i < numregs; i++) + { + unsigned int reg = regs[i]; + + if (reg < 32 && (wmask & (1 << reg)) != 0) + return TRUE; + + reg -= 32; + + if (reg >= 16) + continue; + + if ((wmask & (3 << (reg * 2))) != 0) + return TRUE; + } + + return FALSE; +} + +/* In this function, we're interested in two things: finding input registers + for VFP data-processing instructions, and finding the set of registers which + arbitrary VFP instructions may write to. We use a 32-bit unsigned int to + hold the written set, so FLDM etc. are easy to deal with (we're only + interested in 32 SP registers or 16 dp registers, due to the VFP version + implemented by the chip in question). DP registers are marked by setting + both SP registers in the write mask). */ + +static enum bfd_arm_vfp11_pipe +bfd_arm_vfp11_insn_decode (unsigned int insn, unsigned int *destmask, int *regs, + int *numregs) +{ + enum bfd_arm_vfp11_pipe pipe = VFP11_BAD; + bfd_boolean is_double = ((insn & 0xf00) == 0xb00) ? 1 : 0; + + if ((insn & 0x0f000e10) == 0x0e000a00) /* A data-processing insn. */ + { + unsigned int pqrs; + unsigned int fd = bfd_arm_vfp11_regno (insn, is_double, 12, 22); + unsigned int fm = bfd_arm_vfp11_regno (insn, is_double, 0, 5); + + pqrs = ((insn & 0x00800000) >> 20) + | ((insn & 0x00300000) >> 19) + | ((insn & 0x00000040) >> 6); + + switch (pqrs) + { + case 0: /* fmac[sd]. */ + case 1: /* fnmac[sd]. */ + case 2: /* fmsc[sd]. */ + case 3: /* fnmsc[sd]. */ + pipe = VFP11_FMAC; + bfd_arm_vfp11_write_mask (destmask, fd); + regs[0] = fd; + regs[1] = bfd_arm_vfp11_regno (insn, is_double, 16, 7); /* Fn. */ + regs[2] = fm; + *numregs = 3; + break; + + case 4: /* fmul[sd]. */ + case 5: /* fnmul[sd]. */ + case 6: /* fadd[sd]. */ + case 7: /* fsub[sd]. */ + pipe = VFP11_FMAC; + goto vfp_binop; + + case 8: /* fdiv[sd]. */ + pipe = VFP11_DS; + vfp_binop: + bfd_arm_vfp11_write_mask (destmask, fd); + regs[0] = bfd_arm_vfp11_regno (insn, is_double, 16, 7); /* Fn. */ + regs[1] = fm; + *numregs = 2; + break; + + case 15: /* extended opcode. */ + { + unsigned int extn = ((insn >> 15) & 0x1e) + | ((insn >> 7) & 1); + + switch (extn) + { + case 0: /* fcpy[sd]. */ + case 1: /* fabs[sd]. */ + case 2: /* fneg[sd]. */ + case 8: /* fcmp[sd]. */ + case 9: /* fcmpe[sd]. */ + case 10: /* fcmpz[sd]. */ + case 11: /* fcmpez[sd]. */ + case 16: /* fuito[sd]. */ + case 17: /* fsito[sd]. */ + case 24: /* ftoui[sd]. */ + case 25: /* ftouiz[sd]. */ + case 26: /* ftosi[sd]. */ + case 27: /* ftosiz[sd]. */ + /* These instructions will not bounce due to underflow. */ + *numregs = 0; + pipe = VFP11_FMAC; + break; + + case 3: /* fsqrt[sd]. */ + /* fsqrt cannot underflow, but it can (perhaps) overwrite + registers to cause the erratum in previous instructions. */ + bfd_arm_vfp11_write_mask (destmask, fd); + pipe = VFP11_DS; + break; + + case 15: /* fcvt{ds,sd}. */ + { + int rnum = 0; + + bfd_arm_vfp11_write_mask (destmask, fd); + + /* Only FCVTSD can underflow. */ + if ((insn & 0x100) != 0) + regs[rnum++] = fm; + + *numregs = rnum; + + pipe = VFP11_FMAC; + } + break; + + default: + return VFP11_BAD; + } + } + break; + + default: + return VFP11_BAD; + } + } + /* Two-register transfer. */ + else if ((insn & 0x0fe00ed0) == 0x0c400a10) + { + unsigned int fm = bfd_arm_vfp11_regno (insn, is_double, 0, 5); + + if ((insn & 0x100000) == 0) + { + if (is_double) + bfd_arm_vfp11_write_mask (destmask, fm); + else + { + bfd_arm_vfp11_write_mask (destmask, fm); + bfd_arm_vfp11_write_mask (destmask, fm + 1); + } + } + + pipe = VFP11_LS; + } + else if ((insn & 0x0e100e00) == 0x0c100a00) /* A load insn. */ + { + int fd = bfd_arm_vfp11_regno (insn, is_double, 12, 22); + unsigned int puw = ((insn >> 21) & 0x1) | (((insn >> 23) & 3) << 1); + + switch (puw) + { + case 0: /* Two-reg transfer. We should catch these above. */ + abort (); + + case 2: /* fldm[sdx]. */ + case 3: + case 5: + { + unsigned int i, offset = insn & 0xff; + + if (is_double) + offset >>= 1; + + for (i = fd; i < fd + offset; i++) + bfd_arm_vfp11_write_mask (destmask, i); + } + break; + + case 4: /* fld[sd]. */ + case 6: + bfd_arm_vfp11_write_mask (destmask, fd); + break; + + default: + return VFP11_BAD; + } + + pipe = VFP11_LS; + } + /* Single-register transfer. Note L==0. */ + else if ((insn & 0x0f100e10) == 0x0e000a10) + { + unsigned int opcode = (insn >> 21) & 7; + unsigned int fn = bfd_arm_vfp11_regno (insn, is_double, 16, 7); + + switch (opcode) + { + case 0: /* fmsr/fmdlr. */ + case 1: /* fmdhr. */ + /* Mark fmdhr and fmdlr as writing to the whole of the DP + destination register. I don't know if this is exactly right, + but it is the conservative choice. */ + bfd_arm_vfp11_write_mask (destmask, fn); + break; + + case 7: /* fmxr. */ + break; + } + + pipe = VFP11_LS; + } + + return pipe; +} + + +static int elf32_arm_compare_mapping (const void * a, const void * b); + + +/* Look for potentially-troublesome code sequences which might trigger the + VFP11 denormal/antidependency erratum. See, e.g., the ARM1136 errata sheet + (available from ARM) for details of the erratum. A short version is + described in ld.texinfo. */ + +bfd_boolean +bfd_elf32_arm_vfp11_erratum_scan (bfd *abfd, struct bfd_link_info *link_info) +{ + asection *sec; + bfd_byte *contents = NULL; + int state = 0; + int regs[3], numregs = 0; + struct elf32_arm_link_hash_table *globals = elf32_arm_hash_table (link_info); + int use_vector = (globals->vfp11_fix == BFD_ARM_VFP11_FIX_VECTOR); + + /* We use a simple FSM to match troublesome VFP11 instruction sequences. + The states transition as follows: + + 0 -> 1 (vector) or 0 -> 2 (scalar) + A VFP FMAC-pipeline instruction has been seen. Fill + regs[0]..regs[numregs-1] with its input operands. Remember this + instruction in 'first_fmac'. + + 1 -> 2 + Any instruction, except for a VFP instruction which overwrites + regs[*]. + + 1 -> 3 [ -> 0 ] or + 2 -> 3 [ -> 0 ] + A VFP instruction has been seen which overwrites any of regs[*]. + We must make a veneer! Reset state to 0 before examining next + instruction. + + 2 -> 0 + If we fail to match anything in state 2, reset to state 0 and reset + the instruction pointer to the instruction after 'first_fmac'. + + If the VFP11 vector mode is in use, there must be at least two unrelated + instructions between anti-dependent VFP11 instructions to properly avoid + triggering the erratum, hence the use of the extra state 1. + */ + + /* If we are only performing a partial link do not bother + to construct any glue. */ + if (link_info->relocatable) + return TRUE; + + /* We should have chosen a fix type by the time we get here. */ + BFD_ASSERT (globals->vfp11_fix != BFD_ARM_VFP11_FIX_DEFAULT); + + if (globals->vfp11_fix == BFD_ARM_VFP11_FIX_NONE) + return TRUE; + + /* Skip if this bfd does not correspond to an ELF image. */ + if (bfd_get_flavour (abfd) != bfd_target_elf_flavour) + return TRUE; + + for (sec = abfd->sections; sec != NULL; sec = sec->next) + { + unsigned int i, span, first_fmac = 0, veneer_of_insn = 0; + struct _arm_elf_section_data *sec_data; + + /* If we don't have executable progbits, we're not interested in this + section. Also skip if section is to be excluded. */ + if (elf_section_type (sec) != SHT_PROGBITS + || (elf_section_flags (sec) & SHF_EXECINSTR) == 0 + || (sec->flags & SEC_EXCLUDE) != 0 + || strcmp (sec->name, VFP11_ERRATUM_VENEER_SECTION_NAME) == 0) + continue; + + sec_data = elf32_arm_section_data (sec); + + if (sec_data->mapcount == 0) + continue; + + if (elf_section_data (sec)->this_hdr.contents != NULL) + contents = elf_section_data (sec)->this_hdr.contents; + else if (! bfd_malloc_and_get_section (abfd, sec, &contents)) + goto error_return; + + qsort (sec_data->map, sec_data->mapcount, sizeof (elf32_arm_section_map), + elf32_arm_compare_mapping); + + for (span = 0; span < sec_data->mapcount; span++) + { + unsigned int span_start = sec_data->map[span].vma; + unsigned int span_end = (span == sec_data->mapcount - 1) + ? sec->size : sec_data->map[span + 1].vma; + char span_type = sec_data->map[span].type; + + /* FIXME: Only ARM mode is supported at present. We may need to + support Thumb-2 mode also at some point. */ + if (span_type != 'a') + continue; + + for (i = span_start; i < span_end;) + { + unsigned int next_i = i + 4; + unsigned int insn = bfd_big_endian (abfd) + ? (contents[i] << 24) + | (contents[i + 1] << 16) + | (contents[i + 2] << 8) + | contents[i + 3] + : (contents[i + 3] << 24) + | (contents[i + 2] << 16) + | (contents[i + 1] << 8) + | contents[i]; + unsigned int writemask = 0; + enum bfd_arm_vfp11_pipe pipe; + + switch (state) + { + case 0: + pipe = bfd_arm_vfp11_insn_decode (insn, &writemask, regs, + &numregs); + /* I'm assuming the VFP11 erratum can trigger with denorm + operands on either the FMAC or the DS pipeline. This might + lead to slightly overenthusiastic veneer insertion. */ + if (pipe == VFP11_FMAC || pipe == VFP11_DS) + { + state = use_vector ? 1 : 2; + first_fmac = i; + veneer_of_insn = insn; + } + break; + + case 1: + { + int other_regs[3], other_numregs; + pipe = bfd_arm_vfp11_insn_decode (insn, &writemask, + other_regs, + &other_numregs); + if (pipe != VFP11_BAD + && bfd_arm_vfp11_antidependency (writemask, regs, + numregs)) + state = 3; + else + state = 2; + } + break; + + case 2: + { + int other_regs[3], other_numregs; + pipe = bfd_arm_vfp11_insn_decode (insn, &writemask, + other_regs, + &other_numregs); + if (pipe != VFP11_BAD + && bfd_arm_vfp11_antidependency (writemask, regs, + numregs)) + state = 3; + else + { + state = 0; + next_i = first_fmac + 4; + } + } + break; + + case 3: + abort (); /* Should be unreachable. */ + } + + if (state == 3) + { + elf32_vfp11_erratum_list *newerr + = bfd_zmalloc (sizeof (elf32_vfp11_erratum_list)); + int errcount; + + errcount = ++(elf32_arm_section_data (sec)->erratumcount); + + newerr->u.b.vfp_insn = veneer_of_insn; + + switch (span_type) + { + case 'a': + newerr->type = VFP11_ERRATUM_BRANCH_TO_ARM_VENEER; + break; + + default: + abort (); + } + + record_vfp11_erratum_veneer (link_info, newerr, abfd, sec, + first_fmac); + + newerr->vma = -1; + + newerr->next = sec_data->erratumlist; + sec_data->erratumlist = newerr; + + state = 0; + } + + i = next_i; + } + } + + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) + free (contents); + contents = NULL; + } + + return TRUE; + +error_return: + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) + free (contents); + + return FALSE; +} + +/* Find virtual-memory addresses for VFP11 erratum veneers and return locations + after sections have been laid out, using specially-named symbols. */ + +void +bfd_elf32_arm_vfp11_fix_veneer_locations (bfd *abfd, + struct bfd_link_info *link_info) +{ + asection *sec; + struct elf32_arm_link_hash_table *globals; + char *tmp_name; + + if (link_info->relocatable) + return; + + /* Skip if this bfd does not correspond to an ELF image. */ + if (bfd_get_flavour (abfd) != bfd_target_elf_flavour) + return; + + globals = elf32_arm_hash_table (link_info); + + tmp_name = bfd_malloc ((bfd_size_type) strlen + (VFP11_ERRATUM_VENEER_ENTRY_NAME) + 10); + + for (sec = abfd->sections; sec != NULL; sec = sec->next) + { + struct _arm_elf_section_data *sec_data = elf32_arm_section_data (sec); + elf32_vfp11_erratum_list *errnode = sec_data->erratumlist; + + for (; errnode != NULL; errnode = errnode->next) + { + struct elf_link_hash_entry *myh; + bfd_vma vma; + + switch (errnode->type) + { + case VFP11_ERRATUM_BRANCH_TO_ARM_VENEER: + case VFP11_ERRATUM_BRANCH_TO_THUMB_VENEER: + /* Find veneer symbol. */ + sprintf (tmp_name, VFP11_ERRATUM_VENEER_ENTRY_NAME, + errnode->u.b.veneer->u.v.id); + + myh = elf_link_hash_lookup + (&(globals)->root, tmp_name, FALSE, FALSE, TRUE); + + if (myh == NULL) + (*_bfd_error_handler) (_("%B: unable to find VFP11 veneer " + "`%s'"), abfd, tmp_name); + + vma = myh->root.u.def.section->output_section->vma + + myh->root.u.def.section->output_offset + + myh->root.u.def.value; + + errnode->u.b.veneer->vma = vma; + break; + + case VFP11_ERRATUM_ARM_VENEER: + case VFP11_ERRATUM_THUMB_VENEER: + /* Find return location. */ + sprintf (tmp_name, VFP11_ERRATUM_VENEER_ENTRY_NAME "_r", + errnode->u.v.id); + + myh = elf_link_hash_lookup + (&(globals)->root, tmp_name, FALSE, FALSE, TRUE); + + if (myh == NULL) + (*_bfd_error_handler) (_("%B: unable to find VFP11 veneer " + "`%s'"), abfd, tmp_name); + + vma = myh->root.u.def.section->output_section->vma + + myh->root.u.def.section->output_offset + + myh->root.u.def.value; + + errnode->u.v.branch->vma = vma; + break; + + default: + abort (); + } + } + } + + free (tmp_name); +} + + /* Set target relocation values needed during linking. */ void -bfd_elf32_arm_set_target_relocs (struct bfd_link_info *link_info, +bfd_elf32_arm_set_target_relocs (struct bfd *output_bfd, + struct bfd_link_info *link_info, int target1_is_rel, char * target2_type, int fix_v4bx, - int use_blx) + int use_blx, + bfd_arm_vfp11_fix vfp11_fix, + int no_enum_warn, int pic_veneer) { struct elf32_arm_link_hash_table *globals; @@ -2591,6 +3921,10 @@ bfd_elf32_arm_set_target_relocs (struct bfd_link_info *link_info, } globals->fix_v4bx = fix_v4bx; globals->use_blx |= use_blx; + globals->vfp11_fix = vfp11_fix; + globals->pic_veneer = pic_veneer; + + elf32_arm_tdata (output_bfd)->no_enum_size_warning = no_enum_warn; } /* The thumb form of a long branch is a bit finicky, because the offset @@ -2647,6 +3981,35 @@ insert_thumb_branch (insn32 br_insn, int rel_off) return br_insn; } + +/* Store an Arm insn into an output section not processed by + elf32_arm_write_section. */ + +static void +put_arm_insn (struct elf32_arm_link_hash_table *htab, + bfd * output_bfd, bfd_vma val, void * ptr) +{ + if (htab->byteswap_code != bfd_little_endian (output_bfd)) + bfd_putl32 (val, ptr); + else + bfd_putb32 (val, ptr); +} + + +/* Store a 16-bit Thumb insn into an output section not processed by + elf32_arm_write_section. */ + +static void +put_thumb_insn (struct elf32_arm_link_hash_table *htab, + bfd * output_bfd, bfd_vma val, void * ptr) +{ + if (htab->byteswap_code != bfd_little_endian (output_bfd)) + bfd_putl16 (val, ptr); + else + bfd_putb16 (val, ptr); +} + + /* Thumb code calling an ARM function. */ static int @@ -2659,7 +4022,8 @@ elf32_thumb_to_arm_stub (struct bfd_link_info * info, asection * sym_sec, bfd_vma offset, bfd_signed_vma addend, - bfd_vma val) + bfd_vma val, + char **error_message) { asection * s = 0; bfd_vma my_offset; @@ -2668,7 +4032,7 @@ elf32_thumb_to_arm_stub (struct bfd_link_info * info, struct elf_link_hash_entry * myh; struct elf32_arm_link_hash_table * globals; - myh = find_thumb_glue (info, name, input_bfd); + myh = find_thumb_glue (info, name, error_message); if (myh == NULL) return FALSE; @@ -2703,11 +4067,11 @@ elf32_thumb_to_arm_stub (struct bfd_link_info * info, --my_offset; myh->root.u.def.value = my_offset; - bfd_put_16 (output_bfd, (bfd_vma) t2a1_bx_pc_insn, - s->contents + my_offset); + put_thumb_insn (globals, output_bfd, (bfd_vma) t2a1_bx_pc_insn, + s->contents + my_offset); - bfd_put_16 (output_bfd, (bfd_vma) t2a2_noop_insn, - s->contents + my_offset + 2); + put_thumb_insn (globals, output_bfd, (bfd_vma) t2a2_noop_insn, + s->contents + my_offset + 2); ret_offset = /* Address of destination of the stub. */ @@ -2725,9 +4089,9 @@ elf32_thumb_to_arm_stub (struct bfd_link_info * info, /* ARM branches work from the pc of the instruction + 8. */ + 8); - bfd_put_32 (output_bfd, - (bfd_vma) t2a3_b_insn | ((ret_offset >> 2) & 0x00FFFFFF), - s->contents + my_offset + 4); + put_arm_insn (globals, output_bfd, + (bfd_vma) t2a3_b_insn | ((ret_offset >> 2) & 0x00FFFFFF), + s->contents + my_offset + 4); } BFD_ASSERT (my_offset <= globals->thumb_glue_size); @@ -2754,30 +4118,26 @@ elf32_thumb_to_arm_stub (struct bfd_link_info * info, return TRUE; } -/* Arm code calling a Thumb function. */ +/* Populate an Arm to Thumb stub. Returns the stub symbol. */ -static int -elf32_arm_to_thumb_stub (struct bfd_link_info * info, - const char * name, - bfd * input_bfd, - bfd * output_bfd, - asection * input_section, - bfd_byte * hit_data, - asection * sym_sec, - bfd_vma offset, - bfd_signed_vma addend, - bfd_vma val) +static struct elf_link_hash_entry * +elf32_arm_create_thumb_stub (struct bfd_link_info * info, + const char * name, + bfd * input_bfd, + bfd * output_bfd, + asection * sym_sec, + bfd_vma val, + asection *s, + char **error_message) { - unsigned long int tmp; bfd_vma my_offset; - asection * s; long int ret_offset; struct elf_link_hash_entry * myh; struct elf32_arm_link_hash_table * globals; - myh = find_arm_glue (info, name, input_bfd); + myh = find_arm_glue (info, name, error_message); if (myh == NULL) - return FALSE; + return NULL; globals = elf32_arm_hash_table (info); @@ -2785,11 +4145,6 @@ elf32_arm_to_thumb_stub (struct bfd_link_info * info, BFD_ASSERT (globals->bfd_of_glue_owner != NULL); my_offset = myh->root.u.def.value; - s = bfd_get_section_by_name (globals->bfd_of_glue_owner, - ARM2THUMB_GLUE_SECTION_NAME); - BFD_ASSERT (s != NULL); - BFD_ASSERT (s->contents != NULL); - BFD_ASSERT (s->output_section != NULL); if ((my_offset & 0x01) == 0x01) { @@ -2806,18 +4161,19 @@ elf32_arm_to_thumb_stub (struct bfd_link_info * info, --my_offset; myh->root.u.def.value = my_offset; - if ((info->shared || globals->root.is_relocatable_executable)) + if (info->shared || globals->root.is_relocatable_executable + || globals->pic_veneer) { /* For relocatable objects we can't use absolute addresses, so construct the address from a relative offset. */ /* TODO: If the offset is small it's probably worth constructing the address with adds. */ - bfd_put_32 (output_bfd, (bfd_vma) a2t1p_ldr_insn, - s->contents + my_offset); - bfd_put_32 (output_bfd, (bfd_vma) a2t2p_add_pc_insn, - s->contents + my_offset + 4); - bfd_put_32 (output_bfd, (bfd_vma) a2t3p_bx_r12_insn, - s->contents + my_offset + 8); + put_arm_insn (globals, output_bfd, (bfd_vma) a2t1p_ldr_insn, + s->contents + my_offset); + put_arm_insn (globals, output_bfd, (bfd_vma) a2t2p_add_pc_insn, + s->contents + my_offset + 4); + put_arm_insn (globals, output_bfd, (bfd_vma) a2t3p_bx_r12_insn, + s->contents + my_offset + 8); /* Adjust the offset by 4 for the position of the add, and 8 for the pipeline offset. */ ret_offset = (val - (s->output_offset @@ -2827,13 +4183,22 @@ elf32_arm_to_thumb_stub (struct bfd_link_info * info, bfd_put_32 (output_bfd, ret_offset, s->contents + my_offset + 12); } + else if (globals->use_blx) + { + put_arm_insn (globals, output_bfd, (bfd_vma) a2t1v5_ldr_insn, + s->contents + my_offset); + + /* It's a thumb address. Add the low order bit. */ + bfd_put_32 (output_bfd, val | a2t2v5_func_addr_insn, + s->contents + my_offset + 4); + } else { - bfd_put_32 (output_bfd, (bfd_vma) a2t1_ldr_insn, - s->contents + my_offset); + put_arm_insn (globals, output_bfd, (bfd_vma) a2t1_ldr_insn, + s->contents + my_offset); - bfd_put_32 (output_bfd, (bfd_vma) a2t2_bx_r12_insn, - s->contents + my_offset + 4); + put_arm_insn (globals, output_bfd, (bfd_vma) a2t2_bx_r12_insn, + s->contents + my_offset + 4); /* It's a thumb address. Add the low order bit. */ bfd_put_32 (output_bfd, val | a2t3_func_addr_insn, @@ -2843,6 +4208,48 @@ elf32_arm_to_thumb_stub (struct bfd_link_info * info, BFD_ASSERT (my_offset <= globals->arm_glue_size); + return myh; +} + +/* Arm code calling a Thumb function. */ + +static int +elf32_arm_to_thumb_stub (struct bfd_link_info * info, + const char * name, + bfd * input_bfd, + bfd * output_bfd, + asection * input_section, + bfd_byte * hit_data, + asection * sym_sec, + bfd_vma offset, + bfd_signed_vma addend, + bfd_vma val, + char **error_message) +{ + unsigned long int tmp; + bfd_vma my_offset; + asection * s; + long int ret_offset; + struct elf_link_hash_entry * myh; + struct elf32_arm_link_hash_table * globals; + + globals = elf32_arm_hash_table (info); + + BFD_ASSERT (globals != NULL); + BFD_ASSERT (globals->bfd_of_glue_owner != NULL); + + s = bfd_get_section_by_name (globals->bfd_of_glue_owner, + ARM2THUMB_GLUE_SECTION_NAME); + BFD_ASSERT (s != NULL); + BFD_ASSERT (s->contents != NULL); + BFD_ASSERT (s->output_section != NULL); + + myh = elf32_arm_create_thumb_stub (info, name, input_bfd, output_bfd, + sym_sec, val, s, error_message); + if (!myh) + return FALSE; + + my_offset = myh->root.u.def.value; tmp = bfd_get_32 (input_bfd, hit_data); tmp = tmp & 0xFF000000; @@ -2862,6 +4269,70 @@ elf32_arm_to_thumb_stub (struct bfd_link_info * info, return TRUE; } +/* Populate Arm stub for an exported Thumb function. */ + +static bfd_boolean +elf32_arm_to_thumb_export_stub (struct elf_link_hash_entry *h, void * inf) +{ + struct bfd_link_info * info = (struct bfd_link_info *) inf; + asection * s; + struct elf_link_hash_entry * myh; + struct elf32_arm_link_hash_entry *eh; + struct elf32_arm_link_hash_table * globals; + asection *sec; + bfd_vma val; + char *error_message; + + eh = elf32_arm_hash_entry(h); + /* Allocate stubs for exported Thumb functions on v4t. */ + if (eh->export_glue == NULL) + return TRUE; + + globals = elf32_arm_hash_table (info); + + BFD_ASSERT (globals != NULL); + BFD_ASSERT (globals->bfd_of_glue_owner != NULL); + + s = bfd_get_section_by_name (globals->bfd_of_glue_owner, + ARM2THUMB_GLUE_SECTION_NAME); + BFD_ASSERT (s != NULL); + BFD_ASSERT (s->contents != NULL); + BFD_ASSERT (s->output_section != NULL); + + sec = eh->export_glue->root.u.def.section; + + BFD_ASSERT (sec->output_section != NULL); + + val = eh->export_glue->root.u.def.value + sec->output_offset + + sec->output_section->vma; + myh = elf32_arm_create_thumb_stub (info, h->root.root.string, + h->root.u.def.section->owner, + globals->obfd, sec, val, s, + &error_message); + BFD_ASSERT (myh); + return TRUE; +} + +/* Generate Arm stubs for exported Thumb symbols. */ +static void +elf32_arm_begin_write_processing (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *link_info) +{ + struct elf32_arm_link_hash_table * globals; + + if (!link_info) + return; + + globals = elf32_arm_hash_table (link_info); + /* If blx is available then exported Thumb symbols are OK and there is + nothing to do. */ + if (globals->use_blx) + return; + + elf_link_hash_traverse (&globals->root, elf32_arm_to_thumb_export_stub, + link_info); +} + /* Some relocations map to different relocations depending on the target. Return the real relocation. */ static int @@ -2927,6 +4398,83 @@ elf32_arm_abs12_reloc (bfd *abfd, void *data, bfd_vma value) return bfd_reloc_ok; } +/* For a given value of n, calculate the value of G_n as required to + deal with group relocations. We return it in the form of an + encoded constant-and-rotation, together with the final residual. If n is + specified as less than zero, then final_residual is filled with the + input value and no further action is performed. */ + +static bfd_vma +calculate_group_reloc_mask (bfd_vma value, int n, bfd_vma *final_residual) +{ + int current_n; + bfd_vma g_n; + bfd_vma encoded_g_n = 0; + bfd_vma residual = value; /* Also known as Y_n. */ + + for (current_n = 0; current_n <= n; current_n++) + { + int shift; + + /* Calculate which part of the value to mask. */ + if (residual == 0) + shift = 0; + else + { + int msb; + + /* Determine the most significant bit in the residual and + align the resulting value to a 2-bit boundary. */ + for (msb = 30; msb >= 0; msb -= 2) + if (residual & (3 << msb)) + break; + + /* The desired shift is now (msb - 6), or zero, whichever + is the greater. */ + shift = msb - 6; + if (shift < 0) + shift = 0; + } + + /* Calculate g_n in 32-bit as well as encoded constant+rotation form. */ + g_n = residual & (0xff << shift); + encoded_g_n = (g_n >> shift) + | ((g_n <= 0xff ? 0 : (32 - shift) / 2) << 8); + + /* Calculate the residual for the next time around. */ + residual &= ~g_n; + } + + *final_residual = residual; + + return encoded_g_n; +} + +/* Given an ARM instruction, determine whether it is an ADD or a SUB. + Returns 1 if it is an ADD, -1 if it is a SUB, and 0 otherwise. */ +static int +identify_add_or_sub(bfd_vma insn) +{ + int opcode = insn & 0x1e00000; + + if (opcode == 1 << 23) /* ADD */ + return 1; + + if (opcode == 1 << 22) /* SUB */ + return -1; + + return 0; +} + +/* Determine if we're dealing with a Thumb-2 object. */ + +static int using_thumb2 (struct elf32_arm_link_hash_table *globals) +{ + int arch = bfd_elf_get_obj_attr_int (globals->obfd, OBJ_ATTR_PROC, + Tag_CPU_arch); + return arch == TAG_CPU_ARCH_V6T2 || arch >= TAG_CPU_ARCH_V7; +} + /* Perform a relocation as part of a final link. */ static bfd_reloc_status_type @@ -2942,7 +4490,8 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, const char * sym_name, int sym_flags, struct elf_link_hash_entry * h, - bfd_boolean * unresolved_reloc_p) + bfd_boolean * unresolved_reloc_p, + char **error_message) { unsigned long r_type = howto->type; unsigned long r_symndx; @@ -3019,23 +4568,20 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, case R_ARM_PC24: case R_ARM_ABS32: + case R_ARM_ABS32_NOI: case R_ARM_REL32: + case R_ARM_REL32_NOI: case R_ARM_CALL: case R_ARM_JUMP24: case R_ARM_XPC25: case R_ARM_PREL31: case R_ARM_PLT32: - /* r_symndx will be zero only for relocs against symbols - from removed linkonce sections, or sections discarded by - a linker script. */ - if (r_symndx == 0) - return bfd_reloc_ok; - /* Handle relocations which should use the PLT entry. ABS32/REL32 will use the symbol's value, which may point to a PLT entry, but we don't need to handle that here. If we created a PLT entry, all branches in this object should go to it. */ - if ((r_type != R_ARM_ABS32 && r_type != R_ARM_REL32) + if ((r_type != R_ARM_ABS32 && r_type != R_ARM_REL32 + && r_type != R_ARM_ABS32_NOI && r_type != R_ARM_REL32_NOI) && h != NULL && splt != NULL && h->plt.offset != (bfd_vma) -1) @@ -3059,7 +4605,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, run time. */ if ((info->shared || globals->root.is_relocatable_executable) && (input_section->flags & SEC_ALLOC) - && (r_type != R_ARM_REL32 + && ((r_type != R_ARM_REL32 && r_type != R_ARM_REL32_NOI) || !SYMBOL_CALLS_LOCAL (info, h)) && (h == NULL || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT @@ -3124,6 +4670,8 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, value |= 1; if (globals->symbian_p) { + asection *osec; + /* On Symbian OS, the data segment and text segement can be relocated independently. Therefore, we must indicate the segment to which this @@ -3131,11 +4679,27 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, use any symbol in the right segment; we just use the section symbol as it is convenient. (We cannot use the symbol given by "h" directly as it - will not appear in the dynamic symbol table.) */ + will not appear in the dynamic symbol table.) + + Note that the dynamic linker ignores the section + symbol value, so we don't subtract osec->vma + from the emitted reloc addend. */ if (sym_sec) - symbol = elf_section_data (sym_sec->output_section)->dynindx; + osec = sym_sec->output_section; else - symbol = elf_section_data (input_section->output_section)->dynindx; + osec = input_section->output_section; + symbol = elf_section_data (osec)->dynindx; + if (symbol == 0) + { + struct elf_link_hash_table *htab = elf_hash_table (info); + + if ((osec->flags & SEC_READONLY) == 0 + && htab->data_index_section != NULL) + osec = htab->data_index_section; + else + osec = htab->text_index_section; + symbol = elf_section_data (osec)->dynindx; + } BFD_ASSERT (symbol != 0); } else @@ -3190,11 +4754,14 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, /* Check for Arm calling Thumb function. */ if (sym_flags == STT_ARM_TFUNC) { - elf32_arm_to_thumb_stub (info, sym_name, input_bfd, - output_bfd, input_section, - hit_data, sym_sec, rel->r_offset, - signed_addend, value); - return bfd_reloc_ok; + if (elf32_arm_to_thumb_stub (info, sym_name, input_bfd, + output_bfd, input_section, + hit_data, sym_sec, rel->r_offset, + signed_addend, value, + error_message)) + return bfd_reloc_ok; + else + return bfd_reloc_dangerous; } } @@ -3229,40 +4796,43 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, signed_addend = value; signed_addend >>= howto->rightshift; - /* It is not an error for an undefined weak reference to be - out of range. Any program that branches to such a symbol - is going to crash anyway, so there is no point worrying - about getting the destination exactly right. */ - if (! h || h->root.type != bfd_link_hash_undefweak) + /* A branch to an undefined weak symbol is turned into a jump to + the next instruction. */ + if (h && h->root.type == bfd_link_hash_undefweak) + { + value = (bfd_get_32 (input_bfd, hit_data) & 0xf0000000) + | 0x0affffff; + } + else { /* Perform a signed range check. */ if ( signed_addend > ((bfd_signed_vma) (howto->dst_mask >> 1)) || signed_addend < - ((bfd_signed_vma) ((howto->dst_mask + 1) >> 1))) return bfd_reloc_overflow; - } - addend = (value & 2); + addend = (value & 2); - value = (signed_addend & howto->dst_mask) - | (bfd_get_32 (input_bfd, hit_data) & (~ howto->dst_mask)); + value = (signed_addend & howto->dst_mask) + | (bfd_get_32 (input_bfd, hit_data) & (~ howto->dst_mask)); - /* Set the H bit in the BLX instruction. */ - if (sym_flags == STT_ARM_TFUNC) - { - if (addend) - value |= (1 << 24); - else - value &= ~(bfd_vma)(1 << 24); - } - if (r_type == R_ARM_CALL) - { - /* Select the correct instruction (BL or BLX). */ + /* Set the H bit in the BLX instruction. */ if (sym_flags == STT_ARM_TFUNC) - value |= (1 << 28); - else { - value &= ~(bfd_vma)(1 << 28); - value |= (1 << 24); + if (addend) + value |= (1 << 24); + else + value &= ~(bfd_vma)(1 << 24); + } + if (r_type == R_ARM_CALL) + { + /* Select the correct instruction (BL or BLX). */ + if (sym_flags == STT_ARM_TFUNC) + value |= (1 << 28); + else + { + value &= ~(bfd_vma)(1 << 28); + value |= (1 << 24); + } } } break; @@ -3273,6 +4843,10 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, value |= 1; break; + case R_ARM_ABS32_NOI: + value += addend; + break; + case R_ARM_REL32: value += addend; if (sym_flags == STT_ARM_TFUNC) @@ -3281,6 +4855,12 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, + input_section->output_offset + rel->r_offset); break; + case R_ARM_REL32_NOI: + value += addend; + value -= (input_section->output_section->vma + + input_section->output_offset + rel->r_offset); + break; + case R_ARM_PREL31: value -= (input_section->output_section->vma + input_section->output_offset + rel->r_offset); @@ -3338,27 +4918,122 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, bfd_put_16 (input_bfd, value, hit_data); return bfd_reloc_ok; + case R_ARM_THM_ALU_PREL_11_0: + /* Corresponds to: addw.w reg, pc, #offset (and similarly for subw). */ + { + bfd_vma insn; + bfd_signed_vma relocation; + + insn = (bfd_get_16 (input_bfd, hit_data) << 16) + | bfd_get_16 (input_bfd, hit_data + 2); + + if (globals->use_rel) + { + signed_addend = (insn & 0xff) | ((insn & 0x7000) >> 4) + | ((insn & (1 << 26)) >> 15); + if (insn & 0xf00000) + signed_addend = -signed_addend; + } + + relocation = value + signed_addend; + relocation -= (input_section->output_section->vma + + input_section->output_offset + + rel->r_offset); + + value = abs (relocation); + + if (value >= 0x1000) + return bfd_reloc_overflow; + + insn = (insn & 0xfb0f8f00) | (value & 0xff) + | ((value & 0x700) << 4) + | ((value & 0x800) << 15); + if (relocation < 0) + insn |= 0xa00000; + + bfd_put_16 (input_bfd, insn >> 16, hit_data); + bfd_put_16 (input_bfd, insn & 0xffff, hit_data + 2); + + return bfd_reloc_ok; + } + + case R_ARM_THM_PC12: + /* Corresponds to: ldr.w reg, [pc, #offset]. */ + { + bfd_vma insn; + bfd_signed_vma relocation; + + insn = (bfd_get_16 (input_bfd, hit_data) << 16) + | bfd_get_16 (input_bfd, hit_data + 2); + + if (globals->use_rel) + { + signed_addend = insn & 0xfff; + if (!(insn & (1 << 23))) + signed_addend = -signed_addend; + } + + relocation = value + signed_addend; + relocation -= (input_section->output_section->vma + + input_section->output_offset + + rel->r_offset); + + value = abs (relocation); + + if (value >= 0x1000) + return bfd_reloc_overflow; + + insn = (insn & 0xff7ff000) | value; + if (relocation >= 0) + insn |= (1 << 23); + + bfd_put_16 (input_bfd, insn >> 16, hit_data); + bfd_put_16 (input_bfd, insn & 0xffff, hit_data + 2); + + return bfd_reloc_ok; + } + case R_ARM_THM_XPC22: case R_ARM_THM_CALL: /* Thumb BL (branch long instruction). */ { bfd_vma relocation; + bfd_vma reloc_sign; bfd_boolean overflow = FALSE; bfd_vma upper_insn = bfd_get_16 (input_bfd, hit_data); bfd_vma lower_insn = bfd_get_16 (input_bfd, hit_data + 2); - bfd_signed_vma reloc_signed_max = ((1 << (howto->bitsize - 1)) - 1) >> howto->rightshift; - bfd_signed_vma reloc_signed_min = ~ reloc_signed_max; + bfd_signed_vma reloc_signed_max; + bfd_signed_vma reloc_signed_min; bfd_vma check; bfd_signed_vma signed_check; + int bitsize; + int thumb2 = using_thumb2 (globals); - /* Need to refetch the addend and squish the two 11 bit pieces - together. */ + /* A branch to an undefined weak symbol is turned into a jump to + the next instruction. */ + if (h && h->root.type == bfd_link_hash_undefweak) + { + bfd_put_16 (input_bfd, 0xe000, hit_data); + bfd_put_16 (input_bfd, 0xbf00, hit_data + 2); + return bfd_reloc_ok; + } + + /* Fetch the addend. We use the Thumb-2 encoding (backwards compatible + with Thumb-1) involving the J1 and J2 bits. */ if (globals->use_rel) { - bfd_vma upper = upper_insn & 0x7ff; - bfd_vma lower = lower_insn & 0x7ff; - upper = (upper ^ 0x400) - 0x400; /* Sign extend. */ - addend = (upper << 12) | (lower << 1); + bfd_vma s = (upper_insn & (1 << 10)) >> 10; + bfd_vma upper = upper_insn & 0x3ff; + bfd_vma lower = lower_insn & 0x7ff; + bfd_vma j1 = (lower_insn & (1 << 13)) >> 13; + bfd_vma j2 = (lower_insn & (1 << 11)) >> 11; + bfd_vma i1 = j1 ^ s ? 0 : 1; + bfd_vma i2 = j2 ^ s ? 0 : 1; + + addend = (i1 << 23) | (i2 << 22) | (upper << 12) | (lower << 1); + /* Sign extend. */ + addend = (addend | ((s ? 0 : 1) << 24)) - (1 << 24); + signed_addend = addend; } @@ -3390,7 +5065,8 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, } else if (elf32_thumb_to_arm_stub (info, sym_name, input_bfd, output_bfd, input_section, - hit_data, sym_sec, rel->r_offset, signed_addend, value)) + hit_data, sym_sec, rel->r_offset, signed_addend, value, + error_message)) return bfd_reloc_ok; else return bfd_reloc_dangerous; @@ -3435,6 +5111,15 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, else signed_check = check | ~((bfd_vma) -1 >> howto->rightshift); + /* Calculate the permissable maximum and minimum values for + this relocation according to whether we're relocating for + Thumb-2 or not. */ + bitsize = howto->bitsize; + if (!thumb2) + bitsize -= 2; + reloc_signed_max = ((1 << (bitsize - 1)) - 1) >> howto->rightshift; + reloc_signed_min = ~reloc_signed_max; + /* Assumes two's complement. */ if (signed_check > reloc_signed_max || signed_check < reloc_signed_min) overflow = TRUE; @@ -3446,9 +5131,17 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, 1 of the base address. */ relocation = (relocation + 2) & ~ 3; - /* Put RELOCATION back into the insn. */ - upper_insn = (upper_insn & ~(bfd_vma) 0x7ff) | ((relocation >> 12) & 0x7ff); - lower_insn = (lower_insn & ~(bfd_vma) 0x7ff) | ((relocation >> 1) & 0x7ff); + /* Put RELOCATION back into the insn. Assumes two's complement. + We use the Thumb-2 encoding, which is safe even if dealing with + a Thumb-1 instruction by virtue of our overflow check above. */ + reloc_sign = (signed_check < 0) ? 1 : 0; + upper_insn = (upper_insn & ~(bfd_vma) 0x7ff) + | ((relocation >> 12) & 0x3ff) + | (reloc_sign << 10); + lower_insn = (lower_insn & ~(bfd_vma) 0x2fff) + | (((!((relocation >> 23) & 1)) ^ reloc_sign) << 13) + | (((!((relocation >> 22) & 1)) ^ reloc_sign) << 11) + | ((relocation >> 1) & 0x7ff); /* Put the relocated value back in the object file: */ bfd_put_16 (input_bfd, upper_insn, hit_data); @@ -3538,9 +5231,8 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, bfd_boolean overflow = FALSE; bfd_vma upper_insn = bfd_get_16 (input_bfd, hit_data); bfd_vma lower_insn = bfd_get_16 (input_bfd, hit_data + 2); - bfd_signed_vma reloc_signed_max = ((1 << (howto->bitsize - 1)) - 1) >> howto->rightshift; - bfd_signed_vma reloc_signed_min = ~ reloc_signed_max; - bfd_vma check; + bfd_signed_vma reloc_signed_max = 0xffffe; + bfd_signed_vma reloc_signed_min = -0x100000; bfd_signed_vma signed_check; /* Need to refetch the addend, reconstruct the top three bits, @@ -3548,14 +5240,14 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, if (globals->use_rel) { bfd_vma S = (upper_insn & 0x0400) >> 10; - bfd_vma upper = (upper_insn & 0x001f); + bfd_vma upper = (upper_insn & 0x003f); bfd_vma J1 = (lower_insn & 0x2000) >> 13; bfd_vma J2 = (lower_insn & 0x0800) >> 11; bfd_vma lower = (lower_insn & 0x07ff); - upper |= J2 << 6; - upper |= J1 << 7; - upper |= ~S << 8; + upper |= J1 << 6; + upper |= J2 << 7; + upper |= (!S) << 8; upper -= 0x0100; /* Sign extend. */ addend = (upper << 12) | (lower << 1); @@ -3569,17 +5261,8 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, relocation -= (input_section->output_section->vma + input_section->output_offset + rel->r_offset); + signed_check = (bfd_signed_vma) relocation; - check = relocation >> howto->rightshift; - - /* If this is a signed value, the rightshift just dropped - leading 1 bits (assuming twos complement). */ - if ((bfd_signed_vma) relocation >= 0) - signed_check = check; - else - signed_check = check | ~((bfd_vma) -1 >> howto->rightshift); - - /* Assumes two's complement. */ if (signed_check > reloc_signed_max || signed_check < reloc_signed_min) overflow = TRUE; @@ -3591,7 +5274,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, bfd_vma hi = (relocation & 0x0003f000) >> 12; bfd_vma lo = (relocation & 0x00000ffe) >> 1; - upper_insn = (upper_insn & 0xfb30) | (S << 10) | hi; + upper_insn = (upper_insn & 0xfbc0) | (S << 10) | hi; lower_insn = (lower_insn & 0xd000) | (J1 << 13) | (J2 << 11) | lo; } @@ -4080,199 +5763,499 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, } return bfd_reloc_ok; + case R_ARM_MOVW_ABS_NC: + case R_ARM_MOVT_ABS: + case R_ARM_MOVW_PREL_NC: + case R_ARM_MOVT_PREL: + /* Until we properly support segment-base-relative addressing then + we assume the segment base to be zero, as for the group relocations. + Thus R_ARM_MOVW_BREL_NC has the same semantics as R_ARM_MOVW_ABS_NC + and R_ARM_MOVT_BREL has the same semantics as R_ARM_MOVT_ABS. */ + case R_ARM_MOVW_BREL_NC: + case R_ARM_MOVW_BREL: + case R_ARM_MOVT_BREL: + { + bfd_vma insn = bfd_get_32 (input_bfd, hit_data); + + if (globals->use_rel) + { + addend = ((insn >> 4) & 0xf000) | (insn & 0xfff); + signed_addend = (addend ^ 0x10000) - 0x10000; + } + + value += signed_addend; + + if (r_type == R_ARM_MOVW_PREL_NC || r_type == R_ARM_MOVT_PREL) + value -= (input_section->output_section->vma + + input_section->output_offset + rel->r_offset); + + if (r_type == R_ARM_MOVW_BREL && value >= 0x10000) + return bfd_reloc_overflow; + + if (sym_flags == STT_ARM_TFUNC) + value |= 1; + + if (r_type == R_ARM_MOVT_ABS || r_type == R_ARM_MOVT_PREL + || r_type == R_ARM_MOVT_BREL) + value >>= 16; + + insn &= 0xfff0f000; + insn |= value & 0xfff; + insn |= (value & 0xf000) << 4; + bfd_put_32 (input_bfd, insn, hit_data); + } + return bfd_reloc_ok; + + case R_ARM_THM_MOVW_ABS_NC: + case R_ARM_THM_MOVT_ABS: + case R_ARM_THM_MOVW_PREL_NC: + case R_ARM_THM_MOVT_PREL: + /* Until we properly support segment-base-relative addressing then + we assume the segment base to be zero, as for the above relocations. + Thus R_ARM_THM_MOVW_BREL_NC has the same semantics as + R_ARM_THM_MOVW_ABS_NC and R_ARM_THM_MOVT_BREL has the same semantics + as R_ARM_THM_MOVT_ABS. */ + case R_ARM_THM_MOVW_BREL_NC: + case R_ARM_THM_MOVW_BREL: + case R_ARM_THM_MOVT_BREL: + { + bfd_vma insn; + + insn = bfd_get_16 (input_bfd, hit_data) << 16; + insn |= bfd_get_16 (input_bfd, hit_data + 2); + + if (globals->use_rel) + { + addend = ((insn >> 4) & 0xf000) + | ((insn >> 15) & 0x0800) + | ((insn >> 4) & 0x0700) + | (insn & 0x00ff); + signed_addend = (addend ^ 0x10000) - 0x10000; + } + + value += signed_addend; + + if (r_type == R_ARM_THM_MOVW_PREL_NC || r_type == R_ARM_THM_MOVT_PREL) + value -= (input_section->output_section->vma + + input_section->output_offset + rel->r_offset); + + if (r_type == R_ARM_THM_MOVW_BREL && value >= 0x10000) + return bfd_reloc_overflow; + + if (sym_flags == STT_ARM_TFUNC) + value |= 1; + + if (r_type == R_ARM_THM_MOVT_ABS || r_type == R_ARM_THM_MOVT_PREL + || r_type == R_ARM_THM_MOVT_BREL) + value >>= 16; + + insn &= 0xfbf08f00; + insn |= (value & 0xf000) << 4; + insn |= (value & 0x0800) << 15; + insn |= (value & 0x0700) << 4; + insn |= (value & 0x00ff); + + bfd_put_16 (input_bfd, insn >> 16, hit_data); + bfd_put_16 (input_bfd, insn & 0xffff, hit_data + 2); + } + return bfd_reloc_ok; + + case R_ARM_ALU_PC_G0_NC: + case R_ARM_ALU_PC_G1_NC: + case R_ARM_ALU_PC_G0: + case R_ARM_ALU_PC_G1: + case R_ARM_ALU_PC_G2: + case R_ARM_ALU_SB_G0_NC: + case R_ARM_ALU_SB_G1_NC: + case R_ARM_ALU_SB_G0: + case R_ARM_ALU_SB_G1: + case R_ARM_ALU_SB_G2: + { + bfd_vma insn = bfd_get_32 (input_bfd, hit_data); + bfd_vma pc = input_section->output_section->vma + + input_section->output_offset + rel->r_offset; + /* sb should be the origin of the *segment* containing the symbol. + It is not clear how to obtain this OS-dependent value, so we + make an arbitrary choice of zero. */ + bfd_vma sb = 0; + bfd_vma residual; + bfd_vma g_n; + bfd_signed_vma signed_value; + int group = 0; + + /* Determine which group of bits to select. */ + switch (r_type) + { + case R_ARM_ALU_PC_G0_NC: + case R_ARM_ALU_PC_G0: + case R_ARM_ALU_SB_G0_NC: + case R_ARM_ALU_SB_G0: + group = 0; + break; + + case R_ARM_ALU_PC_G1_NC: + case R_ARM_ALU_PC_G1: + case R_ARM_ALU_SB_G1_NC: + case R_ARM_ALU_SB_G1: + group = 1; + break; + + case R_ARM_ALU_PC_G2: + case R_ARM_ALU_SB_G2: + group = 2; + break; + + default: + abort(); + } + + /* If REL, extract the addend from the insn. If RELA, it will + have already been fetched for us. */ + if (globals->use_rel) + { + int negative; + bfd_vma constant = insn & 0xff; + bfd_vma rotation = (insn & 0xf00) >> 8; + + if (rotation == 0) + signed_addend = constant; + else + { + /* Compensate for the fact that in the instruction, the + rotation is stored in multiples of 2 bits. */ + rotation *= 2; + + /* Rotate "constant" right by "rotation" bits. */ + signed_addend = (constant >> rotation) | + (constant << (8 * sizeof (bfd_vma) - rotation)); + } + + /* Determine if the instruction is an ADD or a SUB. + (For REL, this determines the sign of the addend.) */ + negative = identify_add_or_sub (insn); + if (negative == 0) + { + (*_bfd_error_handler) + (_("%B(%A+0x%lx): Only ADD or SUB instructions are allowed for ALU group relocations"), + input_bfd, input_section, + (long) rel->r_offset, howto->name); + return bfd_reloc_overflow; + } + + signed_addend *= negative; + } + + /* Compute the value (X) to go in the place. */ + if (r_type == R_ARM_ALU_PC_G0_NC + || r_type == R_ARM_ALU_PC_G1_NC + || r_type == R_ARM_ALU_PC_G0 + || r_type == R_ARM_ALU_PC_G1 + || r_type == R_ARM_ALU_PC_G2) + /* PC relative. */ + signed_value = value - pc + signed_addend; + else + /* Section base relative. */ + signed_value = value - sb + signed_addend; + + /* If the target symbol is a Thumb function, then set the + Thumb bit in the address. */ + if (sym_flags == STT_ARM_TFUNC) + signed_value |= 1; + + /* Calculate the value of the relevant G_n, in encoded + constant-with-rotation format. */ + g_n = calculate_group_reloc_mask (abs (signed_value), group, + &residual); + + /* Check for overflow if required. */ + if ((r_type == R_ARM_ALU_PC_G0 + || r_type == R_ARM_ALU_PC_G1 + || r_type == R_ARM_ALU_PC_G2 + || r_type == R_ARM_ALU_SB_G0 + || r_type == R_ARM_ALU_SB_G1 + || r_type == R_ARM_ALU_SB_G2) && residual != 0) + { + (*_bfd_error_handler) + (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), + input_bfd, input_section, + (long) rel->r_offset, abs (signed_value), howto->name); + return bfd_reloc_overflow; + } + + /* Mask out the value and the ADD/SUB part of the opcode; take care + not to destroy the S bit. */ + insn &= 0xff1ff000; + + /* Set the opcode according to whether the value to go in the + place is negative. */ + if (signed_value < 0) + insn |= 1 << 22; + else + insn |= 1 << 23; + + /* Encode the offset. */ + insn |= g_n; + + bfd_put_32 (input_bfd, insn, hit_data); + } + return bfd_reloc_ok; + + case R_ARM_LDR_PC_G0: + case R_ARM_LDR_PC_G1: + case R_ARM_LDR_PC_G2: + case R_ARM_LDR_SB_G0: + case R_ARM_LDR_SB_G1: + case R_ARM_LDR_SB_G2: + { + bfd_vma insn = bfd_get_32 (input_bfd, hit_data); + bfd_vma pc = input_section->output_section->vma + + input_section->output_offset + rel->r_offset; + bfd_vma sb = 0; /* See note above. */ + bfd_vma residual; + bfd_signed_vma signed_value; + int group = 0; + + /* Determine which groups of bits to calculate. */ + switch (r_type) + { + case R_ARM_LDR_PC_G0: + case R_ARM_LDR_SB_G0: + group = 0; + break; + + case R_ARM_LDR_PC_G1: + case R_ARM_LDR_SB_G1: + group = 1; + break; + + case R_ARM_LDR_PC_G2: + case R_ARM_LDR_SB_G2: + group = 2; + break; + + default: + abort(); + } + + /* If REL, extract the addend from the insn. If RELA, it will + have already been fetched for us. */ + if (globals->use_rel) + { + int negative = (insn & (1 << 23)) ? 1 : -1; + signed_addend = negative * (insn & 0xfff); + } + + /* Compute the value (X) to go in the place. */ + if (r_type == R_ARM_LDR_PC_G0 + || r_type == R_ARM_LDR_PC_G1 + || r_type == R_ARM_LDR_PC_G2) + /* PC relative. */ + signed_value = value - pc + signed_addend; + else + /* Section base relative. */ + signed_value = value - sb + signed_addend; + + /* Calculate the value of the relevant G_{n-1} to obtain + the residual at that stage. */ + calculate_group_reloc_mask (abs (signed_value), group - 1, &residual); + + /* Check for overflow. */ + if (residual >= 0x1000) + { + (*_bfd_error_handler) + (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), + input_bfd, input_section, + (long) rel->r_offset, abs (signed_value), howto->name); + return bfd_reloc_overflow; + } + + /* Mask out the value and U bit. */ + insn &= 0xff7ff000; + + /* Set the U bit if the value to go in the place is non-negative. */ + if (signed_value >= 0) + insn |= 1 << 23; + + /* Encode the offset. */ + insn |= residual; + + bfd_put_32 (input_bfd, insn, hit_data); + } + return bfd_reloc_ok; + + case R_ARM_LDRS_PC_G0: + case R_ARM_LDRS_PC_G1: + case R_ARM_LDRS_PC_G2: + case R_ARM_LDRS_SB_G0: + case R_ARM_LDRS_SB_G1: + case R_ARM_LDRS_SB_G2: + { + bfd_vma insn = bfd_get_32 (input_bfd, hit_data); + bfd_vma pc = input_section->output_section->vma + + input_section->output_offset + rel->r_offset; + bfd_vma sb = 0; /* See note above. */ + bfd_vma residual; + bfd_signed_vma signed_value; + int group = 0; + + /* Determine which groups of bits to calculate. */ + switch (r_type) + { + case R_ARM_LDRS_PC_G0: + case R_ARM_LDRS_SB_G0: + group = 0; + break; + + case R_ARM_LDRS_PC_G1: + case R_ARM_LDRS_SB_G1: + group = 1; + break; + + case R_ARM_LDRS_PC_G2: + case R_ARM_LDRS_SB_G2: + group = 2; + break; + + default: + abort(); + } + + /* If REL, extract the addend from the insn. If RELA, it will + have already been fetched for us. */ + if (globals->use_rel) + { + int negative = (insn & (1 << 23)) ? 1 : -1; + signed_addend = negative * (((insn & 0xf00) >> 4) + (insn & 0xf)); + } + + /* Compute the value (X) to go in the place. */ + if (r_type == R_ARM_LDRS_PC_G0 + || r_type == R_ARM_LDRS_PC_G1 + || r_type == R_ARM_LDRS_PC_G2) + /* PC relative. */ + signed_value = value - pc + signed_addend; + else + /* Section base relative. */ + signed_value = value - sb + signed_addend; + + /* Calculate the value of the relevant G_{n-1} to obtain + the residual at that stage. */ + calculate_group_reloc_mask (abs (signed_value), group - 1, &residual); + + /* Check for overflow. */ + if (residual >= 0x100) + { + (*_bfd_error_handler) + (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), + input_bfd, input_section, + (long) rel->r_offset, abs (signed_value), howto->name); + return bfd_reloc_overflow; + } + + /* Mask out the value and U bit. */ + insn &= 0xff7ff0f0; + + /* Set the U bit if the value to go in the place is non-negative. */ + if (signed_value >= 0) + insn |= 1 << 23; + + /* Encode the offset. */ + insn |= ((residual & 0xf0) << 4) | (residual & 0xf); + + bfd_put_32 (input_bfd, insn, hit_data); + } + return bfd_reloc_ok; + + case R_ARM_LDC_PC_G0: + case R_ARM_LDC_PC_G1: + case R_ARM_LDC_PC_G2: + case R_ARM_LDC_SB_G0: + case R_ARM_LDC_SB_G1: + case R_ARM_LDC_SB_G2: + { + bfd_vma insn = bfd_get_32 (input_bfd, hit_data); + bfd_vma pc = input_section->output_section->vma + + input_section->output_offset + rel->r_offset; + bfd_vma sb = 0; /* See note above. */ + bfd_vma residual; + bfd_signed_vma signed_value; + int group = 0; + + /* Determine which groups of bits to calculate. */ + switch (r_type) + { + case R_ARM_LDC_PC_G0: + case R_ARM_LDC_SB_G0: + group = 0; + break; + + case R_ARM_LDC_PC_G1: + case R_ARM_LDC_SB_G1: + group = 1; + break; + + case R_ARM_LDC_PC_G2: + case R_ARM_LDC_SB_G2: + group = 2; + break; + + default: + abort(); + } + + /* If REL, extract the addend from the insn. If RELA, it will + have already been fetched for us. */ + if (globals->use_rel) + { + int negative = (insn & (1 << 23)) ? 1 : -1; + signed_addend = negative * ((insn & 0xff) << 2); + } + + /* Compute the value (X) to go in the place. */ + if (r_type == R_ARM_LDC_PC_G0 + || r_type == R_ARM_LDC_PC_G1 + || r_type == R_ARM_LDC_PC_G2) + /* PC relative. */ + signed_value = value - pc + signed_addend; + else + /* Section base relative. */ + signed_value = value - sb + signed_addend; + + /* Calculate the value of the relevant G_{n-1} to obtain + the residual at that stage. */ + calculate_group_reloc_mask (abs (signed_value), group - 1, &residual); + + /* Check for overflow. (The absolute value to go in the place must be + divisible by four and, after having been divided by four, must + fit in eight bits.) */ + if ((residual & 0x3) != 0 || residual >= 0x400) + { + (*_bfd_error_handler) + (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), + input_bfd, input_section, + (long) rel->r_offset, abs (signed_value), howto->name); + return bfd_reloc_overflow; + } + + /* Mask out the value and U bit. */ + insn &= 0xff7fff00; + + /* Set the U bit if the value to go in the place is non-negative. */ + if (signed_value >= 0) + insn |= 1 << 23; + + /* Encode the offset. */ + insn |= residual >> 2; + + bfd_put_32 (input_bfd, insn, hit_data); + } + return bfd_reloc_ok; + default: return bfd_reloc_notsupported; } } - -static int -uleb128_size (unsigned int i) -{ - int size; - size = 1; - while (i >= 0x80) - { - i >>= 7; - size++; - } - return size; -} - -/* Return TRUE if the attribute has the default value (0/""). */ -static bfd_boolean -is_default_attr (aeabi_attribute *attr) -{ - if ((attr->type & 1) && attr->i != 0) - return FALSE; - if ((attr->type & 2) && attr->s && *attr->s) - return FALSE; - - return TRUE; -} - -/* Return the size of a single attribute. */ -static bfd_vma -eabi_attr_size(int tag, aeabi_attribute *attr) -{ - bfd_vma size; - - if (is_default_attr (attr)) - return 0; - - size = uleb128_size (tag); - if (attr->type & 1) - size += uleb128_size (attr->i); - if (attr->type & 2) - size += strlen ((char *)attr->s) + 1; - return size; -} - -/* Returns the size of the eabi object attributess section. */ -bfd_vma -elf32_arm_eabi_attr_size (bfd *abfd) -{ - bfd_vma size; - aeabi_attribute *attr; - aeabi_attribute_list *list; - int i; - - attr = elf32_arm_tdata (abfd)->known_eabi_attributes; - size = 16; /* 'A' "aeabi" 0x1 . */ - for (i = 4; i < NUM_KNOWN_ATTRIBUTES; i++) - size += eabi_attr_size (i, &attr[i]); - - for (list = elf32_arm_tdata (abfd)->other_eabi_attributes; - list; - list = list->next) - size += eabi_attr_size (list->tag, &list->attr); - - return size; -} - -static bfd_byte * -write_uleb128 (bfd_byte *p, unsigned int val) -{ - bfd_byte c; - do - { - c = val & 0x7f; - val >>= 7; - if (val) - c |= 0x80; - *(p++) = c; - } - while (val); - return p; -} - -/* Write attribute ATTR to butter P, and return a pointer to the following - byte. */ -static bfd_byte * -write_eabi_attribute (bfd_byte *p, int tag, aeabi_attribute *attr) -{ - /* Suppress default entries. */ - if (is_default_attr(attr)) - return p; - - p = write_uleb128 (p, tag); - if (attr->type & 1) - p = write_uleb128 (p, attr->i); - if (attr->type & 2) - { - int len; - - len = strlen (attr->s) + 1; - memcpy (p, attr->s, len); - p += len; - } - - return p; -} - -/* Write the contents of the eabi attributes section to p. */ -void -elf32_arm_set_eabi_attr_contents (bfd *abfd, bfd_byte *contents, bfd_vma size) -{ - bfd_byte *p; - aeabi_attribute *attr; - aeabi_attribute_list *list; - int i; - - p = contents; - *(p++) = 'A'; - bfd_put_32 (abfd, size - 1, p); - p += 4; - memcpy (p, "aeabi", 6); - p += 6; - *(p++) = Tag_File; - bfd_put_32 (abfd, size - 11, p); - p += 4; - - attr = elf32_arm_tdata (abfd)->known_eabi_attributes; - for (i = 4; i < NUM_KNOWN_ATTRIBUTES; i++) - p = write_eabi_attribute (p, i, &attr[i]); - - for (list = elf32_arm_tdata (abfd)->other_eabi_attributes; - list; - list = list->next) - p = write_eabi_attribute (p, list->tag, &list->attr); -} - -/* Override final_link to handle EABI object attribute sections. */ - -static bfd_boolean -elf32_arm_bfd_final_link (bfd *abfd, struct bfd_link_info *info) -{ - asection *o; - struct bfd_link_order *p; - asection *attr_section = NULL; - bfd_byte *contents; - bfd_vma size = 0; - - /* elf32_arm_merge_private_bfd_data will already have merged the - object attributes. Remove the input sections from the link, and set - the contents of the output secton. */ - for (o = abfd->sections; o != NULL; o = o->next) - { - if (strcmp (o->name, ".ARM.attributes") == 0) - { - for (p = o->map_head.link_order; p != NULL; p = p->next) - { - asection *input_section; - - if (p->type != bfd_indirect_link_order) - continue; - input_section = p->u.indirect.section; - /* Hack: reset the SEC_HAS_CONTENTS flag so that - elf_link_input_bfd ignores this section. */ - input_section->flags &= ~SEC_HAS_CONTENTS; - } - - size = elf32_arm_eabi_attr_size (abfd); - bfd_set_section_size (abfd, o, size); - attr_section = o; - /* Skip this section later on. */ - o->map_head.link_order = NULL; - } - } - /* Invoke the ELF linker to do all the work. */ - if (!bfd_elf_final_link (abfd, info)) - return FALSE; - - if (attr_section) - { - contents = bfd_malloc(size); - if (contents == NULL) - return FALSE; - elf32_arm_set_eabi_attr_contents (abfd, contents, size); - bfd_set_section_contents (abfd, attr_section, contents, 0, size); - free (contents); - } - return TRUE; -} - - /* Add INCREMENT to the reloc (of type HOWTO) at ADDRESS. */ static void arm_add_to_rel (bfd * abfd, @@ -4375,8 +6358,6 @@ elf32_arm_relocate_section (bfd * output_bfd, struct elf32_arm_link_hash_table * globals; globals = elf32_arm_hash_table (info); - if (info->relocatable && !globals->use_rel) - return TRUE; symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -4396,6 +6377,7 @@ elf32_arm_relocate_section (bfd * output_bfd, arelent bfd_reloc; char sym_type; bfd_boolean unresolved_reloc = FALSE; + char *error_message = NULL; r_symndx = ELF32_R_SYM (rel->r_info); r_type = ELF32_R_TYPE (rel->r_info); @@ -4408,29 +6390,6 @@ elf32_arm_relocate_section (bfd * output_bfd, bfd_reloc.howto = elf32_arm_howto_from_type (r_type); howto = bfd_reloc.howto; - if (info->relocatable && globals->use_rel) - { - /* This is a relocatable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - { - sec = local_sections[r_symndx]; - arm_add_to_rel (input_bfd, contents + rel->r_offset, - howto, - (bfd_signed_vma) (sec->output_offset - + sym->st_value)); - } - } - - continue; - } - - /* This is a final link. */ h = NULL; sym = NULL; sec = NULL; @@ -4445,8 +6404,9 @@ elf32_arm_relocate_section (bfd * output_bfd, relocation = (sec->output_section->vma + sec->output_offset + sym->st_value); - if ((sec->flags & SEC_MERGE) - && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + if (!info->relocatable + && (sec->flags & SEC_MERGE) + && ELF_ST_TYPE (sym->st_info) == STT_SECTION) { asection *msec; bfd_vma addend, value; @@ -4496,6 +6456,34 @@ elf32_arm_relocate_section (bfd * output_bfd, sym_type = h->type; } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + { + /* This is a relocatable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + if (globals->use_rel) + arm_add_to_rel (input_bfd, contents + rel->r_offset, + howto, (bfd_signed_vma) sec->output_offset); + else + rel->r_addend += sec->output_offset; + } + continue; + } + if (h != NULL) name = h->root.root.string; else @@ -4529,7 +6517,7 @@ elf32_arm_relocate_section (bfd * output_bfd, relocation, info, sec, name, (h ? ELF_ST_TYPE (h->type) : ELF_ST_TYPE (sym->st_info)), h, - &unresolved_reloc); + &unresolved_reloc, &error_message); /* Dynamic relocs are not propagated for SEC_DEBUGGING sections because such sections are not SEC_ALLOC and thus ld.so will @@ -4550,8 +6538,6 @@ elf32_arm_relocate_section (bfd * output_bfd, if (r != bfd_reloc_ok) { - const char * msg = (const char *) 0; - switch (r) { case bfd_reloc_overflow: @@ -4575,24 +6561,25 @@ elf32_arm_relocate_section (bfd * output_bfd, break; case bfd_reloc_outofrange: - msg = _("internal error: out of range error"); + error_message = _("out of range"); goto common_error; case bfd_reloc_notsupported: - msg = _("internal error: unsupported relocation error"); + error_message = _("unsupported relocation"); goto common_error; case bfd_reloc_dangerous: - msg = _("internal error: dangerous error"); + /* error_message should already be set. */ goto common_error; default: - msg = _("internal error: unknown error"); + error_message = _("unknown error"); /* fall through */ common_error: - if (!((*info->callbacks->warning) - (info, msg, name, input_bfd, input_section, + BFD_ASSERT (error_message != NULL); + if (!((*info->callbacks->reloc_dangerous) + (info, error_message, input_bfd, input_section, rel->r_offset))) return FALSE; break; @@ -4603,130 +6590,6 @@ elf32_arm_relocate_section (bfd * output_bfd, return TRUE; } -/* Allocate/find an object attribute. */ -static aeabi_attribute * -elf32_arm_new_eabi_attr (bfd *abfd, int tag) -{ - aeabi_attribute *attr; - aeabi_attribute_list *list; - aeabi_attribute_list *p; - aeabi_attribute_list **lastp; - - - if (tag < NUM_KNOWN_ATTRIBUTES) - { - /* Knwon tags are preallocated. */ - attr = &elf32_arm_tdata (abfd)->known_eabi_attributes[tag]; - } - else - { - /* Create a new tag. */ - list = (aeabi_attribute_list *) - bfd_alloc (abfd, sizeof (aeabi_attribute_list)); - memset (list, 0, sizeof (aeabi_attribute_list)); - list->tag = tag; - /* Keep the tag list in order. */ - lastp = &elf32_arm_tdata (abfd)->other_eabi_attributes; - for (p = *lastp; p; p = p->next) - { - if (tag < p->tag) - break; - lastp = &p->next; - } - list->next = *lastp; - *lastp = list; - attr = &list->attr; - } - - return attr; -} - -int -elf32_arm_get_eabi_attr_int (bfd *abfd, int tag) -{ - aeabi_attribute_list *p; - - if (tag < NUM_KNOWN_ATTRIBUTES) - { - /* Knwon tags are preallocated. */ - return elf32_arm_tdata (abfd)->known_eabi_attributes[tag].i; - } - else - { - for (p = elf32_arm_tdata (abfd)->other_eabi_attributes; - p; - p = p->next) - { - if (tag == p->tag) - return p->attr.i; - if (tag < p->tag) - break; - } - return 0; - } -} - -void -elf32_arm_add_eabi_attr_int (bfd *abfd, int tag, unsigned int i) -{ - aeabi_attribute *attr; - - attr = elf32_arm_new_eabi_attr (abfd, tag); - attr->type = 1; - attr->i = i; -} - -static char * -attr_strdup (bfd *abfd, const char * s) -{ - char * p; - int len; - - len = strlen (s) + 1; - p = (char *)bfd_alloc(abfd, len); - return memcpy (p, s, len); -} - -void -elf32_arm_add_eabi_attr_string (bfd *abfd, int tag, const char *s) -{ - aeabi_attribute *attr; - - attr = elf32_arm_new_eabi_attr (abfd, tag); - attr->type = 2; - attr->s = attr_strdup (abfd, s); -} - -void -elf32_arm_add_eabi_attr_compat (bfd *abfd, unsigned int i, const char *s) -{ - aeabi_attribute_list *list; - aeabi_attribute_list *p; - aeabi_attribute_list **lastp; - - list = (aeabi_attribute_list *) - bfd_alloc (abfd, sizeof (aeabi_attribute_list)); - memset (list, 0, sizeof (aeabi_attribute_list)); - list->tag = Tag_compatibility; - list->attr.type = 3; - list->attr.i = i; - list->attr.s = attr_strdup (abfd, s); - - lastp = &elf32_arm_tdata (abfd)->other_eabi_attributes; - for (p = *lastp; p; p = p->next) - { - int cmp; - if (p->tag != Tag_compatibility) - break; - cmp = strcmp(s, p->attr.s); - if (cmp < 0 || (cmp == 0 && i < p->attr.i)) - break; - lastp = &p->next; - } - list->next = *lastp; - *lastp = list; -} - /* Set the right machine number. */ static bfd_boolean @@ -4777,49 +6640,6 @@ elf32_arm_set_private_flags (bfd *abfd, flagword flags) return TRUE; } -/* Copy the eabi object attribute from IBFD to OBFD. */ -static void -copy_eabi_attributes (bfd *ibfd, bfd *obfd) -{ - aeabi_attribute *in_attr; - aeabi_attribute *out_attr; - aeabi_attribute_list *list; - int i; - - in_attr = elf32_arm_tdata (ibfd)->known_eabi_attributes; - out_attr = elf32_arm_tdata (obfd)->known_eabi_attributes; - for (i = 4; i < NUM_KNOWN_ATTRIBUTES; i++) - { - out_attr->i = in_attr->i; - if (in_attr->s && *in_attr->s) - out_attr->s = attr_strdup (obfd, in_attr->s); - in_attr++; - out_attr++; - } - - for (list = elf32_arm_tdata (ibfd)->other_eabi_attributes; - list; - list = list->next) - { - in_attr = &list->attr; - switch (in_attr->type) - { - case 1: - elf32_arm_add_eabi_attr_int (obfd, list->tag, in_attr->i); - break; - case 2: - elf32_arm_add_eabi_attr_string (obfd, list->tag, in_attr->s); - break; - case 3: - elf32_arm_add_eabi_attr_compat (obfd, in_attr->i, in_attr->s); - break; - default: - abort(); - } - } -} - - /* Copy backend specific data from one object module to another. */ static bfd_boolean @@ -4871,8 +6691,8 @@ elf32_arm_copy_private_bfd_data (bfd *ibfd, bfd *obfd) elf_elfheader (obfd)->e_ident[EI_OSABI] = elf_elfheader (ibfd)->e_ident[EI_OSABI]; - /* Copy EABI object attributes. */ - copy_eabi_attributes (ibfd, obfd); + /* Copy object attributes. */ + _bfd_elf_copy_obj_attributes (ibfd, obfd); return TRUE; } @@ -4904,33 +6724,48 @@ enum AEABI_enum_forced_wide }; +/* Determine whether an object attribute tag takes an integer, a + string or both. */ +static int +elf32_arm_obj_attrs_arg_type (int tag) +{ + if (tag == Tag_compatibility) + return 3; + else if (tag == 4 || tag == 5) + return 2; + else if (tag < 32) + return 1; + else + return (tag & 1) != 0 ? 2 : 1; +} + /* Merge EABI object attributes from IBFD into OBFD. Raise an error if there are conflicting attributes. */ static bfd_boolean elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd) { - aeabi_attribute *in_attr; - aeabi_attribute *out_attr; - aeabi_attribute_list *in_list; - aeabi_attribute_list *out_list; + obj_attribute *in_attr; + obj_attribute *out_attr; + obj_attribute_list *in_list; /* Some tags have 0 = don't care, 1 = strong requirement, 2 = weak requirement. */ static const int order_312[3] = {3, 1, 2}; int i; - if (!elf32_arm_tdata (ibfd)->known_eabi_attributes[0].i) + if (!elf_known_obj_attributes_proc (obfd)[0].i) { /* This is the first object. Copy the attributes. */ - copy_eabi_attributes (ibfd, obfd); + _bfd_elf_copy_obj_attributes (ibfd, obfd); + + /* Use the Tag_null value to indicate the attributes have been + initialized. */ + elf_known_obj_attributes_proc (obfd)[0].i = 1; + return TRUE; } - /* Use the Tag_null value to indicate the attributes have been - initialized. */ - elf32_arm_tdata (ibfd)->known_eabi_attributes[0].i = 1; - - in_attr = elf32_arm_tdata (ibfd)->known_eabi_attributes; - out_attr = elf32_arm_tdata (obfd)->known_eabi_attributes; + in_attr = elf_known_obj_attributes_proc (ibfd); + out_attr = elf_known_obj_attributes_proc (obfd); /* This needs to happen before Tag_ABI_FP_number_model is merged. */ if (in_attr[Tag_ABI_VFP_args].i != out_attr[Tag_ABI_VFP_args].i) { @@ -4946,16 +6781,19 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd) } } - for (i = 4; i < NUM_KNOWN_ATTRIBUTES; i++) + for (i = 4; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++) { /* Merge this attribute with existing attributes. */ switch (i) { case Tag_CPU_raw_name: case Tag_CPU_name: - /* Use whichever has the greatest architecture requirements. */ - if (in_attr[Tag_CPU_arch].i > out_attr[Tag_CPU_arch].i) - out_attr[i].s = attr_strdup(obfd, in_attr[i].s); + /* Use whichever has the greatest architecture requirements. We + won't necessarily have both the above tags, so make sure input + name is non-NULL. */ + if (in_attr[Tag_CPU_arch].i > out_attr[Tag_CPU_arch].i + && in_attr[i].s) + out_attr[i].s = _bfd_elf_attr_strdup (obfd, in_attr[i].s); break; case Tag_ABI_optimization_goals: @@ -5006,7 +6844,8 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd) } break; case Tag_ABI_PCS_R9_use: - if (out_attr[i].i != AEABI_R9_unused + if (in_attr[i].i != out_attr[i].i + && out_attr[i].i != AEABI_R9_unused && in_attr[i].i != AEABI_R9_unused) { _bfd_error_handler @@ -5067,10 +6906,15 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd) out_attr[i].i = in_attr[i].i; } else if (in_attr[i].i != AEABI_enum_forced_wide - && out_attr[i].i != in_attr[i].i) + && out_attr[i].i != in_attr[i].i + && !elf32_arm_tdata (obfd)->no_enum_size_warning) { + const char *aeabi_enum_names[] = + { "", "variable-size", "32-bit", "" }; _bfd_error_handler - (_("ERROR: %B: Conflicting enum sizes"), ibfd); + (_("warning: %B uses %s enums yet the output is to use %s enums; use of enum values across objects may fail"), + ibfd, aeabi_enum_names[in_attr[i].i], + aeabi_enum_names[out_attr[i].i]); } } break; @@ -5091,60 +6935,13 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd) } } - in_list = elf32_arm_tdata (ibfd)->other_eabi_attributes; - out_list = elf32_arm_tdata (ibfd)->other_eabi_attributes; - while (in_list && in_list->tag == Tag_compatibility) - { - in_attr = &in_list->attr; - if (in_attr->i == 0) - continue; - if (in_attr->i == 1) - { - _bfd_error_handler - (_("ERROR: %B: Must be processed by '%s' toolchain"), - ibfd, in_attr->s); - return FALSE; - } - if (!out_list || out_list->tag != Tag_compatibility - || strcmp (in_attr->s, out_list->attr.s) != 0) - { - /* Add this compatibility tag to the output. */ - elf32_arm_add_eabi_attr_compat (obfd, in_attr->i, in_attr->s); - continue; - } - out_attr = &out_list->attr; - /* Check all the input tags with the same identifier. */ - for (;;) - { - if (out_list->tag != Tag_compatibility - || in_attr->i != out_attr->i - || strcmp (in_attr->s, out_attr->s) != 0) - { - _bfd_error_handler - (_("ERROR: %B: Incompatible object tag '%s':%d"), - ibfd, in_attr->s, in_attr->i); - return FALSE; - } - in_list = in_list->next; - if (in_list->tag != Tag_compatibility - || strcmp (in_attr->s, in_list->attr.s) != 0) - break; - in_attr = &in_list->attr; - out_list = out_list->next; - if (out_list) - out_attr = &out_list->attr; - } + /* Merge Tag_compatibility attributes and any common GNU ones. */ + _bfd_elf_merge_object_attributes (ibfd, obfd); - /* Check the output doesn't have extra tags with this identifier. */ - if (out_list && out_list->tag == Tag_compatibility - && strcmp (in_attr->s, out_list->attr.s) == 0) - { - _bfd_error_handler - (_("ERROR: %B: Incompatible object tag '%s':%d"), - ibfd, in_attr->s, out_list->attr.i); - return FALSE; - } - } + /* Check for any attributes not known on ARM. */ + in_list = elf_other_obj_attributes_proc (ibfd); + while (in_list && in_list->tag == Tag_compatibility) + in_list = in_list->next; for (; in_list; in_list = in_list->next) { @@ -5546,39 +7343,21 @@ elf32_arm_get_symbol_type (Elf_Internal_Sym * elf_sym, int type) } static asection * -elf32_arm_gc_mark_hook (asection * sec, - struct bfd_link_info * info ATTRIBUTE_UNUSED, - Elf_Internal_Rela * rel, - struct elf_link_hash_entry * h, - Elf_Internal_Sym * sym) +elf32_arm_gc_mark_hook (asection *sec, + struct bfd_link_info *info, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) + switch (ELF32_R_TYPE (rel->r_info)) { case R_ARM_GNU_VTINHERIT: case R_ARM_GNU_VTENTRY: - break; + return NULL; + } - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Update the got entry reference counts for the section being removed. */ @@ -5644,13 +7423,23 @@ elf32_arm_gc_sweep_hook (bfd * abfd, break; case R_ARM_ABS32: + case R_ARM_ABS32_NOI: case R_ARM_REL32: + case R_ARM_REL32_NOI: case R_ARM_PC24: case R_ARM_PLT32: case R_ARM_CALL: case R_ARM_JUMP24: case R_ARM_PREL31: case R_ARM_THM_CALL: + case R_ARM_MOVW_ABS_NC: + case R_ARM_MOVT_ABS: + case R_ARM_MOVW_PREL_NC: + case R_ARM_MOVT_PREL: + case R_ARM_THM_MOVW_ABS_NC: + case R_ARM_THM_MOVT_ABS: + case R_ARM_THM_MOVW_PREL_NC: + case R_ARM_THM_MOVT_PREL: /* Should the interworking branches be here also? */ if (h != NULL) @@ -5669,14 +7458,17 @@ elf32_arm_gc_sweep_hook (bfd * abfd, } if (r_type == R_ARM_ABS32 - || r_type == R_ARM_REL32) + || r_type == R_ARM_REL32 + || r_type == R_ARM_ABS32_NOI + || r_type == R_ARM_REL32_NOI) { for (pp = &eh->relocs_copied; (p = *pp) != NULL; pp = &p->next) if (p->section == sec) { p->count -= 1; - if (ELF32_R_TYPE (rel->r_info) == R_ARM_REL32) + if (ELF32_R_TYPE (rel->r_info) == R_ARM_REL32 + || ELF32_R_TYPE (rel->r_info) == R_ARM_REL32_NOI) p->pc_count -= 1; if (p->count == 0) *pp = p->next; @@ -5854,13 +7646,23 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, /* Fall through */ case R_ARM_ABS32: + case R_ARM_ABS32_NOI: case R_ARM_REL32: + case R_ARM_REL32_NOI: case R_ARM_PC24: case R_ARM_PLT32: case R_ARM_CALL: case R_ARM_JUMP24: case R_ARM_PREL31: case R_ARM_THM_CALL: + case R_ARM_MOVW_ABS_NC: + case R_ARM_MOVT_ABS: + case R_ARM_MOVW_PREL_NC: + case R_ARM_MOVT_PREL: + case R_ARM_THM_MOVW_ABS_NC: + case R_ARM_THM_MOVT_ABS: + case R_ARM_THM_MOVW_PREL_NC: + case R_ARM_THM_MOVT_PREL: /* Should the interworking branches be listed here? */ if (h != NULL) { @@ -5877,12 +7679,11 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, refers to is in a different object. We can't tell for sure yet, because something later might force the symbol local. */ - if (r_type == R_ARM_PC24 - || r_type == R_ARM_CALL - || r_type == R_ARM_JUMP24 - || r_type == R_ARM_PREL31 - || r_type == R_ARM_PLT32 - || r_type == R_ARM_THM_CALL) + if (r_type != R_ARM_ABS32 + && r_type != R_ARM_REL32 + && r_type != R_ARM_ABS32_NOI + && r_type != R_ARM_REL32_NOI + && r_type != R_ARM_ABS12) h->needs_plt = 1; /* If we create a PLT entry, this relocation will reference @@ -5907,7 +7708,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, relocs_copied field of the hash table entry. */ if ((info->shared || htab->root.is_relocatable_executable) && (sec->flags & SEC_ALLOC) != 0 - && (r_type == R_ARM_ABS32 + && ((r_type == R_ARM_ABS32 || r_type == R_ARM_ABS32_NOI) || (h != NULL && ! h->needs_plt && (! info->symbolic || ! h->def_regular)))) { @@ -5991,7 +7792,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, p->pc_count = 0; } - if (r_type == R_ARM_REL32) + if (r_type == R_ARM_REL32 || r_type == R_ARM_REL32_NOI) p->pc_count += 1; p->count += 1; } @@ -6016,12 +7817,57 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, return TRUE; } +/* Unwinding tables are not referenced directly. This pass marks them as + required if the corresponding code section is marked. */ + +static bfd_boolean +elf32_arm_gc_mark_extra_sections(struct bfd_link_info *info, + elf_gc_mark_hook_fn gc_mark_hook) +{ + bfd *sub; + Elf_Internal_Shdr **elf_shdrp; + bfd_boolean again; + + /* Marking EH data may cause additional code sections to be marked, + requiring multiple passes. */ + again = TRUE; + while (again) + { + again = FALSE; + for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + { + asection *o; + + if (bfd_get_flavour (sub) != bfd_target_elf_flavour) + continue; + + elf_shdrp = elf_elfsections (sub); + for (o = sub->sections; o != NULL; o = o->next) + { + Elf_Internal_Shdr *hdr; + hdr = &elf_section_data (o)->this_hdr; + if (hdr->sh_type == SHT_ARM_EXIDX && hdr->sh_link + && !o->gc_mark + && elf_shdrp[hdr->sh_link]->bfd_section->gc_mark) + { + again = TRUE; + if (!_bfd_elf_gc_mark (info, o, gc_mark_hook)) + return FALSE; + } + } + } + } + + return TRUE; +} + /* Treat mapping symbols as special target symbols. */ static bfd_boolean elf32_arm_is_target_special_symbol (bfd * abfd ATTRIBUTE_UNUSED, asymbol * sym) { - return bfd_is_arm_mapping_symbol_name (sym->name); + return bfd_is_arm_special_symbol_name (sym->name, + BFD_ARM_SPECIAL_SYM_TYPE_ANY); } /* This is a copy of elf_find_function() from elf.c except that @@ -6057,9 +7903,10 @@ arm_elf_find_function (bfd * abfd ATTRIBUTE_UNUSED, case STT_FUNC: case STT_ARM_TFUNC: case STT_NOTYPE: - /* Skip $a and $t symbols. */ + /* Skip mapping symbols. */ if ((q->symbol.flags & BSF_LOCAL) - && bfd_is_arm_mapping_symbol_name (q->symbol.name)) + && bfd_is_arm_special_symbol_name (q->symbol.name, + BFD_ARM_SPECIAL_SYM_TYPE_ANY)) continue; /* Fall through. */ if (bfd_get_section (&q->symbol) == section @@ -6160,7 +8007,6 @@ elf32_arm_adjust_dynamic_symbol (struct bfd_link_info * info, { bfd * dynobj; asection * s; - unsigned int power_of_two; struct elf32_arm_link_hash_entry * eh; struct elf32_arm_link_hash_table *globals; @@ -6273,28 +8119,7 @@ elf32_arm_adjust_dynamic_symbol (struct bfd_link_info * info, h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 3) - power_of_two = 3; - - /* Apply the required alignment. */ - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (dynobj, s)) - { - if (! bfd_set_section_alignment (dynobj, s, power_of_two)) - return FALSE; - } - - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -6483,6 +8308,37 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) else h->got.offset = (bfd_vma) -1; + /* Allocate stubs for exported Thumb functions on v4t. */ + if (!htab->use_blx && h->dynindx != -1 + && h->def_regular + && ELF_ST_TYPE (h->type) == STT_ARM_TFUNC + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) + { + struct elf_link_hash_entry * th; + struct bfd_link_hash_entry * bh; + struct elf_link_hash_entry * myh; + char name[1024]; + asection *s; + bh = NULL; + /* Create a new symbol to regist the real location of the function. */ + s = h->root.u.def.section; + sprintf(name, "__real_%s", h->root.root.string); + _bfd_generic_link_add_one_symbol (info, s->owner, + name, BSF_GLOBAL, s, + h->root.u.def.value, + NULL, TRUE, FALSE, &bh); + + myh = (struct elf_link_hash_entry *) bh; + myh->type = ELF_ST_INFO (STB_LOCAL, STT_ARM_TFUNC); + myh->forced_local = 1; + eh->export_glue = myh; + th = record_arm_to_thumb_glue (info, h); + /* Point the symbol at the stub. */ + h->type = ELF_ST_INFO (ELF_ST_BIND (h->type), STT_FUNC); + h->root.u.def.section = th->root.u.def.section; + h->root.u.def.value = th->root.u.def.value & ~1; + } + if (eh->relocs_copied == NULL) return TRUE; @@ -6494,12 +8350,12 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) if (info->shared || htab->root.is_relocatable_executable) { - /* The only reloc that uses pc_count is R_ARM_REL32, which will - appear on something like ".long foo - .". We want calls to - protected symbols to resolve directly to the function rather - than going via the plt. If people want function pointer - comparisons to work as expected then they should avoid - writing assembly like ".long foo - .". */ + /* The only relocs that use pc_count are R_ARM_REL32 and + R_ARM_REL32_NOI, which will appear on something like + ".long foo - .". We want calls to protected symbols to resolve + directly to the function rather than going via the plt. If people + want function pointer comparisons to work as expected then they + should avoid writing assembly like ".long foo - .". */ if (SYMBOL_CALLS_LOCAL (info, h)) { struct elf32_arm_relocs_copied **pp; @@ -6616,6 +8472,16 @@ elf32_arm_readonly_dynrelocs (struct elf_link_hash_entry *h, PTR inf) return TRUE; } +void +bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *info, + int byteswap_code) +{ + struct elf32_arm_link_hash_table *globals; + + globals = elf32_arm_hash_table (info); + globals->byteswap_code = byteswap_code; +} + /* Set the sizes of the dynamic sections. */ static bfd_boolean @@ -6731,6 +8597,19 @@ elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED, sym dynamic relocs. */ elf_link_hash_traverse (& htab->root, allocate_dynrelocs, info); + /* Here we rummage through the found bfds to collect glue information. */ + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + { + /* Initialise mapping tables for code/data. */ + bfd_elf32_arm_init_maps (ibfd); + + if (!bfd_elf32_arm_process_before_allocation (ibfd, info) + || !bfd_elf32_arm_vfp11_erratum_scan (ibfd, info)) + /* xgettext:c-format */ + _bfd_error_handler (_("Errors encountered processing file %s"), + ibfd->filename); + } + /* The check_relocs and adjust_dynamic_symbol entry points have determined the sizes of the various dynamic sections. Allocate memory for them. */ @@ -6752,7 +8631,7 @@ elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED, /* Remember whether there is a PLT. */ plt = s->size != 0; } - else if (strncmp (name, ".rel", 4) == 0) + else if (CONST_STRNEQ (name, ".rel")) { if (s->size != 0) { @@ -6766,7 +8645,7 @@ elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED, s->reloc_count = 0; } } - else if (strncmp (name, ".got", 4) != 0 + else if (! CONST_STRNEQ (name, ".got") && strcmp (name, ".dynbss") != 0) { /* It's not one of our sections, so don't allocate space. */ @@ -6893,16 +8772,17 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info, /* Fill in the entry in the procedure linkage table. */ if (htab->symbian_p) { - unsigned i; - for (i = 0; i < htab->plt_entry_size / 4; ++i) - bfd_put_32 (output_bfd, - elf32_arm_symbian_plt_entry[i], - splt->contents + h->plt.offset + 4 * i); + put_arm_insn (htab, output_bfd, + elf32_arm_symbian_plt_entry[0], + splt->contents + h->plt.offset); + bfd_put_32 (output_bfd, + elf32_arm_symbian_plt_entry[1], + splt->contents + h->plt.offset + 4); /* Fill in the entry in the .rel.plt section. */ rel.r_offset = (splt->output_section->vma + splt->output_offset - + h->plt.offset + 4 * (i - 1)); + + h->plt.offset + 4); rel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_GLOB_DAT); /* Get the index in the procedure linkage table which @@ -6917,6 +8797,7 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info, bfd_vma got_offset, got_address, plt_address; bfd_vma got_displacement; asection * sgot; + bfd_byte * ptr; sgot = bfd_get_section_by_name (dynobj, ".got.plt"); BFD_ASSERT (sgot != NULL); @@ -6942,20 +8823,23 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info, + splt->output_offset + h->plt.offset); + ptr = htab->splt->contents + h->plt.offset; if (htab->vxworks_p && info->shared) { unsigned int i; bfd_vma val; - for (i = 0; i != htab->plt_entry_size / 4; i++) + for (i = 0; i != htab->plt_entry_size / 4; i++, ptr += 4) { val = elf32_arm_vxworks_shared_plt_entry[i]; if (i == 2) val |= got_address - sgot->output_section->vma; if (i == 5) val |= plt_index * RELOC_SIZE (htab); - bfd_put_32 (output_bfd, val, - htab->splt->contents + h->plt.offset + i * 4); + if (i == 2 || i == 5) + bfd_put_32 (output_bfd, val, ptr); + else + put_arm_insn (htab, output_bfd, val, ptr); } } else if (htab->vxworks_p) @@ -6963,7 +8847,7 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info, unsigned int i; bfd_vma val; - for (i = 0; i != htab->plt_entry_size / 4; i++) + for (i = 0; i != htab->plt_entry_size / 4; i++, ptr += 4) { val = elf32_arm_vxworks_exec_plt_entry[i]; if (i == 2) @@ -6972,8 +8856,10 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info, val |= 0xffffff & -((h->plt.offset + i * 4 + 8) >> 2); if (i == 5) val |= plt_index * RELOC_SIZE (htab); - bfd_put_32 (output_bfd, val, - htab->splt->contents + h->plt.offset + i * 4); + if (i == 2 || i == 5) + bfd_put_32 (output_bfd, val, ptr); + else + put_arm_insn (htab, output_bfd, val, ptr); } loc = (htab->srelplt2->contents @@ -7006,27 +8892,26 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info, if (!htab->use_blx && eh->plt_thumb_refcount > 0) { - bfd_put_16 (output_bfd, elf32_arm_plt_thumb_stub[0], - splt->contents + h->plt.offset - 4); - bfd_put_16 (output_bfd, elf32_arm_plt_thumb_stub[1], - splt->contents + h->plt.offset - 2); + put_thumb_insn (htab, output_bfd, + elf32_arm_plt_thumb_stub[0], ptr - 4); + put_thumb_insn (htab, output_bfd, + elf32_arm_plt_thumb_stub[1], ptr - 2); } - bfd_put_32 (output_bfd, - elf32_arm_plt_entry[0] - | ((got_displacement & 0x0ff00000) >> 20), - splt->contents + h->plt.offset + 0); - bfd_put_32 (output_bfd, - elf32_arm_plt_entry[1] - | ((got_displacement & 0x000ff000) >> 12), - splt->contents + h->plt.offset + 4); - bfd_put_32 (output_bfd, - elf32_arm_plt_entry[2] - | (got_displacement & 0x00000fff), - splt->contents + h->plt.offset + 8); + put_arm_insn (htab, output_bfd, + elf32_arm_plt_entry[0] + | ((got_displacement & 0x0ff00000) >> 20), + ptr + 0); + put_arm_insn (htab, output_bfd, + elf32_arm_plt_entry[1] + | ((got_displacement & 0x000ff000) >> 12), + ptr+ 4); + put_arm_insn (htab, output_bfd, + elf32_arm_plt_entry[2] + | (got_displacement & 0x00000fff), + ptr + 8); #ifdef FOUR_WORD_PLT - bfd_put_32 (output_bfd, elf32_arm_plt_entry[3], - splt->contents + h->plt.offset + 12); + bfd_put_32 (output_bfd, elf32_arm_plt_entry[3], ptr + 12); #endif } @@ -7336,9 +9221,12 @@ elf32_arm_finish_dynamic_sections (bfd * output_bfd, struct bfd_link_info * info Elf_Internal_Rela rel; plt0_entry = elf32_arm_vxworks_exec_plt0_entry; - bfd_put_32 (output_bfd, plt0_entry[0], splt->contents + 0); - bfd_put_32 (output_bfd, plt0_entry[1], splt->contents + 4); - bfd_put_32 (output_bfd, plt0_entry[2], splt->contents + 8); + put_arm_insn (htab, output_bfd, plt0_entry[0], + splt->contents + 0); + put_arm_insn (htab, output_bfd, plt0_entry[1], + splt->contents + 4); + put_arm_insn (htab, output_bfd, plt0_entry[2], + splt->contents + 8); bfd_put_32 (output_bfd, got_address, splt->contents + 12); /* Generate a relocation for _GLOBAL_OFFSET_TABLE_. */ @@ -7353,10 +9241,14 @@ elf32_arm_finish_dynamic_sections (bfd * output_bfd, struct bfd_link_info * info got_displacement = got_address - (plt_address + 16); plt0_entry = elf32_arm_plt0_entry; - bfd_put_32 (output_bfd, plt0_entry[0], splt->contents + 0); - bfd_put_32 (output_bfd, plt0_entry[1], splt->contents + 4); - bfd_put_32 (output_bfd, plt0_entry[2], splt->contents + 8); - bfd_put_32 (output_bfd, plt0_entry[3], splt->contents + 12); + put_arm_insn (htab, output_bfd, plt0_entry[0], + splt->contents + 0); + put_arm_insn (htab, output_bfd, plt0_entry[1], + splt->contents + 4); + put_arm_insn (htab, output_bfd, plt0_entry[2], + splt->contents + 8); + put_arm_insn (htab, output_bfd, plt0_entry[3], + splt->contents + 12); #ifdef FOUR_WORD_PLT /* The displacement value goes in the otherwise-unused @@ -7370,7 +9262,8 @@ elf32_arm_finish_dynamic_sections (bfd * output_bfd, struct bfd_link_info * info /* UnixWare sets the entsize of .plt to 4, although that doesn't really seem like the right value. */ - elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4; + if (splt->output_section->owner == output_bfd) + elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4; if (htab->vxworks_p && !info->shared && htab->splt->size > 0) { @@ -7481,12 +9374,8 @@ elf32_arm_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED static bfd_boolean is_arm_elf_unwind_section_name (bfd * abfd ATTRIBUTE_UNUSED, const char * name) { - size_t len1, len2; - - len1 = sizeof (ELF_STRING_ARM_unwind) - 1; - len2 = sizeof (ELF_STRING_ARM_unwind_once) - 1; - return (strncmp (name, ELF_STRING_ARM_unwind, len1) == 0 - || strncmp (name, ELF_STRING_ARM_unwind_once, len2) == 0); + return (CONST_STRNEQ (name, ELF_STRING_ARM_unwind) + || CONST_STRNEQ (name, ELF_STRING_ARM_unwind_once)); } @@ -7505,125 +9394,9 @@ elf32_arm_fake_sections (bfd * abfd, Elf_Internal_Shdr * hdr, asection * sec) hdr->sh_type = SHT_ARM_EXIDX; hdr->sh_flags |= SHF_LINK_ORDER; } - else if (strcmp(name, ".ARM.attributes") == 0) - { - hdr->sh_type = SHT_ARM_ATTRIBUTES; - } return TRUE; } -/* Parse an Arm EABI attributes section. */ -static void -elf32_arm_parse_attributes (bfd *abfd, Elf_Internal_Shdr * hdr) -{ - bfd_byte *contents; - bfd_byte *p; - bfd_vma len; - - contents = bfd_malloc (hdr->sh_size); - if (!contents) - return; - if (!bfd_get_section_contents (abfd, hdr->bfd_section, contents, 0, - hdr->sh_size)) - { - free (contents); - return; - } - p = contents; - if (*(p++) == 'A') - { - len = hdr->sh_size - 1; - while (len > 0) - { - int namelen; - bfd_vma section_len; - - section_len = bfd_get_32 (abfd, p); - p += 4; - if (section_len > len) - section_len = len; - len -= section_len; - namelen = strlen ((char *)p) + 1; - section_len -= namelen + 4; - if (strcmp((char *)p, "aeabi") != 0) - { - /* Vendor section. Ignore it. */ - p += namelen + section_len; - } - else - { - p += namelen; - while (section_len > 0) - { - int tag; - unsigned int n; - unsigned int val; - bfd_vma subsection_len; - bfd_byte *end; - - tag = read_unsigned_leb128 (abfd, p, &n); - p += n; - subsection_len = bfd_get_32 (abfd, p); - p += 4; - if (subsection_len > section_len) - subsection_len = section_len; - section_len -= subsection_len; - subsection_len -= n + 4; - end = p + subsection_len; - switch (tag) - { - case Tag_File: - while (p < end) - { - bfd_boolean is_string; - - tag = read_unsigned_leb128 (abfd, p, &n); - p += n; - if (tag == 4 || tag == 5) - is_string = 1; - else if (tag < 32) - is_string = 0; - else - is_string = (tag & 1) != 0; - if (tag == Tag_compatibility) - { - val = read_unsigned_leb128 (abfd, p, &n); - p += n; - elf32_arm_add_eabi_attr_compat (abfd, val, - (char *)p); - p += strlen ((char *)p) + 1; - } - else if (is_string) - { - elf32_arm_add_eabi_attr_string (abfd, tag, - (char *)p); - p += strlen ((char *)p) + 1; - } - else - { - val = read_unsigned_leb128 (abfd, p, &n); - p += n; - elf32_arm_add_eabi_attr_int (abfd, tag, val); - } - } - break; - case Tag_Section: - case Tag_Symbol: - /* Don't have anywhere convenient to attach these. - Fall through for now. */ - default: - /* Ignore things we don't kow about. */ - p += subsection_len; - subsection_len = 0; - break; - } - } - } - } - } - free (contents); -} - /* Handle an ARM specific section when reading an object file. This is called when bfd_section_from_shdr finds a section with an unknown type. */ @@ -7653,8 +9426,6 @@ elf32_arm_section_from_shdr (bfd *abfd, if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex)) return FALSE; - if (hdr->sh_type == SHT_ARM_ATTRIBUTES) - elf32_arm_parse_attributes(abfd, hdr); return TRUE; } @@ -7759,76 +9530,236 @@ unrecord_section_with_arm_elf_section_data (asection * sec) } } -/* Called for each symbol. Builds a section map based on mapping symbols. - Does not alter any of the symbols. */ + +typedef struct +{ + void *finfo; + struct bfd_link_info *info; + asection *sec; + int sec_shndx; + bfd_boolean (*func) (void *, const char *, Elf_Internal_Sym *, + asection *, struct elf_link_hash_entry *); +} output_arch_syminfo; + +enum map_symbol_type +{ + ARM_MAP_ARM, + ARM_MAP_THUMB, + ARM_MAP_DATA +}; + + +/* Output a single PLT mapping symbol. */ static bfd_boolean -elf32_arm_output_symbol_hook (struct bfd_link_info *info, - const char *name, - Elf_Internal_Sym *elfsym, - asection *input_sec, - struct elf_link_hash_entry *h) +elf32_arm_ouput_plt_map_sym (output_arch_syminfo *osi, + enum map_symbol_type type, + bfd_vma offset) { - int mapcount; - elf32_arm_section_map *map; - elf32_arm_section_map *newmap; - _arm_elf_section_data *arm_data; - struct elf32_arm_link_hash_table *globals; + static const char *names[3] = {"$a", "$t", "$d"}; + struct elf32_arm_link_hash_table *htab; + Elf_Internal_Sym sym; - globals = elf32_arm_hash_table (info); - if (globals->vxworks_p - && !elf_vxworks_link_output_symbol_hook (info, name, elfsym, - input_sec, h)) + htab = elf32_arm_hash_table (osi->info); + sym.st_value = osi->sec->output_section->vma + + osi->sec->output_offset + + offset; + sym.st_size = 0; + sym.st_other = 0; + sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_NOTYPE); + sym.st_shndx = osi->sec_shndx; + if (!osi->func (osi->finfo, names[type], &sym, osi->sec, NULL)) return FALSE; + return TRUE; +} - /* Only do this on final link. */ - if (info->relocatable) + +/* Output mapping symbols for PLT entries associated with H. */ + +static bfd_boolean +elf32_arm_output_plt_map (struct elf_link_hash_entry *h, void *inf) +{ + output_arch_syminfo *osi = (output_arch_syminfo *) inf; + struct elf32_arm_link_hash_table *htab; + struct elf32_arm_link_hash_entry *eh; + bfd_vma addr; + + htab = elf32_arm_hash_table (osi->info); + + if (h->root.type == bfd_link_hash_indirect) return TRUE; - /* Only build a map if we need to byteswap code. */ - if (!globals->byteswap_code) + if (h->root.type == bfd_link_hash_warning) + /* When warning symbols are created, they **replace** the "real" + entry in the hash table, thus we never get to see the real + symbol in a hash traversal. So look at it now. */ + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (h->plt.offset == (bfd_vma) -1) return TRUE; - /* We only want mapping symbols. */ - if (! bfd_is_arm_mapping_symbol_name (name)) - return TRUE; - - /* If this section has not been allocated an _arm_elf_section_data - structure then we cannot record anything. */ - arm_data = get_arm_elf_section_data (input_sec); - if (arm_data == NULL) - return TRUE; - - mapcount = arm_data->mapcount + 1; - map = arm_data->map; - - /* TODO: This may be inefficient, but we probably don't usually have many - mapping symbols per section. */ - newmap = bfd_realloc (map, mapcount * sizeof (* map)); - if (newmap != NULL) + eh = (struct elf32_arm_link_hash_entry *) h; + addr = h->plt.offset; + if (htab->symbian_p) { - arm_data->map = newmap; - arm_data->mapcount = mapcount; + if (!elf32_arm_ouput_plt_map_sym (osi, ARM_MAP_ARM, addr)) + return FALSE; + if (!elf32_arm_ouput_plt_map_sym (osi, ARM_MAP_DATA, addr + 4)) + return FALSE; + } + else if (htab->vxworks_p) + { + if (!elf32_arm_ouput_plt_map_sym (osi, ARM_MAP_ARM, addr)) + return FALSE; + if (!elf32_arm_ouput_plt_map_sym (osi, ARM_MAP_DATA, addr + 8)) + return FALSE; + if (!elf32_arm_ouput_plt_map_sym (osi, ARM_MAP_ARM, addr + 12)) + return FALSE; + if (!elf32_arm_ouput_plt_map_sym (osi, ARM_MAP_DATA, addr + 20)) + return FALSE; + } + else + { + bfd_boolean thumb_stub; - newmap[mapcount - 1].vma = elfsym->st_value; - newmap[mapcount - 1].type = name[1]; + thumb_stub = eh->plt_thumb_refcount > 0 && !htab->use_blx; + if (thumb_stub) + { + if (!elf32_arm_ouput_plt_map_sym (osi, ARM_MAP_THUMB, addr - 4)) + return FALSE; + } +#ifdef FOUR_WORD_PLT + if (!elf32_arm_ouput_plt_map_sym (osi, ARM_MAP_ARM, addr)) + return FALSE; + if (!elf32_arm_ouput_plt_map_sym (osi, ARM_MAP_DATA, addr + 12)) + return FALSE; +#else + /* A three-word PLT with no Thumb thunk contains only Arm code, + so only need to output a mapping symbol for the first PLT entry and + entries with thumb thunks. */ + if (thumb_stub || addr == 20) + { + if (!elf32_arm_ouput_plt_map_sym (osi, ARM_MAP_ARM, addr)) + return FALSE; + } +#endif } return TRUE; } + +/* Output mapping symbols for linker generated sections. */ + +static bfd_boolean +elf32_arm_output_arch_local_syms (bfd *output_bfd, + struct bfd_link_info *info, + void *finfo, bfd_boolean (*func) (void *, const char *, + Elf_Internal_Sym *, + asection *, + struct elf_link_hash_entry *)) +{ + output_arch_syminfo osi; + struct elf32_arm_link_hash_table *htab; + bfd_vma offset; + bfd_size_type size; + + htab = elf32_arm_hash_table (info); + check_use_blx(htab); + + osi.finfo = finfo; + osi.info = info; + osi.func = func; + + /* ARM->Thumb glue. */ + if (htab->arm_glue_size > 0) + { + osi.sec = bfd_get_section_by_name (htab->bfd_of_glue_owner, + ARM2THUMB_GLUE_SECTION_NAME); + + osi.sec_shndx = _bfd_elf_section_from_bfd_section + (output_bfd, osi.sec->output_section); + if (info->shared || htab->root.is_relocatable_executable + || htab->pic_veneer) + size = ARM2THUMB_PIC_GLUE_SIZE; + else if (htab->use_blx) + size = ARM2THUMB_V5_STATIC_GLUE_SIZE; + else + size = ARM2THUMB_STATIC_GLUE_SIZE; + + for (offset = 0; offset < htab->arm_glue_size; offset += size) + { + elf32_arm_ouput_plt_map_sym (&osi, ARM_MAP_ARM, offset); + elf32_arm_ouput_plt_map_sym (&osi, ARM_MAP_DATA, offset + size - 4); + } + } + + /* Thumb->ARM glue. */ + if (htab->thumb_glue_size > 0) + { + osi.sec = bfd_get_section_by_name (htab->bfd_of_glue_owner, + THUMB2ARM_GLUE_SECTION_NAME); + + osi.sec_shndx = _bfd_elf_section_from_bfd_section + (output_bfd, osi.sec->output_section); + size = THUMB2ARM_GLUE_SIZE; + + for (offset = 0; offset < htab->thumb_glue_size; offset += size) + { + elf32_arm_ouput_plt_map_sym (&osi, ARM_MAP_THUMB, offset); + elf32_arm_ouput_plt_map_sym (&osi, ARM_MAP_ARM, offset + 4); + } + } + + /* Finally, output mapping symbols for the PLT. */ + if (!htab->splt || htab->splt->size == 0) + return TRUE; + + osi.sec_shndx = _bfd_elf_section_from_bfd_section (output_bfd, + htab->splt->output_section); + osi.sec = htab->splt; + /* Output mapping symbols for the plt header. SymbianOS does not have a + plt header. */ + if (htab->vxworks_p) + { + /* VxWorks shared libraries have no PLT header. */ + if (!info->shared) + { + if (!elf32_arm_ouput_plt_map_sym (&osi, ARM_MAP_ARM, 0)) + return FALSE; + if (!elf32_arm_ouput_plt_map_sym (&osi, ARM_MAP_DATA, 12)) + return FALSE; + } + } + else if (!htab->symbian_p) + { + if (!elf32_arm_ouput_plt_map_sym (&osi, ARM_MAP_ARM, 0)) + return FALSE; +#ifndef FOUR_WORD_PLT + if (!elf32_arm_ouput_plt_map_sym (&osi, ARM_MAP_DATA, 16)) + return FALSE; +#endif + } + + elf_link_hash_traverse (&htab->root, elf32_arm_output_plt_map, (void *) &osi); + return TRUE; +} + /* Allocate target specific section data. */ static bfd_boolean elf32_arm_new_section_hook (bfd *abfd, asection *sec) { - _arm_elf_section_data *sdata; - bfd_size_type amt = sizeof (*sdata); + if (!sec->used_by_bfd) + { + _arm_elf_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); - sdata = bfd_zalloc (abfd, amt); - if (sdata == NULL) - return FALSE; - sec->used_by_bfd = sdata; + sdata = bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = sdata; + } record_section_with_arm_elf_section_data (sec); @@ -7850,15 +9781,18 @@ elf32_arm_compare_mapping (const void * a, const void * b) written out as normal. */ static bfd_boolean -elf32_arm_write_section (bfd *output_bfd ATTRIBUTE_UNUSED, asection *sec, +elf32_arm_write_section (bfd *output_bfd, + struct bfd_link_info *link_info, asection *sec, bfd_byte *contents) { - int mapcount; + int mapcount, errcount; _arm_elf_section_data *arm_data; + struct elf32_arm_link_hash_table *globals = elf32_arm_hash_table (link_info); elf32_arm_section_map *map; + elf32_vfp11_erratum_list *errnode; bfd_vma ptr; bfd_vma end; - bfd_vma offset; + bfd_vma offset = sec->output_section->vma + sec->output_offset; bfd_byte tmp; int i; @@ -7870,57 +9804,136 @@ elf32_arm_write_section (bfd *output_bfd ATTRIBUTE_UNUSED, asection *sec, mapcount = arm_data->mapcount; map = arm_data->map; + errcount = arm_data->erratumcount; + + if (errcount != 0) + { + unsigned int endianflip = bfd_big_endian (output_bfd) ? 3 : 0; + + for (errnode = arm_data->erratumlist; errnode != 0; + errnode = errnode->next) + { + bfd_vma index = errnode->vma - offset; + + switch (errnode->type) + { + case VFP11_ERRATUM_BRANCH_TO_ARM_VENEER: + { + bfd_vma branch_to_veneer; + /* Original condition code of instruction, plus bit mask for + ARM B instruction. */ + unsigned int insn = (errnode->u.b.vfp_insn & 0xf0000000) + | 0x0a000000; + + /* The instruction is before the label. */ + index -= 4; + + /* Above offset included in -4 below. */ + branch_to_veneer = errnode->u.b.veneer->vma + - errnode->vma - 4; + + if ((signed) branch_to_veneer < -(1 << 25) + || (signed) branch_to_veneer >= (1 << 25)) + (*_bfd_error_handler) (_("%B: error: VFP11 veneer out of " + "range"), output_bfd); + + insn |= (branch_to_veneer >> 2) & 0xffffff; + contents[endianflip ^ index] = insn & 0xff; + contents[endianflip ^ (index + 1)] = (insn >> 8) & 0xff; + contents[endianflip ^ (index + 2)] = (insn >> 16) & 0xff; + contents[endianflip ^ (index + 3)] = (insn >> 24) & 0xff; + } + break; + + case VFP11_ERRATUM_ARM_VENEER: + { + bfd_vma branch_from_veneer; + unsigned int insn; + + /* Take size of veneer into account. */ + branch_from_veneer = errnode->u.v.branch->vma + - errnode->vma - 12; + + if ((signed) branch_from_veneer < -(1 << 25) + || (signed) branch_from_veneer >= (1 << 25)) + (*_bfd_error_handler) (_("%B: error: VFP11 veneer out of " + "range"), output_bfd); + + /* Original instruction. */ + insn = errnode->u.v.branch->u.b.vfp_insn; + contents[endianflip ^ index] = insn & 0xff; + contents[endianflip ^ (index + 1)] = (insn >> 8) & 0xff; + contents[endianflip ^ (index + 2)] = (insn >> 16) & 0xff; + contents[endianflip ^ (index + 3)] = (insn >> 24) & 0xff; + + /* Branch back to insn after original insn. */ + insn = 0xea000000 | ((branch_from_veneer >> 2) & 0xffffff); + contents[endianflip ^ (index + 4)] = insn & 0xff; + contents[endianflip ^ (index + 5)] = (insn >> 8) & 0xff; + contents[endianflip ^ (index + 6)] = (insn >> 16) & 0xff; + contents[endianflip ^ (index + 7)] = (insn >> 24) & 0xff; + } + break; + + default: + abort (); + } + } + } if (mapcount == 0) return FALSE; - qsort (map, mapcount, sizeof (* map), elf32_arm_compare_mapping); - - offset = sec->output_section->vma + sec->output_offset; - ptr = map[0].vma - offset; - for (i = 0; i < mapcount; i++) + if (globals->byteswap_code) { - if (i == mapcount - 1) - end = sec->size; - else - end = map[i + 1].vma - offset; + qsort (map, mapcount, sizeof (* map), elf32_arm_compare_mapping); - switch (map[i].type) - { - case 'a': - /* Byte swap code words. */ - while (ptr + 3 < end) + ptr = map[0].vma; + for (i = 0; i < mapcount; i++) + { + if (i == mapcount - 1) + end = sec->size; + else + end = map[i + 1].vma; + + switch (map[i].type) { - tmp = contents[ptr]; - contents[ptr] = contents[ptr + 3]; - contents[ptr + 3] = tmp; - tmp = contents[ptr + 1]; - contents[ptr + 1] = contents[ptr + 2]; - contents[ptr + 2] = tmp; - ptr += 4; - } - break; + case 'a': + /* Byte swap code words. */ + while (ptr + 3 < end) + { + tmp = contents[ptr]; + contents[ptr] = contents[ptr + 3]; + contents[ptr + 3] = tmp; + tmp = contents[ptr + 1]; + contents[ptr + 1] = contents[ptr + 2]; + contents[ptr + 2] = tmp; + ptr += 4; + } + break; - case 't': - /* Byte swap code halfwords. */ - while (ptr + 1 < end) - { - tmp = contents[ptr]; - contents[ptr] = contents[ptr + 1]; - contents[ptr + 1] = tmp; - ptr += 2; - } - break; + case 't': + /* Byte swap code halfwords. */ + while (ptr + 1 < end) + { + tmp = contents[ptr]; + contents[ptr] = contents[ptr + 1]; + contents[ptr + 1] = tmp; + ptr += 2; + } + break; - case 'd': - /* Leave data alone. */ - break; - } - ptr = end; + case 'd': + /* Leave data alone. */ + break; + } + ptr = end; + } } free (map); arm_data->mapcount = 0; + arm_data->mapsize = 0; arm_data->map = NULL; unrecord_section_with_arm_elf_section_data (sec); @@ -7938,11 +9951,25 @@ unrecord_section_via_map_over_sections (bfd * abfd ATTRIBUTE_UNUSED, static bfd_boolean elf32_arm_close_and_cleanup (bfd * abfd) { - bfd_map_over_sections (abfd, unrecord_section_via_map_over_sections, NULL); + if (abfd->sections) + bfd_map_over_sections (abfd, + unrecord_section_via_map_over_sections, + NULL); return _bfd_elf_close_and_cleanup (abfd); } +static bfd_boolean +elf32_arm_bfd_free_cached_info (bfd * abfd) +{ + if (abfd->sections) + bfd_map_over_sections (abfd, + unrecord_section_via_map_over_sections, + NULL); + + return _bfd_free_cached_info (abfd); +} + /* Display STT_ARM_TFUNC symbols as functions. */ static void @@ -7958,13 +9985,14 @@ elf32_arm_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, /* Mangle thumb function symbols as we read them in. */ -static void +static bfd_boolean elf32_arm_swap_symbol_in (bfd * abfd, const void *psrc, const void *pshn, Elf_Internal_Sym *dst) { - bfd_elf32_swap_symbol_in (abfd, psrc, pshn, dst); + if (!bfd_elf32_swap_symbol_in (abfd, psrc, pshn, dst)) + return FALSE; /* New EABI objects mark thumb function symbols by setting the low bit of the address. Turn these into STT_ARM_TFUNC. */ @@ -7974,6 +10002,7 @@ elf32_arm_swap_symbol_in (bfd * abfd, dst->st_info = ELF_ST_INFO (ELF_ST_BIND (dst->st_info), STT_ARM_TFUNC); dst->st_value &= ~(bfd_vma) 1; } + return TRUE; } @@ -7995,7 +10024,18 @@ elf32_arm_swap_symbol_out (bfd *abfd, { newsym = *src; newsym.st_info = ELF_ST_INFO (ELF_ST_BIND (src->st_info), STT_FUNC); - newsym.st_value |= 1; + if (newsym.st_shndx != SHN_UNDEF) + { + /* Do this only for defined symbols. At link type, the static + linker will simulate the work of dynamic linker of resolving + symbols and will carry over the thumbness of found symbols to + the output symbol table. It's not clear how it happens, but + the thumbness of undefined symbols can well be different at + runtime, and writing '1' for them will be confusing for users + and possibly for dynamic linker itself. + */ + newsym.st_value |= 1; + } src = &newsym; } @@ -8040,7 +10080,8 @@ elf32_arm_modify_segment_map (bfd *abfd, /* We may add a PT_ARM_EXIDX program header. */ static int -elf32_arm_additional_program_headers (bfd *abfd) +elf32_arm_additional_program_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { asection *sec; @@ -8051,6 +10092,13 @@ elf32_arm_additional_program_headers (bfd *abfd) return 0; } +/* We have two function types: STT_FUNC and STT_ARM_TFUNC. */ +static bfd_boolean +elf32_arm_is_function_type (unsigned int type) +{ + return (type == STT_FUNC) || (type == STT_ARM_TFUNC); +} + /* We use this to override swap_symbol_in and swap_symbol_out. */ const struct elf_size_info elf32_arm_size_info = { sizeof (Elf32_External_Ehdr), @@ -8088,6 +10136,7 @@ const struct elf_size_info elf32_arm_size_info = { #define ELF_MAXPAGESIZE 0x8000 #endif #define ELF_MINPAGESIZE 0x1000 +#define ELF_COMMONPAGESIZE 0x1000 #define bfd_elf32_mkobject elf32_arm_mkobject @@ -8097,15 +10146,17 @@ const struct elf_size_info elf32_arm_size_info = { #define bfd_elf32_bfd_print_private_bfd_data elf32_arm_print_private_bfd_data #define bfd_elf32_bfd_link_hash_table_create elf32_arm_link_hash_table_create #define bfd_elf32_bfd_reloc_type_lookup elf32_arm_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup elf32_arm_reloc_name_lookup #define bfd_elf32_find_nearest_line elf32_arm_find_nearest_line #define bfd_elf32_find_inliner_info elf32_arm_find_inliner_info #define bfd_elf32_new_section_hook elf32_arm_new_section_hook #define bfd_elf32_bfd_is_target_special_symbol elf32_arm_is_target_special_symbol #define bfd_elf32_close_and_cleanup elf32_arm_close_and_cleanup -#define bfd_elf32_bfd_final_link elf32_arm_bfd_final_link +#define bfd_elf32_bfd_free_cached_info elf32_arm_bfd_free_cached_info #define elf_backend_get_symbol_type elf32_arm_get_symbol_type #define elf_backend_gc_mark_hook elf32_arm_gc_mark_hook +#define elf_backend_gc_mark_extra_sections elf32_arm_gc_mark_extra_sections #define elf_backend_gc_sweep_hook elf32_arm_gc_sweep_hook #define elf_backend_check_relocs elf32_arm_check_relocs #define elf_backend_relocate_section elf32_arm_relocate_section @@ -8114,8 +10165,8 @@ const struct elf_size_info elf32_arm_size_info = { #define elf_backend_create_dynamic_sections elf32_arm_create_dynamic_sections #define elf_backend_finish_dynamic_symbol elf32_arm_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections elf32_arm_finish_dynamic_sections -#define elf_backend_link_output_symbol_hook elf32_arm_output_symbol_hook #define elf_backend_size_dynamic_sections elf32_arm_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_2_index_sections #define elf_backend_post_process_headers elf32_arm_post_process_headers #define elf_backend_reloc_type_class elf32_arm_reloc_type_class #define elf_backend_object_p elf32_arm_object_p @@ -8129,6 +10180,11 @@ const struct elf_size_info elf32_arm_size_info = { #define elf_backend_modify_segment_map elf32_arm_modify_segment_map #define elf_backend_additional_program_headers \ elf32_arm_additional_program_headers +#define elf_backend_output_arch_local_syms \ + elf32_arm_output_arch_local_syms +#define elf_backend_begin_write_processing \ + elf32_arm_begin_write_processing +#define elf_backend_is_function_type elf32_arm_is_function_type #define elf_backend_can_refcount 1 #define elf_backend_can_gc_sections 1 @@ -8138,10 +10194,18 @@ const struct elf_size_info elf32_arm_size_info = { #define elf_backend_may_use_rel_p 1 #define elf_backend_may_use_rela_p 0 #define elf_backend_default_use_rela_p 0 -#define elf_backend_rela_normal 0 #define elf_backend_got_header_size 12 +#undef elf_backend_obj_attrs_vendor +#define elf_backend_obj_attrs_vendor "aeabi" +#undef elf_backend_obj_attrs_section +#define elf_backend_obj_attrs_section ".ARM.attributes" +#undef elf_backend_obj_attrs_arg_type +#define elf_backend_obj_attrs_arg_type elf32_arm_obj_attrs_arg_type +#undef elf_backend_obj_attrs_section_type +#define elf_backend_obj_attrs_section_type SHT_ARM_ATTRIBUTES + #include "elf32-target.h" /* VxWorks Targets */ @@ -8202,8 +10266,6 @@ elf32_arm_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker) #define elf_backend_may_use_rela_p 1 #undef elf_backend_default_use_rela_p #define elf_backend_default_use_rela_p 1 -#undef elf_backend_rela_normal -#define elf_backend_rela_normal 1 #undef elf_backend_want_plt_sym #define elf_backend_want_plt_sym 1 #undef ELF_MAXPAGESIZE @@ -8254,24 +10316,23 @@ elf32_arm_symbian_special_sections[] = the loadable read-only segment. The post-linker may wish to refer to these sections, but they are not part of the final program image. */ - { ".dynamic", 8, 0, SHT_DYNAMIC, 0 }, - { ".dynstr", 7, 0, SHT_STRTAB, 0 }, - { ".dynsym", 7, 0, SHT_DYNSYM, 0 }, - { ".got", 4, 0, SHT_PROGBITS, 0 }, - { ".hash", 5, 0, SHT_HASH, 0 }, + { STRING_COMMA_LEN (".dynamic"), 0, SHT_DYNAMIC, 0 }, + { STRING_COMMA_LEN (".dynstr"), 0, SHT_STRTAB, 0 }, + { STRING_COMMA_LEN (".dynsym"), 0, SHT_DYNSYM, 0 }, + { STRING_COMMA_LEN (".got"), 0, SHT_PROGBITS, 0 }, + { STRING_COMMA_LEN (".hash"), 0, SHT_HASH, 0 }, /* These sections do not need to be writable as the SymbianOS postlinker will arrange things so that no dynamic relocation is required. */ - { ".init_array", 11, 0, SHT_INIT_ARRAY, SHF_ALLOC }, - { ".fini_array", 11, 0, SHT_FINI_ARRAY, SHF_ALLOC }, - { ".preinit_array", 14, 0, SHT_PREINIT_ARRAY, SHF_ALLOC }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".init_array"), 0, SHT_INIT_ARRAY, SHF_ALLOC }, + { STRING_COMMA_LEN (".fini_array"), 0, SHT_FINI_ARRAY, SHF_ALLOC }, + { STRING_COMMA_LEN (".preinit_array"), 0, SHT_PREINIT_ARRAY, SHF_ALLOC }, + { NULL, 0, 0, 0, 0 } }; static void elf32_arm_symbian_begin_write_processing (bfd *abfd, - struct bfd_link_info *link_info - ATTRIBUTE_UNUSED) + struct bfd_link_info *link_info) { /* BPABI objects are never loaded directly by an OS kernel; they are processed by a postlinker first, into an OS-specific format. If @@ -8282,6 +10343,7 @@ elf32_arm_symbian_begin_write_processing (bfd *abfd, recognize that the program headers should not be mapped into any loadable segment. */ abfd->flags &= ~D_PAGED; + elf32_arm_begin_write_processing(abfd, link_info); } static bfd_boolean @@ -8298,9 +10360,16 @@ elf32_arm_symbian_modify_segment_map (bfd *abfd, dynsec = bfd_get_section_by_name (abfd, ".dynamic"); if (dynsec) { - m = _bfd_elf_make_dynamic_segment (abfd, dynsec); - m->next = elf_tdata (abfd)->segment_map; - elf_tdata (abfd)->segment_map = m; + for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + if (m->p_type == PT_DYNAMIC) + break; + + if (m == NULL) + { + m = _bfd_elf_make_dynamic_segment (abfd, dynsec); + m->next = elf_tdata (abfd)->segment_map; + elf_tdata (abfd)->segment_map = m; + } } /* Also call the generic arm routine. */ @@ -8349,8 +10418,6 @@ elf32_arm_symbian_modify_segment_map (bfd *abfd, #define elf_backend_may_use_rela_p 0 #undef elf_backend_default_use_rela_p #define elf_backend_default_use_rela_p 0 -#undef elf_backend_rela_normal -#define elf_backend_rela_normal 0 #undef elf_backend_want_plt_sym #define elf_backend_want_plt_sym 0 #undef ELF_MAXPAGESIZE diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c index ec42bb335d1..9169a8b88c3 100644 --- a/bfd/elf32-avr.c +++ b/bfd/elf32-avr.c @@ -1,5 +1,5 @@ /* AVR-specific support for 32-bit ELF - Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2006 + Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. Contributed by Denis Chertykov @@ -20,11 +20,99 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/avr.h" +#include "elf32-avr.h" + +/* Enable debugging printout at stdout with this variable. */ +static bfd_boolean debug_relax = FALSE; + +/* Enable debugging printout at stdout with this variable. */ +static bfd_boolean debug_stubs = FALSE; + +/* Hash table initialization and handling. Code is taken from the hppa port + and adapted to the needs of AVR. */ + +/* We use two hash tables to hold information for linking avr objects. + + The first is the elf32_avr_link_hash_tablse which is derived from the + stanard ELF linker hash table. We use this as a place to attach the other + hash table and some static information. + + The second is the stub hash table which is derived from the base BFD + hash table. The stub hash table holds the information on the linker + stubs. */ + +struct elf32_avr_stub_hash_entry +{ + /* Base hash table entry structure. */ + struct bfd_hash_entry bh_root; + + /* Offset within stub_sec of the beginning of this stub. */ + bfd_vma stub_offset; + + /* Given the symbol's value and its section we can determine its final + value when building the stubs (so the stub knows where to jump). */ + bfd_vma target_value; + + /* This way we could mark stubs to be no longer necessary. */ + bfd_boolean is_actually_needed; +}; + +struct elf32_avr_link_hash_table +{ + /* The main hash table. */ + struct elf_link_hash_table etab; + + /* The stub hash table. */ + struct bfd_hash_table bstab; + + bfd_boolean no_stubs; + + /* Linker stub bfd. */ + bfd *stub_bfd; + + /* The stub section. */ + asection *stub_sec; + + /* Usually 0, unless we are generating code for a bootloader. Will + be initialized by elf32_avr_size_stubs to the vma offset of the + output section associated with the stub section. */ + bfd_vma vector_base; + + /* Assorted information used by elf32_avr_size_stubs. */ + unsigned int bfd_count; + int top_index; + asection ** input_list; + Elf_Internal_Sym ** all_local_syms; + + /* Tables for mapping vma beyond the 128k boundary to the address of the + corresponding stub. (AMT) + "amt_max_entry_cnt" reflects the number of entries that memory is allocated + for in the "amt_stub_offsets" and "amt_destination_addr" arrays. + "amt_entry_cnt" informs how many of these entries actually contain + useful data. */ + unsigned int amt_entry_cnt; + unsigned int amt_max_entry_cnt; + bfd_vma * amt_stub_offsets; + bfd_vma * amt_destination_addr; +}; + +/* Various hash macros and functions. */ +#define avr_link_hash_table(p) \ + /* PR 3874: Check that we have an AVR style hash table before using it. */\ + ((p)->hash->table.newfunc != elf32_avr_link_hash_newfunc ? NULL : \ + ((struct elf32_avr_link_hash_table *) ((p)->hash))) + +#define avr_stub_hash_entry(ent) \ + ((struct elf32_avr_stub_hash_entry *)(ent)) + +#define avr_stub_hash_lookup(table, string, create, copy) \ + ((struct elf32_avr_stub_hash_entry *) \ + bfd_hash_lookup ((table), (string), (create), (copy))) static reloc_howto_type elf_avr_howto_table[] = { @@ -101,7 +189,8 @@ static reloc_howto_type elf_avr_howto_table[] = 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ - /* A 16 bit absolute relocation for command address. */ + /* A 16 bit absolute relocation for command address + Will be changed when linker stubs are needed. */ HOWTO (R_AVR_16_PM, /* type */ 1, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -207,7 +296,7 @@ static reloc_howto_type elf_avr_howto_table[] = 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ /* A low 8 bit absolute relocation of 24 bit program memory address. - For LDI command. */ + For LDI command. Will not be changed when linker stubs are needed. */ HOWTO (R_AVR_LO8_LDI_PM, /* type */ 1, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -221,8 +310,8 @@ static reloc_howto_type elf_avr_howto_table[] = 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ - /* A high 8 bit absolute relocation of 16 bit program memory address. - For LDI command. */ + /* A low 8 bit absolute relocation of 24 bit program memory address. + For LDI command. Will not be changed when linker stubs are needed. */ HOWTO (R_AVR_HI8_LDI_PM, /* type */ 9, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -236,8 +325,8 @@ static reloc_howto_type elf_avr_howto_table[] = 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ - /* A high 8 bit absolute relocation of 24 bit program memory address. - For LDI command. */ + /* A low 8 bit absolute relocation of 24 bit program memory address. + For LDI command. Will not be changed when linker stubs are needed. */ HOWTO (R_AVR_HH8_LDI_PM, /* type */ 17, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -251,8 +340,8 @@ static reloc_howto_type elf_avr_howto_table[] = 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ - /* A low 8 bit absolute relocation of a negative 24 bit - program memory address. For LDI command. */ + /* A low 8 bit absolute relocation of 24 bit program memory address. + For LDI command. Will not be changed when linker stubs are needed. */ HOWTO (R_AVR_LO8_LDI_PM_NEG, /* type */ 1, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -266,8 +355,8 @@ static reloc_howto_type elf_avr_howto_table[] = 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ - /* A high 8 bit absolute relocation of a negative 16 bit - program memory address. For LDI command. */ + /* A low 8 bit absolute relocation of 24 bit program memory address. + For LDI command. Will not be changed when linker stubs are needed. */ HOWTO (R_AVR_HI8_LDI_PM_NEG, /* type */ 9, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -281,8 +370,8 @@ static reloc_howto_type elf_avr_howto_table[] = 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ - /* A high 8 bit absolute relocation of a negative 24 bit - program memory address. For LDI command. */ + /* A low 8 bit absolute relocation of 24 bit program memory address. + For LDI command. Will not be changed when linker stubs are needed. */ HOWTO (R_AVR_HH8_LDI_PM_NEG, /* type */ 17, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -382,7 +471,37 @@ static reloc_howto_type elf_avr_howto_table[] = FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE) /* pcrel_offset */ + FALSE), /* pcrel_offset */ + /* A low 8 bit absolute relocation of 24 bit program memory address. + For LDI command. Will be changed when linker stubs are needed. */ + HOWTO (R_AVR_LO8_LDI_GS, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_AVR_LO8_LDI_GS", /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* A low 8 bit absolute relocation of 24 bit program memory address. + For LDI command. Will be changed when linker stubs are needed. */ + HOWTO (R_AVR_HI8_LDI_GS, /* type */ + 9, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_AVR_HI8_LDI_GS", /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE) /* pcrel_offset */ }; /* Map BFD reloc types to AVR ELF reloc types. */ @@ -393,7 +512,7 @@ struct avr_reloc_map unsigned int elf_reloc_val; }; - static const struct avr_reloc_map avr_reloc_map[] = +static const struct avr_reloc_map avr_reloc_map[] = { { BFD_RELOC_NONE, R_AVR_NONE }, { BFD_RELOC_32, R_AVR_32 }, @@ -410,7 +529,9 @@ struct avr_reloc_map { BFD_RELOC_AVR_HH8_LDI_NEG, R_AVR_HH8_LDI_NEG }, { BFD_RELOC_AVR_MS8_LDI_NEG, R_AVR_MS8_LDI_NEG }, { BFD_RELOC_AVR_LO8_LDI_PM, R_AVR_LO8_LDI_PM }, + { BFD_RELOC_AVR_LO8_LDI_GS, R_AVR_LO8_LDI_GS }, { BFD_RELOC_AVR_HI8_LDI_PM, R_AVR_HI8_LDI_PM }, + { BFD_RELOC_AVR_HI8_LDI_GS, R_AVR_HI8_LDI_GS }, { BFD_RELOC_AVR_HH8_LDI_PM, R_AVR_HH8_LDI_PM }, { BFD_RELOC_AVR_LO8_LDI_PM_NEG, R_AVR_LO8_LDI_PM_NEG }, { BFD_RELOC_AVR_HI8_LDI_PM_NEG, R_AVR_HI8_LDI_PM_NEG }, @@ -429,10 +550,116 @@ struct avr_reloc_map that we will never suggest a wrap-around jump during relaxation. The logic of the source code later on assumes that in avr_pc_wrap_around one single bit is set. */ +static bfd_vma avr_pc_wrap_around = 0x10000000; -unsigned int avr_pc_wrap_around = 0x10000000; +/* If this variable holds a value different from zero, the linker relaxation + machine will try to optimize call/ret sequences by a single jump + instruction. This option could be switched off by a linker switch. */ +static int avr_replace_call_ret_sequences = 1; + +/* Initialize an entry in the stub hash table. */ + +static struct bfd_hash_entry * +stub_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) +{ + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (entry == NULL) + { + entry = bfd_hash_allocate (table, + sizeof (struct elf32_avr_stub_hash_entry)); + if (entry == NULL) + return entry; + } + + /* Call the allocation method of the superclass. */ + entry = bfd_hash_newfunc (entry, table, string); + if (entry != NULL) + { + struct elf32_avr_stub_hash_entry *hsh; + + /* Initialize the local fields. */ + hsh = avr_stub_hash_entry (entry); + hsh->stub_offset = 0; + hsh->target_value = 0; + } + + return entry; +} + +/* This function is just a straight passthrough to the real + function in linker.c. Its prupose is so that its address + can be compared inside the avr_link_hash_table macro. */ + +static struct bfd_hash_entry * +elf32_avr_link_hash_newfunc (struct bfd_hash_entry * entry, + struct bfd_hash_table * table, + const char * string) +{ + return _bfd_elf_link_hash_newfunc (entry, table, string); +} + +/* Create the derived linker hash table. The AVR ELF port uses the derived + hash table to keep information specific to the AVR ELF linker (without + using static variables). */ + +static struct bfd_link_hash_table * +elf32_avr_link_hash_table_create (bfd *abfd) +{ + struct elf32_avr_link_hash_table *htab; + bfd_size_type amt = sizeof (*htab); + + htab = bfd_malloc (amt); + if (htab == NULL) + return NULL; + + if (!_bfd_elf_link_hash_table_init (&htab->etab, abfd, + elf32_avr_link_hash_newfunc, + sizeof (struct elf_link_hash_entry))) + { + free (htab); + return NULL; + } + + /* Init the stub hash table too. */ + if (!bfd_hash_table_init (&htab->bstab, stub_hash_newfunc, + sizeof (struct elf32_avr_stub_hash_entry))) + return NULL; + + htab->stub_bfd = NULL; + htab->stub_sec = NULL; + + /* Initialize the address mapping table. */ + htab->amt_stub_offsets = NULL; + htab->amt_destination_addr = NULL; + htab->amt_entry_cnt = 0; + htab->amt_max_entry_cnt = 0; + + return &htab->etab.root; +} + +/* Free the derived linker hash table. */ + +static void +elf32_avr_link_hash_table_free (struct bfd_link_hash_table *btab) +{ + struct elf32_avr_link_hash_table *htab + = (struct elf32_avr_link_hash_table *) btab; + + /* Free the address mapping table. */ + if (htab->amt_stub_offsets != NULL) + free (htab->amt_stub_offsets); + if (htab->amt_destination_addr != NULL) + free (htab->amt_destination_addr); + + bfd_hash_table_free (&htab->bstab); + _bfd_generic_link_hash_table_free (btab); +} /* Calculates the effective distance of a pc relative jump/call. */ + static int avr_relative_distance_considering_wrap_around (unsigned int distance) { @@ -455,10 +682,24 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, for (i = 0; i < sizeof (avr_reloc_map) / sizeof (struct avr_reloc_map); i++) - { - if (avr_reloc_map[i].bfd_reloc_val == code) - return &elf_avr_howto_table[avr_reloc_map[i].elf_reloc_val]; - } + if (avr_reloc_map[i].bfd_reloc_val == code) + return &elf_avr_howto_table[avr_reloc_map[i].elf_reloc_val]; + + return NULL; +} + +static reloc_howto_type * +bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (elf_avr_howto_table) / sizeof (elf_avr_howto_table[0]); + i++) + if (elf_avr_howto_table[i].name != NULL + && strcasecmp (elf_avr_howto_table[i].name, r_name) == 0) + return &elf_avr_howto_table[i]; return NULL; } @@ -477,48 +718,6 @@ avr_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, cache_ptr->howto = &elf_avr_howto_table[r_type]; } -static asection * -elf32_avr_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, - Elf_Internal_Rela *rel, - struct elf_link_hash_entry *h, - Elf_Internal_Sym *sym) -{ - if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; -} - -static bfd_boolean -elf32_avr_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED, - struct bfd_link_info *info ATTRIBUTE_UNUSED, - asection *sec ATTRIBUTE_UNUSED, - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED) -{ - /* We don't use got and plt entries for avr. */ - return TRUE; -} - /* Look through the relocs for a section during the first phase. Since we don't do .gots or .plts, we just need to consider the virtual table relocs for gc. */ @@ -564,20 +763,57 @@ elf32_avr_check_relocs (bfd *abfd, return TRUE; } +static bfd_boolean +avr_stub_is_required_for_16_bit_reloc (bfd_vma relocation) +{ + return (relocation >= 0x020000); +} + +/* Returns the address of the corresponding stub if there is one. + Returns otherwise an address above 0x020000. This function + could also be used, if there is no knowledge on the section where + the destination is found. */ + +static bfd_vma +avr_get_stub_addr (bfd_vma srel, + struct elf32_avr_link_hash_table *htab) +{ + unsigned int index; + bfd_vma stub_sec_addr = + (htab->stub_sec->output_section->vma + + htab->stub_sec->output_offset); + + for (index = 0; index < htab->amt_max_entry_cnt; index ++) + if (htab->amt_destination_addr[index] == srel) + return htab->amt_stub_offsets[index] + stub_sec_addr; + + /* Return an address that could not be reached by 16 bit relocs. */ + return 0x020000; +} + /* Perform a single relocation. By default we use the standard BFD routines, but a few relocs, we have to do them ourselves. */ static bfd_reloc_status_type -avr_final_link_relocate (reloc_howto_type * howto, - bfd * input_bfd, - asection * input_section, - bfd_byte * contents, - Elf_Internal_Rela * rel, - bfd_vma relocation) +avr_final_link_relocate (reloc_howto_type * howto, + bfd * input_bfd, + asection * input_section, + bfd_byte * contents, + Elf_Internal_Rela * rel, + bfd_vma relocation, + struct elf32_avr_link_hash_table * htab) { bfd_reloc_status_type r = bfd_reloc_ok; bfd_vma x; bfd_signed_vma srel; + bfd_signed_vma reloc_addr; + bfd_boolean use_stubs = FALSE; + /* Usually is 0, unless we are generating code for a bootloader. */ + bfd_signed_vma base_addr = htab->vector_base; + + /* Absolute addr of the reloc in the final excecutable. */ + reloc_addr = rel->r_offset + input_section->output_section->vma + + input_section->output_offset; switch (howto->type) { @@ -748,9 +984,31 @@ avr_final_link_relocate (reloc_howto_type * howto, bfd_put_16 (input_bfd, x, contents); break; + case R_AVR_LO8_LDI_GS: + use_stubs = (!htab->no_stubs); + /* Fall through. */ case R_AVR_LO8_LDI_PM: contents += rel->r_offset; srel = (bfd_signed_vma) relocation + rel->r_addend; + + if (use_stubs + && avr_stub_is_required_for_16_bit_reloc (srel - base_addr)) + { + bfd_vma old_srel = srel; + + /* We need to use the address of the stub instead. */ + srel = avr_get_stub_addr (srel, htab); + if (debug_stubs) + printf ("LD: Using jump stub (at 0x%x) with destination 0x%x for " + "reloc at address 0x%x.\n", + (unsigned int) srel, + (unsigned int) old_srel, + (unsigned int) reloc_addr); + + if (avr_stub_is_required_for_16_bit_reloc (srel - base_addr)) + return bfd_reloc_outofrange; + } + if (srel & 1) return bfd_reloc_outofrange; srel = srel >> 1; @@ -759,9 +1017,31 @@ avr_final_link_relocate (reloc_howto_type * howto, bfd_put_16 (input_bfd, x, contents); break; + case R_AVR_HI8_LDI_GS: + use_stubs = (!htab->no_stubs); + /* Fall through. */ case R_AVR_HI8_LDI_PM: contents += rel->r_offset; srel = (bfd_signed_vma) relocation + rel->r_addend; + + if (use_stubs + && avr_stub_is_required_for_16_bit_reloc (srel - base_addr)) + { + bfd_vma old_srel = srel; + + /* We need to use the address of the stub instead. */ + srel = avr_get_stub_addr (srel, htab); + if (debug_stubs) + printf ("LD: Using jump stub (at 0x%x) with destination 0x%x for " + "reloc at address 0x%x.\n", + (unsigned int) srel, + (unsigned int) old_srel, + (unsigned int) reloc_addr); + + if (avr_stub_is_required_for_16_bit_reloc (srel - base_addr)) + return bfd_reloc_outofrange; + } + if (srel & 1) return bfd_reloc_outofrange; srel = srel >> 1; @@ -833,6 +1113,35 @@ avr_final_link_relocate (reloc_howto_type * howto, bfd_put_16 (input_bfd, (bfd_vma) srel & 0xffff, contents+2); break; + case R_AVR_16_PM: + use_stubs = (!htab->no_stubs); + contents += rel->r_offset; + srel = (bfd_signed_vma) relocation + rel->r_addend; + + if (use_stubs + && avr_stub_is_required_for_16_bit_reloc (srel - base_addr)) + { + bfd_vma old_srel = srel; + + /* We need to use the address of the stub instead. */ + srel = avr_get_stub_addr (srel,htab); + if (debug_stubs) + printf ("LD: Using jump stub (at 0x%x) with destination 0x%x for " + "reloc at address 0x%x.\n", + (unsigned int) srel, + (unsigned int) old_srel, + (unsigned int) reloc_addr); + + if (avr_stub_is_required_for_16_bit_reloc (srel - base_addr)) + return bfd_reloc_outofrange; + } + + if (srel & 1) + return bfd_reloc_outofrange; + srel = srel >> 1; + bfd_put_16 (input_bfd, (bfd_vma) srel &0x00ffff, contents); + break; + default: r = _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, @@ -858,9 +1167,7 @@ elf32_avr_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, struct elf_link_hash_entry ** sym_hashes; Elf_Internal_Rela * rel; Elf_Internal_Rela * relend; - - if (info->relocatable) - return TRUE; + struct elf32_avr_link_hash_table * htab = avr_link_hash_table (info); symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -878,7 +1185,6 @@ elf32_avr_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, const char * name; int r_type; - /* This is a final link. */ r_type = ELF32_R_TYPE (rel->r_info); r_symndx = ELF32_R_SYM (rel->r_info); howto = elf_avr_howto_table + ELF32_R_TYPE (rel->r_info); @@ -908,8 +1214,22 @@ elf32_avr_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, name = h->root.root.string; } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + r = avr_final_link_relocate (howto, input_bfd, input_section, - contents, rel, relocation); + contents, rel, relocation, htab); if (r != bfd_reloc_ok) { @@ -990,6 +1310,10 @@ bfd_elf_avr_final_write_processing (bfd *abfd, case bfd_mach_avr5: val = E_AVR_MACH_AVR5; break; + + case bfd_mach_avr6: + val = E_AVR_MACH_AVR6; + break; } elf_elfheader (abfd)->e_machine = EM_AVR; @@ -1032,6 +1356,10 @@ elf32_avr_object_p (bfd *abfd) case E_AVR_MACH_AVR5: e_set = bfd_mach_avr5; break; + + case E_AVR_MACH_AVR6: + e_set = bfd_mach_avr6; + break; } } return bfd_default_set_arch_mach (abfd, bfd_arch_avr, @@ -1039,9 +1367,6 @@ elf32_avr_object_p (bfd *abfd) } -/* Enable debugging printout at stdout with a value of 1. */ -#define DEBUG_RELAX 0 - /* Delete some bytes from a section while changing the size of an instruction. The parameter "addr" denotes the section-relative offset pointing just behind the shrinked instruction. "addr+count" point at the first @@ -1049,9 +1374,9 @@ elf32_avr_object_p (bfd *abfd) static bfd_boolean elf32_avr_relax_delete_bytes (bfd *abfd, - asection *sec, + asection *sec, bfd_vma addr, - int count) + int count) { Elf_Internal_Shdr *symtab_hdr; unsigned int sec_shndx; @@ -1085,10 +1410,9 @@ elf32_avr_relax_delete_bytes (bfd *abfd, (size_t) (toaddr - addr - count)); sec->size -= count; - /* Adjust all the relocs. */ + /* Adjust all the reloc addresses. */ for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++) { - bfd_vma symval; bfd_vma old_reloc_address; bfd_vma shrinked_insn_address; @@ -1101,7 +1425,7 @@ elf32_avr_relax_delete_bytes (bfd *abfd, if ((irel->r_offset > addr && irel->r_offset < toaddr)) { - if (DEBUG_RELAX) + if (debug_relax) printf ("Relocation at address 0x%x needs to be moved.\n" "Old section offset: 0x%x, New section offset: 0x%x \n", (unsigned int) old_reloc_address, @@ -1111,70 +1435,92 @@ elf32_avr_relax_delete_bytes (bfd *abfd, irel->r_offset -= count; } - /* The reloc's own addresses are now ok. However, we need to readjust - the reloc's addend if two conditions are met: - 1.) the reloc is relative to a symbol in this section that - is located in front of the shrinked instruction - 2.) symbol plus addend end up behind the shrinked instruction. - - This should happen only for local symbols that are progmem related. */ - - /* Read this BFD's local symbols if we haven't done so already. */ - if (isymbuf == NULL && symtab_hdr->sh_info != 0) - { - isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; - if (isymbuf == NULL) - isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, - symtab_hdr->sh_info, 0, - NULL, NULL, NULL); - if (isymbuf == NULL) - return FALSE; - } - - /* Get the value of the symbol referred to by the reloc. */ - if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) - { - /* A local symbol. */ - Elf_Internal_Sym *isym; - asection *sym_sec; - - isym = isymbuf + ELF32_R_SYM (irel->r_info); - sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx); - symval = isym->st_value; - /* If the reloc is absolute, it will not have - a symbol or section associated with it. */ - if (sym_sec) - { - symval += sym_sec->output_section->vma - + sym_sec->output_offset; - - if (DEBUG_RELAX) - printf ("Checking if the relocation's " - "addend needs corrections.\n" - "Address of anchor symbol: 0x%x \n" - "Address of relocation target: 0x%x \n" - "Address of relaxed insn: 0x%x \n", - (unsigned int) symval, - (unsigned int) (symval + irel->r_addend), - (unsigned int) shrinked_insn_address); - - if (symval <= shrinked_insn_address - && (symval + irel->r_addend) > shrinked_insn_address) - { - irel->r_addend -= count; - - if (DEBUG_RELAX) - printf ("Anchor symbol and relocation target bracket " - "shrinked insn address.\n" - "Need for new addend : 0x%x\n", - (unsigned int) irel->r_addend); - } - } - /* else ... Reference symbol is absolute. No adjustment needed. */ - } - /* else ... Reference symbol is extern. No need for adjusting the addend. */ } + /* The reloc's own addresses are now ok. However, we need to readjust + the reloc's addend, i.e. the reloc's value if two conditions are met: + 1.) the reloc is relative to a symbol in this section that + is located in front of the shrinked instruction + 2.) symbol plus addend end up behind the shrinked instruction. + + The most common case where this happens are relocs relative to + the section-start symbol. + + This step needs to be done for all of the sections of the bfd. */ + + { + struct bfd_section *isec; + + for (isec = abfd->sections; isec; isec = isec->next) + { + bfd_vma symval; + bfd_vma shrinked_insn_address; + + shrinked_insn_address = (sec->output_section->vma + + sec->output_offset + addr - count); + + irelend = elf_section_data (isec)->relocs + isec->reloc_count; + for (irel = elf_section_data (isec)->relocs; + irel < irelend; + irel++) + { + /* Read this BFD's local symbols if we haven't done + so already. */ + if (isymbuf == NULL && symtab_hdr->sh_info != 0) + { + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) + return FALSE; + } + + /* Get the value of the symbol referred to by the reloc. */ + if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) + { + /* A local symbol. */ + Elf_Internal_Sym *isym; + asection *sym_sec; + + isym = isymbuf + ELF32_R_SYM (irel->r_info); + sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx); + symval = isym->st_value; + /* If the reloc is absolute, it will not have + a symbol or section associated with it. */ + if (sym_sec == sec) + { + symval += sym_sec->output_section->vma + + sym_sec->output_offset; + + if (debug_relax) + printf ("Checking if the relocation's " + "addend needs corrections.\n" + "Address of anchor symbol: 0x%x \n" + "Address of relocation target: 0x%x \n" + "Address of relaxed insn: 0x%x \n", + (unsigned int) symval, + (unsigned int) (symval + irel->r_addend), + (unsigned int) shrinked_insn_address); + + if (symval <= shrinked_insn_address + && (symval + irel->r_addend) > shrinked_insn_address) + { + irel->r_addend -= count; + + if (debug_relax) + printf ("Relocation's addend needed to be fixed \n"); + } + } + /* else...Reference symbol is absolute. No adjustment needed. */ + } + /* else...Reference symbol is extern. No need for adjusting + the addend. */ + } + } + } + /* Adjust the local symbols defined in this section. */ isym = (Elf_Internal_Sym *) symtab_hdr->contents; isymend = isym + symtab_hdr->sh_info; @@ -1238,7 +1584,7 @@ elf32_avr_relax_delete_bytes (bfd *abfd, contains 4-byte jump instructions whose relative offset must not be changed. */ -static bfd_boolean +static bfd_boolean elf32_avr_relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info, @@ -1251,10 +1597,39 @@ elf32_avr_relax_section (bfd *abfd, Elf_Internal_Sym *isymbuf = NULL; static asection *last_input_section = NULL; static Elf_Internal_Rela *last_reloc = NULL; + struct elf32_avr_link_hash_table *htab; + + htab = avr_link_hash_table (link_info); + if (htab == NULL) + return FALSE; /* Assume nothing changes. */ *again = FALSE; + if ((!htab->no_stubs) && (sec == htab->stub_sec)) + { + /* We are just relaxing the stub section. + Let's calculate the size needed again. */ + bfd_size_type last_estimated_stub_section_size = htab->stub_sec->size; + + if (debug_relax) + printf ("Relaxing the stub section. Size prior to this pass: %i\n", + (int) last_estimated_stub_section_size); + + elf32_avr_size_stubs (htab->stub_sec->output_section->owner, + link_info, FALSE); + + /* Check if the number of trampolines changed. */ + if (last_estimated_stub_section_size != htab->stub_sec->size) + *again = TRUE; + + if (debug_relax) + printf ("Size of stub section after this pass: %i\n", + (int) htab->stub_sec->size); + + return TRUE; + } + /* We don't have to do anything for a relocatable link, if this section does not have relocs, or if this is not a code section. */ @@ -1421,7 +1796,7 @@ elf32_avr_relax_section (bfd *abfd, unsigned char code_msb; unsigned char code_lsb; - if (DEBUG_RELAX) + if (debug_relax) printf ("shrinking jump/call instruction at address 0x%x" " in section %s\n\n", (int) dot, sec->name); @@ -1496,8 +1871,9 @@ elf32_avr_relax_section (bfd *abfd, + sec->output_offset + irel->r_offset); /* Here we look for rcall/ret or call/ret sequences that could be - safely replaced by rjmp/ret or jmp/ret */ - if (0xd0 == (code_msb & 0xf0)) + safely replaced by rjmp/ret or jmp/ret. */ + if (((code_msb & 0xf0) == 0xd0) + && avr_replace_call_ret_sequences) { /* This insn is a rcall. */ unsigned char next_insn_msb = 0; @@ -1517,7 +1893,7 @@ elf32_avr_relax_section (bfd *abfd, into a rjmp instruction. */ code_msb &= 0xef; bfd_put_8 (abfd, code_msb, contents + irel->r_offset + 1); - if (DEBUG_RELAX) + if (debug_relax) printf ("converted rcall/ret sequence at address 0x%x" " into rjmp/ret sequence. Section is %s\n\n", (int) dot, sec->name); @@ -1526,7 +1902,8 @@ elf32_avr_relax_section (bfd *abfd, } } else if ((0x94 == (code_msb & 0xfe)) - && (0x0e == (code_lsb & 0x0e))) + && (0x0e == (code_lsb & 0x0e)) + && avr_replace_call_ret_sequences) { /* This insn is a call. */ unsigned char next_insn_msb = 0; @@ -1547,7 +1924,7 @@ elf32_avr_relax_section (bfd *abfd, code_lsb &= 0xfd; bfd_put_8 (abfd, code_lsb, contents + irel->r_offset); - if (DEBUG_RELAX) + if (debug_relax) printf ("converted call/ret sequence at address 0x%x" " into jmp/ret sequence. Section is %s\n\n", (int) dot, sec->name); @@ -1590,10 +1967,10 @@ elf32_avr_relax_section (bfd *abfd, address_of_ret = dot + insn_size; - if (DEBUG_RELAX && (insn_size == 2)) + if (debug_relax && (insn_size == 2)) printf ("found rjmp / ret sequence at address 0x%x\n", (int) dot); - if (DEBUG_RELAX && (insn_size == 4)) + if (debug_relax && (insn_size == 4)) printf ("found jmp / ret sequence at address 0x%x\n", (int) dot); @@ -1630,7 +2007,7 @@ elf32_avr_relax_section (bfd *abfd, there_is_preceeding_non_skip_insn = 0; if (there_is_preceeding_non_skip_insn == 0) - if (DEBUG_RELAX) + if (debug_relax) printf ("preceeding skip insn prevents deletion of" " ret insn at addr 0x%x in section %s\n", (int) dot + 2, sec->name); @@ -1666,7 +2043,7 @@ elf32_avr_relax_section (bfd *abfd, && isym->st_shndx == sec_shndx) { deleting_ret_is_safe = 0; - if (DEBUG_RELAX) + if (debug_relax) printf ("local label prevents deletion of ret " "insn at address 0x%x\n", (int) dot + insn_size); @@ -1695,7 +2072,7 @@ elf32_avr_relax_section (bfd *abfd, && sym_hash->root.u.def.value == section_offset_of_ret_insn) { deleting_ret_is_safe = 0; - if (DEBUG_RELAX) + if (debug_relax) printf ("global label prevents deletion of " "ret insn at address 0x%x\n", (int) dot + insn_size); @@ -1772,7 +2149,7 @@ elf32_avr_relax_section (bfd *abfd, if (address_of_ret == reloc_target) { deleting_ret_is_safe = 0; - if (DEBUG_RELAX) + if (debug_relax) printf ("ret from " "rjmp/jmp ret sequence at address" " 0x%x could not be deleted. ret" @@ -1784,7 +2161,7 @@ elf32_avr_relax_section (bfd *abfd, if (deleting_ret_is_safe) { - if (DEBUG_RELAX) + if (debug_relax) printf ("unreachable ret instruction " "at address 0x%x deleted.\n", (int) dot + insn_size); @@ -1952,6 +2329,625 @@ elf32_avr_get_relocated_section_contents (bfd *output_bfd, } +/* Determines the hash entry name for a particular reloc. It consists of + the identifier of the symbol section and the added reloc addend and + symbol offset relative to the section the symbol is attached to. */ + +static char * +avr_stub_name (const asection *symbol_section, + const bfd_vma symbol_offset, + const Elf_Internal_Rela *rela) +{ + char *stub_name; + bfd_size_type len; + + len = 8 + 1 + 8 + 1 + 1; + stub_name = bfd_malloc (len); + + sprintf (stub_name, "%08x+%08x", + symbol_section->id & 0xffffffff, + (unsigned int) ((rela->r_addend & 0xffffffff) + symbol_offset)); + + return stub_name; +} + + +/* Add a new stub entry to the stub hash. Not all fields of the new + stub entry are initialised. */ + +static struct elf32_avr_stub_hash_entry * +avr_add_stub (const char *stub_name, + struct elf32_avr_link_hash_table *htab) +{ + struct elf32_avr_stub_hash_entry *hsh; + + /* Enter this entry into the linker stub hash table. */ + hsh = avr_stub_hash_lookup (&htab->bstab, stub_name, TRUE, FALSE); + + if (hsh == NULL) + { + (*_bfd_error_handler) (_("%B: cannot create stub entry %s"), + NULL, stub_name); + return NULL; + } + + hsh->stub_offset = 0; + return hsh; +} + +/* We assume that there is already space allocated for the stub section + contents and that before building the stubs the section size is + initialized to 0. We assume that within the stub hash table entry, + the absolute position of the jmp target has been written in the + target_value field. We write here the offset of the generated jmp insn + relative to the trampoline section start to the stub_offset entry in + the stub hash table entry. */ + +static bfd_boolean +avr_build_one_stub (struct bfd_hash_entry *bh, void *in_arg) +{ + struct elf32_avr_stub_hash_entry *hsh; + struct bfd_link_info *info; + struct elf32_avr_link_hash_table *htab; + bfd *stub_bfd; + bfd_byte *loc; + bfd_vma target; + bfd_vma starget; + + /* Basic opcode */ + bfd_vma jmp_insn = 0x0000940c; + + /* Massage our args to the form they really have. */ + hsh = avr_stub_hash_entry (bh); + + if (!hsh->is_actually_needed) + return TRUE; + + info = (struct bfd_link_info *) in_arg; + + htab = avr_link_hash_table (info); + if (htab == NULL) + return FALSE; + + target = hsh->target_value; + + /* Make a note of the offset within the stubs for this entry. */ + hsh->stub_offset = htab->stub_sec->size; + loc = htab->stub_sec->contents + hsh->stub_offset; + + stub_bfd = htab->stub_sec->owner; + + if (debug_stubs) + printf ("Building one Stub. Address: 0x%x, Offset: 0x%x\n", + (unsigned int) target, + (unsigned int) hsh->stub_offset); + + /* We now have to add the information on the jump target to the bare + opcode bits already set in jmp_insn. */ + + /* Check for the alignment of the address. */ + if (target & 1) + return FALSE; + + starget = target >> 1; + jmp_insn |= ((starget & 0x10000) | ((starget << 3) & 0x1f00000)) >> 16; + bfd_put_16 (stub_bfd, jmp_insn, loc); + bfd_put_16 (stub_bfd, (bfd_vma) starget & 0xffff, loc + 2); + + htab->stub_sec->size += 4; + + /* Now add the entries in the address mapping table if there is still + space left. */ + { + unsigned int nr; + + nr = htab->amt_entry_cnt + 1; + if (nr <= htab->amt_max_entry_cnt) + { + htab->amt_entry_cnt = nr; + + htab->amt_stub_offsets[nr - 1] = hsh->stub_offset; + htab->amt_destination_addr[nr - 1] = target; + } + } + + return TRUE; +} + +static bfd_boolean +avr_mark_stub_not_to_be_necessary (struct bfd_hash_entry *bh, + void *in_arg) +{ + struct elf32_avr_stub_hash_entry *hsh; + struct elf32_avr_link_hash_table *htab; + + htab = in_arg; + hsh = avr_stub_hash_entry (bh); + hsh->is_actually_needed = FALSE; + + return TRUE; +} + +static bfd_boolean +avr_size_one_stub (struct bfd_hash_entry *bh, void *in_arg) +{ + struct elf32_avr_stub_hash_entry *hsh; + struct elf32_avr_link_hash_table *htab; + int size; + + /* Massage our args to the form they really have. */ + hsh = avr_stub_hash_entry (bh); + htab = in_arg; + + if (hsh->is_actually_needed) + size = 4; + else + size = 0; + + htab->stub_sec->size += size; + return TRUE; +} + +void +elf32_avr_setup_params (struct bfd_link_info *info, + bfd *avr_stub_bfd, + asection *avr_stub_section, + bfd_boolean no_stubs, + bfd_boolean deb_stubs, + bfd_boolean deb_relax, + bfd_vma pc_wrap_around, + bfd_boolean call_ret_replacement) +{ + struct elf32_avr_link_hash_table *htab = avr_link_hash_table (info); + + if (htab == NULL) + return; + htab->stub_sec = avr_stub_section; + htab->stub_bfd = avr_stub_bfd; + htab->no_stubs = no_stubs; + + debug_relax = deb_relax; + debug_stubs = deb_stubs; + avr_pc_wrap_around = pc_wrap_around; + avr_replace_call_ret_sequences = call_ret_replacement; +} + + +/* Set up various things so that we can make a list of input sections + for each output section included in the link. Returns -1 on error, + 0 when no stubs will be needed, and 1 on success. It also sets + information on the stubs bfd and the stub section in the info + struct. */ + +int +elf32_avr_setup_section_lists (bfd *output_bfd, + struct bfd_link_info *info) +{ + bfd *input_bfd; + unsigned int bfd_count; + int top_id, top_index; + asection *section; + asection **input_list, **list; + bfd_size_type amt; + struct elf32_avr_link_hash_table *htab = avr_link_hash_table(info); + + if (htab == NULL || htab->no_stubs) + return 0; + + /* Count the number of input BFDs and find the top input section id. */ + for (input_bfd = info->input_bfds, bfd_count = 0, top_id = 0; + input_bfd != NULL; + input_bfd = input_bfd->link_next) + { + bfd_count += 1; + for (section = input_bfd->sections; + section != NULL; + section = section->next) + if (top_id < section->id) + top_id = section->id; + } + + htab->bfd_count = bfd_count; + + /* We can't use output_bfd->section_count here to find the top output + section index as some sections may have been removed, and + strip_excluded_output_sections doesn't renumber the indices. */ + for (section = output_bfd->sections, top_index = 0; + section != NULL; + section = section->next) + if (top_index < section->index) + top_index = section->index; + + htab->top_index = top_index; + amt = sizeof (asection *) * (top_index + 1); + input_list = bfd_malloc (amt); + htab->input_list = input_list; + if (input_list == NULL) + return -1; + + /* For sections we aren't interested in, mark their entries with a + value we can check later. */ + list = input_list + top_index; + do + *list = bfd_abs_section_ptr; + while (list-- != input_list); + + for (section = output_bfd->sections; + section != NULL; + section = section->next) + if ((section->flags & SEC_CODE) != 0) + input_list[section->index] = NULL; + + return 1; +} + + +/* Read in all local syms for all input bfds, and create hash entries + for export stubs if we are building a multi-subspace shared lib. + Returns -1 on error, 0 otherwise. */ + +static int +get_local_syms (bfd *input_bfd, struct bfd_link_info *info) +{ + unsigned int bfd_indx; + Elf_Internal_Sym *local_syms, **all_local_syms; + struct elf32_avr_link_hash_table *htab = avr_link_hash_table (info); + + if (htab == NULL) + return -1; + + /* We want to read in symbol extension records only once. To do this + we need to read in the local symbols in parallel and save them for + later use; so hold pointers to the local symbols in an array. */ + bfd_size_type amt = sizeof (Elf_Internal_Sym *) * htab->bfd_count; + all_local_syms = bfd_zmalloc (amt); + htab->all_local_syms = all_local_syms; + if (all_local_syms == NULL) + return -1; + + /* Walk over all the input BFDs, swapping in local symbols. + If we are creating a shared library, create hash entries for the + export stubs. */ + for (bfd_indx = 0; + input_bfd != NULL; + input_bfd = input_bfd->link_next, bfd_indx++) + { + Elf_Internal_Shdr *symtab_hdr; + + /* We'll need the symbol table in a second. */ + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + if (symtab_hdr->sh_info == 0) + continue; + + /* We need an array of the local symbols attached to the input bfd. */ + local_syms = (Elf_Internal_Sym *) symtab_hdr->contents; + if (local_syms == NULL) + { + local_syms = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + /* Cache them for elf_link_input_bfd. */ + symtab_hdr->contents = (unsigned char *) local_syms; + } + if (local_syms == NULL) + return -1; + + all_local_syms[bfd_indx] = local_syms; + } + + return 0; +} + +#define ADD_DUMMY_STUBS_FOR_DEBUGGING 0 + +bfd_boolean +elf32_avr_size_stubs (bfd *output_bfd, + struct bfd_link_info *info, + bfd_boolean is_prealloc_run) +{ + struct elf32_avr_link_hash_table *htab; + int stub_changed = 0; + + htab = avr_link_hash_table (info); + if (htab == NULL) + return FALSE; + + /* At this point we initialize htab->vector_base + To the start of the text output section. */ + htab->vector_base = htab->stub_sec->output_section->vma; + + if (get_local_syms (info->input_bfds, info)) + { + if (htab->all_local_syms) + goto error_ret_free_local; + return FALSE; + } + + if (ADD_DUMMY_STUBS_FOR_DEBUGGING) + { + struct elf32_avr_stub_hash_entry *test; + + test = avr_add_stub ("Hugo",htab); + test->target_value = 0x123456; + test->stub_offset = 13; + + test = avr_add_stub ("Hugo2",htab); + test->target_value = 0x84210; + test->stub_offset = 14; + } + + while (1) + { + bfd *input_bfd; + unsigned int bfd_indx; + + /* We will have to re-generate the stub hash table each time anything + in memory has changed. */ + + bfd_hash_traverse (&htab->bstab, avr_mark_stub_not_to_be_necessary, htab); + for (input_bfd = info->input_bfds, bfd_indx = 0; + input_bfd != NULL; + input_bfd = input_bfd->link_next, bfd_indx++) + { + Elf_Internal_Shdr *symtab_hdr; + asection *section; + Elf_Internal_Sym *local_syms; + + /* We'll need the symbol table in a second. */ + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + if (symtab_hdr->sh_info == 0) + continue; + + local_syms = htab->all_local_syms[bfd_indx]; + + /* Walk over each section attached to the input bfd. */ + for (section = input_bfd->sections; + section != NULL; + section = section->next) + { + Elf_Internal_Rela *internal_relocs, *irelaend, *irela; + + /* If there aren't any relocs, then there's nothing more + to do. */ + if ((section->flags & SEC_RELOC) == 0 + || section->reloc_count == 0) + continue; + + /* If this section is a link-once section that will be + discarded, then don't create any stubs. */ + if (section->output_section == NULL + || section->output_section->owner != output_bfd) + continue; + + /* Get the relocs. */ + internal_relocs + = _bfd_elf_link_read_relocs (input_bfd, section, NULL, NULL, + info->keep_memory); + if (internal_relocs == NULL) + goto error_ret_free_local; + + /* Now examine each relocation. */ + irela = internal_relocs; + irelaend = irela + section->reloc_count; + for (; irela < irelaend; irela++) + { + unsigned int r_type, r_indx; + struct elf32_avr_stub_hash_entry *hsh; + asection *sym_sec; + bfd_vma sym_value; + bfd_vma destination; + struct elf_link_hash_entry *hh; + char *stub_name; + + r_type = ELF32_R_TYPE (irela->r_info); + r_indx = ELF32_R_SYM (irela->r_info); + + /* Only look for 16 bit GS relocs. No other reloc will need a + stub. */ + if (!((r_type == R_AVR_16_PM) + || (r_type == R_AVR_LO8_LDI_GS) + || (r_type == R_AVR_HI8_LDI_GS))) + continue; + + /* Now determine the call target, its name, value, + section. */ + sym_sec = NULL; + sym_value = 0; + destination = 0; + hh = NULL; + if (r_indx < symtab_hdr->sh_info) + { + /* It's a local symbol. */ + Elf_Internal_Sym *sym; + Elf_Internal_Shdr *hdr; + + sym = local_syms + r_indx; + hdr = elf_elfsections (input_bfd)[sym->st_shndx]; + sym_sec = hdr->bfd_section; + if (ELF_ST_TYPE (sym->st_info) != STT_SECTION) + sym_value = sym->st_value; + destination = (sym_value + irela->r_addend + + sym_sec->output_offset + + sym_sec->output_section->vma); + } + else + { + /* It's an external symbol. */ + int e_indx; + + e_indx = r_indx - symtab_hdr->sh_info; + hh = elf_sym_hashes (input_bfd)[e_indx]; + + while (hh->root.type == bfd_link_hash_indirect + || hh->root.type == bfd_link_hash_warning) + hh = (struct elf_link_hash_entry *) + (hh->root.u.i.link); + + if (hh->root.type == bfd_link_hash_defined + || hh->root.type == bfd_link_hash_defweak) + { + sym_sec = hh->root.u.def.section; + sym_value = hh->root.u.def.value; + if (sym_sec->output_section != NULL) + destination = (sym_value + irela->r_addend + + sym_sec->output_offset + + sym_sec->output_section->vma); + } + else if (hh->root.type == bfd_link_hash_undefweak) + { + if (! info->shared) + continue; + } + else if (hh->root.type == bfd_link_hash_undefined) + { + if (! (info->unresolved_syms_in_objects == RM_IGNORE + && (ELF_ST_VISIBILITY (hh->other) + == STV_DEFAULT))) + continue; + } + else + { + bfd_set_error (bfd_error_bad_value); + + error_ret_free_internal: + if (elf_section_data (section)->relocs == NULL) + free (internal_relocs); + goto error_ret_free_local; + } + } + + if (! avr_stub_is_required_for_16_bit_reloc + (destination - htab->vector_base)) + { + if (!is_prealloc_run) + /* We are having a reloc that does't need a stub. */ + continue; + + /* We don't right now know if a stub will be needed. + Let's rather be on the safe side. */ + } + + /* Get the name of this stub. */ + stub_name = avr_stub_name (sym_sec, sym_value, irela); + + if (!stub_name) + goto error_ret_free_internal; + + + hsh = avr_stub_hash_lookup (&htab->bstab, + stub_name, + FALSE, FALSE); + if (hsh != NULL) + { + /* The proper stub has already been created. Mark it + to be used and write the possibly changed destination + value. */ + hsh->is_actually_needed = TRUE; + hsh->target_value = destination; + free (stub_name); + continue; + } + + hsh = avr_add_stub (stub_name, htab); + if (hsh == NULL) + { + free (stub_name); + goto error_ret_free_internal; + } + + hsh->is_actually_needed = TRUE; + hsh->target_value = destination; + + if (debug_stubs) + printf ("Adding stub with destination 0x%x to the" + " hash table.\n", (unsigned int) destination); + if (debug_stubs) + printf ("(Pre-Alloc run: %i)\n", is_prealloc_run); + + stub_changed = TRUE; + } + + /* We're done with the internal relocs, free them. */ + if (elf_section_data (section)->relocs == NULL) + free (internal_relocs); + } + } + + /* Re-Calculate the number of needed stubs. */ + htab->stub_sec->size = 0; + bfd_hash_traverse (&htab->bstab, avr_size_one_stub, htab); + + if (!stub_changed) + break; + + stub_changed = FALSE; + } + + free (htab->all_local_syms); + return TRUE; + + error_ret_free_local: + free (htab->all_local_syms); + return FALSE; +} + + +/* Build all the stubs associated with the current output file. The + stubs are kept in a hash table attached to the main linker hash + table. We also set up the .plt entries for statically linked PIC + functions here. This function is called via hppaelf_finish in the + linker. */ + +bfd_boolean +elf32_avr_build_stubs (struct bfd_link_info *info) +{ + asection *stub_sec; + struct bfd_hash_table *table; + struct elf32_avr_link_hash_table *htab; + bfd_size_type total_size = 0; + + htab = avr_link_hash_table (info); + if (htab == NULL) + return FALSE; + + /* In case that there were several stub sections: */ + for (stub_sec = htab->stub_bfd->sections; + stub_sec != NULL; + stub_sec = stub_sec->next) + { + bfd_size_type size; + + /* Allocate memory to hold the linker stubs. */ + size = stub_sec->size; + total_size += size; + + stub_sec->contents = bfd_zalloc (htab->stub_bfd, size); + if (stub_sec->contents == NULL && size != 0) + return FALSE; + stub_sec->size = 0; + } + + /* Allocate memory for the adress mapping table. */ + htab->amt_entry_cnt = 0; + htab->amt_max_entry_cnt = total_size / 4; + htab->amt_stub_offsets = bfd_malloc (sizeof (bfd_vma) + * htab->amt_max_entry_cnt); + htab->amt_destination_addr = bfd_malloc (sizeof (bfd_vma) + * htab->amt_max_entry_cnt ); + + if (debug_stubs) + printf ("Allocating %i entries in the AMT\n", htab->amt_max_entry_cnt); + + /* Build the stubs as directed by the stub hash table. */ + table = &htab->bstab; + bfd_hash_traverse (table, avr_build_one_stub, info); + + if (debug_stubs) + printf ("Final Stub section Size: %i\n", (int) htab->stub_sec->size); + + return TRUE; +} + #define ELF_ARCH bfd_arch_avr #define ELF_MACHINE_CODE EM_AVR #define ELF_MACHINE_ALT1 EM_AVR_OLD @@ -1960,11 +2956,12 @@ elf32_avr_get_relocated_section_contents (bfd *output_bfd, #define TARGET_LITTLE_SYM bfd_elf32_avr_vec #define TARGET_LITTLE_NAME "elf32-avr" +#define bfd_elf32_bfd_link_hash_table_create elf32_avr_link_hash_table_create +#define bfd_elf32_bfd_link_hash_table_free elf32_avr_link_hash_table_free + #define elf_info_to_howto avr_info_to_howto_rela #define elf_info_to_howto_rel NULL #define elf_backend_relocate_section elf32_avr_relocate_section -#define elf_backend_gc_mark_hook elf32_avr_gc_mark_hook -#define elf_backend_gc_sweep_hook elf32_avr_gc_sweep_hook #define elf_backend_check_relocs elf32_avr_check_relocs #define elf_backend_can_gc_sections 1 #define elf_backend_rela_normal 1 diff --git a/bfd/elf32-avr.h b/bfd/elf32-avr.h new file mode 100644 index 00000000000..4b9035fa475 --- /dev/null +++ b/bfd/elf32-avr.h @@ -0,0 +1,38 @@ +/* AVR-specific support for 32-bit ELF. + Copyright 2006 Free Software Foundation, Inc. + + Written by Bjoern Haase + + This file is part of BFD, the Binary File Descriptor library. + + 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 2 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. */ + + +/* These four functions will be called from the ld back-end. */ + +extern void +elf32_avr_setup_params (struct bfd_link_info *, bfd *, asection *, + bfd_boolean, bfd_boolean, bfd_boolean, + bfd_vma, bfd_boolean); + +extern int +elf32_avr_setup_section_lists (bfd *, struct bfd_link_info *); + +extern bfd_boolean +elf32_avr_size_stubs (bfd *, struct bfd_link_info *, bfd_boolean); + +extern bfd_boolean +elf32_avr_build_stubs (struct bfd_link_info *); diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c index d5a81dbc605..bf8ed86882e 100644 --- a/bfd/elf32-bfin.c +++ b/bfd/elf32-bfin.c @@ -1,5 +1,5 @@ /* ADI Blackfin BFD support for 32-bit ELF. - Copyright 2005, 2006 Free Software Foundation, Inc. + Copyright 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/bfin.h" @@ -1057,8 +1057,8 @@ bfin_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, else cache_ptr->howto = (reloc_howto_type *) NULL; - } + /* Given a BFD reloc type, return the howto. */ static reloc_howto_type * bfin_bfd_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, @@ -1078,8 +1078,33 @@ bfin_bfd_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, return &bfin_gnuext_howto_table [r_type - BFIN_GNUEXT_RELOC_MIN]; return (reloc_howto_type *) NULL; - } + +static reloc_howto_type * +bfin_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (bfin_howto_table) + / sizeof (bfin_howto_table[0])); + i++) + if (bfin_howto_table[i].name != NULL + && strcasecmp (bfin_howto_table[i].name, r_name) == 0) + return &bfin_howto_table[i]; + + for (i = 0; + i < (sizeof (bfin_gnuext_howto_table) + / sizeof (bfin_gnuext_howto_table[0])); + i++) + if (bfin_gnuext_howto_table[i].name != NULL + && strcasecmp (bfin_gnuext_howto_table[i].name, r_name) == 0) + return &bfin_gnuext_howto_table[i]; + + return NULL; +} + /* Given a bfin relocation type, return the howto. */ static reloc_howto_type * bfin_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, @@ -1092,7 +1117,6 @@ bfin_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, return &bfin_gnuext_howto_table [r_type - BFIN_GNUEXT_RELOC_MIN]; return (reloc_howto_type *) NULL; - } /* Return TRUE if the name is a local label. @@ -1961,7 +1985,7 @@ bfin_check_relocs (bfd * abfd, case R_got: if (h != NULL - && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0) + && strcmp (h->root.root.string, "__GLOBAL_OFFSET_TABLE_") == 0) break; /* Fall through. */ @@ -1984,15 +2008,12 @@ bfin_check_relocs (bfd * abfd, srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); if (srelgot == NULL) { - srelgot = bfd_make_section (dynobj, ".rela.got"); + flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY | SEC_LINKER_CREATED + | SEC_READONLY); + srelgot = bfd_make_section_with_flags (dynobj, ".rela.got", + flags); if (srelgot == NULL - || !bfd_set_section_flags (dynobj, srelgot, - (SEC_ALLOC - | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_LINKER_CREATED - | SEC_READONLY)) || !bfd_set_section_alignment (dynobj, srelgot, 2)) return FALSE; } @@ -2112,9 +2133,6 @@ bfinfdpic_relocate_section (bfd * output_bfd, check_segment[2]; int silence_segment_error = !(info->shared || info->pie); - if (info->relocatable) - return TRUE; - symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); relend = relocs + input_section->reloc_count; @@ -2155,7 +2173,6 @@ bfinfdpic_relocate_section (bfd * output_bfd, || r_type == R_BFIN_GNU_VTENTRY) continue; - /* This is a final link. */ r_symndx = ELF32_R_SYM (rel->r_info); howto = bfin_reloc_type_lookup (input_bfd, r_type); if (howto == NULL) @@ -2180,50 +2197,39 @@ bfinfdpic_relocate_section (bfd * output_bfd, } else { - h = sym_hashes [r_symndx - symtab_hdr->sh_info]; + bfd_boolean warned; + bfd_boolean unresolved_reloc; - while (h->root.type == bfd_link_hash_indirect - || h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - - name = h->root.root.string; - - if ((h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - && ! BFINFDPIC_SYM_LOCAL (info, h)) - { - sec = NULL; - relocation = 0; - } - else - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - { - sec = h->root.u.def.section; - relocation = (h->root.u.def.value - + sec->output_section->vma - + sec->output_offset); - } - else if (h->root.type == bfd_link_hash_undefweak) - { - relocation = 0; - } - else if (info->unresolved_syms_in_objects == RM_IGNORE - && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - relocation = 0; - else - { - if (! ((*info->callbacks->undefined_symbol) - (info, h->root.root.string, input_bfd, - input_section, rel->r_offset, - (info->unresolved_syms_in_objects == RM_GENERATE_ERROR - || ELF_ST_VISIBILITY (h->other))))) - return FALSE; - relocation = 0; - } + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, + unresolved_reloc, warned); osec = sec; } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + + if (h != NULL + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && !BFINFDPIC_SYM_LOCAL (info, h)) + { + osec = sec = NULL; + relocation = 0; + } + switch (r_type) { case R_pcrel24: @@ -2435,6 +2441,8 @@ bfinfdpic_relocate_section (bfd * output_bfd, input_section->output_section) & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD)) { + bfd_vma offset; + if (_bfinfdpic_osec_readonly_p (output_bfd, input_section ->output_section)) @@ -2445,15 +2453,23 @@ bfinfdpic_relocate_section (bfd * output_bfd, name, input_bfd, input_section, rel->r_offset); return FALSE; } - _bfinfdpic_add_dyn_reloc (output_bfd, - bfinfdpic_gotrel_section (info), - _bfd_elf_section_offset - (output_bfd, info, - input_section, rel->r_offset) - + input_section - ->output_section->vma - + input_section->output_offset, - r_type, dynindx, addend, picrel); + offset = _bfd_elf_section_offset (output_bfd, info, + input_section, rel->r_offset); + /* Only output a reloc for a not deleted entry. */ + if (offset >= (bfd_vma) -2) + _bfinfdpic_add_dyn_reloc (output_bfd, + bfinfdpic_gotrel_section (info), + 0, + R_unused0, + dynindx, addend, picrel); + else + _bfinfdpic_add_dyn_reloc (output_bfd, + bfinfdpic_gotrel_section (info), + offset + input_section + ->output_section->vma + + input_section->output_offset, + r_type, + dynindx, addend, picrel); } else addend += bfinfdpic_got_section (info)->output_section->vma; @@ -2824,9 +2840,6 @@ bfin_relocate_section (bfd * output_bfd, Elf_Internal_Rela *relend; int i = 0; - if (info->relocatable) - return TRUE; - dynobj = elf_hash_table (info)->dynobj; symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -2883,13 +2896,27 @@ bfin_relocate_section (bfd * output_bfd, else { bfd_boolean warned; - h = NULL; + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, r_symndx, symtab_hdr, sym_hashes, h, sec, relocation, unresolved_reloc, warned); } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + address = rel->r_offset; /* Then, process normally. */ @@ -2903,7 +2930,7 @@ bfin_relocate_section (bfd * output_bfd, /* Relocation is to the address of the entry for this symbol in the global offset table. */ if (h != NULL - && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0) + && strcmp (h->root.root.string, "__GLOBAL_OFFSET_TABLE_") == 0) goto do_default; /* Fall through. */ /* Relocation is the offset of the entry for this symbol in @@ -3099,51 +3126,20 @@ bfin_relocate_section (bfd * output_bfd, static asection * bfin_gc_mark_hook (asection * sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, + struct bfd_link_info *info, Elf_Internal_Rela * rel, struct elf_link_hash_entry *h, Elf_Internal_Sym * sym) { if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_BFIN_GNU_VTINHERIT: + case R_BFIN_GNU_VTENTRY: + return NULL; + } - case R_BFIN_GNU_VTINHERIT: - case R_BFIN_GNU_VTENTRY: - break; - - default: - switch (h->root.type) - { - default: - break; - - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; -} - - -/* Update the got entry reference counts for the section being removed. */ - -static bfd_boolean -bfinfdpic_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED, - struct bfd_link_info *info ATTRIBUTE_UNUSED, - asection *sec ATTRIBUTE_UNUSED, - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED) -{ - return TRUE; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Update the got entry reference counts for the section being removed. */ @@ -3291,7 +3287,7 @@ _bfin_create_got_section (bfd *abfd, struct bfd_link_info *info) (or .got.plt) section. We don't do this in the linker script because we don't want to define the symbol if we are not creating a global offset table. */ - h = _bfd_elf_define_linkage_sym (abfd, info, s, "_GLOBAL_OFFSET_TABLE_"); + h = _bfd_elf_define_linkage_sym (abfd, info, s, "__GLOBAL_OFFSET_TABLE_"); elf_hash_table (info)->hgot = h; if (h == NULL) return FALSE; @@ -3370,9 +3366,8 @@ elf32_bfinfdpic_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) if (bed->plt_readonly) pltflags |= SEC_READONLY; - s = bfd_make_section (abfd, ".plt"); + s = bfd_make_section_with_flags (abfd, ".plt", pltflags); if (s == NULL - || ! bfd_set_section_flags (abfd, s, pltflags) || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment)) return FALSE; /* Blackfin-specific: remember it. */ @@ -3386,7 +3381,7 @@ elf32_bfinfdpic_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) struct bfd_link_hash_entry *bh = NULL; if (! (_bfd_generic_link_add_one_symbol - (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s, 0, NULL, + (info, abfd, "__PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s, 0, NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh))) return FALSE; h = (struct elf_link_hash_entry *) bh; @@ -3399,9 +3394,8 @@ elf32_bfinfdpic_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) } /* Blackfin-specific: we want rel relocations for the plt. */ - s = bfd_make_section (abfd, ".rel.plt"); + s = bfd_make_section_with_flags (abfd, ".rel.plt", flags | SEC_READONLY); if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) return FALSE; /* Blackfin-specific: remember it. */ @@ -3425,9 +3419,9 @@ elf32_bfinfdpic_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) image and use a R_*_COPY reloc to tell the dynamic linker to initialize them at run time. The linker script puts the .dynbss section into the .bss section of the final image. */ - s = bfd_make_section (abfd, ".dynbss"); - if (s == NULL - || ! bfd_set_section_flags (abfd, s, SEC_ALLOC | SEC_LINKER_CREATED)) + s = bfd_make_section_with_flags (abfd, ".dynbss", + SEC_ALLOC | SEC_LINKER_CREATED); + if (s == NULL) return FALSE; /* The .rel[a].bss section holds copy relocs. This section is not @@ -3443,11 +3437,11 @@ elf32_bfinfdpic_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) copy relocs. */ if (! info->shared) { - s = bfd_make_section (abfd, - (bed->default_use_rela_p - ? ".rela.bss" : ".rel.bss")); + s = bfd_make_section_with_flags (abfd, + (bed->default_use_rela_p + ? ".rela.bss" : ".rel.bss"), + flags | SEC_READONLY); if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) return FALSE; } @@ -4151,7 +4145,6 @@ elf32_bfinfdpic_always_size_sections (bfd *output_bfd, if (!info->relocatable) { struct elf_link_hash_entry *h; - asection *sec; /* Force a PT_GNU_STACK segment to be created. */ if (! elf_tdata (output_bfd)->stack_flags) @@ -4177,61 +4170,51 @@ elf32_bfinfdpic_always_size_sections (bfd *output_bfd, h->def_regular = 1; h->type = STT_OBJECT; } - - /* Create a stack section, and set its alignment. */ - sec = bfd_make_section (output_bfd, ".stack"); - - if (sec == NULL - || ! bfd_set_section_alignment (output_bfd, sec, 3)) - return FALSE; } return TRUE; } static bfd_boolean -elf32_bfinfdpic_modify_segment_map (bfd *output_bfd, - struct bfd_link_info *info) +elf32_bfinfdpic_modify_program_headers (bfd *output_bfd, + struct bfd_link_info *info) { + struct elf_obj_tdata *tdata = elf_tdata (output_bfd); struct elf_segment_map *m; + Elf_Internal_Phdr *p; /* objcopy and strip preserve what's already there using elf32_bfinfdpic_copy_private_bfd_data (). */ if (! info) return TRUE; - for (m = elf_tdata (output_bfd)->segment_map; m != NULL; m = m->next) + for (p = tdata->phdr, m = tdata->segment_map; m != NULL; m = m->next, p++) if (m->p_type == PT_GNU_STACK) break; if (m) { - asection *sec = bfd_get_section_by_name (output_bfd, ".stack"); struct elf_link_hash_entry *h; - if (sec) + /* Obtain the pointer to the __stacksize symbol. */ + h = elf_link_hash_lookup (elf_hash_table (info), "__stacksize", + FALSE, FALSE, FALSE); + if (h) { - /* Obtain the pointer to the __stacksize symbol. */ - h = elf_link_hash_lookup (elf_hash_table (info), "__stacksize", - FALSE, FALSE, FALSE); while (h->root.type == bfd_link_hash_indirect || h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *)h->root.u.i.link; + h = (struct elf_link_hash_entry *) h->root.u.i.link; BFD_ASSERT (h->root.type == bfd_link_hash_defined); - - /* Set the section size from the symbol value. We - intentionally ignore the symbol section. */ - if (h->root.type == bfd_link_hash_defined) - sec->size = h->root.u.def.value; - else - sec->size = DEFAULT_STACK_SIZE; - - /* Add the stack section to the PT_GNU_STACK segment, - such that its size and alignment requirements make it - to the segment. */ - m->sections[m->count] = sec; - m->count++; } + + /* Set the header p_memsz from the symbol value. We + intentionally ignore the symbol section. */ + if (h && h->root.type == bfd_link_hash_defined) + p->p_memsz = h->root.u.def.value; + else + p->p_memsz = DEFAULT_STACK_SIZE; + + p->p_align = 8; } return TRUE; @@ -4742,6 +4725,10 @@ bfin_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd) elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; elf_flags_init (obfd) = TRUE; + + /* Copy object attributes. */ + _bfd_elf_copy_obj_attributes (ibfd, obfd); + return TRUE; } @@ -5035,7 +5022,7 @@ bfin_finish_dynamic_symbol (bfd * output_bfd, && (info->symbolic || h->dynindx == -1 || h->forced_local) && h->def_regular) { -fprintf(stderr, "*** check this relocation %s\n", __FUNCTION__); + fprintf(stderr, "*** check this relocation %s\n", __FUNCTION__); rela.r_info = ELF32_R_INFO (0, R_pcrel24); rela.r_addend = bfd_get_signed_32 (output_bfd, (sgot->contents @@ -5061,7 +5048,7 @@ fprintf(stderr, "*** check this relocation %s\n", __FUNCTION__); BFD_ASSERT (0); } /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ - if (strcmp (h->root.root.string, "_DYNAMIC") == 0 + if (strcmp (h->root.root.string, "__DYNAMIC") == 0 || h == elf_hash_table (info)->hgot) sym->st_shndx = SHN_ABS; @@ -5298,7 +5285,7 @@ bfin_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED, strip = FALSE; - if (strncmp (name, ".rela", 5) == 0) + if (CONST_STRNEQ (name, ".rela")) { if (s->size == 0) { @@ -5322,7 +5309,7 @@ bfin_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED, s->reloc_count = 0; } } - else if (strncmp (name, ".got", 4) != 0) + else if (! CONST_STRNEQ (name, ".got")) { /* It's not one of our sections, so don't allocate space. */ continue; @@ -5516,6 +5503,8 @@ error_return: #define elf_symbol_leading_char '_' #define bfd_elf32_bfd_reloc_type_lookup bfin_bfd_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup \ + bfin_bfd_reloc_name_lookup #define elf_info_to_howto bfin_info_to_howto #define elf_info_to_howto_rel 0 #define elf_backend_object_p elf32_bfin_object_p @@ -5570,7 +5559,6 @@ error_return: #define elf32_bed elf32_bfinfdpic_bed #undef elf_backend_gc_sweep_hook -#define elf_backend_gc_sweep_hook bfinfdpic_gc_sweep_hook #undef elf_backend_got_header_size #define elf_backend_got_header_size 0 @@ -5586,9 +5574,9 @@ error_return: #undef elf_backend_always_size_sections #define elf_backend_always_size_sections \ elf32_bfinfdpic_always_size_sections -#undef elf_backend_modify_segment_map -#define elf_backend_modify_segment_map \ - elf32_bfinfdpic_modify_segment_map +#undef elf_backend_modify_program_headers +#define elf_backend_modify_program_headers \ + elf32_bfinfdpic_modify_program_headers #undef bfd_elf32_bfd_copy_private_bfd_data #define bfd_elf32_bfd_copy_private_bfd_data \ elf32_bfinfdpic_copy_private_bfd_data diff --git a/bfd/elf32-cr16.c b/bfd/elf32-cr16.c new file mode 100644 index 00000000000..197bff72008 --- /dev/null +++ b/bfd/elf32-cr16.c @@ -0,0 +1,1433 @@ +/* BFD back-end for National Semiconductor's CR16 ELF + Copyright 2007 Free Software Foundation, Inc. + Written by M R Swami Reddy. + + This file is part of BFD, the Binary File Descriptor library. + + 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 2 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 "bfdlink.h" +#include "libbfd.h" +#include "libiberty.h" +#include "elf-bfd.h" +#include "elf/cr16.h" + +/* cr16_reloc_map array maps BFD relocation enum into a CRGAS relocation type. */ + +struct cr16_reloc_map +{ + bfd_reloc_code_real_type bfd_reloc_enum; /* BFD relocation enum. */ + unsigned short cr16_reloc_type; /* CR16 relocation type. */ +}; + +static const struct cr16_reloc_map cr16_reloc_map[R_CR16_MAX] = +{ + {BFD_RELOC_NONE, R_CR16_NONE}, + {BFD_RELOC_CR16_NUM8, R_CR16_NUM8}, + {BFD_RELOC_CR16_NUM16, R_CR16_NUM16}, + {BFD_RELOC_CR16_NUM32, R_CR16_NUM32}, + {BFD_RELOC_CR16_NUM32a, R_CR16_NUM32a}, + {BFD_RELOC_CR16_REGREL4, R_CR16_REGREL4}, + {BFD_RELOC_CR16_REGREL4a, R_CR16_REGREL4a}, + {BFD_RELOC_CR16_REGREL14, R_CR16_REGREL14}, + {BFD_RELOC_CR16_REGREL14a, R_CR16_REGREL14a}, + {BFD_RELOC_CR16_REGREL16, R_CR16_REGREL16}, + {BFD_RELOC_CR16_REGREL20, R_CR16_REGREL20}, + {BFD_RELOC_CR16_REGREL20a, R_CR16_REGREL20a}, + {BFD_RELOC_CR16_ABS20, R_CR16_ABS20}, + {BFD_RELOC_CR16_ABS24, R_CR16_ABS24}, + {BFD_RELOC_CR16_IMM4, R_CR16_IMM4}, + {BFD_RELOC_CR16_IMM8, R_CR16_IMM8}, + {BFD_RELOC_CR16_IMM16, R_CR16_IMM16}, + {BFD_RELOC_CR16_IMM20, R_CR16_IMM20}, + {BFD_RELOC_CR16_IMM24, R_CR16_IMM24}, + {BFD_RELOC_CR16_IMM32, R_CR16_IMM32}, + {BFD_RELOC_CR16_IMM32a, R_CR16_IMM32a}, + {BFD_RELOC_CR16_DISP4, R_CR16_DISP4}, + {BFD_RELOC_CR16_DISP8, R_CR16_DISP8}, + {BFD_RELOC_CR16_DISP16, R_CR16_DISP16}, + {BFD_RELOC_CR16_DISP24, R_CR16_DISP24}, + {BFD_RELOC_CR16_DISP24a, R_CR16_DISP24a} +}; + +static reloc_howto_type cr16_elf_howto_table[] = +{ + HOWTO (R_CR16_NONE, /* type */ + 0, /* rightshift */ + 2, /* size */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_NONE", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_NUM8, /* type */ + 0, /* rightshift */ + 0, /* size */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_NUM8", /* name */ + FALSE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_NUM16, /* type */ + 0, /* rightshift */ + 1, /* size */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_NUM16", /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_NUM32, /* type */ + 0, /* rightshift */ + 2, /* size */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_NUM32", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_NUM32a, /* type */ + 1, /* rightshift */ + 2, /* size */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_NUM32a", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_REGREL4, /* type */ + 0, /* rightshift */ + 0, /* size */ + 4, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_REGREL4", /* name */ + FALSE, /* partial_inplace */ + 0xf, /* src_mask */ + 0xf, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_REGREL4a, /* type */ + 0, /* rightshift */ + 0, /* size */ + 4, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_REGREL4a", /* name */ + FALSE, /* partial_inplace */ + 0xf, /* src_mask */ + 0xf, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_REGREL14, /* type */ + 0, /* rightshift */ + 1, /* size */ + 14, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_REGREL14", /* name */ + FALSE, /* partial_inplace */ + 0x3fff, /* src_mask */ + 0x3fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_REGREL14a, /* type */ + 0, /* rightshift */ + 1, /* size */ + 14, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_REGREL14a", /* name */ + FALSE, /* partial_inplace */ + 0x3fff, /* src_mask */ + 0x3fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_REGREL16, /* type */ + 0, /* rightshift */ + 1, /* size */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_REGREL16", /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_REGREL20, /* type */ + 0, /* rightshift */ + 2, /* size */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_REGREL20", /* name */ + FALSE, /* partial_inplace */ + 0xfffff, /* src_mask */ + 0xfffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_REGREL20a, /* type */ + 0, /* rightshift */ + 2, /* size */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_REGREL20a", /* name */ + FALSE, /* partial_inplace */ + 0xfffff, /* src_mask */ + 0xfffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_ABS20, /* type */ + 0, /* rightshift */ + 2, /* size */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_ABS20", /* name */ + FALSE, /* partial_inplace */ + 0xfffff, /* src_mask */ + 0xfffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_ABS24, /* type */ + 0, /* rightshift */ + 2, /* size */ + 24, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_ABS24", /* name */ + FALSE, /* partial_inplace */ + 0xffffff, /* src_mask */ + 0xffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_IMM4, /* type */ + 0, /* rightshift */ + 0, /* size */ + 4, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_IMM4", /* name */ + FALSE, /* partial_inplace */ + 0xf, /* src_mask */ + 0xf, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_IMM8, /* type */ + 0, /* rightshift */ + 0, /* size */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_IMM8", /* name */ + FALSE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_IMM16, /* type */ + 0, /* rightshift */ + 1, /* size */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_IMM16", /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_IMM20, /* type */ + 0, /* rightshift */ + 2, /* size */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_IMM20", /* name */ + FALSE, /* partial_inplace */ + 0xfffff, /* src_mask */ + 0xfffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_IMM24, /* type */ + 0, /* rightshift */ + 2, /* size */ + 24, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_IMM24", /* name */ + FALSE, /* partial_inplace */ + 0xffffff, /* src_mask */ + 0xffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_IMM32, /* type */ + 0, /* rightshift */ + 2, /* size */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_IMM32", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_IMM32a, /* type */ + 1, /* rightshift */ + 2, /* size */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_IMM32a", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_DISP4, /* type */ + 1, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 4, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_DISP4", /* name */ + FALSE, /* partial_inplace */ + 0xf, /* src_mask */ + 0xf, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_DISP8, /* type */ + 1, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_DISP8", /* name */ + FALSE, /* partial_inplace */ + 0x1ff, /* src_mask */ + 0x1ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_DISP16, /* type */ + 0, /* rightshift REVIITS: To sync with WinIDEA*/ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_DISP16", /* name */ + FALSE, /* partial_inplace */ + 0x1ffff, /* src_mask */ + 0x1ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* REVISIT: DISP24 should be left-shift by 2 as per ISA doc + but its not done, to sync with WinIDEA and CR16 4.1 tools */ + HOWTO (R_CR16_DISP24, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_DISP24", /* name */ + FALSE, /* partial_inplace */ + 0x1ffffff, /* src_mask */ + 0x1ffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_DISP24a, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_DISP24a", /* name */ + FALSE, /* partial_inplace */ + 0xffffff, /* src_mask */ + 0xffffff, /* dst_mask */ + FALSE) /* pcrel_offset */ +}; + +/* Retrieve a howto ptr using a BFD reloc_code. */ + +static reloc_howto_type * +elf_cr16_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) +{ + unsigned int i; + + for (i = 0; i < R_CR16_MAX; i++) + if (code == cr16_reloc_map[i].bfd_reloc_enum) + return &cr16_elf_howto_table[cr16_reloc_map[i].cr16_reloc_type]; + + _bfd_error_handler ("Unsupported CR16 relocation type: 0x%x\n", code); + return NULL; +} + +static reloc_howto_type * +elf_cr16_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; ARRAY_SIZE (cr16_elf_howto_table); i++) + if (cr16_elf_howto_table[i].name != NULL + && strcasecmp (cr16_elf_howto_table[i].name, r_name) == 0) + return cr16_elf_howto_table + i; + + return NULL; +} + +/* Retrieve a howto ptr using an internal relocation entry. */ + +static void +elf_cr16_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, + Elf_Internal_Rela *dst) +{ + unsigned int r_type = ELF32_R_TYPE (dst->r_info); + + BFD_ASSERT (r_type < (unsigned int) R_CR16_MAX); + cache_ptr->howto = &cr16_elf_howto_table[r_type]; +} + +/* Perform a relocation as part of a final link. */ + +static bfd_reloc_status_type +cr16_elf_final_link_relocate (reloc_howto_type *howto, + bfd *input_bfd, + bfd *output_bfd ATTRIBUTE_UNUSED, + asection *input_section, + bfd_byte *contents, + bfd_vma offset, + bfd_vma Rvalue, + bfd_vma addend, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + asection *sec ATTRIBUTE_UNUSED, + int is_local ATTRIBUTE_UNUSED) +{ + unsigned short r_type = howto->type; + bfd_byte *hit_data = contents + offset; + bfd_vma reloc_bits, check, Rvalue1; + + switch (r_type) + { + case R_CR16_IMM4: + case R_CR16_IMM8: + case R_CR16_IMM16: + case R_CR16_IMM20: + case R_CR16_IMM32: + case R_CR16_IMM32a: + case R_CR16_REGREL4: + case R_CR16_REGREL4a: + case R_CR16_REGREL14: + case R_CR16_REGREL14a: + case R_CR16_REGREL16: + case R_CR16_REGREL20: + case R_CR16_ABS20: + case R_CR16_ABS24: + case R_CR16_DISP16: + case R_CR16_DISP24: + /* 'hit_data' is relative to the start of the instruction, not the + relocation offset. Advance it to account for the exact offset. */ + hit_data += 2; + break; + + case R_CR16_NONE: + return bfd_reloc_ok; + break; + + case R_CR16_DISP4: + case R_CR16_DISP8: + case R_CR16_DISP24a: + /* We only care about the addend, where the difference between + expressions is kept. */ + if (is_local) Rvalue -= -1; + + default: + break; + } + + if (howto->pc_relative) + { + /* Subtract the address of the section containing the location. */ + Rvalue -= (input_section->output_section->vma + + input_section->output_offset); + /* Subtract the position of the location within the section. */ + Rvalue -= offset; + } + + /* Add in supplied addend. */ + Rvalue += addend; + + /* Complain if the bitfield overflows, whether it is considered + as signed or unsigned. */ + check = Rvalue >> howto->rightshift; + + /* Assumes two's complement. This expression avoids + overflow if howto->bitsize is the number of bits in + bfd_vma. */ + reloc_bits = (((1 << (howto->bitsize - 1)) - 1) << 1) | 1; + + if (((bfd_vma) check & ~reloc_bits) != 0 + && (((bfd_vma) check & ~reloc_bits) + != (-(bfd_vma) 1 & ~reloc_bits))) + { + /* The above right shift is incorrect for a signed + value. See if turning on the upper bits fixes the + overflow. */ + if (howto->rightshift && (bfd_signed_vma) Rvalue < 0) + { + check |= ((bfd_vma) - 1 + & ~((bfd_vma) - 1 + >> howto->rightshift)); + + if (((bfd_vma) check & ~reloc_bits) + != (-(bfd_vma) 1 & ~reloc_bits)) + return bfd_reloc_overflow; + } + else + return bfd_reloc_overflow; + } + + /* Drop unwanted bits from the value we are relocating to. */ + Rvalue >>= (bfd_vma) howto->rightshift; + + /* Apply dst_mask to select only relocatable part of the insn. */ + Rvalue &= howto->dst_mask; + + switch (howto->size) + { + case 0: + if ((r_type == R_CR16_IMM4) + || (r_type == R_CR16_DISP4) + || (r_type == R_CR16_DISP8)) + { + Rvalue1 = bfd_get_16 (input_bfd, hit_data); + Rvalue = ((Rvalue1 & 0xf000) | ((Rvalue << 4) & 0xf00) + | (Rvalue1 & 0x00f0) | (Rvalue & 0xf)); + bfd_put_16 (input_bfd, Rvalue, hit_data); + } + break; + + case 1: + if (r_type == R_CR16_DISP16) + { + Rvalue |= (bfd_get_16 (input_bfd, hit_data)); + Rvalue = ((Rvalue & 0xfffe) | ((Rvalue >> 16) & 0x1)); + + bfd_put_16 (input_bfd, Rvalue, hit_data); + } + break; + + case 2: + if (r_type == R_CR16_ABS20) + { + Rvalue |= (((bfd_get_16 (input_bfd, hit_data) << 16) + | (bfd_get_16 (input_bfd, hit_data + 2))) + & ~howto->dst_mask); + Rvalue |= (bfd_get_16 (input_bfd, hit_data + 2) << 16); + + /* Relocation on INSTRUCTIONS is different : Instructions are + word-addressable, that is, each word itself is arranged according + to little-endian convention, whereas the words are arranged with + respect to one another in BIG ENDIAN fashion. + When there is an immediate value that spans a word boundary, + it is split in a big-endian way with respect to the words. */ + bfd_put_16 (input_bfd, (Rvalue) & 0xffff, hit_data); + bfd_put_16 (input_bfd, (Rvalue >> 16)& 0xffff, hit_data + 2); + } + else if (r_type == R_CR16_ABS24) + { + Rvalue = ((((Rvalue >> 20)& 0xf) + | (((Rvalue >> 16) & 0xf) << 8) + | (bfd_get_16 (input_bfd, hit_data))) + | ((Rvalue & 0xffff) << 16)); + + bfd_put_32 (input_bfd, Rvalue, hit_data); + } + else if (r_type == R_CR16_DISP24) + { + Rvalue = ((((Rvalue >> 20)& 0xf) | (((Rvalue >> 16) & 0xf)<<8) + | (bfd_get_16 (input_bfd, hit_data))) + | (((Rvalue & 0xfffE) | ((Rvalue >> 24) & 0x1)) << 16)); + + bfd_put_32 (input_bfd, Rvalue, hit_data); + } + else if ((r_type == R_CR16_IMM32) || (r_type == R_CR16_IMM32a)) + { + Rvalue = (((Rvalue >> 16)& 0xffff) + | (bfd_get_16 (input_bfd, hit_data))) + | ((Rvalue & 0xffff) << 16); + bfd_put_32 (input_bfd, Rvalue, hit_data); + } + else if (r_type == R_CR16_DISP24a) + { + Rvalue = (((Rvalue & 0xfffffe) | (Rvalue >> 23))); + Rvalue = ((Rvalue >> 16) & 0xff) | ((Rvalue & 0xffff) << 16) + | (bfd_get_32 (input_bfd, hit_data)); + + bfd_put_32 (input_bfd, Rvalue, hit_data); + } + else if ((r_type == R_CR16_NUM32) || (r_type == R_CR16_NUM32a)) + { + bfd_put_32 (input_bfd, Rvalue, hit_data); + } + break; + + default: + return bfd_reloc_notsupported; + } + + return bfd_reloc_ok; +} + +/* Delete some bytes from a section while relaxing. */ + +static bfd_boolean +elf32_cr16_relax_delete_bytes (struct bfd_link_info *link_info, bfd *abfd, + asection *sec, bfd_vma addr, int count) +{ + Elf_Internal_Shdr *symtab_hdr; + unsigned int sec_shndx; + bfd_byte *contents; + Elf_Internal_Rela *irel, *irelend; + Elf_Internal_Rela *irelalign; + bfd_vma toaddr; + Elf_Internal_Sym *isym; + Elf_Internal_Sym *isymend; + struct elf_link_hash_entry **sym_hashes; + struct elf_link_hash_entry **end_hashes; + struct elf_link_hash_entry **start_hashes; + unsigned int symcount; + + sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec); + + contents = elf_section_data (sec)->this_hdr.contents; + + /* The deletion must stop at the next ALIGN reloc for an aligment + power larger than the number of bytes we are deleting. */ + irelalign = NULL; + toaddr = sec->size; + + irel = elf_section_data (sec)->relocs; + irelend = irel + sec->reloc_count; + + /* Actually delete the bytes. */ + memmove (contents + addr, contents + addr + count, + (size_t) (toaddr - addr - count)); + sec->size -= count; + + /* Adjust all the relocs. */ + for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++) + /* Get the new reloc address. */ + if ((irel->r_offset > addr && irel->r_offset < toaddr)) + irel->r_offset -= count; + + /* Adjust the local symbols defined in this section. */ + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + isym = (Elf_Internal_Sym *) symtab_hdr->contents; + for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++) + { + if (isym->st_shndx == sec_shndx + && isym->st_value > addr + && isym->st_value < toaddr) + { + /* Adjust the addend of SWITCH relocations in this section, + which reference this local symbol. */ + for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++) + { + unsigned long r_symndx; + Elf_Internal_Sym *rsym; + bfd_vma addsym, subsym; + + r_symndx = ELF32_R_SYM (irel->r_info); + rsym = (Elf_Internal_Sym *) symtab_hdr->contents + r_symndx; + + /* Skip if not the local adjusted symbol. */ + if (rsym != isym) + continue; + + addsym = isym->st_value; + subsym = addsym - irel->r_addend; + + /* Fix the addend only when -->> (addsym > addr >= subsym). */ + if (subsym <= addr) + irel->r_addend -= count; + else + continue; + } + + isym->st_value -= count; + } + } + + /* Now adjust the global symbols defined in this section. */ + symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym) + - symtab_hdr->sh_info); + sym_hashes = start_hashes = elf_sym_hashes (abfd); + end_hashes = sym_hashes + symcount; + + for (; sym_hashes < end_hashes; sym_hashes++) + { + struct elf_link_hash_entry *sym_hash = *sym_hashes; + + /* The '--wrap SYMBOL' option is causing a pain when the object file, + containing the definition of __wrap_SYMBOL, includes a direct + call to SYMBOL as well. Since both __wrap_SYMBOL and SYMBOL reference + the same symbol (which is __wrap_SYMBOL), but still exist as two + different symbols in 'sym_hashes', we don't want to adjust + the global symbol __wrap_SYMBOL twice. + This check is only relevant when symbols are being wrapped. */ + if (link_info->wrap_hash != NULL) + { + struct elf_link_hash_entry **cur_sym_hashes; + + /* Loop only over the symbols whom been already checked. */ + for (cur_sym_hashes = start_hashes; cur_sym_hashes < sym_hashes; + cur_sym_hashes++) + /* If the current symbol is identical to 'sym_hash', that means + the symbol was already adjusted (or at least checked). */ + if (*cur_sym_hashes == sym_hash) + break; + + /* Don't adjust the symbol again. */ + if (cur_sym_hashes < sym_hashes) + continue; + } + + if ((sym_hash->root.type == bfd_link_hash_defined + || sym_hash->root.type == bfd_link_hash_defweak) + && sym_hash->root.u.def.section == sec + && sym_hash->root.u.def.value > addr + && sym_hash->root.u.def.value < toaddr) + sym_hash->root.u.def.value -= count; + } + + return TRUE; +} + +/* Relocate a CR16 ELF section. */ + +static bfd_boolean +elf32_cr16_relocate_section (bfd *output_bfd, struct bfd_link_info *info, + bfd *input_bfd, asection *input_section, + bfd_byte *contents, Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, + asection **local_sections) +{ + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + Elf_Internal_Rela *rel, *relend; + + if (info->relocatable) + return TRUE; + + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (input_bfd); + + rel = relocs; + relend = relocs + input_section->reloc_count; + for (; rel < relend; rel++) + { + int r_type; + reloc_howto_type *howto; + unsigned long r_symndx; + Elf_Internal_Sym *sym; + asection *sec; + struct elf_link_hash_entry *h; + bfd_vma relocation; + bfd_reloc_status_type r; + + r_symndx = ELF32_R_SYM (rel->r_info); + r_type = ELF32_R_TYPE (rel->r_info); + howto = cr16_elf_howto_table + (r_type); + + h = NULL; + sym = NULL; + sec = NULL; + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + sec = local_sections[r_symndx]; + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); + } + else + { + bfd_boolean unresolved_reloc, warned; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, + unresolved_reloc, warned); + } + + r = cr16_elf_final_link_relocate (howto, input_bfd, output_bfd, + input_section, + contents, rel->r_offset, + relocation, rel->r_addend, + info, sec, h == NULL); + + if (r != bfd_reloc_ok) + { + const char *name; + const char *msg = NULL; + + if (h != NULL) + name = h->root.root.string; + else + { + name = (bfd_elf_string_from_elf_section + (input_bfd, symtab_hdr->sh_link, sym->st_name)); + if (name == NULL || *name == '\0') + name = bfd_section_name (input_bfd, sec); + } + + switch (r) + { + case bfd_reloc_overflow: + if (!((*info->callbacks->reloc_overflow) + (info, (h ? &h->root : NULL), name, howto->name, + (bfd_vma) 0, input_bfd, input_section, + rel->r_offset))) + return FALSE; + break; + + case bfd_reloc_undefined: + if (!((*info->callbacks->undefined_symbol) + (info, name, input_bfd, input_section, + rel->r_offset, TRUE))) + return FALSE; + break; + + case bfd_reloc_outofrange: + msg = _("internal error: out of range error"); + goto common_error; + + case bfd_reloc_notsupported: + msg = _("internal error: unsupported relocation error"); + goto common_error; + + case bfd_reloc_dangerous: + msg = _("internal error: dangerous error"); + goto common_error; + + default: + msg = _("internal error: unknown error"); + /* Fall through. */ + + common_error: + if (!((*info->callbacks->warning) + (info, msg, name, input_bfd, input_section, + rel->r_offset))) + return FALSE; + break; + } + } + } + + return TRUE; +} + +/* This is a version of bfd_generic_get_relocated_section_contents + which uses elf32_cr16_relocate_section. */ + +static bfd_byte * +elf32_cr16_get_relocated_section_contents (bfd *output_bfd, + struct bfd_link_info *link_info, + struct bfd_link_order *link_order, + bfd_byte *data, + bfd_boolean relocatable, + asymbol **symbols) +{ + Elf_Internal_Shdr *symtab_hdr; + asection *input_section = link_order->u.indirect.section; + bfd *input_bfd = input_section->owner; + asection **sections = NULL; + Elf_Internal_Rela *internal_relocs = NULL; + Elf_Internal_Sym *isymbuf = NULL; + + /* We only need to handle the case of relaxing, or of having a + particular set of section contents, specially. */ + if (relocatable + || elf_section_data (input_section)->this_hdr.contents == NULL) + return bfd_generic_get_relocated_section_contents (output_bfd, link_info, + link_order, data, + relocatable, + symbols); + + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + + memcpy (data, elf_section_data (input_section)->this_hdr.contents, + (size_t) input_section->size); + + if ((input_section->flags & SEC_RELOC) != 0 + && input_section->reloc_count > 0) + { + Elf_Internal_Sym *isym; + Elf_Internal_Sym *isymend; + asection **secpp; + bfd_size_type amt; + + internal_relocs = _bfd_elf_link_read_relocs (input_bfd, input_section, + NULL, NULL, FALSE); + if (internal_relocs == NULL) + goto error_return; + + if (symtab_hdr->sh_info != 0) + { + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) + goto error_return; + } + + amt = symtab_hdr->sh_info; + amt *= sizeof (asection *); + sections = bfd_malloc (amt); + if (sections == NULL && amt != 0) + goto error_return; + + isymend = isymbuf + symtab_hdr->sh_info; + for (isym = isymbuf, secpp = sections; isym < isymend; ++isym, ++secpp) + { + asection *isec; + + if (isym->st_shndx == SHN_UNDEF) + isec = bfd_und_section_ptr; + else if (isym->st_shndx == SHN_ABS) + isec = bfd_abs_section_ptr; + else if (isym->st_shndx == SHN_COMMON) + isec = bfd_com_section_ptr; + else + isec = bfd_section_from_elf_index (input_bfd, isym->st_shndx); + + *secpp = isec; + } + + if (! elf32_cr16_relocate_section (output_bfd, link_info, input_bfd, + input_section, data, internal_relocs, + isymbuf, sections)) + goto error_return; + + if (sections != NULL) + free (sections); + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (elf_section_data (input_section)->relocs != internal_relocs) + free (internal_relocs); + } + + return data; + + error_return: + if (sections != NULL) + free (sections); + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (internal_relocs != NULL + && elf_section_data (input_section)->relocs != internal_relocs) + free (internal_relocs); + return NULL; +} + +/* This function handles relaxing for the CR16. + + There's quite a few relaxing opportunites available on the CR16: + + * bcond:24 -> bcond:16 2 bytes + * bcond:16 -> bcond:8 2 bytes + * arithmetic imm32 -> arithmetic imm16 2 bytes + + Symbol- and reloc-reading infrastructure copied from elf-m10200.c. */ + +static bfd_boolean +elf32_cr16_relax_section (bfd *abfd, asection *sec, + struct bfd_link_info *link_info, bfd_boolean *again) +{ + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Rela *internal_relocs; + Elf_Internal_Rela *irel, *irelend; + bfd_byte *contents = NULL; + Elf_Internal_Sym *isymbuf = NULL; + + /* Assume nothing changes. */ + *again = FALSE; + + /* We don't have to do anything for a relocatable link, if + this section does not have relocs, or if this is not a + code section. */ + if (link_info->relocatable + || (sec->flags & SEC_RELOC) == 0 + || sec->reloc_count == 0 + || (sec->flags & SEC_CODE) == 0) + return TRUE; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + + /* Get a copy of the native relocations. */ + internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, + link_info->keep_memory); + if (internal_relocs == NULL) + goto error_return; + + /* Walk through them looking for relaxing opportunities. */ + irelend = internal_relocs + sec->reloc_count; + for (irel = internal_relocs; irel < irelend; irel++) + { + bfd_vma symval; + + /* If this isn't something that can be relaxed, then ignore + this reloc. */ + if (ELF32_R_TYPE (irel->r_info) != (int) R_CR16_DISP16 + && ELF32_R_TYPE (irel->r_info) != (int) R_CR16_DISP24) + continue; + + /* Get the section contents if we haven't done so already. */ + if (contents == NULL) + { + /* Get cached copy if it exists. */ + if (elf_section_data (sec)->this_hdr.contents != NULL) + contents = elf_section_data (sec)->this_hdr.contents; + /* Go get them off disk. */ + else if (!bfd_malloc_and_get_section (abfd, sec, &contents)) + goto error_return; + } + + /* Read this BFD's local symbols if we haven't done so already. */ + if (isymbuf == NULL && symtab_hdr->sh_info != 0) + { + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) + goto error_return; + } + + /* Get the value of the symbol referred to by the reloc. */ + if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) + { + /* A local symbol. */ + Elf_Internal_Sym *isym; + asection *sym_sec; + + isym = isymbuf + ELF32_R_SYM (irel->r_info); + if (isym->st_shndx == SHN_UNDEF) + sym_sec = bfd_und_section_ptr; + else if (isym->st_shndx == SHN_ABS) + sym_sec = bfd_abs_section_ptr; + else if (isym->st_shndx == SHN_COMMON) + sym_sec = bfd_com_section_ptr; + else + sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx); + symval = (isym->st_value + + sym_sec->output_section->vma + + sym_sec->output_offset); + } + else + { + unsigned long indx; + struct elf_link_hash_entry *h; + + /* An external symbol. */ + indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + BFD_ASSERT (h != NULL); + + if (h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) + /* This appears to be a reference to an undefined + symbol. Just ignore it--it will be caught by the + regular reloc processing. */ + continue; + + symval = (h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + } + + /* For simplicity of coding, we are going to modify the section + contents, the section relocs, and the BFD symbol table. We + must tell the rest of the code not to free up this + information. It would be possible to instead create a table + of changes which have to be made, as is done in coff-mips.c; + that would be more work, but would require less memory when + the linker is run. */ + + /* Try to turn a 24 branch/call into a 16bit relative + * branch/call. */ + if (ELF32_R_TYPE (irel->r_info) == (int) R_CR16_DISP24) + { + bfd_vma value = symval; + + /* Deal with pc-relative gunk. */ + value -= (sec->output_section->vma + sec->output_offset); + value -= irel->r_offset; + value += irel->r_addend; + + /* See if the value will fit in 16 bits, note the high value is + 0xfffe + 2 as the target will be two bytes closer if we are + able to relax. */ + if ((long) value < 0x10000 && (long) value > -0x10002) + { + unsigned int code; + + /* Get the opcode. */ + code = (unsigned int) bfd_get_32 (abfd, contents + irel->r_offset); + + /* Verify it's a 'bcond' and fix the opcode. */ + if ((code & 0xffff) == 0x0010) + { + bfd_put_16 (abfd, 0x1800 | ((0xf & (code >>20))<<4), contents + irel->r_offset); + bfd_put_16 (abfd, value, contents + irel->r_offset+2); + } + else + continue; + + /* Note that we've changed the relocs, section contents, etc. */ + elf_section_data (sec)->relocs = internal_relocs; + elf_section_data (sec)->this_hdr.contents = contents; + symtab_hdr->contents = (unsigned char *) isymbuf; + + /* Fix the relocation's type. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_CR16_DISP16); + + /* Delete two bytes of data. */ + if (!elf32_cr16_relax_delete_bytes (link_info, abfd, sec, + irel->r_offset + 2, 2)) + goto error_return; + + /* That will change things, so, we should relax again. + Note that this is not required, and it may be slow. */ + *again = TRUE; + } + } + + /* Try to turn a 16bit pc-relative branch into an + 8bit pc-relative branch. */ + if (ELF32_R_TYPE (irel->r_info) == (int) R_CR16_DISP16) + { + bfd_vma value = symval; + + /* Deal with pc-relative gunk. */ + value -= (sec->output_section->vma + sec->output_offset); + value -= irel->r_offset; + value += irel->r_addend; + + /* See if the value will fit in 8 bits, note the high value is + 0xfc + 2 as the target will be two bytes closer if we are + able to relax. */ + if ((long) value < 0xfe && (long) value > -0x100) + { + unsigned short code; + + /* Get the opcode. */ + code = (unsigned short) bfd_get_16 (abfd, contents + irel->r_offset); + + /* Verify it's a 'bcond' opcode. */ + if ((code & 0xff00) == 0x1800) + { + bfd_put_8 (abfd, 0x1 | ((0xf & (code>>4))<<4), contents + irel->r_offset); + bfd_put_8 (abfd, value, contents + irel->r_offset+2); + } + else + continue; + + /* Note that we've changed the relocs, section contents, etc. */ + elf_section_data (sec)->relocs = internal_relocs; + elf_section_data (sec)->this_hdr.contents = contents; + symtab_hdr->contents = (unsigned char *) isymbuf; + + /* Fix the relocation's type. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_CR16_DISP8); + + /* Delete two bytes of data. */ + if (!elf32_cr16_relax_delete_bytes (link_info, abfd, sec, + irel->r_offset + 2, 2)) + goto error_return; + + /* That will change things, so, we should relax again. + Note that this is not required, and it may be slow. */ + *again = TRUE; + } + } + +#if 0 // REVISIT: To support IMM relaxation in CR16 target + /* Try to turn a 32bit immediate address into + a 20bit immediate address. */ + if (ELF32_R_TYPE (irel->r_info) == (int) R_CR16_IMM32) + { + bfd_vma value = symval; + + /* See if the value will fit in 20 bits. */ + if ((long) value < 0x7ffff && (long) value > -0x80000) + { + unsigned short code; + + /* Get the opcode. */ + code = (unsigned short) bfd_get_16 (abfd, contents + irel->r_offset); + + /* Verify it's a 'arithmetic double'. */ + if ((code & 0xfff0) != 0x0070) + continue; + + /* Note that we've changed the relocs, section contents, etc. */ + elf_section_data (sec)->relocs = internal_relocs; + elf_section_data (sec)->this_hdr.contents = contents; + symtab_hdr->contents = (unsigned char *) isymbuf; + + /* Fix the opcode. */ + bfd_put_8 (abfd, (code & 0xff) - 0x10, contents + irel->r_offset); + + /* Fix the relocation's type. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_CR16_IMM20); + + /* Delete two bytes of data. */ + if (!elf32_cr16_relax_delete_bytes (link_info, abfd, sec, + irel->r_offset + 2, 2)) + goto error_return; + + /* That will change things, so, we should relax again. + Note that this is not required, and it may be slow. */ + *again = TRUE; + } + } + /* Try to turn a 20bit/16bit immediate address into + a 4bit immediate address. */ + if ((ELF32_R_TYPE (irel->r_info) == (int) R_CR16_IMM20) + || (ELF32_R_TYPE (irel->r_info) == (int) R_CR16_IMM16)) + { + bfd_vma value = symval; + + /* See if the value will fit in 4 bits. */ + if ((long) value < 0x7 && (long) value > -0x8) + { + unsigned short code; + + /* Get the opcode. */ + code = (unsigned short) bfd_get_8 (abfd, contents + irel->r_offset); + + /* Verify it's a 'arithmetic double'. */ + if (((code & 0xff) != 0x50) || ((code & 0xff) != 0x45)) + continue; + + /* Note that we've changed the relocs, section contents, etc. */ + elf_section_data (sec)->relocs = internal_relocs; + elf_section_data (sec)->this_hdr.contents = contents; + symtab_hdr->contents = (unsigned char *) isymbuf; + + /* Fix the opcode. */ + bfd_put_8 (abfd, (code & 0xff) - 0x10, contents + irel->r_offset); + + /* Fix the relocation's type. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_CR16_IMM4); + + /* Delete two bytes of data. */ + if (!elf32_cr16_relax_delete_bytes (link_info, abfd, sec, + irel->r_offset + 2, 2)) + goto error_return; + + /* That will change things, so, we should relax again. + Note that this is not required, and it may be slow. */ + *again = TRUE; + } + } +#endif + } + + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + { + if (! link_info->keep_memory) + free (isymbuf); + else + { + /* Cache the symbols for elf_link_input_bfd. */ + symtab_hdr->contents = (unsigned char *) isymbuf; + } + } + + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) + { + if (! link_info->keep_memory) + free (contents); + else + { + /* Cache the section contents for elf_link_input_bfd. */ + elf_section_data (sec)->this_hdr.contents = contents; + } + } + + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); + + return TRUE; + + error_return: + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) + free (contents); + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); + + return FALSE; +} + +static asection * +elf32_cr16_gc_mark_hook (asection *sec, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + Elf_Internal_Rela *rel ATTRIBUTE_UNUSED, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) +{ + if (h == NULL) + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); + + switch (h->root.type) + { + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + return h->root.u.def.section; + + case bfd_link_hash_common: + return h->root.u.c.p->section; + + default: + return NULL; + } +} + +/* Update the got entry reference counts for the section being removed. */ + +static bfd_boolean +elf32_cr16_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + asection *sec ATTRIBUTE_UNUSED, + const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED) +{ + /* We don't support garbage collection of GOT and PLT relocs yet. */ + return TRUE; +} + +/* Definitions for setting CR16 target vector. */ +#define TARGET_LITTLE_SYM bfd_elf32_cr16_vec +#define TARGET_LITTLE_NAME "elf32-cr16" +#define ELF_ARCH bfd_arch_cr16 +#define ELF_MACHINE_CODE EM_CR16 +#define ELF_MAXPAGESIZE 0x1 +#define elf_symbol_leading_char '_' + +#define bfd_elf32_bfd_reloc_type_lookup elf_cr16_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup elf_cr16_reloc_name_lookup +#define elf_info_to_howto elf_cr16_info_to_howto +#define elf_info_to_howto_rel 0 +#define elf_backend_relocate_section elf32_cr16_relocate_section +#define bfd_elf32_bfd_relax_section elf32_cr16_relax_section +#define bfd_elf32_bfd_get_relocated_section_contents \ + elf32_cr16_get_relocated_section_contents +#define elf_backend_gc_mark_hook elf32_cr16_gc_mark_hook +#define elf_backend_gc_sweep_hook elf32_cr16_gc_sweep_hook +#define elf_backend_can_gc_sections 1 +#define elf_backend_rela_normal 1 + +#include "elf32-target.h" diff --git a/bfd/elf32-cr16c.c b/bfd/elf32-cr16c.c index ec7199b2694..3a1db7e8764 100644 --- a/bfd/elf32-cr16c.c +++ b/bfd/elf32-cr16c.c @@ -1,5 +1,5 @@ /* BFD back-end for National Semiconductor's CR16C ELF - Copyright 2004, 2005 Free Software Foundation, Inc. + Copyright 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" #include "elf/cr16c.h" @@ -150,6 +150,20 @@ elf_cr16c_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return 0; } +static reloc_howto_type * +elf_cr16c_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; i < sizeof (elf_howto_table) / sizeof (elf_howto_table[0]); i++) + if (elf_howto_table[i].name != NULL + && strcasecmp (elf_howto_table[i].name, r_name) == 0) + return &elf_howto_table[i]; + + return NULL; +} + static void elf_cr16c_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr ATTRIBUTE_UNUSED, @@ -692,26 +706,6 @@ elf32_cr16c_relocate_section (bfd *output_bfd, r_type = ELF32_R_TYPE (rel->r_info); howto = elf_howto_table + r_type; - if (info->relocatable) - { - /* This is a relocatable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - { - sec = local_sections[r_symndx]; - rel->r_addend += sec->output_offset + sym->st_value; - } - } - - continue; - } - - /* This is a final link. */ h = NULL; sym = NULL; sec = NULL; @@ -731,6 +725,28 @@ elf32_cr16c_relocate_section (bfd *output_bfd, unresolved_reloc, warned); } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + { + /* This is a relocatable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + rel->r_addend += sec->output_offset; + continue; + } + r = cr16c_elf_final_link_relocate (howto, input_bfd, output_bfd, input_section, contents, rel->r_offset, @@ -798,53 +814,6 @@ elf32_cr16c_relocate_section (bfd *output_bfd, return TRUE; } -static asection * -elf32_cr16c_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, - Elf_Internal_Rela *rel, - struct elf_link_hash_entry *h, - Elf_Internal_Sym *sym) -{ - if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - { - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - } - - return NULL; -} - -/* Update the got entry reference counts for the section being removed. */ - -static bfd_boolean -elf32_cr16c_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED, - struct bfd_link_info *info ATTRIBUTE_UNUSED, - asection *sec ATTRIBUTE_UNUSED, - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED) -{ - /* We don't support garbage collection of GOT and PLT relocs yet. */ - return TRUE; -} - /* CR16C ELF uses three common sections: One is for default common symbols (placed in usual common section). Second is for near common symbols (placed in "ncommon" section). @@ -988,11 +957,10 @@ elf32_cr16c_link_output_symbol_hook (struct bfd_link_info *info ATTRIBUTE_UNUSED #define elf_symbol_leading_char '_' #define bfd_elf32_bfd_reloc_type_lookup elf_cr16c_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup elf_cr16c_reloc_name_lookup #define elf_info_to_howto elf_cr16c_info_to_howto #define elf_info_to_howto_rel elf_cr16c_info_to_howto_rel #define elf_backend_relocate_section elf32_cr16c_relocate_section -#define elf_backend_gc_mark_hook elf32_cr16c_gc_mark_hook -#define elf_backend_gc_sweep_hook elf32_cr16c_gc_sweep_hook #define elf_backend_symbol_processing elf32_cr16c_symbol_processing #define elf_backend_section_from_bfd_section elf32_cr16c_section_from_bfd_section #define elf_backend_add_symbol_hook elf32_cr16c_add_symbol_hook diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index 4019e34e26b..04f563bd7bc 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -1,5 +1,5 @@ /* CRIS-specific support for 32-bit ELF. - Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Axis Communications AB. Written by Hans-Peter Nilsson, based on elf32-fr30.c @@ -21,8 +21,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/cris.h" @@ -51,14 +51,6 @@ static bfd_reloc_status_type cris_final_link_relocate PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, bfd_vma)); -static bfd_boolean cris_elf_gc_sweep_hook - PARAMS ((bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *)); - -static asection * cris_elf_gc_mark_hook - PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *)); - static bfd_boolean cris_elf_object_p PARAMS ((bfd *)); static void cris_elf_final_write_processing PARAMS ((bfd *, bfd_boolean)); @@ -465,6 +457,21 @@ cris_reloc_type_lookup (abfd, code) return NULL; } +static reloc_howto_type * +cris_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (cris_elf_howto_table) / sizeof (cris_elf_howto_table[0]); + i++) + if (cris_elf_howto_table[i].name != NULL + && strcasecmp (cris_elf_howto_table[i].name, r_name) == 0) + return &cris_elf_howto_table[i]; + + return NULL; +} + /* Set the howto pointer for an CRIS ELF reloc. */ static void @@ -935,9 +942,6 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocatable) - return TRUE; - dynobj = elf_hash_table (info)->dynobj; local_got_offsets = elf_local_got_offsets (input_bfd); symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; @@ -972,7 +976,6 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, || r_type == R_CRIS_GNU_VTENTRY) continue; - /* This is a final link. */ r_symndx = ELF32_R_SYM (rel->r_info); howto = cris_elf_howto_table + r_type; h = NULL; @@ -1050,7 +1053,7 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, || r_type == R_CRIS_16_PCREL || r_type == R_CRIS_32_PCREL)) relocation = 0; - else if (unresolved_reloc) + else if (!info->relocatable && unresolved_reloc) { _bfd_error_handler (_("%B, section %A: unresolvable relocation %s against symbol `%s'"), @@ -1064,6 +1067,20 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, } } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + switch (r_type) { case R_CRIS_16_GOTPLT: @@ -1388,7 +1405,7 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (input_bfd, input_section), name + 5) == 0); @@ -1438,11 +1455,12 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, } else { + outrel.r_addend = relocation + rel->r_addend; + if (r_type == R_CRIS_32) { relocate = TRUE; outrel.r_info = ELF32_R_INFO (0, R_CRIS_RELATIVE); - outrel.r_addend = relocation + rel->r_addend; } else { @@ -1459,13 +1477,24 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, { asection *osec; + /* We are turning this relocation into one + against a section symbol. It would be + proper to subtract the symbol's value, + osec->vma, from the emitted reloc addend, + but ld.so expects buggy relocs. */ osec = sec->output_section; indx = elf_section_data (osec)->dynindx; - BFD_ASSERT (indx > 0); + if (indx == 0) + { + struct elf_cris_link_hash_table *htab; + htab = elf_cris_hash_table (info); + osec = htab->root.text_index_section; + indx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (indx != 0); } outrel.r_info = ELF32_R_INFO (indx, r_type); - outrel.r_addend = relocation + rel->r_addend; } } @@ -1923,50 +1952,30 @@ elf_cris_finish_dynamic_sections (output_bfd, info) relocation. */ static asection * -cris_elf_gc_mark_hook (sec, info, rel, h, sym) - asection *sec; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +cris_elf_gc_mark_hook (asection *sec, + struct bfd_link_info *info, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_CRIS_GNU_VTINHERIT: - case R_CRIS_GNU_VTENTRY: - break; + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_CRIS_GNU_VTINHERIT: + case R_CRIS_GNU_VTENTRY: + return NULL; + } - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Update the got entry reference counts for the section being removed. */ static bfd_boolean -cris_elf_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - asection *sec ATTRIBUTE_UNUSED; - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED; +cris_elf_gc_sweep_hook (bfd *abfd, + struct bfd_link_info *info, + asection *sec, + const Elf_Internal_Rela *relocs) { Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; @@ -2212,7 +2221,6 @@ elf_cris_adjust_dynamic_symbol (info, h) { bfd *dynobj; asection *s; - unsigned int power_of_two; bfd_size_type plt_entry_size; dynobj = elf_hash_table (info)->dynobj; @@ -2420,31 +2428,7 @@ elf_cris_adjust_dynamic_symbol (info, h) h->needs_copy = 1; } - /* Historic precedent: m68k and i386 allow max 8-byte alignment for the - thing to copy; so do we. */ - - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 3) - power_of_two = 3; - - /* Apply the required alignment. */ - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (dynobj, s)) - { - if (!bfd_set_section_alignment (dynobj, s, power_of_two)) - return FALSE; - } - - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Look through the relocs for a section during the first phase. */ @@ -2799,7 +2783,7 @@ cris_elf_check_relocs (abfd, info, sec, relocs) if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (abfd, sec), name + 5) == 0); @@ -2962,7 +2946,7 @@ elf_cris_size_dynamic_sections (output_bfd, info) /* Remember whether there is a PLT. */ plt = s->size != 0; } - else if (strncmp (name, ".rela", 5) == 0) + else if (CONST_STRNEQ (name, ".rela")) { if (s->size != 0) { @@ -2976,7 +2960,7 @@ elf_cris_size_dynamic_sections (output_bfd, info) s->reloc_count = 0; } } - else if (strncmp (name, ".got", 4) != 0 + else if (! CONST_STRNEQ (name, ".got") && strcmp (name, ".dynbss") != 0) { /* It's not one of our sections, so don't allocate space. */ @@ -3411,6 +3395,7 @@ elf_cris_reloc_type_class (rela) cris_elf_copy_private_bfd_data #define bfd_elf32_bfd_reloc_type_lookup cris_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup cris_reloc_name_lookup #define bfd_elf32_bfd_link_hash_table_create \ elf_cris_link_hash_table_create @@ -3418,6 +3403,7 @@ elf_cris_reloc_type_class (rela) elf_cris_adjust_dynamic_symbol #define elf_backend_size_dynamic_sections \ elf_cris_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_finish_dynamic_symbol \ elf_cris_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections \ @@ -3443,8 +3429,6 @@ elf_cris_reloc_type_class (rela) #include "elf32-target.h" -#define INCLUDED_TARGET_FILE - #undef TARGET_LITTLE_SYM #undef TARGET_LITTLE_NAME #undef elf_symbol_leading_char @@ -3452,5 +3436,7 @@ elf_cris_reloc_type_class (rela) #define TARGET_LITTLE_SYM bfd_elf32_us_cris_vec #define TARGET_LITTLE_NAME "elf32-us-cris" #define elf_symbol_leading_char '_' +#undef elf32_bed +#define elf32_bed elf32_us_cris_bed #include "elf32-target.h" diff --git a/bfd/elf32-crx.c b/bfd/elf32-crx.c index 0a49885a767..f4fe1fa9fc3 100644 --- a/bfd/elf32-crx.c +++ b/bfd/elf32-crx.c @@ -1,5 +1,5 @@ /* BFD back-end for National Semiconductor's CRX ELF - Copyright 2004 Free Software Foundation, Inc. + Copyright 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Tomer Levi, NSC, Israel. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -38,12 +38,6 @@ static bfd_reloc_status_type crx_elf_final_link_relocate static bfd_boolean elf32_crx_relocate_section (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **); -static asection * elf32_crx_gc_mark_hook - (asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *); -static bfd_boolean elf32_crx_gc_sweep_hook - (bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *); static bfd_boolean elf32_crx_relax_section (bfd *, asection *, struct bfd_link_info *, bfd_boolean *); static bfd_byte * elf32_crx_get_relocated_section_contents @@ -405,6 +399,22 @@ elf_crx_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return 0; } +static reloc_howto_type * +elf_crx_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (crx_elf_howto_table) / sizeof (crx_elf_howto_table[0]); + i++) + if (crx_elf_howto_table[i].name != NULL + && strcasecmp (crx_elf_howto_table[i].name, r_name) == 0) + return &crx_elf_howto_table[i]; + + return NULL; +} + /* Retrieve a howto ptr using an internal relocation entry. */ static void @@ -827,9 +837,6 @@ elf32_crx_relocate_section (bfd *output_bfd, struct bfd_link_info *info, struct elf_link_hash_entry **sym_hashes; Elf_Internal_Rela *rel, *relend; - if (info->relocatable) - return TRUE; - symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -869,6 +876,20 @@ elf32_crx_relocate_section (bfd *output_bfd, struct bfd_link_info *info, unresolved_reloc, warned); } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + r = crx_elf_final_link_relocate (howto, input_bfd, output_bfd, input_section, contents, rel->r_offset, @@ -1297,42 +1318,6 @@ elf32_crx_relax_section (bfd *abfd, asection *sec, return FALSE; } -static asection * -elf32_crx_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, - Elf_Internal_Rela *rel ATTRIBUTE_UNUSED, - struct elf_link_hash_entry *h, - Elf_Internal_Sym *sym) -{ - if (h == NULL) - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - return NULL; - } -} - -/* Update the got entry reference counts for the section being removed. */ - -static bfd_boolean -elf32_crx_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED, - struct bfd_link_info *info ATTRIBUTE_UNUSED, - asection *sec ATTRIBUTE_UNUSED, - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED) -{ - /* We don't support garbage collection of GOT and PLT relocs yet. */ - return TRUE; -} - /* Definitions for setting CRX target vector. */ #define TARGET_LITTLE_SYM bfd_elf32_crx_vec #define TARGET_LITTLE_NAME "elf32-crx" @@ -1342,14 +1327,14 @@ elf32_crx_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED, #define elf_symbol_leading_char '_' #define bfd_elf32_bfd_reloc_type_lookup elf_crx_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup \ + elf_crx_reloc_name_lookup #define elf_info_to_howto elf_crx_info_to_howto #define elf_info_to_howto_rel 0 #define elf_backend_relocate_section elf32_crx_relocate_section #define bfd_elf32_bfd_relax_section elf32_crx_relax_section #define bfd_elf32_bfd_get_relocated_section_contents \ elf32_crx_get_relocated_section_contents -#define elf_backend_gc_mark_hook elf32_crx_gc_mark_hook -#define elf_backend_gc_sweep_hook elf32_crx_gc_sweep_hook #define elf_backend_can_gc_sections 1 #define elf_backend_rela_normal 1 diff --git a/bfd/elf32-d10v.c b/bfd/elf32-d10v.c index 293b1419de7..f6a1d926c85 100644 --- a/bfd/elf32-d10v.c +++ b/bfd/elf32-d10v.c @@ -1,6 +1,6 @@ /* D10V-specific support for 32-bit ELF - Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2007 Free Software Foundation, Inc. Contributed by Martin Hunt (hunt@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -20,8 +20,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/d10v.h" @@ -203,6 +203,22 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (elf_d10v_howto_table) / sizeof (elf_d10v_howto_table[0]); + i++) + if (elf_d10v_howto_table[i].name != NULL + && strcasecmp (elf_d10v_howto_table[i].name, r_name) == 0) + return &elf_d10v_howto_table[i]; + + return NULL; +} + /* Set the howto pointer for an D10V ELF reloc. */ static void @@ -219,48 +235,20 @@ d10v_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, static asection * elf32_d10v_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, + struct bfd_link_info *info, Elf_Internal_Rela *rel, struct elf_link_hash_entry *h, Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) + switch (ELF32_R_TYPE (rel->r_info)) { case R_D10V_GNU_VTINHERIT: case R_D10V_GNU_VTENTRY: - break; + return NULL; + } - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; -} - -static bfd_boolean -elf32_d10v_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED, - struct bfd_link_info *info ATTRIBUTE_UNUSED, - asection *sec ATTRIBUTE_UNUSED, - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED) -{ - /* We don't use got and plt entries for d10v. */ - return TRUE; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Look through the relocs for a section during the first phase. @@ -433,35 +421,6 @@ elf32_d10v_relocate_section (bfd *output_bfd, continue; howto = elf_d10v_howto_table + r_type; - - if (info->relocatable) - { - bfd_vma val; - bfd_byte *where; - - /* This is a relocatable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - if (r_symndx >= symtab_hdr->sh_info) - continue; - - sym = local_syms + r_symndx; - if (ELF_ST_TYPE (sym->st_info) != STT_SECTION) - continue; - - sec = local_sections[r_symndx]; - val = sec->output_offset; - if (val == 0) - continue; - - where = contents + rel->r_offset; - val += extract_rel_addend (input_bfd, where, howto); - insert_rel_addend (input_bfd, where, howto, val); - continue; - } - - /* This is a final link. */ h = NULL; sym = NULL; sec = NULL; @@ -472,18 +431,26 @@ elf32_d10v_relocate_section (bfd *output_bfd, relocation = (sec->output_section->vma + sec->output_offset + sym->st_value); - if ((sec->flags & SEC_MERGE) - && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + if (ELF_ST_TYPE (sym->st_info) == STT_SECTION + && ((sec->flags & SEC_MERGE) != 0 + || (info->relocatable + && sec->output_offset != 0))) { - asection *msec; bfd_vma addend; bfd_byte *where = contents + rel->r_offset; addend = extract_rel_addend (input_bfd, where, howto); - msec = sec; - addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend); - addend -= relocation; - addend += msec->output_section->vma + msec->output_offset; + + if (info->relocatable) + addend += sec->output_offset; + else + { + asection *msec = sec; + addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, + addend); + addend -= relocation; + addend += msec->output_section->vma + msec->output_offset; + } insert_rel_addend (input_bfd, where, howto, addend); } } @@ -497,6 +464,20 @@ elf32_d10v_relocate_section (bfd *output_bfd, unresolved_reloc, warned); } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + if (h != NULL) name = h->root.root.string; else @@ -573,7 +554,6 @@ elf32_d10v_relocate_section (bfd *output_bfd, #define elf_backend_object_p 0 #define elf_backend_final_write_processing 0 #define elf_backend_gc_mark_hook elf32_d10v_gc_mark_hook -#define elf_backend_gc_sweep_hook elf32_d10v_gc_sweep_hook #define elf_backend_check_relocs elf32_d10v_check_relocs #define elf_backend_relocate_section elf32_d10v_relocate_section #define elf_backend_can_gc_sections 1 diff --git a/bfd/elf32-d30v.c b/bfd/elf32-d30v.c index c96937d5da0..6bcec43990f 100644 --- a/bfd/elf32-d30v.c +++ b/bfd/elf32-d30v.c @@ -1,5 +1,5 @@ /* D30V-specific support for 32-bit ELF - Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Martin Hunt (hunt@cygnus.com). @@ -20,8 +20,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/d30v.h" @@ -491,6 +491,22 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (elf_d30v_howto_table) / sizeof (elf_d30v_howto_table[0]); + i++) + if (elf_d30v_howto_table[i].name != NULL + && strcasecmp (elf_d30v_howto_table[i].name, r_name) == 0) + return &elf_d30v_howto_table[i]; + + return NULL; +} + /* Set the howto pointer for an D30V ELF reloc (type REL). */ static void diff --git a/bfd/elf32-dlx.c b/bfd/elf32-dlx.c index ae42baf3a63..f57387bf5d6 100644 --- a/bfd/elf32-dlx.c +++ b/bfd/elf32-dlx.c @@ -1,5 +1,6 @@ /* DLX specific support for 32-bit ELF - Copyright 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright 2002, 2003, 2004, 2005, 2007 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +19,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/dlx.h" @@ -27,6 +28,7 @@ #define USE_REL 1 #define bfd_elf32_bfd_reloc_type_lookup elf32_dlx_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup elf32_dlx_reloc_name_lookup #define elf_info_to_howto elf32_dlx_info_to_howto #define elf_info_to_howto_rel elf32_dlx_info_to_howto_rel #define elf_backend_check_relocs elf32_dlx_check_relocs @@ -505,6 +507,31 @@ elf32_dlx_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, } } +static reloc_howto_type * +elf32_dlx_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (dlx_elf_howto_table) / sizeof (dlx_elf_howto_table[0]); + i++) + if (dlx_elf_howto_table[i].name != NULL + && strcasecmp (dlx_elf_howto_table[i].name, r_name) == 0) + return &dlx_elf_howto_table[i]; + + if (strcasecmp (elf_dlx_gnu_rel16_s2.name, r_name) == 0) + return &elf_dlx_gnu_rel16_s2; + if (strcasecmp (elf_dlx_gnu_rel26_s2.name, r_name) == 0) + return &elf_dlx_gnu_rel26_s2; + if (strcasecmp (elf_dlx_reloc_16_hi.name, r_name) == 0) + return &elf_dlx_reloc_16_hi; + if (strcasecmp (elf_dlx_reloc_16_lo.name, r_name) == 0) + return &elf_dlx_reloc_16_lo; + + return NULL; +} + static reloc_howto_type * dlx_rtype_to_howto (unsigned int r_type) { @@ -512,21 +539,15 @@ dlx_rtype_to_howto (unsigned int r_type) { case R_DLX_RELOC_16_PCREL: return & elf_dlx_gnu_rel16_s2; - break; case R_DLX_RELOC_26_PCREL: return & elf_dlx_gnu_rel26_s2; - break; case R_DLX_RELOC_16_HI: return & elf_dlx_reloc_16_hi; - break; case R_DLX_RELOC_16_LO: return & elf_dlx_reloc_16_lo; - break; - default: BFD_ASSERT (r_type < (unsigned int) R_DLX_max); return & dlx_elf_howto_table[r_type]; - break; } } diff --git a/bfd/elf32-fr30.c b/bfd/elf32-fr30.c index e1720796087..df2ebfcb8fc 100644 --- a/bfd/elf32-fr30.c +++ b/bfd/elf32-fr30.c @@ -1,5 +1,5 @@ /* FR30-specific support for 32-bit ELF. - Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/fr30.h" @@ -39,12 +39,6 @@ static bfd_boolean fr30_elf_relocate_section static bfd_reloc_status_type fr30_final_link_relocate PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, bfd_vma)); -static bfd_boolean fr30_elf_gc_sweep_hook - PARAMS ((bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *)); -static asection * fr30_elf_gc_mark_hook - PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *)); static bfd_boolean fr30_elf_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); @@ -372,6 +366,21 @@ fr30_reloc_type_lookup (abfd, code) return NULL; } +static reloc_howto_type * +fr30_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (fr30_elf_howto_table) / sizeof (fr30_elf_howto_table[0]); + i++) + if (fr30_elf_howto_table[i].name != NULL + && strcasecmp (fr30_elf_howto_table[i].name, r_name) == 0) + return &fr30_elf_howto_table[i]; + + return NULL; +} + /* Set the howto pointer for an FR30 ELF reloc. */ static void @@ -516,9 +525,6 @@ fr30_elf_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocatable) - return TRUE; - symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); relend = relocs + input_section->reloc_count; @@ -570,6 +576,20 @@ fr30_elf_relocate_section (output_bfd, info, input_bfd, input_section, name = h->root.root.string; } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + r = fr30_final_link_relocate (howto, input_bfd, input_section, contents, rel, relocation); @@ -624,52 +644,21 @@ fr30_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation. */ static asection * -fr30_elf_gc_mark_hook (sec, info, rel, h, sym) - asection *sec; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym * sym; +fr30_elf_gc_mark_hook (asection *sec, + struct bfd_link_info *info, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_FR30_GNU_VTINHERIT: - case R_FR30_GNU_VTENTRY: - break; + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_FR30_GNU_VTINHERIT: + case R_FR30_GNU_VTENTRY: + return NULL; + } - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; -} - -/* Update the got entry reference counts for the section being removed. */ - -static bfd_boolean -fr30_elf_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - asection *sec ATTRIBUTE_UNUSED; - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED; -{ - return TRUE; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Look through the relocs for a section during the first phase. @@ -747,12 +736,12 @@ fr30_elf_check_relocs (abfd, info, sec, relocs) #define elf_info_to_howto fr30_info_to_howto_rela #define elf_backend_relocate_section fr30_elf_relocate_section #define elf_backend_gc_mark_hook fr30_elf_gc_mark_hook -#define elf_backend_gc_sweep_hook fr30_elf_gc_sweep_hook #define elf_backend_check_relocs fr30_elf_check_relocs #define elf_backend_can_gc_sections 1 #define elf_backend_rela_normal 1 #define bfd_elf32_bfd_reloc_type_lookup fr30_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup fr30_reloc_name_lookup #include "elf32-target.h" diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c index 1758e27591f..97cce0b7629 100644 --- a/bfd/elf32-frv.c +++ b/bfd/elf32-frv.c @@ -1,5 +1,6 @@ /* FRV-specific support for 32-bit ELF. - Copyright 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +18,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/frv.h" @@ -57,12 +58,6 @@ static bfd_boolean elf32_frv_add_symbol_hook static bfd_reloc_status_type frv_final_link_relocate PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, bfd_vma)); -static bfd_boolean elf32_frv_gc_sweep_hook - PARAMS ((bfd *, struct bfd_link_info *, asection *, const - Elf_Internal_Rela *)); -static asection * elf32_frv_gc_mark_hook - PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *)); static bfd_boolean elf32_frv_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); @@ -2595,6 +2590,26 @@ frv_reloc_type_lookup (abfd, code) return NULL; } +static reloc_howto_type * +frv_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (elf32_frv_howto_table) / sizeof (elf32_frv_howto_table[0]); + i++) + if (elf32_frv_howto_table[i].name != NULL + && strcasecmp (elf32_frv_howto_table[i].name, r_name) == 0) + return &elf32_frv_howto_table[i]; + + if (strcasecmp (elf32_frv_vtinherit_howto.name, r_name) == 0) + return &elf32_frv_vtinherit_howto; + if (strcasecmp (elf32_frv_vtentry_howto.name, r_name) == 0) + return &elf32_frv_vtentry_howto; + + return NULL; +} + /* Set the howto pointer for an FRV ELF reloc. */ static void @@ -2728,9 +2743,6 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section, int silence_segment_error = !(info->shared || info->pie); unsigned long insn; - if (info->relocatable) - return TRUE; - symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); relend = relocs + input_section->reloc_count; @@ -2782,7 +2794,6 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section, || r_type == R_FRV_GNU_VTENTRY) continue; - /* This is a final link. */ r_symndx = ELF32_R_SYM (rel->r_info); howto = elf32_frv_howto_table + ELF32_R_TYPE (rel->r_info); h = NULL; @@ -2801,52 +2812,40 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section, } else { - h = sym_hashes [r_symndx - symtab_hdr->sh_info]; + bfd_boolean warned; + bfd_boolean unresolved_reloc; - while (h->root.type == bfd_link_hash_indirect - || h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - - name = h->root.root.string; - - if ((h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak)) - { - if (/* TLSMOFF forces local binding. */ - r_type != R_FRV_TLSMOFF - && ! FRVFDPIC_SYM_LOCAL (info, h)) - { - sec = NULL; - relocation = 0; - } - else - { - sec = h->root.u.def.section; - relocation = (h->root.u.def.value - + sec->output_section->vma - + sec->output_offset); - } - } - else if (h->root.type == bfd_link_hash_undefweak) - { - relocation = 0; - } - else if (info->unresolved_syms_in_objects == RM_IGNORE - && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - relocation = 0; - else - { - if (! ((*info->callbacks->undefined_symbol) - (info, h->root.root.string, input_bfd, - input_section, rel->r_offset, - (info->unresolved_syms_in_objects == RM_GENERATE_ERROR - || ELF_ST_VISIBILITY (h->other))))) - return FALSE; - relocation = 0; - } + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, + unresolved_reloc, warned); osec = sec; } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + + if (r_type != R_FRV_TLSMOFF + && h != NULL + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && !FRVFDPIC_SYM_LOCAL (info, h)) + { + osec = sec = NULL; + relocation = 0; + } + switch (r_type) { case R_FRV_LABEL24: @@ -3645,6 +3644,8 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section, input_section->output_section) & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD)) { + bfd_vma offset; + if (_frvfdpic_osec_readonly_p (output_bfd, input_section ->output_section)) @@ -3655,22 +3656,27 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section, name, input_bfd, input_section, rel->r_offset); return FALSE; } - _frvfdpic_add_rofixup (output_bfd, - frvfdpic_gotfixup_section - (info), - _bfd_elf_section_offset - (output_bfd, info, - input_section, rel->r_offset) - + input_section - ->output_section->vma - + input_section->output_offset, - picrel); + + offset = _bfd_elf_section_offset + (output_bfd, info, + input_section, rel->r_offset); + + if (offset != (bfd_vma)-1) + _frvfdpic_add_rofixup (output_bfd, + frvfdpic_gotfixup_section + (info), + offset + input_section + ->output_section->vma + + input_section->output_offset, + picrel); } } else if ((bfd_get_section_flags (output_bfd, input_section->output_section) & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD)) { + bfd_vma offset; + if (_frvfdpic_osec_readonly_p (output_bfd, input_section ->output_section)) @@ -3681,15 +3687,18 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section, name, input_bfd, input_section, rel->r_offset); return FALSE; } - _frvfdpic_add_dyn_reloc (output_bfd, - frvfdpic_gotrel_section (info), - _bfd_elf_section_offset - (output_bfd, info, - input_section, rel->r_offset) - + input_section - ->output_section->vma - + input_section->output_offset, - r_type, dynindx, addend, picrel); + + offset = _bfd_elf_section_offset + (output_bfd, info, + input_section, rel->r_offset); + + if (offset != (bfd_vma)-1) + _frvfdpic_add_dyn_reloc (output_bfd, + frvfdpic_gotrel_section (info), + offset + input_section + ->output_section->vma + + input_section->output_offset, + r_type, dynindx, addend, picrel); } else addend += frvfdpic_got_section (info)->output_section->vma; @@ -3770,25 +3779,27 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section, } if (!h || h->root.type != bfd_link_hash_undefweak) { - _frvfdpic_add_rofixup (output_bfd, - frvfdpic_gotfixup_section - (info), - _bfd_elf_section_offset - (output_bfd, info, - input_section, rel->r_offset) - + input_section - ->output_section->vma - + input_section->output_offset, - picrel); - if (r_type == R_FRV_FUNCDESC_VALUE) - _frvfdpic_add_rofixup - (output_bfd, - frvfdpic_gotfixup_section (info), - _bfd_elf_section_offset - (output_bfd, info, - input_section, rel->r_offset) - + input_section->output_section->vma - + input_section->output_offset + 4, picrel); + bfd_vma offset = _bfd_elf_section_offset + (output_bfd, info, + input_section, rel->r_offset); + + if (offset != (bfd_vma)-1) + { + _frvfdpic_add_rofixup (output_bfd, + frvfdpic_gotfixup_section + (info), + offset + input_section + ->output_section->vma + + input_section->output_offset, + picrel); + if (r_type == R_FRV_FUNCDESC_VALUE) + _frvfdpic_add_rofixup + (output_bfd, + frvfdpic_gotfixup_section (info), + offset + + input_section->output_section->vma + + input_section->output_offset + 4, picrel); + } } } } @@ -3798,6 +3809,8 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section, input_section->output_section) & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD)) { + bfd_vma offset; + if (_frvfdpic_osec_readonly_p (output_bfd, input_section ->output_section)) @@ -3808,15 +3821,18 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section, name, input_bfd, input_section, rel->r_offset); return FALSE; } - _frvfdpic_add_dyn_reloc (output_bfd, - frvfdpic_gotrel_section (info), - _bfd_elf_section_offset - (output_bfd, info, - input_section, rel->r_offset) - + input_section - ->output_section->vma - + input_section->output_offset, - r_type, dynindx, addend, picrel); + + offset = _bfd_elf_section_offset + (output_bfd, info, + input_section, rel->r_offset); + + if (offset != (bfd_vma)-1) + _frvfdpic_add_dyn_reloc (output_bfd, + frvfdpic_gotrel_section (info), + offset + input_section + ->output_section->vma + + input_section->output_offset, + r_type, dynindx, addend, picrel); } else if (osec) addend += osec->output_section->vma; @@ -4145,54 +4161,22 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section, relocation. */ static asection * -elf32_frv_gc_mark_hook (sec, info, rel, h, sym) - asection *sec; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +elf32_frv_gc_mark_hook (asection *sec, + struct bfd_link_info *info, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_FRV_GNU_VTINHERIT: - case R_FRV_GNU_VTENTRY: - break; + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_FRV_GNU_VTINHERIT: + case R_FRV_GNU_VTENTRY: + return NULL; + } - default: - switch (h->root.type) - { - default: - break; - - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } - -/* Update the got entry reference counts for the section being removed. */ - -static bfd_boolean -elf32_frv_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - asection *sec ATTRIBUTE_UNUSED; - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED; -{ - return TRUE; -} - /* Hook called by the linker routine which adds symbols from an object file. We use it to put .comm items in .scomm, and not .comm. */ @@ -5603,7 +5587,6 @@ elf32_frvfdpic_always_size_sections (bfd *output_bfd, if (!info->relocatable) { struct elf_link_hash_entry *h; - asection *sec; /* Force a PT_GNU_STACK segment to be created. */ if (! elf_tdata (output_bfd)->stack_flags) @@ -5630,12 +5613,121 @@ elf32_frvfdpic_always_size_sections (bfd *output_bfd, h->type = STT_OBJECT; /* This one must NOT be hidden. */ } + } - /* Create a stack section, and set its alignment. */ - sec = bfd_make_section (output_bfd, ".stack"); + return TRUE; +} - if (sec == NULL - || ! bfd_set_section_alignment (output_bfd, sec, 3)) +/* Check whether any of the relocations was optimized away, and + subtract it from the relocation or fixup count. */ +static bfd_boolean +_frvfdpic_check_discarded_relocs (bfd *abfd, asection *sec, + struct bfd_link_info *info, + + bfd_boolean *changed) +{ + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes, **sym_hashes_end; + Elf_Internal_Rela *rel, *erel; + + if ((sec->flags & SEC_RELOC) == 0 + || sec->reloc_count == 0) + return TRUE; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (abfd); + sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf32_External_Sym); + if (!elf_bad_symtab (abfd)) + sym_hashes_end -= symtab_hdr->sh_info; + + rel = elf_section_data (sec)->relocs; + + /* Now examine each relocation. */ + for (erel = rel + sec->reloc_count; rel < erel; rel++) + { + struct elf_link_hash_entry *h; + unsigned long r_symndx; + struct frvfdpic_relocs_info *picrel; + struct _frvfdpic_dynamic_got_info *dinfo; + + if (ELF32_R_TYPE (rel->r_info) != R_FRV_32 + && ELF32_R_TYPE (rel->r_info) != R_FRV_FUNCDESC) + continue; + + if (_bfd_elf_section_offset (sec->output_section->owner, + info, sec, rel->r_offset) + != (bfd_vma)-1) + continue; + + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx < symtab_hdr->sh_info) + h = NULL; + else + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *)h->root.u.i.link; + } + + if (h != NULL) + picrel = frvfdpic_relocs_info_for_global (frvfdpic_relocs_info (info), + abfd, h, + rel->r_addend, NO_INSERT); + else + picrel = frvfdpic_relocs_info_for_local (frvfdpic_relocs_info (info), + abfd, r_symndx, + rel->r_addend, NO_INSERT); + + if (! picrel) + return FALSE; + + *changed = TRUE; + dinfo = frvfdpic_dynamic_got_plt_info (info); + + _frvfdpic_count_relocs_fixups (picrel, dinfo, TRUE); + if (ELF32_R_TYPE (rel->r_info) == R_FRV_32) + picrel->relocs32--; + else /* we know (ELF32_R_TYPE (rel->r_info) == R_FRV_FUNCDESC) */ + picrel->relocsfd--; + _frvfdpic_count_relocs_fixups (picrel, dinfo, FALSE); + } + + return TRUE; +} + +static bfd_boolean +frvfdpic_elf_discard_info (bfd *ibfd, + struct elf_reloc_cookie *cookie ATTRIBUTE_UNUSED, + struct bfd_link_info *info) +{ + bfd_boolean changed = FALSE; + asection *s; + bfd *obfd = NULL; + + /* Account for relaxation of .eh_frame section. */ + for (s = ibfd->sections; s; s = s->next) + if (s->sec_info_type == ELF_INFO_TYPE_EH_FRAME) + { + if (!_frvfdpic_check_discarded_relocs (ibfd, s, info, &changed)) + return FALSE; + obfd = s->output_section->owner; + } + + if (changed) + { + struct _frvfdpic_dynamic_got_plt_info gpinfo; + + memset (&gpinfo, 0, sizeof (gpinfo)); + memcpy (&gpinfo.g, frvfdpic_dynamic_got_plt_info (info), + sizeof (gpinfo.g)); + + /* Clear GOT and PLT assignments. */ + htab_traverse (frvfdpic_relocs_info (info), + _frvfdpic_reset_got_plt_entries, + NULL); + + if (!_frvfdpic_size_got_plt (obfd, &gpinfo)) return FALSE; } @@ -5718,48 +5810,45 @@ elf32_frvfdpic_relax_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, } static bfd_boolean -elf32_frvfdpic_modify_segment_map (bfd *output_bfd, - struct bfd_link_info *info) +elf32_frvfdpic_modify_program_headers (bfd *output_bfd, + struct bfd_link_info *info) { + struct elf_obj_tdata *tdata = elf_tdata (output_bfd); struct elf_segment_map *m; + Elf_Internal_Phdr *p; /* objcopy and strip preserve what's already there using elf32_frvfdpic_copy_private_bfd_data (). */ if (! info) return TRUE; - for (m = elf_tdata (output_bfd)->segment_map; m != NULL; m = m->next) + for (p = tdata->phdr, m = tdata->segment_map; m != NULL; m = m->next, p++) if (m->p_type == PT_GNU_STACK) break; if (m) { - asection *sec = bfd_get_section_by_name (output_bfd, ".stack"); struct elf_link_hash_entry *h; - if (sec) + /* Obtain the pointer to the __stacksize symbol. */ + h = elf_link_hash_lookup (elf_hash_table (info), "__stacksize", + FALSE, FALSE, FALSE); + if (h) { - /* Obtain the pointer to the __stacksize symbol. */ - h = elf_link_hash_lookup (elf_hash_table (info), "__stacksize", - FALSE, FALSE, FALSE); while (h->root.type == bfd_link_hash_indirect || h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *)h->root.u.i.link; + h = (struct elf_link_hash_entry *) h->root.u.i.link; BFD_ASSERT (h->root.type == bfd_link_hash_defined); - - /* Set the section size from the symbol value. We - intentionally ignore the symbol section. */ - if (h->root.type == bfd_link_hash_defined) - sec->size = h->root.u.def.value; - else - sec->size = DEFAULT_STACK_SIZE; - - /* Add the stack section to the PT_GNU_STACK segment, - such that its size and alignment requirements make it - to the segment. */ - m->sections[m->count] = sec; - m->count++; } + + /* Set the header p_memsz from the symbol value. We + intentionally ignore the symbol section. */ + if (h && h->root.type == bfd_link_hash_defined) + p->p_memsz = h->root.u.def.value; + else + p->p_memsz = DEFAULT_STACK_SIZE; + + p->p_align = 8; } return TRUE; @@ -6401,6 +6490,10 @@ frv_elf_copy_private_bfd_data (ibfd, obfd) elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; elf_flags_init (obfd) = TRUE; + + /* Copy object attributes. */ + _bfd_elf_copy_obj_attributes (ibfd, obfd); + return TRUE; } @@ -6922,7 +7015,6 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) #define elf_info_to_howto frv_info_to_howto_rela #define elf_backend_relocate_section elf32_frv_relocate_section #define elf_backend_gc_mark_hook elf32_frv_gc_mark_hook -#define elf_backend_gc_sweep_hook elf32_frv_gc_sweep_hook #define elf_backend_check_relocs elf32_frv_check_relocs #define elf_backend_object_p elf32_frv_object_p #define elf_backend_add_symbol_hook elf32_frv_add_symbol_hook @@ -6931,6 +7023,7 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) #define elf_backend_rela_normal 1 #define bfd_elf32_bfd_reloc_type_lookup frv_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup frv_reloc_name_lookup #define bfd_elf32_bfd_set_private_flags frv_elf_set_private_flags #define bfd_elf32_bfd_copy_private_bfd_data frv_elf_copy_private_bfd_data #define bfd_elf32_bfd_merge_private_bfd_data frv_elf_merge_private_bfd_data @@ -6970,9 +7063,9 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) #undef elf_backend_always_size_sections #define elf_backend_always_size_sections \ elf32_frvfdpic_always_size_sections -#undef elf_backend_modify_segment_map -#define elf_backend_modify_segment_map \ - elf32_frvfdpic_modify_segment_map +#undef elf_backend_modify_program_headers +#define elf_backend_modify_program_headers \ + elf32_frvfdpic_modify_program_headers #undef bfd_elf32_bfd_copy_private_bfd_data #define bfd_elf32_bfd_copy_private_bfd_data \ elf32_frvfdpic_copy_private_bfd_data @@ -6996,6 +7089,9 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) #define elf_backend_finish_dynamic_sections \ elf32_frvfdpic_finish_dynamic_sections +#undef elf_backend_discard_info +#define elf_backend_discard_info \ + frvfdpic_elf_discard_info #undef elf_backend_can_make_relative_eh_frame #define elf_backend_can_make_relative_eh_frame \ frvfdpic_elf_use_relative_eh_frame diff --git a/bfd/elf32-gen.c b/bfd/elf32-gen.c index 23c74767799..ef7d4e2308d 100644 --- a/bfd/elf32-gen.c +++ b/bfd/elf32-gen.c @@ -1,5 +1,5 @@ /* Generic support for 32-bit ELF - Copyright 1993, 1995, 1998, 1999, 2001, 2002, 2004, 2005 + Copyright 1993, 1995, 1998, 1999, 2001, 2002, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" @@ -94,6 +94,7 @@ elf32_generic_link_add_symbols (bfd *abfd, struct bfd_link_info *info) #define ELF_MACHINE_CODE EM_NONE #define ELF_MAXPAGESIZE 0x1 #define bfd_elf32_bfd_reloc_type_lookup bfd_default_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup #define bfd_elf32_bfd_link_add_symbols elf32_generic_link_add_symbols #define elf_info_to_howto elf_generic_info_to_howto #define elf_info_to_howto_rel elf_generic_info_to_howto_rel diff --git a/bfd/elf32-h8300.c b/bfd/elf32-h8300.c index 4cdf2defb58..17e8e30f68d 100644 --- a/bfd/elf32-h8300.c +++ b/bfd/elf32-h8300.c @@ -1,6 +1,6 @@ /* BFD back-end for Renesas H8/300 ELF binaries. - Copyright 1993, 1995, 1998, 1999, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright 1993, 1995, 1998, 1999, 2001, 2002, 2003, 2004, 2005, 2006, + 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/h8.h" @@ -42,11 +42,6 @@ static bfd_boolean elf32_h8_symbol_address_p (bfd *, asection *, bfd_vma); static bfd_byte *elf32_h8_get_relocated_section_contents (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, bfd_boolean, asymbol **); -static asection *elf32_h8_gc_mark_hook - (asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *); -static bfd_boolean elf32_h8_gc_sweep_hook - (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *); static bfd_reloc_status_type elf32_h8_final_link_relocate (unsigned long, bfd *, bfd *, asection *, bfd_byte *, bfd_vma, bfd_vma, bfd_vma, @@ -256,6 +251,22 @@ elf32_h8_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +elf32_h8_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (h8_elf_howto_table) / sizeof (h8_elf_howto_table[0]); + i++) + if (h8_elf_howto_table[i].name != NULL + && strcasecmp (h8_elf_howto_table[i].name, r_name) == 0) + return &h8_elf_howto_table[i]; + + return NULL; +} + static void elf32_h8_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc) @@ -407,9 +418,6 @@ elf32_h8_relocate_section (bfd *output_bfd, struct bfd_link_info *info, struct elf_link_hash_entry **sym_hashes; Elf_Internal_Rela *rel, *relend; - if (info->relocatable) - return TRUE; - symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -424,8 +432,12 @@ elf32_h8_relocate_section (bfd *output_bfd, struct bfd_link_info *info, struct elf_link_hash_entry *h; bfd_vma relocation; bfd_reloc_status_type r; + arelent bfd_reloc; + reloc_howto_type *howto; + + elf32_h8_info_to_howto (input_bfd, &bfd_reloc, rel); + howto = bfd_reloc.howto; - /* This is a final link. */ r_symndx = ELF32_R_SYM (rel->r_info); r_type = ELF32_R_TYPE (rel->r_info); h = NULL; @@ -447,6 +459,20 @@ elf32_h8_relocate_section (bfd *output_bfd, struct bfd_link_info *info, unresolved_reloc, warned); } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + r = elf32_h8_final_link_relocate (r_type, input_bfd, output_bfd, input_section, contents, rel->r_offset, @@ -457,11 +483,6 @@ elf32_h8_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { const char *name; const char *msg = (const char *) 0; - arelent bfd_reloc; - reloc_howto_type *howto; - - elf32_h8_info_to_howto (input_bfd, &bfd_reloc, rel); - howto = bfd_reloc.howto; if (h != NULL) name = h->root.root.string; @@ -1490,42 +1511,6 @@ elf32_h8_get_relocated_section_contents (bfd *output_bfd, return NULL; } -static asection * -elf32_h8_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, - Elf_Internal_Rela *rel ATTRIBUTE_UNUSED, - struct elf_link_hash_entry *h, - Elf_Internal_Sym *sym) -{ - if (h != NULL) - { - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - return NULL; -} - -static bfd_boolean -elf32_h8_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED, - struct bfd_link_info *info ATTRIBUTE_UNUSED, - asection *sec ATTRIBUTE_UNUSED, - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED) -{ - return TRUE; -} - #define TARGET_BIG_SYM bfd_elf32_h8300_vec #define TARGET_BIG_NAME "elf32-h8300" @@ -1533,6 +1518,7 @@ elf32_h8_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED, #define ELF_MACHINE_CODE EM_H8_300 #define ELF_MAXPAGESIZE 0x1 #define bfd_elf32_bfd_reloc_type_lookup elf32_h8_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup elf32_h8_reloc_name_lookup #define elf_info_to_howto elf32_h8_info_to_howto #define elf_info_to_howto_rel elf32_h8_info_to_howto_rel @@ -1544,8 +1530,6 @@ elf32_h8_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED, elf32_h8_object_p #define bfd_elf32_bfd_merge_private_bfd_data \ elf32_h8_merge_private_bfd_data -#define elf_backend_gc_mark_hook elf32_h8_gc_mark_hook -#define elf_backend_gc_sweep_hook elf32_h8_gc_sweep_hook /* ??? when elf_backend_relocate_section is not defined, elf32-target.h defaults to using _bfd_generic_link_hash_table_create, but diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index 51c210e5b1c..49529210c53 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -1,13 +1,15 @@ /* BFD back-end for HP PA-RISC ELF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Original code by Center for Software Science Department of Computer Science University of Utah Largely rewritten by Alan Modra - + Naming cleanup by Carlos O'Donell + TLS support written by Randolph Chung + This file is part of BFD, the Binary File Descriptor library. This program is free software; you can redistribute it and/or modify @@ -24,8 +26,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/hppa.h" @@ -168,7 +170,8 @@ static const bfd_byte plt_stub[] = shared lib. */ #define ELIMINATE_COPY_RELOCS 1 -enum elf32_hppa_stub_type { +enum elf32_hppa_stub_type +{ hppa_stub_long_branch, hppa_stub_long_branch_shared, hppa_stub_import, @@ -177,8 +180,8 @@ enum elf32_hppa_stub_type { hppa_stub_none }; -struct elf32_hppa_stub_hash_entry { - +struct elf32_hppa_stub_hash_entry +{ /* Base hash table entry structure. */ struct bfd_hash_entry bh_root; @@ -203,8 +206,8 @@ struct elf32_hppa_stub_hash_entry { asection *id_sec; }; -struct elf32_hppa_link_hash_entry { - +struct elf32_hppa_link_hash_entry +{ struct elf_link_hash_entry eh; /* A pointer to the most recently used stub hash entry against this @@ -213,8 +216,8 @@ struct elf32_hppa_link_hash_entry { /* Used to count relocations for delayed sizing of relocation sections. */ - struct elf32_hppa_dyn_reloc_entry { - + struct elf32_hppa_dyn_reloc_entry + { /* Next relocation in the chain. */ struct elf32_hppa_dyn_reloc_entry *hdh_next; @@ -230,12 +233,17 @@ struct elf32_hppa_link_hash_entry { #endif } *dyn_relocs; + enum + { + GOT_UNKNOWN = 0, GOT_NORMAL = 1, GOT_TLS_GD = 2, GOT_TLS_LDM = 4, GOT_TLS_IE = 8 + } tls_type; + /* Set if this symbol is used by a plabel reloc. */ unsigned int plabel:1; }; -struct elf32_hppa_link_hash_table { - +struct elf32_hppa_link_hash_table +{ /* The main hash table. */ struct elf_link_hash_table etab; @@ -251,7 +259,8 @@ struct elf32_hppa_link_hash_table { /* Array to keep track of which stub sections have been created, and information on stub grouping. */ - struct map_stub { + struct map_stub + { /* This is the section to which stubs in the group will be attached. */ asection *link_sec; @@ -292,6 +301,13 @@ struct elf32_hppa_link_hash_table { /* Small local sym to section mapping cache. */ struct sym_sec_cache sym_sec; + + /* Data for LDM relocations. */ + union + { + bfd_signed_vma refcount; + bfd_vma offset; + } tls_ldm_got; }; /* Various hash macros and functions. */ @@ -308,6 +324,15 @@ struct elf32_hppa_link_hash_table { ((struct elf32_hppa_stub_hash_entry *) \ bfd_hash_lookup ((table), (string), (create), (copy))) +#define hppa_elf_local_got_tls_type(abfd) \ + ((char *)(elf_local_got_offsets (abfd) + (elf_tdata (abfd)->symtab_hdr.sh_info * 2))) + +#define hh_name(hh) \ + (hh ? hh->eh.root.root.string : "") + +#define eh_name(eh) \ + (eh ? eh->root.root.string : "") + /* Assorted hash table functions. */ /* Initialize an entry in the stub hash table. */ @@ -375,6 +400,7 @@ hppa_link_hash_newfunc (struct bfd_hash_entry *entry, hh->hsh_cache = NULL; hh->dyn_relocs = NULL; hh->plabel = 0; + hh->tls_type = GOT_UNKNOWN; } return entry; @@ -390,7 +416,7 @@ elf32_hppa_link_hash_table_create (bfd *abfd) struct elf32_hppa_link_hash_table *htab; bfd_size_type amt = sizeof (*htab); - htab = (struct elf32_hppa_link_hash_table *) bfd_malloc (amt); + htab = bfd_malloc (amt); if (htab == NULL) return NULL; @@ -424,6 +450,7 @@ elf32_hppa_link_hash_table_create (bfd *abfd) htab->has_22bit_branch = 0; htab->need_plt_stub = 0; htab->sym_sec.abfd = NULL; + htab->tls_ldm_got.refcount = 0; return &htab->etab.root; } @@ -453,28 +480,24 @@ hppa_stub_name (const asection *input_section, if (hh) { - len = 8 + 1 + strlen (hh->eh.root.root.string) + 1 + 8 + 1; + len = 8 + 1 + strlen (hh_name (hh)) + 1 + 8 + 1; stub_name = bfd_malloc (len); if (stub_name != NULL) - { - sprintf (stub_name, "%08x_%s+%x", - input_section->id & 0xffffffff, - hh->eh.root.root.string, - (int) rela->r_addend & 0xffffffff); - } + sprintf (stub_name, "%08x_%s+%x", + input_section->id & 0xffffffff, + hh_name (hh), + (int) rela->r_addend & 0xffffffff); } else { len = 8 + 1 + 8 + 1 + 8 + 1 + 8 + 1; stub_name = bfd_malloc (len); if (stub_name != NULL) - { - sprintf (stub_name, "%08x_%x:%x+%x", - input_section->id & 0xffffffff, - sym_sec->id & 0xffffffff, - (int) ELF32_R_SYM (rela->r_info) & 0xffffffff, - (int) rela->r_addend & 0xffffffff); - } + sprintf (stub_name, "%08x_%x:%x+%x", + input_section->id & 0xffffffff, + sym_sec->id & 0xffffffff, + (int) ELF32_R_SYM (rela->r_info) & 0xffffffff, + (int) rela->r_addend & 0xffffffff); } return stub_name; } @@ -620,17 +643,13 @@ hppa_type_of_stub (asection *input_sec, bytes on from the branch instruction location. The offset is signed and counts in units of 4 bytes. */ if (r_type == (unsigned int) R_PARISC_PCREL17F) - { - max_branch_offset = (1 << (17-1)) << 2; - } + max_branch_offset = (1 << (17 - 1)) << 2; + else if (r_type == (unsigned int) R_PARISC_PCREL12F) - { - max_branch_offset = (1 << (12-1)) << 2; - } + max_branch_offset = (1 << (12 - 1)) << 2; + else /* R_PARISC_PCREL22F. */ - { - max_branch_offset = (1 << (22-1)) << 2; - } + max_branch_offset = (1 << (22 - 1)) << 2; if (branch_offset + max_branch_offset >= 2*max_branch_offset) return hppa_stub_long_branch; @@ -1063,7 +1082,24 @@ elf32_hppa_copy_indirect_symbol (struct bfd_link_info *info, eh_dir->needs_plt |= eh_ind->needs_plt; } else - _bfd_elf_link_hash_copy_indirect (info, eh_dir, eh_ind); + { + if (eh_ind->root.type == bfd_link_hash_indirect + && eh_dir->got.refcount <= 0) + { + hh_dir->tls_type = hh_ind->tls_type; + hh_ind->tls_type = GOT_UNKNOWN; + } + + _bfd_elf_link_hash_copy_indirect (info, eh_dir, eh_ind); + } +} + +static int +elf32_hppa_optimized_tls_reloc (struct bfd_link_info *info ATTRIBUTE_UNUSED, + int r_type, int is_local ATTRIBUTE_UNUSED) +{ + /* For now we don't support linker optimizations. */ + return r_type; } /* Look through the relocs for a section during the first phase, and @@ -1084,6 +1120,7 @@ elf32_hppa_check_relocs (bfd *abfd, struct elf32_hppa_link_hash_table *htab; asection *sreloc; asection *stubreloc; + int tls_type = GOT_UNKNOWN, old_tls_type = GOT_UNKNOWN; if (info->relocatable) return TRUE; @@ -1121,6 +1158,7 @@ elf32_hppa_check_relocs (bfd *abfd, } r_type = ELF32_R_TYPE (rela->r_info); + r_type = elf32_hppa_optimized_tls_reloc (info, r_type, hh == NULL); switch (r_type) { @@ -1243,6 +1281,20 @@ elf32_hppa_check_relocs (bfd *abfd, return FALSE; continue; + case R_PARISC_TLS_GD21L: + case R_PARISC_TLS_GD14R: + case R_PARISC_TLS_LDM21L: + case R_PARISC_TLS_LDM14R: + need_entry = NEED_GOT; + break; + + case R_PARISC_TLS_IE21L: + case R_PARISC_TLS_IE14R: + if (info->shared) + info->flags |= DF_STATIC_TLS; + need_entry = NEED_GOT; + break; + default: continue; } @@ -1250,6 +1302,25 @@ elf32_hppa_check_relocs (bfd *abfd, /* Now carry out our orders. */ if (need_entry & NEED_GOT) { + switch (r_type) + { + default: + tls_type = GOT_NORMAL; + break; + case R_PARISC_TLS_GD21L: + case R_PARISC_TLS_GD14R: + tls_type |= GOT_TLS_GD; + break; + case R_PARISC_TLS_LDM21L: + case R_PARISC_TLS_LDM14R: + tls_type |= GOT_TLS_LDM; + break; + case R_PARISC_TLS_IE21L: + case R_PARISC_TLS_IE14R: + tls_type |= GOT_TLS_IE; + break; + } + /* Allocate space for a GOT entry, as well as a dynamic relocation for this entry. */ if (htab->sgot == NULL) @@ -1260,31 +1331,56 @@ elf32_hppa_check_relocs (bfd *abfd, return FALSE; } - if (hh != NULL) - { - hh->eh.got.refcount += 1; - } + if (r_type == R_PARISC_TLS_LDM21L + || r_type == R_PARISC_TLS_LDM14R) + hppa_link_hash_table (info)->tls_ldm_got.refcount += 1; else { - bfd_signed_vma *local_got_refcounts; - /* This is a global offset table entry for a local symbol. */ - local_got_refcounts = elf_local_got_refcounts (abfd); - if (local_got_refcounts == NULL) - { - bfd_size_type size; + if (hh != NULL) + { + hh->eh.got.refcount += 1; + old_tls_type = hh->tls_type; + } + else + { + bfd_signed_vma *local_got_refcounts; + + /* This is a global offset table entry for a local symbol. */ + local_got_refcounts = elf_local_got_refcounts (abfd); + if (local_got_refcounts == NULL) + { + bfd_size_type size; + + /* Allocate space for local got offsets and local + plt offsets. Done this way to save polluting + elf_obj_tdata with another target specific + pointer. */ + size = symtab_hdr->sh_info; + size *= 2 * sizeof (bfd_signed_vma); + /* Add in space to store the local GOT TLS types. */ + size += symtab_hdr->sh_info; + local_got_refcounts = bfd_zalloc (abfd, size); + if (local_got_refcounts == NULL) + return FALSE; + elf_local_got_refcounts (abfd) = local_got_refcounts; + memset (hppa_elf_local_got_tls_type (abfd), + GOT_UNKNOWN, symtab_hdr->sh_info); + } + local_got_refcounts[r_symndx] += 1; + + old_tls_type = hppa_elf_local_got_tls_type (abfd) [r_symndx]; + } + + tls_type |= old_tls_type; + + if (old_tls_type != tls_type) + { + if (hh != NULL) + hh->tls_type = tls_type; + else + hppa_elf_local_got_tls_type (abfd) [r_symndx] = tls_type; + } - /* Allocate space for local got offsets and local - plt offsets. Done this way to save polluting - elf_obj_tdata with another target specific - pointer. */ - size = symtab_hdr->sh_info; - size *= 2 * sizeof (bfd_signed_vma); - local_got_refcounts = bfd_zalloc (abfd, size); - if (local_got_refcounts == NULL) - return FALSE; - elf_local_got_refcounts (abfd) = local_got_refcounts; - } - local_got_refcounts[r_symndx] += 1; } } @@ -1325,6 +1421,8 @@ elf32_hppa_check_relocs (bfd *abfd, plt offsets. */ size = symtab_hdr->sh_info; size *= 2 * sizeof (bfd_signed_vma); + /* Add in space to store the local GOT TLS types. */ + size += symtab_hdr->sh_info; local_got_refcounts = bfd_zalloc (abfd, size); if (local_got_refcounts == NULL) return FALSE; @@ -1490,38 +1588,20 @@ elf32_hppa_check_relocs (bfd *abfd, static asection * elf32_hppa_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, + struct bfd_link_info *info, Elf_Internal_Rela *rela, struct elf_link_hash_entry *hh, Elf_Internal_Sym *sym) { if (hh != NULL) - { - switch ((unsigned int) ELF32_R_TYPE (rela->r_info)) - { - case R_PARISC_GNU_VTINHERIT: - case R_PARISC_GNU_VTENTRY: - break; + switch ((unsigned int) ELF32_R_TYPE (rela->r_info)) + { + case R_PARISC_GNU_VTINHERIT: + case R_PARISC_GNU_VTENTRY: + return NULL; + } - default: - switch (hh->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return hh->root.u.def.section; - - case bfd_link_hash_common: - return hh->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rela, hh, sym); } /* Update the got and plt entry reference counts for the section being @@ -1578,11 +1658,17 @@ elf32_hppa_gc_sweep_hook (bfd *abfd, } r_type = ELF32_R_TYPE (rela->r_info); + r_type = elf32_hppa_optimized_tls_reloc (info, r_type, eh != NULL); + switch (r_type) { case R_PARISC_DLTIND14F: case R_PARISC_DLTIND14R: case R_PARISC_DLTIND21L: + case R_PARISC_TLS_GD21L: + case R_PARISC_TLS_GD14R: + case R_PARISC_TLS_IE21L: + case R_PARISC_TLS_IE14R: if (eh != NULL) { if (eh->got.refcount > 0) @@ -1595,6 +1681,11 @@ elf32_hppa_gc_sweep_hook (bfd *abfd, } break; + case R_PARISC_TLS_LDM21L: + case R_PARISC_TLS_LDM14R: + hppa_link_hash_table (info)->tls_ldm_got.refcount -= 1; + break; + case R_PARISC_PCREL12F: case R_PARISC_PCREL17C: case R_PARISC_PCREL17F: @@ -1709,7 +1800,7 @@ elf32_hppa_hide_symbol (struct bfd_link_info *info, } } - if (! hppa_elf_hash_entry(eh)->plabel) + if (! hppa_elf_hash_entry (eh)->plabel) { eh->needs_plt = 0; eh->plt = elf_hash_table (info)->init_plt_refcount; @@ -1728,7 +1819,6 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info, { struct elf32_hppa_link_hash_table *htab; asection *sec; - unsigned int power_of_two; /* If this is a function, put it in the procedure linkage table. We will fill in the contents of the procedure linkage table later. */ @@ -1838,30 +1928,9 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info, eh->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how other ELF linkers handle this. */ - - power_of_two = bfd_log2 (eh->size); - if (power_of_two > 3) - power_of_two = 3; - - /* Apply the required alignment. */ sec = htab->sdynbss; - sec->size = BFD_ALIGN (sec->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (htab->etab.dynobj, sec)) - { - if (! bfd_set_section_alignment (htab->etab.dynobj, sec, power_of_two)) - return FALSE; - } - /* Define the symbol as being at this point in the section. */ - eh->root.u.def.section = sec; - eh->root.u.def.value = sec->size; - - /* Increment the section size to make room for the symbol. */ - sec->size += eh->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (eh, sec); } /* Allocate space in the .plt for entries that won't have relocations. @@ -1882,7 +1951,7 @@ allocate_plt_static (struct elf_link_hash_entry *eh, void *inf) eh = (struct elf_link_hash_entry *) eh->root.u.i.link; info = (struct bfd_link_info *) inf; - hh = hppa_elf_hash_entry(eh); + hh = hppa_elf_hash_entry (eh); htab = hppa_link_hash_table (info); if (htab->etab.dynamic_sections_created && eh->plt.refcount > 0) @@ -1982,12 +2051,21 @@ allocate_dynrelocs (struct elf_link_hash_entry *eh, void *inf) sec = htab->sgot; eh->got.offset = sec->size; sec->size += GOT_ENTRY_SIZE; + /* R_PARISC_TLS_GD* needs two GOT entries */ + if ((hh->tls_type & (GOT_TLS_GD | GOT_TLS_IE)) == (GOT_TLS_GD | GOT_TLS_IE)) + sec->size += GOT_ENTRY_SIZE * 2; + else if ((hh->tls_type & GOT_TLS_GD) == GOT_TLS_GD) + sec->size += GOT_ENTRY_SIZE; if (htab->etab.dynamic_sections_created && (info->shared || (eh->dynindx != -1 && !eh->forced_local))) { htab->srelgot->size += sizeof (Elf32_External_Rela); + if ((hh->tls_type & (GOT_TLS_GD | GOT_TLS_IE)) == (GOT_TLS_GD | GOT_TLS_IE)) + htab->srelgot->size += 2 * sizeof (Elf32_External_Rela); + else if ((hh->tls_type & GOT_TLS_GD) == GOT_TLS_GD) + htab->srelgot->size += sizeof (Elf32_External_Rela); } } else @@ -2181,6 +2259,7 @@ elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, bfd_size_type locsymcount; Elf_Internal_Shdr *symtab_hdr; asection *srel; + char *local_tls_type; if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour) continue; @@ -2219,6 +2298,7 @@ elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; locsymcount = symtab_hdr->sh_info; end_local_got = local_got + locsymcount; + local_tls_type = hppa_elf_local_got_tls_type (ibfd); sec = htab->sgot; srel = htab->srelgot; for (; local_got < end_local_got; ++local_got) @@ -2227,11 +2307,23 @@ elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, { *local_got = sec->size; sec->size += GOT_ENTRY_SIZE; + if ((*local_tls_type & (GOT_TLS_GD | GOT_TLS_IE)) == (GOT_TLS_GD | GOT_TLS_IE)) + sec->size += 2 * GOT_ENTRY_SIZE; + else if ((*local_tls_type & GOT_TLS_GD) == GOT_TLS_GD) + sec->size += GOT_ENTRY_SIZE; if (info->shared) - srel->size += sizeof (Elf32_External_Rela); + { + srel->size += sizeof (Elf32_External_Rela); + if ((*local_tls_type & (GOT_TLS_GD | GOT_TLS_IE)) == (GOT_TLS_GD | GOT_TLS_IE)) + srel->size += 2 * sizeof (Elf32_External_Rela); + else if ((*local_tls_type & GOT_TLS_GD) == GOT_TLS_GD) + srel->size += sizeof (Elf32_External_Rela); + } } else *local_got = (bfd_vma) -1; + + ++local_tls_type; } local_plt = end_local_got; @@ -2260,6 +2352,17 @@ elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, } } } + + if (htab->tls_ldm_got.refcount > 0) + { + /* Allocate 2 got entries and 1 dynamic reloc for + R_PARISC_TLS_DTPMOD32 relocs. */ + htab->tls_ldm_got.offset = htab->sgot->size; + htab->sgot->size += (GOT_ENTRY_SIZE * 2); + htab->srelgot->size += sizeof (Elf32_External_Rela); + } + else + htab->tls_ldm_got.offset = -1; /* Do all the .plt entries without relocs first. The dynamic linker uses the last .plt reloc to find the end of the .plt (and hence @@ -2299,7 +2402,7 @@ elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, else if (sec == htab->sgot || sec == htab->sdynbss) ; - else if (strncmp (bfd_get_section_name (dynobj, sec), ".rela", 5) == 0) + else if (CONST_STRNEQ (bfd_get_section_name (dynobj, sec), ".rela")) { if (sec->size != 0) { @@ -2670,7 +2773,7 @@ get_local_syms (bfd *output_bfd, bfd *input_bfd, struct bfd_link_info *info) struct elf32_hppa_stub_hash_entry *hsh; sec = hh->eh.root.u.def.section; - stub_name = hh->eh.root.root.string; + stub_name = hh_name (hh); hsh = hppa_stub_hash_lookup (&htab->bstab, stub_name, FALSE, FALSE); @@ -3104,6 +3207,35 @@ elf32_hppa_build_stubs (struct bfd_link_info *info) return TRUE; } +/* Return the base vma address which should be subtracted from the real + address when resolving a dtpoff relocation. + This is PT_TLS segment p_vaddr. */ + +static bfd_vma +dtpoff_base (struct bfd_link_info *info) +{ + /* If tls_sec is NULL, we should have signalled an error already. */ + if (elf_hash_table (info)->tls_sec == NULL) + return 0; + return elf_hash_table (info)->tls_sec->vma; +} + +/* Return the relocation value for R_PARISC_TLS_TPOFF*.. */ + +static bfd_vma +tpoff (struct bfd_link_info *info, bfd_vma address) +{ + struct elf_link_hash_table *htab = elf_hash_table (info); + + /* If tls_sec is NULL, we should have signalled an error already. */ + if (htab->tls_sec == NULL) + return 0; + /* hppa TLS ABI is variant I and static TLS block start just after + tcbhead structure which has 2 pointer fields. */ + return (address - htab->tls_sec->vma + + align_power ((bfd_vma) 8, htab->tls_sec->alignment_power)); +} + /* Perform a final link. */ static bfd_boolean @@ -3315,6 +3447,12 @@ final_link_relocate (asection *input_section, case R_PARISC_DLTIND21L: case R_PARISC_DLTIND14R: case R_PARISC_DLTIND14F: + case R_PARISC_TLS_GD21L: + case R_PARISC_TLS_GD14R: + case R_PARISC_TLS_LDM21L: + case R_PARISC_TLS_LDM14R: + case R_PARISC_TLS_IE21L: + case R_PARISC_TLS_IE14R: value -= elf_gp (input_section->output_section->owner); break; @@ -3342,6 +3480,9 @@ final_link_relocate (asection *input_section, case R_PARISC_DLTIND14F: case R_PARISC_SEGBASE: case R_PARISC_SEGREL32: + case R_PARISC_TLS_DTPMOD32: + case R_PARISC_TLS_DTPOFF32: + case R_PARISC_TLS_TPREL32: r_field = e_fsel; break; @@ -3353,6 +3494,11 @@ final_link_relocate (asection *input_section, case R_PARISC_DIR21L: case R_PARISC_DPREL21L: + case R_PARISC_TLS_GD21L: + case R_PARISC_TLS_LDM21L: + case R_PARISC_TLS_LDO21L: + case R_PARISC_TLS_IE21L: + case R_PARISC_TLS_LE21L: r_field = e_lrsel; break; @@ -3366,6 +3512,11 @@ final_link_relocate (asection *input_section, case R_PARISC_DIR17R: case R_PARISC_DIR14R: case R_PARISC_DPREL14R: + case R_PARISC_TLS_GD14R: + case R_PARISC_TLS_LDM14R: + case R_PARISC_TLS_LDO14R: + case R_PARISC_TLS_IE14R: + case R_PARISC_TLS_LE14R: r_field = e_rrsel; break; @@ -3478,9 +3629,6 @@ elf32_hppa_relocate_section (bfd *output_bfd, Elf_Internal_Rela *rela; Elf_Internal_Rela *relend; - if (info->relocatable) - return TRUE; - symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; htab = hppa_link_hash_table (info); @@ -3512,7 +3660,6 @@ elf32_hppa_relocate_section (bfd *output_bfd, || r_type == (unsigned int) R_PARISC_GNU_VTINHERIT) continue; - /* This is a final link. */ r_symndx = ELF32_R_SYM (rela->r_info); hh = NULL; sym = NULL; @@ -3536,7 +3683,8 @@ elf32_hppa_relocate_section (bfd *output_bfd, eh, sym_sec, relocation, unresolved_reloc, warned_undef); - if (relocation == 0 + if (!info->relocatable + && relocation == 0 && eh->root.type != bfd_link_hash_defined && eh->root.type != bfd_link_hash_defweak && eh->root.type != bfd_link_hash_undefweak) @@ -3546,7 +3694,7 @@ elf32_hppa_relocate_section (bfd *output_bfd, && eh->type == STT_PARISC_MILLI) { if (! info->callbacks->undefined_symbol - (info, eh->root.root.string, input_bfd, + (info, eh_name (eh), input_bfd, input_section, rela->r_offset, FALSE)) return FALSE; warned_undef = TRUE; @@ -3555,6 +3703,22 @@ elf32_hppa_relocate_section (bfd *output_bfd, hh = hppa_elf_hash_entry (eh); } + if (sym_sec != NULL && elf_discarded_section (sym_sec)) + { + /* For relocs against symbols from removed linkonce + sections, or sections discarded by a linker script, + we just want the section contents zeroed. Avoid any + special processing. */ + _bfd_clear_contents (elf_hppa_howto_table + r_type, input_bfd, + contents + rela->r_offset); + rela->r_info = 0; + rela->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + /* Do any required modifications to the relocation value, and determine what types of dynamic info we need to output, if any. */ @@ -3766,11 +3930,7 @@ elf32_hppa_relocate_section (bfd *output_bfd, case R_PARISC_DPREL14R: case R_PARISC_DPREL21L: case R_PARISC_DIR32: - /* r_symndx will be zero only for relocs against symbols - from removed linkonce sections, or sections discarded by - a linker script. */ - if (r_symndx == 0 - || (input_section->flags & SEC_ALLOC) == 0) + if ((input_section->flags & SEC_ALLOC) == 0) break; /* The reloc types handled here and this conditional @@ -3851,17 +4011,22 @@ elf32_hppa_relocate_section (bfd *output_bfd, && sym_sec->output_section != NULL && ! bfd_is_abs_section (sym_sec)) { - /* Skip this relocation if the output section has - been discarded. */ - if (bfd_is_abs_section (sym_sec->output_section)) - break; + asection *osec; + + osec = sym_sec->output_section; + indx = elf_section_data (osec)->dynindx; + if (indx == 0) + { + osec = htab->etab.text_index_section; + indx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (indx != 0); - indx = elf_section_data (sym_sec->output_section)->dynindx; /* We are turning this relocation into one against a section symbol, so subtract out the output section's address but not the offset of the input section in the output section. */ - outrel.r_addend -= sym_sec->output_section->vma; + outrel.r_addend -= osec->vma; } outrel.r_info = ELF32_R_INFO (indx, r_type); @@ -3875,6 +4040,198 @@ elf32_hppa_relocate_section (bfd *output_bfd, bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); } break; + + case R_PARISC_TLS_LDM21L: + case R_PARISC_TLS_LDM14R: + { + bfd_vma off; + + off = htab->tls_ldm_got.offset; + if (off & 1) + off &= ~1; + else + { + Elf_Internal_Rela outrel; + bfd_byte *loc; + + outrel.r_offset = (off + + htab->sgot->output_section->vma + + htab->sgot->output_offset); + outrel.r_addend = 0; + outrel.r_info = ELF32_R_INFO (0, R_PARISC_TLS_DTPMOD32); + loc = htab->srelgot->contents; + loc += htab->srelgot->reloc_count++ * sizeof (Elf32_External_Rela); + + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + htab->tls_ldm_got.offset |= 1; + } + + /* Add the base of the GOT to the relocation value. */ + relocation = (off + + htab->sgot->output_offset + + htab->sgot->output_section->vma); + + break; + } + + case R_PARISC_TLS_LDO21L: + case R_PARISC_TLS_LDO14R: + relocation -= dtpoff_base (info); + break; + + case R_PARISC_TLS_GD21L: + case R_PARISC_TLS_GD14R: + case R_PARISC_TLS_IE21L: + case R_PARISC_TLS_IE14R: + { + bfd_vma off; + int indx; + char tls_type; + + indx = 0; + if (hh != NULL) + { + bfd_boolean dyn; + dyn = htab->etab.dynamic_sections_created; + + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, &hh->eh) + && (!info->shared + || !SYMBOL_REFERENCES_LOCAL (info, &hh->eh))) + { + indx = hh->eh.dynindx; + } + off = hh->eh.got.offset; + tls_type = hh->tls_type; + } + else + { + off = local_got_offsets[r_symndx]; + tls_type = hppa_elf_local_got_tls_type (input_bfd)[r_symndx]; + } + + if (tls_type == GOT_UNKNOWN) + abort (); + + if ((off & 1) != 0) + off &= ~1; + else + { + bfd_boolean need_relocs = FALSE; + Elf_Internal_Rela outrel; + bfd_byte *loc = NULL; + int cur_off = off; + + /* The GOT entries have not been initialized yet. Do it + now, and emit any relocations. If both an IE GOT and a + GD GOT are necessary, we emit the GD first. */ + + if ((info->shared || indx != 0) + && (hh == NULL + || ELF_ST_VISIBILITY (hh->eh.other) == STV_DEFAULT + || hh->eh.root.type != bfd_link_hash_undefweak)) + { + need_relocs = TRUE; + loc = htab->srelgot->contents; + /* FIXME (CAO): Should this be reloc_count++ ? */ + loc += htab->srelgot->reloc_count * sizeof (Elf32_External_Rela); + } + + if (tls_type & GOT_TLS_GD) + { + if (need_relocs) + { + outrel.r_offset = (cur_off + + htab->sgot->output_section->vma + + htab->sgot->output_offset); + outrel.r_info = ELF32_R_INFO (indx,R_PARISC_TLS_DTPMOD32); + outrel.r_addend = 0; + bfd_put_32 (output_bfd, 0, htab->sgot->contents + cur_off); + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + htab->srelgot->reloc_count++; + loc += sizeof (Elf32_External_Rela); + + if (indx == 0) + bfd_put_32 (output_bfd, relocation - dtpoff_base (info), + htab->sgot->contents + cur_off + 4); + else + { + bfd_put_32 (output_bfd, 0, + htab->sgot->contents + cur_off + 4); + outrel.r_info = ELF32_R_INFO (indx, R_PARISC_TLS_DTPOFF32); + outrel.r_offset += 4; + bfd_elf32_swap_reloca_out (output_bfd, &outrel,loc); + htab->srelgot->reloc_count++; + loc += sizeof (Elf32_External_Rela); + } + } + else + { + /* If we are not emitting relocations for a + general dynamic reference, then we must be in a + static link or an executable link with the + symbol binding locally. Mark it as belonging + to module 1, the executable. */ + bfd_put_32 (output_bfd, 1, + htab->sgot->contents + cur_off); + bfd_put_32 (output_bfd, relocation - dtpoff_base (info), + htab->sgot->contents + cur_off + 4); + } + + + cur_off += 8; + } + + if (tls_type & GOT_TLS_IE) + { + if (need_relocs) + { + outrel.r_offset = (cur_off + + htab->sgot->output_section->vma + + htab->sgot->output_offset); + outrel.r_info = ELF32_R_INFO (indx, R_PARISC_TLS_TPREL32); + + if (indx == 0) + outrel.r_addend = relocation - dtpoff_base (info); + else + outrel.r_addend = 0; + + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + htab->srelgot->reloc_count++; + loc += sizeof (Elf32_External_Rela); + } + else + bfd_put_32 (output_bfd, tpoff (info, relocation), + htab->sgot->contents + cur_off); + + cur_off += 4; + } + + if (hh != NULL) + hh->eh.got.offset |= 1; + else + local_got_offsets[r_symndx] |= 1; + } + + if ((tls_type & GOT_TLS_GD) + && r_type != R_PARISC_TLS_GD21L + && r_type != R_PARISC_TLS_GD14R) + off += 2 * GOT_ENTRY_SIZE; + + /* Add the base of the GOT to the relocation value. */ + relocation = (off + + htab->sgot->output_offset + + htab->sgot->output_section->vma); + + break; + } + + case R_PARISC_TLS_LE21L: + case R_PARISC_TLS_LE14R: + { + relocation = tpoff (info, relocation); + break; + } + break; default: break; @@ -3887,7 +4244,7 @@ elf32_hppa_relocate_section (bfd *output_bfd, continue; if (hh != NULL) - sym_name = hh->eh.root.root.string; + sym_name = hh_name (hh); else { sym_name = bfd_elf_string_from_elf_section (input_bfd, @@ -3996,7 +4353,9 @@ elf32_hppa_finish_dynamic_symbol (bfd *output_bfd, } } - if (eh->got.offset != (bfd_vma) -1) + if (eh->got.offset != (bfd_vma) -1 + && (hppa_elf_hash_entry (eh)->tls_type & GOT_TLS_GD) == 0 + && (hppa_elf_hash_entry (eh)->tls_type & GOT_TLS_IE) == 0) { /* This symbol has an entry in the global offset table. Set it up. */ @@ -4057,8 +4416,8 @@ elf32_hppa_finish_dynamic_symbol (bfd *output_bfd, } /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ - if (eh->root.root.string[0] == '_' - && (strcmp (eh->root.root.string, "_DYNAMIC") == 0 + if (eh_name (eh)[0] == '_' + && (strcmp (eh_name (eh), "_DYNAMIC") == 0 || eh == htab->etab.hgot)) { sym->st_shndx = SHN_ABS; @@ -4073,6 +4432,17 @@ elf32_hppa_finish_dynamic_symbol (bfd *output_bfd, static enum elf_reloc_type_class elf32_hppa_reloc_type_class (const Elf_Internal_Rela *rela) { + /* Handle TLS relocs first; we don't want them to be marked + relative by the "if (ELF32_R_SYM (rela->r_info) == 0)" + check below. */ + switch ((int) ELF32_R_TYPE (rela->r_info)) + { + case R_PARISC_TLS_DTPMOD32: + case R_PARISC_TLS_DTPOFF32: + case R_PARISC_TLS_TPREL32: + return reloc_class_normal; + } + if (ELF32_R_SYM (rela->r_info) == 0) return reloc_class_relative; @@ -4209,30 +4579,6 @@ elf32_hppa_finish_dynamic_sections (bfd *output_bfd, return TRUE; } -/* Tweak the OSABI field of the elf header. */ - -static void -elf32_hppa_post_process_headers (bfd *abfd, - struct bfd_link_info *info ATTRIBUTE_UNUSED) -{ - Elf_Internal_Ehdr * i_ehdrp; - - i_ehdrp = elf_elfheader (abfd); - - if (strcmp (bfd_get_target (abfd), "elf32-hppa-linux") == 0) - { - i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_LINUX; - } - else if (strcmp (bfd_get_target (abfd), "elf32-hppa-netbsd") == 0) - { - i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_NETBSD; - } - else - { - i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_HPUX; - } -} - /* Called when writing out an object file to decide the type of a symbol. */ static int @@ -4247,6 +4593,7 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type) /* Misc BFD support code. */ #define bfd_elf32_bfd_is_local_label_name elf_hppa_is_local_label_name #define bfd_elf32_bfd_reloc_type_lookup elf_hppa_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup elf_hppa_reloc_name_lookup #define elf_info_to_howto elf_hppa_info_to_howto #define elf_info_to_howto_rel elf_hppa_info_to_howto_rel @@ -4264,13 +4611,14 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type) #define elf_backend_finish_dynamic_symbol elf32_hppa_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections elf32_hppa_finish_dynamic_sections #define elf_backend_size_dynamic_sections elf32_hppa_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_gc_mark_hook elf32_hppa_gc_mark_hook #define elf_backend_gc_sweep_hook elf32_hppa_gc_sweep_hook #define elf_backend_grok_prstatus elf32_hppa_grok_prstatus #define elf_backend_grok_psinfo elf32_hppa_grok_psinfo #define elf_backend_object_p elf32_hppa_object_p #define elf_backend_final_write_processing elf_hppa_final_write_processing -#define elf_backend_post_process_headers elf32_hppa_post_process_headers +#define elf_backend_post_process_headers _bfd_elf_set_osabi #define elf_backend_get_symbol_type elf32_hppa_elf_get_symbol_type #define elf_backend_reloc_type_class elf32_hppa_reloc_type_class #define elf_backend_action_discarded elf_hppa_action_discarded @@ -4289,20 +4637,29 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type) #define ELF_ARCH bfd_arch_hppa #define ELF_MACHINE_CODE EM_PARISC #define ELF_MAXPAGESIZE 0x1000 +#define ELF_OSABI ELFOSABI_HPUX +#define elf32_bed elf32_hppa_hpux_bed #include "elf32-target.h" #undef TARGET_BIG_SYM -#define TARGET_BIG_SYM bfd_elf32_hppa_linux_vec +#define TARGET_BIG_SYM bfd_elf32_hppa_linux_vec #undef TARGET_BIG_NAME -#define TARGET_BIG_NAME "elf32-hppa-linux" +#define TARGET_BIG_NAME "elf32-hppa-linux" +#undef ELF_OSABI +#define ELF_OSABI ELFOSABI_LINUX +#undef elf32_bed +#define elf32_bed elf32_hppa_linux_bed -#define INCLUDED_TARGET_FILE 1 #include "elf32-target.h" #undef TARGET_BIG_SYM -#define TARGET_BIG_SYM bfd_elf32_hppa_nbsd_vec +#define TARGET_BIG_SYM bfd_elf32_hppa_nbsd_vec #undef TARGET_BIG_NAME -#define TARGET_BIG_NAME "elf32-hppa-netbsd" +#define TARGET_BIG_NAME "elf32-hppa-netbsd" +#undef ELF_OSABI +#define ELF_OSABI ELFOSABI_NETBSD +#undef elf32_bed +#define elf32_bed elf32_hppa_netbsd_bed #include "elf32-target.h" diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c index d9e6fbf5280..0ec34b872e1 100644 --- a/bfd/elf32-i370.c +++ b/bfd/elf32-i370.c @@ -1,6 +1,6 @@ /* i370-specific support for 32-bit ELF - Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, + 2005, 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. Hacked by Linas Vepstas for i370 linas@linas.org @@ -27,8 +27,8 @@ else is a wild card. In particular, don't expect shared libs or dynamic loading to work ... its never been tested. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -267,6 +267,22 @@ i370_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return i370_elf_howto_table[ (int)i370_reloc ]; }; +static reloc_howto_type * +i370_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (i370_elf_howto_raw) / sizeof (i370_elf_howto_raw[0]); + i++) + if (i370_elf_howto_raw[i].name != NULL + && strcasecmp (i370_elf_howto_raw[i].name, r_name) == 0) + return &i370_elf_howto_raw[i]; + + return NULL; +} + /* The name of the dynamic interpreter. This is put in the .interp section. */ @@ -445,7 +461,6 @@ i370_elf_adjust_dynamic_symbol (struct bfd_link_info *info, { bfd *dynobj = elf_hash_table (info)->dynobj; asection *s; - unsigned int power_of_two; #ifdef DEBUG fprintf (stderr, "i370_elf_adjust_dynamic_symbol called for %s\n", @@ -530,28 +545,7 @@ i370_elf_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 4) - power_of_two = 4; - - /* Apply the required alignment. */ - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (dynobj, s)) - { - if (! bfd_set_section_alignment (dynobj, s, power_of_two)) - return FALSE; - } - - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Increment the index of a dynamic symbol by a given amount. Called @@ -567,7 +561,7 @@ i370_elf_adjust_dynindx (struct elf_link_hash_entry *h, void * cparg) #ifdef DEBUG fprintf (stderr, - "i370_elf_adjust_dynindx called, h->dynindx = %d, *cp = %d\n", + "i370_elf_adjust_dynindx called, h->dynindx = %ld, *cp = %d\n", h->dynindx, *cp); #endif @@ -655,7 +649,7 @@ i370_elf_size_dynamic_sections (bfd *output_bfd, /* Remember whether there is a PLT. */ plt = s->size != 0; } - else if (strncmp (name, ".rela", 5) == 0) + else if (CONST_STRNEQ (name, ".rela")) { if (s->size != 0) { @@ -867,7 +861,7 @@ i370_elf_check_relocs (bfd *abfd, if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (abfd, sec), name + 5) == 0); sreloc = bfd_get_section_by_name (dynobj, name); @@ -1077,9 +1071,6 @@ i370_elf_relocate_section (bfd *output_bfd, bfd_vma *local_got_offsets; bfd_boolean ret = TRUE; - if (info->relocatable) - return TRUE; - #ifdef DEBUG _bfd_error_handler ("i370_elf_relocate_section called for %B section %A, %ld relocations%s", input_bfd, input_section, @@ -1122,6 +1113,7 @@ i370_elf_relocate_section (bfd *output_bfd, howto = i370_elf_howto_table[(int) r_type]; r_symndx = ELF32_R_SYM (rel->r_info); + relocation = 0; if (r_symndx < symtab_hdr->sh_info) { @@ -1154,18 +1146,18 @@ i370_elf_relocate_section (bfd *output_bfd, /* In these cases, we don't need the relocation value. We check specially because in some obscure cases sec->output_section will be NULL. */ - relocation = 0; + ; else relocation = (h->root.u.def.value + sec->output_section->vma + sec->output_offset); } else if (h->root.type == bfd_link_hash_undefweak) - relocation = 0; + ; else if (info->unresolved_syms_in_objects == RM_IGNORE && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - relocation = 0; - else + ; + else if (!info->relocatable) { if ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, @@ -1176,10 +1168,23 @@ i370_elf_relocate_section (bfd *output_bfd, ret = FALSE; continue; } - relocation = 0; } } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + switch ((int) r_type) { default: @@ -1236,7 +1241,7 @@ i370_elf_relocate_section (bfd *output_bfd, if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (input_bfd, input_section), name + 5) == 0); @@ -1290,13 +1295,25 @@ i370_elf_relocate_section (bfd *output_bfd, { asection *osec; + /* We are turning this relocation into one + against a section symbol. It would be + proper to subtract the symbol's value, + osec->vma, from the emitted reloc addend, + but ld.so expects buggy relocs. */ osec = sec->output_section; indx = elf_section_data (osec)->dynindx; - BFD_ASSERT(indx > 0); + if (indx == 0) + { + struct elf_link_hash_table *htab; + htab = elf_hash_table (info); + osec = htab->text_index_section; + indx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (indx != 0); #ifdef DEBUG if (indx <= 0) { - printf ("indx=%d section=%s flags=%08x name=%s\n", + printf ("indx=%ld section=%s flags=%08x name=%s\n", indx, osec->name, osec->flags, h->root.root.string); } @@ -1394,16 +1411,6 @@ i370_elf_relocate_section (bfd *output_bfd, return ret; } - -static void -i370_elf_post_process_headers (bfd * abfd, - struct bfd_link_info * link_info ATTRIBUTE_UNUSED) -{ - Elf_Internal_Ehdr * i_ehdrp; /* Elf file header, internal form. */ - - i_ehdrp = elf_elfheader (abfd); - i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_LINUX; -} #define TARGET_BIG_SYM bfd_elf32_i370_vec #define TARGET_BIG_NAME "elf32-i370" @@ -1413,12 +1420,15 @@ i370_elf_post_process_headers (bfd * abfd, #define ELF_MACHINE_ALT1 EM_I370_OLD #endif #define ELF_MAXPAGESIZE 0x1000 +#define ELF_OSABI ELFOSABI_LINUX + #define elf_info_to_howto i370_elf_info_to_howto #define elf_backend_plt_not_loaded 1 #define elf_backend_rela_normal 1 #define bfd_elf32_bfd_reloc_type_lookup i370_elf_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup i370_elf_reloc_name_lookup #define bfd_elf32_bfd_set_private_flags i370_elf_set_private_flags #define bfd_elf32_bfd_merge_private_bfd_data i370_elf_merge_private_bfd_data #define elf_backend_relocate_section i370_elf_relocate_section @@ -1427,12 +1437,13 @@ i370_elf_post_process_headers (bfd * abfd, link glibc's ld.so without errors. */ #define elf_backend_create_dynamic_sections i370_elf_create_dynamic_sections #define elf_backend_size_dynamic_sections i370_elf_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_finish_dynamic_sections i370_elf_finish_dynamic_sections #define elf_backend_fake_sections i370_elf_fake_sections #define elf_backend_section_from_shdr i370_elf_section_from_shdr #define elf_backend_adjust_dynamic_symbol i370_elf_adjust_dynamic_symbol #define elf_backend_check_relocs i370_elf_check_relocs -#define elf_backend_post_process_headers i370_elf_post_process_headers +#define elf_backend_post_process_headers _bfd_elf_set_osabi static int i370_noop (void) @@ -1440,19 +1451,9 @@ i370_noop (void) return 1; } -/* We need to define these at least as no-ops to link glibc ld.so. */ - -#define elf_backend_add_symbol_hook \ - (bfd_boolean (*) \ - (bfd *, struct bfd_link_info *, Elf_Internal_Sym *, \ - const char **, flagword *, asection **, bfd_vma *)) i370_noop #define elf_backend_finish_dynamic_symbol \ (bfd_boolean (*) \ (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, \ Elf_Internal_Sym *)) i370_noop -#define elf_backend_additional_program_headers \ - (int (*) (bfd *)) i370_noop -#define elf_backend_modify_segment_map \ - (bfd_boolean (*) (bfd *, struct bfd_link_info *)) i370_noop #include "elf32-target.h" diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 754aa52254d..0e023df4ad0 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -1,6 +1,6 @@ /* Intel 80386/80486-specific support for 32-bit ELF Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -330,6 +330,20 @@ elf_i386_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return 0; } +static reloc_howto_type * +elf_i386_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; i < sizeof (elf_howto_table) / sizeof (elf_howto_table[0]); i++) + if (elf_howto_table[i].name != NULL + && strcasecmp (elf_howto_table[i].name, r_name) == 0) + return &elf_howto_table[i]; + + return NULL; +} + static void elf_i386_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, @@ -582,10 +596,6 @@ struct elf_i386_link_hash_entry #define GOT_TLS_IE_NEG 6 #define GOT_TLS_IE_BOTH 7 #define GOT_TLS_GDESC 8 -#define GOT_TLS_MASK 0x0f -#define GOT_TLS_IE_IE 0x10 -#define GOT_TLS_IE_GD 0x20 -#define GOT_TLS_IE_MASK 0x30 #define GOT_TLS_GD_BOTH_P(type) \ ((type) == (GOT_TLS_GD | GOT_TLS_GDESC)) #define GOT_TLS_GD_P(type) \ @@ -626,11 +636,14 @@ struct elf_i386_obj_tdata static bfd_boolean elf_i386_mkobject (bfd *abfd) { - bfd_size_type amt = sizeof (struct elf_i386_obj_tdata); - abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) - return FALSE; - return TRUE; + { + bfd_size_type amt = sizeof (struct elf_i386_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + } + return bfd_elf_mkobject (abfd); } /* i386 ELF linker hash table. */ @@ -1011,25 +1024,12 @@ elf_i386_check_relocs (bfd *abfd, case R_386_TLS_IE_32: if (ELF32_R_TYPE (rel->r_info) == r_type) tls_type = GOT_TLS_IE_NEG; - else if (h - && ELF32_R_TYPE (rel->r_info) == R_386_TLS_GD) - /* If this is a GD->IE transition, we may use either - of R_386_TLS_TPOFF and R_386_TLS_TPOFF32. But if - we may have both R_386_TLS_IE and R_386_TLS_GD, - we can't share the same R_386_TLS_TPOFF since - they require different offsets. So we remember - it comes from R_386_TLS_GD. */ - tls_type = GOT_TLS_IE | GOT_TLS_IE_GD; else + /* If this is a GD->IE transition, we may use either of + R_386_TLS_TPOFF and R_386_TLS_TPOFF32. */ tls_type = GOT_TLS_IE; break; case R_386_TLS_IE: - if (h) - { - /* We remember it comes from R_386_TLS_IE. */ - tls_type = GOT_TLS_IE_POS | GOT_TLS_IE_IE; - break; - } case R_386_TLS_GOTIE: tls_type = GOT_TLS_IE_POS; break; } @@ -1069,8 +1069,7 @@ elf_i386_check_relocs (bfd *abfd, tls_type |= old_tls_type; /* If a TLS symbol is accessed using IE at least once, there is no point to use dynamic model for it. */ - else if (old_tls_type != tls_type - && old_tls_type != GOT_UNKNOWN + else if (old_tls_type != tls_type && old_tls_type != GOT_UNKNOWN && (! GOT_TLS_GD_ANY_P (old_tls_type) || (tls_type & GOT_TLS_IE) == 0)) { @@ -1165,7 +1164,7 @@ elf_i386_check_relocs (bfd *abfd, && (sec->flags & SEC_ALLOC) != 0 && (r_type != R_386_PC32 || (h != NULL - && (! info->symbolic + && (! SYMBOLIC_BIND (info, h) || h->root.type == bfd_link_hash_defweak || !h->def_regular)))) || (ELIMINATE_COPY_RELOCS @@ -1192,7 +1191,7 @@ elf_i386_check_relocs (bfd *abfd, if (name == NULL) return FALSE; - if (strncmp (name, ".rel", 4) != 0 + if (! CONST_STRNEQ (name, ".rel") || strcmp (bfd_get_section_name (abfd, sec), name + 4) != 0) { @@ -1294,38 +1293,20 @@ elf_i386_check_relocs (bfd *abfd, static asection * elf_i386_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, + struct bfd_link_info *info, Elf_Internal_Rela *rel, struct elf_link_hash_entry *h, Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_386_GNU_VTINHERIT: - case R_386_GNU_VTENTRY: - break; + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_386_GNU_VTINHERIT: + case R_386_GNU_VTENTRY: + return NULL; + } - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Update the got entry reference counts for the section being removed. */ @@ -1438,7 +1419,6 @@ elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info, { struct elf_i386_link_hash_table *htab; asection *s; - unsigned int power_of_two; /* If this is a function, put it in the procedure linkage table. We will fill in the contents of the procedure linkage table later, @@ -1558,29 +1538,9 @@ elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 3) - power_of_two = 3; - - /* Apply the required alignment. */ s = htab->sdynbss; - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) - { - if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) - return FALSE; - } - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -1700,14 +1660,6 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) asection *s; bfd_boolean dyn; int tls_type = elf_i386_hash_entry(h)->tls_type; - - /* If we have both R_386_TLS_IE and R_386_TLS_GD, GOT_TLS_IE_BOTH - should be used. */ - if ((tls_type & GOT_TLS_IE_MASK) - == (GOT_TLS_IE_IE | GOT_TLS_IE_GD)) - tls_type = GOT_TLS_IE_BOTH; - else - tls_type &= GOT_TLS_MASK; /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ @@ -2052,7 +2004,7 @@ elf_i386_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, if (htab->elf.hplt != NULL) strip_section = FALSE; } - else if (strncmp (bfd_get_section_name (dynobj, s), ".rel", 4) == 0) + else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rel")) { if (s->size != 0 && s != htab->srelplt && s != htab->srelplt2) relocs = TRUE; @@ -2305,51 +2257,6 @@ elf_i386_relocate_section (bfd *output_bfd, howto = elf_howto_table + indx; r_symndx = ELF32_R_SYM (rel->r_info); - - if (info->relocatable) - { - bfd_vma val; - bfd_byte *where; - - /* This is a relocatable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - if (r_symndx >= symtab_hdr->sh_info) - continue; - - sym = local_syms + r_symndx; - if (ELF_ST_TYPE (sym->st_info) != STT_SECTION) - continue; - - sec = local_sections[r_symndx]; - val = sec->output_offset; - if (val == 0) - continue; - - where = contents + rel->r_offset; - switch (howto->size) - { - /* FIXME: overflow checks. */ - case 0: - val += bfd_get_8 (input_bfd, where); - bfd_put_8 (input_bfd, val, where); - break; - case 1: - val += bfd_get_16 (input_bfd, where); - bfd_put_16 (input_bfd, val, where); - break; - case 2: - val += bfd_get_32 (input_bfd, where); - bfd_put_32 (input_bfd, val, where); - break; - default: - abort (); - } - continue; - } - - /* This is a final link. */ h = NULL; sym = NULL; sec = NULL; @@ -2361,10 +2268,12 @@ elf_i386_relocate_section (bfd *output_bfd, relocation = (sec->output_section->vma + sec->output_offset + sym->st_value); - if ((sec->flags & SEC_MERGE) - && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + + if (ELF_ST_TYPE (sym->st_info) == STT_SECTION + && ((sec->flags & SEC_MERGE) != 0 + || (info->relocatable + && sec->output_offset != 0))) { - asection *msec; bfd_vma addend; bfd_byte *where = contents + rel->r_offset; @@ -2398,10 +2307,16 @@ elf_i386_relocate_section (bfd *output_bfd, abort (); } - msec = sec; - addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend); - addend -= relocation; - addend += msec->output_section->vma + msec->output_offset; + if (info->relocatable) + addend += sec->output_offset; + else + { + asection *msec = sec; + addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, + addend); + addend -= relocation; + addend += msec->output_section->vma + msec->output_offset; + } switch (howto->size) { @@ -2434,21 +2349,20 @@ elf_i386_relocate_section (bfd *output_bfd, unresolved_reloc, warned); } - if (r_symndx == 0) + if (sec != NULL && elf_discarded_section (sec)) { - /* r_symndx will be zero only for relocs against symbols from - removed linkonce sections, or sections discarded by a linker - script. For these relocs, we just want the section contents - zeroed. Avoid any special processing in the switch below. */ - r_type = R_386_NONE; - - relocation = 0; - if (howto->pc_relative) - relocation = (input_section->output_section->vma - + input_section->output_offset - + rel->r_offset); + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; } + if (info->relocatable) + continue; + switch (r_type) { case R_386_GOT32: @@ -2652,7 +2566,7 @@ elf_i386_relocate_section (bfd *output_bfd, && h->dynindx != -1 && (r_type == R_386_PC32 || !info->shared - || !info->symbolic + || !SYMBOLIC_BIND (info, h) || !h->def_regular)) outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); else @@ -2711,13 +2625,6 @@ elf_i386_relocate_section (bfd *output_bfd, else if (h != NULL) { tls_type = elf_i386_hash_entry(h)->tls_type; - /* If we have both R_386_TLS_IE and R_386_TLS_GD, - GOT_TLS_IE_BOTH should be used. */ - if ((tls_type & GOT_TLS_IE_MASK) - == (GOT_TLS_IE_IE | GOT_TLS_IE_GD)) - tls_type = GOT_TLS_IE_BOTH; - else - tls_type &= GOT_TLS_MASK; if (!info->shared && h->dynindx == -1 && (tls_type & GOT_TLS_IE)) r_type = R_386_TLS_LE_32; } @@ -2851,8 +2758,9 @@ elf_i386_relocate_section (bfd *output_bfd, val = bfd_get_8 (input_bfd, contents + roff + 1); BFD_ASSERT (val == 0x10); - /* Now modify the instruction as appropriate. */ - bfd_put_8 (output_bfd, 0x90, contents + roff); + /* Now modify the instruction as appropriate. Use + xchg %ax,%ax instead of 2 nops. */ + bfd_put_8 (output_bfd, 0x66, contents + roff); bfd_put_8 (output_bfd, 0x90, contents + roff + 1); continue; } @@ -3172,12 +3080,8 @@ elf_i386_relocate_section (bfd *output_bfd, subl $foo@gottpoff(%reg), %eax into: addl $foo@gotntpoff(%reg), %eax. */ - if (r_type == R_386_TLS_GOTIE) - { - contents[roff + 6] = 0x03; - if (tls_type == GOT_TLS_IE_BOTH) - off += 4; - } + if (tls_type == GOT_TLS_IE_POS) + contents[roff + 6] = 0x03; bfd_put_32 (output_bfd, htab->sgot->output_section->vma + htab->sgot->output_offset + off @@ -3261,8 +3165,8 @@ elf_i386_relocate_section (bfd *output_bfd, /* Now modify the instruction as appropriate. */ if (tls_type != GOT_TLS_IE_NEG) { - /* nop; nop */ - bfd_put_8 (output_bfd, 0x90, contents + roff); + /* xchg %ax,%ax */ + bfd_put_8 (output_bfd, 0x66, contents + roff); bfd_put_8 (output_bfd, 0x90, contents + roff + 1); } else @@ -3872,6 +3776,18 @@ elf_i386_plt_sym_val (bfd_vma i, const asection *plt, return plt->vma + (i + 1) * PLT_ENTRY_SIZE; } +/* Return TRUE if symbol should be hashed in the `.gnu.hash' section. */ + +static bfd_boolean +elf_i386_hash_symbol (struct elf_link_hash_entry *h) +{ + if (h->plt.offset != (bfd_vma) -1 + && !h->def_regular + && !h->pointer_equality_needed) + return FALSE; + + return _bfd_elf_hash_symbol (h); +} #define TARGET_LITTLE_SYM bfd_elf32_i386_vec #define TARGET_LITTLE_NAME "elf32-i386" @@ -3895,6 +3811,7 @@ elf_i386_plt_sym_val (bfd_vma i, const asection *plt, #define bfd_elf32_bfd_is_local_label_name elf_i386_is_local_label_name #define bfd_elf32_bfd_link_hash_table_create elf_i386_link_hash_table_create #define bfd_elf32_bfd_reloc_type_lookup elf_i386_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup elf_i386_reloc_name_lookup #define elf_backend_adjust_dynamic_symbol elf_i386_adjust_dynamic_symbol #define elf_backend_check_relocs elf_i386_check_relocs @@ -3911,7 +3828,10 @@ elf_i386_plt_sym_val (bfd_vma i, const asection *plt, #define elf_backend_relocate_section elf_i386_relocate_section #define elf_backend_size_dynamic_sections elf_i386_size_dynamic_sections #define elf_backend_always_size_sections elf_i386_always_size_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_plt_sym_val elf_i386_plt_sym_val +#define elf_backend_hash_symbol elf_i386_hash_symbol #include "elf32-target.h" @@ -3921,6 +3841,8 @@ elf_i386_plt_sym_val (bfd_vma i, const asection *plt, #define TARGET_LITTLE_SYM bfd_elf32_i386_freebsd_vec #undef TARGET_LITTLE_NAME #define TARGET_LITTLE_NAME "elf32-i386-freebsd" +#undef ELF_OSABI +#define ELF_OSABI ELFOSABI_FREEBSD /* The kernel recognizes executables as valid only if they carry a "FreeBSD" label in the ELF header. So we put this label on all @@ -3935,7 +3857,7 @@ elf_i386_post_process_headers (bfd *abfd, i_ehdrp = elf_elfheader (abfd); /* Put an ABI label supported by FreeBSD >= 4.1. */ - i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; + i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi; #ifdef OLD_FREEBSD_ABI_LABEL /* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard. */ memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8); @@ -3955,7 +3877,7 @@ elf_i386_post_process_headers (bfd *abfd, #define TARGET_LITTLE_SYM bfd_elf32_i386_vxworks_vec #undef TARGET_LITTLE_NAME #define TARGET_LITTLE_NAME "elf32-i386-vxworks" - +#undef ELF_OSABI /* Like elf_i386_link_hash_table_create but with tweaks for VxWorks. */ diff --git a/bfd/elf32-i860.c b/bfd/elf32-i860.c index 45325601888..22cebeea691 100644 --- a/bfd/elf32-i860.c +++ b/bfd/elf32-i860.c @@ -1,5 +1,5 @@ /* Intel i860 specific support for 32-bit ELF. - Copyright 1993, 1995, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 1993, 1995, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Full i860 support contributed by Jason Eckhardt . @@ -20,8 +20,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/i860.h" @@ -886,6 +886,23 @@ elf32_i860_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return lookup_howto (rtype); } +static reloc_howto_type * +elf32_i860_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (elf32_i860_howto_table) + / sizeof (elf32_i860_howto_table[0])); + i++) + if (elf32_i860_howto_table[i].name != NULL + && strcasecmp (elf32_i860_howto_table[i].name, r_name) == 0) + return &elf32_i860_howto_table[i]; + + return NULL; +} + /* Given a ELF reloc, return the matching HOWTO structure. */ static void elf32_i860_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, @@ -1066,9 +1083,6 @@ elf32_i860_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocatable) - return TRUE; - symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); relend = relocs + input_section->reloc_count; @@ -1113,6 +1127,20 @@ elf32_i860_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, unresolved_reloc, warned); } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + switch (r_type) { default: @@ -1241,6 +1269,7 @@ elf32_i860_is_local_label_name (bfd *abfd, const char *name) #define elf_info_to_howto elf32_i860_info_to_howto_rela #define elf_backend_relocate_section elf32_i860_relocate_section #define bfd_elf32_bfd_reloc_type_lookup elf32_i860_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup elf32_i860_reloc_name_lookup #define bfd_elf32_bfd_is_local_label_name elf32_i860_is_local_label_name #include "elf32-target.h" diff --git a/bfd/elf32-i960.c b/bfd/elf32-i960.c index f458320655b..10e6e55aa87 100644 --- a/bfd/elf32-i960.c +++ b/bfd/elf32-i960.c @@ -1,5 +1,6 @@ /* Intel 960 specific support for 32-bit ELF - Copyright 1999, 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2007 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +19,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/i960.h" @@ -27,6 +28,8 @@ #define USE_REL 1 #define bfd_elf32_bfd_reloc_type_lookup elf32_i960_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup \ + elf32_i960_reloc_name_lookup #define elf_info_to_howto elf32_i960_info_to_howto #define elf_info_to_howto_rel elf32_i960_info_to_howto_rel @@ -142,6 +145,20 @@ elf32_i960_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return elf_howto_table + elf32_i960_bfd_to_reloc_type (code); } +static reloc_howto_type * +elf32_i960_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; i < sizeof (elf_howto_table) / sizeof (elf_howto_table[0]); i++) + if (elf_howto_table[i].name != NULL + && strcasecmp (elf_howto_table[i].name, r_name) == 0) + return &elf_howto_table[i]; + + return NULL; +} + #define TARGET_LITTLE_SYM bfd_elf32_i960_vec #define TARGET_LITTLE_NAME "elf32-i960" #define ELF_ARCH bfd_arch_i960 diff --git a/bfd/elf32-ip2k.c b/bfd/elf32-ip2k.c index 135ef1314ba..1d61aa47679 100644 --- a/bfd/elf32-ip2k.c +++ b/bfd/elf32-ip2k.c @@ -1,5 +1,5 @@ /* Ubicom IP2xxx specific support for 32-bit ELF - Copyright 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/ip2k.h" @@ -223,6 +223,21 @@ ip2k_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +ip2k_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (ip2k_elf_howto_table) / sizeof (ip2k_elf_howto_table[0]); + i++) + if (ip2k_elf_howto_table[i].name != NULL + && strcasecmp (ip2k_elf_howto_table[i].name, r_name) == 0) + return &ip2k_elf_howto_table[i]; + + return NULL; +} + static void ip2k_get_mem (bfd *abfd ATTRIBUTE_UNUSED, bfd_byte *addr, @@ -1399,9 +1414,6 @@ ip2k_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocatable) - return TRUE; - symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); relend = relocs + input_section->reloc_count; @@ -1418,7 +1430,6 @@ ip2k_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, const char * name = NULL; int r_type; - /* This is a final link. */ r_type = ELF32_R_TYPE (rel->r_info); r_symndx = ELF32_R_SYM (rel->r_info); howto = ip2k_elf_howto_table + ELF32_R_TYPE (rel->r_info); @@ -1449,6 +1460,20 @@ ip2k_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, name = h->root.root.string; } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + /* Finally, the sole IP2K-specific part. */ r = ip2k_final_link_relocate (howto, input_bfd, input_section, contents, rel, relocation); @@ -1502,53 +1527,6 @@ ip2k_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, return TRUE; } -static asection * -ip2k_elf_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, - Elf_Internal_Rela *rel, - struct elf_link_hash_entry *h, - Elf_Internal_Sym *sym) -{ - if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - { - if (!(elf_bad_symtab (sec->owner) - && ELF_ST_BIND (sym->st_info) != STB_LOCAL) - && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE) - && sym->st_shndx != SHN_COMMON)) - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - } - return NULL; -} - -static bfd_boolean -ip2k_elf_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED, - struct bfd_link_info *info ATTRIBUTE_UNUSED, - asection *sec ATTRIBUTE_UNUSED, - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED) -{ - /* We don't use got and plt entries for ip2k. */ - return TRUE; -} - #define TARGET_BIG_SYM bfd_elf32_ip2k_vec #define TARGET_BIG_NAME "elf32-ip2k" @@ -1562,12 +1540,11 @@ ip2k_elf_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED, #define elf_backend_can_gc_sections 1 #define elf_backend_rela_normal 1 -#define elf_backend_gc_mark_hook ip2k_elf_gc_mark_hook -#define elf_backend_gc_sweep_hook ip2k_elf_gc_sweep_hook #define elf_backend_relocate_section ip2k_elf_relocate_section #define elf_symbol_leading_char '_' #define bfd_elf32_bfd_reloc_type_lookup ip2k_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup ip2k_reloc_name_lookup #define bfd_elf32_bfd_relax_section ip2k_elf_relax_section #include "elf32-target.h" diff --git a/bfd/elf32-iq2000.c b/bfd/elf32-iq2000.c index 146dcaaecaf..160c996e604 100644 --- a/bfd/elf32-iq2000.c +++ b/bfd/elf32-iq2000.c @@ -1,5 +1,6 @@ /* IQ2000-specific support for 32-bit ELF. - Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/iq2000.h" @@ -349,6 +350,26 @@ iq2000_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +iq2000_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (iq2000_elf_howto_table) + / sizeof (iq2000_elf_howto_table[0])); + i++) + if (iq2000_elf_howto_table[i].name != NULL + && strcasecmp (iq2000_elf_howto_table[i].name, r_name) == 0) + return &iq2000_elf_howto_table[i]; + + if (strcasecmp (iq2000_elf_vtinherit_howto.name, r_name) == 0) + return &iq2000_elf_vtinherit_howto; + if (strcasecmp (iq2000_elf_vtentry_howto.name, r_name) == 0) + return &iq2000_elf_vtentry_howto; + + return NULL; +} /* Perform a single relocation. By default we use the standard BFD routines. */ @@ -452,9 +473,9 @@ iq2000_elf_check_relocs (bfd *abfd, case R_IQ2000_32: /* For debug section, change to special harvard-aware relocations. */ - if (memcmp (sec->name, ".debug", 6) == 0 - || memcmp (sec->name, ".stab", 5) == 0 - || memcmp (sec->name, ".eh_frame", 9) == 0) + if (CONST_STRNEQ (sec->name, ".debug") + || CONST_STRNEQ (sec->name, ".stab") + || CONST_STRNEQ (sec->name, ".eh_frame")) { ((Elf_Internal_Rela *) rel)->r_info = ELF32_R_INFO (ELF32_R_SYM (rel->r_info), R_IQ2000_32_DEBUG); @@ -521,9 +542,6 @@ iq2000_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, Elf_Internal_Rela * rel; Elf_Internal_Rela * relend; - if (info->relocatable) - return TRUE; - symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); relend = relocs + input_section->reloc_count; @@ -548,7 +566,6 @@ iq2000_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, r_symndx = ELF32_R_SYM (rel->r_info); - /* This is a final link. */ howto = iq2000_elf_howto_table + ELF32_R_TYPE (rel->r_info); h = NULL; sym = NULL; @@ -579,6 +596,20 @@ iq2000_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, name = h->root.root.string; } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + switch (r_type) { case R_IQ2000_HI16: @@ -642,53 +673,25 @@ iq2000_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, } -/* Update the got entry reference counts for the section being - removed. */ - -static bfd_boolean -iq2000_elf_gc_sweep_hook (bfd * abfd ATTRIBUTE_UNUSED, - struct bfd_link_info * info ATTRIBUTE_UNUSED, - asection * sec ATTRIBUTE_UNUSED, - const Elf_Internal_Rela * relocs ATTRIBUTE_UNUSED) -{ - return TRUE; -} - /* Return the section that should be marked against GC for a given relocation. */ static asection * -iq2000_elf_gc_mark_hook (asection * sec, - struct bfd_link_info * info ATTRIBUTE_UNUSED, - Elf_Internal_Rela * rel, - struct elf_link_hash_entry * h, - Elf_Internal_Sym * sym) +iq2000_elf_gc_mark_hook (asection *sec, + struct bfd_link_info *info, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { - if (h == NULL) - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); + if (h != NULL) + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_IQ2000_GNU_VTINHERIT: + case R_IQ2000_GNU_VTENTRY: + return NULL; + } - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_IQ2000_GNU_VTINHERIT: - case R_IQ2000_GNU_VTENTRY: - break; - - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } @@ -733,6 +736,10 @@ iq2000_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd) elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; elf_flags_init (obfd) = TRUE; + + /* Copy object attributes. */ + _bfd_elf_copy_obj_attributes (ibfd, obfd); + return TRUE; } @@ -874,7 +881,6 @@ iq2000_elf_object_p (bfd *abfd) #define elf_info_to_howto iq2000_info_to_howto_rela #define elf_backend_relocate_section iq2000_elf_relocate_section #define elf_backend_gc_mark_hook iq2000_elf_gc_mark_hook -#define elf_backend_gc_sweep_hook iq2000_elf_gc_sweep_hook #define elf_backend_check_relocs iq2000_elf_check_relocs #define elf_backend_object_p iq2000_elf_object_p #define elf_backend_rela_normal 1 @@ -882,6 +888,7 @@ iq2000_elf_object_p (bfd *abfd) #define elf_backend_can_gc_sections 1 #define bfd_elf32_bfd_reloc_type_lookup iq2000_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup iq2000_reloc_name_lookup #define bfd_elf32_bfd_set_private_flags iq2000_elf_set_private_flags #define bfd_elf32_bfd_copy_private_bfd_data iq2000_elf_copy_private_bfd_data #define bfd_elf32_bfd_merge_private_bfd_data iq2000_elf_merge_private_bfd_data diff --git a/bfd/elf32-m32c.c b/bfd/elf32-m32c.c index 5e9f3ab28a2..43499cec01c 100644 --- a/bfd/elf32-m32c.c +++ b/bfd/elf32-m32c.c @@ -1,5 +1,5 @@ /* M16C/M32C specific support for 32-bit ELF. - Copyright (C) 2005, 2006 + Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/m32c.h" @@ -32,15 +32,12 @@ static void m32c_info_to_howto_rela (bfd *, arelent *, Elf_Internal_Rela *); static bfd_boolean m32c_elf_relocate_section (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **); -static bfd_boolean m32c_elf_gc_sweep_hook - (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *); -static asection * m32c_elf_gc_mark_hook - (asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *); static bfd_boolean m32c_elf_check_relocs (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *); static bfd_boolean m32c_elf_relax_delete_bytes (bfd *, asection *, bfd_vma, int); #ifdef DEBUG -static char * m32c_get_reloc (long reloc); +char * m32c_get_reloc (long reloc); +void dump_symtab (bfd *, void *, void *); #endif static bfd_boolean m32c_elf_relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info, bfd_boolean *again); @@ -63,13 +60,16 @@ static reloc_howto_type m32c_elf_howto_table [] = 0, /* dst_mask */ FALSE), /* pcrel_offset */ + /* GCC intentionally overflows these next two in order to work + around limitations in the addressing modes, so don't complain + about overflow. */ HOWTO (R_M32C_16, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ + complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_M32C_16", /* name */ FALSE, /* partial_inplace */ @@ -83,7 +83,7 @@ static reloc_howto_type m32c_elf_howto_table [] = 24, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ + complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_M32C_24", /* name */ FALSE, /* partial_inplace */ @@ -272,6 +272,21 @@ m32c_reloc_type_lookup return NULL; } +static reloc_howto_type * +m32c_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (m32c_elf_howto_table) / sizeof (m32c_elf_howto_table[0]); + i++) + if (m32c_elf_howto_table[i].name != NULL + && strcasecmp (m32c_elf_howto_table[i].name, r_name) == 0) + return &m32c_elf_howto_table[i]; + + return NULL; +} + /* Set the howto pointer for an M32C ELF reloc. */ static void @@ -372,31 +387,11 @@ m32c_elf_relocate_section r_symndx = ELF32_R_SYM (rel->r_info); - if (info->relocatable) - { - /* This is a relocatable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - - if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - { - sec = local_sections [r_symndx]; - rel->r_addend += sec->output_offset + sym->st_value; - } - } - - continue; - } - - /* This is a final link. */ howto = m32c_elf_howto_table + ELF32_R_TYPE (rel->r_info); h = NULL; sym = NULL; sec = NULL; + relocation = 0; if (r_symndx < symtab_hdr->sh_info) { @@ -429,19 +424,38 @@ m32c_elf_relocate_section + sec->output_offset); } else if (h->root.type == bfd_link_hash_undefweak) - { - relocation = 0; - } - else + ; + else if (!info->relocatable) { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, rel->r_offset, TRUE))) return FALSE; - relocation = 0; } } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + { + /* This is a relocatable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + rel->r_addend += sec->output_offset; + continue; + } + switch (ELF32_R_TYPE (rel->r_info)) { case R_M32C_16: @@ -571,62 +585,6 @@ m32c_elf_relocate_section return TRUE; } -/* Return the section that should be marked against GC for a given - relocation. */ - -static asection * -m32c_elf_gc_mark_hook - (asection * sec, - struct bfd_link_info * info ATTRIBUTE_UNUSED, - Elf_Internal_Rela * rel, - struct elf_link_hash_entry * h, - Elf_Internal_Sym * sym) -{ - if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - { - if (!(elf_bad_symtab (sec->owner) - && ELF_ST_BIND (sym->st_info) != STB_LOCAL) - && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE) - && sym->st_shndx != SHN_COMMON)) - { - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - } - } - - return NULL; -} - -/* Update the got entry reference counts for the section being removed. */ - -static bfd_boolean -m32c_elf_gc_sweep_hook - (bfd * abfd ATTRIBUTE_UNUSED, - struct bfd_link_info * info ATTRIBUTE_UNUSED, - asection * sec ATTRIBUTE_UNUSED, - const Elf_Internal_Rela * relocs ATTRIBUTE_UNUSED) -{ - return TRUE; -} - /* We support 16-bit pointers to code above 64k by generating a thunk below 64k containing a JMP instruction to the final address. */ @@ -690,16 +648,11 @@ m32c_elf_check_relocs splt = bfd_get_section_by_name (dynobj, ".plt"); if (splt == NULL) { - splt = bfd_make_section (dynobj, ".plt"); + flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY | SEC_LINKER_CREATED + | SEC_READONLY | SEC_CODE); + splt = bfd_make_section_with_flags (dynobj, ".plt", flags); if (splt == NULL - || ! bfd_set_section_flags (dynobj, splt, - (SEC_ALLOC - | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_LINKER_CREATED - | SEC_READONLY - | SEC_CODE)) || ! bfd_set_section_alignment (dynobj, splt, 1)) return FALSE; } @@ -936,7 +889,7 @@ m32c_elf_object_p (bfd *abfd) #ifdef DEBUG -static void +void dump_symtab (bfd * abfd, void *internal_syms, void *external_syms) { size_t locsymcount; @@ -977,7 +930,6 @@ dump_symtab (bfd * abfd, void *internal_syms, void *external_syms) { case STT_FUNC: st_info_str = "STT_FUNC"; case STT_SECTION: st_info_str = "STT_SECTION"; - case STT_SRELC: st_info_str = "STT_SRELC"; case STT_FILE: st_info_str = "STT_FILE"; case STT_OBJECT: st_info_str = "STT_OBJECT"; case STT_TLS: st_info_str = "STT_TLS"; @@ -1022,7 +974,7 @@ dump_symtab (bfd * abfd, void *internal_syms, void *external_syms) free (external_syms); } -static char * +char * m32c_get_reloc (long reloc) { if (0 <= reloc && reloc < R_M32C_max) @@ -2055,8 +2007,6 @@ m32c_elf_relax_delete_bytes #define elf_info_to_howto m32c_info_to_howto_rela #define elf_backend_object_p m32c_elf_object_p #define elf_backend_relocate_section m32c_elf_relocate_section -#define elf_backend_gc_mark_hook m32c_elf_gc_mark_hook -#define elf_backend_gc_sweep_hook m32c_elf_gc_sweep_hook #define elf_backend_check_relocs m32c_elf_check_relocs #define elf_backend_object_p m32c_elf_object_p #define elf_symbol_leading_char ('_') @@ -2068,6 +2018,7 @@ m32c_elf_relax_delete_bytes #define elf_backend_can_gc_sections 1 #define bfd_elf32_bfd_reloc_type_lookup m32c_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup m32c_reloc_name_lookup #define bfd_elf32_bfd_relax_section m32c_elf_relax_section #define bfd_elf32_bfd_set_private_flags m32c_elf_set_private_flags #define bfd_elf32_bfd_merge_private_bfd_data m32c_elf_merge_private_bfd_data diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c index 6c42c2f5b60..31151fc1a47 100644 --- a/bfd/elf32-m32r.c +++ b/bfd/elf32-m32r.c @@ -1,6 +1,6 @@ /* M32R-specific support for 32-bit ELF. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006 Free Software Foundation, Inc. + 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/m32r.h" @@ -1254,6 +1254,22 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (m32r_elf_howto_table) / sizeof (m32r_elf_howto_table[0]); + i++) + if (m32r_elf_howto_table[i].name != NULL + && strcasecmp (m32r_elf_howto_table[i].name, r_name) == 0) + return &m32r_elf_howto_table[i]; + + return NULL; +} + /* Set the howto pointer for an M32R ELF reloc. */ static void @@ -1817,7 +1833,6 @@ m32r_elf_adjust_dynamic_symbol (struct bfd_link_info *info, struct elf_m32r_dyn_relocs *p; bfd *dynobj; asection *s; - unsigned int power_of_two; #ifdef DEBUG_PIC printf ("m32r_elf_adjust_dynamic_symbol()\n"); @@ -1945,28 +1960,7 @@ m32r_elf_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 3) - power_of_two = 3; - - /* Apply the required alignment. */ - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (dynobj, s)) - { - if (! bfd_set_section_alignment (dynobj, s, power_of_two)) - return FALSE; - } - - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -2309,7 +2303,7 @@ m32r_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* Strip this section if we don't need it; see the comment below. */ } - else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) + else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela")) { if (s->size != 0 && s != htab->srelplt) relocs = TRUE; @@ -2477,6 +2471,7 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, `r_addend'. */ bfd_vma addend = rel->r_addend; bfd_vma offset = rel->r_offset; + bfd_vma relocation; Elf_Internal_Sym *sym; asection *sec; const char *sym_name; @@ -2509,27 +2504,152 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, howto = m32r_elf_howto_table + r_type; r_symndx = ELF32_R_SYM (rel->r_info); + sym = NULL; + sec = NULL; + h = NULL; + + if (r_symndx < symtab_hdr->sh_info) + { + /* Local symbol. */ + sym = local_syms + r_symndx; + sec = local_sections[r_symndx]; + sym_name = ""; + + if (!use_rel) + { + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); + addend = rel->r_addend; + } + else + { + relocation = (sec->output_section->vma + + sec->output_offset + + sym->st_value); + } + } + else + { + /* External symbol. */ + relocation = 0; + + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + sym_name = h->root.root.string; + + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + bfd_boolean dyn; + sec = h->root.u.def.section; + + dyn = htab->root.dynamic_sections_created; + sec = h->root.u.def.section; + if (r_type == R_M32R_GOTPC24 + || (r_type == R_M32R_GOTPC_HI_ULO + || r_type == R_M32R_GOTPC_HI_SLO + || r_type == R_M32R_GOTPC_LO) + || (r_type == R_M32R_26_PLTREL + && h->plt.offset != (bfd_vma) -1) + || ((r_type == R_M32R_GOT24 + || r_type == R_M32R_GOT16_HI_ULO + || r_type == R_M32R_GOT16_HI_SLO + || r_type == R_M32R_GOT16_LO) + && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, + info->shared, h) + && (! info->shared + || (! info->symbolic && h->dynindx != -1) + || !h->def_regular)) + || (info->shared + && ((! info->symbolic && h->dynindx != -1) + || !h->def_regular) + && (((r_type == R_M32R_16_RELA + || r_type == R_M32R_32_RELA + || r_type == R_M32R_24_RELA + || r_type == R_M32R_HI16_ULO_RELA + || r_type == R_M32R_HI16_SLO_RELA + || r_type == R_M32R_LO16_RELA) + && !h->forced_local) + || r_type == R_M32R_REL32 + || r_type == R_M32R_10_PCREL_RELA + || r_type == R_M32R_18_PCREL_RELA + || r_type == R_M32R_26_PCREL_RELA) + && ((input_section->flags & SEC_ALLOC) != 0 + /* DWARF will emit R_M32R_16(24,32) relocations + in its sections against symbols defined + externally in shared libraries. We can't do + anything with them here. */ + || ((input_section->flags & SEC_DEBUGGING) != 0 + && h->def_dynamic)))) + { + /* In these cases, we don't need the relocation + value. We check specially because in some + obscure cases sec->output_section will be NULL. */ + } + else if (sec->output_section != NULL) + relocation = (h->root.u.def.value + + sec->output_section->vma + + sec->output_offset); + else if (!info->relocatable) + { + (*_bfd_error_handler) + (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"), + input_bfd, + input_section, + (long) rel->r_offset, + howto->name, + h->root.root.string); + } + } + else if (h->root.type == bfd_link_hash_undefweak) + ; + else if (info->unresolved_syms_in_objects == RM_IGNORE + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) + ; + else if (!info->relocatable) + { + if (! ((*info->callbacks->undefined_symbol) + (info, h->root.root.string, input_bfd, + input_section, offset, + (info->unresolved_syms_in_objects == RM_GENERATE_ERROR + || ELF_ST_VISIBILITY (h->other))))) + return FALSE; + } + } + + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable && !use_rel) + { + /* This is a relocatable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + rel->r_addend += sec->output_offset; + continue; + } + if (info->relocatable && use_rel) { /* This is a relocatable link. We don't have to change anything, unless the reloc is against a section symbol, in which case we have to adjust according to where the section symbol winds up in the output section. */ - sec = NULL; - if (r_symndx >= symtab_hdr->sh_info) - /* External symbol. */ + if (sym == NULL || ELF_ST_TYPE (sym->st_info) != STT_SECTION) continue; - /* Local symbol. */ - sym = local_syms + r_symndx; - sym_name = ""; - /* STT_SECTION: symbol is associated with a section. */ - if (ELF_ST_TYPE (sym->st_info) != STT_SECTION) - /* Symbol isn't associated with a section. Nothing to do. */ - continue; - - sec = local_sections[r_symndx]; - addend += sec->output_offset + sym->st_value; + addend += sec->output_offset; /* If partial_inplace, we need to store any additional addend back in the section. */ @@ -2567,140 +2687,6 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, } else { - bfd_vma relocation; - - /* This is a final link. */ - sym = NULL; - sec = NULL; - h = NULL; - - if (r_symndx < symtab_hdr->sh_info) - { - /* Local symbol. */ - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; - sym_name = ""; - - if (!use_rel) - { - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - addend = rel->r_addend; - - if (info->relocatable) - { - /* This is a relocatable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - rel->r_addend += sec->output_offset + sym->st_value; - - continue; - } - } - else - { - relocation = (sec->output_section->vma - + sec->output_offset - + sym->st_value); - } - } - else - { - /* External symbol. */ - if (info->relocatable && !use_rel) - continue; - - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - while (h->root.type == bfd_link_hash_indirect - || h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - sym_name = h->root.root.string; - - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - { - bfd_boolean dyn; - sec = h->root.u.def.section; - - dyn = htab->root.dynamic_sections_created; - sec = h->root.u.def.section; - if (r_type == R_M32R_GOTPC24 - || (r_type == R_M32R_GOTPC_HI_ULO - || r_type == R_M32R_GOTPC_HI_SLO - || r_type == R_M32R_GOTPC_LO) - || (r_type == R_M32R_26_PLTREL - && h->plt.offset != (bfd_vma) -1) - || ((r_type == R_M32R_GOT24 - || r_type == R_M32R_GOT16_HI_ULO - || r_type == R_M32R_GOT16_HI_SLO - || r_type == R_M32R_GOT16_LO) - && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, - info->shared, h) - && (! info->shared - || (! info->symbolic && h->dynindx != -1) - || !h->def_regular)) - || (info->shared - && ((! info->symbolic && h->dynindx != -1) - || !h->def_regular) - && (((r_type == R_M32R_16_RELA - || r_type == R_M32R_32_RELA - || r_type == R_M32R_24_RELA - || r_type == R_M32R_HI16_ULO_RELA - || r_type == R_M32R_HI16_SLO_RELA - || r_type == R_M32R_LO16_RELA) - && !h->forced_local) - || r_type == R_M32R_REL32 - || r_type == R_M32R_10_PCREL_RELA - || r_type == R_M32R_18_PCREL_RELA - || r_type == R_M32R_26_PCREL_RELA) - && ((input_section->flags & SEC_ALLOC) != 0 - /* DWARF will emit R_M32R_16(24,32) relocations - in its sections against symbols defined - externally in shared libraries. We can't do - anything with them here. */ - || ((input_section->flags & SEC_DEBUGGING) != 0 - && h->def_dynamic)))) - { - /* In these cases, we don't need the relocation - value. We check specially because in some - obscure cases sec->output_section will be NULL. */ - relocation = 0; - } - else if (sec->output_section == NULL) - { - (*_bfd_error_handler) - (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"), - input_bfd, - input_section, - (long) rel->r_offset, - howto->name, - h->root.root.string); - - relocation = 0; - } - else - relocation = (h->root.u.def.value - + sec->output_section->vma - + sec->output_offset); - } - else if (h->root.type == bfd_link_hash_undefweak) - relocation = 0; - else if (info->unresolved_syms_in_objects == RM_IGNORE - && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - relocation = 0; - else - { - if (! ((*info->callbacks->undefined_symbol) - (info, h->root.root.string, input_bfd, - input_section, offset, - (info->unresolved_syms_in_objects == RM_GENERATE_ERROR - || ELF_ST_VISIBILITY (h->other))))) - return FALSE; - relocation = 0; - } - } - /* Sanity check the address. */ if (offset > high_address) { @@ -2933,7 +2919,7 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (input_bfd, input_section), name + 5) == 0); @@ -3637,40 +3623,22 @@ m32r_elf_print_private_bfd_data (bfd *abfd, void * ptr) static asection * m32r_elf_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, + struct bfd_link_info *info, Elf_Internal_Rela *rel, struct elf_link_hash_entry *h, Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) + switch (ELF32_R_TYPE (rel->r_info)) { case R_M32R_GNU_VTINHERIT: case R_M32R_GNU_VTENTRY: case R_M32R_RELA_GNU_VTINHERIT: case R_M32R_RELA_GNU_VTENTRY: - break; + return NULL; + } - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } static bfd_boolean @@ -3990,7 +3958,7 @@ m32r_elf_check_relocs (bfd *abfd, if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (abfd, sec), name + 5) == 0); @@ -4082,9 +4050,9 @@ m32r_elf_check_relocs (bfd *abfd, static const struct bfd_elf_special_section m32r_elf_special_sections[] = { - { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, - { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".sbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".sdata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { NULL, 0, 0, 0, 0 } }; static bfd_boolean @@ -4159,6 +4127,8 @@ m32r_elf_reloc_type_class (const Elf_Internal_Rela *rela) #define elf_backend_create_dynamic_sections m32r_elf_create_dynamic_sections #define bfd_elf32_bfd_link_hash_table_create m32r_elf_link_hash_table_create #define elf_backend_size_dynamic_sections m32r_elf_size_dynamic_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_finish_dynamic_sections m32r_elf_finish_dynamic_sections #define elf_backend_adjust_dynamic_symbol m32r_elf_adjust_dynamic_symbol #define elf_backend_finish_dynamic_symbol m32r_elf_finish_dynamic_symbol diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c index d61590ff486..00253978df0 100644 --- a/bfd/elf32-m68hc11.c +++ b/bfd/elf32-m68hc11.c @@ -1,5 +1,5 @@ /* Motorola 68HC11-specific support for 32-bit ELF - Copyright 1999, 2000, 2001, 2002, 2003, 2004 + Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Stephane Carrez (stcarrez@nerim.fr) (Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com)) @@ -20,8 +20,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -358,6 +358,23 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (elf_m68hc11_howto_table) + / sizeof (elf_m68hc11_howto_table[0])); + i++) + if (elf_m68hc11_howto_table[i].name != NULL + && strcasecmp (elf_m68hc11_howto_table[i].name, r_name) == 0) + return &elf_m68hc11_howto_table[i]; + + return NULL; +} + /* Set the howto pointer for an M68HC11 ELF reloc. */ static void @@ -1259,11 +1276,11 @@ m68hc11_elf_relax_delete_bytes (bfd *abfd, asection *sec, vectors. */ static const struct bfd_elf_special_section elf32_m68hc11_special_sections[] = { - { ".eeprom", 7, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".page0", 6, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".softregs", 9, 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, - { ".vectors", 8, 0, SHT_PROGBITS, SHF_ALLOC }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".eeprom"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".page0"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".softregs"), 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".vectors"), 0, SHT_PROGBITS, SHF_ALLOC }, + { NULL, 0, 0, 0, 0 } }; #define ELF_ARCH bfd_arch_m68hc11 @@ -1276,8 +1293,6 @@ static const struct bfd_elf_special_section elf32_m68hc11_special_sections[] = #define elf_info_to_howto 0 #define elf_info_to_howto_rel m68hc11_info_to_howto_rel #define bfd_elf32_bfd_relax_section m68hc11_elf_relax_section -#define elf_backend_gc_mark_hook elf32_m68hc11_gc_mark_hook -#define elf_backend_gc_sweep_hook elf32_m68hc11_gc_sweep_hook #define elf_backend_check_relocs elf32_m68hc11_check_relocs #define elf_backend_relocate_section elf32_m68hc11_relocate_section #define elf_backend_add_symbol_hook elf32_m68hc11_add_symbol_hook diff --git a/bfd/elf32-m68hc12.c b/bfd/elf32-m68hc12.c index b52f3fff853..fca2d659e2a 100644 --- a/bfd/elf32-m68hc12.c +++ b/bfd/elf32-m68hc12.c @@ -1,5 +1,6 @@ /* Motorola 68HC12-specific support for 32-bit ELF - Copyright 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Contributed by Stephane Carrez (stcarrez@nerim.fr) (Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com)) @@ -19,8 +20,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -406,6 +407,23 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (elf_m68hc11_howto_table) + / sizeof (elf_m68hc11_howto_table[0])); + i++) + if (elf_m68hc11_howto_table[i].name != NULL + && strcasecmp (elf_m68hc11_howto_table[i].name, r_name) == 0) + return &elf_m68hc11_howto_table[i]; + + return NULL; +} + /* Set the howto pointer for an M68HC11 ELF reloc. */ static void @@ -537,11 +555,11 @@ m68hc12_elf_set_mach_from_flags (bfd *abfd) vectors. */ static const struct bfd_elf_special_section elf32_m68hc12_special_sections[] = { - { ".eeprom", 7, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".page0", 6, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".softregs", 9, 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, - { ".vectors", 8, 0, SHT_PROGBITS, SHF_ALLOC }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".eeprom"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".page0"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".softregs"), 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".vectors"), 0, SHT_PROGBITS, SHF_ALLOC }, + { NULL, 0, 0, 0, 0 } }; #define ELF_ARCH bfd_arch_m68hc12 @@ -553,8 +571,6 @@ static const struct bfd_elf_special_section elf32_m68hc12_special_sections[] = #define elf_info_to_howto 0 #define elf_info_to_howto_rel m68hc11_info_to_howto_rel -#define elf_backend_gc_mark_hook elf32_m68hc11_gc_mark_hook -#define elf_backend_gc_sweep_hook elf32_m68hc11_gc_sweep_hook #define elf_backend_check_relocs elf32_m68hc11_check_relocs #define elf_backend_relocate_section elf32_m68hc11_relocate_section #define elf_backend_object_p m68hc12_elf_set_mach_from_flags diff --git a/bfd/elf32-m68hc1x.c b/bfd/elf32-m68hc1x.c index e7fb944b26b..84e3b6e43a3 100644 --- a/bfd/elf32-m68hc1x.c +++ b/bfd/elf32-m68hc1x.c @@ -1,5 +1,5 @@ /* Motorola 68HC11/HC12-specific support for 32-bit ELF - Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Stephane Carrez (stcarrez@nerim.fr) @@ -19,8 +19,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -810,48 +810,6 @@ m68hc11_elf_special_reloc (bfd *abfd ATTRIBUTE_UNUSED, abort(); } -asection * -elf32_m68hc11_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, - Elf_Internal_Rela *rel, - struct elf_link_hash_entry *h, - Elf_Internal_Sym *sym) -{ - if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; -} - -bfd_boolean -elf32_m68hc11_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED, - struct bfd_link_info *info ATTRIBUTE_UNUSED, - asection *sec ATTRIBUTE_UNUSED, - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED) -{ - /* We don't use got and plt entries for 68hc11/68hc12. */ - return TRUE; -} - /* Look through the relocs for a section during the first phase. Since we don't do .gots or .plts, we just need to consider the virtual table relocs for gc. */ @@ -915,86 +873,6 @@ elf32_m68hc11_check_relocs (bfd *abfd, struct bfd_link_info *info, return TRUE; } -static bfd_boolean -m68hc11_get_relocation_value (bfd *input_bfd, struct bfd_link_info *info, - asection *input_section, - asection **local_sections, - Elf_Internal_Sym *local_syms, - Elf_Internal_Rela *rel, - const char **name, - bfd_vma *relocation, bfd_boolean *is_far) -{ - Elf_Internal_Shdr *symtab_hdr; - struct elf_link_hash_entry **sym_hashes; - unsigned long r_symndx; - asection *sec; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; - const char* stub_name = 0; - - symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; - sym_hashes = elf_sym_hashes (input_bfd); - - r_symndx = ELF32_R_SYM (rel->r_info); - - /* This is a final link. */ - h = NULL; - sym = NULL; - sec = NULL; - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; - *relocation = (sec->output_section->vma - + sec->output_offset - + sym->st_value); - *is_far = (sym && (sym->st_other & STO_M68HC12_FAR)); - if (*is_far) - stub_name = (bfd_elf_string_from_elf_section - (input_bfd, symtab_hdr->sh_link, - sym->st_name)); - } - else - { - bfd_boolean unresolved_reloc, warned; - - RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, - r_symndx, symtab_hdr, sym_hashes, - h, sec, *relocation, unresolved_reloc, warned); - - *is_far = (h && (h->other & STO_M68HC12_FAR)); - stub_name = h->root.root.string; - } - - if (h != NULL) - *name = h->root.root.string; - else - { - *name = (bfd_elf_string_from_elf_section - (input_bfd, symtab_hdr->sh_link, sym->st_name)); - if (*name == NULL || **name == '\0') - *name = bfd_section_name (input_bfd, sec); - } - - if (*is_far && ELF32_R_TYPE (rel->r_info) == R_M68HC11_16) - { - struct elf32_m68hc11_stub_hash_entry* stub; - struct m68hc11_elf_link_hash_table *htab; - - htab = m68hc11_elf_hash_table (info); - stub = m68hc12_stub_hash_lookup (htab->stub_hash_table, - *name, FALSE, FALSE); - if (stub) - { - *relocation = stub->stub_offset - + stub->stub_sec->output_section->vma - + stub->stub_sec->output_offset; - *is_far = FALSE; - } - } - return TRUE; -} - /* Relocate a 68hc11/68hc12 ELF section. */ bfd_boolean elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, @@ -1035,6 +913,8 @@ elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, bfd_vma insn_addr; bfd_vma insn_page; bfd_boolean is_far = FALSE; + struct elf_link_hash_entry *h; + const char* stub_name = 0; r_symndx = ELF32_R_SYM (rel->r_info); r_type = ELF32_R_TYPE (rel->r_info); @@ -1043,30 +923,86 @@ elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, || r_type == R_M68HC11_GNU_VTINHERIT ) continue; + (*ebd->elf_info_to_howto_rel) (input_bfd, &arel, rel); + howto = arel.howto; + + h = NULL; + sym = NULL; + sec = NULL; + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + sec = local_sections[r_symndx]; + relocation = (sec->output_section->vma + + sec->output_offset + + sym->st_value); + is_far = (sym && (sym->st_other & STO_M68HC12_FAR)); + if (is_far) + stub_name = (bfd_elf_string_from_elf_section + (input_bfd, symtab_hdr->sh_link, + sym->st_name)); + } + else + { + bfd_boolean unresolved_reloc, warned; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, unresolved_reloc, + warned); + + is_far = (h && (h->other & STO_M68HC12_FAR)); + stub_name = h->root.root.string; + } + + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + if (info->relocatable) { /* This is a relocatable link. We don't have to change anything, unless the reloc is against a section symbol, in which case we have to adjust according to where the section symbol winds up in the output section. */ - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - { - sec = local_sections[r_symndx]; - rel->r_addend += sec->output_offset + sym->st_value; - } - } - + if (sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + rel->r_addend += sec->output_offset; continue; } - (*ebd->elf_info_to_howto_rel) (input_bfd, &arel, rel); - howto = arel.howto; - m68hc11_get_relocation_value (input_bfd, info, input_section, - local_sections, local_syms, - rel, &name, &relocation, &is_far); + if (h != NULL) + name = h->root.root.string; + else + { + name = (bfd_elf_string_from_elf_section + (input_bfd, symtab_hdr->sh_link, sym->st_name)); + if (name == NULL || *name == '\0') + name = bfd_section_name (input_bfd, sec); + } + + if (is_far && ELF32_R_TYPE (rel->r_info) == R_M68HC11_16) + { + struct elf32_m68hc11_stub_hash_entry* stub; + struct m68hc11_elf_link_hash_table *htab; + + htab = m68hc11_elf_hash_table (info); + stub = m68hc12_stub_hash_lookup (htab->stub_hash_table, + name, FALSE, FALSE); + if (stub) + { + relocation = stub->stub_offset + + stub->stub_sec->output_section->vma + + stub->stub_sec->output_offset; + is_far = FALSE; + } + } /* Do the memory bank mapping. */ phys_addr = m68hc11_phys_addr (pinfo, relocation + rel->r_addend); diff --git a/bfd/elf32-m68hc1x.h b/bfd/elf32-m68hc1x.h index 402ae3e68b8..7cae2e8db7a 100644 --- a/bfd/elf32-m68hc1x.h +++ b/bfd/elf32-m68hc1x.h @@ -1,5 +1,5 @@ /* Motorola 68HC11/68HC12-specific support for 32-bit ELF - Copyright 2003, 2004 Free Software Foundation, Inc. + Copyright 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Stephane Carrez (stcarrez@nerim.fr) This file is part of BFD, the Binary File Descriptor library. @@ -159,14 +159,6 @@ bfd_reloc_status_type m68hc11_elf_special_reloc asymbol *symbol, void *data, asection *input_section, bfd *output_bfd, char **error_message); -/* GC mark and sweep. */ -asection *elf32_m68hc11_gc_mark_hook - (asection *sec, struct bfd_link_info *info, - Elf_Internal_Rela *rel, struct elf_link_hash_entry *h, - Elf_Internal_Sym *sym); -bfd_boolean elf32_m68hc11_gc_sweep_hook - (bfd *abfd, struct bfd_link_info *info, - asection *sec, const Elf_Internal_Rela *relocs); bfd_boolean elf32_m68hc11_check_relocs (bfd * abfd, struct bfd_link_info * info, asection * sec, const Elf_Internal_Rela * relocs); diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index df988a84966..82fad32fdd2 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -1,6 +1,6 @@ /* Motorola 68k series support for 32-bit ELF Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -37,12 +37,6 @@ static struct bfd_link_hash_table *elf_m68k_link_hash_table_create static bfd_boolean elf_m68k_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); -static asection *elf_m68k_gc_mark_hook - PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *)); -static bfd_boolean elf_m68k_gc_sweep_hook - PARAMS ((bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *)); static bfd_boolean elf_m68k_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static bfd_boolean elf_m68k_size_dynamic_sections @@ -180,7 +174,21 @@ reloc_type_lookup (abfd, code) return 0; } +static reloc_howto_type * +reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) +{ + unsigned int i; + + for (i = 0; i < sizeof (howto_table) / sizeof (howto_table[0]); i++) + if (howto_table[i].name != NULL + && strcasecmp (howto_table[i].name, r_name) == 0) + return &howto_table[i]; + + return NULL; +} + #define bfd_elf32_bfd_reloc_type_lookup reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup reloc_name_lookup #define ELF_ARCH bfd_arch_m68k /* Functions for the m68k ELF linker. */ @@ -190,6 +198,40 @@ reloc_type_lookup (abfd, code) #define ELF_DYNAMIC_INTERPRETER "/usr/lib/libc.so.1" +/* Describes one of the various PLT styles. */ + +struct elf_m68k_plt_info +{ + /* The size of each PLT entry. */ + bfd_vma size; + + /* The template for the first PLT entry. */ + const bfd_byte *plt0_entry; + + /* Offsets of fields in PLT0_ENTRY that require R_68K_PC32 relocations. + The comments by each member indicate the value that the relocation + is against. */ + struct { + unsigned int got4; /* .got + 4 */ + unsigned int got8; /* .got + 8 */ + } plt0_relocs; + + /* The template for a symbol's PLT entry. */ + const bfd_byte *symbol_entry; + + /* Offsets of fields in SYMBOL_ENTRY that require R_68K_PC32 relocations. + The comments by each member indicate the value that the relocation + is against. */ + struct { + unsigned int got; /* the symbol's .got.plt entry */ + unsigned int plt; /* .plt */ + } symbol_relocs; + + /* The offset of the resolver stub from the start of SYMBOL_ENTRY. + The stub starts with "move.l #relocoffset,%d0". */ + bfd_vma symbol_resolve_entry; +}; + /* The size in bytes of an entry in the procedure linkage table. */ #define PLT_ENTRY_SIZE 20 @@ -200,9 +242,9 @@ reloc_type_lookup (abfd, code) static const bfd_byte elf_m68k_plt0_entry[PLT_ENTRY_SIZE] = { 0x2f, 0x3b, 0x01, 0x70, /* move.l (%pc,addr),-(%sp) */ - 0, 0, 0, 0, /* replaced with offset to .got + 4. */ + 0, 0, 0, 2, /* + (.got + 4) - . */ 0x4e, 0xfb, 0x01, 0x71, /* jmp ([%pc,addr]) */ - 0, 0, 0, 0, /* replaced with offset to .got + 8. */ + 0, 0, 0, 2, /* + (.got + 8) - . */ 0, 0, 0, 0 /* pad out to 20 bytes. */ }; @@ -211,71 +253,118 @@ static const bfd_byte elf_m68k_plt0_entry[PLT_ENTRY_SIZE] = static const bfd_byte elf_m68k_plt_entry[PLT_ENTRY_SIZE] = { 0x4e, 0xfb, 0x01, 0x71, /* jmp ([%pc,symbol@GOTPC]) */ - 0, 0, 0, 0, /* replaced with offset to symbol's .got entry. */ + 0, 0, 0, 2, /* + (.got.plt entry) - . */ 0x2f, 0x3c, /* move.l #offset,-(%sp) */ - 0, 0, 0, 0, /* replaced with offset into relocation table. */ + 0, 0, 0, 0, /* + reloc index */ 0x60, 0xff, /* bra.l .plt */ - 0, 0, 0, 0 /* replaced with offset to start of .plt. */ + 0, 0, 0, 0 /* + .plt - . */ }; +static const struct elf_m68k_plt_info elf_m68k_plt_info = { + PLT_ENTRY_SIZE, + elf_m68k_plt0_entry, { 4, 12 }, + elf_m68k_plt_entry, { 4, 16 }, 8 +}; -#define CFV4E_PLT_ENTRY_SIZE 24 +#define ISAB_PLT_ENTRY_SIZE 24 -#define CFV4E_FLAG(abfd) (elf_elfheader (abfd)->e_flags & EF_M68K_CFV4E) - -static const bfd_byte elf_cfv4e_plt0_entry[CFV4E_PLT_ENTRY_SIZE] = +static const bfd_byte elf_isab_plt0_entry[ISAB_PLT_ENTRY_SIZE] = { - 0x20, 0x3c, - 0, 0, 0, 0, /* Replaced with offset to .got + 4. */ - 0x2f, 0x3b, 0x08, 0xfa, /* move.l (%pc,addr),-(%sp) */ - 0x20, 0x3c, - 0, 0, 0, 0, /* Replaced with offset to .got + 8. */ - 0x20, 0x7b, 0x08, 0x00, /* move.l (%pc,%d0:l), %a0 */ + 0x20, 0x3c, /* move.l #offset,%d0 */ + 0, 0, 0, 0, /* + (.got + 4) - . */ + 0x2f, 0x3b, 0x08, 0xfa, /* move.l (-6,%pc,%d0:l),-(%sp) */ + 0x20, 0x3c, /* move.l #offset,%d0 */ + 0, 0, 0, 0, /* + (.got + 8) - . */ + 0x20, 0x7b, 0x08, 0xfa, /* move.l (-6,%pc,%d0:l), %a0 */ 0x4e, 0xd0, /* jmp (%a0) */ 0x4e, 0x71 /* nop */ }; /* Subsequent entries in a procedure linkage table look like this. */ -static const bfd_byte elf_cfv4e_plt_entry[CFV4E_PLT_ENTRY_SIZE] = +static const bfd_byte elf_isab_plt_entry[ISAB_PLT_ENTRY_SIZE] = { - 0x20, 0x3c, - 0, 0, 0, 0, /* Replaced with offset to symbol's .got entry. */ - 0x20, 0x7b, 0x08, 0x00, /* move.l (%pc,%d0:l), %a0 */ + 0x20, 0x3c, /* move.l #offset,%d0 */ + 0, 0, 0, 0, /* + (.got.plt entry) - . */ + 0x20, 0x7b, 0x08, 0xfa, /* move.l (-6,%pc,%d0:l), %a0 */ 0x4e, 0xd0, /* jmp (%a0) */ 0x2f, 0x3c, /* move.l #offset,-(%sp) */ - 0, 0, 0, 0, /* Replaced with offset into relocation table. */ + 0, 0, 0, 0, /* + reloc index */ 0x60, 0xff, /* bra.l .plt */ - 0, 0, 0, 0 /* Replaced with offset to start of .plt. */ + 0, 0, 0, 0 /* + .plt - . */ }; -#define CPU32_FLAG(abfd) (elf_elfheader (abfd)->e_flags & EF_M68K_CPU32) +static const struct elf_m68k_plt_info elf_isab_plt_info = { + ISAB_PLT_ENTRY_SIZE, + elf_isab_plt0_entry, { 2, 12 }, + elf_isab_plt_entry, { 2, 20 }, 12 +}; -#define PLT_CPU32_ENTRY_SIZE 24 +#define ISAC_PLT_ENTRY_SIZE 24 + +static const bfd_byte elf_isac_plt0_entry[ISAC_PLT_ENTRY_SIZE] = +{ + 0x20, 0x3c, /* move.l #offset,%d0 */ + 0, 0, 0, 0, /* replaced with .got + 4 - . */ + 0x2e, 0xbb, 0x08, 0xfa, /* move.l (-6,%pc,%d0:l),(%sp) */ + 0x20, 0x3c, /* move.l #offset,%d0 */ + 0, 0, 0, 0, /* replaced with .got + 8 - . */ + 0x20, 0x7b, 0x08, 0xfa, /* move.l (-6,%pc,%d0:l), %a0 */ + 0x4e, 0xd0, /* jmp (%a0) */ + 0x4e, 0x71 /* nop */ +}; + +/* Subsequent entries in a procedure linkage table look like this. */ + +static const bfd_byte elf_isac_plt_entry[ISAC_PLT_ENTRY_SIZE] = +{ + 0x20, 0x3c, /* move.l #offset,%d0 */ + 0, 0, 0, 0, /* replaced with (.got entry) - . */ + 0x20, 0x7b, 0x08, 0xfa, /* move.l (-6,%pc,%d0:l), %a0 */ + 0x4e, 0xd0, /* jmp (%a0) */ + 0x2f, 0x3c, /* move.l #offset,-(%sp) */ + 0, 0, 0, 0, /* replaced with offset into relocation table */ + 0x61, 0xff, /* bsr.l .plt */ + 0, 0, 0, 0 /* replaced with .plt - . */ +}; + +static const struct elf_m68k_plt_info elf_isac_plt_info = { + ISAC_PLT_ENTRY_SIZE, + elf_isac_plt0_entry, { 2, 12}, + elf_isac_plt_entry, { 2, 20 }, 12 +}; + +#define CPU32_PLT_ENTRY_SIZE 24 /* Procedure linkage table entries for the cpu32 */ -static const bfd_byte elf_cpu32_plt0_entry[PLT_CPU32_ENTRY_SIZE] = +static const bfd_byte elf_cpu32_plt0_entry[CPU32_PLT_ENTRY_SIZE] = { 0x2f, 0x3b, 0x01, 0x70, /* move.l (%pc,addr),-(%sp) */ - 0, 0, 0, 0, /* replaced with offset to .got + 4. */ + 0, 0, 0, 2, /* + (.got + 4) - . */ 0x22, 0x7b, 0x01, 0x70, /* moveal %pc@(0xc), %a1 */ - 0, 0, 0, 0, /* replace with offset to .got +8. */ + 0, 0, 0, 2, /* + (.got + 8) - . */ 0x4e, 0xd1, /* jmp %a1@ */ 0, 0, 0, 0, /* pad out to 24 bytes. */ 0, 0 }; -static const bfd_byte elf_cpu32_plt_entry[PLT_CPU32_ENTRY_SIZE] = +static const bfd_byte elf_cpu32_plt_entry[CPU32_PLT_ENTRY_SIZE] = { 0x22, 0x7b, 0x01, 0x70, /* moveal %pc@(0xc), %a1 */ - 0, 0, 0, 0, /* replaced with offset to symbol's .got entry. */ + 0, 0, 0, 2, /* + (.got.plt entry) - . */ 0x4e, 0xd1, /* jmp %a1@ */ 0x2f, 0x3c, /* move.l #offset,-(%sp) */ - 0, 0, 0, 0, /* replaced with offset into relocation table. */ + 0, 0, 0, 0, /* + reloc index */ 0x60, 0xff, /* bra.l .plt */ - 0, 0, 0, 0, /* replaced with offset to start of .plt. */ + 0, 0, 0, 0, /* + .plt - . */ 0, 0 }; +static const struct elf_m68k_plt_info elf_cpu32_plt_info = { + CPU32_PLT_ENTRY_SIZE, + elf_cpu32_plt0_entry, { 4, 12 }, + elf_cpu32_plt_entry, { 4, 18 }, 10 +}; + /* The m68k linker needs to keep track of the number of relocs that it decides to copy in check_relocs for each symbol. This is so that it can discard PC relative relocs if it doesn't need them when linking @@ -315,6 +404,10 @@ struct elf_m68k_link_hash_table /* Small local sym to section mapping cache. */ struct sym_sec_cache sym_sec; + + /* The PLT format used by this link, or NULL if the format has not + yet been chosen. */ + const struct elf_m68k_plt_info *plt_info; }; /* Get the m68k ELF linker hash table from a link_info structure. */ @@ -370,6 +463,7 @@ elf_m68k_link_hash_table_create (abfd) } ret->sym_sec.abfd = NULL; + ret->plt_info = NULL; return &ret->root.root; } @@ -383,40 +477,45 @@ elf32_m68k_object_p (bfd *abfd) unsigned features = 0; flagword eflags = elf_elfheader (abfd)->e_flags; - if (eflags & EF_M68K_M68000) + if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_M68000) features |= m68000; - else if (eflags & EF_M68K_CPU32) + else if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32) features |= cpu32; - else if (eflags & EF_M68K_ISA_MASK) + else if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_FIDO) + features |= fido_a; + else { - switch (eflags & EF_M68K_ISA_MASK) + switch (eflags & EF_M68K_CF_ISA_MASK) { - case EF_M68K_ISA_A_NODIV: + case EF_M68K_CF_ISA_A_NODIV: features |= mcfisa_a; break; - case EF_M68K_ISA_A: + case EF_M68K_CF_ISA_A: features |= mcfisa_a|mcfhwdiv; break; - case EF_M68K_ISA_A_PLUS: + case EF_M68K_CF_ISA_A_PLUS: features |= mcfisa_a|mcfisa_aa|mcfhwdiv|mcfusp; break; - case EF_M68K_ISA_B_NOUSP: + case EF_M68K_CF_ISA_B_NOUSP: features |= mcfisa_a|mcfisa_b|mcfhwdiv; break; - case EF_M68K_ISA_B: + case EF_M68K_CF_ISA_B: features |= mcfisa_a|mcfisa_b|mcfhwdiv|mcfusp; break; + case EF_M68K_CF_ISA_C: + features |= mcfisa_a|mcfisa_c|mcfhwdiv|mcfusp; + break; } - switch (eflags & EF_M68K_MAC_MASK) + switch (eflags & EF_M68K_CF_MAC_MASK) { - case EF_M68K_MAC: + case EF_M68K_CF_MAC: features |= mcfmac; break; - case EF_M68K_EMAC: + case EF_M68K_CF_EMAC: features |= mcfemac; break; } - if (eflags & EF_M68K_FLOAT) + if (eflags & EF_M68K_CF_FLOAT) features |= cfloat; } @@ -472,10 +571,27 @@ elf32_m68k_merge_private_bfd_data (ibfd, obfd) else { out_flags = elf_elfheader (obfd)->e_flags; - in_isa = (in_flags & EF_M68K_ISA_MASK); - out_isa = (out_flags & EF_M68K_ISA_MASK); + unsigned int variant_mask; + + if ((in_flags & EF_M68K_ARCH_MASK) == EF_M68K_M68000) + variant_mask = 0; + else if ((in_flags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32) + variant_mask = 0; + else if ((in_flags & EF_M68K_ARCH_MASK) == EF_M68K_FIDO) + variant_mask = 0; + else + variant_mask = EF_M68K_CF_ISA_MASK; + + in_isa = (in_flags & variant_mask); + out_isa = (out_flags & variant_mask); if (in_isa > out_isa) out_flags ^= in_isa ^ out_isa; + if (((in_flags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32 + && (out_flags & EF_M68K_ARCH_MASK) == EF_M68K_FIDO) + || ((in_flags & EF_M68K_ARCH_MASK) == EF_M68K_FIDO + && (out_flags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32)) + out_flags = EF_M68K_FIDO; + else out_flags |= in_flags ^ in_isa; } elf_elfheader (obfd)->e_flags = out_flags; @@ -502,58 +618,64 @@ elf32_m68k_print_private_bfd_data (abfd, ptr) /* xgettext:c-format */ fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags); - if (eflags & EF_M68K_CPU32) - fprintf (file, " [cpu32]"); - - if (eflags & EF_M68K_M68000) + if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_M68000) fprintf (file, " [m68000]"); - - if (eflags & EF_M68K_CFV4E) - fprintf (file, " [cfv4e]"); - - if (eflags & EF_M68K_ISA_MASK) + else if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32) + fprintf (file, " [cpu32]"); + else if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_FIDO) + fprintf (file, " [fido]"); + else { - char const *isa = _("unknown"); - char const *mac = _("unknown"); - char const *additional = ""; + if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_CFV4E) + fprintf (file, " [cfv4e]"); + + if (eflags & EF_M68K_CF_ISA_MASK) + { + char const *isa = _("unknown"); + char const *mac = _("unknown"); + char const *additional = ""; - switch (eflags & EF_M68K_ISA_MASK) - { - case EF_M68K_ISA_A_NODIV: - isa = "A"; - additional = " [nodiv]"; - break; - case EF_M68K_ISA_A: - isa = "A"; - break; - case EF_M68K_ISA_A_PLUS: - isa = "A+"; - break; - case EF_M68K_ISA_B_NOUSP: - isa = "B"; - additional = " [nousp]"; - break; - case EF_M68K_ISA_B: - isa = "B"; - break; + switch (eflags & EF_M68K_CF_ISA_MASK) + { + case EF_M68K_CF_ISA_A_NODIV: + isa = "A"; + additional = " [nodiv]"; + break; + case EF_M68K_CF_ISA_A: + isa = "A"; + break; + case EF_M68K_CF_ISA_A_PLUS: + isa = "A+"; + break; + case EF_M68K_CF_ISA_B_NOUSP: + isa = "B"; + additional = " [nousp]"; + break; + case EF_M68K_CF_ISA_B: + isa = "B"; + break; + case EF_M68K_CF_ISA_C: + isa = "C"; + break; + } + fprintf (file, " [isa %s]%s", isa, additional); + if (eflags & EF_M68K_CF_FLOAT) + fprintf (file, " [float]"); + switch (eflags & EF_M68K_CF_MAC_MASK) + { + case 0: + mac = NULL; + break; + case EF_M68K_CF_MAC: + mac = "mac"; + break; + case EF_M68K_CF_EMAC: + mac = "emac"; + break; + } + if (mac) + fprintf (file, " [%s]", mac); } - fprintf (file, " [isa %s]%s", isa, additional); - if (eflags & EF_M68K_FLOAT) - fprintf (file, " [float]"); - switch (eflags & EF_M68K_MAC_MASK) - { - case 0: - mac = NULL; - break; - case EF_M68K_MAC: - mac = "mac"; - break; - case EF_M68K_EMAC: - mac = "emac"; - break; - } - if (mac) - fprintf (file, " [%s]", mac); } fputc ('\n', file); @@ -812,7 +934,7 @@ elf_m68k_check_relocs (abfd, info, sec, relocs) if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (abfd, sec), name + 5) == 0); @@ -928,50 +1050,30 @@ elf_m68k_check_relocs (abfd, info, sec, relocs) relocation. */ static asection * -elf_m68k_gc_mark_hook (sec, info, rel, h, sym) - asection *sec; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +elf_m68k_gc_mark_hook (asection *sec, + struct bfd_link_info *info, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_68K_GNU_VTINHERIT: - case R_68K_GNU_VTENTRY: - break; + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_68K_GNU_VTINHERIT: + case R_68K_GNU_VTENTRY: + return NULL; + } - default: - switch (h->root.type) - { - default: - break; - - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Update the got entry reference counts for the section being removed. */ static bfd_boolean -elf_m68k_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; +elf_m68k_gc_sweep_hook (bfd *abfd, + struct bfd_link_info *info, + asection *sec, + const Elf_Internal_Rela *relocs) { Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; @@ -1070,6 +1172,34 @@ elf_m68k_gc_sweep_hook (abfd, info, sec, relocs) return TRUE; } + +/* Return the type of PLT associated with OUTPUT_BFD. */ + +static const struct elf_m68k_plt_info * +elf_m68k_get_plt_info (bfd *output_bfd) +{ + unsigned int features; + + features = bfd_m68k_mach_to_features (bfd_get_mach (output_bfd)); + if (features & cpu32) + return &elf_cpu32_plt_info; + if (features & mcfisa_b) + return &elf_isab_plt_info; + if (features & mcfisa_c) + return &elf_isac_plt_info; + return &elf_m68k_plt_info; +} + +/* This function is called after all the input files have been read, + and the input sections have been assigned to output sections. + It's a convenient place to determine the PLT style. */ + +static bfd_boolean +elf_m68k_always_size_sections (bfd *output_bfd, struct bfd_link_info *info) +{ + elf_m68k_hash_table (info)->plt_info = elf_m68k_get_plt_info (output_bfd); + return TRUE; +} /* Adjust a symbol defined by a dynamic object and referenced by a regular object. The current definition is in some section of the @@ -1082,10 +1212,11 @@ elf_m68k_adjust_dynamic_symbol (info, h) struct bfd_link_info *info; struct elf_link_hash_entry *h; { + struct elf_m68k_link_hash_table *htab; bfd *dynobj; asection *s; - unsigned int power_of_two; + htab = elf_m68k_hash_table (info); dynobj = elf_hash_table (info)->dynobj; /* Make sure we know what is going on here. */ @@ -1135,14 +1266,7 @@ elf_m68k_adjust_dynamic_symbol (info, h) /* If this is the first .plt entry, make room for the special first entry. */ if (s->size == 0) - { - if (CPU32_FLAG (dynobj)) - s->size += PLT_CPU32_ENTRY_SIZE; - else if (CFV4E_FLAG (dynobj)) - s->size += CFV4E_PLT_ENTRY_SIZE; - else - s->size += PLT_ENTRY_SIZE; - } + s->size = htab->plt_info->size; /* If this symbol is not defined in a regular file, and we are not generating a shared library, then set the symbol to this @@ -1159,12 +1283,7 @@ elf_m68k_adjust_dynamic_symbol (info, h) h->plt.offset = s->size; /* Make room for this entry. */ - if (CPU32_FLAG (dynobj)) - s->size += PLT_CPU32_ENTRY_SIZE; - else if (CFV4E_FLAG (dynobj)) - s->size += CFV4E_PLT_ENTRY_SIZE; - else - s->size += PLT_ENTRY_SIZE; + s->size += htab->plt_info->size; /* We also need to make an entry in the .got.plt section, which will be placed in the .got section by the linker script. */ @@ -1240,28 +1359,7 @@ elf_m68k_adjust_dynamic_symbol (info, h) h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 3) - power_of_two = 3; - - /* Apply the required alignment. */ - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (dynobj, s)) - { - if (!bfd_set_section_alignment (dynobj, s, power_of_two)) - return FALSE; - } - - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Set the sizes of the dynamic sections. */ @@ -1334,7 +1432,7 @@ elf_m68k_size_dynamic_sections (output_bfd, info) /* Remember whether there is a PLT. */ plt = s->size != 0; } - else if (strncmp (name, ".rela", 5) == 0) + else if (CONST_STRNEQ (name, ".rela")) { if (s->size != 0) { @@ -1345,7 +1443,7 @@ elf_m68k_size_dynamic_sections (output_bfd, info) s->reloc_count = 0; } } - else if (strncmp (name, ".got", 4) != 0 + else if (! CONST_STRNEQ (name, ".got") && strcmp (name, ".dynbss") != 0) { /* It's not one of our sections, so don't allocate space. */ @@ -1501,9 +1599,6 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocatable) - return TRUE; - dynobj = elf_hash_table (info)->dynobj; symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -1558,6 +1653,20 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, unresolved_reloc, warned); } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + switch (r_type) { case R_68K_GOT8: @@ -1791,11 +1900,12 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, else { /* This symbol is local, or marked to become local. */ + outrel.r_addend = relocation + rel->r_addend; + if (r_type == R_68K_32) { relocate = TRUE; outrel.r_info = ELF32_R_INFO (0, R_68K_RELATIVE); - outrel.r_addend = relocation + rel->r_addend; } else { @@ -1812,13 +1922,24 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, { asection *osec; + /* We are turning this relocation into one + against a section symbol. It would be + proper to subtract the symbol's value, + osec->vma, from the emitted reloc addend, + but ld.so expects buggy relocs. */ osec = sec->output_section; indx = elf_section_data (osec)->dynindx; - BFD_ASSERT (indx > 0); + if (indx == 0) + { + struct elf_link_hash_table *htab; + htab = elf_hash_table (info); + osec = htab->text_index_section; + indx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (indx != 0); } outrel.r_info = ELF32_R_INFO (indx, r_type); - outrel.r_addend = relocation + rel->r_addend; } } @@ -1909,6 +2030,21 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, return TRUE; } +/* Install an M_68K_PC32 relocation against VALUE at offset OFFSET + into section SEC. */ + +static void +elf_m68k_install_pc32 (asection *sec, bfd_vma offset, bfd_vma value) +{ + /* Make VALUE PC-relative. */ + value -= sec->output_section->vma + offset; + + /* Apply any in-place addend. */ + value += bfd_get_32 (sec->owner, sec->contents + offset); + + bfd_put_32 (sec->owner, value, sec->contents + offset); +} + /* Finish up dynamic symbol handling. We set the contents of various dynamic sections here. */ @@ -1920,12 +2056,12 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym) Elf_Internal_Sym *sym; { bfd *dynobj; - int plt_off1, plt_off2, plt_off3; dynobj = elf_hash_table (info)->dynobj; if (h->plt.offset != (bfd_vma) -1) { + const struct elf_m68k_plt_info *plt_info; asection *splt; asection *sgot; asection *srela; @@ -1939,6 +2075,7 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym) BFD_ASSERT (h->dynindx != -1); + plt_info = elf_m68k_hash_table (info)->plt_info; splt = bfd_get_section_by_name (dynobj, ".plt"); sgot = bfd_get_section_by_name (dynobj, ".got.plt"); srela = bfd_get_section_by_name (dynobj, ".rela.plt"); @@ -1948,66 +2085,36 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym) corresponds to this symbol. This is the index of this symbol in all the symbols for which we are making plt entries. The first entry in the procedure linkage table is reserved. */ - if (CPU32_FLAG (output_bfd)) - plt_index = (h->plt.offset / PLT_CPU32_ENTRY_SIZE) - 1; - else if (CFV4E_FLAG (output_bfd)) - plt_index = (h->plt.offset / CFV4E_PLT_ENTRY_SIZE) - 1; - else - plt_index = (h->plt.offset / PLT_ENTRY_SIZE) - 1; + plt_index = (h->plt.offset / plt_info->size) - 1; /* Get the offset into the .got table of the entry that corresponds to this function. Each .got entry is 4 bytes. The first three are reserved. */ got_offset = (plt_index + 3) * 4; - if (CPU32_FLAG (output_bfd)) - { - /* Fill in the entry in the procedure linkage table. */ - memcpy (splt->contents + h->plt.offset, elf_cpu32_plt_entry, - PLT_CPU32_ENTRY_SIZE); - plt_off1 = 4; - plt_off2 = 12; - plt_off3 = 18; - } - else if (CFV4E_FLAG (output_bfd)) - { - memcpy (splt->contents + h->plt.offset, elf_cfv4e_plt_entry, - CFV4E_PLT_ENTRY_SIZE); - plt_off1 = 2; - plt_off2 = 14; - plt_off3 = 20; - } - else - { - /* Fill in the entry in the procedure linkage table. */ - memcpy (splt->contents + h->plt.offset, elf_m68k_plt_entry, - PLT_ENTRY_SIZE); - plt_off1 = 4; - plt_off2 = 10; - plt_off3 = 16; - } + memcpy (splt->contents + h->plt.offset, + plt_info->symbol_entry, + plt_info->size); - /* The offset is relative to the first extension word. */ - bfd_put_32 (output_bfd, - sgot->output_section->vma - + sgot->output_offset - + got_offset - - (splt->output_section->vma - + h->plt.offset - + (CFV4E_FLAG (output_bfd) ? 8 : 2)), - splt->contents + h->plt.offset + plt_off1); + elf_m68k_install_pc32 (splt, h->plt.offset + plt_info->symbol_relocs.got, + (sgot->output_section->vma + + sgot->output_offset + + got_offset)); bfd_put_32 (output_bfd, plt_index * sizeof (Elf32_External_Rela), - splt->contents + h->plt.offset + plt_off2); - bfd_put_32 (output_bfd, - (h->plt.offset + plt_off3), - splt->contents + h->plt.offset + plt_off3); + splt->contents + + h->plt.offset + + plt_info->symbol_resolve_entry + 2); + + elf_m68k_install_pc32 (splt, h->plt.offset + plt_info->symbol_relocs.plt, + splt->output_section->vma); /* Fill in the entry in the global offset table. */ bfd_put_32 (output_bfd, (splt->output_section->vma + splt->output_offset + h->plt.offset - + (CFV4E_FLAG (output_bfd) ? 12 : 8)), + + plt_info->symbol_resolve_entry), sgot->contents + got_offset); /* Fill in the entry in the .rela.plt section. */ @@ -2185,54 +2292,23 @@ elf_m68k_finish_dynamic_sections (output_bfd, info) /* Fill in the first entry in the procedure linkage table. */ if (splt->size > 0) { - if (CFV4E_FLAG (output_bfd)) - { - memcpy (splt->contents, elf_cfv4e_plt0_entry, CFV4E_PLT_ENTRY_SIZE); - bfd_put_32 (output_bfd, - (sgot->output_section->vma - + sgot->output_offset + 4 - - (splt->output_section->vma + 2)), - splt->contents + 2); - bfd_put_32 (output_bfd, - (sgot->output_section->vma - + sgot->output_offset + 8 - - (splt->output_section->vma + 10) - 8), - splt->contents + 12); - elf_section_data (splt->output_section)->this_hdr.sh_entsize - = CFV4E_PLT_ENTRY_SIZE; - } - else if (CPU32_FLAG (output_bfd)) - { - memcpy (splt->contents, elf_cpu32_plt0_entry, PLT_CPU32_ENTRY_SIZE); - bfd_put_32 (output_bfd, - (sgot->output_section->vma - + sgot->output_offset + 4 - - (splt->output_section->vma + 2)), - splt->contents + 4); - bfd_put_32 (output_bfd, - (sgot->output_section->vma - + sgot->output_offset + 8 - - (splt->output_section->vma + 10)), - splt->contents + 12); - elf_section_data (splt->output_section)->this_hdr.sh_entsize - = PLT_CPU32_ENTRY_SIZE; - } - else - { - memcpy (splt->contents, elf_m68k_plt0_entry, PLT_ENTRY_SIZE); - bfd_put_32 (output_bfd, - (sgot->output_section->vma - + sgot->output_offset + 4 - - (splt->output_section->vma + 2)), - splt->contents + 4); - bfd_put_32 (output_bfd, - (sgot->output_section->vma - + sgot->output_offset + 8 - - (splt->output_section->vma + 10)), - splt->contents + 12); - elf_section_data (splt->output_section)->this_hdr.sh_entsize - = PLT_ENTRY_SIZE; - } + const struct elf_m68k_plt_info *plt_info; + + plt_info = elf_m68k_hash_table (info)->plt_info; + memcpy (splt->contents, plt_info->plt0_entry, plt_info->size); + + elf_m68k_install_pc32 (splt, plt_info->plt0_relocs.got4, + (sgot->output_section->vma + + sgot->output_offset + + 4)); + + elf_m68k_install_pc32 (splt, plt_info->plt0_relocs.got8, + (sgot->output_section->vma + + sgot->output_offset + + 8)); + + elf_section_data (splt->output_section)->this_hdr.sh_entsize + = plt_info->size; } } @@ -2401,9 +2477,7 @@ static bfd_vma elf_m68k_plt_sym_val (bfd_vma i, const asection *plt, const arelent *rel ATTRIBUTE_UNUSED) { - if (CPU32_FLAG (plt->owner)) - return plt->vma + (i + 1) * PLT_CPU32_ENTRY_SIZE; - return plt->vma + (i + 1) * PLT_ENTRY_SIZE; + return plt->vma + (i + 1) * elf_m68k_get_plt_info (plt->owner)->size; } #define TARGET_BIG_SYM bfd_elf32_m68k_vec @@ -2417,10 +2491,13 @@ elf_m68k_plt_sym_val (bfd_vma i, const asection *plt, #define bfd_elf32_bfd_final_link bfd_elf_gc_common_final_link #define elf_backend_check_relocs elf_m68k_check_relocs +#define elf_backend_always_size_sections \ + elf_m68k_always_size_sections #define elf_backend_adjust_dynamic_symbol \ elf_m68k_adjust_dynamic_symbol #define elf_backend_size_dynamic_sections \ elf_m68k_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_relocate_section elf_m68k_relocate_section #define elf_backend_finish_dynamic_symbol \ elf_m68k_finish_dynamic_symbol diff --git a/bfd/elf32-m88k.c b/bfd/elf32-m88k.c index 1554c23884c..c6c34a3105c 100644 --- a/bfd/elf32-m88k.c +++ b/bfd/elf32-m88k.c @@ -1,5 +1,5 @@ /* Motorola 88k-specific support for 32-bit ELF - Copyright 1993, 1995, 1999 Free Software Foundation, Inc. + Copyright 1993, 1995, 1999, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" @@ -31,6 +31,7 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define ELF_MACHINE_CODE EM_88K #define ELF_MAXPAGESIZE 1 /* FIXME: This number is wrong, It should be the page size in bytes. */ #define bfd_elf32_bfd_reloc_type_lookup bfd_default_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup #define elf_info_to_howto _bfd_elf_no_info_to_howto #include "elf32-target.h" diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c index ed0123d553b..66f4db8b62a 100644 --- a/bfd/elf32-mcore.c +++ b/bfd/elf32-mcore.c @@ -1,6 +1,6 @@ /* Motorola MCore specific support for 32-bit ELF - Copyright 1994, 1995, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1994, 1995, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -22,8 +22,8 @@ /* This file is based on a preliminary RCE ELF ABI. The information may not match the final RCE ELF ABI. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -317,6 +317,22 @@ mcore_elf_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, return mcore_elf_howto_table [(int) mcore_reloc]; }; +static reloc_howto_type * +mcore_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (mcore_elf_howto_raw) / sizeof (mcore_elf_howto_raw[0]); + i++) + if (mcore_elf_howto_raw[i].name != NULL + && strcasecmp (mcore_elf_howto_raw[i].name, r_name) == 0) + return &mcore_elf_howto_raw[i]; + + return NULL; +} + /* Set the howto pointer for a RCE ELF reloc. */ static void @@ -387,9 +403,6 @@ mcore_elf_relocate_section (bfd * output_bfd, (info->relocatable) ? " (relocatable)" : ""); #endif - if (info->relocatable) - return TRUE; - if (! mcore_elf_howto_table [R_MCORE_PCRELIMM8BY4]) /* Initialize howto table if needed */ mcore_elf_howto_init (); @@ -452,6 +465,20 @@ mcore_elf_relocate_section (bfd * output_bfd, unresolved_reloc, warned); } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + switch (r_type) { default: @@ -526,37 +553,21 @@ mcore_elf_relocate_section (bfd * output_bfd, relocation. */ static asection * -mcore_elf_gc_mark_hook (asection * sec, - struct bfd_link_info * info ATTRIBUTE_UNUSED, - Elf_Internal_Rela * rel, - struct elf_link_hash_entry * h, - Elf_Internal_Sym * sym) +mcore_elf_gc_mark_hook (asection *sec, + struct bfd_link_info *info, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { - if (h == NULL) - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); + if (h != NULL) + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_MCORE_GNU_VTINHERIT: + case R_MCORE_GNU_VTENTRY: + return NULL; + } - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_MCORE_GNU_VTINHERIT: - case R_MCORE_GNU_VTENTRY: - break; - - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Update the got entry reference counts for the section being removed. */ @@ -637,9 +648,9 @@ mcore_elf_check_relocs (bfd * abfd, static const struct bfd_elf_special_section mcore_elf_special_sections[]= { - { ".ctors", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".dtors", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".ctors"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".dtors"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { NULL, 0, 0, 0, 0 } }; #define TARGET_BIG_SYM bfd_elf32_mcore_big_vec @@ -656,6 +667,7 @@ static const struct bfd_elf_special_section mcore_elf_special_sections[]= #define bfd_elf32_bfd_merge_private_bfd_data mcore_elf_merge_private_bfd_data #define bfd_elf32_bfd_set_private_flags mcore_elf_set_private_flags #define bfd_elf32_bfd_reloc_type_lookup mcore_elf_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup mcore_elf_reloc_name_lookup #define elf_backend_relocate_section mcore_elf_relocate_section #define elf_backend_gc_mark_hook mcore_elf_gc_mark_hook #define elf_backend_gc_sweep_hook mcore_elf_gc_sweep_hook diff --git a/bfd/elf32-mep.c b/bfd/elf32-mep.c new file mode 100644 index 00000000000..169da4454bc --- /dev/null +++ b/bfd/elf32-mep.c @@ -0,0 +1,959 @@ +/* MeP-specific support for 32-bit ELF. + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + 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 2 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 "libbfd.h" +#include "elf-bfd.h" +#include "elf/mep.h" +#include "libiberty.h" + +/* Forward declarations. */ + +/* Private relocation functions. */ + +#define MEPREL(type, size, bits, right, left, pcrel, overflow, mask) \ + {(unsigned)type, right, size, bits, pcrel, left, overflow, mep_reloc, #type, FALSE, 0, mask, 0 } + +#define N complain_overflow_dont +#define S complain_overflow_signed +#define U complain_overflow_unsigned + +static bfd_reloc_status_type mep_reloc (bfd *, arelent *, struct bfd_symbol *, + void *, asection *, bfd *, char **); + +static reloc_howto_type mep_elf_howto_table [] = +{ + /* type, size, bits, leftshift, rightshift, pcrel, OD/OS/OU, mask. */ + MEPREL (R_MEP_NONE, 0, 0, 0, 0, 0, N, 0), + MEPREL (R_RELC, 0, 0, 0, 0, 0, N, 0), + /* MEPRELOC:HOWTO */ + /* This section generated from bfd/mep-relocs.pl from include/elf/mep.h. */ + MEPREL (R_MEP_8, 0, 8, 0, 0, 0, U, 0xff), + MEPREL (R_MEP_16, 1, 16, 0, 0, 0, U, 0xffff), + MEPREL (R_MEP_32, 2, 32, 0, 0, 0, U, 0xffffffff), + MEPREL (R_MEP_PCREL8A2, 1, 8, 1, 1, 1, S, 0x00fe), + MEPREL (R_MEP_PCREL12A2,1, 12, 1, 1, 1, S, 0x0ffe), + MEPREL (R_MEP_PCREL17A2,2, 17, 0, 1, 1, S, 0x0000ffff), + MEPREL (R_MEP_PCREL24A2,2, 24, 0, 1, 1, S, 0x07f0ffff), + MEPREL (R_MEP_PCABS24A2,2, 24, 0, 1, 0, U, 0x07f0ffff), + MEPREL (R_MEP_LOW16, 2, 16, 0, 0, 0, N, 0x0000ffff), + MEPREL (R_MEP_HI16U, 2, 32, 0,16, 0, N, 0x0000ffff), + MEPREL (R_MEP_HI16S, 2, 32, 0,16, 0, N, 0x0000ffff), + MEPREL (R_MEP_GPREL, 2, 16, 0, 0, 0, S, 0x0000ffff), + MEPREL (R_MEP_TPREL, 2, 16, 0, 0, 0, S, 0x0000ffff), + MEPREL (R_MEP_TPREL7, 1, 7, 0, 0, 0, U, 0x007f), + MEPREL (R_MEP_TPREL7A2, 1, 7, 1, 1, 0, U, 0x007e), + MEPREL (R_MEP_TPREL7A4, 1, 7, 2, 2, 0, U, 0x007c), + MEPREL (R_MEP_UIMM24, 2, 24, 0, 0, 0, U, 0x00ffffff), + MEPREL (R_MEP_ADDR24A4, 2, 24, 0, 2, 0, U, 0x00fcffff), + MEPREL (R_MEP_GNU_VTINHERIT,1, 0,16,32, 0, N, 0x0000), + MEPREL (R_MEP_GNU_VTENTRY,1, 0,16,32, 0, N, 0x0000), + /* MEPRELOC:END */ +}; + +#define VALID_MEP_RELOC(N) ((N) >= 0 \ + && (N) < ARRAY_SIZE (mep_elf_howto_table) + +#undef N +#undef S +#undef U + +static bfd_reloc_status_type +mep_reloc + (bfd * abfd ATTRIBUTE_UNUSED, + arelent * reloc_entry ATTRIBUTE_UNUSED, + struct bfd_symbol * symbol ATTRIBUTE_UNUSED, + void * data ATTRIBUTE_UNUSED, + asection * input_section ATTRIBUTE_UNUSED, + bfd * output_bfd ATTRIBUTE_UNUSED, + char ** error_message ATTRIBUTE_UNUSED) +{ + return bfd_reloc_ok; +} + + + +#define BFD_RELOC_MEP_NONE BFD_RELOC_NONE +#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) +#define MAP(n) case BFD_RELOC_MEP_##n: type = R_MEP_##n; break +#else +#define MAP(n) case BFD_RELOC_MEP_/**/n: type = R_MEP_/**/n; break +#endif + +static reloc_howto_type * +mep_reloc_type_lookup + (bfd * abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) +{ + unsigned int type = 0; + + switch (code) + { + MAP(NONE); + case BFD_RELOC_8: + type = R_MEP_8; + break; + case BFD_RELOC_16: + type = R_MEP_16; + break; + case BFD_RELOC_32: + type = R_MEP_32; + break; + case BFD_RELOC_VTABLE_ENTRY: + type = R_MEP_GNU_VTENTRY; + break; + case BFD_RELOC_VTABLE_INHERIT: + type = R_MEP_GNU_VTINHERIT; + break; + case BFD_RELOC_RELC: + type = R_RELC; + break; + + /* MEPRELOC:MAP */ + /* This section generated from bfd/mep-relocs.pl from include/elf/mep.h. */ + MAP(8); + MAP(16); + MAP(32); + MAP(PCREL8A2); + MAP(PCREL12A2); + MAP(PCREL17A2); + MAP(PCREL24A2); + MAP(PCABS24A2); + MAP(LOW16); + MAP(HI16U); + MAP(HI16S); + MAP(GPREL); + MAP(TPREL); + MAP(TPREL7); + MAP(TPREL7A2); + MAP(TPREL7A4); + MAP(UIMM24); + MAP(ADDR24A4); + MAP(GNU_VTINHERIT); + MAP(GNU_VTENTRY); + /* MEPRELOC:END */ + + default: + /* Pacify gcc -Wall. */ + fprintf (stderr, "mep: no reloc for code %d\n", code); + return NULL; + } + + if (mep_elf_howto_table[type].type != type) + { + fprintf (stderr, "MeP: howto %d has type %d\n", type, mep_elf_howto_table[type].type); + abort (); + } + + return mep_elf_howto_table + type; +} + +#undef MAP + +static reloc_howto_type * +mep_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (mep_elf_howto_table) / sizeof (mep_elf_howto_table[0]); + i++) + if (mep_elf_howto_table[i].name != NULL + && strcasecmp (mep_elf_howto_table[i].name, r_name) == 0) + return &mep_elf_howto_table[i]; + + return NULL; +} + +/* Perform a single relocation. */ + +static struct bfd_link_info *mep_info; +static int warn_tp = 0, warn_sda = 0; + +static bfd_vma +mep_lookup_global + (char * name, + bfd_vma ofs, + bfd_vma * cache, + int * warn) +{ + struct bfd_link_hash_entry *h; + + if (*cache || *warn) + return *cache; + + h = bfd_link_hash_lookup (mep_info->hash, name, FALSE, FALSE, TRUE); + if (h == 0 || h->type != bfd_link_hash_defined) + { + *warn = ofs + 1; + return 0; + } + *cache = (h->u.def.value + + h->u.def.section->output_section->vma + + h->u.def.section->output_offset); + return *cache; +} + +static bfd_vma +mep_tpoff_base (bfd_vma ofs) +{ + static bfd_vma cache = 0; + return mep_lookup_global ("__tpbase", ofs, &cache, &warn_tp); +} + +static bfd_vma +mep_sdaoff_base (bfd_vma ofs) +{ + static bfd_vma cache = 0; + return mep_lookup_global ("__sdabase", ofs, &cache, &warn_sda); +} + +static bfd_reloc_status_type +mep_final_link_relocate + (reloc_howto_type * howto, + bfd * input_bfd, + asection * input_section, + bfd_byte * contents, + Elf_Internal_Rela * rel, + bfd_vma relocation) +{ + unsigned long u; + long s; + unsigned char *byte; + bfd_vma pc; + bfd_reloc_status_type r = bfd_reloc_ok; + int e2, e4; + + if (bfd_big_endian (input_bfd)) + { + e2 = 0; + e4 = 0; + } + else + { + e2 = 1; + e4 = 3; + } + + pc = (input_section->output_section->vma + + input_section->output_offset + + rel->r_offset); + + s = relocation + rel->r_addend; + + byte = (unsigned char *)contents + rel->r_offset; + + if (howto->type == R_MEP_PCREL24A2 + && s == 0 + && pc >= 0x800000) + { + /* This is an unreachable branch to an undefined weak function. + Silently ignore it, since the opcode can't do that but should + never be executed anyway. */ + return bfd_reloc_ok; + } + + if (howto->pc_relative) + s -= pc; + + u = (unsigned long) s; + + switch (howto->type) + { + /* MEPRELOC:APPLY */ + /* This section generated from bfd/mep-relocs.pl from include/elf/mep.h. */ + case R_MEP_8: /* 76543210 */ + if (u > 255) r = bfd_reloc_overflow; + byte[0] = (u & 0xff); + break; + case R_MEP_16: /* fedcba9876543210 */ + if (u > 65535) r = bfd_reloc_overflow; + byte[0^e2] = ((u >> 8) & 0xff); + byte[1^e2] = (u & 0xff); + break; + case R_MEP_32: /* vutsrqponmlkjihgfedcba9876543210 */ + byte[0^e4] = ((u >> 24) & 0xff); + byte[1^e4] = ((u >> 16) & 0xff); + byte[2^e4] = ((u >> 8) & 0xff); + byte[3^e4] = (u & 0xff); + break; + case R_MEP_PCREL8A2: /* --------7654321- */ + if (-128 > s || s > 127) r = bfd_reloc_overflow; + byte[1^e2] = (byte[1^e2] & 0x01) | (s & 0xfe); + break; + case R_MEP_PCREL12A2: /* ----ba987654321- */ + if (-2048 > s || s > 2047) r = bfd_reloc_overflow; + byte[0^e2] = (byte[0^e2] & 0xf0) | ((s >> 8) & 0x0f); + byte[1^e2] = (byte[1^e2] & 0x01) | (s & 0xfe); + break; + case R_MEP_PCREL17A2: /* ----------------gfedcba987654321 */ + if (-65536 > s || s > 65535) r = bfd_reloc_overflow; + byte[2^e2] = ((s >> 9) & 0xff); + byte[3^e2] = ((s >> 1) & 0xff); + break; + case R_MEP_PCREL24A2: /* -----7654321----nmlkjihgfedcba98 */ + if (-8388608 > s || s > 8388607) r = bfd_reloc_overflow; + byte[0^e2] = (byte[0^e2] & 0xf8) | ((s >> 5) & 0x07); + byte[1^e2] = (byte[1^e2] & 0x0f) | ((s << 3) & 0xf0); + byte[2^e2] = ((s >> 16) & 0xff); + byte[3^e2] = ((s >> 8) & 0xff); + break; + case R_MEP_PCABS24A2: /* -----7654321----nmlkjihgfedcba98 */ + if (u > 16777215) r = bfd_reloc_overflow; + byte[0^e2] = (byte[0^e2] & 0xf8) | ((u >> 5) & 0x07); + byte[1^e2] = (byte[1^e2] & 0x0f) | ((u << 3) & 0xf0); + byte[2^e2] = ((u >> 16) & 0xff); + byte[3^e2] = ((u >> 8) & 0xff); + break; + case R_MEP_LOW16: /* ----------------fedcba9876543210 */ + byte[2^e2] = ((u >> 8) & 0xff); + byte[3^e2] = (u & 0xff); + break; + case R_MEP_HI16U: /* ----------------vutsrqponmlkjihg */ + byte[2^e2] = ((u >> 24) & 0xff); + byte[3^e2] = ((u >> 16) & 0xff); + break; + case R_MEP_HI16S: /* ----------------vutsrqponmlkjihg */ + byte[2^e2] = ((s >> 24) & 0xff); + byte[3^e2] = ((s >> 16) & 0xff); + break; + case R_MEP_GPREL: /* ----------------fedcba9876543210 */ + s -= mep_sdaoff_base(rel->r_offset); + if (-32768 > s || s > 32767) r = bfd_reloc_overflow; + byte[2^e2] = ((s >> 8) & 0xff); + byte[3^e2] = (s & 0xff); + break; + case R_MEP_TPREL: /* ----------------fedcba9876543210 */ + s -= mep_tpoff_base(rel->r_offset); + if (-32768 > s || s > 32767) r = bfd_reloc_overflow; + byte[2^e2] = ((s >> 8) & 0xff); + byte[3^e2] = (s & 0xff); + break; + case R_MEP_TPREL7: /* ---------6543210 */ + u -= mep_tpoff_base(rel->r_offset); + if (u > 127) r = bfd_reloc_overflow; + byte[1^e2] = (byte[1^e2] & 0x80) | (u & 0x7f); + break; + case R_MEP_TPREL7A2: /* ---------654321- */ + u -= mep_tpoff_base(rel->r_offset); + if (u > 127) r = bfd_reloc_overflow; + byte[1^e2] = (byte[1^e2] & 0x81) | (u & 0x7e); + break; + case R_MEP_TPREL7A4: /* ---------65432-- */ + u -= mep_tpoff_base(rel->r_offset); + if (u > 127) r = bfd_reloc_overflow; + byte[1^e2] = (byte[1^e2] & 0x83) | (u & 0x7c); + break; + case R_MEP_UIMM24: /* --------76543210nmlkjihgfedcba98 */ + if (u > 16777215) r = bfd_reloc_overflow; + byte[1^e2] = (u & 0xff); + byte[2^e2] = ((u >> 16) & 0xff); + byte[3^e2] = ((u >> 8) & 0xff); + break; + case R_MEP_ADDR24A4: /* --------765432--nmlkjihgfedcba98 */ + if (u > 16777215) r = bfd_reloc_overflow; + byte[1^e2] = (byte[1^e2] & 0x03) | (u & 0xfc); + byte[2^e2] = ((u >> 16) & 0xff); + byte[3^e2] = ((u >> 8) & 0xff); + break; + case R_MEP_GNU_VTINHERIT: /* ---------------- */ + break; + case R_MEP_GNU_VTENTRY: /* ---------------- */ + break; + /* MEPRELOC:END */ + default: + abort (); + } + + return r; +} + +/* Set the howto pointer for a MEP ELF reloc. */ + +static void +mep_info_to_howto_rela + (bfd * abfd ATTRIBUTE_UNUSED, + arelent * cache_ptr, + Elf_Internal_Rela * dst) +{ + unsigned int r_type; + + r_type = ELF32_R_TYPE (dst->r_info); + cache_ptr->howto = & mep_elf_howto_table [r_type]; +} + +/* Look through the relocs for a section during the first phase. + Since we don't do .gots or .plts, we just need to consider the + virtual table relocs for gc. */ + +static bfd_boolean +mep_elf_check_relocs + (bfd * abfd, + struct bfd_link_info * info, + asection * sec, + const Elf_Internal_Rela * relocs) +{ + Elf_Internal_Shdr * symtab_hdr; + struct elf_link_hash_entry ** sym_hashes; + struct elf_link_hash_entry ** sym_hashes_end; + const Elf_Internal_Rela * rel; + const Elf_Internal_Rela * rel_end; + + if (info->relocatable) + return TRUE; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (abfd); + sym_hashes_end = sym_hashes + symtab_hdr->sh_size / sizeof (Elf32_External_Sym); + if (!elf_bad_symtab (abfd)) + sym_hashes_end -= symtab_hdr->sh_info; + + rel_end = relocs + sec->reloc_count; + for (rel = relocs; rel < rel_end; rel++) + { + struct elf_link_hash_entry *h; + unsigned long r_symndx; + + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx < symtab_hdr->sh_info) + h = NULL; + else + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + } + return TRUE; +} + + +/* Relocate a MEP ELF section. + There is some attempt to make this function usable for many architectures, + both USE_REL and USE_RELA ['twould be nice if such a critter existed], + if only to serve as a learning tool. + + The RELOCATE_SECTION function is called by the new ELF backend linker + to handle the relocations for a section. + + The relocs are always passed as Rela structures; if the section + actually uses Rel structures, the r_addend field will always be + zero. + + This function is responsible for adjusting the section contents as + necessary, and (if using Rela relocs and generating a relocatable + output file) adjusting the reloc addend as necessary. + + This function does not have to worry about setting the reloc + address or the reloc symbol index. + + LOCAL_SYMS is a pointer to the swapped in local symbols. + + LOCAL_SECTIONS is an array giving the section in the input file + corresponding to the st_shndx field of each local symbol. + + The global hash table entry for the global symbols can be found + via elf_sym_hashes (input_bfd). + + When generating relocatable output, this function must handle + STB_LOCAL/STT_SECTION symbols specially. The output symbol is + going to be the section symbol corresponding to the output + section, which means that the addend must be adjusted + accordingly. */ + +static bfd_boolean +mep_elf_relocate_section + (bfd * output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info * info, + bfd * input_bfd, + asection * input_section, + bfd_byte * contents, + Elf_Internal_Rela * relocs, + Elf_Internal_Sym * local_syms, + asection ** local_sections) +{ + Elf_Internal_Shdr * symtab_hdr; + struct elf_link_hash_entry ** sym_hashes; + Elf_Internal_Rela * rel; + Elf_Internal_Rela * relend; + + symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (input_bfd); + relend = relocs + input_section->reloc_count; + + mep_info = info; + + for (rel = relocs; rel < relend; rel ++) + { + reloc_howto_type * howto; + unsigned long r_symndx; + Elf_Internal_Sym * sym; + asection * sec; + struct elf_link_hash_entry * h; + bfd_vma relocation; + bfd_reloc_status_type r; + const char * name = NULL; + int r_type; + + r_type = ELF32_R_TYPE (rel->r_info); + + r_symndx = ELF32_R_SYM (rel->r_info); + + /* Is this a complex relocation? */ + if (!info->relocatable && ELF32_R_TYPE (rel->r_info) == R_RELC) + { + bfd_elf_perform_complex_relocation (output_bfd, info, + input_bfd, input_section, contents, + rel, local_syms, local_sections); + continue; + } + + howto = mep_elf_howto_table + ELF32_R_TYPE (rel->r_info); + h = NULL; + sym = NULL; + sec = NULL; + + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + sec = local_sections [r_symndx]; + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); + + name = bfd_elf_string_from_elf_section + (input_bfd, symtab_hdr->sh_link, sym->st_name); + name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name; +#if 0 + fprintf (stderr, "local: sec: %s, sym: %s (%d), value: %x + %x + %x addend %x\n", + sec->name, name, sym->st_name, + sec->output_section->vma, sec->output_offset, + sym->st_value, rel->r_addend); +#endif + } + else + { + relocation = 0; + h = sym_hashes [r_symndx]; + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + name = h->root.root.string; + + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + sec = h->root.u.def.section; + relocation = (h->root.u.def.value + + sec->output_section->vma + + sec->output_offset); +#if 0 + fprintf (stderr, + "defined: sec: %s, name: %s, value: %x + %x + %x gives: %x\n", + sec->name, name, h->root.u.def.value, + sec->output_section->vma, sec->output_offset, relocation); +#endif + } + else if (h->root.type == bfd_link_hash_undefweak) + { +#if 0 + fprintf (stderr, "undefined: sec: %s, name: %s\n", + sec->name, name); +#endif + } + else if (!info->relocatable) + { + if (! ((*info->callbacks->undefined_symbol) + (info, h->root.root.string, input_bfd, + input_section, rel->r_offset, + (!info->shared && info->unresolved_syms_in_objects == RM_GENERATE_ERROR)))) + return FALSE; +#if 0 + fprintf (stderr, "unknown: name: %s\n", name); +#endif + } + } + + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + { + /* This is a relocatable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + rel->r_addend += sec->output_offset; + continue; + } + + switch (r_type) + { + default: + r = mep_final_link_relocate (howto, input_bfd, input_section, + contents, rel, relocation); + break; + } + + if (r != bfd_reloc_ok) + { + const char * msg = (const char *) NULL; + + switch (r) + { + case bfd_reloc_overflow: + r = info->callbacks->reloc_overflow + (info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, + input_bfd, input_section, rel->r_offset); + break; + + case bfd_reloc_undefined: + r = info->callbacks->undefined_symbol + (info, name, input_bfd, input_section, rel->r_offset, TRUE); + break; + + case bfd_reloc_outofrange: + msg = _("internal error: out of range error"); + break; + + case bfd_reloc_notsupported: + msg = _("internal error: unsupported relocation error"); + break; + + case bfd_reloc_dangerous: + msg = _("internal error: dangerous relocation"); + break; + + default: + msg = _("internal error: unknown error"); + break; + } + + if (msg) + r = info->callbacks->warning + (info, msg, name, input_bfd, input_section, rel->r_offset); + + if (! r) + return FALSE; + } + } + + if (warn_tp) + info->callbacks->undefined_symbol + (info, "__tpbase", input_bfd, input_section, warn_tp-1, TRUE); + if (warn_sda) + info->callbacks->undefined_symbol + (info, "__sdabase", input_bfd, input_section, warn_sda-1, TRUE); + if (warn_sda || warn_tp) + return FALSE; + + return TRUE; +} + + +/* Update the got entry reference counts for the section being + removed. */ + +static bfd_boolean +mep_elf_gc_sweep_hook + (bfd * abfd ATTRIBUTE_UNUSED, + struct bfd_link_info * info ATTRIBUTE_UNUSED, + asection * sec ATTRIBUTE_UNUSED, + const Elf_Internal_Rela * relocs ATTRIBUTE_UNUSED) +{ + return TRUE; +} + +/* Return the section that should be marked against GC for a given + relocation. */ + +static asection * +mep_elf_gc_mark_hook + (asection * sec, + struct bfd_link_info * info ATTRIBUTE_UNUSED, + Elf_Internal_Rela * rel, + struct elf_link_hash_entry * h, + Elf_Internal_Sym * sym) +{ + if (h != NULL) + { + switch (ELF32_R_TYPE (rel->r_info)) + { + default: + switch (h->root.type) + { + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + return h->root.u.def.section; + + case bfd_link_hash_common: + return h->root.u.c.p->section; + + default: + break; + } + } + } + else + { + if (!(elf_bad_symtab (sec->owner) + && ELF_ST_BIND (sym->st_info) != STB_LOCAL) + && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE) + && sym->st_shndx != SHN_COMMON)) + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); + } + + return NULL; +} + + +/* Function to set the ELF flag bits. */ + +static bfd_boolean +mep_elf_set_private_flags (bfd * abfd, + flagword flags) +{ + elf_elfheader (abfd)->e_flags = flags; + elf_flags_init (abfd) = TRUE; + return TRUE; +} + +static bfd_boolean +mep_elf_copy_private_bfd_data (bfd * ibfd, bfd * obfd) +{ + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour + || bfd_get_flavour (obfd) != bfd_target_elf_flavour) + return TRUE; + + elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; + elf_flags_init (obfd) = TRUE; + + /* Copy object attributes. */ + _bfd_elf_copy_obj_attributes (ibfd, obfd); + + return TRUE; +} + +/* Merge backend specific data from an object file to the output + object file when linking. */ + +static bfd_boolean +mep_elf_merge_private_bfd_data (bfd * ibfd, bfd * obfd) +{ + static bfd *last_ibfd = 0; + flagword old_flags, new_flags; + flagword old_partial, new_partial; + + /* Check if we have the same endianess. */ + if (_bfd_generic_verify_endian_match (ibfd, obfd) == FALSE) + return FALSE; + + new_flags = elf_elfheader (ibfd)->e_flags; + old_flags = elf_elfheader (obfd)->e_flags; + +#ifdef DEBUG + _bfd_error_handler ("%B: old_flags = 0x%.8lx, new_flags = 0x%.8lx, init = %s", + ibfd, old_flags, new_flags, elf_flags_init (obfd) ? "yes" : "no"); +#endif + + /* First call, no flags set. */ + if (!elf_flags_init (obfd)) + { + elf_flags_init (obfd) = TRUE; + old_flags = new_flags; + } + else if ((new_flags | old_flags) & EF_MEP_LIBRARY) + { + /* Non-library flags trump library flags. The choice doesn't really + matter if both OLD_FLAGS and NEW_FLAGS have EF_MEP_LIBRARY set. */ + if (old_flags & EF_MEP_LIBRARY) + old_flags = new_flags; + } + else + { + /* Make sure they're for the same mach. Allow upgrade from the "mep" + mach. */ + new_partial = (new_flags & EF_MEP_CPU_MASK); + old_partial = (old_flags & EF_MEP_CPU_MASK); + if (new_partial == old_partial) + ; + else if (new_partial == EF_MEP_CPU_MEP) + ; + else if (old_partial == EF_MEP_CPU_MEP) + old_flags = (old_flags & ~EF_MEP_CPU_MASK) | new_partial; + else + { + _bfd_error_handler (_("%B and %B are for different cores"), last_ibfd, ibfd); + bfd_set_error (bfd_error_invalid_target); + return FALSE; + } + + /* Make sure they're for the same me_module. Allow basic config to + mix with any other. */ + new_partial = (new_flags & EF_MEP_INDEX_MASK); + old_partial = (old_flags & EF_MEP_INDEX_MASK); + if (new_partial == old_partial) + ; + else if (new_partial == 0) + ; + else if (old_partial == 0) + old_flags = (old_flags & ~EF_MEP_INDEX_MASK) | new_partial; + else + { + _bfd_error_handler (_("%B and %B are for different configurations"), last_ibfd, ibfd); + bfd_set_error (bfd_error_invalid_target); + return FALSE; + } + } + + elf_elfheader (obfd)->e_flags = old_flags; + last_ibfd = ibfd; + return TRUE; +} + +/* This will be edited by the MeP configration tool. */ +static const char * config_names[] = +{ + "basic" + /* start-mepcfgtool */ + ,"simple" + ,"fmax" + /* end-mepcfgtool */ +}; + +static const char * core_names[] = +{ + "MeP", "MeP-c2", "MeP-c3", "MeP-h1" +}; + +static bfd_boolean +mep_elf_print_private_bfd_data (bfd * abfd, void * ptr) +{ + FILE * file = (FILE *) ptr; + flagword flags, partial_flags; + + BFD_ASSERT (abfd != NULL && ptr != NULL); + + /* Print normal ELF private data. */ + _bfd_elf_print_private_bfd_data (abfd, ptr); + + flags = elf_elfheader (abfd)->e_flags; + fprintf (file, _("private flags = 0x%lx"), (long)flags); + + partial_flags = (flags & EF_MEP_CPU_MASK) >> 24; + if (partial_flags < ARRAY_SIZE (core_names)) + fprintf (file, " core: %s", core_names[(long)partial_flags]); + + partial_flags = flags & EF_MEP_INDEX_MASK; + if (partial_flags < ARRAY_SIZE (config_names)) + fprintf (file, " me_module: %s", config_names[(long)partial_flags]); + + fputc ('\n', file); + + return TRUE; +} + +/* Return the machine subcode from the ELF e_flags header. */ + +static int +elf32_mep_machine (bfd * abfd) +{ + switch (elf_elfheader (abfd)->e_flags & EF_MEP_CPU_MASK) + { + default: break; + case EF_MEP_CPU_C2: return bfd_mach_mep; + case EF_MEP_CPU_C3: return bfd_mach_mep; + case EF_MEP_CPU_C4: return bfd_mach_mep; + case EF_MEP_CPU_H1: return bfd_mach_mep_h1; + } + + return bfd_mach_mep; +} + +static bfd_boolean +mep_elf_object_p (bfd * abfd) +{ + /* Irix 5 and 6 is broken. Object file symbol tables are not always + sorted correctly such that local symbols preceed global symbols, + and the sh_info field in the symbol table is not always right. */ + /* This is needed for the RELC support code. */ + elf_bad_symtab (abfd) = TRUE; + bfd_default_set_arch_mach (abfd, bfd_arch_mep, elf32_mep_machine (abfd)); + return TRUE; +} + +static bfd_boolean +mep_elf_section_flags (flagword * flags, const Elf_Internal_Shdr * hdr) +{ + if (hdr->sh_flags & SHF_MEP_VLIW) + * flags |= SEC_MEP_VLIW; + return TRUE; +} + +static bfd_boolean +mep_elf_fake_sections (bfd * abfd ATTRIBUTE_UNUSED, + Elf_Internal_Shdr * hdr, + asection * sec) +{ + if (sec->flags & SEC_MEP_VLIW) + hdr->sh_flags |= SHF_MEP_VLIW; + return TRUE; +} + + +#define ELF_ARCH bfd_arch_mep +#define ELF_MACHINE_CODE EM_CYGNUS_MEP +#define ELF_MAXPAGESIZE 0x1000 + +#define TARGET_BIG_SYM bfd_elf32_mep_vec +#define TARGET_BIG_NAME "elf32-mep" + +#define TARGET_LITTLE_SYM bfd_elf32_mep_little_vec +#define TARGET_LITTLE_NAME "elf32-mep-little" + +#define elf_info_to_howto_rel NULL +#define elf_info_to_howto mep_info_to_howto_rela +#define elf_backend_relocate_section mep_elf_relocate_section +#define elf_backend_gc_mark_hook mep_elf_gc_mark_hook +#define elf_backend_gc_sweep_hook mep_elf_gc_sweep_hook +#define elf_backend_check_relocs mep_elf_check_relocs +#define elf_backend_object_p mep_elf_object_p +#define elf_backend_section_flags mep_elf_section_flags +#define elf_backend_fake_sections mep_elf_fake_sections + +#define elf_backend_can_gc_sections 1 + +#define bfd_elf32_bfd_reloc_type_lookup mep_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup mep_reloc_name_lookup +#define bfd_elf32_bfd_set_private_flags mep_elf_set_private_flags +#define bfd_elf32_bfd_copy_private_bfd_data mep_elf_copy_private_bfd_data +#define bfd_elf32_bfd_merge_private_bfd_data mep_elf_merge_private_bfd_data +#define bfd_elf32_bfd_print_private_bfd_data mep_elf_print_private_bfd_data + +/* We use only the RELA entries. */ +#define USE_RELA + +#include "elf32-target.h" diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c index 6ed4ad35f62..3843b856e16 100644 --- a/bfd/elf32-mips.c +++ b/bfd/elf32-mips.c @@ -1,6 +1,6 @@ /* MIPS-specific support for 32-bit ELF Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Most of the information added by Ian Lance Taylor, Cygnus Support, . @@ -29,8 +29,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. different MIPS ELF from other targets. This matters when linking. This file supports both, switching at runtime. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" #include "genlink.h" @@ -68,8 +68,6 @@ static bfd_boolean mips_elf32_object_p (bfd *); static bfd_boolean mips_elf_is_local_label_name (bfd *, const char *); -static bfd_reloc_status_type mips16_jump_reloc - (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips16_gprel_reloc (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips_elf_final_gp @@ -702,6 +700,21 @@ static reloc_howto_type elf_mips_howto_table_rel[] = 0x0000ffff, /* src_mask */ 0x0000ffff, /* dst_mask */ FALSE), /* pcrel_offset */ + + /* 32 bit relocation with no addend. */ + HOWTO (R_MIPS_GLOB_DAT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GLOB_DAT", /* name */ + FALSE, /* partial_inplace */ + 0x0, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ }; /* The reloc used for BFD_RELOC_CTOR when doing a 64 bit link. This @@ -734,7 +747,7 @@ static reloc_howto_type elf_mips16_howto_table_rel[] = /* This needs complex overflow detection, because the upper four bits must match the PC. */ - mips16_jump_reloc, /* special_function */ + _bfd_mips_elf_generic_reloc, /* special_function */ "R_MIPS16_26", /* name */ TRUE, /* partial_inplace */ 0x3ffffff, /* src_mask */ @@ -1112,36 +1125,6 @@ mips32_64bit_reloc (bfd *abfd, arelent *reloc_entry, return r; } -/* Handle a mips16 jump. */ - -static bfd_reloc_status_type -mips16_jump_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry, - asymbol *symbol, void *data ATTRIBUTE_UNUSED, - asection *input_section, bfd *output_bfd, - char **error_message ATTRIBUTE_UNUSED) -{ - if (output_bfd != NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - /* FIXME. */ - { - static bfd_boolean warned; - - if (! warned) - (*_bfd_error_handler) - (_("Linking mips16 objects into %s format is not supported"), - bfd_get_target (input_section->output_section->owner)); - warned = TRUE; - } - - return bfd_reloc_undefined; -} - /* Handle a mips16 GP relative reloc. */ static bfd_reloc_status_type @@ -1291,6 +1274,40 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) } } +static reloc_howto_type * +bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (elf_mips_howto_table_rel) + / sizeof (elf_mips_howto_table_rel[0])); + i++) + if (elf_mips_howto_table_rel[i].name != NULL + && strcasecmp (elf_mips_howto_table_rel[i].name, r_name) == 0) + return &elf_mips_howto_table_rel[i]; + + for (i = 0; + i < (sizeof (elf_mips16_howto_table_rel) + / sizeof (elf_mips16_howto_table_rel[0])); + i++) + if (elf_mips16_howto_table_rel[i].name != NULL + && strcasecmp (elf_mips16_howto_table_rel[i].name, r_name) == 0) + return &elf_mips16_howto_table_rel[i]; + + if (strcasecmp (elf_mips_gnu_pcrel32.name, r_name) == 0) + return &elf_mips_gnu_pcrel32; + if (strcasecmp (elf_mips_gnu_rel16_s2.name, r_name) == 0) + return &elf_mips_gnu_rel16_s2; + if (strcasecmp (elf_mips_gnu_vtinherit_howto.name, r_name) == 0) + return &elf_mips_gnu_vtinherit_howto; + if (strcasecmp (elf_mips_gnu_vtentry_howto.name, r_name) == 0) + return &elf_mips_gnu_vtentry_howto; + + return NULL; +} + /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure. */ static reloc_howto_type * @@ -1537,12 +1554,15 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { #define elf_backend_create_dynamic_sections \ _bfd_mips_elf_create_dynamic_sections #define elf_backend_check_relocs _bfd_mips_elf_check_relocs +#define elf_backend_merge_symbol_attribute \ + _bfd_mips_elf_merge_symbol_attribute #define elf_backend_adjust_dynamic_symbol \ _bfd_mips_elf_adjust_dynamic_symbol #define elf_backend_always_size_sections \ _bfd_mips_elf_always_size_sections #define elf_backend_size_dynamic_sections \ _bfd_mips_elf_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_relocate_section _bfd_mips_elf_relocate_section #define elf_backend_finish_dynamic_symbol \ _bfd_mips_elf_finish_dynamic_symbol @@ -1599,6 +1619,7 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { /* The SVR4 MIPS ABI says that this should be 0x10000, but Irix 5 uses a value of 0x1000, and we are compatible. */ #define ELF_MAXPAGESIZE 0x1000 +#define ELF_COMMONPAGESIZE 0x1000 #include "elf32-target.h" @@ -1609,15 +1630,20 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { #undef TARGET_BIG_NAME #undef ELF_MAXPAGESIZE +#undef ELF_COMMONPAGESIZE #define TARGET_LITTLE_SYM bfd_elf32_tradlittlemips_vec #define TARGET_LITTLE_NAME "elf32-tradlittlemips" #define TARGET_BIG_SYM bfd_elf32_tradbigmips_vec #define TARGET_BIG_NAME "elf32-tradbigmips" -/* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses - page sizes of up to that limit, so we need to respect it. */ +/* The MIPS ABI says at Page 5-1: + Virtual addresses and file offsets for MIPS segments are congruent + modulo 64 KByte (0x10000) or larger powers of 2. Because 64 KBytes + is the maximum page size, the files are suitable for paging + regardless of physical page size. */ #define ELF_MAXPAGESIZE 0x10000 +#define ELF_COMMONPAGESIZE 0x1000 #define elf32_bed elf32_tradbed /* Include the target file again for this target. */ @@ -1672,6 +1698,17 @@ mips_vxworks_bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) } } +static reloc_howto_type * +mips_vxworks_bfd_reloc_name_lookup (bfd *abfd, const char *r_name) +{ + if (strcasecmp (mips_vxworks_copy_howto_rela.name, r_name) == 0) + return &mips_vxworks_copy_howto_rela; + if (strcasecmp (mips_vxworks_jump_slot_howto_rela.name, r_name) == 0) + return &mips_vxworks_jump_slot_howto_rela; + + return bfd_elf32_bfd_reloc_name_lookup (abfd, r_name); +} + /* Implement elf_backend_mips_rtype_to_lookup for VxWorks. */ static reloc_howto_type * @@ -1702,6 +1739,9 @@ mips_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker) #undef TARGET_BIG_SYM #undef TARGET_BIG_NAME +#undef ELF_MAXPAGESIZE +#undef ELF_COMMONPAGESIZE + #define TARGET_LITTLE_SYM bfd_elf32_littlemips_vxworks_vec #define TARGET_LITTLE_NAME "elf32-littlemips-vxworks" #define TARGET_BIG_SYM bfd_elf32_bigmips_vxworks_vec @@ -1710,8 +1750,8 @@ mips_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker) #undef elf32_bed #define elf32_bed elf32_mips_vxworks_bed -#undef ELF_MAXPAGESIZE #define ELF_MAXPAGESIZE 0x1000 +#define ELF_COMMONPAGESIZE 0x1000 #undef elf_backend_want_got_plt #define elf_backend_want_got_plt 1 @@ -1735,6 +1775,9 @@ mips_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker) #undef bfd_elf32_bfd_reloc_type_lookup #define bfd_elf32_bfd_reloc_type_lookup \ mips_vxworks_bfd_reloc_type_lookup +#undef bfd_elf32_bfd_reloc_name_lookup +#define bfd_elf32_bfd_reloc_name_lookup \ + mips_vxworks_bfd_reloc_name_lookup #undef elf_backend_mips_rtype_to_howto #define elf_backend_mips_rtype_to_howto \ mips_vxworks_rtype_to_howto diff --git a/bfd/elf32-msp430.c b/bfd/elf32-msp430.c index af737714de2..bd576c3be89 100644 --- a/bfd/elf32-msp430.c +++ b/bfd/elf32-msp430.c @@ -1,5 +1,6 @@ /* MSP430-specific support for 32-bit ELF - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Contributed by Dmitry Diky This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +19,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libiberty.h" #include "libbfd.h" #include "elf-bfd.h" @@ -199,6 +200,23 @@ bfd_elf32_bfd_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (elf_msp430_howto_table) + / sizeof (elf_msp430_howto_table[0])); + i++) + if (elf_msp430_howto_table[i].name != NULL + && strcasecmp (elf_msp430_howto_table[i].name, r_name) == 0) + return &elf_msp430_howto_table[i]; + + return NULL; +} + /* Set the howto pointer for an MSP430 ELF reloc. */ static void @@ -213,48 +231,6 @@ msp430_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, cache_ptr->howto = &elf_msp430_howto_table[r_type]; } -static asection * -elf32_msp430_gc_mark_hook (asection * sec, - struct bfd_link_info * info ATTRIBUTE_UNUSED, - Elf_Internal_Rela * rel, - struct elf_link_hash_entry * h, - Elf_Internal_Sym * sym) -{ - if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; -} - -static bfd_boolean -elf32_msp430_gc_sweep_hook (bfd * abfd ATTRIBUTE_UNUSED, - struct bfd_link_info * info ATTRIBUTE_UNUSED, - asection * sec ATTRIBUTE_UNUSED, - const Elf_Internal_Rela * relocs ATTRIBUTE_UNUSED) -{ - /* We don't use got and plt entries for msp430. */ - return TRUE; -} - /* Look through the relocs for a section during the first phase. Since we don't do .gots or .plts, we just need to consider the virtual table relocs for gc. */ @@ -454,8 +430,6 @@ elf32_msp430_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, const char *name = NULL; int r_type; - /* This is a final link. */ - r_type = ELF32_R_TYPE (rel->r_info); r_symndx = ELF32_R_SYM (rel->r_info); howto = elf_msp430_howto_table + ELF32_R_TYPE (rel->r_info); @@ -483,6 +457,20 @@ elf32_msp430_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, unresolved_reloc, warned); } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + r = msp430_final_link_relocate (howto, input_bfd, input_section, contents, rel, relocation); @@ -685,21 +673,6 @@ elf32_msp430_object_p (bfd * abfd) return bfd_default_set_arch_mach (abfd, bfd_arch_msp430, e_set); } -static void -elf32_msp430_post_process_headers (bfd * abfd, - struct bfd_link_info * link_info ATTRIBUTE_UNUSED) -{ - Elf_Internal_Ehdr * i_ehdrp; /* ELF file header, internal form. */ - - i_ehdrp = elf_elfheader (abfd); - -#ifndef ELFOSABI_STANDALONE -#define ELFOSABI_STANDALONE 255 -#endif - - i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_STANDALONE; -} - /* These functions handle relaxing for the msp430. Relaxation required only in two cases: - Bad hand coding like jumps from one section to another or @@ -1203,6 +1176,7 @@ error_return: #define ELF_MACHINE_CODE EM_MSP430 #define ELF_MACHINE_ALT1 EM_MSP430_OLD #define ELF_MAXPAGESIZE 1 +#define ELF_OSABI ELFOSABI_STANDALONE #define TARGET_LITTLE_SYM bfd_elf32_msp430_vec #define TARGET_LITTLE_NAME "elf32-msp430" @@ -1210,13 +1184,11 @@ error_return: #define elf_info_to_howto msp430_info_to_howto_rela #define elf_info_to_howto_rel NULL #define elf_backend_relocate_section elf32_msp430_relocate_section -#define elf_backend_gc_mark_hook elf32_msp430_gc_mark_hook -#define elf_backend_gc_sweep_hook elf32_msp430_gc_sweep_hook #define elf_backend_check_relocs elf32_msp430_check_relocs #define elf_backend_can_gc_sections 1 #define elf_backend_final_write_processing bfd_elf_msp430_final_write_processing #define elf_backend_object_p elf32_msp430_object_p -#define elf_backend_post_process_headers elf32_msp430_post_process_headers +#define elf_backend_post_process_headers _bfd_elf_set_osabi #define bfd_elf32_bfd_relax_section msp430_elf_relax_section #include "elf32-target.h" diff --git a/bfd/elf32-mt.c b/bfd/elf32-mt.c index 320ef1e3415..a1d86523b83 100644 --- a/bfd/elf32-mt.c +++ b/bfd/elf32-mt.c @@ -1,5 +1,5 @@ /* Morpho Technologies MT specific support for 32-bit ELF - Copyright 2001, 2002, 2003, 2004, 2005 + Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/mt.h" @@ -187,6 +187,22 @@ mt_reloc_type_lookup return NULL; } +static reloc_howto_type * +mt_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (mt_elf_howto_table) / sizeof (mt_elf_howto_table[0]); + i++) + if (mt_elf_howto_table[i].name != NULL + && strcasecmp (mt_elf_howto_table[i].name, r_name) == 0) + return &mt_elf_howto_table[i]; + + return NULL; +} + bfd_reloc_status_type mt_elf_relocate_hi16 (bfd * input_bfd, @@ -309,7 +325,6 @@ mt_elf_relocate_section r_symndx = ELF32_R_SYM (rel->r_info); - /* This is a final link. */ howto = mt_elf_howto_table + ELF32_R_TYPE (rel->r_info); h = NULL; sym = NULL; @@ -338,6 +353,19 @@ mt_elf_relocate_section name = h->root.root.string; } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; /* Finally, the sole MT-specific part. */ switch (r_type) @@ -394,57 +422,6 @@ mt_elf_relocate_section return TRUE; } -/* Return the section that should be marked against GC for a given - relocation. */ - -static asection * -mt_elf_gc_mark_hook - (asection * sec, - struct bfd_link_info * info ATTRIBUTE_UNUSED, - Elf_Internal_Rela * rel ATTRIBUTE_UNUSED, - struct elf_link_hash_entry * h, - Elf_Internal_Sym * sym) -{ - if (h != NULL) - { - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - else - { - if (!(elf_bad_symtab (sec->owner) - && ELF_ST_BIND (sym->st_info) != STB_LOCAL) - && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE) - && sym->st_shndx != SHN_COMMON)) - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - } - - return NULL; -} - -/* Update the got entry reference counts for the section being - removed. */ - -static bfd_boolean -mt_elf_gc_sweep_hook - (bfd * abfd ATTRIBUTE_UNUSED, - struct bfd_link_info * info ATTRIBUTE_UNUSED, - asection * sec ATTRIBUTE_UNUSED, - const Elf_Internal_Rela * relocs ATTRIBUTE_UNUSED) -{ - return TRUE; -} - /* Look through the relocs for a section during the first phase. Since we don't do .gots or .plts, we just need to consider the virtual table relocs for gc. */ @@ -538,6 +515,10 @@ mt_elf_copy_private_bfd_data (bfd * ibfd, bfd * obfd) elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; elf_flags_init (obfd) = TRUE; + + /* Copy object attributes. */ + _bfd_elf_copy_obj_attributes (ibfd, obfd); + return TRUE; } @@ -631,9 +612,8 @@ mt_elf_print_private_bfd_data (bfd * abfd, void * ptr) #define elf_backend_relocate_section mt_elf_relocate_section #define bfd_elf32_bfd_reloc_type_lookup mt_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup mt_reloc_name_lookup -#define elf_backend_gc_mark_hook mt_elf_gc_mark_hook -#define elf_backend_gc_sweep_hook mt_elf_gc_sweep_hook #define elf_backend_check_relocs mt_elf_check_relocs #define elf_backend_object_p mt_elf_object_p #define elf_backend_rela_normal 1 diff --git a/bfd/elf32-openrisc.c b/bfd/elf32-openrisc.c index b3d67bb82cf..f0b780b0591 100644 --- a/bfd/elf32-openrisc.c +++ b/bfd/elf32-openrisc.c @@ -1,5 +1,6 @@ /* OpenRISC-specific support for 32-bit ELF. - Copyright 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Contributed by Johan Rydberg, jrydberg@opencores.org This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +20,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/openrisc.h" @@ -191,9 +192,9 @@ static const struct openrisc_reloc_map openrisc_reloc_map[] = { BFD_RELOC_32, R_OPENRISC_32 }, { BFD_RELOC_16, R_OPENRISC_16 }, { BFD_RELOC_8, R_OPENRISC_8 }, - { BFD_RELOC_OPENRISC_REL_26,R_OPENRISC_INSN_REL_26 }, - { BFD_RELOC_OPENRISC_ABS_26,R_OPENRISC_INSN_ABS_26 }, - { BFD_RELOC_HI16, R_OPENRISC_HI_16_IN_INSN }, + { BFD_RELOC_OPENRISC_REL_26, R_OPENRISC_INSN_REL_26 }, + { BFD_RELOC_OPENRISC_ABS_26, R_OPENRISC_INSN_ABS_26 }, + { BFD_RELOC_HI16, R_OPENRISC_HI_16_IN_INSN }, { BFD_RELOC_LO16, R_OPENRISC_LO_16_IN_INSN }, { BFD_RELOC_VTABLE_INHERIT, R_OPENRISC_GNU_VTINHERIT }, { BFD_RELOC_VTABLE_ENTRY, R_OPENRISC_GNU_VTENTRY } @@ -213,6 +214,23 @@ openrisc_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +openrisc_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (openrisc_elf_howto_table) + / sizeof (openrisc_elf_howto_table[0])); + i++) + if (openrisc_elf_howto_table[i].name != NULL + && strcasecmp (openrisc_elf_howto_table[i].name, r_name) == 0) + return &openrisc_elf_howto_table[i]; + + return NULL; +} + /* Set the howto pointer for an OpenRISC ELF reloc. */ static void @@ -303,9 +321,6 @@ openrisc_elf_relocate_section (bfd *output_bfd, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocatable) - return TRUE; - symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); relend = relocs + input_section->reloc_count; @@ -333,7 +348,6 @@ openrisc_elf_relocate_section (bfd *output_bfd, (sizeof openrisc_elf_howto_table / sizeof (reloc_howto_type))) abort (); - /* This is a final link. */ howto = openrisc_elf_howto_table + ELF32_R_TYPE (rel->r_info); h = NULL; sym = NULL; @@ -359,6 +373,20 @@ openrisc_elf_relocate_section (bfd *output_bfd, unresolved_reloc, warned); } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + r = openrisc_final_link_relocate (howto, input_bfd, input_section, contents, rel, relocation); @@ -413,47 +441,20 @@ openrisc_elf_relocate_section (bfd *output_bfd, static asection * openrisc_elf_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, + struct bfd_link_info *info, Elf_Internal_Rela *rel, struct elf_link_hash_entry *h, Elf_Internal_Sym *sym) { - if (h == NULL) - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); + if (h != NULL) + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_OPENRISC_GNU_VTINHERIT: + case R_OPENRISC_GNU_VTENTRY: + return NULL; + } - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_OPENRISC_GNU_VTINHERIT: - case R_OPENRISC_GNU_VTENTRY: - break; - - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - - return NULL; -} - -/* Update the got entry reference counts for the section being removed. */ - -static bfd_boolean -openrisc_elf_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED, - struct bfd_link_info *info ATTRIBUTE_UNUSED, - asection *sec ATTRIBUTE_UNUSED, - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED) -{ - return TRUE; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Look through the relocs for a section during the first phase. @@ -560,13 +561,13 @@ openrisc_elf_final_write_processing (bfd *abfd, #define elf_info_to_howto openrisc_info_to_howto_rela #define elf_backend_relocate_section openrisc_elf_relocate_section #define elf_backend_gc_mark_hook openrisc_elf_gc_mark_hook -#define elf_backend_gc_sweep_hook openrisc_elf_gc_sweep_hook #define elf_backend_check_relocs openrisc_elf_check_relocs #define elf_backend_can_gc_sections 1 #define elf_backend_rela_normal 1 #define bfd_elf32_bfd_reloc_type_lookup openrisc_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup openrisc_reloc_name_lookup #define elf_backend_object_p openrisc_elf_object_p #define elf_backend_final_write_processing openrisc_elf_final_write_processing diff --git a/bfd/elf32-or32.c b/bfd/elf32-or32.c index 546aa151f5c..598c8c5e570 100644 --- a/bfd/elf32-or32.c +++ b/bfd/elf32-or32.c @@ -1,5 +1,5 @@ /* OR32-specific support for 32-bit ELF - Copyright 2002, 2004, 2005 Free Software Foundation, Inc. + Copyright 2002, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Ivan Guzvinec This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/or32.h" @@ -466,6 +466,22 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (elf_or32_howto_table) / sizeof (elf_or32_howto_table[0]); + i++) + if (elf_or32_howto_table[i].name != NULL + && strcasecmp (elf_or32_howto_table[i].name, r_name) == 0) + return &elf_or32_howto_table[i]; + + return NULL; +} + /* Set the howto pointer for an OR32 ELF reloc. */ static void diff --git a/bfd/elf32-pj.c b/bfd/elf32-pj.c index bd0a5b49ffa..6b2f1de70b9 100644 --- a/bfd/elf32-pj.c +++ b/bfd/elf32-pj.c @@ -1,5 +1,6 @@ /* picoJava specific support for 32-bit ELF - Copyright 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2005, 2007 + Free Software Foundation, Inc. Contributed by Steve Chamberlan of Transmeta (sac@pobox.com). This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +19,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -291,6 +292,22 @@ pj_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +pj_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (pj_elf_howto_table) / sizeof (pj_elf_howto_table[0]); + i++) + if (pj_elf_howto_table[i].name != NULL + && strcasecmp (pj_elf_howto_table[i].name, r_name) == 0) + return &pj_elf_howto_table[i]; + + return NULL; +} + /* Given an ELF reloc, fill in the howto field of a relent. */ static void @@ -326,8 +343,10 @@ pj_elf_final_write_processing (bfd *abfd, #define ELF_MACHINE_CODE EM_PJ #define ELF_MACHINE_ALT1 EM_PJ_OLD #define ELF_MAXPAGESIZE 0x1000 -#define bfd_elf32_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents -#define bfd_elf32_bfd_reloc_type_lookup pj_elf_reloc_type_lookup -#define elf_backend_final_write_processing pj_elf_final_write_processing -#define elf_info_to_howto pj_elf_info_to_howto +#define bfd_elf32_bfd_get_relocated_section_contents \ + bfd_generic_get_relocated_section_contents +#define bfd_elf32_bfd_reloc_type_lookup pj_elf_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup pj_elf_reloc_name_lookup +#define elf_backend_final_write_processing pj_elf_final_write_processing +#define elf_info_to_howto pj_elf_info_to_howto #include "elf32-target.h" diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 53d1046bb8c..d67ad866a6f 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -1,6 +1,6 @@ /* PowerPC-specific support for 32-bit ELF Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -25,8 +25,9 @@ suggestions from the in-progress Embedded PowerPC ABI, and that information may also not match. */ -#include "bfd.h" #include "sysdep.h" +#include +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -1577,6 +1578,22 @@ ppc_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return ppc_elf_howto_table[r]; }; +static reloc_howto_type * +ppc_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (ppc_elf_howto_raw) / sizeof (ppc_elf_howto_raw[0]); + i++) + if (ppc_elf_howto_raw[i].name != NULL + && strcasecmp (ppc_elf_howto_raw[i].name, r_name) == 0) + return &ppc_elf_howto_raw[i]; + + return NULL; +} + /* Set the howto pointer for a PowerPC ELF reloc. */ static void @@ -1590,6 +1607,17 @@ ppc_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, BFD_ASSERT (ELF32_R_TYPE (dst->r_info) < (unsigned int) R_PPC_max); cache_ptr->howto = ppc_elf_howto_table[ELF32_R_TYPE (dst->r_info)]; + + /* Just because the above assert didn't trigger doesn't mean that + ELF32_R_TYPE (dst->r_info) is necessarily a valid relocation. */ + if (!cache_ptr->howto) + { + (*_bfd_error_handler) (_("%B: invalid relocation type %d"), + abfd, ELF32_R_TYPE (dst->r_info)); + bfd_set_error (bfd_error_bad_value); + + cache_ptr->howto = ppc_elf_howto_table[R_PPC_NONE]; + } } /* Handle the R_PPC_ADDR16_HA and R_PPC_REL16_HA relocs. */ @@ -1695,6 +1723,10 @@ struct ppc_elf_obj_tdata /* A mapping from local symbols to offsets into the various linker sections added. This is index by the symbol index. */ elf_linker_section_pointers_t **linker_section_pointers; + + /* Flags used to auto-detect plt type. */ + unsigned int makes_plt_call : 1; + unsigned int has_rel16 : 1; }; #define ppc_elf_tdata(bfd) \ @@ -1708,11 +1740,14 @@ struct ppc_elf_obj_tdata static bfd_boolean ppc_elf_mkobject (bfd *abfd) { - bfd_size_type amt = sizeof (struct ppc_elf_obj_tdata); - abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) - return FALSE; - return TRUE; + { + bfd_size_type amt = sizeof (struct ppc_elf_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + } + return bfd_elf_mkobject (abfd); } /* Fix bad default arch selected for a 32 bit input bfd when the @@ -1810,6 +1845,52 @@ ppc_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) return TRUE; } +static char * +ppc_elf_write_core_note (bfd *abfd, char *buf, int *bufsiz, int note_type, ...) +{ + switch (note_type) + { + default: + return NULL; + + case NT_PRPSINFO: + { + char data[128]; + va_list ap; + + va_start (ap, note_type); + memset (data, 0, 32); + strncpy (data + 32, va_arg (ap, const char *), 16); + strncpy (data + 48, va_arg (ap, const char *), 80); + va_end (ap); + return elfcore_write_note (abfd, buf, bufsiz, + "CORE", note_type, data, sizeof (data)); + } + + case NT_PRSTATUS: + { + char data[268]; + va_list ap; + long pid; + int cursig; + const void *greg; + + va_start (ap, note_type); + memset (data, 0, 72); + pid = va_arg (ap, long); + bfd_put_32 (abfd, pid, data + 24); + cursig = va_arg (ap, int); + bfd_put_16 (abfd, cursig, data + 12); + greg = va_arg (ap, const void *); + memcpy (data + 72, greg, 192); + memset (data + 264, 0, 4); + va_end (ap); + return elfcore_write_note (abfd, buf, bufsiz, + "CORE", note_type, data, sizeof (data)); + } + } +} + /* Return address for Ith PLT stub in section PLT, for relocation REL or (bfd_vma) -1 if it should not be included. */ @@ -1869,7 +1950,8 @@ ppc_elf_fake_sections (bfd *abfd ATTRIBUTE_UNUSED, need to bump up the number of section headers. */ static int -ppc_elf_additional_program_headers (bfd *abfd) +ppc_elf_additional_program_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { asection *s; int ret = 0; @@ -1892,21 +1974,21 @@ ppc_elf_additional_program_headers (bfd *abfd) static const struct bfd_elf_special_section ppc_elf_special_sections[] = { - { ".plt", 4, 0, SHT_NOBITS, SHF_ALLOC + SHF_EXECINSTR }, - { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, - { ".sbss2", 6, -2, SHT_PROGBITS, SHF_ALLOC }, - { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".sdata2", 7, -2, SHT_PROGBITS, SHF_ALLOC }, - { ".tags", 5, 0, SHT_ORDERED, SHF_ALLOC }, - { ".PPC.EMB.apuinfo", 16, 0, SHT_NOTE, 0 }, - { ".PPC.EMB.sbss0", 14, 0, SHT_PROGBITS, SHF_ALLOC }, - { ".PPC.EMB.sdata0", 15, 0, SHT_PROGBITS, SHF_ALLOC }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".plt"), 0, SHT_NOBITS, SHF_ALLOC + SHF_EXECINSTR }, + { STRING_COMMA_LEN (".sbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".sbss2"), -2, SHT_PROGBITS, SHF_ALLOC }, + { STRING_COMMA_LEN (".sdata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".sdata2"), -2, SHT_PROGBITS, SHF_ALLOC }, + { STRING_COMMA_LEN (".tags"), 0, SHT_ORDERED, SHF_ALLOC }, + { STRING_COMMA_LEN (".PPC.EMB.apuinfo"), 0, SHT_NOTE, 0 }, + { STRING_COMMA_LEN (".PPC.EMB.sbss0"), 0, SHT_PROGBITS, SHF_ALLOC }, + { STRING_COMMA_LEN (".PPC.EMB.sdata0"), 0, SHT_PROGBITS, SHF_ALLOC }, + { NULL, 0, 0, 0, 0 } }; /* This is what we want for new plt/got. */ static struct bfd_elf_special_section ppc_alt_plt = - { ".plt", 4, 0, SHT_PROGBITS, SHF_ALLOC }; + { STRING_COMMA_LEN (".plt"), 0, SHT_PROGBITS, SHF_ALLOC }; static const struct bfd_elf_special_section * ppc_elf_get_sec_type_attr (bfd *abfd ATTRIBUTE_UNUSED, asection *sec) @@ -2147,6 +2229,7 @@ ppc_elf_begin_write_processing (bfd *abfd, struct bfd_link_info *link_info) static bfd_boolean ppc_elf_write_section (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *link_info ATTRIBUTE_UNUSED, asection *asec, bfd_byte *contents ATTRIBUTE_UNUSED) { @@ -2313,13 +2396,6 @@ struct ppc_elf_link_hash_entry #define ppc_elf_hash_entry(ent) ((struct ppc_elf_link_hash_entry *) (ent)) -enum ppc_elf_plt_type { - PLT_UNSET, - PLT_OLD, - PLT_NEW, - PLT_VXWORKS -}; - /* PPC ELF linker hash table. */ struct ppc_elf_link_hash_table @@ -2339,9 +2415,18 @@ struct ppc_elf_link_hash_table elf_linker_section_t sdata[2]; asection *sbss; + /* The (unloaded but important) .rela.plt.unloaded on VxWorks. */ + asection *srelplt2; + + /* The .got.plt section (VxWorks only)*/ + asection *sgotplt; + /* Shortcut to .__tls_get_addr. */ struct elf_link_hash_entry *tls_get_addr; + /* The bfd that forced an old-style PLT. */ + bfd *old_bfd; + /* TLS local dynamic got entry handling. */ union { bfd_signed_vma refcount; @@ -2359,23 +2444,11 @@ struct ppc_elf_link_hash_table /* The type of PLT we have chosen to use. */ enum ppc_elf_plt_type plt_type; - /* Whether we can use the new PLT layout. */ - unsigned int can_use_new_plt:1; - /* Set if we should emit symbols for stubs. */ unsigned int emit_stub_syms:1; - /* Small local sym to section mapping cache. */ - struct sym_sec_cache sym_sec; - - /* The (unloaded but important) .rela.plt.unloaded on VxWorks. */ - asection *srelplt2; - - /* The .got.plt section (VxWorks only)*/ - asection *sgotplt; - /* True if the target system is VxWorks. */ - int is_vxworks; + unsigned int is_vxworks:1; /* The size of PLT entries. */ int plt_entry_size; @@ -2383,6 +2456,9 @@ struct ppc_elf_link_hash_table int plt_slot_size; /* The size of the first PLT entry. */ int plt_initial_entry_size; + + /* Small local sym to section mapping cache. */ + struct sym_sec_cache sym_sec; }; /* Get the PPC ELF linker hash table from a link_info structure. */ @@ -2454,8 +2530,6 @@ ppc_elf_link_hash_table_create (bfd *abfd) ret->plt_entry_size = 12; ret->plt_slot_size = 8; ret->plt_initial_entry_size = 72; - - ret->is_vxworks = 0; return &ret->elf.root; } @@ -3225,8 +3299,13 @@ ppc_elf_check_relocs (bfd *abfd, } else { - bfd_vma addend = r_type == R_PPC_PLTREL24 ? rel->r_addend : 0; + bfd_vma addend = 0; + if (r_type == R_PPC_PLTREL24) + { + ppc_elf_tdata (abfd)->makes_plt_call = 1; + addend = rel->r_addend; + } h->needs_plt = 1; if (!update_plt_info (abfd, h, got2, addend)) return FALSE; @@ -3251,7 +3330,7 @@ ppc_elf_check_relocs (bfd *abfd, case R_PPC_REL16_LO: case R_PPC_REL16_HI: case R_PPC_REL16_HA: - htab->can_use_new_plt = 1; + ppc_elf_tdata (abfd)->has_rel16 = 1; break; /* These are just markers. */ @@ -3280,7 +3359,10 @@ ppc_elf_check_relocs (bfd *abfd, /* This refers only to functions defined in the shared library. */ case R_PPC_LOCAL24PC: if (h && h == htab->elf.hgot && htab->plt_type == PLT_UNSET) - htab->plt_type = PLT_OLD; + { + htab->plt_type = PLT_OLD; + htab->old_bfd = abfd; + } break; /* This relocation describes the C++ object vtable hierarchy. @@ -3334,7 +3416,10 @@ ppc_elf_check_relocs (bfd *abfd, s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, sec, r_symndx); if (s == got2) - htab->plt_type = PLT_OLD; + { + htab->plt_type = PLT_OLD; + htab->old_bfd = abfd; + } } if (h == NULL || h == htab->elf.hgot) break; @@ -3349,7 +3434,10 @@ ppc_elf_check_relocs (bfd *abfd, if (h == htab->elf.hgot) { if (htab->plt_type == PLT_UNSET) - htab->plt_type = PLT_OLD; + { + htab->plt_type = PLT_OLD; + htab->old_bfd = abfd; + } break; } /* fall through */ @@ -3432,7 +3520,7 @@ ppc_elf_check_relocs (bfd *abfd, if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (abfd, sec), name + 5) == 0); @@ -3506,6 +3594,62 @@ ppc_elf_check_relocs (bfd *abfd, return TRUE; } + +/* Merge object attributes from IBFD into OBFD. Raise an error if + there are conflicting attributes. */ +static bfd_boolean +ppc_elf_merge_obj_attributes (bfd *ibfd, bfd *obfd) +{ + obj_attribute *in_attr; + obj_attribute *out_attr; + + if (!elf_known_obj_attributes_proc (obfd)[0].i) + { + /* This is the first object. Copy the attributes. */ + _bfd_elf_copy_obj_attributes (ibfd, obfd); + + /* Use the Tag_null value to indicate the attributes have been + initialized. */ + elf_known_obj_attributes_proc (obfd)[0].i = 1; + + return TRUE; + } + + /* Check for conflicting Tag_GNU_Power_ABI_FP attributes and merge + non-conflicting ones. */ + in_attr = elf_known_obj_attributes (ibfd)[OBJ_ATTR_GNU]; + out_attr = elf_known_obj_attributes (obfd)[OBJ_ATTR_GNU]; + if (in_attr[Tag_GNU_Power_ABI_FP].i != out_attr[Tag_GNU_Power_ABI_FP].i) + { + out_attr[Tag_GNU_Power_ABI_FP].type = 1; + if (out_attr[Tag_GNU_Power_ABI_FP].i == 0) + out_attr[Tag_GNU_Power_ABI_FP].i = in_attr[Tag_GNU_Power_ABI_FP].i; + else if (in_attr[Tag_GNU_Power_ABI_FP].i == 0) + ; + else if (out_attr[Tag_GNU_Power_ABI_FP].i == 1 + && in_attr[Tag_GNU_Power_ABI_FP].i == 2) + _bfd_error_handler + (_("Warning: %B uses hard float, %B uses soft float"), obfd, ibfd); + else if (out_attr[Tag_GNU_Power_ABI_FP].i == 2 + && in_attr[Tag_GNU_Power_ABI_FP].i == 1) + _bfd_error_handler + (_("Warning: %B uses hard float, %B uses soft float"), ibfd, obfd); + else if (in_attr[Tag_GNU_Power_ABI_FP].i > 2) + _bfd_error_handler + (_("Warning: %B uses unknown floating point ABI %d"), ibfd, + in_attr[Tag_GNU_Power_ABI_FP].i); + else + _bfd_error_handler + (_("Warning: %B uses unknown floating point ABI %d"), obfd, + out_attr[Tag_GNU_Power_ABI_FP].i); + } + + /* Merge Tag_compatibility attributes and any common GNU ones. */ + _bfd_elf_merge_object_attributes (ibfd, obfd); + + return TRUE; +} + /* Merge backend specific data from an object file to the output object file when linking. */ @@ -3524,6 +3668,9 @@ ppc_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd) if (! _bfd_generic_verify_endian_match (ibfd, obfd)) return FALSE; + if (!ppc_elf_merge_obj_attributes (ibfd, obfd)) + return FALSE; + new_flags = elf_elfheader (ibfd)->e_flags; old_flags = elf_elfheader (obfd)->e_flags; if (!elf_flags_init (obfd)) @@ -3603,7 +3750,7 @@ ppc_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd) int ppc_elf_select_plt_layout (bfd *output_bfd ATTRIBUTE_UNUSED, struct bfd_link_info *info, - int force_old_plt, + enum ppc_elf_plt_type plt_style, int emit_stub_syms) { struct ppc_elf_link_hash_table *htab; @@ -3612,8 +3759,37 @@ ppc_elf_select_plt_layout (bfd *output_bfd ATTRIBUTE_UNUSED, htab = ppc_elf_hash_table (info); if (htab->plt_type == PLT_UNSET) - htab->plt_type = (force_old_plt || !htab->can_use_new_plt - ? PLT_OLD : PLT_NEW); + { + if (plt_style == PLT_OLD) + htab->plt_type = PLT_OLD; + else + { + bfd *ibfd; + enum ppc_elf_plt_type plt_type = plt_style; + + /* Look through the reloc flags left by ppc_elf_check_relocs. + Use the old style bss plt if a file makes plt calls + without using the new relocs, and if ld isn't given + --secure-plt and we never see REL16 relocs. */ + if (plt_type == PLT_UNSET) + plt_type = PLT_OLD; + for (ibfd = info->input_bfds; ibfd; ibfd = ibfd->link_next) + if (is_ppc_elf_target (ibfd->xvec)) + { + if (ppc_elf_tdata (ibfd)->has_rel16) + plt_type = PLT_NEW; + else if (ppc_elf_tdata (ibfd)->makes_plt_call) + { + plt_type = PLT_OLD; + htab->old_bfd = ibfd; + break; + } + } + htab->plt_type = plt_type; + } + } + if (htab->plt_type == PLT_OLD && plt_style == PLT_NEW) + info->callbacks->info (_("Using bss-plt due to %B"), htab->old_bfd); htab->emit_stub_syms = emit_stub_syms; @@ -3649,38 +3825,20 @@ ppc_elf_select_plt_layout (bfd *output_bfd ATTRIBUTE_UNUSED, static asection * ppc_elf_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, + struct bfd_link_info *info, Elf_Internal_Rela *rel, struct elf_link_hash_entry *h, Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_PPC_GNU_VTINHERIT: - case R_PPC_GNU_VTENTRY: - break; + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_PPC_GNU_VTINHERIT: + case R_PPC_GNU_VTENTRY: + return NULL; + } - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Update the got, plt and dynamic reloc reference counts for the @@ -4048,7 +4206,6 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info, { struct ppc_elf_link_hash_table *htab; asection *s; - unsigned int power_of_two; #ifdef DEBUG fprintf (stderr, "ppc_elf_adjust_dynamic_symbol called for %s\n", @@ -4190,28 +4347,7 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 4) - power_of_two = 4; - - /* Apply the required alignment. */ - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) - { - if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) - return FALSE; - } - - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Generate a symbol to mark plt call stubs. For non-PIC code the sym is @@ -4450,13 +4586,15 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) } else ent->plt.offset = (bfd_vma) -1; - - if (!doneone) - { - h->plt.plist = NULL; - h->needs_plt = 0; - } } + else + ent->plt.offset = (bfd_vma) -1; + + if (!doneone) + { + h->plt.plist = NULL; + h->needs_plt = 0; + } } else { @@ -4860,7 +4998,7 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, { /* Strip these too. */ } - else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) + else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela")) { if (s->size != 0) { @@ -5518,6 +5656,7 @@ ppc_elf_relocate_section (bfd *output_bfd, asection *got2, *sreloc = NULL; bfd_vma *local_got_offsets; bfd_boolean ret = TRUE; + bfd_vma d_offset = (bfd_big_endian (output_bfd) ? 2 : 0); #ifdef DEBUG _bfd_error_handler ("ppc_elf_relocate_section called for %B section %A, " @@ -5529,29 +5668,6 @@ ppc_elf_relocate_section (bfd *output_bfd, got2 = bfd_get_section_by_name (input_bfd, ".got2"); - if (info->relocatable) - { - if (got2 == NULL) - return TRUE; - - rel = relocs; - relend = relocs + input_section->reloc_count; - for (; rel < relend; rel++) - { - enum elf_ppc_reloc_type r_type; - - r_type = ELF32_R_TYPE (rel->r_info); - if (r_type == R_PPC_PLTREL24 - && rel->r_addend >= 32768) - { - /* R_PPC_PLTREL24 is rather special. If non-zero, the - addend specifies the GOT pointer offset within .got2. */ - rel->r_addend += got2->output_offset; - } - } - return TRUE; - } - /* Initialize howto table if not already done. */ if (!ppc_elf_howto_table[R_PPC_ADDR32]) ppc_elf_howto_init (); @@ -5605,6 +5721,33 @@ ppc_elf_relocate_section (bfd *output_bfd, sym_name = h->root.root.string; } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + howto = NULL; + if (r_type < R_PPC_max) + howto = ppc_elf_howto_table[r_type]; + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + { + if (got2 != NULL + && r_type == R_PPC_PLTREL24 + && rel->r_addend >= 32768) + { + /* R_PPC_PLTREL24 is rather special. If non-zero, the + addend specifies the GOT pointer offset within .got2. */ + rel->r_addend += got2->output_offset; + } + continue; + } + /* TLS optimizations. Replace instruction sequences and relocs based on information we collected in tls_optimize. We edit RELOCS so that --emit-relocs will output something sensible @@ -5644,10 +5787,10 @@ ppc_elf_relocate_section (bfd *output_bfd, && (tls_mask & TLS_TPREL) == 0) { bfd_vma insn; - insn = bfd_get_32 (output_bfd, contents + rel->r_offset - 2); + insn = bfd_get_32 (output_bfd, contents + rel->r_offset - d_offset); insn &= 31 << 21; insn |= 0x3c020000; /* addis 0,2,0 */ - bfd_put_32 (output_bfd, insn, contents + rel->r_offset - 2); + bfd_put_32 (output_bfd, insn, contents + rel->r_offset - d_offset); r_type = R_PPC_TPREL16_HA; rel->r_info = ELF32_R_INFO (r_symndx, r_type); } @@ -5691,9 +5834,10 @@ ppc_elf_relocate_section (bfd *output_bfd, bfd_put_32 (output_bfd, insn, contents + rel->r_offset); r_type = R_PPC_TPREL16_LO; rel->r_info = ELF32_R_INFO (r_symndx, r_type); + /* Was PPC_TLS which sits on insn boundary, now - PPC_TPREL16_LO which is at insn+2. */ - rel->r_offset += 2; + PPC_TPREL16_LO which is at low-order half-word. */ + rel->r_offset += d_offset; } break; @@ -5715,7 +5859,7 @@ ppc_elf_relocate_section (bfd *output_bfd, else { bfd_put_32 (output_bfd, NOP, contents + rel->r_offset); - rel->r_offset -= 2; + rel->r_offset -= d_offset; r_type = R_PPC_NONE; } rel->r_info = ELF32_R_INFO (r_symndx, r_type); @@ -5764,7 +5908,7 @@ ppc_elf_relocate_section (bfd *output_bfd, /* OK, it checks out. Replace the call. */ offset = rel[1].r_offset; insn1 = bfd_get_32 (output_bfd, - contents + rel->r_offset - 2); + contents + rel->r_offset - d_offset); if ((tls_mask & tls_gd) != 0) { /* IE */ @@ -5792,10 +5936,10 @@ ppc_elf_relocate_section (bfd *output_bfd, rel->r_info = ELF32_R_INFO (r_symndx, r_type); rel[1].r_info = ELF32_R_INFO (r_symndx, R_PPC_TPREL16_LO); - rel[1].r_offset += 2; + rel[1].r_offset += d_offset; rel[1].r_addend = rel->r_addend; } - bfd_put_32 (output_bfd, insn1, contents + rel->r_offset - 2); + bfd_put_32 (output_bfd, insn1, contents + rel->r_offset - d_offset); bfd_put_32 (output_bfd, insn2, contents + offset); if (tls_gd == 0) { @@ -6189,14 +6333,7 @@ ppc_elf_relocate_section (bfd *output_bfd, case R_PPC_ADDR14_BRNTAKEN: case R_PPC_UADDR32: case R_PPC_UADDR16: - /* r_symndx will be zero only for relocs against symbols - from removed linkonce sections, or sections discarded by - a linker script. */ dodyn: - if (r_symndx == 0) - break; - /* Fall thru. */ - if ((input_section->flags & SEC_ALLOC) == 0) break; /* Fall thru. */ @@ -6238,7 +6375,7 @@ ppc_elf_relocate_section (bfd *output_bfd, if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (input_bfd, input_section), name + 5) == 0); @@ -6294,10 +6431,15 @@ ppc_elf_relocate_section (bfd *output_bfd, but ld.so expects buggy relocs. */ osec = sec->output_section; indx = elf_section_data (osec)->dynindx; - BFD_ASSERT (indx > 0); + if (indx == 0) + { + osec = htab->elf.text_index_section; + indx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (indx != 0); #ifdef DEBUG - if (indx <= 0) - printf ("indx=%d section=%s flags=%08x name=%s\n", + if (indx == 0) + printf ("indx=%ld section=%s flags=%08x name=%s\n", indx, osec->name, osec->flags, h->root.root.string); #endif @@ -6441,9 +6583,9 @@ ppc_elf_relocate_section (bfd *output_bfd, BFD_ASSERT (sec != NULL); name = bfd_get_section_name (abfd, sec->output_section); - if (! ((strncmp (name, ".sdata", 6) == 0 + if (! ((CONST_STRNEQ (name, ".sdata") && (name[6] == 0 || name[6] == '.')) - || (strncmp (name, ".sbss", 5) == 0 + || (CONST_STRNEQ (name, ".sbss") && (name[5] == 0 || name[5] == '.')))) { (*_bfd_error_handler) @@ -6469,8 +6611,8 @@ ppc_elf_relocate_section (bfd *output_bfd, BFD_ASSERT (sec != NULL); name = bfd_get_section_name (abfd, sec->output_section); - if (! (strncmp (name, ".sdata2", 7) == 0 - || strncmp (name, ".sbss2", 6) == 0)) + if (! (CONST_STRNEQ (name, ".sdata2") + || CONST_STRNEQ (name, ".sbss2"))) { (*_bfd_error_handler) (_("%B: the target (%s) of a %s relocation is " @@ -6501,9 +6643,9 @@ ppc_elf_relocate_section (bfd *output_bfd, BFD_ASSERT (sec != NULL); name = bfd_get_section_name (abfd, sec->output_section); - if (((strncmp (name, ".sdata", 6) == 0 + if (((CONST_STRNEQ (name, ".sdata") && (name[6] == 0 || name[6] == '.')) - || (strncmp (name, ".sbss", 5) == 0 + || (CONST_STRNEQ (name, ".sbss") && (name[5] == 0 || name[5] == '.')))) { reg = 13; @@ -6513,8 +6655,8 @@ ppc_elf_relocate_section (bfd *output_bfd, + sh->root.u.def.section->output_section->vma); } - else if (strncmp (name, ".sdata2", 7) == 0 - || strncmp (name, ".sbss2", 6) == 0) + else if (CONST_STRNEQ (name, ".sdata2") + || CONST_STRNEQ (name, ".sbss2")) { reg = 2; sh = htab->sdata[1].sym; @@ -6605,25 +6747,28 @@ ppc_elf_relocate_section (bfd *output_bfd, case R_PPC_ADDR16_HA: case R_PPC_REL16_HA: - case R_PPC_GOT16_HA: - case R_PPC_PLT16_HA: case R_PPC_SECTOFF_HA: case R_PPC_TPREL16_HA: case R_PPC_DTPREL16_HA: - case R_PPC_GOT_TLSGD16_HA: - case R_PPC_GOT_TLSLD16_HA: - case R_PPC_GOT_TPREL16_HA: - case R_PPC_GOT_DTPREL16_HA: case R_PPC_EMB_NADDR16_HA: case R_PPC_EMB_RELST_HA: /* It's just possible that this symbol is a weak symbol that's not actually defined anywhere. In that case, 'sec' would be NULL, and we should leave the symbol alone (it will be set to zero elsewhere in the link). */ - if (sec != NULL) - /* Add 0x10000 if sign bit in 0:15 is set. - Bits 0:15 are not used. */ - addend += 0x8000; + if (sec == NULL) + break; + /* Fall thru */ + + case R_PPC_PLT16_HA: + case R_PPC_GOT16_HA: + case R_PPC_GOT_TLSGD16_HA: + case R_PPC_GOT_TLSLD16_HA: + case R_PPC_GOT_TPREL16_HA: + case R_PPC_GOT_DTPREL16_HA: + /* Add 0x10000 if sign bit in 0:15 is set. + Bits 0:15 are not used. */ + addend += 0x8000; break; } @@ -7436,6 +7581,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd, #define ELF_MAXPAGESIZE 0x10000 #endif #define ELF_MINPAGESIZE 0x1000 +#define ELF_COMMONPAGESIZE 0x1000 #define elf_info_to_howto ppc_elf_info_to_howto #ifdef EM_CYGNUS_POWERPC @@ -7455,6 +7601,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd, #define bfd_elf32_bfd_merge_private_bfd_data ppc_elf_merge_private_bfd_data #define bfd_elf32_bfd_relax_section ppc_elf_relax_section #define bfd_elf32_bfd_reloc_type_lookup ppc_elf_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup ppc_elf_reloc_name_lookup #define bfd_elf32_bfd_set_private_flags ppc_elf_set_private_flags #define bfd_elf32_bfd_link_hash_table_create ppc_elf_link_hash_table_create @@ -7475,6 +7622,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd, #define elf_backend_additional_program_headers ppc_elf_additional_program_headers #define elf_backend_grok_prstatus ppc_elf_grok_prstatus #define elf_backend_grok_psinfo ppc_elf_grok_psinfo +#define elf_backend_write_core_note ppc_elf_write_core_note #define elf_backend_reloc_type_class ppc_elf_reloc_type_class #define elf_backend_begin_write_processing ppc_elf_begin_write_processing #define elf_backend_final_write_processing ppc_elf_final_write_processing @@ -7482,6 +7630,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd, #define elf_backend_get_sec_type_attr ppc_elf_get_sec_type_attr #define elf_backend_plt_sym_val ppc_elf_plt_sym_val #define elf_backend_action_discarded ppc_elf_action_discarded +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #include "elf32-target.h" diff --git a/bfd/elf32-ppc.h b/bfd/elf32-ppc.h index 5f8f63a38a5..f5383a7bb58 100644 --- a/bfd/elf32-ppc.h +++ b/bfd/elf32-ppc.h @@ -1,5 +1,5 @@ /* PowerPC-specific support for 64-bit ELF. - Copyright 2003, 2005 Free Software Foundation, Inc. + Copyright 2003, 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,7 +17,15 @@ 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. */ -int ppc_elf_select_plt_layout (bfd *, struct bfd_link_info *, int, int); +enum ppc_elf_plt_type { + PLT_UNSET, + PLT_OLD, + PLT_NEW, + PLT_VXWORKS +}; + +int ppc_elf_select_plt_layout (bfd *, struct bfd_link_info *, + enum ppc_elf_plt_type, int); asection *ppc_elf_tls_setup (bfd *, struct bfd_link_info *); bfd_boolean ppc_elf_tls_optimize (bfd *, struct bfd_link_info *); void ppc_elf_set_sdata_syms (bfd *, struct bfd_link_info *); diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index eb8e1724fc1..9e36a5d5746 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -1,5 +1,5 @@ /* IBM S/390-specific support for 32-bit ELF - Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Carl B. Pedersen and Martin Schwidefsky. @@ -20,8 +20,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -46,12 +46,6 @@ static void elf_s390_copy_indirect_symbol static bfd_boolean elf_s390_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); -static asection *elf_s390_gc_mark_hook - PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *)); -static bfd_boolean elf_s390_gc_sweep_hook - PARAMS ((bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *)); struct elf_s390_link_hash_entry; static void elf_s390_adjust_gotplt PARAMS ((struct elf_s390_link_hash_entry *)); @@ -73,8 +67,6 @@ static enum elf_reloc_type_class elf_s390_reloc_type_class PARAMS ((const Elf_Internal_Rela *)); static bfd_boolean elf_s390_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); -static bfd_boolean elf_s390_mkobject - PARAMS ((bfd *)); static bfd_boolean elf_s390_object_p PARAMS ((bfd *)); static bfd_boolean elf_s390_grok_prstatus @@ -342,6 +334,25 @@ elf_s390_reloc_type_lookup (abfd, code) return 0; } +static reloc_howto_type * +elf_s390_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; i < sizeof (elf_howto_table) / sizeof (elf_howto_table[0]); i++) + if (elf_howto_table[i].name != NULL + && strcasecmp (elf_howto_table[i].name, r_name) == 0) + return &elf_howto_table[i]; + + if (strcasecmp (elf32_s390_vtinherit_howto.name, r_name) == 0) + return &elf32_s390_vtinherit_howto; + if (strcasecmp (elf32_s390_vtentry_howto.name, r_name) == 0) + return &elf32_s390_vtentry_howto; + + return NULL; +} + /* We need to use ELF32_R_TYPE so we have our own copy of this function, and elf32-s390.c has its own copy. */ @@ -678,14 +689,16 @@ struct elf_s390_obj_tdata (elf_s390_tdata (abfd)->local_got_tls_type) static bfd_boolean -elf_s390_mkobject (abfd) - bfd *abfd; +elf_s390_mkobject (bfd *abfd) { - bfd_size_type amt = sizeof (struct elf_s390_obj_tdata); - abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) - return FALSE; - return TRUE; + { + bfd_size_type amt = sizeof (struct elf_s390_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + } + return bfd_elf_mkobject (abfd); } static bfd_boolean @@ -1273,7 +1286,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs) if (name == NULL) return FALSE; - if (strncmp (name, ".rela", 5) != 0 + if (! CONST_STRNEQ (name, ".rela") || strcmp (bfd_get_section_name (abfd, sec), name + 5) != 0) { @@ -1379,50 +1392,30 @@ elf_s390_check_relocs (abfd, info, sec, relocs) relocation. */ static asection * -elf_s390_gc_mark_hook (sec, info, rel, h, sym) - asection *sec; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +elf_s390_gc_mark_hook (asection *sec, + struct bfd_link_info *info, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_390_GNU_VTINHERIT: - case R_390_GNU_VTENTRY: - break; + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_390_GNU_VTINHERIT: + case R_390_GNU_VTENTRY: + return NULL; + } + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; } /* Update the got entry reference counts for the section being removed. */ static bfd_boolean -elf_s390_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; +elf_s390_gc_sweep_hook (bfd *abfd, + struct bfd_link_info *info, + asection *sec, + const Elf_Internal_Rela *relocs) { Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; @@ -1589,7 +1582,6 @@ elf_s390_adjust_dynamic_symbol (info, h) { struct elf_s390_link_hash_table *htab; asection *s; - unsigned int power_of_two; /* If this is a function, put it in the procedure linkage table. We will fill in the contents of the procedure linkage table later @@ -1710,29 +1702,9 @@ elf_s390_adjust_dynamic_symbol (info, h) h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 3) - power_of_two = 3; - - /* Apply the required alignment. */ s = htab->sdynbss; - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) - { - if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) - return FALSE; - } - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -2126,7 +2098,7 @@ elf_s390_size_dynamic_sections (output_bfd, info) /* Strip this section if we don't need it; see the comment below. */ } - else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) + else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela")) { if (s->size != 0) relocs = TRUE; @@ -2268,6 +2240,7 @@ invalid_tls_insn (input_bfd, input_section, rel) input_section, (long) rel->r_offset, howto->name); + bfd_set_error (bfd_error_bad_value); } /* Relocate a 390 ELF section. */ @@ -2291,9 +2264,6 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocatable) - return TRUE; - htab = elf_s390_hash_table (info); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -2328,7 +2298,6 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, howto = elf_howto_table + r_type; r_symndx = ELF32_R_SYM (rel->r_info); - /* This is a final link. */ h = NULL; sym = NULL; sec = NULL; @@ -2349,6 +2318,20 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, unresolved_reloc, warned); } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + switch (r_type) { case R_390_GOTPLT12: @@ -2565,11 +2548,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, case R_390_PC16DBL: case R_390_PC32DBL: case R_390_PC32: - /* r_symndx will be zero only for relocs against symbols - from removed linkonce sections, or sections discarded by - a linker script. */ - if (r_symndx == 0 - || (input_section->flags & SEC_ALLOC) == 0) + if ((input_section->flags & SEC_ALLOC) == 0) break; if ((info->shared @@ -2655,14 +2634,18 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, osec = sec->output_section; sindx = elf_section_data (osec)->dynindx; - BFD_ASSERT (sindx > 0); + if (sindx == 0) + { + osec = htab->elf.text_index_section; + sindx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (sindx != 0); /* We are turning this relocation into one against a section symbol, so subtract out the output section's address but not the offset of the input section in the output section. */ - outrel.r_addend -= osec->vma; } outrel.r_info = ELF32_R_INFO (sindx, r_type); @@ -2926,7 +2909,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, continue; case R_390_TLS_LDO32: - if (info->shared || (input_section->flags & SEC_CODE) == 0) + if (info->shared) relocation -= dtpoff_base (info); else /* When converting LDO to LE, we must negate. */ @@ -2982,16 +2965,44 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, unsigned int insn; insn = bfd_get_32 (input_bfd, contents + rel->r_offset); - if ((insn & 0xff000fff) != 0x4d000000) + if ((insn & 0xff000fff) != 0x4d000000 && + (insn & 0xffff0000) != 0xc0e50000) invalid_tls_insn (input_bfd, input_section, rel); if (!info->shared && (h == NULL || h->dynindx == -1)) - /* GD->LE transition. - bas %r14,0(%rx,%r13) -> bc 0,0 */ - insn = 0x47000000; + { + if ((insn & 0xff000000) == 0x4d000000) + { + /* GD->LE transition. + bas %r14,0(%rx,%r13) -> bc 0,0 */ + insn = 0x47000000; + } + else + { + /* GD->LE transition. + brasl %r14,_tls_get_addr@plt -> brcl 0,. */ + insn = 0xc0040000; + bfd_put_16 (output_bfd, 0x0000, + contents + rel->r_offset + 4); + } + } else - /* GD->IE transition. - bas %r14,0(%rx,%r13) -> l %r2,0(%r2,%r12) */ - insn = 0x5822c000; + { + if ((insn & 0xff000000) == 0x4d000000) + { + /* GD->IE transition. + bas %r14,0(%rx,%r13) -> l %r2,0(%r2,%r12) */ + insn = 0x5822c000; + } + else + { + /* GD->IE transition. + brasl %r14,__tls_get_addr@plt -> + l %r2,0(%r2,%r12) ; bcr 0,0 */ + insn = 0x5822c000; + bfd_put_16 (output_bfd, 0x0700, + contents + rel->r_offset + 4); + } + } bfd_put_32 (output_bfd, insn, contents + rel->r_offset); } else if (r_type == R_390_TLS_LDCALL) @@ -3001,11 +3012,23 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, unsigned int insn; insn = bfd_get_32 (input_bfd, contents + rel->r_offset); - if ((insn & 0xff000fff) != 0x4d000000) + if ((insn & 0xff000fff) != 0x4d000000 && + (insn & 0xffff0000) != 0xc0e50000) invalid_tls_insn (input_bfd, input_section, rel); - /* LD->LE transition. - bas %r14,0(%rx,%r13) -> bc 0,0 */ - insn = 0x47000000; + if ((insn & 0xff000000) == 0x4d000000) + { + /* LD->LE transition. + bas %r14,0(%rx,%r13) -> bc 0,0 */ + insn = 0x47000000; + } + else + { + /* LD->LE transition. + brasl %r14,__tls_get_addr@plt -> brcl 0,. */ + insn = 0xc0040000; + bfd_put_16 (output_bfd, 0x0000, + contents + rel->r_offset + 4); + } bfd_put_32 (output_bfd, insn, contents + rel->r_offset); } } @@ -3515,6 +3538,7 @@ elf_s390_plt_sym_val (bfd_vma i, const asection *plt, #define bfd_elf32_bfd_is_local_label_name elf_s390_is_local_label_name #define bfd_elf32_bfd_link_hash_table_create elf_s390_link_hash_table_create #define bfd_elf32_bfd_reloc_type_lookup elf_s390_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup elf_s390_reloc_name_lookup #define elf_backend_adjust_dynamic_symbol elf_s390_adjust_dynamic_symbol #define elf_backend_check_relocs elf_s390_check_relocs @@ -3527,6 +3551,7 @@ elf_s390_plt_sym_val (bfd_vma i, const asection *plt, #define elf_backend_reloc_type_class elf_s390_reloc_type_class #define elf_backend_relocate_section elf_s390_relocate_section #define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_reloc_type_class elf_s390_reloc_type_class #define elf_backend_grok_prstatus elf_s390_grok_prstatus #define elf_backend_plt_sym_val elf_s390_plt_sym_val diff --git a/bfd/elf32-score.c b/bfd/elf32-score.c new file mode 100644 index 00000000000..070177b1507 --- /dev/null +++ b/bfd/elf32-score.c @@ -0,0 +1,3883 @@ +/* 32-bit ELF support for S+core. + Copyright 2006, 2007 Free Software Foundation, Inc. + Contributed by + Mei Ligang (ligang@sunnorth.com.cn) + Pei-Lin Tsai (pltsai@sunplus.com) + + This file is part of BFD, the Binary File Descriptor library. + + 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 2 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 "libbfd.h" +#include "libiberty.h" +#include "elf-bfd.h" +#include "elf/score.h" +#include "elf/common.h" +#include "elf/internal.h" +#include "hashtab.h" + + +/* Score ELF linker hash table. */ + +struct score_elf_link_hash_table +{ + /* The main hash table. */ + struct elf_link_hash_table root; +}; + +/* The SCORE ELF linker needs additional information for each symbol in + the global hash table. */ + +struct score_elf_link_hash_entry +{ + struct elf_link_hash_entry root; + + /* Number of R_SCORE_ABS32, R_SCORE_REL32 relocs against this symbol. */ + unsigned int possibly_dynamic_relocs; + + /* If the R_SCORE_ABS32, R_SCORE_REL32 reloc is against a readonly section. */ + bfd_boolean readonly_reloc; + + /* We must not create a stub for a symbol that has relocations related to + taking the function's address, i.e. any but R_SCORE_CALL15 ones. */ + bfd_boolean no_fn_stub; + + /* Are we forced local? This will only be set if we have converted + the initial global GOT entry to a local GOT entry. */ + bfd_boolean forced_local; +}; + +/* Traverse a score ELF linker hash table. */ +#define score_elf_link_hash_traverse(table, func, info) \ + (elf_link_hash_traverse \ + (&(table)->root, \ + (bfd_boolean (*) (struct elf_link_hash_entry *, void *)) (func), \ + (info))) + +/* Get the SCORE elf linker hash table from a link_info structure. */ +#define score_elf_hash_table(info) \ + ((struct score_elf_link_hash_table *) ((info)->hash)) + +/* This structure is used to hold .got entries while estimating got sizes. */ +struct score_got_entry +{ + /* The input bfd in which the symbol is defined. */ + bfd *abfd; + /* The index of the symbol, as stored in the relocation r_info, if + we have a local symbol; -1 otherwise. */ + long symndx; + union + { + /* If abfd == NULL, an address that must be stored in the got. */ + bfd_vma address; + /* If abfd != NULL && symndx != -1, the addend of the relocation + that should be added to the symbol value. */ + bfd_vma addend; + /* If abfd != NULL && symndx == -1, the hash table entry + corresponding to a global symbol in the got (or, local, if + h->forced_local). */ + struct score_elf_link_hash_entry *h; + } d; + + /* The offset from the beginning of the .got section to the entry + corresponding to this symbol+addend. If it's a global symbol + whose offset is yet to be decided, it's going to be -1. */ + long gotidx; +}; + +/* This structure is passed to score_elf_sort_hash_table_f when sorting + the dynamic symbols. */ + +struct score_elf_hash_sort_data +{ + /* The symbol in the global GOT with the lowest dynamic symbol table index. */ + struct elf_link_hash_entry *low; + /* The least dynamic symbol table index corresponding to a symbol with a GOT entry. */ + long min_got_dynindx; + /* The greatest dynamic symbol table index corresponding to a symbol + with a GOT entry that is not referenced (e.g., a dynamic symbol + with dynamic relocations pointing to it from non-primary GOTs). */ + long max_unref_got_dynindx; + /* The greatest dynamic symbol table index not corresponding to a + symbol without a GOT entry. */ + long max_non_got_dynindx; +}; + +struct score_got_info +{ + /* The global symbol in the GOT with the lowest index in the dynamic + symbol table. */ + struct elf_link_hash_entry *global_gotsym; + /* The number of global .got entries. */ + unsigned int global_gotno; + /* The number of local .got entries. */ + unsigned int local_gotno; + /* The number of local .got entries we have used. */ + unsigned int assigned_gotno; + /* A hash table holding members of the got. */ + struct htab *got_entries; + /* In multi-got links, a pointer to the next got (err, rather, most + of the time, it points to the previous got). */ + struct score_got_info *next; +}; + +/* A structure used to count GOT entries, for GOT entry or ELF symbol table traversal. */ +struct _score_elf_section_data +{ + struct bfd_elf_section_data elf; + union + { + struct score_got_info *got_info; + bfd_byte *tdata; + } + u; +}; + +#define score_elf_section_data(sec) \ + ((struct _score_elf_section_data *) elf_section_data (sec)) + +/* The size of a symbol-table entry. */ +#define SCORE_ELF_SYM_SIZE(abfd) \ + (get_elf_backend_data (abfd)->s->sizeof_sym) + +/* In case we're on a 32-bit machine, construct a 64-bit "-1" value + from smaller values. Start with zero, widen, *then* decrement. */ +#define MINUS_ONE (((bfd_vma)0) - 1) +#define MINUS_TWO (((bfd_vma)0) - 2) + +#define PDR_SIZE 32 + + +/* The number of local .got entries we reserve. */ +#define SCORE_RESERVED_GOTNO (2) +#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" + +/* The offset of $gp from the beginning of the .got section. */ +#define ELF_SCORE_GP_OFFSET(abfd) (0x3ff0) +/* The maximum size of the GOT for it to be addressable using 15-bit offsets from $gp. */ +#define SCORE_ELF_GOT_MAX_SIZE(abfd) (ELF_SCORE_GP_OFFSET(abfd) + 0x3fff) + +#define SCORE_ELF_STUB_SECTION_NAME (".SCORE.stub") +#define SCORE_FUNCTION_STUB_SIZE (16) + +#define STUB_LW 0xc3bcc010 /* lw r29, [r28, -0x3ff0] */ +#define STUB_MOVE 0x8363bc56 /* mv r27, r3 */ +#define STUB_LI16 0x87548000 /* ori r26, .dynsym_index */ +#define STUB_BRL 0x801dbc09 /* brl r29 */ + +#define SCORE_ELF_GOT_SIZE(abfd) \ + (get_elf_backend_data (abfd)->s->arch_size / 8) + +#define SCORE_ELF_ADD_DYNAMIC_ENTRY(info, tag, val) \ + (_bfd_elf_add_dynamic_entry (info, (bfd_vma) tag, (bfd_vma) val)) + +/* The size of an external dynamic table entry. */ +#define SCORE_ELF_DYN_SIZE(abfd) \ + (get_elf_backend_data (abfd)->s->sizeof_dyn) + +/* The size of an external REL relocation. */ +#define SCORE_ELF_REL_SIZE(abfd) \ + (get_elf_backend_data (abfd)->s->sizeof_rel) + +/* The default alignment for sections, as a power of two. */ +#define SCORE_ELF_LOG_FILE_ALIGN(abfd)\ + (get_elf_backend_data (abfd)->s->log_file_align) + +#ifndef NUM_ELEM +#define NUM_ELEM(a) (sizeof (a) / (sizeof (a)[0])) +#endif + +static bfd_byte *hi16_rel_addr; + +/* This will be used when we sort the dynamic relocation records. */ +static bfd *reldyn_sorting_bfd; + +/* SCORE ELF uses two common sections. One is the usual one, and the + other is for small objects. All the small objects are kept + together, and then referenced via the gp pointer, which yields + faster assembler code. This is what we use for the small common + section. This approach is copied from ecoff.c. */ +static asection score_elf_scom_section; +static asymbol score_elf_scom_symbol; +static asymbol *score_elf_scom_symbol_ptr; + +static bfd_reloc_status_type +score_elf_hi16_reloc (bfd *abfd ATTRIBUTE_UNUSED, + arelent *reloc_entry, + asymbol *symbol ATTRIBUTE_UNUSED, + void * data, + asection *input_section ATTRIBUTE_UNUSED, + bfd *output_bfd ATTRIBUTE_UNUSED, + char **error_message ATTRIBUTE_UNUSED) +{ + hi16_rel_addr = (bfd_byte *) data + reloc_entry->address; + return bfd_reloc_ok; +} + +static bfd_reloc_status_type +score_elf_lo16_reloc (bfd *abfd, + arelent *reloc_entry, + asymbol *symbol ATTRIBUTE_UNUSED, + void * data, + asection *input_section, + bfd *output_bfd ATTRIBUTE_UNUSED, + char **error_message ATTRIBUTE_UNUSED) +{ + bfd_vma addend = 0, offset = 0; + unsigned long val; + unsigned long hi16_offset, hi16_value, uvalue; + + hi16_value = bfd_get_32 (abfd, hi16_rel_addr); + hi16_offset = ((((hi16_value >> 16) & 0x3) << 15) | (hi16_value & 0x7fff)) >> 1; + addend = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); + offset = ((((addend >> 16) & 0x3) << 15) | (addend & 0x7fff)) >> 1; + val = reloc_entry->addend; + if (reloc_entry->address > input_section->size) + return bfd_reloc_outofrange; + uvalue = ((hi16_offset << 16) | (offset & 0xffff)) + val; + hi16_offset = (uvalue >> 16) << 1; + hi16_value = (hi16_value & ~0x37fff) | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000); + bfd_put_32 (abfd, hi16_value, hi16_rel_addr); + offset = (uvalue & 0xffff) << 1; + addend = (addend & ~0x37fff) | (offset & 0x7fff) | ((offset << 1) & 0x30000); + bfd_put_32 (abfd, addend, (bfd_byte *) data + reloc_entry->address); + return bfd_reloc_ok; +} + +/* Set the GP value for OUTPUT_BFD. Returns FALSE if this is a + dangerous relocation. */ + +static bfd_boolean +score_elf_assign_gp (bfd *output_bfd, bfd_vma *pgp) +{ + unsigned int count; + asymbol **sym; + unsigned int i; + + /* If we've already figured out what GP will be, just return it. */ + *pgp = _bfd_get_gp_value (output_bfd); + if (*pgp) + return TRUE; + + count = bfd_get_symcount (output_bfd); + sym = bfd_get_outsymbols (output_bfd); + + /* The linker script will have created a symbol named `_gp' with the + appropriate value. */ + if (sym == NULL) + i = count; + else + { + for (i = 0; i < count; i++, sym++) + { + const char *name; + + name = bfd_asymbol_name (*sym); + if (*name == '_' && strcmp (name, "_gp") == 0) + { + *pgp = bfd_asymbol_value (*sym); + _bfd_set_gp_value (output_bfd, *pgp); + break; + } + } + } + + if (i >= count) + { + /* Only get the error once. */ + *pgp = 4; + _bfd_set_gp_value (output_bfd, *pgp); + return FALSE; + } + + return TRUE; +} + +/* We have to figure out the gp value, so that we can adjust the + symbol value correctly. We look up the symbol _gp in the output + BFD. If we can't find it, we're stuck. We cache it in the ELF + target data. We don't need to adjust the symbol value for an + external symbol if we are producing relocatable output. */ + +static bfd_reloc_status_type +score_elf_final_gp (bfd *output_bfd, + asymbol *symbol, + bfd_boolean relocatable, + char **error_message, + bfd_vma *pgp) +{ + if (bfd_is_und_section (symbol->section) + && ! relocatable) + { + *pgp = 0; + return bfd_reloc_undefined; + } + + *pgp = _bfd_get_gp_value (output_bfd); + if (*pgp == 0 + && (! relocatable + || (symbol->flags & BSF_SECTION_SYM) != 0)) + { + if (relocatable) + { + /* Make up a value. */ + *pgp = symbol->section->output_section->vma + 0x4000; + _bfd_set_gp_value (output_bfd, *pgp); + } + else if (!score_elf_assign_gp (output_bfd, pgp)) + { + *error_message = + (char *) _("GP relative relocation when _gp not defined"); + return bfd_reloc_dangerous; + } + } + + return bfd_reloc_ok; +} + +static bfd_reloc_status_type +score_elf_gprel15_with_gp (bfd *abfd, + asymbol *symbol, + arelent *reloc_entry, + asection *input_section, + bfd_boolean relocateable, + void * data, + bfd_vma gp ATTRIBUTE_UNUSED) +{ + bfd_vma relocation; + unsigned long insn; + + if (bfd_is_com_section (symbol->section)) + relocation = 0; + else + relocation = symbol->value; + + relocation += symbol->section->output_section->vma; + relocation += symbol->section->output_offset; + if (reloc_entry->address > input_section->size) + return bfd_reloc_outofrange; + + insn = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); + if (((reloc_entry->addend & 0xffffc000) != 0) + && ((reloc_entry->addend & 0xffffc000) != 0xffffc000)) + return bfd_reloc_overflow; + + insn = (insn & ~0x7fff) | (reloc_entry->addend & 0x7fff); + bfd_put_32 (abfd, insn, (bfd_byte *) data + reloc_entry->address); + if (relocateable) + reloc_entry->address += input_section->output_offset; + + return bfd_reloc_ok; +} + +static bfd_reloc_status_type +gprel32_with_gp (bfd *abfd, asymbol *symbol, arelent *reloc_entry, + asection *input_section, bfd_boolean relocatable, + void *data, bfd_vma gp) +{ + bfd_vma relocation; + bfd_vma val; + + if (bfd_is_com_section (symbol->section)) + relocation = 0; + else + relocation = symbol->value; + + relocation += symbol->section->output_section->vma; + relocation += symbol->section->output_offset; + + if (reloc_entry->address > bfd_get_section_limit (abfd, input_section)) + return bfd_reloc_outofrange; + + /* Set val to the offset into the section or symbol. */ + val = reloc_entry->addend; + + if (reloc_entry->howto->partial_inplace) + val += bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); + + /* Adjust val for the final section location and GP value. If we + are producing relocatable output, we don't want to do this for + an external symbol. */ + if (! relocatable + || (symbol->flags & BSF_SECTION_SYM) != 0) + val += relocation - gp; + + if (reloc_entry->howto->partial_inplace) + bfd_put_32 (abfd, val, (bfd_byte *) data + reloc_entry->address); + else + reloc_entry->addend = val; + + if (relocatable) + reloc_entry->address += input_section->output_offset; + + return bfd_reloc_ok; +} + +static bfd_reloc_status_type +score_elf_gprel15_reloc (bfd *abfd, + arelent *reloc_entry, + asymbol *symbol, + void * data, + asection *input_section, + bfd *output_bfd, + char **error_message) +{ + bfd_boolean relocateable; + bfd_reloc_status_type ret; + bfd_vma gp; + + if (output_bfd != (bfd *) NULL + && (symbol->flags & BSF_SECTION_SYM) == 0 && reloc_entry->addend == 0) + { + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; + } + if (output_bfd != (bfd *) NULL) + relocateable = TRUE; + else + { + relocateable = FALSE; + output_bfd = symbol->section->output_section->owner; + } + + ret = score_elf_final_gp (output_bfd, symbol, relocateable, error_message, &gp); + if (ret != bfd_reloc_ok) + return ret; + + return score_elf_gprel15_with_gp (abfd, symbol, reloc_entry, + input_section, relocateable, data, gp); +} + +/* Do a R_SCORE_GPREL32 relocation. This is a 32 bit value which must + become the offset from the gp register. */ + +static bfd_reloc_status_type +score_elf_gprel32_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, bfd *output_bfd, + char **error_message) +{ + bfd_boolean relocatable; + bfd_reloc_status_type ret; + bfd_vma gp; + + /* R_SCORE_GPREL32 relocations are defined for local symbols only. */ + if (output_bfd != NULL + && (symbol->flags & BSF_SECTION_SYM) == 0 + && (symbol->flags & BSF_LOCAL) != 0) + { + *error_message = (char *) + _("32bits gp relative relocation occurs for an external symbol"); + return bfd_reloc_outofrange; + } + + if (output_bfd != NULL) + relocatable = TRUE; + else + { + relocatable = FALSE; + output_bfd = symbol->section->output_section->owner; + } + + ret = score_elf_final_gp (output_bfd, symbol, relocatable, error_message, &gp); + if (ret != bfd_reloc_ok) + return ret; + + gp = 0; /* FIXME. */ + return gprel32_with_gp (abfd, symbol, reloc_entry, input_section, + relocatable, data, gp); +} + +/* A howto special_function for R_SCORE_GOT15 relocations. This is just + like any other 16-bit relocation when applied to global symbols, but is + treated in the same as R_SCORE_HI16 when applied to local symbols. */ + +static bfd_reloc_status_type +score_elf_got15_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, + bfd *output_bfd, char **error_message) +{ + if ((symbol->flags & (BSF_GLOBAL | BSF_WEAK)) != 0 + || bfd_is_und_section (bfd_get_section (symbol)) + || bfd_is_com_section (bfd_get_section (symbol))) + /* The relocation is against a global symbol. */ + return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, + error_message); + + return score_elf_hi16_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message); +} + +static bfd_reloc_status_type +score_elf_got_lo16_reloc (bfd *abfd, + arelent *reloc_entry, + asymbol *symbol ATTRIBUTE_UNUSED, + void * data, + asection *input_section, + bfd *output_bfd ATTRIBUTE_UNUSED, + char **error_message ATTRIBUTE_UNUSED) +{ + bfd_vma addend = 0, offset = 0; + signed long val; + signed long hi16_offset, hi16_value, uvalue; + + hi16_value = bfd_get_32 (abfd, hi16_rel_addr); + hi16_offset = ((((hi16_value >> 16) & 0x3) << 15) | (hi16_value & 0x7fff)) >> 1; + addend = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); + offset = ((((addend >> 16) & 0x3) << 15) | (addend & 0x7fff)) >> 1; + val = reloc_entry->addend; + if (reloc_entry->address > input_section->size) + return bfd_reloc_outofrange; + uvalue = ((hi16_offset << 16) | (offset & 0xffff)) + val; + if ((uvalue > -0x8000) && (uvalue < 0x7fff)) + hi16_offset = 0; + else + hi16_offset = (uvalue >> 16) & 0x7fff; + hi16_value = (hi16_value & ~0x37fff) | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000); + bfd_put_32 (abfd, hi16_value, hi16_rel_addr); + offset = (uvalue & 0xffff) << 1; + addend = (addend & ~0x37fff) | (offset & 0x7fff) | ((offset << 1) & 0x30000); + bfd_put_32 (abfd, addend, (bfd_byte *) data + reloc_entry->address); + return bfd_reloc_ok; +} + +static reloc_howto_type elf32_score_howto_table[] = +{ + /* No relocation. */ + HOWTO (R_SCORE_NONE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE_NONE", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* R_SCORE_HI16 */ + HOWTO (R_SCORE_HI16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 1, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + score_elf_hi16_reloc, /* special_function */ + "R_SCORE_HI16", /* name */ + TRUE, /* partial_inplace */ + 0x37fff, /* src_mask */ + 0x37fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* R_SCORE_LO16 */ + HOWTO (R_SCORE_LO16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 1, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + score_elf_lo16_reloc, /* special_function */ + "R_SCORE_LO16", /* name */ + TRUE, /* partial_inplace */ + 0x37fff, /* src_mask */ + 0x37fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* R_SCORE_DUMMY1 */ + HOWTO (R_SCORE_DUMMY1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 1, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE_DUMMY1", /* name */ + TRUE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /*R_SCORE_24 */ + HOWTO (R_SCORE_24, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + FALSE, /* pc_relative */ + 1, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE_24", /* name */ + FALSE, /* partial_inplace */ + 0x3ff7fff, /* src_mask */ + 0x3ff7fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /*R_SCORE_PC19 */ + HOWTO (R_SCORE_PC19, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + TRUE, /* pc_relative */ + 1, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE_PC19", /* name */ + FALSE, /* partial_inplace */ + 0x3ff03fe, /* src_mask */ + 0x3ff03fe, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /*R_SCORE16_11 */ + HOWTO (R_SCORE16_11, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 11, /* bitsize */ + FALSE, /* pc_relative */ + 1, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE16_11", /* name */ + FALSE, /* partial_inplace */ + 0x000000ffe, /* src_mask */ + 0x000000ffe, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* R_SCORE16_PC8 */ + HOWTO (R_SCORE16_PC8, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE16_PC8", /* name */ + FALSE, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* 32 bit absolute */ + HOWTO (R_SCORE_ABS32, /* type 8 */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE_ABS32", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* 16 bit absolute */ + HOWTO (R_SCORE_ABS16, /* type 11 */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE_ABS16", /* name */ + FALSE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* R_SCORE_DUMMY2 */ + HOWTO (R_SCORE_DUMMY2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE_DUMMY2", /* name */ + TRUE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* R_SCORE_GP15 */ + HOWTO (R_SCORE_GP15, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + score_elf_gprel15_reloc,/* special_function */ + "R_SCORE_GP15", /* name */ + TRUE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* GNU extension to record C++ vtable hierarchy. */ + HOWTO (R_SCORE_GNU_VTINHERIT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + NULL, /* special_function */ + "R_SCORE_GNU_VTINHERIT", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* GNU extension to record C++ vtable member usage */ + HOWTO (R_SCORE_GNU_VTENTRY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + _bfd_elf_rel_vtable_reloc_fn, /* special_function */ + "R_SCORE_GNU_VTENTRY", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Reference to global offset table. */ + HOWTO (R_SCORE_GOT15, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + score_elf_got15_reloc, /* special_function */ + "R_SCORE_GOT15", /* name */ + TRUE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Low 16 bits of displacement in global offset table. */ + HOWTO (R_SCORE_GOT_LO16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 1, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + score_elf_got_lo16_reloc, /* special_function */ + "R_SCORE_GOT_LO16", /* name */ + TRUE, /* partial_inplace */ + 0x37ffe, /* src_mask */ + 0x37ffe, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* 15 bit call through global offset table. */ + HOWTO (R_SCORE_CALL15, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE_CALL15", /* name */ + TRUE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* 32 bit GP relative reference. */ + HOWTO (R_SCORE_GPREL32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + score_elf_gprel32_reloc, /* special_function */ + "R_SCORE_GPREL32", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* 32 bit symbol relative relocation. */ + HOWTO (R_SCORE_REL32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE_REL32", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* R_SCORE_DUMMY_HI16 */ + HOWTO (R_SCORE_DUMMY_HI16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 1, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + score_elf_hi16_reloc, /* special_function */ + "R_SCORE_DUMMY_HI16", /* name */ + TRUE, /* partial_inplace */ + 0x37fff, /* src_mask */ + 0x37fff, /* dst_mask */ + FALSE), /* pcrel_offset */ +}; + +struct score_reloc_map +{ + bfd_reloc_code_real_type bfd_reloc_val; + unsigned char elf_reloc_val; +}; + +static const struct score_reloc_map elf32_score_reloc_map[] = +{ + {BFD_RELOC_NONE, R_SCORE_NONE}, + {BFD_RELOC_HI16_S, R_SCORE_HI16}, + {BFD_RELOC_LO16, R_SCORE_LO16}, + {BFD_RELOC_SCORE_DUMMY1, R_SCORE_DUMMY1}, + {BFD_RELOC_SCORE_JMP, R_SCORE_24}, + {BFD_RELOC_SCORE_BRANCH, R_SCORE_PC19}, + {BFD_RELOC_SCORE16_JMP, R_SCORE16_11}, + {BFD_RELOC_SCORE16_BRANCH, R_SCORE16_PC8}, + {BFD_RELOC_32, R_SCORE_ABS32}, + {BFD_RELOC_16, R_SCORE_ABS16}, + {BFD_RELOC_SCORE_DUMMY2, R_SCORE_DUMMY2}, + {BFD_RELOC_SCORE_GPREL15, R_SCORE_GP15}, + {BFD_RELOC_VTABLE_INHERIT, R_SCORE_GNU_VTINHERIT}, + {BFD_RELOC_VTABLE_ENTRY, R_SCORE_GNU_VTENTRY}, + {BFD_RELOC_SCORE_GOT15, R_SCORE_GOT15}, + {BFD_RELOC_SCORE_GOT_LO16, R_SCORE_GOT_LO16}, + {BFD_RELOC_SCORE_CALL15, R_SCORE_CALL15}, + {BFD_RELOC_GPREL32, R_SCORE_GPREL32}, + {BFD_RELOC_32_PCREL, R_SCORE_REL32}, + {BFD_RELOC_SCORE_DUMMY_HI16, R_SCORE_DUMMY_HI16}, +}; + +/* got_entries only match if they're identical, except for gotidx, so + use all fields to compute the hash, and compare the appropriate + union members. */ + +static hashval_t +score_elf_got_entry_hash (const void *entry_) +{ + const struct score_got_entry *entry = (struct score_got_entry *)entry_; + + return entry->symndx + + (!entry->abfd ? entry->d.address : entry->abfd->id); +} + +static int +score_elf_got_entry_eq (const void *entry1, const void *entry2) +{ + const struct score_got_entry *e1 = (struct score_got_entry *)entry1; + const struct score_got_entry *e2 = (struct score_got_entry *)entry2; + + return e1->abfd == e2->abfd && e1->symndx == e2->symndx + && (! e1->abfd ? e1->d.address == e2->d.address + : e1->symndx >= 0 ? e1->d.addend == e2->d.addend + : e1->d.h == e2->d.h); +} + +/* If H needs a GOT entry, assign it the highest available dynamic + index. Otherwise, assign it the lowest available dynamic + index. */ + +static bfd_boolean +score_elf_sort_hash_table_f (struct score_elf_link_hash_entry *h, void *data) +{ + struct score_elf_hash_sort_data *hsd = data; + + if (h->root.root.type == bfd_link_hash_warning) + h = (struct score_elf_link_hash_entry *) h->root.root.u.i.link; + + /* Symbols without dynamic symbol table entries aren't interesting at all. */ + if (h->root.dynindx == -1) + return TRUE; + + /* Global symbols that need GOT entries that are not explicitly + referenced are marked with got offset 2. Those that are + referenced get a 1, and those that don't need GOT entries get + -1. */ + if (h->root.got.offset == 2) + { + if (hsd->max_unref_got_dynindx == hsd->min_got_dynindx) + hsd->low = (struct elf_link_hash_entry *) h; + h->root.dynindx = hsd->max_unref_got_dynindx++; + } + else if (h->root.got.offset != 1) + h->root.dynindx = hsd->max_non_got_dynindx++; + else + { + h->root.dynindx = --hsd->min_got_dynindx; + hsd->low = (struct elf_link_hash_entry *) h; + } + + return TRUE; +} + +static asection * +score_elf_got_section (bfd *abfd, bfd_boolean maybe_excluded) +{ + asection *sgot = bfd_get_section_by_name (abfd, ".got"); + + if (sgot == NULL || (! maybe_excluded && (sgot->flags & SEC_EXCLUDE) != 0)) + return NULL; + return sgot; +} + +/* Returns the GOT information associated with the link indicated by + INFO. If SGOTP is non-NULL, it is filled in with the GOT section. */ + +static struct score_got_info * +score_elf_got_info (bfd *abfd, asection **sgotp) +{ + asection *sgot; + struct score_got_info *g; + + sgot = score_elf_got_section (abfd, TRUE); + BFD_ASSERT (sgot != NULL); + BFD_ASSERT (elf_section_data (sgot) != NULL); + g = score_elf_section_data (sgot)->u.got_info; + BFD_ASSERT (g != NULL); + + if (sgotp) + *sgotp = sgot; + return g; +} + +/* Sort the dynamic symbol table so that symbols that need GOT entries + appear towards the end. This reduces the amount of GOT space + required. MAX_LOCAL is used to set the number of local symbols + known to be in the dynamic symbol table. During + _bfd_score_elf_size_dynamic_sections, this value is 1. Afterward, the + section symbols are added and the count is higher. */ + +static bfd_boolean +score_elf_sort_hash_table (struct bfd_link_info *info, + unsigned long max_local) +{ + struct score_elf_hash_sort_data hsd; + struct score_got_info *g; + bfd *dynobj; + + dynobj = elf_hash_table (info)->dynobj; + + g = score_elf_got_info (dynobj, NULL); + + hsd.low = NULL; + hsd.max_unref_got_dynindx = + hsd.min_got_dynindx = elf_hash_table (info)->dynsymcount + /* In the multi-got case, assigned_gotno of the master got_info + indicate the number of entries that aren't referenced in the + primary GOT, but that must have entries because there are + dynamic relocations that reference it. Since they aren't + referenced, we move them to the end of the GOT, so that they + don't prevent other entries that are referenced from getting + too large offsets. */ + - (g->next ? g->assigned_gotno : 0); + hsd.max_non_got_dynindx = max_local; + score_elf_link_hash_traverse (((struct score_elf_link_hash_table *) + elf_hash_table (info)), + score_elf_sort_hash_table_f, + &hsd); + + /* There should have been enough room in the symbol table to + accommodate both the GOT and non-GOT symbols. */ + BFD_ASSERT (hsd.max_non_got_dynindx <= hsd.min_got_dynindx); + BFD_ASSERT ((unsigned long)hsd.max_unref_got_dynindx + <= elf_hash_table (info)->dynsymcount); + + /* Now we know which dynamic symbol has the lowest dynamic symbol + table index in the GOT. */ + g->global_gotsym = hsd.low; + + return TRUE; +} + +/* Create an entry in an score ELF linker hash table. */ + +static struct bfd_hash_entry * +score_elf_link_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) +{ + struct score_elf_link_hash_entry *ret = (struct score_elf_link_hash_entry *)entry; + + /* Allocate the structure if it has not already been allocated by a subclass. */ + if (ret == NULL) + ret = bfd_hash_allocate (table, sizeof (struct score_elf_link_hash_entry)); + if (ret == NULL) + return (struct bfd_hash_entry *)ret; + + /* Call the allocation method of the superclass. */ + ret = ((struct score_elf_link_hash_entry *) + _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *)ret, table, string)); + + if (ret != NULL) + { + ret->possibly_dynamic_relocs = 0; + ret->readonly_reloc = FALSE; + ret->no_fn_stub = FALSE; + ret->forced_local = FALSE; + } + + return (struct bfd_hash_entry *)ret; +} + +/* Returns the first relocation of type r_type found, beginning with + RELOCATION. RELEND is one-past-the-end of the relocation table. */ + +static const Elf_Internal_Rela * +score_elf_next_relocation (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type, + const Elf_Internal_Rela *relocation, + const Elf_Internal_Rela *relend) +{ + while (relocation < relend) + { + if (ELF32_R_TYPE (relocation->r_info) == r_type) + return relocation; + + ++relocation; + } + + /* We didn't find it. */ + bfd_set_error (bfd_error_bad_value); + return NULL; +} + +/* This function is called via qsort() to sort the dynamic relocation + entries by increasing r_symndx value. */ + +static int +score_elf_sort_dynamic_relocs (const void *arg1, const void *arg2) +{ + Elf_Internal_Rela int_reloc1; + Elf_Internal_Rela int_reloc2; + + bfd_elf32_swap_reloc_in (reldyn_sorting_bfd, arg1, &int_reloc1); + bfd_elf32_swap_reloc_in (reldyn_sorting_bfd, arg2, &int_reloc2); + + return (ELF32_R_SYM (int_reloc1.r_info) - ELF32_R_SYM (int_reloc2.r_info)); +} + +/* Return whether a relocation is against a local symbol. */ + +static bfd_boolean +score_elf_local_relocation_p (bfd *input_bfd, + const Elf_Internal_Rela *relocation, + asection **local_sections, + bfd_boolean check_forced) +{ + unsigned long r_symndx; + Elf_Internal_Shdr *symtab_hdr; + struct score_elf_link_hash_entry *h; + size_t extsymoff; + + r_symndx = ELF32_R_SYM (relocation->r_info); + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + extsymoff = (elf_bad_symtab (input_bfd)) ? 0 : symtab_hdr->sh_info; + + if (r_symndx < extsymoff) + return TRUE; + if (elf_bad_symtab (input_bfd) && local_sections[r_symndx] != NULL) + return TRUE; + + if (check_forced) + { + /* Look up the hash table to check whether the symbol was forced local. */ + h = (struct score_elf_link_hash_entry *) + elf_sym_hashes (input_bfd) [r_symndx - extsymoff]; + /* Find the real hash-table entry for this symbol. */ + while (h->root.root.type == bfd_link_hash_indirect + || h->root.root.type == bfd_link_hash_warning) + h = (struct score_elf_link_hash_entry *) h->root.root.u.i.link; + if (h->root.forced_local) + return TRUE; + } + + return FALSE; +} + +/* Returns the dynamic relocation section for DYNOBJ. */ + +static asection * +score_elf_rel_dyn_section (bfd *dynobj, bfd_boolean create_p) +{ + static const char dname[] = ".rel.dyn"; + asection *sreloc; + + sreloc = bfd_get_section_by_name (dynobj, dname); + if (sreloc == NULL && create_p) + { + sreloc = bfd_make_section_with_flags (dynobj, dname, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED + | SEC_READONLY)); + if (sreloc == NULL + || ! bfd_set_section_alignment (dynobj, sreloc, + SCORE_ELF_LOG_FILE_ALIGN (dynobj))) + return NULL; + } + return sreloc; +} + +static void +score_elf_allocate_dynamic_relocations (bfd *abfd, unsigned int n) +{ + asection *s; + + s = score_elf_rel_dyn_section (abfd, FALSE); + BFD_ASSERT (s != NULL); + + if (s->size == 0) + { + /* Make room for a null element. */ + s->size += SCORE_ELF_REL_SIZE (abfd); + ++s->reloc_count; + } + s->size += n * SCORE_ELF_REL_SIZE (abfd); +} + +/* Create a rel.dyn relocation for the dynamic linker to resolve. REL + is the original relocation, which is now being transformed into a + dynamic relocation. The ADDENDP is adjusted if necessary; the + caller should store the result in place of the original addend. */ + +static bfd_boolean +score_elf_create_dynamic_relocation (bfd *output_bfd, + struct bfd_link_info *info, + const Elf_Internal_Rela *rel, + struct score_elf_link_hash_entry *h, + bfd_vma symbol, + bfd_vma *addendp, asection *input_section) +{ + Elf_Internal_Rela outrel[3]; + asection *sreloc; + bfd *dynobj; + int r_type; + long indx; + bfd_boolean defined_p; + + r_type = ELF32_R_TYPE (rel->r_info); + dynobj = elf_hash_table (info)->dynobj; + sreloc = score_elf_rel_dyn_section (dynobj, FALSE); + BFD_ASSERT (sreloc != NULL); + BFD_ASSERT (sreloc->contents != NULL); + BFD_ASSERT (sreloc->reloc_count * SCORE_ELF_REL_SIZE (output_bfd) < sreloc->size); + + outrel[0].r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, rel[0].r_offset); + outrel[1].r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, rel[1].r_offset); + outrel[2].r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, rel[2].r_offset); + + if (outrel[0].r_offset == MINUS_ONE) + /* The relocation field has been deleted. */ + return TRUE; + + if (outrel[0].r_offset == MINUS_TWO) + { + /* The relocation field has been converted into a relative value of + some sort. Functions like _bfd_elf_write_section_eh_frame expect + the field to be fully relocated, so add in the symbol's value. */ + *addendp += symbol; + return TRUE; + } + + /* We must now calculate the dynamic symbol table index to use + in the relocation. */ + if (h != NULL + && (! info->symbolic || !h->root.def_regular) + /* h->root.dynindx may be -1 if this symbol was marked to + become local. */ + && h->root.dynindx != -1) + { + indx = h->root.dynindx; + /* ??? glibc's ld.so just adds the final GOT entry to the + relocation field. It therefore treats relocs against + defined symbols in the same way as relocs against + undefined symbols. */ + defined_p = FALSE; + } + else + { + indx = 0; + defined_p = TRUE; + } + + /* If the relocation was previously an absolute relocation and + this symbol will not be referred to by the relocation, we must + adjust it by the value we give it in the dynamic symbol table. + Otherwise leave the job up to the dynamic linker. */ + if (defined_p && r_type != R_SCORE_REL32) + *addendp += symbol; + + /* The relocation is always an REL32 relocation because we don't + know where the shared library will wind up at load-time. */ + outrel[0].r_info = ELF32_R_INFO ((unsigned long) indx, R_SCORE_REL32); + + /* For strict adherence to the ABI specification, we should + generate a R_SCORE_64 relocation record by itself before the + _REL32/_64 record as well, such that the addend is read in as + a 64-bit value (REL32 is a 32-bit relocation, after all). + However, since none of the existing ELF64 SCORE dynamic + loaders seems to care, we don't waste space with these + artificial relocations. If this turns out to not be true, + score_elf_allocate_dynamic_relocations() should be tweaked so + as to make room for a pair of dynamic relocations per + invocation if ABI_64_P, and here we should generate an + additional relocation record with R_SCORE_64 by itself for a + NULL symbol before this relocation record. */ + outrel[1].r_info = ELF32_R_INFO (0, R_SCORE_NONE); + outrel[2].r_info = ELF32_R_INFO (0, R_SCORE_NONE); + + /* Adjust the output offset of the relocation to reference the + correct location in the output file. */ + outrel[0].r_offset += (input_section->output_section->vma + + input_section->output_offset); + outrel[1].r_offset += (input_section->output_section->vma + + input_section->output_offset); + outrel[2].r_offset += (input_section->output_section->vma + + input_section->output_offset); + + /* Put the relocation back out. We have to use the special + relocation outputter in the 64-bit case since the 64-bit + relocation format is non-standard. */ + bfd_elf32_swap_reloc_out + (output_bfd, &outrel[0], + (sreloc->contents + sreloc->reloc_count * sizeof (Elf32_External_Rel))); + + /* We've now added another relocation. */ + ++sreloc->reloc_count; + + /* Make sure the output section is writable. The dynamic linker + will be writing to it. */ + elf_section_data (input_section->output_section)->this_hdr.sh_flags |= SHF_WRITE; + + return TRUE; +} + +static bfd_boolean +score_elf_create_got_section (bfd *abfd, + struct bfd_link_info *info, + bfd_boolean maybe_exclude) +{ + flagword flags; + asection *s; + struct elf_link_hash_entry *h; + struct bfd_link_hash_entry *bh; + struct score_got_info *g; + bfd_size_type amt; + + /* This function may be called more than once. */ + s = score_elf_got_section (abfd, TRUE); + if (s) + { + if (! maybe_exclude) + s->flags &= ~SEC_EXCLUDE; + return TRUE; + } + + flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); + + if (maybe_exclude) + flags |= SEC_EXCLUDE; + + /* We have to use an alignment of 2**4 here because this is hardcoded + in the function stub generation and in the linker script. */ + s = bfd_make_section_with_flags (abfd, ".got", flags); + if (s == NULL + || ! bfd_set_section_alignment (abfd, s, 4)) + return FALSE; + + /* Define the symbol _GLOBAL_OFFSET_TABLE_. We don't do this in the + linker script because we don't want to define the symbol if we + are not creating a global offset table. */ + bh = NULL; + if (! (_bfd_generic_link_add_one_symbol + (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s, + 0, NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh))) + return FALSE; + + h = (struct elf_link_hash_entry *) bh; + h->non_elf = 0; + h->def_regular = 1; + h->type = STT_OBJECT; + + if (info->shared && ! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + + amt = sizeof (struct score_got_info); + g = bfd_alloc (abfd, amt); + if (g == NULL) + return FALSE; + + g->global_gotsym = NULL; + g->global_gotno = 0; + + g->local_gotno = SCORE_RESERVED_GOTNO; + g->assigned_gotno = SCORE_RESERVED_GOTNO; + g->next = NULL; + + g->got_entries = htab_try_create (1, score_elf_got_entry_hash, + score_elf_got_entry_eq, NULL); + if (g->got_entries == NULL) + return FALSE; + score_elf_section_data (s)->u.got_info = g; + score_elf_section_data (s)->elf.this_hdr.sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_SCORE_GPREL; + + return TRUE; +} + +/* Calculate the %high function. */ + +static bfd_vma +score_elf_high (bfd_vma value) +{ + return ((value + (bfd_vma) 0x8000) >> 16) & 0xffff; +} + +/* Create a local GOT entry for VALUE. Return the index of the entry, + or -1 if it could not be created. */ + +static struct score_got_entry * +score_elf_create_local_got_entry (bfd *abfd, + bfd *ibfd ATTRIBUTE_UNUSED, + struct score_got_info *gg, + asection *sgot, bfd_vma value, + unsigned long r_symndx ATTRIBUTE_UNUSED, + struct score_elf_link_hash_entry *h ATTRIBUTE_UNUSED, + int r_type ATTRIBUTE_UNUSED) +{ + struct score_got_entry entry, **loc; + struct score_got_info *g; + + entry.abfd = NULL; + entry.symndx = -1; + entry.d.address = value; + + g = gg; + loc = (struct score_got_entry **) htab_find_slot (g->got_entries, &entry, INSERT); + if (*loc) + return *loc; + + entry.gotidx = SCORE_ELF_GOT_SIZE (abfd) * g->assigned_gotno++; + + *loc = bfd_alloc (abfd, sizeof entry); + + if (! *loc) + return NULL; + + memcpy (*loc, &entry, sizeof entry); + + if (g->assigned_gotno >= g->local_gotno) + { + (*loc)->gotidx = -1; + /* We didn't allocate enough space in the GOT. */ + (*_bfd_error_handler) + (_("not enough GOT space for local GOT entries")); + bfd_set_error (bfd_error_bad_value); + return NULL; + } + + bfd_put_32 (abfd, value, (sgot->contents + entry.gotidx)); + + return *loc; +} + +/* Find a GOT entry whose higher-order 16 bits are the same as those + for value. Return the index into the GOT for this entry. */ + +static bfd_vma +score_elf_got16_entry (bfd *abfd, bfd *ibfd, struct bfd_link_info *info, + bfd_vma value, bfd_boolean external) +{ + asection *sgot; + struct score_got_info *g; + struct score_got_entry *entry; + + if (!external) + { + /* Although the ABI says that it is "the high-order 16 bits" that we + want, it is really the %high value. The complete value is + calculated with a `addiu' of a LO16 relocation, just as with a + HI16/LO16 pair. */ + value = score_elf_high (value) << 16; + } + + g = score_elf_got_info (elf_hash_table (info)->dynobj, &sgot); + + entry = score_elf_create_local_got_entry (abfd, ibfd, g, sgot, value, 0, NULL, + R_SCORE_GOT15); + if (entry) + return entry->gotidx; + else + return MINUS_ONE; +} + +static void +_bfd_score_elf_hide_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *entry, + bfd_boolean force_local) +{ + bfd *dynobj; + asection *got; + struct score_got_info *g; + struct score_elf_link_hash_entry *h; + + h = (struct score_elf_link_hash_entry *) entry; + if (h->forced_local) + return; + h->forced_local = TRUE; + + dynobj = elf_hash_table (info)->dynobj; + if (dynobj != NULL && force_local) + { + got = score_elf_got_section (dynobj, FALSE); + if (got == NULL) + return; + g = score_elf_section_data (got)->u.got_info; + + if (g->next) + { + struct score_got_entry e; + struct score_got_info *gg = g; + + /* Since we're turning what used to be a global symbol into a + local one, bump up the number of local entries of each GOT + that had an entry for it. This will automatically decrease + the number of global entries, since global_gotno is actually + the upper limit of global entries. */ + e.abfd = dynobj; + e.symndx = -1; + e.d.h = h; + + for (g = g->next; g != gg; g = g->next) + if (htab_find (g->got_entries, &e)) + { + BFD_ASSERT (g->global_gotno > 0); + g->local_gotno++; + g->global_gotno--; + } + + /* If this was a global symbol forced into the primary GOT, we + no longer need an entry for it. We can't release the entry + at this point, but we must at least stop counting it as one + of the symbols that required a forced got entry. */ + if (h->root.got.offset == 2) + { + BFD_ASSERT (gg->assigned_gotno > 0); + gg->assigned_gotno--; + } + } + else if (g->global_gotno == 0 && g->global_gotsym == NULL) + /* If we haven't got through GOT allocation yet, just bump up the + number of local entries, as this symbol won't be counted as + global. */ + g->local_gotno++; + else if (h->root.got.offset == 1) + { + /* If we're past non-multi-GOT allocation and this symbol had + been marked for a global got entry, give it a local entry + instead. */ + BFD_ASSERT (g->global_gotno > 0); + g->local_gotno++; + g->global_gotno--; + } + } + + _bfd_elf_link_hash_hide_symbol (info, &h->root, force_local); +} + +/* If H is a symbol that needs a global GOT entry, but has a dynamic + symbol table index lower than any we've seen to date, record it for + posterity. */ + +static bfd_boolean +score_elf_record_global_got_symbol (struct elf_link_hash_entry *h, + bfd *abfd, + struct bfd_link_info *info, + struct score_got_info *g) +{ + struct score_got_entry entry, **loc; + + /* A global symbol in the GOT must also be in the dynamic symbol table. */ + if (h->dynindx == -1) + { + switch (ELF_ST_VISIBILITY (h->other)) + { + case STV_INTERNAL: + case STV_HIDDEN: + _bfd_score_elf_hide_symbol (info, h, TRUE); + break; + } + if (!bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + } + + entry.abfd = abfd; + entry.symndx = -1; + entry.d.h = (struct score_elf_link_hash_entry *)h; + + loc = (struct score_got_entry **)htab_find_slot (g->got_entries, &entry, INSERT); + + /* If we've already marked this entry as needing GOT space, we don't + need to do it again. */ + if (*loc) + return TRUE; + + *loc = bfd_alloc (abfd, sizeof entry); + if (! *loc) + return FALSE; + + entry.gotidx = -1; + + memcpy (*loc, &entry, sizeof (entry)); + + if (h->got.offset != MINUS_ONE) + return TRUE; + + /* By setting this to a value other than -1, we are indicating that + there needs to be a GOT entry for H. Avoid using zero, as the + generic ELF copy_indirect_symbol tests for <= 0. */ + h->got.offset = 1; + + return TRUE; +} + +/* Reserve space in G for a GOT entry containing the value of symbol + SYMNDX in input bfd ABDF, plus ADDEND. */ + +static bfd_boolean +score_elf_record_local_got_symbol (bfd *abfd, + long symndx, + bfd_vma addend, + struct score_got_info *g) +{ + struct score_got_entry entry, **loc; + + entry.abfd = abfd; + entry.symndx = symndx; + entry.d.addend = addend; + loc = (struct score_got_entry **)htab_find_slot (g->got_entries, &entry, INSERT); + + if (*loc) + return TRUE; + + entry.gotidx = g->local_gotno++; + + *loc = bfd_alloc (abfd, sizeof(entry)); + if (! *loc) + return FALSE; + + memcpy (*loc, &entry, sizeof (entry)); + + return TRUE; +} + +/* Returns the GOT offset at which the indicated address can be found. + If there is not yet a GOT entry for this value, create one. + Returns -1 if no satisfactory GOT offset can be found. */ + +static bfd_vma +score_elf_local_got_index (bfd *abfd, bfd *ibfd, struct bfd_link_info *info, + bfd_vma value, unsigned long r_symndx, + struct score_elf_link_hash_entry *h, int r_type) +{ + asection *sgot; + struct score_got_info *g; + struct score_got_entry *entry; + + g = score_elf_got_info (elf_hash_table (info)->dynobj, &sgot); + + entry = score_elf_create_local_got_entry (abfd, ibfd, g, sgot, value, + r_symndx, h, r_type); + if (!entry) + return MINUS_ONE; + + else + return entry->gotidx; +} + +/* Returns the GOT index for the global symbol indicated by H. */ + +static bfd_vma +score_elf_global_got_index (bfd *abfd, struct elf_link_hash_entry *h) +{ + bfd_vma index; + asection *sgot; + struct score_got_info *g; + long global_got_dynindx = 0; + + g = score_elf_got_info (abfd, &sgot); + if (g->global_gotsym != NULL) + global_got_dynindx = g->global_gotsym->dynindx; + + /* Once we determine the global GOT entry with the lowest dynamic + symbol table index, we must put all dynamic symbols with greater + indices into the GOT. That makes it easy to calculate the GOT + offset. */ + BFD_ASSERT (h->dynindx >= global_got_dynindx); + index = ((h->dynindx - global_got_dynindx + g->local_gotno) * SCORE_ELF_GOT_SIZE (abfd)); + BFD_ASSERT (index < sgot->size); + + return index; +} + +/* Returns the offset for the entry at the INDEXth position in the GOT. */ + +static bfd_vma +score_elf_got_offset_from_index (bfd *dynobj, bfd *output_bfd, + bfd *input_bfd ATTRIBUTE_UNUSED, bfd_vma index) +{ + asection *sgot; + bfd_vma gp; + struct score_got_info *g; + + g = score_elf_got_info (dynobj, &sgot); + gp = _bfd_get_gp_value (output_bfd); + + return sgot->output_section->vma + sgot->output_offset + index - gp; +} + +/* Follow indirect and warning hash entries so that each got entry + points to the final symbol definition. P must point to a pointer + to the hash table we're traversing. Since this traversal may + modify the hash table, we set this pointer to NULL to indicate + we've made a potentially-destructive change to the hash table, so + the traversal must be restarted. */ +static int +score_elf_resolve_final_got_entry (void **entryp, void *p) +{ + struct score_got_entry *entry = (struct score_got_entry *)*entryp; + htab_t got_entries = *(htab_t *)p; + + if (entry->abfd != NULL && entry->symndx == -1) + { + struct score_elf_link_hash_entry *h = entry->d.h; + + while (h->root.root.type == bfd_link_hash_indirect + || h->root.root.type == bfd_link_hash_warning) + h = (struct score_elf_link_hash_entry *) h->root.root.u.i.link; + + if (entry->d.h == h) + return 1; + + entry->d.h = h; + + /* If we can't find this entry with the new bfd hash, re-insert + it, and get the traversal restarted. */ + if (! htab_find (got_entries, entry)) + { + htab_clear_slot (got_entries, entryp); + entryp = htab_find_slot (got_entries, entry, INSERT); + if (! *entryp) + *entryp = entry; + /* Abort the traversal, since the whole table may have + moved, and leave it up to the parent to restart the + process. */ + *(htab_t *)p = NULL; + return 0; + } + /* We might want to decrement the global_gotno count, but it's + either too early or too late for that at this point. */ + } + + return 1; +} + +/* Turn indirect got entries in a got_entries table into their final locations. */ +static void +score_elf_resolve_final_got_entries (struct score_got_info *g) +{ + htab_t got_entries; + + do + { + got_entries = g->got_entries; + + htab_traverse (got_entries, + score_elf_resolve_final_got_entry, + &got_entries); + } + while (got_entries == NULL); +} + +/* Add INCREMENT to the reloc (of type HOWTO) at ADDRESS. for -r */ + +static void +score_elf_add_to_rel (bfd *abfd, + bfd_byte *address, + reloc_howto_type *howto, + bfd_signed_vma increment) +{ + bfd_signed_vma addend; + bfd_vma contents; + unsigned long offset; + unsigned long r_type = howto->type; + unsigned long hi16_addend, hi16_offset, hi16_value, uvalue; + + contents = bfd_get_32 (abfd, address); + /* Get the (signed) value from the instruction. */ + addend = contents & howto->src_mask; + if (addend & ((howto->src_mask + 1) >> 1)) + { + bfd_signed_vma mask; + + mask = -1; + mask &= ~howto->src_mask; + addend |= mask; + } + /* Add in the increment, (which is a byte value). */ + switch (r_type) + { + case R_SCORE_PC19: + offset = + (((contents & howto->src_mask) & 0x3ff0000) >> 6) | ((contents & howto->src_mask) & 0x3ff); + offset += increment; + contents = + (contents & ~howto-> + src_mask) | (((offset << 6) & howto->src_mask) & 0x3ff0000) | (offset & 0x3ff); + bfd_put_32 (abfd, contents, address); + break; + case R_SCORE_HI16: + break; + case R_SCORE_LO16: + hi16_addend = bfd_get_32 (abfd, address - 4); + hi16_offset = ((((hi16_addend >> 16) & 0x3) << 15) | (hi16_addend & 0x7fff)) >> 1; + offset = ((((contents >> 16) & 0x3) << 15) | (contents & 0x7fff)) >> 1; + offset = (hi16_offset << 16) | (offset & 0xffff); + uvalue = increment + offset; + hi16_offset = (uvalue >> 16) << 1; + hi16_value = (hi16_addend & (~(howto->dst_mask))) + | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000); + bfd_put_32 (abfd, hi16_value, address - 4); + offset = (uvalue & 0xffff) << 1; + contents = (contents & (~(howto->dst_mask))) | (offset & 0x7fff) | ((offset << 1) & 0x30000); + bfd_put_32 (abfd, contents, address); + break; + case R_SCORE_24: + offset = + (((contents & howto->src_mask) >> 1) & 0x1ff8000) | ((contents & howto->src_mask) & 0x7fff); + offset += increment; + contents = + (contents & ~howto-> + src_mask) | (((offset << 1) & howto->src_mask) & 0x3ff0000) | (offset & 0x7fff); + bfd_put_32 (abfd, contents, address); + break; + case R_SCORE16_11: + + contents = bfd_get_16 (abfd, address); + offset = contents & howto->src_mask; + offset += increment; + contents = (contents & ~howto->src_mask) | (offset & howto->src_mask); + bfd_put_16 (abfd, contents, address); + + break; + case R_SCORE16_PC8: + + contents = bfd_get_16 (abfd, address); + offset = (contents & howto->src_mask) + ((increment >> 1) & 0xff); + contents = (contents & (~howto->src_mask)) | (offset & howto->src_mask); + bfd_put_16 (abfd, contents, address); + + break; + default: + addend += increment; + contents = (contents & ~howto->dst_mask) | (addend & howto->dst_mask); + bfd_put_32 (abfd, contents, address); + break; + } +} + +/* Perform a relocation as part of a final link. */ + +static bfd_reloc_status_type +score_elf_final_link_relocate (reloc_howto_type *howto, + bfd *input_bfd, + bfd *output_bfd, + asection *input_section, + bfd_byte *contents, + Elf_Internal_Rela *rel, + Elf_Internal_Rela *relocs, + bfd_vma symbol, + struct bfd_link_info *info, + const char *sym_name ATTRIBUTE_UNUSED, + int sym_flags ATTRIBUTE_UNUSED, + struct score_elf_link_hash_entry *h, + asection **local_sections, + bfd_boolean gp_disp_p) +{ + unsigned long r_type; + unsigned long r_symndx; + bfd_byte *hit_data = contents + rel->r_offset; + bfd_vma addend; + /* The final GP value to be used for the relocatable, executable, or + shared object file being produced. */ + bfd_vma gp = MINUS_ONE; + /* The place (section offset or address) of the storage unit being relocated. */ + bfd_vma rel_addr; + /* The value of GP used to create the relocatable object. */ + bfd_vma gp0 = MINUS_ONE; + /* The offset into the global offset table at which the address of the relocation entry + symbol, adjusted by the addend, resides during execution. */ + bfd_vma g = MINUS_ONE; + /* TRUE if the symbol referred to by this relocation is a local symbol. */ + bfd_boolean local_p; + /* The eventual value we will relocate. */ + bfd_vma value = symbol; + unsigned long hi16_addend, hi16_offset, hi16_value, uvalue, offset, abs_value = 0; + + if (elf_gp (output_bfd) == 0) + { + struct bfd_link_hash_entry *bh; + asection *o; + + bh = bfd_link_hash_lookup (info->hash, "_gp", 0, 0, 1); + if (bh != (struct bfd_link_hash_entry *)NULL && bh->type == bfd_link_hash_defined) + elf_gp (output_bfd) = (bh->u.def.value + + bh->u.def.section->output_section->vma + + bh->u.def.section->output_offset); + else if (info->relocatable) + { + bfd_vma lo = -1; + + /* Find the GP-relative section with the lowest offset. */ + for (o = output_bfd->sections; o != (asection *) NULL; o = o->next) + if (o->vma < lo) + lo = o->vma; + /* And calculate GP relative to that. */ + elf_gp (output_bfd) = lo + ELF_SCORE_GP_OFFSET (input_bfd); + } + else + { + /* If the relocate_section function needs to do a reloc + involving the GP value, it should make a reloc_dangerous + callback to warn that GP is not defined. */ + } + } + + /* Parse the relocation. */ + r_symndx = ELF32_R_SYM (rel->r_info); + r_type = ELF32_R_TYPE (rel->r_info); + rel_addr = (input_section->output_section->vma + input_section->output_offset + rel->r_offset); + local_p = score_elf_local_relocation_p (input_bfd, rel, local_sections, TRUE); + + if (r_type == R_SCORE_GOT15) + { + const Elf_Internal_Rela *relend; + const Elf_Internal_Rela *lo16_rel; + const struct elf_backend_data *bed; + bfd_vma lo_value = 0; + + bed = get_elf_backend_data (output_bfd); + relend = relocs + input_section->reloc_count * bed->s->int_rels_per_ext_rel; + lo16_rel = score_elf_next_relocation (input_bfd, R_SCORE_GOT_LO16, rel, relend); + if ((local_p) && (lo16_rel != NULL)) + { + bfd_vma tmp = 0; + tmp = bfd_get_32 (input_bfd, contents + lo16_rel->r_offset); + lo_value = (((tmp >> 16) & 0x3) << 14) | ((tmp & 0x7fff) >> 1); + } + addend = lo_value; + } + else + { + addend = (bfd_get_32 (input_bfd, hit_data) >> howto->bitpos) & howto->src_mask; + } + + /* If we haven't already determined the GOT offset, or the GP value, + and we're going to need it, get it now. */ + switch (r_type) + { + case R_SCORE_CALL15: + case R_SCORE_GOT15: + if (!local_p) + { + g = score_elf_global_got_index (elf_hash_table (info)->dynobj, + (struct elf_link_hash_entry *) h); + if ((! elf_hash_table(info)->dynamic_sections_created + || (info->shared + && (info->symbolic || h->root.dynindx == -1) + && h->root.def_regular))) + { + /* This is a static link or a -Bsymbolic link. The + symbol is defined locally, or was forced to be local. + We must initialize this entry in the GOT. */ + bfd *tmpbfd = elf_hash_table (info)->dynobj; + asection *sgot = score_elf_got_section (tmpbfd, FALSE); + bfd_put_32 (tmpbfd, value, sgot->contents + g); + } + } + else if (r_type == R_SCORE_GOT15 || r_type == R_SCORE_CALL15) + { + /* There's no need to create a local GOT entry here; the + calculation for a local GOT15 entry does not involve G. */ + ; + } + else + { + g = score_elf_local_got_index (output_bfd, input_bfd, info, + symbol + addend, r_symndx, h, r_type); + if (g == MINUS_ONE) + return bfd_reloc_outofrange; + } + + /* Convert GOT indices to actual offsets. */ + g = score_elf_got_offset_from_index (elf_hash_table (info)->dynobj, + output_bfd, input_bfd, g); + break; + + case R_SCORE_HI16: + case R_SCORE_LO16: + case R_SCORE_GPREL32: + gp0 = _bfd_get_gp_value (input_bfd); + gp = _bfd_get_gp_value (output_bfd); + break; + + case R_SCORE_GP15: + gp = _bfd_get_gp_value (output_bfd); + + default: + break; + } + + switch (r_type) + { + case R_SCORE_NONE: + return bfd_reloc_ok; + + case R_SCORE_ABS32: + case R_SCORE_REL32: + if ((info->shared + || (elf_hash_table (info)->dynamic_sections_created + && h != NULL + && h->root.def_dynamic + && !h->root.def_regular)) + && r_symndx != 0 + && (input_section->flags & SEC_ALLOC) != 0) + { + /* If we're creating a shared library, or this relocation is against a symbol + in a shared library, then we can't know where the symbol will end up. + So, we create a relocation record in the output, and leave the job up + to the dynamic linker. */ + value = addend; + if (!score_elf_create_dynamic_relocation (output_bfd, info, rel, h, + symbol, &value, + input_section)) + return bfd_reloc_undefined; + } + else + { + if (r_type != R_SCORE_REL32) + value = symbol + addend; + else + value = addend; + } + value &= howto->dst_mask; + bfd_put_32 (input_bfd, value, hit_data); + return bfd_reloc_ok; + + case R_SCORE_ABS16: + value += addend; + if ((long)value > 0x7fff || (long)value < -0x8000) + return bfd_reloc_overflow; + bfd_put_16 (input_bfd, value, hit_data); + return bfd_reloc_ok; + + case R_SCORE_24: + addend = bfd_get_32 (input_bfd, hit_data); + offset = (((addend & howto->src_mask) >> 1) & 0x1ff8000) | ((addend & howto->src_mask) & 0x7fff); + if ((offset & 0x1000000) != 0) + offset |= 0xfe000000; + value += offset; + addend = (addend & ~howto->src_mask) + | (((value << 1) & howto->src_mask) & 0x3ff0000) | (value & 0x7fff); + bfd_put_32 (input_bfd, addend, hit_data); + return bfd_reloc_ok; + + case R_SCORE_PC19: + addend = bfd_get_32 (input_bfd, hit_data); + offset = (((addend & howto->src_mask) & 0x3ff0000) >> 6) | ((addend & howto->src_mask) & 0x3ff); + if ((offset & 0x80000) != 0) + offset |= 0xfff00000; + abs_value = value = value - rel_addr + offset; + /* exceed 20 bit : overflow. */ + if ((abs_value & 0x80000000) == 0x80000000) + abs_value = 0xffffffff - value + 1; + if ((abs_value & 0xfff80000) != 0) + return bfd_reloc_overflow; + addend = (addend & ~howto->src_mask) + | (((value << 6) & howto->src_mask) & 0x3ff0000) | (value & 0x3ff); + bfd_put_32 (input_bfd, addend, hit_data); + return bfd_reloc_ok; + + case R_SCORE16_11: + addend = bfd_get_16 (input_bfd, hit_data); + offset = addend & howto->src_mask; + if ((offset & 0x800) != 0) /* Offset is negative. */ + offset |= 0xfffff000; + value += offset; + addend = (addend & ~howto->src_mask) | (value & howto->src_mask); + bfd_put_16 (input_bfd, addend, hit_data); + return bfd_reloc_ok; + + case R_SCORE16_PC8: + addend = bfd_get_16 (input_bfd, hit_data); + offset = (addend & howto->src_mask) << 1; + if ((offset & 0x100) != 0) /* Offset is negative. */ + offset |= 0xfffffe00; + abs_value = value = value - rel_addr + offset; + /* Sign bit + exceed 9 bit. */ + if (((value & 0xffffff00) != 0) && ((value & 0xffffff00) != 0xffffff00)) + return bfd_reloc_overflow; + value >>= 1; + addend = (addend & ~howto->src_mask) | (value & howto->src_mask); + bfd_put_16 (input_bfd, addend, hit_data); + return bfd_reloc_ok; + + case R_SCORE_HI16: + return bfd_reloc_ok; + + case R_SCORE_LO16: + hi16_addend = bfd_get_32 (input_bfd, hit_data - 4); + hi16_offset = ((((hi16_addend >> 16) & 0x3) << 15) | (hi16_addend & 0x7fff)) >> 1; + addend = bfd_get_32 (input_bfd, hit_data); + offset = ((((addend >> 16) & 0x3) << 15) | (addend & 0x7fff)) >> 1; + offset = (hi16_offset << 16) | (offset & 0xffff); + + if (!gp_disp_p) + uvalue = value + offset; + else + uvalue = offset + gp - rel_addr + 4; + + hi16_offset = (uvalue >> 16) << 1; + hi16_value = (hi16_addend & (~(howto->dst_mask))) + | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000); + bfd_put_32 (input_bfd, hi16_value, hit_data - 4); + offset = (uvalue & 0xffff) << 1; + value = (addend & (~(howto->dst_mask))) | (offset & 0x7fff) | ((offset << 1) & 0x30000); + bfd_put_32 (input_bfd, value, hit_data); + return bfd_reloc_ok; + + case R_SCORE_GP15: + addend = bfd_get_32 (input_bfd, hit_data); + offset = addend & 0x7fff; + if ((offset & 0x4000) == 0x4000) + offset |= 0xffffc000; + value = value + offset - gp; + if (((value & 0xffffc000) != 0) && ((value & 0xffffc000) != 0xffffc000)) + return bfd_reloc_overflow; + value = (addend & ~howto->src_mask) | (value & howto->src_mask); + bfd_put_32 (input_bfd, value, hit_data); + return bfd_reloc_ok; + + case R_SCORE_GOT15: + case R_SCORE_CALL15: + if (local_p) + { + bfd_boolean forced; + + /* The special case is when the symbol is forced to be local. We need the + full address in the GOT since no R_SCORE_GOT_LO16 relocation follows. */ + forced = ! score_elf_local_relocation_p (input_bfd, rel, + local_sections, FALSE); + value = score_elf_got16_entry (output_bfd, input_bfd, info, + symbol + addend, forced); + if (value == MINUS_ONE) + return bfd_reloc_outofrange; + value = score_elf_got_offset_from_index (elf_hash_table (info)->dynobj, + output_bfd, input_bfd, value); + } + else + { + value = g; + } + + if ((long) value > 0x3fff || (long) value < -0x4000) + return bfd_reloc_overflow; + + addend = bfd_get_32 (input_bfd, hit_data); + value = (addend & ~howto->dst_mask) | (value & howto->dst_mask); + bfd_put_32 (input_bfd, value, hit_data); + return bfd_reloc_ok; + + case R_SCORE_GPREL32: + value = (addend + symbol - gp); + value &= howto->dst_mask; + bfd_put_32 (input_bfd, value, hit_data); + return bfd_reloc_ok; + + case R_SCORE_GOT_LO16: + addend = bfd_get_32 (input_bfd, hit_data); + value = (((addend >> 16) & 0x3) << 14) | ((addend & 0x7fff) >> 1); + value += symbol; + value = (addend & (~(howto->dst_mask))) | ((value & 0x3fff) << 1) + | (((value >> 14) & 0x3) << 16); + + bfd_put_32 (input_bfd, value, hit_data); + return bfd_reloc_ok; + + case R_SCORE_DUMMY_HI16: + return bfd_reloc_ok; + + case R_SCORE_GNU_VTINHERIT: + case R_SCORE_GNU_VTENTRY: + /* We don't do anything with these at present. */ + return bfd_reloc_continue; + + default: + return bfd_reloc_notsupported; + } +} + +/* Score backend functions. */ + +static void +_bfd_score_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, + arelent *bfd_reloc, + Elf_Internal_Rela *elf_reloc) +{ + unsigned int r_type; + + r_type = ELF32_R_TYPE (elf_reloc->r_info); + if (r_type >= NUM_ELEM (elf32_score_howto_table)) + bfd_reloc->howto = NULL; + else + bfd_reloc->howto = &elf32_score_howto_table[r_type]; +} + +/* Relocate an score ELF section. */ + +static bfd_boolean +_bfd_score_elf_relocate_section (bfd *output_bfd, + struct bfd_link_info *info, + bfd *input_bfd, + asection *input_section, + bfd_byte *contents, + Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, + asection **local_sections) +{ + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + Elf_Internal_Rela *rel; + Elf_Internal_Rela *relend; + const char *name; + unsigned long offset; + unsigned long hi16_addend, hi16_offset, hi16_value, uvalue; + size_t extsymoff; + bfd_boolean gp_disp_p = FALSE; + + /* Sort dynsym. */ + if (elf_hash_table (info)->dynamic_sections_created) + { + bfd_size_type dynsecsymcount = 0; + if (info->shared) + { + asection * p; + const struct elf_backend_data *bed = get_elf_backend_data (output_bfd); + + for (p = output_bfd->sections; p ; p = p->next) + if ((p->flags & SEC_EXCLUDE) == 0 + && (p->flags & SEC_ALLOC) != 0 + && !(*bed->elf_backend_omit_section_dynsym) (output_bfd, info, p)) + ++ dynsecsymcount; + } + + if (!score_elf_sort_hash_table (info, dynsecsymcount + 1)) + return FALSE; + } + + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + extsymoff = (elf_bad_symtab (input_bfd)) ? 0 : symtab_hdr->sh_info; + sym_hashes = elf_sym_hashes (input_bfd); + rel = relocs; + relend = relocs + input_section->reloc_count; + for (; rel < relend; rel++) + { + int r_type; + reloc_howto_type *howto; + unsigned long r_symndx; + Elf_Internal_Sym *sym; + asection *sec; + struct score_elf_link_hash_entry *h; + bfd_vma relocation = 0; + bfd_reloc_status_type r; + arelent bfd_reloc; + + r_symndx = ELF32_R_SYM (rel->r_info); + r_type = ELF32_R_TYPE (rel->r_info); + + _bfd_score_info_to_howto (input_bfd, &bfd_reloc, (Elf_Internal_Rela *) rel); + howto = bfd_reloc.howto; + + h = NULL; + sym = NULL; + sec = NULL; + + if (r_symndx < extsymoff) + { + sym = local_syms + r_symndx; + sec = local_sections[r_symndx]; + relocation = (sec->output_section->vma + + sec->output_offset + + sym->st_value); + name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym, sec); + + if (!info->relocatable + && (sec->flags & SEC_MERGE) != 0 + && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + asection *msec; + bfd_vma addend, value; + + switch (r_type) + { + case R_SCORE_HI16: + break; + case R_SCORE_LO16: + hi16_addend = bfd_get_32 (input_bfd, contents + rel->r_offset - 4); + hi16_offset = ((((hi16_addend >> 16) & 0x3) << 15) | (hi16_addend & 0x7fff)) >> 1; + value = bfd_get_32 (input_bfd, contents + rel->r_offset); + offset = ((((value >> 16) & 0x3) << 15) | (value & 0x7fff)) >> 1; + addend = (hi16_offset << 16) | (offset & 0xffff); + msec = sec; + addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend); + addend -= relocation; + addend += msec->output_section->vma + msec->output_offset; + uvalue = addend; + hi16_offset = (uvalue >> 16) << 1; + hi16_value = (hi16_addend & (~(howto->dst_mask))) + | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000); + bfd_put_32 (input_bfd, hi16_value, contents + rel->r_offset - 4); + offset = (uvalue & 0xffff) << 1; + value = (value & (~(howto->dst_mask))) + | (offset & 0x7fff) | ((offset << 1) & 0x30000); + bfd_put_32 (input_bfd, value, contents + rel->r_offset); + break; + case R_SCORE_GOT_LO16: + value = bfd_get_32 (input_bfd, contents + rel->r_offset); + addend = (((value >> 16) & 0x3) << 14) | ((value & 0x7fff) >> 1); + msec = sec; + addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend) - relocation; + addend += msec->output_section->vma + msec->output_offset; + value = (value & (~(howto->dst_mask))) | ((addend & 0x3fff) << 1) + | (((addend >> 14) & 0x3) << 16); + + bfd_put_32 (input_bfd, value, contents + rel->r_offset); + break; + default: + value = bfd_get_32 (input_bfd, contents + rel->r_offset); + /* Get the (signed) value from the instruction. */ + addend = value & howto->src_mask; + if (addend & ((howto->src_mask + 1) >> 1)) + { + bfd_signed_vma mask; + + mask = -1; + mask &= ~howto->src_mask; + addend |= mask; + } + msec = sec; + addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend) - relocation; + addend += msec->output_section->vma + msec->output_offset; + value = (value & ~howto->dst_mask) | (addend & howto->dst_mask); + bfd_put_32 (input_bfd, value, contents + rel->r_offset); + break; + } + } + } + else + { + /* For global symbols we look up the symbol in the hash-table. */ + h = ((struct score_elf_link_hash_entry *) + elf_sym_hashes (input_bfd) [r_symndx - extsymoff]); + /* Find the real hash-table entry for this symbol. */ + while (h->root.root.type == bfd_link_hash_indirect + || h->root.root.type == bfd_link_hash_warning) + h = (struct score_elf_link_hash_entry *) h->root.root.u.i.link; + + /* Record the name of this symbol, for our caller. */ + name = h->root.root.root.string; + + /* See if this is the special GP_DISP_LABEL symbol. Note that such a + symbol must always be a global symbol. */ + if (strcmp (name, GP_DISP_LABEL) == 0) + { + /* Relocations against GP_DISP_LABEL are permitted only with + R_SCORE_HI16 and R_SCORE_LO16 relocations. */ + if (r_type != R_SCORE_HI16 && r_type != R_SCORE_LO16) + return bfd_reloc_notsupported; + + gp_disp_p = TRUE; + } + + /* If this symbol is defined, calculate its address. Note that + GP_DISP_LABEL is a magic symbol, always implicitly defined by the + linker, so it's inappropriate to check to see whether or not + its defined. */ + else if ((h->root.root.type == bfd_link_hash_defined + || h->root.root.type == bfd_link_hash_defweak) + && h->root.root.u.def.section) + { + sec = h->root.root.u.def.section; + if (sec->output_section) + relocation = (h->root.root.u.def.value + + sec->output_section->vma + + sec->output_offset); + else + { + relocation = h->root.root.u.def.value; + } + } + else if (h->root.root.type == bfd_link_hash_undefweak) + /* We allow relocations against undefined weak symbols, giving + it the value zero, so that you can undefined weak functions + and check to see if they exist by looking at their addresses. */ + relocation = 0; + else if (info->unresolved_syms_in_objects == RM_IGNORE + && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT) + relocation = 0; + else if (strcmp (name, "_DYNAMIC_LINK") == 0) + { + /* If this is a dynamic link, we should have created a _DYNAMIC_LINK symbol + in _bfd_score_elf_create_dynamic_sections. Otherwise, we should define + the symbol with a value of 0. */ + BFD_ASSERT (! info->shared); + BFD_ASSERT (bfd_get_section_by_name (output_bfd, ".dynamic") == NULL); + relocation = 0; + } + else if (!info->relocatable) + { + if (! ((*info->callbacks->undefined_symbol) + (info, h->root.root.root.string, input_bfd, + input_section, rel->r_offset, + (info->unresolved_syms_in_objects == RM_GENERATE_ERROR) + || ELF_ST_VISIBILITY (h->root.other)))) + return bfd_reloc_undefined; + relocation = 0; + } + } + + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + { + /* This is a relocatable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + score_elf_add_to_rel (input_bfd, contents + rel->r_offset, + howto, (bfd_signed_vma) sec->output_offset); + continue; + } + + r = score_elf_final_link_relocate (howto, input_bfd, output_bfd, + input_section, contents, rel, relocs, + relocation, info, name, + (h ? ELF_ST_TYPE ((unsigned int)h->root.root.type) : + ELF_ST_TYPE ((unsigned int)sym->st_info)), h, local_sections, + gp_disp_p); + + if (r != bfd_reloc_ok) + { + const char *msg = (const char *)0; + + switch (r) + { + case bfd_reloc_overflow: + /* If the overflowing reloc was to an undefined symbol, + we have already printed one error message and there + is no point complaining again. */ + if (((!h) || (h->root.root.type != bfd_link_hash_undefined)) + && (!((*info->callbacks->reloc_overflow) + (info, NULL, name, howto->name, (bfd_vma) 0, + input_bfd, input_section, rel->r_offset)))) + return FALSE; + break; + case bfd_reloc_undefined: + if (!((*info->callbacks->undefined_symbol) + (info, name, input_bfd, input_section, rel->r_offset, TRUE))) + return FALSE; + break; + + case bfd_reloc_outofrange: + msg = _("internal error: out of range error"); + goto common_error; + + case bfd_reloc_notsupported: + msg = _("internal error: unsupported relocation error"); + goto common_error; + + case bfd_reloc_dangerous: + msg = _("internal error: dangerous error"); + goto common_error; + + default: + msg = _("internal error: unknown error"); + /* fall through */ + + common_error: + if (!((*info->callbacks->warning) + (info, msg, name, input_bfd, input_section, rel->r_offset))) + return FALSE; + break; + } + } + } + + return TRUE; +} + +/* Look through the relocs for a section during the first phase, and + allocate space in the global offset table. */ + +static bfd_boolean +_bfd_score_elf_check_relocs (bfd *abfd, + struct bfd_link_info *info, + asection *sec, + const Elf_Internal_Rela *relocs) +{ + const char *name; + bfd *dynobj; + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + struct score_got_info *g; + size_t extsymoff; + const Elf_Internal_Rela *rel; + const Elf_Internal_Rela *rel_end; + asection *sgot; + asection *sreloc; + const struct elf_backend_data *bed; + + if (info->relocatable) + return TRUE; + + dynobj = elf_hash_table (info)->dynobj; + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (abfd); + extsymoff = (elf_bad_symtab (abfd)) ? 0 : symtab_hdr->sh_info; + + name = bfd_get_section_name (abfd, sec); + + if (dynobj == NULL) + { + sgot = NULL; + g = NULL; + } + else + { + sgot = score_elf_got_section (dynobj, FALSE); + if (sgot == NULL) + g = NULL; + else + { + BFD_ASSERT (score_elf_section_data (sgot) != NULL); + g = score_elf_section_data (sgot)->u.got_info; + BFD_ASSERT (g != NULL); + } + } + + sreloc = NULL; + bed = get_elf_backend_data (abfd); + rel_end = relocs + sec->reloc_count * bed->s->int_rels_per_ext_rel; + for (rel = relocs; rel < rel_end; ++rel) + { + unsigned long r_symndx; + unsigned int r_type; + struct elf_link_hash_entry *h; + + r_symndx = ELF32_R_SYM (rel->r_info); + r_type = ELF32_R_TYPE (rel->r_info); + + if (r_symndx < extsymoff) + { + h = NULL; + } + else if (r_symndx >= extsymoff + NUM_SHDR_ENTRIES (symtab_hdr)) + { + (*_bfd_error_handler) (_("%s: Malformed reloc detected for section %s"), abfd, name); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + else + { + h = sym_hashes[r_symndx - extsymoff]; + + /* This may be an indirect symbol created because of a version. */ + if (h != NULL) + { + while (h->root.type == bfd_link_hash_indirect) + h = (struct elf_link_hash_entry *)h->root.u.i.link; + } + } + + /* Some relocs require a global offset table. */ + if (dynobj == NULL || sgot == NULL) + { + switch (r_type) + { + case R_SCORE_GOT15: + case R_SCORE_CALL15: + if (dynobj == NULL) + elf_hash_table (info)->dynobj = dynobj = abfd; + if (!score_elf_create_got_section (dynobj, info, FALSE)) + return FALSE; + g = score_elf_got_info (dynobj, &sgot); + break; + case R_SCORE_ABS32: + case R_SCORE_REL32: + if (dynobj == NULL && (info->shared || h != NULL) && (sec->flags & SEC_ALLOC) != 0) + elf_hash_table (info)->dynobj = dynobj = abfd; + break; + default: + break; + } + } + + if (!h && (r_type == R_SCORE_GOT_LO16)) + { + if (! score_elf_record_local_got_symbol (abfd, r_symndx, rel->r_addend, g)) + return FALSE; + } + + switch (r_type) + { + case R_SCORE_CALL15: + if (h == NULL) + { + (*_bfd_error_handler) + (_("%B: CALL15 reloc at 0x%lx not against global symbol"), + abfd, (unsigned long) rel->r_offset); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + else + { + /* This symbol requires a global offset table entry. */ + if (! score_elf_record_global_got_symbol (h, abfd, info, g)) + return FALSE; + + /* We need a stub, not a plt entry for the undefined function. But we record + it as if it needs plt. See _bfd_elf_adjust_dynamic_symbol. */ + h->needs_plt = 1; + h->type = STT_FUNC; + } + break; + case R_SCORE_GOT15: + if (h && ! score_elf_record_global_got_symbol (h, abfd, info, g)) + return FALSE; + break; + case R_SCORE_ABS32: + case R_SCORE_REL32: + if ((info->shared || h != NULL) && (sec->flags & SEC_ALLOC) != 0) + { + if (sreloc == NULL) + { + sreloc = score_elf_rel_dyn_section (dynobj, TRUE); + if (sreloc == NULL) + return FALSE; + } +#define SCORE_READONLY_SECTION (SEC_ALLOC | SEC_LOAD | SEC_READONLY) + if (info->shared) + { + /* When creating a shared object, we must copy these reloc types into + the output file as R_SCORE_REL32 relocs. We make room for this reloc + in the .rel.dyn reloc section. */ + score_elf_allocate_dynamic_relocations (dynobj, 1); + if ((sec->flags & SCORE_READONLY_SECTION) + == SCORE_READONLY_SECTION) + /* We tell the dynamic linker that there are + relocations against the text segment. */ + info->flags |= DF_TEXTREL; + } + else + { + struct score_elf_link_hash_entry *hscore; + + /* We only need to copy this reloc if the symbol is + defined in a dynamic object. */ + hscore = (struct score_elf_link_hash_entry *)h; + ++hscore->possibly_dynamic_relocs; + if ((sec->flags & SCORE_READONLY_SECTION) + == SCORE_READONLY_SECTION) + /* We need it to tell the dynamic linker if there + are relocations against the text segment. */ + hscore->readonly_reloc = TRUE; + } + + /* Even though we don't directly need a GOT entry for this symbol, + a symbol must have a dynamic symbol table index greater that + DT_SCORE_GOTSYM if there are dynamic relocations against it. */ + if (h != NULL) + { + if (dynobj == NULL) + elf_hash_table (info)->dynobj = dynobj = abfd; + if (! score_elf_create_got_section (dynobj, info, TRUE)) + return FALSE; + g = score_elf_got_info (dynobj, &sgot); + if (! score_elf_record_global_got_symbol (h, abfd, info, g)) + return FALSE; + } + } + break; + + /* This relocation describes the C++ object vtable hierarchy. + Reconstruct it for later use during GC. */ + case R_SCORE_GNU_VTINHERIT: + if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) + return FALSE; + break; + + /* This relocation describes which C++ vtable entries are actually + used. Record for later use during GC. */ + case R_SCORE_GNU_VTENTRY: + if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset)) + return FALSE; + break; + default: + break; + } + + /* We must not create a stub for a symbol that has relocations + related to taking the function's address. */ + switch (r_type) + { + default: + if (h != NULL) + { + struct score_elf_link_hash_entry *sh; + + sh = (struct score_elf_link_hash_entry *) h; + sh->no_fn_stub = TRUE; + } + break; + case R_SCORE_CALL15: + break; + } + } + + return TRUE; +} + +static bfd_boolean +_bfd_score_elf_add_symbol_hook (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + Elf_Internal_Sym *sym, + const char **namep ATTRIBUTE_UNUSED, + flagword *flagsp ATTRIBUTE_UNUSED, + asection **secp, + bfd_vma *valp) +{ + switch (sym->st_shndx) + { + case SHN_COMMON: + if (sym->st_size > elf_gp_size (abfd)) + break; + /* Fall through. */ + case SHN_SCORE_SCOMMON: + *secp = bfd_make_section_old_way (abfd, ".scommon"); + (*secp)->flags |= SEC_IS_COMMON; + *valp = sym->st_size; + break; + } + + return TRUE; +} + +static void +_bfd_score_elf_symbol_processing (bfd *abfd, asymbol *asym) +{ + elf_symbol_type *elfsym; + + elfsym = (elf_symbol_type *) asym; + switch (elfsym->internal_elf_sym.st_shndx) + { + case SHN_COMMON: + if (asym->value > elf_gp_size (abfd)) + break; + /* Fall through. */ + case SHN_SCORE_SCOMMON: + if (score_elf_scom_section.name == NULL) + { + /* Initialize the small common section. */ + score_elf_scom_section.name = ".scommon"; + score_elf_scom_section.flags = SEC_IS_COMMON; + score_elf_scom_section.output_section = &score_elf_scom_section; + score_elf_scom_section.symbol = &score_elf_scom_symbol; + score_elf_scom_section.symbol_ptr_ptr = &score_elf_scom_symbol_ptr; + score_elf_scom_symbol.name = ".scommon"; + score_elf_scom_symbol.flags = BSF_SECTION_SYM; + score_elf_scom_symbol.section = &score_elf_scom_section; + score_elf_scom_symbol_ptr = &score_elf_scom_symbol; + } + asym->section = &score_elf_scom_section; + asym->value = elfsym->internal_elf_sym.st_size; + break; + } +} + +static bfd_boolean +_bfd_score_elf_link_output_symbol_hook (struct bfd_link_info *info ATTRIBUTE_UNUSED, + const char *name ATTRIBUTE_UNUSED, + Elf_Internal_Sym *sym, + asection *input_sec, + struct elf_link_hash_entry *h ATTRIBUTE_UNUSED) +{ + /* If we see a common symbol, which implies a relocatable link, then + if a symbol was small common in an input file, mark it as small + common in the output file. */ + if (sym->st_shndx == SHN_COMMON && strcmp (input_sec->name, ".scommon") == 0) + sym->st_shndx = SHN_SCORE_SCOMMON; + + return TRUE; +} + +static bfd_boolean +_bfd_score_elf_section_from_bfd_section (bfd *abfd ATTRIBUTE_UNUSED, + asection *sec, + int *retval) +{ + if (strcmp (bfd_get_section_name (abfd, sec), ".scommon") == 0) + { + *retval = SHN_SCORE_SCOMMON; + return TRUE; + } + + return FALSE; +} + +/* Adjust a symbol defined by a dynamic object and referenced by a + regular object. The current definition is in some section of the + dynamic object, but we're not including those sections. We have to + change the definition to something the rest of the link can understand. */ + +static bfd_boolean +_bfd_score_elf_adjust_dynamic_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h) +{ + bfd *dynobj; + struct score_elf_link_hash_entry *hscore; + asection *s; + + dynobj = elf_hash_table (info)->dynobj; + + /* Make sure we know what is going on here. */ + BFD_ASSERT (dynobj != NULL + && (h->needs_plt + || h->u.weakdef != NULL + || (h->def_dynamic && h->ref_regular && !h->def_regular))); + + /* If this symbol is defined in a dynamic object, we need to copy + any R_SCORE_ABS32 or R_SCORE_REL32 relocs against it into the output + file. */ + hscore = (struct score_elf_link_hash_entry *)h; + if (!info->relocatable + && hscore->possibly_dynamic_relocs != 0 + && (h->root.type == bfd_link_hash_defweak || !h->def_regular)) + { + score_elf_allocate_dynamic_relocations (dynobj, hscore->possibly_dynamic_relocs); + if (hscore->readonly_reloc) + /* We tell the dynamic linker that there are relocations + against the text segment. */ + info->flags |= DF_TEXTREL; + } + + /* For a function, create a stub, if allowed. */ + if (!hscore->no_fn_stub && h->needs_plt) + { + if (!elf_hash_table (info)->dynamic_sections_created) + return TRUE; + + /* If this symbol is not defined in a regular file, then set + the symbol to the stub location. This is required to make + function pointers compare as equal between the normal + executable and the shared library. */ + if (!h->def_regular) + { + /* We need .stub section. */ + s = bfd_get_section_by_name (dynobj, SCORE_ELF_STUB_SECTION_NAME); + BFD_ASSERT (s != NULL); + + h->root.u.def.section = s; + h->root.u.def.value = s->size; + + /* XXX Write this stub address somewhere. */ + h->plt.offset = s->size; + + /* Make room for this stub code. */ + s->size += SCORE_FUNCTION_STUB_SIZE; + + /* The last half word of the stub will be filled with the index + of this symbol in .dynsym section. */ + return TRUE; + } + } + else if ((h->type == STT_FUNC) && !h->needs_plt) + { + /* This will set the entry for this symbol in the GOT to 0, and + the dynamic linker will take care of this. */ + h->root.u.def.value = 0; + return TRUE; + } + + /* If this is a weak symbol, and there is a real definition, the + processor independent code will have arranged for us to see the + real definition first, and we can just use the same value. */ + if (h->u.weakdef != NULL) + { + BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined + || h->u.weakdef->root.type == bfd_link_hash_defweak); + h->root.u.def.section = h->u.weakdef->root.u.def.section; + h->root.u.def.value = h->u.weakdef->root.u.def.value; + return TRUE; + } + + /* This is a reference to a symbol defined by a dynamic object which + is not a function. */ + return TRUE; +} + +/* This function is called after all the input files have been read, + and the input sections have been assigned to output sections. */ + +static bfd_boolean +_bfd_score_elf_always_size_sections (bfd *output_bfd, + struct bfd_link_info *info) +{ + bfd *dynobj; + asection *s; + struct score_got_info *g; + int i; + bfd_size_type loadable_size = 0; + bfd_size_type local_gotno; + bfd *sub; + + dynobj = elf_hash_table (info)->dynobj; + if (dynobj == NULL) + /* Relocatable links don't have it. */ + return TRUE; + + g = score_elf_got_info (dynobj, &s); + if (s == NULL) + return TRUE; + + /* Calculate the total loadable size of the output. That will give us the + maximum number of GOT_PAGE entries required. */ + for (sub = info->input_bfds; sub; sub = sub->link_next) + { + asection *subsection; + + for (subsection = sub->sections; + subsection; + subsection = subsection->next) + { + if ((subsection->flags & SEC_ALLOC) == 0) + continue; + loadable_size += ((subsection->size + 0xf) + &~ (bfd_size_type) 0xf); + } + } + + /* There has to be a global GOT entry for every symbol with + a dynamic symbol table index of DT_SCORE_GOTSYM or + higher. Therefore, it make sense to put those symbols + that need GOT entries at the end of the symbol table. We + do that here. */ + if (! score_elf_sort_hash_table (info, 1)) + return FALSE; + + if (g->global_gotsym != NULL) + i = elf_hash_table (info)->dynsymcount - g->global_gotsym->dynindx; + else + /* If there are no global symbols, or none requiring + relocations, then GLOBAL_GOTSYM will be NULL. */ + i = 0; + + /* In the worst case, we'll get one stub per dynamic symbol. */ + loadable_size += SCORE_FUNCTION_STUB_SIZE * i; + + /* Assume there are two loadable segments consisting of + contiguous sections. Is 5 enough? */ + local_gotno = (loadable_size >> 16) + 5; + + g->local_gotno += local_gotno; + s->size += g->local_gotno * SCORE_ELF_GOT_SIZE (output_bfd); + + g->global_gotno = i; + s->size += i * SCORE_ELF_GOT_SIZE (output_bfd); + + score_elf_resolve_final_got_entries (g); + + if (s->size > SCORE_ELF_GOT_MAX_SIZE (output_bfd)) + { + /* Fixme. Error message or Warning message should be issued here. */ + } + + return TRUE; +} + +/* Set the sizes of the dynamic sections. */ + +static bfd_boolean +_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) +{ + bfd *dynobj; + asection *s; + bfd_boolean reltext; + + dynobj = elf_hash_table (info)->dynobj; + BFD_ASSERT (dynobj != NULL); + + if (elf_hash_table (info)->dynamic_sections_created) + { + /* Set the contents of the .interp section to the interpreter. */ + if (!info->shared) + { + s = bfd_get_section_by_name (dynobj, ".interp"); + BFD_ASSERT (s != NULL); + s->size = strlen (ELF_DYNAMIC_INTERPRETER) + 1; + s->contents = (bfd_byte *) ELF_DYNAMIC_INTERPRETER; + } + } + + /* The check_relocs and adjust_dynamic_symbol entry points have + determined the sizes of the various dynamic sections. Allocate + memory for them. */ + reltext = FALSE; + for (s = dynobj->sections; s != NULL; s = s->next) + { + const char *name; + + if ((s->flags & SEC_LINKER_CREATED) == 0) + continue; + + /* It's OK to base decisions on the section name, because none + of the dynobj section names depend upon the input files. */ + name = bfd_get_section_name (dynobj, s); + + if (CONST_STRNEQ (name, ".rel")) + { + if (s->size == 0) + { + /* We only strip the section if the output section name + has the same name. Otherwise, there might be several + input sections for this output section. FIXME: This + code is probably not needed these days anyhow, since + the linker now does not create empty output sections. */ + if (s->output_section != NULL + && strcmp (name, + bfd_get_section_name (s->output_section->owner, + s->output_section)) == 0) + s->flags |= SEC_EXCLUDE; + } + else + { + const char *outname; + asection *target; + + /* If this relocation section applies to a read only + section, then we probably need a DT_TEXTREL entry. + If the relocation section is .rel.dyn, we always + assert a DT_TEXTREL entry rather than testing whether + there exists a relocation to a read only section or + not. */ + outname = bfd_get_section_name (output_bfd, s->output_section); + target = bfd_get_section_by_name (output_bfd, outname + 4); + if ((target != NULL + && (target->flags & SEC_READONLY) != 0 + && (target->flags & SEC_ALLOC) != 0) || strcmp (outname, ".rel.dyn") == 0) + reltext = TRUE; + + /* We use the reloc_count field as a counter if we need + to copy relocs into the output file. */ + if (strcmp (name, ".rel.dyn") != 0) + s->reloc_count = 0; + } + } + else if (CONST_STRNEQ (name, ".got")) + { + /* _bfd_score_elf_always_size_sections() has already done + most of the work, but some symbols may have been mapped + to versions that we must now resolve in the got_entries + hash tables. */ + } + else if (strcmp (name, SCORE_ELF_STUB_SECTION_NAME) == 0) + { + /* IRIX rld assumes that the function stub isn't at the end + of .text section. So put a dummy. XXX */ + s->size += SCORE_FUNCTION_STUB_SIZE; + } + else if (! CONST_STRNEQ (name, ".init")) + { + /* It's not one of our sections, so don't allocate space. */ + continue; + } + + /* Allocate memory for the section contents. */ + s->contents = bfd_zalloc (dynobj, s->size); + if (s->contents == NULL && s->size != 0) + { + bfd_set_error (bfd_error_no_memory); + return FALSE; + } + } + + if (elf_hash_table (info)->dynamic_sections_created) + { + /* Add some entries to the .dynamic section. We fill in the + values later, in _bfd_score_elf_finish_dynamic_sections, but we + must add the entries now so that we get the correct size for + the .dynamic section. The DT_DEBUG entry is filled in by the + dynamic linker and used by the debugger. */ + + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_DEBUG, 0)) + return FALSE; + + if (reltext) + info->flags |= DF_TEXTREL; + + if ((info->flags & DF_TEXTREL) != 0) + { + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_TEXTREL, 0)) + return FALSE; + } + + if (! SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_PLTGOT, 0)) + return FALSE; + + if (score_elf_rel_dyn_section (dynobj, FALSE)) + { + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_REL, 0)) + return FALSE; + + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELSZ, 0)) + return FALSE; + + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELENT, 0)) + return FALSE; + } + + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_BASE_ADDRESS, 0)) + return FALSE; + + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_LOCAL_GOTNO, 0)) + return FALSE; + + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_SYMTABNO, 0)) + return FALSE; + + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_UNREFEXTNO, 0)) + return FALSE; + + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_GOTSYM, 0)) + return FALSE; + + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_HIPAGENO, 0)) + return FALSE; + } + + return TRUE; +} + +static bfd_boolean +_bfd_score_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) +{ + struct elf_link_hash_entry *h; + struct bfd_link_hash_entry *bh; + flagword flags; + asection *s; + + flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY + | SEC_LINKER_CREATED | SEC_READONLY); + + /* ABI requests the .dynamic section to be read only. */ + s = bfd_get_section_by_name (abfd, ".dynamic"); + if (s != NULL) + { + if (!bfd_set_section_flags (abfd, s, flags)) + return FALSE; + } + + /* We need to create .got section. */ + if (!score_elf_create_got_section (abfd, info, FALSE)) + return FALSE; + + if (!score_elf_rel_dyn_section (elf_hash_table (info)->dynobj, TRUE)) + return FALSE; + + /* Create .stub section. */ + if (bfd_get_section_by_name (abfd, SCORE_ELF_STUB_SECTION_NAME) == NULL) + { + s = bfd_make_section_with_flags (abfd, SCORE_ELF_STUB_SECTION_NAME, + flags | SEC_CODE); + if (s == NULL + || !bfd_set_section_alignment (abfd, s, 2)) + + return FALSE; + } + + if (!info->shared) + { + const char *name; + + name = "_DYNAMIC_LINK"; + bh = NULL; + if (!(_bfd_generic_link_add_one_symbol + (info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr, + (bfd_vma) 0, (const char *)NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh))) + return FALSE; + + h = (struct elf_link_hash_entry *)bh; + h->non_elf = 0; + h->def_regular = 1; + h->type = STT_SECTION; + + if (!bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + } + + return TRUE; +} + + +/* Finish up dynamic symbol handling. We set the contents of various + dynamic sections here. */ + +static bfd_boolean +_bfd_score_elf_finish_dynamic_symbol (bfd *output_bfd, + struct bfd_link_info *info, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) +{ + bfd *dynobj; + asection *sgot; + struct score_got_info *g; + const char *name; + + dynobj = elf_hash_table (info)->dynobj; + + if (h->plt.offset != MINUS_ONE) + { + asection *s; + bfd_byte stub[SCORE_FUNCTION_STUB_SIZE]; + + /* This symbol has a stub. Set it up. */ + BFD_ASSERT (h->dynindx != -1); + + s = bfd_get_section_by_name (dynobj, SCORE_ELF_STUB_SECTION_NAME); + BFD_ASSERT (s != NULL); + + /* FIXME: Can h->dynindex be more than 64K? */ + if (h->dynindx & 0xffff0000) + return FALSE; + + /* Fill the stub. */ + bfd_put_32 (output_bfd, STUB_LW, stub); + bfd_put_32 (output_bfd, STUB_MOVE, stub + 4); + bfd_put_32 (output_bfd, STUB_LI16 | (h->dynindx << 1), stub + 8); + bfd_put_32 (output_bfd, STUB_BRL, stub + 12); + + BFD_ASSERT (h->plt.offset <= s->size); + memcpy (s->contents + h->plt.offset, stub, SCORE_FUNCTION_STUB_SIZE); + + /* Mark the symbol as undefined. plt.offset != -1 occurs + only for the referenced symbol. */ + sym->st_shndx = SHN_UNDEF; + + /* The run-time linker uses the st_value field of the symbol + to reset the global offset table entry for this external + to its stub address when unlinking a shared object. */ + sym->st_value = (s->output_section->vma + s->output_offset + h->plt.offset); + } + + BFD_ASSERT (h->dynindx != -1 || h->forced_local); + + sgot = score_elf_got_section (dynobj, FALSE); + BFD_ASSERT (sgot != NULL); + BFD_ASSERT (score_elf_section_data (sgot) != NULL); + g = score_elf_section_data (sgot)->u.got_info; + BFD_ASSERT (g != NULL); + + /* Run through the global symbol table, creating GOT entries for all + the symbols that need them. */ + if (g->global_gotsym != NULL && h->dynindx >= g->global_gotsym->dynindx) + { + bfd_vma offset; + bfd_vma value; + + value = sym->st_value; + offset = score_elf_global_got_index (dynobj, h); + bfd_put_32 (output_bfd, value, sgot->contents + offset); + } + + /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ + name = h->root.root.string; + if (strcmp (name, "_DYNAMIC") == 0 || strcmp (name, "_GLOBAL_OFFSET_TABLE_") == 0) + sym->st_shndx = SHN_ABS; + else if (strcmp (name, "_DYNAMIC_LINK") == 0) + { + sym->st_shndx = SHN_ABS; + sym->st_info = ELF_ST_INFO (STB_GLOBAL, STT_SECTION); + sym->st_value = 1; + } + else if (strcmp (name, GP_DISP_LABEL) == 0) + { + sym->st_shndx = SHN_ABS; + sym->st_info = ELF_ST_INFO (STB_GLOBAL, STT_SECTION); + sym->st_value = elf_gp (output_bfd); + } + + return TRUE; +} + +/* Finish up the dynamic sections. */ + +static bfd_boolean +_bfd_score_elf_finish_dynamic_sections (bfd *output_bfd, + struct bfd_link_info *info) +{ + bfd *dynobj; + asection *sdyn; + asection *sgot; + asection *s; + struct score_got_info *g; + + dynobj = elf_hash_table (info)->dynobj; + + sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); + + sgot = score_elf_got_section (dynobj, FALSE); + if (sgot == NULL) + g = NULL; + else + { + BFD_ASSERT (score_elf_section_data (sgot) != NULL); + g = score_elf_section_data (sgot)->u.got_info; + BFD_ASSERT (g != NULL); + } + + if (elf_hash_table (info)->dynamic_sections_created) + { + bfd_byte *b; + + BFD_ASSERT (sdyn != NULL); + BFD_ASSERT (g != NULL); + + for (b = sdyn->contents; + b < sdyn->contents + sdyn->size; + b += SCORE_ELF_DYN_SIZE (dynobj)) + { + Elf_Internal_Dyn dyn; + const char *name; + size_t elemsize; + bfd_boolean swap_out_p; + + /* Read in the current dynamic entry. */ + (*get_elf_backend_data (dynobj)->s->swap_dyn_in) (dynobj, b, &dyn); + + /* Assume that we're going to modify it and write it out. */ + swap_out_p = TRUE; + + switch (dyn.d_tag) + { + case DT_RELENT: + s = score_elf_rel_dyn_section (dynobj, FALSE); + BFD_ASSERT (s != NULL); + dyn.d_un.d_val = SCORE_ELF_REL_SIZE (dynobj); + break; + + case DT_STRSZ: + /* Rewrite DT_STRSZ. */ + dyn.d_un.d_val = _bfd_elf_strtab_size (elf_hash_table (info)->dynstr); + break; + + case DT_PLTGOT: + name = ".got"; + s = bfd_get_section_by_name (output_bfd, name); + BFD_ASSERT (s != NULL); + dyn.d_un.d_ptr = s->vma; + break; + + case DT_SCORE_BASE_ADDRESS: + s = output_bfd->sections; + BFD_ASSERT (s != NULL); + dyn.d_un.d_ptr = s->vma & ~(bfd_vma) 0xffff; + break; + + case DT_SCORE_LOCAL_GOTNO: + dyn.d_un.d_val = g->local_gotno; + break; + + case DT_SCORE_UNREFEXTNO: + /* The index into the dynamic symbol table which is the + entry of the first external symbol that is not + referenced within the same object. */ + dyn.d_un.d_val = bfd_count_sections (output_bfd) + 1; + break; + + case DT_SCORE_GOTSYM: + if (g->global_gotsym) + { + dyn.d_un.d_val = g->global_gotsym->dynindx; + break; + } + /* In case if we don't have global got symbols we default + to setting DT_SCORE_GOTSYM to the same value as + DT_SCORE_SYMTABNO, so we just fall through. */ + + case DT_SCORE_SYMTABNO: + name = ".dynsym"; + elemsize = SCORE_ELF_SYM_SIZE (output_bfd); + s = bfd_get_section_by_name (output_bfd, name); + BFD_ASSERT (s != NULL); + + dyn.d_un.d_val = s->size / elemsize; + break; + + case DT_SCORE_HIPAGENO: + dyn.d_un.d_val = g->local_gotno - SCORE_RESERVED_GOTNO; + break; + + default: + swap_out_p = FALSE; + break; + } + + if (swap_out_p) + (*get_elf_backend_data (dynobj)->s->swap_dyn_out) (dynobj, &dyn, b); + } + } + + /* The first entry of the global offset table will be filled at + runtime. The second entry will be used by some runtime loaders. + This isn't the case of IRIX rld. */ + if (sgot != NULL && sgot->size > 0) + { + bfd_put_32 (output_bfd, 0, sgot->contents); + bfd_put_32 (output_bfd, 0x80000000, sgot->contents + SCORE_ELF_GOT_SIZE (output_bfd)); + } + + if (sgot != NULL) + elf_section_data (sgot->output_section)->this_hdr.sh_entsize + = SCORE_ELF_GOT_SIZE (output_bfd); + + + /* We need to sort the entries of the dynamic relocation section. */ + s = score_elf_rel_dyn_section (dynobj, FALSE); + + if (s != NULL && s->size > (bfd_vma)2 * SCORE_ELF_REL_SIZE (output_bfd)) + { + reldyn_sorting_bfd = output_bfd; + qsort ((Elf32_External_Rel *) s->contents + 1, s->reloc_count - 1, + sizeof (Elf32_External_Rel), score_elf_sort_dynamic_relocs); + } + + return TRUE; +} + +/* This function set up the ELF section header for a BFD section in preparation for writing + it out. This is where the flags and type fields are set for unusual sections. */ + +static bfd_boolean +_bfd_score_elf_fake_sections (bfd *abfd ATTRIBUTE_UNUSED, + Elf_Internal_Shdr *hdr, + asection *sec) +{ + const char *name; + + name = bfd_get_section_name (abfd, sec); + + if (strcmp (name, ".got") == 0 + || strcmp (name, ".srdata") == 0 + || strcmp (name, ".sdata") == 0 + || strcmp (name, ".sbss") == 0) + hdr->sh_flags |= SHF_SCORE_GPREL; + + return TRUE; +} + +/* This function do additional processing on the ELF section header before writing + it out. This is used to set the flags and type fields for some sections. */ + +/* assign_file_positions_except_relocs() check section flag and if it is allocatable, + warning message will be issued. backend_fake_section is called before + assign_file_positions_except_relocs(); backend_section_processing after it. so, we + modify section flag there, but not backend_fake_section. */ + +static bfd_boolean +_bfd_score_elf_section_processing (bfd *abfd ATTRIBUTE_UNUSED, Elf_Internal_Shdr *hdr) +{ + if (hdr->bfd_section != NULL) + { + const char *name = bfd_get_section_name (abfd, hdr->bfd_section); + + if (strcmp (name, ".sdata") == 0) + { + hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_SCORE_GPREL; + hdr->sh_type = SHT_PROGBITS; + } + else if (strcmp (name, ".sbss") == 0) + { + hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_SCORE_GPREL; + hdr->sh_type = SHT_NOBITS; + } + else if (strcmp (name, ".srdata") == 0) + { + hdr->sh_flags |= SHF_ALLOC | SHF_SCORE_GPREL; + hdr->sh_type = SHT_PROGBITS; + } + } + + return TRUE; +} + +static bfd_boolean +_bfd_score_elf_write_section (bfd *output_bfd, + struct bfd_link_info *link_info ATTRIBUTE_UNUSED, + asection *sec, bfd_byte *contents) +{ + bfd_byte *to, *from, *end; + int i; + + if (strcmp (sec->name, ".pdr") != 0) + return FALSE; + + if (score_elf_section_data (sec)->u.tdata == NULL) + return FALSE; + + to = contents; + end = contents + sec->size; + for (from = contents, i = 0; from < end; from += PDR_SIZE, i++) + { + if ((score_elf_section_data (sec)->u.tdata)[i] == 1) + continue; + + if (to != from) + memcpy (to, from, PDR_SIZE); + + to += PDR_SIZE; + } + bfd_set_section_contents (output_bfd, sec->output_section, contents, + (file_ptr) sec->output_offset, sec->size); + + return TRUE; +} + +/* Copy data from a SCORE ELF indirect symbol to its direct symbol, hiding the old + indirect symbol. Process additional relocation information. */ + +static void +_bfd_score_elf_copy_indirect_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *dir, + struct elf_link_hash_entry *ind) +{ + struct score_elf_link_hash_entry *dirscore, *indscore; + + _bfd_elf_link_hash_copy_indirect (info, dir, ind); + + if (ind->root.type != bfd_link_hash_indirect) + return; + + dirscore = (struct score_elf_link_hash_entry *) dir; + indscore = (struct score_elf_link_hash_entry *) ind; + dirscore->possibly_dynamic_relocs += indscore->possibly_dynamic_relocs; + + if (indscore->readonly_reloc) + dirscore->readonly_reloc = TRUE; + + if (indscore->no_fn_stub) + dirscore->no_fn_stub = TRUE; +} + +/* Remove information about discarded functions from other sections which mention them. */ + +static bfd_boolean +_bfd_score_elf_discard_info (bfd *abfd, struct elf_reloc_cookie *cookie, + struct bfd_link_info *info) +{ + asection *o; + bfd_boolean ret = FALSE; + unsigned char *tdata; + size_t i, skip; + + o = bfd_get_section_by_name (abfd, ".pdr"); + if ((!o) || (o->size == 0) || (o->size % PDR_SIZE != 0) + || (o->output_section != NULL && bfd_is_abs_section (o->output_section))) + return FALSE; + + tdata = bfd_zmalloc (o->size / PDR_SIZE); + if (!tdata) + return FALSE; + + cookie->rels = _bfd_elf_link_read_relocs (abfd, o, NULL, NULL, info->keep_memory); + if (!cookie->rels) + { + free (tdata); + return FALSE; + } + + cookie->rel = cookie->rels; + cookie->relend = cookie->rels + o->reloc_count; + + for (i = 0, skip = 0; i < o->size; i++) + { + if (bfd_elf_reloc_symbol_deleted_p (i * PDR_SIZE, cookie)) + { + tdata[i] = 1; + skip++; + } + } + + if (skip != 0) + { + score_elf_section_data (o)->u.tdata = tdata; + o->size -= skip * PDR_SIZE; + ret = TRUE; + } + else + free (tdata); + + if (!info->keep_memory) + free (cookie->rels); + + return ret; +} + +/* Signal that discard_info() has removed the discarded relocations for this section. */ + +static bfd_boolean +_bfd_score_elf_ignore_discarded_relocs (asection *sec) +{ + if (strcmp (sec->name, ".pdr") == 0) + return TRUE; + return FALSE; +} + +/* Return the section that should be marked against GC for a given + relocation. */ + +static asection * +_bfd_score_elf_gc_mark_hook (asection *sec, + struct bfd_link_info *info, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) +{ + if (h != NULL) + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_SCORE_GNU_VTINHERIT: + case R_SCORE_GNU_VTENTRY: + return NULL; + } + + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); +} + +/* Support for core dump NOTE sections. */ + +static bfd_boolean +_bfd_score_elf_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) +{ + int offset; + unsigned int raw_size; + + switch (note->descsz) + { + default: + return FALSE; + + case 148: /* Linux/Score 32-bit. */ + /* pr_cursig */ + elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12); + + /* pr_pid */ + elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24); + + /* pr_reg */ + offset = 72; + raw_size = 72; + + break; + } + + /* Make a ".reg/999" section. */ + return _bfd_elfcore_make_pseudosection (abfd, ".reg", raw_size, note->descpos + offset); +} + +static bfd_boolean +_bfd_score_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) +{ + switch (note->descsz) + { + default: + return FALSE; + + case 124: /* Linux/Score elf_prpsinfo. */ + elf_tdata (abfd)->core_program = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16); + elf_tdata (abfd)->core_command = _bfd_elfcore_strndup (abfd, note->descdata + 44, 80); + } + + /* Note that for some reason, a spurious space is tacked + onto the end of the args in some (at least one anyway) + implementations, so strip it off if it exists. */ + + { + char *command = elf_tdata (abfd)->core_command; + int n = strlen (command); + + if (0 < n && command[n - 1] == ' ') + command[n - 1] = '\0'; + } + + return TRUE; +} + + +/* Score BFD functions. */ + +static reloc_howto_type * +elf32_score_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real_type code) +{ + unsigned int i; + + for (i = 0; i < NUM_ELEM (elf32_score_reloc_map); i++) + if (elf32_score_reloc_map[i].bfd_reloc_val == code) + return &elf32_score_howto_table[elf32_score_reloc_map[i].elf_reloc_val]; + + return NULL; +} + +static reloc_howto_type * +elf32_score_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (elf32_score_howto_table) + / sizeof (elf32_score_howto_table[0])); + i++) + if (elf32_score_howto_table[i].name != NULL + && strcasecmp (elf32_score_howto_table[i].name, r_name) == 0) + return &elf32_score_howto_table[i]; + + return NULL; +} + +/* Create a score elf linker hash table. */ + +static struct bfd_link_hash_table * +elf32_score_link_hash_table_create (bfd *abfd) +{ + struct score_elf_link_hash_table *ret; + bfd_size_type amt = sizeof (struct score_elf_link_hash_table); + + ret = bfd_malloc (amt); + if (ret == NULL) + return NULL; + + if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, score_elf_link_hash_newfunc, + sizeof (struct score_elf_link_hash_entry))) + { + free (ret); + return NULL; + } + + return &ret->root.root; +} + +static bfd_boolean +elf32_score_print_private_bfd_data (bfd *abfd, void * ptr) +{ + FILE *file = (FILE *) ptr; + + BFD_ASSERT (abfd != NULL && ptr != NULL); + + /* Print normal ELF private data. */ + _bfd_elf_print_private_bfd_data (abfd, ptr); + + /* xgettext:c-format */ + fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags); + if (elf_elfheader (abfd)->e_flags & EF_SCORE_PIC) + { + fprintf (file, _(" [pic]")); + } + if (elf_elfheader (abfd)->e_flags & EF_SCORE_FIXDEP) + { + fprintf (file, _(" [fix dep]")); + } + fputc ('\n', file); + + return TRUE; +} + +static bfd_boolean +elf32_score_merge_private_bfd_data (bfd *ibfd, bfd *obfd) +{ + flagword in_flags; + flagword out_flags; + + if (!_bfd_generic_verify_endian_match (ibfd, obfd)) + return FALSE; + + in_flags = elf_elfheader (ibfd)->e_flags; + out_flags = elf_elfheader (obfd)->e_flags; + + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour + || bfd_get_flavour (obfd) != bfd_target_elf_flavour) + return TRUE; + + in_flags = elf_elfheader (ibfd)->e_flags; + out_flags = elf_elfheader (obfd)->e_flags; + + if (! elf_flags_init (obfd)) + { + elf_flags_init (obfd) = TRUE; + elf_elfheader (obfd)->e_flags = in_flags; + + if (bfd_get_arch (obfd) == bfd_get_arch (ibfd) + && bfd_get_arch_info (obfd)->the_default) + { + return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd)); + } + + return TRUE; + } + + if (((in_flags & EF_SCORE_PIC) != 0) != ((out_flags & EF_SCORE_PIC) != 0)) + { + (*_bfd_error_handler) (_("%B: warning: linking PIC files with non-PIC files"), ibfd); + } + + /* FIXME: Maybe dependency fix compatibility should be checked here. */ + + return TRUE; +} + +static bfd_boolean +elf32_score_new_section_hook (bfd *abfd, asection *sec) +{ + struct _score_elf_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); + + sdata = bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = sdata; + + return _bfd_elf_new_section_hook (abfd, sec); +} + + +#define USE_REL 1 +#define TARGET_LITTLE_SYM bfd_elf32_littlescore_vec +#define TARGET_LITTLE_NAME "elf32-littlescore" +#define TARGET_BIG_SYM bfd_elf32_bigscore_vec +#define TARGET_BIG_NAME "elf32-bigscore" +#define ELF_ARCH bfd_arch_score +#define ELF_MACHINE_CODE EM_SCORE +#define ELF_MAXPAGESIZE 0x8000 + +#define elf_info_to_howto 0 +#define elf_info_to_howto_rel _bfd_score_info_to_howto +#define elf_backend_relocate_section _bfd_score_elf_relocate_section +#define elf_backend_check_relocs _bfd_score_elf_check_relocs +#define elf_backend_add_symbol_hook _bfd_score_elf_add_symbol_hook +#define elf_backend_symbol_processing _bfd_score_elf_symbol_processing +#define elf_backend_link_output_symbol_hook \ + _bfd_score_elf_link_output_symbol_hook +#define elf_backend_section_from_bfd_section \ + _bfd_score_elf_section_from_bfd_section +#define elf_backend_adjust_dynamic_symbol \ + _bfd_score_elf_adjust_dynamic_symbol +#define elf_backend_always_size_sections \ + _bfd_score_elf_always_size_sections +#define elf_backend_size_dynamic_sections \ + _bfd_score_elf_size_dynamic_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) +#define elf_backend_create_dynamic_sections \ + _bfd_score_elf_create_dynamic_sections +#define elf_backend_finish_dynamic_symbol \ + _bfd_score_elf_finish_dynamic_symbol +#define elf_backend_finish_dynamic_sections \ + _bfd_score_elf_finish_dynamic_sections +#define elf_backend_fake_sections _bfd_score_elf_fake_sections +#define elf_backend_section_processing _bfd_score_elf_section_processing +#define elf_backend_write_section _bfd_score_elf_write_section +#define elf_backend_copy_indirect_symbol _bfd_score_elf_copy_indirect_symbol +#define elf_backend_hide_symbol _bfd_score_elf_hide_symbol +#define elf_backend_discard_info _bfd_score_elf_discard_info +#define elf_backend_ignore_discarded_relocs \ + _bfd_score_elf_ignore_discarded_relocs +#define elf_backend_gc_mark_hook _bfd_score_elf_gc_mark_hook +#define elf_backend_grok_prstatus _bfd_score_elf_grok_prstatus +#define elf_backend_grok_psinfo _bfd_score_elf_grok_psinfo +#define elf_backend_can_gc_sections 1 +#define elf_backend_want_plt_sym 0 +#define elf_backend_got_header_size (4 * SCORE_RESERVED_GOTNO) +#define elf_backend_plt_header_size 0 +#define elf_backend_collect TRUE +#define elf_backend_type_change_ok TRUE + +#define bfd_elf32_bfd_reloc_type_lookup elf32_score_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup \ + elf32_score_reloc_name_lookup +#define bfd_elf32_bfd_link_hash_table_create elf32_score_link_hash_table_create +#define bfd_elf32_bfd_print_private_bfd_data elf32_score_print_private_bfd_data +#define bfd_elf32_bfd_merge_private_bfd_data elf32_score_merge_private_bfd_data +#define bfd_elf32_new_section_hook elf32_score_new_section_hook + +#include "elf32-target.h" diff --git a/bfd/elf32-sh-relocs.h b/bfd/elf32-sh-relocs.h new file mode 100644 index 00000000000..3488ef4edbe --- /dev/null +++ b/bfd/elf32-sh-relocs.h @@ -0,0 +1,1716 @@ + /* No relocation. */ + HOWTO (R_SH_NONE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_NONE", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* 32 bit absolute relocation. Setting partial_inplace to TRUE and + src_mask to a non-zero value is similar to the COFF toolchain. */ + HOWTO (R_SH_DIR32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + SH_ELF_RELOC, /* special_function */ + "R_SH_DIR32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* 32 bit PC relative relocation. */ + HOWTO (R_SH_REL32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_REL32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* 8 bit PC relative branch divided by 2. */ + HOWTO (R_SH_DIR8WPN, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_DIR8WPN", /* name */ + TRUE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* 12 bit PC relative branch divided by 2. */ + /* This cannot be partial_inplace because relaxation can't know the + eventual value of a symbol. */ + HOWTO (R_SH_IND12W, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + NULL, /* special_function */ + "R_SH_IND12W", /* name */ + FALSE, /* partial_inplace */ + 0x0, /* src_mask */ + 0xfff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* 8 bit unsigned PC relative divided by 4. */ + HOWTO (R_SH_DIR8WPL, /* type */ + 2, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_DIR8WPL", /* name */ + TRUE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* 8 bit unsigned PC relative divided by 2. */ + HOWTO (R_SH_DIR8WPZ, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_DIR8WPZ", /* name */ + TRUE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* 8 bit GBR relative. FIXME: This only makes sense if we have some + special symbol for the GBR relative area, and that is not + implemented. */ + HOWTO (R_SH_DIR8BP, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_DIR8BP", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* 8 bit GBR relative divided by 2. FIXME: This only makes sense if + we have some special symbol for the GBR relative area, and that + is not implemented. */ + HOWTO (R_SH_DIR8W, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_DIR8W", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* 8 bit GBR relative divided by 4. FIXME: This only makes sense if + we have some special symbol for the GBR relative area, and that + is not implemented. */ + HOWTO (R_SH_DIR8L, /* type */ + 2, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_DIR8L", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* 8 bit PC relative divided by 2 - but specified in a very odd way. */ + HOWTO (R_SH_LOOP_START, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_LOOP_START", /* name */ + TRUE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* 8 bit PC relative divided by 2 - but specified in a very odd way. */ + HOWTO (R_SH_LOOP_END, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_LOOP_END", /* name */ + TRUE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + EMPTY_HOWTO (12), + EMPTY_HOWTO (13), + EMPTY_HOWTO (14), + EMPTY_HOWTO (15), + EMPTY_HOWTO (16), + EMPTY_HOWTO (17), + EMPTY_HOWTO (18), + EMPTY_HOWTO (19), + EMPTY_HOWTO (20), + EMPTY_HOWTO (21), + + /* The remaining relocs are a GNU extension used for relaxing. The + final pass of the linker never needs to do anything with any of + these relocs. Any required operations are handled by the + relaxation code. */ + + /* GNU extension to record C++ vtable hierarchy */ + HOWTO (R_SH_GNU_VTINHERIT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_SH_GNU_VTINHERIT", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* GNU extension to record C++ vtable member usage */ + HOWTO (R_SH_GNU_VTENTRY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_elf_rel_vtable_reloc_fn, /* special_function */ + "R_SH_GNU_VTENTRY", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* An 8 bit switch table entry. This is generated for an expression + such as ``.word L1 - L2''. The offset holds the difference + between the reloc address and L2. */ + HOWTO (R_SH_SWITCH8, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_SWITCH8", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* A 16 bit switch table entry. This is generated for an expression + such as ``.word L1 - L2''. The offset holds the difference + between the reloc address and L2. */ + HOWTO (R_SH_SWITCH16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_SWITCH16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* A 32 bit switch table entry. This is generated for an expression + such as ``.long L1 - L2''. The offset holds the difference + between the reloc address and L2. */ + HOWTO (R_SH_SWITCH32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_SWITCH32", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Indicates a .uses pseudo-op. The compiler will generate .uses + pseudo-ops when it finds a function call which can be relaxed. + The offset field holds the PC relative offset to the instruction + which loads the register used in the function call. */ + HOWTO (R_SH_USES, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_USES", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* The assembler will generate this reloc for addresses referred to + by the register loads associated with USES relocs. The offset + field holds the number of times the address is referenced in the + object file. */ + HOWTO (R_SH_COUNT, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_COUNT", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Indicates an alignment statement. The offset field is the power + of 2 to which subsequent portions of the object file must be + aligned. */ + HOWTO (R_SH_ALIGN, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_ALIGN", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* The assembler will generate this reloc before a block of + instructions. A section should be processed as assuming it + contains data, unless this reloc is seen. */ + HOWTO (R_SH_CODE, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_CODE", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* The assembler will generate this reloc after a block of + instructions when it sees data that is not instructions. */ + HOWTO (R_SH_DATA, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_DATA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* The assembler generates this reloc for each label within a block + of instructions. This permits the linker to avoid swapping + instructions which are the targets of branches. */ + HOWTO (R_SH_LABEL, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_LABEL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* The next 12 are only supported via linking in SHC-generated objects. */ + HOWTO (R_SH_DIR16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_DIR8, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR8", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_DIR8UL, /* type */ + 2, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR8UL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_DIR8UW, /* type */ + 1, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR8UW", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_DIR8U, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR8U", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_DIR8SW, /* type */ + 1, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR8SW", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_DIR8S, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR8S", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_DIR4UL, /* type */ + 2, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 4, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR4UL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x0f, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_DIR4UW, /* type */ + 1, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 4, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR4UW", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x0f, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_DIR4U, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 4, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR4U", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x0f, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_PSHA, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 7, /* bitsize */ + FALSE, /* pc_relative */ + 4, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_PSHA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x0f, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_PSHL, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 7, /* bitsize */ + FALSE, /* pc_relative */ + 4, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_PSHL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x0f, /* dst_mask */ + FALSE), /* pcrel_offset */ + +#ifdef INCLUDE_SHMEDIA + /* Used in SHLLI.L and SHLRI.L. */ + HOWTO (R_SH_DIR5U, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 5, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR5U", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xfc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in SHARI, SHLLI et al. */ + HOWTO (R_SH_DIR6U, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 6, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR6U", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xfc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in BxxI, LDHI.L et al. */ + HOWTO (R_SH_DIR6S, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 6, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR6S", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xfc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in ADDI, ANDI et al. */ + HOWTO (R_SH_DIR10S, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR10S", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in LD.UW, ST.W et al. */ + HOWTO (R_SH_DIR10SW, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 11, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR10SW", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in LD.L, FLD.S et al. */ + HOWTO (R_SH_DIR10SL, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR10SL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in FLD.D, FST.P et al. */ + HOWTO (R_SH_DIR10SQ, /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 13, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR10SQ", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + +#else + EMPTY_HOWTO (45), + EMPTY_HOWTO (46), + EMPTY_HOWTO (47), + EMPTY_HOWTO (48), + EMPTY_HOWTO (49), + EMPTY_HOWTO (50), + EMPTY_HOWTO (51), +#endif + + EMPTY_HOWTO (52), + + HOWTO (R_SH_DIR16S, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR16S", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + EMPTY_HOWTO (54), + EMPTY_HOWTO (55), + EMPTY_HOWTO (56), + EMPTY_HOWTO (57), + EMPTY_HOWTO (58), + EMPTY_HOWTO (59), + EMPTY_HOWTO (60), + EMPTY_HOWTO (61), + EMPTY_HOWTO (62), + EMPTY_HOWTO (63), + EMPTY_HOWTO (64), + EMPTY_HOWTO (65), + EMPTY_HOWTO (66), + EMPTY_HOWTO (67), + EMPTY_HOWTO (68), + EMPTY_HOWTO (69), + EMPTY_HOWTO (70), + EMPTY_HOWTO (71), + EMPTY_HOWTO (72), + EMPTY_HOWTO (73), + EMPTY_HOWTO (74), + EMPTY_HOWTO (75), + EMPTY_HOWTO (76), + EMPTY_HOWTO (77), + EMPTY_HOWTO (78), + EMPTY_HOWTO (79), + EMPTY_HOWTO (80), + EMPTY_HOWTO (81), + EMPTY_HOWTO (82), + EMPTY_HOWTO (83), + EMPTY_HOWTO (84), + EMPTY_HOWTO (85), + EMPTY_HOWTO (86), + EMPTY_HOWTO (87), + EMPTY_HOWTO (88), + EMPTY_HOWTO (89), + EMPTY_HOWTO (90), + EMPTY_HOWTO (91), + EMPTY_HOWTO (92), + EMPTY_HOWTO (93), + EMPTY_HOWTO (94), + EMPTY_HOWTO (95), + EMPTY_HOWTO (96), + EMPTY_HOWTO (97), + EMPTY_HOWTO (98), + EMPTY_HOWTO (99), + EMPTY_HOWTO (100), + EMPTY_HOWTO (101), + EMPTY_HOWTO (102), + EMPTY_HOWTO (103), + EMPTY_HOWTO (104), + EMPTY_HOWTO (105), + EMPTY_HOWTO (106), + EMPTY_HOWTO (107), + EMPTY_HOWTO (108), + EMPTY_HOWTO (109), + EMPTY_HOWTO (110), + EMPTY_HOWTO (111), + EMPTY_HOWTO (112), + EMPTY_HOWTO (113), + EMPTY_HOWTO (114), + EMPTY_HOWTO (115), + EMPTY_HOWTO (116), + EMPTY_HOWTO (117), + EMPTY_HOWTO (118), + EMPTY_HOWTO (119), + EMPTY_HOWTO (120), + EMPTY_HOWTO (121), + EMPTY_HOWTO (122), + EMPTY_HOWTO (123), + EMPTY_HOWTO (124), + EMPTY_HOWTO (125), + EMPTY_HOWTO (126), + EMPTY_HOWTO (127), + EMPTY_HOWTO (128), + EMPTY_HOWTO (129), + EMPTY_HOWTO (130), + EMPTY_HOWTO (131), + EMPTY_HOWTO (132), + EMPTY_HOWTO (133), + EMPTY_HOWTO (134), + EMPTY_HOWTO (135), + EMPTY_HOWTO (136), + EMPTY_HOWTO (137), + EMPTY_HOWTO (138), + EMPTY_HOWTO (139), + EMPTY_HOWTO (140), + EMPTY_HOWTO (141), + EMPTY_HOWTO (142), + EMPTY_HOWTO (143), + + HOWTO (R_SH_TLS_GD_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_TLS_GD_32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_TLS_LD_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_TLS_LD_32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_TLS_LDO_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_TLS_LDO_32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_TLS_IE_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_TLS_IE_32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_TLS_LE_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_TLS_LE_32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_TLS_DTPMOD32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_TLS_DTPMOD32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_TLS_DTPOFF32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_TLS_DTPOFF32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_TLS_TPOFF32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_TLS_TPOFF32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + EMPTY_HOWTO (152), + EMPTY_HOWTO (153), + EMPTY_HOWTO (154), + EMPTY_HOWTO (155), + EMPTY_HOWTO (156), + EMPTY_HOWTO (157), + EMPTY_HOWTO (158), + EMPTY_HOWTO (159), + + HOWTO (R_SH_GOT32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_GOT32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_PLT32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_PLT32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_SH_COPY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_COPY", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_GLOB_DAT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_GLOB_DAT", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_JMP_SLOT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_JMP_SLOT", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_RELATIVE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_RELATIVE", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_GOTOFF, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_GOTOFF", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_GOTPC, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_GOTPC", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_SH_GOTPLT32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_GOTPLT32", /* name */ + FALSE, /* partial_inplace */ + /* ??? Why not 0? */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + +#ifdef INCLUDE_SHMEDIA + /* Used in MOVI and SHORI (x & 65536). */ + HOWTO (R_SH_GOT_LOW16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOT_LOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 16) & 65536). */ + HOWTO (R_SH_GOT_MEDLOW16, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOT_MEDLOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 32) & 65536). */ + HOWTO (R_SH_GOT_MEDHI16, /* type */ + 32, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOT_MEDHI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 48) & 65536). */ + HOWTO (R_SH_GOT_HI16, /* type */ + 48, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOT_HI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI (x & 65536). */ + HOWTO (R_SH_GOTPLT_LOW16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTPLT_LOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 16) & 65536). */ + HOWTO (R_SH_GOTPLT_MEDLOW16, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTPLT_MEDLOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 32) & 65536). */ + HOWTO (R_SH_GOTPLT_MEDHI16, /* type */ + 32, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTPLT_MEDHI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 48) & 65536). */ + HOWTO (R_SH_GOTPLT_HI16, /* type */ + 48, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTPLT_HI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI (x & 65536). */ + HOWTO (R_SH_PLT_LOW16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_PLT_LOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 16) & 65536). */ + HOWTO (R_SH_PLT_MEDLOW16, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_PLT_MEDLOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 32) & 65536). */ + HOWTO (R_SH_PLT_MEDHI16, /* type */ + 32, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_PLT_MEDHI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 48) & 65536). */ + HOWTO (R_SH_PLT_HI16, /* type */ + 48, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_PLT_HI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in MOVI and SHORI (x & 65536). */ + HOWTO (R_SH_GOTOFF_LOW16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTOFF_LOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 16) & 65536). */ + HOWTO (R_SH_GOTOFF_MEDLOW16, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTOFF_MEDLOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 32) & 65536). */ + HOWTO (R_SH_GOTOFF_MEDHI16, /* type */ + 32, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTOFF_MEDHI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 48) & 65536). */ + HOWTO (R_SH_GOTOFF_HI16, /* type */ + 48, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTOFF_HI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI (x & 65536). */ + HOWTO (R_SH_GOTPC_LOW16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTPC_LOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 16) & 65536). */ + HOWTO (R_SH_GOTPC_MEDLOW16, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTPC_MEDLOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 32) & 65536). */ + HOWTO (R_SH_GOTPC_MEDHI16, /* type */ + 32, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTPC_MEDHI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 48) & 65536). */ + HOWTO (R_SH_GOTPC_HI16, /* type */ + 48, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTPC_HI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in LD.L, FLD.S et al. */ + HOWTO (R_SH_GOT10BY4, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOT10BY4", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in LD.L, FLD.S et al. */ + HOWTO (R_SH_GOTPLT10BY4, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTPLT10BY4", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in FLD.D, FST.P et al. */ + HOWTO (R_SH_GOT10BY8, /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 13, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOT10BY8", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in FLD.D, FST.P et al. */ + HOWTO (R_SH_GOTPLT10BY8, /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 13, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTPLT10BY8", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_COPY64, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_COPY64", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + ((bfd_vma) 0) - 1, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_GLOB_DAT64, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GLOB_DAT64", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + ((bfd_vma) 0) - 1, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_JMP_SLOT64, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_JMP_SLOT64", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + ((bfd_vma) 0) - 1, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_RELATIVE64, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_RELATIVE64", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + ((bfd_vma) 0) - 1, /* dst_mask */ + FALSE), /* pcrel_offset */ + + EMPTY_HOWTO (197), + EMPTY_HOWTO (198), + EMPTY_HOWTO (199), + EMPTY_HOWTO (200), + EMPTY_HOWTO (201), + EMPTY_HOWTO (202), + EMPTY_HOWTO (203), + EMPTY_HOWTO (204), + EMPTY_HOWTO (205), + EMPTY_HOWTO (206), + EMPTY_HOWTO (207), + EMPTY_HOWTO (208), + EMPTY_HOWTO (209), + EMPTY_HOWTO (210), + EMPTY_HOWTO (211), + EMPTY_HOWTO (212), + EMPTY_HOWTO (213), + EMPTY_HOWTO (214), + EMPTY_HOWTO (215), + EMPTY_HOWTO (216), + EMPTY_HOWTO (217), + EMPTY_HOWTO (218), + EMPTY_HOWTO (219), + EMPTY_HOWTO (220), + EMPTY_HOWTO (221), + EMPTY_HOWTO (222), + EMPTY_HOWTO (223), + EMPTY_HOWTO (224), + EMPTY_HOWTO (225), + EMPTY_HOWTO (226), + EMPTY_HOWTO (227), + EMPTY_HOWTO (228), + EMPTY_HOWTO (229), + EMPTY_HOWTO (230), + EMPTY_HOWTO (231), + EMPTY_HOWTO (232), + EMPTY_HOWTO (233), + EMPTY_HOWTO (234), + EMPTY_HOWTO (235), + EMPTY_HOWTO (236), + EMPTY_HOWTO (237), + EMPTY_HOWTO (238), + EMPTY_HOWTO (239), + EMPTY_HOWTO (240), + EMPTY_HOWTO (241), + + /* Relocations for SHmedia code. None of these are partial_inplace or + use the field being relocated (except R_SH_PT_16). */ + + /* The assembler will generate this reloc before a block of SHmedia + instructions. A section should be processed as assuming it contains + data, unless this reloc is seen. Note that a block of SHcompact + instructions are instead preceded by R_SH_CODE. + This is currently not implemented, but should be used for SHmedia + linker relaxation. */ + HOWTO (R_SH_SHMEDIA_CODE, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_SHMEDIA_CODE", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* The assembler will generate this reloc at a PTA or PTB instruction, + and the linker checks the right type of target, or changes a PTA to a + PTB, if the original insn was PT. */ + HOWTO (R_SH_PT_16, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 18, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_PT_16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in unexpanded MOVI. */ + HOWTO (R_SH_IMMS16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_IMMS16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in SHORI. */ + HOWTO (R_SH_IMMU16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_IMMU16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI (x & 65536). */ + HOWTO (R_SH_IMM_LOW16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_IMM_LOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x - $) & 65536). */ + HOWTO (R_SH_IMM_LOW16_PCREL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_IMM_LOW16_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 16) & 65536). */ + HOWTO (R_SH_IMM_MEDLOW16, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_IMM_MEDLOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI (((x - $) >> 16) & 65536). */ + HOWTO (R_SH_IMM_MEDLOW16_PCREL, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_IMM_MEDLOW16_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 32) & 65536). */ + HOWTO (R_SH_IMM_MEDHI16, /* type */ + 32, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_IMM_MEDHI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI (((x - $) >> 32) & 65536). */ + HOWTO (R_SH_IMM_MEDHI16_PCREL, /* type */ + 32, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_IMM_MEDHI16_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 48) & 65536). */ + HOWTO (R_SH_IMM_HI16, /* type */ + 48, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_IMM_HI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI (((x - $) >> 48) & 65536). */ + HOWTO (R_SH_IMM_HI16_PCREL, /* type */ + 48, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_IMM_HI16_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* For the .uaquad pseudo. */ + HOWTO (R_SH_64, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_64", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + ((bfd_vma) 0) - 1, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* For the .uaquad pseudo, (x - $). */ + HOWTO (R_SH_64_PCREL, /* type */ + 48, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_64_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + ((bfd_vma) 0) - 1, /* dst_mask */ + TRUE), /* pcrel_offset */ + +#endif +#undef SH_PARTIAL32 +#undef SH_SRC_MASK32 +#undef SH_ELF_RELOC diff --git a/bfd/elf32-sh-symbian.c b/bfd/elf32-sh-symbian.c index 477cf243e70..7ea9207009f 100644 --- a/bfd/elf32-sh-symbian.c +++ b/bfd/elf32-sh-symbian.c @@ -1,5 +1,5 @@ /* Renesas / SuperH specific support for Symbian 32-bit ELF files - Copyright 2004, 2005 + Copyright 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Red Hat @@ -26,8 +26,8 @@ #include "elf32-sh.c" -//#define DEBUG 1 -#define DEBUG 0 +//#define SYMBIAN_DEBUG 1 +#define SYMBIAN_DEBUG 0 #define DIRECTIVE_HEADER "##\n" #define DIRECTIVE_IMPORT "IMPORT " @@ -36,7 +36,7 @@ /* Macro to advance 's' until either it reaches 'e' or the character pointed to by 's' is equal to 'c'. If 'e' is - reached and DEBUG is enabled then the error message 'm' + reached and SYMBIAN_DEBUG is enabled then the error message 'm' is displayed. */ #define SKIP_UNTIL(s,e,c,m) \ do \ @@ -45,7 +45,7 @@ ++ s; \ if (s >= e) \ { \ - if (DEBUG) \ + if (SYMBIAN_DEBUG) \ fprintf (stderr, "Corrupt directive: %s\n", m); \ result = FALSE; \ } \ @@ -63,7 +63,7 @@ ++ s; \ if (s >= e) \ { \ - if (DEBUG) \ + if (SYMBIAN_DEBUG) \ fprintf (stderr, "Corrupt directive: %s\n", m); \ result = FALSE; \ } \ @@ -74,7 +74,7 @@ /* Macro to advance 's' until either it reaches 'e' or the character pointed to by 's' is not equal to 'c'. If 'e' - is reached and DEBUG is enabled then the error message + is reached and SYMBIAN_DEBUG is enabled then the error message 'm' is displayed. */ #define SKIP_WHILE(s,e,c,m) \ do \ @@ -83,7 +83,7 @@ ++ s; \ if (s >= e) \ { \ - if (DEBUG) \ + if (SYMBIAN_DEBUG) \ fprintf (stderr, "Corrupt directive: %s\n", m); \ result = FALSE; \ } \ @@ -114,7 +114,7 @@ sh_symbian_import_as (struct bfd_link_info *info, bfd * abfd, struct elf_link_hash_entry * new_hash; symbol_rename * node; - if (DEBUG) + if (SYMBIAN_DEBUG) fprintf (stderr, "IMPORT '%s' AS '%s'\n", current_name, new_name); for (node = rename_list; node; node = node->next) @@ -132,14 +132,14 @@ sh_symbian_import_as (struct bfd_link_info *info, bfd * abfd, if ((node = bfd_malloc (sizeof * node)) == NULL) { - if (DEBUG) + if (SYMBIAN_DEBUG) fprintf (stderr, "IMPORT AS: No mem for new rename node\n"); return FALSE; } if ((node->current_name = bfd_malloc (strlen (current_name) + 1)) == NULL) { - if (DEBUG) + if (SYMBIAN_DEBUG) fprintf (stderr, "IMPORT AS: No mem for current name field in rename node\n"); free (node); return FALSE; @@ -149,7 +149,7 @@ sh_symbian_import_as (struct bfd_link_info *info, bfd * abfd, if ((node->new_name = bfd_malloc (strlen (new_name) + 1)) == NULL) { - if (DEBUG) + if (SYMBIAN_DEBUG) fprintf (stderr, "IMPORT AS: No mem for new name field in rename node\n"); free (node->current_name); free (node); @@ -175,7 +175,7 @@ sh_symbian_import_as (struct bfd_link_info *info, bfd * abfd, static bfd_boolean sh_symbian_import (bfd * abfd ATTRIBUTE_UNUSED, char * name) { - if (DEBUG) + if (SYMBIAN_DEBUG) fprintf (stderr, "IMPORT '%s'\n", name); /* XXX: Generate an import somehow ? */ @@ -186,7 +186,7 @@ sh_symbian_import (bfd * abfd ATTRIBUTE_UNUSED, char * name) static bfd_boolean sh_symbian_export (bfd * abfd ATTRIBUTE_UNUSED, char * name) { - if (DEBUG) + if (SYMBIAN_DEBUG) fprintf (stderr, "EXPORT '%s'\n", name); /* XXX: Generate an export somehow ? */ @@ -225,7 +225,7 @@ sh_symbian_process_embedded_commands (struct bfd_link_info *info, bfd * abfd, break; case 'I': - if (strncmp (s, DIRECTIVE_IMPORT, strlen (DIRECTIVE_IMPORT))) + if (! CONST_STRNEQ (s, DIRECTIVE_IMPORT)) result = FALSE; else { @@ -261,12 +261,12 @@ sh_symbian_process_embedded_commands (struct bfd_link_info *info, bfd * abfd, name_end_char = * new_name_end; * new_name_end = 0; - /* Check to see if 'AS '... is present. If se we have an IMPORT AS - directive, otherwise we have an IMPORT directive. */ - if (strncmp (s, DIRECTIVE_AS, strlen (DIRECTIVE_AS))) + /* Check to see if 'AS '... is present. If so we have an + IMPORT AS directive, otherwise we have an IMPORT directive. */ + if (! CONST_STRNEQ (s, DIRECTIVE_AS)) { /* Skip the new-line at the end of the name. */ - if (DEBUG && name_end_char != '\n') + if (SYMBIAN_DEBUG && name_end_char != '\n') fprintf (stderr, "IMPORT: No newline at end of directive\n"); else s ++; @@ -276,7 +276,7 @@ sh_symbian_process_embedded_commands (struct bfd_link_info *info, bfd * abfd, /* Skip past the NUL character. */ if (* s ++ != 0) { - if (DEBUG) + if (SYMBIAN_DEBUG) fprintf (stderr, "IMPORT: No NUL at end of directive\n"); } } @@ -300,7 +300,7 @@ sh_symbian_process_embedded_commands (struct bfd_link_info *info, bfd * abfd, SKIP_WHILE (s, e, ' ', "IMPORT AS: Current name just followed by spaces"); /* Skip past the newline character. */ if (* s ++ != '\n') - if (DEBUG) + if (SYMBIAN_DEBUG) fprintf (stderr, "IMPORT AS: No newline at end of directive\n"); /* Terminate the current name after having performed the skips. */ @@ -311,7 +311,7 @@ sh_symbian_process_embedded_commands (struct bfd_link_info *info, bfd * abfd, /* The next character should be a NUL. */ if (* s != 0) { - if (DEBUG) + if (SYMBIAN_DEBUG) fprintf (stderr, "IMPORT AS: Junk at end of directive\n"); result = FALSE; } @@ -327,7 +327,7 @@ sh_symbian_process_embedded_commands (struct bfd_link_info *info, bfd * abfd, break; case 'E': - if (strncmp (s, DIRECTIVE_EXPORT, strlen (DIRECTIVE_EXPORT))) + if (! CONST_STRNEQ (s, DIRECTIVE_EXPORT)) result = FALSE; else { @@ -355,7 +355,7 @@ sh_symbian_process_embedded_commands (struct bfd_link_info *info, bfd * abfd, /* The next character should be a NUL. */ if (* s != 0) { - if (DEBUG) + if (SYMBIAN_DEBUG) fprintf (stderr, "EXPORT: Junk at end of directive\n"); result = FALSE; } @@ -373,7 +373,7 @@ sh_symbian_process_embedded_commands (struct bfd_link_info *info, bfd * abfd, if (! result) { - if (DEBUG) + if (SYMBIAN_DEBUG) fprintf (stderr, "offset into .directive section: %ld\n", (long) (directive - (char *) contents)); @@ -464,7 +464,7 @@ sh_symbian_relocate_section (bfd * output_bfd, if (ptr->current_hash == NULL) { - if (DEBUG) + if (SYMBIAN_DEBUG) fprintf (stderr, "IMPORT AS: current symbol '%s' does not exist\n", ptr->current_name); continue; } @@ -511,7 +511,7 @@ sh_symbian_relocate_section (bfd * output_bfd, if (new_hash->dynindx == -1) new_hash->def_regular = 1; - if (DEBUG) + if (SYMBIAN_DEBUG) fprintf (stderr, "Created new symbol %s\n", ptr->new_name); } @@ -521,7 +521,7 @@ sh_symbian_relocate_section (bfd * output_bfd, if (* h == new_hash) { ptr->new_symndx = h - sym_hashes + num_local_syms; - if (DEBUG) + if (SYMBIAN_DEBUG) fprintf (stderr, "Converted new hash to index of %ld\n", ptr->new_symndx); break; } @@ -539,7 +539,7 @@ sh_symbian_relocate_section (bfd * output_bfd, new_sym_hashes = bfd_alloc (input_bfd, num_global_syms * sizeof * sym_hashes); if (new_sym_hashes == NULL) { - if (DEBUG) + if (SYMBIAN_DEBUG) fprintf (stderr, "Out of memory extending hash table\n"); continue; } @@ -551,7 +551,7 @@ sh_symbian_relocate_section (bfd * output_bfd, ptr->new_symndx = num_global_syms - 1 + num_local_syms; - if (DEBUG) + if (SYMBIAN_DEBUG) fprintf (stderr, "Extended symbol hash table to insert new symbol as index %ld\n", ptr->new_symndx); } @@ -601,7 +601,7 @@ sh_symbian_relocate_section (bfd * output_bfd, if (h == ptr->current_hash) { BFD_ASSERT (ptr->new_symndx); - if (DEBUG) + if (SYMBIAN_DEBUG) fprintf (stderr, "convert reloc %lx from using index %ld to using index %ld\n", (long) rel->r_info, (long) ELF32_R_SYM (rel->r_info), ptr->new_symndx); rel->r_info = ELF32_R_INFO (ptr->new_symndx, r_type); diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index 118690d9a58..739d2d7b671 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -1,6 +1,6 @@ /* Renesas / SuperH SH specific support for 32-bit ELF Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006 Free Software Foundation, Inc. + 2006, 2007 Free Software Foundation, Inc. Contributed by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -19,11 +19,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" +#include "elf-vxworks.h" #include "elf/sh.h" #include "libiberty.h" #include "../opcodes/sh-opc.h" @@ -52,1722 +53,50 @@ static bfd_vma tpoff #define ELF_DYNAMIC_INTERPRETER "/usr/lib/libc.so.1" +#define MINUS_ONE ((bfd_vma) 0 - 1) + +#define SH_PARTIAL32 TRUE +#define SH_SRC_MASK32 0xffffffff +#define SH_ELF_RELOC sh_elf_reloc static reloc_howto_type sh_elf_howto_table[] = { - /* No relocation. */ - HOWTO (R_SH_NONE, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - sh_elf_ignore_reloc, /* special_function */ - "R_SH_NONE", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* 32 bit absolute relocation. Setting partial_inplace to TRUE and - src_mask to a non-zero value is similar to the COFF toolchain. */ - HOWTO (R_SH_DIR32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - sh_elf_reloc, /* special_function */ - "R_SH_DIR32", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* 32 bit PC relative relocation. */ - HOWTO (R_SH_REL32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - sh_elf_ignore_reloc, /* special_function */ - "R_SH_REL32", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* 8 bit PC relative branch divided by 2. */ - HOWTO (R_SH_DIR8WPN, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - sh_elf_ignore_reloc, /* special_function */ - "R_SH_DIR8WPN", /* name */ - TRUE, /* partial_inplace */ - 0xff, /* src_mask */ - 0xff, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* 12 bit PC relative branch divided by 2. */ - /* This cannot be partial_inplace because relaxation can't know the - eventual value of a symbol. */ - HOWTO (R_SH_IND12W, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 12, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - NULL, /* special_function */ - "R_SH_IND12W", /* name */ - FALSE, /* partial_inplace */ - 0x0, /* src_mask */ - 0xfff, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* 8 bit unsigned PC relative divided by 4. */ - HOWTO (R_SH_DIR8WPL, /* type */ - 2, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - sh_elf_ignore_reloc, /* special_function */ - "R_SH_DIR8WPL", /* name */ - TRUE, /* partial_inplace */ - 0xff, /* src_mask */ - 0xff, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* 8 bit unsigned PC relative divided by 2. */ - HOWTO (R_SH_DIR8WPZ, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - sh_elf_ignore_reloc, /* special_function */ - "R_SH_DIR8WPZ", /* name */ - TRUE, /* partial_inplace */ - 0xff, /* src_mask */ - 0xff, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* 8 bit GBR relative. FIXME: This only makes sense if we have some - special symbol for the GBR relative area, and that is not - implemented. */ - HOWTO (R_SH_DIR8BP, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - sh_elf_ignore_reloc, /* special_function */ - "R_SH_DIR8BP", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xff, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* 8 bit GBR relative divided by 2. FIXME: This only makes sense if - we have some special symbol for the GBR relative area, and that - is not implemented. */ - HOWTO (R_SH_DIR8W, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - sh_elf_ignore_reloc, /* special_function */ - "R_SH_DIR8W", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xff, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* 8 bit GBR relative divided by 4. FIXME: This only makes sense if - we have some special symbol for the GBR relative area, and that - is not implemented. */ - HOWTO (R_SH_DIR8L, /* type */ - 2, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - sh_elf_ignore_reloc, /* special_function */ - "R_SH_DIR8L", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xff, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* 8 bit PC relative divided by 2 - but specified in a very odd way. */ - HOWTO (R_SH_LOOP_START, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - sh_elf_ignore_reloc, /* special_function */ - "R_SH_LOOP_START", /* name */ - TRUE, /* partial_inplace */ - 0xff, /* src_mask */ - 0xff, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* 8 bit PC relative divided by 2 - but specified in a very odd way. */ - HOWTO (R_SH_LOOP_END, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - sh_elf_ignore_reloc, /* special_function */ - "R_SH_LOOP_END", /* name */ - TRUE, /* partial_inplace */ - 0xff, /* src_mask */ - 0xff, /* dst_mask */ - TRUE), /* pcrel_offset */ - - EMPTY_HOWTO (12), - EMPTY_HOWTO (13), - EMPTY_HOWTO (14), - EMPTY_HOWTO (15), - EMPTY_HOWTO (16), - EMPTY_HOWTO (17), - EMPTY_HOWTO (18), - EMPTY_HOWTO (19), - EMPTY_HOWTO (20), - EMPTY_HOWTO (21), - - /* The remaining relocs are a GNU extension used for relaxing. The - final pass of the linker never needs to do anything with any of - these relocs. Any required operations are handled by the - relaxation code. */ - - /* GNU extension to record C++ vtable hierarchy */ - HOWTO (R_SH_GNU_VTINHERIT, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - NULL, /* special_function */ - "R_SH_GNU_VTINHERIT", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* GNU extension to record C++ vtable member usage */ - HOWTO (R_SH_GNU_VTENTRY, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - _bfd_elf_rel_vtable_reloc_fn, /* special_function */ - "R_SH_GNU_VTENTRY", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* An 8 bit switch table entry. This is generated for an expression - such as ``.word L1 - L2''. The offset holds the difference - between the reloc address and L2. */ - HOWTO (R_SH_SWITCH8, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - sh_elf_ignore_reloc, /* special_function */ - "R_SH_SWITCH8", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* A 16 bit switch table entry. This is generated for an expression - such as ``.word L1 - L2''. The offset holds the difference - between the reloc address and L2. */ - HOWTO (R_SH_SWITCH16, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - sh_elf_ignore_reloc, /* special_function */ - "R_SH_SWITCH16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* A 32 bit switch table entry. This is generated for an expression - such as ``.long L1 - L2''. The offset holds the difference - between the reloc address and L2. */ - HOWTO (R_SH_SWITCH32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - sh_elf_ignore_reloc, /* special_function */ - "R_SH_SWITCH32", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* Indicates a .uses pseudo-op. The compiler will generate .uses - pseudo-ops when it finds a function call which can be relaxed. - The offset field holds the PC relative offset to the instruction - which loads the register used in the function call. */ - HOWTO (R_SH_USES, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - sh_elf_ignore_reloc, /* special_function */ - "R_SH_USES", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* The assembler will generate this reloc for addresses referred to - by the register loads associated with USES relocs. The offset - field holds the number of times the address is referenced in the - object file. */ - HOWTO (R_SH_COUNT, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - sh_elf_ignore_reloc, /* special_function */ - "R_SH_COUNT", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* Indicates an alignment statement. The offset field is the power - of 2 to which subsequent portions of the object file must be - aligned. */ - HOWTO (R_SH_ALIGN, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - sh_elf_ignore_reloc, /* special_function */ - "R_SH_ALIGN", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* The assembler will generate this reloc before a block of - instructions. A section should be processed as assuming it - contains data, unless this reloc is seen. */ - HOWTO (R_SH_CODE, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - sh_elf_ignore_reloc, /* special_function */ - "R_SH_CODE", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* The assembler will generate this reloc after a block of - instructions when it sees data that is not instructions. */ - HOWTO (R_SH_DATA, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - sh_elf_ignore_reloc, /* special_function */ - "R_SH_DATA", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* The assembler generates this reloc for each label within a block - of instructions. This permits the linker to avoid swapping - instructions which are the targets of branches. */ - HOWTO (R_SH_LABEL, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - sh_elf_ignore_reloc, /* special_function */ - "R_SH_LABEL", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* The next 12 are only supported via linking in SHC-generated objects. */ - HOWTO (R_SH_DIR16, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_DIR16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_DIR8, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_DIR8", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_DIR8UL, /* type */ - 2, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_DIR8UL", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_DIR8UW, /* type */ - 1, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_DIR8UW", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_DIR8U, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_DIR8U", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_DIR8SW, /* type */ - 1, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_DIR8SW", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_DIR8S, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_DIR8S", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_DIR4UL, /* type */ - 2, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 4, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_DIR4UL", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x0f, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_DIR4UW, /* type */ - 1, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 4, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_DIR4UW", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x0f, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_DIR4U, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 4, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_DIR4U", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x0f, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_PSHA, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 7, /* bitsize */ - FALSE, /* pc_relative */ - 4, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_PSHA", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x0f, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_PSHL, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 7, /* bitsize */ - FALSE, /* pc_relative */ - 4, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_PSHL", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x0f, /* dst_mask */ - FALSE), /* pcrel_offset */ - -#ifdef INCLUDE_SHMEDIA - /* Used in SHLLI.L and SHLRI.L. */ - HOWTO (R_SH_DIR5U, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 5, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_DIR5U", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xfc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in SHARI, SHLLI et al. */ - HOWTO (R_SH_DIR6U, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 6, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_DIR6U", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xfc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in BxxI, LDHI.L et al. */ - HOWTO (R_SH_DIR6S, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 6, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_DIR6S", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xfc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in ADDI, ANDI et al. */ - HOWTO (R_SH_DIR10S, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 10, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_DIR10S", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in LD.UW, ST.W et al. */ - HOWTO (R_SH_DIR10SW, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 11, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_DIR10SW", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in LD.L, FLD.S et al. */ - HOWTO (R_SH_DIR10SL, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 12, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_DIR10SL", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in FLD.D, FST.P et al. */ - HOWTO (R_SH_DIR10SQ, /* type */ - 3, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 13, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_DIR10SQ", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - -#else - EMPTY_HOWTO (45), - EMPTY_HOWTO (46), - EMPTY_HOWTO (47), - EMPTY_HOWTO (48), - EMPTY_HOWTO (49), - EMPTY_HOWTO (50), - EMPTY_HOWTO (51), -#endif - - EMPTY_HOWTO (52), - - HOWTO (R_SH_DIR16S, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_DIR16S", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - EMPTY_HOWTO (54), - EMPTY_HOWTO (55), - EMPTY_HOWTO (56), - EMPTY_HOWTO (57), - EMPTY_HOWTO (58), - EMPTY_HOWTO (59), - EMPTY_HOWTO (60), - EMPTY_HOWTO (61), - EMPTY_HOWTO (62), - EMPTY_HOWTO (63), - EMPTY_HOWTO (64), - EMPTY_HOWTO (65), - EMPTY_HOWTO (66), - EMPTY_HOWTO (67), - EMPTY_HOWTO (68), - EMPTY_HOWTO (69), - EMPTY_HOWTO (70), - EMPTY_HOWTO (71), - EMPTY_HOWTO (72), - EMPTY_HOWTO (73), - EMPTY_HOWTO (74), - EMPTY_HOWTO (75), - EMPTY_HOWTO (76), - EMPTY_HOWTO (77), - EMPTY_HOWTO (78), - EMPTY_HOWTO (79), - EMPTY_HOWTO (80), - EMPTY_HOWTO (81), - EMPTY_HOWTO (82), - EMPTY_HOWTO (83), - EMPTY_HOWTO (84), - EMPTY_HOWTO (85), - EMPTY_HOWTO (86), - EMPTY_HOWTO (87), - EMPTY_HOWTO (88), - EMPTY_HOWTO (89), - EMPTY_HOWTO (90), - EMPTY_HOWTO (91), - EMPTY_HOWTO (92), - EMPTY_HOWTO (93), - EMPTY_HOWTO (94), - EMPTY_HOWTO (95), - EMPTY_HOWTO (96), - EMPTY_HOWTO (97), - EMPTY_HOWTO (98), - EMPTY_HOWTO (99), - EMPTY_HOWTO (100), - EMPTY_HOWTO (101), - EMPTY_HOWTO (102), - EMPTY_HOWTO (103), - EMPTY_HOWTO (104), - EMPTY_HOWTO (105), - EMPTY_HOWTO (106), - EMPTY_HOWTO (107), - EMPTY_HOWTO (108), - EMPTY_HOWTO (109), - EMPTY_HOWTO (110), - EMPTY_HOWTO (111), - EMPTY_HOWTO (112), - EMPTY_HOWTO (113), - EMPTY_HOWTO (114), - EMPTY_HOWTO (115), - EMPTY_HOWTO (116), - EMPTY_HOWTO (117), - EMPTY_HOWTO (118), - EMPTY_HOWTO (119), - EMPTY_HOWTO (120), - EMPTY_HOWTO (121), - EMPTY_HOWTO (122), - EMPTY_HOWTO (123), - EMPTY_HOWTO (124), - EMPTY_HOWTO (125), - EMPTY_HOWTO (126), - EMPTY_HOWTO (127), - EMPTY_HOWTO (128), - EMPTY_HOWTO (129), - EMPTY_HOWTO (130), - EMPTY_HOWTO (131), - EMPTY_HOWTO (132), - EMPTY_HOWTO (133), - EMPTY_HOWTO (134), - EMPTY_HOWTO (135), - EMPTY_HOWTO (136), - EMPTY_HOWTO (137), - EMPTY_HOWTO (138), - EMPTY_HOWTO (139), - EMPTY_HOWTO (140), - EMPTY_HOWTO (141), - EMPTY_HOWTO (142), - EMPTY_HOWTO (143), - - HOWTO (R_SH_TLS_GD_32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* */ - "R_SH_TLS_GD_32", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_TLS_LD_32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* */ - "R_SH_TLS_LD_32", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_TLS_LDO_32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* */ - "R_SH_TLS_LDO_32", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_TLS_IE_32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* */ - "R_SH_TLS_IE_32", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_TLS_LE_32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* */ - "R_SH_TLS_LE_32", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_TLS_DTPMOD32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* */ - "R_SH_TLS_DTPMOD32", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_TLS_DTPOFF32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* */ - "R_SH_TLS_DTPOFF32", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_TLS_TPOFF32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* */ - "R_SH_TLS_TPOFF32", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - EMPTY_HOWTO (152), - EMPTY_HOWTO (153), - EMPTY_HOWTO (154), - EMPTY_HOWTO (155), - EMPTY_HOWTO (156), - EMPTY_HOWTO (157), - EMPTY_HOWTO (158), - EMPTY_HOWTO (159), - - HOWTO (R_SH_GOT32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* */ - "R_SH_GOT32", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_PLT32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* */ - "R_SH_PLT32", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - TRUE), /* pcrel_offset */ - - HOWTO (R_SH_COPY, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* */ - "R_SH_COPY", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_GLOB_DAT, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* */ - "R_SH_GLOB_DAT", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_JMP_SLOT, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* */ - "R_SH_JMP_SLOT", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_RELATIVE, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* */ - "R_SH_RELATIVE", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_GOTOFF, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* */ - "R_SH_GOTOFF", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_GOTPC, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* */ - "R_SH_GOTPC", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - TRUE), /* pcrel_offset */ - - HOWTO (R_SH_GOTPLT32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* */ - "R_SH_GOTPLT32", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - -#ifdef INCLUDE_SHMEDIA - /* Used in MOVI and SHORI (x & 65536). */ - HOWTO (R_SH_GOT_LOW16, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOT_LOW16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in MOVI and SHORI ((x >> 16) & 65536). */ - HOWTO (R_SH_GOT_MEDLOW16, /* type */ - 16, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOT_MEDLOW16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in MOVI and SHORI ((x >> 32) & 65536). */ - HOWTO (R_SH_GOT_MEDHI16, /* type */ - 32, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOT_MEDHI16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in MOVI and SHORI ((x >> 48) & 65536). */ - HOWTO (R_SH_GOT_HI16, /* type */ - 48, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOT_HI16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in MOVI and SHORI (x & 65536). */ - HOWTO (R_SH_GOTPLT_LOW16, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOTPLT_LOW16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in MOVI and SHORI ((x >> 16) & 65536). */ - HOWTO (R_SH_GOTPLT_MEDLOW16, /* type */ - 16, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOTPLT_MEDLOW16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in MOVI and SHORI ((x >> 32) & 65536). */ - HOWTO (R_SH_GOTPLT_MEDHI16, /* type */ - 32, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOTPLT_MEDHI16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in MOVI and SHORI ((x >> 48) & 65536). */ - HOWTO (R_SH_GOTPLT_HI16, /* type */ - 48, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOTPLT_HI16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in MOVI and SHORI (x & 65536). */ - HOWTO (R_SH_PLT_LOW16, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - TRUE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_PLT_LOW16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* Used in MOVI and SHORI ((x >> 16) & 65536). */ - HOWTO (R_SH_PLT_MEDLOW16, /* type */ - 16, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - TRUE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_PLT_MEDLOW16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* Used in MOVI and SHORI ((x >> 32) & 65536). */ - HOWTO (R_SH_PLT_MEDHI16, /* type */ - 32, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - TRUE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_PLT_MEDHI16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* Used in MOVI and SHORI ((x >> 48) & 65536). */ - HOWTO (R_SH_PLT_HI16, /* type */ - 48, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - TRUE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_PLT_HI16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* Used in MOVI and SHORI (x & 65536). */ - HOWTO (R_SH_GOTOFF_LOW16, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOTOFF_LOW16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in MOVI and SHORI ((x >> 16) & 65536). */ - HOWTO (R_SH_GOTOFF_MEDLOW16, /* type */ - 16, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOTOFF_MEDLOW16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in MOVI and SHORI ((x >> 32) & 65536). */ - HOWTO (R_SH_GOTOFF_MEDHI16, /* type */ - 32, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOTOFF_MEDHI16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in MOVI and SHORI ((x >> 48) & 65536). */ - HOWTO (R_SH_GOTOFF_HI16, /* type */ - 48, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOTOFF_HI16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in MOVI and SHORI (x & 65536). */ - HOWTO (R_SH_GOTPC_LOW16, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - TRUE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOTPC_LOW16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* Used in MOVI and SHORI ((x >> 16) & 65536). */ - HOWTO (R_SH_GOTPC_MEDLOW16, /* type */ - 16, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - TRUE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOTPC_MEDLOW16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* Used in MOVI and SHORI ((x >> 32) & 65536). */ - HOWTO (R_SH_GOTPC_MEDHI16, /* type */ - 32, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - TRUE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOTPC_MEDHI16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* Used in MOVI and SHORI ((x >> 48) & 65536). */ - HOWTO (R_SH_GOTPC_HI16, /* type */ - 48, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - TRUE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOTPC_HI16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* Used in LD.L, FLD.S et al. */ - HOWTO (R_SH_GOT10BY4, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 12, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOT10BY4", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in LD.L, FLD.S et al. */ - HOWTO (R_SH_GOTPLT10BY4, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 12, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOTPLT10BY4", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in FLD.D, FST.P et al. */ - HOWTO (R_SH_GOT10BY8, /* type */ - 3, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 13, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOT10BY8", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in FLD.D, FST.P et al. */ - HOWTO (R_SH_GOTPLT10BY8, /* type */ - 3, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 13, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_GOTPLT10BY8", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_COPY64, /* type */ - 0, /* rightshift */ - 4, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_COPY64", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - ((bfd_vma) 0) - 1, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_GLOB_DAT64, /* type */ - 0, /* rightshift */ - 4, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_GLOB_DAT64", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - ((bfd_vma) 0) - 1, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_JMP_SLOT64, /* type */ - 0, /* rightshift */ - 4, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_JMP_SLOT64", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - ((bfd_vma) 0) - 1, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_SH_RELATIVE64, /* type */ - 0, /* rightshift */ - 4, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_RELATIVE64", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - ((bfd_vma) 0) - 1, /* dst_mask */ - FALSE), /* pcrel_offset */ - - EMPTY_HOWTO (197), - EMPTY_HOWTO (198), - EMPTY_HOWTO (199), - EMPTY_HOWTO (200), - EMPTY_HOWTO (201), - EMPTY_HOWTO (202), - EMPTY_HOWTO (203), - EMPTY_HOWTO (204), - EMPTY_HOWTO (205), - EMPTY_HOWTO (206), - EMPTY_HOWTO (207), - EMPTY_HOWTO (208), - EMPTY_HOWTO (209), - EMPTY_HOWTO (210), - EMPTY_HOWTO (211), - EMPTY_HOWTO (212), - EMPTY_HOWTO (213), - EMPTY_HOWTO (214), - EMPTY_HOWTO (215), - EMPTY_HOWTO (216), - EMPTY_HOWTO (217), - EMPTY_HOWTO (218), - EMPTY_HOWTO (219), - EMPTY_HOWTO (220), - EMPTY_HOWTO (221), - EMPTY_HOWTO (222), - EMPTY_HOWTO (223), - EMPTY_HOWTO (224), - EMPTY_HOWTO (225), - EMPTY_HOWTO (226), - EMPTY_HOWTO (227), - EMPTY_HOWTO (228), - EMPTY_HOWTO (229), - EMPTY_HOWTO (230), - EMPTY_HOWTO (231), - EMPTY_HOWTO (232), - EMPTY_HOWTO (233), - EMPTY_HOWTO (234), - EMPTY_HOWTO (235), - EMPTY_HOWTO (236), - EMPTY_HOWTO (237), - EMPTY_HOWTO (238), - EMPTY_HOWTO (239), - EMPTY_HOWTO (240), - EMPTY_HOWTO (241), - - /* Relocations for SHmedia code. None of these are partial_inplace or - use the field being relocated (except R_SH_PT_16). */ - - /* The assembler will generate this reloc before a block of SHmedia - instructions. A section should be processed as assuming it contains - data, unless this reloc is seen. Note that a block of SHcompact - instructions are instead preceded by R_SH_CODE. - This is currently not implemented, but should be used for SHmedia - linker relaxation. */ - HOWTO (R_SH_SHMEDIA_CODE, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - sh_elf_ignore_reloc, /* special_function */ - "R_SH_SHMEDIA_CODE", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* The assembler will generate this reloc at a PTA or PTB instruction, - and the linker checks the right type of target, or changes a PTA to a - PTB, if the original insn was PT. */ - HOWTO (R_SH_PT_16, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 18, /* bitsize */ - TRUE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_PT_16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* Used in unexpanded MOVI. */ - HOWTO (R_SH_IMMS16, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_IMMS16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in SHORI. */ - HOWTO (R_SH_IMMU16, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_IMMU16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in MOVI and SHORI (x & 65536). */ - HOWTO (R_SH_IMM_LOW16, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_IMM_LOW16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in MOVI and SHORI ((x - $) & 65536). */ - HOWTO (R_SH_IMM_LOW16_PCREL, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - TRUE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_IMM_LOW16_PCREL", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* Used in MOVI and SHORI ((x >> 16) & 65536). */ - HOWTO (R_SH_IMM_MEDLOW16, /* type */ - 16, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_IMM_MEDLOW16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in MOVI and SHORI (((x - $) >> 16) & 65536). */ - HOWTO (R_SH_IMM_MEDLOW16_PCREL, /* type */ - 16, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - TRUE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_IMM_MEDLOW16_PCREL", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* Used in MOVI and SHORI ((x >> 32) & 65536). */ - HOWTO (R_SH_IMM_MEDHI16, /* type */ - 32, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_IMM_MEDHI16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in MOVI and SHORI (((x - $) >> 32) & 65536). */ - HOWTO (R_SH_IMM_MEDHI16_PCREL, /* type */ - 32, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - TRUE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_IMM_MEDHI16_PCREL", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* Used in MOVI and SHORI ((x >> 48) & 65536). */ - HOWTO (R_SH_IMM_HI16, /* type */ - 48, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_IMM_HI16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Used in MOVI and SHORI (((x - $) >> 48) & 65536). */ - HOWTO (R_SH_IMM_HI16_PCREL, /* type */ - 48, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - TRUE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_IMM_HI16_PCREL", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0x3fffc00, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* For the .uaquad pseudo. */ - HOWTO (R_SH_64, /* type */ - 0, /* rightshift */ - 4, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_64", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - ((bfd_vma) 0) - 1, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* For the .uaquad pseudo, (x - $). */ - HOWTO (R_SH_64_PCREL, /* type */ - 48, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - TRUE, /* pc_relative */ - 10, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_SH_64_PCREL", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - ((bfd_vma) 0) - 1, /* dst_mask */ - TRUE), /* pcrel_offset */ - -#endif +#include "elf32-sh-relocs.h" }; +#define SH_PARTIAL32 FALSE +#define SH_SRC_MASK32 0 +#define SH_ELF_RELOC bfd_elf_generic_reloc +static reloc_howto_type sh_vxworks_howto_table[] = +{ +#include "elf32-sh-relocs.h" +}; + +/* Return true if OUTPUT_BFD is a VxWorks object. */ + +static bfd_boolean +vxworks_object_p (bfd *abfd ATTRIBUTE_UNUSED) +{ +#if !defined INCLUDE_SHMEDIA && !defined SH_TARGET_ALREADY_DEFINED + extern const bfd_target bfd_elf32_shlvxworks_vec; + extern const bfd_target bfd_elf32_shvxworks_vec; + + return (abfd->xvec == &bfd_elf32_shlvxworks_vec + || abfd->xvec == &bfd_elf32_shvxworks_vec); +#else + return FALSE; +#endif +} + +/* Return the howto table for ABFD. */ + +static reloc_howto_type * +get_howto_table (bfd *abfd) +{ + if (vxworks_object_p (abfd)) + return sh_vxworks_howto_table; + return sh_elf_howto_table; +} + static bfd_reloc_status_type sh_elf_reloc_loop (int r_type ATTRIBUTE_UNUSED, bfd *input_bfd, asection *input_section, bfd_byte *contents, @@ -2057,18 +386,46 @@ static const struct elf_reloc_map sh_reloc_map[] = }; /* Given a BFD reloc code, return the howto structure for the - corresponding SH ELf reloc. */ + corresponding SH ELF reloc. */ static reloc_howto_type * -sh_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, - bfd_reloc_code_real_type code) +sh_elf_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) { unsigned int i; for (i = 0; i < sizeof (sh_reloc_map) / sizeof (struct elf_reloc_map); i++) { if (sh_reloc_map[i].bfd_reloc_val == code) - return &sh_elf_howto_table[(int) sh_reloc_map[i].elf_reloc_val]; + return get_howto_table (abfd) + (int) sh_reloc_map[i].elf_reloc_val; + } + + return NULL; +} + +static reloc_howto_type * +sh_elf_reloc_name_lookup (bfd *abfd, const char *r_name) +{ + unsigned int i; + + if (vxworks_object_p (abfd)) + { + for (i = 0; + i < (sizeof (sh_vxworks_howto_table) + / sizeof (sh_vxworks_howto_table[0])); + i++) + if (sh_vxworks_howto_table[i].name != NULL + && strcasecmp (sh_vxworks_howto_table[i].name, r_name) == 0) + return &sh_vxworks_howto_table[i]; + } + else + { + for (i = 0; + i < (sizeof (sh_elf_howto_table) + / sizeof (sh_elf_howto_table[0])); + i++) + if (sh_elf_howto_table[i].name != NULL + && strcasecmp (sh_elf_howto_table[i].name, r_name) == 0) + return &sh_elf_howto_table[i]; } return NULL; @@ -2077,8 +434,7 @@ sh_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Given an ELF reloc, fill in the howto field of a relent. */ static void -sh_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, - Elf_Internal_Rela *dst) +sh_elf_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r; @@ -2091,7 +447,7 @@ sh_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, BFD_ASSERT (r < R_SH_FIRST_INVALID_RELOC_4 || r > R_SH_LAST_INVALID_RELOC_4); BFD_ASSERT (r < R_SH_FIRST_INVALID_RELOC_5 || r > R_SH_LAST_INVALID_RELOC_5); - cache_ptr->howto = &sh_elf_howto_table[r]; + cache_ptr->howto = get_howto_table (abfd) + r; } /* This function handles relaxing for SH ELF. See the corresponding @@ -2276,7 +632,10 @@ sh_elf_relax_section (bfd *abfd, asection *sec, + h->root.u.def.section->output_offset); } - symval += bfd_get_32 (abfd, contents + paddr); + if (get_howto_table (abfd)[R_SH_DIR32].partial_inplace) + symval += bfd_get_32 (abfd, contents + paddr); + else + symval += irelfn->r_addend; /* See if this function call can be shortened. */ foff = (symval @@ -2284,7 +643,11 @@ sh_elf_relax_section (bfd *abfd, asection *sec, + sec->output_section->vma + sec->output_offset + 4)); - if (foff < -0x1000 || foff >= 0x1000) + /* A branch to an address beyond ours might be increased by an + .align that doesn't move when bytes behind us are deleted. + So, we add some slop in this calculation to allow for + that. */ + if (foff < -0x1000 || foff >= 0x1000 - 8) { /* After all that work, we can't shorten this function call. */ continue; @@ -2322,6 +685,12 @@ sh_elf_relax_section (bfd *abfd, asection *sec, irel->r_addend = -4; + /* When we calculated the symbol "value" we had an offset in the + DIR32's word in memory (we read and add it above). However, + the jsr we create does NOT have this offset encoded, so we + have to add it to the addend to preserve it. */ + irel->r_addend += bfd_get_32 (abfd, contents + paddr); + /* See if there is another R_SH_USES reloc referring to the same register load. */ for (irelscan = internal_relocs; irelscan < irelend; irelscan++) @@ -2591,10 +960,19 @@ sh_elf_relax_delete_bytes (bfd *abfd, asection *sec, bfd_vma addr, { bfd_vma val; - val = bfd_get_32 (abfd, contents + nraddr); - val += isym->st_value; - if (val > addr && val < toaddr) - bfd_put_32 (abfd, val - count, contents + nraddr); + if (get_howto_table (abfd)[R_SH_DIR32].partial_inplace) + { + val = bfd_get_32 (abfd, contents + nraddr); + val += isym->st_value; + if (val > addr && val < toaddr) + bfd_put_32 (abfd, val - count, contents + nraddr); + } + else + { + val = isym->st_value + irel->r_addend; + if (val > addr && val < toaddr) + irel->r_addend -= count; + } } } start = stop = addr; @@ -3144,15 +1522,50 @@ sh_elf_swap_insns (bfd *abfd, asection *sec, void *relocs, } #endif /* defined SH64_ELF */ +/* Describes one of the various PLT styles. */ + +struct elf_sh_plt_info +{ + /* The template for the first PLT entry, or NULL if there is no special + first entry. */ + const bfd_byte *plt0_entry; + + /* The size of PLT0_ENTRY in bytes, or 0 if PLT0_ENTRY is NULL. */ + bfd_vma plt0_entry_size; + + /* Index I is the offset into PLT0_ENTRY of a pointer to + _GLOBAL_OFFSET_TABLE_ + I * 4. The value is MINUS_ONE + if there is no such pointer. */ + bfd_vma plt0_got_fields[3]; + + /* The template for a symbol's PLT entry. */ + const bfd_byte *symbol_entry; + + /* The size of SYMBOL_ENTRY in bytes. */ + bfd_vma symbol_entry_size; + + /* Byte offsets of fields in SYMBOL_ENTRY. Not all fields are used + on all targets. The comments by each member indicate the value + that the field must hold. */ + struct { + bfd_vma got_entry; /* the address of the symbol's .got.plt entry */ + bfd_vma plt; /* .plt (or a branch to .plt on VxWorks) */ + bfd_vma reloc_offset; /* the offset of the symbol's JMP_SLOT reloc */ + } symbol_fields; + + /* The offset of the resolver stub from the start of SYMBOL_ENTRY. */ + bfd_vma symbol_resolve_offset; +}; + #ifdef INCLUDE_SHMEDIA /* The size in bytes of an entry in the procedure linkage table. */ -#define PLT_ENTRY_SIZE 64 +#define ELF_PLT_ENTRY_SIZE 64 /* First entry in an absolute procedure linkage table look like this. */ -static const bfd_byte elf_sh_plt0_entry_be[PLT_ENTRY_SIZE] = +static const bfd_byte elf_sh_plt0_entry_be[ELF_PLT_ENTRY_SIZE] = { 0xcc, 0x00, 0x01, 0x10, /* movi .got.plt >> 16, r17 */ 0xc8, 0x00, 0x01, 0x10, /* shori .got.plt & 65535, r17 */ @@ -3172,7 +1585,7 @@ static const bfd_byte elf_sh_plt0_entry_be[PLT_ENTRY_SIZE] = 0x6f, 0xf0, 0xff, 0xf0, /* nop */ }; -static const bfd_byte elf_sh_plt0_entry_le[PLT_ENTRY_SIZE] = +static const bfd_byte elf_sh_plt0_entry_le[ELF_PLT_ENTRY_SIZE] = { 0x10, 0x01, 0x00, 0xcc, /* movi .got.plt >> 16, r17 */ 0x10, 0x01, 0x00, 0xc8, /* shori .got.plt & 65535, r17 */ @@ -3195,7 +1608,7 @@ static const bfd_byte elf_sh_plt0_entry_le[PLT_ENTRY_SIZE] = /* Sebsequent entries in an absolute procedure linkage table look like this. */ -static const bfd_byte elf_sh_plt_entry_be[PLT_ENTRY_SIZE] = +static const bfd_byte elf_sh_plt_entry_be[ELF_PLT_ENTRY_SIZE] = { 0xcc, 0x00, 0x01, 0x90, /* movi nameN-in-GOT >> 16, r25 */ 0xc8, 0x00, 0x01, 0x90, /* shori nameN-in-GOT & 65535, r25 */ @@ -3215,7 +1628,7 @@ static const bfd_byte elf_sh_plt_entry_be[PLT_ENTRY_SIZE] = 0x6f, 0xf0, 0xff, 0xf0, /* nop */ }; -static const bfd_byte elf_sh_plt_entry_le[PLT_ENTRY_SIZE] = +static const bfd_byte elf_sh_plt_entry_le[ELF_PLT_ENTRY_SIZE] = { 0x90, 0x01, 0x00, 0xcc, /* movi nameN-in-GOT >> 16, r25 */ 0x90, 0x01, 0x00, 0xc8, /* shori nameN-in-GOT & 65535, r25 */ @@ -3237,7 +1650,7 @@ static const bfd_byte elf_sh_plt_entry_le[PLT_ENTRY_SIZE] = /* Entries in a PIC procedure linkage table look like this. */ -static const bfd_byte elf_sh_pic_plt_entry_be[PLT_ENTRY_SIZE] = +static const bfd_byte elf_sh_pic_plt_entry_be[ELF_PLT_ENTRY_SIZE] = { 0xcc, 0x00, 0x01, 0x90, /* movi nameN@GOT >> 16, r25 */ 0xc8, 0x00, 0x01, 0x90, /* shori nameN@GOT & 65535, r25 */ @@ -3257,7 +1670,7 @@ static const bfd_byte elf_sh_pic_plt_entry_be[PLT_ENTRY_SIZE] = 0x44, 0x01, 0xff, 0xf0, /* blink tr0, r63 */ }; -static const bfd_byte elf_sh_pic_plt_entry_le[PLT_ENTRY_SIZE] = +static const bfd_byte elf_sh_pic_plt_entry_le[ELF_PLT_ENTRY_SIZE] = { 0x90, 0x01, 0x00, 0xcc, /* movi nameN@GOT >> 16, r25 */ 0x90, 0x01, 0x00, 0xc8, /* shori nameN@GOT & 65535, r25 */ @@ -3277,31 +1690,67 @@ static const bfd_byte elf_sh_pic_plt_entry_le[PLT_ENTRY_SIZE] = 0xf0, 0xff, 0x01, 0x44, /* blink tr0, r63 */ }; -static const bfd_byte *elf_sh_plt0_entry; -static const bfd_byte *elf_sh_plt_entry; -static const bfd_byte *elf_sh_pic_plt_entry; - -/* Return size of a PLT entry. */ -#define elf_sh_sizeof_plt(info) PLT_ENTRY_SIZE - -/* Return offset of the PLT0 address in an absolute PLT entry. */ -#define elf_sh_plt_plt0_offset(info) 32 +static const struct elf_sh_plt_info elf_sh_plts[2][2] = { + { + { + /* Big-endian non-PIC. */ + elf_sh_plt0_entry_be, + ELF_PLT_ENTRY_SIZE, + { 0, MINUS_ONE, MINUS_ONE }, + elf_sh_plt_entry_be, + ELF_PLT_ENTRY_SIZE, + { 0, 32, 48 }, + 33 /* includes ISA encoding */ + }, + { + /* Little-endian non-PIC. */ + elf_sh_plt0_entry_le, + ELF_PLT_ENTRY_SIZE, + { 0, MINUS_ONE, MINUS_ONE }, + elf_sh_plt_entry_le, + ELF_PLT_ENTRY_SIZE, + { 0, 32, 48 }, + 33 /* includes ISA encoding */ + }, + }, + { + { + /* Big-endian PIC. */ + elf_sh_plt0_entry_be, + ELF_PLT_ENTRY_SIZE, + { MINUS_ONE, MINUS_ONE, MINUS_ONE }, + elf_sh_pic_plt_entry_be, + ELF_PLT_ENTRY_SIZE, + { 0, MINUS_ONE, 52 }, + 33 /* includes ISA encoding */ + }, + { + /* Little-endian PIC. */ + elf_sh_plt0_entry_le, + ELF_PLT_ENTRY_SIZE, + { MINUS_ONE, MINUS_ONE, MINUS_ONE }, + elf_sh_pic_plt_entry_le, + ELF_PLT_ENTRY_SIZE, + { 0, MINUS_ONE, 52 }, + 33 /* includes ISA encoding */ + }, + } +}; /* Return offset of the linker in PLT0 entry. */ #define elf_sh_plt0_gotplt_offset(info) 0 -/* Return offset of the trampoline in PLT entry */ -#define elf_sh_plt_temp_offset(info) 33 /* Add one because it's SHmedia. */ +/* Install a 32-bit PLT field starting at ADDR, which occurs in OUTPUT_BFD. + VALUE is the field's value and CODE_P is true if VALUE refers to code, + not data. -/* Return offset of the symbol in PLT entry. */ -#define elf_sh_plt_symbol_offset(info) 0 - -/* Return offset of the relocation in PLT entry. */ -#define elf_sh_plt_reloc_offset(info) (info->shared ? 52 : 44) + On SH64, each 32-bit field is loaded by a movi/shori pair. */ inline static void -movi_shori_putval (bfd *output_bfd, unsigned long value, bfd_byte *addr) +install_plt_field (bfd *output_bfd, bfd_boolean code_p, + unsigned long value, bfd_byte *addr) { + value |= code_p; bfd_put_32 (output_bfd, bfd_get_32 (output_bfd, addr) | ((value >> 6) & 0x3fffc00), @@ -3312,10 +1761,18 @@ movi_shori_putval (bfd *output_bfd, unsigned long value, bfd_byte *addr) addr + 4); } +/* Return the type of PLT associated with ABFD. PIC_P is true if + the object is position-independent. */ + +static const struct elf_sh_plt_info * +get_plt_info (bfd *abfd ATTRIBUTE_UNUSED, bfd_boolean pic_p) +{ + return &elf_sh_plts[pic_p][!bfd_big_endian (abfd)]; +} #else /* The size in bytes of an entry in the procedure linkage table. */ -#define PLT_ENTRY_SIZE 28 +#define ELF_PLT_ENTRY_SIZE 28 /* First entry in an absolute procedure linkage table look like this. */ @@ -3327,7 +1784,7 @@ movi_shori_putval (bfd *output_bfd, unsigned long value, bfd_byte *addr) ignores the type. Loaders can easily detect this difference however, since the type will always be 0 or 8, and the GOT ids will always be greater than or equal to 12. */ -static const bfd_byte elf_sh_plt0_entry_be[PLT_ENTRY_SIZE] = +static const bfd_byte elf_sh_plt0_entry_be[ELF_PLT_ENTRY_SIZE] = { 0xd0, 0x05, /* mov.l 2f,r0 */ 0x60, 0x02, /* mov.l @r0,r0 */ @@ -3343,7 +1800,7 @@ static const bfd_byte elf_sh_plt0_entry_be[PLT_ENTRY_SIZE] = 0, 0, 0, 0, /* 2: replaced with address of .got.plt + 4. */ }; -static const bfd_byte elf_sh_plt0_entry_le[PLT_ENTRY_SIZE] = +static const bfd_byte elf_sh_plt0_entry_le[ELF_PLT_ENTRY_SIZE] = { 0x05, 0xd0, /* mov.l 2f,r0 */ 0x02, 0x60, /* mov.l @r0,r0 */ @@ -3362,10 +1819,10 @@ static const bfd_byte elf_sh_plt0_entry_le[PLT_ENTRY_SIZE] = /* Sebsequent entries in an absolute procedure linkage table look like this. */ -static const bfd_byte elf_sh_plt_entry_be[PLT_ENTRY_SIZE] = +static const bfd_byte elf_sh_plt_entry_be[ELF_PLT_ENTRY_SIZE] = { 0xd0, 0x04, /* mov.l 1f,r0 */ - 0x60, 0x02, /* mov.l @r0,r0 */ + 0x60, 0x02, /* mov.l @(r0,r12),r0 */ 0xd1, 0x02, /* mov.l 0f,r1 */ 0x40, 0x2b, /* jmp @r0 */ 0x60, 0x13, /* mov r1,r0 */ @@ -3377,7 +1834,7 @@ static const bfd_byte elf_sh_plt_entry_be[PLT_ENTRY_SIZE] = 0, 0, 0, 0, /* 2: replaced with offset into relocation table. */ }; -static const bfd_byte elf_sh_plt_entry_le[PLT_ENTRY_SIZE] = +static const bfd_byte elf_sh_plt_entry_le[ELF_PLT_ENTRY_SIZE] = { 0x04, 0xd0, /* mov.l 1f,r0 */ 0x02, 0x60, /* mov.l @r0,r0 */ @@ -3394,7 +1851,7 @@ static const bfd_byte elf_sh_plt_entry_le[PLT_ENTRY_SIZE] = /* Entries in a PIC procedure linkage table look like this. */ -static const bfd_byte elf_sh_pic_plt_entry_be[PLT_ENTRY_SIZE] = +static const bfd_byte elf_sh_pic_plt_entry_be[ELF_PLT_ENTRY_SIZE] = { 0xd0, 0x04, /* mov.l 1f,r0 */ 0x00, 0xce, /* mov.l @(r0,r12),r0 */ @@ -3410,7 +1867,7 @@ static const bfd_byte elf_sh_pic_plt_entry_be[PLT_ENTRY_SIZE] = 0, 0, 0, 0 /* 2: replaced with offset into relocation table. */ }; -static const bfd_byte elf_sh_pic_plt_entry_le[PLT_ENTRY_SIZE] = +static const bfd_byte elf_sh_pic_plt_entry_le[ELF_PLT_ENTRY_SIZE] = { 0x04, 0xd0, /* mov.l 1f,r0 */ 0xce, 0x00, /* mov.l @(r0,r12),r0 */ @@ -3426,32 +1883,216 @@ static const bfd_byte elf_sh_pic_plt_entry_le[PLT_ENTRY_SIZE] = 0, 0, 0, 0 /* 2: replaced with offset into relocation table. */ }; -static const bfd_byte *elf_sh_plt0_entry; -static const bfd_byte *elf_sh_plt_entry; -static const bfd_byte *elf_sh_pic_plt_entry; +static const struct elf_sh_plt_info elf_sh_plts[2][2] = { + { + { + /* Big-endian non-PIC. */ + elf_sh_plt0_entry_be, + ELF_PLT_ENTRY_SIZE, + { MINUS_ONE, 24, 20 }, + elf_sh_plt_entry_be, + ELF_PLT_ENTRY_SIZE, + { 20, 16, 24 }, + 8 + }, + { + /* Little-endian non-PIC. */ + elf_sh_plt0_entry_le, + ELF_PLT_ENTRY_SIZE, + { MINUS_ONE, 24, 20 }, + elf_sh_plt_entry_le, + ELF_PLT_ENTRY_SIZE, + { 20, 16, 24 }, + 8 + }, + }, + { + { + /* Big-endian PIC. */ + elf_sh_plt0_entry_be, + ELF_PLT_ENTRY_SIZE, + { MINUS_ONE, MINUS_ONE, MINUS_ONE }, + elf_sh_pic_plt_entry_be, + ELF_PLT_ENTRY_SIZE, + { 20, MINUS_ONE, 24 }, + 8 + }, + { + /* Little-endian PIC. */ + elf_sh_plt0_entry_le, + ELF_PLT_ENTRY_SIZE, + { MINUS_ONE, MINUS_ONE, MINUS_ONE }, + elf_sh_pic_plt_entry_le, + ELF_PLT_ENTRY_SIZE, + { 20, MINUS_ONE, 24 }, + 8 + }, + } +}; -/* Return size of a PLT entry. */ -#define elf_sh_sizeof_plt(info) PLT_ENTRY_SIZE +#define VXWORKS_PLT_HEADER_SIZE 12 +#define VXWORKS_PLT_ENTRY_SIZE 24 -/* Return offset of the PLT0 address in an absolute PLT entry. */ -#define elf_sh_plt_plt0_offset(info) 16 +static const bfd_byte vxworks_sh_plt0_entry_be[VXWORKS_PLT_HEADER_SIZE] = +{ + 0xd1, 0x01, /* mov.l @(8,pc),r1 */ + 0x61, 0x12, /* mov.l @r1,r1 */ + 0x41, 0x2b, /* jmp @r1 */ + 0x00, 0x09, /* nop */ + 0, 0, 0, 0 /* 0: replaced with _GLOBAL_OFFSET_TABLE+8. */ +}; -/* Return offset of the linker in PLT0 entry. */ -#define elf_sh_plt0_linker_offset(info) 20 +static const bfd_byte vxworks_sh_plt0_entry_le[VXWORKS_PLT_HEADER_SIZE] = +{ + 0x01, 0xd1, /* mov.l @(8,pc),r1 */ + 0x12, 0x61, /* mov.l @r1,r1 */ + 0x2b, 0x41, /* jmp @r1 */ + 0x09, 0x00, /* nop */ + 0, 0, 0, 0 /* 0: replaced with _GLOBAL_OFFSET_TABLE+8. */ +}; -/* Return offset of the GOT id in PLT0 entry. */ -#define elf_sh_plt0_gotid_offset(info) 24 +static const bfd_byte vxworks_sh_plt_entry_be[VXWORKS_PLT_ENTRY_SIZE] = +{ + 0xd0, 0x01, /* mov.l @(8,pc),r0 */ + 0x60, 0x02, /* mov.l @r0,r0 */ + 0x40, 0x2b, /* jmp @r0 */ + 0x00, 0x09, /* nop */ + 0, 0, 0, 0, /* 0: replaced with address of this symbol in .got. */ + 0xd0, 0x01, /* mov.l @(8,pc),r0 */ + 0xa0, 0x00, /* bra PLT (We need to fix the offset.) */ + 0x00, 0x09, /* nop */ + 0x00, 0x09, /* nop */ + 0, 0, 0, 0, /* 1: replaced with offset into relocation table. */ +}; -/* Return offset of the temporary in PLT entry */ -#define elf_sh_plt_temp_offset(info) 8 +static const bfd_byte vxworks_sh_plt_entry_le[VXWORKS_PLT_ENTRY_SIZE] = +{ + 0x01, 0xd0, /* mov.l @(8,pc),r0 */ + 0x02, 0x60, /* mov.l @r0,r0 */ + 0x2b, 0x40, /* jmp @r0 */ + 0x09, 0x00, /* nop */ + 0, 0, 0, 0, /* 0: replaced with address of this symbol in .got. */ + 0x01, 0xd0, /* mov.l @(8,pc),r0 */ + 0x00, 0xa0, /* bra PLT (We need to fix the offset.) */ + 0x09, 0x00, /* nop */ + 0x09, 0x00, /* nop */ + 0, 0, 0, 0, /* 1: replaced with offset into relocation table. */ +}; -/* Return offset of the symbol in PLT entry. */ -#define elf_sh_plt_symbol_offset(info) 20 +static const bfd_byte vxworks_sh_pic_plt_entry_be[VXWORKS_PLT_ENTRY_SIZE] = +{ + 0xd0, 0x01, /* mov.l @(8,pc),r0 */ + 0x00, 0xce, /* mov.l @(r0,r12),r0 */ + 0x40, 0x2b, /* jmp @r0 */ + 0x00, 0x09, /* nop */ + 0, 0, 0, 0, /* 0: replaced with offset of this symbol in .got. */ + 0xd0, 0x01, /* mov.l @(8,pc),r0 */ + 0x51, 0xc2, /* mov.l @(8,r12),r1 */ + 0x41, 0x2b, /* jmp @r1 */ + 0x00, 0x09, /* nop */ + 0, 0, 0, 0, /* 1: replaced with offset into relocation table. */ +}; -/* Return offset of the relocation in PLT entry. */ -#define elf_sh_plt_reloc_offset(info) 24 +static const bfd_byte vxworks_sh_pic_plt_entry_le[VXWORKS_PLT_ENTRY_SIZE] = +{ + 0x01, 0xd0, /* mov.l @(8,pc),r0 */ + 0xce, 0x00, /* mov.l @(r0,r12),r0 */ + 0x2b, 0x40, /* jmp @r0 */ + 0x09, 0x00, /* nop */ + 0, 0, 0, 0, /* 0: replaced with offset of this symbol in .got. */ + 0x01, 0xd0, /* mov.l @(8,pc),r0 */ + 0xc2, 0x51, /* mov.l @(8,r12),r1 */ + 0x2b, 0x41, /* jmp @r1 */ + 0x09, 0x00, /* nop */ + 0, 0, 0, 0, /* 1: replaced with offset into relocation table. */ +}; + +static const struct elf_sh_plt_info vxworks_sh_plts[2][2] = { + { + { + /* Big-endian non-PIC. */ + vxworks_sh_plt0_entry_be, + VXWORKS_PLT_HEADER_SIZE, + { MINUS_ONE, MINUS_ONE, 8 }, + vxworks_sh_plt_entry_be, + VXWORKS_PLT_ENTRY_SIZE, + { 8, 14, 20 }, + 12 + }, + { + /* Little-endian non-PIC. */ + vxworks_sh_plt0_entry_le, + VXWORKS_PLT_HEADER_SIZE, + { MINUS_ONE, MINUS_ONE, 8 }, + vxworks_sh_plt_entry_le, + VXWORKS_PLT_ENTRY_SIZE, + { 8, 14, 20 }, + 12 + }, + }, + { + { + /* Big-endian PIC. */ + NULL, + 0, + { MINUS_ONE, MINUS_ONE, MINUS_ONE }, + vxworks_sh_pic_plt_entry_be, + VXWORKS_PLT_ENTRY_SIZE, + { 8, MINUS_ONE, 20 }, + 12 + }, + { + /* Little-endian PIC. */ + NULL, + 0, + { MINUS_ONE, MINUS_ONE, MINUS_ONE }, + vxworks_sh_pic_plt_entry_le, + VXWORKS_PLT_ENTRY_SIZE, + { 8, MINUS_ONE, 20 }, + 12 + }, + } +}; + +/* Return the type of PLT associated with ABFD. PIC_P is true if + the object is position-independent. */ + +static const struct elf_sh_plt_info * +get_plt_info (bfd *abfd ATTRIBUTE_UNUSED, bfd_boolean pic_p) +{ + if (vxworks_object_p (abfd)) + return &vxworks_sh_plts[pic_p][!bfd_big_endian (abfd)]; + return &elf_sh_plts[pic_p][!bfd_big_endian (abfd)]; +} + +/* Install a 32-bit PLT field starting at ADDR, which occurs in OUTPUT_BFD. + VALUE is the field's value and CODE_P is true if VALUE refers to code, + not data. */ + +inline static void +install_plt_field (bfd *output_bfd, bfd_boolean code_p ATTRIBUTE_UNUSED, + unsigned long value, bfd_byte *addr) +{ + bfd_put_32 (output_bfd, value, addr); +} #endif +/* Return the index of the PLT entry at byte offset OFFSET. */ + +static bfd_vma +get_plt_index (const struct elf_sh_plt_info *info, bfd_vma offset) +{ + return (offset - info->plt0_entry_size) / info->symbol_entry_size; +} + +/* Do the inverse operation. */ + +static bfd_vma +get_plt_offset (const struct elf_sh_plt_info *info, bfd_vma index) +{ + return info->plt0_entry_size + (index * info->symbol_entry_size); +} + /* The sh linker needs to keep track of the number of relocs that it decides to copy as dynamic relocs in check_relocs for each symbol. This is so that it can later discard them if they are found to be @@ -3518,11 +2159,14 @@ struct sh_elf_obj_tdata static bfd_boolean sh_elf_mkobject (bfd *abfd) { - bfd_size_type amt = sizeof (struct sh_elf_obj_tdata); - abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) - return FALSE; - return TRUE; + { + bfd_size_type amt = sizeof (struct sh_elf_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + } + return bfd_elf_mkobject (abfd); } /* sh ELF linker hash table. */ @@ -3540,6 +2184,9 @@ struct elf_sh_link_hash_table asection *sdynbss; asection *srelbss; + /* The (unloaded but important) VxWorks .rela.plt.unloaded section. */ + asection *srelplt2; + /* Small local sym to section mapping cache. */ struct sym_sec_cache sym_sec; @@ -3549,6 +2196,12 @@ struct elf_sh_link_hash_table bfd_signed_vma refcount; bfd_vma offset; } tls_ldm_got; + + /* The type of PLT to use. */ + const struct elf_sh_plt_info *plt_info; + + /* True if the target system is VxWorks. */ + bfd_boolean vxworks_p; }; /* Traverse an sh ELF linker hash table. */ @@ -3627,8 +2280,11 @@ sh_elf_link_hash_table_create (bfd *abfd) ret->srelplt = NULL; ret->sdynbss = NULL; ret->srelbss = NULL; + ret->srelplt2 = NULL; ret->sym_sec.abfd = NULL; ret->tls_ldm_got.refcount = 0; + ret->plt_info = NULL; + ret->vxworks_p = vxworks_object_p (abfd); return &ret->root.root; } @@ -3810,6 +2466,12 @@ sh_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) } } + if (htab->vxworks_p) + { + if (!elf_vxworks_create_dynamic_sections (abfd, info, &htab->srelplt2)) + return FALSE; + } + return TRUE; } @@ -3827,7 +2489,6 @@ sh_elf_adjust_dynamic_symbol (struct bfd_link_info *info, struct elf_sh_link_hash_entry *eh; struct elf_sh_dyn_relocs *p; asection *s; - unsigned int power_of_two; htab = sh_elf_hash_table (info); @@ -3951,28 +2612,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 3) - power_of_two = 3; - - /* Apply the required alignment. */ - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (htab->root.dynobj, s)) - { - if (! bfd_set_section_alignment (htab->root.dynobj, s, power_of_two)) - return FALSE; - } - - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -4032,7 +2672,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) /* If this is the first .plt entry, make room for the special first entry. */ if (s->size == 0) - s->size += PLT_ENTRY_SIZE; + s->size += htab->plt_info->plt0_entry_size; h->plt.offset = s->size; @@ -4049,7 +2689,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) } /* Make room for this entry. */ - s->size += PLT_ENTRY_SIZE; + s->size += htab->plt_info->symbol_entry_size; /* We also need to make an entry in the .got.plt section, which will be placed in the .got section by the linker script. */ @@ -4057,6 +2697,23 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) /* We also need to make an entry in the .rel.plt section. */ htab->srelplt->size += sizeof (Elf32_External_Rela); + + if (htab->vxworks_p && !info->shared) + { + /* VxWorks executables have a second set of relocations + for each PLT entry. They go in a separate relocation + section, which is processed by the kernel loader. */ + + /* There is a relocation for the initial PLT entry: + an R_SH_DIR32 relocation for _GLOBAL_OFFSET_TABLE_. */ + if (h->plt.offset == htab->plt_info->plt0_entry_size) + htab->srelplt2->size += sizeof (Elf32_External_Rela); + + /* There are two extra relocations for each subsequent + PLT entry: an R_SH_DIR32 relocation for the GOT entry, + and an R_SH_DIR32 relocation for the PLT entry. */ + htab->srelplt2->size += sizeof (Elf32_External_Rela) * 2; + } } else { @@ -4250,6 +2907,17 @@ readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf) return TRUE; } +/* This function is called after all the input files have been read, + and the input sections have been assigned to output sections. + It's a convenient place to determine the PLT style. */ + +static bfd_boolean +sh_elf_always_size_sections (bfd *output_bfd, struct bfd_link_info *info) +{ + sh_elf_hash_table (info)->plt_info = get_plt_info (output_bfd, info->shared); + return TRUE; +} + /* Set the sizes of the dynamic sections. */ static bfd_boolean @@ -4381,9 +3049,9 @@ sh_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* Strip this section if we don't need it; see the comment below. */ } - else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) + else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela")) { - if (s->size != 0 && s != htab->srelplt) + if (s->size != 0 && s != htab->srelplt && s != htab->srelplt2) relocs = TRUE; /* We use the reloc_count field as a counter if we need @@ -4554,7 +3222,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, return FALSE; } - howto = sh_elf_howto_table + r_type; + howto = get_howto_table (output_bfd) + r_type; /* For relocs that aren't partial_inplace, we get the addend from the relocation. */ @@ -4579,13 +3247,16 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, (info, _("Unexpected STO_SH5_ISA32 on local symbol is not handled"), input_bfd, input_section, rel->r_offset)); - if (info->relocatable) + + if (sec != NULL && elf_discarded_section (sec)) + /* Handled below. */ + ; + else if (info->relocatable) { /* This is a relocatable link. We don't have to change anything, unless the reloc is against a section symbol, in which case we have to adjust according to where the section symbol winds up in the output section. */ - sym = local_syms + r_symndx; if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) { if (! howto->partial_inplace) @@ -4594,7 +3265,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, relocation, we need just to update the addend. All real relocs are of type partial_inplace; this code is mostly for completeness. */ - rel->r_addend += sec->output_offset + sym->st_value; + rel->r_addend += sec->output_offset; continue; } @@ -4649,12 +3320,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { /* FIXME: Ought to make use of the RELOC_FOR_GLOBAL_SYMBOL macro. */ - /* Section symbol are never (?) placed in the hash table, so - we can just ignore hash relocations when creating a - relocatable object file. */ - if (info->relocatable) - continue; - + relocation = 0; h = sym_hashes[r_symndx - symtab_hdr->sh_info]; while (h->root.type == bfd_link_hash_indirect || h->root.type == bfd_link_hash_warning) @@ -4725,8 +3391,17 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, || (sec->output_section == NULL && (sh_elf_hash_entry (h)->tls_type == GOT_TLS_IE || sh_elf_hash_entry (h)->tls_type == GOT_TLS_GD))) - relocation = 0; - else if (sec->output_section == NULL) + ; + else if (sec->output_section != NULL) + relocation = ((h->root.u.def.value + + sec->output_section->vma + + sec->output_offset) + /* A STO_SH5_ISA32 causes a "bitor 1" to the + symbol value, unless we've seen + STT_DATALABEL on the way to it. */ + | ((h->other & STO_SH5_ISA32) != 0 + && ! seen_stt_datalabel)); + else if (!info->relocatable) { (*_bfd_error_handler) (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"), @@ -4737,22 +3412,13 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, h->root.root.string); return FALSE; } - else - relocation = ((h->root.u.def.value - + sec->output_section->vma - + sec->output_offset) - /* A STO_SH5_ISA32 causes a "bitor 1" to the - symbol value, unless we've seen - STT_DATALABEL on the way to it. */ - | ((h->other & STO_SH5_ISA32) != 0 - && ! seen_stt_datalabel)); } else if (h->root.type == bfd_link_hash_undefweak) - relocation = 0; + ; else if (info->unresolved_syms_in_objects == RM_IGNORE && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - relocation = 0; - else + ; + else if (!info->relocatable) { if (! info->callbacks->undefined_symbol (info, h->root.root.string, input_bfd, @@ -4760,10 +3426,23 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, (info->unresolved_syms_in_objects == RM_GENERATE_ERROR || ELF_ST_VISIBILITY (h->other)))) return FALSE; - relocation = 0; } } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + switch ((int) r_type) { final_link_relocate: @@ -4924,7 +3603,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (input_bfd, input_section), name + 5) == 0); @@ -4953,7 +3632,9 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, BFD_ASSERT (h != NULL && h->dynindx != -1); outrel.r_info = ELF32_R_INFO (h->dynindx, R_SH_REL32); outrel.r_addend - = bfd_get_32 (input_bfd, contents + rel->r_offset); + = (howto->partial_inplace + ? bfd_get_32 (input_bfd, contents + rel->r_offset) + : addend); } #ifdef INCLUDE_SHMEDIA else if (r_type == R_SH_IMM_LOW16_PCREL @@ -4974,20 +3655,19 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, || ((info->symbolic || h->dynindx == -1) && h->def_regular)) { - relocate = TRUE; + relocate = howto->partial_inplace; outrel.r_info = ELF32_R_INFO (0, R_SH_RELATIVE); - outrel.r_addend - = relocation + bfd_get_32 (input_bfd, - contents + rel->r_offset); } else { BFD_ASSERT (h->dynindx != -1); outrel.r_info = ELF32_R_INFO (h->dynindx, R_SH_DIR32); - outrel.r_addend - = relocation + bfd_get_32 (input_bfd, - contents + rel->r_offset); } + outrel.r_addend = relocation; + outrel.r_addend + += (howto->partial_inplace + ? bfd_get_32 (input_bfd, contents + rel->r_offset) + : addend); } loc = sreloc->contents; @@ -5029,8 +3709,8 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, BFD_ASSERT (sgotplt != NULL); relocation = (sgotplt->output_offset - + ((h->plt.offset / elf_sh_sizeof_plt (info) - - 1 + 3) * 4)); + + (get_plt_index (htab->plt_info, h->plt.offset) + + 3) * 4); #ifdef GOT_BIAS relocation -= GOT_BIAS; @@ -5649,7 +4329,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (input_bfd, input_section), name + 5) == 0); @@ -5853,42 +4533,20 @@ tpoff (struct bfd_link_info *info, bfd_vma address) static asection * sh_elf_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, - Elf_Internal_Rela *rel, struct elf_link_hash_entry *h, + struct bfd_link_info *info, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_SH_GNU_VTINHERIT: - case R_SH_GNU_VTENTRY: - break; + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_SH_GNU_VTINHERIT: + case R_SH_GNU_VTENTRY: + return NULL; + } - default: -#ifdef INCLUDE_SHMEDIA - while (h->root.type == bfd_link_hash_indirect - && h->root.u.i.link) - h = (struct elf_link_hash_entry *) h->root.u.i.link; -#endif - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Update the got entry reference counts for the section being removed. */ @@ -6538,7 +5196,7 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (abfd, sec), name + 5) == 0); @@ -6698,6 +5356,9 @@ sh_elf_copy_private_data (bfd * ibfd, bfd * obfd) || bfd_get_flavour (obfd) != bfd_target_elf_flavour) return TRUE; + /* Copy object attributes. */ + _bfd_elf_copy_obj_attributes (ibfd, obfd); + return sh_elf_set_private_flags (obfd, elf_elfheader (ibfd)->e_flags); } #endif /* not sh_elf_copy_private_data */ @@ -6799,7 +5460,7 @@ sh_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, corresponds to this symbol. This is the index of this symbol in all the symbols for which we are making plt entries. The first entry in the procedure linkage table is reserved. */ - plt_index = h->plt.offset / elf_sh_sizeof_plt (info) - 1; + plt_index = get_plt_index (htab->plt_info, h->plt.offset); /* Get the offset into the .got table of the entry that corresponds to this function. Each .got entry is 4 bytes. @@ -6812,62 +5473,61 @@ sh_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, #endif /* Fill in the entry in the procedure linkage table. */ - if (! info->shared) + memcpy (splt->contents + h->plt.offset, + htab->plt_info->symbol_entry, + htab->plt_info->symbol_entry_size); + + if (info->shared) + install_plt_field (output_bfd, FALSE, got_offset, + (splt->contents + + h->plt.offset + + htab->plt_info->symbol_fields.got_entry)); + else { - if (elf_sh_plt_entry == NULL) - { - elf_sh_plt_entry = (bfd_big_endian (output_bfd) ? - elf_sh_plt_entry_be : elf_sh_plt_entry_le); - } - memcpy (splt->contents + h->plt.offset, elf_sh_plt_entry, - elf_sh_sizeof_plt (info)); -#ifdef INCLUDE_SHMEDIA - movi_shori_putval (output_bfd, + install_plt_field (output_bfd, FALSE, (sgot->output_section->vma + sgot->output_offset + got_offset), - (splt->contents + h->plt.offset - + elf_sh_plt_symbol_offset (info))); - - /* Set bottom bit because its for a branch to SHmedia */ - movi_shori_putval (output_bfd, - (splt->output_section->vma + splt->output_offset) - | 1, - (splt->contents + h->plt.offset - + elf_sh_plt_plt0_offset (info))); -#else - bfd_put_32 (output_bfd, - (sgot->output_section->vma - + sgot->output_offset - + got_offset), - (splt->contents + h->plt.offset - + elf_sh_plt_symbol_offset (info))); - - bfd_put_32 (output_bfd, - (splt->output_section->vma + splt->output_offset), - (splt->contents + h->plt.offset - + elf_sh_plt_plt0_offset (info))); -#endif - } - else - { - if (elf_sh_pic_plt_entry == NULL) + (splt->contents + + h->plt.offset + + htab->plt_info->symbol_fields.got_entry)); + if (htab->vxworks_p) { - elf_sh_pic_plt_entry = (bfd_big_endian (output_bfd) ? - elf_sh_pic_plt_entry_be : - elf_sh_pic_plt_entry_le); + unsigned int reachable_plts, plts_per_4k; + int distance; + + /* Divide the PLT into groups. The first group contains + REACHABLE_PLTS entries and the other groups contain + PLTS_PER_4K entries. Entries in the first group can + branch directly to .plt; those in later groups branch + to the last element of the previous group. */ + /* ??? It would be better to create multiple copies of + the common resolver stub. */ + reachable_plts = ((4096 + - htab->plt_info->plt0_entry_size + - (htab->plt_info->symbol_fields.plt + 4)) + / htab->plt_info->symbol_entry_size) + 1; + plts_per_4k = (4096 / htab->plt_info->symbol_entry_size); + if (plt_index < reachable_plts) + distance = -(h->plt.offset + + htab->plt_info->symbol_fields.plt); + else + distance = -(((plt_index - reachable_plts) % plts_per_4k + 1) + * htab->plt_info->symbol_entry_size); + + /* Install the 'bra' with this offset. */ + bfd_put_16 (output_bfd, + 0xa000 | (0x0fff & ((distance - 4) / 2)), + (splt->contents + + h->plt.offset + + htab->plt_info->symbol_fields.plt)); } - memcpy (splt->contents + h->plt.offset, elf_sh_pic_plt_entry, - elf_sh_sizeof_plt (info)); -#ifdef INCLUDE_SHMEDIA - movi_shori_putval (output_bfd, got_offset, - (splt->contents + h->plt.offset - + elf_sh_plt_symbol_offset (info))); -#else - bfd_put_32 (output_bfd, got_offset, - (splt->contents + h->plt.offset - + elf_sh_plt_symbol_offset (info))); -#endif + else + install_plt_field (output_bfd, TRUE, + splt->output_section->vma + splt->output_offset, + (splt->contents + + h->plt.offset + + htab->plt_info->symbol_fields.plt)); } #ifdef GOT_BIAS @@ -6875,23 +5535,18 @@ sh_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, got_offset += GOT_BIAS; #endif -#ifdef INCLUDE_SHMEDIA - movi_shori_putval (output_bfd, + install_plt_field (output_bfd, FALSE, plt_index * sizeof (Elf32_External_Rela), - (splt->contents + h->plt.offset - + elf_sh_plt_reloc_offset (info))); -#else - bfd_put_32 (output_bfd, plt_index * sizeof (Elf32_External_Rela), - (splt->contents + h->plt.offset - + elf_sh_plt_reloc_offset (info))); -#endif + (splt->contents + + h->plt.offset + + htab->plt_info->symbol_fields.reloc_offset)); /* Fill in the entry in the global offset table. */ bfd_put_32 (output_bfd, (splt->output_section->vma + splt->output_offset + h->plt.offset - + elf_sh_plt_temp_offset (info)), + + htab->plt_info->symbol_resolve_offset), sgot->contents + got_offset); /* Fill in the entry in the .rela.plt section. */ @@ -6906,6 +5561,34 @@ sh_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, loc = srel->contents + plt_index * sizeof (Elf32_External_Rela); bfd_elf32_swap_reloca_out (output_bfd, &rel, loc); + if (htab->vxworks_p && !info->shared) + { + /* Create the .rela.plt.unloaded relocations for this PLT entry. + Begin by pointing LOC to the first such relocation. */ + loc = (htab->srelplt2->contents + + (plt_index * 2 + 1) * sizeof (Elf32_External_Rela)); + + /* Create a .rela.plt.unloaded R_SH_DIR32 relocation + for the PLT entry's pointer to the .got.plt entry. */ + rel.r_offset = (htab->splt->output_section->vma + + htab->splt->output_offset + + h->plt.offset + + htab->plt_info->symbol_fields.got_entry); + rel.r_info = ELF32_R_INFO (htab->root.hgot->indx, R_SH_DIR32); + rel.r_addend = got_offset; + bfd_elf32_swap_reloca_out (output_bfd, &rel, loc); + loc += sizeof (Elf32_External_Rela); + + /* Create a .rela.plt.unloaded R_SH_DIR32 relocation for + the .got.plt entry, which initially points to .plt. */ + rel.r_offset = (htab->sgotplt->output_section->vma + + htab->sgotplt->output_offset + + got_offset); + rel.r_info = ELF32_R_INFO (htab->root.hplt->indx, R_SH_DIR32); + rel.r_addend = 0; + bfd_elf32_swap_reloc_out (output_bfd, &rel, loc); + } + if (!h->def_regular) { /* Mark the symbol as undefined, rather than as defined in @@ -7035,9 +5718,11 @@ sh_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, bfd_elf32_swap_reloca_out (output_bfd, &rel, loc); } - /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ + /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. On VxWorks, + _GLOBAL_OFFSET_TABLE_ is not absolute: it is relative to the + ".got" section. */ if (strcmp (h->root.root.string, "_DYNAMIC") == 0 - || h == htab->root.hgot) + || (!htab->vxworks_p && h == htab->root.hgot)) sym->st_shndx = SHN_ABS; return TRUE; @@ -7144,42 +5829,59 @@ sh_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) /* Fill in the first entry in the procedure linkage table. */ splt = htab->splt; - if (splt && splt->size > 0) + if (splt && splt->size > 0 && htab->plt_info->plt0_entry) { - if (info->shared) + unsigned int i; + + memcpy (splt->contents, + htab->plt_info->plt0_entry, + htab->plt_info->plt0_entry_size); + for (i = 0; i < ARRAY_SIZE (htab->plt_info->plt0_got_fields); i++) + if (htab->plt_info->plt0_got_fields[i] != MINUS_ONE) + install_plt_field (output_bfd, FALSE, + (sgot->output_section->vma + + sgot->output_offset + + (i * 4)), + (splt->contents + + htab->plt_info->plt0_got_fields[i])); + + if (htab->vxworks_p) { - if (elf_sh_pic_plt_entry == NULL) + /* Finalize the .rela.plt.unloaded contents. */ + Elf_Internal_Rela rel; + bfd_byte *loc; + + /* Create a .rela.plt.unloaded R_SH_DIR32 relocation for the + first PLT entry's pointer to _GLOBAL_OFFSET_TABLE_ + 8. */ + loc = htab->srelplt2->contents; + rel.r_offset = (splt->output_section->vma + + splt->output_offset + + htab->plt_info->plt0_got_fields[2]); + rel.r_info = ELF32_R_INFO (htab->root.hgot->indx, R_SH_DIR32); + rel.r_addend = 8; + bfd_elf32_swap_reloca_out (output_bfd, &rel, loc); + loc += sizeof (Elf32_External_Rela); + + /* Fix up the remaining .rela.plt.unloaded relocations. + They may have the wrong symbol index for _G_O_T_ or + _P_L_T_ depending on the order in which symbols were + output. */ + while (loc < htab->srelplt2->contents + htab->srelplt2->size) { - elf_sh_pic_plt_entry = (bfd_big_endian (output_bfd) ? - elf_sh_pic_plt_entry_be : - elf_sh_pic_plt_entry_le); + /* The PLT entry's pointer to the .got.plt slot. */ + bfd_elf32_swap_reloc_in (output_bfd, loc, &rel); + rel.r_info = ELF32_R_INFO (htab->root.hgot->indx, + R_SH_DIR32); + bfd_elf32_swap_reloc_out (output_bfd, &rel, loc); + loc += sizeof (Elf32_External_Rela); + + /* The .got.plt slot's pointer to .plt. */ + bfd_elf32_swap_reloc_in (output_bfd, loc, &rel); + rel.r_info = ELF32_R_INFO (htab->root.hplt->indx, + R_SH_DIR32); + bfd_elf32_swap_reloc_out (output_bfd, &rel, loc); + loc += sizeof (Elf32_External_Rela); } - memcpy (splt->contents, elf_sh_pic_plt_entry, - elf_sh_sizeof_plt (info)); - } - else - { - if (elf_sh_plt0_entry == NULL) - { - elf_sh_plt0_entry = (bfd_big_endian (output_bfd) ? - elf_sh_plt0_entry_be : - elf_sh_plt0_entry_le); - } - memcpy (splt->contents, elf_sh_plt0_entry, PLT_ENTRY_SIZE); -#ifdef INCLUDE_SHMEDIA - movi_shori_putval (output_bfd, - sgot->output_section->vma - + sgot->output_offset, - splt->contents - + elf_sh_plt0_gotplt_offset (info)); -#else - bfd_put_32 (output_bfd, - sgot->output_section->vma + sgot->output_offset + 4, - splt->contents + elf_sh_plt0_gotid_offset (info)); - bfd_put_32 (output_bfd, - sgot->output_section->vma + sgot->output_offset + 8, - splt->contents + elf_sh_plt0_linker_offset (info)); -#endif } /* UnixWare sets the entsize of .plt to 4, although that doesn't @@ -7294,7 +5996,10 @@ static bfd_vma sh_elf_plt_sym_val (bfd_vma i, const asection *plt, const arelent *rel ATTRIBUTE_UNUSED) { - return plt->vma + (i + 1) * PLT_ENTRY_SIZE; + const struct elf_sh_plt_info *plt_info; + + plt_info = get_plt_info (plt->owner, (plt->owner->flags & DYNAMIC) != 0); + return plt->vma + get_plt_offset (plt_info, i); } #if !defined SH_TARGET_ALREADY_DEFINED @@ -7315,6 +6020,8 @@ sh_elf_plt_sym_val (bfd_vma i, const asection *plt, #define elf_symbol_leading_char '_' #define bfd_elf32_bfd_reloc_type_lookup sh_elf_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup \ + sh_elf_reloc_name_lookup #define elf_info_to_howto sh_elf_info_to_howto #define bfd_elf32_bfd_relax_section sh_elf_relax_section #define elf_backend_relocate_section sh_elf_relocate_section @@ -7340,8 +6047,12 @@ sh_elf_plt_sym_val (bfd_vma i, const asection *plt, sh_elf_link_hash_table_create #define elf_backend_adjust_dynamic_symbol \ sh_elf_adjust_dynamic_symbol +#define elf_backend_always_size_sections \ + sh_elf_always_size_sections #define elf_backend_size_dynamic_sections \ sh_elf_size_dynamic_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_finish_dynamic_symbol \ sh_elf_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections \ @@ -7371,6 +6082,7 @@ sh_elf_plt_sym_val (bfd_vma i, const asection *plt, #define TARGET_LITTLE_NAME "elf32-shl-nbsd" #undef ELF_MAXPAGESIZE #define ELF_MAXPAGESIZE 0x10000 +#undef ELF_COMMONPAGESIZE #undef elf_symbol_leading_char #define elf_symbol_leading_char 0 #undef elf32_bed @@ -7388,6 +6100,8 @@ sh_elf_plt_sym_val (bfd_vma i, const asection *plt, #define TARGET_LITTLE_SYM bfd_elf32_shlin_vec #undef TARGET_LITTLE_NAME #define TARGET_LITTLE_NAME "elf32-sh-linux" +#undef ELF_COMMONPAGESIZE +#define ELF_COMMONPAGESIZE 0x1000 #undef elf_backend_grok_prstatus #define elf_backend_grok_prstatus elf32_shlin_grok_prstatus @@ -7398,4 +6112,38 @@ sh_elf_plt_sym_val (bfd_vma i, const asection *plt, #include "elf32-target.h" +#undef TARGET_BIG_SYM +#define TARGET_BIG_SYM bfd_elf32_shvxworks_vec +#undef TARGET_BIG_NAME +#define TARGET_BIG_NAME "elf32-sh-vxworks" +#undef TARGET_LITTLE_SYM +#define TARGET_LITTLE_SYM bfd_elf32_shlvxworks_vec +#undef TARGET_LITTLE_NAME +#define TARGET_LITTLE_NAME "elf32-shl-vxworks" +#undef elf32_bed +#define elf32_bed elf32_sh_vxworks_bed + +#undef elf_backend_want_plt_sym +#define elf_backend_want_plt_sym 1 +#undef elf_symbol_leading_char +#define elf_symbol_leading_char '_' +#define elf_backend_want_got_underscore 1 +#undef elf_backend_grok_prstatus +#undef elf_backend_grok_psinfo +#undef elf_backend_add_symbol_hook +#define elf_backend_add_symbol_hook elf_vxworks_add_symbol_hook +#undef elf_backend_link_output_symbol_hook +#define elf_backend_link_output_symbol_hook \ + elf_vxworks_link_output_symbol_hook +#undef elf_backend_emit_relocs +#define elf_backend_emit_relocs elf_vxworks_emit_relocs +#undef elf_backend_final_write_processing +#define elf_backend_final_write_processing \ + elf_vxworks_final_write_processing +#undef ELF_MAXPAGESIZE +#define ELF_MAXPAGESIZE 0x1000 +#undef ELF_COMMONPAGESIZE + +#include "elf32-target.h" + #endif /* neither INCLUDE_SHMEDIA nor SH_TARGET_ALREADY_DEFINED */ diff --git a/bfd/elf32-sh64-com.c b/bfd/elf32-sh64-com.c index 1b6a8f5aad2..1a30e0d371b 100644 --- a/bfd/elf32-sh64-com.c +++ b/bfd/elf32-sh64-com.c @@ -1,5 +1,6 @@ /* SuperH SH64-specific support for 32-bit ELF - Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003, 2004, 2007 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +20,8 @@ #define SH64_ELF -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/sh.h" diff --git a/bfd/elf32-sh64.c b/bfd/elf32-sh64.c index afafcfde88d..2f85098c0ff 100644 --- a/bfd/elf32-sh64.c +++ b/bfd/elf32-sh64.c @@ -1,5 +1,5 @@ /* SuperH SH64-specific support for 32-bit ELF - Copyright 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -20,8 +20,8 @@ #define SH64_ELF -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "elf-bfd.h" #include "../opcodes/sh64-opc.h" #include "elf32-sh64.h" @@ -115,13 +115,16 @@ static void sh64_find_section_for_address static bfd_boolean sh64_elf_new_section_hook (bfd *abfd, asection *sec) { - struct _sh64_elf_section_data *sdata; - bfd_size_type amt = sizeof (*sdata); + if (!sec->used_by_bfd) + { + struct _sh64_elf_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); - sdata = (struct _sh64_elf_section_data *) bfd_zalloc (abfd, amt); - if (sdata == NULL) - return FALSE; - sec->used_by_bfd = sdata; + sdata = bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = sdata; + } return _bfd_elf_new_section_hook (abfd, sec); } @@ -739,9 +742,9 @@ static void sh64_elf_merge_symbol_attribute (struct elf_link_hash_entry *h, const Elf_Internal_Sym *isym, bfd_boolean definition, - bfd_boolean dynamic) + bfd_boolean dynamic ATTRIBUTE_UNUSED) { - if (isym->st_other != 0 && dynamic) + if ((isym->st_other & ~ELF_ST_VISIBILITY (-1)) != 0) { unsigned char other; @@ -756,8 +759,8 @@ sh64_elf_merge_symbol_attribute (struct elf_link_hash_entry *h, static const struct bfd_elf_special_section sh64_elf_special_sections[] = { - { ".cranges", 8, 0, SHT_PROGBITS, 0 }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".cranges"), 0, SHT_PROGBITS, 0 }, + { NULL, 0, 0, 0, 0 } }; #undef TARGET_BIG_SYM @@ -782,6 +785,7 @@ static const struct bfd_elf_special_section sh64_elf_special_sections[] = #define TARGET_LITTLE_NAME "elf32-sh64l-nbsd" #undef ELF_MAXPAGESIZE #define ELF_MAXPAGESIZE 0x10000 +#undef ELF_COMMONPAGESIZE #undef elf_symbol_leading_char #define elf_symbol_leading_char 0 #undef elf32_bed @@ -800,6 +804,8 @@ static const struct bfd_elf_special_section sh64_elf_special_sections[] = #define TARGET_LITTLE_NAME "elf32-sh64-linux" #undef elf32_bed #define elf32_bed elf32_sh64_lin_bed +#undef ELF_COMMONPAGESIZE +#define ELF_COMMONPAGESIZE 0x1000 #include "elf32-target.h" diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c index 3bfb38a3d44..f8a3bff196d 100644 --- a/bfd/elf32-sparc.c +++ b/bfd/elf32-sparc.c @@ -1,6 +1,6 @@ /* SPARC-specific support for 32-bit ELF Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -172,6 +172,7 @@ elf32_sparc_reloc_type_class (const Elf_Internal_Rela *rela) #define ELF_MACHINE_CODE EM_SPARC #define ELF_MACHINE_ALT1 EM_SPARC32PLUS #define ELF_MAXPAGESIZE 0x10000 +#define ELF_COMMONPAGESIZE 0x2000 #define bfd_elf32_bfd_merge_private_bfd_data \ elf32_sparc_merge_private_bfd_data @@ -182,6 +183,8 @@ elf32_sparc_reloc_type_class (const Elf_Internal_Rela *rela) #define elf_info_to_howto _bfd_sparc_elf_info_to_howto #define bfd_elf32_bfd_reloc_type_lookup _bfd_sparc_elf_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup \ + _bfd_sparc_elf_reloc_name_lookup #define bfd_elf32_bfd_link_hash_table_create \ _bfd_sparc_elf_link_hash_table_create #define bfd_elf32_bfd_relax_section _bfd_sparc_elf_relax_section @@ -206,6 +209,7 @@ elf32_sparc_reloc_type_class (const Elf_Internal_Rela *rela) #define elf_backend_gc_mark_hook _bfd_sparc_elf_gc_mark_hook #define elf_backend_gc_sweep_hook _bfd_sparc_elf_gc_sweep_hook #define elf_backend_plt_sym_val _bfd_sparc_elf_plt_sym_val +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_can_gc_sections 1 #define elf_backend_can_refcount 1 diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c new file mode 100644 index 00000000000..d652117e299 --- /dev/null +++ b/bfd/elf32-spu.c @@ -0,0 +1,3154 @@ +/* SPU specific support for 32-bit ELF + + Copyright 2006, 2007 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + 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 2 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 "bfdlink.h" +#include "libbfd.h" +#include "elf-bfd.h" +#include "elf/spu.h" +#include "elf32-spu.h" + +/* We use RELA style relocs. Don't define USE_REL. */ + +static bfd_reloc_status_type spu_elf_rel9 (bfd *, arelent *, asymbol *, + void *, asection *, + bfd *, char **); + +/* Values of type 'enum elf_spu_reloc_type' are used to index this + array, so it must be declared in the order of that type. */ + +static reloc_howto_type elf_howto_table[] = { + HOWTO (R_SPU_NONE, 0, 0, 0, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "SPU_NONE", + FALSE, 0, 0x00000000, FALSE), + HOWTO (R_SPU_ADDR10, 4, 2, 10, FALSE, 14, complain_overflow_bitfield, + bfd_elf_generic_reloc, "SPU_ADDR10", + FALSE, 0, 0x00ffc000, FALSE), + HOWTO (R_SPU_ADDR16, 2, 2, 16, FALSE, 7, complain_overflow_bitfield, + bfd_elf_generic_reloc, "SPU_ADDR16", + FALSE, 0, 0x007fff80, FALSE), + HOWTO (R_SPU_ADDR16_HI, 16, 2, 16, FALSE, 7, complain_overflow_bitfield, + bfd_elf_generic_reloc, "SPU_ADDR16_HI", + FALSE, 0, 0x007fff80, FALSE), + HOWTO (R_SPU_ADDR16_LO, 0, 2, 16, FALSE, 7, complain_overflow_dont, + bfd_elf_generic_reloc, "SPU_ADDR16_LO", + FALSE, 0, 0x007fff80, FALSE), + HOWTO (R_SPU_ADDR18, 0, 2, 18, FALSE, 7, complain_overflow_bitfield, + bfd_elf_generic_reloc, "SPU_ADDR18", + FALSE, 0, 0x01ffff80, FALSE), + HOWTO (R_SPU_ADDR32, 0, 2, 32, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "SPU_ADDR32", + FALSE, 0, 0xffffffff, FALSE), + HOWTO (R_SPU_REL16, 2, 2, 16, TRUE, 7, complain_overflow_bitfield, + bfd_elf_generic_reloc, "SPU_REL16", + FALSE, 0, 0x007fff80, TRUE), + HOWTO (R_SPU_ADDR7, 0, 2, 7, FALSE, 14, complain_overflow_dont, + bfd_elf_generic_reloc, "SPU_ADDR7", + FALSE, 0, 0x001fc000, FALSE), + HOWTO (R_SPU_REL9, 2, 2, 9, TRUE, 0, complain_overflow_signed, + spu_elf_rel9, "SPU_REL9", + FALSE, 0, 0x0180007f, TRUE), + HOWTO (R_SPU_REL9I, 2, 2, 9, TRUE, 0, complain_overflow_signed, + spu_elf_rel9, "SPU_REL9I", + FALSE, 0, 0x0000c07f, TRUE), + HOWTO (R_SPU_ADDR10I, 0, 2, 10, FALSE, 14, complain_overflow_signed, + bfd_elf_generic_reloc, "SPU_ADDR10I", + FALSE, 0, 0x00ffc000, FALSE), + HOWTO (R_SPU_ADDR16I, 0, 2, 16, FALSE, 7, complain_overflow_signed, + bfd_elf_generic_reloc, "SPU_ADDR16I", + FALSE, 0, 0x007fff80, FALSE), + HOWTO (R_SPU_REL32, 0, 2, 32, TRUE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "SPU_REL32", + FALSE, 0, 0xffffffff, TRUE), + HOWTO (R_SPU_ADDR16X, 0, 2, 16, FALSE, 7, complain_overflow_bitfield, + bfd_elf_generic_reloc, "SPU_ADDR16X", + FALSE, 0, 0x007fff80, FALSE), + HOWTO (R_SPU_PPU32, 0, 2, 32, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "SPU_PPU32", + FALSE, 0, 0xffffffff, FALSE), + HOWTO (R_SPU_PPU64, 0, 4, 64, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "SPU_PPU64", + FALSE, 0, -1, FALSE), +}; + +static struct bfd_elf_special_section const spu_elf_special_sections[] = { + { ".toe", 4, 0, SHT_NOBITS, SHF_ALLOC }, + { NULL, 0, 0, 0, 0 } +}; + +static enum elf_spu_reloc_type +spu_elf_bfd_to_reloc_type (bfd_reloc_code_real_type code) +{ + switch (code) + { + default: + return R_SPU_NONE; + case BFD_RELOC_SPU_IMM10W: + return R_SPU_ADDR10; + case BFD_RELOC_SPU_IMM16W: + return R_SPU_ADDR16; + case BFD_RELOC_SPU_LO16: + return R_SPU_ADDR16_LO; + case BFD_RELOC_SPU_HI16: + return R_SPU_ADDR16_HI; + case BFD_RELOC_SPU_IMM18: + return R_SPU_ADDR18; + case BFD_RELOC_SPU_PCREL16: + return R_SPU_REL16; + case BFD_RELOC_SPU_IMM7: + return R_SPU_ADDR7; + case BFD_RELOC_SPU_IMM8: + return R_SPU_NONE; + case BFD_RELOC_SPU_PCREL9a: + return R_SPU_REL9; + case BFD_RELOC_SPU_PCREL9b: + return R_SPU_REL9I; + case BFD_RELOC_SPU_IMM10: + return R_SPU_ADDR10I; + case BFD_RELOC_SPU_IMM16: + return R_SPU_ADDR16I; + case BFD_RELOC_32: + return R_SPU_ADDR32; + case BFD_RELOC_32_PCREL: + return R_SPU_REL32; + case BFD_RELOC_SPU_PPU32: + return R_SPU_PPU32; + case BFD_RELOC_SPU_PPU64: + return R_SPU_PPU64; + } +} + +static void +spu_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, + arelent *cache_ptr, + Elf_Internal_Rela *dst) +{ + enum elf_spu_reloc_type r_type; + + r_type = (enum elf_spu_reloc_type) ELF32_R_TYPE (dst->r_info); + BFD_ASSERT (r_type < R_SPU_max); + cache_ptr->howto = &elf_howto_table[(int) r_type]; +} + +static reloc_howto_type * +spu_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) +{ + enum elf_spu_reloc_type r_type = spu_elf_bfd_to_reloc_type (code); + + if (r_type == R_SPU_NONE) + return NULL; + + return elf_howto_table + r_type; +} + +static reloc_howto_type * +spu_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; i < sizeof (elf_howto_table) / sizeof (elf_howto_table[0]); i++) + if (elf_howto_table[i].name != NULL + && strcasecmp (elf_howto_table[i].name, r_name) == 0) + return &elf_howto_table[i]; + + return NULL; +} + +/* Apply R_SPU_REL9 and R_SPU_REL9I relocs. */ + +static bfd_reloc_status_type +spu_elf_rel9 (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, + bfd *output_bfd, char **error_message) +{ + bfd_size_type octets; + bfd_vma val; + long insn; + + /* If this is a relocatable link (output_bfd test tells us), just + call the generic function. Any adjustment will be done at final + link time. */ + if (output_bfd != NULL) + return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message); + + if (reloc_entry->address > bfd_get_section_limit (abfd, input_section)) + return bfd_reloc_outofrange; + octets = reloc_entry->address * bfd_octets_per_byte (abfd); + + /* Get symbol value. */ + val = 0; + if (!bfd_is_com_section (symbol->section)) + val = symbol->value; + if (symbol->section->output_section) + val += symbol->section->output_section->vma; + + val += reloc_entry->addend; + + /* Make it pc-relative. */ + val -= input_section->output_section->vma + input_section->output_offset; + + val >>= 2; + if (val + 256 >= 512) + return bfd_reloc_overflow; + + insn = bfd_get_32 (abfd, (bfd_byte *) data + octets); + + /* Move two high bits of value to REL9I and REL9 position. + The mask will take care of selecting the right field. */ + val = (val & 0x7f) | ((val & 0x180) << 7) | ((val & 0x180) << 16); + insn &= ~reloc_entry->howto->dst_mask; + insn |= val & reloc_entry->howto->dst_mask; + bfd_put_32 (abfd, insn, (bfd_byte *) data + octets); + return bfd_reloc_ok; +} + +static bfd_boolean +spu_elf_new_section_hook (bfd *abfd, asection *sec) +{ + if (!sec->used_by_bfd) + { + struct _spu_elf_section_data *sdata; + + sdata = bfd_zalloc (abfd, sizeof (*sdata)); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = sdata; + } + + return _bfd_elf_new_section_hook (abfd, sec); +} + +/* Specially mark defined symbols named _EAR_* with BSF_KEEP so that + strip --strip-unneeded will not remove them. */ + +static void +spu_elf_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, asymbol *sym) +{ + if (sym->name != NULL + && sym->section != bfd_abs_section_ptr + && strncmp (sym->name, "_EAR_", 5) == 0) + sym->flags |= BSF_KEEP; +} + +/* SPU ELF linker hash table. */ + +struct spu_link_hash_table +{ + struct elf_link_hash_table elf; + + /* The stub hash table. */ + struct bfd_hash_table stub_hash_table; + + /* Shortcuts to overlay sections. */ + asection *stub; + asection *ovtab; + + struct elf_link_hash_entry *ovly_load; + + /* An array of two output sections per overlay region, chosen such that + the first section vma is the overlay buffer vma (ie. the section has + the lowest vma in the group that occupy the region), and the second + section vma+size specifies the end of the region. We keep pointers + to sections like this because section vmas may change when laying + them out. */ + asection **ovl_region; + + /* Number of overlay buffers. */ + unsigned int num_buf; + + /* Total number of overlays. */ + unsigned int num_overlays; + + /* Set if we should emit symbols for stubs. */ + unsigned int emit_stub_syms:1; + + /* Set if we want stubs on calls out of overlay regions to + non-overlay regions. */ + unsigned int non_overlay_stubs : 1; + + /* Set on error. */ + unsigned int stub_overflow : 1; + + /* Set if stack size analysis should be done. */ + unsigned int stack_analysis : 1; + + /* Set if __stack_* syms will be emitted. */ + unsigned int emit_stack_syms : 1; +}; + +#define spu_hash_table(p) \ + ((struct spu_link_hash_table *) ((p)->hash)) + +struct spu_stub_hash_entry +{ + struct bfd_hash_entry root; + + /* Destination of this stub. */ + asection *target_section; + bfd_vma target_off; + + /* Offset of entry in stub section. */ + bfd_vma off; + + /* Offset from this stub to stub that loads the overlay index. */ + bfd_vma delta; +}; + +/* Create an entry in a spu stub hash table. */ + +static struct bfd_hash_entry * +stub_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) +{ + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (entry == NULL) + { + entry = bfd_hash_allocate (table, sizeof (struct spu_stub_hash_entry)); + if (entry == NULL) + return entry; + } + + /* Call the allocation method of the superclass. */ + entry = bfd_hash_newfunc (entry, table, string); + if (entry != NULL) + { + struct spu_stub_hash_entry *sh = (struct spu_stub_hash_entry *) entry; + + sh->target_section = NULL; + sh->target_off = 0; + sh->off = 0; + sh->delta = 0; + } + + return entry; +} + +/* Create a spu ELF linker hash table. */ + +static struct bfd_link_hash_table * +spu_elf_link_hash_table_create (bfd *abfd) +{ + struct spu_link_hash_table *htab; + + htab = bfd_malloc (sizeof (*htab)); + if (htab == NULL) + return NULL; + + if (!_bfd_elf_link_hash_table_init (&htab->elf, abfd, + _bfd_elf_link_hash_newfunc, + sizeof (struct elf_link_hash_entry))) + { + free (htab); + return NULL; + } + + /* Init the stub hash table too. */ + if (!bfd_hash_table_init (&htab->stub_hash_table, stub_hash_newfunc, + sizeof (struct spu_stub_hash_entry))) + return NULL; + + memset (&htab->stub, 0, + sizeof (*htab) - offsetof (struct spu_link_hash_table, stub)); + + return &htab->elf.root; +} + +/* Free the derived linker hash table. */ + +static void +spu_elf_link_hash_table_free (struct bfd_link_hash_table *hash) +{ + struct spu_link_hash_table *ret = (struct spu_link_hash_table *) hash; + + bfd_hash_table_free (&ret->stub_hash_table); + _bfd_generic_link_hash_table_free (hash); +} + +/* Find the symbol for the given R_SYMNDX in IBFD and set *HP and *SYMP + to (hash, NULL) for global symbols, and (NULL, sym) for locals. Set + *SYMSECP to the symbol's section. *LOCSYMSP caches local syms. */ + +static bfd_boolean +get_sym_h (struct elf_link_hash_entry **hp, + Elf_Internal_Sym **symp, + asection **symsecp, + Elf_Internal_Sym **locsymsp, + unsigned long r_symndx, + bfd *ibfd) +{ + Elf_Internal_Shdr *symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + + if (r_symndx >= symtab_hdr->sh_info) + { + struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (ibfd); + struct elf_link_hash_entry *h; + + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (hp != NULL) + *hp = h; + + if (symp != NULL) + *symp = NULL; + + if (symsecp != NULL) + { + asection *symsec = NULL; + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + symsec = h->root.u.def.section; + *symsecp = symsec; + } + } + else + { + Elf_Internal_Sym *sym; + Elf_Internal_Sym *locsyms = *locsymsp; + + if (locsyms == NULL) + { + locsyms = (Elf_Internal_Sym *) symtab_hdr->contents; + if (locsyms == NULL) + { + size_t symcount = symtab_hdr->sh_info; + + /* If we are reading symbols into the contents, then + read the global syms too. This is done to cache + syms for later stack analysis. */ + if ((unsigned char **) locsymsp == &symtab_hdr->contents) + symcount = symtab_hdr->sh_size / symtab_hdr->sh_entsize; + locsyms = bfd_elf_get_elf_syms (ibfd, symtab_hdr, symcount, 0, + NULL, NULL, NULL); + } + if (locsyms == NULL) + return FALSE; + *locsymsp = locsyms; + } + sym = locsyms + r_symndx; + + if (hp != NULL) + *hp = NULL; + + if (symp != NULL) + *symp = sym; + + if (symsecp != NULL) + { + asection *symsec = NULL; + if ((sym->st_shndx != SHN_UNDEF + && sym->st_shndx < SHN_LORESERVE) + || sym->st_shndx > SHN_HIRESERVE) + symsec = bfd_section_from_elf_index (ibfd, sym->st_shndx); + *symsecp = symsec; + } + } + + return TRUE; +} + +/* Build a name for an entry in the stub hash table. We can't use a + local symbol name because ld -r might generate duplicate local symbols. */ + +static char * +spu_stub_name (const asection *sym_sec, + const struct elf_link_hash_entry *h, + const Elf_Internal_Rela *rel) +{ + char *stub_name; + bfd_size_type len; + + if (h) + { + len = strlen (h->root.root.string) + 1 + 8 + 1; + stub_name = bfd_malloc (len); + if (stub_name == NULL) + return stub_name; + + sprintf (stub_name, "%s+%x", + h->root.root.string, + (int) rel->r_addend & 0xffffffff); + len -= 8; + } + else + { + len = 8 + 1 + 8 + 1 + 8 + 1; + stub_name = bfd_malloc (len); + if (stub_name == NULL) + return stub_name; + + sprintf (stub_name, "%x:%x+%x", + sym_sec->id & 0xffffffff, + (int) ELF32_R_SYM (rel->r_info) & 0xffffffff, + (int) rel->r_addend & 0xffffffff); + len = strlen (stub_name); + } + + if (stub_name[len - 2] == '+' + && stub_name[len - 1] == '0' + && stub_name[len] == 0) + stub_name[len - 2] = 0; + + return stub_name; +} + +/* Create the note section if not already present. This is done early so + that the linker maps the sections to the right place in the output. */ + +bfd_boolean +spu_elf_create_sections (bfd *output_bfd, + struct bfd_link_info *info, + int stack_analysis, + int emit_stack_syms) +{ + bfd *ibfd; + struct spu_link_hash_table *htab = spu_hash_table (info); + + /* Stash some options away where we can get at them later. */ + htab->stack_analysis = stack_analysis; + htab->emit_stack_syms = emit_stack_syms; + + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + if (bfd_get_section_by_name (ibfd, SPU_PTNOTE_SPUNAME) != NULL) + break; + + if (ibfd == NULL) + { + /* Make SPU_PTNOTE_SPUNAME section. */ + asection *s; + size_t name_len; + size_t size; + bfd_byte *data; + flagword flags; + + ibfd = info->input_bfds; + flags = SEC_LOAD | SEC_READONLY | SEC_HAS_CONTENTS | SEC_IN_MEMORY; + s = bfd_make_section_anyway_with_flags (ibfd, SPU_PTNOTE_SPUNAME, flags); + if (s == NULL + || !bfd_set_section_alignment (ibfd, s, 4)) + return FALSE; + + name_len = strlen (bfd_get_filename (output_bfd)) + 1; + size = 12 + ((sizeof (SPU_PLUGIN_NAME) + 3) & -4); + size += (name_len + 3) & -4; + + if (!bfd_set_section_size (ibfd, s, size)) + return FALSE; + + data = bfd_zalloc (ibfd, size); + if (data == NULL) + return FALSE; + + bfd_put_32 (ibfd, sizeof (SPU_PLUGIN_NAME), data + 0); + bfd_put_32 (ibfd, name_len, data + 4); + bfd_put_32 (ibfd, 1, data + 8); + memcpy (data + 12, SPU_PLUGIN_NAME, sizeof (SPU_PLUGIN_NAME)); + memcpy (data + 12 + ((sizeof (SPU_PLUGIN_NAME) + 3) & -4), + bfd_get_filename (output_bfd), name_len); + s->contents = data; + } + + return TRUE; +} + +/* qsort predicate to sort sections by vma. */ + +static int +sort_sections (const void *a, const void *b) +{ + const asection *const *s1 = a; + const asection *const *s2 = b; + bfd_signed_vma delta = (*s1)->vma - (*s2)->vma; + + if (delta != 0) + return delta < 0 ? -1 : 1; + + return (*s1)->index - (*s2)->index; +} + +/* Identify overlays in the output bfd, and number them. */ + +bfd_boolean +spu_elf_find_overlays (bfd *output_bfd, struct bfd_link_info *info) +{ + struct spu_link_hash_table *htab = spu_hash_table (info); + asection **alloc_sec; + unsigned int i, n, ovl_index, num_buf; + asection *s; + bfd_vma ovl_end; + + if (output_bfd->section_count < 2) + return FALSE; + + alloc_sec = bfd_malloc (output_bfd->section_count * sizeof (*alloc_sec)); + if (alloc_sec == NULL) + return FALSE; + + /* Pick out all the alloced sections. */ + for (n = 0, s = output_bfd->sections; s != NULL; s = s->next) + if ((s->flags & SEC_ALLOC) != 0 + && (s->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) != SEC_THREAD_LOCAL + && s->size != 0) + alloc_sec[n++] = s; + + if (n == 0) + { + free (alloc_sec); + return FALSE; + } + + /* Sort them by vma. */ + qsort (alloc_sec, n, sizeof (*alloc_sec), sort_sections); + + /* Look for overlapping vmas. Any with overlap must be overlays. + Count them. Also count the number of overlay regions and for + each region save a section from that region with the lowest vma + and another section with the highest end vma. */ + ovl_end = alloc_sec[0]->vma + alloc_sec[0]->size; + for (ovl_index = 0, num_buf = 0, i = 1; i < n; i++) + { + s = alloc_sec[i]; + if (s->vma < ovl_end) + { + asection *s0 = alloc_sec[i - 1]; + + if (spu_elf_section_data (s0)->ovl_index == 0) + { + spu_elf_section_data (s0)->ovl_index = ++ovl_index; + alloc_sec[num_buf * 2] = s0; + alloc_sec[num_buf * 2 + 1] = s0; + num_buf++; + } + spu_elf_section_data (s)->ovl_index = ++ovl_index; + if (ovl_end < s->vma + s->size) + { + ovl_end = s->vma + s->size; + alloc_sec[num_buf * 2 - 1] = s; + } + } + else + ovl_end = s->vma + s->size; + } + + htab->num_overlays = ovl_index; + htab->num_buf = num_buf; + if (ovl_index == 0) + { + free (alloc_sec); + return FALSE; + } + + alloc_sec = bfd_realloc (alloc_sec, num_buf * 2 * sizeof (*alloc_sec)); + if (alloc_sec == NULL) + return FALSE; + + htab->ovl_region = alloc_sec; + return TRUE; +} + +/* One of these per stub. */ +#define SIZEOF_STUB1 8 +#define ILA_79 0x4200004f /* ila $79,function_address */ +#define BR 0x32000000 /* br stub2 */ + +/* One of these per overlay. */ +#define SIZEOF_STUB2 8 +#define ILA_78 0x4200004e /* ila $78,overlay_number */ + /* br __ovly_load */ +#define NOP 0x40200000 + +/* Return true for all relative and absolute branch instructions. + bra 00110000 0.. + brasl 00110001 0.. + br 00110010 0.. + brsl 00110011 0.. + brz 00100000 0.. + brnz 00100001 0.. + brhz 00100010 0.. + brhnz 00100011 0.. */ + +static bfd_boolean +is_branch (const unsigned char *insn) +{ + return (insn[0] & 0xec) == 0x20 && (insn[1] & 0x80) == 0; +} + +/* Return true for branch hint instructions. + hbra 0001000.. + hbrr 0001001.. */ + +static bfd_boolean +is_hint (const unsigned char *insn) +{ + return (insn[0] & 0xfc) == 0x10; +} + +/* Return TRUE if this reloc symbol should possibly go via an overlay stub. */ + +static bfd_boolean +needs_ovl_stub (const char *sym_name, + asection *sym_sec, + asection *input_section, + struct spu_link_hash_table *htab, + bfd_boolean is_branch) +{ + if (htab->num_overlays == 0) + return FALSE; + + if (sym_sec == NULL + || sym_sec->output_section == NULL + || spu_elf_section_data (sym_sec->output_section) == NULL) + return FALSE; + + /* setjmp always goes via an overlay stub, because then the return + and hence the longjmp goes via __ovly_return. That magically + makes setjmp/longjmp between overlays work. */ + if (strncmp (sym_name, "setjmp", 6) == 0 + && (sym_name[6] == '\0' || sym_name[6] == '@')) + return TRUE; + + /* Usually, symbols in non-overlay sections don't need stubs. */ + if (spu_elf_section_data (sym_sec->output_section)->ovl_index == 0 + && !htab->non_overlay_stubs) + return FALSE; + + /* A reference from some other section to a symbol in an overlay + section needs a stub. */ + if (spu_elf_section_data (sym_sec->output_section)->ovl_index + != spu_elf_section_data (input_section->output_section)->ovl_index) + return TRUE; + + /* If this insn isn't a branch then we are possibly taking the + address of a function and passing it out somehow. */ + return !is_branch; +} + +struct stubarr { + struct bfd_hash_table *stub_hash_table; + struct spu_stub_hash_entry **sh; + unsigned int count; + int err; +}; + +/* Called via elf_link_hash_traverse to allocate stubs for any _SPUEAR_ + symbols. */ + +static bfd_boolean +allocate_spuear_stubs (struct elf_link_hash_entry *h, void *inf) +{ + /* Symbols starting with _SPUEAR_ need a stub because they may be + invoked by the PPU. */ + if ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && h->def_regular + && strncmp (h->root.root.string, "_SPUEAR_", 8) == 0) + { + struct stubarr *stubs = inf; + static Elf_Internal_Rela zero_rel; + char *stub_name = spu_stub_name (h->root.u.def.section, h, &zero_rel); + struct spu_stub_hash_entry *sh; + + if (stub_name == NULL) + { + stubs->err = 1; + return FALSE; + } + + sh = (struct spu_stub_hash_entry *) + bfd_hash_lookup (stubs->stub_hash_table, stub_name, TRUE, FALSE); + if (sh == NULL) + { + free (stub_name); + return FALSE; + } + + /* If this entry isn't new, we already have a stub. */ + if (sh->target_section != NULL) + { + free (stub_name); + return TRUE; + } + + sh->target_section = h->root.u.def.section; + sh->target_off = h->root.u.def.value; + stubs->count += 1; + } + + return TRUE; +} + +/* Called via bfd_hash_traverse to set up pointers to all symbols + in the stub hash table. */ + +static bfd_boolean +populate_stubs (struct bfd_hash_entry *bh, void *inf) +{ + struct stubarr *stubs = inf; + + stubs->sh[--stubs->count] = (struct spu_stub_hash_entry *) bh; + return TRUE; +} + +/* qsort predicate to sort stubs by overlay number. */ + +static int +sort_stubs (const void *a, const void *b) +{ + const struct spu_stub_hash_entry *const *sa = a; + const struct spu_stub_hash_entry *const *sb = b; + int i; + bfd_signed_vma d; + + i = spu_elf_section_data ((*sa)->target_section->output_section)->ovl_index; + i -= spu_elf_section_data ((*sb)->target_section->output_section)->ovl_index; + if (i != 0) + return i; + + d = ((*sa)->target_section->output_section->vma + + (*sa)->target_section->output_offset + + (*sa)->target_off + - (*sb)->target_section->output_section->vma + - (*sb)->target_section->output_offset + - (*sb)->target_off); + if (d != 0) + return d < 0 ? -1 : 1; + + /* Two functions at the same address. Aliases perhaps. */ + i = strcmp ((*sb)->root.string, (*sa)->root.string); + BFD_ASSERT (i != 0); + return i; +} + +/* Allocate space for overlay call and return stubs. */ + +bfd_boolean +spu_elf_size_stubs (bfd *output_bfd, + struct bfd_link_info *info, + int non_overlay_stubs, + int stack_analysis, + asection **stub, + asection **ovtab, + asection **toe) +{ + struct spu_link_hash_table *htab = spu_hash_table (info); + bfd *ibfd; + struct stubarr stubs; + unsigned i, group; + flagword flags; + + htab->non_overlay_stubs = non_overlay_stubs; + stubs.stub_hash_table = &htab->stub_hash_table; + stubs.count = 0; + stubs.err = 0; + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + { + extern const bfd_target bfd_elf32_spu_vec; + Elf_Internal_Shdr *symtab_hdr; + asection *section; + Elf_Internal_Sym *local_syms = NULL; + void *psyms; + + if (ibfd->xvec != &bfd_elf32_spu_vec) + continue; + + /* We'll need the symbol table in a second. */ + symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + if (symtab_hdr->sh_info == 0) + continue; + + /* Arrange to read and keep global syms for later stack analysis. */ + psyms = &local_syms; + if (stack_analysis) + psyms = &symtab_hdr->contents; + + /* Walk over each section attached to the input bfd. */ + for (section = ibfd->sections; section != NULL; section = section->next) + { + Elf_Internal_Rela *internal_relocs, *irelaend, *irela; + + /* If there aren't any relocs, then there's nothing more to do. */ + if ((section->flags & SEC_RELOC) == 0 + || (section->flags & SEC_ALLOC) == 0 + || (section->flags & SEC_LOAD) == 0 + || section->reloc_count == 0) + continue; + + /* If this section is a link-once section that will be + discarded, then don't create any stubs. */ + if (section->output_section == NULL + || section->output_section->owner != output_bfd) + continue; + + /* Get the relocs. */ + internal_relocs + = _bfd_elf_link_read_relocs (ibfd, section, NULL, NULL, + info->keep_memory); + if (internal_relocs == NULL) + goto error_ret_free_local; + + /* Now examine each relocation. */ + irela = internal_relocs; + irelaend = irela + section->reloc_count; + for (; irela < irelaend; irela++) + { + enum elf_spu_reloc_type r_type; + unsigned int r_indx; + asection *sym_sec; + Elf_Internal_Sym *sym; + struct elf_link_hash_entry *h; + const char *sym_name; + char *stub_name; + struct spu_stub_hash_entry *sh; + unsigned int sym_type; + enum _insn_type { non_branch, branch, call } insn_type; + + r_type = ELF32_R_TYPE (irela->r_info); + r_indx = ELF32_R_SYM (irela->r_info); + + if (r_type >= R_SPU_max) + { + bfd_set_error (bfd_error_bad_value); + goto error_ret_free_internal; + } + + /* Determine the reloc target section. */ + if (!get_sym_h (&h, &sym, &sym_sec, psyms, r_indx, ibfd)) + goto error_ret_free_internal; + + if (sym_sec == NULL + || sym_sec->output_section == NULL + || sym_sec->output_section->owner != output_bfd) + continue; + + /* Ensure no stubs for user supplied overlay manager syms. */ + if (h != NULL + && (strcmp (h->root.root.string, "__ovly_load") == 0 + || strcmp (h->root.root.string, "__ovly_return") == 0)) + continue; + + insn_type = non_branch; + if (r_type == R_SPU_REL16 + || r_type == R_SPU_ADDR16) + { + unsigned char insn[4]; + + if (!bfd_get_section_contents (ibfd, section, insn, + irela->r_offset, 4)) + goto error_ret_free_internal; + + if (is_branch (insn) || is_hint (insn)) + { + insn_type = branch; + if ((insn[0] & 0xfd) == 0x31) + insn_type = call; + } + } + + /* We are only interested in function symbols. */ + if (h != NULL) + { + sym_type = h->type; + sym_name = h->root.root.string; + } + else + { + sym_type = ELF_ST_TYPE (sym->st_info); + sym_name = bfd_elf_sym_name (sym_sec->owner, + symtab_hdr, + sym, + sym_sec); + } + if (sym_type != STT_FUNC) + { + /* It's common for people to write assembly and forget + to give function symbols the right type. Handle + calls to such symbols, but warn so that (hopefully) + people will fix their code. We need the symbol + type to be correct to distinguish function pointer + initialisation from other pointer initialisation. */ + if (insn_type == call) + (*_bfd_error_handler) (_("warning: call to non-function" + " symbol %s defined in %B"), + sym_sec->owner, sym_name); + else + continue; + } + + if (!needs_ovl_stub (sym_name, sym_sec, section, htab, + insn_type != non_branch)) + continue; + + stub_name = spu_stub_name (sym_sec, h, irela); + if (stub_name == NULL) + goto error_ret_free_internal; + + sh = (struct spu_stub_hash_entry *) + bfd_hash_lookup (&htab->stub_hash_table, stub_name, + TRUE, FALSE); + if (sh == NULL) + { + free (stub_name); + error_ret_free_internal: + if (elf_section_data (section)->relocs != internal_relocs) + free (internal_relocs); + error_ret_free_local: + if (local_syms != NULL + && (symtab_hdr->contents + != (unsigned char *) local_syms)) + free (local_syms); + return FALSE; + } + + /* If this entry isn't new, we already have a stub. */ + if (sh->target_section != NULL) + { + free (stub_name); + continue; + } + + sh->target_section = sym_sec; + if (h != NULL) + sh->target_off = h->root.u.def.value; + else + sh->target_off = sym->st_value; + sh->target_off += irela->r_addend; + + stubs.count += 1; + } + + /* We're done with the internal relocs, free them. */ + if (elf_section_data (section)->relocs != internal_relocs) + free (internal_relocs); + } + + if (local_syms != NULL + && symtab_hdr->contents != (unsigned char *) local_syms) + { + if (!info->keep_memory) + free (local_syms); + else + symtab_hdr->contents = (unsigned char *) local_syms; + } + } + + elf_link_hash_traverse (&htab->elf, allocate_spuear_stubs, &stubs); + if (stubs.err) + return FALSE; + + *stub = NULL; + if (stubs.count == 0) + return TRUE; + + ibfd = info->input_bfds; + flags = (SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_READONLY + | SEC_HAS_CONTENTS | SEC_IN_MEMORY); + htab->stub = bfd_make_section_anyway_with_flags (ibfd, ".stub", flags); + *stub = htab->stub; + if (htab->stub == NULL + || !bfd_set_section_alignment (ibfd, htab->stub, 2)) + return FALSE; + + flags = (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS | SEC_IN_MEMORY); + htab->ovtab = bfd_make_section_anyway_with_flags (ibfd, ".ovtab", flags); + *ovtab = htab->ovtab; + if (htab->ovtab == NULL + || !bfd_set_section_alignment (ibfd, htab->stub, 4)) + return FALSE; + + *toe = bfd_make_section_anyway_with_flags (ibfd, ".toe", SEC_ALLOC); + if (*toe == NULL + || !bfd_set_section_alignment (ibfd, *toe, 4)) + return FALSE; + (*toe)->size = 16; + + /* Retrieve all the stubs and sort. */ + stubs.sh = bfd_malloc (stubs.count * sizeof (*stubs.sh)); + if (stubs.sh == NULL) + return FALSE; + i = stubs.count; + bfd_hash_traverse (&htab->stub_hash_table, populate_stubs, &stubs); + BFD_ASSERT (stubs.count == 0); + + stubs.count = i; + qsort (stubs.sh, stubs.count, sizeof (*stubs.sh), sort_stubs); + + /* Now that the stubs are sorted, place them in the stub section. + Stubs are grouped per overlay + . ila $79,func1 + . br 1f + . ila $79,func2 + . br 1f + . + . + . ila $79,funcn + . nop + . 1: + . ila $78,ovl_index + . br __ovly_load */ + + group = 0; + for (i = 0; i < stubs.count; i++) + { + if (spu_elf_section_data (stubs.sh[group]->target_section + ->output_section)->ovl_index + != spu_elf_section_data (stubs.sh[i]->target_section + ->output_section)->ovl_index) + { + htab->stub->size += SIZEOF_STUB2; + for (; group != i; group++) + stubs.sh[group]->delta + = stubs.sh[i - 1]->off - stubs.sh[group]->off; + } + if (group == i + || ((stubs.sh[i - 1]->target_section->output_section->vma + + stubs.sh[i - 1]->target_section->output_offset + + stubs.sh[i - 1]->target_off) + != (stubs.sh[i]->target_section->output_section->vma + + stubs.sh[i]->target_section->output_offset + + stubs.sh[i]->target_off))) + { + stubs.sh[i]->off = htab->stub->size; + htab->stub->size += SIZEOF_STUB1; + } + else + stubs.sh[i]->off = stubs.sh[i - 1]->off; + } + if (group != i) + htab->stub->size += SIZEOF_STUB2; + for (; group != i; group++) + stubs.sh[group]->delta = stubs.sh[i - 1]->off - stubs.sh[group]->off; + + /* htab->ovtab consists of two arrays. + . struct { + . u32 vma; + . u32 size; + . u32 file_off; + . u32 buf; + . } _ovly_table[]; + . + . struct { + . u32 mapped; + . } _ovly_buf_table[]; */ + + htab->ovtab->alignment_power = 4; + htab->ovtab->size = htab->num_overlays * 16 + htab->num_buf * 4; + + return TRUE; +} + +/* Functions to handle embedded spu_ovl.o object. */ + +static void * +ovl_mgr_open (struct bfd *nbfd ATTRIBUTE_UNUSED, void *stream) +{ + return stream; +} + +static file_ptr +ovl_mgr_pread (struct bfd *abfd ATTRIBUTE_UNUSED, + void *stream, + void *buf, + file_ptr nbytes, + file_ptr offset) +{ + struct _ovl_stream *os; + size_t count; + size_t max; + + os = (struct _ovl_stream *) stream; + max = (const char *) os->end - (const char *) os->start; + + if ((ufile_ptr) offset >= max) + return 0; + + count = nbytes; + if (count > max - offset) + count = max - offset; + + memcpy (buf, (const char *) os->start + offset, count); + return count; +} + +bfd_boolean +spu_elf_open_builtin_lib (bfd **ovl_bfd, const struct _ovl_stream *stream) +{ + *ovl_bfd = bfd_openr_iovec ("builtin ovl_mgr", + "elf32-spu", + ovl_mgr_open, + (void *) stream, + ovl_mgr_pread, + NULL, + NULL); + return *ovl_bfd != NULL; +} + +/* Fill in the ila and br for a stub. On the last stub for a group, + write the stub that sets the overlay number too. */ + +static bfd_boolean +write_one_stub (struct bfd_hash_entry *bh, void *inf) +{ + struct spu_stub_hash_entry *ent = (struct spu_stub_hash_entry *) bh; + struct spu_link_hash_table *htab = inf; + asection *sec = htab->stub; + asection *s = ent->target_section; + unsigned int ovl; + bfd_vma val; + + val = ent->target_off + s->output_offset + s->output_section->vma; + bfd_put_32 (sec->owner, ILA_79 + ((val << 7) & 0x01ffff80), + sec->contents + ent->off); + val = ent->delta + 4; + bfd_put_32 (sec->owner, BR + ((val << 5) & 0x007fff80), + sec->contents + ent->off + 4); + + /* If this is the last stub of this group, write stub2. */ + if (ent->delta == 0) + { + bfd_put_32 (sec->owner, NOP, + sec->contents + ent->off + 4); + + ovl = spu_elf_section_data (s->output_section)->ovl_index; + bfd_put_32 (sec->owner, ILA_78 + ((ovl << 7) & 0x01ffff80), + sec->contents + ent->off + 8); + + val = (htab->ovly_load->root.u.def.section->output_section->vma + + htab->ovly_load->root.u.def.section->output_offset + + htab->ovly_load->root.u.def.value + - (sec->output_section->vma + + sec->output_offset + + ent->off + 12)); + + if (val + 0x20000 >= 0x40000) + htab->stub_overflow = TRUE; + + bfd_put_32 (sec->owner, BR + ((val << 5) & 0x007fff80), + sec->contents + ent->off + 12); + } + + if (htab->emit_stub_syms) + { + struct elf_link_hash_entry *h; + size_t len1, len2; + char *name; + + len1 = sizeof ("00000000.ovl_call.") - 1; + len2 = strlen (ent->root.string); + name = bfd_malloc (len1 + len2 + 1); + if (name == NULL) + return FALSE; + memcpy (name, "00000000.ovl_call.", len1); + memcpy (name + len1, ent->root.string, len2 + 1); + h = elf_link_hash_lookup (&htab->elf, name, TRUE, TRUE, FALSE); + free (name); + if (h == NULL) + return FALSE; + if (h->root.type == bfd_link_hash_new) + { + h->root.type = bfd_link_hash_defined; + h->root.u.def.section = sec; + h->root.u.def.value = ent->off; + h->size = (ent->delta == 0 + ? SIZEOF_STUB1 + SIZEOF_STUB2 : SIZEOF_STUB1); + h->type = STT_FUNC; + h->ref_regular = 1; + h->def_regular = 1; + h->ref_regular_nonweak = 1; + h->forced_local = 1; + h->non_elf = 0; + } + } + + return TRUE; +} + +/* Define an STT_OBJECT symbol. */ + +static struct elf_link_hash_entry * +define_ovtab_symbol (struct spu_link_hash_table *htab, const char *name) +{ + struct elf_link_hash_entry *h; + + h = elf_link_hash_lookup (&htab->elf, name, TRUE, FALSE, FALSE); + if (h == NULL) + return NULL; + + if (h->root.type != bfd_link_hash_defined + || !h->def_regular) + { + h->root.type = bfd_link_hash_defined; + h->root.u.def.section = htab->ovtab; + h->type = STT_OBJECT; + h->ref_regular = 1; + h->def_regular = 1; + h->ref_regular_nonweak = 1; + h->non_elf = 0; + } + else + { + (*_bfd_error_handler) (_("%B is not allowed to define %s"), + h->root.u.def.section->owner, + h->root.root.string); + bfd_set_error (bfd_error_bad_value); + return NULL; + } + + return h; +} + +/* Fill in all stubs and the overlay tables. */ + +bfd_boolean +spu_elf_build_stubs (struct bfd_link_info *info, int emit_syms, asection *toe) +{ + struct spu_link_hash_table *htab = spu_hash_table (info); + struct elf_link_hash_entry *h; + bfd_byte *p; + asection *s; + bfd *obfd; + unsigned int i; + + htab->emit_stub_syms = emit_syms; + htab->stub->contents = bfd_zalloc (htab->stub->owner, htab->stub->size); + if (htab->stub->contents == NULL) + return FALSE; + + h = elf_link_hash_lookup (&htab->elf, "__ovly_load", FALSE, FALSE, FALSE); + htab->ovly_load = h; + BFD_ASSERT (h != NULL + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && h->def_regular); + + s = h->root.u.def.section->output_section; + if (spu_elf_section_data (s)->ovl_index) + { + (*_bfd_error_handler) (_("%s in overlay section"), + h->root.u.def.section->owner); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + /* Write out all the stubs. */ + bfd_hash_traverse (&htab->stub_hash_table, write_one_stub, htab); + + if (htab->stub_overflow) + { + (*_bfd_error_handler) (_("overlay stub relocation overflow")); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + htab->ovtab->contents = bfd_zalloc (htab->ovtab->owner, htab->ovtab->size); + if (htab->ovtab->contents == NULL) + return FALSE; + + /* Write out _ovly_table. */ + p = htab->ovtab->contents; + obfd = htab->ovtab->output_section->owner; + for (s = obfd->sections; s != NULL; s = s->next) + { + unsigned int ovl_index = spu_elf_section_data (s)->ovl_index; + + if (ovl_index != 0) + { + unsigned int lo, hi, mid; + unsigned long off = (ovl_index - 1) * 16; + bfd_put_32 (htab->ovtab->owner, s->vma, p + off); + bfd_put_32 (htab->ovtab->owner, (s->size + 15) & -16, p + off + 4); + /* file_off written later in spu_elf_modify_program_headers. */ + + lo = 0; + hi = htab->num_buf; + while (lo < hi) + { + mid = (lo + hi) >> 1; + if (htab->ovl_region[2 * mid + 1]->vma + + htab->ovl_region[2 * mid + 1]->size <= s->vma) + lo = mid + 1; + else if (htab->ovl_region[2 * mid]->vma > s->vma) + hi = mid; + else + { + bfd_put_32 (htab->ovtab->owner, mid + 1, p + off + 12); + break; + } + } + BFD_ASSERT (lo < hi); + } + } + + /* Write out _ovly_buf_table. */ + p = htab->ovtab->contents + htab->num_overlays * 16; + for (i = 0; i < htab->num_buf; i++) + { + bfd_put_32 (htab->ovtab->owner, 0, p); + p += 4; + } + + h = define_ovtab_symbol (htab, "_ovly_table"); + if (h == NULL) + return FALSE; + h->root.u.def.value = 0; + h->size = htab->num_overlays * 16; + + h = define_ovtab_symbol (htab, "_ovly_table_end"); + if (h == NULL) + return FALSE; + h->root.u.def.value = htab->num_overlays * 16; + h->size = 0; + + h = define_ovtab_symbol (htab, "_ovly_buf_table"); + if (h == NULL) + return FALSE; + h->root.u.def.value = htab->num_overlays * 16; + h->size = htab->num_buf * 4; + + h = define_ovtab_symbol (htab, "_ovly_buf_table_end"); + if (h == NULL) + return FALSE; + h->root.u.def.value = htab->num_overlays * 16 + htab->num_buf * 4; + h->size = 0; + + h = define_ovtab_symbol (htab, "_EAR_"); + if (h == NULL) + return FALSE; + h->root.u.def.section = toe; + h->root.u.def.value = 0; + h->size = 16; + + return TRUE; +} + +/* OFFSET in SEC (presumably) is the beginning of a function prologue. + Search for stack adjusting insns, and return the sp delta. */ + +static int +find_function_stack_adjust (asection *sec, bfd_vma offset) +{ + int unrecog; + int reg[128]; + + memset (reg, 0, sizeof (reg)); + for (unrecog = 0; offset + 4 <= sec->size && unrecog < 32; offset += 4) + { + unsigned char buf[4]; + int rt, ra; + int imm; + + /* Assume no relocs on stack adjusing insns. */ + if (!bfd_get_section_contents (sec->owner, sec, buf, offset, 4)) + break; + + if (buf[0] == 0x24 /* stqd */) + continue; + + rt = buf[3] & 0x7f; + ra = ((buf[2] & 0x3f) << 1) | (buf[3] >> 7); + /* Partly decoded immediate field. */ + imm = (buf[1] << 9) | (buf[2] << 1) | (buf[3] >> 7); + + if (buf[0] == 0x1c /* ai */) + { + imm >>= 7; + imm = (imm ^ 0x200) - 0x200; + reg[rt] = reg[ra] + imm; + + if (rt == 1 /* sp */) + { + if (imm > 0) + break; + return reg[rt]; + } + } + else if (buf[0] == 0x18 && (buf[1] & 0xe0) == 0 /* a */) + { + int rb = ((buf[1] & 0x1f) << 2) | ((buf[2] & 0xc0) >> 6); + + reg[rt] = reg[ra] + reg[rb]; + if (rt == 1) + return reg[rt]; + } + else if ((buf[0] & 0xfc) == 0x40 /* il, ilh, ilhu, ila */) + { + if (buf[0] >= 0x42 /* ila */) + imm |= (buf[0] & 1) << 17; + else + { + imm &= 0xffff; + + if (buf[0] == 0x40 /* il */) + { + if ((buf[1] & 0x80) == 0) + goto unknown_insn; + imm = (imm ^ 0x8000) - 0x8000; + } + else if ((buf[1] & 0x80) == 0 /* ilhu */) + imm <<= 16; + } + reg[rt] = imm; + continue; + } + else if (buf[0] == 0x60 && (buf[1] & 0x80) != 0 /* iohl */) + { + reg[rt] |= imm & 0xffff; + continue; + } + else if (buf[0] == 0x04 /* ori */) + { + imm >>= 7; + imm = (imm ^ 0x200) - 0x200; + reg[rt] = reg[ra] | imm; + continue; + } + else if ((buf[0] == 0x33 && imm == 1 /* brsl .+4 */) + || (buf[0] == 0x08 && (buf[1] & 0xe0) == 0 /* sf */)) + { + /* Used in pic reg load. Say rt is trashed. */ + reg[rt] = 0; + continue; + } + else if (is_branch (buf)) + /* If we hit a branch then we must be out of the prologue. */ + break; + unknown_insn: + ++unrecog; + } + + return 0; +} + +/* qsort predicate to sort symbols by section and value. */ + +static Elf_Internal_Sym *sort_syms_syms; +static asection **sort_syms_psecs; + +static int +sort_syms (const void *a, const void *b) +{ + Elf_Internal_Sym *const *s1 = a; + Elf_Internal_Sym *const *s2 = b; + asection *sec1,*sec2; + bfd_signed_vma delta; + + sec1 = sort_syms_psecs[*s1 - sort_syms_syms]; + sec2 = sort_syms_psecs[*s2 - sort_syms_syms]; + + if (sec1 != sec2) + return sec1->index - sec2->index; + + delta = (*s1)->st_value - (*s2)->st_value; + if (delta != 0) + return delta < 0 ? -1 : 1; + + delta = (*s2)->st_size - (*s1)->st_size; + if (delta != 0) + return delta < 0 ? -1 : 1; + + return *s1 < *s2 ? -1 : 1; +} + +struct call_info +{ + struct function_info *fun; + struct call_info *next; + int is_tail; +}; + +struct function_info +{ + /* List of functions called. Also branches to hot/cold part of + function. */ + struct call_info *call_list; + /* For hot/cold part of function, point to owner. */ + struct function_info *start; + /* Symbol at start of function. */ + union { + Elf_Internal_Sym *sym; + struct elf_link_hash_entry *h; + } u; + /* Function section. */ + asection *sec; + /* Address range of (this part of) function. */ + bfd_vma lo, hi; + /* Stack usage. */ + int stack; + /* Set if global symbol. */ + unsigned int global : 1; + /* Set if known to be start of function (as distinct from a hunk + in hot/cold section. */ + unsigned int is_func : 1; + /* Flags used during call tree traversal. */ + unsigned int visit1 : 1; + unsigned int non_root : 1; + unsigned int visit2 : 1; + unsigned int marking : 1; + unsigned int visit3 : 1; +}; + +struct spu_elf_stack_info +{ + int num_fun; + int max_fun; + /* Variable size array describing functions, one per contiguous + address range belonging to a function. */ + struct function_info fun[1]; +}; + +/* Allocate a struct spu_elf_stack_info with MAX_FUN struct function_info + entries for section SEC. */ + +static struct spu_elf_stack_info * +alloc_stack_info (asection *sec, int max_fun) +{ + struct _spu_elf_section_data *sec_data = spu_elf_section_data (sec); + bfd_size_type amt; + + amt = sizeof (struct spu_elf_stack_info); + amt += (max_fun - 1) * sizeof (struct function_info); + sec_data->stack_info = bfd_zmalloc (amt); + if (sec_data->stack_info != NULL) + sec_data->stack_info->max_fun = max_fun; + return sec_data->stack_info; +} + +/* Add a new struct function_info describing a (part of a) function + starting at SYM_H. Keep the array sorted by address. */ + +static struct function_info * +maybe_insert_function (asection *sec, + void *sym_h, + bfd_boolean global, + bfd_boolean is_func) +{ + struct _spu_elf_section_data *sec_data = spu_elf_section_data (sec); + struct spu_elf_stack_info *sinfo = sec_data->stack_info; + int i; + bfd_vma off, size; + + if (sinfo == NULL) + { + sinfo = alloc_stack_info (sec, 20); + if (sinfo == NULL) + return NULL; + } + + if (!global) + { + Elf_Internal_Sym *sym = sym_h; + off = sym->st_value; + size = sym->st_size; + } + else + { + struct elf_link_hash_entry *h = sym_h; + off = h->root.u.def.value; + size = h->size; + } + + for (i = sinfo->num_fun; --i >= 0; ) + if (sinfo->fun[i].lo <= off) + break; + + if (i >= 0) + { + /* Don't add another entry for an alias, but do update some + info. */ + if (sinfo->fun[i].lo == off) + { + /* Prefer globals over local syms. */ + if (global && !sinfo->fun[i].global) + { + sinfo->fun[i].global = TRUE; + sinfo->fun[i].u.h = sym_h; + } + if (is_func) + sinfo->fun[i].is_func = TRUE; + return &sinfo->fun[i]; + } + /* Ignore a zero-size symbol inside an existing function. */ + else if (sinfo->fun[i].hi > off && size == 0) + return &sinfo->fun[i]; + } + + if (++i < sinfo->num_fun) + memmove (&sinfo->fun[i + 1], &sinfo->fun[i], + (sinfo->num_fun - i) * sizeof (sinfo->fun[i])); + else if (i >= sinfo->max_fun) + { + bfd_size_type amt = sizeof (struct spu_elf_stack_info); + bfd_size_type old = amt; + + old += (sinfo->max_fun - 1) * sizeof (struct function_info); + sinfo->max_fun += 20 + (sinfo->max_fun >> 1); + amt += (sinfo->max_fun - 1) * sizeof (struct function_info); + sinfo = bfd_realloc (sinfo, amt); + if (sinfo == NULL) + return NULL; + memset ((char *) sinfo + old, 0, amt - old); + sec_data->stack_info = sinfo; + } + sinfo->fun[i].is_func = is_func; + sinfo->fun[i].global = global; + sinfo->fun[i].sec = sec; + if (global) + sinfo->fun[i].u.h = sym_h; + else + sinfo->fun[i].u.sym = sym_h; + sinfo->fun[i].lo = off; + sinfo->fun[i].hi = off + size; + sinfo->fun[i].stack = -find_function_stack_adjust (sec, off); + sinfo->num_fun += 1; + return &sinfo->fun[i]; +} + +/* Return the name of FUN. */ + +static const char * +func_name (struct function_info *fun) +{ + asection *sec; + bfd *ibfd; + Elf_Internal_Shdr *symtab_hdr; + + while (fun->start != NULL) + fun = fun->start; + + if (fun->global) + return fun->u.h->root.root.string; + + sec = fun->sec; + if (fun->u.sym->st_name == 0) + { + size_t len = strlen (sec->name); + char *name = bfd_malloc (len + 10); + if (name == NULL) + return "(null)"; + sprintf (name, "%s+%lx", sec->name, + (unsigned long) fun->u.sym->st_value & 0xffffffff); + return name; + } + ibfd = sec->owner; + symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + return bfd_elf_sym_name (ibfd, symtab_hdr, fun->u.sym, sec); +} + +/* Read the instruction at OFF in SEC. Return true iff the instruction + is a nop, lnop, or stop 0 (all zero insn). */ + +static bfd_boolean +is_nop (asection *sec, bfd_vma off) +{ + unsigned char insn[4]; + + if (off + 4 > sec->size + || !bfd_get_section_contents (sec->owner, sec, insn, off, 4)) + return FALSE; + if ((insn[0] & 0xbf) == 0 && (insn[1] & 0xe0) == 0x20) + return TRUE; + if (insn[0] == 0 && insn[1] == 0 && insn[2] == 0 && insn[3] == 0) + return TRUE; + return FALSE; +} + +/* Extend the range of FUN to cover nop padding up to LIMIT. + Return TRUE iff some instruction other than a NOP was found. */ + +static bfd_boolean +insns_at_end (struct function_info *fun, bfd_vma limit) +{ + bfd_vma off = (fun->hi + 3) & -4; + + while (off < limit && is_nop (fun->sec, off)) + off += 4; + if (off < limit) + { + fun->hi = off; + return TRUE; + } + fun->hi = limit; + return FALSE; +} + +/* Check and fix overlapping function ranges. Return TRUE iff there + are gaps in the current info we have about functions in SEC. */ + +static bfd_boolean +check_function_ranges (asection *sec, struct bfd_link_info *info) +{ + struct _spu_elf_section_data *sec_data = spu_elf_section_data (sec); + struct spu_elf_stack_info *sinfo = sec_data->stack_info; + int i; + bfd_boolean gaps = FALSE; + + if (sinfo == NULL) + return FALSE; + + for (i = 1; i < sinfo->num_fun; i++) + if (sinfo->fun[i - 1].hi > sinfo->fun[i].lo) + { + /* Fix overlapping symbols. */ + const char *f1 = func_name (&sinfo->fun[i - 1]); + const char *f2 = func_name (&sinfo->fun[i]); + + info->callbacks->einfo (_("warning: %s overlaps %s\n"), f1, f2); + sinfo->fun[i - 1].hi = sinfo->fun[i].lo; + } + else if (insns_at_end (&sinfo->fun[i - 1], sinfo->fun[i].lo)) + gaps = TRUE; + + if (sinfo->num_fun == 0) + gaps = TRUE; + else + { + if (sinfo->fun[0].lo != 0) + gaps = TRUE; + if (sinfo->fun[sinfo->num_fun - 1].hi > sec->size) + { + const char *f1 = func_name (&sinfo->fun[sinfo->num_fun - 1]); + + info->callbacks->einfo (_("warning: %s exceeds section size\n"), f1); + sinfo->fun[sinfo->num_fun - 1].hi = sec->size; + } + else if (insns_at_end (&sinfo->fun[sinfo->num_fun - 1], sec->size)) + gaps = TRUE; + } + return gaps; +} + +/* Search current function info for a function that contains address + OFFSET in section SEC. */ + +static struct function_info * +find_function (asection *sec, bfd_vma offset, struct bfd_link_info *info) +{ + struct _spu_elf_section_data *sec_data = spu_elf_section_data (sec); + struct spu_elf_stack_info *sinfo = sec_data->stack_info; + int lo, hi, mid; + + lo = 0; + hi = sinfo->num_fun; + while (lo < hi) + { + mid = (lo + hi) / 2; + if (offset < sinfo->fun[mid].lo) + hi = mid; + else if (offset >= sinfo->fun[mid].hi) + lo = mid + 1; + else + return &sinfo->fun[mid]; + } + info->callbacks->einfo (_("%A:0x%v not found in function table\n"), + sec, offset); + return NULL; +} + +/* Add CALLEE to CALLER call list if not already present. */ + +static bfd_boolean +insert_callee (struct function_info *caller, struct call_info *callee) +{ + struct call_info *p; + for (p = caller->call_list; p != NULL; p = p->next) + if (p->fun == callee->fun) + { + /* Tail calls use less stack than normal calls. Retain entry + for normal call over one for tail call. */ + if (p->is_tail > callee->is_tail) + p->is_tail = callee->is_tail; + return FALSE; + } + callee->next = caller->call_list; + caller->call_list = callee; + return TRUE; +} + +/* Rummage through the relocs for SEC, looking for function calls. + If CALL_TREE is true, fill in call graph. If CALL_TREE is false, + mark destination symbols on calls as being functions. Also + look at branches, which may be tail calls or go to hot/cold + section part of same function. */ + +static bfd_boolean +mark_functions_via_relocs (asection *sec, + struct bfd_link_info *info, + int call_tree) +{ + Elf_Internal_Rela *internal_relocs, *irelaend, *irela; + Elf_Internal_Shdr *symtab_hdr = &elf_tdata (sec->owner)->symtab_hdr; + Elf_Internal_Sym *syms; + void *psyms; + static bfd_boolean warned; + + internal_relocs = _bfd_elf_link_read_relocs (sec->owner, sec, NULL, NULL, + info->keep_memory); + if (internal_relocs == NULL) + return FALSE; + + symtab_hdr = &elf_tdata (sec->owner)->symtab_hdr; + psyms = &symtab_hdr->contents; + syms = *(Elf_Internal_Sym **) psyms; + irela = internal_relocs; + irelaend = irela + sec->reloc_count; + for (; irela < irelaend; irela++) + { + enum elf_spu_reloc_type r_type; + unsigned int r_indx; + asection *sym_sec; + Elf_Internal_Sym *sym; + struct elf_link_hash_entry *h; + bfd_vma val; + unsigned char insn[4]; + bfd_boolean is_call; + struct function_info *caller; + struct call_info *callee; + + r_type = ELF32_R_TYPE (irela->r_info); + if (r_type != R_SPU_REL16 + && r_type != R_SPU_ADDR16) + continue; + + r_indx = ELF32_R_SYM (irela->r_info); + if (!get_sym_h (&h, &sym, &sym_sec, psyms, r_indx, sec->owner)) + return FALSE; + + if (sym_sec == NULL + || sym_sec->output_section == NULL + || sym_sec->output_section->owner != sec->output_section->owner) + continue; + + if (!bfd_get_section_contents (sec->owner, sec, insn, + irela->r_offset, 4)) + return FALSE; + if (!is_branch (insn)) + continue; + + if ((sym_sec->flags & (SEC_ALLOC | SEC_LOAD | SEC_CODE)) + != (SEC_ALLOC | SEC_LOAD | SEC_CODE)) + { + if (!call_tree) + warned = TRUE; + if (!call_tree || !warned) + info->callbacks->einfo (_("%B(%A+0x%v): call to non-code section" + " %B(%A), stack analysis incomplete\n"), + sec->owner, sec, irela->r_offset, + sym_sec->owner, sym_sec); + continue; + } + + is_call = (insn[0] & 0xfd) == 0x31; + + if (h) + val = h->root.u.def.value; + else + val = sym->st_value; + val += irela->r_addend; + + if (!call_tree) + { + struct function_info *fun; + + if (irela->r_addend != 0) + { + Elf_Internal_Sym *fake = bfd_zmalloc (sizeof (*fake)); + if (fake == NULL) + return FALSE; + fake->st_value = val; + fake->st_shndx + = _bfd_elf_section_from_bfd_section (sym_sec->owner, sym_sec); + sym = fake; + } + if (sym) + fun = maybe_insert_function (sym_sec, sym, FALSE, is_call); + else + fun = maybe_insert_function (sym_sec, h, TRUE, is_call); + if (fun == NULL) + return FALSE; + if (irela->r_addend != 0 + && fun->u.sym != sym) + free (sym); + continue; + } + + caller = find_function (sec, irela->r_offset, info); + if (caller == NULL) + return FALSE; + callee = bfd_malloc (sizeof *callee); + if (callee == NULL) + return FALSE; + + callee->fun = find_function (sym_sec, val, info); + if (callee->fun == NULL) + return FALSE; + callee->is_tail = !is_call; + if (!insert_callee (caller, callee)) + free (callee); + else if (!is_call + && !callee->fun->is_func + && callee->fun->stack == 0) + { + /* This is either a tail call or a branch from one part of + the function to another, ie. hot/cold section. If the + destination has been called by some other function then + it is a separate function. We also assume that functions + are not split across input files. */ + if (callee->fun->start != NULL + || sec->owner != sym_sec->owner) + { + callee->fun->start = NULL; + callee->fun->is_func = TRUE; + } + else + callee->fun->start = caller; + } + } + + return TRUE; +} + +/* Handle something like .init or .fini, which has a piece of a function. + These sections are pasted together to form a single function. */ + +static bfd_boolean +pasted_function (asection *sec, struct bfd_link_info *info) +{ + struct bfd_link_order *l; + struct _spu_elf_section_data *sec_data; + struct spu_elf_stack_info *sinfo; + Elf_Internal_Sym *fake; + struct function_info *fun, *fun_start; + + fake = bfd_zmalloc (sizeof (*fake)); + if (fake == NULL) + return FALSE; + fake->st_value = 0; + fake->st_size = sec->size; + fake->st_shndx + = _bfd_elf_section_from_bfd_section (sec->owner, sec); + fun = maybe_insert_function (sec, fake, FALSE, FALSE); + if (!fun) + return FALSE; + + /* Find a function immediately preceding this section. */ + fun_start = NULL; + for (l = sec->output_section->map_head.link_order; l != NULL; l = l->next) + { + if (l->u.indirect.section == sec) + { + if (fun_start != NULL) + { + if (fun_start->start) + fun_start = fun_start->start; + fun->start = fun_start; + } + return TRUE; + } + if (l->type == bfd_indirect_link_order + && (sec_data = spu_elf_section_data (l->u.indirect.section)) != NULL + && (sinfo = sec_data->stack_info) != NULL + && sinfo->num_fun != 0) + fun_start = &sinfo->fun[sinfo->num_fun - 1]; + } + + info->callbacks->einfo (_("%A link_order not found\n"), sec); + return FALSE; +} + +/* We're only interested in code sections. */ + +static bfd_boolean +interesting_section (asection *s, bfd *obfd, struct spu_link_hash_table *htab) +{ + return (s != htab->stub + && s->output_section != NULL + && s->output_section->owner == obfd + && ((s->flags & (SEC_ALLOC | SEC_LOAD | SEC_CODE)) + == (SEC_ALLOC | SEC_LOAD | SEC_CODE)) + && s->size != 0); +} + +/* Map address ranges in code sections to functions. */ + +static bfd_boolean +discover_functions (bfd *output_bfd, struct bfd_link_info *info) +{ + struct spu_link_hash_table *htab = spu_hash_table (info); + bfd *ibfd; + int bfd_idx; + Elf_Internal_Sym ***psym_arr; + asection ***sec_arr; + bfd_boolean gaps = FALSE; + + bfd_idx = 0; + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + bfd_idx++; + + psym_arr = bfd_zmalloc (bfd_idx * sizeof (*psym_arr)); + if (psym_arr == NULL) + return FALSE; + sec_arr = bfd_zmalloc (bfd_idx * sizeof (*sec_arr)); + if (sec_arr == NULL) + return FALSE; + + + for (ibfd = info->input_bfds, bfd_idx = 0; + ibfd != NULL; + ibfd = ibfd->link_next, bfd_idx++) + { + extern const bfd_target bfd_elf32_spu_vec; + Elf_Internal_Shdr *symtab_hdr; + asection *sec; + size_t symcount; + Elf_Internal_Sym *syms, *sy, **psyms, **psy; + asection **psecs, **p; + + if (ibfd->xvec != &bfd_elf32_spu_vec) + continue; + + /* Read all the symbols. */ + symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + symcount = symtab_hdr->sh_size / symtab_hdr->sh_entsize; + if (symcount == 0) + continue; + + syms = (Elf_Internal_Sym *) symtab_hdr->contents; + if (syms == NULL) + { + syms = bfd_elf_get_elf_syms (ibfd, symtab_hdr, symcount, 0, + NULL, NULL, NULL); + symtab_hdr->contents = (void *) syms; + if (syms == NULL) + return FALSE; + } + + /* Select defined function symbols that are going to be output. */ + psyms = bfd_malloc ((symcount + 1) * sizeof (*psyms)); + if (psyms == NULL) + return FALSE; + psym_arr[bfd_idx] = psyms; + psecs = bfd_malloc (symcount * sizeof (*psecs)); + if (psecs == NULL) + return FALSE; + sec_arr[bfd_idx] = psecs; + for (psy = psyms, p = psecs, sy = syms; sy < syms + symcount; ++p, ++sy) + if (ELF_ST_TYPE (sy->st_info) == STT_NOTYPE + || ELF_ST_TYPE (sy->st_info) == STT_FUNC) + { + asection *s; + + *p = s = bfd_section_from_elf_index (ibfd, sy->st_shndx); + if (s != NULL && interesting_section (s, output_bfd, htab)) + *psy++ = sy; + } + symcount = psy - psyms; + *psy = NULL; + + /* Sort them by section and offset within section. */ + sort_syms_syms = syms; + sort_syms_psecs = psecs; + qsort (psyms, symcount, sizeof (*psyms), sort_syms); + + /* Now inspect the function symbols. */ + for (psy = psyms; psy < psyms + symcount; ) + { + asection *s = psecs[*psy - syms]; + Elf_Internal_Sym **psy2; + + for (psy2 = psy; ++psy2 < psyms + symcount; ) + if (psecs[*psy2 - syms] != s) + break; + + if (!alloc_stack_info (s, psy2 - psy)) + return FALSE; + psy = psy2; + } + + /* First install info about properly typed and sized functions. + In an ideal world this will cover all code sections, except + when partitioning functions into hot and cold sections, + and the horrible pasted together .init and .fini functions. */ + for (psy = psyms; psy < psyms + symcount; ++psy) + { + sy = *psy; + if (ELF_ST_TYPE (sy->st_info) == STT_FUNC) + { + asection *s = psecs[sy - syms]; + if (!maybe_insert_function (s, sy, FALSE, TRUE)) + return FALSE; + } + } + + for (sec = ibfd->sections; sec != NULL && !gaps; sec = sec->next) + if (interesting_section (sec, output_bfd, htab)) + gaps |= check_function_ranges (sec, info); + } + + if (gaps) + { + /* See if we can discover more function symbols by looking at + relocations. */ + for (ibfd = info->input_bfds, bfd_idx = 0; + ibfd != NULL; + ibfd = ibfd->link_next, bfd_idx++) + { + asection *sec; + + if (psym_arr[bfd_idx] == NULL) + continue; + + for (sec = ibfd->sections; sec != NULL; sec = sec->next) + if (interesting_section (sec, output_bfd, htab) + && sec->reloc_count != 0) + { + if (!mark_functions_via_relocs (sec, info, FALSE)) + return FALSE; + } + } + + for (ibfd = info->input_bfds, bfd_idx = 0; + ibfd != NULL; + ibfd = ibfd->link_next, bfd_idx++) + { + Elf_Internal_Shdr *symtab_hdr; + asection *sec; + Elf_Internal_Sym *syms, *sy, **psyms, **psy; + asection **psecs; + + if ((psyms = psym_arr[bfd_idx]) == NULL) + continue; + + psecs = sec_arr[bfd_idx]; + + symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + syms = (Elf_Internal_Sym *) symtab_hdr->contents; + + gaps = FALSE; + for (sec = ibfd->sections; sec != NULL && !gaps; sec = sec->next) + if (interesting_section (sec, output_bfd, htab)) + gaps |= check_function_ranges (sec, info); + if (!gaps) + continue; + + /* Finally, install all globals. */ + for (psy = psyms; (sy = *psy) != NULL; ++psy) + { + asection *s; + + s = psecs[sy - syms]; + + /* Global syms might be improperly typed functions. */ + if (ELF_ST_TYPE (sy->st_info) != STT_FUNC + && ELF_ST_BIND (sy->st_info) == STB_GLOBAL) + { + if (!maybe_insert_function (s, sy, FALSE, FALSE)) + return FALSE; + } + } + + /* Some of the symbols we've installed as marking the + beginning of functions may have a size of zero. Extend + the range of such functions to the beginning of the + next symbol of interest. */ + for (sec = ibfd->sections; sec != NULL; sec = sec->next) + if (interesting_section (sec, output_bfd, htab)) + { + struct _spu_elf_section_data *sec_data; + struct spu_elf_stack_info *sinfo; + + sec_data = spu_elf_section_data (sec); + sinfo = sec_data->stack_info; + if (sinfo != NULL) + { + int fun_idx; + bfd_vma hi = sec->size; + + for (fun_idx = sinfo->num_fun; --fun_idx >= 0; ) + { + sinfo->fun[fun_idx].hi = hi; + hi = sinfo->fun[fun_idx].lo; + } + } + /* No symbols in this section. Must be .init or .fini + or something similar. */ + else if (!pasted_function (sec, info)) + return FALSE; + } + } + } + + for (ibfd = info->input_bfds, bfd_idx = 0; + ibfd != NULL; + ibfd = ibfd->link_next, bfd_idx++) + { + if (psym_arr[bfd_idx] == NULL) + continue; + + free (psym_arr[bfd_idx]); + free (sec_arr[bfd_idx]); + } + + free (psym_arr); + free (sec_arr); + + return TRUE; +} + +/* Mark nodes in the call graph that are called by some other node. */ + +static void +mark_non_root (struct function_info *fun) +{ + struct call_info *call; + + fun->visit1 = TRUE; + for (call = fun->call_list; call; call = call->next) + { + call->fun->non_root = TRUE; + if (!call->fun->visit1) + mark_non_root (call->fun); + } +} + +/* Remove cycles from the call graph. */ + +static void +call_graph_traverse (struct function_info *fun, struct bfd_link_info *info) +{ + struct call_info **callp, *call; + + fun->visit2 = TRUE; + fun->marking = TRUE; + + callp = &fun->call_list; + while ((call = *callp) != NULL) + { + if (!call->fun->visit2) + call_graph_traverse (call->fun, info); + else if (call->fun->marking) + { + const char *f1 = func_name (fun); + const char *f2 = func_name (call->fun); + + info->callbacks->info (_("Stack analysis will ignore the call " + "from %s to %s\n"), + f1, f2); + *callp = call->next; + continue; + } + callp = &call->next; + } + fun->marking = FALSE; +} + +/* Populate call_list for each function. */ + +static bfd_boolean +build_call_tree (bfd *output_bfd, struct bfd_link_info *info) +{ + struct spu_link_hash_table *htab = spu_hash_table (info); + bfd *ibfd; + + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + { + extern const bfd_target bfd_elf32_spu_vec; + asection *sec; + + if (ibfd->xvec != &bfd_elf32_spu_vec) + continue; + + for (sec = ibfd->sections; sec != NULL; sec = sec->next) + { + if (!interesting_section (sec, output_bfd, htab) + || sec->reloc_count == 0) + continue; + + if (!mark_functions_via_relocs (sec, info, TRUE)) + return FALSE; + } + + /* Transfer call info from hot/cold section part of function + to main entry. */ + for (sec = ibfd->sections; sec != NULL; sec = sec->next) + { + struct _spu_elf_section_data *sec_data; + struct spu_elf_stack_info *sinfo; + + if ((sec_data = spu_elf_section_data (sec)) != NULL + && (sinfo = sec_data->stack_info) != NULL) + { + int i; + for (i = 0; i < sinfo->num_fun; ++i) + { + if (sinfo->fun[i].start != NULL) + { + struct call_info *call = sinfo->fun[i].call_list; + + while (call != NULL) + { + struct call_info *call_next = call->next; + if (!insert_callee (sinfo->fun[i].start, call)) + free (call); + call = call_next; + } + sinfo->fun[i].call_list = NULL; + sinfo->fun[i].non_root = TRUE; + } + } + } + } + } + + /* Find the call graph root(s). */ + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + { + extern const bfd_target bfd_elf32_spu_vec; + asection *sec; + + if (ibfd->xvec != &bfd_elf32_spu_vec) + continue; + + for (sec = ibfd->sections; sec != NULL; sec = sec->next) + { + struct _spu_elf_section_data *sec_data; + struct spu_elf_stack_info *sinfo; + + if ((sec_data = spu_elf_section_data (sec)) != NULL + && (sinfo = sec_data->stack_info) != NULL) + { + int i; + for (i = 0; i < sinfo->num_fun; ++i) + if (!sinfo->fun[i].visit1) + mark_non_root (&sinfo->fun[i]); + } + } + } + + /* Remove cycles from the call graph. We start from the root node(s) + so that we break cycles in a reasonable place. */ + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + { + extern const bfd_target bfd_elf32_spu_vec; + asection *sec; + + if (ibfd->xvec != &bfd_elf32_spu_vec) + continue; + + for (sec = ibfd->sections; sec != NULL; sec = sec->next) + { + struct _spu_elf_section_data *sec_data; + struct spu_elf_stack_info *sinfo; + + if ((sec_data = spu_elf_section_data (sec)) != NULL + && (sinfo = sec_data->stack_info) != NULL) + { + int i; + for (i = 0; i < sinfo->num_fun; ++i) + if (!sinfo->fun[i].non_root) + call_graph_traverse (&sinfo->fun[i], info); + } + } + } + + return TRUE; +} + +/* Descend the call graph for FUN, accumulating total stack required. */ + +static bfd_vma +sum_stack (struct function_info *fun, + struct bfd_link_info *info, + int emit_stack_syms) +{ + struct call_info *call; + struct function_info *max = NULL; + bfd_vma max_stack = fun->stack; + bfd_vma stack; + const char *f1; + + if (fun->visit3) + return max_stack; + + for (call = fun->call_list; call; call = call->next) + { + stack = sum_stack (call->fun, info, emit_stack_syms); + /* Include caller stack for normal calls, don't do so for + tail calls. fun->stack here is local stack usage for + this function. */ + if (!call->is_tail) + stack += fun->stack; + if (max_stack < stack) + { + max_stack = stack; + max = call->fun; + } + } + + f1 = func_name (fun); + info->callbacks->minfo (_("%s: 0x%v 0x%v\n"), f1, fun->stack, max_stack); + + if (fun->call_list) + { + info->callbacks->minfo (_(" calls:\n")); + for (call = fun->call_list; call; call = call->next) + { + const char *f2 = func_name (call->fun); + const char *ann1 = call->fun == max ? "*" : " "; + const char *ann2 = call->is_tail ? "t" : " "; + + info->callbacks->minfo (_(" %s%s %s\n"), ann1, ann2, f2); + } + } + + /* Now fun->stack holds cumulative stack. */ + fun->stack = max_stack; + fun->visit3 = TRUE; + + if (emit_stack_syms) + { + struct spu_link_hash_table *htab = spu_hash_table (info); + char *name = bfd_malloc (18 + strlen (f1)); + struct elf_link_hash_entry *h; + + if (name != NULL) + { + if (fun->global || ELF_ST_BIND (fun->u.sym->st_info) == STB_GLOBAL) + sprintf (name, "__stack_%s", f1); + else + sprintf (name, "__stack_%x_%s", fun->sec->id & 0xffffffff, f1); + + h = elf_link_hash_lookup (&htab->elf, name, TRUE, TRUE, FALSE); + free (name); + if (h != NULL + && (h->root.type == bfd_link_hash_new + || h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak)) + { + h->root.type = bfd_link_hash_defined; + h->root.u.def.section = bfd_abs_section_ptr; + h->root.u.def.value = max_stack; + h->size = 0; + h->type = 0; + h->ref_regular = 1; + h->def_regular = 1; + h->ref_regular_nonweak = 1; + h->forced_local = 1; + h->non_elf = 0; + } + } + } + + return max_stack; +} + +/* Provide an estimate of total stack required. */ + +static bfd_boolean +spu_elf_stack_analysis (bfd *output_bfd, + struct bfd_link_info *info, + int emit_stack_syms) +{ + bfd *ibfd; + bfd_vma max_stack = 0; + + if (!discover_functions (output_bfd, info)) + return FALSE; + + if (!build_call_tree (output_bfd, info)) + return FALSE; + + info->callbacks->info (_("Stack size for call graph root nodes.\n")); + info->callbacks->minfo (_("\nStack size for functions. " + "Annotations: '*' max stack, 't' tail call\n")); + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + { + extern const bfd_target bfd_elf32_spu_vec; + asection *sec; + + if (ibfd->xvec != &bfd_elf32_spu_vec) + continue; + + for (sec = ibfd->sections; sec != NULL; sec = sec->next) + { + struct _spu_elf_section_data *sec_data; + struct spu_elf_stack_info *sinfo; + + if ((sec_data = spu_elf_section_data (sec)) != NULL + && (sinfo = sec_data->stack_info) != NULL) + { + int i; + for (i = 0; i < sinfo->num_fun; ++i) + { + if (!sinfo->fun[i].non_root) + { + bfd_vma stack; + const char *f1; + + stack = sum_stack (&sinfo->fun[i], info, + emit_stack_syms); + f1 = func_name (&sinfo->fun[i]); + info->callbacks->info (_(" %s: 0x%v\n"), + f1, stack); + if (max_stack < stack) + max_stack = stack; + } + } + } + } + } + + info->callbacks->info (_("Maximum stack required is 0x%v\n"), max_stack); + return TRUE; +} + +/* Perform a final link. */ + +static bfd_boolean +spu_elf_final_link (bfd *output_bfd, struct bfd_link_info *info) +{ + struct spu_link_hash_table *htab = spu_hash_table (info); + + if (htab->stack_analysis + && !spu_elf_stack_analysis (output_bfd, info, htab->emit_stack_syms)) + info->callbacks->einfo ("%X%P: stack analysis error: %E\n"); + + return bfd_elf_final_link (output_bfd, info); +} + +/* Called when not normally emitting relocs, ie. !info->relocatable + and !info->emitrelocations. Returns a count of special relocs + that need to be emitted. */ + +static unsigned int +spu_elf_count_relocs (asection *sec, Elf_Internal_Rela *relocs) +{ + unsigned int count = 0; + Elf_Internal_Rela *relend = relocs + sec->reloc_count; + + for (; relocs < relend; relocs++) + { + int r_type = ELF32_R_TYPE (relocs->r_info); + if (r_type == R_SPU_PPU32 || r_type == R_SPU_PPU64) + ++count; + } + + return count; +} + +/* Apply RELOCS to CONTENTS of INPUT_SECTION from INPUT_BFD. */ + +static bfd_boolean +spu_elf_relocate_section (bfd *output_bfd, + struct bfd_link_info *info, + bfd *input_bfd, + asection *input_section, + bfd_byte *contents, + Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, + asection **local_sections) +{ + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + Elf_Internal_Rela *rel, *relend; + struct spu_link_hash_table *htab; + bfd_boolean ret = TRUE; + bfd_boolean emit_these_relocs = FALSE; + + htab = spu_hash_table (info); + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + sym_hashes = (struct elf_link_hash_entry **) (elf_sym_hashes (input_bfd)); + + rel = relocs; + relend = relocs + input_section->reloc_count; + for (; rel < relend; rel++) + { + int r_type; + reloc_howto_type *howto; + unsigned long r_symndx; + Elf_Internal_Sym *sym; + asection *sec; + struct elf_link_hash_entry *h; + const char *sym_name; + bfd_vma relocation; + bfd_vma addend; + bfd_reloc_status_type r; + bfd_boolean unresolved_reloc; + bfd_boolean warned; + bfd_boolean branch; + + r_symndx = ELF32_R_SYM (rel->r_info); + r_type = ELF32_R_TYPE (rel->r_info); + if (r_type == R_SPU_PPU32 || r_type == R_SPU_PPU64) + { + emit_these_relocs = TRUE; + continue; + } + + howto = elf_howto_table + r_type; + unresolved_reloc = FALSE; + warned = FALSE; + h = NULL; + sym = NULL; + sec = NULL; + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + sec = local_sections[r_symndx]; + sym_name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym, sec); + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); + } + else + { + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, + unresolved_reloc, warned); + sym_name = h->root.root.string; + } + + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + + if (unresolved_reloc) + { + (*_bfd_error_handler) + (_("%B(%s+0x%lx): unresolvable %s relocation against symbol `%s'"), + input_bfd, + bfd_get_section_name (input_bfd, input_section), + (long) rel->r_offset, + howto->name, + sym_name); + ret = FALSE; + } + + /* If this symbol is in an overlay area, we may need to relocate + to the overlay stub. */ + addend = rel->r_addend; + branch = (is_branch (contents + rel->r_offset) + || is_hint (contents + rel->r_offset)); + if (needs_ovl_stub (sym_name, sec, input_section, htab, branch)) + { + char *stub_name; + struct spu_stub_hash_entry *sh; + + stub_name = spu_stub_name (sec, h, rel); + if (stub_name == NULL) + return FALSE; + + sh = (struct spu_stub_hash_entry *) + bfd_hash_lookup (&htab->stub_hash_table, stub_name, FALSE, FALSE); + if (sh != NULL) + { + relocation = (htab->stub->output_section->vma + + htab->stub->output_offset + + sh->off); + addend = 0; + } + free (stub_name); + } + + r = _bfd_final_link_relocate (howto, + input_bfd, + input_section, + contents, + rel->r_offset, relocation, addend); + + if (r != bfd_reloc_ok) + { + const char *msg = (const char *) 0; + + switch (r) + { + case bfd_reloc_overflow: + if (!((*info->callbacks->reloc_overflow) + (info, (h ? &h->root : NULL), sym_name, howto->name, + (bfd_vma) 0, input_bfd, input_section, rel->r_offset))) + return FALSE; + break; + + case bfd_reloc_undefined: + if (!((*info->callbacks->undefined_symbol) + (info, sym_name, input_bfd, input_section, + rel->r_offset, TRUE))) + return FALSE; + break; + + case bfd_reloc_outofrange: + msg = _("internal error: out of range error"); + goto common_error; + + case bfd_reloc_notsupported: + msg = _("internal error: unsupported relocation error"); + goto common_error; + + case bfd_reloc_dangerous: + msg = _("internal error: dangerous error"); + goto common_error; + + default: + msg = _("internal error: unknown error"); + /* fall through */ + + common_error: + if (!((*info->callbacks->warning) + (info, msg, sym_name, input_bfd, input_section, + rel->r_offset))) + return FALSE; + break; + } + } + } + + if (ret + && emit_these_relocs + && !info->relocatable + && !info->emitrelocations) + { + Elf_Internal_Rela *wrel; + Elf_Internal_Shdr *rel_hdr; + + wrel = rel = relocs; + relend = relocs + input_section->reloc_count; + for (; rel < relend; rel++) + { + int r_type; + + r_type = ELF32_R_TYPE (rel->r_info); + if (r_type == R_SPU_PPU32 || r_type == R_SPU_PPU64) + *wrel++ = *rel; + } + input_section->reloc_count = wrel - relocs; + /* Backflips for _bfd_elf_link_output_relocs. */ + rel_hdr = &elf_section_data (input_section)->rel_hdr; + rel_hdr->sh_size = input_section->reloc_count * rel_hdr->sh_entsize; + ret = 2; + } + + return ret; +} + +/* Adjust _SPUEAR_ syms to point at their overlay stubs. */ + +static bfd_boolean +spu_elf_output_symbol_hook (struct bfd_link_info *info, + const char *sym_name ATTRIBUTE_UNUSED, + Elf_Internal_Sym *sym, + asection *sym_sec ATTRIBUTE_UNUSED, + struct elf_link_hash_entry *h) +{ + struct spu_link_hash_table *htab = spu_hash_table (info); + + if (!info->relocatable + && htab->num_overlays != 0 + && h != NULL + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && h->def_regular + && strncmp (h->root.root.string, "_SPUEAR_", 8) == 0) + { + static Elf_Internal_Rela zero_rel; + char *stub_name = spu_stub_name (h->root.u.def.section, h, &zero_rel); + struct spu_stub_hash_entry *sh; + + if (stub_name == NULL) + return FALSE; + sh = (struct spu_stub_hash_entry *) + bfd_hash_lookup (&htab->stub_hash_table, stub_name, FALSE, FALSE); + free (stub_name); + if (sh == NULL) + return TRUE; + sym->st_shndx + = _bfd_elf_section_from_bfd_section (htab->stub->output_section->owner, + htab->stub->output_section); + sym->st_value = (htab->stub->output_section->vma + + htab->stub->output_offset + + sh->off); + } + + return TRUE; +} + +static int spu_plugin = 0; + +void +spu_elf_plugin (int val) +{ + spu_plugin = val; +} + +/* Set ELF header e_type for plugins. */ + +static void +spu_elf_post_process_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) +{ + if (spu_plugin) + { + Elf_Internal_Ehdr *i_ehdrp = elf_elfheader (abfd); + + i_ehdrp->e_type = ET_DYN; + } +} + +/* We may add an extra PT_LOAD segment for .toe. We also need extra + segments for overlays. */ + +static int +spu_elf_additional_program_headers (bfd *abfd, struct bfd_link_info *info) +{ + struct spu_link_hash_table *htab = spu_hash_table (info); + int extra = htab->num_overlays; + asection *sec; + + if (extra) + ++extra; + + sec = bfd_get_section_by_name (abfd, ".toe"); + if (sec != NULL && (sec->flags & SEC_LOAD) != 0) + ++extra; + + return extra; +} + +/* Remove .toe section from other PT_LOAD segments and put it in + a segment of its own. Put overlays in separate segments too. */ + +static bfd_boolean +spu_elf_modify_segment_map (bfd *abfd, struct bfd_link_info *info) +{ + asection *toe, *s; + struct elf_segment_map *m; + unsigned int i; + + if (info == NULL) + return TRUE; + + toe = bfd_get_section_by_name (abfd, ".toe"); + for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + if (m->p_type == PT_LOAD && m->count > 1) + for (i = 0; i < m->count; i++) + if ((s = m->sections[i]) == toe + || spu_elf_section_data (s)->ovl_index != 0) + { + struct elf_segment_map *m2; + bfd_vma amt; + + if (i + 1 < m->count) + { + amt = sizeof (struct elf_segment_map); + amt += (m->count - (i + 2)) * sizeof (m->sections[0]); + m2 = bfd_zalloc (abfd, amt); + if (m2 == NULL) + return FALSE; + m2->count = m->count - (i + 1); + memcpy (m2->sections, m->sections + i + 1, + m2->count * sizeof (m->sections[0])); + m2->p_type = PT_LOAD; + m2->next = m->next; + m->next = m2; + } + m->count = 1; + if (i != 0) + { + m->count = i; + amt = sizeof (struct elf_segment_map); + m2 = bfd_zalloc (abfd, amt); + if (m2 == NULL) + return FALSE; + m2->p_type = PT_LOAD; + m2->count = 1; + m2->sections[0] = s; + m2->next = m->next; + m->next = m2; + } + break; + } + + return TRUE; +} + +/* Check that all loadable section VMAs lie in the range + LO .. HI inclusive. */ + +asection * +spu_elf_check_vma (bfd *abfd, bfd_vma lo, bfd_vma hi) +{ + struct elf_segment_map *m; + unsigned int i; + + for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + if (m->p_type == PT_LOAD) + for (i = 0; i < m->count; i++) + if (m->sections[i]->size != 0 + && (m->sections[i]->vma < lo + || m->sections[i]->vma > hi + || m->sections[i]->vma + m->sections[i]->size - 1 > hi)) + return m->sections[i]; + + return NULL; +} + +/* Tweak the section type of .note.spu_name. */ + +static bfd_boolean +spu_elf_fake_sections (bfd *obfd ATTRIBUTE_UNUSED, + Elf_Internal_Shdr *hdr, + asection *sec) +{ + if (strcmp (sec->name, SPU_PTNOTE_SPUNAME) == 0) + hdr->sh_type = SHT_NOTE; + return TRUE; +} + +/* Tweak phdrs before writing them out. */ + +static int +spu_elf_modify_program_headers (bfd *abfd, struct bfd_link_info *info) +{ + const struct elf_backend_data *bed; + struct elf_obj_tdata *tdata; + Elf_Internal_Phdr *phdr, *last; + struct spu_link_hash_table *htab; + unsigned int count; + unsigned int i; + + if (info == NULL) + return TRUE; + + bed = get_elf_backend_data (abfd); + tdata = elf_tdata (abfd); + phdr = tdata->phdr; + count = tdata->program_header_size / bed->s->sizeof_phdr; + htab = spu_hash_table (info); + if (htab->num_overlays != 0) + { + struct elf_segment_map *m; + unsigned int o; + + for (i = 0, m = elf_tdata (abfd)->segment_map; m; ++i, m = m->next) + if (m->count != 0 + && (o = spu_elf_section_data (m->sections[0])->ovl_index) != 0) + { + /* Mark this as an overlay header. */ + phdr[i].p_flags |= PF_OVERLAY; + + if (htab->ovtab != NULL && htab->ovtab->size != 0) + { + bfd_byte *p = htab->ovtab->contents; + unsigned int off = (o - 1) * 16 + 8; + + /* Write file_off into _ovly_table. */ + bfd_put_32 (htab->ovtab->owner, phdr[i].p_offset, p + off); + } + } + } + + /* Round up p_filesz and p_memsz of PT_LOAD segments to multiples + of 16. This should always be possible when using the standard + linker scripts, but don't create overlapping segments if + someone is playing games with linker scripts. */ + last = NULL; + for (i = count; i-- != 0; ) + if (phdr[i].p_type == PT_LOAD) + { + unsigned adjust; + + adjust = -phdr[i].p_filesz & 15; + if (adjust != 0 + && last != NULL + && phdr[i].p_offset + phdr[i].p_filesz > last->p_offset - adjust) + break; + + adjust = -phdr[i].p_memsz & 15; + if (adjust != 0 + && last != NULL + && phdr[i].p_filesz != 0 + && phdr[i].p_vaddr + phdr[i].p_memsz > last->p_vaddr - adjust + && phdr[i].p_vaddr + phdr[i].p_memsz <= last->p_vaddr) + break; + + if (phdr[i].p_filesz != 0) + last = &phdr[i]; + } + + if (i == (unsigned int) -1) + for (i = count; i-- != 0; ) + if (phdr[i].p_type == PT_LOAD) + { + unsigned adjust; + + adjust = -phdr[i].p_filesz & 15; + phdr[i].p_filesz += adjust; + + adjust = -phdr[i].p_memsz & 15; + phdr[i].p_memsz += adjust; + } + + return TRUE; +} + +#define TARGET_BIG_SYM bfd_elf32_spu_vec +#define TARGET_BIG_NAME "elf32-spu" +#define ELF_ARCH bfd_arch_spu +#define ELF_MACHINE_CODE EM_SPU +/* This matches the alignment need for DMA. */ +#define ELF_MAXPAGESIZE 0x80 +#define elf_backend_rela_normal 1 +#define elf_backend_can_gc_sections 1 + +#define bfd_elf32_bfd_reloc_type_lookup spu_elf_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup spu_elf_reloc_name_lookup +#define elf_info_to_howto spu_elf_info_to_howto +#define elf_backend_count_relocs spu_elf_count_relocs +#define elf_backend_relocate_section spu_elf_relocate_section +#define elf_backend_symbol_processing spu_elf_backend_symbol_processing +#define elf_backend_link_output_symbol_hook spu_elf_output_symbol_hook +#define bfd_elf32_new_section_hook spu_elf_new_section_hook +#define bfd_elf32_bfd_link_hash_table_create spu_elf_link_hash_table_create +#define bfd_elf32_bfd_link_hash_table_free spu_elf_link_hash_table_free + +#define elf_backend_additional_program_headers spu_elf_additional_program_headers +#define elf_backend_modify_segment_map spu_elf_modify_segment_map +#define elf_backend_modify_program_headers spu_elf_modify_program_headers +#define elf_backend_post_process_headers spu_elf_post_process_headers +#define elf_backend_fake_sections spu_elf_fake_sections +#define elf_backend_special_sections spu_elf_special_sections +#define bfd_elf32_bfd_final_link spu_elf_final_link + +#include "elf32-target.h" diff --git a/bfd/elf32-spu.h b/bfd/elf32-spu.h new file mode 100644 index 00000000000..b74c3102b8b --- /dev/null +++ b/bfd/elf32-spu.h @@ -0,0 +1,57 @@ +/* SPU specific support for 32-bit ELF. + + Copyright 2006, 2007 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Extra info kept for SPU sections. */ + +struct spu_elf_stack_info; + +struct _spu_elf_section_data +{ + struct bfd_elf_section_data elf; + + /* Stack analysis info kept for this section. */ + + struct spu_elf_stack_info *stack_info; + + /* Non-zero for overlay output sections. */ + unsigned int ovl_index; +}; + +#define spu_elf_section_data(sec) \ + ((struct _spu_elf_section_data *) elf_section_data (sec)) + +struct _ovl_stream +{ + const void *start; + const void *end; +}; + +extern void spu_elf_plugin (int); +extern bfd_boolean spu_elf_open_builtin_lib (bfd **, + const struct _ovl_stream *); +extern bfd_boolean spu_elf_create_sections (bfd *, + struct bfd_link_info *, int, int); +extern bfd_boolean spu_elf_find_overlays (bfd *, struct bfd_link_info *); +extern bfd_boolean spu_elf_size_stubs (bfd *, struct bfd_link_info *, int, int, + asection **, asection **, + asection **); +extern bfd_boolean spu_elf_build_stubs (struct bfd_link_info *, int, + asection *); +extern asection *spu_elf_check_vma (bfd *, bfd_vma, bfd_vma); diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c index e2c29ee1922..e5f283a9d0c 100644 --- a/bfd/elf32-v850.c +++ b/bfd/elf32-v850.c @@ -1,6 +1,6 @@ /* V850-specific support for 32-bit ELF - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -22,8 +22,8 @@ /* XXX FIXME: This code is littered with 32bit int, 16bit short, 8bit char dependencies. As is the gas & simulator code for the v850. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -33,6 +33,8 @@ /* Sign-extend a 24-bit number. */ #define SEXT24(x) ((((x) & 0xffffff) ^ 0x800000) - 0x800000) +static reloc_howto_type v850_elf_howto_table[]; + /* Look through the relocs for a section during the first phase, and allocate space in the global offset table or procedure linkage table. */ @@ -1337,6 +1339,22 @@ v850_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } + +static reloc_howto_type * +v850_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (v850_elf_howto_table) / sizeof (v850_elf_howto_table[0]); + i++) + if (v850_elf_howto_table[i].name != NULL + && strcasecmp (v850_elf_howto_table[i].name, r_name) == 0) + return &v850_elf_howto_table[i]; + + return NULL; +} /* Set the howto pointer for an V850 ELF reloc. */ @@ -1565,9 +1583,6 @@ v850_elf_relocate_section (bfd *output_bfd, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocatable) - return TRUE; - symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -1596,7 +1611,6 @@ v850_elf_relocate_section (bfd *output_bfd, || r_type == R_V850_GNU_VTINHERIT) continue; - /* This is a final link. */ howto = v850_elf_howto_table + r_type; h = NULL; sym = NULL; @@ -1629,6 +1643,20 @@ v850_elf_relocate_section (bfd *output_bfd, unresolved_reloc, warned); } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + /* FIXME: We should use the addend, but the COFF relocations don't. */ r = v850_elf_final_link_relocate (howto, input_bfd, output_bfd, input_section, @@ -1709,50 +1737,22 @@ v850_elf_relocate_section (bfd *output_bfd, return TRUE; } -static bfd_boolean -v850_elf_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED, - struct bfd_link_info *info ATTRIBUTE_UNUSED, - asection *sec ATTRIBUTE_UNUSED, - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED) -{ - /* No got and plt entries for v850-elf. */ - return TRUE; -} - static asection * v850_elf_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, + struct bfd_link_info *info, Elf_Internal_Rela *rel, struct elf_link_hash_entry *h, Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) + switch (ELF32_R_TYPE (rel->r_info)) { case R_V850_GNU_VTINHERIT: case R_V850_GNU_VTENTRY: - break; + return NULL; + } - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Set the right machine number. */ @@ -2115,6 +2115,12 @@ v850_elf_link_output_symbol_hook (struct bfd_link_info *info ATTRIBUTE_UNUSED, sym->st_shndx = SHN_V850_ZCOMMON; } + /* The price we pay for using h->other unused bits as flags in the + linker is cleaning up after ourselves. */ + + sym->st_other &= ~(V850_OTHER_SDA | V850_OTHER_ZDA | V850_OTHER_TDA + | V850_OTHER_ERROR); + return TRUE; } @@ -3026,33 +3032,32 @@ v850_elf_relax_section (bfd *abfd, static const struct bfd_elf_special_section v850_elf_special_sections[] = { - { ".call_table_data", 16, 0, SHT_PROGBITS, (SHF_ALLOC - + SHF_WRITE) }, - { ".call_table_text", 16, 0, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE - + SHF_EXECINSTR) }, - { ".rosdata", 8, -2, SHT_PROGBITS, (SHF_ALLOC - + SHF_V850_GPREL) }, - { ".rozdata", 8, -2, SHT_PROGBITS, (SHF_ALLOC - + SHF_V850_R0REL) }, - { ".sbss", 5, -2, SHT_NOBITS, (SHF_ALLOC + SHF_WRITE - + SHF_V850_GPREL) }, - { ".scommon", 8, -2, SHT_V850_SCOMMON, (SHF_ALLOC + SHF_WRITE - + SHF_V850_GPREL) }, - { ".sdata", 6, -2, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE - + SHF_V850_GPREL) }, - { ".tbss", 5, -2, SHT_NOBITS, (SHF_ALLOC + SHF_WRITE - + SHF_V850_EPREL) }, - { ".tcommon", 8, -2, SHT_V850_TCOMMON, (SHF_ALLOC + SHF_WRITE - + SHF_V850_R0REL) }, - { ".tdata", 6, -2, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE - + SHF_V850_EPREL) }, - { ".zbss", 5, -2, SHT_NOBITS, (SHF_ALLOC + SHF_WRITE - + SHF_V850_R0REL) }, - { ".zcommon", 8, -2, SHT_V850_ZCOMMON, (SHF_ALLOC + SHF_WRITE - + SHF_V850_R0REL) }, - { ".zdata", 6, -2, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE - + SHF_V850_R0REL) }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".call_table_data"), 0, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE) }, + { STRING_COMMA_LEN (".call_table_text"), 0, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE + + SHF_EXECINSTR) }, + { STRING_COMMA_LEN (".rosdata"), -2, SHT_PROGBITS, (SHF_ALLOC + + SHF_V850_GPREL) }, + { STRING_COMMA_LEN (".rozdata"), -2, SHT_PROGBITS, (SHF_ALLOC + + SHF_V850_R0REL) }, + { STRING_COMMA_LEN (".sbss"), -2, SHT_NOBITS, (SHF_ALLOC + SHF_WRITE + + SHF_V850_GPREL) }, + { STRING_COMMA_LEN (".scommon"), -2, SHT_V850_SCOMMON, (SHF_ALLOC + SHF_WRITE + + SHF_V850_GPREL) }, + { STRING_COMMA_LEN (".sdata"), -2, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE + + SHF_V850_GPREL) }, + { STRING_COMMA_LEN (".tbss"), -2, SHT_NOBITS, (SHF_ALLOC + SHF_WRITE + + SHF_V850_EPREL) }, + { STRING_COMMA_LEN (".tcommon"), -2, SHT_V850_TCOMMON, (SHF_ALLOC + SHF_WRITE + + SHF_V850_R0REL) }, + { STRING_COMMA_LEN (".tdata"), -2, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE + + SHF_V850_EPREL) }, + { STRING_COMMA_LEN (".zbss"), -2, SHT_NOBITS, (SHF_ALLOC + SHF_WRITE + + SHF_V850_R0REL) }, + { STRING_COMMA_LEN (".zcommon"), -2, SHT_V850_ZCOMMON, (SHF_ALLOC + SHF_WRITE + + SHF_V850_R0REL) }, + { STRING_COMMA_LEN (".zdata"), -2, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE + + SHF_V850_R0REL) }, + { NULL, 0, 0, 0, 0 } }; #define TARGET_LITTLE_SYM bfd_elf32_v850_vec @@ -3077,7 +3082,6 @@ static const struct bfd_elf_special_section v850_elf_special_sections[] = #define elf_backend_section_from_shdr v850_elf_section_from_shdr #define elf_backend_fake_sections v850_elf_fake_sections #define elf_backend_gc_mark_hook v850_elf_gc_mark_hook -#define elf_backend_gc_sweep_hook v850_elf_gc_sweep_hook #define elf_backend_special_sections v850_elf_special_sections #define elf_backend_can_gc_sections 1 @@ -3085,6 +3089,7 @@ static const struct bfd_elf_special_section v850_elf_special_sections[] = #define bfd_elf32_bfd_is_local_label_name v850_elf_is_local_label_name #define bfd_elf32_bfd_reloc_type_lookup v850_elf_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup v850_elf_reloc_name_lookup #define bfd_elf32_bfd_merge_private_bfd_data v850_elf_merge_private_bfd_data #define bfd_elf32_bfd_set_private_flags v850_elf_set_private_flags #define bfd_elf32_bfd_print_private_bfd_data v850_elf_print_private_bfd_data diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c index bf481e459e7..aac81c11e5d 100644 --- a/bfd/elf32-vax.c +++ b/bfd/elf32-vax.c @@ -1,6 +1,6 @@ /* VAX series support for 32-bit ELF Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Matt Thomas . This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -34,13 +34,6 @@ static struct bfd_hash_entry *elf_vax_link_hash_newfunc (struct bfd_hash_entry * static struct bfd_link_hash_table *elf_vax_link_hash_table_create (bfd *); static bfd_boolean elf_vax_check_relocs (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *); -static asection *elf_vax_gc_mark_hook (asection *, struct bfd_link_info *, - Elf_Internal_Rela *, - struct elf_link_hash_entry *, - Elf_Internal_Sym *); -static bfd_boolean elf_vax_gc_sweep_hook (bfd *, struct bfd_link_info *, - asection *, - const Elf_Internal_Rela *); static bfd_boolean elf_vax_adjust_dynamic_symbol (struct bfd_link_info *, struct elf_link_hash_entry *); static bfd_boolean elf_vax_size_dynamic_sections (bfd *, struct bfd_link_info *); @@ -329,7 +322,22 @@ reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real_type code) return 0; } +static reloc_howto_type * +reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; i < sizeof (howto_table) / sizeof (howto_table[0]); i++) + if (howto_table[i].name != NULL + && strcasecmp (howto_table[i].name, r_name) == 0) + return &howto_table[i]; + + return NULL; +} + #define bfd_elf32_bfd_reloc_type_lookup reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup reloc_name_lookup #define ELF_ARCH bfd_arch_vax /* end code generated by elf.el */ @@ -738,7 +746,7 @@ elf_vax_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (abfd, sec), name + 5) == 0); @@ -829,38 +837,20 @@ elf_vax_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, static asection * elf_vax_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, + struct bfd_link_info *info, Elf_Internal_Rela *rel, struct elf_link_hash_entry *h, Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_VAX_GNU_VTINHERIT: - case R_VAX_GNU_VTENTRY: - break; + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_VAX_GNU_VTINHERIT: + case R_VAX_GNU_VTENTRY: + return NULL; + } - default: - switch (h->root.type) - { - default: - break; - - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Update the got entry reference counts for the section being removed. */ @@ -935,7 +925,6 @@ elf_vax_adjust_dynamic_symbol (info, h) { bfd *dynobj; asection *s; - unsigned int power_of_two; dynobj = elf_hash_table (info)->dynobj; @@ -1089,28 +1078,7 @@ elf_vax_adjust_dynamic_symbol (info, h) h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 3) - power_of_two = 3; - - /* Apply the required alignment. */ - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (dynobj, s)) - { - if (!bfd_set_section_alignment (dynobj, s, power_of_two)) - return FALSE; - } - - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Set the sizes of the dynamic sections. */ @@ -1194,7 +1162,7 @@ elf_vax_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) /* Remember whether there is a PLT. */ plt = s->size != 0; } - else if (strncmp (name, ".rela", 5) == 0) + else if (CONST_STRNEQ (name, ".rela")) { if (s->size != 0) { @@ -1226,7 +1194,7 @@ elf_vax_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) s->reloc_count = 0; } } - else if (strncmp (name, ".got", 4) != 0 + else if (! CONST_STRNEQ (name, ".got") && strcmp (name, ".dynbss") != 0) { /* It's not one of our sections, so don't allocate space. */ @@ -1402,9 +1370,6 @@ elf_vax_relocate_section (bfd *output_bfd, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocatable) - return TRUE; - dynobj = elf_hash_table (info)->dynobj; symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -1436,7 +1401,6 @@ elf_vax_relocate_section (bfd *output_bfd, } howto = howto_table + r_type; - /* This is a final link. */ r_symndx = ELF32_R_SYM (rel->r_info); h = NULL; sym = NULL; @@ -1492,6 +1456,20 @@ elf_vax_relocate_section (bfd *output_bfd, relocation = 0; } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + switch (r_type) { case R_VAX_GOT32: @@ -1625,8 +1603,9 @@ elf_vax_relocate_section (bfd *output_bfd, && ((r_type != R_VAX_PC8 && r_type != R_VAX_PC16 && r_type != R_VAX_PC32) - || (!info->symbolic - || !h->def_regular))) + || ((input_section->flags & SEC_CODE) + && (!info->symbolic + || (!h->def_regular && h->type != STT_SECTION))))) { Elf_Internal_Rela outrel; bfd_byte *loc; @@ -1646,7 +1625,7 @@ elf_vax_relocate_section (bfd *output_bfd, if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (input_bfd, input_section), name + 5) == 0); @@ -1705,9 +1684,21 @@ elf_vax_relocate_section (bfd *output_bfd, { asection *osec; + /* We are turning this relocation into one + against a section symbol. It would be + proper to subtract the symbol's value, + osec->vma, from the emitted reloc addend, + but ld.so expects buggy relocs. */ osec = sec->output_section; indx = elf_section_data (osec)->dynindx; - BFD_ASSERT (indx > 0); + if (indx == 0) + { + struct elf_link_hash_table *htab; + htab = elf_hash_table (info); + osec = htab->text_index_section; + indx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (indx != 0); } outrel.r_info = ELF32_R_INFO (indx, r_type); @@ -2087,6 +2078,7 @@ elf_vax_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) elf_vax_adjust_dynamic_symbol #define elf_backend_size_dynamic_sections \ elf_vax_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_relocate_section elf_vax_relocate_section #define elf_backend_finish_dynamic_symbol \ elf_vax_finish_dynamic_symbol diff --git a/bfd/elf32-xc16x.c b/bfd/elf32-xc16x.c index 1824302e885..21d20a19a57 100644 --- a/bfd/elf32-xc16x.c +++ b/bfd/elf32-xc16x.c @@ -1,5 +1,5 @@ /* Infineon XC16X-specific support for 16-bit ELF. - Copyright 2006 Free Software Foundation, Inc. + Copyright 2006, 2007 Free Software Foundation, Inc. Contributed by KPIT Cummins Infosystems This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/xc16x.h" @@ -205,6 +205,22 @@ xc16x_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +xc16x_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (xc16x_elf_howto_table) / sizeof (xc16x_elf_howto_table[0]); + i++) + if (xc16x_elf_howto_table[i].name != NULL + && strcasecmp (xc16x_elf_howto_table[i].name, r_name) == 0) + return &xc16x_elf_howto_table[i]; + + return NULL; +} + /* For a particular operand this function is called to finalise the type of relocation. */ @@ -328,9 +344,6 @@ elf32_xc16x_relocate_section (bfd *output_bfd, struct elf_link_hash_entry **sym_hashes; Elf_Internal_Rela *rel, *relend; - if (info->relocatable) - return TRUE; - symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -368,11 +381,27 @@ elf32_xc16x_relocate_section (bfd *output_bfd, unresolved_reloc, warned); } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + reloc_howto_type *howto; + howto = xc16x_reloc_type_lookup (input_bfd, r_type); + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + r = elf32_xc16x_final_link_relocate (r_type, input_bfd, output_bfd, - input_section, - contents, rel->r_offset, - relocation, rel->r_addend, - info, sec, h == NULL); + input_section, + contents, rel->r_offset, + relocation, rel->r_addend, + info, sec, h == NULL); } return TRUE; @@ -441,6 +470,7 @@ elf32_xc16x_object_p (bfd *abfd) #define elf_backend_object_p elf32_xc16x_object_p #define elf_backend_can_gc_sections 1 #define bfd_elf32_bfd_reloc_type_lookup xc16x_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup xc16x_reloc_name_lookup #define elf_info_to_howto elf32_xc16x_info_to_howto #define elf_info_to_howto_rel elf32_xc16x_info_to_howto #define elf_backend_relocate_section elf32_xc16x_relocate_section diff --git a/bfd/elf32-xstormy16.c b/bfd/elf32-xstormy16.c index 1341a4405ec..0ef9afd26ce 100644 --- a/bfd/elf32-xstormy16.c +++ b/bfd/elf32-xstormy16.c @@ -1,5 +1,6 @@ /* Xstormy16-specific support for 32-bit ELF. - Copyright 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +19,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/xstormy16.h" @@ -348,6 +349,31 @@ xstormy16_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +xstormy16_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (xstormy16_elf_howto_table) + / sizeof (xstormy16_elf_howto_table[0])); + i++) + if (xstormy16_elf_howto_table[i].name != NULL + && strcasecmp (xstormy16_elf_howto_table[i].name, r_name) == 0) + return &xstormy16_elf_howto_table[i]; + + for (i = 0; + i < (sizeof (xstormy16_elf_howto_table2) + / sizeof (xstormy16_elf_howto_table2[0])); + i++) + if (xstormy16_elf_howto_table2[i].name != NULL + && strcasecmp (xstormy16_elf_howto_table2[i].name, r_name) == 0) + return &xstormy16_elf_howto_table2[i]; + + return NULL; +} + /* Set the howto pointer for an XSTORMY16 ELF reloc. */ static void @@ -754,9 +780,6 @@ xstormy16_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNU bfd *dynobj; asection *splt; - if (info->relocatable) - return TRUE; - symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); relend = relocs + input_section->reloc_count; @@ -806,6 +829,20 @@ xstormy16_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNU unresolved_reloc, warned); } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + if (h != NULL) name = h->root.root.string; else @@ -967,50 +1004,21 @@ xstormy16_elf_finish_dynamic_sections (bfd *abfd ATTRIBUTE_UNUSED, relocation. */ static asection * -xstormy16_elf_gc_mark_hook (asection * sec, - struct bfd_link_info * info ATTRIBUTE_UNUSED, - Elf_Internal_Rela * rel, - struct elf_link_hash_entry * h, - Elf_Internal_Sym * sym) +xstormy16_elf_gc_mark_hook (asection *sec, + struct bfd_link_info *info, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_XSTORMY16_GNU_VTINHERIT: - case R_XSTORMY16_GNU_VTENTRY: - break; + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_XSTORMY16_GNU_VTINHERIT: + case R_XSTORMY16_GNU_VTENTRY: + return NULL; + } - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; -} - -/* Update the got entry reference counts for the section being removed. */ - -static bfd_boolean -xstormy16_elf_gc_sweep_hook (bfd * abfd ATTRIBUTE_UNUSED, - struct bfd_link_info * info ATTRIBUTE_UNUSED, - asection * sec ATTRIBUTE_UNUSED, - const Elf_Internal_Rela * relocs ATTRIBUTE_UNUSED) -{ - return TRUE; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } #define ELF_ARCH bfd_arch_xstormy16 @@ -1024,10 +1032,11 @@ xstormy16_elf_gc_sweep_hook (bfd * abfd ATTRIBUTE_UNUSED, #define elf_info_to_howto xstormy16_info_to_howto_rela #define elf_backend_relocate_section xstormy16_elf_relocate_section #define elf_backend_gc_mark_hook xstormy16_elf_gc_mark_hook -#define elf_backend_gc_sweep_hook xstormy16_elf_gc_sweep_hook #define elf_backend_check_relocs xstormy16_elf_check_relocs #define elf_backend_always_size_sections \ xstormy16_elf_always_size_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_finish_dynamic_sections \ xstormy16_elf_finish_dynamic_sections @@ -1035,6 +1044,8 @@ xstormy16_elf_gc_sweep_hook (bfd * abfd ATTRIBUTE_UNUSED, #define elf_backend_rela_normal 1 #define bfd_elf32_bfd_reloc_type_lookup xstormy16_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup \ + xstormy16_reloc_name_lookup #define bfd_elf32_bfd_relax_section xstormy16_elf_relax_section #include "elf32-target.h" diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c index 7a41d628577..a8ec37e5298 100644 --- a/bfd/elf32-xtensa.c +++ b/bfd/elf32-xtensa.c @@ -1,5 +1,5 @@ /* Xtensa-specific support for 32-bit ELF. - Copyright 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include #include @@ -35,7 +35,7 @@ /* Local helper functions. */ -static bfd_boolean add_extra_plt_sections (bfd *, int); +static bfd_boolean add_extra_plt_sections (struct bfd_link_info *, int); static char *vsprint_msg (const char *, const char *, int, ...) ATTRIBUTE_PRINTF(2,4); static bfd_reloc_status_type bfd_elf_xtensa_reloc (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); @@ -94,8 +94,8 @@ static Elf_Internal_Sym *retrieve_local_syms (bfd *); /* Miscellaneous utility functions. */ -static asection *elf_xtensa_get_plt_section (bfd *, int); -static asection *elf_xtensa_get_gotplt_section (bfd *, int); +static asection *elf_xtensa_get_plt_section (struct bfd_link_info *, int); +static asection *elf_xtensa_get_gotplt_section (struct bfd_link_info *, int); static asection *get_elf_r_symndx_section (bfd *, unsigned long); static struct elf_link_hash_entry *get_elf_r_symndx_hash_entry (bfd *, unsigned long); @@ -103,10 +103,12 @@ static bfd_vma get_elf_r_symndx_offset (bfd *, unsigned long); static bfd_boolean is_reloc_sym_weak (bfd *, Elf_Internal_Rela *); static bfd_boolean pcrel_reloc_fits (xtensa_opcode, int, bfd_vma, bfd_vma); static bfd_boolean xtensa_is_property_section (asection *); +static bfd_boolean xtensa_is_insntable_section (asection *); static bfd_boolean xtensa_is_littable_section (asection *); +static bfd_boolean xtensa_is_proptable_section (asection *); static int internal_reloc_compare (const void *, const void *); static int internal_reloc_matches (const void *, const void *); -extern char *xtensa_get_property_section_name (asection *, const char *); +extern asection *xtensa_get_property_section (asection *, const char *); static flagword xtensa_get_property_predef_flags (asection *); /* Other functions called directly by the linker. */ @@ -132,16 +134,6 @@ int elf32xtensa_size_opt; typedef struct xtensa_relax_info_struct xtensa_relax_info; -/* Total count of PLT relocations seen during check_relocs. - The actual PLT code must be split into multiple sections and all - the sections have to be created before size_dynamic_sections, - where we figure out the exact number of PLT entries that will be - needed. It is OK if this count is an overestimate, e.g., some - relocations may be removed by GC. */ - -static int plt_reloc_count = 0; - - /* The GNU tools do not easily allow extending interfaces to pass around the pointer to the Xtensa ISA information, so instead we add a global variable here (in BFD) that can be used by any of the tools that need @@ -166,163 +158,132 @@ static reloc_howto_type elf_howto_table[] = { HOWTO (R_XTENSA_NONE, 0, 0, 0, FALSE, 0, complain_overflow_dont, bfd_elf_xtensa_reloc, "R_XTENSA_NONE", - FALSE, 0x00000000, 0x00000000, FALSE), + FALSE, 0, 0, FALSE), HOWTO (R_XTENSA_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_xtensa_reloc, "R_XTENSA_32", TRUE, 0xffffffff, 0xffffffff, FALSE), + /* Replace a 32-bit value with a value from the runtime linker (only used by linker-generated stub functions). The r_addend value is special: 1 means to substitute a pointer to the runtime linker's dynamic resolver function; 2 means to substitute the link map for the shared object. */ HOWTO (R_XTENSA_RTLD, 0, 2, 32, FALSE, 0, complain_overflow_dont, - NULL, "R_XTENSA_RTLD", - FALSE, 0x00000000, 0x00000000, FALSE), + NULL, "R_XTENSA_RTLD", FALSE, 0, 0, FALSE), + HOWTO (R_XTENSA_GLOB_DAT, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_XTENSA_GLOB_DAT", - FALSE, 0xffffffff, 0xffffffff, FALSE), + FALSE, 0, 0xffffffff, FALSE), HOWTO (R_XTENSA_JMP_SLOT, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_XTENSA_JMP_SLOT", - FALSE, 0xffffffff, 0xffffffff, FALSE), + FALSE, 0, 0xffffffff, FALSE), HOWTO (R_XTENSA_RELATIVE, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_XTENSA_RELATIVE", - FALSE, 0xffffffff, 0xffffffff, FALSE), + FALSE, 0, 0xffffffff, FALSE), HOWTO (R_XTENSA_PLT, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_xtensa_reloc, "R_XTENSA_PLT", - FALSE, 0xffffffff, 0xffffffff, FALSE), + FALSE, 0, 0xffffffff, FALSE), + EMPTY_HOWTO (7), + + /* Old relocations for backward compatibility. */ HOWTO (R_XTENSA_OP0, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_OP0", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_OP0", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_OP1, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_OP1", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_OP1", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_OP2, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_OP2", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_OP2", FALSE, 0, 0, TRUE), + /* Assembly auto-expansion. */ HOWTO (R_XTENSA_ASM_EXPAND, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_ASM_EXPAND", - FALSE, 0x00000000, 0x00000000, FALSE), + bfd_elf_xtensa_reloc, "R_XTENSA_ASM_EXPAND", FALSE, 0, 0, TRUE), /* Relax assembly auto-expansion. */ HOWTO (R_XTENSA_ASM_SIMPLIFY, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_ASM_SIMPLIFY", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_ASM_SIMPLIFY", FALSE, 0, 0, TRUE), + EMPTY_HOWTO (13), EMPTY_HOWTO (14), + /* GNU extension to record C++ vtable hierarchy. */ HOWTO (R_XTENSA_GNU_VTINHERIT, 0, 2, 0, FALSE, 0, complain_overflow_dont, NULL, "R_XTENSA_GNU_VTINHERIT", - FALSE, 0x00000000, 0x00000000, FALSE), + FALSE, 0, 0, FALSE), /* GNU extension to record C++ vtable member usage. */ HOWTO (R_XTENSA_GNU_VTENTRY, 0, 2, 0, FALSE, 0, complain_overflow_dont, _bfd_elf_rel_vtable_reloc_fn, "R_XTENSA_GNU_VTENTRY", - FALSE, 0x00000000, 0x00000000, FALSE), + FALSE, 0, 0, FALSE), /* Relocations for supporting difference of symbols. */ HOWTO (R_XTENSA_DIFF8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, - bfd_elf_xtensa_reloc, "R_XTENSA_DIFF8", - FALSE, 0xffffffff, 0xffffffff, FALSE), + bfd_elf_xtensa_reloc, "R_XTENSA_DIFF8", FALSE, 0, 0xff, FALSE), HOWTO (R_XTENSA_DIFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, - bfd_elf_xtensa_reloc, "R_XTENSA_DIFF16", - FALSE, 0xffffffff, 0xffffffff, FALSE), + bfd_elf_xtensa_reloc, "R_XTENSA_DIFF16", FALSE, 0, 0xffff, FALSE), HOWTO (R_XTENSA_DIFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, - bfd_elf_xtensa_reloc, "R_XTENSA_DIFF32", - FALSE, 0xffffffff, 0xffffffff, FALSE), + bfd_elf_xtensa_reloc, "R_XTENSA_DIFF32", FALSE, 0, 0xffffffff, FALSE), /* General immediate operand relocations. */ HOWTO (R_XTENSA_SLOT0_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT0_OP", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT0_OP", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT1_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT1_OP", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT1_OP", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT2_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT2_OP", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT2_OP", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT3_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT3_OP", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT3_OP", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT4_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT4_OP", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT4_OP", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT5_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT5_OP", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT5_OP", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT6_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT6_OP", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT6_OP", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT7_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT7_OP", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT7_OP", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT8_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT8_OP", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT8_OP", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT9_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT9_OP", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT9_OP", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT10_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT10_OP", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT10_OP", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT11_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT11_OP", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT11_OP", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT12_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT12_OP", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT12_OP", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT13_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT13_OP", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT13_OP", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT14_OP, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT14_OP", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT14_OP", FALSE, 0, 0, TRUE), /* "Alternate" relocations. The meaning of these is opcode-specific. */ HOWTO (R_XTENSA_SLOT0_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT0_ALT", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT0_ALT", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT1_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT1_ALT", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT1_ALT", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT2_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT2_ALT", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT2_ALT", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT3_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT3_ALT", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT3_ALT", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT4_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT4_ALT", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT4_ALT", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT5_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT5_ALT", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT5_ALT", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT6_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT6_ALT", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT6_ALT", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT7_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT7_ALT", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT7_ALT", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT8_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT8_ALT", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT8_ALT", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT9_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT9_ALT", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT9_ALT", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT10_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT10_ALT", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT10_ALT", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT11_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT11_ALT", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT11_ALT", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT12_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT12_ALT", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT12_ALT", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT13_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT13_ALT", - FALSE, 0x00000000, 0x00000000, TRUE), + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT13_ALT", FALSE, 0, 0, TRUE), HOWTO (R_XTENSA_SLOT14_ALT, 0, 0, 0, TRUE, 0, complain_overflow_dont, - bfd_elf_xtensa_reloc, "R_XTENSA_SLOT14_ALT", - FALSE, 0x00000000, 0x00000000, TRUE) + bfd_elf_xtensa_reloc, "R_XTENSA_SLOT14_ALT", FALSE, 0, 0, TRUE), }; #if DEBUG_GEN_RELOC @@ -430,6 +391,20 @@ elf_xtensa_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +elf_xtensa_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; i < sizeof (elf_howto_table) / sizeof (elf_howto_table[0]); i++) + if (elf_howto_table[i].name != NULL + && strcasecmp (elf_howto_table[i].name, r_name) == 0) + return &elf_howto_table[i]; + + return NULL; +} + /* Given an ELF "rela" relocation, find the corresponding howto and record it in the BFD internal arelent representation of the relocation. */ @@ -496,9 +471,70 @@ static const bfd_byte elf_xtensa_le_plt_entry[PLT_ENTRY_SIZE] = 0 /* unused */ }; +/* Xtensa ELF linker hash table. */ + +struct elf_xtensa_link_hash_table +{ + struct elf_link_hash_table elf; + + /* Short-cuts to get to dynamic linker sections. */ + asection *sgot; + asection *sgotplt; + asection *srelgot; + asection *splt; + asection *srelplt; + asection *sgotloc; + asection *spltlittbl; + + /* Total count of PLT relocations seen during check_relocs. + The actual PLT code must be split into multiple sections and all + the sections have to be created before size_dynamic_sections, + where we figure out the exact number of PLT entries that will be + needed. It is OK if this count is an overestimate, e.g., some + relocations may be removed by GC. */ + int plt_reloc_count; +}; + +/* Get the Xtensa ELF linker hash table from a link_info structure. */ + +#define elf_xtensa_hash_table(p) \ + ((struct elf_xtensa_link_hash_table *) ((p)->hash)) + +/* Create an Xtensa ELF linker hash table. */ + +static struct bfd_link_hash_table * +elf_xtensa_link_hash_table_create (bfd *abfd) +{ + struct elf_xtensa_link_hash_table *ret; + bfd_size_type amt = sizeof (struct elf_xtensa_link_hash_table); + + ret = bfd_malloc (amt); + if (ret == NULL) + return NULL; + + if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd, + _bfd_elf_link_hash_newfunc, + sizeof (struct elf_link_hash_entry))) + { + free (ret); + return NULL; + } + + ret->sgot = NULL; + ret->sgotplt = NULL; + ret->srelgot = NULL; + ret->splt = NULL; + ret->srelplt = NULL; + ret->sgotloc = NULL; + ret->spltlittbl = NULL; + + ret->plt_reloc_count = 0; + + return &ret->elf.root; +} static inline bfd_boolean -xtensa_elf_dynamic_symbol_p (struct elf_link_hash_entry *h, +elf_xtensa_dynamic_symbol_p (struct elf_link_hash_entry *h, struct bfd_link_info *info) { /* Check if we should do dynamic things to this symbol. The @@ -571,16 +607,15 @@ xtensa_read_table_entries (bfd *abfd, bfd_boolean output_addr) { asection *table_section; - char *table_section_name; bfd_size_type table_size = 0; bfd_byte *table_data; property_table_entry *blocks; int blk, block_count; bfd_size_type num_records; - Elf_Internal_Rela *internal_relocs; - bfd_vma section_addr; + Elf_Internal_Rela *internal_relocs, *irel, *rel_end; + bfd_vma section_addr, off; flagword predef_flags; - bfd_size_type table_entry_size; + bfd_size_type table_entry_size, section_limit; if (!section || !(section->flags & SEC_ALLOC) @@ -590,9 +625,7 @@ xtensa_read_table_entries (bfd *abfd, return 0; } - table_section_name = xtensa_get_property_section_name (section, sec_name); - table_section = bfd_get_section_by_name (abfd, table_section_name); - free (table_section_name); + table_section = xtensa_get_property_section (section, sec_name); if (table_section) table_size = table_section->size; @@ -618,67 +651,63 @@ xtensa_read_table_entries (bfd *abfd, else section_addr = section->vma; - /* If the file has not yet been relocated, process the relocations - and sort out the table entries that apply to the specified section. */ internal_relocs = retrieve_internal_relocs (abfd, table_section, TRUE); if (internal_relocs && !table_section->reloc_done) { - unsigned i; - - for (i = 0; i < table_section->reloc_count; i++) - { - Elf_Internal_Rela *rel = &internal_relocs[i]; - unsigned long r_symndx; - - if (ELF32_R_TYPE (rel->r_info) == R_XTENSA_NONE) - continue; - - BFD_ASSERT (ELF32_R_TYPE (rel->r_info) == R_XTENSA_32); - r_symndx = ELF32_R_SYM (rel->r_info); - - if (get_elf_r_symndx_section (abfd, r_symndx) == section) - { - bfd_vma sym_off = get_elf_r_symndx_offset (abfd, r_symndx); - BFD_ASSERT (sym_off == 0); - blocks[block_count].address = - (section_addr + sym_off + rel->r_addend - + bfd_get_32 (abfd, table_data + rel->r_offset)); - blocks[block_count].size = - bfd_get_32 (abfd, table_data + rel->r_offset + 4); - if (predef_flags) - blocks[block_count].flags = predef_flags; - else - blocks[block_count].flags = - bfd_get_32 (abfd, table_data + rel->r_offset + 8); - block_count++; - } - } + qsort (internal_relocs, table_section->reloc_count, + sizeof (Elf_Internal_Rela), internal_reloc_compare); + irel = internal_relocs; } else + irel = NULL; + + section_limit = bfd_get_section_limit (abfd, section); + rel_end = internal_relocs + table_section->reloc_count; + + for (off = 0; off < table_size; off += table_entry_size) { - /* The file has already been relocated and the addresses are - already in the table. */ - bfd_vma off; - bfd_size_type section_limit = bfd_get_section_limit (abfd, section); + bfd_vma address = bfd_get_32 (abfd, table_data + off); - for (off = 0; off < table_size; off += table_entry_size) + /* Skip any relocations before the current offset. This should help + avoid confusion caused by unexpected relocations for the preceding + table entry. */ + while (irel && + (irel->r_offset < off + || (irel->r_offset == off + && ELF32_R_TYPE (irel->r_info) == R_XTENSA_NONE))) { - bfd_vma address = bfd_get_32 (abfd, table_data + off); - - if (address >= section_addr - && address < section_addr + section_limit) - { - blocks[block_count].address = address; - blocks[block_count].size = - bfd_get_32 (abfd, table_data + off + 4); - if (predef_flags) - blocks[block_count].flags = predef_flags; - else - blocks[block_count].flags = - bfd_get_32 (abfd, table_data + off + 8); - block_count++; - } + irel += 1; + if (irel >= rel_end) + irel = 0; } + + if (irel && irel->r_offset == off) + { + bfd_vma sym_off; + unsigned long r_symndx = ELF32_R_SYM (irel->r_info); + BFD_ASSERT (ELF32_R_TYPE (irel->r_info) == R_XTENSA_32); + + if (get_elf_r_symndx_section (abfd, r_symndx) != section) + continue; + + sym_off = get_elf_r_symndx_offset (abfd, r_symndx); + BFD_ASSERT (sym_off == 0); + address += (section_addr + sym_off + irel->r_addend); + } + else + { + if (address < section_addr + || address >= section_addr + section_limit) + continue; + } + + blocks[block_count].address = address; + blocks[block_count].size = bfd_get_32 (abfd, table_data + off + 4); + if (predef_flags) + blocks[block_count].flags = predef_flags; + else + blocks[block_count].flags = bfd_get_32 (abfd, table_data + off + 8); + block_count++; } release_contents (table_section, table_data); @@ -757,6 +786,7 @@ elf_xtensa_check_relocs (bfd *abfd, asection *sec, const Elf_Internal_Rela *relocs) { + struct elf_xtensa_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; const Elf_Internal_Rela *rel; @@ -765,6 +795,7 @@ elf_xtensa_check_relocs (bfd *abfd, if (info->relocatable) return TRUE; + htab = elf_xtensa_hash_table (info); symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); @@ -829,12 +860,11 @@ elf_xtensa_check_relocs (bfd *abfd, /* Keep track of the total PLT relocation count even if we don't yet know whether the dynamic sections will be created. */ - plt_reloc_count += 1; + htab->plt_reloc_count += 1; if (elf_hash_table (info)->dynamic_sections_created) { - if (!add_extra_plt_sections (elf_hash_table (info)->dynobj, - plt_reloc_count)) + if (! add_extra_plt_sections (info, htab->plt_reloc_count)) return FALSE; } } @@ -929,18 +959,19 @@ elf_xtensa_check_relocs (bfd *abfd, static void elf_xtensa_make_sym_local (struct bfd_link_info *info, - struct elf_link_hash_entry *h) + struct elf_link_hash_entry *h) { if (info->shared) { if (h->plt.refcount > 0) - { - /* Will use RELATIVE relocs instead of JMP_SLOT relocs. */ - if (h->got.refcount < 0) - h->got.refcount = 0; - h->got.refcount += h->plt.refcount; - h->plt.refcount = 0; - } + { + /* For shared objects, there's no need for PLT entries for local + symbols (use RELATIVE relocs instead of JMP_SLOT relocs). */ + if (h->got.refcount < 0) + h->got.refcount = 0; + h->got.refcount += h->plt.refcount; + h->plt.refcount = 0; + } } else { @@ -953,8 +984,8 @@ elf_xtensa_make_sym_local (struct bfd_link_info *info, static void elf_xtensa_hide_symbol (struct bfd_link_info *info, - struct elf_link_hash_entry *h, - bfd_boolean force_local) + struct elf_link_hash_entry *h, + bfd_boolean force_local) { /* For a shared link, move the plt refcount to the got refcount to leave space for RELATIVE relocs. */ @@ -969,38 +1000,33 @@ elf_xtensa_hide_symbol (struct bfd_link_info *info, static asection * elf_xtensa_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, + struct bfd_link_info *info, Elf_Internal_Rela *rel, struct elf_link_hash_entry *h, Elf_Internal_Sym *sym) { - if (h) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_XTENSA_GNU_VTINHERIT: - case R_XTENSA_GNU_VTENTRY: - break; + /* Property sections are marked "KEEP" in the linker scripts, but they + should not cause other sections to be marked. (This approach relies + on elf_xtensa_discard_info to remove property table entries that + describe discarded sections. Alternatively, it might be more + efficient to avoid using "KEEP" in the linker scripts and instead use + the gc_mark_extra_sections hook to mark only the property sections + that describe marked sections. That alternative does not work well + with the current property table sections, which do not correspond + one-to-one with the sections they describe, but that should be fixed + someday.) */ + if (xtensa_is_property_section (sec)) + return NULL; - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; + if (h != NULL) + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_XTENSA_GNU_VTINHERIT: + case R_XTENSA_GNU_VTENTRY: + return NULL; + } - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } @@ -1077,16 +1103,22 @@ elf_xtensa_gc_sweep_hook (bfd *abfd, static bfd_boolean elf_xtensa_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info) { + struct elf_xtensa_link_hash_table *htab; flagword flags, noalloc_flags; - asection *s; + + htab = elf_xtensa_hash_table (info); /* First do all the standard stuff. */ if (! _bfd_elf_create_dynamic_sections (dynobj, info)) return FALSE; + htab->splt = bfd_get_section_by_name (dynobj, ".plt"); + htab->srelplt = bfd_get_section_by_name (dynobj, ".rela.plt"); + htab->sgot = bfd_get_section_by_name (dynobj, ".got"); + htab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt"); /* Create any extra PLT sections in case check_relocs has already been called on all the non-dynamic input files. */ - if (!add_extra_plt_sections (dynobj, plt_reloc_count)) + if (! add_extra_plt_sections (info, htab->plt_reloc_count)) return FALSE; noalloc_flags = (SEC_HAS_CONTENTS | SEC_IN_MEMORY @@ -1094,28 +1126,27 @@ elf_xtensa_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info) flags = noalloc_flags | SEC_ALLOC | SEC_LOAD; /* Mark the ".got.plt" section READONLY. */ - s = bfd_get_section_by_name (dynobj, ".got.plt"); - if (s == NULL - || ! bfd_set_section_flags (dynobj, s, flags)) + if (htab->sgotplt == NULL + || ! bfd_set_section_flags (dynobj, htab->sgotplt, flags)) return FALSE; /* Create ".rela.got". */ - s = bfd_make_section_with_flags (dynobj, ".rela.got", flags); - if (s == NULL - || ! bfd_set_section_alignment (dynobj, s, 2)) + htab->srelgot = bfd_make_section_with_flags (dynobj, ".rela.got", flags); + if (htab->srelgot == NULL + || ! bfd_set_section_alignment (dynobj, htab->srelgot, 2)) return FALSE; /* Create ".got.loc" (literal tables for use by dynamic linker). */ - s = bfd_make_section_with_flags (dynobj, ".got.loc", flags); - if (s == NULL - || ! bfd_set_section_alignment (dynobj, s, 2)) + htab->sgotloc = bfd_make_section_with_flags (dynobj, ".got.loc", flags); + if (htab->sgotloc == NULL + || ! bfd_set_section_alignment (dynobj, htab->sgotloc, 2)) return FALSE; /* Create ".xt.lit.plt" (literal table for ".got.plt*"). */ - s = bfd_make_section_with_flags (dynobj, ".xt.lit.plt", - noalloc_flags); - if (s == NULL - || ! bfd_set_section_alignment (dynobj, s, 2)) + htab->spltlittbl = bfd_make_section_with_flags (dynobj, ".xt.lit.plt", + noalloc_flags); + if (htab->spltlittbl == NULL + || ! bfd_set_section_alignment (dynobj, htab->spltlittbl, 2)) return FALSE; return TRUE; @@ -1123,8 +1154,9 @@ elf_xtensa_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info) static bfd_boolean -add_extra_plt_sections (bfd *dynobj, int count) +add_extra_plt_sections (struct bfd_link_info *info, int count) { + bfd *dynobj = elf_hash_table (info)->dynobj; int chunk; /* Iterate over all chunks except 0 which uses the standard ".plt" and @@ -1136,7 +1168,7 @@ add_extra_plt_sections (bfd *dynobj, int count) asection *s; /* Stop when we find a section has already been created. */ - if (elf_xtensa_get_plt_section (dynobj, chunk)) + if (elf_xtensa_get_plt_section (info, chunk)) break; flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY @@ -1144,8 +1176,7 @@ add_extra_plt_sections (bfd *dynobj, int count) sname = (char *) bfd_malloc (10); sprintf (sname, ".plt.%u", chunk); - s = bfd_make_section_with_flags (dynobj, sname, - flags | SEC_CODE); + s = bfd_make_section_with_flags (dynobj, sname, flags | SEC_CODE); if (s == NULL || ! bfd_set_section_alignment (dynobj, s, 2)) return FALSE; @@ -1193,56 +1224,44 @@ elf_xtensa_adjust_dynamic_symbol (struct bfd_link_info *info ATTRIBUTE_UNUSED, static bfd_boolean -elf_xtensa_fix_refcounts (struct elf_link_hash_entry *h, void *arg) +elf_xtensa_allocate_dynrelocs (struct elf_link_hash_entry *h, void *arg) { - struct bfd_link_info *info = (struct bfd_link_info *) arg; + struct bfd_link_info *info; + struct elf_xtensa_link_hash_table *htab; + bfd_boolean is_dynamic; + + if (h->root.type == bfd_link_hash_indirect) + return TRUE; if (h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; - if (! xtensa_elf_dynamic_symbol_p (h, info)) + info = (struct bfd_link_info *) arg; + htab = elf_xtensa_hash_table (info); + + is_dynamic = elf_xtensa_dynamic_symbol_p (h, info); + + if (! is_dynamic) elf_xtensa_make_sym_local (info, h); - return TRUE; -} - - -static bfd_boolean -elf_xtensa_allocate_plt_size (struct elf_link_hash_entry *h, void *arg) -{ - asection *srelplt = (asection *) arg; - - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - if (h->plt.refcount > 0) - srelplt->size += (h->plt.refcount * sizeof (Elf32_External_Rela)); - - return TRUE; -} - - -static bfd_boolean -elf_xtensa_allocate_got_size (struct elf_link_hash_entry *h, void *arg) -{ - asection *srelgot = (asection *) arg; - - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; + htab->srelplt->size += (h->plt.refcount * sizeof (Elf32_External_Rela)); if (h->got.refcount > 0) - srelgot->size += (h->got.refcount * sizeof (Elf32_External_Rela)); + htab->srelgot->size += (h->got.refcount * sizeof (Elf32_External_Rela)); return TRUE; } static void -elf_xtensa_allocate_local_got_size (struct bfd_link_info *info, - asection *srelgot) +elf_xtensa_allocate_local_got_size (struct bfd_link_info *info) { + struct elf_xtensa_link_hash_table *htab; bfd *i; + htab = elf_xtensa_hash_table (info); + for (i = info->input_bfds; i; i = i->link_next) { bfd_signed_vma *local_got_refcounts; @@ -1259,8 +1278,8 @@ elf_xtensa_allocate_local_got_size (struct bfd_link_info *info, for (j = 0; j < cnt; ++j) { if (local_got_refcounts[j] > 0) - srelgot->size += (local_got_refcounts[j] - * sizeof (Elf32_External_Rela)); + htab->srelgot->size += (local_got_refcounts[j] + * sizeof (Elf32_External_Rela)); } } } @@ -1272,6 +1291,7 @@ static bfd_boolean elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, struct bfd_link_info *info) { + struct elf_xtensa_link_hash_table *htab; bfd *dynobj, *abfd; asection *s, *srelplt, *splt, *sgotplt, *srelgot, *spltlittbl, *sgotloc; bfd_boolean relplt, relgot; @@ -1279,14 +1299,22 @@ elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, plt_entries = 0; plt_chunks = 0; - srelgot = 0; + htab = elf_xtensa_hash_table (info); dynobj = elf_hash_table (info)->dynobj; if (dynobj == NULL) abort (); + srelgot = htab->srelgot; + srelplt = htab->srelplt; if (elf_hash_table (info)->dynamic_sections_created) { + BFD_ASSERT (htab->srelgot != NULL + && htab->srelplt != NULL + && htab->sgot != NULL + && htab->spltlittbl != NULL + && htab->sgotloc != NULL); + /* Set the contents of the .interp section to the interpreter. */ if (info->executable) { @@ -1298,48 +1326,27 @@ elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, } /* Allocate room for one word in ".got". */ - s = bfd_get_section_by_name (dynobj, ".got"); - if (s == NULL) - abort (); - s->size = 4; + htab->sgot->size = 4; - /* Adjust refcounts for symbols that we now know are not "dynamic". */ + /* Allocate space in ".rela.got" for literals that reference global + symbols and space in ".rela.plt" for literals that have PLT + entries. */ elf_link_hash_traverse (elf_hash_table (info), - elf_xtensa_fix_refcounts, + elf_xtensa_allocate_dynrelocs, (void *) info); - /* Allocate space in ".rela.got" for literals that reference - global symbols. */ - srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); - if (srelgot == NULL) - abort (); - elf_link_hash_traverse (elf_hash_table (info), - elf_xtensa_allocate_got_size, - (void *) srelgot); - /* If we are generating a shared object, we also need space in ".rela.got" for R_XTENSA_RELATIVE relocs for literals that reference local symbols. */ if (info->shared) - elf_xtensa_allocate_local_got_size (info, srelgot); - - /* Allocate space in ".rela.plt" for literals that have PLT entries. */ - srelplt = bfd_get_section_by_name (dynobj, ".rela.plt"); - if (srelplt == NULL) - abort (); - elf_link_hash_traverse (elf_hash_table (info), - elf_xtensa_allocate_plt_size, - (void *) srelplt); + elf_xtensa_allocate_local_got_size (info); /* Allocate space in ".plt" to match the size of ".rela.plt". For each PLT entry, we need the PLT code plus a 4-byte literal. For each chunk of ".plt", we also need two more 4-byte literals, two corresponding entries in ".rela.got", and an 8-byte entry in ".xt.lit.plt". */ - spltlittbl = bfd_get_section_by_name (dynobj, ".xt.lit.plt"); - if (spltlittbl == NULL) - abort (); - + spltlittbl = htab->spltlittbl; plt_entries = srelplt->size / sizeof (Elf32_External_Rela); plt_chunks = (plt_entries + PLT_ENTRIES_PER_CHUNK - 1) / PLT_ENTRIES_PER_CHUNK; @@ -1348,14 +1355,13 @@ elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, created earlier because the initial count of PLT relocations was an overestimate. */ for (chunk = 0; - (splt = elf_xtensa_get_plt_section (dynobj, chunk)) != NULL; + (splt = elf_xtensa_get_plt_section (info, chunk)) != NULL; chunk++) { int chunk_entries; - sgotplt = elf_xtensa_get_gotplt_section (dynobj, chunk); - if (sgotplt == NULL) - abort (); + sgotplt = elf_xtensa_get_gotplt_section (info, chunk); + BFD_ASSERT (sgotplt != NULL); if (chunk < plt_chunks - 1) chunk_entries = PLT_ENTRIES_PER_CHUNK; @@ -1380,9 +1386,7 @@ elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* Allocate space in ".got.loc" to match the total size of all the literal tables. */ - sgotloc = bfd_get_section_by_name (dynobj, ".got.loc"); - if (sgotloc == NULL) - abort (); + sgotloc = htab->sgotloc; sgotloc->size = spltlittbl->size; for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link_next) { @@ -1412,7 +1416,7 @@ elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, of the dynobj section names depend upon the input files. */ name = bfd_get_section_name (dynobj, s); - if (strncmp (name, ".rela", 5) == 0) + if (CONST_STRNEQ (name, ".rela")) { if (s->size != 0) { @@ -1426,8 +1430,8 @@ elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, s->reloc_count = 0; } } - else if (strncmp (name, ".plt.", 5) != 0 - && strncmp (name, ".got.plt.", 9) != 0 + else if (! CONST_STRNEQ (name, ".plt.") + && ! CONST_STRNEQ (name, ".got.plt.") && strcmp (name, ".got") != 0 && strcmp (name, ".plt") != 0 && strcmp (name, ".got.plt") != 0 @@ -1465,8 +1469,6 @@ elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* Add the special XTENSA_RTLD relocations now. The offsets won't be known until finish_dynamic_sections, but we need to get the relocs in place before they are sorted. */ - if (srelgot == NULL) - abort (); for (chunk = 0; chunk < plt_chunks; chunk++) { Elf_Internal_Rela irela; @@ -1492,7 +1494,7 @@ elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, #define add_dynamic_entry(TAG, VAL) \ _bfd_elf_add_dynamic_entry (info, TAG, VAL) - if (! info->shared) + if (info->executable) { if (!add_dynamic_entry (DT_DEBUG, 0)) return FALSE; @@ -1524,31 +1526,6 @@ elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, return TRUE; } - -/* Remove any PT_LOAD segments with no allocated sections. Prior to - binutils 2.13, this function used to remove the non-SEC_ALLOC - sections from PT_LOAD segments, but that task has now been moved - into elf.c. We still need this function to remove any empty - segments that result, but there's nothing Xtensa-specific about - this and it probably ought to be moved into elf.c as well. */ - -static bfd_boolean -elf_xtensa_modify_segment_map (bfd *abfd, - struct bfd_link_info *info ATTRIBUTE_UNUSED) -{ - struct elf_segment_map **m_p; - - m_p = &elf_tdata (abfd)->segment_map; - while (*m_p) - { - if ((*m_p)->p_type == PT_LOAD && (*m_p)->count == 0) - *m_p = (*m_p)->next; - else - m_p = &(*m_p)->next; - } - return TRUE; -} - /* Perform the specified relocation. The instruction at (contents + address) is modified to set one operand to represent the value in "relocation". The @@ -1937,7 +1914,7 @@ bfd_elf_xtensa_reloc (bfd *abfd, /* Set up an entry in the procedure linkage table. */ static bfd_vma -elf_xtensa_create_plt_entry (bfd *dynobj, +elf_xtensa_create_plt_entry (struct bfd_link_info *info, bfd *output_bfd, unsigned reloc_index) { @@ -1947,8 +1924,8 @@ elf_xtensa_create_plt_entry (bfd *dynobj, int chunk; chunk = reloc_index / PLT_ENTRIES_PER_CHUNK; - splt = elf_xtensa_get_plt_section (dynobj, chunk); - sgotplt = elf_xtensa_get_gotplt_section (dynobj, chunk); + splt = elf_xtensa_get_plt_section (info, chunk); + sgotplt = elf_xtensa_get_gotplt_section (info, chunk); BFD_ASSERT (splt != NULL && sgotplt != NULL); plt_base = splt->output_section->vma + splt->output_offset; @@ -1995,12 +1972,11 @@ elf_xtensa_relocate_section (bfd *output_bfd, Elf_Internal_Sym *local_syms, asection **local_sections) { + struct elf_xtensa_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; struct elf_link_hash_entry **sym_hashes; - asection *srelgot, *srelplt; - bfd *dynobj; property_table_entry *lit_table = 0; int ltblsize = 0; char *error_message = NULL; @@ -2009,18 +1985,10 @@ elf_xtensa_relocate_section (bfd *output_bfd, if (!xtensa_default_isa) xtensa_default_isa = xtensa_isa_init (0, 0); - dynobj = elf_hash_table (info)->dynobj; + htab = elf_xtensa_hash_table (info); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); - srelgot = NULL; - srelplt = NULL; - if (dynobj) - { - srelgot = bfd_get_section_by_name (dynobj, ".rela.got");; - srelplt = bfd_get_section_by_name (dynobj, ".rela.plt"); - } - if (elf_hash_table (info)->dynamic_sections_created) { ltblsize = xtensa_read_table_entries (input_bfd, input_section, @@ -2062,6 +2030,53 @@ elf_xtensa_relocate_section (bfd *output_bfd, r_symndx = ELF32_R_SYM (rel->r_info); + h = NULL; + sym = NULL; + sec = NULL; + is_weak_undef = FALSE; + unresolved_reloc = FALSE; + warned = FALSE; + + if (howto->partial_inplace && !info->relocatable) + { + /* Because R_XTENSA_32 was made partial_inplace to fix some + problems with DWARF info in partial links, there may be + an addend stored in the contents. Take it out of there + and move it back into the addend field of the reloc. */ + rel->r_addend += bfd_get_32 (input_bfd, contents + rel->r_offset); + bfd_put_32 (input_bfd, 0, contents + rel->r_offset); + } + + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + sec = local_sections[r_symndx]; + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); + } + else + { + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, + unresolved_reloc, warned); + + if (relocation == 0 + && !unresolved_reloc + && h->root.type == bfd_link_hash_undefweak) + is_weak_undef = TRUE; + } + + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + if (info->relocatable) { /* This is a relocatable link. @@ -2143,42 +2158,6 @@ elf_xtensa_relocate_section (bfd *output_bfd, /* This is a final link. */ - h = NULL; - sym = NULL; - sec = NULL; - is_weak_undef = FALSE; - unresolved_reloc = FALSE; - warned = FALSE; - - if (howto->partial_inplace) - { - /* Because R_XTENSA_32 was made partial_inplace to fix some - problems with DWARF info in partial links, there may be - an addend stored in the contents. Take it out of there - and move it back into the addend field of the reloc. */ - rel->r_addend += bfd_get_32 (input_bfd, contents + rel->r_offset); - bfd_put_32 (input_bfd, 0, contents + rel->r_offset); - } - - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - } - else - { - RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, - r_symndx, symtab_hdr, sym_hashes, - h, sec, relocation, - unresolved_reloc, warned); - - if (relocation == 0 - && !unresolved_reloc - && h->root.type == bfd_link_hash_undefweak) - is_weak_undef = TRUE; - } - if (relaxing_section) { /* Check if this references a section in another input file. */ @@ -2204,7 +2183,7 @@ elf_xtensa_relocate_section (bfd *output_bfd, /* Generate dynamic relocations. */ if (elf_hash_table (info)->dynamic_sections_created) { - bfd_boolean dynamic_symbol = xtensa_elf_dynamic_symbol_p (h, info); + bfd_boolean dynamic_symbol = elf_xtensa_dynamic_symbol_p (h, info); if (dynamic_symbol && is_operand_relocation (r_type)) { @@ -2228,9 +2207,9 @@ elf_xtensa_relocate_section (bfd *output_bfd, asection *srel; if (dynamic_symbol && r_type == R_XTENSA_PLT) - srel = srelplt; + srel = htab->srelplt; else - srel = srelgot; + srel = htab->srelgot; BFD_ASSERT (srel != NULL); @@ -2279,7 +2258,7 @@ elf_xtensa_relocate_section (bfd *output_bfd, contents of the literal entry to the address of the PLT entry. */ relocation = - elf_xtensa_create_plt_entry (dynobj, output_bfd, + elf_xtensa_create_plt_entry (info, output_bfd, srel->reloc_count); } unresolved_reloc = FALSE; @@ -2306,13 +2285,16 @@ elf_xtensa_relocate_section (bfd *output_bfd, if (unresolved_reloc && !((input_section->flags & SEC_DEBUGGING) != 0 && h->def_dynamic)) - (*_bfd_error_handler) - (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"), - input_bfd, - input_section, - (long) rel->r_offset, - howto->name, - h->root.root.string); + { + (*_bfd_error_handler) + (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"), + input_bfd, + input_section, + (long) rel->r_offset, + howto->name, + h->root.root.string); + return FALSE; + } /* There's no point in calling bfd_perform_relocation here. Just go directly to our "special function". */ @@ -2373,12 +2355,17 @@ elf_xtensa_finish_dynamic_symbol (bfd *output_bfd ATTRIBUTE_UNUSED, struct elf_link_hash_entry *h, Elf_Internal_Sym *sym) { - if (h->needs_plt - && !h->def_regular) + if (h->needs_plt && !h->def_regular) { /* Mark the symbol as undefined, rather than as defined in the .plt section. Leave the value alone. */ sym->st_shndx = SHN_UNDEF; + /* If the symbol is weak, we do need to clear the value. + Otherwise, the PLT entry would provide a definition for + the symbol even if the symbol wasn't defined anywhere, + and so the symbol would never be NULL. */ + if (!h->ref_regular_nonweak) + sym->st_value = 0; } /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ @@ -2509,6 +2496,7 @@ static bfd_boolean elf_xtensa_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) { + struct elf_xtensa_link_hash_table *htab; bfd *dynobj; asection *sdyn, *srelplt, *sgot, *sxtlit, *sgotloc; Elf32_External_Dyn *dyncon, *dynconend; @@ -2517,13 +2505,14 @@ elf_xtensa_finish_dynamic_sections (bfd *output_bfd, if (! elf_hash_table (info)->dynamic_sections_created) return TRUE; + htab = elf_xtensa_hash_table (info); dynobj = elf_hash_table (info)->dynobj; sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); BFD_ASSERT (sdyn != NULL); /* Set the first entry in the global offset table to the address of the dynamic section. */ - sgot = bfd_get_section_by_name (dynobj, ".got"); + sgot = htab->sgot; if (sgot) { BFD_ASSERT (sgot->size == 4); @@ -2535,7 +2524,7 @@ elf_xtensa_finish_dynamic_sections (bfd *output_bfd, sgot->contents); } - srelplt = bfd_get_section_by_name (dynobj, ".rela.plt"); + srelplt = htab->srelplt; if (srelplt && srelplt->size != 0) { asection *sgotplt, *srelgot, *spltlittbl; @@ -2544,11 +2533,9 @@ elf_xtensa_finish_dynamic_sections (bfd *output_bfd, bfd_byte *loc; unsigned rtld_reloc; - srelgot = bfd_get_section_by_name (dynobj, ".rela.got");; - BFD_ASSERT (srelgot != NULL); - - spltlittbl = bfd_get_section_by_name (dynobj, ".xt.lit.plt"); - BFD_ASSERT (spltlittbl != NULL); + srelgot = htab->srelgot; + spltlittbl = htab->spltlittbl; + BFD_ASSERT (srelgot != NULL && spltlittbl != NULL); /* Find the first XTENSA_RTLD relocation. Presumably the rest of them follow immediately after.... */ @@ -2569,7 +2556,7 @@ elf_xtensa_finish_dynamic_sections (bfd *output_bfd, { int chunk_entries = 0; - sgotplt = elf_xtensa_get_gotplt_section (dynobj, chunk); + sgotplt = elf_xtensa_get_gotplt_section (info, chunk); BFD_ASSERT (sgotplt != NULL); /* Emit special RTLD relocations for the first two entries in @@ -2637,7 +2624,7 @@ elf_xtensa_finish_dynamic_sections (bfd *output_bfd, /* Combine adjacent literal table entries. */ BFD_ASSERT (! info->relocatable); sxtlit = bfd_get_section_by_name (output_bfd, ".xt.lit"); - sgotloc = bfd_get_section_by_name (dynobj, ".got.loc"); + sgotloc = htab->sgotloc; BFD_ASSERT (sxtlit && sgotloc); num_xtlit_entries = elf_xtensa_combine_prop_entries (output_bfd, sxtlit, sgotloc); @@ -2649,8 +2636,6 @@ elf_xtensa_finish_dynamic_sections (bfd *output_bfd, for (; dyncon < dynconend; dyncon++) { Elf_Internal_Dyn dyn; - const char *name; - asection *s; bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn); @@ -2664,23 +2649,19 @@ elf_xtensa_finish_dynamic_sections (bfd *output_bfd, break; case DT_XTENSA_GOT_LOC_OFF: - name = ".got.loc"; - goto get_vma; + dyn.d_un.d_ptr = htab->sgotloc->vma; + break; + case DT_PLTGOT: - name = ".got"; - goto get_vma; + dyn.d_un.d_ptr = htab->sgot->vma; + break; + case DT_JMPREL: - name = ".rela.plt"; - get_vma: - s = bfd_get_section_by_name (output_bfd, name); - BFD_ASSERT (s); - dyn.d_un.d_ptr = s->vma; + dyn.d_un.d_ptr = htab->srelplt->vma; break; case DT_PLTRELSZ: - s = bfd_get_section_by_name (output_bfd, ".rela.plt"); - BFD_ASSERT (s); - dyn.d_un.d_val = s->size; + dyn.d_un.d_val = htab->srelplt->size; break; case DT_RELASZ: @@ -2690,9 +2671,8 @@ elf_xtensa_finish_dynamic_sections (bfd *output_bfd, seems to be unresolved. Since the linker script arranges for .rela.plt to follow all other relocation sections, we don't have to worry about changing the DT_RELA entry. */ - s = bfd_get_section_by_name (output_bfd, ".rela.plt"); - if (s) - dyn.d_un.d_val -= s->size; + if (htab->srelplt) + dyn.d_un.d_val -= htab->srelplt->size; break; } @@ -2866,16 +2846,22 @@ elf_xtensa_discard_info_for_section (bfd *abfd, bfd_byte *contents; bfd_vma section_size; bfd_vma offset, actual_offset; - size_t removed_bytes = 0; - - section_size = sec->size; - if (section_size == 0 || section_size % 8 != 0) - return FALSE; + bfd_size_type removed_bytes = 0; + bfd_size_type entry_size; if (sec->output_section && bfd_is_abs_section (sec->output_section)) return FALSE; + if (xtensa_is_proptable_section (sec)) + entry_size = 12; + else + entry_size = 8; + + section_size = sec->size; + if (section_size == 0 || section_size % entry_size != 0) + return FALSE; + contents = retrieve_contents (abfd, sec, info->keep_memory); if (!contents) return FALSE; @@ -2887,10 +2873,15 @@ elf_xtensa_discard_info_for_section (bfd *abfd, return FALSE; } + /* Sort the relocations. They should already be in order when + relaxation is enabled, but it might not be. */ + qsort (cookie->rels, sec->reloc_count, sizeof (Elf_Internal_Rela), + internal_reloc_compare); + cookie->rel = cookie->rels; cookie->relend = cookie->rels + sec->reloc_count; - for (offset = 0; offset < section_size; offset += 8) + for (offset = 0; offset < section_size; offset += entry_size) { actual_offset = offset - removed_bytes; @@ -2914,11 +2905,11 @@ elf_xtensa_discard_info_for_section (bfd *abfd, if (ELF32_R_TYPE (cookie->rel->r_info) != R_XTENSA_NONE) { /* Shift the contents up. */ - if (offset + 8 < section_size) + if (offset + entry_size < section_size) memmove (&contents[actual_offset], - &contents[actual_offset+8], - section_size - offset - 8); - removed_bytes += 8; + &contents[actual_offset + entry_size], + section_size - offset - entry_size); + removed_bytes += entry_size; } /* Remove this relocation. */ @@ -2961,14 +2952,9 @@ elf_xtensa_discard_info_for_section (bfd *abfd, if (xtensa_is_littable_section (sec)) { - bfd *dynobj = elf_hash_table (info)->dynobj; - if (dynobj) - { - asection *sgotloc = - bfd_get_section_by_name (dynobj, ".got.loc"); - if (sgotloc) - sgotloc->size -= removed_bytes; - } + asection *sgotloc = elf_xtensa_hash_table (info)->sgotloc; + if (sgotloc) + sgotloc->size -= removed_bytes; } } else @@ -3008,6 +2994,19 @@ elf_xtensa_ignore_discarded_relocs (asection *sec) return xtensa_is_property_section (sec); } + +static unsigned int +elf_xtensa_action_discarded (asection *sec) +{ + if (strcmp (".xt_except_table", sec->name) == 0) + return 0; + + if (strcmp (".xt_except_desc", sec->name) == 0) + return 0; + + return _bfd_elf_default_action_discarded (sec); +} + /* Support for core dump NOTE sections. */ @@ -3433,24 +3432,23 @@ check_loop_aligned (bfd_byte *contents, bfd_vma address) { bfd_size_type loop_len, insn_len; - xtensa_opcode opcode = - insn_decode_opcode (contents, content_length, offset, 0); - BFD_ASSERT (opcode != XTENSA_UNDEFINED); - if (opcode != XTENSA_UNDEFINED) - return FALSE; - BFD_ASSERT (xtensa_opcode_is_loop (xtensa_default_isa, opcode)); - if (!xtensa_opcode_is_loop (xtensa_default_isa, opcode)) - return FALSE; + xtensa_opcode opcode; + opcode = insn_decode_opcode (contents, content_length, offset, 0); + if (opcode == XTENSA_UNDEFINED + || xtensa_opcode_is_loop (xtensa_default_isa, opcode) != 1) + { + BFD_ASSERT (FALSE); + return FALSE; + } + loop_len = insn_decode_len (contents, content_length, offset); - BFD_ASSERT (loop_len != 0); - if (loop_len == 0) - return FALSE; - insn_len = insn_decode_len (contents, content_length, offset + loop_len); - BFD_ASSERT (insn_len != 0); - if (insn_len == 0) - return FALSE; + if (loop_len == 0 || insn_len == 0) + { + BFD_ASSERT (FALSE); + return FALSE; + } return check_branch_target_aligned_address (address + loop_len, insn_len); } @@ -3562,34 +3560,133 @@ struct string_pair widenable[] = }; -/* Attempt to narrow an instruction. Return true if the narrowing is - valid. If the do_it parameter is non-zero, then perform the action - in-place directly into the contents. Otherwise, do not modify the - contents. The set of valid narrowing are specified by a string table +/* Check if an instruction can be "narrowed", i.e., changed from a standard + 3-byte instruction to a 2-byte "density" instruction. If it is valid, + return the instruction buffer holding the narrow instruction. Otherwise, + return 0. The set of valid narrowing are specified by a string table but require some special case operand checks in some cases. */ +static xtensa_insnbuf +can_narrow_instruction (xtensa_insnbuf slotbuf, + xtensa_format fmt, + xtensa_opcode opcode) +{ + xtensa_isa isa = xtensa_default_isa; + xtensa_format o_fmt; + unsigned opi; + + static xtensa_insnbuf o_insnbuf = NULL; + static xtensa_insnbuf o_slotbuf = NULL; + + if (o_insnbuf == NULL) + { + o_insnbuf = xtensa_insnbuf_alloc (isa); + o_slotbuf = xtensa_insnbuf_alloc (isa); + } + + for (opi = 0; opi < (sizeof (narrowable)/sizeof (struct string_pair)); opi++) + { + bfd_boolean is_or = (strcmp ("or", narrowable[opi].wide) == 0); + + if (opcode == xtensa_opcode_lookup (isa, narrowable[opi].wide)) + { + uint32 value, newval; + int i, operand_count, o_operand_count; + xtensa_opcode o_opcode; + + /* Address does not matter in this case. We might need to + fix it to handle branches/jumps. */ + bfd_vma self_address = 0; + + o_opcode = xtensa_opcode_lookup (isa, narrowable[opi].narrow); + if (o_opcode == XTENSA_UNDEFINED) + return 0; + o_fmt = get_single_format (o_opcode); + if (o_fmt == XTENSA_UNDEFINED) + return 0; + + if (xtensa_format_length (isa, fmt) != 3 + || xtensa_format_length (isa, o_fmt) != 2) + return 0; + + xtensa_format_encode (isa, o_fmt, o_insnbuf); + operand_count = xtensa_opcode_num_operands (isa, opcode); + o_operand_count = xtensa_opcode_num_operands (isa, o_opcode); + + if (xtensa_opcode_encode (isa, o_fmt, 0, o_slotbuf, o_opcode) != 0) + return 0; + + if (!is_or) + { + if (xtensa_opcode_num_operands (isa, o_opcode) != operand_count) + return 0; + } + else + { + uint32 rawval0, rawval1, rawval2; + + if (o_operand_count + 1 != operand_count + || xtensa_operand_get_field (isa, opcode, 0, + fmt, 0, slotbuf, &rawval0) != 0 + || xtensa_operand_get_field (isa, opcode, 1, + fmt, 0, slotbuf, &rawval1) != 0 + || xtensa_operand_get_field (isa, opcode, 2, + fmt, 0, slotbuf, &rawval2) != 0 + || rawval1 != rawval2 + || rawval0 == rawval1 /* it is a nop */) + return 0; + } + + for (i = 0; i < o_operand_count; ++i) + { + if (xtensa_operand_get_field (isa, opcode, i, fmt, 0, + slotbuf, &value) + || xtensa_operand_decode (isa, opcode, i, &value)) + return 0; + + /* PC-relative branches need adjustment, but + the PC-rel operand will always have a relocation. */ + newval = value; + if (xtensa_operand_do_reloc (isa, o_opcode, i, &newval, + self_address) + || xtensa_operand_encode (isa, o_opcode, i, &newval) + || xtensa_operand_set_field (isa, o_opcode, i, o_fmt, 0, + o_slotbuf, newval)) + return 0; + } + + if (xtensa_format_set_slot (isa, o_fmt, 0, o_insnbuf, o_slotbuf)) + return 0; + + return o_insnbuf; + } + } + return 0; +} + + +/* Attempt to narrow an instruction. If the narrowing is valid, perform + the action in-place directly into the contents and return TRUE. Otherwise, + the return value is FALSE and the contents are not modified. */ + static bfd_boolean narrow_instruction (bfd_byte *contents, bfd_size_type content_length, - bfd_size_type offset, - bfd_boolean do_it) + bfd_size_type offset) { xtensa_opcode opcode; - bfd_size_type insn_len, opi; + bfd_size_type insn_len; xtensa_isa isa = xtensa_default_isa; - xtensa_format fmt, o_fmt; + xtensa_format fmt; + xtensa_insnbuf o_insnbuf; static xtensa_insnbuf insnbuf = NULL; static xtensa_insnbuf slotbuf = NULL; - static xtensa_insnbuf o_insnbuf = NULL; - static xtensa_insnbuf o_slotbuf = NULL; if (insnbuf == NULL) { insnbuf = xtensa_insnbuf_alloc (isa); slotbuf = xtensa_insnbuf_alloc (isa); - o_insnbuf = xtensa_insnbuf_alloc (isa); - o_slotbuf = xtensa_insnbuf_alloc (isa); } BFD_ASSERT (offset < content_length); @@ -3615,152 +3712,43 @@ narrow_instruction (bfd_byte *contents, if (insn_len > content_length) return FALSE; - for (opi = 0; opi < (sizeof (narrowable)/sizeof (struct string_pair)); ++opi) + o_insnbuf = can_narrow_instruction (slotbuf, fmt, opcode); + if (o_insnbuf) { - bfd_boolean is_or = (strcmp ("or", narrowable[opi].wide) == 0); - - if (opcode == xtensa_opcode_lookup (isa, narrowable[opi].wide)) - { - uint32 value, newval; - int i, operand_count, o_operand_count; - xtensa_opcode o_opcode; - - /* Address does not matter in this case. We might need to - fix it to handle branches/jumps. */ - bfd_vma self_address = 0; - - o_opcode = xtensa_opcode_lookup (isa, narrowable[opi].narrow); - if (o_opcode == XTENSA_UNDEFINED) - return FALSE; - o_fmt = get_single_format (o_opcode); - if (o_fmt == XTENSA_UNDEFINED) - return FALSE; - - if (xtensa_format_length (isa, fmt) != 3 - || xtensa_format_length (isa, o_fmt) != 2) - return FALSE; - - xtensa_format_encode (isa, o_fmt, o_insnbuf); - operand_count = xtensa_opcode_num_operands (isa, opcode); - o_operand_count = xtensa_opcode_num_operands (isa, o_opcode); - - if (xtensa_opcode_encode (isa, o_fmt, 0, o_slotbuf, o_opcode) != 0) - return FALSE; - - if (!is_or) - { - if (xtensa_opcode_num_operands (isa, o_opcode) != operand_count) - return FALSE; - } - else - { - uint32 rawval0, rawval1, rawval2; - - if (o_operand_count + 1 != operand_count) - return FALSE; - if (xtensa_operand_get_field (isa, opcode, 0, - fmt, 0, slotbuf, &rawval0) != 0) - return FALSE; - if (xtensa_operand_get_field (isa, opcode, 1, - fmt, 0, slotbuf, &rawval1) != 0) - return FALSE; - if (xtensa_operand_get_field (isa, opcode, 2, - fmt, 0, slotbuf, &rawval2) != 0) - return FALSE; - - if (rawval1 != rawval2) - return FALSE; - if (rawval0 == rawval1) /* it is a nop */ - return FALSE; - } - - for (i = 0; i < o_operand_count; ++i) - { - if (xtensa_operand_get_field (isa, opcode, i, fmt, 0, - slotbuf, &value) - || xtensa_operand_decode (isa, opcode, i, &value)) - return FALSE; - - /* PC-relative branches need adjustment, but - the PC-rel operand will always have a relocation. */ - newval = value; - if (xtensa_operand_do_reloc (isa, o_opcode, i, &newval, - self_address) - || xtensa_operand_encode (isa, o_opcode, i, &newval) - || xtensa_operand_set_field (isa, o_opcode, i, o_fmt, 0, - o_slotbuf, newval)) - return FALSE; - } - - if (xtensa_format_set_slot (isa, o_fmt, 0, - o_insnbuf, o_slotbuf) != 0) - return FALSE; - - if (do_it) - xtensa_insnbuf_to_chars (isa, o_insnbuf, contents + offset, - content_length - offset); - return TRUE; - } + xtensa_insnbuf_to_chars (isa, o_insnbuf, contents + offset, + content_length - offset); + return TRUE; } + return FALSE; } -/* Attempt to widen an instruction. Return true if the widening is - valid. If the do_it parameter is non-zero, then the action should - be performed inplace into the contents. Otherwise, do not modify - the contents. The set of valid widenings are specified by a string - table but require some special case operand checks in some - cases. */ +/* Check if an instruction can be "widened", i.e., changed from a 2-byte + "density" instruction to a standard 3-byte instruction. If it is valid, + return the instruction buffer holding the wide instruction. Otherwise, + return 0. The set of valid widenings are specified by a string table + but require some special case operand checks in some cases. */ -static bfd_boolean -widen_instruction (bfd_byte *contents, - bfd_size_type content_length, - bfd_size_type offset, - bfd_boolean do_it) +static xtensa_insnbuf +can_widen_instruction (xtensa_insnbuf slotbuf, + xtensa_format fmt, + xtensa_opcode opcode) { - xtensa_opcode opcode; - bfd_size_type insn_len, opi; xtensa_isa isa = xtensa_default_isa; - xtensa_format fmt, o_fmt; + xtensa_format o_fmt; + unsigned opi; - static xtensa_insnbuf insnbuf = NULL; - static xtensa_insnbuf slotbuf = NULL; static xtensa_insnbuf o_insnbuf = NULL; static xtensa_insnbuf o_slotbuf = NULL; - if (insnbuf == NULL) + if (o_insnbuf == NULL) { - insnbuf = xtensa_insnbuf_alloc (isa); - slotbuf = xtensa_insnbuf_alloc (isa); o_insnbuf = xtensa_insnbuf_alloc (isa); o_slotbuf = xtensa_insnbuf_alloc (isa); } - BFD_ASSERT (offset < content_length); - - if (content_length < 2) - return FALSE; - - /* We will hand code a few of these for a little while. - These have all been specified in the assembler aleady. */ - xtensa_insnbuf_from_chars (isa, insnbuf, &contents[offset], - content_length - offset); - fmt = xtensa_format_decode (isa, insnbuf); - if (xtensa_format_num_slots (isa, fmt) != 1) - return FALSE; - - if (xtensa_format_get_slot (isa, fmt, 0, insnbuf, slotbuf) != 0) - return FALSE; - - opcode = xtensa_opcode_decode (isa, fmt, 0, slotbuf); - if (opcode == XTENSA_UNDEFINED) - return FALSE; - insn_len = xtensa_format_length (isa, fmt); - if (insn_len > content_length) - return FALSE; - - for (opi = 0; opi < (sizeof (widenable)/sizeof (struct string_pair)); ++opi) + for (opi = 0; opi < (sizeof (widenable)/sizeof (struct string_pair)); opi++) { bfd_boolean is_or = (strcmp ("or", widenable[opi].wide) == 0); bfd_boolean is_branch = (strcmp ("beqz", widenable[opi].wide) == 0 @@ -3778,14 +3766,14 @@ widen_instruction (bfd_byte *contents, o_opcode = xtensa_opcode_lookup (isa, widenable[opi].wide); if (o_opcode == XTENSA_UNDEFINED) - return FALSE; + return 0; o_fmt = get_single_format (o_opcode); if (o_fmt == XTENSA_UNDEFINED) - return FALSE; + return 0; if (xtensa_format_length (isa, fmt) != 2 || xtensa_format_length (isa, o_fmt) != 3) - return FALSE; + return 0; xtensa_format_encode (isa, o_fmt, o_insnbuf); operand_count = xtensa_opcode_num_operands (isa, opcode); @@ -3793,32 +3781,29 @@ widen_instruction (bfd_byte *contents, check_operand_count = o_operand_count; if (xtensa_opcode_encode (isa, o_fmt, 0, o_slotbuf, o_opcode) != 0) - return FALSE; + return 0; if (!is_or) { if (xtensa_opcode_num_operands (isa, o_opcode) != operand_count) - return FALSE; + return 0; } else { uint32 rawval0, rawval1; - if (o_operand_count != operand_count + 1) - return FALSE; - if (xtensa_operand_get_field (isa, opcode, 0, - fmt, 0, slotbuf, &rawval0) != 0) - return FALSE; - if (xtensa_operand_get_field (isa, opcode, 1, - fmt, 0, slotbuf, &rawval1) != 0) - return FALSE; - if (rawval0 == rawval1) /* it is a nop */ - return FALSE; + if (o_operand_count != operand_count + 1 + || xtensa_operand_get_field (isa, opcode, 0, + fmt, 0, slotbuf, &rawval0) != 0 + || xtensa_operand_get_field (isa, opcode, 1, + fmt, 0, slotbuf, &rawval1) != 0 + || rawval0 == rawval1 /* it is a nop */) + return 0; } if (is_branch) check_operand_count--; - for (i = 0; i < check_operand_count; ++i) + for (i = 0; i < check_operand_count; i++) { int new_i = i; if (is_or && i == o_operand_count - 1) @@ -3826,7 +3811,7 @@ widen_instruction (bfd_byte *contents, if (xtensa_operand_get_field (isa, opcode, new_i, fmt, 0, slotbuf, &value) || xtensa_operand_decode (isa, opcode, new_i, &value)) - return FALSE; + return 0; /* PC-relative branches need adjustment, but the PC-rel operand will always have a relocation. */ @@ -3836,18 +3821,73 @@ widen_instruction (bfd_byte *contents, || xtensa_operand_encode (isa, o_opcode, i, &newval) || xtensa_operand_set_field (isa, o_opcode, i, o_fmt, 0, o_slotbuf, newval)) - return FALSE; + return 0; } if (xtensa_format_set_slot (isa, o_fmt, 0, o_insnbuf, o_slotbuf)) - return FALSE; + return 0; - if (do_it) - xtensa_insnbuf_to_chars (isa, o_insnbuf, contents + offset, - content_length - offset); - return TRUE; + return o_insnbuf; } } + return 0; +} + + +/* Attempt to widen an instruction. If the widening is valid, perform + the action in-place directly into the contents and return TRUE. Otherwise, + the return value is FALSE and the contents are not modified. */ + +static bfd_boolean +widen_instruction (bfd_byte *contents, + bfd_size_type content_length, + bfd_size_type offset) +{ + xtensa_opcode opcode; + bfd_size_type insn_len; + xtensa_isa isa = xtensa_default_isa; + xtensa_format fmt; + xtensa_insnbuf o_insnbuf; + + static xtensa_insnbuf insnbuf = NULL; + static xtensa_insnbuf slotbuf = NULL; + + if (insnbuf == NULL) + { + insnbuf = xtensa_insnbuf_alloc (isa); + slotbuf = xtensa_insnbuf_alloc (isa); + } + + BFD_ASSERT (offset < content_length); + + if (content_length < 2) + return FALSE; + + /* We will hand-code a few of these for a little while. + These have all been specified in the assembler aleady. */ + xtensa_insnbuf_from_chars (isa, insnbuf, &contents[offset], + content_length - offset); + fmt = xtensa_format_decode (isa, insnbuf); + if (xtensa_format_num_slots (isa, fmt) != 1) + return FALSE; + + if (xtensa_format_get_slot (isa, fmt, 0, insnbuf, slotbuf) != 0) + return FALSE; + + opcode = xtensa_opcode_decode (isa, fmt, 0, slotbuf); + if (opcode == XTENSA_UNDEFINED) + return FALSE; + insn_len = xtensa_format_length (isa, fmt); + if (insn_len > content_length) + return FALSE; + + o_insnbuf = can_widen_instruction (slotbuf, fmt, opcode); + if (o_insnbuf) + { + xtensa_insnbuf_to_chars (isa, o_insnbuf, contents + offset, + content_length - offset); + return TRUE; + } return FALSE; } @@ -5007,13 +5047,16 @@ struct elf_xtensa_section_data static bfd_boolean elf_xtensa_new_section_hook (bfd *abfd, asection *sec) { - struct elf_xtensa_section_data *sdata; - bfd_size_type amt = sizeof (*sdata); + if (!sec->used_by_bfd) + { + struct elf_xtensa_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); - sdata = (struct elf_xtensa_section_data *) bfd_zalloc (abfd, amt); - if (sdata == NULL) - return FALSE; - sec->used_by_bfd = (void *) sdata; + sdata = bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = sdata; + } return _bfd_elf_new_section_hook (abfd, sec); } @@ -5498,7 +5541,7 @@ extend_ebb_bounds_forward (ebb_t *ebb) new_entry = &ebb->ptbl[ebb->end_ptbl_idx + 1]; if (((new_entry->flags & XTENSA_PROP_INSN) == 0) - || ((new_entry->flags & XTENSA_PROP_INSN_NO_TRANSFORM) != 0) + || ((new_entry->flags & XTENSA_PROP_NO_TRANSFORM) != 0) || ((the_entry->flags & XTENSA_PROP_ALIGN) != 0)) break; @@ -5571,7 +5614,7 @@ extend_ebb_bounds_backward (ebb_t *ebb) new_entry = &ebb->ptbl[ebb->start_ptbl_idx - 1]; if ((new_entry->flags & XTENSA_PROP_INSN) == 0 - || ((new_entry->flags & XTENSA_PROP_INSN_NO_TRANSFORM) != 0) + || ((new_entry->flags & XTENSA_PROP_NO_TRANSFORM) != 0) || ((new_entry->flags & XTENSA_PROP_ALIGN) != 0)) return TRUE; if (new_entry->address + new_entry->size != the_entry->address) @@ -5779,7 +5822,8 @@ static bfd_boolean compute_removed_literals static Elf_Internal_Rela *get_irel_at_offset (asection *, Elf_Internal_Rela *, bfd_vma); static bfd_boolean is_removable_literal - (const source_reloc *, int, const source_reloc *, int); + (const source_reloc *, int, const source_reloc *, int, asection *, + property_table_entry *, int); static bfd_boolean remove_dead_literal (bfd *, asection *, struct bfd_link_info *, Elf_Internal_Rela *, Elf_Internal_Rela *, source_reloc *, property_table_entry *, int); @@ -5926,6 +5970,8 @@ analyze_relocations (struct bfd_link_info *link_info) relax_info->src_relocs = (source_reloc *) bfd_malloc (relax_info->src_count * sizeof (source_reloc)); } + else + relax_info->src_count = 0; } /* Collect info on relocations against each relaxable section. */ @@ -5969,6 +6015,7 @@ find_relaxable_sections (bfd *abfd, bfd_boolean ok = TRUE; unsigned i; xtensa_relax_info *source_relax_info; + bfd_boolean is_l32r_reloc; internal_relocs = retrieve_internal_relocs (abfd, sec, link_info->keep_memory); @@ -6019,13 +6066,21 @@ find_relaxable_sections (bfd *abfd, /* Count PC-relative operand relocations against the target section. Note: The conditions tested here must match the conditions under which init_source_reloc is called in collect_source_relocs(). */ - if (is_operand_relocation (ELF32_R_TYPE (irel->r_info)) - && (!is_alt_relocation (ELF32_R_TYPE (irel->r_info)) - || is_l32r_relocation (abfd, sec, contents, irel))) - target_relax_info->src_count++; + is_l32r_reloc = FALSE; + if (is_operand_relocation (ELF32_R_TYPE (irel->r_info))) + { + xtensa_opcode opcode = + get_relocation_opcode (abfd, sec, contents, irel); + if (opcode != XTENSA_UNDEFINED) + { + is_l32r_reloc = (opcode == get_l32r_opcode ()); + if (!is_alt_relocation (ELF32_R_TYPE (irel->r_info)) + || is_l32r_reloc) + target_relax_info->src_count++; + } + } - if (is_l32r_relocation (abfd, sec, contents, irel) - && r_reloc_is_defined (&r_rel)) + if (is_l32r_reloc && r_reloc_is_defined (&r_rel)) { /* Mark the target section as relaxable. */ target_relax_info->is_relaxable_literal_section = TRUE; @@ -6346,14 +6401,12 @@ compute_text_actions (bfd *abfd, property_table_entry *prop_table = 0; int ptblsize = 0; bfd_size_type sec_size; - static bfd_boolean no_insn_move = FALSE; - if (no_insn_move) - return ok; - - /* Do nothing if the section contains no optimized longcalls. */ relax_info = get_xtensa_relax_info (sec); BFD_ASSERT (relax_info); + BFD_ASSERT (relax_info->src_next == relax_info->src_count); + + /* Do nothing if the section contains no optimized longcalls. */ if (!relax_info->is_relaxable_asm_section) return ok; @@ -6428,7 +6481,7 @@ compute_text_actions (bfd *abfd, the_entry++; } - if (the_entry->flags & XTENSA_PROP_INSN_NO_TRANSFORM) + if (the_entry->flags & XTENSA_PROP_NO_TRANSFORM) /* NO_REORDER is OK */ continue; @@ -6492,6 +6545,23 @@ error_return: } +/* Do not widen an instruction if it is preceeded by a + loop opcode. It might cause misalignment. */ + +static bfd_boolean +prev_instr_is_a_loop (bfd_byte *contents, + bfd_size_type content_length, + bfd_size_type offset) +{ + xtensa_opcode prev_opcode; + + if (offset < 3) + return FALSE; + prev_opcode = insn_decode_opcode (contents, content_length, offset-3, 0); + return (xtensa_opcode_is_loop (xtensa_default_isa, prev_opcode) == 1); +} + + /* Find all of the possible actions for an extended basic block. */ bfd_boolean @@ -6500,13 +6570,24 @@ compute_ebb_proposed_actions (ebb_constraint *ebb_table) const ebb_t *ebb = &ebb_table->ebb; unsigned rel_idx = ebb->start_reloc_idx; property_table_entry *entry, *start_entry, *end_entry; + bfd_vma offset = 0; + xtensa_isa isa = xtensa_default_isa; + xtensa_format fmt; + static xtensa_insnbuf insnbuf = NULL; + static xtensa_insnbuf slotbuf = NULL; + + if (insnbuf == NULL) + { + insnbuf = xtensa_insnbuf_alloc (isa); + slotbuf = xtensa_insnbuf_alloc (isa); + } start_entry = &ebb->ptbl[ebb->start_ptbl_idx]; end_entry = &ebb->ptbl[ebb->end_ptbl_idx]; for (entry = start_entry; entry <= end_entry; entry++) { - bfd_vma offset, start_offset, end_offset; + bfd_vma start_offset, end_offset; bfd_size_type insn_len; start_offset = entry->address - ebb->sec->vma; @@ -6528,15 +6609,9 @@ compute_ebb_proposed_actions (ebb_constraint *ebb_table) insn_len = insn_decode_len (ebb->contents, ebb->content_length, offset); - - /* Propose no actions for a section with an undecodable offset. */ if (insn_len == 0) - { - (*_bfd_error_handler) - (_("%B(%A+0x%lx): could not decode instruction; possible configuration mismatch"), - ebb->sec->owner, ebb->sec, offset); - return FALSE; - } + goto decode_error; + if (check_branch_target_aligned_address (offset, insn_len)) align_type = EBB_REQUIRE_TGT_ALIGN; @@ -6567,12 +6642,7 @@ compute_ebb_proposed_actions (ebb_constraint *ebb_table) ebb->content_length, irel->r_offset); if (simplify_size == 0) - { - (*_bfd_error_handler) - (_("%B(%A+0x%lx): could not decode instruction for XTENSA_ASM_SIMPLIFY relocation; possible configuration mismatch"), - ebb->sec->owner, ebb->sec, offset); - return FALSE; - } + goto decode_error; ebb_propose_action (ebb_table, EBB_NO_ALIGN, 0, ta_convert_longcall, offset, 0, TRUE); @@ -6581,47 +6651,50 @@ compute_ebb_proposed_actions (ebb_constraint *ebb_table) continue; } - insn_len = insn_decode_len (ebb->contents, ebb->content_length, - offset); - /* If the instruction is undecodable, then report an error. */ - if (insn_len == 0) + if (offset + MIN_INSN_LENGTH > ebb->content_length) + goto decode_error; + xtensa_insnbuf_from_chars (isa, insnbuf, &ebb->contents[offset], + ebb->content_length - offset); + fmt = xtensa_format_decode (isa, insnbuf); + if (fmt == XTENSA_UNDEFINED) + goto decode_error; + insn_len = xtensa_format_length (isa, fmt); + if (insn_len == (bfd_size_type) XTENSA_UNDEFINED) + goto decode_error; + + if (xtensa_format_num_slots (isa, fmt) != 1) { - (*_bfd_error_handler) - (_("%B(%A+0x%lx): could not decode instruction; possible configuration mismatch"), - ebb->sec->owner, ebb->sec, offset); - return FALSE; + offset += insn_len; + continue; } - + + xtensa_format_get_slot (isa, fmt, 0, insnbuf, slotbuf); + opcode = xtensa_opcode_decode (isa, fmt, 0, slotbuf); + if (opcode == XTENSA_UNDEFINED) + goto decode_error; + if ((entry->flags & XTENSA_PROP_INSN_NO_DENSITY) == 0 - && (entry->flags & XTENSA_PROP_INSN_NO_TRANSFORM) == 0 - && narrow_instruction (ebb->contents, ebb->content_length, - offset, FALSE)) + && (entry->flags & XTENSA_PROP_NO_TRANSFORM) == 0 + && can_narrow_instruction (slotbuf, fmt, opcode) != 0) { /* Add an instruction narrow action. */ ebb_propose_action (ebb_table, EBB_NO_ALIGN, 0, ta_narrow_insn, offset, 0, FALSE); - offset += insn_len; - continue; } - if ((entry->flags & XTENSA_PROP_INSN_NO_TRANSFORM) == 0 - && widen_instruction (ebb->contents, ebb->content_length, - offset, FALSE)) + else if ((entry->flags & XTENSA_PROP_NO_TRANSFORM) == 0 + && can_widen_instruction (slotbuf, fmt, opcode) != 0 + && ! prev_instr_is_a_loop (ebb->contents, + ebb->content_length, offset)) { /* Add an instruction widen action. */ ebb_propose_action (ebb_table, EBB_NO_ALIGN, 0, ta_widen_insn, offset, 0, FALSE); - offset += insn_len; - continue; } - opcode = insn_decode_opcode (ebb->contents, ebb->content_length, - offset, 0); - if (xtensa_opcode_is_loop (xtensa_default_isa, opcode)) + else if (xtensa_opcode_is_loop (xtensa_default_isa, opcode) == 1) { /* Check for branch targets. */ ebb_propose_action (ebb_table, EBB_REQUIRE_LOOP_ALIGN, 0, ta_none, offset, 0, TRUE); - offset += insn_len; - continue; } offset += insn_len; @@ -6635,6 +6708,12 @@ compute_ebb_proposed_actions (ebb_constraint *ebb_table) } return TRUE; + + decode_error: + (*_bfd_error_handler) + (_("%B(%A+0x%lx): could not decode instruction; possible configuration mismatch"), + ebb->sec->owner, ebb->sec, offset); + return FALSE; } @@ -7352,7 +7431,8 @@ compute_removed_literals (bfd *abfd, /* Check if the relocation was from an L32R that is being removed because a CALLX was converted to a direct CALL, and check if there are no other relocations to the literal. */ - if (is_removable_literal (rel, i, src_relocs, relax_info->src_count)) + if (is_removable_literal (rel, i, src_relocs, relax_info->src_count, + sec, prop_table, ptblsize)) { if (!remove_dead_literal (abfd, sec, link_info, internal_relocs, irel, rel, prop_table, ptblsize)) @@ -7436,12 +7516,22 @@ bfd_boolean is_removable_literal (const source_reloc *rel, int i, const source_reloc *src_relocs, - int src_count) + int src_count, + asection *sec, + property_table_entry *prop_table, + int ptblsize) { const source_reloc *curr_rel; + property_table_entry *entry; + if (!rel->is_null) return FALSE; + entry = elf_xtensa_find_property_entry (prop_table, ptblsize, + sec->vma + rel->r_rel.target_offset); + if (entry && (entry->flags & XTENSA_PROP_NO_TRANSFORM)) + return FALSE; + for (++i; i < src_count; ++i) { curr_rel = &src_relocs[i]; @@ -7731,7 +7821,7 @@ coalesce_shared_literal (asection *sec, entry = elf_xtensa_find_property_entry (prop_table, ptblsize, sec->vma + rel->r_rel.target_offset); - if (entry && (entry->flags & XTENSA_PROP_INSN_NO_TRANSFORM)) + if (entry && (entry->flags & XTENSA_PROP_NO_TRANSFORM)) return TRUE; /* Mark that the literal will be coalesced. */ @@ -8247,7 +8337,7 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info) copy_size = 2; memmove (scratch, &contents[orig_dot], orig_insn_size); BFD_ASSERT (action->removed_bytes == 1); - rv = narrow_instruction (scratch, final_size, 0, TRUE); + rv = narrow_instruction (scratch, final_size, 0); BFD_ASSERT (rv); memmove (&dup_contents[dup_dot], scratch, copy_size); orig_dot += orig_insn_size; @@ -8280,7 +8370,7 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info) copy_size = 3; memmove (scratch, &contents[orig_dot], orig_insn_size); BFD_ASSERT (action->removed_bytes == -1); - rv = widen_instruction (scratch, final_size, 0, TRUE); + rv = widen_instruction (scratch, final_size, 0); BFD_ASSERT (rv); memmove (&dup_contents[dup_dot], scratch, copy_size); orig_dot += orig_insn_size; @@ -8557,6 +8647,7 @@ shrink_dynamic_reloc_sections (struct bfd_link_info *info, asection *input_section, Elf_Internal_Rela *rel) { + struct elf_xtensa_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; unsigned long r_symndx; @@ -8564,6 +8655,7 @@ shrink_dynamic_reloc_sections (struct bfd_link_info *info, struct elf_link_hash_entry *h; bfd_boolean dynamic_symbol; + htab = elf_xtensa_hash_table (info); symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); @@ -8575,30 +8667,24 @@ shrink_dynamic_reloc_sections (struct bfd_link_info *info, else h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - dynamic_symbol = xtensa_elf_dynamic_symbol_p (h, info); + dynamic_symbol = elf_xtensa_dynamic_symbol_p (h, info); if ((r_type == R_XTENSA_32 || r_type == R_XTENSA_PLT) && (input_section->flags & SEC_ALLOC) != 0 && (dynamic_symbol || info->shared)) { - bfd *dynobj; - const char *srel_name; asection *srel; bfd_boolean is_plt = FALSE; - dynobj = elf_hash_table (info)->dynobj; - BFD_ASSERT (dynobj != NULL); - if (dynamic_symbol && r_type == R_XTENSA_PLT) { - srel_name = ".rela.plt"; + srel = htab->srelplt; is_plt = TRUE; } else - srel_name = ".rela.got"; + srel = htab->srelgot; /* Reduce size of the .rela.* section by one reloc. */ - srel = bfd_get_section_by_name (dynobj, srel_name); BFD_ASSERT (srel != NULL); BFD_ASSERT (srel->size >= sizeof (Elf32_External_Rela)); srel->size -= sizeof (Elf32_External_Rela); @@ -8617,15 +8703,15 @@ shrink_dynamic_reloc_sections (struct bfd_link_info *info, reloc_index = srel->size / sizeof (Elf32_External_Rela); chunk = reloc_index / PLT_ENTRIES_PER_CHUNK; - splt = elf_xtensa_get_plt_section (dynobj, chunk); - sgotplt = elf_xtensa_get_gotplt_section (dynobj, chunk); + splt = elf_xtensa_get_plt_section (info, chunk); + sgotplt = elf_xtensa_get_gotplt_section (info, chunk); BFD_ASSERT (splt != NULL && sgotplt != NULL); /* Check if an entire PLT chunk has just been eliminated. */ if (reloc_index % PLT_ENTRIES_PER_CHUNK == 0) { /* The two magic GOT entries for that chunk can go away. */ - srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); + srelgot = htab->srelgot; BFD_ASSERT (srelgot != NULL); srelgot->reloc_count -= 2; srelgot->size -= 2 * sizeof (Elf32_External_Rela); @@ -8794,12 +8880,13 @@ relax_property_section (bfd *abfd, { Elf_Internal_Rela *internal_relocs; bfd_byte *contents; - unsigned i, nexti; + unsigned i; bfd_boolean ok = TRUE; bfd_boolean is_full_prop_section; size_t last_zfill_target_offset = 0; asection *last_zfill_target_sec = NULL; bfd_size_type sec_size; + bfd_size_type entry_size; sec_size = bfd_get_section_limit (abfd, sec); internal_relocs = retrieve_internal_relocs (abfd, sec, @@ -8811,10 +8898,11 @@ relax_property_section (bfd *abfd, goto error_return; } - is_full_prop_section = - ((strcmp (sec->name, XTENSA_PROP_SEC_NAME) == 0) - || (strncmp (sec->name, ".gnu.linkonce.prop.", - sizeof ".gnu.linkonce.prop." - 1) == 0)); + is_full_prop_section = xtensa_is_proptable_section (sec); + if (is_full_prop_section) + entry_size = 12; + else + entry_size = 8; if (internal_relocs) { @@ -8843,12 +8931,8 @@ relax_property_section (bfd *abfd, size_p = &contents[irel->r_offset + 4]; flags_p = NULL; if (is_full_prop_section) - { - flags_p = &contents[irel->r_offset + 8]; - BFD_ASSERT (irel->r_offset + 12 <= sec_size); - } - else - BFD_ASSERT (irel->r_offset + 8 <= sec_size); + flags_p = &contents[irel->r_offset + 8]; + BFD_ASSERT (irel->r_offset + entry_size <= sec_size); target_sec = r_reloc_get_section (&val.r_rel); target_relax_info = get_xtensa_relax_info (target_sec); @@ -8932,74 +9016,105 @@ relax_property_section (bfd *abfd, reclaim the space in the output section, so we do this twice. */ if (internal_relocs && (!link_info->relocatable - || strcmp (sec->name, XTENSA_LIT_SEC_NAME) == 0)) + || xtensa_is_littable_section (sec))) { Elf_Internal_Rela *last_irel = NULL; + Elf_Internal_Rela *irel, *next_rel, *rel_end; int removed_bytes = 0; - bfd_vma offset, last_irel_offset; + bfd_vma offset; bfd_vma section_size; - bfd_size_type entry_size; flagword predef_flags; - if (is_full_prop_section) - entry_size = 12; - else - entry_size = 8; - predef_flags = xtensa_get_property_predef_flags (sec); - /* Walk over memory and irels at the same time. + /* Walk over memory and relocations at the same time. This REQUIRES that the internal_relocs be sorted by offset. */ qsort (internal_relocs, sec->reloc_count, sizeof (Elf_Internal_Rela), internal_reloc_compare); - nexti = 0; /* Index into internal_relocs. */ pin_internal_relocs (sec, internal_relocs); pin_contents (sec, contents); - last_irel_offset = (bfd_vma) -1; + next_rel = internal_relocs; + rel_end = internal_relocs + sec->reloc_count; + section_size = sec->size; BFD_ASSERT (section_size % entry_size == 0); for (offset = 0; offset < section_size; offset += entry_size) { - Elf_Internal_Rela *irel, *next_irel; + Elf_Internal_Rela *offset_rel, *extra_rel; bfd_vma bytes_to_remove, size, actual_offset; - bfd_boolean remove_this_irel; + bfd_boolean remove_this_rel; flagword flags; - irel = NULL; - next_irel = NULL; - - /* Find the next two relocations (if there are that many left), - skipping over any R_XTENSA_NONE relocs. On entry, "nexti" is - the starting reloc index. After these two loops, "i" - is the index of the first non-NONE reloc past that starting - index, and "nexti" is the index for the next non-NONE reloc - after "i". */ - - for (i = nexti; i < sec->reloc_count; i++) + /* Find the first relocation for the entry at the current offset. + Adjust the offsets of any extra relocations for the previous + entry. */ + offset_rel = NULL; + if (next_rel) { - if (ELF32_R_TYPE (internal_relocs[i].r_info) != R_XTENSA_NONE) + for (irel = next_rel; irel < rel_end; irel++) { - irel = &internal_relocs[i]; - break; + if ((irel->r_offset == offset + && ELF32_R_TYPE (irel->r_info) != R_XTENSA_NONE) + || irel->r_offset > offset) + { + offset_rel = irel; + break; + } + irel->r_offset -= removed_bytes; } - internal_relocs[i].r_offset -= removed_bytes; } - for (nexti = i + 1; nexti < sec->reloc_count; nexti++) + /* Find the next relocation (if there are any left). */ + extra_rel = NULL; + if (offset_rel) { - if (ELF32_R_TYPE (internal_relocs[nexti].r_info) - != R_XTENSA_NONE) + for (irel = offset_rel + 1; irel < rel_end; irel++) { - next_irel = &internal_relocs[nexti]; - break; + if (ELF32_R_TYPE (irel->r_info) != R_XTENSA_NONE) + { + extra_rel = irel; + break; + } } - internal_relocs[nexti].r_offset -= removed_bytes; } - remove_this_irel = FALSE; + /* Check if there are relocations on the current entry. There + should usually be a relocation on the offset field. If there + are relocations on the size or flags, then we can't optimize + this entry. Also, find the next relocation to examine on the + next iteration. */ + if (offset_rel) + { + if (offset_rel->r_offset >= offset + entry_size) + { + next_rel = offset_rel; + /* There are no relocations on the current entry, but we + might still be able to remove it if the size is zero. */ + offset_rel = NULL; + } + else if (offset_rel->r_offset > offset + || (extra_rel + && extra_rel->r_offset < offset + entry_size)) + { + /* There is a relocation on the size or flags, so we can't + do anything with this entry. Continue with the next. */ + next_rel = offset_rel; + continue; + } + else + { + BFD_ASSERT (offset_rel->r_offset == offset); + offset_rel->r_offset -= removed_bytes; + next_rel = offset_rel + 1; + } + } + else + next_rel = NULL; + + remove_this_rel = FALSE; bytes_to_remove = 0; actual_offset = offset - removed_bytes; size = bfd_get_32 (abfd, &contents[actual_offset + 4]); @@ -9009,90 +9124,64 @@ relax_property_section (bfd *abfd, else flags = predef_flags; - /* Check that the irels are sorted by offset, - with only one per address. */ - BFD_ASSERT (!irel || (int) irel->r_offset > (int) last_irel_offset); - BFD_ASSERT (!next_irel || next_irel->r_offset > irel->r_offset); - - /* Make sure there aren't relocs on the size or flag fields. */ - if ((irel && irel->r_offset == offset + 4) - || (is_full_prop_section - && irel && irel->r_offset == offset + 8)) - { - irel->r_offset -= removed_bytes; - last_irel_offset = irel->r_offset; - } - else if (next_irel && (next_irel->r_offset == offset + 4 - || (is_full_prop_section - && next_irel->r_offset == offset + 8))) - { - nexti += 1; - irel->r_offset -= removed_bytes; - next_irel->r_offset -= removed_bytes; - last_irel_offset = next_irel->r_offset; - } - else if (size == 0 && (flags & XTENSA_PROP_ALIGN) == 0 - && (flags & XTENSA_PROP_UNREACHABLE) == 0) + if (size == 0 + && (flags & XTENSA_PROP_ALIGN) == 0 + && (flags & XTENSA_PROP_UNREACHABLE) == 0) { /* Always remove entries with zero size and no alignment. */ bytes_to_remove = entry_size; - if (irel && irel->r_offset == offset) - { - remove_this_irel = TRUE; - - irel->r_offset -= removed_bytes; - last_irel_offset = irel->r_offset; - } + if (offset_rel) + remove_this_rel = TRUE; } - else if (irel && irel->r_offset == offset) + else if (offset_rel + && ELF32_R_TYPE (offset_rel->r_info) == R_XTENSA_32) { - if (ELF32_R_TYPE (irel->r_info) == R_XTENSA_32) + if (last_irel) { - if (last_irel) - { - flagword old_flags; - bfd_vma old_size = - bfd_get_32 (abfd, &contents[last_irel->r_offset + 4]); - bfd_vma old_address = - (last_irel->r_addend - + bfd_get_32 (abfd, &contents[last_irel->r_offset])); - bfd_vma new_address = - (irel->r_addend - + bfd_get_32 (abfd, &contents[actual_offset])); - if (is_full_prop_section) - old_flags = bfd_get_32 - (abfd, &contents[last_irel->r_offset + 8]); - else - old_flags = predef_flags; + flagword old_flags; + bfd_vma old_size = + bfd_get_32 (abfd, &contents[last_irel->r_offset + 4]); + bfd_vma old_address = + (last_irel->r_addend + + bfd_get_32 (abfd, &contents[last_irel->r_offset])); + bfd_vma new_address = + (offset_rel->r_addend + + bfd_get_32 (abfd, &contents[actual_offset])); + if (is_full_prop_section) + old_flags = bfd_get_32 + (abfd, &contents[last_irel->r_offset + 8]); + else + old_flags = predef_flags; - if ((ELF32_R_SYM (irel->r_info) - == ELF32_R_SYM (last_irel->r_info)) - && old_address + old_size == new_address - && old_flags == flags - && (old_flags & XTENSA_PROP_INSN_BRANCH_TARGET) == 0 - && (old_flags & XTENSA_PROP_INSN_LOOP_TARGET) == 0) - { - /* Fix the old size. */ - bfd_put_32 (abfd, old_size + size, - &contents[last_irel->r_offset + 4]); - bytes_to_remove = entry_size; - remove_this_irel = TRUE; - } - else - last_irel = irel; + if ((ELF32_R_SYM (offset_rel->r_info) + == ELF32_R_SYM (last_irel->r_info)) + && old_address + old_size == new_address + && old_flags == flags + && (old_flags & XTENSA_PROP_INSN_BRANCH_TARGET) == 0 + && (old_flags & XTENSA_PROP_INSN_LOOP_TARGET) == 0) + { + /* Fix the old size. */ + bfd_put_32 (abfd, old_size + size, + &contents[last_irel->r_offset + 4]); + bytes_to_remove = entry_size; + remove_this_rel = TRUE; } else - last_irel = irel; + last_irel = offset_rel; } - - irel->r_offset -= removed_bytes; - last_irel_offset = irel->r_offset; + else + last_irel = offset_rel; } - if (remove_this_irel) + if (remove_this_rel) { - irel->r_info = ELF32_R_INFO (0, R_XTENSA_NONE); - irel->r_offset -= bytes_to_remove; + offset_rel->r_info = ELF32_R_INFO (0, R_XTENSA_NONE); + /* In case this is the last entry, move the relocation offset + to the previous entry, if there is one. */ + if (offset_rel->r_offset >= bytes_to_remove) + offset_rel->r_offset -= bytes_to_remove; + else + offset_rel->r_offset = 0; } if (bytes_to_remove != 0) @@ -9107,6 +9196,10 @@ relax_property_section (bfd *abfd, if (removed_bytes) { + /* Fix up any extra relocations on the last entry. */ + for (irel = next_rel; irel < rel_end; irel++) + irel->r_offset -= removed_bytes; + /* Clear the removed bytes. */ memset (&contents[section_size - removed_bytes], 0, removed_bytes); @@ -9114,14 +9207,9 @@ relax_property_section (bfd *abfd, if (xtensa_is_littable_section (sec)) { - bfd *dynobj = elf_hash_table (link_info)->dynobj; - if (dynobj) - { - asection *sgotloc = - bfd_get_section_by_name (dynobj, ".got.loc"); - if (sgotloc) - sgotloc->size -= removed_bytes; - } + asection *sgotloc = elf_xtensa_hash_table (link_info)->sgotloc; + if (sgotloc) + sgotloc->size -= removed_bytes; } } } @@ -9307,26 +9395,38 @@ do_fix_for_final_link (Elf_Internal_Rela *rel, /* Miscellaneous utility functions.... */ static asection * -elf_xtensa_get_plt_section (bfd *dynobj, int chunk) +elf_xtensa_get_plt_section (struct bfd_link_info *info, int chunk) { + struct elf_xtensa_link_hash_table *htab; + bfd *dynobj; char plt_name[10]; if (chunk == 0) - return bfd_get_section_by_name (dynobj, ".plt"); + { + htab = elf_xtensa_hash_table (info); + return htab->splt; + } + dynobj = elf_hash_table (info)->dynobj; sprintf (plt_name, ".plt.%u", chunk); return bfd_get_section_by_name (dynobj, plt_name); } static asection * -elf_xtensa_get_gotplt_section (bfd *dynobj, int chunk) +elf_xtensa_get_gotplt_section (struct bfd_link_info *info, int chunk) { + struct elf_xtensa_link_hash_table *htab; + bfd *dynobj; char got_name[14]; if (chunk == 0) - return bfd_get_section_by_name (dynobj, ".got.plt"); + { + htab = elf_xtensa_hash_table (info); + return htab->sgotplt; + } + dynobj = elf_hash_table (info)->dynobj; sprintf (got_name, ".got.plt.%u", chunk); return bfd_get_section_by_name (dynobj, got_name); } @@ -9474,24 +9574,23 @@ pcrel_reloc_fits (xtensa_opcode opc, } -static int linkonce_len = sizeof (".gnu.linkonce.") - 1; -static int insn_sec_len = sizeof (XTENSA_INSN_SEC_NAME) - 1; -static int lit_sec_len = sizeof (XTENSA_LIT_SEC_NAME) - 1; -static int prop_sec_len = sizeof (XTENSA_PROP_SEC_NAME) - 1; - - static bfd_boolean xtensa_is_property_section (asection *sec) { - if (strncmp (XTENSA_INSN_SEC_NAME, sec->name, insn_sec_len) == 0 - || strncmp (XTENSA_LIT_SEC_NAME, sec->name, lit_sec_len) == 0 - || strncmp (XTENSA_PROP_SEC_NAME, sec->name, prop_sec_len) == 0) + if (xtensa_is_insntable_section (sec) + || xtensa_is_littable_section (sec) + || xtensa_is_proptable_section (sec)) return TRUE; - if (strncmp (".gnu.linkonce.", sec->name, linkonce_len) == 0 - && (strncmp (&sec->name[linkonce_len], "x.", 2) == 0 - || strncmp (&sec->name[linkonce_len], "p.", 2) == 0 - || strncmp (&sec->name[linkonce_len], "prop.", 5) == 0)) + return FALSE; +} + + +static bfd_boolean +xtensa_is_insntable_section (asection *sec) +{ + if (CONST_STRNEQ (sec->name, XTENSA_INSN_SEC_NAME) + || CONST_STRNEQ (sec->name, ".gnu.linkonce.x.")) return TRUE; return FALSE; @@ -9501,12 +9600,19 @@ xtensa_is_property_section (asection *sec) static bfd_boolean xtensa_is_littable_section (asection *sec) { - if (strncmp (XTENSA_LIT_SEC_NAME, sec->name, lit_sec_len) == 0) + if (CONST_STRNEQ (sec->name, XTENSA_LIT_SEC_NAME) + || CONST_STRNEQ (sec->name, ".gnu.linkonce.p.")) return TRUE; - if (strncmp (".gnu.linkonce.", sec->name, linkonce_len) == 0 - && sec->name[linkonce_len] == 'p' - && sec->name[linkonce_len + 1] == '.') + return FALSE; +} + + +static bfd_boolean +xtensa_is_proptable_section (asection *sec) +{ + if (CONST_STRNEQ (sec->name, XTENSA_PROP_SEC_NAME) + || CONST_STRNEQ (sec->name, ".gnu.linkonce.prop.")) return TRUE; return FALSE; @@ -9548,13 +9654,44 @@ internal_reloc_matches (const void *ap, const void *bp) } -char * -xtensa_get_property_section_name (asection *sec, const char *base_name) +/* Predicate function used to look up a section in a particular group. */ + +static bfd_boolean +match_section_group (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *inf) { - if (strncmp (sec->name, ".gnu.linkonce.", linkonce_len) == 0) + const char *gname = inf; + const char *group_name = elf_group_name (sec); + + return (group_name == gname + || (group_name != NULL + && gname != NULL + && strcmp (group_name, gname) == 0)); +} + + +static int linkonce_len = sizeof (".gnu.linkonce.") - 1; + +asection * +xtensa_get_property_section (asection *sec, const char *base_name) +{ + const char *suffix, *group_name; + char *prop_sec_name; + asection *prop_sec; + + group_name = elf_group_name (sec); + if (group_name) + { + suffix = strrchr (sec->name, '.'); + if (suffix == sec->name) + suffix = 0; + prop_sec_name = (char *) bfd_malloc (strlen (base_name) + 1 + + (suffix ? strlen (suffix) : 0)); + strcpy (prop_sec_name, base_name); + if (suffix) + strcat (prop_sec_name, suffix); + } + else if (strncmp (sec->name, ".gnu.linkonce.", linkonce_len) == 0) { - char *prop_sec_name; - const char *suffix; char *linkonce_kind = 0; if (strcmp (base_name, XTENSA_INSN_SEC_NAME) == 0) @@ -9574,30 +9711,48 @@ xtensa_get_property_section_name (asection *sec, const char *base_name) suffix = sec->name + linkonce_len; /* For backward compatibility, replace "t." instead of inserting the new linkonce_kind (but not for "prop" sections). */ - if (strncmp (suffix, "t.", 2) == 0 && linkonce_kind[1] == '.') + if (CONST_STRNEQ (suffix, "t.") && linkonce_kind[1] == '.') suffix += 2; strcat (prop_sec_name + linkonce_len, suffix); + } + else + prop_sec_name = strdup (base_name); - return prop_sec_name; + /* Check if the section already exists. */ + prop_sec = bfd_get_section_by_name_if (sec->owner, prop_sec_name, + match_section_group, + (void *) group_name); + /* If not, create it. */ + if (! prop_sec) + { + flagword flags = (SEC_RELOC | SEC_HAS_CONTENTS | SEC_READONLY); + flags |= (bfd_get_section_flags (sec->owner, sec) + & (SEC_LINK_ONCE | SEC_LINK_DUPLICATES)); + + prop_sec = bfd_make_section_anyway_with_flags + (sec->owner, strdup (prop_sec_name), flags); + if (! prop_sec) + return 0; + + elf_group_name (prop_sec) = group_name; } - return strdup (base_name); + free (prop_sec_name); + return prop_sec; } flagword xtensa_get_property_predef_flags (asection *sec) { - if (strcmp (sec->name, XTENSA_INSN_SEC_NAME) == 0 - || strncmp (sec->name, ".gnu.linkonce.x.", - sizeof ".gnu.linkonce.x." - 1) == 0) + if (xtensa_is_insntable_section (sec)) return (XTENSA_PROP_INSN - | XTENSA_PROP_INSN_NO_TRANSFORM + | XTENSA_PROP_NO_TRANSFORM | XTENSA_PROP_INSN_NO_REORDER); if (xtensa_is_littable_section (sec)) return (XTENSA_PROP_LITERAL - | XTENSA_PROP_INSN_NO_TRANSFORM + | XTENSA_PROP_NO_TRANSFORM | XTENSA_PROP_INSN_NO_REORDER); return 0; @@ -9624,7 +9779,7 @@ xtensa_callback_required_dependence (bfd *abfd, /* ".plt*" sections have no explicit relocations but they contain L32R instructions that reference the corresponding ".got.plt*" sections. */ if ((sec->flags & SEC_LINKER_CREATED) != 0 - && strncmp (sec->name, ".plt", 4) == 0) + && CONST_STRNEQ (sec->name, ".plt")) { asection *sgotplt; @@ -9701,10 +9856,11 @@ xtensa_callback_required_dependence (bfd *abfd, module loader so that the literals are not placed after the text. */ static const struct bfd_elf_special_section elf_xtensa_special_sections[] = { - { ".fini.literal", 13, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, - { ".init.literal", 13, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, - { ".literal", 8, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".fini.literal"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, + { STRING_COMMA_LEN (".init.literal"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, + { STRING_COMMA_LEN (".literal"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, + { STRING_COMMA_LEN (".xtensa.info"), 0, SHT_NOTE, 0 }, + { NULL, 0, 0, 0, 0 } }; #ifndef ELF_ARCH @@ -9738,7 +9894,10 @@ static const struct bfd_elf_special_section elf_xtensa_special_sections[] = #define bfd_elf32_bfd_print_private_bfd_data elf_xtensa_print_private_bfd_data #define bfd_elf32_bfd_relax_section elf_xtensa_relax_section #define bfd_elf32_bfd_reloc_type_lookup elf_xtensa_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup \ + elf_xtensa_reloc_name_lookup #define bfd_elf32_bfd_set_private_flags elf_xtensa_set_private_flags +#define bfd_elf32_bfd_link_hash_table_create elf_xtensa_link_hash_table_create #define elf_backend_adjust_dynamic_symbol elf_xtensa_adjust_dynamic_symbol #define elf_backend_check_relocs elf_xtensa_check_relocs @@ -9753,11 +9912,13 @@ static const struct bfd_elf_special_section elf_xtensa_special_sections[] = #define elf_backend_grok_prstatus elf_xtensa_grok_prstatus #define elf_backend_grok_psinfo elf_xtensa_grok_psinfo #define elf_backend_hide_symbol elf_xtensa_hide_symbol -#define elf_backend_modify_segment_map elf_xtensa_modify_segment_map #define elf_backend_object_p elf_xtensa_object_p #define elf_backend_reloc_type_class elf_xtensa_reloc_type_class #define elf_backend_relocate_section elf_xtensa_relocate_section #define elf_backend_size_dynamic_sections elf_xtensa_size_dynamic_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_special_sections elf_xtensa_special_sections +#define elf_backend_action_discarded elf_xtensa_action_discarded #include "elf32-target.h" diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 76d0661a116..3d4350d0082 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -1,6 +1,6 @@ /* Alpha specific support for 64-bit ELF Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006 Free Software Foundation, Inc. + 2006, 2007 Free Software Foundation, Inc. Contributed by Richard Henderson . This file is part of BFD, the Binary File Descriptor library. @@ -22,8 +22,8 @@ /* We need a published ABI spec for this. Until one comes out, don't assume this'll remain unchanged forever. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" @@ -184,6 +184,10 @@ struct alpha_elf_link_hash_table /* The head of a list of .got subsections linked through alpha_elf_tdata(abfd)->got_link_next. */ bfd *got_list; + + /* The most recent relax pass that we've seen. The GOTs + should be regenerated if this doesn't match. */ + int relax_trip; }; /* Look up an entry in a Alpha ELF linker hash table. */ @@ -321,11 +325,14 @@ struct alpha_elf_obj_tdata static bfd_boolean elf64_alpha_mkobject (bfd *abfd) { - bfd_size_type amt = sizeof (struct alpha_elf_obj_tdata); - abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) - return FALSE; - return TRUE; + { + bfd_size_type amt = sizeof (struct alpha_elf_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + } + return bfd_elf_mkobject (abfd); } static bfd_boolean @@ -1052,6 +1059,23 @@ elf64_alpha_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return 0; } +static reloc_howto_type * +elf64_alpha_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (elf64_alpha_howto_table) + / sizeof (elf64_alpha_howto_table[0])); + i++) + if (elf64_alpha_howto_table[i].name != NULL + && strcasecmp (elf64_alpha_howto_table[i].name, r_name) == 0) + return &elf64_alpha_howto_table[i]; + + return NULL; +} + /* Given an Alpha ELF reloc type, fill in an arelent structure. */ static void @@ -1898,7 +1922,7 @@ elf64_alpha_check_relocs (bfd *abfd, struct bfd_link_info *info, if (rel_sec_name == NULL) return FALSE; - BFD_ASSERT (strncmp (rel_sec_name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (rel_sec_name, ".rela") && strcmp (bfd_get_section_name (abfd, sec), rel_sec_name+5) == 0); } @@ -2032,6 +2056,19 @@ elf64_alpha_adjust_dynamic_symbol (struct bfd_link_info *info, return TRUE; } +/* Record STO_ALPHA_NOPV and STO_ALPHA_STD_GPLOAD. */ + +static void +elf64_alpha_merge_symbol_attribute (struct elf_link_hash_entry *h, + const Elf_Internal_Sym *isym, + bfd_boolean definition, + bfd_boolean dynamic) +{ + if (!dynamic && definition) + h->other = ((h->other & ELF_ST_VISIBILITY (-1)) + | (isym->st_other & ~ELF_ST_VISIBILITY (-1))); +} + /* Symbol versioning can create new symbols, and make our old symbols indirect to the new ones. Consolidate the got and reloc information in these situations. */ @@ -2342,7 +2379,6 @@ static bfd_boolean elf64_alpha_size_got_sections (struct bfd_link_info *info) { bfd *i, *got_list, *cur_got_obj = NULL; - int something_changed = 0; got_list = alpha_elf_hash_table (info)->got_list; @@ -2380,9 +2416,6 @@ elf64_alpha_size_got_sections (struct bfd_link_info *info) return TRUE; alpha_elf_hash_table (info)->got_list = got_list; - - /* Force got offsets to be recalculated. */ - something_changed = 1; } cur_got_obj = got_list; @@ -2396,8 +2429,6 @@ elf64_alpha_size_got_sections (struct bfd_link_info *info) alpha_elf_tdata(i)->got->size = 0; i = alpha_elf_tdata(i)->got_link_next; alpha_elf_tdata(cur_got_obj)->got_link_next = i; - - something_changed = 1; } else { @@ -2408,8 +2439,7 @@ elf64_alpha_size_got_sections (struct bfd_link_info *info) /* Once the gots have been merged, fill in the got offsets for everything therein. */ - if (1 || something_changed) - elf64_alpha_calc_got_offsets (info); + elf64_alpha_calc_got_offsets (info); return TRUE; } @@ -2444,10 +2474,10 @@ elf64_alpha_size_plt_section_1 (struct alpha_elf_link_hash_entry *h, PTR data) return TRUE; } -/* Called from relax_section to rebuild the PLT in light of - potential changes in the function's status. */ +/* Called from relax_section to rebuild the PLT in light of potential changes + in the function's status. */ -static bfd_boolean +static void elf64_alpha_size_plt_section (struct bfd_link_info *info) { asection *splt, *spltrel, *sgotplt; @@ -2457,7 +2487,7 @@ elf64_alpha_size_plt_section (struct bfd_link_info *info) dynobj = elf_hash_table(info)->dynobj; splt = bfd_get_section_by_name (dynobj, ".plt"); if (splt == NULL) - return TRUE; + return; splt->size = 0; @@ -2466,6 +2496,7 @@ elf64_alpha_size_plt_section (struct bfd_link_info *info) /* Every plt entry requires a JMP_SLOT relocation. */ spltrel = bfd_get_section_by_name (dynobj, ".rela.plt"); + entries = 0; if (splt->size) { if (elf64_alpha_use_secureplt) @@ -2473,8 +2504,6 @@ elf64_alpha_size_plt_section (struct bfd_link_info *info) else entries = (splt->size - OLD_PLT_HEADER_SIZE) / OLD_PLT_ENTRY_SIZE; } - else - entries = 0; spltrel->size = entries * sizeof (Elf64_External_Rela); /* When using the secureplt, we need two words somewhere in the data @@ -2485,8 +2514,6 @@ elf64_alpha_size_plt_section (struct bfd_link_info *info) sgotplt = bfd_get_section_by_name (dynobj, ".got.plt"); sgotplt->size = entries ? 16 : 0; } - - return TRUE; } static bfd_boolean @@ -2657,7 +2684,7 @@ elf64_alpha_size_rela_got_1 (struct alpha_elf_link_hash_entry *h, /* Set the sizes of the dynamic relocation sections. */ -static bfd_boolean +static void elf64_alpha_size_rela_got_section (struct bfd_link_info *info) { unsigned long entries; @@ -2696,15 +2723,13 @@ elf64_alpha_size_rela_got_section (struct bfd_link_info *info) if (!srel) { BFD_ASSERT (entries == 0); - return TRUE; + return; } srel->size = sizeof (Elf64_External_Rela) * entries; /* Now do the non-local symbols. */ alpha_elf_link_hash_traverse (alpha_elf_hash_table (info), elf64_alpha_size_rela_got_1, info); - - return TRUE; } /* Set the sizes of the dynamic sections. */ @@ -2758,7 +2783,7 @@ elf64_alpha_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, of the dynobj section names depend upon the input files. */ name = bfd_get_section_name (dynobj, s); - if (strncmp (name, ".rela", 5) == 0) + if (CONST_STRNEQ (name, ".rela")) { if (s->size != 0) { @@ -2770,7 +2795,7 @@ elf64_alpha_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, s->reloc_count = 0; } } - else if (strncmp (name, ".got", 4) != 0 + else if (! CONST_STRNEQ (name, ".got") && strcmp (name, ".plt") != 0 && strcmp (name, ".dynbss") != 0) { @@ -3576,7 +3601,7 @@ elf64_alpha_relax_section (bfd *abfd, asection *sec, struct alpha_elf_got_entry **local_got_entries; struct alpha_relax_info info; - /* We are not currently changing any sizes, so only one pass. */ + /* There's nothing to change, yet. */ *again = FALSE; if (link_info->relocatable @@ -3585,6 +3610,22 @@ elf64_alpha_relax_section (bfd *abfd, asection *sec, || sec->reloc_count == 0) return TRUE; + /* Make sure our GOT and PLT tables are up-to-date. */ + if (alpha_elf_hash_table(link_info)->relax_trip != link_info->relax_trip) + { + alpha_elf_hash_table(link_info)->relax_trip = link_info->relax_trip; + + /* This should never fail after the initial round, since the only + error is GOT overflow, and relaxation only shrinks the table. */ + if (!elf64_alpha_size_got_sections (link_info)) + abort (); + if (elf_hash_table (link_info)->dynamic_sections_created) + { + elf64_alpha_size_plt_section (link_info); + elf64_alpha_size_rela_got_section (link_info); + } + } + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; local_got_entries = alpha_elf_tdata(abfd)->local_got_entries; @@ -3794,13 +3835,6 @@ elf64_alpha_relax_section (bfd *abfd, asection *sec, } } - if (!elf64_alpha_size_plt_section (link_info)) - return FALSE; - if (!elf64_alpha_size_got_sections (link_info)) - return FALSE; - if (!elf64_alpha_size_rela_got_section (link_info)) - return FALSE; - if (isymbuf != NULL && symtab_hdr->contents != (unsigned char *) isymbuf) { @@ -3896,9 +3930,11 @@ elf64_alpha_relocate_section_r (bfd *output_bfd ATTRIBUTE_UNUSED, unsigned long symtab_hdr_sh_info; Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; + struct elf_link_hash_entry **sym_hashes; bfd_boolean ret_val = TRUE; symtab_hdr_sh_info = elf_tdata (input_bfd)->symtab_hdr.sh_info; + sym_hashes = elf_sym_hashes (input_bfd); relend = relocs + input_section->reloc_count; for (rel = relocs; rel < relend; rel++) @@ -3908,7 +3944,7 @@ elf64_alpha_relocate_section_r (bfd *output_bfd ATTRIBUTE_UNUSED, asection *sec; unsigned long r_type; - r_type = ELF64_R_TYPE(rel->r_info); + r_type = ELF64_R_TYPE (rel->r_info); if (r_type >= R_ALPHA_max) { (*_bfd_error_handler) @@ -3919,22 +3955,49 @@ elf64_alpha_relocate_section_r (bfd *output_bfd ATTRIBUTE_UNUSED, continue; } - r_symndx = ELF64_R_SYM(rel->r_info); - /* The symbol associated with GPDISP and LITUSE is immaterial. Only the addend is significant. */ if (r_type == R_ALPHA_GPDISP || r_type == R_ALPHA_LITUSE) continue; + r_symndx = ELF64_R_SYM (rel->r_info); if (r_symndx < symtab_hdr_sh_info) { sym = local_syms + r_symndx; - if (ELF_ST_TYPE(sym->st_info) == STT_SECTION) - { - sec = local_sections[r_symndx]; - rel->r_addend += sec->output_offset + sym->st_value; - } + sec = local_sections[r_symndx]; } + else + { + struct elf_link_hash_entry *h; + + h = sym_hashes[r_symndx - symtab_hdr_sh_info]; + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) + continue; + + sym = NULL; + sec = h->root.u.def.section; + } + + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. */ + _bfd_clear_contents (elf64_alpha_howto_table + r_type, + input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + rel->r_addend += sec->output_offset; } return ret_val; @@ -4134,6 +4197,17 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info, gotent = h->got_entries; } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + addend = rel->r_addend; value += addend; @@ -4193,18 +4267,6 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info, goto default_reloc; case R_ALPHA_GPREL32: - /* If the target section was a removed linkonce section, - r_symndx will be zero. In this case, assume that the - switch will not be used, so don't fill it in. If we - do nothing here, we'll get relocation truncated messages, - due to the placement of the application above 4GB. */ - if (r_symndx == 0) - { - r = bfd_reloc_ok; - break; - } - /* FALLTHRU */ - case R_ALPHA_GPREL16: case R_ALPHA_GPRELLOW: if (dynamic_symbol_p) @@ -5145,9 +5207,9 @@ elf64_alpha_reloc_type_class (const Elf_Internal_Rela *rela) static const struct bfd_elf_special_section elf64_alpha_special_sections[] = { - { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL }, - { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".sbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL }, + { STRING_COMMA_LEN (".sdata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL }, + { NULL, 0, 0, 0, 0 } }; /* ECOFF swapping routines. These are used when dealing with the @@ -5231,12 +5293,15 @@ static const struct elf_size_info alpha_elf_size_info = #define ELF_ARCH bfd_arch_alpha #define ELF_MACHINE_CODE EM_ALPHA #define ELF_MAXPAGESIZE 0x10000 +#define ELF_COMMONPAGESIZE 0x2000 #define bfd_elf64_bfd_link_hash_table_create \ elf64_alpha_bfd_link_hash_table_create #define bfd_elf64_bfd_reloc_type_lookup \ elf64_alpha_bfd_reloc_type_lookup +#define bfd_elf64_bfd_reloc_name_lookup \ + elf64_alpha_bfd_reloc_name_lookup #define elf_info_to_howto \ elf64_alpha_info_to_howto @@ -5267,10 +5332,14 @@ static const struct elf_size_info alpha_elf_size_info = elf64_alpha_create_dynamic_sections #define elf_backend_adjust_dynamic_symbol \ elf64_alpha_adjust_dynamic_symbol +#define elf_backend_merge_symbol_attribute \ + elf64_alpha_merge_symbol_attribute #define elf_backend_always_size_sections \ elf64_alpha_always_size_sections #define elf_backend_size_dynamic_sections \ elf64_alpha_size_dynamic_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_relocate_section \ elf64_alpha_relocate_section #define elf_backend_finish_dynamic_symbol \ @@ -5305,6 +5374,8 @@ static const struct elf_size_info alpha_elf_size_info = #define TARGET_LITTLE_SYM bfd_elf64_alpha_freebsd_vec #undef TARGET_LITTLE_NAME #define TARGET_LITTLE_NAME "elf64-alpha-freebsd" +#undef ELF_OSABI +#define ELF_OSABI ELFOSABI_FREEBSD /* The kernel recognizes executables as valid only if they carry a "FreeBSD" label in the ELF header. So we put this label on all @@ -5319,7 +5390,7 @@ elf64_alpha_fbsd_post_process_headers (bfd * abfd, i_ehdrp = elf_elfheader (abfd); /* Put an ABI label supported by FreeBSD >= 4.1. */ - i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; + i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi; #ifdef OLD_FREEBSD_ABI_LABEL /* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard. */ memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8); diff --git a/bfd/elf64-gen.c b/bfd/elf64-gen.c index 49b8d9c5528..05a94f0650a 100644 --- a/bfd/elf64-gen.c +++ b/bfd/elf64-gen.c @@ -1,5 +1,5 @@ /* Generic support for 64-bit ELF - Copyright 1993, 1995, 1998, 1999, 2001, 2002, 2004, 2005 + Copyright 1993, 1995, 1998, 1999, 2001, 2002, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" @@ -94,6 +94,7 @@ elf64_generic_link_add_symbols (bfd *abfd, struct bfd_link_info *info) #define ELF_MACHINE_CODE EM_NONE #define ELF_MAXPAGESIZE 0x1 #define bfd_elf64_bfd_reloc_type_lookup bfd_default_reloc_type_lookup +#define bfd_elf64_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup #define bfd_elf64_bfd_link_add_symbols elf64_generic_link_add_symbols #define elf_info_to_howto elf_generic_info_to_howto #define elf_info_to_howto_rel elf_generic_info_to_howto_rel diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index 58798ae3794..1f9c7f1f66e 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -1,5 +1,5 @@ /* Support for HPPA 64-bit ELF - Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #include "alloca-conf.h" -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/hppa.h" @@ -204,12 +204,6 @@ static bfd_boolean elf64_hppa_finish_dynamic_symbol PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); -static int elf64_hppa_additional_program_headers - PARAMS ((bfd *)); - -static bfd_boolean elf64_hppa_modify_segment_map - PARAMS ((bfd *, struct bfd_link_info *)); - static enum elf_reloc_type_class elf64_hppa_reloc_type_class PARAMS ((const Elf_Internal_Rela *)); @@ -523,12 +517,12 @@ get_reloc_section (abfd, hppa_info, sec) if (srel_name == NULL) return FALSE; - BFD_ASSERT ((strncmp (srel_name, ".rela", 5) == 0 + BFD_ASSERT ((CONST_STRNEQ (srel_name, ".rela") && strcmp (bfd_get_section_name (abfd, sec), - srel_name+5) == 0) - || (strncmp (srel_name, ".rel", 4) == 0 + srel_name + 5) == 0) + || (CONST_STRNEQ (srel_name, ".rel") && strcmp (bfd_get_section_name (abfd, sec), - srel_name+4) == 0)); + srel_name + 4) == 0)); dynobj = hppa_info->root.dynobj; if (!dynobj) @@ -1204,16 +1198,9 @@ elf64_hppa_post_process_headers (abfd, link_info) Elf_Internal_Ehdr * i_ehdrp; i_ehdrp = elf_elfheader (abfd); - - if (strcmp (bfd_get_target (abfd), "elf64-hppa-linux") == 0) - { - i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_LINUX; - } - else - { - i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_HPUX; - i_ehdrp->e_ident[EI_ABIVERSION] = 1; - } + + i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi; + i_ehdrp->e_ident[EI_ABIVERSION] = 1; } /* Create function descriptor section (.opd). This section is called .opd @@ -1719,13 +1706,13 @@ elf64_hppa_size_dynamic_sections (output_bfd, info) plt = s->size != 0; } else if (strcmp (name, ".opd") == 0 - || strncmp (name, ".dlt", 4) == 0 + || CONST_STRNEQ (name, ".dlt") || strcmp (name, ".stub") == 0 || strcmp (name, ".got") == 0) { /* Strip this section if we don't need it; see the comment below. */ } - else if (strncmp (name, ".rela", 5) == 0) + else if (CONST_STRNEQ (name, ".rela")) { if (s->size != 0) { @@ -2617,8 +2604,8 @@ elf64_hppa_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) existence of a .interp section. */ static int -elf64_hppa_additional_program_headers (abfd) - bfd *abfd; +elf64_hppa_additional_program_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { asection *s; @@ -2644,9 +2631,8 @@ elf64_hppa_additional_program_headers (abfd) existence of a .interp section. */ static bfd_boolean -elf64_hppa_modify_segment_map (abfd, info) - bfd *abfd; - struct bfd_link_info *info ATTRIBUTE_UNUSED; +elf64_hppa_modify_segment_map (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { struct elf_segment_map *m; asection *s; @@ -2759,14 +2745,14 @@ elf64_hppa_section_from_phdr (bfd *abfd, Elf_Internal_Phdr *hdr, int index, static const struct bfd_elf_special_section elf64_hppa_special_sections[] = { - { ".fini", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".init", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".plt", 4, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT }, - { ".dlt", 4, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT }, - { ".sdata", 6, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT }, - { ".sbss", 5, 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT }, - { ".tbss", 5, 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_HP_TLS }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".fini"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".init"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".plt"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT }, + { STRING_COMMA_LEN (".dlt"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT }, + { STRING_COMMA_LEN (".sdata"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT }, + { STRING_COMMA_LEN (".sbss"), 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT }, + { STRING_COMMA_LEN (".tbss"), 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_HP_TLS }, + { NULL, 0, 0, 0, 0 } }; /* The hash bucket size is the standard one, namely 4. */ @@ -2807,7 +2793,10 @@ const struct elf_size_info hppa64_elf_size_info = /* This is not strictly correct. The maximum page size for PA2.0 is 64M. But everything still uses 4k. */ #define ELF_MAXPAGESIZE 0x1000 +#define ELF_OSABI ELFOSABI_HPUX + #define bfd_elf64_bfd_reloc_type_lookup elf_hppa_reloc_type_lookup +#define bfd_elf64_bfd_reloc_name_lookup elf_hppa_reloc_name_lookup #define bfd_elf64_bfd_is_local_label_name elf_hppa_is_local_label_name #define elf_info_to_howto elf_hppa_info_to_howto #define elf_info_to_howto_rel elf_hppa_info_to_howto_rel @@ -2827,6 +2816,8 @@ const struct elf_size_info hppa64_elf_size_info = elf64_hppa_create_dynamic_sections #define elf_backend_post_process_headers elf64_hppa_post_process_headers +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_adjust_dynamic_symbol \ elf64_hppa_adjust_dynamic_symbol @@ -2871,12 +2862,19 @@ const struct elf_size_info hppa64_elf_size_info = #define elf_backend_action_discarded elf_hppa_action_discarded #define elf_backend_section_from_phdr elf64_hppa_section_from_phdr +#define elf64_bed elf64_hppa_hpux_bed + #include "elf64-target.h" #undef TARGET_BIG_SYM #define TARGET_BIG_SYM bfd_elf64_hppa_linux_vec #undef TARGET_BIG_NAME #define TARGET_BIG_NAME "elf64-hppa-linux" +#undef ELF_OSABI +#define ELF_OSABI ELFOSABI_LINUX +#undef elf_backend_post_process_headers +#define elf_backend_post_process_headers _bfd_elf_set_osabi +#undef elf64_bed +#define elf64_bed elf64_hppa_linux_bed -#define INCLUDED_TARGET_FILE 1 #include "elf64-target.h" diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c index c8f3127e3c9..e64b50caed0 100644 --- a/bfd/elf64-mips.c +++ b/bfd/elf64-mips.c @@ -1,6 +1,6 @@ /* MIPS-specific support for 64-bit ELF - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2007 Free Software Foundation, Inc. Ian Lance Taylor, Cygnus Support Linker support added by Mark Mitchell, CodeSourcery, LLC. @@ -40,8 +40,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. . the OldABI version is still lying around and should be removed. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "aout/ar.h" #include "bfdlink.h" @@ -112,8 +112,6 @@ static bfd_reloc_status_type mips_elf64_gprel32_reloc (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips_elf64_shift6_reloc (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); -static bfd_reloc_status_type mips16_jump_reloc - (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips16_gprel_reloc (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_boolean mips_elf64_assign_gp @@ -791,6 +789,21 @@ static reloc_howto_type mips_elf64_howto_table_rel[] = 0x0000ffff, /* src_mask */ 0x0000ffff, /* dst_mask */ FALSE), /* pcrel_offset */ + + /* 32 bit relocation with no addend. */ + HOWTO (R_MIPS_GLOB_DAT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GLOB_DAT", /* name */ + FALSE, /* partial_inplace */ + 0x0, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ }; /* The relocation table used for SHT_RELA sections. */ @@ -1314,7 +1327,20 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = EMPTY_HOWTO (R_MIPS_TLS_DTPMOD32), EMPTY_HOWTO (R_MIPS_TLS_DTPREL32), EMPTY_HOWTO (R_MIPS_TLS_DTPMOD64), - EMPTY_HOWTO (R_MIPS_TLS_DTPREL64), + + HOWTO (R_MIPS_TLS_DTPREL64, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_TLS_DTPREL64", /* name */ + TRUE, /* partial_inplace */ + MINUS_ONE, /* src_mask */ + MINUS_ONE, /* dst_mask */ + FALSE), /* pcrel_offset */ /* TLS general dynamic variable reference. */ HOWTO (R_MIPS_TLS_GD, /* type */ @@ -1423,6 +1449,21 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = 0x0000ffff, /* src_mask */ 0x0000ffff, /* dst_mask */ FALSE), /* pcrel_offset */ + + /* 32 bit relocation with no addend. */ + HOWTO (R_MIPS_GLOB_DAT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GLOB_DAT", /* name */ + FALSE, /* partial_inplace */ + 0x0, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ }; static reloc_howto_type mips16_elf64_howto_table_rel[] = @@ -1438,7 +1479,7 @@ static reloc_howto_type mips16_elf64_howto_table_rel[] = /* This needs complex overflow detection, because the upper four bits must match the PC. */ - mips16_jump_reloc, /* special_function */ + _bfd_mips_elf_generic_reloc, /* special_function */ "R_MIPS16_26", /* name */ TRUE, /* partial_inplace */ 0x3ffffff, /* src_mask */ @@ -1510,7 +1551,7 @@ static reloc_howto_type mips16_elf64_howto_table_rela[] = /* This needs complex overflow detection, because the upper four bits must match the PC. */ - mips16_jump_reloc, /* special_function */ + _bfd_mips_elf_generic_reloc, /* special_function */ "R_MIPS16_26", /* name */ FALSE, /* partial_inplace */ 0x3ffffff, /* src_mask */ @@ -2044,37 +2085,6 @@ mips_elf64_shift6_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, error_message); } -/* Handle a mips16 jump. */ - -static bfd_reloc_status_type -mips16_jump_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry, - asymbol *symbol, void *data ATTRIBUTE_UNUSED, - asection *input_section, bfd *output_bfd, - char **error_message ATTRIBUTE_UNUSED) -{ - if (output_bfd != NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && (! reloc_entry->howto->partial_inplace - || reloc_entry->addend == 0)) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - /* FIXME. */ - { - static bfd_boolean warned; - - if (! warned) - (*_bfd_error_handler) - (_("Linking mips16 objects into %s format is not supported"), - bfd_get_target (input_section->output_section->owner)); - warned = TRUE; - } - - return bfd_reloc_undefined; -} - /* Handle a mips16 GP relative reloc. */ static bfd_reloc_status_type @@ -2227,6 +2237,39 @@ bfd_elf64_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, } } +static reloc_howto_type * +bfd_elf64_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (mips_elf64_howto_table_rela) + / sizeof (mips_elf64_howto_table_rela[0])); i++) + if (mips_elf64_howto_table_rela[i].name != NULL + && strcasecmp (mips_elf64_howto_table_rela[i].name, r_name) == 0) + return &mips_elf64_howto_table_rela[i]; + + for (i = 0; + i < (sizeof (mips16_elf64_howto_table_rela) + / sizeof (mips16_elf64_howto_table_rela[0])); + i++) + if (mips16_elf64_howto_table_rela[i].name != NULL + && strcasecmp (mips16_elf64_howto_table_rela[i].name, r_name) == 0) + return &mips16_elf64_howto_table_rela[i]; + + if (strcasecmp (elf_mips_gnu_vtinherit_howto.name, r_name) == 0) + return &elf_mips_gnu_vtinherit_howto; + if (strcasecmp (elf_mips_gnu_vtentry_howto.name, r_name) == 0) + return &elf_mips_gnu_vtentry_howto; + if (strcasecmp (elf_mips_gnu_rel16_s2.name, r_name) == 0) + return &elf_mips_gnu_rel16_s2; + if (strcasecmp (elf_mips_gnu_rela16_s2.name, r_name) == 0) + return &elf_mips_gnu_rela16_s2; + + return NULL; +} + /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure. */ static reloc_howto_type * @@ -3059,12 +3102,15 @@ const struct elf_size_info mips_elf64_size_info = #define elf_backend_create_dynamic_sections \ _bfd_mips_elf_create_dynamic_sections #define elf_backend_check_relocs _bfd_mips_elf_check_relocs +#define elf_backend_merge_symbol_attribute \ + _bfd_mips_elf_merge_symbol_attribute #define elf_backend_adjust_dynamic_symbol \ _bfd_mips_elf_adjust_dynamic_symbol #define elf_backend_always_size_sections \ _bfd_mips_elf_always_size_sections #define elf_backend_size_dynamic_sections \ _bfd_mips_elf_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_relocate_section _bfd_mips_elf_relocate_section #define elf_backend_finish_dynamic_symbol \ _bfd_mips_elf_finish_dynamic_symbol @@ -3152,10 +3198,8 @@ extern bfd_boolean bfd_elf64_archive_write_armap #define TARGET_BIG_SYM bfd_elf64_bigmips_vec #define TARGET_BIG_NAME "elf64-bigmips" -/* The SVR4 MIPS ABI says that this should be 0x10000, but Irix 5 uses - a value of 0x1000, and we are compatible. - FIXME: How does this affect NewABI? */ -#define ELF_MAXPAGESIZE 0x1000 +#define ELF_MAXPAGESIZE 0x10000 +#define ELF_COMMONPAGESIZE 0x1000 #include "elf64-target.h" @@ -3166,15 +3210,15 @@ extern bfd_boolean bfd_elf64_archive_write_armap #undef TARGET_BIG_NAME #undef ELF_MAXPAGESIZE +#undef ELF_COMMONPAGESIZE #define TARGET_LITTLE_SYM bfd_elf64_tradlittlemips_vec #define TARGET_LITTLE_NAME "elf64-tradlittlemips" #define TARGET_BIG_SYM bfd_elf64_tradbigmips_vec #define TARGET_BIG_NAME "elf64-tradbigmips" -/* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses - page sizes of up to that limit, so we need to respect it. */ #define ELF_MAXPAGESIZE 0x10000 +#define ELF_COMMONPAGESIZE 0x1000 #define elf64_bed elf64_tradbed /* Include the target file again for this target. */ diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c index 6f88fe102f5..3f75042469a 100644 --- a/bfd/elf64-mmix.c +++ b/bfd/elf64-mmix.c @@ -1,5 +1,6 @@ /* MMIX-specific support for 64-bit ELF. - Copyright 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Contributed by Hans-Peter Nilsson This file is part of BFD, the Binary File Descriptor library. @@ -26,8 +27,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. - GETA stub relaxation (call a stub for out of range new R_MMIX_GETA_STUBBABLE). */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/mmix.h" @@ -186,14 +187,6 @@ static bfd_boolean mmix_elf_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); -static asection * mmix_elf_gc_mark_hook - PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *)); - -static bfd_boolean mmix_elf_gc_sweep_hook - PARAMS ((bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *)); - static bfd_reloc_status_type mmix_final_link_relocate PARAMS ((reloc_howto_type *, asection *, bfd_byte *, bfd_vma, bfd_signed_vma, bfd_vma, const char *, asection *)); @@ -855,18 +848,37 @@ bfd_elf64_bfd_reloc_type_lookup (abfd, code) return NULL; } +static reloc_howto_type * +bfd_elf64_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (elf_mmix_howto_table) / sizeof (elf_mmix_howto_table[0]); + i++) + if (elf_mmix_howto_table[i].name != NULL + && strcasecmp (elf_mmix_howto_table[i].name, r_name) == 0) + return &elf_mmix_howto_table[i]; + + return NULL; +} + static bfd_boolean mmix_elf_new_section_hook (abfd, sec) bfd *abfd; asection *sec; { - struct _mmix_elf_section_data *sdata; - bfd_size_type amt = sizeof (*sdata); + if (!sec->used_by_bfd) + { + struct _mmix_elf_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); - sdata = (struct _mmix_elf_section_data *) bfd_zalloc (abfd, amt); - if (sdata == NULL) - return FALSE; - sec->used_by_bfd = (PTR) sdata; + sdata = bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = sdata; + } return _bfd_elf_new_section_hook (abfd, sec); } @@ -1369,22 +1381,53 @@ mmix_elf_relocate_section (output_bfd, info, input_bfd, input_section, r_symndx = ELF64_R_SYM (rel->r_info); + howto = elf_mmix_howto_table + ELF64_R_TYPE (rel->r_info); + h = NULL; + sym = NULL; + sec = NULL; + + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + sec = local_sections [r_symndx]; + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); + + name = bfd_elf_string_from_elf_section (input_bfd, + symtab_hdr->sh_link, + sym->st_name); + if (name == NULL) + name = bfd_section_name (input_bfd, sec); + } + else + { + bfd_boolean unresolved_reloc; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, + unresolved_reloc, undefined_signalled); + name = h->root.root.string; + } + + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + if (info->relocatable) { /* This is a relocatable link. For most relocs we don't have to change anything, unless the reloc is against a section symbol, in which case we have to adjust according to where the section symbol winds up in the output section. */ - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - - if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - { - sec = local_sections [r_symndx]; - rel->r_addend += sec->output_offset + sym->st_value; - } - } + if (sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + rel->r_addend += sec->output_offset; /* For PUSHJ stub relocs however, we may need to change the reloc and the section contents, if the reloc doesn't reach @@ -1458,35 +1501,6 @@ mmix_elf_relocate_section (output_bfd, info, input_bfd, input_section, continue; } - /* This is a final link. */ - howto = elf_mmix_howto_table + ELF64_R_TYPE (rel->r_info); - h = NULL; - sym = NULL; - sec = NULL; - - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - sec = local_sections [r_symndx]; - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - - name = bfd_elf_string_from_elf_section (input_bfd, - symtab_hdr->sh_link, - sym->st_name); - if (name == NULL) - name = bfd_section_name (input_bfd, sec); - } - else - { - bfd_boolean unresolved_reloc; - - RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, - r_symndx, symtab_hdr, sym_hashes, - h, sec, relocation, - unresolved_reloc, undefined_signalled); - name = h->root.root.string; - } - r = mmix_final_link_relocate (howto, input_section, contents, rel->r_offset, rel->r_addend, relocation, name, sec); @@ -1740,40 +1754,21 @@ mmix_final_link_relocate (howto, input_section, contents, relocation. */ static asection * -mmix_elf_gc_mark_hook (sec, info, rel, h, sym) - asection *sec; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +mmix_elf_gc_mark_hook (asection *sec, + struct bfd_link_info *info, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF64_R_TYPE (rel->r_info)) - { - case R_MMIX_GNU_VTINHERIT: - case R_MMIX_GNU_VTENTRY: - break; + switch (ELF64_R_TYPE (rel->r_info)) + { + case R_MMIX_GNU_VTINHERIT: + case R_MMIX_GNU_VTENTRY: + return NULL; + } - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Update relocation info for a GC-excluded section. We could supposedly @@ -1782,11 +1777,10 @@ mmix_elf_gc_mark_hook (sec, info, rel, h, sym) present. Better to waste some memory and (perhaps) a little time. */ static bfd_boolean -mmix_elf_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - asection *sec ATTRIBUTE_UNUSED; - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED; +mmix_elf_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + asection *sec, + const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED) { struct bpo_reloc_section_info *bpodata = mmix_elf_section_data (sec)->bpo.reloc; @@ -2189,8 +2183,7 @@ mmix_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) (*secp)->flags |= SEC_LINKER_CREATED; } else if ((*namep)[0] == '_' && (*namep)[1] == '_' && (*namep)[2] == '.' - && strncmp (*namep, MMIX_LOC_SECTION_START_SYMBOL_PREFIX, - strlen (MMIX_LOC_SECTION_START_SYMBOL_PREFIX)) == 0) + && CONST_STRNEQ (*namep, MMIX_LOC_SECTION_START_SYMBOL_PREFIX)) { /* See if we have another one. */ struct bfd_link_hash_entry *h = bfd_link_hash_lookup (info->hash, @@ -2941,6 +2934,8 @@ mmix_elf_relax_section (abfd, sec, link_info, again) #define elf_backend_check_relocs mmix_elf_check_relocs #define elf_backend_symbol_processing mmix_elf_symbol_processing +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define bfd_elf64_bfd_is_local_label_name \ mmix_elf_is_local_label_name diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 33327f44cba..0e4f725d1ff 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -1,5 +1,5 @@ /* PowerPC64-specific support for 64-bit ELF. - Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Linus Nordberg, Swox AB , based on elf32-ppc.c by Ian Lance Taylor. @@ -25,8 +25,9 @@ http://www.linuxbase.org/spec/ELF/ppc64/PPC-elf64abi.txt, and http://www.linuxbase.org/spec/ELF/ppc64/spec/book1.html */ -#include "bfd.h" #include "sysdep.h" +#include +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -61,6 +62,7 @@ static bfd_vma opd_entry_value #define ELF_ARCH bfd_arch_powerpc #define ELF_MACHINE_CODE EM_PPC64 #define ELF_MAXPAGESIZE 0x10000 +#define ELF_COMMONPAGESIZE 0x1000 #define elf_info_to_howto ppc64_elf_info_to_howto #define elf_backend_want_got_sym 0 @@ -71,9 +73,11 @@ static bfd_vma opd_entry_value #define elf_backend_can_gc_sections 1 #define elf_backend_can_refcount 1 #define elf_backend_rela_normal 1 +#define elf_backend_default_execstack 0 #define bfd_elf64_mkobject ppc64_elf_mkobject #define bfd_elf64_bfd_reloc_type_lookup ppc64_elf_reloc_type_lookup +#define bfd_elf64_bfd_reloc_name_lookup ppc64_elf_reloc_name_lookup #define bfd_elf64_bfd_merge_private_bfd_data ppc64_elf_merge_private_bfd_data #define bfd_elf64_new_section_hook ppc64_elf_new_section_hook #define bfd_elf64_bfd_link_hash_table_create ppc64_elf_link_hash_table_create @@ -83,10 +87,12 @@ static bfd_vma opd_entry_value #define elf_backend_object_p ppc64_elf_object_p #define elf_backend_grok_prstatus ppc64_elf_grok_prstatus #define elf_backend_grok_psinfo ppc64_elf_grok_psinfo +#define elf_backend_write_core_note ppc64_elf_write_core_note #define elf_backend_create_dynamic_sections ppc64_elf_create_dynamic_sections #define elf_backend_copy_indirect_symbol ppc64_elf_copy_indirect_symbol #define elf_backend_add_symbol_hook ppc64_elf_add_symbol_hook #define elf_backend_check_directives ppc64_elf_check_directives +#define elf_backend_as_needed_cleanup ppc64_elf_as_needed_cleanup #define elf_backend_archive_symbol_lookup ppc64_elf_archive_symbol_lookup #define elf_backend_check_relocs ppc64_elf_check_relocs #define elf_backend_gc_mark_dynamic_ref ppc64_elf_gc_mark_dynamic_ref @@ -96,6 +102,7 @@ static bfd_vma opd_entry_value #define elf_backend_hide_symbol ppc64_elf_hide_symbol #define elf_backend_always_size_sections ppc64_elf_func_desc_adjust #define elf_backend_size_dynamic_sections ppc64_elf_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_2_index_sections #define elf_backend_action_discarded ppc64_elf_action_discarded #define elf_backend_relocate_section ppc64_elf_relocate_section #define elf_backend_finish_dynamic_symbol ppc64_elf_finish_dynamic_symbol @@ -134,30 +141,29 @@ static bfd_vma opd_entry_value #define BCTR 0x4e800420 /* bctr */ +#define ADDIS_R12_R12 0x3d8c0000 /* addis %r12,%r12,off@ha */ #define ADDIS_R2_R2 0x3c420000 /* addis %r2,%r2,off@ha */ #define ADDI_R2_R2 0x38420000 /* addi %r2,%r2,off@l */ #define LD_R2_40R1 0xe8410028 /* ld %r2,40(%r1) */ -/* glink call stub instructions. We enter with the index in R0, and the - address of glink entry in CTR. From that, we can calculate PLT0. */ +/* glink call stub instructions. We enter with the index in R0. */ #define GLINK_CALL_STUB_SIZE (16*4) -#define MFCTR_R12 0x7d8902a6 /* mfctr %r12 */ -#define SLDI_R11_R0_3 0x780b1f24 /* sldi %r11,%r0,3 */ -#define ADDIC_R2_R0_32K 0x34408000 /* addic. %r2,%r0,-32768 */ -#define SUB_R12_R12_R11 0x7d8b6050 /* sub %r12,%r12,%r11 */ -#define SRADI_R2_R2_63 0x7c42fe76 /* sradi %r2,%r2,63 */ -#define SLDI_R11_R0_2 0x780b1764 /* sldi %r11,%r0,2 */ -#define AND_R2_R2_R11 0x7c425838 /* and %r2,%r2,%r11 */ - /* sub %r12,%r12,%r11 */ -#define ADD_R12_R12_R2 0x7d8c1214 /* add %r12,%r12,%r2 */ -#define ADDIS_R12_R12 0x3d8c0000 /* addis %r12,%r12,xxx@ha */ - /* ld %r11,xxx@l(%r12) */ -#define ADDI_R12_R12 0x398c0000 /* addi %r12,%r12,xxx@l */ - /* ld %r2,8(%r12) */ - /* mtctr %r11 */ - /* ld %r11,16(%r12) */ - /* bctr */ + /* 0: */ + /* .quad plt0-1f */ + /* __glink: */ +#define MFLR_R12 0x7d8802a6 /* mflr %12 */ +#define BCL_20_31 0x429f0005 /* bcl 20,31,1f */ + /* 1: */ +#define MFLR_R11 0x7d6802a6 /* mflr %11 */ +#define LD_R2_M16R11 0xe84bfff0 /* ld %2,(0b-1b)(%11) */ +#define MTLR_R12 0x7d8803a6 /* mtlr %12 */ +#define ADD_R12_R2_R11 0x7d825a14 /* add %12,%2,%11 */ + /* ld %11,0(%12) */ + /* ld %2,8(%12) */ + /* mtctr %11 */ + /* ld %11,16(%12) */ + /* bctr */ /* Pad with this. */ #define NOP 0x60000000 @@ -1193,7 +1199,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { /* Like R_PPC64_PLTGOT16, but for instructions with a DS field. */ /* FIXME: R_PPC64_PLTGOT16_DS not implemented. */ - HOWTO (R_PPC64_PLTGOT16_DS, /* type */ + HOWTO (R_PPC64_PLTGOT16_DS, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ @@ -2106,6 +2112,22 @@ ppc64_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return ppc64_elf_howto_table[r]; }; +static reloc_howto_type * +ppc64_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (ppc64_elf_howto_raw) / sizeof (ppc64_elf_howto_raw[0]); + i++) + if (ppc64_elf_howto_raw[i].name != NULL + && strcasecmp (ppc64_elf_howto_raw[i].name, r_name) == 0) + return &ppc64_elf_howto_raw[i]; + + return NULL; +} + /* Set the howto pointer for a PowerPC ELF reloc. */ static void @@ -2376,14 +2398,9 @@ struct ppc64_elf_obj_tdata asection *got; asection *relgot; - union { - /* Used during garbage collection. We attach global symbols defined - on removed .opd entries to this section so that the sym is removed. */ - asection *deleted_section; - - /* Used when adding symbols. */ - bfd_boolean has_dotsym; - } u; + /* Used during garbage collection. We attach global symbols defined + on removed .opd entries to this section so that the sym is removed. */ + asection *deleted_section; /* TLS local dynamic got entry handling. Suppose for multiple GOT sections means we potentially need one of these for each input bfd. */ @@ -2407,11 +2424,14 @@ struct ppc64_elf_obj_tdata static bfd_boolean ppc64_elf_mkobject (bfd *abfd) { - bfd_size_type amt = sizeof (struct ppc64_elf_obj_tdata); - abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) - return FALSE; - return TRUE; + { + bfd_size_type amt = sizeof (struct ppc64_elf_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + } + return bfd_elf_mkobject (abfd); } /* Return 1 if target is one of ours. */ @@ -2484,6 +2504,53 @@ ppc64_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) return TRUE; } +static char * +ppc64_elf_write_core_note (bfd *abfd, char *buf, int *bufsiz, int note_type, + ...) +{ + switch (note_type) + { + default: + return NULL; + + case NT_PRPSINFO: + { + char data[136]; + va_list ap; + + va_start (ap, note_type); + memset (data, 0, 40); + strncpy (data + 40, va_arg (ap, const char *), 16); + strncpy (data + 56, va_arg (ap, const char *), 80); + va_end (ap); + return elfcore_write_note (abfd, buf, bufsiz, + "CORE", note_type, data, sizeof (data)); + } + + case NT_PRSTATUS: + { + char data[504]; + va_list ap; + long pid; + int cursig; + const void *greg; + + va_start (ap, note_type); + memset (data, 0, 112); + pid = va_arg (ap, long); + bfd_put_32 (abfd, pid, data + 32); + cursig = va_arg (ap, int); + bfd_put_16 (abfd, cursig, data + 12); + greg = va_arg (ap, const void *); + memcpy (data + 112, greg, 384); + memset (data + 496, 0, 8); + va_end (ap); + return elfcore_write_note (abfd, buf, bufsiz, + "CORE", note_type, data, sizeof (data)); + } + } +} + /* Merge backend specific data from an object file to the output object file when linking. */ @@ -2517,13 +2584,19 @@ ppc64_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd) static const struct bfd_elf_special_section ppc64_elf_special_sections[]= { - { ".plt", 4, 0, SHT_NOBITS, 0 }, - { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, - { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".toc", 4, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".toc1", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".tocbss", 7, 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".plt"), 0, SHT_NOBITS, 0 }, + { STRING_COMMA_LEN (".sbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".sdata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".toc"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".toc1"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".tocbss"), 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, + { NULL, 0, 0, 0, 0 } +}; + +enum _ppc64_sec_type { + sec_normal = 0, + sec_opd = 1, + sec_toc = 2 }; struct _ppc64_elf_section_data @@ -2534,14 +2607,20 @@ struct _ppc64_elf_section_data union { /* Points to the function code section for local opd entries. */ - asection **func_sec; + asection **opd_func_sec; /* After editing .opd, adjust references to opd local syms. */ - long *adjust; - } opd; + long *opd_adjust; - /* An array for toc sections, indexed by offset/8. - Specifies the relocation symbol index used at a given toc offset. */ - unsigned *t_symndx; + /* An array for toc sections, indexed by offset/8. + Specifies the relocation symbol index used at a given toc offset. */ + unsigned *t_symndx; + } u; + + enum _ppc64_sec_type sec_type:2; + + /* Flag set when small branches are detected. Used to + select suitable defaults for the stub group size. */ + unsigned int has_14bit_branch:1; }; #define ppc64_elf_section_data(sec) \ @@ -2550,13 +2629,16 @@ struct _ppc64_elf_section_data static bfd_boolean ppc64_elf_new_section_hook (bfd *abfd, asection *sec) { - struct _ppc64_elf_section_data *sdata; - bfd_size_type amt = sizeof (*sdata); + if (!sec->used_by_bfd) + { + struct _ppc64_elf_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); - sdata = bfd_zalloc (abfd, amt); - if (sdata == NULL) - return FALSE; - sec->used_by_bfd = sdata; + sdata = bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = sdata; + } return _bfd_elf_new_section_hook (abfd, sec); } @@ -2566,8 +2648,8 @@ get_opd_info (asection * sec) { if (sec != NULL && ppc64_elf_section_data (sec) != NULL - && ppc64_elf_section_data (sec)->opd.adjust != NULL) - return ppc64_elf_section_data (sec)->opd.adjust; + && ppc64_elf_section_data (sec)->sec_type == sec_opd) + return ppc64_elf_section_data (sec)->u.opd_adjust; return NULL; } @@ -3234,9 +3316,14 @@ struct ppc_link_hash_entry { struct elf_link_hash_entry elf; - /* A pointer to the most recently used stub hash entry against this - symbol. */ - struct ppc_stub_hash_entry *stub_cache; + union { + /* A pointer to the most recently used stub hash entry against this + symbol. */ + struct ppc_stub_hash_entry *stub_cache; + + /* A pointer to the next symbol starting with a '.' */ + struct ppc_link_hash_entry *next_dot_sym; + } u; /* Track dynamic relocs copied for this symbol. */ struct ppc_dyn_relocs *dyn_relocs; @@ -3314,6 +3401,9 @@ struct ppc_link_hash_table /* Highest output section index. */ int top_index; + /* Used when adding symbols. */ + struct ppc_link_hash_entry *dot_syms; + /* List of input sections for each output section. */ asection **input_list; @@ -3348,10 +3438,6 @@ struct ppc_link_hash_table /* Set on error. */ unsigned int stub_error:1; - /* Flag set when small branches are detected. Used to - select suitable defaults for the stub group size. */ - unsigned int has_14bit_branch:1; - /* Temp used by ppc64_elf_check_directives. */ unsigned int twiddled_syms:1; @@ -3470,9 +3556,34 @@ link_hash_newfunc (struct bfd_hash_entry *entry, { struct ppc_link_hash_entry *eh = (struct ppc_link_hash_entry *) entry; - memset (&eh->stub_cache, 0, + memset (&eh->u.stub_cache, 0, (sizeof (struct ppc_link_hash_entry) - - offsetof (struct ppc_link_hash_entry, stub_cache))); + - offsetof (struct ppc_link_hash_entry, u.stub_cache))); + + /* When making function calls, old ABI code references function entry + points (dot symbols), while new ABI code references the function + descriptor symbol. We need to make any combination of reference and + definition work together, without breaking archive linking. + + For a defined function "foo" and an undefined call to "bar": + An old object defines "foo" and ".foo", references ".bar" (possibly + "bar" too). + A new object defines "foo" and references "bar". + + A new object thus has no problem with its undefined symbols being + satisfied by definitions in an old object. On the other hand, the + old object won't have ".bar" satisfied by a new object. + + Keep a list of newly added dot-symbols. */ + + if (string[0] == '.') + { + struct ppc_link_hash_table *htab; + + htab = (struct ppc_link_hash_table *) table; + eh->u.next_dot_sym = htab->dot_syms; + htab->dot_syms = eh; + } } return entry; @@ -3618,11 +3729,11 @@ ppc_get_stub_entry (const asection *input_section, distinguish between them. */ id_sec = htab->stub_group[input_section->id].link_sec; - if (h != NULL && h->stub_cache != NULL - && h->stub_cache->h == h - && h->stub_cache->id_sec == id_sec) + if (h != NULL && h->u.stub_cache != NULL + && h->u.stub_cache->h == h + && h->u.stub_cache->id_sec == id_sec) { - stub_entry = h->stub_cache; + stub_entry = h->u.stub_cache; } else { @@ -3635,7 +3746,7 @@ ppc_get_stub_entry (const asection *input_section, stub_entry = ppc_stub_hash_lookup (&htab->stub_hash_table, stub_name, FALSE, FALSE); if (h != NULL) - h->stub_cache = stub_entry; + h->u.stub_cache = stub_entry; free (stub_name); } @@ -3721,49 +3832,26 @@ create_linkage_sections (bfd *dynobj, struct bfd_link_info *info) htab->glink = bfd_make_section_anyway_with_flags (dynobj, ".glink", flags); if (htab->glink == NULL - || ! bfd_set_section_alignment (dynobj, htab->glink, 2)) + || ! bfd_set_section_alignment (dynobj, htab->glink, 3)) return FALSE; /* Create branch lookup table for plt_branch stubs. */ - if (info->shared) - { - flags = (SEC_ALLOC | SEC_LOAD - | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); - htab->brlt - = bfd_make_section_anyway_with_flags (dynobj, ".data.rel.ro.brlt", - flags); - } - else - { - flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY - | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); - htab->brlt - = bfd_make_section_anyway_with_flags (dynobj, ".rodata.brlt", flags); - } - + flags = (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); + htab->brlt = bfd_make_section_anyway_with_flags (dynobj, ".branch_lt", + flags); if (htab->brlt == NULL || ! bfd_set_section_alignment (dynobj, htab->brlt, 3)) return FALSE; - if (info->shared) - { - flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY - | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); - htab->relbrlt - = bfd_make_section_anyway_with_flags (dynobj, ".rela.data.rel.ro.brlt", - flags); - } - else if (info->emitrelocations) - { - flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY - | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); - htab->relbrlt - = bfd_make_section_anyway_with_flags (dynobj, ".rela.rodata.brlt", - flags); - } - else + if (!info->shared) return TRUE; + flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY + | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); + htab->relbrlt = bfd_make_section_anyway_with_flags (dynobj, + ".rela.branch_lt", + flags); if (!htab->relbrlt || ! bfd_set_section_alignment (dynobj, htab->relbrlt, 3)) return FALSE; @@ -4044,29 +4132,14 @@ make_fdh (struct bfd_link_info *info, return fdh; } -/* Hacks to support old ABI code. - When making function calls, old ABI code references function entry - points (dot symbols), while new ABI code references the function - descriptor symbol. We need to make any combination of reference and - definition work together, without breaking archive linking. - - For a defined function "foo" and an undefined call to "bar": - An old object defines "foo" and ".foo", references ".bar" (possibly - "bar" too). - A new object defines "foo" and references "bar". - - A new object thus has no problem with its undefined symbols being - satisfied by definitions in an old object. On the other hand, the - old object won't have ".bar" satisfied by a new object. */ - /* Fix function descriptor symbols defined in .opd sections to be function type. */ static bfd_boolean -ppc64_elf_add_symbol_hook (bfd *ibfd, +ppc64_elf_add_symbol_hook (bfd *ibfd ATTRIBUTE_UNUSED, struct bfd_link_info *info ATTRIBUTE_UNUSED, Elf_Internal_Sym *isym, - const char **name, + const char **name ATTRIBUTE_UNUSED, flagword *flags ATTRIBUTE_UNUSED, asection **sec, bfd_vma *value ATTRIBUTE_UNUSED) @@ -4075,12 +4148,6 @@ ppc64_elf_add_symbol_hook (bfd *ibfd, && strcmp (bfd_get_section_name (ibfd, *sec), ".opd") == 0) isym->st_info = ELF_ST_INFO (ELF_ST_BIND (isym->st_info), STT_FUNC); - if ((*name)[0] == '.' - && ELF_ST_BIND (isym->st_info) == STB_GLOBAL - && ELF_ST_TYPE (isym->st_info) < STT_SECTION - && is_ppc64_elf_target (ibfd->xvec)) - ppc64_elf_tdata (ibfd)->u.has_dotsym = 1; - return TRUE; } @@ -4129,35 +4196,25 @@ ppc64_elf_archive_symbol_lookup (bfd *abfd, most restrictive visibility of the function descriptor and the function entry symbol is used. */ -struct add_symbol_adjust_data -{ - struct bfd_link_info *info; - bfd_boolean ok; -}; - static bfd_boolean -add_symbol_adjust (struct elf_link_hash_entry *h, void *inf) +add_symbol_adjust (struct ppc_link_hash_entry *eh, struct bfd_link_info *info) { - struct add_symbol_adjust_data *data; struct ppc_link_hash_table *htab; - struct ppc_link_hash_entry *eh; struct ppc_link_hash_entry *fdh; - if (h->root.type == bfd_link_hash_indirect) + if (eh->elf.root.type == bfd_link_hash_indirect) return TRUE; - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; + if (eh->elf.root.type == bfd_link_hash_warning) + eh = (struct ppc_link_hash_entry *) eh->elf.root.u.i.link; - if (h->root.root.string[0] != '.') - return TRUE; + if (eh->elf.root.root.string[0] != '.') + abort (); - data = inf; - htab = ppc_hash_table (data->info); - eh = (struct ppc_link_hash_entry *) h; + htab = ppc_hash_table (info); fdh = get_fdh (eh, htab); if (fdh == NULL - && !data->info->relocatable + && !info->relocatable && (eh->elf.root.type == bfd_link_hash_undefined || eh->elf.root.type == bfd_link_hash_undefweak) && eh->elf.ref_regular) @@ -4165,9 +4222,9 @@ add_symbol_adjust (struct elf_link_hash_entry *h, void *inf) /* Make an undefweak function descriptor sym, which is enough to pull in an --as-needed shared lib, but won't cause link errors. Archives are handled elsewhere. */ - fdh = make_fdh (data->info, eh); + fdh = make_fdh (info, eh); if (fdh == NULL) - data->ok = FALSE; + return FALSE; else fdh->elf.ref_regular = 1; } @@ -4193,26 +4250,37 @@ add_symbol_adjust (struct elf_link_hash_entry *h, void *inf) return TRUE; } +/* Process list of dot-symbols we made in link_hash_newfunc. */ + static bfd_boolean -ppc64_elf_check_directives (bfd *abfd, struct bfd_link_info *info) +ppc64_elf_check_directives (bfd *ibfd, struct bfd_link_info *info) { struct ppc_link_hash_table *htab; - struct add_symbol_adjust_data data; - - if (!is_ppc64_elf_target (abfd->xvec)) - return TRUE; - - if (!ppc64_elf_tdata (abfd)->u.has_dotsym) - return TRUE; - ppc64_elf_tdata (abfd)->u.deleted_section = NULL; + struct ppc_link_hash_entry **p, *eh; htab = ppc_hash_table (info); if (!is_ppc64_elf_target (htab->elf.root.creator)) return TRUE; - data.info = info; - data.ok = TRUE; - elf_link_hash_traverse (&htab->elf, add_symbol_adjust, &data); + if (is_ppc64_elf_target (ibfd->xvec)) + { + p = &htab->dot_syms; + while ((eh = *p) != NULL) + { + *p = NULL; + if (!add_symbol_adjust (eh, info)) + return FALSE; + p = &eh->u.next_dot_sym; + } + } + + /* Clear the list for non-ppc64 input files. */ + p = &htab->dot_syms; + while ((eh = *p) != NULL) + { + *p = NULL; + p = &eh->u.next_dot_sym; + } /* We need to fix the undefs list for any syms we have twiddled to undef_weak. */ @@ -4221,7 +4289,18 @@ ppc64_elf_check_directives (bfd *abfd, struct bfd_link_info *info) bfd_link_repair_undef_list (&htab->elf.root); htab->twiddled_syms = 0; } - return data.ok; + return TRUE; +} + +/* Undo hash table changes when an --as-needed input file is determined + not to be needed. */ + +static bfd_boolean +ppc64_elf_as_needed_cleanup (bfd *ibfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) +{ + ppc_hash_table (info)->dot_syms = NULL; + return TRUE; } static bfd_boolean @@ -4358,7 +4437,9 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, opd_sym_map = bfd_zalloc (abfd, amt); if (opd_sym_map == NULL) return FALSE; - ppc64_elf_section_data (sec)->opd.func_sec = opd_sym_map; + ppc64_elf_section_data (sec)->u.opd_func_sec = opd_sym_map; + BFD_ASSERT (ppc64_elf_section_data (sec)->sec_type == sec_normal); + ppc64_elf_section_data (sec)->sec_type = sec_opd; } if (htab->sfpr == NULL @@ -4372,6 +4453,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, struct elf_link_hash_entry *h; enum elf_ppc64_reloc_type r_type; int tls_type = 0; + struct _ppc64_elf_section_data *ppc64_sec; r_symndx = ELF64_R_SYM (rel->r_info); if (r_symndx < symtab_hdr->sh_info) @@ -4553,7 +4635,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, dest = bfd_section_from_r_symndx (abfd, &htab->sym_sec, sec, r_symndx); if (dest != sec) - htab->has_14bit_branch = 1; + ppc64_elf_section_data (sec)->has_14bit_branch = 1; } /* Fall through. */ @@ -4569,7 +4651,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, || h == &htab->tls_get_addr_fd->elf) sec->has_tls_reloc = 1; else if (htab->tls_get_addr == NULL - && !strncmp (h->root.root.string, ".__tls_get_addr", 15) + && CONST_STRNEQ (h->root.root.string, ".__tls_get_addr") && (h->root.root.string[15] == 0 || h->root.root.string[15] == '@')) { @@ -4577,7 +4659,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, sec->has_tls_reloc = 1; } else if (htab->tls_get_addr_fd == NULL - && !strncmp (h->root.root.string, "__tls_get_addr", 14) + && CONST_STRNEQ (h->root.root.string, "__tls_get_addr") && (h->root.root.string[14] == 0 || h->root.root.string[14] == '@')) { @@ -4624,23 +4706,26 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, rel->r_addend, tls_type)) return FALSE; - if (ppc64_elf_section_data (sec)->t_symndx == NULL) + ppc64_sec = ppc64_elf_section_data (sec); + if (ppc64_sec->sec_type != sec_toc) { /* One extra to simplify get_tls_mask. */ bfd_size_type amt = sec->size * sizeof (unsigned) / 8 + 1; - ppc64_elf_section_data (sec)->t_symndx = bfd_zalloc (abfd, amt); - if (ppc64_elf_section_data (sec)->t_symndx == NULL) + ppc64_sec->u.t_symndx = bfd_zalloc (abfd, amt); + if (ppc64_sec->u.t_symndx == NULL) return FALSE; + BFD_ASSERT (ppc64_sec->sec_type == sec_normal); + ppc64_sec->sec_type = sec_toc; } BFD_ASSERT (rel->r_offset % 8 == 0); - ppc64_elf_section_data (sec)->t_symndx[rel->r_offset / 8] = r_symndx; + ppc64_sec->u.t_symndx[rel->r_offset / 8] = r_symndx; /* Mark the second slot of a GD or LD entry. -1 to indicate GD and -2 to indicate LD. */ if (tls_type == (TLS_EXPLICIT | TLS_TLS | TLS_GD)) - ppc64_elf_section_data (sec)->t_symndx[rel->r_offset / 8 + 1] = -1; + ppc64_sec->u.t_symndx[rel->r_offset / 8 + 1] = -1; else if (tls_type == (TLS_EXPLICIT | TLS_TLS | TLS_LD)) - ppc64_elf_section_data (sec)->t_symndx[rel->r_offset / 8 + 1] = -2; + ppc64_sec->u.t_symndx[rel->r_offset / 8 + 1] = -2; goto dodyn; case R_PPC64_TPREL16: @@ -4770,7 +4855,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, if (name == NULL) return FALSE; - if (strncmp (name, ".rela", 5) != 0 + if (! CONST_STRNEQ (name, ".rela") || strcmp (bfd_get_section_name (abfd, sec), name + 5) != 0) { @@ -5714,7 +5799,6 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info, { struct ppc_link_hash_table *htab; asection *s; - unsigned int power_of_two; htab = ppc_hash_table (info); @@ -5766,6 +5850,10 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info, if (!h->non_got_ref) return TRUE; + /* Don't generate a copy reloc for symbols defined in the executable. */ + if (!h->def_dynamic || !h->ref_regular || h->def_regular) + return TRUE; + if (ELIMINATE_COPY_RELOCS) { struct ppc_link_hash_entry * eh; @@ -5831,29 +5919,9 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 4) - power_of_two = 4; - - /* Apply the required alignment. */ s = htab->dynbss; - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) - { - if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) - return FALSE; - } - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* If given a function descriptor symbol, hide both the function code @@ -6036,7 +6104,7 @@ get_tls_mask (char **tls_maskp, unsigned long *toc_symndx, if ((*tls_maskp != NULL && **tls_maskp != 0) || sec == NULL - || ppc64_elf_section_data (sec)->t_symndx == NULL) + || ppc64_elf_section_data (sec)->sec_type != sec_toc) return 1; /* Look inside a TOC section too. */ @@ -6049,8 +6117,8 @@ get_tls_mask (char **tls_maskp, unsigned long *toc_symndx, off = sym->st_value; off += rel->r_addend; BFD_ASSERT (off % 8 == 0); - r_symndx = ppc64_elf_section_data (sec)->t_symndx[off / 8]; - next_r = ppc64_elf_section_data (sec)->t_symndx[off / 8 + 1]; + r_symndx = ppc64_elf_section_data (sec)->u.t_symndx[off / 8]; + next_r = ppc64_elf_section_data (sec)->u.t_symndx[off / 8 + 1]; if (!get_sym_h (&h, &sym, &sec, tls_maskp, locsymsp, r_symndx, ibfd)) return 0; if (toc_symndx != NULL) @@ -6096,13 +6164,13 @@ adjust_opd_syms (struct elf_link_hash_entry *h, void *inf ATTRIBUTE_UNUSED) if (adjust == -1) { /* This entry has been deleted. */ - asection *dsec = ppc64_elf_tdata (sym_sec->owner)->u.deleted_section; + asection *dsec = ppc64_elf_tdata (sym_sec->owner)->deleted_section; if (dsec == NULL) { for (dsec = sym_sec->owner->sections; dsec; dsec = dsec->next) if (elf_discarded_section (dsec)) { - ppc64_elf_tdata (sym_sec->owner)->u.deleted_section = dsec; + ppc64_elf_tdata (sym_sec->owner)->deleted_section = dsec; break; } } @@ -6291,7 +6359,9 @@ ppc64_elf_edit_opd (bfd *obfd, struct bfd_link_info *info, opd_adjust = bfd_alloc (obfd, amt); if (opd_adjust == NULL) return FALSE; - ppc64_elf_section_data (sec)->opd.adjust = opd_adjust; + ppc64_elf_section_data (sec)->u.opd_adjust = opd_adjust; + BFD_ASSERT (ppc64_elf_section_data (sec)->sec_type == sec_normal); + ppc64_elf_section_data (sec)->sec_type = sec_opd; } memset (opd_adjust, 0, amt); @@ -6601,7 +6671,7 @@ ppc64_elf_edit_opd (bfd *obfd, struct bfd_link_info *info, sec->contents = new_contents; } - /* Fudge the size too, as this is used later in + /* Fudge the header size too, as this is used later in elf_bfd_final_link if we are emitting relocs. */ elf_section_data (sec)->rel_hdr.sh_size = sec->reloc_count * elf_section_data (sec)->rel_hdr.sh_entsize; @@ -7907,7 +7977,7 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* Strip this section if we don't need it; see the comment below. */ } - else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) + else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela")) { if (s->size != 0) { @@ -8302,6 +8372,33 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) rl += htab->relbrlt->reloc_count++ * sizeof (Elf64_External_Rela); bfd_elf64_swap_reloca_out (htab->relbrlt->owner, &rela, rl); } + else if (info->emitrelocations) + { + Elf_Internal_Rela *relocs, *r; + struct bfd_elf_section_data *elfsec_data; + + elfsec_data = elf_section_data (htab->brlt); + relocs = elfsec_data->relocs; + if (relocs == NULL) + { + bfd_size_type relsize; + relsize = htab->brlt->reloc_count * sizeof (*relocs); + relocs = bfd_alloc (htab->brlt->owner, relsize); + if (relocs == NULL) + return FALSE; + elfsec_data->relocs = relocs; + elfsec_data->rel_hdr.sh_size = relsize; + elfsec_data->rel_hdr.sh_entsize = 24; + htab->brlt->reloc_count = 0; + } + r = relocs + htab->brlt->reloc_count; + htab->brlt->reloc_count += 1; + r->r_offset = (br_entry->offset + + htab->brlt->output_offset + + htab->brlt->output_section->vma); + r->r_info = ELF64_R_INFO (0, R_PPC64_RELATIVE); + r->r_addend = off; + } off = (br_entry->offset + htab->brlt->output_offset @@ -8531,6 +8628,11 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) if (htab->relbrlt != NULL) htab->relbrlt->size += sizeof (Elf64_External_Rela); + else if (info->emitrelocations) + { + htab->brlt->reloc_count += 1; + htab->brlt->flags |= SEC_RELOC; + } } stub_entry->stub_type += ppc_stub_plt_branch - ppc_stub_long_branch; @@ -8538,11 +8640,11 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) if (stub_entry->stub_type != ppc_stub_plt_branch) size = 28; } - - if (info->emitrelocations - && (stub_entry->stub_type == ppc_stub_long_branch - || stub_entry->stub_type == ppc_stub_long_branch_r2off)) - stub_entry->stub_sec->reloc_count += 1; + else if (info->emitrelocations) + { + stub_entry->stub_sec->reloc_count += 1; + stub_entry->stub_sec->flags |= SEC_RELOC; + } } stub_entry->stub_sec->size += size; @@ -8925,7 +9027,29 @@ group_sections (struct ppc_link_hash_table *htab, bfd_size_type stub_group_size, bfd_boolean stubs_always_before_branch) { - asection **list = htab->input_list + htab->top_index; + asection **list; + bfd_size_type stub14_group_size; + bfd_boolean suppress_size_errors; + + suppress_size_errors = FALSE; + stub14_group_size = stub_group_size; + if (stub_group_size == 1) + { + /* Default values. */ + if (stubs_always_before_branch) + { + stub_group_size = 0x1e00000; + stub14_group_size = 0x7800; + } + else + { + stub_group_size = 0x1c00000; + stub14_group_size = 0x7000; + } + suppress_size_errors = TRUE; + } + + list = htab->input_list + htab->top_index; do { asection *tail = *list; @@ -8939,15 +9063,17 @@ group_sections (struct ppc_link_hash_table *htab, curr = tail; total = tail->size; - big_sec = total > stub_group_size; - if (big_sec) + big_sec = total > (ppc64_elf_section_data (tail)->has_14bit_branch + ? stub14_group_size : stub_group_size); + if (big_sec && !suppress_size_errors) (*_bfd_error_handler) (_("%B section %A exceeds stub group size"), tail->owner, tail); curr_toc = htab->stub_group[tail->id].toc_off; while ((prev = PREV_SEC (curr)) != NULL && ((total += curr->output_offset - prev->output_offset) - < stub_group_size) + < (ppc64_elf_section_data (prev)->has_14bit_branch + ? stub14_group_size : stub_group_size)) && htab->stub_group[prev->id].toc_off == curr_toc) curr = prev; @@ -8979,7 +9105,8 @@ group_sections (struct ppc_link_hash_table *htab, total = 0; while (prev != NULL && ((total += tail->output_offset - prev->output_offset) - < stub_group_size) + < (ppc64_elf_section_data (prev)->has_14bit_branch + ? stub14_group_size : stub_group_size)) && htab->stub_group[prev->id].toc_off == curr_toc) { tail = prev; @@ -9020,22 +9147,6 @@ ppc64_elf_size_stubs (bfd *output_bfd, stub_group_size = -group_size; else stub_group_size = group_size; - if (stub_group_size == 1) - { - /* Default values. */ - if (stubs_always_before_branch) - { - stub_group_size = 0x1e00000; - if (htab->has_14bit_branch) - stub_group_size = 0x7800; - } - else - { - stub_group_size = 0x1c00000; - if (htab->has_14bit_branch) - stub_group_size = 0x7000; - } - } group_sections (htab, stub_group_size, stubs_always_before_branch); @@ -9073,6 +9184,9 @@ ppc64_elf_size_stubs (bfd *output_bfd, /* If there aren't any relocs, then there's nothing more to do. */ if ((section->flags & SEC_RELOC) == 0 + || (section->flags & SEC_ALLOC) == 0 + || (section->flags & SEC_LOAD) == 0 + || (section->flags & SEC_CODE) == 0 || section->reloc_count == 0) continue; @@ -9322,9 +9436,12 @@ ppc64_elf_size_stubs (bfd *output_bfd, stub_sec->rawsize = stub_sec->size; stub_sec->size = 0; stub_sec->reloc_count = 0; + stub_sec->flags &= ~SEC_RELOC; } htab->brlt->size = 0; + htab->brlt->reloc_count = 0; + htab->brlt->flags &= ~SEC_RELOC; if (htab->relbrlt != NULL) htab->relbrlt->size = 0; @@ -9442,24 +9559,12 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms, stub_sec->size = 0; } - if (htab->plt != NULL) + if (htab->glink != NULL && htab->glink->size != 0) { unsigned int indx; bfd_vma plt0; /* Build the .glink plt call stub. */ - plt0 = (htab->plt->output_section->vma - + htab->plt->output_offset - - (htab->glink->output_section->vma - + htab->glink->output_offset - + GLINK_CALL_STUB_SIZE)); - if (plt0 + 0x80008000 > 0xffffffff) - { - (*_bfd_error_handler) (_(".glink and .plt too far apart")); - bfd_set_error (bfd_error_bad_value); - return FALSE; - } - if (htab->emit_stub_syms) { struct elf_link_hash_entry *h; @@ -9470,7 +9575,7 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms, { h->root.type = bfd_link_hash_defined; h->root.u.def.section = htab->glink; - h->root.u.def.value = 0; + h->root.u.def.value = 8; h->ref_regular = 1; h->def_regular = 1; h->ref_regular_nonweak = 1; @@ -9479,29 +9584,26 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms, } } p = htab->glink->contents; - bfd_put_32 (htab->glink->owner, MFCTR_R12, p); + plt0 = (htab->plt->output_section->vma + + htab->plt->output_offset + - (htab->glink->output_section->vma + + htab->glink->output_offset + + 16)); + bfd_put_64 (htab->glink->owner, plt0, p); + p += 8; + bfd_put_32 (htab->glink->owner, MFLR_R12, p); p += 4; - bfd_put_32 (htab->glink->owner, SLDI_R11_R0_3, p); + bfd_put_32 (htab->glink->owner, BCL_20_31, p); p += 4; - bfd_put_32 (htab->glink->owner, ADDIC_R2_R0_32K, p); + bfd_put_32 (htab->glink->owner, MFLR_R11, p); p += 4; - bfd_put_32 (htab->glink->owner, SUB_R12_R12_R11, p); + bfd_put_32 (htab->glink->owner, LD_R2_M16R11, p); p += 4; - bfd_put_32 (htab->glink->owner, SRADI_R2_R2_63, p); + bfd_put_32 (htab->glink->owner, MTLR_R12, p); p += 4; - bfd_put_32 (htab->glink->owner, SLDI_R11_R0_2, p); + bfd_put_32 (htab->glink->owner, ADD_R12_R2_R11, p); p += 4; - bfd_put_32 (htab->glink->owner, AND_R2_R2_R11, p); - p += 4; - bfd_put_32 (htab->glink->owner, SUB_R12_R12_R11, p); - p += 4; - bfd_put_32 (htab->glink->owner, ADD_R12_R12_R2, p); - p += 4; - bfd_put_32 (htab->glink->owner, ADDIS_R12_R12 | PPC_HA (plt0), p); - p += 4; - bfd_put_32 (htab->glink->owner, LD_R11_0R12 | PPC_LO (plt0), p); - p += 4; - bfd_put_32 (htab->glink->owner, ADDI_R12_R12 | PPC_LO (plt0), p); + bfd_put_32 (htab->glink->owner, LD_R11_0R12, p); p += 4; bfd_put_32 (htab->glink->owner, LD_R2_0R12 | 8, p); p += 4; @@ -9511,6 +9613,11 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms, p += 4; bfd_put_32 (htab->glink->owner, BCTR, p); p += 4; + while (p - htab->glink->contents < GLINK_CALL_STUB_SIZE) + { + bfd_put_32 (htab->glink->owner, NOP, p); + p += 4; + } /* Build the .glink lazy link call stubs. */ indx = 0; @@ -9529,7 +9636,7 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms, p += 4; } bfd_put_32 (htab->glink->owner, - B_DOT | ((htab->glink->contents - p) & 0x3fffffc), p); + B_DOT | ((htab->glink->contents - p + 8) & 0x3fffffc), p); indx++; p += 4; } @@ -9554,6 +9661,9 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms, /* Build the stubs as directed by the stub hash table. */ bfd_hash_traverse (&htab->stub_hash_table, ppc_build_one_stub, info); + if (htab->relbrlt != NULL) + htab->relbrlt->reloc_count = 0; + for (stub_sec = htab->stub_bfd->sections; stub_sec != NULL; stub_sec = stub_sec->next) @@ -9695,6 +9805,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, bfd_boolean is_opd; /* Disabled until we sort out how ld should choose 'y' vs 'at'. */ bfd_boolean is_power4 = FALSE; + bfd_vma d_offset = (bfd_big_endian (output_bfd) ? 2 : 0); /* Initialize howto table if needed. */ if (!ppc64_elf_howto_table[R_PPC64_ADDR32]) @@ -9710,7 +9821,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, TOCstart = elf_gp (output_bfd); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); - is_opd = ppc64_elf_section_data (input_section)->opd.adjust != NULL; + is_opd = ppc64_elf_section_data (input_section)->sec_type == sec_opd; rel = relocs; relend = relocs + input_section->reloc_count; @@ -9785,13 +9896,9 @@ ppc64_elf_relocate_section (bfd *output_bfd, relocation += adjust; } } - if (info->relocatable) - continue; } else { - if (info->relocatable) - continue; RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, r_symndx, symtab_hdr, sym_hashes, h_elf, sec, relocation, @@ -9801,6 +9908,21 @@ ppc64_elf_relocate_section (bfd *output_bfd, } h = (struct ppc_link_hash_entry *) h_elf; + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (ppc64_elf_howto_table[r_type], input_bfd, + contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + /* TLS optimizations. Replace instruction sequences and relocs based on information we collected in tls_optimize. We edit RELOCS so that --emit-relocs will output something sensible @@ -9924,10 +10046,10 @@ ppc64_elf_relocate_section (bfd *output_bfd, && (tls_mask & TLS_TPREL) == 0) { toctprel: - insn = bfd_get_32 (output_bfd, contents + rel->r_offset - 2); + insn = bfd_get_32 (output_bfd, contents + rel->r_offset - d_offset); insn &= 31 << 21; insn |= 0x3c0d0000; /* addis 0,13,0 */ - bfd_put_32 (output_bfd, insn, contents + rel->r_offset - 2); + bfd_put_32 (output_bfd, insn, contents + rel->r_offset - d_offset); r_type = R_PPC64_TPREL16_HA; if (toc_symndx != 0) { @@ -9979,8 +10101,8 @@ ppc64_elf_relocate_section (bfd *output_bfd, insn |= rtra; bfd_put_32 (output_bfd, insn, contents + rel->r_offset); /* Was PPC64_TLS which sits on insn boundary, now - PPC64_TPREL16_LO which is at insn+2. */ - rel->r_offset += 2; + PPC64_TPREL16_LO which is at low-order half-word. */ + rel->r_offset += d_offset; r_type = R_PPC64_TPREL16_LO; if (toc_symndx != 0) { @@ -10013,7 +10135,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, else { bfd_put_32 (output_bfd, NOP, contents + rel->r_offset); - rel->r_offset -= 2; + rel->r_offset -= d_offset; r_type = R_PPC64_NONE; } rel->r_info = ELF64_R_INFO (r_symndx, r_type); @@ -10062,7 +10184,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, /* OK, it checks out. Replace the call. */ offset = rel[1].r_offset; insn1 = bfd_get_32 (output_bfd, - contents + rel->r_offset - 2); + contents + rel->r_offset - d_offset); insn3 = bfd_get_32 (output_bfd, contents + offset + 4); if ((tls_mask & tls_gd) != 0) @@ -10097,7 +10219,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, rel->r_info = ELF64_R_INFO (r_symndx, r_type); rel[1].r_info = ELF64_R_INFO (r_symndx, R_PPC64_TPREL16_LO); - rel[1].r_offset += 2; + rel[1].r_offset += d_offset; } if (insn3 == NOP || insn3 == CROR_151515 || insn3 == CROR_313131) @@ -10106,7 +10228,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, insn2 = NOP; rel[1].r_offset += 4; } - bfd_put_32 (output_bfd, insn1, contents + rel->r_offset - 2); + bfd_put_32 (output_bfd, insn1, contents + rel->r_offset - d_offset); bfd_put_32 (output_bfd, insn2, contents + offset); bfd_put_32 (output_bfd, insn3, contents + offset + 4); if (tls_gd == 0 || toc_symndx != 0) @@ -10620,7 +10742,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, relocation += htab->stub_group[sec->id].toc_off; else unresolved_reloc = TRUE; - goto dodyn2; + goto dodyn; /* TOC16 relocs. We want the offset relative to the TOC base, which is the address of the start of the TOC plus 0x8000. @@ -10720,15 +10842,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, case R_PPC64_UADDR16: case R_PPC64_UADDR32: case R_PPC64_UADDR64: - /* r_symndx will be zero only for relocs against symbols - from removed linkonce sections, or sections discarded by - a linker script. */ dodyn: - if (r_symndx == 0) - break; - /* Fall thru. */ - - dodyn2: if ((input_section->flags & SEC_ALLOC) == 0) break; @@ -10838,6 +10952,17 @@ ppc64_elf_relocate_section (bfd *output_bfd, osec = sec->output_section; indx = elf_section_data (osec)->dynindx; + if (indx == 0) + { + if ((osec->flags & SEC_READONLY) == 0 + && htab->elf.data_index_section != NULL) + osec = htab->elf.data_index_section; + else + osec = htab->elf.text_index_section; + indx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (indx != 0); + /* We are turning this relocation into one against a section symbol, so subtract out the output section's address but not the @@ -10926,17 +11051,10 @@ ppc64_elf_relocate_section (bfd *output_bfd, case R_PPC64_ADDR16_HA: case R_PPC64_ADDR16_HIGHERA: case R_PPC64_ADDR16_HIGHESTA: - case R_PPC64_GOT16_HA: - case R_PPC64_PLTGOT16_HA: - case R_PPC64_PLT16_HA: case R_PPC64_TOC16_HA: case R_PPC64_SECTOFF_HA: case R_PPC64_TPREL16_HA: case R_PPC64_DTPREL16_HA: - case R_PPC64_GOT_TLSGD16_HA: - case R_PPC64_GOT_TLSLD16_HA: - case R_PPC64_GOT_TPREL16_HA: - case R_PPC64_GOT_DTPREL16_HA: case R_PPC64_TPREL16_HIGHER: case R_PPC64_TPREL16_HIGHERA: case R_PPC64_TPREL16_HIGHEST: @@ -10949,10 +11067,20 @@ ppc64_elf_relocate_section (bfd *output_bfd, that's not actually defined anywhere. In that case, 'sec' would be NULL, and we should leave the symbol alone (it will be set to zero elsewhere in the link). */ - if (sec != NULL) - /* Add 0x10000 if sign bit in 0:15 is set. - Bits 0:15 are not used. */ - addend += 0x8000; + if (sec == NULL) + break; + /* Fall thru */ + + case R_PPC64_GOT16_HA: + case R_PPC64_PLTGOT16_HA: + case R_PPC64_PLT16_HA: + case R_PPC64_GOT_TLSGD16_HA: + case R_PPC64_GOT_TLSLD16_HA: + case R_PPC64_GOT_TPREL16_HA: + case R_PPC64_GOT_DTPREL16_HA: + /* Add 0x10000 if sign bit in 0:15 is set. + Bits 0:15 are not used. */ + addend += 0x8000; break; case R_PPC64_ADDR16_DS: @@ -11125,13 +11253,11 @@ ppc64_elf_finish_dynamic_symbol (bfd *output_bfd, Elf_Internal_Sym *sym) { struct ppc_link_hash_table *htab; - bfd *dynobj; struct plt_entry *ent; Elf_Internal_Rela rela; bfd_byte *loc; htab = ppc_hash_table (info); - dynobj = htab->elf.dynobj; for (ent = h->plt.plist; ent != NULL; ent = ent->next) if (ent->plt.offset != (bfd_vma) -1) @@ -11328,6 +11454,17 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd, = PLT_ENTRY_SIZE; } + /* brlt is SEC_LINKER_CREATED, so we need to write out relocs for + brlt ourselves if emitrelocations. */ + if (htab->brlt != NULL + && htab->brlt->reloc_count != 0 + && !_bfd_elf_link_output_relocs (output_bfd, + htab->brlt, + &elf_section_data (htab->brlt)->rel_hdr, + elf_section_data (htab->brlt)->relocs, + NULL)) + return FALSE; + /* We need to handle writing out multiple GOT sections ourselves, since we didn't add them to DYNOBJ. We know dynobj is the first bfd. */ diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index 1fe0c6ca915..47fbff6bed9 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -1,5 +1,5 @@ /* IBM S/390-specific support for 64-bit ELF - Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed Martin Schwidefsky (schwidefsky@de.ibm.com). @@ -20,8 +20,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -46,12 +46,6 @@ static void elf_s390_copy_indirect_symbol static bfd_boolean elf_s390_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); -static asection *elf_s390_gc_mark_hook - PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *)); -static bfd_boolean elf_s390_gc_sweep_hook - PARAMS ((bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *)); struct elf_s390_link_hash_entry; static void elf_s390_adjust_gotplt PARAMS ((struct elf_s390_link_hash_entry *)); @@ -73,8 +67,6 @@ static enum elf_reloc_type_class elf_s390_reloc_type_class PARAMS ((const Elf_Internal_Rela *)); static bfd_boolean elf_s390_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); -static bfd_boolean elf_s390_mkobject - PARAMS ((bfd *)); static bfd_boolean elf_s390_object_p PARAMS ((bfd *)); static int elf_s390_tls_transition @@ -364,6 +356,27 @@ elf_s390_reloc_type_lookup (abfd, code) return 0; } +static reloc_howto_type * +elf_s390_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (elf_howto_table) / sizeof (elf_howto_table[0]); + i++) + if (elf_howto_table[i].name != NULL + && strcasecmp (elf_howto_table[i].name, r_name) == 0) + return &elf_howto_table[i]; + + if (strcasecmp (elf64_s390_vtinherit_howto.name, r_name) == 0) + return &elf64_s390_vtinherit_howto; + if (strcasecmp (elf64_s390_vtentry_howto.name, r_name) == 0) + return &elf64_s390_vtentry_howto; + + return NULL; +} + /* We need to use ELF64_R_TYPE so we have our own copy of this function, and elf64-s390.c has its own copy. */ @@ -631,14 +644,16 @@ struct elf_s390_obj_tdata (elf_s390_tdata (abfd)->local_got_tls_type) static bfd_boolean -elf_s390_mkobject (abfd) - bfd *abfd; +elf_s390_mkobject (bfd *abfd) { - bfd_size_type amt = sizeof (struct elf_s390_obj_tdata); - abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) - return FALSE; - return TRUE; + { + bfd_size_type amt = sizeof (struct elf_s390_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + } + return bfd_elf_mkobject (abfd); } static bfd_boolean @@ -1238,7 +1253,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs) if (name == NULL) return FALSE; - if (strncmp (name, ".rela", 5) != 0 + if (! CONST_STRNEQ (name, ".rela") || strcmp (bfd_get_section_name (abfd, sec), name + 5) != 0) { @@ -1345,50 +1360,30 @@ elf_s390_check_relocs (abfd, info, sec, relocs) relocation. */ static asection * -elf_s390_gc_mark_hook (sec, info, rel, h, sym) - asection *sec; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +elf_s390_gc_mark_hook (asection *sec, + struct bfd_link_info *info, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF64_R_TYPE (rel->r_info)) - { - case R_390_GNU_VTINHERIT: - case R_390_GNU_VTENTRY: - break; + switch (ELF64_R_TYPE (rel->r_info)) + { + case R_390_GNU_VTINHERIT: + case R_390_GNU_VTENTRY: + return NULL; + } - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Update the got entry reference counts for the section being removed. */ static bfd_boolean -elf_s390_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; +elf_s390_gc_sweep_hook (bfd *abfd, + struct bfd_link_info *info, + asection *sec, + const Elf_Internal_Rela *relocs) { Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; @@ -1562,7 +1557,6 @@ elf_s390_adjust_dynamic_symbol (info, h) { struct elf_s390_link_hash_table *htab; asection *s; - unsigned int power_of_two; /* If this is a function, put it in the procedure linkage table. We will fill in the contents of the procedure linkage table later @@ -1683,29 +1677,9 @@ elf_s390_adjust_dynamic_symbol (info, h) h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 3) - power_of_two = 3; - - /* Apply the required alignment. */ s = htab->sdynbss; - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) - { - if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) - return FALSE; - } - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -2098,7 +2072,7 @@ elf_s390_size_dynamic_sections (output_bfd, info) /* Strip this section if we don't need it; see the comment below. */ } - else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) + else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela")) { if (s->size != 0 && s != htab->srelplt) relocs = TRUE; @@ -2240,6 +2214,7 @@ invalid_tls_insn (input_bfd, input_section, rel) input_section, (long) rel->r_offset, howto->name); + bfd_set_error (bfd_error_bad_value); } /* Relocate a 390 ELF section. */ @@ -2263,9 +2238,6 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocatable) - return TRUE; - htab = elf_s390_hash_table (info); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -2300,7 +2272,6 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, howto = elf_howto_table + r_type; r_symndx = ELF64_R_SYM (rel->r_info); - /* This is a final link. */ h = NULL; sym = NULL; sec = NULL; @@ -2321,6 +2292,20 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, unresolved_reloc, warned); } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + switch (r_type) { case R_390_GOTPLT12: @@ -2544,11 +2529,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, case R_390_PC32: case R_390_PC32DBL: case R_390_PC64: - /* r_symndx will be zero only for relocs against symbols - from removed linkonce sections, or sections discarded by - a linker script. */ - if (r_symndx == 0 - || (input_section->flags & SEC_ALLOC) == 0) + if ((input_section->flags & SEC_ALLOC) == 0) break; if ((info->shared @@ -2636,14 +2617,19 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, osec = sec->output_section; sindx = elf_section_data (osec)->dynindx; - BFD_ASSERT (sindx > 0); + + if (sindx == 0) + { + osec = htab->elf.text_index_section; + sindx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (sindx != 0); /* We are turning this relocation into one against a section symbol, so subtract out the output section's address but not the offset of the input section in the output section. */ - outrel.r_addend -= osec->vma; } outrel.r_info = ELF64_R_INFO (sindx, r_type); @@ -2908,7 +2894,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, continue; case R_390_TLS_LDO64: - if (info->shared || (input_section->flags & SEC_CODE) == 0) + if (info->shared) relocation -= dtpoff_base (info); else /* When converting LDO to LE, we must negate. */ @@ -3462,6 +3448,7 @@ const struct elf_size_info s390_elf64_size_info = #define bfd_elf64_bfd_is_local_label_name elf_s390_is_local_label_name #define bfd_elf64_bfd_link_hash_table_create elf_s390_link_hash_table_create #define bfd_elf64_bfd_reloc_type_lookup elf_s390_reloc_type_lookup +#define bfd_elf64_bfd_reloc_name_lookup elf_s390_reloc_name_lookup #define elf_backend_adjust_dynamic_symbol elf_s390_adjust_dynamic_symbol #define elf_backend_check_relocs elf_s390_check_relocs @@ -3474,6 +3461,7 @@ const struct elf_size_info s390_elf64_size_info = #define elf_backend_reloc_type_class elf_s390_reloc_type_class #define elf_backend_relocate_section elf_s390_relocate_section #define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_reloc_type_class elf_s390_reloc_type_class #define elf_backend_plt_sym_val elf_s390_plt_sym_val diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c index 4d6d8d5645f..6d343b78bff 100644 --- a/bfd/elf64-sh64.c +++ b/bfd/elf64-sh64.c @@ -1,5 +1,5 @@ /* SuperH SH64-specific support for 64-bit ELF - Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -20,8 +20,8 @@ #define SH64_ELF64 -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -1392,6 +1392,22 @@ sh_elf64_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +sh_elf64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (sh_elf64_howto_table) / sizeof (sh_elf64_howto_table[0]); + i++) + if (sh_elf64_howto_table[i].name != NULL + && strcasecmp (sh_elf64_howto_table[i].name, r_name) == 0) + return &sh_elf64_howto_table[i]; + + return NULL; +} + /* Given an ELF reloc, fill in the howto field of a relent. See sh_elf_info_to_howto in elf32-sh.c for the original. */ @@ -1487,10 +1503,10 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, howto = sh_elf64_howto_table + r_type; - /* This is a final link. */ h = NULL; sym = NULL; sec = NULL; + relocation = 0; if (r_symndx < symtab_hdr->sh_info) { sym = local_syms + r_symndx; @@ -1509,13 +1525,15 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, _("Unexpected STO_SH5_ISA32 on local symbol is not handled"), input_bfd, input_section, rel->r_offset)); - if (info->relocatable) + if (sec != NULL && elf_discarded_section (sec)) + /* Handled below. */ + ; + else if (info->relocatable) { /* This is a relocatable link. We don't have to change anything, unless the reloc is against a section symbol, in which case we have to adjust according to where the section symbol winds up in the output section. */ - sym = local_syms + r_symndx; if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) goto final_link_relocate; @@ -1554,12 +1572,6 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, { /* ??? Could we use the RELOC_FOR_GLOBAL_SYMBOL macro here ? */ - /* Section symbols are never (?) placed in the hash table, so - we can just ignore hash relocations when creating a - relocatable object file. */ - if (info->relocatable) - continue; - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; while (h->root.type == bfd_link_hash_indirect || h->root.type == bfd_link_hash_warning) @@ -1619,19 +1631,8 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, || (sec->output_section == NULL && ((input_section->flags & SEC_DEBUGGING) != 0 && h->def_dynamic))) - relocation = 0; - else if (sec->output_section == NULL) - { - (*_bfd_error_handler) - (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"), - input_bfd, - input_section, - (long) rel->r_offset, - howto->name, - h->root.root.string); - relocation = 0; - } - else + ; + else if (sec->output_section != NULL) relocation = ((h->root.u.def.value + sec->output_section->vma + sec->output_offset) @@ -1640,13 +1641,23 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, STT_DATALABEL on the way to it. */ | ((h->other & STO_SH5_ISA32) != 0 && ! seen_stt_datalabel)); + else if (!info->relocatable) + { + (*_bfd_error_handler) + (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"), + input_bfd, + input_section, + (long) rel->r_offset, + howto->name, + h->root.root.string); + } } else if (h->root.type == bfd_link_hash_undefweak) - relocation = 0; + ; else if (info->unresolved_syms_in_objects == RM_IGNORE && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - relocation = 0; - else + ; + else if (!info->relocatable) { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, @@ -1654,10 +1665,23 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, (info->unresolved_syms_in_objects == RM_GENERATE_ERROR || ELF_ST_VISIBILITY (h->other))))) return FALSE; - relocation = 0; } } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + disp = (relocation - input_section->output_section->vma - input_section->output_offset @@ -1709,7 +1733,7 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (input_bfd, input_section), name + 5) == 0); @@ -2292,6 +2316,9 @@ sh_elf64_copy_private_data_internal (bfd *ibfd, bfd *obfd) } } + /* Copy object attributes. */ + _bfd_elf_copy_obj_attributes (ibfd, obfd); + return sh_elf64_set_private_flags (obfd, elf_elfheader (ibfd)->e_flags); } @@ -2366,53 +2393,20 @@ sh_elf64_merge_private_data (bfd *ibfd, bfd *obfd) static asection * sh_elf64_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, + struct bfd_link_info *info, Elf_Internal_Rela *rel, struct elf_link_hash_entry *h, Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF64_R_TYPE (rel->r_info)) - { - case R_SH_GNU_VTINHERIT: - case R_SH_GNU_VTENTRY: - break; + switch (ELF64_R_TYPE (rel->r_info)) + { + case R_SH_GNU_VTINHERIT: + case R_SH_GNU_VTENTRY: + return NULL; + } - default: - while (h->root.type == bfd_link_hash_indirect - && h->root.u.i.link) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; -} - -/* Update the got entry reference counts for the section being removed. */ - -static bfd_boolean -sh_elf64_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED, - struct bfd_link_info *info ATTRIBUTE_UNUSED, - asection *sec ATTRIBUTE_UNUSED, - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED) -{ - /* No got and plt entries for 64-bit SH at present. */ - return TRUE; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Look through the relocs for a section during the first phase. @@ -2731,7 +2725,7 @@ sh_elf64_check_relocs (bfd *abfd, struct bfd_link_info *info, if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (abfd, sec), name + 5) == 0); @@ -3333,7 +3327,6 @@ sh64_elf64_adjust_dynamic_symbol (struct bfd_link_info *info, { bfd *dynobj; asection *s; - unsigned int power_of_two; dynobj = elf_hash_table (info)->dynobj; @@ -3473,28 +3466,7 @@ sh64_elf64_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 3) - power_of_two = 3; - - /* Apply the required alignment. */ - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (dynobj, s)) - { - if (! bfd_set_section_alignment (dynobj, s, power_of_two)) - return FALSE; - } - - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* This function is called via sh_elf_link_hash_traverse if we are @@ -3591,7 +3563,7 @@ sh64_elf64_size_dynamic_sections (bfd *output_bfd, /* Remember whether there is a PLT. */ plt = s->size != 0; } - else if (strncmp (name, ".rela", 5) == 0) + else if (CONST_STRNEQ (name, ".rela")) { if (s->size != 0) { @@ -3624,7 +3596,7 @@ sh64_elf64_size_dynamic_sections (bfd *output_bfd, s->reloc_count = 0; } } - else if (strncmp (name, ".got", 4) != 0 + else if (! CONST_STRNEQ (name, ".got") && strcmp (name, ".dynbss") != 0) { /* It's not one of our sections, so don't allocate space. */ @@ -4053,9 +4025,9 @@ static void sh64_elf64_merge_symbol_attribute (struct elf_link_hash_entry *h, const Elf_Internal_Sym *isym, bfd_boolean definition, - bfd_boolean dynamic) + bfd_boolean dynamic ATTRIBUTE_UNUSED) { - if (isym->st_other != 0 && dynamic) + if ((isym->st_other & ~ELF_ST_VISIBILITY (-1)) != 0) { unsigned char other; @@ -4070,8 +4042,8 @@ sh64_elf64_merge_symbol_attribute (struct elf_link_hash_entry *h, static const struct bfd_elf_special_section sh64_elf64_special_sections[]= { - { ".cranges", 8, 0, SHT_PROGBITS, 0 }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".cranges"), 0, SHT_PROGBITS, 0 }, + { NULL, 0, 0, 0, 0 } }; #define TARGET_BIG_SYM bfd_elf64_sh64_vec @@ -4085,6 +4057,8 @@ static const struct bfd_elf_special_section sh64_elf64_special_sections[]= #define elf_symbol_leading_char '_' #define bfd_elf64_bfd_reloc_type_lookup sh_elf64_reloc_type_lookup +#define bfd_elf64_bfd_reloc_name_lookup \ + sh_elf64_reloc_name_lookup #define elf_info_to_howto sh_elf64_info_to_howto /* Note: there's no relaxation at present. */ @@ -4102,7 +4076,6 @@ static const struct bfd_elf_special_section sh64_elf64_special_sections[]= #define elf_backend_fake_sections sh64_elf64_fake_sections #define elf_backend_gc_mark_hook sh_elf64_gc_mark_hook -#define elf_backend_gc_sweep_hook sh_elf64_gc_sweep_hook #define elf_backend_check_relocs sh_elf64_check_relocs #define elf_backend_can_gc_sections 1 @@ -4128,6 +4101,8 @@ static const struct bfd_elf_special_section sh64_elf64_special_sections[]= sh64_elf64_adjust_dynamic_symbol #define elf_backend_size_dynamic_sections \ sh64_elf64_size_dynamic_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_finish_dynamic_symbol \ sh64_elf64_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections \ @@ -4168,6 +4143,7 @@ static const struct bfd_elf_special_section sh64_elf64_special_sections[]= #define TARGET_LITTLE_SYM bfd_elf64_sh64lin_vec #undef TARGET_LITTLE_NAME #define TARGET_LITTLE_NAME "elf64-sh64-linux" +#undef elf64_bed +#define elf64_bed elf64_sh64_linux_bed -#define INCLUDED_TARGET_FILE #include "elf64-target.h" diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index dd1c302174a..2adddd99446 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -1,6 +1,6 @@ /* SPARC-specific support for 64-bit ELF Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/sparc.h" @@ -814,6 +814,7 @@ const struct elf_size_info elf64_sparc_size_info = #define TARGET_BIG_NAME "elf64-sparc" #define ELF_ARCH bfd_arch_sparc #define ELF_MAXPAGESIZE 0x100000 +#define ELF_COMMONPAGESIZE 0x2000 /* This is the official ABI value. */ #define ELF_MACHINE_CODE EM_SPARCV9 @@ -858,6 +859,8 @@ const struct elf_size_info elf64_sparc_size_info = _bfd_sparc_elf_copy_indirect_symbol #define bfd_elf64_bfd_reloc_type_lookup \ _bfd_sparc_elf_reloc_type_lookup +#define bfd_elf64_bfd_reloc_name_lookup \ + _bfd_sparc_elf_reloc_name_lookup #define bfd_elf64_bfd_relax_section \ _bfd_sparc_elf_relax_section #define bfd_elf64_new_section_hook \ @@ -888,6 +891,8 @@ const struct elf_size_info elf64_sparc_size_info = _bfd_sparc_elf_gc_mark_hook #define elf_backend_gc_sweep_hook \ _bfd_sparc_elf_gc_sweep_hook +#define elf_backend_init_index_section \ + _bfd_elf_init_1_index_section #define elf_backend_can_gc_sections 1 #define elf_backend_can_refcount 1 @@ -901,3 +906,19 @@ const struct elf_size_info elf64_sparc_size_info = #define elf_backend_plt_alignment 8 #include "elf64-target.h" + +/* FreeBSD support */ +#undef TARGET_BIG_SYM +#define TARGET_BIG_SYM bfd_elf64_sparc_freebsd_vec +#undef TARGET_BIG_NAME +#define TARGET_BIG_NAME "elf64-sparc-freebsd" +#undef ELF_OSABI +#define ELF_OSABI ELFOSABI_FREEBSD + +#undef elf_backend_post_process_headers +#define elf_backend_post_process_headers _bfd_elf_set_osabi +#undef elf64_bed +#define elf64_bed elf64_sparc_fbsd_bed + +#include "elf64-target.h" + diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 9befd69c5df..0ee75ce9947 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -1,5 +1,5 @@ /* X86-64 specific support for 64-bit ELF - Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Jan Hubicka . @@ -19,8 +19,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -246,6 +246,23 @@ elf64_x86_64_reloc_type_lookup (bfd *abfd, return 0; } +static reloc_howto_type * +elf64_x86_64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (x86_64_elf_howto_table) + / sizeof (x86_64_elf_howto_table[0])); + i++) + if (x86_64_elf_howto_table[i].name != NULL + && strcasecmp (x86_64_elf_howto_table[i].name, r_name) == 0) + return &x86_64_elf_howto_table[i]; + + return NULL; +} + /* Given an x86_64 ELF reloc type, fill in an arelent structure. */ static void @@ -350,7 +367,7 @@ static const bfd_byte elf64_x86_64_plt0_entry[PLT_ENTRY_SIZE] = { 0xff, 0x35, 8, 0, 0, 0, /* pushq GOT+8(%rip) */ 0xff, 0x25, 16, 0, 0, 0, /* jmpq *GOT+16(%rip) */ - 0x90, 0x90, 0x90, 0x90 /* pad out to 16 bytes with nops. */ + 0x0f, 0x1f, 0x40, 0x00 /* nopl 0(%rax) */ }; /* Subsequent entries in a procedure linkage table look like this. */ @@ -676,11 +693,14 @@ elf64_x86_64_copy_indirect_symbol (struct bfd_link_info *info, static bfd_boolean elf64_x86_64_mkobject (bfd *abfd) { - bfd_size_type amt = sizeof (struct elf64_x86_64_obj_tdata); - abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) - return FALSE; - return TRUE; + { + bfd_size_type amt = sizeof (struct elf64_x86_64_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + } + return bfd_elf_mkobject (abfd); } static bfd_boolean @@ -994,7 +1014,7 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, && (r_type != R_X86_64_PC32) && (r_type != R_X86_64_PC64)) || (h != NULL - && (! info->symbolic + && (! SYMBOLIC_BIND (info, h) || h->root.type == bfd_link_hash_defweak || !h->def_regular)))) || (ELIMINATE_COPY_RELOCS @@ -1022,7 +1042,7 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, if (name == NULL) return FALSE; - if (strncmp (name, ".rela", 5) != 0 + if (! CONST_STRNEQ (name, ".rela") || strcmp (bfd_get_section_name (abfd, sec), name + 5) != 0) { @@ -1131,38 +1151,20 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, static asection * elf64_x86_64_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, + struct bfd_link_info *info, Elf_Internal_Rela *rel, struct elf_link_hash_entry *h, Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF64_R_TYPE (rel->r_info)) - { - case R_X86_64_GNU_VTINHERIT: - case R_X86_64_GNU_VTENTRY: - break; + switch (ELF64_R_TYPE (rel->r_info)) + { + case R_X86_64_GNU_VTINHERIT: + case R_X86_64_GNU_VTENTRY: + return NULL; + } - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Update the got entry reference counts for the section being removed. */ @@ -1285,7 +1287,6 @@ elf64_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info, { struct elf64_x86_64_link_hash_table *htab; asection *s; - unsigned int power_of_two; /* If this is a function, put it in the procedure linkage table. We will fill in the contents of the procedure linkage table later, @@ -1403,32 +1404,9 @@ elf64_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. 16-bytes is the size - of the largest type that requires hard alignment -- long double. */ - /* FIXME: This is VERY ugly. Should be fixed for all architectures using - this construct. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 4) - power_of_two = 4; - - /* Apply the required alignment. */ s = htab->sdynbss; - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) - { - if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) - return FALSE; - } - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -1880,7 +1858,7 @@ elf64_x86_64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* Strip this section if we don't need it; see the comment below. */ } - else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) + else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela")) { if (s->size != 0 && s != htab->srelplt) relocs = TRUE; @@ -2077,9 +2055,6 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocatable) - return TRUE; - htab = elf64_x86_64_hash_table (info); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -2135,6 +2110,21 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, h, sec, relocation, unresolved_reloc, warned); } + + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + /* When generating a shared object, the relocations handled here are copied into the output file to be resolved at run time. */ switch (r_type) @@ -2382,11 +2372,7 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, /* FIXME: The ABI says the linker should make sure the value is the same when it's zeroextended to 64 bit. */ - /* r_symndx will be zero only for relocs against symbols - from removed linkonce sections, or sections discarded by - a linker script. */ - if (r_symndx == 0 - || (input_section->flags & SEC_ALLOC) == 0) + if ((input_section->flags & SEC_ALLOC) == 0) break; if ((info->shared @@ -2442,7 +2428,7 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, || r_type == R_X86_64_PC32 || r_type == R_X86_64_PC64 || !info->shared - || !info->symbolic + || !SYMBOLIC_BIND (info, h) || !h->def_regular)) { outrel.r_info = ELF64_R_INFO (h->dynindx, r_type); @@ -2472,9 +2458,19 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { asection *osec; + /* We are turning this relocation into one + against a section symbol. It would be + proper to subtract the symbol's value, + osec->vma, from the emitted reloc addend, + but ld.so expects buggy relocs. */ osec = sec->output_section; sindx = elf_section_data (osec)->dynindx; - BFD_ASSERT (sindx > 0); + if (sindx == 0) + { + asection *oi = htab->elf.text_index_section; + sindx = elf_section_data (oi)->dynindx; + } + BFD_ASSERT (sindx != 0); } outrel.r_info = ELF64_R_INFO (sindx, r_type); @@ -2614,8 +2610,9 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, val = bfd_get_8 (input_bfd, contents + roff + 1); BFD_ASSERT (val == 0x10); - /* Now modify the instruction as appropriate. */ - bfd_put_8 (output_bfd, 0x90, contents + roff); + /* Now modify the instruction as appropriate. Use + xchg %ax,%ax instead of 2 nops. */ + bfd_put_8 (output_bfd, 0x66, contents + roff); bfd_put_8 (output_bfd, 0x90, contents + roff + 1); continue; } @@ -2907,8 +2904,9 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, val = bfd_get_8 (input_bfd, contents + roff + 1); BFD_ASSERT (val == 0x10); - /* Now modify the instruction as appropriate. */ - bfd_put_8 (output_bfd, 0x90, contents + roff); + /* Now modify the instruction as appropriate. Use + xchg %ax,%ax instead of 2 nops. */ + bfd_put_8 (output_bfd, 0x66, contents + roff); bfd_put_8 (output_bfd, 0x90, contents + roff + 1); continue; @@ -3030,12 +3028,6 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, if (r == bfd_reloc_overflow) { - if (h != NULL - && h->root.type == bfd_link_hash_undefweak - && howto->pc_relative) - /* Ignore reloc overflow on branches to undefweak syms. */ - continue; - if (! ((*info->callbacks->reloc_overflow) (info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, input_bfd, input_section, @@ -3594,7 +3586,8 @@ elf64_x86_64_merge_symbol (struct bfd_link_info *info ATTRIBUTE_UNUSED, } static int -elf64_x86_64_additional_program_headers (bfd *abfd) +elf64_x86_64_additional_program_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { asection *s; int count = 0; @@ -3614,23 +3607,38 @@ elf64_x86_64_additional_program_headers (bfd *abfd) return count; } +/* Return TRUE if symbol should be hashed in the `.gnu.hash' section. */ + +static bfd_boolean +elf64_x86_64_hash_symbol (struct elf_link_hash_entry *h) +{ + if (h->plt.offset != (bfd_vma) -1 + && !h->def_regular + && !h->pointer_equality_needed) + return FALSE; + + return _bfd_elf_hash_symbol (h); +} + static const struct bfd_elf_special_section elf64_x86_64_special_sections[]= { - { ".gnu.linkonce.lb", 16, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_X86_64_LARGE}, - { ".gnu.linkonce.lr", 16, -2, SHT_PROGBITS, SHF_ALLOC + SHF_X86_64_LARGE}, - { ".gnu.linkonce.lt", 16, -2, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR + SHF_X86_64_LARGE}, - { ".lbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_X86_64_LARGE}, - { ".ldata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_X86_64_LARGE}, - { ".lrodata", 8, -2, SHT_PROGBITS, SHF_ALLOC + SHF_X86_64_LARGE}, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".gnu.linkonce.lb"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_X86_64_LARGE}, + { STRING_COMMA_LEN (".gnu.linkonce.lr"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_X86_64_LARGE}, + { STRING_COMMA_LEN (".gnu.linkonce.lt"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR + SHF_X86_64_LARGE}, + { STRING_COMMA_LEN (".lbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_X86_64_LARGE}, + { STRING_COMMA_LEN (".ldata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_X86_64_LARGE}, + { STRING_COMMA_LEN (".lrodata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_X86_64_LARGE}, + { NULL, 0, 0, 0, 0 } }; #define TARGET_LITTLE_SYM bfd_elf64_x86_64_vec #define TARGET_LITTLE_NAME "elf64-x86-64" #define ELF_ARCH bfd_arch_i386 #define ELF_MACHINE_CODE EM_X86_64 -#define ELF_MAXPAGESIZE 0x100000 +#define ELF_MAXPAGESIZE 0x200000 +#define ELF_MINPAGESIZE 0x1000 +#define ELF_COMMONPAGESIZE 0x1000 #define elf_backend_can_gc_sections 1 #define elf_backend_can_refcount 1 @@ -3645,6 +3653,8 @@ static const struct bfd_elf_special_section #define bfd_elf64_bfd_link_hash_table_create \ elf64_x86_64_link_hash_table_create #define bfd_elf64_bfd_reloc_type_lookup elf64_x86_64_reloc_type_lookup +#define bfd_elf64_bfd_reloc_name_lookup \ + elf64_x86_64_reloc_name_lookup #define elf_backend_adjust_dynamic_symbol elf64_x86_64_adjust_dynamic_symbol #define elf_backend_check_relocs elf64_x86_64_check_relocs @@ -3660,6 +3670,7 @@ static const struct bfd_elf_special_section #define elf_backend_relocate_section elf64_x86_64_relocate_section #define elf_backend_size_dynamic_sections elf64_x86_64_size_dynamic_sections #define elf_backend_always_size_sections elf64_x86_64_always_size_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_plt_sym_val elf64_x86_64_plt_sym_val #define elf_backend_object_p elf64_x86_64_elf_object_p #define bfd_elf64_mkobject elf64_x86_64_mkobject @@ -3685,5 +3696,25 @@ static const struct bfd_elf_special_section elf64_x86_64_special_sections #define elf_backend_additional_program_headers \ elf64_x86_64_additional_program_headers +#define elf_backend_hash_symbol \ + elf64_x86_64_hash_symbol + +#include "elf64-target.h" + +/* FreeBSD support. */ + +#undef TARGET_LITTLE_SYM +#define TARGET_LITTLE_SYM bfd_elf64_x86_64_freebsd_vec +#undef TARGET_LITTLE_NAME +#define TARGET_LITTLE_NAME "elf64-x86-64-freebsd" + +#undef ELF_OSABI +#define ELF_OSABI ELFOSABI_FREEBSD + +#undef elf_backend_post_process_headers +#define elf_backend_post_process_headers _bfd_elf_set_osabi + +#undef elf64_bed +#define elf64_bed elf64_x86_64_fbsd_bed #include "elf64-target.h" diff --git a/bfd/elfcode.h b/bfd/elfcode.h index 1f8ec2b2b2c..191e124d770 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -1,6 +1,7 @@ /* ELF executable support for BFD. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Written by Fred Fish @ Cygnus Support, from information published in "UNIX System V Release 4, Programmers Guide: ANSI C and @@ -64,8 +65,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. it's cast in stone. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libiberty.h" #include "bfdlink.h" #include "libbfd.h" @@ -139,10 +140,11 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define LOG_FILE_ALIGN 2 #endif -#ifdef DEBUG +#if DEBUG & 2 static void elf_debug_section (int, Elf_Internal_Shdr *); +#endif +#if DEBUG & 1 static void elf_debug_file (Elf_Internal_Ehdr *); -static char *elf_symbol_flags (flagword); #endif /* Structure swapping routines */ @@ -165,7 +167,7 @@ static char *elf_symbol_flags (flagword); /* Translate an ELF symbol in external format into an ELF symbol in internal format. */ -void +bfd_boolean elf_swap_symbol_in (bfd *abfd, const void *psrc, const void *pshn, @@ -187,9 +189,10 @@ elf_swap_symbol_in (bfd *abfd, if (dst->st_shndx == SHN_XINDEX) { if (shndx == NULL) - abort (); + return FALSE; dst->st_shndx = H_GET_32 (abfd, shndx->est_shndx); } + return TRUE; } /* Translate an ELF symbol in internal format into an ELF symbol in external @@ -498,6 +501,8 @@ elf_object_p (bfd *abfd) struct bfd_preserve preserve; asection *s; bfd_size_type amt; + const bfd_target *target; + const bfd_target * const *target_ptr; preserve.marker = NULL; @@ -541,10 +546,12 @@ elf_object_p (bfd *abfd) if (!bfd_preserve_save (abfd, &preserve)) goto got_no_match; + target = abfd->xvec; + /* Allocate an instance of the elf_obj_tdata structure and hook it up to the tdata pointer in the bfd. */ - if (! (*abfd->xvec->_bfd_set_format[bfd_object]) (abfd)) + if (! (*target->_bfd_set_format[bfd_object]) (abfd)) goto got_no_match; preserve.marker = elf_tdata (abfd); @@ -584,8 +591,6 @@ elf_object_p (bfd *abfd) && (ebd->elf_machine_alt2 == 0 || i_ehdrp->e_machine != ebd->elf_machine_alt2)) { - const bfd_target * const *target_ptr; - if (ebd->elf_machine_code != EM_NONE) goto got_wrong_format_error; @@ -626,6 +631,45 @@ elf_object_p (bfd *abfd) goto got_no_match; } + if (ebd->elf_machine_code != EM_NONE + && i_ehdrp->e_ident[EI_OSABI] != ebd->elf_osabi) + { + if (ebd->elf_osabi != ELFOSABI_NONE) + goto got_wrong_format_error; + + /* This is an ELFOSABI_NONE ELF target. Let it match any ELF + target of the compatible machine for which we do not have a + backend with matching ELFOSABI. */ + for (target_ptr = bfd_target_vector; + *target_ptr != NULL; + target_ptr++) + { + const struct elf_backend_data *back; + + /* Skip this target and targets with incompatible byte + order. */ + if (*target_ptr == target + || (*target_ptr)->flavour != bfd_target_elf_flavour + || (*target_ptr)->byteorder != target->byteorder + || ((*target_ptr)->header_byteorder + != target->header_byteorder)) + continue; + + back = (const struct elf_backend_data *) (*target_ptr)->backend_data; + if (back->elf_osabi == i_ehdrp->e_ident[EI_OSABI] + && (back->elf_machine_code == i_ehdrp->e_machine + || (back->elf_machine_alt1 != 0 + && back->elf_machine_alt1 == i_ehdrp->e_machine) + || (back->elf_machine_alt2 != 0 + && back->elf_machine_alt2 == i_ehdrp->e_machine))) + { + /* target_ptr is an ELF backend which matches this + object file, so reject the ELFOSABI_NONE ELF target. */ + goto got_wrong_format_error; + } + } + } + if (i_ehdrp->e_shoff != 0) { bfd_signed_vma where = i_ehdrp->e_shoff; @@ -846,7 +890,7 @@ elf_object_p (bfd *abfd) } bfd_preserve_finish (abfd, &preserve); - return abfd->xvec; + return target; got_wrong_format_error: /* There is way too much undoing of half-known state here. The caller, @@ -1235,6 +1279,12 @@ elf_slurp_symbol_table (bfd *abfd, asymbol **symptrs, bfd_boolean dynamic) case STT_TLS: sym->symbol.flags |= BSF_THREAD_LOCAL; break; + case STT_RELC: + sym->symbol.flags |= BSF_RELC; + break; + case STT_SRELC: + sym->symbol.flags |= BSF_SRELC; + break; } if (dynamic) @@ -1462,7 +1512,7 @@ elf_slurp_reloc_table (bfd *abfd, return TRUE; } -#ifdef DEBUG +#if DEBUG & 2 static void elf_debug_section (int num, Elf_Internal_Shdr *hdr) { @@ -1488,7 +1538,9 @@ elf_debug_section (int num, Elf_Internal_Shdr *hdr) (long) hdr->sh_entsize); fflush (stderr); } +#endif +#if DEBUG & 1 static void elf_debug_file (Elf_Internal_Ehdr *ehdrp) { @@ -1500,77 +1552,6 @@ elf_debug_file (Elf_Internal_Ehdr *ehdrp) fprintf (stderr, "e_shnum = %ld\n", (long) ehdrp->e_shnum); fprintf (stderr, "e_shentsize = %ld\n", (long) ehdrp->e_shentsize); } - -static char * -elf_symbol_flags (flagword flags) -{ - static char buffer[1024]; - - buffer[0] = '\0'; - if (flags & BSF_LOCAL) - strcat (buffer, " local"); - - if (flags & BSF_GLOBAL) - strcat (buffer, " global"); - - if (flags & BSF_DEBUGGING) - strcat (buffer, " debug"); - - if (flags & BSF_FUNCTION) - strcat (buffer, " function"); - - if (flags & BSF_KEEP) - strcat (buffer, " keep"); - - if (flags & BSF_KEEP_G) - strcat (buffer, " keep_g"); - - if (flags & BSF_WEAK) - strcat (buffer, " weak"); - - if (flags & BSF_SECTION_SYM) - strcat (buffer, " section-sym"); - - if (flags & BSF_OLD_COMMON) - strcat (buffer, " old-common"); - - if (flags & BSF_NOT_AT_END) - strcat (buffer, " not-at-end"); - - if (flags & BSF_CONSTRUCTOR) - strcat (buffer, " constructor"); - - if (flags & BSF_WARNING) - strcat (buffer, " warning"); - - if (flags & BSF_INDIRECT) - strcat (buffer, " indirect"); - - if (flags & BSF_FILE) - strcat (buffer, " file"); - - if (flags & DYNAMIC) - strcat (buffer, " dynamic"); - - if (flags & ~(BSF_LOCAL - | BSF_GLOBAL - | BSF_DEBUGGING - | BSF_FUNCTION - | BSF_KEEP - | BSF_KEEP_G - | BSF_WEAK - | BSF_SECTION_SYM - | BSF_OLD_COMMON - | BSF_NOT_AT_END - | BSF_CONSTRUCTOR - | BSF_WARNING - | BSF_INDIRECT - | BSF_FILE - | BSF_DYNAMIC)) - strcat (buffer, " unknown-bits"); - - return buffer; -} #endif /* Create a new BFD as if by bfd_openr. Rather than opening a file, diff --git a/bfd/elflink.c b/bfd/elflink.c index 59d9c3f1389..9f0efa5b4b7 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -1,6 +1,6 @@ /* ELF linking support for BFD. Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006 Free Software Foundation, Inc. + 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #define ARCH_SIZE 0 @@ -185,16 +185,6 @@ _bfd_elf_link_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) return FALSE; } - if (! info->traditional_format) - { - s = bfd_make_section_with_flags (abfd, ".eh_frame_hdr", - flags | SEC_READONLY); - if (s == NULL - || ! bfd_set_section_alignment (abfd, s, 2)) - return FALSE; - elf_hash_table (info)->eh_info.hdr_sec = s; - } - /* Create sections to hold version informations. These are removed if they are not needed. */ s = bfd_make_section_with_flags (abfd, ".gnu.version_d", @@ -240,12 +230,30 @@ _bfd_elf_link_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) if (!_bfd_elf_define_linkage_sym (abfd, info, s, "_DYNAMIC")) return FALSE; - s = bfd_make_section_with_flags (abfd, ".hash", - flags | SEC_READONLY); - if (s == NULL - || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) - return FALSE; - elf_section_data (s)->this_hdr.sh_entsize = bed->s->sizeof_hash_entry; + if (info->emit_hash) + { + s = bfd_make_section_with_flags (abfd, ".hash", flags | SEC_READONLY); + if (s == NULL + || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) + return FALSE; + elf_section_data (s)->this_hdr.sh_entsize = bed->s->sizeof_hash_entry; + } + + if (info->emit_gnu_hash) + { + s = bfd_make_section_with_flags (abfd, ".gnu.hash", + flags | SEC_READONLY); + if (s == NULL + || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) + return FALSE; + /* For 64-bit ELF, .gnu.hash is a non-uniform entity size section: + 4 32-bit words followed by variable count of 64-bit words, then + variable count of 32-bit words. */ + if (bed->s->arch_size == 64) + elf_section_data (s)->this_hdr.sh_entsize = 0; + else + elf_section_data (s)->this_hdr.sh_entsize = 4; + } /* Let the backend create the rest of the sections. This lets the backend set the right flags. The backend will normally create @@ -426,6 +434,29 @@ bfd_elf_link_record_dynamic_symbol (struct bfd_link_info *info, return TRUE; } +/* Mark a symbol dynamic. */ + +void +bfd_elf_link_mark_dynamic_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) +{ + struct bfd_elf_dynamic_list *d = info->dynamic_list; + + /* It may be called more than once on the same H. */ + if(h->dynamic || info->relocatable) + return; + + if ((info->dynamic_data + && (h->type == STT_OBJECT + || (sym != NULL + && ELF_ST_TYPE (sym->st_info) == STT_OBJECT))) + || (d != NULL + && h->root.type == bfd_link_hash_new + && (*d->match) (&d->head, NULL, h->root.root.string))) + h->dynamic = 1; +} + /* Record an assignment to a symbol made by a linker script. We need this in case some dynamic object refers to this symbol. */ @@ -459,7 +490,10 @@ bfd_elf_record_link_assignment (bfd *output_bfd, } if (h->root.type == bfd_link_hash_new) - h->non_elf = 0; + { + bfd_elf_link_mark_dynamic_symbol (info, h, NULL); + h->non_elf = 0; + } /* If this symbol is being provided by the linker script, and it is currently defined by a dynamic object, but not by a regular @@ -676,6 +710,8 @@ _bfd_elf_link_omit_section_dynsym (bfd *output_bfd ATTRIBUTE_UNUSED, struct bfd_link_info *info, asection *p) { + struct elf_link_hash_table *htab; + switch (elf_section_data (p)->this_hdr.sh_type) { case SHT_PROGBITS: @@ -683,15 +719,21 @@ _bfd_elf_link_omit_section_dynsym (bfd *output_bfd ATTRIBUTE_UNUSED, /* If sh_type is yet undecided, assume it could be SHT_PROGBITS/SHT_NOBITS. */ case SHT_NULL: + htab = elf_hash_table (info); + if (p == htab->tls_sec) + return FALSE; + + if (htab->text_index_section != NULL) + return p != htab->text_index_section && p != htab->data_index_section; + if (strcmp (p->name, ".got") == 0 || strcmp (p->name, ".got.plt") == 0 || strcmp (p->name, ".plt") == 0) { asection *ip; - bfd *dynobj = elf_hash_table (info)->dynobj; - if (dynobj != NULL - && (ip = bfd_get_section_by_name (dynobj, p->name)) != NULL + if (htab->dynobj != NULL + && (ip = bfd_get_section_by_name (htab->dynobj, p->name)) != NULL && (ip->flags & SEC_LINKER_CREATED) && ip->output_section == p) return TRUE; @@ -727,6 +769,8 @@ _bfd_elf_link_renumber_dynsyms (bfd *output_bfd, && (p->flags & SEC_ALLOC) != 0 && !(*bed->elf_backend_omit_section_dynsym) (output_bfd, info, p)) elf_section_data (p)->dynindx = ++dynsymcount; + else + elf_section_data (p)->dynindx = 0; } *section_sym_count = dynsymcount; @@ -796,6 +840,15 @@ _bfd_elf_merge_symbol (bfd *abfd, sec = *psec; bind = ELF_ST_BIND (sym->st_info); + /* Silently discard TLS symbols from --just-syms. There's no way to + combine a static TLS block with a new TLS block for this executable. */ + if (ELF_ST_TYPE (sym->st_info) == STT_TLS + && sec->sec_info_type == ELF_INFO_TYPE_JUST_SYMS) + { + *skip = TRUE; + return TRUE; + } + if (! bfd_is_und_section (sec)) h = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, FALSE, FALSE); else @@ -816,6 +869,11 @@ _bfd_elf_merge_symbol (bfd *abfd, || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; + /* We have to check it for every instance since the first few may be + refereences and not all compilers emit symbol type for undefined + symbols. */ + bfd_elf_link_mark_dynamic_symbol (info, h, sym); + /* If we just created the symbol, mark it as being an ELF symbol. Other than that, there is nothing to do--there is no merge issue with a newly defined symbol--so we just return. */ @@ -889,6 +947,7 @@ _bfd_elf_merge_symbol (bfd *abfd, && h->root.type != bfd_link_hash_undefweak && h->root.type != bfd_link_hash_common); + bed = get_elf_backend_data (abfd); /* When we try to create a default indirect symbol from the dynamic definition with the default version, we skip it if its type and the type of existing regular definition mismatch. We only do it @@ -903,7 +962,9 @@ _bfd_elf_merge_symbol (bfd *abfd, && (olddef || h->root.type == bfd_link_hash_common) && ELF_ST_TYPE (sym->st_info) != h->type && ELF_ST_TYPE (sym->st_info) != STT_NOTYPE - && h->type != STT_NOTYPE) + && h->type != STT_NOTYPE + && !(bed->is_function_type (ELF_ST_TYPE (sym->st_info)) + && bed->is_function_type (h->type))) { *skip = TRUE; return TRUE; @@ -1007,7 +1068,41 @@ _bfd_elf_merge_symbol (bfd *abfd, relocatable file and the old definition comes from a dynamic object, we remove the old definition. */ if ((*sym_hash)->root.type == bfd_link_hash_indirect) - h = *sym_hash; + { + /* Handle the case where the old dynamic definition is + default versioned. We need to copy the symbol info from + the symbol with default version to the normal one if it + was referenced before. */ + if (h->ref_regular) + { + const struct elf_backend_data *bed + = get_elf_backend_data (abfd); + struct elf_link_hash_entry *vh = *sym_hash; + vh->root.type = h->root.type; + h->root.type = bfd_link_hash_indirect; + (*bed->elf_backend_copy_indirect_symbol) (info, vh, h); + /* Protected symbols will override the dynamic definition + with default version. */ + if (ELF_ST_VISIBILITY (sym->st_other) == STV_PROTECTED) + { + h->root.u.i.link = (struct bfd_link_hash_entry *) vh; + vh->dynamic_def = 1; + vh->ref_dynamic = 1; + } + else + { + h->root.type = vh->root.type; + vh->ref_dynamic = 0; + /* We have to hide it here since it was made dynamic + global with extra bits when the symbol info was + copied from the old dynamic definition. */ + (*bed->elf_backend_hide_symbol) (info, vh, TRUE); + } + h = vh; + } + else + h = *sym_hash; + } if ((h->root.u.undef.next || info->hash->undefs_tail == &h->root) && bfd_is_und_section (sec)) @@ -1060,6 +1155,11 @@ _bfd_elf_merge_symbol (bfd *abfd, if (olddef && newdyn) oldweak = FALSE; + /* Allow changes between different types of funciton symbol. */ + if (bed->is_function_type (ELF_ST_TYPE (sym->st_info)) + && bed->is_function_type (h->type)) + *type_change_ok = TRUE; + /* It's OK to change the type if either the existing symbol or the new symbol is weak. A type change is also OK if the old symbol is undefined and the new symbol is defined. */ @@ -1106,7 +1206,7 @@ _bfd_elf_merge_symbol (bfd *abfd, && (sec->flags & SEC_ALLOC) != 0 && (sec->flags & SEC_LOAD) == 0 && sym->st_size > 0 - && ELF_ST_TYPE (sym->st_info) != STT_FUNC) + && !bed->is_function_type (ELF_ST_TYPE (sym->st_info))) newdyncommon = TRUE; else newdyncommon = FALSE; @@ -1118,14 +1218,13 @@ _bfd_elf_merge_symbol (bfd *abfd, && (h->root.u.def.section->flags & SEC_ALLOC) != 0 && (h->root.u.def.section->flags & SEC_LOAD) == 0 && h->size > 0 - && h->type != STT_FUNC) + && !bed->is_function_type (h->type)) olddyncommon = TRUE; else olddyncommon = FALSE; /* We now know everything about the old and new symbols. We ask the backend to check if we can merge them. */ - bed = get_elf_backend_data (abfd); if (bed->merge_symbol && !bed->merge_symbol (info, sym_hash, h, sym, psec, pvalue, pold_alignment, skip, override, @@ -1180,7 +1279,7 @@ _bfd_elf_merge_symbol (bfd *abfd, && (olddef || (h->root.type == bfd_link_hash_common && (newweak - || ELF_ST_TYPE (sym->st_info) == STT_FUNC)))) + || bed->is_function_type (ELF_ST_TYPE (sym->st_info)))))) { *override = TRUE; newdef = FALSE; @@ -1235,7 +1334,7 @@ _bfd_elf_merge_symbol (bfd *abfd, && (newdef || (bfd_is_com_section (sec) && (oldweak - || h->type == STT_FUNC))) + || bed->is_function_type (h->type)))) && olddyn && olddef && h->def_dynamic) @@ -1464,6 +1563,10 @@ _bfd_elf_add_default_symbol (bfd *abfd, hi = h; } + /* Check if HI is a warning symbol. */ + if (hi->root.type == bfd_link_hash_warning) + hi = (struct elf_link_hash_entry *) hi->root.u.i.link; + /* If there is a duplicate definition somewhere, then HI may not point to an indirect symbol. We will have reported an error to the user in that case. */ @@ -1574,6 +1677,10 @@ _bfd_elf_export_symbol (struct elf_link_hash_entry *h, void *data) { struct elf_info_failed *eif = data; + /* Ignore this if we won't export it. */ + if (!eif->info->export_dynamic && !h->dynamic) + return TRUE; + /* Ignore indirect symbols. These are added by the versioning code. */ if (h->root.type == bfd_link_hash_indirect) return TRUE; @@ -1840,7 +1947,7 @@ _bfd_elf_link_assign_sym_version (struct elf_link_hash_entry *h, void *data) /* We could not find the version for a symbol when generating a shared archive. Return an error. */ (*_bfd_error_handler) - (_("%B: undefined versioned symbol name %s"), + (_("%B: version node not found for symbol %s"), sinfo->output_bfd, h->root.root.string); bfd_set_error (bfd_error_bad_value); sinfo->failed = TRUE; @@ -2327,7 +2434,7 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h, if (h->needs_plt && eif->info->shared && is_elf_hash_table (eif->info->hash) - && (eif->info->symbolic + && (SYMBOLIC_BIND (eif->info, h) || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) && h->def_regular) { @@ -2502,6 +2609,52 @@ _bfd_elf_adjust_dynamic_symbol (struct elf_link_hash_entry *h, void *data) return TRUE; } +/* Adjust the dynamic symbol, H, for copy in the dynamic bss section, + DYNBSS. */ + +bfd_boolean +_bfd_elf_adjust_dynamic_copy (struct elf_link_hash_entry *h, + asection *dynbss) +{ + unsigned int power_of_two; + bfd_vma mask; + asection *sec = h->root.u.def.section; + + /* The section aligment of definition is the maximum alignment + requirement of symbols defined in the section. Since we don't + know the symbol alignment requirement, we start with the + maximum alignment and check low bits of the symbol address + for the minimum alignment. */ + power_of_two = bfd_get_section_alignment (sec->owner, sec); + mask = ((bfd_vma) 1 << power_of_two) - 1; + while ((h->root.u.def.value & mask) != 0) + { + mask >>= 1; + --power_of_two; + } + + if (power_of_two > bfd_get_section_alignment (dynbss->owner, + dynbss)) + { + /* Adjust the section alignment if needed. */ + if (! bfd_set_section_alignment (dynbss->owner, dynbss, + power_of_two)) + return FALSE; + } + + /* We make sure that the symbol will be aligned properly. */ + dynbss->size = BFD_ALIGN (dynbss->size, mask + 1); + + /* Define the symbol as being at this point in DYNBSS. */ + h->root.u.def.section = dynbss; + h->root.u.def.value = dynbss->size; + + /* Increment the size of DYNBSS to make room for the symbol. */ + dynbss->size += h->size; + + return TRUE; +} + /* Adjust all external symbols pointing into SEC_MERGE sections to reflect the object merging within the sections. */ @@ -2540,6 +2693,8 @@ _bfd_elf_dynamic_symbol_p (struct elf_link_hash_entry *h, bfd_boolean ignore_protected) { bfd_boolean binding_stays_local_p; + const struct elf_backend_data *bed; + struct elf_link_hash_table *hash_table; if (h == NULL) return FALSE; @@ -2556,7 +2711,7 @@ _bfd_elf_dynamic_symbol_p (struct elf_link_hash_entry *h, /* Identify the cases where name binding rules say that a visible symbol resolves locally. */ - binding_stays_local_p = info->executable || info->symbolic; + binding_stays_local_p = info->executable || SYMBOLIC_BIND (info, h); switch (ELF_ST_VISIBILITY (h->other)) { @@ -2565,10 +2720,16 @@ _bfd_elf_dynamic_symbol_p (struct elf_link_hash_entry *h, return FALSE; case STV_PROTECTED: + hash_table = elf_hash_table (info); + if (!is_elf_hash_table (hash_table)) + return FALSE; + + bed = get_elf_backend_data (hash_table->dynobj); + /* Proper resolution for function pointer equality may require that these symbols perhaps be resolved dynamically, even though we should be resolving them to the current module. */ - if (!ignore_protected || h->type != STT_FUNC) + if (!ignore_protected || !bed->is_function_type (h->type)) binding_stays_local_p = TRUE; break; @@ -2595,6 +2756,9 @@ _bfd_elf_symbol_refs_local_p (struct elf_link_hash_entry *h, struct bfd_link_info *info, bfd_boolean local_protected) { + const struct elf_backend_data *bed; + struct elf_link_hash_table *hash_table; + /* If it's a local sym, of course we resolve locally. */ if (h == NULL) return TRUE; @@ -2619,7 +2783,7 @@ _bfd_elf_symbol_refs_local_p (struct elf_link_hash_entry *h, /* At this point, we know the symbol is defined and dynamic. In an executable it must resolve locally, likewise when building symbolic shared libraries. */ - if (info->executable || info->symbolic) + if (info->executable || SYMBOLIC_BIND (info, h)) return TRUE; /* Now deal with defined dynamic symbols in shared libraries. Ones @@ -2631,8 +2795,14 @@ _bfd_elf_symbol_refs_local_p (struct elf_link_hash_entry *h, if (ELF_ST_VISIBILITY (h->other) != STV_PROTECTED) return TRUE; + hash_table = elf_hash_table (info); + if (!is_elf_hash_table (hash_table)) + return TRUE; + + bed = get_elf_backend_data (hash_table->dynobj); + /* STV_PROTECTED non-function symbols are local. */ - if (h->type != STT_FUNC) + if (!bed->is_function_type (h->type)) return TRUE; /* Function pointer equality tests may require that STV_PROTECTED @@ -2681,8 +2851,9 @@ is_global_data_symbol_definition (bfd *abfd ATTRIBUTE_UNUSED, && ELF_ST_BIND (sym->st_info) < STB_LOOS) return FALSE; + bed = get_elf_backend_data (abfd); /* Function symbols do not count. */ - if (ELF_ST_TYPE (sym->st_info) == STT_FUNC) + if (bed->is_function_type (ELF_ST_TYPE (sym->st_info))) return FALSE; /* If the section is undefined, then so is the symbol. */ @@ -2691,7 +2862,6 @@ is_global_data_symbol_definition (bfd *abfd ATTRIBUTE_UNUSED, /* If the symbol is defined in the common section, then it is a common definition and so does not count. */ - bed = get_elf_backend_data (abfd); if (bed->common_definition (sym)) return FALSE; @@ -3080,6 +3250,9 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) struct elf_link_hash_table *htab; bfd_size_type amt; void *alloc_mark = NULL; + struct bfd_hash_entry **old_table = NULL; + unsigned int old_size = 0; + unsigned int old_count = 0; void *old_tab = NULL; void *old_hash; void *old_ent; @@ -3126,7 +3299,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) const char *name; name = bfd_get_section_name (abfd, s); - if (strncmp (name, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0) + if (CONST_STRNEQ (name, ".gnu.warning.")) { char *msg; bfd_size_type sz; @@ -3511,6 +3684,9 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) memcpy (old_hash, sym_hash, hashsize); old_undefs = htab->root.undefs; old_undefs_tail = htab->root.undefs_tail; + old_table = htab->root.table.table; + old_size = htab->root.table.size; + old_count = htab->root.table.count; old_dynsymcount = htab->dynsymcount; for (i = 0; i < htab->root.table.size; i++) @@ -3592,12 +3768,10 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) sec = bfd_abs_section_ptr; else if (sec->kept_section) { - /* Symbols from discarded section are undefined, and have - default visibility. */ + /* Symbols from discarded section are undefined. We keep + its visibility. */ sec = bfd_und_section_ptr; isym->st_shndx = SHN_UNDEF; - isym->st_other = (STV_DEFAULT - | (isym->st_other & ~ ELF_ST_VISIBILITY (-1))); } else if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0) value -= sec->vma; @@ -3622,7 +3796,8 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) goto error_free_vers; if (isym->st_shndx == SHN_COMMON - && ELF_ST_TYPE (isym->st_info) == STT_TLS) + && ELF_ST_TYPE (isym->st_info) == STT_TLS + && !info->relocatable) { asection *tcomm = bfd_get_section_by_name (abfd, ".tcommon"); @@ -3694,8 +3869,9 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) if it is not a function, because it might be the version symbol itself. FIXME: What if it isn't? */ if ((iver.vs_vers & VERSYM_HIDDEN) != 0 - || (vernum > 1 && (! bfd_is_abs_section (sec) - || ELF_ST_TYPE (isym->st_info) == STT_FUNC))) + || (vernum > 1 + && (!bfd_is_abs_section (sec) + || bed->is_function_type (ELF_ST_TYPE (isym->st_info))))) { const char *verstr; size_t namelen, verlen, newlen; @@ -3842,7 +4018,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) if (dynamic && definition && (flags & BSF_WEAK) != 0 - && ELF_ST_TYPE (isym->st_info) != STT_FUNC + && !bed->is_function_type (ELF_ST_TYPE (isym->st_info)) && is_elf_hash_table (htab) && h->u.weakdef == NULL) { @@ -3929,18 +4105,30 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) } if (normal_align < common_align) - (*_bfd_error_handler) - (_("Warning: alignment %u of symbol `%s' in %B" - " is smaller than %u in %B"), - normal_bfd, common_bfd, - 1 << normal_align, name, 1 << common_align); + { + /* PR binutils/2735 */ + if (normal_bfd == NULL) + (*_bfd_error_handler) + (_("Warning: alignment %u of common symbol `%s' in %B" + " is greater than the alignment (%u) of its section %A"), + common_bfd, h->root.u.def.section, + 1 << common_align, name, 1 << normal_align); + else + (*_bfd_error_handler) + (_("Warning: alignment %u of symbol `%s' in %B" + " is smaller than %u in %B"), + normal_bfd, common_bfd, + 1 << normal_align, name, 1 << common_align); + } } - /* Remember the symbol size and type. */ - if (isym->st_size != 0 + /* Remember the symbol size if it isn't undefined. */ + if ((isym->st_size != 0 && isym->st_shndx != SHN_UNDEF) && (definition || h->size == 0)) { - if (h->size != 0 && h->size != isym->st_size && ! size_change_ok) + if (h->size != 0 + && h->size != isym->st_size + && ! size_change_ok) (*_bfd_error_handler) (_("Warning: size of symbol `%s' changed" " from %lu in %B to %lu in %B"), @@ -3955,7 +4143,8 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) to be the size of the common symbol. The code just above won't fix the size if a common symbol becomes larger. We don't warn about a size change here, because that is - covered by --warn-common. */ + covered by --warn-common. Allow changed between different + function types. */ if (h->root.type == bfd_link_hash_common) h->size = h->root.u.c.size; @@ -3989,13 +4178,13 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) isym->st_other = (STV_HIDDEN | (isym->st_other & ~ELF_ST_VISIBILITY (-1))); - if (isym->st_other != 0 && !dynamic) + if (ELF_ST_VISIBILITY (isym->st_other) != 0 && !dynamic) { unsigned char hvis, symvis, other, nvis; - /* Take the balance of OTHER from the definition. */ - other = (definition ? isym->st_other : h->other); - other &= ~ ELF_ST_VISIBILITY (-1); + /* Only merge the visibility. Leave the remainder of the + st_other field to elf_backend_merge_symbol_attribute. */ + other = h->other & ~ELF_ST_VISIBILITY (-1); /* Combine visibilities, using the most constraining one. */ hvis = ELF_ST_VISIBILITY (h->other); @@ -4045,6 +4234,13 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) dynsym = TRUE; } + if (definition && (sec->flags & SEC_DEBUGGING)) + { + /* We don't want to make debug symbol dynamic. */ + (*bed->elf_backend_hide_symbol) (info, h, TRUE); + dynsym = FALSE; + } + /* Check to see if we need to add an indirect symbol for the default name. */ if (definition || h->root.type == bfd_link_hash_common) @@ -4145,9 +4341,14 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) unsigned int i; /* Restore the symbol table. */ + if (bed->as_needed_cleanup) + (*bed->as_needed_cleanup) (abfd, info); old_hash = (char *) old_tab + tabsize; old_ent = (char *) old_hash + hashsize; sym_hash = elf_sym_hashes (abfd); + htab->root.table.table = old_table; + htab->root.table.size = old_size; + htab->root.table.count = old_count; memcpy (htab->root.table.table, old_tab, tabsize); memcpy (sym_hash, old_hash, hashsize); htab->root.undefs = old_undefs; @@ -4285,7 +4486,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) h = *hpp; if (h != NULL && h->root.type == bfd_link_hash_defined - && h->type != STT_FUNC) + && !bed->is_function_type (h->type)) { *sym_hash = h; sym_hash++; @@ -4457,7 +4658,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) asection *stab; for (stab = abfd->sections; stab; stab = stab->next) - if (strncmp (".stab", stab->name, 5) == 0 + if (CONST_STRNEQ (stab->name, ".stab") && (!stab->name[5] || (stab->name[5] == '.' && ISDIGIT (stab->name[6]))) && (stab->flags & SEC_MERGE) == 0 @@ -4807,6 +5008,131 @@ elf_collect_hash_codes (struct elf_link_hash_entry *h, void *data) return TRUE; } +struct collect_gnu_hash_codes +{ + bfd *output_bfd; + const struct elf_backend_data *bed; + unsigned long int nsyms; + unsigned long int maskbits; + unsigned long int *hashcodes; + unsigned long int *hashval; + unsigned long int *indx; + unsigned long int *counts; + bfd_vma *bitmask; + bfd_byte *contents; + long int min_dynindx; + unsigned long int bucketcount; + unsigned long int symindx; + long int local_indx; + long int shift1, shift2; + unsigned long int mask; +}; + +/* This function will be called though elf_link_hash_traverse to store + all hash value of the exported symbols in an array. */ + +static bfd_boolean +elf_collect_gnu_hash_codes (struct elf_link_hash_entry *h, void *data) +{ + struct collect_gnu_hash_codes *s = data; + const char *name; + char *p; + unsigned long ha; + char *alc = NULL; + + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + /* Ignore indirect symbols. These are added by the versioning code. */ + if (h->dynindx == -1) + return TRUE; + + /* Ignore also local symbols and undefined symbols. */ + if (! (*s->bed->elf_hash_symbol) (h)) + return TRUE; + + name = h->root.root.string; + p = strchr (name, ELF_VER_CHR); + if (p != NULL) + { + alc = bfd_malloc (p - name + 1); + memcpy (alc, name, p - name); + alc[p - name] = '\0'; + name = alc; + } + + /* Compute the hash value. */ + ha = bfd_elf_gnu_hash (name); + + /* Store the found hash value in the array for compute_bucket_count, + and also for .dynsym reordering purposes. */ + s->hashcodes[s->nsyms] = ha; + s->hashval[h->dynindx] = ha; + ++s->nsyms; + if (s->min_dynindx < 0 || s->min_dynindx > h->dynindx) + s->min_dynindx = h->dynindx; + + if (alc != NULL) + free (alc); + + return TRUE; +} + +/* This function will be called though elf_link_hash_traverse to do + final dynaminc symbol renumbering. */ + +static bfd_boolean +elf_renumber_gnu_hash_syms (struct elf_link_hash_entry *h, void *data) +{ + struct collect_gnu_hash_codes *s = data; + unsigned long int bucket; + unsigned long int val; + + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + /* Ignore indirect symbols. */ + if (h->dynindx == -1) + return TRUE; + + /* Ignore also local symbols and undefined symbols. */ + if (! (*s->bed->elf_hash_symbol) (h)) + { + if (h->dynindx >= s->min_dynindx) + h->dynindx = s->local_indx++; + return TRUE; + } + + bucket = s->hashval[h->dynindx] % s->bucketcount; + val = (s->hashval[h->dynindx] >> s->shift1) + & ((s->maskbits >> s->shift1) - 1); + s->bitmask[val] |= ((bfd_vma) 1) << (s->hashval[h->dynindx] & s->mask); + s->bitmask[val] + |= ((bfd_vma) 1) << ((s->hashval[h->dynindx] >> s->shift2) & s->mask); + val = s->hashval[h->dynindx] & ~(unsigned long int) 1; + if (s->counts[bucket] == 1) + /* Last element terminates the chain. */ + val |= 1; + bfd_put_32 (s->output_bfd, val, + s->contents + (s->indx[bucket] - s->symindx) * 4); + --s->counts[bucket]; + h->dynindx = s->indx[bucket]++; + return TRUE; +} + +/* Return TRUE if symbol should be hashed in the `.gnu.hash' section. */ + +bfd_boolean +_bfd_elf_hash_symbol (struct elf_link_hash_entry *h) +{ + return !(h->forced_local + || h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak + || ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && h->root.u.def.section->output_section == NULL)); +} + /* Array used to determine the number of hash table buckets to use based on the number of symbols there are. If there are fewer than 3 symbols we use 1 bucket, fewer than 17 symbols we use 3 buckets, @@ -4828,42 +5154,26 @@ static const size_t elf_buckets[] = Therefore the result is always a good payoff between few collisions (= short chain lengths) and table size. */ static size_t -compute_bucket_count (struct bfd_link_info *info) +compute_bucket_count (struct bfd_link_info *info, unsigned long int *hashcodes, + unsigned long int nsyms, int gnu_hash) { size_t dynsymcount = elf_hash_table (info)->dynsymcount; size_t best_size = 0; - unsigned long int *hashcodes; - unsigned long int *hashcodesp; unsigned long int i; bfd_size_type amt; - /* Compute the hash values for all exported symbols. At the same - time store the values in an array so that we could use them for - optimizations. */ - amt = dynsymcount; - amt *= sizeof (unsigned long int); - hashcodes = bfd_malloc (amt); - if (hashcodes == NULL) - return 0; - hashcodesp = hashcodes; - - /* Put all hash values in HASHCODES. */ - elf_link_hash_traverse (elf_hash_table (info), - elf_collect_hash_codes, &hashcodesp); - /* We have a problem here. The following code to optimize the table size requires an integer type with more the 32 bits. If BFD_HOST_U_64_BIT is set we know about such a type. */ #ifdef BFD_HOST_U_64_BIT if (info->optimize) { - unsigned long int nsyms = hashcodesp - hashcodes; size_t minsize; size_t maxsize; BFD_HOST_U_64_BIT best_chlen = ~((BFD_HOST_U_64_BIT) 0); - unsigned long int *counts ; bfd *dynobj = elf_hash_table (info)->dynobj; const struct elf_backend_data *bed = get_elf_backend_data (dynobj); + unsigned long int *counts; /* Possible optimization parameters: if we have NSYMS symbols we say that the hashing table must at least have NSYMS/4 and at most @@ -4872,6 +5182,13 @@ compute_bucket_count (struct bfd_link_info *info) if (minsize == 0) minsize = 1; best_size = maxsize = nsyms * 2; + if (gnu_hash) + { + if (minsize < 2) + minsize = 2; + if ((best_size & 31) == 0) + ++best_size; + } /* Create array where we count the collisions in. We must use bfd_malloc since the size could be large. */ @@ -4879,10 +5196,7 @@ compute_bucket_count (struct bfd_link_info *info) amt *= sizeof (unsigned long int); counts = bfd_malloc (amt); if (counts == NULL) - { - free (hashcodes); - return 0; - } + return 0; /* Compute the "optimal" size for the hash table. The criteria is a minimal chain length. The minor criteria is (of course) the size @@ -4894,6 +5208,9 @@ compute_bucket_count (struct bfd_link_info *info) unsigned long int j; unsigned long int fact; + if (gnu_hash && (i & 31) == 0) + continue; + memset (counts, '\0', i * sizeof (unsigned long int)); /* Determine how often each hash bucket is used. */ @@ -4909,9 +5226,9 @@ compute_bucket_count (struct bfd_link_info *info) # define BFD_TARGET_PAGESIZE (4096) # endif - /* We in any case need 2 + NSYMS entries for the size values and - the chains. */ - max = (2 + nsyms) * (bed->s->arch_size / 8); + /* We in any case need 2 + DYNSYMCOUNT entries for the size values + and the chains. */ + max = (2 + dynsymcount) * bed->s->sizeof_hash_entry; # if 1 /* Variant 1: optimize for short chains. We add the squares @@ -4921,7 +5238,7 @@ compute_bucket_count (struct bfd_link_info *info) max += counts[j] * counts[j]; /* This adds penalties for the overall size of the table. */ - fact = i / (BFD_TARGET_PAGESIZE / (bed->s->arch_size / 8)) + 1; + fact = i / (BFD_TARGET_PAGESIZE / bed->s->sizeof_hash_entry) + 1; max *= fact * fact; # else /* Variant 2: Optimize a lot more for small table. Here we @@ -4932,7 +5249,7 @@ compute_bucket_count (struct bfd_link_info *info) /* The overall size of the table is considered, but not as strong as in variant 1, where it is squared. */ - fact = i / (BFD_TARGET_PAGESIZE / (bed->s->arch_size / 8)) + 1; + fact = i / (BFD_TARGET_PAGESIZE / bed->s->sizeof_hash_entry) + 1; max *= fact; # endif @@ -4955,14 +5272,13 @@ compute_bucket_count (struct bfd_link_info *info) for (i = 0; elf_buckets[i] != 0; i++) { best_size = elf_buckets[i]; - if (dynsymcount < elf_buckets[i + 1]) + if (nsyms < elf_buckets[i + 1]) break; } + if (gnu_hash && best_size < 2) + best_size = 2; } - /* Free the arrays we needed. */ - free (hashcodes); - return best_size; } @@ -4993,6 +5309,7 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, if (!is_elf_hash_table (info->hash)) return TRUE; + bed = get_elf_backend_data (output_bfd); elf_tdata (output_bfd)->relro = info->relro; if (info->execstack) elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X; @@ -5019,7 +5336,7 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, exec = PF_X; notesec = s; } - else + else if (bed->default_execstack) exec = PF_X; } if (notesec) @@ -5040,11 +5357,13 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, /* The backend may have to create some sections regardless of whether we're dynamic or not. */ - bed = get_elf_backend_data (output_bfd); if (bed->elf_backend_always_size_sections && ! (*bed->elf_backend_always_size_sections) (output_bfd, info)) return FALSE; + if (! _bfd_elf_maybe_strip_eh_frame_hdr (info)) + return FALSE; + dynobj = elf_hash_table (info)->dynobj; /* If there were no dynamic objects in the link, there is nothing to @@ -5052,9 +5371,6 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, if (dynobj == NULL) return TRUE; - if (! _bfd_elf_maybe_strip_eh_frame_hdr (info)) - return FALSE; - if (elf_hash_table (info)->dynamic_sections_created) { struct elf_info_failed eif; @@ -5135,7 +5451,8 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, /* If we are supposed to export all symbols into the dynamic symbol table (this is not the normal case), then do so. */ - if (info->export_dynamic) + if (info->export_dynamic + || (info->executable && info->dynamic)) { elf_link_hash_traverse (elf_hash_table (info), _bfd_elf_export_symbol, @@ -5277,15 +5594,16 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) - for (o = sub->sections; o != NULL; o = o->next) - if (elf_section_data (o)->this_hdr.sh_type - == SHT_PREINIT_ARRAY) - { - (*_bfd_error_handler) - (_("%B: .preinit_array section is not allowed in DSO"), - sub); - break; - } + if (bfd_get_flavour (sub) == bfd_target_elf_flavour) + for (o = sub->sections; o != NULL; o = o->next) + if (elf_section_data (o)->this_hdr.sh_type + == SHT_PREINIT_ARRAY) + { + (*_bfd_error_handler) + (_("%B: .preinit_array section is not allowed in DSO"), + sub); + break; + } bfd_set_error (bfd_error_nonrepresentable_section); return FALSE; @@ -5320,7 +5638,10 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, bfd_size_type strsize; strsize = _bfd_elf_strtab_size (elf_hash_table (info)->dynstr); - if (!_bfd_elf_add_dynamic_entry (info, DT_HASH, 0) + if ((info->emit_hash + && !_bfd_elf_add_dynamic_entry (info, DT_HASH, 0)) + || (info->emit_gnu_hash + && !_bfd_elf_add_dynamic_entry (info, DT_GNU_HASH, 0)) || !_bfd_elf_add_dynamic_entry (info, DT_STRTAB, 0) || !_bfd_elf_add_dynamic_entry (info, DT_SYMTAB, 0) || !_bfd_elf_add_dynamic_entry (info, DT_STRSZ, strsize) @@ -5709,21 +6030,68 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, return TRUE; } +/* Find the first non-excluded output section. We'll use its + section symbol for some emitted relocs. */ +void +_bfd_elf_init_1_index_section (bfd *output_bfd, struct bfd_link_info *info) +{ + asection *s; + + for (s = output_bfd->sections; s != NULL; s = s->next) + if ((s->flags & (SEC_EXCLUDE | SEC_ALLOC)) == SEC_ALLOC + && !_bfd_elf_link_omit_section_dynsym (output_bfd, info, s)) + { + elf_hash_table (info)->text_index_section = s; + break; + } +} + +/* Find two non-excluded output sections, one for code, one for data. + We'll use their section symbols for some emitted relocs. */ +void +_bfd_elf_init_2_index_sections (bfd *output_bfd, struct bfd_link_info *info) +{ + asection *s; + + for (s = output_bfd->sections; s != NULL; s = s->next) + if (((s->flags & (SEC_EXCLUDE | SEC_ALLOC | SEC_READONLY)) + == (SEC_ALLOC | SEC_READONLY)) + && !_bfd_elf_link_omit_section_dynsym (output_bfd, info, s)) + { + elf_hash_table (info)->text_index_section = s; + break; + } + + for (s = output_bfd->sections; s != NULL; s = s->next) + if (((s->flags & (SEC_EXCLUDE | SEC_ALLOC | SEC_READONLY)) == SEC_ALLOC) + && !_bfd_elf_link_omit_section_dynsym (output_bfd, info, s)) + { + elf_hash_table (info)->data_index_section = s; + break; + } + + if (elf_hash_table (info)->text_index_section == NULL) + elf_hash_table (info)->text_index_section + = elf_hash_table (info)->data_index_section; +} + bfd_boolean bfd_elf_size_dynsym_hash_dynstr (bfd *output_bfd, struct bfd_link_info *info) { + const struct elf_backend_data *bed; + if (!is_elf_hash_table (info->hash)) return TRUE; + bed = get_elf_backend_data (output_bfd); + (*bed->elf_backend_init_index_section) (output_bfd, info); + if (elf_hash_table (info)->dynamic_sections_created) { bfd *dynobj; - const struct elf_backend_data *bed; asection *s; bfd_size_type dynsymcount; unsigned long section_sym_count; - size_t bucketcount = 0; - size_t hash_entry_size; unsigned int dtagcount; dynobj = elf_hash_table (info)->dynobj; @@ -5759,7 +6127,6 @@ bfd_elf_size_dynsym_hash_dynstr (bfd *output_bfd, struct bfd_link_info *info) section as we went along in elf_link_add_object_symbols. */ s = bfd_get_section_by_name (dynobj, ".dynsym"); BFD_ASSERT (s != NULL); - bed = get_elf_backend_data (output_bfd); s->size = dynsymcount * bed->s->sizeof_sym; if (dynsymcount != 0) @@ -5774,23 +6141,215 @@ bfd_elf_size_dynsym_hash_dynstr (bfd *output_bfd, struct bfd_link_info *info) memset (s->contents, 0, section_sym_count * bed->s->sizeof_sym); } + elf_hash_table (info)->bucketcount = 0; + /* Compute the size of the hashing table. As a side effect this computes the hash values for all the names we export. */ - bucketcount = compute_bucket_count (info); + if (info->emit_hash) + { + unsigned long int *hashcodes; + unsigned long int *hashcodesp; + bfd_size_type amt; + unsigned long int nsyms; + size_t bucketcount; + size_t hash_entry_size; - s = bfd_get_section_by_name (dynobj, ".hash"); - BFD_ASSERT (s != NULL); - hash_entry_size = elf_section_data (s)->this_hdr.sh_entsize; - s->size = ((2 + bucketcount + dynsymcount) * hash_entry_size); - s->contents = bfd_zalloc (output_bfd, s->size); - if (s->contents == NULL) - return FALSE; + /* Compute the hash values for all exported symbols. At the same + time store the values in an array so that we could use them for + optimizations. */ + amt = dynsymcount * sizeof (unsigned long int); + hashcodes = bfd_malloc (amt); + if (hashcodes == NULL) + return FALSE; + hashcodesp = hashcodes; - bfd_put (8 * hash_entry_size, output_bfd, bucketcount, s->contents); - bfd_put (8 * hash_entry_size, output_bfd, dynsymcount, - s->contents + hash_entry_size); + /* Put all hash values in HASHCODES. */ + elf_link_hash_traverse (elf_hash_table (info), + elf_collect_hash_codes, &hashcodesp); - elf_hash_table (info)->bucketcount = bucketcount; + nsyms = hashcodesp - hashcodes; + bucketcount + = compute_bucket_count (info, hashcodes, nsyms, 0); + free (hashcodes); + + if (bucketcount == 0) + return FALSE; + + elf_hash_table (info)->bucketcount = bucketcount; + + s = bfd_get_section_by_name (dynobj, ".hash"); + BFD_ASSERT (s != NULL); + hash_entry_size = elf_section_data (s)->this_hdr.sh_entsize; + s->size = ((2 + bucketcount + dynsymcount) * hash_entry_size); + s->contents = bfd_zalloc (output_bfd, s->size); + if (s->contents == NULL) + return FALSE; + + bfd_put (8 * hash_entry_size, output_bfd, bucketcount, s->contents); + bfd_put (8 * hash_entry_size, output_bfd, dynsymcount, + s->contents + hash_entry_size); + } + + if (info->emit_gnu_hash) + { + size_t i, cnt; + unsigned char *contents; + struct collect_gnu_hash_codes cinfo; + bfd_size_type amt; + size_t bucketcount; + + memset (&cinfo, 0, sizeof (cinfo)); + + /* Compute the hash values for all exported symbols. At the same + time store the values in an array so that we could use them for + optimizations. */ + amt = dynsymcount * 2 * sizeof (unsigned long int); + cinfo.hashcodes = bfd_malloc (amt); + if (cinfo.hashcodes == NULL) + return FALSE; + + cinfo.hashval = cinfo.hashcodes + dynsymcount; + cinfo.min_dynindx = -1; + cinfo.output_bfd = output_bfd; + cinfo.bed = bed; + + /* Put all hash values in HASHCODES. */ + elf_link_hash_traverse (elf_hash_table (info), + elf_collect_gnu_hash_codes, &cinfo); + + bucketcount + = compute_bucket_count (info, cinfo.hashcodes, cinfo.nsyms, 1); + + if (bucketcount == 0) + { + free (cinfo.hashcodes); + return FALSE; + } + + s = bfd_get_section_by_name (dynobj, ".gnu.hash"); + BFD_ASSERT (s != NULL); + + if (cinfo.nsyms == 0) + { + /* Empty .gnu.hash section is special. */ + BFD_ASSERT (cinfo.min_dynindx == -1); + free (cinfo.hashcodes); + s->size = 5 * 4 + bed->s->arch_size / 8; + contents = bfd_zalloc (output_bfd, s->size); + if (contents == NULL) + return FALSE; + s->contents = contents; + /* 1 empty bucket. */ + bfd_put_32 (output_bfd, 1, contents); + /* SYMIDX above the special symbol 0. */ + bfd_put_32 (output_bfd, 1, contents + 4); + /* Just one word for bitmask. */ + bfd_put_32 (output_bfd, 1, contents + 8); + /* Only hash fn bloom filter. */ + bfd_put_32 (output_bfd, 0, contents + 12); + /* No hashes are valid - empty bitmask. */ + bfd_put (bed->s->arch_size, output_bfd, 0, contents + 16); + /* No hashes in the only bucket. */ + bfd_put_32 (output_bfd, 0, + contents + 16 + bed->s->arch_size / 8); + } + else + { + unsigned long int maskwords, maskbitslog2; + BFD_ASSERT (cinfo.min_dynindx != -1); + + maskbitslog2 = bfd_log2 (cinfo.nsyms) + 1; + if (maskbitslog2 < 3) + maskbitslog2 = 5; + else if ((1 << (maskbitslog2 - 2)) & cinfo.nsyms) + maskbitslog2 = maskbitslog2 + 3; + else + maskbitslog2 = maskbitslog2 + 2; + if (bed->s->arch_size == 64) + { + if (maskbitslog2 == 5) + maskbitslog2 = 6; + cinfo.shift1 = 6; + } + else + cinfo.shift1 = 5; + cinfo.mask = (1 << cinfo.shift1) - 1; + cinfo.shift2 = maskbitslog2; + cinfo.maskbits = 1 << maskbitslog2; + maskwords = 1 << (maskbitslog2 - cinfo.shift1); + amt = bucketcount * sizeof (unsigned long int) * 2; + amt += maskwords * sizeof (bfd_vma); + cinfo.bitmask = bfd_malloc (amt); + if (cinfo.bitmask == NULL) + { + free (cinfo.hashcodes); + return FALSE; + } + + cinfo.counts = (void *) (cinfo.bitmask + maskwords); + cinfo.indx = cinfo.counts + bucketcount; + cinfo.symindx = dynsymcount - cinfo.nsyms; + memset (cinfo.bitmask, 0, maskwords * sizeof (bfd_vma)); + + /* Determine how often each hash bucket is used. */ + memset (cinfo.counts, 0, bucketcount * sizeof (cinfo.counts[0])); + for (i = 0; i < cinfo.nsyms; ++i) + ++cinfo.counts[cinfo.hashcodes[i] % bucketcount]; + + for (i = 0, cnt = cinfo.symindx; i < bucketcount; ++i) + if (cinfo.counts[i] != 0) + { + cinfo.indx[i] = cnt; + cnt += cinfo.counts[i]; + } + BFD_ASSERT (cnt == dynsymcount); + cinfo.bucketcount = bucketcount; + cinfo.local_indx = cinfo.min_dynindx; + + s->size = (4 + bucketcount + cinfo.nsyms) * 4; + s->size += cinfo.maskbits / 8; + contents = bfd_zalloc (output_bfd, s->size); + if (contents == NULL) + { + free (cinfo.bitmask); + free (cinfo.hashcodes); + return FALSE; + } + + s->contents = contents; + bfd_put_32 (output_bfd, bucketcount, contents); + bfd_put_32 (output_bfd, cinfo.symindx, contents + 4); + bfd_put_32 (output_bfd, maskwords, contents + 8); + bfd_put_32 (output_bfd, cinfo.shift2, contents + 12); + contents += 16 + cinfo.maskbits / 8; + + for (i = 0; i < bucketcount; ++i) + { + if (cinfo.counts[i] == 0) + bfd_put_32 (output_bfd, 0, contents); + else + bfd_put_32 (output_bfd, cinfo.indx[i], contents); + contents += 4; + } + + cinfo.contents = contents; + + /* Renumber dynamic symbols, populate .gnu.hash section. */ + elf_link_hash_traverse (elf_hash_table (info), + elf_renumber_gnu_hash_syms, &cinfo); + + contents = s->contents + 16; + for (i = 0; i < maskwords; ++i) + { + bfd_put (bed->s->arch_size, output_bfd, cinfo.bitmask[i], + contents); + contents += bed->s->arch_size / 8; + } + + free (cinfo.bitmask); + free (cinfo.hashcodes); + } + } s = bfd_get_section_by_name (dynobj, ".dynstr"); BFD_ASSERT (s != NULL); @@ -5866,6 +6425,719 @@ struct elf_outext_info struct elf_final_link_info *finfo; }; + +/* Support for evaluating a complex relocation. + + Complex relocations are generalized, self-describing relocations. The + implementation of them consists of two parts: complex symbols, and the + relocations themselves. + + The relocations are use a reserved elf-wide relocation type code (R_RELC + external / BFD_RELOC_RELC internal) and an encoding of relocation field + information (start bit, end bit, word width, etc) into the addend. This + information is extracted from CGEN-generated operand tables within gas. + + Complex symbols are mangled symbols (BSF_RELC external / STT_RELC + internal) representing prefix-notation expressions, including but not + limited to those sorts of expressions normally encoded as addends in the + addend field. The symbol mangling format is: + + := + | ':' + | ':' ':' + ; + + := 's' ':' + | 'S' ':' + | '#' + ; + + := as in C + := as in C, plus "0-" for unambiguous negation. */ + +static void +set_symbol_value (bfd * bfd_with_globals, + struct elf_final_link_info * finfo, + int symidx, + bfd_vma val) +{ + bfd_boolean is_local; + Elf_Internal_Sym * sym; + struct elf_link_hash_entry ** sym_hashes; + struct elf_link_hash_entry * h; + + sym_hashes = elf_sym_hashes (bfd_with_globals); + sym = finfo->internal_syms + symidx; + is_local = ELF_ST_BIND(sym->st_info) == STB_LOCAL; + + if (is_local) + { + /* It is a local symbol: move it to the + "absolute" section and give it a value. */ + sym->st_shndx = SHN_ABS; + sym->st_value = val; + } + else + { + /* It is a global symbol: set its link type + to "defined" and give it a value. */ + h = sym_hashes [symidx]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + h->root.type = bfd_link_hash_defined; + h->root.u.def.value = val; + h->root.u.def.section = bfd_abs_section_ptr; + } +} + +static bfd_boolean +resolve_symbol (const char * name, + bfd * input_bfd, + struct elf_final_link_info * finfo, + bfd_vma * result, + size_t locsymcount) +{ + Elf_Internal_Sym * sym; + struct bfd_link_hash_entry * global_entry; + const char * candidate = NULL; + Elf_Internal_Shdr * symtab_hdr; + asection * sec = NULL; + size_t i; + + symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; + + for (i = 0; i < locsymcount; ++ i) + { + sym = finfo->internal_syms + i; + sec = finfo->sections [i]; + + if (ELF_ST_BIND (sym->st_info) != STB_LOCAL) + continue; + + candidate = bfd_elf_string_from_elf_section (input_bfd, + symtab_hdr->sh_link, + sym->st_name); +#ifdef DEBUG + printf ("Comparing string: '%s' vs. '%s' = 0x%x\n", + name, candidate, (unsigned int)sym->st_value); +#endif + if (candidate && strcmp (candidate, name) == 0) + { + * result = sym->st_value; + + if (sym->st_shndx > SHN_UNDEF && + sym->st_shndx < SHN_LORESERVE) + { +#ifdef DEBUG + printf ("adjusting for sec '%s' @ 0x%x + 0x%x\n", + sec->output_section->name, + (unsigned int)sec->output_section->vma, + (unsigned int)sec->output_offset); +#endif + * result += sec->output_offset + sec->output_section->vma; + } +#ifdef DEBUG + printf ("Found symbol with effective value %8.8x\n", (unsigned int)* result); +#endif + return TRUE; + } + } + + /* Hmm, haven't found it yet. perhaps it is a global. */ + global_entry = bfd_link_hash_lookup (finfo->info->hash, name, FALSE, FALSE, TRUE); + if (!global_entry) + return FALSE; + + if (global_entry->type == bfd_link_hash_defined + || global_entry->type == bfd_link_hash_defweak) + { + * result = global_entry->u.def.value + + global_entry->u.def.section->output_section->vma + + global_entry->u.def.section->output_offset; +#ifdef DEBUG + printf ("Found GLOBAL symbol '%s' with value %8.8x\n", + global_entry->root.string, (unsigned int)*result); +#endif + return TRUE; + } + + if (global_entry->type == bfd_link_hash_common) + { + *result = global_entry->u.def.value + + bfd_com_section_ptr->output_section->vma + + bfd_com_section_ptr->output_offset; +#ifdef DEBUG + printf ("Found COMMON symbol '%s' with value %8.8x\n", + global_entry->root.string, (unsigned int)*result); +#endif + return TRUE; + } + + return FALSE; +} + +static bfd_boolean +resolve_section (const char * name, + asection * sections, + bfd_vma * result) +{ + asection * curr; + unsigned int len; + + for (curr = sections; curr; curr = curr->next) + if (strcmp (curr->name, name) == 0) + { + *result = curr->vma; + return TRUE; + } + + /* Hmm. still haven't found it. try pseudo-section names. */ + for (curr = sections; curr; curr = curr->next) + { + len = strlen (curr->name); + if (len > strlen (name)) + continue; + + if (strncmp (curr->name, name, len) == 0) + { + if (strncmp (".end", name + len, 4) == 0) + { + *result = curr->vma + curr->size; + return TRUE; + } + + /* Insert more pseudo-section names here, if you like. */ + } + } + + return FALSE; +} + +static void +undefined_reference (const char * reftype, + const char * name) +{ + _bfd_error_handler (_("undefined %s reference in complex symbol: %s"), reftype, name); +} + +static bfd_boolean +eval_symbol (bfd_vma * result, + char * sym, + char ** advanced, + bfd * input_bfd, + struct elf_final_link_info * finfo, + bfd_vma addr, + bfd_vma section_offset, + size_t locsymcount, + int signed_p) +{ + int len; + int symlen; + bfd_vma a; + bfd_vma b; + const int bufsz = 4096; + char symbuf [bufsz]; + const char * symend; + bfd_boolean symbol_is_section = FALSE; + + len = strlen (sym); + symend = sym + len; + + if (len < 1 || len > bufsz) + { + bfd_set_error (bfd_error_invalid_operation); + return FALSE; + } + + switch (* sym) + { + case '.': + * result = addr + section_offset; + * advanced = sym + 1; + return TRUE; + + case '#': + ++ sym; + * result = strtoul (sym, advanced, 16); + return TRUE; + + case 'S': + symbol_is_section = TRUE; + case 's': + ++ sym; + symlen = strtol (sym, &sym, 10); + ++ sym; /* Skip the trailing ':'. */ + + if ((symend < sym) || ((symlen + 1) > bufsz)) + { + bfd_set_error (bfd_error_invalid_operation); + return FALSE; + } + + memcpy (symbuf, sym, symlen); + symbuf [symlen] = '\0'; + * advanced = sym + symlen; + + /* Is it always possible, with complex symbols, that gas "mis-guessed" + the symbol as a section, or vice-versa. so we're pretty liberal in our + interpretation here; section means "try section first", not "must be a + section", and likewise with symbol. */ + + if (symbol_is_section) + { + if ((resolve_section (symbuf, finfo->output_bfd->sections, result) != TRUE) + && (resolve_symbol (symbuf, input_bfd, finfo, result, locsymcount) != TRUE)) + { + undefined_reference ("section", symbuf); + return FALSE; + } + } + else + { + if ((resolve_symbol (symbuf, input_bfd, finfo, result, locsymcount) != TRUE) + && (resolve_section (symbuf, finfo->output_bfd->sections, + result) != TRUE)) + { + undefined_reference ("symbol", symbuf); + return FALSE; + } + } + + return TRUE; + + /* All that remains are operators. */ + +#define UNARY_OP(op) \ + if (strncmp (sym, #op, strlen (#op)) == 0) \ + { \ + sym += strlen (#op); \ + if (* sym == ':') \ + ++ sym; \ + if (eval_symbol (& a, sym, & sym, input_bfd, finfo, addr, \ + section_offset, locsymcount, signed_p) \ + != TRUE) \ + return FALSE; \ + if (signed_p) \ + * result = op ((signed)a); \ + else \ + * result = op a; \ + * advanced = sym; \ + return TRUE; \ + } + +#define BINARY_OP(op) \ + if (strncmp (sym, #op, strlen (#op)) == 0) \ + { \ + sym += strlen (#op); \ + if (* sym == ':') \ + ++ sym; \ + if (eval_symbol (& a, sym, & sym, input_bfd, finfo, addr, \ + section_offset, locsymcount, signed_p) \ + != TRUE) \ + return FALSE; \ + ++ sym; \ + if (eval_symbol (& b, sym, & sym, input_bfd, finfo, addr, \ + section_offset, locsymcount, signed_p) \ + != TRUE) \ + return FALSE; \ + if (signed_p) \ + * result = ((signed) a) op ((signed) b); \ + else \ + * result = a op b; \ + * advanced = sym; \ + return TRUE; \ + } + + default: + UNARY_OP (0-); + BINARY_OP (<<); + BINARY_OP (>>); + BINARY_OP (==); + BINARY_OP (!=); + BINARY_OP (<=); + BINARY_OP (>=); + BINARY_OP (&&); + BINARY_OP (||); + UNARY_OP (~); + UNARY_OP (!); + BINARY_OP (*); + BINARY_OP (/); + BINARY_OP (%); + BINARY_OP (^); + BINARY_OP (|); + BINARY_OP (&); + BINARY_OP (+); + BINARY_OP (-); + BINARY_OP (<); + BINARY_OP (>); +#undef UNARY_OP +#undef BINARY_OP + _bfd_error_handler (_("unknown operator '%c' in complex symbol"), * sym); + bfd_set_error (bfd_error_invalid_operation); + return FALSE; + } +} + +/* Entry point to evaluator, called from elf_link_input_bfd. */ + +static bfd_boolean +evaluate_complex_relocation_symbols (bfd * input_bfd, + struct elf_final_link_info * finfo, + size_t locsymcount) +{ + const struct elf_backend_data * bed; + Elf_Internal_Shdr * symtab_hdr; + struct elf_link_hash_entry ** sym_hashes; + asection * reloc_sec; + bfd_boolean result = TRUE; + + /* For each section, we're going to check and see if it has any + complex relocations, and we're going to evaluate any of them + we can. */ + + if (finfo->info->relocatable) + return TRUE; + + symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (input_bfd); + bed = get_elf_backend_data (input_bfd); + + for (reloc_sec = input_bfd->sections; reloc_sec; reloc_sec = reloc_sec->next) + { + Elf_Internal_Rela * internal_relocs; + unsigned long i; + + /* This section was omitted from the link. */ + if (! reloc_sec->linker_mark) + continue; + + /* Only process sections containing relocs. */ + if ((reloc_sec->flags & SEC_RELOC) == 0) + continue; + + if (reloc_sec->reloc_count == 0) + continue; + + /* Read in the relocs for this section. */ + internal_relocs + = _bfd_elf_link_read_relocs (input_bfd, reloc_sec, NULL, + (Elf_Internal_Rela *) NULL, + FALSE); + if (internal_relocs == NULL) + continue; + + for (i = reloc_sec->reloc_count; i--;) + { + Elf_Internal_Rela * rel; + char * sym_name; + bfd_vma index; + Elf_Internal_Sym * sym; + bfd_vma result; + bfd_vma section_offset; + bfd_vma addr; + int signed_p = 0; + + rel = internal_relocs + i; + section_offset = reloc_sec->output_section->vma + + reloc_sec->output_offset; + addr = rel->r_offset; + + index = ELF32_R_SYM (rel->r_info); + if (bed->s->arch_size == 64) + index >>= 24; + + if (index == STN_UNDEF) + continue; + + if (index < locsymcount) + { + /* The symbol is local. */ + sym = finfo->internal_syms + index; + + /* We're only processing STT_RELC or STT_SRELC type symbols. */ + if ((ELF_ST_TYPE (sym->st_info) != STT_RELC) && + (ELF_ST_TYPE (sym->st_info) != STT_SRELC)) + continue; + + sym_name = bfd_elf_string_from_elf_section + (input_bfd, symtab_hdr->sh_link, sym->st_name); + + signed_p = (ELF_ST_TYPE (sym->st_info) == STT_SRELC); + } + else + { + /* The symbol is global. */ + struct elf_link_hash_entry * h; + + if (elf_bad_symtab (input_bfd)) + continue; + + h = sym_hashes [index - locsymcount]; + while ( h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (h->type != STT_RELC && h->type != STT_SRELC) + continue; + + signed_p = (h->type == STT_SRELC); + sym_name = (char *) h->root.root.string; + } +#ifdef DEBUG + printf ("Encountered a complex symbol!"); + printf (" (input_bfd %s, section %s, reloc %ld\n", + input_bfd->filename, reloc_sec->name, i); + printf (" symbol: idx %8.8lx, name %s\n", + index, sym_name); + printf (" reloc : info %8.8lx, addr %8.8lx\n", + rel->r_info, addr); + printf (" Evaluating '%s' ...\n ", sym_name); +#endif + if (eval_symbol (& result, sym_name, & sym_name, input_bfd, + finfo, addr, section_offset, locsymcount, + signed_p)) + /* Symbol evaluated OK. Update to absolute value. */ + set_symbol_value (input_bfd, finfo, index, result); + + else + result = FALSE; + } + + if (internal_relocs != elf_section_data (reloc_sec)->relocs) + free (internal_relocs); + } + + /* If nothing went wrong, then we adjusted + everything we wanted to adjust. */ + return result; +} + +static void +put_value (bfd_vma size, + unsigned long chunksz, + bfd * input_bfd, + bfd_vma x, + bfd_byte * location) +{ + location += (size - chunksz); + + for (; size; size -= chunksz, location -= chunksz, x >>= (chunksz * 8)) + { + switch (chunksz) + { + default: + case 0: + abort (); + case 1: + bfd_put_8 (input_bfd, x, location); + break; + case 2: + bfd_put_16 (input_bfd, x, location); + break; + case 4: + bfd_put_32 (input_bfd, x, location); + break; + case 8: +#ifdef BFD64 + bfd_put_64 (input_bfd, x, location); +#else + abort (); +#endif + break; + } + } +} + +static bfd_vma +get_value (bfd_vma size, + unsigned long chunksz, + bfd * input_bfd, + bfd_byte * location) +{ + bfd_vma x = 0; + + for (; size; size -= chunksz, location += chunksz) + { + switch (chunksz) + { + default: + case 0: + abort (); + case 1: + x = (x << (8 * chunksz)) | bfd_get_8 (input_bfd, location); + break; + case 2: + x = (x << (8 * chunksz)) | bfd_get_16 (input_bfd, location); + break; + case 4: + x = (x << (8 * chunksz)) | bfd_get_32 (input_bfd, location); + break; + case 8: +#ifdef BFD64 + x = (x << (8 * chunksz)) | bfd_get_64 (input_bfd, location); +#else + abort (); +#endif + break; + } + } + return x; +} + +static void +decode_complex_addend + (unsigned long * start, /* in bits */ + unsigned long * oplen, /* in bits */ + unsigned long * len, /* in bits */ + unsigned long * wordsz, /* in bytes */ + unsigned long * chunksz, /* in bytes */ + unsigned long * lsb0_p, + unsigned long * signed_p, + unsigned long * trunc_p, + unsigned long encoded) +{ + * start = encoded & 0x3F; + * len = (encoded >> 6) & 0x3F; + * oplen = (encoded >> 12) & 0x3F; + * wordsz = (encoded >> 18) & 0xF; + * chunksz = (encoded >> 22) & 0xF; + * lsb0_p = (encoded >> 27) & 1; + * signed_p = (encoded >> 28) & 1; + * trunc_p = (encoded >> 29) & 1; +} + +void +bfd_elf_perform_complex_relocation + (bfd * output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info * info, + bfd * input_bfd, + asection * input_section, + bfd_byte * contents, + Elf_Internal_Rela * rel, + Elf_Internal_Sym * local_syms, + asection ** local_sections) +{ + const struct elf_backend_data * bed; + Elf_Internal_Shdr * symtab_hdr; + asection * sec; + bfd_vma relocation = 0, shift, x; + bfd_vma r_symndx; + bfd_vma mask; + unsigned long start, oplen, len, wordsz, + chunksz, lsb0_p, signed_p, trunc_p; + + /* Perform this reloc, since it is complex. + (this is not to say that it necessarily refers to a complex + symbol; merely that it is a self-describing CGEN based reloc. + i.e. the addend has the complete reloc information (bit start, end, + word size, etc) encoded within it.). */ + r_symndx = ELF32_R_SYM (rel->r_info); + bed = get_elf_backend_data (input_bfd); + if (bed->s->arch_size == 64) + r_symndx >>= 24; + +#ifdef DEBUG + printf ("Performing complex relocation %ld...\n", r_symndx); +#endif + + symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; + if (r_symndx < symtab_hdr->sh_info) + { + /* The symbol is local. */ + Elf_Internal_Sym * sym; + + sym = local_syms + r_symndx; + sec = local_sections [r_symndx]; + relocation = sym->st_value; + if (sym->st_shndx > SHN_UNDEF && + sym->st_shndx < SHN_LORESERVE) + relocation += (sec->output_offset + + sec->output_section->vma); + } + else + { + /* The symbol is global. */ + struct elf_link_hash_entry **sym_hashes; + struct elf_link_hash_entry * h; + + sym_hashes = elf_sym_hashes (input_bfd); + h = sym_hashes [r_symndx]; + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + sec = h->root.u.def.section; + relocation = h->root.u.def.value; + + if (! bfd_is_abs_section (sec)) + relocation += (sec->output_section->vma + + sec->output_offset); + } + if (h->root.type == bfd_link_hash_undefined + && !((*info->callbacks->undefined_symbol) + (info, h->root.root.string, input_bfd, + input_section, rel->r_offset, + info->unresolved_syms_in_objects == RM_GENERATE_ERROR + || ELF_ST_VISIBILITY (h->other)))) + return; + } + + decode_complex_addend (& start, & oplen, & len, & wordsz, + & chunksz, & lsb0_p, & signed_p, + & trunc_p, rel->r_addend); + + mask = (((1L << (len - 1)) - 1) << 1) | 1; + + if (lsb0_p) + shift = (start + 1) - len; + else + shift = (8 * wordsz) - (start + len); + + x = get_value (wordsz, chunksz, input_bfd, contents + rel->r_offset); + +#ifdef DEBUG + printf ("Doing complex reloc: " + "lsb0? %ld, signed? %ld, trunc? %ld, wordsz %ld, " + "chunksz %ld, start %ld, len %ld, oplen %ld\n" + " dest: %8.8lx, mask: %8.8lx, reloc: %8.8lx\n", + lsb0_p, signed_p, trunc_p, wordsz, chunksz, start, len, + oplen, x, mask, relocation); +#endif + + if (! trunc_p) + { + /* Now do an overflow check. */ + if (bfd_check_overflow ((signed_p ? + complain_overflow_signed : + complain_overflow_unsigned), + len, 0, (8 * wordsz), + relocation) == bfd_reloc_overflow) + (*_bfd_error_handler) + ("%s (%s + 0x%lx): relocation overflow: 0x%lx %sdoes not fit " + "within 0x%lx", + input_bfd->filename, input_section->name, rel->r_offset, + relocation, (signed_p ? "(signed) " : ""), mask); + } + + /* Do the deed. */ + x = (x & ~(mask << shift)) | ((relocation & mask) << shift); + +#ifdef DEBUG + printf (" relocation: %8.8lx\n" + " shifted mask: %8.8lx\n" + " shifted/masked reloc: %8.8lx\n" + " result: %8.8lx\n", + relocation, (mask << shift), + ((relocation & mask) << shift), x); +#endif + put_value (wordsz, chunksz, input_bfd, x, contents + rel->r_offset); +} + /* When performing a relocatable link, the input relocations are preserved. But, if they reference global symbols, the indices referenced must be updated. Update all the relocations in @@ -5994,7 +7266,9 @@ elf_link_sort_cmp2 (const void *A, const void *B) static size_t elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec) { - asection *reldyn; + asection *dynamic_relocs; + asection *rela_dyn; + asection *rel_dyn; bfd_size_type count, size; size_t i, ret, sort_elt, ext_size; bfd_byte *sort, *s_non_relative, *p; @@ -6005,39 +7279,170 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec) void (*swap_out) (bfd *, const Elf_Internal_Rela *, bfd_byte *); struct bfd_link_order *lo; bfd_vma r_sym_mask; + bfd_boolean use_rela; - reldyn = bfd_get_section_by_name (abfd, ".rela.dyn"); - if (reldyn == NULL || reldyn->size == 0) + /* Find a dynamic reloc section. */ + rela_dyn = bfd_get_section_by_name (abfd, ".rela.dyn"); + rel_dyn = bfd_get_section_by_name (abfd, ".rel.dyn"); + if (rela_dyn != NULL && rela_dyn->size > 0 + && rel_dyn != NULL && rel_dyn->size > 0) { - reldyn = bfd_get_section_by_name (abfd, ".rel.dyn"); - if (reldyn == NULL || reldyn->size == 0) - return 0; - ext_size = bed->s->sizeof_rel; - swap_in = bed->s->swap_reloc_in; - swap_out = bed->s->swap_reloc_out; + bfd_boolean use_rela_initialised = FALSE; + + /* This is just here to stop gcc from complaining. + It's initialization checking code is not perfect. */ + use_rela = TRUE; + + /* Both sections are present. Examine the sizes + of the indirect sections to help us choose. */ + for (lo = rela_dyn->map_head.link_order; lo != NULL; lo = lo->next) + if (lo->type == bfd_indirect_link_order) + { + asection *o = lo->u.indirect.section; + + if ((o->size % bed->s->sizeof_rela) == 0) + { + if ((o->size % bed->s->sizeof_rel) == 0) + /* Section size is divisible by both rel and rela sizes. + It is of no help to us. */ + ; + else + { + /* Section size is only divisible by rela. */ + if (use_rela_initialised && (use_rela == FALSE)) + { + _bfd_error_handler + (_("%B: Unable to sort relocs - they are in more than one size"), abfd); + bfd_set_error (bfd_error_invalid_operation); + return 0; + } + else + { + use_rela = TRUE; + use_rela_initialised = TRUE; + } + } + } + else if ((o->size % bed->s->sizeof_rel) == 0) + { + /* Section size is only divisible by rel. */ + if (use_rela_initialised && (use_rela == TRUE)) + { + _bfd_error_handler + (_("%B: Unable to sort relocs - they are in more than one size"), abfd); + bfd_set_error (bfd_error_invalid_operation); + return 0; + } + else + { + use_rela = FALSE; + use_rela_initialised = TRUE; + } + } + else + { + /* The section size is not divisible by either - something is wrong. */ + _bfd_error_handler + (_("%B: Unable to sort relocs - they are of an unknown size"), abfd); + bfd_set_error (bfd_error_invalid_operation); + return 0; + } + } + + for (lo = rel_dyn->map_head.link_order; lo != NULL; lo = lo->next) + if (lo->type == bfd_indirect_link_order) + { + asection *o = lo->u.indirect.section; + + if ((o->size % bed->s->sizeof_rela) == 0) + { + if ((o->size % bed->s->sizeof_rel) == 0) + /* Section size is divisible by both rel and rela sizes. + It is of no help to us. */ + ; + else + { + /* Section size is only divisible by rela. */ + if (use_rela_initialised && (use_rela == FALSE)) + { + _bfd_error_handler + (_("%B: Unable to sort relocs - they are in more than one size"), abfd); + bfd_set_error (bfd_error_invalid_operation); + return 0; + } + else + { + use_rela = TRUE; + use_rela_initialised = TRUE; + } + } + } + else if ((o->size % bed->s->sizeof_rel) == 0) + { + /* Section size is only divisible by rel. */ + if (use_rela_initialised && (use_rela == TRUE)) + { + _bfd_error_handler + (_("%B: Unable to sort relocs - they are in more than one size"), abfd); + bfd_set_error (bfd_error_invalid_operation); + return 0; + } + else + { + use_rela = FALSE; + use_rela_initialised = TRUE; + } + } + else + { + /* The section size is not divisible by either - something is wrong. */ + _bfd_error_handler + (_("%B: Unable to sort relocs - they are of an unknown size"), abfd); + bfd_set_error (bfd_error_invalid_operation); + return 0; + } + } + + if (! use_rela_initialised) + /* Make a guess. */ + use_rela = TRUE; } + else if (rela_dyn != NULL && rela_dyn->size > 0) + use_rela = TRUE; + else if (rel_dyn != NULL && rel_dyn->size > 0) + use_rela = FALSE; else + return 0; + + if (use_rela) { + dynamic_relocs = rela_dyn; ext_size = bed->s->sizeof_rela; swap_in = bed->s->swap_reloca_in; swap_out = bed->s->swap_reloca_out; } - count = reldyn->size / ext_size; + else + { + dynamic_relocs = rel_dyn; + ext_size = bed->s->sizeof_rel; + swap_in = bed->s->swap_reloc_in; + swap_out = bed->s->swap_reloc_out; + } size = 0; - for (lo = reldyn->map_head.link_order; lo != NULL; lo = lo->next) + for (lo = dynamic_relocs->map_head.link_order; lo != NULL; lo = lo->next) if (lo->type == bfd_indirect_link_order) - { - asection *o = lo->u.indirect.section; - size += o->size; - } + size += lo->u.indirect.section->size; - if (size != reldyn->size) + if (size != dynamic_relocs->size) return 0; sort_elt = (sizeof (struct elf_link_sort_rela) + (i2e - 1) * sizeof (Elf_Internal_Rela)); + + count = dynamic_relocs->size / ext_size; sort = bfd_zmalloc (sort_elt * count); + if (sort == NULL) { (*info->callbacks->warning) @@ -6050,7 +7455,7 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec) else r_sym_mask = ~(bfd_vma) 0xffffffff; - for (lo = reldyn->map_head.link_order; lo != NULL; lo = lo->next) + for (lo = dynamic_relocs->map_head.link_order; lo != NULL; lo = lo->next) if (lo->type == bfd_indirect_link_order) { bfd_byte *erel, *erelend; @@ -6067,9 +7472,11 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec) erel = o->contents; erelend = o->contents + o->size; p = sort + o->output_offset / ext_size * sort_elt; + while (erel < erelend) { struct elf_link_sort_rela *s = (struct elf_link_sort_rela *) p; + (*swap_in) (abfd, erel, s->rela); s->type = (*bed->elf_backend_reloc_type_class) (s->rela); s->u.sym_mask = r_sym_mask; @@ -6100,7 +7507,7 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec) qsort (s_non_relative, count - ret, sort_elt, elf_link_sort_cmp2); - for (lo = reldyn->map_head.link_order; lo != NULL; lo = lo->next) + for (lo = dynamic_relocs->map_head.link_order; lo != NULL; lo = lo->next) if (lo->type == bfd_indirect_link_order) { bfd_byte *erel, *erelend; @@ -6119,7 +7526,7 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec) } free (sort); - *psec = reldyn; + *psec = dynamic_relocs; return ret; } @@ -6657,11 +8064,6 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data) if (h->dynindx != -1 && elf_hash_table (finfo->info)->dynamic_sections_created) { - size_t bucketcount; - size_t bucket; - size_t hash_entry_size; - bfd_byte *bucketpos; - bfd_vma chain; bfd_byte *esym; sym.st_name = h->dynstr_index; @@ -6673,17 +8075,27 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data) } bed->s->swap_symbol_out (finfo->output_bfd, &sym, esym, 0); - bucketcount = elf_hash_table (finfo->info)->bucketcount; - bucket = h->u.elf_hash_value % bucketcount; - hash_entry_size - = elf_section_data (finfo->hash_sec)->this_hdr.sh_entsize; - bucketpos = ((bfd_byte *) finfo->hash_sec->contents - + (bucket + 2) * hash_entry_size); - chain = bfd_get (8 * hash_entry_size, finfo->output_bfd, bucketpos); - bfd_put (8 * hash_entry_size, finfo->output_bfd, h->dynindx, bucketpos); - bfd_put (8 * hash_entry_size, finfo->output_bfd, chain, - ((bfd_byte *) finfo->hash_sec->contents - + (bucketcount + 2 + h->dynindx) * hash_entry_size)); + if (finfo->hash_sec != NULL) + { + size_t hash_entry_size; + bfd_byte *bucketpos; + bfd_vma chain; + size_t bucketcount; + size_t bucket; + + bucketcount = elf_hash_table (finfo->info)->bucketcount; + bucket = h->u.elf_hash_value % bucketcount; + + hash_entry_size + = elf_section_data (finfo->hash_sec)->this_hdr.sh_entsize; + bucketpos = ((bfd_byte *) finfo->hash_sec->contents + + (bucket + 2) * hash_entry_size); + chain = bfd_get (8 * hash_entry_size, finfo->output_bfd, bucketpos); + bfd_put (8 * hash_entry_size, finfo->output_bfd, h->dynindx, bucketpos); + bfd_put (8 * hash_entry_size, finfo->output_bfd, chain, + ((bfd_byte *) finfo->hash_sec->contents + + (bucketcount + 2 + h->dynindx) * hash_entry_size)); + } if (finfo->symver_sec != NULL && finfo->symver_sec->contents != NULL) { @@ -6784,14 +8196,15 @@ _bfd_elf_default_action_discarded (asection *sec) /* Find a match between a section and a member of a section group. */ static asection * -match_group_member (asection *sec, asection *group) +match_group_member (asection *sec, asection *group, + struct bfd_link_info *info) { asection *first = elf_next_in_group (group); asection *s = first; while (s != NULL) { - if (bfd_elf_match_symbols_in_sections (s, sec)) + if (bfd_elf_match_symbols_in_sections (s, sec, info)) return s; s = elf_next_in_group (s); @@ -6803,21 +8216,22 @@ match_group_member (asection *sec, asection *group) } /* Check if the kept section of a discarded section SEC can be used - to replace it. Return the replacement if it is OK. Otherwise return - NULL. */ + to replace it. Return the replacement if it is OK. Otherwise return + NULL. */ asection * -_bfd_elf_check_kept_section (asection *sec) +_bfd_elf_check_kept_section (asection *sec, struct bfd_link_info *info) { asection *kept; kept = sec->kept_section; if (kept != NULL) { - if (elf_sec_group (sec) != NULL) - kept = match_group_member (sec, kept); + if ((kept->flags & SEC_GROUP) != 0) + kept = match_group_member (sec, kept, info); if (kept != NULL && sec->size != kept->size) kept = NULL; + sec->kept_section = kept; } return kept; } @@ -6830,7 +8244,7 @@ _bfd_elf_check_kept_section (asection *sec) static bfd_boolean elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) { - bfd_boolean (*relocate_section) + int (*relocate_section) (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **); bfd *output_bfd; @@ -6844,7 +8258,6 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) asection **ppsection; asection *o; const struct elf_backend_data *bed; - bfd_boolean emit_relocs; struct elf_link_hash_entry **sym_hashes; output_bfd = finfo->output_bfd; @@ -6857,9 +8270,6 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) if ((input_bfd->flags & DYNAMIC) != 0) return TRUE; - emit_relocs = (finfo->info->relocatable - || finfo->info->emitrelocations); - symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; if (elf_bad_symtab (input_bfd)) { @@ -6883,6 +8293,15 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) if (isymbuf == NULL) return FALSE; } + /* evaluate_complex_relocation_symbols looks for symbols in + finfo->internal_syms. */ + else if (isymbuf != NULL && locsymcount != 0) + { + bfd_elf_get_elf_syms (input_bfd, symtab_hdr, locsymcount, 0, + finfo->internal_syms, + finfo->external_syms, + finfo->locsym_shndx); + } /* Find local symbol sections and adjust values of symbols in SEC_MERGE sections. Write out those local symbols we know are @@ -7020,6 +8439,9 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) return FALSE; } + if (! evaluate_complex_relocation_symbols (input_bfd, finfo, locsymcount)) + return FALSE; + /* Relocate the contents of each section. */ sym_hashes = elf_sym_hashes (input_bfd); for (o = input_bfd->sections; o != NULL; o = o->next) @@ -7063,6 +8485,7 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) Elf_Internal_Rela *internal_relocs; bfd_vma r_type_mask; int r_sym_shift; + int ret; /* Get the swapped relocs. */ internal_relocs @@ -7168,23 +8591,14 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) { asection *kept; - kept = _bfd_elf_check_kept_section (sec); + kept = _bfd_elf_check_kept_section (sec, + finfo->info); if (kept != NULL) { *ps = kept; continue; } } - - /* Remove the symbol reference from the reloc, but - don't kill the reloc completely. This is so that - a zero value will be written into the section, - which may have non-zero contents put there by the - assembler. Zero in things like an eh_frame fde - pc_begin allows stack unwinders to recognize the - fde as bogus. */ - rel->r_info &= r_type_mask; - rel->r_addend = 0; } } } @@ -7209,14 +8623,17 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) corresponding to the output section, which will require the addend to be adjusted. */ - if (! (*relocate_section) (output_bfd, finfo->info, + ret = (*relocate_section) (output_bfd, finfo->info, input_bfd, o, contents, internal_relocs, isymbuf, - finfo->sections)) + finfo->sections); + if (!ret) return FALSE; - if (emit_relocs) + if (ret == 2 + || finfo->info->relocatable + || finfo->info->emitrelocations) { Elf_Internal_Rela *irela; Elf_Internal_Rela *irelaend; @@ -7263,7 +8680,7 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) /* This is a reloc for a deleted entry or somesuch. Turn it into an R_*_NONE reloc, at the same offset as the last reloc. elf_eh_frame.c and - elf_bfd_discard_info rely on reloc offsets + bfd_elf_discard_info rely on reloc offsets being ordered. */ irela->r_offset = last_offset; irela->r_info = 0; @@ -7338,8 +8755,10 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) /* If we have discarded a section, the output section will be the absolute section. In - case of discarded link-once and discarded - SEC_MERGE sections, use the kept section. */ + case of discarded SEC_MERGE sections, use + the kept section. relocate_section should + have already handled discarded linkonce + sections. */ if (bfd_is_abs_section (osec) && sec->kept_section != NULL && sec->kept_section->output_section != NULL) @@ -7351,6 +8770,24 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) if (!bfd_is_abs_section (osec)) { r_symndx = osec->target_index; + if (r_symndx == 0) + { + struct elf_link_hash_table *htab; + asection *oi; + + htab = elf_hash_table (finfo->info); + oi = htab->text_index_section; + if ((osec->flags & SEC_READONLY) == 0 + && htab->data_index_section != NULL) + oi = htab->data_index_section; + + if (oi != NULL) + { + irela->r_addend += osec->vma - oi->vma; + r_symndx = oi->target_index; + } + } + BFD_ASSERT (r_symndx != 0); } } @@ -7446,7 +8883,8 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) /* Write out the modified section contents. */ if (bed->elf_backend_write_section - && (*bed->elf_backend_write_section) (output_bfd, o, contents)) + && (*bed->elf_backend_write_section) (output_bfd, finfo->info, o, + contents)) { /* Section written out. */ } @@ -7828,6 +9266,9 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) size_t relativecount = 0; asection *reldyn = 0; bfd_size_type amt; + asection *attr_section = NULL; + bfd_vma attr_size = 0; + const char *std_attrs_section; if (! is_elf_hash_table (info->hash)) return FALSE; @@ -7857,7 +9298,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) { finfo.dynsym_sec = bfd_get_section_by_name (dynobj, ".dynsym"); finfo.hash_sec = bfd_get_section_by_name (dynobj, ".hash"); - BFD_ASSERT (finfo.dynsym_sec != NULL && finfo.hash_sec != NULL); + BFD_ASSERT (finfo.dynsym_sec != NULL); finfo.symver_sec = bfd_get_section_by_name (dynobj, ".gnu.version"); /* Note that it is OK if symver_sec is NULL. */ } @@ -7875,6 +9316,40 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) finfo.symbuf_count = 0; finfo.shndxbuf_size = 0; + /* The object attributes have been merged. Remove the input + sections from the link, and set the contents of the output + secton. */ + std_attrs_section = get_elf_backend_data (abfd)->obj_attrs_section; + for (o = abfd->sections; o != NULL; o = o->next) + { + if ((std_attrs_section && strcmp (o->name, std_attrs_section) == 0) + || strcmp (o->name, ".gnu.attributes") == 0) + { + for (p = o->map_head.link_order; p != NULL; p = p->next) + { + asection *input_section; + + if (p->type != bfd_indirect_link_order) + continue; + input_section = p->u.indirect.section; + /* Hack: reset the SEC_HAS_CONTENTS flag so that + elf_link_input_bfd ignores this section. */ + input_section->flags &= ~SEC_HAS_CONTENTS; + } + + attr_size = bfd_elf_obj_attr_size (abfd); + if (attr_size) + { + bfd_set_section_size (abfd, o, attr_size); + attr_section = o; + /* Skip this section later on. */ + o->map_head.link_order = NULL; + } + else + o->flags |= SEC_EXCLUDE; + } + } + /* Count up the number of relocations we will output for each output section, so that we know the sizes of the reloc sections. We also figure out some maximum sizes. */ @@ -7920,13 +9395,18 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) { Elf_Internal_Rela * relocs; - relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, + relocs = _bfd_elf_link_read_relocs (sec->owner, sec, + NULL, NULL, info->keep_memory); - reloc_count = (*bed->elf_backend_count_relocs) (sec, relocs); + if (relocs != NULL) + { + reloc_count + = (*bed->elf_backend_count_relocs) (sec, relocs); - if (elf_section_data (o)->relocs != relocs) - free (relocs); + if (elf_section_data (sec)->relocs != relocs) + free (relocs); + } } if (sec->rawsize > max_contents_size) @@ -8141,18 +9621,19 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) elfsym.st_size = 0; elfsym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION); elfsym.st_other = 0; + elfsym.st_value = 0; for (i = 1; i < elf_numsections (abfd); i++) { o = bfd_section_from_elf_index (abfd, i); if (o != NULL) - o->target_index = bfd_get_symcount (abfd); - elfsym.st_shndx = i; - if (info->relocatable || o == NULL) - elfsym.st_value = 0; - else - elfsym.st_value = o->vma; - if (! elf_link_output_sym (&finfo, NULL, &elfsym, o, NULL)) - goto error_return; + { + o->target_index = bfd_get_symcount (abfd); + elfsym.st_shndx = i; + if (!info->relocatable) + elfsym.st_value = o->vma; + if (!elf_link_output_sym (&finfo, NULL, &elfsym, o, NULL)) + goto error_return; + } if (i == SHN_LORESERVE - 1) i += SHN_HIRESERVE + 1 - SHN_LORESERVE; } @@ -8298,6 +9779,18 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) } } + /* Free symbol buffer if needed. */ + if (!info->reduce_memory_overheads) + { + for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + if (bfd_get_flavour (sub) == bfd_target_elf_flavour + && elf_tdata (sub)->symbuf) + { + free (elf_tdata (sub)->symbuf); + elf_tdata (sub)->symbuf = NULL; + } + } + /* Output any global symbols that got converted to local in a version script or due to symbol visibility. We do this in a separate step since ELF requires all local symbols to appear @@ -8312,6 +9805,19 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) if (eoinfo.failed) return FALSE; + /* If backend needs to output some local symbols not present in the hash + table, do it now. */ + if (bed->elf_backend_output_arch_local_syms) + { + typedef bfd_boolean (*out_sym_func) + (void *, const char *, Elf_Internal_Sym *, asection *, + struct elf_link_hash_entry *); + + if (! ((*bed->elf_backend_output_arch_local_syms) + (abfd, info, &finfo, (out_sym_func) elf_link_output_sym))) + return FALSE; + } + /* That wrote out all the local symbols. Finish up the symbol table with the global symbols. Even if we want to strip everything we can, we still need to deal with those global symbols that got @@ -8603,6 +10109,9 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) case DT_HASH: name = ".hash"; goto get_vma; + case DT_GNU_HASH: + name = ".gnu.hash"; + goto get_vma; case DT_STRTAB: name = ".dynstr"; goto get_vma; @@ -8686,8 +10195,8 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) if (dyn.d_tag == DT_TEXTREL) { - _bfd_error_handler - (_("warning: creating a DT_TEXTREL in a shared object.")); + info->callbacks->einfo + (_("%P: warning: creating a DT_TEXTREL in a shared object.\n")); break; } } @@ -8785,6 +10294,16 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) elf_tdata (abfd)->linker = TRUE; + if (attr_section) + { + bfd_byte *contents = bfd_malloc (attr_size); + if (contents == NULL) + goto error_return; + bfd_elf_set_obj_attr_contents (abfd, contents, attr_size); + bfd_set_section_contents (abfd, attr_section, contents, 0, attr_size); + free (contents); + } + return TRUE; error_return: @@ -8822,18 +10341,44 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) /* Garbage collect unused sections. */ +/* Default gc_mark_hook. */ + +asection * +_bfd_elf_gc_mark_hook (asection *sec, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + Elf_Internal_Rela *rel ATTRIBUTE_UNUSED, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) +{ + if (h != NULL) + { + switch (h->root.type) + { + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + return h->root.u.def.section; + + case bfd_link_hash_common: + return h->root.u.c.p->section; + + default: + break; + } + } + else + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); + + return NULL; +} + /* The mark phase of garbage collection. For a given section, mark it and any sections in this section's group, and all the sections which define symbols to which it refers. */ -typedef asection * (*gc_mark_hook_fn) - (asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *); - bfd_boolean _bfd_elf_gc_mark (struct bfd_link_info *info, asection *sec, - gc_mark_hook_fn gc_mark_hook) + elf_gc_mark_hook_fn gc_mark_hook) { bfd_boolean ret; bfd_boolean is_eh; @@ -8954,7 +10499,8 @@ _bfd_elf_gc_mark (struct bfd_link_info *info, /* Sweep symbols in swept sections. Called via elf_link_hash_traverse. */ -struct elf_gc_sweep_symbol_info { +struct elf_gc_sweep_symbol_info +{ struct bfd_link_info *info; void (*hide_symbol) (struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean); @@ -9017,6 +10563,9 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info) to remove a section from the output. */ o->flags |= SEC_EXCLUDE; + if (info->print_gc_sections && o->size != 0) + _bfd_error_handler (_("Removing unused section '%s' in file '%B'"), sub, o->name); + /* But we also have to update some of the relocation info we collected before. */ if (gc_sweep_hook @@ -9198,9 +10747,7 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info) { bfd_boolean ok = TRUE; bfd *sub; - asection * (*gc_mark_hook) - (asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *h, Elf_Internal_Sym *); + elf_gc_mark_hook_fn gc_mark_hook; const struct elf_backend_data *bed = get_elf_backend_data (abfd); if (!bed->can_gc_sections @@ -9242,11 +10789,15 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info) continue; for (o = sub->sections; o != NULL; o = o->next) - if ((o->flags & SEC_KEEP) != 0 && !o->gc_mark) + if ((o->flags & (SEC_EXCLUDE | SEC_KEEP)) == SEC_KEEP && !o->gc_mark) if (!_bfd_elf_gc_mark (info, o, gc_mark_hook)) return FALSE; } + /* Allow the backend to mark additional target specific sections. */ + if (bed->gc_mark_extra_sections) + bed->gc_mark_extra_sections(info, gc_mark_hook); + /* ... again for sections marked from eh_frame. */ for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) { @@ -9262,30 +10813,38 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info) easily due to needing special relocs to handle the difference of two symbols in separate sections. Don't keep code sections referenced by .eh_frame. */ +#define TEXT_PREFIX ".text." +#define TEXT_PREFIX2 ".gnu.linkonce.t." +#define GCC_EXCEPT_TABLE_PREFIX ".gcc_except_table." for (o = sub->sections; o != NULL; o = o->next) if (!o->gc_mark && o->gc_mark_from_eh && (o->flags & SEC_CODE) == 0) { - if (strncmp (o->name, ".gcc_except_table.", 18) == 0) + if (CONST_STRNEQ (o->name, GCC_EXCEPT_TABLE_PREFIX)) { - unsigned long len; char *fn_name; + const char *sec_name; asection *fn_text; + unsigned o_name_prefix_len , fn_name_prefix_len, tmp; - len = strlen (o->name + 18) + 1; - fn_name = bfd_malloc (len + 16); + o_name_prefix_len = strlen (GCC_EXCEPT_TABLE_PREFIX); + sec_name = o->name + o_name_prefix_len; + fn_name_prefix_len = strlen (TEXT_PREFIX); + tmp = strlen (TEXT_PREFIX2); + if (tmp > fn_name_prefix_len) + fn_name_prefix_len = tmp; + fn_name + = bfd_malloc (fn_name_prefix_len + strlen (sec_name) + 1); if (fn_name == NULL) return FALSE; /* Try the first prefix. */ - memcpy (fn_name, ".text.", 6); - memcpy (fn_name + 6, o->name + 18, len); + sprintf (fn_name, "%s%s", TEXT_PREFIX, sec_name); fn_text = bfd_get_section_by_name (sub, fn_name); /* Try the second prefix. */ if (fn_text == NULL) { - memcpy (fn_name, ".gnu.linkonce.t.", 16); - memcpy (fn_name + 16, o->name + 18, len); + sprintf (fn_name, "%s%s", TEXT_PREFIX2, sec_name); fn_text = bfd_get_section_by_name (sub, fn_name); } @@ -9637,12 +11196,15 @@ bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info) if ((abfd->flags & DYNAMIC) != 0) continue; - eh = bfd_get_section_by_name (abfd, ".eh_frame"); - if (info->relocatable - || (eh != NULL + eh = NULL; + if (!info->relocatable) + { + eh = bfd_get_section_by_name (abfd, ".eh_frame"); + if (eh != NULL && (eh->size == 0 - || bfd_is_abs_section (eh->output_section)))) - eh = NULL; + || bfd_is_abs_section (eh->output_section))) + eh = NULL; + } stab = bfd_get_section_by_name (abfd, ".stab"); if (stab != NULL @@ -9683,7 +11245,10 @@ bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info) cookie.locsymcount, 0, NULL, NULL, NULL); if (cookie.locsyms == NULL) - return FALSE; + { + info->callbacks->einfo (_("%P%X: can not read symbols: %E\n")); + return FALSE; + } } if (stab != NULL) @@ -9753,39 +11318,28 @@ bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info) } void -_bfd_elf_section_already_linked (bfd *abfd, struct bfd_section * sec) +_bfd_elf_section_already_linked (bfd *abfd, struct bfd_section *sec, + struct bfd_link_info *info) { flagword flags; const char *name, *p; struct bfd_section_already_linked *l; struct bfd_section_already_linked_hash_entry *already_linked_list; - asection *group; - /* A single member comdat group section may be discarded by a - linkonce section. See below. */ if (sec->output_section == bfd_abs_section_ptr) return; flags = sec->flags; - /* Check if it belongs to a section group. */ - group = elf_sec_group (sec); - - /* Return if it isn't a linkonce section nor a member of a group. A - comdat group section also has SEC_LINK_ONCE set. */ - if ((flags & SEC_LINK_ONCE) == 0 && group == NULL) + /* Return if it isn't a linkonce section. A comdat group section + also has SEC_LINK_ONCE set. */ + if ((flags & SEC_LINK_ONCE) == 0) return; - if (group) - { - /* If this is the member of a single member comdat group, check if - the group should be discarded. */ - if (elf_next_in_group (sec) == sec - && (group->flags & SEC_LINK_ONCE) != 0) - sec = group; - else - return; - } + /* Don't put group member sections on our list of already linked + sections. They are handled as a group via their group section. */ + if (elf_sec_group (sec) != NULL) + return; /* FIXME: When doing a relocatable link, we may have trouble copying relocations in other sections that refer to local symbols @@ -9806,7 +11360,7 @@ _bfd_elf_section_already_linked (bfd *abfd, struct bfd_section * sec) name = bfd_get_section_name (abfd, sec); - if (strncmp (name, ".gnu.linkonce.", sizeof (".gnu.linkonce.") - 1) == 0 + if (CONST_STRNEQ (name, ".gnu.linkonce.") && (p = strchr (name + sizeof (".gnu.linkonce.") - 1, '.')) != NULL) p++; else @@ -9816,11 +11370,8 @@ _bfd_elf_section_already_linked (bfd *abfd, struct bfd_section * sec) for (l = already_linked_list->entry; l != NULL; l = l->next) { - /* We may have 3 different sections on the list: group section, - comdat section and linkonce section. SEC may be a linkonce or - group section. We match a group section with a group section, - a linkonce section with a linkonce section, and ignore comdat - section. */ + /* We may have 2 different types of sections on the list: group + sections and linkonce sections. Match like sections. */ if ((flags & SEC_GROUP) == (l->sec->flags & SEC_GROUP) && strcmp (name, l->sec->name) == 0 && bfd_coff_get_comdat_section (l->sec->owner, l->sec) == NULL) @@ -9908,31 +11459,28 @@ _bfd_elf_section_already_linked (bfd *abfd, struct bfd_section * sec) } } - if (group) + /* A single member comdat group section may be discarded by a + linkonce section and vice versa. */ + + if ((flags & SEC_GROUP) != 0) { - /* If this is the member of a single member comdat group and the - group hasn't be discarded, we check if it matches a linkonce - section. We only record the discarded comdat group. Otherwise - the undiscarded group will be discarded incorrectly later since - itself has been recorded. */ - for (l = already_linked_list->entry; l != NULL; l = l->next) - if ((l->sec->flags & SEC_GROUP) == 0 - && bfd_coff_get_comdat_section (l->sec->owner, l->sec) == NULL - && bfd_elf_match_symbols_in_sections (l->sec, - elf_next_in_group (sec))) - { - elf_next_in_group (sec)->output_section = bfd_abs_section_ptr; - elf_next_in_group (sec)->kept_section = l->sec; - group->output_section = bfd_abs_section_ptr; - break; - } - if (l == NULL) - return; + asection *first = elf_next_in_group (sec); + + if (first != NULL && elf_next_in_group (first) == first) + /* Check this single member group against linkonce sections. */ + for (l = already_linked_list->entry; l != NULL; l = l->next) + if ((l->sec->flags & SEC_GROUP) == 0 + && bfd_coff_get_comdat_section (l->sec->owner, l->sec) == NULL + && bfd_elf_match_symbols_in_sections (l->sec, first, info)) + { + first->output_section = bfd_abs_section_ptr; + first->kept_section = l->sec; + sec->output_section = bfd_abs_section_ptr; + break; + } } else - /* There is no direct match. But for linkonce section, we should - check if there is a match with comdat group member. We always - record the linkonce section, discarded or not. */ + /* Check this linkonce section against single member groups. */ for (l = already_linked_list->entry; l != NULL; l = l->next) if (l->sec->flags & SEC_GROUP) { @@ -9940,10 +11488,10 @@ _bfd_elf_section_already_linked (bfd *abfd, struct bfd_section * sec) if (first != NULL && elf_next_in_group (first) == first - && bfd_elf_match_symbols_in_sections (first, sec)) + && bfd_elf_match_symbols_in_sections (first, sec, info)) { sec->output_section = bfd_abs_section_ptr; - sec->kept_section = l->sec; + sec->kept_section = first; break; } } diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c index b1211f0c65e..e0994a0dd06 100644 --- a/bfd/elfn32-mips.c +++ b/bfd/elfn32-mips.c @@ -1,6 +1,6 @@ /* MIPS-specific support for 32-bit ELF Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Most of the information added by Ian Lance Taylor, Cygnus Support, . @@ -29,8 +29,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. different MIPS ELF from other targets. This matters when linking. This file supports both, switching at runtime. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" #include "genlink.h" @@ -61,8 +61,6 @@ static bfd_reloc_status_type gprel32_with_gp (bfd *, asymbol *, arelent *, asection *, bfd_boolean, void *, bfd_vma); static bfd_reloc_status_type mips_elf_shift6_reloc (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); -static bfd_reloc_status_type mips16_jump_reloc - (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips16_gprel_reloc (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup @@ -756,6 +754,21 @@ static reloc_howto_type elf_mips_howto_table_rel[] = 0x0000ffff, /* src_mask */ 0x0000ffff, /* dst_mask */ FALSE), /* pcrel_offset */ + + /* 32 bit relocation with no addend. */ + HOWTO (R_MIPS_GLOB_DAT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GLOB_DAT", /* name */ + FALSE, /* partial_inplace */ + 0x0, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ }; /* The relocation table used for SHT_RELA sections. */ @@ -1429,6 +1442,21 @@ static reloc_howto_type elf_mips_howto_table_rela[] = 0x0000ffff, /* src_mask */ 0x0000ffff, /* dst_mask */ FALSE), /* pcrel_offset */ + + /* 32 bit relocation with no addend. */ + HOWTO (R_MIPS_GLOB_DAT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GLOB_DAT", /* name */ + FALSE, /* partial_inplace */ + 0x0, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ }; static reloc_howto_type elf_mips16_howto_table_rel[] = @@ -1444,7 +1472,7 @@ static reloc_howto_type elf_mips16_howto_table_rel[] = /* This needs complex overflow detection, because the upper four bits must match the PC. */ - mips16_jump_reloc, /* special_function */ + _bfd_mips_elf_generic_reloc, /* special_function */ "R_MIPS16_26", /* name */ TRUE, /* partial_inplace */ 0x3ffffff, /* src_mask */ @@ -1516,7 +1544,7 @@ static reloc_howto_type elf_mips16_howto_table_rela[] = /* This needs complex overflow detection, because the upper four bits must match the PC. */ - mips16_jump_reloc, /* special_function */ + _bfd_mips_elf_generic_reloc, /* special_function */ "R_MIPS16_26", /* name */ FALSE, /* partial_inplace */ 0x3ffffff, /* src_mask */ @@ -1901,28 +1929,6 @@ mips_elf_shift6_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, error_message); } -/* Handle a mips16 jump. */ - -static bfd_reloc_status_type -mips16_jump_reloc (bfd *abfd ATTRIBUTE_UNUSED, - arelent *reloc_entry ATTRIBUTE_UNUSED, - asymbol *symbol ATTRIBUTE_UNUSED, - void *data ATTRIBUTE_UNUSED, - asection *input_section, bfd *output_bfd ATTRIBUTE_UNUSED, - char **error_message ATTRIBUTE_UNUSED) -{ - static bfd_boolean warned = FALSE; - - /* FIXME. */ - if (! warned) - (*_bfd_error_handler) - (_("Linking mips16 objects into %s format is not supported"), - bfd_get_target (input_section->output_section->owner)); - warned = TRUE; - - return bfd_reloc_undefined; -} - /* Handle a mips16 GP relative reloc. */ static bfd_reloc_status_type @@ -2075,6 +2081,40 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, } } +static reloc_howto_type * +bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (elf_mips_howto_table_rela) + / sizeof (elf_mips_howto_table_rela[0])); + i++) + if (elf_mips_howto_table_rela[i].name != NULL + && strcasecmp (elf_mips_howto_table_rela[i].name, r_name) == 0) + return &elf_mips_howto_table_rela[i]; + + for (i = 0; + i < (sizeof (elf_mips16_howto_table_rela) + / sizeof (elf_mips16_howto_table_rela[0])); + i++) + if (elf_mips16_howto_table_rela[i].name != NULL + && strcasecmp (elf_mips16_howto_table_rela[i].name, r_name) == 0) + return &elf_mips16_howto_table_rela[i]; + + if (strcasecmp (elf_mips_gnu_vtinherit_howto.name, r_name) == 0) + return &elf_mips_gnu_vtinherit_howto; + if (strcasecmp (elf_mips_gnu_vtentry_howto.name, r_name) == 0) + return &elf_mips_gnu_vtentry_howto; + if (strcasecmp (elf_mips_gnu_rel16_s2.name, r_name) == 0) + return &elf_mips_gnu_rel16_s2; + if (strcasecmp (elf_mips_gnu_rela16_s2.name, r_name) == 0) + return &elf_mips_gnu_rela16_s2; + + return NULL; +} + /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure. */ static reloc_howto_type * @@ -2317,12 +2357,15 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { #define elf_backend_create_dynamic_sections \ _bfd_mips_elf_create_dynamic_sections #define elf_backend_check_relocs _bfd_mips_elf_check_relocs +#define elf_backend_merge_symbol_attribute \ + _bfd_mips_elf_merge_symbol_attribute #define elf_backend_adjust_dynamic_symbol \ _bfd_mips_elf_adjust_dynamic_symbol #define elf_backend_always_size_sections \ _bfd_mips_elf_always_size_sections #define elf_backend_size_dynamic_sections \ _bfd_mips_elf_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_relocate_section _bfd_mips_elf_relocate_section #define elf_backend_finish_dynamic_symbol \ _bfd_mips_elf_finish_dynamic_symbol @@ -2380,10 +2423,8 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { #define TARGET_BIG_SYM bfd_elf32_nbigmips_vec #define TARGET_BIG_NAME "elf32-nbigmips" -/* The SVR4 MIPS ABI says that this should be 0x10000, but Irix 5 uses - a value of 0x1000, and we are compatible. - FIXME: How does this affect NewABI? */ -#define ELF_MAXPAGESIZE 0x1000 +#define ELF_MAXPAGESIZE 0x10000 +#define ELF_COMMONPAGESIZE 0x1000 #include "elf32-target.h" @@ -2394,15 +2435,15 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { #undef TARGET_BIG_NAME #undef ELF_MAXPAGESIZE +#undef ELF_COMMONPAGESIZE #define TARGET_LITTLE_SYM bfd_elf32_ntradlittlemips_vec #define TARGET_LITTLE_NAME "elf32-ntradlittlemips" #define TARGET_BIG_SYM bfd_elf32_ntradbigmips_vec #define TARGET_BIG_NAME "elf32-ntradbigmips" -/* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses - page sizes of up to that limit, so we need to respect it. */ #define ELF_MAXPAGESIZE 0x10000 +#define ELF_COMMONPAGESIZE 0x1000 #define elf32_bed elf32_tradbed /* Include the target file again for this target. */ diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index 6b3257afdf1..68f2010c619 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -1,5 +1,5 @@ /* IA-64 support for 64-bit ELF - Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by David Mosberger-Tang @@ -19,8 +19,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "opcode/ia64.h" @@ -215,10 +215,6 @@ static bfd_boolean elfNN_ia64_add_symbol_hook PARAMS ((bfd *abfd, struct bfd_link_info *info, Elf_Internal_Sym *sym, const char **namep, flagword *flagsp, asection **secp, bfd_vma *valp)); -static int elfNN_ia64_additional_program_headers - PARAMS ((bfd *abfd)); -static bfd_boolean elfNN_ia64_modify_segment_map - PARAMS ((bfd *, struct bfd_link_info *)); static bfd_boolean elfNN_ia64_is_local_label_name PARAMS ((bfd *abfd, const char *name)); static bfd_boolean elfNN_ia64_dynamic_symbol_p @@ -617,6 +613,22 @@ elfNN_ia64_reloc_type_lookup (abfd, bfd_code) return lookup_howto (rtype); } +static reloc_howto_type * +elfNN_ia64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (ia64_howto_table) / sizeof (ia64_howto_table[0]); + i++) + if (ia64_howto_table[i].name != NULL + && strcasecmp (ia64_howto_table[i].name, r_name) == 0) + return &ia64_howto_table[i]; + + return NULL; +} + /* Given a ELF reloc, return the matching HOWTO structure. */ static void @@ -1428,22 +1440,15 @@ elfNN_ia64_relax_ldxmov (contents, off) /* Return TRUE if NAME is an unwind table section name. */ static inline bfd_boolean -is_unwind_section_name (abfd, name) - bfd *abfd; - const char *name; +is_unwind_section_name (bfd *abfd, const char *name) { - size_t len1, len2, len3; - if (elfNN_ia64_hpux_vec (abfd->xvec) && !strcmp (name, ELF_STRING_ia64_unwind_hdr)) return FALSE; - len1 = sizeof (ELF_STRING_ia64_unwind) - 1; - len2 = sizeof (ELF_STRING_ia64_unwind_info) - 1; - len3 = sizeof (ELF_STRING_ia64_unwind_once) - 1; - return ((strncmp (name, ELF_STRING_ia64_unwind, len1) == 0 - && strncmp (name, ELF_STRING_ia64_unwind_info, len2) != 0) - || strncmp (name, ELF_STRING_ia64_unwind_once, len3) == 0); + return ((CONST_STRNEQ (name, ELF_STRING_ia64_unwind) + && ! CONST_STRNEQ (name, ELF_STRING_ia64_unwind_info)) + || CONST_STRNEQ (name, ELF_STRING_ia64_unwind_once)); } /* Handle an IA-64 specific section when reading an object file. This @@ -1637,8 +1642,8 @@ elfNN_ia64_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) /* Return the number of additional phdrs we will need. */ static int -elfNN_ia64_additional_program_headers (abfd) - bfd *abfd; +elfNN_ia64_additional_program_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { asection *s; int ret = 0; @@ -1657,9 +1662,8 @@ elfNN_ia64_additional_program_headers (abfd) } static bfd_boolean -elfNN_ia64_modify_segment_map (abfd, info) - bfd *abfd; - struct bfd_link_info *info ATTRIBUTE_UNUSED; +elfNN_ia64_modify_segment_map (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { struct elf_segment_map *m, **pm; Elf_Internal_Shdr *hdr; @@ -1742,17 +1746,30 @@ elfNN_ia64_modify_segment_map (abfd, info) } } - /* Turn on PF_IA_64_NORECOV if needed. This involves traversing all of - the input sections for each output section in the segment and testing - for SHF_IA_64_NORECOV on each. */ - for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + return TRUE; +} + +/* Turn on PF_IA_64_NORECOV if needed. This involves traversing all of + the input sections for each output section in the segment and testing + for SHF_IA_64_NORECOV on each. */ + +static bfd_boolean +elfNN_ia64_modify_program_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) +{ + struct elf_obj_tdata *tdata = elf_tdata (abfd); + struct elf_segment_map *m; + Elf_Internal_Phdr *p; + + for (p = tdata->phdr, m = tdata->segment_map; m != NULL; m = m->next, p++) if (m->p_type == PT_LOAD) { int i; for (i = m->count - 1; i >= 0; --i) { struct bfd_link_order *order = m->sections[i]->map_head.link_order; - while (order) + + while (order != NULL) { if (order->type == bfd_indirect_link_order) { @@ -1760,7 +1777,7 @@ elfNN_ia64_modify_segment_map (abfd, info) bfd_vma flags = elf_section_data(is)->this_hdr.sh_flags; if (flags & SHF_IA_64_NORECOV) { - m->p_flags |= PF_IA_64_NORECOV; + p->p_flags |= PF_IA_64_NORECOV; goto found; } } @@ -2208,7 +2225,7 @@ addend_compare (const void *xp, const void *yp) const struct elfNN_ia64_dyn_sym_info *y = (const struct elfNN_ia64_dyn_sym_info *) yp; - return x->addend - y->addend; + return x->addend < y->addend ? -1 : x->addend > y->addend ? 1 : 0; } /* Sort elfNN_ia64_dyn_sym_info array and remove duplicates. */ @@ -2217,37 +2234,62 @@ static unsigned int sort_dyn_sym_info (struct elfNN_ia64_dyn_sym_info *info, unsigned int count) { - bfd_vma curr, prev; - unsigned int i, dup, diff, dest, src, len; + bfd_vma curr, prev, got_offset; + unsigned int i, kept, dup, diff, dest, src, len; qsort (info, count, sizeof (*info), addend_compare); /* Find the first duplicate. */ prev = info [0].addend; + got_offset = info [0].got_offset; for (i = 1; i < count; i++) { curr = info [i].addend; if (curr == prev) - break; + { + /* For duplicates, make sure that GOT_OFFSET is valid. */ + if (got_offset == (bfd_vma) -1) + got_offset = info [i].got_offset; + break; + } + got_offset = info [i].got_offset; prev = curr; } + /* We may move a block of elements to here. */ + dest = i++; + /* Remove duplicates. */ if (i < count) { - /* We need to move a block of elements to here. */ - dest = i++; while (i < count) { + /* For duplicates, make sure that the kept one has a valid + got_offset. */ + kept = dest - 1; + if (got_offset != (bfd_vma) -1) + info [kept].got_offset = got_offset; + curr = info [i].addend; + got_offset = info [i].got_offset; /* Move a block of elements whose first one is different from the previous. */ if (curr == prev) { for (src = i + 1; src < count; src++) - if (info [src].addend != curr) - break; + { + if (info [src].addend != curr) + break; + /* For duplicates, make sure that GOT_OFFSET is + valid. */ + if (got_offset == (bfd_vma) -1) + got_offset = info [src].got_offset; + } + + /* Make sure that the kept one has a valid got_offset. */ + if (got_offset != (bfd_vma) -1) + info [kept].got_offset = got_offset; } else src = i; @@ -2255,13 +2297,25 @@ sort_dyn_sym_info (struct elfNN_ia64_dyn_sym_info *info, if (src >= count) break; - /* Find the next duplicate. */ + /* Find the next duplicate. SRC will be kept. */ prev = info [src].addend; + got_offset = info [src].got_offset; for (dup = src + 1; dup < count; dup++) { curr = info [dup].addend; if (curr == prev) - break; + { + /* Make sure that got_offset is valid. */ + if (got_offset == (bfd_vma) -1) + got_offset = info [dup].got_offset; + + /* For duplicates, make sure that the kept one has + a valid got_offset. */ + if (got_offset != (bfd_vma) -1) + info [dup - 1].got_offset = got_offset; + break; + } + got_offset = info [dup].got_offset; prev = curr; } @@ -2272,20 +2326,41 @@ sort_dyn_sym_info (struct elfNN_ia64_dyn_sym_info *info, if (len == 1 && dup < count) { /* If we only move 1 element, we combine it with the next - one. Find the next different one. */ + one. There must be at least a duplicate. Find the + next different one. */ for (diff = dup + 1, src++; diff < count; diff++, src++) - if (info [diff].addend != curr) - break; + { + if (info [diff].addend != curr) + break; + /* Make sure that got_offset is valid. */ + if (got_offset == (bfd_vma) -1) + got_offset = info [diff].got_offset; + } + + /* Makre sure that the last duplicated one has an valid + offset. */ + BFD_ASSERT (curr == prev); + if (got_offset != (bfd_vma) -1) + info [diff - 1].got_offset = got_offset; if (diff < count) { - /* Find the next duplicate. */ + /* Find the next duplicate. Track the current valid + offset. */ prev = info [diff].addend; + got_offset = info [diff].got_offset; for (dup = diff + 1; dup < count; dup++) { curr = info [dup].addend; if (curr == prev) - break; + { + /* For duplicates, make sure that GOT_OFFSET + is valid. */ + if (got_offset == (bfd_vma) -1) + got_offset = info [dup].got_offset; + break; + } + got_offset = info [dup].got_offset; prev = curr; diff++; } @@ -2302,6 +2377,19 @@ sort_dyn_sym_info (struct elfNN_ia64_dyn_sym_info *info, count = dest; } + else + { + /* When we get here, either there is no duplicate at all or + the only duplicate is the last element. */ + if (dest < count) + { + /* If the last element is a duplicate, make sure that the + kept one has a valid got_offset. We also update count. */ + if (got_offset != (bfd_vma) -1) + info [dest - 1].got_offset = got_offset; + count = dest; + } + } return count; } @@ -2424,6 +2512,7 @@ has_space: /* Append the new one to the array. */ dyn_i = info + count; memset (dyn_i, 0, sizeof (*dyn_i)); + dyn_i->got_offset = (bfd_vma) -1; dyn_i->addend = addend; /* We increment count only since the new ones are unsorted and @@ -2613,10 +2702,10 @@ get_reloc_section (abfd, ia64_info, sec, create) if (srel_name == NULL) return NULL; - BFD_ASSERT ((strncmp (srel_name, ".rela", 5) == 0 + BFD_ASSERT ((CONST_STRNEQ (srel_name, ".rela") && strcmp (bfd_get_section_name (abfd, sec), srel_name+5) == 0) - || (strncmp (srel_name, ".rel", 4) == 0 + || (CONST_STRNEQ (srel_name, ".rel") && strcmp (bfd_get_section_name (abfd, sec), srel_name+4) == 0)); @@ -2733,7 +2822,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) have yet been processed. Do something with what we know, as this may help reduce memory usage and processing time later. */ maybe_dynamic = (h && ((!info->executable - && (!info->symbolic + && (!SYMBOLIC_BIND (info, h) || info->unresolved_syms_in_shared_libs == RM_IGNORE)) || !h->def_regular || h->root.type == bfd_link_hash_defweak)); @@ -2905,7 +2994,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) have yet been processed. Do something with what we know, as this may help reduce memory usage and processing time later. */ maybe_dynamic = (h && ((!info->executable - && (!info->symbolic + && (!SYMBOLIC_BIND (info, h) || info->unresolved_syms_in_shared_libs == RM_IGNORE)) || !h->def_regular || h->root.type == bfd_link_hash_defweak)); @@ -3694,7 +3783,7 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) if (strcmp (name, ".got.plt") == 0) strip = FALSE; - else if (strncmp (name, ".rel", 4) == 0) + else if (CONST_STRNEQ (name, ".rel")) { if (!strip) { @@ -4358,7 +4447,7 @@ elfNN_ia64_choose_gp (abfd, info) continue; lo = os->vma; - hi = os->vma + os->size; + hi = os->vma + (os->rawsize ? os->rawsize : os->size); if (hi < lo) hi = (bfd_vma) -1; @@ -4556,7 +4645,6 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, elf_section_data(input_section->output_section) ->this_hdr.sh_flags |= flags; - return TRUE; } gp_val = _bfd_get_gp_value (output_bfd); @@ -4605,7 +4693,8 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, sym_sec = local_sections[r_symndx]; msec = sym_sec; value = _bfd_elf_rela_local_sym (output_bfd, sym, &msec, rel); - if ((sym_sec->flags & SEC_MERGE) + if (!info->relocatable + && (sym_sec->flags & SEC_MERGE) != 0 && ELF_ST_TYPE (sym->st_info) == STT_SECTION && sym_sec->sec_info_type == ELF_INFO_TYPE_MERGE) { @@ -4634,9 +4723,15 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, - sym_sec->output_section->vma - sym_sec->output_offset; } - - qsort (loc_h->info, loc_h->count, - sizeof (*loc_h->info), addend_compare); + + /* We may have introduced duplicated entries. We need + to remove them properly. */ + count = sort_dyn_sym_info (loc_h->info, loc_h->count); + if (count != loc_h->count) + { + loc_h->count = count; + loc_h->sorted_count = count; + } loc_h->sec_merge_done = 1; } @@ -4659,6 +4754,20 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, continue; } + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + if (sym_sec != NULL && elf_discarded_section (sym_sec)) + { + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + hit_addr = contents + rel->r_offset; value += rel->r_addend; dynamic_symbol_p = elfNN_ia64_dynamic_symbol_p (h, info, r_type); @@ -4990,13 +5099,6 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, case R_IA64_SEGREL32LSB: case R_IA64_SEGREL64MSB: case R_IA64_SEGREL64LSB: - if (r_symndx == 0) - { - /* If the input section was discarded from the output, then - do nothing. */ - r = bfd_reloc_ok; - } - else { struct elf_segment_map *m; Elf_Internal_Phdr *p; @@ -5561,9 +5663,9 @@ elfNN_ia64_reloc_type_class (rela) static const struct bfd_elf_special_section elfNN_ia64_special_sections[] = { - { ".sbss", 5, -1, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT }, - { ".sdata", 6, -1, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".sbss"), -1, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT }, + { STRING_COMMA_LEN (".sdata"), -1, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT }, + { NULL, 0, 0, 0, 0 } }; static bfd_boolean @@ -5590,7 +5692,7 @@ elfNN_ia64_object_p (bfd *abfd) if (elf_sec_group (sec) == NULL && ((sec->flags & (SEC_LINK_ONCE | SEC_CODE | SEC_GROUP)) == (SEC_LINK_ONCE | SEC_CODE)) - && strncmp (sec->name, ".gnu.linkonce.t.", 16) == 0) + && CONST_STRNEQ (sec->name, ".gnu.linkonce.t.")) { name = sec->name + 16; @@ -5673,7 +5775,7 @@ elfNN_hpux_post_process_headers (abfd, info) { Elf_Internal_Ehdr *i_ehdrp = elf_elfheader (abfd); - i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_HPUX; + i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi; i_ehdrp->e_ident[EI_ABIVERSION] = 1; } @@ -5717,6 +5819,7 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, #define ELF_MACHINE_ALT1 1999 /* EAS2.3 */ #define ELF_MACHINE_ALT2 1998 /* EAS2.2 */ #define ELF_MAXPAGESIZE 0x10000 /* 64KB */ +#define ELF_COMMONPAGESIZE 0x4000 /* 16KB */ #define elf_backend_section_from_shdr \ elfNN_ia64_section_from_shdr @@ -5732,11 +5835,15 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, elfNN_ia64_additional_program_headers #define elf_backend_modify_segment_map \ elfNN_ia64_modify_segment_map +#define elf_backend_modify_program_headers \ + elfNN_ia64_modify_program_headers #define elf_info_to_howto \ elfNN_ia64_info_to_howto #define bfd_elfNN_bfd_reloc_type_lookup \ elfNN_ia64_reloc_type_lookup +#define bfd_elfNN_bfd_reloc_name_lookup \ + elfNN_ia64_reloc_name_lookup #define bfd_elfNN_bfd_is_local_label_name \ elfNN_ia64_is_local_label_name #define bfd_elfNN_bfd_relax_section \ @@ -5758,6 +5865,8 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, elfNN_ia64_adjust_dynamic_symbol #define elf_backend_size_dynamic_sections \ elfNN_ia64_size_dynamic_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_relocate_section \ elfNN_ia64_relocate_section #define elf_backend_finish_dynamic_symbol \ @@ -5789,6 +5898,7 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, #define elf_backend_reloc_type_class elfNN_ia64_reloc_type_class #define elf_backend_rela_normal 1 #define elf_backend_special_sections elfNN_ia64_special_sections +#define elf_backend_default_execstack 0 /* FIXME: PR 290: The Intel C compiler generates SHT_IA_64_UNWIND with SHF_LINK_ORDER. But it doesn't set the sh_link or sh_info fields. @@ -5823,7 +5933,10 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, #define elf_backend_want_p_paddr_set_to_zero 1 #undef ELF_MAXPAGESIZE -#define ELF_MAXPAGESIZE 0x1000 /* 1K */ +#define ELF_MAXPAGESIZE 0x1000 /* 4K */ +#undef ELF_COMMONPAGESIZE +#undef ELF_OSABI +#define ELF_OSABI ELFOSABI_HPUX #undef elfNN_bed #define elfNN_bed elfNN_ia64_hpux_bed diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 39420a63ae7..28a4e8b333b 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -1,6 +1,6 @@ /* MIPS-specific support for ELF Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Most of the information added by Ian Lance Taylor, Cygnus Support, . @@ -27,8 +27,8 @@ /* This file handles functionality common to the different MIPS ABI's. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libiberty.h" #include "elf-bfd.h" @@ -488,12 +488,12 @@ typedef struct runtime_pdr { static struct mips_got_entry *mips_elf_create_local_got_entry (bfd *, struct bfd_link_info *, bfd *, struct mips_got_info *, asection *, - asection *, bfd_vma, unsigned long, struct mips_elf_link_hash_entry *, int); + bfd_vma, unsigned long, struct mips_elf_link_hash_entry *, int); static bfd_boolean mips_elf_sort_hash_table_f (struct mips_elf_link_hash_entry *, void *); static bfd_vma mips_elf_high (bfd_vma); -static bfd_boolean mips_elf_stub_section_p +static bfd_boolean mips16_stub_section_p (bfd *, asection *); static bfd_boolean mips_elf_create_dynamic_relocation (bfd *, struct bfd_link_info *, const Elf_Internal_Rela *, @@ -709,6 +709,10 @@ static bfd *reldyn_sorting_bfd; #define FN_STUB ".mips16.fn." #define CALL_STUB ".mips16.call." #define CALL_FP_STUB ".mips16.call.fp." + +#define FN_STUB_P(name) CONST_STRNEQ (name, FN_STUB) +#define CALL_STUB_P(name) CONST_STRNEQ (name, CALL_STUB) +#define CALL_FP_STUB_P(name) CONST_STRNEQ (name, CALL_FP_STUB) /* The format of the first PLT entry in a VxWorks executable. */ static const bfd_vma mips_vxworks_exec_plt0_entry[] = { @@ -838,13 +842,16 @@ mips_elf_link_hash_newfunc (struct bfd_hash_entry *entry, bfd_boolean _bfd_mips_elf_new_section_hook (bfd *abfd, asection *sec) { - struct _mips_elf_section_data *sdata; - bfd_size_type amt = sizeof (*sdata); + if (!sec->used_by_bfd) + { + struct _mips_elf_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); - sdata = bfd_zalloc (abfd, amt); - if (sdata == NULL) - return FALSE; - sec->used_by_bfd = sdata; + sdata = bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = sdata; + } return _bfd_elf_new_section_hook (abfd, sec); } @@ -1689,11 +1696,20 @@ sort_dynamic_relocs (const void *arg1, const void *arg2) { Elf_Internal_Rela int_reloc1; Elf_Internal_Rela int_reloc2; + int diff; bfd_elf32_swap_reloc_in (reldyn_sorting_bfd, arg1, &int_reloc1); bfd_elf32_swap_reloc_in (reldyn_sorting_bfd, arg2, &int_reloc2); - return ELF32_R_SYM (int_reloc1.r_info) - ELF32_R_SYM (int_reloc2.r_info); + diff = ELF32_R_SYM (int_reloc1.r_info) - ELF32_R_SYM (int_reloc2.r_info); + if (diff != 0) + return diff; + + if (int_reloc1.r_offset < int_reloc2.r_offset) + return -1; + if (int_reloc1.r_offset > int_reloc2.r_offset) + return 1; + return 0; } /* Like sort_dynamic_relocs, but used for elf64 relocations. */ @@ -1711,8 +1727,16 @@ sort_dynamic_relocs_64 (const void *arg1 ATTRIBUTE_UNUSED, (*get_elf_backend_data (reldyn_sorting_bfd)->s->swap_reloc_in) (reldyn_sorting_bfd, arg2, int_reloc2); - return (ELF64_R_SYM (int_reloc1[0].r_info) - - ELF64_R_SYM (int_reloc2[0].r_info)); + if (ELF64_R_SYM (int_reloc1[0].r_info) < ELF64_R_SYM (int_reloc2[0].r_info)) + return -1; + if (ELF64_R_SYM (int_reloc1[0].r_info) > ELF64_R_SYM (int_reloc2[0].r_info)) + return 1; + + if (int_reloc1[0].r_offset < int_reloc2[0].r_offset) + return -1; + if (int_reloc1[0].r_offset > int_reloc2[0].r_offset) + return 1; + return 0; #else abort (); #endif @@ -2389,16 +2413,14 @@ mips_elf_gotplt_index (struct bfd_link_info *info, return got_address - got_value; } -/* Return the GOT offset for address VALUE, which was derived from - a symbol belonging to INPUT_SECTION. If there is not yet a GOT +/* Return the GOT offset for address VALUE. If there is not yet a GOT entry for this value, create one. If R_SYMNDX refers to a TLS symbol, create a TLS GOT entry instead. Return -1 if no satisfactory GOT offset can be found. */ static bfd_vma mips_elf_local_got_index (bfd *abfd, bfd *ibfd, struct bfd_link_info *info, - asection *input_section, bfd_vma value, - unsigned long r_symndx, + bfd_vma value, unsigned long r_symndx, struct mips_elf_link_hash_entry *h, int r_type) { asection *sgot; @@ -2408,8 +2430,7 @@ mips_elf_local_got_index (bfd *abfd, bfd *ibfd, struct bfd_link_info *info, g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot); entry = mips_elf_create_local_got_entry (abfd, info, ibfd, g, sgot, - input_section, value, - r_symndx, h, r_type); + value, r_symndx, h, r_type); if (!entry) return MINUS_ONE; @@ -2510,16 +2531,15 @@ mips_elf_global_got_index (bfd *abfd, bfd *ibfd, struct elf_link_hash_entry *h, return index; } -/* Find a GOT page entry that points to within 32KB of VALUE, which was - calculated from a symbol belonging to INPUT_SECTION. These entries - are supposed to be placed at small offsets in the GOT, i.e., within - 32KB of GP. Return the index of the GOT entry, or -1 if no entry - could be created. If OFFSETP is nonnull, use it to return the +/* Find a GOT page entry that points to within 32KB of VALUE. These + entries are supposed to be placed at small offsets in the GOT, i.e., + within 32KB of GP. Return the index of the GOT entry, or -1 if no + entry could be created. If OFFSETP is nonnull, use it to return the offset of the GOT entry from VALUE. */ static bfd_vma mips_elf_got_page (bfd *abfd, bfd *ibfd, struct bfd_link_info *info, - asection *input_section, bfd_vma value, bfd_vma *offsetp) + bfd_vma value, bfd_vma *offsetp) { asection *sgot; struct mips_got_info *g; @@ -2530,8 +2550,7 @@ mips_elf_got_page (bfd *abfd, bfd *ibfd, struct bfd_link_info *info, page = (value + 0x8000) & ~(bfd_vma) 0xffff; entry = mips_elf_create_local_got_entry (abfd, info, ibfd, g, sgot, - input_section, page, 0, - NULL, R_MIPS_GOT_PAGE); + page, 0, NULL, R_MIPS_GOT_PAGE); if (!entry) return MINUS_ONE; @@ -2544,15 +2563,13 @@ mips_elf_got_page (bfd *abfd, bfd *ibfd, struct bfd_link_info *info, return index; } -/* Find a local GOT entry for an R_MIPS_GOT16 relocation against VALUE, - which was calculated from a symbol belonging to INPUT_SECTION. +/* Find a local GOT entry for an R_MIPS_GOT16 relocation against VALUE. EXTERNAL is true if the relocation was against a global symbol that has been forced local. */ static bfd_vma mips_elf_got16_entry (bfd *abfd, bfd *ibfd, struct bfd_link_info *info, - asection *input_section, bfd_vma value, - bfd_boolean external) + bfd_vma value, bfd_boolean external) { asection *sgot; struct mips_got_info *g; @@ -2568,8 +2585,7 @@ mips_elf_got16_entry (bfd *abfd, bfd *ibfd, struct bfd_link_info *info, g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot); entry = mips_elf_create_local_got_entry (abfd, info, ibfd, g, sgot, - input_section, value, 0, - NULL, R_MIPS_GOT16); + value, 0, NULL, R_MIPS_GOT16); if (entry) return entry->gotidx; else @@ -2602,8 +2618,8 @@ mips_elf_got_offset_from_index (bfd *dynobj, bfd *output_bfd, static struct mips_got_entry * mips_elf_create_local_got_entry (bfd *abfd, struct bfd_link_info *info, bfd *ibfd, struct mips_got_info *gg, - asection *sgot, asection *input_section, - bfd_vma value, unsigned long r_symndx, + asection *sgot, bfd_vma value, + unsigned long r_symndx, struct mips_elf_link_hash_entry *h, int r_type) { @@ -2684,30 +2700,23 @@ mips_elf_create_local_got_entry (bfd *abfd, struct bfd_link_info *info, MIPS_ELF_PUT_WORD (abfd, value, (sgot->contents + entry.gotidx)); - /* These GOT entries need a dynamic relocation on VxWorks. Because - the offset between segments is not fixed, the relocation must be - against a symbol in the same segment as the original symbol. - The easiest way to do this is to take INPUT_SECTION's output - section and emit a relocation against its section symbol. */ + /* These GOT entries need a dynamic relocation on VxWorks. */ if (htab->is_vxworks) { Elf_Internal_Rela outrel; - asection *s, *output_section; + asection *s; bfd_byte *loc; bfd_vma got_address; - int dynindx; s = mips_elf_rel_dyn_section (info, FALSE); - output_section = input_section->output_section; - dynindx = elf_section_data (output_section)->dynindx; got_address = (sgot->output_section->vma + sgot->output_offset + entry.gotidx); loc = s->contents + (s->reloc_count++ * sizeof (Elf32_External_Rela)); outrel.r_offset = got_address; - outrel.r_info = ELF32_R_INFO (dynindx, R_MIPS_32); - outrel.r_addend = value - output_section->vma; + outrel.r_info = ELF32_R_INFO (STN_UNDEF, R_MIPS_32); + outrel.r_addend = value; bfd_elf32_swap_reloca_out (abfd, &outrel, loc); } @@ -3085,8 +3094,7 @@ mips_elf_merge_gots (void **bfd2got_, void *p) if (tcount > 0) { unsigned int primary_total = lcount + tcount + arg->global_count; - if (primary_total * MIPS_ELF_GOT_SIZE (bfd2got->bfd) - >= MIPS_ELF_GOT_MAX_SIZE (arg->info)) + if (primary_total > maxcnt) too_many_for_tls = TRUE; } @@ -3178,6 +3186,7 @@ mips_elf_initialize_tls_index (void **entryp, void *p) struct mips_got_entry *entry = (struct mips_got_entry *)*entryp; struct mips_got_info *g = p; bfd_vma next_index; + unsigned char tls_type; /* We're only interested in TLS symbols. */ if (entry->tls_type == 0) @@ -3193,6 +3202,7 @@ mips_elf_initialize_tls_index (void **entryp, void *p) return 1; entry->d.h->tls_type |= GOT_TLS_OFFSET_DONE; entry->d.h->tls_got_offset = next_index; + tls_type = entry->d.h->tls_type; } else { @@ -3209,12 +3219,13 @@ mips_elf_initialize_tls_index (void **entryp, void *p) g->tls_ldm_offset = next_index; } entry->gotidx = next_index; + tls_type = entry->tls_type; } /* Account for the entries we've just allocated. */ - if (entry->tls_type & (GOT_TLS_GD | GOT_TLS_LDM)) + if (tls_type & (GOT_TLS_GD | GOT_TLS_LDM)) g->tls_assigned_gotno += 2; - if (entry->tls_type & GOT_TLS_IE) + if (tls_type & GOT_TLS_IE) g->tls_assigned_gotno += 1; return 1; @@ -3580,16 +3591,18 @@ mips_elf_next_relocation (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type, const Elf_Internal_Rela *relocation, const Elf_Internal_Rela *relend) { + unsigned long r_symndx = ELF_R_SYM (abfd, relocation->r_info); + while (relocation < relend) { - if (ELF_R_TYPE (abfd, relocation->r_info) == r_type) + if (ELF_R_TYPE (abfd, relocation->r_info) == r_type + && ELF_R_SYM (abfd, relocation->r_info) == r_symndx) return relocation; ++relocation; } /* We didn't find it. */ - bfd_set_error (bfd_error_bad_value); return NULL; } @@ -4056,9 +4069,10 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, a stub. */ if (r_type != R_MIPS16_26 && !info->relocatable && ((h != NULL && h->fn_stub != NULL) - || (local_p && elf_tdata (input_bfd)->local_stubs != NULL + || (local_p + && elf_tdata (input_bfd)->local_stubs != NULL && elf_tdata (input_bfd)->local_stubs[r_symndx] != NULL)) - && !mips_elf_stub_section_p (input_bfd, input_section)) + && !mips16_stub_section_p (input_bfd, input_section)) { /* This is a 32- or 64-bit call to a 16-bit function. We should have already noticed that we were going to need the @@ -4072,38 +4086,46 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, } symbol = sec->output_section->vma + sec->output_offset; + /* The target is 16-bit, but the stub isn't. */ + target_is_16_bit_code_p = FALSE; } /* If this is a 16-bit call to a 32- or 64-bit function with a stub, we need to redirect the call to the stub. */ else if (r_type == R_MIPS16_26 && !info->relocatable - && h != NULL - && (h->call_stub != NULL || h->call_fp_stub != NULL) + && ((h != NULL && (h->call_stub != NULL || h->call_fp_stub != NULL)) + || (local_p + && elf_tdata (input_bfd)->local_call_stubs != NULL + && elf_tdata (input_bfd)->local_call_stubs[r_symndx] != NULL)) && !target_is_16_bit_code_p) { - /* If both call_stub and call_fp_stub are defined, we can figure - out which one to use by seeing which one appears in the input - file. */ - if (h->call_stub != NULL && h->call_fp_stub != NULL) - { - asection *o; - - sec = NULL; - for (o = input_bfd->sections; o != NULL; o = o->next) - { - if (strncmp (bfd_get_section_name (input_bfd, o), - CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0) - { - sec = h->call_fp_stub; - break; - } - } - if (sec == NULL) - sec = h->call_stub; - } - else if (h->call_stub != NULL) - sec = h->call_stub; + if (local_p) + sec = elf_tdata (input_bfd)->local_call_stubs[r_symndx]; else - sec = h->call_fp_stub; + { + /* If both call_stub and call_fp_stub are defined, we can figure + out which one to use by checking which one appears in the input + file. */ + if (h->call_stub != NULL && h->call_fp_stub != NULL) + { + asection *o; + + sec = NULL; + for (o = input_bfd->sections; o != NULL; o = o->next) + { + if (CALL_FP_STUB_P (bfd_get_section_name (input_bfd, o))) + { + sec = h->call_fp_stub; + break; + } + } + if (sec == NULL) + sec = h->call_stub; + } + else if (h->call_stub != NULL) + sec = h->call_stub; + else + sec = h->call_fp_stub; + } BFD_ASSERT (sec->size > 0); symbol = sec->output_section->vma + sec->output_offset; @@ -4145,7 +4167,7 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, if (r_type == R_MIPS_TLS_LDM) { g = mips_elf_local_got_index (abfd, input_bfd, info, - sec, 0, 0, NULL, r_type); + 0, 0, NULL, r_type); if (g == MINUS_ONE) return bfd_reloc_outofrange; } @@ -4191,7 +4213,7 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, break; else { - g = mips_elf_local_got_index (abfd, input_bfd, info, sec, + g = mips_elf_local_got_index (abfd, input_bfd, info, symbol + addend, r_symndx, h, r_type); if (g == MINUS_ONE) return bfd_reloc_outofrange; @@ -4240,6 +4262,13 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, outrel.r_info = ELF32_R_INFO (h->root.dynindx, r_type); outrel.r_addend = addend; bfd_elf32_swap_reloca_out (abfd, &outrel, loc); + + /* If we've written this relocation for a readonly section, + we need to set DF_TEXTREL again, so that we do not delete the + DT_TEXTREL tag. */ + if (MIPS_ELF_READONLY_SECTION (input_section)) + info->flags |= DF_TEXTREL; + *valuep = 0; return bfd_reloc_ok; } @@ -4326,6 +4355,8 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, break; case R_MIPS_TLS_DTPREL_LO16: + case R_MIPS_TLS_DTPREL32: + case R_MIPS_TLS_DTPREL64: value = (symbol + addend - dtprel_base (info)) & howto->dst_mask; break; @@ -4435,7 +4466,7 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, forced = ! mips_elf_local_relocation_p (input_bfd, relocation, local_sections, FALSE); - value = mips_elf_got16_entry (abfd, input_bfd, info, sec, + value = mips_elf_got16_entry (abfd, input_bfd, info, symbol + addend, forced); if (value == MINUS_ONE) return bfd_reloc_outofrange; @@ -4466,7 +4497,8 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, case R_MIPS_GNU_REL16_S2: value = symbol + _bfd_mips_elf_sign_extend (addend, 18) - p; overflowed_p = mips_elf_overflow_p (value, 18); - value = (value >> 2) & howto->dst_mask; + value >>= howto->rightshift; + value &= howto->dst_mask; break; case R_MIPS_GOT_HI16: @@ -4490,8 +4522,7 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, 0. */ if (! local_p) goto got_disp; - value = mips_elf_got_page (abfd, input_bfd, info, sec, - symbol + addend, NULL); + value = mips_elf_got_page (abfd, input_bfd, info, symbol + addend, NULL); if (value == MINUS_ONE) return bfd_reloc_outofrange; value = mips_elf_got_offset_from_index (dynobj, abfd, input_bfd, value); @@ -4500,8 +4531,7 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, case R_MIPS_GOT_OFST: if (local_p) - mips_elf_got_page (abfd, input_bfd, info, sec, - symbol + addend, &value); + mips_elf_got_page (abfd, input_bfd, info, symbol + addend, &value); else value = addend; overflowed_p = mips_elf_overflow_p (value, 16); @@ -4677,13 +4707,11 @@ mips_elf_perform_relocation (struct bfd_link_info *info, /* Returns TRUE if SECTION is a MIPS16 stub section. */ static bfd_boolean -mips_elf_stub_section_p (bfd *abfd ATTRIBUTE_UNUSED, asection *section) +mips16_stub_section_p (bfd *abfd ATTRIBUTE_UNUSED, asection *section) { const char *name = bfd_get_section_name (abfd, section); - return (strncmp (name, FN_STUB, sizeof FN_STUB - 1) == 0 - || strncmp (name, CALL_STUB, sizeof CALL_STUB - 1) == 0 - || strncmp (name, CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0); + return FN_STUB_P (name) || CALL_STUB_P (name) || CALL_FP_STUB_P (name); } /* Add room for N relocations to the .rel(a).dyn section in ABFD. */ @@ -4745,10 +4773,13 @@ mips_elf_create_dynamic_relocation (bfd *output_bfd, outrel[0].r_offset = _bfd_elf_section_offset (output_bfd, info, input_section, rel[0].r_offset); - outrel[1].r_offset = - _bfd_elf_section_offset (output_bfd, info, input_section, rel[1].r_offset); - outrel[2].r_offset = - _bfd_elf_section_offset (output_bfd, info, input_section, rel[2].r_offset); + if (ABI_64_P (output_bfd)) + { + outrel[1].r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, rel[1].r_offset); + outrel[2].r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, rel[2].r_offset); + } if (outrel[0].r_offset == MINUS_ONE) /* The relocation field has been deleted. */ @@ -4791,6 +4822,11 @@ mips_elf_create_dynamic_relocation (bfd *output_bfd, else { indx = elf_section_data (sec->output_section)->dynindx; + if (indx == 0) + { + asection *osec = htab->root.text_index_section; + indx = elf_section_data (osec)->dynindx; + } if (indx == 0) abort (); } @@ -4973,39 +5009,30 @@ _bfd_elf_mips_mach (flagword flags) default: case E_MIPS_ARCH_1: return bfd_mach_mips3000; - break; case E_MIPS_ARCH_2: return bfd_mach_mips6000; - break; case E_MIPS_ARCH_3: return bfd_mach_mips4000; - break; case E_MIPS_ARCH_4: return bfd_mach_mips8000; - break; case E_MIPS_ARCH_5: return bfd_mach_mips5; - break; case E_MIPS_ARCH_32: return bfd_mach_mipsisa32; - break; case E_MIPS_ARCH_64: return bfd_mach_mipsisa64; - break; case E_MIPS_ARCH_32R2: return bfd_mach_mipsisa32r2; - break; case E_MIPS_ARCH_64R2: return bfd_mach_mipsisa64r2; - break; } } @@ -5095,6 +5122,7 @@ _bfd_mips_elf_symbol_processing (bfd *abfd, asymbol *asym) /* Common symbols less than the GP size are automatically treated as SHN_MIPS_SCOMMON symbols on IRIX5. */ if (asym->value > elf_gp_size (abfd) + || ELF_ST_TYPE (elfsym->internal_elf_sym.st_info) == STT_TLS || IRIX_COMPAT (abfd) == ict_irix6) break; /* Fall through. */ @@ -5406,7 +5434,7 @@ _bfd_mips_elf_section_from_shdr (bfd *abfd, return FALSE; break; case SHT_MIPS_GPTAB: - if (strncmp (name, ".gptab.", sizeof ".gptab." - 1) != 0) + if (! CONST_STRNEQ (name, ".gptab.")) return FALSE; break; case SHT_MIPS_UCODE: @@ -5429,7 +5457,7 @@ _bfd_mips_elf_section_from_shdr (bfd *abfd, return FALSE; break; case SHT_MIPS_CONTENT: - if (strncmp (name, ".MIPS.content", sizeof ".MIPS.content" - 1) != 0) + if (! CONST_STRNEQ (name, ".MIPS.content")) return FALSE; break; case SHT_MIPS_OPTIONS: @@ -5437,7 +5465,7 @@ _bfd_mips_elf_section_from_shdr (bfd *abfd, return FALSE; break; case SHT_MIPS_DWARF: - if (strncmp (name, ".debug_", sizeof ".debug_" - 1) != 0) + if (! CONST_STRNEQ (name, ".debug_")) return FALSE; break; case SHT_MIPS_SYMBOL_LIB: @@ -5445,9 +5473,8 @@ _bfd_mips_elf_section_from_shdr (bfd *abfd, return FALSE; break; case SHT_MIPS_EVENTS: - if (strncmp (name, ".MIPS.events", sizeof ".MIPS.events" - 1) != 0 - && strncmp (name, ".MIPS.post_rel", - sizeof ".MIPS.post_rel" - 1) != 0) + if (! CONST_STRNEQ (name, ".MIPS.events") + && ! CONST_STRNEQ (name, ".MIPS.post_rel")) return FALSE; break; default: @@ -5553,11 +5580,7 @@ _bfd_mips_elf_section_from_shdr (bfd *abfd, bfd_boolean _bfd_mips_elf_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec) { - register const char *name; - unsigned int sh_type; - - name = bfd_get_section_name (abfd, sec); - sh_type = hdr->sh_type; + const char *name = bfd_get_section_name (abfd, sec); if (strcmp (name, ".liblist") == 0) { @@ -5567,7 +5590,7 @@ _bfd_mips_elf_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec) } else if (strcmp (name, ".conflict") == 0) hdr->sh_type = SHT_MIPS_CONFLICT; - else if (strncmp (name, ".gptab.", sizeof ".gptab." - 1) == 0) + else if (CONST_STRNEQ (name, ".gptab.")) { hdr->sh_type = SHT_MIPS_GPTAB; hdr->sh_entsize = sizeof (Elf32_External_gptab); @@ -5624,7 +5647,7 @@ _bfd_mips_elf_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec) hdr->sh_type = SHT_MIPS_IFACE; hdr->sh_flags |= SHF_MIPS_NOSTRIP; } - else if (strncmp (name, ".MIPS.content", strlen (".MIPS.content")) == 0) + else if (CONST_STRNEQ (name, ".MIPS.content")) { hdr->sh_type = SHT_MIPS_CONTENT; hdr->sh_flags |= SHF_MIPS_NOSTRIP; @@ -5636,7 +5659,7 @@ _bfd_mips_elf_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec) hdr->sh_entsize = 1; hdr->sh_flags |= SHF_MIPS_NOSTRIP; } - else if (strncmp (name, ".debug_", sizeof ".debug_" - 1) == 0) + else if (CONST_STRNEQ (name, ".debug_")) hdr->sh_type = SHT_MIPS_DWARF; else if (strcmp (name, ".MIPS.symlib") == 0) { @@ -5644,9 +5667,8 @@ _bfd_mips_elf_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec) /* The sh_link and sh_info fields are set in final_write_processing. */ } - else if (strncmp (name, ".MIPS.events", sizeof ".MIPS.events" - 1) == 0 - || strncmp (name, ".MIPS.post_rel", - sizeof ".MIPS.post_rel" - 1) == 0) + else if (CONST_STRNEQ (name, ".MIPS.events") + || CONST_STRNEQ (name, ".MIPS.post_rel")) { hdr->sh_type = SHT_MIPS_EVENTS; hdr->sh_flags |= SHF_MIPS_NOSTRIP; @@ -5659,12 +5681,6 @@ _bfd_mips_elf_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec) hdr->sh_entsize = 8; } - /* In the unlikely event a special section is empty it has to lose its - special meaning. This may happen e.g. when using `strip' with the - "--only-keep-debug" option. */ - if (sec->size > 0 && !(sec->flags & SEC_HAS_CONTENTS)) - hdr->sh_type = sh_type; - /* The generic elf_fake_sections will set up REL_HDR using the default kind of relocations. We used to set up a second header for the non-default kind of relocations here, but only NewABI would use @@ -5735,6 +5751,7 @@ _bfd_mips_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, /* Common symbols less than the GP size are automatically treated as SHN_MIPS_SCOMMON symbols. */ if (sym->st_size > elf_gp_size (abfd) + || ELF_ST_TYPE (sym->st_info) == STT_TLS || IRIX_COMPAT (abfd) == ict_irix6) break; /* Fall through. */ @@ -6116,7 +6133,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, /* Check for the mips16 stub sections. */ name = bfd_get_section_name (abfd, sec); - if (strncmp (name, FN_STUB, sizeof FN_STUB - 1) == 0) + if (FN_STUB_P (name)) { unsigned long r_symndx; @@ -6141,12 +6158,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, /* We can ignore stub sections when looking for relocs. */ if ((o->flags & SEC_RELOC) == 0 || o->reloc_count == 0 - || strncmp (bfd_get_section_name (abfd, o), FN_STUB, - sizeof FN_STUB - 1) == 0 - || strncmp (bfd_get_section_name (abfd, o), CALL_STUB, - sizeof CALL_STUB - 1) == 0 - || strncmp (bfd_get_section_name (abfd, o), CALL_FP_STUB, - sizeof CALL_FP_STUB - 1) == 0) + || mips16_stub_section_p (abfd, o)) continue; sec_relocs @@ -6198,6 +6210,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, elf_tdata (abfd)->local_stubs = n; } + sec->flags |= SEC_KEEP; elf_tdata (abfd)->local_stubs[r_symndx] = sec; /* We don't need to set mips16_stubs_seen in this case. @@ -6218,12 +6231,23 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, /* H is the symbol this stub is for. */ + /* If we already have an appropriate stub for this function, we + don't need another one, so we can discard this one. Since + this function is called before the linker maps input sections + to output sections, we can easily discard it by setting the + SEC_EXCLUDE flag. */ + if (h->fn_stub != NULL) + { + sec->flags |= SEC_EXCLUDE; + return TRUE; + } + + sec->flags |= SEC_KEEP; h->fn_stub = sec; mips_elf_hash_table (info)->mips16_stubs_seen = TRUE; } } - else if (strncmp (name, CALL_STUB, sizeof CALL_STUB - 1) == 0 - || strncmp (name, CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0) + else if (CALL_STUB_P (name) || CALL_FP_STUB_P (name)) { unsigned long r_symndx; struct mips_elf_link_hash_entry *h; @@ -6237,42 +6261,106 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, if (r_symndx < extsymoff || sym_hashes[r_symndx - extsymoff] == NULL) { - /* This stub was actually built for a static symbol defined - in the same file. We assume that all static symbols in - mips16 code are themselves mips16, so we can simply - discard this stub. Since this function is called before - the linker maps input sections to output sections, we can - easily discard it by setting the SEC_EXCLUDE flag. */ - sec->flags |= SEC_EXCLUDE; - return TRUE; + asection *o; + + /* This stub is for a local symbol. This stub will only be + needed if there is some relocation (R_MIPS16_26) in this BFD + that refers to this symbol. */ + for (o = abfd->sections; o != NULL; o = o->next) + { + Elf_Internal_Rela *sec_relocs; + const Elf_Internal_Rela *r, *rend; + + /* We can ignore stub sections when looking for relocs. */ + if ((o->flags & SEC_RELOC) == 0 + || o->reloc_count == 0 + || mips16_stub_section_p (abfd, o)) + continue; + + sec_relocs + = _bfd_elf_link_read_relocs (abfd, o, NULL, NULL, + info->keep_memory); + if (sec_relocs == NULL) + return FALSE; + + rend = sec_relocs + o->reloc_count; + for (r = sec_relocs; r < rend; r++) + if (ELF_R_SYM (abfd, r->r_info) == r_symndx + && ELF_R_TYPE (abfd, r->r_info) == R_MIPS16_26) + break; + + if (elf_section_data (o)->relocs != sec_relocs) + free (sec_relocs); + + if (r < rend) + break; + } + + if (o == NULL) + { + /* There is no non-call reloc for this stub, so we do + not need it. Since this function is called before + the linker maps input sections to output sections, we + can easily discard it by setting the SEC_EXCLUDE + flag. */ + sec->flags |= SEC_EXCLUDE; + return TRUE; + } + + /* Record this stub in an array of local symbol call_stubs for + this BFD. */ + if (elf_tdata (abfd)->local_call_stubs == NULL) + { + unsigned long symcount; + asection **n; + bfd_size_type amt; + + if (elf_bad_symtab (abfd)) + symcount = NUM_SHDR_ENTRIES (symtab_hdr); + else + symcount = symtab_hdr->sh_info; + amt = symcount * sizeof (asection *); + n = bfd_zalloc (abfd, amt); + if (n == NULL) + return FALSE; + elf_tdata (abfd)->local_call_stubs = n; + } + + sec->flags |= SEC_KEEP; + elf_tdata (abfd)->local_call_stubs[r_symndx] = sec; + + /* We don't need to set mips16_stubs_seen in this case. + That flag is used to see whether we need to look through + the global symbol table for stubs. We don't need to set + it here, because we just have a local stub. */ } - - h = ((struct mips_elf_link_hash_entry *) - sym_hashes[r_symndx - extsymoff]); - - /* H is the symbol this stub is for. */ - - if (strncmp (name, CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0) - loc = &h->call_fp_stub; else - loc = &h->call_stub; - - /* If we already have an appropriate stub for this function, we - don't need another one, so we can discard this one. Since - this function is called before the linker maps input sections - to output sections, we can easily discard it by setting the - SEC_EXCLUDE flag. We can also discard this section if we - happen to already know that this is a mips16 function; it is - not necessary to check this here, as it is checked later, but - it is slightly faster to check now. */ - if (*loc != NULL || h->root.other == STO_MIPS16) { - sec->flags |= SEC_EXCLUDE; - return TRUE; - } + h = ((struct mips_elf_link_hash_entry *) + sym_hashes[r_symndx - extsymoff]); + + /* H is the symbol this stub is for. */ + + if (CALL_FP_STUB_P (name)) + loc = &h->call_fp_stub; + else + loc = &h->call_stub; + + /* If we already have an appropriate stub for this function, we + don't need another one, so we can discard this one. Since + this function is called before the linker maps input sections + to output sections, we can easily discard it by setting the + SEC_EXCLUDE flag. */ + if (*loc != NULL) + { + sec->flags |= SEC_EXCLUDE; + return TRUE; + } - *loc = sec; - mips_elf_hash_table (info)->mips16_stubs_seen = TRUE; + sec->flags |= SEC_KEEP; + *loc = sec; + mips_elf_hash_table (info)->mips16_stubs_seen = TRUE; + } } if (dynobj == NULL) @@ -6392,6 +6480,10 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, return FALSE; } mips_elf_allocate_dynamic_relocations (dynobj, info, 1); + if (MIPS_ELF_READONLY_SECTION (sec)) + /* We tell the dynamic linker that there are + relocations against the text segment. */ + info->flags |= DF_TEXTREL; } } else if (r_type == R_MIPS_CALL_LO16 @@ -6637,12 +6729,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, References from a stub section do not count. */ if (h != NULL && r_type != R_MIPS16_26 - && strncmp (bfd_get_section_name (abfd, sec), FN_STUB, - sizeof FN_STUB - 1) != 0 - && strncmp (bfd_get_section_name (abfd, sec), CALL_STUB, - sizeof CALL_STUB - 1) != 0 - && strncmp (bfd_get_section_name (abfd, sec), CALL_FP_STUB, - sizeof CALL_FP_STUB - 1) != 0) + && !mips16_stub_section_p (abfd, sec)) { struct mips_elf_link_hash_entry *mh; @@ -6935,7 +7022,6 @@ _bfd_mips_vxworks_adjust_dynamic_symbol (struct bfd_link_info *info, bfd *dynobj; struct mips_elf_link_hash_entry *hmips; struct mips_elf_link_hash_table *htab; - unsigned int power_of_two; htab = mips_elf_hash_table (info); dynobj = elf_hash_table (info)->dynobj; @@ -7058,26 +7144,7 @@ _bfd_mips_vxworks_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 4) - power_of_two = 4; - - /* Apply the required alignment. */ - htab->sdynbss->size = BFD_ALIGN (htab->sdynbss->size, - (bfd_size_type) 1 << power_of_two); - if (power_of_two > bfd_get_section_alignment (dynobj, htab->sdynbss) - && !bfd_set_section_alignment (dynobj, htab->sdynbss, power_of_two)) - return FALSE; - - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = htab->sdynbss; - h->root.u.def.value = htab->sdynbss->size; - - /* Increment the section size to make room for the symbol. */ - htab->sdynbss->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, htab->sdynbss); } /* Return the number of dynamic section symbols required by OUTPUT_BFD. @@ -7091,7 +7158,7 @@ count_section_dynsyms (bfd *output_bfd, struct bfd_link_info *info) bfd_size_type count; count = 0; - if (info->shared) + if (info->shared || elf_hash_table (info)->is_relocatable_executable) { asection *p; const struct elf_backend_data *bed; @@ -7290,7 +7357,7 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd, if ((s->flags & SEC_LINKER_CREATED) == 0) continue; - if (strncmp (name, ".rel", 4) == 0) + if (CONST_STRNEQ (name, ".rel")) { if (s->size != 0) { @@ -7342,7 +7409,7 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd, mips_elf_allocate_dynamic_relocations (dynobj, info, count); } } - else if (!htab->is_vxworks && strncmp (name, ".got", 4) == 0) + else if (!htab->is_vxworks && CONST_STRNEQ (name, ".got")) { /* _bfd_mips_elf_always_size_sections() has already done most of the work, but some symbols may have been mapped @@ -7418,16 +7485,16 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd, } else if (! info->shared && ! mips_elf_hash_table (info)->use_rld_obj_head - && strncmp (name, ".rld_map", 8) == 0) + && CONST_STRNEQ (name, ".rld_map")) { /* We add a room for __rld_map. It will be filled in by the rtld to contain a pointer to the _r_debug structure. */ s->size += 4; } else if (SGI_COMPAT (output_bfd) - && strncmp (name, ".compact_rel", 12) == 0) + && CONST_STRNEQ (name, ".compact_rel")) s->size += mips_elf_hash_table (info)->compact_rel_size; - else if (strncmp (name, ".init", 5) != 0 + else if (! CONST_STRNEQ (name, ".init") && s != htab->sgotplt && s != htab->splt) { @@ -7477,29 +7544,22 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd, /* Add some entries to the .dynamic section. We fill in the values later, in _bfd_mips_elf_finish_dynamic_sections, but we must add the entries now so that we get the correct size for - the .dynamic section. The DT_DEBUG entry is filled in by the - dynamic linker and used by the debugger. */ - if (! info->shared) - { - /* SGI object has the equivalence of DT_DEBUG in the - DT_MIPS_RLD_MAP entry. */ - if (!MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_RLD_MAP, 0)) - return FALSE; - if (!SGI_COMPAT (output_bfd)) - { - if (!MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_DEBUG, 0)) - return FALSE; - } - } - else - { - /* Shared libraries on traditional mips have DT_DEBUG. */ - if (!SGI_COMPAT (output_bfd)) - { - if (!MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_DEBUG, 0)) - return FALSE; - } - } + the .dynamic section. */ + + /* SGI object has the equivalence of DT_DEBUG in the + DT_MIPS_RLD_MAP entry. This must come first because glibc + only fills in DT_MIPS_RLD_MAP (not DT_DEBUG) and GDB only + looks at the first one it sees. */ + if (!info->shared + && !MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_RLD_MAP, 0)) + return FALSE; + + /* The DT_DEBUG entry may be filled in by the dynamic linker and + used by the debugger. */ + if (info->executable + && !SGI_COMPAT (output_bfd) + && !MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_DEBUG, 0)) + return FALSE; if (reltext && (SGI_COMPAT (output_bfd) || htab->is_vxworks)) info->flags |= DF_TEXTREL; @@ -7666,8 +7726,54 @@ _bfd_mips_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, bfd_boolean rela_relocation_p = TRUE; unsigned int r_type = ELF_R_TYPE (output_bfd, rel->r_info); const char *msg; + unsigned long r_symndx; + asection *sec; + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry *h; /* Find the relocation howto for this relocation. */ + howto = MIPS_ELF_RTYPE_TO_HOWTO (input_bfd, r_type, + NEWABI_P (input_bfd) + && (MIPS_RELOC_RELA_P + (input_bfd, input_section, + rel - relocs))); + + r_symndx = ELF_R_SYM (input_bfd, rel->r_info); + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + if (mips_elf_local_relocation_p (input_bfd, rel, local_sections, FALSE)) + { + sec = local_sections[r_symndx]; + h = NULL; + } + else + { + unsigned long extsymoff; + + extsymoff = 0; + if (!elf_bad_symtab (input_bfd)) + extsymoff = symtab_hdr->sh_info; + h = elf_sym_hashes (input_bfd) [r_symndx - extsymoff]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + sec = NULL; + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + sec = h->root.u.def.section; + } + + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + if (r_type == R_MIPS_64 && ! NEWABI_P (input_bfd)) { /* Some 32-bit code uses R_MIPS_64. In particular, people use @@ -7683,13 +7789,6 @@ _bfd_mips_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, if (bfd_big_endian (input_bfd)) rel->r_offset += 4; } - else - /* NewABI defaults to RELA relocations. */ - howto = MIPS_ELF_RTYPE_TO_HOWTO (input_bfd, r_type, - NEWABI_P (input_bfd) - && (MIPS_RELOC_RELA_P - (input_bfd, input_section, - rel - relocs))); if (!use_saved_addend_p) { @@ -7730,10 +7829,8 @@ _bfd_mips_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, && mips_elf_local_relocation_p (input_bfd, rel, local_sections, FALSE))) { - bfd_vma l; const Elf_Internal_Rela *lo16_relocation; reloc_howto_type *lo16_howto; - bfd_byte *lo16_location; int lo16_type; if (r_type == R_MIPS16_HI16) @@ -7756,32 +7853,56 @@ _bfd_mips_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, several relocations for the same address. In that case, the R_MIPS_LO16 relocation may occur as one of these. We permit a similar extension - in general, as that is useful for GCC. */ + in general, as that is useful for GCC. + + In some cases GCC dead code elimination removes + the LO16 but keeps the corresponding HI16. This + is strictly speaking a violation of the ABI but + not immediately harmful. */ lo16_relocation = mips_elf_next_relocation (input_bfd, lo16_type, rel, relend); if (lo16_relocation == NULL) - return FALSE; + { + const char *name; - lo16_location = contents + lo16_relocation->r_offset; + if (h) + name = h->root.root.string; + else + name = bfd_elf_sym_name (input_bfd, symtab_hdr, + local_syms + r_symndx, + sec); + (*_bfd_error_handler) + (_("%B: Can't find matching LO16 reloc against `%s' for %s at 0x%lx in section `%A'"), + input_bfd, input_section, name, howto->name, + rel->r_offset); + } + else + { + bfd_byte *lo16_location; + bfd_vma l; - /* Obtain the addend kept there. */ - lo16_howto = MIPS_ELF_RTYPE_TO_HOWTO (input_bfd, - lo16_type, FALSE); - _bfd_mips16_elf_reloc_unshuffle (input_bfd, lo16_type, FALSE, - lo16_location); - l = mips_elf_obtain_contents (lo16_howto, lo16_relocation, - input_bfd, contents); - _bfd_mips16_elf_reloc_shuffle (input_bfd, lo16_type, FALSE, - lo16_location); - l &= lo16_howto->src_mask; - l <<= lo16_howto->rightshift; - l = _bfd_mips_elf_sign_extend (l, 16); + lo16_location = contents + lo16_relocation->r_offset; - addend <<= 16; + /* Obtain the addend kept there. */ + lo16_howto = MIPS_ELF_RTYPE_TO_HOWTO (input_bfd, + lo16_type, FALSE); + _bfd_mips16_elf_reloc_unshuffle (input_bfd, lo16_type, + FALSE, lo16_location); + l = mips_elf_obtain_contents (lo16_howto, + lo16_relocation, + input_bfd, contents); + _bfd_mips16_elf_reloc_shuffle (input_bfd, lo16_type, + FALSE, lo16_location); + l &= lo16_howto->src_mask; + l <<= lo16_howto->rightshift; + l = _bfd_mips_elf_sign_extend (l, 16); - /* Compute the combined addend. */ - addend += l; + addend <<= 16; + + /* Compute the combined addend. */ + addend += l; + } } else addend <<= howto->rightshift; @@ -8789,11 +8910,10 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd, MIPS_ELF_PUT_WORD (output_bfd, (bfd_vma) 0x80000000, sgot->contents + MIPS_ELF_GOT_SIZE (output_bfd)); } - } - if (sgot != NULL) - elf_section_data (sgot->output_section)->this_hdr.sh_entsize - = MIPS_ELF_GOT_SIZE (output_bfd); + elf_section_data (sgot->output_section)->this_hdr.sh_entsize + = MIPS_ELF_GOT_SIZE (output_bfd); + } /* Generate dynamic relocations for the non-primary gots. */ if (gg != NULL && gg->next) @@ -8867,6 +8987,10 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd, * (ABI_64_P (output_bfd) ? sizeof (Elf64_Mips_External_Rel) : sizeof (Elf32_External_Rel))); + /* Adjust the section size too. Tools like the prelinker + can reasonably expect the values to the same. */ + elf_section_data (s->output_section)->this_hdr.sh_size + = dyn.d_un.d_val; break; default: @@ -9088,7 +9212,7 @@ _bfd_mips_elf_final_write_processing (bfd *abfd, BFD_ASSERT ((*hdrpp)->bfd_section != NULL); name = bfd_get_section_name (abfd, (*hdrpp)->bfd_section); BFD_ASSERT (name != NULL - && strncmp (name, ".gptab.", sizeof ".gptab." - 1) == 0); + && CONST_STRNEQ (name, ".gptab.")); sec = bfd_get_section_by_name (abfd, name + sizeof ".gptab" - 1); BFD_ASSERT (sec != NULL); (*hdrpp)->sh_info = elf_section_data (sec)->this_idx; @@ -9098,8 +9222,7 @@ _bfd_mips_elf_final_write_processing (bfd *abfd, BFD_ASSERT ((*hdrpp)->bfd_section != NULL); name = bfd_get_section_name (abfd, (*hdrpp)->bfd_section); BFD_ASSERT (name != NULL - && strncmp (name, ".MIPS.content", - sizeof ".MIPS.content" - 1) == 0); + && CONST_STRNEQ (name, ".MIPS.content")); sec = bfd_get_section_by_name (abfd, name + sizeof ".MIPS.content" - 1); BFD_ASSERT (sec != NULL); @@ -9119,13 +9242,12 @@ _bfd_mips_elf_final_write_processing (bfd *abfd, BFD_ASSERT ((*hdrpp)->bfd_section != NULL); name = bfd_get_section_name (abfd, (*hdrpp)->bfd_section); BFD_ASSERT (name != NULL); - if (strncmp (name, ".MIPS.events", sizeof ".MIPS.events" - 1) == 0) + if (CONST_STRNEQ (name, ".MIPS.events")) sec = bfd_get_section_by_name (abfd, name + sizeof ".MIPS.events" - 1); else { - BFD_ASSERT (strncmp (name, ".MIPS.post_rel", - sizeof ".MIPS.post_rel" - 1) == 0); + BFD_ASSERT (CONST_STRNEQ (name, ".MIPS.post_rel")); sec = bfd_get_section_by_name (abfd, (name + sizeof ".MIPS.post_rel" - 1)); @@ -9142,7 +9264,8 @@ _bfd_mips_elf_final_write_processing (bfd *abfd, segments. */ int -_bfd_mips_elf_additional_program_headers (bfd *abfd) +_bfd_mips_elf_additional_program_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { asection *s; int ret = 0; @@ -9164,6 +9287,12 @@ _bfd_mips_elf_additional_program_headers (bfd *abfd) && bfd_get_section_by_name (abfd, ".mdebug")) ++ret; + /* Allocate a PT_NULL header in dynamic objects. See + _bfd_mips_elf_modify_segment_map for details. */ + if (!SGI_COMPAT (abfd) + && bfd_get_section_by_name (abfd, ".dynamic")) + ++ret; + return ret; } @@ -9233,15 +9362,18 @@ _bfd_mips_elf_modify_segment_map (bfd *abfd, || (*pm)->p_type == PT_INTERP)) pm = &(*pm)->next; - amt = sizeof (struct elf_segment_map); - options_segment = bfd_zalloc (abfd, amt); - options_segment->next = *pm; - options_segment->p_type = PT_MIPS_OPTIONS; - options_segment->p_flags = PF_R; - options_segment->p_flags_valid = TRUE; - options_segment->count = 1; - options_segment->sections[0] = s; - *pm = options_segment; + if (*pm == NULL || (*pm)->p_type != PT_MIPS_OPTIONS) + { + amt = sizeof (struct elf_segment_map); + options_segment = bfd_zalloc (abfd, amt); + options_segment->next = *pm; + options_segment->p_type = PT_MIPS_OPTIONS; + options_segment->p_flags = PF_R; + options_segment->p_flags_valid = TRUE; + options_segment->count = 1; + options_segment->sections[0] = s; + *pm = options_segment; + } } } else @@ -9311,8 +9443,18 @@ _bfd_mips_elf_modify_segment_map (bfd *abfd, m->p_flags_valid = 1; } } - if (m != NULL - && m->count == 1 && strcmp (m->sections[0]->name, ".dynamic") == 0) + /* GNU/Linux binaries do not need the extended PT_DYNAMIC section. + glibc's dynamic linker has traditionally derived the number of + tags from the p_filesz field, and sometimes allocates stack + arrays of that size. An overly-big PT_DYNAMIC segment can + be actively harmful in such cases. Making PT_DYNAMIC contain + other sections can also make life hard for the prelinker, + which might move one of the other sections to a different + PT_LOAD segment. */ + if (SGI_COMPAT (abfd) + && m != NULL + && m->count == 1 + && strcmp (m->sections[0]->name, ".dynamic") == 0) { static const char *sec_names[] = { @@ -9369,6 +9511,38 @@ _bfd_mips_elf_modify_segment_map (bfd *abfd, } } + /* Allocate a spare program header in dynamic objects so that tools + like the prelinker can add an extra PT_LOAD entry. + + If the prelinker needs to make room for a new PT_LOAD entry, its + standard procedure is to move the first (read-only) sections into + the new (writable) segment. However, the MIPS ABI requires + .dynamic to be in a read-only segment, and the section will often + start within sizeof (ElfNN_Phdr) bytes of the last program header. + + Although the prelinker could in principle move .dynamic to a + writable segment, it seems better to allocate a spare program + header instead, and avoid the need to move any sections. + There is a long tradition of allocating spare dynamic tags, + so allocating a spare program header seems like a natural + extension. */ + if (!SGI_COMPAT (abfd) + && bfd_get_section_by_name (abfd, ".dynamic")) + { + for (pm = &elf_tdata (abfd)->segment_map; *pm != NULL; pm = &(*pm)->next) + if ((*pm)->p_type == PT_NULL) + break; + if (*pm == NULL) + { + m = bfd_zalloc (abfd, sizeof (*m)); + if (m == NULL) + return FALSE; + + m->p_type = PT_NULL; + *pm = m; + } + } + return TRUE; } @@ -9377,7 +9551,7 @@ _bfd_mips_elf_modify_segment_map (bfd *abfd, asection * _bfd_mips_elf_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, + struct bfd_link_info *info, Elf_Internal_Rela *rel, struct elf_link_hash_entry *h, Elf_Internal_Sym *sym) @@ -9385,32 +9559,14 @@ _bfd_mips_elf_gc_mark_hook (asection *sec, /* ??? Do mips16 stub sections need to be handled special? */ if (h != NULL) - { - switch (ELF_R_TYPE (sec->owner, rel->r_info)) - { - case R_MIPS_GNU_VTINHERIT: - case R_MIPS_GNU_VTENTRY: - break; + switch (ELF_R_TYPE (sec->owner, rel->r_info)) + { + case R_MIPS_GNU_VTINHERIT: + case R_MIPS_GNU_VTENTRY: + return NULL; + } - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Update the got entry reference counts for the section being removed. */ @@ -9505,7 +9661,7 @@ _bfd_mips_elf_hide_symbol (struct bfd_link_info *info, dynobj = elf_hash_table (info)->dynobj; if (dynobj != NULL && force_local && h->root.type != STT_TLS - && (got = mips_elf_got_section (dynobj, FALSE)) != NULL + && (got = mips_elf_got_section (dynobj, TRUE)) != NULL && (g = mips_elf_section_data (got)->u.got_info) != NULL) { if (g->next) @@ -9630,8 +9786,9 @@ _bfd_mips_elf_ignore_discarded_relocs (asection *sec) } bfd_boolean -_bfd_mips_elf_write_section (bfd *output_bfd, asection *sec, - bfd_byte *contents) +_bfd_mips_elf_write_section (bfd *output_bfd, + struct bfd_link_info *link_info ATTRIBUTE_UNUSED, + asection *sec, bfd_byte *contents) { bfd_byte *to, *from, *end; int i; @@ -10430,7 +10587,7 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info) mdebug_sec = o; } - if (strncmp (o->name, ".gptab.", sizeof ".gptab." - 1) == 0) + if (CONST_STRNEQ (o->name, ".gptab.")) { const char *subname; unsigned int c; @@ -10805,6 +10962,112 @@ mips_32bit_flags_p (flagword flags) } +/* Merge object attributes from IBFD into OBFD. Raise an error if + there are conflicting attributes. */ +static bfd_boolean +mips_elf_merge_obj_attributes (bfd *ibfd, bfd *obfd) +{ + obj_attribute *in_attr; + obj_attribute *out_attr; + + if (!elf_known_obj_attributes_proc (obfd)[0].i) + { + /* This is the first object. Copy the attributes. */ + _bfd_elf_copy_obj_attributes (ibfd, obfd); + + /* Use the Tag_null value to indicate the attributes have been + initialized. */ + elf_known_obj_attributes_proc (obfd)[0].i = 1; + + return TRUE; + } + + /* Check for conflicting Tag_GNU_MIPS_ABI_FP attributes and merge + non-conflicting ones. */ + in_attr = elf_known_obj_attributes (ibfd)[OBJ_ATTR_GNU]; + out_attr = elf_known_obj_attributes (obfd)[OBJ_ATTR_GNU]; + if (in_attr[Tag_GNU_MIPS_ABI_FP].i != out_attr[Tag_GNU_MIPS_ABI_FP].i) + { + out_attr[Tag_GNU_MIPS_ABI_FP].type = 1; + if (out_attr[Tag_GNU_MIPS_ABI_FP].i == 0) + out_attr[Tag_GNU_MIPS_ABI_FP].i = in_attr[Tag_GNU_MIPS_ABI_FP].i; + else if (in_attr[Tag_GNU_MIPS_ABI_FP].i == 0) + ; + else if (in_attr[Tag_GNU_MIPS_ABI_FP].i > 3) + _bfd_error_handler + (_("Warning: %B uses unknown floating point ABI %d"), ibfd, + in_attr[Tag_GNU_MIPS_ABI_FP].i); + else if (out_attr[Tag_GNU_MIPS_ABI_FP].i > 3) + _bfd_error_handler + (_("Warning: %B uses unknown floating point ABI %d"), obfd, + out_attr[Tag_GNU_MIPS_ABI_FP].i); + else + switch (out_attr[Tag_GNU_MIPS_ABI_FP].i) + { + case 1: + switch (in_attr[Tag_GNU_MIPS_ABI_FP].i) + { + case 2: + _bfd_error_handler + (_("Warning: %B uses -msingle-float, %B uses -mdouble-float"), + obfd, ibfd); + + case 3: + _bfd_error_handler + (_("Warning: %B uses hard float, %B uses soft float"), + obfd, ibfd); + break; + + default: + abort (); + } + break; + + case 2: + switch (in_attr[Tag_GNU_MIPS_ABI_FP].i) + { + case 1: + _bfd_error_handler + (_("Warning: %B uses -msingle-float, %B uses -mdouble-float"), + ibfd, obfd); + + case 3: + _bfd_error_handler + (_("Warning: %B uses hard float, %B uses soft float"), + obfd, ibfd); + break; + + default: + abort (); + } + break; + + case 3: + switch (in_attr[Tag_GNU_MIPS_ABI_FP].i) + { + case 1: + case 2: + _bfd_error_handler + (_("Warning: %B uses hard float, %B uses soft float"), + ibfd, obfd); + break; + + default: + abort (); + } + break; + + default: + abort (); + } + } + + /* Merge Tag_compatibility attributes and any common GNU ones. */ + _bfd_elf_merge_object_attributes (ibfd, obfd); + + return TRUE; +} + /* Merge backend specific data from an object file to the output object file when linking. */ @@ -10838,6 +11101,9 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd) return FALSE; } + if (!mips_elf_merge_obj_attributes (ibfd, obfd)) + return FALSE; + new_flags = elf_elfheader (ibfd)->e_flags; elf_elfheader (obfd)->e_flags |= new_flags & EF_MIPS_NOREORDER; old_flags = elf_elfheader (obfd)->e_flags; @@ -10850,7 +11116,9 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd) = elf_elfheader (ibfd)->e_ident[EI_CLASS]; if (bfd_get_arch (obfd) == bfd_get_arch (ibfd) - && bfd_get_arch_info (obfd)->the_default) + && (bfd_get_arch_info (obfd)->the_default + || mips_mach_extends_p (bfd_get_mach (obfd), + bfd_get_mach (ibfd)))) { if (! bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd))) @@ -11061,37 +11329,52 @@ _bfd_mips_elf_print_private_bfd_data (bfd *abfd, void *ptr) fprintf (file, _(" [no abi set]")); if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_1) - fprintf (file, _(" [mips1]")); + fprintf (file, " [mips1]"); else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_2) - fprintf (file, _(" [mips2]")); + fprintf (file, " [mips2]"); else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_3) - fprintf (file, _(" [mips3]")); + fprintf (file, " [mips3]"); else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_4) - fprintf (file, _(" [mips4]")); + fprintf (file, " [mips4]"); else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_5) - fprintf (file, _(" [mips5]")); + fprintf (file, " [mips5]"); else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32) - fprintf (file, _(" [mips32]")); + fprintf (file, " [mips32]"); else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_64) - fprintf (file, _(" [mips64]")); + fprintf (file, " [mips64]"); else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32R2) - fprintf (file, _(" [mips32r2]")); + fprintf (file, " [mips32r2]"); else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_64R2) - fprintf (file, _(" [mips64r2]")); + fprintf (file, " [mips64r2]"); else fprintf (file, _(" [unknown ISA]")); if (elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH_ASE_MDMX) - fprintf (file, _(" [mdmx]")); + fprintf (file, " [mdmx]"); if (elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH_ASE_M16) - fprintf (file, _(" [mips16]")); + fprintf (file, " [mips16]"); if (elf_elfheader (abfd)->e_flags & EF_MIPS_32BITMODE) - fprintf (file, _(" [32bitmode]")); + fprintf (file, " [32bitmode]"); else fprintf (file, _(" [not 32bitmode]")); + if (elf_elfheader (abfd)->e_flags & EF_MIPS_NOREORDER) + fprintf (file, " [noreorder]"); + + if (elf_elfheader (abfd)->e_flags & EF_MIPS_PIC) + fprintf (file, " [PIC]"); + + if (elf_elfheader (abfd)->e_flags & EF_MIPS_CPIC) + fprintf (file, " [CPIC]"); + + if (elf_elfheader (abfd)->e_flags & EF_MIPS_XGOT) + fprintf (file, " [XGOT]"); + + if (elf_elfheader (abfd)->e_flags & EF_MIPS_UCODE) + fprintf (file, " [UCODE]"); + fputc ('\n', file); return TRUE; @@ -11099,24 +11382,34 @@ _bfd_mips_elf_print_private_bfd_data (bfd *abfd, void *ptr) const struct bfd_elf_special_section _bfd_mips_elf_special_sections[] = { - { ".lit4", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, - { ".lit8", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, - { ".mdebug", 7, 0, SHT_MIPS_DEBUG, 0 }, - { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, - { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, - { ".ucode", 6, 0, SHT_MIPS_UCODE, 0 }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".lit4"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, + { STRING_COMMA_LEN (".lit8"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, + { STRING_COMMA_LEN (".mdebug"), 0, SHT_MIPS_DEBUG, 0 }, + { STRING_COMMA_LEN (".sbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, + { STRING_COMMA_LEN (".sdata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, + { STRING_COMMA_LEN (".ucode"), 0, SHT_MIPS_UCODE, 0 }, + { NULL, 0, 0, 0, 0 } }; -/* Ensure that the STO_OPTIONAL flag is copied into h->other, - even if this is not a defintion of the symbol. */ +/* Merge non visibility st_other attributes. Ensure that the + STO_OPTIONAL flag is copied into h->other, even if this is not a + definiton of the symbol. */ void _bfd_mips_elf_merge_symbol_attribute (struct elf_link_hash_entry *h, const Elf_Internal_Sym *isym, bfd_boolean definition, bfd_boolean dynamic ATTRIBUTE_UNUSED) { - if (! definition + if ((isym->st_other & ~ELF_ST_VISIBILITY (-1)) != 0) + { + unsigned char other; + + other = (definition ? isym->st_other : h->other); + other &= ~ELF_ST_VISIBILITY (-1); + h->other = other | ELF_ST_VISIBILITY (h->other); + } + + if (!definition && ELF_MIPS_IS_OPTIONAL (isym->st_other)) h->other |= STO_OPTIONAL; } @@ -11128,3 +11421,11 @@ _bfd_mips_elf_ignore_undef_symbol (struct elf_link_hash_entry *h) { return ELF_MIPS_IS_OPTIONAL (h->other) ? TRUE : FALSE; } + +bfd_boolean +_bfd_mips_elf_common_definition (Elf_Internal_Sym *sym) +{ + return (sym->st_shndx == SHN_COMMON + || sym->st_shndx == SHN_MIPS_ACOMMON + || sym->st_shndx == SHN_MIPS_SCOMMON); +} diff --git a/bfd/elfxx-mips.h b/bfd/elfxx-mips.h index 6c3c9a30f6e..3e97cc04ab6 100644 --- a/bfd/elfxx-mips.h +++ b/bfd/elfxx-mips.h @@ -1,5 +1,6 @@ /* MIPS ELF specific backend routines. - Copyright 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -68,7 +69,7 @@ extern bfd_boolean _bfd_mips_elf_finish_dynamic_sections extern void _bfd_mips_elf_final_write_processing (bfd *, bfd_boolean); extern int _bfd_mips_elf_additional_program_headers - (bfd *); + (bfd *, struct bfd_link_info *); extern bfd_boolean _bfd_mips_elf_modify_segment_map (bfd *, struct bfd_link_info *); extern asection * _bfd_mips_elf_gc_mark_hook @@ -108,7 +109,7 @@ extern bfd_boolean _bfd_mips_elf_print_private_bfd_data extern bfd_boolean _bfd_mips_elf_discard_info (bfd *, struct elf_reloc_cookie *, struct bfd_link_info *); extern bfd_boolean _bfd_mips_elf_write_section - (bfd *, asection *, bfd_byte *); + (bfd *, struct bfd_link_info *, asection *, bfd_byte *); extern bfd_boolean _bfd_mips_elf_read_ecoff_info (bfd *, asection *, struct ecoff_debug_info *); @@ -141,6 +142,9 @@ extern bfd_boolean _bfd_mips_elf_ignore_undef_symbol extern const struct bfd_elf_special_section _bfd_mips_elf_special_sections []; +extern bfd_boolean _bfd_mips_elf_common_definition (Elf_Internal_Sym *); + +#define elf_backend_common_definition _bfd_mips_elf_common_definition #define elf_backend_name_local_section_symbols \ _bfd_mips_elf_name_local_section_symbols #define elf_backend_special_sections _bfd_mips_elf_special_sections diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c index ef7ff482d2e..708af290e3c 100644 --- a/bfd/elfxx-sparc.c +++ b/bfd/elfxx-sparc.c @@ -1,5 +1,5 @@ /* SPARC-specific support for ELF - Copyright 2005, 2006 Free Software Foundation, Inc. + Copyright 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ /* This file handles functionality common to the different SPARC ABI's. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "libiberty.h" @@ -384,6 +384,30 @@ _bfd_sparc_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } +reloc_howto_type * +_bfd_sparc_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (_bfd_sparc_elf_howto_table) + / sizeof (_bfd_sparc_elf_howto_table[0])); + i++) + if (_bfd_sparc_elf_howto_table[i].name != NULL + && strcasecmp (_bfd_sparc_elf_howto_table[i].name, r_name) == 0) + return &_bfd_sparc_elf_howto_table[i]; + + if (strcasecmp (sparc_vtinherit_howto.name, r_name) == 0) + return &sparc_vtinherit_howto; + if (strcasecmp (sparc_vtentry_howto.name, r_name) == 0) + return &sparc_vtentry_howto; + if (strcasecmp (sparc_rev32_howto.name, r_name) == 0) + return &sparc_rev32_howto; + + return NULL; +} + reloc_howto_type * _bfd_sparc_elf_info_to_howto_ptr (unsigned int r_type) { @@ -487,11 +511,14 @@ struct _bfd_sparc_elf_obj_tdata bfd_boolean _bfd_sparc_elf_mkobject (bfd *abfd) { - bfd_size_type amt = sizeof (struct _bfd_sparc_elf_obj_tdata); - abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) - return FALSE; - return TRUE; + { + bfd_size_type amt = sizeof (struct _bfd_sparc_elf_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + } + return bfd_elf_mkobject (abfd); } static void @@ -507,27 +534,14 @@ sparc_put_word_64 (bfd *bfd, bfd_vma val, void *ptr) } static void -sparc_elf_append_rela_64 (bfd *abfd ATTRIBUTE_UNUSED, - asection *s ATTRIBUTE_UNUSED, - Elf_Internal_Rela *rel ATTRIBUTE_UNUSED) +sparc_elf_append_rela (bfd *abfd, asection *s, Elf_Internal_Rela *rel) { -#ifdef BFD64 - Elf64_External_Rela *loc64; + const struct elf_backend_data *bed; + bfd_byte *loc; - loc64 = (Elf64_External_Rela *) s->contents; - loc64 += s->reloc_count++; - bfd_elf64_swap_reloca_out (abfd, rel, (bfd_byte *) loc64); -#endif -} - -static void -sparc_elf_append_rela_32 (bfd *abfd, asection *s, Elf_Internal_Rela *rel) -{ - Elf32_External_Rela *loc32; - - loc32 = (Elf32_External_Rela *) s->contents; - loc32 += s->reloc_count++; - bfd_elf32_swap_reloca_out (abfd, rel, (bfd_byte *) loc32); + bed = get_elf_backend_data (abfd); + loc = s->contents + (s->reloc_count++ * bed->s->sizeof_rela); + bed->s->swap_reloca_out (abfd, rel, loc); } static bfd_vma @@ -746,9 +760,6 @@ static const bfd_vma sparc_vxworks_shared_plt_entry[] = #define SPARC_ELF_PUT_WORD(htab, bfd, val, ptr) \ htab->put_word(bfd, val, ptr) -#define SPARC_ELF_APPEND_RELA(htab, bfd, sec, rela) \ - htab->append_rela(bfd, sec, rela) - #define SPARC_ELF_R_INFO(htab, in_rel, index, type) \ htab->r_info(in_rel, index, type) @@ -824,7 +835,6 @@ _bfd_sparc_elf_link_hash_table_create (bfd *abfd) if (ABI_64_P (abfd)) { ret->put_word = sparc_put_word_64; - ret->append_rela = sparc_elf_append_rela_64; ret->r_info = sparc_elf_r_info_64; ret->r_symndx = sparc_elf_r_symndx_64; ret->dtpoff_reloc = R_SPARC_TLS_DTPOFF64; @@ -840,7 +850,6 @@ _bfd_sparc_elf_link_hash_table_create (bfd *abfd) else { ret->put_word = sparc_put_word_32; - ret->append_rela = sparc_elf_append_rela_32; ret->r_info = sparc_elf_r_info_32; ret->r_symndx = sparc_elf_r_symndx_32; ret->dtpoff_reloc = R_SPARC_TLS_DTPOFF32; @@ -1427,7 +1436,7 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (abfd, sec), name + 5) == 0); @@ -1529,35 +1538,14 @@ _bfd_sparc_elf_gc_mark_hook (asection *sec, Elf_Internal_Sym *sym) { if (h != NULL) - { - struct _bfd_sparc_elf_link_hash_table *htab; - - htab = _bfd_sparc_elf_hash_table (info); - switch (SPARC_ELF_R_TYPE (rel->r_info)) + switch (SPARC_ELF_R_TYPE (rel->r_info)) { case R_SPARC_GNU_VTINHERIT: case R_SPARC_GNU_VTENTRY: - break; - - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } + return NULL; } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Update the got entry reference counts for the section being removed. */ @@ -1713,7 +1701,6 @@ _bfd_sparc_elf_adjust_dynamic_symbol (struct bfd_link_info *info, struct _bfd_sparc_elf_link_hash_entry * eh; struct _bfd_sparc_elf_dyn_relocs *p; asection *s; - unsigned int power_of_two; htab = _bfd_sparc_elf_hash_table (info); @@ -1830,29 +1817,9 @@ _bfd_sparc_elf_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > htab->align_power_max) - power_of_two = htab->align_power_max; - - /* Apply the required alignment. */ s = htab->sdynbss; - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (dynobj, s)) - { - if (! bfd_set_section_alignment (dynobj, s, power_of_two)) - return FALSE; - } - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -2287,7 +2254,7 @@ _bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd, /* Strip this section if we don't need it; see the comment below. */ } - else if (strncmp (s->name, ".rela", 5) == 0) + else if (CONST_STRNEQ (s->name, ".rela")) { if (s->size != 0) { @@ -2434,13 +2401,16 @@ _bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd, bfd_boolean _bfd_sparc_elf_new_section_hook (bfd *abfd, asection *sec) { - struct _bfd_sparc_elf_section_data *sdata; - bfd_size_type amt = sizeof (*sdata); + if (!sec->used_by_bfd) + { + struct _bfd_sparc_elf_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); - sdata = (struct _bfd_sparc_elf_section_data *) bfd_zalloc (abfd, amt); - if (sdata == NULL) - return FALSE; - sec->used_by_bfd = (PTR) sdata; + sdata = bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = sdata; + } return _bfd_elf_new_section_hook (abfd, sec); } @@ -2486,10 +2456,14 @@ tpoff (struct bfd_link_info *info, bfd_vma address) /* Relocate a SPARC ELF section. */ bfd_boolean -_bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, - bfd *input_bfd, asection *input_section, - bfd_byte *contents, Elf_Internal_Rela *relocs, - Elf_Internal_Sym *local_syms, asection **local_sections) +_bfd_sparc_elf_relocate_section (bfd *output_bfd, + struct bfd_link_info *info, + bfd *input_bfd, + asection *input_section, + bfd_byte *contents, + Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, + asection **local_sections) { struct _bfd_sparc_elf_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; @@ -2501,9 +2475,6 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, Elf_Internal_Rela *relend; int num_relocs; - if (info->relocatable) - return TRUE; - htab = _bfd_sparc_elf_hash_table (info); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -2547,7 +2518,6 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, } howto = _bfd_sparc_elf_howto_table + r_type; - /* This is a final link. */ r_symndx = SPARC_ELF_R_SYMNDX (htab, rel->r_info); h = NULL; sym = NULL; @@ -2579,6 +2549,21 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, } } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce + sections, or sections discarded by a linker script, we + just want the section contents zeroed. Avoid any + special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + switch (r_type) { case R_SPARC_GOT10: @@ -2660,7 +2645,7 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, 0, R_SPARC_RELATIVE); outrel.r_addend = relocation; relocation = 0; - SPARC_ELF_APPEND_RELA (htab, output_bfd, s, &outrel); + sparc_elf_append_rela (output_bfd, s, &outrel); } SPARC_ELF_PUT_WORD (htab, output_bfd, relocation, @@ -2767,11 +2752,7 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, case R_SPARC_L44: case R_SPARC_UA64: r_sparc_plt32: - /* r_symndx will be zero only for relocs against symbols - from removed linkonce sections, or sections discarded by - a linker script. */ - if (r_symndx == 0 - || (input_section->flags & SEC_ALLOC) == 0) + if ((input_section->flags & SEC_ALLOC) == 0) break; if ((info->shared @@ -2879,6 +2860,8 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { long indx; + outrel.r_addend = relocation + rel->r_addend; + if (is_plt) sec = htab->splt; @@ -2893,9 +2876,20 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { asection *osec; + /* We are turning this relocation into one + against a section symbol. It would be + proper to subtract the symbol's value, + osec->vma, from the emitted reloc addend, + but ld.so expects buggy relocs. */ osec = sec->output_section; indx = elf_section_data (osec)->dynindx; + if (indx == 0) + { + osec = htab->elf.text_index_section; + indx = elf_section_data (osec)->dynindx; + } + /* FIXME: we really should be able to link non-pic shared libraries. */ if (indx == 0) @@ -2909,12 +2903,12 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, } } - outrel.r_info = SPARC_ELF_R_INFO (htab, rel, indx, r_type); - outrel.r_addend = relocation + rel->r_addend; + outrel.r_info = SPARC_ELF_R_INFO (htab, rel, indx, + r_type); } } - SPARC_ELF_APPEND_RELA (htab, output_bfd, sreloc, &outrel); + sparc_elf_append_rela (output_bfd, sreloc, &outrel); /* This reloc will be computed at runtime, so there's no need to do anything now. */ @@ -3022,7 +3016,7 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, else outrel.r_addend = 0; outrel.r_info = SPARC_ELF_R_INFO (htab, NULL, indx, dr_type); - SPARC_ELF_APPEND_RELA (htab, output_bfd, htab->srelgot, &outrel); + sparc_elf_append_rela (output_bfd, htab->srelgot, &outrel); if (r_type == R_SPARC_TLS_GD_HI22 || r_type == R_SPARC_TLS_GD_LO10) @@ -3043,7 +3037,8 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, outrel.r_info = SPARC_ELF_R_INFO (htab, NULL, indx, SPARC_ELF_DTPOFF_RELOC (htab)); outrel.r_offset += SPARC_ELF_WORD_BYTES (htab); - SPARC_ELF_APPEND_RELA (htab, output_bfd, htab->srelgot, &outrel); + sparc_elf_append_rela (output_bfd, htab->srelgot, + &outrel); } } else if (dr_type == SPARC_ELF_DTPMOD_RELOC (htab)) @@ -3112,7 +3107,7 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, + rel->r_addend; } - SPARC_ELF_APPEND_RELA (htab, output_bfd, sreloc, &outrel); + sparc_elf_append_rela (output_bfd, sreloc, &outrel); continue; } relocation = tpoff (info, relocation); @@ -3633,9 +3628,11 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd, { bfd *dynobj; struct _bfd_sparc_elf_link_hash_table *htab; + const struct elf_backend_data *bed; htab = _bfd_sparc_elf_hash_table (info); dynobj = htab->elf.dynobj; + bed = get_elf_backend_data (output_bfd); if (h->plt.offset != (bfd_vma) -1) { @@ -3705,18 +3702,8 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd, thus .plt[4] has corresponding .rela.plt[0] and so on. */ loc = srela->contents; -#ifdef BFD64 - if (ABI_64_P (output_bfd)) - { - loc += rela_index * sizeof (Elf64_External_Rela); - bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); - } - else -#endif - { - loc += rela_index * sizeof (Elf32_External_Rela); - bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); - } + loc += rela_index * bed->s->sizeof_rela; + bed->s->swap_reloca_out (output_bfd, &rela, loc); if (!h->def_regular) { @@ -3773,7 +3760,7 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd, SPARC_ELF_PUT_WORD (htab, output_bfd, 0, sgot->contents + (h->got.offset & ~(bfd_vma) 1)); - SPARC_ELF_APPEND_RELA (htab, output_bfd, srela, &rela); + sparc_elf_append_rela (output_bfd, srela, &rela); } if (h->needs_copy) @@ -3793,7 +3780,7 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd, + h->root.u.def.section->output_offset); rela.r_info = SPARC_ELF_R_INFO (htab, NULL, h->dynindx, R_SPARC_COPY); rela.r_addend = 0; - SPARC_ELF_APPEND_RELA (htab, output_bfd, s, &rela); + sparc_elf_append_rela (output_bfd, s, &rela); } /* Mark some specially defined symbols as absolute. On VxWorks, @@ -3809,83 +3796,30 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd, /* Finish up the dynamic sections. */ -#ifdef BFD64 static bfd_boolean -sparc64_finish_dyn (bfd *output_bfd, struct bfd_link_info *info, - bfd *dynobj, asection *sdyn, - asection *splt ATTRIBUTE_UNUSED) +sparc_finish_dyn (bfd *output_bfd, struct bfd_link_info *info, + bfd *dynobj, asection *sdyn, + asection *splt ATTRIBUTE_UNUSED) { - Elf64_External_Dyn *dyncon, *dynconend; - int stt_regidx = -1; - - dyncon = (Elf64_External_Dyn *) sdyn->contents; - dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->size); - for (; dyncon < dynconend; dyncon++) - { - Elf_Internal_Dyn dyn; - const char *name; - bfd_boolean size; - - bfd_elf64_swap_dyn_in (dynobj, dyncon, &dyn); - - switch (dyn.d_tag) - { - case DT_PLTGOT: name = ".plt"; size = FALSE; break; - case DT_PLTRELSZ: name = ".rela.plt"; size = TRUE; break; - case DT_JMPREL: name = ".rela.plt"; size = FALSE; break; - case DT_SPARC_REGISTER: - if (stt_regidx == -1) - { - stt_regidx = - _bfd_elf_link_lookup_local_dynindx (info, output_bfd, -1); - if (stt_regidx == -1) - return FALSE; - } - dyn.d_un.d_val = stt_regidx++; - bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); - /* fallthrough */ - default: name = NULL; size = FALSE; break; - } - - if (name != NULL) - { - asection *s; - - s = bfd_get_section_by_name (output_bfd, name); - if (s == NULL) - dyn.d_un.d_val = 0; - else - { - if (! size) - dyn.d_un.d_ptr = s->vma; - else - dyn.d_un.d_val = s->size; - } - bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); - } - } - return TRUE; -} -#endif - -static bfd_boolean -sparc32_finish_dyn (bfd *output_bfd, struct bfd_link_info *info, - bfd *dynobj, asection *sdyn, - asection *splt ATTRIBUTE_UNUSED) -{ - Elf32_External_Dyn *dyncon, *dynconend; struct _bfd_sparc_elf_link_hash_table *htab; + const struct elf_backend_data *bed; + bfd_byte *dyncon, *dynconend; + size_t dynsize; + int stt_regidx = -1; + bfd_boolean abi_64_p; htab = _bfd_sparc_elf_hash_table (info); - dyncon = (Elf32_External_Dyn *) sdyn->contents; - dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size); - for (; dyncon < dynconend; dyncon++) + bed = get_elf_backend_data (output_bfd); + dynsize = bed->s->sizeof_dyn; + dynconend = sdyn->contents + sdyn->size; + abi_64_p = ABI_64_P (output_bfd); + for (dyncon = sdyn->contents; dyncon < dynconend; dyncon += dynsize) { Elf_Internal_Dyn dyn; const char *name; bfd_boolean size; - bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn); + bed->s->swap_dyn_in (dynobj, dyncon, &dyn); if (htab->is_vxworks && dyn.d_tag == DT_RELASZ) { @@ -3894,7 +3828,7 @@ sparc32_finish_dyn (bfd *output_bfd, struct bfd_link_info *info, if (htab->srelplt) { dyn.d_un.d_val -= htab->srelplt->size; - bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + bed->s->swap_dyn_out (output_bfd, &dyn, dyncon); } } else if (htab->is_vxworks && dyn.d_tag == DT_PLTGOT) @@ -3905,9 +3839,21 @@ sparc32_finish_dyn (bfd *output_bfd, struct bfd_link_info *info, { dyn.d_un.d_val = (htab->sgotplt->output_section->vma + htab->sgotplt->output_offset); - bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + bed->s->swap_dyn_out (output_bfd, &dyn, dyncon); } } + else if (abi_64_p && dyn.d_tag == DT_SPARC_REGISTER) + { + if (stt_regidx == -1) + { + stt_regidx = + _bfd_elf_link_lookup_local_dynindx (info, output_bfd, -1); + if (stt_regidx == -1) + return FALSE; + } + dyn.d_un.d_val = stt_regidx++; + bed->s->swap_dyn_out (output_bfd, &dyn, dyncon); + } else { switch (dyn.d_tag) @@ -3915,7 +3861,7 @@ sparc32_finish_dyn (bfd *output_bfd, struct bfd_link_info *info, case DT_PLTGOT: name = ".plt"; size = FALSE; break; case DT_PLTRELSZ: name = ".rela.plt"; size = TRUE; break; case DT_JMPREL: name = ".rela.plt"; size = FALSE; break; - default: name = NULL; size = FALSE; break; + default: name = NULL; size = FALSE; break; } if (name != NULL) @@ -3932,7 +3878,7 @@ sparc32_finish_dyn (bfd *output_bfd, struct bfd_link_info *info, else dyn.d_un.d_val = s->size; } - bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + bed->s->swap_dyn_out (output_bfd, &dyn, dyncon); } } } @@ -4046,20 +3992,12 @@ _bfd_sparc_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *i if (elf_hash_table (info)->dynamic_sections_created) { asection *splt; - bfd_boolean ret; splt = bfd_get_section_by_name (dynobj, ".plt"); BFD_ASSERT (splt != NULL && sdyn != NULL); -#ifdef BFD64 - if (ABI_64_P (output_bfd)) - ret = sparc64_finish_dyn (output_bfd, info, dynobj, sdyn, splt); - else -#endif - ret = sparc32_finish_dyn (output_bfd, info, dynobj, sdyn, splt); - - if (ret != TRUE) - return ret; + if (!sparc_finish_dyn (output_bfd, info, dynobj, sdyn, splt)) + return FALSE; /* Initialize the contents of the .plt section. */ if (splt->size > 0) @@ -4081,7 +4019,8 @@ _bfd_sparc_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *i } elf_section_data (splt->output_section)->this_hdr.sh_entsize - = htab->plt_entry_size; + = (htab->is_vxworks || !ABI_64_P (output_bfd)) + ? 0 : htab->plt_entry_size; } /* Set the first entry in the global offset table to the address of diff --git a/bfd/elfxx-sparc.h b/bfd/elfxx-sparc.h index 0a5a88b6fe3..787fd33c6d7 100644 --- a/bfd/elfxx-sparc.h +++ b/bfd/elfxx-sparc.h @@ -1,5 +1,5 @@ /* SPARC ELF specific backend routines. - Copyright 2005 Free Software Foundation, Inc. + Copyright 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -71,7 +71,6 @@ struct _bfd_sparc_elf_link_hash_table asection *sgotplt; void (*put_word) (bfd *, bfd_vma, void *); - void (*append_rela) (bfd *, asection *, Elf_Internal_Rela *); bfd_vma (*r_info) (Elf_Internal_Rela *, bfd_vma, bfd_vma); bfd_vma (*r_symndx) (bfd_vma); int (*build_plt_entry) (bfd *, asection *, bfd_vma, bfd_vma, bfd_vma *); @@ -97,6 +96,8 @@ struct _bfd_sparc_elf_link_hash_table extern reloc_howto_type *_bfd_sparc_elf_reloc_type_lookup (bfd *, bfd_reloc_code_real_type); +extern reloc_howto_type *_bfd_sparc_elf_reloc_name_lookup + (bfd *, const char *); extern void _bfd_sparc_elf_info_to_howto (bfd *, arelent *, Elf_Internal_Rela *); extern reloc_howto_type *_bfd_sparc_elf_info_to_howto_ptr diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h index 503726d2b86..be0cfecfde0 100644 --- a/bfd/elfxx-target.h +++ b/bfd/elfxx-target.h @@ -29,7 +29,9 @@ #ifndef bfd_elfNN_close_and_cleanup #define bfd_elfNN_close_and_cleanup _bfd_elf_close_and_cleanup #endif -#define bfd_elfNN_bfd_free_cached_info _bfd_generic_bfd_free_cached_info +#ifndef bfd_elfNN_bfd_free_cached_info +#define bfd_elfNN_bfd_free_cached_info _bfd_free_cached_info +#endif #ifndef bfd_elfNN_get_section_contents #define bfd_elfNN_get_section_contents _bfd_generic_get_section_contents #endif @@ -101,6 +103,9 @@ #ifndef elf_backend_want_p_paddr_set_to_zero #define elf_backend_want_p_paddr_set_to_zero 0 #endif +#ifndef elf_backend_default_execstack +#define elf_backend_default_execstack 1 +#endif #define bfd_elfNN_bfd_debug_info_start bfd_void #define bfd_elfNN_bfd_debug_info_end bfd_void @@ -129,7 +134,10 @@ #define elf_backend_gc_mark_dynamic_ref bfd_elf_gc_mark_dynamic_ref_symbol #endif #ifndef elf_backend_gc_mark_hook -#define elf_backend_gc_mark_hook NULL +#define elf_backend_gc_mark_hook _bfd_elf_gc_mark_hook +#endif +#ifndef elf_backend_gc_mark_extra_sections +#define elf_backend_gc_mark_extra_sections NULL #endif #ifndef elf_backend_gc_sweep_hook #define elf_backend_gc_sweep_hook NULL @@ -283,6 +291,10 @@ #define elf_info_to_howto_rel 0 #endif +#ifndef ELF_OSABI +#define ELF_OSABI ELFOSABI_NONE +#endif + #ifndef ELF_MAXPAGESIZE #error ELF_MAXPAGESIZE is not defined #define ELF_MAXPAGESIZE 1 @@ -292,6 +304,10 @@ #define ELF_MINPAGESIZE ELF_MAXPAGESIZE #endif +#ifndef ELF_COMMONPAGESIZE +#define ELF_COMMONPAGESIZE ELF_MAXPAGESIZE +#endif + #ifndef ELF_DYNAMIC_SEC_FLAGS /* Note that we set the SEC_IN_MEMORY flag for these sections. */ #define ELF_DYNAMIC_SEC_FLAGS \ @@ -366,6 +382,9 @@ #ifndef elf_backend_check_directives #define elf_backend_check_directives 0 #endif +#ifndef elf_backend_as_needed_cleanup +#define elf_backend_as_needed_cleanup 0 +#endif #ifndef elf_backend_adjust_dynamic_symbol #define elf_backend_adjust_dynamic_symbol 0 #endif @@ -375,6 +394,10 @@ #ifndef elf_backend_size_dynamic_sections #define elf_backend_size_dynamic_sections 0 #endif +#ifndef elf_backend_init_index_section +#define elf_backend_init_index_section \ + ((void (*) (bfd *, struct bfd_link_info *)) bfd_void) +#endif #ifndef elf_backend_relocate_section #define elf_backend_relocate_section 0 #endif @@ -396,6 +419,9 @@ #ifndef elf_backend_modify_segment_map #define elf_backend_modify_segment_map 0 #endif +#ifndef elf_backend_modify_program_headers +#define elf_backend_modify_program_headers 0 +#endif #ifndef elf_backend_ecoff_debug_swap #define elf_backend_ecoff_debug_swap 0 #endif @@ -405,12 +431,27 @@ #ifndef elf_backend_got_header_size #define elf_backend_got_header_size 0 #endif +#ifndef elf_backend_obj_attrs_vendor +#define elf_backend_obj_attrs_vendor NULL +#endif +#ifndef elf_backend_obj_attrs_section +#define elf_backend_obj_attrs_section NULL +#endif +#ifndef elf_backend_obj_attrs_arg_type +#define elf_backend_obj_attrs_arg_type NULL +#endif +#ifndef elf_backend_obj_attrs_section_type +#define elf_backend_obj_attrs_section_type SHT_GNU_ATTRIBUTES +#endif #ifndef elf_backend_post_process_headers #define elf_backend_post_process_headers NULL #endif #ifndef elf_backend_print_symbol_all #define elf_backend_print_symbol_all NULL #endif +#ifndef elf_backend_output_arch_local_syms +#define elf_backend_output_arch_local_syms NULL +#endif #ifndef elf_backend_output_arch_syms #define elf_backend_output_arch_syms NULL #endif @@ -441,6 +482,9 @@ #ifndef elf_backend_grok_psinfo #define elf_backend_grok_psinfo NULL #endif +#ifndef elf_backend_write_core_note +#define elf_backend_write_core_note NULL +#endif #ifndef elf_backend_sprintf_vma #define elf_backend_sprintf_vma _bfd_elf_sprintf_vma #endif @@ -551,15 +595,24 @@ #define elf_backend_merge_symbol NULL #endif +#ifndef elf_backend_hash_symbol +#define elf_backend_hash_symbol _bfd_elf_hash_symbol +#endif + +#ifndef elf_backend_is_function_type +#define elf_backend_is_function_type _bfd_elf_is_function_type +#endif + extern const struct elf_size_info _bfd_elfNN_size_info; -#ifndef INCLUDED_TARGET_FILE -static const struct elf_backend_data elfNN_bed = +static struct elf_backend_data elfNN_bed = { ELF_ARCH, /* arch */ ELF_MACHINE_CODE, /* elf_machine_code */ + ELF_OSABI, /* elf_osabi */ ELF_MAXPAGESIZE, /* maxpagesize */ ELF_MINPAGESIZE, /* minpagesize */ + ELF_COMMONPAGESIZE, /* commonpagesize */ ELF_DYNAMIC_SEC_FLAGS, /* dynamic_sec_flags */ elf_info_to_howto, elf_info_to_howto_rel, @@ -583,9 +636,11 @@ static const struct elf_backend_data elfNN_bed = elf_backend_omit_section_dynsym, elf_backend_check_relocs, elf_backend_check_directives, + elf_backend_as_needed_cleanup, elf_backend_adjust_dynamic_symbol, elf_backend_always_size_sections, elf_backend_size_dynamic_sections, + elf_backend_init_index_section, elf_backend_relocate_section, elf_backend_finish_dynamic_symbol, elf_backend_finish_dynamic_sections, @@ -593,11 +648,14 @@ static const struct elf_backend_data elfNN_bed = elf_backend_final_write_processing, elf_backend_additional_program_headers, elf_backend_modify_segment_map, + elf_backend_modify_program_headers, elf_backend_gc_mark_dynamic_ref, elf_backend_gc_mark_hook, + elf_backend_gc_mark_extra_sections, elf_backend_gc_sweep_hook, elf_backend_post_process_headers, elf_backend_print_symbol_all, + elf_backend_output_arch_local_syms, elf_backend_output_arch_syms, elf_backend_copy_indirect_symbol, elf_backend_hide_symbol, @@ -608,6 +666,7 @@ static const struct elf_backend_data elfNN_bed = elf_backend_count_relocs, elf_backend_grok_prstatus, elf_backend_grok_psinfo, + elf_backend_write_core_note, elf_backend_sprintf_vma, elf_backend_fprintf_vma, elf_backend_reloc_type_class, @@ -628,6 +687,8 @@ static const struct elf_backend_data elfNN_bed = elf_backend_common_section_index, elf_backend_common_section, elf_backend_merge_symbol, + elf_backend_hash_symbol, + elf_backend_is_function_type, elf_backend_link_order_error_handler, elf_backend_relplt_name, ELF_MACHINE_ALT1, @@ -635,6 +696,10 @@ static const struct elf_backend_data elfNN_bed = &elf_backend_size_info, elf_backend_special_sections, elf_backend_got_header_size, + elf_backend_obj_attrs_vendor, + elf_backend_obj_attrs_section, + elf_backend_obj_attrs_arg_type, + elf_backend_obj_attrs_section_type, elf_backend_collect, elf_backend_type_change_ok, elf_backend_may_use_rel_p, @@ -651,9 +716,9 @@ static const struct elf_backend_data elfNN_bed = elf_backend_can_refcount, elf_backend_want_got_sym, elf_backend_want_dynbss, - elf_backend_want_p_paddr_set_to_zero + elf_backend_want_p_paddr_set_to_zero, + elf_backend_default_execstack }; -#endif /* Forward declaration for use when initialising alternative_target field. */ #ifdef TARGET_LITTLE_SYM diff --git a/bfd/format.c b/bfd/format.c index 6a34dd2bea4..51438984353 100644 --- a/bfd/format.c +++ b/bfd/format.c @@ -1,6 +1,6 @@ /* Generic BFD support for file formats. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002, - 2003, 2005 Free Software Foundation, Inc. + 2003, 2005, 2007 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -42,8 +42,8 @@ SUBSECTION File format functions */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" /* IMPORT from targets.c. */ diff --git a/bfd/freebsd.h b/bfd/freebsd.h index 6d577ea4afb..e453b4b21c3 100644 --- a/bfd/freebsd.h +++ b/bfd/freebsd.h @@ -1,5 +1,5 @@ /* BFD back-end definitions used by all FreeBSD targets. - Copyright 1990, 1991, 1992, 1996, 1997, 2000, 2001, 2002, 2005 + Copyright 1990, 1991, 1992, 1996, 1997, 2000, 2001, 2002, 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -51,8 +51,8 @@ ((exec).a_info = \ ((exec).a_info & 0x03ffffff) | ((flags & 0x03f) << 26)) -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libaout.h" diff --git a/bfd/gen-aout.c b/bfd/gen-aout.c index c81d3d0027b..80e90c05eae 100644 --- a/bfd/gen-aout.c +++ b/bfd/gen-aout.c @@ -1,5 +1,5 @@ /* Generate parameters for an a.out system. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 2001, 2002 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 2001, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -99,8 +99,8 @@ main (argc, argv) printf("\n#define MY(OP) CONCAT2 (%s_,OP)\n\n", target); printf("#define TARGETNAME \"a.out-%s\"\n\n", target); - printf("#include \"bfd.h\"\n"); printf("#include \"sysdep.h\"\n"); + printf("#include \"bfd.h\"\n"); printf("#include \"libbfd.h\"\n"); printf("#include \"libaout.h\"\n"); printf("\n#include \"aout-target.h\"\n"); diff --git a/bfd/hash.c b/bfd/hash.c index ce9ba5c6297..2b67dc5eb02 100644 --- a/bfd/hash.c +++ b/bfd/hash.c @@ -1,6 +1,6 @@ /* hash.c -- hash table routines for BFD Copyright 1993, 1994, 1995, 1997, 1999, 2001, 2002, 2003, 2004, 2005, - 2006 Free Software Foundation, Inc. + 2006, 2007 Free Software Foundation, Inc. Written by Steve Chamberlain This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "objalloc.h" #include "libiberty.h" @@ -299,6 +299,58 @@ SUBSUBSECTION /* The default number of entries to use when creating a hash table. */ #define DEFAULT_SIZE 4051 + +/* The following function returns a nearest prime number which is + greater than N, and near a power of two. Copied from libiberty. + Returns zero for ridiculously large N to signify an error. */ + +static unsigned long +higher_prime_number (unsigned long n) +{ + /* These are primes that are near, but slightly smaller than, a + power of two. */ + static const unsigned long primes[] = { + (unsigned long) 127, + (unsigned long) 2039, + (unsigned long) 32749, + (unsigned long) 65521, + (unsigned long) 131071, + (unsigned long) 262139, + (unsigned long) 524287, + (unsigned long) 1048573, + (unsigned long) 2097143, + (unsigned long) 4194301, + (unsigned long) 8388593, + (unsigned long) 16777213, + (unsigned long) 33554393, + (unsigned long) 67108859, + (unsigned long) 134217689, + (unsigned long) 268435399, + (unsigned long) 536870909, + (unsigned long) 1073741789, + (unsigned long) 2147483647, + /* 4294967291L */ + ((unsigned long) 2147483647) + ((unsigned long) 2147483644), + }; + + const unsigned long *low = &primes[0]; + const unsigned long *high = &primes[sizeof (primes) / sizeof (primes[0])]; + + while (low != high) + { + const unsigned long *mid = low + (high - low) / 2; + if (n >= *mid) + low = mid + 1; + else + high = mid; + } + + if (n >= *low) + return 0; + + return *low; +} + static size_t bfd_default_hash_table_size = DEFAULT_SIZE; /* Create a new hash table, given a number of entries. */ @@ -330,6 +382,8 @@ bfd_hash_table_init_n (struct bfd_hash_table *table, memset ((void *) table->table, 0, alloc); table->size = size; table->entsize = entsize; + table->count = 0; + table->frozen = 0; table->newfunc = newfunc; return TRUE; } @@ -416,6 +470,45 @@ bfd_hash_lookup (struct bfd_hash_table *table, hashp->hash = hash; hashp->next = table->table[index]; table->table[index] = hashp; + table->count++; + + if (!table->frozen && table->count > table->size * 3 / 4) + { + unsigned long newsize = higher_prime_number (table->size); + struct bfd_hash_entry **newtable; + unsigned int hi; + unsigned long alloc = newsize * sizeof (struct bfd_hash_entry *); + + /* If we can't find a higher prime, or we can't possibly alloc + that much memory, don't try to grow the table. */ + if (newsize == 0 || alloc / sizeof (struct bfd_hash_entry *) != newsize) + { + table->frozen = 1; + return hashp; + } + + newtable = ((struct bfd_hash_entry **) + objalloc_alloc ((struct objalloc *) table->memory, alloc)); + memset ((PTR) newtable, 0, alloc); + + for (hi = 0; hi < table->size; hi ++) + while (table->table[hi]) + { + struct bfd_hash_entry *chain = table->table[hi]; + struct bfd_hash_entry *chain_end = chain; + int index; + + while (chain_end->next && chain_end->next->hash == chain->hash) + chain_end = chain_end->next; + + table->table[hi] = chain_end->next; + index = chain->hash % newsize; + chain_end->next = newtable[index]; + newtable[index] = chain; + } + table->table = newtable; + table->size = newsize; + } return hashp; } @@ -480,14 +573,17 @@ bfd_hash_traverse (struct bfd_hash_table *table, { unsigned int i; + table->frozen = 1; for (i = 0; i < table->size; i++) { struct bfd_hash_entry *p; for (p = table->table[i]; p != NULL; p = p->next) if (! (*func) (p, info)) - return; + goto out; } + out: + table->frozen = 0; } void diff --git a/bfd/host-aout.c b/bfd/host-aout.c index 902a0206696..12e59510d86 100644 --- a/bfd/host-aout.c +++ b/bfd/host-aout.c @@ -1,5 +1,5 @@ /* BFD backend for local host's a.out binaries - Copyright 1990, 1991, 1992, 1994, 1995, 2001 + Copyright 1990, 1991, 1992, 1994, 1995, 2001, 2007 Free Software Foundation, Inc. Written by Cygnus Support. Probably John Gilmore's fault. @@ -19,8 +19,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #define ARCH_SIZE 32 diff --git a/bfd/hp300bsd.c b/bfd/hp300bsd.c index 91d994cc3ae..43a6caf45c1 100644 --- a/bfd/hp300bsd.c +++ b/bfd/hp300bsd.c @@ -1,5 +1,6 @@ /* BFD back-end for HP 9000/300 (68000-based) machines running BSD Unix. - Copyright 1992, 1994, 1995, 2001, 2003 Free Software Foundation, Inc. + Copyright 1992, 1994, 1995, 2001, 2003, 2007 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -32,8 +33,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define MY(OP) CONCAT2 (hp300bsd_,OP) #define TARGETNAME "a.out-hp300bsd" -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libaout.h" diff --git a/bfd/hppabsd-core.c b/bfd/hppabsd-core.c index 67627e7a666..7de1c0199be 100644 --- a/bfd/hppabsd-core.c +++ b/bfd/hppabsd-core.c @@ -1,6 +1,6 @@ /* BFD back-end for HPPA BSD core files. - Copyright 1993, 1994, 1995, 1998, 1999, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1998, 1999, 2001, 2002, 2003, 2004, 2005, + 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -33,8 +33,8 @@ I would not expect this to be of use to any other host/target, but you never know. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #if defined (HOST_HPPABSD) @@ -90,11 +90,10 @@ make_bfd_asection (abfd, name, flags, size, offset, alignment_power) { asection *asect; - asect = bfd_make_section (abfd, name); + asect = bfd_make_section_with_flags (abfd, name, flags); if (!asect) return NULL; - asect->flags = flags; asect->size = size; asect->filepos = offset; asect->alignment_power = alignment_power; diff --git a/bfd/hpux-core.c b/bfd/hpux-core.c index 08adcd3a1e6..64ce41703e6 100644 --- a/bfd/hpux-core.c +++ b/bfd/hpux-core.c @@ -1,6 +1,6 @@ /* BFD back-end for HP/UX core files. - Copyright 1993, 1994, 1996, 1998, 1999, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1996, 1998, 1999, 2001, 2002, 2003, 2004, 2006, + 2007 Free Software Foundation, Inc. Written by Stu Grossman, Cygnus Support. Converted to back-end form by Ian Lance Taylor, Cygnus SUpport @@ -23,8 +23,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. /* This file can only be compiled on systems which use HP/UX style core files. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #if defined (HOST_HPPAHPUX) || defined (HOST_HP300HPUX) || defined (HOST_HPPAMPEIX) @@ -124,11 +124,10 @@ make_bfd_asection (bfd *abfd, const char *name, flagword flags, strcpy (newname, name); - asect = bfd_make_section_anyway (abfd, newname); + asect = bfd_make_section_anyway_with_flags (abfd, newname, flags); if (!asect) return NULL; - asect->flags = flags; asect->size = size; asect->vma = vma; asect->filepos = bfd_tell (abfd); @@ -145,7 +144,7 @@ thread_section_p (bfd *abfd ATTRIBUTE_UNUSED, asection *sect, void *obj ATTRIBUTE_UNUSED) { - return (strncmp (sect->name, ".reg/", 5) == 0); + return CONST_STRNEQ (sect->name, ".reg/"); } /* this function builds a bfd target if the file is a corefile. diff --git a/bfd/i386aout.c b/bfd/i386aout.c index 128e9d20dc0..936ffb21de1 100644 --- a/bfd/i386aout.c +++ b/bfd/i386aout.c @@ -1,6 +1,6 @@ /* BFD back-end for i386 a.out binaries. - Copyright 1990, 1991, 1992, 1994, 1996, 1997, 2001, 2002, 2003, 2005 - Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1994, 1996, 1997, 2001, 2002, 2003, 2005, + 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -39,8 +39,8 @@ #define TARGETNAME "a.out-i386" #define NO_WRITE_HEADER_KLUDGE 1 -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "aout/aout64.h" #include "libaout.h" diff --git a/bfd/i386bsd.c b/bfd/i386bsd.c index 3f98ee4025c..f8b109edae7 100644 --- a/bfd/i386bsd.c +++ b/bfd/i386bsd.c @@ -1,5 +1,5 @@ /* BFD back-end for i386 a.out binaries under BSD. - Copyright 1990, 1991, 1992, 1993, 1994, 2001 + Copyright 1990, 1991, 1992, 1993, 1994, 2001, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -42,8 +42,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define MY(OP) CONCAT2 (i386bsd_,OP) #define TARGETNAME "a.out-i386-bsd" -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libaout.h" diff --git a/bfd/i386linux.c b/bfd/i386linux.c index 17c618006ff..83f9965a3c3 100644 --- a/bfd/i386linux.c +++ b/bfd/i386linux.c @@ -1,6 +1,6 @@ /* BFD back-end for linux flavored i386 a.out binaries. Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2001, 2002, 2003, - 2004, 2006 Free Software Foundation, Inc. + 2004, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -26,8 +26,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define MACHTYPE_OK(mtype) ((mtype) == M_386 || (mtype) == M_UNKNOWN) -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "aout/aout64.h" #include "aout/stab_gnu.h" @@ -93,8 +93,7 @@ i386linux_write_object_contents (abfd) #define GOT_REF_PREFIX "__GOT_" #endif -#define IS_GOT_SYM(name) \ - (strncmp (name, GOT_REF_PREFIX, sizeof GOT_REF_PREFIX - 1) == 0) +#define IS_GOT_SYM(name) (CONST_STRNEQ (name, GOT_REF_PREFIX)) /* See if a symbol name is a reference to the procedure linkage table. */ @@ -102,8 +101,7 @@ i386linux_write_object_contents (abfd) #define PLT_REF_PREFIX "__PLT_" #endif -#define IS_PLT_SYM(name) \ - (strncmp (name, PLT_REF_PREFIX, sizeof PLT_REF_PREFIX - 1) == 0) +#define IS_PLT_SYM(name) (CONST_STRNEQ (name, PLT_REF_PREFIX)) /* This string is used to generate specialized error messages. */ @@ -312,9 +310,8 @@ linux_link_create_dynamic_sections (abfd, info) /* We choose to use the name ".linux-dynamic" for the fixup table. Why not? */ - s = bfd_make_section (abfd, ".linux-dynamic"); + s = bfd_make_section_with_flags (abfd, ".linux-dynamic", flags); if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags) || ! bfd_set_section_alignment (abfd, s, 2)) return FALSE; s->size = 0; @@ -442,8 +439,7 @@ linux_tally_symbols (h, data) h = (struct linux_link_hash_entry *) h->root.root.u.i.link; if (h->root.root.type == bfd_link_hash_undefined - && strncmp (h->root.root.root.string, NEEDS_SHRLIB, - sizeof NEEDS_SHRLIB - 1) == 0) + && CONST_STRNEQ (h->root.root.root.string, NEEDS_SHRLIB)) { const char *name; char *p; diff --git a/bfd/i386lynx.c b/bfd/i386lynx.c index 856c0fd2069..a1a45169c2b 100644 --- a/bfd/i386lynx.c +++ b/bfd/i386lynx.c @@ -1,6 +1,6 @@ /* BFD back-end for i386 a.out binaries under LynxOS. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2001, 2002, - 2003 Free Software Foundation, Inc. + 2003, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -31,8 +31,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define MY(OP) CONCAT2 (i386lynx_aout_,OP) #define TARGETNAME "a.out-i386-lynx" -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #ifndef WRITE_HEADERS diff --git a/bfd/i386mach3.c b/bfd/i386mach3.c index 15137c7e9ed..9e1beb17591 100644 --- a/bfd/i386mach3.c +++ b/bfd/i386mach3.c @@ -1,5 +1,5 @@ /* BFD back-end for i386 a.out binaries. - Copyright 1990, 1991, 1993, 1994, 1995, 1997, 2001, 2002, 2003 + Copyright 1990, 1991, 1993, 1994, 1995, 1997, 2001, 2002, 2003, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -33,8 +33,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define N_TXTSIZE(x) ((x).a_text) -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "aout/aout64.h" #include "aout/stab_gnu.h" diff --git a/bfd/i386msdos.c b/bfd/i386msdos.c index bb25acd7324..ceb0244fade 100644 --- a/bfd/i386msdos.c +++ b/bfd/i386msdos.c @@ -1,6 +1,6 @@ /* BFD back-end for MS-DOS executables. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Bryan Ford of the University of Utah. Contributed by the Center for Software Science at the @@ -23,8 +23,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libaout.h" @@ -33,24 +33,15 @@ #define EXE_LOAD_LOW 0xffff #define EXE_PAGE_SIZE 512 -static int msdos_sizeof_headers - PARAMS ((bfd *, bfd_boolean)); -static bfd_boolean msdos_write_object_contents - PARAMS ((bfd *)); -static bfd_boolean msdos_set_section_contents - PARAMS ((bfd *, sec_ptr, const PTR, file_ptr, bfd_size_type)); - static int -msdos_sizeof_headers (abfd, exec) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_boolean exec ATTRIBUTE_UNUSED; +msdos_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return 0; } static bfd_boolean -msdos_write_object_contents (abfd) - bfd *abfd; +msdos_write_object_contents (bfd *abfd) { static char hdr[EXE_PAGE_SIZE]; file_ptr outfile_size = sizeof(hdr); @@ -112,12 +103,11 @@ msdos_write_object_contents (abfd) } static bfd_boolean -msdos_set_section_contents (abfd, section, location, offset, count) - bfd *abfd; - sec_ptr section; - const PTR location; - file_ptr offset; - bfd_size_type count; +msdos_set_section_contents (bfd *abfd, + sec_ptr section, + const void *location, + file_ptr offset, + bfd_size_type count) { if (count == 0) @@ -140,6 +130,7 @@ msdos_set_section_contents (abfd, section, location, offset, count) #define msdos_mkobject aout_32_mkobject #define msdos_make_empty_symbol aout_32_make_empty_symbol #define msdos_bfd_reloc_type_lookup aout_32_reloc_type_lookup +#define msdos_bfd_reloc_name_lookup aout_32_reloc_name_lookup #define msdos_close_and_cleanup _bfd_generic_close_and_cleanup #define msdos_bfd_free_cached_info _bfd_generic_bfd_free_cached_info diff --git a/bfd/i386os9k.c b/bfd/i386os9k.c index f825bc62073..f5b49cf28e2 100644 --- a/bfd/i386os9k.c +++ b/bfd/i386os9k.c @@ -1,6 +1,6 @@ /* BFD back-end for os9000 i386 binaries. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, 2002, - 2004, 2005 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -20,29 +20,19 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" #include "libaout.h" /* BFD a.out internal data structures */ #include "os9k.h" -static const bfd_target * os9k_callback - PARAMS ((bfd *)); -static const bfd_target * os9k_object_p - PARAMS ((bfd *)); -static int os9k_sizeof_headers - PARAMS ((bfd *, bfd_boolean)); -bfd_boolean os9k_swap_exec_header_in - PARAMS ((bfd *, mh_com *, struct internal_exec *)); - /* Swaps the information in an executable header taken from a raw byte stream memory image, into the internal exec_header structure. */ -bfd_boolean -os9k_swap_exec_header_in (abfd, raw_bytes, execp) - bfd *abfd; - mh_com *raw_bytes; - struct internal_exec *execp; +static bfd_boolean +os9k_swap_exec_header_in (bfd *abfd, + mh_com *raw_bytes, + struct internal_exec *execp) { mh_com *bytes = (mh_com *) raw_bytes; unsigned int dload, dmemsize, dmemstart; @@ -77,44 +67,12 @@ os9k_swap_exec_header_in (abfd, raw_bytes, execp) return TRUE; } -static const bfd_target * -os9k_object_p (abfd) - bfd *abfd; -{ - struct internal_exec anexec; - mh_com exec_bytes; - - if (bfd_bread ((PTR) &exec_bytes, (bfd_size_type) MHCOM_BYTES_SIZE, abfd) - != MHCOM_BYTES_SIZE) - { - if (bfd_get_error () != bfd_error_system_call) - bfd_set_error (bfd_error_wrong_format); - return 0; - } - - anexec.a_info = H_GET_16 (abfd, exec_bytes.m_sync); - if (N_BADMAG (anexec)) - { - bfd_set_error (bfd_error_wrong_format); - return 0; - } - - if (! os9k_swap_exec_header_in (abfd, &exec_bytes, &anexec)) - { - if (bfd_get_error () != bfd_error_system_call) - bfd_set_error (bfd_error_wrong_format); - return NULL; - } - return aout_32_some_aout_object_p (abfd, &anexec, os9k_callback); -} - /* Finish up the opening of a b.out file for reading. Fill in all the fields that are not handled by common code. */ static const bfd_target * -os9k_callback (abfd) - bfd *abfd; +os9k_callback (bfd *abfd) { struct internal_exec *execp = exec_hdr (abfd); unsigned long bss_start; @@ -156,10 +114,39 @@ os9k_callback (abfd) return abfd->xvec; } +static const bfd_target * +os9k_object_p (bfd *abfd) +{ + struct internal_exec anexec; + mh_com exec_bytes; + + if (bfd_bread ((PTR) &exec_bytes, (bfd_size_type) MHCOM_BYTES_SIZE, abfd) + != MHCOM_BYTES_SIZE) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return 0; + } + + anexec.a_info = H_GET_16 (abfd, exec_bytes.m_sync); + if (N_BADMAG (anexec)) + { + bfd_set_error (bfd_error_wrong_format); + return 0; + } + + if (! os9k_swap_exec_header_in (abfd, &exec_bytes, &anexec)) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + return aout_32_some_aout_object_p (abfd, &anexec, os9k_callback); +} + static int -os9k_sizeof_headers (ignore_abfd, ignore) - bfd *ignore_abfd ATTRIBUTE_UNUSED; - bfd_boolean ignore ATTRIBUTE_UNUSED; +os9k_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return sizeof (struct internal_exec); } @@ -171,6 +158,7 @@ os9k_sizeof_headers (ignore_abfd, ignore) #define aout_32_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define aout_32_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup +#define aout_32_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup #define aout_32_get_section_contents_in_window \ _bfd_generic_get_section_contents_in_window diff --git a/bfd/ieee.c b/bfd/ieee.c index be8455c617f..727869e669c 100644 --- a/bfd/ieee.c +++ b/bfd/ieee.c @@ -1,6 +1,6 @@ /* BFD back-end for ieee-695 objects. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support. @@ -27,8 +27,8 @@ token (which is one byte in this lexicon) lookahead recursive decent parser. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "ieee.h" #include "libieee.h" @@ -370,7 +370,7 @@ parse_int (common_header_type *ieee, bfd_vma *value_ptr) static int parse_i (common_header_type *ieee, bfd_boolean *ok) { - bfd_vma x; + bfd_vma x = 0; *ok = parse_int (ieee, &x); return x; } @@ -378,7 +378,7 @@ parse_i (common_header_type *ieee, bfd_boolean *ok) static bfd_vma must_parse_int (common_header_type *ieee) { - bfd_vma result; + bfd_vma result = 0; BFD_ASSERT (parse_int (ieee, &result)); return result; } @@ -767,7 +767,7 @@ ieee_slurp_external_symbols (bfd *abfd) unsigned int symbol_name_index; unsigned int symbol_type_index; unsigned int symbol_attribute_def; - bfd_vma value; + bfd_vma value = 0; switch (read_2bytes (&ieee->h)) { @@ -1080,7 +1080,6 @@ get_section_entry (bfd *abfd, ieee_data_type *ieee, unsigned int index) sprintf (tmp, " fsec%4d", index); section = bfd_make_section (abfd, tmp); ieee->section_table[index] = section; - section->flags = SEC_NO_FLAGS; section->target_index = index; ieee->section_table[index] = section; } @@ -1268,14 +1267,15 @@ ieee_slurp_debug (bfd *abfd) ieee_data_type *ieee = IEEE_DATA (abfd); asection *sec; file_ptr debug_end; + flagword flags; if (ieee->w.r.debug_information_part == 0) return TRUE; - sec = bfd_make_section (abfd, ".debug"); + flags = SEC_DEBUGGING | SEC_HAS_CONTENTS; + sec = bfd_make_section_with_flags (abfd, ".debug", flags); if (sec == NULL) return FALSE; - sec->flags |= SEC_DEBUGGING | SEC_HAS_CONTENTS; sec->filepos = ieee->w.r.debug_information_part; debug_end = ieee_part_after (ieee, ieee->w.r.debug_information_part); @@ -1875,8 +1875,8 @@ ieee_object_p (bfd *abfd) family[9] = '\0'; } } - else if ((strncmp (processor, "cpu32", 5) == 0) /* CPU32 and CPU32+ */ - || (strncmp (processor, "CPU32", 5) == 0)) + else if ((CONST_STRNEQ (processor, "cpu32")) /* CPU32 and CPU32+ */ + || (CONST_STRNEQ (processor, "CPU32"))) strcpy (family, "68332"); else { @@ -2014,12 +2014,15 @@ ieee_print_symbol (bfd *abfd, static bfd_boolean ieee_new_section_hook (bfd *abfd, asection *newsect) { - newsect->used_by_bfd = bfd_alloc (abfd, (bfd_size_type) sizeof (ieee_per_section_type)); if (!newsect->used_by_bfd) - return FALSE; + { + newsect->used_by_bfd = bfd_alloc (abfd, sizeof (ieee_per_section_type)); + if (!newsect->used_by_bfd) + return FALSE; + } ieee_per_section (newsect)->data = NULL; ieee_per_section (newsect)->section = newsect; - return TRUE; + return _bfd_generic_new_section_hook (abfd, newsect); } static long @@ -3712,7 +3715,7 @@ ieee_generic_stat_arch_elt (bfd *abfd, struct stat *buf) static int ieee_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, - bfd_boolean x ATTRIBUTE_UNUSED) + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return 0; } @@ -3744,6 +3747,7 @@ ieee_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, #define ieee_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol #define ieee_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup +#define ieee_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup #define ieee_set_arch_mach _bfd_generic_set_arch_mach diff --git a/bfd/ihex.c b/bfd/ihex.c index fb2ab96c99e..9f765b33f77 100644 --- a/bfd/ihex.c +++ b/bfd/ihex.c @@ -1,6 +1,6 @@ /* BFD back-end for Intel Hex objects. - Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor of Cygnus Support . This file is part of BFD, the Binary File Descriptor library. @@ -118,8 +118,8 @@ The MRI compiler uses this, which is a repeat of type 5: 18..19 Checksum in hex notation 20..21 Carriage return, line feed. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libiberty.h" #include "safe-ctype.h" @@ -355,6 +355,7 @@ ihex_scan (bfd *abfd) char secbuf[20]; char *secname; bfd_size_type amt; + flagword flags; sprintf (secbuf, ".sec%d", bfd_count_sections (abfd) + 1); amt = strlen (secbuf) + 1; @@ -362,10 +363,10 @@ ihex_scan (bfd *abfd) if (secname == NULL) goto error_return; strcpy (secname, secbuf); - sec = bfd_make_section (abfd, secname); + flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC; + sec = bfd_make_section_with_flags (abfd, secname, flags); if (sec == NULL) goto error_return; - sec->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC; sec->vma = extbase + segbase + addr; sec->lma = extbase + segbase + addr; sec->size = len; @@ -553,7 +554,6 @@ ihex_read_section (bfd *abfd, asection *section, bfd_byte *contents) { char hdr[8]; unsigned int len; - bfd_vma addr; unsigned int type; unsigned int i; @@ -568,7 +568,6 @@ ihex_read_section (bfd *abfd, asection *section, bfd_byte *contents) goto error_return; len = HEX2 (hdr); - addr = HEX4 (hdr + 2); type = HEX2 (hdr + 6); /* We should only see type 0 records here. */ @@ -900,7 +899,8 @@ ihex_set_arch_mach (bfd *abfd, /* Get the size of the headers, for the linker. */ static int -ihex_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, bfd_boolean exec ATTRIBUTE_UNUSED) +ihex_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return 0; } @@ -924,9 +924,6 @@ ihex_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, bfd_boolean exec ATTRIBUTE_UNUS #define ihex_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define ihex_read_minisymbols _bfd_nosymbols_read_minisymbols #define ihex_minisymbol_to_symbol _bfd_nosymbols_minisymbol_to_symbol -#define ihex_get_reloc_upper_bound ((long (*) (bfd *, asection *)) bfd_0l) -#define ihex_canonicalize_reloc ((long (*) (bfd *, asection *, arelent **, asymbol **)) bfd_0l) -#define ihex_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup #define ihex_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents #define ihex_bfd_relax_section bfd_generic_relax_section #define ihex_bfd_gc_sections bfd_generic_gc_sections @@ -985,7 +982,7 @@ const bfd_target ihex_vec = BFD_JUMP_TABLE_CORE (_bfd_nocore), BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), BFD_JUMP_TABLE_SYMBOLS (ihex), - BFD_JUMP_TABLE_RELOCS (ihex), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), BFD_JUMP_TABLE_WRITE (ihex), BFD_JUMP_TABLE_LINK (ihex), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), diff --git a/bfd/init.c b/bfd/init.c index a34acbf9faf..49f5533f2e2 100644 --- a/bfd/init.c +++ b/bfd/init.c @@ -1,5 +1,5 @@ /* bfd initialization stuff - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 2003 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 2003, 2007 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support. @@ -19,8 +19,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" /* diff --git a/bfd/irix-core.c b/bfd/irix-core.c index e6331454c44..5b982e276c7 100644 --- a/bfd/irix-core.c +++ b/bfd/irix-core.c @@ -1,5 +1,5 @@ /* BFD back-end for Irix core files. - Copyright 1993, 1994, 1996, 1999, 2001, 2002, 2004 + Copyright 1993, 1994, 1996, 1999, 2001, 2002, 2004, 2006, 2007 Free Software Foundation, Inc. Written by Stu Grossman, Cygnus Support. Converted to back-end form by Ian Lance Taylor, Cygnus Support @@ -23,8 +23,8 @@ /* This file can only be compiled on systems which use Irix style core files (namely, Irix 4 and Irix 5, so far). */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #ifdef IRIX_CORE @@ -152,11 +152,10 @@ make_bfd_asection (bfd *abfd, { asection *asect; - asect = bfd_make_section_anyway (abfd, name); + asect = bfd_make_section_anyway_with_flags (abfd, name, flags); if (!asect) return NULL; - asect->flags = flags; asect->size = size; asect->vma = vma; asect->filepos = filepos; diff --git a/bfd/libaout.h b/bfd/libaout.h index bb3ee808267..879de1380bd 100644 --- a/bfd/libaout.h +++ b/bfd/libaout.h @@ -1,6 +1,6 @@ /* BFD back-end data structures for a.out (and similar) files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -525,6 +525,9 @@ extern void NAME (aout, swap_std_reloc_in) extern reloc_howto_type * NAME (aout, reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); +extern reloc_howto_type * NAME (aout, reloc_name_lookup) + (bfd *, const char *); + extern bfd_boolean NAME (aout, slurp_reloc_table) (bfd *, sec_ptr, asymbol **); @@ -557,7 +560,7 @@ extern asymbol * NAME (aout, minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, asymbol *); extern int NAME (aout, sizeof_headers) - (bfd *, bfd_boolean); + (bfd *, struct bfd_link_info *); extern bfd_boolean NAME (aout, adjust_sizes_and_vmas) (bfd *, bfd_size_type *, file_ptr *); diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h index ee2484f25c1..3555e6a8eef 100644 --- a/bfd/libbfd-in.h +++ b/bfd/libbfd-in.h @@ -2,7 +2,7 @@ (This include file is not for users of the library.) Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -155,6 +155,8 @@ bfd * _bfd_new_bfd (void); void _bfd_delete_bfd (bfd *); +bfd_boolean _bfd_free_cached_info + (bfd *); bfd_boolean bfd_false (bfd *ignore); @@ -215,8 +217,8 @@ int bfd_generic_stat_arch_elt #define _bfd_generic_close_and_cleanup bfd_true #define _bfd_generic_bfd_free_cached_info bfd_true -#define _bfd_generic_new_section_hook \ - ((bfd_boolean (*) (bfd *, asection *)) bfd_true) +extern bfd_boolean _bfd_generic_new_section_hook + (bfd *, asection *); extern bfd_boolean _bfd_generic_get_section_contents (bfd *, asection *, void *, file_ptr, bfd_size_type); extern bfd_boolean _bfd_generic_get_section_contents_in_window @@ -346,12 +348,13 @@ extern bfd_boolean _bfd_archive_coff_construct_extended_name_table /* Routines to use for BFD_JUMP_TABLE_RELOCS when there is no reloc support. Use BFD_JUMP_TABLE_RELOCS (_bfd_norelocs). */ -#define _bfd_norelocs_get_reloc_upper_bound \ - ((long (*) (bfd *, asection *)) _bfd_n1) -#define _bfd_norelocs_canonicalize_reloc \ - ((long (*) (bfd *, asection *, arelent **, asymbol **)) _bfd_n1) +extern long _bfd_norelocs_get_reloc_upper_bound (bfd *, asection *); +extern long _bfd_norelocs_canonicalize_reloc (bfd *, asection *, + arelent **, asymbol **); #define _bfd_norelocs_bfd_reloc_type_lookup \ ((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr) +#define _bfd_norelocs_bfd_reloc_name_lookup \ + ((reloc_howto_type *(*) (bfd *, const char *)) bfd_nullvoidptr) /* Routines to use for BFD_JUMP_TABLE_WRITE for targets which may not be written. Use BFD_JUMP_TABLE_WRITE (_bfd_nowrite). */ @@ -373,7 +376,8 @@ extern bfd_boolean _bfd_generic_set_section_contents /* Routines to use for BFD_JUMP_TABLE_LINK for targets which do not support linking. Use BFD_JUMP_TABLE_LINK (_bfd_nolink). */ -#define _bfd_nolink_sizeof_headers ((int (*) (bfd *, bfd_boolean)) bfd_0) +#define _bfd_nolink_sizeof_headers \ + ((int (*) (bfd *, struct bfd_link_info *)) bfd_0) #define _bfd_nolink_bfd_get_relocated_section_contents \ ((bfd_byte *(*) (bfd *, struct bfd_link_info *, struct bfd_link_order *, \ bfd_byte *, bfd_boolean, asymbol **)) \ @@ -407,7 +411,7 @@ extern bfd_boolean _bfd_generic_set_section_contents #define _bfd_nolink_bfd_link_split_section \ ((bfd_boolean (*) (bfd *, struct bfd_section *)) bfd_false) #define _bfd_nolink_section_already_linked \ - ((void (*) (bfd *, struct bfd_section *)) bfd_void) + ((void (*) (bfd *, struct bfd_section *, struct bfd_link_info *)) bfd_void) /* Routines to use for BFD_JUMP_TABLE_DYNAMIC for targets which do not have dynamic symbols or relocs. Use BFD_JUMP_TABLE_DYNAMIC @@ -521,7 +525,7 @@ extern bfd_boolean _bfd_generic_link_split_section (bfd *, struct bfd_section *); extern void _bfd_generic_section_already_linked - (bfd *, struct bfd_section *); + (bfd *, struct bfd_section *, struct bfd_link_info *); /* Generic reloc_link_order processing routine. */ extern bfd_boolean _bfd_generic_reloc_link_order @@ -544,6 +548,10 @@ extern bfd_reloc_status_type _bfd_final_link_relocate extern bfd_reloc_status_type _bfd_relocate_contents (reloc_howto_type *, bfd *, bfd_vma, bfd_byte *); +/* Clear a given location using a given howto. */ +extern void _bfd_clear_contents (reloc_howto_type *howto, bfd *input_bfd, + bfd_byte *location); + /* Link stabs in sections in the first pass. */ extern bfd_boolean _bfd_link_section_stabs diff --git a/bfd/libbfd.c b/bfd/libbfd.c index 57cfabcd460..7dada1cbf53 100644 --- a/bfd/libbfd.c +++ b/bfd/libbfd.c @@ -1,6 +1,6 @@ /* Assorted BFD support routines, only used internally. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 + 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -20,8 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #ifndef HAVE_GETPAGESIZE @@ -103,6 +103,23 @@ bfd_void (bfd *ignore ATTRIBUTE_UNUSED) { } +long +_bfd_norelocs_get_reloc_upper_bound (bfd *abfd ATTRIBUTE_UNUSED, + asection *sec ATTRIBUTE_UNUSED) +{ + return sizeof (arelent *); +} + +long +_bfd_norelocs_canonicalize_reloc (bfd *abfd ATTRIBUTE_UNUSED, + asection *sec ATTRIBUTE_UNUSED, + arelent **relptr, + asymbol **symbols ATTRIBUTE_UNUSED) +{ + *relptr = NULL; + return 0; +} + bfd_boolean _bfd_nocore_core_file_matches_executable_p (bfd *ignore_core_bfd ATTRIBUTE_UNUSED, diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 2a590a395a5..4c1414f826f 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -7,7 +7,7 @@ (This include file is not for users of the library.) Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -160,6 +160,8 @@ bfd * _bfd_new_bfd (void); void _bfd_delete_bfd (bfd *); +bfd_boolean _bfd_free_cached_info + (bfd *); bfd_boolean bfd_false (bfd *ignore); @@ -220,8 +222,8 @@ int bfd_generic_stat_arch_elt #define _bfd_generic_close_and_cleanup bfd_true #define _bfd_generic_bfd_free_cached_info bfd_true -#define _bfd_generic_new_section_hook \ - ((bfd_boolean (*) (bfd *, asection *)) bfd_true) +extern bfd_boolean _bfd_generic_new_section_hook + (bfd *, asection *); extern bfd_boolean _bfd_generic_get_section_contents (bfd *, asection *, void *, file_ptr, bfd_size_type); extern bfd_boolean _bfd_generic_get_section_contents_in_window @@ -351,12 +353,13 @@ extern bfd_boolean _bfd_archive_coff_construct_extended_name_table /* Routines to use for BFD_JUMP_TABLE_RELOCS when there is no reloc support. Use BFD_JUMP_TABLE_RELOCS (_bfd_norelocs). */ -#define _bfd_norelocs_get_reloc_upper_bound \ - ((long (*) (bfd *, asection *)) _bfd_n1) -#define _bfd_norelocs_canonicalize_reloc \ - ((long (*) (bfd *, asection *, arelent **, asymbol **)) _bfd_n1) +extern long _bfd_norelocs_get_reloc_upper_bound (bfd *, asection *); +extern long _bfd_norelocs_canonicalize_reloc (bfd *, asection *, + arelent **, asymbol **); #define _bfd_norelocs_bfd_reloc_type_lookup \ ((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr) +#define _bfd_norelocs_bfd_reloc_name_lookup \ + ((reloc_howto_type *(*) (bfd *, const char *)) bfd_nullvoidptr) /* Routines to use for BFD_JUMP_TABLE_WRITE for targets which may not be written. Use BFD_JUMP_TABLE_WRITE (_bfd_nowrite). */ @@ -378,7 +381,8 @@ extern bfd_boolean _bfd_generic_set_section_contents /* Routines to use for BFD_JUMP_TABLE_LINK for targets which do not support linking. Use BFD_JUMP_TABLE_LINK (_bfd_nolink). */ -#define _bfd_nolink_sizeof_headers ((int (*) (bfd *, bfd_boolean)) bfd_0) +#define _bfd_nolink_sizeof_headers \ + ((int (*) (bfd *, struct bfd_link_info *)) bfd_0) #define _bfd_nolink_bfd_get_relocated_section_contents \ ((bfd_byte *(*) (bfd *, struct bfd_link_info *, struct bfd_link_order *, \ bfd_byte *, bfd_boolean, asymbol **)) \ @@ -412,7 +416,7 @@ extern bfd_boolean _bfd_generic_set_section_contents #define _bfd_nolink_bfd_link_split_section \ ((bfd_boolean (*) (bfd *, struct bfd_section *)) bfd_false) #define _bfd_nolink_section_already_linked \ - ((void (*) (bfd *, struct bfd_section *)) bfd_void) + ((void (*) (bfd *, struct bfd_section *, struct bfd_link_info *)) bfd_void) /* Routines to use for BFD_JUMP_TABLE_DYNAMIC for targets which do not have dynamic symbols or relocs. Use BFD_JUMP_TABLE_DYNAMIC @@ -526,7 +530,7 @@ extern bfd_boolean _bfd_generic_link_split_section (bfd *, struct bfd_section *); extern void _bfd_generic_section_already_linked - (bfd *, struct bfd_section *); + (bfd *, struct bfd_section *, struct bfd_link_info *); /* Generic reloc_link_order processing routine. */ extern bfd_boolean _bfd_generic_reloc_link_order @@ -549,6 +553,10 @@ extern bfd_reloc_status_type _bfd_final_link_relocate extern bfd_reloc_status_type _bfd_relocate_contents (reloc_howto_type *, bfd *, bfd_vma, bfd_byte *); +/* Clear a given location using a given howto. */ +extern void _bfd_clear_contents (reloc_howto_type *howto, bfd *input_bfd, + bfd_byte *location); + /* Link stabs in sections in the first pass. */ extern bfd_boolean _bfd_link_section_stabs @@ -899,6 +907,20 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_SPARC_TLS_DTPOFF64", "BFD_RELOC_SPARC_TLS_TPOFF32", "BFD_RELOC_SPARC_TLS_TPOFF64", + "BFD_RELOC_SPU_IMM7", + "BFD_RELOC_SPU_IMM8", + "BFD_RELOC_SPU_IMM10", + "BFD_RELOC_SPU_IMM10W", + "BFD_RELOC_SPU_IMM16", + "BFD_RELOC_SPU_IMM16W", + "BFD_RELOC_SPU_IMM18", + "BFD_RELOC_SPU_PCREL9a", + "BFD_RELOC_SPU_PCREL9b", + "BFD_RELOC_SPU_PCREL16", + "BFD_RELOC_SPU_LO16", + "BFD_RELOC_SPU_HI16", + "BFD_RELOC_SPU_PPU32", + "BFD_RELOC_SPU_PPU64", "BFD_RELOC_ALPHA_GPDISP_HI16", "BFD_RELOC_ALPHA_GPDISP_LO16", "BFD_RELOC_ALPHA_GPDISP", @@ -1206,6 +1228,14 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_ARM_SBREL32", "BFD_RELOC_ARM_TARGET2", "BFD_RELOC_ARM_PREL31", + "BFD_RELOC_ARM_MOVW", + "BFD_RELOC_ARM_MOVT", + "BFD_RELOC_ARM_MOVW_PCREL", + "BFD_RELOC_ARM_MOVT_PCREL", + "BFD_RELOC_ARM_THUMB_MOVW", + "BFD_RELOC_ARM_THUMB_MOVT", + "BFD_RELOC_ARM_THUMB_MOVW_PCREL", + "BFD_RELOC_ARM_THUMB_MOVT_PCREL", "BFD_RELOC_ARM_JUMP_SLOT", "BFD_RELOC_ARM_GLOB_DAT", "BFD_RELOC_ARM_GOT32", @@ -1221,9 +1251,38 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_ARM_TLS_TPOFF32", "BFD_RELOC_ARM_TLS_IE32", "BFD_RELOC_ARM_TLS_LE32", + "BFD_RELOC_ARM_ALU_PC_G0_NC", + "BFD_RELOC_ARM_ALU_PC_G0", + "BFD_RELOC_ARM_ALU_PC_G1_NC", + "BFD_RELOC_ARM_ALU_PC_G1", + "BFD_RELOC_ARM_ALU_PC_G2", + "BFD_RELOC_ARM_LDR_PC_G0", + "BFD_RELOC_ARM_LDR_PC_G1", + "BFD_RELOC_ARM_LDR_PC_G2", + "BFD_RELOC_ARM_LDRS_PC_G0", + "BFD_RELOC_ARM_LDRS_PC_G1", + "BFD_RELOC_ARM_LDRS_PC_G2", + "BFD_RELOC_ARM_LDC_PC_G0", + "BFD_RELOC_ARM_LDC_PC_G1", + "BFD_RELOC_ARM_LDC_PC_G2", + "BFD_RELOC_ARM_ALU_SB_G0_NC", + "BFD_RELOC_ARM_ALU_SB_G0", + "BFD_RELOC_ARM_ALU_SB_G1_NC", + "BFD_RELOC_ARM_ALU_SB_G1", + "BFD_RELOC_ARM_ALU_SB_G2", + "BFD_RELOC_ARM_LDR_SB_G0", + "BFD_RELOC_ARM_LDR_SB_G1", + "BFD_RELOC_ARM_LDR_SB_G2", + "BFD_RELOC_ARM_LDRS_SB_G0", + "BFD_RELOC_ARM_LDRS_SB_G1", + "BFD_RELOC_ARM_LDRS_SB_G2", + "BFD_RELOC_ARM_LDC_SB_G0", + "BFD_RELOC_ARM_LDC_SB_G1", + "BFD_RELOC_ARM_LDC_SB_G2", "BFD_RELOC_ARM_IMMEDIATE", "BFD_RELOC_ARM_ADRL_IMMEDIATE", "BFD_RELOC_ARM_T32_IMMEDIATE", + "BFD_RELOC_ARM_T32_ADD_IMM", "BFD_RELOC_ARM_T32_IMM12", "BFD_RELOC_ARM_T32_ADD_PC12", "BFD_RELOC_ARM_SHIFT_IMM", @@ -1473,6 +1532,27 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_MCORE_PCREL_32", "BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2", "BFD_RELOC_MCORE_RVA", + "BFD_RELOC_MEP_8", + "BFD_RELOC_MEP_16", + "BFD_RELOC_MEP_32", + "BFD_RELOC_MEP_PCREL8A2", + "BFD_RELOC_MEP_PCREL12A2", + "BFD_RELOC_MEP_PCREL17A2", + "BFD_RELOC_MEP_PCREL24A2", + "BFD_RELOC_MEP_PCABS24A2", + "BFD_RELOC_MEP_LOW16", + "BFD_RELOC_MEP_HI16U", + "BFD_RELOC_MEP_HI16S", + "BFD_RELOC_MEP_GPREL", + "BFD_RELOC_MEP_TPREL", + "BFD_RELOC_MEP_TPREL7", + "BFD_RELOC_MEP_TPREL7A2", + "BFD_RELOC_MEP_TPREL7A4", + "BFD_RELOC_MEP_UIMM24", + "BFD_RELOC_MEP_ADDR24A4", + "BFD_RELOC_MEP_GNU_VTINHERIT", + "BFD_RELOC_MEP_GNU_VTENTRY", + "BFD_RELOC_MMIX_GETA", "BFD_RELOC_MMIX_GETA_1", "BFD_RELOC_MMIX_GETA_2", @@ -1509,7 +1589,9 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_AVR_HH8_LDI_NEG", "BFD_RELOC_AVR_MS8_LDI_NEG", "BFD_RELOC_AVR_LO8_LDI_PM", + "BFD_RELOC_AVR_LO8_LDI_GS", "BFD_RELOC_AVR_HI8_LDI_PM", + "BFD_RELOC_AVR_HI8_LDI_GS", "BFD_RELOC_AVR_HH8_LDI_PM", "BFD_RELOC_AVR_LO8_LDI_PM_NEG", "BFD_RELOC_AVR_HI8_LDI_PM_NEG", @@ -1568,6 +1650,17 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_390_GOT20", "BFD_RELOC_390_GOTPLT20", "BFD_RELOC_390_TLS_GOTIE20", + "BFD_RELOC_SCORE_DUMMY1", + "BFD_RELOC_SCORE_GPREL15", + "BFD_RELOC_SCORE_DUMMY2", + "BFD_RELOC_SCORE_JMP", + "BFD_RELOC_SCORE_BRANCH", + "BFD_RELOC_SCORE16_JMP", + "BFD_RELOC_SCORE16_BRANCH", + "BFD_RELOC_SCORE_GOT15", + "BFD_RELOC_SCORE_GOT_LO16", + "BFD_RELOC_SCORE_CALL15", + "BFD_RELOC_SCORE_DUMMY_HI16", "BFD_RELOC_IP2K_FR9", "BFD_RELOC_IP2K_BANK", "BFD_RELOC_IP2K_ADDR16CJP", @@ -1712,6 +1805,33 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_16C_IMM24_C", "BFD_RELOC_16C_IMM32", "BFD_RELOC_16C_IMM32_C", + "BFD_RELOC_CR16_NUM8", + "BFD_RELOC_CR16_NUM16", + "BFD_RELOC_CR16_NUM32", + "BFD_RELOC_CR16_NUM32a", + "BFD_RELOC_CR16_REGREL0", + "BFD_RELOC_CR16_REGREL4", + "BFD_RELOC_CR16_REGREL4a", + "BFD_RELOC_CR16_REGREL14", + "BFD_RELOC_CR16_REGREL14a", + "BFD_RELOC_CR16_REGREL16", + "BFD_RELOC_CR16_REGREL20", + "BFD_RELOC_CR16_REGREL20a", + "BFD_RELOC_CR16_ABS20", + "BFD_RELOC_CR16_ABS24", + "BFD_RELOC_CR16_IMM4", + "BFD_RELOC_CR16_IMM8", + "BFD_RELOC_CR16_IMM16", + "BFD_RELOC_CR16_IMM20", + "BFD_RELOC_CR16_IMM24", + "BFD_RELOC_CR16_IMM32", + "BFD_RELOC_CR16_IMM32a", + "BFD_RELOC_CR16_DISP4", + "BFD_RELOC_CR16_DISP8", + "BFD_RELOC_CR16_DISP16", + "BFD_RELOC_CR16_DISP20", + "BFD_RELOC_CR16_DISP24", + "BFD_RELOC_CR16_DISP24a", "BFD_RELOC_CRX_REL4", "BFD_RELOC_CRX_REL8", "BFD_RELOC_CRX_REL8_CMP", @@ -1796,6 +1916,8 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_XSTORMY16_12", "BFD_RELOC_XSTORMY16_24", "BFD_RELOC_XSTORMY16_FPTR16", + "BFD_RELOC_RELC", + "BFD_RELOC_XC16X_PAG", "BFD_RELOC_XC16X_POF", "BFD_RELOC_XC16X_SEG", diff --git a/bfd/libcoff-in.h b/bfd/libcoff-in.h index f2bc264b3b9..fdb1a59b814 100644 --- a/bfd/libcoff-in.h +++ b/bfd/libcoff-in.h @@ -348,7 +348,7 @@ extern bfd_boolean coff_find_nearest_line extern bfd_boolean coff_find_inliner_info (bfd *, const char **, const char **, unsigned int *); extern int coff_sizeof_headers - (bfd *, bfd_boolean); + (bfd *, struct bfd_link_info *); extern bfd_boolean bfd_coff_reloc16_relax_section (bfd *, asection *, struct bfd_link_info *, bfd_boolean *); extern bfd_byte *bfd_coff_reloc16_get_relocated_section_contents diff --git a/bfd/libcoff.h b/bfd/libcoff.h index f756f30b1bf..e26fce06415 100644 --- a/bfd/libcoff.h +++ b/bfd/libcoff.h @@ -352,7 +352,7 @@ extern bfd_boolean coff_find_nearest_line extern bfd_boolean coff_find_inliner_info (bfd *, const char **, const char **, unsigned int *); extern int coff_sizeof_headers - (bfd *, bfd_boolean); + (bfd *, struct bfd_link_info *); extern bfd_boolean bfd_coff_reloc16_relax_section (bfd *, asection *, struct bfd_link_info *, bfd_boolean *); extern bfd_byte *bfd_coff_reloc16_get_relocated_section_contents diff --git a/bfd/libecoff.h b/bfd/libecoff.h index 8c5e218ee58..165e75585a3 100644 --- a/bfd/libecoff.h +++ b/bfd/libecoff.h @@ -1,6 +1,6 @@ /* BFD ECOFF object file private structure. Copyright 1993, 1994, 1995, 1996, 1999, 2001, 2002, 2003, 2004, - 2005 Free Software Foundation, Inc. + 2005, 2006 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -301,7 +301,7 @@ extern bfd_boolean _bfd_ecoff_set_arch_mach extern bfd_boolean _bfd_ecoff_set_section_contents (bfd *, asection *, const void * location, file_ptr, bfd_size_type); -extern int _bfd_ecoff_sizeof_headers (bfd *, bfd_boolean); +extern int _bfd_ecoff_sizeof_headers (bfd *, struct bfd_link_info *); /* ecoff_bfd_get_relocated_section_contents defined by backend. */ /* ecoff_bfd_relax_section defined by backend. */ extern struct bfd_link_hash_table *_bfd_ecoff_bfd_link_hash_table_create diff --git a/bfd/libpei.h b/bfd/libpei.h index f0f6580fe4b..0e08e039bc0 100644 --- a/bfd/libpei.h +++ b/bfd/libpei.h @@ -1,5 +1,5 @@ /* Support for the generic parts of PE/PEI; common header information. - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. Written by Cygnus Solutions. @@ -204,7 +204,38 @@ #define PUT_SCNHDR_LNNOPTR H_PUT_32 #endif -#ifdef COFF_WITH_pep +#ifdef COFF_WITH_pex64 + +#define GET_OPTHDR_IMAGE_BASE H_GET_64 +#define PUT_OPTHDR_IMAGE_BASE H_PUT_64 +#define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_64 +#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_64 +#define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_64 +#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_64 +#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_64 +#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_64 +#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_64 +#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_64 +#define GET_PDATA_ENTRY bfd_get_32 + +#define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pex64_bfd_copy_private_bfd_data_common +#define _bfd_XX_bfd_copy_private_section_data _bfd_pex64_bfd_copy_private_section_data +#define _bfd_XX_get_symbol_info _bfd_pex64_get_symbol_info +#define _bfd_XX_only_swap_filehdr_out _bfd_pex64_only_swap_filehdr_out +#define _bfd_XX_print_private_bfd_data_common _bfd_pex64_print_private_bfd_data_common +#define _bfd_XXi_final_link_postscript _bfd_pex64i_final_link_postscript +#define _bfd_XXi_only_swap_filehdr_out _bfd_pex64i_only_swap_filehdr_out +#define _bfd_XXi_swap_aouthdr_in _bfd_pex64i_swap_aouthdr_in +#define _bfd_XXi_swap_aouthdr_out _bfd_pex64i_swap_aouthdr_out +#define _bfd_XXi_swap_aux_in _bfd_pex64i_swap_aux_in +#define _bfd_XXi_swap_aux_out _bfd_pex64i_swap_aux_out +#define _bfd_XXi_swap_lineno_in _bfd_pex64i_swap_lineno_in +#define _bfd_XXi_swap_lineno_out _bfd_pex64i_swap_lineno_out +#define _bfd_XXi_swap_scnhdr_out _bfd_pex64i_swap_scnhdr_out +#define _bfd_XXi_swap_sym_in _bfd_pex64i_swap_sym_in +#define _bfd_XXi_swap_sym_out _bfd_pex64i_swap_sym_out + +#elif defined COFF_WITH_pep #define GET_OPTHDR_IMAGE_BASE H_GET_64 #define PUT_OPTHDR_IMAGE_BASE H_PUT_64 @@ -224,7 +255,6 @@ #define _bfd_XX_only_swap_filehdr_out _bfd_pep_only_swap_filehdr_out #define _bfd_XX_print_private_bfd_data_common _bfd_pep_print_private_bfd_data_common #define _bfd_XXi_final_link_postscript _bfd_pepi_final_link_postscript -#define _bfd_XXi_final_link_postscript _bfd_pepi_final_link_postscript #define _bfd_XXi_only_swap_filehdr_out _bfd_pepi_only_swap_filehdr_out #define _bfd_XXi_swap_aouthdr_in _bfd_pepi_swap_aouthdr_in #define _bfd_XXi_swap_aouthdr_out _bfd_pepi_swap_aouthdr_out @@ -256,7 +286,6 @@ #define _bfd_XX_only_swap_filehdr_out _bfd_pe_only_swap_filehdr_out #define _bfd_XX_print_private_bfd_data_common _bfd_pe_print_private_bfd_data_common #define _bfd_XXi_final_link_postscript _bfd_pei_final_link_postscript -#define _bfd_XXi_final_link_postscript _bfd_pei_final_link_postscript #define _bfd_XXi_only_swap_filehdr_out _bfd_pei_only_swap_filehdr_out #define _bfd_XXi_swap_aouthdr_in _bfd_pei_swap_aouthdr_in #define _bfd_XXi_swap_aouthdr_out _bfd_pei_swap_aouthdr_out @@ -270,10 +299,27 @@ #endif /* !COFF_WITH_pep */ -/* Macro: Returns true if the bfd is a PE executable as opposed to a PE object file. */ -#define bfd_pe_executable_p(abfd) \ - (strncmp ((abfd)->xvec->name, "pei-", 4) == 0 \ - || strncmp ((abfd)->xvec->name, "efi-app-", 8) == 0) +/* Returns true if the target is a PE executable target. */ +#define bfd_target_pei_p(xvec) \ + (CONST_STRNEQ ((xvec)->name, "pei-")) + +/* Return the arch string of a PE executable target. */ +#define bfd_target_pei_arch(xvec) \ + ((xvec)->name + sizeof ("pei-") - 1) + +/* Returns true if the target is an EFI target. */ +#define bfd_target_efi_p(xvec) \ + (CONST_STRNEQ ((xvec)->name, "efi-app-")) + +/* Return the arch string of an EFI target. */ +#define bfd_target_efi_arch(xvec) \ + ((xvec)->name + sizeof ("efi-app-") - 1) + +/* Macro: Returns true if the bfd is a PE executable as opposed to a + PE object file. */ +#define bfd_pe_executable_p(abfd) \ + (bfd_target_pei_p ((abfd)->xvec) \ + || bfd_target_efi_p ((abfd)->xvec)) /* These functions are architecture dependent, and are in peicode.h: coff_swap_reloc_in diff --git a/bfd/linker.c b/bfd/linker.c index 14eeae4df0c..497b5c23556 100644 --- a/bfd/linker.c +++ b/bfd/linker.c @@ -1,6 +1,7 @@ /* linker.c -- BFD linker routines Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" #include "genlink.h" @@ -562,11 +563,11 @@ bfd_wrapped_link_hash_lookup (bfd *abfd, #undef WRAP -#undef REAL +#undef REAL #define REAL "__real_" if (*l == '_' - && strncmp (l, REAL, sizeof REAL - 1) == 0 + && CONST_STRNEQ (l, REAL) && bfd_hash_lookup (info->wrap_hash, l + sizeof REAL - 1, FALSE, FALSE) != NULL) { @@ -1659,8 +1660,7 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info, s = name + 1; while (*s == '_') ++s; - if (s[0] == 'G' - && strncmp (s, CONS_PREFIX, CONS_PREFIX_LEN - 1) == 0) + if (s[0] == 'G' && CONST_STRNEQ (s, CONS_PREFIX)) { char c; @@ -2877,14 +2877,15 @@ FUNCTION bfd_section_already_linked SYNOPSIS - void bfd_section_already_linked (bfd *abfd, asection *sec); + void bfd_section_already_linked (bfd *abfd, asection *sec, + struct bfd_link_info *info); DESCRIPTION Check if @var{sec} has been already linked during a reloceatable or final link. -.#define bfd_section_already_linked(abfd, sec) \ -. BFD_SEND (abfd, _section_already_linked, (abfd, sec)) +.#define bfd_section_already_linked(abfd, sec, info) \ +. BFD_SEND (abfd, _section_already_linked, (abfd, sec, info)) . */ @@ -2970,7 +2971,8 @@ bfd_section_already_linked_table_free (void) /* This is used on non-ELF inputs. */ void -_bfd_generic_section_already_linked (bfd *abfd, asection *sec) +_bfd_generic_section_already_linked (bfd *abfd, asection *sec, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { flagword flags; const char *name; @@ -3074,7 +3076,7 @@ _bfd_generic_section_already_linked (bfd *abfd, asection *sec) bfd_section_already_linked_table_insert (already_linked_list, sec); } -/* Convert symbols in excluded output sections to absolute. */ +/* Convert symbols in excluded output sections to use a kept section. */ static bfd_boolean fix_syms (struct bfd_link_hash_entry *h, void *data) @@ -3093,8 +3095,64 @@ fix_syms (struct bfd_link_hash_entry *h, void *data) && (s->output_section->flags & SEC_EXCLUDE) != 0 && bfd_section_removed_from_list (obfd, s->output_section)) { + asection *op, *op1; + h->u.def.value += s->output_offset + s->output_section->vma; - h->u.def.section = bfd_abs_section_ptr; + + /* Find preceding kept section. */ + for (op1 = s->output_section->prev; op1 != NULL; op1 = op1->prev) + if ((op1->flags & SEC_EXCLUDE) == 0 + && !bfd_section_removed_from_list (obfd, op1)) + break; + + /* Find following kept section. Start at prev->next because + other sections may have been added after S was removed. */ + if (s->output_section->prev != NULL) + op = s->output_section->prev->next; + else + op = s->output_section->owner->sections; + for (; op != NULL; op = op->next) + if ((op->flags & SEC_EXCLUDE) == 0 + && !bfd_section_removed_from_list (obfd, op)) + break; + + /* Choose better of two sections, based on flags. The idea + is to choose a section that will be in the same segment + as S would have been if it was kept. */ + if (op1 == NULL) + { + if (op == NULL) + op = bfd_abs_section_ptr; + } + else if (op == NULL) + op = op1; + else if (((op1->flags ^ op->flags) + & (SEC_ALLOC | SEC_THREAD_LOCAL)) != 0) + { + if (((op->flags ^ s->flags) + & (SEC_ALLOC | SEC_THREAD_LOCAL)) != 0) + op = op1; + } + else if (((op1->flags ^ op->flags) & SEC_READONLY) != 0) + { + if (((op->flags ^ s->flags) & SEC_READONLY) != 0) + op = op1; + } + else if (((op1->flags ^ op->flags) & SEC_CODE) != 0) + { + if (((op->flags ^ s->flags) & SEC_CODE) != 0) + op = op1; + } + else + { + /* Flags we care about are the same. Prefer the following + section if that will result in a positive valued sym. */ + if (h->u.def.value < op->vma) + op = op1; + } + + h->u.def.value -= op->vma; + h->u.def.section = op; } } diff --git a/bfd/lynx-core.c b/bfd/lynx-core.c index ef243fbef19..55f0a0c9804 100644 --- a/bfd/lynx-core.c +++ b/bfd/lynx-core.c @@ -1,5 +1,5 @@ /* BFD back end for Lynx core files - Copyright 1993, 1994, 1995, 2001, 2002, 2004 + Copyright 1993, 1994, 1995, 2001, 2002, 2004, 2006, 2007 Free Software Foundation, Inc. Written by Stu Grossman of Cygnus Support. @@ -19,8 +19,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #ifdef LYNX_CORE @@ -73,11 +73,10 @@ make_bfd_asection (abfd, name, flags, size, vma, filepos) strcpy (newname, name); - asect = bfd_make_section (abfd, newname); + asect = bfd_make_section_with_flags (abfd, newname, flags); if (!asect) return NULL; - asect->flags = flags; asect->size = size; asect->vma = vma; asect->filepos = filepos; diff --git a/bfd/m68klinux.c b/bfd/m68klinux.c index 2c12a7c776e..31694771760 100644 --- a/bfd/m68klinux.c +++ b/bfd/m68klinux.c @@ -1,6 +1,6 @@ /* BFD back-end for linux flavored m68k a.out binaries. Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, - 2003, 2004, 2006 Free Software Foundation, Inc. + 2003, 2004, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -26,8 +26,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define MACHTYPE_OK(mtype) ((mtype) == M_68020 || (mtype) == M_UNKNOWN) -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "aout/aout64.h" #include "aout/stab_gnu.h" @@ -94,8 +94,7 @@ m68klinux_write_object_contents (abfd) #define GOT_REF_PREFIX "__GOT_" #endif -#define IS_GOT_SYM(name) \ - (strncmp (name, GOT_REF_PREFIX, sizeof GOT_REF_PREFIX - 1) == 0) +#define IS_GOT_SYM(name) (CONST_STRNEQ (name, GOT_REF_PREFIX)) /* See if a symbol name is a reference to the procedure linkage table. */ @@ -103,8 +102,7 @@ m68klinux_write_object_contents (abfd) #define PLT_REF_PREFIX "__PLT_" #endif -#define IS_PLT_SYM(name) \ - (strncmp (name, PLT_REF_PREFIX, sizeof PLT_REF_PREFIX - 1) == 0) +#define IS_PLT_SYM(name) (CONST_STRNEQ (name, PLT_REF_PREFIX)) /* This string is used to generate specialized error messages. */ @@ -316,9 +314,8 @@ linux_link_create_dynamic_sections (abfd, info) /* We choose to use the name ".linux-dynamic" for the fixup table. Why not? */ - s = bfd_make_section (abfd, ".linux-dynamic"); + s = bfd_make_section_with_flags (abfd, ".linux-dynamic", flags); if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags) || ! bfd_set_section_alignment (abfd, s, 2)) return FALSE; s->size = 0; @@ -446,8 +443,7 @@ linux_tally_symbols (h, data) h = (struct linux_link_hash_entry *) h->root.root.u.i.link; if (h->root.root.type == bfd_link_hash_undefined - && strncmp (h->root.root.root.string, NEEDS_SHRLIB, - sizeof NEEDS_SHRLIB - 1) == 0) + && CONST_STRNEQ (h->root.root.root.string, NEEDS_SHRLIB)) { const char *name; char *p; diff --git a/bfd/m88kmach3.c b/bfd/m88kmach3.c index ec2ae75554c..a94425c7fd1 100644 --- a/bfd/m88kmach3.c +++ b/bfd/m88kmach3.c @@ -1,5 +1,5 @@ /* BFD back-end for Motorola m88k a.out (Mach 3) binaries. - Copyright 1990, 1991, 1993, 1994, 1995, 2001, 2003 + Copyright 1990, 1991, 1993, 1994, 1995, 2001, 2003, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -26,8 +26,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define N_TXTSIZE(x) ((x).a_text) -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libaout.h" diff --git a/bfd/mach-o-target.c b/bfd/mach-o-target.c index 103142a08dd..76bed2e002d 100644 --- a/bfd/mach-o-target.c +++ b/bfd/mach-o-target.c @@ -1,5 +1,5 @@ /* Mach-O support for BFD. - Copyright 1999, 2000, 2001, 2002 + Copyright 1999, 2000, 2001, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -105,7 +105,7 @@ const bfd_target TARGET_NAME = BFD_JUMP_TABLE_CORE (bfd_mach_o), BFD_JUMP_TABLE_ARCHIVE (bfd_mach_o), BFD_JUMP_TABLE_SYMBOLS (bfd_mach_o), - BFD_JUMP_TABLE_RELOCS (bfd_mach_o), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), BFD_JUMP_TABLE_WRITE (bfd_mach_o), BFD_JUMP_TABLE_LINK (bfd_mach_o), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), diff --git a/bfd/mach-o.c b/bfd/mach-o.c index 03a714495bb..d4abbeccd2d 100644 --- a/bfd/mach-o.c +++ b/bfd/mach-o.c @@ -1,5 +1,5 @@ /* Mach-O support for BFD. - Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,9 +18,9 @@ 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 "mach-o.h" #include "bfd.h" -#include "sysdep.h" #include "libbfd.h" #include "libiberty.h" #include @@ -52,9 +52,6 @@ #define bfd_mach_o_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define bfd_mach_o_read_minisymbols _bfd_generic_read_minisymbols #define bfd_mach_o_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol -#define bfd_mach_o_get_reloc_upper_bound _bfd_norelocs_get_reloc_upper_bound -#define bfd_mach_o_canonicalize_reloc _bfd_norelocs_canonicalize_reloc -#define bfd_mach_o_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup #define bfd_mach_o_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents #define bfd_mach_o_bfd_relax_section bfd_generic_relax_section #define bfd_mach_o_bfd_link_hash_table_create _bfd_generic_link_hash_table_create @@ -568,7 +565,7 @@ bfd_mach_o_write_contents (bfd *abfd) static int bfd_mach_o_sizeof_headers (bfd *a ATTRIBUTE_UNUSED, - bfd_boolean b ATTRIBUTE_UNUSED) + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return 0; } @@ -634,6 +631,7 @@ bfd_mach_o_make_bfd_section (bfd *abfd, bfd_mach_o_section *section) char *sname; const char *prefix = "LC_SEGMENT"; unsigned int snamelen; + flagword flags; snamelen = strlen (prefix) + 1 + strlen (section->segname) + 1 @@ -644,7 +642,10 @@ bfd_mach_o_make_bfd_section (bfd *abfd, bfd_mach_o_section *section) return NULL; sprintf (sname, "%s.%s.%s", prefix, section->segname, section->sectname); - bfdsec = bfd_make_section_anyway (abfd, sname); + flags = SEC_ALLOC; + if (!(section->flags & BFD_MACH_O_S_ZEROFILL)) + flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC | SEC_CODE; + bfdsec = bfd_make_section_anyway_with_flags (abfd, sname, flags); if (bfdsec == NULL) return NULL; @@ -654,11 +655,6 @@ bfd_mach_o_make_bfd_section (bfd *abfd, bfd_mach_o_section *section) bfdsec->filepos = section->offset; bfdsec->alignment_power = section->align; - if (section->flags & BFD_MACH_O_S_ZEROFILL) - bfdsec->flags = SEC_ALLOC; - else - bfdsec->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC | SEC_CODE; - return bfdsec; } @@ -966,7 +962,7 @@ bfd_mach_o_scan_read_dylinker (bfd *abfd, return -1; strcpy (sname, prefix); - bfdsec = bfd_make_section_anyway (abfd, sname); + bfdsec = bfd_make_section_anyway_with_flags (abfd, sname, SEC_HAS_CONTENTS); if (bfdsec == NULL) return -1; @@ -975,7 +971,6 @@ bfd_mach_o_scan_read_dylinker (bfd *abfd, bfdsec->size = command->len - 8; bfdsec->filepos = command->offset + 8; bfdsec->alignment_power = 0; - bfdsec->flags = SEC_HAS_CONTENTS; cmd->section = bfdsec; @@ -1022,7 +1017,7 @@ bfd_mach_o_scan_read_dylib (bfd *abfd, bfd_mach_o_load_command *command) return -1; strcpy (sname, prefix); - bfdsec = bfd_make_section_anyway (abfd, sname); + bfdsec = bfd_make_section_anyway_with_flags (abfd, sname, SEC_HAS_CONTENTS); if (bfdsec == NULL) return -1; @@ -1031,7 +1026,6 @@ bfd_mach_o_scan_read_dylib (bfd *abfd, bfd_mach_o_load_command *command) bfdsec->size = command->len - 8; bfdsec->filepos = command->offset + 8; bfdsec->alignment_power = 0; - bfdsec->flags = SEC_HAS_CONTENTS; cmd->section = bfdsec; @@ -1142,14 +1136,13 @@ bfd_mach_o_scan_read_thread (bfd *abfd, bfd_mach_o_load_command *command) j++; } - bfdsec = bfd_make_section (abfd, sname); + bfdsec = bfd_make_section_with_flags (abfd, sname, SEC_HAS_CONTENTS); bfdsec->vma = 0; bfdsec->lma = 0; bfdsec->size = cmd->flavours[i].size; bfdsec->filepos = cmd->flavours[i].offset; bfdsec->alignment_power = 0x0; - bfdsec->flags = SEC_HAS_CONTENTS; cmd->section = bfdsec; } @@ -1218,7 +1211,7 @@ bfd_mach_o_scan_read_symtab (bfd *abfd, bfd_mach_o_load_command *command) return -1; strcpy (sname, prefix); - bfdsec = bfd_make_section_anyway (abfd, sname); + bfdsec = bfd_make_section_anyway_with_flags (abfd, sname, SEC_HAS_CONTENTS); if (bfdsec == NULL) return -1; @@ -1227,7 +1220,6 @@ bfd_mach_o_scan_read_symtab (bfd *abfd, bfd_mach_o_load_command *command) bfdsec->size = seg->nsyms * 12; bfdsec->filepos = seg->symoff; bfdsec->alignment_power = 0; - bfdsec->flags = SEC_HAS_CONTENTS; seg->stabs_segment = bfdsec; @@ -1237,7 +1229,7 @@ bfd_mach_o_scan_read_symtab (bfd *abfd, bfd_mach_o_load_command *command) return -1; strcpy (sname, prefix); - bfdsec = bfd_make_section_anyway (abfd, sname); + bfdsec = bfd_make_section_anyway_with_flags (abfd, sname, SEC_HAS_CONTENTS); if (bfdsec == NULL) return -1; @@ -1246,7 +1238,6 @@ bfd_mach_o_scan_read_symtab (bfd *abfd, bfd_mach_o_load_command *command) bfdsec->size = seg->strsize; bfdsec->filepos = seg->stroff; bfdsec->alignment_power = 0; - bfdsec->flags = SEC_HAS_CONTENTS; seg->stabstr_segment = bfdsec; @@ -1263,6 +1254,7 @@ bfd_mach_o_scan_read_segment (bfd *abfd, bfd_mach_o_load_command *command) char *sname; const char *prefix = "LC_SEGMENT"; unsigned int snamelen; + flagword flags; BFD_ASSERT (command->type == BFD_MACH_O_LC_SEGMENT); @@ -1286,7 +1278,8 @@ bfd_mach_o_scan_read_segment (bfd *abfd, bfd_mach_o_load_command *command) return -1; sprintf (sname, "%s.%s", prefix, seg->segname); - bfdsec = bfd_make_section_anyway (abfd, sname); + flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC | SEC_CODE; + bfdsec = bfd_make_section_anyway_with_flags (abfd, sname, flags); if (bfdsec == NULL) return -1; @@ -1295,7 +1288,6 @@ bfd_mach_o_scan_read_segment (bfd *abfd, bfd_mach_o_load_command *command) bfdsec->size = seg->filesize; bfdsec->filepos = seg->fileoff; bfdsec->alignment_power = 0x0; - bfdsec->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC | SEC_CODE; seg->segment = bfdsec; diff --git a/bfd/mep-relocs.pl b/bfd/mep-relocs.pl new file mode 100755 index 00000000000..d227b8252c0 --- /dev/null +++ b/bfd/mep-relocs.pl @@ -0,0 +1,274 @@ +#!/usr/bin/perl +# -*- perl -*- +# +# Toshiba MeP Media Engine Relocation Generator +# Copyright (C) 2001, 2007 Free Software Foundation, Inc. +# This file is part of BFD. +# Originally written by DJ Delorie +# +# 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 2 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. */ + + +# Usage: Run this anywhere inside your source tree. It will read +# include/elf/mep.h and scan the comments therein. It will renumber +# the relocs to be sequential (this is needed so that bfd/elf32-mep.h +# works) if needed. It will then update the reloc list in bfd/reloc.c +# and the howto, mapping, and apply routines in bfd/elf32-mep.c. You +# can then regenerate bfd-in2.h and check everything in. + +# FIXME: After the relocation list is finalized, change this to +# *verify* the reloc list, rather than resequence it. + +while (! -f "include/elf/mep.h" && ! -f "bfd/reloc.c") { + chdir ".."; + $pwd = `pwd`; + if ($pwd !~ m@/.*/@) { + print STDERR "Cannot find include/elf/mep.h or bfd/reloc.h\n"; + exit 1; + } +} +$pwd = `pwd`; +print "srctop is $pwd"; + +printf "Reading include/elf/mep.h ...\n"; +open(MEPH, "include/elf/mep.h"); +open(MEPHO, "> include/elf/mep.h.new") || die("mep.h.new create: $!"); +$val = 0; +while () { + if (($pre,$rel,$rest) = /(.*RELOC_NUMBER \()([^,]+), *\d+(.*)/) { + $rest =~ s/[\r\n]+$//; + print (MEPHO "$pre$rel, $val$rest\n") || die("mep.h.new write: $!"); + $val ++; + $rel =~ s/R_MEP_//; + push(@relocs, $rel); + + $rest =~ s@.*/\* @@; + ($pattern, $sign, $attrs) = $rest =~ m@(.*) ([US]) (.*)\*/@; + $pattern =~ s/ //g; + push(@pattern, $pattern); + push(@sign, $sign); + push(@attrs, $attrs); + + printf "%4d $rel p=`$pattern' s=`$sign' a=`$attrs'\n", $#pattern; + + } else { + print(MEPHO) || die("mep.h.new write: $!"); + } +} +close(MEPH); +close(MEPHO) || die("mep.h.new close: $!"); + +&swapfile("include/elf/mep.h"); + +redo_file ("bfd/reloc.c", + "", + "ENUMDOC\n Toshiba Media Processor Relocations.\n\nCOMMENT\n", + "ENUM\n BFD_RELOC_MEP_%s\n", + ""); + +$autogen = " /* This section generated from bfd/mep-relocs.pl from include/elf/mep.h. */\n"; + +redo_file ("bfd/elf32-mep.c", + "MEPRELOC:HOWTO", + $autogen, + "MEPRELOC:END", + "", + "&emit_howto();", + "MEPRELOC:MAP", + $autogen, + "MEPRELOC:END", + "", + " MAP(%s);\n", + "MEPRELOC:APPLY", + $autogen, + "MEPRELOC:END", + "", + "&emit_apply();", + ); + +sub mask2shifts { + my ($mask) = @_; + my ($bits, $left, $right, $ci, $c, $cv); + $bits = 0; + $left = 0; + $right = 32; + for ($ci=0; $ci 9; + $right = $cv unless $right < $cv; + $bits = $cv+1 unless $bits > $cv+1; + } + $mask =~ tr/-/1/c; + $mask =~ tr/-/0/; + ($rmask = $mask) =~ tr/01/10/; + $mask = unpack("H*", pack("B*", $mask)); + $rmask = unpack("H*", pack("B*", $rmask)); + return ($bits, $left, $right, $mask, $rmask); +} + +sub emit_howto { + for ($i=2; $i<=$#relocs; $i++) { + $mask = $pattern[$i]; + + if (length($mask) == 8) { $bytesize = 0; } + elsif (length($mask) == 16) { $bytesize = 1; } + elsif (length($mask) == 32) { $bytesize = 2; } + + ($bits, $left, $right, $mask) = mask2shifts ($mask); + $bits[$i] = $bits; + $pcrel = 0; + $pcrel = 1 if $attrs[$i] =~ /pc-rel/i; + $overflow = $sign[$i]; + $overflow = 'N' if $attrs[$i] =~ /no-overflow/; + + $c = "$relocs[$i],"; + printf(NEW " MEPREL (R_MEP_%-10s%d,%3d,%2d,%2d,%2d,%2s, 0x%s),\n", + $c, $bytesize, $bits, $left, $right, $pcrel, $overflow, $mask); + } +} + +sub emit_apply { + for ($i=2; $i<=$#relocs; $i++) { + $v = "u"; + $v = "s" if $sign[$i] =~ /S/; + if (length($pattern[$i]) == 8) { + $e = ''; # no endian swap for bytes + } elsif ($pattern[$i] =~ /-/ || length($pattern[$i]) == 16) { + $e = '^e2'; # endian swap - 2byte words only + } else { + $e = '^e4' # endian swap for data + } + print NEW " case R_MEP_$relocs[$i]: /* $pattern[$i] */\n"; + if ($attrs[$i] =~ /tp-rel/i) { + print NEW " $v -= mep_tpoff_base(rel->r_offset);\n"; + } + if ($attrs[$i] =~ /gp-rel/i) { + print NEW " $v -= mep_sdaoff_base(rel->r_offset);\n"; + } + if ($attrs[$i] !~ /no-overflow/ && $bits[$i] < 32) { + if ($v eq "u") { + $max = (1 << $bits[$i]) - 1; + print NEW " if (u > $max) r = bfd_reloc_overflow;\n"; + } else { + $min = -(1 << ($bits[$i]-1)); + $max = (1 << ($bits[$i]-1)) - 1; + print NEW " if ($min > s || s > $max) r = bfd_reloc_overflow;\n"; + } + } + for ($b=0; $b $right) { $left -= $right; $right = 0; } + else { $right -= $left; $left = 0; } + + if ($mask ne "00") { + $bb = $b / 8; + print NEW " byte[$bb$e] = "; + print NEW "(byte[$bb$e] & 0x$rmask) | " if $rmask ne "00"; + if ($left) { + print NEW "(($v << $left) & 0x$mask)"; + } elsif ($right) { + print NEW "(($v >> $right) & 0x$mask)"; + } else { + print NEW "($v & 0x$mask)"; + } + print NEW ";\n"; + } + } + print NEW " break;\n"; + } +} + + +#----------------------------------------------------------------------------- + +sub redo_file { + my ($file, @control) = @_; + open(OLD, $file); + open(NEW, "> $file.new") || die("$file.new create: $!"); + + print "Scanning file $file ...\n"; + + while (1) { + $start = shift @control; + $prefix = shift @control; + $end = shift @control; + $suffix = shift @control; + $pattern = shift @control; + + if (!$start) { + print NEW while ; + last; + } + + print " looking for $start\n"; + while () { + print NEW; + last if /\Q$start\E/; + } + print "can't find $start\n" unless $_; + last unless $_; + + print NEW $prefix; + if ($pattern =~ /^\&/) { + eval $pattern; + die("$pattern: $@") if $@; + } else { + for $i (2..$#relocs) { + printf (NEW "$pattern", $relocs[$i]) || die("$file.new write: $!"); + $pattern =~ s/^ENUM\n/ENUMX\n/; + } + } + print NEW $suffix; + while () { + last if /\Q$end\E/; + } + print NEW; + } + + close(OLD); + close(NEW) || die("$file.new close: $!"); + &swapfile($file); +} + +#----------------------------------------------------------------------------- + +sub swapfile { + my ($f) = @_; + if ( ! -f "$f.save") { + system "cp $f $f.save"; + } + open(ORIG, $f); + open(NEW, "$f.new"); + while () { + $n = ; + if ($n ne $_) { + close(ORIG); + close(NEW); + print " Updating $f\n"; + rename "$f", "$f.old"; + rename "$f.new", "$f"; + return; + } + } + close(ORIG); + close(NEW); + print " No change to $f\n"; + unlink "$f.new"; +} diff --git a/bfd/merge.c b/bfd/merge.c index c1795d29112..71b31d378b5 100644 --- a/bfd/merge.c +++ b/bfd/merge.c @@ -1,5 +1,5 @@ /* SEC_MERGE support. - Copyright 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Jakub Jelinek . @@ -22,8 +22,8 @@ /* This file contains support for merging duplicate entities within sections, as used in ELF SHF_MERGE. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "hashtab.h" #include "libiberty.h" @@ -766,7 +766,7 @@ _bfd_merge_sections (bfd *abfd ATTRIBUTE_UNUSED, the hash table at all. */ for (secinfo = sinfo->chain; secinfo; secinfo = secinfo->next) if (secinfo->first_str == NULL) - secinfo->sec->flags |= SEC_EXCLUDE; + secinfo->sec->flags |= SEC_EXCLUDE | SEC_KEEP; } return TRUE; diff --git a/bfd/mipsbsd.c b/bfd/mipsbsd.c index b8621e486ae..6edb9728361 100644 --- a/bfd/mipsbsd.c +++ b/bfd/mipsbsd.c @@ -1,6 +1,6 @@ /* BFD backend for MIPS BSD (a.out) binaries. - Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, + 2007 Free Software Foundation, Inc. Written by Ralph Campbell. This file is part of BFD, the Binary File Descriptor library. @@ -40,8 +40,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. the tokens. */ #define MY(OP) CONCAT2 (mipsbsd_,OP) -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libaout.h" @@ -56,7 +56,8 @@ static bfd_boolean MY(write_object_contents) PARAMS ((bfd *abfd)); /* We can't use MY(x) here because it leads to a recursive call to CONCAT2 when expanded inside JUMP_TABLE. */ -#define MY_bfd_reloc_type_lookup mipsbsd_reloc_howto_type_lookup +#define MY_bfd_reloc_type_lookup mipsbsd_reloc_type_lookup +#define MY_bfd_reloc_name_lookup mipsbsd_reloc_name_lookup #define MY_canonicalize_reloc mipsbsd_canonicalize_reloc #define MY_bfd_link_hash_table_create _bfd_generic_link_hash_table_create @@ -72,8 +73,6 @@ static bfd_boolean MY(write_object_contents) PARAMS ((bfd *abfd)); static bfd_reloc_status_type mips_fix_jmp_addr PARAMS ((bfd *, arelent *, struct bfd_symbol *, PTR, asection *, bfd *, char **)); -static reloc_howto_type *MY(reloc_howto_type_lookup) - PARAMS ((bfd *, bfd_reloc_code_real_type)); long MY(canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, asymbol **)); @@ -302,9 +301,7 @@ static reloc_howto_type mips_howto_table_ext[] = { }; static reloc_howto_type * -MY(reloc_howto_type_lookup) (abfd, code) - bfd *abfd; - bfd_reloc_code_real_type code; +MY(reloc_type_lookup) (bfd *abfd, bfd_reloc_code_real_type code) { if (bfd_get_arch (abfd) != bfd_arch_mips) @@ -330,6 +327,22 @@ MY(reloc_howto_type_lookup) (abfd, code) } } +static reloc_howto_type * +MY(reloc_name_lookup) (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (mips_howto_table_ext) / sizeof (mips_howto_table_ext[0]); + i++) + if (mips_howto_table_ext[i].name != NULL + && strcasecmp (mips_howto_table_ext[i].name, r_name) == 0) + return &mips_howto_table_ext[i]; + + return NULL; +} + /* This is just like the standard aoutx.h version but we need to do our own mapping of external reloc type values to howto entries. */ long diff --git a/bfd/mmo.c b/bfd/mmo.c index 091b341810b..380a0429d3b 100644 --- a/bfd/mmo.c +++ b/bfd/mmo.c @@ -1,5 +1,5 @@ /* BFD back-end for mmo objects (MMIX-specific object-format). - Copyright 2001, 2002, 2003, 2004, 2005 + Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Hans-Peter Nilsson (hp@bitrange.com). Infrastructure and other bits originally copied from srec.c and @@ -195,8 +195,8 @@ EXAMPLE | 0x81000000 | 0x980c0005 - lop_end; symbol table contained five 32-bit words. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libiberty.h" #include "elf/mmix.h" @@ -387,8 +387,7 @@ static void mmo_print_symbol (bfd *, void *, asymbol *, bfd_print_symbol_type); static bfd_boolean mmo_set_section_contents (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); -static int mmo_sizeof_headers (bfd *, bfd_boolean); -static long mmo_get_reloc_upper_bound (bfd *, asection *); +static int mmo_sizeof_headers (bfd *, struct bfd_link_info *); static bfd_boolean mmo_internal_write_header (bfd *); static bfd_boolean mmo_internal_write_post (bfd *, int, asection *); static bfd_boolean mmo_internal_add_3_sym (bfd *, struct mmo_symbol_trie *, @@ -415,7 +414,6 @@ static void mmo_write_byte (bfd *, bfd_byte); static bfd_boolean mmo_new_section_hook (bfd *, asection *); static int mmo_sort_mmo_symbols (const void *, const void *); static bfd_boolean mmo_write_object_contents (bfd *); -static long mmo_canonicalize_reloc (bfd *, sec_ptr, arelent **, asymbol **); static bfd_boolean mmo_write_section_description (bfd *, asection *); static bfd_boolean mmo_has_leading_or_trailing_zero_tetra_p (bfd *, asection *); @@ -1917,7 +1915,7 @@ mmo_scan (bfd *abfd) /* This must be the last 32-bit word in an mmo file. Let's find out. */ struct stat statbuf; - long curpos = bfd_tell (abfd); + file_ptr curpos = bfd_tell (abfd); if (bfd_stat (abfd, &statbuf) < 0) goto error_return; @@ -2007,19 +2005,21 @@ mmo_scan (bfd *abfd) we point out the shape of allocated section contents. */ static bfd_boolean -mmo_new_section_hook (bfd *abfd ATTRIBUTE_UNUSED, asection *newsect) +mmo_new_section_hook (bfd *abfd, asection *newsect) { - /* We zero-fill all fields and assume NULL is represented by an all - zero-bit pattern. */ - newsect->used_by_bfd = - bfd_zalloc (abfd, sizeof (struct mmo_section_data_struct)); - if (!newsect->used_by_bfd) - return FALSE; + { + /* We zero-fill all fields and assume NULL is represented by an all + zero-bit pattern. */ + newsect->used_by_bfd + = bfd_zalloc (abfd, sizeof (struct mmo_section_data_struct)); + if (!newsect->used_by_bfd) + return FALSE; + } /* Always align to at least 32-bit words. */ newsect->alignment_power = 2; - return TRUE; + return _bfd_generic_new_section_hook (abfd, newsect); } /* We already have section contents loaded for sections that have @@ -2229,7 +2229,7 @@ mmo_print_symbol (bfd *abfd, void *afile, asymbol *symbol, static int mmo_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, - bfd_boolean exec ATTRIBUTE_UNUSED) + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return 0; } @@ -2419,10 +2419,10 @@ mmo_internal_write_section (bfd *abfd, asection *sec) bfd_set_error (bfd_error_bad_value); return FALSE; } - else if (strncmp (sec->name, MMIX_OTHER_SPEC_SECTION_PREFIX, - strlen (MMIX_OTHER_SPEC_SECTION_PREFIX)) == 0) + else if (CONST_STRNEQ (sec->name, MMIX_OTHER_SPEC_SECTION_PREFIX)) { int n = atoi (sec->name + strlen (MMIX_OTHER_SPEC_SECTION_PREFIX)); + mmo_write_tetra_raw (abfd, (LOP << 24) | (LOP_SPEC << 16) | n); return (! abfd->tdata.mmo_data->have_error && mmo_write_chunk_list (abfd, mmo_section_data (sec)->head)); @@ -3159,28 +3159,6 @@ mmo_write_object_contents (bfd *abfd) return mmo_write_symbols_and_terminator (abfd); } -/* Return the size of a NULL pointer, so we support linking in an mmo - object. */ - -static long -mmo_get_reloc_upper_bound (bfd *abfd ATTRIBUTE_UNUSED, - asection *sec ATTRIBUTE_UNUSED) -{ - return sizeof (void *); -} - -/* Similarly canonicalize relocs to empty, filling in the terminating NULL - pointer. */ - -long -mmo_canonicalize_reloc (bfd *abfd ATTRIBUTE_UNUSED, - sec_ptr section ATTRIBUTE_UNUSED, arelent **relptr, - asymbol **symbols ATTRIBUTE_UNUSED) -{ - *relptr = NULL; - return 0; -} - /* If there's anything in particular in a mmo bfd that we want to free, make this a real function. Only do this if you see major memory thrashing; zealous free:ing will cause unwanted behavior, especially if @@ -3232,18 +3210,6 @@ mmo_canonicalize_reloc (bfd *abfd ATTRIBUTE_UNUSED, #define mmo_section_already_linked \ _bfd_generic_section_already_linked -/* objcopy will be upset if we return -1 from bfd_get_reloc_upper_bound by - using BFD_JUMP_TABLE_RELOCS (_bfd_norelocs) rather than 0. FIXME: Most - likely a bug in the _bfd_norelocs definition. - - On the other hand, we smuggle in an mmo object (because setting up ELF - is too cumbersome) when linking (from other formats, presumably ELF) to - represent the g255 entry. We need to link that object, so need to say - it has no relocs. Upper bound for the size of the relocation table is - the size of a NULL pointer, and we support "canonicalization" for that - pointer. */ -#define mmo_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup - /* We want to copy time of creation, otherwise we'd use BFD_JUMP_TABLE_COPY (_bfd_generic). */ #define mmo_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data @@ -3303,9 +3269,7 @@ const bfd_target bfd_mmo_vec = BFD_JUMP_TABLE_CORE (_bfd_nocore), BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), BFD_JUMP_TABLE_SYMBOLS (mmo), - /* We have to provide a valid method for getting relocs, returning zero, - so we can't say BFD_JUMP_TABLE_RELOCS (_bfd_norelocs). */ - BFD_JUMP_TABLE_RELOCS (mmo), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), BFD_JUMP_TABLE_WRITE (mmo), BFD_JUMP_TABLE_LINK (mmo), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), diff --git a/bfd/netbsd-core.c b/bfd/netbsd-core.c index e9111a98501..913e862f9a4 100644 --- a/bfd/netbsd-core.c +++ b/bfd/netbsd-core.c @@ -1,6 +1,6 @@ /* BFD back end for NetBSD style core files Copyright 1988, 1989, 1991, 1992, 1993, 1996, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005 + 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Paul Kranenburg, EUR @@ -20,8 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libaout.h" /* BFD a.out internal data structures. */ @@ -126,11 +126,10 @@ netbsd_core_file_p (bfd *abfd) flags = SEC_ALLOC + SEC_HAS_CONTENTS; break; } - asect = bfd_make_section_anyway (abfd, sname); + asect = bfd_make_section_anyway_with_flags (abfd, sname, flags); if (asect == NULL) goto punt; - asect->flags = flags; asect->size = coreseg.c_size; asect->vma = coreseg.c_addr; asect->filepos = offset; @@ -159,11 +158,12 @@ netbsd_core_file_p (bfd *abfd) asect->size = wcookie_offset; /* And create the .wcookie section. */ - asect = bfd_make_section_anyway (abfd, ".wcookie"); + flags = SEC_ALLOC + SEC_HAS_CONTENTS; + asect = bfd_make_section_anyway_with_flags (abfd, ".wcookie", + flags); if (asect == NULL) goto punt; - asect->flags = SEC_ALLOC + SEC_HAS_CONTENTS; asect->size = coreseg.c_size - wcookie_offset; asect->vma = 0; asect->filepos = offset + wcookie_offset; diff --git a/bfd/netbsd.h b/bfd/netbsd.h index 92f6a7d2fd1..7182eda9047 100644 --- a/bfd/netbsd.h +++ b/bfd/netbsd.h @@ -1,6 +1,6 @@ /* BFD back-end definitions used by all NetBSD targets. - Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2002, 2005 - Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2002, + 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -50,8 +50,8 @@ ((exec).a_info = \ ((exec).a_info & 0x03ffffff) | ((flags & 0x03f) << 26)) -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libaout.h" diff --git a/bfd/newsos3.c b/bfd/newsos3.c index 46f1d76054a..9270c2398c7 100644 --- a/bfd/newsos3.c +++ b/bfd/newsos3.c @@ -1,5 +1,5 @@ /* BFD back-end for NewsOS3 (Sony, 68k) binaries. - Copyright 1990, 1991, 1994, 1995, 2000, 2001, 2003 + Copyright 1990, 1991, 1994, 1995, 2000, 2001, 2003, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -33,8 +33,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define TARGET_IS_BIG_ENDIAN_P #define N_HEADER_IN_TEXT(x) 0 -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "aout/aout64.h" #include "aout/stab_gnu.h" diff --git a/bfd/nlm-target.h b/bfd/nlm-target.h index 3358aef8e75..7556112b5bd 100644 --- a/bfd/nlm-target.h +++ b/bfd/nlm-target.h @@ -1,6 +1,6 @@ /* Target definitions for 32/64-bit NLM (NetWare Loadable Module) Copyright 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005 Free Software Foundation, Inc. + 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -37,6 +37,7 @@ #define nlm_get_reloc_upper_bound nlmNAME (get_reloc_upper_bound) #define nlm_canonicalize_reloc nlmNAME (canonicalize_reloc) #define nlm_bfd_reloc_type_lookup bfd_default_reloc_type_lookup +#define nlm_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup #define nlm_set_section_contents nlmNAME (set_section_contents) #define nlm_sizeof_headers _bfd_nolink_sizeof_headers diff --git a/bfd/nlm.c b/bfd/nlm.c index 44599b595f2..4919d6c8dbb 100644 --- a/bfd/nlm.c +++ b/bfd/nlm.c @@ -1,5 +1,5 @@ /* NLM (NetWare Loadable Module) executable support for BFD. - Copyright 1993, 1994, 2001, 2002, 2003, 2005 + Copyright 1993, 1994, 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libnlm.h" diff --git a/bfd/nlm32-alpha.c b/bfd/nlm32-alpha.c index 87d80c159a8..384c0169a7f 100644 --- a/bfd/nlm32-alpha.c +++ b/bfd/nlm32-alpha.c @@ -1,5 +1,5 @@ /* Support for 32-bit Alpha NLM (NetWare Loadable Module) - Copyright 1993, 1994, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 1993, 1994, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. @@ -23,8 +23,8 @@ that an Alpha chip would use a 64 bit format, but, for some reason, it doesn't. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #define ARCH_SIZE 32 diff --git a/bfd/nlm32-i386.c b/bfd/nlm32-i386.c index fcdfc645640..c3a5d7e1eb9 100644 --- a/bfd/nlm32-i386.c +++ b/bfd/nlm32-i386.c @@ -1,5 +1,5 @@ /* Support for 32-bit i386 NLM (NetWare Loadable Module) - Copyright 1993, 1994, 2000, 2001, 2002, 2003, 2005 + Copyright 1993, 1994, 2000, 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #define ARCH_SIZE 32 diff --git a/bfd/nlm32-ppc.c b/bfd/nlm32-ppc.c index 8b0d4009df8..a09df98c2a6 100644 --- a/bfd/nlm32-ppc.c +++ b/bfd/nlm32-ppc.c @@ -1,6 +1,6 @@ /* Support for 32-bit PowerPC NLM (NetWare Loadable Module) - Copyright 1994, 1995, 1999, 2000, 2001, 2002, 2003, 2004, - 2005 Free Software Foundation, Inc. + Copyright 1994, 1995, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/nlm32-sparc.c b/bfd/nlm32-sparc.c index e647ad082aa..4acf791c1fb 100644 --- a/bfd/nlm32-sparc.c +++ b/bfd/nlm32-sparc.c @@ -1,6 +1,6 @@ /* Support for 32-bit SPARC NLM (NetWare Loadable Module) - Copyright 1993, 1994, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #define ARCH_SIZE 32 @@ -123,8 +123,9 @@ nlm_sparc_read_reloc (bfd *abfd, } #ifdef DEBUG - fprintf (stderr, "%s: address = %08lx, addend = %08lx, type = %d, howto = %08lx\n", - __FUNCTION__, rel->address, rel->addend, type, rel->howto); + fprintf (stderr, "%s: address = %08lx, addend = %08lx, type = %u, howto = %p\n", + __FUNCTION__, (unsigned long) rel->address, + (unsigned long) rel->addend, type, rel->howto); #endif return TRUE; @@ -176,8 +177,9 @@ nlm_sparc_write_reloc (bfd * abfd, asection * sec, arelent * rel) val = bfd_get_section_vma (abfd, sec) + rel->address; #ifdef DEBUG - fprintf (stderr, "%s: val = %08lx, addend = %08lx, type = %d\n", - __FUNCTION__, val, rel->addend, rel->howto->type); + fprintf (stderr, "%s: val = %08lx, addend = %08lx, type = %u\n", + __FUNCTION__, (unsigned long) val, (unsigned long) rel->addend, + rel->howto->type); #endif bfd_put_32 (abfd, val, tmp_reloc.offset); bfd_put_32 (abfd, rel->addend, tmp_reloc.addend); @@ -280,8 +282,8 @@ nlm_sparc_write_import (bfd * abfd, asection * sec, arelent * rel) base = 0; #ifdef DEBUG - fprintf (stderr, "%s: <%x, 1>\n\t", - __FUNCTION__, base + (*rel->sym_ptr_ptr)->value); + fprintf (stderr, "%s: <%lx, 1>\n\t", + __FUNCTION__, (unsigned long) (base + (*rel->sym_ptr_ptr)->value)); #endif bfd_put_32 (abfd, base + (*rel->sym_ptr_ptr)->value, temp); if (bfd_bwrite (temp, (bfd_size_type) 4, abfd) != 4) @@ -330,8 +332,8 @@ nlm_sparc_write_export (bfd * abfd, asymbol * sym, bfd_vma value) bfd_byte temp[4]; #ifdef DEBUG - fprintf (stderr, "%s: <%x, %d, %s>\n", - __FUNCTION__, value, strlen (sym->name), sym->name); + fprintf (stderr, "%s: <%lx, %u, %s>\n", + __FUNCTION__, (unsigned long) value, strlen (sym->name), sym->name); #endif bfd_put_32 (abfd, value, temp); len = strlen (sym->name); diff --git a/bfd/nlmcode.h b/bfd/nlmcode.h index 4773061138f..d4a0d983b98 100644 --- a/bfd/nlmcode.h +++ b/bfd/nlmcode.h @@ -1,6 +1,6 @@ /* NLM (NetWare Loadable Module) executable support for BFD. Copyright 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005 Free Software Foundation, Inc. + 2005, 2006, 2007 Free Software Foundation, Inc. Written by Fred Fish @ Cygnus Support, using ELF support as the template. @@ -21,8 +21,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libnlm.h" @@ -138,14 +138,13 @@ add_bfd_section (bfd *abfd, { asection *newsect; - newsect = bfd_make_section (abfd, name); + newsect = bfd_make_section_with_flags (abfd, name, flags); if (newsect == NULL) return FALSE; newsect->vma = 0; /* NLM's are relocatable. */ newsect->size = size; newsect->filepos = offset; - newsect->flags = flags; newsect->alignment_power = bfd_log2 ((bfd_vma) 0); /* FIXME */ return TRUE; @@ -175,7 +174,7 @@ nlm_swap_auxiliary_headers_in (bfd *abfd) return FALSE; if (bfd_seek (abfd, position, SEEK_SET) != 0) return FALSE; - if (strncmp (tempstr, "VeRsIoN#", 8) == 0) + if (CONST_STRNEQ (tempstr, "VeRsIoN#")) { Nlm_External_Version_Header thdr; @@ -197,7 +196,7 @@ nlm_swap_auxiliary_headers_in (bfd *abfd) nlm_version_header (abfd)->day = get_word (abfd, (bfd_byte *) thdr.day); } - else if (strncmp (tempstr, "MeSsAgEs", 8) == 0) + else if (CONST_STRNEQ (tempstr, "MeSsAgEs")) { Nlm_External_Extended_Header thdr; @@ -265,7 +264,7 @@ nlm_swap_auxiliary_headers_in (bfd *abfd) nlm_extended_header (abfd)->reserved5 = get_word (abfd, (bfd_byte *) thdr.reserved5); } - else if (strncmp (tempstr, "CoPyRiGhT=", 10) == 0) + else if (CONST_STRNEQ (tempstr, "CoPyRiGhT=")) { amt = sizeof (nlm_copyright_header (abfd)->stamp); if (bfd_bread ((void *) nlm_copyright_header (abfd)->stamp, @@ -281,7 +280,7 @@ nlm_swap_auxiliary_headers_in (bfd *abfd) amt, abfd) != amt) return FALSE; } - else if (strncmp (tempstr, "CuStHeAd", 8) == 0) + else if (CONST_STRNEQ (tempstr, "CuStHeAd")) { Nlm_External_Custom_Header thdr; bfd_size_type hdrLength; @@ -346,7 +345,7 @@ nlm_swap_auxiliary_headers_in (bfd *abfd) /* If we have found a Cygnus header, process it. Otherwise, just save the associated data without trying to interpret it. */ - if (strncmp (dataStamp, "CyGnUsEx", 8) == 0) + if (CONST_STRNEQ (dataStamp, "CyGnUsEx")) { file_ptr pos; bfd_byte *contents; @@ -365,7 +364,7 @@ nlm_swap_auxiliary_headers_in (bfd *abfd) if (bfd_seek (abfd, pos, SEEK_SET) != 0) return FALSE; - memcpy (nlm_cygnus_ext_header (abfd), "CyGnUsEx", 8); + LITMEMCPY (nlm_cygnus_ext_header (abfd), "CyGnUsEx"); nlm_cygnus_ext_header (abfd)->offset = dataOffset; nlm_cygnus_ext_header (abfd)->length = dataLength; @@ -646,7 +645,7 @@ nlm_swap_auxiliary_headers_out (bfd *abfd) { Nlm_External_Version_Header thdr; - memcpy (thdr.stamp, "VeRsIoN#", 8); + LITMEMCPY (thdr.stamp, "VeRsIoN#"); put_word (abfd, (bfd_vma) nlm_version_header (abfd)->majorVersion, (bfd_byte *) thdr.majorVersion); put_word (abfd, (bfd_vma) nlm_version_header (abfd)->minorVersion, @@ -673,7 +672,7 @@ nlm_swap_auxiliary_headers_out (bfd *abfd) { Nlm_External_Copyright_Header thdr; - memcpy (thdr.stamp, "CoPyRiGhT=", 10); + LITMEMCPY (thdr.stamp, "CoPyRiGhT="); amt = sizeof (thdr.stamp); if (bfd_bwrite ((void *) thdr.stamp, amt, abfd) != amt) return FALSE; @@ -695,7 +694,7 @@ nlm_swap_auxiliary_headers_out (bfd *abfd) { Nlm_External_Extended_Header thdr; - memcpy (thdr.stamp, "MeSsAgEs", 8); + LITMEMCPY (thdr.stamp, "MeSsAgEs"); put_word (abfd, (bfd_vma) nlm_extended_header (abfd)->languageID, (bfd_byte *) thdr.languageID); @@ -798,7 +797,7 @@ nlm_swap_auxiliary_headers_out (bfd *abfd) ds = find_nonzero (nlm_custom_header (abfd)->dataStamp, sizeof (nlm_custom_header (abfd)->dataStamp)); - memcpy (thdr.stamp, "CuStHeAd", 8); + LITMEMCPY (thdr.stamp, "CuStHeAd"); hdrLength = (2 * NLM_TARGET_LONG_SIZE + (ds ? 8 : 0) + nlm_custom_header (abfd)->hdrLength); put_word (abfd, hdrLength, thdr.length); @@ -832,14 +831,14 @@ nlm_swap_auxiliary_headers_out (bfd *abfd) { Nlm_External_Custom_Header thdr; - memcpy (thdr.stamp, "CuStHeAd", 8); + LITMEMCPY (thdr.stamp, "CuStHeAd"); put_word (abfd, (bfd_vma) 2 * NLM_TARGET_LONG_SIZE + 8, (bfd_byte *) thdr.length); put_word (abfd, (bfd_vma) nlm_cygnus_ext_header (abfd)->offset, (bfd_byte *) thdr.dataOffset); put_word (abfd, (bfd_vma) nlm_cygnus_ext_header (abfd)->length, (bfd_byte *) thdr.dataLength); - memcpy (thdr.dataStamp, "CyGnUsEx", 8); + LITMEMCPY (thdr.dataStamp, "CyGnUsEx"); amt = sizeof (thdr); if (bfd_bwrite ((void *) &thdr, amt, abfd) != amt) return FALSE; diff --git a/bfd/oasys.c b/bfd/oasys.c index 74d2c310a03..972455d877d 100644 --- a/bfd/oasys.c +++ b/bfd/oasys.c @@ -1,6 +1,6 @@ /* BFD back-end for oasys objects. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001, - 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support, . This file is part of BFD, the Binary File Descriptor library. @@ -20,8 +20,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #define UNDERSCORE_HACK 1 -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "safe-ctype.h" #include "libbfd.h" #include "oasys.h" @@ -685,9 +685,13 @@ oasys_print_symbol (bfd *abfd, void * afile, asymbol *symbol, bfd_print_symbol_t static bfd_boolean oasys_new_section_hook (bfd *abfd, asection *newsect) { - newsect->used_by_bfd = bfd_alloc (abfd, (bfd_size_type) sizeof (oasys_per_section_type)); if (!newsect->used_by_bfd) - return FALSE; + { + newsect->used_by_bfd + = bfd_alloc (abfd, (bfd_size_type) sizeof (oasys_per_section_type)); + if (!newsect->used_by_bfd) + return FALSE; + } oasys_per_section (newsect)->data = NULL; oasys_per_section (newsect)->section = newsect; oasys_per_section (newsect)->offset = 0; @@ -697,7 +701,7 @@ oasys_new_section_hook (bfd *abfd, asection *newsect) /* Turn the section string into an index. */ sscanf (newsect->name, "%u", &newsect->target_index); - return TRUE; + return _bfd_generic_new_section_hook (abfd, newsect); } @@ -1160,7 +1164,8 @@ oasys_generic_stat_arch_elt (bfd *abfd, struct stat *buf) } static int -oasys_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, bfd_boolean exec ATTRIBUTE_UNUSED) +oasys_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return 0; } @@ -1182,6 +1187,7 @@ oasys_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, bfd_boolean exec ATTRIBUTE_UNU #define oasys_read_minisymbols _bfd_generic_read_minisymbols #define oasys_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol #define oasys_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup +#define oasys_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup #define oasys_set_arch_mach bfd_default_set_arch_mach #define oasys_get_section_contents_in_window _bfd_generic_get_section_contents_in_window #define oasys_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents diff --git a/bfd/opncls.c b/bfd/opncls.c index b02b137889a..4457a797cf4 100644 --- a/bfd/opncls.c +++ b/bfd/opncls.c @@ -1,6 +1,6 @@ /* opncls.c -- open and close a BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, - 2001, 2002, 2003, 2004, 2005, 2006 + 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -21,8 +21,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "objalloc.h" #include "libbfd.h" #include "libiberty.h" @@ -115,11 +115,35 @@ _bfd_new_bfd_contained_in (bfd *obfd) void _bfd_delete_bfd (bfd *abfd) { - bfd_hash_table_free (&abfd->section_htab); - objalloc_free ((struct objalloc *) abfd->memory); + if (abfd->memory) + { + bfd_hash_table_free (&abfd->section_htab); + objalloc_free ((struct objalloc *) abfd->memory); + } free (abfd); } +/* Free objalloc memory. */ + +bfd_boolean +_bfd_free_cached_info (bfd *abfd) +{ + if (abfd->memory) + { + bfd_hash_table_free (&abfd->section_htab); + objalloc_free ((struct objalloc *) abfd->memory); + + abfd->sections = NULL; + abfd->section_last = NULL; + abfd->outsymbols = NULL; + abfd->tdata.any = NULL; + abfd->usrdata = NULL; + abfd->memory = NULL; + } + + return TRUE; +} + /* SECTION Opening and closing BFDs @@ -360,7 +384,10 @@ SYNOPSIS file_ptr nbytes, file_ptr offset), int (*close) (struct bfd *nbfd, - void *stream)); + void *stream), + int (*stat) (struct bfd *abfd, + void *stream, + struct stat *sb)); DESCRIPTION @@ -387,6 +414,10 @@ DESCRIPTION <>. @var{close} either succeeds returning 0, or fails returning -1 (setting <>). + Calls @var{stat} to fill in a stat structure for bfd_stat, + bfd_get_size, and bfd_get_mtime calls. @var{stat} returns 0 + on success, or returns -1 on failure (setting <>). + If <> returns <> then an error has occurred. Possible errors are <>, <> and <>. @@ -399,6 +430,7 @@ struct opncls file_ptr (*pread) (struct bfd *abfd, void *stream, void *buf, file_ptr nbytes, file_ptr offset); int (*close) (struct bfd *abfd, void *stream); + int (*stat) (struct bfd *abfd, void *stream, struct stat *sb); file_ptr where; }; @@ -461,10 +493,15 @@ opncls_bflush (struct bfd *abfd ATTRIBUTE_UNUSED) } static int -opncls_bstat (struct bfd *abfd ATTRIBUTE_UNUSED, struct stat *sb) +opncls_bstat (struct bfd *abfd, struct stat *sb) { + struct opncls *vec = abfd->iostream; + memset (sb, 0, sizeof (*sb)); - return 0; + if (vec->stat == NULL) + return 0; + + return (vec->stat) (abfd, vec->stream, sb); } static const struct bfd_iovec opncls_iovec = { @@ -483,7 +520,10 @@ bfd_openr_iovec (const char *filename, const char *target, file_ptr nbytes, file_ptr offset), int (*close) (struct bfd *nbfd, - void *stream)) + void *stream), + int (*stat) (struct bfd *abfd, + void *stream, + struct stat *sb)) { bfd *nbfd; const bfd_target *target_vec; @@ -515,6 +555,7 @@ bfd_openr_iovec (const char *filename, const char *target, vec->stream = stream; vec->pread = pread; vec->close = close; + vec->stat = stat; nbfd->iovec = &opncls_iovec; nbfd->iostream = vec; @@ -1321,6 +1362,7 @@ bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename) { asection *sect; bfd_size_type debuglink_size; + flagword flags; if (abfd == NULL || filename == NULL) { @@ -1339,16 +1381,11 @@ bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename) return NULL; } - sect = bfd_make_section (abfd, GNU_DEBUGLINK); + flags = SEC_HAS_CONTENTS | SEC_READONLY | SEC_DEBUGGING; + sect = bfd_make_section_with_flags (abfd, GNU_DEBUGLINK, flags); if (sect == NULL) return NULL; - if (! bfd_set_section_flags (abfd, sect, - SEC_HAS_CONTENTS | SEC_READONLY | SEC_DEBUGGING)) - /* XXX Should we delete the section from the bfd ? */ - return NULL; - - debuglink_size = strlen (filename) + 1; debuglink_size += 3; debuglink_size &= ~3; diff --git a/bfd/osf-core.c b/bfd/osf-core.c index cc6c4dccd00..b9472abe390 100644 --- a/bfd/osf-core.c +++ b/bfd/osf-core.c @@ -1,6 +1,6 @@ /* BFD back-end for OSF/1 core files. - Copyright 1993, 1994, 1995, 1998, 1999, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1998, 1999, 2001, 2002, 2003, 2004, 2006, + 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -21,8 +21,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. /* This file can only be compiled on systems which use OSF/1 style core files. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include @@ -67,11 +67,10 @@ make_bfd_asection (abfd, name, flags, size, vma, filepos) { asection *asect; - asect = bfd_make_section_anyway (abfd, name); + asect = bfd_make_section_anyway_with_flags (abfd, name, flags); if (!asect) return NULL; - asect->flags = flags; asect->size = size; asect->vma = vma; asect->filepos = filepos; @@ -95,7 +94,7 @@ osf_core_core_file_p (abfd) if (val != sizeof core_header) return NULL; - if (strncmp (core_header.magic, "Core", 4) != 0) + if (! CONST_STRNEQ (core_header.magic, "Core")) return NULL; core_hdr (abfd) = (struct osf_core_struct *) diff --git a/bfd/pc532-mach.c b/bfd/pc532-mach.c index 70ca8613cc3..6dc1de13a59 100644 --- a/bfd/pc532-mach.c +++ b/bfd/pc532-mach.c @@ -1,5 +1,5 @@ /* BFD back-end for Mach3/532 a.out-ish binaries. - Copyright 1990, 1991, 1992, 1994, 1995, 2000, 2001, 2002 + Copyright 1990, 1991, 1992, 1994, 1995, 2000, 2001, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -60,8 +60,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define TARGETNAME "a.out-pc532-mach" -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libaout.h" #include "libbfd.h" #include "aout/aout64.h" diff --git a/bfd/pdp11.c b/bfd/pdp11.c index 37f960f1992..c3fbb41df0e 100644 --- a/bfd/pdp11.c +++ b/bfd/pdp11.c @@ -1,5 +1,5 @@ /* BFD back-end for PDP-11 a.out binaries. - Copyright 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -70,6 +70,7 @@ && ((x).a_info != A_MAGIC5) \ && ((x).a_info != A_MAGIC6)) +#include "sysdep.h" #include "bfd.h" #define external_exec pdp11_external_exec @@ -123,7 +124,6 @@ struct pdp11_external_nlist #define WRITE_HEADERS(abfd, execp) pdp11_aout_write_headers (abfd, execp) -#include "sysdep.h" #include "libbfd.h" #include "libaout.h" @@ -277,6 +277,22 @@ NAME (aout, reloc_type_lookup) (bfd * abfd ATTRIBUTE_UNUSED, } } +reloc_howto_type * +NAME (aout, reloc_name_lookup) (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (howto_table_pdp11) / sizeof (howto_table_pdp11[0]); + i++) + if (howto_table_pdp11[i].name != NULL + && strcasecmp (howto_table_pdp11[i].name, r_name) == 0) + return &howto_table_pdp11[i]; + + return NULL; +} + static int pdp11_aout_write_headers (bfd *abfd, struct internal_exec *execp) { @@ -1111,32 +1127,27 @@ NAME (aout, new_section_hook) (bfd *abfd, asection *newsect) if (bfd_get_format (abfd) == bfd_object) { if (obj_textsec (abfd) == NULL - && ! strcmp (newsect->name, ".text")) + && !strcmp (newsect->name, ".text")) { obj_textsec(abfd)= newsect; newsect->target_index = N_TEXT; - return TRUE; } - - if (obj_datasec (abfd) == NULL - && ! strcmp (newsect->name, ".data")) - { - obj_datasec (abfd) = newsect; - newsect->target_index = N_DATA; - return TRUE; - } - - if (obj_bsssec (abfd) == NULL - && !strcmp (newsect->name, ".bss")) - { - obj_bsssec (abfd) = newsect; - newsect->target_index = N_BSS; - return TRUE; - } - } + else if (obj_datasec (abfd) == NULL + && !strcmp (newsect->name, ".data")) + { + obj_datasec (abfd) = newsect; + newsect->target_index = N_DATA; + } + else if (obj_bsssec (abfd) == NULL + && !strcmp (newsect->name, ".bss")) + { + obj_bsssec (abfd) = newsect; + newsect->target_index = N_BSS; + } + } /* We allow more than three sections internally. */ - return TRUE; + return _bfd_generic_new_section_hook (abfd, newsect); } bfd_boolean @@ -2376,7 +2387,8 @@ NAME (aout, find_nearest_line) (bfd *abfd, } int -NAME (aout, sizeof_headers) (bfd *abfd, bfd_boolean execable ATTRIBUTE_UNUSED) +NAME (aout, sizeof_headers) (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return adata (abfd).exec_bytes_size; } diff --git a/bfd/pe-arm-wince.c b/bfd/pe-arm-wince.c new file mode 100644 index 00000000000..a13594fd894 --- /dev/null +++ b/bfd/pe-arm-wince.c @@ -0,0 +1,37 @@ +/* BFD back-end for ARM WINCE PE files. + Copyright 2006 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + 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 2 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. */ + +#define TARGET_UNDERSCORE 0 +#define USER_LABEL_PREFIX "" + +#define TARGET_LITTLE_SYM arm_wince_pe_little_vec +#define TARGET_LITTLE_NAME "pe-arm-wince-little" +#define TARGET_BIG_SYM arm_wince_pe_big_vec +#define TARGET_BIG_NAME "pe-arm-wince-big" + +#define bfd_arm_allocate_interworking_sections \ + bfd_arm_wince_pe_allocate_interworking_sections +#define bfd_arm_get_bfd_for_interworking \ + bfd_arm_wince_pe_get_bfd_for_interworking +#define bfd_arm_process_before_allocation \ + bfd_arm_wince_pe_process_before_allocation + +#define LOCAL_LABEL_PREFIX "." + +#include "pe-arm.c" diff --git a/bfd/pe-arm.c b/bfd/pe-arm.c index dba9c1b40e4..5700e2382a8 100644 --- a/bfd/pe-arm.c +++ b/bfd/pe-arm.c @@ -1,5 +1,6 @@ /* BFD back-end for ARM PECOFF files. - Copyright 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1995, 1996, 1999, 2000, 2001, 2002, 2007 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +18,19 @@ 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 "bfd.h" +/* Do this before including bfd.h, so we prototype the right functions. */ + +#ifndef bfd_arm_allocate_interworking_sections +#define bfd_arm_allocate_interworking_sections \ + bfd_armpe_allocate_interworking_sections +#define bfd_arm_get_bfd_for_interworking \ + bfd_armpe_get_bfd_for_interworking +#define bfd_arm_process_before_allocation \ + bfd_armpe_process_before_allocation +#endif + #include "sysdep.h" +#include "bfd.h" #ifndef TARGET_LITTLE_SYM #define TARGET_LITTLE_SYM armpe_little_vec @@ -31,17 +43,22 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define PCRELOFFSET TRUE #define COFF_LONG_SECTION_NAMES -#ifndef bfd_arm_allocate_interworking_sections -#define bfd_arm_allocate_interworking_sections \ - bfd_arm_pe_allocate_interworking_sections -#define bfd_arm_get_bfd_for_interworking \ - bfd_arm_pe_get_bfd_for_interworking -#define bfd_arm_process_before_allocation \ - bfd_arm_pe_process_before_allocation -#endif - -#ifdef ARM_WINCE -#define TARGET_UNDERSCORE 0 -#endif +#define COFF_SECTION_ALIGNMENT_ENTRIES \ +{ COFF_SECTION_NAME_EXACT_MATCH (".bss"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".data"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".rdata"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".text"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".debug"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.wi."), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 } #include "coff-arm.c" diff --git a/bfd/pe-i386.c b/bfd/pe-i386.c index 7c102b42de8..72aacf0a893 100644 --- a/bfd/pe-i386.c +++ b/bfd/pe-i386.c @@ -1,5 +1,6 @@ /* BFD back-end for Intel 386 PECOFF files. - Copyright 1995, 1996, 1999, 2001, 2002, 2004 Free Software Foundation, Inc. + Copyright 1995, 1996, 1999, 2001, 2002, 2004, 2007 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #define TARGET_SYM i386pe_vec #define TARGET_NAME "pe-i386" @@ -34,10 +35,16 @@ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_EXACT_MATCH (".data"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".data$"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_EXACT_MATCH (".rdata"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".rdata$"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_EXACT_MATCH (".text"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".text$"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ { COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \ diff --git a/bfd/pe-mcore.c b/bfd/pe-mcore.c index 1f8a4146074..4dcf0765c54 100644 --- a/bfd/pe-mcore.c +++ b/bfd/pe-mcore.c @@ -1,5 +1,5 @@ /* BFD back-end for MCore PECOFF files. - Copyright 1999, 2002 Free Software Foundation, Inc. + Copyright 1999, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #ifndef TARGET_BIG_SYM #define TARGET_BIG_SYM mcore_pe_big_vec diff --git a/bfd/pe-mips.c b/bfd/pe-mips.c index 03d6beca981..628cecf9a71 100644 --- a/bfd/pe-mips.c +++ b/bfd/pe-mips.c @@ -1,6 +1,6 @@ /* BFD back-end for MIPS PE COFF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Modified from coff-i386.c by DJ Delorie, dj@cygnus.com This file is part of BFD, the Binary File Descriptor library. @@ -23,8 +23,8 @@ #define COFF_LONG_SECTION_NAMES #define PCRELOFFSET TRUE -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/mipspe.h" #include "coff/internal.h" @@ -453,6 +453,7 @@ coff_mips_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED, #define coff_rtype_to_howto coff_mips_rtype_to_howto #define coff_bfd_reloc_type_lookup coff_mips_reloc_type_lookup +#define coff_bfd_reloc_name_lookup coff_mips_reloc_name_lookup /* Get the howto structure for a generic reloc type. */ @@ -496,6 +497,22 @@ coff_mips_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return & howto_table [mips_type]; } +static reloc_howto_type * +coff_mips_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (howto_table) / sizeof (howto_table[0]); + i++) + if (howto_table[i].name != NULL + && strcasecmp (howto_table[i].name, r_name) == 0) + return &howto_table[i]; + + return NULL; +} + static void mips_swap_reloc_in (bfd * abfd, void * src, void * dst) { diff --git a/bfd/pe-ppc.c b/bfd/pe-ppc.c index 93cf6367c6e..fa6404e4a34 100644 --- a/bfd/pe-ppc.c +++ b/bfd/pe-ppc.c @@ -1,5 +1,5 @@ /* BFD back-end for PowerPC PECOFF files. - Copyright 1995, 1996, 1999, 2001 Free Software Foundation, Inc. + Copyright 1995, 1996, 1999, 2001, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #define E_FILENMLEN 18 diff --git a/bfd/pe-sh.c b/bfd/pe-sh.c index c0f81933b4d..d8f61b7d316 100644 --- a/bfd/pe-sh.c +++ b/bfd/pe-sh.c @@ -1,5 +1,5 @@ /* BFD back-end for SH PECOFF files. - Copyright 1995, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1995, 2000, 2001, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #define TARGET_SHL_SYM shlpe_vec #define TARGET_SHL_NAME "pe-shl" diff --git a/bfd/pe-x86_64.c b/bfd/pe-x86_64.c new file mode 100644 index 00000000000..0c6badf1a36 --- /dev/null +++ b/bfd/pe-x86_64.c @@ -0,0 +1,53 @@ +/* BFD back-end for Intel/AMD x86_64 PECOFF files. + Copyright 2006, 2007 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + 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 2 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. + + Written by Kai Tietz, OneVision Software GmbH&CoKg. */ + +#include "sysdep.h" +#include "bfd.h" + +#define TARGET_SYM x86_64pe_vec +#define TARGET_NAME "pe-x86-64" +#define COFF_WITH_PE +#define COFF_WITH_pex64 +#define PCRELOFFSET TRUE +#define TARGET_UNDERSCORE '_' +#define COFF_LONG_SECTION_NAMES +#define COFF_SUPPORT_GNU_LINKONCE +#define COFF_LONG_FILENAMES + +#define COFF_SECTION_ALIGNMENT_ENTRIES \ +{ COFF_SECTION_NAME_EXACT_MATCH (".bss"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".data"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".rdata"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".text"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".debug"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.wi."), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 } + +#include "coff-x86_64.c" diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c index 71300219d30..f96825f687e 100644 --- a/bfd/peXXigen.c +++ b/bfd/peXXigen.c @@ -1,6 +1,6 @@ /* Support for the generic parts of PE/PEI; the common executable parts. Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006 Free Software Foundation, Inc. + 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Solutions. This file is part of BFD, the Binary File Descriptor library. @@ -52,12 +52,12 @@ on this code has a chance of getting something accomplished without wasting too much time. */ -/* This expands into COFF_WITH_pe or COFF_WITH_pep depending on whether - we're compiling for straight PE or PE+. */ +/* This expands into COFF_WITH_pe, COFF_WITH_pep, or COFF_WITH_pex64 + depending on whether we're compiling for straight PE or PE+. */ #define COFF_WITH_XX -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/internal.h" @@ -67,7 +67,9 @@ within PE/PEI, so we get them from there. FIXME: The lack of variance is an assumption which may prove to be incorrect if new PE/PEI targets are created. */ -#ifdef COFF_WITH_pep +#if defined COFF_WITH_pex64 +# include "coff/x86_64.h" +#elif defined COFF_WITH_pep # include "coff/ia64.h" #else # include "coff/i386.h" @@ -77,7 +79,7 @@ #include "libcoff.h" #include "libpei.h" -#ifdef COFF_WITH_pep +#if defined COFF_WITH_pep || defined COFF_WITH_pex64 # undef AOUTSZ # define AOUTSZ PEPAOUTSZ # define PEAOUTHDR PEPAOUTHDR @@ -147,6 +149,7 @@ _bfd_XXi_swap_sym_in (bfd * abfd, void * ext1, void * in1) int unused_section_number = 0; asection *sec; char *name; + flagword flags; for (sec = abfd->sections; sec; sec = sec->next) if (unused_section_number <= sec->target_index) @@ -156,7 +159,8 @@ _bfd_XXi_swap_sym_in (bfd * abfd, void * ext1, void * in1) if (name == NULL) return; strcpy (name, in->n_name); - sec = bfd_make_section_anyway (abfd, name); + flags = SEC_HAS_CONTENTS | SEC_ALLOC | SEC_DATA | SEC_LOAD; + sec = bfd_make_section_anyway_with_flags (abfd, name, flags); sec->vma = 0; sec->lma = 0; @@ -169,7 +173,6 @@ _bfd_XXi_swap_sym_in (bfd * abfd, void * ext1, void * in1) sec->userdata = NULL; sec->next = NULL; sec->alignment_power = 2; - sec->flags = SEC_HAS_CONTENTS | SEC_ALLOC | SEC_DATA | SEC_LOAD; sec->target_index = unused_section_number; @@ -385,10 +388,11 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd, void * aouthdr_ext1, void * aouthdr_int1) { - struct internal_extra_pe_aouthdr *a; - PEAOUTHDR * src = (PEAOUTHDR *) (aouthdr_ext1); + PEAOUTHDR * src = (PEAOUTHDR *) aouthdr_ext1; AOUTHDR * aouthdr_ext = (AOUTHDR *) aouthdr_ext1; - struct internal_aouthdr *aouthdr_int = (struct internal_aouthdr *)aouthdr_int1; + struct internal_aouthdr *aouthdr_int + = (struct internal_aouthdr *) aouthdr_int1; + struct internal_extra_pe_aouthdr *a = &aouthdr_int->pe; aouthdr_int->magic = H_GET_16 (abfd, aouthdr_ext->magic); aouthdr_int->vstamp = H_GET_16 (abfd, aouthdr_ext->vstamp); @@ -398,13 +402,21 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd, aouthdr_int->entry = GET_AOUTHDR_ENTRY (abfd, aouthdr_ext->entry); aouthdr_int->text_start = GET_AOUTHDR_TEXT_START (abfd, aouthdr_ext->text_start); -#ifndef COFF_WITH_pep +#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) /* PE32+ does not have data_start member! */ aouthdr_int->data_start = GET_AOUTHDR_DATA_START (abfd, aouthdr_ext->data_start); + a->BaseOfData = aouthdr_int->data_start; #endif - a = &aouthdr_int->pe; + a->Magic = aouthdr_int->magic; + a->MajorLinkerVersion = H_GET_8 (abfd, aouthdr_ext->vstamp); + a->MinorLinkerVersion = H_GET_8 (abfd, aouthdr_ext->vstamp + 1); + a->SizeOfCode = aouthdr_int->tsize ; + a->SizeOfInitializedData = aouthdr_int->dsize ; + a->SizeOfUninitializedData = aouthdr_int->bsize ; + a->AddressOfEntryPoint = aouthdr_int->entry; + a->BaseOfCode = aouthdr_int->text_start; a->ImageBase = GET_OPTHDR_IMAGE_BASE (abfd, src->ImageBase); a->SectionAlignment = H_GET_32 (abfd, src->SectionAlignment); a->FileAlignment = H_GET_32 (abfd, src->FileAlignment); @@ -441,6 +453,7 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd, /* If data directory is empty, rva also should be 0. */ int size = H_GET_32 (abfd, src->DataDirectory[idx][1]); + a->DataDirectory[idx].Size = size; if (size) @@ -454,7 +467,7 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd, if (aouthdr_int->entry) { aouthdr_int->entry += a->ImageBase; -#ifndef COFF_WITH_pep +#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) aouthdr_int->entry &= 0xffffffff; #endif } @@ -462,12 +475,12 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd, if (aouthdr_int->tsize) { aouthdr_int->text_start += a->ImageBase; -#ifndef COFF_WITH_pep +#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) aouthdr_int->text_start &= 0xffffffff; #endif } -#ifndef COFF_WITH_pep +#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) /* PE32+ does not have data_start member! */ if (aouthdr_int->dsize) { @@ -480,9 +493,9 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd, /* These three fields are normally set up by ppc_relocate_section. In the case of reading a file in, we can pick them up from the DataDirectory. */ - first_thunk_address = a->DataDirectory[12].VirtualAddress; - thunk_size = a->DataDirectory[12].Size; - import_table_size = a->DataDirectory[1].Size; + first_thunk_address = a->DataDirectory[PE_IMPORT_ADDRESS_TABLE].VirtualAddress; + thunk_size = a->DataDirectory[PE_IMPORT_ADDRESS_TABLE].Size; + import_table_size = a->DataDirectory[PE_IMPORT_TABLE].Size; #endif } @@ -540,14 +553,14 @@ _bfd_XXi_swap_aouthdr_out (bfd * abfd, void * in, void * out) fa = extra->FileAlignment; ib = extra->ImageBase; - idata2 = pe->pe_opthdr.DataDirectory[1]; - idata5 = pe->pe_opthdr.DataDirectory[12]; - tls = pe->pe_opthdr.DataDirectory[9]; + idata2 = pe->pe_opthdr.DataDirectory[PE_IMPORT_TABLE]; + idata5 = pe->pe_opthdr.DataDirectory[PE_IMPORT_ADDRESS_TABLE]; + tls = pe->pe_opthdr.DataDirectory[PE_TLS_TABLE]; if (aouthdr_in->tsize) { aouthdr_in->text_start -= ib; -#ifndef COFF_WITH_pep +#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) aouthdr_in->text_start &= 0xffffffff; #endif } @@ -555,7 +568,7 @@ _bfd_XXi_swap_aouthdr_out (bfd * abfd, void * in, void * out) if (aouthdr_in->dsize) { aouthdr_in->data_start -= ib; -#ifndef COFF_WITH_pep +#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) aouthdr_in->data_start &= 0xffffffff; #endif } @@ -563,7 +576,7 @@ _bfd_XXi_swap_aouthdr_out (bfd * abfd, void * in, void * out) if (aouthdr_in->entry) { aouthdr_in->entry -= ib; -#ifndef COFF_WITH_pep +#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) aouthdr_in->entry &= 0xffffffff; #endif } @@ -592,11 +605,11 @@ _bfd_XXi_swap_aouthdr_out (bfd * abfd, void * in, void * out) So - we copy the input values into the output values, and then, if a final link is going to be performed, it can overwrite them. */ - extra->DataDirectory[1] = idata2; - extra->DataDirectory[12] = idata5; - extra->DataDirectory[9] = tls; + extra->DataDirectory[PE_IMPORT_TABLE] = idata2; + extra->DataDirectory[PE_IMPORT_ADDRESS_TABLE] = idata5; + extra->DataDirectory[PE_TLS_TABLE] = tls; - if (extra->DataDirectory[1].VirtualAddress == 0) + if (extra->DataDirectory[PE_IMPORT_TABLE].VirtualAddress == 0) /* Until other .idata fixes are made (pending patch), the entry for .idata is needed for backwards compatibility. FIXME. */ add_data_entry (abfd, extra, 1, ".idata", ib); @@ -632,16 +645,22 @@ _bfd_XXi_swap_aouthdr_out (bfd * abfd, void * in, void * out) in the virt_size field). Files have been seen (from MSVC 5.0 link.exe) where the file size of the .data segment is quite small compared to the virtual size. Without this - fix, strip munges the file. */ + fix, strip munges the file. + + FIXME: We need to handle holes between sections, which may + happpen when we covert from another format. We just use + the virtual address and virtual size of the last section + for the image size. */ if (coff_section_data (abfd, sec) != NULL && pei_section_data (abfd, sec) != NULL) - isize += SA (FA (pei_section_data (abfd, sec)->virt_size)); + isize = (sec->vma - extra->ImageBase + + SA (FA (pei_section_data (abfd, sec)->virt_size))); } aouthdr_in->dsize = dsize; aouthdr_in->tsize = tsize; extra->SizeOfHeaders = hsize; - extra->SizeOfImage = SA (hsize) + isize; + extra->SizeOfImage = isize; } H_PUT_16 (abfd, aouthdr_in->magic, aouthdr_out->standard.magic); @@ -660,7 +679,7 @@ _bfd_XXi_swap_aouthdr_out (bfd * abfd, void * in, void * out) PUT_AOUTHDR_TEXT_START (abfd, aouthdr_in->text_start, aouthdr_out->standard.text_start); -#ifndef COFF_WITH_pep +#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) /* PE32+ does not have data_start member! */ PUT_AOUTHDR_DATA_START (abfd, aouthdr_in->data_start, aouthdr_out->standard.data_start); @@ -1017,7 +1036,7 @@ static char * dir_names[IMAGE_NUMBEROF_DIRECTORY_ENTRIES] = N_("Bound Import Directory"), N_("Import Address Table Directory"), N_("Delay Import Directory"), - N_("Reserved"), + N_("CLR Runtime Header"), N_("Reserved") }; @@ -1051,9 +1070,9 @@ pe_print_idata (bfd * abfd, void * vfile) bfd_vma addr; - addr = extra->DataDirectory[1].VirtualAddress; + addr = extra->DataDirectory[PE_IMPORT_TABLE].VirtualAddress; - if (addr == 0 && extra->DataDirectory[1].Size == 0) + if (addr == 0 && extra->DataDirectory[PE_IMPORT_TABLE].Size == 0) { /* Maybe the extra header isn't there. Look for the section. */ section = bfd_get_section_by_name (abfd, ".idata"); @@ -1171,7 +1190,7 @@ pe_print_idata (bfd * abfd, void * vfile) bfd_size_type j; char *dll; - /* Print (i + extra->DataDirectory[1].VirtualAddress). */ + /* Print (i + extra->DataDirectory[PE_IMPORT_TABLE].VirtualAddress). */ fprintf (file, " %08lx\t", (unsigned long) (i + adj + dataoff)); hint_addr = bfd_get_32 (abfd, data + i + dataoff); time_stamp = bfd_get_32 (abfd, data + i + 4 + dataoff); @@ -1212,8 +1231,8 @@ pe_print_idata (bfd * abfd, void * vfile) ft_data = data; ft_idx = first_thunk - adj; ft_allocated = 0; - - if (first_thunk != hint_addr) + + if (first_thunk != hint_addr) { /* Find the section which contains the first thunk. */ for (ft_section = abfd->sections; @@ -1261,6 +1280,38 @@ pe_print_idata (bfd * abfd, void * vfile) } /* Print HintName vector entries. */ +#ifdef COFF_WITH_pex64 + for (j = 0; j < datasize; j += 8) + { + unsigned long member = bfd_get_32 (abfd, data + idx + j); + unsigned long member_high = bfd_get_32 (abfd, data + idx + j + 4); + + if (!member && !member_high) + break; + + if (member_high & 0x80000000) + fprintf (file, "\t%lx%08lx\t %4lx%08lx ", + member_high,member, member_high & 0x7fffffff, member); + else + { + int ordinal; + char *member_name; + + ordinal = bfd_get_16 (abfd, data + member - adj); + member_name = (char *) data + member - adj + 2; + fprintf (file, "\t%04lx\t %4d %s",member, ordinal, member_name); + } + + /* If the time stamp is not zero, the import address + table holds actual addresses. */ + if (time_stamp != 0 + && first_thunk != 0 + && first_thunk != hint_addr) + fprintf (file, "\t%04lx", + (long) bfd_get_32 (abfd, ft_data + ft_idx + j)); + fprintf (file, "\n"); + } +#else for (j = 0; j < datasize; j += 4) { unsigned long member = bfd_get_32 (abfd, data + idx + j); @@ -1293,7 +1344,7 @@ pe_print_idata (bfd * abfd, void * vfile) fprintf (file, "\n"); } - +#endif if (ft_allocated) free (ft_data); } @@ -1336,9 +1387,9 @@ pe_print_edata (bfd * abfd, void * vfile) bfd_vma addr; - addr = extra->DataDirectory[0].VirtualAddress; + addr = extra->DataDirectory[PE_EXPORT_TABLE].VirtualAddress; - if (addr == 0 && extra->DataDirectory[0].Size == 0) + if (addr == 0 && extra->DataDirectory[PE_EXPORT_TABLE].Size == 0) { /* Maybe the extra header isn't there. Look for the section. */ section = bfd_get_section_by_name (abfd, ".edata"); @@ -1367,7 +1418,7 @@ pe_print_edata (bfd * abfd, void * vfile) } dataoff = addr - section->vma; - datasize = extra->DataDirectory[0].Size; + datasize = extra->DataDirectory[PE_EXPORT_TABLE].Size; if (datasize > section->size - dataoff) { fprintf (file, @@ -1533,10 +1584,10 @@ pe_print_edata (bfd * abfd, void * vfile) static bfd_boolean pe_print_pdata (bfd * abfd, void * vfile) { -#ifdef COFF_WITH_pep -# define PDATA_ROW_SIZE (3*8) +#if defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) +# define PDATA_ROW_SIZE (3 * 8) #else -# define PDATA_ROW_SIZE (5*4) +# define PDATA_ROW_SIZE (5 * 4) #endif FILE *file = (FILE *) vfile; bfd_byte *data = 0; @@ -1559,7 +1610,7 @@ pe_print_pdata (bfd * abfd, void * vfile) fprintf (file, _("\nThe Function Table (interpreted .pdata section contents)\n")); -#ifdef COFF_WITH_pep +#if defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) fprintf (file, _(" vma:\t\t\tBegin Address End Address Unwind Info\n")); #else @@ -1613,7 +1664,7 @@ pe_print_pdata (bfd * abfd, void * vfile) fprintf_vma (file, begin_addr); fputc (' ', file); fprintf_vma (file, end_addr); fputc (' ', file); fprintf_vma (file, eh_handler); -#ifndef COFF_WITH_pep +#if !defined(COFF_WITH_pep) || defined(COFF_WITH_pex64) fputc (' ', file); fprintf_vma (file, eh_data); fputc (' ', file); fprintf_vma (file, prolog_end_addr); @@ -1766,6 +1817,7 @@ _bfd_XX_print_private_bfd_data_common (bfd * abfd, void * vfile) pe_data_type *pe = pe_data (abfd); struct internal_extra_pe_aouthdr *i = &pe->pe_opthdr; const char *subsystem_name = NULL; + const char *name; /* The MS dumpbin program reportedly ands with 0xff0f before printing the characteristics field. Not sure why. No reason to @@ -1791,6 +1843,52 @@ _bfd_XX_print_private_bfd_data_common (bfd * abfd, void * vfile) time_t t = pe->coff.timestamp; fprintf (file, "\nTime/Date\t\t%s", ctime (&t)); } + +#ifndef IMAGE_NT_OPTIONAL_HDR_MAGIC +# define IMAGE_NT_OPTIONAL_HDR_MAGIC 0x10b +#endif +#ifndef IMAGE_NT_OPTIONAL_HDR64_MAGIC +# define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b +#endif +#ifndef IMAGE_NT_OPTIONAL_HDRROM_MAGIC +# define IMAGE_NT_OPTIONAL_HDRROM_MAGIC 0x107 +#endif + + switch (i->Magic) + { + case IMAGE_NT_OPTIONAL_HDR_MAGIC: + name = "PE32"; + break; + case IMAGE_NT_OPTIONAL_HDR64_MAGIC: + name = "PE32+"; + break; + case IMAGE_NT_OPTIONAL_HDRROM_MAGIC: + name = "ROM"; + break; + default: + name = NULL; + break; + } + fprintf (file, "Magic\t\t\t%04x", i->Magic); + if (name) + fprintf (file, "\t(%s)",name); + fprintf (file, "\nMajorLinkerVersion\t%d\n", i->MajorLinkerVersion); + fprintf (file, "MinorLinkerVersion\t%d\n", i->MinorLinkerVersion); + fprintf (file, "SizeOfCode\t\t%08lx\n", i->SizeOfCode); + fprintf (file, "SizeOfInitializedData\t%08lx\n", + i->SizeOfInitializedData); + fprintf (file, "SizeOfUninitializedData\t%08lx\n", + i->SizeOfUninitializedData); + fprintf (file, "AddressOfEntryPoint\t"); + fprintf_vma (file, i->AddressOfEntryPoint); + fprintf (file, "\nBaseOfCode\t\t"); + fprintf_vma (file, i->BaseOfCode); +#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) + /* PE32+ does not have BaseOfData member! */ + fprintf (file, "\nBaseOfData\t\t"); + fprintf_vma (file, i->BaseOfData); +#endif + fprintf (file, "\nImageBase\t\t"); fprintf_vma (file, i->ImageBase); fprintf (file, "\nSectionAlignment\t"); @@ -1837,6 +1935,16 @@ _bfd_XX_print_private_bfd_data_common (bfd * abfd, void * vfile) case IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER: subsystem_name = "EFI runtime driver"; break; + // These are from revision 8.0 of the MS PE/COFF spec + case IMAGE_SUBSYSTEM_EFI_ROM: + subsystem_name = "EFI ROM"; + break; + case IMAGE_SUBSYSTEM_XBOX: + subsystem_name = "XBOX"; + break; + // Added default case for clarity - subsystem_name is NULL anyway. + default: + subsystem_name = NULL; } fprintf (file, "Subsystem\t\t%08x", i->Subsystem); @@ -1889,8 +1997,8 @@ _bfd_XX_bfd_copy_private_bfd_data_common (bfd * ibfd, bfd * obfd) if we don't remove this entry as well. */ if (! pe_data (obfd)->has_reloc_section) { - pe_data (obfd)->pe_opthdr.DataDirectory[5].VirtualAddress = 0; - pe_data (obfd)->pe_opthdr.DataDirectory[5].Size = 0; + pe_data (obfd)->pe_opthdr.DataDirectory[PE_BASE_RELOCATION_TABLE].VirtualAddress = 0; + pe_data (obfd)->pe_opthdr.DataDirectory[PE_BASE_RELOCATION_TABLE].Size = 0; } return TRUE; } @@ -1949,6 +2057,7 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo) { struct coff_link_hash_entry *h1; struct bfd_link_info *info = pfinfo->info; + bfd_boolean result = TRUE; /* There are a few fields that need to be filled in now while we have symbol table access. @@ -1962,49 +2071,103 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo) ".idata$2", FALSE, FALSE, TRUE); if (h1 != NULL) { - pe_data (abfd)->pe_opthdr.DataDirectory[1].VirtualAddress = - (h1->root.u.def.value - + h1->root.u.def.section->output_section->vma - + h1->root.u.def.section->output_offset); + /* PR ld/2729: We cannot rely upon all the output sections having been + created properly, so check before referencing them. Issue a warning + message for any sections tht could not be found. */ + if (h1->root.u.def.section != NULL + && h1->root.u.def.section->output_section != NULL) + pe_data (abfd)->pe_opthdr.DataDirectory[PE_IMPORT_TABLE].VirtualAddress = + (h1->root.u.def.value + + h1->root.u.def.section->output_section->vma + + h1->root.u.def.section->output_offset); + else + { + _bfd_error_handler + (_("%B: unable to fill in DataDictionary[1] because .idata$2 is missing"), + abfd); + result = FALSE; + } + h1 = coff_link_hash_lookup (coff_hash_table (info), ".idata$4", FALSE, FALSE, TRUE); - pe_data (abfd)->pe_opthdr.DataDirectory[1].Size = - ((h1->root.u.def.value - + h1->root.u.def.section->output_section->vma - + h1->root.u.def.section->output_offset) - - pe_data (abfd)->pe_opthdr.DataDirectory[1].VirtualAddress); + if (h1 != NULL + && h1->root.u.def.section != NULL + && h1->root.u.def.section->output_section != NULL) + pe_data (abfd)->pe_opthdr.DataDirectory[PE_IMPORT_TABLE].Size = + ((h1->root.u.def.value + + h1->root.u.def.section->output_section->vma + + h1->root.u.def.section->output_offset) + - pe_data (abfd)->pe_opthdr.DataDirectory[PE_IMPORT_TABLE].VirtualAddress); + else + { + _bfd_error_handler + (_("%B: unable to fill in DataDictionary[1] because .idata$4 is missing"), + abfd); + result = FALSE; + } /* The import address table. This is the size/address of .idata$5. */ h1 = coff_link_hash_lookup (coff_hash_table (info), ".idata$5", FALSE, FALSE, TRUE); - pe_data (abfd)->pe_opthdr.DataDirectory[12].VirtualAddress = - (h1->root.u.def.value - + h1->root.u.def.section->output_section->vma - + h1->root.u.def.section->output_offset); + if (h1 != NULL + && h1->root.u.def.section != NULL + && h1->root.u.def.section->output_section != NULL) + pe_data (abfd)->pe_opthdr.DataDirectory[PE_IMPORT_ADDRESS_TABLE].VirtualAddress = + (h1->root.u.def.value + + h1->root.u.def.section->output_section->vma + + h1->root.u.def.section->output_offset); + else + { + _bfd_error_handler + (_("%B: unable to fill in DataDictionary[12] because .idata$5 is missing"), + abfd); + result = FALSE; + } + h1 = coff_link_hash_lookup (coff_hash_table (info), ".idata$6", FALSE, FALSE, TRUE); - pe_data (abfd)->pe_opthdr.DataDirectory[12].Size = - ((h1->root.u.def.value - + h1->root.u.def.section->output_section->vma - + h1->root.u.def.section->output_offset) - - pe_data (abfd)->pe_opthdr.DataDirectory[12].VirtualAddress); + if (h1 != NULL + && h1->root.u.def.section != NULL + && h1->root.u.def.section->output_section != NULL) + pe_data (abfd)->pe_opthdr.DataDirectory[PE_IMPORT_ADDRESS_TABLE].Size = + ((h1->root.u.def.value + + h1->root.u.def.section->output_section->vma + + h1->root.u.def.section->output_offset) + - pe_data (abfd)->pe_opthdr.DataDirectory[PE_IMPORT_ADDRESS_TABLE].VirtualAddress); + else + { + _bfd_error_handler + (_("%B: unable to fill in DataDictionary[PE_IMPORT_ADDRESS_TABLE (12)] because .idata$6 is missing"), + abfd); + result = FALSE; + } } h1 = coff_link_hash_lookup (coff_hash_table (info), "__tls_used", FALSE, FALSE, TRUE); if (h1 != NULL) { - pe_data (abfd)->pe_opthdr.DataDirectory[9].VirtualAddress = - (h1->root.u.def.value - + h1->root.u.def.section->output_section->vma - + h1->root.u.def.section->output_offset - - pe_data (abfd)->pe_opthdr.ImageBase); - pe_data (abfd)->pe_opthdr.DataDirectory[9].Size = 0x18; + if (h1->root.u.def.section != NULL + && h1->root.u.def.section->output_section != NULL) + pe_data (abfd)->pe_opthdr.DataDirectory[PE_TLS_TABLE].VirtualAddress = + (h1->root.u.def.value + + h1->root.u.def.section->output_section->vma + + h1->root.u.def.section->output_offset + - pe_data (abfd)->pe_opthdr.ImageBase); + else + { + _bfd_error_handler + (_("%B: unable to fill in DataDictionary[9] because __tls_used is missing"), + abfd); + result = FALSE; + } + + pe_data (abfd)->pe_opthdr.DataDirectory[PE_TLS_TABLE].Size = 0x18; } /* If we couldn't find idata$2, we either have an excessively trivial program or are in DEEP trouble; we have to assume trivial program.... */ - return TRUE; + return result; } diff --git a/bfd/pef.c b/bfd/pef.c index 2aca6a445b7..fc345e955bc 100644 --- a/bfd/pef.c +++ b/bfd/pef.c @@ -1,5 +1,5 @@ /* PEF support for BFD. - Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,11 +18,11 @@ 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 "safe-ctype.h" #include "pef.h" #include "pef-traceback.h" #include "bfd.h" -#include "sysdep.h" #include "libbfd.h" #include "libiberty.h" @@ -41,9 +41,6 @@ #define bfd_pef_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define bfd_pef_read_minisymbols _bfd_generic_read_minisymbols #define bfd_pef_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol -#define bfd_pef_get_reloc_upper_bound _bfd_norelocs_get_reloc_upper_bound -#define bfd_pef_canonicalize_reloc _bfd_norelocs_canonicalize_reloc -#define bfd_pef_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup #define bfd_pef_set_arch_mach _bfd_generic_set_arch_mach #define bfd_pef_get_section_contents _bfd_generic_get_section_contents #define bfd_pef_set_section_contents _bfd_generic_set_section_contents @@ -209,7 +206,7 @@ bfd_pef_print_symbol (bfd *abfd, default: bfd_print_symbol_vandf (abfd, (void *) file, symbol); fprintf (file, " %-5s %s", symbol->section->name, symbol->name); - if (strncmp (symbol->name, "__traceback_", strlen ("__traceback_")) == 0) + if (CONST_STRNEQ (symbol->name, "__traceback_")) { unsigned char *buf = alloca (symbol->udata.i); size_t offset = symbol->value + 4; @@ -987,11 +984,7 @@ bfd_pef_canonicalize_symtab (bfd *abfd, asymbol **alocation) return ret; } -static asymbol * -bfd_pef_make_empty_symbol (bfd *abfd) -{ - return bfd_alloc (abfd, sizeof (asymbol)); -} +#define bfd_pef_make_empty_symbol _bfd_generic_make_empty_symbol static void bfd_pef_get_symbol_info (bfd *abfd ATTRIBUTE_UNUSED, @@ -1002,7 +995,8 @@ bfd_pef_get_symbol_info (bfd *abfd ATTRIBUTE_UNUSED, } static int -bfd_pef_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, bfd_boolean exec ATTRIBUTE_UNUSED) +bfd_pef_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return 0; } @@ -1051,7 +1045,7 @@ const bfd_target pef_vec = BFD_JUMP_TABLE_CORE (_bfd_nocore), BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), BFD_JUMP_TABLE_SYMBOLS (bfd_pef), - BFD_JUMP_TABLE_RELOCS (bfd_pef), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), BFD_JUMP_TABLE_WRITE (bfd_pef), BFD_JUMP_TABLE_LINK (bfd_pef), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), diff --git a/bfd/pei-arm-wince.c b/bfd/pei-arm-wince.c new file mode 100644 index 00000000000..7d5a3be3515 --- /dev/null +++ b/bfd/pei-arm-wince.c @@ -0,0 +1,30 @@ +/* BFD back-end for ARM WINCE PE IMAGE COFF files. + Copyright 2006 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + 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 2 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. */ + +#define TARGET_UNDERSCORE 0 +#define USER_LABEL_PREFIX "" + +#define TARGET_LITTLE_SYM arm_wince_pei_little_vec +#define TARGET_LITTLE_NAME "pei-arm-wince-little" +#define TARGET_BIG_SYM arm_wince_pei_big_vec +#define TARGET_BIG_NAME "pei-arm-wince-big" + +#define LOCAL_LABEL_PREFIX "." + +#include "pei-arm.c" diff --git a/bfd/pei-arm.c b/bfd/pei-arm.c index 38d3367cef6..299eda20ad8 100644 --- a/bfd/pei-arm.c +++ b/bfd/pei-arm.c @@ -1,5 +1,5 @@ /* BFD back-end for arm PE IMAGE COFF files. - Copyright 1995, 1996, 1999, 2002 Free Software Foundation, Inc. + Copyright 1995, 1996, 1999, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #ifndef TARGET_LITTLE_SYM #define TARGET_LITTLE_SYM armpei_little_vec @@ -32,4 +32,22 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define PCRELOFFSET TRUE #define COFF_LONG_SECTION_NAMES +#define COFF_SECTION_ALIGNMENT_ENTRIES \ +{ COFF_SECTION_NAME_EXACT_MATCH (".bss"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".data"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".rdata"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".text"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".debug"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.wi."), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 } + #include "coff-arm.c" diff --git a/bfd/pei-i386.c b/bfd/pei-i386.c index 38e36f3689d..9892f1c0976 100644 --- a/bfd/pei-i386.c +++ b/bfd/pei-i386.c @@ -1,5 +1,6 @@ /* BFD back-end for Intel 386 PE IMAGE COFF files. - Copyright 1995, 1996, 1999, 2002, 2004 Free Software Foundation, Inc. + Copyright 1995, 1996, 1999, 2002, 2004, 2007 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #define TARGET_SYM i386pei_vec #define TARGET_NAME "pei-i386" @@ -35,10 +36,16 @@ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_EXACT_MATCH (".data"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".data$"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_EXACT_MATCH (".rdata"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".rdata$"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_EXACT_MATCH (".text"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".text$"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ { COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \ diff --git a/bfd/pei-mcore.c b/bfd/pei-mcore.c index e71bc11cf6b..a78f0633910 100644 --- a/bfd/pei-mcore.c +++ b/bfd/pei-mcore.c @@ -1,5 +1,5 @@ /* BFD back-end for MCore PECOFF files. - Copyright 1999, 2002 Free Software Foundation, Inc. + Copyright 1999, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #ifndef TARGET_BIG_SYM #define TARGET_BIG_SYM mcore_pei_big_vec diff --git a/bfd/pei-mips.c b/bfd/pei-mips.c index 0c9b962f2b6..4405c0af217 100644 --- a/bfd/pei-mips.c +++ b/bfd/pei-mips.c @@ -1,5 +1,5 @@ /* BFD back-end for MIPS PE IMAGE COFF files. - Copyright 1995, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1995, 2000, 2001, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #define TARGET_SYM mipslpei_vec #define TARGET_NAME "pei-mips" diff --git a/bfd/pei-ppc.c b/bfd/pei-ppc.c index 58d65e285d0..0f572f0c089 100644 --- a/bfd/pei-ppc.c +++ b/bfd/pei-ppc.c @@ -1,5 +1,5 @@ /* BFD back-end for PowerPC PE IMAGE COFF files. - Copyright 1995, 1996, 1999 Free Software Foundation, Inc. + Copyright 1995, 1996, 1999, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" /* setting up for a PE environment stolen directly from the i386 structure */ #define E_FILNMLEN 18 /* # characters in a file name */ diff --git a/bfd/pei-sh.c b/bfd/pei-sh.c index 61a3ed06eb6..acbea9ae36d 100644 --- a/bfd/pei-sh.c +++ b/bfd/pei-sh.c @@ -1,5 +1,5 @@ /* BFD back-end for SH PE IMAGE COFF files. - Copyright 1995, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1995, 2000, 2001, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #define TARGET_SHL_SYM shlpei_vec #define TARGET_SHL_NAME "pei-shl" diff --git a/bfd/pei-x86_64.c b/bfd/pei-x86_64.c new file mode 100644 index 00000000000..37d9c7f2e54 --- /dev/null +++ b/bfd/pei-x86_64.c @@ -0,0 +1,54 @@ +/* BFD back-end for Intel 386 PE IMAGE COFF files. + Copyright 2006, 2007 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + 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 2 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. + + Written by Kai Tietz, OneVision Software GmbH&CoKg. */ + +#include "sysdep.h" +#include "bfd.h" + +#define TARGET_SYM x86_64pei_vec +#define TARGET_NAME "pei-x86-64" +#define COFF_IMAGE_WITH_PE +#define COFF_WITH_PE +#define COFF_WITH_pex64 +#define PCRELOFFSET TRUE +#define TARGET_UNDERSCORE '_' +#define COFF_LONG_SECTION_NAMES +#define COFF_SUPPORT_GNU_LINKONCE +#define COFF_LONG_FILENAMES + +#define COFF_SECTION_ALIGNMENT_ENTRIES \ +{ COFF_SECTION_NAME_EXACT_MATCH (".bss"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".data"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".rdata"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".text"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".debug"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.wi."), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 } + +#include "coff-x86_64.c" diff --git a/bfd/peicode.h b/bfd/peicode.h index 2061f415af6..0f4858f4bfb 100644 --- a/bfd/peicode.h +++ b/bfd/peicode.h @@ -1,6 +1,6 @@ /* Support for the generic parts of PE/PEI, for BFD. Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005 Free Software Foundation, Inc. + 2005, 2006 Free Software Foundation, Inc. Written by Cygnus Solutions. This file is part of BFD, the Binary File Descriptor library. @@ -182,6 +182,10 @@ coff_swap_filehdr_in (bfd * abfd, void * src, void * dst) #ifdef COFF_IMAGE_WITH_PE # define coff_swap_filehdr_out _bfd_XXi_only_swap_filehdr_out +#elif defined COFF_WITH_pex64 +# define coff_swap_filehdr_out _bfd_pex64_only_swap_filehdr_out +#elif defined COFF_WITH_pep +# define coff_swap_filehdr_out _bfd_pep_only_swap_filehdr_out #else # define coff_swap_filehdr_out _bfd_pe_only_swap_filehdr_out #endif @@ -217,7 +221,10 @@ coff_swap_scnhdr_in (bfd * abfd, void * ext, void * in) if (scnhdr_int->s_vaddr != 0) { scnhdr_int->s_vaddr += pe_data (abfd)->pe_opthdr.ImageBase; + /* Do not cut upper 32-bits for 64-bit vma. */ +#ifndef COFF_WITH_pex64 scnhdr_int->s_vaddr &= 0xffffffff; +#endif } #ifndef COFF_NO_HACK_SCNHDR_SIZE @@ -405,8 +412,16 @@ pe_bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd) + NUM_ILF_SECTIONS * 9 \ + STRING_SIZE_SIZE) #define SIZEOF_IDATA2 (5 * 4) + +/* For PEx64 idata4 & 5 have thumb size of 8 bytes. */ +#ifdef COFF_WITH_pex64 +#define SIZEOF_IDATA4 (2 * 4) +#define SIZEOF_IDATA5 (2 * 4) +#else #define SIZEOF_IDATA4 (1 * 4) #define SIZEOF_IDATA5 (1 * 4) +#endif + #define SIZEOF_IDATA6 (2 + strlen (symbol_name) + 1 + 1) #define SIZEOF_IDATA7 (strlen (source_dll) + 1 + 1) #define SIZEOF_ILF_SECTIONS (NUM_ILF_SECTIONS * sizeof (struct coff_section_tdata)) @@ -656,9 +671,20 @@ static jump_table jtab[] = }, #endif -#ifdef MC68MAGIC - { MC68MAGIC, { /* XXX fill me in */ }, 0, 0 }, +#ifdef AMD64MAGIC + { AMD64MAGIC, + { 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x90, 0x90 }, + 8, 2 + }, #endif + +#ifdef MC68MAGIC + { MC68MAGIC, + { /* XXX fill me in */ }, + 0, 0 + }, +#endif + #ifdef MIPS_ARCH_MAGIC_WINCE { MIPS_ARCH_MAGIC_WINCE, { 0x00, 0x00, 0x08, 0x3c, 0x00, 0x00, 0x08, 0x8d, @@ -830,8 +856,15 @@ pe_ILF_build_a_bfd (bfd * abfd, /* XXX - treat as IMPORT_NAME ??? */ abort (); +#ifdef COFF_WITH_pex64 + ((unsigned int *) id4->contents)[0] = ordinal; + ((unsigned int *) id4->contents)[1] = 0x80000000; + ((unsigned int *) id5->contents)[0] = ordinal; + ((unsigned int *) id5->contents)[1] = 0x80000000; +#else * (unsigned int *) id4->contents = ordinal | 0x80000000; * (unsigned int *) id5->contents = ordinal | 0x80000000; +#endif } else { @@ -1071,6 +1104,12 @@ pe_ILF_object_p (bfd * abfd) #endif break; + case IMAGE_FILE_MACHINE_AMD64: +#ifdef AMD64MAGIC + magic = AMD64MAGIC; +#endif + break; + case IMAGE_FILE_MACHINE_M68K: #ifdef MC68AGIC magic = MC68MAGIC; @@ -1195,6 +1234,25 @@ pe_ILF_object_p (bfd * abfd) return abfd->xvec; } +enum arch_type +{ + arch_type_unknown, + arch_type_i386, + arch_type_x86_64 +}; + +static enum arch_type +pe_arch (const char *arch) +{ + if (strcmp (arch, "i386") == 0 || strcmp (arch, "ia32") == 0) + return arch_type_i386; + + if (strcmp (arch, "x86_64") == 0 || strcmp (arch, "x86-64") == 0) + return arch_type_x86_64; + + return arch_type_unknown; +} + static const bfd_target * pe_bfd_object_p (bfd * abfd) { @@ -1202,6 +1260,7 @@ pe_bfd_object_p (bfd * abfd) struct external_PEI_DOS_hdr dos_hdr; struct external_PEI_IMAGE_hdr image_hdr; file_ptr offset; + const bfd_target *target; /* Detect if this a Microsoft Import Library Format element. */ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 @@ -1266,7 +1325,60 @@ pe_bfd_object_p (bfd * abfd) return NULL; } - return coff_object_p (abfd); + target = coff_object_p (abfd); + if (target) + { + pe_data_type *pe = pe_data (abfd); + struct internal_extra_pe_aouthdr *i = &pe->pe_opthdr; + bfd_boolean efi = i->Subsystem == IMAGE_SUBSYSTEM_EFI_APPLICATION; + enum arch_type arch; + const bfd_target * const *target_ptr; + + /* Get the machine. */ + if (bfd_target_efi_p (abfd->xvec)) + arch = pe_arch (bfd_target_efi_arch (abfd->xvec)); + else + arch = pe_arch (bfd_target_pei_arch (abfd->xvec)); + + for (target_ptr = bfd_target_vector; *target_ptr != NULL; + target_ptr++) + { + if (*target_ptr == target + || (*target_ptr)->flavour != bfd_target_coff_flavour) + continue; + + if (bfd_target_efi_p (*target_ptr)) + { + /* Skip incompatible arch. */ + if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch) + continue; + + if (efi) + { + /* TARGET_PTR is an EFI backend. Don't match + TARGET with a EFI file. */ + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + } + else if (bfd_target_pei_p (*target_ptr)) + { + /* Skip incompatible arch. */ + if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch) + continue; + + if (!efi) + { + /* TARGET_PTR is a PE backend. Don't match + TARGET with a PE file. */ + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + } + } + } + + return target; } #define coff_object_p pe_bfd_object_p diff --git a/bfd/po/BLD-POTFILES.in b/bfd/po/BLD-POTFILES.in index 2dbe723a50e..07ad4b3602f 100644 --- a/bfd/po/BLD-POTFILES.in +++ b/bfd/po/BLD-POTFILES.in @@ -5,4 +5,5 @@ elf64-ia64.c elf64-target.h peigen.c pepigen.c +pex64igen.c targmatch.h diff --git a/bfd/po/Make-in b/bfd/po/Make-in index f11ccb41cef..1a619929557 100644 --- a/bfd/po/Make-in +++ b/bfd/po/Make-in @@ -16,6 +16,7 @@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ +top_builddir = @top_builddir@ prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -78,7 +79,7 @@ INSTOBJEXT = @INSTOBJEXT@ $(MSGFMT) -o $@ $< .po.gmo: - file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ + file=`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: diff --git a/bfd/po/SRC-POTFILES.in b/bfd/po/SRC-POTFILES.in index 8bcf979a5bf..5a3d361747c 100644 --- a/bfd/po/SRC-POTFILES.in +++ b/bfd/po/SRC-POTFILES.in @@ -57,6 +57,7 @@ coff-tic80.c coff-u68k.c coff-w65.c coff-we32k.c +coff-x86_64.c coff-z80.c coff-z8k.c corefile.c @@ -65,6 +66,7 @@ cpu-arc.c cpu-arm.c cpu-avr.c cpu-bfin.c +cpu-cr16.c cpu-cr16c.c cpu-cris.c cpu-crx.c @@ -93,6 +95,7 @@ cpu-m68k.c cpu-m88k.c cpu-maxq.c cpu-mcore.c +cpu-mep.c cpu-mips.c cpu-mmix.c cpu-msp430.c @@ -105,8 +108,10 @@ cpu-pj.c cpu-powerpc.c cpu-rs6000.c cpu-s390.c +cpu-score.c cpu-sh.c cpu-sparc.c +cpu-spu.c cpu-tic30.c cpu-tic4x.c cpu-tic54x.c @@ -128,12 +133,14 @@ ecofflink.c ecoffswap.h efi-app-ia32.c efi-app-ia64.c +efi-app-x86_64.c elf32-am33lin.c elf32-arc.c elf32-arm.c elf32-avr.c elf32-bfin.c elf32.c +elf32-cr16.c elf32-cr16c.c elf32-cris.c elf32-crx.c @@ -160,6 +167,7 @@ elf32-m68hc1x.c elf32-m68k.c elf32-m88k.c elf32-mcore.c +elf32-mep.c elf32-mips.c elf32-msp430.c elf32-mt.c @@ -168,11 +176,13 @@ elf32-or32.c elf32-pj.c elf32-ppc.c elf32-s390.c +elf32-score.c elf32-sh64.c elf32-sh64-com.c elf32-sh.c elf32-sh-symbian.c elf32-sparc.c +elf32-spu.c elf32-v850.c elf32-vax.c elf32-xc16x.c @@ -190,6 +200,7 @@ elf64-s390.c elf64-sh64.c elf64-sparc.c elf64-x86-64.c +elf-attrs.c elf-bfd.h elf.c elfcode.h @@ -271,21 +282,25 @@ osf-core.c pc532-mach.c pdp11.c pe-arm.c +pe-arm-wince.c pef.c pef.h pef-traceback.h pe-i386.c pei-arm.c +pei-arm-wince.c peicode.h pei-i386.c pei-mcore.c pei-mips.c pei-ppc.c pei-sh.c +pei-x86_64.c pe-mcore.c pe-mips.c pe-ppc.c pe-sh.c +pe-x86_64.c ppcboot.c reloc16.c reloc.c diff --git a/bfd/po/bfd.pot b/bfd/po/bfd.pot index 37c57290aee..a01ee37160a 100644 --- a/bfd/po/bfd.pot +++ b/bfd/po/bfd.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-10-25 22:24+0930\n" +"POT-Creation-Date: 2007-07-02 16:16+0930\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -33,153 +33,162 @@ msgstr "" msgid "%B: Bad relocation record imported: %d" msgstr "" -#: aoutx.h:1244 aoutx.h:1578 +#: aoutx.h:1267 aoutx.h:1601 #, c-format msgid "%s: can not represent section `%s' in a.out object file format" msgstr "" -#: aoutx.h:1544 +#: aoutx.h:1567 #, c-format msgid "" "%s: can not represent section for symbol `%s' in a.out object file format" msgstr "" -#: aoutx.h:1546 +#: aoutx.h:1569 msgid "*unknown*" msgstr "" -#: aoutx.h:5281 +#: aoutx.h:5311 #, c-format msgid "%s: relocatable link from %s to %s not supported" msgstr "" -#: archive.c:1760 +#: archive.c:1764 msgid "Warning: writing archive was slow: rewriting timestamp\n" msgstr "" -#: archive.c:2019 +#: archive.c:2027 msgid "Reading archive file mod timestamp" msgstr "" -#: archive.c:2043 +#: archive.c:2051 msgid "Writing updated armap timestamp" msgstr "" -#: bfd.c:279 +#: bfd.c:288 msgid "No error" msgstr "" -#: bfd.c:280 +#: bfd.c:289 msgid "System call error" msgstr "" -#: bfd.c:281 +#: bfd.c:290 msgid "Invalid bfd target" msgstr "" -#: bfd.c:282 +#: bfd.c:291 msgid "File in wrong format" msgstr "" -#: bfd.c:283 +#: bfd.c:292 msgid "Archive object file in wrong format" msgstr "" -#: bfd.c:284 +#: bfd.c:293 msgid "Invalid operation" msgstr "" -#: bfd.c:285 +#: bfd.c:294 msgid "Memory exhausted" msgstr "" -#: bfd.c:286 +#: bfd.c:295 msgid "No symbols" msgstr "" -#: bfd.c:287 +#: bfd.c:296 msgid "Archive has no index; run ranlib to add one" msgstr "" -#: bfd.c:288 +#: bfd.c:297 msgid "No more archived files" msgstr "" -#: bfd.c:289 +#: bfd.c:298 msgid "Malformed archive" msgstr "" -#: bfd.c:290 +#: bfd.c:299 msgid "File format not recognized" msgstr "" -#: bfd.c:291 +#: bfd.c:300 msgid "File format is ambiguous" msgstr "" -#: bfd.c:292 +#: bfd.c:301 msgid "Section has no contents" msgstr "" -#: bfd.c:293 +#: bfd.c:302 msgid "Nonrepresentable section on output" msgstr "" -#: bfd.c:294 +#: bfd.c:303 msgid "Symbol needs debug section which does not exist" msgstr "" -#: bfd.c:295 +#: bfd.c:304 msgid "Bad value" msgstr "" -#: bfd.c:296 +#: bfd.c:305 msgid "File truncated" msgstr "" -#: bfd.c:297 +#: bfd.c:306 msgid "File too big" msgstr "" -#: bfd.c:298 +#: bfd.c:307 +#, c-format +msgid "Error reading %s: %s" +msgstr "" + +#: bfd.c:308 msgid "#" msgstr "" -#: bfd.c:771 +#: bfd.c:829 #, c-format msgid "BFD %s assertion fail %s:%d" msgstr "" -#: bfd.c:787 +#: bfd.c:841 #, c-format msgid "BFD %s internal error, aborting at %s line %d in %s\n" msgstr "" -#: bfd.c:791 +#: bfd.c:845 #, c-format msgid "BFD %s internal error, aborting at %s line %d\n" msgstr "" -#: bfd.c:793 +#: bfd.c:847 msgid "Please report this bug.\n" msgstr "" -#: bfdwin.c:202 +#: bfdwin.c:207 #, c-format msgid "not mapping: data=%lx mapped=%d\n" msgstr "" -#: bfdwin.c:205 +#: bfdwin.c:210 #, c-format msgid "not mapping: env var not set\n" msgstr "" -#: binary.c:285 +#: binary.c:283 #, c-format msgid "Warning: Writing section `%s' to huge (ie negative) file offset 0x%lx." msgstr "" -#: coff64-rs6000.c:2109 coff-rs6000.c:3610 +#: cache.c:237 +msgid "reopening %B: %s\n" +msgstr "" + +#: coff64-rs6000.c:2125 coff-rs6000.c:3623 msgid "%B: symbol `%s' has unrecognized smclas %d" msgstr "" @@ -193,45 +202,45 @@ msgstr "" msgid "%B: unknown/unsupported relocation type %d" msgstr "" -#: coff-alpha.c:898 coff-alpha.c:935 coff-alpha.c:2007 coff-mips.c:985 +#: coff-alpha.c:898 coff-alpha.c:935 coff-alpha.c:2023 coff-mips.c:1001 msgid "GP relative relocation used when GP not defined" msgstr "" -#: coff-alpha.c:1484 +#: coff-alpha.c:1500 msgid "using multiple gp values" msgstr "" -#: coff-alpha.c:1543 +#: coff-alpha.c:1559 msgid "%B: unsupported relocation: ALPHA_R_GPRELHIGH" msgstr "" -#: coff-alpha.c:1550 +#: coff-alpha.c:1566 msgid "%B: unsupported relocation: ALPHA_R_GPRELLOW" msgstr "" -#: coff-alpha.c:1557 elf32-m32r.c:2471 elf64-alpha.c:3912 elf64-alpha.c:4038 -#: elf32-ia64.c:4108 elf64-ia64.c:4108 +#: coff-alpha.c:1573 elf32-m32r.c:2486 elf64-alpha.c:3951 elf64-alpha.c:4104 +#: elf32-ia64.c:4674 elf64-ia64.c:4674 msgid "%B: unknown relocation type %d" msgstr "" -#: coff-arm.c:990 elf32-arm.c:1926 +#: coff-arm.c:1035 #, c-format msgid "%B: unable to find THUMB glue '%s' for `%s'" msgstr "" -#: coff-arm.c:1019 elf32-arm.c:1960 +#: coff-arm.c:1064 #, c-format msgid "%B: unable to find ARM glue '%s' for `%s'" msgstr "" -#: coff-arm.c:1319 elf32-arm.c:2683 +#: coff-arm.c:1366 elf32-arm.c:4156 #, c-format msgid "" "%B(%s): warning: interworking not enabled.\n" " first occurrence: %B: arm call to thumb" msgstr "" -#: coff-arm.c:1409 +#: coff-arm.c:1456 #, c-format msgid "" "%B(%s): warning: interworking not enabled.\n" @@ -239,105 +248,105 @@ msgid "" " consider relinking with --support-old-code enabled" msgstr "" -#: coff-arm.c:1702 cofflink.c:3015 coff-tic80.c:695 +#: coff-arm.c:1749 cofflink.c:3014 coff-tic80.c:695 msgid "%B: bad reloc address 0x%lx in section `%A'" msgstr "" -#: coff-arm.c:2028 +#: coff-arm.c:2074 msgid "%B: illegal symbol index in reloc: %d" msgstr "" -#: coff-arm.c:2158 +#: coff-arm.c:2205 #, c-format msgid "ERROR: %B is compiled for APCS-%d, whereas %B is compiled for APCS-%d" msgstr "" -#: coff-arm.c:2174 elf32-arm.c:5093 +#: coff-arm.c:2221 elf32-arm.c:7103 #, c-format msgid "" "ERROR: %B passes floats in float registers, whereas %B passes them in " "integer registers" msgstr "" -#: coff-arm.c:2177 elf32-arm.c:5097 +#: coff-arm.c:2224 elf32-arm.c:7107 #, c-format msgid "" "ERROR: %B passes floats in integer registers, whereas %B passes them in " "float registers" msgstr "" -#: coff-arm.c:2191 +#: coff-arm.c:2238 #, c-format msgid "" "ERROR: %B is compiled as position independent code, whereas target %B is " "absolute position" msgstr "" -#: coff-arm.c:2194 +#: coff-arm.c:2241 #, c-format msgid "" "ERROR: %B is compiled as absolute position code, whereas target %B is " "position independent" msgstr "" -#: coff-arm.c:2222 elf32-arm.c:5162 +#: coff-arm.c:2269 elf32-arm.c:7172 #, c-format msgid "Warning: %B supports interworking, whereas %B does not" msgstr "" -#: coff-arm.c:2225 elf32-arm.c:5168 +#: coff-arm.c:2272 elf32-arm.c:7178 #, c-format msgid "Warning: %B does not support interworking, whereas %B does" msgstr "" -#: coff-arm.c:2249 +#: coff-arm.c:2296 #, c-format msgid "private flags = %x:" msgstr "" -#: coff-arm.c:2257 elf32-arm.c:5219 +#: coff-arm.c:2304 elf32-arm.c:7229 #, c-format msgid " [floats passed in float registers]" msgstr "" -#: coff-arm.c:2259 +#: coff-arm.c:2306 #, c-format msgid " [floats passed in integer registers]" msgstr "" -#: coff-arm.c:2262 elf32-arm.c:5222 +#: coff-arm.c:2309 elf32-arm.c:7232 #, c-format msgid " [position independent]" msgstr "" -#: coff-arm.c:2264 +#: coff-arm.c:2311 #, c-format msgid " [absolute position]" msgstr "" -#: coff-arm.c:2268 +#: coff-arm.c:2315 #, c-format msgid " [interworking flag not initialised]" msgstr "" -#: coff-arm.c:2270 +#: coff-arm.c:2317 #, c-format msgid " [interworking supported]" msgstr "" -#: coff-arm.c:2272 +#: coff-arm.c:2319 #, c-format msgid " [interworking not supported]" msgstr "" -#: coff-arm.c:2318 elf32-arm.c:4571 +#: coff-arm.c:2365 elf32-arm.c:6626 #, c-format msgid "" "Warning: Not setting interworking flag of %B since it has already been " "specified as non-interworking" msgstr "" -#: coff-arm.c:2322 elf32-arm.c:4575 +#: coff-arm.c:2369 elf32-arm.c:6630 #, c-format msgid "Warning: Clearing the interworking flag of %B due to outside request" msgstr "" @@ -358,36 +367,40 @@ msgstr "" msgid "%B (%s): Section flag %s (0x%x) ignored" msgstr "" -#: coffcode.h:2204 +#: coffcode.h:2231 #, c-format msgid "Unrecognized TI COFF target id '0x%x'" msgstr "" -#: coffcode.h:4211 +#: coffcode.h:2546 +msgid "%B: reloc against a non-existant symbol index: %ld" +msgstr "" + +#: coffcode.h:4269 msgid "%B: warning: line number table read failed" msgstr "" -#: coffcode.h:4243 +#: coffcode.h:4301 msgid "%B: warning: illegal symbol index %ld in line numbers" msgstr "" -#: coffcode.h:4257 +#: coffcode.h:4315 msgid "%B: warning: duplicate line number information for `%s'" msgstr "" -#: coffcode.h:4597 +#: coffcode.h:4655 msgid "%B: Unrecognized storage class %d for %s symbol `%s'" msgstr "" -#: coffcode.h:4723 +#: coffcode.h:4781 msgid "warning: %B: local symbol `%s' has no section" msgstr "" -#: coffcode.h:4827 coff-i860.c:586 coff-tic54x.c:376 +#: coffcode.h:4886 coff-i860.c:600 coff-tic54x.c:393 msgid "%B: warning: illegal symbol index %ld in relocs" msgstr "" -#: coffcode.h:4865 +#: coffcode.h:4924 msgid "%B: illegal relocation type %d at address 0x%lx" msgstr "" @@ -395,7 +408,7 @@ msgstr "" msgid "%B: bad string table size %lu" msgstr "" -#: coff-h8300.c:1126 +#: coff-h8300.c:1121 #, c-format msgid "cannot handle R_MEM_INDIRECT reloc when using %s output" msgstr "" @@ -405,53 +418,54 @@ msgstr "" msgid "Relocation `%s' not yet implemented\n" msgstr "" -#: coff-i960.c:137 coff-i960.c:486 +#: coff-i960.c:137 coff-i960.c:500 msgid "uncertain calling convention for non-COFF symbol" msgstr "" -#: cofflink.c:507 elflink.c:3948 +#: cofflink.c:509 elflink.c:4158 msgid "Warning: type of symbol `%s' changed from %d to %d in %B" msgstr "" -#: cofflink.c:2293 +#: cofflink.c:2292 msgid "%B: relocs in section `%A', but it has no contents" msgstr "" -#: cofflink.c:2624 coffswap.h:823 +#: cofflink.c:2623 coffswap.h:823 #, c-format msgid "%s: %s: reloc overflow: 0x%lx > 0xffff" msgstr "" -#: cofflink.c:2633 coffswap.h:809 +#: cofflink.c:2632 coffswap.h:809 #, c-format msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff" msgstr "" -#: coff-m68k.c:482 elf32-bfin.c:2722 elf32-m68k.c:2193 +#: coff-m68k.c:505 elf32-bfin.c:5434 elf32-m68k.c:2392 msgid "unsupported reloc type" msgstr "" -#: coff-maxq.c:128 +#: coff-maxq.c:126 msgid "Can't Make it a Short Jump" msgstr "" -#: coff-maxq.c:193 +#: coff-maxq.c:191 msgid "Exceeds Long Jump Range" msgstr "" -#: coff-maxq.c:204 coff-maxq.c:278 +#: coff-maxq.c:202 coff-maxq.c:276 msgid "Absolute address Exceeds 16 bit Range" msgstr "" -#: coff-maxq.c:242 +#: coff-maxq.c:240 msgid "Absolute address Exceeds 8 bit Range" msgstr "" -#: coff-maxq.c:335 +#: coff-maxq.c:333 msgid "Unrecognized Reloc Type" msgstr "" -#: coff-mips.c:686 elf32-mips.c:940 elf64-mips.c:1864 elfn32-mips.c:1718 +#: coff-mips.c:686 elf32-mips.c:956 elf32-score.c:344 elf64-mips.c:1896 +#: elfn32-mips.c:1750 msgid "GP relative relocation when _gp not defined" msgstr "" @@ -459,22 +473,22 @@ msgstr "" msgid "Unrecognized reloc" msgstr "" -#: coff-rs6000.c:2785 +#: coff-rs6000.c:2798 #, c-format msgid "%s: unsupported relocation type 0x%02x" msgstr "" -#: coff-rs6000.c:2878 +#: coff-rs6000.c:2891 #, c-format msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry" msgstr "" -#: coff-tic4x.c:174 coff-tic54x.c:282 coff-tic80.c:458 +#: coff-tic4x.c:191 coff-tic54x.c:299 coff-tic80.c:458 #, c-format msgid "Unrecognized reloc type 0x%x" msgstr "" -#: coff-tic4x.c:219 +#: coff-tic4x.c:236 #, c-format msgid "%s: warning: illegal symbol index %ld in relocs" msgstr "" @@ -484,543 +498,644 @@ msgstr "" msgid "ignoring reloc %s\n" msgstr "" -#: cpu-arm.c:184 cpu-arm.c:193 +#: cpu-arm.c:188 cpu-arm.c:199 msgid "ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale" msgstr "" -#: cpu-arm.c:324 +#: cpu-arm.c:331 #, c-format msgid "warning: unable to update contents of %s section in %s" msgstr "" -#: dwarf2.c:315 +#: dwarf2.c:329 msgid "Dwarf Error: Can't find .debug_str section." msgstr "" -#: dwarf2.c:333 +#: dwarf2.c:347 #, c-format msgid "" "Dwarf Error: DW_FORM_strp offset (%lu) greater than or equal to .debug_str " "size (%lu)." msgstr "" -#: dwarf2.c:426 +#: dwarf2.c:440 msgid "Dwarf Error: Can't find .debug_abbrev section." msgstr "" -#: dwarf2.c:441 +#: dwarf2.c:455 #, c-format msgid "" "Dwarf Error: Abbrev offset (%lu) greater than or equal to .debug_abbrev size " "(%lu)." msgstr "" -#: dwarf2.c:656 +#: dwarf2.c:670 #, c-format msgid "Dwarf Error: Invalid or unhandled FORM value: %u." msgstr "" -#: dwarf2.c:856 +#: dwarf2.c:873 msgid "Dwarf Error: mangled line number section (bad file number)." msgstr "" -#: dwarf2.c:947 +#: dwarf2.c:985 msgid "Dwarf Error: Can't find .debug_line section." msgstr "" -#: dwarf2.c:964 +#: dwarf2.c:1002 #, c-format msgid "" "Dwarf Error: Line offset (%lu) greater than or equal to .debug_line size (%" "lu)." msgstr "" -#: dwarf2.c:1192 +#: dwarf2.c:1228 msgid "Dwarf Error: mangled line number section." msgstr "" -#: dwarf2.c:1382 +#: dwarf2.c:1416 msgid "Dwarf Error: Can't find .debug_ranges section." msgstr "" -#: dwarf2.c:1544 dwarf2.c:1660 dwarf2.c:1930 +#: dwarf2.c:1579 dwarf2.c:1695 dwarf2.c:1965 #, c-format msgid "Dwarf Error: Could not find abbrev number %u." msgstr "" -#: dwarf2.c:1891 +#: dwarf2.c:1926 #, c-format msgid "" "Dwarf Error: found dwarf version '%u', this reader only handles version 2 " "information." msgstr "" -#: dwarf2.c:1898 +#: dwarf2.c:1933 #, c-format msgid "" "Dwarf Error: found address size '%u', this reader can not handle sizes " "greater than '%u'." msgstr "" -#: dwarf2.c:1921 +#: dwarf2.c:1956 #, c-format msgid "Dwarf Error: Bad abbrev number: %u." msgstr "" -#: ecoff.c:1227 +#: ecoff.c:1226 #, c-format msgid "Unknown basic type %d" msgstr "" -#: ecoff.c:1484 +#: ecoff.c:1483 #, c-format msgid "" "\n" " End+1 symbol: %ld" msgstr "" -#: ecoff.c:1491 ecoff.c:1494 +#: ecoff.c:1490 ecoff.c:1493 #, c-format msgid "" "\n" " First symbol: %ld" msgstr "" -#: ecoff.c:1506 +#: ecoff.c:1505 #, c-format msgid "" "\n" " End+1 symbol: %-7ld Type: %s" msgstr "" -#: ecoff.c:1513 +#: ecoff.c:1512 #, c-format msgid "" "\n" " Local symbol: %ld" msgstr "" -#: ecoff.c:1521 +#: ecoff.c:1520 #, c-format msgid "" "\n" " struct; End+1 symbol: %ld" msgstr "" -#: ecoff.c:1526 +#: ecoff.c:1525 #, c-format msgid "" "\n" " union; End+1 symbol: %ld" msgstr "" -#: ecoff.c:1531 +#: ecoff.c:1530 #, c-format msgid "" "\n" " enum; End+1 symbol: %ld" msgstr "" -#: ecoff.c:1537 +#: ecoff.c:1536 #, c-format msgid "" "\n" " Type: %s" msgstr "" -#: elf32-arm.c:2315 +#: elf32-arm.c:2516 +#, c-format +msgid "unable to find THUMB glue '%s' for '%s'" +msgstr "" + +#: elf32-arm.c:2549 +#, c-format +msgid "unable to find ARM glue '%s' for '%s'" +msgstr "" + +#: elf32-arm.c:3119 msgid "%B: BE8 images only valid in big-endian mode." msgstr "" -#: elf32-arm.c:2471 +#. Give a warning, but do as the user requests anyway. +#: elf32-arm.c:3320 +msgid "" +"%B: warning: selected VFP11 erratum workaround is not necessary for target " +"architecture" +msgstr "" + +#: elf32-arm.c:3854 elf32-arm.c:3874 +msgid "%B: unable to find VFP11 veneer `%s'" +msgstr "" + +#: elf32-arm.c:3919 #, c-format msgid "Invalid TARGET2 relocation type '%s'." msgstr "" -#: elf32-arm.c:2578 +#: elf32-arm.c:4060 msgid "" "%B(%s): warning: interworking not enabled.\n" " first occurrence: %B: thumb call to arm" msgstr "" -#: elf32-arm.c:3044 +#: elf32-arm.c:4748 msgid "\\%B: Warning: Arm BLX instruction targets Arm function '%s'." msgstr "" -#: elf32-arm.c:3227 +#: elf32-arm.c:5047 msgid "%B: Warning: Thumb BLX instruction targets thumb function '%s'." msgstr "" -#: elf32-arm.c:3889 +#: elf32-arm.c:5738 msgid "%B(%A+0x%lx): R_ARM_TLS_LE32 relocation not permitted in shared object" msgstr "" -#: elf32-arm.c:4290 elf32-sh.c:4618 elf64-sh64.c:1537 +#: elf32-arm.c:5939 +msgid "" +"%B(%A+0x%lx): Only ADD or SUB instructions are allowed for ALU group " +"relocations" +msgstr "" + +#: elf32-arm.c:5979 elf32-arm.c:6066 elf32-arm.c:6149 elf32-arm.c:6234 +msgid "%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s" +msgstr "" + +#: elf32-arm.c:6417 elf32-sh.c:3303 elf64-sh64.c:1555 msgid "%B(%A+0x%lx): %s relocation against SEC_MERGE section" msgstr "" -#: elf32-arm.c:4351 elf64-ppc.c:9672 +#: elf32-arm.c:6506 elf64-ppc.c:9972 msgid "%B(%A+0x%lx): %s used with TLS symbol %s" msgstr "" -#: elf32-arm.c:4352 elf64-ppc.c:9673 +#: elf32-arm.c:6507 elf64-ppc.c:9973 msgid "%B(%A+0x%lx): %s used with non-TLS symbol %s" msgstr "" -#: elf32-arm.c:4375 elf32-i386.c:3038 elf32-m32r.c:2653 elf32-m68k.c:1737 -#: elf32-ppc.c:6561 elf32-s390.c:3012 elf32-sh.c:4717 elf32-xtensa.c:2311 -#: elf64-ppc.c:10825 elf64-s390.c:3010 elf64-sh64.c:1626 elf64-x86-64.c:2522 -#: elf-hppa.h:1413 elf-m10300.c:1460 elfxx-sparc.c:3137 +#: elf32-arm.c:6530 elf32-i386.c:3305 elf32-m32r.c:2597 elf32-m68k.c:1981 +#: elf32-ppc.c:6791 elf32-s390.c:3048 elf32-sh.c:3407 elf32-xtensa.c:2290 +#: elf64-ppc.c:11137 elf64-s390.c:3009 elf64-sh64.c:1647 elf64-x86-64.c:3001 +#: elf-hppa.h:2193 elf-m10300.c:1459 elfxx-sparc.c:3254 msgid "%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'" msgstr "" -#: elf32-arm.c:4411 elf32-avr.c:880 elf32-cr16c.c:773 elf32-cris.c:1502 -#: elf32-crx.c:911 elf32-d10v.c:536 elf32-fr30.c:595 elf32-frv.c:4107 -#: elf32-h8300.c:494 elf32-i860.c:1189 elf32-ip2k.c:1474 elf32-iq2000.c:616 -#: elf32-m32c.c:465 elf32-m32r.c:3111 elf32-m68hc1x.c:1194 elf32-ms1.c:373 -#: elf32-msp430.c:508 elf32-openrisc.c:383 elf32-v850.c:1672 -#: elf32-xstormy16.c:909 elf64-mmix.c:1517 elf-m10200.c:427 elf-m10300.c:1509 -msgid "internal error: out of range error" +#: elf32-arm.c:6564 +msgid "out of range" msgstr "" -#: elf32-arm.c:4415 elf32-avr.c:884 elf32-cr16c.c:777 elf32-cris.c:1506 -#: elf32-crx.c:915 elf32-d10v.c:540 elf32-fr30.c:599 elf32-frv.c:4111 -#: elf32-h8300.c:498 elf32-i860.c:1193 elf32-iq2000.c:620 elf32-m32c.c:469 -#: elf32-m32r.c:3115 elf32-m68hc1x.c:1198 elf32-msp430.c:512 -#: elf32-openrisc.c:387 elf32-v850.c:1676 elf32-xstormy16.c:913 -#: elf64-mmix.c:1521 elf-m10200.c:431 elf-m10300.c:1513 elfxx-mips.c:7212 -msgid "internal error: unsupported relocation error" +#: elf32-arm.c:6568 +msgid "unsupported relocation" msgstr "" -#: elf32-arm.c:4419 elf32-cr16c.c:781 elf32-crx.c:919 elf32-d10v.c:544 -#: elf32-h8300.c:502 elf32-m32r.c:3119 elf32-m68hc1x.c:1202 elf-m10200.c:435 -#: elf-m10300.c:1517 -msgid "internal error: dangerous error" +#: elf32-arm.c:6576 +msgid "unknown error" msgstr "" -#: elf32-arm.c:4423 elf32-avr.c:892 elf32-cr16c.c:785 elf32-cris.c:1514 -#: elf32-crx.c:923 elf32-d10v.c:548 elf32-fr30.c:607 elf32-frv.c:4119 -#: elf32-h8300.c:506 elf32-i860.c:1201 elf32-ip2k.c:1489 elf32-iq2000.c:628 -#: elf32-m32c.c:477 elf32-m32r.c:3123 elf32-m68hc1x.c:1206 elf32-ms1.c:381 -#: elf32-msp430.c:520 elf32-openrisc.c:395 elf32-v850.c:1696 -#: elf32-xstormy16.c:921 elf64-mmix.c:1529 elf-m10200.c:439 elf-m10300.c:1521 -msgid "internal error: unknown error" -msgstr "" - -#: elf32-arm.c:4664 +#: elf32-arm.c:6676 msgid "" "Warning: Clearing the interworking flag of %B because non-interworking code " "in %B has been linked with it" msgstr "" -#: elf32-arm.c:4751 +#: elf32-arm.c:6778 msgid "ERROR: %B uses VFP register arguments, %B does not" msgstr "" -#: elf32-arm.c:4798 +#: elf32-arm.c:6828 msgid "ERROR: %B: Conflicting architecture profiles %c/%c" msgstr "" -#: elf32-arm.c:4813 +#: elf32-arm.c:6843 msgid "Warning: %B: Conflicting platform configuration" msgstr "" -#: elf32-arm.c:4821 +#: elf32-arm.c:6852 msgid "ERROR: %B: Conflicting use of R9" msgstr "" -#: elf32-arm.c:4833 +#: elf32-arm.c:6864 msgid "ERROR: %B: SB relative addressing conflicts with use of R9" msgstr "" -#: elf32-arm.c:4855 +#: elf32-arm.c:6886 msgid "ERROR: %B: Conflicting definitions of wchar_t" msgstr "" -#: elf32-arm.c:4881 -msgid "ERROR: %B: Conflicting enum sizes" +#: elf32-arm.c:6915 +msgid "" +"warning: %B uses %s enums yet the output is to use %s enums; use of enum " +"values across objects may fail" msgstr "" -#: elf32-arm.c:4892 +#: elf32-arm.c:6928 msgid "ERROR: %B uses iWMMXt register arguments, %B does not" msgstr "" -#: elf32-arm.c:4912 -msgid "ERROR: %B: Must be processed by '%s' toolchain" -msgstr "" - -#: elf32-arm.c:4932 elf32-arm.c:4951 -msgid "ERROR: %B: Incompatible object tag '%s':%d" -msgstr "" - -#: elf32-arm.c:4961 +#: elf32-arm.c:6951 msgid "Warning: %B: Unknown EABI object attribute %d" msgstr "" -#: elf32-arm.c:5069 +#: elf32-arm.c:7076 msgid "" "ERROR: Source object %B has EABI version %d, but target %B has EABI version %" "d" msgstr "" -#: elf32-arm.c:5082 +#: elf32-arm.c:7092 msgid "ERROR: %B is compiled for APCS-%d, whereas target %B uses APCS-%d" msgstr "" -#: elf32-arm.c:5107 +#: elf32-arm.c:7117 msgid "ERROR: %B uses VFP instructions, whereas %B does not" msgstr "" -#: elf32-arm.c:5111 +#: elf32-arm.c:7121 msgid "ERROR: %B uses FPA instructions, whereas %B does not" msgstr "" -#: elf32-arm.c:5121 +#: elf32-arm.c:7131 msgid "ERROR: %B uses Maverick instructions, whereas %B does not" msgstr "" -#: elf32-arm.c:5125 +#: elf32-arm.c:7135 msgid "ERROR: %B does not use Maverick instructions, whereas %B does" msgstr "" -#: elf32-arm.c:5144 +#: elf32-arm.c:7154 msgid "ERROR: %B uses software FP, whereas %B uses hardware FP" msgstr "" -#: elf32-arm.c:5148 +#: elf32-arm.c:7158 msgid "ERROR: %B uses hardware FP, whereas %B uses software FP" msgstr "" #. Ignore init flag - it may not be set, despite the flags field #. containing valid data. #. Ignore init flag - it may not be set, despite the flags field containing valid data. -#: elf32-arm.c:5195 elf32-bfin.c:2164 elf32-cris.c:3243 elf32-m68hc1x.c:1338 -#: elf32-m68k.c:428 elf32-vax.c:528 elfxx-mips.c:9933 +#: elf32-arm.c:7205 elf32-bfin.c:4795 elf32-cris.c:3233 elf32-m68hc1x.c:1276 +#: elf32-m68k.c:619 elf32-score.c:3752 elf32-vax.c:537 elfxx-mips.c:11310 #, c-format msgid "private flags = %lx:" msgstr "" -#: elf32-arm.c:5204 +#: elf32-arm.c:7214 #, c-format msgid " [interworking enabled]" msgstr "" -#: elf32-arm.c:5212 +#: elf32-arm.c:7222 #, c-format msgid " [VFP float format]" msgstr "" -#: elf32-arm.c:5214 +#: elf32-arm.c:7224 #, c-format msgid " [Maverick float format]" msgstr "" -#: elf32-arm.c:5216 +#: elf32-arm.c:7226 #, c-format msgid " [FPA float format]" msgstr "" -#: elf32-arm.c:5225 +#: elf32-arm.c:7235 #, c-format msgid " [new ABI]" msgstr "" -#: elf32-arm.c:5228 +#: elf32-arm.c:7238 #, c-format msgid " [old ABI]" msgstr "" -#: elf32-arm.c:5231 +#: elf32-arm.c:7241 #, c-format msgid " [software FP]" msgstr "" -#: elf32-arm.c:5240 +#: elf32-arm.c:7250 #, c-format msgid " [Version1 EABI]" msgstr "" -#: elf32-arm.c:5243 elf32-arm.c:5254 +#: elf32-arm.c:7253 elf32-arm.c:7264 #, c-format msgid " [sorted symbol table]" msgstr "" -#: elf32-arm.c:5245 elf32-arm.c:5256 +#: elf32-arm.c:7255 elf32-arm.c:7266 #, c-format msgid " [unsorted symbol table]" msgstr "" -#: elf32-arm.c:5251 +#: elf32-arm.c:7261 #, c-format msgid " [Version2 EABI]" msgstr "" -#: elf32-arm.c:5259 +#: elf32-arm.c:7269 #, c-format msgid " [dynamic symbols use segment index]" msgstr "" -#: elf32-arm.c:5262 +#: elf32-arm.c:7272 #, c-format msgid " [mapping symbols precede others]" msgstr "" -#: elf32-arm.c:5269 +#: elf32-arm.c:7279 #, c-format msgid " [Version3 EABI]" msgstr "" -#: elf32-arm.c:5273 +#: elf32-arm.c:7283 #, c-format msgid " [Version4 EABI]" msgstr "" -#: elf32-arm.c:5276 +#: elf32-arm.c:7287 +#, c-format +msgid " [Version5 EABI]" +msgstr "" + +#: elf32-arm.c:7290 #, c-format msgid " [BE8]" msgstr "" -#: elf32-arm.c:5279 +#: elf32-arm.c:7293 #, c-format msgid " [LE8]" msgstr "" -#: elf32-arm.c:5285 +#: elf32-arm.c:7299 #, c-format msgid " " msgstr "" -#: elf32-arm.c:5292 +#: elf32-arm.c:7306 #, c-format msgid " [relocatable executable]" msgstr "" -#: elf32-arm.c:5295 +#: elf32-arm.c:7309 #, c-format msgid " [has entry point]" msgstr "" -#: elf32-arm.c:5300 +#: elf32-arm.c:7314 #, c-format msgid "" msgstr "" -#: elf32-arm.c:5536 elf32-i386.c:902 elf32-s390.c:989 elf32-xtensa.c:784 -#: elf64-s390.c:942 elf64-x86-64.c:666 elfxx-sparc.c:1016 +#: elf32-arm.c:7545 elf32-i386.c:960 elf32-s390.c:1003 elf32-xtensa.c:814 +#: elf64-s390.c:958 elf64-x86-64.c:772 elfxx-sparc.c:1113 msgid "%B: bad symbol index: %d" msgstr "" -#: elf32-arm.c:6023 elf32-cris.c:2385 elf32-hppa.c:1813 elf32-i370.c:491 -#: elf32-i386.c:1465 elf32-m32r.c:1913 elf32-m68k.c:1088 elf32-ppc.c:4145 -#: elf32-s390.c:1686 elf32-sh.c:3920 elf32-vax.c:1059 elf64-ppc.c:5717 -#: elf64-s390.c:1659 elf64-sh64.c:3442 elf64-x86-64.c:1252 elf-m10300.c:4107 -#: elfxx-sparc.c:1720 +#: elf32-arm.c:8091 elf32-cris.c:2399 elf32-hppa.c:1905 elf32-i370.c:506 +#: elf32-i386.c:1517 elf32-m32r.c:1930 elf32-m68k.c:1330 elf32-ppc.c:4309 +#: elf32-s390.c:1679 elf32-sh.c:2583 elf32-vax.c:1049 elf64-ppc.c:5897 +#: elf64-s390.c:1654 elf64-sh64.c:3437 elf64-x86-64.c:1381 elf-m10300.c:4206 +#: elfxx-sparc.c:1795 #, c-format msgid "dynamic variable `%s' is zero size" msgstr "" -#: elf32-avr.c:888 elf32-cris.c:1510 elf32-fr30.c:603 elf32-frv.c:4115 -#: elf32-i860.c:1197 elf32-ip2k.c:1485 elf32-iq2000.c:624 elf32-m32c.c:473 -#: elf32-ms1.c:377 elf32-msp430.c:516 elf32-openrisc.c:391 elf32-v850.c:1680 -#: elf32-xstormy16.c:917 elf64-mmix.c:1525 +#: elf32-arm.c:8609 +#, c-format +msgid "Errors encountered processing file %s" +msgstr "" + +#: elf32-arm.c:9837 elf32-arm.c:9859 +msgid "%B: error: VFP11 veneer out of range" +msgstr "" + +#: elf32-avr.c:1253 elf32-bfin.c:2795 elf32-cr16.c:887 elf32-cr16c.c:789 +#: elf32-cris.c:1537 elf32-crx.c:932 elf32-d10v.c:517 elf32-fr30.c:615 +#: elf32-frv.c:4128 elf32-h8300.c:515 elf32-i860.c:1217 elf32-ip2k.c:1499 +#: elf32-iq2000.c:647 elf32-m32c.c:560 elf32-m32r.c:3123 elf32-m68hc1x.c:1132 +#: elf32-mep.c:639 elf32-msp430.c:496 elf32-mt.c:401 elf32-openrisc.c:411 +#: elf32-score.c:2455 elf32-spu.c:2813 elf32-v850.c:1700 elf32-xstormy16.c:946 +#: elf64-mmix.c:1531 elf-m10200.c:455 elf-m10300.c:1522 +msgid "internal error: out of range error" +msgstr "" + +#: elf32-avr.c:1257 elf32-bfin.c:2799 elf32-cr16.c:891 elf32-cr16c.c:793 +#: elf32-cris.c:1541 elf32-crx.c:936 elf32-d10v.c:521 elf32-fr30.c:619 +#: elf32-frv.c:4132 elf32-h8300.c:519 elf32-i860.c:1221 elf32-iq2000.c:651 +#: elf32-m32c.c:564 elf32-m32r.c:3127 elf32-m68hc1x.c:1136 elf32-mep.c:643 +#: elf32-msp430.c:500 elf32-openrisc.c:415 elf32-score.c:2459 elf32-spu.c:2817 +#: elf32-v850.c:1704 elf32-xstormy16.c:950 elf64-mmix.c:1535 elf-m10200.c:459 +#: elf-m10300.c:1526 elfxx-mips.c:8019 +msgid "internal error: unsupported relocation error" +msgstr "" + +#: elf32-avr.c:1261 elf32-bfin.c:2803 elf32-cris.c:1545 elf32-fr30.c:623 +#: elf32-frv.c:4136 elf32-i860.c:1225 elf32-ip2k.c:1510 elf32-iq2000.c:655 +#: elf32-m32c.c:568 elf32-mep.c:647 elf32-msp430.c:504 elf32-mt.c:405 +#: elf32-openrisc.c:419 elf32-v850.c:1708 elf32-xstormy16.c:954 +#: elf64-mmix.c:1539 msgid "internal error: dangerous relocation" msgstr "" -#: elf32-bfin.c:96 -msgid "Division by zero. " +#: elf32-avr.c:1265 elf32-bfin.c:2807 elf32-cr16.c:899 elf32-cr16c.c:801 +#: elf32-cris.c:1549 elf32-crx.c:944 elf32-d10v.c:529 elf32-fr30.c:627 +#: elf32-frv.c:4140 elf32-h8300.c:527 elf32-i860.c:1229 elf32-ip2k.c:1514 +#: elf32-iq2000.c:659 elf32-m32c.c:572 elf32-m32r.c:3135 elf32-m68hc1x.c:1144 +#: elf32-mep.c:651 elf32-msp430.c:508 elf32-mt.c:409 elf32-openrisc.c:423 +#: elf32-score.c:2467 elf32-spu.c:2825 elf32-v850.c:1724 elf32-xstormy16.c:958 +#: elf64-mmix.c:1543 elf-m10200.c:467 elf-m10300.c:1539 +msgid "internal error: unknown error" msgstr "" -#: elf32-bfin.c:1958 +#: elf32-avr.c:2369 elf32-hppa.c:594 elf32-m68hc1x.c:163 elf64-ppc.c:3801 +msgid "%B: cannot create stub entry %s" +msgstr "" + +#: elf32-bfin.c:2274 +msgid "%B: relocation at `%A+0x%x' references symbol `%s' with nonzero addend" +msgstr "" + +#: elf32-bfin.c:2288 elf32-frv.c:2918 +msgid "relocation references symbol not defined in the module" +msgstr "" + +#: elf32-bfin.c:2385 +msgid "R_BFIN_FUNCDESC references dynamic symbol with nonzero addend" +msgstr "" + +#: elf32-bfin.c:2424 elf32-bfin.c:2547 elf32-frv.c:3655 elf32-frv.c:3776 +msgid "cannot emit fixups in read-only section" +msgstr "" + +#: elf32-bfin.c:2452 elf32-bfin.c:2587 elf32-frv.c:3686 elf32-frv.c:3820 +msgid "cannot emit dynamic relocations in read-only section" +msgstr "" + +#: elf32-bfin.c:2505 +msgid "R_BFIN_FUNCDESC_VALUE references dynamic symbol with nonzero addend" +msgstr "" + +#: elf32-bfin.c:2673 +msgid "relocations between different segments are not supported" +msgstr "" + +#: elf32-bfin.c:2674 +msgid "warning: relocation references a different segment" +msgstr "" + +#: elf32-bfin.c:3083 msgid "%B(%A+0x%lx): unresolvable relocation against symbol `%s'" msgstr "" -#: elf32-bfin.c:1991 elf32-i386.c:3079 elf32-m68k.c:1778 elf32-s390.c:3064 -#: elf64-s390.c:3062 elf64-x86-64.c:2567 +#: elf32-bfin.c:3116 elf32-i386.c:3346 elf32-m68k.c:2022 elf32-s390.c:3100 +#: elf64-s390.c:3061 elf64-x86-64.c:3040 msgid "%B(%A+0x%lx): reloc against `%s': error %d" msgstr "" -#: elf32-cris.c:1050 +#: elf32-bfin.c:4687 elf32-frv.c:6422 +msgid "%B: unsupported relocation type %i" +msgstr "" + +#: elf32-bfin.c:4868 elf32-frv.c:6830 +#, c-format +msgid "%s: cannot link non-fdpic object file into fdpic executable" +msgstr "" + +#: elf32-bfin.c:4872 elf32-frv.c:6834 +#, c-format +msgid "%s: cannot link fdpic object file into non-fdpic executable" +msgstr "" + +#: elf32-cr16.c:895 elf32-cr16c.c:797 elf32-crx.c:940 elf32-d10v.c:525 +#: elf32-h8300.c:523 elf32-m32r.c:3131 elf32-m68hc1x.c:1140 elf32-score.c:2463 +#: elf32-spu.c:2821 elf-m10200.c:463 +msgid "internal error: dangerous error" +msgstr "" + +#: elf32-cris.c:1059 msgid "%B, section %A: unresolvable relocation %s against symbol `%s'" msgstr "" -#: elf32-cris.c:1105 +#: elf32-cris.c:1128 msgid "%B, section %A: No PLT nor GOT for relocation %s against symbol `%s'" msgstr "" -#: elf32-cris.c:1107 +#: elf32-cris.c:1130 msgid "%B, section %A: No PLT for relocation %s against symbol `%s'" msgstr "" -#: elf32-cris.c:1113 elf32-cris.c:1245 +#: elf32-cris.c:1136 elf32-cris.c:1268 msgid "[whose name is lost]" msgstr "" -#: elf32-cris.c:1231 +#: elf32-cris.c:1254 msgid "" "%B, section %A: relocation %s with non-zero addend %d against local symbol" msgstr "" -#: elf32-cris.c:1239 +#: elf32-cris.c:1262 msgid "" "%B, section %A: relocation %s with non-zero addend %d against symbol `%s'" msgstr "" -#: elf32-cris.c:1265 +#: elf32-cris.c:1288 msgid "%B, section %A: relocation %s is not allowed for global symbol: `%s'" msgstr "" -#: elf32-cris.c:1281 +#: elf32-cris.c:1304 msgid "%B, section %A: relocation %s with no GOT created" msgstr "" -#: elf32-cris.c:1399 +#: elf32-cris.c:1422 msgid "%B: Internal inconsistency; no relocation section %s" msgstr "" -#: elf32-cris.c:2520 +#: elf32-cris.c:2510 msgid "" "%B, section %A:\n" " v10/v32 compatible object %s must not contain a PIC relocation" msgstr "" -#: elf32-cris.c:2707 elf32-cris.c:2775 +#: elf32-cris.c:2697 elf32-cris.c:2765 msgid "" "%B, section %A:\n" " relocation %s should not be used in a shared object; recompile with -fPIC" msgstr "" -#: elf32-cris.c:3192 +#: elf32-cris.c:3182 msgid "Unexpected machine number" msgstr "" -#: elf32-cris.c:3246 +#: elf32-cris.c:3236 #, c-format msgid " [symbols have a _ prefix]" msgstr "" -#: elf32-cris.c:3249 +#: elf32-cris.c:3239 #, c-format msgid " [v10 and v32]" msgstr "" -#: elf32-cris.c:3252 +#: elf32-cris.c:3242 #, c-format msgid " [v32]" msgstr "" -#: elf32-cris.c:3297 +#: elf32-cris.c:3287 msgid "%B: uses _-prefixed symbols, but writing file with non-prefixed symbols" msgstr "" -#: elf32-cris.c:3298 +#: elf32-cris.c:3288 msgid "%B: uses non-prefixed symbols, but writing file with _-prefixed symbols" msgstr "" -#: elf32-cris.c:3317 +#: elf32-cris.c:3307 msgid "%B contains CRIS v32 code, incompatible with previous objects" msgstr "" -#: elf32-cris.c:3319 +#: elf32-cris.c:3309 msgid "%B contains non-CRIS-v32 code, incompatible with previous objects" msgstr "" @@ -1028,119 +1143,93 @@ msgstr "" msgid "relocation requires zero addend" msgstr "" -#: elf32-frv.c:2901 +#: elf32-frv.c:2905 msgid "%B(%A+0x%x): relocation to `%s+%x' may have caused the error above" msgstr "" -#: elf32-frv.c:2914 -msgid "relocation references symbol not defined in the module" -msgstr "" - -#: elf32-frv.c:2990 +#: elf32-frv.c:2994 msgid "R_FRV_GETTLSOFF not applied to a call instruction" msgstr "" -#: elf32-frv.c:3032 +#: elf32-frv.c:3036 msgid "R_FRV_GOTTLSDESC12 not applied to an lddi instruction" msgstr "" -#: elf32-frv.c:3103 +#: elf32-frv.c:3107 msgid "R_FRV_GOTTLSDESCHI not applied to a sethi instruction" msgstr "" -#: elf32-frv.c:3140 +#: elf32-frv.c:3144 msgid "R_FRV_GOTTLSDESCLO not applied to a setlo or setlos instruction" msgstr "" -#: elf32-frv.c:3188 +#: elf32-frv.c:3192 msgid "R_FRV_TLSDESC_RELAX not applied to an ldd instruction" msgstr "" -#: elf32-frv.c:3272 +#: elf32-frv.c:3276 msgid "R_FRV_GETTLSOFF_RELAX not applied to a calll instruction" msgstr "" -#: elf32-frv.c:3327 +#: elf32-frv.c:3331 msgid "R_FRV_GOTTLSOFF12 not applied to an ldi instruction" msgstr "" -#: elf32-frv.c:3357 +#: elf32-frv.c:3361 msgid "R_FRV_GOTTLSOFFHI not applied to a sethi instruction" msgstr "" -#: elf32-frv.c:3386 +#: elf32-frv.c:3390 msgid "R_FRV_GOTTLSOFFLO not applied to a setlo or setlos instruction" msgstr "" -#: elf32-frv.c:3417 +#: elf32-frv.c:3421 msgid "R_FRV_TLSOFF_RELAX not applied to an ld instruction" msgstr "" -#: elf32-frv.c:3462 +#: elf32-frv.c:3466 msgid "R_FRV_TLSMOFFHI not applied to a sethi instruction" msgstr "" -#: elf32-frv.c:3489 +#: elf32-frv.c:3493 msgid "R_FRV_TLSMOFFLO not applied to a setlo or setlos instruction" msgstr "" -#: elf32-frv.c:3610 +#: elf32-frv.c:3614 msgid "R_FRV_FUNCDESC references dynamic symbol with nonzero addend" msgstr "" -#: elf32-frv.c:3649 elf32-frv.c:3762 -msgid "cannot emit fixups in read-only section" -msgstr "" - -#: elf32-frv.c:3675 elf32-frv.c:3802 -msgid "cannot emit dynamic relocations in read-only section" -msgstr "" - -#: elf32-frv.c:3720 +#: elf32-frv.c:3734 msgid "R_FRV_FUNCDESC_VALUE references dynamic symbol with nonzero addend" msgstr "" -#: elf32-frv.c:3970 elf32-frv.c:4126 +#: elf32-frv.c:3991 elf32-frv.c:4147 msgid "%B(%A+0x%lx): reloc against `%s': %s" msgstr "" -#: elf32-frv.c:3972 elf32-frv.c:3976 +#: elf32-frv.c:3993 elf32-frv.c:3997 msgid "relocation references a different segment" msgstr "" -#: elf32-frv.c:6324 -msgid "%B: unsupported relocation type %i" -msgstr "" - -#: elf32-frv.c:6642 +#: elf32-frv.c:6744 #, c-format msgid "" "%s: compiled with %s and linked with modules that use non-pic relocations" msgstr "" -#: elf32-frv.c:6695 elf32-iq2000.c:801 elf32-m32c.c:785 +#: elf32-frv.c:6797 elf32-iq2000.c:808 elf32-m32c.c:819 #, c-format msgid "%s: compiled with %s and linked with modules compiled with %s" msgstr "" -#: elf32-frv.c:6707 +#: elf32-frv.c:6809 #, c-format msgid "" "%s: uses different unknown e_flags (0x%lx) fields than previous modules (0x%" "lx)" msgstr "" -#: elf32-frv.c:6728 -#, c-format -msgid "%s: cannot link non-fdpic object file into fdpic executable" -msgstr "" - -#: elf32-frv.c:6732 -#, c-format -msgid "%s: cannot link fdpic object file into non-fdpic executable" -msgstr "" - -#: elf32-frv.c:6757 elf32-iq2000.c:838 elf32-m32c.c:821 elf32-ms1.c:596 +#: elf32-frv.c:6859 elf32-iq2000.c:845 elf32-m32c.c:855 elf32-mt.c:586 #, c-format msgid "private flags = 0x%lx:" msgstr "" @@ -1149,423 +1238,461 @@ msgstr "" msgid "%B: Relocations in generic ELF (EM: %d)" msgstr "" -#: elf32-hppa.c:569 elf32-m68hc1x.c:161 elf64-ppc.c:3660 -msgid "%B: cannot create stub entry %s" -msgstr "" - -#: elf32-hppa.c:822 elf32-hppa.c:3411 +#: elf32-hppa.c:843 elf32-hppa.c:3576 msgid "%B(%A+0x%lx): cannot reach %s, recompile with -ffunction-sections" msgstr "" -#: elf32-hppa.c:1212 +#: elf32-hppa.c:1252 msgid "" "%B: relocation %s can not be used when making a shared object; recompile " "with -fPIC" msgstr "" -#: elf32-hppa.c:1405 +#: elf32-hppa.c:1505 #, c-format msgid "Could not find relocation section for %s" msgstr "" -#: elf32-hppa.c:2677 +#: elf32-hppa.c:2794 msgid "%B: duplicate export stub %s" msgstr "" -#: elf32-hppa.c:3266 +#: elf32-hppa.c:3412 msgid "" "%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link" msgstr "" -#: elf32-hppa.c:3895 +#: elf32-hppa.c:4266 msgid "%B(%A+0x%lx): cannot handle %s for %s" msgstr "" -#: elf32-hppa.c:4189 +#: elf32-hppa.c:4573 msgid ".got section not immediately after .plt section" msgstr "" -#: elf32-i386.c:327 elf32-s390.c:368 elf64-ppc.c:2124 elf64-s390.c:390 -#: elf64-x86-64.c:204 +#: elf32-i386.c:363 elf32-ppc.c:1615 elf32-s390.c:379 elf64-ppc.c:2147 +#: elf64-s390.c:403 elf64-x86-64.c:220 msgid "%B: invalid relocation type %d" msgstr "" -#: elf32-i386.c:1015 elf32-s390.c:1171 elf32-sh.c:6389 elf64-s390.c:1133 -#: elfxx-sparc.c:1144 +#: elf32-i386.c:1084 elf32-s390.c:1185 elf32-sh.c:5062 elf64-s390.c:1149 +#: elfxx-sparc.c:1241 msgid "%B: `%s' accessed both as normal and thread local symbol" msgstr "" -#: elf32-i386.c:1130 elf32-s390.c:1280 elf64-ppc.c:4731 elf64-s390.c:1245 -#: elf64-x86-64.c:910 +#: elf32-i386.c:1199 elf32-s390.c:1294 elf64-ppc.c:4863 elf64-s390.c:1261 +#: elf64-x86-64.c:1050 msgid "%B: bad relocation section name `%s'" msgstr "" -#: elf32-i386.c:2149 +#: elf32-i386.c:2252 msgid "%B: unrecognized relocation (0x%x) in section `%A'" msgstr "" -#: elf32-i386.c:2409 +#: elf32-i386.c:2474 msgid "" "%B: relocation R_386_GOTOFF against protected function `%s' can not be used " "when making a shared object" msgstr "" -#: elf32-ip2k.c:853 elf32-ip2k.c:859 elf32-ip2k.c:926 elf32-ip2k.c:932 +#: elf32-ip2k.c:868 elf32-ip2k.c:874 elf32-ip2k.c:941 elf32-ip2k.c:947 msgid "" "ip2k relaxer: switch table without complete matching relocation information." msgstr "" -#: elf32-ip2k.c:876 elf32-ip2k.c:959 +#: elf32-ip2k.c:891 elf32-ip2k.c:974 msgid "ip2k relaxer: switch table header corrupt." msgstr "" -#: elf32-ip2k.c:1301 +#: elf32-ip2k.c:1316 #, c-format msgid "ip2k linker: missing page instruction at 0x%08lx (dest = 0x%08lx)." msgstr "" -#: elf32-ip2k.c:1317 +#: elf32-ip2k.c:1332 #, c-format msgid "ip2k linker: redundant page instruction at 0x%08lx (dest = 0x%08lx)." msgstr "" #. Only if it's not an unresolved symbol. -#: elf32-ip2k.c:1481 +#: elf32-ip2k.c:1506 msgid "unsupported relocation between data/insn address spaces" msgstr "" -#: elf32-iq2000.c:814 elf32-m32c.c:797 +#: elf32-iq2000.c:821 elf32-m32c.c:831 #, c-format msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" msgstr "" -#: elf32-m32r.c:1436 +#: elf32-m32r.c:1452 msgid "SDA relocation when _SDA_BASE_ not defined" msgstr "" -#: elf32-m32r.c:3048 +#: elf32-m32r.c:3060 msgid "%B: The target (%s) of an %s relocation is in the wrong section (%A)" msgstr "" -#: elf32-m32r.c:3576 +#: elf32-m32r.c:3588 msgid "%B: Instruction set mismatch with previous modules" msgstr "" -#: elf32-m32r.c:3597 +#: elf32-m32r.c:3609 #, c-format msgid "private flags = %lx" msgstr "" -#: elf32-m32r.c:3602 +#: elf32-m32r.c:3614 #, c-format msgid ": m32r instructions" msgstr "" -#: elf32-m32r.c:3603 +#: elf32-m32r.c:3615 #, c-format msgid ": m32rx instructions" msgstr "" -#: elf32-m32r.c:3604 +#: elf32-m32r.c:3616 #, c-format msgid ": m32r2 instructions" msgstr "" -#: elf32-m68hc1x.c:1106 +#: elf32-m68hc1x.c:1044 #, c-format msgid "" "Reference to the far symbol `%s' using a wrong relocation may result in " "incorrect execution" msgstr "" -#: elf32-m68hc1x.c:1129 +#: elf32-m68hc1x.c:1067 #, c-format msgid "" "banked address [%lx:%04lx] (%lx) is not in the same bank as current banked " "address [%lx:%04lx] (%lx)" msgstr "" -#: elf32-m68hc1x.c:1148 +#: elf32-m68hc1x.c:1086 #, c-format msgid "" "reference to a banked address [%lx:%04lx] in the normal address space at %" "04lx" msgstr "" -#: elf32-m68hc1x.c:1281 +#: elf32-m68hc1x.c:1219 msgid "" "%B: linking files compiled for 16-bit integers (-mshort) and others for 32-" "bit integers" msgstr "" -#: elf32-m68hc1x.c:1288 +#: elf32-m68hc1x.c:1226 msgid "" "%B: linking files compiled for 32-bit double (-fshort-double) and others for " "64-bit double" msgstr "" -#: elf32-m68hc1x.c:1297 +#: elf32-m68hc1x.c:1235 msgid "%B: linking files compiled for HCS12 with others compiled for HC12" msgstr "" -#: elf32-m68hc1x.c:1313 elf32-ppc.c:3576 elf64-sparc.c:696 elfxx-mips.c:9894 +#: elf32-m68hc1x.c:1251 elf32-ppc.c:3733 elf64-sparc.c:696 elfxx-mips.c:11271 msgid "%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" msgstr "" -#: elf32-m68hc1x.c:1341 +#: elf32-m68hc1x.c:1279 #, c-format msgid "[abi=32-bit int, " msgstr "" -#: elf32-m68hc1x.c:1343 +#: elf32-m68hc1x.c:1281 #, c-format msgid "[abi=16-bit int, " msgstr "" -#: elf32-m68hc1x.c:1346 +#: elf32-m68hc1x.c:1284 #, c-format msgid "64-bit double, " msgstr "" -#: elf32-m68hc1x.c:1348 +#: elf32-m68hc1x.c:1286 #, c-format msgid "32-bit double, " msgstr "" -#: elf32-m68hc1x.c:1351 +#: elf32-m68hc1x.c:1289 #, c-format msgid "cpu=HC11]" msgstr "" -#: elf32-m68hc1x.c:1353 +#: elf32-m68hc1x.c:1291 #, c-format msgid "cpu=HCS12]" msgstr "" -#: elf32-m68hc1x.c:1355 +#: elf32-m68hc1x.c:1293 #, c-format msgid "cpu=HC12]" msgstr "" -#: elf32-m68hc1x.c:1358 +#: elf32-m68hc1x.c:1296 #, c-format msgid " [memory=bank-model]" msgstr "" -#: elf32-m68hc1x.c:1360 +#: elf32-m68hc1x.c:1298 #, c-format msgid " [memory=flat]" msgstr "" -#: elf32-m68k.c:431 -#, c-format -msgid " [cpu32]" +#: elf32-m68k.c:634 elf32-m68k.c:635 +msgid "unknown" msgstr "" -#: elf32-m68k.c:434 -#, c-format -msgid " [m68000]" -msgstr "" - -#: elf32-mcore.c:98 elf32-mcore.c:428 +#: elf32-mcore.c:98 elf32-mcore.c:441 msgid "%B: Relocation %s (%d) is not currently supported.\n" msgstr "" -#: elf32-mcore.c:414 +#: elf32-mcore.c:427 msgid "%B: Unknown relocation type %d\n" msgstr "" -#: elf32-mips.c:971 elf64-mips.c:1929 elfn32-mips.c:1774 +#: elf32-mep.c:809 +msgid "%B and %B are for different cores" +msgstr "" + +#: elf32-mep.c:826 +msgid "%B and %B are for different configurations" +msgstr "" + +#: elf32-mep.c:864 +#, c-format +msgid "private flags = 0x%lx" +msgstr "" + +#: elf32-mips.c:987 elf64-mips.c:1961 elfn32-mips.c:1806 msgid "literal relocation occurs for an external symbol" msgstr "" -#: elf32-mips.c:1011 elf64-mips.c:1972 elfn32-mips.c:1815 +#: elf32-mips.c:1027 elf32-score.c:483 elf64-mips.c:2004 elfn32-mips.c:1847 msgid "32bits gp relative relocation occurs for an external symbol" msgstr "" -#: elf32-mips.c:1134 elf64-mips.c:2066 elfn32-mips.c:1915 -#, c-format -msgid "Linking mips16 objects into %s format is not supported" -msgstr "" - -#: elf32-ppc.c:1652 +#: elf32-ppc.c:1680 #, c-format msgid "generic linker can't handle %s" msgstr "" -#: elf32-ppc.c:2080 +#: elf32-ppc.c:2162 msgid "corrupt or empty %s section in %B" msgstr "" -#: elf32-ppc.c:2087 +#: elf32-ppc.c:2169 msgid "unable to read in %s section from %B" msgstr "" -#: elf32-ppc.c:2093 +#: elf32-ppc.c:2175 msgid "corrupt %s section in %B" msgstr "" -#: elf32-ppc.c:2136 +#: elf32-ppc.c:2218 msgid "warning: unable to set size of %s section in %B" msgstr "" -#: elf32-ppc.c:2183 +#: elf32-ppc.c:2266 msgid "failed to allocate space for new APUinfo section." msgstr "" -#: elf32-ppc.c:2202 +#: elf32-ppc.c:2285 msgid "failed to compute new APUinfo section." msgstr "" -#: elf32-ppc.c:2205 +#: elf32-ppc.c:2288 msgid "failed to install new APUinfo section." msgstr "" -#: elf32-ppc.c:2941 +#: elf32-ppc.c:3021 msgid "%B: relocation %s cannot be used when making a shared object" msgstr "" #. It does not make sense to have a procedure linkage #. table entry for a local symbol. -#: elf32-ppc.c:3211 +#: elf32-ppc.c:3291 msgid "%B(%A+0x%lx): %s reloc against local symbol" msgstr "" -#: elf32-ppc.c:3541 +#: elf32-ppc.c:3632 elf32-ppc.c:3636 elfxx-mips.c:11015 elfxx-mips.c:11034 +#: elfxx-mips.c:11049 +msgid "Warning: %B uses hard float, %B uses soft float" +msgstr "" + +#: elf32-ppc.c:3639 elf32-ppc.c:3643 elfxx-mips.c:10996 elfxx-mips.c:11000 +msgid "Warning: %B uses unknown floating point ABI %d" +msgstr "" + +#: elf32-ppc.c:3698 msgid "" "%B: compiled with -mrelocatable and linked with modules compiled normally" msgstr "" -#: elf32-ppc.c:3549 +#: elf32-ppc.c:3706 msgid "" "%B: compiled normally and linked with modules compiled with -mrelocatable" msgstr "" -#: elf32-ppc.c:5768 elf64-ppc.c:10186 +#: elf32-ppc.c:3792 +msgid "Using bss-plt due to %B" +msgstr "" + +#: elf32-ppc.c:5997 elf64-ppc.c:10489 msgid "%B: unknown relocation type %d for symbol %s" msgstr "" -#: elf32-ppc.c:6018 +#: elf32-ppc.c:6247 msgid "%B(%A+0x%lx): non-zero addend on %s reloc against `%s'" msgstr "" -#: elf32-ppc.c:6365 elf32-ppc.c:6391 elf32-ppc.c:6450 +#: elf32-ppc.c:6592 elf32-ppc.c:6618 elf32-ppc.c:6677 msgid "" "%B: the target (%s) of a %s relocation is in the wrong output section (%s)" msgstr "" -#: elf32-ppc.c:6505 +#: elf32-ppc.c:6732 msgid "%B: relocation %s is not yet supported for symbol %s." msgstr "" -#: elf32-ppc.c:6610 elf64-ppc.c:10872 +#: elf32-ppc.c:6840 elf64-ppc.c:11184 msgid "%B(%A+0x%lx): %s reloc against `%s': error %d" msgstr "" -#: elf32-s390.c:2253 elf64-s390.c:2225 +#: elf32-s390.c:2238 elf64-s390.c:2212 msgid "%B(%A+0x%lx): invalid instruction for TLS relocation %s" msgstr "" -#: elf32-sh64.c:218 elf64-sh64.c:2322 +#: elf32-score.c:1417 elfxx-mips.c:2695 +msgid "not enough GOT space for local GOT entries" +msgstr "" + +#: elf32-score.c:2549 +#, c-format +msgid "%s: Malformed reloc detected for section %s" +msgstr "" + +#: elf32-score.c:2600 +msgid "%B: CALL15 reloc at 0x%lx not against global symbol" +msgstr "" + +#: elf32-score.c:3755 +#, c-format +msgid " [pic]" +msgstr "" + +#: elf32-score.c:3759 +#, c-format +msgid " [fix dep]" +msgstr "" + +#: elf32-score.c:3801 elfxx-mips.c:11180 +msgid "%B: warning: linking PIC files with non-PIC files" +msgstr "" + +#: elf32-sh64.c:221 elf64-sh64.c:2349 #, c-format msgid "%s: compiled as 32-bit object and %s is 64-bit" msgstr "" -#: elf32-sh64.c:221 elf64-sh64.c:2325 +#: elf32-sh64.c:224 elf64-sh64.c:2352 #, c-format msgid "%s: compiled as 64-bit object and %s is 32-bit" msgstr "" -#: elf32-sh64.c:223 elf64-sh64.c:2327 +#: elf32-sh64.c:226 elf64-sh64.c:2354 #, c-format msgid "%s: object size does not match that of target %s" msgstr "" -#: elf32-sh64.c:446 elf64-sh64.c:2899 +#: elf32-sh64.c:449 elf64-sh64.c:2893 #, c-format msgid "%s: encountered datalabel symbol in input" msgstr "" -#: elf32-sh64.c:523 +#: elf32-sh64.c:526 msgid "PTB mismatch: a SHmedia address (bit 0 == 1)" msgstr "" -#: elf32-sh64.c:526 +#: elf32-sh64.c:529 msgid "PTA mismatch: a SHcompact address (bit 0 == 0)" msgstr "" -#: elf32-sh64.c:544 +#: elf32-sh64.c:547 #, c-format msgid "%s: GAS error: unexpected PTB insn with R_SH_PT_16" msgstr "" -#: elf32-sh64.c:593 +#: elf32-sh64.c:596 msgid "%B: error: unaligned relocation type %d at %08x reloc %p\n" msgstr "" -#: elf32-sh64.c:669 +#: elf32-sh64.c:672 #, c-format msgid "%s: could not write out added .cranges entries" msgstr "" -#: elf32-sh64.c:729 +#: elf32-sh64.c:732 #, c-format msgid "%s: could not write out sorted .cranges entries" msgstr "" -#: elf32-sh.c:2176 +#: elf32-sh.c:532 msgid "%B: 0x%lx: warning: bad R_SH_USES offset" msgstr "" -#: elf32-sh.c:2188 +#: elf32-sh.c:544 msgid "%B: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x" msgstr "" -#: elf32-sh.c:2205 +#: elf32-sh.c:561 msgid "%B: 0x%lx: warning: bad R_SH_USES load offset" msgstr "" -#: elf32-sh.c:2220 +#: elf32-sh.c:576 msgid "%B: 0x%lx: warning: could not find expected reloc" msgstr "" -#: elf32-sh.c:2248 +#: elf32-sh.c:604 msgid "%B: 0x%lx: warning: symbol in unexpected section" msgstr "" -#: elf32-sh.c:2361 +#: elf32-sh.c:730 msgid "%B: 0x%lx: warning: could not find expected COUNT reloc" msgstr "" -#: elf32-sh.c:2370 +#: elf32-sh.c:739 msgid "%B: 0x%lx: warning: bad count" msgstr "" -#: elf32-sh.c:2765 elf32-sh.c:3135 +#: elf32-sh.c:1143 elf32-sh.c:1513 msgid "%B: 0x%lx: fatal: reloc overflow while relaxing" msgstr "" -#: elf32-sh.c:4566 elf64-sh64.c:1509 +#: elf32-sh.c:3248 elf64-sh64.c:1525 msgid "Unexpected STO_SH5_ISA32 on local symbol is not handled" msgstr "" -#: elf32-sh.c:4791 +#: elf32-sh.c:3485 msgid "%B: 0x%lx: fatal: unaligned branch target for relax-support relocation" msgstr "" -#: elf32-sh.c:4824 elf32-sh.c:4839 +#: elf32-sh.c:3518 elf32-sh.c:3533 msgid "%B: 0x%lx: fatal: unaligned %s relocation 0x%lx" msgstr "" -#: elf32-sh.c:4853 +#: elf32-sh.c:3547 msgid "%B: 0x%lx: fatal: R_SH_PSHA relocation %d not in range -32..32" msgstr "" -#: elf32-sh.c:4867 +#: elf32-sh.c:3561 msgid "%B: 0x%lx: fatal: R_SH_PSHL relocation %d not in range -32..32" msgstr "" -#: elf32-sh.c:6601 elf64-alpha.c:4466 +#: elf32-sh.c:5274 elf64-alpha.c:4531 msgid "%B: TLS local exec code cannot be linked into shared objects" msgstr "" @@ -1581,57 +1708,138 @@ msgstr "" msgid "%B: Failed to add renamed symbol %s" msgstr "" -#: elf32-sparc.c:87 +#: elf32-sparc.c:88 msgid "%B: compiled for a 64 bit system and target is 32 bit" msgstr "" -#: elf32-sparc.c:100 +#: elf32-sparc.c:101 msgid "%B: linking little endian files with big endian files" msgstr "" -#: elf32-v850.c:160 +#: elf32-spu.c:995 +msgid "warning: call to non-function symbol %s defined in %B" +msgstr "" + +#: elf32-spu.c:1315 +msgid "%B is not allowed to define %s" +msgstr "" + +#: elf32-spu.c:1352 +#, c-format +msgid "%s in overlay section" +msgstr "" + +#: elf32-spu.c:1363 +msgid "overlay stub relocation overflow" +msgstr "" + +#: elf32-spu.c:1820 +#, c-format +msgid "warning: %s overlaps %s\n" +msgstr "" + +#: elf32-spu.c:1836 +#, c-format +msgid "warning: %s exceeds section size\n" +msgstr "" + +#: elf32-spu.c:1867 +msgid "%A:0x%v not found in function table\n" +msgstr "" + +#: elf32-spu.c:1958 +msgid "" +"%B(%A+0x%v): call to non-code section %B(%A), stack analysis incomplete\n" +msgstr "" + +#: elf32-spu.c:2079 +#, c-format +msgid "%A link_order not found\n" +msgstr "" + +#: elf32-spu.c:2358 +#, c-format +msgid "Stack analysis will ignore the call from %s to %s\n" +msgstr "" + +#: elf32-spu.c:2513 +msgid "%s: 0x%v 0x%v\n" +msgstr "" + +#: elf32-spu.c:2517 +msgid " calls:\n" +msgstr "" + +#: elf32-spu.c:2524 +#, c-format +msgid " %s%s %s\n" +msgstr "" + +#: elf32-spu.c:2585 +msgid "Stack size for call graph root nodes.\n" +msgstr "" + +#: elf32-spu.c:2586 +msgid "" +"\n" +"Stack size for functions. Annotations: '*' max stack, 't' tail call\n" +msgstr "" + +#: elf32-spu.c:2615 +msgid " %s: 0x%v\n" +msgstr "" + +#: elf32-spu.c:2625 +msgid "Maximum stack required is 0x%v\n" +msgstr "" + +#: elf32-spu.c:2751 +msgid "%B(%s+0x%lx): unresolvable %s relocation against symbol `%s'" +msgstr "" + +#: elf32-v850.c:162 #, c-format msgid "Variable `%s' cannot occupy in multiple small data regions" msgstr "" -#: elf32-v850.c:163 +#: elf32-v850.c:165 #, c-format msgid "" "Variable `%s' can only be in one of the small, zero, and tiny data regions" msgstr "" -#: elf32-v850.c:166 +#: elf32-v850.c:168 #, c-format msgid "" "Variable `%s' cannot be in both small and zero data regions simultaneously" msgstr "" -#: elf32-v850.c:169 +#: elf32-v850.c:171 #, c-format msgid "" "Variable `%s' cannot be in both small and tiny data regions simultaneously" msgstr "" -#: elf32-v850.c:172 +#: elf32-v850.c:174 #, c-format msgid "" "Variable `%s' cannot be in both zero and tiny data regions simultaneously" msgstr "" -#: elf32-v850.c:475 +#: elf32-v850.c:477 #, c-format msgid "FAILED to find previous HI16 reloc\n" msgstr "" -#: elf32-v850.c:1684 +#: elf32-v850.c:1712 msgid "could not locate special linker symbol __gp" msgstr "" -#: elf32-v850.c:1688 +#: elf32-v850.c:1716 msgid "could not locate special linker symbol __ep" msgstr "" -#: elf32-v850.c:1692 +#: elf32-v850.c:1720 msgid "could not locate special linker symbol __ctbp" msgstr "" @@ -1659,145 +1867,144 @@ msgstr "" msgid "v850e1 architecture" msgstr "" -#: elf32-vax.c:531 +#: elf32-vax.c:540 #, c-format msgid " [nonpic]" msgstr "" -#: elf32-vax.c:534 +#: elf32-vax.c:543 #, c-format msgid " [d-float]" msgstr "" -#: elf32-vax.c:537 +#: elf32-vax.c:546 #, c-format msgid " [g-float]" msgstr "" -#: elf32-vax.c:647 +#: elf32-vax.c:656 #, c-format msgid "" "%s: warning: GOT addend of %ld to `%s' does not match previous GOT addend of " "%ld" msgstr "" -#: elf32-vax.c:1604 +#: elf32-vax.c:1583 #, c-format msgid "%s: warning: PLT addend of %d to `%s' from %s section ignored" msgstr "" -#: elf32-vax.c:1728 +#: elf32-vax.c:1720 #, c-format msgid "%s: warning: %s relocation against symbol `%s' from %s section" msgstr "" -#: elf32-vax.c:1734 +#: elf32-vax.c:1726 #, c-format msgid "%s: warning: %s relocation to 0x%x from %s section" msgstr "" -#: elf32-xstormy16.c:425 elf32-ia64.c:2563 elf64-ia64.c:2563 +#: elf32-xstormy16.c:451 elf32-ia64.c:2961 elf64-ia64.c:2961 msgid "non-zero addend in @fptr reloc" msgstr "" -#: elf32-xtensa.c:705 +#: elf32-xtensa.c:733 msgid "%B(%A): invalid property table" msgstr "" -#: elf32-xtensa.c:2199 +#: elf32-xtensa.c:2177 msgid "%B(%A+0x%lx): relocation offset out of range (size=0x%x)" msgstr "" -#: elf32-xtensa.c:2256 +#: elf32-xtensa.c:2234 msgid "dynamic relocation in read-only section" msgstr "" -#: elf32-xtensa.c:2421 +#: elf32-xtensa.c:2407 msgid "internal inconsistency in size of .got.loc section" msgstr "" -#: elf32-xtensa.c:2735 +#: elf32-xtensa.c:2714 msgid "%B: incompatible machine type. Output is 0x%x. Input is 0x%x" msgstr "" -#: elf32-xtensa.c:3881 elf32-xtensa.c:3889 +#: elf32-xtensa.c:3920 elf32-xtensa.c:3928 msgid "Attempt to convert L32R/CALLX to CALL failed" msgstr "" -#: elf32-xtensa.c:5467 elf32-xtensa.c:5543 elf32-xtensa.c:6496 -#: elf32-xtensa.c:6550 +#: elf32-xtensa.c:5522 elf32-xtensa.c:5598 elf32-xtensa.c:6714 msgid "" "%B(%A+0x%lx): could not decode instruction; possible configuration mismatch" msgstr "" -#: elf32-xtensa.c:6369 elf32-xtensa.c:6532 +#: elf32-xtensa.c:6454 msgid "" "%B(%A+0x%lx): could not decode instruction for XTENSA_ASM_SIMPLIFY " "relocation; possible configuration mismatch" msgstr "" -#: elf32-xtensa.c:7855 +#: elf32-xtensa.c:8166 msgid "invalid relocation address" msgstr "" -#: elf32-xtensa.c:7904 +#: elf32-xtensa.c:8215 msgid "overflow after relaxation" msgstr "" -#: elf32-xtensa.c:9032 +#: elf32-xtensa.c:9341 msgid "%B(%A+0x%lx): unexpected fix for %s relocation" msgstr "" -#: elf64-alpha.c:443 +#: elf64-alpha.c:451 msgid "GPDISP relocation did not find ldah and lda instructions" msgstr "" -#: elf64-alpha.c:2363 +#: elf64-alpha.c:2402 msgid "%B: .got subsegment exceeds 64K (size %d)" msgstr "" -#: elf64-alpha.c:4210 elf64-alpha.c:4222 +#: elf64-alpha.c:4275 elf64-alpha.c:4287 msgid "%B: gp-relative relocation against dynamic symbol %s" msgstr "" -#: elf64-alpha.c:4248 elf64-alpha.c:4383 +#: elf64-alpha.c:4313 elf64-alpha.c:4448 msgid "%B: pc-relative relocation against dynamic symbol %s" msgstr "" -#: elf64-alpha.c:4276 +#: elf64-alpha.c:4341 msgid "%B: change in gp: BRSGP %s" msgstr "" -#: elf64-alpha.c:4301 +#: elf64-alpha.c:4366 msgid "" msgstr "" -#: elf64-alpha.c:4306 +#: elf64-alpha.c:4371 msgid "%B: !samegp reloc against symbol without .prologue: %s" msgstr "" -#: elf64-alpha.c:4358 +#: elf64-alpha.c:4423 msgid "%B: unhandled dynamic relocation against %s" msgstr "" -#: elf64-alpha.c:4390 +#: elf64-alpha.c:4455 msgid "%B: pc-relative relocation against undefined weak symbol %s" msgstr "" -#: elf64-alpha.c:4450 +#: elf64-alpha.c:4515 msgid "%B: dtp-relative relocation against dynamic symbol %s" msgstr "" -#: elf64-alpha.c:4473 +#: elf64-alpha.c:4538 msgid "%B: tp-relative relocation against dynamic symbol %s" msgstr "" -#: elf64-hppa.c:2046 +#: elf64-hppa.c:2039 #, c-format msgid "stub entry for %s cannot load .plt, dp offset = %ld" msgstr "" -#: elf64-mmix.c:1163 +#: elf64-mmix.c:1175 #, c-format msgid "" "%s: Internal inconsistency error for value for\n" @@ -1805,126 +2012,122 @@ msgid "" "08lx\n" msgstr "" -#: elf64-mmix.c:1602 +#: elf64-mmix.c:1616 #, c-format msgid "" "%s: base-plus-offset relocation against register symbol: (unknown) in %s" msgstr "" -#: elf64-mmix.c:1607 +#: elf64-mmix.c:1621 #, c-format msgid "%s: base-plus-offset relocation against register symbol: %s in %s" msgstr "" -#: elf64-mmix.c:1651 +#: elf64-mmix.c:1665 #, c-format msgid "%s: register relocation against non-register symbol: (unknown) in %s" msgstr "" -#: elf64-mmix.c:1656 +#: elf64-mmix.c:1670 #, c-format msgid "%s: register relocation against non-register symbol: %s in %s" msgstr "" -#: elf64-mmix.c:1693 +#: elf64-mmix.c:1707 #, c-format msgid "%s: directive LOCAL valid only with a register or absolute value" msgstr "" -#: elf64-mmix.c:1721 +#: elf64-mmix.c:1735 #, c-format msgid "" "%s: LOCAL directive: Register $%ld is not a local register. First global " "register is $%ld." msgstr "" -#: elf64-mmix.c:2207 +#: elf64-mmix.c:2200 #, c-format msgid "" "%s: Error: multiple definition of `%s'; start of %s is set in a earlier " "linked file\n" msgstr "" -#: elf64-mmix.c:2265 +#: elf64-mmix.c:2258 msgid "Register section has contents\n" msgstr "" -#: elf64-mmix.c:2457 +#: elf64-mmix.c:2450 #, c-format msgid "" "Internal inconsistency: remaining %u != max %u.\n" " Please report this bug." msgstr "" -#: elf64-ppc.c:2500 libbfd.c:931 +#: elf64-ppc.c:2568 libbfd.c:948 msgid "%B: compiled for a big endian system and target is little endian" msgstr "" -#: elf64-ppc.c:2503 libbfd.c:933 +#: elf64-ppc.c:2571 libbfd.c:950 msgid "%B: compiled for a little endian system and target is big endian" msgstr "" -#: elf64-ppc.c:5707 +#: elf64-ppc.c:5887 #, c-format msgid "" "copy reloc against `%s' requires lazy plt linking; avoid setting " "LD_BIND_NOW=1 or upgrade gcc" msgstr "" -#: elf64-ppc.c:6155 +#: elf64-ppc.c:6315 msgid "dynreloc miscount for %B, section %A" msgstr "" -#: elf64-ppc.c:6257 +#: elf64-ppc.c:6419 msgid "%B: .opd is not a regular array of opd entries" msgstr "" -#: elf64-ppc.c:6266 +#: elf64-ppc.c:6428 msgid "%B: unexpected reloc type %u in .opd section" msgstr "" -#: elf64-ppc.c:6287 +#: elf64-ppc.c:6449 msgid "%B: undefined sym `%s' in .opd section" msgstr "" -#: elf64-ppc.c:6939 elf64-ppc.c:7318 +#: elf64-ppc.c:7156 elf64-ppc.c:7536 #, c-format msgid "%s defined in removed toc entry" msgstr "" -#: elf64-ppc.c:8041 +#: elf64-ppc.c:8271 #, c-format msgid "long branch stub `%s' offset overflow" msgstr "" -#: elf64-ppc.c:8116 +#: elf64-ppc.c:8346 #, c-format msgid "can't find branch stub `%s'" msgstr "" -#: elf64-ppc.c:8155 elf64-ppc.c:8231 +#: elf64-ppc.c:8412 elf64-ppc.c:8488 #, c-format msgid "linkage table error against `%s'" msgstr "" -#: elf64-ppc.c:8360 +#: elf64-ppc.c:8617 #, c-format msgid "can't build branch stub `%s'" msgstr "" -#: elf64-ppc.c:8784 +#: elf64-ppc.c:9069 msgid "%B section %A exceeds stub group size" msgstr "" -#: elf64-ppc.c:9295 -msgid ".glink and .plt too far apart" -msgstr "" - -#: elf64-ppc.c:9408 +#: elf64-ppc.c:9681 msgid "stubs don't match calculated size" msgstr "" -#: elf64-ppc.c:9420 +#: elf64-ppc.c:9693 #, c-format msgid "" "linker stubs in %u group%s\n" @@ -1935,28 +2138,28 @@ msgid "" " plt call %lu" msgstr "" -#: elf64-ppc.c:10075 +#: elf64-ppc.c:10377 msgid "" "%B(%A+0x%lx): automatic multiple TOCs not supported using your crt files; " "recompile with -mminimal-toc or upgrade gcc" msgstr "" -#: elf64-ppc.c:10083 +#: elf64-ppc.c:10385 msgid "" "%B(%A+0x%lx): sibling call optimization to `%s' does not allow automatic " "multiple TOCs; recompile with -mminimal-toc or -fno-optimize-sibling-calls, " "or make `%s' extern" msgstr "" -#: elf64-ppc.c:10727 +#: elf64-ppc.c:11036 msgid "%B: relocation %s is not supported for symbol %s." msgstr "" -#: elf64-ppc.c:10806 +#: elf64-ppc.c:11118 msgid "%B: error: relocation %s not a multiple of %d" msgstr "" -#: elf64-sh64.c:1676 +#: elf64-sh64.c:1700 #, c-format msgid "%s: error: unaligned relocation type %d at %08x reloc %08x\n" msgstr "" @@ -1981,471 +2184,519 @@ msgstr "" msgid "%B: linking UltraSPARC specific with HAL specific code" msgstr "" -#: elf64-x86-64.c:692 elf64-x86-64.c:818 elf64-x86-64.c:2069 +#: elf64-x86-64.c:798 elf64-x86-64.c:958 elf64-x86-64.c:2359 msgid "" "%B: relocation %s against `%s' can not be used when making a shared object; " "recompile with -fPIC" msgstr "" -#: elf64-x86-64.c:760 +#: elf64-x86-64.c:889 msgid "%B: %s' accessed both as normal and thread local symbol" msgstr "" -#: elf64-x86-64.c:2000 +#: elf64-x86-64.c:2271 msgid "" "%B: relocation R_X86_64_GOTOFF64 against protected function `%s' can not be " "used when making a shared object" msgstr "" -#: elf64-x86-64.c:2065 +#: elf64-x86-64.c:2355 msgid "" "%B: relocation R_X86_64_PC32 against protected function `%s' can not be used " "when making a shared object" msgstr "" -#: elf.c:288 +#: elf-attrs.c:581 +msgid "ERROR: %B: Must be processed by '%s' toolchain" +msgstr "" + +#: elf-attrs.c:601 elf-attrs.c:620 +msgid "ERROR: %B: Incompatible object tag '%s':%d" +msgstr "" + +#: elf.c:309 msgid "%B: invalid string offset %u >= %lu for section `%s'" msgstr "" -#: elf.c:552 +#: elf.c:411 +msgid "%B symbol number %lu references nonexistent SHT_SYMTAB_SHNDX section" +msgstr "" + +#: elf.c:564 +msgid "%B: Corrupt size field in group section header: 0x%lx" +msgstr "" + +#: elf.c:600 msgid "%B: invalid SHT_GROUP entry" msgstr "" -#: elf.c:622 +#: elf.c:670 msgid "%B: no group info for section %A" msgstr "" -#: elf.c:652 elf.c:3091 elflink.c:7588 +#: elf.c:700 elf.c:3251 elflink.c:9120 msgid "%B: warning: sh_link not set for section `%A'" msgstr "" -#: elf.c:688 +#: elf.c:716 +msgid "%B: sh_link [%d] in section `%A' is incorrect" +msgstr "" + +#: elf.c:751 msgid "%B: unknown [%d] section `%s' in group [%s]" msgstr "" -#: elf.c:1071 +#: elf.c:1160 #, c-format msgid "" "\n" "Program Header:\n" msgstr "" -#: elf.c:1123 +#: elf.c:1202 #, c-format msgid "" "\n" "Dynamic Section:\n" msgstr "" -#: elf.c:1248 +#: elf.c:1328 #, c-format msgid "" "\n" "Version definitions:\n" msgstr "" -#: elf.c:1273 +#: elf.c:1353 #, c-format msgid "" "\n" "Version References:\n" msgstr "" -#: elf.c:1278 +#: elf.c:1358 #, c-format msgid " required from %s:\n" msgstr "" -#: elf.c:1985 +#: elf.c:2054 msgid "%B: invalid link %lu for reloc section %s (index %u)" msgstr "" -#: elf.c:3062 +#: elf.c:2222 +msgid "" +"%B: don't know how to handle allocated, application specific section `%s' [0x" +"%8x]" +msgstr "" + +#: elf.c:2234 +msgid "%B: don't know how to handle processor specific section `%s' [0x%8x]" +msgstr "" + +#: elf.c:2245 +msgid "%B: don't know how to handle OS specific section `%s' [0x%8x]" +msgstr "" + +#: elf.c:2255 +msgid "%B: don't know how to handle section `%s' [0x%8x]" +msgstr "" + +#: elf.c:3208 msgid "%B: sh_link of section `%A' points to discarded section `%A' of `%B'" msgstr "" -#: elf.c:4070 -msgid "%B: Not enough room for program headers (allocated %u, need %u)" +#: elf.c:3231 +msgid "%B: sh_link of section `%A' points to removed section `%A' of `%B'" msgstr "" -#: elf.c:4173 +#: elf.c:4472 msgid "" "%B: The first section in the PT_DYNAMIC segment is not the .dynamic section" msgstr "" -#: elf.c:4217 +#: elf.c:4495 msgid "%B: Not enough room for program headers, try linking with -N" msgstr "" -#: elf.c:4308 +#: elf.c:4573 msgid "%B: section %A lma 0x%lx overlaps previous sections" msgstr "" -#: elf.c:4709 +#: elf.c:4671 +msgid "%B: section `%A' can't be allocated in segment %d" +msgstr "" + +#: elf.c:4720 msgid "%B: warning: allocated section `%s' not in segment" msgstr "" -#: elf.c:5002 +#: elf.c:5209 msgid "%B: symbol `%s' required but not present" msgstr "" -#: elf.c:5299 +#: elf.c:5522 msgid "%B: warning: Empty loadable segment detected, is this intentional ?\n" msgstr "" -#: elf.c:5961 +#: elf.c:6425 #, c-format msgid "" "Unable to find equivalent output section for symbol '%s' from section '%s'" msgstr "" -#: elf.c:6917 +#: elf.c:7399 msgid "%B: unsupported relocation type %s" msgstr "" -#: elfcode.h:1110 +#: elfcode.h:810 +#, c-format +msgid "warning: %s has a corrupt string table index - ignoring" +msgstr "" + +#: elfcode.h:1176 #, c-format msgid "%s: version count (%ld) does not match symbol count (%ld)" msgstr "" -#: elfcode.h:1337 +#: elfcode.h:1409 #, c-format msgid "%s(%s): relocation %d has invalid symbol index %ld" msgstr "" -#: elf-hppa.h:1443 elf-hppa.h:1458 +#: elf-eh-frame.c:822 +msgid "" +"%P: fde encoding in %B(%A) prevents .eh_frame_hdr table being created.\n" +msgstr "" + +#: elf-eh-frame.c:973 +msgid "%P: error in %B(%A); no .eh_frame_hdr table will be created.\n" +msgstr "" + +#: elf-hppa.h:2218 elf-hppa.h:2232 msgid "%B(%A): warning: unresolvable relocation against symbol `%s'" msgstr "" -#: elflink.c:907 +#: elflink.c:1004 msgid "" "%s: TLS definition in %B section %A mismatches non-TLS definition in %B " "section %A" msgstr "" -#: elflink.c:911 +#: elflink.c:1008 msgid "%s: TLS reference in %B mismatches non-TLS reference in %B" msgstr "" -#: elflink.c:915 +#: elflink.c:1012 msgid "%s: TLS definition in %B section %A mismatches non-TLS reference in %B" msgstr "" -#: elflink.c:919 +#: elflink.c:1016 msgid "%s: TLS reference in %B mismatches non-TLS definition in %B section %A" msgstr "" -#: elflink.c:1491 +#: elflink.c:1630 msgid "%B: unexpected redefinition of indirect versioned symbol `%s'" msgstr "" -#: elflink.c:1807 -msgid "%B: undefined versioned symbol name %s" +#: elflink.c:1950 +msgid "%B: version node not found for symbol %s" msgstr "" -#: elflink.c:1955 +#: elflink.c:2098 msgid "" "%B: bad reloc symbol index (0x%lx >= 0x%lx) for offset 0x%lx in section `%A'" msgstr "" -#: elflink.c:2147 +#: elflink.c:2290 msgid "%B: relocation size mismatch in %B section %A" msgstr "" -#: elflink.c:2437 +#: elflink.c:2598 #, c-format msgid "warning: type and size of dynamic symbol `%s' are not defined" msgstr "" -#: elflink.c:2761 -msgid "warning: creating a DT_TEXTREL in a shared object." -msgstr "" - -#: elflink.c:3696 +#: elflink.c:3893 msgid "%B: %s: invalid version %u (max %d)" msgstr "" -#: elflink.c:3732 +#: elflink.c:3929 msgid "%B: %s: invalid needed version %d" msgstr "" -#: elflink.c:3912 +#: elflink.c:4112 +msgid "" +"Warning: alignment %u of common symbol `%s' in %B is greater than the " +"alignment (%u) of its section %A" +msgstr "" + +#: elflink.c:4118 msgid "Warning: alignment %u of symbol `%s' in %B is smaller than %u in %B" msgstr "" -#: elflink.c:3924 +#: elflink.c:4133 msgid "Warning: size of symbol `%s' changed from %lu in %B to %lu in %B" msgstr "" -#: elflink.c:4091 +#: elflink.c:4309 #, c-format msgid "%s: invalid DSO for symbol `%s' definition" msgstr "" -#: elflink.c:5152 +#: elflink.c:5535 #, c-format msgid "%s: undefined version: %s" msgstr "" -#: elflink.c:5219 +#: elflink.c:5603 msgid "%B: .preinit_array section is not allowed in DSO" msgstr "" -#: elflink.c:5978 +#: elflink.c:6621 +#, c-format +msgid "undefined %s reference in complex symbol: %s" +msgstr "" + +#: elflink.c:6776 +#, c-format +msgid "unknown operator '%c' in complex symbol" +msgstr "" + +#: elflink.c:7315 elflink.c:7332 elflink.c:7369 elflink.c:7386 +msgid "%B: Unable to sort relocs - they are in more than one size" +msgstr "" + +#: elflink.c:7346 elflink.c:7400 +msgid "%B: Unable to sort relocs - they are of an unknown size" +msgstr "" + +#: elflink.c:7449 msgid "Not enough memory to sort relocations" msgstr "" -#: elflink.c:6369 +#: elflink.c:7636 +msgid "%B: Too many sections: %d (>= %d)" +msgstr "" + +#: elflink.c:7870 msgid "%B: %s symbol `%s' in %B is referenced by DSO" msgstr "" -#: elflink.c:6452 +#: elflink.c:7953 msgid "%B: could not find output section %A for input section %A" msgstr "" -#: elflink.c:6549 +#: elflink.c:8050 msgid "%B: %s symbol `%s' isn't defined" msgstr "" -#: elflink.c:7024 +#: elflink.c:8546 msgid "" "error: %B contains a reloc (0x%s) for section %A that references a non-" "existent global symbol" msgstr "" -#: elflink.c:7058 +#: elflink.c:8580 msgid "" "%X`%s' referenced in section `%A' of %B: defined in discarded section `%A' " "of %B\n" msgstr "" -#: elflink.c:7665 +#: elflink.c:9198 msgid "%A has both ordered [`%A' in %B] and unordered [`%A' in %B] sections" msgstr "" -#: elflink.c:7670 +#: elflink.c:9203 #, c-format msgid "%A has both ordered and unordered sections" msgstr "" -#: elflink.c:8487 elflink.c:8528 +#: elflink.c:10090 elflink.c:10134 msgid "%B: could not find output section %s" msgstr "" -#: elflink.c:8492 +#: elflink.c:10095 #, c-format msgid "warning: %s section has zero size" msgstr "" -#: elflink.c:9087 +#: elflink.c:10199 +msgid "%P: warning: creating a DT_TEXTREL in a shared object.\n" +msgstr "" + +#: elflink.c:10567 +msgid "Removing unused section '%s' in file '%B'" +msgstr "" + +#: elflink.c:10758 msgid "Warning: gc-sections option ignored" msgstr "" -#: elflink.c:9704 +#: elflink.c:11249 +msgid "%P%X: can not read symbols: %E\n" +msgstr "" + +#: elflink.c:11391 msgid "%B: ignoring duplicate section `%A'" msgstr "" -#: elflink.c:9711 elflink.c:9718 +#: elflink.c:11398 elflink.c:11405 msgid "%B: duplicate section `%A' has different size" msgstr "" -#: elflink.c:9726 elflink.c:9731 +#: elflink.c:11413 elflink.c:11418 msgid "%B: warning: could not read contents of section `%A'" msgstr "" -#: elflink.c:9735 +#: elflink.c:11422 msgid "%B: warning: duplicate section `%A' has different contents" msgstr "" -#: elfxx-mips.c:866 +#: elf-m10300.c:1531 +msgid "" +"error: inappropriate relocation type for shared library (did you forget -" +"fpic?)" +msgstr "" + +#: elf-m10300.c:1534 +msgid "internal error: suspicious relocation type used in shared library" +msgstr "" + +#: elfxx-mips.c:986 msgid "static procedure (no name)" msgstr "" -#: elfxx-mips.c:2513 -msgid "not enough GOT space for local GOT entries" -msgstr "" - -#: elfxx-mips.c:4356 +#: elfxx-mips.c:4657 msgid "%B: %A+0x%lx: jump to stub routine which is not jal" msgstr "" -#: elfxx-mips.c:4993 elfxx-mips.c:5214 +#: elfxx-mips.c:5320 elfxx-mips.c:5540 msgid "%B: Warning: bad `%s' option size %u smaller than its header" msgstr "" -#: elfxx-mips.c:5965 +#: elfxx-mips.c:6399 msgid "%B: Malformed reloc detected for section %s" msgstr "" -#: elfxx-mips.c:6041 +#: elfxx-mips.c:6441 +msgid "%B: GOT reloc at 0x%lx not expected in executables" +msgstr "" + +#: elfxx-mips.c:6511 msgid "%B: CALL16 reloc at 0x%lx not against global symbol" msgstr "" -#: elfxx-mips.c:9380 +#: elfxx-mips.c:7874 +msgid "" +"%B: Can't find matching LO16 reloc against `%s' for %s at 0x%lx in section `%" +"A'" +msgstr "" + +#: elfxx-mips.c:10640 #, c-format msgid "%s: illegal section name `%s'" msgstr "" -#: elfxx-mips.c:9719 +#: elfxx-mips.c:11010 elfxx-mips.c:11029 +msgid "Warning: %B uses -msingle-float, %B uses -mdouble-float" +msgstr "" + +#: elfxx-mips.c:11085 msgid "%B: endianness incompatible with that of the selected emulation" msgstr "" -#: elfxx-mips.c:9731 +#: elfxx-mips.c:11097 msgid "%B: ABI is incompatible with that of the selected emulation" msgstr "" -#: elfxx-mips.c:9803 -msgid "%B: warning: linking PIC files with non-PIC files" -msgstr "" - -#: elfxx-mips.c:9820 +#: elfxx-mips.c:11197 msgid "%B: linking 32-bit code with 64-bit code" msgstr "" -#: elfxx-mips.c:9848 +#: elfxx-mips.c:11225 msgid "%B: linking %s module with previous %s modules" msgstr "" -#: elfxx-mips.c:9871 +#: elfxx-mips.c:11248 msgid "%B: ABI mismatch: linking %s module with previous %s modules" msgstr "" -#: elfxx-mips.c:9936 +#: elfxx-mips.c:11313 #, c-format msgid " [abi=O32]" msgstr "" -#: elfxx-mips.c:9938 +#: elfxx-mips.c:11315 #, c-format msgid " [abi=O64]" msgstr "" -#: elfxx-mips.c:9940 +#: elfxx-mips.c:11317 #, c-format msgid " [abi=EABI32]" msgstr "" -#: elfxx-mips.c:9942 +#: elfxx-mips.c:11319 #, c-format msgid " [abi=EABI64]" msgstr "" -#: elfxx-mips.c:9944 +#: elfxx-mips.c:11321 #, c-format msgid " [abi unknown]" msgstr "" -#: elfxx-mips.c:9946 +#: elfxx-mips.c:11323 #, c-format msgid " [abi=N32]" msgstr "" -#: elfxx-mips.c:9948 +#: elfxx-mips.c:11325 #, c-format msgid " [abi=64]" msgstr "" -#: elfxx-mips.c:9950 +#: elfxx-mips.c:11327 #, c-format msgid " [no abi set]" msgstr "" -#: elfxx-mips.c:9953 -#, c-format -msgid " [mips1]" -msgstr "" - -#: elfxx-mips.c:9955 -#, c-format -msgid " [mips2]" -msgstr "" - -#: elfxx-mips.c:9957 -#, c-format -msgid " [mips3]" -msgstr "" - -#: elfxx-mips.c:9959 -#, c-format -msgid " [mips4]" -msgstr "" - -#: elfxx-mips.c:9961 -#, c-format -msgid " [mips5]" -msgstr "" - -#: elfxx-mips.c:9963 -#, c-format -msgid " [mips32]" -msgstr "" - -#: elfxx-mips.c:9965 -#, c-format -msgid " [mips64]" -msgstr "" - -#: elfxx-mips.c:9967 -#, c-format -msgid " [mips32r2]" -msgstr "" - -#: elfxx-mips.c:9969 -#, c-format -msgid " [mips64r2]" -msgstr "" - -#: elfxx-mips.c:9971 +#: elfxx-mips.c:11348 #, c-format msgid " [unknown ISA]" msgstr "" -#: elfxx-mips.c:9974 -#, c-format -msgid " [mdmx]" -msgstr "" - -#: elfxx-mips.c:9977 -#, c-format -msgid " [mips16]" -msgstr "" - -#: elfxx-mips.c:9980 -#, c-format -msgid " [32bitmode]" -msgstr "" - -#: elfxx-mips.c:9982 +#: elfxx-mips.c:11359 #, c-format msgid " [not 32bitmode]" msgstr "" -#: elfxx-sparc.c:402 +#: elfxx-sparc.c:428 #, c-format msgid "invalid relocation type %d" msgstr "" -#: elfxx-sparc.c:2783 +#: elfxx-sparc.c:2899 msgid "%B: probably compiled without -fPIC?" msgstr "" -#: i386linux.c:457 m68klinux.c:461 sparclinux.c:458 +#: i386linux.c:454 m68klinux.c:458 sparclinux.c:453 #, c-format msgid "Output file requires shared library `%s'\n" msgstr "" -#: i386linux.c:465 m68klinux.c:469 sparclinux.c:466 +#: i386linux.c:462 m68klinux.c:466 sparclinux.c:461 #, c-format msgid "Output file requires shared library `%s.so.%s'\n" msgstr "" -#: i386linux.c:654 i386linux.c:704 m68klinux.c:661 m68klinux.c:709 -#: sparclinux.c:656 sparclinux.c:706 +#: i386linux.c:651 i386linux.c:701 m68klinux.c:658 m68klinux.c:706 +#: sparclinux.c:651 sparclinux.c:701 #, c-format msgid "Symbol %s not defined for fixups\n" msgstr "" -#: i386linux.c:728 m68klinux.c:733 sparclinux.c:730 +#: i386linux.c:725 m68klinux.c:730 sparclinux.c:725 msgid "Warning: fixup count mismatch\n" msgstr "" @@ -2479,161 +2730,161 @@ msgstr "" msgid "%B:%u: bad checksum in Intel Hex file (expected %u, found %u)" msgstr "" -#: ihex.c:389 +#: ihex.c:390 msgid "%B:%u: bad extended address record length in Intel Hex file" msgstr "" -#: ihex.c:406 +#: ihex.c:407 msgid "%B:%u: bad extended start address length in Intel Hex file" msgstr "" -#: ihex.c:423 +#: ihex.c:424 msgid "%B:%u: bad extended linear address record length in Intel Hex file" msgstr "" -#: ihex.c:440 +#: ihex.c:441 msgid "%B:%u: bad extended linear start address length in Intel Hex file" msgstr "" -#: ihex.c:457 +#: ihex.c:458 msgid "%B:%u: unrecognized ihex type %u in Intel Hex file" msgstr "" -#: ihex.c:578 +#: ihex.c:577 msgid "%B: internal error in ihex_read_section" msgstr "" -#: ihex.c:612 +#: ihex.c:611 msgid "%B: bad section length in ihex_read_section" msgstr "" -#: ihex.c:824 +#: ihex.c:823 #, c-format msgid "%s: address 0x%s out of range for Intel Hex file" msgstr "" -#: libbfd.c:961 +#: libbfd.c:978 #, c-format msgid "Deprecated %s called at %s line %d in %s\n" msgstr "" -#: libbfd.c:964 +#: libbfd.c:981 #, c-format msgid "Deprecated %s called\n" msgstr "" -#: linker.c:1873 +#: linker.c:1877 msgid "%B: indirect symbol `%s' to `%s' is a loop" msgstr "" -#: linker.c:2740 +#: linker.c:2743 #, c-format msgid "Attempt to do relocatable link with %s input and %s output" msgstr "" -#: linker.c:3037 +#: linker.c:3044 msgid "%B: warning: ignoring duplicate section `%A'\n" msgstr "" -#: linker.c:3051 +#: linker.c:3058 msgid "%B: warning: duplicate section `%A' has different size\n" msgstr "" -#: merge.c:817 +#: merge.c:818 #, c-format msgid "%s: access beyond end of merged section (%ld)" msgstr "" -#: mmo.c:456 +#: mmo.c:454 #, c-format msgid "%s: No core to allocate section name %s\n" msgstr "" -#: mmo.c:531 +#: mmo.c:529 #, c-format msgid "%s: No core to allocate a symbol %d bytes long\n" msgstr "" -#: mmo.c:1187 +#: mmo.c:1185 #, c-format msgid "%s: invalid mmo file: initialization value for $255 is not `Main'\n" msgstr "" -#: mmo.c:1332 +#: mmo.c:1330 #, c-format msgid "" "%s: unsupported wide character sequence 0x%02X 0x%02X after symbol name " "starting with `%s'\n" msgstr "" -#: mmo.c:1566 +#: mmo.c:1564 #, c-format msgid "%s: invalid mmo file: unsupported lopcode `%d'\n" msgstr "" -#: mmo.c:1576 +#: mmo.c:1574 #, c-format msgid "%s: invalid mmo file: expected YZ = 1 got YZ = %d for lop_quote\n" msgstr "" -#: mmo.c:1612 +#: mmo.c:1610 #, c-format msgid "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_loc\n" msgstr "" -#: mmo.c:1658 +#: mmo.c:1656 #, c-format msgid "" "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_fixo\n" msgstr "" -#: mmo.c:1697 +#: mmo.c:1695 #, c-format msgid "%s: invalid mmo file: expected y = 0, got y = %d for lop_fixrx\n" msgstr "" -#: mmo.c:1706 +#: mmo.c:1704 #, c-format msgid "" "%s: invalid mmo file: expected z = 16 or z = 24, got z = %d for lop_fixrx\n" msgstr "" -#: mmo.c:1729 +#: mmo.c:1727 #, c-format msgid "" "%s: invalid mmo file: leading byte of operand word must be 0 or 1, got %d " "for lop_fixrx\n" msgstr "" -#: mmo.c:1752 +#: mmo.c:1750 #, c-format msgid "%s: cannot allocate file name for file number %d, %d bytes\n" msgstr "" -#: mmo.c:1772 +#: mmo.c:1770 #, c-format msgid "" "%s: invalid mmo file: file number %d `%s', was already entered as `%s'\n" msgstr "" -#: mmo.c:1785 +#: mmo.c:1783 #, c-format msgid "" "%s: invalid mmo file: file name for number %d was not specified before use\n" msgstr "" -#: mmo.c:1892 +#: mmo.c:1890 #, c-format msgid "" "%s: invalid mmo file: fields y and z of lop_stab non-zero, y: %d, z: %d\n" msgstr "" -#: mmo.c:1928 +#: mmo.c:1926 #, c-format msgid "%s: invalid mmo file: lop_end not last item in file\n" msgstr "" -#: mmo.c:1941 +#: mmo.c:1939 #, c-format msgid "" "%s: invalid mmo file: YZ of lop_end (%ld) not equal to the number of tetras " @@ -2686,7 +2937,7 @@ msgid "" "08lx\n" msgstr "" -#: oasys.c:876 +#: oasys.c:880 #, c-format msgid "%s: can not represent section `%s' in oasys" msgstr "" @@ -2697,37 +2948,37 @@ msgid "Unhandled OSF/1 core file section type %d\n" msgstr "" #. XXX code yet to be written. -#: peicode.h:731 +#: peicode.h:757 msgid "%B: Unhandled import type; %x" msgstr "" -#: peicode.h:736 +#: peicode.h:762 msgid "%B: Unrecognised import type; %x" msgstr "" -#: peicode.h:750 +#: peicode.h:776 msgid "%B: Unrecognised import name type; %x" msgstr "" -#: peicode.h:1120 +#: peicode.h:1159 msgid "%B: Unrecognised machine type (0x%x) in Import Library Format archive" msgstr "" -#: peicode.h:1132 +#: peicode.h:1171 msgid "" "%B: Recognised but unhandled machine type (0x%x) in Import Library Format " "archive" msgstr "" -#: peicode.h:1150 +#: peicode.h:1189 msgid "%B: size field is zero in Import Library Format header" msgstr "" -#: peicode.h:1181 +#: peicode.h:1220 msgid "%B: string not null terminated in ILF object file." msgstr "" -#: pe-mips.c:588 +#: pe-mips.c:605 msgid "%B: `ld -r' not supported with PE MIPS objects\n" msgstr "" @@ -2735,75 +2986,75 @@ msgstr "" #. src = VMA of the memory we're fixing up #. mem = pointer to memory we're fixing up #. val = VMA of what we need to refer to. -#: pe-mips.c:704 +#: pe-mips.c:721 msgid "%B: unimplemented %s\n" msgstr "" -#: pe-mips.c:730 +#: pe-mips.c:747 msgid "%B: jump too far away\n" msgstr "" -#: pe-mips.c:756 +#: pe-mips.c:773 msgid "%B: bad pair/reflo after refhi\n" msgstr "" -#: ppcboot.c:419 +#: ppcboot.c:412 #, c-format msgid "" "\n" "ppcboot header:\n" msgstr "" -#: ppcboot.c:420 +#: ppcboot.c:413 #, c-format msgid "Entry offset = 0x%.8lx (%ld)\n" msgstr "" -#: ppcboot.c:421 +#: ppcboot.c:414 #, c-format msgid "Length = 0x%.8lx (%ld)\n" msgstr "" -#: ppcboot.c:424 +#: ppcboot.c:417 #, c-format msgid "Flag field = 0x%.2x\n" msgstr "" -#: ppcboot.c:430 +#: ppcboot.c:423 #, c-format msgid "Partition name = \"%s\"\n" msgstr "" -#: ppcboot.c:449 +#: ppcboot.c:442 #, c-format msgid "" "\n" "Partition[%d] start = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" msgstr "" -#: ppcboot.c:455 +#: ppcboot.c:448 #, c-format msgid "Partition[%d] end = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" msgstr "" -#: ppcboot.c:461 +#: ppcboot.c:454 #, c-format msgid "Partition[%d] sector = 0x%.8lx (%ld)\n" msgstr "" -#: ppcboot.c:462 +#: ppcboot.c:455 #, c-format msgid "Partition[%d] length = 0x%.8lx (%ld)\n" msgstr "" -#: som.c:5069 +#: som.c:5088 #, c-format msgid "" "\n" "Exec Auxiliary Header\n" msgstr "" -#: som.c:5330 +#: som.c:5349 msgid "som_sizeof_headers unimplemented" msgstr "" @@ -2811,11 +3062,11 @@ msgstr "" msgid "%B:%d: Unexpected character `%s' in S-record file\n" msgstr "" -#: stabs.c:276 +#: stabs.c:277 msgid "%B(%A+0x%lx): Stabs entry has invalid string index." msgstr "" -#: syms.c:1048 +#: syms.c:1056 msgid "Unsupported .stab relocation" msgstr "" @@ -2978,316 +3229,320 @@ msgstr "" msgid "Unhandled relocation %s" msgstr "" -#: xcofflink.c:564 +#: xcofflink.c:565 #, c-format msgid "%s: XCOFF shared object when not producing XCOFF output" msgstr "" -#: xcofflink.c:585 +#: xcofflink.c:586 #, c-format msgid "%s: dynamic object with no .loader section" msgstr "" -#: xcofflink.c:1148 +#: xcofflink.c:1149 msgid "%B: `%s' has line numbers but no enclosing section" msgstr "" -#: xcofflink.c:1200 +#: xcofflink.c:1201 msgid "%B: class %d symbol `%s' has no aux entries" msgstr "" -#: xcofflink.c:1223 +#: xcofflink.c:1224 msgid "%B: symbol `%s' has unrecognized csect type %d" msgstr "" -#: xcofflink.c:1235 +#: xcofflink.c:1236 msgid "%B: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d" msgstr "" -#: xcofflink.c:1271 +#: xcofflink.c:1272 msgid "%B: XMC_TC0 symbol `%s' is class %d scnlen %d" msgstr "" -#: xcofflink.c:1417 +#: xcofflink.c:1418 msgid "%B: csect `%s' not in enclosing section" msgstr "" -#: xcofflink.c:1524 +#: xcofflink.c:1525 msgid "%B: misplaced XTY_LD `%s'" msgstr "" -#: xcofflink.c:1839 +#: xcofflink.c:1841 msgid "%B: reloc %s:%d not in csect" msgstr "" -#: xcofflink.c:2637 +#: xcofflink.c:2639 #, c-format msgid "%s: no such symbol" msgstr "" -#: xcofflink.c:2866 +#: xcofflink.c:2868 #, c-format msgid "warning: attempt to export undefined symbol `%s'" msgstr "" -#: xcofflink.c:3033 +#: xcofflink.c:3035 msgid "error: undefined symbol __rtinit" msgstr "" -#: xcofflink.c:3653 +#: xcofflink.c:3655 #, c-format msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling" msgstr "" -#: xcofflink.c:4489 +#: xcofflink.c:4491 msgid "%B: loader reloc in unrecognized section `%A'" msgstr "" -#: xcofflink.c:4510 +#: xcofflink.c:4512 msgid "%B: `%s' in loader reloc but not loader sym" msgstr "" -#: xcofflink.c:4525 +#: xcofflink.c:4527 msgid "%B: loader reloc in read-only section %A" msgstr "" -#: xcofflink.c:4934 xcofflink.c:4996 xcofflink.c:5291 +#: xcofflink.c:4936 xcofflink.c:4998 xcofflink.c:5293 #, c-format msgid "%s: loader reloc in unrecognized section `%s'" msgstr "" -#: xcofflink.c:5302 +#: xcofflink.c:5304 #, c-format msgid "%s: `%s' in loader reloc but not loader sym" msgstr "" -#: elf32-ia64.c:1139 elf64-ia64.c:1139 +#: elf32-ia64.c:1168 elf64-ia64.c:1168 msgid "" "%B: Can't relax br at 0x%lx in section `%A'. Please use brl or indirect " "branch." msgstr "" -#: elf32-ia64.c:2508 elf64-ia64.c:2508 +#: elf32-ia64.c:2909 elf64-ia64.c:2909 msgid "@pltoff reloc against local symbol" msgstr "" -#: elf32-ia64.c:3955 elf64-ia64.c:3955 +#: elf32-ia64.c:4522 elf64-ia64.c:4522 #, c-format msgid "%s: short data segment overflowed (0x%lx >= 0x400000)" msgstr "" -#: elf32-ia64.c:3966 elf64-ia64.c:3966 +#: elf32-ia64.c:4533 elf64-ia64.c:4533 #, c-format msgid "%s: __gp does not cover short data segment" msgstr "" -#: elf32-ia64.c:4213 elf64-ia64.c:4213 +#: elf32-ia64.c:4807 elf64-ia64.c:4807 msgid "%B: non-pic code with imm relocation against dynamic symbol `%s'" msgstr "" -#: elf32-ia64.c:4280 elf64-ia64.c:4280 +#: elf32-ia64.c:4874 elf64-ia64.c:4874 msgid "%B: @gprel relocation against dynamic symbol %s" msgstr "" -#: elf32-ia64.c:4343 elf64-ia64.c:4343 +#: elf32-ia64.c:4937 elf64-ia64.c:4937 msgid "%B: linking non-pic code in a position independent executable" msgstr "" -#: elf32-ia64.c:4480 elf64-ia64.c:4480 +#: elf32-ia64.c:5074 elf64-ia64.c:5074 msgid "%B: @internal branch to dynamic symbol %s" msgstr "" -#: elf32-ia64.c:4482 elf64-ia64.c:4482 +#: elf32-ia64.c:5076 elf64-ia64.c:5076 msgid "%B: speculation fixup to dynamic symbol %s" msgstr "" -#: elf32-ia64.c:4484 elf64-ia64.c:4484 +#: elf32-ia64.c:5078 elf64-ia64.c:5078 msgid "%B: @pcrel relocation against dynamic symbol %s" msgstr "" -#: elf32-ia64.c:4691 elf64-ia64.c:4691 +#: elf32-ia64.c:5278 elf64-ia64.c:5278 msgid "unsupported reloc" msgstr "" -#: elf32-ia64.c:4724 elf64-ia64.c:4724 +#: elf32-ia64.c:5311 elf64-ia64.c:5311 msgid "" "%B: Can't relax br (%s) to `%s' at 0x%lx in section `%A' with size 0x%lx (> " "0x1000000)." msgstr "" -#: elf32-ia64.c:4985 elf64-ia64.c:4985 +#: elf32-ia64.c:5572 elf64-ia64.c:5572 msgid "%B: linking trap-on-NULL-dereference with non-trapping files" msgstr "" -#: elf32-ia64.c:4994 elf64-ia64.c:4994 +#: elf32-ia64.c:5581 elf64-ia64.c:5581 msgid "%B: linking big-endian files with little-endian files" msgstr "" -#: elf32-ia64.c:5003 elf64-ia64.c:5003 +#: elf32-ia64.c:5590 elf64-ia64.c:5590 msgid "%B: linking 64-bit files with 32-bit files" msgstr "" -#: elf32-ia64.c:5012 elf64-ia64.c:5012 +#: elf32-ia64.c:5599 elf64-ia64.c:5599 msgid "%B: linking constant-gp files with non-constant-gp files" msgstr "" -#: elf32-ia64.c:5022 elf64-ia64.c:5022 +#: elf32-ia64.c:5609 elf64-ia64.c:5609 msgid "%B: linking auto-pic files with non-auto-pic files" msgstr "" -#: peigen.c:979 pepigen.c:979 +#: peigen.c:998 pepigen.c:998 pex64igen.c:998 #, c-format msgid "%s: line number overflow: 0x%lx > 0xffff" msgstr "" -#: peigen.c:1006 pepigen.c:1006 +#: peigen.c:1025 pepigen.c:1025 pex64igen.c:1025 msgid "Export Directory [.edata (or where ever we found it)]" msgstr "" -#: peigen.c:1007 pepigen.c:1007 +#: peigen.c:1026 pepigen.c:1026 pex64igen.c:1026 msgid "Import Directory [parts of .idata]" msgstr "" -#: peigen.c:1008 pepigen.c:1008 +#: peigen.c:1027 pepigen.c:1027 pex64igen.c:1027 msgid "Resource Directory [.rsrc]" msgstr "" -#: peigen.c:1009 pepigen.c:1009 +#: peigen.c:1028 pepigen.c:1028 pex64igen.c:1028 msgid "Exception Directory [.pdata]" msgstr "" -#: peigen.c:1010 pepigen.c:1010 +#: peigen.c:1029 pepigen.c:1029 pex64igen.c:1029 msgid "Security Directory" msgstr "" -#: peigen.c:1011 pepigen.c:1011 +#: peigen.c:1030 pepigen.c:1030 pex64igen.c:1030 msgid "Base Relocation Directory [.reloc]" msgstr "" -#: peigen.c:1012 pepigen.c:1012 +#: peigen.c:1031 pepigen.c:1031 pex64igen.c:1031 msgid "Debug Directory" msgstr "" -#: peigen.c:1013 pepigen.c:1013 +#: peigen.c:1032 pepigen.c:1032 pex64igen.c:1032 msgid "Description Directory" msgstr "" -#: peigen.c:1014 pepigen.c:1014 +#: peigen.c:1033 pepigen.c:1033 pex64igen.c:1033 msgid "Special Directory" msgstr "" -#: peigen.c:1015 pepigen.c:1015 +#: peigen.c:1034 pepigen.c:1034 pex64igen.c:1034 msgid "Thread Storage Directory [.tls]" msgstr "" -#: peigen.c:1016 pepigen.c:1016 +#: peigen.c:1035 pepigen.c:1035 pex64igen.c:1035 msgid "Load Configuration Directory" msgstr "" -#: peigen.c:1017 pepigen.c:1017 +#: peigen.c:1036 pepigen.c:1036 pex64igen.c:1036 msgid "Bound Import Directory" msgstr "" -#: peigen.c:1018 pepigen.c:1018 +#: peigen.c:1037 pepigen.c:1037 pex64igen.c:1037 msgid "Import Address Table Directory" msgstr "" -#: peigen.c:1019 pepigen.c:1019 +#: peigen.c:1038 pepigen.c:1038 pex64igen.c:1038 msgid "Delay Import Directory" msgstr "" -#: peigen.c:1020 peigen.c:1021 pepigen.c:1020 pepigen.c:1021 +#: peigen.c:1039 pepigen.c:1039 pex64igen.c:1039 +msgid "CLR Runtime Header" +msgstr "" + +#: peigen.c:1040 pepigen.c:1040 pex64igen.c:1040 msgid "Reserved" msgstr "" -#: peigen.c:1081 pepigen.c:1081 +#: peigen.c:1100 pepigen.c:1100 pex64igen.c:1100 #, c-format msgid "" "\n" "There is an import table, but the section containing it could not be found\n" msgstr "" -#: peigen.c:1086 pepigen.c:1086 +#: peigen.c:1105 pepigen.c:1105 pex64igen.c:1105 #, c-format msgid "" "\n" "There is an import table in %s at 0x%lx\n" msgstr "" -#: peigen.c:1129 pepigen.c:1129 +#: peigen.c:1148 pepigen.c:1148 pex64igen.c:1148 #, c-format msgid "" "\n" "Function descriptor located at the start address: %04lx\n" msgstr "" -#: peigen.c:1132 pepigen.c:1132 +#: peigen.c:1151 pepigen.c:1151 pex64igen.c:1151 #, c-format msgid "\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n" msgstr "" -#: peigen.c:1140 pepigen.c:1140 +#: peigen.c:1159 pepigen.c:1159 pex64igen.c:1159 #, c-format msgid "" "\n" "No reldata section! Function descriptor not decoded.\n" msgstr "" -#: peigen.c:1145 pepigen.c:1145 +#: peigen.c:1164 pepigen.c:1164 pex64igen.c:1164 #, c-format msgid "" "\n" "The Import Tables (interpreted %s section contents)\n" msgstr "" -#: peigen.c:1148 pepigen.c:1148 +#: peigen.c:1167 pepigen.c:1167 pex64igen.c:1167 #, c-format msgid "" " vma: Hint Time Forward DLL First\n" " Table Stamp Chain Name Thunk\n" msgstr "" -#: peigen.c:1196 pepigen.c:1196 +#: peigen.c:1215 pepigen.c:1215 pex64igen.c:1215 #, c-format msgid "" "\n" "\tDLL Name: %s\n" msgstr "" -#: peigen.c:1207 pepigen.c:1207 +#: peigen.c:1226 pepigen.c:1226 pex64igen.c:1226 #, c-format msgid "\tvma: Hint/Ord Member-Name Bound-To\n" msgstr "" -#: peigen.c:1232 pepigen.c:1232 +#: peigen.c:1251 pepigen.c:1251 pex64igen.c:1251 #, c-format msgid "" "\n" "There is a first thunk, but the section containing it could not be found\n" msgstr "" -#: peigen.c:1365 pepigen.c:1365 +#: peigen.c:1416 pepigen.c:1416 pex64igen.c:1416 #, c-format msgid "" "\n" "There is an export table, but the section containing it could not be found\n" msgstr "" -#: peigen.c:1374 pepigen.c:1374 +#: peigen.c:1425 pepigen.c:1425 pex64igen.c:1425 #, c-format msgid "" "\n" "There is an export table in %s, but it does not fit into that section\n" msgstr "" -#: peigen.c:1380 pepigen.c:1380 +#: peigen.c:1431 pepigen.c:1431 pex64igen.c:1431 #, c-format msgid "" "\n" "There is an export table in %s at 0x%lx\n" msgstr "" -#: peigen.c:1408 pepigen.c:1408 +#: peigen.c:1459 pepigen.c:1459 pex64igen.c:1459 #, c-format msgid "" "\n" @@ -3295,128 +3550,128 @@ msgid "" "\n" msgstr "" -#: peigen.c:1412 pepigen.c:1412 +#: peigen.c:1463 pepigen.c:1463 pex64igen.c:1463 #, c-format msgid "Export Flags \t\t\t%lx\n" msgstr "" -#: peigen.c:1415 pepigen.c:1415 +#: peigen.c:1466 pepigen.c:1466 pex64igen.c:1466 #, c-format msgid "Time/Date stamp \t\t%lx\n" msgstr "" -#: peigen.c:1418 pepigen.c:1418 +#: peigen.c:1469 pepigen.c:1469 pex64igen.c:1469 #, c-format msgid "Major/Minor \t\t\t%d/%d\n" msgstr "" -#: peigen.c:1421 pepigen.c:1421 +#: peigen.c:1472 pepigen.c:1472 pex64igen.c:1472 #, c-format msgid "Name \t\t\t\t" msgstr "" -#: peigen.c:1427 pepigen.c:1427 +#: peigen.c:1478 pepigen.c:1478 pex64igen.c:1478 #, c-format msgid "Ordinal Base \t\t\t%ld\n" msgstr "" -#: peigen.c:1430 pepigen.c:1430 +#: peigen.c:1481 pepigen.c:1481 pex64igen.c:1481 #, c-format msgid "Number in:\n" msgstr "" -#: peigen.c:1433 pepigen.c:1433 +#: peigen.c:1484 pepigen.c:1484 pex64igen.c:1484 #, c-format msgid "\tExport Address Table \t\t%08lx\n" msgstr "" -#: peigen.c:1437 pepigen.c:1437 +#: peigen.c:1488 pepigen.c:1488 pex64igen.c:1488 #, c-format msgid "\t[Name Pointer/Ordinal] Table\t%08lx\n" msgstr "" -#: peigen.c:1440 pepigen.c:1440 +#: peigen.c:1491 pepigen.c:1491 pex64igen.c:1491 #, c-format msgid "Table Addresses\n" msgstr "" -#: peigen.c:1443 pepigen.c:1443 +#: peigen.c:1494 pepigen.c:1494 pex64igen.c:1494 #, c-format msgid "\tExport Address Table \t\t" msgstr "" -#: peigen.c:1448 pepigen.c:1448 +#: peigen.c:1499 pepigen.c:1499 pex64igen.c:1499 #, c-format msgid "\tName Pointer Table \t\t" msgstr "" -#: peigen.c:1453 pepigen.c:1453 +#: peigen.c:1504 pepigen.c:1504 pex64igen.c:1504 #, c-format msgid "\tOrdinal Table \t\t\t" msgstr "" -#: peigen.c:1467 pepigen.c:1467 +#: peigen.c:1518 pepigen.c:1518 pex64igen.c:1518 #, c-format msgid "" "\n" "Export Address Table -- Ordinal Base %ld\n" msgstr "" -#: peigen.c:1486 pepigen.c:1486 +#: peigen.c:1537 pepigen.c:1537 pex64igen.c:1537 msgid "Forwarder RVA" msgstr "" -#: peigen.c:1497 pepigen.c:1497 +#: peigen.c:1548 pepigen.c:1548 pex64igen.c:1548 msgid "Export RVA" msgstr "" -#: peigen.c:1504 pepigen.c:1504 +#: peigen.c:1555 pepigen.c:1555 pex64igen.c:1555 #, c-format msgid "" "\n" "[Ordinal/Name Pointer] Table\n" msgstr "" -#: peigen.c:1557 pepigen.c:1557 +#: peigen.c:1608 pepigen.c:1608 pex64igen.c:1608 #, c-format msgid "Warning, .pdata section size (%ld) is not a multiple of %d\n" msgstr "" -#: peigen.c:1561 pepigen.c:1561 +#: peigen.c:1612 pepigen.c:1612 pex64igen.c:1612 #, c-format msgid "" "\n" "The Function Table (interpreted .pdata section contents)\n" msgstr "" -#: peigen.c:1564 pepigen.c:1564 +#: peigen.c:1615 pepigen.c:1615 pex64igen.c:1615 #, c-format msgid " vma:\t\t\tBegin Address End Address Unwind Info\n" msgstr "" -#: peigen.c:1566 pepigen.c:1566 +#: peigen.c:1617 pepigen.c:1617 pex64igen.c:1617 #, c-format msgid "" " vma:\t\tBegin End EH EH PrologEnd Exception\n" " \t\tAddress Address Handler Data Address Mask\n" msgstr "" -#: peigen.c:1636 pepigen.c:1636 +#: peigen.c:1687 pepigen.c:1687 pex64igen.c:1687 #, c-format msgid " Register save millicode" msgstr "" -#: peigen.c:1639 pepigen.c:1639 +#: peigen.c:1690 pepigen.c:1690 pex64igen.c:1690 #, c-format msgid " Register restore millicode" msgstr "" -#: peigen.c:1642 pepigen.c:1642 +#: peigen.c:1693 pepigen.c:1693 pex64igen.c:1693 #, c-format msgid " Glue code sequence" msgstr "" -#: peigen.c:1692 pepigen.c:1692 +#: peigen.c:1743 pepigen.c:1743 pex64igen.c:1743 #, c-format msgid "" "\n" @@ -3424,14 +3679,14 @@ msgid "" "PE File Base Relocations (interpreted .reloc section contents)\n" msgstr "" -#: peigen.c:1722 pepigen.c:1722 +#: peigen.c:1773 pepigen.c:1773 pex64igen.c:1773 #, c-format msgid "" "\n" "Virtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n" msgstr "" -#: peigen.c:1735 pepigen.c:1735 +#: peigen.c:1786 pepigen.c:1786 pex64igen.c:1786 #, c-format msgid "\treloc %4d offset %4x [%4lx] %s" msgstr "" @@ -3439,9 +3694,31 @@ msgstr "" #. The MS dumpbin program reportedly ands with 0xff0f before #. printing the characteristics field. Not sure why. No reason to #. emulate it here. -#: peigen.c:1773 pepigen.c:1773 +#: peigen.c:1825 pepigen.c:1825 pex64igen.c:1825 #, c-format msgid "" "\n" "Characteristics 0x%x\n" msgstr "" + +#: peigen.c:2086 pepigen.c:2086 pex64igen.c:2086 +msgid "%B: unable to fill in DataDictionary[1] because .idata$2 is missing" +msgstr "" + +#: peigen.c:2104 pepigen.c:2104 pex64igen.c:2104 +msgid "%B: unable to fill in DataDictionary[1] because .idata$4 is missing" +msgstr "" + +#: peigen.c:2123 pepigen.c:2123 pex64igen.c:2123 +msgid "%B: unable to fill in DataDictionary[12] because .idata$5 is missing" +msgstr "" + +#: peigen.c:2141 pepigen.c:2141 pex64igen.c:2141 +msgid "" +"%B: unable to fill in DataDictionary[PE_IMPORT_ADDRESS_TABLE (12)] because ." +"idata$6 is missing" +msgstr "" + +#: peigen.c:2161 pepigen.c:2161 pex64igen.c:2161 +msgid "%B: unable to fill in DataDictionary[9] because __tls_used is missing" +msgstr "" diff --git a/bfd/po/da.gmo b/bfd/po/da.gmo deleted file mode 100644 index 944a11c1610..00000000000 Binary files a/bfd/po/da.gmo and /dev/null differ diff --git a/bfd/po/es.gmo b/bfd/po/es.gmo deleted file mode 100644 index 4097899662a..00000000000 Binary files a/bfd/po/es.gmo and /dev/null differ diff --git a/bfd/po/fr.gmo b/bfd/po/fr.gmo deleted file mode 100644 index 1a6948d5b93..00000000000 Binary files a/bfd/po/fr.gmo and /dev/null differ diff --git a/bfd/po/ja.gmo b/bfd/po/ja.gmo deleted file mode 100644 index f8142480577..00000000000 Binary files a/bfd/po/ja.gmo and /dev/null differ diff --git a/bfd/po/ro.gmo b/bfd/po/ro.gmo deleted file mode 100644 index 8621928313f..00000000000 Binary files a/bfd/po/ro.gmo and /dev/null differ diff --git a/bfd/po/rw.gmo b/bfd/po/rw.gmo deleted file mode 100644 index 49d9e2fd45e..00000000000 Binary files a/bfd/po/rw.gmo and /dev/null differ diff --git a/bfd/po/sv.gmo b/bfd/po/sv.gmo deleted file mode 100644 index e746ec02e75..00000000000 Binary files a/bfd/po/sv.gmo and /dev/null differ diff --git a/bfd/po/tr.gmo b/bfd/po/tr.gmo deleted file mode 100644 index 74c0ea8fc2d..00000000000 Binary files a/bfd/po/tr.gmo and /dev/null differ diff --git a/bfd/po/vi.gmo b/bfd/po/vi.gmo deleted file mode 100644 index f5683c6169d..00000000000 Binary files a/bfd/po/vi.gmo and /dev/null differ diff --git a/bfd/po/zh_CN.gmo b/bfd/po/zh_CN.gmo deleted file mode 100644 index 501f89d427f..00000000000 Binary files a/bfd/po/zh_CN.gmo and /dev/null differ diff --git a/bfd/ppcboot.c b/bfd/ppcboot.c index 7c8a4190bac..da8c6b8019b 100644 --- a/bfd/ppcboot.c +++ b/bfd/ppcboot.c @@ -1,6 +1,6 @@ /* BFD back-end for PPCbug boot records. - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, + 2007 Free Software Foundation, Inc. Written by Michael Meissner, Cygnus Support, This file is part of BFD, the Binary File Descriptor library. @@ -32,9 +32,9 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. the file. objcopy cooperates by specially setting the start address to zero by default. */ +#include "sysdep.h" #include "safe-ctype.h" #include "bfd.h" -#include "sysdep.h" #include "libbfd.h" /* PPCbug location structure */ @@ -99,7 +99,6 @@ static long ppcboot_canonicalize_symtab PARAMS ((bfd *, asymbol **)); static void ppcboot_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); static bfd_boolean ppcboot_set_section_contents PARAMS ((bfd *, asection *, const PTR, file_ptr, bfd_size_type)); -static int ppcboot_sizeof_headers PARAMS ((bfd *, bfd_boolean)); static bfd_boolean ppcboot_bfd_print_private_bfd_data PARAMS ((bfd *, PTR)); #define ppcboot_set_tdata(abfd, ptr) ((abfd)->tdata.any = (PTR) (ptr)) @@ -151,6 +150,7 @@ ppcboot_object_p (abfd) ppcboot_hdr_t hdr; size_t i; ppcboot_data_t *tdata; + flagword flags; BFD_ASSERT (sizeof (ppcboot_hdr_t) == 1024); @@ -205,10 +205,10 @@ ppcboot_object_p (abfd) abfd->symcount = PPCBOOT_SYMS; /* One data section. */ - sec = bfd_make_section (abfd, ".data"); + flags = SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_CODE | SEC_HAS_CONTENTS; + sec = bfd_make_section_with_flags (abfd, ".data", flags); if (sec == NULL) return NULL; - sec->flags = SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_CODE | SEC_HAS_CONTENTS; sec->vma = 0; sec->size = statbuf.st_size - sizeof (ppcboot_hdr_t); sec->filepos = sizeof (ppcboot_hdr_t); @@ -354,12 +354,6 @@ ppcboot_get_symbol_info (ignore_abfd, symbol, ret) #define ppcboot_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define ppcboot_read_minisymbols _bfd_generic_read_minisymbols #define ppcboot_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol - -#define ppcboot_get_reloc_upper_bound \ - ((long (*) PARAMS ((bfd *, asection *))) bfd_0l) -#define ppcboot_canonicalize_reloc \ - ((long (*) PARAMS ((bfd *, asection *, arelent **, asymbol **))) bfd_0l) -#define ppcboot_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup /* Write section contents of a ppcboot file. */ @@ -395,9 +389,8 @@ ppcboot_set_section_contents (abfd, sec, data, offset, size) static int -ppcboot_sizeof_headers (abfd, exec) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_boolean exec ATTRIBUTE_UNUSED; +ppcboot_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return sizeof (ppcboot_hdr_t); } @@ -535,7 +528,7 @@ const bfd_target ppcboot_vec = BFD_JUMP_TABLE_CORE (_bfd_nocore), BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), BFD_JUMP_TABLE_SYMBOLS (ppcboot), - BFD_JUMP_TABLE_RELOCS (ppcboot), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), BFD_JUMP_TABLE_WRITE (ppcboot), BFD_JUMP_TABLE_LINK (ppcboot), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), diff --git a/bfd/ptrace-core.c b/bfd/ptrace-core.c index 4ac28aa1dec..8607225da16 100644 --- a/bfd/ptrace-core.c +++ b/bfd/ptrace-core.c @@ -1,6 +1,6 @@ /* BFD backend for core files which use the ptrace_user structure - Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002, 2003, 2004, + 2006, 2007 Free Software Foundation, Inc. The structure of this file is based on trad-core.c written by John Gilmore of Cygnus Support. Modified to work with the ptrace_user structure by Kevin A. Buettner. @@ -24,8 +24,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #ifdef PTRACE_CORE -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include @@ -63,6 +63,7 @@ ptrace_unix_core_file_p (abfd) struct ptrace_user u; struct trad_core_struct *rawptr; bfd_size_type amt; + flagword flags; val = bfd_bread ((void *)&u, (bfd_size_type) sizeof u, abfd); if (val != sizeof u || u.pt_magic != _BCS_PTRACE_MAGIC @@ -89,13 +90,17 @@ ptrace_unix_core_file_p (abfd) /* Create the sections. */ - core_stacksec (abfd) = bfd_make_section_anyway (abfd, ".stack"); + flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; + core_stacksec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".stack", + flags); if (core_stacksec (abfd) == NULL) goto fail; - core_datasec (abfd) = bfd_make_section_anyway (abfd, ".data"); + core_datasec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".data", + flags); if (core_datasec (abfd) == NULL) goto fail; - core_regsec (abfd) = bfd_make_section_anyway (abfd, ".reg"); + core_regsec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".reg", + SEC_HAS_CONTENTS); if (core_regsec (abfd) == NULL) goto fail; @@ -103,10 +108,6 @@ ptrace_unix_core_file_p (abfd) text. I don't think that any of these things are supported on the system on which I am developing this for though. */ - core_stacksec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; - core_datasec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; - core_regsec (abfd)->flags = SEC_HAS_CONTENTS; - core_datasec (abfd)->size = u.pt_dsize; core_stacksec (abfd)->size = u.pt_ssize; core_regsec (abfd)->size = sizeof (u); diff --git a/bfd/reloc.c b/bfd/reloc.c index f1d09a5ab07..1e5d4bd03fa 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -1,6 +1,6 @@ /* BFD support for handling relocation entries. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -47,8 +47,8 @@ SECTION /* DO compile in the reloc_code name table from libbfd.h. */ #define _BFD_MAKE_TABLE_bfd_reloc_code_real -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" /* @@ -1522,7 +1522,6 @@ _bfd_relocate_contents (reloc_howto_type *howto, switch (size) { default: - case 0: abort (); case 1: bfd_put_8 (input_bfd, x, location); @@ -1545,6 +1544,72 @@ _bfd_relocate_contents (reloc_howto_type *howto, return flag; } +/* Clear a given location using a given howto, by applying a relocation value + of zero and discarding any in-place addend. This is used for fixed-up + relocations against discarded symbols, to make ignorable debug or unwind + information more obvious. */ + +void +_bfd_clear_contents (reloc_howto_type *howto, + bfd *input_bfd, + bfd_byte *location) +{ + int size; + bfd_vma x = 0; + + /* Get the value we are going to relocate. */ + size = bfd_get_reloc_size (howto); + switch (size) + { + default: + case 0: + abort (); + case 1: + x = bfd_get_8 (input_bfd, location); + break; + case 2: + x = bfd_get_16 (input_bfd, location); + break; + case 4: + x = bfd_get_32 (input_bfd, location); + break; + case 8: +#ifdef BFD64 + x = bfd_get_64 (input_bfd, location); +#else + abort (); +#endif + break; + } + + /* Zero out the unwanted bits of X. */ + x &= ~howto->dst_mask; + + /* Put the relocated value back in the object file. */ + switch (size) + { + default: + case 0: + abort (); + case 1: + bfd_put_8 (input_bfd, x, location); + break; + case 2: + bfd_put_16 (input_bfd, x, location); + break; + case 4: + bfd_put_32 (input_bfd, x, location); + break; + case 8: +#ifdef BFD64 + bfd_put_64 (input_bfd, x, location); +#else + abort (); +#endif + break; + } +} + /* DOCDD INODE @@ -1883,6 +1948,37 @@ ENUMX ENUMDOC SPARC TLS relocations +ENUM + BFD_RELOC_SPU_IMM7 +ENUMX + BFD_RELOC_SPU_IMM8 +ENUMX + BFD_RELOC_SPU_IMM10 +ENUMX + BFD_RELOC_SPU_IMM10W +ENUMX + BFD_RELOC_SPU_IMM16 +ENUMX + BFD_RELOC_SPU_IMM16W +ENUMX + BFD_RELOC_SPU_IMM18 +ENUMX + BFD_RELOC_SPU_PCREL9a +ENUMX + BFD_RELOC_SPU_PCREL9b +ENUMX + BFD_RELOC_SPU_PCREL16 +ENUMX + BFD_RELOC_SPU_LO16 +ENUMX + BFD_RELOC_SPU_HI16 +ENUMX + BFD_RELOC_SPU_PPU32 +ENUMX + BFD_RELOC_SPU_PPU64 +ENUMDOC + SPU Relocations. + ENUM BFD_RELOC_ALPHA_GPDISP_HI16 ENUMDOC @@ -2701,6 +2797,24 @@ ENUM BFD_RELOC_ARM_PREL31 ENUMDOC 31-bit PC relative address. +ENUM + BFD_RELOC_ARM_MOVW +ENUMX + BFD_RELOC_ARM_MOVT +ENUMX + BFD_RELOC_ARM_MOVW_PCREL +ENUMX + BFD_RELOC_ARM_MOVT_PCREL +ENUMX + BFD_RELOC_ARM_THUMB_MOVW +ENUMX + BFD_RELOC_ARM_THUMB_MOVT +ENUMX + BFD_RELOC_ARM_THUMB_MOVW_PCREL +ENUMX + BFD_RELOC_ARM_THUMB_MOVT_PCREL +ENUMDOC + Low and High halfword relocations for MOVW and MOVT instructions. ENUM BFD_RELOC_ARM_JUMP_SLOT @@ -2738,12 +2852,73 @@ ENUMX ENUMDOC ARM thread-local storage relocations. +ENUM + BFD_RELOC_ARM_ALU_PC_G0_NC +ENUMX + BFD_RELOC_ARM_ALU_PC_G0 +ENUMX + BFD_RELOC_ARM_ALU_PC_G1_NC +ENUMX + BFD_RELOC_ARM_ALU_PC_G1 +ENUMX + BFD_RELOC_ARM_ALU_PC_G2 +ENUMX + BFD_RELOC_ARM_LDR_PC_G0 +ENUMX + BFD_RELOC_ARM_LDR_PC_G1 +ENUMX + BFD_RELOC_ARM_LDR_PC_G2 +ENUMX + BFD_RELOC_ARM_LDRS_PC_G0 +ENUMX + BFD_RELOC_ARM_LDRS_PC_G1 +ENUMX + BFD_RELOC_ARM_LDRS_PC_G2 +ENUMX + BFD_RELOC_ARM_LDC_PC_G0 +ENUMX + BFD_RELOC_ARM_LDC_PC_G1 +ENUMX + BFD_RELOC_ARM_LDC_PC_G2 +ENUMX + BFD_RELOC_ARM_ALU_SB_G0_NC +ENUMX + BFD_RELOC_ARM_ALU_SB_G0 +ENUMX + BFD_RELOC_ARM_ALU_SB_G1_NC +ENUMX + BFD_RELOC_ARM_ALU_SB_G1 +ENUMX + BFD_RELOC_ARM_ALU_SB_G2 +ENUMX + BFD_RELOC_ARM_LDR_SB_G0 +ENUMX + BFD_RELOC_ARM_LDR_SB_G1 +ENUMX + BFD_RELOC_ARM_LDR_SB_G2 +ENUMX + BFD_RELOC_ARM_LDRS_SB_G0 +ENUMX + BFD_RELOC_ARM_LDRS_SB_G1 +ENUMX + BFD_RELOC_ARM_LDRS_SB_G2 +ENUMX + BFD_RELOC_ARM_LDC_SB_G0 +ENUMX + BFD_RELOC_ARM_LDC_SB_G1 +ENUMX + BFD_RELOC_ARM_LDC_SB_G2 +ENUMDOC + ARM group relocations. + ENUM BFD_RELOC_ARM_IMMEDIATE ENUMX BFD_RELOC_ARM_ADRL_IMMEDIATE ENUMX BFD_RELOC_ARM_T32_IMMEDIATE +ENUMX + BFD_RELOC_ARM_T32_ADD_IMM ENUMX BFD_RELOC_ARM_T32_IMM12 ENUMX @@ -3529,6 +3704,50 @@ ENUMX ENUMDOC Motorola Mcore relocations. +ENUM + BFD_RELOC_MEP_8 +ENUMX + BFD_RELOC_MEP_16 +ENUMX + BFD_RELOC_MEP_32 +ENUMX + BFD_RELOC_MEP_PCREL8A2 +ENUMX + BFD_RELOC_MEP_PCREL12A2 +ENUMX + BFD_RELOC_MEP_PCREL17A2 +ENUMX + BFD_RELOC_MEP_PCREL24A2 +ENUMX + BFD_RELOC_MEP_PCABS24A2 +ENUMX + BFD_RELOC_MEP_LOW16 +ENUMX + BFD_RELOC_MEP_HI16U +ENUMX + BFD_RELOC_MEP_HI16S +ENUMX + BFD_RELOC_MEP_GPREL +ENUMX + BFD_RELOC_MEP_TPREL +ENUMX + BFD_RELOC_MEP_TPREL7 +ENUMX + BFD_RELOC_MEP_TPREL7A2 +ENUMX + BFD_RELOC_MEP_TPREL7A4 +ENUMX + BFD_RELOC_MEP_UIMM24 +ENUMX + BFD_RELOC_MEP_ADDR24A4 +ENUMX + BFD_RELOC_MEP_GNU_VTINHERIT +ENUMX + BFD_RELOC_MEP_GNU_VTENTRY +ENUMDOC + Toshiba Media Processor Relocations. +COMMENT + ENUM BFD_RELOC_MMIX_GETA ENUMX @@ -3665,11 +3884,25 @@ ENUM ENUMDOC This is a 16 bit reloc for the AVR that stores 8 bit value (usually command address) into 8 bit immediate value of LDI insn. +ENUM + BFD_RELOC_AVR_LO8_LDI_GS +ENUMDOC + This is a 16 bit reloc for the AVR that stores 8 bit value + (command address) into 8 bit immediate value of LDI insn. If the address + is beyond the 128k boundary, the linker inserts a jump stub for this reloc + in the lower 128k. ENUM BFD_RELOC_AVR_HI8_LDI_PM ENUMDOC This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit of command address) into 8 bit immediate value of LDI insn. +ENUM + BFD_RELOC_AVR_HI8_LDI_GS +ENUMDOC + This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit + of command address) into 8 bit immediate value of LDI insn. If the address + is beyond the 128k boundary, the linker inserts a jump stub for this reloc + below 128k. ENUM BFD_RELOC_AVR_HH8_LDI_PM ENUMDOC @@ -3872,6 +4105,43 @@ ENUMX ENUMDOC Long displacement extension. +ENUM + BFD_RELOC_SCORE_DUMMY1 +ENUMDOC + Score relocations +ENUM + BFD_RELOC_SCORE_GPREL15 +ENUMDOC + Low 16 bit for load/store +ENUM + BFD_RELOC_SCORE_DUMMY2 +ENUMX + BFD_RELOC_SCORE_JMP +ENUMDOC + This is a 24-bit reloc with the right 1 bit assumed to be 0 +ENUM + BFD_RELOC_SCORE_BRANCH +ENUMDOC + This is a 19-bit reloc with the right 1 bit assumed to be 0 +ENUM + BFD_RELOC_SCORE16_JMP +ENUMDOC + This is a 11-bit reloc with the right 1 bit assumed to be 0 +ENUM + BFD_RELOC_SCORE16_BRANCH +ENUMDOC + This is a 8-bit reloc with the right 1 bit assumed to be 0 +ENUM + BFD_RELOC_SCORE_GOT15 +ENUMX + BFD_RELOC_SCORE_GOT_LO16 +ENUMX + BFD_RELOC_SCORE_CALL15 +ENUMX + BFD_RELOC_SCORE_DUMMY_HI16 +ENUMDOC + Undocumented Score relocs + ENUM BFD_RELOC_IP2K_FR9 ENUMDOC @@ -4245,6 +4515,63 @@ ENUMX ENUMDOC NS CR16C Relocations. +ENUM + BFD_RELOC_CR16_NUM8 +ENUMX + BFD_RELOC_CR16_NUM16 +ENUMX + BFD_RELOC_CR16_NUM32 +ENUMX + BFD_RELOC_CR16_NUM32a +ENUMX + BFD_RELOC_CR16_REGREL0 +ENUMX + BFD_RELOC_CR16_REGREL4 +ENUMX + BFD_RELOC_CR16_REGREL4a +ENUMX + BFD_RELOC_CR16_REGREL14 +ENUMX + BFD_RELOC_CR16_REGREL14a +ENUMX + BFD_RELOC_CR16_REGREL16 +ENUMX + BFD_RELOC_CR16_REGREL20 +ENUMX + BFD_RELOC_CR16_REGREL20a +ENUMX + BFD_RELOC_CR16_ABS20 +ENUMX + BFD_RELOC_CR16_ABS24 +ENUMX + BFD_RELOC_CR16_IMM4 +ENUMX + BFD_RELOC_CR16_IMM8 +ENUMX + BFD_RELOC_CR16_IMM16 +ENUMX + BFD_RELOC_CR16_IMM20 +ENUMX + BFD_RELOC_CR16_IMM24 +ENUMX + BFD_RELOC_CR16_IMM32 +ENUMX + BFD_RELOC_CR16_IMM32a +ENUMX + BFD_RELOC_CR16_DISP4 +ENUMX + BFD_RELOC_CR16_DISP8 +ENUMX + BFD_RELOC_CR16_DISP16 +ENUMX + BFD_RELOC_CR16_DISP20 +ENUMX + BFD_RELOC_CR16_DISP24 +ENUMX + BFD_RELOC_CR16_DISP24a +ENUMDOC + NS CR16 Relocations. + ENUM BFD_RELOC_CRX_REL4 ENUMX @@ -4448,6 +4775,12 @@ ENUMX ENUMDOC Sony Xstormy16 Relocations. +ENUM + BFD_RELOC_RELC +ENUMDOC + Self-describing complex relocations. +COMMENT + ENUM BFD_RELOC_XC16X_PAG ENUMX @@ -4670,10 +5003,13 @@ CODE_FRAGMENT /* FUNCTION bfd_reloc_type_lookup + bfd_reloc_name_lookup SYNOPSIS reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); + reloc_howto_type *bfd_reloc_name_lookup + (bfd *abfd, const char *reloc_name); DESCRIPTION Return a pointer to a howto structure which, when @@ -4688,6 +5024,12 @@ bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) return BFD_SEND (abfd, reloc_type_lookup, (abfd, code)); } +reloc_howto_type * +bfd_reloc_name_lookup (bfd *abfd, const char *reloc_name) +{ + return BFD_SEND (abfd, reloc_name_lookup, (abfd, reloc_name)); +} + static reloc_howto_type bfd_howto_32 = HOWTO (0, 00, 2, 32, FALSE, 0, complain_overflow_dont, 0, "VRT32", FALSE, 0xffffffff, 0xffffffff, TRUE); @@ -4876,13 +5218,31 @@ bfd_generic_get_relocated_section_contents (bfd *abfd, for (parent = reloc_vector; *parent != NULL; parent++) { char *error_message = NULL; - bfd_reloc_status_type r = - bfd_perform_relocation (input_bfd, - *parent, - data, - input_section, - relocatable ? abfd : NULL, - &error_message); + asymbol *symbol; + bfd_reloc_status_type r; + + symbol = *(*parent)->sym_ptr_ptr; + if (symbol->section && elf_discarded_section (symbol->section)) + { + bfd_byte *p; + static reloc_howto_type none_howto + = HOWTO (0, 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, + "unused", FALSE, 0, 0, FALSE); + + p = data + (*parent)->address * bfd_octets_per_byte (input_bfd); + _bfd_clear_contents ((*parent)->howto, input_bfd, p); + (*parent)->sym_ptr_ptr = bfd_abs_section.symbol_ptr_ptr; + (*parent)->addend = 0; + (*parent)->howto = &none_howto; + r = bfd_reloc_ok; + } + else + r = bfd_perform_relocation (input_bfd, + *parent, + data, + input_section, + relocatable ? abfd : NULL, + &error_message); if (relocatable) { diff --git a/bfd/reloc16.c b/bfd/reloc16.c index 3adbbc75cd1..f5c78b2c73b 100644 --- a/bfd/reloc16.c +++ b/bfd/reloc16.c @@ -1,6 +1,6 @@ /* 8 and 16 bit COFF relocation functions, for BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001, - 2002, 2003, 2004 Free Software Foundation, Inc. + 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -32,8 +32,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. file) (unless info->keep_memory is FALSE, in which case they should free up the relocs after dealing with them). */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" #include "genlink.h" diff --git a/bfd/riscix.c b/bfd/riscix.c index 182707981e4..2e9416e1269 100644 --- a/bfd/riscix.c +++ b/bfd/riscix.c @@ -1,6 +1,6 @@ /* BFD back-end for RISC iX (Acorn, arm) binaries. Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, - 2005 Free Software Foundation, Inc. + 2005, 2007 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) This file is part of BFD, the Binary File Descriptor library. @@ -103,8 +103,8 @@ && ((x).a_info != NMAGIC)) #define N_MAGIC(x) ((x).a_info & ~07200) -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #define WRITE_HEADERS(abfd, execp) \ @@ -274,12 +274,29 @@ riscix_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) } } +static reloc_howto_type * +riscix_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (riscix_std_reloc_howto) / sizeof (riscix_std_reloc_howto[0]); + i++) + if (riscix_std_reloc_howto[i].name != NULL + && strcasecmp (riscix_std_reloc_howto[i].name, r_name) == 0) + return &riscix_std_reloc_howto[i]; + + return NULL; +} + #define MY_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define MY_bfd_link_add_symbols _bfd_generic_link_add_symbols #define MY_final_link_callback should_not_be_used #define MY_bfd_final_link _bfd_generic_final_link #define MY_bfd_reloc_type_lookup riscix_reloc_type_lookup +#define MY_bfd_reloc_name_lookup riscix_reloc_name_lookup #define MY_canonicalize_reloc riscix_canonicalize_reloc #define MY_object_p riscix_object_p diff --git a/bfd/rs6000-core.c b/bfd/rs6000-core.c index 280a020a754..4a2e107d3d7 100644 --- a/bfd/rs6000-core.c +++ b/bfd/rs6000-core.c @@ -1,13 +1,8 @@ /* IBM RS/6000 "XCOFF" back-end for BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, - 2001, 2002, 2004 + 2001, 2002, 2004, 2006, 2007 Free Software Foundation, Inc. - FIXME: Can someone provide a transliteration of this name into ASCII? - Using the following chars caused a compiler warning on HIUX (so I replaced - them with octal escapes), and isn't useful without an understanding of what - character set it is. - Written by Metin G. Ozisik, Mimi Ph\373\364ng-Th\345o V\365, - and John Gilmore. + Written by Metin G. Ozisik, Mimi Phuong-Thao Vo, and John Gilmore. Archive support from Damon A. Permezel. Contributed by IBM Corporation and Cygnus Support. @@ -44,8 +39,8 @@ #define _LONG_LONG #endif -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #ifdef AIX_CORE @@ -294,11 +289,10 @@ make_bfd_asection (bfd *abfd, const char *name, flagword flags, { asection *asect; - asect = bfd_make_section_anyway (abfd, name); + asect = bfd_make_section_anyway_with_flags (abfd, name, flags); if (!asect) return NULL; - asect->flags = flags; asect->size = size; asect->vma = vma; asect->filepos = filepos; diff --git a/bfd/sco5-core.c b/bfd/sco5-core.c index 9a06b8839f5..21631cf5b84 100644 --- a/bfd/sco5-core.c +++ b/bfd/sco5-core.c @@ -1,5 +1,5 @@ /* BFD back end for SCO5 core files (U-area and raw sections) - Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Jouke Numan @@ -19,8 +19,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libaout.h" /* BFD a.out internal data structures */ @@ -63,10 +63,9 @@ make_bfd_asection (abfd, name, flags, size, vma, filepos) { asection *asect; - asect = bfd_make_section_anyway (abfd, name); + asect = bfd_make_section_anyway_with_flags (abfd, name, flags); if (!asect) return NULL; - asect->flags = flags; asect->size = size; asect->vma = vma; asect->filepos = filepos; diff --git a/bfd/section.c b/bfd/section.c index f870e6bfc08..135f44c0780 100644 --- a/bfd/section.c +++ b/bfd/section.c @@ -1,6 +1,6 @@ /* Object file "section" support for the BFD library. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -133,8 +133,8 @@ SUBSECTION */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" @@ -294,7 +294,9 @@ CODE_FRAGMENT . else up the line will take care of it later. *} .#define SEC_LINKER_CREATED 0x200000 . -. {* This section should not be subject to garbage collection. *} +. {* This section should not be subject to garbage collection. +. Also set to inform the linker that this section should not be +. listed in the link map as discarded. *} .#define SEC_KEEP 0x400000 . . {* This section contains "short" data, and should be placed @@ -540,11 +542,6 @@ CODE_FRAGMENT . || ((SEC) == bfd_com_section_ptr) \ . || ((SEC) == bfd_ind_section_ptr)) . -.extern const struct bfd_symbol * const bfd_abs_symbol; -.extern const struct bfd_symbol * const bfd_com_symbol; -.extern const struct bfd_symbol * const bfd_und_symbol; -.extern const struct bfd_symbol * const bfd_ind_symbol; -. .{* Macros to handle insertion and deletion of a bfd's sections. These . only handle the list pointers, ie. do not adjust section_count, . target_index etc. *} @@ -635,7 +632,7 @@ CODE_FRAGMENT .#define bfd_section_removed_from_list(ABFD, S) \ . ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) . -.#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, SYM_PTR, NAME, IDX) \ +.#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ . {* name, id, index, next, prev, flags, user_set_vma, *} \ . { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ . \ @@ -666,11 +663,8 @@ CODE_FRAGMENT . {* target_index, used_by_bfd, constructor_chain, owner, *} \ . 0, NULL, NULL, NULL, \ . \ -. {* symbol, *} \ -. (struct bfd_symbol *) SYM, \ -. \ -. {* symbol_ptr_ptr, *} \ -. (struct bfd_symbol **) SYM_PTR, \ +. {* symbol, symbol_ptr_ptr, *} \ +. (struct bfd_symbol *) SYM, &SEC.symbol, \ . \ . {* map_head, map_tail *} \ . { NULL }, { NULL } \ @@ -701,16 +695,14 @@ static const asymbol global_syms[] = GLOBAL_SYM_INIT (BFD_IND_SECTION_NAME, &bfd_ind_section) }; -#define STD_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ - const asymbol * const SYM = (asymbol *) &global_syms[IDX]; \ - asection SEC = BFD_FAKE_SECTION(SEC, FLAGS, &global_syms[IDX], &SYM, \ +#define STD_SECTION(SEC, FLAGS, NAME, IDX) \ + asection SEC = BFD_FAKE_SECTION(SEC, FLAGS, &global_syms[IDX], \ NAME, IDX) -STD_SECTION (bfd_com_section, SEC_IS_COMMON, bfd_com_symbol, - BFD_COM_SECTION_NAME, 0); -STD_SECTION (bfd_und_section, 0, bfd_und_symbol, BFD_UND_SECTION_NAME, 1); -STD_SECTION (bfd_abs_section, 0, bfd_abs_symbol, BFD_ABS_SECTION_NAME, 2); -STD_SECTION (bfd_ind_section, 0, bfd_ind_symbol, BFD_IND_SECTION_NAME, 3); +STD_SECTION (bfd_com_section, SEC_IS_COMMON, BFD_COM_SECTION_NAME, 0); +STD_SECTION (bfd_und_section, 0, BFD_UND_SECTION_NAME, 1); +STD_SECTION (bfd_abs_section, 0, BFD_ABS_SECTION_NAME, 2); +STD_SECTION (bfd_ind_section, 0, BFD_IND_SECTION_NAME, 3); #undef STD_SECTION /* Initialize an entry in the section hash table. */ @@ -743,6 +735,26 @@ bfd_section_hash_newfunc (struct bfd_hash_entry *entry, ((struct section_hash_entry *) \ bfd_hash_lookup ((table), (string), (create), (copy))) +/* Create a symbol whose only job is to point to this section. This + is useful for things like relocs which are relative to the base + of a section. */ + +bfd_boolean +_bfd_generic_new_section_hook (bfd *abfd, asection *newsect) +{ + newsect->symbol = bfd_make_empty_symbol (abfd); + if (newsect->symbol == NULL) + return FALSE; + + newsect->symbol->name = newsect->name; + newsect->symbol->value = 0; + newsect->symbol->section = newsect; + newsect->symbol->flags = BSF_SECTION_SYM; + + newsect->symbol_ptr_ptr = &newsect->symbol; + return TRUE; +} + /* Initializes a new section. NEWSECT->NAME is already set. */ static asection * @@ -754,20 +766,6 @@ bfd_section_init (bfd *abfd, asection *newsect) newsect->index = abfd->section_count; newsect->owner = abfd; - /* Create a symbol whose only job is to point to this section. This - is useful for things like relocs which are relative to the base - of a section. */ - newsect->symbol = bfd_make_empty_symbol (abfd); - if (newsect->symbol == NULL) - return NULL; - - newsect->symbol->name = newsect->name; - newsect->symbol->value = 0; - newsect->symbol->section = newsect; - newsect->symbol->flags = BSF_SECTION_SYM; - - newsect->symbol_ptr_ptr = &newsect->symbol; - if (! BFD_SEND (abfd, _new_section_hook, (abfd, newsect))) return NULL; @@ -964,7 +962,6 @@ DESCRIPTION asection * bfd_make_section_old_way (bfd *abfd, const char *name) { - struct section_hash_entry *sh; asection *newsect; if (abfd->output_has_begun) @@ -974,30 +971,38 @@ bfd_make_section_old_way (bfd *abfd, const char *name) } if (strcmp (name, BFD_ABS_SECTION_NAME) == 0) - return bfd_abs_section_ptr; - - if (strcmp (name, BFD_COM_SECTION_NAME) == 0) - return bfd_com_section_ptr; - - if (strcmp (name, BFD_UND_SECTION_NAME) == 0) - return bfd_und_section_ptr; - - if (strcmp (name, BFD_IND_SECTION_NAME) == 0) - return bfd_ind_section_ptr; - - sh = section_hash_lookup (&abfd->section_htab, name, TRUE, FALSE); - if (sh == NULL) - return NULL; - - newsect = &sh->section; - if (newsect->name != NULL) + newsect = bfd_abs_section_ptr; + else if (strcmp (name, BFD_COM_SECTION_NAME) == 0) + newsect = bfd_com_section_ptr; + else if (strcmp (name, BFD_UND_SECTION_NAME) == 0) + newsect = bfd_und_section_ptr; + else if (strcmp (name, BFD_IND_SECTION_NAME) == 0) + newsect = bfd_ind_section_ptr; + else { - /* Section already exists. */ - return newsect; + struct section_hash_entry *sh; + + sh = section_hash_lookup (&abfd->section_htab, name, TRUE, FALSE); + if (sh == NULL) + return NULL; + + newsect = &sh->section; + if (newsect->name != NULL) + { + /* Section already exists. */ + return newsect; + } + + newsect->name = name; + return bfd_section_init (abfd, newsect); } - newsect->name = name; - return bfd_section_init (abfd, newsect); + /* Call new_section_hook when "creating" the standard abs, com, und + and ind sections to tack on format specific section data. + Also, create a proper section symbol. */ + if (! BFD_SEND (abfd, _new_section_hook, (abfd, newsect))) + return NULL; + return newsect; } /* diff --git a/bfd/simple.c b/bfd/simple.c index d06ce2a96e1..8ebc47e0597 100644 --- a/bfd/simple.c +++ b/bfd/simple.c @@ -1,5 +1,5 @@ /* simple.c -- BFD simple client routines - Copyright 2002, 2003, 2004, 2005 + Copyright 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by MontaVista Software, Inc. @@ -19,8 +19,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" @@ -183,6 +183,7 @@ bfd_simple_get_relocated_section_contents (bfd *abfd, /* Fill in the bare minimum number of fields for our purposes. */ memset (&link_info, 0, sizeof (link_info)); link_info.input_bfds = abfd; + link_info.input_bfds_tail = &abfd->link_next; link_info.hash = _bfd_generic_link_hash_table_create (abfd); link_info.callbacks = &callbacks; diff --git a/bfd/som.c b/bfd/som.c index 0c9e1b79f9c..28eb885bfe2 100644 --- a/bfd/som.c +++ b/bfd/som.c @@ -1,6 +1,6 @@ /* bfd back-end for HP PA-RISC SOM objects. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by the Center for Software Science at the @@ -24,8 +24,8 @@ 02110-1301, USA. */ #include "alloca-conf.h" -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) || defined(HOST_HPPAMPEIX) @@ -1626,6 +1626,22 @@ som_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +som_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (som_hppa_howto_table) / sizeof (som_hppa_howto_table[0]); + i++) + if (som_hppa_howto_table[i].name != NULL + && strcasecmp (som_hppa_howto_table[i].name, r_name) == 0) + return &som_hppa_howto_table[i]; + + return NULL; +} + /* Perform some initialization for an object. Save results of this initialization in the BFD. */ @@ -4374,12 +4390,12 @@ som_slurp_symbol_table (bfd *abfd) && sym->symbol.name[strlen (sym->symbol.name) - 1] == '$' && !strcmp (sym->symbol.name, sym->symbol.section->name)) sym->symbol.flags |= BSF_SECTION_SYM; - else if (!strncmp (sym->symbol.name, "L$0\002", 4)) + else if (CONST_STRNEQ (sym->symbol.name, "L$0\002")) { sym->symbol.flags |= BSF_SECTION_SYM; sym->symbol.name = sym->symbol.section->name; } - else if (!strncmp (sym->symbol.name, "L$0\001", 4)) + else if (CONST_STRNEQ (sym->symbol.name, "L$0\001")) sym->symbol.flags |= BSF_DEBUGGING; /* Note increment at bottom of loop, since we skip some symbols @@ -4959,15 +4975,18 @@ extern const bfd_target som_vec; static bfd_boolean som_new_section_hook (bfd *abfd, asection *newsect) { - bfd_size_type amt = sizeof (struct som_section_data_struct); - - newsect->used_by_bfd = bfd_zalloc (abfd, amt); if (!newsect->used_by_bfd) - return FALSE; + { + bfd_size_type amt = sizeof (struct som_section_data_struct); + + newsect->used_by_bfd = bfd_zalloc (abfd, amt); + if (!newsect->used_by_bfd) + return FALSE; + } newsect->alignment_power = 3; /* We allow more than three sections internally. */ - return TRUE; + return _bfd_generic_new_section_hook (abfd, newsect); } /* Copy any private info we understand from the input symbol @@ -5325,7 +5344,7 @@ som_find_nearest_line (bfd *abfd ATTRIBUTE_UNUSED, static int som_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, - bfd_boolean reloc ATTRIBUTE_UNUSED) + struct bfd_link_info *info ATTRIBUTE_UNUSED) { (*_bfd_error_handler) (_("som_sizeof_headers unimplemented")); fflush (stderr); @@ -5650,7 +5669,7 @@ som_slurp_armap (bfd *abfd) return FALSE; /* For archives without .o files there is no symbol table. */ - if (strncmp (nextname, "/ ", 16)) + if (! CONST_STRNEQ (nextname, "/ ")) { bfd_has_map (abfd) = FALSE; return TRUE; @@ -5749,7 +5768,7 @@ som_bfd_prep_for_ar_write (bfd *abfd, if (curr_bfd->format != bfd_object || curr_bfd->xvec->flavour != bfd_target_som_flavour) { - curr_bfd = curr_bfd->next; + curr_bfd = curr_bfd->archive_next; continue; } @@ -5794,7 +5813,7 @@ som_bfd_prep_for_ar_write (bfd *abfd, (*stringsize)++; } - curr_bfd = curr_bfd->next; + curr_bfd = curr_bfd->archive_next; } return TRUE; } @@ -5903,7 +5922,7 @@ som_bfd_ar_write_symbol_stuff (bfd *abfd, if (curr_bfd->format != bfd_object || curr_bfd->xvec->flavour != bfd_target_som_flavour) { - curr_bfd = curr_bfd->next; + curr_bfd = curr_bfd->archive_next; continue; } @@ -6019,7 +6038,7 @@ som_bfd_ar_write_symbol_stuff (bfd *abfd, linker requires objects begin on an even boundary. So round up the current offset as necessary. */ curr_som_offset = (curr_som_offset + 0x1) &~ (unsigned) 1; - curr_bfd = curr_bfd->next; + curr_bfd = curr_bfd->archive_next; som_index++; } @@ -6125,7 +6144,7 @@ som_write_armap (bfd *abfd, if (curr_bfd->format == bfd_object && curr_bfd->xvec->flavour == bfd_target_som_flavour) lst.module_count++; - curr_bfd = curr_bfd->next; + curr_bfd = curr_bfd->archive_next; } lst.module_limit = lst.module_count; lst.dir_loc = lst_size; diff --git a/bfd/sparclinux.c b/bfd/sparclinux.c index d8659eec16b..445a66c0e10 100644 --- a/bfd/sparclinux.c +++ b/bfd/sparclinux.c @@ -1,23 +1,23 @@ /* BFD back-end for linux flavored sparc a.out binaries. Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, - 2003, 2004, 2006 Free Software Foundation, Inc. + 2003, 2004, 2006, 2007 Free Software Foundation, Inc. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -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 2 of the License, or -(at your option) any later version. + 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 2 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. + 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. */ + 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. */ #define TARGET_PAGE_SIZE 4096 #define ZMAGIC_DISK_BLOCK_SIZE 1024 @@ -27,8 +27,8 @@ USA. */ #define MACHTYPE_OK(mtype) ((mtype) == M_SPARC || (mtype) == M_UNKNOWN) -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "aout/aout64.h" #include "aout/stab_gnu.h" @@ -94,8 +94,7 @@ sparclinux_write_object_contents (abfd) #define GOT_REF_PREFIX "__GOT_" #endif -#define IS_GOT_SYM(name) \ - (strncmp (name, GOT_REF_PREFIX, sizeof GOT_REF_PREFIX - 1) == 0) +#define IS_GOT_SYM(name) (CONST_STRNEQ (name, GOT_REF_PREFIX)) /* See if a symbol name is a reference to the procedure linkage table. */ @@ -103,8 +102,7 @@ sparclinux_write_object_contents (abfd) #define PLT_REF_PREFIX "__PLT_" #endif -#define IS_PLT_SYM(name) \ - (strncmp (name, PLT_REF_PREFIX, sizeof PLT_REF_PREFIX - 1) == 0) +#define IS_PLT_SYM(name) (CONST_STRNEQ (name, PLT_REF_PREFIX)) /* This string is used to generate specialized error messages. */ @@ -313,9 +311,8 @@ linux_link_create_dynamic_sections (abfd, info) /* We choose to use the name ".linux-dynamic" for the fixup table. Why not? */ - s = bfd_make_section (abfd, ".linux-dynamic"); + s = bfd_make_section_with_flags (abfd, ".linux-dynamic", flags); if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags) || ! bfd_set_section_alignment (abfd, s, 2)) return FALSE; s->size = 0; @@ -429,9 +426,7 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string, This function is called via linux_link_hash_traverse. */ static bfd_boolean -linux_tally_symbols (h, data) - struct linux_link_hash_entry *h; - PTR data; +linux_tally_symbols (struct linux_link_hash_entry *h, void * data) { struct bfd_link_info *info = (struct bfd_link_info *) data; struct fixup *f, *f1; @@ -443,8 +438,7 @@ linux_tally_symbols (h, data) h = (struct linux_link_hash_entry *) h->root.root.u.i.link; if (h->root.root.type == bfd_link_hash_undefined - && strncmp (h->root.root.root.string, NEEDS_SHRLIB, - sizeof NEEDS_SHRLIB - 1) == 0) + && CONST_STRNEQ (h->root.root.root.string, NEEDS_SHRLIB)) { const char *name; char *p; diff --git a/bfd/sparclynx.c b/bfd/sparclynx.c index 81aa5548153..df61d425d25 100644 --- a/bfd/sparclynx.c +++ b/bfd/sparclynx.c @@ -1,6 +1,6 @@ /* BFD support for Sparc binaries under LynxOS. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000, - 2001, 2002, 2003, 2005 Free Software Foundation, Inc. + 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -24,8 +24,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define MY(OP) CONCAT2 (sparclynx_aout_,OP) #define TARGETNAME "a.out-sparc-lynx" -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "aout/sun4.h" diff --git a/bfd/srec.c b/bfd/srec.c index 2b24f46ffb6..354a6ee670f 100644 --- a/bfd/srec.c +++ b/bfd/srec.c @@ -1,6 +1,6 @@ /* BFD back-end for s-record objects. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support . @@ -101,8 +101,8 @@ We allow symbols to be anywhere in the data stream - the module names are always ignored. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libiberty.h" #include "safe-ctype.h" @@ -526,15 +526,16 @@ srec_scan (bfd *abfd) char secbuf[20]; char *secname; bfd_size_type amt; + flagword flags; sprintf (secbuf, ".sec%d", bfd_count_sections (abfd) + 1); amt = strlen (secbuf) + 1; secname = bfd_alloc (abfd, amt); strcpy (secname, secbuf); - sec = bfd_make_section (abfd, secname); + flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC; + sec = bfd_make_section_with_flags (abfd, secname, flags); if (sec == NULL) goto error_return; - sec->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC; sec->vma = address; sec->lma = address; sec->size = bytes; @@ -1099,7 +1100,7 @@ symbolsrec_write_object_contents (bfd *abfd) static int srec_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, - bfd_boolean exec ATTRIBUTE_UNUSED) + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return 0; } @@ -1193,9 +1194,6 @@ srec_print_symbol (bfd *abfd, #define srec_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define srec_read_minisymbols _bfd_generic_read_minisymbols #define srec_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol -#define srec_get_reloc_upper_bound ((long (*) (bfd *, asection *)) bfd_0l) -#define srec_canonicalize_reloc ((long (*) (bfd *, asection *, arelent **, asymbol **)) bfd_0l) -#define srec_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup #define srec_get_section_contents_in_window _bfd_generic_get_section_contents_in_window #define srec_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents #define srec_bfd_relax_section bfd_generic_relax_section @@ -1256,7 +1254,7 @@ const bfd_target srec_vec = BFD_JUMP_TABLE_CORE (_bfd_nocore), BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), BFD_JUMP_TABLE_SYMBOLS (srec), - BFD_JUMP_TABLE_RELOCS (srec), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), BFD_JUMP_TABLE_WRITE (srec), BFD_JUMP_TABLE_LINK (srec), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), @@ -1311,7 +1309,7 @@ const bfd_target symbolsrec_vec = BFD_JUMP_TABLE_CORE (_bfd_nocore), BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), BFD_JUMP_TABLE_SYMBOLS (srec), - BFD_JUMP_TABLE_RELOCS (srec), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), BFD_JUMP_TABLE_WRITE (srec), BFD_JUMP_TABLE_LINK (srec), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), diff --git a/bfd/stabs.c b/bfd/stabs.c index ba3f9344619..1192cd165b9 100644 --- a/bfd/stabs.c +++ b/bfd/stabs.c @@ -1,6 +1,6 @@ /* Stabs in sections linking support. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006 Free Software Foundation, Inc. + 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -22,8 +22,8 @@ /* This file contains support for linking stabs in sections, as used on COFF and ELF. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "aout/stab_gnu.h" #include "safe-ctype.h" @@ -175,10 +175,8 @@ _bfd_link_section_stabs (bfd *abfd, prepared to handle them. */ return TRUE; - if ((stabsec->output_section != NULL - && bfd_is_abs_section (stabsec->output_section)) - || (stabstrsec->output_section != NULL - && bfd_is_abs_section (stabstrsec->output_section))) + if (bfd_is_abs_section (stabsec->output_section) + || bfd_is_abs_section (stabstrsec->output_section)) /* At least one of the sections is being discarded from the link, so we should just ignore them. */ return TRUE; @@ -187,6 +185,8 @@ _bfd_link_section_stabs (bfd *abfd, if (sinfo->stabstr == NULL) { + flagword flags; + /* Initialize the stabs information we need to keep track of. */ first = TRUE; sinfo->strings = _bfd_stringtab_init (); @@ -198,11 +198,12 @@ _bfd_link_section_stabs (bfd *abfd, stab_link_includes_newfunc, sizeof (struct stab_link_includes_entry))) goto error_return; - sinfo->stabstr = bfd_make_section_anyway (abfd, ".stabstr"); + flags = (SEC_HAS_CONTENTS | SEC_READONLY | SEC_DEBUGGING + | SEC_LINKER_CREATED); + sinfo->stabstr = bfd_make_section_anyway_with_flags (abfd, ".stabstr", + flags); if (sinfo->stabstr == NULL) goto error_return; - sinfo->stabstr->flags |= (SEC_HAS_CONTENTS | SEC_READONLY - | SEC_DEBUGGING | SEC_LINKER_CREATED); } /* Initialize the information we are going to store for this .stab @@ -430,7 +431,7 @@ _bfd_link_section_stabs (bfd *abfd, ++nest; else if (incl_type == (int) N_EXCL) /* Keep existing exclusion marks. */ - continue; + continue; else if (nest == 0) { *incl_pstridx = (bfd_size_type) -1; @@ -455,8 +456,8 @@ _bfd_link_section_stabs (bfd *abfd, for that section. */ stabsec->size = (count - skip) * STABSIZE; if (stabsec->size == 0) - stabsec->flags |= SEC_EXCLUDE; - stabstrsec->flags |= SEC_EXCLUDE; + stabsec->flags |= SEC_EXCLUDE | SEC_KEEP; + stabstrsec->flags |= SEC_EXCLUDE | SEC_KEEP; sinfo->stabstr->size = _bfd_stringtab_size (sinfo->strings); /* Calculate the `cumulative_skips' array now that stabs have been @@ -608,7 +609,7 @@ _bfd_discard_section_stabs (bfd *abfd, /* Shrink the stabsec as needed. */ stabsec->size -= skip * STABSIZE; if (stabsec->size == 0) - stabsec->flags |= SEC_EXCLUDE; + stabsec->flags |= SEC_EXCLUDE | SEC_KEEP; /* Recalculate the `cumulative_skips' array now that stabs have been deleted for this section. */ diff --git a/bfd/sunos.c b/bfd/sunos.c index 024320fbfa1..a9117f47718 100644 --- a/bfd/sunos.c +++ b/bfd/sunos.c @@ -745,57 +745,50 @@ sunos_create_dynamic_sections (bfd *abfd, /* The .dynamic section holds the basic dynamic information: the sun4_dynamic structure, the dynamic debugger information, and the sun4_dynamic_link structure. */ - s = bfd_make_section (abfd, ".dynamic"); + s = bfd_make_section_with_flags (abfd, ".dynamic", flags); if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags) || ! bfd_set_section_alignment (abfd, s, 2)) return FALSE; /* The .got section holds the global offset table. The address is put in the ld_got field. */ - s = bfd_make_section (abfd, ".got"); + s = bfd_make_section_with_flags (abfd, ".got", flags); if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags) || ! bfd_set_section_alignment (abfd, s, 2)) return FALSE; /* The .plt section holds the procedure linkage table. The address is put in the ld_plt field. */ - s = bfd_make_section (abfd, ".plt"); + s = bfd_make_section_with_flags (abfd, ".plt", flags | SEC_CODE); if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_CODE) || ! bfd_set_section_alignment (abfd, s, 2)) return FALSE; /* The .dynrel section holds the dynamic relocs. The address is put in the ld_rel field. */ - s = bfd_make_section (abfd, ".dynrel"); + s = bfd_make_section_with_flags (abfd, ".dynrel", flags | SEC_READONLY); if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, 2)) return FALSE; /* The .hash section holds the dynamic hash table. The address is put in the ld_hash field. */ - s = bfd_make_section (abfd, ".hash"); + s = bfd_make_section_with_flags (abfd, ".hash", flags | SEC_READONLY); if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, 2)) return FALSE; /* The .dynsym section holds the dynamic symbols. The address is put in the ld_stab field. */ - s = bfd_make_section (abfd, ".dynsym"); + s = bfd_make_section_with_flags (abfd, ".dynsym", flags | SEC_READONLY); if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, 2)) return FALSE; /* The .dynstr section holds the dynamic symbol string table. The address is put in the ld_symbols field. */ - s = bfd_make_section (abfd, ".dynstr"); + s = bfd_make_section_with_flags (abfd, ".dynstr", flags | SEC_READONLY); if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, 2)) return FALSE; @@ -890,14 +883,10 @@ sunos_add_dynamic_symbols (bfd *abfd, /* The .need section holds the list of names of shared objets which must be included at runtime. The address of this section is put in the ld_need field. */ - asection *s = bfd_make_section (dynobj, ".need"); + flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY | SEC_READONLY); + asection *s = bfd_make_section_with_flags (dynobj, ".need", flags); if (s == NULL - || ! bfd_set_section_flags (dynobj, s, - (SEC_ALLOC - | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_READONLY)) || ! bfd_set_section_alignment (dynobj, s, 2)) return FALSE; } @@ -907,14 +896,10 @@ sunos_add_dynamic_symbols (bfd *abfd, /* The .rules section holds the path to search for shared objects. The address of this section is put in the ld_rules field. */ - asection *s = bfd_make_section (dynobj, ".rules"); + flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY | SEC_READONLY); + asection *s = bfd_make_section_with_flags (dynobj, ".rules", flags); if (s == NULL - || ! bfd_set_section_flags (dynobj, s, - (SEC_ALLOC - | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_READONLY)) || ! bfd_set_section_alignment (dynobj, s, 2)) return FALSE; } diff --git a/bfd/syms.c b/bfd/syms.c index 0ff94164ed5..89c38692ed3 100644 --- a/bfd/syms.c +++ b/bfd/syms.c @@ -1,6 +1,6 @@ /* Generic symbol-table support for the BFD library. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004 + 2000, 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -288,6 +288,14 @@ CODE_FRAGMENT . {* This symbol is thread local. Used in ELF. *} .#define BSF_THREAD_LOCAL 0x40000 . +. {* This symbol represents a complex relocation expression, +. with the expression tree serialized in the symbol name. *} +.#define BSF_RELC 0x80000 +. +. {* This symbol represents a signed complex relocation expression, +. with the expression tree serialized in the symbol name. *} +.#define BSF_SRELC 0x100000 +. . flagword flags; . . {* A pointer to the section to which this symbol is @@ -307,8 +315,8 @@ CODE_FRAGMENT . */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "safe-ctype.h" #include "bfdlink.h" diff --git a/bfd/sysdep.h b/bfd/sysdep.h index f6313d3905c..e1b070b4a89 100644 --- a/bfd/sysdep.h +++ b/bfd/sysdep.h @@ -1,5 +1,5 @@ /* sysdep.h -- handle host dependencies for the BFD library - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -22,10 +22,10 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #ifndef BFD_SYSDEP_H #define BFD_SYSDEP_H -#include "ansidecl.h" - #include "config.h" +#include "ansidecl.h" + #ifdef HAVE_STDDEF_H #include #endif diff --git a/bfd/targets.c b/bfd/targets.c index 849eb944fbe..23e52cd6ec8 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -1,6 +1,6 @@ /* Generic target-file-type support for the BFD library. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -20,8 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "fnmatch.h" @@ -402,7 +402,8 @@ BFD_JUMP_TABLE macros. .#define BFD_JUMP_TABLE_RELOCS(NAME) \ . NAME##_get_reloc_upper_bound, \ . NAME##_canonicalize_reloc, \ -. NAME##_bfd_reloc_type_lookup +. NAME##_bfd_reloc_type_lookup, \ +. NAME##_bfd_reloc_name_lookup . . long (*_get_reloc_upper_bound) (bfd *, sec_ptr); . long (*_bfd_canonicalize_reloc) @@ -410,6 +411,9 @@ BFD_JUMP_TABLE macros. . {* See documentation on reloc types. *} . reloc_howto_type * . (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); +. reloc_howto_type * +. (*reloc_name_lookup) (bfd *, const char *); +. . . {* Routines used when writing an object file. *} .#define BFD_JUMP_TABLE_WRITE(NAME) \ @@ -438,7 +442,7 @@ BFD_JUMP_TABLE macros. . NAME##_bfd_discard_group, \ . NAME##_section_already_linked \ . -. int (*_bfd_sizeof_headers) (bfd *, bfd_boolean); +. int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); . bfd_byte * (*_bfd_get_relocated_section_contents) . (bfd *, struct bfd_link_info *, struct bfd_link_order *, . bfd_byte *, bfd_boolean, struct bfd_symbol **); @@ -481,7 +485,8 @@ BFD_JUMP_TABLE macros. . . {* Check if SEC has been already linked during a reloceatable or . final link. *} -. void (*_section_already_linked) (bfd *, struct bfd_section *); +. void (*_section_already_linked) (bfd *, struct bfd_section *, +. struct bfd_link_info *); . . {* Routines to handle dynamic symbols and relocs. *} .#define BFD_JUMP_TABLE_DYNAMIC(NAME) \ @@ -541,6 +546,10 @@ extern const bfd_target arm_epoc_pe_big_vec; extern const bfd_target arm_epoc_pe_little_vec; extern const bfd_target arm_epoc_pei_big_vec; extern const bfd_target arm_epoc_pei_little_vec; +extern const bfd_target arm_wince_pe_big_vec; +extern const bfd_target arm_wince_pe_little_vec; +extern const bfd_target arm_wince_pei_big_vec; +extern const bfd_target arm_wince_pei_little_vec; extern const bfd_target armcoff_big_vec; extern const bfd_target armcoff_little_vec; extern const bfd_target armnetbsd_vec; @@ -551,6 +560,7 @@ extern const bfd_target armpei_little_vec; extern const bfd_target b_out_vec_big_host; extern const bfd_target b_out_vec_little_host; extern const bfd_target bfd_efi_app_ia32_vec; +extern const bfd_target bfd_efi_app_x86_64_vec; extern const bfd_target bfd_efi_app_ia64_vec; extern const bfd_target bfd_elf32_avr_vec; extern const bfd_target bfd_elf32_bfin_vec; @@ -562,6 +572,7 @@ extern const bfd_target bfd_elf32_bigarm_symbian_vec; extern const bfd_target bfd_elf32_bigarm_vxworks_vec; extern const bfd_target bfd_elf32_bigmips_vec; extern const bfd_target bfd_elf32_bigmips_vxworks_vec; +extern const bfd_target bfd_elf32_cr16_vec; extern const bfd_target bfd_elf32_cr16c_vec; extern const bfd_target bfd_elf32_cris_vec; extern const bfd_target bfd_elf32_crx_vec; @@ -604,6 +615,8 @@ extern const bfd_target bfd_elf32_m68k_vec; extern const bfd_target bfd_elf32_m88k_vec; extern const bfd_target bfd_elf32_mcore_big_vec; extern const bfd_target bfd_elf32_mcore_little_vec; +extern const bfd_target bfd_elf32_mep_vec; +extern const bfd_target bfd_elf32_mep_little_vec; extern const bfd_target bfd_elf32_mn10200_vec; extern const bfd_target bfd_elf32_mn10300_vec; extern const bfd_target bfd_elf32_mt_vec; @@ -620,6 +633,8 @@ extern const bfd_target bfd_elf32_powerpc_vec; extern const bfd_target bfd_elf32_powerpcle_vec; extern const bfd_target bfd_elf32_powerpc_vxworks_vec; extern const bfd_target bfd_elf32_s390_vec; +extern const bfd_target bfd_elf32_bigscore_vec; +extern const bfd_target bfd_elf32_littlescore_vec; extern const bfd_target bfd_elf32_sh64_vec; extern const bfd_target bfd_elf32_sh64l_vec; extern const bfd_target bfd_elf32_sh64lin_vec; @@ -632,9 +647,12 @@ extern const bfd_target bfd_elf32_shl_vec; extern const bfd_target bfd_elf32_shl_symbian_vec; extern const bfd_target bfd_elf32_shlin_vec; extern const bfd_target bfd_elf32_shlnbsd_vec; +extern const bfd_target bfd_elf32_shlvxworks_vec; extern const bfd_target bfd_elf32_shnbsd_vec; +extern const bfd_target bfd_elf32_shvxworks_vec; extern const bfd_target bfd_elf32_sparc_vec; extern const bfd_target bfd_elf32_sparc_vxworks_vec; +extern const bfd_target bfd_elf32_spu_vec; extern const bfd_target bfd_elf32_tradbigmips_vec; extern const bfd_target bfd_elf32_tradlittlemips_vec; extern const bfd_target bfd_elf32_us_cris_vec; @@ -666,8 +684,10 @@ extern const bfd_target bfd_elf64_sh64blin_vec; extern const bfd_target bfd_elf64_sh64lnbsd_vec; extern const bfd_target bfd_elf64_sh64nbsd_vec; extern const bfd_target bfd_elf64_sparc_vec; +extern const bfd_target bfd_elf64_sparc_freebsd_vec; extern const bfd_target bfd_elf64_tradbigmips_vec; extern const bfd_target bfd_elf64_tradlittlemips_vec; +extern const bfd_target bfd_elf64_x86_64_freebsd_vec; extern const bfd_target bfd_elf64_x86_64_vec; extern const bfd_target bfd_mmo_vec; extern const bfd_target bfd_powerpc_pe_vec; @@ -780,6 +800,9 @@ extern const bfd_target vms_alpha_vec; extern const bfd_target vms_vax_vec; extern const bfd_target w65_vec; extern const bfd_target we32kcoff_vec; +extern const bfd_target x86_64pe_vec; +extern const bfd_target x86_64pei_vec; +extern const bfd_target x86_64coff_vec; extern const bfd_target z80coff_vec; extern const bfd_target z8kcoff_vec; @@ -804,8 +827,8 @@ extern const bfd_target sco5_core_vec; extern const bfd_target trad_core_vec; extern const bfd_target bfd_elf32_am33lin_vec; -static const bfd_target * const _bfd_target_vector[] = { - +static const bfd_target * const _bfd_target_vector[] = +{ #ifdef SELECT_VECS SELECT_VECS, @@ -841,6 +864,10 @@ static const bfd_target * const _bfd_target_vector[] = { &arm_epoc_pe_little_vec, &arm_epoc_pei_big_vec, &arm_epoc_pei_little_vec, + &arm_wince_pe_big_vec, + &arm_wince_pe_little_vec, + &arm_wince_pei_big_vec, + &arm_wince_pei_little_vec, &armcoff_big_vec, &armcoff_little_vec, &armnetbsd_vec, @@ -852,6 +879,7 @@ static const bfd_target * const _bfd_target_vector[] = { &b_out_vec_little_host, &bfd_efi_app_ia32_vec, #ifdef BFD64 + &bfd_efi_app_x86_64_vec, &bfd_efi_app_ia64_vec, #endif &bfd_elf32_avr_vec, @@ -869,6 +897,7 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf32_bigarm_vxworks_vec, &bfd_elf32_bigmips_vec, &bfd_elf32_bigmips_vxworks_vec, + &bfd_elf32_cr16_vec, &bfd_elf32_cr16c_vec, &bfd_elf32_cris_vec, &bfd_elf32_crx_vec, @@ -915,6 +944,7 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf32_m88k_vec, &bfd_elf32_mcore_big_vec, &bfd_elf32_mcore_little_vec, + &bfd_elf32_mep_vec, &bfd_elf32_mn10200_vec, &bfd_elf32_mn10300_vec, &bfd_elf32_mt_vec, @@ -933,13 +963,17 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf32_powerpc_vxworks_vec, &bfd_elf32_powerpcle_vec, &bfd_elf32_s390_vec, + &bfd_elf32_bigscore_vec, + &bfd_elf32_littlescore_vec, &bfd_elf32_sh_vec, &bfd_elf32_shblin_vec, &bfd_elf32_shl_vec, &bfd_elf32_shl_symbian_vec, &bfd_elf32_shlin_vec, &bfd_elf32_shlnbsd_vec, + &bfd_elf32_shlvxworks_vec, &bfd_elf32_shnbsd_vec, + &bfd_elf32_shvxworks_vec, #ifdef BFD64 &bfd_elf32_sh64_vec, &bfd_elf32_sh64l_vec, @@ -950,6 +984,7 @@ static const bfd_target * const _bfd_target_vector[] = { #endif &bfd_elf32_sparc_vec, &bfd_elf32_sparc_vxworks_vec, + &bfd_elf32_spu_vec, &bfd_elf32_tradbigmips_vec, &bfd_elf32_tradlittlemips_vec, &bfd_elf32_us_cris_vec, @@ -982,8 +1017,10 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf64_sh64lin_vec, &bfd_elf64_sh64blin_vec, &bfd_elf64_sparc_vec, + &bfd_elf64_sparc_freebsd_vec, &bfd_elf64_tradbigmips_vec, &bfd_elf64_tradlittlemips_vec, + &bfd_elf64_x86_64_freebsd_vec, &bfd_elf64_x86_64_vec, &bfd_mmo_vec, #endif @@ -1036,6 +1073,11 @@ static const bfd_target * const _bfd_target_vector[] = { &i386os9k_vec, &i386pe_vec, &i386pei_vec, +#ifdef BFD64 + &x86_64coff_vec, + &x86_64pe_vec, + &x86_64pei_vec, +#endif &i860coff_vec, &icoff_big_vec, &icoff_little_vec, @@ -1260,7 +1302,6 @@ find_target (const char *name) while (match->vector == NULL) ++match; return match->vector; - break; } } @@ -1307,14 +1348,15 @@ SYNOPSIS DESCRIPTION Return a pointer to the transfer vector for the object target - named @var{target_name}. If @var{target_name} is <>, choose the - one in the environment variable <>; if that is null or not - defined, then choose the first entry in the target list. - Passing in the string "default" or setting the environment - variable to "default" will cause the first entry in the target - list to be returned, and "target_defaulted" will be set in the - BFD. This causes <> to loop over all the - targets to find the one that matches the file being read. + named @var{target_name}. If @var{target_name} is <>, + choose the one in the environment variable <>; if + that is null or not defined, then choose the first entry in the + target list. Passing in the string "default" or setting the + environment variable to "default" will cause the first entry in + the target list to be returned, and "target_defaulted" will be + set in the BFD if @var{abfd} isn't <>. This causes + <> to loop over all the targets to find the + one that matches the file being read. */ const bfd_target * @@ -1331,21 +1373,27 @@ bfd_find_target (const char *target_name, bfd *abfd) /* This is safe; the vector cannot be null. */ if (targname == NULL || strcmp (targname, "default") == 0) { - abfd->target_defaulted = TRUE; if (bfd_default_vector[0] != NULL) - abfd->xvec = bfd_default_vector[0]; + target = bfd_default_vector[0]; else - abfd->xvec = bfd_target_vector[0]; - return abfd->xvec; + target = bfd_target_vector[0]; + if (abfd) + { + abfd->xvec = target; + abfd->target_defaulted = TRUE; + } + return target; } - abfd->target_defaulted = FALSE; + if (abfd) + abfd->target_defaulted = FALSE; target = find_target (targname); if (target == NULL) return NULL; - abfd->xvec = target; + if (abfd) + abfd->xvec = target; return target; } diff --git a/bfd/tekhex.c b/bfd/tekhex.c index afe42cc948a..78deaf99ae1 100644 --- a/bfd/tekhex.c +++ b/bfd/tekhex.c @@ -1,6 +1,6 @@ /* BFD backend for Extended Tektronix Hex Format objects. Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, - 2003, 2004 Free Software Foundation, Inc. + 2003, 2004, 2007 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support . This file is part of BFD, the Binary File Descriptor library. @@ -65,8 +65,8 @@ The data can come out of order, and may be discontigous. This is a serial protocol, so big files are unlikely, so we keep a list of 8k chunks. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libiberty.h" @@ -436,6 +436,7 @@ first_phase (bfd *abfd, int type, char *src) if (!getvalue (&src, &val)) return FALSE; new->symbol.value = val - section->vma; + break; } default: return FALSE; @@ -457,11 +458,10 @@ pass_over (bfd *abfd, bfd_boolean (*func) (bfd *, int, char *)) /* To the front of the file. */ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) - abort (); + return FALSE; while (! eof) { - char buffer[MAXCHUNK]; - char *src = buffer; + char src[MAXCHUNK]; char type; /* Find first '%'. */ @@ -471,22 +471,24 @@ pass_over (bfd *abfd, bfd_boolean (*func) (bfd *, int, char *)) if (eof) break; - src++; /* Fetch the type and the length and the checksum. */ if (bfd_bread (src, (bfd_size_type) 5, abfd) != 5) - abort (); /* FIXME. */ + return FALSE; type = src[2]; if (!ISHEX (src[0]) || !ISHEX (src[1])) break; - /* Already read five char. */ + /* Already read five chars. */ chars_on_line = HEX (src) - 5; + if (chars_on_line >= MAXCHUNK) + return FALSE; + if (bfd_bread (src, (bfd_size_type) chars_on_line, abfd) != chars_on_line) - abort (); /* FIXME. */ + return FALSE; /* Put a null at the end. */ src[chars_on_line] = 0; @@ -751,7 +753,6 @@ out (bfd *abfd, int type, char *start, char *end) static bfd_boolean tekhex_write_object_contents (bfd *abfd) { - int bytes_written; char buffer[100]; asymbol **p; asection *s; @@ -759,8 +760,6 @@ tekhex_write_object_contents (bfd *abfd) tekhex_init (); - bytes_written = 0; - /* And the raw data. */ for (d = abfd->tdata.tekhex_data->data; d != NULL; @@ -868,7 +867,7 @@ tekhex_write_object_contents (bfd *abfd) static int tekhex_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, - bfd_boolean exec ATTRIBUTE_UNUSED) + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return 0; } diff --git a/bfd/trad-core.c b/bfd/trad-core.c index cb4111fb941..79b869cb37a 100644 --- a/bfd/trad-core.c +++ b/bfd/trad-core.c @@ -1,6 +1,6 @@ /* BFD back end for traditional Unix core files (U-area and raw sections) Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by John Gilmore of Cygnus Support. @@ -20,8 +20,8 @@ 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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libaout.h" /* BFD a.out internal data structures */ @@ -79,6 +79,7 @@ trad_unix_core_file_p (abfd) struct user u; struct trad_core_struct *rawptr; bfd_size_type amt; + flagword flags; #ifdef TRAD_CORE_USER_OFFSET /* If defined, this macro is the file position of the user struct. */ @@ -113,24 +114,24 @@ trad_unix_core_file_p (abfd) if (bfd_stat (abfd, &statbuf) < 0) return 0; - if ((unsigned long) (NBPG * (UPAGES + u.u_dsize + if ((ufile_ptr) NBPG * (UPAGES + u.u_dsize #ifdef TRAD_CORE_DSIZE_INCLUDES_TSIZE - - u.u_tsize + - u.u_tsize #endif - + u.u_ssize)) - > (unsigned long) statbuf.st_size) + + u.u_ssize) + > (ufile_ptr) statbuf.st_size) { bfd_set_error (bfd_error_wrong_format); return 0; } #ifndef TRAD_CORE_ALLOW_ANY_EXTRA_SIZE - if ((unsigned long) (NBPG * (UPAGES + u.u_dsize + u.u_ssize) + if (((ufile_ptr) NBPG * (UPAGES + u.u_dsize + u.u_ssize) #ifdef TRAD_CORE_EXTRA_SIZE_ALLOWED /* Some systems write the file too big. */ - + TRAD_CORE_EXTRA_SIZE_ALLOWED + + TRAD_CORE_EXTRA_SIZE_ALLOWED #endif - ) - < (unsigned long) statbuf.st_size) + ) + < (ufile_ptr) statbuf.st_size) { /* The file is too big. Maybe it's not a core file or we otherwise have bad values for u_dsize and u_ssize). */ @@ -155,20 +156,20 @@ trad_unix_core_file_p (abfd) /* Create the sections. */ - core_stacksec(abfd) = bfd_make_section_anyway (abfd, ".stack"); + flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; + core_stacksec(abfd) = bfd_make_section_anyway_with_flags (abfd, ".stack", + flags); if (core_stacksec (abfd) == NULL) goto fail; - core_datasec (abfd) = bfd_make_section_anyway (abfd, ".data"); + core_datasec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".data", + flags); if (core_datasec (abfd) == NULL) goto fail; - core_regsec (abfd) = bfd_make_section_anyway (abfd, ".reg"); + core_regsec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".reg", + SEC_HAS_CONTENTS); if (core_regsec (abfd) == NULL) goto fail; - core_stacksec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; - core_datasec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; - core_regsec (abfd)->flags = SEC_HAS_CONTENTS; - core_datasec (abfd)->size = NBPG * u.u_dsize #ifdef TRAD_CORE_DSIZE_INCLUDES_TSIZE - NBPG * u.u_tsize diff --git a/bfd/vaxbsd.c b/bfd/vaxbsd.c index 5f5f8a1e59d..fc53f7800bb 100644 --- a/bfd/vaxbsd.c +++ b/bfd/vaxbsd.c @@ -1,5 +1,5 @@ /* BFD back-end for BSD and Ultrix/VAX (1K page size) a.out-ish binaries. - Copyright 2002, 2003 Free Software Foundation, Inc. + Copyright 2002, 2003, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -32,8 +32,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define TARGETNAME "a.out-vax-bsd" -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libaout.h" diff --git a/bfd/versados.c b/bfd/versados.c index fb6cfbd22ac..a2ce0db79ae 100644 --- a/bfd/versados.c +++ b/bfd/versados.c @@ -1,6 +1,6 @@ /* BFD back-end for VERSAdos-E objects. - Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2006, 2007 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support . Versados is a Motorola trademark. @@ -37,8 +37,8 @@ o Object Text Record o End Record. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libiberty.h" @@ -675,7 +675,7 @@ versados_set_section_contents (bfd *abfd ATTRIBUTE_UNUSED, static int versados_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, - bfd_boolean exec ATTRIBUTE_UNUSED) + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return 0; } @@ -798,6 +798,7 @@ versados_canonicalize_reloc (bfd *abfd, #define versados_read_minisymbols _bfd_generic_read_minisymbols #define versados_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol #define versados_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup +#define versados_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup #define versados_set_arch_mach bfd_default_set_arch_mach #define versados_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents #define versados_bfd_relax_section bfd_generic_relax_section diff --git a/bfd/version.h b/bfd/version.h index f0ad1a88909..88dbbce9fc8 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1,3 +1,4 @@ -#define BFD_VERSION_DATE 20070807 +#define BFD_VERSION_DATE 20070703 #define BFD_VERSION @bfd_version@ -#define BFD_VERSION_STRING @bfd_version_string@ +#define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ +#define REPORT_BUGS_TO @report_bugs_to@ diff --git a/bfd/vms-gsd.c b/bfd/vms-gsd.c index 9d06cf78d0e..661f0c43770 100644 --- a/bfd/vms-gsd.c +++ b/bfd/vms-gsd.c @@ -1,7 +1,7 @@ /* vms-gsd.c -- BFD back-end for VAX (openVMS/VAX) and EVAX (openVMS/Alpha) files. - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2007 Free Software Foundation, Inc. go and read the openVMS linker manual (esp. appendix B) if you don't know what's going on here :-) @@ -22,8 +22,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" diff --git a/bfd/vms-hdr.c b/bfd/vms-hdr.c index 24a0aec1a0c..f116904f237 100644 --- a/bfd/vms-hdr.c +++ b/bfd/vms-hdr.c @@ -1,7 +1,7 @@ /* vms-hdr.c -- BFD back-end for VMS/VAX (openVMS/VAX) and EVAX (openVMS/Alpha) files. - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 - Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, + 2007 Free Software Foundation, Inc. HDR record handling functions EMH record handling functions @@ -25,9 +25,9 @@ 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 "bfdver.h" -#include "sysdep.h" #include "bfdlink.h" #include "safe-ctype.h" #include "libbfd.h" @@ -248,7 +248,7 @@ _bfd_vms_write_hdr (bfd *abfd, int objtype) /* LMN. */ _bfd_vms_output_begin (abfd, EOBJ_S_C_EMH, EMH_S_C_LNM); - _bfd_vms_output_dump (abfd, (unsigned char *)"GAS proGIS", 10); + _bfd_vms_output_dump (abfd, (unsigned char *) STRING_COMMA_LEN ("GAS proGIS")); _bfd_vms_output_flush (abfd); /* SRC. */ @@ -260,7 +260,7 @@ _bfd_vms_write_hdr (bfd *abfd, int objtype) if (symbol->flags & BSF_FILE) { - if (strncmp ((char *)symbol->name, "name, "name[6] - '0'; PRIV (flag_show_after_trunc) = symbol->name[7] - '0'; @@ -280,13 +280,13 @@ _bfd_vms_write_hdr (bfd *abfd, int objtype) } if (symnum == abfd->symcount) - _bfd_vms_output_dump (abfd, (unsigned char *)"noname", 6); + _bfd_vms_output_dump (abfd, (unsigned char *) STRING_COMMA_LEN ("noname")); _bfd_vms_output_flush (abfd); /* TTL. */ _bfd_vms_output_begin (abfd, EOBJ_S_C_EMH, EMH_S_C_TTL); - _bfd_vms_output_dump (abfd, (unsigned char *)"TTL", 3); + _bfd_vms_output_dump (abfd, (unsigned char *) STRING_COMMA_LEN ("TTL")); _bfd_vms_output_flush (abfd); /* CPR. */ diff --git a/bfd/vms-misc.c b/bfd/vms-misc.c index 7a3368bc7b0..31bd3b45a37 100644 --- a/bfd/vms-misc.c +++ b/bfd/vms-misc.c @@ -1,7 +1,7 @@ /* vms-misc.c -- Miscellaneous functions for VAX (openVMS/VAX) and EVAX (openVMS/Alpha) files. - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2007 Free Software Foundation, Inc. Written by Klaus K"ampf (kkaempf@rmi.de) @@ -23,8 +23,8 @@ #include #endif -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" diff --git a/bfd/vms-tir.c b/bfd/vms-tir.c index d6bff96f483..af79f20b75d 100644 --- a/bfd/vms-tir.c +++ b/bfd/vms-tir.c @@ -1,6 +1,6 @@ /* vms-tir.c -- BFD back-end for VAX (openVMS/VAX) and EVAX (openVMS/Alpha) files. - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2007 Free Software Foundation, Inc. TIR record handling functions @@ -34,8 +34,8 @@ qw quadword (8 byte, 64 bit) da data stream */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "vms.h" diff --git a/bfd/vms.c b/bfd/vms.c index e6ee98a53ee..c73692e32b5 100644 --- a/bfd/vms.c +++ b/bfd/vms.c @@ -1,7 +1,7 @@ /* vms.c -- BFD back-end for VAX (openVMS/VAX) and EVAX (openVMS/Alpha) files. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006 Free Software Foundation, Inc. + 2006, 2007 Free Software Foundation, Inc. Written by Klaus K"ampf (kkaempf@rmi.de) @@ -19,8 +19,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" @@ -487,7 +487,7 @@ vms_new_section_hook (bfd * abfd, asection *section) vms_debug (7, "%d: %s\n", section->index, section->name); #endif - return TRUE; + return _bfd_generic_new_section_hook (abfd, section); } /* Read the contents of a section. @@ -1353,6 +1353,22 @@ vms_bfd_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, return & alpha_howto_table[alpha_type]; } +static reloc_howto_type * +vms_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (alpha_howto_table) / sizeof (alpha_howto_table[0]); + i++) + if (alpha_howto_table[i].name != NULL + && strcasecmp (alpha_howto_table[i].name, r_name) == 0) + return &alpha_howto_table[i]; + + return NULL; +} + /* Part 4.7, writing an object file. */ /* Set the architecture and machine type in BFD abfd to arch and mach. @@ -1402,7 +1418,7 @@ vms_set_section_contents (bfd * abfd, static int vms_sizeof_headers (bfd * abfd ATTRIBUTE_UNUSED, - bfd_boolean reloc ATTRIBUTE_UNUSED) + struct bfd_link_info *info ATTRIBUTE_UNUSED) { #if VMS_DEBUG vms_debug (1, "vms_sizeof_headers (%p, %s)\n", abfd, (reloc)?"True":"False"); diff --git a/bfd/warning.m4 b/bfd/warning.m4 index 2e2dd424c0f..b366cadeb29 100644 --- a/bfd/warning.m4 +++ b/bfd/warning.m4 @@ -4,7 +4,7 @@ AC_DEFUN([AM_BINUTILS_WARNINGS],[ GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" AC_ARG_ENABLE(werror, - [ --enable-werror treat compile warnings as errors], + [ --enable-werror treat compile warnings as errors], [case "${enableval}" in yes | y) ERROR_ON_WARNING="yes" ;; no | n) ERROR_ON_WARNING="no" ;; @@ -27,7 +27,7 @@ if test "${GCC}" = yes ; then fi AC_ARG_ENABLE(build-warnings, -[ --enable-build-warnings Enable build-time compiler warnings], +[ --enable-build-warnings enable build-time compiler warnings], [case "${enableval}" in yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; no) if test "${GCC}" = yes ; then diff --git a/bfd/xcoff-target.h b/bfd/xcoff-target.h index 7e73cf26a59..b912fdf35e6 100644 --- a/bfd/xcoff-target.h +++ b/bfd/xcoff-target.h @@ -1,5 +1,5 @@ /* Common definitions for backends based on IBM RS/6000 "XCOFF64" files. - Copyright 2000, 2001, 2002, 2004, 2005 + Copyright 2000, 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -125,7 +125,7 @@ extern bfd * _bfd_xcoff_openr_next_archived_file (bfd *, bfd *); extern int _bfd_xcoff_generic_stat_arch_elt (bfd *, struct stat *); extern bfd_boolean _bfd_xcoff_write_armap (bfd *, unsigned int, struct orl *, unsigned int, int); extern bfd_boolean _bfd_xcoff_write_archive_contents (bfd *); -extern int _bfd_xcoff_sizeof_headers (bfd *, bfd_boolean); +extern int _bfd_xcoff_sizeof_headers (bfd *, struct bfd_link_info *); extern void _bfd_xcoff_swap_sym_in (bfd *, void *, void *); extern unsigned int _bfd_xcoff_swap_sym_out (bfd *, void *, void *); extern void _bfd_xcoff_swap_aux_in (bfd *, void *, int, int, int, int, void *); diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c index 47c330b6c15..b02886a416b 100644 --- a/bfd/xcofflink.c +++ b/bfd/xcofflink.c @@ -1,6 +1,6 @@ /* POWER/PowerPC XCOFF linker support. Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006 Free Software Foundation, Inc. + 2005, 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor , Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "coff/internal.h" @@ -794,27 +794,27 @@ xcoff_link_create_extra_sections (bfd * abfd, struct bfd_link_info *info) if (xcoff_hash_table (info)->loader_section == NULL) { asection *lsec; + flagword flags = SEC_HAS_CONTENTS | SEC_IN_MEMORY; - lsec = bfd_make_section_anyway (abfd, ".loader"); + lsec = bfd_make_section_anyway_with_flags (abfd, ".loader", flags); if (lsec == NULL) goto end_return; xcoff_hash_table (info)->loader_section = lsec; - lsec->flags |= SEC_HAS_CONTENTS | SEC_IN_MEMORY; } /* Likewise for the linkage section. */ if (xcoff_hash_table (info)->linkage_section == NULL) { asection *lsec; + flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY); - lsec = bfd_make_section_anyway (abfd, ".gl"); + lsec = bfd_make_section_anyway_with_flags (abfd, ".gl", flags); if (lsec == NULL) goto end_return; xcoff_hash_table (info)->linkage_section = lsec; - lsec->flags |= (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS - | SEC_IN_MEMORY); lsec->alignment_power = 2; } @@ -822,14 +822,14 @@ xcoff_link_create_extra_sections (bfd * abfd, struct bfd_link_info *info) if (xcoff_hash_table (info)->toc_section == NULL) { asection *tsec; + flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY); - tsec = bfd_make_section_anyway (abfd, ".tc"); + tsec = bfd_make_section_anyway_with_flags (abfd, ".tc", flags); if (tsec == NULL) goto end_return; xcoff_hash_table (info)->toc_section = tsec; - tsec->flags |= (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS - | SEC_IN_MEMORY); tsec->alignment_power = 2; } @@ -837,14 +837,14 @@ xcoff_link_create_extra_sections (bfd * abfd, struct bfd_link_info *info) if (xcoff_hash_table (info)->descriptor_section == NULL) { asection *dsec; + flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY); - dsec = bfd_make_section_anyway (abfd, ".ds"); + dsec = bfd_make_section_anyway_with_flags (abfd, ".ds", flags); if (dsec == NULL) goto end_return; xcoff_hash_table (info)->descriptor_section = dsec; - dsec->flags |= (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS - | SEC_IN_MEMORY); dsec->alignment_power = 2; } @@ -853,13 +853,13 @@ xcoff_link_create_extra_sections (bfd * abfd, struct bfd_link_info *info) && info->strip != strip_all) { asection *dsec; + flagword flags = SEC_HAS_CONTENTS | SEC_IN_MEMORY; - dsec = bfd_make_section_anyway (abfd, ".debug"); + dsec = bfd_make_section_anyway_with_flags (abfd, ".debug", flags); if (dsec == NULL) goto end_return; xcoff_hash_table (info)->debug_section = dsec; - dsec->flags |= SEC_HAS_CONTENTS | SEC_IN_MEMORY; } } @@ -1552,16 +1552,17 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info) { /* The linker script puts the .td section in the data section after the .tc section. */ - csect = bfd_make_section_anyway (abfd, ".td"); + csect = bfd_make_section_anyway_with_flags (abfd, ".td", + SEC_ALLOC); } else - csect = bfd_make_section_anyway (abfd, ".bss"); + csect = bfd_make_section_anyway_with_flags (abfd, ".bss", + SEC_ALLOC); if (csect == NULL) goto error_return; csect->vma = sym.n_value; csect->size = aux.x_csect.x_scnlen.l; - csect->flags |= SEC_ALLOC; csect->alignment_power = SMTYP_ALIGN (aux.x_csect.x_smtyp); /* There are a number of other fields and section flags which we do not bother to set. */ @@ -5460,8 +5461,8 @@ _bfd_xcoff_bfd_final_link (bfd *abfd, struct bfd_link_info *info) that needs padding. This requires unlinking and relinking the bfd's section list. */ - n = bfd_make_section_anyway (abfd, ".pad"); - n->flags = SEC_HAS_CONTENTS; + n = bfd_make_section_anyway_with_flags (abfd, ".pad", + SEC_HAS_CONTENTS); n->alignment_power = 0; bfd_section_list_remove (abfd, n); diff --git a/bfd/xsym.c b/bfd/xsym.c index 9659a65e021..c9757b65414 100644 --- a/bfd/xsym.c +++ b/bfd/xsym.c @@ -1,5 +1,5 @@ /* xSYM symbol-file support for BFD. - Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,9 +18,9 @@ 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 "xsym.h" #include "bfd.h" -#include "sysdep.h" #include "libbfd.h" #define bfd_sym_close_and_cleanup _bfd_generic_close_and_cleanup @@ -34,9 +34,6 @@ #define bfd_sym_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define bfd_sym_read_minisymbols _bfd_generic_read_minisymbols #define bfd_sym_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol -#define bfd_sym_get_reloc_upper_bound _bfd_norelocs_get_reloc_upper_bound -#define bfd_sym_canonicalize_reloc _bfd_norelocs_canonicalize_reloc -#define bfd_sym_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup #define bfd_sym_set_arch_mach _bfd_generic_set_arch_mach #define bfd_sym_get_section_contents _bfd_generic_get_section_contents #define bfd_sym_set_section_contents _bfd_generic_set_section_contents @@ -2228,7 +2225,7 @@ bfd_sym_scan (bfd *abfd, bfd_sym_version version, bfd_sym_data_struct *mdata) if (mdata->name_table == NULL) return -1; - bfdsec = bfd_make_section_anyway (abfd, name); + bfdsec = bfd_make_section_anyway_with_flags (abfd, name, SEC_HAS_CONTENTS); if (bfdsec == NULL) return -1; @@ -2238,8 +2235,6 @@ bfd_sym_scan (bfd *abfd, bfd_sym_version version, bfd_sym_data_struct *mdata) bfdsec->filepos = 0; bfdsec->alignment_power = 0; - bfdsec->flags = SEC_HAS_CONTENTS; - abfd->tdata.sym_data = mdata; return 0; @@ -2277,11 +2272,7 @@ bfd_sym_object_p (bfd *abfd) return NULL; } -asymbol * -bfd_sym_make_empty_symbol (bfd *abfd) -{ - return bfd_alloc (abfd, sizeof (asymbol)); -} +#define bfd_sym_make_empty_symbol _bfd_generic_make_empty_symbol void bfd_sym_get_symbol_info (bfd *abfd ATTRIBUTE_UNUSED, asymbol *symbol, symbol_info *ret) @@ -2302,7 +2293,8 @@ bfd_sym_canonicalize_symtab (bfd *abfd ATTRIBUTE_UNUSED, asymbol **sym ATTRIBUTE } int -bfd_sym_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, bfd_boolean exec ATTRIBUTE_UNUSED) +bfd_sym_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return 0; } @@ -2351,7 +2343,7 @@ const bfd_target sym_vec = BFD_JUMP_TABLE_CORE (_bfd_nocore), BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), BFD_JUMP_TABLE_SYMBOLS (bfd_sym), - BFD_JUMP_TABLE_RELOCS (bfd_sym), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), BFD_JUMP_TABLE_WRITE (bfd_sym), BFD_JUMP_TABLE_LINK (bfd_sym), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), diff --git a/bfd/xsym.h b/bfd/xsym.h index 386a1635746..7b69aadf34b 100644 --- a/bfd/xsym.h +++ b/bfd/xsym.h @@ -1,5 +1,5 @@ /* xSYM symbol-file support for BFD. - Copyright 1999, 2000, 2001, 2002, 2003, 2005 + Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -687,8 +687,6 @@ extern int bfd_sym_scan (bfd *, bfd_sym_version, bfd_sym_data_struct *); extern const bfd_target * bfd_sym_object_p (bfd *); -extern asymbol * bfd_sym_make_empty_symbol - (bfd *); extern void bfd_sym_get_symbol_info (bfd *, asymbol *, symbol_info *); extern long bfd_sym_get_symtab_upper_bound @@ -696,6 +694,6 @@ extern long bfd_sym_get_symtab_upper_bound extern long bfd_sym_canonicalize_symtab (bfd *, asymbol **); extern int bfd_sym_sizeof_headers - (bfd *, bfd_boolean); + (bfd *, struct bfd_link_info *); #endif /* __xSYM_H__ */ diff --git a/bfd/xtensa-isa.c b/bfd/xtensa-isa.c index 5fcf51eea93..362e47c3179 100644 --- a/bfd/xtensa-isa.c +++ b/bfd/xtensa-isa.c @@ -1,5 +1,5 @@ /* Configurable Xtensa ISA support. - Copyright 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "xtensa-isa.h" #include "xtensa-isa-internal.h" diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 2f6520f4420..574f1839e37 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,267 +1,696 @@ -2006-08-15 Nick Clifton +2007-07-02 Alan Modra - PR binutils/3039 - * wrstabs.c (stab_tag_type): Initialize 'size'. + PR 4716 + * objcopy.c (filter_symbols): Correct relocatable file test. -2006-06-07 Joseph S. Myers +2007-07-02 Alan Modra - * po/Make-in (pdf, ps): New dummy targets. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * doc/Makefile.in: Regenerate. + * po/POTFILES.in: Regenerate. + * po/binutils.pot: Regenerate. -2006-06-02 Joseph S. Myers +2007-06-30 H.J. Lu - * doc/Makefile.am (TEXI2DVI): Define. + * aclocal.m4: Regenerated. + * doc/Makefile.in: Likewise. + * Makefile.in: Likewise. + +2007-06-29 Joseph Myers + + * readelf.c (display_power_gnu_attribute, process_power_specific): + New. + (process_arch_specific): Call process_power_specific. + +2007-06-29 Joseph Myers + + * readelf.c (display_mips_gnu_attribute): New. + (process_mips_specific): Call process_attributes. + +2007-06-29 Joseph Myers + + * readelf.c (display_gnu_attribute): New. + (process_arm_specific): Rearrange as process_attributes. + (process_arm_specific): Replace by wrapper of process_attributes. + +2007-06-28 Roland McGrath + + * objcopy.c (setup_section): Don't reset ELF section type to + SHT_NOBITS when it is SHT_NOTE. + * doc/binutils.texi (objcopy, strip): Mention under --only-keep-debug. + +2007-06-27 Alan Modra + + * ar.c: Rename uses of bfd.next to bfd.archive_next throughout. + * arsup.c: Likewise. + * binemul.c: Likewise. + * objcopy.c: Likewise. + * dlltool.c: Likewise. + +2007-06-26 Shantonu Sen + + PR binutils/4693 + * Makefile.am (windres_DEPENDENCIES, windmc_DEPENDENCIES): Move + dependency on $(LIBICONV) to ... + (windres_LDADD, windmc_LDADD) ... here. + * Makefile.in: Regenerate. + +2007-06-21 Alan Modra + + * embedspu.sh (relas): Correct sh_info parsing. + +2007-06-19 Danny Smith + + * objdump.c: Include sys/stat.h. + +2007-06-19 Kai Tietz + + * Makefile.am: Add windmc tool. + * Makefile.in: Regenerate. + * configure.in: Add windmc tool. + * configure: Regenerate. + * mclex.c: New. + * mcparse.y: New. + * windmc.c: New. + * windmc.h: New. + * doc/Makefile.am: Add windmc tool. + * doc/Makefile.in: Regenerate. + * doc/binutils.texi: Add windmc documentation. + * NEWS: Mention new tool. + +2007-06-18 Andi Kleen + + * objdump.c: Include sys/mman.h + (print_file_list): Remove f, add map, mapsize, linemap, maxline, + last_line, first fields. + (slurp_file): Add. + (index_file): Add. + (print_file_open): Call slurp_file and index_file. Initialize new + fields. + (skip_to_line): Rename to print_line and write only single line. + (dump_line): Add. + (show_line): Change to new algorithm. + +2007-06-18 Thomas Weidenmueller + + * resres.c (probe_binary): Fix test for badly formatted headers. + +2007-06-18 Kai Tietz + + * rclex.c: (cpp_line): Add code_page pragma support. + * windres.c: (usage, long_options, main): Add new option + --codepage or -c. + * winduni.c: (wind_default_codepage, wind_current_codepage): New. + (unicode_from_ascii, ascii_from_unicode): Use + wind_current_codepage as codepage parameter. + (unicode_print): Print 4 characters for hexadecimal values in + unicode strings. + * winduni.h: (wind_default_codepage, wind_current_codepage): + Export. + * doc/binutils.texi: Document new option. + * NEWS: Mention new features of windres. + +2007-06-18 Brian D. Watt + + * embedspu.sh: Parse _SPUEAR_ symbol values as hex. + +2007-06-14 H.J. Lu + + * Makefile.am (ACLOCAL_AMFLAGS): Add -I ../config -I ../bfd. + + * acinclude.m4: Removed. + + * Makefile.in: Regenerated. + * aclocal.m4: Likewise. + * configure: Likewise. + +2007-06-11 Nathan Sidwell + + * dwarf.c (decode_location_expression): Add DW_OP_form_tls_address. + +2007-06-06 Kai Tietz + + PR binutils/4356 binutils/591 + * resrc.c (filename_need_quotes): New function. + (look_for_default): If filename_need_quotes is true then quote the + filename in the command line being created. + (read_rc_file): Likewise. + +2007-06-06 Ben Elliston + + * doc/binutils.texi (objdump): Fix capitalisation of "PowerPC". + +2007-06-05 Kai Tietz + + * Makefile.am: Add LIBICONV to windres. + * acinclude.m4: Added missing "lib-*.m4" and "lt*.m4" files. + * configure.in: Add AC_CHECK_HEADER for iconv.h and use AM_ICONV. + * config.in: Add ICONV defines. + * aclocal.m4: Regenerate. + * confugure: Regenerate. + * winduni.c: (local_iconv_map codepages, wind_language_t, + languages, unicode_is_valid_codepage, wind_find_language_by_id, + wind_find_language_by_codepage, wind_find_codepage_info, + unicode_from_codepage, codepage_from_unicode, iconv_onechar, + wind_iconv_cp, wind_MultiByteToWideChar wind_WideCharToMultiByte): + New. + (ascii_from_unicode): Use codepage_from_unicode. + (ascii_from_unicode): Use unicode_from_codepage. + Use for cygwin windows API for unicode transformation. + * winduni.h: (CP_ACP, CP_UTF7, CP_UTF8, CP_OEM, CP_UTF16): New + macros. + (wind_language_t, local_iconv_map): New types. + (wind_find_language_by_id, wind_find_language_by_codepage, + unicode_is_valid_codepage, wind_find_codepage_info, + unicode_from_codepage, codepage_from_unicode): New + prototypes. + +2007-06-05 Alan Modra + + * embedspu.sh: Handle R_SPU_PPU* relocs with no symbol. + +2007-05-30 Alan Modra + + * objcopy.c (copy_object): Revert 2007-05-11 change. Don't + avoid calling bfd_copy_private_bfd_data for ELF STRIP_NONDEBUG. + (setup_section): Don't modify flags, and don't avoid calling + bfd_copy_private_section_data for ELF STRIP_NONDEBUG. + * readelf.c (process_program_headers): Ignore .dynamic of type + SHT_NOBITS. + +2007-05-29 Alan Modra + + * embedspu.sh: Emit SPU ELF image to .data.rel.ro.speelf if + pic or pie and image needs relocs. + +2007-05-24 Steve Ellcey + + * Makefile.in: Regenerate. + * configure: Regenerate. + * aclocal.m4: Regenerate. * doc/Makefile.in: Regenerate. -2006-06-01 Daniel Jacobowitz +2007-05-24 Kai Tietz - Backport: - 2006-05-19 Andreas Schwab - * doc/Makefile.am (addr2line.1): Depend on $(binutils_TEXINFOS). - (ar.1): Likewise. - (dlltool.1): Likewise. - (nlmconv.1): Likewise. - (nm.1): Likewise. - (objcopy.1): Likewise. - (objdump.1): Likewise. - (ranlib.1): Likewise. - (readelf.1): Likewise. - (size.1): Likewise. - (strings.1): Likewise. - (strip.1): Likewise. - (windres.1): Likewise. - (cxxfilt.man): Likewise. + * rcparse.y: Join strings for elements having no side-effects in + "rc"-grammar. + +2007-05-23 Kai Tietz + + * rclex.c: New file replacing rclex.l. + * rclex.l: Removed. + * windint.h: New file holding common structure and type + definitions. + * Makefile.am: Added new header windint.h and exchanged rclex.l by + rclex.c. + * Makefile.in: Regenerate. + * rcparse.y: Renamed some structures. + Use in internal representation always bfd_vma instead of long or + int. + Removed from %union unused stringtable. + Added to %union suni structure for unicode strings. + Added new tokens for ANICURSOR, ANIICON, DLGINCLUDE, + DLGINIT, FONTDIR, HTML, MANIFEST, PLUGPLAY, VXD, + TOOLBAR, BUTTON, QUOTEDUNISTRING, and SIZEDUNISTRING. + Added support for these new rc file tokens. + * resbin.c: Rewrote using bfd and binary structures, and support + new resource types. + * rescoff.c: Likewise. + * resres.c: Likewise. + * resrc.c: Likewise. Dumps as RC are now recompilable. + * windres.c: As above. Using bfd for res and provide target + specific endianess support. + * windres.h: Use windint.h as include. Additionally removed K&R + syntax. + * winduni.c: New printing and unichar support routines. + * winduni.h: Prototypes for new unichar helpers. + * windint.h: New file. + +2007-05-22 Paul Brook + + * objdump.c (find_symbol_for_address): Merge section and target + specific filtering code. + +2007-05-22 Nick Clifton + + * doc/binutils.texi: Use @copying around the copyright notice. + +2007-05-21 Richard Sandiford + + * objdump.c (disassemble_bytes): Ignore disassembler_needs_relocs + for executables and shared libraries. + +2007-05-18 Nathan Sidwell + + * objcopy.c (strip_main): Detect identical input and output file + names. + (copy_main): Refactor tempname detection and use. + +2007-05-17 Nick Clifton + + * objdump.c (load_debug_section): Select bias for DWARF debug + addresses based on the flavour of the bfd. + +2007-05-11 Alan Modra + + PR 4479 + * objcopy.c (copy_object): Don't copy ELF program headers for + --only-keep-debug. + +2007-05-11 Alan Modra + + * embedspu.sh (find_prog): Prefer prog in same dir as embedspu + over one found on the users path. + (main): Generate .reloc for each R_SPU_PPU* reloc. + +2007-04-28 Alan Modra + + * prdbg.c (tg_variable): Adjust for changed demangler. + (tg_start_function): Likewise. + +2007-04-27 Alan Modra + + * bucumm.h: Split off host dependencies to.. + * sysdep.h: ..here. + Many files: Include sysdep.h. Remove duplicate headers and reorder. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2007-04-24 Nick Clifton + + * srconv.c (walk_tree_type_1): Initialise dpt.dunno. + +2007-04-24 Nathan Froyd + Phil Edwards + + * objcopy.c (filter_symbols): Explicitly stripping a symbol + used in relocations is an error. + Retype 'keep' to bfd_boolean. + +2007-04-24 Alan Modra + + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + +2007-04-20 Nathan Froyd + Phil Edwards + Thomas de Lellis + + * objcopy.c (reverse_bytes): New variable. + (command_line_switch, copy_main): Add OPTION_REVERSE_ENDIAN. + (copy_options, copy_usage): Add "reverse-bytes" entry. + (copy_section): Reverse bytes within output sections. + * doc/binutils.texi: Document new objcopy option. + +2007-04-20 Nick Clifton + + * rclex.l: Allow underscores at the start of identifiers. + +2007-04-19 Alan Modra + + * budemang.c: Delete. + * budemang.h: Delete. + * addr2line.c (translate_addresses): Call bfd_demangle rather than + demangle. + * nm.c (print_symname): Likewise. + * objdump.c (objdump_print_symname, dump_symbols): Likewise. + (dump_bfd): Likewise. + * prdbg.c (struct pr_handle ): Add int param. + (tg_variable, tg_start_function): Adjust demangler calls. + * Makefile.am: Remove mention of budemang.[ch]. Run "make dep-am". + * Makefile.in: Regenerate. + * po/POTFILES.in: Regenerate. + +2007-04-14 Steve Ellcey + + * Makefile.am: Add ACLOCAL_AMFLAGS. + * configure.in: Change macro call order. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2007-04-13 Nathan Sidwell + + * Makefile.am (TOOL_PROGS): Add objcopy. + * Makefile.in: Rebuilt. + +2007-04-12 H.J. Lu + + PR binutils/4348 + * objcopy.c (copy_object): Don't stop when there are no + sections to be copied. + +2007-04-10 Vladimir Prus + + * NEWS: Mention disjoint histograms support in + gprof. + +2007-04-09 Daniel Jacobowitz + + * dwarf.c (process_debug_info): Do not require DW_AT_frame_base for + DW_TAG_inlined_subroutine. + +2007-04-06 Matt Thomas + + * MAINTAINERS: Add myself as VAX and NetBSD support maintainer. + +2007-04-05 Alan Modra + + PR binutils/4292 + * nm.c (print_value): Cast bfd_vma to unsigned long to suit + value_format_32bit. + +2007-04-02 Nick Clifton + + PR binutils/4292 + * nm.c (value_format): Replace with value_format_32bit and + value_format_64bit. + (set_radix): Update setting of value_format. + (set_print_width): New function. Compute the address size of a + given bfd and set the print_width global appropriately. + (display_archive): Use set_print_width. + (display_file): Likewise, + (print_object_filename_sysv): Update use of print_width. + (print_archive_member_sysv): Likewise. + (print_symbol_filename_posix): Likewise. + (print_sumbol_info_bfd, print_symbol_info_sysv): Likewise. + +2007-03-28 Richard Sandiford + Phil Edwards + + * doc/binutils.texi: Put the contents after the title page rather + than at the end of the document. + +2007-03-28 Nick Clifton + + * readelf.c (slurp_rela_relocs): Add newline to end of error + messages. + (slurp_rel_relocs, request_dump, request_dump_byname, + process_program_headers, process_dynamic_section, + process_symbol_table, process_mips_specific, main): Likewise. + +2007-03-28 Alan Modra + + * MAINTAINERS: Update mailing list addresses. Add myself + as PPC maintainer. + +2007-03-27 Alan Modra + + * embedspu.sh: Correct toe_addr quoting. + +2007-03-27 Alan Modra + + * embedspu.sh: Combine "_EAR_" and "_EAR_*" patterns. Tighten + .toe section and .toe address checks. Use .reloc for _EAR* + symbols defined in non-BSS sections. Build table for _SPUEAR_ + symbols. + +2007-03-23 Kaz Kojima + + PR gas/3811 + * readelf.c (debug_apply_rela_addends): Do nothing for SH. + +2007-03-22 Joseph Myers + + * doc/binutils.texi: Include VERSION_PACKAGE when reporting + version. + +2007-03-16 Kai Tietz + + * dlltool.c (make_one_lib_file): Use pc-relative relocation + instead of an absolute relocation for x86_64-pc-mingw32 target. + +2007-03-15 H.J. Lu + + * Makefile.am (REPORT_BUGS_TO): Removed. + (INCLUDES): Remove -DREPORT_BUGS_TO. + * Makefile.in: Regenerated. + + * bucomm.c: Don't include bfdver.h. + * objdump.c: Likewise. + * version.c: Likewise. + + * bucomm.h: Include bfdver.h. + + * configure.in (--with-bugurl): Removed. + * configure: Regenerated. + + * doc/Makefile.am (binutils_TEXINFOS): Removed. + (AM_MAKEINFOFLAGS): Add -I ../../bfd/doc. + (TEXI2DVI): Likewise. + (config.texi): Removed. + (MOSTLYCLEANFILES): Remove config.texi. * doc/Makefile.in: Regenerated. -2006-05-30 Nick Clifton + * doc/binutils.texi: Include bfdver.texi instead of + config.texi. - * po/es.po: Updated Spanish translation. +2007-03-13 Nick Clifton -2006-05-24 Nick Clifton + * readelf.c (dump_section): Also test for SHT_REL sections when + producing the warning about unapplied relocs. - * po/fr.po: Updated French translation. +2007-03-07 Joseph Myers -2006-05-23 Nick Clifton + * configure.in (REPORT_BUGS_TEXI): Define to Texinfo version of + bug-reporting URL. + * doc/Makefile.am (config.texi): Define BUGURL. + * doc/binutils.texi: Use BUGURL. Remove text about large files + and uuencoding. + * Makefile.in, configure, doc/Makefile.in: Regenerate. - * po/vi.po: Updated Vietnamese translation. +2007-03-01 Phil Edwards + Richard Sandiford -2006-05-22 Daniel Jacobowitz + * NEWS: Mention addition of --extract-symbol. + * doc/binutils.texi: Document it. + * objcopy.c (extract_symbol): New variable. + (OPTION_EXTRACT_SYMBOLS): New command_line_switch. + (copy_options): Add an entry for --extract-symbol. + (copy_usage): Mention --extract-symbol. + (copy_object): Set the start address to zero for --extract-symbol. + Do not copy private BFD data in that case. + (setup_section): Set the size, LMA and VMA to zero for + --extract-symbol. Do not copy private BFD data in that case. + (copy_section): Do not copy section contents if --extract-symbol + is passed. + (copy_main): Set extract_symbol to TRUE if --extract-symbol + is passed. - * po/ru.po: Updated translation. +2007-03-01 Paul Brook -2006-05-02 Daniel Jacobowitz + * MAINTAINERS: Update my entry. - * doc/Makefile.am (AM_MAKEINFOFLAGS): New. - (TEXI2POD): Use AM_MAKEINFOFLAGS. - (config.texi): Don't set top_srcdir. - * doc/binutils.texi: Don't use top_srcdir. - * aclocal.m4, Makefile.in, doc/Makefile.in: Regenerated. +2007-03-01 Joseph Myers -2006-04-12 Nick Clifton + * version.c: Update copyright date. - * objdump.c (objdump_symbol_at_address): Fix typo in comment. +2007-03-01 Daniel Jacobowitz -2006-04-10 Ben Elliston + * Makefile.am (install-exec-local): Depend on $(noinst_PROGRAMS). + Adjust $(EXEEXT) handling for $(RENAMED_PROGS). + * Makefile.in, doc/Makefile.in: Regenerate. - * MAINTAINERS (CGEN Maintainers): Remove myself. +2007-03-01 Alan Modra -2006-04-06 Carlos O'Donell + * embedspu.sh: Set type and size of global program handle symbol. - * po/Make-in: Add install-html target. - * Makefile.am: Add install-html and install-html-recursive targets. +2007-02-28 Alan Modra + + * Makefile.am (PROGS): Delete. + (RENAMED_PROGS): Define. Extracted from.. + (noinst_PROGRAMS): ..here. Add BUILD_MISC. + (install-exec-local): Adjust. + * Makefile.in: Regenerate. + +2007-02-28 Alan Modra + + * Makefile.am (PROGS): Add BUILD_INSTALL_MISC. + (bin_PROGRAMS): Replace BUILD_MISC with BUILD_INSTALL_MISC. + (EXTRA_PROGRAMS): Remove bin2c. + (bin2c$(EXEEXT_FOR_BUILD)): New rule. + (bin2c_SOURCES): Delete. + (DISTCLEANFILES): Remove sysinfo. + (MOSTLYCLEANFILES): Add sysinfo$(EXEEXT_FOR_BUILD) and + bin2c$(EXEEXT_FOR_BUILD). + * configure.in (BUILD_MISC): Add $(EXEEXT_FOR_BUILD) to bin2c. + Move embedspu to.. + (BUILD_INSTALL_MISC): ..here. * Makefile.in: Regenerate. - * configure.in: AC_SUBST datarootdir, docdir and htmldir. * configure: Regenerate. - * doc/Makefile.am: Add install-html and install-html-am targets. + +2007-02-27 Alan Modra + + * bin2c.c: New file. + * Makefile.am (EXTRA_PROGRAMS): Add bin2c. + (CFILES): Add bin2c.c. + (bin2c_SOURCES): Define. + (bin2c.o): Dependencies from "make dep-am". + * configure.in (BUILD_MISC): Add bin2c. + * version.c: Update year. + * po/POTFILES.in: Regenerate. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2007-02-17 Mark Mitchell + Nathan Sidwell + Vladimir Prus + + * configure.in (--with-bugurl): New option. + * configure: Regenerate. + * Makefile.am (REPORT_BUGS_TO): Define. + (INCLUDES): Define REPORT_BUGS_TO. + Regenerate dependencies. + * Makefile.in: Regenerate. * doc/Makefile.in: Regenerate. + * bucomm.h: Remove include of bin-bugs.h. + * addr2line.c (usage): Don't print empty REPORT_BUGS_TO. + * ar.c (usage): Pass s to list_supported_targets. Don't print + empty REPORT_BUGS_TO. + * coffdump.c (show_usage): Don't print empty REPORT_BUGS_TO. + * cxxfilt.c (usage): Print bug url when giving help. + * dlltool.c (usage): Likewise. + * dllwrap.c (usage): Likewise. + * nlmconv.c (show_usage): Don't print empty REPORT_BUGS_TO. + * nm.c (usage): Likewise. + * objcopy.c (copy_usage, strip_usage): Likewise. + * objdump.c (usage): Likewise. + * readelf.c ((usage): Likewise. Add STREAM argument. Adjust + callers. + * size.c (usage): Don't print empty REPORT_BUGS_TO. + * srconv.c (show_usage): Likewise. + * strings.c (usage): Likewise. + * sysdymp.c (show_usage): Likewise. + * windres.c (usage): Likewise. -2006-04-05 Eric Botcazou +2007-02-13 Alan Modra - * addr2line.c (long_options): Add new option 'section'. - (usage): Document new -j/--section option. - (find_offset_in_section): New function. - (translate_addresses): Add 'section' parameter. - If it is non-null, call find_offset_in_section on it. - (process_file): Add 'section_name' parameter. - If it is non-null, look for the section in the BFD object. - Pass the section to translate_addresses. - (main): Handle new -j option. - Pass the section name to process_file. - * doc/binutils.texi (addr2line): Document new -j/--section option. + * embedspu.sh: Add -W to readelf invocation. -2006-03-29 Ben Elliston +2007-02-06 Dave Brolley - * resbin.c: Avoid duplicating constants in calls to reswr_alloc. + * MAINTAINERS: Add myself as the maintainer of the MeP port. -2006-03-20 Nathan Sidwell +2007-02-06 Nick Clifton - * BRANCHES: Remove binutils-csl-arm-2006q1-branch. Document - binutils-csl-2_17-branch instead. + PR gas/3800 + * readelf.c: Include elf/h8.h twice. The first time in order to + get the reloc numbers, the second time in order to get the reloc + decoder function. + (dump_section): Tell the user if the section being displayed has + unprocessed relocs associated with it. + (get_reloc_size): New function - returns the size of a reloc. + (debug_apply_rela_addends): Use get_reloc_size(). + * dwarf.c (read_and_display_attr_value): Extend number of + languages known for the DW_AT_language attribute. + (process_debug_info): Display the attribute offset before decoding + the attribute, in case there are problems. -2006-03-20 Paul Brook +2007-02-05 Dave Brolley - * BRANCHES: Mention binutils-csl-arm-2006q1-branch. + * readelf.c (dump_relocations): Don't check for + (rtype == NULL && type == R_RELC). -2006-03-16 Alan Modra +2007-02-05 Dave Brolley - PR 2434 - * ieee.c (write_ieee_debugging_info): Adjust bfd_hash_table_init calls. - * wrstabs.c (write_stabs_in_sections_debugging_info): Likewise. + * Makefile.am (readelf.o): Depends on $(INCDIR)/elf/mep.h. + * Makefile.in: Regenerated. + * Contribute the following changes: + 2003-10-29 Dave Brolley -2006-03-13 Ben Elliston + * configure.in: Define SKIP_ZEROES and SKIP_ZEROES_AT_END for mep. + * configure: Regenerated. - * bucomm.c (display_target_list): Make local variable `a' to be of - type enum bfd_architecture. Thus no need to cast enums to int. - (display_info_table): Likewise. + 2001-04-03 Ben Elliston -2006-03-10 Paul Brook + * readelf.c: Include "elf/mep.h". + (guess_is_rela): Handle EM_CYGNUS_MEP. + (get_machine_name): Ditto. + (dump_relocations): Ditto. - * readelf.c (decode_ARM_machine_flags): Handle EABIv5. +2007-02-02 H.J. Lu -2006-03-10 Alan Modra + * MAINTAINERS: Add a space between H.J. and Lu. - * dwarf.c (process_extended_line_op): Remove pointer_size param. - Use length instead to determine address size. - (get_pointer_size_and_offset_of_comp_unit): Delete. - (display_debug_lines): Adjust for above. - (display_debug_aranges): Don't stop on finding two zeros. - (display_debug_frames): For warning, print offset not pointer. +2007-02-02 H.J. Lu -2006-03-09 Danny Smith + * doc/binutils.texi (objdump): Document the new addr64 option + for i386 disassembler. - * dlltool.c: Update copyright year. - * doc/binutils.texi: Likewise. +2007-02-02 H.J. Lu -2006-03-09 Danny Smith + PR binutils/3945 + * configure.in (DLLTOOL_DEFAULT): New. Defined for the first PE + target. + (DLLTOOL_DEFS): Add $DLLTOOL_DEFAULT. + * configure: Regenerated. - * dlltool.c (add_stdcall_underscore): New flag. - (xlate): Also add underscore to stdcall symbol if - add_stdcall_underscore set. - (usage): Document --add-stdcall-underscore option. - (OPTION_ADD_STDCALL_UNDERSCORE): New define. - (long_options): Use it for --add-stdcall-underscore option. - (main): Handle it. - * doc/binutils.texi: Document --add-stdcall-underscore option - and differentiate from --add-underscore. + * dlltool.c (mname): Defined with DLLTOOL_DEFAULT_XXX. -2006-03-06 Nathan Sidwell +2007-02-02 Nick Clifton - * readelf.c (get_machine_flags): Adjust. + * doc/binutils.texi (objdump): Document support for disassembling + the 440 PowerPC architecture. -2006-03-03 Jakub Jelinek +2007-01-31 Nathan Sidwell - * dwarf.c (frame_display_row, display_debug_frames): Handle - DW_CFA_val_offset, DW_CFA_val_offset_sf and DW_CFA_val_expression. + * dwarf.c (process_debug_info): Protect against bogus length and + abbrev offsets. -2006-02-28 Nick Clifton +2007-01-25 Kazu Hirata - * objcopy.c (use_alt_mach_code): Change type to unsigned long. - (copy_object): If bfd_alt_mach_code fails emit a more helpful - message and if the target architecture is ELF use the alternative - as replacement value for the e_machine number. - (copy_main): Use strtoul to parse the number provided with the - --alt-mach-code switch. - * doc/binutils.texi (--alt-mach-code): Document that this switch - can now set the absolute e_machine value. + * ar.c (print_contents, extract_file): Cast the return value + of fwrite to size_t. -2006-02-27 Carlos O'Donell +2007-01-12 Alan Modra - * po/Make-in: Add html target. + * ar.c (open_inarch): Check fwrite return. Use size_t. + (extract_file): Likewise. Remove test for "negative" file size. + * readelf.c (process_program_headers): Check fscanf return. -2006-02-17 Nick Hudson +2007-01-11 H.J. Lu - * readelf.c (get_machine_flags): Add logic for missing EF_SH flags. + * bucomm.c (template_in_dir): Fix typo. -2006-02-14 Jakub Jelinek +2007-01-11 Alan Modra - * config.in: Rebuilt. - -2006-02-10 H.J. Lu - - PR binutils/2258 - * readelf.c (process_program_headers): Use - ELF_IS_SECTION_IN_SEGMENT_MEMORY. - -2006-02-09 Eric Botcazou - - * configure.in (CHECK_DECLS): Add snprintf and vsnprintf. - * configure: Regenerate. - * objdump.c (fprintf): Remove declaration. - * bucomm.h (fprintf): Declare if not already declared. - (snprintf): Likewise. - (vsnprintf): Likewise. - -2006-02-08 H.J. Lu - - * readelf.c (process_program_headers): Match PT_TLS segment - only with SHT_TLS sections. - -2006-02-07 Nathan Sidwell - - * readelf.c (get_machine_flags): Add logic for EF_M68K flags. - -2006-02-02 H.J. Lu - - * readelf.c (process_program_headers): Undo the last change. - -2006-02-02 H.J. Lu - - * readelf.c (process_program_headers): Undo the change made on - 2004-09-22. Match PT_DYNAMIC segment only with SHT_DYNAMIC - sections. - -2006-01-30 Nick Clifton - - * objcopy.c (copy_object): Catch the case where an attempt is made - to add a section that already exists and produce a more helpful - warning message. - -2006-01-26 Nick Clifton - - * po/vi.po: New Vietnamese translation. - * configure.in (ALL_LINGUAS): Add vi. - * configure: Regenerate. - -2006-01-18 Alexandre Oliva - - Introduce TLS descriptors for i386 and x86_64. - * readelf.c (get_dynamic_type): Handle DT_TLSDESC_GOT and - DT_TLSDESC_PLT. - -2006-01-18 Nick Clifton - - PR binutils/1391 - * objcopy.c (copy_object): For PE format targets set the VMA of a - newly created gnu_debuglink section to a non-zero, aligned, - contiguous value. - * Makefile.am (objcopy.c): Add a dependency upon libbfd.h. + * embedspu.sh: New file. + * Makefile.am (embedspu): Add rule. + * configure.in (BUILD_MISC): Add embedspu for powerpc-linux. * Makefile.in: Regenerate. - -2006-01-17 Andreas Schwab - - PR binutils/1486 - * configure.in: Don't define DISASSEMBLER_NEEDS_RELOCS. * configure: Regenerate. - * objdump.c (struct objdump_disasm_info): Don't check for - DISASSEMBLER_NEEDS_RELOCS. - (objdump_print_addr): Likewise. - (disassemble_bytes): Check disassembler_needs_relocs from - disassemble_info at run-time instead of DISASSEMBLER_NEEDS_RELOCS - at compile-time. - (disassemble_section): Likewise. - (disassemble_data): Initialize it. -2006-01-11 Alan Modra +2007-01-11 Alan Modra - * objcopy.c (copy_object): Fix thinko. + * bucomm.h (make_tempdir): Declare independently of HAVE_MKDTEMP. + * bucomm.c (template_in_dir): New function, split out from.. + (make_tempname): ..here. Open the file with O_EXCL if !HAVE_MKSTEMP. + (make_tempdir): Use template_in_dir. Handle directory creation + when !HAVE_MKDTEMP. + * objcopy.c (MKDIR): Don't define. + (copy_archive): Use make_tempdir when !HAVE_MKDTEMP too. Fix + error message. - * objcopy.c (copy_object): Set isympp and osympp to NULL after free. +2007-01-08 Kazu Hirata -2006-01-09 Mike Frysinger : + * readelf.c (get_machine_flags): Treat Fido as an architecture + by itself. - * readelf.c (guess_is_rela): Add case for Nios/Nios II. - (get_machine_name): Likewise. +2007-01-08 Kai Tietz -For older changes see ChangeLog-2005 + * configure.in: Renamed target x86_64-*-mingw64 to + x86_64-*-mingw*. + * configure: Regenerated. + +2007-01-05 Alan Modra + + * readelf.c (dump_section): Don't print 32-bit values, which + were done incorrectly for little-endian. Instead print bytes. + +For older changes see ChangeLog-2006 Local Variables: mode: change-log diff --git a/binutils/ChangeLog-2006 b/binutils/ChangeLog-2006 new file mode 100644 index 00000000000..9961063afd2 --- /dev/null +++ b/binutils/ChangeLog-2006 @@ -0,0 +1,599 @@ +2006-12-25 Kazu Hirata + + * readelf.c (get_machine_flags): Handle EF_M68K_CPU32_FIDO_A. + +2006-12-11 J"orn Rennecke + + MAINTAINERS (SH): Remove my entry. + +2006-12-11 Daniel Jacobowitz + + * configure.in: Define GENINSRC_NEVER. + * doc/Makefile.am (MAINTAINERCLEANFILES): Add info file. + (DISTCLEANFILES): Pretend to add info file. + * po/Make-in (.po.gmo): Put gmo files in objdir. + * configure, Makefile.in, doc/Makefile.in: Regenerated. + +2006-12-07 Kazu Hirata + + * readelf.c: Update uses of EF_M68K_*. + +2006-10-30 Paul Brook + + * objdump.c (disassemble_section): Set info->symtab_pos. + (disassemble_data): Set info->symtab and info->symtab_size. + +2006-10-29 H.J. Lu + + PR binutils/3384 + * configure.in (AC_CHECK_HEADERS): Add limits.h and sys/param.h. + * configure: Regenerated. + * config.in: Likewise. + + * readelf.c: Include and for PATH_MAX. + (program_interpreter): Allocate PATH_MAX bytes instead of 64. + (process_program_headers): Don't assume that program interpreter + is shorter than 64 characters. + +2006-10-25 Trevor Smigiel + Yukishige Shibata + Nobuhisa Fujinami + Takeaki Fukuoka + Alan Modra + + * readelf.c: Add SPU support. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2006-10-13 Robert Connolly + + PR binutils/2876 + * configure.in: Check for the mkstemp and mkdtemp functions. + * configure: Regenerate. + * config.in (HAVE_MKDTEMP): New potential define. + (MAKE_MKSTEMP): Likewise. + * bucomm.c (make_tempname): Use mkstemp if it is available. + (make_tempdir): New function: Create a temporary directory using + mkdtemp, if it is available. + * bucomm.h (make_tempdir): New prototype. + * objcopy.c (copy_archive): Use make_tempdir if it is available. + (strip_main): Produce an warning message if a temporary file could + not be created. + (copy_main): Likewise. + * ar.c (write_archive): Likewise. + +2006-10-10 Andreas Schwab + + * dwarf.c (display_debug_loc): Don't dereference loc_offsets when + there are no location lists. + (display_debug_ranges): Similar for range_lists. + +2006-10-04 H.J. Lu + + * readelf.c (debug_apply_rela_addends): Don't ignore relocation + against symbols without type. + +2006-09-25 Pedro Alves + + * nlmconv.c (main) : Use LITMEMCPY. + * prdbg.c (tg_class_static_member) : Use LITSTRCPY. + +2006-09-26 H.J. Lu + + PR binutils/3257 + * strings.c (main): Handle "-T format". + +2006-09-26 Nick Clifton + + * MAINTAINERS: Add Mei Ligang as maintainer of the Score port. + +2006-09-26 Thiemo Seufer + + * configure.in: Remove broken changequote lines. + +2006-09-20 Kai Tietz + + * configure.in: Add new target x86_64-pc-mingw64. + * configure: Regenerate. + * dlltool.c: Adjust include for this target. + (DLLTOOL_MX86_64): Added macro to handle target specific code. + (mname): Added default target static as "i386:x86-64". + (MX86): Added macro for target ident. + (mtable): Added target specific definitions. + (rvaafter): Add handling of MX86. + (rvabefore): Add handling of MX86. + (asmprefix): Add handling of MX86. + +2006-09-17 Mei Ligang + + * readelf.c: Add support for Score binaries. + * Makefile.am: Update readelf's dependencies. + * Makefile.in: Regenerate. + +2006-09-16 Nick Clifton + Pedro Alves + + * ar.c: Make use of new STRING_COMMA_LEN and CONST_STRNEQ + macros defined in bfd.h. + * dlltool.c: Likewise. + * emul_aix.c: Likewise. + * nlmconv.c: Likewise. + * objdump.c: Likewise. + * prdbg.c: Likewise. + * stabs.c: Likewise. + * readelf.c (const_strneq): New macro. + (process_section_headers, slurp_ia64_unwind_table, + slurp_hppa_unwind_table, display_debug_section, process_notes, + process_archive): Use the new macro. + +2006-09-14 H.J. Lu + + PR binutils/3181 + * objcopy.c (group_signature): Return proper group signature. + +2006-09-14 Alan Modra + + PR 3181 + * objcopy.c (group_signature): New function, split out from.. + (setup_section): ..here. + (is_strip_section): Return true for SHT_GROUP sections that are + going to lose their group signature symbol. + +2006-09-14 Alan Modra + + PR 3181 + * objcopy.c (copy_object): Load symbols earlier. + (setup_section): Mark group signature symbols with BSF_KEEP. + +2006-09-09 Nick Clifton + + PR binutils/3110 + * objcopy.c (copy_archive): Add new parameter: + force_output_target. If not true, then perserve the file formats + of each copied archive element, otherwise force them to be one + specific file format. + (copy_file): Compute force_output_target parameter to pass to + copy_archive. + +2006-09-05 Nick Clifton + + PR binutils/3166 + * objcopy.c (is_strip_section): Do not treat group sections as + debugging sections. + * doc/binutils.texi (--only-keep-debug): Document that this switch + is only intended for use on fully linked files. + +2006-09-01 Nick Clifton + + PR binutils/3146 + * readelf.c (dump_relocations): Check for a NULL value in rtype + before using it. + +2006-08-21 Pedro Alves + + * configure.in: Split arm-pe and arm-wince-pe. Build dlltool + with -DDLLTOOL_ARM_WINCE for Windows CE case. + * configure: Regenerate. + * dlltool.c: Add support for arm-wince. + +2006-08-15 Nick Clifton + + PR binutils/3039 + * wrstabs.c (stab_tag_type): Initialize 'size'. + +2006-08-10 J"orn Rennecke + + PR binutils/3017 + * doc/Makefile.am: Use single quotes inside backquotes for + date command while generating config.texi. + * doc/Makefile.in: Regenerate. + +2006-08-08 Nick Clifton + + PR binutils/2768 + * dwarf.c (display_debug_aranges): When the address size is + greater than 4 display addresses and lengths as 16 hex digits, + otherwise use 8 hex digits. + +2006-08-06 Nick Clifton + + PR binutils/3001 + * addr2line.c (process_file): Change function from void to + returning an int. Return 0 upon success, 1 otherwise. + (main): Use return value from process_file as the exit value. + * ar.c (ranlib_only): Change function from void to returning an + int. Return 0 upon success, 1 otherwise. + (ranlib_touch): Likewise. + (main): Use return value from ranlib functions as exit value. + * objcopy.c (add_specific_symbol): Set status to 1 if get_file_size + fails. + (copy_file): Likewise. + (strip_main): Likewise. + (copy_main): Likewise. + * objdump.c (display_file): Set exit_status to 1 if get_file_size + fails. + * size.c (display_file): Set return_code to 1 if get_file_size + fails. + +2006-08-02 Thiemo Seufer + Nigel Stephens + + * readelf.c (dump_relocations): Handle MIPS-specific + SHN_MIPS_SCOMMON and SHN_MIPS_SUNDEFINED. + (get_symbol_index_type): Similarly. + +2006-07-24 Ralk Wildenhues + + * doc/binutils.texinfo: Fix spelling mistakes. + +2006-07-10 Jakub Jelinek + + * readelf.c (get_dynamic_type): Handle DT_GNU_HASH. + (get_section_type_name): Handle SHT_GNU_HASH. + (dynamic_info_DT_GNU_HASH): New variable. + (process_dynamic_section): Handle DT_GNU_HASH. + (process_symbol_table): Print also DT_GNU_HASH histogram. + +2006-07-06 Mohammed Adnène Trojette + + PR binutils/2879 + * doc/binutils.texi (Strings): Document -T shorthand for --target + switch. + * strings.c: Update comment to include -T option. + + PR binutils/2875 + * doc/binutils.texi (readelf): Fix spelling typo. + +2006-06-30 Nick Clifton + + * dwarf.c (display_debug_frames): Catch a corrupt length field + generating an end of block address that is beyond the end of the + section. + When encountering a corrupt CIE pointer do not reset the start + pointer as more data still has to be read. + Do not warn about user defined call frame instructions. + +2006-06-29 DJ Delorie + + * readelf.c (process_section_headers): Add H8/300 support. + +2006-06-23 Richard Sandiford + + * objcopy.c (localize_hidden): New variable. + (OPTION_LOCALIZE_HIDDEN): New command_line_switch value. + (copy_options): Add --localize-hidden. + (copy_usage): Mention --localize-hidden. + (is_hidden_symbol): New function. + (filter_symbols): Handle localize_hidden. + (copy_object): Call filter_symbols if localize_hidden. + (copy_main): Handle OPTION_LOCALIZE_HIDDEN. + * doc/binutils.texi (--localize-hidden): Document new option. + +2006-06-23 Daniel Jacobowitz + + * Makefile.am (ar_DEPENDENCIES, ranlib_DEPENDENCIES) + (dlltool_DEPENDENCIES, windres_DEPENDENCIES): Remove @LEXLIB@. + * Makefile.in: Regenerate. + +2006-06-23 Alan Modra + + * Makefile.am (*_DEPENDENCIES): Add missing dependencies. + * Makefile.in: Regenerate. + +2006-06-07 Joseph S. Myers + + * po/Make-in (pdf, ps): New dummy targets. + +2006-06-05 Daniel Jacobowitz + + * po/Make-in (top_builddir): Define. + +2006-06-05 Alan Modra + + * config.in: Regenerate. + +2006-06-02 Joseph S. Myers + + * doc/Makefile.am (TEXI2DVI): Define. + * doc/Makefile.in: Regenerate. + +2006-05-31 Daniel Jacobowitz + + * Makefile.am: Replace INTLLIBS with LIBINTL everywhere. Add + DEPENDENCIES variables for every program. + (INTLLIBS): Remove. + (INCLUDES): Use @INCINTL@. + * acinclude.m4: Include new gettext macros. + * configure.in: Use ZW_GNU_GETTEXT_SISTER_DIR and AM_PO_SUBDIRS. + Remove local code for po/Makefile. + * Makefile.in, configure, doc/Makefile.in: Regenerated. + +2006-05-30 Nick Clifton + + * po/es.po: Updated Spanish translation. + +2006-05-25 J"orn Rennecke + + * MAINTAINERS: Update my email address. + +2006-05-24 Nick Clifton + + * po/fr.po: Updated French translation. + +2006-05-23 Nick Clifton + + * po/vi.po: Updated Vietnamese translation. + +2006-05-22 Daniel Jacobowitz + + * po/ru.po: Updated translation. + +2006-05-19 Andreas Schwab + + * doc/Makefile.am (addr2line.1): Depend on $(binutils_TEXINFOS). + (ar.1): Likewise. + (dlltool.1): Likewise. + (nlmconv.1): Likewise. + (nm.1): Likewise. + (objcopy.1): Likewise. + (objdump.1): Likewise. + (ranlib.1): Likewise. + (readelf.1): Likewise. + (size.1): Likewise. + (strings.1): Likewise. + (strip.1): Likewise. + (windres.1): Likewise. + (cxxfilt.man): Likewise. + * doc/Makefile.in: Regenerated. + +2006-05-17 Carlos O'Donell + + * doc/binutils.texi: Use "Binutils Index" for index name. + +2006-05-15 H.J. Lu + + * dwarf.c (display_debug_frames): Don't return on ZERO + terminator. + +2006-05-02 Daniel Jacobowitz + + * doc/Makefile.am (AM_MAKEINFOFLAGS): New. + (TEXI2POD): Use AM_MAKEINFOFLAGS. + (config.texi): Don't set top_srcdir. + * doc/binutils.texi: Don't use top_srcdir. + * aclocal.m4, Makefile.in, doc/Makefile.in: Regenerated. + +2006-04-26 Julian Brown + + * readelf.c (arm_attr_tag_VFP_arch): Add VFPv3. + +2006-04-19 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2006-04-19 Alan Modra + + * configure: Regenerate. + +2006-04-18 Nick Clifton + + PR 2257 + * readelf.c (SECTION_NAME): Cope with a missing string table. + (process_file_header): Cope with a corrupt e_shstrndx field. + (process_section_headers): Correctly handle an e_shstrndx value of + SHF_UNDEF. + +2006-04-12 Nick Clifton + + * objdump.c (objdump_symbol_at_address): Fix typo in comment. + +2006-04-10 Ben Elliston + + * MAINTAINERS (CGEN Maintainers): Remove myself. + +2006-04-06 Carlos O'Donell + + * po/Make-in: Add install-html target. + * Makefile.am: Add install-html and install-html-recursive targets. + * Makefile.in: Regenerate. + * configure.in: AC_SUBST datarootdir, docdir and htmldir. + * configure: Regenerate. + * doc/Makefile.am: Add install-html and install-html-am targets. + * doc/Makefile.in: Regenerate. + +2006-04-05 Eric Botcazou + + * addr2line.c (long_options): Add new option 'section'. + (usage): Document new -j/--section option. + (find_offset_in_section): New function. + (translate_addresses): Add 'section' parameter. + If it is non-null, call find_offset_in_section on it. + (process_file): Add 'section_name' parameter. + If it is non-null, look for the section in the BFD object. + Pass the section to translate_addresses. + (main): Handle new -j option. + Pass the section name to process_file. + * doc/binutils.texi (addr2line): Document new -j/--section option. + +2006-03-29 Ben Elliston + + * resbin.c: Avoid duplicating constants in calls to reswr_alloc. + +2006-03-20 Nathan Sidwell + + * BRANCHES: Remove binutils-csl-arm-2006q1-branch. Document + binutils-csl-2_17-branch instead. + +2006-03-20 Paul Brook + + * BRANCHES: Mention binutils-csl-arm-2006q1-branch. + +2006-03-16 Alan Modra + + PR 2434 + * ieee.c (write_ieee_debugging_info): Adjust bfd_hash_table_init calls. + * wrstabs.c (write_stabs_in_sections_debugging_info): Likewise. + +2006-03-13 Ben Elliston + + * bucomm.c (display_target_list): Make local variable `a' to be of + type enum bfd_architecture. Thus no need to cast enums to int. + (display_info_table): Likewise. + +2006-03-10 Paul Brook + + * readelf.c (decode_ARM_machine_flags): Handle EABIv5. + +2006-03-10 Alan Modra + + * dwarf.c (process_extended_line_op): Remove pointer_size param. + Use length instead to determine address size. + (get_pointer_size_and_offset_of_comp_unit): Delete. + (display_debug_lines): Adjust for above. + (display_debug_aranges): Don't stop on finding two zeros. + (display_debug_frames): For warning, print offset not pointer. + +2006-03-09 Danny Smith + + * dlltool.c: Update copyright year. + * doc/binutils.texi: Likewise. + +2006-03-09 Danny Smith + + * dlltool.c (add_stdcall_underscore): New flag. + (xlate): Also add underscore to stdcall symbol if + add_stdcall_underscore set. + (usage): Document --add-stdcall-underscore option. + (OPTION_ADD_STDCALL_UNDERSCORE): New define. + (long_options): Use it for --add-stdcall-underscore option. + (main): Handle it. + * doc/binutils.texi: Document --add-stdcall-underscore option + and differentiate from --add-underscore. + +2006-03-06 Nathan Sidwell + + * readelf.c (get_machine_flags): Adjust. + +2006-03-03 Jakub Jelinek + + * dwarf.c (frame_display_row, display_debug_frames): Handle + DW_CFA_val_offset, DW_CFA_val_offset_sf and DW_CFA_val_expression. + +2006-02-28 Nick Clifton + + * objcopy.c (use_alt_mach_code): Change type to unsigned long. + (copy_object): If bfd_alt_mach_code fails emit a more helpful + message and if the target architecture is ELF use the alternative + as replacement value for the e_machine number. + (copy_main): Use strtoul to parse the number provided with the + --alt-mach-code switch. + * doc/binutils.texi (--alt-mach-code): Document that this switch + can now set the absolute e_machine value. + +2006-02-27 Carlos O'Donell + + * po/Make-in: Add html target. + +2006-02-17 Nick Hudson + + * readelf.c (get_machine_flags): Add logic for missing EF_SH flags. + +2006-02-14 Jakub Jelinek + + * config.in: Rebuilt. + +2006-02-10 H.J. Lu + + PR binutils/2258 + * readelf.c (process_program_headers): Use + ELF_IS_SECTION_IN_SEGMENT_MEMORY. + +2006-02-09 Eric Botcazou + + * configure.in (CHECK_DECLS): Add snprintf and vsnprintf. + * configure: Regenerate. + * objdump.c (fprintf): Remove declaration. + * bucomm.h (fprintf): Declare if not already declared. + (snprintf): Likewise. + (vsnprintf): Likewise. + +2006-02-08 H.J. Lu + + * readelf.c (process_program_headers): Match PT_TLS segment + only with SHT_TLS sections. + +2006-02-07 Nathan Sidwell + + * readelf.c (get_machine_flags): Add logic for EF_M68K flags. + +2006-02-02 H.J. Lu + + * readelf.c (process_program_headers): Undo the last change. + +2006-02-02 H.J. Lu + + * readelf.c (process_program_headers): Undo the change made on + 2004-09-22. Match PT_DYNAMIC segment only with SHT_DYNAMIC + sections. + +2006-01-30 Nick Clifton + + * objcopy.c (copy_object): Catch the case where an attempt is made + to add a section that already exists and produce a more helpful + warning message. + +2006-01-26 Nick Clifton + + * po/vi.po: New Vietnamese translation. + * configure.in (ALL_LINGUAS): Add vi. + * configure: Regenerate. + +2006-01-18 Alexandre Oliva + + Introduce TLS descriptors for i386 and x86_64. + * readelf.c (get_dynamic_type): Handle DT_TLSDESC_GOT and + DT_TLSDESC_PLT. + +2006-01-18 Nick Clifton + + PR binutils/1391 + * objcopy.c (copy_object): For PE format targets set the VMA of a + newly created gnu_debuglink section to a non-zero, aligned, + contiguous value. + * Makefile.am (objcopy.c): Add a dependency upon libbfd.h. + * Makefile.in: Regenerate. + +2006-01-17 Andreas Schwab + + PR binutils/1486 + * configure.in: Don't define DISASSEMBLER_NEEDS_RELOCS. + * configure: Regenerate. + * objdump.c (struct objdump_disasm_info): Don't check for + DISASSEMBLER_NEEDS_RELOCS. + (objdump_print_addr): Likewise. + (disassemble_bytes): Check disassembler_needs_relocs from + disassemble_info at run-time instead of DISASSEMBLER_NEEDS_RELOCS + at compile-time. + (disassemble_section): Likewise. + (disassemble_data): Initialize it. + +2006-01-11 Alan Modra + + * objcopy.c (copy_object): Fix thinko. + + * objcopy.c (copy_object): Set isympp and osympp to NULL after free. + +2006-01-09 Mike Frysinger : + + * readelf.c (guess_is_rela): Add case for Nios/Nios II. + (get_machine_name): Likewise. + +For older changes see ChangeLog-2005 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/binutils/MAINTAINERS b/binutils/MAINTAINERS index f5beb0343b4..a3fdce30605 100644 --- a/binutils/MAINTAINERS +++ b/binutils/MAINTAINERS @@ -5,7 +5,7 @@ of the GNU Binary Utilities project. This includes the linker (ld), the assembler (gas), the profiler (gprof), a whole suite of other programs (binutils) and the libraries that they use (bfd and opcodes). This project shares a common set of header files with the -GCC and GDB projects (include), so maintainership of those files is +GCC and GDB projects (include), so maintainership of those files is shared amoungst the projects. The home page for binutils is: @@ -14,8 +14,8 @@ The home page for binutils is: and patches should be sent to: - bug-binutils@gnu.org or binutils@sources.redhat.com - + binutils@sourceware.org + with "[Patch]" as part of the subject line. Note - patches to the top level config.guess and config.sub scripts should be sent to: @@ -25,13 +25,13 @@ and not to the binutils lists. Patches to the other top level configure files (configure, configure.in, config-ml.in) should be sent to the binutils lists, and copied to the gcc and gdb lists as well (gcc-patches@gcc.gnu.org and -gdb-patches@sources.redhat.com). +gdb-patches@sourceware.org). --------- Blanket Write Privs --------- The following people have permission to check patches into the repository without obtaining approval first: - + Nick Clifton (head maintainer) Richard Henderson Ian Lance Taylor @@ -58,7 +58,7 @@ responsibility among the other maintainers. ALPHA Richard Henderson ARM Nick Clifton ARM Richard Earnshaw - ARM (Symbian) Paul Brook + ARM Paul Brook ARM (Symbian) Mark Mitchell AVR Denis Chertykov AVR Marek Michalkiewicz @@ -73,7 +73,7 @@ responsibility among the other maintainers. FR30 Dave Brolley FRV Dave Brolley FRV Alexandre Oliva - H8300 Anil Paranjpe + H8300 Anil Paranjpe HPPA Dave Anglin HPPA elf32 Alan Modra HPPA elf64 Jeff Law [Basic maintainance only] @@ -83,33 +83,36 @@ responsibility among the other maintainers. ix86 Alan Modra ix86 PE Christopher Faylor ix86 COFF DJ Delorie - ix86 H.J.Lu + ix86 H.J. Lu ix86 INTEL MODE Jan Beulich M68HC11 M68HC12 Stephane Carrez M68k Ben Elliston M88k Mark Kettenis MAXQ Inderpreet Singh + MEP Dave Brolley MIPS Eric Christopher MIPS Thiemo Seufer MMIX Hans-Peter Nilsson MN10300 Eric Christopher MN10300 Alexandre Oliva MSP430 Dmitry Diky + NetBSD support Matt Thomas PPC Geoff Keating + PPC Alan Modra PPC vector ext Aldy Hernandez s390, s390x Martin Schwidefsky - SH Jrn Rennecke + SCORE Mei Ligang SH Alexandre Oliva SH Kaz Kojima SPARC Jakub Jelinek TESTSUITES Ben Elliston TIC4X Svein Seldal TIC54X Timothy Wall - VAX Jason R Thorpe + VAX Matt Thomas VAX Jan-Benedict Glaw x86_64 Jan Hubicka x86_64 Andreas Jaeger - x86_64 H.J.Lu + x86_64 H.J. Lu Xtensa Bob Wilson z80 Arnold Metselaar z8k Christian Groessler @@ -121,11 +124,11 @@ CGEN is a tool for building, amongst other things, assemblers, disassemblers and simulators from a single description of a CPU. It creates files in several of the binutils directories, but it is mentioned here since there is a single group that maintains -CGEN and the files that it creates. +CGEN and the files that it creates. If you have CGEN related problems you can send email to; - cgen@sources.redhat.com + cgen@sourceware.org The current CGEN maintainers are: @@ -158,7 +161,7 @@ If a patch is approved for check in to the mainline sources, it can also be checked into the current release branch. Normally however only bug fixes should be applied to the branch. New features, new ports, etc, should be restricted to the mainline. (Otherwise the -burden of maintaining the branch in sync with the mainline becomes too +burden of maintaining the branch in sync with the mainline becomes too great). If you are uncertain as to whether a patch is appropriate for the branch, ask the branch maintainer. This is: @@ -194,7 +197,7 @@ to contributions on a branch. Before creating the branch, you should select a name for the branch of the form: - binutils-- + binutils-- where "org" is the initials of your organization, or your own initials if you are acting as an individual. For example, for a branch created @@ -238,7 +241,7 @@ Having selected the branch name, create the branch as follows: 3. Create the branch: cvs rtag -b -r binutils---branchpoint \ - binutils---branch + binutils---branch 4. Document the branch: diff --git a/binutils/Makefile.am b/binutils/Makefile.am index 1b4e85adb8a..34c03ce6831 100644 --- a/binutils/Makefile.am +++ b/binutils/Makefile.am @@ -1,9 +1,7 @@ ## Process this file with automake to generate Makefile.in -## FIXME: Work around apparent bug in automake. -INTLLIBS = @INTLLIBS@ - AUTOMAKE_OPTIONS = cygnus dejagnu +ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd SUBDIRS = doc po @@ -22,6 +20,7 @@ LEX = `if [ -f ../flex/flex ]; then echo ../flex/flex; else echo @LEX@; fi` WARN_CFLAGS = @WARN_CFLAGS@ NO_WERROR = @NO_WERROR@ AM_CFLAGS = $(WARN_CFLAGS) +LIBICONV = @LIBICONV@ # these two are almost the same program AR_PROG=ar @@ -49,22 +48,22 @@ ADDR2LINE_PROG=addr2line NLMCONV_PROG=nlmconv DLLTOOL_PROG=dlltool WINDRES_PROG=windres +WINDMC_PROG=windmc DLLWRAP_PROG=dllwrap -SRCONV_PROG=srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT) +SRCONV_PROG=srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT) -PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRINGS_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_MISC@ - -bin_PROGRAMS = $(SIZE_PROG) $(OBJDUMP_PROG) $(AR_PROG) $(STRINGS_PROG) $(RANLIB_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_MISC@ +bin_PROGRAMS = $(SIZE_PROG) $(OBJDUMP_PROG) $(AR_PROG) $(STRINGS_PROG) $(RANLIB_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ @BUILD_WINDMC@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_INSTALL_MISC@ ## We need a special rule to install the programs which are built with ## -new, and to rename cxxfilt to c++filt. -noinst_PROGRAMS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG) +RENAMED_PROGS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG) +noinst_PROGRAMS = $(RENAMED_PROGS) @BUILD_MISC@ -EXTRA_PROGRAMS = $(NLMCONV_PROG) srconv sysdump coffdump $(DLLTOOL_PROG) $(WINDRES_PROG) $(DLLWRAP_PROG) +EXTRA_PROGRAMS = $(NLMCONV_PROG) srconv sysdump coffdump $(DLLTOOL_PROG) $(WINDRES_PROG) $(WINDMC_PROG) $(DLLWRAP_PROG) # Stuff that goes in tooldir/ if appropriate. -TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump +TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump objcopy BASEDIR = $(srcdir)/.. BFDDIR = $(BASEDIR)/bfd @@ -75,33 +74,35 @@ MKDEP = gcc -MM INCLUDES = -D_GNU_SOURCE \ -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) \ @HDEFINES@ \ - -I$(srcdir)/../intl -I../intl \ + @INCINTL@ \ -DLOCALEDIR="\"$(datadir)/locale\"" \ -Dbin_dummy_emulation=$(EMULATION_VECTOR) HFILES = \ - arsup.h binemul.h bucomm.h budbg.h budemang.h \ + arsup.h binemul.h bucomm.h budbg.h \ coffgrok.h debug.h dlltool.h nlmconv.h \ - windres.h winduni.h + windres.h winduni.h windint.h \ + windmc.h -GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h +GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h mcparse.h CFILES = \ - addr2line.c ar.c arsup.c binemul.c bucomm.c budemang.c \ + addr2line.c ar.c arsup.c bin2c.c binemul.c bucomm.c \ coffdump.c coffgrok.c cxxfilt.c \ dwarf.c debug.c dlltool.c dllwrap.c \ emul_aix.c emul_vanilla.c filemode.c \ ieee.c is-ranlib.c is-strip.c maybe-ranlib.c maybe-strip.c \ nlmconv.c nm.c not-ranlib.c not-strip.c \ objcopy.c objdump.c prdbg.c \ - rdcoff.c rddbg.c readelf.c rename.c \ + rclex.c rdcoff.c rddbg.c readelf.c rename.c \ resbin.c rescoff.c resrc.c resres.c \ size.c srconv.c stabs.c strings.c sysdump.c version.c \ - windres.c winduni.c wrstabs.c + windres.c winduni.c wrstabs.c \ + windmc.c mclex.c GENERATED_CFILES = \ arparse.c arlex.c sysroff.c sysinfo.c syslex.c \ - defparse.c deflex.c nlmheader.c rcparse.c rclex.c + defparse.c deflex.c nlmheader.c rcparse.c mcparse.c DEBUG_SRCS = rddbg.c debug.c stabs.c ieee.c rdcoff.c WRITE_DEBUG_SRCS = $(DEBUG_SRCS) wrstabs.c @@ -117,8 +118,8 @@ LIBIBERTY = ../libiberty/libiberty.a .PHONY: install-html install-html-am install-html-recursive -install-html: install-html-recursive - +install-html: install-html-recursive + install-html-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ @@ -182,7 +183,30 @@ check-DEJAGNU: site.exp installcheck: /bin/sh $(srcdir)/sanity.sh $(bindir) -LDADD = $(BFDLIB) $(LIBIBERTY) $(INTLLIBS) +# There's no global DEPENDENCIES. So, we must explicitly list everything +# which depends on libintl, since we don't know whether LIBINTL_DEP will be +# non-empty until configure time. Ugh! +size_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +objdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) $(OPCODES) +nm_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +ar_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +strings_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +strip_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +ranlib_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +cxxfilt_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +objcopy_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +nlmconv_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +srconv_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +sysdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +coffdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +dlltool_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +windres_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +windmc_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +addr2line_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +readelf_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) +dllwrap_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) + +LDADD = $(BFDLIB) $(LIBIBERTY) $(LIBINTL) size_SOURCES = size.c $(BULIBS) @@ -191,14 +215,14 @@ objcopy_SOURCES = objcopy.c not-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS) strings_SOURCES = strings.c $(BULIBS) readelf_SOURCES = readelf.c version.c unwind-ia64.c dwarf.c -readelf_LDADD = $(INTLLIBS) $(LIBIBERTY) +readelf_LDADD = $(LIBINTL) $(LIBIBERTY) strip_new_SOURCES = objcopy.c is-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS) -nm_new_SOURCES = nm.c budemang.c $(BULIBS) +nm_new_SOURCES = nm.c $(BULIBS) -objdump_SOURCES = objdump.c dwarf.c budemang.c prdbg.c $(DEBUG_SRCS) $(BULIBS) -objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(INTLLIBS) +objdump_SOURCES = objdump.c dwarf.c prdbg.c $(DEBUG_SRCS) $(BULIBS) +objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL) objdump.o:objdump.c $(COMPILE) -c $(OBJDUMP_DEFS) $(srcdir)/objdump.c @@ -207,13 +231,13 @@ cxxfilt_SOURCES = cxxfilt.c $(BULIBS) ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c rename.c binemul.c \ emul_$(EMULATION).c $(BULIBS) -ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) +ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) ranlib_SOURCES = ar.c is-ranlib.c arparse.y arlex.l arsup.c rename.c \ binemul.c emul_$(EMULATION).c $(BULIBS) -ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) +ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) -addr2line_SOURCES = addr2line.c budemang.c $(BULIBS) +addr2line_SOURCES = addr2line.c $(BULIBS) # The following is commented out for the conversion to automake. # This rule creates a single binary that switches between ar and ranlib @@ -233,7 +257,7 @@ addr2line_SOURCES = addr2line.c budemang.c $(BULIBS) # -rm -f $(STRIP_PROG) # -ln $(OBJCOPY_PROG) $(STRIP_PROG) -sysroff.c: sysinfo$(EXEEXT_FOR_BUILD) sysroff.info +sysroff.c: sysinfo$(EXEEXT_FOR_BUILD) sysroff.info ./sysinfo$(EXEEXT_FOR_BUILD) -c <$(srcdir)/sysroff.info >sysroff.c ./sysinfo$(EXEEXT_FOR_BUILD) -i <$(srcdir)/sysroff.info >>sysroff.c ./sysinfo$(EXEEXT_FOR_BUILD) -g <$(srcdir)/sysroff.info >>sysroff.c @@ -258,15 +282,23 @@ sysinfo.o: $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) $(srcdir)/sysinfo.c -Wno-error ; \ fi +bin2c$(EXEEXT_FOR_BUILD): + $(CC_FOR_BUILD) -o $@ $(INCLUDES) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) $(srcdir)/bin2c.c $(srcdir)/version.c + +embedspu: embedspu.sh + sed "s@^program_transform_name=@program_transform_name=$(program_transform_name)@" < $< > $@ + chmod a+x $@ + # We need these for parallel make. arparse.h: arparse.c defparse.h: defparse.c nlmheader.h: nlmheader.c rcparse.h: rcparse.c +mcparse.h: mcparse.c sysinfo.h: sysinfo.c # Disable -Werror, if it has been enabled, since old versions of bison/ -# yacc will produce working code which contain compile time warnings. +# yacc will produce working code which contain compile time warnings. arparse.o: $(COMPILE) -c $< $(NO_WERROR) arlex.o: @@ -281,13 +313,17 @@ nlmheader.o: $(COMPILE) -c $< $(NO_WERROR) rcparse.o: $(COMPILE) -c $< $(NO_WERROR) +mcparse.o: + $(COMPILE) -c $< $(NO_WERROR) rclex.o: $(COMPILE) -c $< $(NO_WERROR) +mclex.o: + $(COMPILE) -c $< $(NO_WERROR) srconv_SOURCES = srconv.c coffgrok.c $(BULIBS) dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS) -dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) +dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) dlltool.o: $(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/dlltool.c @@ -307,22 +343,26 @@ nlmconv.o: nlmconv.c $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h nlmconv_SOURCES = nlmconv.c nlmheader.y $(BULIBS) -windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.l \ +windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.c \ winduni.c resres.c $(BULIBS) -windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) +windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) $(LIBICONV) + +windmc_SOURCES = windmc.c mcparse.y mclex.c \ + winduni.c $(BULIBS) +windmc_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) $(LIBICONV) dllwrap_SOURCES = dllwrap.c version.c -dllwrap_LDADD = $(LIBIBERTY) $(INTLLIBS) +dllwrap_LDADD = $(LIBIBERTY) $(LIBINTL) EXTRA_DIST = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \ - syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c + syslex.c deflex.c defparse.h defparse.c rcparse.h rcparse.c \ + mcparse.h mcparse.c diststuff: $(EXTRA_DIST) info all: info -DISTCLEANFILES = sysinfo sysroff.c sysroff.h \ - site.exp site.bak +DISTCLEANFILES = sysroff.c sysroff.h site.exp site.bak # Targets to rebuild dependencies in this Makefile. # Have to get rid of DEP1 here so that "$?" later includes all of $(CFILES). @@ -371,7 +411,8 @@ dep-am: DEP ### -MOSTLYCLEANFILES = sysinfo binutils.log binutils.sum abcdefgh* +MOSTLYCLEANFILES = sysinfo$(EXEEXT_FOR_BUILD) bin2c$(EXEEXT_FOR_BUILD) \ + binutils.log binutils.sum abcdefgh* mostlyclean-local: -rm -rf tmpdir @@ -380,10 +421,10 @@ CLEANFILES = dep.sed DEP DEPA DEP1 DEP2 .PHONY: install-exec-local install-exec-local: install-binPROGRAMS $(bin_PROGRAMS) $(noinst_PROGRAMS) - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ - $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + @list='$(RENAMED_PROGS)'; for p in $$list; do \ + if test -f $$p$(EXEEXT); then \ + echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p$(EXEEXT) $(bindir)/`echo $$p|sed -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p$(EXEEXT) $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ else :; fi; \ done $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin @@ -404,208 +445,250 @@ install-exec-local: install-binPROGRAMS $(bin_PROGRAMS) $(noinst_PROGRAMS) # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -addr2line.o: addr2line.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/getopt.h $(INCDIR)/libiberty.h \ - $(INCDIR)/demangle.h bucomm.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h budemang.h -ar.o: ar.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ - $(INCDIR)/libiberty.h $(INCDIR)/progress.h bucomm.h \ - config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/aout/ar.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h \ - arsup.h $(INCDIR)/filenames.h binemul.h -arsup.o: arsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h arsup.h $(INCDIR)/libiberty.h bucomm.h \ - config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/filenames.h -binemul.o: binemul.c binemul.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h -bucomm.o: bucomm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h ../bfd/bfdver.h $(INCDIR)/libiberty.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/filenames.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h -budemang.o: budemang.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/demangle.h \ - budemang.h -coffdump.o: coffdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h coffgrok.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h -coffgrok.o: coffgrok.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h coffgrok.h -cxxfilt.o: cxxfilt.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h $(INCDIR)/demangle.h $(INCDIR)/safe-ctype.h -dwarf.o: dwarf.c dwarf.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/elf/dwarf2.h bucomm.h \ - config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h -debug.o: debug.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h -dlltool.o: dlltool.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/demangle.h \ - $(INCDIR)/dyn-string.h dlltool.h $(INCDIR)/safe-ctype.h -dllwrap.o: dllwrap.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/dyn-string.h -emul_aix.o: emul_aix.c binemul.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/xcoff.h $(BFDDIR)/libcoff.h $(BFDDIR)/libxcoff.h -emul_vanilla.o: emul_vanilla.c binemul.h ../bfd/bfd.h \ - $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h -filemode.o: filemode.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h -ieee.o: ieee.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ - $(INCDIR)/ieee.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h \ - budbg.h $(INCDIR)/filenames.h +addr2line.o: addr2line.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \ + bucomm.h +ar.o: ar.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/progress.h $(INCDIR)/aout/ar.h $(BFDDIR)/libbfd.h \ + $(INCDIR)/hashtab.h bucomm.h arsup.h $(INCDIR)/filenames.h \ + binemul.h +arsup.o: arsup.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/filenames.h bucomm.h arsup.h +bin2c.o: bin2c.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h +binemul.o: binemul.c binemul.h sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h +bucomm.o: bucomm.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/filenames.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h \ + bucomm.h +coffdump.o: coffdump.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h bucomm.h coffgrok.h +coffgrok.o: coffgrok.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h bucomm.h coffgrok.h +cxxfilt.o: cxxfilt.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \ + $(INCDIR)/safe-ctype.h bucomm.h +dwarf.o: dwarf.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/elf/dwarf2.h \ + dwarf.h +debug.o: debug.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + debug.h +dlltool.o: dlltool.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \ + $(INCDIR)/dyn-string.h bucomm.h dlltool.h $(INCDIR)/safe-ctype.h +dllwrap.o: dllwrap.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/dyn-string.h bucomm.h +emul_aix.o: emul_aix.c binemul.h sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(BFDDIR)/libxcoff.h +emul_vanilla.o: emul_vanilla.c binemul.h sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h +filemode.o: filemode.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h +ieee.o: ieee.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/ieee.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h debug.h budbg.h $(INCDIR)/filenames.h is-ranlib.o: is-ranlib.c is-strip.o: is-strip.c maybe-ranlib.o: maybe-ranlib.c maybe-strip.o: maybe-strip.c -nlmconv.o: nlmconv.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h \ - $(BFDDIR)/libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ - $(INCDIR)/nlm/external.h nlmconv.h -nm.o: nm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ - $(INCDIR)/progress.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h budemang.h $(INCDIR)/aout/stab_gnu.h \ +nlmconv.o: nlmconv.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h $(BFDDIR)/libnlm.h \ + $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h \ + nlmconv.h bucomm.h +nm.o: nm.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/progress.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ranlib.h $(INCDIR)/demangle.h \ - $(INCDIR)/libiberty.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h + $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/common.h \ + bucomm.h not-ranlib.o: not-ranlib.c not-strip.o: not-strip.c -objcopy.o: objcopy.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/progress.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ +objcopy.o: objcopy.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/progress.h \ + $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h bucomm.h \ budbg.h $(INCDIR)/filenames.h $(INCDIR)/fnmatch.h $(BFDDIR)/elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(BFDDIR)/libbfd.h -objdump.o: objdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h ../bfd/bfdver.h $(INCDIR)/progress.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - dwarf.h $(INCDIR)/elf/dwarf2.h budemang.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/dis-asm.h $(INCDIR)/libiberty.h $(INCDIR)/demangle.h \ - debug.h budbg.h $(INCDIR)/aout/aout64.h -prdbg.o: prdbg.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h \ + $(INCDIR)/bfdlink.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h +objdump.o: objdump.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/progress.h \ + bucomm.h dwarf.h $(INCDIR)/safe-ctype.h $(INCDIR)/dis-asm.h \ + ../bfd/bfd.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/demangle.h $(INCDIR)/libiberty.h debug.h \ + budbg.h $(INCDIR)/aout/aout64.h +prdbg.o: prdbg.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/demangle.h $(INCDIR)/libiberty.h debug.h \ budbg.h -rdcoff.o: rdcoff.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h bucomm.h \ - config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h debug.h budbg.h $(BFDDIR)/libcoff.h \ +rclex.o: rclex.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/safe-ctype.h windres.h $(INCDIR)/ansidecl.h \ + winduni.h windint.h rcparse.h +rdcoff.o: rdcoff.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h bucomm.h debug.h budbg.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h -rddbg.o: rddbg.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h \ - budbg.h -readelf.o: readelf.c dwarf.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/alpha.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/arm.h \ - $(INCDIR)/elf/avr.h $(INCDIR)/elf/bfin.h $(INCDIR)/elf/cris.h \ +rddbg.o: rddbg.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + bucomm.h debug.h budbg.h +readelf.o: readelf.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h dwarf.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/elf/alpha.h \ + $(INCDIR)/elf/arc.h $(INCDIR)/elf/arm.h $(INCDIR)/elf/avr.h \ + $(INCDIR)/elf/bfin.h $(INCDIR)/elf/cris.h $(INCDIR)/elf/crx.h \ $(INCDIR)/elf/d10v.h $(INCDIR)/elf/d30v.h $(INCDIR)/elf/dlx.h \ - $(INCDIR)/elf/fr30.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/h8.h \ - $(INCDIR)/elf/hppa.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/i370.h \ - $(INCDIR)/elf/i860.h $(INCDIR)/elf/i960.h $(INCDIR)/elf/ia64.h \ - $(INCDIR)/elf/ip2k.h $(INCDIR)/elf/m32c.h $(INCDIR)/elf/m32r.h \ + $(INCDIR)/elf/fr30.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/hppa.h \ + $(INCDIR)/elf/i386.h $(INCDIR)/elf/i370.h $(INCDIR)/elf/i860.h \ + $(INCDIR)/elf/i960.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/ip2k.h \ + $(INCDIR)/elf/iq2000.h $(INCDIR)/elf/m32c.h $(INCDIR)/elf/m32r.h \ $(INCDIR)/elf/m68k.h $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/mcore.h \ - $(INCDIR)/elf/mips.h $(INCDIR)/elf/mmix.h $(INCDIR)/elf/mn10200.h \ - $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/mt.h $(INCDIR)/elf/msp430.h \ - $(INCDIR)/elf/or32.h $(INCDIR)/elf/pj.h $(INCDIR)/elf/ppc.h \ - $(INCDIR)/elf/ppc64.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/sparc.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/vax.h \ - $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/xstormy16.h $(INCDIR)/elf/crx.h \ - $(INCDIR)/elf/iq2000.h $(INCDIR)/elf/xtensa.h $(INCDIR)/aout/ar.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h unwind-ia64.h -rename.o: rename.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h -resbin.o: resbin.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ - winduni.h -rescoff.o: rescoff.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ - winduni.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -resrc.o: resrc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ - windres.h winduni.h -resres.o: resres.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ - winduni.h -size.o: size.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h -srconv.o: srconv.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h sysroff.h coffgrok.h $(INCDIR)/libiberty.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - sysroff.c -stabs.o: stabs.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/demangle.h debug.h budbg.h $(INCDIR)/filenames.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def -strings.o: strings.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/getopt.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ - $(INCDIR)/safe-ctype.h -sysdump.o: sysdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h $(INCDIR)/libiberty.h \ - sysroff.h sysroff.c -version.o: version.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h ../bfd/bfdver.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h -windres.o: windres.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ - windres.h winduni.h -winduni.o: winduni.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h winduni.h $(INCDIR)/safe-ctype.h -wrstabs.o: wrstabs.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/elf/mep.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/mmix.h \ + $(INCDIR)/elf/mn10200.h $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/mt.h \ + $(INCDIR)/elf/msp430.h $(INCDIR)/elf/or32.h $(INCDIR)/elf/pj.h \ + $(INCDIR)/elf/ppc.h $(INCDIR)/elf/ppc64.h $(INCDIR)/elf/s390.h \ + $(INCDIR)/elf/score.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/sparc.h \ + $(INCDIR)/elf/spu.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/vax.h \ + $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/xstormy16.h $(INCDIR)/elf/xtensa.h \ + $(INCDIR)/aout/ar.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + unwind-ia64.h +rename.o: rename.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h +resbin.o: resbin.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + windres.h winduni.h windint.h +rescoff.o: rescoff.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h windres.h winduni.h windint.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +resrc.o: resrc.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/safe-ctype.h windres.h winduni.h windint.h +resres.o: resres.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + windres.h winduni.h windint.h +size.o: size.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + bucomm.h +srconv.o: srconv.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h sysroff.h coffgrok.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h sysroff.c +stabs.o: stabs.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \ + debug.h budbg.h $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def +strings.o: strings.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h bucomm.h +sysdump.o: sysdump.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h bucomm.h \ + sysroff.h sysroff.c $(INCDIR)/ansidecl.h +version.o: version.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h +windres.o: windres.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ + windres.h winduni.h windint.h +winduni.o: winduni.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h bucomm.h winduni.h $(INCDIR)/safe-ctype.h +wrstabs.o: wrstabs.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h bucomm.h \ debug.h budbg.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def -arparse.o: arparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h arsup.h +windmc.o: windmc.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h windmc.h \ + winduni.h windint.h +mclex.o: mclex.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/safe-ctype.h windmc.h winduni.h mcparse.h +arparse.o: arparse.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h arsup.h arlex.o: arlex.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ - arparse.h + $(INCDIR)/ansidecl.h arparse.h sysroff.o: sysroff.c sysinfo.o: sysinfo.c syslex.o: syslex.c config.h sysinfo.h -defparse.o: defparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h dlltool.h +defparse.o: defparse.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h dlltool.h deflex.o: deflex.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ - defparse.h dlltool.h -nlmheader.o: nlmheader.c $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h \ - ../bfd/bfd.h $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ + defparse.h dlltool.h $(INCDIR)/ansidecl.h +nlmheader.o: nlmheader.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h \ + ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ + $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h bucomm.h \ nlmconv.h -rcparse.o: rcparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ - winduni.h $(INCDIR)/safe-ctype.h -rclex.o: rclex.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ - windres.h winduni.h rcparse.h +rcparse.o: rcparse.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h windres.h winduni.h windint.h \ + $(INCDIR)/safe-ctype.h +mcparse.o: mcparse.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h windmc.h winduni.h $(INCDIR)/safe-ctype.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/binutils/Makefile.in b/binutils/Makefile.in index 8b5ab820548..9cf28fdc779 100644 --- a/binutils/Makefile.in +++ b/binutils/Makefile.in @@ -37,30 +37,40 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -bin_PROGRAMS = $(am__EXEEXT_5) $(am__EXEEXT_6) $(am__EXEEXT_7) \ - $(am__EXEEXT_8) $(am__EXEEXT_9) $(am__EXEEXT_10) \ +bin_PROGRAMS = $(am__EXEEXT_6) $(am__EXEEXT_7) $(am__EXEEXT_8) \ + $(am__EXEEXT_9) $(am__EXEEXT_10) $(am__EXEEXT_11) \ @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ \ - $(am__EXEEXT_11) $(am__EXEEXT_12) @BUILD_DLLWRAP@ @BUILD_MISC@ -noinst_PROGRAMS = $(am__EXEEXT_13) $(am__EXEEXT_14) $(am__EXEEXT_15) + @BUILD_WINDMC@ $(am__EXEEXT_12) $(am__EXEEXT_13) \ + @BUILD_DLLWRAP@ @BUILD_INSTALL_MISC@ $(am__empty) +noinst_PROGRAMS = $(am__EXEEXT_17) @BUILD_MISC@ EXTRA_PROGRAMS = $(am__EXEEXT_1) srconv$(EXEEXT) sysdump$(EXEEXT) \ coffdump$(EXEEXT) $(am__EXEEXT_2) $(am__EXEEXT_3) \ - $(am__EXEEXT_4) + $(am__EXEEXT_4) $(am__EXEEXT_5) DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub NEWS \ README ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(srcdir)/config.in $(srcdir)/../mkinstalldirs \ $(top_srcdir)/po/Make-in arparse.h arparse.c arlex.c \ defparse.h defparse.c deflex.c nlmheader.h nlmheader.c \ - arparse.h arparse.c arlex.c rcparse.h rcparse.c rclex.c \ - $(srcdir)/../ylwrap $(srcdir)/../ltmain.sh \ + arparse.h arparse.c arlex.c mcparse.h mcparse.c rcparse.h \ + rcparse.c $(srcdir)/../ylwrap $(srcdir)/../ltmain.sh \ $(srcdir)/../config.guess $(srcdir)/../config.sub subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/../bfd/acinclude.m4 \ - $(top_srcdir)/../config/acx.m4 $(top_srcdir)/../bfd/bfd.m4 \ - $(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/../gettext.m4 $(top_srcdir)/configure.in +am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \ + $(top_srcdir)/../bfd/warning.m4 \ + $(top_srcdir)/../config/depstand.m4 \ + $(top_srcdir)/../config/gettext-sister.m4 \ + $(top_srcdir)/../config/iconv.m4 \ + $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/lib-ld.m4 \ + $(top_srcdir)/../config/lib-link.m4 \ + $(top_srcdir)/../config/lib-prefix.m4 \ + $(top_srcdir)/../config/nls.m4 $(top_srcdir)/../config/po.m4 \ + $(top_srcdir)/../config/progtest.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -71,67 +81,53 @@ CONFIG_CLEAN_FILES = po/Makefile.in am__EXEEXT_1 = nlmconv$(EXEEXT) am__EXEEXT_2 = dlltool$(EXEEXT) am__EXEEXT_3 = windres$(EXEEXT) -am__EXEEXT_4 = dllwrap$(EXEEXT) -am__EXEEXT_5 = size$(EXEEXT) -am__EXEEXT_6 = objdump$(EXEEXT) -am__EXEEXT_7 = ar$(EXEEXT) -am__EXEEXT_8 = strings$(EXEEXT) -am__EXEEXT_9 = ranlib$(EXEEXT) -am__EXEEXT_10 = objcopy$(EXEEXT) -am__EXEEXT_11 = addr2line$(EXEEXT) -am__EXEEXT_12 = readelf$(EXEEXT) +am__EXEEXT_4 = windmc$(EXEEXT) +am__EXEEXT_5 = dllwrap$(EXEEXT) +am__EXEEXT_6 = size$(EXEEXT) +am__EXEEXT_7 = objdump$(EXEEXT) +am__EXEEXT_8 = ar$(EXEEXT) +am__EXEEXT_9 = strings$(EXEEXT) +am__EXEEXT_10 = ranlib$(EXEEXT) +am__EXEEXT_11 = objcopy$(EXEEXT) +am__EXEEXT_12 = addr2line$(EXEEXT) +am__EXEEXT_13 = readelf$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -am__EXEEXT_13 = nm-new$(EXEEXT) -am__EXEEXT_14 = strip-new$(EXEEXT) -am__EXEEXT_15 = cxxfilt$(EXEEXT) +am__EXEEXT_14 = nm-new$(EXEEXT) +am__EXEEXT_15 = strip-new$(EXEEXT) +am__EXEEXT_16 = cxxfilt$(EXEEXT) +am__EXEEXT_17 = $(am__EXEEXT_14) $(am__EXEEXT_15) $(am__EXEEXT_16) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am__objects_1 = bucomm.$(OBJEXT) version.$(OBJEXT) filemode.$(OBJEXT) -am_addr2line_OBJECTS = addr2line.$(OBJEXT) budemang.$(OBJEXT) \ - $(am__objects_1) +am_addr2line_OBJECTS = addr2line.$(OBJEXT) $(am__objects_1) addr2line_OBJECTS = $(am_addr2line_OBJECTS) addr2line_LDADD = $(LDADD) am__DEPENDENCIES_1 = ../bfd/libbfd.la am__DEPENDENCIES_2 = ../libiberty/libiberty.a am__DEPENDENCIES_3 = -addr2line_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am_ar_OBJECTS = arparse.$(OBJEXT) arlex.$(OBJEXT) ar.$(OBJEXT) \ not-ranlib.$(OBJEXT) arsup.$(OBJEXT) rename.$(OBJEXT) \ binemul.$(OBJEXT) emul_$(EMULATION).$(OBJEXT) $(am__objects_1) ar_OBJECTS = $(am_ar_OBJECTS) -ar_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am_coffdump_OBJECTS = coffdump.$(OBJEXT) coffgrok.$(OBJEXT) \ $(am__objects_1) coffdump_OBJECTS = $(am_coffdump_OBJECTS) coffdump_LDADD = $(LDADD) -coffdump_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am_cxxfilt_OBJECTS = cxxfilt.$(OBJEXT) $(am__objects_1) cxxfilt_OBJECTS = $(am_cxxfilt_OBJECTS) cxxfilt_LDADD = $(LDADD) -cxxfilt_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am_dlltool_OBJECTS = dlltool.$(OBJEXT) defparse.$(OBJEXT) \ deflex.$(OBJEXT) $(am__objects_1) dlltool_OBJECTS = $(am_dlltool_OBJECTS) -dlltool_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am_dllwrap_OBJECTS = dllwrap.$(OBJEXT) version.$(OBJEXT) dllwrap_OBJECTS = $(am_dllwrap_OBJECTS) -dllwrap_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) am_nlmconv_OBJECTS = nlmconv.$(OBJEXT) nlmheader.$(OBJEXT) \ $(am__objects_1) nlmconv_OBJECTS = $(am_nlmconv_OBJECTS) nlmconv_LDADD = $(LDADD) -nlmconv_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) -am_nm_new_OBJECTS = nm.$(OBJEXT) budemang.$(OBJEXT) $(am__objects_1) +am_nm_new_OBJECTS = nm.$(OBJEXT) $(am__objects_1) nm_new_OBJECTS = $(am_nm_new_OBJECTS) nm_new_LDADD = $(LDADD) -nm_new_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am__objects_2 = rddbg.$(OBJEXT) debug.$(OBJEXT) stabs.$(OBJEXT) \ ieee.$(OBJEXT) rdcoff.$(OBJEXT) am__objects_3 = $(am__objects_2) wrstabs.$(OBJEXT) @@ -139,69 +135,52 @@ am_objcopy_OBJECTS = objcopy.$(OBJEXT) not-strip.$(OBJEXT) \ rename.$(OBJEXT) $(am__objects_3) $(am__objects_1) objcopy_OBJECTS = $(am_objcopy_OBJECTS) objcopy_LDADD = $(LDADD) -objcopy_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) -am_objdump_OBJECTS = objdump.$(OBJEXT) dwarf.$(OBJEXT) \ - budemang.$(OBJEXT) prdbg.$(OBJEXT) $(am__objects_2) \ - $(am__objects_1) +am_objdump_OBJECTS = objdump.$(OBJEXT) dwarf.$(OBJEXT) prdbg.$(OBJEXT) \ + $(am__objects_2) $(am__objects_1) objdump_OBJECTS = $(am_objdump_OBJECTS) am__DEPENDENCIES_4 = ../opcodes/libopcodes.la -objdump_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) am_ranlib_OBJECTS = ar.$(OBJEXT) is-ranlib.$(OBJEXT) arparse.$(OBJEXT) \ arlex.$(OBJEXT) arsup.$(OBJEXT) rename.$(OBJEXT) \ binemul.$(OBJEXT) emul_$(EMULATION).$(OBJEXT) $(am__objects_1) ranlib_OBJECTS = $(am_ranlib_OBJECTS) -ranlib_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am_readelf_OBJECTS = readelf.$(OBJEXT) version.$(OBJEXT) \ unwind-ia64.$(OBJEXT) dwarf.$(OBJEXT) readelf_OBJECTS = $(am_readelf_OBJECTS) -readelf_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_2) am_size_OBJECTS = size.$(OBJEXT) $(am__objects_1) size_OBJECTS = $(am_size_OBJECTS) size_LDADD = $(LDADD) -size_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am_srconv_OBJECTS = srconv.$(OBJEXT) coffgrok.$(OBJEXT) \ $(am__objects_1) srconv_OBJECTS = $(am_srconv_OBJECTS) srconv_LDADD = $(LDADD) -srconv_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am_strings_OBJECTS = strings.$(OBJEXT) $(am__objects_1) strings_OBJECTS = $(am_strings_OBJECTS) strings_LDADD = $(LDADD) -strings_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am_strip_new_OBJECTS = objcopy.$(OBJEXT) is-strip.$(OBJEXT) \ rename.$(OBJEXT) $(am__objects_3) $(am__objects_1) strip_new_OBJECTS = $(am_strip_new_OBJECTS) strip_new_LDADD = $(LDADD) -strip_new_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) am_sysdump_OBJECTS = sysdump.$(OBJEXT) $(am__objects_1) sysdump_OBJECTS = $(am_sysdump_OBJECTS) sysdump_LDADD = $(LDADD) -sysdump_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) +am_windmc_OBJECTS = windmc.$(OBJEXT) mcparse.$(OBJEXT) mclex.$(OBJEXT) \ + winduni.$(OBJEXT) $(am__objects_1) +windmc_OBJECTS = $(am_windmc_OBJECTS) am_windres_OBJECTS = windres.$(OBJEXT) resrc.$(OBJEXT) \ rescoff.$(OBJEXT) resbin.$(OBJEXT) rcparse.$(OBJEXT) \ rclex.$(OBJEXT) winduni.$(OBJEXT) resres.$(OBJEXT) \ $(am__objects_1) windres_OBJECTS = $(am_windres_OBJECTS) -windres_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_3) DEFAULT_INCLUDES = -I. -I$(srcdir) -I. depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) LTLEXCOMPILE = $(LIBTOOL) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS) @@ -214,7 +193,8 @@ SOURCES = $(addr2line_SOURCES) $(ar_SOURCES) $(coffdump_SOURCES) \ $(nlmconv_SOURCES) $(nm_new_SOURCES) $(objcopy_SOURCES) \ $(objdump_SOURCES) $(ranlib_SOURCES) $(readelf_SOURCES) \ $(size_SOURCES) $(srconv_SOURCES) $(strings_SOURCES) \ - $(strip_new_SOURCES) $(sysdump_SOURCES) $(windres_SOURCES) + $(strip_new_SOURCES) $(sysdump_SOURCES) $(windmc_SOURCES) \ + $(windres_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ @@ -238,9 +218,11 @@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_DLLTOOL = @BUILD_DLLTOOL@ BUILD_DLLWRAP = @BUILD_DLLWRAP@ +BUILD_INSTALL_MISC = @BUILD_INSTALL_MISC@ BUILD_MISC = @BUILD_MISC@ BUILD_NLMCONV = @BUILD_NLMCONV@ BUILD_SRCONV = @BUILD_SRCONV@ +BUILD_WINDMC = @BUILD_WINDMC@ BUILD_WINDRES = @BUILD_WINDRES@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ @@ -256,6 +238,7 @@ DEFS = @DEFS@ DEMANGLER_NAME = @DEMANGLER_NAME@ DEPDIR = @DEPDIR@ DLLTOOL_DEFS = @DLLTOOL_DEFS@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ @@ -264,28 +247,32 @@ EMULATION = @EMULATION@ EMULATION_VECTOR = @EMULATION_VECTOR@ EXEEXT = @EXEEXT@ EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@ -GMOFILES = @GMOFILES@ +FGREP = @FGREP@ +GENCAT = @GENCAT@ +GENINSRC_NEVER_FALSE = @GENINSRC_NEVER_FALSE@ +GENINSRC_NEVER_TRUE = @GENINSRC_NEVER_TRUE@ GMSGFMT = @GMSGFMT@ -GT_NO = @GT_NO@ -GT_YES = @GT_YES@ +GREP = @GREP@ HDEFINES = @HDEFINES@ -INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +INCINTL = @INCINTL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ -INTLDEPS = @INTLDEPS@ -INTLLIBS = @INTLLIBS@ -INTLOBJS = @INTLOBJS@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = `if [ -f ../flex/flex ]; then echo ../flex/flex; else echo @LEX@; fi` LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBINTL_DEP = @LIBINTL_DEP@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ @@ -293,7 +280,9 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ NLMCONV_DEFS = @NLMCONV_DEFS@ +NM = @NM@ NO_WERROR = @NO_WERROR@ OBJDUMP_DEFS = @OBJDUMP_DEFS@ OBJEXT = @OBJEXT@ @@ -304,19 +293,20 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ -USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ XGETTEXT = @XGETTEXT@ YACC = `if [ -f ../bison/bison ]; then echo ../bison/bison -y -L$(srcdir)/../bison/; else echo @YACC@; fi` +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ @@ -345,10 +335,10 @@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -l = @l@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -363,6 +353,7 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ AUTOMAKE_OPTIONS = cygnus dejagnu +ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd SUBDIRS = doc po tooldir = $(exec_prefix)/$(target_alias) YFLAGS = -d @@ -390,12 +381,13 @@ ADDR2LINE_PROG = addr2line NLMCONV_PROG = nlmconv DLLTOOL_PROG = dlltool WINDRES_PROG = windres +WINDMC_PROG = windmc DLLWRAP_PROG = dllwrap -SRCONV_PROG = srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT) -PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRINGS_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_MISC@ +SRCONV_PROG = srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT) +RENAMED_PROGS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG) # Stuff that goes in tooldir/ if appropriate. -TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump +TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump objcopy BASEDIR = $(srcdir)/.. BFDDIR = $(BASEDIR)/bfd INCDIR = $(BASEDIR)/include @@ -403,32 +395,34 @@ MKDEP = gcc -MM INCLUDES = -D_GNU_SOURCE \ -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) \ @HDEFINES@ \ - -I$(srcdir)/../intl -I../intl \ + @INCINTL@ \ -DLOCALEDIR="\"$(datadir)/locale\"" \ -Dbin_dummy_emulation=$(EMULATION_VECTOR) HFILES = \ - arsup.h binemul.h bucomm.h budbg.h budemang.h \ + arsup.h binemul.h bucomm.h budbg.h \ coffgrok.h debug.h dlltool.h nlmconv.h \ - windres.h winduni.h + windres.h winduni.h windint.h \ + windmc.h -GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h +GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h mcparse.h CFILES = \ - addr2line.c ar.c arsup.c binemul.c bucomm.c budemang.c \ + addr2line.c ar.c arsup.c bin2c.c binemul.c bucomm.c \ coffdump.c coffgrok.c cxxfilt.c \ dwarf.c debug.c dlltool.c dllwrap.c \ emul_aix.c emul_vanilla.c filemode.c \ ieee.c is-ranlib.c is-strip.c maybe-ranlib.c maybe-strip.c \ nlmconv.c nm.c not-ranlib.c not-strip.c \ objcopy.c objdump.c prdbg.c \ - rdcoff.c rddbg.c readelf.c rename.c \ + rclex.c rdcoff.c rddbg.c readelf.c rename.c \ resbin.c rescoff.c resrc.c resres.c \ size.c srconv.c stabs.c strings.c sysdump.c version.c \ - windres.c winduni.c wrstabs.c + windres.c winduni.c wrstabs.c \ + windmc.c mclex.c GENERATED_CFILES = \ arparse.c arlex.c sysroff.c sysinfo.c syslex.c \ - defparse.c deflex.c nlmheader.c rcparse.c rclex.c + defparse.c deflex.c nlmheader.c rcparse.c mcparse.c DEBUG_SRCS = rddbg.c debug.c stabs.c ieee.c rdcoff.c WRITE_DEBUG_SRCS = $(DEBUG_SRCS) wrstabs.c @@ -456,47 +450,75 @@ CC_FOR_TARGET = ` \ fi; \ fi` -LDADD = $(BFDLIB) $(LIBIBERTY) $(INTLLIBS) + +# There's no global DEPENDENCIES. So, we must explicitly list everything +# which depends on libintl, since we don't know whether LIBINTL_DEP will be +# non-empty until configure time. Ugh! +size_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +objdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) $(OPCODES) +nm_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +ar_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +strings_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +strip_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +ranlib_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +cxxfilt_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +objcopy_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +nlmconv_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +srconv_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +sysdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +coffdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +dlltool_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +windres_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +windmc_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +addr2line_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +readelf_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) +dllwrap_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) +LDADD = $(BFDLIB) $(LIBIBERTY) $(LIBINTL) size_SOURCES = size.c $(BULIBS) objcopy_SOURCES = objcopy.c not-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS) strings_SOURCES = strings.c $(BULIBS) readelf_SOURCES = readelf.c version.c unwind-ia64.c dwarf.c -readelf_LDADD = $(INTLLIBS) $(LIBIBERTY) +readelf_LDADD = $(LIBINTL) $(LIBIBERTY) strip_new_SOURCES = objcopy.c is-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS) -nm_new_SOURCES = nm.c budemang.c $(BULIBS) -objdump_SOURCES = objdump.c dwarf.c budemang.c prdbg.c $(DEBUG_SRCS) $(BULIBS) -objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(INTLLIBS) +nm_new_SOURCES = nm.c $(BULIBS) +objdump_SOURCES = objdump.c dwarf.c prdbg.c $(DEBUG_SRCS) $(BULIBS) +objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL) cxxfilt_SOURCES = cxxfilt.c $(BULIBS) ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c rename.c binemul.c \ emul_$(EMULATION).c $(BULIBS) -ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) +ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) ranlib_SOURCES = ar.c is-ranlib.c arparse.y arlex.l arsup.c rename.c \ binemul.c emul_$(EMULATION).c $(BULIBS) -ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) -addr2line_SOURCES = addr2line.c budemang.c $(BULIBS) +ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) +addr2line_SOURCES = addr2line.c $(BULIBS) srconv_SOURCES = srconv.c coffgrok.c $(BULIBS) dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS) -dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) +dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) coffdump_SOURCES = coffdump.c coffgrok.c $(BULIBS) sysdump_SOURCES = sysdump.c $(BULIBS) nlmconv_SOURCES = nlmconv.c nlmheader.y $(BULIBS) -windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.l \ +windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.c \ winduni.c resres.c $(BULIBS) -windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) +windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) $(LIBICONV) +windmc_SOURCES = windmc.c mcparse.y mclex.c \ + winduni.c $(BULIBS) + +windmc_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) $(LIBICONV) dllwrap_SOURCES = dllwrap.c version.c -dllwrap_LDADD = $(LIBIBERTY) $(INTLLIBS) +dllwrap_LDADD = $(LIBIBERTY) $(LIBINTL) EXTRA_DIST = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \ - syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c - -DISTCLEANFILES = sysinfo sysroff.c sysroff.h \ - site.exp site.bak + syslex.c deflex.c defparse.h defparse.c rcparse.h rcparse.c \ + mcparse.h mcparse.c +DISTCLEANFILES = sysroff.c sysroff.h site.exp site.bak ### -MOSTLYCLEANFILES = sysinfo binutils.log binutils.sum abcdefgh* +MOSTLYCLEANFILES = sysinfo$(EXEEXT_FOR_BUILD) bin2c$(EXEEXT_FOR_BUILD) \ + binutils.log binutils.sum abcdefgh* + CLEANFILES = dep.sed DEP DEPA DEP1 DEP2 all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -509,15 +531,15 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ - cd $(srcdir) && $(AUTOMAKE) --foreign \ + echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus '; \ + cd $(srcdir) && $(AUTOMAKE) --cygnus \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile + $(AUTOMAKE) --cygnus Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -641,6 +663,9 @@ strip-new$(EXEEXT): $(strip_new_OBJECTS) $(strip_new_DEPENDENCIES) sysdump$(EXEEXT): $(sysdump_OBJECTS) $(sysdump_DEPENDENCIES) @rm -f sysdump$(EXEEXT) $(LINK) $(sysdump_LDFLAGS) $(sysdump_OBJECTS) $(sysdump_LDADD) $(LIBS) +windmc$(EXEEXT): $(windmc_OBJECTS) $(windmc_DEPENDENCIES) + @rm -f windmc$(EXEEXT) + $(LINK) $(windmc_LDFLAGS) $(windmc_OBJECTS) $(windmc_LDADD) $(LIBS) windres$(EXEEXT): $(windres_OBJECTS) $(windres_DEPENDENCIES) @rm -f windres$(EXEEXT) $(LINK) $(windres_LDFLAGS) $(windres_OBJECTS) $(windres_LDADD) $(LIBS) @@ -872,9 +897,10 @@ maintainer-clean-generic: -rm -f deflex.c -rm -f defparse.c -rm -f defparse.h + -rm -f mcparse.c + -rm -f mcparse.h -rm -f nlmheader.c -rm -f nlmheader.h - -rm -f rclex.c -rm -f rcparse.c -rm -f rcparse.h clean: clean-recursive @@ -951,7 +977,7 @@ uninstall-info: uninstall-info-recursive .PHONY: install-html install-html-am install-html-recursive -install-html: install-html-recursive +install-html: install-html-recursive install-html-recursive: @failcom='exit 1'; \ @@ -1017,7 +1043,7 @@ objdump.o:objdump.c # -rm -f $(STRIP_PROG) # -ln $(OBJCOPY_PROG) $(STRIP_PROG) -sysroff.c: sysinfo$(EXEEXT_FOR_BUILD) sysroff.info +sysroff.c: sysinfo$(EXEEXT_FOR_BUILD) sysroff.info ./sysinfo$(EXEEXT_FOR_BUILD) -c <$(srcdir)/sysroff.info >sysroff.c ./sysinfo$(EXEEXT_FOR_BUILD) -i <$(srcdir)/sysroff.info >>sysroff.c ./sysinfo$(EXEEXT_FOR_BUILD) -g <$(srcdir)/sysroff.info >>sysroff.c @@ -1042,15 +1068,23 @@ sysinfo.o: $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) $(srcdir)/sysinfo.c -Wno-error ; \ fi +bin2c$(EXEEXT_FOR_BUILD): + $(CC_FOR_BUILD) -o $@ $(INCLUDES) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) $(srcdir)/bin2c.c $(srcdir)/version.c + +embedspu: embedspu.sh + sed "s@^program_transform_name=@program_transform_name=$(program_transform_name)@" < $< > $@ + chmod a+x $@ + # We need these for parallel make. arparse.h: arparse.c defparse.h: defparse.c nlmheader.h: nlmheader.c rcparse.h: rcparse.c +mcparse.h: mcparse.c sysinfo.h: sysinfo.c # Disable -Werror, if it has been enabled, since old versions of bison/ -# yacc will produce working code which contain compile time warnings. +# yacc will produce working code which contain compile time warnings. arparse.o: $(COMPILE) -c $< $(NO_WERROR) arlex.o: @@ -1065,8 +1099,12 @@ nlmheader.o: $(COMPILE) -c $< $(NO_WERROR) rcparse.o: $(COMPILE) -c $< $(NO_WERROR) +mcparse.o: + $(COMPILE) -c $< $(NO_WERROR) rclex.o: $(COMPILE) -c $< $(NO_WERROR) +mclex.o: + $(COMPILE) -c $< $(NO_WERROR) dlltool.o: $(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/dlltool.c @@ -1133,10 +1171,10 @@ mostlyclean-local: .PHONY: install-exec-local install-exec-local: install-binPROGRAMS $(bin_PROGRAMS) $(noinst_PROGRAMS) - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ - $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + @list='$(RENAMED_PROGS)'; for p in $$list; do \ + if test -f $$p$(EXEEXT); then \ + echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p$(EXEEXT) $(bindir)/`echo $$p|sed -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p$(EXEEXT) $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ else :; fi; \ done $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin @@ -1157,210 +1195,252 @@ install-exec-local: install-binPROGRAMS $(bin_PROGRAMS) $(noinst_PROGRAMS) # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -addr2line.o: addr2line.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/getopt.h $(INCDIR)/libiberty.h \ - $(INCDIR)/demangle.h bucomm.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h budemang.h -ar.o: ar.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ - $(INCDIR)/libiberty.h $(INCDIR)/progress.h bucomm.h \ - config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/aout/ar.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h \ - arsup.h $(INCDIR)/filenames.h binemul.h -arsup.o: arsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h arsup.h $(INCDIR)/libiberty.h bucomm.h \ - config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/filenames.h -binemul.o: binemul.c binemul.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h -bucomm.o: bucomm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h ../bfd/bfdver.h $(INCDIR)/libiberty.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/filenames.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h -budemang.o: budemang.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/demangle.h \ - budemang.h -coffdump.o: coffdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h coffgrok.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h -coffgrok.o: coffgrok.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h coffgrok.h -cxxfilt.o: cxxfilt.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h $(INCDIR)/demangle.h $(INCDIR)/safe-ctype.h -dwarf.o: dwarf.c dwarf.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/elf/dwarf2.h bucomm.h \ - config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h -debug.o: debug.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h -dlltool.o: dlltool.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/demangle.h \ - $(INCDIR)/dyn-string.h dlltool.h $(INCDIR)/safe-ctype.h -dllwrap.o: dllwrap.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/dyn-string.h -emul_aix.o: emul_aix.c binemul.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/xcoff.h $(BFDDIR)/libcoff.h $(BFDDIR)/libxcoff.h -emul_vanilla.o: emul_vanilla.c binemul.h ../bfd/bfd.h \ - $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h -filemode.o: filemode.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h -ieee.o: ieee.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ - $(INCDIR)/ieee.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h \ - budbg.h $(INCDIR)/filenames.h +addr2line.o: addr2line.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \ + bucomm.h +ar.o: ar.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/progress.h $(INCDIR)/aout/ar.h $(BFDDIR)/libbfd.h \ + $(INCDIR)/hashtab.h bucomm.h arsup.h $(INCDIR)/filenames.h \ + binemul.h +arsup.o: arsup.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/filenames.h bucomm.h arsup.h +bin2c.o: bin2c.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h +binemul.o: binemul.c binemul.h sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h +bucomm.o: bucomm.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/filenames.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h \ + bucomm.h +coffdump.o: coffdump.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h bucomm.h coffgrok.h +coffgrok.o: coffgrok.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h bucomm.h coffgrok.h +cxxfilt.o: cxxfilt.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \ + $(INCDIR)/safe-ctype.h bucomm.h +dwarf.o: dwarf.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/elf/dwarf2.h \ + dwarf.h +debug.o: debug.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + debug.h +dlltool.o: dlltool.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \ + $(INCDIR)/dyn-string.h bucomm.h dlltool.h $(INCDIR)/safe-ctype.h +dllwrap.o: dllwrap.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/dyn-string.h bucomm.h +emul_aix.o: emul_aix.c binemul.h sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(BFDDIR)/libxcoff.h +emul_vanilla.o: emul_vanilla.c binemul.h sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h +filemode.o: filemode.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h +ieee.o: ieee.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/ieee.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h debug.h budbg.h $(INCDIR)/filenames.h is-ranlib.o: is-ranlib.c is-strip.o: is-strip.c maybe-ranlib.o: maybe-ranlib.c maybe-strip.o: maybe-strip.c -nlmconv.o: nlmconv.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h \ - $(BFDDIR)/libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ - $(INCDIR)/nlm/external.h nlmconv.h -nm.o: nm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ - $(INCDIR)/progress.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h budemang.h $(INCDIR)/aout/stab_gnu.h \ +nlmconv.o: nlmconv.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h $(BFDDIR)/libnlm.h \ + $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h \ + nlmconv.h bucomm.h +nm.o: nm.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/progress.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ranlib.h $(INCDIR)/demangle.h \ - $(INCDIR)/libiberty.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h + $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/common.h \ + bucomm.h not-ranlib.o: not-ranlib.c not-strip.o: not-strip.c -objcopy.o: objcopy.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/progress.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ +objcopy.o: objcopy.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/progress.h \ + $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h bucomm.h \ budbg.h $(INCDIR)/filenames.h $(INCDIR)/fnmatch.h $(BFDDIR)/elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(BFDDIR)/libbfd.h -objdump.o: objdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h ../bfd/bfdver.h $(INCDIR)/progress.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - dwarf.h $(INCDIR)/elf/dwarf2.h budemang.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/dis-asm.h $(INCDIR)/libiberty.h $(INCDIR)/demangle.h \ - debug.h budbg.h $(INCDIR)/aout/aout64.h -prdbg.o: prdbg.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h \ + $(INCDIR)/bfdlink.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h +objdump.o: objdump.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/progress.h \ + bucomm.h dwarf.h $(INCDIR)/safe-ctype.h $(INCDIR)/dis-asm.h \ + ../bfd/bfd.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/demangle.h $(INCDIR)/libiberty.h debug.h \ + budbg.h $(INCDIR)/aout/aout64.h +prdbg.o: prdbg.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/demangle.h $(INCDIR)/libiberty.h debug.h \ budbg.h -rdcoff.o: rdcoff.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h bucomm.h \ - config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h debug.h budbg.h $(BFDDIR)/libcoff.h \ +rclex.o: rclex.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/safe-ctype.h windres.h $(INCDIR)/ansidecl.h \ + winduni.h windint.h rcparse.h +rdcoff.o: rdcoff.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h bucomm.h debug.h budbg.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h -rddbg.o: rddbg.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h \ - budbg.h -readelf.o: readelf.c dwarf.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/alpha.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/arm.h \ - $(INCDIR)/elf/avr.h $(INCDIR)/elf/bfin.h $(INCDIR)/elf/cris.h \ +rddbg.o: rddbg.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + bucomm.h debug.h budbg.h +readelf.o: readelf.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h dwarf.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/elf/alpha.h \ + $(INCDIR)/elf/arc.h $(INCDIR)/elf/arm.h $(INCDIR)/elf/avr.h \ + $(INCDIR)/elf/bfin.h $(INCDIR)/elf/cris.h $(INCDIR)/elf/crx.h \ $(INCDIR)/elf/d10v.h $(INCDIR)/elf/d30v.h $(INCDIR)/elf/dlx.h \ - $(INCDIR)/elf/fr30.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/h8.h \ - $(INCDIR)/elf/hppa.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/i370.h \ - $(INCDIR)/elf/i860.h $(INCDIR)/elf/i960.h $(INCDIR)/elf/ia64.h \ - $(INCDIR)/elf/ip2k.h $(INCDIR)/elf/m32c.h $(INCDIR)/elf/m32r.h \ + $(INCDIR)/elf/fr30.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/hppa.h \ + $(INCDIR)/elf/i386.h $(INCDIR)/elf/i370.h $(INCDIR)/elf/i860.h \ + $(INCDIR)/elf/i960.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/ip2k.h \ + $(INCDIR)/elf/iq2000.h $(INCDIR)/elf/m32c.h $(INCDIR)/elf/m32r.h \ $(INCDIR)/elf/m68k.h $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/mcore.h \ - $(INCDIR)/elf/mips.h $(INCDIR)/elf/mmix.h $(INCDIR)/elf/mn10200.h \ - $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/mt.h $(INCDIR)/elf/msp430.h \ - $(INCDIR)/elf/or32.h $(INCDIR)/elf/pj.h $(INCDIR)/elf/ppc.h \ - $(INCDIR)/elf/ppc64.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/sparc.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/vax.h \ - $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/xstormy16.h $(INCDIR)/elf/crx.h \ - $(INCDIR)/elf/iq2000.h $(INCDIR)/elf/xtensa.h $(INCDIR)/aout/ar.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h unwind-ia64.h -rename.o: rename.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h -resbin.o: resbin.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ - winduni.h -rescoff.o: rescoff.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ - winduni.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -resrc.o: resrc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ - windres.h winduni.h -resres.o: resres.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ - winduni.h -size.o: size.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ - bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h -srconv.o: srconv.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h sysroff.h coffgrok.h $(INCDIR)/libiberty.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - sysroff.c -stabs.o: stabs.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/demangle.h debug.h budbg.h $(INCDIR)/filenames.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def -strings.o: strings.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/getopt.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ - $(INCDIR)/safe-ctype.h -sysdump.o: sysdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h $(INCDIR)/libiberty.h \ - sysroff.h sysroff.c -version.o: version.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h ../bfd/bfdver.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h -windres.o: windres.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ - windres.h winduni.h -winduni.o: winduni.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h winduni.h $(INCDIR)/safe-ctype.h -wrstabs.o: wrstabs.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/elf/mep.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/mmix.h \ + $(INCDIR)/elf/mn10200.h $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/mt.h \ + $(INCDIR)/elf/msp430.h $(INCDIR)/elf/or32.h $(INCDIR)/elf/pj.h \ + $(INCDIR)/elf/ppc.h $(INCDIR)/elf/ppc64.h $(INCDIR)/elf/s390.h \ + $(INCDIR)/elf/score.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/sparc.h \ + $(INCDIR)/elf/spu.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/vax.h \ + $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/xstormy16.h $(INCDIR)/elf/xtensa.h \ + $(INCDIR)/aout/ar.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + unwind-ia64.h +rename.o: rename.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h +resbin.o: resbin.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + windres.h winduni.h windint.h +rescoff.o: rescoff.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h windres.h winduni.h windint.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +resrc.o: resrc.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/safe-ctype.h windres.h winduni.h windint.h +resres.o: resres.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + windres.h winduni.h windint.h +size.o: size.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + bucomm.h +srconv.o: srconv.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h sysroff.h coffgrok.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h sysroff.c +stabs.o: stabs.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \ + debug.h budbg.h $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def +strings.o: strings.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h bucomm.h +sysdump.o: sysdump.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h bucomm.h \ + sysroff.h sysroff.c $(INCDIR)/ansidecl.h +version.o: version.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h +windres.o: windres.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ + windres.h winduni.h windint.h +winduni.o: winduni.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h bucomm.h winduni.h $(INCDIR)/safe-ctype.h +wrstabs.o: wrstabs.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h bucomm.h \ debug.h budbg.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def -arparse.o: arparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h arsup.h +windmc.o: windmc.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h windmc.h \ + winduni.h windint.h +mclex.o: mclex.c sysdep.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \ + config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/safe-ctype.h windmc.h winduni.h mcparse.h +arparse.o: arparse.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h arsup.h arlex.o: arlex.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ - arparse.h + $(INCDIR)/ansidecl.h arparse.h sysroff.o: sysroff.c sysinfo.o: sysinfo.c syslex.o: syslex.c config.h sysinfo.h -defparse.o: defparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h dlltool.h +defparse.o: defparse.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h dlltool.h deflex.o: deflex.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ - defparse.h dlltool.h -nlmheader.o: nlmheader.c $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h \ - ../bfd/bfd.h $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ + defparse.h dlltool.h $(INCDIR)/ansidecl.h +nlmheader.o: nlmheader.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h \ + ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ + $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h bucomm.h \ nlmconv.h -rcparse.o: rcparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h windres.h \ - winduni.h $(INCDIR)/safe-ctype.h -rclex.o: rclex.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ - windres.h winduni.h rcparse.h +rcparse.o: rcparse.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h windres.h winduni.h windint.h \ + $(INCDIR)/safe-ctype.h +mcparse.o: mcparse.c sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h windmc.h winduni.h $(INCDIR)/safe-ctype.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/binutils/NEWS b/binutils/NEWS index d12450e3892..ad6058f75b2 100644 --- a/binutils/NEWS +++ b/binutils/NEWS @@ -1,5 +1,20 @@ -*- text -*- +* A new tool "windmc" has been added for some targets. This is a message + compiler which attempts to be compatible with the MS version. + +* Add codepage support to the windres tool. It now supports many new + resource types (e.g. MANIFEST, TOOLBAR, etc). The output generation + for binary files is done now via bfd itself. The endianess problems + for different hosts are solved. Dumps of .res files can now be + re-compiled by windres without lossing resources or compilation errors. + Some problems on dialog resource translations are corrected. + +* Add --extract-symbol command line option to objcopy, which will + strip everything out of an ordinary object file or executable except + for its symbol table. Files containing just symbols can be useful + to some OSes. + * Add "-x NAME" to readelf in addition to "-x NUMBER". * Add -i and -t switches to cxxfilt. -i disables the display of implementation @@ -30,6 +45,9 @@ * Add "--globalize-symbol " and "--globalize-symbols " switches to objcopy to convert local symbols into global symbols. + +* gprof now allows input files to have histogram records for + several memory ranges, provided those ranges are disjoint. Changes in 2.16: diff --git a/binutils/acinclude.m4 b/binutils/acinclude.m4 deleted file mode 100644 index 71b09b9f6ac..00000000000 --- a/binutils/acinclude.m4 +++ /dev/null @@ -1 +0,0 @@ -sinclude(../bfd/acinclude.m4) diff --git a/binutils/aclocal.m4 b/binutils/aclocal.m4 index cd4267338b7..29676eafab9 100644 --- a/binutils/aclocal.m4 +++ b/binutils/aclocal.m4 @@ -480,27 +480,6 @@ AC_DEFUN([AM_PROG_INSTALL_SH], install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 # Free Software Foundation, Inc. # @@ -910,4 +889,19 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR -m4_include([acinclude.m4]) +m4_include([../bfd/acinclude.m4]) +m4_include([../bfd/warning.m4]) +m4_include([../config/depstand.m4]) +m4_include([../config/gettext-sister.m4]) +m4_include([../config/iconv.m4]) +m4_include([../config/lead-dot.m4]) +m4_include([../config/lib-ld.m4]) +m4_include([../config/lib-link.m4]) +m4_include([../config/lib-prefix.m4]) +m4_include([../config/nls.m4]) +m4_include([../config/po.m4]) +m4_include([../config/progtest.m4]) +m4_include([../libtool.m4]) +m4_include([../ltoptions.m4]) +m4_include([../ltsugar.m4]) +m4_include([../ltversion.m4]) diff --git a/binutils/addr2line.c b/binutils/addr2line.c index 7cd67bc0a1b..a7c365ae741 100644 --- a/binutils/addr2line.c +++ b/binutils/addr2line.c @@ -1,5 +1,5 @@ /* addr2line.c -- convert addresses to line number and function name - Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006 + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. Contributed by Ulrich Lauther @@ -29,15 +29,12 @@ both forms write results to stdout, the second form reads addresses to be converted from stdin. */ -#include "config.h" -#include - +#include "sysdep.h" #include "bfd.h" #include "getopt.h" #include "libiberty.h" #include "demangle.h" #include "bucomm.h" -#include "budemang.h" static bfd_boolean unwind_inlines; /* -i, unwind inlined functions. */ static bfd_boolean with_functions; /* -f, show function names. */ @@ -68,7 +65,6 @@ static void slurp_symtab (bfd *); static void find_address_in_section (bfd *, asection *, void *); static void find_offset_in_section (bfd *, asection *); static void translate_addresses (bfd *, asection *); -static void process_file (const char *, const char *, const char *); /* Print a usage message to STREAM and exit with STATUS. */ @@ -92,7 +88,7 @@ usage (FILE *stream, int status) \n")); list_supported_targets (program_name, stream); - if (status == 0) + if (REPORT_BUGS_TO[0] && status == 0) fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); } @@ -225,8 +221,9 @@ translate_addresses (bfd *abfd, asection *section) name = "??"; else if (do_demangle) { - alloc = demangle (abfd, name); - name = alloc; + alloc = bfd_demangle (abfd, name, DMGL_ANSI | DMGL_PARAMS); + if (alloc != NULL) + name = alloc; } printf ("%s\n", name); @@ -261,9 +258,9 @@ translate_addresses (bfd *abfd, asection *section) } } -/* Process a file. */ +/* Process a file. Returns an exit value for main(). */ -static void +static int process_file (const char *file_name, const char *section_name, const char *target) { @@ -272,7 +269,7 @@ process_file (const char *file_name, const char *section_name, char **matching; if (get_file_size (file_name) < 1) - return; + return 1; abfd = bfd_openr (file_name, target); if (abfd == NULL) @@ -312,6 +309,8 @@ process_file (const char *file_name, const char *section_name, } bfd_close (abfd); + + return 0; } int @@ -401,7 +400,5 @@ main (int argc, char **argv) addr = argv + optind; naddr = argc - optind; - process_file (file_name, section_name, target); - - return 0; + return process_file (file_name, section_name, target); } diff --git a/binutils/ar.c b/binutils/ar.c index fe1c6402222..8313df5bf39 100644 --- a/binutils/ar.c +++ b/binutils/ar.c @@ -1,6 +1,6 @@ /* ar.c - Archive modify and extract. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005 + 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -26,12 +26,13 @@ when name truncated. No way to specify pos_end. Error messages should be more consistent. */ +#include "sysdep.h" #include "bfd.h" #include "libiberty.h" #include "progress.h" -#include "bucomm.h" #include "aout/ar.h" #include "libbfd.h" +#include "bucomm.h" #include "arsup.h" #include "filenames.h" #include "binemul.h" @@ -68,8 +69,8 @@ static void replace_members (bfd *, char **files_to_replace, bfd_boolean quick); static void print_descr (bfd * abfd); static void write_archive (bfd *); -static void ranlib_only (const char *archname); -static void ranlib_touch (const char *archname); +static int ranlib_only (const char *archname); +static int ranlib_touch (const char *archname); static void usage (int); /** Globals and flags */ @@ -153,7 +154,7 @@ map_over_members (bfd *arch, void (*function)(bfd *), char **files, int count) if (count == 0) { - for (head = arch->next; head; head = head->next) + for (head = arch->archive_next; head; head = head->archive_next) { PROGRESS (1); function (head); @@ -172,7 +173,7 @@ map_over_members (bfd *arch, void (*function)(bfd *), char **files, int count) bfd_boolean found = FALSE; match_count = 0; - for (head = arch->next; head; head = head->next) + for (head = arch->archive_next; head; head = head->archive_next) { PROGRESS (1); if (head->filename == NULL) @@ -257,9 +258,9 @@ usage (int help) -V --version Print version information\n")); } - list_supported_targets (program_name, stderr); + list_supported_targets (program_name, s); - if (help) + if (REPORT_BUGS_TO[0] && help) fprintf (s, _("Report bugs to %s\n"), REPORT_BUGS_TO); xexit (help ? 0 : 1); @@ -420,6 +421,7 @@ main (int argc, char **argv) if (is_ranlib) { + int status = 0; bfd_boolean touch = FALSE; if (argc < 2 @@ -429,7 +431,7 @@ main (int argc, char **argv) usage (0); if (strcmp (argv[1], "-V") == 0 || strcmp (argv[1], "-v") == 0 - || strncmp (argv[1], "--v", 3) == 0) + || CONST_STRNEQ (argv[1], "--v")) print_version ("ranlib"); arg_index = 1; if (strcmp (argv[1], "-t") == 0) @@ -440,12 +442,12 @@ main (int argc, char **argv) while (arg_index < argc) { if (! touch) - ranlib_only (argv[arg_index]); + status |= ranlib_only (argv[arg_index]); else - ranlib_touch (argv[arg_index]); + status |= ranlib_touch (argv[arg_index]); ++arg_index; } - xexit (0); + xexit (status); } if (argc == 2 && strcmp (argv[1], "-M") == 0) @@ -597,10 +599,7 @@ main (int argc, char **argv) if ((operation == none || operation == print_table) && write_armap == 1) - { - ranlib_only (argv[arg_index]); - xexit (0); - } + xexit (ranlib_only (argv[arg_index])); if (operation == none) fatal (_("no operation specified")); @@ -760,7 +759,7 @@ open_inarch (const char *archive_filename, const char *file) xexit (1); } - last_one = &(arch->next); + last_one = &(arch->archive_next); /* Read all the contents right away, regardless. */ for (next_one = bfd_openr_next_archived_file (arch, NULL); next_one; @@ -768,7 +767,7 @@ open_inarch (const char *archive_filename, const char *file) { PROGRESS (1); *last_one = next_one; - last_one = &next_one->next; + last_one = &next_one->archive_next; } *last_one = (bfd *) NULL; if (bfd_get_error () != bfd_error_no_more_archived_files) @@ -779,10 +778,10 @@ open_inarch (const char *archive_filename, const char *file) static void print_contents (bfd *abfd) { - int ncopied = 0; + size_t ncopied = 0; char *cbuf = xmalloc (BUFSIZE); struct stat buf; - long size; + size_t size; if (bfd_stat_arch_elt (abfd, &buf) != 0) /* xgettext:c-format */ fatal (_("internal stat error on %s"), bfd_get_filename (abfd)); @@ -797,8 +796,8 @@ print_contents (bfd *abfd) while (ncopied < size) { - int nread; - int tocopy = size - ncopied; + size_t nread; + size_t tocopy = size - ncopied; if (tocopy > BUFSIZE) tocopy = BUFSIZE; @@ -807,7 +806,12 @@ print_contents (bfd *abfd) /* xgettext:c-format */ fatal (_("%s is not a valid archive"), bfd_get_filename (bfd_my_archive (abfd))); - fwrite (cbuf, 1, nread, stdout); + + /* fwrite in mingw32 may return int instead of size_t. Cast the + return value to size_t to avoid comparison between signed and + unsigned values. */ + if ((size_t) fwrite (cbuf, 1, nread, stdout) != nread) + fatal ("stdout: %s", strerror (errno)); ncopied += tocopy; } free (cbuf); @@ -828,9 +832,9 @@ extract_file (bfd *abfd) { FILE *ostream; char *cbuf = xmalloc (BUFSIZE); - int nread, tocopy; - long ncopied = 0; - long size; + size_t nread, tocopy; + size_t ncopied = 0; + size_t size; struct stat buf; if (bfd_stat_arch_elt (abfd, &buf) != 0) @@ -838,10 +842,6 @@ extract_file (bfd *abfd) fatal (_("internal stat error on %s"), bfd_get_filename (abfd)); size = buf.st_size; - if (size < 0) - /* xgettext:c-format */ - fatal (_("stat returns negative size for %s"), bfd_get_filename (abfd)); - if (verbose) printf ("x - %s\n", bfd_get_filename (abfd)); @@ -890,7 +890,12 @@ extract_file (bfd *abfd) output_file = ostream; } - fwrite (cbuf, 1, nread, ostream); + + /* fwrite in mingw32 may return int instead of size_t. Cast + the return value to size_t to avoid comparison between + signed and unsigned values. */ + if ((size_t) fwrite (cbuf, 1, nread, ostream) != nread) + fatal ("%s: %s", output_filename, strerror (errno)); ncopied += tocopy; } @@ -918,12 +923,15 @@ write_archive (bfd *iarch) { bfd *obfd; char *old_name, *new_name; - bfd *contents_head = iarch->next; + bfd *contents_head = iarch->archive_next; old_name = xmalloc (strlen (bfd_get_filename (iarch)) + 1); strcpy (old_name, bfd_get_filename (iarch)); new_name = make_tempname (old_name); + if (new_name == NULL) + bfd_fatal ("could not create temporary file whilst writing archive"); + output_filename = new_name; obfd = bfd_openw (new_name, bfd_get_target (iarch)); @@ -987,15 +995,15 @@ get_pos_bfd (bfd **contents, enum pos default_pos, const char *default_posname) if (realpos == pos_end) { while (*after_bfd) - after_bfd = &((*after_bfd)->next); + after_bfd = &((*after_bfd)->archive_next); } else { - for (; *after_bfd; after_bfd = &(*after_bfd)->next) + for (; *after_bfd; after_bfd = &(*after_bfd)->archive_next) if (FILENAME_CMP ((*after_bfd)->filename, realposname) == 0) { if (realpos == pos_after) - after_bfd = &(*after_bfd)->next; + after_bfd = &(*after_bfd)->archive_next; break; } } @@ -1027,7 +1035,7 @@ delete_members (bfd *arch, char **files_to_delete) found = FALSE; match_count = 0; - current_ptr_ptr = &(arch->next); + current_ptr_ptr = &(arch->archive_next); while (*current_ptr_ptr) { if (FILENAME_CMP (normalize (*files_to_delete, arch), @@ -1047,12 +1055,12 @@ delete_members (bfd *arch, char **files_to_delete) if (verbose) printf ("d - %s\n", *files_to_delete); - *current_ptr_ptr = ((*current_ptr_ptr)->next); + *current_ptr_ptr = ((*current_ptr_ptr)->archive_next); goto next_file; } } - current_ptr_ptr = &((*current_ptr_ptr)->next); + current_ptr_ptr = &((*current_ptr_ptr)->archive_next); } if (verbose && !found) @@ -1081,7 +1089,7 @@ move_members (bfd *arch, char **files_to_move) for (; *files_to_move; ++files_to_move) { - current_ptr_ptr = &(arch->next); + current_ptr_ptr = &(arch->archive_next); while (*current_ptr_ptr) { bfd *current_ptr = *current_ptr_ptr; @@ -1091,13 +1099,13 @@ move_members (bfd *arch, char **files_to_move) /* Move this file to the end of the list - first cut from where it is. */ bfd *link; - *current_ptr_ptr = current_ptr->next; + *current_ptr_ptr = current_ptr->archive_next; /* Now glue to end */ - after_bfd = get_pos_bfd (&arch->next, pos_end, NULL); + after_bfd = get_pos_bfd (&arch->archive_next, pos_end, NULL); link = *after_bfd; *after_bfd = current_ptr; - current_ptr->next = link; + current_ptr->archive_next = link; if (verbose) printf ("m - %s\n", *files_to_move); @@ -1105,7 +1113,7 @@ move_members (bfd *arch, char **files_to_move) goto next_file; } - current_ptr_ptr = &((*current_ptr_ptr)->next); + current_ptr_ptr = &((*current_ptr_ptr)->archive_next); } /* xgettext:c-format */ fatal (_("no entry %s in archive %s!"), *files_to_move, arch->filename); @@ -1130,7 +1138,7 @@ replace_members (bfd *arch, char **files_to_move, bfd_boolean quick) { if (! quick) { - current_ptr = &arch->next; + current_ptr = &arch->archive_next; while (*current_ptr) { current = *current_ptr; @@ -1160,24 +1168,24 @@ replace_members (bfd *arch, char **files_to_move, bfd_boolean quick) goto next_file; } - after_bfd = get_pos_bfd (&arch->next, pos_after, + after_bfd = get_pos_bfd (&arch->archive_next, pos_after, current->filename); if (ar_emul_replace (after_bfd, *files_to_move, verbose)) { /* Snip out this entry from the chain. */ - *current_ptr = (*current_ptr)->next; + *current_ptr = (*current_ptr)->archive_next; changed = TRUE; } goto next_file; } - current_ptr = &(current->next); + current_ptr = &(current->archive_next); } } /* Add to the end of the archive. */ - after_bfd = get_pos_bfd (&arch->next, pos_end, NULL); + after_bfd = get_pos_bfd (&arch->archive_next, pos_end, NULL); if (ar_emul_append (after_bfd, *files_to_move, verbose)) changed = TRUE; @@ -1193,23 +1201,24 @@ replace_members (bfd *arch, char **files_to_move, bfd_boolean quick) output_filename = NULL; } -static void +static int ranlib_only (const char *archname) { bfd *arch; if (get_file_size (archname) < 1) - return; + return 1; write_armap = 1; arch = open_inarch (archname, (char *) NULL); if (arch == NULL) xexit (1); write_archive (arch); + return 0; } /* Update the timestamp of the symbol map of an archive. */ -static void +static int ranlib_touch (const char *archname) { #ifdef __GO32__ @@ -1221,7 +1230,7 @@ ranlib_touch (const char *archname) char **matching; if (get_file_size (archname) < 1) - return; + return 1; f = open (archname, O_RDWR | O_BINARY, 0); if (f < 0) { @@ -1252,6 +1261,7 @@ ranlib_touch (const char *archname) if (! bfd_close (arch)) bfd_fatal (archname); #endif + return 0; } /* Things which are interesting to map over all or some of the files: */ diff --git a/binutils/arlex.c b/binutils/arlex.c deleted file mode 100644 index cd9bd52d080..00000000000 --- a/binutils/arlex.c +++ /dev/null @@ -1,1856 +0,0 @@ -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /cvs/src/src/binutils/Attic/arlex.c,v 1.1.16.1 2006/04/16 18:36:40 drow Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include -#include - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#ifndef _WIN32 -#include -#endif - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 40 -#define YY_END_OF_BUFFER 41 -static yyconst short int yy_accept[177] = - { 0, - 0, 0, 41, 40, 39, 38, 35, 32, 33, 36, - 40, 34, 37, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 36, 31, 37, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 7, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 22, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - - 35, 35, 35, 10, 11, 12, 35, 15, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 25, 26, 27, - 35, 30, 35, 35, 35, 3, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 18, 35, 35, 35, 35, - 35, 35, 35, 1, 2, 4, 5, 35, 35, 35, - 35, 35, 16, 17, 19, 20, 35, 35, 35, 35, - 35, 35, 8, 9, 13, 14, 35, 23, 24, 28, - 29, 35, 35, 6, 21, 0 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 1, 1, 1, 4, 1, 1, 1, 5, - 6, 7, 8, 9, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 10, 1, - 1, 1, 1, 1, 11, 12, 13, 14, 15, 16, - 4, 17, 18, 4, 4, 19, 20, 21, 22, 23, - 4, 24, 25, 26, 27, 28, 4, 29, 30, 4, - 1, 4, 1, 1, 4, 1, 31, 32, 33, 34, - - 35, 36, 4, 37, 38, 4, 4, 39, 40, 41, - 42, 43, 4, 44, 45, 46, 47, 48, 4, 49, - 50, 4, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[51] = - { 0, - 1, 2, 1, 3, 1, 1, 1, 1, 1, 1, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 - } ; - -static yyconst short int yy_base[180] = - { 0, - 0, 0, 193, 194, 194, 194, 0, 194, 194, 0, - 190, 194, 0, 177, 32, 37, 32, 163, 174, 170, - 164, 171, 174, 169, 149, 15, 22, 17, 135, 146, - 142, 136, 143, 146, 141, 0, 0, 194, 0, 161, - 159, 158, 153, 147, 156, 143, 149, 148, 141, 150, - 141, 135, 138, 127, 125, 124, 119, 113, 122, 109, - 115, 114, 107, 116, 107, 101, 104, 43, 136, 135, - 130, 129, 0, 119, 123, 118, 114, 118, 119, 122, - 124, 25, 104, 103, 98, 97, 0, 87, 91, 86, - 82, 86, 87, 90, 92, 105, 100, 97, 94, 93, - - 105, 106, 102, 0, 0, 0, 104, 0, 92, 75, - 70, 67, 64, 63, 75, 76, 72, 0, 0, 0, - 74, 0, 62, 91, 88, 0, 86, 85, 73, 85, - 79, 83, 70, 62, 59, 0, 57, 56, 44, 56, - 50, 54, 41, 0, 0, 0, 0, 63, 58, 59, - 67, 66, 0, 0, 0, 0, 38, 33, 34, 42, - 41, 51, 0, 0, 0, 0, 30, 0, 0, 0, - 0, 43, 21, 0, 0, 194, 65, 66, 69 - } ; - -static yyconst short int yy_def[180] = - { 0, - 176, 1, 176, 176, 176, 176, 177, 176, 176, 178, - 176, 176, 179, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 178, 176, 179, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 0, 176, 176, 176 - } ; - -static yyconst short int yy_nxt[245] = - { 0, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 7, 15, 16, 17, 18, 19, 7, 20, 7, - 7, 21, 7, 22, 23, 7, 7, 24, 7, 7, - 25, 7, 26, 27, 28, 29, 30, 7, 31, 7, - 7, 32, 7, 33, 34, 7, 7, 35, 7, 7, - 41, 43, 45, 55, 44, 42, 57, 59, 56, 58, - 46, 96, 97, 110, 111, 60, 37, 36, 37, 39, - 175, 39, 174, 173, 172, 171, 170, 169, 168, 167, - 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, - 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, - - 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, - 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, - 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, - 116, 115, 114, 113, 112, 109, 108, 107, 106, 105, - 104, 103, 102, 101, 100, 99, 98, 95, 94, 93, - 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, - 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, - 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, - 62, 61, 54, 53, 52, 51, 50, 49, 48, 47, - 40, 38, 176, 3, 176, 176, 176, 176, 176, 176, - - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176 - } ; - -static yyconst short int yy_chk[245] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 15, 16, 17, 26, 16, 15, 27, 28, 26, 27, - 17, 68, 68, 82, 82, 28, 178, 177, 178, 179, - 173, 179, 172, 167, 162, 161, 160, 159, 158, 157, - 152, 151, 150, 149, 148, 143, 142, 141, 140, 139, - 138, 137, 135, 134, 133, 132, 131, 130, 129, 128, - - 127, 125, 124, 123, 121, 117, 116, 115, 114, 113, - 112, 111, 110, 109, 107, 103, 102, 101, 100, 99, - 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, - 88, 86, 85, 84, 83, 81, 80, 79, 78, 77, - 76, 75, 74, 72, 71, 70, 69, 67, 66, 65, - 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, - 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, - 44, 43, 42, 41, 40, 35, 34, 33, 32, 31, - 30, 29, 25, 24, 23, 22, 21, 20, 19, 18, - 14, 11, 3, 176, 176, 176, 176, 176, 176, 176, - - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "arlex.l" -#define INITIAL 0 -#line 2 "arlex.l" -/* arlex.l - Strange script language lexer */ - -/* Copyright 1992, 1997, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. - -This file is part of 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 2 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. */ - - -/* Contributed by Steve Chamberlain . */ - -#define DONTDECLARE_MALLOC -#include "ansidecl.h" -#include "libiberty.h" -#include "arparse.h" - -#define YY_NO_UNPUT - -extern int yylex (void); - -int linenumber; -#line 511 "arlex.c" - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - } -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 41 "arlex.l" - - -#line 676 "arlex.c" - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 177 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 194 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 43 "arlex.l" -{ return ADDLIB; } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 44 "arlex.l" -{ return ADDMOD; } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 45 "arlex.l" -{ return CLEAR; } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 46 "arlex.l" -{ return CREATE; } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 47 "arlex.l" -{ return DELETE; } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 48 "arlex.l" -{ return DIRECTORY; } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 49 "arlex.l" -{ return END; } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 50 "arlex.l" -{ return EXTRACT; } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 51 "arlex.l" -{ return FULLDIR; } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 52 "arlex.l" -{ return HELP; } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 53 "arlex.l" -{ return LIST; } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 54 "arlex.l" -{ return OPEN; } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 55 "arlex.l" -{ return REPLACE; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 56 "arlex.l" -{ return VERBOSE; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 57 "arlex.l" -{ return SAVE; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 58 "arlex.l" -{ return ADDLIB; } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 59 "arlex.l" -{ return ADDMOD; } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 60 "arlex.l" -{ return CLEAR; } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 61 "arlex.l" -{ return CREATE; } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 62 "arlex.l" -{ return DELETE; } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 63 "arlex.l" -{ return DIRECTORY; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 64 "arlex.l" -{ return END; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 65 "arlex.l" -{ return EXTRACT; } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 66 "arlex.l" -{ return FULLDIR; } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 67 "arlex.l" -{ return HELP; } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 68 "arlex.l" -{ return LIST; } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 69 "arlex.l" -{ return OPEN; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 70 "arlex.l" -{ return REPLACE; } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 71 "arlex.l" -{ return VERBOSE; } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 72 "arlex.l" -{ return SAVE; } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 73 "arlex.l" -{ linenumber ++; } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 74 "arlex.l" -{ return '('; } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 75 "arlex.l" -{ return ')'; } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 76 "arlex.l" -{ return ','; } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 77 "arlex.l" -{ - yylval.name = xstrdup (yytext); - return FILENAME; - } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 81 "arlex.l" -{ } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 82 "arlex.l" -{ } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 83 "arlex.l" -{ } - YY_BREAK -case 39: -YY_RULE_SETUP -#line 84 "arlex.l" -{ linenumber ++; return NEWLINE; } - YY_BREAK -case 40: -YY_RULE_SETUP -#line 86 "arlex.l" -ECHO; - YY_BREAK -#line 962 "arlex.c" -case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 177 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 177 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 176); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - - return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef _WIN32 -#include -#else -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -#line 86 "arlex.l" - -#ifndef yywrap -/* Needed for lex, though not flex. */ -int yywrap(void) { return 1; } -#endif diff --git a/binutils/arparse.c b/binutils/arparse.c deleted file mode 100644 index 21fa13a44b0..00000000000 --- a/binutils/arparse.c +++ /dev/null @@ -1,1605 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - 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 2, 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. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NEWLINE = 258, - VERBOSE = 259, - FILENAME = 260, - ADDLIB = 261, - LIST = 262, - ADDMOD = 263, - CLEAR = 264, - CREATE = 265, - DELETE = 266, - DIRECTORY = 267, - END = 268, - EXTRACT = 269, - FULLDIR = 270, - HELP = 271, - QUIT = 272, - REPLACE = 273, - SAVE = 274, - OPEN = 275 - }; -#endif -/* Tokens. */ -#define NEWLINE 258 -#define VERBOSE 259 -#define FILENAME 260 -#define ADDLIB 261 -#define LIST 262 -#define ADDMOD 263 -#define CLEAR 264 -#define CREATE 265 -#define DELETE 266 -#define DIRECTORY 267 -#define END 268 -#define EXTRACT 269 -#define FULLDIR 270 -#define HELP 271 -#define QUIT 272 -#define REPLACE 273 -#define SAVE 274 -#define OPEN 275 - - - - -/* Copy the first part of user declarations. */ -#line 1 "arparse.y" - -/* arparse.y - Stange script language parser */ - -/* Copyright 1992, 1993, 1995, 1997, 1999, 2002, 2003 - Free Software Foundation, Inc. - -This file is part of 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 2 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. */ - - -/* Contributed by Steve Chamberlain - sac@cygnus.com - -*/ -#define DONTDECLARE_MALLOC -#include "bfd.h" -#include "bucomm.h" -#include "arsup.h" -extern int verbose; -extern int yylex (void); -static int yyerror (const char *); - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 37 "arparse.y" -typedef union YYSTYPE { - char *name; -struct list *list ; - -} YYSTYPE; -/* Line 196 of yacc.c. */ -#line 167 "arparse.c" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 219 of yacc.c. */ -#line 179 "arparse.c" - -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -#if ! defined (yyoverflow) || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# else -# define YYSTACK_ALLOC alloca -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYINCLUDED_STDLIB_H -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) -# endif -# ifdef __cplusplus -extern "C" { -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifdef __cplusplus -} -# endif -# endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ - - -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short int yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short int yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 3 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 34 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 24 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 22 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 42 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 53 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 275 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 21, 22, 2, 2, 23, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const unsigned char yyprhs[] = -{ - 0, 0, 3, 4, 7, 10, 11, 14, 16, 18, - 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, - 40, 42, 44, 45, 48, 51, 53, 56, 59, 61, - 63, 66, 69, 73, 78, 80, 81, 85, 86, 90, - 91, 93, 94 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yysigned_char yyrhs[] = -{ - 25, 0, -1, -1, 26, 27, -1, 27, 28, -1, - -1, 29, 3, -1, 37, -1, 38, -1, 45, -1, - 40, -1, 39, -1, 32, -1, 34, -1, 36, -1, - 30, -1, 31, -1, 33, -1, 35, -1, 13, -1, - 1, -1, 5, -1, -1, 14, 43, -1, 18, 43, - -1, 9, -1, 11, 43, -1, 8, 43, -1, 7, - -1, 19, -1, 20, 5, -1, 10, 5, -1, 6, - 5, 42, -1, 12, 5, 42, 41, -1, 5, -1, - -1, 21, 43, 22, -1, -1, 43, 44, 5, -1, - -1, 23, -1, -1, 4, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned char yyrline[] = -{ - 0, 68, 68, 68, 72, 73, 77, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 101, 106, 111, 116, 120, 125, 130, - 137, 142, 148, 152, 159, 161, 165, 168, 172, 178, - 183, 184, 189 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "NEWLINE", "VERBOSE", "FILENAME", - "ADDLIB", "LIST", "ADDMOD", "CLEAR", "CREATE", "DELETE", "DIRECTORY", - "END", "EXTRACT", "FULLDIR", "HELP", "QUIT", "REPLACE", "SAVE", "OPEN", - "'('", "')'", "','", "$accept", "start", "@1", "session", "command_line", - "command", "extract_command", "replace_command", "clear_command", - "delete_command", "addmod_command", "list_command", "save_command", - "open_command", "create_command", "addlib_command", "directory_command", - "optional_filename", "modulelist", "modulename", "optcomma", - "verbose_command", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const unsigned short int yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 40, 41, 44 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = -{ - 0, 24, 26, 25, 27, 27, 28, 29, 29, 29, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, - 29, 29, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 41, 42, 42, 43, 43, - 44, 44, 45 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = -{ - 0, 2, 0, 2, 2, 0, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 0, 2, 2, 1, 2, 2, 1, 1, - 2, 2, 3, 4, 1, 0, 3, 0, 3, 0, - 1, 0, 1 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const unsigned char yydefact[] = -{ - 2, 0, 5, 1, 0, 20, 42, 21, 0, 28, - 39, 25, 0, 39, 0, 19, 39, 39, 29, 0, - 4, 0, 15, 16, 12, 17, 13, 18, 14, 7, - 8, 11, 10, 9, 37, 27, 31, 26, 37, 23, - 24, 30, 6, 39, 32, 40, 0, 35, 41, 38, - 34, 33, 36 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yysigned_char yydefgoto[] = -{ - -1, 1, 2, 4, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 51, 44, 35, - 46, 33 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -14 -static const yysigned_char yypact[] = -{ - -14, 1, -14, -14, 5, -14, -14, -14, 2, -14, - -14, -14, 21, -14, 22, -14, -14, -14, -14, 23, - -14, 26, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, 10, -3, -14, -3, 10, -3, - -3, -14, -14, -14, -14, -14, 27, 28, -1, -14, - -14, -14, -14 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yysigned_char yypgoto[] = -{ - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -4, -13, - -14, -14 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -42 -static const yysigned_char yytable[] = -{ - 37, 3, -41, 39, 40, -3, 5, 34, -22, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 45, 52, 45, 17, 18, 19, 36, 38, 41, 42, - 48, 43, 49, 50, 47 -}; - -static const unsigned char yycheck[] = -{ - 13, 0, 5, 16, 17, 0, 1, 5, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 23, 22, 23, 18, 19, 20, 5, 5, 5, 3, - 43, 21, 5, 5, 38 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const unsigned char yystos[] = -{ - 0, 25, 26, 0, 27, 1, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 18, 19, 20, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 45, 5, 43, 5, 43, 5, 43, - 43, 5, 3, 21, 42, 23, 44, 42, 43, 5, - 5, 41, 22 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (0) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_stack_print (short int *bottom, short int *top) -#else -static void -yy_stack_print (bottom, top) - short int *bottom; - short int *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_reduce_print (int yyrule) -#else -static void -yy_reduce_print (yyrule) - int yyrule; -#endif -{ - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; -} -# endif -# endif - -# ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - size_t yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -#endif /* YYERROR_VERBOSE */ - - - -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - switch (yytype) - { - default: - break; - } - YYFPRINTF (yyoutput, ")"); -} - -#endif /* ! YYDEBUG */ -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM); -# else -int yyparse (); -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int -yyparse (void) -#else -int -yyparse () - ; -#endif -#endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short int yyssa[YYINITDEPTH]; - short int *yyss = yyssa; - short int *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK (yyvsp--, yyssp--) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short int *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - short int *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a look-ahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to look-ahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; - - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 68 "arparse.y" - { prompt(); } - break; - - case 6: -#line 77 "arparse.y" - { prompt(); } - break; - - case 19: -#line 93 "arparse.y" - { ar_end(); return 0; } - break; - - case 21: -#line 95 "arparse.y" - { yyerror("foo"); } - break; - - case 23: -#line 102 "arparse.y" - { ar_extract((yyvsp[0].list)); } - break; - - case 24: -#line 107 "arparse.y" - { ar_replace((yyvsp[0].list)); } - break; - - case 25: -#line 112 "arparse.y" - { ar_clear(); } - break; - - case 26: -#line 117 "arparse.y" - { ar_delete((yyvsp[0].list)); } - break; - - case 27: -#line 121 "arparse.y" - { ar_addmod((yyvsp[0].list)); } - break; - - case 28: -#line 126 "arparse.y" - { ar_list(); } - break; - - case 29: -#line 131 "arparse.y" - { ar_save(); } - break; - - case 30: -#line 138 "arparse.y" - { ar_open((yyvsp[0].name),0); } - break; - - case 31: -#line 143 "arparse.y" - { ar_open((yyvsp[0].name),1); } - break; - - case 32: -#line 149 "arparse.y" - { ar_addlib((yyvsp[-1].name),(yyvsp[0].list)); } - break; - - case 33: -#line 153 "arparse.y" - { ar_directory((yyvsp[-2].name), (yyvsp[-1].list), (yyvsp[0].name)); } - break; - - case 34: -#line 160 "arparse.y" - { (yyval.name) = (yyvsp[0].name); } - break; - - case 35: -#line 161 "arparse.y" - { (yyval.name) = 0; } - break; - - case 36: -#line 166 "arparse.y" - { (yyval.list) = (yyvsp[-1].list); } - break; - - case 37: -#line 168 "arparse.y" - { (yyval.list) = 0; } - break; - - case 38: -#line 173 "arparse.y" - { struct list *n = (struct list *) malloc(sizeof(struct list)); - n->next = (yyvsp[-2].list); - n->name = (yyvsp[0].name); - (yyval.list) = n; - } - break; - - case 39: -#line 178 "arparse.y" - { (yyval.list) = 0; } - break; - - case 42: -#line 190 "arparse.y" - { verbose = !verbose; } - break; - - - default: break; - } - -/* Line 1126 of yacc.c. */ -#line 1327 "arparse.c" - - yyvsp -= yylen; - yyssp -= yylen; - - - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - char *yymsg = 0; -# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -#if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -#endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - - if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yymsg; - int yyi = 0; - while ((*yyp = *yyf)) - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - { - yyerror (YY_("syntax error")); - goto yyexhaustedlab; - } - } - else -#endif /* YYERROR_VERBOSE */ - yyerror (YY_("syntax error")); - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (0) - goto yyerrorlab; - -yyvsp -= yylen; - yyssp -= yylen; - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK; - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK; - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif - return yyresult; -} - - -#line 194 "arparse.y" - - -static int -yyerror (const char *x ATTRIBUTE_UNUSED) -{ - extern int linenumber; - - printf (_("Syntax error in archive script, line %d\n"), linenumber + 1); - return 0; -} - diff --git a/binutils/arparse.h b/binutils/arparse.h deleted file mode 100644 index 41044396e19..00000000000 --- a/binutils/arparse.h +++ /dev/null @@ -1,92 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - 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 2, 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. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NEWLINE = 258, - VERBOSE = 259, - FILENAME = 260, - ADDLIB = 261, - LIST = 262, - ADDMOD = 263, - CLEAR = 264, - CREATE = 265, - DELETE = 266, - DIRECTORY = 267, - END = 268, - EXTRACT = 269, - FULLDIR = 270, - HELP = 271, - QUIT = 272, - REPLACE = 273, - SAVE = 274, - OPEN = 275 - }; -#endif -/* Tokens. */ -#define NEWLINE 258 -#define VERBOSE 259 -#define FILENAME 260 -#define ADDLIB 261 -#define LIST 262 -#define ADDMOD 263 -#define CLEAR 264 -#define CREATE 265 -#define DELETE 266 -#define DIRECTORY 267 -#define END 268 -#define EXTRACT 269 -#define FULLDIR 270 -#define HELP 271 -#define QUIT 272 -#define REPLACE 273 -#define SAVE 274 -#define OPEN 275 - - - - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 37 "arparse.y" -typedef union YYSTYPE { - char *name; -struct list *list ; - -} YYSTYPE; -/* Line 1447 of yacc.c. */ -#line 84 "arparse.h" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE yylval; - - - diff --git a/binutils/arparse.y b/binutils/arparse.y index a7ea0157f41..2453b65a02e 100644 --- a/binutils/arparse.y +++ b/binutils/arparse.y @@ -1,7 +1,7 @@ %{ /* arparse.y - Stange script language parser */ -/* Copyright 1992, 1993, 1995, 1997, 1999, 2002, 2003 +/* Copyright 1992, 1993, 1995, 1997, 1999, 2002, 2003, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -26,8 +26,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #define DONTDECLARE_MALLOC +#include "sysdep.h" #include "bfd.h" -#include "bucomm.h" #include "arsup.h" extern int verbose; extern int yylex (void); diff --git a/binutils/arsup.c b/binutils/arsup.c index 189490b307b..98f93a637e5 100644 --- a/binutils/arsup.c +++ b/binutils/arsup.c @@ -1,6 +1,6 @@ /* arsup.c - Archive support for MRI compatibility Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, - 2004 Free Software Foundation, Inc. + 2004, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -25,11 +25,12 @@ This file looks after requests from arparse.y, to provide the MRI style librarian command syntax + 1 word LIST. */ +#include "sysdep.h" #include "bfd.h" -#include "arsup.h" #include "libiberty.h" -#include "bucomm.h" #include "filenames.h" +#include "bucomm.h" +#include "arsup.h" static void map_over_list (bfd *, void (*function) (bfd *, bfd *), struct list *); @@ -51,10 +52,10 @@ map_over_list (bfd *arch, void (*function) (bfd *, bfd *), struct list *list) { bfd *next; - head = arch->next; + head = arch->archive_next; while (head != NULL) { - next = head->next; + next = head->archive_next; function (head, (bfd *) NULL); head = next; } @@ -73,7 +74,7 @@ map_over_list (bfd *arch, void (*function) (bfd *, bfd *), struct list *list) bfd_boolean found = FALSE; bfd *prev = arch; - for (head = arch->next; head; head = head->next) + for (head = arch->archive_next; head; head = head->archive_next) { if (head->filename != NULL && FILENAME_CMP (ptr->name, head->filename) == 0) @@ -197,7 +198,7 @@ ar_open (char *name, int t) while (element) { *ptr = element; - ptr = &element->next; + ptr = &element->archive_next; element = bfd_openr_next_archived_file (ibfd, element); } } @@ -213,9 +214,9 @@ ar_addlib_doer (bfd *abfd, bfd *prev) { /* Add this module to the output bfd. */ if (prev != NULL) - prev->next = abfd->next; + prev->archive_next = abfd->archive_next; - abfd->next = obfd->archive_head; + abfd->archive_next = obfd->archive_head; obfd->archive_head = abfd; } @@ -261,7 +262,7 @@ ar_addmod (struct list *list) } else { - abfd->next = obfd->archive_head; + abfd->archive_next = obfd->archive_head; obfd->archive_head = abfd; } list = list->next; @@ -298,13 +299,13 @@ ar_delete (struct list *list) { if (FILENAME_CMP(member->filename, list->name) == 0) { - *prev = member->next; + *prev = member->archive_next; found = 1; } else - prev = &(member->next); + prev = &(member->archive_next); - member = member->next; + member = member->archive_next; } if (!found) @@ -372,15 +373,15 @@ ar_replace (struct list *list) else { *prev = abfd; - abfd->next = member->next; + abfd->archive_next = member->archive_next; found = 1; } } else { - prev = &(member->next); + prev = &(member->archive_next); } - member = member->next; + member = member->archive_next; } if (!found) @@ -423,7 +424,7 @@ ar_list (void) for (abfd = obfd->archive_head; abfd != (bfd *)NULL; - abfd = abfd->next) + abfd = abfd->archive_next) ar_directory_doer (abfd, (bfd *) NULL); } } @@ -462,7 +463,7 @@ ar_extract (struct list *list) found = 1; } - member = member->next; + member = member->archive_next; } if (!found) diff --git a/binutils/bin2c.c b/binutils/bin2c.c new file mode 100644 index 00000000000..b83f02d3c98 --- /dev/null +++ b/binutils/bin2c.c @@ -0,0 +1,105 @@ +/* bin2c.c -- dump binary file in hex format + Copyright 2007 Free Software Foundation, Inc. + + This file is part of 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 2 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 "bucomm.h" + +#if !defined O_BINARY && defined _O_BINARY + /* For MSC-compatible compilers. */ +# define O_BINARY _O_BINARY +# define O_TEXT _O_TEXT +#endif + +#ifdef __BEOS__ + /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ +# undef O_BINARY +# undef O_TEXT +#endif + +#if O_BINARY +# ifndef __DJGPP__ +# define setmode _setmode +# define fileno(_fp) _fileno (_fp) +# endif /* not DJGPP */ +# define SET_BINARY(_f) \ + do { if (!isatty (_f)) setmode (_f, O_BINARY); } while (0) +#else +# define SET_BINARY(f) (void) 0 +# define O_BINARY 0 +# define O_TEXT 0 +#endif /* O_BINARY */ + +int +main (int argc, char *argv[]) +{ + int c; + int i; + +#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) + setlocale (LC_MESSAGES, ""); +#endif +#if defined (HAVE_SETLOCALE) + setlocale (LC_CTYPE, ""); +#endif + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + if (argc != 1) + { + int ishelp = 0; + int isvers = 0; + FILE *stream; + + if (argc == 2 && argv[1][0] == '-') + { + const char *opt = &argv[1][1]; + if (*opt == '-') + ++opt; + ishelp = *opt == 'h' || *opt == 'H'; + isvers = *opt == 'v' || *opt == 'V'; + } + + if (isvers) + print_version ("bin2c"); + + stream = ishelp ? stdout : stderr; + fprintf (stream, _("Usage: %s < input_file > output_file\n"), argv[0]); + fprintf (stream, _("Prints bytes from stdin in hex format.\n")); + exit (!ishelp); + } + + SET_BINARY (fileno (stdin)); + + i = 0; + while ((c = getc (stdin)) != EOF) + { + printf ("0x%02x,", c); + if (++i == 16) + { + printf ("\n"); + i = 0; + } + } + if (i != 0) + printf ("\n"); + + exit (0); +} diff --git a/binutils/binemul.c b/binutils/binemul.c index 7dac32dd115..83740d0d6ac 100644 --- a/binutils/binemul.c +++ b/binutils/binemul.c @@ -58,7 +58,7 @@ ar_emul_default_append (bfd **after_bfd, char *file_name, AR_EMUL_ELEMENT_CHECK (*after_bfd, file_name); AR_EMUL_APPEND_PRINT_VERBOSE (verbose, file_name); - (*after_bfd)->next = temp; + (*after_bfd)->archive_next = temp; return TRUE; } @@ -84,7 +84,7 @@ ar_emul_default_replace (bfd **after_bfd, char *file_name, AR_EMUL_ELEMENT_CHECK (*after_bfd, file_name); AR_EMUL_REPLACE_PRINT_VERBOSE (verbose, file_name); - (*after_bfd)->next = temp; + (*after_bfd)->archive_next = temp; return TRUE; } diff --git a/binutils/binemul.h b/binutils/binemul.h index 53bbbd2de20..c5d8c78f7fb 100644 --- a/binutils/binemul.h +++ b/binutils/binemul.h @@ -1,5 +1,5 @@ /* Binutils emulation layer. - Copyright 2002, 2003 Free Software Foundation, Inc. + Copyright 2002, 2003, 2007 Free Software Foundation, Inc. Written by Tom Rix, Red Hat Inc. This file is part of GNU Binutils. @@ -21,6 +21,7 @@ #ifndef BINEMUL_H #define BINEMUL_H +#include "sysdep.h" #include "bfd.h" #include "bucomm.h" diff --git a/binutils/bucomm.c b/binutils/bucomm.c index 03a4d2873e2..a4c11f0cfa0 100644 --- a/binutils/bucomm.c +++ b/binutils/bucomm.c @@ -1,5 +1,6 @@ /* bucomm.c -- Bin Utils COMmon code. - Copyright 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2003 + Copyright 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000, 2001, 2002, + 2003, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -22,16 +23,16 @@ /* We might put this in a library someday so it could be dynamically loaded, but for now it's not necessary. */ +#include "sysdep.h" #include "bfd.h" -#include "bfdver.h" #include "libiberty.h" -#include "bucomm.h" #include "filenames.h" #include "libbfd.h" #include #include /* ctime, maybe time_t */ #include +#include "bucomm.h" #ifndef HAVE_TIME_T_IN_TIME_H #ifndef HAVE_TIME_T_IN_TYPES_H @@ -386,53 +387,101 @@ print_arelt_descr (FILE *file, bfd *abfd, bfd_boolean verbose) fprintf (file, "%s\n", bfd_get_filename (abfd)); } -/* Return the name of a temporary file in the same directory as FILENAME. */ +/* Return a path for a new temporary file in the same directory + as file PATH. */ -char * -make_tempname (char *filename) +static char * +template_in_dir (const char *path) { - static char template[] = "stXXXXXX"; +#define template "stXXXXXX" + const char *slash = strrchr (path, '/'); char *tmpname; - char *slash = strrchr (filename, '/'); + size_t len; #ifdef HAVE_DOS_BASED_FILE_SYSTEM { /* We could have foo/bar\\baz, or foo\\bar, or d:bar. */ - char *bslash = strrchr (filename, '\\'); + char *bslash = strrchr (path, '\\'); + if (slash == NULL || (bslash != NULL && bslash > slash)) slash = bslash; - if (slash == NULL && filename[0] != '\0' && filename[1] == ':') - slash = filename + 1; + if (slash == NULL && path[0] != '\0' && path[1] == ':') + slash = path + 1; } #endif if (slash != (char *) NULL) { - char c; + len = slash - path; + tmpname = xmalloc (len + sizeof (template) + 2); + memcpy (tmpname, path, len); - c = *slash; - *slash = 0; - tmpname = xmalloc (strlen (filename) + sizeof (template) + 2); - strcpy (tmpname, filename); #ifdef HAVE_DOS_BASED_FILE_SYSTEM /* If tmpname is "X:", appending a slash will make it a root directory on drive X, which is NOT the same as the current directory on drive X. */ - if (tmpname[1] == ':' && tmpname[2] == '\0') - strcat (tmpname, "."); + if (len == 2 && tmpname[1] == ':') + tmpname[len++] = '.'; #endif - strcat (tmpname, "/"); - strcat (tmpname, template); - mktemp (tmpname); - *slash = c; + tmpname[len++] = '/'; } else { tmpname = xmalloc (sizeof (template)); - strcpy (tmpname, template); - mktemp (tmpname); + len = 0; } + + memcpy (tmpname + len, template, sizeof (template)); return tmpname; +#undef template +} + +/* Return the name of a created temporary file in the same directory + as FILENAME. */ + +char * +make_tempname (char *filename) +{ + char *tmpname = template_in_dir (filename); + int fd; + +#ifdef HAVE_MKSTEMP + fd = mkstemp (tmpname); +#else + tmpname = mktemp (tmpname); + if (tmpname == NULL) + return NULL; + fd = open (tmpname, O_RDWR | O_CREAT | O_EXCL, 0600); +#endif + if (fd == -1) + return NULL; + close (fd); + return tmpname; +} + +/* Return the name of a created temporary directory inside the + directory containing FILENAME. */ + +char * +make_tempdir (char *filename) +{ + char *tmpname = template_in_dir (filename); + +#ifdef HAVE_MKDTEMP + return mkdtemp (tmpname); +#else + tmpname = mktemp (tmpname); + if (tmpname == NULL) + return NULL; +#if defined (_WIN32) && !defined (__CYGWIN32__) + if (mkdir (tmpname) != 0) + return NULL; +#else + if (mkdir (tmpname, 0700) != 0) + return NULL; +#endif + return tmpname; +#endif } /* Parse a string into a VMA, with a fatal error if it can't be diff --git a/binutils/bucomm.h b/binutils/bucomm.h index 9f914adeb58..95ed2ec2c3a 100644 --- a/binutils/bucomm.h +++ b/binutils/bucomm.h @@ -1,6 +1,6 @@ /* bucomm.h -- binutils common include file. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2005 Free Software Foundation, Inc. + 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -21,159 +21,6 @@ #ifndef _BUCOMM_H #define _BUCOMM_H -#include "ansidecl.h" -#include -#include - -#include "config.h" -#include "bin-bugs.h" - -#include - -#ifdef USE_BINARY_FOPEN -#include "fopen-bin.h" -#else -#include "fopen-same.h" -#endif - -#include -#ifndef errno -extern int errno; -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifdef HAVE_STRING_H -#include -#else -#ifdef HAVE_STRINGS_H -#include -#else -extern char *strchr (); -extern char *strrchr (); -#endif -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif - -#ifdef HAVE_FCNTL_H -#include -#else -#ifdef HAVE_SYS_FILE_H -#include -#endif -#endif - -#if !HAVE_DECL_STPCPY -extern char *stpcpy (char *, const char *); -#endif - -#if !HAVE_DECL_STRSTR -extern char *strstr (); -#endif - -#ifdef HAVE_SBRK -#if !HAVE_DECL_SBRK -extern char *sbrk (); -#endif -#endif - -#if !HAVE_DECL_GETENV -extern char *getenv (); -#endif - -#if !HAVE_DECL_ENVIRON -extern char **environ; -#endif - -#if !HAVE_DECL_FPRINTF -extern int fprintf (FILE *, const char *, ...); -#endif - -#if !HAVE_DECL_SNPRINTF -extern int snprintf(char *, size_t, const char *, ...); -#endif - -#if !HAVE_DECL_VSNPRINTF -extern int vsnprintf(char *, size_t, const char *, va_list); -#endif - -#ifndef O_RDONLY -#define O_RDONLY 0 -#endif - -#ifndef O_RDWR -#define O_RDWR 2 -#endif - -#ifndef SEEK_SET -#define SEEK_SET 0 -#endif -#ifndef SEEK_CUR -#define SEEK_CUR 1 -#endif -#ifndef SEEK_END -#define SEEK_END 2 -#endif - -#if defined(__GNUC__) && !defined(C_ALLOCA) -# undef alloca -# define alloca __builtin_alloca -#else -# if defined(HAVE_ALLOCA_H) && !defined(C_ALLOCA) -# include -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -# if !defined (__STDC__) && !defined (__hpux) -char *alloca (); -# else -void *alloca (); -# endif /* __STDC__, __hpux */ -# endif /* alloca */ -# endif /* HAVE_ALLOCA_H */ -#endif - - -#ifdef HAVE_LOCALE_H -# ifndef ENABLE_NLS - /* The Solaris version of locale.h always includes libintl.h. If we have - been configured with --disable-nls then ENABLE_NLS will not be defined - and the dummy definitions of bindtextdomain (et al) below will conflict - with the defintions in libintl.h. So we define these values to prevent - the bogus inclusion of libintl.h. */ -# define _LIBINTL_H -# define _LIBGETTEXT_H -# endif -# include -#endif - -#ifdef ENABLE_NLS -# include -# define _(String) gettext (String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define gettext(Msgid) (Msgid) -# define dgettext(Domainname, Msgid) (Msgid) -# define dcgettext(Domainname, Msgid, Category) (Msgid) -# define textdomain(Domainname) while (0) /* nothing */ -# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */ -# define _(String) (String) -# define N_(String) (String) -#endif - -/* Used by ar.c and objcopy.c. */ -#define BUFSIZE 8192 - -/* bucomm.c */ - /* Return the filename in a static buffer. */ const char *bfd_get_archive_filename (bfd *); @@ -200,6 +47,7 @@ int display_info (void); void print_arelt_descr (FILE *, bfd *, bfd_boolean); char *make_tempname (char *); +char *make_tempdir (char *); bfd_vma parse_vma (const char *, const char *); diff --git a/binutils/budemang.c b/binutils/budemang.c deleted file mode 100644 index 55f10b785da..00000000000 --- a/binutils/budemang.c +++ /dev/null @@ -1,100 +0,0 @@ -/* demangle.c -- A wrapper calling libiberty cplus_demangle - Copyright 2002, 2003, 2004 Free Software Foundation, Inc. - - This file is part of 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 2 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 "config.h" -#include -#ifdef HAVE_STRING_H -#include -#else -#ifdef HAVE_STRINGS_H -#include -#endif -#endif -#include "bfd.h" -#include "libiberty.h" -#include "demangle.h" -#include "budemang.h" - -/* Wrapper around cplus_demangle. Strips leading underscores and - other such chars that would otherwise confuse the demangler. */ - -char * -demangle (bfd *abfd, const char *name) -{ - char *res, *alloc; - const char *pre, *suf; - size_t pre_len; - - if (abfd != NULL && bfd_get_symbol_leading_char (abfd) == name[0]) - ++name; - - /* This is a hack for better error reporting on XCOFF, PowerPC64-ELF - or the MS PE format. These formats have a number of leading '.'s - on at least some symbols, so we remove all dots to avoid - confusing the demangler. */ - pre = name; - while (*name == '.') - ++name; - pre_len = name - pre; - - alloc = NULL; - suf = strchr (name, '@'); - if (suf != NULL) - { - alloc = xmalloc (suf - name + 1); - memcpy (alloc, name, suf - name); - alloc[suf - name] = '\0'; - name = alloc; - } - - res = cplus_demangle (name, DMGL_ANSI | DMGL_PARAMS); - if (res != NULL) - { - /* Now put back any suffix, or stripped dots. */ - if (pre_len != 0 || suf != NULL) - { - size_t len; - size_t suf_len; - char *final; - - if (alloc != NULL) - free (alloc); - - len = strlen (res); - if (suf == NULL) - suf = res + len; - suf_len = strlen (suf) + 1; - final = xmalloc (pre_len + len + suf_len); - - memcpy (final, pre, pre_len); - memcpy (final + pre_len, res, len); - memcpy (final + pre_len + len, suf, suf_len); - free (res); - res = final; - } - - return res; - } - - if (alloc != NULL) - free (alloc); - - return xstrdup (pre); -} diff --git a/binutils/coffdump.c b/binutils/coffdump.c index 5ec23b43f62..7b6ead4af38 100644 --- a/binutils/coffdump.c +++ b/binutils/coffdump.c @@ -1,5 +1,5 @@ /* Coff file dumper. - Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003 + Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -23,11 +23,12 @@ This module reads a type tree generated by coffgrok and prints it out so we can test the grokker. */ +#include "sysdep.h" #include "bfd.h" #include "libiberty.h" +#include "bucomm.h" #include "coffgrok.h" -#include "bucomm.h" #include "getopt.h" static int atnl; @@ -462,7 +463,7 @@ show_usage (FILE *file, int status) -v --version Display the program's version\n\ \n")); - if (status == 0) + if (REPORT_BUGS_TO[0] && status == 0) fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); diff --git a/binutils/coffgrok.c b/binutils/coffgrok.c index a6c05b14d2a..a1e89e1298c 100644 --- a/binutils/coffgrok.c +++ b/binutils/coffgrok.c @@ -1,5 +1,5 @@ /* coffgrok.c - Copyright 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2003, 2004 + Copyright 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -26,13 +26,15 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "sysdep.h" #include "bfd.h" #include "libiberty.h" -#include "bucomm.h" #include "coff/internal.h" #include "../bfd/libcoff.h" +#include "bucomm.h" #include "coffgrok.h" + static int lofile = 1; static struct coff_scope *top_scope; static struct coff_scope *file_scope; diff --git a/binutils/config.in b/binutils/config.in index 93d8e952837..6183c3782e1 100644 --- a/binutils/config.in +++ b/binutils/config.in @@ -8,7 +8,8 @@ /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA -/* Define to 1 if NLS is requested */ +/* Define to 1 if translation of program messages to the user's native + language is requested. */ #undef ENABLE_NLS /* Suffix used for executables, if any. */ @@ -21,12 +22,6 @@ */ #undef HAVE_ALLOCA_H -/* Define to 1 if you have the header file. */ -#undef HAVE_ARGZ_H - -/* Define to 1 if you have the `dcgettext' function. */ -#undef HAVE_DCGETTEXT - /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #undef HAVE_DECL_ENVIRON @@ -66,6 +61,9 @@ don't. */ #undef HAVE_DECL_VSNPRINTF +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + /* Does the platform use an executable suffix? */ #undef HAVE_EXECUTABLE_SUFFIX @@ -75,60 +73,33 @@ /* Is fopen64 available? */ #undef HAVE_FOPEN64 -/* Define to 1 if you have the `getcwd' function. */ -#undef HAVE_GETCWD - /* Define to 1 if you have the `getc_unlocked' function. */ #undef HAVE_GETC_UNLOCKED -/* Define to 1 if you have the `getpagesize' function. */ -#undef HAVE_GETPAGESIZE - -/* Define as 1 if you have gettext and don't want to use GNU gettext. */ -#undef HAVE_GETTEXT - /* Does define struct utimbuf? */ #undef HAVE_GOOD_UTIME_H +/* Define if you have the iconv() function. */ +#undef HAVE_ICONV + /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define if your locale.h file contains LC_MESSAGES. */ -#undef HAVE_LC_MESSAGES - /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H -/* Define to 1 if you have the header file. */ -#undef HAVE_LOCALE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MALLOC_H - /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H -/* Define to 1 if you have a working `mmap' system call. */ -#undef HAVE_MMAP +/* Define to 1 if you have the `mkdtemp' function. */ +#undef HAVE_MKDTEMP -/* Define to 1 if you have the `munmap' function. */ -#undef HAVE_MUNMAP - -/* Define to 1 if you have the header file. */ -#undef HAVE_NL_TYPES_H - -/* Define to 1 if you have the `putenv' function. */ -#undef HAVE_PUTENV +/* Define to 1 if you have the `mkstemp' function. */ +#undef HAVE_MKSTEMP /* Define to 1 if you have the `sbrk' function. */ #undef HAVE_SBRK -/* Define to 1 if you have the `setenv' function. */ -#undef HAVE_SETENV - -/* Define to 1 if you have the `setlocale' function. */ -#undef HAVE_SETLOCALE - /* Define to 1 if you have the `setmode' function. */ #undef HAVE_SETMODE @@ -141,15 +112,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H -/* Define if you have the stpcpy function */ -#undef HAVE_STPCPY - -/* Define to 1 if you have the `strcasecmp' function. */ -#undef HAVE_STRCASECMP - -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR - /* Define to 1 if you have the `strcoll' function. */ #undef HAVE_STRCOLL @@ -186,17 +148,12 @@ /* Define to 1 if you have the `utimes' function. */ #undef HAVE_UTIMES -/* Define to 1 if you have the header file. */ -#undef HAVE_VALUES_H +/* Define as const if the declaration of iconv() needs const. */ +#undef ICONV_CONST -/* Define to 1 if you have the `__argz_count' function. */ -#undef HAVE___ARGZ_COUNT - -/* Define to 1 if you have the `__argz_next' function. */ -#undef HAVE___ARGZ_NEXT - -/* Define to 1 if you have the `__argz_stringify' function. */ -#undef HAVE___ARGZ_STRINGIFY +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR /* Name of package */ #undef PACKAGE @@ -250,18 +207,3 @@ /* Enable LFS */ #undef _LARGEFILE64_SOURCE - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#undef inline -#endif - -/* Define to `long' if does not define. */ -#undef off_t - -/* Define to `unsigned' if does not define. */ -#undef size_t diff --git a/binutils/configure b/binutils/configure index 2d8e0cb970c..a10a8adcc05 100755 --- a/binutils/configure +++ b/binutils/configure @@ -241,6 +241,155 @@ IFS=" $as_nl" $as_unset CDPATH + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +$* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. @@ -309,7 +458,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S RANLIB ac_ct_RANLIB LIBTOOL WARN_CFLAGS NO_WERROR YACC LEX LEXLIB LEX_OUTPUT_ROOT CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT HDEFINES AR CC_FOR_BUILD EXEEXT_FOR_BUILD DEMANGLER_NAME NLMCONV_DEFS BUILD_NLMCONV BUILD_SRCONV BUILD_DLLTOOL DLLTOOL_DEFS BUILD_WINDRES BUILD_DLLWRAP BUILD_MISC OBJDUMP_DEFS EMULATION EMULATION_VECTOR datarootdir docdir htmldir LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LIBTOOL SED EGREP FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S AR ac_ct_AR RANLIB ac_ct_RANLIB lt_ECHO CPP WARN_CFLAGS NO_WERROR YACC LEX LEXLIB LEX_OUTPUT_ROOT USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT MKINSTALLDIRS MSGFMT MSGMERGE MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT GENINSRC_NEVER_TRUE GENINSRC_NEVER_FALSE HDEFINES CC_FOR_BUILD EXEEXT_FOR_BUILD DEMANGLER_NAME ALLOCA LIBICONV LTLIBICONV NLMCONV_DEFS BUILD_NLMCONV BUILD_SRCONV BUILD_DLLTOOL DLLTOOL_DEFS BUILD_WINDRES BUILD_WINDMC BUILD_DLLWRAP BUILD_MISC BUILD_INSTALL_MISC OBJDUMP_DEFS EMULATION EMULATION_VECTOR datarootdir docdir htmldir LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -852,24 +1001,31 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors - --enable-shared=PKGS build shared libraries default=yes - --enable-static=PKGS build static libraries default=yes - --enable-fast-install=PKGS optimize for fast installation default=yes + --enable-shared[=PKGS] + build shared libraries [default=yes] + --enable-static[=PKGS] + build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-targets alternative target configurations --enable-commonbfdlib build shared BFD/opcodes/libiberty library - --enable-werror treat compile warnings as errors - --enable-build-warnings Enable build-time compiler warnings + --enable-werror treat compile warnings as errors + --enable-build-warnings enable build-time compiler warnings --disable-nls do not use Native Language Support --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer + --disable-rpath do not hardcode runtime library paths Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-gnu-ld assume the C compiler uses GNU ld default=no - --with-pic try to use only PIC/non-PIC objects default=use both - --with-included-gettext use the GNU gettext library included here + --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib + --without-libiconv-prefix don't search for libiconv in includedir and libdir Some influential environment variables: CC C compiler command @@ -3072,1178 +3228,6 @@ fi -# Check whether --enable-shared or --disable-shared was given. -if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - p=${PACKAGE-default} -case $enableval in -yes) enable_shared=yes ;; -no) enable_shared=no ;; -*) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac -else - enable_shared=yes -fi; -# Check whether --enable-static or --disable-static was given. -if test "${enable_static+set}" = set; then - enableval="$enable_static" - p=${PACKAGE-default} -case $enableval in -yes) enable_static=yes ;; -no) enable_static=no ;; -*) - enable_static=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac -else - enable_static=yes -fi; -# Check whether --enable-fast-install or --disable-fast-install was given. -if test "${enable_fast_install+set}" = set; then - enableval="$enable_fast_install" - p=${PACKAGE-default} -case $enableval in -yes) enable_fast_install=yes ;; -no) enable_fast_install=no ;; -*) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac -else - enable_fast_install=yes -fi; - -# Check whether --with-gnu-ld or --without-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi; -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by GCC" >&5 -echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 -else - echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 -fi -if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" -else - lt_cv_path_LD="$LD" # Let the user override the test with a path. -fi -fi - -LD="$lt_cv_path_LD" -if test -n "$LD"; then - echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 -if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then - lt_cv_prog_gnu_ld=yes -else - lt_cv_prog_gnu_ld=no -fi -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 -with_gnu_ld=$lt_cv_prog_gnu_ld - - -echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 -echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 -if test "${lt_cv_ld_reload_flag+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_ld_reload_flag='-r' -fi -echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 -reload_flag=$lt_cv_ld_reload_flag -test -n "$reload_flag" && reload_flag=" $reload_flag" - -echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 -echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 -if test "${lt_cv_path_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/${ac_tool_prefix}nm - if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then - lt_cv_path_NM="$tmp_nm -B" - break - elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - lt_cv_path_NM="$tmp_nm -p" - break - else - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - fi - fi - done - IFS="$ac_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi -fi - -NM="$lt_cv_path_NM" -echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6 - -echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else - echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6 -fi - -echo "$as_me:$LINENO: checking how to recognise dependant libraries" >&5 -echo $ECHO_N "checking how to recognise dependant libraries... $ECHO_C" >&6 -if test "${lt_cv_deplibs_check_method+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [regex]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given egrep regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi4*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin* | mingw* |pw32*) - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - # this will be overwritten by pass_all, but leave it in just in case - lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' - lt_cv_file_magic_cmd='/usr/bin/file -L' - case "$host_os" in - rhapsody* | darwin1.012) - lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System' - ;; - *) # Darwin 1.3 on - lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' - ;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | kfreebsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20*|hpux11*) - case $host_cpu in - hppa*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - esac - ;; - -irix5* | irix6*) - case $host_os in - irix5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" - ;; - *) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" - ;; - esac - lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux-gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$' - fi - ;; - -newsos6) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -osf3* | osf4* | osf5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' - lt_cv_file_magic_test_file=/shlib/libc.so - lt_cv_deplibs_check_method=pass_all - ;; - -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - lt_cv_file_magic_test_file=/lib/libc.so - ;; - -sysv5uw[78]* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - esac - ;; -esac - -fi -echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method - - - - -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! - -# find the maximum length of command line arguments -echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 -echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 -if test "${lt_cv_sys_max_cmd_len+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for *BSD - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - esac - -fi - -if test -n "$lt_cv_sys_max_cmd_len" ; then - echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 -echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 -else - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 -fi - - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MAGIC_CMD in - /*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; - ?:/*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. - ;; - *) - ac_save_MAGIC_CMD="$MAGIC_CMD" - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="/usr/bin:$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$ac_save_ifs" - MAGIC_CMD="$ac_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - echo "$as_me:$LINENO: checking for file" >&5 -echo $ECHO_N "checking for file... $ECHO_C" >&6 -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MAGIC_CMD in - /*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; - ?:/*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. - ;; - *) - ac_save_MAGIC_CMD="$MAGIC_CMD" - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="/usr/bin:$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$ac_save_ifs" - MAGIC_CMD="$ac_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - RANLIB=$ac_ct_RANLIB -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - STRIP=$ac_ct_STRIP -else - STRIP="$ac_cv_prog_STRIP" -fi - - -# Check for any special flags to pass to ltconfig. -libtool_flags="--cache-file=$cache_file" -test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" -test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" -test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" -test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc" -test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" - - -# Check whether --enable-libtool-lock or --disable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then - enableval="$enable_libtool_lock" - -fi; -test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" -test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" - - -# Check whether --with-pic or --without-pic was given. -if test "${with_pic+set}" = set; then - withval="$with_pic" - pic_mode="$withval" -else - pic_mode=default -fi; -test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic" -test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -*-*-irix6*) - # Find out which ABI we are using. - echo '#line 3870 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case "`/usr/bin/file conftest.o`" in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case "`/usr/bin/file conftest.o`" in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 -if test "${lt_cv_cc_needs_belf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - lt_cv_cc_needs_belf=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -lt_cv_cc_needs_belf=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 -echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; - - -esac - - -# Save cache, so that ltconfig can load it -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -{ - (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} | - sed ' - t clear - : clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -# Actually configure libtool. ac_aux_dir is where install-sh is found. -AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ -MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ -LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \ -AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \ -objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \ -deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \ -${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ -$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \ -|| { { echo "$as_me:$LINENO: error: libtool configure failed" >&5 -echo "$as_me: error: libtool configure failed" >&2;} - { (exit 1); exit 1; }; } - -# Reload cache, that may have been modified by ltconfig -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - -# Redirect the config.log output again, so that the ltconfig log is not -# clobbered by the next message. -exec 5>>./config.log - - - - - - - -# Check whether --enable-targets or --disable-targets was given. -if test "${enable_targets+set}" = set; then - enableval="$enable_targets" - case "${enableval}" in - yes | "") { { echo "$as_me:$LINENO: error: enable-targets option must specify target names or 'all'" >&5 -echo "$as_me: error: enable-targets option must specify target names or 'all'" >&2;} - { (exit 1); exit 1; }; } - ;; - no) enable_targets= ;; - *) enable_targets=$enableval ;; -esac -fi; # Check whether --enable-commonbfdlib or --disable-commonbfdlib was given. -if test "${enable_commonbfdlib+set}" = set; then - enableval="$enable_commonbfdlib" - case "${enableval}" in - yes) commonbfdlib=true ;; - no) commonbfdlib=false ;; - *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for BFD commonbfdlib option" >&5 -echo "$as_me: error: bad value ${enableval} for BFD commonbfdlib option" >&2;} - { (exit 1); exit 1; }; } ;; -esac -fi; - -GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" - -# Check whether --enable-werror or --disable-werror was given. -if test "${enable_werror+set}" = set; then - enableval="$enable_werror" - case "${enableval}" in - yes | y) ERROR_ON_WARNING="yes" ;; - no | n) ERROR_ON_WARNING="no" ;; - *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-werror" >&5 -echo "$as_me: error: bad value ${enableval} for --enable-werror" >&2;} - { (exit 1); exit 1; }; } ;; - esac -fi; - -# Enable -Werror by default when using gcc -if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then - ERROR_ON_WARNING=yes -fi - -NO_WERROR= -if test "${ERROR_ON_WARNING}" = yes ; then - GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" - NO_WERROR="-Wno-error" -fi - -if test "${GCC}" = yes ; then - WARN_CFLAGS="${GCC_WARN_CFLAGS}" -fi - -# Check whether --enable-build-warnings or --disable-build-warnings was given. -if test "${enable_build_warnings+set}" = set; then - enableval="$enable_build_warnings" - case "${enableval}" in - yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; - no) if test "${GCC}" = yes ; then - WARN_CFLAGS="-w" - fi;; - ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; - *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; - *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; -esac -fi; - -if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then - echo "Setting warning flags = $WARN_CFLAGS" 6>&1 -fi - - - - - - ac_config_headers="$ac_config_headers config.h:config.in" - - -if test -z "$target" ; then - { { echo "$as_me:$LINENO: error: Unrecognized target system type; please check config.sub." >&5 -echo "$as_me: error: Unrecognized target system type; please check config.sub." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "$host" ; then - { { echo "$as_me:$LINENO: error: Unrecognized host system type; please check config.sub." >&5 -echo "$as_me: error: Unrecognized host system type; please check config.sub." >&2;} - { (exit 1); exit 1; }; } -fi - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4980,6 +3964,6400 @@ _ACEOF + +macro_version='2.1a' +macro_revision='1.2435' + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Set options + +enable_dlopen=no + + +enable_win32_dll=no + + +# Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi; + + + + + + + + +# Check whether --enable-static or --disable-static was given. +if test "${enable_static+set}" = set; then + enableval="$enable_static" + p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi; + + + + + + + + + +# Check whether --with-pic or --without-pic was given. +if test "${with_pic+set}" = set; then + withval="$with_pic" + pic_mode="$withval" +else + pic_mode=default +fi; + +test -z "$pic_mode" && pic_mode=default + + + + + + + +# Check whether --enable-fast-install or --disable-fast-install was given. +if test "${enable_fast_install+set}" = set; then + enableval="$enable_fast_install" + p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi; + + + + + + + + +echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done + +fi + +SED=$lt_cv_path_SED + +echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6 + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +echo "$as_me:$LINENO: checking for fgrep" >&5 +echo $ECHO_N "checking for fgrep... $ECHO_C" >&6 +if test "${ac_cv_prog_fgrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo 'ab*c' | (grep -F 'ab*c') >/dev/null 2>&1 + then ac_cv_prog_fgrep='grep -F' + else ac_cv_prog_fgrep='fgrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_fgrep" >&5 +echo "${ECHO_T}$ac_cv_prog_fgrep" >&6 + FGREP=$ac_cv_prog_fgrep + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi; +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + + +echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5 +echo $ECHO_N "checking for BSD- or MS-compatible name lister (nm)... $ECHO_C" >&6 +if test "${lt_cv_path_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi +fi +echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6 +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$ac_tool_prefix"; then + for ac_prog in "dumpbin -symbols" "link -dump -symbols" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_DUMPBIN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + echo "$as_me:$LINENO: result: $DUMPBIN" >&5 +echo "${ECHO_T}$DUMPBIN" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in "dumpbin -symbols" "link -dump -symbols" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 +echo "${ECHO_T}$ac_ct_DUMPBIN" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_DUMPBIN" && break +done +test -n "$ac_ct_DUMPBIN" || ac_ct_DUMPBIN=":" + + DUMPBIN=$ac_ct_DUMPBIN +fi + + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 +echo $ECHO_N "checking the name lister ($NM) interface... $ECHO_C" >&6 +if test "${lt_cv_nm_interface+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:4499: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:4502: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:4505: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 +echo "${ECHO_T}$lt_cv_nm_interface" >&6 + +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + +# find the maximum length of command line arguments +echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`getconf ARG_MAX 2> /dev/null` + if test -n $lt_cv_sys_max_cmd_len; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 +else + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 +echo $ECHO_N "checking whether the shell understands some XSI constructs... $ECHO_C" >&6 +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, ) >/dev/null 2>&1 \ + && xsi_shell=yes +echo "$as_me:$LINENO: result: $xsi_shell" >&5 +echo "${ECHO_T}$xsi_shell" >&6 + + +echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 +echo $ECHO_N "checking whether the shell understands \"+=\"... $ECHO_C" >&6 +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +echo "$as_me:$LINENO: result: $lt_shell_append" >&5 +echo "${ECHO_T}$lt_shell_append" >&6 + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 +if test "${lt_cv_ld_reload_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_ld_reload_flag='-r' +fi +echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + + +echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 +echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6 +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AR=$ac_ct_AR +else + AR="$ac_cv_prog_AR" +fi + +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6 +else + echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6 +fi + + + + + + + + + + + + + + + + + +# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval="$enable_libtool_lock" + +fi; +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 5560 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 +if test "${lt_cv_cc_needs_belf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + lt_cv_cc_needs_belf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +lt_cv_cc_needs_belf=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_header in dlfcn.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6 +if test "${lt_cv_objdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$lt_cv_objdir" >&6 +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + + + + + + + + + + + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:6660: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:6664: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + if test "$host_cpu" = m68k; then + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + fi + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic='-qnocommon' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6 + + + + + + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:6982: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:6986: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 + +if test x"$lt_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works=yes + fi + else + lt_prog_compiler_static_works=yes + fi + fi + $RM conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 + +if test x"$lt_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7087: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:7091: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 + + + + + + + echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7142: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:7146: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +_LT_EOF + fi + ;; + + amigaos*) + if test "$host_cpu" = m68k; then + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + fi + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + *) + tmp_sharedflag='-shared' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + if test "$host_cpu" = m68k; then + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + fi + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[012]) + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + ;; + esac + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + if test "$GCC" = yes ; then + if test "${lt_cv_apple_cc_single_mod+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi-module to the + # link flags. + echo "int foo(void){return 1;}" > conftest.c + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib ${wl}-single_module conftest.c + if test -f libconftest.dylib; then + lt_cv_apple_cc_single_mod=yes + rm libconftest.dylib + fi + rm conftest.$ac_ext + fi +fi + + output_verbose_link_cmd=echo + if test "X$lt_cv_apple_cc_single_mod" = Xyes ; then + archive_cmds='$CC -dynamiclib $single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + archive_expsym_cmds='sed "s,^,_," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $single_module -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + archive_expsym_cmds='sed "s,^,_," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + module_expsym_cmds='sed -e "s,^,_," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd=echo + archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`$ECHO $rpath/$soname` $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed "s,^,_," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed "s,^,_," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat >conftest.$ac_ext <<_ACEOF +int foo(void) {} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6 +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6 + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +withGCC=$GCC +if test "$withGCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + if test "$host_cpu" = m68k; then + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + else + dynamic_linker=no + fi + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $withGCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[3-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir"; then + shlibpath_overrides_runpath=yes +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$hardcode_action" >&6 + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shl_load) || defined (__stub___shl_load) +choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dlopen) || defined (__stub___dlopen) +choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main () +{ +dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line 9939 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +_LT_EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line 10039 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +_LT_EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 + + echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 + + echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6 + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + +# Check whether --enable-targets or --disable-targets was given. +if test "${enable_targets+set}" = set; then + enableval="$enable_targets" + case "${enableval}" in + yes | "") { { echo "$as_me:$LINENO: error: enable-targets option must specify target names or 'all'" >&5 +echo "$as_me: error: enable-targets option must specify target names or 'all'" >&2;} + { (exit 1); exit 1; }; } + ;; + no) enable_targets= ;; + *) enable_targets=$enableval ;; +esac +fi; # Check whether --enable-commonbfdlib or --disable-commonbfdlib was given. +if test "${enable_commonbfdlib+set}" = set; then + enableval="$enable_commonbfdlib" + case "${enableval}" in + yes) commonbfdlib=true ;; + no) commonbfdlib=false ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for BFD commonbfdlib option" >&5 +echo "$as_me: error: bad value ${enableval} for BFD commonbfdlib option" >&2;} + { (exit 1); exit 1; }; } ;; +esac +fi; + +GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" + +# Check whether --enable-werror or --disable-werror was given. +if test "${enable_werror+set}" = set; then + enableval="$enable_werror" + case "${enableval}" in + yes | y) ERROR_ON_WARNING="yes" ;; + no | n) ERROR_ON_WARNING="no" ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-werror" >&5 +echo "$as_me: error: bad value ${enableval} for --enable-werror" >&2;} + { (exit 1); exit 1; }; } ;; + esac +fi; + +# Enable -Werror by default when using gcc +if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then + ERROR_ON_WARNING=yes +fi + +NO_WERROR= +if test "${ERROR_ON_WARNING}" = yes ; then + GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" + NO_WERROR="-Wno-error" +fi + +if test "${GCC}" = yes ; then + WARN_CFLAGS="${GCC_WARN_CFLAGS}" +fi + +# Check whether --enable-build-warnings or --disable-build-warnings was given. +if test "${enable_build_warnings+set}" = set; then + enableval="$enable_build_warnings" + case "${enableval}" in + yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; + no) if test "${GCC}" = yes ; then + WARN_CFLAGS="-w" + fi;; + ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` + WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; + *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` + WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; + *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; +esac +fi; + +if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then + echo "Setting warning flags = $WARN_CFLAGS" 6>&1 +fi + + + + + + ac_config_headers="$ac_config_headers config.h:config.in" + + +if test -z "$target" ; then + { { echo "$as_me:$LINENO: error: Unrecognized target system type; please check config.sub." >&5 +echo "$as_me: error: Unrecognized target system type; please check config.sub." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "$host" ; then + { { echo "$as_me:$LINENO: error: Unrecognized host system type; please check config.sub." >&5 +echo "$as_me: error: Unrecognized host system type; please check config.sub." >&2;} + { (exit 1); exit 1; }; } +fi + for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -5300,2479 +10678,138 @@ if test "$LEX" = :; then fi ALL_LINGUAS="fr tr ja es sv da zh_CN ru ro rw zh_TW fi vi" -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - RANLIB=$ac_ct_RANLIB -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep - - -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 -if test "${ac_cv_c_const+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset x; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *ccp; - char **p; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - ccp = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++ccp; - p = (char**) ccp; - ccp = (char const *const *) p; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - } -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_const=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_c_const=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6 -if test $ac_cv_c_const = no; then - -cat >>confdefs.h <<\_ACEOF -#define const -_ACEOF - -fi - -echo "$as_me:$LINENO: checking for inline" >&5 -echo $ECHO_N "checking for inline... $ECHO_C" >&6 -if test "${ac_cv_c_inline+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif - -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_inline=$ac_kw; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done - -fi -echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 -echo "${ECHO_T}$ac_cv_c_inline" >&6 - - -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6 -if test "${ac_cv_type_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((off_t *) 0) - return 0; -if (sizeof (off_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_off_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_off_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6 -if test $ac_cv_type_off_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define off_t long -_ACEOF - -fi - -echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6 -if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((size_t *) 0) - return 0; -if (sizeof (size_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_size_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_size_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6 -if test $ac_cv_type_size_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned -_ACEOF - -fi - -# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works -# for constant arguments. Useless! -echo "$as_me:$LINENO: checking for working alloca.h" >&5 -echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 -if test "${ac_cv_working_alloca_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -char *p = (char *) alloca (2 * sizeof (int)); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_working_alloca_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_working_alloca_h=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 -echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 -if test $ac_cv_working_alloca_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA_H 1 -_ACEOF - -fi - -echo "$as_me:$LINENO: checking for alloca" >&5 -echo $ECHO_N "checking for alloca... $ECHO_C" >&6 -if test "${ac_cv_func_alloca_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER -# include -# define alloca _alloca -# else -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -# endif -#endif - -int -main () -{ -char *p = (char *) alloca (1); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_alloca_works=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_alloca_works=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 -echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 - -if test $ac_cv_func_alloca_works = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA 1 -_ACEOF - -else - # The SVR3 libPW and SVR4 libucb both contain incompatible functions -# that cause trouble. Some versions do not even contain alloca or -# contain a buggy version. If you still want to use their alloca, -# use ar to extract alloca.o from them instead of compiling alloca.c. - -ALLOCA=alloca.$ac_objext - -cat >>confdefs.h <<\_ACEOF -#define C_ALLOCA 1 -_ACEOF - - -echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 -echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 -if test "${ac_cv_os_cray+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if defined(CRAY) && ! defined(CRAY2) -webecray -#else -wenotbecray -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then - ac_cv_os_cray=yes -else - ac_cv_os_cray=no -fi -rm -f conftest* - -fi -echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 -echo "${ECHO_T}$ac_cv_os_cray" >&6 -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - -cat >>confdefs.h <<_ACEOF -#define CRAY_STACKSEG_END $ac_func -_ACEOF - - break -fi - - done -fi - -echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 -echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 -if test "${ac_cv_c_stack_direction+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_c_stack_direction=0 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -find_stack_direction () -{ - static char *addr = 0; - auto char dummy; - if (addr == 0) - { - addr = &dummy; - return find_stack_direction (); - } - else - return (&dummy > addr) ? 1 : -1; -} - -int -main () -{ - exit (find_stack_direction () < 0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_stack_direction=1 -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_stack_direction=-1 -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 -echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 - -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -_ACEOF - - -fi - - - -for ac_header in stdlib.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_func in getpagesize -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -echo "$as_me:$LINENO: checking for working mmap" >&5 -echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 -if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_mmap_fixed_mapped=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -/* malloc might have been renamed as rpl_malloc. */ -#undef malloc - -/* Thanks to Mike Haertel and Jim Avera for this test. - Here is a matrix of mmap possibilities: - mmap private not fixed - mmap private fixed at somewhere currently unmapped - mmap private fixed at somewhere already mapped - mmap shared not fixed - mmap shared fixed at somewhere currently unmapped - mmap shared fixed at somewhere already mapped - For private mappings, we should verify that changes cannot be read() - back from the file, nor mmap's back from the file at a different - address. (There have been systems where private was not correctly - implemented like the infamous i386 svr4.0, and systems where the - VM page cache was not coherent with the file system buffer cache - like early versions of FreeBSD and possibly contemporary NetBSD.) - For shared mappings, we should conversely verify that changes get - propagated back to all the places they're supposed to be. - - Grep wants private fixed already mapped. - The main things grep needs to know about mmap are: - * does it exist and is it safe to write into the mmap'd area - * how to use it (BSD variants) */ - -#include -#include - -#if !STDC_HEADERS && !HAVE_STDLIB_H -char *malloc (); -#endif - -/* This mess was copied from the GNU getpagesize.h. */ -#if !HAVE_GETPAGESIZE -/* Assume that all systems that can run configure have sys/param.h. */ -# if !HAVE_SYS_PARAM_H -# define HAVE_SYS_PARAM_H 1 -# endif - -# ifdef _SC_PAGESIZE -# define getpagesize() sysconf(_SC_PAGESIZE) -# else /* no _SC_PAGESIZE */ -# if HAVE_SYS_PARAM_H -# include -# ifdef EXEC_PAGESIZE -# define getpagesize() EXEC_PAGESIZE -# else /* no EXEC_PAGESIZE */ -# ifdef NBPG -# define getpagesize() NBPG * CLSIZE -# ifndef CLSIZE -# define CLSIZE 1 -# endif /* no CLSIZE */ -# else /* no NBPG */ -# ifdef NBPC -# define getpagesize() NBPC -# else /* no NBPC */ -# ifdef PAGESIZE -# define getpagesize() PAGESIZE -# endif /* PAGESIZE */ -# endif /* no NBPC */ -# endif /* no NBPG */ -# endif /* no EXEC_PAGESIZE */ -# else /* no HAVE_SYS_PARAM_H */ -# define getpagesize() 8192 /* punt totally */ -# endif /* no HAVE_SYS_PARAM_H */ -# endif /* no _SC_PAGESIZE */ - -#endif /* no HAVE_GETPAGESIZE */ - -int -main () -{ - char *data, *data2, *data3; - int i, pagesize; - int fd; - - pagesize = getpagesize (); - - /* First, make a file with some known garbage in it. */ - data = (char *) malloc (pagesize); - if (!data) - exit (1); - for (i = 0; i < pagesize; ++i) - *(data + i) = rand (); - umask (0); - fd = creat ("conftest.mmap", 0600); - if (fd < 0) - exit (1); - if (write (fd, data, pagesize) != pagesize) - exit (1); - close (fd); - - /* Next, try to mmap the file at a fixed address which already has - something else allocated at it. If we can, also make sure that - we see the same garbage. */ - fd = open ("conftest.mmap", O_RDWR); - if (fd < 0) - exit (1); - data2 = (char *) malloc (2 * pagesize); - if (!data2) - exit (1); - data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); - if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_FIXED, fd, 0L)) - exit (1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data2 + i)) - exit (1); - - /* Finally, make sure that changes to the mapped area do not - percolate back to the file as seen by read(). (This is a bug on - some variants of i386 svr4.0.) */ - for (i = 0; i < pagesize; ++i) - *(data2 + i) = *(data2 + i) + 1; - data3 = (char *) malloc (pagesize); - if (!data3) - exit (1); - if (read (fd, data3, pagesize) != pagesize) - exit (1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data3 + i)) - exit (1); - close (fd); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_mmap_fixed_mapped=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_mmap_fixed_mapped=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 -echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 -if test $ac_cv_func_mmap_fixed_mapped = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MMAP 1 -_ACEOF - -fi -rm -f conftest.mmap - - - - - - - - - - - -for ac_header in argz.h limits.h locale.h nl_types.h malloc.h string.h \ -unistd.h values.h sys/param.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - - - - - - -for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \ -__argz_count __argz_stringify __argz_next -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - if test "${ac_cv_func_stpcpy+set}" != "set"; then - -for ac_func in stpcpy -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - fi - if test "${ac_cv_func_stpcpy}" = "yes"; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STPCPY 1 -_ACEOF - - fi - - if test $ac_cv_header_locale_h = yes; then - echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 -echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6 -if test "${am_cv_val_LC_MESSAGES+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -return LC_MESSAGES - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - am_cv_val_LC_MESSAGES=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -am_cv_val_LC_MESSAGES=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5 -echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6 - if test $am_cv_val_LC_MESSAGES = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LC_MESSAGES 1 -_ACEOF - - fi - fi - echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +# If we haven't got the data from the intl directory, +# assume NLS is disabled. +USE_NLS=no +LIBINTL= +LIBINTL_DEP= +INCINTL= +XGETTEXT= +GMSGFMT= +POSUB= + +if test -f ../intl/config.intl; then + . ../intl/config.intl +fi +echo "$as_me:$LINENO: checking whether NLS is requested" >&5 echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 - # Check whether --enable-nls or --disable-nls was given. +if test x"$USE_NLS" != xyes; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_NLS 1 +_ACEOF + + + echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 +echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 + # Look for .po and .gmo files in the source directory. + CATALOGS= + XLINGUAS= + for cat in $srcdir/po/*.gmo $srcdir/po/*.po; do + # If there aren't any .gmo files the shell will give us the + # literal string "../path/to/srcdir/po/*.gmo" which has to be + # weeded out. + case "$cat" in *\**) + continue;; + esac + # The quadruple backslash is collapsed to a double backslash + # by the backticks, then collapsed again by the double quotes, + # leaving us with one backslash in the sed expression (right + # before the dot that mustn't act as a wildcard). + cat=`echo $cat | sed -e "s!$srcdir/po/!!" -e "s!\\\\.po!.gmo!"` + lang=`echo $cat | sed -e "s!\\\\.gmo!!"` + # The user is allowed to set LINGUAS to a list of languages to + # install catalogs for. If it's empty that means "all of them." + if test "x$LINGUAS" = x; then + CATALOGS="$CATALOGS $cat" + XLINGUAS="$XLINGUAS $lang" + else + case "$LINGUAS" in *$lang*) + CATALOGS="$CATALOGS $cat" + XLINGUAS="$XLINGUAS $lang" + ;; + esac + fi + done + LINGUAS="$XLINGUAS" + echo "$as_me:$LINENO: result: $LINGUAS" >&5 +echo "${ECHO_T}$LINGUAS" >&6 + + + DATADIRNAME=share + + INSTOBJEXT=.mo + + GENCAT=gencat + + CATOBJEXT=.gmo + +fi + + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + case "$ac_aux_dir" in + /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; + *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; + esac + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + + + + echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 + # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" USE_NLS=$enableval else USE_NLS=yes fi; - echo "$as_me:$LINENO: result: $USE_NLS" >&5 + echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6 - USE_INCLUDED_LIBINTL=no - if test "$USE_NLS" = "yes"; then - echo "$as_me:$LINENO: checking whether included gettext is requested" >&5 -echo $ECHO_N "checking whether included gettext is requested... $ECHO_C" >&6 -# Check whether --with-included-gettext or --without-included-gettext was given. -if test "${with_included_gettext+set}" = set; then - withval="$with_included_gettext" - nls_cv_force_use_gnu_gettext=$withval -else - nls_cv_force_use_gnu_gettext=no -fi; - echo "$as_me:$LINENO: result: $nls_cv_force_use_gnu_gettext" >&5 -echo "${ECHO_T}$nls_cv_force_use_gnu_gettext" >&6 - nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" - if test "$nls_cv_force_use_gnu_gettext" != "yes"; then - nls_cv_header_intl= - nls_cv_header_libgt= - CATOBJEXT= - if test "${ac_cv_header_libintl_h+set}" = set; then - echo "$as_me:$LINENO: checking for libintl.h" >&5 -echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6 -if test "${ac_cv_header_libintl_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 -echo "${ECHO_T}$ac_cv_header_libintl_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking libintl.h usability" >&5 -echo $ECHO_N "checking libintl.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking libintl.h presence" >&5 -echo $ECHO_N "checking libintl.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' else - ac_cpp_err= + PATH_SEPARATOR=: fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" else - ac_cpp_err=yes + ac_executable_p="test -f" fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +rm -f conf$$.file - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: libintl.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: libintl.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: libintl.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: libintl.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: libintl.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: libintl.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for libintl.h" >&5 -echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6 -if test "${ac_cv_header_libintl_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_libintl_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 -echo "${ECHO_T}$ac_cv_header_libintl_h" >&6 - -fi -if test $ac_cv_header_libintl_h = yes; then - echo "$as_me:$LINENO: checking for gettext in libc" >&5 -echo $ECHO_N "checking for gettext in libc... $ECHO_C" >&6 -if test "${gt_cv_func_gettext_libc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -return (int) gettext ("") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gt_cv_func_gettext_libc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gt_cv_func_gettext_libc=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $gt_cv_func_gettext_libc" >&5 -echo "${ECHO_T}$gt_cv_func_gettext_libc" >&6 - - if test "$gt_cv_func_gettext_libc" != "yes"; then - echo "$as_me:$LINENO: checking for bindtextdomain in -lintl" >&5 -echo $ECHO_N "checking for bindtextdomain in -lintl... $ECHO_C" >&6 -if test "${ac_cv_lib_intl_bindtextdomain+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lintl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char bindtextdomain (); -int -main () -{ -bindtextdomain (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_intl_bindtextdomain=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_intl_bindtextdomain=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_intl_bindtextdomain" >&5 -echo "${ECHO_T}$ac_cv_lib_intl_bindtextdomain" >&6 -if test $ac_cv_lib_intl_bindtextdomain = yes; then - echo "$as_me:$LINENO: checking for gettext in libintl" >&5 -echo $ECHO_N "checking for gettext in libintl... $ECHO_C" >&6 -if test "${gt_cv_func_gettext_libintl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -return (int) gettext ("") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gt_cv_func_gettext_libintl=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gt_cv_func_gettext_libintl=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $gt_cv_func_gettext_libintl" >&5 -echo "${ECHO_T}$gt_cv_func_gettext_libintl" >&6 -fi - - fi - - if test "$gt_cv_func_gettext_libc" = "yes" \ - || test "$gt_cv_func_gettext_libintl" = "yes"; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_GETTEXT 1 -_ACEOF - - # Extract the first word of "msgfmt", so it can be a program name with args. +# Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -7780,308 +10817,31 @@ if test "${ac_cv_path_MSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in - /*) - ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then - ac_cv_path_MSGFMT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" - ;; -esac -fi -MSGFMT="$ac_cv_path_MSGFMT" -if test -n "$MSGFMT"; then - echo "$as_me:$LINENO: result: $MSGFMT" >&5 -echo "${ECHO_T}$MSGFMT" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - if test "$MSGFMT" != "no"; then - -for ac_func in dcgettext -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - # Extract the first word of "gmsgfmt", so it can be a program name with args. -set dummy gmsgfmt; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_GMSGFMT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $GMSGFMT in [\\/]* | ?:[\\/]*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. - ;; + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" - ;; -esac -fi -GMSGFMT=$ac_cv_path_GMSGFMT - -if test -n "$GMSGFMT"; then - echo "$as_me:$LINENO: result: $GMSGFMT" >&5 -echo "${ECHO_T}$GMSGFMT" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - # Extract the first word of "xgettext", so it can be a program name with args. -set dummy xgettext; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_XGETTEXT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case "$XGETTEXT" in - /*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then - ac_cv_path_XGETTEXT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" - ;; -esac -fi -XGETTEXT="$ac_cv_path_XGETTEXT" -if test -n "$XGETTEXT"; then - echo "$as_me:$LINENO: result: $XGETTEXT" >&5 -echo "${ECHO_T}$XGETTEXT" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -extern int _nl_msg_cat_cntr; - return _nl_msg_cat_cntr - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - CATOBJEXT=.gmo - DATADIRNAME=share -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -CATOBJEXT=.mo - DATADIRNAME=lib -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - INSTOBJEXT=.mo - fi - fi - -fi - - - - - if test x"$CATOBJEXT" = x && test -d $srcdir/../intl; then - # Neither gettext nor catgets in included in the C library. - # Fall back on GNU gettext library (assuming it is present). - nls_cv_use_gnu_gettext=yes + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi fi - fi - - if test "$nls_cv_use_gnu_gettext" = "yes"; then - INTLOBJS="\$(GETTOBJS)" - # Extract the first word of "msgfmt", so it can be a program name with args. -set dummy msgfmt; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_MSGFMT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case "$MSGFMT" in - /*) - ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then - ac_cv_path_MSGFMT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="msgfmt" - ;; + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" -if test -n "$MSGFMT"; then +if test "$MSGFMT" != ":"; then echo "$as_me:$LINENO: result: $MSGFMT" >&5 echo "${ECHO_T}$MSGFMT" >&6 else @@ -8089,7 +10849,7 @@ else echo "${ECHO_T}no" >&6 fi - # Extract the first word of "gmsgfmt", so it can be a program name with args. + # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -8129,7 +10889,37 @@ else echo "${ECHO_T}no" >&6 fi - # Extract the first word of "xgettext", so it can be a program name with args. + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -8137,27 +10927,31 @@ if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in - /*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then - ac_cv_path_XGETTEXT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" - ;; + ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" -if test -n "$XGETTEXT"; then +if test "$XGETTEXT" != ":"; then echo "$as_me:$LINENO: result: $XGETTEXT" >&5 echo "${ECHO_T}$XGETTEXT" >&6 else @@ -8165,284 +10959,105 @@ else echo "${ECHO_T}no" >&6 fi - - USE_INCLUDED_LIBINTL=yes - CATOBJEXT=.gmo - INSTOBJEXT=.mo - DATADIRNAME=share - INTLDEPS='$(top_builddir)/../intl/libintl.a' - INTLLIBS=$INTLDEPS - LIBS=`echo $LIBS | sed -e 's/-lintl//'` - nls_cv_header_intl=libintl.h - nls_cv_header_libgt=libgettext.h - fi - - if test "$XGETTEXT" != ":"; then - if $XGETTEXT --omit-header /dev/null 2> /dev/null; then - : ; - else - echo "$as_me:$LINENO: result: found xgettext programs is not GNU xgettext; ignore it" >&5 -echo "${ECHO_T}found xgettext programs is not GNU xgettext; ignore it" >&6 - XGETTEXT=":" - fi - fi - - # We need to process the po/ directory. - POSUB=po - else - DATADIRNAME=share - nls_cv_header_intl=libintl.h - nls_cv_header_libgt=libgettext.h - fi - - # If this is used in GNU gettext we have to set USE_NLS to `yes' - # because some of the sources are only built for this goal. - if test "$PACKAGE" = gettext; then - USE_NLS=yes - USE_INCLUDED_LIBINTL=yes - fi - - for lang in $ALL_LINGUAS; do - GMOFILES="$GMOFILES $lang.gmo" - POFILES="$POFILES $lang.po" - done + rm -f messages.po - - - - - - - - - - - if test "x$CATOBJEXT" != "x"; then - -cat >>confdefs.h <<\_ACEOF -#define ENABLE_NLS 1 -_ACEOF - - fi - - - if test "x$CATOBJEXT" != "x"; then - if test "x$ALL_LINGUAS" = "x"; then - LINGUAS= - else - echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 -echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 - NEW_LINGUAS= - for lang in ${LINGUAS=$ALL_LINGUAS}; do - case "$ALL_LINGUAS" in - *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; - esac - done - LINGUAS=$NEW_LINGUAS - echo "$as_me:$LINENO: result: $LINGUAS" >&5 -echo "${ECHO_T}$LINGUAS" >&6 - fi - - if test -n "$LINGUAS"; then - for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done - fi - fi - - if test $ac_cv_header_locale_h = yes; then - INCLUDE_LOCALE_H="#include " - else - INCLUDE_LOCALE_H="\ -/* The system does not provide the header . Take care yourself. */" - fi - - - if test -f $srcdir/po2tbl.sed.in; then - if test "$CATOBJEXT" = ".cat"; then - if test "${ac_cv_header_linux_version_h+set}" = set; then - echo "$as_me:$LINENO: checking for linux/version.h" >&5 -echo $ECHO_N "checking for linux/version.h... $ECHO_C" >&6 -if test "${ac_cv_header_linux_version_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_linux_version_h" >&5 -echo "${ECHO_T}$ac_cv_header_linux_version_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking linux/version.h usability" >&5 -echo $ECHO_N "checking linux/version.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking linux/version.h presence" >&5 -echo $ECHO_N "checking linux/version.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' else - ac_cpp_err= + PATH_SEPARATOR=: fi -else - ac_cpp_err=yes + rm -f conf$$.sh fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no + ac_executable_p="test -f" fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +rm -f conf$$.file -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: linux/version.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: linux/version.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: linux/version.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes +# Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MSGMERGE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case "$MSGMERGE" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: linux/version.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: linux/version.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: linux/version.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: linux/version.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: linux/version.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: linux/version.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: linux/version.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac -echo "$as_me:$LINENO: checking for linux/version.h" >&5 -echo $ECHO_N "checking for linux/version.h... $ECHO_C" >&6 -if test "${ac_cv_header_linux_version_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + echo "$as_me:$LINENO: result: $MSGMERGE" >&5 +echo "${ECHO_T}$MSGMERGE" >&6 else - ac_cv_header_linux_version_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_linux_version_h" >&5 -echo "${ECHO_T}$ac_cv_header_linux_version_h" >&6 - -fi -if test $ac_cv_header_linux_version_h = yes; then - msgformat=linux -else - msgformat=xopen + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi + if test "$GMSGFMT" != ":"; then + if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && + (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` + echo "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 +echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6 + GMSGFMT=":" + fi + fi - sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed - fi - sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ - $srcdir/po2tbl.sed.in > po2tbl.sed - fi + if test "$XGETTEXT" != ":"; then + if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 +echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6 + XGETTEXT=":" + fi + rm -f messages.po + fi - if test "$PACKAGE" = "gettext"; then - GT_NO="#NO#" - GT_YES= - else - GT_NO= - GT_YES="#YES#" - fi + ac_config_commands="$ac_config_commands default-1" - MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs" - - - l= - - - if test -f $srcdir/po/POTFILES.in; then - test -d po || mkdir po - if test "x$srcdir" != "x."; then - if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then - posrcprefix="$srcdir/" - else - posrcprefix="../$srcdir/" - fi - else - posrcprefix="../" - fi - rm -f po/POTFILES - sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ - < $srcdir/po/POTFILES.in > po/POTFILES - fi - - echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. @@ -8468,6 +11083,16 @@ fi + +if false; then + GENINSRC_NEVER_TRUE= + GENINSRC_NEVER_FALSE='#' +else + GENINSRC_NEVER_TRUE='#' + GENINSRC_NEVER_FALSE= +fi + + if test -n "$EXEEXT"; then cat >>confdefs.h <<\_ACEOF @@ -8701,7 +11326,9 @@ esac -for ac_header in string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h + + +for ac_header in string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h sys/param.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -9386,6 +12013,202 @@ _ACEOF fi done +echo "$as_me:$LINENO: checking for mkstemp" >&5 +echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6 +if test "${ac_cv_func_mkstemp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define mkstemp to an innocuous variant, in case declares mkstemp. + For example, HP-UX 11i declares gettimeofday. */ +#define mkstemp innocuous_mkstemp + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char mkstemp (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef mkstemp + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char mkstemp (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_mkstemp) || defined (__stub___mkstemp) +choke me +#else +char (*f) () = mkstemp; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != mkstemp; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_mkstemp=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_mkstemp=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_mkstemp" >&5 +echo "${ECHO_T}$ac_cv_func_mkstemp" >&6 +if test $ac_cv_func_mkstemp = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MKSTEMP 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for mkdtemp" >&5 +echo $ECHO_N "checking for mkdtemp... $ECHO_C" >&6 +if test "${ac_cv_func_mkdtemp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define mkdtemp to an innocuous variant, in case declares mkdtemp. + For example, HP-UX 11i declares gettimeofday. */ +#define mkdtemp innocuous_mkdtemp + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char mkdtemp (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef mkdtemp + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char mkdtemp (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_mkdtemp) || defined (__stub___mkdtemp) +choke me +#else +char (*f) () = mkdtemp; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != mkdtemp; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_mkdtemp=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_mkdtemp=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_mkdtemp" >&5 +echo "${ECHO_T}$ac_cv_func_mkdtemp" >&6 +if test $ac_cv_func_mkdtemp = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MKDTEMP 1 +_ACEOF + +fi + # Check whether fopen64 is available and whether _LARGEFILE64_SOURCE # needs to be defined for it @@ -10660,15 +13483,944 @@ if test -n "$enable_targets"; then done fi +if test "${ac_cv_header_iconv_h+set}" = set; then + echo "$as_me:$LINENO: checking for iconv.h" >&5 +echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6 +if test "${ac_cv_header_iconv_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5 +echo "${ECHO_T}$ac_cv_header_iconv_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking iconv.h usability" >&5 +echo $ECHO_N "checking iconv.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking iconv.h presence" >&5 +echo $ECHO_N "checking iconv.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: iconv.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: iconv.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: iconv.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: iconv.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: iconv.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: iconv.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: iconv.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: iconv.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: iconv.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: iconv.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: iconv.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: iconv.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for iconv.h" >&5 +echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6 +if test "${ac_cv_header_iconv_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_iconv_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5 +echo "${ECHO_T}$ac_cv_header_iconv_h" >&6 + +fi + + + + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi; +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by GCC" >&5 +echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${acl_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$acl_cv_path_LD" +if test -n "$LD"; then + echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${acl_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 &5; then + acl_cv_prog_gnu_ld=yes +else + acl_cv_prog_gnu_ld=no +fi +fi +echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5 +echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6 +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + echo "$as_me:$LINENO: checking for shared library run path origin" >&5 +echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6 +if test "${acl_cv_rpath+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + +fi +echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 +echo "${ECHO_T}$acl_cv_rpath" >&6 + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + # Check whether --enable-rpath or --disable-rpath was given. +if test "${enable_rpath+set}" = set; then + enableval="$enable_rpath" + : +else + enable_rpath=yes +fi; + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. +if test "${with_libiconv_prefix+set}" = set; then + withval="$with_libiconv_prefix" + + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + +fi; + LIBICONV= + LTLIBICONV= + INCICONV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done + fi + + + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + echo "$as_me:$LINENO: checking for iconv" >&5 +echo $ECHO_N "checking for iconv... $ECHO_C" >&6 +if test "${am_cv_func_iconv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_func_iconv=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + +fi +echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 +echo "${ECHO_T}$am_cv_func_iconv" >&6 + if test "$am_cv_func_iconv" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ICONV 1 +_ACEOF + + fi + if test "$am_cv_lib_iconv" = yes; then + echo "$as_me:$LINENO: checking how to link with libiconv" >&5 +echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: $LIBICONV" >&5 +echo "${ECHO_T}$LIBICONV" >&6 + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + if test "$am_cv_func_iconv" = yes; then + echo "$as_me:$LINENO: checking for iconv declaration" >&5 +echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6 + if test "${am_cv_proto_iconv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_proto_iconv_arg1="" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +am_cv_proto_iconv_arg1="const" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" +fi + + am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + echo "$as_me:$LINENO: result: ${ac_t:- + }$am_cv_proto_iconv" >&5 +echo "${ECHO_T}${ac_t:- + }$am_cv_proto_iconv" >&6 + +cat >>confdefs.h <<_ACEOF +#define ICONV_CONST $am_cv_proto_iconv_arg1 +_ACEOF + + fi + + all_targets=false BUILD_NLMCONV= NLMCONV_DEFS= BUILD_SRCONV= BUILD_DLLTOOL= DLLTOOL_DEFS= +DLLTOOL_DEFAULT= BUILD_WINDRES= +BUILD_WINDMC= BUILD_DLLWRAP= BUILD_MISC= +BUILD_INSTALL_MISC= OBJDUMP_DEFS= for targ in $target $canon_targets @@ -10678,6 +14430,7 @@ do BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' BUILD_SRCONV='$(SRCONV_PROG)' NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC" + BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)' else case $targ in i[3-7]86*-*-netware*) @@ -10703,27 +14456,65 @@ do case $targ in arm-epoc-pe*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' ;; - arm-*-pe* | arm-*-wince) + arm-wince-pe* | arm-*-wince) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_WINCE" + fi + DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM" + BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + ;; + arm-*-pe*) + BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' ;; thumb-*-pe*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + ;; + x86_64-*-mingw*) + BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64" + fi + DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64" + BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)' ;; i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)' ;; i[3-7]86-*-interix) BUILD_DLLTOOL='$(DLLTOOL_PROG)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386" ;; powerpc*-aix5.[01]) @@ -10733,36 +14524,72 @@ do ;; powerpc*-*-pe* | powerpc*-*-cygwin*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + ;; + powerpc*-*-linux* | powerpc*-*-elf*) + BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu" ;; sh*-*-pe) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_SH" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + ;; + spu-*-*) + BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)' ;; mips*-*-pe) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' ;; mcore-*-pe) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' ;; mcore-*-elf) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE_ELF" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF" ;; + mep-*) + OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0" + ;; esac fi done +DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT" + if test "${with_windres+set}" = set; then BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' fi +if test "${with_windmc+set}" = set; then + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' +fi + + + @@ -10818,7 +14645,6 @@ done ac_config_files="$ac_config_files Makefile doc/Makefile po/Makefile.in:po/Make-in" - ac_config_commands="$ac_config_commands default" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -10931,6 +14757,13 @@ echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${GENINSRC_NEVER_TRUE}" && test -z "${GENINSRC_NEVER_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"GENINSRC_NEVER\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"GENINSRC_NEVER\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files @@ -11366,6 +15199,254 @@ cat >>$CONFIG_STATUS <<_ACEOF AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' +macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' +enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' +pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' +host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' +host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' +host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' +build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' +build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' +build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' +SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' +Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' +GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' +EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' +FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' +LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' +NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' +LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' +ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' +exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' +lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' +reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' +AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' +STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' +RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' +compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' +GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' +objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' +SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' +ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' +need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' +libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' +version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' +runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' +libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' +soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' +old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' +striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +AR \ +AR_FLAGS \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +SHELL \ +ECHO \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_wl \ +lt_prog_compiler_pic \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_flag_spec_ld \ +hardcode_libdir_separator \ +fix_srcfile_path \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` + ;; +esac + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + +# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it + # from automake. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + + _ACEOF @@ -11379,7 +15460,8 @@ do "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in:po/Make-in" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + "libtool" ) CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} @@ -11516,55 +15598,65 @@ s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@LIBTOOL@,$LIBTOOL,;t t +s,@SED@,$SED,;t t +s,@EGREP@,$EGREP,;t t +s,@FGREP@,$FGREP,;t t +s,@GREP@,$GREP,;t t +s,@LD@,$LD,;t t +s,@DUMPBIN@,$DUMPBIN,;t t +s,@ac_ct_DUMPBIN@,$ac_ct_DUMPBIN,;t t +s,@NM@,$NM,;t t s,@LN_S@,$LN_S,;t t +s,@AR@,$AR,;t t +s,@ac_ct_AR@,$ac_ct_AR,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@LIBTOOL@,$LIBTOOL,;t t +s,@lt_ECHO@,$lt_ECHO,;t t +s,@CPP@,$CPP,;t t s,@WARN_CFLAGS@,$WARN_CFLAGS,;t t s,@NO_WERROR@,$NO_WERROR,;t t s,@YACC@,$YACC,;t t s,@LEX@,$LEX,;t t s,@LEXLIB@,$LEXLIB,;t t s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@ALLOCA@,$ALLOCA,;t t s,@USE_NLS@,$USE_NLS,;t t -s,@MSGFMT@,$MSGFMT,;t t -s,@GMSGFMT@,$GMSGFMT,;t t +s,@LIBINTL@,$LIBINTL,;t t +s,@LIBINTL_DEP@,$LIBINTL_DEP,;t t +s,@INCINTL@,$INCINTL,;t t s,@XGETTEXT@,$XGETTEXT,;t t -s,@USE_INCLUDED_LIBINTL@,$USE_INCLUDED_LIBINTL,;t t -s,@CATALOGS@,$CATALOGS,;t t -s,@CATOBJEXT@,$CATOBJEXT,;t t -s,@DATADIRNAME@,$DATADIRNAME,;t t -s,@GMOFILES@,$GMOFILES,;t t -s,@INSTOBJEXT@,$INSTOBJEXT,;t t -s,@INTLDEPS@,$INTLDEPS,;t t -s,@INTLLIBS@,$INTLLIBS,;t t -s,@INTLOBJS@,$INTLOBJS,;t t -s,@POFILES@,$POFILES,;t t +s,@GMSGFMT@,$GMSGFMT,;t t s,@POSUB@,$POSUB,;t t -s,@INCLUDE_LOCALE_H@,$INCLUDE_LOCALE_H,;t t -s,@GT_NO@,$GT_NO,;t t -s,@GT_YES@,$GT_YES,;t t +s,@CATALOGS@,$CATALOGS,;t t +s,@DATADIRNAME@,$DATADIRNAME,;t t +s,@INSTOBJEXT@,$INSTOBJEXT,;t t +s,@GENCAT@,$GENCAT,;t t +s,@CATOBJEXT@,$CATOBJEXT,;t t s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t -s,@l@,$l,;t t +s,@MSGFMT@,$MSGFMT,;t t +s,@MSGMERGE@,$MSGMERGE,;t t s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t s,@MAINT@,$MAINT,;t t +s,@GENINSRC_NEVER_TRUE@,$GENINSRC_NEVER_TRUE,;t t +s,@GENINSRC_NEVER_FALSE@,$GENINSRC_NEVER_FALSE,;t t s,@HDEFINES@,$HDEFINES,;t t -s,@AR@,$AR,;t t s,@CC_FOR_BUILD@,$CC_FOR_BUILD,;t t s,@EXEEXT_FOR_BUILD@,$EXEEXT_FOR_BUILD,;t t s,@DEMANGLER_NAME@,$DEMANGLER_NAME,;t t +s,@ALLOCA@,$ALLOCA,;t t +s,@LIBICONV@,$LIBICONV,;t t +s,@LTLIBICONV@,$LTLIBICONV,;t t s,@NLMCONV_DEFS@,$NLMCONV_DEFS,;t t s,@BUILD_NLMCONV@,$BUILD_NLMCONV,;t t s,@BUILD_SRCONV@,$BUILD_SRCONV,;t t s,@BUILD_DLLTOOL@,$BUILD_DLLTOOL,;t t s,@DLLTOOL_DEFS@,$DLLTOOL_DEFS,;t t s,@BUILD_WINDRES@,$BUILD_WINDRES,;t t +s,@BUILD_WINDMC@,$BUILD_WINDMC,;t t s,@BUILD_DLLWRAP@,$BUILD_DLLWRAP,;t t s,@BUILD_MISC@,$BUILD_MISC,;t t +s,@BUILD_INSTALL_MISC@,$BUILD_INSTALL_MISC,;t t s,@OBJDUMP_DEFS@,$OBJDUMP_DEFS,;t t s,@EMULATION@,$EMULATION,;t t s,@EMULATION_VECTOR@,$EMULATION_VECTOR,;t t @@ -12255,11 +16347,656 @@ echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} done done ;; - default ) -case "x$CONFIG_FILES" in -*) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;; + libtool ) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me (GNU $PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007 Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# 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 2 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, a copy can be downloaded from +# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that does not interpret backslashes. +ECHO=$lt_ECHO + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[^=]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} +_LT_EOF esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=\$$1\$2" +} +_LT_EOF + ;; + esac + + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + ;; + default-1 ) + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assigment from automake. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + GMOFILES= + UPDATEPOFILES= + DUMMYPOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done ;; esac done _ACEOF diff --git a/binutils/configure.in b/binutils/configure.in index 10afc537441..19aaabc8678 100644 --- a/binutils/configure.in +++ b/binutils/configure.in @@ -11,7 +11,9 @@ BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${ changequote([,])dnl AM_INIT_AUTOMAKE(binutils, ${BFD_VERSION}) -AM_PROG_LIBTOOL +AC_PROG_CC +AC_GNU_SOURCE +AC_PROG_LIBTOOL AC_ARG_ENABLE(targets, [ --enable-targets alternative target configurations], @@ -40,16 +42,15 @@ if test -z "$host" ; then AC_MSG_ERROR(Unrecognized host system type; please check config.sub.) fi -AC_PROG_CC -AC_GNU_SOURCE - AC_PROG_YACC AM_PROG_LEX ALL_LINGUAS="fr tr ja es sv da zh_CN ru ro rw zh_TW fi vi" -CY_GNU_GETTEXT +ZW_GNU_GETTEXT_SISTER_DIR +AM_PO_SUBDIRS AM_MAINTAINER_MODE +AM_CONDITIONAL(GENINSRC_NEVER, false) AC_EXEEXT if test -n "$EXEEXT"; then AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1, @@ -79,10 +80,16 @@ case "${host}" in esac AC_SUBST(DEMANGLER_NAME) -AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h) +AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h sys/param.h) AC_HEADER_SYS_WAIT AC_FUNC_ALLOCA AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll) +AC_CHECK_FUNC([mkstemp], + AC_DEFINE([HAVE_MKSTEMP], 1, + [Define to 1 if you have the `mkstemp' function.])) +AC_CHECK_FUNC([mkdtemp], + AC_DEFINE([HAVE_MKDTEMP], 1, + [Define to 1 if you have the `mkdtemp' function.])) # Check whether fopen64 is available and whether _LARGEFILE64_SOURCE # needs to be defined for it @@ -193,15 +200,21 @@ if test -n "$enable_targets"; then done fi +AC_CHECK_HEADER(iconv.h) +AM_ICONV + all_targets=false BUILD_NLMCONV= NLMCONV_DEFS= BUILD_SRCONV= BUILD_DLLTOOL= DLLTOOL_DEFS= +DLLTOOL_DEFAULT= BUILD_WINDRES= +BUILD_WINDMC= BUILD_DLLWRAP= BUILD_MISC= +BUILD_INSTALL_MISC= OBJDUMP_DEFS= for targ in $target $canon_targets @@ -211,6 +224,7 @@ do BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' BUILD_SRCONV='$(SRCONV_PROG)' NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC" + BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)' else case $targ in changequote(,)dnl @@ -238,31 +252,69 @@ changequote([,])dnl case $targ in arm-epoc-pe*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' ;; - arm-*-pe* | arm-*-wince) + arm-wince-pe* | arm-*-wince) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_WINCE" + fi + DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM" + BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + ;; + arm-*-pe*) + BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' ;; thumb-*-pe*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + ;; + x86_64-*-mingw*) + BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64" + fi + DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64" + BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)' ;; changequote(,)dnl i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*) changequote([,])dnl BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)' ;; changequote(,)dnl i[3-7]86-*-interix) changequote([,])dnl BUILD_DLLTOOL='$(DLLTOOL_PROG)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386" ;; changequote(,)dnl @@ -274,44 +326,80 @@ changequote([,])dnl ;; powerpc*-*-pe* | powerpc*-*-cygwin*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + ;; + powerpc*-*-linux* | powerpc*-*-elf*) + BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu" ;; sh*-*-pe) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_SH" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' + ;; + spu-*-*) + BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)' ;; mips*-*-pe) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' ;; mcore-*-pe) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' ;; mcore-*-elf) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + if test -z "$DLLTOOL_DEFAULT"; then + DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE_ELF" + fi DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF" ;; + mep-*) + OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0" + ;; esac fi done +DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT" + if test "${with_windres+set}" = set; then BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' fi +if test "${with_windmc+set}" = set; then + BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' +fi + AC_SUBST(NLMCONV_DEFS) AC_SUBST(BUILD_NLMCONV) AC_SUBST(BUILD_SRCONV) AC_SUBST(BUILD_DLLTOOL) AC_SUBST(DLLTOOL_DEFS) AC_SUBST(BUILD_WINDRES) +AC_SUBST(BUILD_WINDMC) AC_SUBST(BUILD_DLLWRAP) AC_SUBST(BUILD_MISC) +AC_SUBST(BUILD_INSTALL_MISC) AC_SUBST(OBJDUMP_DEFS) AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.]) @@ -351,9 +439,4 @@ AC_SUBST(datarootdir) AC_SUBST(docdir) AC_SUBST(htmldir) -AC_OUTPUT(Makefile doc/Makefile po/Makefile.in:po/Make-in, -[ -case "x$CONFIG_FILES" in -*) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;; -esac -]) +AC_OUTPUT(Makefile doc/Makefile po/Makefile.in:po/Make-in) diff --git a/binutils/cxxfilt.c b/binutils/cxxfilt.c index a8ec43ba118..bed0537e477 100644 --- a/binutils/cxxfilt.c +++ b/binutils/cxxfilt.c @@ -1,6 +1,6 @@ /* Demangler for GNU C++ - main program Copyright 1989, 1991, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.uucp) Rewritten by Fred Fish (fnf@cygnus.com) for ARM and Lucid demangling Modified by Satish Pai (pai@apollo.hp.com) for HP demangling @@ -22,13 +22,13 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "config.h" +#include "sysdep.h" #include "bfd.h" -#include "bucomm.h" #include "libiberty.h" #include "demangle.h" #include "getopt.h" #include "safe-ctype.h" +#include "bucomm.h" static int flags = DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE; static int strip_underscore = TARGET_PREPENDS_UNDERSCORE; @@ -115,6 +115,8 @@ Options are:\n\ Demangled names are displayed to stdout.\n\ If a name cannot be demangled it is just echoed to stdout.\n\ If no names are provided on the command line, stdin is read.\n"); + if (REPORT_BUGS_TO[0] && status == 0) + fprintf (stream, _("Report bugs to %s.\n"), REPORT_BUGS_TO); exit (status); } diff --git a/binutils/debug.c b/binutils/debug.c index 07d38acfe40..1cc518e6295 100644 --- a/binutils/debug.c +++ b/binutils/debug.c @@ -1,5 +1,5 @@ /* debug.c -- Handle generic debugging information. - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003 + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor . @@ -26,11 +26,9 @@ this was writing a converter from stabs to HP IEEE-695 debugging format. */ -#include +#include "sysdep.h" #include - #include "bfd.h" -#include "bucomm.h" #include "libiberty.h" #include "debug.h" diff --git a/binutils/deflex.c b/binutils/deflex.c deleted file mode 100644 index 9051c907b59..00000000000 --- a/binutils/deflex.c +++ /dev/null @@ -1,1881 +0,0 @@ -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /cvs/src/src/binutils/Attic/deflex.c,v 1.1.16.1 2006/04/16 18:36:40 drow Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include -#include - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#ifndef _WIN32 -#include -#endif - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 41 -#define YY_END_OF_BUFFER 42 -static yyconst short int yy_accept[198] = - { 0, - 0, 0, 42, 41, 34, 36, 35, 33, 41, 28, - 41, 31, 40, 38, 27, 32, 37, 39, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 0, 29, 28, 0, 30, 31, 27, - 32, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 12, 6, 28, 7, - 28, 28, 28, 28, 28, 28, 28, 28, 1, 28, - - 28, 28, 16, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 17, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 14, 28, 28, 28, 19, 21, 28, 28, 28, - 28, 28, 28, 18, 9, 28, 10, 28, 28, 2, - 28, 28, 15, 28, 28, 28, 28, 11, 13, 28, - 5, 28, 28, 22, 28, 8, 28, 28, 28, 28, - 28, 28, 20, 4, 28, 28, 28, 24, 28, 26, - 28, 3, 28, 28, 23, 25, 0 - - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 5, 1, 6, 1, 7, 1, 1, 8, 1, - 1, 9, 1, 10, 7, 11, 12, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 7, 14, 1, - 15, 1, 7, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 7, 26, 27, 28, 29, 30, 31, - 7, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 1, 1, 1, 1, 7, 1, 22, 22, 22, 22, - - 22, 22, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 22, - 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[41] = - { 0, - 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, - 1, 4, 5, 1, 1, 4, 6, 6, 6, 6, - 6, 6, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 - } ; - -static yyconst short int yy_base[205] = - { 0, - 0, 0, 229, 230, 230, 230, 230, 230, 222, 0, - 219, 0, 230, 230, 0, 0, 230, 0, 209, 195, - 24, 186, 202, 14, 197, 186, 27, 188, 198, 25, - 197, 196, 184, 209, 230, 0, 206, 230, 0, 0, - 0, 0, 180, 27, 178, 178, 27, 193, 178, 183, - 189, 179, 177, 175, 178, 185, 182, 183, 170, 181, - 165, 164, 170, 173, 172, 159, 174, 171, 170, 158, - 156, 156, 151, 152, 149, 161, 34, 145, 160, 145, - 146, 154, 157, 147, 141, 139, 0, 0, 138, 0, - 139, 135, 137, 135, 135, 29, 149, 140, 0, 136, - - 139, 145, 0, 136, 139, 132, 132, 30, 132, 135, - 138, 129, 119, 118, 126, 116, 122, 119, 115, 115, - 124, 127, 109, 112, 121, 119, 106, 111, 108, 106, - 0, 106, 103, 112, 99, 91, 97, 99, 95, 88, - 99, 0, 93, 103, 94, 0, 0, 97, 91, 87, - 90, 84, 83, 0, 0, 95, 0, 97, 80, 0, - 92, 91, 0, 78, 70, 91, 74, 0, 0, 82, - 0, 89, 88, 0, 84, 0, 82, 85, 83, 69, - 66, 56, 0, 0, 39, 36, 35, 0, 44, 0, - 43, 0, 40, 39, 0, 0, 230, 67, 71, 77, - - 83, 85, 91, 95 - } ; - -static yyconst short int yy_def[205] = - { 0, - 197, 1, 197, 197, 197, 197, 197, 197, 198, 199, - 200, 201, 197, 197, 202, 203, 197, 204, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 198, 197, 199, 200, 197, 201, 202, - 203, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 0, 197, 197, 197, - - 197, 197, 197, 197 - } ; - -static yyconst short int yy_nxt[271] = - { 0, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 4, 15, 16, 17, 18, 10, 19, 20, 21, - 22, 10, 10, 23, 24, 10, 25, 26, 27, 10, - 28, 29, 30, 31, 10, 32, 33, 10, 10, 10, - 45, 49, 50, 53, 46, 57, 65, 69, 58, 59, - 100, 117, 128, 118, 129, 66, 54, 70, 60, 196, - 195, 194, 193, 192, 191, 190, 101, 34, 34, 34, - 34, 34, 34, 36, 36, 36, 36, 37, 37, 37, - 37, 37, 37, 39, 189, 39, 39, 39, 39, 40, - 40, 41, 188, 41, 41, 41, 41, 42, 187, 186, - - 42, 185, 184, 183, 182, 181, 180, 179, 178, 177, - 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, - 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, - 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, - 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, - 136, 135, 134, 133, 132, 131, 130, 127, 126, 125, - 124, 123, 122, 121, 120, 119, 116, 115, 114, 113, - 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, - 102, 99, 98, 97, 96, 95, 94, 93, 92, 91, - 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, - - 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, - 68, 67, 64, 38, 35, 63, 62, 61, 56, 55, - 52, 51, 48, 47, 44, 43, 38, 35, 197, 3, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197 - } ; - -static yyconst short int yy_chk[271] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 21, 24, 24, 27, 21, 30, 44, 47, 30, 30, - 77, 96, 108, 96, 108, 44, 27, 47, 30, 194, - 193, 191, 189, 187, 186, 185, 77, 198, 198, 198, - 198, 198, 198, 199, 199, 199, 199, 200, 200, 200, - 200, 200, 200, 201, 182, 201, 201, 201, 201, 202, - 202, 203, 181, 203, 203, 203, 203, 204, 180, 179, - - 204, 178, 177, 175, 173, 172, 170, 167, 166, 165, - 164, 162, 161, 159, 158, 156, 153, 152, 151, 150, - 149, 148, 145, 144, 143, 141, 140, 139, 138, 137, - 136, 135, 134, 133, 132, 130, 129, 128, 127, 126, - 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, - 115, 114, 113, 112, 111, 110, 109, 107, 106, 105, - 104, 102, 101, 100, 98, 97, 95, 94, 93, 92, - 91, 89, 86, 85, 84, 83, 82, 81, 80, 79, - 78, 76, 75, 74, 73, 72, 71, 70, 69, 68, - 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, - - 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, - 46, 45, 43, 37, 34, 33, 32, 31, 29, 28, - 26, 25, 23, 22, 20, 19, 11, 9, 3, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "deflex.l" -#define INITIAL 0 -#line 2 "deflex.l" - -/* Copyright 1995, 1997, 1998, 1999, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. - - This file is part of 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 2 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. */ - - -/* Contributed by Steve Chamberlain: sac@cygnus.com */ - -#define DONTDECLARE_MALLOC -#include "libiberty.h" -#include "defparse.h" -#include "dlltool.h" - -#define YY_NO_UNPUT - -int linenumber; - -#line 523 "deflex.c" - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - } -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 35 "deflex.l" - -#line 687 "deflex.c" - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 198 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 230 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 36 "deflex.l" -{ return NAME;} - YY_BREAK -case 2: -YY_RULE_SETUP -#line 37 "deflex.l" -{ return LIBRARY;} - YY_BREAK -case 3: -YY_RULE_SETUP -#line 38 "deflex.l" -{ return DESCRIPTION;} - YY_BREAK -case 4: -YY_RULE_SETUP -#line 39 "deflex.l" -{ return STACKSIZE;} - YY_BREAK -case 5: -YY_RULE_SETUP -#line 40 "deflex.l" -{ return HEAPSIZE;} - YY_BREAK -case 6: -YY_RULE_SETUP -#line 41 "deflex.l" -{ return CODE;} - YY_BREAK -case 7: -YY_RULE_SETUP -#line 42 "deflex.l" -{ return DATA;} - YY_BREAK -case 8: -YY_RULE_SETUP -#line 43 "deflex.l" -{ return SECTIONS;} - YY_BREAK -case 9: -YY_RULE_SETUP -#line 44 "deflex.l" -{ return EXPORTS;} - YY_BREAK -case 10: -YY_RULE_SETUP -#line 45 "deflex.l" -{ return IMPORTS;} - YY_BREAK -case 11: -YY_RULE_SETUP -#line 46 "deflex.l" -{ return VERSIONK;} - YY_BREAK -case 12: -YY_RULE_SETUP -#line 47 "deflex.l" -{ return BASE;} - YY_BREAK -case 13: -YY_RULE_SETUP -#line 48 "deflex.l" -{ return CONSTANT; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 49 "deflex.l" -{ return NONAME; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 50 "deflex.l" -{ return PRIVATE; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 51 "deflex.l" -{ return READ;} - YY_BREAK -case 17: -YY_RULE_SETUP -#line 52 "deflex.l" -{ return WRITE;} - YY_BREAK -case 18: -YY_RULE_SETUP -#line 53 "deflex.l" -{ return EXECUTE;} - YY_BREAK -case 19: -YY_RULE_SETUP -#line 54 "deflex.l" -{ return SHARED;} - YY_BREAK -case 20: -YY_RULE_SETUP -#line 55 "deflex.l" -{ return NONSHARED;} - YY_BREAK -case 21: -YY_RULE_SETUP -#line 56 "deflex.l" -{ return SINGLE;} - YY_BREAK -case 22: -YY_RULE_SETUP -#line 57 "deflex.l" -{ return MULTIPLE;} - YY_BREAK -case 23: -YY_RULE_SETUP -#line 58 "deflex.l" -{ return INITINSTANCE;} - YY_BREAK -case 24: -YY_RULE_SETUP -#line 59 "deflex.l" -{ return INITGLOBAL;} - YY_BREAK -case 25: -YY_RULE_SETUP -#line 60 "deflex.l" -{ return TERMINSTANCE;} - YY_BREAK -case 26: -YY_RULE_SETUP -#line 61 "deflex.l" -{ return TERMGLOBAL;} - YY_BREAK -case 27: -YY_RULE_SETUP -#line 63 "deflex.l" -{ yylval.number = strtol (yytext,0,0); - return NUMBER; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 66 "deflex.l" -{ - yylval.id = xstrdup (yytext); - return ID; - } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 71 "deflex.l" -{ - yylval.id = xstrdup (yytext+1); - yylval.id[yyleng-2] = 0; - return ID; - } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 77 "deflex.l" -{ - yylval.id = xstrdup (yytext+1); - yylval.id[yyleng-2] = 0; - return ID; - } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 82 "deflex.l" -{ } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 83 "deflex.l" -{ } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 84 "deflex.l" -{ } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 85 "deflex.l" -{ } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 86 "deflex.l" -{ } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 87 "deflex.l" -{ linenumber ++ ;} - YY_BREAK -case 37: -YY_RULE_SETUP -#line 88 "deflex.l" -{ return '=';} - YY_BREAK -case 38: -YY_RULE_SETUP -#line 89 "deflex.l" -{ return '.';} - YY_BREAK -case 39: -YY_RULE_SETUP -#line 90 "deflex.l" -{ return '@';} - YY_BREAK -case 40: -YY_RULE_SETUP -#line 91 "deflex.l" -{ return ',';} - YY_BREAK -case 41: -YY_RULE_SETUP -#line 92 "deflex.l" -ECHO; - YY_BREAK -#line 987 "deflex.c" -case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 198 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 198 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 197); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - - return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef _WIN32 -#include -#else -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -#line 92 "deflex.l" - -#ifndef yywrap -/* Needed for lex, though not flex. */ -int yywrap(void) { return 1; } -#endif diff --git a/binutils/defparse.c b/binutils/defparse.c deleted file mode 100644 index de34ae0cfc1..00000000000 --- a/binutils/defparse.c +++ /dev/null @@ -1,1777 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - 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 2, 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. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NAME = 258, - LIBRARY = 259, - DESCRIPTION = 260, - STACKSIZE = 261, - HEAPSIZE = 262, - CODE = 263, - DATA = 264, - SECTIONS = 265, - EXPORTS = 266, - IMPORTS = 267, - VERSIONK = 268, - BASE = 269, - CONSTANT = 270, - READ = 271, - WRITE = 272, - EXECUTE = 273, - SHARED = 274, - NONSHARED = 275, - NONAME = 276, - PRIVATE = 277, - SINGLE = 278, - MULTIPLE = 279, - INITINSTANCE = 280, - INITGLOBAL = 281, - TERMINSTANCE = 282, - TERMGLOBAL = 283, - ID = 284, - NUMBER = 285 - }; -#endif -/* Tokens. */ -#define NAME 258 -#define LIBRARY 259 -#define DESCRIPTION 260 -#define STACKSIZE 261 -#define HEAPSIZE 262 -#define CODE 263 -#define DATA 264 -#define SECTIONS 265 -#define EXPORTS 266 -#define IMPORTS 267 -#define VERSIONK 268 -#define BASE 269 -#define CONSTANT 270 -#define READ 271 -#define WRITE 272 -#define EXECUTE 273 -#define SHARED 274 -#define NONSHARED 275 -#define NONAME 276 -#define PRIVATE 277 -#define SINGLE 278 -#define MULTIPLE 279 -#define INITINSTANCE 280 -#define INITGLOBAL 281 -#define TERMINSTANCE 282 -#define TERMGLOBAL 283 -#define ID 284 -#define NUMBER 285 - - - - -/* Copy the first part of user declarations. */ -#line 1 "defparse.y" - /* defparse.y - parser for .def files */ - -/* Copyright 1995, 1997, 1998, 1999, 2001, 2004 - Free Software Foundation, Inc. - - This file is part of 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 2 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 "bfd.h" -#include "bucomm.h" -#include "dlltool.h" - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 27 "defparse.y" -typedef union YYSTYPE { - char *id; - int number; -} YYSTYPE; -/* Line 196 of yacc.c. */ -#line 176 "defparse.c" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 219 of yacc.c. */ -#line 188 "defparse.c" - -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -#if ! defined (yyoverflow) || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# else -# define YYSTACK_ALLOC alloca -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYINCLUDED_STDLIB_H -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) -# endif -# ifdef __cplusplus -extern "C" { -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifdef __cplusplus -} -# endif -# endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ - - -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short int yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short int yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 38 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 114 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 35 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 23 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 68 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 98 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 285 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 33, 2, 31, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 32, 2, 2, 34, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const unsigned char yyprhs[] = -{ - 0, 0, 3, 6, 8, 12, 17, 20, 23, 27, - 31, 34, 37, 40, 43, 46, 51, 52, 55, 63, - 66, 68, 76, 84, 90, 96, 102, 108, 112, 116, - 119, 121, 124, 128, 130, 132, 133, 136, 137, 139, - 141, 143, 145, 147, 149, 151, 153, 154, 156, 157, - 159, 160, 162, 163, 165, 169, 170, 173, 174, 177, - 182, 183, 187, 188, 189, 193, 195, 197, 199 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yysigned_char yyrhs[] = -{ - 36, 0, -1, 36, 37, -1, 37, -1, 3, 52, - 55, -1, 4, 52, 55, 56, -1, 11, 38, -1, - 5, 29, -1, 6, 30, 46, -1, 7, 30, 46, - -1, 8, 44, -1, 9, 44, -1, 10, 42, -1, - 12, 40, -1, 13, 30, -1, 13, 30, 31, 30, - -1, -1, 38, 39, -1, 29, 54, 53, 49, 48, - 50, 51, -1, 40, 41, -1, 41, -1, 29, 32, - 29, 31, 29, 31, 29, -1, 29, 32, 29, 31, - 29, 31, 30, -1, 29, 32, 29, 31, 29, -1, - 29, 32, 29, 31, 30, -1, 29, 31, 29, 31, - 29, -1, 29, 31, 29, 31, 30, -1, 29, 31, - 29, -1, 29, 31, 30, -1, 42, 43, -1, 43, - -1, 29, 44, -1, 44, 45, 47, -1, 47, -1, - 33, -1, -1, 33, 30, -1, -1, 16, -1, 17, - -1, 18, -1, 19, -1, 20, -1, 23, -1, 24, - -1, 15, -1, -1, 21, -1, -1, 9, -1, -1, - 22, -1, -1, 29, -1, 29, 31, 29, -1, -1, - 34, 30, -1, -1, 32, 29, -1, 32, 29, 31, - 29, -1, -1, 14, 32, 30, -1, -1, -1, 56, - 45, 57, -1, 25, -1, 26, -1, 27, -1, 28, - -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned char yyrline[] = -{ - 0, 44, 44, 45, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 64, 66, 70, 74, - 75, 79, 80, 81, 82, 83, 84, 85, 86, 90, - 91, 95, 99, 100, 104, 105, 107, 108, 112, 113, - 114, 115, 116, 117, 118, 122, 123, 127, 128, 132, - 133, 137, 138, 141, 142, 148, 152, 153, 157, 158, - 164, 167, 168, 171, 173, 177, 178, 179, 180 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "NAME", "LIBRARY", "DESCRIPTION", - "STACKSIZE", "HEAPSIZE", "CODE", "DATA", "SECTIONS", "EXPORTS", - "IMPORTS", "VERSIONK", "BASE", "CONSTANT", "READ", "WRITE", "EXECUTE", - "SHARED", "NONSHARED", "NONAME", "PRIVATE", "SINGLE", "MULTIPLE", - "INITINSTANCE", "INITGLOBAL", "TERMINSTANCE", "TERMGLOBAL", "ID", - "NUMBER", "'.'", "'='", "','", "'@'", "$accept", "start", "command", - "explist", "expline", "implist", "impline", "seclist", "secline", - "attr_list", "opt_comma", "opt_number", "attr", "opt_CONSTANT", - "opt_NONAME", "opt_DATA", "opt_PRIVATE", "opt_name", "opt_ordinal", - "opt_equal_name", "opt_base", "option_list", "option", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const unsigned short int yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 46, 61, 44, 64 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = -{ - 0, 35, 36, 36, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 38, 38, 39, 40, - 40, 41, 41, 41, 41, 41, 41, 41, 41, 42, - 42, 43, 44, 44, 45, 45, 46, 46, 47, 47, - 47, 47, 47, 47, 47, 48, 48, 49, 49, 50, - 50, 51, 51, 52, 52, 52, 53, 53, 54, 54, - 54, 55, 55, 56, 56, 57, 57, 57, 57 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = -{ - 0, 2, 2, 1, 3, 4, 2, 2, 3, 3, - 2, 2, 2, 2, 2, 4, 0, 2, 7, 2, - 1, 7, 7, 5, 5, 5, 5, 3, 3, 2, - 1, 2, 3, 1, 1, 0, 2, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, - 0, 1, 0, 1, 3, 0, 2, 0, 2, 4, - 0, 3, 0, 0, 3, 1, 1, 1, 1 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const unsigned char yydefact[] = -{ - 0, 55, 55, 0, 0, 0, 0, 0, 0, 16, - 0, 0, 0, 3, 53, 62, 62, 7, 37, 37, - 38, 39, 40, 41, 42, 43, 44, 10, 33, 11, - 0, 12, 30, 6, 0, 13, 20, 14, 1, 2, - 0, 0, 4, 63, 0, 8, 9, 34, 0, 31, - 29, 60, 17, 0, 0, 19, 0, 54, 0, 5, - 36, 32, 0, 57, 27, 28, 0, 15, 61, 0, - 58, 0, 48, 0, 0, 65, 66, 67, 68, 64, - 0, 56, 47, 46, 25, 26, 23, 24, 59, 45, - 50, 0, 49, 52, 21, 22, 51, 18 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yysigned_char yydefgoto[] = -{ - -1, 12, 13, 33, 52, 35, 36, 31, 32, 27, - 48, 45, 28, 90, 83, 93, 97, 15, 72, 63, - 42, 59, 79 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -26 -static const yysigned_char yypact[] = -{ - 32, -12, -12, 17, -8, 33, -4, -4, 35, -26, - 36, 37, 21, -26, 38, 48, 48, -26, 39, 39, - -26, -26, -26, -26, -26, -26, -26, -15, -26, -15, - -4, 35, -26, 41, -25, 36, -26, 40, -26, -26, - 44, 34, -26, -26, 45, -26, -26, -26, -4, -15, - -26, 42, -26, -19, 47, -26, 49, -26, 50, 22, - -26, -26, 52, 43, 51, -26, 53, -26, -26, 26, - 54, 56, 57, 27, 29, -26, -26, -26, -26, -26, - 58, -26, -26, 68, -26, -26, 59, -26, -26, -26, - 79, 31, -26, 46, -26, -26, -26, -26 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yysigned_char yypgoto[] = -{ - -26, -26, 77, -26, -26, -26, 60, -26, 61, -7, - 55, 72, 62, -26, -26, -26, -26, 91, -26, -26, - 78, -26, -26 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -36 -static const yysigned_char yytable[] = -{ - 29, -35, -35, -35, -35, -35, 53, 54, -35, -35, - 64, 65, 20, 21, 22, 23, 24, 14, 47, 25, - 26, 38, 18, 49, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 17, -35, -35, -35, - -35, 75, 76, 77, 78, 47, 84, 85, 86, 87, - 94, 95, 41, 19, 30, 34, 58, 37, 96, 40, - 51, 56, 44, 57, 62, 60, 66, 71, 82, 67, - 68, 70, 73, 89, 74, 80, 81, 88, 92, 39, - 91, 46, 50, 16, 43, 55, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 61, 0, 0, 0, 69 -}; - -static const yysigned_char yycheck[] = -{ - 7, 16, 17, 18, 19, 20, 31, 32, 23, 24, - 29, 30, 16, 17, 18, 19, 20, 29, 33, 23, - 24, 0, 30, 30, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 29, 25, 26, 27, - 28, 25, 26, 27, 28, 33, 29, 30, 29, 30, - 29, 30, 14, 30, 29, 29, 32, 30, 22, 31, - 29, 31, 33, 29, 32, 30, 29, 34, 21, 30, - 30, 29, 31, 15, 31, 31, 30, 29, 9, 12, - 31, 19, 31, 2, 16, 35, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 48, -1, -1, -1, 59 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const unsigned char yystos[] = -{ - 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 36, 37, 29, 52, 52, 29, 30, 30, - 16, 17, 18, 19, 20, 23, 24, 44, 47, 44, - 29, 42, 43, 38, 29, 40, 41, 30, 0, 37, - 31, 14, 55, 55, 33, 46, 46, 33, 45, 44, - 43, 29, 39, 31, 32, 41, 31, 29, 32, 56, - 30, 47, 32, 54, 29, 30, 29, 30, 30, 45, - 29, 34, 53, 31, 31, 25, 26, 27, 28, 57, - 31, 30, 21, 49, 29, 30, 29, 30, 29, 15, - 48, 31, 9, 50, 29, 30, 22, 51 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (0) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_stack_print (short int *bottom, short int *top) -#else -static void -yy_stack_print (bottom, top) - short int *bottom; - short int *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_reduce_print (int yyrule) -#else -static void -yy_reduce_print (yyrule) - int yyrule; -#endif -{ - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; -} -# endif -# endif - -# ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - size_t yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -#endif /* YYERROR_VERBOSE */ - - - -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - switch (yytype) - { - default: - break; - } - YYFPRINTF (yyoutput, ")"); -} - -#endif /* ! YYDEBUG */ -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM); -# else -int yyparse (); -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int -yyparse (void) -#else -int -yyparse () - ; -#endif -#endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short int yyssa[YYINITDEPTH]; - short int *yyss = yyssa; - short int *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK (yyvsp--, yyssp--) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short int *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - short int *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a look-ahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to look-ahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; - - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 4: -#line 49 "defparse.y" - { def_name ((yyvsp[-1].id), (yyvsp[0].number)); } - break; - - case 5: -#line 50 "defparse.y" - { def_library ((yyvsp[-2].id), (yyvsp[-1].number)); } - break; - - case 7: -#line 52 "defparse.y" - { def_description ((yyvsp[0].id));} - break; - - case 8: -#line 53 "defparse.y" - { def_stacksize ((yyvsp[-1].number), (yyvsp[0].number));} - break; - - case 9: -#line 54 "defparse.y" - { def_heapsize ((yyvsp[-1].number), (yyvsp[0].number));} - break; - - case 10: -#line 55 "defparse.y" - { def_code ((yyvsp[0].number));} - break; - - case 11: -#line 56 "defparse.y" - { def_data ((yyvsp[0].number));} - break; - - case 14: -#line 59 "defparse.y" - { def_version ((yyvsp[0].number),0);} - break; - - case 15: -#line 60 "defparse.y" - { def_version ((yyvsp[-2].number),(yyvsp[0].number));} - break; - - case 18: -#line 71 "defparse.y" - { def_exports ((yyvsp[-6].id), (yyvsp[-5].id), (yyvsp[-4].number), (yyvsp[-3].number), (yyvsp[-2].number), (yyvsp[-1].number), (yyvsp[0].number));} - break; - - case 21: -#line 79 "defparse.y" - { def_import ((yyvsp[-6].id),(yyvsp[-4].id),(yyvsp[-2].id),(yyvsp[0].id), 0); } - break; - - case 22: -#line 80 "defparse.y" - { def_import ((yyvsp[-6].id),(yyvsp[-4].id),(yyvsp[-2].id), 0,(yyvsp[0].number)); } - break; - - case 23: -#line 81 "defparse.y" - { def_import ((yyvsp[-4].id),(yyvsp[-2].id), 0,(yyvsp[0].id), 0); } - break; - - case 24: -#line 82 "defparse.y" - { def_import ((yyvsp[-4].id),(yyvsp[-2].id), 0, 0,(yyvsp[0].number)); } - break; - - case 25: -#line 83 "defparse.y" - { def_import ( 0,(yyvsp[-4].id),(yyvsp[-2].id),(yyvsp[0].id), 0); } - break; - - case 26: -#line 84 "defparse.y" - { def_import ( 0,(yyvsp[-4].id),(yyvsp[-2].id), 0,(yyvsp[0].number)); } - break; - - case 27: -#line 85 "defparse.y" - { def_import ( 0,(yyvsp[-2].id), 0,(yyvsp[0].id), 0); } - break; - - case 28: -#line 86 "defparse.y" - { def_import ( 0,(yyvsp[-2].id), 0, 0,(yyvsp[0].number)); } - break; - - case 31: -#line 95 "defparse.y" - { def_section ((yyvsp[-1].id),(yyvsp[0].number));} - break; - - case 36: -#line 107 "defparse.y" - { (yyval.number)=(yyvsp[0].number);} - break; - - case 37: -#line 108 "defparse.y" - { (yyval.number)=-1;} - break; - - case 38: -#line 112 "defparse.y" - { (yyval.number) = 1; } - break; - - case 39: -#line 113 "defparse.y" - { (yyval.number) = 2; } - break; - - case 40: -#line 114 "defparse.y" - { (yyval.number) = 4; } - break; - - case 41: -#line 115 "defparse.y" - { (yyval.number) = 8; } - break; - - case 42: -#line 116 "defparse.y" - { (yyval.number) = 0; } - break; - - case 43: -#line 117 "defparse.y" - { (yyval.number) = 0; } - break; - - case 44: -#line 118 "defparse.y" - { (yyval.number) = 0; } - break; - - case 45: -#line 122 "defparse.y" - {(yyval.number)=1;} - break; - - case 46: -#line 123 "defparse.y" - {(yyval.number)=0;} - break; - - case 47: -#line 127 "defparse.y" - {(yyval.number)=1;} - break; - - case 48: -#line 128 "defparse.y" - {(yyval.number)=0;} - break; - - case 49: -#line 132 "defparse.y" - { (yyval.number) = 1; } - break; - - case 50: -#line 133 "defparse.y" - { (yyval.number) = 0; } - break; - - case 51: -#line 137 "defparse.y" - { (yyval.number) = 1; } - break; - - case 52: -#line 138 "defparse.y" - { (yyval.number) = 0; } - break; - - case 53: -#line 141 "defparse.y" - { (yyval.id) =(yyvsp[0].id); } - break; - - case 54: -#line 143 "defparse.y" - { - char *name = xmalloc (strlen ((yyvsp[-2].id)) + 1 + strlen ((yyvsp[0].id)) + 1); - sprintf (name, "%s.%s", (yyvsp[-2].id), (yyvsp[0].id)); - (yyval.id) = name; - } - break; - - case 55: -#line 148 "defparse.y" - { (yyval.id)=""; } - break; - - case 56: -#line 152 "defparse.y" - { (yyval.number)=(yyvsp[0].number);} - break; - - case 57: -#line 153 "defparse.y" - { (yyval.number)=-1;} - break; - - case 58: -#line 157 "defparse.y" - { (yyval.id) = (yyvsp[0].id); } - break; - - case 59: -#line 159 "defparse.y" - { - char *name = xmalloc (strlen ((yyvsp[-2].id)) + 1 + strlen ((yyvsp[0].id)) + 1); - sprintf (name, "%s.%s", (yyvsp[-2].id), (yyvsp[0].id)); - (yyval.id) = name; - } - break; - - case 60: -#line 164 "defparse.y" - { (yyval.id) = 0; } - break; - - case 61: -#line 167 "defparse.y" - { (yyval.number)= (yyvsp[0].number);} - break; - - case 62: -#line 168 "defparse.y" - { (yyval.number)=-1;} - break; - - - default: break; - } - -/* Line 1126 of yacc.c. */ -#line 1510 "defparse.c" - - yyvsp -= yylen; - yyssp -= yylen; - - - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - char *yymsg = 0; -# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -#if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -#endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - - if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yymsg; - int yyi = 0; - while ((*yyp = *yyf)) - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - { - yyerror (YY_("syntax error")); - goto yyexhaustedlab; - } - } - else -#endif /* YYERROR_VERBOSE */ - yyerror (YY_("syntax error")); - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (0) - goto yyerrorlab; - -yyvsp -= yylen; - yyssp -= yylen; - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK; - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK; - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif - return yyresult; -} - - - diff --git a/binutils/defparse.h b/binutils/defparse.h deleted file mode 100644 index 0eea9b9dcf4..00000000000 --- a/binutils/defparse.h +++ /dev/null @@ -1,111 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - 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 2, 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. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NAME = 258, - LIBRARY = 259, - DESCRIPTION = 260, - STACKSIZE = 261, - HEAPSIZE = 262, - CODE = 263, - DATA = 264, - SECTIONS = 265, - EXPORTS = 266, - IMPORTS = 267, - VERSIONK = 268, - BASE = 269, - CONSTANT = 270, - READ = 271, - WRITE = 272, - EXECUTE = 273, - SHARED = 274, - NONSHARED = 275, - NONAME = 276, - PRIVATE = 277, - SINGLE = 278, - MULTIPLE = 279, - INITINSTANCE = 280, - INITGLOBAL = 281, - TERMINSTANCE = 282, - TERMGLOBAL = 283, - ID = 284, - NUMBER = 285 - }; -#endif -/* Tokens. */ -#define NAME 258 -#define LIBRARY 259 -#define DESCRIPTION 260 -#define STACKSIZE 261 -#define HEAPSIZE 262 -#define CODE 263 -#define DATA 264 -#define SECTIONS 265 -#define EXPORTS 266 -#define IMPORTS 267 -#define VERSIONK 268 -#define BASE 269 -#define CONSTANT 270 -#define READ 271 -#define WRITE 272 -#define EXECUTE 273 -#define SHARED 274 -#define NONSHARED 275 -#define NONAME 276 -#define PRIVATE 277 -#define SINGLE 278 -#define MULTIPLE 279 -#define INITINSTANCE 280 -#define INITGLOBAL 281 -#define TERMINSTANCE 282 -#define TERMGLOBAL 283 -#define ID 284 -#define NUMBER 285 - - - - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 27 "defparse.y" -typedef union YYSTYPE { - char *id; - int number; -} YYSTYPE; -/* Line 1447 of yacc.c. */ -#line 103 "defparse.h" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE yylval; - - - diff --git a/binutils/defparse.y b/binutils/defparse.y index 81b4c61ce90..8b870d7c6be 100644 --- a/binutils/defparse.y +++ b/binutils/defparse.y @@ -1,6 +1,6 @@ %{ /* defparse.y - parser for .def files */ -/* Copyright 1995, 1997, 1998, 1999, 2001, 2004 +/* Copyright 1995, 1997, 1998, 1999, 2001, 2004, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -19,8 +19,9 @@ 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 "bucomm.h" +#include "libiberty.h" #include "dlltool.h" %} diff --git a/binutils/dlltool.c b/binutils/dlltool.c index 6c231f69a44..568ad689efa 100644 --- a/binutils/dlltool.c +++ b/binutils/dlltool.c @@ -1,6 +1,6 @@ /* dlltool.c -- tool to generate stuff for PE style DLLs Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006 Free Software Foundation, Inc. + 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -243,12 +243,13 @@ #define PAGE_SIZE 4096 #define PAGE_MASK (-PAGE_SIZE) +#include "sysdep.h" #include "bfd.h" #include "libiberty.h" -#include "bucomm.h" #include "getopt.h" #include "demangle.h" #include "dyn-string.h" +#include "bucomm.h" #include "dlltool.h" #include "safe-ctype.h" @@ -261,6 +262,9 @@ #include "coff/arm.h" #include "coff/internal.h" #endif +#ifdef DLLTOOL_MX86_64 +#include "coff/x86_64.h" +#endif /* Forward references. */ static char *look_for_prog (const char *, const char *, int); @@ -384,35 +388,43 @@ static int verbose; static FILE *output_def; static FILE *base_file; -#ifdef DLLTOOL_ARM -#ifdef DLLTOOL_ARM_EPOC -static const char *mname = "arm-epoc"; -#else +#ifdef DLLTOOL_DEFAULT_ARM static const char *mname = "arm"; #endif + +#ifdef DLLTOOL_DEFAULT_ARM_EPOC +static const char *mname = "arm-epoc"; #endif -#ifdef DLLTOOL_I386 +#ifdef DLLTOOL_DEFAULT_ARM_WINCE +static const char *mname = "arm-wince"; +#endif + +#ifdef DLLTOOL_DEFAULT_I386 static const char *mname = "i386"; #endif -#ifdef DLLTOOL_PPC +#ifdef DLLTOOL_DEFAULT_MX86_64 +static const char *mname = "i386:x86-64"; +#endif + +#ifdef DLLTOOL_DEFAULT_PPC static const char *mname = "ppc"; #endif -#ifdef DLLTOOL_SH +#ifdef DLLTOOL_DEFAULT_SH static const char *mname = "sh"; #endif -#ifdef DLLTOOL_MIPS +#ifdef DLLTOOL_DEFAULT_MIPS static const char *mname = "mips"; #endif -#ifdef DLLTOOL_MCORE +#ifdef DLLTOOL_DEFAULT_MCORE static const char * mname = "mcore-le"; #endif -#ifdef DLLTOOL_MCORE_ELF +#ifdef DLLTOOL_DEFAULT_MCORE_ELF static const char * mname = "mcore-elf"; static char * mcore_elf_out_file = NULL; static char * mcore_elf_linker = NULL; @@ -629,6 +641,23 @@ mtable[] = arm_jtab, sizeof (arm_jtab), 8 } , + { +#define MARM_WINCE 10 + "arm-wince", ".byte", ".short", ".long", ".asciz", "@", + "ldr\tip,[pc]\n\tldr\tpc,[ip]\n\t.long", + ".global", ".space", ".align\t2",".align\t4", "-mapcs-32", + "pe-arm-wince-little", bfd_arch_arm, + arm_jtab, sizeof (arm_jtab), 8 + } + , + { +#define MX86 11 + "i386:x86-64", ".byte", ".short", ".long", ".asciz", "#", + "jmp *", ".global", ".space", ".align\t2",".align\t4", "", + "pe-x86-64",bfd_arch_i386, + i386_jtab, sizeof (i386_jtab), 2 + } + , { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; @@ -752,6 +781,7 @@ rvaafter (int machine) { case MARM: case M386: + case MX86: case MPPC: case MTHUMB: case MARM_INTERWORK: @@ -760,6 +790,7 @@ rvaafter (int machine) case MMCORE_ELF: case MMCORE_ELF_LE: case MARM_EPOC: + case MARM_WINCE: break; default: /* xgettext:c-format */ @@ -776,6 +807,7 @@ rvabefore (int machine) { case MARM: case M386: + case MX86: case MPPC: case MTHUMB: case MARM_INTERWORK: @@ -784,6 +816,7 @@ rvabefore (int machine) case MMCORE_ELF: case MMCORE_ELF_LE: case MARM_EPOC: + case MARM_WINCE: return ".rva\t"; default: /* xgettext:c-format */ @@ -807,8 +840,10 @@ asm_prefix (int machine, const char *name) case MMCORE_ELF: case MMCORE_ELF_LE: case MARM_EPOC: + case MARM_WINCE: break; case M386: + case MX86: /* Symbol names starting with ? do not have a leading underscore. */ if (name && *name == '?') break; @@ -1234,7 +1269,7 @@ scan_drectve_symbols (bfd *abfd) while (p < e) { if (p[0] == '-' - && strncmp (p, "-export:", 8) == 0) + && CONST_STRNEQ (p, "-export:")) { char * name; char * c; @@ -1252,7 +1287,7 @@ scan_drectve_symbols (bfd *abfd) char *tag_start = ++p; while (p < e && *p != ' ' && *p != '-') p++; - if (strncmp (tag_start, "data", 4) == 0) + if (CONST_STRNEQ (tag_start, "data")) flags &= ~BSF_FUNCTION; } @@ -1686,10 +1721,19 @@ generate_idata_ofile (FILE *filvar) for (headptr = import_list; headptr != NULL; headptr = headptr->next) { fprintf (filvar, "listone%d:\n", headindex); - for ( funcindex = 0; funcindex < headptr->nfuncs; funcindex++ ) + for (funcindex = 0; funcindex < headptr->nfuncs; funcindex++) +#ifdef DLLTOOL_MX86_64 + fprintf (filvar, "\t%sfuncptr%d_%d%s\n%s\t0\n", + ASM_RVA_BEFORE, headindex, funcindex, ASM_RVA_AFTER,ASM_LONG); +#else fprintf (filvar, "\t%sfuncptr%d_%d%s\n", ASM_RVA_BEFORE, headindex, funcindex, ASM_RVA_AFTER); - fprintf (filvar,"\t%s\t0\n", ASM_LONG); /* NULL terminating list */ +#endif +#ifdef DLLTOOL_MX86_64 + fprintf (filvar, "\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); /* NULL terminating list. */ +#else + fprintf (filvar, "\t%s\t0\n", ASM_LONG); /* NULL terminating list. */ +#endif headindex++; } @@ -1698,10 +1742,19 @@ generate_idata_ofile (FILE *filvar) for (headptr = import_list; headptr != NULL; headptr = headptr->next) { fprintf (filvar, "listtwo%d:\n", headindex); - for ( funcindex = 0; funcindex < headptr->nfuncs; funcindex++ ) + for (funcindex = 0; funcindex < headptr->nfuncs; funcindex++) +#ifdef DLLTOOL_MX86_64 + fprintf (filvar, "\t%sfuncptr%d_%d%s\n%s\t0\n", + ASM_RVA_BEFORE, headindex, funcindex, ASM_RVA_AFTER,ASM_LONG); +#else fprintf (filvar, "\t%sfuncptr%d_%d%s\n", ASM_RVA_BEFORE, headindex, funcindex, ASM_RVA_AFTER); - fprintf (filvar, "\t%s\t0\n", ASM_LONG); /* NULL terminating list */ +#endif +#ifdef DLLTOOL_MX86_64 + fprintf (filvar, "\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); /* NULL terminating list. */ +#else + fprintf (filvar, "\t%s\t0\n", ASM_LONG); /* NULL terminating list. */ +#endif headindex++; } @@ -2344,7 +2397,7 @@ make_one_lib_file (export_type *exp, int i) si->data = xmalloc (HOW_JTAB_SIZE); memcpy (si->data, HOW_JTAB, HOW_JTAB_SIZE); - /* add the reloc into idata$5 */ + /* Add the reloc into idata$5. */ rel = xmalloc (sizeof (arelent)); rpp = xmalloc (sizeof (arelent *) * 2); @@ -2360,6 +2413,12 @@ make_one_lib_file (export_type *exp, int i) BFD_RELOC_16_GOTOFF); rel->sym_ptr_ptr = iname_pp; } + else if (machine == MX86) + { + rel->howto = bfd_reloc_type_lookup (abfd, + BFD_RELOC_32_PCREL); + rel->sym_ptr_ptr = iname_pp; + } else { rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_32); @@ -2374,6 +2433,36 @@ make_one_lib_file (export_type *exp, int i) /* An idata$4 or idata$5 is one word long, and has an rva to idata$6. */ +#ifdef DLLTOOL_MX86_64 + si->data = xmalloc (8); + si->size = 8; + + if (exp->noname) + { + si->data[0] = exp->ordinal ; + si->data[1] = exp->ordinal >> 8; + si->data[2] = exp->ordinal >> 16; + si->data[3] = exp->ordinal >> 24; + si->data[4] = 0; + si->data[5] = 0; + si->data[6] = 0; + si->data[7] = 0x80; + } + else + { + sec->reloc_count = 1; + memset (si->data, 0, si->size); + rel = xmalloc (sizeof (arelent)); + rpp = xmalloc (sizeof (arelent *) * 2); + rpp[0] = rel; + rpp[1] = 0; + rel->address = 0; + rel->addend = 0; + rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_RVA); + rel->sym_ptr_ptr = secdata[IDATA6].sympp; + sec->orelocation = rpp; + } +#else si->data = xmalloc (4); si->size = 4; @@ -2398,7 +2487,7 @@ make_one_lib_file (export_type *exp, int i) rel->sym_ptr_ptr = secdata[IDATA6].sympp; sec->orelocation = rpp; } - +#endif break; case IDATA6: @@ -2612,14 +2701,17 @@ make_head (void) if (!no_idata5) { fprintf (f, "\t.section\t.idata$5\n"); - fprintf (f, "\t%s\t0\n", ASM_LONG); +#ifdef DLLTOOL_MX86_64 + fprintf (f,"\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); /* NULL terminating list. */ +#else + fprintf (f,"\t%s\t0\n", ASM_LONG); /* NULL terminating list. */ +#endif fprintf (f, "fthunk:\n"); } if (!no_idata4) { fprintf (f, "\t.section\t.idata$4\n"); - fprintf (f, "\t%s\t0\n", ASM_LONG); fprintf (f, "\t.section .idata$4\n"); fprintf (f, "hname:\n"); @@ -2646,13 +2738,21 @@ make_tail (void) if (!no_idata4) { fprintf (f, "\t.section .idata$4\n"); - fprintf (f, "\t%s\t0\n", ASM_LONG); +#ifdef DLLTOOL_MX86_64 + fprintf (f,"\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); /* NULL terminating list. */ +#else + fprintf (f,"\t%s\t0\n", ASM_LONG); /* NULL terminating list. */ +#endif } if (!no_idata5) { fprintf (f, "\t.section .idata$5\n"); - fprintf (f, "\t%s\t0\n", ASM_LONG); +#ifdef DLLTOOL_MX86_64 + fprintf (f,"\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); /* NULL terminating list. */ +#else + fprintf (f,"\t%s\t0\n", ASM_LONG); /* NULL terminating list. */ +#endif } #ifdef DLLTOOL_PPC @@ -2728,7 +2828,7 @@ gen_lib_file (void) if (exp->private) continue; n = make_one_lib_file (exp, i); - n->next = head; + n->archive_next = head; head = n; if (ext_prefix_alias) { @@ -2747,14 +2847,14 @@ gen_lib_file (void) alias_exp.forward = exp->forward; alias_exp.next = exp->next; n = make_one_lib_file (&alias_exp, i + PREFIX_ALIAS_BASE); - n->next = head; + n->archive_next = head; head = n; } } /* Now stick them all into the archive. */ - ar_head->next = head; - ar_tail->next = ar_head; + ar_head->archive_next = head; + ar_tail->archive_next = ar_head; head = ar_tail; if (! bfd_set_archive_head (outarch, head)) @@ -2765,7 +2865,7 @@ gen_lib_file (void) while (head != NULL) { - bfd *n = head->next; + bfd *n = head->archive_next; bfd_close (head); head = n; } @@ -3068,6 +3168,8 @@ usage (FILE *file, int status) fprintf (file, _(" -L --linker Use as the linker.\n")); fprintf (file, _(" -F --linker-flags Pass to the linker.\n")); #endif + if (REPORT_BUGS_TO[0] && status == 0) + fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); } diff --git a/binutils/dllwrap.c b/binutils/dllwrap.c index f93c75d6fb3..9828a958a73 100644 --- a/binutils/dllwrap.c +++ b/binutils/dllwrap.c @@ -1,5 +1,6 @@ /* dllwrap.c -- wrapper for DLLTOOL and GCC to generate PE style DLLs - Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 + Free Software Foundation, Inc. Contributed by Mumit Khan (khan@xraylith.wisc.edu). This file is part of GNU Binutils. @@ -26,19 +27,15 @@ #endif #endif -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - +#include "sysdep.h" #include "bfd.h" #include "libiberty.h" -#include "bucomm.h" #include "getopt.h" #include "dyn-string.h" +#include "bucomm.h" #include #include -#include #ifdef HAVE_SYS_WAIT_H #include @@ -509,6 +506,8 @@ usage (FILE *file, int status) fprintf (file, _(" --nodelete Keep temp files.\n")); fprintf (file, _(" Rest are passed unmodified to the language driver\n")); fprintf (file, "\n\n"); + if (REPORT_BUGS_TO[0] && status == 0) + fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); } diff --git a/binutils/doc/Makefile.am b/binutils/doc/Makefile.am index 1d043e7d3f8..ceeda41b004 100644 --- a/binutils/doc/Makefile.am +++ b/binutils/doc/Makefile.am @@ -28,20 +28,16 @@ man_MANS = \ strings.1 \ strip.1 \ windres.1 \ + windmc.1 \ $(DEMANGLER_NAME).1 info_TEXINFOS = binutils.texi -binutils_TEXINFOS = config.texi binutils_TEXI = $(srcdir)/binutils.texi -AM_MAKEINFOFLAGS = -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" -TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" - -config.texi: $(srcdir)/../../bfd/configure $(binutils_TEXI) - rm -f config.texi - eval `grep '^ *VERSION=' $(srcdir)/../../bfd/configure`; \ - echo "@set VERSION $$VERSION" > $@ - echo "@set UPDATED `date "+%B %Y"`" >> config.texi +AM_MAKEINFOFLAGS = -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" \ + -I ../../bfd/doc +TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" \ + -I ../../bfd/doc # Man page generation from texinfo addr2line.1: $(binutils_TEXI) $(binutils_TEXINFOS) @@ -135,6 +131,13 @@ windres.1: $(binutils_TEXI) $(binutils_TEXINFOS) mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f windres.pod +windmc.1: $(binutils_TEXI) $(binutils_TEXINFOS) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dwindmc < $(binutils_TEXI) > windmc.pod + -($(POD2MAN) windmc.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f windmc.pod + cxxfilt.man: $(binutils_TEXI) $(binutils_TEXINFOS) touch $@ -$(TEXI2POD) $(MANCONF) -Dcxxfilt < $(binutils_TEXI) > $(DEMANGLER_NAME).pod @@ -142,7 +145,6 @@ cxxfilt.man: $(binutils_TEXI) $(binutils_TEXINFOS) mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f $(DEMANGLER_NAME).pod -MAINTAINERCLEANFILES = config.texi MOSTLYCLEANFILES = $(DEMANGLER_NAME).1 $(DEMANGLER_NAME).1: cxxfilt.man Makefile @@ -180,6 +182,15 @@ install-html-am: $(HTMLS) fi; \ done +MAINTAINERCLEANFILES = binutils.info + +# Automake 1.9 will only build info files in the objdir if they are +# mentioned in DISTCLEANFILES. It doesn't have to be unconditional, +# though, so we use a bogus condition. +if GENINSRC_NEVER +DISTCLEANFILES = binutils.info +endif + # Maintenance # We need it for the taz target in ../../Makefile.in. diff --git a/binutils/doc/Makefile.in b/binutils/doc/Makefile.in index ef28ceff8df..338c9bad74e 100644 --- a/binutils/doc/Makefile.in +++ b/binutils/doc/Makefile.in @@ -37,14 +37,22 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(binutils_TEXINFOS) +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/../bfd/acinclude.m4 \ - $(top_srcdir)/../config/acx.m4 $(top_srcdir)/../bfd/bfd.m4 \ - $(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/../gettext.m4 $(top_srcdir)/configure.in +am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \ + $(top_srcdir)/../bfd/warning.m4 \ + $(top_srcdir)/../config/depstand.m4 \ + $(top_srcdir)/../config/gettext-sister.m4 \ + $(top_srcdir)/../config/iconv.m4 \ + $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/lib-ld.m4 \ + $(top_srcdir)/../config/lib-link.m4 \ + $(top_srcdir)/../config/lib-prefix.m4 \ + $(top_srcdir)/../config/nls.m4 $(top_srcdir)/../config/po.m4 \ + $(top_srcdir)/../config/progtest.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs @@ -53,7 +61,7 @@ CONFIG_CLEAN_FILES = depcomp = am__depfiles_maybe = SOURCES = -INFO_DEPS = $(srcdir)/binutils.info +INFO_DEPS = binutils.info TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex am__TEXINFO_TEX_DIR = $(top_srcdir)/../texinfo DVIS = binutils.dvi @@ -81,9 +89,11 @@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_DLLTOOL = @BUILD_DLLTOOL@ BUILD_DLLWRAP = @BUILD_DLLWRAP@ +BUILD_INSTALL_MISC = @BUILD_INSTALL_MISC@ BUILD_MISC = @BUILD_MISC@ BUILD_NLMCONV = @BUILD_NLMCONV@ BUILD_SRCONV = @BUILD_SRCONV@ +BUILD_WINDMC = @BUILD_WINDMC@ BUILD_WINDRES = @BUILD_WINDRES@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ @@ -99,6 +109,7 @@ DEFS = @DEFS@ DEMANGLER_NAME = @DEMANGLER_NAME@ DEPDIR = @DEPDIR@ DLLTOOL_DEFS = @DLLTOOL_DEFS@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ @@ -107,28 +118,32 @@ EMULATION = @EMULATION@ EMULATION_VECTOR = @EMULATION_VECTOR@ EXEEXT = @EXEEXT@ EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@ -GMOFILES = @GMOFILES@ +FGREP = @FGREP@ +GENCAT = @GENCAT@ +GENINSRC_NEVER_FALSE = @GENINSRC_NEVER_FALSE@ +GENINSRC_NEVER_TRUE = @GENINSRC_NEVER_TRUE@ GMSGFMT = @GMSGFMT@ -GT_NO = @GT_NO@ -GT_YES = @GT_YES@ +GREP = @GREP@ HDEFINES = @HDEFINES@ -INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +INCINTL = @INCINTL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ -INTLDEPS = @INTLDEPS@ -INTLLIBS = @INTLLIBS@ -INTLOBJS = @INTLOBJS@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBINTL_DEP = @LIBINTL_DEP@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ @@ -136,7 +151,9 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ NLMCONV_DEFS = @NLMCONV_DEFS@ +NM = @NM@ NO_WERROR = @NO_WERROR@ OBJDUMP_DEFS = @OBJDUMP_DEFS@ OBJEXT = @OBJEXT@ @@ -147,19 +164,20 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ -USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ XGETTEXT = @XGETTEXT@ YACC = @YACC@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ @@ -188,10 +206,10 @@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -l = @l@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -232,20 +250,29 @@ man_MANS = \ strings.1 \ strip.1 \ windres.1 \ + windmc.1 \ $(DEMANGLER_NAME).1 info_TEXINFOS = binutils.texi -binutils_TEXINFOS = config.texi binutils_TEXI = $(srcdir)/binutils.texi -AM_MAKEINFOFLAGS = -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" -TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" -MAINTAINERCLEANFILES = config.texi +AM_MAKEINFOFLAGS = -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" \ + -I ../../bfd/doc + +TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" \ + -I ../../bfd/doc + MOSTLYCLEANFILES = $(DEMANGLER_NAME).1 html__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +MAINTAINERCLEANFILES = binutils.info + +# Automake 1.9 will only build info files in the objdir if they are +# mentioned in DISTCLEANFILES. It doesn't have to be unconditional, +# though, so we use a bogus condition. +@GENINSRC_NEVER_TRUE@DISTCLEANFILES = binutils.info all: all-am .SUFFIXES: -.SUFFIXES: .dvi .html .info .pdf .ps .texi +.SUFFIXES: .dvi .ps $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -255,9 +282,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus doc/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign doc/Makefile + $(AUTOMAKE) --cygnus doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -285,42 +312,38 @@ clean-libtool: distclean-libtool: -rm -f libtool -.texi.info: +binutils.info: binutils.texi restore=: && backupdir="$(am__leading_dot)am$$$$" && \ - am__cwd=`pwd` && cd $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ - cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $@ $<; \ + -o $@ `test -f 'binutils.texi' || echo '$(srcdir)/'`binutils.texi; \ then \ rc=0; \ - cd $(srcdir); \ else \ rc=$$?; \ - cd $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc -.texi.dvi: +binutils.dvi: binutils.texi TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2DVI) $< + $(TEXI2DVI) -o $@ `test -f 'binutils.texi' || echo '$(srcdir)/'`binutils.texi -.texi.pdf: +binutils.pdf: binutils.texi TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2PDF) $< + $(TEXI2PDF) -o $@ `test -f 'binutils.texi' || echo '$(srcdir)/'`binutils.texi -.texi.html: +binutils.html: binutils.texi rm -rf $(@:.html=.htp) if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $(@:.html=.htp) $<; \ + -o $(@:.html=.htp) `test -f 'binutils.texi' || echo '$(srcdir)/'`binutils.texi; \ then \ rm -rf $@; \ if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ @@ -330,10 +353,6 @@ distclean-libtool: rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ exit 1; \ fi -$(srcdir)/binutils.info: binutils.texi $(binutils_TEXINFOS) -binutils.dvi: binutils.texi $(binutils_TEXINFOS) -binutils.pdf: binutils.texi $(binutils_TEXINFOS) -binutils.html: binutils.texi $(binutils_TEXINFOS) .dvi.ps: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ $(DVIPS) -o $@ $< @@ -469,6 +488,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -569,12 +589,6 @@ uninstall-man: uninstall-man1 uninstall-man uninstall-man1 -config.texi: $(srcdir)/../../bfd/configure $(binutils_TEXI) - rm -f config.texi - eval `grep '^ *VERSION=' $(srcdir)/../../bfd/configure`; \ - echo "@set VERSION $$VERSION" > $@ - echo "@set UPDATED `date "+%B %Y"`" >> config.texi - # Man page generation from texinfo addr2line.1: $(binutils_TEXI) $(binutils_TEXINFOS) touch $@ @@ -667,6 +681,13 @@ windres.1: $(binutils_TEXI) $(binutils_TEXINFOS) mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f windres.pod +windmc.1: $(binutils_TEXI) $(binutils_TEXINFOS) + touch $@ + -$(TEXI2POD) $(MANCONF) -Dwindmc < $(binutils_TEXI) > windmc.pod + -($(POD2MAN) windmc.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) + rm -f windmc.pod + cxxfilt.man: $(binutils_TEXI) $(binutils_TEXINFOS) touch $@ -$(TEXI2POD) $(MANCONF) -Dcxxfilt < $(binutils_TEXI) > $(DEMANGLER_NAME).pod diff --git a/binutils/doc/addr2line.1 b/binutils/doc/addr2line.1 deleted file mode 100644 index 71d1ea76398..00000000000 --- a/binutils/doc/addr2line.1 +++ /dev/null @@ -1,265 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "ADDR2LINE 1" -.TH ADDR2LINE 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -addr2line \- convert addresses into file names and line numbers. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -addr2line [\fB\-b\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR] - [\fB\-C\fR|\fB\-\-demangle\fR[=\fIstyle\fR]] - [\fB\-e\fR \fIfilename\fR|\fB\-\-exe=\fR\fIfilename\fR] - [\fB\-f\fR|\fB\-\-functions\fR] [\fB\-s\fR|\fB\-\-basename\fR] - [\fB\-i\fR|\fB\-\-inlines\fR] - [\fB\-j\fR|\fB\-\-section=\fR\fIname\fR] - [\fB\-H\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] - [addr addr ...] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBaddr2line\fR translates addresses into file names and line numbers. -Given an address in an executable or an offset in a section of a relocatable -object, it uses the debugging information to figure out which file name and -line number are associated with it. -.PP -The executable or relocatable object to use is specified with the \fB\-e\fR -option. The default is the file \fIa.out\fR. The section in the relocatable -object to use is specified with the \fB\-j\fR option. -.PP -\&\fBaddr2line\fR has two modes of operation. -.PP -In the first, hexadecimal addresses are specified on the command line, -and \fBaddr2line\fR displays the file name and line number for each -address. -.PP -In the second, \fBaddr2line\fR reads hexadecimal addresses from -standard input, and prints the file name and line number for each -address on standard output. In this mode, \fBaddr2line\fR may be used -in a pipe to convert dynamically chosen addresses. -.PP -The format of the output is \fB\s-1FILENAME:LINENO\s0\fR. The file name and -line number for each address is printed on a separate line. If the -\&\fB\-f\fR option is used, then each \fB\s-1FILENAME:LINENO\s0\fR line is -preceded by a \fB\s-1FUNCTIONNAME\s0\fR line which is the name of the function -containing the address. -.PP -If the file name or function name can not be determined, -\&\fBaddr2line\fR will print two question marks in their place. If the -line number can not be determined, \fBaddr2line\fR will print 0. -.SH "OPTIONS" -.IX Header "OPTIONS" -The long and short forms of options, shown here as alternatives, are -equivalent. -.IP "\fB\-b\fR \fIbfdname\fR" 4 -.IX Item "-b bfdname" -.PD 0 -.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 -.IX Item "--target=bfdname" -.PD -Specify that the object-code format for the object files is -\&\fIbfdname\fR. -.IP "\fB\-C\fR" 4 -.IX Item "-C" -.PD 0 -.IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4 -.IX Item "--demangle[=style]" -.PD -Decode (\fIdemangle\fR) low-level symbol names into user-level names. -Besides removing any initial underscore prepended by the system, this -makes \*(C+ function names readable. Different compilers have different -mangling styles. The optional demangling style argument can be used to -choose an appropriate demangling style for your compiler. -.IP "\fB\-e\fR \fIfilename\fR" 4 -.IX Item "-e filename" -.PD 0 -.IP "\fB\-\-exe=\fR\fIfilename\fR" 4 -.IX Item "--exe=filename" -.PD -Specify the name of the executable for which addresses should be -translated. The default file is \fIa.out\fR. -.IP "\fB\-f\fR" 4 -.IX Item "-f" -.PD 0 -.IP "\fB\-\-functions\fR" 4 -.IX Item "--functions" -.PD -Display function names as well as file and line number information. -.IP "\fB\-s\fR" 4 -.IX Item "-s" -.PD 0 -.IP "\fB\-\-basenames\fR" 4 -.IX Item "--basenames" -.PD -Display only the base of each file name. -.IP "\fB\-i\fR" 4 -.IX Item "-i" -.PD 0 -.IP "\fB\-\-inlines\fR" 4 -.IX Item "--inlines" -.PD -If the address belongs to a function that was inlined, the source -information for all enclosing scopes back to the first non-inlined -function will also be printed. For example, if \f(CW\*(C`main\*(C'\fR inlines -\&\f(CW\*(C`callee1\*(C'\fR which inlines \f(CW\*(C`callee2\*(C'\fR, and address is from -\&\f(CW\*(C`callee2\*(C'\fR, the source information for \f(CW\*(C`callee1\*(C'\fR and \f(CW\*(C`main\*(C'\fR -will also be printed. -.IP "\fB\-j\fR" 4 -.IX Item "-j" -.PD 0 -.IP "\fB\-\-section\fR" 4 -.IX Item "--section" -.PD -Read offsets relative to the specified section instead of absolute addresses. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/ar.1 b/binutils/doc/ar.1 deleted file mode 100644 index 5985ca15e44..00000000000 --- a/binutils/doc/ar.1 +++ /dev/null @@ -1,390 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "AR 1" -.TH AR 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -ar \- create, modify, and extract from archives -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -ar [\fB\-X32_64\fR] [\fB\-\fR]\fIp\fR[\fImod\fR [\fIrelpos\fR] [\fIcount\fR]] \fIarchive\fR [\fImember\fR...] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -The \s-1GNU\s0 \fBar\fR program creates, modifies, and extracts from -archives. An \fIarchive\fR is a single file holding a collection of -other files in a structure that makes it possible to retrieve -the original individual files (called \fImembers\fR of the archive). -.PP -The original files' contents, mode (permissions), timestamp, owner, and -group are preserved in the archive, and can be restored on -extraction. -.PP -\&\s-1GNU\s0 \fBar\fR can maintain archives whose members have names of any -length; however, depending on how \fBar\fR is configured on your -system, a limit on member-name length may be imposed for compatibility -with archive formats maintained with other tools. If it exists, the -limit is often 15 characters (typical of formats related to a.out) or 16 -characters (typical of formats related to coff). -.PP -\&\fBar\fR is considered a binary utility because archives of this sort -are most often used as \fIlibraries\fR holding commonly needed -subroutines. -.PP -\&\fBar\fR creates an index to the symbols defined in relocatable -object modules in the archive when you specify the modifier \fBs\fR. -Once created, this index is updated in the archive whenever \fBar\fR -makes a change to its contents (save for the \fBq\fR update operation). -An archive with such an index speeds up linking to the library, and -allows routines in the library to call each other without regard to -their placement in the archive. -.PP -You may use \fBnm \-s\fR or \fBnm \-\-print\-armap\fR to list this index -table. If an archive lacks the table, another form of \fBar\fR called -\&\fBranlib\fR can be used to add just the table. -.PP -\&\s-1GNU\s0 \fBar\fR is designed to be compatible with two different -facilities. You can control its activity using command-line options, -like the different varieties of \fBar\fR on Unix systems; or, if you -specify the single command-line option \fB\-M\fR, you can control it -with a script supplied via standard input, like the \s-1MRI\s0 \*(L"librarian\*(R" -program. -.SH "OPTIONS" -.IX Header "OPTIONS" -\&\s-1GNU\s0 \fBar\fR allows you to mix the operation code \fIp\fR and modifier -flags \fImod\fR in any order, within the first command-line argument. -.PP -If you wish, you may begin the first command-line argument with a -dash. -.PP -The \fIp\fR keyletter specifies what operation to execute; it may be -any of the following, but you must specify only one of them: -.IP "\fBd\fR" 4 -.IX Item "d" -\&\fIDelete\fR modules from the archive. Specify the names of modules to -be deleted as \fImember\fR...; the archive is untouched if you -specify no files to delete. -.Sp -If you specify the \fBv\fR modifier, \fBar\fR lists each module -as it is deleted. -.IP "\fBm\fR" 4 -.IX Item "m" -Use this operation to \fImove\fR members in an archive. -.Sp -The ordering of members in an archive can make a difference in how -programs are linked using the library, if a symbol is defined in more -than one member. -.Sp -If no modifiers are used with \f(CW\*(C`m\*(C'\fR, any members you name in the -\&\fImember\fR arguments are moved to the \fIend\fR of the archive; -you can use the \fBa\fR, \fBb\fR, or \fBi\fR modifiers to move them to a -specified place instead. -.IP "\fBp\fR" 4 -.IX Item "p" -\&\fIPrint\fR the specified members of the archive, to the standard -output file. If the \fBv\fR modifier is specified, show the member -name before copying its contents to standard output. -.Sp -If you specify no \fImember\fR arguments, all the files in the archive are -printed. -.IP "\fBq\fR" 4 -.IX Item "q" -\&\fIQuick append\fR; Historically, add the files \fImember\fR... to the end of -\&\fIarchive\fR, without checking for replacement. -.Sp -The modifiers \fBa\fR, \fBb\fR, and \fBi\fR do \fInot\fR affect this -operation; new members are always placed at the end of the archive. -.Sp -The modifier \fBv\fR makes \fBar\fR list each file as it is appended. -.Sp -Since the point of this operation is speed, the archive's symbol table -index is not updated, even if it already existed; you can use \fBar s\fR or -\&\fBranlib\fR explicitly to update the symbol table index. -.Sp -However, too many different systems assume quick append rebuilds the -index, so \s-1GNU\s0 \fBar\fR implements \fBq\fR as a synonym for \fBr\fR. -.IP "\fBr\fR" 4 -.IX Item "r" -Insert the files \fImember\fR... into \fIarchive\fR (with -\&\fIreplacement\fR). This operation differs from \fBq\fR in that any -previously existing members are deleted if their names match those being -added. -.Sp -If one of the files named in \fImember\fR... does not exist, \fBar\fR -displays an error message, and leaves undisturbed any existing members -of the archive matching that name. -.Sp -By default, new members are added at the end of the file; but you may -use one of the modifiers \fBa\fR, \fBb\fR, or \fBi\fR to request -placement relative to some existing member. -.Sp -The modifier \fBv\fR used with this operation elicits a line of -output for each file inserted, along with one of the letters \fBa\fR or -\&\fBr\fR to indicate whether the file was appended (no old member -deleted) or replaced. -.IP "\fBt\fR" 4 -.IX Item "t" -Display a \fItable\fR listing the contents of \fIarchive\fR, or those -of the files listed in \fImember\fR... that are present in the -archive. Normally only the member name is shown; if you also want to -see the modes (permissions), timestamp, owner, group, and size, you can -request that by also specifying the \fBv\fR modifier. -.Sp -If you do not specify a \fImember\fR, all files in the archive -are listed. -.Sp -If there is more than one file with the same name (say, \fBfie\fR) in -an archive (say \fBb.a\fR), \fBar t b.a fie\fR lists only the -first instance; to see them all, you must ask for a complete -listing\-\-\-in our example, \fBar t b.a\fR. -.IP "\fBx\fR" 4 -.IX Item "x" -\&\fIExtract\fR members (named \fImember\fR) from the archive. You can -use the \fBv\fR modifier with this operation, to request that -\&\fBar\fR list each name as it extracts it. -.Sp -If you do not specify a \fImember\fR, all files in the archive -are extracted. -.PP -A number of modifiers (\fImod\fR) may immediately follow the \fIp\fR -keyletter, to specify variations on an operation's behavior: -.IP "\fBa\fR" 4 -.IX Item "a" -Add new files \fIafter\fR an existing member of the -archive. If you use the modifier \fBa\fR, the name of an existing archive -member must be present as the \fIrelpos\fR argument, before the -\&\fIarchive\fR specification. -.IP "\fBb\fR" 4 -.IX Item "b" -Add new files \fIbefore\fR an existing member of the -archive. If you use the modifier \fBb\fR, the name of an existing archive -member must be present as the \fIrelpos\fR argument, before the -\&\fIarchive\fR specification. (same as \fBi\fR). -.IP "\fBc\fR" 4 -.IX Item "c" -\&\fICreate\fR the archive. The specified \fIarchive\fR is always -created if it did not exist, when you request an update. But a warning is -issued unless you specify in advance that you expect to create it, by -using this modifier. -.IP "\fBf\fR" 4 -.IX Item "f" -Truncate names in the archive. \s-1GNU\s0 \fBar\fR will normally permit file -names of any length. This will cause it to create archives which are -not compatible with the native \fBar\fR program on some systems. If -this is a concern, the \fBf\fR modifier may be used to truncate file -names when putting them in the archive. -.IP "\fBi\fR" 4 -.IX Item "i" -Insert new files \fIbefore\fR an existing member of the -archive. If you use the modifier \fBi\fR, the name of an existing archive -member must be present as the \fIrelpos\fR argument, before the -\&\fIarchive\fR specification. (same as \fBb\fR). -.IP "\fBl\fR" 4 -.IX Item "l" -This modifier is accepted but not used. -.IP "\fBN\fR" 4 -.IX Item "N" -Uses the \fIcount\fR parameter. This is used if there are multiple -entries in the archive with the same name. Extract or delete instance -\&\fIcount\fR of the given name from the archive. -.IP "\fBo\fR" 4 -.IX Item "o" -Preserve the \fIoriginal\fR dates of members when extracting them. If -you do not specify this modifier, files extracted from the archive -are stamped with the time of extraction. -.IP "\fBP\fR" 4 -.IX Item "P" -Use the full path name when matching names in the archive. \s-1GNU\s0 -\&\fBar\fR can not create an archive with a full path name (such archives -are not \s-1POSIX\s0 complaint), but other archive creators can. This option -will cause \s-1GNU\s0 \fBar\fR to match file names using a complete path -name, which can be convenient when extracting a single file from an -archive created by another tool. -.IP "\fBs\fR" 4 -.IX Item "s" -Write an object-file index into the archive, or update an existing one, -even if no other change is made to the archive. You may use this modifier -flag either with any operation, or alone. Running \fBar s\fR on an -archive is equivalent to running \fBranlib\fR on it. -.IP "\fBS\fR" 4 -.IX Item "S" -Do not generate an archive symbol table. This can speed up building a -large library in several steps. The resulting archive can not be used -with the linker. In order to build a symbol table, you must omit the -\&\fBS\fR modifier on the last execution of \fBar\fR, or you must run -\&\fBranlib\fR on the archive. -.IP "\fBu\fR" 4 -.IX Item "u" -Normally, \fBar r\fR... inserts all files -listed into the archive. If you would like to insert \fIonly\fR those -of the files you list that are newer than existing members of the same -names, use this modifier. The \fBu\fR modifier is allowed only for the -operation \fBr\fR (replace). In particular, the combination \fBqu\fR is -not allowed, since checking the timestamps would lose any speed -advantage from the operation \fBq\fR. -.IP "\fBv\fR" 4 -.IX Item "v" -This modifier requests the \fIverbose\fR version of an operation. Many -operations display additional information, such as filenames processed, -when the modifier \fBv\fR is appended. -.IP "\fBV\fR" 4 -.IX Item "V" -This modifier shows the version number of \fBar\fR. -.PP -\&\fBar\fR ignores an initial option spelt \fB\-X32_64\fR, for -compatibility with \s-1AIX\s0. The behaviour produced by this option is the -default for \s-1GNU\s0 \fBar\fR. \fBar\fR does not support any of the other -\&\fB\-X\fR options; in particular, it does not support \fB\-X32\fR -which is the default for \s-1AIX\s0 \fBar\fR. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fInm\fR\|(1), \fIranlib\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/binutils.info b/binutils/doc/binutils.info deleted file mode 100644 index dcb79bedfb6..00000000000 --- a/binutils/doc/binutils.info +++ /dev/null @@ -1,3835 +0,0 @@ -This is ../.././binutils/doc/binutils.info, produced by makeinfo -version 4.8 from ../.././binutils/doc/binutils.texi. - -START-INFO-DIR-ENTRY -* Binutils: (binutils). The GNU binary utilities. -* ar: (binutils)ar. Create, modify, and extract from archives -* nm: (binutils)nm. List symbols from object files -* objcopy: (binutils)objcopy. Copy and translate object files -* objdump: (binutils)objdump. Display information from object files -* ranlib: (binutils)ranlib. Generate index to archive contents -* readelf: (binutils)readelf. Display the contents of ELF format files. -* size: (binutils)size. List section sizes and total size -* strings: (binutils)strings. List printable strings from files -* strip: (binutils)strip. Discard symbols -* c++filt: (binutils)c++filt. Filter to demangle encoded C++ symbols -* cxxfilt: (binutils)c++filt. MS-DOS name for c++filt -* addr2line: (binutils)addr2line. Convert addresses to file and line -* nlmconv: (binutils)nlmconv. Converts object code into an NLM -* windres: (binutils)windres. Manipulate Windows resources -* dlltool: (binutils)dlltool. Create files needed to build and use DLLs -END-INFO-DIR-ENTRY - - Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - - Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.1 or -any later version published by the Free Software Foundation; with no -Invariant Sections, with no Front-Cover Texts, and with no Back-Cover -Texts. A copy of the license is included in the section entitled "GNU -Free Documentation License". - - -File: binutils.info, Node: Top, Next: ar, Up: (dir) - -Introduction -************ - -This brief manual contains documentation for the GNU binary utilities -(collectively version 2.17): - - This document is distributed under the terms of the GNU Free -Documentation License. A copy of the license is included in the -section entitled "GNU Free Documentation License". - -* Menu: - -* ar:: Create, modify, and extract from archives -* nm:: List symbols from object files -* objcopy:: Copy and translate object files -* objdump:: Display information from object files -* ranlib:: Generate index to archive contents -* readelf:: Display the contents of ELF format files. -* size:: List section sizes and total size -* strings:: List printable strings from files -* strip:: Discard symbols -* c++filt:: Filter to demangle encoded C++ symbols -* cxxfilt: c++filt. MS-DOS name for c++filt -* addr2line:: Convert addresses to file and line -* nlmconv:: Converts object code into an NLM -* windres:: Manipulate Windows resources -* dlltool:: Create files needed to build and use DLLs -* Common Options:: Command-line options for all utilities -* Selecting The Target System:: How these utilities determine the target. -* Reporting Bugs:: Reporting Bugs -* GNU Free Documentation License:: GNU Free Documentation License -* Index:: Index - - -File: binutils.info, Node: ar, Next: nm, Prev: Top, Up: Top - -1 ar -**** - - ar [-]P[MOD [RELPOS] [COUNT]] ARCHIVE [MEMBER...] - ar -M [ '), and continues executing even after errors. If you -redirect standard input to a script file, no prompts are issued, and -`ar' abandons execution (with a nonzero exit code) on any error. - - The `ar' command language is _not_ designed to be equivalent to the -command-line options; in fact, it provides somewhat less control over -archives. The only purpose of the command language is to ease the -transition to GNU `ar' for developers who already have scripts written -for the MRI "librarian" program. - - The syntax for the `ar' command language is straightforward: - * commands are recognized in upper or lower case; for example, `LIST' - is the same as `list'. In the following descriptions, commands are - shown in upper case for clarity. - - * a single command may appear on each line; it is the first word on - the line. - - * empty lines are allowed, and have no effect. - - * comments are allowed; text after either of the characters `*' or - `;' is ignored. - - * Whenever you use a list of names as part of the argument to an `ar' - command, you can separate the individual names with either commas - or blanks. Commas are shown in the explanations below, for - clarity. - - * `+' is used as a line continuation character; if `+' appears at - the end of a line, the text on the following line is considered - part of the current command. - - Here are the commands you can use in `ar' scripts, or when using -`ar' interactively. Three of them have special significance: - - `OPEN' or `CREATE' specify a "current archive", which is a temporary -file required for most of the other commands. - - `SAVE' commits the changes so far specified by the script. Prior to -`SAVE', commands affect only the temporary copy of the current archive. - -`ADDLIB ARCHIVE' -`ADDLIB ARCHIVE (MODULE, MODULE, ... MODULE)' - Add all the contents of ARCHIVE (or, if specified, each named - MODULE from ARCHIVE) to the current archive. - - Requires prior use of `OPEN' or `CREATE'. - -`ADDMOD MEMBER, MEMBER, ... MEMBER' - Add each named MEMBER as a module in the current archive. - - Requires prior use of `OPEN' or `CREATE'. - -`CLEAR' - Discard the contents of the current archive, canceling the effect - of any operations since the last `SAVE'. May be executed (with no - effect) even if no current archive is specified. - -`CREATE ARCHIVE' - Creates an archive, and makes it the current archive (required for - many other commands). The new archive is created with a temporary - name; it is not actually saved as ARCHIVE until you use `SAVE'. - You can overwrite existing archives; similarly, the contents of any - existing file named ARCHIVE will not be destroyed until `SAVE'. - -`DELETE MODULE, MODULE, ... MODULE' - Delete each listed MODULE from the current archive; equivalent to - `ar -d ARCHIVE MODULE ... MODULE'. - - Requires prior use of `OPEN' or `CREATE'. - -`DIRECTORY ARCHIVE (MODULE, ... MODULE)' -`DIRECTORY ARCHIVE (MODULE, ... MODULE) OUTPUTFILE' - List each named MODULE present in ARCHIVE. The separate command - `VERBOSE' specifies the form of the output: when verbose output is - off, output is like that of `ar -t ARCHIVE MODULE...'. When - verbose output is on, the listing is like `ar -tv ARCHIVE - MODULE...'. - - Output normally goes to the standard output stream; however, if you - specify OUTPUTFILE as a final argument, `ar' directs the output to - that file. - -`END' - Exit from `ar', with a `0' exit code to indicate successful - completion. This command does not save the output file; if you - have changed the current archive since the last `SAVE' command, - those changes are lost. - -`EXTRACT MODULE, MODULE, ... MODULE' - Extract each named MODULE from the current archive, writing them - into the current directory as separate files. Equivalent to `ar -x - ARCHIVE MODULE...'. - - Requires prior use of `OPEN' or `CREATE'. - -`LIST' - Display full contents of the current archive, in "verbose" style - regardless of the state of `VERBOSE'. The effect is like `ar tv - ARCHIVE'. (This single command is a GNU `ar' enhancement, rather - than present for MRI compatibility.) - - Requires prior use of `OPEN' or `CREATE'. - -`OPEN ARCHIVE' - Opens an existing archive for use as the current archive (required - for many other commands). Any changes as the result of subsequent - commands will not actually affect ARCHIVE until you next use - `SAVE'. - -`REPLACE MODULE, MODULE, ... MODULE' - In the current archive, replace each existing MODULE (named in the - `REPLACE' arguments) from files in the current working directory. - To execute this command without errors, both the file, and the - module in the current archive, must exist. - - Requires prior use of `OPEN' or `CREATE'. - -`VERBOSE' - Toggle an internal flag governing the output from `DIRECTORY'. - When the flag is on, `DIRECTORY' output matches output from `ar - -tv '.... - -`SAVE' - Commit your changes to the current archive, and actually save it - as a file with the name specified in the last `CREATE' or `OPEN' - command. - - Requires prior use of `OPEN' or `CREATE'. - - - -File: binutils.info, Node: nm, Next: objcopy, Prev: ar, Up: Top - -2 nm -**** - - nm [`-a'|`--debug-syms'] [`-g'|`--extern-only'] - [`-B'] [`-C'|`--demangle'[=STYLE]] [`-D'|`--dynamic'] - [`-S'|`--print-size'] [`-s'|`--print-armap'] - [`-A'|`-o'|`--print-file-name'][`--special-syms'] - [`-n'|`-v'|`--numeric-sort'] [`-p'|`--no-sort'] - [`-r'|`--reverse-sort'] [`--size-sort'] [`-u'|`--undefined-only'] - [`-t' RADIX|`--radix='RADIX] [`-P'|`--portability'] - [`--target='BFDNAME] [`-f'FORMAT|`--format='FORMAT] - [`--defined-only'] [`-l'|`--line-numbers'] [`--no-demangle'] - [`-V'|`--version'] [`-X 32_64'] [`--help'] [OBJFILE...] - - GNU `nm' lists the symbols from object files OBJFILE.... If no -object files are listed as arguments, `nm' assumes the file `a.out'. - - For each symbol, `nm' shows: - - * The symbol value, in the radix selected by options (see below), or - hexadecimal by default. - - * The symbol type. At least the following types are used; others - are, as well, depending on the object file format. If lowercase, - the symbol is local; if uppercase, the symbol is global (external). - - `A' - The symbol's value is absolute, and will not be changed by - further linking. - - `B' - The symbol is in the uninitialized data section (known as - BSS). - - `C' - The symbol is common. Common symbols are uninitialized data. - When linking, multiple common symbols may appear with the - same name. If the symbol is defined anywhere, the common - symbols are treated as undefined references. For more - details on common symbols, see the discussion of -warn-common - in *Note Linker options: (ld.info)Options. - - `D' - The symbol is in the initialized data section. - - `G' - The symbol is in an initialized data section for small - objects. Some object file formats permit more efficient - access to small data objects, such as a global int variable - as opposed to a large global array. - - `I' - The symbol is an indirect reference to another symbol. This - is a GNU extension to the a.out object file format which is - rarely used. - - `N' - The symbol is a debugging symbol. - - `R' - The symbol is in a read only data section. - - `S' - The symbol is in an uninitialized data section for small - objects. - - `T' - The symbol is in the text (code) section. - - `U' - The symbol is undefined. - - `V' - The symbol is a weak object. When a weak defined symbol is - linked with a normal defined symbol, the normal defined - symbol is used with no error. When a weak undefined symbol - is linked and the symbol is not defined, the value of the - weak symbol becomes zero with no error. - - `W' - The symbol is a weak symbol that has not been specifically - tagged as a weak object symbol. When a weak defined symbol - is linked with a normal defined symbol, the normal defined - symbol is used with no error. When a weak undefined symbol - is linked and the symbol is not defined, the value of the - symbol is determined in a system-specific manner without - error. On some systems, uppercase indicates that a default - value has been specified. - - `-' - The symbol is a stabs symbol in an a.out object file. In - this case, the next values printed are the stabs other field, - the stabs desc field, and the stab type. Stabs symbols are - used to hold debugging information. For more information, - see *Note Stabs: (stabs.info)Top. - - `?' - The symbol type is unknown, or object file format specific. - - * The symbol name. - - The long and short forms of options, shown here as alternatives, are -equivalent. - -`-A' -`-o' -`--print-file-name' - Precede each symbol by the name of the input file (or archive - member) in which it was found, rather than identifying the input - file once only, before all of its symbols. - -`-a' -`--debug-syms' - Display all symbols, even debugger-only symbols; normally these - are not listed. - -`-B' - The same as `--format=bsd' (for compatibility with the MIPS `nm'). - -`-C' -`--demangle[=STYLE]' - Decode ("demangle") low-level symbol names into user-level names. - Besides removing any initial underscore prepended by the system, - this makes C++ function names readable. Different compilers have - different mangling styles. The optional demangling style argument - can be used to choose an appropriate demangling style for your - compiler. *Note c++filt::, for more information on demangling. - -`--no-demangle' - Do not demangle low-level symbol names. This is the default. - -`-D' -`--dynamic' - Display the dynamic symbols rather than the normal symbols. This - is only meaningful for dynamic objects, such as certain types of - shared libraries. - -`-f FORMAT' -`--format=FORMAT' - Use the output format FORMAT, which can be `bsd', `sysv', or - `posix'. The default is `bsd'. Only the first character of - FORMAT is significant; it can be either upper or lower case. - -`-g' -`--extern-only' - Display only external symbols. - -`-l' -`--line-numbers' - For each symbol, use debugging information to try to find a - filename and line number. For a defined symbol, look for the line - number of the address of the symbol. For an undefined symbol, - look for the line number of a relocation entry which refers to the - symbol. If line number information can be found, print it after - the other symbol information. - -`-n' -`-v' -`--numeric-sort' - Sort symbols numerically by their addresses, rather than - alphabetically by their names. - -`-p' -`--no-sort' - Do not bother to sort the symbols in any order; print them in the - order encountered. - -`-P' -`--portability' - Use the POSIX.2 standard output format instead of the default - format. Equivalent to `-f posix'. - -`-S' -`--print-size' - Print size, not the value, of defined symbols for the `bsd' output - format. - -`-s' -`--print-armap' - When listing symbols from archive members, include the index: a - mapping (stored in the archive by `ar' or `ranlib') of which - modules contain definitions for which names. - -`-r' -`--reverse-sort' - Reverse the order of the sort (whether numeric or alphabetic); let - the last come first. - -`--size-sort' - Sort symbols by size. The size is computed as the difference - between the value of the symbol and the value of the symbol with - the next higher value. If the `bsd' output format is used the - size of the symbol is printed, rather than the value, and `-S' - must be used in order both size and value to be printed. - -`--special-syms' - Display symbols which have a target-specific special meaning. - These symbols are usually used by the target for some special - processing and are not normally helpful when included included in - the normal symbol lists. For example for ARM targets this option - would skip the mapping symbols used to mark transistions between - ARM code, THUMB code and data. - -`-t RADIX' -`--radix=RADIX' - Use RADIX as the radix for printing the symbol values. It must be - `d' for decimal, `o' for octal, or `x' for hexadecimal. - -`--target=BFDNAME' - Specify an object code format other than your system's default - format. *Note Target Selection::, for more information. - -`-u' -`--undefined-only' - Display only undefined symbols (those external to each object - file). - -`--defined-only' - Display only defined symbols for each object file. - -`-V' -`--version' - Show the version number of `nm' and exit. - -`-X' - This option is ignored for compatibility with the AIX version of - `nm'. It takes one parameter which must be the string `32_64'. - The default mode of AIX `nm' corresponds to `-X 32', which is not - supported by GNU `nm'. - -`--help' - Show a summary of the options to `nm' and exit. - - -File: binutils.info, Node: objcopy, Next: objdump, Prev: nm, Up: Top - -3 objcopy -********* - - objcopy [`-F' BFDNAME|`--target='BFDNAME] - [`-I' BFDNAME|`--input-target='BFDNAME] - [`-O' BFDNAME|`--output-target='BFDNAME] - [`-B' BFDARCH|`--binary-architecture='BFDARCH] - [`-S'|`--strip-all'] - [`-g'|`--strip-debug'] - [`-K' SYMBOLNAME|`--keep-symbol='SYMBOLNAME] - [`-N' SYMBOLNAME|`--strip-symbol='SYMBOLNAME] - [`--strip-unneeded-symbol='SYMBOLNAME] - [`-G' SYMBOLNAME|`--keep-global-symbol='SYMBOLNAME] - [`-L' SYMBOLNAME|`--localize-symbol='SYMBOLNAME] - [`--globalize-symbol='SYMBOLNAME] - [`-W' SYMBOLNAME|`--weaken-symbol='SYMBOLNAME] - [`-w'|`--wildcard'] - [`-x'|`--discard-all'] - [`-X'|`--discard-locals'] - [`-b' BYTE|`--byte='BYTE] - [`-i' INTERLEAVE|`--interleave='INTERLEAVE] - [`-j' SECTIONNAME|`--only-section='SECTIONNAME] - [`-R' SECTIONNAME|`--remove-section='SECTIONNAME] - [`-p'|`--preserve-dates'] - [`--debugging'] - [`--gap-fill='VAL] - [`--pad-to='ADDRESS] - [`--set-start='VAL] - [`--adjust-start='INCR] - [`--change-addresses='INCR] - [`--change-section-address' SECTION{=,+,-}VAL] - [`--change-section-lma' SECTION{=,+,-}VAL] - [`--change-section-vma' SECTION{=,+,-}VAL] - [`--change-warnings'] [`--no-change-warnings'] - [`--set-section-flags' SECTION=FLAGS] - [`--add-section' SECTIONNAME=FILENAME] - [`--rename-section' OLDNAME=NEWNAME[,FLAGS]] - [`--change-leading-char'] [`--remove-leading-char'] - [`--srec-len='IVAL] [`--srec-forceS3'] - [`--redefine-sym' OLD=NEW] - [`--redefine-syms='FILENAME] - [`--weaken'] - [`--keep-symbols='FILENAME] - [`--strip-symbols='FILENAME] - [`--strip-unneeded-symbols='FILENAME] - [`--keep-global-symbols='FILENAME] - [`--localize-symbols='FILENAME] - [`--globalize-symbols='FILENAME] - [`--weaken-symbols='FILENAME] - [`--alt-machine-code='INDEX] - [`--prefix-symbols='STRING] - [`--prefix-sections='STRING] - [`--prefix-alloc-sections='STRING] - [`--add-gnu-debuglink='PATH-TO-FILE] - [`--keep-file-symbols'] - [`--only-keep-debug'] - [`--writable-text'] - [`--readonly-text'] - [`--pure'] - [`--impure'] - [`-v'|`--verbose'] - [`-V'|`--version'] - [`--help'] [`--info'] - INFILE [OUTFILE] - - The GNU `objcopy' utility copies the contents of an object file to -another. `objcopy' uses the GNU BFD Library to read and write the -object files. It can write the destination object file in a format -different from that of the source object file. The exact behavior of -`objcopy' is controlled by command-line options. Note that `objcopy' -should be able to copy a fully linked file between any two formats. -However, copying a relocatable object file between any two formats may -not work as expected. - - `objcopy' creates temporary files to do its translations and deletes -them afterward. `objcopy' uses BFD to do all its translation work; it -has access to all the formats described in BFD and thus is able to -recognize most formats without being told explicitly. *Note BFD: -(ld.info)BFD. - - `objcopy' can be used to generate S-records by using an output -target of `srec' (e.g., use `-O srec'). - - `objcopy' can be used to generate a raw binary file by using an -output target of `binary' (e.g., use `-O binary'). When `objcopy' -generates a raw binary file, it will essentially produce a memory dump -of the contents of the input object file. All symbols and relocation -information will be discarded. The memory dump will start at the load -address of the lowest section copied into the output file. - - When generating an S-record or a raw binary file, it may be helpful -to use `-S' to remove sections containing debugging information. In -some cases `-R' will be useful to remove sections which contain -information that is not needed by the binary file. - - Note--`objcopy' is not able to change the endianness of its input -files. If the input format has an endianness (some formats do not), -`objcopy' can only copy the inputs into file formats that have the same -endianness or which have no endianness (e.g., `srec'). - -`INFILE' -`OUTFILE' - The input and output files, respectively. If you do not specify - OUTFILE, `objcopy' creates a temporary file and destructively - renames the result with the name of INFILE. - -`-I BFDNAME' -`--input-target=BFDNAME' - Consider the source file's object format to be BFDNAME, rather than - attempting to deduce it. *Note Target Selection::, for more - information. - -`-O BFDNAME' -`--output-target=BFDNAME' - Write the output file using the object format BFDNAME. *Note - Target Selection::, for more information. - -`-F BFDNAME' -`--target=BFDNAME' - Use BFDNAME as the object format for both the input and the output - file; i.e., simply transfer data from source to destination with no - translation. *Note Target Selection::, for more information. - -`-B BFDARCH' -`--binary-architecture=BFDARCH' - Useful when transforming a raw binary input file into an object - file. In this case the output architecture can be set to BFDARCH. - This option will be ignored if the input file has a known BFDARCH. - You can access this binary data inside a program by referencing - the special symbols that are created by the conversion process. - These symbols are called _binary_OBJFILE_start, - _binary_OBJFILE_end and _binary_OBJFILE_size. e.g. you can - transform a picture file into an object file and then access it in - your code using these symbols. - -`-j SECTIONNAME' -`--only-section=SECTIONNAME' - Copy only the named section from the input file to the output file. - This option may be given more than once. Note that using this - option inappropriately may make the output file unusable. - -`-R SECTIONNAME' -`--remove-section=SECTIONNAME' - Remove any section named SECTIONNAME from the output file. This - option may be given more than once. Note that using this option - inappropriately may make the output file unusable. - -`-S' -`--strip-all' - Do not copy relocation and symbol information from the source file. - -`-g' -`--strip-debug' - Do not copy debugging symbols or sections from the source file. - -`--strip-unneeded' - Strip all symbols that are not needed for relocation processing. - -`-K SYMBOLNAME' -`--keep-symbol=SYMBOLNAME' - When stripping symbols, keep symbol SYMBOLNAME even if it would - normally be stripped. This option may be given more than once. - -`-N SYMBOLNAME' -`--strip-symbol=SYMBOLNAME' - Do not copy symbol SYMBOLNAME from the source file. This option - may be given more than once. - -`--strip-unneeded-symbol=SYMBOLNAME' - Do not copy symbol SYMBOLNAME from the source file unless it is - needed by a relocation. This option may be given more than once. - -`-G SYMBOLNAME' -`--keep-global-symbol=SYMBOLNAME' - Keep only symbol SYMBOLNAME global. Make all other symbols local - to the file, so that they are not visible externally. This option - may be given more than once. - -`-L SYMBOLNAME' -`--localize-symbol=SYMBOLNAME' - Make symbol SYMBOLNAME local to the file, so that it is not - visible externally. This option may be given more than once. - -`-W SYMBOLNAME' -`--weaken-symbol=SYMBOLNAME' - Make symbol SYMBOLNAME weak. This option may be given more than - once. - -`--globalize-symbol=SYMBOLNAME' - Give symbol SYMBOLNAME global scoping so that it is visible - outside of the file in which it is defined. This option may be - given more than once. - -`-w' -`--wildcard' - Permit regular expressions in SYMBOLNAMEs used in other command - line options. The question mark (?), asterisk (*), backslash (\) - and square brackets ([]) operators can be used anywhere in the - symbol name. If the first character of the symbol name is the - exclamation point (!) then the sense of the switch is reversed for - that symbol. For example: - - -w -W !foo -W fo* - - would cause objcopy to weaken all symbols that start with "fo" - except for the symbol "foo". - -`-x' -`--discard-all' - Do not copy non-global symbols from the source file. - -`-X' -`--discard-locals' - Do not copy compiler-generated local symbols. (These usually - start with `L' or `.'.) - -`-b BYTE' -`--byte=BYTE' - Keep only every BYTEth byte of the input file (header data is not - affected). BYTE can be in the range from 0 to INTERLEAVE-1, where - INTERLEAVE is given by the `-i' or `--interleave' option, or the - default of 4. This option is useful for creating files to program - ROM. It is typically used with an `srec' output target. - -`-i INTERLEAVE' -`--interleave=INTERLEAVE' - Only copy one out of every INTERLEAVE bytes. Select which byte to - copy with the `-b' or `--byte' option. The default is 4. - `objcopy' ignores this option if you do not specify either `-b' or - `--byte'. - -`-p' -`--preserve-dates' - Set the access and modification dates of the output file to be the - same as those of the input file. - -`--debugging' - Convert debugging information, if possible. This is not the - default because only certain debugging formats are supported, and - the conversion process can be time consuming. - -`--gap-fill VAL' - Fill gaps between sections with VAL. This operation applies to - the _load address_ (LMA) of the sections. It is done by increasing - the size of the section with the lower address, and filling in the - extra space created with VAL. - -`--pad-to ADDRESS' - Pad the output file up to the load address ADDRESS. This is done - by increasing the size of the last section. The extra space is - filled in with the value specified by `--gap-fill' (default zero). - -`--set-start VAL' - Set the start address of the new file to VAL. Not all object file - formats support setting the start address. - -`--change-start INCR' -`--adjust-start INCR' - Change the start address by adding INCR. Not all object file - formats support setting the start address. - -`--change-addresses INCR' -`--adjust-vma INCR' - Change the VMA and LMA addresses of all sections, as well as the - start address, by adding INCR. Some object file formats do not - permit section addresses to be changed arbitrarily. Note that - this does not relocate the sections; if the program expects - sections to be loaded at a certain address, and this option is - used to change the sections such that they are loaded at a - different address, the program may fail. - -`--change-section-address SECTION{=,+,-}VAL' -`--adjust-section-vma SECTION{=,+,-}VAL' - Set or change both the VMA address and the LMA address of the named - SECTION. If `=' is used, the section address is set to VAL. - Otherwise, VAL is added to or subtracted from the section address. - See the comments under `--change-addresses', above. If SECTION - does not exist in the input file, a warning will be issued, unless - `--no-change-warnings' is used. - -`--change-section-lma SECTION{=,+,-}VAL' - Set or change the LMA address of the named SECTION. The LMA - address is the address where the section will be loaded into - memory at program load time. Normally this is the same as the VMA - address, which is the address of the section at program run time, - but on some systems, especially those where a program is held in - ROM, the two can be different. If `=' is used, the section - address is set to VAL. Otherwise, VAL is added to or subtracted - from the section address. See the comments under - `--change-addresses', above. If SECTION does not exist in the - input file, a warning will be issued, unless - `--no-change-warnings' is used. - -`--change-section-vma SECTION{=,+,-}VAL' - Set or change the VMA address of the named SECTION. The VMA - address is the address where the section will be located once the - program has started executing. Normally this is the same as the - LMA address, which is the address where the section will be loaded - into memory, but on some systems, especially those where a program - is held in ROM, the two can be different. If `=' is used, the - section address is set to VAL. Otherwise, VAL is added to or - subtracted from the section address. See the comments under - `--change-addresses', above. If SECTION does not exist in the - input file, a warning will be issued, unless - `--no-change-warnings' is used. - -`--change-warnings' -`--adjust-warnings' - If `--change-section-address' or `--change-section-lma' or - `--change-section-vma' is used, and the named section does not - exist, issue a warning. This is the default. - -`--no-change-warnings' -`--no-adjust-warnings' - Do not issue a warning if `--change-section-address' or - `--adjust-section-lma' or `--adjust-section-vma' is used, even if - the named section does not exist. - -`--set-section-flags SECTION=FLAGS' - Set the flags for the named section. The FLAGS argument is a - comma separated string of flag names. The recognized names are - `alloc', `contents', `load', `noload', `readonly', `code', `data', - `rom', `share', and `debug'. You can set the `contents' flag for - a section which does not have contents, but it is not meaningful - to clear the `contents' flag of a section which does have - contents-just remove the section instead. Not all flags are - meaningful for all object file formats. - -`--add-section SECTIONNAME=FILENAME' - Add a new section named SECTIONNAME while copying the file. The - contents of the new section are taken from the file FILENAME. The - size of the section will be the size of the file. This option only - works on file formats which can support sections with arbitrary - names. - -`--rename-section OLDNAME=NEWNAME[,FLAGS]' - Rename a section from OLDNAME to NEWNAME, optionally changing the - section's flags to FLAGS in the process. This has the advantage - over usng a linker script to perform the rename in that the output - stays as an object file and does not become a linked executable. - - This option is particularly helpful when the input format is - binary, since this will always create a section called .data. If - for example, you wanted instead to create a section called .rodata - containing binary data you could use the following command line to - achieve it: - - objcopy -I binary -O -B \ - --rename-section .data=.rodata,alloc,load,readonly,data,contents \ - - -`--change-leading-char' - Some object file formats use special characters at the start of - symbols. The most common such character is underscore, which - compilers often add before every symbol. This option tells - `objcopy' to change the leading character of every symbol when it - converts between object file formats. If the object file formats - use the same leading character, this option has no effect. - Otherwise, it will add a character, or remove a character, or - change a character, as appropriate. - -`--remove-leading-char' - If the first character of a global symbol is a special symbol - leading character used by the object file format, remove the - character. The most common symbol leading character is - underscore. This option will remove a leading underscore from all - global symbols. This can be useful if you want to link together - objects of different file formats with different conventions for - symbol names. This is different from `--change-leading-char' - because it always changes the symbol name when appropriate, - regardless of the object file format of the output file. - -`--srec-len=IVAL' - Meaningful only for srec output. Set the maximum length of the - Srecords being produced to IVAL. This length covers both address, - data and crc fields. - -`--srec-forceS3' - Meaningful only for srec output. Avoid generation of S1/S2 - records, creating S3-only record format. - -`--redefine-sym OLD=NEW' - Change the name of a symbol OLD, to NEW. This can be useful when - one is trying link two things together for which you have no - source, and there are name collisions. - -`--redefine-syms=FILENAME' - Apply `--redefine-sym' to each symbol pair "OLD NEW" listed in the - file FILENAME. FILENAME is simply a flat file, with one symbol - pair per line. Line comments may be introduced by the hash - character. This option may be given more than once. - -`--weaken' - Change all global symbols in the file to be weak. This can be - useful when building an object which will be linked against other - objects using the `-R' option to the linker. This option is only - effective when using an object file format which supports weak - symbols. - -`--keep-symbols=FILENAME' - Apply `--keep-symbol' option to each symbol listed in the file - FILENAME. FILENAME is simply a flat file, with one symbol name - per line. Line comments may be introduced by the hash character. - This option may be given more than once. - -`--strip-symbols=FILENAME' - Apply `--strip-symbol' option to each symbol listed in the file - FILENAME. FILENAME is simply a flat file, with one symbol name - per line. Line comments may be introduced by the hash character. - This option may be given more than once. - -`--strip-unneeded-symbols=FILENAME' - Apply `--strip-unneeded-symbol' option to each symbol listed in - the file FILENAME. FILENAME is simply a flat file, with one - symbol name per line. Line comments may be introduced by the hash - character. This option may be given more than once. - -`--keep-global-symbols=FILENAME' - Apply `--keep-global-symbol' option to each symbol listed in the - file FILENAME. FILENAME is simply a flat file, with one symbol - name per line. Line comments may be introduced by the hash - character. This option may be given more than once. - -`--localize-symbols=FILENAME' - Apply `--localize-symbol' option to each symbol listed in the file - FILENAME. FILENAME is simply a flat file, with one symbol name - per line. Line comments may be introduced by the hash character. - This option may be given more than once. - -`--globalize-symbols=FILENAME' - Apply `--globalize-symbol' option to each symbol listed in the file - FILENAME. FILENAME is simply a flat file, with one symbol name - per line. Line comments may be introduced by the hash character. - This option may be given more than once. - -`--weaken-symbols=FILENAME' - Apply `--weaken-symbol' option to each symbol listed in the file - FILENAME. FILENAME is simply a flat file, with one symbol name - per line. Line comments may be introduced by the hash character. - This option may be given more than once. - -`--alt-machine-code=INDEX' - If the output architecture has alternate machine codes, use the - INDEXth code instead of the default one. This is useful in case a - machine is assigned an official code and the tool-chain adopts the - new code, but other applications still depend on the original code - being used. For ELF based architectures if the INDEX alternative - does not exist then the value is treated as an absolute number to - be stored in the e_machine field of the ELF header. - -`--writable-text' - Mark the output text as writable. This option isn't meaningful - for all object file formats. - -`--readonly-text' - Make the output text write protected. This option isn't - meaningful for all object file formats. - -`--pure' - Mark the output file as demand paged. This option isn't - meaningful for all object file formats. - -`--impure' - Mark the output file as impure. This option isn't meaningful for - all object file formats. - -`--prefix-symbols=STRING' - Prefix all symbols in the output file with STRING. - -`--prefix-sections=STRING' - Prefix all section names in the output file with STRING. - -`--prefix-alloc-sections=STRING' - Prefix all the names of all allocated sections in the output file - with STRING. - -`--add-gnu-debuglink=PATH-TO-FILE' - Creates a .gnu_debuglink section which contains a reference to - PATH-TO-FILE and adds it to the output file. - -`--keep-file-symbols' - When stripping a file, perhaps with `--strip-debug' or - `--strip-unneeded', retain any symbols specifying source file - names, which would otherwise get stripped. - -`--only-keep-debug' - Strip a file, removing contents of any sections that would not be - stripped by `--strip-debug' and leaving the debugging sections - intact. - - The intention is that this option will be used in conjunction with - `--add-gnu-debuglink' to create a two part executable. One a - stripped binary which will occupy less space in RAM and in a - distribution and the second a debugging information file which is - only needed if debugging abilities are required. The suggested - procedure to create these files is as follows: - - 1. Link the executable as normal. Assuming that is is called - `foo' then... - - 2. Run `objcopy --only-keep-debug foo foo.dbg' to create a file - containing the debugging info. - - 3. Run `objcopy --strip-debug foo' to create a stripped - executable. - - 4. Run `objcopy --add-gnu-debuglink=foo.dbg foo' to add a link - to the debugging info into the stripped executable. - - Note - the choice of `.dbg' as an extension for the debug info - file is arbitrary. Also the `--only-keep-debug' step is optional. - You could instead do this: - - 1. Link the executable as normal. - - 2. Copy `foo' to `foo.full' - - 3. Run `objcopy --strip-debug foo' - - 4. Run `objcopy --add-gnu-debuglink=foo.full foo' - - i.e. the file pointed to by the `--add-gnu-debuglink' can be the - full executable. It does not have to be a file created by the - `--only-keep-debug' switch. - -`-V' -`--version' - Show the version number of `objcopy'. - -`-v' -`--verbose' - Verbose output: list all object files modified. In the case of - archives, `objcopy -V' lists all members of the archive. - -`--help' - Show a summary of the options to `objcopy'. - -`--info' - Display a list showing all architectures and object formats - available. - - -File: binutils.info, Node: objdump, Next: ranlib, Prev: objcopy, Up: Top - -4 objdump -********* - - objdump [`-a'|`--archive-headers'] - [`-b' BFDNAME|`--target=BFDNAME'] - [`-C'|`--demangle'[=STYLE] ] - [`-d'|`--disassemble'] - [`-D'|`--disassemble-all'] - [`-z'|`--disassemble-zeroes'] - [`-EB'|`-EL'|`--endian='{big | little }] - [`-f'|`--file-headers'] - [`--file-start-context'] - [`-g'|`--debugging'] - [`-e'|`--debugging-tags'] - [`-h'|`--section-headers'|`--headers'] - [`-i'|`--info'] - [`-j' SECTION|`--section='SECTION] - [`-l'|`--line-numbers'] - [`-S'|`--source'] - [`-m' MACHINE|`--architecture='MACHINE] - [`-M' OPTIONS|`--disassembler-options='OPTIONS] - [`-p'|`--private-headers'] - [`-r'|`--reloc'] - [`-R'|`--dynamic-reloc'] - [`-s'|`--full-contents'] - [`-W'|`--dwarf'] - [`-G'|`--stabs'] - [`-t'|`--syms'] - [`-T'|`--dynamic-syms'] - [`-x'|`--all-headers'] - [`-w'|`--wide'] - [`--start-address='ADDRESS] - [`--stop-address='ADDRESS] - [`--prefix-addresses'] - [`--[no-]show-raw-insn'] - [`--adjust-vma='OFFSET] - [`--special-syms'] - [`-V'|`--version'] - [`-H'|`--help'] - OBJFILE... - - `objdump' displays information about one or more object files. The -options control what particular information to display. This -information is mostly useful to programmers who are working on the -compilation tools, as opposed to programmers who just want their -program to compile and work. - - OBJFILE... are the object files to be examined. When you specify -archives, `objdump' shows information on each of the member object -files. - - The long and short forms of options, shown here as alternatives, are -equivalent. At least one option from the list -`-a,-d,-D,-e,-f,-g,-G,-h,-H,-p,-r,-R,-s,-S,-t,-T,-V,-x' must be given. - -`-a' -`--archive-header' - If any of the OBJFILE files are archives, display the archive - header information (in a format similar to `ls -l'). Besides the - information you could list with `ar tv', `objdump -a' shows the - object file format of each archive member. - -`--adjust-vma=OFFSET' - When dumping information, first add OFFSET to all the section - addresses. This is useful if the section addresses do not - correspond to the symbol table, which can happen when putting - sections at particular addresses when using a format which can not - represent section addresses, such as a.out. - -`-b BFDNAME' -`--target=BFDNAME' - Specify that the object-code format for the object files is - BFDNAME. This option may not be necessary; OBJDUMP can - automatically recognize many formats. - - For example, - objdump -b oasys -m vax -h fu.o - displays summary information from the section headers (`-h') of - `fu.o', which is explicitly identified (`-m') as a VAX object file - in the format produced by Oasys compilers. You can list the - formats available with the `-i' option. *Note Target Selection::, - for more information. - -`-C' -`--demangle[=STYLE]' - Decode ("demangle") low-level symbol names into user-level names. - Besides removing any initial underscore prepended by the system, - this makes C++ function names readable. Different compilers have - different mangling styles. The optional demangling style argument - can be used to choose an appropriate demangling style for your - compiler. *Note c++filt::, for more information on demangling. - -`-g' -`--debugging' - Display debugging information. This attempts to parse debugging - information stored in the file and print it out using a C like - syntax. Only certain types of debugging information have been - implemented. Some other types are supported by `readelf -w'. - *Note readelf::. - -`-e' -`--debugging-tags' - Like `-g', but the information is generated in a format compatible - with ctags tool. - -`-d' -`--disassemble' - Display the assembler mnemonics for the machine instructions from - OBJFILE. This option only disassembles those sections which are - expected to contain instructions. - -`-D' -`--disassemble-all' - Like `-d', but disassemble the contents of all sections, not just - those expected to contain instructions. - -`--prefix-addresses' - When disassembling, print the complete address on each line. This - is the older disassembly format. - -`-EB' -`-EL' -`--endian={big|little}' - Specify the endianness of the object files. This only affects - disassembly. This can be useful when disassembling a file format - which does not describe endianness information, such as S-records. - -`-f' -`--file-headers' - Display summary information from the overall header of each of the - OBJFILE files. - -`--file-start-context' - Specify that when displaying interlisted source code/disassembly - (assumes `-S') from a file that has not yet been displayed, extend - the context to the start of the file. - -`-h' -`--section-headers' -`--headers' - Display summary information from the section headers of the object - file. - - File segments may be relocated to nonstandard addresses, for - example by using the `-Ttext', `-Tdata', or `-Tbss' options to - `ld'. However, some object file formats, such as a.out, do not - store the starting address of the file segments. In those - situations, although `ld' relocates the sections correctly, using - `objdump -h' to list the file section headers cannot show the - correct addresses. Instead, it shows the usual addresses, which - are implicit for the target. - -`-H' -`--help' - Print a summary of the options to `objdump' and exit. - -`-i' -`--info' - Display a list showing all architectures and object formats - available for specification with `-b' or `-m'. - -`-j NAME' -`--section=NAME' - Display information only for section NAME. - -`-l' -`--line-numbers' - Label the display (using debugging information) with the filename - and source line numbers corresponding to the object code or relocs - shown. Only useful with `-d', `-D', or `-r'. - -`-m MACHINE' -`--architecture=MACHINE' - Specify the architecture to use when disassembling object files. - This can be useful when disassembling object files which do not - describe architecture information, such as S-records. You can - list the available architectures with the `-i' option. - -`-M OPTIONS' -`--disassembler-options=OPTIONS' - Pass target specific information to the disassembler. Only - supported on some targets. If it is necessary to specify more - than one disassembler option then multiple `-M' options can be - used or can be placed together into a comma separated list. - - If the target is an ARM architecture then this switch can be used - to select which register name set is used during disassembler. - Specifying `-M reg-names-std' (the default) will select the - register names as used in ARM's instruction set documentation, but - with register 13 called 'sp', register 14 called 'lr' and register - 15 called 'pc'. Specifying `-M reg-names-apcs' will select the - name set used by the ARM Procedure Call Standard, whilst - specifying `-M reg-names-raw' will just use `r' followed by the - register number. - - There are also two variants on the APCS register naming scheme - enabled by `-M reg-names-atpcs' and `-M reg-names-special-atpcs' - which use the ARM/Thumb Procedure Call Standard naming - conventions. (Either with the normal register names or the - special register names). - - This option can also be used for ARM architectures to force the - disassembler to interpret all instructions as Thumb instructions by - using the switch `--disassembler-options=force-thumb'. This can be - useful when attempting to disassemble thumb code produced by other - compilers. - - For the x86, some of the options duplicate functions of the `-m' - switch, but allow finer grained control. Multiple selections from - the following may be specified as a comma separated string. - `x86-64', `i386' and `i8086' select disassembly for the given - architecture. `intel' and `att' select between intel syntax mode - and AT&T syntax mode. `addr32', `addr16', `data32' and `data16' - specify the default address size and operand size. These four - options will be overridden if `x86-64', `i386' or `i8086' appear - later in the option string. Lastly, `suffix', when in AT&T mode, - instructs the disassembler to print a mnemonic suffix even when the - suffix could be inferred by the operands. - - For PPC, `booke', `booke32' and `booke64' select disassembly of - BookE instructions. `32' and `64' select PowerPC and PowerPC64 - disassembly, respectively. `e300' selects disassembly for the - e300 family. - - For MIPS, this option controls the printing of instruction - mneumonic names and register names in disassembled instructions. - Multiple selections from the following may be specified as a comma - separated string, and invalid options are ignored: - - `no-aliases' - Print the 'raw' instruction mneumonic instead of some pseudo - instruction mneumonic. I.E. print 'daddu' or 'or' instead of - 'move', 'sll' instead of 'nop', etc. - - `gpr-names=ABI' - Print GPR (general-purpose register) names as appropriate for - the specified ABI. By default, GPR names are selected - according to the ABI of the binary being disassembled. - - `fpr-names=ABI' - Print FPR (floating-point register) names as appropriate for - the specified ABI. By default, FPR numbers are printed - rather than names. - - `cp0-names=ARCH' - Print CP0 (system control coprocessor; coprocessor 0) - register names as appropriate for the CPU or architecture - specified by ARCH. By default, CP0 register names are - selected according to the architecture and CPU of the binary - being disassembled. - - `hwr-names=ARCH' - Print HWR (hardware register, used by the `rdhwr' - instruction) names as appropriate for the CPU or architecture - specified by ARCH. By default, HWR names are selected - according to the architecture and CPU of the binary being - disassembled. - - `reg-names=ABI' - Print GPR and FPR names as appropriate for the selected ABI. - - `reg-names=ARCH' - Print CPU-specific register names (CP0 register and HWR names) - as appropriate for the selected CPU or architecture. - - For any of the options listed above, ABI or ARCH may be specified - as `numeric' to have numbers printed rather than names, for the - selected types of registers. You can list the available values of - ABI and ARCH using the `--help' option. - - For VAX, you can specify function entry addresses with `-M - entry:0xf00ba'. You can use this multiple times to properly - disassemble VAX binary files that don't contain symbol tables (like - ROM dumps). In these cases, the function entry mask would - otherwise be decoded as VAX instructions, which would probably - lead the the rest of the function being wrongly disassembled. - -`-p' -`--private-headers' - Print information that is specific to the object file format. The - exact information printed depends upon the object file format. - For some object file formats, no additional information is printed. - -`-r' -`--reloc' - Print the relocation entries of the file. If used with `-d' or - `-D', the relocations are printed interspersed with the - disassembly. - -`-R' -`--dynamic-reloc' - Print the dynamic relocation entries of the file. This is only - meaningful for dynamic objects, such as certain types of shared - libraries. - -`-s' -`--full-contents' - Display the full contents of any sections requested. By default - all non-empty sections are displayed. - -`-S' -`--source' - Display source code intermixed with disassembly, if possible. - Implies `-d'. - -`--show-raw-insn' - When disassembling instructions, print the instruction in hex as - well as in symbolic form. This is the default except when - `--prefix-addresses' is used. - -`--no-show-raw-insn' - When disassembling instructions, do not print the instruction - bytes. This is the default when `--prefix-addresses' is used. - -`-W' -`--dwarf' - Displays the contents of the DWARF debug sections in the file, if - any are present. - -`-G' -`--stabs' - Display the full contents of any sections requested. Display the - contents of the .stab and .stab.index and .stab.excl sections from - an ELF file. This is only useful on systems (such as Solaris 2.0) - in which `.stab' debugging symbol-table entries are carried in an - ELF section. In most other file formats, debugging symbol-table - entries are interleaved with linkage symbols, and are visible in - the `--syms' output. For more information on stabs symbols, see - *Note Stabs: (stabs.info)Top. - -`--start-address=ADDRESS' - Start displaying data at the specified address. This affects the - output of the `-d', `-r' and `-s' options. - -`--stop-address=ADDRESS' - Stop displaying data at the specified address. This affects the - output of the `-d', `-r' and `-s' options. - -`-t' -`--syms' - Print the symbol table entries of the file. This is similar to - the information provided by the `nm' program. - -`-T' -`--dynamic-syms' - Print the dynamic symbol table entries of the file. This is only - meaningful for dynamic objects, such as certain types of shared - libraries. This is similar to the information provided by the `nm' - program when given the `-D' (`--dynamic') option. - -`--special-syms' - When displaying symbols include those which the target considers - to be special in some way and which would not normally be of - interest to the user. - -`-V' -`--version' - Print the version number of `objdump' and exit. - -`-x' -`--all-headers' - Display all available header information, including the symbol - table and relocation entries. Using `-x' is equivalent to - specifying all of `-a -f -h -p -r -t'. - -`-w' -`--wide' - Format some lines for output devices that have more than 80 - columns. Also do not truncate symbol names when they are - displayed. - -`-z' -`--disassemble-zeroes' - Normally the disassembly output will skip blocks of zeroes. This - option directs the disassembler to disassemble those blocks, just - like any other data. - - -File: binutils.info, Node: ranlib, Next: readelf, Prev: objdump, Up: Top - -5 ranlib -******** - - ranlib [`-vV'] ARCHIVE - - `ranlib' generates an index to the contents of an archive and stores -it in the archive. The index lists each symbol defined by a member of -an archive that is a relocatable object file. - - You may use `nm -s' or `nm --print-armap' to list this index. - - An archive with such an index speeds up linking to the library and -allows routines in the library to call each other without regard to -their placement in the archive. - - The GNU `ranlib' program is another form of GNU `ar'; running -`ranlib' is completely equivalent to executing `ar -s'. *Note ar::. - -`-v' -`-V' -`--version' - Show the version number of `ranlib'. - - -File: binutils.info, Node: size, Next: strings, Prev: readelf, Up: Top - -6 size -****** - - size [`-A'|`-B'|`--format='COMPATIBILITY] - [`--help'] - [`-d'|`-o'|`-x'|`--radix='NUMBER] - [`-t'|`--totals'] - [`--target='BFDNAME] [`-V'|`--version'] - [OBJFILE...] - - The GNU `size' utility lists the section sizes--and the total -size--for each of the object or archive files OBJFILE in its argument -list. By default, one line of output is generated for each object file -or each module in an archive. - - OBJFILE... are the object files to be examined. If none are -specified, the file `a.out' will be used. - - The command line options have the following meanings: - -`-A' -`-B' -`--format=COMPATIBILITY' - Using one of these options, you can choose whether the output from - GNU `size' resembles output from System V `size' (using `-A', or - `--format=sysv'), or Berkeley `size' (using `-B', or - `--format=berkeley'). The default is the one-line format similar - to Berkeley's. - - Here is an example of the Berkeley (default) format of output from - `size': - $ size --format=Berkeley ranlib size - text data bss dec hex filename - 294880 81920 11592 388392 5ed28 ranlib - 294880 81920 11888 388688 5ee50 size - - This is the same data, but displayed closer to System V - conventions: - - $ size --format=SysV ranlib size - ranlib : - section size addr - .text 294880 8192 - .data 81920 303104 - .bss 11592 385024 - Total 388392 - - - size : - section size addr - .text 294880 8192 - .data 81920 303104 - .bss 11888 385024 - Total 388688 - -`--help' - Show a summary of acceptable arguments and options. - -`-d' -`-o' -`-x' -`--radix=NUMBER' - Using one of these options, you can control whether the size of - each section is given in decimal (`-d', or `--radix=10'); octal - (`-o', or `--radix=8'); or hexadecimal (`-x', or `--radix=16'). - In `--radix=NUMBER', only the three values (8, 10, 16) are - supported. The total size is always given in two radices; decimal - and hexadecimal for `-d' or `-x' output, or octal and hexadecimal - if you're using `-o'. - -`-t' -`--totals' - Show totals of all objects listed (Berkeley format listing mode - only). - -`--target=BFDNAME' - Specify that the object-code format for OBJFILE is BFDNAME. This - option may not be necessary; `size' can automatically recognize - many formats. *Note Target Selection::, for more information. - -`-V' -`--version' - Display the version number of `size'. - - -File: binutils.info, Node: strings, Next: strip, Prev: size, Up: Top - -7 strings -********* - - strings [`-afov'] [`-'MIN-LEN] - [`-n' MIN-LEN] [`--bytes='MIN-LEN] - [`-t' RADIX] [`--radix='RADIX] - [`-e' ENCODING] [`--encoding='ENCODING] - [`-'] [`--all'] [`--print-file-name'] - [`--target='BFDNAME] - [`--help'] [`--version'] FILE... - - For each FILE given, GNU `strings' prints the printable character -sequences that are at least 4 characters long (or the number given with -the options below) and are followed by an unprintable character. By -default, it only prints the strings from the initialized and loaded -sections of object files; for other types of files, it prints the -strings from the whole file. - - `strings' is mainly useful for determining the contents of non-text -files. - -`-a' -`--all' -`-' - Do not scan only the initialized and loaded sections of object - files; scan the whole files. - -`-f' -`--print-file-name' - Print the name of the file before each string. - -`--help' - Print a summary of the program usage on the standard output and - exit. - -`-MIN-LEN' -`-n MIN-LEN' -`--bytes=MIN-LEN' - Print sequences of characters that are at least MIN-LEN characters - long, instead of the default 4. - -`-o' - Like `-t o'. Some other versions of `strings' have `-o' act like - `-t d' instead. Since we can not be compatible with both ways, we - simply chose one. - -`-t RADIX' -`--radix=RADIX' - Print the offset within the file before each string. The single - character argument specifies the radix of the offset--`o' for - octal, `x' for hexadecimal, or `d' for decimal. - -`-e ENCODING' -`--encoding=ENCODING' - Select the character encoding of the strings that are to be found. - Possible values for ENCODING are: `s' = single-7-bit-byte - characters (ASCII, ISO 8859, etc., default), `S' = - single-8-bit-byte characters, `b' = 16-bit bigendian, `l' = 16-bit - littleendian, `B' = 32-bit bigendian, `L' = 32-bit littleendian. - Useful for finding wide character strings. - -`--target=BFDNAME' - Specify an object code format other than your system's default - format. *Note Target Selection::, for more information. - -`-v' -`--version' - Print the program version number on the standard output and exit. - - -File: binutils.info, Node: strip, Next: c++filt, Prev: strings, Up: Top - -8 strip -******* - - strip [`-F' BFDNAME |`--target='BFDNAME] - [`-I' BFDNAME |`--input-target='BFDNAME] - [`-O' BFDNAME |`--output-target='BFDNAME] - [`-s'|`--strip-all'] - [`-S'|`-g'|`-d'|`--strip-debug'] - [`-K' SYMBOLNAME |`--keep-symbol='SYMBOLNAME] - [`-N' SYMBOLNAME |`--strip-symbol='SYMBOLNAME] - [`-w'|`--wildcard'] - [`-x'|`--discard-all'] [`-X' |`--discard-locals'] - [`-R' SECTIONNAME |`--remove-section='SECTIONNAME] - [`-o' FILE] [`-p'|`--preserve-dates'] - [`--keep-file-symbols'] - [`--only-keep-debug'] - [`-v' |`--verbose'] [`-V'|`--version'] - [`--help'] [`--info'] - OBJFILE... - - GNU `strip' discards all symbols from object files OBJFILE. The -list of object files may include archives. At least one object file -must be given. - - `strip' modifies the files named in its argument, rather than -writing modified copies under different names. - -`-F BFDNAME' -`--target=BFDNAME' - Treat the original OBJFILE as a file with the object code format - BFDNAME, and rewrite it in the same format. *Note Target - Selection::, for more information. - -`--help' - Show a summary of the options to `strip' and exit. - -`--info' - Display a list showing all architectures and object formats - available. - -`-I BFDNAME' -`--input-target=BFDNAME' - Treat the original OBJFILE as a file with the object code format - BFDNAME. *Note Target Selection::, for more information. - -`-O BFDNAME' -`--output-target=BFDNAME' - Replace OBJFILE with a file in the output format BFDNAME. *Note - Target Selection::, for more information. - -`-R SECTIONNAME' -`--remove-section=SECTIONNAME' - Remove any section named SECTIONNAME from the output file. This - option may be given more than once. Note that using this option - inappropriately may make the output file unusable. - -`-s' -`--strip-all' - Remove all symbols. - -`-g' -`-S' -`-d' -`--strip-debug' - Remove debugging symbols only. - -`--strip-unneeded' - Remove all symbols that are not needed for relocation processing. - -`-K SYMBOLNAME' -`--keep-symbol=SYMBOLNAME' - When stripping symbols, keep symbol SYMBOLNAME even if it would - normally be stripped. This option may be given more than once. - -`-N SYMBOLNAME' -`--strip-symbol=SYMBOLNAME' - Remove symbol SYMBOLNAME from the source file. This option may be - given more than once, and may be combined with strip options other - than `-K'. - -`-o FILE' - Put the stripped output in FILE, rather than replacing the - existing file. When this argument is used, only one OBJFILE - argument may be specified. - -`-p' -`--preserve-dates' - Preserve the access and modification dates of the file. - -`-w' -`--wildcard' - Permit regular expressions in SYMBOLNAMEs used in other command - line options. The question mark (?), asterisk (*), backslash (\) - and square brackets ([]) operators can be used anywhere in the - symbol name. If the first character of the symbol name is the - exclamation point (!) then the sense of the switch is reversed for - that symbol. For example: - - -w -K !foo -K fo* - - would cause strip to only keep symbols that start with the letters - "fo", but to discard the symbol "foo". - -`-x' -`--discard-all' - Remove non-global symbols. - -`-X' -`--discard-locals' - Remove compiler-generated local symbols. (These usually start - with `L' or `.'.) - -`--keep-file-symbols' - When stripping a file, perhaps with `--strip-debug' or - `--strip-unneeded', retain any symbols specifying source file - names, which would otherwise get stripped. - -`--only-keep-debug' - Strip a file, removing any sections that would be stripped by - `--strip-debug' and leaving the debugging sections. - - The intention is that this option will be used in conjunction with - `--add-gnu-debuglink' to create a two part executable. One a - stripped binary which will occupy less space in RAM and in a - distribution and the second a debugging information file which is - only needed if debugging abilities are required. The suggested - procedure to create these files is as follows: - - 1. Link the executable as normal. Assuming that is is called - `foo' then... - - 2. Run `objcopy --only-keep-debug foo foo.dbg' to create a file - containing the debugging info. - - 3. Run `objcopy --strip-debug foo' to create a stripped - executable. - - 4. Run `objcopy --add-gnu-debuglink=foo.dbg foo' to add a link - to the debugging info into the stripped executable. - - Note - the choice of `.dbg' as an extension for the debug info - file is arbitrary. Also the `--only-keep-debug' step is optional. - You could instead do this: - - 1. Link the executable as normal. - - 2. Copy `foo' to `foo.full' - - 3. Run `strip --strip-debug foo' - - 4. Run `objcopy --add-gnu-debuglink=foo.full foo' - - ie the file pointed to by the `--add-gnu-debuglink' can be the - full executable. It does not have to be a file created by the - `--only-keep-debug' switch. - -`-V' -`--version' - Show the version number for `strip'. - -`-v' -`--verbose' - Verbose output: list all object files modified. In the case of - archives, `strip -v' lists all members of the archive. - - -File: binutils.info, Node: c++filt, Next: addr2line, Prev: strip, Up: Top - -9 c++filt -********* - - c++filt [`-_'|`--strip-underscores'] - [`-n'|`--no-strip-underscores'] - [`-p'|`--no-params'] - [`-t'|`--types'] - [`-i'|`--no-verbose'] - [`-s' FORMAT|`--format='FORMAT] - [`--help'] [`--version'] [SYMBOL...] - - The C++ and Java languages provide function overloading, which means -that you can write many functions with the same name, providing that -each function takes parameters of different types. In order to be able -to distinguish these similarly named functions C++ and Java encode them -into a low-level assembler name which uniquely identifies each -different version. This process is known as "mangling". The `c++filt' -(1) program does the inverse mapping: it decodes ("demangles") low-level -names into user-level names so that they can be read. - - Every alphanumeric word (consisting of letters, digits, underscores, -dollars, or periods) seen in the input is a potential mangled name. If -the name decodes into a C++ name, the C++ name replaces the low-level -name in the output, otherwise the original word is output. In this way -you can pass an entire assembler source file, containing mangled names, -through `c++filt' and see the same source file containing demangled -names. - - You can also use `c++filt' to decipher individual symbols by passing -them on the command line: - - c++filt SYMBOL - - If no SYMBOL arguments are given, `c++filt' reads symbol names from -the standard input instead. All the results are printed on the -standard output. The difference between reading names from the command -line versus reading names from the standard input is that command line -arguments are expected to be just mangled names and no checking is -performed to seperate them from surrounding text. Thus for example: - - c++filt -n _Z1fv - - will work and demangle the name to "f()" whereas: - - c++filt -n _Z1fv, - - will not work. (Note the extra comma at the end of the mangled name -which makes it invalid). This command however will work: - - echo _Z1fv, | c++filt -n - - and will display "f()," ie the demangled name followed by a trailing -comma. This behaviour is because when the names are read from the -standard input it is expected that they might be part of an assembler -source file where there might be extra, extraneous characters trailing -after a mangled name. eg: - - .type _Z1fv, @function - -`-_' -`--strip-underscores' - On some systems, both the C and C++ compilers put an underscore in - front of every name. For example, the C name `foo' gets the - low-level name `_foo'. This option removes the initial - underscore. Whether `c++filt' removes the underscore by default - is target dependent. - -`-j' -`--java' - Prints demangled names using Java syntax. The default is to use - C++ syntax. - -`-n' -`--no-strip-underscores' - Do not remove the initial underscore. - -`-p' -`--no-params' - When demangling the name of a function, do not display the types of - the function's parameters. - -`-t' -`--types' - Attempt to demangle types as well as function names. This is - disabled by default since mangled types are normally only used - internally in the compiler, and they can be confused with - non-mangled names. eg a function called "a" treated as a mangled - type name would be demangled to "signed char". - -`-i' -`--no-verbose' - Do not include implementation details (if any) in the demangled - output. - -`-s FORMAT' -`--format=FORMAT' - `c++filt' can decode various methods of mangling, used by - different compilers. The argument to this option selects which - method it uses: - - `auto' - Automatic selection based on executable (the default method) - - `gnu' - the one used by the GNU C++ compiler (g++) - - `lucid' - the one used by the Lucid compiler (lcc) - - `arm' - the one specified by the C++ Annotated Reference Manual - - `hp' - the one used by the HP compiler (aCC) - - `edg' - the one used by the EDG compiler - - `gnu-v3' - the one used by the GNU C++ compiler (g++) with the V3 ABI. - - `java' - the one used by the GNU Java compiler (gcj) - - `gnat' - the one used by the GNU Ada compiler (GNAT). - -`--help' - Print a summary of the options to `c++filt' and exit. - -`--version' - Print the version number of `c++filt' and exit. - - _Warning:_ `c++filt' is a new utility, and the details of its user - interface are subject to change in future releases. In particular, - a command-line option may be required in the the future to decode - a name passed as an argument on the command line; in other words, - - c++filt SYMBOL - - may in a future release become - - c++filt OPTION SYMBOL - - ---------- Footnotes ---------- - - (1) MS-DOS does not allow `+' characters in file names, so on MS-DOS -this program is named `CXXFILT'. - - -File: binutils.info, Node: addr2line, Next: nlmconv, Prev: c++filt, Up: Top - -10 addr2line -************ - - addr2line [`-b' BFDNAME|`--target='BFDNAME] - [`-C'|`--demangle'[=STYLE]] - [`-e' FILENAME|`--exe='FILENAME] - [`-f'|`--functions'] [`-s'|`--basename'] - [`-i'|`--inlines'] - [`-j'|`--section='NAME] - [`-H'|`--help'] [`-V'|`--version'] - [addr addr ...] - - `addr2line' translates addresses into file names and line numbers. -Given an address in an executable or an offset in a section of a -relocatable object, it uses the debugging information to figure out -which file name and line number are associated with it. - - The executable or relocatable object to use is specified with the -`-e' option. The default is the file `a.out'. The section in the -relocatable object to use is specified with the `-j' option. - - `addr2line' has two modes of operation. - - In the first, hexadecimal addresses are specified on the command -line, and `addr2line' displays the file name and line number for each -address. - - In the second, `addr2line' reads hexadecimal addresses from standard -input, and prints the file name and line number for each address on -standard output. In this mode, `addr2line' may be used in a pipe to -convert dynamically chosen addresses. - - The format of the output is `FILENAME:LINENO'. The file name and -line number for each address is printed on a separate line. If the -`-f' option is used, then each `FILENAME:LINENO' line is preceded by a -`FUNCTIONNAME' line which is the name of the function containing the -address. - - If the file name or function name can not be determined, `addr2line' -will print two question marks in their place. If the line number can -not be determined, `addr2line' will print 0. - - The long and short forms of options, shown here as alternatives, are -equivalent. - -`-b BFDNAME' -`--target=BFDNAME' - Specify that the object-code format for the object files is - BFDNAME. - -`-C' -`--demangle[=STYLE]' - Decode ("demangle") low-level symbol names into user-level names. - Besides removing any initial underscore prepended by the system, - this makes C++ function names readable. Different compilers have - different mangling styles. The optional demangling style argument - can be used to choose an appropriate demangling style for your - compiler. *Note c++filt::, for more information on demangling. - -`-e FILENAME' -`--exe=FILENAME' - Specify the name of the executable for which addresses should be - translated. The default file is `a.out'. - -`-f' -`--functions' - Display function names as well as file and line number information. - -`-s' -`--basenames' - Display only the base of each file name. - -`-i' -`--inlines' - If the address belongs to a function that was inlined, the source - information for all enclosing scopes back to the first non-inlined - function will also be printed. For example, if `main' inlines - `callee1' which inlines `callee2', and address is from `callee2', - the source information for `callee1' and `main' will also be - printed. - -`-j' -`--section' - Read offsets relative to the specified section instead of absolute - addresses. - - -File: binutils.info, Node: nlmconv, Next: windres, Prev: addr2line, Up: Top - -11 nlmconv -********** - -`nlmconv' converts a relocatable object file into a NetWare Loadable -Module. - - _Warning:_ `nlmconv' is not always built as part of the binary - utilities, since it is only useful for NLM targets. - - nlmconv [`-I' BFDNAME|`--input-target='BFDNAME] - [`-O' BFDNAME|`--output-target='BFDNAME] - [`-T' HEADERFILE|`--header-file='HEADERFILE] - [`-d'|`--debug'] [`-l' LINKER|`--linker='LINKER] - [`-h'|`--help'] [`-V'|`--version'] - INFILE OUTFILE - - `nlmconv' converts the relocatable `i386' object file INFILE into -the NetWare Loadable Module OUTFILE, optionally reading HEADERFILE for -NLM header information. For instructions on writing the NLM command -file language used in header files, see the `linkers' section, -`NLMLINK' in particular, of the `NLM Development and Tools Overview', -which is part of the NLM Software Developer's Kit ("NLM SDK"), -available from Novell, Inc. `nlmconv' uses the GNU Binary File -Descriptor library to read INFILE; see *Note BFD: (ld.info)BFD, for -more information. - - `nlmconv' can perform a link step. In other words, you can list -more than one object file for input if you list them in the definitions -file (rather than simply specifying one input file on the command line). -In this case, `nlmconv' calls the linker for you. - -`-I BFDNAME' -`--input-target=BFDNAME' - Object format of the input file. `nlmconv' can usually determine - the format of a given file (so no default is necessary). *Note - Target Selection::, for more information. - -`-O BFDNAME' -`--output-target=BFDNAME' - Object format of the output file. `nlmconv' infers the output - format based on the input format, e.g. for a `i386' input file the - output format is `nlm32-i386'. *Note Target Selection::, for more - information. - -`-T HEADERFILE' -`--header-file=HEADERFILE' - Reads HEADERFILE for NLM header information. For instructions on - writing the NLM command file language used in header files, see - see the `linkers' section, of the `NLM Development and Tools - Overview', which is part of the NLM Software Developer's Kit, - available from Novell, Inc. - -`-d' -`--debug' - Displays (on standard error) the linker command line used by - `nlmconv'. - -`-l LINKER' -`--linker=LINKER' - Use LINKER for any linking. LINKER can be an absolute or a - relative pathname. - -`-h' -`--help' - Prints a usage summary. - -`-V' -`--version' - Prints the version number for `nlmconv'. - - -File: binutils.info, Node: windres, Next: dlltool, Prev: nlmconv, Up: Top - -12 windres -********** - -`windres' may be used to manipulate Windows resources. - - _Warning:_ `windres' is not always built as part of the binary - utilities, since it is only useful for Windows targets. - - windres [options] [input-file] [output-file] - - `windres' reads resources from an input file and copies them into an -output file. Either file may be in one of three formats: - -`rc' - A text format read by the Resource Compiler. - -`res' - A binary format generated by the Resource Compiler. - -`coff' - A COFF object or executable. - - The exact description of these different formats is available in -documentation from Microsoft. - - When `windres' converts from the `rc' format to the `res' format, it -is acting like the Windows Resource Compiler. When `windres' converts -from the `res' format to the `coff' format, it is acting like the -Windows `CVTRES' program. - - When `windres' generates an `rc' file, the output is similar but not -identical to the format expected for the input. When an input `rc' -file refers to an external filename, an output `rc' file will instead -include the file contents. - - If the input or output format is not specified, `windres' will guess -based on the file name, or, for the input file, the file contents. A -file with an extension of `.rc' will be treated as an `rc' file, a file -with an extension of `.res' will be treated as a `res' file, and a file -with an extension of `.o' or `.exe' will be treated as a `coff' file. - - If no output file is specified, `windres' will print the resources -in `rc' format to standard output. - - The normal use is for you to write an `rc' file, use `windres' to -convert it to a COFF object file, and then link the COFF file into your -application. This will make the resources described in the `rc' file -available to Windows. - -`-i FILENAME' -`--input FILENAME' - The name of the input file. If this option is not used, then - `windres' will use the first non-option argument as the input file - name. If there are no non-option arguments, then `windres' will - read from standard input. `windres' can not read a COFF file from - standard input. - -`-o FILENAME' -`--output FILENAME' - The name of the output file. If this option is not used, then - `windres' will use the first non-option argument, after any used - for the input file name, as the output file name. If there is no - non-option argument, then `windres' will write to standard output. - `windres' can not write a COFF file to standard output. Note, for - compatability with `rc' the option `-fo' is also accepted, but its - use is not recommended. - -`-J FORMAT' -`--input-format FORMAT' - The input format to read. FORMAT may be `res', `rc', or `coff'. - If no input format is specified, `windres' will guess, as - described above. - -`-O FORMAT' -`--output-format FORMAT' - The output format to generate. FORMAT may be `res', `rc', or - `coff'. If no output format is specified, `windres' will guess, - as described above. - -`-F TARGET' -`--target TARGET' - Specify the BFD format to use for a COFF file as input or output. - This is a BFD target name; you can use the `--help' option to see - a list of supported targets. Normally `windres' will use the - default format, which is the first one listed by the `--help' - option. *Note Target Selection::. - -`--preprocessor PROGRAM' - When `windres' reads an `rc' file, it runs it through the C - preprocessor first. This option may be used to specify the - preprocessor to use, including any leading arguments. The default - preprocessor argument is `gcc -E -xc-header -DRC_INVOKED'. - -`-I DIRECTORY' -`--include-dir DIRECTORY' - Specify an include directory to use when reading an `rc' file. - `windres' will pass this to the preprocessor as an `-I' option. - `windres' will also search this directory when looking for files - named in the `rc' file. If the argument passed to this command - matches any of the supported FORMATS (as descrived in the `-J' - option), it will issue a deprecation warning, and behave just like - the `-J' option. New programs should not use this behaviour. If a - directory happens to match a FORMAT, simple prefix it with `./' to - disable the backward compatibility. - -`-D TARGET' -`--define SYM[=VAL]' - Specify a `-D' option to pass to the preprocessor when reading an - `rc' file. - -`-U TARGET' -`--undefine SYM' - Specify a `-U' option to pass to the preprocessor when reading an - `rc' file. - -`-r' - Ignored for compatibility with rc. - -`-v' - Enable verbose mode. This tells you what the preprocessor is if - you didn't specify one. - -`-l VAL' - -`--language VAL' - Specify the default language to use when reading an `rc' file. - VAL should be a hexadecimal language code. The low eight bits are - the language, and the high eight bits are the sublanguage. - -`--use-temp-file' - Use a temporary file to instead of using popen to read the output - of the preprocessor. Use this option if the popen implementation - is buggy on the host (eg., certain non-English language versions - of Windows 95 and Windows 98 are known to have buggy popen where - the output will instead go the console). - -`--no-use-temp-file' - Use popen, not a temporary file, to read the output of the - preprocessor. This is the default behaviour. - -`-h' - -`--help' - Prints a usage summary. - -`-V' - -`--version' - Prints the version number for `windres'. - -`--yydebug' - If `windres' is compiled with `YYDEBUG' defined as `1', this will - turn on parser debugging. - - -File: binutils.info, Node: dlltool, Next: Common Options, Prev: windres, Up: Top - -13 dlltool -********** - -`dlltool' is used to create the files needed to create dynamic link -libraries (DLLs) on systems which understand PE format image files such -as Windows. A DLL contains an export table which contains information -that the runtime loader needs to resolve references from a referencing -program. - - The export table is generated by this program by reading in a `.def' -file or scanning the `.a' and `.o' files which will be in the DLL. A -`.o' file can contain information in special `.drectve' sections with -export information. - - _Note:_ `dlltool' is not always built as part of the binary - utilities, since it is only useful for those targets which support - DLLs. - - dlltool [`-d'|`--input-def' DEF-FILE-NAME] - [`-b'|`--base-file' BASE-FILE-NAME] - [`-e'|`--output-exp' EXPORTS-FILE-NAME] - [`-z'|`--output-def' DEF-FILE-NAME] - [`-l'|`--output-lib' LIBRARY-FILE-NAME] - [`--export-all-symbols'] [`--no-export-all-symbols'] - [`--exclude-symbols' LIST] - [`--no-default-excludes'] - [`-S'|`--as' PATH-TO-ASSEMBLER] [`-f'|`--as-flags' OPTIONS] - [`-D'|`--dllname' NAME] [`-m'|`--machine' MACHINE] - [`-a'|`--add-indirect'] - [`-U'|`--add-underscore'] [`--add-stdcall-underscore'] - [`-k'|`--kill-at'] [`-A'|`--add-stdcall-alias'] - [`-p'|`--ext-prefix-alias' PREFIX] - [`-x'|`--no-idata4'] [`-c'|`--no-idata5'] [`-i'|`--interwork'] - [`-n'|`--nodelete'] [`-t'|`--temp-prefix' PREFIX] - [`-v'|`--verbose'] - [`-h'|`--help'] [`-V'|`--version'] - [object-file ...] - - `dlltool' reads its inputs, which can come from the `-d' and `-b' -options as well as object files specified on the command line. It then -processes these inputs and if the `-e' option has been specified it -creates a exports file. If the `-l' option has been specified it -creates a library file and if the `-z' option has been specified it -creates a def file. Any or all of the `-e', `-l' and `-z' options can -be present in one invocation of dlltool. - - When creating a DLL, along with the source for the DLL, it is -necessary to have three other files. `dlltool' can help with the -creation of these files. - - The first file is a `.def' file which specifies which functions are -exported from the DLL, which functions the DLL imports, and so on. This -is a text file and can be created by hand, or `dlltool' can be used to -create it using the `-z' option. In this case `dlltool' will scan the -object files specified on its command line looking for those functions -which have been specially marked as being exported and put entries for -them in the `.def' file it creates. - - In order to mark a function as being exported from a DLL, it needs to -have an `-export:' entry in the `.drectve' section of -the object file. This can be done in C by using the asm() operator: - - asm (".section .drectve"); - asm (".ascii \"-export:my_func\""); - - int my_func (void) { ... } - - The second file needed for DLL creation is an exports file. This -file is linked with the object files that make up the body of the DLL -and it handles the interface between the DLL and the outside world. -This is a binary file and it can be created by giving the `-e' option to -`dlltool' when it is creating or reading in a `.def' file. - - The third file needed for DLL creation is the library file that -programs will link with in order to access the functions in the DLL. -This file can be created by giving the `-l' option to dlltool when it -is creating or reading in a `.def' file. - - `dlltool' builds the library file by hand, but it builds the exports -file by creating temporary files containing assembler statements and -then assembling these. The `-S' command line option can be used to -specify the path to the assembler that dlltool will use, and the `-f' -option can be used to pass specific flags to that assembler. The `-n' -can be used to prevent dlltool from deleting these temporary assembler -files when it is done, and if `-n' is specified twice then this will -prevent dlltool from deleting the temporary object files it used to -build the library. - - Here is an example of creating a DLL from a source file `dll.c' and -also creating a program (from an object file called `program.o') that -uses that DLL: - - gcc -c dll.c - dlltool -e exports.o -l dll.lib dll.o - gcc dll.o exports.o -o dll.dll - gcc program.o dll.lib -o program - - The command line options have the following meanings: - -`-d FILENAME' -`--input-def FILENAME' - Specifies the name of a `.def' file to be read in and processed. - -`-b FILENAME' -`--base-file FILENAME' - Specifies the name of a base file to be read in and processed. The - contents of this file will be added to the relocation section in - the exports file generated by dlltool. - -`-e FILENAME' -`--output-exp FILENAME' - Specifies the name of the export file to be created by dlltool. - -`-z FILENAME' -`--output-def FILENAME' - Specifies the name of the `.def' file to be created by dlltool. - -`-l FILENAME' -`--output-lib FILENAME' - Specifies the name of the library file to be created by dlltool. - -`--export-all-symbols' - Treat all global and weak defined symbols found in the input object - files as symbols to be exported. There is a small list of symbols - which are not exported by default; see the `--no-default-excludes' - option. You may add to the list of symbols to not export by using - the `--exclude-symbols' option. - -`--no-export-all-symbols' - Only export symbols explicitly listed in an input `.def' file or in - `.drectve' sections in the input object files. This is the default - behaviour. The `.drectve' sections are created by `dllexport' - attributes in the source code. - -`--exclude-symbols LIST' - Do not export the symbols in LIST. This is a list of symbol names - separated by comma or colon characters. The symbol names should - not contain a leading underscore. This is only meaningful when - `--export-all-symbols' is used. - -`--no-default-excludes' - When `--export-all-symbols' is used, it will by default avoid - exporting certain special symbols. The current list of symbols to - avoid exporting is `DllMain@12', `DllEntryPoint@0', `impure_ptr'. - You may use the `--no-default-excludes' option to go ahead and - export these special symbols. This is only meaningful when - `--export-all-symbols' is used. - -`-S PATH' -`--as PATH' - Specifies the path, including the filename, of the assembler to be - used to create the exports file. - -`-f OPTIONS' -`--as-flags OPTIONS' - Specifies any specific command line options to be passed to the - assembler when building the exports file. This option will work - even if the `-S' option is not used. This option only takes one - argument, and if it occurs more than once on the command line, - then later occurrences will override earlier occurrences. So if - it is necessary to pass multiple options to the assembler they - should be enclosed in double quotes. - -`-D NAME' -`--dll-name NAME' - Specifies the name to be stored in the `.def' file as the name of - the DLL when the `-e' option is used. If this option is not - present, then the filename given to the `-e' option will be used - as the name of the DLL. - -`-m MACHINE' -`-machine MACHINE' - Specifies the type of machine for which the library file should be - built. `dlltool' has a built in default type, depending upon how - it was created, but this option can be used to override that. - This is normally only useful when creating DLLs for an ARM - processor, when the contents of the DLL are actually encode using - Thumb instructions. - -`-a' -`--add-indirect' - Specifies that when `dlltool' is creating the exports file it - should add a section which allows the exported functions to be - referenced without using the import library. Whatever the hell - that means! - -`-U' -`--add-underscore' - Specifies that when `dlltool' is creating the exports file it - should prepend an underscore to the names of _all_ exported - symbols. - -`--add-stdcall-underscore' - Specifies that when `dlltool' is creating the exports file it - should prepend an underscore to the names of exported _stdcall_ - functions. Variable names and non-stdcall function names are not - modified. This option is useful when creating GNU-compatible - import libs for third party DLLs that were built with MS-Windows - tools. - -`-k' -`--kill-at' - Specifies that when `dlltool' is creating the exports file it - should not append the string `@ '. These numbers are - called ordinal numbers and they represent another way of accessing - the function in a DLL, other than by name. - -`-A' -`--add-stdcall-alias' - Specifies that when `dlltool' is creating the exports file it - should add aliases for stdcall symbols without `@ ' in - addition to the symbols with `@ '. - -`-p' -`--ext-prefix-alias PREFIX' - Causes `dlltool' to create external aliases for all DLL imports - with the specified prefix. The aliases are created for both - external and import symbols with no leading underscore. - -`-x' -`--no-idata4' - Specifies that when `dlltool' is creating the exports and library - files it should omit the `.idata4' section. This is for - compatibility with certain operating systems. - -`-c' -`--no-idata5' - Specifies that when `dlltool' is creating the exports and library - files it should omit the `.idata5' section. This is for - compatibility with certain operating systems. - -`-i' -`--interwork' - Specifies that `dlltool' should mark the objects in the library - file and exports file that it produces as supporting interworking - between ARM and Thumb code. - -`-n' -`--nodelete' - Makes `dlltool' preserve the temporary assembler files it used to - create the exports file. If this option is repeated then dlltool - will also preserve the temporary object files it uses to create - the library file. - -`-t PREFIX' -`--temp-prefix PREFIX' - Makes `dlltool' use PREFIX when constructing the names of - temporary assembler and object files. By default, the temp file - prefix is generated from the pid. - -`-v' -`--verbose' - Make dlltool describe what it is doing. - -`-h' -`--help' - Displays a list of command line options and then exits. - -`-V' -`--version' - Displays dlltool's version number and then exits. - - -* Menu: - -* def file format:: The format of the dlltool `.def' file - - -File: binutils.info, Node: def file format, Up: dlltool - -13.1 The format of the `dlltool' `.def' file -============================================ - -A `.def' file contains any number of the following commands: - -`NAME' NAME `[ ,' BASE `]' - The result is going to be named NAME`.exe'. - -`LIBRARY' NAME `[ ,' BASE `]' - The result is going to be named NAME`.dll'. - -`EXPORTS ( ( (' NAME1 `[ = ' NAME2 `] ) | ( ' NAME1 `=' MODULE-NAME `.' EXTERNAL-NAME `) )' - -`[' INTEGER `] [ NONAME ] [ CONSTANT ] [ DATA ] [ PRIVATE ] ) *' - Declares NAME1 as an exported symbol from the DLL, with optional - ordinal number INTEGER, or declares NAME1 as an alias (forward) of - the function EXTERNAL-NAME in the DLL MODULE-NAME. - -`IMPORTS ( (' INTERNAL-NAME `=' MODULE-NAME `.' INTEGER `) | [' INTERNAL-NAME `= ]' MODULE-NAME `.' EXTERNAL-NAME `) ) *' - Declares that EXTERNAL-NAME or the exported function whose ordinal - number is INTEGER is to be imported from the file MODULE-NAME. If - INTERNAL-NAME is specified then this is the name that the imported - function will be referred to in the body of the DLL. - -`DESCRIPTION' STRING - Puts STRING into the output `.exp' file in the `.rdata' section. - -`STACKSIZE' NUMBER-RESERVE `[, ' NUMBER-COMMIT `]' - -`HEAPSIZE' NUMBER-RESERVE `[, ' NUMBER-COMMIT `]' - Generates `--stack' or `--heap' NUMBER-RESERVE,NUMBER-COMMIT in - the output `.drectve' section. The linker will see this and act - upon it. - -`CODE' ATTR `+' - -`DATA' ATTR `+' - -`SECTIONS (' SECTION-NAME ATTR` + ) *' - Generates `--attr' SECTION-NAME ATTR in the output `.drectve' - section, where ATTR is one of `READ', `WRITE', `EXECUTE' or - `SHARED'. The linker will see this and act upon it. - - - -File: binutils.info, Node: readelf, Next: size, Prev: ranlib, Up: Top - -14 readelf -********** - - readelf [`-a'|`--all'] - [`-h'|`--file-header'] - [`-l'|`--program-headers'|`--segments'] - [`-S'|`--section-headers'|`--sections'] - [`-g'|`--section-groups'] - [`-t'|`--section-details'] - [`-e'|`--headers'] - [`-s'|`--syms'|`--symbols'] - [`-n'|`--notes'] - [`-r'|`--relocs'] - [`-u'|`--unwind'] - [`-d'|`--dynamic'] - [`-V'|`--version-info'] - [`-A'|`--arch-specific'] - [`-D'|`--use-dynamic'] - [`-x' |`--hex-dump='] - [`-w[liaprmfFsoR]'| - `--debug-dump'[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]] - [`-I'|`-histogram'] - [`-v'|`--version'] - [`-W'|`--wide'] - [`-H'|`--help'] - ELFFILE... - - `readelf' displays information about one or more ELF format object -files. The options control what particular information to display. - - ELFFILE... are the object files to be examined. 32-bit and 64-bit -ELF files are supported, as are archives containing ELF files. - - This program performs a similar function to `objdump' but it goes -into more detail and it exists independently of the BFD library, so if -there is a bug in BFD then readelf will not be affected. - - The long and short forms of options, shown here as alternatives, are -equivalent. At least one option besides `-v' or `-H' must be given. - -`-a' -`--all' - Equivalent to specifiying `--file-header', `--program-headers', - `--sections', `--symbols', `--relocs', `--dynamic', `--notes' and - `--version-info'. - -`-h' -`--file-header' - Displays the information contained in the ELF header at the start - of the file. - -`-l' -`--program-headers' -`--segments' - Displays the information contained in the file's segment headers, - if it has any. - -`-S' -`--sections' -`--section-headers' - Displays the information contained in the file's section headers, - if it has any. - -`-g' -`--section-groups' - Displays the information contained in the file's section groups, - if it has any. - -`-t' -`--section-details' - Displays the detailed section information. Implies `-S'. - -`-s' -`--symbols' -`--syms' - Displays the entries in symbol table section of the file, if it - has one. - -`-e' -`--headers' - Display all the headers in the file. Equivalent to `-h -l -S'. - -`-n' -`--notes' - Displays the contents of the NOTE segments and/or sections, if any. - -`-r' -`--relocs' - Displays the contents of the file's relocation section, if it has - one. - -`-u' -`--unwind' - Displays the contents of the file's unwind section, if it has one. - Only the unwind sections for IA64 ELF files are currently - supported. - -`-d' -`--dynamic' - Displays the contents of the file's dynamic section, if it has one. - -`-V' -`--version-info' - Displays the contents of the version sections in the file, it they - exist. - -`-A' -`--arch-specific' - Displays architecture-specific information in the file, if there - is any. - -`-D' -`--use-dynamic' - When displaying symbols, this option makes `readelf' use the - symbol table in the file's dynamic section, rather than the one in - the symbols section. - -`-x ' -`--hex-dump=' - Displays the contents of the indicated section as a hexadecimal - dump. A number identifies a particular section by index in the - section table; any other string identifies all sections with that - name in the object file. - -`-w[liaprmfFsoR]' -`--debug-dump[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]' - Displays the contents of the debug sections in the file, if any are - present. If one of the optional letters or words follows the - switch then only data found in those specific sections will be - dumped. - -`-I' -`--histogram' - Display a histogram of bucket list lengths when displaying the - contents of the symbol tables. - -`-v' -`--version' - Display the version number of readelf. - -`-W' -`--wide' - Don't break output lines to fit into 80 columns. By default - `readelf' breaks section header and segment listing lines for - 64-bit ELF files, so that they fit into 80 columns. This option - causes `readelf' to print each section header resp. each segment - one a single line, which is far more readable on terminals wider - than 80 columns. - -`-H' -`--help' - Display the command line options understood by `readelf'. - - - -File: binutils.info, Node: Common Options, Next: Selecting The Target System, Prev: dlltool, Up: Top - -15 Common Options -***************** - -The following command-line options are supported by all of the programs -described in this manual. - -`@FILE' - Read command-line options from FILE. The options read are - inserted in place of the original @FILE option. If FILE does not - exist, or cannot be read, then the option will be treated - literally, and not removed. - - Options in FILE are separated by whitespace. A whitespace - character may be included in an option by surrounding the entire - option in either single or double quotes. Any character - (including a backslash) may be included by prefixing the character - to be included with a backslash. The FILE may itself contain - additional @FILE options; any such options will be processed - recursively. - -`--help' - Display the command-line options supported by the program. - -`--version' - Display the version number of the program. - - - -File: binutils.info, Node: Selecting The Target System, Next: Reporting Bugs, Prev: Common Options, Up: Top - -16 Selecting the Target System -****************************** - -You can specify two aspects of the target system to the GNU binary file -utilities, each in several ways: - - * the target - - * the architecture - - In the following summaries, the lists of ways to specify values are -in order of decreasing precedence. The ways listed first override those -listed later. - - The commands to list valid values only list the values for which the -programs you are running were configured. If they were configured with -`--enable-targets=all', the commands list most of the available values, -but a few are left out; not all targets can be configured in at once -because some of them can only be configured "native" (on hosts with the -same type as the target system). - -* Menu: - -* Target Selection:: -* Architecture Selection:: - - -File: binutils.info, Node: Target Selection, Next: Architecture Selection, Up: Selecting The Target System - -16.1 Target Selection -===================== - -A "target" is an object file format. A given target may be supported -for multiple architectures (*note Architecture Selection::). A target -selection may also have variations for different operating systems or -architectures. - - The command to list valid target values is `objdump -i' (the first -column of output contains the relevant information). - - Some sample values are: `a.out-hp300bsd', `ecoff-littlemips', -`a.out-sunos-big'. - - You can also specify a target using a configuration triplet. This is -the same sort of name that is passed to `configure' to specify a -target. When you use a configuration triplet as an argument, it must be -fully canonicalized. You can see the canonical version of a triplet by -running the shell script `config.sub' which is included with the -sources. - - Some sample configuration triplets are: `m68k-hp-bsd', -`mips-dec-ultrix', `sparc-sun-sunos'. - -`objdump' Target ----------------- - -Ways to specify: - - 1. command line option: `-b' or `--target' - - 2. environment variable `GNUTARGET' - - 3. deduced from the input file - -`objcopy' and `strip' Input Target ----------------------------------- - -Ways to specify: - - 1. command line options: `-I' or `--input-target', or `-F' or - `--target' - - 2. environment variable `GNUTARGET' - - 3. deduced from the input file - -`objcopy' and `strip' Output Target ------------------------------------ - -Ways to specify: - - 1. command line options: `-O' or `--output-target', or `-F' or - `--target' - - 2. the input target (see "`objcopy' and `strip' Input Target" above) - - 3. environment variable `GNUTARGET' - - 4. deduced from the input file - -`nm', `size', and `strings' Target ----------------------------------- - -Ways to specify: - - 1. command line option: `--target' - - 2. environment variable `GNUTARGET' - - 3. deduced from the input file - - -File: binutils.info, Node: Architecture Selection, Prev: Target Selection, Up: Selecting The Target System - -16.2 Architecture Selection -=========================== - -An "architecture" is a type of CPU on which an object file is to run. -Its name may contain a colon, separating the name of the processor -family from the name of the particular CPU. - - The command to list valid architecture values is `objdump -i' (the -second column contains the relevant information). - - Sample values: `m68k:68020', `mips:3000', `sparc'. - -`objdump' Architecture ----------------------- - -Ways to specify: - - 1. command line option: `-m' or `--architecture' - - 2. deduced from the input file - -`objcopy', `nm', `size', `strings' Architecture ------------------------------------------------ - -Ways to specify: - - 1. deduced from the input file - - -File: binutils.info, Node: Reporting Bugs, Next: GNU Free Documentation License, Prev: Selecting The Target System, Up: Top - -17 Reporting Bugs -***************** - -Your bug reports play an essential role in making the binary utilities -reliable. - - Reporting a bug may help you by bringing a solution to your problem, -or it may not. But in any case the principal function of a bug report -is to help the entire community by making the next version of the binary -utilities work better. Bug reports are your contribution to their -maintenance. - - In order for a bug report to serve its purpose, you must include the -information that enables us to fix the bug. - -* Menu: - -* Bug Criteria:: Have you found a bug? -* Bug Reporting:: How to report bugs - - -File: binutils.info, Node: Bug Criteria, Next: Bug Reporting, Up: Reporting Bugs - -17.1 Have You Found a Bug? -========================== - -If you are not sure whether you have found a bug, here are some -guidelines: - - * If a binary utility gets a fatal signal, for any input whatever, - that is a bug. Reliable utilities never crash. - - * If a binary utility produces an error message for valid input, - that is a bug. - - * If you are an experienced user of binary utilities, your - suggestions for improvement are welcome in any case. - - -File: binutils.info, Node: Bug Reporting, Prev: Bug Criteria, Up: Reporting Bugs - -17.2 How to Report Bugs -======================= - -A number of companies and individuals offer support for GNU products. -If you obtained the binary utilities from a support organization, we -recommend you contact that organization first. - - You can find contact information for many support companies and -individuals in the file `etc/SERVICE' in the GNU Emacs distribution. - - In any event, we also recommend that you send bug reports for the -binary utilities to `bug-binutils@gnu.org'. - - The fundamental principle of reporting bugs usefully is this: -*report all the facts*. If you are not sure whether to state a fact or -leave it out, state it! - - Often people omit facts because they think they know what causes the -problem and assume that some details do not matter. Thus, you might -assume that the name of a file you use in an example does not matter. -Well, probably it does not, but one cannot be sure. Perhaps the bug is -a stray memory reference which happens to fetch from the location where -that pathname is stored in memory; perhaps, if the pathname were -different, the contents of that location would fool the utility into -doing the right thing despite the bug. Play it safe and give a -specific, complete example. That is the easiest thing for you to do, -and the most helpful. - - Keep in mind that the purpose of a bug report is to enable us to fix -the bug if it is new to us. Therefore, always write your bug reports -on the assumption that the bug has not been reported previously. - - Sometimes people give a few sketchy facts and ask, "Does this ring a -bell?" This cannot help us fix a bug, so it is basically useless. We -respond by asking for enough details to enable us to investigate. You -might as well expedite matters by sending them to begin with. - - To enable us to fix the bug, you should include all these things: - - * The version of the utility. Each utility announces it if you - start it with the `--version' argument. - - Without this, we will not know whether there is any point in - looking for the bug in the current version of the binary utilities. - - * Any patches you may have applied to the source, including any - patches made to the `BFD' library. - - * The type of machine you are using, and the operating system name - and version number. - - * What compiler (and its version) was used to compile the - utilities--e.g. "`gcc-2.7'". - - * The command arguments you gave the utility to observe the bug. To - guarantee you will not omit something important, list them all. A - copy of the Makefile (or the output from make) is sufficient. - - If we were to try to guess the arguments, we would probably guess - wrong and then we might not encounter the bug. - - * A complete input file, or set of input files, that will reproduce - the bug. If the utility is reading an object file or files, then - it is generally most helpful to send the actual object files, - uuencoded if necessary to get them through the mail system. Note - that `bug-binutils@gnu.org' is a mailing list, so you should avoid - sending very large files to it. Making the files available for - anonymous FTP is OK. - - If the source files were produced exclusively using GNU programs - (e.g., `gcc', `gas', and/or the GNU `ld'), then it may be OK to - send the source files rather than the object files. In this case, - be sure to say exactly what version of `gcc', or whatever, was - used to produce the object files. Also say how `gcc', or - whatever, was configured. - - * A description of what behavior you observe that you believe is - incorrect. For example, "It gets a fatal signal." - - Of course, if the bug is that the utility gets a fatal signal, - then we will certainly notice it. But if the bug is incorrect - output, we might not notice unless it is glaringly wrong. You - might as well not give us a chance to make a mistake. - - Even if the problem you experience is a fatal signal, you should - still say so explicitly. Suppose something strange is going on, - such as your copy of the utility is out of synch, or you have - encountered a bug in the C library on your system. (This has - happened!) Your copy might crash and ours would not. If you told - us to expect a crash, then when ours fails to crash, we would know - that the bug was not happening for us. If you had not told us to - expect a crash, then we would not be able to draw any conclusion - from our observations. - - * If you wish to suggest changes to the source, send us context - diffs, as generated by `diff' with the `-u', `-c', or `-p' option. - Always send diffs from the old file to the new file. If you wish - to discuss something in the `ld' source, refer to it by context, - not by line number. - - The line numbers in our development sources will not match those - in your sources. Your line numbers would convey no useful - information to us. - - Here are some things that are not necessary: - - * A description of the envelope of the bug. - - Often people who encounter a bug spend a lot of time investigating - which changes to the input file will make the bug go away and which - changes will not affect it. - - This is often time consuming and not very useful, because the way - we will find the bug is by running a single example under the - debugger with breakpoints, not by pure deduction from a series of - examples. We recommend that you save your time for something else. - - Of course, if you can find a simpler example to report _instead_ - of the original one, that is a convenience for us. Errors in the - output will be easier to spot, running under the debugger will take - less time, and so on. - - However, simplification is not vital; if you do not want to do - this, report the bug anyway and send us the entire test case you - used. - - * A patch for the bug. - - A patch for the bug does help us if it is a good one. But do not - omit the necessary information, such as the test case, on the - assumption that a patch is all we need. We might see problems - with your patch and decide to fix the problem another way, or we - might not understand it at all. - - Sometimes with programs as complicated as the binary utilities it - is very hard to construct an example that will make the program - follow a certain path through the code. If you do not send us the - example, we will not be able to construct one, so we will not be - able to verify that the bug is fixed. - - And if we cannot understand what bug you are trying to fix, or why - your patch should be an improvement, we will not install it. A - test case will help us to understand. - - * A guess about what the bug is or what it depends on. - - Such guesses are usually wrong. Even we cannot guess right about - such things without first using the debugger to find the facts. - - -File: binutils.info, Node: GNU Free Documentation License, Next: Index, Prev: Reporting Bugs, Up: Top - -Appendix A GNU Free Documentation License -***************************************** - - Version 1.1, March 2000 - - Copyright (C) 2000, 2003 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - 0. PREAMBLE - - The purpose of this License is to make a manual, textbook, or other - written document "free" in the sense of freedom: to assure everyone - the effective freedom to copy and redistribute it, with or without - modifying it, either commercially or noncommercially. Secondarily, - this License preserves for the author and publisher a way to get - credit for their work, while not being considered responsible for - modifications made by others. - - This License is a kind of "copyleft", which means that derivative - works of the document must themselves be free in the same sense. - It complements the GNU General Public License, which is a copyleft - license designed for free software. - - We have designed this License in order to use it for manuals for - free software, because free software needs free documentation: a - free program should come with manuals providing the same freedoms - that the software does. But this License is not limited to - software manuals; it can be used for any textual work, regardless - of subject matter or whether it is published as a printed book. - We recommend this License principally for works whose purpose is - instruction or reference. - - - 1. APPLICABILITY AND DEFINITIONS - - This License applies to any manual or other work that contains a - notice placed by the copyright holder saying it can be distributed - under the terms of this License. The "Document", below, refers to - any such manual or work. Any member of the public is a licensee, - and is addressed as "you." - - A "Modified Version" of the Document means any work containing the - Document or a portion of it, either copied verbatim, or with - modifications and/or translated into another language. - - A "Secondary Section" is a named appendix or a front-matter - section of the Document that deals exclusively with the - relationship of the publishers or authors of the Document to the - Document's overall subject (or to related matters) and contains - nothing that could fall directly within that overall subject. - (For example, if the Document is in part a textbook of - mathematics, a Secondary Section may not explain any mathematics.) - The relationship could be a matter of historical connection with - the subject or with related matters, or of legal, commercial, - philosophical, ethical or political position regarding them. - - The "Invariant Sections" are certain Secondary Sections whose - titles are designated, as being those of Invariant Sections, in - the notice that says that the Document is released under this - License. - - The "Cover Texts" are certain short passages of text that are - listed, as Front-Cover Texts or Back-Cover Texts, in the notice - that says that the Document is released under this License. - - A "Transparent" copy of the Document means a machine-readable copy, - represented in a format whose specification is available to the - general public, whose contents can be viewed and edited directly - and straightforwardly with generic text editors or (for images - composed of pixels) generic paint programs or (for drawings) some - widely available drawing editor, and that is suitable for input to - text formatters or for automatic translation to a variety of - formats suitable for input to text formatters. A copy made in an - otherwise Transparent file format whose markup has been designed - to thwart or discourage subsequent modification by readers is not - Transparent. A copy that is not "Transparent" is called "Opaque." - - Examples of suitable formats for Transparent copies include plain - ASCII without markup, Texinfo input format, LaTeX input format, - SGML or XML using a publicly available DTD, and - standard-conforming simple HTML designed for human modification. - Opaque formats include PostScript, PDF, proprietary formats that - can be read and edited only by proprietary word processors, SGML - or XML for which the DTD and/or processing tools are not generally - available, and the machine-generated HTML produced by some word - processors for output purposes only. - - The "Title Page" means, for a printed book, the title page itself, - plus such following pages as are needed to hold, legibly, the - material this License requires to appear in the title page. For - works in formats which do not have any title page as such, "Title - Page" means the text near the most prominent appearance of the - work's title, preceding the beginning of the body of the text. - - 2. VERBATIM COPYING - - You may copy and distribute the Document in any medium, either - commercially or noncommercially, provided that this License, the - copyright notices, and the license notice saying this License - applies to the Document are reproduced in all copies, and that you - add no other conditions whatsoever to those of this License. You - may not use technical measures to obstruct or control the reading - or further copying of the copies you make or distribute. However, - you may accept compensation in exchange for copies. If you - distribute a large enough number of copies you must also follow - the conditions in section 3. - - You may also lend copies, under the same conditions stated above, - and you may publicly display copies. - - 3. COPYING IN QUANTITY - - If you publish printed copies of the Document numbering more than - 100, and the Document's license notice requires Cover Texts, you - must enclose the copies in covers that carry, clearly and legibly, - all these Cover Texts: Front-Cover Texts on the front cover, and - Back-Cover Texts on the back cover. Both covers must also clearly - and legibly identify you as the publisher of these copies. The - front cover must present the full title with all words of the - title equally prominent and visible. You may add other material - on the covers in addition. Copying with changes limited to the - covers, as long as they preserve the title of the Document and - satisfy these conditions, can be treated as verbatim copying in - other respects. - - If the required texts for either cover are too voluminous to fit - legibly, you should put the first ones listed (as many as fit - reasonably) on the actual cover, and continue the rest onto - adjacent pages. - - If you publish or distribute Opaque copies of the Document - numbering more than 100, you must either include a - machine-readable Transparent copy along with each Opaque copy, or - state in or with each Opaque copy a publicly-accessible - computer-network location containing a complete Transparent copy - of the Document, free of added material, which the general - network-using public has access to download anonymously at no - charge using public-standard network protocols. If you use the - latter option, you must take reasonably prudent steps, when you - begin distribution of Opaque copies in quantity, to ensure that - this Transparent copy will remain thus accessible at the stated - location until at least one year after the last time you - distribute an Opaque copy (directly or through your agents or - retailers) of that edition to the public. - - It is requested, but not required, that you contact the authors of - the Document well before redistributing any large number of - copies, to give them a chance to provide you with an updated - version of the Document. - - 4. MODIFICATIONS - - You may copy and distribute a Modified Version of the Document - under the conditions of sections 2 and 3 above, provided that you - release the Modified Version under precisely this License, with - the Modified Version filling the role of the Document, thus - licensing distribution and modification of the Modified Version to - whoever possesses a copy of it. In addition, you must do these - things in the Modified Version: - - A. Use in the Title Page (and on the covers, if any) a title - distinct from that of the Document, and from those of previous - versions (which should, if there were any, be listed in the - History section of the Document). You may use the same title - as a previous version if the original publisher of that version - gives permission. - B. List on the Title Page, as authors, one or more persons or - entities responsible for authorship of the modifications in the - Modified Version, together with at least five of the principal - authors of the Document (all of its principal authors, if it - has less than five). - C. State on the Title page the name of the publisher of the - Modified Version, as the publisher. - D. Preserve all the copyright notices of the Document. - E. Add an appropriate copyright notice for your modifications - adjacent to the other copyright notices. - F. Include, immediately after the copyright notices, a license - notice giving the public permission to use the Modified Version - under the terms of this License, in the form shown in the - Addendum below. - G. Preserve in that license notice the full lists of Invariant - Sections and required Cover Texts given in the Document's - license notice. - H. Include an unaltered copy of this License. - I. Preserve the section entitled "History", and its title, and add - to it an item stating at least the title, year, new authors, and - publisher of the Modified Version as given on the Title Page. - If there is no section entitled "History" in the Document, - create one stating the title, year, authors, and publisher of - the Document as given on its Title Page, then add an item - describing the Modified Version as stated in the previous - sentence. - J. Preserve the network location, if any, given in the Document for - public access to a Transparent copy of the Document, and - likewise the network locations given in the Document for - previous versions it was based on. These may be placed in the - "History" section. You may omit a network location for a work - that was published at least four years before the Document - itself, or if the original publisher of the version it refers - to gives permission. - K. In any section entitled "Acknowledgements" or "Dedications", - preserve the section's title, and preserve in the section all the - substance and tone of each of the contributor acknowledgements - and/or dedications given therein. - L. Preserve all the Invariant Sections of the Document, - unaltered in their text and in their titles. Section numbers - or the equivalent are not considered part of the section titles. - M. Delete any section entitled "Endorsements." Such a section - may not be included in the Modified Version. - N. Do not retitle any existing section as "Endorsements" or to - conflict in title with any Invariant Section. - - If the Modified Version includes new front-matter sections or - appendices that qualify as Secondary Sections and contain no - material copied from the Document, you may at your option - designate some or all of these sections as invariant. To do this, - add their titles to the list of Invariant Sections in the Modified - Version's license notice. These titles must be distinct from any - other section titles. - - You may add a section entitled "Endorsements", provided it contains - nothing but endorsements of your Modified Version by various - parties-for example, statements of peer review or that the text has - been approved by an organization as the authoritative definition - of a standard. - - You may add a passage of up to five words as a Front-Cover Text, - and a passage of up to 25 words as a Back-Cover Text, to the end - of the list of Cover Texts in the Modified Version. Only one - passage of Front-Cover Text and one of Back-Cover Text may be - added by (or through arrangements made by) any one entity. If the - Document already includes a cover text for the same cover, - previously added by you or by arrangement made by the same entity - you are acting on behalf of, you may not add another; but you may - replace the old one, on explicit permission from the previous - publisher that added the old one. - - The author(s) and publisher(s) of the Document do not by this - License give permission to use their names for publicity for or to - assert or imply endorsement of any Modified Version. - - 5. COMBINING DOCUMENTS - - You may combine the Document with other documents released under - this License, under the terms defined in section 4 above for - modified versions, provided that you include in the combination - all of the Invariant Sections of all of the original documents, - unmodified, and list them all as Invariant Sections of your - combined work in its license notice. - - The combined work need only contain one copy of this License, and - multiple identical Invariant Sections may be replaced with a single - copy. If there are multiple Invariant Sections with the same name - but different contents, make the title of each such section unique - by adding at the end of it, in parentheses, the name of the - original author or publisher of that section if known, or else a - unique number. Make the same adjustment to the section titles in - the list of Invariant Sections in the license notice of the - combined work. - - In the combination, you must combine any sections entitled - "History" in the various original documents, forming one section - entitled "History"; likewise combine any sections entitled - "Acknowledgements", and any sections entitled "Dedications." You - must delete all sections entitled "Endorsements." - - 6. COLLECTIONS OF DOCUMENTS - - You may make a collection consisting of the Document and other - documents released under this License, and replace the individual - copies of this License in the various documents with a single copy - that is included in the collection, provided that you follow the - rules of this License for verbatim copying of each of the - documents in all other respects. - - You may extract a single document from such a collection, and - distribute it individually under this License, provided you insert - a copy of this License into the extracted document, and follow - this License in all other respects regarding verbatim copying of - that document. - - 7. AGGREGATION WITH INDEPENDENT WORKS - - A compilation of the Document or its derivatives with other - separate and independent documents or works, in or on a volume of - a storage or distribution medium, does not as a whole count as a - Modified Version of the Document, provided no compilation - copyright is claimed for the compilation. Such a compilation is - called an "aggregate", and this License does not apply to the - other self-contained works thus compiled with the Document, on - account of their being thus compiled, if they are not themselves - derivative works of the Document. - - If the Cover Text requirement of section 3 is applicable to these - copies of the Document, then if the Document is less than one - quarter of the entire aggregate, the Document's Cover Texts may be - placed on covers that surround only the Document within the - aggregate. Otherwise they must appear on covers around the whole - aggregate. - - 8. TRANSLATION - - Translation is considered a kind of modification, so you may - distribute translations of the Document under the terms of section - 4. Replacing Invariant Sections with translations requires special - permission from their copyright holders, but you may include - translations of some or all Invariant Sections in addition to the - original versions of these Invariant Sections. You may include a - translation of this License provided that you also include the - original English version of this License. In case of a - disagreement between the translation and the original English - version of this License, the original English version will prevail. - - 9. TERMINATION - - You may not copy, modify, sublicense, or distribute the Document - except as expressly provided for under this License. Any other - attempt to copy, modify, sublicense or distribute the Document is - void, and will automatically terminate your rights under this - License. However, parties who have received copies, or rights, - from you under this License will not have their licenses - terminated so long as such parties remain in full compliance. - - 10. FUTURE REVISIONS OF THIS LICENSE - - The Free Software Foundation may publish new, revised versions of - the GNU Free Documentation License from time to time. Such new - versions will be similar in spirit to the present version, but may - differ in detail to address new problems or concerns. See - http://www.gnu.org/copyleft/. - - Each version of the License is given a distinguishing version - number. If the Document specifies that a particular numbered - version of this License "or any later version" applies to it, you - have the option of following the terms and conditions either of - that specified version or of any later version that has been - published (not as a draft) by the Free Software Foundation. If - the Document does not specify a version number of this License, - you may choose any version ever published (not as a draft) by the - Free Software Foundation. - - -ADDENDUM: How to use this License for your documents -==================================================== - -To use this License in a document you have written, include a copy of -the License in the document and put the following copyright and license -notices just after the title page: - - Copyright (C) YEAR YOUR NAME. - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.1 - or any later version published by the Free Software Foundation; - with the Invariant Sections being LIST THEIR TITLES, with the - Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. - A copy of the license is included in the section entitled "GNU - Free Documentation License." - - If you have no Invariant Sections, write "with no Invariant Sections" -instead of saying which ones are invariant. If you have no Front-Cover -Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being -LIST"; likewise for Back-Cover Texts. - - If your document contains nontrivial examples of program code, we -recommend releasing these examples in parallel under your choice of -free software license, such as the GNU General Public License, to -permit their use in free software. - - -File: binutils.info, Node: Index, Prev: GNU Free Documentation License, Up: Top - -Index -***** - -[index] -* Menu: - -* .stab: objdump. (line 324) -* addr2line: addr2line. (line 6) -* address to file name and line number: addr2line. (line 6) -* all header information, object file: objdump. (line 364) -* ar: ar. (line 6) -* ar compatibility: ar. (line 40) -* architecture: objdump. (line 176) -* architectures available: objdump. (line 161) -* archive contents: ranlib. (line 6) -* archive headers: objdump. (line 60) -* archives: ar. (line 6) -* base files: dlltool. (line 108) -* bug criteria: Bug Criteria. (line 6) -* bug reports: Bug Reporting. (line 6) -* bugs: Reporting Bugs. (line 6) -* bugs, reporting: Bug Reporting. (line 6) -* c++filt: c++filt. (line 6) -* changing object addresses: objcopy. (line 266) -* changing section address: objcopy. (line 276) -* changing section LMA: objcopy. (line 284) -* changing section VMA: objcopy. (line 297) -* changing start address: objcopy. (line 261) -* collections of files: ar. (line 6) -* compatibility, ar: ar. (line 40) -* contents of archive: ar cmdline. (line 88) -* crash: Bug Criteria. (line 9) -* creating archives: ar cmdline. (line 127) -* cxxfilt: c++filt. (line 14) -* dates in archive: ar cmdline. (line 154) -* debug symbols: objdump. (line 319) -* debugging symbols: nm. (line 116) -* deleting from archive: ar cmdline. (line 26) -* demangling C++ symbols: c++filt. (line 6) -* demangling in nm: nm. (line 124) -* demangling in objdump <1>: addr2line. (line 55) -* demangling in objdump: objdump. (line 88) -* disassembling object code: objdump. (line 110) -* disassembly architecture: objdump. (line 176) -* disassembly endianness: objdump. (line 126) -* disassembly, with source: objdump. (line 305) -* discarding symbols: strip. (line 6) -* DLL: dlltool. (line 6) -* dlltool: dlltool. (line 6) -* DWARF: objdump. (line 319) -* dynamic relocation entries, in object file: objdump. (line 294) -* dynamic symbol table entries, printing: objdump. (line 348) -* dynamic symbols: nm. (line 136) -* ELF dynamic section information: readelf. (line 102) -* ELF file header information: readelf. (line 51) -* ELF file information: readelf. (line 6) -* ELF notes: readelf. (line 87) -* ELF object file format: objdump. (line 324) -* ELF program header information: readelf. (line 57) -* ELF reloc information: readelf. (line 91) -* ELF section group information: readelf. (line 68) -* ELF section information: readelf. (line 63) -* ELF segment information: readelf. (line 57) -* ELF symbol table information: readelf. (line 78) -* ELF version sections informations: readelf. (line 106) -* endianness: objdump. (line 126) -* error on valid input: Bug Criteria. (line 12) -* external symbols: nm. (line 148) -* extract from archive: ar cmdline. (line 103) -* fatal signal: Bug Criteria. (line 9) -* file name: nm. (line 110) -* header information, all: objdump. (line 364) -* input .def file: dlltool. (line 104) -* input file name: nm. (line 110) -* libraries: ar. (line 25) -* listings strings: strings. (line 6) -* machine instructions: objdump. (line 110) -* moving in archive: ar cmdline. (line 34) -* MRI compatibility, ar: ar scripts. (line 8) -* name duplication in archive: ar cmdline. (line 97) -* name length: ar. (line 18) -* nm: nm. (line 6) -* nm compatibility: nm. (line 120) -* nm format: nm. (line 120) -* not writing archive index: ar cmdline. (line 173) -* objdump: objdump. (line 6) -* object code format <1>: addr2line. (line 50) -* object code format <2>: strings. (line 65) -* object code format <3>: size. (line 79) -* object code format <4>: objdump. (line 74) -* object code format: nm. (line 212) -* object file header: objdump. (line 132) -* object file information: objdump. (line 6) -* object file sections: objdump. (line 300) -* object formats available: objdump. (line 161) -* operations on archive: ar cmdline. (line 22) -* printing from archive: ar cmdline. (line 46) -* printing strings: strings. (line 6) -* quick append to archive: ar cmdline. (line 54) -* radix for section sizes: size. (line 65) -* ranlib: ranlib. (line 6) -* readelf: readelf. (line 6) -* relative placement in archive: ar cmdline. (line 115) -* relocation entries, in object file: objdump. (line 288) -* removing symbols: strip. (line 6) -* repeated names in archive: ar cmdline. (line 97) -* replacement in archive: ar cmdline. (line 70) -* reporting bugs: Reporting Bugs. (line 6) -* scripts, ar: ar scripts. (line 8) -* section addresses in objdump: objdump. (line 66) -* section headers: objdump. (line 143) -* section information: objdump. (line 166) -* section sizes: size. (line 6) -* sections, full contents: objdump. (line 300) -* size: size. (line 6) -* size display format: size. (line 26) -* size number format: size. (line 65) -* sorting symbols: nm. (line 167) -* source code context: objdump. (line 136) -* source disassembly: objdump. (line 305) -* source file name: nm. (line 110) -* source filenames for object files: objdump. (line 170) -* stab: objdump. (line 324) -* start-address: objdump. (line 334) -* stop-address: objdump. (line 338) -* strings: strings. (line 6) -* strings, printing: strings. (line 6) -* strip: strip. (line 6) -* symbol index <1>: ranlib. (line 6) -* symbol index: ar. (line 28) -* symbol index, listing: nm. (line 182) -* symbol line numbers: nm. (line 152) -* symbol table entries, printing: objdump. (line 343) -* symbols: nm. (line 6) -* symbols, discarding: strip. (line 6) -* undefined symbols: nm. (line 217) -* Unix compatibility, ar: ar cmdline. (line 8) -* unwind information: readelf. (line 96) -* updating an archive: ar cmdline. (line 180) -* version: Top. (line 6) -* VMA in objdump: objdump. (line 66) -* wide output, printing: objdump. (line 370) -* writing archive index: ar cmdline. (line 167) - - - -Tag Table: -Node: Top1751 -Node: ar3304 -Node: ar cmdline5482 -Node: ar scripts13625 -Node: nm19313 -Node: objcopy27509 -Node: objdump50561 -Node: ranlib65474 -Node: size66229 -Node: strings69076 -Node: strip71426 -Node: c++filt76905 -Ref: c++filt-Footnote-181833 -Node: addr2line81939 -Node: nlmconv85210 -Node: windres87816 -Node: dlltool93549 -Node: def file format104387 -Node: readelf106125 -Node: Common Options110833 -Node: Selecting The Target System111873 -Node: Target Selection112805 -Node: Architecture Selection114787 -Node: Reporting Bugs115615 -Node: Bug Criteria116394 -Node: Bug Reporting116947 -Node: GNU Free Documentation License124041 -Node: Index143773 - -End Tag Table diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi index be571d2a7cc..9499634458d 100644 --- a/binutils/doc/binutils.texi +++ b/binutils/doc/binutils.texi @@ -1,9 +1,10 @@ \input texinfo @c -*- Texinfo -*- @setfilename binutils.info -@c Copyright 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +@c Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 +@c Free Software Foundation, Inc. @c man begin INCLUDE -@include config.texi +@include bfdver.texi @c man end @ifinfo @@ -24,15 +25,16 @@ START-INFO-DIR-ENTRY * addr2line: (binutils)addr2line. Convert addresses to file and line * nlmconv: (binutils)nlmconv. Converts object code into an NLM * windres: (binutils)windres. Manipulate Windows resources +* windmc: (binutils)windmc. Generator for Windows message resources * dlltool: (binutils)dlltool. Create files needed to build and use DLLs END-INFO-DIR-ENTRY @end format @end ifinfo -@ifinfo +@copying @c man begin COPYRIGHT Copyright @copyright{} 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 @@ -42,23 +44,16 @@ Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. @c man end -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries a copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -@end ifinfo +@end copying @synindex ky cp @c @c This file documents the GNU binary utilities "ar", "ld", "objcopy", @c "objdump", "nm", "size", "strings", "strip", "readelf" and "ranlib". @c -@c Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -@c 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -@c +@c Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +@c 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +@c @c This text may be freely distributed under the terms of the GNU @c Free Documentation License. @c @@ -68,6 +63,9 @@ notice identical to this one except for the removal of this paragraph @titlepage @finalout @title The @sc{gnu} Binary Utilities +@ifset VERSION_PACKAGE +@subtitle @value{VERSION_PACKAGE} +@end ifset @subtitle Version @value{VERSION} @sp 1 @subtitle @value{UPDATED} @@ -83,7 +81,7 @@ notice identical to this one except for the removal of this paragraph @vskip 0pt plus 1filll Copyright @copyright{} 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 @@ -93,13 +91,18 @@ Copyright @copyright{} 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, section entitled ``GNU Free Documentation License''. @end titlepage +@contents @node Top @top Introduction @cindex version This brief manual contains documentation for the @sc{gnu} binary -utilities (collectively version @value{VERSION}): +utilities +@ifset VERSION_PACKAGE +@value{VERSION_PACKAGE} +@end ifset +version @value{VERSION}: @iftex @table @code @@ -143,6 +146,9 @@ Convert object code into a Netware Loadable Module @item windres Manipulate Windows resources +@item windmc +Genertor for Windows message resources + @item dlltool Create the files needed to build and use Dynamic Link Libraries @end table @@ -167,12 +173,13 @@ section entitled "GNU Free Documentation License". * addr2line:: Convert addresses to file and line * nlmconv:: Converts object code into an NLM * windres:: Manipulate Windows resources +* windmc:: Generator for Windows message resources * dlltool:: Create files needed to build and use DLLs * Common Options:: Command-line options for all utilities * Selecting The Target System:: How these utilities determine the target. * Reporting Bugs:: Reporting Bugs * GNU Free Documentation License:: GNU Free Documentation License -* Index:: Index +* Binutils Index:: Binutils Index @end menu @node ar @@ -198,7 +205,7 @@ the original individual files (called @dfn{members} of the archive). The original files' contents, mode (permissions), timestamp, owner, and group are preserved in the archive, and can be restored on -extraction. +extraction. @cindex name length @sc{gnu} @command{ar} can maintain archives whose members have names of any @@ -289,7 +296,7 @@ Use this operation to @emph{move} members in an archive. The ordering of members in an archive can make a difference in how programs are linked using the library, if a symbol is defined in more -than one member. +than one member. If no modifiers are used with @code{m}, any members you name in the @var{member} arguments are moved to the @emph{end} of the archive; @@ -413,7 +420,7 @@ member must be present as the @var{relpos} argument, before the @item l This modifier is accepted but not used. @c whaffor ar l modifier??? presumably compat; with -@c what???---doc@@cygnus.com, 25jan91 +@c what???---doc@@cygnus.com, 25jan91 @item N Uses the @var{count} parameter. This is used if there are multiple @@ -546,7 +553,7 @@ to @code{SAVE}, commands affect only the temporary copy of the current archive. @table @code -@item ADDLIB @var{archive} +@item ADDLIB @var{archive} @itemx ADDLIB @var{archive} (@var{module}, @var{module}, @dots{} @var{module}) Add all the contents of @var{archive} (or, if specified, each named @var{module} from @var{archive}) to the current archive. @@ -627,7 +634,7 @@ will not actually affect @var{archive} until you next use @code{SAVE}. In the current archive, replace each existing @var{module} (named in the @code{REPLACE} arguments) from files in the current working directory. To execute this command without errors, both the file, and the module in -the current archive, must exist. +the current archive, must exist. Requires prior use of @code{OPEN} or @code{CREATE}. @@ -639,7 +646,7 @@ When the flag is on, @code{DIRECTORY} output matches output from @item SAVE Commit your changes to the current archive, and actually save it as a file with the name specified in the last @code{CREATE} or @code{OPEN} -command. +command. Requires prior use of @code{OPEN} or @code{CREATE}. @@ -752,7 +759,7 @@ weak object symbol. When a weak defined symbol is linked with a normal defined symbol, the normal defined symbol is used with no error. When a weak undefined symbol is linked and the symbol is not defined, the value of the symbol is determined in a system-specific manner without -error. On some systems, uppercase indicates that a default value has been +error. On some systems, uppercase indicates that a default value has been specified. @@ -782,7 +789,7 @@ equivalent. @table @env @item -A @itemx -o -@itemx --print-file-name +@itemx --print-file-name @cindex input file name @cindex file name @cindex source file name @@ -791,7 +798,7 @@ in which it was found, rather than identifying the input file once only, before all of its symbols. @item -a -@itemx --debug-syms +@itemx --debug-syms @cindex debugging symbols Display all symbols, even debugger-only symbols; normally these are not listed. @@ -807,8 +814,8 @@ The same as @option{--format=bsd} (for compatibility with the MIPS @command{nm}) Decode (@dfn{demangle}) low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, this makes C++ function names readable. Different compilers have different -mangling styles. The optional demangling style argument can be used to -choose an appropriate demangling style for your compiler. @xref{c++filt}, +mangling styles. The optional demangling style argument can be used to +choose an appropriate demangling style for your compiler. @xref{c++filt}, for more information on demangling. @item --no-demangle @@ -831,7 +838,7 @@ Only the first character of @var{format} is significant; it can be either upper or lower case. @item -g -@itemx --extern-only +@itemx --extern-only @cindex external symbols Display only external symbols. @@ -846,12 +853,12 @@ information can be found, print it after the other symbol information. @item -n @itemx -v -@itemx --numeric-sort +@itemx --numeric-sort Sort symbols numerically by their addresses, rather than alphabetically -by their names. +by their names. @item -p -@itemx --no-sort +@itemx --no-sort @cindex sorting symbols Do not bother to sort the symbols in any order; print them in the order encountered. @@ -873,15 +880,15 @@ When listing symbols from archive members, include the index: a mapping contain definitions for which names. @item -r -@itemx --reverse-sort +@itemx --reverse-sort Reverse the order of the sort (whether numeric or alphabetic); let the last come first. @item --size-sort Sort symbols by size. The size is computed as the difference between the value of the symbol and the value of the symbol with the next higher -value. If the @code{bsd} output format is used the size of the symbol -is printed, rather than the value, and @samp{-S} must be used in order +value. If the @code{bsd} output format is used the size of the symbol +is printed, rather than the value, and @samp{-S} must be used in order both size and value to be printed. @item --special-syms @@ -889,7 +896,7 @@ Display symbols which have a target-specific special meaning. These symbols are usually used by the target for some special processing and are not normally helpful when included included in the normal symbol lists. For example for ARM targets this option would skip the mapping -symbols used to mark transistions between ARM code, THUMB code and +symbols used to mark transitions between ARM code, THUMB code and data. @item -t @var{radix} @@ -903,7 +910,7 @@ Specify an object code format other than your system's default format. @xref{Target Selection}, for more information. @item -u -@itemx --undefined-only +@itemx --undefined-only @cindex external symbols @cindex undefined symbols Display only undefined symbols (those external to each object file). @@ -952,6 +959,7 @@ objcopy [@option{-F} @var{bfdname}|@option{--target=}@var{bfdname}] [@option{-N} @var{symbolname}|@option{--strip-symbol=}@var{symbolname}] [@option{--strip-unneeded-symbol=}@var{symbolname}] [@option{-G} @var{symbolname}|@option{--keep-global-symbol=}@var{symbolname}] + [@option{--localize-hidden}] [@option{-L} @var{symbolname}|@option{--localize-symbol=}@var{symbolname}] [@option{--globalize-symbol=}@var{symbolname}] [@option{-W} @var{symbolname}|@option{--weaken-symbol=}@var{symbolname}] @@ -977,6 +985,7 @@ objcopy [@option{-F} @var{bfdname}|@option{--target=}@var{bfdname}] [@option{--add-section} @var{sectionname}=@var{filename}] [@option{--rename-section} @var{oldname}=@var{newname}[,@var{flags}]] [@option{--change-leading-char}] [@option{--remove-leading-char}] + [@option{--reverse-bytes=}@var{num}] [@option{--srec-len=}@var{ival}] [@option{--srec-forceS3}] [@option{--redefine-sym} @var{old}=@var{new}] [@option{--redefine-syms=}@var{filename}] @@ -995,12 +1004,13 @@ objcopy [@option{-F} @var{bfdname}|@option{--target=}@var{bfdname}] [@option{--add-gnu-debuglink=}@var{path-to-file}] [@option{--keep-file-symbols}] [@option{--only-keep-debug}] + [@option{--extract-symbol}] [@option{--writable-text}] [@option{--readonly-text}] [@option{--pure}] [@option{--impure}] [@option{-v}|@option{--verbose}] - [@option{-V}|@option{--version}] + [@option{-V}|@option{--version}] [@option{--help}] [@option{--info}] @var{infile} [@var{outfile}] @c man end @@ -1041,6 +1051,7 @@ Note---@command{objcopy} is not able to change the endianness of its input files. If the input format has an endianness (some formats do not), @command{objcopy} can only copy the inputs into file formats that have the same endianness or which have no endianness (e.g., @samp{srec}). +(However, see the @option{--reverse-bytes} option.) @c man end @@ -1079,7 +1090,7 @@ can access this binary data inside a program by referencing the special symbols that are created by the conversion process. These symbols are called _binary_@var{objfile}_start, _binary_@var{objfile}_end and _binary_@var{objfile}_size. e.g. you can transform a picture file into -an object file and then access it in your code using these symbols. +an object file and then access it in your code using these symbols. @item -j @var{sectionname} @itemx --only-section=@var{sectionname} @@ -1124,6 +1135,11 @@ Keep only symbol @var{symbolname} global. Make all other symbols local to the file, so that they are not visible externally. This option may be given more than once. +@item --localize-hidden +In an ELF object, mark all symbols that have hidden or internal visibility +as local. This option applies on top of symbol-specific localization options +such as @option{-L}. + @item -L @var{symbolname} @itemx --localize-symbol=@var{symbolname} Make symbol @var{symbolname} local to the file, so that it is not @@ -1219,7 +1235,7 @@ address, by adding @var{incr}. Some object file formats do not permit section addresses to be changed arbitrarily. Note that this does not relocate the sections; if the program expects sections to be loaded at a certain address, and this option is used to change the sections such -that they are loaded at a different address, the program may fail. +that they are loaded at a different address, the program may fail. @item --change-section-address @var{section}@{=,+,-@}@var{val} @itemx --adjust-section-vma @var{section}@{=,+,-@}@var{val} @@ -1242,7 +1258,7 @@ different. If @samp{=} is used, the section address is set to @var{val}. Otherwise, @var{val} is added to or subtracted from the section address. See the comments under @option{--change-addresses}, above. If @var{section} does not exist in the input file, a warning -will be issued, unless @option{--no-change-warnings} is used. +will be issued, unless @option{--no-change-warnings} is used. @item --change-section-vma @var{section}@{=,+,-@}@var{val} @cindex changing section VMA @@ -1256,19 +1272,19 @@ is set to @var{val}. Otherwise, @var{val} is added to or subtracted from the section address. See the comments under @option{--change-addresses}, above. If @var{section} does not exist in the input file, a warning will be issued, unless -@option{--no-change-warnings} is used. +@option{--no-change-warnings} is used. @item --change-warnings @itemx --adjust-warnings If @option{--change-section-address} or @option{--change-section-lma} or @option{--change-section-vma} is used, and the named section does not -exist, issue a warning. This is the default. +exist, issue a warning. This is the default. @item --no-change-warnings @itemx --no-adjust-warnings Do not issue a warning if @option{--change-section-address} or @option{--adjust-section-lma} or @option{--adjust-section-vma} is used, even -if the named section does not exist. +if the named section does not exist. @item --set-section-flags @var{section}=@var{flags} Set the flags for the named section. The @var{flags} argument is a @@ -1326,13 +1342,37 @@ different conventions for symbol names. This is different from when appropriate, regardless of the object file format of the output file. +@item --reverse-bytes=@var{num} +Reverse the bytes in a section with output contents. A section length must +be evenly divisible by the value given in order for the swap to be able to +take place. Reversing takes place before the interleaving is performed. + +This option is used typically in generating ROM images for problematic +target systems. For example, on some target boards, the 32-bit words +fetched from 8-bit ROMs are re-assembled in little-endian byte order +regardless of the CPU byte order. Depending on the programming model, the +endianness of the ROM may need to be modified. + +Consider a simple file with a section containing the following eight +bytes: @code{12345678}. + +Using @samp{--reverse-bytes=2} for the above example, the bytes in the +output file would be ordered @code{21436587}. + +Using @samp{--reverse-bytes=4} for the above example, the bytes in the +output file would be ordered @code{43218765}. + +By using @samp{--reverse-bytes=2} for the above example, followed by +@samp{--reverse-bytes=4} on the output file, the bytes in the second +output file would be ordered @code{34127856}. + @item --srec-len=@var{ival} Meaningful only for srec output. Set the maximum length of the Srecords being produced to @var{ival}. This length covers both address, data and crc fields. @item --srec-forceS3 -Meaningful only for srec output. Avoid generation of S1/S2 records, +Meaningful only for srec output. Avoid generation of S1/S2 records, creating S3-only record format. @item --redefine-sym @var{old}=@var{new} @@ -1397,7 +1437,7 @@ This option may be given more than once. @item --alt-machine-code=@var{index} If the output architecture has alternate machine codes, use the @var{index}th code instead of the default one. This is useful in case -a machine is assigned an official code and the tool-chain adopts the +a machine is assigned an official code and the tool-chain adopts the new code, but other applications still depend on the original code being used. For ELF based architectures if the @var{index} alternative does not exist then the value is treated as an absolute @@ -1441,7 +1481,7 @@ which would otherwise get stripped. @item --only-keep-debug Strip a file, removing contents of any sections that would not be stripped by @option{--strip-debug} and leaving the debugging sections -intact. +intact. In ELF files, this preserves all note sections in the output. The intention is that this option will be used in conjunction with @option{--add-gnu-debuglink} to create a two part executable. One a @@ -1472,10 +1512,32 @@ optional. You could instead do this: @item Run @code{objcopy --add-gnu-debuglink=foo.full foo} @end enumerate -i.e. the file pointed to by the @option{--add-gnu-debuglink} can be the +i.e., the file pointed to by the @option{--add-gnu-debuglink} can be the full executable. It does not have to be a file created by the @option{--only-keep-debug} switch. +Note - this switch is only intended for use on fully linked files. It +does not make sense to use it on object files where the debugging +information may be incomplete. Besides the gnu_debuglink feature +currently only supports the presence of one filename containing +debugging information, not multiple filenames on a one-per-object-file +basis. + +@item --extract-symbol +Keep the file's section flags and symbols but remove all section data. +Specifically, the option: + +@itemize +@item sets the virtual and load addresses of every section to zero; +@item removes the contents of all sections; +@item sets the size of every section to zero; and +@item sets the file's start address to zero. +@end itemize + +This option is used to build a @file{.sym} file for a VxWorks kernel. +It can also be a useful way of reducing the size of a @option{--just-symbols} +linker input file. + @item -V @itemx --version Show the version number of @command{objcopy}. @@ -1612,8 +1674,8 @@ formats available with the @option{-i} option. Decode (@dfn{demangle}) low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, this makes C++ function names readable. Different compilers have different -mangling styles. The optional demangling style argument can be used to -choose an appropriate demangling style for your compiler. @xref{c++filt}, +mangling styles. The optional demangling style argument can be used to +choose an appropriate demangling style for your compiler. @xref{c++filt}, for more information on demangling. @item -g @@ -1747,7 +1809,7 @@ switch, but allow finer grained control. Multiple selections from the following may be specified as a comma separated string. @option{x86-64}, @option{i386} and @option{i8086} select disassembly for the given architecture. @option{intel} and @option{att} select between -intel syntax mode and AT&T syntax mode. @option{addr32}, +intel syntax mode and AT&T syntax mode. @option{addr64}, @option{addr32}, @option{addr16}, @option{data32} and @option{data16} specify the default address size and operand size. These four options will be overridden if @option{x86-64}, @option{i386} or @option{i8086} appear later in the @@ -1758,17 +1820,18 @@ suffix could be inferred by the operands. For PPC, @option{booke}, @option{booke32} and @option{booke64} select disassembly of BookE instructions. @option{32} and @option{64} select PowerPC and PowerPC64 disassembly, respectively. @option{e300} selects -disassembly for the e300 family. +disassembly for the e300 family. @option{440} selects disassembly for +the PowerPC 440. -For MIPS, this option controls the printing of instruction mneumonic +For MIPS, this option controls the printing of instruction mnemonic names and register names in disassembled instructions. Multiple selections from the following may be specified as a comma separated string, and invalid options are ignored: @table @code @item no-aliases -Print the 'raw' instruction mneumonic instead of some pseudo -instruction mneumonic. I.E. print 'daddu' or 'or' instead of 'move', +Print the 'raw' instruction mnemonic instead of some pseudo +instruction mnemonic. I.e., print 'daddu' or 'or' instead of 'move', 'sll' instead of 'nop', etc. @item gpr-names=@var{ABI} @@ -1811,7 +1874,7 @@ For VAX, you can specify function entry addresses with @option{-M entry:0xf00ba}. You can use this multiple times to properly disassemble VAX binary files that don't contain symbol tables (like ROM dumps). In these cases, the function entry mask would otherwise -be decoded as VAX instructions, which would probably lead the the rest +be decoded as VAX instructions, which would probably lead the rest of the function being wrongly disassembled. @item -p @@ -1963,7 +2026,7 @@ ranlib [@option{-vV}] @var{archive} @command{ranlib} generates an index to the contents of an archive and stores it in the archive. The index lists each symbol defined by a -member of an archive that is a relocatable object file. +member of an archive that is a relocatable object file. You may use @samp{nm -s} or @samp{nm --print-armap} to list this index. @@ -2008,7 +2071,7 @@ size [@option{-A}|@option{-B}|@option{--format=}@var{compatibility}] [@option{--help}] [@option{-d}|@option{-o}|@option{-x}|@option{--radix=}@var{number}] [@option{-t}|@option{--totals}] - [@option{--target=}@var{bfdname}] [@option{-V}|@option{--version}] + [@option{--target=}@var{bfdname}] [@option{-V}|@option{--version}] [@var{objfile}@dots{}] @c man end @end smallexample @@ -2038,13 +2101,13 @@ Using one of these options, you can choose whether the output from @sc{gnu} @command{size} resembles output from System V @command{size} (using @option{-A}, or @option{--format=sysv}), or Berkeley @command{size} (using @option{-B}, or @option{--format=berkeley}). The default is the one-line format similar to -Berkeley's. +Berkeley's. @c Bonus for doc-source readers: you can also say --format=strange (or @c anything else that starts with 's') for sysv, and --format=boring (or @c anything else that starts with 'b') for Berkeley. Here is an example of the Berkeley (default) format of output from -@command{size}: +@command{size}: @smallexample $ size --format=Berkeley ranlib size text data bss dec hex filename @@ -2059,18 +2122,18 @@ This is the same data, but displayed closer to System V conventions: $ size --format=SysV ranlib size ranlib : section size addr -.text 294880 8192 -.data 81920 303104 -.bss 11592 385024 -Total 388392 +.text 294880 8192 +.data 81920 303104 +.bss 11592 385024 +Total 388392 size : section size addr -.text 294880 8192 -.data 81920 303104 -.bss 11888 385024 -Total 388688 +.text 294880 8192 +.data 81920 303104 +.bss 11888 385024 +Total 388688 @end smallexample @item --help @@ -2130,7 +2193,7 @@ strings [@option{-afov}] [@option{-}@var{min-len}] [@option{-t} @var{radix}] [@option{--radix=}@var{radix}] [@option{-e} @var{encoding}] [@option{--encoding=}@var{encoding}] [@option{-}] [@option{--all}] [@option{--print-file-name}] - [@option{--target=}@var{bfdname}] + [@option{-T} @var{bfdname}] [@option{--target=}@var{bfdname}] [@option{--help}] [@option{--version}] @var{file}@dots{} @c man end @end smallexample @@ -2191,7 +2254,8 @@ single-8-bit-byte characters, @samp{b} = 16-bit bigendian, @samp{l} = 16-bit littleendian, @samp{B} = 32-bit bigendian, @samp{L} = 32-bit littleendian. Useful for finding wide character strings. -@item --target=@var{bfdname} +@item -T @var{bfdname} +@itemx --target=@var{bfdname} @cindex object code format Specify an object code format other than your system's default format. @xref{Target Selection}, for more information. @@ -2348,8 +2412,9 @@ When stripping a file, perhaps with @option{--strip-debug} or which would otherwise get stripped. @item --only-keep-debug -Strip a file, removing any sections that would be stripped by -@option{--strip-debug} and leaving the debugging sections. +Strip a file, removing contents of any sections that would not be +stripped by @option{--strip-debug} and leaving the debugging sections +intact. In ELF files, this preserves all note sections in the output. The intention is that this option will be used in conjunction with @option{--add-gnu-debuglink} to create a two part executable. One a @@ -2384,6 +2449,13 @@ ie the file pointed to by the @option{--add-gnu-debuglink} can be the full executable. It does not have to be a file created by the @option{--only-keep-debug} switch. +Note - this switch is only intended for use on fully linked files. It +does not make sense to use it on object files where the debugging +information may be incomplete. Besides the gnu_debuglink feature +currently only supports the presence of one filename containing +debugging information, not multiple filenames on a one-per-object-file +basis. + @item -V @itemx --version Show the version number for @command{strip}. @@ -2432,7 +2504,7 @@ able to distinguish these similarly named functions C++ and Java encode them into a low-level assembler name which uniquely identifies each different version. This process is known as @dfn{mangling}. The @command{c++filt} -@footnote{MS-DOS does not allow @kbd{+} characters in file names, so on +@footnote{MS-DOS does not allow @kbd{+} characters in file names, so on MS-DOS this program is named @command{CXXFILT}.} program does the inverse mapping: it decodes (@dfn{demangles}) low-level names into user-level names so that they can be read. @@ -2457,7 +2529,7 @@ names from the standard input instead. All the results are printed on the standard output. The difference between reading names from the command line versus reading names from the standard input is that command line arguments are expected to be just mangled names and no -checking is performed to seperate them from surrounding text. Thus +checking is performed to separate them from surrounding text. Thus for example: @smallexample @@ -2571,8 +2643,8 @@ the Info entries for @file{binutils}. @quotation @emph{Warning:} @command{c++filt} is a new utility, and the details of its user interface are subject to change in future releases. In particular, -a command-line option may be required in the the future to decode a name -passed as an argument on the command line; in other words, +a command-line option may be required in the future to decode a name +passed as an argument on the command line; in other words, @example c++filt @var{symbol} @@ -2659,8 +2731,8 @@ Specify that the object-code format for the object files is Decode (@dfn{demangle}) low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, this makes C++ function names readable. Different compilers have different -mangling styles. The optional demangling style argument can be used to -choose an appropriate demangling style for your compiler. @xref{c++filt}, +mangling styles. The optional demangling style argument can be used to +choose an appropriate demangling style for your compiler. @xref{c++filt}, for more information on demangling. @item -e @var{filename} @@ -2803,6 +2875,168 @@ the Info entries for @file{binutils}. @c man end @end ignore +@node windmc +@chapter windmc + +@command{windmc} may be used to generator Windows message resources. + +@quotation +@emph{Warning:} @command{windmc} is not always built as part of the binary +utilities, since it is only useful for Windows targets. +@end quotation + +@c man title windmc generates Windows message resources. + +@smallexample +@c man begin SYNOPSIS windres +windmc [options] input-file +@c man end +@end smallexample + +@c man begin DESCRIPTION windmc + +@command{windmc} reads message definitions from an input file (.mc) and +translate them into a set of output files. The output files may be of +four kinds: + +@table @code +@item h +A C header file containing the message definitions. + +@item rc +A resource file compilable by the @command{windres} tool. + +@item bin +One or more binary files containing the resource data for a specific +message language. + +@item dbg +A C include file that maps message id's to their symbolic name. +@end table + +The exact description of these different formats is available in +documentation from Microsoft. + +When @command{windmc} converts from the @code{mc} format to the @code{bin} +format, @code{rc}, @code{h}, and optional @code{dbg} it is acting like the +Windows Message Compiler. + +@c man end + +@c man begin OPTIONS windmc + +@table @env +@item -a +@itemx --ascii_in +Specifies that the input file specified is ANSI. This is the default +behaviour. + +@item -A +@itemx --ascii_out +Specifies that messages in the output @code{bin} files should be in ANSI +format. + +@item -b +@itemx --binprefix +Specifies that @code{bin} filenames should have to be prefixed by the +basename of the source file. + +@item -c +@itemx --customflag +Sets the customer bit in all message id's. + +@item -C @var{codepage} +@itemx --codepage_in @var{codepage} +Sets the default codepage to be used to convert input file to UTF16. The +default is ocdepage 1252. + +@item -d +@itemx --decimal_values +Outputs the constants in the header file in decimal. Default is using +hexadecimal output. + +@item -e @var{ext} +@itemx --extension @var{ext} +The extension for the header file. The default is .h extension. + +@item -F @var{target} +@itemx --target @var{target} +Specify the BFD format to use for a bin file as output. This +is a BFD target name; you can use the @option{--help} option to see a list +of supported targets. Normally @command{windmc} will use the default +format, which is the first one listed by the @option{--help} option. +@ifclear man +@ref{Target Selection}. +@end ifclear + +@item -h @var{path} +@itemx --headerdir @var{path} +The target directory of the generated header file. The default is the +current directory. + +@item -H +@itemx --help +Displays a list of command line options and then exits. + +@item -m @var{characters} +@itemx --maxlength @var{characters} +Instructs @command{windmc} to generate a warning if the length +of any message exceeds the number specified. + +@item -n +@itemx --nullterminate +Terminate message text in @code{bin} files by zero. By default they are +terminated by CR/LF. + +@item -o +@itemx --hresult_use +Not yet implemented. Instructs @code{windmc} to generate an OLE2 header +file, using HRESULT definitions. Status codes are used if the flag is not +specified. + +@item -O @var{codepage} +@itemx --codepage_out @var{codepage} +Sets the default codepage to be used to output text files. The default +is ocdepage 1252. + +@item -r @var{path} +@itemx --rcdir @var{path} +The target directory for the generated @code{rc} script and the generated +@code{bin} files that the resource compiler script includes. The default +is the current directory. + +@item -u +@itemx --unicode_in +Specifies that the input file is UTF16. + +@item -U +@itemx --unicode_out +Specifies that messages in the output @code{bin} file should be in UTF16 +format. This is the default behaviour. + +@item -v +@item --verbose +Enable verbose mode. This tells you what the preprocessor is if you +didn't specify one. + +@item -V +@item --version +Prints the version number for @command{windres}. + +@item -x @var{path} +@itemx --xdgb @var{path} +The path of the @code{dbg} C include file that maps message id's to the +symbolic name. No such file is generated without specifying the switch. +@end table + +@c man end + +@ignore +@c man begin SEEALSO windmc +the Info entries for @file{binutils}. +@c man end +@end ignore + @node windres @chapter windres @@ -2885,7 +3119,7 @@ The name of the output file. If this option is not used, then for the input file name, as the output file name. If there is no non-option argument, then @command{windres} will write to standard output. @command{windres} can not write a COFF file to standard output. Note, -for compatability with @command{rc} the option @option{-fo} is also +for compatibility with @command{rc} the option @option{-fo} is also accepted, but its use is not recommended. @item -J @var{format} @@ -2922,7 +3156,7 @@ Specify an include directory to use when reading an @code{rc} file. @command{windres} will pass this to the preprocessor as an @option{-I} option. @command{windres} will also search this directory when looking for files named in the @code{rc} file. If the argument passed to this command -matches any of the supported @var{formats} (as descrived in the @option{-J} +matches any of the supported @var{formats} (as described in the @option{-J} option), it will issue a deprecation warning, and behave just like the @option{-J} option. New programs should not use this behaviour. If a directory happens to match a @var{format}, simple prefix it with @samp{./} @@ -2945,6 +3179,13 @@ Ignored for compatibility with rc. Enable verbose mode. This tells you what the preprocessor is if you didn't specify one. +@item -c @var{val} +@item --codepage @var{val} +Specify the default codepage to use when reading an @code{rc} file. +@var{val} should be a hexadecimal prefixed by @samp{0x} or decimal +codepage code. The valid range is from zero up to 0xffff, but the +validity of the codepage is host and configuration dependent. + @item -l @var{val} @item --language @var{val} Specify the default language to use when reading an @code{rc} file. @@ -2953,8 +3194,8 @@ the language, and the high eight bits are the sublanguage. @item --use-temp-file Use a temporary file to instead of using popen to read the output of -the preprocessor. Use this option if the popen implementation is buggy -on the host (eg., certain non-English language versions of Windows 95 and +the preprocessor. Use this option if the popen implementation is buggy +on the host (eg., certain non-English language versions of Windows 95 and Windows 98 are known to have buggy popen where the output will instead go the console). @@ -3013,7 +3254,7 @@ dlltool [@option{-d}|@option{--input-def} @var{def-file-name}] [@option{-b}|@option{--base-file} @var{base-file-name}] [@option{-e}|@option{--output-exp} @var{exports-file-name}] [@option{-z}|@option{--output-def} @var{def-file-name}] - [@option{-l}|@option{--output-lib} @var{library-file-name}] + [@option{-l}|@option{--output-lib} @var{library-file-name}] [@option{--export-all-symbols}] [@option{--no-export-all-symbols}] [@option{--exclude-symbols} @var{list}] [@option{--no-default-excludes}] @@ -3025,7 +3266,7 @@ dlltool [@option{-d}|@option{--input-def} @var{def-file-name}] [@option{-p}|@option{--ext-prefix-alias} @var{prefix}] [@option{-x}|@option{--no-idata4}] [@option{-c}|@option{--no-idata5}] [@option{-i}|@option{--interwork}] [@option{-n}|@option{--nodelete}] [@option{-t}|@option{--temp-prefix} @var{prefix}] - [@option{-v}|@option{--verbose}] + [@option{-v}|@option{--verbose}] [@option{-h}|@option{--help}] [@option{-V}|@option{--version}] [object-file @dots{}] @c man end @@ -3038,8 +3279,8 @@ dlltool [@option{-d}|@option{--input-def} @var{def-file-name}] line. It then processes these inputs and if the @option{-e} option has been specified it creates a exports file. If the @option{-l} option has been specified it creates a library file and if the @option{-z} option -has been specified it creates a def file. Any or all of the @option{-e}, -@option{-l} and @option{-z} options can be present in one invocation of +has been specified it creates a def file. Any or all of the @option{-e}, +@option{-l} and @option{-z} options can be present in one invocation of dlltool. When creating a DLL, along with the source for the DLL, it is necessary @@ -3060,7 +3301,7 @@ section of the object file. This can be done in C by using the asm() operator: @smallexample - asm (".section .drectve"); + asm (".section .drectve"); asm (".ascii \"-export:my_func\""); int my_func (void) @{ @dots{} @} @@ -3070,7 +3311,7 @@ The second file needed for DLL creation is an exports file. This file is linked with the object files that make up the body of the DLL and it handles the interface between the DLL and the outside world. This is a binary file and it can be created by giving the @option{-e} option to -@command{dlltool} when it is creating or reading in a @file{.def} file. +@command{dlltool} when it is creating or reading in a @file{.def} file. The third file needed for DLL creation is the library file that programs will link with in order to access the functions in the DLL. This file @@ -3192,12 +3433,12 @@ contents of the DLL are actually encode using Thumb instructions. Specifies that when @command{dlltool} is creating the exports file it should add a section which allows the exported functions to be referenced without using the import library. Whatever the hell that -means! +means! @item -U @itemx --add-underscore Specifies that when @command{dlltool} is creating the exports file it -should prepend an underscore to the names of @emph{all} exported symbols. +should prepend an underscore to the names of @emph{all} exported symbols. @item --add-stdcall-underscore Specifies that when @command{dlltool} is creating the exports file it @@ -3254,7 +3495,7 @@ file. @itemx --temp-prefix @var{prefix} Makes @command{dlltool} use @var{prefix} when constructing the names of temporary assembler and object files. By default, the temp file prefix -is generated from the pid. +is generated from the pid. @item -v @itemx --verbose @@ -3339,7 +3580,7 @@ The Info pages for @file{binutils}. @smallexample @c man begin SYNOPSIS readelf -readelf [@option{-a}|@option{--all}] +readelf [@option{-a}|@option{--all}] [@option{-h}|@option{--file-header}] [@option{-l}|@option{--program-headers}|@option{--segments}] [@option{-S}|@option{--section-headers}|@option{--sections}] @@ -3384,15 +3625,15 @@ affected. The long and short forms of options, shown here as alternatives, are equivalent. At least one option besides @samp{-v} or @samp{-H} must be -given. +given. @table @env @item -a @itemx --all -Equivalent to specifiying @option{--file-header}, +Equivalent to specifying @option{--file-header}, @option{--program-headers}, @option{--sections}, @option{--symbols}, @option{--relocs}, @option{--dynamic}, @option{--notes} and -@option{--version-info}. +@option{--version-info}. @item -h @itemx --file-header @@ -3564,8 +3805,8 @@ once because some of them can only be configured @dfn{native} (on hosts with the same type as the target system). @menu -* Target Selection:: -* Architecture Selection:: +* Target Selection:: +* Architecture Selection:: @end menu @node Target Selection @@ -3746,8 +3987,10 @@ You can find contact information for many support companies and individuals in the file @file{etc/SERVICE} in the @sc{gnu} Emacs distribution. +@ifset BUGURL In any event, we also recommend that you send bug reports for the binary -utilities to @samp{bug-binutils@@gnu.org}. +utilities to @value{BUGURL}. +@end ifset The fundamental principle of reporting bugs usefully is this: @strong{report all the facts}. If you are not sure whether to state a @@ -3806,11 +4049,7 @@ and then we might not encounter the bug. @item A complete input file, or set of input files, that will reproduce the bug. If the utility is reading an object file or files, then it is -generally most helpful to send the actual object files, uuencoded if -necessary to get them through the mail system. Note that -@samp{bug-binutils@@gnu.org} is a mailing list, so you should avoid -sending very large files to it. Making the files available for -anonymous FTP is OK. +generally most helpful to send the actual object files. If the source files were produced exclusively using @sc{gnu} programs (e.g., @command{gcc}, @command{gas}, and/or the @sc{gnu} @command{ld}), then it @@ -3830,7 +4069,7 @@ a chance to make a mistake. Even if the problem you experience is a fatal signal, you should still say so explicitly. Suppose something strange is going on, such as your -copy of the utility is out of synch, or you have encountered a bug in +copy of the utility is out of sync, or you have encountered a bug in the C library on your system. (This has happened!) Your copy might crash and ours would not. If you told us to expect a crash, then when ours fails to crash, we would know that the bug was not happening for @@ -3898,10 +4137,9 @@ things without first using the debugger to find the facts. @include fdl.texi -@node Index -@unnumbered Index +@node Binutils Index +@unnumbered Binutils Index @printindex cp -@contents @bye diff --git a/binutils/doc/config.texi b/binutils/doc/config.texi deleted file mode 100644 index c49c43a461b..00000000000 --- a/binutils/doc/config.texi +++ /dev/null @@ -1,2 +0,0 @@ -@set VERSION 2.17 -@set UPDATED June 2006 diff --git a/binutils/doc/cxxfilt.man b/binutils/doc/cxxfilt.man deleted file mode 100644 index 08e77f18ed9..00000000000 --- a/binutils/doc/cxxfilt.man +++ /dev/null @@ -1,345 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "C++FILT 1" -.TH C++FILT 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -cxxfilt \- Demangle C++ and Java symbols. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -c++filt [\fB\-_\fR|\fB\-\-strip\-underscores\fR] - [\fB\-n\fR|\fB\-\-no\-strip\-underscores\fR] - [\fB\-p\fR|\fB\-\-no\-params\fR] - [\fB\-t\fR|\fB\-\-types\fR] - [\fB\-i\fR|\fB\-\-no\-verbose\fR] - [\fB\-s\fR \fIformat\fR|\fB\-\-format=\fR\fIformat\fR] - [\fB\-\-help\fR] [\fB\-\-version\fR] [\fIsymbol\fR...] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -The \*(C+ and Java languages provide function overloading, which means -that you can write many functions with the same name, providing that -each function takes parameters of different types. In order to be -able to distinguish these similarly named functions \*(C+ and Java -encode them into a low-level assembler name which uniquely identifies -each different version. This process is known as \fImangling\fR. The -\&\fBc++filt\fR -[1] -program does the inverse mapping: it decodes (\fIdemangles\fR) low-level -names into user-level names so that they can be read. -.PP -Every alphanumeric word (consisting of letters, digits, underscores, -dollars, or periods) seen in the input is a potential mangled name. -If the name decodes into a \*(C+ name, the \*(C+ name replaces the -low-level name in the output, otherwise the original word is output. -In this way you can pass an entire assembler source file, containing -mangled names, through \fBc++filt\fR and see the same source file -containing demangled names. -.PP -You can also use \fBc++filt\fR to decipher individual symbols by -passing them on the command line: -.PP -.Vb 1 -\& c++filt -.Ve -.PP -If no \fIsymbol\fR arguments are given, \fBc++filt\fR reads symbol -names from the standard input instead. All the results are printed on -the standard output. The difference between reading names from the -command line versus reading names from the standard input is that -command line arguments are expected to be just mangled names and no -checking is performed to seperate them from surrounding text. Thus -for example: -.PP -.Vb 1 -\& c++filt \-n _Z1fv -.Ve -.PP -will work and demangle the name to \*(L"f()\*(R" whereas: -.PP -.Vb 1 -\& c++filt \-n _Z1fv, -.Ve -.PP -will not work. (Note the extra comma at the end of the mangled -name which makes it invalid). This command however will work: -.PP -.Vb 1 -\& echo _Z1fv, | c++filt \-n -.Ve -.PP -and will display \*(L"f(),\*(R" ie the demangled name followed by a -trailing comma. This behaviour is because when the names are read -from the standard input it is expected that they might be part of an -assembler source file where there might be extra, extraneous -characters trailing after a mangled name. eg: -.PP -.Vb 1 -\& .type _Z1fv, @function -.Ve -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fB\-_\fR" 4 -.IX Item "-_" -.PD 0 -.IP "\fB\-\-strip\-underscores\fR" 4 -.IX Item "--strip-underscores" -.PD -On some systems, both the C and \*(C+ compilers put an underscore in front -of every name. For example, the C name \f(CW\*(C`foo\*(C'\fR gets the low-level -name \f(CW\*(C`_foo\*(C'\fR. This option removes the initial underscore. Whether -\&\fBc++filt\fR removes the underscore by default is target dependent. -.IP "\fB\-j\fR" 4 -.IX Item "-j" -.PD 0 -.IP "\fB\-\-java\fR" 4 -.IX Item "--java" -.PD -Prints demangled names using Java syntax. The default is to use \*(C+ -syntax. -.IP "\fB\-n\fR" 4 -.IX Item "-n" -.PD 0 -.IP "\fB\-\-no\-strip\-underscores\fR" 4 -.IX Item "--no-strip-underscores" -.PD -Do not remove the initial underscore. -.IP "\fB\-p\fR" 4 -.IX Item "-p" -.PD 0 -.IP "\fB\-\-no\-params\fR" 4 -.IX Item "--no-params" -.PD -When demangling the name of a function, do not display the types of -the function's parameters. -.IP "\fB\-t\fR" 4 -.IX Item "-t" -.PD 0 -.IP "\fB\-\-types\fR" 4 -.IX Item "--types" -.PD -Attempt to demangle types as well as function names. This is disabled -by default since mangled types are normally only used internally in -the compiler, and they can be confused with non-mangled names. eg -a function called \*(L"a\*(R" treated as a mangled type name would be -demangled to \*(L"signed char\*(R". -.IP "\fB\-i\fR" 4 -.IX Item "-i" -.PD 0 -.IP "\fB\-\-no\-verbose\fR" 4 -.IX Item "--no-verbose" -.PD -Do not include implementation details (if any) in the demangled -output. -.IP "\fB\-s\fR \fIformat\fR" 4 -.IX Item "-s format" -.PD 0 -.IP "\fB\-\-format=\fR\fIformat\fR" 4 -.IX Item "--format=format" -.PD -\&\fBc++filt\fR can decode various methods of mangling, used by -different compilers. The argument to this option selects which -method it uses: -.RS 4 -.ie n .IP """auto""" 4 -.el .IP "\f(CWauto\fR" 4 -.IX Item "auto" -Automatic selection based on executable (the default method) -.ie n .IP """gnu""" 4 -.el .IP "\f(CWgnu\fR" 4 -.IX Item "gnu" -the one used by the \s-1GNU\s0 \*(C+ compiler (g++) -.ie n .IP """lucid""" 4 -.el .IP "\f(CWlucid\fR" 4 -.IX Item "lucid" -the one used by the Lucid compiler (lcc) -.ie n .IP """arm""" 4 -.el .IP "\f(CWarm\fR" 4 -.IX Item "arm" -the one specified by the \*(C+ Annotated Reference Manual -.ie n .IP """hp""" 4 -.el .IP "\f(CWhp\fR" 4 -.IX Item "hp" -the one used by the \s-1HP\s0 compiler (aCC) -.ie n .IP """edg""" 4 -.el .IP "\f(CWedg\fR" 4 -.IX Item "edg" -the one used by the \s-1EDG\s0 compiler -.ie n .IP """gnu\-v3""" 4 -.el .IP "\f(CWgnu\-v3\fR" 4 -.IX Item "gnu-v3" -the one used by the \s-1GNU\s0 \*(C+ compiler (g++) with the V3 \s-1ABI\s0. -.ie n .IP """java""" 4 -.el .IP "\f(CWjava\fR" 4 -.IX Item "java" -the one used by the \s-1GNU\s0 Java compiler (gcj) -.ie n .IP """gnat""" 4 -.el .IP "\f(CWgnat\fR" 4 -.IX Item "gnat" -the one used by the \s-1GNU\s0 Ada compiler (\s-1GNAT\s0). -.RE -.RS 4 -.RE -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Print a summary of the options to \fBc++filt\fR and exit. -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -Print the version number of \fBc++filt\fR and exit. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "FOOTNOTES" -.IX Header "FOOTNOTES" -.IP "1." 4 -MS-DOS does not allow \f(CW\*(C`+\*(C'\fR characters in file names, so on -MS-DOS this program is named \fB\s-1CXXFILT\s0\fR. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/dlltool.1 b/binutils/doc/dlltool.1 deleted file mode 100644 index 44c5a4e01dd..00000000000 --- a/binutils/doc/dlltool.1 +++ /dev/null @@ -1,478 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "DLLTOOL 1" -.TH DLLTOOL 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -dlltool \- Create files needed to build and use DLLs. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -dlltool [\fB\-d\fR|\fB\-\-input\-def\fR \fIdef-file-name\fR] - [\fB\-b\fR|\fB\-\-base\-file\fR \fIbase-file-name\fR] - [\fB\-e\fR|\fB\-\-output\-exp\fR \fIexports-file-name\fR] - [\fB\-z\fR|\fB\-\-output\-def\fR \fIdef-file-name\fR] - [\fB\-l\fR|\fB\-\-output\-lib\fR \fIlibrary-file-name\fR] - [\fB\-\-export\-all\-symbols\fR] [\fB\-\-no\-export\-all\-symbols\fR] - [\fB\-\-exclude\-symbols\fR \fIlist\fR] - [\fB\-\-no\-default\-excludes\fR] - [\fB\-S\fR|\fB\-\-as\fR \fIpath-to-assembler\fR] [\fB\-f\fR|\fB\-\-as\-flags\fR \fIoptions\fR] - [\fB\-D\fR|\fB\-\-dllname\fR \fIname\fR] [\fB\-m\fR|\fB\-\-machine\fR \fImachine\fR] - [\fB\-a\fR|\fB\-\-add\-indirect\fR] - [\fB\-U\fR|\fB\-\-add\-underscore\fR] [\fB\-\-add\-stdcall\-underscore\fR] - [\fB\-k\fR|\fB\-\-kill\-at\fR] [\fB\-A\fR|\fB\-\-add\-stdcall\-alias\fR] - [\fB\-p\fR|\fB\-\-ext\-prefix\-alias\fR \fIprefix\fR] - [\fB\-x\fR|\fB\-\-no\-idata4\fR] [\fB\-c\fR|\fB\-\-no\-idata5\fR] [\fB\-i\fR|\fB\-\-interwork\fR] - [\fB\-n\fR|\fB\-\-nodelete\fR] [\fB\-t\fR|\fB\-\-temp\-prefix\fR \fIprefix\fR] - [\fB\-v\fR|\fB\-\-verbose\fR] - [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] - [object\-file ...] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBdlltool\fR reads its inputs, which can come from the \fB\-d\fR and -\&\fB\-b\fR options as well as object files specified on the command -line. It then processes these inputs and if the \fB\-e\fR option has -been specified it creates a exports file. If the \fB\-l\fR option -has been specified it creates a library file and if the \fB\-z\fR option -has been specified it creates a def file. Any or all of the \fB\-e\fR, -\&\fB\-l\fR and \fB\-z\fR options can be present in one invocation of -dlltool. -.PP -When creating a \s-1DLL\s0, along with the source for the \s-1DLL\s0, it is necessary -to have three other files. \fBdlltool\fR can help with the creation of -these files. -.PP -The first file is a \fI.def\fR file which specifies which functions are -exported from the \s-1DLL\s0, which functions the \s-1DLL\s0 imports, and so on. This -is a text file and can be created by hand, or \fBdlltool\fR can be used -to create it using the \fB\-z\fR option. In this case \fBdlltool\fR -will scan the object files specified on its command line looking for -those functions which have been specially marked as being exported and -put entries for them in the \fI.def\fR file it creates. -.PP -In order to mark a function as being exported from a \s-1DLL\s0, it needs to -have an \fB\-export:\fR entry in the \fB.drectve\fR -section of the object file. This can be done in C by using the -\&\fIasm()\fR operator: -.PP -.Vb 2 -\& asm (".section .drectve"); -\& asm (".ascii \e"\-export:my_func\e""); -.Ve -.PP -.Vb 1 -\& int my_func (void) { ... } -.Ve -.PP -The second file needed for \s-1DLL\s0 creation is an exports file. This file -is linked with the object files that make up the body of the \s-1DLL\s0 and it -handles the interface between the \s-1DLL\s0 and the outside world. This is a -binary file and it can be created by giving the \fB\-e\fR option to -\&\fBdlltool\fR when it is creating or reading in a \fI.def\fR file. -.PP -The third file needed for \s-1DLL\s0 creation is the library file that programs -will link with in order to access the functions in the \s-1DLL\s0. This file -can be created by giving the \fB\-l\fR option to dlltool when it -is creating or reading in a \fI.def\fR file. -.PP -\&\fBdlltool\fR builds the library file by hand, but it builds the -exports file by creating temporary files containing assembler statements -and then assembling these. The \fB\-S\fR command line option can be -used to specify the path to the assembler that dlltool will use, -and the \fB\-f\fR option can be used to pass specific flags to that -assembler. The \fB\-n\fR can be used to prevent dlltool from deleting -these temporary assembler files when it is done, and if \fB\-n\fR is -specified twice then this will prevent dlltool from deleting the -temporary object files it used to build the library. -.PP -Here is an example of creating a \s-1DLL\s0 from a source file \fBdll.c\fR and -also creating a program (from an object file called \fBprogram.o\fR) -that uses that \s-1DLL:\s0 -.PP -.Vb 4 -\& gcc \-c dll.c -\& dlltool \-e exports.o \-l dll.lib dll.o -\& gcc dll.o exports.o \-o dll.dll -\& gcc program.o dll.lib \-o program -.Ve -.SH "OPTIONS" -.IX Header "OPTIONS" -The command line options have the following meanings: -.IP "\fB\-d\fR \fIfilename\fR" 4 -.IX Item "-d filename" -.PD 0 -.IP "\fB\-\-input\-def\fR \fIfilename\fR" 4 -.IX Item "--input-def filename" -.PD -Specifies the name of a \fI.def\fR file to be read in and processed. -.IP "\fB\-b\fR \fIfilename\fR" 4 -.IX Item "-b filename" -.PD 0 -.IP "\fB\-\-base\-file\fR \fIfilename\fR" 4 -.IX Item "--base-file filename" -.PD -Specifies the name of a base file to be read in and processed. The -contents of this file will be added to the relocation section in the -exports file generated by dlltool. -.IP "\fB\-e\fR \fIfilename\fR" 4 -.IX Item "-e filename" -.PD 0 -.IP "\fB\-\-output\-exp\fR \fIfilename\fR" 4 -.IX Item "--output-exp filename" -.PD -Specifies the name of the export file to be created by dlltool. -.IP "\fB\-z\fR \fIfilename\fR" 4 -.IX Item "-z filename" -.PD 0 -.IP "\fB\-\-output\-def\fR \fIfilename\fR" 4 -.IX Item "--output-def filename" -.PD -Specifies the name of the \fI.def\fR file to be created by dlltool. -.IP "\fB\-l\fR \fIfilename\fR" 4 -.IX Item "-l filename" -.PD 0 -.IP "\fB\-\-output\-lib\fR \fIfilename\fR" 4 -.IX Item "--output-lib filename" -.PD -Specifies the name of the library file to be created by dlltool. -.IP "\fB\-\-export\-all\-symbols\fR" 4 -.IX Item "--export-all-symbols" -Treat all global and weak defined symbols found in the input object -files as symbols to be exported. There is a small list of symbols which -are not exported by default; see the \fB\-\-no\-default\-excludes\fR -option. You may add to the list of symbols to not export by using the -\&\fB\-\-exclude\-symbols\fR option. -.IP "\fB\-\-no\-export\-all\-symbols\fR" 4 -.IX Item "--no-export-all-symbols" -Only export symbols explicitly listed in an input \fI.def\fR file or in -\&\fB.drectve\fR sections in the input object files. This is the default -behaviour. The \fB.drectve\fR sections are created by \fBdllexport\fR -attributes in the source code. -.IP "\fB\-\-exclude\-symbols\fR \fIlist\fR" 4 -.IX Item "--exclude-symbols list" -Do not export the symbols in \fIlist\fR. This is a list of symbol names -separated by comma or colon characters. The symbol names should not -contain a leading underscore. This is only meaningful when -\&\fB\-\-export\-all\-symbols\fR is used. -.IP "\fB\-\-no\-default\-excludes\fR" 4 -.IX Item "--no-default-excludes" -When \fB\-\-export\-all\-symbols\fR is used, it will by default avoid -exporting certain special symbols. The current list of symbols to avoid -exporting is \fBDllMain@12\fR, \fBDllEntryPoint@0\fR, -\&\fBimpure_ptr\fR. You may use the \fB\-\-no\-default\-excludes\fR option -to go ahead and export these special symbols. This is only meaningful -when \fB\-\-export\-all\-symbols\fR is used. -.IP "\fB\-S\fR \fIpath\fR" 4 -.IX Item "-S path" -.PD 0 -.IP "\fB\-\-as\fR \fIpath\fR" 4 -.IX Item "--as path" -.PD -Specifies the path, including the filename, of the assembler to be used -to create the exports file. -.IP "\fB\-f\fR \fIoptions\fR" 4 -.IX Item "-f options" -.PD 0 -.IP "\fB\-\-as\-flags\fR \fIoptions\fR" 4 -.IX Item "--as-flags options" -.PD -Specifies any specific command line options to be passed to the -assembler when building the exports file. This option will work even if -the \fB\-S\fR option is not used. This option only takes one argument, -and if it occurs more than once on the command line, then later -occurrences will override earlier occurrences. So if it is necessary to -pass multiple options to the assembler they should be enclosed in -double quotes. -.IP "\fB\-D\fR \fIname\fR" 4 -.IX Item "-D name" -.PD 0 -.IP "\fB\-\-dll\-name\fR \fIname\fR" 4 -.IX Item "--dll-name name" -.PD -Specifies the name to be stored in the \fI.def\fR file as the name of -the \s-1DLL\s0 when the \fB\-e\fR option is used. If this option is not -present, then the filename given to the \fB\-e\fR option will be -used as the name of the \s-1DLL\s0. -.IP "\fB\-m\fR \fImachine\fR" 4 -.IX Item "-m machine" -.PD 0 -.IP "\fB\-machine\fR \fImachine\fR" 4 -.IX Item "-machine machine" -.PD -Specifies the type of machine for which the library file should be -built. \fBdlltool\fR has a built in default type, depending upon how -it was created, but this option can be used to override that. This is -normally only useful when creating DLLs for an \s-1ARM\s0 processor, when the -contents of the \s-1DLL\s0 are actually encode using Thumb instructions. -.IP "\fB\-a\fR" 4 -.IX Item "-a" -.PD 0 -.IP "\fB\-\-add\-indirect\fR" 4 -.IX Item "--add-indirect" -.PD -Specifies that when \fBdlltool\fR is creating the exports file it -should add a section which allows the exported functions to be -referenced without using the import library. Whatever the hell that -means! -.IP "\fB\-U\fR" 4 -.IX Item "-U" -.PD 0 -.IP "\fB\-\-add\-underscore\fR" 4 -.IX Item "--add-underscore" -.PD -Specifies that when \fBdlltool\fR is creating the exports file it -should prepend an underscore to the names of \fIall\fR exported symbols. -.IP "\fB\-\-add\-stdcall\-underscore\fR" 4 -.IX Item "--add-stdcall-underscore" -Specifies that when \fBdlltool\fR is creating the exports file it -should prepend an underscore to the names of exported \fIstdcall\fR -functions. Variable names and non-stdcall function names are not modified. -This option is useful when creating GNU-compatible import libs for third -party DLLs that were built with MS-Windows tools. -.IP "\fB\-k\fR" 4 -.IX Item "-k" -.PD 0 -.IP "\fB\-\-kill\-at\fR" 4 -.IX Item "--kill-at" -.PD -Specifies that when \fBdlltool\fR is creating the exports file it -should not append the string \fB@ \fR. These numbers are -called ordinal numbers and they represent another way of accessing the -function in a \s-1DLL\s0, other than by name. -.IP "\fB\-A\fR" 4 -.IX Item "-A" -.PD 0 -.IP "\fB\-\-add\-stdcall\-alias\fR" 4 -.IX Item "--add-stdcall-alias" -.PD -Specifies that when \fBdlltool\fR is creating the exports file it -should add aliases for stdcall symbols without \fB@ \fR -in addition to the symbols with \fB@ \fR. -.IP "\fB\-p\fR" 4 -.IX Item "-p" -.PD 0 -.IP "\fB\-\-ext\-prefix\-alias\fR \fIprefix\fR" 4 -.IX Item "--ext-prefix-alias prefix" -.PD -Causes \fBdlltool\fR to create external aliases for all \s-1DLL\s0 -imports with the specified prefix. The aliases are created for both -external and import symbols with no leading underscore. -.IP "\fB\-x\fR" 4 -.IX Item "-x" -.PD 0 -.IP "\fB\-\-no\-idata4\fR" 4 -.IX Item "--no-idata4" -.PD -Specifies that when \fBdlltool\fR is creating the exports and library -files it should omit the \f(CW\*(C`.idata4\*(C'\fR section. This is for compatibility -with certain operating systems. -.IP "\fB\-c\fR" 4 -.IX Item "-c" -.PD 0 -.IP "\fB\-\-no\-idata5\fR" 4 -.IX Item "--no-idata5" -.PD -Specifies that when \fBdlltool\fR is creating the exports and library -files it should omit the \f(CW\*(C`.idata5\*(C'\fR section. This is for compatibility -with certain operating systems. -.IP "\fB\-i\fR" 4 -.IX Item "-i" -.PD 0 -.IP "\fB\-\-interwork\fR" 4 -.IX Item "--interwork" -.PD -Specifies that \fBdlltool\fR should mark the objects in the library -file and exports file that it produces as supporting interworking -between \s-1ARM\s0 and Thumb code. -.IP "\fB\-n\fR" 4 -.IX Item "-n" -.PD 0 -.IP "\fB\-\-nodelete\fR" 4 -.IX Item "--nodelete" -.PD -Makes \fBdlltool\fR preserve the temporary assembler files it used to -create the exports file. If this option is repeated then dlltool will -also preserve the temporary object files it uses to create the library -file. -.IP "\fB\-t\fR \fIprefix\fR" 4 -.IX Item "-t prefix" -.PD 0 -.IP "\fB\-\-temp\-prefix\fR \fIprefix\fR" 4 -.IX Item "--temp-prefix prefix" -.PD -Makes \fBdlltool\fR use \fIprefix\fR when constructing the names of -temporary assembler and object files. By default, the temp file prefix -is generated from the pid. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-\-verbose\fR" 4 -.IX Item "--verbose" -.PD -Make dlltool describe what it is doing. -.IP "\fB\-h\fR" 4 -.IX Item "-h" -.PD 0 -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -.PD -Displays a list of command line options and then exits. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Displays dlltool's version number and then exits. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -The Info pages for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/nlmconv.1 b/binutils/doc/nlmconv.1 deleted file mode 100644 index d8f4d14cae2..00000000000 --- a/binutils/doc/nlmconv.1 +++ /dev/null @@ -1,243 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "NLMCONV 1" -.TH NLMCONV 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -nlmconv \- converts object code into an NLM. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -nlmconv [\fB\-I\fR \fIbfdname\fR|\fB\-\-input\-target=\fR\fIbfdname\fR] - [\fB\-O\fR \fIbfdname\fR|\fB\-\-output\-target=\fR\fIbfdname\fR] - [\fB\-T\fR \fIheaderfile\fR|\fB\-\-header\-file=\fR\fIheaderfile\fR] - [\fB\-d\fR|\fB\-\-debug\fR] [\fB\-l\fR \fIlinker\fR|\fB\-\-linker=\fR\fIlinker\fR] - [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] - \fIinfile\fR \fIoutfile\fR -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBnlmconv\fR converts the relocatable \fBi386\fR object file -\&\fIinfile\fR into the NetWare Loadable Module \fIoutfile\fR, optionally -reading \fIheaderfile\fR for \s-1NLM\s0 header information. For instructions -on writing the \s-1NLM\s0 command file language used in header files, see the -\&\fBlinkers\fR section, \fB\s-1NLMLINK\s0\fR in particular, of the \fI\s-1NLM\s0 -Development and Tools Overview\fR, which is part of the \s-1NLM\s0 Software -Developer's Kit (\*(L"\s-1NLM\s0 \s-1SDK\s0\*(R"), available from Novell, Inc. -\&\fBnlmconv\fR uses the \s-1GNU\s0 Binary File Descriptor library to read -\&\fIinfile\fR; -.PP -\&\fBnlmconv\fR can perform a link step. In other words, you can list -more than one object file for input if you list them in the definitions -file (rather than simply specifying one input file on the command line). -In this case, \fBnlmconv\fR calls the linker for you. -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fB\-I\fR \fIbfdname\fR" 4 -.IX Item "-I bfdname" -.PD 0 -.IP "\fB\-\-input\-target=\fR\fIbfdname\fR" 4 -.IX Item "--input-target=bfdname" -.PD -Object format of the input file. \fBnlmconv\fR can usually determine -the format of a given file (so no default is necessary). -.IP "\fB\-O\fR \fIbfdname\fR" 4 -.IX Item "-O bfdname" -.PD 0 -.IP "\fB\-\-output\-target=\fR\fIbfdname\fR" 4 -.IX Item "--output-target=bfdname" -.PD -Object format of the output file. \fBnlmconv\fR infers the output -format based on the input format, e.g. for a \fBi386\fR input file the -output format is \fBnlm32\-i386\fR. -.IP "\fB\-T\fR \fIheaderfile\fR" 4 -.IX Item "-T headerfile" -.PD 0 -.IP "\fB\-\-header\-file=\fR\fIheaderfile\fR" 4 -.IX Item "--header-file=headerfile" -.PD -Reads \fIheaderfile\fR for \s-1NLM\s0 header information. For instructions on -writing the \s-1NLM\s0 command file language used in header files, see see the -\&\fBlinkers\fR section, of the \fI\s-1NLM\s0 Development and Tools -Overview\fR, which is part of the \s-1NLM\s0 Software Developer's Kit, available -from Novell, Inc. -.IP "\fB\-d\fR" 4 -.IX Item "-d" -.PD 0 -.IP "\fB\-\-debug\fR" 4 -.IX Item "--debug" -.PD -Displays (on standard error) the linker command line used by \fBnlmconv\fR. -.IP "\fB\-l\fR \fIlinker\fR" 4 -.IX Item "-l linker" -.PD 0 -.IP "\fB\-\-linker=\fR\fIlinker\fR" 4 -.IX Item "--linker=linker" -.PD -Use \fIlinker\fR for any linking. \fIlinker\fR can be an absolute or a -relative pathname. -.IP "\fB\-h\fR" 4 -.IX Item "-h" -.PD 0 -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -.PD -Prints a usage summary. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Prints the version number for \fBnlmconv\fR. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/nm.1 b/binutils/doc/nm.1 deleted file mode 100644 index 9f2271c7cbd..00000000000 --- a/binutils/doc/nm.1 +++ /dev/null @@ -1,449 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "NM 1" -.TH NM 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -nm \- list symbols from object files -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -nm [\fB\-a\fR|\fB\-\-debug\-syms\fR] [\fB\-g\fR|\fB\-\-extern\-only\fR] - [\fB\-B\fR] [\fB\-C\fR|\fB\-\-demangle\fR[=\fIstyle\fR]] [\fB\-D\fR|\fB\-\-dynamic\fR] - [\fB\-S\fR|\fB\-\-print\-size\fR] [\fB\-s\fR|\fB\-\-print\-armap\fR] - [\fB\-A\fR|\fB\-o\fR|\fB\-\-print\-file\-name\fR][\fB\-\-special\-syms\fR] - [\fB\-n\fR|\fB\-v\fR|\fB\-\-numeric\-sort\fR] [\fB\-p\fR|\fB\-\-no\-sort\fR] - [\fB\-r\fR|\fB\-\-reverse\-sort\fR] [\fB\-\-size\-sort\fR] [\fB\-u\fR|\fB\-\-undefined\-only\fR] - [\fB\-t\fR \fIradix\fR|\fB\-\-radix=\fR\fIradix\fR] [\fB\-P\fR|\fB\-\-portability\fR] - [\fB\-\-target=\fR\fIbfdname\fR] [\fB\-f\fR\fIformat\fR|\fB\-\-format=\fR\fIformat\fR] - [\fB\-\-defined\-only\fR] [\fB\-l\fR|\fB\-\-line\-numbers\fR] [\fB\-\-no\-demangle\fR] - [\fB\-V\fR|\fB\-\-version\fR] [\fB\-X 32_64\fR] [\fB\-\-help\fR] [\fIobjfile\fR...] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\s-1GNU\s0 \fBnm\fR lists the symbols from object files \fIobjfile\fR.... -If no object files are listed as arguments, \fBnm\fR assumes the file -\&\fIa.out\fR. -.PP -For each symbol, \fBnm\fR shows: -.IP "\(bu" 4 -The symbol value, in the radix selected by options (see below), or -hexadecimal by default. -.IP "\(bu" 4 -The symbol type. At least the following types are used; others are, as -well, depending on the object file format. If lowercase, the symbol is -local; if uppercase, the symbol is global (external). -.RS 4 -.ie n .IP """A""" 4 -.el .IP "\f(CWA\fR" 4 -.IX Item "A" -The symbol's value is absolute, and will not be changed by further -linking. -.ie n .IP """B""" 4 -.el .IP "\f(CWB\fR" 4 -.IX Item "B" -The symbol is in the uninitialized data section (known as \s-1BSS\s0). -.ie n .IP """C""" 4 -.el .IP "\f(CWC\fR" 4 -.IX Item "C" -The symbol is common. Common symbols are uninitialized data. When -linking, multiple common symbols may appear with the same name. If the -symbol is defined anywhere, the common symbols are treated as undefined -references. -.ie n .IP """D""" 4 -.el .IP "\f(CWD\fR" 4 -.IX Item "D" -The symbol is in the initialized data section. -.ie n .IP """G""" 4 -.el .IP "\f(CWG\fR" 4 -.IX Item "G" -The symbol is in an initialized data section for small objects. Some -object file formats permit more efficient access to small data objects, -such as a global int variable as opposed to a large global array. -.ie n .IP """I""" 4 -.el .IP "\f(CWI\fR" 4 -.IX Item "I" -The symbol is an indirect reference to another symbol. This is a \s-1GNU\s0 -extension to the a.out object file format which is rarely used. -.ie n .IP """N""" 4 -.el .IP "\f(CWN\fR" 4 -.IX Item "N" -The symbol is a debugging symbol. -.ie n .IP """R""" 4 -.el .IP "\f(CWR\fR" 4 -.IX Item "R" -The symbol is in a read only data section. -.ie n .IP """S""" 4 -.el .IP "\f(CWS\fR" 4 -.IX Item "S" -The symbol is in an uninitialized data section for small objects. -.ie n .IP """T""" 4 -.el .IP "\f(CWT\fR" 4 -.IX Item "T" -The symbol is in the text (code) section. -.ie n .IP """U""" 4 -.el .IP "\f(CWU\fR" 4 -.IX Item "U" -The symbol is undefined. -.ie n .IP """V""" 4 -.el .IP "\f(CWV\fR" 4 -.IX Item "V" -The symbol is a weak object. When a weak defined symbol is linked with -a normal defined symbol, the normal defined symbol is used with no error. -When a weak undefined symbol is linked and the symbol is not defined, -the value of the weak symbol becomes zero with no error. -.ie n .IP """W""" 4 -.el .IP "\f(CWW\fR" 4 -.IX Item "W" -The symbol is a weak symbol that has not been specifically tagged as a -weak object symbol. When a weak defined symbol is linked with a normal -defined symbol, the normal defined symbol is used with no error. -When a weak undefined symbol is linked and the symbol is not defined, -the value of the symbol is determined in a system-specific manner without -error. On some systems, uppercase indicates that a default value has been -specified. -.ie n .IP """\-""" 4 -.el .IP "\f(CW\-\fR" 4 -.IX Item "-" -The symbol is a stabs symbol in an a.out object file. In this case, the -next values printed are the stabs other field, the stabs desc field, and -the stab type. Stabs symbols are used to hold debugging information. -.ie n .IP """?""" 4 -.el .IP "\f(CW?\fR" 4 -.IX Item "?" -The symbol type is unknown, or object file format specific. -.RE -.RS 4 -.RE -.IP "\(bu" 4 -The symbol name. -.SH "OPTIONS" -.IX Header "OPTIONS" -The long and short forms of options, shown here as alternatives, are -equivalent. -.IP "\fB\-A\fR" 4 -.IX Item "-A" -.PD 0 -.IP "\fB\-o\fR" 4 -.IX Item "-o" -.IP "\fB\-\-print\-file\-name\fR" 4 -.IX Item "--print-file-name" -.PD -Precede each symbol by the name of the input file (or archive member) -in which it was found, rather than identifying the input file once only, -before all of its symbols. -.IP "\fB\-a\fR" 4 -.IX Item "-a" -.PD 0 -.IP "\fB\-\-debug\-syms\fR" 4 -.IX Item "--debug-syms" -.PD -Display all symbols, even debugger-only symbols; normally these are not -listed. -.IP "\fB\-B\fR" 4 -.IX Item "-B" -The same as \fB\-\-format=bsd\fR (for compatibility with the \s-1MIPS\s0 \fBnm\fR). -.IP "\fB\-C\fR" 4 -.IX Item "-C" -.PD 0 -.IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4 -.IX Item "--demangle[=style]" -.PD -Decode (\fIdemangle\fR) low-level symbol names into user-level names. -Besides removing any initial underscore prepended by the system, this -makes \*(C+ function names readable. Different compilers have different -mangling styles. The optional demangling style argument can be used to -choose an appropriate demangling style for your compiler. -.IP "\fB\-\-no\-demangle\fR" 4 -.IX Item "--no-demangle" -Do not demangle low-level symbol names. This is the default. -.IP "\fB\-D\fR" 4 -.IX Item "-D" -.PD 0 -.IP "\fB\-\-dynamic\fR" 4 -.IX Item "--dynamic" -.PD -Display the dynamic symbols rather than the normal symbols. This is -only meaningful for dynamic objects, such as certain types of shared -libraries. -.IP "\fB\-f\fR \fIformat\fR" 4 -.IX Item "-f format" -.PD 0 -.IP "\fB\-\-format=\fR\fIformat\fR" 4 -.IX Item "--format=format" -.PD -Use the output format \fIformat\fR, which can be \f(CW\*(C`bsd\*(C'\fR, -\&\f(CW\*(C`sysv\*(C'\fR, or \f(CW\*(C`posix\*(C'\fR. The default is \f(CW\*(C`bsd\*(C'\fR. -Only the first character of \fIformat\fR is significant; it can be -either upper or lower case. -.IP "\fB\-g\fR" 4 -.IX Item "-g" -.PD 0 -.IP "\fB\-\-extern\-only\fR" 4 -.IX Item "--extern-only" -.PD -Display only external symbols. -.IP "\fB\-l\fR" 4 -.IX Item "-l" -.PD 0 -.IP "\fB\-\-line\-numbers\fR" 4 -.IX Item "--line-numbers" -.PD -For each symbol, use debugging information to try to find a filename and -line number. For a defined symbol, look for the line number of the -address of the symbol. For an undefined symbol, look for the line -number of a relocation entry which refers to the symbol. If line number -information can be found, print it after the other symbol information. -.IP "\fB\-n\fR" 4 -.IX Item "-n" -.PD 0 -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.IP "\fB\-\-numeric\-sort\fR" 4 -.IX Item "--numeric-sort" -.PD -Sort symbols numerically by their addresses, rather than alphabetically -by their names. -.IP "\fB\-p\fR" 4 -.IX Item "-p" -.PD 0 -.IP "\fB\-\-no\-sort\fR" 4 -.IX Item "--no-sort" -.PD -Do not bother to sort the symbols in any order; print them in the order -encountered. -.IP "\fB\-P\fR" 4 -.IX Item "-P" -.PD 0 -.IP "\fB\-\-portability\fR" 4 -.IX Item "--portability" -.PD -Use the \s-1POSIX\s0.2 standard output format instead of the default format. -Equivalent to \fB\-f posix\fR. -.IP "\fB\-S\fR" 4 -.IX Item "-S" -.PD 0 -.IP "\fB\-\-print\-size\fR" 4 -.IX Item "--print-size" -.PD -Print size, not the value, of defined symbols for the \f(CW\*(C`bsd\*(C'\fR output format. -.IP "\fB\-s\fR" 4 -.IX Item "-s" -.PD 0 -.IP "\fB\-\-print\-armap\fR" 4 -.IX Item "--print-armap" -.PD -When listing symbols from archive members, include the index: a mapping -(stored in the archive by \fBar\fR or \fBranlib\fR) of which modules -contain definitions for which names. -.IP "\fB\-r\fR" 4 -.IX Item "-r" -.PD 0 -.IP "\fB\-\-reverse\-sort\fR" 4 -.IX Item "--reverse-sort" -.PD -Reverse the order of the sort (whether numeric or alphabetic); let the -last come first. -.IP "\fB\-\-size\-sort\fR" 4 -.IX Item "--size-sort" -Sort symbols by size. The size is computed as the difference between -the value of the symbol and the value of the symbol with the next higher -value. If the \f(CW\*(C`bsd\*(C'\fR output format is used the size of the symbol -is printed, rather than the value, and \fB\-S\fR must be used in order -both size and value to be printed. -.IP "\fB\-\-special\-syms\fR" 4 -.IX Item "--special-syms" -Display symbols which have a target-specific special meaning. These -symbols are usually used by the target for some special processing and -are not normally helpful when included included in the normal symbol -lists. For example for \s-1ARM\s0 targets this option would skip the mapping -symbols used to mark transistions between \s-1ARM\s0 code, \s-1THUMB\s0 code and -data. -.IP "\fB\-t\fR \fIradix\fR" 4 -.IX Item "-t radix" -.PD 0 -.IP "\fB\-\-radix=\fR\fIradix\fR" 4 -.IX Item "--radix=radix" -.PD -Use \fIradix\fR as the radix for printing the symbol values. It must be -\&\fBd\fR for decimal, \fBo\fR for octal, or \fBx\fR for hexadecimal. -.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 -.IX Item "--target=bfdname" -Specify an object code format other than your system's default format. -.IP "\fB\-u\fR" 4 -.IX Item "-u" -.PD 0 -.IP "\fB\-\-undefined\-only\fR" 4 -.IX Item "--undefined-only" -.PD -Display only undefined symbols (those external to each object file). -.IP "\fB\-\-defined\-only\fR" 4 -.IX Item "--defined-only" -Display only defined symbols for each object file. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Show the version number of \fBnm\fR and exit. -.IP "\fB\-X\fR" 4 -.IX Item "-X" -This option is ignored for compatibility with the \s-1AIX\s0 version of -\&\fBnm\fR. It takes one parameter which must be the string -\&\fB32_64\fR. The default mode of \s-1AIX\s0 \fBnm\fR corresponds -to \fB\-X 32\fR, which is not supported by \s-1GNU\s0 \fBnm\fR. -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Show a summary of the options to \fBnm\fR and exit. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIar\fR\|(1), \fIobjdump\fR\|(1), \fIranlib\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/objcopy.1 b/binutils/doc/objcopy.1 deleted file mode 100644 index 828cddef56e..00000000000 --- a/binutils/doc/objcopy.1 +++ /dev/null @@ -1,795 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "OBJCOPY 1" -.TH OBJCOPY 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -objcopy \- copy and translate object files -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -objcopy [\fB\-F\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR] - [\fB\-I\fR \fIbfdname\fR|\fB\-\-input\-target=\fR\fIbfdname\fR] - [\fB\-O\fR \fIbfdname\fR|\fB\-\-output\-target=\fR\fIbfdname\fR] - [\fB\-B\fR \fIbfdarch\fR|\fB\-\-binary\-architecture=\fR\fIbfdarch\fR] - [\fB\-S\fR|\fB\-\-strip\-all\fR] - [\fB\-g\fR|\fB\-\-strip\-debug\fR] - [\fB\-K\fR \fIsymbolname\fR|\fB\-\-keep\-symbol=\fR\fIsymbolname\fR] - [\fB\-N\fR \fIsymbolname\fR|\fB\-\-strip\-symbol=\fR\fIsymbolname\fR] - [\fB\-\-strip\-unneeded\-symbol=\fR\fIsymbolname\fR] - [\fB\-G\fR \fIsymbolname\fR|\fB\-\-keep\-global\-symbol=\fR\fIsymbolname\fR] - [\fB\-L\fR \fIsymbolname\fR|\fB\-\-localize\-symbol=\fR\fIsymbolname\fR] - [\fB\-\-globalize\-symbol=\fR\fIsymbolname\fR] - [\fB\-W\fR \fIsymbolname\fR|\fB\-\-weaken\-symbol=\fR\fIsymbolname\fR] - [\fB\-w\fR|\fB\-\-wildcard\fR] - [\fB\-x\fR|\fB\-\-discard\-all\fR] - [\fB\-X\fR|\fB\-\-discard\-locals\fR] - [\fB\-b\fR \fIbyte\fR|\fB\-\-byte=\fR\fIbyte\fR] - [\fB\-i\fR \fIinterleave\fR|\fB\-\-interleave=\fR\fIinterleave\fR] - [\fB\-j\fR \fIsectionname\fR|\fB\-\-only\-section=\fR\fIsectionname\fR] - [\fB\-R\fR \fIsectionname\fR|\fB\-\-remove\-section=\fR\fIsectionname\fR] - [\fB\-p\fR|\fB\-\-preserve\-dates\fR] - [\fB\-\-debugging\fR] - [\fB\-\-gap\-fill=\fR\fIval\fR] - [\fB\-\-pad\-to=\fR\fIaddress\fR] - [\fB\-\-set\-start=\fR\fIval\fR] - [\fB\-\-adjust\-start=\fR\fIincr\fR] - [\fB\-\-change\-addresses=\fR\fIincr\fR] - [\fB\-\-change\-section\-address\fR \fIsection\fR{=,+,\-}\fIval\fR] - [\fB\-\-change\-section\-lma\fR \fIsection\fR{=,+,\-}\fIval\fR] - [\fB\-\-change\-section\-vma\fR \fIsection\fR{=,+,\-}\fIval\fR] - [\fB\-\-change\-warnings\fR] [\fB\-\-no\-change\-warnings\fR] - [\fB\-\-set\-section\-flags\fR \fIsection\fR=\fIflags\fR] - [\fB\-\-add\-section\fR \fIsectionname\fR=\fIfilename\fR] - [\fB\-\-rename\-section\fR \fIoldname\fR=\fInewname\fR[,\fIflags\fR]] - [\fB\-\-change\-leading\-char\fR] [\fB\-\-remove\-leading\-char\fR] - [\fB\-\-srec\-len=\fR\fIival\fR] [\fB\-\-srec\-forceS3\fR] - [\fB\-\-redefine\-sym\fR \fIold\fR=\fInew\fR] - [\fB\-\-redefine\-syms=\fR\fIfilename\fR] - [\fB\-\-weaken\fR] - [\fB\-\-keep\-symbols=\fR\fIfilename\fR] - [\fB\-\-strip\-symbols=\fR\fIfilename\fR] - [\fB\-\-strip\-unneeded\-symbols=\fR\fIfilename\fR] - [\fB\-\-keep\-global\-symbols=\fR\fIfilename\fR] - [\fB\-\-localize\-symbols=\fR\fIfilename\fR] - [\fB\-\-globalize\-symbols=\fR\fIfilename\fR] - [\fB\-\-weaken\-symbols=\fR\fIfilename\fR] - [\fB\-\-alt\-machine\-code=\fR\fIindex\fR] - [\fB\-\-prefix\-symbols=\fR\fIstring\fR] - [\fB\-\-prefix\-sections=\fR\fIstring\fR] - [\fB\-\-prefix\-alloc\-sections=\fR\fIstring\fR] - [\fB\-\-add\-gnu\-debuglink=\fR\fIpath-to-file\fR] - [\fB\-\-keep\-file\-symbols\fR] - [\fB\-\-only\-keep\-debug\fR] - [\fB\-\-writable\-text\fR] - [\fB\-\-readonly\-text\fR] - [\fB\-\-pure\fR] - [\fB\-\-impure\fR] - [\fB\-v\fR|\fB\-\-verbose\fR] - [\fB\-V\fR|\fB\-\-version\fR] - [\fB\-\-help\fR] [\fB\-\-info\fR] - \fIinfile\fR [\fIoutfile\fR] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -The \s-1GNU\s0 \fBobjcopy\fR utility copies the contents of an object -file to another. \fBobjcopy\fR uses the \s-1GNU\s0 \s-1BFD\s0 Library to -read and write the object files. It can write the destination object -file in a format different from that of the source object file. The -exact behavior of \fBobjcopy\fR is controlled by command-line options. -Note that \fBobjcopy\fR should be able to copy a fully linked file -between any two formats. However, copying a relocatable object file -between any two formats may not work as expected. -.PP -\&\fBobjcopy\fR creates temporary files to do its translations and -deletes them afterward. \fBobjcopy\fR uses \s-1BFD\s0 to do all its -translation work; it has access to all the formats described in \s-1BFD\s0 -and thus is able to recognize most formats without being told -explicitly. -.PP -\&\fBobjcopy\fR can be used to generate S\-records by using an output -target of \fBsrec\fR (e.g., use \fB\-O srec\fR). -.PP -\&\fBobjcopy\fR can be used to generate a raw binary file by using an -output target of \fBbinary\fR (e.g., use \fB\-O binary\fR). When -\&\fBobjcopy\fR generates a raw binary file, it will essentially produce -a memory dump of the contents of the input object file. All symbols and -relocation information will be discarded. The memory dump will start at -the load address of the lowest section copied into the output file. -.PP -When generating an S\-record or a raw binary file, it may be helpful to -use \fB\-S\fR to remove sections containing debugging information. In -some cases \fB\-R\fR will be useful to remove sections which contain -information that is not needed by the binary file. -.PP -Note\-\-\-\fBobjcopy\fR is not able to change the endianness of its input -files. If the input format has an endianness (some formats do not), -\&\fBobjcopy\fR can only copy the inputs into file formats that have the -same endianness or which have no endianness (e.g., \fBsrec\fR). -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fIinfile\fR" 4 -.IX Item "infile" -.PD 0 -.IP "\fIoutfile\fR" 4 -.IX Item "outfile" -.PD -The input and output files, respectively. -If you do not specify \fIoutfile\fR, \fBobjcopy\fR creates a -temporary file and destructively renames the result with -the name of \fIinfile\fR. -.IP "\fB\-I\fR \fIbfdname\fR" 4 -.IX Item "-I bfdname" -.PD 0 -.IP "\fB\-\-input\-target=\fR\fIbfdname\fR" 4 -.IX Item "--input-target=bfdname" -.PD -Consider the source file's object format to be \fIbfdname\fR, rather than -attempting to deduce it. -.IP "\fB\-O\fR \fIbfdname\fR" 4 -.IX Item "-O bfdname" -.PD 0 -.IP "\fB\-\-output\-target=\fR\fIbfdname\fR" 4 -.IX Item "--output-target=bfdname" -.PD -Write the output file using the object format \fIbfdname\fR. -.IP "\fB\-F\fR \fIbfdname\fR" 4 -.IX Item "-F bfdname" -.PD 0 -.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 -.IX Item "--target=bfdname" -.PD -Use \fIbfdname\fR as the object format for both the input and the output -file; i.e., simply transfer data from source to destination with no -translation. -.IP "\fB\-B\fR \fIbfdarch\fR" 4 -.IX Item "-B bfdarch" -.PD 0 -.IP "\fB\-\-binary\-architecture=\fR\fIbfdarch\fR" 4 -.IX Item "--binary-architecture=bfdarch" -.PD -Useful when transforming a raw binary input file into an object file. -In this case the output architecture can be set to \fIbfdarch\fR. This -option will be ignored if the input file has a known \fIbfdarch\fR. You -can access this binary data inside a program by referencing the special -symbols that are created by the conversion process. These symbols are -called _binary_\fIobjfile\fR_start, _binary_\fIobjfile\fR_end and -_binary_\fIobjfile\fR_size. e.g. you can transform a picture file into -an object file and then access it in your code using these symbols. -.IP "\fB\-j\fR \fIsectionname\fR" 4 -.IX Item "-j sectionname" -.PD 0 -.IP "\fB\-\-only\-section=\fR\fIsectionname\fR" 4 -.IX Item "--only-section=sectionname" -.PD -Copy only the named section from the input file to the output file. -This option may be given more than once. Note that using this option -inappropriately may make the output file unusable. -.IP "\fB\-R\fR \fIsectionname\fR" 4 -.IX Item "-R sectionname" -.PD 0 -.IP "\fB\-\-remove\-section=\fR\fIsectionname\fR" 4 -.IX Item "--remove-section=sectionname" -.PD -Remove any section named \fIsectionname\fR from the output file. This -option may be given more than once. Note that using this option -inappropriately may make the output file unusable. -.IP "\fB\-S\fR" 4 -.IX Item "-S" -.PD 0 -.IP "\fB\-\-strip\-all\fR" 4 -.IX Item "--strip-all" -.PD -Do not copy relocation and symbol information from the source file. -.IP "\fB\-g\fR" 4 -.IX Item "-g" -.PD 0 -.IP "\fB\-\-strip\-debug\fR" 4 -.IX Item "--strip-debug" -.PD -Do not copy debugging symbols or sections from the source file. -.IP "\fB\-\-strip\-unneeded\fR" 4 -.IX Item "--strip-unneeded" -Strip all symbols that are not needed for relocation processing. -.IP "\fB\-K\fR \fIsymbolname\fR" 4 -.IX Item "-K symbolname" -.PD 0 -.IP "\fB\-\-keep\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--keep-symbol=symbolname" -.PD -When stripping symbols, keep symbol \fIsymbolname\fR even if it would -normally be stripped. This option may be given more than once. -.IP "\fB\-N\fR \fIsymbolname\fR" 4 -.IX Item "-N symbolname" -.PD 0 -.IP "\fB\-\-strip\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--strip-symbol=symbolname" -.PD -Do not copy symbol \fIsymbolname\fR from the source file. This option -may be given more than once. -.IP "\fB\-\-strip\-unneeded\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--strip-unneeded-symbol=symbolname" -Do not copy symbol \fIsymbolname\fR from the source file unless it is needed -by a relocation. This option may be given more than once. -.IP "\fB\-G\fR \fIsymbolname\fR" 4 -.IX Item "-G symbolname" -.PD 0 -.IP "\fB\-\-keep\-global\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--keep-global-symbol=symbolname" -.PD -Keep only symbol \fIsymbolname\fR global. Make all other symbols local -to the file, so that they are not visible externally. This option may -be given more than once. -.IP "\fB\-L\fR \fIsymbolname\fR" 4 -.IX Item "-L symbolname" -.PD 0 -.IP "\fB\-\-localize\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--localize-symbol=symbolname" -.PD -Make symbol \fIsymbolname\fR local to the file, so that it is not -visible externally. This option may be given more than once. -.IP "\fB\-W\fR \fIsymbolname\fR" 4 -.IX Item "-W symbolname" -.PD 0 -.IP "\fB\-\-weaken\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--weaken-symbol=symbolname" -.PD -Make symbol \fIsymbolname\fR weak. This option may be given more than once. -.IP "\fB\-\-globalize\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--globalize-symbol=symbolname" -Give symbol \fIsymbolname\fR global scoping so that it is visible -outside of the file in which it is defined. This option may be given -more than once. -.IP "\fB\-w\fR" 4 -.IX Item "-w" -.PD 0 -.IP "\fB\-\-wildcard\fR" 4 -.IX Item "--wildcard" -.PD -Permit regular expressions in \fIsymbolname\fRs used in other command -line options. The question mark (?), asterisk (*), backslash (\e) and -square brackets ([]) operators can be used anywhere in the symbol -name. If the first character of the symbol name is the exclamation -point (!) then the sense of the switch is reversed for that symbol. -For example: -.Sp -.Vb 1 -\& \-w \-W !foo \-W fo* -.Ve -.Sp -would cause objcopy to weaken all symbols that start with \*(L"fo\*(R" -except for the symbol \*(L"foo\*(R". -.IP "\fB\-x\fR" 4 -.IX Item "-x" -.PD 0 -.IP "\fB\-\-discard\-all\fR" 4 -.IX Item "--discard-all" -.PD -Do not copy non-global symbols from the source file. -.IP "\fB\-X\fR" 4 -.IX Item "-X" -.PD 0 -.IP "\fB\-\-discard\-locals\fR" 4 -.IX Item "--discard-locals" -.PD -Do not copy compiler-generated local symbols. -(These usually start with \fBL\fR or \fB.\fR.) -.IP "\fB\-b\fR \fIbyte\fR" 4 -.IX Item "-b byte" -.PD 0 -.IP "\fB\-\-byte=\fR\fIbyte\fR" 4 -.IX Item "--byte=byte" -.PD -Keep only every \fIbyte\fRth byte of the input file (header data is not -affected). \fIbyte\fR can be in the range from 0 to \fIinterleave\fR\-1, -where \fIinterleave\fR is given by the \fB\-i\fR or \fB\-\-interleave\fR -option, or the default of 4. This option is useful for creating files -to program \s-1ROM\s0. It is typically used with an \f(CW\*(C`srec\*(C'\fR output -target. -.IP "\fB\-i\fR \fIinterleave\fR" 4 -.IX Item "-i interleave" -.PD 0 -.IP "\fB\-\-interleave=\fR\fIinterleave\fR" 4 -.IX Item "--interleave=interleave" -.PD -Only copy one out of every \fIinterleave\fR bytes. Select which byte to -copy with the \fB\-b\fR or \fB\-\-byte\fR option. The default is 4. -\&\fBobjcopy\fR ignores this option if you do not specify either \fB\-b\fR or -\&\fB\-\-byte\fR. -.IP "\fB\-p\fR" 4 -.IX Item "-p" -.PD 0 -.IP "\fB\-\-preserve\-dates\fR" 4 -.IX Item "--preserve-dates" -.PD -Set the access and modification dates of the output file to be the same -as those of the input file. -.IP "\fB\-\-debugging\fR" 4 -.IX Item "--debugging" -Convert debugging information, if possible. This is not the default -because only certain debugging formats are supported, and the -conversion process can be time consuming. -.IP "\fB\-\-gap\-fill\fR \fIval\fR" 4 -.IX Item "--gap-fill val" -Fill gaps between sections with \fIval\fR. This operation applies to -the \fIload address\fR (\s-1LMA\s0) of the sections. It is done by increasing -the size of the section with the lower address, and filling in the extra -space created with \fIval\fR. -.IP "\fB\-\-pad\-to\fR \fIaddress\fR" 4 -.IX Item "--pad-to address" -Pad the output file up to the load address \fIaddress\fR. This is -done by increasing the size of the last section. The extra space is -filled in with the value specified by \fB\-\-gap\-fill\fR (default zero). -.IP "\fB\-\-set\-start\fR \fIval\fR" 4 -.IX Item "--set-start val" -Set the start address of the new file to \fIval\fR. Not all object file -formats support setting the start address. -.IP "\fB\-\-change\-start\fR \fIincr\fR" 4 -.IX Item "--change-start incr" -.PD 0 -.IP "\fB\-\-adjust\-start\fR \fIincr\fR" 4 -.IX Item "--adjust-start incr" -.PD -Change the start address by adding \fIincr\fR. Not all object file -formats support setting the start address. -.IP "\fB\-\-change\-addresses\fR \fIincr\fR" 4 -.IX Item "--change-addresses incr" -.PD 0 -.IP "\fB\-\-adjust\-vma\fR \fIincr\fR" 4 -.IX Item "--adjust-vma incr" -.PD -Change the \s-1VMA\s0 and \s-1LMA\s0 addresses of all sections, as well as the start -address, by adding \fIincr\fR. Some object file formats do not permit -section addresses to be changed arbitrarily. Note that this does not -relocate the sections; if the program expects sections to be loaded at a -certain address, and this option is used to change the sections such -that they are loaded at a different address, the program may fail. -.IP "\fB\-\-change\-section\-address\fR \fIsection\fR\fB{=,+,\-}\fR\fIval\fR" 4 -.IX Item "--change-section-address section{=,+,-}val" -.PD 0 -.IP "\fB\-\-adjust\-section\-vma\fR \fIsection\fR\fB{=,+,\-}\fR\fIval\fR" 4 -.IX Item "--adjust-section-vma section{=,+,-}val" -.PD -Set or change both the \s-1VMA\s0 address and the \s-1LMA\s0 address of the named -\&\fIsection\fR. If \fB=\fR is used, the section address is set to -\&\fIval\fR. Otherwise, \fIval\fR is added to or subtracted from the -section address. See the comments under \fB\-\-change\-addresses\fR, -above. If \fIsection\fR does not exist in the input file, a warning will -be issued, unless \fB\-\-no\-change\-warnings\fR is used. -.IP "\fB\-\-change\-section\-lma\fR \fIsection\fR\fB{=,+,\-}\fR\fIval\fR" 4 -.IX Item "--change-section-lma section{=,+,-}val" -Set or change the \s-1LMA\s0 address of the named \fIsection\fR. The \s-1LMA\s0 -address is the address where the section will be loaded into memory at -program load time. Normally this is the same as the \s-1VMA\s0 address, which -is the address of the section at program run time, but on some systems, -especially those where a program is held in \s-1ROM\s0, the two can be -different. If \fB=\fR is used, the section address is set to -\&\fIval\fR. Otherwise, \fIval\fR is added to or subtracted from the -section address. See the comments under \fB\-\-change\-addresses\fR, -above. If \fIsection\fR does not exist in the input file, a warning -will be issued, unless \fB\-\-no\-change\-warnings\fR is used. -.IP "\fB\-\-change\-section\-vma\fR \fIsection\fR\fB{=,+,\-}\fR\fIval\fR" 4 -.IX Item "--change-section-vma section{=,+,-}val" -Set or change the \s-1VMA\s0 address of the named \fIsection\fR. The \s-1VMA\s0 -address is the address where the section will be located once the -program has started executing. Normally this is the same as the \s-1LMA\s0 -address, which is the address where the section will be loaded into -memory, but on some systems, especially those where a program is held in -\&\s-1ROM\s0, the two can be different. If \fB=\fR is used, the section address -is set to \fIval\fR. Otherwise, \fIval\fR is added to or subtracted -from the section address. See the comments under -\&\fB\-\-change\-addresses\fR, above. If \fIsection\fR does not exist in -the input file, a warning will be issued, unless -\&\fB\-\-no\-change\-warnings\fR is used. -.IP "\fB\-\-change\-warnings\fR" 4 -.IX Item "--change-warnings" -.PD 0 -.IP "\fB\-\-adjust\-warnings\fR" 4 -.IX Item "--adjust-warnings" -.PD -If \fB\-\-change\-section\-address\fR or \fB\-\-change\-section\-lma\fR or -\&\fB\-\-change\-section\-vma\fR is used, and the named section does not -exist, issue a warning. This is the default. -.IP "\fB\-\-no\-change\-warnings\fR" 4 -.IX Item "--no-change-warnings" -.PD 0 -.IP "\fB\-\-no\-adjust\-warnings\fR" 4 -.IX Item "--no-adjust-warnings" -.PD -Do not issue a warning if \fB\-\-change\-section\-address\fR or -\&\fB\-\-adjust\-section\-lma\fR or \fB\-\-adjust\-section\-vma\fR is used, even -if the named section does not exist. -.IP "\fB\-\-set\-section\-flags\fR \fIsection\fR\fB=\fR\fIflags\fR" 4 -.IX Item "--set-section-flags section=flags" -Set the flags for the named section. The \fIflags\fR argument is a -comma separated string of flag names. The recognized names are -\&\fBalloc\fR, \fBcontents\fR, \fBload\fR, \fBnoload\fR, -\&\fBreadonly\fR, \fBcode\fR, \fBdata\fR, \fBrom\fR, \fBshare\fR, and -\&\fBdebug\fR. You can set the \fBcontents\fR flag for a section which -does not have contents, but it is not meaningful to clear the -\&\fBcontents\fR flag of a section which does have contents\*(--just remove -the section instead. Not all flags are meaningful for all object file -formats. -.IP "\fB\-\-add\-section\fR \fIsectionname\fR\fB=\fR\fIfilename\fR" 4 -.IX Item "--add-section sectionname=filename" -Add a new section named \fIsectionname\fR while copying the file. The -contents of the new section are taken from the file \fIfilename\fR. The -size of the section will be the size of the file. This option only -works on file formats which can support sections with arbitrary names. -.IP "\fB\-\-rename\-section\fR \fIoldname\fR\fB=\fR\fInewname\fR\fB[,\fR\fIflags\fR\fB]\fR" 4 -.IX Item "--rename-section oldname=newname[,flags]" -Rename a section from \fIoldname\fR to \fInewname\fR, optionally -changing the section's flags to \fIflags\fR in the process. This has -the advantage over usng a linker script to perform the rename in that -the output stays as an object file and does not become a linked -executable. -.Sp -This option is particularly helpful when the input format is binary, -since this will always create a section called .data. If for example, -you wanted instead to create a section called .rodata containing binary -data you could use the following command line to achieve it: -.Sp -.Vb 3 -\& objcopy \-I binary \-O \-B \e -\& \-\-rename\-section .data=.rodata,alloc,load,readonly,data,contents \e -\& -.Ve -.IP "\fB\-\-change\-leading\-char\fR" 4 -.IX Item "--change-leading-char" -Some object file formats use special characters at the start of -symbols. The most common such character is underscore, which compilers -often add before every symbol. This option tells \fBobjcopy\fR to -change the leading character of every symbol when it converts between -object file formats. If the object file formats use the same leading -character, this option has no effect. Otherwise, it will add a -character, or remove a character, or change a character, as -appropriate. -.IP "\fB\-\-remove\-leading\-char\fR" 4 -.IX Item "--remove-leading-char" -If the first character of a global symbol is a special symbol leading -character used by the object file format, remove the character. The -most common symbol leading character is underscore. This option will -remove a leading underscore from all global symbols. This can be useful -if you want to link together objects of different file formats with -different conventions for symbol names. This is different from -\&\fB\-\-change\-leading\-char\fR because it always changes the symbol name -when appropriate, regardless of the object file format of the output -file. -.IP "\fB\-\-srec\-len=\fR\fIival\fR" 4 -.IX Item "--srec-len=ival" -Meaningful only for srec output. Set the maximum length of the Srecords -being produced to \fIival\fR. This length covers both address, data and -crc fields. -.IP "\fB\-\-srec\-forceS3\fR" 4 -.IX Item "--srec-forceS3" -Meaningful only for srec output. Avoid generation of S1/S2 records, -creating S3\-only record format. -.IP "\fB\-\-redefine\-sym\fR \fIold\fR\fB=\fR\fInew\fR" 4 -.IX Item "--redefine-sym old=new" -Change the name of a symbol \fIold\fR, to \fInew\fR. This can be useful -when one is trying link two things together for which you have no -source, and there are name collisions. -.IP "\fB\-\-redefine\-syms=\fR\fIfilename\fR" 4 -.IX Item "--redefine-syms=filename" -Apply \fB\-\-redefine\-sym\fR to each symbol pair "\fIold\fR \fInew\fR" -listed in the file \fIfilename\fR. \fIfilename\fR is simply a flat file, -with one symbol pair per line. Line comments may be introduced by the hash -character. This option may be given more than once. -.IP "\fB\-\-weaken\fR" 4 -.IX Item "--weaken" -Change all global symbols in the file to be weak. This can be useful -when building an object which will be linked against other objects using -the \fB\-R\fR option to the linker. This option is only effective when -using an object file format which supports weak symbols. -.IP "\fB\-\-keep\-symbols=\fR\fIfilename\fR" 4 -.IX Item "--keep-symbols=filename" -Apply \fB\-\-keep\-symbol\fR option to each symbol listed in the file -\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol -name per line. Line comments may be introduced by the hash character. -This option may be given more than once. -.IP "\fB\-\-strip\-symbols=\fR\fIfilename\fR" 4 -.IX Item "--strip-symbols=filename" -Apply \fB\-\-strip\-symbol\fR option to each symbol listed in the file -\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol -name per line. Line comments may be introduced by the hash character. -This option may be given more than once. -.IP "\fB\-\-strip\-unneeded\-symbols=\fR\fIfilename\fR" 4 -.IX Item "--strip-unneeded-symbols=filename" -Apply \fB\-\-strip\-unneeded\-symbol\fR option to each symbol listed in -the file \fIfilename\fR. \fIfilename\fR is simply a flat file, with one -symbol name per line. Line comments may be introduced by the hash -character. This option may be given more than once. -.IP "\fB\-\-keep\-global\-symbols=\fR\fIfilename\fR" 4 -.IX Item "--keep-global-symbols=filename" -Apply \fB\-\-keep\-global\-symbol\fR option to each symbol listed in the -file \fIfilename\fR. \fIfilename\fR is simply a flat file, with one -symbol name per line. Line comments may be introduced by the hash -character. This option may be given more than once. -.IP "\fB\-\-localize\-symbols=\fR\fIfilename\fR" 4 -.IX Item "--localize-symbols=filename" -Apply \fB\-\-localize\-symbol\fR option to each symbol listed in the file -\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol -name per line. Line comments may be introduced by the hash character. -This option may be given more than once. -.IP "\fB\-\-globalize\-symbols=\fR\fIfilename\fR" 4 -.IX Item "--globalize-symbols=filename" -Apply \fB\-\-globalize\-symbol\fR option to each symbol listed in the file -\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol -name per line. Line comments may be introduced by the hash character. -This option may be given more than once. -.IP "\fB\-\-weaken\-symbols=\fR\fIfilename\fR" 4 -.IX Item "--weaken-symbols=filename" -Apply \fB\-\-weaken\-symbol\fR option to each symbol listed in the file -\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol -name per line. Line comments may be introduced by the hash character. -This option may be given more than once. -.IP "\fB\-\-alt\-machine\-code=\fR\fIindex\fR" 4 -.IX Item "--alt-machine-code=index" -If the output architecture has alternate machine codes, use the -\&\fIindex\fRth code instead of the default one. This is useful in case -a machine is assigned an official code and the tool-chain adopts the -new code, but other applications still depend on the original code -being used. For \s-1ELF\s0 based architectures if the \fIindex\fR -alternative does not exist then the value is treated as an absolute -number to be stored in the e_machine field of the \s-1ELF\s0 header. -.IP "\fB\-\-writable\-text\fR" 4 -.IX Item "--writable-text" -Mark the output text as writable. This option isn't meaningful for all -object file formats. -.IP "\fB\-\-readonly\-text\fR" 4 -.IX Item "--readonly-text" -Make the output text write protected. This option isn't meaningful for all -object file formats. -.IP "\fB\-\-pure\fR" 4 -.IX Item "--pure" -Mark the output file as demand paged. This option isn't meaningful for all -object file formats. -.IP "\fB\-\-impure\fR" 4 -.IX Item "--impure" -Mark the output file as impure. This option isn't meaningful for all -object file formats. -.IP "\fB\-\-prefix\-symbols=\fR\fIstring\fR" 4 -.IX Item "--prefix-symbols=string" -Prefix all symbols in the output file with \fIstring\fR. -.IP "\fB\-\-prefix\-sections=\fR\fIstring\fR" 4 -.IX Item "--prefix-sections=string" -Prefix all section names in the output file with \fIstring\fR. -.IP "\fB\-\-prefix\-alloc\-sections=\fR\fIstring\fR" 4 -.IX Item "--prefix-alloc-sections=string" -Prefix all the names of all allocated sections in the output file with -\&\fIstring\fR. -.IP "\fB\-\-add\-gnu\-debuglink=\fR\fIpath-to-file\fR" 4 -.IX Item "--add-gnu-debuglink=path-to-file" -Creates a .gnu_debuglink section which contains a reference to \fIpath-to-file\fR -and adds it to the output file. -.IP "\fB\-\-keep\-file\-symbols\fR" 4 -.IX Item "--keep-file-symbols" -When stripping a file, perhaps with \fB\-\-strip\-debug\fR or -\&\fB\-\-strip\-unneeded\fR, retain any symbols specifying source file names, -which would otherwise get stripped. -.IP "\fB\-\-only\-keep\-debug\fR" 4 -.IX Item "--only-keep-debug" -Strip a file, removing contents of any sections that would not be -stripped by \fB\-\-strip\-debug\fR and leaving the debugging sections -intact. -.Sp -The intention is that this option will be used in conjunction with -\&\fB\-\-add\-gnu\-debuglink\fR to create a two part executable. One a -stripped binary which will occupy less space in \s-1RAM\s0 and in a -distribution and the second a debugging information file which is only -needed if debugging abilities are required. The suggested procedure -to create these files is as follows: -.RS 4 -.IP "1." 4 -.IX Item "1." -\&\f(CW\*(C`foo\*(C'\fR then... -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -create a file containing the debugging info. -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -stripped executable. -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -to add a link to the debugging info into the stripped executable. -.RE -.RS 4 -.Sp -Note \- the choice of \f(CW\*(C`.dbg\*(C'\fR as an extension for the debug info -file is arbitrary. Also the \f(CW\*(C`\-\-only\-keep\-debug\*(C'\fR step is -optional. You could instead do this: -.IP "1." 4 -.IX Item "1." -.PD 0 -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -.RE -.RS 4 -.PD -.Sp -i.e. the file pointed to by the \fB\-\-add\-gnu\-debuglink\fR can be the -full executable. It does not have to be a file created by the -\&\fB\-\-only\-keep\-debug\fR switch. -.RE -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Show the version number of \fBobjcopy\fR. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-\-verbose\fR" 4 -.IX Item "--verbose" -.PD -Verbose output: list all object files modified. In the case of -archives, \fBobjcopy \-V\fR lists all members of the archive. -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Show a summary of the options to \fBobjcopy\fR. -.IP "\fB\-\-info\fR" 4 -.IX Item "--info" -Display a list showing all architectures and object formats available. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIld\fR\|(1), \fIobjdump\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/objdump.1 b/binutils/doc/objdump.1 deleted file mode 100644 index a27423c21ba..00000000000 --- a/binutils/doc/objdump.1 +++ /dev/null @@ -1,634 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "OBJDUMP 1" -.TH OBJDUMP 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -objdump \- display information from object files. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -objdump [\fB\-a\fR|\fB\-\-archive\-headers\fR] - [\fB\-b\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR] - [\fB\-C\fR|\fB\-\-demangle\fR[=\fIstyle\fR] ] - [\fB\-d\fR|\fB\-\-disassemble\fR] - [\fB\-D\fR|\fB\-\-disassemble\-all\fR] - [\fB\-z\fR|\fB\-\-disassemble\-zeroes\fR] - [\fB\-EB\fR|\fB\-EL\fR|\fB\-\-endian=\fR{big | little }] - [\fB\-f\fR|\fB\-\-file\-headers\fR] - [\fB\-\-file\-start\-context\fR] - [\fB\-g\fR|\fB\-\-debugging\fR] - [\fB\-e\fR|\fB\-\-debugging\-tags\fR] - [\fB\-h\fR|\fB\-\-section\-headers\fR|\fB\-\-headers\fR] - [\fB\-i\fR|\fB\-\-info\fR] - [\fB\-j\fR \fIsection\fR|\fB\-\-section=\fR\fIsection\fR] - [\fB\-l\fR|\fB\-\-line\-numbers\fR] - [\fB\-S\fR|\fB\-\-source\fR] - [\fB\-m\fR \fImachine\fR|\fB\-\-architecture=\fR\fImachine\fR] - [\fB\-M\fR \fIoptions\fR|\fB\-\-disassembler\-options=\fR\fIoptions\fR] - [\fB\-p\fR|\fB\-\-private\-headers\fR] - [\fB\-r\fR|\fB\-\-reloc\fR] - [\fB\-R\fR|\fB\-\-dynamic\-reloc\fR] - [\fB\-s\fR|\fB\-\-full\-contents\fR] - [\fB\-W\fR|\fB\-\-dwarf\fR] - [\fB\-G\fR|\fB\-\-stabs\fR] - [\fB\-t\fR|\fB\-\-syms\fR] - [\fB\-T\fR|\fB\-\-dynamic\-syms\fR] - [\fB\-x\fR|\fB\-\-all\-headers\fR] - [\fB\-w\fR|\fB\-\-wide\fR] - [\fB\-\-start\-address=\fR\fIaddress\fR] - [\fB\-\-stop\-address=\fR\fIaddress\fR] - [\fB\-\-prefix\-addresses\fR] - [\fB\-\-[no\-]show\-raw\-insn\fR] - [\fB\-\-adjust\-vma=\fR\fIoffset\fR] - [\fB\-\-special\-syms\fR] - [\fB\-V\fR|\fB\-\-version\fR] - [\fB\-H\fR|\fB\-\-help\fR] - \fIobjfile\fR... -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBobjdump\fR displays information about one or more object files. -The options control what particular information to display. This -information is mostly useful to programmers who are working on the -compilation tools, as opposed to programmers who just want their -program to compile and work. -.PP -\&\fIobjfile\fR... are the object files to be examined. When you -specify archives, \fBobjdump\fR shows information on each of the member -object files. -.SH "OPTIONS" -.IX Header "OPTIONS" -The long and short forms of options, shown here as alternatives, are -equivalent. At least one option from the list -\&\fB\-a,\-d,\-D,\-e,\-f,\-g,\-G,\-h,\-H,\-p,\-r,\-R,\-s,\-S,\-t,\-T,\-V,\-x\fR must be given. -.IP "\fB\-a\fR" 4 -.IX Item "-a" -.PD 0 -.IP "\fB\-\-archive\-header\fR" 4 -.IX Item "--archive-header" -.PD -If any of the \fIobjfile\fR files are archives, display the archive -header information (in a format similar to \fBls \-l\fR). Besides the -information you could list with \fBar tv\fR, \fBobjdump \-a\fR shows -the object file format of each archive member. -.IP "\fB\-\-adjust\-vma=\fR\fIoffset\fR" 4 -.IX Item "--adjust-vma=offset" -When dumping information, first add \fIoffset\fR to all the section -addresses. This is useful if the section addresses do not correspond to -the symbol table, which can happen when putting sections at particular -addresses when using a format which can not represent section addresses, -such as a.out. -.IP "\fB\-b\fR \fIbfdname\fR" 4 -.IX Item "-b bfdname" -.PD 0 -.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 -.IX Item "--target=bfdname" -.PD -Specify that the object-code format for the object files is -\&\fIbfdname\fR. This option may not be necessary; \fIobjdump\fR can -automatically recognize many formats. -.Sp -For example, -.Sp -.Vb 1 -\& objdump \-b oasys \-m vax \-h fu.o -.Ve -.Sp -displays summary information from the section headers (\fB\-h\fR) of -\&\fIfu.o\fR, which is explicitly identified (\fB\-m\fR) as a \s-1VAX\s0 object -file in the format produced by Oasys compilers. You can list the -formats available with the \fB\-i\fR option. -.IP "\fB\-C\fR" 4 -.IX Item "-C" -.PD 0 -.IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4 -.IX Item "--demangle[=style]" -.PD -Decode (\fIdemangle\fR) low-level symbol names into user-level names. -Besides removing any initial underscore prepended by the system, this -makes \*(C+ function names readable. Different compilers have different -mangling styles. The optional demangling style argument can be used to -choose an appropriate demangling style for your compiler. -.IP "\fB\-g\fR" 4 -.IX Item "-g" -.PD 0 -.IP "\fB\-\-debugging\fR" 4 -.IX Item "--debugging" -.PD -Display debugging information. This attempts to parse debugging -information stored in the file and print it out using a C like syntax. -Only certain types of debugging information have been implemented. -Some other types are supported by \fBreadelf \-w\fR. -.IP "\fB\-e\fR" 4 -.IX Item "-e" -.PD 0 -.IP "\fB\-\-debugging\-tags\fR" 4 -.IX Item "--debugging-tags" -.PD -Like \fB\-g\fR, but the information is generated in a format compatible -with ctags tool. -.IP "\fB\-d\fR" 4 -.IX Item "-d" -.PD 0 -.IP "\fB\-\-disassemble\fR" 4 -.IX Item "--disassemble" -.PD -Display the assembler mnemonics for the machine instructions from -\&\fIobjfile\fR. This option only disassembles those sections which are -expected to contain instructions. -.IP "\fB\-D\fR" 4 -.IX Item "-D" -.PD 0 -.IP "\fB\-\-disassemble\-all\fR" 4 -.IX Item "--disassemble-all" -.PD -Like \fB\-d\fR, but disassemble the contents of all sections, not just -those expected to contain instructions. -.IP "\fB\-\-prefix\-addresses\fR" 4 -.IX Item "--prefix-addresses" -When disassembling, print the complete address on each line. This is -the older disassembly format. -.IP "\fB\-EB\fR" 4 -.IX Item "-EB" -.PD 0 -.IP "\fB\-EL\fR" 4 -.IX Item "-EL" -.IP "\fB\-\-endian={big|little}\fR" 4 -.IX Item "--endian={big|little}" -.PD -Specify the endianness of the object files. This only affects -disassembly. This can be useful when disassembling a file format which -does not describe endianness information, such as S\-records. -.IP "\fB\-f\fR" 4 -.IX Item "-f" -.PD 0 -.IP "\fB\-\-file\-headers\fR" 4 -.IX Item "--file-headers" -.PD -Display summary information from the overall header of -each of the \fIobjfile\fR files. -.IP "\fB\-\-file\-start\-context\fR" 4 -.IX Item "--file-start-context" -Specify that when displaying interlisted source code/disassembly -(assumes \fB\-S\fR) from a file that has not yet been displayed, extend the -context to the start of the file. -.IP "\fB\-h\fR" 4 -.IX Item "-h" -.PD 0 -.IP "\fB\-\-section\-headers\fR" 4 -.IX Item "--section-headers" -.IP "\fB\-\-headers\fR" 4 -.IX Item "--headers" -.PD -Display summary information from the section headers of the -object file. -.Sp -File segments may be relocated to nonstandard addresses, for example by -using the \fB\-Ttext\fR, \fB\-Tdata\fR, or \fB\-Tbss\fR options to -\&\fBld\fR. However, some object file formats, such as a.out, do not -store the starting address of the file segments. In those situations, -although \fBld\fR relocates the sections correctly, using \fBobjdump -\&\-h\fR to list the file section headers cannot show the correct addresses. -Instead, it shows the usual addresses, which are implicit for the -target. -.IP "\fB\-H\fR" 4 -.IX Item "-H" -.PD 0 -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -.PD -Print a summary of the options to \fBobjdump\fR and exit. -.IP "\fB\-i\fR" 4 -.IX Item "-i" -.PD 0 -.IP "\fB\-\-info\fR" 4 -.IX Item "--info" -.PD -Display a list showing all architectures and object formats available -for specification with \fB\-b\fR or \fB\-m\fR. -.IP "\fB\-j\fR \fIname\fR" 4 -.IX Item "-j name" -.PD 0 -.IP "\fB\-\-section=\fR\fIname\fR" 4 -.IX Item "--section=name" -.PD -Display information only for section \fIname\fR. -.IP "\fB\-l\fR" 4 -.IX Item "-l" -.PD 0 -.IP "\fB\-\-line\-numbers\fR" 4 -.IX Item "--line-numbers" -.PD -Label the display (using debugging information) with the filename and -source line numbers corresponding to the object code or relocs shown. -Only useful with \fB\-d\fR, \fB\-D\fR, or \fB\-r\fR. -.IP "\fB\-m\fR \fImachine\fR" 4 -.IX Item "-m machine" -.PD 0 -.IP "\fB\-\-architecture=\fR\fImachine\fR" 4 -.IX Item "--architecture=machine" -.PD -Specify the architecture to use when disassembling object files. This -can be useful when disassembling object files which do not describe -architecture information, such as S\-records. You can list the available -architectures with the \fB\-i\fR option. -.IP "\fB\-M\fR \fIoptions\fR" 4 -.IX Item "-M options" -.PD 0 -.IP "\fB\-\-disassembler\-options=\fR\fIoptions\fR" 4 -.IX Item "--disassembler-options=options" -.PD -Pass target specific information to the disassembler. Only supported on -some targets. If it is necessary to specify more than one -disassembler option then multiple \fB\-M\fR options can be used or -can be placed together into a comma separated list. -.Sp -If the target is an \s-1ARM\s0 architecture then this switch can be used to -select which register name set is used during disassembler. Specifying -\&\fB\-M reg-names-std\fR (the default) will select the register names as -used in \s-1ARM\s0's instruction set documentation, but with register 13 called -\&'sp', register 14 called 'lr' and register 15 called 'pc'. Specifying -\&\fB\-M reg-names-apcs\fR will select the name set used by the \s-1ARM\s0 -Procedure Call Standard, whilst specifying \fB\-M reg-names-raw\fR will -just use \fBr\fR followed by the register number. -.Sp -There are also two variants on the \s-1APCS\s0 register naming scheme enabled -by \fB\-M reg-names-atpcs\fR and \fB\-M reg-names-special-atpcs\fR which -use the ARM/Thumb Procedure Call Standard naming conventions. (Either -with the normal register names or the special register names). -.Sp -This option can also be used for \s-1ARM\s0 architectures to force the -disassembler to interpret all instructions as Thumb instructions by -using the switch \fB\-\-disassembler\-options=force\-thumb\fR. This can be -useful when attempting to disassemble thumb code produced by other -compilers. -.Sp -For the x86, some of the options duplicate functions of the \fB\-m\fR -switch, but allow finer grained control. Multiple selections from the -following may be specified as a comma separated string. -\&\fBx86\-64\fR, \fBi386\fR and \fBi8086\fR select disassembly for -the given architecture. \fBintel\fR and \fBatt\fR select between -intel syntax mode and \s-1AT&T\s0 syntax mode. \fBaddr32\fR, -\&\fBaddr16\fR, \fBdata32\fR and \fBdata16\fR specify the default -address size and operand size. These four options will be overridden if -\&\fBx86\-64\fR, \fBi386\fR or \fBi8086\fR appear later in the -option string. Lastly, \fBsuffix\fR, when in \s-1AT&T\s0 mode, -instructs the disassembler to print a mnemonic suffix even when the -suffix could be inferred by the operands. -.Sp -For \s-1PPC\s0, \fBbooke\fR, \fBbooke32\fR and \fBbooke64\fR select -disassembly of BookE instructions. \fB32\fR and \fB64\fR select -PowerPC and PowerPC64 disassembly, respectively. \fBe300\fR selects -disassembly for the e300 family. -.Sp -For \s-1MIPS\s0, this option controls the printing of instruction mneumonic -names and register names in disassembled instructions. Multiple -selections from the following may be specified as a comma separated -string, and invalid options are ignored: -.RS 4 -.ie n .IP """no\-aliases""" 4 -.el .IP "\f(CWno\-aliases\fR" 4 -.IX Item "no-aliases" -Print the 'raw' instruction mneumonic instead of some pseudo -instruction mneumonic. I.E. print 'daddu' or 'or' instead of 'move', -\&'sll' instead of 'nop', etc. -.ie n .IP """gpr\-names=\f(CI\s-1ABI\s0\f(CW""" 4 -.el .IP "\f(CWgpr\-names=\f(CI\s-1ABI\s0\f(CW\fR" 4 -.IX Item "gpr-names=ABI" -Print \s-1GPR\s0 (general\-purpose register) names as appropriate -for the specified \s-1ABI\s0. By default, \s-1GPR\s0 names are selected according to -the \s-1ABI\s0 of the binary being disassembled. -.ie n .IP """fpr\-names=\f(CI\s-1ABI\s0\f(CW""" 4 -.el .IP "\f(CWfpr\-names=\f(CI\s-1ABI\s0\f(CW\fR" 4 -.IX Item "fpr-names=ABI" -Print \s-1FPR\s0 (floating\-point register) names as -appropriate for the specified \s-1ABI\s0. By default, \s-1FPR\s0 numbers are printed -rather than names. -.ie n .IP """cp0\-names=\f(CI\s-1ARCH\s0\f(CW""" 4 -.el .IP "\f(CWcp0\-names=\f(CI\s-1ARCH\s0\f(CW\fR" 4 -.IX Item "cp0-names=ARCH" -Print \s-1CP0\s0 (system control coprocessor; coprocessor 0) register names -as appropriate for the \s-1CPU\s0 or architecture specified by -\&\fI\s-1ARCH\s0\fR. By default, \s-1CP0\s0 register names are selected according to -the architecture and \s-1CPU\s0 of the binary being disassembled. -.ie n .IP """hwr\-names=\f(CI\s-1ARCH\s0\f(CW""" 4 -.el .IP "\f(CWhwr\-names=\f(CI\s-1ARCH\s0\f(CW\fR" 4 -.IX Item "hwr-names=ARCH" -Print \s-1HWR\s0 (hardware register, used by the \f(CW\*(C`rdhwr\*(C'\fR instruction) names -as appropriate for the \s-1CPU\s0 or architecture specified by -\&\fI\s-1ARCH\s0\fR. By default, \s-1HWR\s0 names are selected according to -the architecture and \s-1CPU\s0 of the binary being disassembled. -.ie n .IP """reg\-names=\f(CI\s-1ABI\s0\f(CW""" 4 -.el .IP "\f(CWreg\-names=\f(CI\s-1ABI\s0\f(CW\fR" 4 -.IX Item "reg-names=ABI" -Print \s-1GPR\s0 and \s-1FPR\s0 names as appropriate for the selected \s-1ABI\s0. -.ie n .IP """reg\-names=\f(CI\s-1ARCH\s0\f(CW""" 4 -.el .IP "\f(CWreg\-names=\f(CI\s-1ARCH\s0\f(CW\fR" 4 -.IX Item "reg-names=ARCH" -Print CPU-specific register names (\s-1CP0\s0 register and \s-1HWR\s0 names) -as appropriate for the selected \s-1CPU\s0 or architecture. -.RE -.RS 4 -.Sp -For any of the options listed above, \fI\s-1ABI\s0\fR or -\&\fI\s-1ARCH\s0\fR may be specified as \fBnumeric\fR to have numbers printed -rather than names, for the selected types of registers. -You can list the available values of \fI\s-1ABI\s0\fR and \fI\s-1ARCH\s0\fR using -the \fB\-\-help\fR option. -.Sp -For \s-1VAX\s0, you can specify function entry addresses with \fB\-M -entry:0xf00ba\fR. You can use this multiple times to properly -disassemble \s-1VAX\s0 binary files that don't contain symbol tables (like -\&\s-1ROM\s0 dumps). In these cases, the function entry mask would otherwise -be decoded as \s-1VAX\s0 instructions, which would probably lead the the rest -of the function being wrongly disassembled. -.RE -.IP "\fB\-p\fR" 4 -.IX Item "-p" -.PD 0 -.IP "\fB\-\-private\-headers\fR" 4 -.IX Item "--private-headers" -.PD -Print information that is specific to the object file format. The exact -information printed depends upon the object file format. For some -object file formats, no additional information is printed. -.IP "\fB\-r\fR" 4 -.IX Item "-r" -.PD 0 -.IP "\fB\-\-reloc\fR" 4 -.IX Item "--reloc" -.PD -Print the relocation entries of the file. If used with \fB\-d\fR or -\&\fB\-D\fR, the relocations are printed interspersed with the -disassembly. -.IP "\fB\-R\fR" 4 -.IX Item "-R" -.PD 0 -.IP "\fB\-\-dynamic\-reloc\fR" 4 -.IX Item "--dynamic-reloc" -.PD -Print the dynamic relocation entries of the file. This is only -meaningful for dynamic objects, such as certain types of shared -libraries. -.IP "\fB\-s\fR" 4 -.IX Item "-s" -.PD 0 -.IP "\fB\-\-full\-contents\fR" 4 -.IX Item "--full-contents" -.PD -Display the full contents of any sections requested. By default all -non-empty sections are displayed. -.IP "\fB\-S\fR" 4 -.IX Item "-S" -.PD 0 -.IP "\fB\-\-source\fR" 4 -.IX Item "--source" -.PD -Display source code intermixed with disassembly, if possible. Implies -\&\fB\-d\fR. -.IP "\fB\-\-show\-raw\-insn\fR" 4 -.IX Item "--show-raw-insn" -When disassembling instructions, print the instruction in hex as well as -in symbolic form. This is the default except when -\&\fB\-\-prefix\-addresses\fR is used. -.IP "\fB\-\-no\-show\-raw\-insn\fR" 4 -.IX Item "--no-show-raw-insn" -When disassembling instructions, do not print the instruction bytes. -This is the default when \fB\-\-prefix\-addresses\fR is used. -.IP "\fB\-W\fR" 4 -.IX Item "-W" -.PD 0 -.IP "\fB\-\-dwarf\fR" 4 -.IX Item "--dwarf" -.PD -Displays the contents of the \s-1DWARF\s0 debug sections in the file, if any -are present. -.IP "\fB\-G\fR" 4 -.IX Item "-G" -.PD 0 -.IP "\fB\-\-stabs\fR" 4 -.IX Item "--stabs" -.PD -Display the full contents of any sections requested. Display the -contents of the .stab and .stab.index and .stab.excl sections from an -\&\s-1ELF\s0 file. This is only useful on systems (such as Solaris 2.0) in which -\&\f(CW\*(C`.stab\*(C'\fR debugging symbol-table entries are carried in an \s-1ELF\s0 -section. In most other file formats, debugging symbol-table entries are -interleaved with linkage symbols, and are visible in the \fB\-\-syms\fR -output. -.IP "\fB\-\-start\-address=\fR\fIaddress\fR" 4 -.IX Item "--start-address=address" -Start displaying data at the specified address. This affects the output -of the \fB\-d\fR, \fB\-r\fR and \fB\-s\fR options. -.IP "\fB\-\-stop\-address=\fR\fIaddress\fR" 4 -.IX Item "--stop-address=address" -Stop displaying data at the specified address. This affects the output -of the \fB\-d\fR, \fB\-r\fR and \fB\-s\fR options. -.IP "\fB\-t\fR" 4 -.IX Item "-t" -.PD 0 -.IP "\fB\-\-syms\fR" 4 -.IX Item "--syms" -.PD -Print the symbol table entries of the file. -This is similar to the information provided by the \fBnm\fR program. -.IP "\fB\-T\fR" 4 -.IX Item "-T" -.PD 0 -.IP "\fB\-\-dynamic\-syms\fR" 4 -.IX Item "--dynamic-syms" -.PD -Print the dynamic symbol table entries of the file. This is only -meaningful for dynamic objects, such as certain types of shared -libraries. This is similar to the information provided by the \fBnm\fR -program when given the \fB\-D\fR (\fB\-\-dynamic\fR) option. -.IP "\fB\-\-special\-syms\fR" 4 -.IX Item "--special-syms" -When displaying symbols include those which the target considers to be -special in some way and which would not normally be of interest to the -user. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Print the version number of \fBobjdump\fR and exit. -.IP "\fB\-x\fR" 4 -.IX Item "-x" -.PD 0 -.IP "\fB\-\-all\-headers\fR" 4 -.IX Item "--all-headers" -.PD -Display all available header information, including the symbol table and -relocation entries. Using \fB\-x\fR is equivalent to specifying all of -\&\fB\-a \-f \-h \-p \-r \-t\fR. -.IP "\fB\-w\fR" 4 -.IX Item "-w" -.PD 0 -.IP "\fB\-\-wide\fR" 4 -.IX Item "--wide" -.PD -Format some lines for output devices that have more than 80 columns. -Also do not truncate symbol names when they are displayed. -.IP "\fB\-z\fR" 4 -.IX Item "-z" -.PD 0 -.IP "\fB\-\-disassemble\-zeroes\fR" 4 -.IX Item "--disassemble-zeroes" -.PD -Normally the disassembly output will skip blocks of zeroes. This -option directs the disassembler to disassemble those blocks, just like -any other data. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fInm\fR\|(1), \fIreadelf\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/ranlib.1 b/binutils/doc/ranlib.1 deleted file mode 100644 index fd03dd02c72..00000000000 --- a/binutils/doc/ranlib.1 +++ /dev/null @@ -1,188 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "RANLIB 1" -.TH RANLIB 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -ranlib \- generate index to archive. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -ranlib [\fB\-vV\fR] \fIarchive\fR -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBranlib\fR generates an index to the contents of an archive and -stores it in the archive. The index lists each symbol defined by a -member of an archive that is a relocatable object file. -.PP -You may use \fBnm \-s\fR or \fBnm \-\-print\-armap\fR to list this index. -.PP -An archive with such an index speeds up linking to the library and -allows routines in the library to call each other without regard to -their placement in the archive. -.PP -The \s-1GNU\s0 \fBranlib\fR program is another form of \s-1GNU\s0 \fBar\fR; running -\&\fBranlib\fR is completely equivalent to executing \fBar \-s\fR. -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Show the version number of \fBranlib\fR. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIar\fR\|(1), \fInm\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/readelf.1 b/binutils/doc/readelf.1 deleted file mode 100644 index 14480c7938e..00000000000 --- a/binutils/doc/readelf.1 +++ /dev/null @@ -1,376 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "READELF 1" -.TH READELF 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -readelf \- Displays information about ELF files. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -readelf [\fB\-a\fR|\fB\-\-all\fR] - [\fB\-h\fR|\fB\-\-file\-header\fR] - [\fB\-l\fR|\fB\-\-program\-headers\fR|\fB\-\-segments\fR] - [\fB\-S\fR|\fB\-\-section\-headers\fR|\fB\-\-sections\fR] - [\fB\-g\fR|\fB\-\-section\-groups\fR] - [\fB\-t\fR|\fB\-\-section\-details\fR] - [\fB\-e\fR|\fB\-\-headers\fR] - [\fB\-s\fR|\fB\-\-syms\fR|\fB\-\-symbols\fR] - [\fB\-n\fR|\fB\-\-notes\fR] - [\fB\-r\fR|\fB\-\-relocs\fR] - [\fB\-u\fR|\fB\-\-unwind\fR] - [\fB\-d\fR|\fB\-\-dynamic\fR] - [\fB\-V\fR|\fB\-\-version\-info\fR] - [\fB\-A\fR|\fB\-\-arch\-specific\fR] - [\fB\-D\fR|\fB\-\-use\-dynamic\fR] - [\fB\-x\fR |\fB\-\-hex\-dump=\fR] - [\fB\-w[liaprmfFsoR]\fR| - \fB\-\-debug\-dump\fR[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames\-interp,=str,=loc,=Ranges]] - [\fB\-I\fR|\fB\-histogram\fR] - [\fB\-v\fR|\fB\-\-version\fR] - [\fB\-W\fR|\fB\-\-wide\fR] - [\fB\-H\fR|\fB\-\-help\fR] - \fIelffile\fR... -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBreadelf\fR displays information about one or more \s-1ELF\s0 format object -files. The options control what particular information to display. -.PP -\&\fIelffile\fR... are the object files to be examined. 32\-bit and -64\-bit \s-1ELF\s0 files are supported, as are archives containing \s-1ELF\s0 files. -.PP -This program performs a similar function to \fBobjdump\fR but it -goes into more detail and it exists independently of the \s-1BFD\s0 -library, so if there is a bug in \s-1BFD\s0 then readelf will not be -affected. -.SH "OPTIONS" -.IX Header "OPTIONS" -The long and short forms of options, shown here as alternatives, are -equivalent. At least one option besides \fB\-v\fR or \fB\-H\fR must be -given. -.IP "\fB\-a\fR" 4 -.IX Item "-a" -.PD 0 -.IP "\fB\-\-all\fR" 4 -.IX Item "--all" -.PD -Equivalent to specifiying \fB\-\-file\-header\fR, -\&\fB\-\-program\-headers\fR, \fB\-\-sections\fR, \fB\-\-symbols\fR, -\&\fB\-\-relocs\fR, \fB\-\-dynamic\fR, \fB\-\-notes\fR and -\&\fB\-\-version\-info\fR. -.IP "\fB\-h\fR" 4 -.IX Item "-h" -.PD 0 -.IP "\fB\-\-file\-header\fR" 4 -.IX Item "--file-header" -.PD -Displays the information contained in the \s-1ELF\s0 header at the start of the -file. -.IP "\fB\-l\fR" 4 -.IX Item "-l" -.PD 0 -.IP "\fB\-\-program\-headers\fR" 4 -.IX Item "--program-headers" -.IP "\fB\-\-segments\fR" 4 -.IX Item "--segments" -.PD -Displays the information contained in the file's segment headers, if it -has any. -.IP "\fB\-S\fR" 4 -.IX Item "-S" -.PD 0 -.IP "\fB\-\-sections\fR" 4 -.IX Item "--sections" -.IP "\fB\-\-section\-headers\fR" 4 -.IX Item "--section-headers" -.PD -Displays the information contained in the file's section headers, if it -has any. -.IP "\fB\-g\fR" 4 -.IX Item "-g" -.PD 0 -.IP "\fB\-\-section\-groups\fR" 4 -.IX Item "--section-groups" -.PD -Displays the information contained in the file's section groups, if it -has any. -.IP "\fB\-t\fR" 4 -.IX Item "-t" -.PD 0 -.IP "\fB\-\-section\-details\fR" 4 -.IX Item "--section-details" -.PD -Displays the detailed section information. Implies \fB\-S\fR. -.IP "\fB\-s\fR" 4 -.IX Item "-s" -.PD 0 -.IP "\fB\-\-symbols\fR" 4 -.IX Item "--symbols" -.IP "\fB\-\-syms\fR" 4 -.IX Item "--syms" -.PD -Displays the entries in symbol table section of the file, if it has one. -.IP "\fB\-e\fR" 4 -.IX Item "-e" -.PD 0 -.IP "\fB\-\-headers\fR" 4 -.IX Item "--headers" -.PD -Display all the headers in the file. Equivalent to \fB\-h \-l \-S\fR. -.IP "\fB\-n\fR" 4 -.IX Item "-n" -.PD 0 -.IP "\fB\-\-notes\fR" 4 -.IX Item "--notes" -.PD -Displays the contents of the \s-1NOTE\s0 segments and/or sections, if any. -.IP "\fB\-r\fR" 4 -.IX Item "-r" -.PD 0 -.IP "\fB\-\-relocs\fR" 4 -.IX Item "--relocs" -.PD -Displays the contents of the file's relocation section, if it has one. -.IP "\fB\-u\fR" 4 -.IX Item "-u" -.PD 0 -.IP "\fB\-\-unwind\fR" 4 -.IX Item "--unwind" -.PD -Displays the contents of the file's unwind section, if it has one. Only -the unwind sections for \s-1IA64\s0 \s-1ELF\s0 files are currently supported. -.IP "\fB\-d\fR" 4 -.IX Item "-d" -.PD 0 -.IP "\fB\-\-dynamic\fR" 4 -.IX Item "--dynamic" -.PD -Displays the contents of the file's dynamic section, if it has one. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\-info\fR" 4 -.IX Item "--version-info" -.PD -Displays the contents of the version sections in the file, it they -exist. -.IP "\fB\-A\fR" 4 -.IX Item "-A" -.PD 0 -.IP "\fB\-\-arch\-specific\fR" 4 -.IX Item "--arch-specific" -.PD -Displays architecture-specific information in the file, if there -is any. -.IP "\fB\-D\fR" 4 -.IX Item "-D" -.PD 0 -.IP "\fB\-\-use\-dynamic\fR" 4 -.IX Item "--use-dynamic" -.PD -When displaying symbols, this option makes \fBreadelf\fR use the -symbol table in the file's dynamic section, rather than the one in the -symbols section. -.IP "\fB\-x \fR" 4 -.IX Item "-x " -.PD 0 -.IP "\fB\-\-hex\-dump=\fR" 4 -.IX Item "--hex-dump=" -.PD -Displays the contents of the indicated section as a hexadecimal dump. -A number identifies a particular section by index in the section table; -any other string identifies all sections with that name in the object file. -.IP "\fB\-w[liaprmfFsoR]\fR" 4 -.IX Item "-w[liaprmfFsoR]" -.PD 0 -.IP "\fB\-\-debug\-dump[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames\-interp,=str,=loc,=Ranges]\fR" 4 -.IX Item "--debug-dump[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]" -.PD -Displays the contents of the debug sections in the file, if any are -present. If one of the optional letters or words follows the switch -then only data found in those specific sections will be dumped. -.IP "\fB\-I\fR" 4 -.IX Item "-I" -.PD 0 -.IP "\fB\-\-histogram\fR" 4 -.IX Item "--histogram" -.PD -Display a histogram of bucket list lengths when displaying the contents -of the symbol tables. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Display the version number of readelf. -.IP "\fB\-W\fR" 4 -.IX Item "-W" -.PD 0 -.IP "\fB\-\-wide\fR" 4 -.IX Item "--wide" -.PD -Don't break output lines to fit into 80 columns. By default -\&\fBreadelf\fR breaks section header and segment listing lines for -64\-bit \s-1ELF\s0 files, so that they fit into 80 columns. This option causes -\&\fBreadelf\fR to print each section header resp. each segment one a -single line, which is far more readable on terminals wider than 80 columns. -.IP "\fB\-H\fR" 4 -.IX Item "-H" -.PD 0 -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -.PD -Display the command line options understood by \fBreadelf\fR. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIobjdump\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/size.1 b/binutils/doc/size.1 deleted file mode 100644 index 1cf72ac7fe2..00000000000 --- a/binutils/doc/size.1 +++ /dev/null @@ -1,263 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "SIZE 1" -.TH SIZE 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -size \- list section sizes and total size. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -size [\fB\-A\fR|\fB\-B\fR|\fB\-\-format=\fR\fIcompatibility\fR] - [\fB\-\-help\fR] - [\fB\-d\fR|\fB\-o\fR|\fB\-x\fR|\fB\-\-radix=\fR\fInumber\fR] - [\fB\-t\fR|\fB\-\-totals\fR] - [\fB\-\-target=\fR\fIbfdname\fR] [\fB\-V\fR|\fB\-\-version\fR] - [\fIobjfile\fR...] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -The \s-1GNU\s0 \fBsize\fR utility lists the section sizes\-\-\-and the total -size\-\-\-for each of the object or archive files \fIobjfile\fR in its -argument list. By default, one line of output is generated for each -object file or each module in an archive. -.PP -\&\fIobjfile\fR... are the object files to be examined. -If none are specified, the file \f(CW\*(C`a.out\*(C'\fR will be used. -.SH "OPTIONS" -.IX Header "OPTIONS" -The command line options have the following meanings: -.IP "\fB\-A\fR" 4 -.IX Item "-A" -.PD 0 -.IP "\fB\-B\fR" 4 -.IX Item "-B" -.IP "\fB\-\-format=\fR\fIcompatibility\fR" 4 -.IX Item "--format=compatibility" -.PD -Using one of these options, you can choose whether the output from \s-1GNU\s0 -\&\fBsize\fR resembles output from System V \fBsize\fR (using \fB\-A\fR, -or \fB\-\-format=sysv\fR), or Berkeley \fBsize\fR (using \fB\-B\fR, or -\&\fB\-\-format=berkeley\fR). The default is the one-line format similar to -Berkeley's. -.Sp -Here is an example of the Berkeley (default) format of output from -\&\fBsize\fR: -.Sp -.Vb 4 -\& $ size \-\-format=Berkeley ranlib size -\& text data bss dec hex filename -\& 294880 81920 11592 388392 5ed28 ranlib -\& 294880 81920 11888 388688 5ee50 size -.Ve -.Sp -This is the same data, but displayed closer to System V conventions: -.Sp -.Vb 7 -\& $ size \-\-format=SysV ranlib size -\& ranlib : -\& section size addr -\& .text 294880 8192 -\& .data 81920 303104 -\& .bss 11592 385024 -\& Total 388392 -.Ve -.Sp -.Vb 6 -\& size : -\& section size addr -\& .text 294880 8192 -\& .data 81920 303104 -\& .bss 11888 385024 -\& Total 388688 -.Ve -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Show a summary of acceptable arguments and options. -.IP "\fB\-d\fR" 4 -.IX Item "-d" -.PD 0 -.IP "\fB\-o\fR" 4 -.IX Item "-o" -.IP "\fB\-x\fR" 4 -.IX Item "-x" -.IP "\fB\-\-radix=\fR\fInumber\fR" 4 -.IX Item "--radix=number" -.PD -Using one of these options, you can control whether the size of each -section is given in decimal (\fB\-d\fR, or \fB\-\-radix=10\fR); octal -(\fB\-o\fR, or \fB\-\-radix=8\fR); or hexadecimal (\fB\-x\fR, or -\&\fB\-\-radix=16\fR). In \fB\-\-radix=\fR\fInumber\fR, only the three -values (8, 10, 16) are supported. The total size is always given in two -radices; decimal and hexadecimal for \fB\-d\fR or \fB\-x\fR output, or -octal and hexadecimal if you're using \fB\-o\fR. -.IP "\fB\-t\fR" 4 -.IX Item "-t" -.PD 0 -.IP "\fB\-\-totals\fR" 4 -.IX Item "--totals" -.PD -Show totals of all objects listed (Berkeley format listing mode only). -.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 -.IX Item "--target=bfdname" -Specify that the object-code format for \fIobjfile\fR is -\&\fIbfdname\fR. This option may not be necessary; \fBsize\fR can -automatically recognize many formats. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Display the version number of \fBsize\fR. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIar\fR\|(1), \fIobjdump\fR\|(1), \fIreadelf\fR\|(1), and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/strings.1 b/binutils/doc/strings.1 deleted file mode 100644 index 5cffee121bf..00000000000 --- a/binutils/doc/strings.1 +++ /dev/null @@ -1,249 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "STRINGS 1" -.TH STRINGS 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -strings \- print the strings of printable characters in files. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -strings [\fB\-afov\fR] [\fB\-\fR\fImin-len\fR] - [\fB\-n\fR \fImin-len\fR] [\fB\-\-bytes=\fR\fImin-len\fR] - [\fB\-t\fR \fIradix\fR] [\fB\-\-radix=\fR\fIradix\fR] - [\fB\-e\fR \fIencoding\fR] [\fB\-\-encoding=\fR\fIencoding\fR] - [\fB\-\fR] [\fB\-\-all\fR] [\fB\-\-print\-file\-name\fR] - [\fB\-\-target=\fR\fIbfdname\fR] - [\fB\-\-help\fR] [\fB\-\-version\fR] \fIfile\fR... -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -For each \fIfile\fR given, \s-1GNU\s0 \fBstrings\fR prints the printable -character sequences that are at least 4 characters long (or the number -given with the options below) and are followed by an unprintable -character. By default, it only prints the strings from the initialized -and loaded sections of object files; for other types of files, it prints -the strings from the whole file. -.PP -\&\fBstrings\fR is mainly useful for determining the contents of non-text -files. -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fB\-a\fR" 4 -.IX Item "-a" -.PD 0 -.IP "\fB\-\-all\fR" 4 -.IX Item "--all" -.IP "\fB\-\fR" 4 -.IX Item "-" -.PD -Do not scan only the initialized and loaded sections of object files; -scan the whole files. -.IP "\fB\-f\fR" 4 -.IX Item "-f" -.PD 0 -.IP "\fB\-\-print\-file\-name\fR" 4 -.IX Item "--print-file-name" -.PD -Print the name of the file before each string. -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Print a summary of the program usage on the standard output and exit. -.IP "\fB\-\fR\fImin-len\fR" 4 -.IX Item "-min-len" -.PD 0 -.IP "\fB\-n\fR \fImin-len\fR" 4 -.IX Item "-n min-len" -.IP "\fB\-\-bytes=\fR\fImin-len\fR" 4 -.IX Item "--bytes=min-len" -.PD -Print sequences of characters that are at least \fImin-len\fR characters -long, instead of the default 4. -.IP "\fB\-o\fR" 4 -.IX Item "-o" -Like \fB\-t o\fR. Some other versions of \fBstrings\fR have \fB\-o\fR -act like \fB\-t d\fR instead. Since we can not be compatible with both -ways, we simply chose one. -.IP "\fB\-t\fR \fIradix\fR" 4 -.IX Item "-t radix" -.PD 0 -.IP "\fB\-\-radix=\fR\fIradix\fR" 4 -.IX Item "--radix=radix" -.PD -Print the offset within the file before each string. The single -character argument specifies the radix of the offset\-\-\-\fBo\fR for -octal, \fBx\fR for hexadecimal, or \fBd\fR for decimal. -.IP "\fB\-e\fR \fIencoding\fR" 4 -.IX Item "-e encoding" -.PD 0 -.IP "\fB\-\-encoding=\fR\fIencoding\fR" 4 -.IX Item "--encoding=encoding" -.PD -Select the character encoding of the strings that are to be found. -Possible values for \fIencoding\fR are: \fBs\fR = single\-7\-bit\-byte -characters (\s-1ASCII\s0, \s-1ISO\s0 8859, etc., default), \fBS\fR = -single\-8\-bit\-byte characters, \fBb\fR = 16\-bit bigendian, \fBl\fR = -16\-bit littleendian, \fBB\fR = 32\-bit bigendian, \fBL\fR = 32\-bit -littleendian. Useful for finding wide character strings. -.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 -.IX Item "--target=bfdname" -Specify an object code format other than your system's default format. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Print the program version number on the standard output and exit. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIar\fR\|(1), \fInm\fR\|(1), \fIobjdump\fR\|(1), \fIranlib\fR\|(1), \fIreadelf\fR\|(1) -and the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/strip.1 b/binutils/doc/strip.1 deleted file mode 100644 index 982255ef754..00000000000 --- a/binutils/doc/strip.1 +++ /dev/null @@ -1,383 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "STRIP 1" -.TH STRIP 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -strip \- Discard symbols from object files. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -strip [\fB\-F\fR \fIbfdname\fR |\fB\-\-target=\fR\fIbfdname\fR] - [\fB\-I\fR \fIbfdname\fR |\fB\-\-input\-target=\fR\fIbfdname\fR] - [\fB\-O\fR \fIbfdname\fR |\fB\-\-output\-target=\fR\fIbfdname\fR] - [\fB\-s\fR|\fB\-\-strip\-all\fR] - [\fB\-S\fR|\fB\-g\fR|\fB\-d\fR|\fB\-\-strip\-debug\fR] - [\fB\-K\fR \fIsymbolname\fR |\fB\-\-keep\-symbol=\fR\fIsymbolname\fR] - [\fB\-N\fR \fIsymbolname\fR |\fB\-\-strip\-symbol=\fR\fIsymbolname\fR] - [\fB\-w\fR|\fB\-\-wildcard\fR] - [\fB\-x\fR|\fB\-\-discard\-all\fR] [\fB\-X\fR |\fB\-\-discard\-locals\fR] - [\fB\-R\fR \fIsectionname\fR |\fB\-\-remove\-section=\fR\fIsectionname\fR] - [\fB\-o\fR \fIfile\fR] [\fB\-p\fR|\fB\-\-preserve\-dates\fR] - [\fB\-\-keep\-file\-symbols\fR] - [\fB\-\-only\-keep\-debug\fR] - [\fB\-v\fR |\fB\-\-verbose\fR] [\fB\-V\fR|\fB\-\-version\fR] - [\fB\-\-help\fR] [\fB\-\-info\fR] - \fIobjfile\fR... -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\s-1GNU\s0 \fBstrip\fR discards all symbols from object files -\&\fIobjfile\fR. The list of object files may include archives. -At least one object file must be given. -.PP -\&\fBstrip\fR modifies the files named in its argument, -rather than writing modified copies under different names. -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fB\-F\fR \fIbfdname\fR" 4 -.IX Item "-F bfdname" -.PD 0 -.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 -.IX Item "--target=bfdname" -.PD -Treat the original \fIobjfile\fR as a file with the object -code format \fIbfdname\fR, and rewrite it in the same format. -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Show a summary of the options to \fBstrip\fR and exit. -.IP "\fB\-\-info\fR" 4 -.IX Item "--info" -Display a list showing all architectures and object formats available. -.IP "\fB\-I\fR \fIbfdname\fR" 4 -.IX Item "-I bfdname" -.PD 0 -.IP "\fB\-\-input\-target=\fR\fIbfdname\fR" 4 -.IX Item "--input-target=bfdname" -.PD -Treat the original \fIobjfile\fR as a file with the object -code format \fIbfdname\fR. -.IP "\fB\-O\fR \fIbfdname\fR" 4 -.IX Item "-O bfdname" -.PD 0 -.IP "\fB\-\-output\-target=\fR\fIbfdname\fR" 4 -.IX Item "--output-target=bfdname" -.PD -Replace \fIobjfile\fR with a file in the output format \fIbfdname\fR. -.IP "\fB\-R\fR \fIsectionname\fR" 4 -.IX Item "-R sectionname" -.PD 0 -.IP "\fB\-\-remove\-section=\fR\fIsectionname\fR" 4 -.IX Item "--remove-section=sectionname" -.PD -Remove any section named \fIsectionname\fR from the output file. This -option may be given more than once. Note that using this option -inappropriately may make the output file unusable. -.IP "\fB\-s\fR" 4 -.IX Item "-s" -.PD 0 -.IP "\fB\-\-strip\-all\fR" 4 -.IX Item "--strip-all" -.PD -Remove all symbols. -.IP "\fB\-g\fR" 4 -.IX Item "-g" -.PD 0 -.IP "\fB\-S\fR" 4 -.IX Item "-S" -.IP "\fB\-d\fR" 4 -.IX Item "-d" -.IP "\fB\-\-strip\-debug\fR" 4 -.IX Item "--strip-debug" -.PD -Remove debugging symbols only. -.IP "\fB\-\-strip\-unneeded\fR" 4 -.IX Item "--strip-unneeded" -Remove all symbols that are not needed for relocation processing. -.IP "\fB\-K\fR \fIsymbolname\fR" 4 -.IX Item "-K symbolname" -.PD 0 -.IP "\fB\-\-keep\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--keep-symbol=symbolname" -.PD -When stripping symbols, keep symbol \fIsymbolname\fR even if it would -normally be stripped. This option may be given more than once. -.IP "\fB\-N\fR \fIsymbolname\fR" 4 -.IX Item "-N symbolname" -.PD 0 -.IP "\fB\-\-strip\-symbol=\fR\fIsymbolname\fR" 4 -.IX Item "--strip-symbol=symbolname" -.PD -Remove symbol \fIsymbolname\fR from the source file. This option may be -given more than once, and may be combined with strip options other than -\&\fB\-K\fR. -.IP "\fB\-o\fR \fIfile\fR" 4 -.IX Item "-o file" -Put the stripped output in \fIfile\fR, rather than replacing the -existing file. When this argument is used, only one \fIobjfile\fR -argument may be specified. -.IP "\fB\-p\fR" 4 -.IX Item "-p" -.PD 0 -.IP "\fB\-\-preserve\-dates\fR" 4 -.IX Item "--preserve-dates" -.PD -Preserve the access and modification dates of the file. -.IP "\fB\-w\fR" 4 -.IX Item "-w" -.PD 0 -.IP "\fB\-\-wildcard\fR" 4 -.IX Item "--wildcard" -.PD -Permit regular expressions in \fIsymbolname\fRs used in other command -line options. The question mark (?), asterisk (*), backslash (\e) and -square brackets ([]) operators can be used anywhere in the symbol -name. If the first character of the symbol name is the exclamation -point (!) then the sense of the switch is reversed for that symbol. -For example: -.Sp -.Vb 1 -\& \-w \-K !foo \-K fo* -.Ve -.Sp -would cause strip to only keep symbols that start with the letters -\&\*(L"fo\*(R", but to discard the symbol \*(L"foo\*(R". -.IP "\fB\-x\fR" 4 -.IX Item "-x" -.PD 0 -.IP "\fB\-\-discard\-all\fR" 4 -.IX Item "--discard-all" -.PD -Remove non-global symbols. -.IP "\fB\-X\fR" 4 -.IX Item "-X" -.PD 0 -.IP "\fB\-\-discard\-locals\fR" 4 -.IX Item "--discard-locals" -.PD -Remove compiler-generated local symbols. -(These usually start with \fBL\fR or \fB.\fR.) -.IP "\fB\-\-keep\-file\-symbols\fR" 4 -.IX Item "--keep-file-symbols" -When stripping a file, perhaps with \fB\-\-strip\-debug\fR or -\&\fB\-\-strip\-unneeded\fR, retain any symbols specifying source file names, -which would otherwise get stripped. -.IP "\fB\-\-only\-keep\-debug\fR" 4 -.IX Item "--only-keep-debug" -Strip a file, removing any sections that would be stripped by -\&\fB\-\-strip\-debug\fR and leaving the debugging sections. -.Sp -The intention is that this option will be used in conjunction with -\&\fB\-\-add\-gnu\-debuglink\fR to create a two part executable. One a -stripped binary which will occupy less space in \s-1RAM\s0 and in a -distribution and the second a debugging information file which is only -needed if debugging abilities are required. The suggested procedure -to create these files is as follows: -.RS 4 -.IP "1." 4 -.IX Item "1." -\&\f(CW\*(C`foo\*(C'\fR then... -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -create a file containing the debugging info. -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -stripped executable. -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -to add a link to the debugging info into the stripped executable. -.RE -.RS 4 -.Sp -Note \- the choice of \f(CW\*(C`.dbg\*(C'\fR as an extension for the debug info -file is arbitrary. Also the \f(CW\*(C`\-\-only\-keep\-debug\*(C'\fR step is -optional. You could instead do this: -.IP "1." 4 -.IX Item "1." -.PD 0 -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -.RE -.RS 4 -.PD -.Sp -ie the file pointed to by the \fB\-\-add\-gnu\-debuglink\fR can be the -full executable. It does not have to be a file created by the -\&\fB\-\-only\-keep\-debug\fR switch. -.RE -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Show the version number for \fBstrip\fR. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-\-verbose\fR" 4 -.IX Item "--verbose" -.PD -Verbose output: list all object files modified. In the case of -archives, \fBstrip \-v\fR lists all members of the archive. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/doc/windres.1 b/binutils/doc/windres.1 deleted file mode 100644 index 8d102543d16..00000000000 --- a/binutils/doc/windres.1 +++ /dev/null @@ -1,343 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "WINDRES 1" -.TH WINDRES 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -windres \- manipulate Windows resources. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -windres [options] [input\-file] [output\-file] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBwindres\fR reads resources from an input file and copies them into -an output file. Either file may be in one of three formats: -.ie n .IP """rc""" 4 -.el .IP "\f(CWrc\fR" 4 -.IX Item "rc" -A text format read by the Resource Compiler. -.ie n .IP """res""" 4 -.el .IP "\f(CWres\fR" 4 -.IX Item "res" -A binary format generated by the Resource Compiler. -.ie n .IP """coff""" 4 -.el .IP "\f(CWcoff\fR" 4 -.IX Item "coff" -A \s-1COFF\s0 object or executable. -.PP -The exact description of these different formats is available in -documentation from Microsoft. -.PP -When \fBwindres\fR converts from the \f(CW\*(C`rc\*(C'\fR format to the \f(CW\*(C`res\*(C'\fR -format, it is acting like the Windows Resource Compiler. When -\&\fBwindres\fR converts from the \f(CW\*(C`res\*(C'\fR format to the \f(CW\*(C`coff\*(C'\fR -format, it is acting like the Windows \f(CW\*(C`CVTRES\*(C'\fR program. -.PP -When \fBwindres\fR generates an \f(CW\*(C`rc\*(C'\fR file, the output is similar -but not identical to the format expected for the input. When an input -\&\f(CW\*(C`rc\*(C'\fR file refers to an external filename, an output \f(CW\*(C`rc\*(C'\fR file -will instead include the file contents. -.PP -If the input or output format is not specified, \fBwindres\fR will -guess based on the file name, or, for the input file, the file contents. -A file with an extension of \fI.rc\fR will be treated as an \f(CW\*(C`rc\*(C'\fR -file, a file with an extension of \fI.res\fR will be treated as a -\&\f(CW\*(C`res\*(C'\fR file, and a file with an extension of \fI.o\fR or -\&\fI.exe\fR will be treated as a \f(CW\*(C`coff\*(C'\fR file. -.PP -If no output file is specified, \fBwindres\fR will print the resources -in \f(CW\*(C`rc\*(C'\fR format to standard output. -.PP -The normal use is for you to write an \f(CW\*(C`rc\*(C'\fR file, use \fBwindres\fR -to convert it to a \s-1COFF\s0 object file, and then link the \s-1COFF\s0 file into -your application. This will make the resources described in the -\&\f(CW\*(C`rc\*(C'\fR file available to Windows. -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fB\-i\fR \fIfilename\fR" 4 -.IX Item "-i filename" -.PD 0 -.IP "\fB\-\-input\fR \fIfilename\fR" 4 -.IX Item "--input filename" -.PD -The name of the input file. If this option is not used, then -\&\fBwindres\fR will use the first non-option argument as the input file -name. If there are no non-option arguments, then \fBwindres\fR will -read from standard input. \fBwindres\fR can not read a \s-1COFF\s0 file from -standard input. -.IP "\fB\-o\fR \fIfilename\fR" 4 -.IX Item "-o filename" -.PD 0 -.IP "\fB\-\-output\fR \fIfilename\fR" 4 -.IX Item "--output filename" -.PD -The name of the output file. If this option is not used, then -\&\fBwindres\fR will use the first non-option argument, after any used -for the input file name, as the output file name. If there is no -non-option argument, then \fBwindres\fR will write to standard output. -\&\fBwindres\fR can not write a \s-1COFF\s0 file to standard output. Note, -for compatability with \fBrc\fR the option \fB\-fo\fR is also -accepted, but its use is not recommended. -.IP "\fB\-J\fR \fIformat\fR" 4 -.IX Item "-J format" -.PD 0 -.IP "\fB\-\-input\-format\fR \fIformat\fR" 4 -.IX Item "--input-format format" -.PD -The input format to read. \fIformat\fR may be \fBres\fR, \fBrc\fR, or -\&\fBcoff\fR. If no input format is specified, \fBwindres\fR will -guess, as described above. -.IP "\fB\-O\fR \fIformat\fR" 4 -.IX Item "-O format" -.PD 0 -.IP "\fB\-\-output\-format\fR \fIformat\fR" 4 -.IX Item "--output-format format" -.PD -The output format to generate. \fIformat\fR may be \fBres\fR, -\&\fBrc\fR, or \fBcoff\fR. If no output format is specified, -\&\fBwindres\fR will guess, as described above. -.IP "\fB\-F\fR \fItarget\fR" 4 -.IX Item "-F target" -.PD 0 -.IP "\fB\-\-target\fR \fItarget\fR" 4 -.IX Item "--target target" -.PD -Specify the \s-1BFD\s0 format to use for a \s-1COFF\s0 file as input or output. This -is a \s-1BFD\s0 target name; you can use the \fB\-\-help\fR option to see a list -of supported targets. Normally \fBwindres\fR will use the default -format, which is the first one listed by the \fB\-\-help\fR option. -.IP "\fB\-\-preprocessor\fR \fIprogram\fR" 4 -.IX Item "--preprocessor program" -When \fBwindres\fR reads an \f(CW\*(C`rc\*(C'\fR file, it runs it through the C -preprocessor first. This option may be used to specify the preprocessor -to use, including any leading arguments. The default preprocessor -argument is \f(CW\*(C`gcc \-E \-xc\-header \-DRC_INVOKED\*(C'\fR. -.IP "\fB\-I\fR \fIdirectory\fR" 4 -.IX Item "-I directory" -.PD 0 -.IP "\fB\-\-include\-dir\fR \fIdirectory\fR" 4 -.IX Item "--include-dir directory" -.PD -Specify an include directory to use when reading an \f(CW\*(C`rc\*(C'\fR file. -\&\fBwindres\fR will pass this to the preprocessor as an \fB\-I\fR -option. \fBwindres\fR will also search this directory when looking for -files named in the \f(CW\*(C`rc\*(C'\fR file. If the argument passed to this command -matches any of the supported \fIformats\fR (as descrived in the \fB\-J\fR -option), it will issue a deprecation warning, and behave just like the -\&\fB\-J\fR option. New programs should not use this behaviour. If a -directory happens to match a \fIformat\fR, simple prefix it with \fB./\fR -to disable the backward compatibility. -.IP "\fB\-D\fR \fItarget\fR" 4 -.IX Item "-D target" -.PD 0 -.IP "\fB\-\-define\fR \fIsym\fR\fB[=\fR\fIval\fR\fB]\fR" 4 -.IX Item "--define sym[=val]" -.PD -Specify a \fB\-D\fR option to pass to the preprocessor when reading an -\&\f(CW\*(C`rc\*(C'\fR file. -.IP "\fB\-U\fR \fItarget\fR" 4 -.IX Item "-U target" -.PD 0 -.IP "\fB\-\-undefine\fR \fIsym\fR" 4 -.IX Item "--undefine sym" -.PD -Specify a \fB\-U\fR option to pass to the preprocessor when reading an -\&\f(CW\*(C`rc\*(C'\fR file. -.IP "\fB\-r\fR" 4 -.IX Item "-r" -Ignored for compatibility with rc. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -Enable verbose mode. This tells you what the preprocessor is if you -didn't specify one. -.IP "\fB\-l\fR \fIval\fR" 4 -.IX Item "-l val" -.PD 0 -.IP "\fB\-\-language\fR \fIval\fR" 4 -.IX Item "--language val" -.PD -Specify the default language to use when reading an \f(CW\*(C`rc\*(C'\fR file. -\&\fIval\fR should be a hexadecimal language code. The low eight bits are -the language, and the high eight bits are the sublanguage. -.IP "\fB\-\-use\-temp\-file\fR" 4 -.IX Item "--use-temp-file" -Use a temporary file to instead of using popen to read the output of -the preprocessor. Use this option if the popen implementation is buggy -on the host (eg., certain non-English language versions of Windows 95 and -Windows 98 are known to have buggy popen where the output will instead -go the console). -.IP "\fB\-\-no\-use\-temp\-file\fR" 4 -.IX Item "--no-use-temp-file" -Use popen, not a temporary file, to read the output of the preprocessor. -This is the default behaviour. -.IP "\fB\-h\fR" 4 -.IX Item "-h" -.PD 0 -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -.PD -Prints a usage summary. -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.PD -Prints the version number for \fBwindres\fR. -.IP "\fB\-\-yydebug\fR" 4 -.IX Item "--yydebug" -If \fBwindres\fR is compiled with \f(CW\*(C`YYDEBUG\*(C'\fR defined as \f(CW1\fR, -this will turn on parser debugging. -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -the Info entries for \fIbinutils\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/binutils/dwarf.c b/binutils/dwarf.c index c69cab224b2..cc37b25b701 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -1,5 +1,5 @@ /* dwarf.c -- display DWARF contents of a BFD binary file - Copyright 2005, 2006 + Copyright 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -19,12 +19,12 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include - -#include "dwarf.h" - -#include "bucomm.h" +#include "sysdep.h" #include "libiberty.h" +#include "bfd.h" +#include "bucomm.h" +#include "elf/dwarf2.h" +#include "dwarf.h" static int have_frame_base; static int need_base_address; @@ -895,6 +895,9 @@ decode_location_expression (unsigned char * data, case DW_OP_call_ref: printf ("DW_OP_call_ref"); break; + case DW_OP_form_tls_address: + printf ("DW_OP_form_tls_address"); + break; /* GNU extensions. */ case DW_OP_GNU_push_tls_address: @@ -1213,26 +1216,37 @@ read_and_display_attr_value (unsigned long attribute, case DW_AT_language: switch (uvalue) { - case DW_LANG_C: printf ("(non-ANSI C)"); break; + /* Ordered by the numeric value of these constants. */ case DW_LANG_C89: printf ("(ANSI C)"); break; - case DW_LANG_C_plus_plus: printf ("(C++)"); break; - case DW_LANG_Fortran77: printf ("(FORTRAN 77)"); break; - case DW_LANG_Fortran90: printf ("(Fortran 90)"); break; - case DW_LANG_Modula2: printf ("(Modula 2)"); break; - case DW_LANG_Pascal83: printf ("(ANSI Pascal)"); break; + case DW_LANG_C: printf ("(non-ANSI C)"); break; case DW_LANG_Ada83: printf ("(Ada)"); break; + case DW_LANG_C_plus_plus: printf ("(C++)"); break; case DW_LANG_Cobol74: printf ("(Cobol 74)"); break; case DW_LANG_Cobol85: printf ("(Cobol 85)"); break; + case DW_LANG_Fortran77: printf ("(FORTRAN 77)"); break; + case DW_LANG_Fortran90: printf ("(Fortran 90)"); break; + case DW_LANG_Pascal83: printf ("(ANSI Pascal)"); break; + case DW_LANG_Modula2: printf ("(Modula 2)"); break; /* DWARF 2.1 values. */ + case DW_LANG_Java: printf ("(Java)"); break; case DW_LANG_C99: printf ("(ANSI C99)"); break; case DW_LANG_Ada95: printf ("(ADA 95)"); break; case DW_LANG_Fortran95: printf ("(Fortran 95)"); break; + /* DWARF 3 values. */ + case DW_LANG_PLI: printf ("(PLI)"); break; + case DW_LANG_ObjC: printf ("(Objective C)"); break; + case DW_LANG_ObjC_plus_plus: printf ("(Objective C++)"); break; + case DW_LANG_UPC: printf ("(Unified Parallel C)"); break; + case DW_LANG_D: printf ("(D)"); break; /* MIPS extension. */ case DW_LANG_Mips_Assembler: printf ("(MIPS assembler)"); break; /* UPC extension. */ case DW_LANG_Upc: printf ("(Unified Parallel C)"); break; default: - printf ("(Unknown: %lx)", uvalue); + if (uvalue >= DW_LANG_lo_user && uvalue <= DW_LANG_hi_user) + printf ("(implementation defined: %lx)", uvalue); + else + printf ("(Unknown: %lx)", uvalue); break; } break; @@ -1604,7 +1618,6 @@ process_debug_info (struct dwarf_section *section, void *file, hdrptr += 2; cu_offset = start - section_begin; - start += compunit.cu_length + initial_length_size; cu_abbrev_offset_ptr = hdrptr; compunit.cu_abbrev_offset = byte_get (hdrptr, offset_size); @@ -1628,8 +1641,6 @@ process_debug_info (struct dwarf_section *section, void *file, debug_information [unit].num_range_lists = 0; } - tags = hdrptr; - if (!do_loc) { printf (_(" Compilation Unit @ offset 0x%lx:\n"), cu_offset); @@ -1639,6 +1650,16 @@ process_debug_info (struct dwarf_section *section, void *file, printf (_(" Pointer Size: %d\n"), compunit.cu_pointer_size); } + if (cu_offset + compunit.cu_length + initial_length_size + > section->size) + { + warn (_("Debug info is corrupted, length is invalid (section is %lu bytes)\n"), + (unsigned long)section->size); + break; + } + tags = hdrptr; + start += compunit.cu_length + initial_length_size; + if (compunit.cu_version != 2 && compunit.cu_version != 3) { warn (_("Only version 2 and 3 DWARF debug information is currently supported.\n")); @@ -1649,11 +1670,15 @@ process_debug_info (struct dwarf_section *section, void *file, /* Process the abbrevs used by this compilation unit. DWARF sections under Mach-O have non-zero addresses. */ - process_abbrev_section - ((unsigned char *) debug_displays [abbrev].section.start - + compunit.cu_abbrev_offset - debug_displays [abbrev].section.address, - (unsigned char *) debug_displays [abbrev].section.start - + debug_displays [abbrev].section.size); + if (compunit.cu_abbrev_offset >= debug_displays [abbrev].section.size) + warn (_("Debug info is corrupted, abbrev offset is invalid (section is %lu bytes)\n"), + (unsigned long)debug_displays [abbrev].section.size); + else + process_abbrev_section + ((unsigned char *) debug_displays [abbrev].section.start + + compunit.cu_abbrev_offset - debug_displays [abbrev].section.address, + (unsigned char *) debug_displays [abbrev].section.start + + debug_displays [abbrev].section.size); level = 0; while (tags < start) @@ -1673,6 +1698,13 @@ process_debug_info (struct dwarf_section *section, void *file, continue; } + if (!do_loc) + printf (_(" <%d><%lx>: Abbrev Number: %lu"), + level, + (unsigned long) (tags - section_begin + - bytes_read), + abbrev_number); + /* Scan through the abbreviation list until we reach the correct entry. */ for (entry = first_abbrev; @@ -1682,18 +1714,18 @@ process_debug_info (struct dwarf_section *section, void *file, if (entry == NULL) { + if (!do_loc) + { + printf ("\n"); + fflush (stdout); + } warn (_("Unable to locate entry %lu in the abbreviation table\n"), abbrev_number); return 0; } if (!do_loc) - printf (_(" <%d><%lx>: Abbrev Number: %lu (%s)\n"), - level, - (unsigned long) (tags - section_begin - - bytes_read), - abbrev_number, - get_TAG_name (entry->tag)); + printf (_(" (%s)\n"), get_TAG_name (entry->tag)); switch (entry->tag) { @@ -1704,7 +1736,6 @@ process_debug_info (struct dwarf_section *section, void *file, need_base_address = 1; break; case DW_TAG_entry_point: - case DW_TAG_inlined_subroutine: case DW_TAG_subprogram: need_base_address = 0; /* Assuming that there is no DW_AT_frame_base. */ @@ -1713,14 +1744,20 @@ process_debug_info (struct dwarf_section *section, void *file, } for (attr = entry->first_attr; attr; attr = attr->next) - tags = read_and_display_attr (attr->attribute, - attr->form, - tags, cu_offset, - compunit.cu_pointer_size, - offset_size, - compunit.cu_version, - &debug_information [unit], - do_loc); + { + if (! do_loc) + /* Show the offset from where the tag was extracted. */ + printf (" <%2lx>", (unsigned long)(tags - section_begin)); + + tags = read_and_display_attr (attr->attribute, + attr->form, + tags, cu_offset, + compunit.cu_pointer_size, + offset_size, + compunit.cu_version, + &debug_information [unit], + do_loc); + } if (entry->children) ++level; @@ -2315,7 +2352,8 @@ display_debug_loc (struct dwarf_section *section, void *file) error (_("No location lists in .debug_info section!\n")); /* DWARF sections under Mach-O have non-zero addresses. */ - if (debug_information [first].loc_offsets [0] != section->address) + if (debug_information [first].num_loc_offsets > 0 + && debug_information [first].loc_offsets [0] != section->address) warn (_("Location lists in %s section start at 0x%lx\n"), section->name, debug_information [first].loc_offsets [0]); @@ -2495,7 +2533,6 @@ display_debug_str (struct dwarf_section *section, return 1; } - static int display_debug_info (struct dwarf_section *section, void *file) { @@ -2519,6 +2556,7 @@ display_debug_aranges (struct dwarf_section *section, unsigned char *ranges; unsigned long length; unsigned long address; + unsigned char address_size; int excess; int offset_size; int initial_length_size; @@ -2565,28 +2603,45 @@ display_debug_aranges (struct dwarf_section *section, printf (_(" Pointer Size: %d\n"), arange.ar_pointer_size); printf (_(" Segment Size: %d\n"), arange.ar_segment_size); - printf (_("\n Address Length\n")); + address_size = arange.ar_pointer_size + arange.ar_segment_size; + + /* The DWARF spec does not require that the address size be a power + of two, but we do. This will have to change if we ever encounter + an uneven architecture. */ + if ((address_size & (address_size - 1)) != 0) + { + warn (_("Pointer size + Segment size is not a power of two.\n")); + break; + } + + if (address_size > 4) + printf (_("\n Address Length\n")); + else + printf (_("\n Address Length\n")); ranges = hdrptr; - /* Must pad to an alignment boundary that is twice the pointer size. */ - excess = (hdrptr - start) % (2 * arange.ar_pointer_size); + /* Must pad to an alignment boundary that is twice the address size. */ + excess = (hdrptr - start) % (2 * address_size); if (excess) - ranges += (2 * arange.ar_pointer_size) - excess; + ranges += (2 * address_size) - excess; start += arange.ar_length + initial_length_size; - while (ranges + 2 * arange.ar_pointer_size <= start) + while (ranges + 2 * address_size <= start) { - address = byte_get (ranges, arange.ar_pointer_size); + address = byte_get (ranges, address_size); - ranges += arange.ar_pointer_size; + ranges += address_size; - length = byte_get (ranges, arange.ar_pointer_size); + length = byte_get (ranges, address_size); - ranges += arange.ar_pointer_size; + ranges += address_size; - printf (" %8.8lx %lu\n", address, length); + if (address_size > 4) + printf (" 0x%16.16lx 0x%lx\n", address, length); + else + printf (" 0x%8.8lx 0x%lx\n", address, length); } } @@ -2668,7 +2723,8 @@ display_debug_ranges (struct dwarf_section *section, error (_("No range lists in .debug_info section!\n")); /* DWARF sections under Mach-O have non-zero addresses. */ - if (debug_information [first].range_lists [0] != section->address) + if (debug_information [first].num_range_lists > 0 + && debug_information [first].range_lists [0] != section->address) warn (_("Range lists in %s section start at 0x%lx\n"), section->name, debug_information [first].range_lists [0]); @@ -2879,6 +2935,7 @@ static dwarf_vma get_encoded_value (unsigned char *data, int encoding) { int size = size_of_encoded_value (encoding); + if (encoding & DW_EH_PE_signed) return byte_get_signed (data, size); else @@ -2927,7 +2984,7 @@ display_debug_frames (struct dwarf_section *section, { printf ("\n%08lx ZERO terminator\n\n", (unsigned long)(saved_start - section_start)); - return 1; + continue; } if (length == 0xffffffff) @@ -2944,6 +3001,12 @@ display_debug_frames (struct dwarf_section *section, } block_end = saved_start + length + initial_length_size; + if (block_end > end) + { + warn ("Invalid length %#08lx in FDE at %#08lx\n", + length, (unsigned long)(saved_start - section_start)); + block_end = end; + } cie_id = byte_get (start, offset_size); start += offset_size; if (is_eh ? (cie_id == 0) : (cie_id == DW_CIE_ID)) @@ -3078,9 +3141,8 @@ display_debug_frames (struct dwarf_section *section, if (!cie) { - warn ("Invalid CIE pointer %08lx in FDE at %08lx\n", + warn ("Invalid CIE pointer %#08lx in FDE at %#08lx\n", cie_id, (unsigned long)(saved_start - section_start)); - start = block_end; fc->ncols = 0; fc->col_type = xmalloc (sizeof (short int)); fc->col_offset = xmalloc (sizeof (int)); @@ -3584,7 +3646,10 @@ display_debug_frames (struct dwarf_section *section, break; default: - warn (_("unsupported or unknown DW_CFA_%d\n"), op); + if (op >= DW_CFA_lo_user && op <= DW_CFA_hi_user) + printf (_(" DW_CFA_??? (User defined call frame op: %#x)\n"), op); + else + warn (_("unsupported or unknown Dwarf Call Frame Instruction number: %#x\n"), op); start = block_end; } } diff --git a/binutils/dwarf.h b/binutils/dwarf.h index 907ac93ef71..6b4674268a9 100644 --- a/binutils/dwarf.h +++ b/binutils/dwarf.h @@ -1,5 +1,5 @@ /* dwwrf.h - DWARF support header file - Copyright 2005 + Copyright 2005, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -18,9 +18,6 @@ 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 "bfd.h" -#include "elf/dwarf2.h" - #if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2) /* We can't use any bfd types here since readelf may define BFD64 and objdump may not. */ diff --git a/binutils/embedspu.sh b/binutils/embedspu.sh new file mode 100644 index 00000000000..6611172814e --- /dev/null +++ b/binutils/embedspu.sh @@ -0,0 +1,257 @@ +#! /bin/sh +# Embed an SPU ELF executable into a PowerPC object file. +# +# Copyright 2006, 2007 Free Software Foundation, Inc. +# +# This file is part of 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 2 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. + +usage () +{ + echo "Usage: embedspu [flags] symbol_name input_filename output_filename" + echo + echo " input_filename: SPU ELF executable to be embedded" + echo " output_filename: Resulting PowerPC object file" + echo " symbol_name: Name of program handle struct to be defined" + echo " flags: GCC flags defining PowerPC object file format" + echo " (e.g. -m32 or -m64)" + exit 1 +} + +program_transform_name= +mydir=`dirname "$0"` + +find_prog () +{ + prog=`echo $1 | sed "$program_transform_name"` + prog="$mydir/$prog" + test -x "$prog" && return 0 + prog="$mydir/$1" + test -x "$prog" && return 0 + prog=`echo $1 | sed "$program_transform_name"` + which $prog > /dev/null 2> /dev/null && return 0 + return 1 +} + +SYMBOL= +INFILE= +OUTFILE= +FLAGS= + +parse_args () +{ + while test -n "$1"; do + case "$1" in + -*) FLAGS="${FLAGS} $1" ;; + *) if test -z "$SYMBOL"; then + SYMBOL="$1" + elif test -z "$INFILE"; then + INFILE="$1" + elif test -z "$OUTFILE"; then + OUTFILE="$1" + else + echo "Too many arguments!" + usage + fi ;; + esac + shift + done + if test -z "$OUTFILE"; then + usage + fi + if test ! -r "$INFILE"; then + echo "${INFILE}: File not found" + usage + fi +} + +main () +{ + parse_args "$@" + + # Find a powerpc gcc. Support running from a combined tree build. + if test -x "$mydir/../gcc/xgcc"; then + CC="$mydir/../gcc/xgcc -B$mydir/../gcc/" + else + find_prog gcc + if test $? -ne 0; then + echo "Cannot find $prog" + exit 1 + fi + CC="$prog" + fi + + # Find readelf. Any old readelf should do. + find_prog readelf + if test $? -ne 0; then + if which readelf > /dev/null 2> /dev/null; then + prog=readelf + else + echo "Cannot find $prog" + exit 1 + fi + fi + READELF="$prog" + + # Sanity check the input file + if ! ${READELF} -h ${INFILE} | grep 'Class:.*ELF32' >/dev/null 2>/dev/null \ + || ! ${READELF} -h ${INFILE} | grep 'Type:.*EXEC' >/dev/null 2>/dev/null \ + || ! ${READELF} -h ${INFILE} | egrep 'Machine:.*(SPU|17)' >/dev/null 2>/dev/null + then + echo "${INFILE}: Does not appear to be an SPU executable" + exit 1 + fi + + toe=`${READELF} -S ${INFILE} | sed -n -e 's, *\[ *\([0-9]*\)\] *\.toe *[PROGN]*BITS *\([0-9a-f]*\).*,\1 \2,p'` + toe_addr=`echo $toe | sed -n -e 's,.* ,,p'` + toe=`echo $toe | sed -n -e 's, .*,,p'` + # For loaded sections, pick off section number, address, and file offset + sections=`${READELF} -S ${INFILE} | sed -n -e 's, *\[ *\([0-9]*\)\] *[^ ]* *PROGBITS *\([0-9a-f]*\) *\([0-9a-f]*\).*,\1 \2 \3,p'` + sections=`echo ${sections}` + # For relocation sections, pick off file offset and info (points to + # section where relocs apply) + relas=`${READELF} -S ${INFILE} | sed -n -e 's, *\[ *[0-9]*\] *[^ ]* *RELA *[0-9a-f]* *0*\([0-9a-f][0-9a-f]*\).* \([0-9a-f][0-9a-f]*\) *[0-9a-f][0-9a-f]*$,\1 \2,p'` + relas=`echo ${relas}` + + # Build embedded SPU image. + # 1. The whole SPU ELF file is written to .rodata.speelf + # 2. Symbols starting with the string "_EAR_" in the SPU ELF image are + # special. They allow an SPU program to access corresponding symbols + # (ie. minus the _EAR_ prefix), in the PowerPC program. _EAR_ without + # a suffix is used to refer to the addrress of the SPU image in + # PowerPC address space. _EAR_* symbols must all be defined in .toe + # at 16 byte intervals, or they must be defined in other non-bss + # sections. + # Find all _EAR_ symbols in .toe using readelf, sort by address, and + # write the address of the corresponding PowerPC symbol in a table + # built in .data.spetoe. For _EAE_ symbols not in .toe, create + # .reloc commands to relocate their location directly. + # 3. Look for R_SPU_PPU32 and R_SPU_PPU64 relocations in the SPU ELF image + # and create .reloc commands for them. + # 4. Write a struct spe_program_handle to .data. + # 5. Write a table of _SPUEAR_ symbols. + ${CC} ${FLAGS} -x assembler-with-cpp -nostartfiles -nostdlib \ + -Wa,-mbig -Wl,-r -Wl,-x -o ${OUTFILE} - <. @@ -22,12 +22,10 @@ /* This file reads and writes IEEE-695 debugging information. */ -#include +#include "sysdep.h" #include - #include "bfd.h" #include "ieee.h" -#include "bucomm.h" #include "libiberty.h" #include "debug.h" #include "budbg.h" diff --git a/binutils/mclex.c b/binutils/mclex.c new file mode 100644 index 00000000000..f6cedd9efd7 --- /dev/null +++ b/binutils/mclex.c @@ -0,0 +1,441 @@ +/* mclex.c -- lexer for Windows mc files parser. + Copyright 2007 + Free Software Foundation, Inc. + + Written by Kai Tietz, Onevision. + + This file is part of 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 2 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. */ + +/* This is a lexer used by the Windows rc file parser. + It basically just recognized a bunch of keywords. */ + +#include "sysdep.h" +#include "bfd.h" +#include "bucomm.h" +#include "libiberty.h" +#include "safe-ctype.h" +#include "windmc.h" +#include "mcparse.h" + +#include + +/* Exported globals. */ +bfd_boolean mclex_want_nl = FALSE; +bfd_boolean mclex_want_line = FALSE; +bfd_boolean mclex_want_filename = FALSE; + +/* Local globals. */ +static unichar *input_stream = NULL; +static unichar *input_stream_pos = NULL; +static int input_line = 1; +static const char *input_filename = NULL; + +void +mc_set_content (const unichar *src) +{ + if (!src) + return; + input_stream = input_stream_pos = unichar_dup (src); +} + +void +mc_set_inputfile (const char *name) +{ + if (! name || *name == 0) + input_filename = "-"; + else + { + const char *s1 = strrchr (name, '/'); + const char *s2 = strrchr (name, '\\'); + + if (! s1) + s1 = s2; + if (s1 && s2 && s1 < s2) + s1 = s2; + if (! s1) + s1 = name; + else + s1++; + s1 = xstrdup (s1); + input_filename = s1; + } +} + +static void +show_msg (const char *kind, const char *msg, va_list argp) +{ + fprintf (stderr, "In %s at line %d: %s: ", input_filename, input_line, kind); + vfprintf (stderr, msg, argp); + fprintf (stderr, ".\n"); +} + +void +mc_warn (const char *s, ...) +{ + va_list argp; + va_start (argp, s); + show_msg ("warning", s, argp); + va_end (argp); +} + +void +mc_fatal (const char *s, ...) +{ + va_list argp; + va_start (argp, s); + show_msg ("fatal", s, argp); + va_end (argp); + xexit (1); +} + + +int +yyerror (const char *s, ...) +{ + va_list argp; + va_start (argp, s); + show_msg ("parser", s, argp); + va_end (argp); + return 1; +} + +static unichar * +get_diff (unichar *end, unichar *start) +{ + unichar *ret; + unichar save = *end; + + *end = 0; + ret = unichar_dup (start); + *end = save; + return ret; +} + +static rc_uint_type +parse_digit (unichar ch) +{ + rc_uint_type base = 10, v = 0, c; + + if (ch == '0') + { + base = 8; + switch (input_stream_pos[0]) + { + case 'x': case 'X': base = 16; input_stream_pos++; break; + case 'o': case 'O': base = 8; input_stream_pos++; break; + case 'b': case 'B': base = 2; input_stream_pos++; break; + } + } + else + v = (rc_uint_type) (ch - '0'); + + while ((ch = input_stream_pos[0]) != 0) + { + if (ch >= 'A' && ch <= 'F') + c = (rc_uint_type) (ch - 'A') + 10; + else if (ch >= 'a' && ch <= 'f') + c = (rc_uint_type) (ch - 'a') + 10; + else if (ch >= '0' && ch <= '9') + c = (rc_uint_type) (ch - '0'); + else + break; + v *= base; + v += c; + ++input_stream_pos; + } + if (input_stream_pos[0] == 'U' || input_stream_pos[0] == 'u') + input_stream_pos++; + if (input_stream_pos[0] == 'L' || input_stream_pos[0] == 'l') + input_stream_pos++; + if (input_stream_pos[0] == 'L' || input_stream_pos[0] == 'l') + input_stream_pos++; + return v; +} + +static mc_keyword *keyword_top = NULL; + +const mc_keyword * +enum_facility (int e) +{ + mc_keyword *h = keyword_top; + + while (h != NULL) + { + while (h && strcmp (h->group_name, "facility") != 0) + h = h->next; + if (e == 0) + return h; + --e; + if (h) + h = h->next; + } + return h; +} + +const mc_keyword * +enum_severity (int e) +{ + mc_keyword *h = keyword_top; + + while (h != NULL) + { + while (h && strcmp (h->group_name, "severity") != 0) + h = h->next; + if (e == 0) + return h; + --e; + if (h) + h = h->next; + } + return h; +} + +static void +mc_add_keyword_ascii (const char *sz, int rid, const char *grp, rc_uint_type nv, const char *sv) +{ + unichar *usz, *usv = NULL; + rc_uint_type usz_len; + + unicode_from_codepage (&usz_len, &usz, sz, CP_ACP); + if (sv) + unicode_from_codepage (&usz_len, &usv, sv, CP_ACP); + mc_add_keyword (usz, rid, grp, nv, usv); +} + +void +mc_add_keyword (unichar *usz, int rid, const char *grp, rc_uint_type nv, unichar *sv) +{ + mc_keyword *p, *c, *n; + size_t len = unichar_len (usz); + + c = keyword_top; + p = NULL; + while (c != NULL) + { + if (c->len > len) + break; + if (c->len == len) + { + int e = memcmp (usz, c->usz, len * sizeof (unichar)); + + if (e < 0) + break; + if (! e) + { + if (! strcmp (grp, "keyword") || strcmp (c->group_name, grp) != 0) + fatal (_("Duplicate symbol entered into keyword list.")); + c->rid = rid; + c->nval = nv; + c->sval = (!sv ? NULL : unichar_dup (sv)); + if (! strcmp (grp, "language")) + { + const wind_language_t *lag = wind_find_language_by_id ((unsigned) nv); + + if (lag == NULL) + fatal ("Language ident 0x%lx is not resolvable.\n", (long) nv); + memcpy (&c->lang_info, lag, sizeof (*lag)); + } + return; + } + } + c = (p = c)->next; + } + n = xmalloc (sizeof (mc_keyword)); + n->next = c; + n->len = len; + n->group_name = grp; + n->usz = usz; + n->rid = rid; + n->nval = nv; + n->sval = (!sv ? NULL : unichar_dup (sv)); + if (! strcmp (grp, "language")) + { + const wind_language_t *lag = wind_find_language_by_id ((unsigned) nv); + if (lag == NULL) + fatal ("Language ident 0x%lx is not resolvable.\n", (long) nv); + memcpy (&n->lang_info, lag, sizeof (*lag)); + } + if (! p) + keyword_top = n; + else + p->next = n; +} + +static int +mc_token (const unichar *t, size_t len) +{ + static int was_init = 0; + mc_keyword *k; + + if (! was_init) + { + was_init = 1; + mc_add_keyword_ascii ("OutputBase", MCOUTPUTBASE, "keyword", 0, NULL); + mc_add_keyword_ascii ("MessageIdTypedef", MCMESSAGEIDTYPEDEF, "keyword", 0, NULL); + mc_add_keyword_ascii ("SeverityNames", MCSEVERITYNAMES, "keyword", 0, NULL); + mc_add_keyword_ascii ("FacilityNames", MCFACILITYNAMES, "keyword", 0, NULL); + mc_add_keyword_ascii ("LanguageNames", MCLANGUAGENAMES, "keyword", 0, NULL); + mc_add_keyword_ascii ("MessageId", MCMESSAGEID, "keyword", 0, NULL); + mc_add_keyword_ascii ("Severity", MCSEVERITY, "keyword", 0, NULL); + mc_add_keyword_ascii ("Facility", MCFACILITY, "keyword", 0, NULL); + mc_add_keyword_ascii ("SymbolicName", MCSYMBOLICNAME, "keyword", 0, NULL); + mc_add_keyword_ascii ("Language", MCLANGUAGE, "keyword", 0, NULL); + mc_add_keyword_ascii ("Success", MCTOKEN, "severity", 0, NULL); + mc_add_keyword_ascii ("Informational", MCTOKEN, "severity", 1, NULL); + mc_add_keyword_ascii ("Warning", MCTOKEN, "severity", 2, NULL); + mc_add_keyword_ascii ("Error", MCTOKEN, "severity", 3, NULL); + mc_add_keyword_ascii ("System", MCTOKEN, "facility", 0xff, NULL); + mc_add_keyword_ascii ("Application", MCTOKEN, "facility", 0xfff, NULL); + mc_add_keyword_ascii ("English", MCTOKEN, "language", 0x409, "MSG00001"); + } + k = keyword_top; + if (!len || !t || *t == 0) + return -1; + while (k != NULL) + { + if (k->len > len) + break; + if (k->len == len) + { + if (! memcmp (k->usz, t, len * sizeof (unichar))) + { + if (k->rid == MCTOKEN) + yylval.tok = k; + return k->rid; + } + } + k = k->next; + } + return -1; +} + +int +yylex (void) +{ + unichar *start_token; + unichar ch; + + if (! input_stream_pos) + { + fatal ("Input stream not setuped.\n"); + return -1; + } + if (mclex_want_line) + { + start_token = input_stream_pos; + if (input_stream_pos[0] == '.' + && (input_stream_pos[1] == '\n' + || (input_stream_pos[1] == '\r' && input_stream_pos[2] == '\n'))) + { + mclex_want_line = FALSE; + while (input_stream_pos[0] != 0 && input_stream_pos[0] != '\n') + ++input_stream_pos; + if (input_stream_pos[0] == '\n') + ++input_stream_pos; + return MCENDLINE; + } + while (input_stream_pos[0] != 0 && input_stream_pos[0] != '\n') + ++input_stream_pos; + if (input_stream_pos[0] == '\n') + ++input_stream_pos; + yylval.ustr = get_diff (input_stream_pos, start_token); + return MCLINE; + } + while ((ch = input_stream_pos[0]) <= 0x20) + { + if (ch == 0) + return -1; + ++input_stream_pos; + if (ch == '\n') + input_line += 1; + if (mclex_want_nl && ch == '\n') + { + mclex_want_nl = FALSE; + return NL; + } + } + start_token = input_stream_pos; + ++input_stream_pos; + if (mclex_want_filename) + { + mclex_want_filename = FALSE; + if (ch == '"') + { + start_token++; + while ((ch = input_stream_pos[0]) != 0) + { + if (ch == '"') + break; + ++input_stream_pos; + } + yylval.ustr = get_diff (input_stream_pos, start_token); + if (ch == '"') + ++input_stream_pos; + } + else + { + while ((ch = input_stream_pos[0]) != 0) + { + if (ch <= 0x20 || ch == ')') + break; + ++input_stream_pos; + } + yylval.ustr = get_diff (input_stream_pos, start_token); + } + return MCFILENAME; + } + switch (ch) + { + case ';': + ++start_token; + while (input_stream_pos[0] != '\n' && input_stream_pos[0] != 0) + ++input_stream_pos; + if (input_stream_pos[0] == '\n') + input_stream_pos++; + yylval.ustr = get_diff (input_stream_pos, start_token); + return MCCOMMENT; + case '=': + return '='; + case '(': + return '('; + case ')': + return ')'; + case '+': + return '+'; + case ':': + return ':'; + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + yylval.ival = parse_digit (ch); + return MCNUMBER; + default: + if (ch >= 0x40) + { + int ret; + while (input_stream_pos[0] >= 0x40 || (input_stream_pos[0] >= '0' && input_stream_pos[0] <= '9')) + ++input_stream_pos; + ret = mc_token (start_token, (size_t) (input_stream_pos - start_token)); + if (ret != -1) + return ret; + yylval.ustr = get_diff (input_stream_pos, start_token); + return MCIDENT; + } + yyerror ("illegal character 0x%x.", ch); + } + return -1; +} diff --git a/binutils/mcparse.y b/binutils/mcparse.y new file mode 100644 index 00000000000..9aaba9b8d41 --- /dev/null +++ b/binutils/mcparse.y @@ -0,0 +1,356 @@ +%{ /* mcparse.y -- parser for Windows mc files + Copyright 2007 + Free Software Foundation, Inc. + + Parser for Windows mc files + Written by Kai Tietz, Onevision. + + This file is part of 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 2 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. */ + +/* This is a parser for Windows rc files. It is based on the parser + by Gunther Ebert . */ + +#include "sysdep.h" +#include "bfd.h" +#include "bucomm.h" +#include "libiberty.h" +#include "windmc.h" +#include "safe-ctype.h" + +static rc_uint_type mc_last_id = 0; +static rc_uint_type mc_sefa_val = 0; +static unichar *mc_last_symbol = NULL; +static const mc_keyword *mc_cur_severity = NULL; +static const mc_keyword *mc_cur_facility = NULL; +static mc_node *cur_node = NULL; + +%} + +%union +{ + rc_uint_type ival; + unichar *ustr; + const mc_keyword *tok; + mc_node *nod; +}; + +%start input + +%token NL +%token MCIDENT MCFILENAME MCLINE MCCOMMENT +%token MCTOKEN +%token MCENDLINE +%token MCLANGUAGENAMES MCFACILITYNAMES MCSEVERITYNAMES MCOUTPUTBASE MCMESSAGEIDTYPEDEF +%token MCLANGUAGE MCMESSAGEID MCSEVERITY MCFACILITY MCSYMBOLICNAME +%token MCNUMBER + +%type id vid sefasy_def +%type alias_name token lines comments +%type lang + +%% +input: entities + ; + +entities: + /* empty */ + | entities entity + ; +entity: global_section + | message + | comments + { + cur_node = mc_add_node (); + cur_node->user_text = $1; + } + | error { mc_fatal ("syntax error"); } +; + +global_section: + MCSEVERITYNAMES '=' '(' severitymaps ')' + | MCSEVERITYNAMES '=' '(' severitymaps error { mc_fatal ("missing ')' in SeverityNames"); } + | MCSEVERITYNAMES '=' error { mc_fatal ("missing '(' in SeverityNames"); } + | MCSEVERITYNAMES error { mc_fatal ("missing '=' for SeverityNames"); } + | MCLANGUAGENAMES '=' '(' langmaps ')' + | MCLANGUAGENAMES '=' '(' langmaps error { mc_fatal ("missing ')' in LanguageNames"); } + | MCLANGUAGENAMES '=' error { mc_fatal ("missing '(' in LanguageNames"); } + | MCLANGUAGENAMES error { mc_fatal ("missing '=' for LanguageNames"); } + | MCFACILITYNAMES '=' '(' facilitymaps ')' + | MCFACILITYNAMES '=' '(' facilitymaps error { mc_fatal ("missing ')' in FacilityNames"); } + | MCFACILITYNAMES '=' error { mc_fatal ("missing '(' in FacilityNames"); } + | MCFACILITYNAMES error { mc_fatal ("missing '=' for FacilityNames"); } + | MCOUTPUTBASE '=' MCNUMBER + { + if ($3 != 10 && $3 != 16) + mc_fatal ("OutputBase allows 10 or 16 as value"); + mcset_out_values_are_decimal = ($3 == 10 ? 1 : 0); + } + | MCMESSAGEIDTYPEDEF '=' MCIDENT + { + mcset_msg_id_typedef = $3; + } + | MCMESSAGEIDTYPEDEF '=' error + { + mc_fatal ("MessageIdTypedef expects an identifier"); + } + | MCMESSAGEIDTYPEDEF error + { + mc_fatal ("missing '=' for MessageIdTypedef"); + } +; + +severitymaps: + severitymap + | severitymaps severitymap + | error { mc_fatal ("severity ident missing"); } +; + +severitymap: + token '=' MCNUMBER alias_name + { + mc_add_keyword ($1, MCTOKEN, "severity", $3, $4); + } + | token '=' error { mc_fatal ("severity number missing"); } + | token error { mc_fatal ("severity missing '='"); } +; + +facilitymaps: + facilitymap + | facilitymaps facilitymap + | error { mc_fatal ("missing ident in FacilityNames"); } +; + +facilitymap: + token '=' MCNUMBER alias_name + { + mc_add_keyword ($1, MCTOKEN, "facility", $3, $4); + } + | token '=' error { mc_fatal ("facility number missing"); } + | token error { mc_fatal ("facility missing '='"); } +; + +langmaps: + langmap + | langmaps langmap + | error { mc_fatal ("missing ident in LanguageNames"); } +; + +langmap: + token '=' MCNUMBER lex_want_filename ':' MCFILENAME + { + mc_add_keyword ($1, MCTOKEN, "language", $3, $6); + } + | token '=' MCNUMBER lex_want_filename ':' error { mc_fatal ("missing filename in LanguageNames"); } + | token '=' MCNUMBER error { mc_fatal ("missing ':' in LanguageNames"); } + | token '=' error { mc_fatal ("missing language code in LanguageNames"); } + | token error { mc_fatal ("missing '=' for LanguageNames"); } +; + +alias_name: + /* empty */ + { + $$ = NULL; + } + | ':' MCIDENT + { + $$ = $2; + } + | ':' error { mc_fatal ("illegal token in identifier"); $$ = NULL; } +; + +message: + id sefasy_def + { + cur_node = mc_add_node (); + cur_node->symbol = mc_last_symbol; + cur_node->facility = mc_cur_facility; + cur_node->severity = mc_cur_severity; + cur_node->id = ($1 & 0xffffUL); + cur_node->vid = ($1 & 0xffffUL) | mc_sefa_val; + mc_last_id = $1; + } + lang_entities +; + +id: MCMESSAGEID '=' vid { $$ = $3; } + | MCMESSAGEID '=' error { mc_fatal ("missing number in MessageId"); $$ = 0; } + | MCMESSAGEID error { mc_fatal ("missing '=' for MessageId"); $$ = 0; } +; + +vid: /* empty */ + { + $$ = ++mc_last_id; + } + | MCNUMBER + { + $$ = $1; + } + | '+' MCNUMBER + { + $$ = mc_last_id + $2; + } + | '+' error { mc_fatal ("missing number after MessageId '+'"); } +; + +sefasy_def: + /* empty */ + { + $$ = 0; + mc_sefa_val = (mcset_custom_bit ? 1 : 0) << 29; + mc_last_symbol = NULL; + mc_cur_severity = NULL; + mc_cur_facility = NULL; + } + | sefasy_def severity + { + if ($1 & 1) + mc_warn (_("duplicate definition of Severity")); + $$ = $1 | 1; + } + | sefasy_def facility + { + if ($1 & 2) + mc_warn (_("duplicate definition of Facility")); + $$ = $1 | 2; + } + | sefasy_def symbol + { + if ($1 & 4) + mc_warn (_("duplicate definition of SymbolicName")); + $$ = $1 | 4; + } +; + +severity: MCSEVERITY '=' MCTOKEN + { + mc_sefa_val &= ~ (0x3UL << 30); + mc_sefa_val |= (($3->nval & 0x3UL) << 30); + mc_cur_severity = $3; + } +; + +facility: MCFACILITY '=' MCTOKEN + { + mc_sefa_val &= ~ (0xfffUL << 16); + mc_sefa_val |= (($3->nval & 0xfffUL) << 16); + mc_cur_facility = $3; + } +; + +symbol: MCSYMBOLICNAME '=' MCIDENT + { + mc_last_symbol = $3; + } +; + +lang_entities: + lang_entity + | lang_entities lang_entity +; + +lang_entity: + lang lex_want_line lines MCENDLINE + { + mc_node_lang *h; + h = mc_add_node_lang (cur_node, $1, cur_node->vid); + h->message = $3; + if (mcset_max_message_length != 0 && unichar_len (h->message) > mcset_max_message_length) + mc_warn ("message length to long"); + } +; + +lines: MCLINE + { + $$ = $1; + } + | lines MCLINE + { + unichar *h; + rc_uint_type l1,l2; + l1 = unichar_len ($1); + l2 = unichar_len ($2); + h = (unichar *) res_alloc ((l1 + l2 + 1) * sizeof (unichar)); + if (l1) memcpy (h, $1, l1 * sizeof (unichar)); + if (l2) memcpy (&h[l1], $2, l2 * sizeof (unichar)); + h[l1 + l2] = 0; + $$ = h; + } + | error { mc_fatal ("missing end of message text"); $$ = NULL; } + | lines error { mc_fatal ("missing end of message text"); $$ = $1; } +; + +comments: MCCOMMENT { $$ = $1; } + | comments MCCOMMENT + { + unichar *h; + rc_uint_type l1,l2; + l1 = unichar_len ($1); + l2 = unichar_len ($2); + h = (unichar *) res_alloc ((l1 + l2 + 1) * sizeof (unichar)); + if (l1) memcpy (h, $1, l1 * sizeof (unichar)); + if (l2) memcpy (&h[l1], $2, l2 * sizeof (unichar)); + h[l1 + l2] = 0; + $$ = h; + } +; + +lang: MCLANGUAGE lex_want_nl '=' MCTOKEN NL + { + $$ = $4; + } + | MCLANGUAGE lex_want_nl '=' MCIDENT NL + { + $$ = NULL; + mc_fatal (_("undeclared language identifier")); + } + | MCLANGUAGE lex_want_nl '=' token error + { + $$ = NULL; + mc_fatal ("missing newline after Language"); + } + | MCLANGUAGE lex_want_nl '=' error + { + $$ = NULL; + mc_fatal ("missing ident for Language"); + } + | MCLANGUAGE error + { + $$ = NULL; + mc_fatal ("missing '=' for Language"); + } +; + +token: MCIDENT { $$ = $1; } + | MCTOKEN { $$ = $1->usz; } +; + +lex_want_nl: + /* Empty */ { mclex_want_nl = 1; } +; + +lex_want_line: + /* Empty */ { mclex_want_line = 1; } +; + +lex_want_filename: + /* Empty */ { mclex_want_filename = 1; } +; + +%% + +/* Something else. */ diff --git a/binutils/nlmconv.c b/binutils/nlmconv.c index 551e7e59e43..9932ba29b71 100644 --- a/binutils/nlmconv.c +++ b/binutils/nlmconv.c @@ -1,6 +1,6 @@ /* nlmconv.c -- NLM conversion program Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -32,9 +32,9 @@ #endif #endif +#include "sysdep.h" #include "bfd.h" #include "libiberty.h" -#include "bucomm.h" #include "safe-ctype.h" #include "ansidecl.h" @@ -53,6 +53,8 @@ #include "coff/ecoff.h" #endif +#include "bucomm.h" + /* If strerror is just a macro, we want to use the one from libiberty since it will handle undefined values. */ #undef strerror @@ -737,7 +739,7 @@ main (int argc, char **argv) || ! bfd_set_section_flags (outbfd, help_section, SEC_HAS_CONTENTS)) bfd_fatal (_("help section")); - strncpy (nlm_extended_header (outbfd)->stamp, "MeSsAgEs", 8); + LITMEMCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs"); } } if (message_file != NULL) @@ -759,7 +761,7 @@ main (int argc, char **argv) || ! bfd_set_section_flags (outbfd, message_section, SEC_HAS_CONTENTS)) bfd_fatal (_("message section")); - strncpy (nlm_extended_header (outbfd)->stamp, "MeSsAgEs", 8); + LITMEMCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs"); } } if (modules != NULL) @@ -795,7 +797,7 @@ main (int argc, char **argv) || ! bfd_set_section_flags (outbfd, rpc_section, SEC_HAS_CONTENTS)) bfd_fatal (_("rpc section")); - strncpy (nlm_extended_header (outbfd)->stamp, "MeSsAgEs", 8); + LITMEMCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs"); } } if (sharelib_file != NULL) @@ -852,20 +854,20 @@ main (int argc, char **argv) || ! bfd_set_section_flags (outbfd, shared_section, SEC_HAS_CONTENTS)) bfd_fatal (_("shared section")); - strncpy (nlm_extended_header (outbfd)->stamp, "MeSsAgEs", 8); + LITMEMCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs"); } } } /* Check whether a version was given. */ - if (strncmp (version_hdr->stamp, "VeRsIoN#", 8) != 0) + if (!CONST_STRNEQ (version_hdr->stamp, "VeRsIoN#")) non_fatal (_("warning: No version number given")); /* At least for now, always create an extended header, because that is what NLMLINK does. */ - strncpy (nlm_extended_header (outbfd)->stamp, "MeSsAgEs", 8); + LITMEMCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs"); - strncpy (nlm_cygnus_ext_header (outbfd)->stamp, "CyGnUsEx", 8); + LITMEMCPY (nlm_cygnus_ext_header (outbfd)->stamp, "CyGnUsEx"); /* If the date was not given, force it in. */ if (nlm_version_header (outbfd)->month == 0 @@ -880,7 +882,7 @@ main (int argc, char **argv) nlm_version_header (outbfd)->month = ptm->tm_mon + 1; nlm_version_header (outbfd)->day = ptm->tm_mday; nlm_version_header (outbfd)->year = ptm->tm_year + 1900; - strncpy (version_hdr->stamp, "VeRsIoN#", 8); + LITMEMCPY (version_hdr->stamp, "VeRsIoN#"); } #ifdef NLMCONV_POWERPC @@ -1109,7 +1111,7 @@ show_usage (FILE *file, int status) -h --help Display this information\n\ -v --version Display the program's version\n\ ")); - if (status == 0) + if (REPORT_BUGS_TO[0] && status == 0) fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); } @@ -1747,9 +1749,9 @@ powerpc_build_stubs (bfd *inbfd, bfd *outbfd ATTRIBUTE_UNUSED, /* Make a new undefined symbol with the same name but without the leading `.'. */ - newsym = (asymbol *) xmalloc (sizeof (asymbol)); + newsym = xmalloc (sizeof (asymbol)); *newsym = *sym; - newname = (char *) xmalloc (strlen (bfd_asymbol_name (sym))); + newname = xmalloc (strlen (bfd_asymbol_name (sym))); strcpy (newname, bfd_asymbol_name (sym) + 1); newsym->name = newname; diff --git a/binutils/nlmheader.c b/binutils/nlmheader.c deleted file mode 100644 index 1e6a862b2e5..00000000000 --- a/binutils/nlmheader.c +++ /dev/null @@ -1,2534 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - 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 2, 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. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - CHECK = 258, - CODESTART = 259, - COPYRIGHT = 260, - CUSTOM = 261, - DATE = 262, - DEBUG = 263, - DESCRIPTION = 264, - EXIT = 265, - EXPORT = 266, - FLAG_ON = 267, - FLAG_OFF = 268, - FULLMAP = 269, - HELP = 270, - IMPORT = 271, - INPUT = 272, - MAP = 273, - MESSAGES = 274, - MODULE = 275, - MULTIPLE = 276, - OS_DOMAIN = 277, - OUTPUT = 278, - PSEUDOPREEMPTION = 279, - REENTRANT = 280, - SCREENNAME = 281, - SHARELIB = 282, - STACK = 283, - START = 284, - SYNCHRONIZE = 285, - THREADNAME = 286, - TYPE = 287, - VERBOSE = 288, - VERSIONK = 289, - XDCDATA = 290, - STRING = 291, - QUOTED_STRING = 292 - }; -#endif -/* Tokens. */ -#define CHECK 258 -#define CODESTART 259 -#define COPYRIGHT 260 -#define CUSTOM 261 -#define DATE 262 -#define DEBUG 263 -#define DESCRIPTION 264 -#define EXIT 265 -#define EXPORT 266 -#define FLAG_ON 267 -#define FLAG_OFF 268 -#define FULLMAP 269 -#define HELP 270 -#define IMPORT 271 -#define INPUT 272 -#define MAP 273 -#define MESSAGES 274 -#define MODULE 275 -#define MULTIPLE 276 -#define OS_DOMAIN 277 -#define OUTPUT 278 -#define PSEUDOPREEMPTION 279 -#define REENTRANT 280 -#define SCREENNAME 281 -#define SHARELIB 282 -#define STACK 283 -#define START 284 -#define SYNCHRONIZE 285 -#define THREADNAME 286 -#define TYPE 287 -#define VERBOSE 288 -#define VERSIONK 289 -#define XDCDATA 290 -#define STRING 291 -#define QUOTED_STRING 292 - - - - -/* Copy the first part of user declarations. */ -#line 1 "nlmheader.y" -/* nlmheader.y - parse NLM header specification keywords. - Copyright 1993, 1994, 1995, 1997, 1998, 2001, 2002, 2003 - Free Software Foundation, Inc. - -This file is part of 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 2 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. */ - -/* Written by Ian Lance Taylor . - - This bison file parses the commands recognized by the NetWare NLM - linker, except for lists of object files. It stores the - information in global variables. - - This implementation is based on the description in the NetWare Tool - Maker Specification manual, edition 1.0. */ - -#include "ansidecl.h" -#include -#include "safe-ctype.h" -#include "bfd.h" -#include "bucomm.h" -#include "nlm/common.h" -#include "nlm/internal.h" -#include "nlmconv.h" - -/* Information is stored in the structures pointed to by these - variables. */ - -Nlm_Internal_Fixed_Header *fixed_hdr; -Nlm_Internal_Variable_Header *var_hdr; -Nlm_Internal_Version_Header *version_hdr; -Nlm_Internal_Copyright_Header *copyright_hdr; -Nlm_Internal_Extended_Header *extended_hdr; - -/* Procedure named by CHECK. */ -char *check_procedure; -/* File named by CUSTOM. */ -char *custom_file; -/* Whether to generate debugging information (DEBUG). */ -bfd_boolean debug_info; -/* Procedure named by EXIT. */ -char *exit_procedure; -/* Exported symbols (EXPORT). */ -struct string_list *export_symbols; -/* List of files from INPUT. */ -struct string_list *input_files; -/* Map file name (MAP, FULLMAP). */ -char *map_file; -/* Whether a full map has been requested (FULLMAP). */ -bfd_boolean full_map; -/* File named by HELP. */ -char *help_file; -/* Imported symbols (IMPORT). */ -struct string_list *import_symbols; -/* File named by MESSAGES. */ -char *message_file; -/* Autoload module list (MODULE). */ -struct string_list *modules; -/* File named by OUTPUT. */ -char *output_file; -/* File named by SHARELIB. */ -char *sharelib_file; -/* Start procedure name (START). */ -char *start_procedure; -/* VERBOSE. */ -bfd_boolean verbose; -/* RPC description file (XDCDATA). */ -char *rpc_file; - -/* The number of serious errors that have occurred. */ -int parse_errors; - -/* The current symbol prefix when reading a list of import or export - symbols. */ -static char *symbol_prefix; - -/* Parser error message handler. */ -#define yyerror(msg) nlmheader_error (msg); - -/* Local functions. */ -static int yylex (void); -static void nlmlex_file_push (const char *); -static bfd_boolean nlmlex_file_open (const char *); -static int nlmlex_buf_init (void); -static char nlmlex_buf_add (int); -static long nlmlex_get_number (const char *); -static void nlmheader_identify (void); -static void nlmheader_warn (const char *, int); -static void nlmheader_error (const char *); -static struct string_list * string_list_cons (char *, struct string_list *); -static struct string_list * string_list_append (struct string_list *, - struct string_list *); -static struct string_list * string_list_append1 (struct string_list *, - char *); -static char *xstrdup (const char *); - - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 113 "nlmheader.y" -typedef union YYSTYPE { - char *string; - struct string_list *list; -} YYSTYPE; -/* Line 196 of yacc.c. */ -#line 275 "nlmheader.c" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 219 of yacc.c. */ -#line 287 "nlmheader.c" - -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -#if ! defined (yyoverflow) || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# else -# define YYSTACK_ALLOC alloca -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYINCLUDED_STDLIB_H -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) -# endif -# ifdef __cplusplus -extern "C" { -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifdef __cplusplus -} -# endif -# endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ - - -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short int yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short int yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 64 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 73 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 40 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 11 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 52 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 82 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 292 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 38, 39, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const unsigned char yyprhs[] = -{ - 0, 0, 3, 5, 6, 9, 12, 15, 18, 21, - 26, 28, 31, 34, 35, 39, 42, 45, 47, 50, - 53, 54, 58, 61, 63, 66, 69, 72, 74, 76, - 79, 81, 83, 86, 89, 92, 95, 97, 100, 103, - 105, 110, 114, 117, 118, 120, 122, 124, 127, 130, - 134, 136, 137 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yysigned_char yyrhs[] = -{ - 41, 0, -1, 42, -1, -1, 43, 42, -1, 3, - 36, -1, 4, 36, -1, 5, 37, -1, 6, 36, - -1, 7, 36, 36, 36, -1, 8, -1, 9, 37, - -1, 10, 36, -1, -1, 11, 44, 46, -1, 12, - 36, -1, 13, 36, -1, 14, -1, 14, 36, -1, - 15, 36, -1, -1, 16, 45, 46, -1, 17, 50, - -1, 18, -1, 18, 36, -1, 19, 36, -1, 20, - 50, -1, 21, -1, 22, -1, 23, 36, -1, 24, - -1, 25, -1, 26, 37, -1, 27, 36, -1, 28, - 36, -1, 29, 36, -1, 30, -1, 31, 37, -1, - 32, 36, -1, 33, -1, 34, 36, 36, 36, -1, - 34, 36, 36, -1, 35, 36, -1, -1, 47, -1, - 49, -1, 48, -1, 47, 49, -1, 47, 48, -1, - 38, 36, 39, -1, 36, -1, -1, 36, 50, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short int yyrline[] = -{ - 0, 144, 144, 149, 151, 157, 161, 166, 183, 187, - 205, 209, 225, 230, 229, 237, 242, 247, 252, 257, - 262, 261, 269, 273, 277, 281, 285, 289, 293, 297, - 304, 308, 312, 328, 332, 337, 341, 345, 361, 366, - 370, 394, 410, 420, 423, 434, 438, 442, 446, 455, - 466, 483, 486 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "CHECK", "CODESTART", "COPYRIGHT", - "CUSTOM", "DATE", "DEBUG", "DESCRIPTION", "EXIT", "EXPORT", "FLAG_ON", - "FLAG_OFF", "FULLMAP", "HELP", "IMPORT", "INPUT", "MAP", "MESSAGES", - "MODULE", "MULTIPLE", "OS_DOMAIN", "OUTPUT", "PSEUDOPREEMPTION", - "REENTRANT", "SCREENNAME", "SHARELIB", "STACK", "START", "SYNCHRONIZE", - "THREADNAME", "TYPE", "VERBOSE", "VERSIONK", "XDCDATA", "STRING", - "QUOTED_STRING", "'('", "')'", "$accept", "file", "commands", "command", - "@1", "@2", "symbol_list_opt", "symbol_list", "symbol_prefix", "symbol", - "string_list", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const unsigned short int yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 40, 41 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = -{ - 0, 40, 41, 42, 42, 43, 43, 43, 43, 43, - 43, 43, 43, 44, 43, 43, 43, 43, 43, 43, - 45, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 46, 46, 47, 47, 47, 47, 48, - 49, 50, 50 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = -{ - 0, 2, 1, 0, 2, 2, 2, 2, 2, 4, - 1, 2, 2, 0, 3, 2, 2, 1, 2, 2, - 0, 3, 2, 1, 2, 2, 2, 1, 1, 2, - 1, 1, 2, 2, 2, 2, 1, 2, 2, 1, - 4, 3, 2, 0, 1, 1, 1, 2, 2, 3, - 1, 0, 2 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const unsigned char yydefact[] = -{ - 3, 0, 0, 0, 0, 0, 10, 0, 0, 13, - 0, 0, 17, 0, 20, 51, 23, 0, 51, 27, - 28, 0, 30, 31, 0, 0, 0, 0, 36, 0, - 0, 39, 0, 0, 0, 2, 3, 5, 6, 7, - 8, 0, 11, 12, 43, 15, 16, 18, 19, 43, - 51, 22, 24, 25, 26, 29, 32, 33, 34, 35, - 37, 38, 0, 42, 1, 4, 0, 50, 0, 14, - 44, 46, 45, 21, 52, 41, 9, 0, 48, 47, - 40, 49 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yysigned_char yydefgoto[] = -{ - -1, 34, 35, 36, 44, 49, 69, 70, 71, 72, - 51 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -20 -static const yysigned_char yypact[] = -{ - -3, -1, 1, 2, 4, 5, -20, 6, 8, -20, - 9, 10, 11, 12, -20, 13, 14, 16, 13, -20, - -20, 17, -20, -20, 18, 20, 21, 22, -20, 23, - 25, -20, 26, 27, 38, -20, -3, -20, -20, -20, - -20, 28, -20, -20, -2, -20, -20, -20, -20, -2, - 13, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, 30, -20, -20, -20, 31, -20, 32, -20, - -2, -20, -20, -20, -20, 33, -20, 3, -20, -20, - -20, -20 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yysigned_char yypgoto[] = -{ - -20, -20, 34, -20, -20, -20, 24, -20, -19, -16, - 15 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 -static const unsigned char yytable[] = -{ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 54, 67, 37, 68, 38, 64, 39, - 40, 41, 81, 42, 43, 45, 46, 47, 48, 50, - 52, 78, 53, 55, 79, 56, 57, 58, 59, 0, - 60, 61, 62, 63, 66, 74, 75, 76, 77, 80, - 65, 0, 0, 73 -}; - -static const yysigned_char yycheck[] = -{ - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 18, 36, 36, 38, 36, 0, 37, - 36, 36, 39, 37, 36, 36, 36, 36, 36, 36, - 36, 70, 36, 36, 70, 37, 36, 36, 36, -1, - 37, 36, 36, 36, 36, 50, 36, 36, 36, 36, - 36, -1, -1, 49 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const unsigned char yystos[] = -{ - 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 41, 42, 43, 36, 36, 37, - 36, 36, 37, 36, 44, 36, 36, 36, 36, 45, - 36, 50, 36, 36, 50, 36, 37, 36, 36, 36, - 37, 36, 36, 36, 0, 42, 36, 36, 38, 46, - 47, 48, 49, 46, 50, 36, 36, 36, 48, 49, - 36, 39 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (0) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_stack_print (short int *bottom, short int *top) -#else -static void -yy_stack_print (bottom, top) - short int *bottom; - short int *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_reduce_print (int yyrule) -#else -static void -yy_reduce_print (yyrule) - int yyrule; -#endif -{ - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; -} -# endif -# endif - -# ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - size_t yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -#endif /* YYERROR_VERBOSE */ - - - -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - switch (yytype) - { - default: - break; - } - YYFPRINTF (yyoutput, ")"); -} - -#endif /* ! YYDEBUG */ -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM); -# else -int yyparse (); -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int -yyparse (void) -#else -int -yyparse () - ; -#endif -#endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short int yyssa[YYINITDEPTH]; - short int *yyss = yyssa; - short int *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK (yyvsp--, yyssp--) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short int *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - short int *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a look-ahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to look-ahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; - - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 5: -#line 158 "nlmheader.y" - { - check_procedure = (yyvsp[0].string); - } - break; - - case 6: -#line 162 "nlmheader.y" - { - nlmheader_warn (_("CODESTART is not implemented; sorry"), -1); - free ((yyvsp[0].string)); - } - break; - - case 7: -#line 167 "nlmheader.y" - { - int len; - - strncpy (copyright_hdr->stamp, "CoPyRiGhT=", 10); - len = strlen ((yyvsp[0].string)); - if (len >= NLM_MAX_COPYRIGHT_MESSAGE_LENGTH) - { - nlmheader_warn (_("copyright string is too long"), - NLM_MAX_COPYRIGHT_MESSAGE_LENGTH - 1); - len = NLM_MAX_COPYRIGHT_MESSAGE_LENGTH - 1; - } - copyright_hdr->copyrightMessageLength = len; - strncpy (copyright_hdr->copyrightMessage, (yyvsp[0].string), len); - copyright_hdr->copyrightMessage[len] = '\0'; - free ((yyvsp[0].string)); - } - break; - - case 8: -#line 184 "nlmheader.y" - { - custom_file = (yyvsp[0].string); - } - break; - - case 9: -#line 188 "nlmheader.y" - { - /* We don't set the version stamp here, because we use the - version stamp to detect whether the required VERSION - keyword was given. */ - version_hdr->month = nlmlex_get_number ((yyvsp[-2].string)); - version_hdr->day = nlmlex_get_number ((yyvsp[-1].string)); - version_hdr->year = nlmlex_get_number ((yyvsp[0].string)); - free ((yyvsp[-2].string)); - free ((yyvsp[-1].string)); - free ((yyvsp[0].string)); - if (version_hdr->month < 1 || version_hdr->month > 12) - nlmheader_warn (_("illegal month"), -1); - if (version_hdr->day < 1 || version_hdr->day > 31) - nlmheader_warn (_("illegal day"), -1); - if (version_hdr->year < 1900 || version_hdr->year > 3000) - nlmheader_warn (_("illegal year"), -1); - } - break; - - case 10: -#line 206 "nlmheader.y" - { - debug_info = TRUE; - } - break; - - case 11: -#line 210 "nlmheader.y" - { - int len; - - len = strlen ((yyvsp[0].string)); - if (len > NLM_MAX_DESCRIPTION_LENGTH) - { - nlmheader_warn (_("description string is too long"), - NLM_MAX_DESCRIPTION_LENGTH); - len = NLM_MAX_DESCRIPTION_LENGTH; - } - var_hdr->descriptionLength = len; - strncpy (var_hdr->descriptionText, (yyvsp[0].string), len); - var_hdr->descriptionText[len] = '\0'; - free ((yyvsp[0].string)); - } - break; - - case 12: -#line 226 "nlmheader.y" - { - exit_procedure = (yyvsp[0].string); - } - break; - - case 13: -#line 230 "nlmheader.y" - { - symbol_prefix = NULL; - } - break; - - case 14: -#line 234 "nlmheader.y" - { - export_symbols = string_list_append (export_symbols, (yyvsp[0].list)); - } - break; - - case 15: -#line 238 "nlmheader.y" - { - fixed_hdr->flags |= nlmlex_get_number ((yyvsp[0].string)); - free ((yyvsp[0].string)); - } - break; - - case 16: -#line 243 "nlmheader.y" - { - fixed_hdr->flags &=~ nlmlex_get_number ((yyvsp[0].string)); - free ((yyvsp[0].string)); - } - break; - - case 17: -#line 248 "nlmheader.y" - { - map_file = ""; - full_map = TRUE; - } - break; - - case 18: -#line 253 "nlmheader.y" - { - map_file = (yyvsp[0].string); - full_map = TRUE; - } - break; - - case 19: -#line 258 "nlmheader.y" - { - help_file = (yyvsp[0].string); - } - break; - - case 20: -#line 262 "nlmheader.y" - { - symbol_prefix = NULL; - } - break; - - case 21: -#line 266 "nlmheader.y" - { - import_symbols = string_list_append (import_symbols, (yyvsp[0].list)); - } - break; - - case 22: -#line 270 "nlmheader.y" - { - input_files = string_list_append (input_files, (yyvsp[0].list)); - } - break; - - case 23: -#line 274 "nlmheader.y" - { - map_file = ""; - } - break; - - case 24: -#line 278 "nlmheader.y" - { - map_file = (yyvsp[0].string); - } - break; - - case 25: -#line 282 "nlmheader.y" - { - message_file = (yyvsp[0].string); - } - break; - - case 26: -#line 286 "nlmheader.y" - { - modules = string_list_append (modules, (yyvsp[0].list)); - } - break; - - case 27: -#line 290 "nlmheader.y" - { - fixed_hdr->flags |= 0x2; - } - break; - - case 28: -#line 294 "nlmheader.y" - { - fixed_hdr->flags |= 0x10; - } - break; - - case 29: -#line 298 "nlmheader.y" - { - if (output_file == NULL) - output_file = (yyvsp[0].string); - else - nlmheader_warn (_("ignoring duplicate OUTPUT statement"), -1); - } - break; - - case 30: -#line 305 "nlmheader.y" - { - fixed_hdr->flags |= 0x8; - } - break; - - case 31: -#line 309 "nlmheader.y" - { - fixed_hdr->flags |= 0x1; - } - break; - - case 32: -#line 313 "nlmheader.y" - { - int len; - - len = strlen ((yyvsp[0].string)); - if (len >= NLM_MAX_SCREEN_NAME_LENGTH) - { - nlmheader_warn (_("screen name is too long"), - NLM_MAX_SCREEN_NAME_LENGTH); - len = NLM_MAX_SCREEN_NAME_LENGTH; - } - var_hdr->screenNameLength = len; - strncpy (var_hdr->screenName, (yyvsp[0].string), len); - var_hdr->screenName[NLM_MAX_SCREEN_NAME_LENGTH] = '\0'; - free ((yyvsp[0].string)); - } - break; - - case 33: -#line 329 "nlmheader.y" - { - sharelib_file = (yyvsp[0].string); - } - break; - - case 34: -#line 333 "nlmheader.y" - { - var_hdr->stackSize = nlmlex_get_number ((yyvsp[0].string)); - free ((yyvsp[0].string)); - } - break; - - case 35: -#line 338 "nlmheader.y" - { - start_procedure = (yyvsp[0].string); - } - break; - - case 36: -#line 342 "nlmheader.y" - { - fixed_hdr->flags |= 0x4; - } - break; - - case 37: -#line 346 "nlmheader.y" - { - int len; - - len = strlen ((yyvsp[0].string)); - if (len >= NLM_MAX_THREAD_NAME_LENGTH) - { - nlmheader_warn (_("thread name is too long"), - NLM_MAX_THREAD_NAME_LENGTH); - len = NLM_MAX_THREAD_NAME_LENGTH; - } - var_hdr->threadNameLength = len; - strncpy (var_hdr->threadName, (yyvsp[0].string), len); - var_hdr->threadName[len] = '\0'; - free ((yyvsp[0].string)); - } - break; - - case 38: -#line 362 "nlmheader.y" - { - fixed_hdr->moduleType = nlmlex_get_number ((yyvsp[0].string)); - free ((yyvsp[0].string)); - } - break; - - case 39: -#line 367 "nlmheader.y" - { - verbose = TRUE; - } - break; - - case 40: -#line 371 "nlmheader.y" - { - long val; - - strncpy (version_hdr->stamp, "VeRsIoN#", 8); - version_hdr->majorVersion = nlmlex_get_number ((yyvsp[-2].string)); - val = nlmlex_get_number ((yyvsp[-1].string)); - if (val < 0 || val > 99) - nlmheader_warn (_("illegal minor version number (must be between 0 and 99)"), - -1); - else - version_hdr->minorVersion = val; - val = nlmlex_get_number ((yyvsp[0].string)); - if (val < 0) - nlmheader_warn (_("illegal revision number (must be between 0 and 26)"), - -1); - else if (val > 26) - version_hdr->revision = 0; - else - version_hdr->revision = val; - free ((yyvsp[-2].string)); - free ((yyvsp[-1].string)); - free ((yyvsp[0].string)); - } - break; - - case 41: -#line 395 "nlmheader.y" - { - long val; - - strncpy (version_hdr->stamp, "VeRsIoN#", 8); - version_hdr->majorVersion = nlmlex_get_number ((yyvsp[-1].string)); - val = nlmlex_get_number ((yyvsp[0].string)); - if (val < 0 || val > 99) - nlmheader_warn (_("illegal minor version number (must be between 0 and 99)"), - -1); - else - version_hdr->minorVersion = val; - version_hdr->revision = 0; - free ((yyvsp[-1].string)); - free ((yyvsp[0].string)); - } - break; - - case 42: -#line 411 "nlmheader.y" - { - rpc_file = (yyvsp[0].string); - } - break; - - case 43: -#line 420 "nlmheader.y" - { - (yyval.list) = NULL; - } - break; - - case 44: -#line 424 "nlmheader.y" - { - (yyval.list) = (yyvsp[0].list); - } - break; - - case 45: -#line 435 "nlmheader.y" - { - (yyval.list) = string_list_cons ((yyvsp[0].string), NULL); - } - break; - - case 46: -#line 439 "nlmheader.y" - { - (yyval.list) = NULL; - } - break; - - case 47: -#line 443 "nlmheader.y" - { - (yyval.list) = string_list_append1 ((yyvsp[-1].list), (yyvsp[0].string)); - } - break; - - case 48: -#line 447 "nlmheader.y" - { - (yyval.list) = (yyvsp[-1].list); - } - break; - - case 49: -#line 456 "nlmheader.y" - { - if (symbol_prefix != NULL) - free (symbol_prefix); - symbol_prefix = (yyvsp[-1].string); - } - break; - - case 50: -#line 467 "nlmheader.y" - { - if (symbol_prefix == NULL) - (yyval.string) = (yyvsp[0].string); - else - { - (yyval.string) = xmalloc (strlen (symbol_prefix) + strlen ((yyvsp[0].string)) + 2); - sprintf ((yyval.string), "%s@%s", symbol_prefix, (yyvsp[0].string)); - free ((yyvsp[0].string)); - } - } - break; - - case 51: -#line 483 "nlmheader.y" - { - (yyval.list) = NULL; - } - break; - - case 52: -#line 487 "nlmheader.y" - { - (yyval.list) = string_list_cons ((yyvsp[-1].string), (yyvsp[0].list)); - } - break; - - - default: break; - } - -/* Line 1126 of yacc.c. */ -#line 1797 "nlmheader.c" - - yyvsp -= yylen; - yyssp -= yylen; - - - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - char *yymsg = 0; -# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -#if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -#endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - - if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yymsg; - int yyi = 0; - while ((*yyp = *yyf)) - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - { - yyerror (YY_("syntax error")); - goto yyexhaustedlab; - } - } - else -#endif /* YYERROR_VERBOSE */ - yyerror (YY_("syntax error")); - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (0) - goto yyerrorlab; - -yyvsp -= yylen; - yyssp -= yylen; - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK; - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK; - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif - return yyresult; -} - - -#line 492 "nlmheader.y" - - -/* If strerror is just a macro, we want to use the one from libiberty - since it will handle undefined values. */ -#undef strerror -extern char *strerror PARAMS ((int)); - -/* The lexer is simple, too simple for flex. Keywords are only - recognized at the start of lines. Everything else must be an - argument. A comma is treated as whitespace. */ - -/* The states the lexer can be in. */ - -enum lex_state -{ - /* At the beginning of a line. */ - BEGINNING_OF_LINE, - /* In the middle of a line. */ - IN_LINE -}; - -/* We need to keep a stack of files to handle file inclusion. */ - -struct input -{ - /* The file to read from. */ - FILE *file; - /* The name of the file. */ - char *name; - /* The current line number. */ - int lineno; - /* The current state. */ - enum lex_state state; - /* The next file on the stack. */ - struct input *next; -}; - -/* The current input file. */ - -static struct input current; - -/* The character which introduces comments. */ -#define COMMENT_CHAR '#' - -/* Start the lexer going on the main input file. */ - -bfd_boolean -nlmlex_file (const char *name) -{ - current.next = NULL; - return nlmlex_file_open (name); -} - -/* Start the lexer going on a subsidiary input file. */ - -static void -nlmlex_file_push (const char *name) -{ - struct input *push; - - push = (struct input *) xmalloc (sizeof (struct input)); - *push = current; - if (nlmlex_file_open (name)) - current.next = push; - else - { - current = *push; - free (push); - } -} - -/* Start lexing from a file. */ - -static bfd_boolean -nlmlex_file_open (const char *name) -{ - current.file = fopen (name, "r"); - if (current.file == NULL) - { - fprintf (stderr, "%s:%s: %s\n", program_name, name, strerror (errno)); - ++parse_errors; - return FALSE; - } - current.name = xstrdup (name); - current.lineno = 1; - current.state = BEGINNING_OF_LINE; - return TRUE; -} - -/* Table used to turn keywords into tokens. */ - -struct keyword_tokens_struct -{ - const char *keyword; - int token; -}; - -static struct keyword_tokens_struct keyword_tokens[] = -{ - { "CHECK", CHECK }, - { "CODESTART", CODESTART }, - { "COPYRIGHT", COPYRIGHT }, - { "CUSTOM", CUSTOM }, - { "DATE", DATE }, - { "DEBUG", DEBUG }, - { "DESCRIPTION", DESCRIPTION }, - { "EXIT", EXIT }, - { "EXPORT", EXPORT }, - { "FLAG_ON", FLAG_ON }, - { "FLAG_OFF", FLAG_OFF }, - { "FULLMAP", FULLMAP }, - { "HELP", HELP }, - { "IMPORT", IMPORT }, - { "INPUT", INPUT }, - { "MAP", MAP }, - { "MESSAGES", MESSAGES }, - { "MODULE", MODULE }, - { "MULTIPLE", MULTIPLE }, - { "OS_DOMAIN", OS_DOMAIN }, - { "OUTPUT", OUTPUT }, - { "PSEUDOPREEMPTION", PSEUDOPREEMPTION }, - { "REENTRANT", REENTRANT }, - { "SCREENNAME", SCREENNAME }, - { "SHARELIB", SHARELIB }, - { "STACK", STACK }, - { "STACKSIZE", STACK }, - { "START", START }, - { "SYNCHRONIZE", SYNCHRONIZE }, - { "THREADNAME", THREADNAME }, - { "TYPE", TYPE }, - { "VERBOSE", VERBOSE }, - { "VERSION", VERSIONK }, - { "XDCDATA", XDCDATA } -}; - -#define KEYWORD_COUNT (sizeof (keyword_tokens) / sizeof (keyword_tokens[0])) - -/* The lexer accumulates strings in these variables. */ -static char *lex_buf; -static int lex_size; -static int lex_pos; - -/* Start accumulating strings into the buffer. */ -#define BUF_INIT() \ - ((void) (lex_buf != NULL ? lex_pos = 0 : nlmlex_buf_init ())) - -static int -nlmlex_buf_init (void) -{ - lex_size = 10; - lex_buf = xmalloc (lex_size + 1); - lex_pos = 0; - return 0; -} - -/* Finish a string in the buffer. */ -#define BUF_FINISH() ((void) (lex_buf[lex_pos] = '\0')) - -/* Accumulate a character into the buffer. */ -#define BUF_ADD(c) \ - ((void) (lex_pos < lex_size \ - ? lex_buf[lex_pos++] = (c) \ - : nlmlex_buf_add (c))) - -static char -nlmlex_buf_add (int c) -{ - if (lex_pos >= lex_size) - { - lex_size *= 2; - lex_buf = xrealloc (lex_buf, lex_size + 1); - } - - return lex_buf[lex_pos++] = c; -} - -/* The lexer proper. This is called by the bison generated parsing - code. */ - -static int -yylex (void) -{ - int c; - -tail_recurse: - - c = getc (current.file); - - /* Commas are treated as whitespace characters. */ - while (ISSPACE (c) || c == ',') - { - current.state = IN_LINE; - if (c == '\n') - { - ++current.lineno; - current.state = BEGINNING_OF_LINE; - } - c = getc (current.file); - } - - /* At the end of the file we either pop to the previous file or - finish up. */ - if (c == EOF) - { - fclose (current.file); - free (current.name); - if (current.next == NULL) - return 0; - else - { - struct input *next; - - next = current.next; - current = *next; - free (next); - goto tail_recurse; - } - } - - /* A comment character always means to drop everything until the - next newline. */ - if (c == COMMENT_CHAR) - { - do - { - c = getc (current.file); - } - while (c != '\n'); - ++current.lineno; - current.state = BEGINNING_OF_LINE; - goto tail_recurse; - } - - /* An '@' introduces an include file. */ - if (c == '@') - { - do - { - c = getc (current.file); - if (c == '\n') - ++current.lineno; - } - while (ISSPACE (c)); - BUF_INIT (); - while (! ISSPACE (c) && c != EOF) - { - BUF_ADD (c); - c = getc (current.file); - } - BUF_FINISH (); - - ungetc (c, current.file); - - nlmlex_file_push (lex_buf); - goto tail_recurse; - } - - /* A non-space character at the start of a line must be the start of - a keyword. */ - if (current.state == BEGINNING_OF_LINE) - { - BUF_INIT (); - while (ISALNUM (c) || c == '_') - { - BUF_ADD (TOUPPER (c)); - c = getc (current.file); - } - BUF_FINISH (); - - if (c != EOF && ! ISSPACE (c) && c != ',') - { - nlmheader_identify (); - fprintf (stderr, _("%s:%d: illegal character in keyword: %c\n"), - current.name, current.lineno, c); - } - else - { - unsigned int i; - - for (i = 0; i < KEYWORD_COUNT; i++) - { - if (lex_buf[0] == keyword_tokens[i].keyword[0] - && strcmp (lex_buf, keyword_tokens[i].keyword) == 0) - { - /* Pushing back the final whitespace avoids worrying - about \n here. */ - ungetc (c, current.file); - current.state = IN_LINE; - return keyword_tokens[i].token; - } - } - - nlmheader_identify (); - fprintf (stderr, _("%s:%d: unrecognized keyword: %s\n"), - current.name, current.lineno, lex_buf); - } - - ++parse_errors; - /* Treat the rest of this line as a comment. */ - ungetc (COMMENT_CHAR, current.file); - goto tail_recurse; - } - - /* Parentheses just represent themselves. */ - if (c == '(' || c == ')') - return c; - - /* Handle quoted strings. */ - if (c == '"' || c == '\'') - { - int quote; - int start_lineno; - - quote = c; - start_lineno = current.lineno; - - c = getc (current.file); - BUF_INIT (); - while (c != quote && c != EOF) - { - BUF_ADD (c); - if (c == '\n') - ++current.lineno; - c = getc (current.file); - } - BUF_FINISH (); - - if (c == EOF) - { - nlmheader_identify (); - fprintf (stderr, _("%s:%d: end of file in quoted string\n"), - current.name, start_lineno); - ++parse_errors; - } - - /* FIXME: Possible memory leak. */ - yylval.string = xstrdup (lex_buf); - return QUOTED_STRING; - } - - /* Gather a generic argument. */ - BUF_INIT (); - while (! ISSPACE (c) - && c != ',' - && c != COMMENT_CHAR - && c != '(' - && c != ')') - { - BUF_ADD (c); - c = getc (current.file); - } - BUF_FINISH (); - - ungetc (c, current.file); - - /* FIXME: Possible memory leak. */ - yylval.string = xstrdup (lex_buf); - return STRING; -} - -/* Get a number from a string. */ - -static long -nlmlex_get_number (const char *s) -{ - long ret; - char *send; - - ret = strtol (s, &send, 10); - if (*send != '\0') - nlmheader_warn (_("bad number"), -1); - return ret; -} - -/* Prefix the nlmconv warnings with a note as to where they come from. - We don't use program_name on every warning, because then some - versions of the emacs next-error function can't recognize the line - number. */ - -static void -nlmheader_identify (void) -{ - static int done; - - if (! done) - { - fprintf (stderr, _("%s: problems in NLM command language input:\n"), - program_name); - done = 1; - } -} - -/* Issue a warning. */ - -static void -nlmheader_warn (const char *s, int imax) -{ - nlmheader_identify (); - fprintf (stderr, "%s:%d: %s", current.name, current.lineno, s); - if (imax != -1) - fprintf (stderr, " (max %d)", imax); - fprintf (stderr, "\n"); -} - -/* Report an error. */ - -static void -nlmheader_error (const char *s) -{ - nlmheader_warn (s, -1); - ++parse_errors; -} - -/* Add a string to a string list. */ - -static struct string_list * -string_list_cons (char *s, struct string_list *l) -{ - struct string_list *ret; - - ret = (struct string_list *) xmalloc (sizeof (struct string_list)); - ret->next = l; - ret->string = s; - return ret; -} - -/* Append a string list to another string list. */ - -static struct string_list * -string_list_append (struct string_list *l1, struct string_list *l2) -{ - register struct string_list **pp; - - for (pp = &l1; *pp != NULL; pp = &(*pp)->next) - ; - *pp = l2; - return l1; -} - -/* Append a string to a string list. */ - -static struct string_list * -string_list_append1 (struct string_list *l, char *s) -{ - struct string_list *n; - register struct string_list **pp; - - n = (struct string_list *) xmalloc (sizeof (struct string_list)); - n->next = NULL; - n->string = s; - for (pp = &l; *pp != NULL; pp = &(*pp)->next) - ; - *pp = n; - return l; -} - -/* Duplicate a string in memory. */ - -static char * -xstrdup (const char *s) -{ - unsigned long len; - char *ret; - - len = strlen (s); - ret = xmalloc (len + 1); - strcpy (ret, s); - return ret; -} - diff --git a/binutils/nlmheader.h b/binutils/nlmheader.h deleted file mode 100644 index 42ca39afc10..00000000000 --- a/binutils/nlmheader.h +++ /dev/null @@ -1,125 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - 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 2, 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. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - CHECK = 258, - CODESTART = 259, - COPYRIGHT = 260, - CUSTOM = 261, - DATE = 262, - DEBUG = 263, - DESCRIPTION = 264, - EXIT = 265, - EXPORT = 266, - FLAG_ON = 267, - FLAG_OFF = 268, - FULLMAP = 269, - HELP = 270, - IMPORT = 271, - INPUT = 272, - MAP = 273, - MESSAGES = 274, - MODULE = 275, - MULTIPLE = 276, - OS_DOMAIN = 277, - OUTPUT = 278, - PSEUDOPREEMPTION = 279, - REENTRANT = 280, - SCREENNAME = 281, - SHARELIB = 282, - STACK = 283, - START = 284, - SYNCHRONIZE = 285, - THREADNAME = 286, - TYPE = 287, - VERBOSE = 288, - VERSIONK = 289, - XDCDATA = 290, - STRING = 291, - QUOTED_STRING = 292 - }; -#endif -/* Tokens. */ -#define CHECK 258 -#define CODESTART 259 -#define COPYRIGHT 260 -#define CUSTOM 261 -#define DATE 262 -#define DEBUG 263 -#define DESCRIPTION 264 -#define EXIT 265 -#define EXPORT 266 -#define FLAG_ON 267 -#define FLAG_OFF 268 -#define FULLMAP 269 -#define HELP 270 -#define IMPORT 271 -#define INPUT 272 -#define MAP 273 -#define MESSAGES 274 -#define MODULE 275 -#define MULTIPLE 276 -#define OS_DOMAIN 277 -#define OUTPUT 278 -#define PSEUDOPREEMPTION 279 -#define REENTRANT 280 -#define SCREENNAME 281 -#define SHARELIB 282 -#define STACK 283 -#define START 284 -#define SYNCHRONIZE 285 -#define THREADNAME 286 -#define TYPE 287 -#define VERBOSE 288 -#define VERSIONK 289 -#define XDCDATA 290 -#define STRING 291 -#define QUOTED_STRING 292 - - - - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 113 "nlmheader.y" -typedef union YYSTYPE { - char *string; - struct string_list *list; -} YYSTYPE; -/* Line 1447 of yacc.c. */ -#line 117 "nlmheader.h" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE yylval; - - - diff --git a/binutils/nlmheader.y b/binutils/nlmheader.y index b79d63ad91e..192aafa3fb9 100644 --- a/binutils/nlmheader.y +++ b/binutils/nlmheader.y @@ -1,5 +1,5 @@ %{/* nlmheader.y - parse NLM header specification keywords. - Copyright 1993, 1994, 1995, 1997, 1998, 2001, 2002, 2003 + Copyright 1993, 1994, 1995, 1997, 1998, 2001, 2002, 2003, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -27,13 +27,12 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. This implementation is based on the description in the NetWare Tool Maker Specification manual, edition 1.0. */ -#include "ansidecl.h" -#include +#include "sysdep.h" #include "safe-ctype.h" #include "bfd.h" -#include "bucomm.h" #include "nlm/common.h" #include "nlm/internal.h" +#include "bucomm.h" #include "nlmconv.h" /* Information is stored in the structures pointed to by these diff --git a/binutils/nm.c b/binutils/nm.c index c1fb4d803e8..62328a4d54e 100644 --- a/binutils/nm.c +++ b/binutils/nm.c @@ -1,6 +1,6 @@ /* nm.c -- Describe symbol table of a rel file. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005 + 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -20,10 +20,9 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "sysdep.h" #include "bfd.h" #include "progress.h" -#include "bucomm.h" -#include "budemang.h" #include "getopt.h" #include "aout/stab_gnu.h" #include "aout/ranlib.h" @@ -31,6 +30,7 @@ #include "libiberty.h" #include "elf-bfd.h" #include "elf/common.h" +#include "bucomm.h" /* When sorting by size, we use this structure to hold the size and a pointer to the minisymbol. */ @@ -159,20 +159,9 @@ static int filename_per_file = 0; /* Once per file, on its own line. */ static int filename_per_symbol = 0; /* Once per symbol, at start of line. */ /* Print formats for printing a symbol value. */ -#ifndef BFD64 -static char value_format[] = "%08lx"; -#else -#if BFD_HOST_64BIT_LONG -static char value_format[] = "%016lx"; -#else -/* We don't use value_format for this case. */ -#endif -#endif -#ifdef BFD64 -static int print_width = 16; -#else -static int print_width = 8; -#endif +static char value_format_32bit[] = "%08lx"; +static char value_format_64bit[] = "%016lx"; +static int print_width = 0; static int print_radix = 16; /* Print formats for printing stab info. */ static char other_format[] = "%02x"; @@ -259,7 +248,7 @@ usage (FILE *stream, int status) -V, --version Display this program's version number\n\ \n")); list_supported_targets (program_name, stream); - if (status == 0) + if (REPORT_BUGS_TO[0] && status == 0) fprintf (stream, _("Report bugs to %s.\n"), REPORT_BUGS_TO); exit (status); } @@ -279,16 +268,8 @@ set_print_radix (char *radix) print_radix = 10; else print_radix = 8; -#ifndef BFD64 - value_format[4] = *radix; -#else -#if BFD_HOST_64BIT_LONG - value_format[5] = *radix; -#else - /* This case requires special handling for octal and decimal - printing. */ -#endif -#endif + value_format_32bit[4] = *radix; + value_format_64bit[5] = *radix; other_format[3] = desc_format[3] = *radix; break; default: @@ -354,11 +335,14 @@ print_symname (const char *format, const char *name, bfd *abfd) { if (do_demangle && *name) { - char *res = demangle (abfd, name); + char *res = bfd_demangle (abfd, name, DMGL_ANSI | DMGL_PARAMS); - printf (format, res); - free (res); - return; + if (res != NULL) + { + printf (format, res); + free (res); + return; + } } printf (format, name); @@ -1093,6 +1077,26 @@ display_rel_file (bfd *abfd, bfd *archive_bfd) free (minisyms); } +static void +set_print_width (bfd *file) +{ + print_width = bfd_get_arch_size (file); + + if (print_width == -1) + { + /* PR binutils/4292 + Guess the target's bitsize based on its name. + We assume here than any 64-bit format will include + "64" somewhere in its name. The only known exception + is the MMO object file format. */ + if (strstr (bfd_get_target (file), "64") != NULL + || strcmp (bfd_get_target (file), "mmo") == 0) + print_width = 64; + else + print_width = 32; + } +} + static void display_archive (bfd *file) { @@ -1120,10 +1124,7 @@ display_archive (bfd *file) if (bfd_check_format_matches (arfile, bfd_object, &matching)) { - char buf[30]; - - bfd_sprintf_vma (arfile, buf, (bfd_vma) -1); - print_width = strlen (buf); + set_print_width (arfile); format->print_archive_member (bfd_get_filename (file), bfd_get_filename (arfile)); display_rel_file (arfile, file); @@ -1178,10 +1179,7 @@ display_file (char *filename) } else if (bfd_check_format_matches (file, bfd_object, &matching)) { - char buf[30]; - - bfd_sprintf_vma (file, buf, (bfd_vma) -1); - print_width = strlen (buf); + set_print_width (file); format->print_object_filename (filename); display_rel_file (file, NULL); } @@ -1227,7 +1225,7 @@ print_object_filename_sysv (char *filename) printf (_("\n\nUndefined symbols from %s:\n\n"), filename); else printf (_("\n\nSymbols from %s:\n\n"), filename); - if (print_width == 8) + if (print_width == 32) printf (_("\ Name Value Class Type Size Line Section\n\n")); else @@ -1278,7 +1276,7 @@ print_archive_member_sysv (char *archive, const char *filename) printf (_("\n\nUndefined symbols from %s[%s]:\n\n"), archive, filename); else printf (_("\n\nSymbols from %s[%s]:\n\n"), archive, filename); - if (print_width == 8) + if (print_width == 32) printf (_("\ Name Value Class Type Size Line Section\n\n")); else @@ -1336,29 +1334,42 @@ print_symbol_filename_posix (bfd *archive_bfd, bfd *abfd) static void print_value (bfd *abfd ATTRIBUTE_UNUSED, bfd_vma val) { -#if ! defined (BFD64) || BFD_HOST_64BIT_LONG - printf (value_format, val); -#else - /* We have a 64 bit value to print, but the host is only 32 bit. */ - if (print_radix == 16) - bfd_fprintf_vma (abfd, stdout, val); - else + switch (print_width) { - char buf[30]; - char *s; + case 32: + printf (value_format_32bit, (unsigned long) val); + break; - s = buf + sizeof buf; - *--s = '\0'; - while (val > 0) + case 64: +#if BFD_HOST_64BIT_LONG + printf (value_format_64bit, val); +#else + /* We have a 64 bit value to print, but the host is only 32 bit. */ + if (print_radix == 16) + bfd_fprintf_vma (abfd, stdout, val); + else { - *--s = (val % print_radix) + '0'; - val /= print_radix; + char buf[30]; + char *s; + + s = buf + sizeof buf; + *--s = '\0'; + while (val > 0) + { + *--s = (val % print_radix) + '0'; + val /= print_radix; + } + while ((buf + sizeof buf - 1) - s < 16) + *--s = '0'; + printf ("%s", s); } - while ((buf + sizeof buf - 1) - s < 16) - *--s = '0'; - printf ("%s", s); - } #endif + break; + + default: + fatal (_("Print width has not been initialized (%d)"), print_width); + break; + } } /* Print a line of information about a symbol. */ @@ -1368,7 +1379,7 @@ print_symbol_info_bsd (struct extended_symbol_info *info, bfd *abfd) { if (bfd_is_undefined_symclass (SYM_TYPE (info))) { - if (print_width == 16) + if (print_width == 64) printf (" "); printf (" "); } @@ -1411,7 +1422,7 @@ print_symbol_info_sysv (struct extended_symbol_info *info, bfd *abfd) if (bfd_is_undefined_symclass (SYM_TYPE (info))) { - if (print_width == 8) + if (print_width == 32) printf (" "); else printf (" "); @@ -1441,7 +1452,7 @@ print_symbol_info_sysv (struct extended_symbol_info *info, bfd *abfd) print_value (abfd, SYM_SIZE (info)); else { - if (print_width == 8) + if (print_width == 32) printf (" "); else printf (" "); diff --git a/binutils/objcopy.c b/binutils/objcopy.c index 0e0cfaaccf5..06e2946ce34 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -1,6 +1,6 @@ /* objcopy.c -- copy object file from input to output, optionally massaging it. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2006 + 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -20,11 +20,12 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "sysdep.h" #include "bfd.h" #include "progress.h" -#include "bucomm.h" #include "getopt.h" #include "libiberty.h" +#include "bucomm.h" #include "budbg.h" #include "filenames.h" #include "fnmatch.h" @@ -190,6 +191,9 @@ static bfd_boolean remove_leading_char = FALSE; /* Whether to permit wildcard in symbol comparison. */ static bfd_boolean wildcard = FALSE; +/* True if --localize-hidden is in effect. */ +static bfd_boolean localize_hidden = FALSE; + /* List of symbols to strip, keep, localize, keep-global, weaken, or redefine. */ static struct symlist *strip_specific_list = NULL; @@ -212,6 +216,14 @@ static char *prefix_symbols_string = 0; static char *prefix_sections_string = 0; static char *prefix_alloc_sections_string = 0; +/* True if --extract-symbol was passed on the command line. */ +static bfd_boolean extract_symbol = FALSE; + +/* If `reverse_bytes' is nonzero, then reverse the order of every chunk + of bytes within each output section. */ +static int reverse_bytes = 0; + + /* 150 isn't special; it's just an arbitrary non-ASCII char value. */ enum command_line_switch { @@ -240,6 +252,7 @@ enum command_line_switch OPTION_STRIP_UNNEEDED_SYMBOL, OPTION_STRIP_UNNEEDED_SYMBOLS, OPTION_KEEP_SYMBOLS, + OPTION_LOCALIZE_HIDDEN, OPTION_LOCALIZE_SYMBOLS, OPTION_GLOBALIZE_SYMBOL, OPTION_GLOBALIZE_SYMBOLS, @@ -257,7 +270,9 @@ enum command_line_switch OPTION_READONLY_TEXT, OPTION_WRITABLE_TEXT, OPTION_PURE, - OPTION_IMPURE + OPTION_IMPURE, + OPTION_EXTRACT_SYMBOL, + OPTION_REVERSE_BYTES }; /* Options to handle if running as "strip". */ @@ -313,6 +328,7 @@ static struct option copy_options[] = {"debugging", no_argument, 0, OPTION_DEBUGGING}, {"discard-all", no_argument, 0, 'x'}, {"discard-locals", no_argument, 0, 'X'}, + {"extract-symbol", no_argument, 0, OPTION_EXTRACT_SYMBOL}, {"format", required_argument, 0, 'F'}, /* Obsolete */ {"gap-fill", required_argument, 0, OPTION_GAP_FILL}, {"globalize-symbol", required_argument, 0, OPTION_GLOBALIZE_SYMBOL}, @@ -328,6 +344,7 @@ static struct option copy_options[] = {"keep-global-symbols", required_argument, 0, OPTION_KEEPGLOBAL_SYMBOLS}, {"keep-symbol", required_argument, 0, 'K'}, {"keep-symbols", required_argument, 0, OPTION_KEEP_SYMBOLS}, + {"localize-hidden", no_argument, 0, OPTION_LOCALIZE_HIDDEN}, {"localize-symbol", required_argument, 0, 'L'}, {"localize-symbols", required_argument, 0, OPTION_LOCALIZE_SYMBOLS}, {"no-adjust-warnings", no_argument, 0, OPTION_NO_CHANGE_WARNINGS}, @@ -348,6 +365,7 @@ static struct option copy_options[] = {"remove-leading-char", no_argument, 0, OPTION_REMOVE_LEADING_CHAR}, {"remove-section", required_argument, 0, 'R'}, {"rename-section", required_argument, 0, OPTION_RENAME_SECTION}, + {"reverse-bytes", required_argument, 0, OPTION_REVERSE_BYTES}, {"set-section-flags", required_argument, 0, OPTION_SET_SECTION_FLAGS}, {"set-start", required_argument, 0, OPTION_SET_START}, {"srec-len", required_argument, 0, OPTION_SREC_LEN}, @@ -426,8 +444,10 @@ copy_usage (FILE *stream, int exit_status) Do not copy symbol unless needed by\n\ relocations\n\ --only-keep-debug Strip everything but the debug information\n\ + --extract-symbol Remove section contents but keep symbols\n\ -K --keep-symbol Do not strip symbol \n\ --keep-file-symbols Do not strip file symbol(s)\n\ + --localize-hidden Turn all ELF hidden symbols into locals\n\ -L --localize-symbol Force symbol to be marked as a local\n\ --globalize-symbol Force symbol to be marked as a global\n\ -G --keep-global-symbol Localize all symbols except \n\ @@ -459,6 +479,7 @@ copy_usage (FILE *stream, int exit_status) --rename-section =[,] Rename section to \n\ --change-leading-char Force output format's leading character style\n\ --remove-leading-char Remove leading character from global symbols\n\ + --reverse-bytes= Reverse bytes at a time, in output sections with content\n\ --redefine-sym = Redefine symbol name to \n\ --redefine-syms --redefine-sym for all symbol pairs \n\ listed in \n\ @@ -490,7 +511,7 @@ copy_usage (FILE *stream, int exit_status) --info List object formats & architectures supported\n\ ")); list_supported_targets (program_name, stream); - if (exit_status == 0) + if (REPORT_BUGS_TO[0] && exit_status == 0) fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (exit_status); } @@ -525,7 +546,7 @@ strip_usage (FILE *stream, int exit_status) ")); list_supported_targets (program_name, stream); - if (exit_status == 0) + if (REPORT_BUGS_TO[0] && exit_status == 0) fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (exit_status); } @@ -647,7 +668,10 @@ add_specific_symbols (const char *filename, struct symlist **list) size = get_file_size (filename); if (size == 0) - return; + { + status = 1; + return; + } buffer = xmalloc (size + 2); f = fopen (filename, FOPEN_RT); @@ -776,6 +800,30 @@ is_specified_symbol (const char *name, struct symlist *list) return FALSE; } +/* Return a pointer to the symbol used as a signature for GROUP. */ + +static asymbol * +group_signature (asection *group) +{ + bfd *abfd = group->owner; + Elf_Internal_Shdr *ghdr; + + if (bfd_get_flavour (abfd) != bfd_target_elf_flavour) + return NULL; + + ghdr = &elf_section_data (group)->this_hdr; + if (ghdr->sh_link < elf_numsections (abfd)) + { + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + Elf_Internal_Shdr *symhdr = elf_elfsections (abfd) [ghdr->sh_link]; + + if (symhdr->sh_type == SHT_SYMTAB + && ghdr->sh_info < symhdr->sh_size / bed->s->sizeof_sym) + return isympp[ghdr->sh_info - 1]; + } + return NULL; +} + /* See if a section is being removed. */ static bfd_boolean @@ -806,6 +854,49 @@ is_strip_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec) return FALSE; } + if ((bfd_get_section_flags (abfd, sec) & SEC_GROUP) != 0) + { + asymbol *gsym; + const char *gname; + + /* PR binutils/3166 + Group sections look like debugging sections but they are not. + (They have a non-zero size but they are not ALLOCated). */ + if (strip_symbols == STRIP_NONDEBUG) + return TRUE; + + /* PR binutils/3181 + If we are going to strip the group signature symbol, then + strip the group section too. */ + gsym = group_signature (sec); + if (gsym != NULL) + gname = gsym->name; + else + gname = sec->name; + if ((strip_symbols == STRIP_ALL + && !is_specified_symbol (gname, keep_specific_list)) + || is_specified_symbol (gname, strip_specific_list)) + return TRUE; + } + + return FALSE; +} + +/* Return true if SYM is a hidden symbol. */ + +static bfd_boolean +is_hidden_symbol (asymbol *sym) +{ + elf_symbol_type *elf_sym; + + elf_sym = elf_symbol_from (sym->the_bfd, sym); + if (elf_sym != NULL) + switch (ELF_ST_VISIBILITY (elf_sym->internal_elf_sym.st_other)) + { + case STV_HIDDEN: + case STV_INTERNAL: + return TRUE; + } return FALSE; } @@ -819,15 +910,15 @@ filter_symbols (bfd *abfd, bfd *obfd, asymbol **osyms, { asymbol **from = isyms, **to = osyms; long src_count = 0, dst_count = 0; - int relocatable = (abfd->flags & (HAS_RELOC | EXEC_P | DYNAMIC)) - == HAS_RELOC; + int relocatable = (abfd->flags & (EXEC_P | DYNAMIC)) == 0; for (; src_count < symcount; src_count++) { asymbol *sym = from[src_count]; flagword flags = sym->flags; char *name = (char *) bfd_asymbol_name (sym); - int keep; + bfd_boolean keep; + bfd_boolean used_in_reloc = FALSE; bfd_boolean undefined; bfd_boolean rem_leading_char; bfd_boolean add_leading_char; @@ -895,21 +986,24 @@ filter_symbols (bfd *abfd, bfd *obfd, asymbol **osyms, } if (strip_symbols == STRIP_ALL) - keep = 0; + keep = FALSE; else if ((flags & BSF_KEEP) != 0 /* Used in relocation. */ || ((flags & BSF_SECTION_SYM) != 0 && ((*bfd_get_section (sym)->symbol_ptr_ptr)->flags & BSF_KEEP) != 0)) - keep = 1; + { + keep = TRUE; + used_in_reloc = TRUE; + } else if (relocatable /* Relocatable file. */ && (flags & (BSF_GLOBAL | BSF_WEAK)) != 0) - keep = 1; + keep = TRUE; else if (bfd_decode_symclass (sym) == 'I') /* Global symbols in $idata sections need to be retained even if relocatable is FALSE. External users of the library containing the $idata section may reference these symbols. */ - keep = 1; + keep = TRUE; else if ((flags & BSF_GLOBAL) != 0 /* Global symbol. */ || (flags & BSF_WEAK) != 0 || undefined @@ -922,7 +1016,7 @@ filter_symbols (bfd *abfd, bfd *obfd, asymbol **osyms, else if (bfd_coff_get_comdat_section (abfd, bfd_get_section (sym))) /* COMDAT sections store special information in local symbols, so we cannot risk stripping any of them. */ - keep = 1; + keep = TRUE; else /* Local symbol. */ keep = (strip_symbols != STRIP_UNNEEDED && (discard_locals != LOCALS_ALL @@ -930,17 +1024,30 @@ filter_symbols (bfd *abfd, bfd *obfd, asymbol **osyms, || ! bfd_is_local_label (abfd, sym)))); if (keep && is_specified_symbol (name, strip_specific_list)) - keep = 0; + { + /* There are multiple ways to set 'keep' above, but if it + was the relocatable symbol case, then that's an error. */ + if (used_in_reloc) + { + non_fatal (_("not stripping symbol `%s' because it is named in a relocation"), name); + status = 1; + } + else + keep = FALSE; + } + if (keep && !(flags & BSF_KEEP) && is_specified_symbol (name, strip_unneeded_list)) - keep = 0; + keep = FALSE; + if (!keep && ((keep_file_symbols && (flags & BSF_FILE)) || is_specified_symbol (name, keep_specific_list))) - keep = 1; + keep = TRUE; + if (keep && is_strip_section (abfd, bfd_get_section (sym))) - keep = 0; + keep = FALSE; if (keep) { @@ -955,14 +1062,15 @@ filter_symbols (bfd *abfd, bfd *obfd, asymbol **osyms, && (flags & (BSF_GLOBAL | BSF_WEAK)) && (is_specified_symbol (name, localize_specific_list) || (keepglobal_specific_list != NULL - && ! is_specified_symbol (name, keepglobal_specific_list)))) + && ! is_specified_symbol (name, keepglobal_specific_list)) + || (localize_hidden && is_hidden_symbol (sym)))) { sym->flags &= ~ (BSF_GLOBAL | BSF_WEAK); sym->flags |= BSF_LOCAL; } if (!undefined - && (flags & BSF_LOCAL) + && (flags & BSF_LOCAL) && is_specified_symbol (name, globalize_specific_list)) { sym->flags &= ~ BSF_LOCAL; @@ -1105,7 +1213,7 @@ add_redefine_syms_file (const char *filename) if (buf[0] != '\0') redefine_list_append (filename, &buf[0], &buf[outsym_off]); - lineno++; + lineno++; len = 0; outsym_off = 0; if (c == EOF) @@ -1233,11 +1341,16 @@ copy_object (bfd *ibfd, bfd *obfd) bfd_get_archive_filename (ibfd), bfd_get_target (ibfd), bfd_get_filename (obfd), bfd_get_target (obfd)); - if (set_start_set) - start = set_start; + if (extract_symbol) + start = 0; else - start = bfd_get_start_address (ibfd); - start += change_start; + { + if (set_start_set) + start = set_start; + else + start = bfd_get_start_address (ibfd); + start += change_start; + } /* Neither the start address nor the flags need to be set for a core file. */ @@ -1290,6 +1403,21 @@ copy_object (bfd *ibfd, bfd *obfd) isympp = NULL; osympp = NULL; + symsize = bfd_get_symtab_upper_bound (ibfd); + if (symsize < 0) + { + bfd_nonfatal (bfd_get_archive_filename (ibfd)); + return FALSE; + } + + osympp = isympp = xmalloc (symsize); + symcount = bfd_canonicalize_symtab (ibfd, isympp); + if (symcount < 0) + { + bfd_nonfatal (bfd_get_filename (ibfd)); + return FALSE; + } + /* BFD mandates that all output sections be created and sizes set before any output is done. Thus, we traverse all sections multiple times. */ bfd_map_over_sections (ibfd, setup_section, obfd); @@ -1418,13 +1546,8 @@ copy_object (bfd *ibfd, bfd *obfd) } } - if (bfd_count_sections (obfd) == 0) - { - non_fatal (_("there are no sections to be copied!")); - return FALSE; - } - - if (gap_fill_set || pad_to_set) + if (bfd_count_sections (obfd) != 0 + && (gap_fill_set || pad_to_set)) { asection **set; unsigned int c, i; @@ -1509,21 +1632,6 @@ copy_object (bfd *ibfd, bfd *obfd) /* Symbol filtering must happen after the output sections have been created, but before their contents are set. */ dhandle = NULL; - symsize = bfd_get_symtab_upper_bound (ibfd); - if (symsize < 0) - { - bfd_nonfatal (bfd_get_archive_filename (ibfd)); - return FALSE; - } - - osympp = isympp = xmalloc (symsize); - symcount = bfd_canonicalize_symtab (ibfd, isympp); - if (symcount < 0) - { - bfd_nonfatal (bfd_get_filename (ibfd)); - return FALSE; - } - if (convert_debugging) dhandle = read_debugging_info (ibfd, isympp, symcount); @@ -1532,6 +1640,7 @@ copy_object (bfd *ibfd, bfd *obfd) || strip_symbols == STRIP_UNNEEDED || strip_symbols == STRIP_NONDEBUG || discard_locals != LOCALS_UNDEF + || localize_hidden || strip_specific_list != NULL || keep_specific_list != NULL || localize_specific_list != NULL @@ -1647,16 +1756,16 @@ copy_object (bfd *ibfd, bfd *obfd) } } + /* Do not copy backend data if --extract-symbol is passed; anything + that needs to look at the section contents will fail. */ + if (extract_symbol) + return TRUE; + /* Allow the BFD backend to copy any private data it understands from the input BFD to the output BFD. This is done last to permit the routine to look at the filtered symbol table, which is important for the ECOFF code at least. */ - if (bfd_get_flavour (ibfd) == bfd_target_elf_flavour - && strip_symbols == STRIP_NONDEBUG) - /* Do not copy the private data when creating an ELF format - debug info file. We do not want the program headers. */ - ; - else if (! bfd_copy_private_bfd_data (ibfd, obfd)) + if (! bfd_copy_private_bfd_data (ibfd, obfd)) { non_fatal (_("%s: error copying private BFD data: %s"), bfd_get_filename (obfd), @@ -1686,18 +1795,15 @@ copy_object (bfd *ibfd, bfd *obfd) return TRUE; } -#undef MKDIR -#if defined (_WIN32) && !defined (__CYGWIN32__) -#define MKDIR(DIR, MODE) mkdir (DIR) -#else -#define MKDIR(DIR, MODE) mkdir (DIR, MODE) -#endif - /* Read each archive element in turn from IBFD, copy the - contents to temp file, and keep the temp file handle. */ + contents to temp file, and keep the temp file handle. + If 'force_output_target' is TRUE then make sure that + all elements in the new archive are of the type + 'output_target'. */ static void -copy_archive (bfd *ibfd, bfd *obfd, const char *output_target) +copy_archive (bfd *ibfd, bfd *obfd, const char *output_target, + bfd_boolean force_output_target) { struct name_list { @@ -1707,12 +1813,13 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target) } *list, *l; bfd **ptr = &obfd->archive_head; bfd *this_element; - char *dir = make_tempname (bfd_get_filename (obfd)); + char * dir; /* Make a temp directory to hold the contents. */ - if (MKDIR (dir, 0700) != 0) - fatal (_("cannot mkdir %s for archive copying (error: %s)"), - dir, strerror (errno)); + dir = make_tempdir (bfd_get_filename (obfd)); + if (dir == NULL) + fatal (_("cannot create tempdir for archive copying (error: %s)"), + strerror (errno)); obfd->has_armap = ibfd->has_armap; @@ -1739,10 +1846,10 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target) /* If the file already exists, make another temp dir. */ if (stat (output_name, &buf) >= 0) { - output_name = make_tempname (output_name); - if (MKDIR (output_name, 0700) != 0) - fatal (_("cannot mkdir %s for archive copying (error: %s)"), - output_name, strerror (errno)); + output_name = make_tempdir (output_name); + if (output_name == NULL) + fatal (_("cannot create tempdir for archive copying (error: %s)"), + strerror (errno)); l = xmalloc (sizeof (struct name_list)); l->name = output_name; @@ -1753,7 +1860,6 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target) bfd_get_filename (this_element), (char *) 0); } - output_bfd = bfd_openw (output_name, output_target); if (preserve_dates) { stat_status = bfd_stat_arch_elt (this_element, &buf); @@ -1769,11 +1875,18 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target) l->obfd = NULL; list = l; - if (output_bfd == NULL) - RETURN_NONFATAL (output_name); - if (bfd_check_format (this_element, bfd_object)) { + /* PR binutils/3110: Cope with archives + containing multiple target types. */ + if (force_output_target) + output_bfd = bfd_openw (output_name, output_target); + else + output_bfd = bfd_openw (output_name, bfd_get_target (this_element)); + + if (output_bfd == NULL) + RETURN_NONFATAL (output_name); + delete = ! copy_object (this_element, output_bfd); if (! delete @@ -1794,6 +1907,7 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target) non_fatal (_("Unable to recognise the format of the input file `%s'"), bfd_get_archive_filename (this_element)); + output_bfd = bfd_openw (output_name, output_target); copy_unknown_element: delete = !copy_unknown_object (this_element, output_bfd); if (!bfd_close_all_done (output_bfd)) @@ -1820,7 +1934,7 @@ copy_unknown_element: l->obfd = output_bfd; *ptr = output_bfd; - ptr = &output_bfd->next; + ptr = &output_bfd->archive_next; last_element = this_element; @@ -1863,7 +1977,6 @@ copy_file (const char *input_filename, const char *output_filename, if (get_file_size (input_filename) < 1) { - non_fatal (_("error: the input file '%s' is empty"), input_filename); status = 1; return; } @@ -1876,18 +1989,24 @@ copy_file (const char *input_filename, const char *output_filename, if (bfd_check_format (ibfd, bfd_archive)) { + bfd_boolean force_output_target; bfd *obfd; /* bfd_get_target does not return the correct value until bfd_check_format succeeds. */ if (output_target == NULL) - output_target = bfd_get_target (ibfd); + { + output_target = bfd_get_target (ibfd); + force_output_target = FALSE; + } + else + force_output_target = TRUE; obfd = bfd_openw (output_filename, output_target); if (obfd == NULL) RETURN_NONFATAL (output_filename); - copy_archive (ibfd, obfd, output_target); + copy_archive (ibfd, obfd, output_target, force_output_target); } else if (bfd_check_format_matches (ibfd, bfd_object, &obj_matching)) { @@ -2076,7 +2195,9 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg) if (p != NULL && p->set_flags) flags = p->flags | (flags & (SEC_HAS_CONTENTS | SEC_RELOC)); - else if (strip_symbols == STRIP_NONDEBUG && (flags & SEC_ALLOC) != 0) + else if (strip_symbols == STRIP_NONDEBUG + && obfd->xvec->flavour != bfd_target_elf_flavour + && (flags & SEC_ALLOC) != 0) flags &= ~(SEC_HAS_CONTENTS | SEC_LOAD); osection = bfd_make_section_anyway_with_flags (obfd, name, flags); @@ -2090,12 +2211,17 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg) if (strip_symbols == STRIP_NONDEBUG && obfd->xvec->flavour == bfd_target_elf_flavour && (flags & SEC_ALLOC) != 0 + && elf_section_type (osection) != SHT_NOTE + && (ibfd->xvec->flavour != bfd_target_elf_flavour + || elf_section_type (isection) != SHT_NOTE) && (p == NULL || !p->set_flags)) elf_section_type (osection) = SHT_NOBITS; size = bfd_section_size (ibfd, isection); if (copy_byte >= 0) size = (size + interleave - 1) / interleave; + else if (extract_symbol) + size = 0; if (! bfd_set_section_size (obfd, osection, size)) { err = _("size"); @@ -2110,7 +2236,7 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg) else vma += change_section_address; - if (! bfd_set_section_vma (obfd, osection, vma)) + if (! bfd_set_section_vma (obfd, osection, extract_symbol ? 0 : vma)) { err = _("vma"); goto loser; @@ -2129,7 +2255,7 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg) else lma += change_section_address; - osection->lma = lma; + osection->lma = extract_symbol ? 0 : lma; /* FIXME: This is probably not enough. If we change the LMA we may have to recompute the header for the file as well. */ @@ -2148,20 +2274,27 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg) bfd_get_section_by_name since some formats allow multiple sections with the same name. */ isection->output_section = osection; - isection->output_offset = 0; + isection->output_offset = extract_symbol ? vma : 0; + + /* Do not copy backend data if --extract-symbol is passed; anything + that needs to look at the section contents will fail. */ + if (extract_symbol) + return; /* Allow the BFD backend to copy any private data it understands from the input section to the output section. */ - if (bfd_get_flavour (ibfd) == bfd_target_elf_flavour - && strip_symbols == STRIP_NONDEBUG) - /* Do not copy the private data when creating an ELF format - debug info file. We do not want the program headers. */ - ; - else if (!bfd_copy_private_section_data (ibfd, isection, obfd, osection)) + if (!bfd_copy_private_section_data (ibfd, isection, obfd, osection)) { err = _("private data"); goto loser; } + else if ((isection->flags & SEC_GROUP) != 0) + { + asymbol *gsym = group_signature (isection); + + if (gsym != NULL) + gsym->flags |= BSF_KEEP; + } /* All went well. */ return; @@ -2259,6 +2392,9 @@ copy_section (bfd *ibfd, sec_ptr isection, void *obfdarg) free (relpp); } + if (extract_symbol) + return; + if (bfd_get_section_flags (ibfd, isection) & SEC_HAS_CONTENTS && bfd_get_section_flags (obfd, osection) & SEC_HAS_CONTENTS) { @@ -2267,6 +2403,32 @@ copy_section (bfd *ibfd, sec_ptr isection, void *obfdarg) if (!bfd_get_section_contents (ibfd, isection, memhunk, 0, size)) RETURN_NONFATAL (bfd_get_filename (ibfd)); + if (reverse_bytes) + { + /* We don't handle leftover bytes (too many possible behaviors, + and we don't know what the user wants). The section length + must be a multiple of the number of bytes to swap. */ + if ((size % reverse_bytes) == 0) + { + unsigned long i, j; + bfd_byte b; + + for (i = 0; i < size; i += reverse_bytes) + for (j = 0; j < (unsigned long)(reverse_bytes / 2); j++) + { + bfd_byte *m = (bfd_byte *) memhunk; + + b = m[i + j]; + m[i + j] = m[(i + reverse_bytes) - (j + 1)]; + m[(i + reverse_bytes) - (j + 1)] = b; + } + } + else + /* User must pad the section up in order to do this. */ + fatal (_("cannot reverse bytes: length of section %s must be evenly divisible by %d"), + bfd_section_name (ibfd, isection), reverse_bytes); + } + if (copy_byte >= 0) { /* Keep only every `copy_byte'th byte in MEMHUNK. */ @@ -2561,7 +2723,7 @@ strip_main (int argc, char *argv[]) display_info (); return 0; } - + if (show_version) print_version ("strip"); @@ -2586,35 +2748,47 @@ strip_main (int argc, char *argv[]) char *tmpname; if (get_file_size (argv[i]) < 1) - continue; + { + status = 1; + continue; + } if (preserve_dates) /* No need to check the return value of stat(). It has already been checked in get_file_size(). */ stat (argv[i], &statbuf); - if (output_file != NULL) - tmpname = output_file; - else + if (output_file == NULL || strcmp (argv[i], output_file) == 0) tmpname = make_tempname (argv[i]); - status = 0; + else + tmpname = output_file; + if (tmpname == NULL) + { + non_fatal (_("could not create temporary file to hold stripped copy of '%s'"), + argv[i]); + status = 1; + continue; + } + + status = 0; copy_file (argv[i], tmpname, input_target, output_target); if (status == 0) { if (preserve_dates) set_times (tmpname, &statbuf); - if (output_file == NULL) - smart_rename (tmpname, argv[i], preserve_dates); + if (output_file != tmpname) + smart_rename (tmpname, output_file ? output_file : argv[i], + preserve_dates); status = hold_status; } else unlink_if_ordinary (tmpname); - if (output_file == NULL) + if (output_file != tmpname) free (tmpname); } - return 0; + return status; } static int @@ -2623,6 +2797,7 @@ copy_main (int argc, char *argv[]) char * binary_architecture = NULL; char *input_filename = NULL; char *output_filename = NULL; + char *tmpname; char *input_target = NULL; char *output_target = NULL; bfd_boolean show_version = FALSE; @@ -2783,7 +2958,10 @@ copy_main (int argc, char *argv[]) size = get_file_size (s + 1); if (size < 1) - break; + { + status = 1; + break; + } pa = xmalloc (sizeof (struct section_add)); @@ -3064,6 +3242,10 @@ copy_main (int argc, char *argv[]) add_specific_symbols (optarg, &keep_specific_list); break; + case OPTION_LOCALIZE_HIDDEN: + localize_hidden = TRUE; + break; + case OPTION_LOCALIZE_SYMBOLS: add_specific_symbols (optarg, &localize_specific_list); break; @@ -3118,6 +3300,24 @@ copy_main (int argc, char *argv[]) bfd_flags_to_set &= ~D_PAGED; break; + case OPTION_EXTRACT_SYMBOL: + extract_symbol = TRUE; + break; + + case OPTION_REVERSE_BYTES: + { + int prev = reverse_bytes; + + reverse_bytes = atoi (optarg); + if ((reverse_bytes <= 0) || ((reverse_bytes % 2) != 0)) + fatal (_("number of bytes to reverse must be positive and even")); + + if (prev && prev != reverse_bytes) + non_fatal (_("Warning: ignoring previous --reverse-bytes value of %d"), + prev); + break; + } + case 0: /* We've been given a long option. */ break; @@ -3136,7 +3336,7 @@ copy_main (int argc, char *argv[]) display_info (); return 0; } - + if (show_version) print_version ("objcopy"); @@ -3188,28 +3388,24 @@ copy_main (int argc, char *argv[]) /* If there is no destination file, or the source and destination files are the same, then create a temp and rename the result into the input. */ if (output_filename == NULL || strcmp (input_filename, output_filename) == 0) - { - char *tmpname = make_tempname (input_filename); + tmpname = make_tempname (input_filename); + else + tmpname = output_filename; - copy_file (input_filename, tmpname, input_target, output_target); - if (status == 0) - { - if (preserve_dates) - set_times (tmpname, &statbuf); - smart_rename (tmpname, input_filename, preserve_dates); - } - else - unlink (tmpname); + if (tmpname == NULL) + fatal (_("warning: could not create temporary file whilst copying '%s', (error: %s)"), + input_filename, strerror (errno)); + + copy_file (input_filename, tmpname, input_target, output_target); + if (status == 0) + { + if (preserve_dates) + set_times (tmpname, &statbuf); + if (tmpname != output_filename) + smart_rename (tmpname, input_filename, preserve_dates); } else - { - copy_file (input_filename, output_filename, input_target, output_target); - - if (status == 0 && preserve_dates) - set_times (output_filename, &statbuf); - else if (status != 0) - unlink_if_ordinary (output_filename); - } + unlink_if_ordinary (tmpname); if (change_warn) { diff --git a/binutils/objdump.c b/binutils/objdump.c index 6e5eab56da2..38e7c028985 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -1,6 +1,6 @@ /* objdump.c -- dump information about an object file. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -48,12 +48,11 @@ disassembling is done by the libopcodes library, via a function pointer supplied by the disassembler() function. */ +#include "sysdep.h" #include "bfd.h" -#include "bfdver.h" #include "progress.h" #include "bucomm.h" #include "dwarf.h" -#include "budemang.h" #include "getopt.h" #include "safe-ctype.h" #include "dis-asm.h" @@ -62,6 +61,12 @@ #include "debug.h" #include "budbg.h" +#ifdef HAVE_MMAP +#include +#endif + +#include + /* Internal headers for the ELF .stab-dump code - sorry. */ #define BYTES_IN_WORD 32 #include "aout/aout64.h" @@ -225,7 +230,7 @@ usage (FILE *stream, int status) disassembler_usage (stream); } - if (status == 0) + if (REPORT_BUGS_TO[0] && status == 0) fprintf (stream, _("Report bugs to %s.\n"), REPORT_BUGS_TO); exit (status); } @@ -650,8 +655,9 @@ objdump_print_symname (bfd *abfd, struct disassemble_info *info, if (do_demangle && name[0] != '\0') { /* Demangle the name. */ - alloc = demangle (abfd, name); - name = alloc; + alloc = bfd_demangle (abfd, name, DMGL_ANSI | DMGL_PARAMS); + if (alloc != NULL) + name = alloc; } if (info != NULL) @@ -687,6 +693,7 @@ find_symbol_for_address (bfd_vma vma, bfd *abfd; asection *sec; unsigned int opb; + bfd_boolean want_section; if (sorted_symcount < 1) return NULL; @@ -732,15 +739,19 @@ find_symbol_for_address (bfd_vma vma, Note that this may be wrong for some symbol references if the sections have overlapping memory ranges, but in that case there's no way to tell what's desired without looking at the relocation - table. */ - if (sorted_syms[thisplace]->section != sec - && (aux->require_sec - || ((abfd->flags & HAS_RELOC) != 0 - && vma >= bfd_get_section_vma (abfd, sec) - && vma < (bfd_get_section_vma (abfd, sec) - + bfd_section_size (abfd, sec) / opb)))) + table. + + Also give the target a chance to reject symbols. */ + want_section = (aux->require_sec + || ((abfd->flags & HAS_RELOC) != 0 + && vma >= bfd_get_section_vma (abfd, sec) + && vma < (bfd_get_section_vma (abfd, sec) + + bfd_section_size (abfd, sec) / opb))); + if ((sorted_syms[thisplace]->section != sec && want_section) + || !info->symbol_is_valid (sorted_syms[thisplace], info)) { long i; + long newplace; for (i = thisplace + 1; i < sorted_symcount; i++) { @@ -750,27 +761,36 @@ find_symbol_for_address (bfd_vma vma, } --i; + newplace = sorted_symcount; for (; i >= 0; i--) { - if (sorted_syms[i]->section == sec - && (i == 0 - || sorted_syms[i - 1]->section != sec - || (bfd_asymbol_value (sorted_syms[i]) - != bfd_asymbol_value (sorted_syms[i - 1])))) + if ((sorted_syms[i]->section == sec || !want_section) + && info->symbol_is_valid (sorted_syms[i], info)) { - thisplace = i; - break; + if (newplace == sorted_symcount) + newplace = i; + + if (bfd_asymbol_value (sorted_syms[i]) + != bfd_asymbol_value (sorted_syms[newplace])) + break; + + /* Remember this symbol and keep searching until we reach + an earlier address. */ + newplace = i; } } - if (sorted_syms[thisplace]->section != sec) + if (newplace != sorted_symcount) + thisplace = newplace; + else { /* We didn't find a good symbol with a smaller value. Look for one with a larger value. */ for (i = thisplace + 1; i < sorted_symcount; i++) { - if (sorted_syms[i]->section == sec) + if ((sorted_syms[i]->section == sec || !want_section) + && info->symbol_is_valid (sorted_syms[i], info)) { thisplace = i; break; @@ -778,25 +798,12 @@ find_symbol_for_address (bfd_vma vma, } } - if (sorted_syms[thisplace]->section != sec - && (aux->require_sec - || ((abfd->flags & HAS_RELOC) != 0 - && vma >= bfd_get_section_vma (abfd, sec) - && vma < (bfd_get_section_vma (abfd, sec) - + bfd_section_size (abfd, sec))))) + if ((sorted_syms[thisplace]->section != sec && want_section) + || !info->symbol_is_valid (sorted_syms[thisplace], info)) /* There is no suitable symbol. */ return NULL; } - /* Give the target a chance to reject the symbol. */ - while (! info->symbol_is_valid (sorted_syms [thisplace], info)) - { - ++ thisplace; - if (thisplace >= sorted_symcount - || bfd_asymbol_value (sorted_syms [thisplace]) > vma) - return NULL; - } - if (place != NULL) *place = thisplace; @@ -926,8 +933,12 @@ struct print_file_list struct print_file_list *next; const char *filename; const char *modname; - unsigned int line; - FILE *f; + const char *map; + size_t mapsize; + const char **linemap; + unsigned maxline; + unsigned last_line; + int first; }; static struct print_file_list *print_files; @@ -937,6 +948,99 @@ static struct print_file_list *print_files; #define SHOW_PRECEDING_CONTEXT_LINES (5) +/* Read a complete file into memory. */ + +static const char * +slurp_file (const char *fn, size_t *size) +{ +#ifdef HAVE_MMAP + int ps = getpagesize (); + size_t msize; +#endif + const char *map; + struct stat st; + int fd = open (fn, O_RDONLY); + + if (fd < 0) + return NULL; + if (fstat (fd, &st) < 0) + return NULL; + *size = st.st_size; +#ifdef HAVE_MMAP + msize = (*size + ps - 1) & ~(ps - 1); + map = mmap (NULL, msize, PROT_READ, MAP_SHARED, fd, 0); + if (map != (char *)-1L) + { + close(fd); + return map; + } +#endif + map = malloc (*size); + if (!map || (size_t) read (fd, (char *)map, *size) != *size) + { + free ((void *)map); + map = NULL; + } + close (fd); + return map; +} + +#define line_map_decrease 5 + +/* Precompute array of lines for a mapped file. */ + +static const char ** +index_file (const char *map, size_t size, unsigned int *maxline) +{ + const char *p, *lstart, *end; + int chars_per_line = 45; /* First iteration will use 40. */ + unsigned int lineno; + const char **linemap = NULL; + unsigned long line_map_size = 0; + + lineno = 0; + lstart = map; + end = map + size; + + for (p = map; p < end; p++) + { + if (*p == '\n') + { + if (p + 1 < end && p[1] == '\r') + p++; + } + else if (*p == '\r') + { + if (p + 1 < end && p[1] == '\n') + p++; + } + else + continue; + + /* End of line found. */ + + if (linemap == NULL || line_map_size < lineno + 1) + { + unsigned long newsize; + + chars_per_line -= line_map_decrease; + if (chars_per_line <= 1) + chars_per_line = 1; + line_map_size = size / chars_per_line + 1; + if (line_map_size < lineno + 1) + line_map_size = lineno + 1; + newsize = line_map_size * sizeof (char *); + linemap = xrealloc (linemap, newsize); + } + + linemap[lineno++] = lstart; + lstart = p + 1; + } + + *maxline = lineno; + return linemap; +} + /* Tries to open MODNAME, and if successful adds a node to print_files linked list and returns that node. Returns NULL on failure. */ @@ -944,24 +1048,22 @@ static struct print_file_list * try_print_file_open (const char *origname, const char *modname) { struct print_file_list *p; - FILE *f; - - f = fopen (modname, "r"); - if (f == NULL) - return NULL; - - if (print_files != NULL && print_files->f != NULL) - { - fclose (print_files->f); - print_files->f = NULL; - } p = xmalloc (sizeof (struct print_file_list)); + + p->map = slurp_file (modname, &p->mapsize); + if (p->map == NULL) + { + free (p); + return NULL; + } + + p->linemap = index_file (p->map, p->mapsize, &p->maxline); + p->last_line = 0; p->filename = origname; p->modname = modname; - p->line = 0; - p->f = f; p->next = print_files; + p->first = 1; print_files = p; return p; } @@ -1020,29 +1122,32 @@ update_source_path (const char *filename) return NULL; } -/* Skip ahead to a given line in a file, optionally printing each - line. */ +/* Print a source file line. */ + +static void +print_line (struct print_file_list *p, unsigned int line) +{ + const char *l; + + --line; + if (line >= p->maxline) + return; + l = p->linemap [line]; + fwrite (l, 1, strcspn (l, "\n\r"), stdout); + putchar ('\n'); +} + +/* Print a range of source code lines. */ static void -skip_to_line (struct print_file_list *p, unsigned int line, - bfd_boolean show) +dump_lines (struct print_file_list *p, unsigned int start, unsigned int end) { - while (p->line < line) + if (p->map == NULL) + return; + while (start <= end) { - char buf[100]; - - if (fgets (buf, sizeof buf, p->f) == NULL) - { - fclose (p->f); - p->f = NULL; - break; - } - - if (show) - printf ("%s", buf); - - if (strchr (buf, '\n') != NULL) - ++p->line; + print_line (p, start); + start++; } } @@ -1083,79 +1188,31 @@ show_line (bfd *abfd, asection *section, bfd_vma addr_offset) && line > 0) { struct print_file_list **pp, *p; + unsigned l; for (pp = &print_files; *pp != NULL; pp = &(*pp)->next) if (strcmp ((*pp)->filename, filename) == 0) break; p = *pp; - if (p != NULL) - { - if (p != print_files) - { - int l; - - /* We have reencountered a file name which we saw - earlier. This implies that either we are dumping out - code from an included file, or the same file was - linked in more than once. There are two common cases - of an included file: inline functions in a header - file, and a bison or flex skeleton file. In the - former case we want to just start printing (but we - back up a few lines to give context); in the latter - case we want to continue from where we left off. I - can't think of a good way to distinguish the cases, - so I used a heuristic based on the file name. */ - if (strcmp (p->filename + strlen (p->filename) - 2, ".h") != 0) - l = p->line; - else - { - l = line - SHOW_PRECEDING_CONTEXT_LINES; - if (l < 0) - l = 0; - } - - if (p->f == NULL) - { - p->f = fopen (p->modname, "r"); - p->line = 0; - } - if (p->f != NULL) - skip_to_line (p, l, FALSE); - - if (print_files->f != NULL) - { - fclose (print_files->f); - print_files->f = NULL; - } - } - - if (p->f != NULL) - { - skip_to_line (p, line, TRUE); - *pp = p->next; - p->next = print_files; - print_files = p; - } - } - else - { + if (p == NULL) p = update_source_path (filename); - if (p != NULL) + if (p != NULL && line != p->last_line) + { + if (file_start_context && p->first) + l = 1; + else { - int l; - - if (file_start_context) - l = 0; - else - l = line - SHOW_PRECEDING_CONTEXT_LINES; - if (l < 0) - l = 0; - skip_to_line (p, l, FALSE); - if (p->f != NULL) - skip_to_line (p, line, TRUE); + l = line - SHOW_PRECEDING_CONTEXT_LINES; + if (l >= line) + l = 1; + if (p->last_line >= l && p->last_line <= line) + l = p->last_line + 1; } + dump_lines (p, l, line); + p->last_line = line; + p->first = 0; } } @@ -1377,6 +1434,8 @@ disassemble_bytes (struct disassemble_info * info, info->flags = 0; if (info->disassembler_needs_relocs + && (bfd_get_file_flags (aux->abfd) & EXEC_P) == 0 + && (bfd_get_file_flags (aux->abfd) & DYNAMIC) == 0 && *relppp < relppend) { bfd_signed_vma distance_to_rel; @@ -1748,11 +1807,13 @@ disassemble_section (bfd *abfd, asection *section, void *info) pinfo->symbols = sorted_syms + place; pinfo->num_symbols = x - place; + pinfo->symtab_pos = place; } else { pinfo->symbols = NULL; pinfo->num_symbols = 0; + pinfo->symtab_pos = -1; } if (! prefix_addresses) @@ -1945,6 +2006,8 @@ disassemble_data (bfd *abfd) compare_relocs); } } + disasm_info.symtab = sorted_syms; + disasm_info.symtab_size = sorted_symcount; bfd_map_over_sections (abfd, disassemble_section, & disasm_info); @@ -1970,7 +2033,19 @@ load_debug_section (enum dwarf_section_display_enum debug, void *file) if (sec == NULL) return 0; - section->address = bfd_get_section_vma (abfd, sec); + /* Compute a bias to be added to offsets found within the DWARF debug + information. These offsets are meant to be relative to the start of + the dwarf section, and hence the bias should be 0. For MACH-O however + a dwarf section is really just a region of a much larger section and so + the bias is the address of the start of that area within the larger + section. This test is important for PE and COFF based targets which + use DWARF debug information, since unlike ELF, they do not allow the + dwarf sections to be placed at address 0. */ + if (bfd_get_flavour (abfd) == bfd_target_mach_o_flavour) + section->address = bfd_get_section_vma (abfd, sec); + else + section->address = 0; + section->size = bfd_get_section_size (sec); section->start = xmalloc (section->size); @@ -2015,7 +2090,7 @@ dump_dwarf_section (bfd *abfd, asection *section, const char *match; enum dwarf_section_display_enum i; - if (strncmp (name, ".gnu.linkonce.wi.", 17) == 0) + if (CONST_STRNEQ (name, ".gnu.linkonce.wi.")) match = ".debug_info"; else match = name; @@ -2511,12 +2586,16 @@ dump_symbols (bfd *abfd ATTRIBUTE_UNUSED, bfd_boolean dynamic) /* If we want to demangle the name, we demangle it here, and temporarily clobber it while calling bfd_print_symbol. FIXME: This is a gross hack. */ - alloc = demangle (cur_bfd, name); - (*current)->name = alloc; + alloc = bfd_demangle (cur_bfd, name, DMGL_ANSI | DMGL_PARAMS); + if (alloc != NULL) + (*current)->name = alloc; bfd_print_symbol (cur_bfd, stdout, *current, bfd_print_symbol_all); - (*current)->name = name; - free (alloc); + if (alloc != NULL) + { + (*current)->name = name; + free (alloc); + } } else bfd_print_symbol (cur_bfd, stdout, *current, @@ -2822,8 +2901,9 @@ dump_bfd (bfd *abfd) dhandle = read_debugging_info (abfd, syms, symcount); if (dhandle != NULL) { - if (! print_debugging_info (stdout, dhandle, abfd, syms, demangle, - dump_debugging_tags ? TRUE : FALSE)) + if (!print_debugging_info (stdout, dhandle, abfd, syms, + bfd_demangle, + dump_debugging_tags ? TRUE : FALSE)) { non_fatal (_("%s: printing debugging information failed"), bfd_get_filename (abfd)); @@ -2902,7 +2982,10 @@ display_file (char *filename, char *target) bfd *arfile = NULL; if (get_file_size (filename) < 1) - return; + { + exit_status = 1; + return; + } file = bfd_openr (filename, target); if (file == NULL) diff --git a/binutils/po/Make-in b/binutils/po/Make-in index be09b4cd788..86ff3143b98 100644 --- a/binutils/po/Make-in +++ b/binutils/po/Make-in @@ -16,6 +16,7 @@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ +top_builddir = @top_builddir@ prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -72,7 +73,7 @@ INSTOBJEXT = @INSTOBJEXT@ $(MSGFMT) -o $@ $< .po.gmo: - file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ + file=`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: diff --git a/binutils/po/POTFILES.in b/binutils/po/POTFILES.in index d3f6cb3fa7c..e96d8bf3ca1 100644 --- a/binutils/po/POTFILES.in +++ b/binutils/po/POTFILES.in @@ -2,13 +2,12 @@ addr2line.c ar.c arsup.c arsup.h +bin2c.c binemul.c binemul.h bucomm.c bucomm.h budbg.h -budemang.c -budemang.h coffdump.c coffgrok.c coffgrok.h @@ -29,6 +28,7 @@ is-ranlib.c is-strip.c maybe-ranlib.c maybe-strip.c +mclex.c nlmconv.c nlmconv.h nm.c @@ -37,6 +37,7 @@ not-strip.c objcopy.c objdump.c prdbg.c +rclex.c rdcoff.c rdcoff.c rddbg.c @@ -54,6 +55,9 @@ stabs.c strings.c sysdump.c version.c +windint.h +windmc.c +windmc.h windres.c windres.h winduni.c diff --git a/binutils/po/binutils.pot b/binutils/po/binutils.pot index 5e5a4dc7f22..f0801683f20 100644 --- a/binutils/po/binutils.pot +++ b/binutils/po/binutils.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-10-25 09:14+0930\n" +"POT-Creation-Date: 2007-07-02 15:55+0930\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -16,31 +16,32 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: addr2line.c:76 +#: addr2line.c:74 #, c-format msgid "Usage: %s [option(s)] [addr(s)]\n" msgstr "" -#: addr2line.c:77 +#: addr2line.c:75 #, c-format msgid " Convert addresses into line number/file name pairs.\n" msgstr "" -#: addr2line.c:78 +#: addr2line.c:76 #, c-format msgid "" " If no addresses are specified on the command line, they will be read from " "stdin\n" msgstr "" -#: addr2line.c:79 +#: addr2line.c:77 #, c-format msgid "" " The options are:\n" " @ Read options from \n" " -b --target= Set the binary file format\n" " -e --exe= Set the input file name (default is a.out)\n" -" -i --inlines\t\t Unwind inlined functions\n" +" -i --inlines Unwind inlined functions\n" +" -j --section= Read section-relative offsets instead of addresses\n" " -s --basenames Strip directory names\n" " -f --functions Show function names\n" " -C --demangle[=style] Demangle function names\n" @@ -49,169 +50,174 @@ msgid "" "\n" msgstr "" -#: addr2line.c:93 ar.c:263 coffdump.c:466 nlmconv.c:1113 objcopy.c:486 -#: objcopy.c:520 readelf.c:2622 size.c:102 srconv.c:1732 strings.c:725 -#: sysdump.c:648 windres.c:673 +#: addr2line.c:92 ar.c:264 coffdump.c:467 dlltool.c:3172 dllwrap.c:510 +#: nlmconv.c:1115 objcopy.c:515 objcopy.c:550 readelf.c:2797 size.c:103 +#: srconv.c:1734 strings.c:722 sysdump.c:647 windmc.c:232 windres.c:698 #, c-format msgid "Report bugs to %s\n" msgstr "" -#: addr2line.c:253 +#: addr2line.c:279 #, c-format -msgid "%s: can not get addresses from archive" +msgid "%s: cannot get addresses from archive" msgstr "" -#: addr2line.c:325 nm.c:1523 objdump.c:3033 +#: addr2line.c:296 +#, c-format +msgid "%s: cannot find section %s" +msgstr "" + +#: addr2line.c:362 nm.c:1534 objdump.c:3099 #, c-format msgid "unknown demangling style `%s'" msgstr "" -#: ar.c:203 +#: ar.c:204 #, c-format msgid "no entry %s in archive\n" msgstr "" -#: ar.c:219 +#: ar.c:220 #, c-format msgid "" "Usage: %s [emulation options] [-]{dmpqrstx}[abcfilNoPsSuvV] [member-name] " "[count] archive-file file...\n" msgstr "" -#: ar.c:222 +#: ar.c:223 #, c-format msgid " %s -M [ - read options from \n" msgstr "" -#: ar.c:252 +#: ar.c:253 #, c-format msgid "Usage: %s [options] archive\n" msgstr "" -#: ar.c:253 +#: ar.c:254 #, c-format msgid " Generate an index to speed access to archives\n" msgstr "" -#: ar.c:254 +#: ar.c:255 #, c-format msgid "" " The options are:\n" @@ -220,47 +226,47 @@ msgid "" " -V --version Print version information\n" msgstr "" -#: ar.c:485 +#: ar.c:487 msgid "two different operation options specified" msgstr "" -#: ar.c:560 +#: ar.c:562 #, c-format msgid "illegal option -- %c" msgstr "" -#: ar.c:606 +#: ar.c:605 msgid "no operation specified" msgstr "" -#: ar.c:609 +#: ar.c:608 msgid "`u' is only meaningful with the `r' option." msgstr "" -#: ar.c:617 +#: ar.c:616 msgid "`N' is only meaningful with the `x' and `d' options." msgstr "" -#: ar.c:620 +#: ar.c:619 msgid "Value for `N' must be positive." msgstr "" -#: ar.c:670 +#: ar.c:669 #, c-format msgid "internal error -- this option not implemented" msgstr "" -#: ar.c:739 +#: ar.c:738 #, c-format msgid "creating %s" msgstr "" -#: ar.c:788 ar.c:838 ar.c:1156 objcopy.c:1683 +#: ar.c:787 ar.c:842 ar.c:1164 objcopy.c:1869 #, c-format msgid "internal stat error on %s" msgstr "" -#: ar.c:792 +#: ar.c:791 #, c-format msgid "" "\n" @@ -268,168 +274,173 @@ msgid "" "\n" msgstr "" -#: ar.c:808 ar.c:875 +#: ar.c:807 ar.c:875 #, c-format msgid "%s is not a valid archive" msgstr "" -#: ar.c:843 -#, c-format -msgid "stat returns negative size for %s" -msgstr "" - -#: ar.c:1061 +#: ar.c:1069 #, c-format msgid "No member named `%s'\n" msgstr "" -#: ar.c:1111 +#: ar.c:1119 #, c-format msgid "no entry %s in archive %s!" msgstr "" -#: ar.c:1248 +#: ar.c:1257 #, c-format msgid "%s: no archive map to update" msgstr "" -#: arsup.c:87 +#: arsup.c:88 #, c-format msgid "No entry %s in archive.\n" msgstr "" -#: arsup.c:112 +#: arsup.c:113 #, c-format msgid "Can't open file %s\n" msgstr "" -#: arsup.c:162 +#: arsup.c:163 #, c-format msgid "%s: Can't open output archive %s\n" msgstr "" -#: arsup.c:179 +#: arsup.c:180 #, c-format msgid "%s: Can't open input archive %s\n" msgstr "" -#: arsup.c:188 +#: arsup.c:189 #, c-format msgid "%s: file %s is not an archive\n" msgstr "" -#: arsup.c:227 +#: arsup.c:228 #, c-format msgid "%s: no output archive specified yet\n" msgstr "" -#: arsup.c:247 arsup.c:285 arsup.c:327 arsup.c:347 arsup.c:413 +#: arsup.c:248 arsup.c:286 arsup.c:328 arsup.c:348 arsup.c:414 #, c-format msgid "%s: no open output archive\n" msgstr "" -#: arsup.c:258 arsup.c:368 arsup.c:394 +#: arsup.c:259 arsup.c:369 arsup.c:395 #, c-format msgid "%s: can't open file %s\n" msgstr "" -#: arsup.c:312 arsup.c:390 arsup.c:471 +#: arsup.c:313 arsup.c:391 arsup.c:472 #, c-format msgid "%s: can't find module file %s\n" msgstr "" -#: arsup.c:422 +#: arsup.c:423 #, c-format msgid "Current open archive is %s\n" msgstr "" -#: arsup.c:446 +#: arsup.c:447 #, c-format msgid "%s: no open archive\n" msgstr "" +#: bin2c.c:84 +#, c-format +msgid "Usage: %s < input_file > output_file\n" +msgstr "" + +#: bin2c.c:85 +#, c-format +msgid "Prints bytes from stdin in hex format.\n" +msgstr "" + #: binemul.c:37 #, c-format msgid " No emulation specific options\n" msgstr "" #. Macros for common output. -#: binemul.h:40 +#: binemul.h:41 #, c-format msgid " emulation options: \n" msgstr "" -#: bucomm.c:110 +#: bucomm.c:111 #, c-format msgid "can't set BFD default target to `%s': %s" msgstr "" -#: bucomm.c:121 +#: bucomm.c:122 #, c-format msgid "%s: Matching formats:" msgstr "" -#: bucomm.c:136 +#: bucomm.c:137 #, c-format msgid "Supported targets:" msgstr "" -#: bucomm.c:138 +#: bucomm.c:139 #, c-format msgid "%s: supported targets:" msgstr "" -#: bucomm.c:154 +#: bucomm.c:155 #, c-format msgid "Supported architectures:" msgstr "" -#: bucomm.c:156 +#: bucomm.c:157 #, c-format msgid "%s: supported architectures:" msgstr "" -#: bucomm.c:349 +#: bucomm.c:350 #, c-format msgid "BFD header file version %s\n" msgstr "" -#: bucomm.c:450 +#: bucomm.c:499 #, c-format msgid "%s: bad number: %s" msgstr "" -#: bucomm.c:467 strings.c:438 +#: bucomm.c:516 strings.c:435 #, c-format msgid "'%s': No such file" msgstr "" -#: bucomm.c:469 strings.c:440 +#: bucomm.c:518 strings.c:437 #, c-format msgid "Warning: could not locate '%s'. reason: %s" msgstr "" -#: bucomm.c:473 +#: bucomm.c:522 #, c-format msgid "Warning: '%s' is not an ordinary file" msgstr "" -#: coffdump.c:103 +#: coffdump.c:104 #, c-format msgid "#lines %d " msgstr "" -#: coffdump.c:457 sysdump.c:641 +#: coffdump.c:458 sysdump.c:640 #, c-format msgid "Usage: %s [option(s)] in-file\n" msgstr "" -#: coffdump.c:458 +#: coffdump.c:459 #, c-format msgid " Print a human readable interpretation of a SYSROFF object file\n" msgstr "" -#: coffdump.c:459 +#: coffdump.c:460 #, c-format msgid "" " The options are:\n" @@ -439,720 +450,732 @@ msgid "" "\n" msgstr "" -#: coffdump.c:528 srconv.c:1822 sysdump.c:705 +#: coffdump.c:529 srconv.c:1824 sysdump.c:704 msgid "no input file specified" msgstr "" -#: debug.c:648 +#: cxxfilt.c:119 nm.c:252 objdump.c:234 +#, c-format +msgid "Report bugs to %s.\n" +msgstr "" + +#: debug.c:646 msgid "debug_add_to_current_namespace: no current file" msgstr "" -#: debug.c:727 +#: debug.c:725 msgid "debug_start_source: no debug_set_filename call" msgstr "" -#: debug.c:783 +#: debug.c:781 msgid "debug_record_function: no debug_set_filename call" msgstr "" -#: debug.c:835 +#: debug.c:833 msgid "debug_record_parameter: no current function" msgstr "" -#: debug.c:867 +#: debug.c:865 msgid "debug_end_function: no current function" msgstr "" -#: debug.c:873 +#: debug.c:871 msgid "debug_end_function: some blocks were not closed" msgstr "" -#: debug.c:901 +#: debug.c:899 msgid "debug_start_block: no current block" msgstr "" -#: debug.c:937 +#: debug.c:935 msgid "debug_end_block: no current block" msgstr "" -#: debug.c:944 +#: debug.c:942 msgid "debug_end_block: attempt to close top level block" msgstr "" -#: debug.c:967 +#: debug.c:965 msgid "debug_record_line: no current unit" msgstr "" #. FIXME -#: debug.c:1020 +#: debug.c:1018 msgid "debug_start_common_block: not implemented" msgstr "" #. FIXME -#: debug.c:1031 +#: debug.c:1029 msgid "debug_end_common_block: not implemented" msgstr "" #. FIXME. -#: debug.c:1115 +#: debug.c:1113 msgid "debug_record_label: not implemented" msgstr "" -#: debug.c:1137 +#: debug.c:1135 msgid "debug_record_variable: no current file" msgstr "" -#: debug.c:1665 +#: debug.c:1663 msgid "debug_make_undefined_type: unsupported kind" msgstr "" -#: debug.c:1842 +#: debug.c:1840 msgid "debug_name_type: no current file" msgstr "" -#: debug.c:1887 +#: debug.c:1885 msgid "debug_tag_type: no current file" msgstr "" -#: debug.c:1895 +#: debug.c:1893 msgid "debug_tag_type: extra tag attempted" msgstr "" -#: debug.c:1932 +#: debug.c:1930 #, c-format msgid "Warning: changing type size from %d to %d\n" msgstr "" -#: debug.c:1954 +#: debug.c:1952 msgid "debug_find_named_type: no current compilation unit" msgstr "" -#: debug.c:2057 +#: debug.c:2055 #, c-format msgid "debug_get_real_type: circular debug information for %s\n" msgstr "" -#: debug.c:2484 +#: debug.c:2482 msgid "debug_write_type: illegal type encountered" msgstr "" -#: dlltool.c:765 dlltool.c:789 dlltool.c:818 +#: dlltool.c:797 dlltool.c:823 dlltool.c:854 #, c-format msgid "Internal error: Unknown machine type: %d" msgstr "" -#: dlltool.c:854 +#: dlltool.c:890 #, c-format msgid "Can't open def file: %s" msgstr "" -#: dlltool.c:859 +#: dlltool.c:895 #, c-format msgid "Processing def file: %s" msgstr "" -#: dlltool.c:863 +#: dlltool.c:899 msgid "Processed def file" msgstr "" -#: dlltool.c:887 +#: dlltool.c:923 #, c-format msgid "Syntax error in def file %s:%d" msgstr "" -#: dlltool.c:922 +#: dlltool.c:958 #, c-format msgid "%s: Path components stripped from image name, '%s'." msgstr "" -#: dlltool.c:931 +#: dlltool.c:967 #, c-format msgid "NAME: %s base: %x" msgstr "" -#: dlltool.c:934 dlltool.c:950 +#: dlltool.c:970 dlltool.c:986 msgid "Can't have LIBRARY and NAME" msgstr "" -#: dlltool.c:947 +#: dlltool.c:983 #, c-format msgid "LIBRARY: %s base: %x" msgstr "" -#: dlltool.c:1183 resrc.c:269 +#: dlltool.c:1219 resrc.c:293 #, c-format msgid "wait: %s" msgstr "" -#: dlltool.c:1188 dllwrap.c:413 resrc.c:274 +#: dlltool.c:1224 dllwrap.c:410 resrc.c:298 #, c-format msgid "subprocess got fatal signal %d" msgstr "" -#: dlltool.c:1194 dllwrap.c:420 resrc.c:281 +#: dlltool.c:1230 dllwrap.c:417 resrc.c:305 #, c-format msgid "%s exited with status %d" msgstr "" -#: dlltool.c:1225 +#: dlltool.c:1261 #, c-format msgid "Sucking in info from %s section in %s" msgstr "" -#: dlltool.c:1350 +#: dlltool.c:1386 #, c-format msgid "Excluding symbol: %s" msgstr "" -#: dlltool.c:1439 dlltool.c:1450 nm.c:1000 nm.c:1011 +#: dlltool.c:1475 dlltool.c:1486 nm.c:984 nm.c:995 #, c-format msgid "%s: no symbols" msgstr "" #. FIXME: we ought to read in and block out the base relocations. -#: dlltool.c:1476 +#: dlltool.c:1512 #, c-format msgid "Done reading %s" msgstr "" -#: dlltool.c:1486 +#: dlltool.c:1522 #, c-format msgid "Unable to open object file: %s" msgstr "" -#: dlltool.c:1489 +#: dlltool.c:1525 #, c-format msgid "Scanning object file %s" msgstr "" -#: dlltool.c:1504 +#: dlltool.c:1540 #, c-format msgid "Cannot produce mcore-elf dll from archive file: %s" msgstr "" -#: dlltool.c:1590 +#: dlltool.c:1626 msgid "Adding exports to output file" msgstr "" -#: dlltool.c:1638 +#: dlltool.c:1674 msgid "Added exports to output file" msgstr "" -#: dlltool.c:1759 +#: dlltool.c:1813 #, c-format msgid "Generating export file: %s" msgstr "" -#: dlltool.c:1764 +#: dlltool.c:1818 #, c-format msgid "Unable to open temporary assembler file: %s" msgstr "" -#: dlltool.c:1767 +#: dlltool.c:1821 #, c-format msgid "Opened temporary file: %s" msgstr "" -#: dlltool.c:1989 +#: dlltool.c:2043 msgid "Generated exports file" msgstr "" -#: dlltool.c:2195 +#: dlltool.c:2251 #, c-format msgid "bfd_open failed open stub file: %s" msgstr "" -#: dlltool.c:2198 +#: dlltool.c:2254 #, c-format msgid "Creating stub file: %s" msgstr "" -#: dlltool.c:2580 +#: dlltool.c:2672 #, c-format msgid "failed to open temporary head file: %s" msgstr "" -#: dlltool.c:2639 +#: dlltool.c:2734 #, c-format msgid "failed to open temporary tail file: %s" msgstr "" -#: dlltool.c:2706 +#: dlltool.c:2809 #, c-format msgid "Can't open .lib file: %s" msgstr "" -#: dlltool.c:2709 +#: dlltool.c:2812 #, c-format msgid "Creating library file: %s" msgstr "" -#: dlltool.c:2792 dlltool.c:2798 +#: dlltool.c:2895 dlltool.c:2901 #, c-format msgid "cannot delete %s: %s" msgstr "" -#: dlltool.c:2803 +#: dlltool.c:2906 msgid "Created lib file" msgstr "" -#: dlltool.c:2882 +#: dlltool.c:2985 #, c-format msgid "Warning, ignoring duplicate EXPORT %s %d,%d" msgstr "" -#: dlltool.c:2888 +#: dlltool.c:2991 #, c-format msgid "Error, duplicate EXPORT with oridinals: %s" msgstr "" -#: dlltool.c:2993 +#: dlltool.c:3096 msgid "Processing definitions" msgstr "" -#: dlltool.c:3025 +#: dlltool.c:3128 msgid "Processed definitions" msgstr "" #. xgetext:c-format -#: dlltool.c:3032 dllwrap.c:474 +#: dlltool.c:3135 dllwrap.c:471 #, c-format msgid "Usage %s \n" msgstr "" #. xgetext:c-format -#: dlltool.c:3034 +#: dlltool.c:3137 #, c-format msgid "" " -m --machine Create as DLL for . [default: %s]\n" msgstr "" -#: dlltool.c:3035 +#: dlltool.c:3138 #, c-format msgid "" " possible : arm[_interwork], i386, mcore[-elf]{-le|-be}, " "ppc, thumb\n" msgstr "" -#: dlltool.c:3036 +#: dlltool.c:3139 #, c-format msgid " -e --output-exp Generate an export file.\n" msgstr "" -#: dlltool.c:3037 +#: dlltool.c:3140 #, c-format msgid " -l --output-lib Generate an interface library.\n" msgstr "" -#: dlltool.c:3038 +#: dlltool.c:3141 #, c-format msgid " -a --add-indirect Add dll indirects to export file.\n" msgstr "" -#: dlltool.c:3039 +#: dlltool.c:3142 #, c-format msgid "" " -D --dllname Name of input dll to put into interface lib.\n" msgstr "" -#: dlltool.c:3040 +#: dlltool.c:3143 #, c-format msgid " -d --input-def Name of .def file to be read in.\n" msgstr "" -#: dlltool.c:3041 +#: dlltool.c:3144 #, c-format msgid " -z --output-def Name of .def file to be created.\n" msgstr "" -#: dlltool.c:3042 +#: dlltool.c:3145 #, c-format msgid " --export-all-symbols Export all symbols to .def\n" msgstr "" -#: dlltool.c:3043 +#: dlltool.c:3146 #, c-format msgid " --no-export-all-symbols Only export listed symbols\n" msgstr "" -#: dlltool.c:3044 +#: dlltool.c:3147 #, c-format msgid " --exclude-symbols Don't export \n" msgstr "" -#: dlltool.c:3045 +#: dlltool.c:3148 #, c-format msgid " --no-default-excludes Clear default exclude symbols\n" msgstr "" -#: dlltool.c:3046 +#: dlltool.c:3149 #, c-format msgid " -b --base-file Read linker generated base file.\n" msgstr "" -#: dlltool.c:3047 +#: dlltool.c:3150 #, c-format msgid " -x --no-idata4 Don't generate idata$4 section.\n" msgstr "" -#: dlltool.c:3048 +#: dlltool.c:3151 #, c-format msgid " -c --no-idata5 Don't generate idata$5 section.\n" msgstr "" -#: dlltool.c:3049 +#: dlltool.c:3152 #, c-format msgid "" -" -U --add-underscore Add underscores to symbols in interface " +" -U --add-underscore Add underscores to all symbols in interface " "library.\n" msgstr "" -#: dlltool.c:3050 +#: dlltool.c:3153 +#, c-format +msgid "" +" --add-stdcall-underscore Add underscores to stdcall symbols in " +"interface library.\n" +msgstr "" + +#: dlltool.c:3154 #, c-format msgid " -k --kill-at Kill @ from exported names.\n" msgstr "" -#: dlltool.c:3051 +#: dlltool.c:3155 #, c-format msgid " -A --add-stdcall-alias Add aliases without @.\n" msgstr "" -#: dlltool.c:3052 +#: dlltool.c:3156 #, c-format msgid " -p --ext-prefix-alias Add aliases with .\n" msgstr "" -#: dlltool.c:3053 +#: dlltool.c:3157 #, c-format msgid " -S --as Use for assembler.\n" msgstr "" -#: dlltool.c:3054 +#: dlltool.c:3158 #, c-format msgid " -f --as-flags Pass to the assembler.\n" msgstr "" -#: dlltool.c:3055 +#: dlltool.c:3159 #, c-format msgid "" " -C --compat-implib Create backward compatible import library.\n" msgstr "" -#: dlltool.c:3056 +#: dlltool.c:3160 #, c-format msgid "" " -n --no-delete Keep temp files (repeat for extra " "preservation).\n" msgstr "" -#: dlltool.c:3057 +#: dlltool.c:3161 #, c-format msgid "" " -t --temp-prefix Use to construct temp file names.\n" msgstr "" -#: dlltool.c:3058 +#: dlltool.c:3162 #, c-format msgid " -v --verbose Be verbose.\n" msgstr "" -#: dlltool.c:3059 +#: dlltool.c:3163 #, c-format msgid " -V --version Display the program version.\n" msgstr "" -#: dlltool.c:3060 +#: dlltool.c:3164 #, c-format msgid " -h --help Display this information.\n" msgstr "" -#: dlltool.c:3061 +#: dlltool.c:3165 #, c-format msgid " @ Read options from .\n" msgstr "" -#: dlltool.c:3063 +#: dlltool.c:3167 #, c-format msgid "" " -M --mcore-elf Process mcore-elf object files into .\n" msgstr "" -#: dlltool.c:3064 +#: dlltool.c:3168 #, c-format msgid " -L --linker Use as the linker.\n" msgstr "" -#: dlltool.c:3065 +#: dlltool.c:3169 #, c-format msgid " -F --linker-flags Pass to the linker.\n" msgstr "" -#: dlltool.c:3181 +#: dlltool.c:3292 #, c-format msgid "Path components stripped from dllname, '%s'." msgstr "" -#: dlltool.c:3226 +#: dlltool.c:3337 #, c-format msgid "Unable to open base-file: %s" msgstr "" -#: dlltool.c:3258 +#: dlltool.c:3369 #, c-format msgid "Machine '%s' not supported" msgstr "" -#: dlltool.c:3362 dllwrap.c:204 +#: dlltool.c:3473 dllwrap.c:201 #, c-format msgid "Tried file: %s" msgstr "" -#: dlltool.c:3369 dllwrap.c:211 +#: dlltool.c:3480 dllwrap.c:208 #, c-format msgid "Using file: %s" msgstr "" -#: dllwrap.c:294 +#: dllwrap.c:291 #, c-format msgid "Keeping temporary base file %s" msgstr "" -#: dllwrap.c:296 +#: dllwrap.c:293 #, c-format msgid "Deleting temporary base file %s" msgstr "" -#: dllwrap.c:310 +#: dllwrap.c:307 #, c-format msgid "Keeping temporary exp file %s" msgstr "" -#: dllwrap.c:312 +#: dllwrap.c:309 #, c-format msgid "Deleting temporary exp file %s" msgstr "" -#: dllwrap.c:325 +#: dllwrap.c:322 #, c-format msgid "Keeping temporary def file %s" msgstr "" -#: dllwrap.c:327 +#: dllwrap.c:324 #, c-format msgid "Deleting temporary def file %s" msgstr "" -#: dllwrap.c:475 +#: dllwrap.c:472 #, c-format msgid " Generic options:\n" msgstr "" -#: dllwrap.c:476 +#: dllwrap.c:473 #, c-format msgid " @ Read options from \n" msgstr "" -#: dllwrap.c:477 +#: dllwrap.c:474 #, c-format msgid " --quiet, -q Work quietly\n" msgstr "" -#: dllwrap.c:478 +#: dllwrap.c:475 #, c-format msgid " --verbose, -v Verbose\n" msgstr "" -#: dllwrap.c:479 +#: dllwrap.c:476 #, c-format msgid " --version Print dllwrap version\n" msgstr "" -#: dllwrap.c:480 +#: dllwrap.c:477 #, c-format msgid " --implib Synonym for --output-lib\n" msgstr "" -#: dllwrap.c:481 +#: dllwrap.c:478 #, c-format msgid " Options for %s:\n" msgstr "" -#: dllwrap.c:482 +#: dllwrap.c:479 #, c-format msgid " --driver-name Defaults to \"gcc\"\n" msgstr "" -#: dllwrap.c:483 +#: dllwrap.c:480 #, c-format msgid " --driver-flags Override default ld flags\n" msgstr "" -#: dllwrap.c:484 +#: dllwrap.c:481 #, c-format msgid " --dlltool-name Defaults to \"dlltool\"\n" msgstr "" -#: dllwrap.c:485 +#: dllwrap.c:482 #, c-format msgid " --entry Specify alternate DLL entry point\n" msgstr "" -#: dllwrap.c:486 +#: dllwrap.c:483 #, c-format msgid " --image-base Specify image base address\n" msgstr "" -#: dllwrap.c:487 +#: dllwrap.c:484 #, c-format msgid " --target i386-cygwin32 or i386-mingw32\n" msgstr "" -#: dllwrap.c:488 +#: dllwrap.c:485 #, c-format msgid " --dry-run Show what needs to be run\n" msgstr "" -#: dllwrap.c:489 +#: dllwrap.c:486 #, c-format msgid " --mno-cygwin Create Mingw DLL\n" msgstr "" -#: dllwrap.c:490 +#: dllwrap.c:487 #, c-format msgid " Options passed to DLLTOOL:\n" msgstr "" -#: dllwrap.c:491 +#: dllwrap.c:488 #, c-format msgid " --machine \n" msgstr "" -#: dllwrap.c:492 +#: dllwrap.c:489 #, c-format msgid " --output-exp Generate export file.\n" msgstr "" -#: dllwrap.c:493 +#: dllwrap.c:490 #, c-format msgid " --output-lib Generate input library.\n" msgstr "" -#: dllwrap.c:494 +#: dllwrap.c:491 #, c-format msgid " --add-indirect Add dll indirects to export file.\n" msgstr "" -#: dllwrap.c:495 +#: dllwrap.c:492 #, c-format msgid " --dllname Name of input dll to put into output lib.\n" msgstr "" -#: dllwrap.c:496 +#: dllwrap.c:493 #, c-format msgid " --def Name input .def file\n" msgstr "" -#: dllwrap.c:497 +#: dllwrap.c:494 #, c-format msgid " --output-def Name output .def file\n" msgstr "" -#: dllwrap.c:498 +#: dllwrap.c:495 #, c-format msgid " --export-all-symbols Export all symbols to .def\n" msgstr "" -#: dllwrap.c:499 +#: dllwrap.c:496 #, c-format msgid " --no-export-all-symbols Only export .drectve symbols\n" msgstr "" -#: dllwrap.c:500 +#: dllwrap.c:497 #, c-format msgid " --exclude-symbols Exclude from .def\n" msgstr "" -#: dllwrap.c:501 +#: dllwrap.c:498 #, c-format msgid " --no-default-excludes Zap default exclude symbols\n" msgstr "" -#: dllwrap.c:502 +#: dllwrap.c:499 #, c-format msgid " --base-file Read linker generated base file\n" msgstr "" -#: dllwrap.c:503 +#: dllwrap.c:500 #, c-format msgid " --no-idata4 Don't generate idata$4 section\n" msgstr "" -#: dllwrap.c:504 +#: dllwrap.c:501 #, c-format msgid " --no-idata5 Don't generate idata$5 section\n" msgstr "" -#: dllwrap.c:505 +#: dllwrap.c:502 #, c-format msgid " -U Add underscores to .lib\n" msgstr "" -#: dllwrap.c:506 +#: dllwrap.c:503 #, c-format msgid " -k Kill @ from exported names\n" msgstr "" -#: dllwrap.c:507 +#: dllwrap.c:504 #, c-format msgid " --add-stdcall-alias Add aliases without @\n" msgstr "" -#: dllwrap.c:508 +#: dllwrap.c:505 #, c-format msgid " --as Use for assembler\n" msgstr "" -#: dllwrap.c:509 +#: dllwrap.c:506 #, c-format msgid " --nodelete Keep temp files.\n" msgstr "" -#: dllwrap.c:510 +#: dllwrap.c:507 #, c-format msgid " Rest are passed unmodified to the language driver\n" msgstr "" -#: dllwrap.c:782 +#: dllwrap.c:781 msgid "Must provide at least one of -o or --dllname options" msgstr "" -#: dllwrap.c:811 +#: dllwrap.c:810 msgid "" "no export definition file provided.\n" "Creating one, but that may not be what you want" msgstr "" -#: dllwrap.c:970 +#: dllwrap.c:969 #, c-format msgid "DLLTOOL name : %s\n" msgstr "" -#: dllwrap.c:971 +#: dllwrap.c:970 #, c-format msgid "DLLTOOL options : %s\n" msgstr "" -#: dllwrap.c:972 +#: dllwrap.c:971 #, c-format msgid "DRIVER name : %s\n" msgstr "" -#: dllwrap.c:973 +#: dllwrap.c:972 #, c-format msgid "DRIVER options : %s\n" msgstr "" -#: dwarf.c:93 dwarf.c:137 readelf.c:322 readelf.c:515 +#: dwarf.c:93 dwarf.c:137 readelf.c:377 readelf.c:570 #, c-format msgid "Unhandled data length: %d\n" msgstr "" @@ -1183,7 +1206,7 @@ msgstr "" msgid " define new File Table entry\n" msgstr "" -#: dwarf.c:261 dwarf.c:1944 +#: dwarf.c:261 dwarf.c:1928 #, c-format msgid " Entry\tDir\tTime\tSize\tName\n" msgstr "" @@ -1193,7 +1216,7 @@ msgstr "" msgid " %d\t" msgstr "" -#: dwarf.c:266 dwarf.c:268 dwarf.c:270 dwarf.c:1956 dwarf.c:1958 dwarf.c:1960 +#: dwarf.c:266 dwarf.c:268 dwarf.c:270 dwarf.c:1940 dwarf.c:1942 dwarf.c:1944 #, c-format msgid "%lu\t" msgstr "" @@ -1238,154 +1261,152 @@ msgstr "" msgid " %lu byte block: " msgstr "" -#: dwarf.c:907 +#: dwarf.c:910 #, c-format msgid "(User defined location op)" msgstr "" -#: dwarf.c:909 +#: dwarf.c:912 #, c-format msgid "(Unknown location op)" msgstr "" -#: dwarf.c:955 +#: dwarf.c:958 msgid "Internal error: DWARF version is not 2 or 3.\n" msgstr "" -#: dwarf.c:1053 +#: dwarf.c:1056 msgid "DW_FORM_data8 is unsupported when sizeof (unsigned long) != 8\n" msgstr "" -#: dwarf.c:1102 +#: dwarf.c:1105 #, c-format msgid " (indirect string, offset: 0x%lx): %s" msgstr "" -#: dwarf.c:1111 +#: dwarf.c:1114 #, c-format msgid "Unrecognized form: %lu\n" msgstr "" -#: dwarf.c:1196 +#: dwarf.c:1199 #, c-format msgid "(not inlined)" msgstr "" -#: dwarf.c:1199 +#: dwarf.c:1202 #, c-format msgid "(inlined)" msgstr "" -#: dwarf.c:1202 +#: dwarf.c:1205 #, c-format msgid "(declared as inline but ignored)" msgstr "" -#: dwarf.c:1205 +#: dwarf.c:1208 #, c-format msgid "(declared as inline and inlined)" msgstr "" -#: dwarf.c:1208 +#: dwarf.c:1211 #, c-format msgid " (Unknown inline attribute value: %lx)" msgstr "" -#: dwarf.c:1354 dwarf.c:2484 +#: dwarf.c:1368 dwarf.c:2462 #, c-format msgid " [without DW_AT_frame_base]" msgstr "" -#: dwarf.c:1357 +#: dwarf.c:1371 #, c-format msgid "(location list)" msgstr "" -#: dwarf.c:1475 +#: dwarf.c:1489 #, c-format msgid "Unknown AT value: %lx" msgstr "" -#: dwarf.c:1544 +#: dwarf.c:1558 #, c-format msgid "No comp units in %s section ?" msgstr "" -#: dwarf.c:1553 +#: dwarf.c:1567 #, c-format msgid "Not enough memory for a debug info array of %u entries" msgstr "" -#: dwarf.c:1561 dwarf.c:2573 +#: dwarf.c:1575 dwarf.c:2550 #, c-format msgid "" "The section %s contains:\n" "\n" msgstr "" -#: dwarf.c:1569 +#: dwarf.c:1583 #, c-format msgid "Unable to locate %s section!\n" msgstr "" -#: dwarf.c:1635 +#: dwarf.c:1646 #, c-format msgid " Compilation Unit @ offset 0x%lx:\n" msgstr "" -#: dwarf.c:1636 +#: dwarf.c:1647 #, c-format msgid " Length: %ld\n" msgstr "" -#: dwarf.c:1637 +#: dwarf.c:1648 #, c-format msgid " Version: %d\n" msgstr "" -#: dwarf.c:1638 +#: dwarf.c:1649 #, c-format msgid " Abbrev Offset: %ld\n" msgstr "" -#: dwarf.c:1639 +#: dwarf.c:1650 #, c-format msgid " Pointer Size: %d\n" msgstr "" -#: dwarf.c:1644 +#: dwarf.c:1656 +#, c-format +msgid "Debug info is corrupted, length is invalid (section is %lu bytes)\n" +msgstr "" + +#: dwarf.c:1665 msgid "Only version 2 and 3 DWARF debug information is currently supported.\n" msgstr "" -#: dwarf.c:1685 +#: dwarf.c:1674 +#, c-format +msgid "" +"Debug info is corrupted, abbrev offset is invalid (section is %lu bytes)\n" +msgstr "" + +#: dwarf.c:1702 +#, c-format +msgid " <%d><%lx>: Abbrev Number: %lu" +msgstr "" + +#: dwarf.c:1722 #, c-format msgid "Unable to locate entry %lu in the abbreviation table\n" msgstr "" -#: dwarf.c:1691 +#: dwarf.c:1728 #, c-format -msgid " <%d><%lx>: Abbrev Number: %lu (%s)\n" +msgid " (%s)\n" msgstr "" -#: dwarf.c:1785 -#, c-format -msgid "%s section needs a populated .debug_info section\n" -msgstr "" - -#: dwarf.c:1792 -#, c-format -msgid "%s section has more comp units than .debug_info section\n" -msgstr "" - -#: dwarf.c:1794 -#, c-format -msgid "" -"assuming that the pointer size is %d, from the last comp unit in ." -"debug_info\n" -"\n" -msgstr "" - -#: dwarf.c:1819 +#: dwarf.c:1813 #, c-format msgid "" "\n" @@ -1393,289 +1414,280 @@ msgid "" "\n" msgstr "" -#: dwarf.c:1858 +#: dwarf.c:1851 msgid "The line info appears to be corrupt - the section is too small\n" msgstr "" -#: dwarf.c:1867 +#: dwarf.c:1860 msgid "Only DWARF version 2 and 3 line info is currently supported.\n" msgstr "" -#: dwarf.c:1894 +#: dwarf.c:1881 #, c-format msgid " Length: %ld\n" msgstr "" -#: dwarf.c:1895 +#: dwarf.c:1882 #, c-format msgid " DWARF Version: %d\n" msgstr "" -#: dwarf.c:1896 +#: dwarf.c:1883 #, c-format msgid " Prologue Length: %d\n" msgstr "" -#: dwarf.c:1897 +#: dwarf.c:1884 #, c-format msgid " Minimum Instruction Length: %d\n" msgstr "" -#: dwarf.c:1898 +#: dwarf.c:1885 #, c-format msgid " Initial value of 'is_stmt': %d\n" msgstr "" -#: dwarf.c:1899 +#: dwarf.c:1886 #, c-format msgid " Line Base: %d\n" msgstr "" -#: dwarf.c:1900 +#: dwarf.c:1887 #, c-format msgid " Line Range: %d\n" msgstr "" -#: dwarf.c:1901 +#: dwarf.c:1888 #, c-format msgid " Opcode Base: %d\n" msgstr "" -#: dwarf.c:1902 -#, c-format -msgid " (Pointer size: %u)%s\n" -msgstr "" - -#: dwarf.c:1913 +#: dwarf.c:1897 #, c-format msgid "" "\n" " Opcodes:\n" msgstr "" -#: dwarf.c:1916 +#: dwarf.c:1900 #, c-format msgid " Opcode %d has %d args\n" msgstr "" -#: dwarf.c:1922 +#: dwarf.c:1906 #, c-format msgid "" "\n" " The Directory Table is empty.\n" msgstr "" -#: dwarf.c:1925 +#: dwarf.c:1909 #, c-format msgid "" "\n" " The Directory Table:\n" msgstr "" -#: dwarf.c:1929 +#: dwarf.c:1913 #, c-format msgid " %s\n" msgstr "" -#: dwarf.c:1940 +#: dwarf.c:1924 #, c-format msgid "" "\n" " The File Name Table is empty.\n" msgstr "" -#: dwarf.c:1943 +#: dwarf.c:1927 #, c-format msgid "" "\n" " The File Name Table:\n" msgstr "" -#: dwarf.c:1951 +#: dwarf.c:1935 #, c-format msgid " %d\t" msgstr "" -#: dwarf.c:1962 +#: dwarf.c:1946 #, c-format msgid "%s\n" msgstr "" #. Now display the statements. -#: dwarf.c:1970 +#: dwarf.c:1954 #, c-format msgid "" "\n" " Line Number Statements:\n" msgstr "" -#: dwarf.c:1986 +#: dwarf.c:1970 #, c-format msgid " Special opcode %d: advance Address by %lu to 0x%lx" msgstr "" -#: dwarf.c:1990 +#: dwarf.c:1974 #, c-format msgid " and Line by %d to %d\n" msgstr "" -#: dwarf.c:1998 -msgid "Extend line ops need a valid pointer size, guessing at 4\n" -msgstr "" - -#: dwarf.c:2007 +#: dwarf.c:1984 #, c-format msgid " Copy\n" msgstr "" -#: dwarf.c:2015 +#: dwarf.c:1992 #, c-format msgid " Advance PC by %lu to 0x%lx\n" msgstr "" -#: dwarf.c:2023 +#: dwarf.c:2000 #, c-format msgid " Advance Line by %d to %d\n" msgstr "" -#: dwarf.c:2030 +#: dwarf.c:2007 #, c-format msgid " Set File Name to entry %d in the File Name Table\n" msgstr "" -#: dwarf.c:2038 +#: dwarf.c:2015 #, c-format msgid " Set column to %lu\n" msgstr "" -#: dwarf.c:2045 +#: dwarf.c:2022 #, c-format msgid " Set is_stmt to %d\n" msgstr "" -#: dwarf.c:2050 +#: dwarf.c:2027 #, c-format msgid " Set basic block\n" msgstr "" -#: dwarf.c:2058 +#: dwarf.c:2035 #, c-format msgid " Advance PC by constant %lu to 0x%lx\n" msgstr "" -#: dwarf.c:2066 +#: dwarf.c:2043 #, c-format msgid " Advance PC by fixed size amount %lu to 0x%lx\n" msgstr "" -#: dwarf.c:2071 +#: dwarf.c:2048 #, c-format msgid " Set prologue_end to true\n" msgstr "" -#: dwarf.c:2075 +#: dwarf.c:2052 #, c-format msgid " Set epilogue_begin to true\n" msgstr "" -#: dwarf.c:2081 +#: dwarf.c:2058 #, c-format msgid " Set ISA to %lu\n" msgstr "" -#: dwarf.c:2085 +#: dwarf.c:2062 #, c-format msgid " Unknown opcode %d with operands: " msgstr "" -#: dwarf.c:2111 dwarf.c:2197 dwarf.c:2271 dwarf.c:2382 dwarf.c:2514 -#: dwarf.c:2739 +#: dwarf.c:2088 dwarf.c:2174 dwarf.c:2248 dwarf.c:2360 dwarf.c:2492 +#: dwarf.c:2731 #, c-format msgid "" "Contents of the %s section:\n" "\n" msgstr "" -#: dwarf.c:2151 +#: dwarf.c:2128 msgid "Only DWARF 2 and 3 pubnames are currently supported\n" msgstr "" -#: dwarf.c:2158 +#: dwarf.c:2135 #, c-format msgid " Length: %ld\n" msgstr "" -#: dwarf.c:2160 +#: dwarf.c:2137 #, c-format msgid " Version: %d\n" msgstr "" -#: dwarf.c:2162 +#: dwarf.c:2139 #, c-format msgid " Offset into .debug_info section: %ld\n" msgstr "" -#: dwarf.c:2164 +#: dwarf.c:2141 #, c-format msgid " Size of area in .debug_info section: %ld\n" msgstr "" -#: dwarf.c:2167 +#: dwarf.c:2144 #, c-format msgid "" "\n" " Offset\tName\n" msgstr "" -#: dwarf.c:2218 +#: dwarf.c:2195 #, c-format msgid " DW_MACINFO_start_file - lineno: %d filenum: %d\n" msgstr "" -#: dwarf.c:2224 +#: dwarf.c:2201 #, c-format msgid " DW_MACINFO_end_file\n" msgstr "" -#: dwarf.c:2232 +#: dwarf.c:2209 #, c-format msgid " DW_MACINFO_define - lineno : %d macro : %s\n" msgstr "" -#: dwarf.c:2241 +#: dwarf.c:2218 #, c-format msgid " DW_MACINFO_undef - lineno : %d macro : %s\n" msgstr "" -#: dwarf.c:2253 +#: dwarf.c:2230 #, c-format msgid " DW_MACINFO_vendor_ext - constant : %d string : %s\n" msgstr "" -#: dwarf.c:2282 +#: dwarf.c:2259 #, c-format msgid " Number TAG\n" msgstr "" -#: dwarf.c:2288 +#: dwarf.c:2265 #, c-format msgid " %ld %s [%s]\n" msgstr "" -#: dwarf.c:2291 +#: dwarf.c:2268 msgid "has children" msgstr "" -#: dwarf.c:2291 +#: dwarf.c:2268 msgid "no children" msgstr "" -#: dwarf.c:2294 +#: dwarf.c:2271 #, c-format msgid " %-18s %s\n" msgstr "" -#: dwarf.c:2327 dwarf.c:2510 dwarf.c:2684 +#: dwarf.c:2304 dwarf.c:2488 dwarf.c:2675 #, c-format msgid "" "\n" @@ -1683,148 +1695,164 @@ msgid "" msgstr "" #. FIXME: Should we handle this case? -#: dwarf.c:2372 +#: dwarf.c:2349 msgid "Location lists in .debug_info section aren't in ascending order!\n" msgstr "" -#: dwarf.c:2375 +#: dwarf.c:2352 msgid "No location lists in .debug_info section!\n" msgstr "" -#: dwarf.c:2379 +#: dwarf.c:2357 #, c-format msgid "Location lists in %s section start at 0x%lx\n" msgstr "" -#: dwarf.c:2383 +#: dwarf.c:2361 #, c-format msgid " Offset Begin End Expression\n" msgstr "" -#: dwarf.c:2414 +#: dwarf.c:2392 #, c-format msgid "There is a hole [0x%lx - 0x%lx] in .debug_loc section.\n" msgstr "" -#: dwarf.c:2417 +#: dwarf.c:2395 #, c-format msgid "There is an overlap [0x%lx - 0x%lx] in .debug_loc section.\n" msgstr "" -#: dwarf.c:2424 +#: dwarf.c:2402 #, c-format msgid "Offset 0x%lx is bigger than .debug_loc section size.\n" msgstr "" -#: dwarf.c:2433 dwarf.c:2460 dwarf.c:2470 +#: dwarf.c:2411 dwarf.c:2438 dwarf.c:2448 #, c-format msgid "Location list starting at offset 0x%lx is not terminated.\n" msgstr "" -#: dwarf.c:2445 dwarf.c:2784 +#: dwarf.c:2423 dwarf.c:2776 #, c-format msgid " %8.8lx \n" msgstr "" -#: dwarf.c:2453 +#: dwarf.c:2431 #, c-format msgid " %8.8lx %8.8lx %8.8lx (base address)\n" msgstr "" -#: dwarf.c:2487 dwarf.c:2801 +#: dwarf.c:2465 dwarf.c:2793 msgid " (start == end)" msgstr "" -#: dwarf.c:2489 dwarf.c:2803 +#: dwarf.c:2467 dwarf.c:2795 msgid " (start > end)" msgstr "" -#: dwarf.c:2618 +#: dwarf.c:2596 msgid "Only DWARF 2 and 3 aranges are currently supported.\n" msgstr "" -#: dwarf.c:2622 +#: dwarf.c:2600 #, c-format msgid " Length: %ld\n" msgstr "" -#: dwarf.c:2623 +#: dwarf.c:2601 #, c-format msgid " Version: %d\n" msgstr "" -#: dwarf.c:2624 +#: dwarf.c:2602 #, c-format msgid " Offset into .debug_info: %lx\n" msgstr "" -#: dwarf.c:2625 +#: dwarf.c:2603 #, c-format msgid " Pointer Size: %d\n" msgstr "" -#: dwarf.c:2626 +#: dwarf.c:2604 #, c-format msgid " Segment Size: %d\n" msgstr "" -#: dwarf.c:2628 +#: dwarf.c:2613 +msgid "Pointer size + Segment size is not a power of two.\n" +msgstr "" + +#: dwarf.c:2618 #, c-format msgid "" "\n" -" Address Length\n" +" Address Length\n" +msgstr "" + +#: dwarf.c:2620 +#, c-format +msgid "" +"\n" +" Address Length\n" msgstr "" #. FIXME: Should we handle this case? -#: dwarf.c:2729 +#: dwarf.c:2720 msgid "Range lists in .debug_info section aren't in ascending order!\n" msgstr "" -#: dwarf.c:2732 +#: dwarf.c:2723 msgid "No range lists in .debug_info section!\n" msgstr "" -#: dwarf.c:2736 +#: dwarf.c:2728 #, c-format msgid "Range lists in %s section start at 0x%lx\n" msgstr "" -#: dwarf.c:2740 +#: dwarf.c:2732 #, c-format msgid " Offset Begin End\n" msgstr "" -#: dwarf.c:2765 +#: dwarf.c:2757 #, c-format msgid "There is a hole [0x%lx - 0x%lx] in %s section.\n" msgstr "" -#: dwarf.c:2769 +#: dwarf.c:2761 #, c-format msgid "There is an overlap [0x%lx - 0x%lx] in %s section.\n" msgstr "" -#: dwarf.c:2964 +#: dwarf.c:2963 #, c-format msgid "The section %s contains:\n" msgstr "" -#: dwarf.c:3608 +#: dwarf.c:3650 #, c-format -msgid "unsupported or unknown DW_CFA_%d\n" +msgid " DW_CFA_??? (User defined call frame op: %#x)\n" msgstr "" -#: dwarf.c:3632 +#: dwarf.c:3652 +#, c-format +msgid "unsupported or unknown Dwarf Call Frame Instruction number: %#x\n" +msgstr "" + +#: dwarf.c:3676 #, c-format msgid "Displaying the debug contents of section %s is not yet supported.\n" msgstr "" -#: dwarf.c:3674 +#: dwarf.c:3718 #, c-format msgid "%s: Error: " msgstr "" -#: dwarf.c:3685 +#: dwarf.c:3729 #, c-format msgid "%s: Warning: " msgstr "" @@ -1849,223 +1877,223 @@ msgstr "" msgid " [-X32_64] - accepts 32 and 64 bit objects\n" msgstr "" -#: ieee.c:311 +#: ieee.c:309 msgid "unexpected end of debugging information" msgstr "" -#: ieee.c:398 +#: ieee.c:396 msgid "invalid number" msgstr "" -#: ieee.c:451 +#: ieee.c:449 msgid "invalid string length" msgstr "" -#: ieee.c:506 ieee.c:547 +#: ieee.c:504 ieee.c:545 msgid "expression stack overflow" msgstr "" -#: ieee.c:526 +#: ieee.c:524 msgid "unsupported IEEE expression operator" msgstr "" -#: ieee.c:541 +#: ieee.c:539 msgid "unknown section" msgstr "" -#: ieee.c:562 +#: ieee.c:560 msgid "expression stack underflow" msgstr "" -#: ieee.c:576 +#: ieee.c:574 msgid "expression stack mismatch" msgstr "" -#: ieee.c:613 +#: ieee.c:611 msgid "unknown builtin type" msgstr "" -#: ieee.c:758 +#: ieee.c:756 msgid "BCD float type not supported" msgstr "" -#: ieee.c:895 +#: ieee.c:893 msgid "unexpected number" msgstr "" -#: ieee.c:902 +#: ieee.c:900 msgid "unexpected record type" msgstr "" -#: ieee.c:935 +#: ieee.c:933 msgid "blocks left on stack at end" msgstr "" -#: ieee.c:1198 +#: ieee.c:1196 msgid "unknown BB type" msgstr "" -#: ieee.c:1207 +#: ieee.c:1205 msgid "stack overflow" msgstr "" -#: ieee.c:1230 +#: ieee.c:1228 msgid "stack underflow" msgstr "" -#: ieee.c:1342 ieee.c:1412 ieee.c:2109 +#: ieee.c:1340 ieee.c:1410 ieee.c:2107 msgid "illegal variable index" msgstr "" -#: ieee.c:1390 +#: ieee.c:1388 msgid "illegal type index" msgstr "" -#: ieee.c:1400 ieee.c:1437 +#: ieee.c:1398 ieee.c:1435 msgid "unknown TY code" msgstr "" -#: ieee.c:1419 +#: ieee.c:1417 msgid "undefined variable in TY" msgstr "" #. Pascal file name. FIXME. -#: ieee.c:1830 +#: ieee.c:1828 msgid "Pascal file name not supported" msgstr "" -#: ieee.c:1878 +#: ieee.c:1876 msgid "unsupported qualifier" msgstr "" -#: ieee.c:2147 +#: ieee.c:2145 msgid "undefined variable in ATN" msgstr "" -#: ieee.c:2190 +#: ieee.c:2188 msgid "unknown ATN type" msgstr "" #. Reserved for FORTRAN common. -#: ieee.c:2312 +#: ieee.c:2310 msgid "unsupported ATN11" msgstr "" #. We have no way to record this information. FIXME. -#: ieee.c:2339 +#: ieee.c:2337 msgid "unsupported ATN12" msgstr "" -#: ieee.c:2399 +#: ieee.c:2397 msgid "unexpected string in C++ misc" msgstr "" -#: ieee.c:2412 +#: ieee.c:2410 msgid "bad misc record" msgstr "" -#: ieee.c:2453 +#: ieee.c:2451 msgid "unrecognized C++ misc record" msgstr "" -#: ieee.c:2568 +#: ieee.c:2566 msgid "undefined C++ object" msgstr "" -#: ieee.c:2602 +#: ieee.c:2600 msgid "unrecognized C++ object spec" msgstr "" -#: ieee.c:2638 +#: ieee.c:2636 msgid "unsupported C++ object type" msgstr "" -#: ieee.c:2648 +#: ieee.c:2646 msgid "C++ base class not defined" msgstr "" -#: ieee.c:2660 ieee.c:2765 +#: ieee.c:2658 ieee.c:2763 msgid "C++ object has no fields" msgstr "" -#: ieee.c:2679 +#: ieee.c:2677 msgid "C++ base class not found in container" msgstr "" -#: ieee.c:2786 +#: ieee.c:2784 msgid "C++ data member not found in container" msgstr "" -#: ieee.c:2827 ieee.c:2977 +#: ieee.c:2825 ieee.c:2975 msgid "unknown C++ visibility" msgstr "" -#: ieee.c:2861 +#: ieee.c:2859 msgid "bad C++ field bit pos or size" msgstr "" -#: ieee.c:2953 +#: ieee.c:2951 msgid "bad type for C++ method function" msgstr "" -#: ieee.c:2963 +#: ieee.c:2961 msgid "no type information for C++ method function" msgstr "" -#: ieee.c:3002 +#: ieee.c:3000 msgid "C++ static virtual method" msgstr "" -#: ieee.c:3097 +#: ieee.c:3095 msgid "unrecognized C++ object overhead spec" msgstr "" -#: ieee.c:3136 +#: ieee.c:3134 msgid "undefined C++ vtable" msgstr "" -#: ieee.c:3205 +#: ieee.c:3203 msgid "C++ default values not in a function" msgstr "" -#: ieee.c:3245 +#: ieee.c:3243 msgid "unrecognized C++ default type" msgstr "" -#: ieee.c:3276 +#: ieee.c:3274 msgid "reference parameter is not a pointer" msgstr "" -#: ieee.c:3359 +#: ieee.c:3357 msgid "unrecognized C++ reference type" msgstr "" -#: ieee.c:3441 +#: ieee.c:3439 msgid "C++ reference not found" msgstr "" -#: ieee.c:3449 +#: ieee.c:3447 msgid "C++ reference is not pointer" msgstr "" -#: ieee.c:3475 ieee.c:3483 +#: ieee.c:3473 ieee.c:3481 msgid "missing required ASN" msgstr "" -#: ieee.c:3510 ieee.c:3518 +#: ieee.c:3508 ieee.c:3516 msgid "missing required ATN65" msgstr "" -#: ieee.c:3532 +#: ieee.c:3530 msgid "bad ATN65 record" msgstr "" -#: ieee.c:4160 +#: ieee.c:4158 #, c-format msgid "IEEE numeric overflow: 0x" msgstr "" -#: ieee.c:4204 +#: ieee.c:4202 #, c-format msgid "IEEE string length overflow: %u\n" msgstr "" @@ -2085,124 +2113,128 @@ msgstr "" msgid "IEEE unsupported complex type size %u\n" msgstr "" -#: nlmconv.c:269 srconv.c:1813 +#: mclex.c:241 +msgid "Duplicate symbol entered into keyword list." +msgstr "" + +#: nlmconv.c:271 srconv.c:1815 msgid "input and output files must be different" msgstr "" -#: nlmconv.c:316 +#: nlmconv.c:318 msgid "input file named both on command line and with INPUT" msgstr "" -#: nlmconv.c:325 +#: nlmconv.c:327 msgid "no input file" msgstr "" -#: nlmconv.c:355 +#: nlmconv.c:357 msgid "no name for output file" msgstr "" -#: nlmconv.c:369 +#: nlmconv.c:371 msgid "warning: input and output formats are not compatible" msgstr "" -#: nlmconv.c:398 +#: nlmconv.c:400 msgid "make .bss section" msgstr "" -#: nlmconv.c:407 +#: nlmconv.c:409 msgid "make .nlmsections section" msgstr "" -#: nlmconv.c:409 +#: nlmconv.c:411 msgid "set .nlmsections flags" msgstr "" -#: nlmconv.c:437 +#: nlmconv.c:439 msgid "set .bss vma" msgstr "" -#: nlmconv.c:444 +#: nlmconv.c:446 msgid "set .data size" msgstr "" -#: nlmconv.c:624 +#: nlmconv.c:626 #, c-format msgid "warning: symbol %s imported but not in import list" msgstr "" -#: nlmconv.c:644 +#: nlmconv.c:646 msgid "set start address" msgstr "" -#: nlmconv.c:693 -#, c-format -msgid "warning: START procedure %s not defined" -msgstr "" - #: nlmconv.c:695 #, c-format -msgid "warning: EXIT procedure %s not defined" +msgid "warning: START procedure %s not defined" msgstr "" #: nlmconv.c:697 #, c-format +msgid "warning: EXIT procedure %s not defined" +msgstr "" + +#: nlmconv.c:699 +#, c-format msgid "warning: CHECK procedure %s not defined" msgstr "" -#: nlmconv.c:718 nlmconv.c:907 +#: nlmconv.c:720 nlmconv.c:909 msgid "custom section" msgstr "" -#: nlmconv.c:739 nlmconv.c:936 +#: nlmconv.c:741 nlmconv.c:938 msgid "help section" msgstr "" -#: nlmconv.c:761 nlmconv.c:954 +#: nlmconv.c:763 nlmconv.c:956 msgid "message section" msgstr "" -#: nlmconv.c:777 nlmconv.c:987 +#: nlmconv.c:779 nlmconv.c:989 msgid "module section" msgstr "" -#: nlmconv.c:797 nlmconv.c:1003 +#: nlmconv.c:799 nlmconv.c:1005 msgid "rpc section" msgstr "" #. There is no place to record this information. -#: nlmconv.c:833 +#: nlmconv.c:835 #, c-format msgid "%s: warning: shared libraries can not have uninitialized data" msgstr "" -#: nlmconv.c:854 nlmconv.c:1022 +#: nlmconv.c:856 nlmconv.c:1024 msgid "shared section" msgstr "" -#: nlmconv.c:862 +#: nlmconv.c:864 msgid "warning: No version number given" msgstr "" -#: nlmconv.c:902 nlmconv.c:931 nlmconv.c:949 nlmconv.c:998 nlmconv.c:1017 +#: nlmconv.c:904 nlmconv.c:933 nlmconv.c:951 nlmconv.c:1000 nlmconv.c:1019 #, c-format msgid "%s: read: %s" msgstr "" -#: nlmconv.c:924 +#: nlmconv.c:926 msgid "warning: FULLMAP is not supported; try ld -M" msgstr "" -#: nlmconv.c:1100 +#: nlmconv.c:1102 #, c-format msgid "Usage: %s [option(s)] [in-file [out-file]]\n" msgstr "" -#: nlmconv.c:1101 +#: nlmconv.c:1103 #, c-format msgid " Convert an object file into a NetWare Loadable Module\n" msgstr "" -#: nlmconv.c:1102 +#: nlmconv.c:1104 #, c-format msgid "" " The options are:\n" @@ -2216,74 +2248,74 @@ msgid "" " -v --version Display the program's version\n" msgstr "" -#: nlmconv.c:1143 +#: nlmconv.c:1145 #, c-format msgid "support not compiled in for %s" msgstr "" -#: nlmconv.c:1180 +#: nlmconv.c:1182 msgid "make section" msgstr "" -#: nlmconv.c:1194 +#: nlmconv.c:1196 msgid "set section size" msgstr "" -#: nlmconv.c:1200 +#: nlmconv.c:1202 msgid "set section alignment" msgstr "" -#: nlmconv.c:1204 +#: nlmconv.c:1206 msgid "set section flags" msgstr "" -#: nlmconv.c:1215 +#: nlmconv.c:1217 msgid "set .nlmsections size" msgstr "" -#: nlmconv.c:1296 nlmconv.c:1304 nlmconv.c:1313 nlmconv.c:1318 +#: nlmconv.c:1298 nlmconv.c:1306 nlmconv.c:1315 nlmconv.c:1320 msgid "set .nlmsection contents" msgstr "" -#: nlmconv.c:1797 +#: nlmconv.c:1799 msgid "stub section sizes" msgstr "" -#: nlmconv.c:1844 +#: nlmconv.c:1846 msgid "writing stub" msgstr "" -#: nlmconv.c:1928 +#: nlmconv.c:1930 #, c-format msgid "unresolved PC relative reloc against %s" msgstr "" -#: nlmconv.c:1992 +#: nlmconv.c:1994 #, c-format msgid "overflow when adjusting relocation against %s" msgstr "" -#: nlmconv.c:2119 +#: nlmconv.c:2121 #, c-format msgid "%s: execution of %s failed: " msgstr "" -#: nlmconv.c:2134 +#: nlmconv.c:2136 #, c-format msgid "Execution of %s failed" msgstr "" -#: nm.c:224 size.c:82 strings.c:708 +#: nm.c:213 size.c:83 strings.c:705 #, c-format msgid "Usage: %s [option(s)] [file(s)]\n" msgstr "" -#: nm.c:225 +#: nm.c:214 #, c-format msgid " List symbols in [file(s)] (a.out by default).\n" msgstr "" -#: nm.c:226 +#: nm.c:215 #, c-format msgid "" " The options are:\n" @@ -2327,44 +2359,39 @@ msgid "" "\n" msgstr "" -#: nm.c:263 objdump.c:236 -#, c-format -msgid "Report bugs to %s.\n" -msgstr "" - -#: nm.c:295 +#: nm.c:276 #, c-format msgid "%s: invalid radix" msgstr "" -#: nm.c:319 +#: nm.c:300 #, c-format msgid "%s: invalid output format" msgstr "" -#: nm.c:340 readelf.c:6623 readelf.c:6659 +#: nm.c:321 readelf.c:6853 readelf.c:6891 #, c-format msgid ": %d" msgstr "" -#: nm.c:342 readelf.c:6626 readelf.c:6671 +#: nm.c:323 readelf.c:6856 readelf.c:6903 #, c-format msgid ": %d" msgstr "" -#: nm.c:344 readelf.c:6628 readelf.c:6674 +#: nm.c:325 readelf.c:6858 readelf.c:6906 #, c-format msgid ": %d" msgstr "" -#: nm.c:381 +#: nm.c:365 #, c-format msgid "" "\n" "Archive index:\n" msgstr "" -#: nm.c:1227 +#: nm.c:1225 #, c-format msgid "" "\n" @@ -2373,7 +2400,7 @@ msgid "" "\n" msgstr "" -#: nm.c:1229 +#: nm.c:1227 #, c-format msgid "" "\n" @@ -2382,7 +2409,7 @@ msgid "" "\n" msgstr "" -#: nm.c:1231 nm.c:1282 +#: nm.c:1229 nm.c:1280 #, c-format msgid "" "Name Value Class Type Size Line " @@ -2390,7 +2417,7 @@ msgid "" "\n" msgstr "" -#: nm.c:1234 nm.c:1285 +#: nm.c:1232 nm.c:1283 #, c-format msgid "" "Name Value Class Type " @@ -2398,7 +2425,7 @@ msgid "" "\n" msgstr "" -#: nm.c:1278 +#: nm.c:1276 #, c-format msgid "" "\n" @@ -2407,7 +2434,7 @@ msgid "" "\n" msgstr "" -#: nm.c:1280 +#: nm.c:1278 #, c-format msgid "" "\n" @@ -2416,39 +2443,44 @@ msgid "" "\n" msgstr "" -#: nm.c:1584 +#: nm.c:1370 +#, c-format +msgid "Print width has not been initialized (%d)" +msgstr "" + +#: nm.c:1595 msgid "Only -X 32_64 is supported" msgstr "" -#: nm.c:1604 +#: nm.c:1615 msgid "Using the --size-sort and --undefined-only options together" msgstr "" -#: nm.c:1605 +#: nm.c:1616 msgid "will produce no output, since undefined symbols have no size." msgstr "" -#: nm.c:1633 +#: nm.c:1644 #, c-format msgid "data size %ld" msgstr "" -#: objcopy.c:401 srconv.c:1721 +#: objcopy.c:426 srconv.c:1723 #, c-format msgid "Usage: %s [option(s)] in-file [out-file]\n" msgstr "" -#: objcopy.c:402 +#: objcopy.c:427 #, c-format msgid " Copies a binary file, possibly transforming it in the process\n" msgstr "" -#: objcopy.c:403 objcopy.c:495 +#: objcopy.c:428 objcopy.c:524 #, c-format msgid " The options are:\n" msgstr "" -#: objcopy.c:404 +#: objcopy.c:429 #, c-format msgid "" " -I --input-target Assume input file is in format \n" @@ -2478,7 +2510,10 @@ msgid "" " relocations\n" " --only-keep-debug Strip everything but the debug " "information\n" +" --extract-symbol Remove section contents but keep symbols\n" " -K --keep-symbol Do not strip symbol \n" +" --keep-file-symbols Do not strip file symbol(s)\n" +" --localize-hidden Turn all ELF hidden symbols into locals\n" " -L --localize-symbol Force symbol to be marked as a " "local\n" " --globalize-symbol Force symbol to be marked as a " @@ -2525,6 +2560,8 @@ msgid "" "style\n" " --remove-leading-char Remove leading character from global " "symbols\n" +" --reverse-bytes= Reverse bytes at a time, in output " +"sections with content\n" " --redefine-sym = Redefine symbol name to \n" " --redefine-syms --redefine-sym for all symbol pairs \n" " listed in \n" @@ -2542,7 +2579,8 @@ msgid "" " --globalize-symbols --globalize-symbol for all in \n" " --keep-global-symbols -G for all symbols listed in \n" " --weaken-symbols -W for all symbols listed in \n" -" --alt-machine-code Use alternate machine code for output\n" +" --alt-machine-code Use the target's 'th alternative " +"machine\n" " --writable-text Mark the output text as writable\n" " --readonly-text Make the output text write protected\n" " --pure Mark the output file as demand paged\n" @@ -2563,17 +2601,17 @@ msgid "" "supported\n" msgstr "" -#: objcopy.c:493 +#: objcopy.c:522 #, c-format msgid "Usage: %s in-file(s)\n" msgstr "" -#: objcopy.c:494 +#: objcopy.c:523 #, c-format msgid " Removes symbols and sections from files\n" msgstr "" -#: objcopy.c:496 +#: objcopy.c:525 #, c-format msgid "" " -I --input-target= Assume input file is in format \n" @@ -2593,6 +2631,7 @@ msgid "" "information\n" " -N --strip-symbol= Do not copy symbol \n" " -K --keep-symbol= Do not strip symbol \n" +" --keep-file-symbols Do not strip file symbol(s)\n" " -w --wildcard Permit wildcard in symbol comparison\n" " -x --discard-all Remove all non-global symbols\n" " -X --discard-locals Remove any compiler-generated symbols\n" @@ -2604,260 +2643,297 @@ msgid "" " -o Place stripped output into \n" msgstr "" -#: objcopy.c:568 +#: objcopy.c:598 #, c-format msgid "unrecognized section flag `%s'" msgstr "" -#: objcopy.c:569 +#: objcopy.c:599 #, c-format msgid "supported flags: %s" msgstr "" -#: objcopy.c:646 +#: objcopy.c:679 #, c-format msgid "cannot open '%s': %s" msgstr "" -#: objcopy.c:649 objcopy.c:2722 +#: objcopy.c:682 objcopy.c:2987 #, c-format msgid "%s: fread failed" msgstr "" -#: objcopy.c:722 +#: objcopy.c:755 #, c-format msgid "%s:%d: Ignoring rubbish found on this line" msgstr "" -#: objcopy.c:996 +#: objcopy.c:1033 +#, c-format +msgid "not stripping symbol `%s' because it is named in a relocation" +msgstr "" + +#: objcopy.c:1116 #, c-format msgid "%s: Multiple redefinition of symbol \"%s\"" msgstr "" -#: objcopy.c:1000 +#: objcopy.c:1120 #, c-format msgid "%s: Symbol \"%s\" is target of more than one redefinition" msgstr "" -#: objcopy.c:1028 +#: objcopy.c:1148 #, c-format msgid "couldn't open symbol redefinition file %s (error: %s)" msgstr "" -#: objcopy.c:1106 +#: objcopy.c:1226 #, c-format msgid "%s:%d: garbage found at end of line" msgstr "" -#: objcopy.c:1109 +#: objcopy.c:1229 #, c-format msgid "%s:%d: missing new symbol name" msgstr "" -#: objcopy.c:1119 +#: objcopy.c:1239 #, c-format msgid "%s:%d: premature end of file" msgstr "" -#: objcopy.c:1145 +#: objcopy.c:1265 #, c-format msgid "stat returns negative size for `%s'" msgstr "" -#: objcopy.c:1157 +#: objcopy.c:1277 #, c-format msgid "copy from `%s' [unknown] to `%s' [unknown]\n" msgstr "" -#: objcopy.c:1212 +#: objcopy.c:1332 msgid "Unable to change endianness of input file(s)" msgstr "" -#: objcopy.c:1221 +#: objcopy.c:1341 #, c-format msgid "copy from `%s' [%s] to `%s' [%s]\n" msgstr "" -#: objcopy.c:1258 objcopy.c:1715 +#: objcopy.c:1383 objcopy.c:1908 #, c-format msgid "Unable to recognise the format of the input file `%s'" msgstr "" -#: objcopy.c:1261 +#: objcopy.c:1386 #, c-format msgid "Warning: Output file cannot represent architecture `%s'" msgstr "" -#: objcopy.c:1305 +#: objcopy.c:1449 +#, c-format +msgid "can't add section '%s' - it already exists!" +msgstr "" + +#: objcopy.c:1457 #, c-format msgid "can't create section `%s': %s" msgstr "" -#: objcopy.c:1356 -msgid "there are no sections to be copied!" -msgstr "" - -#: objcopy.c:1402 +#: objcopy.c:1593 #, c-format msgid "Can't fill gap after %s: %s" msgstr "" -#: objcopy.c:1427 +#: objcopy.c:1618 #, c-format msgid "Can't add padding to %s: %s" msgstr "" -#: objcopy.c:1594 +#: objcopy.c:1771 #, c-format msgid "%s: error copying private BFD data: %s" msgstr "" -#: objcopy.c:1605 -msgid "unknown alternate machine code, ignored" -msgstr "" - -#: objcopy.c:1635 objcopy.c:1665 +#: objcopy.c:1784 #, c-format -msgid "cannot mkdir %s for archive copying (error: %s)" +msgid "this target does not support %lu alternative machine codes" msgstr "" -#: objcopy.c:1787 +#: objcopy.c:1788 +msgid "treating that number as an absolute e_machine value instead" +msgstr "" + +#: objcopy.c:1792 +msgid "ignoring the alternative value" +msgstr "" + +#: objcopy.c:1822 objcopy.c:1852 #, c-format -msgid "error: the input file '%s' is empty" +msgid "cannot create tempdir for archive copying (error: %s)" msgstr "" -#: objcopy.c:1889 +#: objcopy.c:2088 #, c-format msgid "Multiple renames of section %s" msgstr "" -#: objcopy.c:1940 +#: objcopy.c:2139 msgid "private header data" msgstr "" -#: objcopy.c:1948 +#: objcopy.c:2147 #, c-format msgid "%s: error in %s: %s" msgstr "" -#: objcopy.c:2007 +#: objcopy.c:2208 msgid "making" msgstr "" -#: objcopy.c:2022 +#: objcopy.c:2228 msgid "size" msgstr "" -#: objcopy.c:2036 +#: objcopy.c:2242 msgid "vma" msgstr "" -#: objcopy.c:2061 +#: objcopy.c:2267 msgid "alignment" msgstr "" -#: objcopy.c:2083 +#: objcopy.c:2289 msgid "private data" msgstr "" -#: objcopy.c:2091 +#: objcopy.c:2304 #, c-format msgid "%s: section `%s': error in %s: %s" msgstr "" -#: objcopy.c:2363 +#. User must pad the section up in order to do this. +#: objcopy.c:2429 +#, c-format +msgid "" +"cannot reverse bytes: length of section %s must be evenly divisible by %d" +msgstr "" + +#: objcopy.c:2605 #, c-format msgid "%s: can't create debugging section: %s" msgstr "" -#: objcopy.c:2377 +#: objcopy.c:2619 #, c-format msgid "%s: can't set debugging section contents: %s" msgstr "" -#: objcopy.c:2386 +#: objcopy.c:2628 #, c-format msgid "%s: don't know how to write debugging information for %s" msgstr "" -#: objcopy.c:2561 +#: objcopy.c:2769 +#, c-format +msgid "could not create temporary file to hold stripped copy of '%s'" +msgstr "" + +#: objcopy.c:2819 msgid "byte number must be non-negative" msgstr "" -#: objcopy.c:2571 +#: objcopy.c:2829 msgid "interleave must be positive" msgstr "" -#: objcopy.c:2591 objcopy.c:2599 +#: objcopy.c:2849 objcopy.c:2857 #, c-format msgid "%s both copied and removed" msgstr "" -#: objcopy.c:2696 objcopy.c:2767 objcopy.c:2867 objcopy.c:2898 objcopy.c:2922 -#: objcopy.c:2926 objcopy.c:2946 +#: objcopy.c:2958 objcopy.c:3032 objcopy.c:3132 objcopy.c:3163 objcopy.c:3187 +#: objcopy.c:3191 objcopy.c:3211 #, c-format msgid "bad format for %s" msgstr "" -#: objcopy.c:2717 +#: objcopy.c:2982 #, c-format msgid "cannot open: %s: %s" msgstr "" -#: objcopy.c:2836 +#: objcopy.c:3101 #, c-format msgid "Warning: truncating gap-fill from 0x%s to 0x%x" msgstr "" -#: objcopy.c:3000 -msgid "alternate machine code index must be positive" +#: objcopy.c:3269 +msgid "unable to parse alternative machine code" msgstr "" -#: objcopy.c:3058 +#: objcopy.c:3314 +msgid "number of bytes to reverse must be positive and even" +msgstr "" + +#: objcopy.c:3317 +#, c-format +msgid "Warning: ignoring previous --reverse-bytes value of %d" +msgstr "" + +#: objcopy.c:3345 msgid "byte number must be less than interleave" msgstr "" -#: objcopy.c:3088 +#: objcopy.c:3375 #, c-format msgid "architecture %s unknown" msgstr "" -#: objcopy.c:3092 +#: objcopy.c:3379 msgid "" "Warning: input target 'binary' required for binary architecture parameter." msgstr "" -#: objcopy.c:3093 +#: objcopy.c:3380 #, c-format msgid " Argument %s ignored" msgstr "" -#: objcopy.c:3099 +#: objcopy.c:3386 #, c-format msgid "warning: could not locate '%s'. System error message: %s" msgstr "" -#: objcopy.c:3141 objcopy.c:3155 +#: objcopy.c:3397 +#, c-format +msgid "" +"warning: could not create temporary file whilst copying '%s', (error: %s)" +msgstr "" + +#: objcopy.c:3424 objcopy.c:3438 #, c-format msgid "%s %s%c0x%s never used" msgstr "" -#: objdump.c:178 +#: objdump.c:176 #, c-format msgid "Usage: %s \n" msgstr "" -#: objdump.c:179 +#: objdump.c:177 #, c-format msgid " Display information from object .\n" msgstr "" -#: objdump.c:180 +#: objdump.c:178 #, c-format msgid " At least one of the following switches must be given:\n" msgstr "" -#: objdump.c:181 +#: objdump.c:179 #, c-format msgid "" " -a, --archive-headers Display archive header information\n" @@ -2887,14 +2963,14 @@ msgid "" " -H, --help Display this information\n" msgstr "" -#: objdump.c:206 +#: objdump.c:204 #, c-format msgid "" "\n" " The following switches are optional:\n" msgstr "" -#: objdump.c:207 +#: objdump.c:205 #, c-format msgid "" " -b, --target=BFDNAME Specify the target object format as " @@ -2931,347 +3007,364 @@ msgid "" "\n" msgstr "" -#: objdump.c:389 +#: objdump.c:387 #, c-format msgid "Sections:\n" msgstr "" -#: objdump.c:392 objdump.c:396 +#: objdump.c:390 objdump.c:394 #, c-format msgid "Idx Name Size VMA LMA File off Algn" msgstr "" -#: objdump.c:398 +#: objdump.c:396 #, c-format msgid "" "Idx Name Size VMA LMA File off " "Algn" msgstr "" -#: objdump.c:402 +#: objdump.c:400 #, c-format msgid " Flags" msgstr "" -#: objdump.c:404 +#: objdump.c:402 #, c-format msgid " Pg" msgstr "" -#: objdump.c:447 +#: objdump.c:445 #, c-format msgid "%s: not a dynamic object" msgstr "" -#: objdump.c:1735 +#: objdump.c:1778 #, c-format msgid "Disassembly of section %s:\n" msgstr "" -#: objdump.c:1897 +#: objdump.c:1940 #, c-format msgid "Can't use supplied machine %s" msgstr "" -#: objdump.c:1916 +#: objdump.c:1959 #, c-format msgid "Can't disassemble for architecture %s\n" msgstr "" -#: objdump.c:2006 +#: objdump.c:2064 #, c-format msgid "" "\n" "Can't get contents for section '%s'.\n" msgstr "" -#: objdump.c:2143 +#: objdump.c:2201 #, c-format msgid "" "No %s section present\n" "\n" msgstr "" -#: objdump.c:2152 +#: objdump.c:2210 #, c-format msgid "Reading %s section of %s failed: %s" msgstr "" -#: objdump.c:2196 +#: objdump.c:2254 #, c-format msgid "" "Contents of %s section:\n" "\n" msgstr "" -#: objdump.c:2323 +#: objdump.c:2381 #, c-format msgid "architecture: %s, " msgstr "" -#: objdump.c:2326 +#: objdump.c:2384 #, c-format msgid "flags 0x%08x:\n" msgstr "" -#: objdump.c:2340 +#: objdump.c:2398 #, c-format msgid "" "\n" "start address 0x" msgstr "" -#: objdump.c:2380 +#: objdump.c:2438 #, c-format msgid "Contents of section %s:\n" msgstr "" -#: objdump.c:2505 +#: objdump.c:2563 #, c-format msgid "no symbols\n" msgstr "" -#: objdump.c:2512 +#: objdump.c:2570 #, c-format msgid "no information for symbol number %ld\n" msgstr "" -#: objdump.c:2515 +#: objdump.c:2573 #, c-format msgid "could not determine the type of symbol number %ld\n" msgstr "" -#: objdump.c:2788 +#: objdump.c:2850 #, c-format msgid "" "\n" "%s: file format %s\n" msgstr "" -#: objdump.c:2845 +#: objdump.c:2908 #, c-format msgid "%s: printing debugging information failed" msgstr "" -#: objdump.c:2936 +#: objdump.c:3002 #, c-format msgid "In archive %s:\n" msgstr "" -#: objdump.c:3058 +#: objdump.c:3124 msgid "unrecognized -E option" msgstr "" -#: objdump.c:3069 +#: objdump.c:3135 #, c-format msgid "unrecognized --endian type `%s'" msgstr "" -#: rdcoff.c:196 +#: rclex.c:196 +msgid "invalid value specified for pragma code_page.\n" +msgstr "" + +#: rdcoff.c:198 #, c-format msgid "parse_coff_type: Bad type code 0x%x" msgstr "" -#: rdcoff.c:404 rdcoff.c:509 rdcoff.c:697 +#: rdcoff.c:406 rdcoff.c:511 rdcoff.c:699 #, c-format msgid "bfd_coff_get_syment failed: %s" msgstr "" -#: rdcoff.c:420 rdcoff.c:717 +#: rdcoff.c:422 rdcoff.c:719 #, c-format msgid "bfd_coff_get_auxent failed: %s" msgstr "" -#: rdcoff.c:784 +#: rdcoff.c:786 #, c-format msgid "%ld: .bf without preceding function" msgstr "" -#: rdcoff.c:834 +#: rdcoff.c:836 #, c-format msgid "%ld: unexpected .ef\n" msgstr "" -#: rddbg.c:85 +#: rddbg.c:86 #, c-format msgid "%s: no recognized debugging information" msgstr "" -#: rddbg.c:394 +#: rddbg.c:400 #, c-format msgid "Last stabs entries before error:\n" msgstr "" -#: readelf.c:264 +#: readelf.c:319 #, c-format msgid "Unable to seek to 0x%lx for %s\n" msgstr "" -#: readelf.c:279 +#: readelf.c:334 #, c-format msgid "Out of memory allocating 0x%lx bytes for %s\n" msgstr "" -#: readelf.c:289 +#: readelf.c:344 #, c-format msgid "Unable to read in 0x%lx bytes of %s\n" msgstr "" -#: readelf.c:623 +#: readelf.c:683 msgid "Don't know about relocations on this machine architecture\n" msgstr "" -#: readelf.c:643 readelf.c:671 readelf.c:715 readelf.c:743 +#: readelf.c:703 readelf.c:731 readelf.c:775 readelf.c:803 msgid "relocs" msgstr "" -#: readelf.c:654 readelf.c:682 readelf.c:726 readelf.c:754 -msgid "out of memory parsing relocs" +#: readelf.c:714 readelf.c:742 readelf.c:786 readelf.c:814 +msgid "out of memory parsing relocs\n" msgstr "" -#: readelf.c:808 +#: readelf.c:868 #, c-format msgid "" " Offset Info Type Sym. Value Symbol's Name + Addend\n" msgstr "" -#: readelf.c:810 +#: readelf.c:870 #, c-format msgid " Offset Info Type Sym.Value Sym. Name + Addend\n" msgstr "" -#: readelf.c:815 +#: readelf.c:875 #, c-format msgid " Offset Info Type Sym. Value Symbol's Name\n" msgstr "" -#: readelf.c:817 +#: readelf.c:877 #, c-format msgid " Offset Info Type Sym.Value Sym. Name\n" msgstr "" -#: readelf.c:825 +#: readelf.c:885 #, c-format msgid "" " Offset Info Type Symbol's Value " "Symbol's Name + Addend\n" msgstr "" -#: readelf.c:827 +#: readelf.c:887 #, c-format msgid "" " Offset Info Type Sym. Value Sym. Name + " "Addend\n" msgstr "" -#: readelf.c:832 +#: readelf.c:892 #, c-format msgid "" " Offset Info Type Symbol's Value " "Symbol's Name\n" msgstr "" -#: readelf.c:834 +#: readelf.c:894 #, c-format msgid "" " Offset Info Type Sym. Value Sym. Name\n" msgstr "" -#: readelf.c:1127 readelf.c:1129 readelf.c:1238 readelf.c:1240 readelf.c:1249 -#: readelf.c:1251 +#: readelf.c:1198 readelf.c:1200 readelf.c:1318 readelf.c:1320 readelf.c:1329 +#: readelf.c:1331 #, c-format msgid "unrecognized: %-7lx" msgstr "" -#: readelf.c:1154 +#: readelf.c:1226 #, c-format msgid "" msgstr "" -#: readelf.c:1210 +#: readelf.c:1288 #, c-format msgid "" msgstr "" -#: readelf.c:1212 +#: readelf.c:1290 #, c-format msgid "" msgstr "" -#: readelf.c:1522 +#: readelf.c:1625 #, c-format msgid "Processor Specific: %lx" msgstr "" -#: readelf.c:1543 +#: readelf.c:1646 #, c-format msgid "Operating System specific: %lx" msgstr "" -#: readelf.c:1547 readelf.c:2349 +#: readelf.c:1650 readelf.c:2521 #, c-format msgid ": %lx" msgstr "" -#: readelf.c:1560 +#: readelf.c:1663 msgid "NONE (None)" msgstr "" -#: readelf.c:1561 +#: readelf.c:1664 msgid "REL (Relocatable file)" msgstr "" -#: readelf.c:1562 +#: readelf.c:1665 msgid "EXEC (Executable file)" msgstr "" -#: readelf.c:1563 +#: readelf.c:1666 msgid "DYN (Shared object file)" msgstr "" -#: readelf.c:1564 +#: readelf.c:1667 msgid "CORE (Core file)" msgstr "" -#: readelf.c:1568 +#: readelf.c:1671 #, c-format msgid "Processor Specific: (%x)" msgstr "" -#: readelf.c:1570 +#: readelf.c:1673 #, c-format msgid "OS Specific: (%x)" msgstr "" -#: readelf.c:1572 readelf.c:1681 readelf.c:2541 +#: readelf.c:1675 readelf.c:2714 #, c-format msgid ": %x" msgstr "" -#: readelf.c:1584 +#: readelf.c:1687 msgid "None" msgstr "" -#: readelf.c:2186 +#: readelf.c:1791 +#, c-format +msgid ": 0x%x" +msgstr "" + +#: readelf.c:2048 +msgid "unknown" +msgstr "" + +#: readelf.c:2049 +msgid "unknown mac" +msgstr "" + +#: readelf.c:2358 msgid "Standalone App" msgstr "" -#: readelf.c:2189 readelf.c:2948 readelf.c:2964 +#: readelf.c:2361 readelf.c:3145 readelf.c:3161 #, c-format msgid "" msgstr "" -#: readelf.c:2586 +#: readelf.c:2759 #, c-format msgid "Usage: readelf elf-file(s)\n" msgstr "" -#: readelf.c:2587 +#: readelf.c:2760 #, c-format msgid " Display information about the contents of ELF format files\n" msgstr "" -#: readelf.c:2588 +#: readelf.c:2761 #, c-format msgid "" " Options are:\n" @@ -3302,14 +3395,14 @@ msgid "" " Display the contents of DWARF2 debug sections\n" msgstr "" -#: readelf.c:2612 +#: readelf.c:2785 #, c-format msgid "" " -i --instruction-dump=\n" " Disassemble the contents of section \n" msgstr "" -#: readelf.c:2616 +#: readelf.c:2789 #, c-format msgid "" " -I --histogram Display histogram of bucket list lengths\n" @@ -3319,382 +3412,394 @@ msgid "" " -v --version Display the version number of readelf\n" msgstr "" -#: readelf.c:2642 readelf.c:9180 -msgid "Out of memory allocating dump request table." +#: readelf.c:2817 readelf.c:2845 readelf.c:2849 readelf.c:9898 +msgid "Out of memory allocating dump request table.\n" msgstr "" -#: readelf.c:2816 readelf.c:2884 +#: readelf.c:3011 readelf.c:3079 #, c-format msgid "Unrecognized debug option '%s'\n" msgstr "" -#: readelf.c:2918 +#: readelf.c:3115 #, c-format msgid "Invalid option '-%c'\n" msgstr "" -#: readelf.c:2932 +#: readelf.c:3129 msgid "Nothing to do.\n" msgstr "" -#: readelf.c:2944 readelf.c:2960 readelf.c:6169 +#: readelf.c:3141 readelf.c:3157 readelf.c:6399 msgid "none" msgstr "" -#: readelf.c:2961 +#: readelf.c:3158 msgid "2's complement, little endian" msgstr "" -#: readelf.c:2962 +#: readelf.c:3159 msgid "2's complement, big endian" msgstr "" -#: readelf.c:2980 +#: readelf.c:3177 msgid "Not an ELF file - it has the wrong magic bytes at the start\n" msgstr "" -#: readelf.c:2988 +#: readelf.c:3185 #, c-format msgid "ELF Header:\n" msgstr "" -#: readelf.c:2989 +#: readelf.c:3186 #, c-format msgid " Magic: " msgstr "" -#: readelf.c:2993 +#: readelf.c:3190 #, c-format msgid " Class: %s\n" msgstr "" -#: readelf.c:2995 +#: readelf.c:3192 #, c-format msgid " Data: %s\n" msgstr "" -#: readelf.c:2997 +#: readelf.c:3194 #, c-format msgid " Version: %d %s\n" msgstr "" -#: readelf.c:3004 +#: readelf.c:3201 #, c-format msgid " OS/ABI: %s\n" msgstr "" -#: readelf.c:3006 +#: readelf.c:3203 #, c-format msgid " ABI Version: %d\n" msgstr "" -#: readelf.c:3008 +#: readelf.c:3205 #, c-format msgid " Type: %s\n" msgstr "" -#: readelf.c:3010 +#: readelf.c:3207 #, c-format msgid " Machine: %s\n" msgstr "" -#: readelf.c:3012 +#: readelf.c:3209 #, c-format msgid " Version: 0x%lx\n" msgstr "" -#: readelf.c:3015 +#: readelf.c:3212 #, c-format msgid " Entry point address: " msgstr "" -#: readelf.c:3017 +#: readelf.c:3214 #, c-format msgid "" "\n" " Start of program headers: " msgstr "" -#: readelf.c:3019 +#: readelf.c:3216 #, c-format msgid "" " (bytes into file)\n" " Start of section headers: " msgstr "" -#: readelf.c:3021 +#: readelf.c:3218 #, c-format msgid " (bytes into file)\n" msgstr "" -#: readelf.c:3023 +#: readelf.c:3220 #, c-format msgid " Flags: 0x%lx%s\n" msgstr "" -#: readelf.c:3026 +#: readelf.c:3223 #, c-format msgid " Size of this header: %ld (bytes)\n" msgstr "" -#: readelf.c:3028 +#: readelf.c:3225 #, c-format msgid " Size of program headers: %ld (bytes)\n" msgstr "" -#: readelf.c:3030 +#: readelf.c:3227 #, c-format msgid " Number of program headers: %ld\n" msgstr "" -#: readelf.c:3032 +#: readelf.c:3229 #, c-format msgid " Size of section headers: %ld (bytes)\n" msgstr "" -#: readelf.c:3034 +#: readelf.c:3231 #, c-format msgid " Number of section headers: %ld" msgstr "" -#: readelf.c:3039 +#: readelf.c:3236 #, c-format msgid " Section header string table index: %ld" msgstr "" -#: readelf.c:3070 readelf.c:3103 +#: readelf.c:3277 readelf.c:3310 msgid "program headers" msgstr "" -#: readelf.c:3141 readelf.c:3440 readelf.c:3481 readelf.c:3540 readelf.c:3603 -#: readelf.c:4208 readelf.c:4232 readelf.c:5510 readelf.c:5554 readelf.c:5752 -#: readelf.c:6734 readelf.c:6748 readelf.c:8564 readelf.c:8972 readelf.c:9039 +#: readelf.c:3348 readelf.c:3643 readelf.c:3684 readelf.c:3743 readelf.c:3806 +#: readelf.c:4429 readelf.c:4453 readelf.c:5731 readelf.c:5775 readelf.c:5973 +#: readelf.c:7007 readelf.c:7021 readelf.c:7378 readelf.c:7394 readelf.c:7533 +#: readelf.c:7558 readelf.c:8746 readelf.c:8938 readelf.c:9279 readelf.c:9690 +#: readelf.c:9757 msgid "Out of memory\n" msgstr "" -#: readelf.c:3168 +#: readelf.c:3375 #, c-format msgid "" "\n" "There are no program headers in this file.\n" msgstr "" -#: readelf.c:3174 +#: readelf.c:3381 #, c-format msgid "" "\n" "Elf file type is %s\n" msgstr "" -#: readelf.c:3175 +#: readelf.c:3382 #, c-format msgid "Entry point " msgstr "" -#: readelf.c:3177 +#: readelf.c:3384 #, c-format msgid "" "\n" "There are %d program headers, starting at offset " msgstr "" -#: readelf.c:3189 readelf.c:3191 +#: readelf.c:3396 readelf.c:3398 #, c-format msgid "" "\n" "Program Headers:\n" msgstr "" -#: readelf.c:3195 +#: readelf.c:3402 #, c-format msgid "" " Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align\n" msgstr "" -#: readelf.c:3198 +#: readelf.c:3405 #, c-format msgid "" " Type Offset VirtAddr PhysAddr FileSiz " "MemSiz Flg Align\n" msgstr "" -#: readelf.c:3202 +#: readelf.c:3409 #, c-format msgid " Type Offset VirtAddr PhysAddr\n" msgstr "" -#: readelf.c:3204 +#: readelf.c:3411 #, c-format msgid " FileSiz MemSiz Flags Align\n" msgstr "" -#: readelf.c:3297 +#: readelf.c:3504 msgid "more than one dynamic segment\n" msgstr "" -#: readelf.c:3308 -msgid "no .dynamic section in the dynamic segment" +#: readelf.c:3515 +msgid "no .dynamic section in the dynamic segment\n" msgstr "" -#: readelf.c:3317 -msgid "the .dynamic section is not contained within the dynamic segment" +#: readelf.c:3527 +msgid "the .dynamic section is not contained within the dynamic segment\n" msgstr "" -#: readelf.c:3319 -msgid "the .dynamic section is not the first section in the dynamic segment." +#: readelf.c:3529 +msgid "the .dynamic section is not the first section in the dynamic segment.\n" msgstr "" -#: readelf.c:3333 +#: readelf.c:3543 msgid "Unable to find program interpreter name\n" msgstr "" -#: readelf.c:3340 +#: readelf.c:3550 +msgid "" +"Internal error: failed to create format string to display program " +"interpreter\n" +msgstr "" + +#: readelf.c:3554 +msgid "Unable to read program interpreter name\n" +msgstr "" + +#: readelf.c:3557 #, c-format msgid "" "\n" " [Requesting program interpreter: %s]" msgstr "" -#: readelf.c:3352 +#: readelf.c:3569 #, c-format msgid "" "\n" " Section to Segment mapping:\n" msgstr "" -#: readelf.c:3353 +#: readelf.c:3570 #, c-format msgid " Segment Sections...\n" msgstr "" -#: readelf.c:3402 +#: readelf.c:3605 msgid "Cannot interpret virtual addresses without program headers.\n" msgstr "" -#: readelf.c:3418 +#: readelf.c:3621 #, c-format msgid "Virtual address 0x%lx not located in any PT_LOAD segment.\n" msgstr "" -#: readelf.c:3432 readelf.c:3473 +#: readelf.c:3635 readelf.c:3676 msgid "section headers" msgstr "" -#: readelf.c:3517 readelf.c:3580 +#: readelf.c:3720 readelf.c:3783 msgid "symbols" msgstr "" -#: readelf.c:3527 readelf.c:3590 +#: readelf.c:3730 readelf.c:3793 msgid "symtab shndx" msgstr "" -#: readelf.c:3817 readelf.c:4192 +#: readelf.c:4020 readelf.c:4413 #, c-format msgid "" "\n" "There are no sections in this file.\n" msgstr "" -#: readelf.c:3823 +#: readelf.c:4026 #, c-format msgid "There are %d section headers, starting at offset 0x%lx:\n" msgstr "" -#: readelf.c:3842 readelf.c:4309 readelf.c:4544 readelf.c:4852 readelf.c:5267 -#: readelf.c:6906 +#: readelf.c:4046 readelf.c:4530 readelf.c:4765 readelf.c:5073 readelf.c:5488 +#: readelf.c:7187 msgid "string table" msgstr "" -#: readelf.c:3881 +#: readelf.c:4102 #, c-format msgid "Section %d has invalid sh_entsize %lx (expected %lx)\n" msgstr "" -#: readelf.c:3901 +#: readelf.c:4122 msgid "File contains multiple dynamic symbol tables\n" msgstr "" -#: readelf.c:3914 +#: readelf.c:4135 msgid "File contains multiple dynamic string tables\n" msgstr "" -#: readelf.c:3919 +#: readelf.c:4140 msgid "dynamic strings" msgstr "" -#: readelf.c:3926 +#: readelf.c:4147 msgid "File contains multiple symtab shndx tables\n" msgstr "" -#: readelf.c:3973 +#: readelf.c:4194 #, c-format msgid "" "\n" "Section Headers:\n" msgstr "" -#: readelf.c:3975 +#: readelf.c:4196 #, c-format msgid "" "\n" "Section Header:\n" msgstr "" -#: readelf.c:3981 readelf.c:3992 readelf.c:4003 +#: readelf.c:4202 readelf.c:4213 readelf.c:4224 #, c-format msgid " [Nr] Name\n" msgstr "" -#: readelf.c:3982 +#: readelf.c:4203 #, c-format msgid " Type Addr Off Size ES Lk Inf Al\n" msgstr "" -#: readelf.c:3986 +#: readelf.c:4207 #, c-format msgid "" " [Nr] Name Type Addr Off Size ES Flg Lk " "Inf Al\n" msgstr "" -#: readelf.c:3993 +#: readelf.c:4214 #, c-format msgid " Type Address Off Size ES Lk Inf Al\n" msgstr "" -#: readelf.c:3997 +#: readelf.c:4218 #, c-format msgid "" " [Nr] Name Type Address Off Size ES " "Flg Lk Inf Al\n" msgstr "" -#: readelf.c:4004 +#: readelf.c:4225 #, c-format msgid " Type Address Offset Link\n" msgstr "" -#: readelf.c:4005 +#: readelf.c:4226 #, c-format msgid " Size EntSize Info Align\n" msgstr "" -#: readelf.c:4009 +#: readelf.c:4230 #, c-format msgid " [Nr] Name Type Address Offset\n" msgstr "" -#: readelf.c:4010 +#: readelf.c:4231 #, c-format msgid " Size EntSize Flags Link Info Align\n" msgstr "" -#: readelf.c:4015 +#: readelf.c:4236 #, c-format msgid " Flags\n" msgstr "" -#: readelf.c:4150 +#: readelf.c:4371 #, c-format msgid "" "Key to Flags:\n" @@ -3703,1030 +3808,1056 @@ msgid "" " O (extra OS processing required) o (OS specific), p (processor specific)\n" msgstr "" -#: readelf.c:4168 +#: readelf.c:4389 #, c-format msgid "[: 0x%x]" msgstr "" -#: readelf.c:4199 +#: readelf.c:4420 msgid "Section headers are not available!\n" msgstr "" -#: readelf.c:4223 +#: readelf.c:4444 #, c-format msgid "" "\n" "There are no section groups in this file.\n" msgstr "" -#: readelf.c:4259 +#: readelf.c:4480 #, c-format msgid "Bad sh_link in group section `%s'\n" msgstr "" -#: readelf.c:4278 +#: readelf.c:4499 #, c-format msgid "Bad sh_info in group section `%s'\n" msgstr "" -#: readelf.c:4317 readelf.c:7243 +#: readelf.c:4538 readelf.c:7690 msgid "section data" msgstr "" -#: readelf.c:4329 +#: readelf.c:4550 #, c-format msgid " [Index] Name\n" msgstr "" -#: readelf.c:4343 +#: readelf.c:4564 #, c-format msgid "section [%5u] in group section [%5u] > maximum section [%5u]\n" msgstr "" -#: readelf.c:4349 +#: readelf.c:4570 #, c-format msgid "invalid section [%5u] in group section [%5u]\n" msgstr "" -#: readelf.c:4359 +#: readelf.c:4580 #, c-format msgid "section [%5u] in group section [%5u] already in group section [%5u]\n" msgstr "" -#: readelf.c:4372 +#: readelf.c:4593 #, c-format msgid "section 0 in group section [%5u]\n" msgstr "" -#: readelf.c:4468 +#: readelf.c:4689 #, c-format msgid "" "\n" "'%s' relocation section at offset 0x%lx contains %ld bytes:\n" msgstr "" -#: readelf.c:4480 +#: readelf.c:4701 #, c-format msgid "" "\n" "There are no dynamic relocations in this file.\n" msgstr "" -#: readelf.c:4504 +#: readelf.c:4725 #, c-format msgid "" "\n" "Relocation section " msgstr "" -#: readelf.c:4509 readelf.c:4928 readelf.c:4942 readelf.c:5282 +#: readelf.c:4730 readelf.c:5149 readelf.c:5163 readelf.c:5503 #, c-format msgid "'%s'" msgstr "" -#: readelf.c:4511 readelf.c:4944 readelf.c:5284 +#: readelf.c:4732 readelf.c:5165 readelf.c:5505 #, c-format msgid " at offset 0x%lx contains %lu entries:\n" msgstr "" -#: readelf.c:4563 +#: readelf.c:4784 #, c-format msgid "" "\n" "There are no relocations in this file.\n" msgstr "" -#: readelf.c:4742 readelf.c:5124 +#: readelf.c:4963 readelf.c:5345 msgid "unwind table" msgstr "" -#: readelf.c:4801 readelf.c:5214 +#: readelf.c:5022 readelf.c:5435 #, c-format msgid "Skipping unexpected relocation type %s\n" msgstr "" -#: readelf.c:4860 readelf.c:5275 readelf.c:5326 +#: readelf.c:5081 readelf.c:5496 readelf.c:5547 #, c-format msgid "" "\n" "There are no unwind sections in this file.\n" msgstr "" -#: readelf.c:4923 +#: readelf.c:5144 #, c-format msgid "" "\n" "Could not find unwind info section for " msgstr "" -#: readelf.c:4935 +#: readelf.c:5156 msgid "unwind info" msgstr "" -#: readelf.c:4937 readelf.c:5281 +#: readelf.c:5158 readelf.c:5502 #, c-format msgid "" "\n" "Unwind section " msgstr "" -#: readelf.c:5491 readelf.c:5535 +#: readelf.c:5712 readelf.c:5756 msgid "dynamic section" msgstr "" -#: readelf.c:5612 +#: readelf.c:5833 #, c-format msgid "" "\n" "There is no dynamic section in this file.\n" msgstr "" -#: readelf.c:5650 -msgid "Unable to seek to end of file!" +#: readelf.c:5871 +msgid "Unable to seek to end of file!\n" msgstr "" -#: readelf.c:5663 +#: readelf.c:5884 msgid "Unable to determine the number of symbols to load\n" msgstr "" -#: readelf.c:5698 +#: readelf.c:5919 msgid "Unable to seek to end of file\n" msgstr "" -#: readelf.c:5705 +#: readelf.c:5926 msgid "Unable to determine the length of the dynamic string table\n" msgstr "" -#: readelf.c:5710 +#: readelf.c:5931 msgid "dynamic string table" msgstr "" -#: readelf.c:5745 +#: readelf.c:5966 msgid "symbol information" msgstr "" -#: readelf.c:5770 +#: readelf.c:5991 #, c-format msgid "" "\n" "Dynamic section at offset 0x%lx contains %u entries:\n" msgstr "" -#: readelf.c:5773 +#: readelf.c:5994 #, c-format msgid " Tag Type Name/Value\n" msgstr "" -#: readelf.c:5809 +#: readelf.c:6030 #, c-format msgid "Auxiliary library" msgstr "" -#: readelf.c:5813 +#: readelf.c:6034 #, c-format msgid "Filter library" msgstr "" -#: readelf.c:5817 +#: readelf.c:6038 #, c-format msgid "Configuration file" msgstr "" -#: readelf.c:5821 +#: readelf.c:6042 #, c-format msgid "Dependency audit library" msgstr "" -#: readelf.c:5825 +#: readelf.c:6046 #, c-format msgid "Audit library" msgstr "" -#: readelf.c:5843 readelf.c:5871 readelf.c:5899 +#: readelf.c:6064 readelf.c:6092 readelf.c:6120 #, c-format msgid "Flags:" msgstr "" -#: readelf.c:5846 readelf.c:5874 readelf.c:5901 +#: readelf.c:6067 readelf.c:6095 readelf.c:6122 #, c-format msgid " None\n" msgstr "" -#: readelf.c:6022 +#: readelf.c:6243 #, c-format msgid "Shared library: [%s]" msgstr "" -#: readelf.c:6025 +#: readelf.c:6246 #, c-format msgid " program interpreter" msgstr "" -#: readelf.c:6029 +#: readelf.c:6250 #, c-format msgid "Library soname: [%s]" msgstr "" -#: readelf.c:6033 +#: readelf.c:6254 #, c-format msgid "Library rpath: [%s]" msgstr "" -#: readelf.c:6037 +#: readelf.c:6258 #, c-format msgid "Library runpath: [%s]" msgstr "" -#: readelf.c:6100 +#: readelf.c:6321 #, c-format msgid "Not needed object: [%s]\n" msgstr "" -#: readelf.c:6214 +#: readelf.c:6444 #, c-format msgid "" "\n" "Version definition section '%s' contains %ld entries:\n" msgstr "" -#: readelf.c:6217 +#: readelf.c:6447 #, c-format msgid " Addr: 0x" msgstr "" -#: readelf.c:6219 readelf.c:6426 +#: readelf.c:6449 readelf.c:6656 #, c-format msgid " Offset: %#08lx Link: %lx (%s)\n" msgstr "" -#: readelf.c:6228 +#: readelf.c:6458 msgid "version definition section" msgstr "" -#: readelf.c:6254 +#: readelf.c:6484 #, c-format msgid " %#06x: Rev: %d Flags: %s" msgstr "" -#: readelf.c:6257 +#: readelf.c:6487 #, c-format msgid " Index: %d Cnt: %d " msgstr "" -#: readelf.c:6268 +#: readelf.c:6498 #, c-format msgid "Name: %s\n" msgstr "" -#: readelf.c:6270 +#: readelf.c:6500 #, c-format msgid "Name index: %ld\n" msgstr "" -#: readelf.c:6285 +#: readelf.c:6515 #, c-format msgid " %#06x: Parent %d: %s\n" msgstr "" -#: readelf.c:6288 +#: readelf.c:6518 #, c-format msgid " %#06x: Parent %d, name index: %ld\n" msgstr "" -#: readelf.c:6307 +#: readelf.c:6537 #, c-format msgid "" "\n" "Version needs section '%s' contains %ld entries:\n" msgstr "" -#: readelf.c:6310 +#: readelf.c:6540 #, c-format msgid " Addr: 0x" msgstr "" -#: readelf.c:6312 +#: readelf.c:6542 #, c-format msgid " Offset: %#08lx Link to section: %ld (%s)\n" msgstr "" -#: readelf.c:6321 +#: readelf.c:6551 msgid "version need section" msgstr "" -#: readelf.c:6343 +#: readelf.c:6573 #, c-format msgid " %#06x: Version: %d" msgstr "" -#: readelf.c:6346 +#: readelf.c:6576 #, c-format msgid " File: %s" msgstr "" -#: readelf.c:6348 +#: readelf.c:6578 #, c-format msgid " File: %lx" msgstr "" -#: readelf.c:6350 +#: readelf.c:6580 #, c-format msgid " Cnt: %d\n" msgstr "" -#: readelf.c:6368 +#: readelf.c:6598 #, c-format msgid " %#06x: Name: %s" msgstr "" -#: readelf.c:6371 +#: readelf.c:6601 #, c-format msgid " %#06x: Name index: %lx" msgstr "" -#: readelf.c:6374 +#: readelf.c:6604 #, c-format msgid " Flags: %s Version: %d\n" msgstr "" -#: readelf.c:6417 +#: readelf.c:6647 msgid "version string table" msgstr "" -#: readelf.c:6421 +#: readelf.c:6651 #, c-format msgid "" "\n" "Version symbols section '%s' contains %d entries:\n" msgstr "" -#: readelf.c:6424 +#: readelf.c:6654 #, c-format msgid " Addr: " msgstr "" -#: readelf.c:6434 +#: readelf.c:6664 msgid "version symbol data" msgstr "" -#: readelf.c:6461 +#: readelf.c:6691 msgid " 0 (*local*) " msgstr "" -#: readelf.c:6465 +#: readelf.c:6695 msgid " 1 (*global*) " msgstr "" -#: readelf.c:6503 readelf.c:6969 +#: readelf.c:6733 readelf.c:7255 msgid "version need" msgstr "" -#: readelf.c:6513 +#: readelf.c:6743 msgid "version need aux (2)" msgstr "" -#: readelf.c:6555 readelf.c:7034 +#: readelf.c:6785 readelf.c:7320 msgid "version def" msgstr "" -#: readelf.c:6575 readelf.c:7049 +#: readelf.c:6805 readelf.c:7335 msgid "version def aux" msgstr "" -#: readelf.c:6606 +#: readelf.c:6836 #, c-format msgid "" "\n" "No version information found in this file.\n" msgstr "" -#: readelf.c:6740 +#: readelf.c:6955 +#, c-format +msgid ": %x" +msgstr "" + +#: readelf.c:7013 msgid "Unable to read in dynamic data\n" msgstr "" -#: readelf.c:6793 -msgid "Unable to seek to start of dynamic information" +#: readelf.c:7069 readelf.c:7443 readelf.c:7467 readelf.c:7497 readelf.c:7521 +msgid "Unable to seek to start of dynamic information\n" msgstr "" -#: readelf.c:6799 +#: readelf.c:7075 readelf.c:7449 msgid "Failed to read in number of buckets\n" msgstr "" -#: readelf.c:6805 +#: readelf.c:7081 msgid "Failed to read in number of chains\n" msgstr "" -#: readelf.c:6825 +#: readelf.c:7101 #, c-format msgid "" "\n" "Symbol table for image:\n" msgstr "" -#: readelf.c:6827 +#: readelf.c:7103 #, c-format msgid " Num Buc: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: readelf.c:6829 +#: readelf.c:7105 #, c-format msgid " Num Buc: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: readelf.c:6882 +#: readelf.c:7163 #, c-format msgid "" "\n" "Symbol table '%s' contains %lu entries:\n" msgstr "" -#: readelf.c:6886 +#: readelf.c:7167 #, c-format msgid " Num: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: readelf.c:6888 +#: readelf.c:7169 #, c-format msgid " Num: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: readelf.c:6939 +#: readelf.c:7225 msgid "version data" msgstr "" -#: readelf.c:6982 +#: readelf.c:7268 msgid "version need aux (3)" msgstr "" -#: readelf.c:7009 -msgid "bad dynamic symbol" +#: readelf.c:7295 +msgid "bad dynamic symbol\n" msgstr "" -#: readelf.c:7073 +#: readelf.c:7359 #, c-format msgid "" "\n" "Dynamic symbol information is not available for displaying symbols.\n" msgstr "" -#: readelf.c:7085 +#: readelf.c:7371 #, c-format msgid "" "\n" "Histogram for bucket list length (total of %lu buckets):\n" msgstr "" -#: readelf.c:7087 +#: readelf.c:7373 readelf.c:7539 #, c-format msgid " Length Number %% of total Coverage\n" msgstr "" -#: readelf.c:7092 readelf.c:7108 readelf.c:8031 readelf.c:8223 -msgid "Out of memory" +#: readelf.c:7505 +msgid "Failed to determine last chain length\n" msgstr "" -#: readelf.c:7157 +#: readelf.c:7537 +#, c-format +msgid "" +"\n" +"Histogram for `.gnu.hash' bucket list length (total of %lu buckets):\n" +msgstr "" + +#: readelf.c:7603 #, c-format msgid "" "\n" "Dynamic info segment at offset 0x%lx contains %d entries:\n" msgstr "" -#: readelf.c:7160 +#: readelf.c:7606 #, c-format msgid " Num: Name BoundTo Flags\n" msgstr "" -#: readelf.c:7212 +#: readelf.c:7658 #, c-format msgid "" "\n" "Assembly dump of section %s\n" msgstr "" -#: readelf.c:7233 +#: readelf.c:7680 #, c-format msgid "" "\n" "Section '%s' has no data to dump.\n" msgstr "" -#: readelf.c:7238 +#: readelf.c:7685 #, c-format msgid "" "\n" "Hex dump of section '%s':\n" msgstr "" -#: readelf.c:7359 +#: readelf.c:7710 +#, c-format +msgid "" +" NOTE: This section has relocations against it, but these have NOT been " +"applied to this dump.\n" +msgstr "" + +#: readelf.c:7845 +#, c-format +msgid "" +"skipping relocation of unknown size against offset 0x%lx in section %s\n" +msgstr "" + +#: readelf.c:7854 #, c-format msgid "skipping invalid relocation offset 0x%lx in section %s\n" msgstr "" -#: readelf.c:7376 +#: readelf.c:7875 #, c-format msgid "skipping unexpected symbol type %s in relocation in section .rela%s\n" msgstr "" -#: readelf.c:7402 +#: readelf.c:7902 #, c-format msgid "skipping unexpected symbol type %s in relocation in section .rela.%s\n" msgstr "" -#: readelf.c:7435 +#: readelf.c:7935 #, c-format msgid "%s section data" msgstr "" -#: readelf.c:7472 +#: readelf.c:7972 #, c-format msgid "" "\n" "Section '%s' has no debugging data.\n" msgstr "" -#: readelf.c:7498 +#: readelf.c:7998 #, c-format msgid "Unrecognized debug section: %s\n" msgstr "" -#: readelf.c:7533 +#: readelf.c:8026 +#, c-format +msgid "Section '%s' was not dumped because it does not exist!\n" +msgstr "" + +#: readelf.c:8061 #, c-format msgid "Section %d was not dumped because it does not exist!\n" msgstr "" -#: readelf.c:7791 +#: readelf.c:8478 msgid "attributes" msgstr "" -#: readelf.c:7809 +#: readelf.c:8497 #, c-format msgid "ERROR: Bad section length (%d > %d)\n" msgstr "" -#: readelf.c:7830 +#: readelf.c:8522 #, c-format msgid "ERROR: Bad subsection length (%d > %d)\n" msgstr "" -#: readelf.c:7880 +#: readelf.c:8578 #, c-format msgid "Unknown format '%c'\n" msgstr "" -#: readelf.c:7936 readelf.c:8304 +#: readelf.c:8651 readelf.c:9019 msgid "liblist" msgstr "" -#: readelf.c:8025 +#: readelf.c:8740 msgid "options" msgstr "" -#: readelf.c:8055 +#: readelf.c:8770 #, c-format msgid "" "\n" "Section '%s' contains %d entries:\n" msgstr "" -#: readelf.c:8216 -msgid "conflict list found without a dynamic symbol table" +#: readelf.c:8931 +msgid "conflict list found without a dynamic symbol table\n" msgstr "" -#: readelf.c:8232 readelf.c:8246 +#: readelf.c:8947 readelf.c:8961 msgid "conflict" msgstr "" -#: readelf.c:8256 +#: readelf.c:8971 #, c-format msgid "" "\n" "Section '.conflict' contains %lu entries:\n" msgstr "" -#: readelf.c:8258 +#: readelf.c:8973 msgid " Num: Index Value Name" msgstr "" -#: readelf.c:8311 +#: readelf.c:9026 msgid "liblist string table" msgstr "" -#: readelf.c:8321 +#: readelf.c:9036 #, c-format msgid "" "\n" "Library list section '%s' contains %lu entries:\n" msgstr "" -#: readelf.c:8374 +#: readelf.c:9089 msgid "NT_AUXV (auxiliary vector)" msgstr "" -#: readelf.c:8376 +#: readelf.c:9091 msgid "NT_PRSTATUS (prstatus structure)" msgstr "" -#: readelf.c:8378 +#: readelf.c:9093 msgid "NT_FPREGSET (floating point registers)" msgstr "" -#: readelf.c:8380 +#: readelf.c:9095 msgid "NT_PRPSINFO (prpsinfo structure)" msgstr "" -#: readelf.c:8382 +#: readelf.c:9097 msgid "NT_TASKSTRUCT (task structure)" msgstr "" -#: readelf.c:8384 +#: readelf.c:9099 msgid "NT_PRXFPREG (user_xfpregs structure)" msgstr "" -#: readelf.c:8386 +#: readelf.c:9101 msgid "NT_PSTATUS (pstatus structure)" msgstr "" -#: readelf.c:8388 +#: readelf.c:9103 msgid "NT_FPREGS (floating point registers)" msgstr "" -#: readelf.c:8390 +#: readelf.c:9105 msgid "NT_PSINFO (psinfo structure)" msgstr "" -#: readelf.c:8392 +#: readelf.c:9107 msgid "NT_LWPSTATUS (lwpstatus_t structure)" msgstr "" -#: readelf.c:8394 +#: readelf.c:9109 msgid "NT_LWPSINFO (lwpsinfo_t structure)" msgstr "" -#: readelf.c:8396 +#: readelf.c:9111 msgid "NT_WIN32PSTATUS (win32_pstatus structure)" msgstr "" -#: readelf.c:8404 +#: readelf.c:9119 msgid "NT_VERSION (version)" msgstr "" -#: readelf.c:8406 +#: readelf.c:9121 msgid "NT_ARCH (architecture)" msgstr "" -#: readelf.c:8411 readelf.c:8433 +#: readelf.c:9126 readelf.c:9148 #, c-format msgid "Unknown note type: (0x%08x)" msgstr "" #. NetBSD core "procinfo" structure. -#: readelf.c:8423 +#: readelf.c:9138 msgid "NetBSD procinfo structure" msgstr "" -#: readelf.c:8450 readelf.c:8464 +#: readelf.c:9165 readelf.c:9179 msgid "PT_GETREGS (reg structure)" msgstr "" -#: readelf.c:8452 readelf.c:8466 +#: readelf.c:9167 readelf.c:9181 msgid "PT_GETFPREGS (fpreg structure)" msgstr "" -#: readelf.c:8472 +#: readelf.c:9187 #, c-format msgid "PT_FIRSTMACH+%d" msgstr "" -#: readelf.c:8518 +#: readelf.c:9233 msgid "notes" msgstr "" -#: readelf.c:8524 +#: readelf.c:9239 #, c-format msgid "" "\n" "Notes at offset 0x%08lx with length 0x%08lx:\n" msgstr "" -#: readelf.c:8526 +#: readelf.c:9241 #, c-format msgid " Owner\t\tData size\tDescription\n" msgstr "" -#: readelf.c:8545 +#: readelf.c:9260 #, c-format msgid "corrupt note found at offset %lx into core notes\n" msgstr "" -#: readelf.c:8547 +#: readelf.c:9262 #, c-format msgid " type: %lx, namesize: %08lx, descsize: %08lx\n" msgstr "" -#: readelf.c:8645 +#: readelf.c:9360 #, c-format msgid "No note segments present in the core file.\n" msgstr "" -#: readelf.c:8726 +#: readelf.c:9444 msgid "" "This instance of readelf has been built without support for a\n" "64 bit data type and so it cannot read 64 bit ELF files.\n" msgstr "" -#: readelf.c:8775 readelf.c:9119 +#: readelf.c:9493 readelf.c:9837 #, c-format msgid "%s: Failed to read file header\n" msgstr "" -#: readelf.c:8788 +#: readelf.c:9506 #, c-format msgid "" "\n" "File: %s\n" msgstr "" -#: readelf.c:8936 readelf.c:8957 readelf.c:8994 readelf.c:9074 +#: readelf.c:9654 readelf.c:9675 readelf.c:9712 readelf.c:9792 #, c-format msgid "%s: failed to read archive header\n" msgstr "" -#: readelf.c:8947 +#: readelf.c:9665 #, c-format msgid "%s: failed to skip archive symbol table\n" msgstr "" -#: readelf.c:8979 +#: readelf.c:9697 #, c-format msgid "%s: failed to read string table\n" msgstr "" -#: readelf.c:9015 +#: readelf.c:9733 #, c-format msgid "%s: invalid archive string table offset %lu\n" msgstr "" -#: readelf.c:9031 +#: readelf.c:9749 #, c-format msgid "%s: bad archive file name\n" msgstr "" -#: readelf.c:9063 +#: readelf.c:9781 #, c-format msgid "%s: failed to seek to next archive header\n" msgstr "" -#: readelf.c:9097 +#: readelf.c:9815 #, c-format msgid "'%s': No such file\n" msgstr "" -#: readelf.c:9099 +#: readelf.c:9817 #, c-format msgid "Could not locate '%s'. System error message: %s\n" msgstr "" -#: readelf.c:9106 +#: readelf.c:9824 #, c-format msgid "'%s' is not an ordinary file\n" msgstr "" -#: readelf.c:9113 +#: readelf.c:9831 #, c-format msgid "Input file '%s' is not readable.\n" msgstr "" -#: rename.c:129 +#: rename.c:130 #, c-format msgid "%s: cannot set time: %s" msgstr "" #. We have to clean up here. -#: rename.c:164 rename.c:202 +#: rename.c:165 rename.c:203 #, c-format msgid "unable to rename '%s' reason: %s" msgstr "" -#: rename.c:210 +#: rename.c:211 #, c-format msgid "unable to copy file '%s' reason: %s" msgstr "" -#: resbin.c:132 +#: resbin.c:119 #, c-format msgid "%s: not enough binary data" msgstr "" -#: resbin.c:148 +#: resbin.c:135 msgid "null terminated unicode string" msgstr "" -#: resbin.c:175 resbin.c:181 +#: resbin.c:162 resbin.c:168 msgid "resource ID" msgstr "" -#: resbin.c:221 +#: resbin.c:207 msgid "cursor" msgstr "" -#: resbin.c:253 resbin.c:260 +#: resbin.c:238 resbin.c:245 msgid "menu header" msgstr "" -#: resbin.c:270 +#: resbin.c:254 msgid "menuex header" msgstr "" -#: resbin.c:274 +#: resbin.c:258 msgid "menuex offset" msgstr "" -#: resbin.c:281 +#: resbin.c:263 #, c-format msgid "unsupported menu version %d" msgstr "" -#: resbin.c:306 resbin.c:321 resbin.c:384 +#: resbin.c:288 resbin.c:303 resbin.c:365 msgid "menuitem header" msgstr "" -#: resbin.c:414 +#: resbin.c:395 msgid "menuitem" msgstr "" -#: resbin.c:453 resbin.c:481 +#: resbin.c:432 resbin.c:460 msgid "dialog header" msgstr "" -#: resbin.c:471 +#: resbin.c:450 #, c-format msgid "unexpected DIALOGEX version %d" msgstr "" -#: resbin.c:516 +#: resbin.c:495 msgid "dialog font point size" msgstr "" -#: resbin.c:524 +#: resbin.c:503 msgid "dialogex font information" msgstr "" -#: resbin.c:550 resbin.c:568 +#: resbin.c:529 resbin.c:547 msgid "dialog control" msgstr "" -#: resbin.c:560 +#: resbin.c:539 msgid "dialogex control" msgstr "" -#: resbin.c:589 +#: resbin.c:568 msgid "dialog control end" msgstr "" -#: resbin.c:601 +#: resbin.c:580 msgid "dialog control data" msgstr "" -#: resbin.c:642 +#: resbin.c:620 msgid "stringtable string length" msgstr "" -#: resbin.c:652 +#: resbin.c:630 msgid "stringtable string" msgstr "" -#: resbin.c:683 +#: resbin.c:660 msgid "fontdir header" msgstr "" -#: resbin.c:696 +#: resbin.c:674 msgid "fontdir" msgstr "" -#: resbin.c:712 +#: resbin.c:691 msgid "fontdir device name" msgstr "" -#: resbin.c:718 +#: resbin.c:697 msgid "fontdir face name" msgstr "" -#: resbin.c:759 +#: resbin.c:737 msgid "accelerator" msgstr "" -#: resbin.c:819 +#: resbin.c:796 msgid "group cursor header" msgstr "" -#: resbin.c:823 +#: resbin.c:800 resrc.c:1306 #, c-format msgid "unexpected group cursor type %d" msgstr "" -#: resbin.c:838 +#: resbin.c:815 msgid "group cursor" msgstr "" -#: resbin.c:875 +#: resbin.c:851 msgid "group icon header" msgstr "" -#: resbin.c:879 +#: resbin.c:855 resrc.c:1253 #, c-format msgid "unexpected group icon type %d" msgstr "" -#: resbin.c:894 +#: resbin.c:870 msgid "group icon" msgstr "" -#: resbin.c:957 resbin.c:1174 +#: resbin.c:934 resbin.c:1150 msgid "unexpected version string" msgstr "" -#: resbin.c:989 +#: resbin.c:965 #, c-format msgid "version length %d does not match resource length %lu" msgstr "" -#: resbin.c:993 +#: resbin.c:969 #, c-format msgid "unexpected version type %d" msgstr "" -#: resbin.c:1005 +#: resbin.c:981 #, c-format -msgid "unexpected fixed version information length %d" +msgid "unexpected fixed version information length %ld" msgstr "" -#: resbin.c:1008 +#: resbin.c:984 msgid "fixed version info" msgstr "" -#: resbin.c:1012 +#: resbin.c:988 #, c-format msgid "unexpected fixed version signature %lu" msgstr "" -#: resbin.c:1016 +#: resbin.c:992 #, c-format msgid "unexpected fixed version info version %lu" msgstr "" -#: resbin.c:1045 +#: resbin.c:1021 msgid "version var info" msgstr "" -#: resbin.c:1062 +#: resbin.c:1038 #, c-format -msgid "unexpected stringfileinfo value length %d" +msgid "unexpected stringfileinfo value length %ld" msgstr "" -#: resbin.c:1072 +#: resbin.c:1048 #, c-format -msgid "unexpected version stringtable value length %d" +msgid "unexpected version stringtable value length %ld" msgstr "" -#: resbin.c:1106 +#: resbin.c:1082 #, c-format -msgid "unexpected version string length %d != %d + %d" +msgid "unexpected version string length %ld != %ld + %ld" msgstr "" -#: resbin.c:1117 +#: resbin.c:1093 #, c-format -msgid "unexpected version string length %d < %d" +msgid "unexpected version string length %ld < %ld" msgstr "" -#: resbin.c:1134 +#: resbin.c:1110 #, c-format -msgid "unexpected varfileinfo value length %d" +msgid "unexpected varfileinfo value length %ld" msgstr "" -#: resbin.c:1153 +#: resbin.c:1129 msgid "version varfileinfo" msgstr "" -#: resbin.c:1168 +#: resbin.c:1144 #, c-format -msgid "unexpected version value length %d" +msgid "unexpected version value length %ld" msgstr "" -#: rescoff.c:126 +#: rescoff.c:124 msgid "filename required for COFF input" msgstr "" -#: rescoff.c:143 +#: rescoff.c:141 #, c-format msgid "%s: no resource section" msgstr "" -#: rescoff.c:150 -msgid "can't read resource section" -msgstr "" - -#: rescoff.c:174 +#: rescoff.c:173 #, c-format msgid "%s: %s: address out of bounds" msgstr "" @@ -4763,144 +4894,144 @@ msgstr "" msgid "ID resource" msgstr "" -#: rescoff.c:318 +#: rescoff.c:320 msgid "resource type unknown" msgstr "" -#: rescoff.c:321 +#: rescoff.c:323 msgid "data entry" msgstr "" -#: rescoff.c:329 +#: rescoff.c:331 msgid "resource data" msgstr "" -#: rescoff.c:334 +#: rescoff.c:336 msgid "resource data size" msgstr "" -#: rescoff.c:427 +#: rescoff.c:431 msgid "filename required for COFF output" msgstr "" -#: rescoff.c:719 +#: rescoff.c:718 msgid "can't get BFD_RELOC_RVA relocation type" msgstr "" -#: resrc.c:238 resrc.c:309 +#: resrc.c:262 resrc.c:333 #, c-format msgid "can't open temporary file `%s': %s" msgstr "" -#: resrc.c:244 +#: resrc.c:268 #, c-format msgid "can't redirect stdout: `%s': %s" msgstr "" -#: resrc.c:260 +#: resrc.c:284 #, c-format msgid "%s %s: %s" msgstr "" -#: resrc.c:305 +#: resrc.c:329 #, c-format msgid "can't execute `%s': %s" msgstr "" -#: resrc.c:314 +#: resrc.c:338 #, c-format msgid "Using temporary file `%s' to read preprocessor output\n" msgstr "" -#: resrc.c:321 +#: resrc.c:345 #, c-format msgid "can't popen `%s': %s" msgstr "" -#: resrc.c:323 +#: resrc.c:347 #, c-format msgid "Using popen to read preprocessor output\n" msgstr "" -#: resrc.c:362 +#: resrc.c:413 #, c-format msgid "Tried `%s'\n" msgstr "" -#: resrc.c:373 +#: resrc.c:424 #, c-format msgid "Using `%s'\n" msgstr "" -#: resrc.c:529 +#: resrc.c:583 #, c-format msgid "%s:%d: %s\n" msgstr "" -#: resrc.c:537 +#: resrc.c:591 #, c-format msgid "%s: unexpected EOF" msgstr "" -#: resrc.c:586 +#: resrc.c:640 #, c-format msgid "%s: read of %lu returned %lu" msgstr "" -#: resrc.c:624 resrc.c:1134 +#: resrc.c:678 resrc.c:1453 #, c-format msgid "stat failed on bitmap file `%s': %s" msgstr "" -#: resrc.c:675 +#: resrc.c:729 #, c-format msgid "cursor file `%s' does not contain cursor data" msgstr "" -#: resrc.c:707 resrc.c:1003 +#: resrc.c:761 resrc.c:1161 #, c-format msgid "%s: fseek to %lu failed: %s" msgstr "" -#: resrc.c:831 +#: resrc.c:887 msgid "help ID requires DIALOGEX" msgstr "" -#: resrc.c:833 +#: resrc.c:889 msgid "control data requires DIALOGEX" msgstr "" -#: resrc.c:861 +#: resrc.c:917 #, c-format msgid "stat failed on font file `%s': %s" msgstr "" -#: resrc.c:972 +#: resrc.c:1130 #, c-format msgid "icon file `%s' does not contain icon data" msgstr "" -#: resrc.c:1273 resrc.c:1308 +#: resrc.c:1675 resrc.c:1710 #, c-format msgid "stat failed on file `%s': %s" msgstr "" -#: resrc.c:1494 +#: resrc.c:1891 #, c-format msgid "can't open `%s' for output: %s" msgstr "" -#: size.c:83 +#: size.c:84 #, c-format msgid " Displays the sizes of sections inside binary files\n" msgstr "" -#: size.c:84 +#: size.c:85 #, c-format msgid " If no input file(s) are specified, a.out is assumed\n" msgstr "" -#: size.c:85 +#: size.c:86 #, c-format msgid "" " The options are:\n" @@ -4916,22 +5047,22 @@ msgid "" "\n" msgstr "" -#: size.c:158 +#: size.c:159 #, c-format msgid "invalid argument to --format: %s" msgstr "" -#: size.c:185 +#: size.c:186 #, c-format msgid "Invalid radix: %s\n" msgstr "" -#: srconv.c:1722 +#: srconv.c:1724 #, c-format msgid "Convert a COFF object file into a SYSROFF object file\n" msgstr "" -#: srconv.c:1723 +#: srconv.c:1725 #, c-format msgid "" " The options are:\n" @@ -4943,160 +5074,160 @@ msgid "" " -v --version Print the program's version number\n" msgstr "" -#: srconv.c:1869 +#: srconv.c:1871 #, c-format msgid "unable to open output file %s" msgstr "" -#: stabs.c:330 stabs.c:1708 +#: stabs.c:328 stabs.c:1706 msgid "numeric overflow" msgstr "" -#: stabs.c:340 +#: stabs.c:338 #, c-format msgid "Bad stab: %s\n" msgstr "" -#: stabs.c:348 +#: stabs.c:346 #, c-format msgid "Warning: %s: %s\n" msgstr "" -#: stabs.c:458 +#: stabs.c:456 #, c-format msgid "N_LBRAC not within function\n" msgstr "" -#: stabs.c:497 +#: stabs.c:495 #, c-format msgid "Too many N_RBRACs\n" msgstr "" -#: stabs.c:738 +#: stabs.c:736 msgid "unknown C++ encoded name" msgstr "" #. Complain and keep going, so compilers can invent new #. cross-reference types. -#: stabs.c:1253 +#: stabs.c:1251 msgid "unrecognized cross reference type" msgstr "" #. Does this actually ever happen? Is that why we are worrying #. about dealing with it rather than just calling error_type? -#: stabs.c:1800 +#: stabs.c:1798 msgid "missing index type" msgstr "" -#: stabs.c:2114 +#: stabs.c:2112 msgid "unknown virtual character for baseclass" msgstr "" -#: stabs.c:2132 +#: stabs.c:2130 msgid "unknown visibility character for baseclass" msgstr "" -#: stabs.c:2318 +#: stabs.c:2316 msgid "unnamed $vb type" msgstr "" -#: stabs.c:2324 +#: stabs.c:2322 msgid "unrecognized C++ abbreviation" msgstr "" -#: stabs.c:2400 +#: stabs.c:2398 msgid "unknown visibility character for field" msgstr "" -#: stabs.c:2652 +#: stabs.c:2650 msgid "const/volatile indicator missing" msgstr "" -#: stabs.c:2888 +#: stabs.c:2886 #, c-format msgid "No mangling for \"%s\"\n" msgstr "" -#: stabs.c:3188 +#: stabs.c:3186 msgid "Undefined N_EXCL" msgstr "" -#: stabs.c:3268 +#: stabs.c:3266 #, c-format msgid "Type file number %d out of range\n" msgstr "" -#: stabs.c:3273 +#: stabs.c:3271 #, c-format msgid "Type index number %d out of range\n" msgstr "" -#: stabs.c:3352 +#: stabs.c:3350 #, c-format msgid "Unrecognized XCOFF type %d\n" msgstr "" -#: stabs.c:3644 +#: stabs.c:3642 #, c-format msgid "bad mangled name `%s'\n" msgstr "" -#: stabs.c:3739 +#: stabs.c:3737 #, c-format msgid "no argument types in mangled string\n" msgstr "" -#: stabs.c:5093 +#: stabs.c:5091 #, c-format msgid "Demangled name is not a function\n" msgstr "" -#: stabs.c:5135 +#: stabs.c:5133 #, c-format msgid "Unexpected type in v3 arglist demangling\n" msgstr "" -#: stabs.c:5202 +#: stabs.c:5200 #, c-format msgid "Unrecognized demangle component %d\n" msgstr "" -#: stabs.c:5254 +#: stabs.c:5252 #, c-format msgid "Failed to print demangled template\n" msgstr "" -#: stabs.c:5334 +#: stabs.c:5332 #, c-format msgid "Couldn't get demangled builtin type\n" msgstr "" -#: stabs.c:5383 +#: stabs.c:5381 #, c-format msgid "Unexpected demangled varargs\n" msgstr "" -#: stabs.c:5390 +#: stabs.c:5388 #, c-format msgid "Unrecognized demangled builtin type\n" msgstr "" -#: strings.c:218 +#: strings.c:215 #, c-format msgid "invalid number %s" msgstr "" -#: strings.c:700 +#: strings.c:697 #, c-format msgid "invalid integer argument %s" msgstr "" -#: strings.c:709 +#: strings.c:706 #, c-format msgid " Display printable strings in [file(s)] (stdin by default)\n" msgstr "" -#: strings.c:710 +#: strings.c:707 #, c-format msgid "" " The options are:\n" @@ -5117,12 +5248,12 @@ msgid "" " -v --version Print the program's version number\n" msgstr "" -#: sysdump.c:642 +#: sysdump.c:641 #, c-format msgid "Print a human readable interpretation of a SYSROFF object file\n" msgstr "" -#: sysdump.c:643 +#: sysdump.c:642 #, c-format msgid "" " The options are:\n" @@ -5130,70 +5261,139 @@ msgid "" " -v --version Print the program's version number\n" msgstr "" -#: sysdump.c:710 +#: sysdump.c:709 #, c-format msgid "cannot open input file %s" msgstr "" -#: version.c:35 +#: version.c:34 #, c-format -msgid "Copyright 2005 Free Software Foundation, Inc.\n" +msgid "Copyright 2007 Free Software Foundation, Inc.\n" msgstr "" -#: version.c:36 +#: version.c:35 #, c-format msgid "" "This program is free software; you may redistribute it under the terms of\n" "the GNU General Public License. This program has absolutely no warranty.\n" msgstr "" -#: windres.c:204 +#: windmc.c:194 #, c-format -msgid "can't open %s `%s': %s" +msgid "can't create %s file ,%s' for output.\n" msgstr "" -#: windres.c:370 +#: windmc.c:202 #, c-format -msgid ": expected to be a directory\n" +msgid "Usage: %s [option(s)] [input-file]\n" msgstr "" -#: windres.c:382 +#: windmc.c:204 #, c-format -msgid ": expected to be a leaf\n" +msgid "" +" The options are:\n" +" -a --ascii_in Read input file as ASCII file\n" +" -A --ascii_out Write binary messages as ASCII\n" +" -b --binprefix .bin filename is prefixed by .mc filename_ " +"for uniqueness.\n" +" -c --customflag Set custom flags for messages\n" +" -C --codepage_in= Set codepage when reading mc text file\n" +" -d --decimal_values Print values to text files decimal\n" +" -e --extension= Set header extension used on export header " +"file\n" +" -F --target Specify output target for endianess.\n" +" -h --headerdir= Set the export directory for headers\n" +" -u --unicode_in Read input file as UTF16 file\n" +" -U --unicode_out Write binary messages as UFT16\n" +" -m --maxlength= Set the maximal allowed message length\n" +" -n --nullterminate Automatic add a zero termination to strings\n" +" -o --hresult_use Use HRESULT definition instead of status code " +"definition\n" +" -O --codepage_out= Set codepage used for writing text file\n" +" -r --rcdir= Set the export directory for rc files\n" +" -x --xdbg= Where to create the .dbg C include file\n" +" that maps message ID's to their symbolic " +"name.\n" msgstr "" -#: windres.c:391 +#: windmc.c:224 +#, c-format +msgid "" +" -H --help Print this help message\n" +" -v --verbose Verbose - tells you what it's doing\n" +" -V --version Print version information\n" +msgstr "" + +#: windmc.c:287 windres.c:415 #, c-format msgid "%s: warning: " msgstr "" -#: windres.c:393 +#: windmc.c:288 +#, c-format +msgid "A codepage was specified switch ,%s' and UTF16.\n" +msgstr "" + +#: windmc.c:289 +#, c-format +msgid "\tcodepage settings are ignored.\n" +msgstr "" + +#: windmc.c:333 +msgid "try to add a ill language." +msgstr "" + +#: windmc.c:1142 +#, c-format +msgid "unable to open file ,%s' for input.\n" +msgstr "" + +#: windmc.c:1161 +msgid "input file does not seems to be UFT16.\n" +msgstr "" + +#: windres.c:220 +#, c-format +msgid "can't open %s `%s': %s" +msgstr "" + +#: windres.c:394 +#, c-format +msgid ": expected to be a directory\n" +msgstr "" + +#: windres.c:406 +#, c-format +msgid ": expected to be a leaf\n" +msgstr "" + +#: windres.c:417 #, c-format msgid ": duplicate value\n" msgstr "" -#: windres.c:543 +#: windres.c:567 #, c-format msgid "unknown format type `%s'" msgstr "" -#: windres.c:544 +#: windres.c:568 #, c-format msgid "%s: supported formats:" msgstr "" #. Otherwise, we give up. -#: windres.c:627 +#: windres.c:651 #, c-format msgid "can not determine type of file `%s'; use the -J option" msgstr "" -#: windres.c:639 +#: windres.c:663 #, c-format msgid "Usage: %s [option(s)] [input-file] [output-file]\n" msgstr "" -#: windres.c:641 +#: windres.c:665 #, c-format msgid "" " The options are:\n" @@ -5207,6 +5407,7 @@ msgid "" " -D --define [=] Define SYM when preprocessing rc file\n" " -U --undefine Undefine SYM when preprocessing rc file\n" " -v --verbose Verbose - tells you what it's doing\n" +" -c --codepage= Specify default codepage\n" " -l --language= Set language when reading rc file\n" " --use-temp-file Use a temporary file instead of popen to " "read\n" @@ -5214,12 +5415,12 @@ msgid "" " --no-use-temp-file Use popen (default)\n" msgstr "" -#: windres.c:657 +#: windres.c:682 #, c-format msgid " --yydebug Turn on parser debugging\n" msgstr "" -#: windres.c:660 +#: windres.c:685 #, c-format msgid "" " -r Ignored for compatibility with rc\n" @@ -5228,7 +5429,7 @@ msgid "" " -V --version Print version information\n" msgstr "" -#: windres.c:665 +#: windres.c:690 #, c-format msgid "" "FORMAT is one of rc, res, or coff, and is deduced from the file name\n" @@ -5236,36 +5437,40 @@ msgid "" "No input-file is stdin, default rc. No output-file is stdout, default rc.\n" msgstr "" -#: windres.c:803 +#: windres.c:828 +msgid "invalid codepage specified.\n" +msgstr "" + +#: windres.c:843 msgid "invalid option -f\n" msgstr "" -#: windres.c:808 +#: windres.c:848 msgid "No filename following the -fo option.\n" msgstr "" -#: windres.c:866 +#: windres.c:907 #, c-format msgid "" "Option -I is deprecated for setting the input format, please use -J " "instead.\n" msgstr "" -#: windres.c:984 +#: windres.c:1027 msgid "no resources" msgstr "" -#: wrstabs.c:354 wrstabs.c:1915 +#: wrstabs.c:353 wrstabs.c:1916 #, c-format msgid "string_hash_lookup failed: %s" msgstr "" -#: wrstabs.c:635 +#: wrstabs.c:636 #, c-format msgid "stab_int_type: bad size %u" msgstr "" -#: wrstabs.c:1393 +#: wrstabs.c:1394 #, c-format msgid "%s: warning: unknown size for field `%s' in struct" msgstr "" diff --git a/binutils/po/da.gmo b/binutils/po/da.gmo deleted file mode 100644 index 8f9b965b6ed..00000000000 Binary files a/binutils/po/da.gmo and /dev/null differ diff --git a/binutils/po/es.gmo b/binutils/po/es.gmo deleted file mode 100644 index f5f43fabe67..00000000000 Binary files a/binutils/po/es.gmo and /dev/null differ diff --git a/binutils/po/fi.gmo b/binutils/po/fi.gmo deleted file mode 100644 index 55d819ee4c7..00000000000 Binary files a/binutils/po/fi.gmo and /dev/null differ diff --git a/binutils/po/fr.gmo b/binutils/po/fr.gmo deleted file mode 100644 index 214c0998cf4..00000000000 Binary files a/binutils/po/fr.gmo and /dev/null differ diff --git a/binutils/po/ja.gmo b/binutils/po/ja.gmo deleted file mode 100644 index 5152d33babf..00000000000 Binary files a/binutils/po/ja.gmo and /dev/null differ diff --git a/binutils/po/ro.gmo b/binutils/po/ro.gmo deleted file mode 100644 index f1c1e0e13ad..00000000000 Binary files a/binutils/po/ro.gmo and /dev/null differ diff --git a/binutils/po/ru.gmo b/binutils/po/ru.gmo deleted file mode 100644 index 88eb5d3023c..00000000000 Binary files a/binutils/po/ru.gmo and /dev/null differ diff --git a/binutils/po/rw.gmo b/binutils/po/rw.gmo deleted file mode 100644 index 6d5d7b9ef17..00000000000 Binary files a/binutils/po/rw.gmo and /dev/null differ diff --git a/binutils/po/sv.gmo b/binutils/po/sv.gmo deleted file mode 100644 index 16e64439949..00000000000 Binary files a/binutils/po/sv.gmo and /dev/null differ diff --git a/binutils/po/tr.gmo b/binutils/po/tr.gmo deleted file mode 100644 index 71904464e41..00000000000 Binary files a/binutils/po/tr.gmo and /dev/null differ diff --git a/binutils/po/vi.gmo b/binutils/po/vi.gmo deleted file mode 100644 index c63cb5d0042..00000000000 Binary files a/binutils/po/vi.gmo and /dev/null differ diff --git a/binutils/po/zh_CN.gmo b/binutils/po/zh_CN.gmo deleted file mode 100644 index 04e985e361f..00000000000 Binary files a/binutils/po/zh_CN.gmo and /dev/null differ diff --git a/binutils/po/zh_TW.gmo b/binutils/po/zh_TW.gmo deleted file mode 100644 index b02a71ee6b1..00000000000 Binary files a/binutils/po/zh_TW.gmo and /dev/null differ diff --git a/binutils/prdbg.c b/binutils/prdbg.c index 87a49341b01..529903d790c 100644 --- a/binutils/prdbg.c +++ b/binutils/prdbg.c @@ -1,5 +1,5 @@ /* prdbg.c -- Print out generic debugging information. - Copyright 1995, 1996, 1999, 2002, 2003, 2004 + Copyright 1995, 1996, 1999, 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor . Tags style generation written by Salvador E. Tropea . @@ -24,12 +24,11 @@ /* This file prints out the generic debugging information, by supplying a set of routines to debug_write. */ -#include +#include "sysdep.h" #include - #include "bfd.h" -#include "bucomm.h" #include "libiberty.h" +#include "demangle.h" #include "debug.h" #include "budbg.h" @@ -53,7 +52,7 @@ struct pr_handle /* The symbols table for this BFD. */ asymbol **syms; /* Pointer to a function to demangle symbols. */ - char *(*demangler) (bfd *, const char *); + char *(*demangler) (bfd *, const char *, int); }; /* The type stack. */ @@ -724,8 +723,8 @@ pr_function_type (void *p, int argcount, bfd_boolean varargs) /* Now the return type is on the top of the stack. */ - s = (char *) xmalloc (len); - strcpy (s, "(|) ("); + s = xmalloc (len); + LITSTRCPY (s, "(|) ("); if (argcount < 0) strcat (s, "/* unknown */"); @@ -910,11 +909,10 @@ pr_method_type (void *p, bfd_boolean domain, int argcount, bfd_boolean varargs) domain_type = pop_type (info); if (domain_type == NULL) return FALSE; - if (strncmp (domain_type, "class ", sizeof "class " - 1) == 0 + if (CONST_STRNEQ (domain_type, "class ") && strchr (domain_type + sizeof "class " - 1, ' ') == NULL) domain_type += sizeof "class " - 1; - else if (strncmp (domain_type, "union class ", - sizeof "union class ") == 0 + else if (CONST_STRNEQ (domain_type, "union class ") && (strchr (domain_type + sizeof "union class " - 1, ' ') == NULL)) domain_type += sizeof "union class " - 1; @@ -1317,7 +1315,7 @@ pr_class_baseclass (void *p, bfd_vma bitpos, bfd_boolean virtual, if (t == NULL) return FALSE; - if (strncmp (t, "class ", sizeof "class " - 1) == 0) + if (CONST_STRNEQ (t, "class ")) t += sizeof "class " - 1; /* Push it back on to take advantage of the prepend_type and @@ -2154,12 +2152,10 @@ tg_class_static_member (void *p, const char *name, len_var = strlen (name); len_class = strlen (info->stack->next->type); - full_name = (char *) xmalloc (len_var + len_class + 3); + full_name = xmalloc (len_var + len_class + 3); if (! full_name) return FALSE; - memcpy (full_name, info->stack->next->type, len_class); - memcpy (full_name + len_class, "::", 2); - memcpy (full_name + len_class + 2, name, len_var + 1); + sprintf (full_name, "%s::%s", info->stack->next->type, name); if (! substitute_type (info, full_name)) return FALSE; @@ -2199,7 +2195,7 @@ tg_class_baseclass (void *p, bfd_vma bitpos ATTRIBUTE_UNUSED, if (t == NULL) return FALSE; - if (strncmp (t, "class ", sizeof "class " - 1) == 0) + if (CONST_STRNEQ (t, "class ")) t += sizeof "class " - 1; /* Push it back on to take advantage of the prepend_type and @@ -2529,25 +2525,18 @@ tg_variable (void *p, const char *name, enum debug_var_kind kind, bfd_vma val ATTRIBUTE_UNUSED) { struct pr_handle *info = (struct pr_handle *) p; - char *t; - const char *dname, *from_class; + char *t, *dname, *from_class; t = pop_type (info); if (t == NULL) return FALSE; - dname = name; + dname = NULL; if (info->demangler) - { - dname = info->demangler (info->abfd, name); - if (strcmp (name, dname) == 0) - { - free ((char *) dname); - dname = name; - } - } + dname = info->demangler (info->abfd, name, DMGL_ANSI | DMGL_PARAMS); - if (dname != name) + from_class = NULL; + if (dname != NULL) { char *sep; sep = strstr (dname, "::"); @@ -2558,14 +2547,9 @@ tg_variable (void *p, const char *name, enum debug_var_kind kind, from_class = dname; } else - { - /* Obscure types as vts and type_info nodes. */ - name = dname; - from_class = NULL; - } + /* Obscure types as vts and type_info nodes. */ + name = dname; } - else - from_class = NULL; fprintf (info->f, "%s\t%s\t0;\"\tkind:v\ttype:%s", name, info->filename, t); @@ -2583,10 +2567,10 @@ tg_variable (void *p, const char *name, enum debug_var_kind kind, } if (from_class) - { - fprintf (info->f, "\tclass:%s",from_class); - free ((char *) dname); - } + fprintf (info->f, "\tclass:%s", from_class); + + if (dname) + free (dname); fprintf (info->f, "\n"); @@ -2601,28 +2585,22 @@ static bfd_boolean tg_start_function (void *p, const char *name, bfd_boolean global) { struct pr_handle *info = (struct pr_handle *) p; - const char *dname; + char *dname; if (! global) info->stack->flavor = "static"; else info->stack->flavor = NULL; - dname = name; + dname = NULL; if (info->demangler) - { - dname = info->demangler (info->abfd, name); - if (strcmp (name, dname) == 0) - { - free ((char *) dname); - dname = name; - } - } + dname = info->demangler (info->abfd, name, DMGL_ANSI | DMGL_PARAMS); - if (! substitute_type (info, dname)) + if (! substitute_type (info, dname ? dname : name)) return FALSE; - if (dname != name) + info->stack->method = NULL; + if (dname != NULL) { char *sep; sep = strstr (dname, "::"); @@ -2642,8 +2620,6 @@ tg_start_function (void *p, const char *name, bfd_boolean global) *sep = 0; /* Obscure functions as type_info function. */ } - else - info->stack->method = NULL; info->stack->parents = strdup (name); diff --git a/binutils/rclex.c b/binutils/rclex.c index b546335b1ab..ef0961b61ca 100644 --- a/binutils/rclex.c +++ b/binutils/rclex.c @@ -1,646 +1,9 @@ -/* A lexical scanner generated by flex */ +/* rclex.c -- lexer for Windows rc files parser */ -/* Scanner skeleton version: - * $Header: /cvs/src/src/binutils/rclex.c,v 1.1.16.1 2006/04/16 18:36:40 drow Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include -#include - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#ifndef _WIN32 -#include -#endif - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 86 -#define YY_END_OF_BUFFER 87 -static yyconst short int yy_accept[470] = - { 0, - 0, 0, 87, 85, 84, 83, 85, 78, 80, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 2, 4, 84, - 0, 81, 78, 80, 79, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 81, 0, 82, 11, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - - 82, 82, 82, 82, 82, 3, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 76, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 41, 82, 82, - 82, 53, 42, 82, 82, 82, 82, 82, 82, 82, - 46, 82, 82, 82, 82, 82, 82, 71, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - - 82, 82, 82, 7, 82, 82, 82, 38, 1, 82, - 82, 82, 82, 82, 18, 82, 82, 25, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 70, - 82, 82, 39, 40, 82, 82, 82, 82, 82, 30, - 82, 82, 82, 82, 82, 82, 50, 82, 82, 82, - 82, 82, 34, 82, 82, 9, 82, 82, 19, 82, - 68, 82, 82, 82, 82, 82, 82, 12, 0, 82, - 82, 82, 82, 82, 82, 82, 13, 82, 14, 82, - 82, 82, 82, 65, 82, 82, 82, 52, 82, 72, - 82, 82, 82, 82, 82, 82, 47, 82, 82, 82, - - 82, 82, 82, 82, 82, 82, 58, 82, 82, 36, - 82, 82, 82, 82, 82, 82, 82, 82, 0, 82, - 0, 77, 17, 82, 82, 51, 82, 10, 82, 82, - 82, 82, 16, 82, 82, 82, 82, 82, 82, 82, - 29, 82, 82, 82, 82, 82, 82, 82, 73, 82, - 31, 82, 82, 82, 82, 82, 82, 45, 6, 82, - 82, 82, 82, 77, 82, 23, 24, 82, 15, 82, - 27, 82, 82, 66, 82, 28, 54, 43, 82, 82, - 82, 48, 82, 69, 8, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - - 64, 82, 82, 82, 82, 56, 82, 82, 82, 82, - 35, 49, 82, 82, 82, 82, 20, 82, 82, 82, - 82, 82, 82, 82, 82, 74, 82, 82, 82, 32, - 82, 82, 37, 82, 82, 82, 82, 82, 82, 75, - 82, 67, 61, 82, 82, 82, 33, 59, 60, 5, - 21, 82, 82, 82, 82, 55, 57, 82, 82, 82, - 26, 63, 82, 82, 82, 62, 22, 44, 0 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 5, 6, 1, 1, 1, 1, 1, - 1, 1, 1, 7, 1, 1, 1, 8, 8, 8, - 9, 8, 8, 8, 8, 8, 8, 1, 1, 1, - 1, 1, 1, 1, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 19, 26, 27, 28, 29, 30, 19, 31, 32, 19, - 1, 1, 1, 1, 1, 1, 33, 33, 33, 33, - - 33, 33, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 33, - 19, 19, 34, 1, 35, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[36] = - { 0, - 1, 2, 3, 2, 1, 4, 2, 5, 5, 5, - 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, - 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 5, 1, 1 - } ; - -static yyconst short int yy_base[476] = - { 0, - 0, 0, 517, 518, 34, 518, 511, 0, 494, 25, - 26, 45, 25, 28, 24, 488, 499, 49, 0, 40, - 43, 488, 51, 66, 67, 484, 35, 518, 518, 81, - 505, 84, 0, 488, 518, 0, 496, 479, 494, 477, - 75, 476, 479, 477, 46, 491, 70, 486, 473, 483, - 55, 479, 483, 468, 69, 471, 86, 84, 469, 479, - 466, 480, 466, 461, 477, 472, 75, 455, 81, 459, - 87, 77, 470, 469, 467, 454, 454, 460, 96, 463, - 455, 449, 448, 110, 468, 458, 0, 453, 446, 451, - 450, 445, 454, 437, 438, 451, 435, 450, 432, 428, - - 431, 432, 435, 443, 426, 0, 425, 438, 437, 422, - 417, 419, 429, 421, 422, 426, 414, 430, 425, 412, - 426, 407, 408, 409, 421, 411, 0, 404, 411, 418, - 416, 412, 410, 417, 395, 401, 414, 408, 394, 403, - 399, 393, 389, 390, 388, 394, 396, 105, 385, 389, - 401, 390, 391, 398, 387, 379, 381, 378, 375, 378, - 372, 376, 389, 370, 365, 105, 383, 0, 381, 369, - 365, 0, 0, 364, 365, 362, 360, 377, 363, 358, - 105, 375, 374, 353, 357, 357, 351, 0, 368, 354, - 349, 348, 354, 348, 345, 358, 348, 356, 358, 354, - - 349, 346, 351, 0, 337, 346, 352, 0, 0, 336, - 122, 336, 347, 107, 0, 347, 333, 0, 330, 328, - 338, 327, 338, 330, 329, 322, 319, 315, 332, 0, - 332, 333, 0, 0, 329, 324, 331, 316, 316, 0, - 116, 307, 309, 320, 324, 320, 0, 323, 320, 110, - 320, 320, 0, 308, 318, 0, 318, 310, 0, 296, - 0, 300, 309, 296, 293, 306, 306, 0, 135, 139, - 295, 289, 292, 302, 290, 292, 0, 295, 297, 297, - 278, 294, 297, 0, 295, 280, 278, 0, 279, 0, - 272, 285, 269, 287, 272, 283, 0, 282, 281, 273, - - 267, 279, 263, 259, 261, 259, 0, 276, 258, 0, - 257, 256, 260, 250, 271, 270, 267, 260, 272, 145, - 271, 151, 0, 261, 243, 0, 242, 0, 261, 240, - 260, 241, 0, 252, 239, 252, 238, 233, 249, 248, - 0, 251, 249, 249, 236, 229, 242, 227, 0, 224, - 0, 225, 224, 241, 226, 239, 220, 229, 0, 218, - 217, 224, 219, 237, 215, 0, 0, 211, 0, 228, - 0, 211, 205, 0, 218, 0, 0, 0, 214, 208, - 213, 0, 222, 0, 0, 217, 206, 201, 202, 201, - 215, 201, 201, 199, 208, 210, 209, 201, 190, 196, - - 194, 190, 190, 192, 198, 0, 200, 184, 186, 184, - 0, 0, 186, 183, 190, 178, 0, 179, 173, 174, - 172, 185, 188, 183, 173, 0, 185, 173, 166, 0, - 169, 177, 0, 166, 162, 157, 159, 158, 161, 0, - 157, 0, 0, 162, 167, 158, 0, 0, 0, 0, - 0, 143, 152, 143, 141, 0, 0, 130, 124, 124, - 0, 0, 107, 85, 80, 0, 0, 0, 518, 158, - 163, 65, 168, 173, 178 - } ; - -static yyconst short int yy_def[476] = - { 0, - 469, 1, 469, 469, 469, 469, 470, 471, 472, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 469, 469, 469, - 470, 469, 471, 472, 469, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 469, 470, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 469, 474, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 475, 474, - 475, 474, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 475, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, - 473, 473, 473, 473, 473, 473, 473, 473, 0, 469, - 469, 469, 469, 469, 469 - } ; - -static yyconst short int yy_nxt[554] = - { 0, - 4, 5, 6, 5, 7, 8, 4, 9, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 19, - 20, 21, 22, 19, 23, 24, 25, 19, 26, 27, - 19, 19, 19, 28, 29, 30, 37, 30, 50, 41, - 52, 55, 51, 42, 81, 38, 43, 56, 82, 63, - 53, 39, 83, 40, 44, 95, 67, 64, 54, 96, - 59, 45, 60, 65, 103, 46, 68, 66, 47, 34, - 61, 62, 48, 49, 70, 73, 71, 74, 76, 72, - 77, 104, 30, 78, 30, 84, 84, 90, 85, 108, - 91, 98, 99, 75, 79, 111, 113, 123, 126, 109, - - 129, 124, 131, 132, 114, 139, 468, 467, 127, 112, - 130, 84, 84, 205, 85, 241, 206, 273, 242, 225, - 274, 140, 243, 269, 269, 295, 270, 141, 226, 466, - 207, 227, 228, 304, 229, 465, 269, 269, 305, 319, - 321, 296, 321, 322, 36, 321, 321, 464, 321, 322, - 36, 321, 321, 463, 321, 322, 36, 321, 31, 31, - 462, 31, 31, 33, 33, 461, 33, 33, 36, 460, - 459, 36, 36, 320, 320, 458, 320, 320, 321, 321, - 457, 456, 321, 455, 454, 453, 452, 451, 450, 449, - 448, 447, 446, 445, 444, 443, 442, 441, 440, 439, - - 438, 437, 436, 435, 434, 433, 432, 431, 430, 429, - 428, 427, 426, 425, 424, 423, 422, 421, 420, 419, - 418, 417, 416, 415, 414, 413, 412, 411, 410, 409, - 408, 407, 406, 405, 404, 403, 402, 401, 400, 399, - 398, 364, 397, 396, 395, 394, 393, 392, 391, 390, - 389, 388, 387, 386, 385, 384, 383, 382, 381, 380, - 379, 378, 377, 376, 375, 374, 373, 372, 371, 370, - 369, 368, 367, 366, 365, 364, 364, 363, 362, 361, - 360, 359, 358, 357, 356, 355, 354, 353, 352, 351, - 350, 349, 348, 347, 346, 345, 344, 343, 342, 341, - - 340, 339, 338, 337, 336, 335, 334, 333, 332, 331, - 330, 329, 328, 327, 326, 325, 324, 323, 318, 317, - 316, 315, 314, 313, 312, 311, 310, 309, 308, 307, - 306, 303, 302, 301, 300, 299, 298, 297, 294, 293, - 292, 291, 290, 289, 288, 287, 286, 285, 284, 283, - 282, 281, 280, 279, 278, 277, 276, 275, 272, 271, - 268, 267, 266, 265, 264, 263, 262, 261, 260, 259, - 258, 257, 256, 255, 254, 253, 252, 251, 250, 249, - 248, 247, 246, 245, 244, 240, 239, 238, 237, 236, - 235, 234, 233, 232, 231, 230, 224, 223, 222, 221, - - 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, - 210, 209, 208, 204, 203, 202, 201, 200, 199, 198, - 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, - 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, - 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, - 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, - 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, - 147, 146, 32, 145, 144, 143, 142, 138, 137, 136, - 135, 134, 133, 128, 125, 122, 121, 120, 119, 118, - 117, 116, 115, 110, 107, 106, 105, 102, 101, 100, - - 97, 94, 93, 92, 89, 88, 87, 86, 35, 32, - 80, 69, 58, 57, 35, 32, 469, 3, 469, 469, - 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, - 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, - 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, - 469, 469, 469 - } ; - -static yyconst short int yy_chk[554] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 5, 10, 5, 13, 11, - 14, 15, 13, 11, 27, 10, 11, 15, 27, 20, - 14, 10, 27, 10, 12, 45, 21, 20, 14, 45, - 18, 12, 18, 20, 51, 12, 21, 20, 12, 472, - 18, 18, 12, 12, 23, 24, 23, 24, 25, 23, - 25, 51, 30, 25, 30, 32, 32, 41, 32, 55, - 41, 47, 47, 24, 25, 57, 58, 67, 69, 55, - - 71, 67, 72, 72, 58, 79, 465, 464, 69, 57, - 71, 84, 84, 148, 84, 181, 148, 214, 181, 166, - 214, 79, 181, 211, 211, 241, 211, 79, 166, 463, - 148, 166, 166, 250, 166, 460, 269, 269, 250, 269, - 270, 241, 270, 270, 270, 270, 320, 459, 320, 320, - 320, 320, 322, 458, 322, 322, 322, 322, 470, 470, - 455, 470, 470, 471, 471, 454, 471, 471, 473, 453, - 452, 473, 473, 474, 474, 446, 474, 474, 475, 475, - 445, 444, 475, 441, 439, 438, 437, 436, 435, 434, - 432, 431, 429, 428, 427, 425, 424, 423, 422, 421, - - 420, 419, 418, 416, 415, 414, 413, 410, 409, 408, - 407, 405, 404, 403, 402, 401, 400, 399, 398, 397, - 396, 395, 394, 393, 392, 391, 390, 389, 388, 387, - 386, 383, 381, 380, 379, 375, 373, 372, 370, 368, - 365, 364, 363, 362, 361, 360, 358, 357, 356, 355, - 354, 353, 352, 350, 348, 347, 346, 345, 344, 343, - 342, 340, 339, 338, 337, 336, 335, 334, 332, 331, - 330, 329, 327, 325, 324, 321, 319, 318, 317, 316, - 315, 314, 313, 312, 311, 309, 308, 306, 305, 304, - 303, 302, 301, 300, 299, 298, 296, 295, 294, 293, - - 292, 291, 289, 287, 286, 285, 283, 282, 281, 280, - 279, 278, 276, 275, 274, 273, 272, 271, 267, 266, - 265, 264, 263, 262, 260, 258, 257, 255, 254, 252, - 251, 249, 248, 246, 245, 244, 243, 242, 239, 238, - 237, 236, 235, 232, 231, 229, 228, 227, 226, 225, - 224, 223, 222, 221, 220, 219, 217, 216, 213, 212, - 210, 207, 206, 205, 203, 202, 201, 200, 199, 198, - 197, 196, 195, 194, 193, 192, 191, 190, 189, 187, - 186, 185, 184, 183, 182, 180, 179, 178, 177, 176, - 175, 174, 171, 170, 169, 167, 165, 164, 163, 162, - - 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, - 151, 150, 149, 147, 146, 145, 144, 143, 142, 141, - 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, - 130, 129, 128, 126, 125, 124, 123, 122, 121, 120, - 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, - 109, 108, 107, 105, 104, 103, 102, 101, 100, 99, - 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, - 88, 86, 85, 83, 82, 81, 80, 78, 77, 76, - 75, 74, 73, 70, 68, 66, 65, 64, 63, 62, - 61, 60, 59, 56, 54, 53, 52, 50, 49, 48, - - 46, 44, 43, 42, 40, 39, 38, 37, 34, 31, - 26, 22, 17, 16, 9, 7, 3, 469, 469, 469, - 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, - 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, - 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, - 469, 469, 469 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "rclex.l" -#define INITIAL 0 -#line 2 "rclex.l" -/* Copyright 1997, 1998, 1999, 2001, 2002, 2003, 2005 +/* Copyright 1997, 1998, 1999, 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. - Written by Ian Lance Taylor, Cygnus Support. + + Written by Kai Tietz, Onevision. This file is part of GNU Binutils. @@ -659,10 +22,10 @@ char *yytext; Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -/* This is a lex input file which generates a lexer used by the - Windows rc file parser. It basically just recognized a bunch of - keywords. */ +/* This is a lexer used by the Windows rc file parser. It basically + just recognized a bunch of keywords. */ +#include "sysdep.h" #include "bfd.h" #include "bucomm.h" #include "libiberty.h" @@ -672,8 +35,6 @@ char *yytext; #include -#define YY_NO_UNPUT - /* Whether we are in rcdata mode, in which we returns the lengths of strings. */ @@ -689,7 +50,7 @@ static int rcdata_mode; static int suppress_cpp_data; -#define MAYBE_RETURN(x) return suppress_cpp_data ? IGNORED_TOKEN : (x) +#define IGNORE_CPP(x) (suppress_cpp_data ? IGNORED_TOKEN : (x)) /* The first filename we detect in the cpp output. We use this to tell included files from the original file. */ @@ -706,1668 +67,139 @@ struct alloc_string static struct alloc_string *strings; -/* Local functions. */ - -static void cpp_line (const char *); -static char *handle_quotes (const char *, unsigned long *); -static char *get_string (int); - -#line 716 "rclex.c" - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - } -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 78 "rclex.l" - - -#line 881 "rclex.c" - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 470 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 518 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 80 "rclex.l" -{ MAYBE_RETURN (BEG); } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 81 "rclex.l" -{ MAYBE_RETURN (BEG); } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 82 "rclex.l" -{ MAYBE_RETURN (END); } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 83 "rclex.l" -{ MAYBE_RETURN (END); } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 84 "rclex.l" -{ MAYBE_RETURN (ACCELERATORS); } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 85 "rclex.l" -{ MAYBE_RETURN (VIRTKEY); } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 86 "rclex.l" -{ MAYBE_RETURN (ASCII); } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 87 "rclex.l" -{ MAYBE_RETURN (NOINVERT); } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 88 "rclex.l" -{ MAYBE_RETURN (SHIFT); } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 89 "rclex.l" -{ MAYBE_RETURN (CONTROL); } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 90 "rclex.l" -{ MAYBE_RETURN (ALT); } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 91 "rclex.l" -{ MAYBE_RETURN (BITMAP); } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 92 "rclex.l" -{ MAYBE_RETURN (CURSOR); } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 93 "rclex.l" -{ MAYBE_RETURN (DIALOG); } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 94 "rclex.l" -{ MAYBE_RETURN (DIALOGEX); } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 95 "rclex.l" -{ MAYBE_RETURN (EXSTYLE); } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 96 "rclex.l" -{ MAYBE_RETURN (CAPTION); } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 97 "rclex.l" -{ MAYBE_RETURN (CLASS); } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 98 "rclex.l" -{ MAYBE_RETURN (STYLE); } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 99 "rclex.l" -{ MAYBE_RETURN (AUTO3STATE); } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 100 "rclex.l" -{ MAYBE_RETURN (AUTOCHECKBOX); } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 101 "rclex.l" -{ MAYBE_RETURN (AUTORADIOBUTTON); } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 102 "rclex.l" -{ MAYBE_RETURN (CHECKBOX); } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 103 "rclex.l" -{ MAYBE_RETURN (COMBOBOX); } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 104 "rclex.l" -{ MAYBE_RETURN (CTEXT); } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 105 "rclex.l" -{ MAYBE_RETURN (DEFPUSHBUTTON); } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 106 "rclex.l" -{ MAYBE_RETURN (EDITTEXT); } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 107 "rclex.l" -{ MAYBE_RETURN (GROUPBOX); } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 108 "rclex.l" -{ MAYBE_RETURN (LISTBOX); } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 109 "rclex.l" -{ MAYBE_RETURN (LTEXT); } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 110 "rclex.l" -{ MAYBE_RETURN (PUSHBOX); } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 111 "rclex.l" -{ MAYBE_RETURN (PUSHBUTTON); } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 112 "rclex.l" -{ MAYBE_RETURN (RADIOBUTTON); } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 113 "rclex.l" -{ MAYBE_RETURN (RTEXT); } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 114 "rclex.l" -{ MAYBE_RETURN (SCROLLBAR); } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 115 "rclex.l" -{ MAYBE_RETURN (STATE3); } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 116 "rclex.l" -{ MAYBE_RETURN (USERBUTTON); } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 117 "rclex.l" -{ MAYBE_RETURN (BEDIT); } - YY_BREAK -case 39: -YY_RULE_SETUP -#line 118 "rclex.l" -{ MAYBE_RETURN (HEDIT); } - YY_BREAK -case 40: -YY_RULE_SETUP -#line 119 "rclex.l" -{ MAYBE_RETURN (IEDIT); } - YY_BREAK -case 41: -YY_RULE_SETUP -#line 120 "rclex.l" -{ MAYBE_RETURN (FONT); } - YY_BREAK -case 42: -YY_RULE_SETUP -#line 121 "rclex.l" -{ MAYBE_RETURN (ICON); } - YY_BREAK -case 43: -YY_RULE_SETUP -#line 122 "rclex.l" -{ MAYBE_RETURN (LANGUAGE); } - YY_BREAK -case 44: -YY_RULE_SETUP -#line 123 "rclex.l" -{ MAYBE_RETURN (CHARACTERISTICS); } - YY_BREAK -case 45: -YY_RULE_SETUP -#line 124 "rclex.l" -{ MAYBE_RETURN (VERSIONK); } - YY_BREAK -case 46: -YY_RULE_SETUP -#line 125 "rclex.l" -{ MAYBE_RETURN (MENU); } - YY_BREAK -case 47: -YY_RULE_SETUP -#line 126 "rclex.l" -{ MAYBE_RETURN (MENUEX); } - YY_BREAK -case 48: -YY_RULE_SETUP -#line 127 "rclex.l" -{ MAYBE_RETURN (MENUITEM); } - YY_BREAK -case 49: -YY_RULE_SETUP -#line 128 "rclex.l" -{ MAYBE_RETURN (SEPARATOR); } - YY_BREAK -case 50: -YY_RULE_SETUP -#line 129 "rclex.l" -{ MAYBE_RETURN (POPUP); } - YY_BREAK -case 51: -YY_RULE_SETUP -#line 130 "rclex.l" -{ MAYBE_RETURN (CHECKED); } - YY_BREAK -case 52: -YY_RULE_SETUP -#line 131 "rclex.l" -{ MAYBE_RETURN (GRAYED); } - YY_BREAK -case 53: -YY_RULE_SETUP -#line 132 "rclex.l" -{ MAYBE_RETURN (HELP); } - YY_BREAK -case 54: -YY_RULE_SETUP -#line 133 "rclex.l" -{ MAYBE_RETURN (INACTIVE); } - YY_BREAK -case 55: -YY_RULE_SETUP -#line 134 "rclex.l" -{ MAYBE_RETURN (MENUBARBREAK); } - YY_BREAK -case 56: -YY_RULE_SETUP -#line 135 "rclex.l" -{ MAYBE_RETURN (MENUBREAK); } - YY_BREAK -case 57: -YY_RULE_SETUP -#line 136 "rclex.l" -{ MAYBE_RETURN (MESSAGETABLE); } - YY_BREAK -case 58: -YY_RULE_SETUP -#line 137 "rclex.l" -{ MAYBE_RETURN (RCDATA); } - YY_BREAK -case 59: -YY_RULE_SETUP -#line 138 "rclex.l" -{ MAYBE_RETURN (STRINGTABLE); } - YY_BREAK -case 60: -YY_RULE_SETUP -#line 139 "rclex.l" -{ MAYBE_RETURN (VERSIONINFO); } - YY_BREAK -case 61: -YY_RULE_SETUP -#line 140 "rclex.l" -{ MAYBE_RETURN (FILEVERSION); } - YY_BREAK -case 62: -YY_RULE_SETUP -#line 141 "rclex.l" -{ MAYBE_RETURN (PRODUCTVERSION); } - YY_BREAK -case 63: -YY_RULE_SETUP -#line 142 "rclex.l" -{ MAYBE_RETURN (FILEFLAGSMASK); } - YY_BREAK -case 64: -YY_RULE_SETUP -#line 143 "rclex.l" -{ MAYBE_RETURN (FILEFLAGS); } - YY_BREAK -case 65: -YY_RULE_SETUP -#line 144 "rclex.l" -{ MAYBE_RETURN (FILEOS); } - YY_BREAK -case 66: -YY_RULE_SETUP -#line 145 "rclex.l" -{ MAYBE_RETURN (FILETYPE); } - YY_BREAK -case 67: -YY_RULE_SETUP -#line 146 "rclex.l" -{ MAYBE_RETURN (FILESUBTYPE); } - YY_BREAK -case 68: -YY_RULE_SETUP -#line 147 "rclex.l" -{ MAYBE_RETURN (VALUE); } - YY_BREAK -case 69: -YY_RULE_SETUP -#line 148 "rclex.l" -{ MAYBE_RETURN (MOVEABLE); } - YY_BREAK -case 70: -YY_RULE_SETUP -#line 149 "rclex.l" -{ MAYBE_RETURN (FIXED); } - YY_BREAK -case 71: -YY_RULE_SETUP -#line 150 "rclex.l" -{ MAYBE_RETURN (PURE); } - YY_BREAK -case 72: -YY_RULE_SETUP -#line 151 "rclex.l" -{ MAYBE_RETURN (IMPURE); } - YY_BREAK -case 73: -YY_RULE_SETUP -#line 152 "rclex.l" -{ MAYBE_RETURN (PRELOAD); } - YY_BREAK -case 74: -YY_RULE_SETUP -#line 153 "rclex.l" -{ MAYBE_RETURN (LOADONCALL); } - YY_BREAK -case 75: -YY_RULE_SETUP -#line 154 "rclex.l" -{ MAYBE_RETURN (DISCARDABLE); } - YY_BREAK -case 76: -YY_RULE_SETUP -#line 155 "rclex.l" -{ MAYBE_RETURN (NOT); } - YY_BREAK -case 77: -YY_RULE_SETUP -#line 157 "rclex.l" +struct rclex_keywords { - char *s, *send; + const char *name; + int tok; +}; - /* This is a hack to let us parse version - information easily. */ +#define K(KEY) { #KEY, KEY } +#define KRT(KEY) { #KEY, RT_##KEY } - s = strchr (yytext, '"'); - ++s; - send = strchr (s, '"'); - if (strncmp (s, "StringFileInfo", - sizeof "StringFileInfo" - 1) == 0 - && s + sizeof "StringFileInfo" - 1 == send) - MAYBE_RETURN (BLOCKSTRINGFILEINFO); - else if (strncmp (s, "VarFileInfo", - sizeof "VarFileInfo" - 1) == 0 - && s + sizeof "VarFileInfo" - 1 == send) - MAYBE_RETURN (BLOCKVARFILEINFO); - else - { - char *r; - - r = get_string (send - s + 1); - strncpy (r, s, send - s); - r[send - s] = '\0'; - yylval.s = r; - MAYBE_RETURN (BLOCK); - } - } - YY_BREAK -case 78: -YY_RULE_SETUP -#line 186 "rclex.l" +static const struct rclex_keywords keywds[] = { - cpp_line (yytext); - } - YY_BREAK -case 79: -YY_RULE_SETUP -#line 190 "rclex.l" + K(ACCELERATORS), K(ALT), K(ANICURSOR), K(ANIICON), K(ASCII), + K(AUTO3STATE), K(AUTOCHECKBOX), K(AUTORADIOBUTTON), + K(BEDIT), { "BEGIN", BEG }, K(BITMAP), K(BLOCK), K(BUTTON), + K(CAPTION), K(CHARACTERISTICS), K(CHECKBOX), K(CHECKED), + K(CLASS), K(COMBOBOX), K(CONTROL), K(CTEXT), K(CURSOR), + K(DEFPUSHBUTTON), K(DIALOG), K(DIALOGEX), K(DISCARDABLE), + K(DLGINCLUDE), K(DLGINIT), + K(EDITTEXT), K(END), K(EXSTYLE), + K(FILEFLAGS), K(FILEFLAGSMASK), K(FILEOS), K(FILESUBTYPE), + K(FILETYPE), K(FILEVERSION), K(FIXED), K(FONT), K(FONTDIR), + K(GRAYED), KRT(GROUP_CURSOR), KRT(GROUP_ICON), K(GROUPBOX), + K(HEDIT), K(HELP), K(HTML), + K(ICON), K(IEDIT), K(IMPURE), K(INACTIVE), + K(LANGUAGE), K(LISTBOX), K(LOADONCALL), K(LTEXT), + K(MANIFEST), K(MENU), K(MENUBARBREAK), K(MENUBREAK), + K(MENUEX), K(MENUITEM), K(MESSAGETABLE), K(MOVEABLE), + K(NOINVERT), K(NOT), + K(PLUGPLAY), K(POPUP), K(PRELOAD), K(PRODUCTVERSION), + K(PURE), K(PUSHBOX), K(PUSHBUTTON), + K(RADIOBUTTON), K(RCDATA), K(RTEXT), + K(SCROLLBAR), K(SEPARATOR), K(SHIFT), K(STATE3), + K(STRINGTABLE), K(STYLE), + K(TOOLBAR), + K(USERBUTTON), + K(VALUE), { "VERSION", VERSIONK }, K(VERSIONINFO), + K(VIRTKEY), K(VXD), + { NULL, 0 }, +}; + +/* External input stream from resrc */ +extern FILE *cpp_pipe; + +/* Lexical scanner helpers. */ +static int rclex_lastch = -1; +static size_t rclex_tok_max = 0; +static size_t rclex_tok_pos = 0; +static char *rclex_tok = NULL; + +static int +rclex_translatekeyword (const char *key) { - yylval.i.val = strtoul (yytext, 0, 0); - yylval.i.dword = 1; - MAYBE_RETURN (NUMBER); - } - YY_BREAK -case 80: -YY_RULE_SETUP -#line 196 "rclex.l" -{ - yylval.i.val = strtoul (yytext, 0, 0); - yylval.i.dword = 0; - MAYBE_RETURN (NUMBER); - } - YY_BREAK -case 81: -YY_RULE_SETUP -#line 202 "rclex.l" -{ - char *s; - unsigned long length; - - s = handle_quotes (yytext, &length); - if (! rcdata_mode) - { - yylval.s = s; - MAYBE_RETURN (QUOTEDSTRING); - } - else - { - yylval.ss.length = length; - yylval.ss.s = s; - MAYBE_RETURN (SIZEDSTRING); - } - } - YY_BREAK -case 82: -YY_RULE_SETUP -#line 220 "rclex.l" -{ - char *s; - - /* I rejected comma in a string in order to - handle VIRTKEY, CONTROL in an accelerator - resource. This means that an unquoted - file name can not contain a comma. I - don't know what rc permits. */ - - s = get_string (strlen (yytext) + 1); - strcpy (s, yytext); - yylval.s = s; - MAYBE_RETURN (STRING); - } - YY_BREAK -case 83: -YY_RULE_SETUP -#line 235 "rclex.l" -{ ++rc_lineno; } - YY_BREAK -case 84: -YY_RULE_SETUP -#line 236 "rclex.l" -{ /* ignore whitespace */ } - YY_BREAK -case 85: -YY_RULE_SETUP -#line 237 "rclex.l" -{ MAYBE_RETURN (*yytext); } - YY_BREAK -case 86: -YY_RULE_SETUP -#line 239 "rclex.l" -ECHO; - YY_BREAK -#line 1460 "rclex.c" -case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 470 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 470 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 469); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - - return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef _WIN32 -#include -#else -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -#line 239 "rclex.l" - -#ifndef yywrap -/* This is needed for some versions of lex. */ -int yywrap (void) -{ - return 1; + if (key && ISUPPER (key[0])) + { + const struct rclex_keywords *kw = &keywds[0]; + + do + { + if (! strcmp (kw->name, key)) + return kw->tok; + ++kw; + } + while (kw->name != NULL); + } + return STRING; } -#endif /* Handle a C preprocessor line. */ static void -cpp_line (const char *s) +cpp_line (void) { + const char *s = rclex_tok; int line; char *send, *fn; + size_t len, mlen; ++s; while (ISSPACE (*s)) ++s; + /* Check for #pragma code_page ( DEFAULT | ). */ + len = strlen (s); + mlen = strlen ("pragma"); + if (len > mlen && memcmp (s, "pragma", mlen) == 0 && ISSPACE (s[mlen])) + { + const char *end; + + s += mlen + 1; + while (ISSPACE (*s)) + ++s; + len = strlen (s); + mlen = strlen ("code_page"); + if (len <= mlen || memcmp (s, "code_page", mlen) != 0) + /* FIXME: We ought to issue a warning message about an unrecognised pragma. */ + return; + s += mlen; + while (ISSPACE (*s)) + ++s; + if (*s != '(') + /* FIXME: We ought to issue an error message about a malformed pragma. */ + return; + ++s; + while (ISSPACE (*s)) + ++s; + if (*s == 0 || (end = strchr (s, ')')) == NULL) + /* FIXME: We ought to issue an error message about a malformed pragma. */ + return; + len = (size_t) (end - s); + fn = xmalloc (len + 1); + if (len) + memcpy (fn, s, len); + fn[len] = 0; + while (len > 0 && (fn[len - 1] > 0 && fn[len - 1] <= 0x20)) + fn[--len] = 0; + if (! len || (len == strlen ("DEFAULT") && strcasecmp (fn, "DEFAULT") == 0)) + wind_current_codepage = wind_default_codepage; + else if (len > 0) + { + rc_uint_type ncp; + + if (fn[0] == '0' && (fn[1] == 'x' || fn[1] == 'X')) + ncp = (rc_uint_type) strtol (fn + 2, NULL, 16); + else + ncp = (rc_uint_type) strtol (fn, NULL, 10); + if (ncp == CP_UTF16 || ! unicode_is_valid_codepage (ncp)) + fatal (_("invalid value specified for pragma code_page.\n")); + wind_current_codepage = ncp; + } + free (fn); + return; + } + line = strtol (s, &send, 0); if (*send != '\0' && ! ISSPACE (*send)) return; @@ -2387,14 +219,14 @@ cpp_line (const char *s) if (send == NULL) return; - fn = (char *) xmalloc (send - s + 1); + fn = xmalloc (send - s + 1); strncpy (fn, s, send - s); fn[send - s] = '\0'; free (rc_filename); rc_filename = fn; - if (!initial_fn) + if (! initial_fn) { initial_fn = xmalloc (strlen (fn) + 1); strcpy (initial_fn, fn); @@ -2409,13 +241,30 @@ cpp_line (const char *s) suppress_cpp_data = 1; } +/* Allocate a string of a given length. */ + +static char * +get_string (int len) +{ + struct alloc_string *as; + + as = xmalloc (sizeof *as); + as->s = xmalloc (len); + + as->next = strings; + strings = as; + + return as->s; +} + /* Handle a quoted string. The quotes are stripped. A pair of quotes in a string are turned into a single quote. Adjacent strings are merged separated by whitespace are merged, as in C. */ static char * -handle_quotes (const char *input, unsigned long *len) +handle_quotes (rc_uint_type *len) { + const char *input = rclex_tok; char *ret, *s; const char *t; int ch; @@ -2440,6 +289,8 @@ handle_quotes (const char *input, unsigned long *len) case '\"': rcparse_warning ("use \"\" to put \" in a string"); + *s++ = '"'; + ++t; break; case 'a': @@ -2498,7 +349,7 @@ handle_quotes (const char *input, unsigned long *len) *s++ = ch; break; - case 'x': + case 'x': case 'X': ++t; ch = 0; /* We only handle single byte chars here. Make sure @@ -2538,6 +389,7 @@ handle_quotes (const char *input, unsigned long *len) } else { + rcparse_warning ("unexpected character after '\"'"); ++t; assert (ISSPACE (*t)); while (ISSPACE (*t)) @@ -2560,20 +412,166 @@ handle_quotes (const char *input, unsigned long *len) return ret; } -/* Allocate a string of a given length. */ +/* Allocate a unicode string of a given length. */ -static char * -get_string (int len) +static unichar * +get_unistring (int len) { - struct alloc_string *as; + return (unichar *) get_string (len * sizeof (unichar)); +} - as = (struct alloc_string *) xmalloc (sizeof *as); - as->s = xmalloc (len); +/* Handle a quoted unicode string. The quotes are stripped. A pair of quotes + in a string are turned into a single quote. Adjacent strings are + merged separated by whitespace are merged, as in C. */ - as->next = strings; - strings = as; +static unichar * +handle_uniquotes (rc_uint_type *len) +{ + const char *input = rclex_tok; + unichar *ret, *s; + const char *t; + int ch; + int num_xdigits; - return as->s; + ret = get_unistring (strlen (input) + 1); + + s = ret; + t = input; + if ((*t == 'L' || *t == 'l') && t[1] == '"') + t += 2; + else if (*t == '"') + ++t; + while (*t != '\0') + { + if (*t == '\\') + { + ++t; + switch (*t) + { + case '\0': + rcparse_warning ("backslash at end of string"); + break; + + case '\"': + rcparse_warning ("use \"\" to put \" in a string"); + break; + + case 'a': + *s++ = ESCAPE_B; /* Strange, but true... */ + ++t; + break; + + case 'b': + *s++ = ESCAPE_B; + ++t; + break; + + case 'f': + *s++ = ESCAPE_F; + ++t; + break; + + case 'n': + *s++ = ESCAPE_N; + ++t; + break; + + case 'r': + *s++ = ESCAPE_R; + ++t; + break; + + case 't': + *s++ = ESCAPE_T; + ++t; + break; + + case 'v': + *s++ = ESCAPE_V; + ++t; + break; + + case '\\': + *s++ = (unichar) *t++; + break; + + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + ch = *t - '0'; + ++t; + if (*t >= '0' && *t <= '7') + { + ch = (ch << 3) | (*t - '0'); + ++t; + if (*t >= '0' && *t <= '7') + { + ch = (ch << 3) | (*t - '0'); + ++t; + } + } + *s++ = (unichar) ch; + break; + + case 'x': case 'X': + ++t; + ch = 0; + /* We only handle two byte chars here. Make sure + we finish an escape sequence like "/xB0ABC" after + the first two digits. */ + num_xdigits = 4; + while (num_xdigits--) + { + if (*t >= '0' && *t <= '9') + ch = (ch << 4) | (*t - '0'); + else if (*t >= 'a' && *t <= 'f') + ch = (ch << 4) | (*t - 'a' + 10); + else if (*t >= 'A' && *t <= 'F') + ch = (ch << 4) | (*t - 'A' + 10); + else + break; + ++t; + } + *s++ = (unichar) ch; + break; + + default: + rcparse_warning ("unrecognized escape sequence"); + *s++ = '\\'; + *s++ = (unichar) *t++; + break; + } + } + else if (*t != '"') + *s++ = (unichar) *t++; + else if (t[1] == '\0') + break; + else if (t[1] == '"') + { + *s++ = '"'; + t += 2; + } + else + { + ++t; + assert (ISSPACE (*t)); + while (ISSPACE (*t)) + { + if ((*t) == '\n') + ++rc_lineno; + ++t; + } + if (*t == '\0') + break; + assert (*t == '"'); + ++t; + } + } + + *s = '\0'; + + *len = s - ret; + + return ret; } /* Discard all the strings we have allocated. The parser calls this @@ -2599,7 +597,6 @@ rcparse_discard_strings (void) } /* Enter rcdata mode. */ - void rcparse_rcdata (void) { @@ -2607,9 +604,285 @@ rcparse_rcdata (void) } /* Go back to normal mode from rcdata mode. */ - void rcparse_normal (void) { rcdata_mode = 0; } + +static void +rclex_tok_add_char (int ch) +{ + if (! rclex_tok || rclex_tok_max <= rclex_tok_pos) + { + char *h = xmalloc (rclex_tok_max + 9); + + if (! h) + abort (); + if (rclex_tok) + { + memcpy (h, rclex_tok, rclex_tok_pos + 1); + free (rclex_tok); + } + else + rclex_tok_pos = 0; + rclex_tok_max += 8; + rclex_tok = h; + } + if (ch != -1) + rclex_tok[rclex_tok_pos++] = (char) ch; + rclex_tok[rclex_tok_pos] = 0; +} + +static int +rclex_readch (void) +{ + int r = -1; + + if ((r = rclex_lastch) != -1) + rclex_lastch = -1; + else + { + char ch; + do + { + if (! cpp_pipe || feof (cpp_pipe) + || fread (&ch, 1, 1,cpp_pipe) != 1) + break; + r = ((int) ch) & 0xff; + } + while (r == 0 || r == '\r'); + } + rclex_tok_add_char (r); + return r; +} + +static int +rclex_peekch (void) +{ + int r; + + if ((r = rclex_lastch) == -1) + { + if ((r = rclex_readch ()) != -1) + { + rclex_lastch = r; + if (rclex_tok_pos > 0) + rclex_tok[--rclex_tok_pos] = 0; + } + } + return r; +} + +static void +rclex_string (void) +{ + int c; + + while ((c = rclex_peekch ()) != -1) + { + if (c == '\n') + break; + if (c == '\\') + { + rclex_readch (); + if ((c = rclex_peekch ()) == -1 || c == '\n') + break; + rclex_readch (); + } + else if (rclex_readch () == '"') + { + if (rclex_peekch () == '"') + rclex_readch (); + else + break; + } + } +} + +static rc_uint_type +read_digit (int ch) +{ + rc_uint_type base = 10; + rc_uint_type ret, val; + int warned = 0; + + ret = 0; + if (ch == '0') + { + base = 8; + switch (rclex_peekch ()) + { + case 'o': case 'O': + rclex_readch (); + base = 8; + break; + + case 'x': case 'X': + rclex_readch (); + base = 16; + break; + } + } + else + ret = (rc_uint_type) (ch - '0'); + while ((ch = rclex_peekch ()) != -1) + { + if (ISDIGIT (ch)) + val = (rc_uint_type) (ch - '0'); + else if (ch >= 'a' && ch <= 'f') + val = (rc_uint_type) ((ch - 'a') + 10); + else if (ch >= 'A' && ch <= 'F') + val = (rc_uint_type) ((ch - 'A') + 10); + else + break; + rclex_readch (); + if (! warned && val >= base) + { + warned = 1; + rcparse_warning ("digit exceeds base"); + } + ret *= base; + ret += val; + } + return ret; +} + +/* yyparser entry method. */ + +int +yylex (void) +{ + char *s; + unichar *us; + rc_uint_type length; + int ch; + + /* Make sure that rclex_tok is initialized. */ + if (! rclex_tok) + rclex_tok_add_char (-1); + + do + { + do + { + /* Clear token. */ + rclex_tok_pos = 0; + rclex_tok[0] = 0; + + if ((ch = rclex_readch ()) == -1) + return -1; + if (ch == '\n') + ++rc_lineno; + } + while (ch <= 0x20); + + switch (ch) + { + case '#': + while ((ch = rclex_peekch ()) != -1 && ch != '\n') + rclex_readch (); + cpp_line (); + ch = IGNORED_TOKEN; + break; + + case '{': + ch = IGNORE_CPP (BEG); + break; + + case '}': + ch = IGNORE_CPP (END); + break; + + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + yylval.i.val = read_digit (ch); + yylval.i.dword = 0; + switch (rclex_peekch ()) + { + case 'l': case 'L': + rclex_readch (); + yylval.i.dword = 1; + break; + } + ch = IGNORE_CPP (NUMBER); + break; + case '"': + rclex_string (); + ch = IGNORE_CPP ((! rcdata_mode ? QUOTEDSTRING : SIZEDSTRING)); + if (ch == IGNORED_TOKEN) + break; + s = handle_quotes (&length); + if (! rcdata_mode) + yylval.s = s; + else + { + yylval.ss.length = length; + yylval.ss.s = s; + } + break; + case 'L': case 'l': + if (rclex_peekch () == '"') + { + rclex_readch (); + rclex_string (); + ch = IGNORE_CPP ((! rcdata_mode ? QUOTEDUNISTRING : SIZEDUNISTRING)); + if (ch == IGNORED_TOKEN) + break; + us = handle_uniquotes (&length); + if (! rcdata_mode) + yylval.uni = us; + else + { + yylval.suni.length = length; + yylval.suni.s = us; + } + break; + } + /* Fall through. */ + default: + if (ISIDST (ch) || ch=='$') + { + while ((ch = rclex_peekch ()) != -1 && (ISIDNUM (ch) || ch == '$' || ch == '.')) + rclex_readch (); + ch = IGNORE_CPP (rclex_translatekeyword (rclex_tok)); + if (ch == STRING) + { + s = get_string (strlen (rclex_tok) + 1); + strcpy (s, rclex_tok); + yylval.s = s; + } + else if (ch == BLOCK) + { + const char *hs = NULL; + + switch (yylex ()) + { + case STRING: + case QUOTEDSTRING: + hs = yylval.s; + break; + case SIZEDSTRING: + hs = yylval.s = yylval.ss.s; + break; + } + if (! hs) + { + rcparse_warning ("BLOCK expects a string as argument."); + ch = IGNORED_TOKEN; + } + else if (! strcmp (hs, "StringFileInfo")) + ch = BLOCKSTRINGFILEINFO; + else if (! strcmp (hs, "VarFileInfo")) + ch = BLOCKVARFILEINFO; + } + break; + } + ch = IGNORE_CPP (ch); + break; + } + } + while (ch == IGNORED_TOKEN); + + return ch; +} diff --git a/binutils/rclex.l b/binutils/rclex.l deleted file mode 100644 index 92b1ec73852..00000000000 --- a/binutils/rclex.l +++ /dev/null @@ -1,504 +0,0 @@ -%{ /* rclex.l -- lexer for Windows rc files parser */ -/* Copyright 1997, 1998, 1999, 2001, 2002, 2003, 2005 - Free Software Foundation, Inc. - Written by Ian Lance Taylor, Cygnus Support. - - This file is part of 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 2 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. */ - -/* This is a lex input file which generates a lexer used by the - Windows rc file parser. It basically just recognized a bunch of - keywords. */ - -#include "bfd.h" -#include "bucomm.h" -#include "libiberty.h" -#include "safe-ctype.h" -#include "windres.h" -#include "rcparse.h" - -#include - -#define YY_NO_UNPUT - -/* Whether we are in rcdata mode, in which we returns the lengths of - strings. */ - -static int rcdata_mode; - -/* Whether we are supressing lines from cpp (including windows.h or - headers from your C sources may bring in externs and typedefs). - When active, we return IGNORED_TOKEN, which lets us ignore these - outside of resource constructs. Thus, it isn't required to protect - all the non-preprocessor lines in your header files with #ifdef - RC_INVOKED. It also means your RC file can't include other RC - files if they're named "*.h". Sorry. Name them *.rch or whatever. */ - -static int suppress_cpp_data; - -#define MAYBE_RETURN(x) return suppress_cpp_data ? IGNORED_TOKEN : (x) - -/* The first filename we detect in the cpp output. We use this to - tell included files from the original file. */ - -static char *initial_fn; - -/* List of allocated strings. */ - -struct alloc_string -{ - struct alloc_string *next; - char *s; -}; - -static struct alloc_string *strings; - -/* Local functions. */ - -static void cpp_line (const char *); -static char *handle_quotes (const char *, unsigned long *); -static char *get_string (int); - -%} - -%% - -"BEGIN" { MAYBE_RETURN (BEG); } -"{" { MAYBE_RETURN (BEG); } -"END" { MAYBE_RETURN (END); } -"}" { MAYBE_RETURN (END); } -"ACCELERATORS" { MAYBE_RETURN (ACCELERATORS); } -"VIRTKEY" { MAYBE_RETURN (VIRTKEY); } -"ASCII" { MAYBE_RETURN (ASCII); } -"NOINVERT" { MAYBE_RETURN (NOINVERT); } -"SHIFT" { MAYBE_RETURN (SHIFT); } -"CONTROL" { MAYBE_RETURN (CONTROL); } -"ALT" { MAYBE_RETURN (ALT); } -"BITMAP" { MAYBE_RETURN (BITMAP); } -"CURSOR" { MAYBE_RETURN (CURSOR); } -"DIALOG" { MAYBE_RETURN (DIALOG); } -"DIALOGEX" { MAYBE_RETURN (DIALOGEX); } -"EXSTYLE" { MAYBE_RETURN (EXSTYLE); } -"CAPTION" { MAYBE_RETURN (CAPTION); } -"CLASS" { MAYBE_RETURN (CLASS); } -"STYLE" { MAYBE_RETURN (STYLE); } -"AUTO3STATE" { MAYBE_RETURN (AUTO3STATE); } -"AUTOCHECKBOX" { MAYBE_RETURN (AUTOCHECKBOX); } -"AUTORADIOBUTTON" { MAYBE_RETURN (AUTORADIOBUTTON); } -"CHECKBOX" { MAYBE_RETURN (CHECKBOX); } -"COMBOBOX" { MAYBE_RETURN (COMBOBOX); } -"CTEXT" { MAYBE_RETURN (CTEXT); } -"DEFPUSHBUTTON" { MAYBE_RETURN (DEFPUSHBUTTON); } -"EDITTEXT" { MAYBE_RETURN (EDITTEXT); } -"GROUPBOX" { MAYBE_RETURN (GROUPBOX); } -"LISTBOX" { MAYBE_RETURN (LISTBOX); } -"LTEXT" { MAYBE_RETURN (LTEXT); } -"PUSHBOX" { MAYBE_RETURN (PUSHBOX); } -"PUSHBUTTON" { MAYBE_RETURN (PUSHBUTTON); } -"RADIOBUTTON" { MAYBE_RETURN (RADIOBUTTON); } -"RTEXT" { MAYBE_RETURN (RTEXT); } -"SCROLLBAR" { MAYBE_RETURN (SCROLLBAR); } -"STATE3" { MAYBE_RETURN (STATE3); } -"USERBUTTON" { MAYBE_RETURN (USERBUTTON); } -"BEDIT" { MAYBE_RETURN (BEDIT); } -"HEDIT" { MAYBE_RETURN (HEDIT); } -"IEDIT" { MAYBE_RETURN (IEDIT); } -"FONT" { MAYBE_RETURN (FONT); } -"ICON" { MAYBE_RETURN (ICON); } -"LANGUAGE" { MAYBE_RETURN (LANGUAGE); } -"CHARACTERISTICS" { MAYBE_RETURN (CHARACTERISTICS); } -"VERSION" { MAYBE_RETURN (VERSIONK); } -"MENU" { MAYBE_RETURN (MENU); } -"MENUEX" { MAYBE_RETURN (MENUEX); } -"MENUITEM" { MAYBE_RETURN (MENUITEM); } -"SEPARATOR" { MAYBE_RETURN (SEPARATOR); } -"POPUP" { MAYBE_RETURN (POPUP); } -"CHECKED" { MAYBE_RETURN (CHECKED); } -"GRAYED" { MAYBE_RETURN (GRAYED); } -"HELP" { MAYBE_RETURN (HELP); } -"INACTIVE" { MAYBE_RETURN (INACTIVE); } -"MENUBARBREAK" { MAYBE_RETURN (MENUBARBREAK); } -"MENUBREAK" { MAYBE_RETURN (MENUBREAK); } -"MESSAGETABLE" { MAYBE_RETURN (MESSAGETABLE); } -"RCDATA" { MAYBE_RETURN (RCDATA); } -"STRINGTABLE" { MAYBE_RETURN (STRINGTABLE); } -"VERSIONINFO" { MAYBE_RETURN (VERSIONINFO); } -"FILEVERSION" { MAYBE_RETURN (FILEVERSION); } -"PRODUCTVERSION" { MAYBE_RETURN (PRODUCTVERSION); } -"FILEFLAGSMASK" { MAYBE_RETURN (FILEFLAGSMASK); } -"FILEFLAGS" { MAYBE_RETURN (FILEFLAGS); } -"FILEOS" { MAYBE_RETURN (FILEOS); } -"FILETYPE" { MAYBE_RETURN (FILETYPE); } -"FILESUBTYPE" { MAYBE_RETURN (FILESUBTYPE); } -"VALUE" { MAYBE_RETURN (VALUE); } -"MOVEABLE" { MAYBE_RETURN (MOVEABLE); } -"FIXED" { MAYBE_RETURN (FIXED); } -"PURE" { MAYBE_RETURN (PURE); } -"IMPURE" { MAYBE_RETURN (IMPURE); } -"PRELOAD" { MAYBE_RETURN (PRELOAD); } -"LOADONCALL" { MAYBE_RETURN (LOADONCALL); } -"DISCARDABLE" { MAYBE_RETURN (DISCARDABLE); } -"NOT" { MAYBE_RETURN (NOT); } - -"BLOCK"[ \t\n]*"\""[^\#\n]*"\"" { - char *s, *send; - - /* This is a hack to let us parse version - information easily. */ - - s = strchr (yytext, '"'); - ++s; - send = strchr (s, '"'); - if (strncmp (s, "StringFileInfo", - sizeof "StringFileInfo" - 1) == 0 - && s + sizeof "StringFileInfo" - 1 == send) - MAYBE_RETURN (BLOCKSTRINGFILEINFO); - else if (strncmp (s, "VarFileInfo", - sizeof "VarFileInfo" - 1) == 0 - && s + sizeof "VarFileInfo" - 1 == send) - MAYBE_RETURN (BLOCKVARFILEINFO); - else - { - char *r; - - r = get_string (send - s + 1); - strncpy (r, s, send - s); - r[send - s] = '\0'; - yylval.s = r; - MAYBE_RETURN (BLOCK); - } - } - -"#"[^\n]* { - cpp_line (yytext); - } - -[0-9][x0-9A-Fa-f]*L { - yylval.i.val = strtoul (yytext, 0, 0); - yylval.i.dword = 1; - MAYBE_RETURN (NUMBER); - } - -[0-9][x0-9A-Fa-f]* { - yylval.i.val = strtoul (yytext, 0, 0); - yylval.i.dword = 0; - MAYBE_RETURN (NUMBER); - } - -("\""[^\"\n]*"\""[ \t\n]*)+ { - char *s; - unsigned long length; - - s = handle_quotes (yytext, &length); - if (! rcdata_mode) - { - yylval.s = s; - MAYBE_RETURN (QUOTEDSTRING); - } - else - { - yylval.ss.length = length; - yylval.ss.s = s; - MAYBE_RETURN (SIZEDSTRING); - } - } - -[A-Za-z][^ ,\t\r\n]* { - char *s; - - /* I rejected comma in a string in order to - handle VIRTKEY, CONTROL in an accelerator - resource. This means that an unquoted - file name can not contain a comma. I - don't know what rc permits. */ - - s = get_string (strlen (yytext) + 1); - strcpy (s, yytext); - yylval.s = s; - MAYBE_RETURN (STRING); - } - -[\n] { ++rc_lineno; } -[ \t\r]+ { /* ignore whitespace */ } -. { MAYBE_RETURN (*yytext); } - -%% -#ifndef yywrap -/* This is needed for some versions of lex. */ -int yywrap (void) -{ - return 1; -} -#endif - -/* Handle a C preprocessor line. */ - -static void -cpp_line (const char *s) -{ - int line; - char *send, *fn; - - ++s; - while (ISSPACE (*s)) - ++s; - - line = strtol (s, &send, 0); - if (*send != '\0' && ! ISSPACE (*send)) - return; - - /* Subtract 1 because we are about to count the newline. */ - rc_lineno = line - 1; - - s = send; - while (ISSPACE (*s)) - ++s; - - if (*s != '"') - return; - - ++s; - send = strchr (s, '"'); - if (send == NULL) - return; - - fn = (char *) xmalloc (send - s + 1); - strncpy (fn, s, send - s); - fn[send - s] = '\0'; - - free (rc_filename); - rc_filename = fn; - - if (!initial_fn) - { - initial_fn = xmalloc (strlen (fn) + 1); - strcpy (initial_fn, fn); - } - - /* Allow the initial file, regardless of name. Suppress all other - files if they end in ".h" (this allows included "*.rc"). */ - if (strcmp (initial_fn, fn) == 0 - || strcmp (fn + strlen (fn) - 2, ".h") != 0) - suppress_cpp_data = 0; - else - suppress_cpp_data = 1; -} - -/* Handle a quoted string. The quotes are stripped. A pair of quotes - in a string are turned into a single quote. Adjacent strings are - merged separated by whitespace are merged, as in C. */ - -static char * -handle_quotes (const char *input, unsigned long *len) -{ - char *ret, *s; - const char *t; - int ch; - int num_xdigits; - - ret = get_string (strlen (input) + 1); - - s = ret; - t = input; - if (*t == '"') - ++t; - while (*t != '\0') - { - if (*t == '\\') - { - ++t; - switch (*t) - { - case '\0': - rcparse_warning ("backslash at end of string"); - break; - - case '\"': - rcparse_warning ("use \"\" to put \" in a string"); - break; - - case 'a': - *s++ = ESCAPE_B; /* Strange, but true... */ - ++t; - break; - - case 'b': - *s++ = ESCAPE_B; - ++t; - break; - - case 'f': - *s++ = ESCAPE_F; - ++t; - break; - - case 'n': - *s++ = ESCAPE_N; - ++t; - break; - - case 'r': - *s++ = ESCAPE_R; - ++t; - break; - - case 't': - *s++ = ESCAPE_T; - ++t; - break; - - case 'v': - *s++ = ESCAPE_V; - ++t; - break; - - case '\\': - *s++ = *t++; - break; - - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - ch = *t - '0'; - ++t; - if (*t >= '0' && *t <= '7') - { - ch = (ch << 3) | (*t - '0'); - ++t; - if (*t >= '0' && *t <= '7') - { - ch = (ch << 3) | (*t - '0'); - ++t; - } - } - *s++ = ch; - break; - - case 'x': - ++t; - ch = 0; - /* We only handle single byte chars here. Make sure - we finish an escape sequence like "/xB0ABC" after - the first two digits. */ - num_xdigits = 2; - while (num_xdigits--) - { - if (*t >= '0' && *t <= '9') - ch = (ch << 4) | (*t - '0'); - else if (*t >= 'a' && *t <= 'f') - ch = (ch << 4) | (*t - 'a' + 10); - else if (*t >= 'A' && *t <= 'F') - ch = (ch << 4) | (*t - 'A' + 10); - else - break; - ++t; - } - *s++ = ch; - break; - - default: - rcparse_warning ("unrecognized escape sequence"); - *s++ = '\\'; - *s++ = *t++; - break; - } - } - else if (*t != '"') - *s++ = *t++; - else if (t[1] == '\0') - break; - else if (t[1] == '"') - { - *s++ = '"'; - t += 2; - } - else - { - ++t; - assert (ISSPACE (*t)); - while (ISSPACE (*t)) - { - if ((*t) == '\n') - ++rc_lineno; - ++t; - } - if (*t == '\0') - break; - assert (*t == '"'); - ++t; - } - } - - *s = '\0'; - - *len = s - ret; - - return ret; -} - -/* Allocate a string of a given length. */ - -static char * -get_string (int len) -{ - struct alloc_string *as; - - as = (struct alloc_string *) xmalloc (sizeof *as); - as->s = xmalloc (len); - - as->next = strings; - strings = as; - - return as->s; -} - -/* Discard all the strings we have allocated. The parser calls this - when it no longer needs them. */ - -void -rcparse_discard_strings (void) -{ - struct alloc_string *as; - - as = strings; - while (as != NULL) - { - struct alloc_string *n; - - free (as->s); - n = as->next; - free (as); - as = n; - } - - strings = NULL; -} - -/* Enter rcdata mode. */ - -void -rcparse_rcdata (void) -{ - rcdata_mode = 1; -} - -/* Go back to normal mode from rcdata mode. */ - -void -rcparse_normal (void) -{ - rcdata_mode = 0; -} diff --git a/binutils/rcparse.c b/binutils/rcparse.c deleted file mode 100644 index a34e0bfca5b..00000000000 --- a/binutils/rcparse.c +++ /dev/null @@ -1,4144 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - 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 2, 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. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - BEG = 258, - END = 259, - ACCELERATORS = 260, - VIRTKEY = 261, - ASCII = 262, - NOINVERT = 263, - SHIFT = 264, - CONTROL = 265, - ALT = 266, - BITMAP = 267, - CURSOR = 268, - DIALOG = 269, - DIALOGEX = 270, - EXSTYLE = 271, - CAPTION = 272, - CLASS = 273, - STYLE = 274, - AUTO3STATE = 275, - AUTOCHECKBOX = 276, - AUTORADIOBUTTON = 277, - CHECKBOX = 278, - COMBOBOX = 279, - CTEXT = 280, - DEFPUSHBUTTON = 281, - EDITTEXT = 282, - GROUPBOX = 283, - LISTBOX = 284, - LTEXT = 285, - PUSHBOX = 286, - PUSHBUTTON = 287, - RADIOBUTTON = 288, - RTEXT = 289, - SCROLLBAR = 290, - STATE3 = 291, - USERBUTTON = 292, - BEDIT = 293, - HEDIT = 294, - IEDIT = 295, - FONT = 296, - ICON = 297, - LANGUAGE = 298, - CHARACTERISTICS = 299, - VERSIONK = 300, - MENU = 301, - MENUEX = 302, - MENUITEM = 303, - SEPARATOR = 304, - POPUP = 305, - CHECKED = 306, - GRAYED = 307, - HELP = 308, - INACTIVE = 309, - MENUBARBREAK = 310, - MENUBREAK = 311, - MESSAGETABLE = 312, - RCDATA = 313, - STRINGTABLE = 314, - VERSIONINFO = 315, - FILEVERSION = 316, - PRODUCTVERSION = 317, - FILEFLAGSMASK = 318, - FILEFLAGS = 319, - FILEOS = 320, - FILETYPE = 321, - FILESUBTYPE = 322, - BLOCKSTRINGFILEINFO = 323, - BLOCKVARFILEINFO = 324, - VALUE = 325, - BLOCK = 326, - MOVEABLE = 327, - FIXED = 328, - PURE = 329, - IMPURE = 330, - PRELOAD = 331, - LOADONCALL = 332, - DISCARDABLE = 333, - NOT = 334, - QUOTEDSTRING = 335, - STRING = 336, - NUMBER = 337, - SIZEDSTRING = 338, - IGNORED_TOKEN = 339, - NEG = 340 - }; -#endif -/* Tokens. */ -#define BEG 258 -#define END 259 -#define ACCELERATORS 260 -#define VIRTKEY 261 -#define ASCII 262 -#define NOINVERT 263 -#define SHIFT 264 -#define CONTROL 265 -#define ALT 266 -#define BITMAP 267 -#define CURSOR 268 -#define DIALOG 269 -#define DIALOGEX 270 -#define EXSTYLE 271 -#define CAPTION 272 -#define CLASS 273 -#define STYLE 274 -#define AUTO3STATE 275 -#define AUTOCHECKBOX 276 -#define AUTORADIOBUTTON 277 -#define CHECKBOX 278 -#define COMBOBOX 279 -#define CTEXT 280 -#define DEFPUSHBUTTON 281 -#define EDITTEXT 282 -#define GROUPBOX 283 -#define LISTBOX 284 -#define LTEXT 285 -#define PUSHBOX 286 -#define PUSHBUTTON 287 -#define RADIOBUTTON 288 -#define RTEXT 289 -#define SCROLLBAR 290 -#define STATE3 291 -#define USERBUTTON 292 -#define BEDIT 293 -#define HEDIT 294 -#define IEDIT 295 -#define FONT 296 -#define ICON 297 -#define LANGUAGE 298 -#define CHARACTERISTICS 299 -#define VERSIONK 300 -#define MENU 301 -#define MENUEX 302 -#define MENUITEM 303 -#define SEPARATOR 304 -#define POPUP 305 -#define CHECKED 306 -#define GRAYED 307 -#define HELP 308 -#define INACTIVE 309 -#define MENUBARBREAK 310 -#define MENUBREAK 311 -#define MESSAGETABLE 312 -#define RCDATA 313 -#define STRINGTABLE 314 -#define VERSIONINFO 315 -#define FILEVERSION 316 -#define PRODUCTVERSION 317 -#define FILEFLAGSMASK 318 -#define FILEFLAGS 319 -#define FILEOS 320 -#define FILETYPE 321 -#define FILESUBTYPE 322 -#define BLOCKSTRINGFILEINFO 323 -#define BLOCKVARFILEINFO 324 -#define VALUE 325 -#define BLOCK 326 -#define MOVEABLE 327 -#define FIXED 328 -#define PURE 329 -#define IMPURE 330 -#define PRELOAD 331 -#define LOADONCALL 332 -#define DISCARDABLE 333 -#define NOT 334 -#define QUOTEDSTRING 335 -#define STRING 336 -#define NUMBER 337 -#define SIZEDSTRING 338 -#define IGNORED_TOKEN 339 -#define NEG 340 - - - - -/* Copy the first part of user declarations. */ -#line 1 "rcparse.y" - /* rcparse.y -- parser for Windows rc files - Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 - Free Software Foundation, Inc. - Written by Ian Lance Taylor, Cygnus Support. - - This file is part of 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 2 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. */ - -/* This is a parser for Windows rc files. It is based on the parser - by Gunther Ebert . */ - -#include "bfd.h" -#include "bucomm.h" -#include "libiberty.h" -#include "windres.h" -#include "safe-ctype.h" - -/* The current language. */ - -static unsigned short language; - -/* The resource information during a sub statement. */ - -static struct res_res_info sub_res_info; - -/* Dialog information. This is built by the nonterminals styles and - controls. */ - -static struct dialog dialog; - -/* This is used when building a style. It is modified by the - nonterminal styleexpr. */ - -static unsigned long style; - -/* These are used when building a control. They are set before using - control_params. */ - -static unsigned long base_style; -static unsigned long default_style; -static unsigned long class; -static struct res_id res_text_field; -static unichar null_unichar; - -/* This is used for COMBOBOX, LISTBOX and EDITTEXT which - do not allow resource 'text' field in control definition. */ -static const struct res_id res_null_text = { 1, {{0, &null_unichar}}}; - - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 66 "rcparse.y" -typedef union YYSTYPE { - struct accelerator acc; - struct accelerator *pacc; - struct dialog_control *dialog_control; - struct menuitem *menuitem; - struct - { - struct rcdata_item *first; - struct rcdata_item *last; - } rcdata; - struct rcdata_item *rcdata_item; - struct stringtable_data *stringtable; - struct fixed_versioninfo *fixver; - struct ver_info *verinfo; - struct ver_stringinfo *verstring; - struct ver_varinfo *vervar; - struct res_id id; - struct res_res_info res_info; - struct - { - unsigned short on; - unsigned short off; - } memflags; - struct - { - unsigned long val; - /* Nonzero if this number was explicitly specified as long. */ - int dword; - } i; - unsigned long il; - unsigned short is; - const char *s; - struct - { - unsigned long length; - const char *s; - } ss; -} YYSTYPE; -/* Line 196 of yacc.c. */ -#line 358 "rcparse.c" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 219 of yacc.c. */ -#line 370 "rcparse.c" - -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -#if ! defined (yyoverflow) || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# else -# define YYSTACK_ALLOC alloca -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYINCLUDED_STDLIB_H -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) -# endif -# ifdef __cplusplus -extern "C" { -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifdef __cplusplus -} -# endif -# endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ - - -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short int yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short int yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 2 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 792 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 99 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 91 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 247 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 500 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 340 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 92, 87, 2, - 97, 98, 90, 88, 95, 89, 2, 91, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 96, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 86, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 85, 2, 93, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 94 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const unsigned short int yyprhs[] = -{ - 0, 0, 3, 4, 7, 10, 13, 16, 19, 22, - 25, 28, 31, 34, 37, 40, 43, 46, 49, 56, - 57, 60, 63, 68, 70, 72, 74, 78, 81, 83, - 85, 87, 89, 91, 93, 98, 103, 104, 118, 119, - 133, 134, 149, 150, 154, 155, 159, 163, 167, 171, - 175, 181, 188, 196, 205, 209, 213, 218, 222, 223, - 226, 227, 232, 233, 238, 239, 244, 245, 250, 251, - 256, 257, 261, 273, 286, 299, 313, 314, 319, 320, - 325, 326, 330, 331, 336, 337, 342, 349, 358, 369, - 381, 382, 387, 388, 392, 393, 398, 399, 404, 405, - 410, 411, 416, 417, 422, 423, 427, 428, 433, 434, - 450, 457, 466, 476, 477, 480, 482, 485, 486, 490, - 491, 495, 496, 500, 501, 505, 510, 515, 519, 526, - 527, 530, 535, 538, 545, 546, 550, 553, 555, 557, - 559, 561, 563, 565, 572, 573, 576, 579, 583, 589, - 592, 598, 605, 613, 623, 628, 635, 640, 641, 644, - 645, 647, 649, 651, 655, 659, 660, 667, 668, 672, - 677, 684, 689, 696, 697, 704, 711, 715, 719, 723, - 727, 731, 732, 741, 749, 750, 756, 757, 761, 763, - 765, 767, 770, 773, 776, 778, 779, 782, 786, 791, - 795, 796, 799, 800, 803, 805, 807, 809, 811, 813, - 815, 817, 819, 821, 823, 826, 830, 835, 837, 841, - 842, 844, 847, 849, 851, 855, 858, 861, 865, 869, - 873, 877, 881, 885, 889, 893, 896, 898, 900, 904, - 907, 911, 915, 919, 923, 927, 931, 935 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const short int yyrhs[] = -{ - 100, 0, -1, -1, 100, 101, -1, 100, 107, -1, - 100, 108, -1, 100, 109, -1, 100, 147, -1, 100, - 148, -1, 100, 149, -1, 100, 150, -1, 100, 155, - -1, 100, 158, -1, 100, 159, -1, 100, 164, -1, - 100, 167, -1, 100, 168, -1, 100, 84, -1, 173, - 5, 176, 3, 102, 4, -1, -1, 102, 103, -1, - 104, 187, -1, 104, 187, 95, 105, -1, 80, -1, - 188, -1, 106, -1, 105, 95, 106, -1, 105, 106, - -1, 6, -1, 7, -1, 8, -1, 9, -1, 10, - -1, 11, -1, 173, 12, 178, 180, -1, 173, 13, - 177, 180, -1, -1, 173, 14, 178, 113, 188, 184, - 184, 184, 110, 114, 3, 115, 4, -1, -1, 173, - 15, 178, 113, 188, 184, 184, 184, 111, 114, 3, - 115, 4, -1, -1, 173, 15, 178, 113, 188, 184, - 184, 184, 184, 112, 114, 3, 115, 4, -1, -1, - 16, 96, 185, -1, -1, 114, 17, 80, -1, 114, - 18, 173, -1, 114, 19, 181, -1, 114, 16, 185, - -1, 114, 18, 80, -1, 114, 41, 185, 95, 80, - -1, 114, 41, 185, 95, 80, 184, -1, 114, 41, - 185, 95, 80, 184, 184, -1, 114, 41, 185, 95, - 80, 184, 184, 184, -1, 114, 46, 173, -1, 114, - 44, 185, -1, 114, 43, 185, 184, -1, 114, 45, - 185, -1, -1, 115, 116, -1, -1, 20, 139, 117, - 138, -1, -1, 21, 139, 118, 138, -1, -1, 22, - 139, 119, 138, -1, -1, 38, 139, 120, 138, -1, - -1, 23, 139, 121, 138, -1, -1, 24, 122, 138, - -1, 10, 139, 185, 184, 141, 184, 184, 184, 184, - 183, 140, -1, 10, 139, 185, 184, 141, 184, 184, - 184, 184, 184, 184, 140, -1, 10, 139, 185, 95, - 80, 141, 184, 184, 184, 184, 183, 140, -1, 10, - 139, 185, 95, 80, 141, 184, 184, 184, 184, 184, - 184, 140, -1, -1, 25, 139, 123, 138, -1, -1, - 26, 139, 124, 138, -1, -1, 27, 125, 138, -1, - -1, 28, 139, 126, 138, -1, -1, 39, 139, 127, - 138, -1, 42, 175, 185, 184, 184, 140, -1, 42, - 175, 185, 184, 184, 184, 184, 140, -1, 42, 175, - 185, 184, 184, 184, 184, 143, 183, 140, -1, 42, - 175, 185, 184, 184, 184, 184, 143, 184, 184, 140, - -1, -1, 40, 139, 128, 138, -1, -1, 29, 129, - 138, -1, -1, 30, 139, 130, 138, -1, -1, 31, - 139, 131, 138, -1, -1, 32, 139, 132, 138, -1, - -1, 33, 139, 133, 138, -1, -1, 34, 139, 134, - 138, -1, -1, 35, 135, 138, -1, -1, 36, 139, - 136, 138, -1, -1, 37, 175, 185, 95, 185, 95, - 185, 95, 185, 95, 185, 95, 137, 181, 183, -1, - 185, 184, 184, 184, 184, 140, -1, 185, 184, 184, - 184, 184, 145, 183, 140, -1, 185, 184, 184, 184, - 184, 145, 184, 184, 140, -1, -1, 188, 95, -1, - 80, -1, 80, 95, -1, -1, 3, 160, 4, -1, - -1, 95, 142, 181, -1, -1, 95, 144, 181, -1, - -1, 95, 146, 181, -1, 173, 41, 177, 180, -1, - 173, 42, 177, 180, -1, 43, 185, 184, -1, 173, - 46, 176, 3, 151, 4, -1, -1, 151, 152, -1, - 48, 80, 184, 153, -1, 48, 49, -1, 50, 80, - 153, 3, 151, 4, -1, -1, 153, 95, 154, -1, - 153, 154, -1, 51, -1, 52, -1, 53, -1, 54, - -1, 55, -1, 56, -1, 173, 47, 176, 3, 156, - 4, -1, -1, 156, 157, -1, 48, 80, -1, 48, - 80, 184, -1, 48, 80, 184, 184, 183, -1, 48, - 49, -1, 50, 80, 3, 156, 4, -1, 50, 80, - 184, 3, 156, 4, -1, 50, 80, 184, 184, 3, - 156, 4, -1, 50, 80, 184, 184, 184, 183, 3, - 156, 4, -1, 173, 57, 178, 180, -1, 173, 58, - 176, 3, 160, 4, -1, 173, 58, 176, 180, -1, - -1, 161, 162, -1, -1, 163, -1, 83, -1, 186, - -1, 163, 95, 83, -1, 163, 95, 186, -1, -1, - 59, 176, 3, 165, 166, 4, -1, -1, 166, 185, - 80, -1, 166, 185, 95, 80, -1, 173, 173, 176, - 3, 160, 4, -1, 173, 173, 176, 180, -1, 173, - 60, 169, 3, 170, 4, -1, -1, 169, 61, 185, - 184, 184, 184, -1, 169, 62, 185, 184, 184, 184, - -1, 169, 63, 185, -1, 169, 64, 185, -1, 169, - 65, 185, -1, 169, 66, 185, -1, 169, 67, 185, - -1, -1, 170, 68, 3, 71, 3, 171, 4, 4, - -1, 170, 69, 3, 70, 80, 172, 4, -1, -1, - 171, 70, 80, 95, 80, -1, -1, 172, 184, 184, - -1, 188, -1, 81, -1, 80, -1, 80, 95, -1, - 81, 95, -1, 188, 95, -1, 174, -1, -1, 176, - 179, -1, 176, 44, 185, -1, 176, 43, 185, 184, - -1, 176, 45, 185, -1, -1, 177, 179, -1, -1, - 178, 179, -1, 72, -1, 73, -1, 74, -1, 75, - -1, 76, -1, 77, -1, 78, -1, 80, -1, 81, - -1, 182, -1, 79, 182, -1, 181, 85, 182, -1, - 181, 85, 79, 182, -1, 82, -1, 97, 185, 98, - -1, -1, 184, -1, 95, 185, -1, 186, -1, 82, - -1, 97, 186, 98, -1, 93, 186, -1, 89, 186, - -1, 186, 90, 186, -1, 186, 91, 186, -1, 186, - 92, 186, -1, 186, 88, 186, -1, 186, 89, 186, - -1, 186, 87, 186, -1, 186, 86, 186, -1, 186, - 85, 186, -1, 95, 188, -1, 189, -1, 82, -1, - 97, 186, 98, -1, 93, 186, -1, 189, 90, 186, - -1, 189, 91, 186, -1, 189, 92, 186, -1, 189, - 88, 186, -1, 189, 89, 186, -1, 189, 87, 186, - -1, 189, 86, 186, -1, 189, 85, 186, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short int yyrline[] = -{ - 0, 161, 161, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 183, 194, - 197, 218, 223, 235, 256, 266, 270, 275, 282, 286, - 291, 295, 299, 303, 312, 324, 338, 336, 363, 361, - 390, 388, 420, 423, 429, 431, 437, 441, 446, 450, - 454, 467, 482, 497, 512, 516, 520, 524, 530, 532, - 544, 543, 555, 554, 566, 565, 577, 576, 591, 590, - 602, 601, 614, 625, 634, 647, 659, 658, 670, 669, - 681, 680, 692, 691, 703, 702, 716, 721, 727, 733, - 740, 739, 754, 753, 765, 764, 776, 775, 786, 785, - 797, 796, 808, 807, 819, 818, 830, 829, 842, 840, - 858, 869, 880, 893, 896, 901, 905, 913, 916, 926, - 925, 932, 931, 938, 937, 945, 957, 970, 979, 990, - 993, 1010, 1014, 1018, 1026, 1029, 1033, 1040, 1044, 1048, - 1052, 1056, 1060, 1069, 1080, 1083, 1100, 1104, 1108, 1112, - 1116, 1120, 1124, 1128, 1138, 1150, 1157, 1170, 1170, 1182, - 1186, 1193, 1201, 1209, 1218, 1233, 1232, 1237, 1239, 1246, - 1259, 1266, 1278, 1289, 1294, 1300, 1306, 1311, 1316, 1321, - 1326, 1341, 1344, 1348, 1356, 1359, 1367, 1370, 1379, 1384, - 1400, 1404, 1408, 1416, 1421, 1439, 1445, 1451, 1456, 1461, - 1472, 1477, 1489, 1494, 1506, 1511, 1516, 1521, 1526, 1531, - 1536, 1546, 1550, 1567, 1571, 1575, 1579, 1586, 1590, 1600, - 1603, 1612, 1621, 1630, 1634, 1638, 1643, 1648, 1653, 1658, - 1663, 1668, 1673, 1678, 1683, 1694, 1703, 1714, 1718, 1722, - 1727, 1732, 1737, 1742, 1747, 1752, 1757, 1762 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "BEG", "END", "ACCELERATORS", "VIRTKEY", - "ASCII", "NOINVERT", "SHIFT", "CONTROL", "ALT", "BITMAP", "CURSOR", - "DIALOG", "DIALOGEX", "EXSTYLE", "CAPTION", "CLASS", "STYLE", - "AUTO3STATE", "AUTOCHECKBOX", "AUTORADIOBUTTON", "CHECKBOX", "COMBOBOX", - "CTEXT", "DEFPUSHBUTTON", "EDITTEXT", "GROUPBOX", "LISTBOX", "LTEXT", - "PUSHBOX", "PUSHBUTTON", "RADIOBUTTON", "RTEXT", "SCROLLBAR", "STATE3", - "USERBUTTON", "BEDIT", "HEDIT", "IEDIT", "FONT", "ICON", "LANGUAGE", - "CHARACTERISTICS", "VERSIONK", "MENU", "MENUEX", "MENUITEM", "SEPARATOR", - "POPUP", "CHECKED", "GRAYED", "HELP", "INACTIVE", "MENUBARBREAK", - "MENUBREAK", "MESSAGETABLE", "RCDATA", "STRINGTABLE", "VERSIONINFO", - "FILEVERSION", "PRODUCTVERSION", "FILEFLAGSMASK", "FILEFLAGS", "FILEOS", - "FILETYPE", "FILESUBTYPE", "BLOCKSTRINGFILEINFO", "BLOCKVARFILEINFO", - "VALUE", "BLOCK", "MOVEABLE", "FIXED", "PURE", "IMPURE", "PRELOAD", - "LOADONCALL", "DISCARDABLE", "NOT", "QUOTEDSTRING", "STRING", "NUMBER", - "SIZEDSTRING", "IGNORED_TOKEN", "'|'", "'^'", "'&'", "'+'", "'-'", "'*'", - "'/'", "'%'", "'~'", "NEG", "','", "'='", "'('", "')'", "$accept", - "input", "accelerator", "acc_entries", "acc_entry", "acc_event", - "acc_options", "acc_option", "bitmap", "cursor", "dialog", "@1", "@2", - "@3", "exstyle", "styles", "controls", "control", "@4", "@5", "@6", "@7", - "@8", "@9", "@10", "@11", "@12", "@13", "@14", "@15", "@16", "@17", - "@18", "@19", "@20", "@21", "@22", "@23", "@24", "control_params", - "optresidc", "opt_control_data", "control_styleexpr", "@25", - "icon_styleexpr", "@26", "control_params_styleexpr", "@27", "font", - "icon", "language", "menu", "menuitems", "menuitem", "menuitem_flags", - "menuitem_flag", "menuex", "menuexitems", "menuexitem", "messagetable", - "rcdata", "optrcdata_data", "@28", "optrcdata_data_int", "rcdata_data", - "stringtable", "@29", "string_data", "user", "versioninfo", - "fixedverinfo", "verblocks", "vervals", "vertrans", "id", "resname", - "resref", "suboptions", "memflags_move_discard", "memflags_move", - "memflag", "file_name", "styleexpr", "parennumber", "optcnumexpr", - "cnumexpr", "numexpr", "sizednumexpr", "cposnumexpr", "posnumexpr", - "sizedposnumexpr", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const unsigned short int yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 124, 94, 38, 43, 45, - 42, 47, 37, 126, 340, 44, 61, 40, 41 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = -{ - 0, 99, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 101, 102, - 102, 103, 103, 104, 104, 105, 105, 105, 106, 106, - 106, 106, 106, 106, 107, 108, 110, 109, 111, 109, - 112, 109, 113, 113, 114, 114, 114, 114, 114, 114, - 114, 114, 114, 114, 114, 114, 114, 114, 115, 115, - 117, 116, 118, 116, 119, 116, 120, 116, 121, 116, - 122, 116, 116, 116, 116, 116, 123, 116, 124, 116, - 125, 116, 126, 116, 127, 116, 116, 116, 116, 116, - 128, 116, 129, 116, 130, 116, 131, 116, 132, 116, - 133, 116, 134, 116, 135, 116, 136, 116, 137, 116, - 138, 138, 138, 139, 139, 139, 139, 140, 140, 142, - 141, 144, 143, 146, 145, 147, 148, 149, 150, 151, - 151, 152, 152, 152, 153, 153, 153, 154, 154, 154, - 154, 154, 154, 155, 156, 156, 157, 157, 157, 157, - 157, 157, 157, 157, 158, 159, 159, 161, 160, 162, - 162, 163, 163, 163, 163, 165, 164, 166, 166, 166, - 167, 167, 168, 169, 169, 169, 169, 169, 169, 169, - 169, 170, 170, 170, 171, 171, 172, 172, 173, 173, - 174, 174, 174, 175, 175, 176, 176, 176, 176, 176, - 177, 177, 178, 178, 179, 179, 179, 179, 179, 179, - 179, 180, 180, 181, 181, 181, 181, 182, 182, 183, - 183, 184, 185, 186, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 187, 188, 189, 189, 189, - 189, 189, 189, 189, 189, 189, 189, 189 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = -{ - 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 6, 0, - 2, 2, 4, 1, 1, 1, 3, 2, 1, 1, - 1, 1, 1, 1, 4, 4, 0, 13, 0, 13, - 0, 14, 0, 3, 0, 3, 3, 3, 3, 3, - 5, 6, 7, 8, 3, 3, 4, 3, 0, 2, - 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, - 0, 3, 11, 12, 12, 13, 0, 4, 0, 4, - 0, 3, 0, 4, 0, 4, 6, 8, 10, 11, - 0, 4, 0, 3, 0, 4, 0, 4, 0, 4, - 0, 4, 0, 4, 0, 3, 0, 4, 0, 15, - 6, 8, 9, 0, 2, 1, 2, 0, 3, 0, - 3, 0, 3, 0, 3, 4, 4, 3, 6, 0, - 2, 4, 2, 6, 0, 3, 2, 1, 1, 1, - 1, 1, 1, 6, 0, 2, 2, 3, 5, 2, - 5, 6, 7, 9, 4, 6, 4, 0, 2, 0, - 1, 1, 1, 3, 3, 0, 6, 0, 3, 4, - 6, 4, 6, 0, 6, 6, 3, 3, 3, 3, - 3, 0, 8, 7, 0, 5, 0, 3, 1, 1, - 1, 2, 2, 2, 1, 0, 2, 3, 4, 3, - 0, 2, 0, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 3, 4, 1, 3, 0, - 1, 2, 1, 1, 3, 2, 2, 3, 3, 3, - 3, 3, 3, 3, 3, 2, 1, 1, 3, 2, - 3, 3, 3, 3, 3, 3, 3, 3 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const unsigned char yydefact[] = -{ - 2, 0, 1, 0, 195, 189, 237, 17, 0, 0, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 0, 188, 236, 223, 0, 0, - 0, 0, 222, 0, 239, 0, 195, 202, 200, 202, - 202, 200, 200, 195, 195, 202, 195, 173, 195, 0, - 0, 0, 0, 0, 0, 0, 0, 226, 225, 0, - 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, - 165, 0, 0, 0, 204, 205, 206, 207, 208, 209, - 210, 196, 238, 0, 0, 0, 42, 42, 0, 0, - 0, 0, 0, 0, 0, 0, 247, 246, 245, 243, - 244, 240, 241, 242, 224, 221, 234, 233, 232, 230, - 231, 227, 228, 229, 167, 0, 197, 199, 19, 211, - 212, 203, 34, 201, 35, 0, 0, 0, 125, 126, - 129, 144, 154, 157, 156, 181, 0, 0, 0, 0, - 0, 0, 0, 157, 171, 0, 198, 0, 0, 0, - 0, 0, 0, 0, 159, 0, 0, 0, 176, 177, - 178, 179, 180, 0, 166, 0, 18, 23, 20, 0, - 24, 43, 0, 0, 128, 0, 0, 130, 143, 0, - 0, 145, 155, 161, 158, 160, 162, 172, 0, 0, - 0, 0, 170, 168, 0, 0, 21, 0, 0, 132, - 0, 134, 149, 146, 0, 0, 0, 0, 0, 0, - 169, 235, 0, 36, 38, 134, 0, 147, 144, 0, - 163, 164, 0, 0, 174, 175, 28, 29, 30, 31, - 32, 33, 22, 25, 44, 44, 40, 131, 129, 137, - 138, 139, 140, 141, 142, 0, 136, 219, 0, 144, - 0, 184, 186, 0, 27, 0, 0, 44, 0, 135, - 148, 220, 150, 0, 144, 219, 0, 0, 26, 58, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, - 0, 133, 151, 0, 0, 0, 0, 183, 0, 0, - 48, 45, 49, 46, 0, 217, 0, 47, 213, 0, - 0, 55, 57, 54, 0, 58, 152, 144, 182, 0, - 187, 37, 113, 113, 113, 113, 113, 70, 113, 113, - 80, 113, 92, 113, 113, 113, 113, 113, 104, 113, - 0, 113, 113, 113, 0, 59, 214, 0, 0, 0, - 56, 39, 0, 0, 0, 115, 0, 0, 60, 62, - 64, 68, 0, 76, 78, 0, 82, 0, 94, 96, - 98, 100, 102, 0, 106, 190, 0, 194, 0, 0, - 66, 84, 90, 0, 218, 0, 215, 50, 41, 153, - 185, 116, 0, 114, 0, 0, 0, 0, 71, 0, - 0, 0, 81, 0, 93, 0, 0, 0, 0, 0, - 105, 0, 191, 192, 0, 193, 0, 0, 0, 0, - 216, 51, 0, 0, 61, 63, 65, 69, 0, 77, - 79, 83, 95, 97, 99, 101, 103, 107, 0, 67, - 85, 91, 0, 52, 0, 119, 0, 0, 0, 117, - 53, 0, 0, 0, 0, 0, 157, 86, 0, 0, - 120, 0, 117, 0, 0, 117, 0, 0, 123, 110, - 219, 0, 118, 121, 87, 219, 0, 219, 0, 117, - 220, 0, 0, 117, 220, 219, 117, 220, 124, 111, - 117, 0, 122, 88, 117, 117, 220, 72, 117, 112, - 0, 89, 74, 117, 73, 108, 75, 0, 219, 109 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const short int yydefgoto[] = -{ - -1, 1, 10, 147, 168, 169, 232, 233, 11, 12, - 13, 234, 235, 257, 126, 255, 289, 335, 384, 385, - 386, 406, 387, 352, 390, 391, 355, 393, 407, 408, - 357, 395, 396, 397, 398, 399, 363, 401, 497, 388, - 346, 447, 436, 442, 465, 472, 460, 468, 14, 15, - 16, 17, 151, 177, 216, 246, 18, 152, 181, 19, - 20, 153, 154, 184, 185, 21, 114, 145, 22, 23, - 94, 155, 266, 267, 24, 367, 368, 33, 85, 84, - 81, 122, 297, 298, 260, 261, 389, 32, 196, 347, - 26 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -426 -static const short int yypact[] = -{ - -426, 12, -426, 287, -426, -426, -426, -426, 287, 287, - -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, - -426, -426, -426, -426, 106, -426, 585, -426, 287, 287, - 287, -80, 675, 83, -426, 637, -426, -426, -426, -426, - -426, -426, -426, -426, -426, -426, -426, -426, -426, 287, - 287, 287, 287, 287, 287, 287, 287, -426, -426, 651, - 287, -426, 287, 287, 287, 287, 287, 287, 287, 287, - -426, 287, 287, 287, -426, -426, -426, -426, -426, -426, - -426, -426, -426, 286, 678, 678, 188, 188, 678, 678, - 323, 375, 678, 210, 128, 274, 682, 688, 302, 89, - 89, -426, -426, -426, -426, -426, 682, 688, 302, 89, - 89, -426, -426, -426, -426, -80, -426, -426, -426, -426, - -426, -426, -426, -426, -426, -70, 142, 142, -426, -426, - -426, -426, -426, -426, -426, -426, 287, 287, 287, 287, - 287, 287, 287, -426, -426, 2, -426, 5, 287, -80, - -80, 33, 40, 47, 373, 38, -80, -80, -426, -426, - -426, -426, -426, 49, -426, 17, -426, -426, -426, -41, - -426, -426, -80, -80, -426, -44, -24, -426, -426, -35, - 36, -426, -426, -426, -426, -13, 675, -426, 129, 138, - -80, -80, -426, -426, 69, 142, 73, -80, -80, -426, - -80, -426, -426, -80, 8, 454, 111, 97, -80, -80, - -426, -426, 775, -426, -80, -426, 119, -80, -426, 13, - -426, 675, 183, 116, -426, -426, -426, -426, -426, -426, - -426, -426, 22, -426, -426, -426, -426, 245, -426, -426, - -426, -426, -426, -426, -426, 736, -426, -80, 96, -426, - 15, -426, -426, 775, -426, 370, 512, -426, 158, -426, - -426, -426, -426, 172, -426, -80, 34, 6, -426, -426, - 287, 125, 227, 72, 287, 287, 287, 287, 260, -426, - 523, -426, -426, 179, 207, 229, 131, -426, -80, 584, - -426, -426, -426, -426, 43, -426, 287, 159, -426, 151, - -80, -426, -426, -426, 621, -426, -426, -426, -426, 153, - -426, -426, 141, 141, 141, 141, 141, -426, 141, 141, - -426, 141, -426, 141, 141, 141, 141, 141, -426, 141, - 230, 141, 141, 141, 230, -426, -426, 160, 133, 169, - -426, -426, 658, 193, 189, 164, 287, 173, -426, -426, - -426, -426, 287, -426, -426, 287, -426, 287, -426, -426, - -426, -426, -426, 287, -426, 175, 181, -426, 287, 184, - -426, -426, -426, 287, -426, 43, -426, -80, -426, -426, - -426, -426, 185, -426, 287, 287, 287, 287, -426, -80, - 287, 287, -426, 287, -426, 287, 287, 287, 287, 287, - -426, 287, -426, -426, 197, -426, 287, 287, 287, -80, - -426, -80, 341, 199, -426, -426, -426, -426, -80, -426, - -426, -426, -426, -426, -426, -426, -426, -426, 287, -426, - -426, -426, -80, -80, 199, -426, -80, -80, 208, 18, - -426, -80, 72, -80, -80, 287, -426, -426, -80, -80, - 159, -80, 19, 211, 298, 20, -80, -80, -426, -426, - -80, 287, -426, -426, -426, -80, -80, -80, 72, 310, - -80, 219, 72, 310, -80, -80, 310, -80, 159, -426, - 310, 287, 159, -426, 310, 310, -80, -426, 310, -426, - 220, -426, -426, 310, -426, -426, -426, 72, -37, -426 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const short int yypgoto[] = -{ - -426, -426, -426, -426, -426, -426, -426, -207, -426, -426, - -426, -426, -426, -426, 218, -222, -255, -426, -426, -426, - -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, - -426, -426, -426, -426, -426, -426, -426, -426, -426, 126, - 388, 107, -113, -426, -426, -426, -426, -426, -426, -426, - -426, -426, 84, -426, 110, 87, -426, -215, -426, -426, - -426, -142, -426, -426, -426, -426, -426, -426, -426, -426, - -426, -426, -426, -426, -22, -426, 0, 397, 82, 212, - 548, 486, -425, -286, -258, 28, -3, 11, -426, 3, - -426 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 -static const unsigned short int yytable[] = -{ - 31, 163, 48, 248, 25, 199, 164, 284, 336, 166, - 287, 218, 2, 256, 202, 60, 249, 450, 264, 34, - 35, 446, 446, 446, 304, 254, 148, 25, 226, 227, - 228, 229, 230, 231, 263, 280, 200, 174, 285, 57, - 58, 59, 187, 478, 178, 203, 268, 482, 338, 283, - 342, 182, 376, 192, 195, 3, 201, 105, 60, 61, - 96, 97, 98, 99, 100, 101, 102, 103, 115, 116, - 117, 4, 498, 106, 107, 108, 109, 110, 111, 112, - 113, 175, 205, 176, 27, 167, 70, 6, 179, 410, - 180, 28, 343, 5, 6, 29, 7, 193, 8, 30, - 262, 60, 9, 60, 286, 8, 188, 189, 60, 9, - 60, 36, 194, 60, 458, 463, 204, 253, 37, 38, - 39, 40, 238, 88, 89, 295, 71, 72, 73, 149, - 150, 135, 206, 156, 157, 158, 159, 160, 161, 162, - 296, 207, 165, 146, 179, 171, 180, 41, 42, 210, - 170, 294, 43, 44, 295, 74, 75, 76, 77, 78, - 79, 80, 281, 45, 46, 186, 47, 223, 212, 296, - 239, 240, 241, 242, 243, 244, 282, 172, 173, 67, - 68, 69, 222, 306, 190, 191, 251, 5, 6, 136, - 137, 138, 139, 140, 141, 142, 252, 379, 211, 8, - 197, 198, 469, 9, 125, 291, 175, 473, 176, 476, - 307, 309, 375, 133, 245, 295, 221, 485, 208, 209, - 179, 345, 180, 6, 6, 213, 214, 179, 215, 180, - 296, 217, 219, 308, 8, 8, 224, 225, 9, 9, - 499, 179, 236, 180, 338, 247, 339, 250, 344, 377, - 293, 86, 87, 71, 72, 73, 303, 92, 374, 381, - 74, 75, 76, 77, 78, 79, 80, 290, 383, 380, - 402, 299, 300, 301, 302, 25, 403, 143, 265, 405, - 412, 25, 74, 75, 76, 77, 78, 79, 80, 118, - 119, 120, 428, 337, 435, 288, 239, 240, 241, 242, - 243, 244, 462, 445, 454, 127, 461, 292, 5, 6, - 365, 366, 6, 446, 481, 495, 310, 71, 72, 73, - 8, 441, 258, 8, 9, 237, 130, 9, 340, 71, - 72, 73, 259, 369, 373, 0, 0, 369, 0, 0, - 245, 5, 6, 382, 0, 0, 74, 75, 76, 77, - 78, 79, 80, 8, 119, 120, 0, 9, 74, 75, - 76, 77, 78, 79, 80, 404, 71, 72, 73, 27, - 409, 0, 0, 269, 0, 0, 28, 0, 131, 0, - 29, 0, 0, 0, 30, 0, 270, 271, 272, 273, - 65, 66, 67, 68, 69, 74, 75, 76, 77, 78, - 79, 80, 0, 0, 0, 411, 0, 0, 0, 105, - 413, 274, 0, 275, 276, 277, 278, 418, 71, 72, - 73, 434, 0, 27, 0, 438, 0, 0, 0, 0, - 28, 0, 0, 83, 29, 0, 0, 432, 30, 433, - 90, 91, 453, 93, 0, 95, 437, 74, 75, 76, - 77, 78, 79, 80, 0, 27, 183, 0, 471, 0, - 439, 440, 28, 0, 443, 444, 29, 448, 0, 449, - 30, 451, 452, 0, 0, 0, 455, 456, 490, 457, - 0, 392, 0, 394, 466, 467, 0, 0, 470, 400, - 0, 0, 0, 474, 475, 477, 0, 0, 480, 0, - 0, 0, 484, 486, 0, 488, 0, 0, 0, 0, - 414, 415, 416, 417, 493, 279, 419, 420, 0, 421, - 0, 422, 423, 424, 425, 426, 305, 427, 270, 271, - 272, 273, 429, 430, 431, 0, 27, 220, 0, 270, - 271, 272, 273, 28, 0, 0, 0, 29, 0, 0, - 0, 30, 0, 274, 0, 275, 276, 277, 278, 459, - 0, 0, 464, 0, 274, 0, 275, 276, 277, 278, - 0, 124, 0, 0, 128, 129, 479, 0, 132, 134, - 483, 144, 0, 487, 0, 0, 0, 489, 311, 0, - 0, 491, 492, 0, 312, 494, 0, 0, 0, 0, - 496, 0, 0, 0, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 341, 334, 0, 0, 0, - 0, 312, 121, 123, 121, 121, 123, 123, 0, 0, - 121, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, - 332, 333, 378, 334, 0, 0, 0, 0, 312, 0, - 49, 50, 51, 52, 53, 54, 55, 56, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 0, - 334, 348, 349, 350, 351, 0, 353, 354, 0, 356, - 0, 358, 359, 360, 361, 362, 0, 364, 0, 370, - 371, 372, 62, 63, 64, 65, 66, 67, 68, 69, - 0, 0, 0, 0, 0, 82, 62, 63, 64, 65, - 66, 67, 68, 69, 0, 0, 0, 0, 0, 104, - 74, 75, 76, 77, 78, 79, 80, 0, 119, 120, - 62, 63, 64, 65, 66, 67, 68, 69, 63, 64, - 65, 66, 67, 68, 69, 64, 65, 66, 67, 68, - 69, 226, 227, 228, 229, 230, 231, 239, 240, 241, - 242, 243, 244 -}; - -static const short int yycheck[] = -{ - 3, 143, 24, 218, 1, 49, 4, 265, 294, 4, - 4, 3, 0, 235, 49, 95, 3, 442, 3, 8, - 9, 3, 3, 3, 279, 232, 96, 24, 6, 7, - 8, 9, 10, 11, 249, 257, 80, 4, 4, 28, - 29, 30, 4, 468, 4, 80, 253, 472, 85, 264, - 305, 4, 338, 4, 95, 43, 80, 60, 95, 31, - 49, 50, 51, 52, 53, 54, 55, 56, 71, 72, - 73, 59, 497, 62, 63, 64, 65, 66, 67, 68, - 69, 48, 95, 50, 82, 80, 3, 82, 48, 375, - 50, 89, 307, 81, 82, 93, 84, 80, 93, 97, - 4, 95, 97, 95, 70, 93, 68, 69, 95, 97, - 95, 5, 95, 95, 95, 95, 80, 95, 12, 13, - 14, 15, 3, 41, 42, 82, 43, 44, 45, 126, - 127, 3, 3, 136, 137, 138, 139, 140, 141, 142, - 97, 3, 145, 115, 48, 148, 50, 41, 42, 80, - 147, 79, 46, 47, 82, 72, 73, 74, 75, 76, - 77, 78, 4, 57, 58, 154, 60, 70, 95, 97, - 51, 52, 53, 54, 55, 56, 4, 149, 150, 90, - 91, 92, 71, 4, 156, 157, 3, 81, 82, 61, - 62, 63, 64, 65, 66, 67, 80, 4, 195, 93, - 172, 173, 460, 97, 16, 80, 48, 465, 50, 467, - 3, 80, 79, 3, 95, 82, 205, 475, 190, 191, - 48, 80, 50, 82, 82, 197, 198, 48, 200, 50, - 97, 203, 204, 4, 93, 93, 208, 209, 97, 97, - 498, 48, 214, 50, 85, 217, 95, 219, 95, 80, - 272, 39, 40, 43, 44, 45, 278, 45, 98, 95, - 72, 73, 74, 75, 76, 77, 78, 270, 95, 80, - 95, 274, 275, 276, 277, 272, 95, 3, 250, 95, - 95, 278, 72, 73, 74, 75, 76, 77, 78, 3, - 80, 81, 95, 296, 95, 267, 51, 52, 53, 54, - 55, 56, 4, 95, 446, 87, 95, 80, 81, 82, - 80, 81, 82, 3, 95, 95, 288, 43, 44, 45, - 93, 434, 238, 93, 97, 215, 3, 97, 300, 43, - 44, 45, 245, 330, 334, -1, -1, 334, -1, -1, - 95, 81, 82, 346, -1, -1, 72, 73, 74, 75, - 76, 77, 78, 93, 80, 81, -1, 97, 72, 73, - 74, 75, 76, 77, 78, 368, 43, 44, 45, 82, - 373, -1, -1, 3, -1, -1, 89, -1, 3, -1, - 93, -1, -1, -1, 97, -1, 16, 17, 18, 19, - 88, 89, 90, 91, 92, 72, 73, 74, 75, 76, - 77, 78, -1, -1, -1, 377, -1, -1, -1, 412, - 382, 41, -1, 43, 44, 45, 46, 389, 43, 44, - 45, 80, -1, 82, -1, 428, -1, -1, -1, -1, - 89, -1, -1, 36, 93, -1, -1, 409, 97, 411, - 43, 44, 445, 46, -1, 48, 418, 72, 73, 74, - 75, 76, 77, 78, -1, 82, 83, -1, 461, -1, - 432, 433, 89, -1, 436, 437, 93, 439, -1, 441, - 97, 443, 444, -1, -1, -1, 448, 449, 481, 451, - -1, 355, -1, 357, 456, 457, -1, -1, 460, 363, - -1, -1, -1, 465, 466, 467, -1, -1, 470, -1, - -1, -1, 474, 475, -1, 477, -1, -1, -1, -1, - 384, 385, 386, 387, 486, 3, 390, 391, -1, 393, - -1, 395, 396, 397, 398, 399, 3, 401, 16, 17, - 18, 19, 406, 407, 408, -1, 82, 83, -1, 16, - 17, 18, 19, 89, -1, -1, -1, 93, -1, -1, - -1, 97, -1, 41, -1, 43, 44, 45, 46, 452, - -1, -1, 455, -1, 41, -1, 43, 44, 45, 46, - -1, 85, -1, -1, 88, 89, 469, -1, 92, 93, - 473, 95, -1, 476, -1, -1, -1, 480, 4, -1, - -1, 484, 485, -1, 10, 488, -1, -1, -1, -1, - 493, -1, -1, -1, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 4, 42, -1, -1, -1, - -1, 10, 84, 85, 86, 87, 88, 89, -1, -1, - 92, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 4, 42, -1, -1, -1, -1, 10, -1, - 85, 86, 87, 88, 89, 90, 91, 92, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, -1, - 42, 313, 314, 315, 316, -1, 318, 319, -1, 321, - -1, 323, 324, 325, 326, 327, -1, 329, -1, 331, - 332, 333, 85, 86, 87, 88, 89, 90, 91, 92, - -1, -1, -1, -1, -1, 98, 85, 86, 87, 88, - 89, 90, 91, 92, -1, -1, -1, -1, -1, 98, - 72, 73, 74, 75, 76, 77, 78, -1, 80, 81, - 85, 86, 87, 88, 89, 90, 91, 92, 86, 87, - 88, 89, 90, 91, 92, 87, 88, 89, 90, 91, - 92, 6, 7, 8, 9, 10, 11, 51, 52, 53, - 54, 55, 56 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const unsigned char yystos[] = -{ - 0, 100, 0, 43, 59, 81, 82, 84, 93, 97, - 101, 107, 108, 109, 147, 148, 149, 150, 155, 158, - 159, 164, 167, 168, 173, 188, 189, 82, 89, 93, - 97, 185, 186, 176, 186, 186, 5, 12, 13, 14, - 15, 41, 42, 46, 47, 57, 58, 60, 173, 85, - 86, 87, 88, 89, 90, 91, 92, 186, 186, 186, - 95, 184, 85, 86, 87, 88, 89, 90, 91, 92, - 3, 43, 44, 45, 72, 73, 74, 75, 76, 77, - 78, 179, 98, 176, 178, 177, 178, 178, 177, 177, - 176, 176, 178, 176, 169, 176, 186, 186, 186, 186, - 186, 186, 186, 186, 98, 185, 186, 186, 186, 186, - 186, 186, 186, 186, 165, 185, 185, 185, 3, 80, - 81, 179, 180, 179, 180, 16, 113, 113, 180, 180, - 3, 3, 180, 3, 180, 3, 61, 62, 63, 64, - 65, 66, 67, 3, 180, 166, 184, 102, 96, 188, - 188, 151, 156, 160, 161, 170, 185, 185, 185, 185, - 185, 185, 185, 160, 4, 185, 4, 80, 103, 104, - 188, 185, 184, 184, 4, 48, 50, 152, 4, 48, - 50, 157, 4, 83, 162, 163, 186, 4, 68, 69, - 184, 184, 4, 80, 95, 95, 187, 184, 184, 49, - 80, 80, 49, 80, 80, 95, 3, 3, 184, 184, - 80, 188, 95, 184, 184, 184, 153, 184, 3, 184, - 83, 186, 71, 70, 184, 184, 6, 7, 8, 9, - 10, 11, 105, 106, 110, 111, 184, 153, 3, 51, - 52, 53, 54, 55, 56, 95, 154, 184, 156, 3, - 184, 3, 80, 95, 106, 114, 114, 112, 151, 154, - 183, 184, 4, 156, 3, 184, 171, 172, 106, 3, - 16, 17, 18, 19, 41, 43, 44, 45, 46, 3, - 114, 4, 4, 156, 183, 4, 70, 4, 184, 115, - 185, 80, 80, 173, 79, 82, 97, 181, 182, 185, - 185, 185, 185, 173, 115, 3, 4, 3, 4, 80, - 184, 4, 10, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 42, 116, 182, 185, 85, 95, - 184, 4, 115, 156, 95, 80, 139, 188, 139, 139, - 139, 139, 122, 139, 139, 125, 139, 129, 139, 139, - 139, 139, 139, 135, 139, 80, 81, 174, 175, 188, - 139, 139, 139, 175, 98, 79, 182, 80, 4, 4, - 80, 95, 185, 95, 117, 118, 119, 121, 138, 185, - 123, 124, 138, 126, 138, 130, 131, 132, 133, 134, - 138, 136, 95, 95, 185, 95, 120, 127, 128, 185, - 182, 184, 95, 184, 138, 138, 138, 138, 184, 138, - 138, 138, 138, 138, 138, 138, 138, 138, 95, 138, - 138, 138, 184, 184, 80, 95, 141, 184, 185, 184, - 184, 141, 142, 184, 184, 95, 3, 140, 184, 184, - 181, 184, 184, 185, 160, 184, 184, 184, 95, 140, - 145, 95, 4, 95, 140, 143, 184, 184, 146, 183, - 184, 185, 144, 183, 184, 184, 183, 184, 181, 140, - 184, 95, 181, 140, 184, 183, 184, 140, 184, 140, - 185, 140, 140, 184, 140, 95, 140, 137, 181, 183 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (0) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_stack_print (short int *bottom, short int *top) -#else -static void -yy_stack_print (bottom, top) - short int *bottom; - short int *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_reduce_print (int yyrule) -#else -static void -yy_reduce_print (yyrule) - int yyrule; -#endif -{ - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; -} -# endif -# endif - -# ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - size_t yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -#endif /* YYERROR_VERBOSE */ - - - -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - switch (yytype) - { - default: - break; - } - YYFPRINTF (yyoutput, ")"); -} - -#endif /* ! YYDEBUG */ -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM); -# else -int yyparse (); -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int -yyparse (void) -#else -int -yyparse () - ; -#endif -#endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short int yyssa[YYINITDEPTH]; - short int *yyss = yyssa; - short int *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK (yyvsp--, yyssp--) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short int *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - short int *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a look-ahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to look-ahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; - - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 18: -#line 184 "rcparse.y" - { - define_accelerator ((yyvsp[-5].id), &(yyvsp[-3].res_info), (yyvsp[-1].pacc)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 19: -#line 194 "rcparse.y" - { - (yyval.pacc) = NULL; - } - break; - - case 20: -#line 198 "rcparse.y" - { - struct accelerator *a; - - a = (struct accelerator *) res_alloc (sizeof *a); - *a = (yyvsp[0].acc); - if ((yyvsp[-1].pacc) == NULL) - (yyval.pacc) = a; - else - { - struct accelerator **pp; - - for (pp = &(yyvsp[-1].pacc)->next; *pp != NULL; pp = &(*pp)->next) - ; - *pp = a; - (yyval.pacc) = (yyvsp[-1].pacc); - } - } - break; - - case 21: -#line 219 "rcparse.y" - { - (yyval.acc) = (yyvsp[-1].acc); - (yyval.acc).id = (yyvsp[0].il); - } - break; - - case 22: -#line 224 "rcparse.y" - { - (yyval.acc) = (yyvsp[-3].acc); - (yyval.acc).id = (yyvsp[-2].il); - (yyval.acc).flags |= (yyvsp[0].is); - if (((yyval.acc).flags & ACC_VIRTKEY) == 0 - && ((yyval.acc).flags & (ACC_SHIFT | ACC_CONTROL)) != 0) - rcparse_warning (_("inappropriate modifiers for non-VIRTKEY")); - } - break; - - case 23: -#line 236 "rcparse.y" - { - const char *s = (yyvsp[0].s); - char ch; - - (yyval.acc).next = NULL; - (yyval.acc).id = 0; - ch = *s; - if (ch != '^') - (yyval.acc).flags = 0; - else - { - (yyval.acc).flags = ACC_CONTROL | ACC_VIRTKEY; - ++s; - ch = *s; - ch = TOUPPER (ch); - } - (yyval.acc).key = ch; - if (s[1] != '\0') - rcparse_warning (_("accelerator should only be one character")); - } - break; - - case 24: -#line 257 "rcparse.y" - { - (yyval.acc).next = NULL; - (yyval.acc).flags = 0; - (yyval.acc).id = 0; - (yyval.acc).key = (yyvsp[0].il); - } - break; - - case 25: -#line 267 "rcparse.y" - { - (yyval.is) = (yyvsp[0].is); - } - break; - - case 26: -#line 271 "rcparse.y" - { - (yyval.is) = (yyvsp[-2].is) | (yyvsp[0].is); - } - break; - - case 27: -#line 276 "rcparse.y" - { - (yyval.is) = (yyvsp[-1].is) | (yyvsp[0].is); - } - break; - - case 28: -#line 283 "rcparse.y" - { - (yyval.is) = ACC_VIRTKEY; - } - break; - - case 29: -#line 287 "rcparse.y" - { - /* This is just the absence of VIRTKEY. */ - (yyval.is) = 0; - } - break; - - case 30: -#line 292 "rcparse.y" - { - (yyval.is) = ACC_NOINVERT; - } - break; - - case 31: -#line 296 "rcparse.y" - { - (yyval.is) = ACC_SHIFT; - } - break; - - case 32: -#line 300 "rcparse.y" - { - (yyval.is) = ACC_CONTROL; - } - break; - - case 33: -#line 304 "rcparse.y" - { - (yyval.is) = ACC_ALT; - } - break; - - case 34: -#line 313 "rcparse.y" - { - define_bitmap ((yyvsp[-3].id), &(yyvsp[-1].res_info), (yyvsp[0].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 35: -#line 325 "rcparse.y" - { - define_cursor ((yyvsp[-3].id), &(yyvsp[-1].res_info), (yyvsp[0].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 36: -#line 338 "rcparse.y" - { - memset (&dialog, 0, sizeof dialog); - dialog.x = (yyvsp[-3].il); - dialog.y = (yyvsp[-2].il); - dialog.width = (yyvsp[-1].il); - dialog.height = (yyvsp[0].il); - dialog.style = WS_POPUP | WS_BORDER | WS_SYSMENU; - dialog.exstyle = (yyvsp[-4].il); - dialog.menu.named = 1; - dialog.class.named = 1; - dialog.font = NULL; - dialog.ex = NULL; - dialog.controls = NULL; - sub_res_info = (yyvsp[-5].res_info); - style = 0; - } - break; - - case 37: -#line 355 "rcparse.y" - { - define_dialog ((yyvsp[-12].id), &sub_res_info, &dialog); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 38: -#line 363 "rcparse.y" - { - memset (&dialog, 0, sizeof dialog); - dialog.x = (yyvsp[-3].il); - dialog.y = (yyvsp[-2].il); - dialog.width = (yyvsp[-1].il); - dialog.height = (yyvsp[0].il); - dialog.style = WS_POPUP | WS_BORDER | WS_SYSMENU; - dialog.exstyle = (yyvsp[-4].il); - dialog.menu.named = 1; - dialog.class.named = 1; - dialog.font = NULL; - dialog.ex = ((struct dialog_ex *) - res_alloc (sizeof (struct dialog_ex))); - memset (dialog.ex, 0, sizeof (struct dialog_ex)); - dialog.controls = NULL; - sub_res_info = (yyvsp[-5].res_info); - style = 0; - } - break; - - case 39: -#line 382 "rcparse.y" - { - define_dialog ((yyvsp[-12].id), &sub_res_info, &dialog); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 40: -#line 390 "rcparse.y" - { - memset (&dialog, 0, sizeof dialog); - dialog.x = (yyvsp[-4].il); - dialog.y = (yyvsp[-3].il); - dialog.width = (yyvsp[-2].il); - dialog.height = (yyvsp[-1].il); - dialog.style = WS_POPUP | WS_BORDER | WS_SYSMENU; - dialog.exstyle = (yyvsp[-5].il); - dialog.menu.named = 1; - dialog.class.named = 1; - dialog.font = NULL; - dialog.ex = ((struct dialog_ex *) - res_alloc (sizeof (struct dialog_ex))); - memset (dialog.ex, 0, sizeof (struct dialog_ex)); - dialog.ex->help = (yyvsp[0].il); - dialog.controls = NULL; - sub_res_info = (yyvsp[-6].res_info); - style = 0; - } - break; - - case 41: -#line 410 "rcparse.y" - { - define_dialog ((yyvsp[-13].id), &sub_res_info, &dialog); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 42: -#line 420 "rcparse.y" - { - (yyval.il) = 0; - } - break; - - case 43: -#line 424 "rcparse.y" - { - (yyval.il) = (yyvsp[0].il); - } - break; - - case 45: -#line 432 "rcparse.y" - { - dialog.style |= WS_CAPTION; - style |= WS_CAPTION; - unicode_from_ascii ((int *) NULL, &dialog.caption, (yyvsp[0].s)); - } - break; - - case 46: -#line 438 "rcparse.y" - { - dialog.class = (yyvsp[0].id); - } - break; - - case 47: -#line 443 "rcparse.y" - { - dialog.style = style; - } - break; - - case 48: -#line 447 "rcparse.y" - { - dialog.exstyle = (yyvsp[0].il); - } - break; - - case 49: -#line 451 "rcparse.y" - { - res_string_to_id (& dialog.class, (yyvsp[0].s)); - } - break; - - case 50: -#line 455 "rcparse.y" - { - dialog.style |= DS_SETFONT; - style |= DS_SETFONT; - dialog.pointsize = (yyvsp[-2].il); - unicode_from_ascii ((int *) NULL, &dialog.font, (yyvsp[0].s)); - if (dialog.ex != NULL) - { - dialog.ex->weight = 0; - dialog.ex->italic = 0; - dialog.ex->charset = 1; - } - } - break; - - case 51: -#line 468 "rcparse.y" - { - dialog.style |= DS_SETFONT; - style |= DS_SETFONT; - dialog.pointsize = (yyvsp[-3].il); - unicode_from_ascii ((int *) NULL, &dialog.font, (yyvsp[-1].s)); - if (dialog.ex == NULL) - rcparse_warning (_("extended FONT requires DIALOGEX")); - else - { - dialog.ex->weight = (yyvsp[0].il); - dialog.ex->italic = 0; - dialog.ex->charset = 1; - } - } - break; - - case 52: -#line 483 "rcparse.y" - { - dialog.style |= DS_SETFONT; - style |= DS_SETFONT; - dialog.pointsize = (yyvsp[-4].il); - unicode_from_ascii ((int *) NULL, &dialog.font, (yyvsp[-2].s)); - if (dialog.ex == NULL) - rcparse_warning (_("extended FONT requires DIALOGEX")); - else - { - dialog.ex->weight = (yyvsp[-1].il); - dialog.ex->italic = (yyvsp[0].il); - dialog.ex->charset = 1; - } - } - break; - - case 53: -#line 498 "rcparse.y" - { - dialog.style |= DS_SETFONT; - style |= DS_SETFONT; - dialog.pointsize = (yyvsp[-5].il); - unicode_from_ascii ((int *) NULL, &dialog.font, (yyvsp[-3].s)); - if (dialog.ex == NULL) - rcparse_warning (_("extended FONT requires DIALOGEX")); - else - { - dialog.ex->weight = (yyvsp[-2].il); - dialog.ex->italic = (yyvsp[-1].il); - dialog.ex->charset = (yyvsp[0].il); - } - } - break; - - case 54: -#line 513 "rcparse.y" - { - dialog.menu = (yyvsp[0].id); - } - break; - - case 55: -#line 517 "rcparse.y" - { - sub_res_info.characteristics = (yyvsp[0].il); - } - break; - - case 56: -#line 521 "rcparse.y" - { - sub_res_info.language = (yyvsp[-1].il) | ((yyvsp[0].il) << SUBLANG_SHIFT); - } - break; - - case 57: -#line 525 "rcparse.y" - { - sub_res_info.version = (yyvsp[0].il); - } - break; - - case 59: -#line 533 "rcparse.y" - { - struct dialog_control **pp; - - for (pp = &dialog.controls; *pp != NULL; pp = &(*pp)->next) - ; - *pp = (yyvsp[0].dialog_control); - } - break; - - case 60: -#line 544 "rcparse.y" - { - default_style = BS_AUTO3STATE | WS_TABSTOP; - base_style = BS_AUTO3STATE; - class = CTL_BUTTON; - res_text_field = (yyvsp[0].id); - } - break; - - case 61: -#line 551 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 62: -#line 555 "rcparse.y" - { - default_style = BS_AUTOCHECKBOX | WS_TABSTOP; - base_style = BS_AUTOCHECKBOX; - class = CTL_BUTTON; - res_text_field = (yyvsp[0].id); - } - break; - - case 63: -#line 562 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 64: -#line 566 "rcparse.y" - { - default_style = BS_AUTORADIOBUTTON | WS_TABSTOP; - base_style = BS_AUTORADIOBUTTON; - class = CTL_BUTTON; - res_text_field = (yyvsp[0].id); - } - break; - - case 65: -#line 573 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 66: -#line 577 "rcparse.y" - { - default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - class = CTL_EDIT; - res_text_field = (yyvsp[0].id); - } - break; - - case 67: -#line 584 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - if (dialog.ex == NULL) - rcparse_warning (_("BEDIT requires DIALOGEX")); - res_string_to_id (&(yyval.dialog_control)->class, "BEDIT"); - } - break; - - case 68: -#line 591 "rcparse.y" - { - default_style = BS_CHECKBOX | WS_TABSTOP; - base_style = BS_CHECKBOX | WS_TABSTOP; - class = CTL_BUTTON; - res_text_field = (yyvsp[0].id); - } - break; - - case 69: -#line 598 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 70: -#line 602 "rcparse.y" - { - /* This is as per MSDN documentation. With some (???) - versions of MS rc.exe their is no default style. */ - default_style = CBS_SIMPLE | WS_TABSTOP; - base_style = 0; - class = CTL_COMBOBOX; - res_text_field = res_null_text; - } - break; - - case 71: -#line 611 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 72: -#line 616 "rcparse.y" - { - (yyval.dialog_control) = define_control ((yyvsp[-9].id), (yyvsp[-8].il), (yyvsp[-5].il), (yyvsp[-4].il), (yyvsp[-3].il), (yyvsp[-2].il), (yyvsp[-7].il), style, (yyvsp[-1].il)); - if ((yyvsp[0].rcdata_item) != NULL) - { - if (dialog.ex == NULL) - rcparse_warning (_("control data requires DIALOGEX")); - (yyval.dialog_control)->data = (yyvsp[0].rcdata_item); - } - } - break; - - case 73: -#line 627 "rcparse.y" - { - (yyval.dialog_control) = define_control ((yyvsp[-10].id), (yyvsp[-9].il), (yyvsp[-6].il), (yyvsp[-5].il), (yyvsp[-4].il), (yyvsp[-3].il), (yyvsp[-8].il), style, (yyvsp[-2].il)); - if (dialog.ex == NULL) - rcparse_warning (_("help ID requires DIALOGEX")); - (yyval.dialog_control)->help = (yyvsp[-1].il); - (yyval.dialog_control)->data = (yyvsp[0].rcdata_item); - } - break; - - case 74: -#line 636 "rcparse.y" - { - (yyval.dialog_control) = define_control ((yyvsp[-10].id), (yyvsp[-9].il), (yyvsp[-5].il), (yyvsp[-4].il), (yyvsp[-3].il), (yyvsp[-2].il), 0, style, (yyvsp[-1].il)); - if ((yyvsp[0].rcdata_item) != NULL) - { - if (dialog.ex == NULL) - rcparse_warning ("control data requires DIALOGEX"); - (yyval.dialog_control)->data = (yyvsp[0].rcdata_item); - } - (yyval.dialog_control)->class.named = 1; - unicode_from_ascii (&(yyval.dialog_control)->class.u.n.length, &(yyval.dialog_control)->class.u.n.name, (yyvsp[-7].s)); - } - break; - - case 75: -#line 649 "rcparse.y" - { - (yyval.dialog_control) = define_control ((yyvsp[-11].id), (yyvsp[-10].il), (yyvsp[-6].il), (yyvsp[-5].il), (yyvsp[-4].il), (yyvsp[-3].il), 0, style, (yyvsp[-2].il)); - if (dialog.ex == NULL) - rcparse_warning ("help ID requires DIALOGEX"); - (yyval.dialog_control)->help = (yyvsp[-1].il); - (yyval.dialog_control)->data = (yyvsp[0].rcdata_item); - (yyval.dialog_control)->class.named = 1; - unicode_from_ascii (&(yyval.dialog_control)->class.u.n.length, &(yyval.dialog_control)->class.u.n.name, (yyvsp[-8].s)); - } - break; - - case 76: -#line 659 "rcparse.y" - { - default_style = SS_CENTER | WS_GROUP; - base_style = SS_CENTER; - class = CTL_STATIC; - res_text_field = (yyvsp[0].id); - } - break; - - case 77: -#line 666 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 78: -#line 670 "rcparse.y" - { - default_style = BS_DEFPUSHBUTTON | WS_TABSTOP; - base_style = BS_DEFPUSHBUTTON | WS_TABSTOP; - class = CTL_BUTTON; - res_text_field = (yyvsp[0].id); - } - break; - - case 79: -#line 677 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 80: -#line 681 "rcparse.y" - { - default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - class = CTL_EDIT; - res_text_field = res_null_text; - } - break; - - case 81: -#line 688 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 82: -#line 692 "rcparse.y" - { - default_style = BS_GROUPBOX; - base_style = BS_GROUPBOX; - class = CTL_BUTTON; - res_text_field = (yyvsp[0].id); - } - break; - - case 83: -#line 699 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 84: -#line 703 "rcparse.y" - { - default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - class = CTL_EDIT; - res_text_field = (yyvsp[0].id); - } - break; - - case 85: -#line 710 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - if (dialog.ex == NULL) - rcparse_warning (_("IEDIT requires DIALOGEX")); - res_string_to_id (&(yyval.dialog_control)->class, "HEDIT"); - } - break; - - case 86: -#line 717 "rcparse.y" - { - (yyval.dialog_control) = define_icon_control ((yyvsp[-4].id), (yyvsp[-3].il), (yyvsp[-2].il), (yyvsp[-1].il), 0, 0, 0, (yyvsp[0].rcdata_item), - dialog.ex); - } - break; - - case 87: -#line 723 "rcparse.y" - { - (yyval.dialog_control) = define_icon_control ((yyvsp[-6].id), (yyvsp[-5].il), (yyvsp[-4].il), (yyvsp[-3].il), 0, 0, 0, (yyvsp[0].rcdata_item), - dialog.ex); - } - break; - - case 88: -#line 729 "rcparse.y" - { - (yyval.dialog_control) = define_icon_control ((yyvsp[-8].id), (yyvsp[-7].il), (yyvsp[-6].il), (yyvsp[-5].il), style, (yyvsp[-1].il), 0, (yyvsp[0].rcdata_item), - dialog.ex); - } - break; - - case 89: -#line 735 "rcparse.y" - { - (yyval.dialog_control) = define_icon_control ((yyvsp[-9].id), (yyvsp[-8].il), (yyvsp[-7].il), (yyvsp[-6].il), style, (yyvsp[-2].il), (yyvsp[-1].il), (yyvsp[0].rcdata_item), - dialog.ex); - } - break; - - case 90: -#line 740 "rcparse.y" - { - default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - class = CTL_EDIT; - res_text_field = (yyvsp[0].id); - } - break; - - case 91: -#line 747 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - if (dialog.ex == NULL) - rcparse_warning (_("IEDIT requires DIALOGEX")); - res_string_to_id (&(yyval.dialog_control)->class, "IEDIT"); - } - break; - - case 92: -#line 754 "rcparse.y" - { - default_style = LBS_NOTIFY | WS_BORDER; - base_style = LBS_NOTIFY | WS_BORDER; - class = CTL_LISTBOX; - res_text_field = res_null_text; - } - break; - - case 93: -#line 761 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 94: -#line 765 "rcparse.y" - { - default_style = SS_LEFT | WS_GROUP; - base_style = SS_LEFT; - class = CTL_STATIC; - res_text_field = (yyvsp[0].id); - } - break; - - case 95: -#line 772 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 96: -#line 776 "rcparse.y" - { - default_style = BS_PUSHBOX | WS_TABSTOP; - base_style = BS_PUSHBOX; - class = CTL_BUTTON; - } - break; - - case 97: -#line 782 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 98: -#line 786 "rcparse.y" - { - default_style = BS_PUSHBUTTON | WS_TABSTOP; - base_style = BS_PUSHBUTTON | WS_TABSTOP; - class = CTL_BUTTON; - res_text_field = (yyvsp[0].id); - } - break; - - case 99: -#line 793 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 100: -#line 797 "rcparse.y" - { - default_style = BS_RADIOBUTTON | WS_TABSTOP; - base_style = BS_RADIOBUTTON; - class = CTL_BUTTON; - res_text_field = (yyvsp[0].id); - } - break; - - case 101: -#line 804 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 102: -#line 808 "rcparse.y" - { - default_style = SS_RIGHT | WS_GROUP; - base_style = SS_RIGHT; - class = CTL_STATIC; - res_text_field = (yyvsp[0].id); - } - break; - - case 103: -#line 815 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 104: -#line 819 "rcparse.y" - { - default_style = SBS_HORZ; - base_style = 0; - class = CTL_SCROLLBAR; - res_text_field = res_null_text; - } - break; - - case 105: -#line 826 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 106: -#line 830 "rcparse.y" - { - default_style = BS_3STATE | WS_TABSTOP; - base_style = BS_3STATE; - class = CTL_BUTTON; - res_text_field = (yyvsp[0].id); - } - break; - - case 107: -#line 837 "rcparse.y" - { - (yyval.dialog_control) = (yyvsp[0].dialog_control); - } - break; - - case 108: -#line 842 "rcparse.y" - { style = WS_CHILD | WS_VISIBLE; } - break; - - case 109: -#line 844 "rcparse.y" - { - (yyval.dialog_control) = define_control ((yyvsp[-13].id), (yyvsp[-12].il), (yyvsp[-10].il), (yyvsp[-8].il), (yyvsp[-6].il), (yyvsp[-4].il), CTL_BUTTON, - style, (yyvsp[0].il)); - } - break; - - case 110: -#line 859 "rcparse.y" - { - (yyval.dialog_control) = define_control (res_text_field, (yyvsp[-5].il), (yyvsp[-4].il), (yyvsp[-3].il), (yyvsp[-2].il), (yyvsp[-1].il), class, - default_style | WS_CHILD | WS_VISIBLE, 0); - if ((yyvsp[0].rcdata_item) != NULL) - { - if (dialog.ex == NULL) - rcparse_warning (_("control data requires DIALOGEX")); - (yyval.dialog_control)->data = (yyvsp[0].rcdata_item); - } - } - break; - - case 111: -#line 871 "rcparse.y" - { - (yyval.dialog_control) = define_control (res_text_field, (yyvsp[-7].il), (yyvsp[-6].il), (yyvsp[-5].il), (yyvsp[-4].il), (yyvsp[-3].il), class, style, (yyvsp[-1].il)); - if ((yyvsp[0].rcdata_item) != NULL) - { - if (dialog.ex == NULL) - rcparse_warning (_("control data requires DIALOGEX")); - (yyval.dialog_control)->data = (yyvsp[0].rcdata_item); - } - } - break; - - case 112: -#line 882 "rcparse.y" - { - (yyval.dialog_control) = define_control (res_text_field, (yyvsp[-8].il), (yyvsp[-7].il), (yyvsp[-6].il), (yyvsp[-5].il), (yyvsp[-4].il), class, style, (yyvsp[-2].il)); - if (dialog.ex == NULL) - rcparse_warning (_("help ID requires DIALOGEX")); - (yyval.dialog_control)->help = (yyvsp[-1].il); - (yyval.dialog_control)->data = (yyvsp[0].rcdata_item); - } - break; - - case 113: -#line 893 "rcparse.y" - { - res_string_to_id (&(yyval.id), ""); - } - break; - - case 114: -#line 897 "rcparse.y" - { - (yyval.id).named = 0; - (yyval.id).u.id = (yyvsp[-1].il); - } - break; - - case 115: -#line 902 "rcparse.y" - { - res_string_to_id (&(yyval.id), (yyvsp[0].s)); - } - break; - - case 116: -#line 906 "rcparse.y" - { - res_string_to_id (&(yyval.id), (yyvsp[-1].s)); - } - break; - - case 117: -#line 913 "rcparse.y" - { - (yyval.rcdata_item) = NULL; - } - break; - - case 118: -#line 917 "rcparse.y" - { - (yyval.rcdata_item) = (yyvsp[-1].rcdata).first; - } - break; - - case 119: -#line 926 "rcparse.y" - { style = WS_CHILD | WS_VISIBLE; } - break; - - case 121: -#line 932 "rcparse.y" - { style = SS_ICON | WS_CHILD | WS_VISIBLE; } - break; - - case 123: -#line 938 "rcparse.y" - { style = base_style | WS_CHILD | WS_VISIBLE; } - break; - - case 125: -#line 946 "rcparse.y" - { - define_font ((yyvsp[-3].id), &(yyvsp[-1].res_info), (yyvsp[0].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 126: -#line 958 "rcparse.y" - { - define_icon ((yyvsp[-3].id), &(yyvsp[-1].res_info), (yyvsp[0].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 127: -#line 971 "rcparse.y" - { - language = (yyvsp[-1].il) | ((yyvsp[0].il) << SUBLANG_SHIFT); - } - break; - - case 128: -#line 980 "rcparse.y" - { - define_menu ((yyvsp[-5].id), &(yyvsp[-3].res_info), (yyvsp[-1].menuitem)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 129: -#line 990 "rcparse.y" - { - (yyval.menuitem) = NULL; - } - break; - - case 130: -#line 994 "rcparse.y" - { - if ((yyvsp[-1].menuitem) == NULL) - (yyval.menuitem) = (yyvsp[0].menuitem); - else - { - struct menuitem **pp; - - for (pp = &(yyvsp[-1].menuitem)->next; *pp != NULL; pp = &(*pp)->next) - ; - *pp = (yyvsp[0].menuitem); - (yyval.menuitem) = (yyvsp[-1].menuitem); - } - } - break; - - case 131: -#line 1011 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[-2].s), (yyvsp[-1].il), (yyvsp[0].is), 0, 0, NULL); - } - break; - - case 132: -#line 1015 "rcparse.y" - { - (yyval.menuitem) = define_menuitem (NULL, 0, 0, 0, 0, NULL); - } - break; - - case 133: -#line 1019 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[-4].s), 0, (yyvsp[-3].is), 0, 0, (yyvsp[-1].menuitem)); - } - break; - - case 134: -#line 1026 "rcparse.y" - { - (yyval.is) = 0; - } - break; - - case 135: -#line 1030 "rcparse.y" - { - (yyval.is) = (yyvsp[-2].is) | (yyvsp[0].is); - } - break; - - case 136: -#line 1034 "rcparse.y" - { - (yyval.is) = (yyvsp[-1].is) | (yyvsp[0].is); - } - break; - - case 137: -#line 1041 "rcparse.y" - { - (yyval.is) = MENUITEM_CHECKED; - } - break; - - case 138: -#line 1045 "rcparse.y" - { - (yyval.is) = MENUITEM_GRAYED; - } - break; - - case 139: -#line 1049 "rcparse.y" - { - (yyval.is) = MENUITEM_HELP; - } - break; - - case 140: -#line 1053 "rcparse.y" - { - (yyval.is) = MENUITEM_INACTIVE; - } - break; - - case 141: -#line 1057 "rcparse.y" - { - (yyval.is) = MENUITEM_MENUBARBREAK; - } - break; - - case 142: -#line 1061 "rcparse.y" - { - (yyval.is) = MENUITEM_MENUBREAK; - } - break; - - case 143: -#line 1070 "rcparse.y" - { - define_menu ((yyvsp[-5].id), &(yyvsp[-3].res_info), (yyvsp[-1].menuitem)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 144: -#line 1080 "rcparse.y" - { - (yyval.menuitem) = NULL; - } - break; - - case 145: -#line 1084 "rcparse.y" - { - if ((yyvsp[-1].menuitem) == NULL) - (yyval.menuitem) = (yyvsp[0].menuitem); - else - { - struct menuitem **pp; - - for (pp = &(yyvsp[-1].menuitem)->next; *pp != NULL; pp = &(*pp)->next) - ; - *pp = (yyvsp[0].menuitem); - (yyval.menuitem) = (yyvsp[-1].menuitem); - } - } - break; - - case 146: -#line 1101 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[0].s), 0, 0, 0, 0, NULL); - } - break; - - case 147: -#line 1105 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[-1].s), (yyvsp[0].il), 0, 0, 0, NULL); - } - break; - - case 148: -#line 1109 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[-3].s), (yyvsp[-2].il), (yyvsp[-1].il), (yyvsp[0].il), 0, NULL); - } - break; - - case 149: -#line 1113 "rcparse.y" - { - (yyval.menuitem) = define_menuitem (NULL, 0, 0, 0, 0, NULL); - } - break; - - case 150: -#line 1117 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[-3].s), 0, 0, 0, 0, (yyvsp[-1].menuitem)); - } - break; - - case 151: -#line 1121 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[-4].s), (yyvsp[-3].il), 0, 0, 0, (yyvsp[-1].menuitem)); - } - break; - - case 152: -#line 1125 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[-5].s), (yyvsp[-4].il), (yyvsp[-3].il), 0, 0, (yyvsp[-1].menuitem)); - } - break; - - case 153: -#line 1130 "rcparse.y" - { - (yyval.menuitem) = define_menuitem ((yyvsp[-7].s), (yyvsp[-6].il), (yyvsp[-5].il), (yyvsp[-4].il), (yyvsp[-3].il), (yyvsp[-1].menuitem)); - } - break; - - case 154: -#line 1139 "rcparse.y" - { - define_messagetable ((yyvsp[-3].id), &(yyvsp[-1].res_info), (yyvsp[0].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 155: -#line 1151 "rcparse.y" - { - define_rcdata ((yyvsp[-5].id), &(yyvsp[-3].res_info), (yyvsp[-1].rcdata).first); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 156: -#line 1158 "rcparse.y" - { - define_rcdata_file ((yyvsp[-3].id), &(yyvsp[-1].res_info), (yyvsp[0].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 157: -#line 1170 "rcparse.y" - { - rcparse_rcdata (); - } - break; - - case 158: -#line 1174 "rcparse.y" - { - rcparse_normal (); - (yyval.rcdata) = (yyvsp[0].rcdata); - } - break; - - case 159: -#line 1182 "rcparse.y" - { - (yyval.rcdata).first = NULL; - (yyval.rcdata).last = NULL; - } - break; - - case 160: -#line 1187 "rcparse.y" - { - (yyval.rcdata) = (yyvsp[0].rcdata); - } - break; - - case 161: -#line 1194 "rcparse.y" - { - struct rcdata_item *ri; - - ri = define_rcdata_string ((yyvsp[0].ss).s, (yyvsp[0].ss).length); - (yyval.rcdata).first = ri; - (yyval.rcdata).last = ri; - } - break; - - case 162: -#line 1202 "rcparse.y" - { - struct rcdata_item *ri; - - ri = define_rcdata_number ((yyvsp[0].i).val, (yyvsp[0].i).dword); - (yyval.rcdata).first = ri; - (yyval.rcdata).last = ri; - } - break; - - case 163: -#line 1210 "rcparse.y" - { - struct rcdata_item *ri; - - ri = define_rcdata_string ((yyvsp[0].ss).s, (yyvsp[0].ss).length); - (yyval.rcdata).first = (yyvsp[-2].rcdata).first; - (yyvsp[-2].rcdata).last->next = ri; - (yyval.rcdata).last = ri; - } - break; - - case 164: -#line 1219 "rcparse.y" - { - struct rcdata_item *ri; - - ri = define_rcdata_number ((yyvsp[0].i).val, (yyvsp[0].i).dword); - (yyval.rcdata).first = (yyvsp[-2].rcdata).first; - (yyvsp[-2].rcdata).last->next = ri; - (yyval.rcdata).last = ri; - } - break; - - case 165: -#line 1233 "rcparse.y" - { sub_res_info = (yyvsp[-1].res_info); } - break; - - case 168: -#line 1240 "rcparse.y" - { - define_stringtable (&sub_res_info, (yyvsp[-1].il), (yyvsp[0].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 169: -#line 1247 "rcparse.y" - { - define_stringtable (&sub_res_info, (yyvsp[-2].il), (yyvsp[0].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 170: -#line 1260 "rcparse.y" - { - define_user_data ((yyvsp[-5].id), (yyvsp[-4].id), &(yyvsp[-3].res_info), (yyvsp[-1].rcdata).first); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 171: -#line 1267 "rcparse.y" - { - define_user_file ((yyvsp[-3].id), (yyvsp[-2].id), &(yyvsp[-1].res_info), (yyvsp[0].s)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 172: -#line 1279 "rcparse.y" - { - define_versioninfo ((yyvsp[-5].id), language, (yyvsp[-3].fixver), (yyvsp[-1].verinfo)); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - break; - - case 173: -#line 1289 "rcparse.y" - { - (yyval.fixver) = ((struct fixed_versioninfo *) - res_alloc (sizeof (struct fixed_versioninfo))); - memset ((yyval.fixver), 0, sizeof (struct fixed_versioninfo)); - } - break; - - case 174: -#line 1295 "rcparse.y" - { - (yyvsp[-5].fixver)->file_version_ms = ((yyvsp[-3].il) << 16) | (yyvsp[-2].il); - (yyvsp[-5].fixver)->file_version_ls = ((yyvsp[-1].il) << 16) | (yyvsp[0].il); - (yyval.fixver) = (yyvsp[-5].fixver); - } - break; - - case 175: -#line 1301 "rcparse.y" - { - (yyvsp[-5].fixver)->product_version_ms = ((yyvsp[-3].il) << 16) | (yyvsp[-2].il); - (yyvsp[-5].fixver)->product_version_ls = ((yyvsp[-1].il) << 16) | (yyvsp[0].il); - (yyval.fixver) = (yyvsp[-5].fixver); - } - break; - - case 176: -#line 1307 "rcparse.y" - { - (yyvsp[-2].fixver)->file_flags_mask = (yyvsp[0].il); - (yyval.fixver) = (yyvsp[-2].fixver); - } - break; - - case 177: -#line 1312 "rcparse.y" - { - (yyvsp[-2].fixver)->file_flags = (yyvsp[0].il); - (yyval.fixver) = (yyvsp[-2].fixver); - } - break; - - case 178: -#line 1317 "rcparse.y" - { - (yyvsp[-2].fixver)->file_os = (yyvsp[0].il); - (yyval.fixver) = (yyvsp[-2].fixver); - } - break; - - case 179: -#line 1322 "rcparse.y" - { - (yyvsp[-2].fixver)->file_type = (yyvsp[0].il); - (yyval.fixver) = (yyvsp[-2].fixver); - } - break; - - case 180: -#line 1327 "rcparse.y" - { - (yyvsp[-2].fixver)->file_subtype = (yyvsp[0].il); - (yyval.fixver) = (yyvsp[-2].fixver); - } - break; - - case 181: -#line 1341 "rcparse.y" - { - (yyval.verinfo) = NULL; - } - break; - - case 182: -#line 1345 "rcparse.y" - { - (yyval.verinfo) = append_ver_stringfileinfo ((yyvsp[-7].verinfo), (yyvsp[-4].s), (yyvsp[-2].verstring)); - } - break; - - case 183: -#line 1349 "rcparse.y" - { - (yyval.verinfo) = append_ver_varfileinfo ((yyvsp[-6].verinfo), (yyvsp[-2].s), (yyvsp[-1].vervar)); - } - break; - - case 184: -#line 1356 "rcparse.y" - { - (yyval.verstring) = NULL; - } - break; - - case 185: -#line 1360 "rcparse.y" - { - (yyval.verstring) = append_verval ((yyvsp[-4].verstring), (yyvsp[-2].s), (yyvsp[0].s)); - } - break; - - case 186: -#line 1367 "rcparse.y" - { - (yyval.vervar) = NULL; - } - break; - - case 187: -#line 1371 "rcparse.y" - { - (yyval.vervar) = append_vertrans ((yyvsp[-2].vervar), (yyvsp[-1].il), (yyvsp[0].il)); - } - break; - - case 188: -#line 1380 "rcparse.y" - { - (yyval.id).named = 0; - (yyval.id).u.id = (yyvsp[0].il); - } - break; - - case 189: -#line 1385 "rcparse.y" - { - char *copy, *s; - - /* It seems that resource ID's are forced to upper case. */ - copy = xstrdup ((yyvsp[0].s)); - for (s = copy; *s != '\0'; s++) - *s = TOUPPER (*s); - res_string_to_id (&(yyval.id), copy); - free (copy); - } - break; - - case 190: -#line 1401 "rcparse.y" - { - (yyval.s) = (yyvsp[0].s); - } - break; - - case 191: -#line 1405 "rcparse.y" - { - (yyval.s) = (yyvsp[-1].s); - } - break; - - case 192: -#line 1409 "rcparse.y" - { - (yyval.s) = (yyvsp[-1].s); - } - break; - - case 193: -#line 1417 "rcparse.y" - { - (yyval.id).named = 0; - (yyval.id).u.id = (yyvsp[-1].il); - } - break; - - case 194: -#line 1422 "rcparse.y" - { - char *copy, *s; - - /* It seems that resource ID's are forced to upper case. */ - copy = xstrdup ((yyvsp[0].s)); - for (s = copy; *s != '\0'; s++) - *s = TOUPPER (*s); - res_string_to_id (&(yyval.id), copy); - free (copy); - } - break; - - case 195: -#line 1439 "rcparse.y" - { - memset (&(yyval.res_info), 0, sizeof (struct res_res_info)); - (yyval.res_info).language = language; - /* FIXME: Is this the right default? */ - (yyval.res_info).memflags = MEMFLAG_MOVEABLE | MEMFLAG_PURE | MEMFLAG_DISCARDABLE; - } - break; - - case 196: -#line 1446 "rcparse.y" - { - (yyval.res_info) = (yyvsp[-1].res_info); - (yyval.res_info).memflags |= (yyvsp[0].memflags).on; - (yyval.res_info).memflags &=~ (yyvsp[0].memflags).off; - } - break; - - case 197: -#line 1452 "rcparse.y" - { - (yyval.res_info) = (yyvsp[-2].res_info); - (yyval.res_info).characteristics = (yyvsp[0].il); - } - break; - - case 198: -#line 1457 "rcparse.y" - { - (yyval.res_info) = (yyvsp[-3].res_info); - (yyval.res_info).language = (yyvsp[-1].il) | ((yyvsp[0].il) << SUBLANG_SHIFT); - } - break; - - case 199: -#line 1462 "rcparse.y" - { - (yyval.res_info) = (yyvsp[-2].res_info); - (yyval.res_info).version = (yyvsp[0].il); - } - break; - - case 200: -#line 1472 "rcparse.y" - { - memset (&(yyval.res_info), 0, sizeof (struct res_res_info)); - (yyval.res_info).language = language; - (yyval.res_info).memflags = MEMFLAG_MOVEABLE | MEMFLAG_DISCARDABLE; - } - break; - - case 201: -#line 1478 "rcparse.y" - { - (yyval.res_info) = (yyvsp[-1].res_info); - (yyval.res_info).memflags |= (yyvsp[0].memflags).on; - (yyval.res_info).memflags &=~ (yyvsp[0].memflags).off; - } - break; - - case 202: -#line 1489 "rcparse.y" - { - memset (&(yyval.res_info), 0, sizeof (struct res_res_info)); - (yyval.res_info).language = language; - (yyval.res_info).memflags = MEMFLAG_MOVEABLE | MEMFLAG_PURE | MEMFLAG_DISCARDABLE; - } - break; - - case 203: -#line 1495 "rcparse.y" - { - (yyval.res_info) = (yyvsp[-1].res_info); - (yyval.res_info).memflags |= (yyvsp[0].memflags).on; - (yyval.res_info).memflags &=~ (yyvsp[0].memflags).off; - } - break; - - case 204: -#line 1507 "rcparse.y" - { - (yyval.memflags).on = MEMFLAG_MOVEABLE; - (yyval.memflags).off = 0; - } - break; - - case 205: -#line 1512 "rcparse.y" - { - (yyval.memflags).on = 0; - (yyval.memflags).off = MEMFLAG_MOVEABLE; - } - break; - - case 206: -#line 1517 "rcparse.y" - { - (yyval.memflags).on = MEMFLAG_PURE; - (yyval.memflags).off = 0; - } - break; - - case 207: -#line 1522 "rcparse.y" - { - (yyval.memflags).on = 0; - (yyval.memflags).off = MEMFLAG_PURE; - } - break; - - case 208: -#line 1527 "rcparse.y" - { - (yyval.memflags).on = MEMFLAG_PRELOAD; - (yyval.memflags).off = 0; - } - break; - - case 209: -#line 1532 "rcparse.y" - { - (yyval.memflags).on = 0; - (yyval.memflags).off = MEMFLAG_PRELOAD; - } - break; - - case 210: -#line 1537 "rcparse.y" - { - (yyval.memflags).on = MEMFLAG_DISCARDABLE; - (yyval.memflags).off = 0; - } - break; - - case 211: -#line 1547 "rcparse.y" - { - (yyval.s) = (yyvsp[0].s); - } - break; - - case 212: -#line 1551 "rcparse.y" - { - (yyval.s) = (yyvsp[0].s); - } - break; - - case 213: -#line 1568 "rcparse.y" - { - style |= (yyvsp[0].il); - } - break; - - case 214: -#line 1572 "rcparse.y" - { - style &=~ (yyvsp[0].il); - } - break; - - case 215: -#line 1576 "rcparse.y" - { - style |= (yyvsp[0].il); - } - break; - - case 216: -#line 1580 "rcparse.y" - { - style &=~ (yyvsp[0].il); - } - break; - - case 217: -#line 1587 "rcparse.y" - { - (yyval.il) = (yyvsp[0].i).val; - } - break; - - case 218: -#line 1591 "rcparse.y" - { - (yyval.il) = (yyvsp[-1].il); - } - break; - - case 219: -#line 1600 "rcparse.y" - { - (yyval.il) = 0; - } - break; - - case 220: -#line 1604 "rcparse.y" - { - (yyval.il) = (yyvsp[0].il); - } - break; - - case 221: -#line 1613 "rcparse.y" - { - (yyval.il) = (yyvsp[0].il); - } - break; - - case 222: -#line 1622 "rcparse.y" - { - (yyval.il) = (yyvsp[0].i).val; - } - break; - - case 223: -#line 1631 "rcparse.y" - { - (yyval.i) = (yyvsp[0].i); - } - break; - - case 224: -#line 1635 "rcparse.y" - { - (yyval.i) = (yyvsp[-1].i); - } - break; - - case 225: -#line 1639 "rcparse.y" - { - (yyval.i).val = ~ (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[0].i).dword; - } - break; - - case 226: -#line 1644 "rcparse.y" - { - (yyval.i).val = - (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[0].i).dword; - } - break; - - case 227: -#line 1649 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val * (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 228: -#line 1654 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val / (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 229: -#line 1659 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val % (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 230: -#line 1664 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val + (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 231: -#line 1669 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val - (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 232: -#line 1674 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val & (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 233: -#line 1679 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val ^ (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 234: -#line 1684 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val | (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 235: -#line 1695 "rcparse.y" - { - (yyval.il) = (yyvsp[0].il); - } - break; - - case 236: -#line 1704 "rcparse.y" - { - (yyval.il) = (yyvsp[0].i).val; - } - break; - - case 237: -#line 1715 "rcparse.y" - { - (yyval.i) = (yyvsp[0].i); - } - break; - - case 238: -#line 1719 "rcparse.y" - { - (yyval.i) = (yyvsp[-1].i); - } - break; - - case 239: -#line 1723 "rcparse.y" - { - (yyval.i).val = ~ (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[0].i).dword; - } - break; - - case 240: -#line 1728 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val * (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 241: -#line 1733 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val / (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 242: -#line 1738 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val % (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 243: -#line 1743 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val + (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 244: -#line 1748 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val - (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 245: -#line 1753 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val & (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 246: -#line 1758 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val ^ (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - case 247: -#line 1763 "rcparse.y" - { - (yyval.i).val = (yyvsp[-2].i).val | (yyvsp[0].i).val; - (yyval.i).dword = (yyvsp[-2].i).dword || (yyvsp[0].i).dword; - } - break; - - - default: break; - } - -/* Line 1126 of yacc.c. */ -#line 3867 "rcparse.c" - - yyvsp -= yylen; - yyssp -= yylen; - - - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - char *yymsg = 0; -# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -#if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -#endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - - if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yymsg; - int yyi = 0; - while ((*yyp = *yyf)) - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - { - yyerror (YY_("syntax error")); - goto yyexhaustedlab; - } - } - else -#endif /* YYERROR_VERBOSE */ - yyerror (YY_("syntax error")); - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (0) - goto yyerrorlab; - -yyvsp -= yylen; - yyssp -= yylen; - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK; - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK; - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif - return yyresult; -} - - -#line 1769 "rcparse.y" - - -/* Set the language from the command line. */ - -void -rcparse_set_language (int lang) -{ - language = lang; -} - diff --git a/binutils/rcparse.h b/binutils/rcparse.h deleted file mode 100644 index f61d200ae7d..00000000000 --- a/binutils/rcparse.h +++ /dev/null @@ -1,255 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - 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 2, 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. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - BEG = 258, - END = 259, - ACCELERATORS = 260, - VIRTKEY = 261, - ASCII = 262, - NOINVERT = 263, - SHIFT = 264, - CONTROL = 265, - ALT = 266, - BITMAP = 267, - CURSOR = 268, - DIALOG = 269, - DIALOGEX = 270, - EXSTYLE = 271, - CAPTION = 272, - CLASS = 273, - STYLE = 274, - AUTO3STATE = 275, - AUTOCHECKBOX = 276, - AUTORADIOBUTTON = 277, - CHECKBOX = 278, - COMBOBOX = 279, - CTEXT = 280, - DEFPUSHBUTTON = 281, - EDITTEXT = 282, - GROUPBOX = 283, - LISTBOX = 284, - LTEXT = 285, - PUSHBOX = 286, - PUSHBUTTON = 287, - RADIOBUTTON = 288, - RTEXT = 289, - SCROLLBAR = 290, - STATE3 = 291, - USERBUTTON = 292, - BEDIT = 293, - HEDIT = 294, - IEDIT = 295, - FONT = 296, - ICON = 297, - LANGUAGE = 298, - CHARACTERISTICS = 299, - VERSIONK = 300, - MENU = 301, - MENUEX = 302, - MENUITEM = 303, - SEPARATOR = 304, - POPUP = 305, - CHECKED = 306, - GRAYED = 307, - HELP = 308, - INACTIVE = 309, - MENUBARBREAK = 310, - MENUBREAK = 311, - MESSAGETABLE = 312, - RCDATA = 313, - STRINGTABLE = 314, - VERSIONINFO = 315, - FILEVERSION = 316, - PRODUCTVERSION = 317, - FILEFLAGSMASK = 318, - FILEFLAGS = 319, - FILEOS = 320, - FILETYPE = 321, - FILESUBTYPE = 322, - BLOCKSTRINGFILEINFO = 323, - BLOCKVARFILEINFO = 324, - VALUE = 325, - BLOCK = 326, - MOVEABLE = 327, - FIXED = 328, - PURE = 329, - IMPURE = 330, - PRELOAD = 331, - LOADONCALL = 332, - DISCARDABLE = 333, - NOT = 334, - QUOTEDSTRING = 335, - STRING = 336, - NUMBER = 337, - SIZEDSTRING = 338, - IGNORED_TOKEN = 339, - NEG = 340 - }; -#endif -/* Tokens. */ -#define BEG 258 -#define END 259 -#define ACCELERATORS 260 -#define VIRTKEY 261 -#define ASCII 262 -#define NOINVERT 263 -#define SHIFT 264 -#define CONTROL 265 -#define ALT 266 -#define BITMAP 267 -#define CURSOR 268 -#define DIALOG 269 -#define DIALOGEX 270 -#define EXSTYLE 271 -#define CAPTION 272 -#define CLASS 273 -#define STYLE 274 -#define AUTO3STATE 275 -#define AUTOCHECKBOX 276 -#define AUTORADIOBUTTON 277 -#define CHECKBOX 278 -#define COMBOBOX 279 -#define CTEXT 280 -#define DEFPUSHBUTTON 281 -#define EDITTEXT 282 -#define GROUPBOX 283 -#define LISTBOX 284 -#define LTEXT 285 -#define PUSHBOX 286 -#define PUSHBUTTON 287 -#define RADIOBUTTON 288 -#define RTEXT 289 -#define SCROLLBAR 290 -#define STATE3 291 -#define USERBUTTON 292 -#define BEDIT 293 -#define HEDIT 294 -#define IEDIT 295 -#define FONT 296 -#define ICON 297 -#define LANGUAGE 298 -#define CHARACTERISTICS 299 -#define VERSIONK 300 -#define MENU 301 -#define MENUEX 302 -#define MENUITEM 303 -#define SEPARATOR 304 -#define POPUP 305 -#define CHECKED 306 -#define GRAYED 307 -#define HELP 308 -#define INACTIVE 309 -#define MENUBARBREAK 310 -#define MENUBREAK 311 -#define MESSAGETABLE 312 -#define RCDATA 313 -#define STRINGTABLE 314 -#define VERSIONINFO 315 -#define FILEVERSION 316 -#define PRODUCTVERSION 317 -#define FILEFLAGSMASK 318 -#define FILEFLAGS 319 -#define FILEOS 320 -#define FILETYPE 321 -#define FILESUBTYPE 322 -#define BLOCKSTRINGFILEINFO 323 -#define BLOCKVARFILEINFO 324 -#define VALUE 325 -#define BLOCK 326 -#define MOVEABLE 327 -#define FIXED 328 -#define PURE 329 -#define IMPURE 330 -#define PRELOAD 331 -#define LOADONCALL 332 -#define DISCARDABLE 333 -#define NOT 334 -#define QUOTEDSTRING 335 -#define STRING 336 -#define NUMBER 337 -#define SIZEDSTRING 338 -#define IGNORED_TOKEN 339 -#define NEG 340 - - - - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 66 "rcparse.y" -typedef union YYSTYPE { - struct accelerator acc; - struct accelerator *pacc; - struct dialog_control *dialog_control; - struct menuitem *menuitem; - struct - { - struct rcdata_item *first; - struct rcdata_item *last; - } rcdata; - struct rcdata_item *rcdata_item; - struct stringtable_data *stringtable; - struct fixed_versioninfo *fixver; - struct ver_info *verinfo; - struct ver_stringinfo *verstring; - struct ver_varinfo *vervar; - struct res_id id; - struct res_res_info res_info; - struct - { - unsigned short on; - unsigned short off; - } memflags; - struct - { - unsigned long val; - /* Nonzero if this number was explicitly specified as long. */ - int dword; - } i; - unsigned long il; - unsigned short is; - const char *s; - struct - { - unsigned long length; - const char *s; - } ss; -} YYSTYPE; -/* Line 1447 of yacc.c. */ -#line 247 "rcparse.h" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE yylval; - - - diff --git a/binutils/rcparse.y b/binutils/rcparse.y index fbc5bef6f8a..ac72ee77778 100644 --- a/binutils/rcparse.y +++ b/binutils/rcparse.y @@ -1,7 +1,8 @@ %{ /* rcparse.y -- parser for Windows rc files - Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. + Extended by Kai Tietz, Onevision. This file is part of GNU Binutils. @@ -23,6 +24,7 @@ /* This is a parser for Windows rc files. It is based on the parser by Gunther Ebert . */ +#include "sysdep.h" #include "bfd.h" #include "bucomm.h" #include "libiberty.h" @@ -35,12 +37,12 @@ static unsigned short language; /* The resource information during a sub statement. */ -static struct res_res_info sub_res_info; +static rc_res_res_info sub_res_info; /* Dialog information. This is built by the nonterminals styles and controls. */ -static struct dialog dialog; +static rc_dialog dialog; /* This is used when building a style. It is modified by the nonterminal styleexpr. */ @@ -50,56 +52,62 @@ static unsigned long style; /* These are used when building a control. They are set before using control_params. */ -static unsigned long base_style; -static unsigned long default_style; -static unsigned long class; -static struct res_id res_text_field; +static rc_uint_type base_style; +static rc_uint_type default_style; +static rc_res_id class; +static rc_res_id res_text_field; static unichar null_unichar; /* This is used for COMBOBOX, LISTBOX and EDITTEXT which do not allow resource 'text' field in control definition. */ -static const struct res_id res_null_text = { 1, {{0, &null_unichar}}}; +static const rc_res_id res_null_text = { 1, {{0, &null_unichar}}}; %} %union { - struct accelerator acc; - struct accelerator *pacc; - struct dialog_control *dialog_control; - struct menuitem *menuitem; + rc_accelerator acc; + rc_accelerator *pacc; + rc_dialog_control *dialog_control; + rc_menuitem *menuitem; struct { - struct rcdata_item *first; - struct rcdata_item *last; + rc_rcdata_item *first; + rc_rcdata_item *last; } rcdata; - struct rcdata_item *rcdata_item; - struct stringtable_data *stringtable; - struct fixed_versioninfo *fixver; - struct ver_info *verinfo; - struct ver_stringinfo *verstring; - struct ver_varinfo *vervar; - struct res_id id; - struct res_res_info res_info; + rc_rcdata_item *rcdata_item; + rc_fixed_versioninfo *fixver; + rc_ver_info *verinfo; + rc_ver_stringinfo *verstring; + rc_ver_varinfo *vervar; + rc_toolbar_item *toobar_item; + rc_res_id id; + rc_res_res_info res_info; struct { - unsigned short on; - unsigned short off; + rc_uint_type on; + rc_uint_type off; } memflags; struct { - unsigned long val; + rc_uint_type val; /* Nonzero if this number was explicitly specified as long. */ int dword; } i; - unsigned long il; - unsigned short is; + rc_uint_type il; + rc_uint_type is; const char *s; struct { - unsigned long length; + rc_uint_type length; const char *s; } ss; + unichar *uni; + struct + { + rc_uint_type length; + const unichar *s; + } suni; }; %token BEG END @@ -113,6 +121,7 @@ static const struct res_id res_null_text = { 1, {{0, &null_unichar}}}; %token BEDIT HEDIT IEDIT %token FONT %token ICON +%token ANICURSOR ANIICON DLGINCLUDE DLGINIT FONTDIR HTML MANIFEST PLUGPLAY VXD TOOLBAR BUTTON %token LANGUAGE CHARACTERISTICS VERSIONK %token MENU MENUEX MENUITEM SEPARATOR POPUP CHECKED GRAYED HELP INACTIVE %token MENUBARBREAK MENUBREAK @@ -125,8 +134,10 @@ static const struct res_id res_null_text = { 1, {{0, &null_unichar}}}; %token BLOCK %token MOVEABLE FIXED PURE IMPURE PRELOAD LOADONCALL DISCARDABLE %token NOT +%token QUOTEDUNISTRING %token QUOTEDSTRING STRING %token NUMBER +%token SIZEDUNISTRING %token SIZEDSTRING %token IGNORED_TOKEN @@ -140,13 +151,17 @@ static const struct res_id res_null_text = { 1, {{0, &null_unichar}}}; %type verblocks %type vervals %type vertrans +%type toolbar_data %type suboptions memflags_move_discard memflags_move %type memflag -%type id optresidc resref +%type id rcdata_id optresidc resref resid cresid %type exstyle parennumber %type numexpr posnumexpr cnumexpr optcnumexpr cposnumexpr %type acc_options acc_option menuitem_flags menuitem_flag -%type file_name resname +%type file_name +%type res_unicode_string resname res_unicode_string_concat +%type sizedstring +%type sizedunistring %type sizednumexpr sizedposnumexpr %left '|' @@ -170,8 +185,8 @@ input: | input menu | input menuex | input messagetable - | input rcdata | input stringtable + | input toolbar | input user | input versioninfo | input IGNORED_TOKEN @@ -196,15 +211,15 @@ acc_entries: } | acc_entries acc_entry { - struct accelerator *a; + rc_accelerator *a; - a = (struct accelerator *) res_alloc (sizeof *a); + a = (rc_accelerator *) res_alloc (sizeof *a); *a = $2; if ($1 == NULL) $$ = a; else { - struct accelerator **pp; + rc_accelerator **pp; for (pp = &$1->next; *pp != NULL; pp = &(*pp)->next) ; @@ -246,8 +261,7 @@ acc_event: { $$.flags = ACC_CONTROL | ACC_VIRTKEY; ++s; - ch = *s; - ch = TOUPPER (ch); + ch = TOUPPER (s[0]); } $$.key = ch; if (s[1] != '\0') @@ -371,9 +385,9 @@ dialog: dialog.menu.named = 1; dialog.class.named = 1; dialog.font = NULL; - dialog.ex = ((struct dialog_ex *) - res_alloc (sizeof (struct dialog_ex))); - memset (dialog.ex, 0, sizeof (struct dialog_ex)); + dialog.ex = ((rc_dialog_ex *) + res_alloc (sizeof (rc_dialog_ex))); + memset (dialog.ex, 0, sizeof (rc_dialog_ex)); dialog.controls = NULL; sub_res_info = $3; style = 0; @@ -398,9 +412,9 @@ dialog: dialog.menu.named = 1; dialog.class.named = 1; dialog.font = NULL; - dialog.ex = ((struct dialog_ex *) - res_alloc (sizeof (struct dialog_ex))); - memset (dialog.ex, 0, sizeof (struct dialog_ex)); + dialog.ex = ((rc_dialog_ex *) + res_alloc (sizeof (rc_dialog_ex))); + memset (dialog.ex, 0, sizeof (rc_dialog_ex)); dialog.ex->help = $9; dialog.controls = NULL; sub_res_info = $3; @@ -428,11 +442,11 @@ exstyle: styles: /* empty */ - | styles CAPTION QUOTEDSTRING + | styles CAPTION res_unicode_string_concat { dialog.style |= WS_CAPTION; style |= WS_CAPTION; - unicode_from_ascii ((int *) NULL, &dialog.caption, $3); + dialog.caption = $3; } | styles CLASS id { @@ -447,16 +461,16 @@ styles: { dialog.exstyle = $3; } - | styles CLASS QUOTEDSTRING + | styles CLASS res_unicode_string_concat { - res_string_to_id (& dialog.class, $3); + res_unistring_to_id (& dialog.class, $3); } - | styles FONT numexpr ',' QUOTEDSTRING + | styles FONT numexpr ',' res_unicode_string_concat { dialog.style |= DS_SETFONT; style |= DS_SETFONT; dialog.pointsize = $3; - unicode_from_ascii ((int *) NULL, &dialog.font, $5); + dialog.font = $5; if (dialog.ex != NULL) { dialog.ex->weight = 0; @@ -464,12 +478,12 @@ styles: dialog.ex->charset = 1; } } - | styles FONT numexpr ',' QUOTEDSTRING cnumexpr + | styles FONT numexpr ',' res_unicode_string_concat cnumexpr { dialog.style |= DS_SETFONT; style |= DS_SETFONT; dialog.pointsize = $3; - unicode_from_ascii ((int *) NULL, &dialog.font, $5); + dialog.font = $5; if (dialog.ex == NULL) rcparse_warning (_("extended FONT requires DIALOGEX")); else @@ -479,12 +493,12 @@ styles: dialog.ex->charset = 1; } } - | styles FONT numexpr ',' QUOTEDSTRING cnumexpr cnumexpr + | styles FONT numexpr ',' res_unicode_string_concat cnumexpr cnumexpr { dialog.style |= DS_SETFONT; style |= DS_SETFONT; dialog.pointsize = $3; - unicode_from_ascii ((int *) NULL, &dialog.font, $5); + dialog.font = $5; if (dialog.ex == NULL) rcparse_warning (_("extended FONT requires DIALOGEX")); else @@ -494,12 +508,12 @@ styles: dialog.ex->charset = 1; } } - | styles FONT numexpr ',' QUOTEDSTRING cnumexpr cnumexpr cnumexpr + | styles FONT numexpr ',' res_unicode_string_concat cnumexpr cnumexpr cnumexpr { dialog.style |= DS_SETFONT; style |= DS_SETFONT; dialog.pointsize = $3; - unicode_from_ascii ((int *) NULL, &dialog.font, $5); + dialog.font = $5; if (dialog.ex == NULL) rcparse_warning (_("extended FONT requires DIALOGEX")); else @@ -531,7 +545,7 @@ controls: /* empty */ | controls control { - struct dialog_control **pp; + rc_dialog_control **pp; for (pp = &dialog.controls; *pp != NULL; pp = &(*pp)->next) ; @@ -544,7 +558,8 @@ control: { default_style = BS_AUTO3STATE | WS_TABSTOP; base_style = BS_AUTO3STATE; - class = CTL_BUTTON; + class.named = 0; + class.u.id = CTL_BUTTON; res_text_field = $2; } control_params @@ -555,7 +570,8 @@ control: { default_style = BS_AUTOCHECKBOX | WS_TABSTOP; base_style = BS_AUTOCHECKBOX; - class = CTL_BUTTON; + class.named = 0; + class.u.id = CTL_BUTTON; res_text_field = $2; } control_params @@ -566,7 +582,8 @@ control: { default_style = BS_AUTORADIOBUTTON | WS_TABSTOP; base_style = BS_AUTORADIOBUTTON; - class = CTL_BUTTON; + class.named = 0; + class.u.id = CTL_BUTTON; res_text_field = $2; } control_params @@ -577,7 +594,8 @@ control: { default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - class = CTL_EDIT; + class.named = 0; + class.u.id = CTL_EDIT; res_text_field = $2; } control_params @@ -591,7 +609,8 @@ control: { default_style = BS_CHECKBOX | WS_TABSTOP; base_style = BS_CHECKBOX | WS_TABSTOP; - class = CTL_BUTTON; + class.named = 0; + class.u.id = CTL_BUTTON; res_text_field = $2; } control_params @@ -604,14 +623,15 @@ control: versions of MS rc.exe their is no default style. */ default_style = CBS_SIMPLE | WS_TABSTOP; base_style = 0; - class = CTL_COMBOBOX; + class.named = 0; + class.u.id = CTL_COMBOBOX; res_text_field = res_null_text; } control_params { $$ = $3; } - | CONTROL optresidc numexpr cnumexpr control_styleexpr cnumexpr + | CONTROL optresidc numexpr cresid control_styleexpr cnumexpr cnumexpr cnumexpr cnumexpr optcnumexpr opt_control_data { $$ = define_control ($2, $3, $6, $7, $8, $9, $4, style, $10); @@ -622,7 +642,7 @@ control: $$->data = $11; } } - | CONTROL optresidc numexpr cnumexpr control_styleexpr cnumexpr + | CONTROL optresidc numexpr cresid control_styleexpr cnumexpr cnumexpr cnumexpr cnumexpr cnumexpr cnumexpr opt_control_data { $$ = define_control ($2, $3, $6, $7, $8, $9, $4, style, $10); @@ -631,35 +651,12 @@ control: $$->help = $11; $$->data = $12; } - | CONTROL optresidc numexpr ',' QUOTEDSTRING control_styleexpr - cnumexpr cnumexpr cnumexpr cnumexpr optcnumexpr opt_control_data - { - $$ = define_control ($2, $3, $7, $8, $9, $10, 0, style, $11); - if ($12 != NULL) - { - if (dialog.ex == NULL) - rcparse_warning ("control data requires DIALOGEX"); - $$->data = $12; - } - $$->class.named = 1; - unicode_from_ascii (&$$->class.u.n.length, &$$->class.u.n.name, $5); - } - | CONTROL optresidc numexpr ',' QUOTEDSTRING control_styleexpr - cnumexpr cnumexpr cnumexpr cnumexpr cnumexpr cnumexpr opt_control_data - { - $$ = define_control ($2, $3, $7, $8, $9, $10, 0, style, $11); - if (dialog.ex == NULL) - rcparse_warning ("help ID requires DIALOGEX"); - $$->help = $12; - $$->data = $13; - $$->class.named = 1; - unicode_from_ascii (&$$->class.u.n.length, &$$->class.u.n.name, $5); - } | CTEXT optresidc { default_style = SS_CENTER | WS_GROUP; base_style = SS_CENTER; - class = CTL_STATIC; + class.named = 0; + class.u.id = CTL_STATIC; res_text_field = $2; } control_params @@ -670,7 +667,8 @@ control: { default_style = BS_DEFPUSHBUTTON | WS_TABSTOP; base_style = BS_DEFPUSHBUTTON | WS_TABSTOP; - class = CTL_BUTTON; + class.named = 0; + class.u.id = CTL_BUTTON; res_text_field = $2; } control_params @@ -681,7 +679,8 @@ control: { default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - class = CTL_EDIT; + class.named = 0; + class.u.id = CTL_EDIT; res_text_field = res_null_text; } control_params @@ -692,7 +691,8 @@ control: { default_style = BS_GROUPBOX; base_style = BS_GROUPBOX; - class = CTL_BUTTON; + class.named = 0; + class.u.id = CTL_BUTTON; res_text_field = $2; } control_params @@ -703,7 +703,8 @@ control: { default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - class = CTL_EDIT; + class.named = 0; + class.u.id = CTL_EDIT; res_text_field = $2; } control_params @@ -740,7 +741,8 @@ control: { default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; - class = CTL_EDIT; + class.named = 0; + class.u.id = CTL_EDIT; res_text_field = $2; } control_params @@ -754,7 +756,8 @@ control: { default_style = LBS_NOTIFY | WS_BORDER; base_style = LBS_NOTIFY | WS_BORDER; - class = CTL_LISTBOX; + class.named = 0; + class.u.id = CTL_LISTBOX; res_text_field = res_null_text; } control_params @@ -765,7 +768,8 @@ control: { default_style = SS_LEFT | WS_GROUP; base_style = SS_LEFT; - class = CTL_STATIC; + class.named = 0; + class.u.id = CTL_STATIC; res_text_field = $2; } control_params @@ -776,7 +780,8 @@ control: { default_style = BS_PUSHBOX | WS_TABSTOP; base_style = BS_PUSHBOX; - class = CTL_BUTTON; + class.named = 0; + class.u.id = CTL_BUTTON; } control_params { @@ -786,7 +791,8 @@ control: { default_style = BS_PUSHBUTTON | WS_TABSTOP; base_style = BS_PUSHBUTTON | WS_TABSTOP; - class = CTL_BUTTON; + class.named = 0; + class.u.id = CTL_BUTTON; res_text_field = $2; } control_params @@ -797,7 +803,8 @@ control: { default_style = BS_RADIOBUTTON | WS_TABSTOP; base_style = BS_RADIOBUTTON; - class = CTL_BUTTON; + class.named = 0; + class.u.id = CTL_BUTTON; res_text_field = $2; } control_params @@ -808,7 +815,8 @@ control: { default_style = SS_RIGHT | WS_GROUP; base_style = SS_RIGHT; - class = CTL_STATIC; + class.named = 0; + class.u.id = CTL_STATIC; res_text_field = $2; } control_params @@ -819,7 +827,8 @@ control: { default_style = SBS_HORZ; base_style = 0; - class = CTL_SCROLLBAR; + class.named = 0; + class.u.id = CTL_SCROLLBAR; res_text_field = res_null_text; } control_params @@ -830,7 +839,8 @@ control: { default_style = BS_3STATE | WS_TABSTOP; base_style = BS_3STATE; - class = CTL_BUTTON; + class.named = 0; + class.u.id = CTL_BUTTON; res_text_field = $2; } control_params @@ -842,7 +852,10 @@ control: { style = WS_CHILD | WS_VISIBLE; } styleexpr optcnumexpr { - $$ = define_control ($2, $3, $5, $7, $9, $11, CTL_BUTTON, + rc_res_id cid; + cid.named = 0; + cid.u.id = CTL_BUTTON; + $$ = define_control ($2, $3, $5, $7, $9, $11, cid, style, $15); } ; @@ -888,23 +901,35 @@ control_params: } ; +cresid: + ',' resid + { + if ($2.named) + res_unistring_to_id (&$$, $2.u.n.name); + else + $$=$2; + } + ; + optresidc: /* empty */ { res_string_to_id (&$$, ""); } - | posnumexpr ',' + | resid ',' { $$=$1; } + ; + +resid: + posnumexpr { $$.named = 0; $$.u.id = $1; } - | QUOTEDSTRING + | res_unicode_string { - res_string_to_id (&$$, $1); - } - | QUOTEDSTRING ',' - { - res_string_to_id (&$$, $1); + $$.named = 1; + $$.u.n.name = $1; + $$.u.n.length = unichar_len ($1); } ; @@ -996,7 +1021,7 @@ menuitems: $$ = $2; else { - struct menuitem **pp; + rc_menuitem **pp; for (pp = &$1->next; *pp != NULL; pp = &(*pp)->next) ; @@ -1007,7 +1032,7 @@ menuitems: ; menuitem: - MENUITEM QUOTEDSTRING cnumexpr menuitem_flags + MENUITEM res_unicode_string_concat cnumexpr menuitem_flags { $$ = define_menuitem ($2, $3, $4, 0, 0, NULL); } @@ -1015,7 +1040,7 @@ menuitem: { $$ = define_menuitem (NULL, 0, 0, 0, 0, NULL); } - | POPUP QUOTEDSTRING menuitem_flags BEG menuitems END + | POPUP res_unicode_string_concat menuitem_flags BEG menuitems END { $$ = define_menuitem ($2, 0, $3, 0, 0, $5); } @@ -1086,7 +1111,7 @@ menuexitems: $$ = $2; else { - struct menuitem **pp; + rc_menuitem **pp; for (pp = &$1->next; *pp != NULL; pp = &(*pp)->next) ; @@ -1097,15 +1122,15 @@ menuexitems: ; menuexitem: - MENUITEM QUOTEDSTRING + MENUITEM res_unicode_string_concat { $$ = define_menuitem ($2, 0, 0, 0, 0, NULL); } - | MENUITEM QUOTEDSTRING cnumexpr + | MENUITEM res_unicode_string_concat cnumexpr { $$ = define_menuitem ($2, $3, 0, 0, 0, NULL); } - | MENUITEM QUOTEDSTRING cnumexpr cnumexpr optcnumexpr + | MENUITEM res_unicode_string_concat cnumexpr cnumexpr optcnumexpr { $$ = define_menuitem ($2, $3, $4, $5, 0, NULL); } @@ -1113,19 +1138,19 @@ menuexitem: { $$ = define_menuitem (NULL, 0, 0, 0, 0, NULL); } - | POPUP QUOTEDSTRING BEG menuexitems END + | POPUP res_unicode_string_concat BEG menuexitems END { $$ = define_menuitem ($2, 0, 0, 0, 0, $4); } - | POPUP QUOTEDSTRING cnumexpr BEG menuexitems END + | POPUP res_unicode_string_concat cnumexpr BEG menuexitems END { $$ = define_menuitem ($2, $3, 0, 0, 0, $5); } - | POPUP QUOTEDSTRING cnumexpr cnumexpr BEG menuexitems END + | POPUP res_unicode_string_concat cnumexpr cnumexpr BEG menuexitems END { $$ = define_menuitem ($2, $3, $4, 0, 0, $6); } - | POPUP QUOTEDSTRING cnumexpr cnumexpr cnumexpr optcnumexpr + | POPUP res_unicode_string_concat cnumexpr cnumexpr cnumexpr optcnumexpr BEG menuexitems END { $$ = define_menuitem ($2, $3, $4, $5, $6, $8); @@ -1144,25 +1169,6 @@ messagetable: } ; -/* Rcdata resources. */ - -rcdata: - id RCDATA suboptions BEG optrcdata_data END - { - define_rcdata ($1, &$3, $5.first); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - | id RCDATA suboptions file_name - { - define_rcdata_file ($1, &$3, $4); - if (yychar != YYEMPTY) - YYERROR; - rcparse_discard_strings (); - } - ; - /* We use a different lexing algorithm, because rcdata strings may contain embedded null bytes, and we need to know the length to use. */ @@ -1190,34 +1196,51 @@ optrcdata_data_int: ; rcdata_data: - SIZEDSTRING + sizedstring { - struct rcdata_item *ri; + rc_rcdata_item *ri; ri = define_rcdata_string ($1.s, $1.length); $$.first = ri; $$.last = ri; } + | sizedunistring + { + rc_rcdata_item *ri; + + ri = define_rcdata_unistring ($1.s, $1.length); + $$.first = ri; + $$.last = ri; + } | sizednumexpr { - struct rcdata_item *ri; + rc_rcdata_item *ri; ri = define_rcdata_number ($1.val, $1.dword); $$.first = ri; $$.last = ri; } - | rcdata_data ',' SIZEDSTRING + | rcdata_data ',' sizedstring { - struct rcdata_item *ri; + rc_rcdata_item *ri; ri = define_rcdata_string ($3.s, $3.length); $$.first = $1.first; $1.last->next = ri; $$.last = ri; } + | rcdata_data ',' sizedunistring + { + rc_rcdata_item *ri; + + ri = define_rcdata_unistring ($3.s, $3.length); + $$.first = $1.first; + $1.last->next = ri; + $$.last = ri; + } | rcdata_data ',' sizednumexpr { - struct rcdata_item *ri; + rc_rcdata_item *ri; ri = define_rcdata_number ($3.val, $3.dword); $$.first = $1.first; @@ -1236,14 +1259,14 @@ stringtable: string_data: /* empty */ - | string_data numexpr QUOTEDSTRING + | string_data numexpr res_unicode_string_concat { define_stringtable (&sub_res_info, $2, $3); if (yychar != YYEMPTY) YYERROR; rcparse_discard_strings (); } - | string_data numexpr ',' QUOTEDSTRING + | string_data numexpr ',' res_unicode_string_concat { define_stringtable (&sub_res_info, $2, $4); if (yychar != YYEMPTY) @@ -1252,18 +1275,70 @@ string_data: } ; +rcdata_id: + id + { + $$=$1; + } + | HTML + { + $$.named = 0; + $$.u.id = 23; + } + | RCDATA + { + $$.named = 0; + $$.u.id = RT_RCDATA; + } + | MANIFEST + { + $$.named = 0; + $$.u.id = RT_MANIFEST; + } + | PLUGPLAY + { + $$.named = 0; + $$.u.id = RT_PLUGPLAY; + } + | VXD + { + $$.named = 0; + $$.u.id = RT_VXD; + } + | DLGINCLUDE + { + $$.named = 0; + $$.u.id = RT_DLGINCLUDE; + } + | DLGINIT + { + $$.named = 0; + $$.u.id = RT_DLGINIT; + } + | ANICURSOR + { + $$.named = 0; + $$.u.id = RT_ANICURSOR; + } + | ANIICON + { + $$.named = 0; + $$.u.id = RT_ANIICON; + } + ; + /* User defined resources. We accept general suboptions in the file_name case to keep the parser happy. */ user: - id id suboptions BEG optrcdata_data END + id rcdata_id suboptions BEG optrcdata_data END { define_user_data ($1, $2, &$3, $5.first); if (yychar != YYEMPTY) YYERROR; rcparse_discard_strings (); } - | id id suboptions file_name + | id rcdata_id suboptions file_name { define_user_file ($1, $2, &$3, $4); if (yychar != YYEMPTY) @@ -1272,6 +1347,55 @@ user: } ; +toolbar: + id TOOLBAR suboptions numexpr cnumexpr BEG toolbar_data END + { + define_toolbar ($1, &$3, $4, $5, $7); + } + ; + +toolbar_data: /* empty */ { $$= NULL; } + | toolbar_data BUTTON id + { + rc_toolbar_item *c,*n; + c = $1; + n= (rc_toolbar_item *) + res_alloc (sizeof (rc_toolbar_item)); + if (c != NULL) + while (c->next != NULL) + c = c->next; + n->prev = c; + n->next = NULL; + if (c != NULL) + c->next = n; + n->id = $3; + if ($1 == NULL) + $$ = n; + else + $$ = $1; + } + | toolbar_data SEPARATOR + { + rc_toolbar_item *c,*n; + c = $1; + n= (rc_toolbar_item *) + res_alloc (sizeof (rc_toolbar_item)); + if (c != NULL) + while (c->next != NULL) + c = c->next; + n->prev = c; + n->next = NULL; + if (c != NULL) + c->next = n; + n->id.named = 0; + n->id.u.id = 0; + if ($1 == NULL) + $$ = n; + else + $$ = $1; + } + ; + /* Versioninfo resources. */ versioninfo: @@ -1287,9 +1411,9 @@ versioninfo: fixedverinfo: /* empty */ { - $$ = ((struct fixed_versioninfo *) - res_alloc (sizeof (struct fixed_versioninfo))); - memset ($$, 0, sizeof (struct fixed_versioninfo)); + $$ = ((rc_fixed_versioninfo *) + res_alloc (sizeof (rc_fixed_versioninfo))); + memset ($$, 0, sizeof (rc_fixed_versioninfo)); } | fixedverinfo FILEVERSION numexpr cnumexpr cnumexpr cnumexpr { @@ -1345,7 +1469,7 @@ verblocks: { $$ = append_ver_stringfileinfo ($1, $4, $6); } - | verblocks BLOCKVARFILEINFO BEG VALUE QUOTEDSTRING vertrans END + | verblocks BLOCKVARFILEINFO BEG VALUE res_unicode_string_concat vertrans END { $$ = append_ver_varfileinfo ($1, $5, $6); } @@ -1356,7 +1480,7 @@ vervals: { $$ = NULL; } - | vervals VALUE QUOTEDSTRING ',' QUOTEDSTRING + | vervals VALUE res_unicode_string_concat ',' res_unicode_string_concat { $$ = append_verval ($1, $3, $5); } @@ -1381,33 +1505,24 @@ id: $$.named = 0; $$.u.id = $1; } - | STRING + | resname { - char *copy, *s; - - /* It seems that resource ID's are forced to upper case. */ - copy = xstrdup ($1); - for (s = copy; *s != '\0'; s++) - *s = TOUPPER (*s); - res_string_to_id (&$$, copy); - free (copy); + res_unistring_to_id (&$$, $1); } ; /* A resource reference. */ resname: - QUOTEDSTRING + res_unicode_string { $$ = $1; } - | QUOTEDSTRING ',' + | STRING { - $$ = $1; - } - | STRING ',' - { - $$ = $1; + unichar *h = NULL; + unicode_from_ascii ((rc_uint_type *) NULL, &h, $1); + $$ = h; } ; @@ -1420,14 +1535,11 @@ resref: } | resname { - char *copy, *s; - - /* It seems that resource ID's are forced to upper case. */ - copy = xstrdup ($1); - for (s = copy; *s != '\0'; s++) - *s = TOUPPER (*s); - res_string_to_id (&$$, copy); - free (copy); + res_unistring_to_id (&$$, $1); + } + | resname ',' + { + res_unistring_to_id (&$$, $1); } ; @@ -1437,7 +1549,7 @@ resref: suboptions: /* empty */ { - memset (&$$, 0, sizeof (struct res_res_info)); + memset (&$$, 0, sizeof (rc_res_res_info)); $$.language = language; /* FIXME: Is this the right default? */ $$.memflags = MEMFLAG_MOVEABLE | MEMFLAG_PURE | MEMFLAG_DISCARDABLE; @@ -1470,7 +1582,7 @@ suboptions: memflags_move_discard: /* empty */ { - memset (&$$, 0, sizeof (struct res_res_info)); + memset (&$$, 0, sizeof (rc_res_res_info)); $$.language = language; $$.memflags = MEMFLAG_MOVEABLE | MEMFLAG_DISCARDABLE; } @@ -1487,7 +1599,7 @@ memflags_move_discard: memflags_move: /* empty */ { - memset (&$$, 0, sizeof (struct res_res_info)); + memset (&$$, 0, sizeof (rc_res_res_info)); $$.language = language; $$.memflags = MEMFLAG_MOVEABLE | MEMFLAG_PURE | MEMFLAG_DISCARDABLE; } @@ -1553,6 +1665,72 @@ file_name: } ; +/* Concat string */ +res_unicode_string_concat: + res_unicode_string + { + $$ = $1; + } + | + res_unicode_string_concat res_unicode_string + { + rc_uint_type l1 = unichar_len ($1); + rc_uint_type l2 = unichar_len ($2); + unichar *h = (unichar *) res_alloc ((l1 + l2 + 1) * sizeof (unichar)); + if (l1 != 0) + memcpy (h, $1, l1 * sizeof (unichar)); + if (l2 != 0) + memcpy (h + l1, $2, l2 * sizeof (unichar)); + h[l1 + l2] = 0; + $$ = h; + } + ; + +res_unicode_string: + QUOTEDUNISTRING + { + $$ = unichar_dup ($1); + } + | QUOTEDSTRING + { + unichar *h = NULL; + unicode_from_ascii ((rc_uint_type *) NULL, &h, $1); + $$ = h; + } + ; + +sizedstring: + SIZEDSTRING + { + $$ = $1; + } + | sizedstring SIZEDSTRING + { + rc_uint_type l = $1.length + $2.length; + char *h = (char *) res_alloc (l); + memcpy (h, $1.s, $1.length); + memcpy (h + $1.length, $2.s, $2.length); + $$.s = h; + $$.length = l; + } + ; + +sizedunistring: + SIZEDUNISTRING + { + $$ = $1; + } + | sizedunistring SIZEDUNISTRING + { + rc_uint_type l = $1.length + $2.length; + unichar *h = (unichar *) res_alloc (l * sizeof (unichar)); + memcpy (h, $1.s, $1.length * sizeof (unichar)); + memcpy (h + $1.length, $2.s, $2.length * sizeof (unichar)); + $$.s = h; + $$.length = l; + } + ; + /* A style expression. This changes the static variable STYLE. We do it this way because rc appears to permit a style to be set to something like diff --git a/binutils/rdcoff.c b/binutils/rdcoff.c index 1eda3af195d..70bf8425a1b 100644 --- a/binutils/rdcoff.c +++ b/binutils/rdcoff.c @@ -1,5 +1,6 @@ /* stabs.c -- Parse COFF debugging information - Copyright 1996, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. + Copyright 1996, 1999, 2000, 2002, 2003, 2007 + Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of GNU Binutils. @@ -21,10 +22,11 @@ /* This file contains code which parses COFF debugging information. */ +#include "sysdep.h" #include "bfd.h" #include "coff/internal.h" -#include "bucomm.h" #include "libiberty.h" +#include "bucomm.h" #include "debug.h" #include "budbg.h" diff --git a/binutils/rddbg.c b/binutils/rddbg.c index e977d8b5ef1..b9953d43f37 100644 --- a/binutils/rddbg.c +++ b/binutils/rddbg.c @@ -1,5 +1,5 @@ /* rddbg.c -- Read debugging information into a generic form. - Copyright 1995, 1996, 1997, 2000, 2002, 2003, 2005 + Copyright 1995, 1996, 1997, 2000, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor . @@ -24,9 +24,10 @@ file knows how to dig the debugging information out of an object file. */ +#include "sysdep.h" #include "bfd.h" -#include "bucomm.h" #include "libiberty.h" +#include "bucomm.h" #include "debug.h" #include "budbg.h" diff --git a/binutils/readelf.c b/binutils/readelf.c index d8bd54f440f..ab41e28828b 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -1,5 +1,5 @@ /* readelf.c -- display contents of an ELF format file - Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Originally developed by Eric Youngdale @@ -41,12 +41,30 @@ ELF file than is provided by objdump. In particular it can display DWARF debugging information which (at the moment) objdump cannot. */ +#include "sysdep.h" #include -#include #include -#include #include +/* for PATH_MAX */ +#ifdef HAVE_LIMITS_H +#include +#endif + +#ifndef PATH_MAX +/* for MAXPATHLEN */ +# ifdef HAVE_SYS_PARAM_H +# include +# endif +# ifndef PATH_MAX +# ifdef MAXPATHLEN +# define PATH_MAX MAXPATHLEN +# else +# define PATH_MAX 1024 +# endif +# endif +#endif + #if __GNUC__ >= 2 /* Define BFD64 here, even if our default architecture is 32 bit ELF as this will allow us to read in and parse 64bit and 32bit ELF files. @@ -55,12 +73,32 @@ #define BFD64 #endif +#include "bfd.h" +#include "bucomm.h" #include "dwarf.h" #include "elf/common.h" #include "elf/external.h" #include "elf/internal.h" + +/* Included here, before RELOC_MACROS_GEN_FUNC is defined, so that + we can obtain the H8 reloc numbers. We need these for the + get_reloc_size() function. We include h8.h again after defining + RELOC_MACROS_GEN_FUNC so that we get the naming function as well. */ + +#include "elf/h8.h" +#undef _ELF_H8_H + +/* Undo the effects of #including reloc-macros.h. */ + +#undef START_RELOC_NUMBERS +#undef RELOC_NUMBER +#undef FAKE_RELOC +#undef EMPTY_RELOC +#undef END_RELOC_NUMBERS +#undef _RELOC_MACROS_H + /* The following headers use the elf/reloc-macros.h file to automatically generate relocation recognition functions such as elf_mips_reloc_type() */ @@ -73,6 +111,7 @@ #include "elf/avr.h" #include "elf/bfin.h" #include "elf/cris.h" +#include "elf/crx.h" #include "elf/d10v.h" #include "elf/d30v.h" #include "elf/dlx.h" @@ -86,11 +125,13 @@ #include "elf/i960.h" #include "elf/ia64.h" #include "elf/ip2k.h" +#include "elf/iq2000.h" #include "elf/m32c.h" #include "elf/m32r.h" #include "elf/m68k.h" #include "elf/m68hc11.h" #include "elf/mcore.h" +#include "elf/mep.h" #include "elf/mips.h" #include "elf/mmix.h" #include "elf/mn10200.h" @@ -102,19 +143,18 @@ #include "elf/ppc.h" #include "elf/ppc64.h" #include "elf/s390.h" +#include "elf/score.h" #include "elf/sh.h" #include "elf/sparc.h" +#include "elf/spu.h" #include "elf/v850.h" #include "elf/vax.h" #include "elf/x86-64.h" #include "elf/xstormy16.h" -#include "elf/crx.h" -#include "elf/iq2000.h" #include "elf/xtensa.h" #include "aout/ar.h" -#include "bucomm.h" #include "getopt.h" #include "libiberty.h" @@ -133,8 +173,9 @@ static Elf_Internal_Sym *dynamic_symbols; static Elf_Internal_Syminfo *dynamic_syminfo; static unsigned long dynamic_syminfo_offset; static unsigned int dynamic_syminfo_nent; -static char program_interpreter[64]; +static char program_interpreter[PATH_MAX]; static bfd_vma dynamic_info[DT_JMPREL + 1]; +static bfd_vma dynamic_info_DT_GNU_HASH; static bfd_vma version_info[16]; static Elf_Internal_Ehdr elf_header; static Elf_Internal_Shdr *section_headers; @@ -222,9 +263,11 @@ static void (*byte_put) (unsigned char *, bfd_vma, int); #define UNKNOWN -1 -#define SECTION_NAME(X) ((X) == NULL ? "" : \ - ((X)->sh_name >= string_table_length \ - ? "" : string_table + (X)->sh_name)) +#define SECTION_NAME(X) \ + ((X) == NULL ? "" \ + : string_table == NULL ? "" \ + : ((X)->sh_name >= string_table_length ? "" \ + : string_table + (X)->sh_name)) /* Given st_shndx I, map to section_headers index. */ #define SECTION_HEADER_INDEX(I) \ @@ -260,6 +303,7 @@ static void (*byte_put) (unsigned char *, bfd_vma, int); /* This is just a bit of syntatic sugar. */ #define streq(a,b) (strcmp ((a), (b)) == 0) #define strneq(a,b,n) (strncmp ((a), (b), (n)) == 0) +#define const_strneq(a,b) (strncmp ((a), (b), sizeof (b) - 1) == 0) static void * get_data (void *var, FILE *file, long offset, size_t size, size_t nmemb, @@ -550,88 +594,91 @@ guess_is_rela (unsigned long e_machine) switch (e_machine) { /* Targets that use REL relocations. */ - case EM_ARM: case EM_386: case EM_486: case EM_960: - case EM_DLX: - case EM_OPENRISC: - case EM_OR32: - case EM_CYGNUS_M32R: + case EM_ARM: case EM_D10V: case EM_CYGNUS_D10V: + case EM_DLX: case EM_MIPS: case EM_MIPS_RS3_LE: + case EM_CYGNUS_M32R: + case EM_OPENRISC: + case EM_OR32: + case EM_SCORE: return FALSE; /* Targets that use RELA relocations. */ case EM_68K: - case EM_H8_300: - case EM_H8_300H: - case EM_H8S: - case EM_SPARC32PLUS: - case EM_SPARCV9: - case EM_SPARC: - case EM_PPC: - case EM_PPC64: - case EM_V850: - case EM_CYGNUS_V850: + case EM_860: + case EM_ALPHA: + case EM_ALTERA_NIOS2: + case EM_AVR: + case EM_AVR_OLD: + case EM_BLACKFIN: + case EM_CRIS: + case EM_CRX: case EM_D30V: case EM_CYGNUS_D30V: + case EM_FR30: + case EM_CYGNUS_FR30: + case EM_CYGNUS_FRV: + case EM_H8S: + case EM_H8_300: + case EM_H8_300H: + case EM_IA_64: + case EM_IP2K: + case EM_IP2K_OLD: + case EM_IQ2000: + case EM_M32C: + case EM_M32R: + case EM_MCORE: + case EM_CYGNUS_MEP: + case EM_MMIX: case EM_MN10200: case EM_CYGNUS_MN10200: case EM_MN10300: case EM_CYGNUS_MN10300: - case EM_FR30: - case EM_CYGNUS_FR30: - case EM_CYGNUS_FRV: - case EM_SH: - case EM_ALPHA: - case EM_MCORE: - case EM_IA_64: - case EM_AVR: - case EM_AVR_OLD: - case EM_CRIS: - case EM_860: - case EM_X86_64: - case EM_S390: - case EM_S390_OLD: - case EM_MMIX: case EM_MSP430: case EM_MSP430_OLD: - case EM_XSTORMY16: - case EM_CRX: + case EM_MT: + case EM_NIOS32: + case EM_PPC64: + case EM_PPC: + case EM_S390: + case EM_S390_OLD: + case EM_SH: + case EM_SPARC: + case EM_SPARC32PLUS: + case EM_SPARCV9: + case EM_SPU: + case EM_V850: + case EM_CYGNUS_V850: case EM_VAX: - case EM_IP2K: - case EM_IP2K_OLD: - case EM_IQ2000: + case EM_X86_64: + case EM_XSTORMY16: case EM_XTENSA: case EM_XTENSA_OLD: - case EM_M32R: - case EM_M32C: - case EM_MT: - case EM_BLACKFIN: - case EM_NIOS32: - case EM_ALTERA_NIOS2: return TRUE; + case EM_68HC05: + case EM_68HC08: + case EM_68HC11: + case EM_68HC16: + case EM_FX66: + case EM_ME16: case EM_MMA: - case EM_PCP: case EM_NCPU: case EM_NDR1: - case EM_STARCORE: - case EM_ME16: + case EM_PCP: case EM_ST100: - case EM_TINYJ: - case EM_FX66: - case EM_ST9PLUS: - case EM_ST7: - case EM_68HC16: - case EM_68HC11: - case EM_68HC08: - case EM_68HC05: - case EM_SVX: case EM_ST19: + case EM_ST7: + case EM_ST9PLUS: + case EM_STARCORE: + case EM_SVX: + case EM_TINYJ: default: warn (_("Don't know about relocations on this machine architecture\n")); return FALSE; @@ -664,7 +711,7 @@ slurp_rela_relocs (FILE *file, if (relas == NULL) { free (erelas); - error (_("out of memory parsing relocs")); + error (_("out of memory parsing relocs\n")); return 0; } @@ -692,7 +739,7 @@ slurp_rela_relocs (FILE *file, if (relas == NULL) { free (erelas); - error (_("out of memory parsing relocs")); + error (_("out of memory parsing relocs\n")); return 0; } @@ -736,7 +783,7 @@ slurp_rel_relocs (FILE *file, if (rels == NULL) { free (erels); - error (_("out of memory parsing relocs")); + error (_("out of memory parsing relocs\n")); return 0; } @@ -764,7 +811,7 @@ slurp_rel_relocs (FILE *file, if (rels == NULL) { free (erels); - error (_("out of memory parsing relocs")); + error (_("out of memory parsing relocs\n")); return 0; } @@ -966,6 +1013,10 @@ dump_relocations (FILE *file, rtype = elf_sparc_reloc_type (type); break; + case EM_SPU: + rtype = elf_spu_reloc_type (type); + break; + case EM_V850: case EM_CYGNUS_V850: rtype = v850_reloc_type (type); @@ -1095,6 +1146,10 @@ dump_relocations (FILE *file, rtype = elf_s390_reloc_type (type); break; + case EM_SCORE: + rtype = elf_score_reloc_type (type); + break; + case EM_XSTORMY16: rtype = elf_xstormy16_reloc_type (type); break; @@ -1133,6 +1188,9 @@ dump_relocations (FILE *file, rtype = elf_bfin_reloc_type (type); break; + case EM_CYGNUS_MEP: + rtype = elf_mep_reloc_type (type); + break; } if (rtype == NULL) @@ -1145,6 +1203,7 @@ dump_relocations (FILE *file, printf (do_wide ? "%-22.22s" : "%-17.17s", rtype); if (elf_header.e_machine == EM_ALPHA + && rtype != NULL && streq (rtype, "R_ALPHA_LITUSE") && is_rela) { @@ -1203,6 +1262,12 @@ dump_relocations (FILE *file, sec_name = "ABS"; else if (psym->st_shndx == SHN_COMMON) sec_name = "COMMON"; + else if (elf_header.e_machine == EM_MIPS + && psym->st_shndx == SHN_MIPS_SCOMMON) + sec_name = "SCOMMON"; + else if (elf_header.e_machine == EM_MIPS + && psym->st_shndx == SHN_MIPS_SUNDEFINED) + sec_name = "SUNDEF"; else if (elf_header.e_machine == EM_X86_64 && psym->st_shndx == SHN_X86_64_LCOMMON) sec_name = "LARGE_COMMON"; @@ -1237,7 +1302,9 @@ dump_relocations (FILE *file, print_vma (rels[i].r_addend, LONG_HEX); } - if (elf_header.e_machine == EM_SPARCV9 && streq (rtype, "R_SPARC_OLO10")) + if (elf_header.e_machine == EM_SPARCV9 + && rtype != NULL + && streq (rtype, "R_SPARC_OLO10")) printf (" + %lx", (unsigned long) ELF64_R_TYPE_DATA (info)); putchar ('\n'); @@ -1419,6 +1486,23 @@ get_alpha_dynamic_type (unsigned long type) } } +static const char * +get_score_dynamic_type (unsigned long type) +{ + switch (type) + { + case DT_SCORE_BASE_ADDRESS: return "SCORE_BASE_ADDRESS"; + case DT_SCORE_LOCAL_GOTNO: return "SCORE_LOCAL_GOTNO"; + case DT_SCORE_SYMTABNO: return "SCORE_SYMTABNO"; + case DT_SCORE_GOTSYM: return "SCORE_GOTSYM"; + case DT_SCORE_UNREFEXTNO: return "SCORE_UNREFEXTNO"; + case DT_SCORE_HIPAGENO: return "SCORE_HIPAGENO"; + default: + return NULL; + } +} + + static const char * get_dynamic_type (unsigned long type) { @@ -1499,6 +1583,7 @@ get_dynamic_type (unsigned long type) case DT_GNU_CONFLICTSZ: return "GNU_CONFLICTSZ"; case DT_GNU_LIBLIST: return "GNU_LIBLIST"; case DT_GNU_LIBLISTSZ: return "GNU_LIBLISTSZ"; + case DT_GNU_HASH: return "GNU_HASH"; default: if ((type >= DT_LOPROC) && (type <= DT_HIPROC)) @@ -1526,6 +1611,9 @@ get_dynamic_type (unsigned long type) case EM_ALPHA: result = get_alpha_dynamic_type (type); break; + case EM_SCORE: + result = get_score_dynamic_type (type); + break; default: result = NULL; break; @@ -1599,6 +1687,7 @@ get_machine_name (unsigned e_machine) case EM_NONE: return _("None"); case EM_M32: return "WE32100"; case EM_SPARC: return "Sparc"; + case EM_SPU: return "SPU"; case EM_386: return "Intel 80386"; case EM_68K: return "MC68000"; case EM_88K: return "MC88000"; @@ -1680,6 +1769,7 @@ get_machine_name (unsigned e_machine) case EM_X86_64: return "Advanced Micro Devices X86-64"; case EM_S390_OLD: case EM_S390: return "IBM S/390"; + case EM_SCORE: return "SUNPLUS S+Core"; case EM_XSTORMY16: return "Sanyo Xstormy16 CPU core"; case EM_OPENRISC: case EM_OR32: return "OpenRISC"; @@ -1696,8 +1786,9 @@ get_machine_name (unsigned e_machine) case EM_NIOS32: return "Altera Nios"; case EM_ALTERA_NIOS2: return "Altera Nios II"; case EM_XC16X: return "Infineon Technologies xc16x"; + case EM_CYGNUS_MEP: return "Toshiba MeP Media Engine"; default: - snprintf (buff, sizeof (buff), _(": %x"), e_machine); + snprintf (buff, sizeof (buff), _(": 0x%x"), e_machine); return buff; } } @@ -1946,33 +2037,35 @@ get_machine_flags (unsigned e_flags, unsigned e_machine) break; case EM_68K: - if (e_flags & EF_M68K_CPU32) - strcat (buf, ", cpu32"); - if (e_flags & EF_M68K_M68000) + if ((e_flags & EF_M68K_ARCH_MASK) == EF_M68K_M68000) strcat (buf, ", m68000"); - if (e_flags & EF_M68K_ISA_MASK) + else if ((e_flags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32) + strcat (buf, ", cpu32"); + else if ((e_flags & EF_M68K_ARCH_MASK) == EF_M68K_FIDO) + strcat (buf, ", fido_a"); + else { char const *isa = _("unknown"); char const *mac = _("unknown mac"); char const *additional = NULL; - - switch (e_flags & EF_M68K_ISA_MASK) + + switch (e_flags & EF_M68K_CF_ISA_MASK) { - case EF_M68K_ISA_A_NODIV: + case EF_M68K_CF_ISA_A_NODIV: isa = "A"; additional = ", nodiv"; break; - case EF_M68K_ISA_A: + case EF_M68K_CF_ISA_A: isa = "A"; break; - case EF_M68K_ISA_A_PLUS: + case EF_M68K_CF_ISA_A_PLUS: isa = "A+"; break; - case EF_M68K_ISA_B_NOUSP: + case EF_M68K_CF_ISA_B_NOUSP: isa = "B"; additional = ", nousp"; break; - case EF_M68K_ISA_B: + case EF_M68K_CF_ISA_B: isa = "B"; break; } @@ -1980,17 +2073,17 @@ get_machine_flags (unsigned e_flags, unsigned e_machine) strcat (buf, isa); if (additional) strcat (buf, additional); - if (e_flags & EF_M68K_FLOAT) + if (e_flags & EF_M68K_CF_FLOAT) strcat (buf, ", float"); - switch (e_flags & EF_M68K_MAC_MASK) + switch (e_flags & EF_M68K_CF_MAC_MASK) { case 0: mac = NULL; break; - case EF_M68K_MAC: + case EF_M68K_CF_MAC: mac = "mac"; break; - case EF_M68K_EMAC: + case EF_M68K_CF_EMAC: mac = "emac"; break; } @@ -2036,7 +2129,6 @@ get_machine_flags (unsigned e_flags, unsigned e_machine) case EM_CYGNUS_M32R: if ((e_flags & EF_M32R_ARCH) == E_M32R_ARCH) strcat (buf, ", m32r"); - break; case EM_MIPS: @@ -2569,6 +2661,7 @@ get_section_type_name (unsigned int sh_type) case SHT_INIT_ARRAY: return "INIT_ARRAY"; case SHT_FINI_ARRAY: return "FINI_ARRAY"; case SHT_PREINIT_ARRAY: return "PREINIT_ARRAY"; + case SHT_GNU_HASH: return "GNU_HASH"; case SHT_GROUP: return "GROUP"; case SHT_SYMTAB_SHNDX: return "SYMTAB SECTION INDICIES"; case SHT_GNU_verdef: return "VERDEF"; @@ -2661,11 +2754,11 @@ static struct option options[] = }; static void -usage (void) +usage (FILE *stream) { - fprintf (stdout, _("Usage: readelf elf-file(s)\n")); - fprintf (stdout, _(" Display information about the contents of ELF format files\n")); - fprintf (stdout, _(" Options are:\n\ + fprintf (stream, _("Usage: readelf elf-file(s)\n")); + fprintf (stream, _(" Display information about the contents of ELF format files\n")); + fprintf (stream, _(" Options are:\n\ -a --all Equivalent to: -h -l -S -s -r -d -V -A -I\n\ -h --file-header Display the ELF file header\n\ -l --program-headers Display the program headers\n\ @@ -2689,19 +2782,21 @@ usage (void) --debug-dump[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=str,=loc,=Ranges]\n\ Display the contents of DWARF2 debug sections\n")); #ifdef SUPPORT_DISASSEMBLY - fprintf (stdout, _("\ + fprintf (stream, _("\ -i --instruction-dump=\n\ Disassemble the contents of section \n")); #endif - fprintf (stdout, _("\ + fprintf (stream, _("\ -I --histogram Display histogram of bucket list lengths\n\ -W --wide Allow output width to exceed 80 characters\n\ @ Read options from \n\ -H --help Display this information\n\ -v --version Display the version number of readelf\n")); - fprintf (stdout, _("Report bugs to %s\n"), REPORT_BUGS_TO); + + if (REPORT_BUGS_TO[0] && stream == stdout) + fprintf (stdout, _("Report bugs to %s\n"), REPORT_BUGS_TO); - exit (0); + exit (stream == stdout ? 0 : 1); } /* Record the fact that the user wants the contents of section number @@ -2719,7 +2814,7 @@ request_dump (unsigned int section, int type) new_dump_sects = calloc (section + 1, 1); if (new_dump_sects == NULL) - error (_("Out of memory allocating dump request table.")); + error (_("Out of memory allocating dump request table.\n")); else { /* Copy current flag settings. */ @@ -2747,11 +2842,11 @@ request_dump_byname (const char *section, int type) new_request = malloc (sizeof (struct dump_list_entry)); if (!new_request) - error (_("Out of memory allocating dump request table.")); + error (_("Out of memory allocating dump request table.\n")); new_request->name = strdup (section); if (!new_request->name) - error (_("Out of memory allocating dump request table.")); + error (_("Out of memory allocating dump request table.\n")); new_request->type = type; @@ -2765,7 +2860,7 @@ parse_args (int argc, char **argv) int c; if (argc < 2) - usage (); + usage (stderr); while ((c = getopt_long (argc, argv, "ersuahnldSDAINtgw::x:i:vVWH", options, NULL)) != EOF) @@ -2779,7 +2874,7 @@ parse_args (int argc, char **argv) /* Long options. */ break; case 'H': - usage (); + usage (stdout); break; case 'a': @@ -3020,7 +3115,7 @@ parse_args (int argc, char **argv) error (_("Invalid option '-%c'\n"), c); /* Drop through. */ case '?': - usage (); + usage (stderr); } } @@ -3028,11 +3123,11 @@ parse_args (int argc, char **argv) && !do_segments && !do_header && !do_dump && !do_version && !do_histogram && !do_debugging && !do_arch && !do_notes && !do_section_groups) - usage (); + usage (stderr); else if (argc < 3) { warn (_("Nothing to do.\n")); - usage (); + usage (stderr); } } @@ -3142,6 +3237,11 @@ process_file_header (void) (long) elf_header.e_shstrndx); if (section_headers != NULL && elf_header.e_shstrndx == SHN_XINDEX) printf (" (%ld)", (long) section_headers[0].sh_link); + else if (elf_header.e_shstrndx != SHN_UNDEF + && (elf_header.e_shstrndx >= elf_header.e_shnum + || (elf_header.e_shstrndx >= SHN_LORESERVE + && elf_header.e_shstrndx <= SHN_HIRESERVE))) + printf (" "); putc ('\n', stdout); } @@ -3151,6 +3251,11 @@ process_file_header (void) elf_header.e_shnum = section_headers[0].sh_size; if (elf_header.e_shstrndx == SHN_XINDEX) elf_header.e_shstrndx = section_headers[0].sh_link; + else if (elf_header.e_shstrndx != SHN_UNDEF + && (elf_header.e_shstrndx >= elf_header.e_shnum + || (elf_header.e_shstrndx >= SHN_LORESERVE + && elf_header.e_shstrndx <= SHN_HIRESERVE))) + elf_header.e_shstrndx = SHN_UNDEF; free (section_headers); section_headers = NULL; } @@ -3407,18 +3512,21 @@ process_program_headers (FILE *file) sec = find_section (".dynamic"); if (sec == NULL || sec->sh_size == 0) { - error (_("no .dynamic section in the dynamic segment")); + error (_("no .dynamic section in the dynamic segment\n")); break; } + if (sec->sh_type == SHT_NOBITS) + break; + dynamic_addr = sec->sh_offset; dynamic_size = sec->sh_size; if (dynamic_addr < segment->p_offset || dynamic_addr > segment->p_offset + segment->p_filesz) - warn (_("the .dynamic section is not contained within the dynamic segment")); + warn (_("the .dynamic section is not contained within the dynamic segment\n")); else if (dynamic_addr > segment->p_offset) - warn (_("the .dynamic section is not the first section in the dynamic segment.")); + warn (_("the .dynamic section is not the first section in the dynamic segment.\n")); } else { @@ -3435,8 +3543,15 @@ process_program_headers (FILE *file) error (_("Unable to find program interpreter name\n")); else { + char fmt [32]; + int ret = snprintf (fmt, sizeof (fmt), "%%%ds", PATH_MAX); + + if (ret >= (int) sizeof (fmt) || ret < 0) + error (_("Internal error: failed to create format string to display program interpreter\n")); + program_interpreter[0] = 0; - fscanf (file, "%63s", program_interpreter); + if (fscanf (file, fmt, program_interpreter) <= 0) + error (_("Unable to read program interpreter name\n")); if (do_segments) printf (_("\n [Requesting program interpreter: %s]"), @@ -3920,7 +4035,8 @@ process_section_headers (FILE *file) return 0; /* Read in the string table, so that we have names to display. */ - if (SECTION_HEADER_INDEX (elf_header.e_shstrndx) < elf_header.e_shnum) + if (elf_header.e_shstrndx != SHN_UNDEF + && SECTION_HEADER_INDEX (elf_header.e_shstrndx) < elf_header.e_shnum) { section = SECTION_HEADER (elf_header.e_shstrndx); @@ -3958,6 +4074,23 @@ process_section_headers (FILE *file) && find_section (".gcc_compiled_long32") == NULL) eh_addr_size = 8; break; + + case EM_H8_300: + case EM_H8_300H: + switch (elf_header.e_flags & EF_H8_MACH) + { + case E_H8_MACH_H8300: + case E_H8_MACH_H8300HN: + case E_H8_MACH_H8300SN: + case E_H8_MACH_H8300SXN: + eh_addr_size = 2; + break; + case E_H8_MACH_H8300H: + case E_H8_MACH_H8300S: + case E_H8_MACH_H8300SX: + eh_addr_size = 4; + break; + } } #define CHECK_ENTSIZE_VALUES(section, i, size32, size64) \ @@ -4028,7 +4161,7 @@ process_section_headers (FILE *file) || do_debug_lines || do_debug_pubnames || do_debug_aranges || do_debug_frames || do_debug_macinfo || do_debug_str || do_debug_loc || do_debug_ranges) - && strneq (name, ".debug_", 7)) + && const_strneq (name, ".debug_")) { name += 7; @@ -4048,7 +4181,7 @@ process_section_headers (FILE *file) } /* linkonce section to be combined with .debug_info at link time. */ else if ((do_debugging || do_debug_info) - && strneq (name, ".gnu.linkonce.wi.", 17)) + && const_strneq (name, ".gnu.linkonce.wi.")) request_dump (i, DEBUG_DUMP); else if (do_debug_frames && streq (name, ".eh_frame")) request_dump (i, DEBUG_DUMP); @@ -4884,7 +5017,7 @@ slurp_ia64_unwind_table (FILE *file, sym = aux->symtab + ELF64_R_SYM (rp->r_info); } - if (! strneq (relname, "R_IA64_SEGREL", 13)) + if (! const_strneq (relname, "R_IA64_SEGREL")) { warn (_("Skipping unexpected relocation type %s\n"), relname); continue; @@ -5297,7 +5430,7 @@ slurp_hppa_unwind_table (FILE *file, } /* R_PARISC_SEGREL32 or R_PARISC_SEGREL64. */ - if (strncmp (relname, "R_PARISC_SEGREL", 15) != 0) + if (! const_strneq (relname, "R_PARISC_SEGREL")) { warn (_("Skipping unexpected relocation type %s\n"), relname); continue; @@ -5735,7 +5868,7 @@ process_dynamic_section (FILE *file) else { if (fseek (file, 0, SEEK_END)) - error (_("Unable to seek to end of file!")); + error (_("Unable to seek to end of file!\n")); section.sh_size = ftell (file) - section.sh_offset; } @@ -6215,6 +6348,15 @@ process_dynamic_section (FILE *file) } break; + case DT_GNU_HASH: + dynamic_info_DT_GNU_HASH = entry->d_un.d_val; + if (do_dynamic) + { + print_vma (entry->d_un.d_val, PREFIX_HEX); + putchar ('\n'); + } + break; + default: if ((entry->d_tag >= DT_VERSYM) && (entry->d_tag <= DT_VERNEEDNUM)) version_info[DT_VERSIONTAGIDX (entry->d_tag)] = @@ -6732,6 +6874,8 @@ get_symbol_type (unsigned int type) case STT_FILE: return "FILE"; case STT_COMMON: return "COMMON"; case STT_TLS: return "TLS"; + case STT_RELC: return "RELC"; + case STT_SRELC: return "SRELC"; default: if (type >= STT_LOPROC && type <= STT_HIPROC) { @@ -6830,6 +6974,12 @@ get_symbol_index_type (unsigned int type) else if (elf_header.e_machine == EM_X86_64 && type == SHN_X86_64_LCOMMON) return "LARGE_COM"; + else if (type == SHN_MIPS_SCOMMON + && elf_header.e_machine == EM_MIPS) + return "SCOM"; + else if (type == SHN_MIPS_SUNDEFINED + && elf_header.e_machine == EM_MIPS) + return "SUND"; else if (type >= SHN_LOPROC && type <= SHN_HIPROC) sprintf (buff, "PRC[0x%04x]", type); else if (type >= SHN_LOOS && type <= SHN_HIOS) @@ -6890,6 +7040,9 @@ process_symbol_table (FILE *file) bfd_vma nchains = 0; bfd_vma *buckets = NULL; bfd_vma *chains = NULL; + bfd_vma ngnubuckets = 0; + bfd_vma *gnubuckets = NULL; + bfd_vma *gnuchains = NULL; if (! do_syms && !do_histogram) return 1; @@ -6913,7 +7066,7 @@ process_symbol_table (FILE *file) sizeof nb + sizeof nc)), SEEK_SET)) { - error (_("Unable to seek to start of dynamic information")); + error (_("Unable to seek to start of dynamic information\n")); return 0; } @@ -7139,7 +7292,7 @@ process_symbol_table (FILE *file) check_def = 0; } else if (! is_nobits) - error (_("bad dynamic symbol")); + error (_("bad dynamic symbol\n")); else check_def = 1; } @@ -7222,7 +7375,7 @@ process_symbol_table (FILE *file) lengths = calloc (nbuckets, sizeof (*lengths)); if (lengths == NULL) { - error (_("Out of memory")); + error (_("Out of memory\n")); return 0; } for (hn = 0; hn < nbuckets; ++hn) @@ -7238,7 +7391,7 @@ process_symbol_table (FILE *file) counts = calloc (maxlength + 1, sizeof (*counts)); if (counts == NULL) { - error (_("Out of memory")); + error (_("Out of memory\n")); return 0; } @@ -7269,6 +7422,166 @@ process_symbol_table (FILE *file) free (chains); } + if (do_histogram && dynamic_info_DT_GNU_HASH) + { + unsigned char nb[16]; + bfd_vma i, maxchain = 0xffffffff, symidx, bitmaskwords; + unsigned long *lengths; + unsigned long *counts; + unsigned long hn; + unsigned long maxlength = 0; + unsigned long nzero_counts = 0; + unsigned long nsyms = 0; + bfd_vma buckets_vma; + + if (fseek (file, + (archive_file_offset + + offset_from_vma (file, dynamic_info_DT_GNU_HASH, + sizeof nb)), + SEEK_SET)) + { + error (_("Unable to seek to start of dynamic information\n")); + return 0; + } + + if (fread (nb, 16, 1, file) != 1) + { + error (_("Failed to read in number of buckets\n")); + return 0; + } + + ngnubuckets = byte_get (nb, 4); + symidx = byte_get (nb + 4, 4); + bitmaskwords = byte_get (nb + 8, 4); + buckets_vma = dynamic_info_DT_GNU_HASH + 16; + if (is_32bit_elf) + buckets_vma += bitmaskwords * 4; + else + buckets_vma += bitmaskwords * 8; + + if (fseek (file, + (archive_file_offset + + offset_from_vma (file, buckets_vma, 4)), + SEEK_SET)) + { + error (_("Unable to seek to start of dynamic information\n")); + return 0; + } + + gnubuckets = get_dynamic_data (file, ngnubuckets, 4); + + if (gnubuckets == NULL) + return 0; + + for (i = 0; i < ngnubuckets; i++) + if (gnubuckets[i] != 0) + { + if (gnubuckets[i] < symidx) + return 0; + + if (maxchain == 0xffffffff || gnubuckets[i] > maxchain) + maxchain = gnubuckets[i]; + } + + if (maxchain == 0xffffffff) + return 0; + + maxchain -= symidx; + + if (fseek (file, + (archive_file_offset + + offset_from_vma (file, buckets_vma + + 4 * (ngnubuckets + maxchain), 4)), + SEEK_SET)) + { + error (_("Unable to seek to start of dynamic information\n")); + return 0; + } + + do + { + if (fread (nb, 4, 1, file) != 1) + { + error (_("Failed to determine last chain length\n")); + return 0; + } + + if (maxchain + 1 == 0) + return 0; + + ++maxchain; + } + while ((byte_get (nb, 4) & 1) == 0); + + if (fseek (file, + (archive_file_offset + + offset_from_vma (file, buckets_vma + 4 * ngnubuckets, 4)), + SEEK_SET)) + { + error (_("Unable to seek to start of dynamic information\n")); + return 0; + } + + gnuchains = get_dynamic_data (file, maxchain, 4); + + if (gnuchains == NULL) + return 0; + + lengths = calloc (ngnubuckets, sizeof (*lengths)); + if (lengths == NULL) + { + error (_("Out of memory\n")); + return 0; + } + + printf (_("\nHistogram for `.gnu.hash' bucket list length (total of %lu buckets):\n"), + (unsigned long) ngnubuckets); + printf (_(" Length Number %% of total Coverage\n")); + + for (hn = 0; hn < ngnubuckets; ++hn) + if (gnubuckets[hn] != 0) + { + bfd_vma off, length = 1; + + for (off = gnubuckets[hn] - symidx; + (gnuchains[off] & 1) == 0; ++off) + ++length; + lengths[hn] = length; + if (length > maxlength) + maxlength = length; + nsyms += length; + } + + counts = calloc (maxlength + 1, sizeof (*counts)); + if (counts == NULL) + { + error (_("Out of memory\n")); + return 0; + } + + for (hn = 0; hn < ngnubuckets; ++hn) + ++counts[lengths[hn]]; + + if (ngnubuckets > 0) + { + unsigned long j; + printf (" 0 %-10lu (%5.1f%%)\n", + counts[0], (counts[0] * 100.0) / ngnubuckets); + for (j = 1; j <= maxlength; ++j) + { + nzero_counts += counts[j] * j; + printf ("%7lu %-10lu (%5.1f%%) %5.1f%%\n", + j, counts[j], (counts[j] * 100.0) / ngnubuckets, + (nzero_counts * 100.0) / nsyms); + } + } + + free (counts); + free (lengths); + free (gnubuckets); + free (gnuchains); + } + return 1; } @@ -7354,6 +7667,7 @@ disassemble_section (Elf_Internal_Shdr *section, FILE *file) static int dump_section (Elf_Internal_Shdr *section, FILE *file) { + Elf_Internal_Shdr *relsec; bfd_size_type bytes; bfd_vma addr; unsigned char *data; @@ -7377,6 +7691,26 @@ dump_section (Elf_Internal_Shdr *section, FILE *file) if (!start) return 0; + /* If the section being dumped has relocations against it the user might + be expecting these relocations to have been applied. Check for this + case and issue a warning message in order to avoid confusion. + FIXME: Maybe we ought to have an option that dumps a section with + relocs applied ? */ + for (relsec = section_headers; + relsec < section_headers + elf_header.e_shnum; + ++relsec) + { + if ((relsec->sh_type != SHT_RELA && relsec->sh_type != SHT_REL) + || SECTION_HEADER_INDEX (relsec->sh_info) >= elf_header.e_shnum + || SECTION_HEADER (relsec->sh_info) != section + || relsec->sh_size == 0 + || SECTION_HEADER_INDEX (relsec->sh_link) >= elf_header.e_shnum) + continue; + + printf (_(" NOTE: This section has relocations against it, but these have NOT been applied to this dump.\n")); + break; + } + data = start; while (bytes) @@ -7389,34 +7723,15 @@ dump_section (Elf_Internal_Shdr *section, FILE *file) printf (" 0x%8.8lx ", (unsigned long) addr); - switch (elf_header.e_ident[EI_DATA]) + for (j = 0; j < 16; j++) { - default: - case ELFDATA2LSB: - for (j = 15; j >= 0; j --) - { - if (j < lbytes) - printf ("%2.2x", data[j]); - else - printf (" "); + if (j < lbytes) + printf ("%2.2x", data[j]); + else + printf (" "); - if (!(j & 0x3)) - printf (" "); - } - break; - - case ELFDATA2MSB: - for (j = 0; j < 16; j++) - { - if (j < lbytes) - printf ("%2.2x", data[j]); - else - printf (" "); - - if ((j & 3) == 3) - printf (" "); - } - break; + if ((j & 3) == 3) + printf (" "); } for (j = 0; j < lbytes; j++) @@ -7437,9 +7752,47 @@ dump_section (Elf_Internal_Shdr *section, FILE *file) free (start); + putchar ('\n'); return 1; } +/* Return the number of bytes affected by a given reloc. + This information is architecture and reloc dependent. + Returns 4 by default, although this is not always correct. + It should return 0 if a decision cannot be made. + FIXME: This is not the correct way to solve this problem. + The proper way is to have target specific reloc sizing functions + created by the reloc-macros.h header, in the same way that it + already creates the reloc naming functions. */ + +static unsigned int +get_reloc_size (Elf_Internal_Rela * reloc) +{ + switch (elf_header.e_machine) + { + case EM_H8S: + case EM_H8_300: + case EM_H8_300H: + case EM_H8_500: + switch (ELF32_R_TYPE (reloc->r_info)) + { + /* PR gas/3800 - without this information we do not correctly + decode the debug information generated by the h8300 assembler. */ + case R_H8_DIR16: + return 2; + default: + return 4; + } + default: + /* FIXME: We need to extend this switch statement to cope with other + architecture's relocs. (When those relocs are used against debug + sections, and when their size is not 4). But see the multiple + inclusions of for an example of the hoops that we need + to jump through in order to obtain the reloc numbers. */ + return 4; + } +} + /* Apply addends of RELA relocations. */ static int @@ -7449,14 +7802,13 @@ debug_apply_rela_addends (void *file, { Elf_Internal_Shdr *relsec; unsigned char *end = start + section->sh_size; - /* FIXME: The relocation field size is relocation type dependent. */ - unsigned int reloc_size = 4; if (!is_relocatable) return 1; - if (section->sh_size < reloc_size) - return 1; + /* SH uses RELA but uses in place value instead of the addend field. */ + if (elf_header.e_machine == EM_SH) + return 0; for (relsec = section_headers; relsec < section_headers + elf_header.e_shnum; @@ -7485,6 +7837,16 @@ debug_apply_rela_addends (void *file, for (rp = rela; rp < rela + nrelas; ++rp) { unsigned char *loc; + unsigned int reloc_size; + + reloc_size = get_reloc_size (rp); + if (reloc_size == 0) + { + warn (_("skipping relocation of unknown size against offset 0x%lx in section %s\n"), + (unsigned long) rp->r_offset, + SECTION_NAME (section)); + continue; + } loc = start + rp->r_offset; if ((loc + reloc_size) > end) @@ -7501,6 +7863,10 @@ debug_apply_rela_addends (void *file, if (ELF32_R_SYM (rp->r_info) != 0 && ELF32_ST_TYPE (sym->st_info) != STT_SECTION + /* Relocations against symbols without type can happen. + Gcc -feliminate-dwarf2-dups may generate symbols + without type for debug info. */ + && ELF32_ST_TYPE (sym->st_info) != STT_NOTYPE /* Relocations against object symbols can happen, eg when referencing a global array. For an example of this see the _clz.o binary in libgcc.a. */ @@ -7530,6 +7896,7 @@ debug_apply_rela_addends (void *file, if (ELF64_R_SYM (rp->r_info) != 0 && ELF64_ST_TYPE (sym->st_info) != STT_SECTION + && ELF64_ST_TYPE (sym->st_info) != STT_NOTYPE && ELF64_ST_TYPE (sym->st_info) != STT_OBJECT) { warn (_("skipping unexpected symbol type %s in relocation in section .rela.%s\n"), @@ -7606,7 +7973,7 @@ display_debug_section (Elf_Internal_Shdr *section, FILE *file) return 0; } - if (strneq (name, ".gnu.linkonce.wi.", 17)) + if (const_strneq (name, ".gnu.linkonce.wi.")) name = ".debug_info"; /* See if we know how to display the contents of this section. */ @@ -7731,7 +8098,8 @@ static const char *arm_attr_tag_CPU_arch[] = static const char *arm_attr_tag_ARM_ISA_use[] = {"No", "Yes"}; static const char *arm_attr_tag_THUMB_ISA_use[] = {"No", "Thumb-1", "Thumb-2"}; -static const char *arm_attr_tag_VFP_arch[] = {"No", "VFPv1", "VFPv2"}; +/* FIXME: VFPv3 encoding was extrapolated! */ +static const char *arm_attr_tag_VFP_arch[] = {"No", "VFPv1", "VFPv2", "VFPv3"}; static const char *arm_attr_tag_WMMX_arch[] = {"No", "WMMXv1"}; static const char *arm_attr_tag_NEON_arch[] = {"No", "NEONv1"}; static const char *arm_attr_tag_ABI_PCS_config[] = @@ -7929,8 +8297,166 @@ display_arm_attribute (unsigned char *p) return p; } + +static unsigned char * +display_gnu_attribute (unsigned char *p, + unsigned char *(*display_proc_gnu_attribute) + (unsigned char *, int)) +{ + int tag; + unsigned int len; + int val; + int type; + + tag = read_uleb128 (p, &len); + p += len; + + /* Tag_compatibility is the only generic GNU attribute defined at + present. */ + if (tag == 32) + { + val = read_uleb128 (p, &len); + p += len; + printf ("flag = %d, vendor = %s\n", val, p); + p += strlen((char *)p) + 1; + return p; + } + + if ((tag & 2) == 0 && display_proc_gnu_attribute) + return display_proc_gnu_attribute (p, tag); + + if (tag & 1) + type = 1; /* String. */ + else + type = 2; /* uleb128. */ + printf (" Tag_unknown_%d: ", tag); + + if (type == 1) + { + printf ("\"%s\"\n", p); + p += strlen ((char *)p) + 1; + } + else + { + val = read_uleb128 (p, &len); + p += len; + printf ("%d (0x%x)\n", val, val); + } + + return p; +} + +static unsigned char * +display_power_gnu_attribute (unsigned char *p, int tag) +{ + int type; + unsigned int len; + int val; + + if (tag == Tag_GNU_Power_ABI_FP) + { + val = read_uleb128 (p, &len); + p += len; + printf (" Tag_GNU_Power_ABI_FP: "); + switch (val) + { + case 0: + printf ("Hard or soft float\n"); + break; + case 1: + printf ("Hard float\n"); + break; + case 2: + printf ("Soft float\n"); + break; + default: + printf ("??? (%d)\n", val); + break; + } + return p; + } + + if (tag & 1) + type = 1; /* String. */ + else + type = 2; /* uleb128. */ + printf (" Tag_unknown_%d: ", tag); + + if (type == 1) + { + printf ("\"%s\"\n", p); + p += strlen ((char *)p) + 1; + } + else + { + val = read_uleb128 (p, &len); + p += len; + printf ("%d (0x%x)\n", val, val); + } + + return p; +} + +static unsigned char * +display_mips_gnu_attribute (unsigned char *p, int tag) +{ + int type; + unsigned int len; + int val; + + if (tag == Tag_GNU_MIPS_ABI_FP) + { + val = read_uleb128 (p, &len); + p += len; + printf (" Tag_GNU_MIPS_ABI_FP: "); + switch (val) + { + case 0: + printf ("Hard or soft float\n"); + break; + case 1: + printf ("Hard float (-mdouble-float)\n"); + break; + case 2: + printf ("Hard float (-msingle-float)\n"); + break; + case 3: + printf ("Soft float\n"); + break; + default: + printf ("??? (%d)\n", val); + break; + } + return p; + } + + if (tag & 1) + type = 1; /* String. */ + else + type = 2; /* uleb128. */ + printf (" Tag_unknown_%d: ", tag); + + if (type == 1) + { + printf ("\"%s\"\n", p); + p += strlen ((char *)p) + 1; + } + else + { + val = read_uleb128 (p, &len); + p += len; + printf ("%d (0x%x)\n", val, val); + } + + return p; +} + static int -process_arm_specific (FILE *file) +process_attributes (FILE *file, const char *public_name, + unsigned int proc_type, + unsigned char *(*display_pub_attribute) (unsigned char *), + unsigned char *(*display_proc_gnu_attribute) + (unsigned char *, int)) { Elf_Internal_Shdr *sect; unsigned char *contents; @@ -7945,7 +8471,7 @@ process_arm_specific (FILE *file) i < elf_header.e_shnum; i++, sect++) { - if (sect->sh_type != SHT_ARM_ATTRIBUTES) + if (sect->sh_type != proc_type && sect->sh_type != SHT_GNU_ATTRIBUTES) continue; contents = get_data (NULL, file, sect->sh_offset, 1, sect->sh_size, @@ -7962,6 +8488,7 @@ process_arm_specific (FILE *file) { int namelen; bfd_boolean public_section; + bfd_boolean gnu_section; section_len = byte_get (p, 4); p += 4; @@ -7973,10 +8500,14 @@ process_arm_specific (FILE *file) } len -= section_len; printf ("Attribute Section: %s\n", p); - if (strcmp ((char *)p, "aeabi") == 0) + if (public_name && strcmp ((char *)p, public_name) == 0) public_section = TRUE; else public_section = FALSE; + if (strcmp ((char *)p, "gnu") == 0) + gnu_section = TRUE; + else + gnu_section = FALSE; namelen = strlen ((char *)p) + 1; p += namelen; section_len -= namelen + 4; @@ -8025,7 +8556,13 @@ process_arm_specific (FILE *file) if (public_section) { while (p < end) - p = display_arm_attribute(p); + p = display_pub_attribute (p); + } + else if (gnu_section) + { + while (p < end) + p = display_gnu_attribute (p, + display_proc_gnu_attribute); } else { @@ -8046,6 +8583,20 @@ process_arm_specific (FILE *file) return 1; } +static int +process_arm_specific (FILE *file) +{ + return process_attributes (file, "aeabi", SHT_ARM_ATTRIBUTES, + display_arm_attribute, NULL); +} + +static int +process_power_specific (FILE *file) +{ + return process_attributes (file, NULL, SHT_GNU_ATTRIBUTES, NULL, + display_power_gnu_attribute); +} + static int process_mips_specific (FILE *file) { @@ -8056,6 +8607,9 @@ process_mips_specific (FILE *file) size_t options_offset = 0; size_t conflicts_offset = 0; + process_attributes (file, NULL, SHT_GNU_ATTRIBUTES, NULL, + display_mips_gnu_attribute); + /* We have a lot of special sections. Thanks SGI! */ if (dynamic_section == NULL) /* No information available. */ @@ -8189,7 +8743,7 @@ process_mips_specific (FILE *file) iopt = cmalloc ((sect->sh_size / sizeof (eopt)), sizeof (*iopt)); if (iopt == NULL) { - error (_("Out of memory")); + error (_("Out of memory\n")); return 0; } @@ -8374,14 +8928,14 @@ process_mips_specific (FILE *file) if (dynamic_symbols == NULL) { - error (_("conflict list found without a dynamic symbol table")); + error (_("conflict list found without a dynamic symbol table\n")); return 0; } iconf = cmalloc (conflictsno, sizeof (*iconf)); if (iconf == NULL) { - error (_("Out of memory")); + error (_("Out of memory\n")); return 0; } @@ -8650,7 +9204,7 @@ process_note (Elf_Internal_Note *pnote) note type strings. */ nt = get_note_type (pnote->type); - else if (strneq (pnote->namedata, "NetBSD-CORE", 11)) + else if (const_strneq (pnote->namedata, "NetBSD-CORE")) /* NetBSD-specific core file notes. */ nt = get_netbsd_elfcore_note_type (pnote->type); @@ -8821,6 +9375,9 @@ process_arch_specific (FILE *file) case EM_MIPS_RS3_LE: return process_mips_specific (file); break; + case EM_PPC: + return process_power_specific (file); + break; default: break; } @@ -9098,7 +9655,7 @@ process_archive (char *file_name, FILE *file) return 1; } - if (memcmp (arhdr.ar_name, "/ ", 16) == 0) + if (const_strneq (arhdr.ar_name, "/ ")) { /* This is the archive symbol table. Skip it. FIXME: We should have an option to dump it. */ @@ -9120,7 +9677,7 @@ process_archive (char *file_name, FILE *file) } } - if (memcmp (arhdr.ar_name, "// ", 16) == 0) + if (const_strneq (arhdr.ar_name, "// ")) { /* This is the archive string table holding long member names. */ @@ -9338,7 +9895,7 @@ main (int argc, char **argv) /* Make a copy of the dump_sects array. */ cmdline_dump_sects = malloc (num_dump_sects); if (cmdline_dump_sects == NULL) - error (_("Out of memory allocating dump request table.")); + error (_("Out of memory allocating dump request table.\n")); else { memcpy (cmdline_dump_sects, dump_sects, num_dump_sects); diff --git a/binutils/rename.c b/binutils/rename.c index 7d21cb34c04..25329d14050 100644 --- a/binutils/rename.c +++ b/binutils/rename.c @@ -1,5 +1,5 @@ /* rename.c -- rename a file, preserving symlinks. - Copyright 1999, 2002, 2003 Free Software Foundation, Inc. + Copyright 1999, 2002, 2003, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -18,6 +18,7 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "sysdep.h" #include "bfd.h" #include "bucomm.h" diff --git a/binutils/resbin.c b/binutils/resbin.c index 80c2596a70b..7c8f5019641 100644 --- a/binutils/resbin.c +++ b/binutils/resbin.c @@ -1,7 +1,8 @@ /* resbin.c -- manipulate the Windows binary resource format. - Copyright 1997, 1998, 1999, 2002, 2003 + Copyright 1997, 1998, 1999, 2002, 2003, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. + Rewritten by Kai Tietz, Onevision. This file is part of GNU Binutils. @@ -24,102 +25,88 @@ format and the internal structures that we want to use. The same binary resource format is used in both res and COFF files. */ +#include "sysdep.h" #include "bfd.h" #include "bucomm.h" #include "libiberty.h" #include "windres.h" -/* Macros to swap in values. */ - -#define get_8(s) (*((unsigned char *)(s))) -#define get_16(be, s) ((be) ? bfd_getb16 (s) : bfd_getl16 (s)) -#define get_32(be, s) ((be) ? bfd_getb32 (s) : bfd_getl32 (s)) - /* Local functions. */ static void toosmall (const char *); -static unichar *get_unicode - (const unsigned char *, unsigned long, int, int *); -static int get_resid - (struct res_id *, const unsigned char *, unsigned long, int); -static struct res_resource *bin_to_res_generic - (enum res_type, const unsigned char *, unsigned long); -static struct res_resource *bin_to_res_cursor - (const unsigned char *, unsigned long, int); -static struct res_resource *bin_to_res_menu - (const unsigned char *, unsigned long, int); -static struct menuitem *bin_to_res_menuitems - (const unsigned char *, unsigned long, int, int *); -static struct menuitem *bin_to_res_menuexitems - (const unsigned char *, unsigned long, int, int *); -static struct res_resource *bin_to_res_dialog - (const unsigned char *, unsigned long, int); -static struct res_resource *bin_to_res_string - (const unsigned char *, unsigned long, int); -static struct res_resource *bin_to_res_fontdir - (const unsigned char *, unsigned long, int); -static struct res_resource *bin_to_res_accelerators - (const unsigned char *, unsigned long, int); -static struct res_resource *bin_to_res_rcdata - (const unsigned char *, unsigned long, int); -static struct res_resource *bin_to_res_group_cursor - (const unsigned char *, unsigned long, int); -static struct res_resource *bin_to_res_group_icon - (const unsigned char *, unsigned long, int); -static struct res_resource *bin_to_res_version - (const unsigned char *, unsigned long, int); -static struct res_resource *bin_to_res_userdata - (const unsigned char *, unsigned long, int); -static void get_version_header - (const unsigned char *, unsigned long, int, const char *, - unichar **, int *, int *, int *, int *); +static unichar *get_unicode (windres_bfd *, const bfd_byte *, rc_uint_type, rc_uint_type *); +static int get_resid (windres_bfd *, rc_res_id *, const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_generic (windres_bfd *, enum rc_res_type, + const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_cursor (windres_bfd *, const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_menu (windres_bfd *,const bfd_byte *, rc_uint_type); +static rc_menuitem *bin_to_res_menuitems (windres_bfd *, const bfd_byte *, rc_uint_type, + rc_uint_type *); +static rc_menuitem *bin_to_res_menuexitems (windres_bfd *, const bfd_byte *, rc_uint_type, + rc_uint_type *); +static rc_res_resource *bin_to_res_dialog (windres_bfd *, const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_string (windres_bfd *,const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_fontdir (windres_bfd *, const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_accelerators (windres_bfd *, const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_rcdata (windres_bfd *, const bfd_byte *, rc_uint_type, int); +static rc_res_resource *bin_to_res_group_cursor (windres_bfd *, const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_group_icon (windres_bfd *, const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_version (windres_bfd *, const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_userdata (windres_bfd *, const bfd_byte *, rc_uint_type); +static rc_res_resource *bin_to_res_toolbar (windres_bfd *, const bfd_byte *, rc_uint_type); +static void get_version_header (windres_bfd *, const bfd_byte *, rc_uint_type, const char *, + unichar **, rc_uint_type *, rc_uint_type *, rc_uint_type *, + rc_uint_type *); /* Given a resource type ID, a pointer to data, a length, return a - res_resource structure which represents that resource. The caller + rc_res_resource structure which represents that resource. The caller is responsible for initializing the res_info and coff_info fields of the returned structure. */ -struct res_resource * -bin_to_res (struct res_id type, const unsigned char *data, - unsigned long length, int big_endian) +rc_res_resource * +bin_to_res (windres_bfd *wrbfd, rc_res_id type, const bfd_byte *data, + rc_uint_type length) { if (type.named) - return bin_to_res_userdata (data, length, big_endian); + return bin_to_res_userdata (wrbfd, data, length); else { switch (type.u.id) { default: - return bin_to_res_userdata (data, length, big_endian); + return bin_to_res_userdata (wrbfd, data, length); case RT_CURSOR: - return bin_to_res_cursor (data, length, big_endian); + return bin_to_res_cursor (wrbfd, data, length); case RT_BITMAP: - return bin_to_res_generic (RES_TYPE_BITMAP, data, length); + return bin_to_res_generic (wrbfd, RES_TYPE_BITMAP, data, length); case RT_ICON: - return bin_to_res_generic (RES_TYPE_ICON, data, length); + return bin_to_res_generic (wrbfd, RES_TYPE_ICON, data, length); case RT_MENU: - return bin_to_res_menu (data, length, big_endian); + return bin_to_res_menu (wrbfd, data, length); case RT_DIALOG: - return bin_to_res_dialog (data, length, big_endian); + return bin_to_res_dialog (wrbfd, data, length); case RT_STRING: - return bin_to_res_string (data, length, big_endian); + return bin_to_res_string (wrbfd, data, length); case RT_FONTDIR: - return bin_to_res_fontdir (data, length, big_endian); + return bin_to_res_fontdir (wrbfd, data, length); case RT_FONT: - return bin_to_res_generic (RES_TYPE_FONT, data, length); + return bin_to_res_generic (wrbfd, RES_TYPE_FONT, data, length); case RT_ACCELERATOR: - return bin_to_res_accelerators (data, length, big_endian); + return bin_to_res_accelerators (wrbfd, data, length); case RT_RCDATA: - return bin_to_res_rcdata (data, length, big_endian); + return bin_to_res_rcdata (wrbfd, data, length, RES_TYPE_RCDATA); case RT_MESSAGETABLE: - return bin_to_res_generic (RES_TYPE_MESSAGETABLE, data, length); + return bin_to_res_generic (wrbfd, RES_TYPE_MESSAGETABLE, data, length); case RT_GROUP_CURSOR: - return bin_to_res_group_cursor (data, length, big_endian); + return bin_to_res_group_cursor (wrbfd, data, length); case RT_GROUP_ICON: - return bin_to_res_group_icon (data, length, big_endian); + return bin_to_res_group_icon (wrbfd, data, length); case RT_VERSION: - return bin_to_res_version (data, length, big_endian); + return bin_to_res_version (wrbfd, data, length); + case RT_TOOLBAR: + return bin_to_res_toolbar (wrbfd, data, length); + } } } @@ -135,18 +122,18 @@ toosmall (const char *msg) /* Swap in a NULL terminated unicode string. */ static unichar * -get_unicode (const unsigned char *data, unsigned long length, - int big_endian, int *retlen) +get_unicode (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length, + rc_uint_type *retlen) { - int c, i; + rc_uint_type c, i; unichar *ret; c = 0; while (1) { - if (length < (unsigned long) c * 2 + 2) + if (length < c * 2 + 2) toosmall (_("null terminated unicode string")); - if (get_16 (big_endian, data + c * 2) == 0) + if (windres_get_16 (wrbfd, data + c * 2, 2) == 0) break; ++c; } @@ -154,7 +141,7 @@ get_unicode (const unsigned char *data, unsigned long length, ret = (unichar *) res_alloc ((c + 1) * sizeof (unichar)); for (i = 0; i < c; i++) - ret[i] = get_16 (big_endian, data + i * 2); + ret[i] = windres_get_16 (wrbfd, data + i * 2, 2); ret[i] = 0; if (retlen != NULL) @@ -166,27 +153,27 @@ get_unicode (const unsigned char *data, unsigned long length, /* Get a resource identifier. This returns the number of bytes used. */ static int -get_resid (struct res_id *id, const unsigned char *data, - unsigned long length, int big_endian) +get_resid (windres_bfd *wrbfd, rc_res_id *id, const bfd_byte *data, + rc_uint_type length) { - int first; + rc_uint_type first; if (length < 2) toosmall (_("resource ID")); - first = get_16 (big_endian, data); + first = windres_get_16 (wrbfd, data, 2); if (first == 0xffff) { if (length < 4) toosmall (_("resource ID")); id->named = 0; - id->u.id = get_16 (big_endian, data + 2); + id->u.id = windres_get_16 (wrbfd, data + 2, 2); return 4; } else { id->named = 1; - id->u.n.name = get_unicode (data, length, big_endian, &id->u.n.length); + id->u.n.name = get_unicode (wrbfd, data, length, &id->u.n.length); return id->u.n.length * 2 + 2; } } @@ -194,13 +181,13 @@ get_resid (struct res_id *id, const unsigned char *data, /* Convert a resource which just stores uninterpreted data from binary. */ -struct res_resource * -bin_to_res_generic (enum res_type type, const unsigned char *data, - unsigned long length) +rc_res_resource * +bin_to_res_generic (windres_bfd *wrbfd ATTRIBUTE_UNUSED, enum rc_res_type type, + const bfd_byte *data, rc_uint_type length) { - struct res_resource *r; + rc_res_resource *r; - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof (rc_res_resource)); r->type = type; r->u.data.data = data; r->u.data.length = length; @@ -210,23 +197,22 @@ bin_to_res_generic (enum res_type type, const unsigned char *data, /* Convert a cursor resource from binary. */ -struct res_resource * -bin_to_res_cursor (const unsigned char *data, unsigned long length, - int big_endian) +rc_res_resource * +bin_to_res_cursor (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length) { - struct cursor *c; - struct res_resource *r; + rc_cursor *c; + rc_res_resource *r; if (length < 4) toosmall (_("cursor")); - c = (struct cursor *) res_alloc (sizeof *c); - c->xhotspot = get_16 (big_endian, data); - c->yhotspot = get_16 (big_endian, data + 2); + c = (rc_cursor *) res_alloc (sizeof (rc_cursor)); + c->xhotspot = windres_get_16 (wrbfd, data, 2); + c->yhotspot = windres_get_16 (wrbfd, data + 2, 2); c->length = length - 4; c->data = data + 4; - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof *r); r->type = RES_TYPE_CURSOR; r->u.cursor = c; @@ -235,61 +221,57 @@ bin_to_res_cursor (const unsigned char *data, unsigned long length, /* Convert a menu resource from binary. */ -struct res_resource * -bin_to_res_menu (const unsigned char *data, unsigned long length, - int big_endian) +rc_res_resource * +bin_to_res_menu (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length) { - struct res_resource *r; - struct menu *m; - int version, read; + rc_res_resource *r; + rc_menu *m; + rc_uint_type version, read; - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof *r); r->type = RES_TYPE_MENU; - m = (struct menu *) res_alloc (sizeof *m); + m = (rc_menu *) res_alloc (sizeof (rc_menu)); r->u.menu = m; if (length < 2) toosmall (_("menu header")); - version = get_16 (big_endian, data); + version = windres_get_16 (wrbfd, data, 2); if (version == 0) { if (length < 4) toosmall (_("menu header")); m->help = 0; - m->items = bin_to_res_menuitems (data + 4, length - 4, big_endian, - &read); + m->items = bin_to_res_menuitems (wrbfd, data + 4, length - 4, &read); } else if (version == 1) { - unsigned int offset; + rc_uint_type offset; if (length < 8) toosmall (_("menuex header")); - m->help = get_32 (big_endian, data + 4); - offset = get_16 (big_endian, data + 2); + m->help = windres_get_32 (wrbfd, data + 4, 4); + offset = windres_get_16 (wrbfd, data + 2, 2); if (offset + 4 >= length) toosmall (_("menuex offset")); - m->items = bin_to_res_menuexitems (data + 4 + offset, - length - (4 + offset), - big_endian, - &read); + m->items = bin_to_res_menuexitems (wrbfd, data + 4 + offset, + length - (4 + offset), &read); } else - fatal (_("unsupported menu version %d"), version); + fatal (_("unsupported menu version %d"), (int) version); return r; } /* Convert menu items from binary. */ -static struct menuitem * -bin_to_res_menuitems (const unsigned char *data, unsigned long length, - int big_endian, int *read) +static rc_menuitem * +bin_to_res_menuitems (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length, + rc_uint_type *read) { - struct menuitem *first, **pp; + rc_menuitem *first, **pp; first = NULL; pp = &first; @@ -298,18 +280,18 @@ bin_to_res_menuitems (const unsigned char *data, unsigned long length, while (length > 0) { - int flags, slen, itemlen; - unsigned int stroff; - struct menuitem *mi; + rc_uint_type flags, slen, itemlen; + rc_uint_type stroff; + rc_menuitem *mi; if (length < 4) toosmall (_("menuitem header")); - mi = (struct menuitem *) res_alloc (sizeof *mi); + mi = (rc_menuitem *) res_alloc (sizeof *mi); mi->state = 0; mi->help = 0; - flags = get_16 (big_endian, data); + flags = windres_get_16 (wrbfd, data, 2); mi->type = flags &~ (MENUITEM_POPUP | MENUITEM_ENDMENU); if ((flags & MENUITEM_POPUP) == 0) @@ -320,29 +302,28 @@ bin_to_res_menuitems (const unsigned char *data, unsigned long length, if (length < stroff + 2) toosmall (_("menuitem header")); - if (get_16 (big_endian, data + stroff) == 0) + if (windres_get_16 (wrbfd, data + stroff, 2) == 0) { slen = 0; mi->text = NULL; } else - mi->text = get_unicode (data + stroff, length - stroff, big_endian, - &slen); + mi->text = get_unicode (wrbfd, data + stroff, length - stroff, &slen); itemlen = stroff + slen * 2 + 2; if ((flags & MENUITEM_POPUP) == 0) { mi->popup = NULL; - mi->id = get_16 (big_endian, data + 2); + mi->id = windres_get_16 (wrbfd, data + 2, 2); } else { - int subread; + rc_uint_type subread; mi->id = 0; - mi->popup = bin_to_res_menuitems (data + itemlen, length - itemlen, - big_endian, &subread); + mi->popup = bin_to_res_menuitems (wrbfd, data + itemlen, length - itemlen, + &subread); itemlen += subread; } @@ -363,11 +344,11 @@ bin_to_res_menuitems (const unsigned char *data, unsigned long length, /* Convert menuex items from binary. */ -static struct menuitem * -bin_to_res_menuexitems (const unsigned char *data, unsigned long length, - int big_endian, int *read) +static rc_menuitem * +bin_to_res_menuexitems (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length, + rc_uint_type *read) { - struct menuitem *first, **pp; + rc_menuitem *first, **pp; first = NULL; pp = &first; @@ -376,29 +357,29 @@ bin_to_res_menuexitems (const unsigned char *data, unsigned long length, while (length > 0) { - int flags, slen; - unsigned int itemlen; - struct menuitem *mi; + rc_uint_type flags, slen; + rc_uint_type itemlen; + rc_menuitem *mi; - if (length < 14) + if (length < 16) toosmall (_("menuitem header")); - mi = (struct menuitem *) res_alloc (sizeof *mi); - mi->type = get_32 (big_endian, data); - mi->state = get_32 (big_endian, data + 4); - mi->id = get_16 (big_endian, data + 8); + mi = (rc_menuitem *) res_alloc (sizeof (rc_menuitem)); + mi->type = windres_get_32 (wrbfd, data, 4); + mi->state = windres_get_32 (wrbfd, data + 4, 4); + mi->id = windres_get_32 (wrbfd, data + 8, 4); - flags = get_16 (big_endian, data + 10); + flags = windres_get_16 (wrbfd, data + 12, 2); - if (get_16 (big_endian, data + 12) == 0) + if (windres_get_16 (wrbfd, data + 14, 2) == 0) { slen = 0; mi->text = NULL; } else - mi->text = get_unicode (data + 12, length - 12, big_endian, &slen); + mi->text = get_unicode (wrbfd, data + 14, length - 14, &slen); - itemlen = 12 + slen * 2 + 2; + itemlen = 14 + slen * 2 + 2; itemlen = (itemlen + 3) &~ 3; if ((flags & 1) == 0) @@ -408,16 +389,15 @@ bin_to_res_menuexitems (const unsigned char *data, unsigned long length, } else { - int subread; + rc_uint_type subread; if (length < itemlen + 4) toosmall (_("menuitem")); - mi->help = get_32 (big_endian, data + itemlen); + mi->help = windres_get_32 (wrbfd, data + itemlen, 4); itemlen += 4; - mi->popup = bin_to_res_menuexitems (data + itemlen, - length - itemlen, - big_endian, &subread); + mi->popup = bin_to_res_menuexitems (wrbfd, data + itemlen, + length - itemlen, &subread); itemlen += subread; } @@ -438,63 +418,62 @@ bin_to_res_menuexitems (const unsigned char *data, unsigned long length, /* Convert a dialog resource from binary. */ -static struct res_resource * -bin_to_res_dialog (const unsigned char *data, unsigned long length, - int big_endian) +static rc_res_resource * +bin_to_res_dialog (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length) { - int signature; - struct dialog *d; - int c, sublen, i; - unsigned int off; - struct dialog_control **pp; - struct res_resource *r; + rc_uint_type signature; + rc_dialog *d; + rc_uint_type c, sublen, i; + rc_uint_type off; + rc_dialog_control **pp; + rc_res_resource *r; if (length < 18) toosmall (_("dialog header")); - d = (struct dialog *) res_alloc (sizeof *d); + d = (rc_dialog *) res_alloc (sizeof (rc_dialog)); - signature = get_16 (big_endian, data + 2); + signature = windres_get_16 (wrbfd, data + 2, 2); if (signature != 0xffff) { d->ex = NULL; - d->style = get_32 (big_endian, data); - d->exstyle = get_32 (big_endian, data + 4); + d->style = windres_get_32 (wrbfd, data, 4); + d->exstyle = windres_get_32 (wrbfd, data + 4, 4); off = 8; } else { int version; - version = get_16 (big_endian, data); + version = windres_get_16 (wrbfd, data, 2); if (version != 1) fatal (_("unexpected DIALOGEX version %d"), version); - d->ex = (struct dialog_ex *) res_alloc (sizeof (struct dialog_ex)); - d->ex->help = get_32 (big_endian, data + 4); - d->exstyle = get_32 (big_endian, data + 8); - d->style = get_32 (big_endian, data + 12); + d->ex = (rc_dialog_ex *) res_alloc (sizeof (rc_dialog_ex)); + d->ex->help = windres_get_32 (wrbfd, data + 4, 4); + d->exstyle = windres_get_32 (wrbfd, data + 8, 4); + d->style = windres_get_32 (wrbfd, data + 12, 4); off = 16; } if (length < off + 10) toosmall (_("dialog header")); - c = get_16 (big_endian, data + off); - d->x = get_16 (big_endian, data + off + 2); - d->y = get_16 (big_endian, data + off + 4); - d->width = get_16 (big_endian, data + off + 6); - d->height = get_16 (big_endian, data + off + 8); + c = windres_get_16 (wrbfd, data + off, 2); + d->x = windres_get_16 (wrbfd, data + off + 2, 2); + d->y = windres_get_16 (wrbfd, data + off + 4, 2); + d->width = windres_get_16 (wrbfd, data + off + 6, 2); + d->height = windres_get_16 (wrbfd, data + off + 8, 2); off += 10; - sublen = get_resid (&d->menu, data + off, length - off, big_endian); + sublen = get_resid (wrbfd, &d->menu, data + off, length - off); off += sublen; - sublen = get_resid (&d->class, data + off, length - off, big_endian); + sublen = get_resid (wrbfd, &d->class, data + off, length - off); off += sublen; - d->caption = get_unicode (data + off, length - off, big_endian, &sublen); + d->caption = get_unicode (wrbfd, data + off, length - off, &sublen); off += sublen * 2 + 2; if (sublen == 0) d->caption = NULL; @@ -515,20 +494,20 @@ bin_to_res_dialog (const unsigned char *data, unsigned long length, if (length < off + 2) toosmall (_("dialog font point size")); - d->pointsize = get_16 (big_endian, data + off); + d->pointsize = windres_get_16 (wrbfd, data + off, 2); off += 2; if (d->ex != NULL) { if (length < off + 4) toosmall (_("dialogex font information")); - d->ex->weight = get_16 (big_endian, data + off); - d->ex->italic = get_8 (data + off + 2); - d->ex->charset = get_8 (data + off + 3); + d->ex->weight = windres_get_16 (wrbfd, data + off, 2); + d->ex->italic = windres_get_8 (wrbfd, data + off + 2, 1); + d->ex->charset = windres_get_8 (wrbfd, data + off + 3, 1); off += 4; } - d->font = get_unicode (data + off, length - off, big_endian, &sublen); + d->font = get_unicode (wrbfd, data + off, length - off, &sublen); off += sublen * 2 + 2; } @@ -537,20 +516,20 @@ bin_to_res_dialog (const unsigned char *data, unsigned long length, for (i = 0; i < c; i++) { - struct dialog_control *dc; + rc_dialog_control *dc; int datalen; off = (off + 3) &~ 3; - dc = (struct dialog_control *) res_alloc (sizeof *dc); + dc = (rc_dialog_control *) res_alloc (sizeof (rc_dialog_control)); if (d->ex == NULL) { if (length < off + 8) toosmall (_("dialog control")); - dc->style = get_32 (big_endian, data + off); - dc->exstyle = get_32 (big_endian, data + off + 4); + dc->style = windres_get_32 (wrbfd, data + off, 4); + dc->exstyle = windres_get_32 (wrbfd, data + off + 4, 4); dc->help = 0; off += 8; } @@ -558,37 +537,37 @@ bin_to_res_dialog (const unsigned char *data, unsigned long length, { if (length < off + 12) toosmall (_("dialogex control")); - dc->help = get_32 (big_endian, data + off); - dc->exstyle = get_32 (big_endian, data + off + 4); - dc->style = get_32 (big_endian, data + off + 8); + dc->help = windres_get_32 (wrbfd, data + off, 4); + dc->exstyle = windres_get_32 (wrbfd, data + off + 4, 4); + dc->style = windres_get_32 (wrbfd, data + off + 8, 4); off += 12; } - if (length < off + 10) + if (length < off + (d->ex != NULL ? 2 : 0) + 10) toosmall (_("dialog control")); - dc->x = get_16 (big_endian, data + off); - dc->y = get_16 (big_endian, data + off + 2); - dc->width = get_16 (big_endian, data + off + 4); - dc->height = get_16 (big_endian, data + off + 6); + dc->x = windres_get_16 (wrbfd, data + off, 2); + dc->y = windres_get_16 (wrbfd, data + off + 2, 2); + dc->width = windres_get_16 (wrbfd, data + off + 4, 2); + dc->height = windres_get_16 (wrbfd, data + off + 6, 2); if (d->ex != NULL) - dc->id = get_32 (big_endian, data + off + 8); + dc->id = windres_get_32 (wrbfd, data + off + 8, 4); else - dc->id = get_16 (big_endian, data + off + 8); + dc->id = windres_get_16 (wrbfd, data + off + 8, 2); off += 10 + (d->ex != NULL ? 2 : 0); - sublen = get_resid (&dc->class, data + off, length - off, big_endian); + sublen = get_resid (wrbfd, &dc->class, data + off, length - off); off += sublen; - sublen = get_resid (&dc->text, data + off, length - off, big_endian); + sublen = get_resid (wrbfd, &dc->text, data + off, length - off); off += sublen; if (length < off + 2) toosmall (_("dialog control end")); - datalen = get_16 (big_endian, data + off); + datalen = windres_get_16 (wrbfd, data + off, 2); off += 2; if (datalen == 0) @@ -600,8 +579,8 @@ bin_to_res_dialog (const unsigned char *data, unsigned long length, if (length < off + datalen) toosmall (_("dialog control data")); - dc->data = ((struct rcdata_item *) - res_alloc (sizeof (struct rcdata_item))); + dc->data = ((rc_rcdata_item *) + res_alloc (sizeof (rc_rcdata_item))); dc->data->next = NULL; dc->data->type = RCDATA_BUFFER; dc->data->u.buffer.length = datalen; @@ -615,7 +594,7 @@ bin_to_res_dialog (const unsigned char *data, unsigned long length, pp = &dc->next; } - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof *r); r->type = RES_TYPE_DIALOG; r->u.dialog = d; @@ -624,15 +603,14 @@ bin_to_res_dialog (const unsigned char *data, unsigned long length, /* Convert a stringtable resource from binary. */ -static struct res_resource * -bin_to_res_string (const unsigned char *data, unsigned long length, - int big_endian) +static rc_res_resource * +bin_to_res_string (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length) { - struct stringtable *st; + rc_stringtable *st; int i; - struct res_resource *r; + rc_res_resource *r; - st = (struct stringtable *) res_alloc (sizeof *st); + st = (rc_stringtable *) res_alloc (sizeof (rc_stringtable)); for (i = 0; i < 16; i++) { @@ -640,7 +618,7 @@ bin_to_res_string (const unsigned char *data, unsigned long length, if (length < 2) toosmall (_("stringtable string length")); - slen = get_16 (big_endian, data); + slen = windres_get_16 (wrbfd, data, 2); st->strings[i].length = slen; if (slen > 0) @@ -655,14 +633,14 @@ bin_to_res_string (const unsigned char *data, unsigned long length, st->strings[i].string = s; for (j = 0; j < slen; j++) - s[j] = get_16 (big_endian, data + 2 + j * 2); + s[j] = windres_get_16 (wrbfd, data + 2 + j * 2, 2); } data += 2 + 2 * slen; length -= 2 + 2 * slen; } - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof *r); r->type = RES_TYPE_STRINGTABLE; r->u.stringtable = st; @@ -671,36 +649,37 @@ bin_to_res_string (const unsigned char *data, unsigned long length, /* Convert a fontdir resource from binary. */ -static struct res_resource * -bin_to_res_fontdir (const unsigned char *data, unsigned long length, - int big_endian) +static rc_res_resource * +bin_to_res_fontdir (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length) { - int c, i; - struct fontdir *first, **pp; - struct res_resource *r; + rc_uint_type c, i; + rc_fontdir *first, **pp; + rc_res_resource *r; if (length < 2) toosmall (_("fontdir header")); - c = get_16 (big_endian, data); + c = windres_get_16 (wrbfd, data, 2); first = NULL; pp = &first; for (i = 0; i < c; i++) { - struct fontdir *fd; + const struct bin_fontdir_item *bfi; + rc_fontdir *fd; unsigned int off; if (length < 56) toosmall (_("fontdir")); - fd = (struct fontdir *) res_alloc (sizeof *fd); - fd->index = get_16 (big_endian, data); + bfi = (const struct bin_fontdir_item *) data; + fd = (rc_fontdir *) res_alloc (sizeof *fd); + fd->index = windres_get_16 (wrbfd, bfi->index, 2); /* To work out the length of the fontdir data, we must get the length of the device name and face name strings, even though - we don't store them in the fontdir structure. The + we don't store them in the rc_fontdir. The documentation says that these are NULL terminated char strings, not Unicode strings. */ @@ -732,7 +711,7 @@ bin_to_res_fontdir (const unsigned char *data, unsigned long length, length -= off; } - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof *r); r->type = RES_TYPE_FONTDIR; r->u.fontdir = first; @@ -741,28 +720,27 @@ bin_to_res_fontdir (const unsigned char *data, unsigned long length, /* Convert an accelerators resource from binary. */ -static struct res_resource * -bin_to_res_accelerators (const unsigned char *data, unsigned long length, - int big_endian) +static rc_res_resource * +bin_to_res_accelerators (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length) { - struct accelerator *first, **pp; - struct res_resource *r; + rc_accelerator *first, **pp; + rc_res_resource *r; first = NULL; pp = &first; while (1) { - struct accelerator *a; + rc_accelerator *a; if (length < 8) toosmall (_("accelerator")); - a = (struct accelerator *) res_alloc (sizeof *a); + a = (rc_accelerator *) res_alloc (sizeof (rc_accelerator)); - a->flags = get_16 (big_endian, data); - a->key = get_16 (big_endian, data + 2); - a->id = get_16 (big_endian, data + 4); + a->flags = windres_get_16 (wrbfd, data, 2); + a->key = windres_get_16 (wrbfd, data + 2, 2); + a->id = windres_get_16 (wrbfd, data + 4, 2); a->next = NULL; *pp = a; @@ -775,7 +753,7 @@ bin_to_res_accelerators (const unsigned char *data, unsigned long length, length -= 8; } - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof (rc_res_resource)); r->type = RES_TYPE_ACCELERATOR; r->u.acc = first; @@ -784,22 +762,22 @@ bin_to_res_accelerators (const unsigned char *data, unsigned long length, /* Convert an rcdata resource from binary. */ -static struct res_resource * -bin_to_res_rcdata (const unsigned char *data, unsigned long length, - int big_endian ATTRIBUTE_UNUSED) +static rc_res_resource * +bin_to_res_rcdata (windres_bfd *wrbfd ATTRIBUTE_UNUSED, const bfd_byte *data, + rc_uint_type length, int rctyp) { - struct rcdata_item *ri; - struct res_resource *r; + rc_rcdata_item *ri; + rc_res_resource *r; - ri = (struct rcdata_item *) res_alloc (sizeof *ri); + ri = (rc_rcdata_item *) res_alloc (sizeof (rc_rcdata_item)); ri->next = NULL; ri->type = RCDATA_BUFFER; ri->u.buffer.length = length; ri->u.buffer.data = data; - r = (struct res_resource *) res_alloc (sizeof *r); - r->type = RES_TYPE_RCDATA; + r = (rc_res_resource *) res_alloc (sizeof *r); + r->type = rctyp; r->u.rcdata = ri; return r; @@ -807,22 +785,21 @@ bin_to_res_rcdata (const unsigned char *data, unsigned long length, /* Convert a group cursor resource from binary. */ -static struct res_resource * -bin_to_res_group_cursor (const unsigned char *data, unsigned long length, - int big_endian) +static rc_res_resource * +bin_to_res_group_cursor (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length) { int type, c, i; - struct group_cursor *first, **pp; - struct res_resource *r; + rc_group_cursor *first, **pp; + rc_res_resource *r; if (length < 6) toosmall (_("group cursor header")); - type = get_16 (big_endian, data + 2); + type = windres_get_16 (wrbfd, data + 2, 2); if (type != 2) fatal (_("unexpected group cursor type %d"), type); - c = get_16 (big_endian, data + 4); + c = windres_get_16 (wrbfd, data + 4, 2); data += 6; length -= 6; @@ -832,19 +809,19 @@ bin_to_res_group_cursor (const unsigned char *data, unsigned long length, for (i = 0; i < c; i++) { - struct group_cursor *gc; + rc_group_cursor *gc; if (length < 14) toosmall (_("group cursor")); - gc = (struct group_cursor *) res_alloc (sizeof *gc); + gc = (rc_group_cursor *) res_alloc (sizeof *gc); - gc->width = get_16 (big_endian, data); - gc->height = get_16 (big_endian, data + 2); - gc->planes = get_16 (big_endian, data + 4); - gc->bits = get_16 (big_endian, data + 6); - gc->bytes = get_32 (big_endian, data + 8); - gc->index = get_16 (big_endian, data + 12); + gc->width = windres_get_16 (wrbfd, data, 2); + gc->height = windres_get_16 (wrbfd, data + 2, 2); + gc->planes = windres_get_16 (wrbfd, data + 4, 2); + gc->bits = windres_get_16 (wrbfd, data + 6, 2); + gc->bytes = windres_get_32 (wrbfd, data + 8, 4); + gc->index = windres_get_16 (wrbfd, data + 12, 2); gc->next = NULL; *pp = gc; @@ -854,7 +831,7 @@ bin_to_res_group_cursor (const unsigned char *data, unsigned long length, length -= 14; } - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof (rc_res_resource)); r->type = RES_TYPE_GROUP_CURSOR; r->u.group_cursor = first; @@ -863,22 +840,21 @@ bin_to_res_group_cursor (const unsigned char *data, unsigned long length, /* Convert a group icon resource from binary. */ -static struct res_resource * -bin_to_res_group_icon (const unsigned char *data, unsigned long length, - int big_endian) +static rc_res_resource * +bin_to_res_group_icon (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length) { int type, c, i; - struct group_icon *first, **pp; - struct res_resource *r; + rc_group_icon *first, **pp; + rc_res_resource *r; if (length < 6) toosmall (_("group icon header")); - type = get_16 (big_endian, data + 2); + type = windres_get_16 (wrbfd, data + 2, 2); if (type != 1) fatal (_("unexpected group icon type %d"), type); - c = get_16 (big_endian, data + 4); + c = windres_get_16 (wrbfd, data + 4, 2); data += 6; length -= 6; @@ -888,20 +864,20 @@ bin_to_res_group_icon (const unsigned char *data, unsigned long length, for (i = 0; i < c; i++) { - struct group_icon *gi; + rc_group_icon *gi; if (length < 14) toosmall (_("group icon")); - gi = (struct group_icon *) res_alloc (sizeof *gi); + gi = (rc_group_icon *) res_alloc (sizeof (rc_group_icon)); - gi->width = data[0]; - gi->height = data[1]; - gi->colors = data[2]; - gi->planes = get_16 (big_endian, data + 4); - gi->bits = get_16 (big_endian, data + 6); - gi->bytes = get_32 (big_endian, data + 8); - gi->index = get_16 (big_endian, data + 12); + gi->width = windres_get_8 (wrbfd, data, 1); + gi->height = windres_get_8 (wrbfd, data + 1, 1); + gi->colors = windres_get_8 (wrbfd, data + 2, 1); + gi->planes = windres_get_16 (wrbfd, data + 4, 2); + gi->bits = windres_get_16 (wrbfd, data + 6, 2); + gi->bytes = windres_get_32 (wrbfd, data + 8, 4); + gi->index = windres_get_16 (wrbfd, data + 12, 2); gi->next = NULL; *pp = gi; @@ -911,7 +887,7 @@ bin_to_res_group_icon (const unsigned char *data, unsigned long length, length -= 14; } - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof *r); r->type = RES_TYPE_GROUP_ICON; r->u.group_icon = first; @@ -924,16 +900,17 @@ bin_to_res_group_icon (const unsigned char *data, unsigned long length, to the type, and *OFF to the offset to the children. */ static void -get_version_header (const unsigned char *data, unsigned long length, - int big_endian, const char *key, unichar **pkey, - int *len, int *vallen, int *type, int *off) +get_version_header (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length, + const char *key, unichar **pkey, + rc_uint_type *len, rc_uint_type *vallen, rc_uint_type *type, + rc_uint_type *off) { if (length < 8) toosmall (key); - *len = get_16 (big_endian, data); - *vallen = get_16 (big_endian, data + 2); - *type = get_16 (big_endian, data + 4); + *len = windres_get_16 (wrbfd, data, 2); + *vallen = windres_get_16 (wrbfd, data + 2, 2); + *type = windres_get_16 (wrbfd, data + 4, 2); *off = 6; @@ -942,10 +919,10 @@ get_version_header (const unsigned char *data, unsigned long length, if (key == NULL) { - int sublen; + rc_uint_type sublen; - *pkey = get_unicode (data, length, big_endian, &sublen); - *off += sublen * 2 + 2; + *pkey = get_unicode (wrbfd, data, length, &sublen); + *off += (sublen + 1) * sizeof (unichar); } else { @@ -953,7 +930,7 @@ get_version_header (const unsigned char *data, unsigned long length, { if (length < 2) toosmall (key); - if (get_16 (big_endian, data) != (unsigned char) *key) + if (windres_get_16 (wrbfd, data, 2) != (bfd_byte) *key) fatal (_("unexpected version string")); *off += 2; @@ -972,25 +949,24 @@ get_version_header (const unsigned char *data, unsigned long length, /* Convert a version resource from binary. */ -static struct res_resource * -bin_to_res_version (const unsigned char *data, unsigned long length, - int big_endian) +static rc_res_resource * +bin_to_res_version (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length) { - int verlen, vallen, type, off; - struct fixed_versioninfo *fi; - struct ver_info *first, **pp; - struct versioninfo *v; - struct res_resource *r; + rc_uint_type verlen, vallen, type, off; + rc_fixed_versioninfo *fi; + rc_ver_info *first, **pp; + rc_versioninfo *v; + rc_res_resource *r; - get_version_header (data, length, big_endian, "VS_VERSION_INFO", + get_version_header (wrbfd, data, length, "VS_VERSION_INFO", (unichar **) NULL, &verlen, &vallen, &type, &off); if ((unsigned int) verlen != length) fatal (_("version length %d does not match resource length %lu"), - verlen, length); + (int) verlen, (unsigned long) length); if (type != 0) - fatal (_("unexpected version type %d"), type); + fatal (_("unexpected version type %d"), (int) type); data += off; length -= off; @@ -1002,32 +978,32 @@ bin_to_res_version (const unsigned char *data, unsigned long length, unsigned long signature, fiv; if (vallen != 52) - fatal (_("unexpected fixed version information length %d"), vallen); + fatal (_("unexpected fixed version information length %ld"), (long) vallen); if (length < 52) toosmall (_("fixed version info")); - signature = get_32 (big_endian, data); + signature = windres_get_32 (wrbfd, data, 4); if (signature != 0xfeef04bd) fatal (_("unexpected fixed version signature %lu"), signature); - fiv = get_32 (big_endian, data + 4); + fiv = windres_get_32 (wrbfd, data + 4, 4); if (fiv != 0 && fiv != 0x10000) fatal (_("unexpected fixed version info version %lu"), fiv); - fi = (struct fixed_versioninfo *) res_alloc (sizeof *fi); + fi = (rc_fixed_versioninfo *) res_alloc (sizeof (rc_fixed_versioninfo)); - fi->file_version_ms = get_32 (big_endian, data + 8); - fi->file_version_ls = get_32 (big_endian, data + 12); - fi->product_version_ms = get_32 (big_endian, data + 16); - fi->product_version_ls = get_32 (big_endian, data + 20); - fi->file_flags_mask = get_32 (big_endian, data + 24); - fi->file_flags = get_32 (big_endian, data + 28); - fi->file_os = get_32 (big_endian, data + 32); - fi->file_type = get_32 (big_endian, data + 36); - fi->file_subtype = get_32 (big_endian, data + 40); - fi->file_date_ms = get_32 (big_endian, data + 44); - fi->file_date_ls = get_32 (big_endian, data + 48); + fi->file_version_ms = windres_get_32 (wrbfd, data + 8, 4); + fi->file_version_ls = windres_get_32 (wrbfd, data + 12, 4); + fi->product_version_ms = windres_get_32 (wrbfd, data + 16, 4); + fi->product_version_ls = windres_get_32 (wrbfd, data + 20, 4); + fi->file_flags_mask = windres_get_32 (wrbfd, data + 24, 4); + fi->file_flags = windres_get_32 (wrbfd, data + 28, 4); + fi->file_os = windres_get_32 (wrbfd, data + 32, 4); + fi->file_type = windres_get_32 (wrbfd, data + 36, 4); + fi->file_subtype = windres_get_32 (wrbfd, data + 40, 4); + fi->file_date_ms = windres_get_32 (wrbfd, data + 44, 4); + fi->file_date_ls = windres_get_32 (wrbfd, data + 48, 4); data += 52; length -= 52; @@ -1038,38 +1014,38 @@ bin_to_res_version (const unsigned char *data, unsigned long length, while (length > 0) { - struct ver_info *vi; + rc_ver_info *vi; int ch; if (length < 8) toosmall (_("version var info")); - vi = (struct ver_info *) res_alloc (sizeof *vi); + vi = (rc_ver_info *) res_alloc (sizeof (rc_ver_info)); - ch = get_16 (big_endian, data + 6); + ch = windres_get_16 (wrbfd, data + 6, 2); if (ch == 'S') { - struct ver_stringinfo **ppvs; + rc_ver_stringinfo **ppvs; vi->type = VERINFO_STRING; - get_version_header (data, length, big_endian, "StringFileInfo", + get_version_header (wrbfd, data, length, "StringFileInfo", (unichar **) NULL, &verlen, &vallen, &type, &off); if (vallen != 0) - fatal (_("unexpected stringfileinfo value length %d"), vallen); + fatal (_("unexpected stringfileinfo value length %ld"), (long) vallen); data += off; length -= off; - get_version_header (data, length, big_endian, (const char *) NULL, + get_version_header (wrbfd, data, length, (const char *) NULL, &vi->u.string.language, &verlen, &vallen, &type, &off); if (vallen != 0) - fatal (_("unexpected version stringtable value length %d"), vallen); + fatal (_("unexpected version stringtable value length %ld"), (long) vallen); data += off; length -= off; @@ -1084,12 +1060,12 @@ bin_to_res_version (const unsigned char *data, unsigned long length, while (verlen > 0) { - struct ver_stringinfo *vs; - int subverlen, vslen, valoff; + rc_ver_stringinfo *vs; + rc_uint_type subverlen, vslen, valoff; - vs = (struct ver_stringinfo *) res_alloc (sizeof *vs); + vs = (rc_ver_stringinfo *) res_alloc (sizeof *vs); - get_version_header (data, length, big_endian, + get_version_header (wrbfd, data, length, (const char *) NULL, &vs->key, &subverlen, &vallen, &type, &off); @@ -1098,13 +1074,13 @@ bin_to_res_version (const unsigned char *data, unsigned long length, data += off; length -= off; - vs->value = get_unicode (data, length, big_endian, &vslen); + vs->value = get_unicode (wrbfd, data, length, &vslen); valoff = vslen * 2 + 2; valoff = (valoff + 3) &~ 3; if (off + valoff != subverlen) - fatal (_("unexpected version string length %d != %d + %d"), - subverlen, off, valoff); + fatal (_("unexpected version string length %ld != %ld + %ld"), + (long) subverlen, (long) off, (long) valoff); vs->next = NULL; *ppvs = vs; @@ -1114,29 +1090,29 @@ bin_to_res_version (const unsigned char *data, unsigned long length, length -= valoff; if (verlen < subverlen) - fatal (_("unexpected version string length %d < %d"), - verlen, subverlen); + fatal (_("unexpected version string length %ld < %ld"), + (long) verlen, (long) subverlen); verlen -= subverlen; } } else if (ch == 'V') { - struct ver_varinfo **ppvv; + rc_ver_varinfo **ppvv; vi->type = VERINFO_VAR; - get_version_header (data, length, big_endian, "VarFileInfo", + get_version_header (wrbfd, data, length, "VarFileInfo", (unichar **) NULL, &verlen, &vallen, &type, &off); if (vallen != 0) - fatal (_("unexpected varfileinfo value length %d"), vallen); + fatal (_("unexpected varfileinfo value length %ld"), (long) vallen); data += off; length -= off; - get_version_header (data, length, big_endian, (const char *) NULL, + get_version_header (wrbfd, data, length, (const char *) NULL, &vi->u.var.key, &verlen, &vallen, &type, &off); data += off; @@ -1147,15 +1123,15 @@ bin_to_res_version (const unsigned char *data, unsigned long length, while (vallen > 0) { - struct ver_varinfo *vv; + rc_ver_varinfo *vv; if (length < 4) toosmall (_("version varfileinfo")); - vv = (struct ver_varinfo *) res_alloc (sizeof *vv); + vv = (rc_ver_varinfo *) res_alloc (sizeof (rc_ver_varinfo)); - vv->language = get_16 (big_endian, data); - vv->charset = get_16 (big_endian, data + 2); + vv->language = windres_get_16 (wrbfd, data, 2); + vv->charset = windres_get_16 (wrbfd, data + 2, 2); vv->next = NULL; *ppvv = vv; @@ -1165,7 +1141,7 @@ bin_to_res_version (const unsigned char *data, unsigned long length, length -= 4; if (vallen < 4) - fatal (_("unexpected version value length %d"), vallen); + fatal (_("unexpected version value length %ld"), (long) vallen); vallen -= 4; } @@ -1178,11 +1154,11 @@ bin_to_res_version (const unsigned char *data, unsigned long length, pp = &vi->next; } - v = (struct versioninfo *) res_alloc (sizeof *v); + v = (rc_versioninfo *) res_alloc (sizeof (rc_versioninfo)); v->fixed = fi; v->var = first; - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof *r); r->type = RES_TYPE_VERSIONINFO; r->u.versioninfo = v; @@ -1191,1128 +1167,968 @@ bin_to_res_version (const unsigned char *data, unsigned long length, /* Convert an arbitrary user defined resource from binary. */ -static struct res_resource * -bin_to_res_userdata (const unsigned char *data, unsigned long length, - int big_endian ATTRIBUTE_UNUSED) +static rc_res_resource * +bin_to_res_userdata (windres_bfd *wrbfd ATTRIBUTE_UNUSED, const bfd_byte *data, + rc_uint_type length) { - struct rcdata_item *ri; - struct res_resource *r; + rc_rcdata_item *ri; + rc_res_resource *r; - ri = (struct rcdata_item *) res_alloc (sizeof *ri); + ri = (rc_rcdata_item *) res_alloc (sizeof (rc_rcdata_item)); ri->next = NULL; ri->type = RCDATA_BUFFER; ri->u.buffer.length = length; ri->u.buffer.data = data; - r = (struct res_resource *) res_alloc (sizeof *r); + r = (rc_res_resource *) res_alloc (sizeof *r); r->type = RES_TYPE_USERDATA; r->u.rcdata = ri; return r; } -/* Macros to swap out values. */ +static rc_res_resource * +bin_to_res_toolbar (windres_bfd *wrbfd, const bfd_byte *data, rc_uint_type length) +{ + rc_toolbar *ri; + rc_res_resource *r; + rc_uint_type i; + + ri = (rc_toolbar *) res_alloc (sizeof (rc_toolbar)); + ri->button_width = windres_get_32 (wrbfd, data, 4); + ri->button_height = windres_get_32 (wrbfd, data + 4, 4); + ri->nitems = windres_get_32 (wrbfd, data + 8, 4); + ri->items = NULL; + + data += 12; + length -= 12; + for (i=0 ; i < ri->nitems; i++) + { + rc_toolbar_item *it; + it = (rc_toolbar_item *) res_alloc (sizeof (rc_toolbar_item)); + it->id.named = 0; + it->id.u.id = (int) windres_get_32 (wrbfd, data, 4); + it->prev = it->next = NULL; + data += 4; + length -= 4; + if(ri->items) { + rc_toolbar_item *ii = ri->items; + while (ii->next != NULL) + ii = ii->next; + it->prev = ii; + ii->next = it; + } + else + ri->items = it; + } + r = (rc_res_resource *) res_alloc (sizeof *r); + r->type = RES_TYPE_TOOLBAR; + r->u.toolbar = ri; + return r; +} -#define put_8(v, s) (*((unsigned char *) (s)) = (unsigned char) (v)) -#define put_16(be, v, s) ((be) ? bfd_putb16 ((v), (s)) : bfd_putl16 ((v), (s))) -#define put_32(be, v, s) ((be) ? bfd_putb32 ((v), (s)) : bfd_putl32 ((v), (s))) /* Local functions used to convert resources to binary format. */ -static void dword_align_bin (struct bindata ***, unsigned long *); -static struct bindata *resid_to_bin (struct res_id, int); -static struct bindata *unicode_to_bin (const unichar *, int); -static struct bindata *res_to_bin_accelerator - (const struct accelerator *, int); -static struct bindata *res_to_bin_cursor - (const struct cursor *, int); -static struct bindata *res_to_bin_group_cursor - (const struct group_cursor *, int); -static struct bindata *res_to_bin_dialog - (const struct dialog *, int); -static struct bindata *res_to_bin_fontdir - (const struct fontdir *, int); -static struct bindata *res_to_bin_group_icon - (const struct group_icon *, int); -static struct bindata *res_to_bin_menu - (const struct menu *, int); -static struct bindata *res_to_bin_menuitems - (const struct menuitem *, int); -static struct bindata *res_to_bin_menuexitems - (const struct menuitem *, int); -static struct bindata *res_to_bin_rcdata - (const struct rcdata_item *, int); -static struct bindata *res_to_bin_stringtable - (const struct stringtable *, int); -static struct bindata *string_to_unicode_bin (const char *, int); -static struct bindata *res_to_bin_versioninfo - (const struct versioninfo *, int); -static struct bindata *res_to_bin_generic - (unsigned long, const unsigned char *); +static rc_uint_type resid_to_bin (windres_bfd *, rc_uint_type, rc_res_id); +static rc_uint_type unicode_to_bin (windres_bfd *, rc_uint_type, const unichar *); +static rc_uint_type res_to_bin_accelerator (windres_bfd *, rc_uint_type, const rc_accelerator *); +static rc_uint_type res_to_bin_cursor (windres_bfd *, rc_uint_type, const rc_cursor *); +static rc_uint_type res_to_bin_group_cursor (windres_bfd *, rc_uint_type, const rc_group_cursor *); +static rc_uint_type res_to_bin_dialog (windres_bfd *, rc_uint_type, const rc_dialog *); +static rc_uint_type res_to_bin_fontdir (windres_bfd *, rc_uint_type, const rc_fontdir *); +static rc_uint_type res_to_bin_group_icon (windres_bfd *, rc_uint_type, const rc_group_icon *); +static rc_uint_type res_to_bin_menu (windres_bfd *, rc_uint_type, const rc_menu *); +static rc_uint_type res_to_bin_menuitems (windres_bfd *, rc_uint_type, const rc_menuitem *); +static rc_uint_type res_to_bin_menuexitems (windres_bfd *, rc_uint_type, const rc_menuitem *); +static rc_uint_type res_to_bin_rcdata (windres_bfd *, rc_uint_type, const rc_rcdata_item *); +static rc_uint_type res_to_bin_stringtable (windres_bfd *, rc_uint_type, const rc_stringtable *); +static rc_uint_type string_to_unicode_bin (windres_bfd *, rc_uint_type, const char *); +static rc_uint_type res_to_bin_toolbar (windres_bfd *, rc_uint_type, rc_toolbar *tb); +static rc_uint_type res_to_bin_versioninfo (windres_bfd *, rc_uint_type, const rc_versioninfo *); +static rc_uint_type res_to_bin_generic (windres_bfd *, rc_uint_type, rc_uint_type, + const bfd_byte *); /* Convert a resource to binary. */ -struct bindata * -res_to_bin (const struct res_resource *res, int big_endian) +rc_uint_type +res_to_bin (windres_bfd *wrbfd, rc_uint_type off, const rc_res_resource *res) { switch (res->type) { - default: - abort (); case RES_TYPE_BITMAP: case RES_TYPE_FONT: case RES_TYPE_ICON: case RES_TYPE_MESSAGETABLE: - return res_to_bin_generic (res->u.data.length, res->u.data.data); + return res_to_bin_generic (wrbfd, off, res->u.data.length, res->u.data.data); case RES_TYPE_ACCELERATOR: - return res_to_bin_accelerator (res->u.acc, big_endian); + return res_to_bin_accelerator (wrbfd, off, res->u.acc); case RES_TYPE_CURSOR: - return res_to_bin_cursor (res->u.cursor, big_endian); + return res_to_bin_cursor (wrbfd, off, res->u.cursor); case RES_TYPE_GROUP_CURSOR: - return res_to_bin_group_cursor (res->u.group_cursor, big_endian); + return res_to_bin_group_cursor (wrbfd, off, res->u.group_cursor); case RES_TYPE_DIALOG: - return res_to_bin_dialog (res->u.dialog, big_endian); + return res_to_bin_dialog (wrbfd, off, res->u.dialog); case RES_TYPE_FONTDIR: - return res_to_bin_fontdir (res->u.fontdir, big_endian); + return res_to_bin_fontdir (wrbfd, off, res->u.fontdir); case RES_TYPE_GROUP_ICON: - return res_to_bin_group_icon (res->u.group_icon, big_endian); + return res_to_bin_group_icon (wrbfd, off, res->u.group_icon); case RES_TYPE_MENU: - return res_to_bin_menu (res->u.menu, big_endian); - case RES_TYPE_RCDATA: - return res_to_bin_rcdata (res->u.rcdata, big_endian); + return res_to_bin_menu (wrbfd, off, res->u.menu); case RES_TYPE_STRINGTABLE: - return res_to_bin_stringtable (res->u.stringtable, big_endian); - case RES_TYPE_USERDATA: - return res_to_bin_rcdata (res->u.rcdata, big_endian); + return res_to_bin_stringtable (wrbfd, off, res->u.stringtable); case RES_TYPE_VERSIONINFO: - return res_to_bin_versioninfo (res->u.versioninfo, big_endian); + return res_to_bin_versioninfo (wrbfd, off, res->u.versioninfo); + case RES_TYPE_TOOLBAR: + return res_to_bin_toolbar (wrbfd, off, res->u.toolbar); + case RES_TYPE_USERDATA: + case RES_TYPE_RCDATA: + default: + return res_to_bin_rcdata (wrbfd, off, res->u.rcdata); } } -/* Align to a 32 bit boundary. PPP points to the of a list of bindata - structures. LENGTH points to the length of the structures. If - necessary, this adds a new bindata to bring length up to a 32 bit - boundary. It updates *PPP and *LENGTH. */ - -static void -dword_align_bin (struct bindata ***ppp, unsigned long *length) -{ - int add; - struct bindata *d; - - if ((*length & 3) == 0) - return; - - add = 4 - (*length & 3); - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = add; - d->data = (unsigned char *) reswr_alloc (add); - memset (d->data, 0, add); - - d->next = NULL; - **ppp = d; - *ppp = &(**ppp)->next; - - *length += add; -} - /* Convert a resource ID to binary. This always returns exactly one bindata structure. */ -static struct bindata * -resid_to_bin (struct res_id id, int big_endian) +static rc_uint_type +resid_to_bin (windres_bfd *wrbfd, rc_uint_type off, rc_res_id id) { - struct bindata *d; - - d = (struct bindata *) reswr_alloc (sizeof *d); - if (! id.named) { - d->length = 4; - d->data = (unsigned char *) reswr_alloc (d->length); - put_16 (big_endian, 0xffff, d->data); - put_16 (big_endian, id.u.id, d->data + 2); + if (wrbfd) + { + struct bin_res_id bri; + + windres_put_16 (wrbfd, bri.sig, 0xffff); + windres_put_16 (wrbfd, bri.id, id.u.id); + set_windres_bfd_content (wrbfd, &bri, off, BIN_RES_ID); + } + off += BIN_RES_ID; } else { - int i; - - d->length = id.u.n.length * 2 + 2; - d->data = (unsigned char *) reswr_alloc (d->length); - for (i = 0; i < id.u.n.length; i++) - put_16 (big_endian, id.u.n.name[i], d->data + i * 2); - put_16 (big_endian, 0, d->data + i * 2); + rc_uint_type len = (id.u.n.name ? unichar_len (id.u.n.name) : 0); + if (wrbfd) + { + bfd_byte *d = (bfd_byte *) reswr_alloc ((len + 1) * sizeof (unichar)); + rc_uint_type i; + for (i = 0; i < len; i++) + windres_put_16 (wrbfd, d + (i * sizeof (unichar)), id.u.n.name[i]); + windres_put_16 (wrbfd, d + (len * sizeof (unichar)), 0); + set_windres_bfd_content (wrbfd, d, off, (len + 1) * sizeof (unichar)); } - - d->next = NULL; - - return d; + off += (rc_uint_type) ((len + 1) * sizeof (unichar)); + } + return off; } /* Convert a null terminated unicode string to binary. This always returns exactly one bindata structure. */ -static struct bindata * -unicode_to_bin (const unichar *str, int big_endian) +static rc_uint_type +unicode_to_bin (windres_bfd *wrbfd, rc_uint_type off, const unichar *str) { - int len; - struct bindata *d; + rc_uint_type len = 0; - len = 0; if (str != NULL) + len = unichar_len (str); + + if (wrbfd) { - const unichar *s; - - for (s = str; *s != 0; s++) - ++len; + bfd_byte *d; + rc_uint_type i; + d = (bfd_byte *) reswr_alloc ( (len + 1) * sizeof (unichar)); + for (i = 0; i < len; i++) + windres_put_16 (wrbfd, d + (i * sizeof (unichar)), str[i]); + windres_put_16 (wrbfd, d + (len * sizeof (unichar)), 0); + set_windres_bfd_content (wrbfd, d, off, (len + 1) * sizeof (unichar)); } + off += (rc_uint_type) ((len + 1) * sizeof (unichar)); - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = len * 2 + 2; - d->data = (unsigned char *) reswr_alloc (d->length); - - if (str == NULL) - put_16 (big_endian, 0, d->data); - else - { - const unichar *s; - int i; - - for (s = str, i = 0; *s != 0; s++, i++) - put_16 (big_endian, *s, d->data + i * 2); - put_16 (big_endian, 0, d->data + i * 2); - } - - d->next = NULL; - - return d; + return off; } /* Convert an accelerator resource to binary. */ -static struct bindata * -res_to_bin_accelerator (const struct accelerator *accelerators, - int big_endian) +static rc_uint_type +res_to_bin_accelerator (windres_bfd *wrbfd, rc_uint_type off, + const rc_accelerator *accelerators) { - struct bindata *first, **pp; - const struct accelerator *a; + bindata *first, **pp; + const rc_accelerator *a; first = NULL; pp = &first; for (a = accelerators; a != NULL; a = a->next) { - struct bindata *d; + if (wrbfd) + { + struct bin_accelerator ba; - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = 8; - d->data = (unsigned char *) reswr_alloc (d->length); - - put_16 (big_endian, - a->flags | (a->next != NULL ? 0 : ACC_LAST), - d->data); - put_16 (big_endian, a->key, d->data + 2); - put_16 (big_endian, a->id, d->data + 4); - put_16 (big_endian, 0, d->data + 6); - - d->next = NULL; - *pp = d; - pp = &d->next; + windres_put_16 (wrbfd, ba.flags, a->flags | (a->next != NULL ? 0 : ACC_LAST)); + windres_put_16 (wrbfd, ba.key, a->key); + windres_put_16 (wrbfd, ba.id, a->id); + windres_put_16 (wrbfd, ba.pad, 0); + set_windres_bfd_content (wrbfd, &ba, off, BIN_ACCELERATOR_SIZE); } - - return first; + off += BIN_ACCELERATOR_SIZE; + } + return off; } /* Convert a cursor resource to binary. */ -static struct bindata * -res_to_bin_cursor (const struct cursor *c, int big_endian) +static rc_uint_type +res_to_bin_cursor (windres_bfd *wrbfd, rc_uint_type off, const rc_cursor *c) { - struct bindata *d; + if (wrbfd) + { + struct bin_cursor bc; - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = 4; - d->data = (unsigned char *) reswr_alloc (d->length); - - put_16 (big_endian, c->xhotspot, d->data); - put_16 (big_endian, c->yhotspot, d->data + 2); - - d->next = (struct bindata *) reswr_alloc (sizeof *d); - d->next->length = c->length; - d->next->data = (unsigned char *) c->data; - d->next->next = NULL; - - return d; + windres_put_16 (wrbfd, bc.xhotspot, c->xhotspot); + windres_put_16 (wrbfd, bc.yhotspot, c->yhotspot); + set_windres_bfd_content (wrbfd, &bc, off, BIN_CURSOR_SIZE); + if (c->length) + set_windres_bfd_content (wrbfd, c->data, off + BIN_CURSOR_SIZE, c->length); + } + off = (off + BIN_CURSOR_SIZE + (rc_uint_type) c->length); + return off; } /* Convert a group cursor resource to binary. */ -static struct bindata * -res_to_bin_group_cursor (const struct group_cursor *group_cursors, - int big_endian) +static rc_uint_type +res_to_bin_group_cursor (windres_bfd *wrbfd, rc_uint_type off, + const rc_group_cursor *group_cursors) { - struct bindata *first, **pp; - int c; - const struct group_cursor *gc; + int c = 0; + const rc_group_cursor *gc; + struct bin_group_cursor bgc; + struct bin_group_cursor_item bgci; + rc_uint_type start = off; - first = (struct bindata *) reswr_alloc (sizeof *first); - first->length = 6; - first->data = (unsigned char *) reswr_alloc (first->length); + off += BIN_GROUP_CURSOR_SIZE; - put_16 (big_endian, 0, first->data); - put_16 (big_endian, 2, first->data + 2); - - first->next = NULL; - pp = &first->next; - - c = 0; - for (gc = group_cursors; gc != NULL; gc = gc->next) + for (c = 0, gc = group_cursors; gc != NULL; gc = gc->next, c++) { - struct bindata *d; - - ++c; - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = 14; - d->data = (unsigned char *) reswr_alloc (d->length); - - put_16 (big_endian, gc->width, d->data); - put_16 (big_endian, gc->height, d->data + 2); - put_16 (big_endian, gc->planes, d->data + 4); - put_16 (big_endian, gc->bits, d->data + 6); - put_32 (big_endian, gc->bytes, d->data + 8); - put_16 (big_endian, gc->index, d->data + 12); - - d->next = NULL; - *pp = d; - pp = &d->next; + if (wrbfd) + { + windres_put_16 (wrbfd, bgci.width, gc->width); + windres_put_16 (wrbfd, bgci.height, gc->height); + windres_put_16 (wrbfd, bgci.planes, gc->planes); + windres_put_16 (wrbfd, bgci.bits, gc->bits); + windres_put_32 (wrbfd, bgci.bytes, gc->bytes); + windres_put_16 (wrbfd, bgci.index, gc->index); + set_windres_bfd_content (wrbfd, &bgci, off, BIN_GROUP_CURSOR_ITEM_SIZE); } - put_16 (big_endian, c, first->data + 4); - - return first; + off += BIN_GROUP_CURSOR_ITEM_SIZE; + } + if (wrbfd) + { + windres_put_16 (wrbfd, bgc.sig1, 0); + windres_put_16 (wrbfd, bgc.sig2, 2); + windres_put_16 (wrbfd, bgc.nitems, c); + set_windres_bfd_content (wrbfd, &bgc, start, BIN_GROUP_CURSOR_SIZE); + } + return off; } /* Convert a dialog resource to binary. */ -static struct bindata * -res_to_bin_dialog (const struct dialog *dialog, int big_endian) +static rc_uint_type +res_to_bin_dialog (windres_bfd *wrbfd, rc_uint_type off, const rc_dialog *dialog) { + rc_uint_type off_delta; + rc_uint_type start, marker; int dialogex; - struct bindata *first, **pp; - unsigned long length; - int off, c; - struct dialog_control *dc; + int c; + rc_dialog_control *dc; + struct bin_dialogex bdx; + struct bin_dialog bd; + off_delta = off; + start = off; dialogex = extended_dialog (dialog); - first = (struct bindata *) reswr_alloc (sizeof *first); - first->length = dialogex ? 26 : 18; - first->data = (unsigned char *) reswr_alloc (first->length); - - length = first->length; - + if (wrbfd) + { if (! dialogex) { - put_32 (big_endian, dialog->style, first->data); - put_32 (big_endian, dialog->exstyle, first->data + 4); - off = 8; + windres_put_32 (wrbfd, bd.style, dialog->style); + windres_put_32 (wrbfd, bd.exstyle, dialog->exstyle); + windres_put_16 (wrbfd, bd.x, dialog->x); + windres_put_16 (wrbfd, bd.y, dialog->y); + windres_put_16 (wrbfd, bd.width, dialog->width); + windres_put_16 (wrbfd, bd.height, dialog->height); } else { - put_16 (big_endian, 1, first->data); - put_16 (big_endian, 0xffff, first->data + 2); - - if (dialog->ex == NULL) - put_32 (big_endian, 0, first->data + 4); - else - put_32 (big_endian, dialog->ex->help, first->data + 4); - put_32 (big_endian, dialog->exstyle, first->data + 8); - put_32 (big_endian, dialog->style, first->data + 12); - off = 16; + windres_put_16 (wrbfd, bdx.sig1, 1); + windres_put_16 (wrbfd, bdx.sig2, 0xffff); + windres_put_32 (wrbfd, bdx.help, (dialog->ex ? dialog->ex->help : 0)); + windres_put_32 (wrbfd, bdx.exstyle, dialog->exstyle); + windres_put_32 (wrbfd, bdx.style, dialog->style); + windres_put_16 (wrbfd, bdx.x, dialog->x); + windres_put_16 (wrbfd, bdx.y, dialog->y); + windres_put_16 (wrbfd, bdx.width, dialog->width); + windres_put_16 (wrbfd, bdx.height, dialog->height); + } } - put_16 (big_endian, dialog->x, first->data + off + 2); - put_16 (big_endian, dialog->y, first->data + off + 4); - put_16 (big_endian, dialog->width, first->data + off + 6); - put_16 (big_endian, dialog->height, first->data + off + 8); + off += (dialogex != 0 ? BIN_DIALOGEX_SIZE : BIN_DIALOG_SIZE); - pp = &first->next; - - *pp = resid_to_bin (dialog->menu, big_endian); - length += (*pp)->length; - pp = &(*pp)->next; - - *pp = resid_to_bin (dialog->class, big_endian); - length += (*pp)->length; - pp = &(*pp)->next; - - *pp = unicode_to_bin (dialog->caption, big_endian); - length += (*pp)->length; - pp = &(*pp)->next; + off = resid_to_bin (wrbfd, off, dialog->menu); + off = resid_to_bin (wrbfd, off, dialog->class); + off = unicode_to_bin (wrbfd, off, dialog->caption); if ((dialog->style & DS_SETFONT) != 0) { - struct bindata *d; - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = dialogex ? 6 : 2; - d->data = (unsigned char *) reswr_alloc (d->length); - - length += d->length; - - put_16 (big_endian, dialog->pointsize, d->data); - - if (dialogex) + if (wrbfd) { - if (dialog->ex == NULL) + if (! dialogex) { - put_16 (big_endian, 0, d->data + 2); - put_8 (0, d->data + 4); - put_8 (1, d->data + 5); + struct bin_dialogfont bdf; + windres_put_16 (wrbfd, bdf.pointsize, dialog->pointsize); + set_windres_bfd_content (wrbfd, &bdf, off, BIN_DIALOGFONT_SIZE); } else { - put_16 (big_endian, dialog->ex->weight, d->data + 2); - put_8 (dialog->ex->italic, d->data + 4); - put_8 (dialog->ex->charset, d->data + 5); + struct bin_dialogexfont bdxf; + windres_put_16 (wrbfd, bdxf.pointsize, dialog->pointsize); + windres_put_16 (wrbfd, bdxf.weight, (dialog->ex == NULL ? 0 : dialog->ex->weight)); + windres_put_8 (wrbfd, bdxf.italic, (dialog->ex == NULL ? 0 : dialog->ex->italic)); + windres_put_8 (wrbfd, bdxf.charset, (dialog->ex == NULL ? 1 : dialog->ex->charset)); + set_windres_bfd_content (wrbfd, &bdxf, off, BIN_DIALOGEXFONT_SIZE); } } - - *pp = d; - pp = &d->next; - - *pp = unicode_to_bin (dialog->font, big_endian); - length += (*pp)->length; - pp = &(*pp)->next; + off += (dialogex ? BIN_DIALOGEXFONT_SIZE : BIN_DIALOGFONT_SIZE); + off = unicode_to_bin (wrbfd, off, dialog->font); } - - c = 0; - for (dc = dialog->controls; dc != NULL; dc = dc->next) + for (c = 0, dc = dialog->controls; dc != NULL; dc = dc->next, c++) { - struct bindata *d; - int dcoff; - - ++c; - - dword_align_bin (&pp, &length); - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = dialogex ? 24 : 18; - d->data = (unsigned char *) reswr_alloc (d->length); - - length += d->length; + bfd_byte dc_rclen[2]; + off += (4 - ((off - off_delta) & 3)) & 3; + if (wrbfd) + { if (! dialogex) { - put_32 (big_endian, dc->style, d->data); - put_32 (big_endian, dc->exstyle, d->data + 4); - dcoff = 8; + struct bin_dialog_control bdc; + + windres_put_32 (wrbfd, bdc.style, dc->style); + windres_put_32 (wrbfd, bdc.exstyle, dc->exstyle); + windres_put_16 (wrbfd, bdc.x, dc->x); + windres_put_16 (wrbfd, bdc.y, dc->y); + windres_put_16 (wrbfd, bdc.width, dc->width); + windres_put_16 (wrbfd, bdc.height, dc->height); + windres_put_16 (wrbfd, bdc.id, dc->id); + set_windres_bfd_content (wrbfd, &bdc, off, BIN_DIALOG_CONTROL_SIZE); } else { - put_32 (big_endian, dc->help, d->data); - put_32 (big_endian, dc->exstyle, d->data + 4); - put_32 (big_endian, dc->style, d->data + 8); - dcoff = 12; - } + struct bin_dialogex_control bdc; - put_16 (big_endian, dc->x, d->data + dcoff); - put_16 (big_endian, dc->y, d->data + dcoff + 2); - put_16 (big_endian, dc->width, d->data + dcoff + 4); - put_16 (big_endian, dc->height, d->data + dcoff + 6); + windres_put_32 (wrbfd, bdc.help, dc->help); + windres_put_32 (wrbfd, bdc.exstyle, dc->exstyle); + windres_put_32 (wrbfd, bdc.style, dc->style); + windres_put_16 (wrbfd, bdc.x, dc->x); + windres_put_16 (wrbfd, bdc.y, dc->y); + windres_put_16 (wrbfd, bdc.width, dc->width); + windres_put_16 (wrbfd, bdc.height, dc->height); + windres_put_32 (wrbfd, bdc.id, dc->id); + set_windres_bfd_content (wrbfd, &bdc, off, BIN_DIALOGEX_CONTROL_SIZE); + } + } + off += (dialogex != 0 ? BIN_DIALOGEX_CONTROL_SIZE : BIN_DIALOG_CONTROL_SIZE); - if (dialogex) - put_32 (big_endian, dc->id, d->data + dcoff + 8); - else - put_16 (big_endian, dc->id, d->data + dcoff + 8); + off = resid_to_bin (wrbfd, off, dc->class); + off = resid_to_bin (wrbfd, off, dc->text); - *pp = d; - pp = &d->next; - - *pp = resid_to_bin (dc->class, big_endian); - length += (*pp)->length; - pp = &(*pp)->next; - - *pp = resid_to_bin (dc->text, big_endian); - length += (*pp)->length; - pp = &(*pp)->next; - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = 2; - d->data = (unsigned char *) reswr_alloc (d->length); - - length += 2; - - d->next = NULL; - *pp = d; - pp = &d->next; + marker = off; /* Save two bytes for size of optional data. */ + off += 2; if (dc->data == NULL) - put_16 (big_endian, 0, d->data); + { + if (wrbfd) + windres_put_16 (wrbfd, dc_rclen, 0); + } else { - unsigned long sublen; + rc_uint_type saved_off = off; + rc_uint_type old_off; + off += (4 - ((off - off_delta) & 3)) & 3; - dword_align_bin (&pp, &length); - - *pp = res_to_bin_rcdata (dc->data, big_endian); - sublen = 0; - while (*pp != NULL) - { - sublen += (*pp)->length; - pp = &(*pp)->next; + old_off = off; + off = res_to_bin_rcdata (wrbfd, off, dc->data); + if ((off - old_off) == 0) + old_off = off = saved_off; + if (wrbfd) + windres_put_16 (wrbfd, dc_rclen, off - old_off); } - - put_16 (big_endian, sublen, d->data); - - length += sublen; + if (wrbfd) + set_windres_bfd_content (wrbfd, dc_rclen, marker, 2); } - } - put_16 (big_endian, c, first->data + off); - return first; + if (wrbfd) + { + windres_put_16 (wrbfd, (dialogex != 0 ? bdx.off : bd.off), c); + if (! dialogex) + set_windres_bfd_content (wrbfd, &bd, start, BIN_DIALOG_SIZE); + else + set_windres_bfd_content (wrbfd, &bdx, start, BIN_DIALOGEX_SIZE); + } + + return off; } /* Convert a fontdir resource to binary. */ - -static struct bindata * -res_to_bin_fontdir (const struct fontdir *fontdirs, int big_endian) +static rc_uint_type +res_to_bin_fontdir (windres_bfd *wrbfd, rc_uint_type off, const rc_fontdir *fontdirs) { - struct bindata *first, **pp; + rc_uint_type start; int c; - const struct fontdir *fd; + const rc_fontdir *fd; - first = (struct bindata *) reswr_alloc (sizeof *first); - first->length = 2; - first->data = (unsigned char *) reswr_alloc (first->length); + start = off; + off += 2; - first->next = NULL; - pp = &first->next; - - c = 0; - for (fd = fontdirs; fd != NULL; fd = fd->next) + for (c = 0, fd = fontdirs; fd != NULL; fd = fd->next, c++) { - struct bindata *d; - - ++c; - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = 2; - d->data = (unsigned char *) reswr_alloc (d->length); - - put_16 (big_endian, fd->index, d->data); - - *pp = d; - pp = &d->next; - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = fd->length; - d->data = (unsigned char *) fd->data; - - d->next = NULL; - *pp = d; - pp = &d->next; + if (wrbfd) + { + bfd_byte d[2]; + windres_put_16 (wrbfd, d, fd->index); + set_windres_bfd_content (wrbfd, d, off, 2); + if (fd->length) + set_windres_bfd_content (wrbfd, fd->data, off + 2, fd->length); + } + off += (rc_uint_type) fd->length + 2; } - put_16 (big_endian, c, first->data); - - return first; + if (wrbfd) + { + bfd_byte d[2]; + windres_put_16 (wrbfd, d, c); + set_windres_bfd_content (wrbfd, d, start, 2); + } + return off; } /* Convert a group icon resource to binary. */ -static struct bindata * -res_to_bin_group_icon (const struct group_icon *group_icons, int big_endian) +static rc_uint_type +res_to_bin_group_icon (windres_bfd *wrbfd, rc_uint_type off, const rc_group_icon *group_icons) { - struct bindata *first, **pp; + rc_uint_type start; + struct bin_group_icon bgi; int c; - const struct group_icon *gi; + const rc_group_icon *gi; - first = (struct bindata *) reswr_alloc (sizeof *first); - first->length = 6; - first->data = (unsigned char *) reswr_alloc (first->length); + start = off; + off += BIN_GROUP_ICON_SIZE; - put_16 (big_endian, 0, first->data); - put_16 (big_endian, 1, first->data + 2); - - first->next = NULL; - pp = &first->next; - - c = 0; - for (gi = group_icons; gi != NULL; gi = gi->next) + for (c = 0, gi = group_icons; gi != NULL; gi = gi->next, c++) { - struct bindata *d; + struct bin_group_icon_item bgii; - ++c; - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = 14; - d->data = (unsigned char *) reswr_alloc (d->length); - - d->data[0] = gi->width; - d->data[1] = gi->height; - d->data[2] = gi->colors; - d->data[3] = 0; - put_16 (big_endian, gi->planes, d->data + 4); - put_16 (big_endian, gi->bits, d->data + 6); - put_32 (big_endian, gi->bytes, d->data + 8); - put_16 (big_endian, gi->index, d->data + 12); - - d->next = NULL; - *pp = d; - pp = &d->next; + if (wrbfd) + { + windres_put_8 (wrbfd, bgii.width, gi->width); + windres_put_8 (wrbfd, bgii.height, gi->height); + windres_put_8 (wrbfd, bgii.colors, gi->colors); + windres_put_8 (wrbfd, bgii.pad, 0); + windres_put_16 (wrbfd, bgii.planes, gi->planes); + windres_put_16 (wrbfd, bgii.bits, gi->bits); + windres_put_32 (wrbfd, bgii.bytes, gi->bytes); + windres_put_16 (wrbfd, bgii.index, gi->index); + set_windres_bfd_content (wrbfd, &bgii, off, BIN_GROUP_ICON_ITEM_SIZE); + } + off += BIN_GROUP_ICON_ITEM_SIZE; } - put_16 (big_endian, c, first->data + 4); - - return first; + if (wrbfd) + { + windres_put_16 (wrbfd, bgi.sig1, 0); + windres_put_16 (wrbfd, bgi.sig2, 1); + windres_put_16 (wrbfd, bgi.count, c); + set_windres_bfd_content (wrbfd, &bgi, start, BIN_GROUP_ICON_SIZE); + } + return off; } /* Convert a menu resource to binary. */ -static struct bindata * -res_to_bin_menu (const struct menu *menu, int big_endian) +static rc_uint_type +res_to_bin_menu (windres_bfd *wrbfd, rc_uint_type off, const rc_menu *menu) { int menuex; - struct bindata *d; menuex = extended_menu (menu); - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = menuex ? 8 : 4; - d->data = (unsigned char *) reswr_alloc (d->length); - + if (wrbfd) + { if (! menuex) { - put_16 (big_endian, 0, d->data); - put_16 (big_endian, 0, d->data + 2); - - d->next = res_to_bin_menuitems (menu->items, big_endian); + struct bin_menu bm; + windres_put_16 (wrbfd, bm.sig1, 0); + windres_put_16 (wrbfd, bm.sig2, 0); + set_windres_bfd_content (wrbfd, &bm, off, BIN_MENU_SIZE); } else { - put_16 (big_endian, 1, d->data); - put_16 (big_endian, 4, d->data + 2); - put_32 (big_endian, menu->help, d->data + 4); - - d->next = res_to_bin_menuexitems (menu->items, big_endian); + struct bin_menuex bm; + windres_put_16 (wrbfd, bm.sig1, 1); + windres_put_16 (wrbfd, bm.sig2, 4); + windres_put_32 (wrbfd, bm.help, menu->help); + set_windres_bfd_content (wrbfd, &bm, off, BIN_MENUEX_SIZE); } - - return d; + } + off += (menuex != 0 ? BIN_MENUEX_SIZE : BIN_MENU_SIZE); + if (! menuex) + { + off = res_to_bin_menuitems (wrbfd, off, menu->items); + } + else + { + off = res_to_bin_menuexitems (wrbfd, off, menu->items); + } + return off; } /* Convert menu items to binary. */ -static struct bindata * -res_to_bin_menuitems (const struct menuitem *items, int big_endian) +static rc_uint_type +res_to_bin_menuitems (windres_bfd *wrbfd, rc_uint_type off, const rc_menuitem *items) { - struct bindata *first, **pp; - const struct menuitem *mi; - - first = NULL; - pp = &first; + const rc_menuitem *mi; for (mi = items; mi != NULL; mi = mi->next) { - struct bindata *d; + struct bin_menuitem bmi; int flags; - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = mi->popup == NULL ? 4 : 2; - d->data = (unsigned char *) reswr_alloc (d->length); - flags = mi->type; if (mi->next == NULL) flags |= MENUITEM_ENDMENU; if (mi->popup != NULL) flags |= MENUITEM_POPUP; - put_16 (big_endian, flags, d->data); - + if (wrbfd) + { + windres_put_16 (wrbfd, bmi.flags, flags); if (mi->popup == NULL) - put_16 (big_endian, mi->id, d->data + 2); + windres_put_16 (wrbfd, bmi.id, mi->id); + set_windres_bfd_content (wrbfd, &bmi, off, + mi->popup == NULL ? BIN_MENUITEM_SIZE + : BIN_MENUITEM_POPUP_SIZE); + } + off += (mi->popup == NULL ? BIN_MENUITEM_SIZE : BIN_MENUITEM_POPUP_SIZE); - *pp = d; - pp = &d->next; - - *pp = unicode_to_bin (mi->text, big_endian); - pp = &(*pp)->next; + off = unicode_to_bin (wrbfd, off, mi->text); if (mi->popup != NULL) { - *pp = res_to_bin_menuitems (mi->popup, big_endian); - while (*pp != NULL) - pp = &(*pp)->next; + off = res_to_bin_menuitems (wrbfd, off, mi->popup); } } - - return first; + return off; } /* Convert menuex items to binary. */ -static struct bindata * -res_to_bin_menuexitems (const struct menuitem *items, int big_endian) +static rc_uint_type +res_to_bin_menuexitems (windres_bfd *wrbfd, rc_uint_type off, const rc_menuitem *items) { - struct bindata *first, **pp; - unsigned long length; - const struct menuitem *mi; - - first = NULL; - pp = &first; - - length = 0; + rc_uint_type off_delta = off; + const rc_menuitem *mi; for (mi = items; mi != NULL; mi = mi->next) { - struct bindata *d; + struct bin_menuitemex bmi; int flags; - dword_align_bin (&pp, &length); - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = 12; - d->data = (unsigned char *) reswr_alloc (d->length); - - length += 12; - - put_32 (big_endian, mi->type, d->data); - put_32 (big_endian, mi->state, d->data + 4); - put_16 (big_endian, mi->id, d->data + 8); + off += (4 - ((off - off_delta) & 3)) & 3; flags = 0; if (mi->next == NULL) flags |= 0x80; if (mi->popup != NULL) flags |= 1; - put_16 (big_endian, flags, d->data + 10); - *pp = d; - pp = &d->next; + if (wrbfd) + { + windres_put_32 (wrbfd, bmi.type, mi->type); + windres_put_32 (wrbfd, bmi.state, mi->state); + windres_put_32 (wrbfd, bmi.id, mi->id); + windres_put_16 (wrbfd, bmi.flags, flags); + set_windres_bfd_content (wrbfd, &bmi, off, BIN_MENUITEMEX_SIZE); + } + off += BIN_MENUITEMEX_SIZE; - *pp = unicode_to_bin (mi->text, big_endian); - length += (*pp)->length; - pp = &(*pp)->next; + off = unicode_to_bin (wrbfd, off, mi->text); if (mi->popup != NULL) { - dword_align_bin (&pp, &length); + bfd_byte help[4]; - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = 4; - d->data = (unsigned char *) reswr_alloc (d->length); + off += (4 - ((off - off_delta) & 3)) & 3; - put_32 (big_endian, mi->help, d->data); - - *pp = d; - pp = &d->next; - - *pp = res_to_bin_menuexitems (mi->popup, big_endian); - while (*pp != NULL) + if (wrbfd) { - length += (*pp)->length; - pp = &(*pp)->next; + windres_put_32 (wrbfd, help, mi->help); + set_windres_bfd_content (wrbfd, help, off, 4); } + off += 4; + off = res_to_bin_menuexitems (wrbfd, off, mi->popup); } } - - return first; + return off; } /* Convert an rcdata resource to binary. This is also used to convert - other information which happens to be stored in rcdata_item lists + other information which happens to be stored in rc_rcdata_item lists to binary. */ -static struct bindata * -res_to_bin_rcdata (const struct rcdata_item *items, int big_endian) +static rc_uint_type +res_to_bin_rcdata (windres_bfd *wrbfd, rc_uint_type off, const rc_rcdata_item *items) { - struct bindata *first, **pp; - const struct rcdata_item *ri; - - first = NULL; - pp = &first; + const rc_rcdata_item *ri; for (ri = items; ri != NULL; ri = ri->next) { - struct bindata *d; - - d = (struct bindata *) reswr_alloc (sizeof *d); - + rc_uint_type len; switch (ri->type) { default: abort (); - case RCDATA_WORD: - d->length = 2; - d->data = (unsigned char *) reswr_alloc (d->length); - put_16 (big_endian, ri->u.word, d->data); + len = 2; break; - case RCDATA_DWORD: - d->length = 4; - d->data = (unsigned char *) reswr_alloc (d->length); - put_32 (big_endian, ri->u.dword, d->data); + len = 4; break; - case RCDATA_STRING: - d->length = ri->u.string.length; - d->data = (unsigned char *) ri->u.string.s; + len = ri->u.string.length; break; - case RCDATA_WSTRING: - { - unsigned long i; - - d->length = ri->u.wstring.length * 2; - d->data = (unsigned char *) reswr_alloc (d->length); - for (i = 0; i < ri->u.wstring.length; i++) - put_16 (big_endian, ri->u.wstring.w[i], d->data + i * 2); - break; - } - + len = ri->u.wstring.length * sizeof (unichar); + break; case RCDATA_BUFFER: - d->length = ri->u.buffer.length; - d->data = (unsigned char *) ri->u.buffer.data; + len = ri->u.buffer.length; break; } + if (wrbfd) + { + bfd_byte h[4]; + bfd_byte *hp = &h[0]; + switch (ri->type) + { + case RCDATA_WORD: + windres_put_16 (wrbfd, hp, ri->u.word); + break; + case RCDATA_DWORD: + windres_put_32 (wrbfd, hp, ri->u.dword); + break; + case RCDATA_STRING: + hp = (bfd_byte *) ri->u.string.s; + break; + case RCDATA_WSTRING: + { + rc_uint_type i; - d->next = NULL; - *pp = d; - pp = &d->next; + hp = (bfd_byte *) reswr_alloc (len); + for (i = 0; i < ri->u.wstring.length; i++) + windres_put_16 (wrbfd, hp + i * sizeof (unichar), ri->u.wstring.w[i]); + } + break; + case RCDATA_BUFFER: + hp = (bfd_byte *) ri->u.buffer.data; + break; + } + set_windres_bfd_content (wrbfd, hp, off, len); } - - return first; + off += len; + } + return off; } /* Convert a stringtable resource to binary. */ -static struct bindata * -res_to_bin_stringtable (const struct stringtable *st, int big_endian) +static rc_uint_type +res_to_bin_stringtable (windres_bfd *wrbfd, rc_uint_type off, + const rc_stringtable *st) { - struct bindata *first, **pp; int i; - first = NULL; - pp = &first; - for (i = 0; i < 16; i++) { - int slen, j; - struct bindata *d; + rc_uint_type slen, length; unichar *s; - slen = st->strings[i].length; + slen = (rc_uint_type) st->strings[i].length; s = st->strings[i].string; - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = 2 + slen * 2; - d->data = (unsigned char *) reswr_alloc (d->length); + length = 2 + slen * 2; + if (wrbfd) + { + bfd_byte *hp; + rc_uint_type j; - put_16 (big_endian, slen, d->data); + hp = (bfd_byte *) reswr_alloc (length); + windres_put_16 (wrbfd, hp, slen); for (j = 0; j < slen; j++) - put_16 (big_endian, s[j], d->data + 2 + j * 2); - - d->next = NULL; - *pp = d; - pp = &d->next; + windres_put_16 (wrbfd, hp + 2 + j * 2, s[j]); + set_windres_bfd_content (wrbfd, hp, off, length); } - - return first; + off += length; + } + return off; } /* Convert an ASCII string to a unicode binary string. This always returns exactly one bindata structure. */ -static struct bindata * -string_to_unicode_bin (const char *s, int big_endian) +static rc_uint_type +string_to_unicode_bin (windres_bfd *wrbfd, rc_uint_type off, const char *s) { - size_t len, i; - struct bindata *d; + rc_uint_type len; - len = strlen (s); + len = (rc_uint_type) strlen (s); - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = len * 2 + 2; - d->data = (unsigned char *) reswr_alloc (d->length); + if (wrbfd) + { + rc_uint_type i; + bfd_byte *hp; - for (i = 0; i < len; i++) - put_16 (big_endian, s[i], d->data + i * 2); - put_16 (big_endian, 0, d->data + i * 2); + hp = (bfd_byte *) reswr_alloc ((len + 1) * sizeof (unichar)); - d->next = NULL; + for (i = 0; i < len; i++) + windres_put_16 (wrbfd, hp + i * 2, s[i]); + windres_put_16 (wrbfd, hp + i * 2, 0); + set_windres_bfd_content (wrbfd, hp, off, (len + 1) * sizeof (unichar)); + } + off += (rc_uint_type) ((len + 1) * sizeof (unichar)); + return off; +} - return d; +static rc_uint_type +res_to_bin_toolbar (windres_bfd *wrbfd, rc_uint_type off, rc_toolbar *tb) +{ + if (wrbfd) + { + struct bin_toolbar bt; + windres_put_32 (wrbfd, bt.button_width, tb->button_width); + windres_put_32 (wrbfd, bt.button_height, tb->button_height); + windres_put_32 (wrbfd, bt.nitems, tb->nitems); + set_windres_bfd_content (wrbfd, &bt, off, BIN_TOOLBAR_SIZE); + if (tb->nitems > 0) + { + rc_toolbar_item *it; + bfd_byte *ids; + rc_uint_type i = 0; + + ids = (bfd_byte *) reswr_alloc (tb->nitems * 4); + it=tb->items; + while(it != NULL) + { + windres_put_32 (wrbfd, ids + i, it->id.u.id); + i += 4; + it = it->next; + } + set_windres_bfd_content (wrbfd, ids, off + BIN_TOOLBAR_SIZE, i); + } + } + off += BIN_TOOLBAR_SIZE + tb->nitems * 4; + + return off; } /* Convert a versioninfo resource to binary. */ -static struct bindata * -res_to_bin_versioninfo (const struct versioninfo *versioninfo, int big_endian) +static rc_uint_type +res_to_bin_versioninfo (windres_bfd *wrbfd, rc_uint_type off, + const rc_versioninfo *versioninfo) { - struct bindata *first, **pp; - unsigned long length; - struct ver_info *vi; + rc_uint_type off_delta = off; + rc_uint_type start; + struct bin_versioninfo bvi; + rc_ver_info *vi; - first = (struct bindata *) reswr_alloc (sizeof *first); - first->length = 6; - first->data = (unsigned char *) reswr_alloc (first->length); - - length = 6; - - if (versioninfo->fixed == NULL) - put_16 (big_endian, 0, first->data + 2); - else - put_16 (big_endian, 52, first->data + 2); - - put_16 (big_endian, 0, first->data + 4); - - pp = &first->next; - - *pp = string_to_unicode_bin ("VS_VERSION_INFO", big_endian); - length += (*pp)->length; - pp = &(*pp)->next; - - dword_align_bin (&pp, &length); + start = off; + off += BIN_VERSIONINFO_SIZE; + off = string_to_unicode_bin (wrbfd, off, "VS_VERSION_INFO"); + off += (4 - ((off - off_delta) & 3)) & 3; if (versioninfo->fixed != NULL) { - const struct fixed_versioninfo *fi; - struct bindata *d; - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = 52; - d->data = (unsigned char *) reswr_alloc (d->length); - - length += 52; + if (wrbfd) + { + struct bin_fixed_versioninfo bfv; + const rc_fixed_versioninfo *fi; fi = versioninfo->fixed; - - put_32 (big_endian, 0xfeef04bd, d->data); - put_32 (big_endian, 0x10000, d->data + 4); - put_32 (big_endian, fi->file_version_ms, d->data + 8); - put_32 (big_endian, fi->file_version_ls, d->data + 12); - put_32 (big_endian, fi->product_version_ms, d->data + 16); - put_32 (big_endian, fi->product_version_ls, d->data + 20); - put_32 (big_endian, fi->file_flags_mask, d->data + 24); - put_32 (big_endian, fi->file_flags, d->data + 28); - put_32 (big_endian, fi->file_os, d->data + 32); - put_32 (big_endian, fi->file_type, d->data + 36); - put_32 (big_endian, fi->file_subtype, d->data + 40); - put_32 (big_endian, fi->file_date_ms, d->data + 44); - put_32 (big_endian, fi->file_date_ls, d->data + 48); - - d->next = NULL; - *pp = d; - pp = &d->next; + windres_put_32 (wrbfd, bfv.sig1, 0xfeef04bd); + windres_put_32 (wrbfd, bfv.sig2, 0x10000); + windres_put_32 (wrbfd, bfv.file_version, fi->file_version_ms); + windres_put_32 (wrbfd, bfv.file_version_ls, fi->file_version_ls); + windres_put_32 (wrbfd, bfv.product_version_ms, fi->product_version_ms); + windres_put_32 (wrbfd, bfv.product_version_ls, fi->product_version_ls); + windres_put_32 (wrbfd, bfv.file_flags_mask, fi->file_flags_mask); + windres_put_32 (wrbfd, bfv.file_flags, fi->file_flags); + windres_put_32 (wrbfd, bfv.file_os, fi->file_os); + windres_put_32 (wrbfd, bfv.file_type, fi->file_type); + windres_put_32 (wrbfd, bfv.file_subtype, fi->file_subtype); + windres_put_32 (wrbfd, bfv.file_date_ms, fi->file_date_ms); + windres_put_32 (wrbfd, bfv.file_date_ls, fi->file_date_ls); + set_windres_bfd_content (wrbfd, &bfv, off, BIN_FIXED_VERSIONINFO_SIZE); + } + off += BIN_FIXED_VERSIONINFO_SIZE; } for (vi = versioninfo->var; vi != NULL; vi = vi->next) { - struct bindata *vid; - unsigned long vilen; + struct bin_ver_info bv; + rc_uint_type bv_off; - dword_align_bin (&pp, &length); + off += (4 - ((off - off_delta) & 3)) & 3; - vid = (struct bindata *) reswr_alloc (sizeof *vid); - vid->length = 6; - vid->data = (unsigned char *) reswr_alloc (vid->length); + bv_off = off; - length += 6; - vilen = 6; - - put_16 (big_endian, 0, vid->data + 2); - put_16 (big_endian, 0, vid->data + 4); - - *pp = vid; - pp = &vid->next; + off += BIN_VER_INFO_SIZE; switch (vi->type) { default: abort (); - case VERINFO_STRING: { - unsigned long hold, vslen; - struct bindata *vsd; - const struct ver_stringinfo *vs; + struct bin_ver_info bvsd; + rc_uint_type vs_off; + const rc_ver_stringinfo *vs; - *pp = string_to_unicode_bin ("StringFileInfo", big_endian); - length += (*pp)->length; - vilen += (*pp)->length; - pp = &(*pp)->next; + off = string_to_unicode_bin (wrbfd, off, "StringFileInfo"); + off += (4 - ((off - off_delta) & 3)) & 3; - hold = length; - dword_align_bin (&pp, &length); - vilen += length - hold; + vs_off = off; - vsd = (struct bindata *) reswr_alloc (sizeof *vsd); - vsd->length = 6; - vsd->data = (unsigned char *) reswr_alloc (vsd->length); + off += BIN_VER_INFO_SIZE; - length += 6; - vilen += 6; - vslen = 6; - - put_16 (big_endian, 0, vsd->data + 2); - put_16 (big_endian, 0, vsd->data + 4); - - *pp = vsd; - pp = &vsd->next; - - *pp = unicode_to_bin (vi->u.string.language, big_endian); - length += (*pp)->length; - vilen += (*pp)->length; - vslen += (*pp)->length; - pp = &(*pp)->next; + off = unicode_to_bin (wrbfd, off, vi->u.string.language); for (vs = vi->u.string.strings; vs != NULL; vs = vs->next) { - struct bindata *vssd; - unsigned long vsslen; + struct bin_ver_info bvss; + rc_uint_type vss_off,str_off; - hold = length; - dword_align_bin (&pp, &length); - vilen += length - hold; - vslen += length - hold; + off += (4 - ((off - off_delta) & 3)) & 3; - vssd = (struct bindata *) reswr_alloc (sizeof *vssd); - vssd->length = 6; - vssd->data = (unsigned char *) reswr_alloc (vssd->length); + vss_off = off; + off += BIN_VER_INFO_SIZE; - length += 6; - vilen += 6; - vslen += 6; - vsslen = 6; + off = unicode_to_bin (wrbfd, off, vs->key); - put_16 (big_endian, 1, vssd->data + 4); + off += (4 - ((off - off_delta) & 3)) & 3; - *pp = vssd; - pp = &vssd->next; - - *pp = unicode_to_bin (vs->key, big_endian); - length += (*pp)->length; - vilen += (*pp)->length; - vslen += (*pp)->length; - vsslen += (*pp)->length; - pp = &(*pp)->next; - - hold = length; - dword_align_bin (&pp, &length); - vilen += length - hold; - vslen += length - hold; - vsslen += length - hold; - - *pp = unicode_to_bin (vs->value, big_endian); - put_16 (big_endian, (*pp)->length / 2, vssd->data + 2); - length += (*pp)->length; - vilen += (*pp)->length; - vslen += (*pp)->length; - vsslen += (*pp)->length; - pp = &(*pp)->next; - - put_16 (big_endian, vsslen, vssd->data); + str_off = off; + off = unicode_to_bin (wrbfd, off, vs->value); + if (wrbfd) + { + windres_put_16 (wrbfd, bvss.size, off - vss_off); + windres_put_16 (wrbfd, bvss.sig1, (off - str_off) / 2); + windres_put_16 (wrbfd, bvss.sig2, 1); + set_windres_bfd_content (wrbfd, &bvss, vss_off, + BIN_VER_INFO_SIZE); + } + } + if (wrbfd) + { + windres_put_16 (wrbfd, bvsd.size, off - vs_off); + windres_put_16 (wrbfd, bvsd.sig1, 0); + windres_put_16 (wrbfd, bvsd.sig2, 0); + set_windres_bfd_content (wrbfd, &bvsd, vs_off, + BIN_VER_INFO_SIZE); } - - put_16 (big_endian, vslen, vsd->data); - break; } case VERINFO_VAR: { - unsigned long hold, vvlen, vvvlen; - struct bindata *vvd; - const struct ver_varinfo *vv; + rc_uint_type vvd_off, vvvd_off; + struct bin_ver_info bvvd; + const rc_ver_varinfo *vv; - *pp = string_to_unicode_bin ("VarFileInfo", big_endian); - length += (*pp)->length; - vilen += (*pp)->length; - pp = &(*pp)->next; + off = string_to_unicode_bin (wrbfd, off, "VarFileInfo"); - hold = length; - dword_align_bin (&pp, &length); - vilen += length - hold; + off += (4 - ((off - off_delta) & 3)) & 3; - vvd = (struct bindata *) reswr_alloc (sizeof *vvd); - vvd->length = 6; - vvd->data = (unsigned char *) reswr_alloc (vvd->length); + vvd_off = off; + off += BIN_VER_INFO_SIZE; - length += 6; - vilen += 6; - vvlen = 6; + off = unicode_to_bin (wrbfd, off, vi->u.var.key); - put_16 (big_endian, 0, vvd->data + 4); + off += (4 - ((off - off_delta) & 3)) & 3; - *pp = vvd; - pp = &vvd->next; - - *pp = unicode_to_bin (vi->u.var.key, big_endian); - length += (*pp)->length; - vilen += (*pp)->length; - vvlen += (*pp)->length; - pp = &(*pp)->next; - - hold = length; - dword_align_bin (&pp, &length); - vilen += length - hold; - vvlen += length - hold; - - vvvlen = 0; + vvvd_off = off; for (vv = vi->u.var.var; vv != NULL; vv = vv->next) { - struct bindata *vvsd; + if (wrbfd) + { + bfd_byte vvsd[4]; - vvsd = (struct bindata *) reswr_alloc (sizeof *vvsd); - vvsd->length = 4; - vvsd->data = (unsigned char *) reswr_alloc (vvsd->length); - - length += 4; - vilen += 4; - vvlen += 4; - vvvlen += 4; - - put_16 (big_endian, vv->language, vvsd->data); - put_16 (big_endian, vv->charset, vvsd->data + 2); - - vvsd->next = NULL; - *pp = vvsd; - pp = &vvsd->next; + windres_put_16 (wrbfd, &vvsd[0], vv->language); + windres_put_16 (wrbfd, &vvsd[2], vv->charset); + set_windres_bfd_content (wrbfd, vvsd, off, 4); + } + off += 4; } - - put_16 (big_endian, vvlen, vvd->data); - put_16 (big_endian, vvvlen, vvd->data + 2); + if (wrbfd) + { + windres_put_16 (wrbfd, bvvd.size, off - vvd_off); + windres_put_16 (wrbfd, bvvd.sig1, off - vvvd_off); + windres_put_16 (wrbfd, bvvd.sig2, 0); + set_windres_bfd_content (wrbfd, &bvvd, vvd_off, + BIN_VER_INFO_SIZE); + } break; } } - put_16 (big_endian, vilen, vid->data); + if (wrbfd) + { + windres_put_16 (wrbfd, bv.size, off-bv_off); + windres_put_16 (wrbfd, bv.sig1, 0); + windres_put_16 (wrbfd, bv.sig2, 0); + set_windres_bfd_content (wrbfd, &bv, bv_off, + BIN_VER_INFO_SIZE); + } } - put_16 (big_endian, length, first->data); - - return first; + if (wrbfd) + { + windres_put_16 (wrbfd, bvi.size, off - start); + windres_put_16 (wrbfd, bvi.fixed_size, + versioninfo->fixed == NULL ? 0 + : BIN_FIXED_VERSIONINFO_SIZE); + windres_put_16 (wrbfd, bvi.sig2, 0); + set_windres_bfd_content (wrbfd, &bvi, start, BIN_VER_INFO_SIZE); + } + return off; } /* Convert a generic resource to binary. */ -static struct bindata * -res_to_bin_generic (unsigned long length, const unsigned char *data) +static rc_uint_type +res_to_bin_generic (windres_bfd *wrbfd, rc_uint_type off, rc_uint_type length, + const bfd_byte *data) { - struct bindata *d; - - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = length; - d->data = (unsigned char *) data; - - d->next = NULL; - - return d; + if (wrbfd && length != 0) + set_windres_bfd_content (wrbfd, data, off, length); + return off + (rc_uint_type) length; } diff --git a/binutils/rescoff.c b/binutils/rescoff.c index fdd9aad9982..737eb4f0ba9 100644 --- a/binutils/rescoff.c +++ b/binutils/rescoff.c @@ -1,7 +1,8 @@ /* rescoff.c -- read and write resources in Windows COFF files. - Copyright 1997, 1998, 1999, 2000, 2003 + Copyright 1997, 1998, 1999, 2000, 2003, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. + Rewritten by Kai Tietz, Onevision. This file is part of GNU Binutils. @@ -23,6 +24,7 @@ /* This file contains function that read and write Windows resources in COFF files. */ +#include "sysdep.h" #include "bfd.h" #include "bucomm.h" #include "libiberty.h" @@ -48,14 +50,12 @@ struct coff_file_info /* End of data read from file. */ const bfd_byte *data_end; /* Address of the resource section minus the image base of the file. */ - bfd_vma secaddr; - /* Non-zero if the file is big endian. */ - int big_endian; + rc_uint_type secaddr; }; /* A resource directory table in a COFF file. */ -struct extern_res_directory +struct __attribute__ ((__packed__)) extern_res_directory { /* Characteristics. */ bfd_byte characteristics[4]; @@ -96,26 +96,24 @@ struct extern_res_data bfd_byte reserved[4]; }; -/* Macros to swap in values. */ - -#define getfi_16(fi, s) ((fi)->big_endian ? bfd_getb16 (s) : bfd_getl16 (s)) -#define getfi_32(fi, s) ((fi)->big_endian ? bfd_getb32 (s) : bfd_getl32 (s)) - /* Local functions. */ static void overrun (const struct coff_file_info *, const char *); -static struct res_directory *read_coff_res_dir - (const bfd_byte *, const struct coff_file_info *, - const struct res_id *, int); -static struct res_resource *read_coff_data_entry - (const bfd_byte *, const struct coff_file_info *, const struct res_id *); +static rc_res_directory *read_coff_res_dir (windres_bfd *, const bfd_byte *, + const struct coff_file_info *, + const rc_res_id *, int); +static rc_res_resource *read_coff_data_entry (windres_bfd *, const bfd_byte *, + const struct coff_file_info *, + const rc_res_id *); /* Read the resources in a COFF file. */ -struct res_directory * +rc_res_directory * read_coff_rsrc (const char *filename, const char *target) { + rc_res_directory *ret; bfd *abfd; + windres_bfd wrbfd; char **matching; asection *sec; bfd_size_type size; @@ -143,27 +141,28 @@ read_coff_rsrc (const char *filename, const char *target) fatal (_("%s: no resource section"), filename); } + set_windres_bfd (&wrbfd, abfd, sec, WR_KIND_BFD); size = bfd_section_size (abfd, sec); data = (bfd_byte *) res_alloc (size); - if (! bfd_get_section_contents (abfd, sec, data, 0, size)) - bfd_fatal (_("can't read resource section")); + get_windres_bfd_content (&wrbfd, data, 0, size); finfo.filename = filename; finfo.data = data; finfo.data_end = data + size; finfo.secaddr = (bfd_get_section_vma (abfd, sec) - pe_data (abfd)->pe_opthdr.ImageBase); - finfo.big_endian = bfd_big_endian (abfd); - - bfd_close (abfd); /* Now just read in the top level resource directory. Note that we don't free data, since we create resource entries that point into it. If we ever want to free up the resource information we read, this will have to be cleaned up. */ - return read_coff_res_dir (data, &finfo, (const struct res_id *) NULL, 0); + ret = read_coff_res_dir (&wrbfd, data, &finfo, (const rc_res_id *) NULL, 0); + + bfd_close (abfd); + + return ret; } /* Give an error if we are out of bounds. */ @@ -176,14 +175,15 @@ overrun (const struct coff_file_info *finfo, const char *msg) /* Read a resource directory. */ -static struct res_directory * -read_coff_res_dir (const bfd_byte *data, const struct coff_file_info *finfo, - const struct res_id *type, int level) +static rc_res_directory * +read_coff_res_dir (windres_bfd *wrbfd, const bfd_byte *data, + const struct coff_file_info *finfo, + const rc_res_id *type, int level) { const struct extern_res_directory *erd; - struct res_directory *rd; + rc_res_directory *rd; int name_count, id_count, i; - struct res_entry **pp; + rc_res_entry **pp; const struct extern_res_entry *ere; if ((size_t) (finfo->data_end - data) < sizeof (struct extern_res_directory)) @@ -191,15 +191,15 @@ read_coff_res_dir (const bfd_byte *data, const struct coff_file_info *finfo, erd = (const struct extern_res_directory *) data; - rd = (struct res_directory *) res_alloc (sizeof *rd); - rd->characteristics = getfi_32 (finfo, erd->characteristics); - rd->time = getfi_32 (finfo, erd->time); - rd->major = getfi_16 (finfo, erd->major); - rd->minor = getfi_16 (finfo, erd->minor); + rd = (rc_res_directory *) res_alloc (sizeof (rc_res_directory)); + rd->characteristics = windres_get_32 (wrbfd, erd->characteristics, 4); + rd->time = windres_get_32 (wrbfd, erd->time, 4); + rd->major = windres_get_16 (wrbfd, erd->major, 2); + rd->minor = windres_get_16 (wrbfd, erd->minor, 2); rd->entries = NULL; - name_count = getfi_16 (finfo, erd->name_count); - id_count = getfi_16 (finfo, erd->id_count); + name_count = windres_get_16 (wrbfd, erd->name_count, 2); + id_count = windres_get_16 (wrbfd, erd->id_count, 2); pp = &rd->entries; @@ -209,33 +209,33 @@ read_coff_res_dir (const bfd_byte *data, const struct coff_file_info *finfo, for (i = 0; i < name_count; i++, ere++) { - unsigned long name, rva; - struct res_entry *re; + rc_uint_type name, rva; + rc_res_entry *re; const bfd_byte *ers; int length, j; if ((const bfd_byte *) ere >= finfo->data_end) overrun (finfo, _("named directory entry")); - name = getfi_32 (finfo, ere->name); - rva = getfi_32 (finfo, ere->rva); + name = windres_get_32 (wrbfd, ere->name, 4); + rva = windres_get_32 (wrbfd, ere->rva, 4); /* For some reason the high bit in NAME is set. */ name &=~ 0x80000000; - if (name > (size_t) (finfo->data_end - finfo->data)) + if (name > (rc_uint_type) (finfo->data_end - finfo->data)) overrun (finfo, _("directory entry name")); ers = finfo->data + name; - re = (struct res_entry *) res_alloc (sizeof *re); + re = (rc_res_entry *) res_alloc (sizeof *re); re->next = NULL; re->id.named = 1; - length = getfi_16 (finfo, ers); + length = windres_get_16 (wrbfd, ers, 2); re->id.u.n.length = length; re->id.u.n.name = (unichar *) res_alloc (length * sizeof (unichar)); for (j = 0; j < length; j++) - re->id.u.n.name[j] = getfi_16 (finfo, ers + j * 2 + 2); + re->id.u.n.name[j] = windres_get_16 (wrbfd, ers + j * 2 + 2, 2); if (level == 0) type = &re->id; @@ -243,18 +243,18 @@ read_coff_res_dir (const bfd_byte *data, const struct coff_file_info *finfo, if ((rva & 0x80000000) != 0) { rva &=~ 0x80000000; - if (rva >= (size_t) (finfo->data_end - finfo->data)) + if (rva >= (rc_uint_type) (finfo->data_end - finfo->data)) overrun (finfo, _("named subdirectory")); re->subdir = 1; - re->u.dir = read_coff_res_dir (finfo->data + rva, finfo, type, + re->u.dir = read_coff_res_dir (wrbfd, finfo->data + rva, finfo, type, level + 1); } else { - if (rva >= (size_t) (finfo->data_end - finfo->data)) + if (rva >= (rc_uint_type) (finfo->data_end - finfo->data)) overrun (finfo, _("named resource")); re->subdir = 0; - re->u.res = read_coff_data_entry (finfo->data + rva, finfo, type); + re->u.res = read_coff_data_entry (wrbfd, finfo->data + rva, finfo, type); } *pp = re; @@ -264,15 +264,15 @@ read_coff_res_dir (const bfd_byte *data, const struct coff_file_info *finfo, for (i = 0; i < id_count; i++, ere++) { unsigned long name, rva; - struct res_entry *re; + rc_res_entry *re; if ((const bfd_byte *) ere >= finfo->data_end) overrun (finfo, _("ID directory entry")); - name = getfi_32 (finfo, ere->name); - rva = getfi_32 (finfo, ere->rva); + name = windres_get_32 (wrbfd, ere->name, 4); + rva = windres_get_32 (wrbfd, ere->rva, 4); - re = (struct res_entry *) res_alloc (sizeof *re); + re = (rc_res_entry *) res_alloc (sizeof *re); re->next = NULL; re->id.named = 0; re->id.u.id = name; @@ -283,18 +283,18 @@ read_coff_res_dir (const bfd_byte *data, const struct coff_file_info *finfo, if ((rva & 0x80000000) != 0) { rva &=~ 0x80000000; - if (rva >= (size_t) (finfo->data_end - finfo->data)) + if (rva >= (rc_uint_type) (finfo->data_end - finfo->data)) overrun (finfo, _("ID subdirectory")); re->subdir = 1; - re->u.dir = read_coff_res_dir (finfo->data + rva, finfo, type, + re->u.dir = read_coff_res_dir (wrbfd, finfo->data + rva, finfo, type, level + 1); } else { - if (rva >= (size_t) (finfo->data_end - finfo->data)) + if (rva >= (rc_uint_type) (finfo->data_end - finfo->data)) overrun (finfo, _("ID resource")); re->subdir = 0; - re->u.res = read_coff_data_entry (finfo->data + rva, finfo, type); + re->u.res = read_coff_data_entry (wrbfd, finfo->data + rva, finfo, type); } *pp = re; @@ -306,12 +306,14 @@ read_coff_res_dir (const bfd_byte *data, const struct coff_file_info *finfo, /* Read a resource data entry. */ -static struct res_resource * -read_coff_data_entry (const bfd_byte *data, const struct coff_file_info *finfo, const struct res_id *type) +static rc_res_resource * +read_coff_data_entry (windres_bfd *wrbfd, const bfd_byte *data, + const struct coff_file_info *finfo, + const rc_res_id *type) { const struct extern_res_data *erd; - struct res_resource *r; - unsigned long size, rva; + rc_res_resource *r; + rc_uint_type size, rva; const bfd_byte *resdata; if (type == NULL) @@ -322,22 +324,22 @@ read_coff_data_entry (const bfd_byte *data, const struct coff_file_info *finfo, erd = (const struct extern_res_data *) data; - size = getfi_32 (finfo, erd->size); - rva = getfi_32 (finfo, erd->rva); + size = windres_get_32 (wrbfd, erd->size, 4); + rva = windres_get_32 (wrbfd, erd->rva, 4); if (rva < finfo->secaddr - || rva - finfo->secaddr >= (size_t) (finfo->data_end - finfo->data)) + || rva - finfo->secaddr >= (rc_uint_type) (finfo->data_end - finfo->data)) overrun (finfo, _("resource data")); resdata = finfo->data + (rva - finfo->secaddr); - if (size > (size_t) (finfo->data_end - resdata)) + if (size > (rc_uint_type) (finfo->data_end - resdata)) overrun (finfo, _("resource data size")); - r = bin_to_res (*type, resdata, size, finfo->big_endian); + r = bin_to_res (wrbfd, *type, resdata, size); - memset (&r->res_info, 0, sizeof (struct res_res_info)); - r->coff_info.codepage = getfi_32 (finfo, erd->codepage); - r->coff_info.reserved = getfi_32 (finfo, erd->reserved); + memset (&r->res_info, 0, sizeof (rc_res_res_info)); + r->coff_info.codepage = windres_get_32 (wrbfd, erd->codepage, 4); + r->coff_info.reserved = windres_get_32 (wrbfd, erd->reserved, 4); return r; } @@ -347,9 +349,19 @@ read_coff_data_entry (const bfd_byte *data, const struct coff_file_info *finfo, struct bindata_build { /* The data. */ - struct bindata *d; + bindata *d; /* The last structure we have added to the list. */ - struct bindata *last; + bindata *last; + /* The size of the list as a whole. */ + unsigned long length; +}; + +struct coff_res_data_build +{ + /* The data. */ + coff_res_data *d; + /* The last structure we have added to the list. */ + coff_res_data *last; /* The size of the list as a whole. */ unsigned long length; }; @@ -361,9 +373,7 @@ struct coff_write_info { /* These fields are based on the BFD. */ /* The BFD itself. */ - bfd *abfd; - /* Non-zero if the file is big endian. */ - int big_endian; + windres_bfd *wrbfd; /* Pointer to section symbol used to build RVA relocs. */ asymbol **sympp; @@ -383,27 +393,19 @@ struct coff_write_info /* Resource data entries. */ struct bindata_build dataents; /* Actual resource data. */ - struct bindata_build resources; + struct coff_res_data_build resources; /* Relocations. */ arelent **relocs; /* Number of relocations. */ unsigned int reloc_count; }; -/* Macros to swap out values. */ - -#define putcwi_16(cwi, v, s) \ - ((cwi->big_endian) ? bfd_putb16 ((v), (s)) : bfd_putl16 ((v), (s))) -#define putcwi_32(cwi, v, s) \ - ((cwi->big_endian) ? bfd_putb32 ((v), (s)) : bfd_putl32 ((v), (s))) - -static void coff_bin_sizes - (const struct res_directory *, struct coff_write_info *); -static unsigned char *coff_alloc (struct bindata_build *, size_t); +static void coff_bin_sizes (const rc_res_directory *, struct coff_write_info *); +static bfd_byte *coff_alloc (struct bindata_build *, rc_uint_type); static void coff_to_bin - (const struct res_directory *, struct coff_write_info *); + (const rc_res_directory *, struct coff_write_info *); static void coff_res_to_bin - (const struct res_resource *, struct coff_write_info *); + (const rc_res_resource *, struct coff_write_info *); /* Write resources to a COFF file. RESOURCES should already be sorted. @@ -415,12 +417,14 @@ static void coff_res_to_bin void write_coff_file (const char *filename, const char *target, - const struct res_directory *resources) + const rc_res_directory *resources) { bfd *abfd; asection *sec; struct coff_write_info cwi; - struct bindata *d; + windres_bfd wrbfd; + bindata *d; + coff_res_data *rd; unsigned long length, offset; if (filename == NULL) @@ -474,8 +478,9 @@ write_coff_file (const char *filename, const char *target, We build these different types of data in different lists. */ - cwi.abfd = abfd; - cwi.big_endian = bfd_big_endian (abfd); + set_windres_bfd (&wrbfd, abfd, sec, WR_KIND_BFD); + + cwi.wrbfd = &wrbfd; cwi.sympp = sec->symbol_ptr_ptr; cwi.dirsize = 0; cwi.dirstrsize = 0; @@ -510,7 +515,7 @@ write_coff_file (const char *filename, const char *target, alignment. */ if ((cwi.dirstrs.length & 3) != 0) { - unsigned char *ex; + bfd_byte *ex; ex = coff_alloc (&cwi.dirstrs, 2); ex[0] = 0; @@ -542,21 +547,18 @@ write_coff_file (const char *filename, const char *target, } for (d = cwi.dirstrs.d; d != NULL; d = d->next) { - if (! bfd_set_section_contents (abfd, sec, d->data, offset, d->length)) - bfd_fatal ("bfd_set_section_contents"); + set_windres_bfd_content (&wrbfd, d->data, offset, d->length); offset += d->length; } for (d = cwi.dataents.d; d != NULL; d = d->next) { - if (! bfd_set_section_contents (abfd, sec, d->data, offset, d->length)) - bfd_fatal ("bfd_set_section_contents"); + set_windres_bfd_content (&wrbfd, d->data, offset, d->length); offset += d->length; } - for (d = cwi.resources.d; d != NULL; d = d->next) + for (rd = cwi.resources.d; rd != NULL; rd = rd->next) { - if (! bfd_set_section_contents (abfd, sec, d->data, offset, d->length)) - bfd_fatal ("bfd_set_section_contents"); - offset += d->length; + res_to_bin (cwi.wrbfd, (rc_uint_type) offset, rd->res); + offset += rd->length; } assert (offset == length); @@ -572,10 +574,10 @@ write_coff_file (const char *filename, const char *target, entries. This updates fields in CWI. */ static void -coff_bin_sizes (const struct res_directory *resdir, +coff_bin_sizes (const rc_res_directory *resdir, struct coff_write_info *cwi) { - const struct res_entry *re; + const rc_res_entry *re; cwi->dirsize += sizeof (struct extern_res_directory); @@ -595,15 +597,15 @@ coff_bin_sizes (const struct res_directory *resdir, /* Allocate data for a particular list. */ -static unsigned char * -coff_alloc (struct bindata_build *bb, size_t size) +static bfd_byte * +coff_alloc (struct bindata_build *bb, rc_uint_type size) { - struct bindata *d; + bindata *d; - d = (struct bindata *) reswr_alloc (sizeof *d); + d = (bindata *) reswr_alloc (sizeof (bindata)); d->next = NULL; - d->data = (unsigned char *) reswr_alloc (size); + d->data = (bfd_byte *) reswr_alloc (size); d->length = size; if (bb->d == NULL) @@ -619,11 +621,11 @@ coff_alloc (struct bindata_build *bb, size_t size) /* Convert the resource directory RESDIR to binary. */ static void -coff_to_bin (const struct res_directory *resdir, struct coff_write_info *cwi) +coff_to_bin (const rc_res_directory *resdir, struct coff_write_info *cwi) { struct extern_res_directory *erd; int ci, cn; - const struct res_entry *e; + const rc_res_entry *e; struct extern_res_entry *ere; /* Write out the directory table. */ @@ -631,10 +633,10 @@ coff_to_bin (const struct res_directory *resdir, struct coff_write_info *cwi) erd = ((struct extern_res_directory *) coff_alloc (&cwi->dirs, sizeof (*erd))); - putcwi_32 (cwi, resdir->characteristics, erd->characteristics); - putcwi_32 (cwi, resdir->time, erd->time); - putcwi_16 (cwi, resdir->major, erd->major); - putcwi_16 (cwi, resdir->minor, erd->minor); + windres_put_32 (cwi->wrbfd, erd->characteristics, resdir->characteristics); + windres_put_32 (cwi->wrbfd, erd->time, resdir->time); + windres_put_16 (cwi->wrbfd, erd->major, resdir->major); + windres_put_16 (cwi->wrbfd, erd->minor, resdir->minor); ci = 0; cn = 0; @@ -646,8 +648,8 @@ coff_to_bin (const struct res_directory *resdir, struct coff_write_info *cwi) ++ci; } - putcwi_16 (cwi, cn, erd->name_count); - putcwi_16 (cwi, ci, erd->id_count); + windres_put_16 (cwi->wrbfd, erd->name_count, cn); + windres_put_16 (cwi->wrbfd, erd->id_count, ci); /* Write out the data entries. Note that we allocate space for all the entries before writing them out. That permits a recursive @@ -658,35 +660,33 @@ coff_to_bin (const struct res_directory *resdir, struct coff_write_info *cwi) for (e = resdir->entries; e != NULL; e = e->next, ere++) { if (! e->id.named) - putcwi_32 (cwi, e->id.u.id, ere->name); + windres_put_32 (cwi->wrbfd, ere->name, e->id.u.id); else { - unsigned char *str; - int i; + bfd_byte *str; + rc_uint_type i; /* For some reason existing files seem to have the high bit set on the address of the name, although that is not documented. */ - putcwi_32 (cwi, - 0x80000000 | (cwi->dirsize + cwi->dirstrs.length), - ere->name); + windres_put_32 (cwi->wrbfd, ere->name, + 0x80000000 | (cwi->dirsize + cwi->dirstrs.length)); str = coff_alloc (&cwi->dirstrs, e->id.u.n.length * 2 + 2); - putcwi_16 (cwi, e->id.u.n.length, str); + windres_put_16 (cwi->wrbfd, str, e->id.u.n.length); for (i = 0; i < e->id.u.n.length; i++) - putcwi_16 (cwi, e->id.u.n.name[i], str + i * 2 + 2); + windres_put_16 (cwi->wrbfd, str + (i + 1) * sizeof (unichar), e->id.u.n.name[i]); } if (e->subdir) { - putcwi_32 (cwi, 0x80000000 | cwi->dirs.length, ere->rva); + windres_put_32 (cwi->wrbfd, ere->rva, 0x80000000 | cwi->dirs.length); coff_to_bin (e->u.dir, cwi); } else { - putcwi_32 (cwi, - cwi->dirsize + cwi->dirstrsize + cwi->dataents.length, - ere->rva); + windres_put_32 (cwi->wrbfd, ere->rva, + cwi->dirsize + cwi->dirstrsize + cwi->dataents.length); coff_res_to_bin (e->u.res, cwi); } @@ -696,12 +696,11 @@ coff_to_bin (const struct res_directory *resdir, struct coff_write_info *cwi) /* Convert the resource RES to binary. */ static void -coff_res_to_bin (const struct res_resource *res, struct coff_write_info *cwi) +coff_res_to_bin (const rc_res_resource *res, struct coff_write_info *cwi) { arelent *r; struct extern_res_data *erd; - struct bindata *d; - unsigned long length; + coff_res_data *d; /* For some reason, although every other address is a section offset, the address of the resource data itself is an RVA. That @@ -714,7 +713,7 @@ coff_res_to_bin (const struct res_resource *res, struct coff_write_info *cwi) r->sym_ptr_ptr = cwi->sympp; r->address = cwi->dirsize + cwi->dirstrsize + cwi->dataents.length; r->addend = 0; - r->howto = bfd_reloc_type_lookup (cwi->abfd, BFD_RELOC_RVA); + r->howto = bfd_reloc_type_lookup (WR_BFD (cwi->wrbfd), BFD_RELOC_RVA); if (r->howto == NULL) bfd_fatal (_("can't get BFD_RELOC_RVA relocation type")); @@ -726,41 +725,29 @@ coff_res_to_bin (const struct res_resource *res, struct coff_write_info *cwi) erd = (struct extern_res_data *) coff_alloc (&cwi->dataents, sizeof (*erd)); - putcwi_32 (cwi, + windres_put_32 (cwi->wrbfd, erd->rva, (cwi->dirsize + cwi->dirstrsize + cwi->dataentsize - + cwi->resources.length), - erd->rva); - putcwi_32 (cwi, res->coff_info.codepage, erd->codepage); - putcwi_32 (cwi, res->coff_info.reserved, erd->reserved); + + cwi->resources.length)); + windres_put_32 (cwi->wrbfd, erd->codepage, res->coff_info.codepage); + windres_put_32 (cwi->wrbfd, erd->reserved, res->coff_info.reserved); - d = res_to_bin (res, cwi->big_endian); + d = (coff_res_data *) reswr_alloc (sizeof (coff_res_data)); + d->length = res_to_bin (NULL, (rc_uint_type) 0, res); + d->res = res; + d->next = NULL; if (cwi->resources.d == NULL) cwi->resources.d = d; else cwi->resources.last->next = d; - length = 0; - for (; d->next != NULL; d = d->next) - length += d->length; - length += d->length; cwi->resources.last = d; - cwi->resources.length += length; + cwi->resources.length += (d->length + 3) & ~3; - putcwi_32 (cwi, length, erd->size); + windres_put_32 (cwi->wrbfd, erd->size, d->length); /* Force the next resource to have 32 bit alignment. */ - - if ((length & 3) != 0) - { - int add; - unsigned char *ex; - - add = 4 - (length & 3); - - ex = coff_alloc (&cwi->resources, add); - memset (ex, 0, add); - } + d->length = (d->length + 3) & ~3; } diff --git a/binutils/resrc.c b/binutils/resrc.c index 73b482cd04a..ebed255157d 100644 --- a/binutils/resrc.c +++ b/binutils/resrc.c @@ -1,7 +1,8 @@ /* resrc.c -- read and write Windows rc files. - Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. + Rewritten by Kai Tietz, Onevision. This file is part of GNU Binutils. @@ -23,6 +24,7 @@ /* This file contains functions that read and write Windows rc files. These are text files that represent resources. */ +#include "sysdep.h" #include "bfd.h" #include "bucomm.h" #include "libiberty.h" @@ -87,11 +89,11 @@ struct icondir { /* Width of image. */ - unsigned char width; + bfd_byte width; /* Height of image. */ - unsigned char height; + bfd_byte height; /* Number of colors in image. */ - unsigned char colorcount; + bfd_byte colorcount; union { struct @@ -125,7 +127,7 @@ int rc_lineno; /* The pipe we are reading from, so that we can close it if we exit. */ -static FILE *cpp_pipe; +FILE *cpp_pipe; /* The temporary file used if we're not using popen, so we can delete it if we exit. */ @@ -138,7 +140,7 @@ static enum {ISTREAM_PIPE, ISTREAM_FILE} istream_type; /* As we read the rc file, we attach information to this structure. */ -static struct res_directory *resources; +static rc_res_directory *resources; /* The number of cursor resources we have written out. */ @@ -150,17 +152,39 @@ static int fonts; /* Font directory information. */ -struct fontdir *fontdirs; +rc_fontdir *fontdirs; /* Resource info to use for fontdirs. */ -struct res_res_info fontdirs_resinfo; +rc_res_res_info fontdirs_resinfo; /* The number of icon resources we have written out. */ static int icons; -/* Local functions. */ +/* The windres target bfd . */ + +static windres_bfd wrtarget = +{ + (bfd *) NULL, (asection *) NULL, WR_KIND_TARGET +}; + +/* Local functions for rcdata based resource definitions. */ + +static void define_font_rcdata (rc_res_id, const rc_res_res_info *, + rc_rcdata_item *); +static void define_icon_rcdata (rc_res_id, const rc_res_res_info *, + rc_rcdata_item *); +static void define_bitmap_rcdata (rc_res_id, const rc_res_res_info *, + rc_rcdata_item *); +static void define_cursor_rcdata (rc_res_id, const rc_res_res_info *, + rc_rcdata_item *); +static void define_fontdir_rcdata (rc_res_id, const rc_res_res_info *, + rc_rcdata_item *); +static void define_messagetable_rcdata (rc_res_id, const rc_res_res_info *, + rc_rcdata_item *); +static rc_uint_type rcdata_copy (const rc_rcdata_item *, bfd_byte *); +static bfd_byte *rcdata_render_as_buffer (const rc_rcdata_item *, rc_uint_type *); static int run_cmd (char *, const char *); static FILE *open_input_stream (char *); @@ -170,7 +194,7 @@ static void close_input_stream (void); static void unexpected_eof (const char *); static int get_word (FILE *, const char *); static unsigned long get_long (FILE *, const char *); -static void get_data (FILE *, unsigned char *, unsigned long, const char *); +static void get_data (FILE *, bfd_byte *, rc_uint_type, const char *); static void define_fontdirs (void); /* Run `cmd' and redirect the output to `redir'. */ @@ -327,7 +351,33 @@ open_input_stream (char *cmd) return cpp_pipe; } -/* look for the preprocessor program */ +/* Determine if FILENAME contains special characters that + can cause problems unless the entire filename is quoted. */ + +static int +filename_need_quotes (const char *filename) +{ + if (filename == NULL || (filename[0] == '-' && filename[1] == 0)) + return 0; + + while (*filename != 0) + { + switch (*filename) + { + case '&': + case ' ': + case '<': + case '>': + case '|': + case '%': + return 1; + } + ++filename; + } + return 0; +} + +/* Look for the preprocessor program. */ static FILE * look_for_default (char *cmd, const char *prefix, int end_prefix, @@ -336,6 +386,7 @@ look_for_default (char *cmd, const char *prefix, int end_prefix, char *space; int found; struct stat s; + const char *fnquotes = (filename_need_quotes (filename) ? "\"" : ""); strcpy (cmd, prefix); @@ -366,8 +417,8 @@ look_for_default (char *cmd, const char *prefix, int end_prefix, strcpy (cmd, prefix); - sprintf (cmd + end_prefix, "%s %s %s", - DEFAULT_PREPROCESSOR, preprocargs, filename); + sprintf (cmd + end_prefix, "%s %s %s%s%s", + DEFAULT_PREPROCESSOR, preprocargs, fnquotes, filename, fnquotes); if (verbose) fprintf (stderr, _("Using `%s'\n"), cmd); @@ -378,11 +429,12 @@ look_for_default (char *cmd, const char *prefix, int end_prefix, /* Read an rc file. */ -struct res_directory * +rc_res_directory * read_rc_file (const char *filename, const char *preprocessor, const char *preprocargs, int language, int use_temp_file) { char *cmd; + const char *fnquotes = (filename_need_quotes (filename) ? "\"" : ""); istream_type = (use_temp_file) ? ISTREAM_FILE : ISTREAM_PIPE; @@ -396,8 +448,10 @@ read_rc_file (const char *filename, const char *preprocessor, cmd = xmalloc (strlen (preprocessor) + strlen (preprocargs) + strlen (filename) + + strlen (fnquotes) * 2 + 10); - sprintf (cmd, "%s %s %s", preprocessor, preprocargs, filename); + sprintf (cmd, "%s %s %s%s%s", preprocessor, preprocargs, + fnquotes, filename, fnquotes); cpp_pipe = open_input_stream (cmd); } @@ -411,6 +465,7 @@ read_rc_file (const char *filename, const char *preprocessor, + strlen (preprocessor) + strlen (preprocargs) + strlen (filename) + + strlen (fnquotes) * 2 #ifdef HAVE_EXECUTABLE_SUFFIX + strlen (EXECUTABLE_SUFFIX) #endif @@ -440,20 +495,20 @@ read_rc_file (const char *filename, const char *preprocessor, /* First, try looking for a prefixed gcc in the windres directory, with the same prefix as windres */ - cpp_pipe = look_for_default (cmd, program_name, dash-program_name+1, + cpp_pipe = look_for_default (cmd, program_name, dash - program_name + 1, preprocargs, filename); } - if (slash && !cpp_pipe) + if (slash && ! cpp_pipe) { /* Next, try looking for a gcc in the same directory as that windres */ - cpp_pipe = look_for_default (cmd, program_name, slash-program_name+1, + cpp_pipe = look_for_default (cmd, program_name, slash - program_name + 1, preprocargs, filename); } - if (!cpp_pipe) + if (! cpp_pipe) { /* Sigh, try the default */ @@ -468,7 +523,6 @@ read_rc_file (const char *filename, const char *preprocessor, rc_lineno = 1; if (language != -1) rcparse_set_language (language); - yyin = cpp_pipe; yyparse (); rcparse_discard_strings (); @@ -575,24 +629,24 @@ get_long (FILE *e, const char *msg) /* Read data from a file. This is a wrapper to do error checking. */ static void -get_data (FILE *e, unsigned char *p, unsigned long c, const char *msg) +get_data (FILE *e, bfd_byte *p, rc_uint_type c, const char *msg) { - unsigned long got; + rc_uint_type got; // $$$d - got = fread (p, 1, c, e); + got = (rc_uint_type) fread (p, 1, c, e); if (got == c) return; - fatal (_("%s: read of %lu returned %lu"), msg, c, got); + fatal (_("%s: read of %lu returned %lu"), msg, (long) c, (long) got); } /* Define an accelerator resource. */ void -define_accelerator (struct res_id id, const struct res_res_info *resinfo, - struct accelerator *data) +define_accelerator (rc_res_id id, const rc_res_res_info *resinfo, + rc_accelerator *data) { - struct res_resource *r; + rc_res_resource *r; r = define_standard_resource (&resources, RT_ACCELERATOR, id, resinfo->language, 0); @@ -608,15 +662,15 @@ define_accelerator (struct res_id id, const struct res_res_info *resinfo, #define BITMAP_SKIP (14) void -define_bitmap (struct res_id id, const struct res_res_info *resinfo, +define_bitmap (rc_res_id id, const rc_res_res_info *resinfo, const char *filename) { FILE *e; char *real_filename; struct stat s; - unsigned char *data; - int i; - struct res_resource *r; + bfd_byte *data; + rc_uint_type i; + rc_res_resource *r; e = open_file_search (filename, FOPEN_RB, "bitmap file", &real_filename); @@ -624,7 +678,7 @@ define_bitmap (struct res_id id, const struct res_res_info *resinfo, fatal (_("stat failed on bitmap file `%s': %s"), real_filename, strerror (errno)); - data = (unsigned char *) res_alloc (s.st_size - BITMAP_SKIP); + data = (bfd_byte *) res_alloc (s.st_size - BITMAP_SKIP); for (i = 0; i < BITMAP_SKIP; i++) getc (e); @@ -650,7 +704,7 @@ define_bitmap (struct res_id id, const struct res_res_info *resinfo, select one of the actual cursors. */ void -define_cursor (struct res_id id, const struct res_res_info *resinfo, +define_cursor (rc_res_id id, const rc_res_res_info *resinfo, const char *filename) { FILE *e; @@ -658,8 +712,8 @@ define_cursor (struct res_id id, const struct res_res_info *resinfo, int type, count, i; struct icondir *icondirs; int first_cursor; - struct res_resource *r; - struct group_cursor *first, **pp; + rc_res_resource *r; + rc_group_cursor *first, **pp; e = open_file_search (filename, FOPEN_RB, "cursor file", &real_filename); @@ -699,19 +753,19 @@ define_cursor (struct res_id id, const struct res_res_info *resinfo, for (i = 0; i < count; i++) { - unsigned char *data; - struct res_id name; - struct cursor *c; + bfd_byte *data; + rc_res_id name; + rc_cursor *c; if (fseek (e, icondirs[i].offset, SEEK_SET) != 0) fatal (_("%s: fseek to %lu failed: %s"), real_filename, icondirs[i].offset, strerror (errno)); - data = (unsigned char *) res_alloc (icondirs[i].bytes); + data = (bfd_byte *) res_alloc (icondirs[i].bytes); get_data (e, data, icondirs[i].bytes, real_filename); - c = (struct cursor *) res_alloc (sizeof *c); + c = (rc_cursor *) res_alloc (sizeof (rc_cursor)); c->xhotspot = icondirs[i].u.cursor.xhotspot; c->yhotspot = icondirs[i].u.cursor.yhotspot; c->length = icondirs[i].bytes; @@ -738,9 +792,9 @@ define_cursor (struct res_id id, const struct res_res_info *resinfo, pp = &first; for (i = 0; i < count; i++) { - struct group_cursor *cg; + rc_group_cursor *cg; - cg = (struct group_cursor *) res_alloc (sizeof *cg); + cg = (rc_group_cursor *) res_alloc (sizeof (rc_group_cursor)); cg->next = NULL; cg->width = icondirs[i].width; cg->height = 2 * icondirs[i].height; @@ -768,13 +822,13 @@ define_cursor (struct res_id id, const struct res_res_info *resinfo, /* Define a dialog resource. */ void -define_dialog (struct res_id id, const struct res_res_info *resinfo, - const struct dialog *dialog) +define_dialog (rc_res_id id, const rc_res_res_info *resinfo, + const rc_dialog *dialog) { - struct dialog *copy; - struct res_resource *r; + rc_dialog *copy; + rc_res_resource *r; - copy = (struct dialog *) res_alloc (sizeof *copy); + copy = (rc_dialog *) res_alloc (sizeof *copy); *copy = *dialog; r = define_standard_resource (&resources, RT_DIALOG, id, @@ -787,15 +841,15 @@ define_dialog (struct res_id id, const struct res_res_info *resinfo, /* Define a dialog control. This does not define a resource, but merely allocates and fills in a structure. */ -struct dialog_control * -define_control (const struct res_id iid, unsigned long id, unsigned long x, - unsigned long y, unsigned long width, unsigned long height, - unsigned long class, unsigned long style, - unsigned long exstyle) +rc_dialog_control * +define_control (const rc_res_id iid, rc_uint_type id, rc_uint_type x, + rc_uint_type y, rc_uint_type width, rc_uint_type height, + const rc_res_id class, rc_uint_type style, + rc_uint_type exstyle) { - struct dialog_control *n; + rc_dialog_control *n; - n = (struct dialog_control *) res_alloc (sizeof *n); + n = (rc_dialog_control *) res_alloc (sizeof (rc_dialog_control)); n->next = NULL; n->id = id; n->style = style; @@ -804,8 +858,7 @@ define_control (const struct res_id iid, unsigned long id, unsigned long x, n->y = y; n->width = width; n->height = height; - n->class.named = 0; - n->class.u.id = class; + n->class = class; n->text = iid; n->data = NULL; n->help = 0; @@ -813,23 +866,26 @@ define_control (const struct res_id iid, unsigned long id, unsigned long x, return n; } -struct dialog_control * -define_icon_control (struct res_id iid, unsigned long id, unsigned long x, - unsigned long y, unsigned long style, - unsigned long exstyle, unsigned long help, - struct rcdata_item *data, struct dialog_ex *ex) +rc_dialog_control * +define_icon_control (rc_res_id iid, rc_uint_type id, rc_uint_type x, + rc_uint_type y, rc_uint_type style, + rc_uint_type exstyle, rc_uint_type help, + rc_rcdata_item *data, rc_dialog_ex *ex) { - struct dialog_control *n; - struct res_id tid; + rc_dialog_control *n; + rc_res_id tid; + rc_res_id cid; if (style == 0) style = SS_ICON | WS_CHILD | WS_VISIBLE; res_string_to_id (&tid, ""); - n = define_control (tid, id, x, y, 0, 0, CTL_STATIC, style, exstyle); + cid.named = 0; + cid.u.id = CTL_STATIC; + n = define_control (tid, id, x, y, 0, 0, cid, style, exstyle); n->text = iid; - if (help && !ex) + if (help && ! ex) rcparse_warning (_("help ID requires DIALOGEX")); - if (data && !ex) + if (data && ! ex) rcparse_warning (_("control data requires DIALOGEX")); n->help = help; n->data = data; @@ -840,20 +896,20 @@ define_icon_control (struct res_id iid, unsigned long id, unsigned long x, /* Define a font resource. */ void -define_font (struct res_id id, const struct res_res_info *resinfo, +define_font (rc_res_id id, const rc_res_res_info *resinfo, const char *filename) { FILE *e; char *real_filename; struct stat s; - unsigned char *data; - struct res_resource *r; + bfd_byte *data; + rc_res_resource *r; long offset; long fontdatalength; - unsigned char *fontdata; - struct fontdir *fd; + bfd_byte *fontdata; + rc_fontdir *fd; const char *device, *face; - struct fontdir **pp; + rc_fontdir **pp; e = open_file_search (filename, FOPEN_RB, "font file", &real_filename); @@ -861,7 +917,7 @@ define_font (struct res_id id, const struct res_res_info *resinfo, fatal (_("stat failed on font file `%s': %s"), real_filename, strerror (errno)); - data = (unsigned char *) res_alloc (s.st_size); + data = (bfd_byte *) res_alloc (s.st_size); get_data (e, data, s.st_size, real_filename); @@ -902,12 +958,12 @@ define_font (struct res_id id, const struct res_res_info *resinfo, ++fonts; fontdatalength = 58 + strlen (device) + strlen (face); - fontdata = (unsigned char *) res_alloc (fontdatalength); + fontdata = (bfd_byte *) res_alloc (fontdatalength); memcpy (fontdata, data, 56); strcpy ((char *) fontdata + 56, device); strcpy ((char *) fontdata + 57 + strlen (device), face); - fd = (struct fontdir *) res_alloc (sizeof *fd); + fd = (rc_fontdir *) res_alloc (sizeof (rc_fontdir)); fd->next = NULL; fd->index = fonts; fd->length = fontdatalength; @@ -922,14 +978,33 @@ define_font (struct res_id id, const struct res_res_info *resinfo, fontdirs_resinfo = *resinfo; } +static void +define_font_rcdata (rc_res_id id,const rc_res_res_info *resinfo, + rc_rcdata_item *data) +{ + rc_res_resource *r; + rc_uint_type len_data; + bfd_byte *pb_data; + + r = define_standard_resource (&resources, RT_FONT, id, + resinfo->language, 0); + + pb_data = rcdata_render_as_buffer (data, &len_data); + + r->type = RES_TYPE_FONT; + r->u.data.length = len_data; + r->u.data.data = pb_data; + r->res_info = *resinfo; +} + /* Define the fontdirs resource. This is called after the entire rc file has been parsed, if any font resources were seen. */ static void define_fontdirs (void) { - struct res_resource *r; - struct res_id id; + rc_res_resource *r; + rc_res_id id; id.named = 0; id.u.id = 1; @@ -941,6 +1016,89 @@ define_fontdirs (void) r->res_info = fontdirs_resinfo; } +static bfd_byte * +rcdata_render_as_buffer (const rc_rcdata_item *data, rc_uint_type *plen) +{ + const rc_rcdata_item *d; + bfd_byte *ret = NULL, *pret; + rc_uint_type len = 0; + + for (d = data; d != NULL; d = d->next) + len += rcdata_copy (d, NULL); + if (len != 0) + { + ret = pret = (bfd_byte *) res_alloc (len); + for (d = data; d != NULL; d = d->next) + pret += rcdata_copy (d, pret); + } + if (plen) + *plen = len; + return ret; +} + +static void +define_fontdir_rcdata (rc_res_id id,const rc_res_res_info *resinfo, + rc_rcdata_item *data) +{ + rc_res_resource *r; + rc_fontdir *fd, *fd_first, *fd_cur; + rc_uint_type len_data; + bfd_byte *pb_data; + rc_uint_type c; + + fd_cur = fd_first = NULL; + r = define_standard_resource (&resources, RT_FONTDIR, id, 0x409, 0); + + pb_data = rcdata_render_as_buffer (data, &len_data); + + if (pb_data) + { + rc_uint_type off = 2; + c = windres_get_16 (&wrtarget, pb_data, len_data); + for (; c > 0; c--) + { + size_t len; + rc_uint_type safe_pos = off; + const struct bin_fontdir_item *bfi; + + bfi = (const struct bin_fontdir_item *) pb_data + off; + fd = (rc_fontdir *) res_alloc (sizeof (rc_fontdir)); + fd->index = windres_get_16 (&wrtarget, bfi->index, len_data - off); + fd->data = pb_data + off; + off += 56; + len = strlen ((char *) bfi->device_name) + 1; + off += (rc_uint_type) len; + off += (rc_uint_type) strlen ((char *) bfi->device_name + len) + 1; + fd->length = (off - safe_pos); + fd->next = NULL; + if (fd_first == NULL) + fd_first = fd; + else + fd_cur->next = fd; + fd_cur = fd; + } + } + r->type = RES_TYPE_FONTDIR; + r->u.fontdir = fd_first; + r->res_info = *resinfo; +} + +static void define_messagetable_rcdata (rc_res_id id, const rc_res_res_info *resinfo, + rc_rcdata_item *data) +{ + rc_res_resource *r; + rc_uint_type len_data; + bfd_byte *pb_data; + + r = define_standard_resource (&resources, RT_MESSAGETABLE, id, resinfo->language, 0); + + pb_data = rcdata_render_as_buffer (data, &len_data); + r->type = RES_TYPE_MESSAGETABLE; + r->u.data.length = len_data; + r->u.data.data = pb_data; + r->res_info = *resinfo; +} + /* Define an icon resource. An icon file may contain a set of bitmaps, each representing the same icon at various different resolutions. They each get written out with a different ID. The @@ -948,7 +1106,7 @@ define_fontdirs (void) select one of the actual icon bitmaps. */ void -define_icon (struct res_id id, const struct res_res_info *resinfo, +define_icon (rc_res_id id, const rc_res_res_info *resinfo, const char *filename) { FILE *e; @@ -956,8 +1114,8 @@ define_icon (struct res_id id, const struct res_res_info *resinfo, int type, count, i; struct icondir *icondirs; int first_icon; - struct res_resource *r; - struct group_icon *first, **pp; + rc_res_resource *r; + rc_group_icon *first, **pp; e = open_file_search (filename, FOPEN_RB, "icon file", &real_filename); @@ -996,14 +1154,14 @@ define_icon (struct res_id id, const struct res_res_info *resinfo, for (i = 0; i < count; i++) { - unsigned char *data; - struct res_id name; + bfd_byte *data; + rc_res_id name; if (fseek (e, icondirs[i].offset, SEEK_SET) != 0) fatal (_("%s: fseek to %lu failed: %s"), real_filename, icondirs[i].offset, strerror (errno)); - data = (unsigned char *) res_alloc (icondirs[i].bytes); + data = (bfd_byte *) res_alloc (icondirs[i].bytes); get_data (e, data, icondirs[i].bytes, real_filename); @@ -1029,13 +1187,13 @@ define_icon (struct res_id id, const struct res_res_info *resinfo, pp = &first; for (i = 0; i < count; i++) { - struct group_icon *cg; + rc_group_icon *cg; /* For some reason, at least in some files the planes and bits are zero. We instead set them from the color. This is copied from rcl. */ - cg = (struct group_icon *) res_alloc (sizeof *cg); + cg = (rc_group_icon *) res_alloc (sizeof (rc_group_icon)); cg->next = NULL; cg->width = icondirs[i].width; cg->height = icondirs[i].height; @@ -1072,16 +1230,180 @@ define_icon (struct res_id id, const struct res_res_info *resinfo, r->res_info = *resinfo; } +static void +define_group_icon_rcdata (rc_res_id id, const rc_res_res_info *resinfo, + rc_rcdata_item *data) +{ + rc_res_resource *r; + rc_group_icon *cg, *first, *cur; + rc_uint_type len_data; + bfd_byte *pb_data; + + pb_data = rcdata_render_as_buffer (data, &len_data); + + cur = NULL; + first = NULL; + + while (len_data >= 6) + { + int c, i; + unsigned short type; + type = windres_get_16 (&wrtarget, pb_data + 2, len_data - 2); + if (type != 1) + fatal (_("unexpected group icon type %d"), type); + c = windres_get_16 (&wrtarget, pb_data + 4, len_data - 4); + len_data -= 6; + pb_data += 6; + + for (i = 0; i < c; i++) + { + if (len_data < 14) + fatal ("too small group icon rcdata"); + cg = (rc_group_icon *) res_alloc (sizeof (rc_group_icon)); + cg->next = NULL; + cg->width = pb_data[0]; + cg->height = pb_data[1]; + cg->colors = pb_data[2]; + cg->planes = windres_get_16 (&wrtarget, pb_data + 4, len_data - 4); + cg->bits = windres_get_16 (&wrtarget, pb_data + 6, len_data - 6); + cg->bytes = windres_get_32 (&wrtarget, pb_data + 8, len_data - 8); + cg->index = windres_get_16 (&wrtarget, pb_data + 12, len_data - 12); + if (! first) + first = cg; + else + cur->next = cg; + cur = cg; + pb_data += 14; + len_data -= 14; + } + } + r = define_standard_resource (&resources, RT_GROUP_ICON, id, + resinfo->language, 0); + r->type = RES_TYPE_GROUP_ICON; + r->u.group_icon = first; + r->res_info = *resinfo; +} + +static void +define_group_cursor_rcdata (rc_res_id id, const rc_res_res_info *resinfo, + rc_rcdata_item *data) +{ + rc_res_resource *r; + rc_group_cursor *cg, *first, *cur; + rc_uint_type len_data; + bfd_byte *pb_data; + + pb_data = rcdata_render_as_buffer (data, &len_data); + + first = cur = NULL; + + while (len_data >= 6) + { + int c, i; + unsigned short type; + type = windres_get_16 (&wrtarget, pb_data + 2, len_data - 2); + if (type != 2) + fatal (_("unexpected group cursor type %d"), type); + c = windres_get_16 (&wrtarget, pb_data + 4, len_data - 4); + len_data -= 6; + pb_data += 6; + + for (i = 0; i < c; i++) + { + if (len_data < 14) + fatal ("too small group icon rcdata"); + cg = (rc_group_cursor *) res_alloc (sizeof (rc_group_cursor)); + cg->next = NULL; + cg->width = windres_get_16 (&wrtarget, pb_data, len_data); + cg->height = windres_get_16 (&wrtarget, pb_data + 2, len_data - 2); + cg->planes = windres_get_16 (&wrtarget, pb_data + 4, len_data - 4); + cg->bits = windres_get_16 (&wrtarget, pb_data + 6, len_data - 6); + cg->bytes = windres_get_32 (&wrtarget, pb_data + 8, len_data - 8); + cg->index = windres_get_16 (&wrtarget, pb_data + 12, len_data - 12); + if (! first) + first = cg; + else + cur->next = cg; + cur = cg; + pb_data += 14; + len_data -= 14; + } + } + + r = define_standard_resource (&resources, RT_GROUP_ICON, id, + resinfo->language, 0); + r->type = RES_TYPE_GROUP_CURSOR; + r->u.group_cursor = first; + r->res_info = *resinfo; +} + +static void +define_cursor_rcdata (rc_res_id id, const rc_res_res_info *resinfo, + rc_rcdata_item *data) +{ + rc_cursor *c; + rc_res_resource *r; + rc_uint_type len_data; + bfd_byte *pb_data; + + pb_data = rcdata_render_as_buffer (data, &len_data); + + c = (rc_cursor *) res_alloc (sizeof (rc_cursor)); + c->xhotspot = windres_get_16 (&wrtarget, pb_data, len_data); + c->yhotspot = windres_get_16 (&wrtarget, pb_data + 2, len_data - 2); + c->length = len_data - BIN_CURSOR_SIZE; + c->data = (const bfd_byte *) (data + BIN_CURSOR_SIZE); + + r = define_standard_resource (&resources, RT_CURSOR, id, resinfo->language, 0); + r->type = RES_TYPE_CURSOR; + r->u.cursor = c; + r->res_info = *resinfo; +} + +static void +define_bitmap_rcdata (rc_res_id id, const rc_res_res_info *resinfo, + rc_rcdata_item *data) +{ + rc_res_resource *r; + rc_uint_type len_data; + bfd_byte *pb_data; + + pb_data = rcdata_render_as_buffer (data, &len_data); + + r = define_standard_resource (&resources, RT_BITMAP, id, resinfo->language, 0); + r->type = RES_TYPE_BITMAP; + r->u.data.length = len_data; + r->u.data.data = pb_data; + r->res_info = *resinfo; +} + +static void +define_icon_rcdata (rc_res_id id, const rc_res_res_info *resinfo, + rc_rcdata_item *data) +{ + rc_res_resource *r; + rc_uint_type len_data; + bfd_byte *pb_data; + + pb_data = rcdata_render_as_buffer (data, &len_data); + + r = define_standard_resource (&resources, RT_ICON, id, resinfo->language, 0); + r->type = RES_TYPE_ICON; + r->u.data.length = len_data; + r->u.data.data = pb_data; + r->res_info = *resinfo; +} + /* Define a menu resource. */ void -define_menu (struct res_id id, const struct res_res_info *resinfo, - struct menuitem *menuitems) +define_menu (rc_res_id id, const rc_res_res_info *resinfo, + rc_menuitem *menuitems) { - struct menu *m; - struct res_resource *r; + rc_menu *m; + rc_res_resource *r; - m = (struct menu *) res_alloc (sizeof *m); + m = (rc_menu *) res_alloc (sizeof (rc_menu)); m->items = menuitems; m->help = 0; @@ -1094,22 +1416,19 @@ define_menu (struct res_id id, const struct res_res_info *resinfo, /* Define a menu item. This does not define a resource, but merely allocates and fills in a structure. */ -struct menuitem * -define_menuitem (const char *text, int menuid, unsigned long type, - unsigned long state, unsigned long help, - struct menuitem *menuitems) +rc_menuitem * +define_menuitem (const unichar *text, rc_uint_type menuid, rc_uint_type type, + rc_uint_type state, rc_uint_type help, + rc_menuitem *menuitems) { - struct menuitem *mi; + rc_menuitem *mi; - mi = (struct menuitem *) res_alloc (sizeof *mi); + mi = (rc_menuitem *) res_alloc (sizeof (rc_menuitem)); mi->next = NULL; mi->type = type; mi->state = state; mi->id = menuid; - if (text == NULL) - mi->text = NULL; - else - unicode_from_ascii ((int *) NULL, &mi->text, text); + mi->text = unichar_dup (text); mi->help = help; mi->popup = menuitems; return mi; @@ -1118,14 +1437,14 @@ define_menuitem (const char *text, int menuid, unsigned long type, /* Define a messagetable resource. */ void -define_messagetable (struct res_id id, const struct res_res_info *resinfo, +define_messagetable (rc_res_id id, const rc_res_res_info *resinfo, const char *filename) { FILE *e; char *real_filename; struct stat s; - unsigned char *data; - struct res_resource *r; + bfd_byte *data; + rc_res_resource *r; e = open_file_search (filename, FOPEN_RB, "messagetable file", &real_filename); @@ -1134,7 +1453,7 @@ define_messagetable (struct res_id id, const struct res_res_info *resinfo, fatal (_("stat failed on bitmap file `%s': %s"), real_filename, strerror (errno)); - data = (unsigned char *) res_alloc (s.st_size); + data = (bfd_byte *) res_alloc (s.st_size); get_data (e, data, s.st_size, real_filename); @@ -1153,10 +1472,10 @@ define_messagetable (struct res_id id, const struct res_res_info *resinfo, /* Define an rcdata resource. */ void -define_rcdata (struct res_id id, const struct res_res_info *resinfo, - struct rcdata_item *data) +define_rcdata (rc_res_id id, const rc_res_res_info *resinfo, + rc_rcdata_item *data) { - struct res_resource *r; + rc_res_resource *r; r = define_standard_resource (&resources, RT_RCDATA, id, resinfo->language, 0); @@ -1167,13 +1486,13 @@ define_rcdata (struct res_id id, const struct res_res_info *resinfo, /* Create an rcdata item holding a string. */ -struct rcdata_item * -define_rcdata_string (const char *string, unsigned long len) +rc_rcdata_item * +define_rcdata_string (const char *string, rc_uint_type len) { - struct rcdata_item *ri; + rc_rcdata_item *ri; char *s; - ri = (struct rcdata_item *) res_alloc (sizeof *ri); + ri = (rc_rcdata_item *) res_alloc (sizeof (rc_rcdata_item)); ri->next = NULL; ri->type = RCDATA_STRING; ri->u.string.length = len; @@ -1184,14 +1503,33 @@ define_rcdata_string (const char *string, unsigned long len) return ri; } +/* Create an rcdata item holding a unicode string. */ + +rc_rcdata_item * +define_rcdata_unistring (const unichar *string, rc_uint_type len) +{ + rc_rcdata_item *ri; + unichar *s; + + ri = (rc_rcdata_item *) res_alloc (sizeof (rc_rcdata_item)); + ri->next = NULL; + ri->type = RCDATA_WSTRING; + ri->u.wstring.length = len; + s = (unichar *) res_alloc (len * sizeof (unichar)); + memcpy (s, string, len * sizeof (unichar)); + ri->u.wstring.w = s; + + return ri; +} + /* Create an rcdata item holding a number. */ -struct rcdata_item * -define_rcdata_number (unsigned long val, int dword) +rc_rcdata_item * +define_rcdata_number (rc_uint_type val, int dword) { - struct rcdata_item *ri; + rc_rcdata_item *ri; - ri = (struct rcdata_item *) res_alloc (sizeof *ri); + ri = (rc_rcdata_item *) res_alloc (sizeof (rc_rcdata_item)); ri->next = NULL; ri->type = dword ? RCDATA_DWORD : RCDATA_WORD; ri->u.word = val; @@ -1203,11 +1541,11 @@ define_rcdata_number (unsigned long val, int dword) which appears in a STRINGTABLE statement. */ void -define_stringtable (const struct res_res_info *resinfo, - unsigned long stringid, const char *string) +define_stringtable (const rc_res_res_info *resinfo, + rc_uint_type stringid, const unichar *string) { - struct res_id id; - struct res_resource *r; + rc_res_id id; + rc_res_resource *r; id.named = 0; id.u.id = (stringid >> 4) + 1; @@ -1219,8 +1557,8 @@ define_stringtable (const struct res_res_info *resinfo, int i; r->type = RES_TYPE_STRINGTABLE; - r->u.stringtable = ((struct stringtable *) - res_alloc (sizeof (struct stringtable))); + r->u.stringtable = ((rc_stringtable *) + res_alloc (sizeof (rc_stringtable))); for (i = 0; i < 16; i++) { r->u.stringtable->strings[i].length = 0; @@ -1230,21 +1568,79 @@ define_stringtable (const struct res_res_info *resinfo, r->res_info = *resinfo; } - unicode_from_ascii (&r->u.stringtable->strings[stringid & 0xf].length, - &r->u.stringtable->strings[stringid & 0xf].string, - string); + r->u.stringtable->strings[stringid & 0xf].length = unichar_len (string); + r->u.stringtable->strings[stringid & 0xf].string = unichar_dup (string); +} + +void +define_toolbar (rc_res_id id, rc_res_res_info *resinfo, rc_uint_type width, rc_uint_type height, + rc_toolbar_item *items) +{ + rc_toolbar *t; + rc_res_resource *r; + + t = (rc_toolbar *) res_alloc (sizeof (rc_toolbar)); + t->button_width = width; + t->button_height = height; + t->nitems = 0; + t->items = items; + while (items != NULL) + { + t->nitems+=1; + items = items->next; + } + r = define_standard_resource (&resources, RT_TOOLBAR, id, resinfo->language, 0); + r->type = RES_TYPE_TOOLBAR; + r->u.toolbar = t; + r->res_info = *resinfo; } /* Define a user data resource where the data is in the rc file. */ void -define_user_data (struct res_id id, struct res_id type, - const struct res_res_info *resinfo, - struct rcdata_item *data) +define_user_data (rc_res_id id, rc_res_id type, + const rc_res_res_info *resinfo, + rc_rcdata_item *data) { - struct res_id ids[3]; - struct res_resource *r; + rc_res_id ids[3]; + rc_res_resource *r; + bfd_byte *pb_data; + rc_uint_type len_data; + /* We have to check if the binary data is parsed specially. */ + if (type.named == 0) + { + switch (type.u.id) + { + case RT_FONTDIR: + define_fontdir_rcdata (id, resinfo, data); + return; + case RT_FONT: + define_font_rcdata (id, resinfo, data); + return; + case RT_ICON: + define_icon_rcdata (id, resinfo, data); + return; + case RT_BITMAP: + define_bitmap_rcdata (id, resinfo, data); + return; + case RT_CURSOR: + define_cursor_rcdata (id, resinfo, data); + return; + case RT_GROUP_ICON: + define_group_icon_rcdata (id, resinfo, data); + return; + case RT_GROUP_CURSOR: + define_group_cursor_rcdata (id, resinfo, data); + return; + case RT_MESSAGETABLE: + define_messagetable_rcdata (id, resinfo, data); + return; + default: + /* Treat as normal user-data. */ + break; + } + } ids[0] = type; ids[1] = id; ids[2].named = 0; @@ -1252,19 +1648,25 @@ define_user_data (struct res_id id, struct res_id type, r = define_resource (& resources, 3, ids, 0); r->type = RES_TYPE_USERDATA; - r->u.userdata = data; + r->u.userdata = ((rc_rcdata_item *) + res_alloc (sizeof (rc_rcdata_item))); + r->u.userdata->next = NULL; + r->u.userdata->type = RCDATA_BUFFER; + pb_data = rcdata_render_as_buffer (data, &len_data); + r->u.userdata->u.buffer.length = len_data; + r->u.userdata->u.buffer.data = pb_data; r->res_info = *resinfo; } void -define_rcdata_file (struct res_id id, const struct res_res_info *resinfo, +define_rcdata_file (rc_res_id id, const rc_res_res_info *resinfo, const char *filename) { - struct rcdata_item *ri; + rc_rcdata_item *ri; FILE *e; char *real_filename; struct stat s; - unsigned char *data; + bfd_byte *data; e = open_file_search (filename, FOPEN_RB, "file", &real_filename); @@ -1273,14 +1675,14 @@ define_rcdata_file (struct res_id id, const struct res_res_info *resinfo, fatal (_("stat failed on file `%s': %s"), real_filename, strerror (errno)); - data = (unsigned char *) res_alloc (s.st_size); + data = (bfd_byte *) res_alloc (s.st_size); get_data (e, data, s.st_size, real_filename); fclose (e); free (real_filename); - ri = (struct rcdata_item *) res_alloc (sizeof *ri); + ri = (rc_rcdata_item *) res_alloc (sizeof (rc_rcdata_item)); ri->next = NULL; ri->type = RCDATA_BUFFER; ri->u.buffer.length = s.st_size; @@ -1292,15 +1694,15 @@ define_rcdata_file (struct res_id id, const struct res_res_info *resinfo, /* Define a user data resource where the data is in a file. */ void -define_user_file (struct res_id id, struct res_id type, - const struct res_res_info *resinfo, const char *filename) +define_user_file (rc_res_id id, rc_res_id type, + const rc_res_res_info *resinfo, const char *filename) { FILE *e; char *real_filename; struct stat s; - unsigned char *data; - struct res_id ids[3]; - struct res_resource *r; + bfd_byte *data; + rc_res_id ids[3]; + rc_res_resource *r; e = open_file_search (filename, FOPEN_RB, "file", &real_filename); @@ -1308,7 +1710,7 @@ define_user_file (struct res_id id, struct res_id type, fatal (_("stat failed on file `%s': %s"), real_filename, strerror (errno)); - data = (unsigned char *) res_alloc (s.st_size); + data = (bfd_byte *) res_alloc (s.st_size); get_data (e, data, s.st_size, real_filename); @@ -1322,8 +1724,8 @@ define_user_file (struct res_id id, struct res_id type, r = define_resource (&resources, 3, ids, 0); r->type = RES_TYPE_USERDATA; - r->u.userdata = ((struct rcdata_item *) - res_alloc (sizeof (struct rcdata_item))); + r->u.userdata = ((rc_rcdata_item *) + res_alloc (sizeof (rc_rcdata_item))); r->u.userdata->next = NULL; r->u.userdata->type = RCDATA_BUFFER; r->u.userdata->u.buffer.length = s.st_size; @@ -1334,16 +1736,16 @@ define_user_file (struct res_id id, struct res_id type, /* Define a versioninfo resource. */ void -define_versioninfo (struct res_id id, int language, - struct fixed_versioninfo *fixedverinfo, - struct ver_info *verinfo) +define_versioninfo (rc_res_id id, rc_uint_type language, + rc_fixed_versioninfo *fixedverinfo, + rc_ver_info *verinfo) { - struct res_resource *r; + rc_res_resource *r; r = define_standard_resource (&resources, RT_VERSION, id, language, 0); r->type = RES_TYPE_VERSIONINFO; - r->u.versioninfo = ((struct versioninfo *) - res_alloc (sizeof (struct versioninfo))); + r->u.versioninfo = ((rc_versioninfo *) + res_alloc (sizeof (rc_versioninfo))); r->u.versioninfo->fixed = fixedverinfo; r->u.versioninfo->var = verinfo; r->res_info.language = language; @@ -1351,16 +1753,16 @@ define_versioninfo (struct res_id id, int language, /* Add string version info to a list of version information. */ -struct ver_info * -append_ver_stringfileinfo (struct ver_info *verinfo, const char *language, - struct ver_stringinfo *strings) +rc_ver_info * +append_ver_stringfileinfo (rc_ver_info *verinfo, const char *language, + rc_ver_stringinfo *strings) { - struct ver_info *vi, **pp; + rc_ver_info *vi, **pp; - vi = (struct ver_info *) res_alloc (sizeof *vi); + vi = (rc_ver_info *) res_alloc (sizeof (rc_ver_info)); vi->next = NULL; vi->type = VERINFO_STRING; - unicode_from_ascii ((int *) NULL, &vi->u.string.language, language); + unicode_from_ascii ((rc_uint_type *) NULL, &vi->u.string.language, language); vi->u.string.strings = strings; for (pp = &verinfo; *pp != NULL; pp = &(*pp)->next) @@ -1372,16 +1774,16 @@ append_ver_stringfileinfo (struct ver_info *verinfo, const char *language, /* Add variable version info to a list of version information. */ -struct ver_info * -append_ver_varfileinfo (struct ver_info *verinfo, const char *key, - struct ver_varinfo *var) +rc_ver_info * +append_ver_varfileinfo (rc_ver_info *verinfo, const unichar *key, + rc_ver_varinfo *var) { - struct ver_info *vi, **pp; + rc_ver_info *vi, **pp; - vi = (struct ver_info *) res_alloc (sizeof *vi); + vi = (rc_ver_info *) res_alloc (sizeof *vi); vi->next = NULL; vi->type = VERINFO_VAR; - unicode_from_ascii ((int *) NULL, &vi->u.var.key, key); + vi->u.var.key = unichar_dup (key); vi->u.var.var = var; for (pp = &verinfo; *pp != NULL; pp = &(*pp)->next) @@ -1393,16 +1795,16 @@ append_ver_varfileinfo (struct ver_info *verinfo, const char *key, /* Append version string information to a list. */ -struct ver_stringinfo * -append_verval (struct ver_stringinfo *strings, const char *key, - const char *value) +rc_ver_stringinfo * +append_verval (rc_ver_stringinfo *strings, const unichar *key, + const unichar *value) { - struct ver_stringinfo *vs, **pp; + rc_ver_stringinfo *vs, **pp; - vs = (struct ver_stringinfo *) res_alloc (sizeof *vs); + vs = (rc_ver_stringinfo *) res_alloc (sizeof (rc_ver_stringinfo)); vs->next = NULL; - unicode_from_ascii ((int *) NULL, &vs->key, key); - unicode_from_ascii ((int *) NULL, &vs->value, value); + vs->key = unichar_dup (key); + vs->value = unichar_dup (value); for (pp = &strings; *pp != NULL; pp = &(*pp)->next) ; @@ -1413,13 +1815,13 @@ append_verval (struct ver_stringinfo *strings, const char *key, /* Append version variable information to a list. */ -struct ver_varinfo * -append_vertrans (struct ver_varinfo *var, unsigned long language, - unsigned long charset) +rc_ver_varinfo * +append_vertrans (rc_ver_varinfo *var, rc_uint_type language, + rc_uint_type charset) { - struct ver_varinfo *vv, **pp; + rc_ver_varinfo *vv, **pp; - vv = (struct ver_varinfo *) res_alloc (sizeof *vv); + vv = (rc_ver_varinfo *) res_alloc (sizeof (rc_ver_varinfo)); vv->next = NULL; vv->language = language; vv->charset = charset; @@ -1434,29 +1836,28 @@ append_vertrans (struct ver_varinfo *var, unsigned long language, /* Local functions used to write out an rc file. */ static void indent (FILE *, int); -static void write_rc_directory - (FILE *, const struct res_directory *, const struct res_id *, - const struct res_id *, int *, int); -static void write_rc_subdir - (FILE *, const struct res_entry *, const struct res_id *, - const struct res_id *, int *, int); -static void write_rc_resource - (FILE *, const struct res_id *, const struct res_id *, - const struct res_resource *, int *); -static void write_rc_accelerators (FILE *, const struct accelerator *); -static void write_rc_cursor (FILE *, const struct cursor *); -static void write_rc_group_cursor (FILE *, const struct group_cursor *); -static void write_rc_dialog (FILE *, const struct dialog *); -static void write_rc_dialog_control (FILE *, const struct dialog_control *); -static void write_rc_fontdir (FILE *, const struct fontdir *); -static void write_rc_group_icon (FILE *, const struct group_icon *); -static void write_rc_menu (FILE *, const struct menu *, int); -static void write_rc_menuitems (FILE *, const struct menuitem *, int, int); -static void write_rc_rcdata (FILE *, const struct rcdata_item *, int); -static void write_rc_stringtable - (FILE *, const struct res_id *, const struct stringtable *); -static void write_rc_versioninfo (FILE *, const struct versioninfo *); -static void write_rc_filedata (FILE *, unsigned long, const unsigned char *); +static void write_rc_directory (FILE *, const rc_res_directory *, const rc_res_id *, + const rc_res_id *, rc_uint_type *, int); +static void write_rc_subdir (FILE *, const rc_res_entry *, const rc_res_id *, + const rc_res_id *, rc_uint_type *, int); +static void write_rc_resource (FILE *, const rc_res_id *, const rc_res_id *, + const rc_res_resource *, rc_uint_type *); +static void write_rc_accelerators (FILE *, const rc_accelerator *); +static void write_rc_cursor (FILE *, const rc_cursor *); +static void write_rc_group_cursor (FILE *, const rc_group_cursor *); +static void write_rc_dialog (FILE *, const rc_dialog *); +static void write_rc_dialog_control (FILE *, const rc_dialog_control *); +static void write_rc_fontdir (FILE *, const rc_fontdir *); +static void write_rc_group_icon (FILE *, const rc_group_icon *); +static void write_rc_menu (FILE *, const rc_menu *, int); +static void write_rc_toolbar (FILE *, const rc_toolbar *); +static void write_rc_menuitems (FILE *, const rc_menuitem *, int, int); +static void write_rc_messagetable (FILE *, rc_uint_type , const bfd_byte *); + +static void write_rc_datablock (FILE *, rc_uint_type , const bfd_byte *, int, int, int); +static void write_rc_rcdata (FILE *, const rc_rcdata_item *, int); +static void write_rc_stringtable (FILE *, const rc_res_id *, const rc_stringtable *); +static void write_rc_versioninfo (FILE *, const rc_versioninfo *); /* Indent a given number of spaces. */ @@ -1471,19 +1872,15 @@ indent (FILE *e, int c) /* Dump the resources we have read in the format of an rc file. - Actually, we don't use the format of an rc file, because it's way - too much of a pain--for example, we'd have to write icon resources - into a file and refer to that file. We just generate a readable - format that kind of looks like an rc file, and is useful for - understanding the contents of a resource file. Someday we may want - to generate an rc file which the rc compiler can read; if that day - comes, this code will have to be fixed up. */ + Reasoned by the fact, that some resources need to be stored into file and + refer to that file, we use the user-data model for that to express it binary + without the need to store it somewhere externally. */ void -write_rc_file (const char *filename, const struct res_directory *resources) +write_rc_file (const char *filename, const rc_res_directory *resources) { FILE *e; - int language; + rc_uint_type language; if (filename == NULL) e = stdout; @@ -1494,9 +1891,9 @@ write_rc_file (const char *filename, const struct res_directory *resources) fatal (_("can't open `%s' for output: %s"), filename, strerror (errno)); } - language = -1; - write_rc_directory (e, resources, (const struct res_id *) NULL, - (const struct res_id *) NULL, &language, 1); + language = (rc_uint_type) ((bfd_signed_vma) -1); + write_rc_directory (e, resources, (const rc_res_id *) NULL, + (const rc_res_id *) NULL, &language, 1); } /* Write out a directory. E is the file to write to. RD is the @@ -1506,20 +1903,23 @@ write_rc_file (const char *filename, const struct res_directory *resources) language. LEVEL is the level in the tree. */ static void -write_rc_directory (FILE *e, const struct res_directory *rd, - const struct res_id *type, const struct res_id *name, - int *language, int level) +write_rc_directory (FILE *e, const rc_res_directory *rd, + const rc_res_id *type, const rc_res_id *name, + rc_uint_type *language, int level) { - const struct res_entry *re; + const rc_res_entry *re; /* Print out some COFF information that rc files can't represent. */ - + if (rd->time != 0 || rd->characteristics != 0 || rd->major != 0 || rd->minor != 0) + { + wr_printcomment (e, "COFF information not part of RC"); if (rd->time != 0) - fprintf (e, "// Time stamp: %lu\n", rd->time); + wr_printcomment (e, "Time stamp: %u", rd->time); if (rd->characteristics != 0) - fprintf (e, "// Characteristics: %lu\n", rd->characteristics); + wr_printcomment (e, "Characteristics: %u", rd->characteristics); if (rd->major != 0 || rd->minor != 0) - fprintf (e, "// Version: %d %d\n", rd->major, rd->minor); + wr_printcomment (e, "Version major:%d minor:%d", rd->major, rd->minor); + } for (re = rd->entries; re != NULL; re = re->next) { @@ -1546,7 +1946,7 @@ write_rc_directory (FILE *e, const struct res_directory *rd, && re->id.u.id != (unsigned long) (unsigned int) *language && (re->id.u.id & 0xffff) == re->id.u.id) { - fprintf (e, "LANGUAGE %lu, %lu\n", + wr_print (e, "LANGUAGE %u, %u\n", re->id.u.id & ((1 << SUBLANG_SHIFT) - 1), (re->id.u.id >> SUBLANG_SHIFT) & 0xff); *language = re->id.u.id; @@ -1572,12 +1972,16 @@ write_rc_directory (FILE *e, const struct res_directory *rd, } else { - fprintf (e, "// Resource at unexpected level %d\n", level); - write_rc_resource (e, type, (struct res_id *) NULL, re->u.res, + wr_printcomment (e, "Resource at unexpected level %d", level); + write_rc_resource (e, type, (rc_res_id *) NULL, re->u.res, language); } } } + if (rd->entries == NULL) + { + wr_print_flush (e); + } } /* Write out a subdirectory entry. E is the file to write to. RE is @@ -1586,15 +1990,15 @@ write_rc_directory (FILE *e, const struct res_directory *rd, LEVEL is the level in the tree. */ static void -write_rc_subdir (FILE *e, const struct res_entry *re, - const struct res_id *type, const struct res_id *name, - int *language, int level) +write_rc_subdir (FILE *e, const rc_res_entry *re, + const rc_res_id *type, const rc_res_id *name, + rc_uint_type *language, int level) { fprintf (e, "\n"); switch (level) { case 1: - fprintf (e, "// Type: "); + wr_printcomment (e, "Type: "); if (re->id.named) res_id_print (e, re->id, 1); else @@ -1622,6 +2026,8 @@ write_rc_subdir (FILE *e, const struct res_entry *re, case RT_VXD: s = "vxd"; break; case RT_ANICURSOR: s = "anicursor"; break; case RT_ANIICON: s = "aniicon"; break; + case RT_TOOLBAR: s = "toolbar"; break; + case RT_HTML: s = "html"; break; default: s = NULL; break; } @@ -1630,25 +2036,21 @@ write_rc_subdir (FILE *e, const struct res_entry *re, else res_id_print (e, re->id, 1); } - fprintf (e, "\n"); break; case 2: - fprintf (e, "// Name: "); + wr_printcomment (e, "Name: "); res_id_print (e, re->id, 1); - fprintf (e, "\n"); break; case 3: - fprintf (e, "// Language: "); + wr_printcomment (e, "Language: "); res_id_print (e, re->id, 1); - fprintf (e, "\n"); break; default: - fprintf (e, "// Level %d: ", level); + wr_printcomment (e, "Level %d: ", level); res_id_print (e, re->id, 1); - fprintf (e, "\n"); } write_rc_directory (e, re->u.dir, type, name, language, level + 1); @@ -1661,38 +2063,36 @@ write_rc_subdir (FILE *e, const struct res_entry *re, language. */ static void -write_rc_resource (FILE *e, const struct res_id *type, - const struct res_id *name, const struct res_resource *res, - int *language) +write_rc_resource (FILE *e, const rc_res_id *type, + const rc_res_id *name, const rc_res_resource *res, + rc_uint_type *language) { const char *s; int rt; int menuex = 0; - fprintf (e, "\n"); - switch (res->type) { default: abort (); case RES_TYPE_ACCELERATOR: - s = "ACCELERATOR"; + s = "ACCELERATORS"; rt = RT_ACCELERATOR; break; case RES_TYPE_BITMAP: - s = "BITMAP"; + s = "2 /* RT_BITMAP */"; rt = RT_BITMAP; break; case RES_TYPE_CURSOR: - s = "CURSOR"; + s = "1 /* RT_CURSOR */"; rt = RT_CURSOR; break; case RES_TYPE_GROUP_CURSOR: - s = "GROUP_CURSOR"; + s = "12 /* RT_GROUP_CURSOR */"; rt = RT_GROUP_CURSOR; break; @@ -1705,22 +2105,22 @@ write_rc_resource (FILE *e, const struct res_id *type, break; case RES_TYPE_FONT: - s = "FONT"; + s = "8 /* RT_FONT */"; rt = RT_FONT; break; case RES_TYPE_FONTDIR: - s = "FONTDIR"; + s = "7 /* RT_FONTDIR */"; rt = RT_FONTDIR; break; case RES_TYPE_ICON: - s = "ICON"; + s = "3 /* RT_ICON */"; rt = RT_ICON; break; case RES_TYPE_GROUP_ICON: - s = "GROUP_ICON"; + s = "14 /* RT_GROUP_ICON */"; rt = RT_GROUP_ICON; break; @@ -1739,7 +2139,7 @@ write_rc_resource (FILE *e, const struct res_id *type, break; case RES_TYPE_MESSAGETABLE: - s = "MESSAGETABLE"; + s = "11 /* RT_MESSAGETABLE */"; rt = RT_MESSAGETABLE; break; @@ -1762,32 +2162,76 @@ write_rc_resource (FILE *e, const struct res_id *type, s = "VERSIONINFO"; rt = RT_VERSION; break; + + case RES_TYPE_TOOLBAR: + s = "TOOLBAR"; + rt = RT_TOOLBAR; + break; } if (rt != 0 && type != NULL && (type->named || type->u.id != (unsigned long) rt)) { - fprintf (e, "// Unexpected resource type mismatch: "); + wr_printcomment (e, "Unexpected resource type mismatch: "); res_id_print (e, *type, 1); fprintf (e, " != %d", rt); } if (res->coff_info.codepage != 0) - fprintf (e, "// Code page: %lu\n", res->coff_info.codepage); + wr_printcomment (e, "Code page: %u", res->coff_info.codepage); if (res->coff_info.reserved != 0) - fprintf (e, "// COFF reserved value: %lu\n", res->coff_info.reserved); + wr_printcomment (e, "COFF reserved value: %u", res->coff_info.reserved); + wr_print (e, "\n"); + if (rt == RT_STRING) + ; + else + { if (name != NULL) - res_id_print (e, *name, 0); + res_id_print (e, *name, 1); else fprintf (e, "??Unknown-Name??"); - fprintf (e, " "); + } + if (s != NULL) fprintf (e, "%s", s); else if (type != NULL) + { + if (type->named == 0) + { +#define PRINT_RT_NAME(NAME) case NAME: \ + fprintf (e, "%u /* %s */", (unsigned int) NAME, #NAME); \ + break + + switch (type->u.id) + { + default: res_id_print (e, *type, 0); + break; + + PRINT_RT_NAME(RT_MANIFEST); + PRINT_RT_NAME(RT_ANICURSOR); + PRINT_RT_NAME(RT_ANIICON); + PRINT_RT_NAME(RT_RCDATA); + PRINT_RT_NAME(RT_ICON); + PRINT_RT_NAME(RT_CURSOR); + PRINT_RT_NAME(RT_BITMAP); + PRINT_RT_NAME(RT_PLUGPLAY); + PRINT_RT_NAME(RT_VXD); + PRINT_RT_NAME(RT_FONT); + PRINT_RT_NAME(RT_FONTDIR); + PRINT_RT_NAME(RT_HTML); + PRINT_RT_NAME(RT_MESSAGETABLE); + PRINT_RT_NAME(RT_DLGINCLUDE); + PRINT_RT_NAME(RT_DLGINIT); + } +#undef PRINT_RT_NAME + } + else + res_id_print (e, *type, 1); + } else fprintf (e, "??Unknown-Type??"); @@ -1805,11 +2249,17 @@ write_rc_resource (FILE *e, const struct res_id *type, if (res->type == RES_TYPE_DIALOG) { - fprintf (e, " %d, %d, %d, %d", res->u.dialog->x, res->u.dialog->y, - res->u.dialog->width, res->u.dialog->height); + fprintf (e, " %d, %d, %d, %d", + (int) res->u.dialog->x, (int) res->u.dialog->y, + (int) res->u.dialog->width, (int) res->u.dialog->height); if (res->u.dialog->ex != NULL && res->u.dialog->ex->help != 0) - fprintf (e, ", %lu", res->u.dialog->ex->help); + fprintf (e, ", %u", (unsigned int) res->u.dialog->ex->help); + } + else if (res->type == RES_TYPE_TOOLBAR) + { + fprintf (e, " %d, %d", (int) res->u.toolbar->button_width, + (int) res->u.toolbar->button_height); } fprintf (e, "\n"); @@ -1838,16 +2288,16 @@ write_rc_resource (FILE *e, const struct res_id *type, if (res->res_info.language != 0 && res->res_info.language != *language) fprintf (e, "%sLANGUAGE %d, %d\n", modifiers ? "// " : "", - res->res_info.language & ((1<res_info.language >> SUBLANG_SHIFT) & 0xff); + (int) res->res_info.language & ((1<res_info.language >> SUBLANG_SHIFT) & 0xff); if (res->res_info.characteristics != 0) - fprintf (e, "%sCHARACTERISTICS %lu\n", + fprintf (e, "%sCHARACTERISTICS %u\n", modifiers ? "// " : "", - res->res_info.characteristics); + (unsigned int) res->res_info.characteristics); if (res->res_info.version != 0) - fprintf (e, "%sVERSION %lu\n", + fprintf (e, "%sVERSION %u\n", modifiers ? "// " : "", - res->res_info.version); + (unsigned int) res->res_info.version); } switch (res->type) @@ -1895,6 +2345,10 @@ write_rc_resource (FILE *e, const struct res_id *type, write_rc_rcdata (e, res->u.userdata, 0); break; + case RES_TYPE_TOOLBAR: + write_rc_toolbar (e, res->u.toolbar); + break; + case RES_TYPE_VERSIONINFO: write_rc_versioninfo (e, res->u.versioninfo); break; @@ -1902,8 +2356,10 @@ write_rc_resource (FILE *e, const struct res_id *type, case RES_TYPE_BITMAP: case RES_TYPE_FONT: case RES_TYPE_ICON: + write_rc_datablock (e, res->u.data.length, res->u.data.data, 0, 1, 0); + break; case RES_TYPE_MESSAGETABLE: - write_rc_filedata (e, res->u.data.length, res->u.data.data); + write_rc_messagetable (e, res->u.data.length, res->u.data.data); break; } } @@ -1911,9 +2367,9 @@ write_rc_resource (FILE *e, const struct res_id *type, /* Write out accelerator information. */ static void -write_rc_accelerators (FILE *e, const struct accelerator *accelerators) +write_rc_accelerators (FILE *e, const rc_accelerator *accelerators) { - const struct accelerator *acc; + const rc_accelerator *acc; fprintf (e, "BEGIN\n"); for (acc = accelerators; acc != NULL; acc = acc->next) @@ -1926,16 +2382,16 @@ write_rc_accelerators (FILE *e, const struct accelerator *accelerators) && ISPRINT (acc->key) && (acc->flags & ACC_VIRTKEY) == 0) { - fprintf (e, "\"%c\"", acc->key); + fprintf (e, "\"%c\"", (char) acc->key); printable = 1; } else { - fprintf (e, "%d", acc->key); + fprintf (e, "%d", (int) acc->key); printable = 0; } - fprintf (e, ", %d", acc->id); + fprintf (e, ", %d", (int) acc->id); if (! printable) { @@ -1962,41 +2418,60 @@ write_rc_accelerators (FILE *e, const struct accelerator *accelerators) file, which the rc file would include. */ static void -write_rc_cursor (FILE *e, const struct cursor *cursor) +write_rc_cursor (FILE *e, const rc_cursor *cursor) { - fprintf (e, "// Hotspot: x: %d; y: %d\n", cursor->xhotspot, - cursor->yhotspot); - write_rc_filedata (e, cursor->length, cursor->data); + fprintf (e, "BEGIN\n"); + indent (e, 2); + fprintf (e, " 0x%x, 0x%x,\t/* Hotspot x: %d, y: %d. */\n", + (unsigned int) cursor->xhotspot, (unsigned int) cursor->yhotspot, + (int) cursor->xhotspot, (int) cursor->yhotspot); + write_rc_datablock (e, (rc_uint_type) cursor->length, (const bfd_byte *) cursor->data, + 0, 0, 0); + fprintf (e, "END\n"); } /* Write out group cursor data. This would normally be built from the cursor data. */ static void -write_rc_group_cursor (FILE *e, const struct group_cursor *group_cursor) +write_rc_group_cursor (FILE *e, const rc_group_cursor *group_cursor) { - const struct group_cursor *gc; + const rc_group_cursor *gc; + int c; - for (gc = group_cursor; gc != NULL; gc = gc->next) + for (c = 0, gc = group_cursor; gc != NULL; gc = gc->next, c++) + ; + fprintf (e, "BEGIN\n"); + + indent (e, 2); + fprintf (e, "0, 2, %d%s\t /* Having %d items. */\n", c, (c != 0 ? "," : ""), c); + indent (e, 4); + fprintf (e, "/* width, height, planes, bits, bytes, index. */\n"); + + for (c = 1, gc = group_cursor; gc != NULL; gc = gc->next, c++) { - fprintf (e, "// width: %d; height %d; planes %d; bits %d\n", - gc->width, gc->height, gc->planes, gc->bits); - fprintf (e, "// data bytes: %lu; index: %d\n", - gc->bytes, gc->index); + indent (e, 4); + fprintf (e, "%d, %d, %d, %d, 0x%xL, %d%s /* Element %d. */\n", + (int) gc->width, (int) gc->height, (int) gc->planes, (int) gc->bits, + (unsigned int) gc->bytes, (int) gc->index, (gc->next != NULL ? "," : ""), c); + fprintf (e, "/* width: %d; height %d; planes %d; bits %d. */\n", + (int) gc->width, (int) gc->height, (int) gc->planes, + (int) gc->bits); } + fprintf (e, "END\n"); } /* Write dialog data. */ static void -write_rc_dialog (FILE *e, const struct dialog *dialog) +write_rc_dialog (FILE *e, const rc_dialog *dialog) { - const struct dialog_control *control; + const rc_dialog_control *control; - fprintf (e, "STYLE 0x%lx\n", dialog->style); + fprintf (e, "STYLE 0x%x\n", dialog->style); if (dialog->exstyle != 0) - fprintf (e, "EXSTYLE 0x%lx\n", dialog->exstyle); + fprintf (e, "EXSTYLE 0x%x\n", (unsigned int) dialog->exstyle); if ((dialog->class.named && dialog->class.u.n.length > 0) || dialog->class.u.id != 0) @@ -2008,9 +2483,9 @@ write_rc_dialog (FILE *e, const struct dialog *dialog) if (dialog->caption != NULL) { - fprintf (e, "CAPTION \""); - unicode_print (e, dialog->caption, -1); - fprintf (e, "\"\n"); + fprintf (e, "CAPTION "); + unicode_print_quoted (e, dialog->caption, -1); + fprintf (e, "\n"); } if ((dialog->menu.named && dialog->menu.u.n.length > 0) @@ -2023,15 +2498,16 @@ write_rc_dialog (FILE *e, const struct dialog *dialog) if (dialog->font != NULL) { - fprintf (e, "FONT %d, \"", dialog->pointsize); - unicode_print (e, dialog->font, -1); - fprintf (e, "\""); + fprintf (e, "FONT %d, ", (int) dialog->pointsize); + unicode_print_quoted (e, dialog->font, -1); if (dialog->ex != NULL && (dialog->ex->weight != 0 || dialog->ex->italic != 0 || dialog->ex->charset != 1)) fprintf (e, ", %d, %d, %d", - dialog->ex->weight, dialog->ex->italic, dialog->ex->charset); + (int) dialog->ex->weight, + (int) dialog->ex->italic, + (int) dialog->ex->charset); fprintf (e, "\n"); } @@ -2082,7 +2558,7 @@ static const struct control_info control_info[] = /* Write a dialog control. */ static void -write_rc_dialog_control (FILE *e, const struct dialog_control *control) +write_rc_dialog_control (FILE *e, const rc_dialog_control *control) { const struct control_info *ci; @@ -2103,7 +2579,10 @@ write_rc_dialog_control (FILE *e, const struct dialog_control *control) else if (ci->name != NULL) fprintf (e, "%s", ci->name); else + { fprintf (e, "CONTROL"); + ci = NULL; + } if (control->text.named || control->text.u.id != 0) { @@ -2112,7 +2591,7 @@ write_rc_dialog_control (FILE *e, const struct dialog_control *control) fprintf (e, ","); } - fprintf (e, " %d, ", control->id); + fprintf (e, " %d, ", (int) control->id); if (ci == NULL) { @@ -2121,10 +2600,10 @@ write_rc_dialog_control (FILE *e, const struct dialog_control *control) res_id_print (e, control->class, 0); if (control->class.named) fprintf (e, "\""); - fprintf (e, ", 0x%lx, ", control->style); + fprintf (e, ", 0x%x, ", (unsigned int) control->style); } - fprintf (e, "%d, %d", control->x, control->y); + fprintf (e, "%d, %d", (int) control->x, (int) control->y); if (control->style != SS_ICON || control->exstyle != 0 @@ -2132,15 +2611,17 @@ write_rc_dialog_control (FILE *e, const struct dialog_control *control) || control->height != 0 || control->help != 0) { - fprintf (e, ", %d, %d", control->width, control->height); + fprintf (e, ", %d, %d", (int) control->width, (int) control->height); /* FIXME: We don't need to print the style if it is the default. More importantly, in certain cases we actually need to turn off parts of the forced style, by using NOT. */ - fprintf (e, ", 0x%lx", control->style); + if (ci != NULL) + fprintf (e, ", 0x%x", (unsigned int) control->style); if (control->exstyle != 0 || control->help != 0) - fprintf (e, ", 0x%lx, %lu", control->exstyle, control->help); + fprintf (e, ", 0x%x, %u", (unsigned int) control->exstyle, + (unsigned int) control->help); } fprintf (e, "\n"); @@ -2153,51 +2634,93 @@ write_rc_dialog_control (FILE *e, const struct dialog_control *control) the font data. */ static void -write_rc_fontdir (FILE *e, const struct fontdir *fontdir) +write_rc_fontdir (FILE *e, const rc_fontdir *fontdir) { - const struct fontdir *fc; + const rc_fontdir *fc; + int c; - for (fc = fontdir; fc != NULL; fc = fc->next) + for (c = 0, fc = fontdir; fc != NULL; fc = fc->next, c++) + ; + fprintf (e, "BEGIN\n"); + indent (e, 2); + fprintf (e, "%d%s\t /* Has %d elements. */\n", c, (c != 0 ? "," : ""), c); + for (c = 1, fc = fontdir; fc != NULL; fc = fc->next, c++) { - fprintf (e, "// Font index: %d\n", fc->index); - write_rc_filedata (e, fc->length, fc->data); + indent (e, 4); + fprintf (e, "%d,\t/* Font no %d with index %d. */\n", + (int) fc->index, c, (int) fc->index); + write_rc_datablock (e, (rc_uint_type) fc->length - 2, + (const bfd_byte *) fc->data + 4,fc->next != NULL, + 0, 0); } + fprintf (e, "END\n"); } /* Write out group icon data. This would normally be built from the icon data. */ static void -write_rc_group_icon (FILE *e, const struct group_icon *group_icon) +write_rc_group_icon (FILE *e, const rc_group_icon *group_icon) { - const struct group_icon *gi; + const rc_group_icon *gi; + int c; - for (gi = group_icon; gi != NULL; gi = gi->next) + for (c = 0, gi = group_icon; gi != NULL; gi = gi->next, c++) + ; + + fprintf (e, "BEGIN\n"); + indent (e, 2); + fprintf (e, " 0, 1, %d%s\t /* Has %d elements. */\n", c, (c != 0 ? "," : ""), c); + + indent (e, 4); + fprintf (e, "/* \"width height colors pad\", planes, bits, bytes, index. */\n"); + for (c = 1, gi = group_icon; gi != NULL; gi = gi->next, c++) { - fprintf (e, "// width: %d; height %d; colors: %d; planes %d; bits %d\n", - gi->width, gi->height, gi->colors, gi->planes, gi->bits); - fprintf (e, "// data bytes: %lu; index: %d\n", - gi->bytes, gi->index); + indent (e, 4); + fprintf (e, "\"\\%03o\\%03o\\%03o\\%03o\", %d, %d, 0x%xL, %d%s\t/* Element no %d. */\n", + gi->width, gi->height, gi->colors, 0, (int) gi->planes, (int) gi->bits, + (unsigned int) gi->bytes, (int) gi->index, (gi->next != NULL ? "," : ""), c); } + fprintf (e, "END\n"); } /* Write out a menu resource. */ static void -write_rc_menu (FILE *e, const struct menu *menu, int menuex) +write_rc_menu (FILE *e, const rc_menu *menu, int menuex) { if (menu->help != 0) - fprintf (e, "// Help ID: %lu\n", menu->help); + fprintf (e, "// Help ID: %u\n", (unsigned int) menu->help); write_rc_menuitems (e, menu->items, menuex, 0); } +static void +write_rc_toolbar (FILE *e, const rc_toolbar *tb) +{ + rc_toolbar_item *it; + indent (e, 0); + fprintf (e, "BEGIN\n"); + it = tb->items; + while(it != NULL) + { + indent (e, 2); + if (it->id.u.id == 0) + fprintf (e, "SEPARATOR\n"); + else + fprintf (e, "BUTTON %d\n", (int) it->id.u.id); + it = it->next; + } + indent (e, 0); + fprintf (e, "END\n"); +} + /* Write out menuitems. */ static void -write_rc_menuitems (FILE *e, const struct menuitem *menuitems, int menuex, +write_rc_menuitems (FILE *e, const rc_menuitem *menuitems, int menuex, int ind) { - const struct menuitem *mi; + const rc_menuitem *mi; indent (e, ind); fprintf (e, "BEGIN\n"); @@ -2225,15 +2748,14 @@ write_rc_menuitems (FILE *e, const struct menuitem *menuitems, int menuex, fprintf (e, " \"\""); else { - fprintf (e, " \""); - unicode_print (e, mi->text, -1); - fprintf (e, "\""); + fprintf (e, " "); + unicode_print_quoted (e, mi->text, -1); } if (! menuex) { if (mi->popup == NULL) - fprintf (e, ", %d", mi->id); + fprintf (e, ", %d", (int) mi->id); if ((mi->type & MENUITEM_CHECKED) != 0) fprintf (e, ", CHECKED"); @@ -2252,15 +2774,15 @@ write_rc_menuitems (FILE *e, const struct menuitem *menuitems, int menuex, { if (mi->id != 0 || mi->type != 0 || mi->state != 0 || mi->help != 0) { - fprintf (e, ", %d", mi->id); + fprintf (e, ", %d", (int) mi->id); if (mi->type != 0 || mi->state != 0 || mi->help != 0) { - fprintf (e, ", %lu", mi->type); + fprintf (e, ", %u", (unsigned int) mi->type); if (mi->state != 0 || mi->help != 0) { - fprintf (e, ", %lu", mi->state); + fprintf (e, ", %u", (unsigned int) mi->state); if (mi->help != 0) - fprintf (e, ", %lu", mi->help); + fprintf (e, ", %u", (unsigned int) mi->help); } } } @@ -2276,13 +2798,289 @@ write_rc_menuitems (FILE *e, const struct menuitem *menuitems, int menuex, fprintf (e, "END\n"); } +static int +test_rc_datablock_unicode (rc_uint_type length, const bfd_byte *data) +{ + rc_uint_type i; + if ((length & 1) != 0) + return 0; + + for (i = 0; i < length; i += 2) + { + if (data[i] == 0 && data[i + 1] == 0 && (i + 2) < length) + return 0; + if (data[i] == 0xff && data[i + 1] == 0xff) + return 0; + } + return 1; +} + +static int +test_rc_datablock_text (rc_uint_type length, const bfd_byte *data) +{ + int has_nl; + rc_uint_type c; + rc_uint_type i; + + if (length <= 1) + return 0; + + has_nl = 0; + for (i = 0, c = 0; i < length; i++) + { + if (! ISPRINT (data[i]) && data[i] != '\n' + && ! (data[i] == '\r' && (i + 1) < length && data[i + 1] == '\n') + && data[i] != '\t' + && ! (data[i] == 0 && (i + 1) != length)) + { + if (data[i] <= 7) + return 0; + c++; + } + else if (data[i] == '\n') has_nl++; + } + if (length > 80 && ! has_nl) + return 0; + c = (((c * 10000) + (i / 100) - 1)) / i; + if (c >= 150) + return 0; + return 1; +} + +static void +write_rc_messagetable (FILE *e, rc_uint_type length, const bfd_byte *data) +{ + int has_error = 0; + const struct bin_messagetable *mt; + fprintf (e, "BEGIN\n"); + + write_rc_datablock (e, length, data, 0, 0, 0); + + fprintf (e, "\n"); + wr_printcomment (e, "MC syntax dump"); + if (length < BIN_MESSAGETABLE_SIZE) + has_error = 1; + else + do { + rc_uint_type m, i; + mt = (const struct bin_messagetable *) data; + m = windres_get_32 (&wrtarget, mt->cblocks, length); + if (length < (BIN_MESSAGETABLE_SIZE + m * BIN_MESSAGETABLE_BLOCK_SIZE)) + { + has_error = 1; + break; + } + for (i = 0; i < m; i++) + { + rc_uint_type low, high, offset; + const struct bin_messagetable_item *mti; + + low = windres_get_32 (&wrtarget, mt->items[i].lowid, 4); + high = windres_get_32 (&wrtarget, mt->items[i].highid, 4); + offset = windres_get_32 (&wrtarget, mt->items[i].offset, 4); + while (low <= high) + { + rc_uint_type elen, flags; + if ((offset + BIN_MESSAGETABLE_ITEM_SIZE) > length) + { + has_error = 1; + break; + } + mti = (const struct bin_messagetable_item *) &data[offset]; + elen = windres_get_16 (&wrtarget, mti->length, 2); + flags = windres_get_16 (&wrtarget, mti->flags, 2); + if ((offset + elen) > length) + { + has_error = 1; + break; + } + wr_printcomment (e, "MessageId = 0x%x", low); + wr_printcomment (e, ""); + if ((flags & MESSAGE_RESOURCE_UNICODE) == MESSAGE_RESOURCE_UNICODE) + unicode_print (e, (const unichar *) mti->data, + (elen - BIN_MESSAGETABLE_ITEM_SIZE) / 2); + else + ascii_print (e, (const char *) mti->data, + (elen - BIN_MESSAGETABLE_ITEM_SIZE)); + wr_printcomment (e,""); + ++low; + offset += elen; + } + } + } while (0); + if (has_error) + wr_printcomment (e, "Illegal data"); + wr_print_flush (e); + fprintf (e, "END\n"); +} + +static void +write_rc_datablock (FILE *e, rc_uint_type length, const bfd_byte *data, int has_next, + int hasblock, int show_comment) +{ + int plen; + + if (hasblock) + fprintf (e, "BEGIN\n"); + + if (show_comment == -1) + { + if (test_rc_datablock_text(length, data)) + { + rc_uint_type i, c; + for (i = 0; i < length;) + { + indent (e, 2); + fprintf (e, "\""); + + for (c = 0; i < length && c < 160 && data[i] != '\n'; c++, i++) + ; + if (i < length && data[i] == '\n') + ++i, ++c; + ascii_print (e, (const char *) &data[i - c], c); + fprintf (e, "\""); + if (i < length) + fprintf (e, "\n"); + } + + if (i == 0) + { + indent (e, 2); + fprintf (e, "\"\""); + } + if (has_next) + fprintf (e, ","); + fprintf (e, "\n"); + if (hasblock) + fprintf (e, "END\n"); + return; + } + if (test_rc_datablock_unicode (length, data)) + { + rc_uint_type i, c; + for (i = 0; i < length;) + { + const unichar *u; + + u = (const unichar *) &data[i]; + indent (e, 2); + fprintf (e, "L\""); + + for (c = 0; i < length && c < 160 && u[c] != '\n'; c++, i += 2) + ; + if (i < length && u[c] == '\n') + i += 2, ++c; + unicode_print (e, u, c); + fprintf (e, "\""); + if (i < length) + fprintf (e, "\n"); + } + + if (i == 0) + { + indent (e, 2); + fprintf (e, "L\"\""); + } + if (has_next) + fprintf (e, ","); + fprintf (e, "\n"); + if (hasblock) + fprintf (e, "END\n"); + return; + } + + show_comment = 0; + } + + if (length != 0) + { + rc_uint_type i, max_row; + int first = 1; + + max_row = (show_comment ? 4 : 8); + indent (e, 2); + for (i = 0; i + 3 < length;) + { + rc_uint_type k; + rc_uint_type comment_start; + + comment_start = i; + + if (! first) + indent (e, 2); + + for (k = 0; k < max_row && i + 3 < length; k++, i += 4) + { + if (k == 0) + plen = fprintf (e, "0x%lxL", + (long) windres_get_32 (&wrtarget, data + i, length - i)); + else + plen = fprintf (e, " 0x%lxL", + (long) windres_get_32 (&wrtarget, data + i, length - i)) - 1; + if (has_next || (i + 4) < length) + { + if (plen>0 && plen < 11) + indent (e, 11 - plen); + fprintf (e, ","); + } + } + if (show_comment) + { + fprintf (e, "\t/* "); + ascii_print (e, (const char *) &data[comment_start], i - comment_start); + fprintf (e, ". */"); + } + fprintf (e, "\n"); + first = 0; + } + + if (i + 1 < length) + { + if (! first) + indent (e, 2); + plen = fprintf (e, "0x%x", + (int) windres_get_16 (&wrtarget, data + i, length - i)); + if (has_next || i + 2 < length) + { + if (plen > 0 && plen < 11) + indent (e, 11 - plen); + fprintf (e, ","); + } + if (show_comment) + { + fprintf (e, "\t/* "); + ascii_print (e, (const char *) &data[i], 2); + fprintf (e, ". */"); + } + fprintf (e, "\n"); + i += 2; + first = 0; + } + + if (i < length) + { + if (! first) + indent (e, 2); + fprintf (e, "\""); + ascii_print (e, (const char *) &data[i], 1); + fprintf (e, "\""); + if (has_next) + fprintf (e, ","); + fprintf (e, "\n"); + first = 0; + } + } + if (hasblock) + fprintf (e, "END\n"); +} + /* Write out an rcdata resource. This is also used for other types of resources that need to print arbitrary data. */ static void -write_rc_rcdata (FILE *e, const struct rcdata_item *rcdata, int ind) +write_rc_rcdata (FILE *e, const rc_rcdata_item *rcdata, int ind) { - const struct rcdata_item *ri; + const rc_rcdata_item *ri; indent (e, ind); fprintf (e, "BEGIN\n"); @@ -2292,142 +3090,40 @@ write_rc_rcdata (FILE *e, const struct rcdata_item *rcdata, int ind) if (ri->type == RCDATA_BUFFER && ri->u.buffer.length == 0) continue; - indent (e, ind + 2); - switch (ri->type) { default: abort (); case RCDATA_WORD: - fprintf (e, "%d", ri->u.word); + indent (e, ind + 2); + fprintf (e, "%ld", (long) (ri->u.word & 0xffff)); break; case RCDATA_DWORD: - fprintf (e, "%luL", ri->u.dword); + indent (e, ind + 2); + fprintf (e, "%luL", (unsigned long) ri->u.dword); break; case RCDATA_STRING: - { - const char *s; - unsigned long i; - - fprintf (e, "\""); - s = ri->u.string.s; - for (i = 0; i < ri->u.string.length; i++) - { - if (ISPRINT (*s)) - putc (*s, e); - else - fprintf (e, "\\%03o", *s); - } - fprintf (e, "\""); - break; - } + indent (e, ind + 2); + fprintf (e, "\""); + ascii_print (e, ri->u.string.s, ri->u.string.length); + fprintf (e, "\""); + break; case RCDATA_WSTRING: + indent (e, ind + 2); fprintf (e, "L\""); unicode_print (e, ri->u.wstring.w, ri->u.wstring.length); fprintf (e, "\""); break; case RCDATA_BUFFER: - { - unsigned long i; - int first; - - /* Assume little endian data. */ - - first = 1; - for (i = 0; i + 3 < ri->u.buffer.length; i += 4) - { - unsigned long l; - int j; - - if (! first) - indent (e, ind + 2); - l = ((((((ri->u.buffer.data[i + 3] << 8) - | ri->u.buffer.data[i + 2]) << 8) - | ri->u.buffer.data[i + 1]) << 8) - | ri->u.buffer.data[i]); - fprintf (e, "%luL", l); - if (i + 4 < ri->u.buffer.length || ri->next != NULL) - fprintf (e, ","); - for (j = 0; j < 4; ++j) - if (! ISPRINT (ri->u.buffer.data[i + j]) - && ri->u.buffer.data[i + j] != 0) - break; - if (j >= 4) - { - fprintf (e, "\t// "); - for (j = 0; j < 4; ++j) - { - if (! ISPRINT (ri->u.buffer.data[i + j])) - fprintf (e, "\\%03o", ri->u.buffer.data[i + j]); - else - { - if (ri->u.buffer.data[i + j] == '\\') - fprintf (e, "\\"); - fprintf (e, "%c", ri->u.buffer.data[i + j]); - } - } - } - fprintf (e, "\n"); - first = 0; - } - - if (i + 1 < ri->u.buffer.length) - { - int s; - int j; - - if (! first) - indent (e, ind + 2); - s = (ri->u.buffer.data[i + 1] << 8) | ri->u.buffer.data[i]; - fprintf (e, "%d", s); - if (i + 2 < ri->u.buffer.length || ri->next != NULL) - fprintf (e, ","); - for (j = 0; j < 2; ++j) - if (! ISPRINT (ri->u.buffer.data[i + j]) - && ri->u.buffer.data[i + j] != 0) - break; - if (j >= 2) - { - fprintf (e, "\t// "); - for (j = 0; j < 2; ++j) - { - if (! ISPRINT (ri->u.buffer.data[i + j])) - fprintf (e, "\\%03o", ri->u.buffer.data[i + j]); - else - { - if (ri->u.buffer.data[i + j] == '\\') - fprintf (e, "\\"); - fprintf (e, "%c", ri->u.buffer.data[i + j]); - } - } - } - fprintf (e, "\n"); - i += 2; - first = 0; - } - - if (i < ri->u.buffer.length) - { - if (! first) - indent (e, ind + 2); - if ((ri->u.buffer.data[i] & 0x7f) == ri->u.buffer.data[i] - && ISPRINT (ri->u.buffer.data[i])) - fprintf (e, "\"%c\"", ri->u.buffer.data[i]); - else - fprintf (e, "\"\\%03o\"", ri->u.buffer.data[i]); - if (ri->next != NULL) - fprintf (e, ","); - fprintf (e, "\n"); - first = 0; - } - + write_rc_datablock (e, (rc_uint_type) ri->u.buffer.length, + (const bfd_byte *) ri->u.buffer.data, + ri->next != NULL, 0, -1); break; - } } if (ri->type != RCDATA_BUFFER) @@ -2445,17 +3141,17 @@ write_rc_rcdata (FILE *e, const struct rcdata_item *rcdata, int ind) /* Write out a stringtable resource. */ static void -write_rc_stringtable (FILE *e, const struct res_id *name, - const struct stringtable *stringtable) +write_rc_stringtable (FILE *e, const rc_res_id *name, + const rc_stringtable *stringtable) { - unsigned long offset; + rc_uint_type offset; int i; if (name != NULL && ! name->named) offset = (name->u.id - 1) << 4; else { - fprintf (e, "// %s string table name\n", + fprintf (e, "/* %s string table name. */\n", name == NULL ? "Missing" : "Invalid"); offset = 0; } @@ -2466,10 +3162,10 @@ write_rc_stringtable (FILE *e, const struct res_id *name, { if (stringtable->strings[i].length != 0) { - fprintf (e, " %lu, \"", offset + i); - unicode_print (e, stringtable->strings[i].string, + fprintf (e, " %lu, ", (long) offset + i); + unicode_print_quoted (e, stringtable->strings[i].string, stringtable->strings[i].length); - fprintf (e, "\"\n"); + fprintf (e, "\n"); } } @@ -2479,36 +3175,37 @@ write_rc_stringtable (FILE *e, const struct res_id *name, /* Write out a versioninfo resource. */ static void -write_rc_versioninfo (FILE *e, const struct versioninfo *versioninfo) +write_rc_versioninfo (FILE *e, const rc_versioninfo *versioninfo) { - const struct fixed_versioninfo *f; - const struct ver_info *vi; + const rc_fixed_versioninfo *f; + const rc_ver_info *vi; f = versioninfo->fixed; if (f->file_version_ms != 0 || f->file_version_ls != 0) - fprintf (e, " FILEVERSION %lu, %lu, %lu, %lu\n", - (f->file_version_ms >> 16) & 0xffff, - f->file_version_ms & 0xffff, - (f->file_version_ls >> 16) & 0xffff, - f->file_version_ls & 0xffff); + fprintf (e, " FILEVERSION %u, %u, %u, %u\n", + (unsigned int) ((f->file_version_ms >> 16) & 0xffff), + (unsigned int) (f->file_version_ms & 0xffff), + (unsigned int) ((f->file_version_ls >> 16) & 0xffff), + (unsigned int) (f->file_version_ls & 0xffff)); if (f->product_version_ms != 0 || f->product_version_ls != 0) - fprintf (e, " PRODUCTVERSION %lu, %lu, %lu, %lu\n", - (f->product_version_ms >> 16) & 0xffff, - f->product_version_ms & 0xffff, - (f->product_version_ls >> 16) & 0xffff, - f->product_version_ls & 0xffff); + fprintf (e, " PRODUCTVERSION %u, %u, %u, %u\n", + (unsigned int) ((f->product_version_ms >> 16) & 0xffff), + (unsigned int) (f->product_version_ms & 0xffff), + (unsigned int) ((f->product_version_ls >> 16) & 0xffff), + (unsigned int) (f->product_version_ls & 0xffff)); if (f->file_flags_mask != 0) - fprintf (e, " FILEFLAGSMASK 0x%lx\n", f->file_flags_mask); + fprintf (e, " FILEFLAGSMASK 0x%x\n", (unsigned int) f->file_flags_mask); if (f->file_flags != 0) - fprintf (e, " FILEFLAGS 0x%lx\n", f->file_flags); + fprintf (e, " FILEFLAGS 0x%x\n", (unsigned int) f->file_flags); if (f->file_os != 0) - fprintf (e, " FILEOS 0x%lx\n", f->file_os); + fprintf (e, " FILEOS 0x%x\n", (unsigned int) f->file_os); if (f->file_type != 0) - fprintf (e, " FILETYPE 0x%lx\n", f->file_type); + fprintf (e, " FILETYPE 0x%x\n", (unsigned int) f->file_type); if (f->file_subtype != 0) - fprintf (e, " FILESUBTYPE 0x%lx\n", f->file_subtype); + fprintf (e, " FILESUBTYPE 0x%x\n", (unsigned int) f->file_subtype); if (f->file_date_ms != 0 || f->file_date_ls != 0) - fprintf (e, "// Date: %lu, %lu\n", f->file_date_ms, f->file_date_ls); + fprintf (e, "/* Date: %u, %u. */\n", + (unsigned int) f->file_date_ms, (unsigned int) f->file_date_ls); fprintf (e, "BEGIN\n"); @@ -2518,22 +3215,22 @@ write_rc_versioninfo (FILE *e, const struct versioninfo *versioninfo) { case VERINFO_STRING: { - const struct ver_stringinfo *vs; + const rc_ver_stringinfo *vs; fprintf (e, " BLOCK \"StringFileInfo\"\n"); fprintf (e, " BEGIN\n"); - fprintf (e, " BLOCK \""); - unicode_print (e, vi->u.string.language, -1); - fprintf (e, "\"\n"); + fprintf (e, " BLOCK "); + unicode_print_quoted (e, vi->u.string.language, -1); + fprintf (e, "\n"); fprintf (e, " BEGIN\n"); for (vs = vi->u.string.strings; vs != NULL; vs = vs->next) { - fprintf (e, " VALUE \""); - unicode_print (e, vs->key, -1); - fprintf (e, "\", \""); - unicode_print (e, vs->value, -1); - fprintf (e, "\"\n"); + fprintf (e, " VALUE "); + unicode_print_quoted (e, vs->key, -1); + fprintf (e, ", "); + unicode_print_quoted (e, vs->value, -1); + fprintf (e, "\n"); } fprintf (e, " END\n"); @@ -2543,17 +3240,16 @@ write_rc_versioninfo (FILE *e, const struct versioninfo *versioninfo) case VERINFO_VAR: { - const struct ver_varinfo *vv; + const rc_ver_varinfo *vv; fprintf (e, " BLOCK \"VarFileInfo\"\n"); fprintf (e, " BEGIN\n"); - fprintf (e, " VALUE \""); - unicode_print (e, vi->u.var.key, -1); - fprintf (e, "\""); + fprintf (e, " VALUE "); + unicode_print_quoted (e, vi->u.var.key, -1); for (vv = vi->u.var.var; vv != NULL; vv = vv->next) fprintf (e, ", 0x%x, %d", (unsigned int) vv->language, - vv->charset); + (int) vv->charset); fprintf (e, "\n END\n"); @@ -2565,32 +3261,36 @@ write_rc_versioninfo (FILE *e, const struct versioninfo *versioninfo) fprintf (e, "END\n"); } -/* Write out data which would normally be read from a file. */ - -static void -write_rc_filedata (FILE *e, unsigned long length, const unsigned char *data) +static rc_uint_type +rcdata_copy (const rc_rcdata_item *src, bfd_byte *dst) { - unsigned long i; - - for (i = 0; i + 15 < length; i += 16) - { - fprintf (e, "// %4lx: ", i); - fprintf (e, "%02x %02x %02x %02x %02x %02x %02x %02x ", - data[i + 0], data[i + 1], data[i + 2], data[i + 3], - data[i + 4], data[i + 5], data[i + 6], data[i + 7]); - fprintf (e, "%02x %02x %02x %02x %02x %02x %02x %02x\n", - data[i + 8], data[i + 9], data[i + 10], data[i + 11], - data[i + 12], data[i + 13], data[i + 14], data[i + 15]); - } - - if (i < length) - { - fprintf (e, "// %4lx:", i); - while (i < length) + if (! src) + return 0; + switch (src->type) { - fprintf (e, " %02x", data[i]); - ++i; - } - fprintf (e, "\n"); + case RCDATA_WORD: + if (dst) + windres_put_16 (&wrtarget, dst, (rc_uint_type) src->u.word); + return 2; + case RCDATA_DWORD: + if (dst) + windres_put_32 (&wrtarget, dst, (rc_uint_type) src->u.dword); + return 4; + case RCDATA_STRING: + if (dst && src->u.string.length) + memcpy (dst, src->u.string.s, src->u.string.length); + return (rc_uint_type) src->u.string.length; + case RCDATA_WSTRING: + if (dst && src->u.wstring.length) + memcpy (dst, src->u.wstring.w, src->u.wstring.length * sizeof (unichar)); + return (rc_uint_type) (src->u.wstring.length * sizeof (unichar)); + case RCDATA_BUFFER: + if (dst && src->u.buffer.length) + memcpy (dst, src->u.buffer.data, src->u.buffer.length); + return (rc_uint_type) src->u.buffer.length; + default: + abort (); } + /* Never reached. */ + return 0; } diff --git a/binutils/resres.c b/binutils/resres.c index 1489d5eeda4..f345da3e5de 100644 --- a/binutils/resres.c +++ b/binutils/resres.c @@ -1,6 +1,8 @@ /* resres.c: read_res_file and write_res_file implementation for windres. - Copyright 1998, 1999, 2001, 2002 Free Software Foundation, Inc. + Copyright 1998, 1999, 2001, 2002, 2007 + Free Software Foundation, Inc. Written by Anders Norlander . + Rewritten by Kai Tietz, Onevision. This file is part of GNU Binutils. @@ -23,6 +25,7 @@ It assumes that it can use fread and fwrite to read and write integers. It does no swapping. */ +#include "sysdep.h" #include "bfd.h" #include "bucomm.h" #include "libiberty.h" @@ -31,154 +34,179 @@ #include #include -struct res_hdr - { - unsigned long data_size; - unsigned long header_size; - }; +static rc_uint_type write_res_directory (windres_bfd *, rc_uint_type, + const rc_res_directory *, const rc_res_id *, + const rc_res_id *, rc_uint_type *, int); +static rc_uint_type write_res_resource (windres_bfd *, rc_uint_type,const rc_res_id *, + const rc_res_id *, const rc_res_resource *, + rc_uint_type *); +static rc_uint_type write_res_bin (windres_bfd *, rc_uint_type, const rc_res_resource *, + const rc_res_id *, const rc_res_id *, + const rc_res_res_info *); -static void write_res_directory - PARAMS ((const struct res_directory *, - const struct res_id *, const struct res_id *, - int *, int)); -static void write_res_resource - PARAMS ((const struct res_id *, const struct res_id *, - const struct res_resource *, int *)); -static void write_res_bin - PARAMS ((const struct res_resource *, const struct res_id *, - const struct res_id *, const struct res_res_info *)); +static rc_uint_type write_res_id (windres_bfd *, rc_uint_type, const rc_res_id *); +static rc_uint_type write_res_info (windres_bfd *, rc_uint_type, const rc_res_res_info *); +static rc_uint_type write_res_data_hdr (windres_bfd *, rc_uint_type, res_hdr *); -static void write_res_id PARAMS ((const struct res_id *)); -static void write_res_info PARAMS ((const struct res_res_info *)); -static void write_res_data PARAMS ((const void *, size_t, int)); -static void write_res_header - PARAMS ((unsigned long, const struct res_id *, const struct res_id *, - const struct res_res_info *)); +static rc_uint_type write_res_header (windres_bfd *, rc_uint_type, rc_uint_type, + const rc_res_id *, const rc_res_id *, + const rc_res_res_info *); -static int read_resource_entry PARAMS ((void)); -static void read_res_data PARAMS ((void *, size_t, int)); -static void read_res_id PARAMS ((struct res_id *)); -static unichar *read_unistring PARAMS ((int *)); -static void skip_null_resource PARAMS ((void)); +static int read_resource_entry (windres_bfd *, rc_uint_type *, rc_uint_type); +static void read_res_data (windres_bfd *, rc_uint_type *, rc_uint_type, void *, + rc_uint_type); +static void read_res_data_hdr (windres_bfd *, rc_uint_type *, rc_uint_type, res_hdr *); +static void read_res_id (windres_bfd *, rc_uint_type *, rc_uint_type, rc_res_id *); +static unichar *read_unistring (windres_bfd *, rc_uint_type *, rc_uint_type, rc_uint_type *); +static void skip_null_resource (windres_bfd *, rc_uint_type *, rc_uint_type); +static int probe_binary (windres_bfd *wrbfd, rc_uint_type); -static unsigned long get_id_size PARAMS ((const struct res_id *)); -static void res_align_file PARAMS ((void)); +static unsigned long get_id_size (const rc_res_id *); -static void - res_add_resource - PARAMS ((struct res_resource *, const struct res_id *, - const struct res_id *, int, int)); +static void res_add_resource (rc_res_resource *, const rc_res_id *, + const rc_res_id *, rc_uint_type, int); -void - res_append_resource - PARAMS ((struct res_directory **, struct res_resource *, - int, const struct res_id *, int)); +static void res_append_resource (rc_res_directory **, rc_res_resource *, + int, const rc_res_id *, int); -static struct res_directory *resources = NULL; +static rc_res_directory *resources = NULL; -static FILE *fres; static const char *filename; extern char *program_name; /* Read resource file */ -struct res_directory * -read_res_file (fn) - const char *fn; +rc_res_directory * +read_res_file (const char *fn) { + rc_uint_type off, flen; + windres_bfd wrbfd; + bfd *abfd; + asection *sec; filename = fn; - fres = fopen (filename, "rb"); - if (fres == NULL) - fatal ("can't open `%s' for output: %s", filename, strerror (errno)); - skip_null_resource (); + flen = (rc_uint_type) get_file_size (filename); + if (! flen) + fatal ("can't open '%s' for input.", filename); + abfd = windres_open_as_binary (filename, 1); + sec = bfd_get_section_by_name (abfd, ".data"); + if (sec == NULL) + bfd_fatal ("bfd_get_section_by_name"); + set_windres_bfd (&wrbfd, abfd, sec, + (target_is_bigendian ? WR_KIND_BFD_BIN_B + : WR_KIND_BFD_BIN_L)); + off = 0; - while (read_resource_entry ()) + if (! probe_binary (&wrbfd, flen)) + set_windres_bfd_endianess (&wrbfd, ! target_is_bigendian); + + skip_null_resource (&wrbfd, &off, flen); + + while (read_resource_entry (&wrbfd, &off, flen)) ; - fclose (fres); + bfd_close (abfd); return resources; } /* Write resource file */ void -write_res_file (fn, resdir) - const char *fn; - const struct res_directory *resdir; +write_res_file (const char *fn,const rc_res_directory *resdir) { - int language; - static const unsigned char sign[] = + asection *sec; + rc_uint_type language; + bfd *abfd; + windres_bfd wrbfd; + unsigned long sec_length = 0,sec_length_wrote; + static const bfd_byte sign[] = {0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - long fpos; filename = fn; - fres = fopen (filename, "wb"); - if (fres == NULL) - fatal ("can't open `%s' for output: %s", filename, strerror (errno)); + abfd = windres_open_as_binary (filename, 0); + sec = bfd_make_section (abfd, ".data"); + if (sec == NULL) + bfd_fatal ("bfd_make_section"); + if (! bfd_set_section_flags (abfd, sec, + (SEC_HAS_CONTENTS | SEC_ALLOC + | SEC_LOAD | SEC_DATA))) + bfd_fatal ("bfd_set_section_flags"); + /* Requiring this is probably a bug in BFD. */ + sec->output_section = sec; - /* Write 32 bit resource signature */ - write_res_data (sign, sizeof (sign), 1); - - /* write resources */ + set_windres_bfd (&wrbfd, abfd, sec, + (target_is_bigendian ? WR_KIND_BFD_BIN_B + : WR_KIND_BFD_BIN_L)); language = -1; - write_res_directory (resdir, (const struct res_id *) NULL, - (const struct res_id *) NULL, &language, 1); + sec_length = write_res_directory ((windres_bfd *) NULL, 0x20UL, resdir, + (const rc_res_id *) NULL, + (const rc_res_id *) NULL, &language, 1); + if (! bfd_set_section_size (abfd, sec, (sec_length + 3) & ~3)) + bfd_fatal ("bfd_set_section_size"); + if ((sec_length & 3) != 0) + set_windres_bfd_content (&wrbfd, sign, sec_length, 4-(sec_length & 3)); + set_windres_bfd_content (&wrbfd, sign, 0, sizeof (sign)); + language = -1; + sec_length_wrote = write_res_directory (&wrbfd, 0x20UL, resdir, + (const rc_res_id *) NULL, + (const rc_res_id *) NULL, + &language, 1); + if (sec_length != sec_length_wrote) + fatal ("res write failed with different sizes (%lu/%lu).", (long) sec_length, + (long) sec_length_wrote); - /* end file on DWORD boundary */ - fpos = ftell (fres); - if (fpos % 4) - write_res_data (sign, fpos % 4, 1); - - fclose (fres); + bfd_close (abfd); + return; } /* Read a resource entry, returns 0 when all resources are read */ static int -read_resource_entry (void) +read_resource_entry (windres_bfd *wrbfd, rc_uint_type *off, rc_uint_type omax) { - struct res_id type; - struct res_id name; - struct res_res_info resinfo; - struct res_hdr reshdr; - long version; + rc_res_id type; + rc_res_id name; + rc_res_res_info resinfo; + res_hdr reshdr; void *buff; - struct res_resource *r; + rc_res_resource *r; + struct bin_res_info l; - res_align_file (); + off[0] = (off[0] + 3) & ~3; /* Read header */ - if (fread (&reshdr, sizeof (reshdr), 1, fres) != 1) + if ((off[0] + 8) > omax) return 0; + read_res_data_hdr (wrbfd, off, omax, &reshdr); /* read resource type */ - read_res_id (&type); + read_res_id (wrbfd, off, omax, &type); /* read resource id */ - read_res_id (&name); + read_res_id (wrbfd, off, omax, &name); - res_align_file (); + off[0] = (off[0] + 3) & ~3; /* Read additional resource header */ - read_res_data (&resinfo.version, sizeof (resinfo.version), 1); - read_res_data (&resinfo.memflags, sizeof (resinfo.memflags), 1); - read_res_data (&resinfo.language, sizeof (resinfo.language), 1); - read_res_data (&version, sizeof (version), 1); - read_res_data (&resinfo.characteristics, sizeof (resinfo.characteristics), 1); + read_res_data (wrbfd, off, omax, &l, BIN_RES_INFO_SIZE); + resinfo.version = windres_get_32 (wrbfd, l.version, 4); + resinfo.memflags = windres_get_16 (wrbfd, l.memflags, 2); + resinfo.language = windres_get_16 (wrbfd, l.language, 2); + /* resinfo.version2 = windres_get_32 (wrbfd, l.version2, 4); */ + resinfo.characteristics = windres_get_32 (wrbfd, l.characteristics, 4); - res_align_file (); + off[0] = (off[0] + 3) & ~3; /* Allocate buffer for data */ buff = res_alloc (reshdr.data_size); /* Read data */ - read_res_data (buff, reshdr.data_size, 1); + read_res_data (wrbfd, off, omax, buff, reshdr.data_size); /* Convert binary data to resource */ - r = bin_to_res (type, buff, reshdr.data_size, 0); + r = bin_to_res (wrbfd, type, buff, reshdr.data_size); r->res_info = resinfo; /* Add resource to resource directory */ res_add_resource (r, &type, &name, resinfo.language, 0); @@ -187,15 +215,12 @@ read_resource_entry (void) } /* write resource directory to binary resource file */ -static void -write_res_directory (rd, type, name, language, level) - const struct res_directory *rd; - const struct res_id *type; - const struct res_id *name; - int *language; - int level; +static rc_uint_type +write_res_directory (windres_bfd *wrbfd, rc_uint_type off, const rc_res_directory *rd, + const rc_res_id *type, const rc_res_id *name, rc_uint_type *language, + int level) { - const struct res_entry *re; + const rc_res_entry *re; for (re = rd->entries; re != NULL; re = re->next) { @@ -218,7 +243,7 @@ write_res_directory (rd, type, name, language, level) case 3: /* If we're at level 3, then this key represents a language. Use it to update the current language. */ - if (!re->id.named + if (! re->id.named && re->id.u.id != (unsigned long) *language && (re->id.u.id & 0xffff) == re->id.u.id) { @@ -231,7 +256,8 @@ write_res_directory (rd, type, name, language, level) } if (re->subdir) - write_res_directory (re->u.dir, type, name, language, level + 1); + off = write_res_directory (wrbfd, off, re->u.dir, type, name, language, + level + 1); else { if (level == 3) @@ -241,25 +267,25 @@ write_res_directory (rd, type, name, language, level) 2, and represents the name to use. We probably just set LANGUAGE, and it will probably match what the resource itself records if anything. */ - write_res_resource (type, name, re->u.res, language); + off = write_res_resource (wrbfd, off, type, name, re->u.res, + language); } else { fprintf (stderr, "// Resource at unexpected level %d\n", level); - write_res_resource (type, (struct res_id *) NULL, re->u.res, - language); + off = write_res_resource (wrbfd, off, type, (rc_res_id *) NULL, + re->u.res, language); } } } + return off; } -static void -write_res_resource (type, name, res, language) - const struct res_id *type; - const struct res_id *name; - const struct res_resource *res; - int *language ATTRIBUTE_UNUSED; +static rc_uint_type +write_res_resource (windres_bfd *wrbfd, rc_uint_type off, const rc_res_id *type, + const rc_res_id *name, const rc_res_resource *res, + rc_uint_type *language ATTRIBUTE_UNUSED) { int rt; @@ -327,6 +353,10 @@ write_res_resource (type, name, res, language) case RES_TYPE_VERSIONINFO: rt = RT_VERSION; break; + + case RES_TYPE_TOOLBAR: + rt = RT_TOOLBAR; + break; } if (rt != 0 @@ -339,35 +369,29 @@ write_res_resource (type, name, res, language) abort (); } - write_res_bin (res, type, name, &res->res_info); - return; + return write_res_bin (wrbfd, off, res, type, name, &res->res_info); } /* Write a resource in binary resource format */ -static void -write_res_bin (res, type, name, resinfo) - const struct res_resource *res; - const struct res_id *type; - const struct res_id *name; - const struct res_res_info *resinfo; +static rc_uint_type +write_res_bin (windres_bfd *wrbfd, rc_uint_type off, const rc_res_resource *res, + const rc_res_id *type, const rc_res_id *name, + const rc_res_res_info *resinfo) { - unsigned long datasize = 0; - const struct bindata *bin_rep, *data; + rc_uint_type noff; + rc_uint_type datasize = 0; - bin_rep = res_to_bin (res, 0); - for (data = bin_rep; data != NULL; data = data->next) - datasize += data->length; + noff = res_to_bin ((windres_bfd *) NULL, off, res); + datasize = noff - off; - write_res_header (datasize, type, name, resinfo); - - for (data = bin_rep; data != NULL; data = data->next) - write_res_data (data->data, data->length, 1); + off = write_res_header (wrbfd, off, datasize, type, name, resinfo); + return res_to_bin (wrbfd, off, res); } /* Get number of bytes needed to store an id in binary format */ static unsigned long get_id_size (id) - const struct res_id *id; + const rc_res_id *id; { if (id->named) return sizeof (unichar) * (id->u.n.length + 1); @@ -376,108 +400,142 @@ get_id_size (id) } /* Write a resource header */ -static void -write_res_header (datasize, type, name, resinfo) - unsigned long datasize; - const struct res_id *type; - const struct res_id *name; - const struct res_res_info *resinfo; +static rc_uint_type +write_res_header (windres_bfd *wrbfd, rc_uint_type off, rc_uint_type datasize, + const rc_res_id *type, const rc_res_id *name, + const rc_res_res_info *resinfo) { - struct res_hdr reshdr; + res_hdr reshdr; reshdr.data_size = datasize; reshdr.header_size = 24 + get_id_size (type) + get_id_size (name); reshdr.header_size = (reshdr.header_size + 3) & ~3; - res_align_file (); - write_res_data (&reshdr, sizeof (reshdr), 1); - write_res_id (type); - write_res_id (name); + off = (off + 3) & ~3; - res_align_file (); + off = write_res_data_hdr (wrbfd, off, &reshdr); + off = write_res_id (wrbfd, off, type); + off = write_res_id (wrbfd, off, name); - write_res_info (resinfo); - res_align_file (); + off = (off + 3) & ~3; + + off = write_res_info (wrbfd, off, resinfo); + off = (off + 3) & ~3; + return off; } - -/* Write data to file, abort on failure */ -static void -write_res_data (data, size, count) - const void *data; - size_t size; - int count; +static rc_uint_type +write_res_data_hdr (windres_bfd *wrbfd, rc_uint_type off, res_hdr *hdr) { - if ((size_t) fwrite (data, size, count, fres) != (size_t) count) - fatal ("%s: could not write to file", filename); + if (wrbfd) + { + struct bin_res_hdr brh; + windres_put_32 (wrbfd, brh.data_size, hdr->data_size); + windres_put_32 (wrbfd, brh.header_size, hdr->header_size); + set_windres_bfd_content (wrbfd, &brh, off, BIN_RES_HDR_SIZE); + } + return off + BIN_RES_HDR_SIZE; +} + +static void +read_res_data_hdr (windres_bfd *wrbfd, rc_uint_type *off, rc_uint_type omax, + res_hdr *reshdr) +{ + struct bin_res_hdr brh; + + if ((off[0] + BIN_RES_HDR_SIZE) > omax) + fatal ("%s: unexpected end of file %ld/%ld", filename,(long) off[0], (long) omax); + + get_windres_bfd_content (wrbfd, &brh, off[0], BIN_RES_HDR_SIZE); + reshdr->data_size = windres_get_32 (wrbfd, brh.data_size, 4); + reshdr->header_size = windres_get_32 (wrbfd, brh.header_size, 4); + off[0] += BIN_RES_HDR_SIZE; } /* Read data from file, abort on failure */ static void -read_res_data (data, size, count) - void *data; - size_t size; - int count; +read_res_data (windres_bfd *wrbfd, rc_uint_type *off, rc_uint_type omax, void *data, + rc_uint_type size) { - if (fread (data, size, count, fres) != (size_t) count) - fatal ("%s: unexpected end of file", filename); + if ((off[0] + size) > omax) + fatal ("%s: unexpected end of file %ld/%ld %ld", filename,(long) off[0], + (long) omax, (long) size); + get_windres_bfd_content (wrbfd, data, off[0], size); + off[0] += size; } /* Write a resource id */ -static void -write_res_id (id) - const struct res_id *id; +static rc_uint_type +write_res_id (windres_bfd *wrbfd, rc_uint_type off, const rc_res_id *id) { if (id->named) { - unsigned long len = id->u.n.length; - unichar null_term = 0; - write_res_data (id->u.n.name, len * sizeof (unichar), 1); - write_res_data (&null_term, sizeof (null_term), 1); + rc_uint_type len = (((bfd_signed_vma) id->u.n.length < 0 ? 0 : id->u.n.length) + 1); + if (wrbfd) + { + rc_uint_type i; + bfd_byte *d = (bfd_byte *) xmalloc (len * sizeof (unichar)); + for (i = 0; i < (len - 1); i++) + windres_put_16 (wrbfd, d + (i * sizeof (unichar)), id->u.n.name[i]); + windres_put_16 (wrbfd, d + (i * sizeof (unichar)), 0); + set_windres_bfd_content (wrbfd, d, off, (len * sizeof (unichar))); + } + off += (len * sizeof (unichar)); } else { - unsigned short i = 0xFFFF; - write_res_data (&i, sizeof (i), 1); - i = id->u.id; - write_res_data (&i, sizeof (i), 1); + if (wrbfd) + { + struct bin_res_id bid; + windres_put_16 (wrbfd, bid.sig, 0xffff); + windres_put_16 (wrbfd, bid.id, id->u.id); + set_windres_bfd_content (wrbfd, &bid, off, BIN_RES_ID); + } + off += BIN_RES_ID; } + return off; } /* Write resource info */ -static void -write_res_info (info) - const struct res_res_info *info; +static rc_uint_type +write_res_info (windres_bfd *wrbfd, rc_uint_type off, const rc_res_res_info *info) { - write_res_data (&info->version, sizeof (info->version), 1); - write_res_data (&info->memflags, sizeof (info->memflags), 1); - write_res_data (&info->language, sizeof (info->language), 1); - write_res_data (&info->version, sizeof (info->version), 1); - write_res_data (&info->characteristics, sizeof (info->characteristics), 1); + if (wrbfd) + { + struct bin_res_info l; + + windres_put_32 (wrbfd, l.version, info->version); + windres_put_16 (wrbfd, l.memflags, info->memflags); + windres_put_16 (wrbfd, l.language, info->language); + windres_put_32 (wrbfd, l.version2, info->version); + windres_put_32 (wrbfd, l.characteristics, info->characteristics); + set_windres_bfd_content (wrbfd, &l, off, BIN_RES_INFO_SIZE); + } + return off + BIN_RES_INFO_SIZE; } /* read a resource identifier */ -void -read_res_id (id) - struct res_id *id; +static void +read_res_id (windres_bfd *wrbfd, rc_uint_type *off, rc_uint_type omax, rc_res_id *id) { + struct bin_res_id bid; unsigned short ord; unichar *id_s = NULL; - int len; + rc_uint_type len; - read_res_data (&ord, sizeof (ord), 1); + read_res_data (wrbfd, off, omax, &bid, BIN_RES_ID - 2); + ord = (unsigned short) windres_get_16 (wrbfd, bid.sig, 2); if (ord == 0xFFFF) /* an ordinal id */ { - read_res_data (&ord, sizeof (ord), 1); + read_res_data (wrbfd, off, omax, bid.id, BIN_RES_ID - 2); id->named = 0; - id->u.id = ord; + id->u.id = windres_get_16 (wrbfd, bid.id, 2); } else /* named id */ { - if (fseek (fres, -sizeof (ord), SEEK_CUR) != 0) - fatal ("%s: %s: could not seek in file", program_name, filename); - id_s = read_unistring (&len); + off[0] -= 2; + id_s = read_unistring (wrbfd, off, omax, &len); id->named = 1; id->u.n.length = len; id->u.n.name = id_s; @@ -486,39 +544,62 @@ read_res_id (id) /* Read a null terminated UNICODE string */ static unichar * -read_unistring (len) - int *len; +read_unistring (windres_bfd *wrbfd, rc_uint_type *off, rc_uint_type omax, + rc_uint_type *len) { unichar *s; + bfd_byte d[2]; unichar c; unichar *p; - int l; + rc_uint_type l; + rc_uint_type soff = off[0]; - *len = 0; - l = 0; - - /* there are hardly any names longer than 256 characters */ - p = s = (unichar *) xmalloc (sizeof (unichar) * 256); do { - read_res_data (&c, sizeof (c), 1); - *p++ = c; - if (c != 0) - l++; + read_res_data (wrbfd, &soff, omax, d, sizeof (unichar)); + c = windres_get_16 (wrbfd, d, 2); } while (c != 0); - *len = l; + l = ((soff - off[0]) / sizeof (unichar)); + + /* there are hardly any names longer than 256 characters, but anyway. */ + p = s = (unichar *) xmalloc (sizeof (unichar) * l); + do + { + read_res_data (wrbfd, off, omax, d, sizeof (unichar)); + c = windres_get_16 (wrbfd, d, 2); + *p++ = c; + } + while (c != 0); + *len = l - 1; return s; } -/* align file on DWORD boundary */ -static void -res_align_file (void) +static int +probe_binary (windres_bfd *wrbfd, rc_uint_type omax) { - int pos = ftell (fres); - int skip = ((pos + 3) & ~3) - pos; - if (fseek (fres, skip, SEEK_CUR) != 0) - fatal ("%s: %s: unable to align file", program_name, filename); + rc_uint_type off; + res_hdr reshdr; + + off = 0; + read_res_data_hdr (wrbfd, &off, omax, &reshdr); + if (reshdr.data_size != 0) + return 1; + if ((reshdr.header_size != 0x20 && ! target_is_bigendian) + || (reshdr.header_size != 0x20000000 && target_is_bigendian)) + return 1; + + /* Subtract size of HeaderSize. DataSize has to be zero. */ + off += 0x20 - BIN_RES_HDR_SIZE; + if ((off + BIN_RES_HDR_SIZE) >= omax) + return 1; + read_res_data_hdr (wrbfd, &off, omax, &reshdr); + /* off is advanced by BIN_RES_HDR_SIZE in read_res_data_hdr() + which is part of reshdr.header_size. We shouldn't take it + into account twice. */ + if ((off - BIN_RES_HDR_SIZE + reshdr.data_size + reshdr.header_size) > omax) + return 0; + return 1; } /* Check if file is a win32 binary resource file, if so @@ -526,16 +607,19 @@ res_align_file (void) error. */ static void -skip_null_resource (void) +skip_null_resource (windres_bfd *wrbfd, rc_uint_type *off, rc_uint_type omax) { - struct res_hdr reshdr = - {0, 0}; - read_res_data (&reshdr, sizeof (reshdr), 1); - if ((reshdr.data_size != 0) || (reshdr.header_size != 0x20)) + res_hdr reshdr; + read_res_data_hdr (wrbfd, off, omax, &reshdr); + if (reshdr.data_size != 0) + goto skip_err; + if ((reshdr.header_size != 0x20 && ! target_is_bigendian) + || (reshdr.header_size != 0x20000000 && target_is_bigendian)) goto skip_err; - /* Subtract size of HeaderSize and DataSize */ - if (fseek (fres, reshdr.header_size - 8, SEEK_CUR) != 0) + /* Subtract size of HeaderSize. DataSize has to be zero. */ + off[0] += 0x20 - BIN_RES_HDR_SIZE; + if (off[0] >= omax) goto skip_err; return; @@ -547,15 +631,11 @@ skip_err: } /* Add a resource to resource directory */ -void -res_add_resource (r, type, id, language, dupok) - struct res_resource *r; - const struct res_id *type; - const struct res_id *id; - int language; - int dupok; +static void +res_add_resource (rc_res_resource *r, const rc_res_id *type, const rc_res_id *id, + rc_uint_type language, int dupok) { - struct res_id a[3]; + rc_res_id a[3]; a[0] = *type; a[1] = *id; @@ -568,21 +648,17 @@ res_add_resource (r, type, id, language, dupok) This is just copied from define_resource and modified to add an existing resource. */ -void -res_append_resource (resources, resource, cids, ids, dupok) - struct res_directory **resources; - struct res_resource *resource; - int cids; - const struct res_id *ids; - int dupok; +static void +res_append_resource (rc_res_directory **resources, rc_res_resource *resource, + int cids, const rc_res_id *ids, int dupok) { - struct res_entry *re = NULL; + rc_res_entry *re = NULL; int i; assert (cids > 0); for (i = 0; i < cids; i++) { - struct res_entry **pp; + rc_res_entry **pp; if (*resources == NULL) { @@ -593,8 +669,8 @@ res_append_resource (resources, resource, cids, ids, dupok) if (timeval == 0) timeval = time (NULL); - *resources = ((struct res_directory *) - res_alloc (sizeof **resources)); + *resources = ((rc_res_directory *) + res_alloc (sizeof (rc_res_directory))); (*resources)->characteristics = 0; (*resources)->time = timeval; (*resources)->major = 0; @@ -610,7 +686,7 @@ res_append_resource (resources, resource, cids, ids, dupok) re = *pp; else { - re = (struct res_entry *) res_alloc (sizeof *re); + re = (rc_res_entry *) res_alloc (sizeof (rc_res_entry)); re->next = NULL; re->id = ids[i]; if ((i + 1) < cids) @@ -629,7 +705,7 @@ res_append_resource (resources, resource, cids, ids, dupok) if ((i + 1) < cids) { - if (!re->subdir) + if (! re->subdir) { fprintf (stderr, "%s: ", program_name); res_ids_print (stderr, i, ids); diff --git a/binutils/size.c b/binutils/size.c index b78cba02ba0..f83b050506b 100644 --- a/binutils/size.c +++ b/binutils/size.c @@ -1,6 +1,6 @@ /* size.c -- report size of various sections of an executable file. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -28,10 +28,11 @@ If you write shell scripts which manipulate this info then you may be out of luck; there's no --compatibility or --pedantic option. */ +#include "sysdep.h" #include "bfd.h" -#include "bucomm.h" #include "libiberty.h" #include "getopt.h" +#include "bucomm.h" #ifndef BSD_DEFAULT #define BSD_DEFAULT 1 @@ -98,7 +99,7 @@ usage (FILE *stream, int status) #endif ); list_supported_targets (program_name, stream); - if (status == 0) + if (REPORT_BUGS_TO[0] && status == 0) fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); } @@ -346,7 +347,10 @@ display_file (char *filename) bfd *file; if (get_file_size (filename) < 1) - return; + { + return_code = 1; + return; + } file = bfd_openr (filename, target); if (file == NULL) diff --git a/binutils/srconv.c b/binutils/srconv.c index d1f3efdb9e0..906432f6dba 100644 --- a/binutils/srconv.c +++ b/binutils/srconv.c @@ -1,6 +1,6 @@ /* srconv.c -- Sysroff conversion program Copyright 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005 Free Software Foundation, Inc. + 2005, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -26,6 +26,7 @@ All debugging information is preserved */ +#include "sysdep.h" #include "bfd.h" #include "bucomm.h" #include "sysroff.h" @@ -704,6 +705,7 @@ walk_tree_type_1 (struct coff_sfile *sfile, struct coff_symbol *symbol, { struct IT_dpt dpt; + dpt.dunno = 0; walk_tree_type_1 (sfile, symbol, type->u.pointer.points_to, nest + 1); dpt.neg = 0x1001; sysroff_swap_dpt_out (file, &dpt); @@ -1728,7 +1730,7 @@ show_usage (FILE *file, int status) -h --help Display this information\n\ -v --version Print the program's version number\n")); - if (status == 0) + if (REPORT_BUGS_TO[0] && status == 0) fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); } diff --git a/binutils/stabs.c b/binutils/stabs.c index 879a3e2c7a7..c8fc77dab2f 100644 --- a/binutils/stabs.c +++ b/binutils/stabs.c @@ -1,6 +1,6 @@ /* stabs.c -- Parse stabs debugging information - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of GNU Binutils. @@ -25,10 +25,8 @@ code. The job it does is somewhat different, because it is not trying to identify the correct address for anything. */ -#include - +#include "sysdep.h" #include "bfd.h" -#include "bucomm.h" #include "libiberty.h" #include "safe-ctype.h" #include "demangle.h" @@ -1696,12 +1694,12 @@ parse_stab_range_type (void *dhandle, struct stab_handle *info, const char *type #define ULLHIGH "01777777777777777777777;" if (index_type == DEBUG_TYPE_NULL) { - if (strncmp (s2, LLLOW, sizeof LLLOW - 1) == 0 - && strncmp (s3, LLHIGH, sizeof LLHIGH - 1) == 0) + if (CONST_STRNEQ (s2, LLLOW) + && CONST_STRNEQ (s3, LLHIGH)) return debug_make_int_type (dhandle, 8, FALSE); if (! ov2 && n2 == 0 - && strncmp (s3, ULLHIGH, sizeof ULLHIGH - 1) == 0) + && CONST_STRNEQ (s3, ULLHIGH)) return debug_make_int_type (dhandle, 8, TRUE); } @@ -2832,7 +2830,7 @@ parse_stab_argtypes (void *dhandle, struct stab_handle *info, && (ISDIGIT (argtypes[2]) || argtypes[2] == 'Q' || argtypes[2] == 't')) - || strncmp (argtypes, "__ct", 4) == 0); + || CONST_STRNEQ (argtypes, "__ct")); is_constructor = (is_full_physname_constructor || (tagname != NULL @@ -2840,7 +2838,7 @@ parse_stab_argtypes (void *dhandle, struct stab_handle *info, is_destructor = ((argtypes[0] == '_' && (argtypes[1] == '$' || argtypes[1] == '.') && argtypes[2] == '_') - || strncmp (argtypes, "__dt", 4) == 0); + || CONST_STRNEQ (argtypes, "__dt")); is_v3 = argtypes[0] == '_' && argtypes[1] == 'Z'; if (is_destructor || is_full_physname_constructor || is_v3) @@ -3841,7 +3839,7 @@ stab_demangle_function_name (struct stab_demangle_info *minfo, *pp = scan + 2; if (*pp - name >= 5 - && strncmp (name, "type", 4) == 0 + && CONST_STRNEQ (name, "type") && (name[4] == '$' || name[4] == '.')) { const char *tem; diff --git a/binutils/strings.c b/binutils/strings.c index a04cb581eae..2238574bac0 100644 --- a/binutils/strings.c +++ b/binutils/strings.c @@ -1,6 +1,6 @@ /* strings -- print the strings of printable characters in files Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. 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 @@ -46,6 +46,7 @@ littleendian 32-bit. --target=BFDNAME + -T {bfdname} Specify a non-default object file format. --help @@ -57,17 +58,13 @@ Written by Richard Stallman and David MacKenzie . */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include "sysdep.h" #include "bfd.h" -#include #include "getopt.h" -#include -#include "bucomm.h" #include "libiberty.h" #include "safe-ctype.h" #include +#include "bucomm.h" /* Some platforms need to put stdin into binary mode, to read binary files. */ @@ -195,7 +192,7 @@ main (int argc, char **argv) target = NULL; encoding = 's'; - while ((optc = getopt_long (argc, argv, "afhHn:ot:e:Vv0123456789", + while ((optc = getopt_long (argc, argv, "afhHn:ot:e:T:Vv0123456789", long_options, (int *) 0)) != EOF) { switch (optc) @@ -721,7 +718,7 @@ usage (FILE *stream, int status) -h --help Display this information\n\ -v --version Print the program's version number\n")); list_supported_targets (program_name, stream); - if (status == 0) + if (REPORT_BUGS_TO[0] && status == 0) fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); } diff --git a/binutils/sysdep.h b/binutils/sysdep.h new file mode 100644 index 00000000000..9627b46d459 --- /dev/null +++ b/binutils/sysdep.h @@ -0,0 +1,174 @@ +/* sysdep.h -- handle host dependencies for binutils + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, + 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. + + This file is part of 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 2 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. */ + +#ifndef _BIN_SYSDEP_H +#define _BIN_SYSDEP_H + +#include "ansidecl.h" +#include +#include + +#include "bfdver.h" +#include "config.h" + +#include + +#ifdef USE_BINARY_FOPEN +#include "fopen-bin.h" +#else +#include "fopen-same.h" +#endif + +#include +#ifndef errno +extern int errno; +#endif + +#ifdef HAVE_UNISTD_H +#include +#endif + +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#else +extern char *strchr (); +extern char *strrchr (); +#endif +#endif + +#ifdef HAVE_STDLIB_H +#include +#endif + +#ifdef HAVE_FCNTL_H +#include +#else +#ifdef HAVE_SYS_FILE_H +#include +#endif +#endif + +#if !HAVE_DECL_STPCPY +extern char *stpcpy (char *, const char *); +#endif + +#if !HAVE_DECL_STRSTR +extern char *strstr (); +#endif + +#ifdef HAVE_SBRK +#if !HAVE_DECL_SBRK +extern char *sbrk (); +#endif +#endif + +#if !HAVE_DECL_GETENV +extern char *getenv (); +#endif + +#if !HAVE_DECL_ENVIRON +extern char **environ; +#endif + +#if !HAVE_DECL_FPRINTF +extern int fprintf (FILE *, const char *, ...); +#endif + +#if !HAVE_DECL_SNPRINTF +extern int snprintf(char *, size_t, const char *, ...); +#endif + +#if !HAVE_DECL_VSNPRINTF +extern int vsnprintf(char *, size_t, const char *, va_list); +#endif + +#ifndef O_RDONLY +#define O_RDONLY 0 +#endif + +#ifndef O_RDWR +#define O_RDWR 2 +#endif + +#ifndef SEEK_SET +#define SEEK_SET 0 +#endif +#ifndef SEEK_CUR +#define SEEK_CUR 1 +#endif +#ifndef SEEK_END +#define SEEK_END 2 +#endif + +#if defined(__GNUC__) && !defined(C_ALLOCA) +# undef alloca +# define alloca __builtin_alloca +#else +# if defined(HAVE_ALLOCA_H) && !defined(C_ALLOCA) +# include +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +# if !defined (__STDC__) && !defined (__hpux) +char *alloca (); +# else +void *alloca (); +# endif /* __STDC__, __hpux */ +# endif /* alloca */ +# endif /* HAVE_ALLOCA_H */ +#endif + +#ifdef HAVE_LOCALE_H +# ifndef ENABLE_NLS + /* The Solaris version of locale.h always includes libintl.h. If we have + been configured with --disable-nls then ENABLE_NLS will not be defined + and the dummy definitions of bindtextdomain (et al) below will conflict + with the defintions in libintl.h. So we define these values to prevent + the bogus inclusion of libintl.h. */ +# define _LIBINTL_H +# define _LIBGETTEXT_H +# endif +# include +#endif + +#ifdef ENABLE_NLS +# include +# define _(String) gettext (String) +# ifdef gettext_noop +# define N_(String) gettext_noop (String) +# else +# define N_(String) (String) +# endif +#else +# define gettext(Msgid) (Msgid) +# define dgettext(Domainname, Msgid) (Msgid) +# define dcgettext(Domainname, Msgid, Category) (Msgid) +# define textdomain(Domainname) while (0) /* nothing */ +# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */ +# define _(String) (String) +# define N_(String) (String) +#endif + +/* Used by ar.c and objcopy.c. */ +#define BUFSIZE 8192 + +#endif /* _BIN_SYSDEP_H */ diff --git a/binutils/sysdump.c b/binutils/sysdump.c index ec19472558f..2f924692064 100644 --- a/binutils/sysdump.c +++ b/binutils/sysdump.c @@ -1,5 +1,5 @@ /* Sysroff object format dumper. - Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2005 + Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -25,13 +25,12 @@ This program reads a SYSROFF object file and prints it in an almost human readable form to stdout. */ +#include "sysdep.h" #include "bfd.h" -#include "bucomm.h" #include "safe-ctype.h" - -#include #include "libiberty.h" #include "getopt.h" +#include "bucomm.h" #include "sysroff.h" static int dump = 1; @@ -644,7 +643,7 @@ show_usage (FILE *file, int status) -h --help Display this information\n\ -v --version Print the program's version number\n")); - if (status == 0) + if (REPORT_BUGS_TO[0] && status == 0) fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); } diff --git a/binutils/sysinfo.c b/binutils/sysinfo.c deleted file mode 100644 index a8426ff71fe..00000000000 --- a/binutils/sysinfo.c +++ /dev/null @@ -1,1804 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - 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 2, 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. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - COND = 258, - REPEAT = 259, - TYPE = 260, - NAME = 261, - NUMBER = 262, - UNIT = 263 - }; -#endif -/* Tokens. */ -#define COND 258 -#define REPEAT 259 -#define TYPE 260 -#define NAME 261 -#define NUMBER 262 -#define UNIT 263 - - - - -/* Copy the first part of user declarations. */ -#line 20 "sysinfo.y" - -#include -#include - -static char writecode; -static char *it; -static int code; -static char * repeat; -static char *oldrepeat; -static char *name; -static int rdepth; -static char *names[] = {" ","[n]","[n][m]"}; -static char *pnames[]= {"","*","**"}; - -static int yyerror (char *s); -extern int yylex (void); - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 39 "sysinfo.y" -typedef union YYSTYPE { - int i; - char *s; -} YYSTYPE; -/* Line 196 of yacc.c. */ -#line 124 "sysinfo.c" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 219 of yacc.c. */ -#line 136 "sysinfo.c" - -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -#if ! defined (yyoverflow) || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# else -# define YYSTACK_ALLOC alloca -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYINCLUDED_STDLIB_H -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) -# endif -# ifdef __cplusplus -extern "C" { -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifdef __cplusplus -} -# endif -# endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ - - -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short int yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short int yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 3 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 38 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 11 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 19 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 27 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 55 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 263 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 5, 6, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 7, 8, 9, 10 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const unsigned char yyprhs[] = -{ - 0, 0, 3, 4, 7, 10, 11, 12, 19, 22, - 25, 28, 29, 30, 37, 38, 45, 46, 57, 59, - 60, 64, 67, 71, 72, 73, 77, 78 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yysigned_char yyrhs[] = -{ - 12, 0, -1, -1, 13, 14, -1, 15, 14, -1, - -1, -1, 5, 8, 9, 16, 17, 6, -1, 22, - 17, -1, 20, 17, -1, 18, 17, -1, -1, -1, - 5, 4, 8, 19, 17, 6, -1, -1, 5, 3, - 8, 21, 17, 6, -1, -1, 5, 25, 5, 24, - 26, 6, 27, 23, 28, 6, -1, 7, -1, -1, - 5, 8, 6, -1, 9, 10, -1, 5, 8, 6, - -1, -1, -1, 5, 29, 6, -1, -1, 29, 5, - 8, 8, 6, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short int yyrline[] = -{ - 0, 53, 53, 53, 91, 92, 97, 96, 174, 175, - 176, 177, 181, 180, 228, 227, 255, 254, 362, 363, - 367, 372, 378, 379, 382, 383, 385, 387 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "COND", "REPEAT", "'('", "')'", "TYPE", - "NAME", "NUMBER", "UNIT", "$accept", "top", "@1", "it_list", "it", "@2", - "it_field_list", "repeat_it_field", "@3", "cond_it_field", "@4", - "it_field", "@5", "attr_type", "attr_desc", "attr_size", "attr_id", - "enums", "enum_list", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const unsigned short int yytoknum[] = -{ - 0, 256, 257, 258, 259, 40, 41, 260, 261, 262, - 263 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = -{ - 0, 11, 13, 12, 14, 14, 16, 15, 17, 17, - 17, 17, 19, 18, 21, 20, 23, 22, 24, 24, - 25, 26, 27, 27, 28, 28, 29, 29 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = -{ - 0, 2, 0, 2, 2, 0, 0, 6, 2, 2, - 2, 0, 0, 6, 0, 6, 0, 10, 1, 0, - 3, 2, 3, 0, 0, 3, 0, 5 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const unsigned char yydefact[] = -{ - 2, 0, 5, 1, 0, 3, 5, 0, 4, 6, - 11, 0, 0, 11, 11, 11, 0, 0, 0, 0, - 7, 10, 9, 8, 14, 12, 0, 19, 11, 11, - 20, 18, 0, 0, 0, 0, 0, 15, 13, 21, - 23, 0, 16, 0, 24, 22, 26, 0, 0, 17, - 0, 25, 0, 0, 27 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yysigned_char yydefgoto[] = -{ - -1, 1, 2, 5, 6, 10, 12, 13, 29, 14, - 28, 15, 44, 32, 19, 36, 42, 47, 48 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -14 -static const yysigned_char yypact[] = -{ - -14, 8, 4, -14, 2, -14, 4, 3, -14, -14, - 6, 0, 7, 6, 6, 6, 9, 10, 11, 15, - -14, -14, -14, -14, -14, -14, 16, 14, 6, 6, - -14, -14, 5, 17, 18, 19, 20, -14, -14, -14, - 22, 23, -14, 24, 27, -14, -14, 28, 1, -14, - 25, -14, 29, 30, -14 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yysigned_char yypgoto[] = -{ - -14, -14, -14, 32, -14, -14, -13, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 -static const unsigned char yytable[] = -{ - 21, 22, 23, 16, 17, 18, 50, 51, 3, 4, - 7, 11, 9, 20, 35, 33, 34, 24, 25, 26, - 27, 31, 30, 37, 38, 0, 40, 41, 0, 39, - 45, 43, 46, 52, 49, 0, 54, 53, 8 -}; - -static const yysigned_char yycheck[] = -{ - 13, 14, 15, 3, 4, 5, 5, 6, 0, 5, - 8, 5, 9, 6, 9, 28, 29, 8, 8, 8, - 5, 7, 6, 6, 6, -1, 6, 5, -1, 10, - 6, 8, 5, 8, 6, -1, 6, 8, 6 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const unsigned char yystos[] = -{ - 0, 12, 13, 0, 5, 14, 15, 8, 14, 9, - 16, 5, 17, 18, 20, 22, 3, 4, 5, 25, - 6, 17, 17, 17, 8, 8, 8, 5, 21, 19, - 6, 7, 24, 17, 17, 9, 26, 6, 6, 10, - 6, 5, 27, 8, 23, 6, 5, 28, 29, 6, - 5, 6, 8, 8, 6 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (0) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_stack_print (short int *bottom, short int *top) -#else -static void -yy_stack_print (bottom, top) - short int *bottom; - short int *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_reduce_print (int yyrule) -#else -static void -yy_reduce_print (yyrule) - int yyrule; -#endif -{ - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; -} -# endif -# endif - -# ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - size_t yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -#endif /* YYERROR_VERBOSE */ - - - -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - switch (yytype) - { - default: - break; - } - YYFPRINTF (yyoutput, ")"); -} - -#endif /* ! YYDEBUG */ -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM); -# else -int yyparse (); -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int -yyparse (void) -#else -int -yyparse () - ; -#endif -#endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short int yyssa[YYINITDEPTH]; - short int *yyss = yyssa; - short int *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK (yyvsp--, yyssp--) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short int *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - short int *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a look-ahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to look-ahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; - - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 53 "sysinfo.y" - { - switch (writecode) - { - case 'i': - printf("#ifdef SYSROFF_SWAP_IN\n"); - break; - case 'p': - printf("#ifdef SYSROFF_p\n"); - break; - case 'd': - break; - case 'g': - printf("#ifdef SYSROFF_SWAP_OUT\n"); - break; - case 'c': - printf("#ifdef SYSROFF_PRINT\n"); - printf("#include \n"); - printf("#include \n"); - printf("#include \n"); - break; - } - } - break; - - case 3: -#line 75 "sysinfo.y" - { - switch (writecode) { - case 'i': - case 'p': - case 'g': - case 'c': - printf("#endif\n"); - break; - case 'd': - break; - } -} - break; - - case 6: -#line 97 "sysinfo.y" - { - it = (yyvsp[-1].s); code = (yyvsp[0].i); - switch (writecode) - { - case 'd': - printf("\n\n\n#define IT_%s_CODE 0x%x\n", it,code); - printf("struct IT_%s;\n", it); - printf("extern void sysroff_swap_%s_in PARAMS ((struct IT_%s *));\n", - (yyvsp[-1].s), it); - printf("extern void sysroff_swap_%s_out PARAMS ((FILE *, struct IT_%s *));\n", - (yyvsp[-1].s), it); - printf("extern void sysroff_print_%s_out PARAMS ((struct IT_%s *));\n", - (yyvsp[-1].s), it); - printf("struct IT_%s { \n", it); - break; - case 'i': - printf("void sysroff_swap_%s_in(ptr)\n",(yyvsp[-1].s)); - printf("struct IT_%s *ptr;\n", it); - printf("{\n"); - printf("unsigned char raw[255];\n"); - printf("\tint idx = 0 ;\n"); - printf("\tint size;\n"); - printf("memset(raw,0,255);\n"); - printf("memset(ptr,0,sizeof(*ptr));\n"); - printf("size = fillup(raw);\n"); - break; - case 'g': - printf("void sysroff_swap_%s_out(file,ptr)\n",(yyvsp[-1].s)); - printf("FILE * file;\n"); - printf("struct IT_%s *ptr;\n", it); - printf("{\n"); - printf("\tunsigned char raw[255];\n"); - printf("\tint idx = 16 ;\n"); - printf("\tmemset (raw, 0, 255);\n"); - printf("\tcode = IT_%s_CODE;\n", it); - break; - case 'o': - printf("void sysroff_swap_%s_out(abfd,ptr)\n",(yyvsp[-1].s)); - printf("bfd * abfd;\n"); - printf("struct IT_%s *ptr;\n",it); - printf("{\n"); - printf("int idx = 0 ;\n"); - break; - case 'c': - printf("void sysroff_print_%s_out(ptr)\n",(yyvsp[-1].s)); - printf("struct IT_%s *ptr;\n", it); - printf("{\n"); - printf("itheader(\"%s\", IT_%s_CODE);\n",(yyvsp[-1].s),(yyvsp[-1].s)); - break; - - case 't': - break; - } - - } - break; - - case 7: -#line 154 "sysinfo.y" - { - switch (writecode) { - case 'd': - printf("};\n"); - break; - case 'g': - printf("\tchecksum(file,raw, idx, IT_%s_CODE);\n", it); - - case 'i': - - case 'o': - case 'c': - printf("}\n"); - } -} - break; - - case 12: -#line 181 "sysinfo.y" - { - rdepth++; - switch (writecode) - { - case 'c': - if (rdepth==1) - printf("\tprintf(\"repeat %%d\\n\", %s);\n",(yyvsp[0].s)); - if (rdepth==2) - printf("\tprintf(\"repeat %%d\\n\", %s[n]);\n",(yyvsp[0].s)); - case 'i': - case 'g': - case 'o': - - if (rdepth==1) - { - printf("\t{ int n; for (n = 0; n < %s; n++) {\n", (yyvsp[0].s)); - } - if (rdepth == 2) { - printf("\t{ int m; for (m = 0; m < %s[n]; m++) {\n", (yyvsp[0].s)); - } - - break; - } - - oldrepeat = repeat; - repeat = (yyvsp[0].s); - } - break; - - case 13: -#line 211 "sysinfo.y" - { - repeat = oldrepeat; - oldrepeat =0; - rdepth--; - switch (writecode) - { - case 'i': - case 'g': - case 'o': - case 'c': - printf("\t}}\n"); - } - } - break; - - case 14: -#line 228 "sysinfo.y" - { - switch (writecode) - { - case 'i': - case 'g': - case 'o': - case 'c': - printf("\tif (%s) {\n", (yyvsp[0].s)); - break; - } - } - break; - - case 15: -#line 241 "sysinfo.y" - { - switch (writecode) - { - case 'i': - case 'g': - case 'o': - case 'c': - printf("\t}\n"); - } - } - break; - - case 16: -#line 255 "sysinfo.y" - {name = (yyvsp[0].s); } - break; - - case 17: -#line 257 "sysinfo.y" - { - char *desc = (yyvsp[-8].s); - char *type = (yyvsp[-6].s); - int size = (yyvsp[-5].i); - char *id = (yyvsp[-3].s); -char *p = names[rdepth]; -char *ptr = pnames[rdepth]; - switch (writecode) - { - case 'g': - if (size % 8) - { - - printf("\twriteBITS(ptr->%s%s,raw,&idx,%d);\n", - id, - names[rdepth], size); - - } - else { - printf("\twrite%s(ptr->%s%s,raw,&idx,%d,file);\n", - type, - id, - names[rdepth],size/8); - } - break; - case 'i': - { - - if (rdepth >= 1) - - { - printf("if (!ptr->%s) ptr->%s = (%s*)xcalloc(%s, sizeof(ptr->%s[0]));\n", - id, - id, - type, - repeat, - id); - } - - if (rdepth == 2) - { - printf("if (!ptr->%s[n]) ptr->%s[n] = (%s**)xcalloc(%s[n], sizeof(ptr->%s[n][0]));\n", - id, - id, - type, - repeat, - id); - } - - } - - if (size % 8) - { - printf("\tptr->%s%s = getBITS(raw,&idx, %d,size);\n", - id, - names[rdepth], - size); - } - else { - printf("\tptr->%s%s = get%s(raw,&idx, %d,size);\n", - id, - names[rdepth], - type, - size/8); - } - break; - case 'o': - printf("\tput%s(raw,%d,%d,&idx,ptr->%s%s);\n", type,size/8,size%8,id,names[rdepth]); - break; - case 'd': - if (repeat) - printf("\t/* repeat %s */\n", repeat); - - if (type[0] == 'I') { - printf("\tint %s%s; \t/* %s */\n",ptr,id, desc); - } - else if (type[0] =='C') { - printf("\tchar %s*%s;\t /* %s */\n",ptr,id, desc); - } - else { - printf("\tbarray %s%s;\t /* %s */\n",ptr,id, desc); - } - break; - case 'c': - printf("tabout();\n"); - printf("\tprintf(\"/*%-30s*/ ptr->%s = \");\n", desc, id); - - if (type[0] == 'I') - printf("\tprintf(\"%%d\\n\",ptr->%s%s);\n", id,p); - else if (type[0] == 'C') - printf("\tprintf(\"%%s\\n\",ptr->%s%s);\n", id,p); - - else if (type[0] == 'B') - { - printf("\tpbarray(&ptr->%s%s);\n", id,p); - } - else abort(); - break; - } - } - break; - - case 18: -#line 362 "sysinfo.y" - { (yyval.s) = (yyvsp[0].s); } - break; - - case 19: -#line 363 "sysinfo.y" - { (yyval.s) = "INT";} - break; - - case 20: -#line 368 "sysinfo.y" - { (yyval.s) = (yyvsp[-1].s); } - break; - - case 21: -#line 373 "sysinfo.y" - { (yyval.i) = (yyvsp[-1].i) * (yyvsp[0].i); } - break; - - case 22: -#line 378 "sysinfo.y" - { (yyval.s) = (yyvsp[-1].s); } - break; - - case 23: -#line 379 "sysinfo.y" - { (yyval.s) = "dummy";} - break; - - case 27: -#line 387 "sysinfo.y" - { - switch (writecode) - { - case 'd': - printf("#define %s %s\n", (yyvsp[-2].s),(yyvsp[-1].s)); - break; - case 'c': - printf("if (ptr->%s%s == %s) { tabout(); printf(\"%s\\n\");}\n", name, names[rdepth],(yyvsp[-1].s),(yyvsp[-2].s)); - } - } - break; - - - default: break; - } - -/* Line 1126 of yacc.c. */ -#line 1503 "sysinfo.c" - - yyvsp -= yylen; - yyssp -= yylen; - - - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - char *yymsg = 0; -# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -#if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -#endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - - if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yymsg; - int yyi = 0; - while ((*yyp = *yyf)) - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - { - yyerror (YY_("syntax error")); - goto yyexhaustedlab; - } - } - else -#endif /* YYERROR_VERBOSE */ - yyerror (YY_("syntax error")); - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (0) - goto yyerrorlab; - -yyvsp -= yylen; - yyssp -= yylen; - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK; - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK; - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif - return yyresult; -} - - -#line 402 "sysinfo.y" - -/* four modes - - -d write structure definitions for sysroff in host format - -i write functions to swap into sysroff format in - -o write functions to swap into sysroff format out - -c write code to print info in human form */ - -int yydebug; - -int -main (int ac, char **av) -{ - yydebug=0; - if (ac > 1) - writecode = av[1][1]; -if (writecode == 'd') - { - printf("typedef struct { unsigned char *data; int len; } barray; \n"); - printf("typedef int INT;\n"); - printf("typedef char * CHARS;\n"); - - } - yyparse(); -return 0; -} - -static int -yyerror (char *s) -{ - fprintf(stderr, "%s\n" , s); - return 0; -} - diff --git a/binutils/sysinfo.h b/binutils/sysinfo.h deleted file mode 100644 index a608d69f82b..00000000000 --- a/binutils/sysinfo.h +++ /dev/null @@ -1,67 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - 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 2, 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. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - COND = 258, - REPEAT = 259, - TYPE = 260, - NAME = 261, - NUMBER = 262, - UNIT = 263 - }; -#endif -/* Tokens. */ -#define COND 258 -#define REPEAT 259 -#define TYPE 260 -#define NAME 261 -#define NUMBER 262 -#define UNIT 263 - - - - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 39 "sysinfo.y" -typedef union YYSTYPE { - int i; - char *s; -} YYSTYPE; -/* Line 1447 of yacc.c. */ -#line 59 "sysinfo.h" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE yylval; - - - diff --git a/binutils/syslex.c b/binutils/syslex.c deleted file mode 100644 index 48aab40d165..00000000000 --- a/binutils/syslex.c +++ /dev/null @@ -1,1729 +0,0 @@ -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /cvs/src/src/binutils/Attic/syslex.c,v 1.1.16.1 2006/04/16 18:36:41 drow Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include -#include - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#ifndef _WIN32 -#include -#endif - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 25 -#define YY_END_OF_BUFFER 26 -static yyconst short int yy_accept[81] = - { 0, - 0, 0, 26, 25, 7, 8, 5, 25, 1, 2, - 11, 11, 6, 3, 4, 25, 25, 25, 25, 25, - 25, 25, 0, 9, 11, 0, 6, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, - 13, 0, 0, 0, 0, 16, 0, 0, 0, 0, - 0, 12, 15, 0, 23, 0, 0, 0, 0, 0, - 0, 14, 18, 0, 0, 0, 0, 0, 17, 0, - 24, 0, 0, 0, 20, 22, 0, 21, 19, 0 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 4, 1, 5, 1, 1, 1, 1, 1, 6, - 7, 1, 1, 1, 1, 1, 1, 8, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 1, 10, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 11, 1, 12, 1, 1, 1, 13, 14, 15, 16, - - 17, 18, 19, 20, 21, 1, 1, 22, 1, 23, - 24, 25, 1, 26, 27, 28, 29, 30, 1, 31, - 32, 33, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[34] = - { 0, - 1, 1, 2, 1, 1, 1, 1, 3, 3, 1, - 1, 1, 3, 3, 3, 3, 3, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1 - } ; - -static yyconst short int yy_base[84] = - { 0, - 0, 0, 100, 101, 101, 101, 101, 94, 101, 101, - 26, 28, 0, 101, 101, 82, 26, 18, 74, 79, - 78, 81, 88, 101, 32, 0, 0, 76, 65, 62, - 61, 75, 20, 59, 61, 66, 58, 0, 57, 56, - 54, 63, 53, 62, 54, 101, 59, 48, 53, 46, - 59, 101, 44, 43, 101, 41, 55, 46, 53, 44, - 31, 101, 101, 39, 27, 21, 39, 19, 101, 35, - 101, 33, 26, 29, 101, 101, 28, 101, 101, 101, - 58, 61, 41 - } ; - -static yyconst short int yy_def[84] = - { 0, - 80, 1, 80, 80, 80, 80, 80, 81, 80, 80, - 80, 80, 82, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 81, 80, 80, 83, 82, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 83, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, - 80, 80, 80 - } ; - -static yyconst short int yy_nxt[135] = - { 0, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 4, 4, 4, 4, 4, - 19, 4, 4, 4, 4, 20, 21, 4, 4, 22, - 4, 4, 4, 25, 25, 25, 25, 32, 29, 25, - 25, 33, 44, 38, 79, 78, 30, 77, 45, 76, - 75, 74, 73, 72, 71, 70, 26, 31, 23, 23, - 23, 27, 69, 27, 68, 67, 66, 65, 64, 63, - 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, - 52, 51, 50, 49, 48, 47, 46, 43, 42, 41, - 40, 39, 24, 37, 36, 35, 34, 28, 24, 80, - - 3, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80 - } ; - -static yyconst short int yy_chk[135] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 11, 11, 12, 12, 18, 17, 25, - 25, 18, 33, 83, 77, 74, 17, 73, 33, 72, - 70, 68, 67, 66, 65, 64, 11, 17, 81, 81, - 81, 82, 61, 82, 60, 59, 58, 57, 56, 54, - 53, 51, 50, 49, 48, 47, 45, 44, 43, 42, - 41, 40, 39, 37, 36, 35, 34, 32, 31, 30, - 29, 28, 23, 22, 21, 20, 19, 16, 8, 3, - - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "syslex.l" -#define INITIAL 0 -#line 2 "syslex.l" -/* Copyright 2001, 2003, 2005 Free Software Foundation, Inc. - -This file is part of 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 2, 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 GLD; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA -02110-1301, USA. */ - -#include "config.h" -#ifdef HAVE_STRING_H -#include -#else -#ifdef HAVE_STRINGS_H -#include -#endif -#endif -#include "sysinfo.h" - -#define YY_NO_UNPUT - -#ifndef yywrap -static int yywrap (void) { return 1; } -#endif - -extern int yylex (void); -#line 457 "syslex.c" - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - } -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 39 "syslex.l" - -#line 621 "syslex.c" - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 81 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 101 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 40 "syslex.l" -{ return '(';} - YY_BREAK -case 2: -YY_RULE_SETUP -#line 41 "syslex.l" -{ return ')';} - YY_BREAK -case 3: -YY_RULE_SETUP -#line 42 "syslex.l" -{ return '[';} - YY_BREAK -case 4: -YY_RULE_SETUP -#line 43 "syslex.l" -{ return ']';} - YY_BREAK -case 5: -YY_RULE_SETUP -#line 44 "syslex.l" -{ ; } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 45 "syslex.l" -{ ; } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 46 "syslex.l" -{ ; } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 47 "syslex.l" -{ ; } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 48 "syslex.l" -{ - yylval.s = malloc (yyleng - 1); - memcpy (yylval.s, yytext + 1, yyleng - 2); - yylval.s[yyleng - 2] = '\0'; - return NAME; - } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 55 "syslex.l" -{ - yylval.i = strtol(yytext,0,16); - return NUMBER; - } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 60 "syslex.l" -{ - yylval.i = atoi(yytext); - return NUMBER; - } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 66 "syslex.l" -{ yylval.i =1 ;return UNIT;} - YY_BREAK -case 13: -YY_RULE_SETUP -#line 67 "syslex.l" -{ yylval.i = 1; return UNIT;} - YY_BREAK -case 14: -YY_RULE_SETUP -#line 68 "syslex.l" -{ yylval.i= 8; return UNIT;} - YY_BREAK -case 15: -YY_RULE_SETUP -#line 69 "syslex.l" -{ yylval.i = 8; return UNIT;} - YY_BREAK -case 16: -YY_RULE_SETUP -#line 71 "syslex.l" -{ yylval.s = "INT"; return TYPE;} - YY_BREAK -case 17: -YY_RULE_SETUP -#line 72 "syslex.l" -{ yylval.s = "BARRAY"; return TYPE;} - YY_BREAK -case 18: -YY_RULE_SETUP -#line 73 "syslex.l" -{ yylval.s = "CHARS"; return TYPE;} - YY_BREAK -case 19: -YY_RULE_SETUP -#line 74 "syslex.l" -{ yylval.i = 0; return NUMBER;} - YY_BREAK -case 20: -YY_RULE_SETUP -#line 75 "syslex.l" -{ yylval.i = -4; return NUMBER;} - YY_BREAK -case 21: -YY_RULE_SETUP -#line 76 "syslex.l" -{ yylval.i = -2; return NUMBER; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 77 "syslex.l" -{ yylval.i = -1; return NUMBER; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 78 "syslex.l" -{ return COND;} - YY_BREAK -case 24: -YY_RULE_SETUP -#line 79 "syslex.l" -{ return REPEAT;} - YY_BREAK -case 25: -YY_RULE_SETUP -#line 80 "syslex.l" -ECHO; - YY_BREAK -#line 840 "syslex.c" -case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 81 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 81 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 80); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - - return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef _WIN32 -#include -#else -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -#line 80 "syslex.l" diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog index a7e6ad6d975..ee8d32ec7e0 100644 --- a/binutils/testsuite/ChangeLog +++ b/binutils/testsuite/ChangeLog @@ -1,3 +1,195 @@ +2007-06-23 H.J. Lu + + * binutils-all/strip-3.d: Also strip .xtensa.info section. + +2007-05-24 Kai Tietz + + * binutils-all/windres/version_cat.rc: New. + * binutils-all/windres/version_cat.rsd: New. + +2007-05-23 Kai Tietz + + * binutils-all/windres/html.rc: New. + * binutils-all/windres/html.rsd: New. + * binutils-all/windres/html1.hm: New. + * binutils-all/windres/html2.hm: New. + * binutils-all/windres/messagetable.rc: New. + * binutils-all/windres/messagetable.rsd: New. + * binutils-all/windres/MSG00001.bin: New. + * binutils-all/windres/strtab2.rc: New. + * binutils-all/windres/strtab2.rsd: New. + * binutils-all/windres/version.rc: New. + * binutils-all/windres/version.rsd: New. + * binutils-all/windres/dialog.rsd: Fix expected results. + +2007-05-17 Joseph Myers + + * binutils-all/strip-3.d: Strip .pdr section. + +2007-05-15 Alan Modra + + * binutils-all/objcopy.exp: Only run needed-by-reloc test for ELF. + +2007-05-11 Alan Modra + + * binutils-all/needed-by-reloc.s: Use .long rather than .4byte. + +2007-05-08 Mark Shinwell + + * binutils-all/strip-3.d: Strip .ARM.attributes and .reginfo + sections. + +2007-05-02 Alan Modra + + * binutils-all/objcopy.exp (copy_setup): Don't perror, use send_log. + (copy_executable): Return early if test2 is blank. + Return unsupported rather than unresolved if we can't run + executables. Do test1 if we can compile. + +2007-04-24 Nathan Froyd + Phil Edwards + + * binutils-all/objcopy.exp: Add test for stripping a symbol + used in a relocation. + * binutils-all/needed-by-reloc.s: New file. + +2007-04-20 Nathan Froyd + Phil Edwards + Thomas de Lellis + + * binutils-all/objcopy.exp: Add test for --reverse-bytes. + +2007-04-21 Richard Earnshaw + + * binutils-all/readelf.exp (regexp_diff): Delete. + +2007-04-20 Richard Earnshaw + + * binutils-all/arm/thumb2-cond.s: Allow for tab expansion by the pty. + Rename the second test. + +2007-04-12 H.J. Lu + + PR binutils/4348 + * binutils-all/empty.s: New file. + * binutils-all/strip-3.d: Likewise. + + * binutils-all/objcopy.exp: Run strip-3 for ELF target. + +2007-02-27 Nathan Sidwell + + * binutils-all/objcopy.exp: Skip for uclinux targets. + +2007-02-14 Nick Clifton + + * binutils-all/readelf.exp (readelf_wi_test): Fix unexpected + output failure message. + +2007-01-08 Kai Tietz + + * copy-3.d: Renamed target x86_64-*-mingw64 to x86_64-*-mingw* + * dlltool.exp: Dito + * lang.rc: Dito + * strtab1.rc: Dito + * windres.exp: Dito + +2006-09-20 Kai Tietz + + * binutils-all/copy-3.d: Add support for target x86_64-pc-mingw64. + * binutils-all/dlltool.exp: Likewise. + * binutils-all/objcopy.exp: Likewise. + * binutils-all/windres/windres.exp: Likewise. + * binutils-all/windres/lang.rc: xfail it as long as there is no windows.h. + * binutils-all/windres/strtab1.rc: Likewise. + * lib/utils-lib.exp: Adjust executable prefix detection (as .exe). + +2006-09-14 H.J. Lu + + PR binutils/3181 + * binutils-all/objcopy.exp: Run strip-1 and strip-2 for ELF + targets. + + * binutils-all/strip-1.d: New file. + * binutils-all/strip-2.d: Likewise. + + * lib/utils-lib.exp (run_dump_test): Support strip. + +2006-08-15 Thiemo Seufer + Nigel Stephens + David Ung + + * binutils-all/readelf.exp (readelf_test): Handle mips*-sde-elf*. + +2006-06-24 Richard Sandiford + + * binutils-all/localize-hidden-1.d: Use objdump --syms instead + of readelf. + +2006-06-23 Richard Sandiford + + * binutils-all/localize-hidden-1.s, + * binutils-all/localize-hidden-1.d, + * binutils-all/localize-hidden-2.s, + * binutils-all/localize-hidden-2.d: New tests. + * binutils-all/objcopy.exp: Run them. + +2006-06-06 Paul Brook + + * binutils-all/arm/objdump.exp: New file. + * binutils-all/arm/thumb2-cond.s: New test. + +2006-05-03 H.J. Lu + + * binutils-all/copy-3.d: Fix a typo. + +2006-05-03 H.J. Lu + + * binutils-all/copy-3.d: New. + + * objcopy.exp: Run copy-3. + +2006-05-02 Dave Korn + + * binutils-all/copy-1.d (name): Correct spelling of 'setting'. + * binutils-all/copy-1.d (name): Likewise. + +2006-05-02 Nick Clifton + + * binutils-all/copy-2.d: Change the name of the section whose + flags are changed to "foo" so that the test will work with PE + based targets. Skip this test for AOUT based targeted. + * binutils-all/copytest.s: New file. + +2006-05-01 H.J. Lu + + * binutils-all/objcopy.exp: Run "copy-1" for ELF only. + +2006-05-01 Ben Elliston + + * binutils-all/objcopy.exp (objcopy_test_readelf): Remove stray ; + +2006-04-26 H.J. Lu + + PR binutils/2593 + * binutils-all/copy-1.d: New file. + * binutils-all/copy-1.s: Likewise. + * binutils-all/copy-2.d: Likewise. + + * binutils-all/objcopy.exp: Add run_dump_test "copy-1" and + run_dump_test "copy-2". + + * lib/utils-lib.exp (run_dump_test): New. + (slurp_options): Likewise. + (regexp_diff): Likewise. + (file_contents): Likewise. + (verbose_eval): Likewise. + +2006-04-25 H.J. Lu + + PR binutils/2467 + * binutils-all/objcopy.exp (strip_test): Also test "strip -g" + on archive. + 2006-04-10 H.J. Lu * lib/utils-lib.exp (default_binutils_run): Check exit status. diff --git a/binutils/testsuite/binutils-all/arm/objdump.exp b/binutils/testsuite/binutils-all/arm/objdump.exp new file mode 100644 index 00000000000..4677a48585c --- /dev/null +++ b/binutils/testsuite/binutils-all/arm/objdump.exp @@ -0,0 +1,63 @@ +# Copyright 2004 +# Free Software Foundation, Inc. + +# 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 2 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. + +if {![istarget "arm*-*-*"]} then { + return +} + +if {[which $OBJDUMP] == 0} then { + perror "$OBJDUMP does not exist" + return +} + +send_user "Version [binutil_version $OBJDUMP]" + +########################### +# Set up the test of movem.s +########################### + +if {![binutils_assemble $srcdir/$subdir/thumb2-cond.s tmpdir/thumb2-cond.o]} then { + return +} + +if [is_remote host] { + set objfile [remote_download host tmpdir/thumb2-cond.o] +} else { + set objfile tmpdir/thumb2-cond.o +} + +# Make sure that conditional instructions are correctly decoded. + +set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble --start-address=6 $objfile"] + +set want "bcc.w\[ \t\]*e12.*bx\[ \t\]*lr" + +if [regexp $want $got] then { + pass "thumb2-cond test1" +} else { + fail "thumb2-cond test1" +} + +set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble --start-address=10 $objfile"] + +set want "bx\[ \t\]*lr" + +if [regexp $want $got] then { + pass "thumb2-cond test2" +} else { + fail "thumb2-cond test2" +} diff --git a/binutils/testsuite/binutils-all/arm/thumb2-cond.s b/binutils/testsuite/binutils-all/arm/thumb2-cond.s new file mode 100644 index 00000000000..95761e17a67 --- /dev/null +++ b/binutils/testsuite/binutils-all/arm/thumb2-cond.s @@ -0,0 +1,6 @@ +.thumb +foo: +.short 0xf000, 0xf800 +.short 0xbf38 +.short 0xf000, 0xbf04 +bx lr diff --git a/binutils/testsuite/binutils-all/copy-1.d b/binutils/testsuite/binutils-all/copy-1.d new file mode 100644 index 00000000000..f2b0d9e90df --- /dev/null +++ b/binutils/testsuite/binutils-all/copy-1.d @@ -0,0 +1,13 @@ +#PROG: objcopy +#objdump: -h +#objcopy: --set-section-flags .post_text_reserve=contents,alloc,load,readonly,code +#name: copy with setting section flags 1 + +.*: +file format .* + +Sections: +Idx.* +#... + [0-9]* .post_text_reserve.* + CONTENTS, ALLOC, LOAD, READONLY, CODE +#... diff --git a/binutils/testsuite/binutils-all/copy-1.s b/binutils/testsuite/binutils-all/copy-1.s new file mode 100644 index 00000000000..32864de76ed --- /dev/null +++ b/binutils/testsuite/binutils-all/copy-1.s @@ -0,0 +1,6 @@ + .globl text_symbol + .text +text_symbol: + .long 1 + .section .post_text_reserve,"w", %nobits + .space 160 diff --git a/binutils/testsuite/binutils-all/copy-2.d b/binutils/testsuite/binutils-all/copy-2.d new file mode 100644 index 00000000000..8a1ab593858 --- /dev/null +++ b/binutils/testsuite/binutils-all/copy-2.d @@ -0,0 +1,18 @@ +#PROG: objcopy +#objdump: -h +#objcopy: --set-section-flags foo=contents,alloc,load,code +#name: copy with setting section flags 2 +#source: copytest.s +#not-target: *-*-aout +# Note - we use copytest.s and a section named "foo" rather +# than .text because for some file formats (eg PE) the .text +# section has a fixed set of flags and these cannot be changed. + +.*: +file format .* + +Sections: +Idx.* +#... + [0-9]* foo.* + CONTENTS, ALLOC, LOAD, CODE +#... diff --git a/binutils/testsuite/binutils-all/copy-3.d b/binutils/testsuite/binutils-all/copy-3.d new file mode 100644 index 00000000000..1b07817cd23 --- /dev/null +++ b/binutils/testsuite/binutils-all/copy-3.d @@ -0,0 +1,17 @@ +#PROG: objcopy +#objdump: -h +#objcopy: --set-section-flags .text=alloc,data +#name: copy with setting section flags 3 +#source: bintest.s +#not-target: *-*-aout *-*-*pe *-*-*coff i*86-*-cygwin* i*86-*-mingw32* x86_64-*-mingw* +# The .text # section in PE/COFF has a fixed set of flags and these +# cannot be changed. We skip it for them. + +.*: +file format .* + +Sections: +Idx.* +#... + [0-9]* .text.* + CONTENTS, ALLOC, LOAD, RELOC, DATA +#... diff --git a/binutils/testsuite/binutils-all/copytest.s b/binutils/testsuite/binutils-all/copytest.s new file mode 100644 index 00000000000..33c13b881a6 --- /dev/null +++ b/binutils/testsuite/binutils-all/copytest.s @@ -0,0 +1,7 @@ + .globl foo_symbol + .section foo +foo_symbol: + .long 1 + .section bar +bar_symbol: + .long 2 diff --git a/binutils/testsuite/binutils-all/dlltool.exp b/binutils/testsuite/binutils-all/dlltool.exp index 6ddfcfae9b0..af0145d48d1 100644 --- a/binutils/testsuite/binutils-all/dlltool.exp +++ b/binutils/testsuite/binutils-all/dlltool.exp @@ -1,4 +1,4 @@ -# Copyright 2002, 2004 Free Software Foundation, Inc. +# Copyright 2002, 2004, 2006 Free Software Foundation, Inc. # 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 @@ -14,13 +14,14 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. -if {![istarget "i*86-*-*"]} { +if {![istarget "i*86-*-*"] && ![istarget "x86_64-*-mingw*"] } { return } if {![istarget "i*86-*-*pe*"] \ && ![istarget "i*86-*-cygwin*"] \ - && ![istarget "i*86-*-mingw32*"] } { + && ![istarget "i*86-*-mingw32*"] \ + && ![istarget "x86_64-*-mingw*"] } { set target_xfail "yes" } else { set target_xfail "no" diff --git a/binutils/testsuite/binutils-all/empty.s b/binutils/testsuite/binutils-all/empty.s new file mode 100644 index 00000000000..8690c06ad8e --- /dev/null +++ b/binutils/testsuite/binutils-all/empty.s @@ -0,0 +1 @@ +# An empty file. diff --git a/binutils/testsuite/binutils-all/localize-hidden-1.d b/binutils/testsuite/binutils-all/localize-hidden-1.d new file mode 100644 index 00000000000..a5286ed1e81 --- /dev/null +++ b/binutils/testsuite/binutils-all/localize-hidden-1.d @@ -0,0 +1,19 @@ +#PROG: objcopy +#objdump: --syms +#objcopy: --localize-hidden +#name: --localize-hidden test 1 +#... +0+1200 l .*\*ABS\* 0+ \.hidden Lhidden +0+1300 l .*\*ABS\* 0+ \.internal Linternal +0+1400 l .*\*ABS\* 0+ \.protected Lprotected +0+1100 l .*\*ABS\* 0+ Ldefault +#... +0+2200 l .*\*ABS\* 0+ \.hidden Ghidden +0+2300 l .*\*ABS\* 0+ \.internal Ginternal +0+3200 l .*\*ABS\* 0+ \.hidden Whidden +0+3300 l .*\*ABS\* 0+ \.internal Winternal +0+2100 g .*\*ABS\* 0+ Gdefault +0+2400 g .*\*ABS\* 0+ \.protected Gprotected +0+3100 w.*\*ABS\* 0+ Wdefault +0+3400 w.*\*ABS\* 0+ \.protected Wprotected +#pass diff --git a/binutils/testsuite/binutils-all/localize-hidden-1.s b/binutils/testsuite/binutils-all/localize-hidden-1.s new file mode 100644 index 00000000000..bdaa69d0c08 --- /dev/null +++ b/binutils/testsuite/binutils-all/localize-hidden-1.s @@ -0,0 +1,36 @@ + .globl Gdefault + .globl Ghidden + .globl Ginternal + .globl Gprotected + + .weak Wdefault + .weak Whidden + .weak Winternal + .weak Wprotected + + .hidden Lhidden + .hidden Ghidden + .hidden Whidden + + .internal Linternal + .internal Ginternal + .internal Winternal + + .protected Lprotected + .protected Gprotected + .protected Wprotected + + .equ Ldefault, 0x1100 + .equ Lhidden, 0x1200 + .equ Linternal, 0x1300 + .equ Lprotected, 0x1400 + + .equ Gdefault, 0x2100 + .equ Ghidden, 0x2200 + .equ Ginternal, 0x2300 + .equ Gprotected, 0x2400 + + .equ Wdefault, 0x3100 + .equ Whidden, 0x3200 + .equ Winternal, 0x3300 + .equ Wprotected, 0x3400 diff --git a/binutils/testsuite/binutils-all/localize-hidden-2.d b/binutils/testsuite/binutils-all/localize-hidden-2.d new file mode 100644 index 00000000000..ed3807aefbc --- /dev/null +++ b/binutils/testsuite/binutils-all/localize-hidden-2.d @@ -0,0 +1,7 @@ +#PROG: objcopy +#nm: -n +#objcopy: --localize-hidden +#name: --localize-hidden test 2 +#... +0+100 A G +#pass diff --git a/binutils/testsuite/binutils-all/localize-hidden-2.s b/binutils/testsuite/binutils-all/localize-hidden-2.s new file mode 100644 index 00000000000..d428c3aa470 --- /dev/null +++ b/binutils/testsuite/binutils-all/localize-hidden-2.s @@ -0,0 +1,2 @@ + .globl G + .equ G,0x100 diff --git a/binutils/testsuite/binutils-all/needed-by-reloc.s b/binutils/testsuite/binutils-all/needed-by-reloc.s new file mode 100644 index 00000000000..40ebdedfe90 --- /dev/null +++ b/binutils/testsuite/binutils-all/needed-by-reloc.s @@ -0,0 +1,7 @@ + .globl foo + + .data + .long foo + .text +foo: + .long 1 diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp index 23e537ea76a..72338df350b 100644 --- a/binutils/testsuite/binutils-all/objcopy.exp +++ b/binutils/testsuite/binutils-all/objcopy.exp @@ -1,5 +1,5 @@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, -# 2004 +# 2004, 2006, 2007 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -113,6 +113,40 @@ proc objcopy_test {testname srcfile} { objcopy_test "simple copy" bintest.s +# Test reversing bytes in a section. + +set reversed ${tempfile}-reversed +set got [binutils_run $OBJCOPY "$OBJCOPYFLAGS -j .data --reverse-bytes=4 $tempfile $reversed"] + +if ![string match "" $got] then { + fail "objcopy --reverse-bytes" +} else { + if [is_remote host] { + remote_upload host ${reversed} tmpdir/copy-reversed.o + set reversed tmpdir/copy-reversed.o + } + + set origdata [binutils_run $OBJDUMP "$OBJDUMPFLAGS -s -j .data $tempfile"] + set revdata [binutils_run $OBJDUMP "$OBJDUMPFLAGS -s -j .data $reversed"] + + set want "^ \[0-9\]+ (\[0-9\]+)" + set found_orig [regexp -lineanchor $want $origdata -> origdata] + set found_rev [regexp -lineanchor $want $revdata -> revdata] + + if {$found_orig == 0 || $found_rev == 0} then { + fail "objcopy --reverse-bytes" + } else { + scan $origdata "%2x%2x%2x%2x" b1 b2 b3 b4 + scan $revdata "%2x%2x%2x%2x" c4 c3 c2 c1 + + if {$b1 == $c1 && $b2 == $c2 && $b3 == $c3 && $b4 == $c4} then { + pass "objcopy --reverse-bytes" + } else { + fail "objcopy --reverse-bytes" + } + } +} + # Test generating S records. # We make the srec filename 8.3 compatible. Note that the header string @@ -359,6 +393,12 @@ proc strip_test { } { return } + set exec_output [binutils_run $STRIP "-g $archive"] + if ![string match "" $exec_output] { + fail $test + return + } + set exec_output [binutils_run $STRIP "$STRIPFLAGS $archive"] if ![string match "" $exec_output] { fail $test @@ -437,7 +477,7 @@ strip_test_with_saving_a_symbol # Build a final executable. -if { [istarget *-*-cygwin] || [istarget *-*-mingw32] } { +if { [istarget *-*-cygwin] || [istarget *-*-mingw*] } { set test_prog "testprog.exe" } else { set test_prog "testprog" @@ -452,6 +492,10 @@ proc copy_setup { } { set res [build_wrapper testglue.o] set flags { debug } + if { [istarget *-*-uclinux*] } { + return 1 + } + if { $res != "" } { lappend flags "additional_flags=[lindex $res 1]" set add_libs "testglue.o" @@ -472,7 +516,7 @@ proc copy_setup { } { set status [lindex $result 0] if { $status != "pass" } { - perror "unresolved setup, status = $status" + send_log "cannot run executable, status = ${status}\n" return 3 } @@ -497,6 +541,9 @@ proc copy_executable { prog flags test1 test2 } { if ![string match "" $exec_output] { fail $test1 + if [string match "" $test2] { + return + } fail $test2 return } @@ -538,6 +585,10 @@ proc copy_executable { prog flags test1 test2 } { fail $test1 } + if [string match "" $test2] { + return + } + set output [remote_load target tmpdir/copyprog] set status [lindex $output 0] if { $status != "pass" } { @@ -649,10 +700,10 @@ switch [copy_setup] { untested $test4 } "3" { - unresolved $test1 - unresolved $test2 - unresolved $test3 - unresolved $test4 + copy_executable "$OBJCOPY" "$OBJCOPYFLAGS" "$test1" "" + unsupported $test2 + unsupported $test3 + unsupported $test4 } "0" { copy_executable "$OBJCOPY" "$OBJCOPYFLAGS" "$test1" "$test2" @@ -677,7 +728,7 @@ proc objcopy_test_readelf {testname srcfile} { catch "exec $OBJCOPY $OBJCOPYFLAGS tmpdir/bintest.o tmpdir/copy.o" exec_output if ![string match "" $exec_output] then { fail "objcopy ($testname)" - return; + return } verbose -log "$READELF -a tmpdir/bintest.o > tmpdir/bintest.o.out" @@ -717,4 +768,36 @@ if { ([istarget "ia64-*-elf*"] if [is_elf_format] { objcopy_test "ELF unknown section type" unknown.s objcopy_test_readelf "ELF group" group.s + run_dump_test "copy-1" } + +run_dump_test "copy-2" +run_dump_test "copy-3" + +if [is_elf_format] { + run_dump_test "strip-1" + run_dump_test "strip-2" + run_dump_test "strip-3" + + if { [istarget "i*86-*"] || [istarget "x86_64-*-*"] } { + # Check to make sure we don't strip a symbol named in relocations. + set test "objcopy keeps symbols needed by relocs" + + set srcfile $srcdir/$subdir/needed-by-reloc.s + + if {![binutils_assemble $srcfile tmpdir/bintest.o]} then { + unresolved $test + } else { + set got [binutils_run $OBJCOPY "$OBJCOPYFLAGS --strip-symbol=foo tmpdir/bintest.o ${copyfile}.o"] + + if [regexp "not stripping symbol `foo' because it is named in a relocation" $got] { + pass $test + } else { + fail $test + } + } + } + + run_dump_test "localize-hidden-1" +} +run_dump_test "localize-hidden-2" diff --git a/binutils/testsuite/binutils-all/readelf.exp b/binutils/testsuite/binutils-all/readelf.exp index 8815fee5924..814ae7caa56 100644 --- a/binutils/testsuite/binutils-all/readelf.exp +++ b/binutils/testsuite/binutils-all/readelf.exp @@ -31,108 +31,6 @@ proc file_contents { filename } { return $contents } -# regexp_diff, based on simple_diff taken from ld test suite -# compares two files line-by-line -# file1 contains strings, file2 contains regexps and #-comments -# blank lines are ignored in either file -# returns non-zero if differences exist -# -proc regexp_diff { file_1 file_2 } { - - set eof -1 - set end_1 0 - set end_2 0 - set differences 0 - set diff_pass 0 - - if [file exists $file_1] then { - set file_a [open $file_1 r] - } else { - warning "$file_1 doesn't exist" - return 1 - } - - if [file exists $file_2] then { - set file_b [open $file_2 r] - } else { - fail "$file_2 doesn't exist" - close $file_a - return 1 - } - - verbose " Regexp-diff'ing: $file_1 $file_2" 2 - - while { 1 } { - set line_a "" - set line_b "" - while { [string length $line_a] == 0 } { - if { [gets $file_a line_a] == $eof } { - set end_1 1 - break - } - } - while { [string length $line_b] == 0 || [string match "#*" $line_b] } { - if [ string match "#pass" $line_b ] { - set end_2 1 - set diff_pass 1 - break - } elseif [ string match "#..." $line_b ] { - if { [gets $file_b line_b] == $eof } { - set end_2 1 - break - } - verbose "looking for \"^$line_b$\"" 3 - while { ![regexp "^$line_b$" "$line_a"] } { - verbose "skipping \"$line_a\"" 3 - if { [gets $file_a line_a] == $eof } { - set end_1 1 - break - } - } - break - } - if { [gets $file_b line_b] == $eof } { - set end_2 1 - break - } - } - - if { $diff_pass } { - break - } elseif { $end_1 && $end_2 } { - break - } elseif { $end_1 } { - send_log "extra regexps in $file_2 starting with \"^$line_b$\"\nEOF from $file_1\n" - verbose "extra regexps in $file_2 starting with \"^$line_b$\"\nEOF from $file_1" 3 - set differences 1 - break - } elseif { $end_2 } { - send_log "extra lines in $file_1 starting with \"^$line_a$\"\nEOF from $file_2\n" - verbose "extra lines in $file_1 starting with \"^$line_a$\"\nEOF from $file_2\n" 3 - set differences 1 - break - } else { - verbose "regexp \"^$line_b$\"\nline \"$line_a\"" 3 - if ![regexp "^$line_b$" "$line_a"] { - send_log "regexp_diff match failure\n" - send_log "regexp \"^$line_b$\"\nline \"$line_a\"\n" - set differences 1 - } - } - } - - if { $differences == 0 && !$diff_pass && [eof $file_a] != [eof $file_b] } { - send_log "$file_1 and $file_2 are different lengths\n" - verbose "$file_1 and $file_2 are different lengths" 3 - set differences 1 - } - - close $file_a - close $file_b - - return $differences -} - # Find out the size by reading the output of the EI_CLASS field. # Similar to the test for readelf -h, but we're just looking for the # EI_CLASS line here. @@ -193,7 +91,7 @@ proc readelf_test { options binary_file regexp_file xfails } { set target_machine "" if [istarget "mips*-*-*"] then { - if { [istarget "mips*-*-*linux*"] } then { + if { [istarget "mips*-*-*linux*"] || [istarget "mips*-sde-elf*"] } then { set target_machine tmips } else { set target_machine mips @@ -260,7 +158,7 @@ proc readelf_wi_test {} { set got [prune_readelf_wi_warnings $got] if ![string match "" $got] then { - fail "readelf $options (reason: unexpected output)" + fail "readelf $READELFFLAGS -wi (reason: unexpected output)" send_log $got send_log "\n" return diff --git a/binutils/testsuite/binutils-all/strip-1.d b/binutils/testsuite/binutils-all/strip-1.d new file mode 100644 index 00000000000..200983211ea --- /dev/null +++ b/binutils/testsuite/binutils-all/strip-1.d @@ -0,0 +1,11 @@ +#PROG: strip +#source: group.s +#readelf: -Sg --wide +#name: strip with section group 1 + +#... + \[[ 0-9]+\] \.text.*[ \t]+PROGBITS[ \t0-9a-f]+AX[ \t]+.* +#... + \[[ 0-9]+\] \.data.*[ \t]+PROGBITS[ \t0-9a-f]+WA[ \t]+.* +#... +There are no section groups in this file. diff --git a/binutils/testsuite/binutils-all/strip-2.d b/binutils/testsuite/binutils-all/strip-2.d new file mode 100644 index 00000000000..5c54b7ecb82 --- /dev/null +++ b/binutils/testsuite/binutils-all/strip-2.d @@ -0,0 +1,18 @@ +#PROG: strip +#source: group.s +#strip: --strip-unneeded +#readelf: -Sg --wide +#name: strip with section group 2 + +#... + \[[ 0-9]+\] foo_group[ \t]+GROUP[ \t]+.* +#... + \[[ 0-9]+\] \.text.*[ \t]+PROGBITS[ \t0-9a-f]+AXG[ \t]+.* +#... + \[[ 0-9]+\] \.data.*[ \t]+PROGBITS[ \t0-9a-f]+WAG[ \t]+.* +#... +COMDAT group section \[[ 0-9]+\] `foo_group' \[foo_group\] contains 2 sections: + \[Index\] Name + \[[ 0-9]+\] .text.* + \[[ 0-9]+\] .data.* +#pass diff --git a/binutils/testsuite/binutils-all/strip-3.d b/binutils/testsuite/binutils-all/strip-3.d new file mode 100644 index 00000000000..d6566977001 --- /dev/null +++ b/binutils/testsuite/binutils-all/strip-3.d @@ -0,0 +1,11 @@ +#PROG: strip +#source: empty.s +#strip: -R .text -R .data -R .bss -R .ARM.attributes -R .reginfo -R .pdr -R .xtensa.info +#readelf: -S --wide +#name: strip empty file +#target: *-*-linux* + +#... + \[[ 0]+\][ \t]+NULL[ \t]+.* + \[[ 1]+\] \.shstrtab.*[ \t]+STRTAB[ \t]+.* +#pass diff --git a/binutils/testsuite/binutils-all/windres/MSG00001.bin b/binutils/testsuite/binutils-all/windres/MSG00001.bin new file mode 100644 index 00000000000..0092b834152 Binary files /dev/null and b/binutils/testsuite/binutils-all/windres/MSG00001.bin differ diff --git a/binutils/testsuite/binutils-all/windres/dialogid.rsd b/binutils/testsuite/binutils-all/windres/dialogid.rsd index 1e6bb1885dc..6c655a1c117 100644 --- a/binutils/testsuite/binutils-all/windres/dialogid.rsd +++ b/binutils/testsuite/binutils-all/windres/dialogid.rsd @@ -9,10 +9,10 @@ Contents of section .data: 0040 0100ffff 00000000 00000000 00008880 ................ 0050 02000000 0000c800 c8000000 00000000 ................ 0060 00000000 00000000 4d000050 0b000b00 ........M..P.... - 0070 5300a200 ffff0000 63006c00 61007300 S.......c.l.a.s. - 0080 73006e00 61006d00 65000000 ffff6c00 s.n.a.m.e.....l. + 0070 5300a200 ffffffff 43004c00 41005300 S.......C.L.A.S. + 0080 53004e00 41004d00 45000000 ffff6c00 S.N.A.M.E.....l. 0090 00000000 00000000 00000000 0e120050 ...............P - 00a0 05000500 0a000a00 66000000 63006c00 ........f...c.l. - 00b0 61007300 73006e00 61006d00 65000000 a.s.s.n.a.m.e... + 00a0 05000500 0a000a00 66000000 43004c00 ........f...C.L. + 00b0 41005300 53004e00 41004d00 45000000 A.S.S.N.A.M.E... 00c0 73007400 72006900 6e006700 69006400 s.t.r.i.n.g.i.d. 00d0 00000000 .... diff --git a/binutils/testsuite/binutils-all/windres/html.rc b/binutils/testsuite/binutils-all/windres/html.rc new file mode 100644 index 00000000000..ead6a11829c --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/html.rc @@ -0,0 +1,7 @@ +//#xfail x86_64-*-mingw* +#include "windows.h" + +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN + +129 HTML "html1.hm" +130 HTML "html2.hm" diff --git a/binutils/testsuite/binutils-all/windres/html.rsd b/binutils/testsuite/binutils-all/windres/html.rsd new file mode 100644 index 00000000000..c124a82b662 --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/html.rsd @@ -0,0 +1,45 @@ + +html.res: file format binary + +Contents of section .data: + 0000 00000000 20000000 ffff0000 ffff0000 .... ........... + 0010 00000000 00000000 00000000 00000000 ................ + 0020 0d010000 20000000 ffff1700 ffff8100 .... ........... + 0030 00000000 30100704 00000000 00000000 ....0........... + 0040 3c21444f 43545950 4520646f 63747970 ...... .. + 00e0 20203c74 69746c65 3e57696e 64726573 Windres + 00f0 3c2f7469 746c653e 0d0a3c2f 68656164 ........Thi + 0110 73206973 20612074 65737420 70616765 s is a test page + 0120 20666f72 2077696e 64726573 2048544d for windres HTM + 0130 4c207265 736f7572 63652e0d 0a3c2f62 L resource........ + 0150 14010000 20000000 ffff1700 ffff8200 .... ........... + 0160 00000000 30100704 00000000 00000000 ....0........... + 0170 3c21444f 43545950 4520646f 63747970 ...... .. + 0210 20203c74 69746c65 3e57696e 64726573 Windres + 0220 3c2f7469 746c653e 0d0a3c2f 68656164 ........Thi + 0240 73206973 20612073 65636f6e 64207465 s is a second te + 0250 73742070 61676520 666f7220 77696e64 st page for wind + 0260 72657320 48544d4c 20726573 6f757263 res HTML resourc + 0270 652e0d0a 3c2f626f 64793e0d 0a3c2f68 e..... diff --git a/binutils/testsuite/binutils-all/windres/html1.hm b/binutils/testsuite/binutils-all/windres/html1.hm new file mode 100644 index 00000000000..ffc5a1825cc --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/html1.hm @@ -0,0 +1,11 @@ + + + + + Windres + + + +This is a test page for windres HTML resource. + + \ No newline at end of file diff --git a/binutils/testsuite/binutils-all/windres/html2.hm b/binutils/testsuite/binutils-all/windres/html2.hm new file mode 100644 index 00000000000..2fb343bf528 --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/html2.hm @@ -0,0 +1,11 @@ + + + + + Windres + + + +This is a second test page for windres HTML resource. + + \ No newline at end of file diff --git a/binutils/testsuite/binutils-all/windres/lang.rc b/binutils/testsuite/binutils-all/windres/lang.rc index d894315568e..11a4d06b948 100644 --- a/binutils/testsuite/binutils-all/windres/lang.rc +++ b/binutils/testsuite/binutils-all/windres/lang.rc @@ -1,3 +1,4 @@ +//#xfail x86_64-*-mingw* #include "windows.h" LANGUAGE 0, 0 diff --git a/binutils/testsuite/binutils-all/windres/messagetable.rc b/binutils/testsuite/binutils-all/windres/messagetable.rc new file mode 100644 index 00000000000..e10ee639db5 --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/messagetable.rc @@ -0,0 +1,6 @@ +//#xfail x86_64-*-mingw* +#include "windows.h" + +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN + +888 MESSAGETABLE MSG00001.bin diff --git a/binutils/testsuite/binutils-all/windres/messagetable.rsd b/binutils/testsuite/binutils-all/windres/messagetable.rsd new file mode 100644 index 00000000000..9d108a58932 --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/messagetable.rsd @@ -0,0 +1,15 @@ + +messagetable.res: file format binary + +Contents of section .data: + 0000 00000000 20000000 ffff0000 ffff0000 .... ........... + 0010 00000000 00000000 00000000 00000000 ................ + 0020 70000000 20000000 ffff0b00 ffff7803 p... .........x. + 0030 00000000 30100704 00000000 00000000 ....0........... + 0040 01000000 00000000 05000000 10000000 ................ + 0050 14000000 4e6f7469 63653a20 25310d0a ....Notice: %1.. + 0060 00000000 0c000000 25310d0a 00000000 ........%1...... + 0070 10000000 5761726e 3a202531 0d0a0000 ....Warn: %1.... + 0080 10000000 4572726f 723a2025 310d0a00 ....Error: %1... + 0090 10000000 46617461 6c3a2025 310d0a00 ....Fatal: %1... + 00a0 10000000 25310d0a 25320d0a 00000000 ....%1..%2...... diff --git a/binutils/testsuite/binutils-all/windres/strtab1.rc b/binutils/testsuite/binutils-all/windres/strtab1.rc index a1a246d8eb8..416d157f1cf 100644 --- a/binutils/testsuite/binutils-all/windres/strtab1.rc +++ b/binutils/testsuite/binutils-all/windres/strtab1.rc @@ -1,3 +1,4 @@ +//#xfail x86_64-*-mingw* #include "windows.h" LANGUAGE 0, 0 diff --git a/binutils/testsuite/binutils-all/windres/strtab2.rc b/binutils/testsuite/binutils-all/windres/strtab2.rc new file mode 100644 index 00000000000..9322034946c --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/strtab2.rc @@ -0,0 +1,9 @@ +//#xfail x86_64-*-mingw* +#include "windows.h" + +LANGUAGE 0, 0 + +STRINGTABLE MOVEABLE PURE DISCARDABLE +BEGIN + 1 L"hello, world" +END diff --git a/binutils/testsuite/binutils-all/windres/strtab2.rsd b/binutils/testsuite/binutils-all/windres/strtab2.rsd new file mode 100644 index 00000000000..4d610739352 --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/strtab2.rsd @@ -0,0 +1,8 @@ + 0000 00000000 20000000 ffff0000 ffff0000 .... ........... + 0010 00000000 00000000 00000000 00000000 ................ + 0020 38000000 20000000 ffff0600 ffff0100 8... ........... + 0030 00000000 30100000 00000000 00000000 ....0........... + 0040 00000c00 68006500 6c006c00 6f002c00 ....h.e.l.l.o.,. + 0050 20007700 6f007200 6c006400 00000000 .w.o.r.l.d..... + 0060 00000000 00000000 00000000 00000000 ................ + 0070 00000000 00000000 ........ diff --git a/binutils/testsuite/binutils-all/windres/version.rc b/binutils/testsuite/binutils-all/windres/version.rc new file mode 100644 index 00000000000..5eea3353e0d --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/version.rc @@ -0,0 +1,33 @@ +//#xfail x86_64-*-mingw* +#include "windows.h" + +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL + FILEFLAGS 0x0L + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040704e4" + BEGIN + VALUE L"CompanyName", L"binutil\x0073" + VALUE "FileDescription", "RC compiler." + VALUE "FileVersion", "1.0.0.1" + VALUE "InternalName", "windres.exe" + VALUE "LegalCopyright", "(c) FSF. All rights are reserved." + VALUE "OriginalFilename", "windres.exe" + VALUE "ProductName", "windows resource compiler" + VALUE "ProductVersion", "1.0.0.1" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x407, 1252 + END +END diff --git a/binutils/testsuite/binutils-all/windres/version.rsd b/binutils/testsuite/binutils-all/windres/version.rsd new file mode 100644 index 00000000000..85dd5d35281 --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/version.rsd @@ -0,0 +1,55 @@ + +version.res: file format binary + +Contents of section .data: + 0000 00000000 20000000 ffff0000 ffff0000 .... ........... + 0010 00000000 00000000 00000000 00000000 ................ + 0020 ec020000 20000000 ffff1000 ffff0100 .... ........... + 0030 00000000 00000704 00000000 00000000 ................ + 0040 ec023400 00005600 53005f00 56004500 ..4...V.S._.V.E. + 0050 52005300 49004f00 4e005f00 49004e00 R.S.I.O.N._.I.N. + 0060 46004f00 00000000 bd04effe 00000100 F.O............. + 0070 00000100 01000000 00000100 01000000 ................ + 0080 3f000000 00000000 04000000 01000000 ?............... + 0090 00000000 00000000 00000000 4c020000 ............L... + 00a0 00005300 74007200 69006e00 67004600 ..S.t.r.i.n.g.F. + 00b0 69006c00 65004900 6e006600 6f000000 i.l.e.I.n.f.o... + 00c0 28020000 00003000 34003000 37003000 (.....0.4.0.7.0. + 00d0 34006500 34000000 32000900 01004300 4.e.4...2.....C. + 00e0 6f006d00 70006100 6e007900 4e006100 o.m.p.a.n.y.N.a. + 00f0 6d006500 00000000 62006900 6e007500 m.e.....b.i.n.u. + 0100 74006900 6c007300 00000000 42000d00 t.i.l.s.....B... + 0110 01004600 69006c00 65004400 65007300 ..F.i.l.e.D.e.s. + 0120 63007200 69007000 74006900 6f006e00 c.r.i.p.t.i.o.n. + 0130 00000000 52004300 20006300 6f006d00 ....R.C. .c.o.m. + 0140 70006900 6c006500 72002e00 00000000 p.i.l.e.r....... + 0150 30000800 01004600 69006c00 65005600 0.....F.i.l.e.V. + 0160 65007200 73006900 6f006e00 00000000 e.r.s.i.o.n..... + 0170 31002e00 30002e00 30002e00 31000000 1...0...0...1... + 0180 38000c00 01004900 6e007400 65007200 8.....I.n.t.e.r. + 0190 6e006100 6c004e00 61006d00 65000000 n.a.l.N.a.m.e... + 01a0 77006900 6e006400 72006500 73002e00 w.i.n.d.r.e.s... + 01b0 65007800 65000000 68002200 01004c00 e.x.e...h."...L. + 01c0 65006700 61006c00 43006f00 70007900 e.g.a.l.C.o.p.y. + 01d0 72006900 67006800 74000000 28006300 r.i.g.h.t...(.c. + 01e0 29002000 46005300 46002e00 20004100 ). .F.S.F... .A. + 01f0 6c006c00 20007200 69006700 68007400 l.l. .r.i.g.h.t. + 0200 73002000 61007200 65002000 72006500 s. .a.r.e. .r.e. + 0210 73006500 72007600 65006400 2e000000 s.e.r.v.e.d..... + 0220 40000c00 01004f00 72006900 67006900 @.....O.r.i.g.i. + 0230 6e006100 6c004600 69006c00 65006e00 n.a.l.F.i.l.e.n. + 0240 61006d00 65000000 77006900 6e006400 a.m.e...w.i.n.d. + 0250 72006500 73002e00 65007800 65000000 r.e.s...e.x.e... + 0260 54001a00 01005000 72006f00 64007500 T.....P.r.o.d.u. + 0270 63007400 4e006100 6d006500 00000000 c.t.N.a.m.e..... + 0280 77006900 6e006400 6f007700 73002000 w.i.n.d.o.w.s. . + 0290 72006500 73006f00 75007200 63006500 r.e.s.o.u.r.c.e. + 02a0 20006300 6f006d00 70006900 6c006500 .c.o.m.p.i.l.e. + 02b0 72000000 34000800 01005000 72006f00 r...4.....P.r.o. + 02c0 64007500 63007400 56006500 72007300 d.u.c.t.V.e.r.s. + 02d0 69006f00 6e000000 31002e00 30002e00 i.o.n...1...0... + 02e0 30002e00 31000000 44000000 00005600 0...1...D.....V. + 02f0 61007200 46006900 6c006500 49006e00 a.r.F.i.l.e.I.n. + 0300 66006f00 00000000 24000400 00005400 f.o.....$.....T. + 0310 72006100 6e007300 6c006100 74006900 r.a.n.s.l.a.t.i. + 0320 6f006e00 00000000 0704e404 o.n......... diff --git a/binutils/testsuite/binutils-all/windres/version_cat.rc b/binutils/testsuite/binutils-all/windres/version_cat.rc new file mode 100644 index 00000000000..5b70eada1e8 --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/version_cat.rc @@ -0,0 +1,33 @@ +//#xfail x86_64-*-mingw* +#include "windows.h" + +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL + FILEFLAGS 0x0L + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040704e4" + BEGIN + VALUE L"Company" "Name", L"binutil\x0073" + VALUE "File" "Description", L"RC " L"compiler." + VALUE "File" "Version", "1.0.0.1" + VALUE "Internal" "Name", "windres" L".exe" + VALUE "Legal" "Copyright", "(c) FSF." " All rights are reserved." + VALUE "Original" "Filename", L"windres" ".exe" + VALUE "Product" "Name", "windows resource " "compiler" + VALUE "Product" "Version", "1.0.0.1" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x407, 1252 + END +END diff --git a/binutils/testsuite/binutils-all/windres/version_cat.rsd b/binutils/testsuite/binutils-all/windres/version_cat.rsd new file mode 100644 index 00000000000..85dd5d35281 --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/version_cat.rsd @@ -0,0 +1,55 @@ + +version.res: file format binary + +Contents of section .data: + 0000 00000000 20000000 ffff0000 ffff0000 .... ........... + 0010 00000000 00000000 00000000 00000000 ................ + 0020 ec020000 20000000 ffff1000 ffff0100 .... ........... + 0030 00000000 00000704 00000000 00000000 ................ + 0040 ec023400 00005600 53005f00 56004500 ..4...V.S._.V.E. + 0050 52005300 49004f00 4e005f00 49004e00 R.S.I.O.N._.I.N. + 0060 46004f00 00000000 bd04effe 00000100 F.O............. + 0070 00000100 01000000 00000100 01000000 ................ + 0080 3f000000 00000000 04000000 01000000 ?............... + 0090 00000000 00000000 00000000 4c020000 ............L... + 00a0 00005300 74007200 69006e00 67004600 ..S.t.r.i.n.g.F. + 00b0 69006c00 65004900 6e006600 6f000000 i.l.e.I.n.f.o... + 00c0 28020000 00003000 34003000 37003000 (.....0.4.0.7.0. + 00d0 34006500 34000000 32000900 01004300 4.e.4...2.....C. + 00e0 6f006d00 70006100 6e007900 4e006100 o.m.p.a.n.y.N.a. + 00f0 6d006500 00000000 62006900 6e007500 m.e.....b.i.n.u. + 0100 74006900 6c007300 00000000 42000d00 t.i.l.s.....B... + 0110 01004600 69006c00 65004400 65007300 ..F.i.l.e.D.e.s. + 0120 63007200 69007000 74006900 6f006e00 c.r.i.p.t.i.o.n. + 0130 00000000 52004300 20006300 6f006d00 ....R.C. .c.o.m. + 0140 70006900 6c006500 72002e00 00000000 p.i.l.e.r....... + 0150 30000800 01004600 69006c00 65005600 0.....F.i.l.e.V. + 0160 65007200 73006900 6f006e00 00000000 e.r.s.i.o.n..... + 0170 31002e00 30002e00 30002e00 31000000 1...0...0...1... + 0180 38000c00 01004900 6e007400 65007200 8.....I.n.t.e.r. + 0190 6e006100 6c004e00 61006d00 65000000 n.a.l.N.a.m.e... + 01a0 77006900 6e006400 72006500 73002e00 w.i.n.d.r.e.s... + 01b0 65007800 65000000 68002200 01004c00 e.x.e...h."...L. + 01c0 65006700 61006c00 43006f00 70007900 e.g.a.l.C.o.p.y. + 01d0 72006900 67006800 74000000 28006300 r.i.g.h.t...(.c. + 01e0 29002000 46005300 46002e00 20004100 ). .F.S.F... .A. + 01f0 6c006c00 20007200 69006700 68007400 l.l. .r.i.g.h.t. + 0200 73002000 61007200 65002000 72006500 s. .a.r.e. .r.e. + 0210 73006500 72007600 65006400 2e000000 s.e.r.v.e.d..... + 0220 40000c00 01004f00 72006900 67006900 @.....O.r.i.g.i. + 0230 6e006100 6c004600 69006c00 65006e00 n.a.l.F.i.l.e.n. + 0240 61006d00 65000000 77006900 6e006400 a.m.e...w.i.n.d. + 0250 72006500 73002e00 65007800 65000000 r.e.s...e.x.e... + 0260 54001a00 01005000 72006f00 64007500 T.....P.r.o.d.u. + 0270 63007400 4e006100 6d006500 00000000 c.t.N.a.m.e..... + 0280 77006900 6e006400 6f007700 73002000 w.i.n.d.o.w.s. . + 0290 72006500 73006f00 75007200 63006500 r.e.s.o.u.r.c.e. + 02a0 20006300 6f006d00 70006900 6c006500 .c.o.m.p.i.l.e. + 02b0 72000000 34000800 01005000 72006f00 r...4.....P.r.o. + 02c0 64007500 63007400 56006500 72007300 d.u.c.t.V.e.r.s. + 02d0 69006f00 6e000000 31002e00 30002e00 i.o.n...1...0... + 02e0 30002e00 31000000 44000000 00005600 0...1...D.....V. + 02f0 61007200 46006900 6c006500 49006e00 a.r.F.i.l.e.I.n. + 0300 66006f00 00000000 24000400 00005400 f.o.....$.....T. + 0310 72006100 6e007300 6c006100 74006900 r.a.n.s.l.a.t.i. + 0320 6f006e00 00000000 0704e404 o.n......... diff --git a/binutils/testsuite/binutils-all/windres/windres.exp b/binutils/testsuite/binutils-all/windres/windres.exp index 4189c551a6f..eb825d0f736 100644 --- a/binutils/testsuite/binutils-all/windres/windres.exp +++ b/binutils/testsuite/binutils-all/windres/windres.exp @@ -1,4 +1,4 @@ -# Copyright 2001, 2003, 2004 Free Software Foundation, Inc. +# Copyright 2001, 2003, 2004, 2006 Free Software Foundation, Inc. # 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 @@ -19,13 +19,14 @@ # Written by DJ Delorie -if {![istarget "i*86-*-*"]} { +if {![istarget "i*86-*-*"] && ![istarget "x86_64-*-mingw*"] } { return } if {![istarget "i*86-*-*pe*"] \ && ![istarget "i*86-*-cygwin*"] \ - && ![istarget "i*86-*-mingw32*"] } { + && ![istarget "i*86-*-mingw32*"] \ + && ![istarget "x86_64-*-mingw*"] } { set target_xfail "yes" } else { set target_xfail "no" diff --git a/binutils/testsuite/lib/utils-lib.exp b/binutils/testsuite/lib/utils-lib.exp index f7970b29269..597437e6ffd 100644 --- a/binutils/testsuite/lib/utils-lib.exp +++ b/binutils/testsuite/lib/utils-lib.exp @@ -1,4 +1,4 @@ -# Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003, 2004 +# Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003, 2004, 2006 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -161,9 +161,508 @@ proc is_elf_format {} { # Returns target executable extension, if any. # proc exe_ext {} { - if { [istarget *-*-mingw32] || [istarget *-*-cygwin*] } { + if { [istarget *-*-mingw*] || [istarget *-*-cygwin*] } { return ".exe" } else { return "" } } + +# Copied and modified from gas. + +# run_dump_test FILE (optional:) EXTRA_OPTIONS +# +# Assemble a .s file, then run some utility on it and check the output. +# +# There should be an assembly language file named FILE.s in the test +# suite directory, and a pattern file called FILE.d. `run_dump_test' +# will assemble FILE.s, run some tool like `objdump', `objcopy', or +# `nm' on the .o file to produce textual output, and then analyze that +# with regexps. The FILE.d file specifies what program to run, and +# what to expect in its output. +# +# The FILE.d file begins with zero or more option lines, which specify +# flags to pass to the assembler, the program to run to dump the +# assembler's output, and the options it wants. The option lines have +# the syntax: +# +# # OPTION: VALUE +# +# OPTION is the name of some option, like "name" or "objdump", and +# VALUE is OPTION's value. The valid options are described below. +# Whitespace is ignored everywhere, except within VALUE. The option +# list ends with the first line that doesn't match the above syntax. +# However, a line within the options that begins with a #, but doesn't +# have a recognizable option name followed by a colon, is considered a +# comment and entirely ignored. +# +# The optional EXTRA_OPTIONS argument to `run_dump_test' is a list of +# two-element lists. The first element of each is an option name, and +# the second additional arguments to be added on to the end of the +# option list as given in FILE.d. (If omitted, no additional options +# are added.) +# +# The interesting options are: +# +# name: TEST-NAME +# The name of this test, passed to DejaGNU's `pass' and `fail' +# commands. If omitted, this defaults to FILE, the root of the +# .s and .d files' names. +# +# as: FLAGS +# When assembling FILE.s, pass FLAGS to the assembler. +# +# PROG: PROGRAM-NAME +# The name of the program to run to analyze the .o file produced +# by the assembler. This can be omitted; run_dump_test will guess +# which program to run by seeing which of the flags options below +# is present. +# +# objdump: FLAGS +# nm: FLAGS +# objcopy: FLAGS +# Use the specified program to analyze the .o file, and pass it +# FLAGS, in addition to the .o file name. Note that they are run +# with LC_ALL=C in the environment to give consistent sorting +# of symbols. +# +# source: SOURCE +# Assemble the file SOURCE.s. If omitted, this defaults to FILE.s. +# This is useful if several .d files want to share a .s file. +# +# target: GLOBS... +# Run this test only on a specified list of targets. More precisely, +# each glob in the space-separated list is passed to "istarget"; if +# it evaluates true for any of them, the test will be run, otherwise +# it will be marked unsupported. +# +# not-target: GLOBS... +# Do not run this test on a specified list of targets. Again, +# the each glob in the space-separated list is passed to +# "istarget", and the test is run if it evaluates *false* for +# *all* of them. Otherwise it will be marked unsupported. +# +# skip: GLOBS... +# not-skip: GLOBS... +# These are exactly the same as "not-target" and "target", +# respectively, except that they do nothing at all if the check +# fails. They should only be used in groups, to construct a single +# test which is run on all targets but with variant options or +# expected output on some targets. (For example, see +# gas/arm/inst.d and gas/arm/wince_inst.d.) +# +# error: REGEX +# An error with message matching REGEX must be emitted for the test +# to pass. The PROG, objdump, nm and objcopy options have no +# meaning and need not supplied if this is present. +# +# warning: REGEX +# Expect a gas warning matching REGEX. It is an error to issue +# both "error" and "warning". +# +# stderr: FILE +# FILE contains regexp lines to be matched against the diagnostic +# output of the assembler. This does not preclude the use of +# PROG, nm, objdump, or objcopy. +# +# error-output: FILE +# Means the same as 'stderr', but also indicates that the assembler +# is expected to exit unsuccessfully (therefore PROG, objdump, nm, +# and objcopy have no meaning and should not be supplied). +# +# Each option may occur at most once. +# +# After the option lines come regexp lines. `run_dump_test' calls +# `regexp_diff' to compare the output of the dumping tool against the +# regexps in FILE.d. `regexp_diff' is defined later in this file; see +# further comments there. + +proc run_dump_test { name {extra_options {}} } { + global subdir srcdir + global OBJDUMP NM OBJCOPY READELF STRIP + global OBJDUMPFLAGS NMFLAGS OBJCOPYFLAGS READELFFLAGS STRIPFLAGS + global host_triplet + global env + global copyfile + global tempfile + + if [string match "*/*" $name] { + set file $name + set name [file tail $name] + } else { + set file "$srcdir/$subdir/$name" + } + set opt_array [slurp_options "${file}.d"] + if { $opt_array == -1 } { + perror "error reading options from $file.d" + unresolved $subdir/$name + return + } + set opts(addr2line) {} + set opts(ar) {} + set opts(nm) {} + set opts(objcopy) {} + set opts(objdump) {} + set opts(strip) {} + set opts(ranlib) {} + set opts(readelf) {} + set opts(size) {} + set opts(strings) {} + set opts(name) {} + set opts(PROG) {} + set opts(DUMPPROG) {} + set opts(source) {} + set opts(target) {} + set opts(not-target) {} + set opts(skip) {} + set opts(not-skip) {} + + foreach i $opt_array { + set opt_name [lindex $i 0] + set opt_val [lindex $i 1] + if ![info exists opts($opt_name)] { + perror "unknown option $opt_name in file $file.d" + unresolved $subdir/$name + return + } + if [string length $opts($opt_name)] { + perror "option $opt_name multiply set in $file.d" + unresolved $subdir/$name + return + } + set opts($opt_name) $opt_val + } + + foreach i $extra_options { + set opt_name [lindex $i 0] + set opt_val [lindex $i 1] + if ![info exists opts($opt_name)] { + perror "unknown option $opt_name given in extra_opts" + unresolved $subdir/$name + return + } + # add extra option to end of existing option, adding space + # if necessary. + if [string length $opts($opt_name)] { + append opts($opt_name) " " + } + append opts($opt_name) $opt_val + } + + if { $opts(name) == "" } { + set testname "$subdir/$name" + } else { + set testname $opts(name) + } + verbose "Testing $testname" + + if {$opts(PROG) == ""} { + perror "program isn't set in $file.d" + unresolved $testname + return + } + + set destopt "" + switch -- $opts(PROG) { + ar { set program ar } + objcopy { set program objcopy } + ranlib { set program ranlib } + strip { + set program strip + set destopt "-o" + } + strings { set program strings } + default { + perror "unrecognized program option $opts(PROG) in $file.d" + unresolved $testname + return } + } + + set dumpprogram "" + if { $opts(DUMPPROG) != "" } { + switch -- $opts(DUMPPROG) { + addr2line { set dumpprogram addr2line } + nm { set dumpprogram nm } + objdump { set dumpprogram objdump } + readelf { set dumpprogram readelf } + size { set dumpprogram size } + default { + perror "unrecognized dump program option $opts(DUMPPROG) in $file.d" + unresolved $testname + return } + } + } else { + # Guess which program to run, by seeing which option was specified. + foreach p {objdump nm readelf} { + if {$opts($p) != ""} { + if {$dumpprogram != ""} { + perror "ambiguous dump program in $file.d" + unresolved $testname + return + } else { + set dumpprogram $p + } + } + } + } + + # Handle skipping the test on specified targets. + # You can have both skip/not-skip and target/not-target, but you can't + # have both skip and not-skip, or target and not-target, in the same file. + if { $opts(skip) != "" } then { + if { $opts(not-skip) != "" } then { + perror "$testname: mixing skip and not-skip directives is invalid" + unresolved $testname + return + } + foreach glob $opts(skip) { + if {[istarget $glob]} { return } + } + } + if { $opts(not-skip) != "" } then { + set skip 1 + foreach glob $opts(not-skip) { + if {[istarget $glob]} { + set skip 0 + break + } + } + if {$skip} { return } + } + if { $opts(target) != "" } then { + if { $opts(not-target) != "" } then { + perror "$testname: mixing target and not-target directives is invalid" + unresolved $testname + return + } + set skip 1 + foreach glob $opts(target) { + if {[istarget $glob]} { + set skip 0 + break + } + } + if {$skip} { + unsupported $testname + return + } + } + if { $opts(not-target) != "" } then { + foreach glob $opts(not-target) { + if {[istarget $glob]} { + unsupported $testname + return + } + } + } + + if { $opts(source) == "" } { + set srcfile ${file}.s + } else { + set srcfile $srcdir/$subdir/$opts(source) + } + + set exec_output [binutils_assemble ${srcfile} tmpdir/bintest.o] + if [string match "" $exec_output] then { + send_log "$exec_output\n" + verbose "$exec_output" + fail $testname + return + } + + set progopts1 $opts($program) + eval set progopts \$[string toupper $program]FLAGS + eval set binary \$[string toupper $program] + + set exec_output [binutils_run $binary "$progopts $progopts1 $tempfile $destopt ${copyfile}.o"] + if ![string match "" $exec_output] { + send_log "$exec_output\n" + verbose "$exec_output" + fail $testname + return + } + + set progopts1 $opts($dumpprogram) + eval set progopts \$[string toupper $dumpprogram]FLAGS + eval set binary \$[string toupper $dumpprogram] + + if { [which $binary] == 0 } { + untested $testname + return + } + + verbose "running $binary $progopts $progopts1" 3 + + set cmd "$binary $progopts $progopts1 ${copyfile}.o > tmpdir/dump.out" + + # Ensure consistent sorting of symbols + if {[info exists env(LC_ALL)]} { + set old_lc_all $env(LC_ALL) + } + set env(LC_ALL) "C" + send_log "$cmd\n" + catch "exec $cmd" comp_output + if {[info exists old_lc_all]} { + set env(LC_ALL) $old_lc_all + } else { + unset env(LC_ALL) + } + set comp_output [prune_warnings $comp_output] + if ![string match "" $comp_output] then { + send_log "$comp_output\n" + fail $testname + return + } + + verbose_eval {[file_contents "tmpdir/dump.out"]} 3 + if { [regexp_diff "tmpdir/dump.out" "${file}.d"] } then { + fail $testname + verbose "output is [file_contents "tmpdir/dump.out"]" 2 + return + } + + pass $testname +} + +proc slurp_options { file } { + if [catch { set f [open $file r] } x] { + #perror "couldn't open `$file': $x" + perror "$x" + return -1 + } + set opt_array {} + # whitespace expression + set ws {[ ]*} + set nws {[^ ]*} + # whitespace is ignored anywhere except within the options list; + # option names are alphabetic plus dash + set pat "^#${ws}(\[a-zA-Z-\]*)$ws:${ws}(.*)$ws\$" + while { [gets $f line] != -1 } { + set line [string trim $line] + # Whitespace here is space-tab. + if [regexp $pat $line xxx opt_name opt_val] { + # match! + lappend opt_array [list $opt_name $opt_val] + } elseif {![regexp "^#" $line ]} { + break + } + } + close $f + return $opt_array +} + +# regexp_diff, based on simple_diff taken from ld test suite +# compares two files line-by-line +# file1 contains strings, file2 contains regexps and #-comments +# blank lines are ignored in either file +# returns non-zero if differences exist +# +proc regexp_diff { file_1 file_2 } { + + set eof -1 + set end_1 0 + set end_2 0 + set differences 0 + set diff_pass 0 + + if [file exists $file_1] then { + set file_a [open $file_1 r] + } else { + perror "$file_1 doesn't exist" + return 1 + } + + if [file exists $file_2] then { + set file_b [open $file_2 r] + } else { + perror "$file_2 doesn't exist" + close $file_a + return 1 + } + + verbose " Regexp-diff'ing: $file_1 $file_2" 2 + + while { 1 } { + set line_a "" + set line_b "" + while { [string length $line_a] == 0 } { + if { [gets $file_a line_a] == $eof } { + set end_1 1 + break + } + } + while { [string length $line_b] == 0 || [string match "#*" $line_b] } { + if [ string match "#pass" $line_b ] { + set end_2 1 + set diff_pass 1 + break + } elseif [ string match "#..." $line_b ] { + if { [gets $file_b line_b] == $eof } { + set end_2 1 + set diff_pass 1 + break + } + verbose "looking for \"^$line_b$\"" 3 + while { ![regexp "^$line_b$" "$line_a"] } { + verbose "skipping \"$line_a\"" 3 + if { [gets $file_a line_a] == $eof } { + set end_1 1 + break + } + } + break + } + if { [gets $file_b line_b] == $eof } { + set end_2 1 + break + } + } + + if { $diff_pass } { + break + } elseif { $end_1 && $end_2 } { + break + } elseif { $end_1 } { + send_log "extra regexps in $file_2 starting with \"^$line_b$\"\nEOF from $file_1\n" + verbose "extra regexps in $file_2 starting with \"^$line_b$\"\nEOF from $file_1" 3 + set differences 1 + break + } elseif { $end_2 } { + send_log "extra lines in $file_1 starting with \"^$line_a$\"\nEOF from $file_2\n" + verbose "extra lines in $file_1 starting with \"^$line_a$\"\nEOF from $file_2\n" 3 + set differences 1 + break + } else { + verbose "regexp \"^$line_b$\"\nline \"$line_a\"" 3 + if ![regexp "^$line_b$" "$line_a"] { + send_log "regexp_diff match failure\n" + send_log "regexp \"^$line_b$\"\nline \"$line_a\"\n" + verbose "regexp_diff match failure\n" 3 + set differences 1 + } + } + } + + if { $differences == 0 && !$diff_pass && [eof $file_a] != [eof $file_b] } { + send_log "$file_1 and $file_2 are different lengths\n" + verbose "$file_1 and $file_2 are different lengths" 3 + set differences 1 + } + + close $file_a + close $file_b + + return $differences +} + +proc file_contents { filename } { + set file [open $filename r] + set contents [read $file] + close $file + return $contents +} + +proc verbose_eval { expr { level 1 } } { + global verbose + if $verbose>$level then { eval verbose "$expr" $level } +} diff --git a/binutils/version.c b/binutils/version.c index 2843e69f06b..b4a4c3d3e7e 100644 --- a/binutils/version.c +++ b/binutils/version.c @@ -1,6 +1,6 @@ /* version.c -- binutils version information - Copyright 1991, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1991, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -18,9 +18,8 @@ along with this program; if not, write to the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include "sysdep.h" #include "bfd.h" -#include "bfdver.h" #include "bucomm.h" /* Print the version number and copyright information, and exit. This @@ -32,7 +31,7 @@ print_version (const char *name) /* This output is intended to follow the GNU standards document. */ /* xgettext:c-format */ printf ("GNU %s %s\n", name, BFD_VERSION_STRING); - printf (_("Copyright 2005 Free Software Foundation, Inc.\n")); + printf (_("Copyright 2007 Free Software Foundation, Inc.\n")); printf (_("\ This program is free software; you may redistribute it under the terms of\n\ the GNU General Public License. This program has absolutely no warranty.\n")); diff --git a/binutils/windint.h b/binutils/windint.h new file mode 100644 index 00000000000..b46f857a7a8 --- /dev/null +++ b/binutils/windint.h @@ -0,0 +1,1088 @@ +/* windint.h -- internal header file for windres program. + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007 + Free Software Foundation, Inc. + Written by Kai Tietz, Onevision. + + This file is part of 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 2 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 "winduni.h" + +#ifndef WINDINT_H +#define WINDINT_H + +/* Use bfd_size_type to ensure a sufficient number of bits. */ +#ifndef DEFINED_RC_UINT_TYPE +#define DEFINED_RC_UINT_TYPE +typedef bfd_size_type rc_uint_type; +#endif + +/* Resource directory structure. */ + +typedef struct res_hdr +{ + rc_uint_type data_size; + rc_uint_type header_size; +} res_hdr; + +struct __attribute__ ((__packed__)) bin_res_hdr +{ + bfd_byte data_size[4]; + bfd_byte header_size[4]; +}; +#define BIN_RES_HDR_SIZE 8 + +struct __attribute__ ((__packed__)) bin_res_id +{ + bfd_byte sig[2]; /* Has to be 0xffff for unnamed ids. */ + bfd_byte id[2]; +}; +#define BIN_RES_ID 4 + +/* This structure is used when converting resource information to + binary. */ + +typedef struct bindata +{ + /* Next data. */ + struct bindata *next; + /* Length of data. */ + rc_uint_type length; + /* Data. */ + bfd_byte *data; +} bindata; + +/* This structure is used when converting resource information to + coff. */ +typedef struct coff_res_data +{ + /* Next data. */ + struct coff_res_data *next; + /* Length of data. */ + rc_uint_type length; + /* Data. */ + const struct rc_res_resource *res; +} coff_res_data; + +/* We represent resources internally as a tree, similar to the tree + used in the .rsrc section of a COFF file. The root is a + rc_res_directory structure. */ + +typedef struct rc_res_directory +{ + /* Resource flags. According to the MS docs, this is currently + always zero. */ + rc_uint_type characteristics; + /* Time/date stamp. */ + rc_uint_type time; + /* Major version number. */ + rc_uint_type major; + /* Minor version number. */ + rc_uint_type minor; + /* Directory entries. */ + struct rc_res_entry *entries; +} rc_res_directory; + +/* A resource ID is stored in a rc_res_id structure. */ + +typedef struct rc_res_id +{ + /* Non-zero if this entry has a name rather than an ID. */ + rc_uint_type named : 1; + union + { + /* If the named field is non-zero, this is the name. */ + struct + { + /* Length of the name. */ + rc_uint_type length; + /* Pointer to the name, which is a Unicode string. */ + unichar *name; + } n; + /* If the named field is zero, this is the ID. */ + rc_uint_type id; + } u; +} rc_res_id; + +/* Each entry in the tree is a rc_res_entry structure. We mix + directories and resources because in a COFF file all entries in a + directory are sorted together, whether the entries are + subdirectories or resources. */ + +typedef struct rc_res_entry +{ + /* Next entry. */ + struct rc_res_entry *next; + /* Resource ID. */ + rc_res_id id; + /* Non-zero if this entry is a subdirectory rather than a leaf. */ + rc_uint_type subdir : 1; + union + { + /* If the subdir field is non-zero, this is a pointer to the + subdirectory. */ + rc_res_directory *dir; + /* If the subdir field is zero, this is a pointer to the resource + data. */ + struct rc_res_resource *res; + } u; +} rc_res_entry; + +/* Types of resources. */ + +enum rc_res_type +{ + RES_TYPE_UNINITIALIZED, + RES_TYPE_ACCELERATOR, + RES_TYPE_BITMAP, + RES_TYPE_CURSOR, + RES_TYPE_GROUP_CURSOR, + RES_TYPE_DIALOG, + RES_TYPE_FONT, + RES_TYPE_FONTDIR, + RES_TYPE_ICON, + RES_TYPE_GROUP_ICON, + RES_TYPE_MENU, + RES_TYPE_MESSAGETABLE, + RES_TYPE_RCDATA, + RES_TYPE_STRINGTABLE, + RES_TYPE_USERDATA, + RES_TYPE_VERSIONINFO, + RES_TYPE_DLGINCLUDE, + RES_TYPE_PLUGPLAY, + RES_TYPE_VXD, + RES_TYPE_ANICURSOR, + RES_TYPE_ANIICON, + RES_TYPE_DLGINIT, + RES_TYPE_TOOLBAR +}; + +/* A res file and a COFF file store information differently. The + res_info structures holds data which in a res file is stored with + each resource, but in a COFF file is stored elsewhere. */ + +typedef struct rc_res_res_info +{ + /* Language. In a COFF file, the third level of the directory is + keyed by the language, so the language of a resource is defined + by its location in the resource tree. */ + rc_uint_type language; + /* Characteristics of the resource. Entirely user defined. In a + COFF file, the rc_res_directory structure has a characteristics + field, but I don't know if it's related to the one in the res + file. */ + rc_uint_type characteristics; + /* Version of the resource. Entirely user defined. In a COFF file, + the rc_res_directory structure has a characteristics field, but I + don't know if it's related to the one in the res file. */ + rc_uint_type version; + /* Memory flags. This is a combination of the MEMFLAG values + defined below. Most of these values are historical, and are not + meaningful for win32. I don't think there is any way to store + this information in a COFF file. */ + rc_uint_type memflags; +} rc_res_res_info; + +/* Binary layout of rc_res_info. */ + +struct __attribute__ ((__packed__)) bin_res_info +{ + bfd_byte version[4]; + bfd_byte memflags[2]; + bfd_byte language[2]; + bfd_byte version2[4]; + bfd_byte characteristics[4]; +}; +#define BIN_RES_INFO_SIZE 16 + +/* Each resource in a COFF file has some information which can does + not appear in a res file. */ + +typedef struct rc_res_coff_info +{ + /* The code page used for the data. I don't really know what this + should be. It has something todo with ASCII to Unicode encoding. */ + rc_uint_type codepage; + /* A resource entry in a COFF file has a reserved field, which we + record here when reading a COFF file. When writing a COFF file, + we set this field to zero. */ + rc_uint_type reserved; +} rc_res_coff_info; + +/* Resource data is stored in a rc_res_resource structure. */ + +typedef struct rc_res_resource +{ + /* The type of resource. */ + enum rc_res_type type; + /* The data for the resource. */ + union + { + struct + { + rc_uint_type length; + const bfd_byte *data; + } data; + struct rc_accelerator *acc; + struct rc_cursor *cursor; + struct rc_group_cursor *group_cursor; + struct rc_dialog *dialog; + struct rc_fontdir *fontdir; + struct rc_group_icon *group_icon; + struct rc_menu *menu; + struct rc_rcdata_item *rcdata; + struct rc_stringtable *stringtable; + struct rc_rcdata_item *userdata; + struct rc_versioninfo *versioninfo; + struct rc_toolbar *toolbar; + } u; + /* Information from a res file. */ + struct rc_res_res_info res_info; + /* Information from a COFF file. */ + rc_res_coff_info coff_info; +} rc_res_resource; + +#define SUBLANG_SHIFT 10 + +/* Memory flags in the memflags field of a rc_res_resource. */ + +#define MEMFLAG_MOVEABLE 0x10 +#define MEMFLAG_PURE 0x20 +#define MEMFLAG_PRELOAD 0x40 +#define MEMFLAG_DISCARDABLE 0x1000 + +/* Standard resource type codes. These are used in the ID field of a + rc_res_entry structure. */ + +#define RT_CURSOR 1 +#define RT_BITMAP 2 +#define RT_ICON 3 +#define RT_MENU 4 +#define RT_DIALOG 5 +#define RT_STRING 6 +#define RT_FONTDIR 7 +#define RT_FONT 8 +#define RT_ACCELERATOR 9 +#define RT_RCDATA 10 +#define RT_MESSAGETABLE 11 +#define RT_GROUP_CURSOR 12 +#define RT_GROUP_ICON 14 +#define RT_VERSION 16 +#define RT_DLGINCLUDE 17 +#define RT_PLUGPLAY 19 +#define RT_VXD 20 +#define RT_ANICURSOR 21 +#define RT_ANIICON 22 +#define RT_HTML 23 +#define RT_MANIFEST 24 +#define RT_DLGINIT 240 +#define RT_TOOLBAR 241 + +/* An accelerator resource is a linked list of these structures. */ + +typedef struct rc_accelerator +{ + /* Next accelerator. */ + struct rc_accelerator *next; + /* Flags. A combination of the ACC values defined below. */ + rc_uint_type flags; + /* Key value. */ + rc_uint_type key; + /* Resource ID. */ + rc_uint_type id; +} rc_accelerator; + +struct __attribute__ ((__packed__)) bin_accelerator +{ + bfd_byte flags[2]; + bfd_byte key[2]; + bfd_byte id[2]; + bfd_byte pad[2]; +}; +#define BIN_ACCELERATOR_SIZE 8 + +/* Accelerator flags in the flags field of a rc_accelerator. + These are the same values that appear in a res file. I hope. */ + +#define ACC_VIRTKEY 0x01 +#define ACC_NOINVERT 0x02 +#define ACC_SHIFT 0x04 +#define ACC_CONTROL 0x08 +#define ACC_ALT 0x10 +#define ACC_LAST 0x80 + +/* A cursor resource. */ + +typedef struct rc_cursor +{ + /* X coordinate of hotspot. */ + bfd_signed_vma xhotspot; + /* Y coordinate of hotspot. */ + bfd_signed_vma yhotspot; + /* Length of bitmap data. */ + rc_uint_type length; + /* Data. */ + const bfd_byte *data; +} rc_cursor; + +struct __attribute__ ((__packed__)) bin_cursor +{ + bfd_byte xhotspot[2]; + bfd_byte yhotspot[2]; +}; +#define BIN_CURSOR_SIZE 4 + +/* A group_cursor resource is a list of rc_i_group_cursor structures. */ + +typedef struct rc_group_cursor +{ + /* Next cursor in group. */ + struct rc_group_cursor *next; + /* Width. */ + rc_uint_type width; + /* Height. */ + rc_uint_type height; + /* Planes. */ + rc_uint_type planes; + /* Bits per pixel. */ + rc_uint_type bits; + /* Number of bytes in cursor resource. */ + rc_uint_type bytes; + /* Index of cursor resource. */ + rc_uint_type index; +} rc_group_cursor; + +struct __attribute__ ((__packed__)) bin_group_cursor_item +{ + bfd_byte width[2]; + bfd_byte height[2]; + bfd_byte planes[2]; + bfd_byte bits[2]; + bfd_byte bytes[4]; + bfd_byte index[2]; +}; +#define BIN_GROUP_CURSOR_ITEM_SIZE 14 + +struct __attribute__ ((__packed__)) bin_group_cursor +{ + bfd_byte sig1[2]; + bfd_byte sig2[2]; + bfd_byte nitems[2]; + /* struct bin_group_cursor_item item[nitems]; */ +}; +#define BIN_GROUP_CURSOR_SIZE 6 + +/* A dialog resource. */ + +typedef struct rc_dialog +{ + /* Basic window style. */ + unsigned int style; + /* Extended window style. */ + rc_uint_type exstyle; + /* X coordinate. */ + rc_uint_type x; + /* Y coordinate. */ + rc_uint_type y; + /* Width. */ + rc_uint_type width; + /* Height. */ + rc_uint_type height; + /* Menu name. */ + rc_res_id menu; + /* Class name. */ + rc_res_id class; + /* Caption. */ + unichar *caption; + /* Font point size. */ + rc_uint_type pointsize; + /* Font name. */ + unichar *font; + /* Extended information for a dialogex. */ + struct rc_dialog_ex *ex; + /* Controls. */ + struct rc_dialog_control *controls; +} rc_dialog; + +struct __attribute__ ((__packed__)) bin_dialog +{ + bfd_byte style[4]; + bfd_byte exstyle[4]; + bfd_byte off[2]; + bfd_byte x[2]; + bfd_byte y[2]; + bfd_byte width[2]; + bfd_byte height[2]; +}; +#define BIN_DIALOG_SIZE 18 + +/* An extended dialog has additional information. */ + +typedef struct rc_dialog_ex +{ + /* Help ID. */ + rc_uint_type help; + /* Font weight. */ + rc_uint_type weight; + /* Whether the font is italic. */ + bfd_byte italic; + /* Character set. */ + bfd_byte charset; +} rc_dialog_ex; + +struct __attribute__ ((__packed__)) bin_dialogex +{ + bfd_byte sig1[2]; + bfd_byte sig2[2]; + bfd_byte help[4]; + bfd_byte exstyle[4]; + bfd_byte style[4]; + bfd_byte off[2]; + bfd_byte x[2]; + bfd_byte y[2]; + bfd_byte width[2]; + bfd_byte height[2]; +}; +#define BIN_DIALOGEX_SIZE 26 + +struct __attribute__ ((__packed__)) bin_dialogfont +{ + bfd_byte pointsize[2]; +}; +#define BIN_DIALOGFONT_SIZE 2 + +struct __attribute__ ((__packed__)) bin_dialogexfont +{ + bfd_byte pointsize[2]; + bfd_byte weight[2]; + bfd_byte italic[1]; + bfd_byte charset[1]; +}; +#define BIN_DIALOGEXFONT_SIZE 6 + +/* Window style flags, from the winsup Defines.h header file. These + can appear in the style field of a rc_dialog or a rc_dialog_control. */ + +#define CW_USEDEFAULT 0x80000000 +#define WS_BORDER 0x800000L +#define WS_CAPTION 0xc00000L +#define WS_CHILD 0x40000000L +#define WS_CHILDWINDOW 0x40000000L +#define WS_CLIPCHILDREN 0x2000000L +#define WS_CLIPSIBLINGS 0x4000000L +#define WS_DISABLED 0x8000000L +#define WS_DLGFRAME 0x400000L +#define WS_GROUP 0x20000L +#define WS_HSCROLL 0x100000L +#define WS_ICONIC 0x20000000L +#define WS_MAXIMIZE 0x1000000L +#define WS_MAXIMIZEBOX 0x10000L +#define WS_MINIMIZE 0x20000000L +#define WS_MINIMIZEBOX 0x20000L +#define WS_OVERLAPPED 0L +#define WS_OVERLAPPEDWINDOW 0xcf0000L +#define WS_POPUP 0x80000000L +#define WS_POPUPWINDOW 0x80880000L +#define WS_SIZEBOX 0x40000L +#define WS_SYSMENU 0x80000L +#define WS_TABSTOP 0x10000L +#define WS_THICKFRAME 0x40000L +#define WS_TILED 0L +#define WS_TILEDWINDOW 0xcf0000L +#define WS_VISIBLE 0x10000000L +#define WS_VSCROLL 0x200000L +#define MDIS_ALLCHILDSTYLES 0x1 +#define BS_3STATE 0x5L +#define BS_AUTO3STATE 0x6L +#define BS_AUTOCHECKBOX 0x3L +#define BS_AUTORADIOBUTTON 0x9L +#define BS_BITMAP 0x80L +#define BS_BOTTOM 0x800L +#define BS_CENTER 0x300L +#define BS_CHECKBOX 0x2L +#define BS_DEFPUSHBUTTON 0x1L +#define BS_GROUPBOX 0x7L +#define BS_ICON 0x40L +#define BS_LEFT 0x100L +#define BS_LEFTTEXT 0x20L +#define BS_MULTILINE 0x2000L +#define BS_NOTIFY 0x4000L +#define BS_OWNERDRAW 0xbL +#define BS_PUSHBOX 0xcL /* FIXME! What should this be? */ +#define BS_PUSHBUTTON 0L +#define BS_PUSHLIKE 0x1000L +#define BS_RADIOBUTTON 0x4L +#define BS_RIGHT 0x200L +#define BS_RIGHTBUTTON 0x20L +#define BS_TEXT 0L +#define BS_TOP 0x400L +#define BS_USERBUTTON 0x8L +#define BS_VCENTER 0xc00L +#define CBS_AUTOHSCROLL 0x40L +#define CBS_DISABLENOSCROLL 0x800L +#define CBS_DROPDOWN 0x2L +#define CBS_DROPDOWNLIST 0x3L +#define CBS_HASSTRINGS 0x200L +#define CBS_LOWERCASE 0x4000L +#define CBS_NOINTEGRALHEIGHT 0x400L +#define CBS_OEMCONVERT 0x80L +#define CBS_OWNERDRAWFIXED 0x10L +#define CBS_OWNERDRAWVARIABLE 0x20L +#define CBS_SIMPLE 0x1L +#define CBS_SORT 0x100L +#define CBS_UPPERCASE 0x2000L +#define ES_AUTOHSCROLL 0x80L +#define ES_AUTOVSCROLL 0x40L +#define ES_CENTER 0x1L +#define ES_LEFT 0L +#define ES_LOWERCASE 0x10L +#define ES_MULTILINE 0x4L +#define ES_NOHIDESEL 0x100L +#define ES_NUMBER 0x2000L +#define ES_OEMCONVERT 0x400L +#define ES_PASSWORD 0x20L +#define ES_READONLY 0x800L +#define ES_RIGHT 0x2L +#define ES_UPPERCASE 0x8L +#define ES_WANTRETURN 0x1000L +#define LBS_DISABLENOSCROLL 0x1000L +#define LBS_EXTENDEDSEL 0x800L +#define LBS_HASSTRINGS 0x40L +#define LBS_MULTICOLUMN 0x200L +#define LBS_MULTIPLESEL 0x8L +#define LBS_NODATA 0x2000L +#define LBS_NOINTEGRALHEIGHT 0x100L +#define LBS_NOREDRAW 0x4L +#define LBS_NOSEL 0x4000L +#define LBS_NOTIFY 0x1L +#define LBS_OWNERDRAWFIXED 0x10L +#define LBS_OWNERDRAWVARIABLE 0x20L +#define LBS_SORT 0x2L +#define LBS_STANDARD 0xa00003L +#define LBS_USETABSTOPS 0x80L +#define LBS_WANTKEYBOARDINPUT 0x400L +#define SBS_BOTTOMALIGN 0x4L +#define SBS_HORZ 0L +#define SBS_LEFTALIGN 0x2L +#define SBS_RIGHTALIGN 0x4L +#define SBS_SIZEBOX 0x8L +#define SBS_SIZEBOXBOTTOMRIGHTALIGN 0x4L +#define SBS_SIZEBOXTOPLEFTALIGN 0x2L +#define SBS_SIZEGRIP 0x10L +#define SBS_TOPALIGN 0x2L +#define SBS_VERT 0x1L +#define SS_BITMAP 0xeL +#define SS_BLACKFRAME 0x7L +#define SS_BLACKRECT 0x4L +#define SS_CENTER 0x1L +#define SS_CENTERIMAGE 0x200L +#define SS_ENHMETAFILE 0xfL +#define SS_ETCHEDFRAME 0x12L +#define SS_ETCHEDHORZ 0x10L +#define SS_ETCHEDVERT 0x11L +#define SS_GRAYFRAME 0x8L +#define SS_GRAYRECT 0x5L +#define SS_ICON 0x3L +#define SS_LEFT 0L +#define SS_LEFTNOWORDWRAP 0xcL +#define SS_NOPREFIX 0x80L +#define SS_NOTIFY 0x100L +#define SS_OWNERDRAW 0xdL +#define SS_REALSIZEIMAGE 0x800L +#define SS_RIGHT 0x2L +#define SS_RIGHTJUST 0x400L +#define SS_SIMPLE 0xbL +#define SS_SUNKEN 0x1000L +#define SS_USERITEM 0xaL +#define SS_WHITEFRAME 0x9L +#define SS_WHITERECT 0x6L +#define DS_3DLOOK 0x4L +#define DS_ABSALIGN 0x1L +#define DS_CENTER 0x800L +#define DS_CENTERMOUSE 0x1000L +#define DS_CONTEXTHELP 0x2000L +#define DS_CONTROL 0x400L +#define DS_FIXEDSYS 0x8L +#define DS_LOCALEDIT 0x20L +#define DS_MODALFRAME 0x80L +#define DS_NOFAILCREATE 0x10L +#define DS_NOIDLEMSG 0x100L +#define DS_SETFONT 0x40L +#define DS_SETFOREGROUND 0x200L +#define DS_SYSMODAL 0x2L + +/* A dialog control. */ + +typedef struct rc_dialog_control +{ + /* Next control. */ + struct rc_dialog_control *next; + /* ID. */ + rc_uint_type id; + /* Style. */ + rc_uint_type style; + /* Extended style. */ + rc_uint_type exstyle; + /* X coordinate. */ + rc_uint_type x; + /* Y coordinate. */ + rc_uint_type y; + /* Width. */ + rc_uint_type width; + /* Height. */ + rc_uint_type height; + /* Class name. */ + rc_res_id class; + /* Associated text. */ + rc_res_id text; + /* Extra data for the window procedure. */ + struct rc_rcdata_item *data; + /* Help ID. Only used in an extended dialog. */ + rc_uint_type help; +} rc_dialog_control; + +struct __attribute__ ((__packed__)) bin_dialog_control +{ + bfd_byte style[4]; + bfd_byte exstyle[4]; + bfd_byte x[2]; + bfd_byte y[2]; + bfd_byte width[2]; + bfd_byte height[2]; + bfd_byte id[2]; +}; +#define BIN_DIALOG_CONTROL_SIZE 18 + +struct __attribute__ ((__packed__)) bin_dialogex_control +{ + bfd_byte help[4]; + bfd_byte exstyle[4]; + bfd_byte style[4]; + bfd_byte x[2]; + bfd_byte y[2]; + bfd_byte width[2]; + bfd_byte height[2]; + bfd_byte id[4]; +}; +#define BIN_DIALOGEX_CONTROL_SIZE 24 + +/* Control classes. These can be used as the ID field in a rc_dialog_control. */ + +#define CTL_BUTTON 0x80 +#define CTL_EDIT 0x81 +#define CTL_STATIC 0x82 +#define CTL_LISTBOX 0x83 +#define CTL_SCROLLBAR 0x84 +#define CTL_COMBOBOX 0x85 + +/* A fontdir resource is a list of rc_fontdir. */ + +typedef struct rc_fontdir +{ + struct rc_fontdir *next; + /* Index of font entry. */ + rc_uint_type index; + /* Length of font information. */ + rc_uint_type length; + /* Font information. */ + const bfd_byte *data; +} rc_fontdir; + +struct __attribute__ ((__packed__)) bin_fontdir_item +{ + bfd_byte index[2]; + bfd_byte header[54]; + bfd_byte device_name[1]; + /* bfd_byte face_name[]; */ +}; + +/* A group_icon resource is a list of rc_group_icon. */ + +typedef struct rc_group_icon +{ + /* Next icon in group. */ + struct rc_group_icon *next; + /* Width. */ + bfd_byte width; + /* Height. */ + bfd_byte height; + /* Color count. */ + bfd_byte colors; + /* Planes. */ + rc_uint_type planes; + /* Bits per pixel. */ + rc_uint_type bits; + /* Number of bytes in cursor resource. */ + rc_uint_type bytes; + /* Index of cursor resource. */ + rc_uint_type index; +} rc_group_icon; + +struct __attribute__ ((__packed__)) bin_group_icon +{ + bfd_byte sig1[2]; + bfd_byte sig2[2]; + bfd_byte count[2]; +}; +#define BIN_GROUP_ICON_SIZE 6 + +struct __attribute__ ((__packed__)) bin_group_icon_item +{ + bfd_byte width[1]; + bfd_byte height[1]; + bfd_byte colors[1]; + bfd_byte pad[1]; + bfd_byte planes[2]; + bfd_byte bits[2]; + bfd_byte bytes[4]; + bfd_byte index[2]; +}; +#define BIN_GROUP_ICON_ITEM_SIZE 14 + +/* A menu resource. */ + +typedef struct rc_menu +{ + /* List of menuitems. */ + struct rc_menuitem *items; + /* Help ID. I don't think there is any way to set this in an rc + file, but it can appear in the binary format. */ + rc_uint_type help; +} rc_menu; + +struct __attribute__ ((__packed__)) bin_menu +{ + bfd_byte sig1[2]; + bfd_byte sig2[2]; +}; +#define BIN_MENU_SIZE 4 + +struct __attribute__ ((__packed__)) bin_menuex +{ + bfd_byte sig1[2]; + bfd_byte sig2[2]; + bfd_byte help[4]; +}; +#define BIN_MENUEX_SIZE 8 + +/* A menu resource is a list of rc_menuitem. */ + +typedef struct rc_menuitem +{ + /* Next menu item. */ + struct rc_menuitem *next; + /* Type. In a normal menu, rather than a menuex, this is the flags + field. */ + rc_uint_type type; + /* State. This is only used in a menuex. */ + rc_uint_type state; + /* Id. */ + rc_uint_type id; + /* Unicode text. */ + unichar *text; + /* Popup menu items for a popup. */ + struct rc_menuitem *popup; + /* Help ID. This is only used in a menuex. */ + rc_uint_type help; +} rc_menuitem; + +struct __attribute__ ((__packed__)) bin_menuitem +{ + bfd_byte flags[2]; + bfd_byte id[2]; +}; +#define BIN_MENUITEM_SIZE 4 +#define BIN_MENUITEM_POPUP_SIZE 2 + +struct __attribute__ ((__packed__)) bin_menuitemex +{ + bfd_byte type[4]; + bfd_byte state[4]; + bfd_byte id[4]; + bfd_byte flags[2]; + /* unicode text */ + /* if popup: align, bfd_byte help[4], align, bin_menuitemex[]; */ +}; +#define BIN_MENUITEMEX_SIZE 14 + +/* Menu item flags. These can appear in the flags field of a rc_menuitem. */ + +#define MENUITEM_GRAYED 0x001 +#define MENUITEM_INACTIVE 0x002 +#define MENUITEM_BITMAP 0x004 +#define MENUITEM_OWNERDRAW 0x100 +#define MENUITEM_CHECKED 0x008 +#define MENUITEM_POPUP 0x010 +#define MENUITEM_MENUBARBREAK 0x020 +#define MENUITEM_MENUBREAK 0x040 +#define MENUITEM_ENDMENU 0x080 +#define MENUITEM_HELP 0x4000 + +/* An rcdata resource is a pointer to a list of rc_rcdata_item. */ + +typedef struct rc_rcdata_item +{ + /* Next data item. */ + struct rc_rcdata_item *next; + /* Type of data. */ + enum + { + RCDATA_WORD, + RCDATA_DWORD, + RCDATA_STRING, + RCDATA_WSTRING, + RCDATA_BUFFER + } type; + union + { + rc_uint_type word; + rc_uint_type dword; + struct + { + rc_uint_type length; + const char *s; + } string; + struct + { + rc_uint_type length; + const unichar *w; + } wstring; + struct + { + rc_uint_type length; + const bfd_byte *data; + } buffer; + } u; +} rc_rcdata_item; + +/* A stringtable resource is a pointer to a rc_stringtable. */ + +typedef struct rc_stringtable +{ + /* Each stringtable resource is a list of 16 unicode strings. */ + struct + { + /* Length of string. */ + rc_uint_type length; + /* String data if length > 0. */ + unichar *string; + } strings[16]; +} rc_stringtable; + +/* A versioninfo resource points to a rc_versioninfo. */ + +typedef struct rc_versioninfo +{ + /* Fixed version information. */ + struct rc_fixed_versioninfo *fixed; + /* Variable version information. */ + struct rc_ver_info *var; +} rc_versioninfo; + +struct __attribute__ ((__packed__)) bin_versioninfo +{ + bfd_byte size[2]; + bfd_byte fixed_size[2]; + bfd_byte sig2[2]; +}; +#define BIN_VERSIONINFO_SIZE 6 + +/* The fixed portion of a versioninfo resource. */ + +typedef struct rc_fixed_versioninfo +{ + /* The file version, which is two 32 bit integers. */ + rc_uint_type file_version_ms; + rc_uint_type file_version_ls; + /* The product version, which is two 32 bit integers. */ + rc_uint_type product_version_ms; + rc_uint_type product_version_ls; + /* The file flags mask. */ + rc_uint_type file_flags_mask; + /* The file flags. */ + rc_uint_type file_flags; + /* The OS type. */ + rc_uint_type file_os; + /* The file type. */ + rc_uint_type file_type; + /* The file subtype. */ + rc_uint_type file_subtype; + /* The date, which in Windows is two 32 bit integers. */ + rc_uint_type file_date_ms; + rc_uint_type file_date_ls; +} rc_fixed_versioninfo; + +struct __attribute__ ((__packed__)) bin_fixed_versioninfo +{ + bfd_byte sig1[4]; + bfd_byte sig2[4]; + bfd_byte file_version[4]; + bfd_byte file_version_ls[4]; + bfd_byte product_version_ms[4]; + bfd_byte product_version_ls[4]; + bfd_byte file_flags_mask[4]; + bfd_byte file_flags[4]; + bfd_byte file_os[4]; + bfd_byte file_type[4]; + bfd_byte file_subtype[4]; + bfd_byte file_date_ms[4]; + bfd_byte file_date_ls[4]; +}; +#define BIN_FIXED_VERSIONINFO_SIZE 52 + +/* A list of variable version information. */ + +typedef struct rc_ver_info +{ + /* Next item. */ + struct rc_ver_info *next; + /* Type of data. */ + enum { VERINFO_STRING, VERINFO_VAR } type; + union + { + /* StringFileInfo data. */ + struct + { + /* Language. */ + unichar *language; + /* Strings. */ + struct rc_ver_stringinfo *strings; + } string; + /* VarFileInfo data. */ + struct + { + /* Key. */ + unichar *key; + /* Values. */ + struct rc_ver_varinfo *var; + } var; + } u; +} rc_ver_info; + +struct __attribute__ ((__packed__)) bin_ver_info +{ + bfd_byte size[2]; + bfd_byte sig1[2]; + bfd_byte sig2[2]; +}; +#define BIN_VER_INFO_SIZE 6 + +/* A list of string version information. */ + +typedef struct rc_ver_stringinfo +{ + /* Next string. */ + struct rc_ver_stringinfo *next; + /* Key. */ + unichar *key; + /* Value. */ + unichar *value; +} rc_ver_stringinfo; + +/* A list of variable version information. */ + +typedef struct rc_ver_varinfo +{ + /* Next item. */ + struct rc_ver_varinfo *next; + /* Language ID. */ + rc_uint_type language; + /* Character set ID. */ + rc_uint_type charset; +} rc_ver_varinfo; + +typedef struct rc_toolbar_item +{ + struct rc_toolbar_item *next; + struct rc_toolbar_item *prev; + rc_res_id id; +} rc_toolbar_item; + +struct __attribute__ ((__packed__)) bin_messagetable_item +{ + bfd_byte length[2]; + bfd_byte flags[2]; + bfd_byte data[1]; +}; +#define BIN_MESSAGETABLE_ITEM_SIZE 4 + +#define MESSAGE_RESOURCE_UNICODE 0x0001 + +struct __attribute__ ((__packed__)) bin_messagetable_block +{ + bfd_byte lowid[4]; + bfd_byte highid[4]; + bfd_byte offset[4]; +}; +#define BIN_MESSAGETABLE_BLOCK_SIZE 12 + +struct __attribute__ ((__packed__)) bin_messagetable +{ + bfd_byte cblocks[4]; + struct bin_messagetable_block items[1]; +}; +#define BIN_MESSAGETABLE_SIZE 8 + +typedef struct rc_toolbar +{ + rc_uint_type button_width; + rc_uint_type button_height; + rc_uint_type nitems; + rc_toolbar_item *items; +} rc_toolbar; + +struct __attribute__ ((__packed__)) bin_toolbar +{ + bfd_byte button_width[4]; + bfd_byte button_height[4]; + bfd_byte nitems[4]; + /* { bfd_byte id[4]; } * nitems; */ +}; +#define BIN_TOOLBAR_SIZE 12 + +extern int target_is_bigendian; + +typedef struct windres_bfd +{ + bfd *abfd; + asection *sec; + rc_uint_type kind : 4; +} windres_bfd; + +#define WR_KIND_TARGET 0 +#define WR_KIND_BFD 1 +#define WR_KIND_BFD_BIN_L 2 +#define WR_KIND_BFD_BIN_B 3 + +#define WR_KIND(PTR) (PTR)->kind +#define WR_SECTION(PTR) (PTR)->sec +#define WR_BFD(PTR) (PTR)->abfd + +extern void set_windres_bfd_content (windres_bfd *, const void *, rc_uint_type, rc_uint_type); +extern void get_windres_bfd_content (windres_bfd *, void *, rc_uint_type, rc_uint_type); + +extern void windres_put_8 (windres_bfd *, void *, rc_uint_type); +extern void windres_put_16 (windres_bfd *, void *, rc_uint_type); +extern void windres_put_32 (windres_bfd *, void *, rc_uint_type); +extern rc_uint_type windres_get_8 (windres_bfd *, const void *, rc_uint_type); +extern rc_uint_type windres_get_16 (windres_bfd *, const void *, rc_uint_type); +extern rc_uint_type windres_get_32 (windres_bfd *, const void *, rc_uint_type); + +extern void set_windres_bfd (windres_bfd *, bfd *, asection *, rc_uint_type); +extern void set_windres_bfd_endianess (windres_bfd *, int); + +#endif diff --git a/binutils/windmc.c b/binutils/windmc.c new file mode 100644 index 00000000000..5465b351cd7 --- /dev/null +++ b/binutils/windmc.c @@ -0,0 +1,1197 @@ +/* windmc.c -- a program to compile Windows message files. + Copyright 2007 + Free Software Foundation, Inc. + Written by Kai Tietz, Onevision. + + This file is part of 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 2 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. */ + +/* This program can read and comile Windows message format. + + It is based on information taken from the following sources: + + * Microsoft documentation. + + * The wmc program, written by Bertho A. Stultiens (BS). */ + +#include "sysdep.h" +#include +#include +#include "bfd.h" +#include "getopt.h" +#include "bucomm.h" +#include "libiberty.h" +#include "safe-ctype.h" +#include "obstack.h" + +#include "windmc.h" +#include "windint.h" + +/* Defines a message compiler element item with length and offset + information. */ +typedef struct mc_msg_item +{ + rc_uint_type res_len; + rc_uint_type res_off; + struct bin_messagetable_item *res; +} mc_msg_item; + +/* Defined in bfd/binary.c. Used to set architecture and machine of input + binary files. */ +extern enum bfd_architecture bfd_external_binary_architecture; +extern unsigned long bfd_external_machine; + +int target_is_bigendian = 0; +const char *def_target_arch; + +/* Globals and static variable definitions. */ + +/* bfd global helper struct variable. */ +static struct +{ + bfd *abfd; + asection *sec; +} mc_bfd; + +/* Memory list. */ +mc_node *mc_nodes = NULL; +static mc_node_lang **mc_nodes_lang = NULL; +static int mc_nodes_lang_count = 0; +static mc_keyword **mc_severity_codes = NULL; +static int mc_severity_codes_count = 0; +static mc_keyword **mc_facility_codes = NULL; +static int mc_facility_codes_count = 0; + +/* When we are building a resource tree, we allocate everything onto + an obstack, so that we can free it all at once if we want. */ +#define obstack_chunk_alloc xmalloc +#define obstack_chunk_free free + +/* The resource building obstack. */ +static struct obstack res_obstack; + +/* Flag variables. */ +/* Set by -C. Set the default code page to be used for input text file. */ +static rc_uint_type mcset_codepage_in = 0; + +/* Set by -O. Set the default code page to be used for output text files. */ +static rc_uint_type mcset_codepage_out = 0; + +/* Set by -b. .BIN filename should have .mc filename_ included for uniqueness. */ +static int mcset_prefix_bin = 0; + +/* The base name of the .mc file. */ +static const char *mcset_mc_basename = "unknown"; + +/* Set by -e . Specify the extension for the header file. */ +static const char *mcset_header_ext = ".h"; + +/* Set by -h . Gives the path of where to create the C include file. */ +static const char *mcset_header_dir = "./"; + +/* Set by -r . Gives the path of where to create the RC include file + and the binary message resource files it includes. */ +static const char *mcset_rc_dir = "./"; + +/* Modified by -a & -u. By -u input file is unicode, by -a is ASCII (default). */ +static int mcset_text_in_is_unicode = 0; + +/* Modified by -A & -U. By -U bin file is unicode (default), by -A is ASCII. */ +static int mcset_bin_out_is_unicode = 1; + +/* Set by -c. Sets the Customer bit in all the message ID's. */ +int mcset_custom_bit = 0; + +/* Set by -o. Generate OLE2 header file. Use HRESULT definition instead of + status code definition. */ +static int mcset_use_hresult = 0; + +/* Set by -m . Generate a warning if the size of any message exceeds + maxmsglen characters. */ +rc_uint_type mcset_max_message_length = 0; + +/* Set by -d. Sets message values in header to decimal initially. */ +int mcset_out_values_are_decimal = 0; + +/* Set by -n. terminates all strings with null's in the message tables. */ +static int mcset_automatic_null_termination = 0; + +/* The type used for message id output in header. */ +unichar *mcset_msg_id_typedef = NULL; + +/* Set by -x path. Geberated debug C file for mapping ID's to text. */ +static const char *mcset_dbg_dir = NULL; + +/* getopt long name definitions. */ +static const struct option long_options[] = +{ + {"binprefix", no_argument, 0, 'b'}, + {"target", required_argument, 0, 'F'}, + {"extension", required_argument, 0, 'e'}, + {"headerdir", required_argument, 0, 'h'}, + {"rcdir", required_argument, 0, 'r'}, + {"verbose", no_argument, 0, 'v'}, + {"codepage_in", required_argument, 0, 'C'}, + {"codepage_out", required_argument, 0, 'O'}, + {"maxlength", required_argument, 0, 'm'}, + {"ascii_in", no_argument, 0, 'a'}, + {"ascii_out", no_argument, 0, 'A'}, + {"unicode_in", no_argument, 0, 'u'}, + {"unicode_out", no_argument, 0, 'U'}, + {"customflag", no_argument, 0, 'c'}, + {"decimal_values", no_argument, 0, 'd'}, + {"hresult_use", no_argument, 0, 'o'}, + {"nullterminate", no_argument, 0, 'n'}, + {"xdbg", required_argument, 0, 'x'}, + {"version", no_argument, 0, 'V'}, + {"help", no_argument, 0, 'H'}, + {0, no_argument, 0, 0} +}; + + +/* Initialize the resource building obstack. */ +static void +res_init (void) +{ + obstack_init (&res_obstack); +} + +/* Allocate space on the resource building obstack. */ +void * +res_alloc (rc_uint_type bytes) +{ + return (void *) obstack_alloc (&res_obstack, (size_t) bytes); +} + +static FILE * +mc_create_path_text_file (const char *path, const char *ext) +{ + FILE *ret; + size_t len = 1; + char *hsz; + + len += (path != NULL ? strlen (path) : 0); + len += strlen (mcset_mc_basename); + len += (ext != NULL ? strlen (ext) : 0); + hsz = xmalloc (len); + sprintf (hsz, "%s%s%s", (path != NULL ? path : ""), mcset_mc_basename, + (ext != NULL ? ext : "")); + if ((ret = fopen (hsz, "wb")) == NULL) + fatal (_("can't create %s file ,%s' for output.\n"), (ext ? ext : "text"), hsz); + free (hsz); + return ret; +} + +static void +usage (FILE *stream, int status) +{ + fprintf (stream, _("Usage: %s [option(s)] [input-file]\n"), + program_name); + fprintf (stream, _(" The options are:\n\ + -a --ascii_in Read input file as ASCII file\n\ + -A --ascii_out Write binary messages as ASCII\n\ + -b --binprefix .bin filename is prefixed by .mc filename_ for uniqueness.\n\ + -c --customflag Set custom flags for messages\n\ + -C --codepage_in= Set codepage when reading mc text file\n\ + -d --decimal_values Print values to text files decimal\n\ + -e --extension= Set header extension used on export header file\n\ + -F --target Specify output target for endianess.\n\ + -h --headerdir= Set the export directory for headers\n\ + -u --unicode_in Read input file as UTF16 file\n\ + -U --unicode_out Write binary messages as UFT16\n\ + -m --maxlength= Set the maximal allowed message length\n\ + -n --nullterminate Automatic add a zero termination to strings\n\ + -o --hresult_use Use HRESULT definition instead of status code definition\n\ + -O --codepage_out= Set codepage used for writing text file\n\ + -r --rcdir= Set the export directory for rc files\n\ + -x --xdbg= Where to create the .dbg C include file\n\ + that maps message ID's to their symbolic name.\n\ +")); + fprintf (stream, _("\ + -H --help Print this help message\n\ + -v --verbose Verbose - tells you what it's doing\n\ + -V --version Print version information\n")); + + list_supported_targets (program_name, stream); + + if (REPORT_BUGS_TO[0] && status == 0) + fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); + + exit (status); +} + +static void +set_endianess (bfd *abfd, const char *target) +{ + const bfd_target *target_vec; + + def_target_arch = NULL; + target_vec = bfd_find_target (target, abfd); + if (! target_vec) + fatal ("Can't detect target endianess and architecture."); + target_is_bigendian = ((target_vec->byteorder == BFD_ENDIAN_BIG) ? 1 : 0); + { + const char *tname = target_vec->name; + const char **arch = bfd_arch_list (); + + if (arch && tname) + { + if (strchr (tname, '-') != NULL) + tname = strchr (tname, '-') + 1; + while (*arch != NULL) + { + const char *in_a = strstr (*arch, tname); + char end_ch = (in_a ? in_a[strlen (tname)] : 0); + if (in_a && (in_a == *arch || in_a[-1] == ':') + && end_ch == 0) + { + def_target_arch = *arch; + break; + } + arch++; + } + } + if (! def_target_arch) + fatal ("Can't detect architecture."); + } +} + +static int +probe_codepage (rc_uint_type *cp, int *is_uni, const char *pswitch, int defmode) +{ + if (*is_uni == -1) + { + if (*cp != CP_UTF16) + *is_uni = defmode; + else + *is_uni = 1; + } + if (*is_uni) + { + if (*cp != 0 && *cp != CP_UTF16) + { + fprintf (stderr, _("%s: warning: "), program_name); + fprintf (stderr, _("A codepage was specified switch ,%s' and UTF16.\n"), pswitch); + fprintf (stderr, _("\tcodepage settings are ignored.\n")); + } + *cp = CP_UTF16; + return 1; + } + if (*cp == CP_UTF16) + { + *is_uni = 1; + return 1; + } + if (*cp == 0) + *cp = 1252; + if (! unicode_is_valid_codepage (*cp)) + fatal ("Code page 0x%x is unknown.", (unsigned int) *cp); + *is_uni = 0; + return 1; +} + +mc_node * +mc_add_node (void) +{ + mc_node *ret; + + ret = res_alloc (sizeof (mc_node)); + memset (ret, 0, sizeof (mc_node)); + if (! mc_nodes) + mc_nodes = ret; + else + { + mc_node *h = mc_nodes; + + while (h->next != NULL) + h = h->next; + h->next = ret; + } + return ret; +} + +mc_node_lang * +mc_add_node_lang (mc_node *root, const mc_keyword *lang, rc_uint_type vid) +{ + mc_node_lang *ret, *h, *p; + + if (! lang || ! root) + fatal (_("try to add a ill language.")); + ret = res_alloc (sizeof (mc_node_lang)); + memset (ret, 0, sizeof (mc_node_lang)); + ret->lang = lang; + ret->vid = vid; + if ((h = root->sub) == NULL) + root->sub = ret; + else + { + p = NULL; + while (h != NULL) + { + if (h->lang->nval > lang->nval) + break; + if (h->lang->nval == lang->nval) + { + if (h->vid > vid) + break; + if (h->vid == vid) + fatal ("double defined message id %ld.\n", (long) vid); + } + h = (p = h)->next; + } + ret->next = h; + if (! p) + root->sub = ret; + else + p->next = ret; + } + return ret; +} + +static char * +convert_unicode_to_ACP (const unichar *usz) +{ + char *s; + rc_uint_type l; + + if (! usz) + return NULL; + codepage_from_unicode (&l, usz, &s, mcset_codepage_out); + if (! s) + fatal ("unicode string not mappable to ASCII codepage 0x%lx.\n", (long) mcset_codepage_out); + return s; +} + +static void +write_dbg_define (FILE *fp, const unichar *sym_name, const unichar *typecast) +{ + char *sym; + + if (!sym_name || sym_name[0] == 0) + return; + sym = convert_unicode_to_ACP (sym_name); + fprintf (fp, " {("); + if (typecast) + unicode_print (fp, typecast, unichar_len (typecast)); + else + fprintf (fp, "DWORD"); + fprintf (fp, ") %s, \"%s\" },\n", sym, sym); +} + +static void +write_header_define (FILE *fp, const unichar *sym_name, rc_uint_type vid, const unichar *typecast, mc_node_lang *nl) +{ + char *sym; + char *tdef = NULL; + + if (!sym_name || sym_name[0] == 0) + { + if (nl != NULL) + { + if (mcset_out_values_are_decimal) + fprintf (fp, "//\n// MessageId: 0x%lu\n//\n", (unsigned long) vid); + else + fprintf (fp, "//\n// MessageId: 0x%lx\n//\n", (unsigned long) vid); + } + return; + } + sym = convert_unicode_to_ACP (sym_name); + if (typecast && typecast[0] != 0) + tdef = convert_unicode_to_ACP (typecast); + fprintf (fp, "//\n// MessageId: %s\n//\n", sym); + if (! mcset_out_values_are_decimal) + fprintf (fp, "#define %s %s%s%s 0x%lx\n\n", sym, + (tdef ? "(" : ""), (tdef ? tdef : ""), (tdef ? ")" : ""), + (unsigned long) vid); + else + fprintf (fp, "#define %s %s%s%s 0x%lu\n\n", sym, + (tdef ? "(" : ""), (tdef ? tdef : ""), (tdef ? ")" : ""), + (unsigned long) vid); +} + +static int +sort_mc_node_lang (const void *l, const void *r) +{ + const mc_node_lang *l1 = *((const mc_node_lang **)l); + const mc_node_lang *r1 = *((const mc_node_lang **)r); + + if (l == r) + return 0; + if (l1->lang != r1->lang) + { + if (l1->lang->nval < r1->lang->nval) + return -1; + return 1; + } + if (l1->vid == r1->vid) + return 0; + if (l1->vid < r1->vid) + return -1; + return 1; +} + +static int +sort_keyword_by_nval (const void *l, const void *r) +{ + const mc_keyword *l1 = *((const mc_keyword **)l); + const mc_keyword *r1 = *((const mc_keyword **)r); + rc_uint_type len1, len2; + int e; + + if (l == r) + return 0; + if (l1->nval != r1->nval) + { + if (l1->nval < r1->nval) + return -1; + return 1; + } + len1 = unichar_len (l1->usz); + len2 = unichar_len (r1->usz); + if (len1 <= len2) + e = memcmp (l1->usz, r1->usz, sizeof (unichar) * len1); + else + e = memcmp (l1->usz, r1->usz, sizeof (unichar) * len2); + if (e) + return e; + if (len1 < len2) + return -1; + else if (len1 > len2) + return 1; + return 0; +} + +static void +do_sorts (void) +{ + mc_node *h; + mc_node_lang *n; + const mc_keyword *k; + int i; + + /* Sort message by their language and id ascending. */ + mc_nodes_lang_count = 0; + + h = mc_nodes; + while (h != NULL) + { + n = h->sub; + while (n != NULL) + { + mc_nodes_lang_count +=1; + n = n->next; + } + h = h->next; + } + + if (mc_nodes_lang_count != 0) + { + h = mc_nodes; + i = 0; + mc_nodes_lang = xmalloc (sizeof (mc_node_lang *) * mc_nodes_lang_count); + + while (h != NULL) + { + n = h->sub; + while (n != NULL) + { + mc_nodes_lang[i++] = n; + n = n->next; + } + h = h->next; + } + qsort (mc_nodes_lang, (size_t) mc_nodes_lang_count, sizeof (mc_node_lang *), sort_mc_node_lang); + } + /* Sort facility code definitions by there id ascending. */ + i = 0; + while ((k = enum_facility (i)) != NULL) + ++i; + mc_facility_codes_count = i; + if (i != 0) + { + mc_facility_codes = xmalloc (sizeof (mc_keyword *) * i); + i = 0; + while ((k = enum_facility (i)) != NULL) + mc_facility_codes[i++] = (mc_keyword *) k; + qsort (mc_facility_codes, (size_t) mc_facility_codes_count, sizeof (mc_keyword *), sort_keyword_by_nval); + } + + /* Sort severity code definitions by there id ascending. */ + i = 0; + while ((k = enum_severity (i)) != NULL) + ++i; + mc_severity_codes_count = i; + if (i != 0) + { + mc_severity_codes = xmalloc (sizeof (mc_keyword *) * i); + i = 0; + while ((k = enum_severity (i)) != NULL) + mc_severity_codes[i++] = (mc_keyword *) k; + qsort (mc_severity_codes, (size_t) mc_severity_codes_count, sizeof (mc_keyword *), sort_keyword_by_nval); + } +} + +static int +mc_get_block_count (mc_node_lang **nl, int elems) +{ + rc_uint_type exid; + int i, ret; + + if (! nl) + return 0; + i = 0; + ret = 0; + while (i < elems) + { + ret++; + exid = nl[i++]->vid; + while (i < elems && nl[i]->vid == exid + 1) + exid = nl[i++]->vid; + } + return ret; +} + +static bfd * +windmc_open_as_binary (const char *filename) +{ + bfd *abfd; + + abfd = bfd_openw (filename, "binary"); + if (! abfd) + fatal ("can't open `%s' for output", filename); + + return abfd; +} + +static void +target_put_16 (void *p, rc_uint_type value) +{ + assert (!! p); + + if (target_is_bigendian) + bfd_putb16 (value, p); + else + bfd_putl16 (value, p); +} + +static void +target_put_32 (void *p, rc_uint_type value) +{ + assert (!! p); + + if (target_is_bigendian) + bfd_putb32 (value, p); + else + bfd_putl32 (value, p); +} + +static struct bin_messagetable_item * +mc_generate_bin_item (mc_node_lang *n, rc_uint_type *res_len) +{ + struct bin_messagetable_item *ret = NULL; + rc_uint_type len; + + *res_len = 0; + if (mcset_bin_out_is_unicode == 1) + { + unichar *ht = n->message; + rc_uint_type txt_len; + + txt_len = unichar_len (n->message); + if (mcset_automatic_null_termination && txt_len != 0) + { + while (txt_len > 0 && ht[txt_len - 1] > 0 && ht[txt_len - 1] < 0x20) + ht[--txt_len] = 0; + } + txt_len *= sizeof (unichar); + len = BIN_MESSAGETABLE_ITEM_SIZE + txt_len + sizeof (unichar); + ret = res_alloc ((len + 3) & ~3); + memset (ret, 0, (len + 3) & ~3); + target_put_16 (ret->length, (len + 3) & ~3); + target_put_16 (ret->flags, MESSAGE_RESOURCE_UNICODE); + txt_len = 0; + while (*ht != 0) + { + target_put_16 (ret->data + txt_len, *ht++); + txt_len += 2; + } + } + else + { + rc_uint_type txt_len, l; + char *cvt_txt; + + codepage_from_unicode( &l, n->message, &cvt_txt, n->lang->lang_info.wincp); + if (! cvt_txt) + fatal ("Failed to convert message to language codepage.\n"); + txt_len = strlen (cvt_txt); + if (mcset_automatic_null_termination && txt_len > 0) + { + while (txt_len > 0 && cvt_txt[txt_len - 1] > 0 && cvt_txt[txt_len - 1] < 0x20) + cvt_txt[--txt_len] = 0; + } + len = BIN_MESSAGETABLE_ITEM_SIZE + txt_len + 1; + ret = res_alloc ((len + 3) & ~3); + memset (ret, 0, (len + 3) & ~3); + target_put_16 (ret->length, (len + 3) & ~3); + target_put_16 (ret->flags, 0); + strcpy ((char *) ret->data, cvt_txt); + } + *res_len = (len + 3) & ~3; + return ret; +} + +static void +mc_write_blocks (struct bin_messagetable *mtbl, mc_node_lang **nl, mc_msg_item *ml, int elems) +{ + int i, idx = 0; + rc_uint_type exid; + + if (! nl) + return; + i = 0; + while (i < elems) + { + target_put_32 (mtbl->items[idx].lowid, nl[i]->vid); + target_put_32 (mtbl->items[idx].highid, nl[i]->vid); + target_put_32 (mtbl->items[idx].offset, ml[i].res_off); + exid = nl[i++]->vid; + while (i < elems && nl[i]->vid == exid + 1) + { + target_put_32 (mtbl->items[idx].highid, nl[i]->vid); + exid = nl[i++]->vid; + } + ++idx; + } +} + +static void +set_windmc_bfd_content (const void *data, rc_uint_type off, rc_uint_type length) +{ + if (! bfd_set_section_contents (mc_bfd.abfd, mc_bfd.sec, data, off, length)) + bfd_fatal ("bfd_set_section_contents"); +} + +static void +windmc_write_bin (const char *filename, mc_node_lang **nl, int elems) +{ + unsigned long sec_length = 1; + int block_count, i; + mc_msg_item *mi; + struct bin_messagetable *mtbl; + rc_uint_type dta_off, dta_start; + + if (elems <= 0) + return; + mc_bfd.abfd = windmc_open_as_binary (filename); + mc_bfd.sec = bfd_make_section (mc_bfd.abfd, ".data"); + if (mc_bfd.sec == NULL) + bfd_fatal ("bfd_make_section"); + if (! bfd_set_section_flags (mc_bfd.abfd, mc_bfd.sec, + (SEC_HAS_CONTENTS | SEC_ALLOC + | SEC_LOAD | SEC_DATA))) + bfd_fatal ("bfd_set_section_flags"); + /* Requiring this is probably a bug in BFD. */ + mc_bfd.sec->output_section = mc_bfd.sec; + + block_count = mc_get_block_count (nl, elems); + + dta_off = (rc_uint_type) ((BIN_MESSAGETABLE_BLOCK_SIZE * block_count) + BIN_MESSAGETABLE_SIZE - 4); + dta_start = dta_off = (dta_off + 3) & ~3; + mi = xmalloc (sizeof (mc_msg_item) * elems); + mtbl = xmalloc (dta_start); + + /* Clear header region. */ + memset (mtbl, 0, dta_start); + target_put_32 (mtbl->cblocks, block_count); + /* Prepare items section for output. */ + for (i = 0; i < elems; i++) + { + mi[i].res_off = dta_off; + mi[i].res = mc_generate_bin_item (nl[i], &mi[i].res_len); + dta_off += mi[i].res_len; + } + sec_length = (dta_off + 3) & ~3; + if (! bfd_set_section_size (mc_bfd.abfd, mc_bfd.sec, sec_length)) + bfd_fatal ("bfd_set_section_size"); + /* Make sure we write the complete block. */ + set_windmc_bfd_content ("\0", sec_length - 1, 1); + + /* Write block information. */ + mc_write_blocks (mtbl, nl, mi, elems); + + set_windmc_bfd_content (mtbl, 0, dta_start); + + /* Write items. */ + for (i = 0; i < elems; i++) + set_windmc_bfd_content (mi[i].res, mi[i].res_off, mi[i].res_len); + + free (mtbl); + free (mi); + bfd_close (mc_bfd.abfd); + mc_bfd.abfd = NULL; + mc_bfd.sec = NULL; +} + +static void +write_bin (void) +{ + mc_node_lang *n = NULL; + int i, c; + + if (! mc_nodes_lang_count) + return; + + i = 0; + while (i < mc_nodes_lang_count) + { + char *nd; + char *filename; + + if (n && n->lang == mc_nodes_lang[i]->lang) + { + i++; + continue; + } + n = mc_nodes_lang[i]; + c = i + 1; + while (c < mc_nodes_lang_count && n->lang == mc_nodes_lang[c]->lang) + c++; + nd = convert_unicode_to_ACP (n->lang->sval); + + /* Prepare filename for binary output. */ + filename = xmalloc (strlen (nd) + 4 + 1 + strlen (mcset_mc_basename) + 1 + strlen (mcset_rc_dir)); + strcpy (filename, mcset_rc_dir); + if (mcset_prefix_bin) + sprintf (filename + strlen (filename), "%s_", mcset_mc_basename); + strcat (filename, nd); + strcat (filename, ".bin"); + + /* Write message file. */ + windmc_write_bin (filename, &mc_nodes_lang[i], (c - i)); + + free (filename); + i = c; + } +} + +static void +write_rc (FILE *fp) +{ + mc_node_lang *n; + int i, l; + + fprintf (fp, + "/* Do not edit this file manually.\n" + " This file is autogenerated by windmc. */\n\n"); + if (! mc_nodes_lang_count) + return; + n = NULL; + i = 0; + for (l = 0; l < mc_nodes_lang_count; l++) + { + if (n && n->lang == mc_nodes_lang[l]->lang) + continue; + ++i; + n = mc_nodes_lang[l]; + fprintf (fp, "\n// Country: %s\n// Language: %s\n#pragma code_page(%u)\n", + n->lang->lang_info.country, n->lang->lang_info.name, + (unsigned) n->lang->lang_info.wincp); + fprintf (fp, "LANGUAGE 0x%lx, 0x%lx\n", (long) (n->lang->nval & 0x3ff), + (long) ((n->lang->nval & 0xffff) >> 10)); + fprintf (fp, "1 MESSAGETABLE \""); + if (mcset_prefix_bin) + fprintf (fp, "%s_", mcset_mc_basename); + unicode_print (fp, n->lang->sval, unichar_len (n->lang->sval)); + fprintf (fp, ".bin\"\n"); + } +} + +static void +write_dbg (FILE *fp) +{ + mc_node *h; + + fprintf (fp, + "/* Do not edit this file manually.\n" + " This file is autogenerated by windmc.\n\n" + " This file maps each message ID value in to a text string that contains\n" + " the symbolic name used for it. */\n\n"); + + fprintf (fp, + "struct %sSymbolicName\n" + "{\n ", mcset_mc_basename); + if (mcset_msg_id_typedef) + unicode_print (fp, mcset_msg_id_typedef, unichar_len (mcset_msg_id_typedef)); + else + fprintf (fp, "DWORD"); + fprintf (fp, + " MessageId;\n" + " char *SymbolicName;\n" + "} %sSymbolicNames[] =\n" + "{\n", mcset_mc_basename); + h = mc_nodes; + while (h != NULL) + { + if (h->symbol) + write_dbg_define (fp, h->symbol, mcset_msg_id_typedef); + h = h->next; + } + fprintf (fp, " { ("); + if (mcset_msg_id_typedef) + unicode_print (fp, mcset_msg_id_typedef, unichar_len (mcset_msg_id_typedef)); + else + fprintf (fp, "DWORD"); + fprintf (fp, + ") 0xffffffff, NULL }\n" + "};\n"); +} + +static void +write_header (FILE *fp) +{ + char *s; + int i; + const mc_keyword *key; + mc_node *h; + + fprintf (fp, + "/* Do not edit this file manually.\n" + " This file is autogenerated by windmc. */\n\n" + "//\n// The values are 32 bit layed out as follows:\n//\n" + "// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1\n" + "// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0\n" + "// +---+-+-+-----------------------+-------------------------------+\n" + "// |Sev|C|R| Facility | Code |\n" + "// +---+-+-+-----------------------+-------------------------------+\n//\n" + "// where\n//\n" + "// C - is the Customer code flag\n//\n" + "// R - is a reserved bit\n//\n" + "// Code - is the facility's status code\n//\n"); + + h = mc_nodes; + + fprintf (fp, "// Sev - is the severity code\n//\n"); + if (mc_severity_codes_count != 0) + { + for (i = 0; i < mc_severity_codes_count; i++) + { + key = mc_severity_codes[i]; + fprintf (fp, "// %s - %02lx\n", convert_unicode_to_ACP (key->usz), + (unsigned long) key->nval); + if (key->sval && key->sval[0] != 0) + { + if (! mcset_out_values_are_decimal) + fprintf (fp, "#define %s 0x%lx\n", convert_unicode_to_ACP (key->sval), + (unsigned long) key->nval); + else + fprintf (fp, "#define %s 0x%lu\n", convert_unicode_to_ACP (key->sval), + (unsigned long) key->nval); + } + } + fprintf (fp, "//\n"); + } + fprintf (fp, "// Facility - is the facility code\n//\n"); + if (mc_facility_codes_count != 0) + { + for (i = 0; i < mc_facility_codes_count; i++) + { + key = mc_facility_codes[i]; + fprintf (fp, "// %s - %04lx\n", convert_unicode_to_ACP (key->usz), + (unsigned long) key->nval); + if (key->sval && key->sval[0] != 0) + { + if (! mcset_out_values_are_decimal) + fprintf (fp, "#define %s 0x%lx\n", convert_unicode_to_ACP (key->sval), + (unsigned long) key->nval); + else + fprintf (fp, "#define %s 0x%lu\n", convert_unicode_to_ACP (key->sval), + (unsigned long) key->nval); + } + } + fprintf (fp, "//\n"); + } + fprintf (fp, "\n"); + while (h != NULL) + { + if (h->user_text) + { + s = convert_unicode_to_ACP (h->user_text); + if (s) + fprintf (fp, "%s", s); + } + if (h->symbol) + write_header_define (fp, h->symbol, h->vid, mcset_msg_id_typedef, h->sub); + h = h->next; + } +} + +static const char * +mc_unify_path (const char *path) +{ + char *end; + char *hsz; + + if (! path || *path == 0) + return "./"; + hsz = xmalloc (strlen (path) + 2); + strcpy (hsz, path); + end = hsz + strlen (hsz); + if (hsz[-1] != '/' && hsz[-1] != '\\') + strcpy (end, "/"); + while ((end = strchr (hsz, '\\')) != NULL) + *end = '/'; + return hsz; +} + +int main (int, char **); + +int +main (int argc, char **argv) +{ + FILE *h_fp; + int c; + char *target, *input_filename; + int verbose; + +#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) + setlocale (LC_MESSAGES, ""); +#endif +#if defined (HAVE_SETLOCALE) + setlocale (LC_CTYPE, ""); +#endif + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + program_name = argv[0]; + xmalloc_set_program_name (program_name); + + expandargv (&argc, &argv); + + bfd_init (); + set_default_bfd_target (); + + target = NULL; + verbose = 0; + input_filename = NULL; + + res_init (); + + while ((c = getopt_long (argc, argv, "C:F:O:h:e:m:r:x:aAbcdHunoUvV", long_options, + (int *) 0)) != EOF) + { + switch (c) + { + case 'b': + mcset_prefix_bin = 1; + break; + case 'e': + { + mcset_header_ext = optarg; + if (mcset_header_ext[0] != '.' && mcset_header_ext[0] != 0) + { + char *hsz = xmalloc (strlen (mcset_header_ext) + 2); + + sprintf (hsz, ".%s", mcset_header_ext); + mcset_header_ext = hsz; + } + } + break; + case 'h': + mcset_header_dir = mc_unify_path (optarg); + break; + case 'r': + mcset_rc_dir = mc_unify_path (optarg); + break; + case 'a': + mcset_text_in_is_unicode = 0; + break; + case 'x': + if (*optarg != 0) + mcset_dbg_dir = mc_unify_path (optarg); + break; + case 'A': + mcset_bin_out_is_unicode = 0; + break; + case 'd': + mcset_out_values_are_decimal = 1; + break; + case 'u': + mcset_text_in_is_unicode = 1; + break; + case 'U': + mcset_bin_out_is_unicode = 1; + break; + case 'c': + mcset_custom_bit = 1; + break; + case 'n': + mcset_automatic_null_termination = 1; + break; + case 'o': + mcset_use_hresult = 1; + fatal ("option -o is not implemented until yet.\n"); + break; + case 'F': + target = optarg; + break; + case 'v': + verbose ++; + break; + case 'm': + mcset_max_message_length = strtol (optarg, (char **) NULL, 10); + break; + case 'C': + mcset_codepage_in = strtol (optarg, (char **) NULL, 10); + break; + case 'O': + mcset_codepage_out = strtol (optarg, (char **) NULL, 10); + break; + case '?': + case 'H': + usage (stdout, 0); + break; + case 'V': + print_version ("windmc"); + break; + + default: + usage (stderr, 1); + break; + } + } + if (input_filename == NULL && optind < argc) + { + input_filename = argv[optind]; + ++optind; + } + + set_endianess (NULL, target); + + if (input_filename == NULL) + { + fprintf (stderr, "Error: No input file was specified.\n"); + usage (stderr, 1); + } + mc_set_inputfile (input_filename); + + if (!probe_codepage (&mcset_codepage_in, &mcset_text_in_is_unicode, "codepage_in", 0)) + usage (stderr, 1); + if (mcset_codepage_out == 0) + mcset_codepage_out = 1252; + if (! unicode_is_valid_codepage (mcset_codepage_out)) + fatal ("Code page 0x%x is unknown.", (unsigned int) mcset_codepage_out); + if (mcset_codepage_out == CP_UTF16) + fatal ("UTF16 is no valid text output code page."); + if (verbose) + { + fprintf (stderr, "// Default target is %s and it is %s endian.\n", + def_target_arch, (target_is_bigendian ? "big" : "little")); + fprintf (stderr, "// Input codepage: 0x%x\n", (unsigned int) mcset_codepage_in); + fprintf (stderr, "// Output codepage: 0x%x\n", (unsigned int) mcset_codepage_out); + } + + if (argc != optind) + usage (stderr, 1); + + /* Initialize mcset_mc_basename. */ + { + const char *bn, *bn2; + char *hsz; + + bn = strrchr (input_filename, '/'); + bn2 = strrchr (input_filename, '\\'); + if (! bn) + bn = bn2; + if (bn && bn2 && bn < bn2) + bn = bn2; + if (! bn) + bn = input_filename; + else + bn++; + mcset_mc_basename = hsz = xstrdup (bn); + + /* Cut of right-hand extension. */ + if ((hsz = strrchr (hsz, '.')) != NULL) + *hsz = 0; + } + + /* Load the input file and do code page transformations to UTF16. */ + { + unichar *u; + rc_uint_type ul; + char *buff; + long flen; + FILE *fp = fopen (input_filename, "rb"); + + if (!fp) + fatal (_("unable to open file ,%s' for input.\n"), input_filename); + + fseek (fp, 0, SEEK_END); + flen = ftell (fp); + fseek (fp, 0, SEEK_SET); + buff = malloc (flen + 3); + memset (buff, 0, flen + 3); + fread (buff, 1, flen, fp); + fclose (fp); + if (mcset_text_in_is_unicode != 1) + { + unicode_from_codepage (&ul, &u, buff, mcset_codepage_in); + if (! u) + fatal ("Failed to convert input to UFT16\n"); + mc_set_content (u); + } + else + { + if ((flen & 1) != 0) + fatal (_("input file does not seems to be UFT16.\n")); + mc_set_content ((unichar *) buff); + } + free (buff); + } + + while (yyparse ()) + ; + + do_sorts (); + + h_fp = mc_create_path_text_file (mcset_header_dir, mcset_header_ext); + write_header (h_fp); + fclose (h_fp); + + h_fp = mc_create_path_text_file (mcset_rc_dir, ".rc"); + write_rc (h_fp); + fclose (h_fp); + + if (mcset_dbg_dir != NULL) + { + h_fp = mc_create_path_text_file (mcset_dbg_dir, ".dbg"); + write_dbg (h_fp); + fclose (h_fp); + } + write_bin (); + + if (mc_nodes_lang) + free (mc_nodes_lang); + if (mc_severity_codes) + free (mc_severity_codes); + if (mc_facility_codes) + free (mc_facility_codes); + + xexit (0); + return 0; +} diff --git a/binutils/windmc.h b/binutils/windmc.h new file mode 100644 index 00000000000..08a77062609 --- /dev/null +++ b/binutils/windmc.h @@ -0,0 +1,99 @@ +/* windmc.h -- header file for windmc program. + Copyright 2007 + Free Software Foundation, Inc. + Written by Kai Tietz, Onevision. + + This file is part of 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 2 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 "ansidecl.h" + +/* This is the header file for the windmc program. It defines + structures and declares functions used within the program. */ + +#include "winduni.h" + +#ifndef WINDMC_HXX +#define WINDMC_HXX + +/* Global flag variables (set by windmc.c file. */ +extern int mcset_custom_bit; +extern int mcset_out_values_are_decimal; +extern rc_uint_type mcset_max_message_length; +extern unichar *mcset_msg_id_typedef; + +/* Lexer keyword definition and internal memory structures. */ + +typedef struct mc_keyword +{ + struct mc_keyword *next; + const char *group_name; + size_t len; + unichar *usz; + int rid; + rc_uint_type nval; + unichar *sval; + wind_language_t lang_info; +} mc_keyword; + +typedef struct mc_node_lang +{ + struct mc_node_lang *next; + rc_uint_type vid; + const mc_keyword *lang; + unichar *message; +} mc_node_lang; + +typedef struct mc_node +{ + struct mc_node *next; + unichar *user_text; + const mc_keyword *facility; + const mc_keyword *severity; + unichar *symbol; + rc_uint_type id; + rc_uint_type vid; + mc_node_lang *sub; +} mc_node; + +extern mc_node *mc_nodes; + +void mc_add_keyword (unichar *, int, const char *, rc_uint_type, unichar *); +const mc_keyword *enum_facility (int); +const mc_keyword *enum_severity (int); + +mc_node_lang *mc_add_node_lang (mc_node *, const mc_keyword *, rc_uint_type); +mc_node *mc_add_node (void); + +/* Standard yacc/flex stuff. */ +int yyerror (const char *, ...); +int yylex (void); +int yyparse (void); + +/* mclex.c */ +void mc_set_inputfile (const char *); +void mc_set_content (const unichar *); + +/* Lexer control variables. Used by mcparser.y file. */ +extern bfd_boolean mclex_want_nl; +extern bfd_boolean mclex_want_line; +extern bfd_boolean mclex_want_filename; + +void mc_fatal (const char *, ...); +void mc_warn (const char *, ...); + +#endif diff --git a/binutils/windres.c b/binutils/windres.c index 50af427d0f3..da8e33f39ad 100644 --- a/binutils/windres.c +++ b/binutils/windres.c @@ -1,7 +1,8 @@ /* windres.c -- a program to manipulate Windows resources - Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. + Rewritten by Kai Tietz, Onevision. This file is part of GNU Binutils. @@ -34,10 +35,7 @@ * The res2coff program, written by Pedro A. Aranda . */ -#include "config.h" -#ifdef HAVE_UNISTD_H -#include -#endif +#include "sysdep.h" #include #include #include "bfd.h" @@ -48,10 +46,20 @@ #include "obstack.h" #include "windres.h" +/* Defined in bfd/binary.c. Used to set architecture and machine of input + binary files. */ +extern enum bfd_architecture bfd_external_binary_architecture; +extern unsigned long bfd_external_machine; + /* Used by resrc.c at least. */ int verbose = 0; +int target_is_bigendian = 0; +const char *def_target_arch; + +static void set_endianess (bfd *, const char *); + /* An enumeration of format types. */ enum res_format @@ -109,14 +117,22 @@ static struct include_dir *include_dirs; /* Static functions. */ static void res_init (void); -static int extended_menuitems (const struct menuitem *); +static int extended_menuitems (const rc_menuitem *); static enum res_format format_from_name (const char *, int); static enum res_format format_from_filename (const char *, int); static void usage (FILE *, int); static int cmp_res_entry (const void *, const void *); -static struct res_directory *sort_resources (struct res_directory *); +static rc_res_directory *sort_resources (rc_res_directory *); static void reswr_init (void); static const char * quot (const char *); + +static rc_uint_type target_get_8 (const void *, rc_uint_type); +static void target_put_8 (void *, rc_uint_type); +static rc_uint_type target_get_16 (const void *, rc_uint_type); +static void target_put_16 (void *, rc_uint_type); +static rc_uint_type target_get_32 (const void *, rc_uint_type); +static void target_put_32 (void *, rc_uint_type); + /* When we are building a resource tree, we allocate everything onto an obstack, so that we can free it all at once if we want. */ @@ -139,9 +155,9 @@ res_init (void) /* Allocate space on the resource building obstack. */ void * -res_alloc (size_t bytes) +res_alloc (rc_uint_type bytes) { - return (void *) obstack_alloc (&res_obstack, bytes); + return (void *) obstack_alloc (&res_obstack, (size_t) bytes); } /* We also use an obstack to save memory used while writing out a set @@ -160,9 +176,9 @@ reswr_init (void) /* Allocate space on the resource writing obstack. */ void * -reswr_alloc (size_t bytes) +reswr_alloc (rc_uint_type bytes) { - return (void *) obstack_alloc (&reswr_obstack, bytes); + return (void *) obstack_alloc (&reswr_obstack, (size_t) bytes); } /* Open a file using the include directory search list. */ @@ -212,7 +228,7 @@ open_file_search (const char *filename, const char *mode, const char *errmsg, section. */ int -res_id_cmp (struct res_id a, struct res_id b) +res_id_cmp (rc_res_id a, rc_res_id b) { if (! a.named) { @@ -260,24 +276,23 @@ res_id_cmp (struct res_id a, struct res_id b) /* Print a resource ID. */ void -res_id_print (FILE *stream, struct res_id id, int quote) +res_id_print (FILE *stream, rc_res_id id, int quote) { if (! id.named) - fprintf (stream, "%lu", id.u.id); + fprintf (stream, "%u", (int) id.u.id); else { if (quote) - putc ('"', stream); + unicode_print_quoted (stream, id.u.n.name, id.u.n.length); + else unicode_print (stream, id.u.n.name, id.u.n.length); - if (quote) - putc ('"', stream); } } /* Print a list of resource ID's. */ void -res_ids_print (FILE *stream, int cids, const struct res_id *ids) +res_ids_print (FILE *stream, int cids, const rc_res_id *ids) { int i; @@ -292,43 +307,52 @@ res_ids_print (FILE *stream, int cids, const struct res_id *ids) /* Convert an ASCII string to a resource ID. */ void -res_string_to_id (struct res_id *res_id, const char *string) +res_string_to_id (rc_res_id *res_id, const char *string) { res_id->named = 1; unicode_from_ascii (&res_id->u.n.length, &res_id->u.n.name, string); } +/* Convert an unicode string to a resource ID. */ +void +res_unistring_to_id (rc_res_id *res_id, const unichar *u) +{ + res_id->named = 1; + res_id->u.n.length = unichar_len (u); + res_id->u.n.name = unichar_dup_uppercase (u); +} + /* Define a resource. The arguments are the resource tree, RESOURCES, and the location at which to put it in the tree, CIDS and IDS. - This returns a newly allocated res_resource structure, which the + This returns a newly allocated rc_res_resource structure, which the caller is expected to initialize. If DUPOK is non-zero, then if a resource with this ID exists, it is returned. Otherwise, a warning is issued, and a new resource is created replacing the existing one. */ -struct res_resource * -define_resource (struct res_directory **resources, int cids, - const struct res_id *ids, int dupok) +rc_res_resource * +define_resource (rc_res_directory **resources, int cids, + const rc_res_id *ids, int dupok) { - struct res_entry *re = NULL; + rc_res_entry *re = NULL; int i; assert (cids > 0); for (i = 0; i < cids; i++) { - struct res_entry **pp; + rc_res_entry **pp; if (*resources == NULL) { - static unsigned long timeval; + static unsigned int timeval; /* Use the same timestamp for every resource created in a single run. */ if (timeval == 0) timeval = time (NULL); - *resources = ((struct res_directory *) - res_alloc (sizeof **resources)); + *resources = ((rc_res_directory *) + res_alloc (sizeof (rc_res_directory))); (*resources)->characteristics = 0; (*resources)->time = timeval; (*resources)->major = 0; @@ -344,7 +368,7 @@ define_resource (struct res_directory **resources, int cids, re = *pp; else { - re = (struct res_entry *) res_alloc (sizeof *re); + re = (rc_res_entry *) res_alloc (sizeof (rc_res_entry)); re->next = NULL; re->id = ids[i]; if ((i + 1) < cids) @@ -393,9 +417,9 @@ define_resource (struct res_directory **resources, int cids, fprintf (stderr, _(": duplicate value\n")); } - re->u.res = ((struct res_resource *) - res_alloc (sizeof (struct res_resource))); - memset (re->u.res, 0, sizeof (struct res_resource)); + re->u.res = ((rc_res_resource *) + res_alloc (sizeof (rc_res_resource))); + memset (re->u.res, 0, sizeof (rc_res_resource)); re->u.res->type = RES_TYPE_UNINITIALIZED; return re->u.res; @@ -404,11 +428,11 @@ define_resource (struct res_directory **resources, int cids, /* Define a standard resource. This is a version of define_resource that just takes type, name, and language arguments. */ -struct res_resource * -define_standard_resource (struct res_directory **resources, int type, - struct res_id name, int language, int dupok) +rc_res_resource * +define_standard_resource (rc_res_directory **resources, int type, + rc_res_id name, rc_uint_type language, int dupok) { - struct res_id a[3]; + rc_res_id a[3]; a[0].named = 0; a[0].u.id = type; @@ -423,21 +447,21 @@ define_standard_resource (struct res_directory **resources, int type, static int cmp_res_entry (const void *p1, const void *p2) { - const struct res_entry **re1, **re2; + const rc_res_entry **re1, **re2; - re1 = (const struct res_entry **) p1; - re2 = (const struct res_entry **) p2; + re1 = (const rc_res_entry **) p1; + re2 = (const rc_res_entry **) p2; return res_id_cmp ((*re1)->id, (*re2)->id); } /* Sort the resources. */ -static struct res_directory * -sort_resources (struct res_directory *resdir) +static rc_res_directory * +sort_resources (rc_res_directory *resdir) { int c, i; - struct res_entry *re; - struct res_entry **a; + rc_res_entry *re; + rc_res_entry **a; if (resdir->entries == NULL) return resdir; @@ -448,12 +472,12 @@ sort_resources (struct res_directory *resdir) /* This is a recursive routine, so using xmalloc is probably better than alloca. */ - a = (struct res_entry **) xmalloc (c * sizeof (struct res_entry *)); + a = (rc_res_entry **) xmalloc (c * sizeof (rc_res_entry *)); for (i = 0, re = resdir->entries; re != NULL; re = re->next, i++) a[i] = re; - qsort (a, c, sizeof (struct res_entry *), cmp_res_entry); + qsort (a, c, sizeof (rc_res_entry *), cmp_res_entry); resdir->entries = a[0]; for (i = 0; i < c - 1; i++) @@ -475,9 +499,9 @@ sort_resources (struct res_directory *resdir) DIALOGEX. */ int -extended_dialog (const struct dialog *dialog) +extended_dialog (const rc_dialog *dialog) { - const struct dialog_control *c; + const rc_dialog_control *c; if (dialog->ex != NULL) return 1; @@ -492,15 +516,15 @@ extended_dialog (const struct dialog *dialog) /* Return whether MENUITEMS are a MENU or a MENUEX. */ int -extended_menu (const struct menu *menu) +extended_menu (const rc_menu *menu) { return extended_menuitems (menu->items); } static int -extended_menuitems (const struct menuitem *menuitems) +extended_menuitems (const rc_menuitem *menuitems) { - const struct menuitem *mi; + const rc_menuitem *mi; for (mi = menuitems; mi != NULL; mi = mi->next) { @@ -559,7 +583,7 @@ format_from_filename (const char *filename, int input) { const char *ext; FILE *e; - unsigned char b1, b2, b3, b4, b5; + bfd_byte b1, b2, b3, b4, b5; int magic; /* If we have an extension, see if we recognize it as implying a @@ -649,6 +673,7 @@ usage (FILE *stream, int status) -D --define [=] Define SYM when preprocessing rc file\n\ -U --undefine Undefine SYM when preprocessing rc file\n\ -v --verbose Verbose - tells you what it's doing\n\ + -c --codepage= Specify default codepage\n\ -l --language= Set language when reading rc file\n\ --use-temp-file Use a temporary file instead of popen to read\n\ the preprocessor output\n\ @@ -669,7 +694,7 @@ No input-file is stdin, default rc. No output-file is stdout, default rc.\n")); list_supported_targets (program_name, stream); - if (status == 0) + if (REPORT_BUGS_TO[0] && status == 0) fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); exit (status); @@ -686,7 +711,7 @@ quot (const char *string) const char *src; char *dest; - if ((buflen < slen * 2 + 2) || !buf) + if ((buflen < slen * 2 + 2) || ! buf) { buflen = slen * 2 + 2; if (buf) @@ -725,6 +750,7 @@ static const struct option long_options[] = {"define", required_argument, 0, 'D'}, {"undefine", required_argument, 0, 'U'}, {"verbose", no_argument, 0, 'v'}, + {"codepage", required_argument, 0, 'c'}, {"language", required_argument, 0, 'l'}, {"use-temp-file", no_argument, 0, OPTION_USE_TEMP_FILE}, {"no-use-temp-file", no_argument, 0, OPTION_NO_USE_TEMP_FILE}, @@ -753,7 +779,7 @@ main (int argc, char **argv) char *preprocargs; const char *quotedarg; int language; - struct res_directory *resources; + rc_res_directory *resources; int use_temp_file; #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) @@ -785,11 +811,25 @@ main (int argc, char **argv) language = 0x409; /* LANG_ENGLISH, SUBLANG_ENGLISH_US. */ use_temp_file = 0; - while ((c = getopt_long (argc, argv, "f:i:l:o:I:J:O:F:D:U:rhHvV", long_options, + while ((c = getopt_long (argc, argv, "c:f:i:l:o:I:J:O:F:D:U:rhHvV", long_options, (int *) 0)) != EOF) { switch (c) { + case 'c': + { + rc_uint_type ncp; + + if (optarg[0] == '0' && (optarg[1] == 'x' || optarg[1] == 'X')) + ncp = (rc_uint_type) strtol (optarg + 2, NULL, 16); + else + ncp = (rc_uint_type) strtol (optarg, NULL, 10); + if (ncp == CP_UTF16 || ! unicode_is_valid_codepage (ncp)) + fatal (_("invalid codepage specified.\n")); + wind_default_codepage = wind_current_codepage = ncp; + } + break; + case 'i': input_filename = optarg; break; @@ -863,7 +903,8 @@ main (int argc, char **argv) input_format_tmp = format_from_name (optarg, 0); if (input_format_tmp != RES_FORMAT_UNKNOWN) { - fprintf (stderr, _("Option -I is deprecated for setting the input format, please use -J instead.\n")); + fprintf (stderr, + _("Option -I is deprecated for setting the input format, please use -J instead.\n")); input_format = input_format_tmp; break; } @@ -963,6 +1004,8 @@ main (int argc, char **argv) output_format = format_from_filename (output_filename, 0); } + set_endianess (NULL, target); + /* Read the input file. */ switch (input_format) { @@ -1008,3 +1051,339 @@ main (int argc, char **argv) xexit (0); return 0; } + +static void set_endianess (bfd *abfd, const char *target) +{ + const bfd_target *target_vec; + + def_target_arch = NULL; + target_vec = bfd_find_target (target, abfd); + if (! target_vec) + fatal ("Can't detect target endianess and architecture."); + target_is_bigendian = ((target_vec->byteorder == BFD_ENDIAN_BIG) ? 1 : 0); + { + const char *tname = target_vec->name; + const char **arch = bfd_arch_list(); + if (arch && tname) + { + if (strchr (tname, '-') != NULL) + tname = strchr (tname, '-') + 1; + while (*arch != NULL) + { + const char *in_a = strstr (*arch, tname); + char end_ch = (in_a ? in_a[strlen(tname)] : 0); + if (in_a && (in_a == *arch || in_a[-1] == ':') + && end_ch == 0) + { + def_target_arch = *arch; + break; + } + arch++; + } + } + if (! def_target_arch) + fatal ("Can't detect architecture."); + } +} + +bfd * +windres_open_as_binary (const char *filename, int rdmode) +{ + bfd *abfd; + + abfd = (rdmode ? bfd_openr (filename, "binary") : bfd_openw (filename, "binary")); + if (! abfd) + fatal ("can't open `%s' for %s", filename, (rdmode ? "input" : "output")); + + if (rdmode && ! bfd_check_format (abfd, bfd_object)) + fatal ("can't open `%s' for input.", filename); + + return abfd; +} + +void +set_windres_bfd_endianess (windres_bfd *wrbfd, int is_bigendian) +{ + assert (!! wrbfd); + switch (WR_KIND(wrbfd)) + { + case WR_KIND_BFD_BIN_L: + if (is_bigendian) + WR_KIND(wrbfd) = WR_KIND_BFD_BIN_B; + break; + case WR_KIND_BFD_BIN_B: + if (! is_bigendian) + WR_KIND(wrbfd) = WR_KIND_BFD_BIN_L; + break; + default: + /* only binary bfd can be overriden. */ + abort (); + } +} + +void +set_windres_bfd (windres_bfd *wrbfd, bfd *abfd, asection *sec, rc_uint_type kind) +{ + assert (!! wrbfd); + switch (kind) + { + case WR_KIND_TARGET: + abfd = NULL; + sec = NULL; + break; + case WR_KIND_BFD: + case WR_KIND_BFD_BIN_L: + case WR_KIND_BFD_BIN_B: + assert (!! abfd); + assert (!!sec); + break; + default: + abort (); + } + WR_KIND(wrbfd) = kind; + WR_BFD(wrbfd) = abfd; + WR_SECTION(wrbfd) = sec; +} + +void +set_windres_bfd_content(windres_bfd *wrbfd, const void *data, rc_uint_type off, + rc_uint_type length) +{ + if (WR_KIND(wrbfd) != WR_KIND_TARGET) + { + if (! bfd_set_section_contents (WR_BFD(wrbfd), WR_SECTION(wrbfd), data, off, length)) + bfd_fatal ("bfd_set_section_contents"); + } + else + abort (); +} + +void +get_windres_bfd_content(windres_bfd *wrbfd, void *data, rc_uint_type off, + rc_uint_type length) +{ + if (WR_KIND(wrbfd) != WR_KIND_TARGET) + { + if (! bfd_get_section_contents (WR_BFD(wrbfd), WR_SECTION(wrbfd), data, off, length)) + bfd_fatal ("bfd_get_section_contents"); + } + else + abort (); +} + +void +windres_put_8 (windres_bfd *wrbfd, void *p, rc_uint_type value) +{ + switch (WR_KIND(wrbfd)) + { + case WR_KIND_TARGET: + target_put_8 (p, value); + break; + case WR_KIND_BFD: + case WR_KIND_BFD_BIN_L: + case WR_KIND_BFD_BIN_B: + bfd_put_8 (WR_BFD(wrbfd), value, p); + break; + default: + abort (); + } +} + +void +windres_put_16 (windres_bfd *wrbfd, void *data, rc_uint_type value) +{ + switch (WR_KIND(wrbfd)) + { + case WR_KIND_TARGET: + target_put_16 (data, value); + break; + case WR_KIND_BFD: + case WR_KIND_BFD_BIN_B: + bfd_put_16 (WR_BFD(wrbfd), value, data); + break; + case WR_KIND_BFD_BIN_L: + bfd_putl16 (value, data); + break; + default: + abort (); + } +} + +void +windres_put_32 (windres_bfd *wrbfd, void *data, rc_uint_type value) +{ + switch (WR_KIND(wrbfd)) + { + case WR_KIND_TARGET: + target_put_32 (data, value); + break; + case WR_KIND_BFD: + case WR_KIND_BFD_BIN_B: + bfd_put_32 (WR_BFD(wrbfd), value, data); + break; + case WR_KIND_BFD_BIN_L: + bfd_putl32 (value, data); + break; + default: + abort (); + } +} + +rc_uint_type +windres_get_8 (windres_bfd *wrbfd, const void *data, rc_uint_type length) +{ + if (length < 1) + fatal ("windres_get_8: unexpected eob."); + switch (WR_KIND(wrbfd)) + { + case WR_KIND_TARGET: + return target_get_8 (data, length); + case WR_KIND_BFD: + case WR_KIND_BFD_BIN_B: + case WR_KIND_BFD_BIN_L: + return bfd_get_8 (WR_BFD(wrbfd), data); + default: + abort (); + } + return 0; +} + +rc_uint_type +windres_get_16 (windres_bfd *wrbfd, const void *data, rc_uint_type length) +{ + if (length < 2) + fatal ("windres_get_16: unexpected eob."); + switch (WR_KIND(wrbfd)) + { + case WR_KIND_TARGET: + return target_get_16 (data, length); + case WR_KIND_BFD: + case WR_KIND_BFD_BIN_B: + return bfd_get_16 (WR_BFD(wrbfd), data); + case WR_KIND_BFD_BIN_L: + return bfd_getl16 (data); + default: + abort (); + } + return 0; +} + +rc_uint_type +windres_get_32 (windres_bfd *wrbfd, const void *data, rc_uint_type length) +{ + if (length < 4) + fatal ("windres_get_32: unexpected eob."); + switch (WR_KIND(wrbfd)) + { + case WR_KIND_TARGET: + return target_get_32 (data, length); + case WR_KIND_BFD: + case WR_KIND_BFD_BIN_B: + return bfd_get_32 (WR_BFD(wrbfd), data); + case WR_KIND_BFD_BIN_L: + return bfd_getl32 (data); + default: + abort (); + } + return 0; +} + +static rc_uint_type +target_get_8 (const void *p, rc_uint_type length) +{ + rc_uint_type ret; + + if (length < 1) + fatal ("Resource too small for getting 8-bit value."); + + ret = (rc_uint_type) *((const bfd_byte *) p); + return ret & 0xff; +} + +static rc_uint_type +target_get_16 (const void *p, rc_uint_type length) +{ + if (length < 2) + fatal ("Resource too small for getting 16-bit value."); + + if (target_is_bigendian) + return bfd_getb16 (p); + else + return bfd_getl16 (p); +} + +static rc_uint_type +target_get_32 (const void *p, rc_uint_type length) +{ + if (length < 4) + fatal ("Resource too small for getting 32-bit value."); + + if (target_is_bigendian) + return bfd_getb32 (p); + else + return bfd_getl32 (p); +} + +static void +target_put_8 (void *p, rc_uint_type value) +{ + assert (!! p); + *((bfd_byte *) p)=(bfd_byte) value; +} + +static void +target_put_16 (void *p, rc_uint_type value) +{ + assert (!! p); + + if (target_is_bigendian) + bfd_putb16 (value, p); + else + bfd_putl16 (value, p); +} + +static void +target_put_32 (void *p, rc_uint_type value) +{ + assert (!! p); + + if (target_is_bigendian) + bfd_putb32 (value, p); + else + bfd_putl32 (value, p); +} + +static int isInComment = 0; + +int wr_printcomment (FILE *e, const char *fmt, ...) +{ + va_list arg; + int r = 0; + + if (isInComment) + r += fprintf (e, "\n "); + else + fprintf (e, "/* "); + isInComment = 1; + if (fmt == NULL) + return r; + va_start (arg, fmt); + r += vfprintf (e, fmt, arg); + va_end (arg); + return r; +} + +int wr_print (FILE *e, const char *fmt, ...) +{ + va_list arg; + int r = 0; + if (isInComment) + r += fprintf (e, ". */\n"); + isInComment = 0; + if (! fmt) + return r; + va_start (arg, fmt); + r += vfprintf (e, fmt, arg); + va_end (arg); + return r; +} diff --git a/binutils/windres.h b/binutils/windres.h index 6a9dfa73797..d7494ec6a27 100644 --- a/binutils/windres.h +++ b/binutils/windres.h @@ -1,7 +1,8 @@ /* windres.h -- header file for windres program. - Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. + Rewritten by Kai Tietz, Onevision. This file is part of GNU Binutils. @@ -26,771 +27,49 @@ structures and declares functions used within the program. */ #include "winduni.h" - -/* We represent resources internally as a tree, similar to the tree - used in the .rsrc section of a COFF file. The root is a - res_directory structure. */ - -struct res_directory -{ - /* Resource flags. According to the MS docs, this is currently - always zero. */ - unsigned long characteristics; - /* Time/date stamp. */ - unsigned long time; - /* Major version number. */ - unsigned short major; - /* Minor version number. */ - unsigned short minor; - /* Directory entries. */ - struct res_entry *entries; -}; - -/* A resource ID is stored in a res_id structure. */ - -struct res_id -{ - /* Non-zero if this entry has a name rather than an ID. */ - unsigned int named : 1; - union - { - /* If the named field is non-zero, this is the name. */ - struct - { - /* Length of the name. */ - int length; - /* Pointer to the name, which is a Unicode string. */ - unichar *name; - } n; - /* If the named field is zero, this is the ID. */ - unsigned long id; - } u; -}; - -/* Each entry in the tree is a res_entry structure. We mix - directories and resources because in a COFF file all entries in a - directory are sorted together, whether the entries are - subdirectories or resources. */ - -struct res_entry -{ - /* Next entry. */ - struct res_entry *next; - /* Resource ID. */ - struct res_id id; - /* Non-zero if this entry is a subdirectory rather than a leaf. */ - unsigned int subdir : 1; - union - { - /* If the subdir field is non-zero, this is a pointer to the - subdirectory. */ - struct res_directory *dir; - /* If the subdir field is zero, this is a pointer to the resource - data. */ - struct res_resource *res; - } u; -}; - -/* Types of resources. */ - -enum res_type -{ - RES_TYPE_UNINITIALIZED, - RES_TYPE_ACCELERATOR, - RES_TYPE_BITMAP, - RES_TYPE_CURSOR, - RES_TYPE_GROUP_CURSOR, - RES_TYPE_DIALOG, - RES_TYPE_FONT, - RES_TYPE_FONTDIR, - RES_TYPE_ICON, - RES_TYPE_GROUP_ICON, - RES_TYPE_MENU, - RES_TYPE_MESSAGETABLE, - RES_TYPE_RCDATA, - RES_TYPE_STRINGTABLE, - RES_TYPE_USERDATA, - RES_TYPE_VERSIONINFO -}; - -/* A res file and a COFF file store information differently. The - res_info structures holds data which in a res file is stored with - each resource, but in a COFF file is stored elsewhere. */ - -struct res_res_info -{ - /* Language. In a COFF file, the third level of the directory is - keyed by the language, so the language of a resource is defined - by its location in the resource tree. */ - unsigned short language; - /* Characteristics of the resource. Entirely user defined. In a - COFF file, the res_directory structure has a characteristics - field, but I don't know if it's related to the one in the res - file. */ - unsigned long characteristics; - /* Version of the resource. Entirely user defined. In a COFF file, - the res_directory structure has a characteristics field, but I - don't know if it's related to the one in the res file. */ - unsigned long version; - /* Memory flags. This is a combination of the MEMFLAG values - defined below. Most of these values are historical, and are not - meaningful for win32. I don't think there is any way to store - this information in a COFF file. */ - unsigned short memflags; -}; - -/* Each resource in a COFF file has some information which can does - not appear in a res file. */ - -struct res_coff_info -{ - /* The code page used for the data. I don't really know what this - should be. */ - unsigned long codepage; - /* A resource entry in a COFF file has a reserved field, which we - record here when reading a COFF file. When writing a COFF file, - we set this field to zero. */ - unsigned long reserved; -}; - -/* Resource data is stored in a res_resource structure. */ - -struct res_resource -{ - /* The type of resource. */ - enum res_type type; - /* The data for the resource. */ - union - { - struct - { - unsigned long length; - const unsigned char *data; - } data; - struct accelerator *acc; - struct cursor *cursor; - struct group_cursor *group_cursor; - struct dialog *dialog; - struct fontdir *fontdir; - struct group_icon *group_icon; - struct menu *menu; - struct rcdata_item *rcdata; - struct stringtable *stringtable; - struct rcdata_item *userdata; - struct versioninfo *versioninfo; - } u; - /* Information from a res file. */ - struct res_res_info res_info; - /* Information from a COFF file. */ - struct res_coff_info coff_info; -}; - -#define SUBLANG_SHIFT 10 - -/* Memory flags in the memflags field of a struct res_resource. */ - -#define MEMFLAG_MOVEABLE 0x10 -#define MEMFLAG_PURE 0x20 -#define MEMFLAG_PRELOAD 0x40 -#define MEMFLAG_DISCARDABLE 0x1000 - -/* Standard resource type codes. These are used in the ID field of a - res_entry structure. */ - -#define RT_CURSOR 1 -#define RT_BITMAP 2 -#define RT_ICON 3 -#define RT_MENU 4 -#define RT_DIALOG 5 -#define RT_STRING 6 -#define RT_FONTDIR 7 -#define RT_FONT 8 -#define RT_ACCELERATOR 9 -#define RT_RCDATA 10 -#define RT_MESSAGETABLE 11 -#define RT_GROUP_CURSOR 12 -#define RT_GROUP_ICON 14 -#define RT_VERSION 16 -#define RT_DLGINCLUDE 17 -#define RT_PLUGPLAY 19 -#define RT_VXD 20 -#define RT_ANICURSOR 21 -#define RT_ANIICON 22 - -/* An accelerator resource is a linked list of these structures. */ - -struct accelerator -{ - /* Next accelerator. */ - struct accelerator *next; - /* Flags. A combination of the ACC values defined below. */ - unsigned short flags; - /* Key value. */ - unsigned short key; - /* Resource ID. */ - unsigned short id; -}; - -/* Accelerator flags in the flags field of a struct accelerator. - These are the same values that appear in a res file. I hope. */ - -#define ACC_VIRTKEY 0x01 -#define ACC_NOINVERT 0x02 -#define ACC_SHIFT 0x04 -#define ACC_CONTROL 0x08 -#define ACC_ALT 0x10 -#define ACC_LAST 0x80 - -/* A cursor resource. */ - -struct cursor -{ - /* X coordinate of hotspot. */ - short xhotspot; - /* Y coordinate of hotspot. */ - short yhotspot; - /* Length of bitmap data. */ - unsigned long length; - /* Data. */ - const unsigned char *data; -}; - -/* A group_cursor resource is a list of group_cursor structures. */ - -struct group_cursor -{ - /* Next cursor in group. */ - struct group_cursor *next; - /* Width. */ - unsigned short width; - /* Height. */ - unsigned short height; - /* Planes. */ - unsigned short planes; - /* Bits per pixel. */ - unsigned short bits; - /* Number of bytes in cursor resource. */ - unsigned long bytes; - /* Index of cursor resource. */ - unsigned short index; -}; - -/* A dialog resource. */ - -struct dialog -{ - /* Basic window style. */ - unsigned long style; - /* Extended window style. */ - unsigned long exstyle; - /* X coordinate. */ - unsigned short x; - /* Y coordinate. */ - unsigned short y; - /* Width. */ - unsigned short width; - /* Height. */ - unsigned short height; - /* Menu name. */ - struct res_id menu; - /* Class name. */ - struct res_id class; - /* Caption. */ - unichar *caption; - /* Font point size. */ - unsigned short pointsize; - /* Font name. */ - unichar *font; - /* Extended information for a dialogex. */ - struct dialog_ex *ex; - /* Controls. */ - struct dialog_control *controls; -}; - -/* An extended dialog has additional information. */ - -struct dialog_ex -{ - /* Help ID. */ - unsigned long help; - /* Font weight. */ - unsigned short weight; - /* Whether the font is italic. */ - unsigned char italic; - /* Character set. */ - unsigned char charset; -}; - -/* Window style flags, from the winsup Defines.h header file. These - can appear in the style field of a struct dialog or a struct - dialog_control. */ - -#define CW_USEDEFAULT (0x80000000) -#define WS_BORDER (0x800000L) -#define WS_CAPTION (0xc00000L) -#define WS_CHILD (0x40000000L) -#define WS_CHILDWINDOW (0x40000000L) -#define WS_CLIPCHILDREN (0x2000000L) -#define WS_CLIPSIBLINGS (0x4000000L) -#define WS_DISABLED (0x8000000L) -#define WS_DLGFRAME (0x400000L) -#define WS_GROUP (0x20000L) -#define WS_HSCROLL (0x100000L) -#define WS_ICONIC (0x20000000L) -#define WS_MAXIMIZE (0x1000000L) -#define WS_MAXIMIZEBOX (0x10000L) -#define WS_MINIMIZE (0x20000000L) -#define WS_MINIMIZEBOX (0x20000L) -#define WS_OVERLAPPED (0L) -#define WS_OVERLAPPEDWINDOW (0xcf0000L) -#define WS_POPUP (0x80000000L) -#define WS_POPUPWINDOW (0x80880000L) -#define WS_SIZEBOX (0x40000L) -#define WS_SYSMENU (0x80000L) -#define WS_TABSTOP (0x10000L) -#define WS_THICKFRAME (0x40000L) -#define WS_TILED (0L) -#define WS_TILEDWINDOW (0xcf0000L) -#define WS_VISIBLE (0x10000000L) -#define WS_VSCROLL (0x200000L) -#define MDIS_ALLCHILDSTYLES (0x1) -#define BS_3STATE (0x5L) -#define BS_AUTO3STATE (0x6L) -#define BS_AUTOCHECKBOX (0x3L) -#define BS_AUTORADIOBUTTON (0x9L) -#define BS_BITMAP (0x80L) -#define BS_BOTTOM (0x800L) -#define BS_CENTER (0x300L) -#define BS_CHECKBOX (0x2L) -#define BS_DEFPUSHBUTTON (0x1L) -#define BS_GROUPBOX (0x7L) -#define BS_ICON (0x40L) -#define BS_LEFT (0x100L) -#define BS_LEFTTEXT (0x20L) -#define BS_MULTILINE (0x2000L) -#define BS_NOTIFY (0x4000L) -#define BS_OWNERDRAW (0xbL) -#define BS_PUSHBOX (0xcL) /* FIXME! What should this be? */ -#define BS_PUSHBUTTON (0L) -#define BS_PUSHLIKE (0x1000L) -#define BS_RADIOBUTTON (0x4L) -#define BS_RIGHT (0x200L) -#define BS_RIGHTBUTTON (0x20L) -#define BS_TEXT (0L) -#define BS_TOP (0x400L) -#define BS_USERBUTTON (0x8L) -#define BS_VCENTER (0xc00L) -#define CBS_AUTOHSCROLL (0x40L) -#define CBS_DISABLENOSCROLL (0x800L) -#define CBS_DROPDOWN (0x2L) -#define CBS_DROPDOWNLIST (0x3L) -#define CBS_HASSTRINGS (0x200L) -#define CBS_LOWERCASE (0x4000L) -#define CBS_NOINTEGRALHEIGHT (0x400L) -#define CBS_OEMCONVERT (0x80L) -#define CBS_OWNERDRAWFIXED (0x10L) -#define CBS_OWNERDRAWVARIABLE (0x20L) -#define CBS_SIMPLE (0x1L) -#define CBS_SORT (0x100L) -#define CBS_UPPERCASE (0x2000L) -#define ES_AUTOHSCROLL (0x80L) -#define ES_AUTOVSCROLL (0x40L) -#define ES_CENTER (0x1L) -#define ES_LEFT (0L) -#define ES_LOWERCASE (0x10L) -#define ES_MULTILINE (0x4L) -#define ES_NOHIDESEL (0x100L) -#define ES_NUMBER (0x2000L) -#define ES_OEMCONVERT (0x400L) -#define ES_PASSWORD (0x20L) -#define ES_READONLY (0x800L) -#define ES_RIGHT (0x2L) -#define ES_UPPERCASE (0x8L) -#define ES_WANTRETURN (0x1000L) -#define LBS_DISABLENOSCROLL (0x1000L) -#define LBS_EXTENDEDSEL (0x800L) -#define LBS_HASSTRINGS (0x40L) -#define LBS_MULTICOLUMN (0x200L) -#define LBS_MULTIPLESEL (0x8L) -#define LBS_NODATA (0x2000L) -#define LBS_NOINTEGRALHEIGHT (0x100L) -#define LBS_NOREDRAW (0x4L) -#define LBS_NOSEL (0x4000L) -#define LBS_NOTIFY (0x1L) -#define LBS_OWNERDRAWFIXED (0x10L) -#define LBS_OWNERDRAWVARIABLE (0x20L) -#define LBS_SORT (0x2L) -#define LBS_STANDARD (0xa00003L) -#define LBS_USETABSTOPS (0x80L) -#define LBS_WANTKEYBOARDINPUT (0x400L) -#define SBS_BOTTOMALIGN (0x4L) -#define SBS_HORZ (0L) -#define SBS_LEFTALIGN (0x2L) -#define SBS_RIGHTALIGN (0x4L) -#define SBS_SIZEBOX (0x8L) -#define SBS_SIZEBOXBOTTOMRIGHTALIGN (0x4L) -#define SBS_SIZEBOXTOPLEFTALIGN (0x2L) -#define SBS_SIZEGRIP (0x10L) -#define SBS_TOPALIGN (0x2L) -#define SBS_VERT (0x1L) -#define SS_BITMAP (0xeL) -#define SS_BLACKFRAME (0x7L) -#define SS_BLACKRECT (0x4L) -#define SS_CENTER (0x1L) -#define SS_CENTERIMAGE (0x200L) -#define SS_ENHMETAFILE (0xfL) -#define SS_ETCHEDFRAME (0x12L) -#define SS_ETCHEDHORZ (0x10L) -#define SS_ETCHEDVERT (0x11L) -#define SS_GRAYFRAME (0x8L) -#define SS_GRAYRECT (0x5L) -#define SS_ICON (0x3L) -#define SS_LEFT (0L) -#define SS_LEFTNOWORDWRAP (0xcL) -#define SS_NOPREFIX (0x80L) -#define SS_NOTIFY (0x100L) -#define SS_OWNERDRAW (0xdL) -#define SS_REALSIZEIMAGE (0x800L) -#define SS_RIGHT (0x2L) -#define SS_RIGHTJUST (0x400L) -#define SS_SIMPLE (0xbL) -#define SS_SUNKEN (0x1000L) -#define SS_USERITEM (0xaL) -#define SS_WHITEFRAME (0x9L) -#define SS_WHITERECT (0x6L) -#define DS_3DLOOK (0x4L) -#define DS_ABSALIGN (0x1L) -#define DS_CENTER (0x800L) -#define DS_CENTERMOUSE (0x1000L) -#define DS_CONTEXTHELP (0x2000L) -#define DS_CONTROL (0x400L) -#define DS_FIXEDSYS (0x8L) -#define DS_LOCALEDIT (0x20L) -#define DS_MODALFRAME (0x80L) -#define DS_NOFAILCREATE (0x10L) -#define DS_NOIDLEMSG (0x100L) -#define DS_SETFONT (0x40L) -#define DS_SETFOREGROUND (0x200L) -#define DS_SYSMODAL (0x2L) - -/* A dialog control. */ - -struct dialog_control -{ - /* Next control. */ - struct dialog_control *next; - /* ID. */ - unsigned short id; - /* Style. */ - unsigned long style; - /* Extended style. */ - unsigned long exstyle; - /* X coordinate. */ - unsigned short x; - /* Y coordinate. */ - unsigned short y; - /* Width. */ - unsigned short width; - /* Height. */ - unsigned short height; - /* Class name. */ - struct res_id class; - /* Associated text. */ - struct res_id text; - /* Extra data for the window procedure. */ - struct rcdata_item *data; - /* Help ID. Only used in an extended dialog. */ - unsigned long help; -}; - -/* Control classes. These can be used as the ID field in a struct - dialog_control. */ - -#define CTL_BUTTON 0x80 -#define CTL_EDIT 0x81 -#define CTL_STATIC 0x82 -#define CTL_LISTBOX 0x83 -#define CTL_SCROLLBAR 0x84 -#define CTL_COMBOBOX 0x85 - -/* A fontdir resource is a list of fontdir structures. */ - -struct fontdir -{ - struct fontdir *next; - /* Index of font entry. */ - short index; - /* Length of font information. */ - unsigned long length; - /* Font information. */ - const unsigned char *data; -}; - -/* A group_icon resource is a list of group_icon structures. */ - -struct group_icon -{ - /* Next icon in group. */ - struct group_icon *next; - /* Width. */ - unsigned char width; - /* Height. */ - unsigned char height; - /* Color count. */ - unsigned char colors; - /* Planes. */ - unsigned short planes; - /* Bits per pixel. */ - unsigned short bits; - /* Number of bytes in cursor resource. */ - unsigned long bytes; - /* Index of cursor resource. */ - unsigned short index; -}; - -/* A menu resource. */ - -struct menu -{ - /* List of menuitems. */ - struct menuitem *items; - /* Help ID. I don't think there is any way to set this in an rc - file, but it can appear in the binary format. */ - unsigned long help; -}; - -/* A menu resource is a list of menuitem structures. */ - -struct menuitem -{ - /* Next menuitem. */ - struct menuitem *next; - /* Type. In a normal menu, rather than a menuex, this is the flags - field. */ - unsigned long type; - /* State. This is only used in a menuex. */ - unsigned long state; - /* Id. */ - unsigned short id; - /* Unicode text. */ - unichar *text; - /* Popup menu items for a popup. */ - struct menuitem *popup; - /* Help ID. This is only used in a menuex. */ - unsigned long help; -}; - -/* Menu item flags. These can appear in the flags field of a struct - menuitem. */ - -#define MENUITEM_GRAYED 0x001 -#define MENUITEM_INACTIVE 0x002 -#define MENUITEM_BITMAP 0x004 -#define MENUITEM_OWNERDRAW 0x100 -#define MENUITEM_CHECKED 0x008 -#define MENUITEM_POPUP 0x010 -#define MENUITEM_MENUBARBREAK 0x020 -#define MENUITEM_MENUBREAK 0x040 -#define MENUITEM_ENDMENU 0x080 -#define MENUITEM_HELP 0x4000 - -/* An rcdata resource is a pointer to a list of rcdata_item - structures. */ - -struct rcdata_item -{ - /* Next data item. */ - struct rcdata_item *next; - /* Type of data. */ - enum - { - RCDATA_WORD, - RCDATA_DWORD, - RCDATA_STRING, - RCDATA_WSTRING, - RCDATA_BUFFER - } type; - union - { - unsigned int word; - unsigned long dword; - struct - { - unsigned long length; - const char *s; - } string; - struct - { - unsigned long length; - const unichar *w; - } wstring; - struct - { - unsigned long length; - const unsigned char *data; - } buffer; - } u; -}; - -/* A stringtable resource is a pointer to a stringtable structure. */ - -struct stringtable -{ - /* Each stringtable resource is a list of 16 unicode strings. */ - struct - { - /* Length of string. */ - int length; - /* String data if length > 0. */ - unichar *string; - } strings[16]; -}; - -/* A versioninfo resource points to a versioninfo structure. */ - -struct versioninfo -{ - /* Fixed version information. */ - struct fixed_versioninfo *fixed; - /* Variable version information. */ - struct ver_info *var; -}; - -/* The fixed portion of a versioninfo resource. */ - -struct fixed_versioninfo -{ - /* The file version, which is two 32 bit integers. */ - unsigned long file_version_ms; - unsigned long file_version_ls; - /* The product version, which is two 32 bit integers. */ - unsigned long product_version_ms; - unsigned long product_version_ls; - /* The file flags mask. */ - unsigned long file_flags_mask; - /* The file flags. */ - unsigned long file_flags; - /* The OS type. */ - unsigned long file_os; - /* The file type. */ - unsigned long file_type; - /* The file subtype. */ - unsigned long file_subtype; - /* The date, which in Windows is two 32 bit integers. */ - unsigned long file_date_ms; - unsigned long file_date_ls; -}; - -/* A list of variable version information. */ - -struct ver_info -{ - /* Next item. */ - struct ver_info *next; - /* Type of data. */ - enum { VERINFO_STRING, VERINFO_VAR } type; - union - { - /* StringFileInfo data. */ - struct - { - /* Language. */ - unichar *language; - /* Strings. */ - struct ver_stringinfo *strings; - } string; - /* VarFileInfo data. */ - struct - { - /* Key. */ - unichar *key; - /* Values. */ - struct ver_varinfo *var; - } var; - } u; -}; - -/* A list of string version information. */ - -struct ver_stringinfo -{ - /* Next string. */ - struct ver_stringinfo *next; - /* Key. */ - unichar *key; - /* Value. */ - unichar *value; -}; - -/* A list of variable version information. */ - -struct ver_varinfo -{ - /* Next item. */ - struct ver_varinfo *next; - /* Language ID. */ - unsigned short language; - /* Character set ID. */ - unsigned short charset; -}; - -/* This structure is used when converting resource information to - binary. */ - -struct bindata -{ - /* Next data. */ - struct bindata *next; - /* Length of data. */ - unsigned long length; - /* Data. */ - unsigned char *data; -}; +#include "windint.h" extern int verbose; /* Function declarations. */ -extern struct res_directory *read_rc_file - (const char *, const char *, const char *, int, int); -extern struct res_directory *read_res_file (const char *); -extern struct res_directory *read_coff_rsrc (const char *, const char *); -extern void write_rc_file (const char *, const struct res_directory *); -extern void write_res_file (const char *, const struct res_directory *); -extern void write_coff_file - (const char *, const char *, const struct res_directory *); +extern rc_res_directory *read_rc_file (const char *, const char *, const char *, int, int); +extern rc_res_directory *read_res_file (const char *); +extern rc_res_directory *read_coff_rsrc (const char *, const char *); +extern void write_rc_file (const char *, const rc_res_directory *); +extern void write_res_file (const char *, const rc_res_directory *); +extern void write_coff_file (const char *, const char *, const rc_res_directory *); -extern struct res_resource *bin_to_res - (struct res_id, const unsigned char *, unsigned long, int); -extern struct bindata *res_to_bin (const struct res_resource *, int); +extern rc_res_resource *bin_to_res (windres_bfd *, rc_res_id, const bfd_byte *, + rc_uint_type); +extern rc_uint_type res_to_bin (windres_bfd *, rc_uint_type, const rc_res_resource *); -extern FILE *open_file_search - (const char *, const char *, const char *, char **); +extern FILE *open_file_search (const char *, const char *, const char *, char **); -extern void *res_alloc (size_t); -extern void *reswr_alloc (size_t); +extern void *res_alloc (rc_uint_type); +extern void *reswr_alloc (rc_uint_type); /* Resource ID handling. */ -extern int res_id_cmp (struct res_id, struct res_id); -extern void res_id_print (FILE *, struct res_id, int); -extern void res_ids_print (FILE *, int, const struct res_id *); -extern void res_string_to_id (struct res_id *, const char *); +extern int res_id_cmp (rc_res_id, rc_res_id); +extern void res_id_print (FILE *, rc_res_id, int); +extern void res_ids_print (FILE *, int, const rc_res_id *); +extern void res_string_to_id (rc_res_id *, const char *); +extern void res_unistring_to_id (rc_res_id *, const unichar *); /* Manipulation of the resource tree. */ -extern struct res_resource *define_resource - (struct res_directory **, int, const struct res_id *, int); -extern struct res_resource *define_standard_resource - (struct res_directory **, int, struct res_id, int, int); +extern rc_res_resource *define_resource (rc_res_directory **, int, const rc_res_id *, + int); +extern rc_res_resource *define_standard_resource (rc_res_directory **, int, rc_res_id, + rc_uint_type, int); -extern int extended_dialog (const struct dialog *); -extern int extended_menu (const struct menu *); +extern int extended_dialog (const rc_dialog *); +extern int extended_menu (const rc_menu *); /* Communication between the rc file support and the parser and lexer. */ extern int yydebug; -extern FILE *yyin; extern char *rc_filename; extern int rc_lineno; @@ -803,52 +82,40 @@ extern void rcparse_discard_strings (void); extern void rcparse_rcdata (void); extern void rcparse_normal (void); -extern void define_accelerator - (struct res_id, const struct res_res_info *, struct accelerator *); -extern void define_bitmap - (struct res_id, const struct res_res_info *, const char *); -extern void define_cursor - (struct res_id, const struct res_res_info *, const char *); -extern void define_dialog - (struct res_id, const struct res_res_info *, const struct dialog *); -extern struct dialog_control *define_control - (const struct res_id, unsigned long, unsigned long, unsigned long, - unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); -extern struct dialog_control *define_icon_control - (struct res_id, unsigned long, unsigned long, unsigned long, unsigned long, - unsigned long, unsigned long, struct rcdata_item *, struct dialog_ex *); -extern void define_font - (struct res_id, const struct res_res_info *, const char *); -extern void define_icon - (struct res_id, const struct res_res_info *, const char *); -extern void define_menu - (struct res_id, const struct res_res_info *, struct menuitem *); -extern struct menuitem *define_menuitem - (const char *, int, unsigned long, unsigned long, unsigned long, - struct menuitem *); -extern void define_messagetable - (struct res_id, const struct res_res_info *, const char *); -extern void define_rcdata - (struct res_id, const struct res_res_info *, struct rcdata_item *); -extern void define_rcdata_file - (struct res_id, const struct res_res_info *, const char *); -extern struct rcdata_item *define_rcdata_string - (const char *, unsigned long); -extern struct rcdata_item *define_rcdata_number (unsigned long, int); -extern void define_stringtable - (const struct res_res_info *, unsigned long, const char *); -extern void define_user_data - (struct res_id, struct res_id, const struct res_res_info *, - struct rcdata_item *); -extern void define_user_file - (struct res_id, struct res_id, const struct res_res_info *, const char *); -extern void define_versioninfo - (struct res_id, int, struct fixed_versioninfo *, struct ver_info *); -extern struct ver_info *append_ver_stringfileinfo - (struct ver_info *, const char *, struct ver_stringinfo *); -extern struct ver_info *append_ver_varfileinfo - (struct ver_info *, const char *, struct ver_varinfo *); -extern struct ver_stringinfo *append_verval - (struct ver_stringinfo *, const char *, const char *); -extern struct ver_varinfo *append_vertrans - (struct ver_varinfo *, unsigned long, unsigned long); +extern void define_accelerator (rc_res_id, const rc_res_res_info *, rc_accelerator *); +extern void define_bitmap (rc_res_id, const rc_res_res_info *, const char *); +extern void define_cursor (rc_res_id, const rc_res_res_info *, const char *); +extern void define_dialog (rc_res_id, const rc_res_res_info *, const rc_dialog *); +extern rc_dialog_control *define_control (const rc_res_id, rc_uint_type, rc_uint_type, + rc_uint_type, rc_uint_type, rc_uint_type, + const rc_res_id, rc_uint_type, rc_uint_type); +extern rc_dialog_control *define_icon_control (rc_res_id, rc_uint_type, rc_uint_type, + rc_uint_type, rc_uint_type, rc_uint_type, + rc_uint_type, rc_rcdata_item *, + rc_dialog_ex *); +extern void define_font (rc_res_id, const rc_res_res_info *, const char *); +extern void define_icon (rc_res_id, const rc_res_res_info *, const char *); +extern void define_menu (rc_res_id, const rc_res_res_info *, rc_menuitem *); +extern rc_menuitem *define_menuitem (const unichar *, rc_uint_type, rc_uint_type, + rc_uint_type, rc_uint_type, rc_menuitem *); +extern void define_messagetable (rc_res_id, const rc_res_res_info *, const char *); +extern void define_rcdata (rc_res_id, const rc_res_res_info *, rc_rcdata_item *); +extern void define_rcdata_file (rc_res_id, const rc_res_res_info *, const char *); +extern rc_rcdata_item *define_rcdata_string (const char *, rc_uint_type); +extern rc_rcdata_item *define_rcdata_unistring (const unichar *, rc_uint_type); +extern rc_rcdata_item *define_rcdata_number (rc_uint_type, int); +extern void define_stringtable (const rc_res_res_info *, rc_uint_type, const unichar *); +extern void define_user_data (rc_res_id, rc_res_id, const rc_res_res_info *, rc_rcdata_item *); +extern void define_toolbar (rc_res_id, rc_res_res_info *, rc_uint_type ,rc_uint_type ,rc_toolbar_item *); +extern void define_user_file (rc_res_id, rc_res_id, const rc_res_res_info *, const char *); +extern void define_versioninfo (rc_res_id, rc_uint_type, rc_fixed_versioninfo *, rc_ver_info *); +extern rc_ver_info *append_ver_stringfileinfo (rc_ver_info *, const char *, rc_ver_stringinfo *); +extern rc_ver_info *append_ver_varfileinfo (rc_ver_info *, const unichar *, rc_ver_varinfo *); +extern rc_ver_stringinfo *append_verval (rc_ver_stringinfo *, const unichar *, const unichar *); +extern rc_ver_varinfo *append_vertrans (rc_ver_varinfo *, rc_uint_type, rc_uint_type); + +extern bfd *windres_open_as_binary (const char *, int); + +extern int wr_printcomment (FILE *, const char *, ...); +extern int wr_print (FILE *, const char *, ...); +#define wr_print_flush(FP) wr_print ((FP),NULL) diff --git a/binutils/winduni.c b/binutils/winduni.c index b172b5e2196..f1bd58acf3b 100644 --- a/binutils/winduni.c +++ b/binutils/winduni.c @@ -1,6 +1,8 @@ /* winduni.c -- unicode support for the windres program. - Copyright 1997, 1998, 2000, 2001, 2003 Free Software Foundation, Inc. + Copyright 1997, 1998, 2000, 2001, 2003, 2007 + Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. + Rewritten by Kai Tietz, Onevision. This file is part of GNU Binutils. @@ -27,48 +29,178 @@ hosts, but that seems better than not really supporting unicode at all. */ +#include "sysdep.h" #include "bfd.h" +#include "libiberty.h" /* for xstrdup */ #include "bucomm.h" +/* Must be include before windows.h and winnls.h. */ +#if defined (_WIN32) || defined (__CYGWIN__) +#include +#include +#endif #include "winduni.h" #include "safe-ctype.h" -#ifdef _WIN32 -#include +#if HAVE_ICONV_H +#include #endif +static rc_uint_type wind_WideCharToMultiByte (rc_uint_type, const unichar *, char *, rc_uint_type); +static rc_uint_type wind_MultiByteToWideChar (rc_uint_type, const char *, unichar *, rc_uint_type); +static int unichar_isascii (const unichar *, rc_uint_type); + +/* Convert an ASCII string to a unicode string. We just copy it, + expanding chars to shorts, rather than doing something intelligent. */ + +#if !defined (_WIN32) && !defined (__CYGWIN__) + +/* Codepages mapped. */ +static local_iconv_map codepages[] = +{ + { 0, "MS-ANSI" }, + { 1, "WINDOWS-1252" }, + { 437, "MS-ANSI" }, + { 737, "MS-GREEK" }, + { 775, "WINBALTRIM" }, + { 850, "MS-ANSI" }, + { 852, "MS-EE" }, + { 857, "MS-TURK" }, + { 862, "CP862" }, + { 864, "CP864" }, + { 866, "MS-CYRL" }, + { 874, "WINDOWS-874" }, + { 932, "CP932" }, + { 936, "CP936" }, + { 949, "CP949" }, + { 950, "CP950" }, + { 1250, "WINDOWS-1250" }, + { 1251, "WINDOWS-1251" }, + { 1252, "WINDOWS-1252" }, + { 1253, "WINDOWS-1253" }, + { 1254, "WINDOWS-1254" }, + { 1255, "WINDOWS-1255" }, + { 1256, "WINDOWS-1256" }, + { 1257, "WINDOWS-1257" }, + { 1258, "WINDOWS-1258" }, + { CP_UTF7, "UTF-7" }, + { CP_UTF8, "UTF-8" }, + { CP_UTF16, "UTF-16" }, + { (rc_uint_type) -1, NULL } +}; + +/* Languages supported. */ +static const wind_language_t languages[] = +{ + { 0x0000, 437, 1252, "Neutral", "Neutral" }, + { 0x0401, 864, 1256, "Arabic", "Saudi Arabia" }, { 0x0402, 866, 1251, "Bulgarian", "Bulgaria" }, + { 0x0403, 850, 1252, "Catalan", "Spain" }, { 0x0404, 950, 950, "Chinese", "Taiwan" }, + { 0x0405, 852, 1250, "Czech", "Czech Republic" }, { 0x0406, 850, 1252, "Danish", "Denmark" }, + { 0x0407, 850, 1252, "German", "Germany" }, { 0x0408, 737, 1253, "Greek", "Greece" }, + { 0x0409, 437, 1252, "English", "United States" }, { 0x040A, 850, 1252, "Spanish - Traditional Sort", "Spain" }, + { 0x040B, 850, 1252, "Finnish", "Finland" }, { 0x040C, 850, 1252, "French", "France" }, + { 0x040D, 862, 1255, "Hebrew", "Israel" }, { 0x040E, 852, 1250, "Hungarian", "Hungary" }, + { 0x040F, 850, 1252, "Icelandic", "Iceland" }, { 0x0410, 850, 1252, "Italian", "Italy" }, + { 0x0411, 932, 932, "Japanese", "Japan" }, { 0x0412, 949, 949, "Korean", "Korea (south)" }, + { 0x0413, 850, 1252, "Dutch", "Netherlands" }, { 0x0414, 850, 1252, "Norwegian (Bokml)", "Norway" }, + { 0x0415, 852, 1250, "Polish", "Poland" }, { 0x0416, 850, 1252, "Portuguese", "Brazil" }, + { 0x0418, 852, 1250, "Romanian", "Romania" }, { 0x0419, 866, 1251, "Russian", "Russia" }, + { 0x041A, 852, 1250, "Croatian", "Croatia" }, { 0x041B, 852, 1250, "Slovak", "Slovakia" }, + { 0x041C, 852, 1250, "Albanian", "Albania" }, { 0x041D, 850, 1252, "Swedish", "Sweden" }, + { 0x041E, 874, 874, "Thai", "Thailand" }, { 0x041F, 857, 1254, "Turkish", "Turkey" }, + { 0x0421, 850, 1252, "Indonesian", "Indonesia" }, { 0x0422, 866, 1251, "Ukrainian", "Ukraine" }, + { 0x0423, 866, 1251, "Belarusian", "Belarus" }, { 0x0424, 852, 1250, "Slovene", "Slovenia" }, + { 0x0425, 775, 1257, "Estonian", "Estonia" }, { 0x0426, 775, 1257, "Latvian", "Latvia" }, + { 0x0427, 775, 1257, "Lithuanian", "Lithuania" }, + { 0x0429, 864, 1256, "Arabic", "Farsi" }, { 0x042A,1258, 1258, "Vietnamese", "Vietnam" }, + { 0x042D, 850, 1252, "Basque", "Spain" }, + { 0x042F, 866, 1251, "Macedonian", "Former Yugoslav Republic of Macedonia" }, + { 0x0436, 850, 1252, "Afrikaans", "South Africa" }, + { 0x0438, 850, 1252, "Faroese", "Faroe Islands" }, + { 0x043C, 437, 1252, "Irish", "Ireland" }, + { 0x043E, 850, 1252, "Malay", "Malaysia" }, + { 0x0801, 864, 1256, "Arabic", "Iraq" }, + { 0x0804, 936, 936, "Chinese (People's republic of China)", "People's republic of China" }, + { 0x0807, 850, 1252, "German", "Switzerland" }, + { 0x0809, 850, 1252, "English", "United Kingdom" }, { 0x080A, 850, 1252, "Spanish", "Mexico" }, + { 0x080C, 850, 1252, "French", "Belgium" }, + { 0x0810, 850, 1252, "Italian", "Switzerland" }, + { 0x0813, 850, 1252, "Dutch", "Belgium" }, { 0x0814, 850, 1252, "Norwegian (Nynorsk)", "Norway" }, + { 0x0816, 850, 1252, "Portuguese", "Portugal" }, + { 0x081A, 852, 1252, "Serbian (latin)", "Yugoslavia" }, + { 0x081D, 850, 1252, "Swedish (Finland)", "Finland" }, + { 0x0C01, 864, 1256, "Arabic", "Egypt" }, + { 0x0C04, 950, 950, "Chinese", "Hong Kong" }, + { 0x0C07, 850, 1252, "German", "Austria" }, + { 0x0C09, 850, 1252, "English", "Australia" }, { 0x0C0A, 850, 1252, "Spanish - International Sort", "Spain" }, + { 0x0C0C, 850, 1252, "French", "Canada"}, + { 0x0C1A, 855, 1251, "Serbian (Cyrillic)", "Serbia" }, + { 0x1001, 864, 1256, "Arabic", "Libya" }, + { 0x1004, 936, 936, "Chinese", "Singapore" }, + { 0x1007, 850, 1252, "German", "Luxembourg" }, + { 0x1009, 850, 1252, "English", "Canada" }, + { 0x100A, 850, 1252, "Spanish", "Guatemala" }, + { 0x100C, 850, 1252, "French", "Switzerland" }, + { 0x1401, 864, 1256, "Arabic", "Algeria" }, + { 0x1407, 850, 1252, "German", "Liechtenstein" }, + { 0x1409, 850, 1252, "English", "New Zealand" }, { 0x140A, 850, 1252, "Spanish", "Costa Rica" }, + { 0x140C, 850, 1252, "French", "Luxembourg" }, + { 0x1801, 864, 1256, "Arabic", "Morocco" }, + { 0x1809, 850, 1252, "English", "Ireland" }, { 0x180A, 850, 1252, "Spanish", "Panama" }, + { 0x180C, 850, 1252, "French", "Monaco" }, + { 0x1C01, 864, 1256, "Arabic", "Tunisia" }, + { 0x1C09, 437, 1252, "English", "South Africa" }, { 0x1C0A, 850, 1252, "Spanish", "Dominican Republic" }, + { 0x2001, 864, 1256, "Arabic", "Oman" }, + { 0x2009, 850, 1252, "English", "Jamaica" }, { 0x200A, 850, 1252, "Spanish", "Venezuela" }, + { 0x2401, 864, 1256, "Arabic", "Yemen" }, + { 0x2409, 850, 1252, "English", "Caribbean" }, { 0x240A, 850, 1252, "Spanish", "Colombia" }, + { 0x2801, 864, 1256, "Arabic", "Syria" }, + { 0x2809, 850, 1252, "English", "Belize" }, { 0x280A, 850, 1252, "Spanish", "Peru" }, + { 0x2C01, 864, 1256, "Arabic", "Jordan" }, + { 0x2C09, 437, 1252, "English", "Trinidad & Tobago" },{ 0x2C0A, 850, 1252, "Spanish", "Argentina" }, + { 0x3001, 864, 1256, "Arabic", "Lebanon" }, + { 0x3009, 437, 1252, "English", "Zimbabwe" }, { 0x300A, 850, 1252, "Spanish", "Ecuador" }, + { 0x3401, 864, 1256, "Arabic", "Kuwait" }, + { 0x3409, 437, 1252, "English", "Philippines" }, { 0x340A, 850, 1252, "Spanish", "Chile" }, + { 0x3801, 864, 1256, "Arabic", "United Arab Emirates" }, + { 0x380A, 850, 1252, "Spanish", "Uruguay" }, + { 0x3C01, 864, 1256, "Arabic", "Bahrain" }, + { 0x3C0A, 850, 1252, "Spanish", "Paraguay" }, + { 0x4001, 864, 1256, "Arabic", "Qatar" }, + { 0x400A, 850, 1252, "Spanish", "Bolivia" }, + { 0x440A, 850, 1252, "Spanish", "El Salvador" }, + { 0x480A, 850, 1252, "Spanish", "Honduras" }, + { 0x4C0A, 850, 1252, "Spanish", "Nicaragua" }, + { 0x500A, 850, 1252, "Spanish", "Puerto Rico" }, + { (unsigned) -1, 0, 0, NULL, NULL } +}; + +#endif + +/* Specifies the default codepage to be used for unicode + transformations. By default this is CP_ACP. */ +rc_uint_type wind_default_codepage = CP_ACP; + +/* Specifies the currently used codepage for unicode + transformations. By default this is CP_ACP. */ +rc_uint_type wind_current_codepage = CP_ACP; + /* Convert an ASCII string to a unicode string. We just copy it, expanding chars to shorts, rather than doing something intelligent. */ void -unicode_from_ascii (int *length, unichar **unicode, const char *ascii) +unicode_from_ascii (rc_uint_type *length, unichar **unicode, const char *ascii) { - int len; -#ifndef _WIN32 - const char *s; - unsigned short *w; + unicode_from_codepage (length, unicode, ascii, wind_current_codepage); +} - len = strlen (ascii); - *unicode = ((unichar *) res_alloc ((len + 1) * sizeof (unichar))); - for (s = ascii, w = *unicode; *s != '\0'; s++, w++) - *w = *s & 0xff; - *w = 0; -#else - /* We use MultiByteToWideChar rather than strlen to get the unicode - string length to allow multibyte "ascii" chars. The value returned - by this function includes the trailing '\0'. */ - len = MultiByteToWideChar (CP_ACP, 0, ascii, -1, NULL, 0); - if (len) - { - *unicode = ((unichar *) res_alloc (len * sizeof (unichar))); - MultiByteToWideChar (CP_ACP, 0, ascii, -1, *unicode, len); - } - /* Discount the trailing '/0'. If MultiByteToWideChar failed, - this will set *length to -1. */ - len--; -#endif +/* Convert an unicode string to an ASCII string. We just copy it, + shrink shorts to chars, rather than doing something intelligent. + Shorts with not within the char range are replaced by '_'. */ - if (length != NULL) - *length = len; +void +ascii_from_unicode (rc_uint_type *length, const unichar *unicode, char **ascii) +{ + codepage_from_unicode (length, unicode, ascii, wind_current_codepage); } /* Print the unicode string UNICODE to the file E. LENGTH is the @@ -77,7 +209,7 @@ unicode_from_ascii (int *length, unichar **unicode, const char *ascii) some Windows function, probably WideCharToMultiByte. */ void -unicode_print (FILE *e, const unichar *unicode, int length) +unicode_print (FILE *e, const unichar *unicode, rc_uint_type length) { while (1) { @@ -85,12 +217,12 @@ unicode_print (FILE *e, const unichar *unicode, int length) if (length == 0) return; - if (length > 0) + if ((bfd_signed_vma) length > 0) --length; ch = *unicode; - if (ch == 0 && length < 0) + if (ch == 0 && (bfd_signed_vma) length < 0) return; ++unicode; @@ -98,7 +230,9 @@ unicode_print (FILE *e, const unichar *unicode, int length) if ((ch & 0x7f) == ch) { if (ch == '\\') - fputs ("\\", e); + fputs ("\\\\", e); + else if (ch == '"') + fputs ("\"\"", e); else if (ISPRINT (ch)) putc (ch, e); else @@ -142,6 +276,534 @@ unicode_print (FILE *e, const unichar *unicode, int length) else if ((ch & 0xff) == ch) fprintf (e, "\\%03o", (unsigned int) ch); else - fprintf (e, "\\x%x", (unsigned int) ch); + fprintf (e, "\\x%04x", (unsigned int) ch); } } + +/* Print a unicode string to a file. */ + +void +ascii_print (FILE *e, const char *s, rc_uint_type length) +{ + while (1) + { + char ch; + + if (length == 0) + return; + if ((bfd_signed_vma) length > 0) + --length; + + ch = *s; + + if (ch == 0 && (bfd_signed_vma) length < 0) + return; + + ++s; + + if ((ch & 0x7f) == ch) + { + if (ch == '\\') + fputs ("\\\\", e); + else if (ch == '"') + fputs ("\"\"", e); + else if (ISPRINT (ch)) + putc (ch, e); + else + { + switch (ch) + { + case ESCAPE_A: + fputs ("\\a", e); + break; + + case ESCAPE_B: + fputs ("\\b", e); + break; + + case ESCAPE_F: + fputs ("\\f", e); + break; + + case ESCAPE_N: + fputs ("\\n", e); + break; + + case ESCAPE_R: + fputs ("\\r", e); + break; + + case ESCAPE_T: + fputs ("\\t", e); + break; + + case ESCAPE_V: + fputs ("\\v", e); + break; + + default: + fprintf (e, "\\%03o", (unsigned int) ch); + break; + } + } + } + else + fprintf (e, "\\%03o", (unsigned int) ch & 0xff); + } +} + +rc_uint_type +unichar_len (const unichar *unicode) +{ + rc_uint_type r = 0; + + if (unicode) + while (unicode[r] != 0) + r++; + else + --r; + return r; +} + +unichar * +unichar_dup (const unichar *unicode) +{ + unichar *r; + int len; + + if (! unicode) + return NULL; + for (len = 0; unicode[len] != 0; ++len) + ; + ++len; + r = ((unichar *) res_alloc (len * sizeof (unichar))); + memcpy (r, unicode, len * sizeof (unichar)); + return r; +} + +unichar * +unichar_dup_uppercase (const unichar *u) +{ + unichar *r = unichar_dup (u); + int i; + + if (! r) + return NULL; + + for (i = 0; r[i] != 0; ++i) + { + if (r[i] >= 'a' && r[i] <= 'z') + r[i] &= 0xdf; + } + return r; +} + +static int +unichar_isascii (const unichar *u, rc_uint_type len) +{ + rc_uint_type i; + + if ((bfd_signed_vma) len < 0) + { + if (u) + len = (rc_uint_type) unichar_len (u); + else + len = 0; + } + + for (i = 0; i < len; i++) + if ((u[i] & 0xff80) != 0) + return 0; + return 1; +} + +void +unicode_print_quoted (FILE *e, const unichar *u, rc_uint_type len) +{ + if (! unichar_isascii (u, len)) + fputc ('L', e); + fputc ('"', e); + unicode_print (e, u, len); + fputc ('"', e); +} + +int +unicode_is_valid_codepage (rc_uint_type cp) +{ + if ((cp & 0xffff) != cp) + return 0; + if (cp == CP_UTF16 || cp == CP_ACP) + return 1; + +#if !defined (_WIN32) && !defined (__CYGWIN__) + if (! wind_find_codepage_info (cp)) + return 0; + return 1; +#else + return !! IsValidCodePage ((UINT) cp); +#endif +} + +#if defined (_WIN32) || defined (__CYGWIN__) + +#define max_cp_string_len 6 + +static unsigned int +codepage_from_langid (unsigned short langid) +{ + char cp_string [max_cp_string_len]; + int c; + + memset (cp_string, 0, max_cp_string_len); + /* LOCALE_RETURN_NUMBER flag would avoid strtoul conversion, + but is unavailable on Win95. */ + c = GetLocaleInfoA (MAKELCID (langid, SORT_DEFAULT), + LOCALE_IDEFAULTANSICODEPAGE, + cp_string, max_cp_string_len); + /* If codepage data for an LCID is not installed on users's system, + GetLocaleInfo returns an empty string. Fall back to system ANSI + default. */ + if (c == 0) + return CP_ACP; + return strtoul (cp_string, 0, 10); +} + +static unsigned int +wincodepage_from_langid (unsigned short langid) +{ + char cp_string [max_cp_string_len]; + int c; + + memset (cp_string, 0, max_cp_string_len); + /* LOCALE_RETURN_NUMBER flag would avoid strtoul conversion, + but is unavailable on Win95. */ + c = GetLocaleInfoA (MAKELCID (langid, SORT_DEFAULT), + LOCALE_IDEFAULTCODEPAGE, + cp_string, max_cp_string_len); + /* If codepage data for an LCID is not installed on users's system, + GetLocaleInfo returns an empty string. Fall back to system ANSI + default. */ + if (c == 0) + return CP_OEM; + return strtoul (cp_string, 0, 10); +} + +static char * +lang_from_langid (unsigned short langid) +{ + char cp_string[261]; + int c; + + memset (cp_string, 0, 261); + c = GetLocaleInfoA (MAKELCID (langid, SORT_DEFAULT), + LOCALE_SENGLANGUAGE, + cp_string, 260); + /* If codepage data for an LCID is not installed on users's system, + GetLocaleInfo returns an empty string. Fall back to system ANSI + default. */ + if (c == 0) + strcpy (cp_string, "Neutral"); + return xstrdup (cp_string); +} + +static char * +country_from_langid (unsigned short langid) +{ + char cp_string[261]; + int c; + + memset (cp_string, 0, 261); + c = GetLocaleInfoA (MAKELCID (langid, SORT_DEFAULT), + LOCALE_SENGCOUNTRY, + cp_string, 260); + /* If codepage data for an LCID is not installed on users's system, + GetLocaleInfo returns an empty string. Fall back to system ANSI + default. */ + if (c == 0) + strcpy (cp_string, "Neutral"); + return xstrdup (cp_string); +} + +#endif + +const wind_language_t * +wind_find_language_by_id (unsigned id) +{ +#if !defined (_WIN32) && !defined (__CYGWIN__) + int i; + + if (! id) + return NULL; + for (i = 0; languages[i].id != (unsigned) -1 && languages[i].id != id; i++) + ; + if (languages[i].id == id) + return &languages[i]; + return NULL; +#else + static wind_language_t wl; + + wl.id = id; + wl.doscp = codepage_from_langid ((unsigned short) id); + wl.wincp = wincodepage_from_langid ((unsigned short) id); + wl.name = lang_from_langid ((unsigned short) id); + wl.country = country_from_langid ((unsigned short) id); + + return & wl; +#endif +} + +const local_iconv_map * +wind_find_codepage_info (unsigned cp) +{ +#if !defined (_WIN32) && !defined (__CYGWIN__) + int i; + + for (i = 0; codepages[i].codepage != (rc_uint_type) -1 && codepages[i].codepage != cp; i++) + ; + if (codepages[i].codepage == (rc_uint_type) -1) + return NULL; + return &codepages[i]; +#else + static local_iconv_map lim; + if (!unicode_is_valid_codepage (cp)) + return NULL; + lim.codepage = cp; + lim.iconv_name = ""; + return & lim; +#endif +} + +/* Convert an Codepage string to a unicode string. */ + +void +unicode_from_codepage (rc_uint_type *length, unichar **u, const char *src, rc_uint_type cp) +{ + rc_uint_type len; + + len = wind_MultiByteToWideChar (cp, src, NULL, 0); + if (len) + { + *u = ((unichar *) res_alloc (len)); + wind_MultiByteToWideChar (cp, src, *u, len); + } + /* Discount the trailing '/0'. If MultiByteToWideChar failed, + this will set *length to -1. */ + len -= sizeof (unichar); + + if (length != NULL) + *length = len / sizeof (unichar); +} + +/* Convert an unicode string to an codepage string. */ + +void +codepage_from_unicode (rc_uint_type *length, const unichar *unicode, char **ascii, rc_uint_type cp) +{ + rc_uint_type len; + + len = wind_WideCharToMultiByte (cp, unicode, NULL, 0); + if (len) + { + *ascii = (char *) res_alloc (len * sizeof (char)); + wind_WideCharToMultiByte (cp, unicode, *ascii, len); + } + /* Discount the trailing '/0'. If MultiByteToWideChar failed, + this will set *length to -1. */ + len--; + + if (length != NULL) + *length = len; +} + +#ifdef HAVE_ICONV_H +static int +iconv_onechar (iconv_t cd, const char *s, char *d, int d_len, const char **n_s, char **n_d) +{ + int i; + + for (i = 1; i <= 32; i++) + { + char *tmp_d = d; + const char *tmp_s = s; + size_t ret; + size_t s_left = (size_t) i; + size_t d_left = (size_t) d_len; + + ret = iconv (cd, & tmp_s, & s_left, & tmp_d, & d_left); + + if (ret != (size_t) -1) + { + *n_s = tmp_s; + *n_d = tmp_d; + return 0; + } + } + + return 1; +} + +static const char * +wind_iconv_cp (rc_uint_type cp) +{ + const local_iconv_map *lim = wind_find_codepage_info (cp); + + if (!lim) + return NULL; + return lim->iconv_name; +} +#endif /* HAVE_ICONV_H */ + +static rc_uint_type +wind_MultiByteToWideChar (rc_uint_type cp, const char *mb, + unichar *u, rc_uint_type u_len) +{ + rc_uint_type ret = 0; + +#if defined (_WIN32) || defined (__CYGWIN__) + ret = (rc_uint_type) MultiByteToWideChar (cp, MB_PRECOMPOSED, + mb, -1, u, u_len); + /* Convert to bytes. */ + ret *= sizeof (unichar); + +#elif defined (HAVE_ICONV_H) + int first = 1; + char tmp[32]; + char *p_tmp; + const char *iconv_name = wind_iconv_cp (cp); + + if (!mb || !iconv_name) + return 0; + iconv_t cd = iconv_open ("UTF-16", iconv_name); + + while (1) + { + int iret; + const char *n_mb; + char *n_tmp; + + p_tmp = tmp; + iret = iconv_onechar (cd, (const char *) mb, p_tmp, 32, & n_mb, & n_tmp); + if (first) + { + first = 0; + continue; + } + if (!iret) + { + size_t l_tmp = (size_t) (n_tmp - p_tmp); + + if (u) + { + if ((size_t) u_len < l_tmp) + break; + memcpy (u, tmp, l_tmp); + u += l_tmp/2; + u_len -= l_tmp; + } + ret += l_tmp; + } + else + break; + if (tmp[0] == 0 && tmp[1] == 0) + break; + mb = n_mb; + } + iconv_close (cd); +#else + if (cp) + ret = 0; + ret = strlen (mb) + 1; + ret *= sizeof (unichar); + if (u != NULL && u_len != 0) + { + do + { + *u++ = ((unichar) *mb) & 0xff; + --u_len; mb++; + } + while (u_len != 0 && mb[-1] != 0); + } + if (u != NULL && u_len != 0) + *u = 0; +#endif + return ret; +} + +static rc_uint_type +wind_WideCharToMultiByte (rc_uint_type cp, const unichar *u, char *mb, rc_uint_type mb_len) +{ + rc_uint_type ret = 0; +#if defined (_WIN32) || defined (__CYGWIN__) + WINBOOL used_def = FALSE; + + ret = (rc_uint_type) WideCharToMultiByte (cp, 0, u, -1, mb, mb_len, + NULL, & used_def); +#elif defined (HAVE_ICONV_H) + int first = 1; + char tmp[32]; + char *p_tmp; + const char *iconv_name = wind_iconv_cp (cp); + + if (!u || !iconv_name) + return 0; + iconv_t cd = iconv_open (iconv_name, "UTF-16"); + + while (1) + { + int iret; + const char *n_u; + char *n_tmp; + + p_tmp = tmp; + iret = iconv_onechar (cd, (const char *) u, p_tmp, 32, &n_u, & n_tmp); + if (first) + { + first = 0; + continue; + } + if (!iret) + { + size_t l_tmp = (size_t) (n_tmp - p_tmp); + + if (mb) + { + if ((size_t) mb_len < l_tmp) + break; + memcpy (mb, tmp, l_tmp); + mb += l_tmp; + mb_len -= l_tmp; + } + ret += l_tmp; + } + else + break; + if (u[0] == 0) + break; + u = (const unichar *) n_u; + } + iconv_close (cd); +#else + if (cp) + ret = 0; + + while (u[ret] != 0) + ++ret; + + ++ret; + + if (mb) + { + while (*u != 0 && mb_len != 0) + { + if (u[0] == (u[0] & 0x7f)) + *mb++ = (char) u[0]; + else + *mb++ = '_'; + ++u; --mb_len; + } + if (mb_len != 0) + *mb = 0; + } +#endif + return ret; +} diff --git a/binutils/winduni.h b/binutils/winduni.h index 71cd055a9da..82c3022831a 100644 --- a/binutils/winduni.h +++ b/binutils/winduni.h @@ -1,6 +1,8 @@ /* winduni.h -- header file for unicode support for windres program. - Copyright 1997, 1998, 2002 Free Software Foundation, Inc. + Copyright 1997, 1998, 2002, 2007 + Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. + Rewritten by Kai Tietz, Onevision. This file is part of GNU Binutils. @@ -21,6 +23,9 @@ #include "ansidecl.h" +#ifndef WINDUNI_H +#define WINDUNI_H + /* This header file declares the types and functions we use for unicode support in windres. Our unicode support is very limited at present. @@ -30,31 +35,105 @@ that would conflict with the definitions of Windows macros we already have in windres.h. */ +/* Use bfd_size_type to ensure a sufficient number of bits. */ +#ifndef DEFINED_RC_UINT_TYPE +#define DEFINED_RC_UINT_TYPE +typedef bfd_size_type rc_uint_type; +#endif + /* We use this type to hold a unicode character. */ typedef unsigned short unichar; /* Escape character translations. */ -#define ESCAPE_A (007) -#define ESCAPE_B (010) -#define ESCAPE_F (014) -#define ESCAPE_N (012) -#define ESCAPE_R (015) -#define ESCAPE_T (011) -#define ESCAPE_V (013) +#define ESCAPE_A 007 +#define ESCAPE_B 010 +#define ESCAPE_F 014 +#define ESCAPE_N 012 +#define ESCAPE_R 015 +#define ESCAPE_T 011 +#define ESCAPE_V 013 /* Convert an ASCII string to a unicode string. */ +extern void unicode_from_ascii (rc_uint_type *, unichar **, const char *); -extern void unicode_from_ascii - PARAMS ((int *, unichar **, const char *)); +/* Convert an unicode string to an ASCII string. */ +extern void ascii_from_unicode (rc_uint_type *, const unichar *, char **); + +/* Duplicate a unicode string by using res_alloc. */ +extern unichar *unichar_dup (const unichar *); + +/* Duplicate a unicode string by using res_alloc and make it uppercase. */ +extern unichar *unichar_dup_uppercase (const unichar *); + +/* The count of unichar elements. */ +extern rc_uint_type unichar_len (const unichar *); /* Print a unicode string to a file. */ +extern void unicode_print (FILE *, const unichar *, rc_uint_type); -extern void unicode_print PARAMS ((FILE *, const unichar *, int)); +/* Print a ascii string to a file. */ +extern void ascii_print (FILE *, const char *, rc_uint_type); + +/* Print a quoted unicode string to a file. */ +extern void unicode_print_quoted (FILE *, const unichar *, rc_uint_type); + +#ifndef CP_UTF8 +#define CP_UTF7 65000 /* UTF-7 translation. */ +#define CP_UTF8 65001 /* UTF-8 translation. */ +#endif + +#ifndef CP_UTF16 +#define CP_UTF16 65002 /* UTF-16 translation. */ +#endif + +#ifndef CP_ACP +#define CP_ACP 0 /* Default to ANSI code page. */ +#endif + +#ifndef CP_OEM +#define CP_OEM 1 /* Default OEM code page. */ +#endif + +/* Specifies the default codepage to be used for unicode + transformations. By default this is CP_ACP. */ +extern rc_uint_type wind_default_codepage; + +/* Specifies the currently used codepage for unicode + transformations. By default this is CP_ACP. */ +extern rc_uint_type wind_current_codepage; + +typedef struct wind_language_t +{ + unsigned id; + unsigned doscp; + unsigned wincp; + const char *name; + const char *country; +} wind_language_t; + +extern const wind_language_t *wind_find_language_by_id (unsigned); +extern int unicode_is_valid_codepage (rc_uint_type); + +typedef struct local_iconv_map +{ + rc_uint_type codepage; + const char * iconv_name; +} local_iconv_map; + +extern const local_iconv_map *wind_find_codepage_info (unsigned); + +/* Convert an Codepage string to a unicode string. */ +extern void unicode_from_codepage (rc_uint_type *, unichar **, const char *, rc_uint_type); + +/* Convert an unicode string to an codepage string. */ +extern void codepage_from_unicode (rc_uint_type *, const unichar *, char **, rc_uint_type); /* Windres support routine called by unicode_from_ascii. This is both here and in windres.h. It should probably be in a separate header file, but it hardly seems worth it for one function. */ -extern PTR res_alloc PARAMS ((size_t)); +extern void * res_alloc (rc_uint_type); + +#endif diff --git a/binutils/wrstabs.c b/binutils/wrstabs.c index 13f01dac725..325047ea71e 100644 --- a/binutils/wrstabs.c +++ b/binutils/wrstabs.c @@ -1,5 +1,5 @@ /* wrstabs.c -- Output stabs debugging information - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2006 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor . @@ -23,13 +23,12 @@ /* This file contains code which writes out stabs debugging information. */ -#include +#include "sysdep.h" #include - #include "bfd.h" -#include "bucomm.h" #include "libiberty.h" #include "safe-ctype.h" +#include "bucomm.h" #include "debug.h" #include "budbg.h" #include "aout/aout64.h" diff --git a/compile b/compile new file mode 100755 index 00000000000..1b1d2321695 --- /dev/null +++ b/compile @@ -0,0 +1,142 @@ +#! /bin/sh +# Wrapper for compilers which do not understand `-c -o'. + +scriptversion=2005-05-14.22 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# 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 2, 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. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; +esac + +ofile= +cfile= +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/config-ml.in b/config-ml.in index 937273173c0..cc9cf66cebc 100644 --- a/config-ml.in +++ b/config-ml.in @@ -108,6 +108,11 @@ ml_realsrcdir=${srcdir} ml_verbose=--verbose for option in ${ac_configure_args} do + # strip single quotes surrounding individual options + case $option in + \'*\') eval option=$option ;; + esac + case $option in --*) ;; -*) option=-$option ;; @@ -546,6 +551,7 @@ multi-do: flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \ if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \ CFLAGS="$(CFLAGS) $${flags}" \ + CCASFLAGS="$(CCASFLAGS) $${flags}" \ FCFLAGS="$(FCFLAGS) $${flags}" \ FFLAGS="$(FFLAGS) $${flags}" \ ADAFLAGS="$(ADAFLAGS) $${flags}" \ @@ -889,7 +895,7 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then if eval ${ml_config_env} ${ml_config_shell} ${ml_recprog} \ --with-multisubdir=${ml_dir} --with-multisrctop=${multisrctop} \ - ${ac_configure_args} ${ml_srcdiroption} ; then + ${ac_configure_args} ${ml_config_env} ${ml_srcdiroption} ; then true else exit 1 diff --git a/config.guess b/config.guess index 17690aea342..951383e3554 100755 --- a/config.guess +++ b/config.guess @@ -1,9 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. -timestamp='2006-01-02' +timestamp='2007-05-17' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -106,7 +107,7 @@ set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; @@ -160,6 +161,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched @@ -210,7 +212,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) - echo powerppc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} @@ -328,7 +330,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; - i86pc:SunOS:5.*:*) + i86pc:SunOS:5.*:* | ix86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) @@ -770,6 +772,8 @@ EOF case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac @@ -777,7 +781,7 @@ EOF i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; - i*:MINGW*:*) + *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) @@ -787,9 +791,15 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - x86:Interix*:[345]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; @@ -825,6 +835,9 @@ EOF arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; @@ -859,7 +872,11 @@ EOF #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`" + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) @@ -878,7 +895,11 @@ EOF #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`" + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) @@ -933,6 +954,9 @@ EOF x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; + xtensa:Linux:*:*) + echo xtensa-unknown-linux-gnu + exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent @@ -975,7 +999,7 @@ EOF LIBC=gnulibc1 # endif #else - #if defined(__INTEL_COMPILER) || defined(__PGI) + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout @@ -985,7 +1009,11 @@ EOF LIBC=dietlibc #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^LIBC/{s: ::g;p;}'`" + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit @@ -1187,6 +1215,15 @@ EOF SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; diff --git a/config.rpath b/config.rpath new file mode 100755 index 00000000000..937edf5ecb5 --- /dev/null +++ b/config.rpath @@ -0,0 +1,548 @@ +#! /bin/sh +# Output a system dependent set of variables, describing how to set the +# run time search path of shared libraries in an executable. +# +# Copyright 1996-2003 Free Software Foundation, Inc. +# Taken from GNU libtool, 2001 +# Originally by Gordon Matzigkeit , 1996 +# +# 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 2 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. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. +# +# The first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +# should be set by the caller. +# +# The set of defined variables is at the end of this script. + +# Known limitations: +# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer +# than 256 bytes, otherwise the compiler driver will dump core. The only +# known workaround is to choose shorter directory names for the build +# directory and/or the installation directory. + +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +shrext=.so + +host="$1" +host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. + +wl= +if test "$GCC" = yes; then + wl='-Wl,' +else + case "$host_os" in + aix*) + wl='-Wl,' + ;; + mingw* | pw32* | os2*) + ;; + hpux9* | hpux10* | hpux11*) + wl='-Wl,' + ;; + irix5* | irix6* | nonstopux*) + wl='-Wl,' + ;; + newsos6) + ;; + linux*) + case $CC in + icc|ecc) + wl='-Wl,' + ;; + ccc) + wl='-Wl,' + ;; + esac + ;; + osf3* | osf4* | osf5*) + wl='-Wl,' + ;; + sco3.2v5*) + ;; + solaris*) + wl='-Wl,' + ;; + sunos4*) + wl='-Qoption ld ' + ;; + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + wl='-Wl,' + ;; + sysv4*MP*) + ;; + uts4*) + ;; + esac +fi + +# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. + +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no + +case "$host_os" in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + case "$host_os" in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can use + # them. + ld_shlibs=no + ;; + beos*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + netbsd*) + ;; + solaris* | sysv5*) + if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + sunos4*) + hardcode_direct=yes + ;; + *) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + esac + if test "$ld_shlibs" = yes; then + # Unlike libtool, we use -rpath here, not --rpath, since the documented + # option of GNU ld is called -rpath, not --rpath. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + fi +else + case "$host_os" in + aix3*) + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + else + aix_use_runtimelinking=no + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + fi + hardcode_direct=yes + hardcode_libdir_separator=':' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + esac + fi + # Begin _LT_AC_SYS_LIBPATH_AIX. + echo 'int main () { return 0; }' > conftest.c + ${CC} ${LDFLAGS} conftest.c -o conftest + aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + fi + if test -z "$aix_libpath"; then + aix_libpath="/usr/lib:/lib" + fi + rm -f conftest.c conftest + # End _LT_AC_SYS_LIBPATH_AIX. + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + else + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + fi + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + bsdi4*) + ;; + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + libext=lib + ;; + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + hardcode_direct=no + fi + ;; + dgux*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + freebsd1*) + ld_shlibs=no + ;; + freebsd2.2*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + freebsd2*) + hardcode_direct=yes + hardcode_minus_L=yes + ;; + freebsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + hpux9*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + hpux10* | hpux11*) + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=no + ;; + ia64*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=no + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + *) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + netbsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + newsos6) + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + openbsd*) + hardcode_direct=yes + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + osf3*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) + if test "$GCC" = yes; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + # Both cc and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + sco3.2v5*) + ;; + solaris*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + sunos4*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + ;; + sysv4) + case $host_vendor in + sni) + hardcode_direct=yes # is this really true??? + ;; + siemens) + hardcode_direct=no + ;; + motorola) + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + ;; + sysv4.3*) + ;; + sysv4*MP*) + if test -d /usr/nec; then + ld_shlibs=yes + fi + ;; + sysv4.2uw2*) + hardcode_direct=yes + hardcode_minus_L=no + ;; + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + ;; + sysv5*) + hardcode_libdir_flag_spec= + ;; + uts4*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + *) + ld_shlibs=no + ;; + esac +fi + +# Check dynamic linker characteristics +# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. +libname_spec='lib$name' +case "$host_os" in + aix3*) + ;; + aix4* | aix5*) + ;; + amigaos*) + ;; + beos*) + ;; + bsdi4*) + ;; + cygwin* | mingw* | pw32*) + shrext=.dll + ;; + darwin* | rhapsody*) + shrext=.dylib + ;; + dgux*) + ;; + freebsd1*) + ;; + freebsd*) + ;; + gnu*) + ;; + hpux9* | hpux10* | hpux11*) + case "$host_cpu" in + ia64*) + shrext=.so + ;; + hppa*64*) + shrext=.sl + ;; + *) + shrext=.sl + ;; + esac + ;; + irix5* | irix6* | nonstopux*) + case "$host_os" in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; + *) libsuff= shlibsuff= ;; + esac + ;; + esac + ;; + linux*oldld* | linux*aout* | linux*coff*) + ;; + linux*) + ;; + netbsd*) + ;; + newsos6) + ;; + nto-qnx) + ;; + openbsd*) + ;; + os2*) + libname_spec='$name' + shrext=.dll + ;; + osf3* | osf4* | osf5*) + ;; + sco3.2v5*) + ;; + solaris*) + ;; + sunos4*) + ;; + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + ;; + sysv4*MP*) + ;; + uts4*) + ;; +esac + +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` +shlibext=`echo "$shrext" | sed -e 's,^\.,,'` +escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + +sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' < - Andreas Schwab +2007-06-27 Mike Stump - * acx.m4 (NCN_STRICT_CHECK_TARGET_TOOLS): Use correct program name. + * acx.m4 (ACX_CHECK_INSTALLED_TARGET_TOOL): Fixup logic for cross + builds. + +2007-06-20 Mike Stump + + * acx.m4 (NCN_STRICT_CHECK_TARGET_TOOLS): Fix incremental builds. + (ACX_HAVE_GCC_FOR_TARGET): Likewise. + +2007-06-14 Paolo Bonzini + + * acx.m4 (ACX_CHECK_PROG_VER): Remove duplicate lines. + +2007-06-04 Olivier Hainque + + * mh-ppc-aix: Add default ADAFLAGS to BOOT_ADAFLAGS. + +2007-05-27 Paolo Bonzini + + * confsubdir.m4: Move here from newlib. + +2007-05-23 Paolo Bonzini + + PR bootstrap/32009 + * mh-ppc-darwin: Temporarily disable. + +2007-04-11 Kai Tietz + + * stdint.m4: Make template compatible with older cygwin + types.h, wrapping each type in a __XXX_t_defined #ifdef. + +2007-03-26 H.J. Lu + + * acx.m4 (ACX_BUGURL): Set BUGURL first. Quote $BUGURL first + when setting REPORT_BUGS_TEXI. + +2007-03-23 H.J. Lu + + * acx.m4 (ACX_BUGURL): Replace "@" with "@@" for + REPORT_BUGS_TEXI. + +2007-03-23 Joseph Myers + + * acx.m4 (ACX_PKGVERSION, ACX_BUGURL): Define. + +2007-03-07 Andreas Schwab + + * acx.m4 (GCC_TARGET_TOOL): Expand backquotes outside + AC_MSG_RESULT. + +2007-02-27 Alan Modra + + * mt-spu (all-ld): Depend on all-binutils. + +2007-02-18 Alexandre Oliva + + * acx.m4 (NCN_STRICT_CHECK_TOOLS): Mark environment variable as + precious. Prefer it over a cached value. Use cached value + verbosely. + (NCN_STRICT_CHECK_TARGET_TOOLS): Likewise. Don't override + environment variable with build-time tools. + +2006-12-11 Alan Modra + + * mt-spu: New file. + +2007-02-09 Daniel Jacobowitz + + * acx.m4 (ACX_CHECK_INSTALLED_TARGET_TOOL): Avoid AC_PATH_PROG + with an empty path. + +2007-02-07 Bruno Haible + + PR libgomp/28468 + * config/tls.m4 (GCC_CHECK_TLS): Also check whether the libc supports + TLS via __thread. + +2007-01-31 Daniel Franke + + PR libgomp/30546 + * acx.m4 (ACX_PROG_CHECK_VER): Locate a program and check that its + version is acceptable. + +2007-01-27 Paolo Bonzini + + * depstand.m4 (ZW_CREATE_DEPDIR): Use mkinstalldirs to make + directory. + +2007-01-23 Richard Guenther + + PR bootstrap/30541 + * config/acx.m4 (ACX_PROG_GNAT): Check for gnatmake. + +2007-01-14 H.J. Lu + + * ld-symbolic.m4: New. + +2007-01-11 Paolo Bonzini + + * warnings.m4: Use m4_expand_once to clear the AC_SUBST'ed variable. + (ACX_PROG_CC_WARNINGS_ARE_ERRORS): Fix typo. Add optional 2nd argument. + +2007-01-11 Paolo Bonzini + + * warnings.m4: Add second parameter with name of variable. + Always append to the variable if it exists. + +2007-01-01 Mike Stump + + * mh-ppc-darwin: Remove support for building with Apple's gcc-3.1. + +2006-12-04 Eric Botcazou + + * tls.m4 (GCC_CHECK_TLS): Do not test TLS with static linking + if static linking doesn't even work. + +2006-11-13 Daniel Jacobowitz + + * tls.m4 (GCC_CHECK_TLS): Fall back to a link test. + +2006-10-14 Geoffrey Keating + + * multi.m4: New file, from automake version 2 branch. + +2006-09-18 Tom Tromey + + * tls.m4 (GCC_CHECK_TLS): Pass empty argument as "help arg" to + GCC_ENABLE. + +2006-07-25 Paolo Bonzini + + PR build/26188 + * stdint.m4: Test for uintptr_t even on systems with uint64_t or uint32_t. + +2006-07-21 Steve Ellcey + + PR target/26792 + * unwind_ipinfo.m4: New. + +2006-07-21 David Daney + + PR libgcj/28426 + * gxx-include-dir.m4: Use target_alias in path for cross build. + +2006-07-18 Paolo Bonzini + + * acx.m4: Support --with-build-libsubdir and AC_SUBST + build_libsubdir. + +2006-06-13 Richard Earnshaw + Alexandre Oliva + + * gettext-sister.m4 (ZW_GNU_GETTEXT_SISTER_DIR): Add optional + argument for where to search for NLS config file. + +2006-05-31 Daniel Jacobowitz + + * gettext-sister.m4 (ZW_GNU_GETTEXT_SISTER_DIR): Provide some + defines otherwise gotten from AM_GNU_GETTEXT. Remove the + po/ prefix from CATALOGS. + +2006-02-14 Paolo Bonzini + Andreas Schwab + + * acx.m4 (NCN_STRICT_CHECK_TARGET_TOOLS): Use correct program name. (ACX_CHECK_INSTALLED_TARGET_TOOL): Likewise, and always set $1. 2006-01-26 Paolo Bonzini @@ -15,19 +177,19 @@ 2006-01-02 Paolo Bonzini - PR target/25259 - * stdint.m4: New. + PR target/25259 + * stdint.m4: New. 2005-12-20 Paolo Bonzini - Revert Ada-related part of the previous change. + Revert Ada-related part of the previous change. - * mt-ppc-aix: Delete. + * mt-ppc-aix: Delete. 2005-12-19 Paolo Bonzini - - * mt-ppc-aix, mh-ppc-aix: New. - + + * mt-ppc-aix, mh-ppc-aix: New. + 2005-12-05 Paolo Bonzini * acx.m4 (GCC_TARGET_TOOL): New. diff --git a/config/acx.m4 b/config/acx.m4 index 7c4c21386f1..c8a32c9f9ed 100644 --- a/config/acx.m4 +++ b/config/acx.m4 @@ -74,8 +74,22 @@ dnl # amount to a lot more with autoconf 2.5x. AC_DEFUN([GCC_TOPLEV_SUBDIRS], [AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_TARGET]) []dnl AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_BUILD]) []dnl + +# post-stage1 host modules use a different CC_FOR_BUILD so, in order to +# have matching libraries, they should use host libraries: Makefile.tpl +# arranges to pass --with-build-libsubdir=$(HOST_SUBDIR). +# However, they still use the build modules, because the corresponding +# host modules (e.g. bison) are only built for the host when bootstrap +# finishes. So: +# - build_subdir is where we find build modules, and never changes. +# - build_libsubdir is where we find build libraries, and can be overridden. + # Prefix 'build-' so this never conflicts with target_subdir. build_subdir="build-${build_noncanonical}" +AC_ARG_WITH(build-libsubdir, +[ --with-build-libsubdir=[DIR] Directory where to find libraries for build system], +build_libsubdir="$withval", +build_libsubdir="$build_subdir") # --srcdir=. covers the toplevel, while "test -d" covers the subdirectories if ( test $srcdir = . && test -d gcc ) \ || test -d $srcdir/../host-${host_noncanonical}; then @@ -85,6 +99,7 @@ else fi # No prefix. target_subdir=${target_noncanonical} +AC_SUBST([build_libsubdir]) []dnl AC_SUBST([build_subdir]) []dnl AC_SUBST([host_subdir]) []dnl AC_SUBST([target_subdir]) []dnl @@ -108,6 +123,20 @@ test -n "$target_alias" && ncn_target_tool_prefix=$target_alias- AC_DEFUN([NCN_STRICT_CHECK_TOOLS], [AC_REQUIRE([_NCN_TOOL_PREFIXES]) []dnl +AC_ARG_VAR([$1], [$1 for the host]) + +if test -n "[$]$1"; then + ac_cv_prog_$1=[$]$1 +elif test -n "$ac_cv_prog_$1"; then + $1=$ac_cv_prog_$1 +fi + +if test -n "$ac_cv_prog_$1"; then + for ncn_progname in $2; do + AC_CHECK_PROG([$1], [${ncn_progname}], [${ncn_progname}], , [$4]) + done +fi + for ncn_progname in $2; do if test -n "$ncn_tool_prefix"; then AC_CHECK_PROG([$1], [${ncn_tool_prefix}${ncn_progname}], @@ -135,7 +164,21 @@ fi AC_DEFUN([NCN_STRICT_CHECK_TARGET_TOOLS], [AC_REQUIRE([_NCN_TOOL_PREFIXES]) []dnl -if test -n "$with_build_time_tools"; then +AC_ARG_VAR([$1], patsubst([$1], [_FOR_TARGET$], [])[ for the target]) + +if test -n "[$]$1"; then + ac_cv_prog_$1=[$]$1 +elif test -n "$ac_cv_prog_$1"; then + $1=$ac_cv_prog_$1 +fi + +if test -n "$ac_cv_prog_$1"; then + for ncn_progname in $2; do + AC_CHECK_PROG([$1], [${ncn_progname}], [${ncn_progname}], , [$4]) + done +fi + +if test -z "$ac_cv_prog_$1" && test -n "$with_build_time_tools"; then for ncn_progname in $2; do AC_MSG_CHECKING([for ${ncn_progname} in $with_build_time_tools]) if test -x $with_build_time_tools/${ncn_progname}; then @@ -168,6 +211,8 @@ if test -z "$ac_cv_prog_$1" ; then else $1="${ncn_target_tool_prefix}[$]2" fi], [$1="$3"]) +else + $1="$ac_cv_prog_$1" fi ]) []dnl # NCN_STRICT_CHECK_TARGET_TOOLS @@ -281,11 +326,11 @@ if test -z "$ac_cv_path_$1" ; then fi elif test $build != $host && test $have_gcc_for_target = yes; then $1=`$GCC_FOR_TARGET --print-prog-name=$2` - test [$]$1=$2 && $1= - ac_cv_path_$1=[$]$1 + test [$]$1 = $2 && $1= + test -n "[$]$1" && ac_cv_path_$1=[$]$1 fi fi -if test -z "$ac_cv_path_$1" ; then +if test -z "$ac_cv_path_$1" && test -n "$gcc_cv_tool_dirs"; then AC_PATH_PROG([$1], [$2], [], [$gcc_cv_tool_dirs]) fi if test -z "$ac_cv_path_$1" ; then @@ -315,11 +360,12 @@ ac_c_preproc_warn_flag=yes])# AC_PROG_CPP_WERROR # understands Ada. We use the user's CC setting, already found. # # Sets the shell variable have_gnat to yes or no as appropriate, and -# substitutes GNATBIND. +# substitutes GNATBIND and GNATMAKE. AC_DEFUN([ACX_PROG_GNAT], [AC_REQUIRE([AC_CHECK_TOOL_PREFIX]) AC_REQUIRE([AC_PROG_CC]) AC_CHECK_TOOL(GNATBIND, gnatbind, no) +AC_CHECK_TOOL(GNATMAKE, gnatmake, no) AC_CACHE_CHECK([whether compiler driver understands Ada], acx_cv_cc_gcc_supports_ada, [cat >conftest.adb < /dev/null; then # We already found the complete path - AC_MSG_RESULT(pre-installed in `dirname [$]$2`) + ac_dir=`dirname [$]$2` + AC_MSG_RESULT(pre-installed in $ac_dir) else # Canadian cross, just use what we found AC_MSG_RESULT(pre-installed) @@ -464,7 +511,8 @@ else AC_MSG_RESULT(just compiled) el])if expr "x[$]$2" : "x/" > /dev/null; then # We already found the complete path - AC_MSG_RESULT(pre-installed in `dirname [$]$2`) + ac_dir=`dirname [$]$2` + AC_MSG_RESULT(pre-installed in $ac_dir) elif test "x$target" = "x$host"; then # We can use an host tool $2='$($3)' @@ -473,4 +521,77 @@ else # We need a cross tool AC_MSG_RESULT(pre-installed) fi -fi]) +fi +AC_SUBST($2)]) + + +dnl Locate a program and check that its version is acceptable. +dnl ACX_PROG_CHECK_VER(var, name, version-switch, +dnl version-extract-regexp, version-glob) +AC_DEFUN([ACX_CHECK_PROG_VER],[ + AC_CHECK_PROG([$1], [$2], [$2]) + if test -n "[$]$1"; then + # Found it, now check the version. + AC_CACHE_CHECK([for modern $2], + [gcc_cv_prog_$2_modern], + [ac_prog_version=`eval [$]$1 $3 2>&1 | + sed -n 's/^.*patsubst([[$4]],/,\/).*$/\1/p'` + + [case $ac_prog_version in + '') gcc_cv_prog_$2_modern=no;; + $5) gcc_cv_prog_$2_modern=yes;; + *) gcc_cv_prog_$2_modern=no;; + esac] + ]) + else + gcc_cv_prog_$2_modern=no + fi + if test $gcc_cv_prog_$2_modern = no; then + $1="${CONFIG_SHELL-/bin/sh} $ac_aux_dir/missing $2" + fi +]) + +dnl Support the --with-pkgversion configure option. +dnl ACX_PKGVERSION(default-pkgversion) +AC_DEFUN([ACX_PKGVERSION],[ + AC_ARG_WITH(pkgversion, + AS_HELP_STRING([--with-pkgversion=PKG], + [Use PKG in the version string in place of "$1"]), + [case "$withval" in + yes) AC_MSG_ERROR([package version not specified]) ;; + no) PKGVERSION= ;; + *) PKGVERSION="($withval) " ;; + esac], + PKGVERSION="($1) " + ) + AC_SUBST(PKGVERSION) +]) + +dnl Support the --with-bugurl configure option. +dnl ACX_BUGURL(default-bugurl) +AC_DEFUN([ACX_BUGURL],[ + AC_ARG_WITH(bugurl, + AS_HELP_STRING([--with-bugurl=URL], + [Direct users to URL to report a bug]), + [case "$withval" in + yes) AC_MSG_ERROR([bug URL not specified]) ;; + no) BUGURL= + ;; + *) BUGURL="$withval" + ;; + esac], + BUGURL="$1" + ) + case ${BUGURL} in + "") + REPORT_BUGS_TO= + REPORT_BUGS_TEXI= + ;; + *) + REPORT_BUGS_TO="<$BUGURL>" + REPORT_BUGS_TEXI=@uref{`echo "$BUGURL" | sed 's/@/@@/g'`} + ;; + esac; + AC_SUBST(REPORT_BUGS_TO) + AC_SUBST(REPORT_BUGS_TEXI) +]) diff --git a/config/confsubdir.m4 b/config/confsubdir.m4 new file mode 100644 index 00000000000..4e1e8c4641c --- /dev/null +++ b/config/confsubdir.m4 @@ -0,0 +1,127 @@ +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 +])]) diff --git a/config/depstand.m4 b/config/depstand.m4 index 8f936e0c263..beaf2cc7bf0 100644 --- a/config/depstand.m4 +++ b/config/depstand.m4 @@ -1,6 +1,6 @@ ## -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation @@ -132,5 +132,6 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl # As AM_SET_DEPDIR, but also create the directory at config.status time. AC_DEFUN([ZW_CREATE_DEPDIR], [AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_CONFIG_COMMANDS([depdir], [mkdir $DEPDIR], [DEPDIR=$DEPDIR]) +AC_CONFIG_COMMANDS([depdir], [$SHELL $ac_aux_dir/mkinstalldirs $DEPDIR], + [ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR]) ]) diff --git a/config/gettext-sister.m4 b/config/gettext-sister.m4 index d10aae80b6b..e8e6b668416 100644 --- a/config/gettext-sister.m4 +++ b/config/gettext-sister.m4 @@ -19,8 +19,9 @@ INCINTL= AC_SUBST(INCINTL) XGETTEXT= AC_SUBST(XGETTEXT) GMSGFMT= AC_SUBST(GMSGFMT) POSUB= AC_SUBST(POSUB) -if test -f ../intl/config.intl; then - . ../intl/config.intl + +if test -f ifelse([$1],,[../intl],[$1])/config.intl; then + . ifelse([$1],,[../intl],[$1])/config.intl fi AC_MSG_CHECKING([whether NLS is requested]) if test x"$USE_NLS" != xyes; then @@ -46,8 +47,8 @@ else # by the backticks, then collapsed again by the double quotes, # leaving us with one backslash in the sed expression (right # before the dot that mustn't act as a wildcard). - cat=`echo $cat | sed -e "s!$srcdir/!!" -e "s!\\\\.po!.gmo!"` - lang=`echo $cat | sed -e 's!po/!!' -e "s!\\\\.gmo!!"` + cat=`echo $cat | sed -e "s!$srcdir/po/!!" -e "s!\\\\.po!.gmo!"` + lang=`echo $cat | sed -e "s!\\\\.gmo!!"` # The user is allowed to set LINGUAS to a list of languages to # install catalogs for. If it's empty that means "all of them." if test "x$LINGUAS" = x; then @@ -63,4 +64,17 @@ else done LINGUAS="$XLINGUAS" AC_MSG_RESULT($LINGUAS) + + dnl Set up some additional variables which our po/Make-in files + dnl may need. + + dnl For backward compatibility. Some Makefiles may be using these. + DATADIRNAME=share + AC_SUBST(DATADIRNAME) + INSTOBJEXT=.mo + AC_SUBST(INSTOBJEXT) + GENCAT=gencat + AC_SUBST(GENCAT) + CATOBJEXT=.gmo + AC_SUBST(CATOBJEXT) fi]) diff --git a/config/gxx-include-dir.m4 b/config/gxx-include-dir.m4 index 0e6e4ffc397..4f54d427f7e 100644 --- a/config/gxx-include-dir.m4 +++ b/config/gxx-include-dir.m4 @@ -17,7 +17,13 @@ case "${with_gxx_include_dir}" in yes) gxx_include_dir='$(libsubdir)/include/c++' ;; *) libstdcxx_incdir='c++/$(gcc_version)' - gxx_include_dir='$(prefix)/include/$(libstdcxx_incdir)' ;; + gxx_include_dir='include/$(libstdcxx_incdir)' + if test -n "$with_cross_host" && + test x"$with_cross_host" != x"no"; then + gxx_include_dir='${prefix}/${target_alias}/'"$gxx_include_dir" + else + gxx_include_dir='${prefix}/'"$gxx_include_dir" + fi;; esac ;; *) gxx_include_dir=${with_gxx_include_dir} ;; esac diff --git a/config/ld-symbolic.m4 b/config/ld-symbolic.m4 new file mode 100644 index 00000000000..16d64f9ad38 --- /dev/null +++ b/config/ld-symbolic.m4 @@ -0,0 +1,45 @@ +dnl Copyright (C) 2007 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl Set SYMBOLIC_LDFLAGS to -Bsymbolic-functions for GNU linker if it +dnl is supported. +AC_DEFUN([ACX_PROG_LD_GNU_SYMBOLIC], +[AC_CACHE_CHECK([if the GNU linker ($LD) supports -Bsymbolic-functions], +acl_cv_prog_gnu_ld_symbolic, [ +acl_cv_prog_gnu_ld_symbolic=no +AC_REQUIRE([AC_LIB_PROG_LD_GNU]) +if test x"$with_gnu_ld" = x"yes"; then + if $LD --help 2>&1 &5; then + acl_cv_prog_gnu_ld_symbolic=yes + fi +fi]) +if test x"$acl_cv_prog_gnu_ld_symbolic" = x"yes"; then + SYMBOLIC_LDFLAGS="-Wl,-Bsymbolic-functions" +else + SYMBOLIC_LDFLAGS='' +fi +]) + +dnl Set DYNAMIC_LIST_CPP_NEW_LDFLAGS to --dynamic-list-cpp-new for GNU +dnl linker if it is supported. +AC_DEFUN([ACX_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW], +[AC_CACHE_CHECK([if the GNU linker ($LD) supports --dynamic-list-cpp-new], +acl_cv_prog_gnu_ld_dynamic_list_cpp_new, [ +acl_cv_prog_gnu_ld_dynamic_list_cpp_new=no +AC_REQUIRE([ACX_PROG_LD_GNU_SYMBOLIC]) +if test x"$with_gnu_ld" = x"yes" -a \ + x"$acl_cv_prog_gnu_ld_symbolic" = x"yes"; then + if $LD --help 2>&1 &5; then + acl_cv_prog_gnu_ld_dynamic_list_cpp_new=yes + fi +fi]) +if test x"$acl_cv_prog_gnu_ld_dynamic_list_cpp_new" = x"yes"; then + DYNAMIC_LIST_CPP_NEW_LDFLAGS="$SYMBOLIC_LDFLAGS -Wl,--dynamic-list-cpp-new" +else + DYNAMIC_LIST_CPP_NEW_LDFLAGS='' +fi +]) diff --git a/config/mh-ppc-aix b/config/mh-ppc-aix index f2bc76a0c3e..a56985fa940 100644 --- a/config/mh-ppc-aix +++ b/config/mh-ppc-aix @@ -1,8 +1,9 @@ -# Compile Ada files with minimal-toc. The primary focus is gnatlib, so -# that the library does not use nearly the entire TOC of applications -# until gnatlib is built as a shared library on AIX. Compiling the -# compiler with -mminimal-toc does not cause any harm. -BOOT_ADAFLAGS = -mminimal-toc +# Compile Ada files with minimal-toc in addition to the default flags (at +# least -gnatg is required to compile language defined units). The primary +# focus is gnatlib, so that the library does not use nearly the entire TOC of +# applications until gnatlib is built as a shared library on AIX. Compiling +# the compiler with -mminimal-toc does not cause any harm. +BOOT_ADAFLAGS = -gnatapg -mminimal-toc BOOT_LDFLAGS = -Wl,-bbigtoc LDFLAGS = `case $(CC) in *gcc*) echo -Wl,-bbigtoc ;; esac;` diff --git a/config/mh-ppc-darwin b/config/mh-ppc-darwin index 44fd620b66e..8e64791f6ee 100644 --- a/config/mh-ppc-darwin +++ b/config/mh-ppc-darwin @@ -2,5 +2,5 @@ # position-independent-code -- the usual default on Darwin. This fix speeds # compiles by 3-5%. -BOOT_CFLAGS=-g -O2 -mdynamic-no-pic - +# Broken because of PR32009. +# BOOT_CFLAGS=-g -O2 -mdynamic-no-pic diff --git a/config/mt-mep b/config/mt-mep new file mode 100644 index 00000000000..849d128a3f5 --- /dev/null +++ b/config/mt-mep @@ -0,0 +1,8 @@ + +EXTRA_TARGET_HOST_ALL_MODULES:=$(EXTRA_TARGET_HOST_ALL_MODULES) all-utils +EXTRA_TARGET_HOST_INSTALL_MODULES:=$(EXTRA_TARGET_HOST_INSTALL_MODULES) install-utils + +all-utils : all-libiberty + +install-utils : all-libiberty + diff --git a/config/mt-spu b/config/mt-spu new file mode 100644 index 00000000000..c2dbc66e999 --- /dev/null +++ b/config/mt-spu @@ -0,0 +1,4 @@ +# spu ld makefile invokes as-new in maintainer mode. +all-ld: $(MAINT) all-gas +# spu ld makefile invokes bin2c +all-ld: all-binutils diff --git a/config/multi.m4 b/config/multi.m4 new file mode 100644 index 00000000000..98417679f51 --- /dev/null +++ b/config/multi.m4 @@ -0,0 +1,65 @@ +## -*- Autoconf -*- +# Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR]) +# --------------------------------------------------- +# Add --enable-multilib to configure. +AC_DEFUN([AM_ENABLE_MULTILIB], +[# Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "$enableval" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR([bad value $enableval for multilib option]) ;; + esac], + [multilib=yes]) + +# We may get other options which we leave undocumented: +# --with-target-subdir, --with-multisrctop, --with-multisubdir +# See config-ml.in if you want the gory details. + +if test "$srcdir" = "."; then + if test "$with_target_subdir" != "."; then + multi_basedir="$srcdir/$with_multisrctop../$2" + else + multi_basedir="$srcdir/$with_multisrctop$2" + fi +else + multi_basedir="$srcdir/$2" +fi +AC_SUBST(multi_basedir) + +# Even if the default multilib is not a cross compilation, +# it may be that some of the other multilibs are. +if test $cross_compiling = no && test $multilib = yes \ + && test "x${with_multisubdir}" != x ; then + cross_compiling=maybe +fi + +AC_OUTPUT_COMMANDS([ +# Only add multilib support code if we just rebuilt the top-level +# Makefile. +case " $CONFIG_FILES " in + *" ]m4_default([$1],Makefile)[ "*) + ac_file=]m4_default([$1],Makefile)[ . ${multi_basedir}/config-ml.in + ;; +esac], + [ +srcdir="$srcdir" +host="$host" +target="$target" +with_multisubdir="$with_multisubdir" +with_multisrctop="$with_multisrctop" +with_target_subdir="$with_target_subdir" +ac_configure_args="${multilib_arg} ${ac_configure_args}" +multi_basedir="$multi_basedir" +CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} +CC="$CC"])])dnl diff --git a/config/stdint.m4 b/config/stdint.m4 index 21ef2ec43ac..025ffad9ea2 100644 --- a/config/stdint.m4 +++ b/config/stdint.m4 @@ -61,14 +61,17 @@ for i in stdint.h $inttype_headers; do break done if test "$acx_cv_header_stdint" = stddef.h; then - acx_cv_header_stdint_kind="(lacks uintptr_t)" + acx_cv_header_stdint_kind="(lacks uintmax_t)" for i in stdint.h $inttype_headers; do + unset ac_cv_type_uintptr_t unset ac_cv_type_uint32_t unset ac_cv_type_uint64_t _AS_ECHO_N([looking for an incomplete stdint.h in $i, ]) AC_CHECK_TYPE(uint32_t,[acx_cv_header_stdint=$i],continue,[#include #include <$i>]) - AC_CHECK_TYPE(uint64_t,,[acx_cv_header_stdint_kind="(lacks uintptr_t and uint64_t)"], [#include + AC_CHECK_TYPE(uint64_t,,,[#include +#include <$i>]) + AC_CHECK_TYPE(uintptr_t,,,[#include #include <$i>]) break done @@ -81,7 +84,7 @@ if test "$acx_cv_header_stdint" = stddef.h; then _AS_ECHO_N([looking for u_intXX_t types in $i, ]) AC_CHECK_TYPE(u_int32_t,[acx_cv_header_stdint=$i],continue,[#include #include <$i>]) - AC_CHECK_TYPE(u_int64_t,,[acx_cv_header_stdint_kind="(u_intXX_t style, lacks u_int64_t)"], [#include + AC_CHECK_TYPE(u_int64_t,,,[#include #include <$i>]) break done @@ -215,33 +218,51 @@ if test "$acx_cv_header_stdint" = stddef.h; then #ifndef _UINT8_T #define _UINT8_T + #ifndef __uint8_t_defined + #define __uint8_t_defined typedef unsigned $acx_cv_type_int8_t uint8_t; #endif + #endif #ifndef _UINT16_T #define _UINT16_T + #ifndef __uint16_t_defined + #define __uint16_t_defined typedef unsigned $acx_cv_type_int16_t uint16_t; #endif + #endif #ifndef _UINT32_T #define _UINT32_T + #ifndef __uint32_t_defined + #define __uint32_t_defined typedef unsigned $acx_cv_type_int32_t uint32_t; #endif + #endif #ifndef _INT8_T #define _INT8_T + #ifndef __int8_t_defined + #define __int8_t_defined typedef $acx_cv_type_int8_t int8_t; #endif + #endif #ifndef _INT16_T #define _INT16_T + #ifndef __int16_t_defined + #define __int16_t_defined typedef $acx_cv_type_int16_t int16_t; #endif + #endif #ifndef _INT32_T #define _INT32_T + #ifndef __int32_t_defined + #define __int32_t_defined typedef $acx_cv_type_int32_t int32_t; #endif + #endif EOF elif test "$ac_cv_type_u_int32_t" = yes; then sed 's/^ *//' >> tmp-stdint.h <> tmp-stdint.h <> tmp-stdint.h <> tmp-stdint.h <= 199901L #ifndef _INT64_T #define _INT64_T + #ifndef __int64_t_defined typedef long long int64_t; #endif + #endif #ifndef _UINT64_T #define _UINT64_T typedef unsigned long long uint64_t; @@ -387,8 +425,12 @@ if test "$ac_cv_type_uintptr_t" != yes; then sed 's/^ *//' >> tmp-stdint.h < + void *g(void *d) { return NULL; }], + [pthread_t t; pthread_create(&t,NULL,g,NULL);])], + [thread_CFLAGS="$flag"]) + if test "X$thread_CFLAGS" != Xfailed; then + break + fi + done + CFLAGS="$chktls_save_CFLAGS" + if test "X$thread_CFLAGS" != Xfailed; then + CFLAGS="$thread_CFLAGS $chktls_save_CFLAGS" + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [#include + __thread int a; + static int *a_in_other_thread; + static void * + thread_func (void *arg) + { + a_in_other_thread = &a; + return (void *)0; + }], + [pthread_t thread; + void *thread_retval; + int *a_in_main_thread; + if (pthread_create (&thread, (pthread_attr_t *)0, + thread_func, (void *)0)) + return 0; + a_in_main_thread = &a; + if (pthread_join (thread, &thread_retval)) + return 0; + return (a_in_other_thread == a_in_main_thread);])], + [have_tls=yes], [have_tls=no], []) + CFLAGS="$chktls_save_CFLAGS" + fi + fi], [have_tls=no], - [AC_COMPILE_IFELSE([__thread int foo;], [have_tls=yes], [have_tls=no])] + [dnl This is the cross-compiling case. Assume libc supports TLS if the + dnl binutils and the compiler do. + AC_LINK_IFELSE([__thread int a; int b; int main() { return a = b; }], + [have_tls=yes], [have_tls=no]) + ] )]) if test "$enable_tls $have_tls" = "yes yes"; then AC_DEFINE(HAVE_TLS, 1, diff --git a/config/unwind_ipinfo.m4 b/config/unwind_ipinfo.m4 new file mode 100644 index 00000000000..5587d9c3fb0 --- /dev/null +++ b/config/unwind_ipinfo.m4 @@ -0,0 +1,22 @@ +dnl +dnl Check whether _Unwind_GetIPInfo is available. +dnl +AC_DEFUN([GCC_CHECK_UNWIND_GETIPINFO], [ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" + AC_MSG_CHECKING([for _Unwind_GetIPInfo]) + AC_CACHE_VAL(gcc_cv_getipinfo, [ + AC_TRY_LINK([extern "C" { extern void _Unwind_GetIPInfo(); }], + [_Unwind_GetIPInfo();], + [gcc_cv_getipinfo=yes], + [gcc_cv_getipinfo=no]) + ]) + if test $gcc_cv_getipinfo = yes; then + AC_DEFINE(HAVE_GETIPINFO, 1, [Define if _Unwind_GetIPInfo is available.]) + fi + AC_MSG_RESULT($gcc_cv_getipinfo) + CXXFLAGS="$ac_save_CXXFLAGS" + AC_LANG_RESTORE +]) diff --git a/config/warnings.m4 b/config/warnings.m4 index 8b832382bea..d3358b6a894 100644 --- a/config/warnings.m4 +++ b/config/warnings.m4 @@ -1,6 +1,6 @@ # Autoconf include file defining macros related to compile-time warnings. -# Copyright 2004, 2005 Free Software Foundation, Inc. +# Copyright 2004, 2005, 2007 Free Software Foundation, Inc. #This file is part of GCC. @@ -19,13 +19,15 @@ #Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA #02110-1301, USA. -# ACX_PROG_CC_WARNING_OPTS([-Wfoo -Wbar -Wbaz]) -# Sets @WARN_CFLAGS@ to the subset of the given options which the +# ACX_PROG_CC_WARNING_OPTS(WARNINGS, [VARIABLE = WARN_CFLAGS) +# Sets @VARIABLE@ to the subset of the given options which the # compiler accepts. AC_DEFUN([ACX_PROG_CC_WARNING_OPTS], [AC_REQUIRE([AC_PROG_CC])dnl -AC_SUBST([WARN_CFLAGS])dnl -WARN_CFLAGS= +m4_pushdef([acx_Var], [m4_default([$2], [WARN_CFLAGS])])dnl +AC_SUBST(acx_Var)dnl +m4_expand_once([acx_Var= +],m4_quote(acx_Var=))dnl save_CFLAGS="$CFLAGS" for option in $1; do AS_VAR_PUSHDEF([acx_Woption], [acx_cv_prog_cc_warning_$option]) @@ -36,20 +38,23 @@ for option in $1; do [AS_VAR_SET(acx_Woption, no)]) ]) AS_IF([test AS_VAR_GET(acx_Woption) = yes], - [WARN_CFLAGS="$WARN_CFLAGS${WARN_CFLAGS:+ }$option"]) + [acx_Var="$acx_Var${acx_Var:+ }$option"]) AS_VAR_POPDEF([acx_Woption])dnl done CFLAGS="$save_CFLAGS" +m4_popdef([acx_Var])dnl ])# ACX_PROG_CC_WARNING_OPTS -# ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long ...]) -# Sets WARN_PEDANTIC to "-pedantic" + the argument, if the compiler is GCC +# ACX_PROG_CC_WARNING_ALMOST_PEDANTIC(WARNINGS, [VARIABLE = WARN_PEDANTIC) +# Append to VARIABLE "-pedantic" + the argument, if the compiler is GCC # and accepts all of those options simultaneously, otherwise to nothing. AC_DEFUN([ACX_PROG_CC_WARNING_ALMOST_PEDANTIC], [AC_REQUIRE([AC_PROG_CC])dnl -AC_SUBST([WARN_PEDANTIC])dnl +m4_pushdef([acx_Var], [m4_default([$2], [WARN_PEDANTIC])])dnl +AC_SUBST(acx_Var)dnl +m4_expand_once([acx_Var= +],m4_quote(acx_Var=))dnl AS_VAR_PUSHDEF([acx_Pedantic], [acx_cv_prog_cc_pedantic_$1])dnl -WARN_PEDANTIC= AS_IF([test "$GCC" = yes], [AC_CACHE_CHECK([whether $CC supports -pedantic $1], acx_Pedantic, [save_CFLAGS="$CFLAGS" @@ -59,28 +64,31 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], [AS_VAR_SET(acx_Pedantic, no)]) CFLAGS="$save_CFLAGS"]) AS_IF([test AS_VAR_GET(acx_Pedantic) = yes], - [WARN_PEDANTIC="-pedantic $1"]) + [acx_Var="$acx_Var${acx_Var:+ }-pedantic $1"]) ]) AS_VAR_POPDEF([acx_Pedantic])dnl +m4_popdef([acx_Var])dnl ])# ACX_PROG_CC_WARNING_ALMOST_PEDANTIC -# ACX_PROG_CC_WARNINGS_ARE_ERRORS([x.y.z]) -# sets WERROR to "-Werror" if the compiler is GCC >=x.y.z, or if +# ACX_PROG_CC_WARNINGS_ARE_ERRORS([x.y.z], [VARIABLE = WERROR]) +# sets @VARIABLE@ to "-Werror" if the compiler is GCC >=x.y.z, or if # --enable-werror-always was given on the command line, otherwise # to nothing. # If the argument is the word "manual" instead of a version number, -# then WERROR will be set to -Werror only if --enable-werror-always +# then @VARIABLE@ will be set to -Werror only if --enable-werror-always # appeared on the configure command line. AC_DEFUN([ACX_PROG_CC_WARNINGS_ARE_ERRORS], [AC_REQUIRE([AC_PROG_CC])dnl -AC_SUBST([WERROR])dnl -WERROR= +m4_pushdef([acx_Var], [m4_default([$2], [WERROR])])dnl +AC_SUBST(acx_Var)dnl +m4_expand_once([acx_Var= +],m4_quote(acx_Var=))dnl AC_ARG_ENABLE(werror-always, AS_HELP_STRING([--enable-werror-always], [enable -Werror despite compiler version]), [], [enable_werror_always=no]) AS_IF([test $enable_werror_always = yes], - [WERROR=-Werror], + [acx_Var="$acx_Var${acx_Var:+ }-Werror"]) m4_if($1, [manual],, [AS_VAR_PUSHDEF([acx_GCCvers], [acx_cv_prog_cc_gcc_$1_or_newer])dnl AC_CACHE_CHECK([whether $CC is GCC >=$1], acx_GCCvers, @@ -94,6 +102,7 @@ AS_IF([test $enable_werror_always = yes], [AS_VAR_SET(acx_GCCvers, yes)], [AS_VAR_SET(acx_GCCvers, no)])]) AS_IF([test AS_VAR_GET(acx_GCCvers) = yes], - [WERROR=-WerrorB]) - AS_VAR_POPDEF([acx_GCCvers])])) + [acx_Var="$acx_Var${acx_Var:+ }-Werror"]) + AS_VAR_POPDEF([acx_GCCvers])]) +m4_popdef([acx_Var])dnl ])# ACX_PROG_CC_WARNINGS_ARE_ERRORS diff --git a/configure b/configure index dbcbdfef7d3..13f1960e4fd 100755 --- a/configure +++ b/configure @@ -1,64 +1,288 @@ #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# Generated by GNU Autoconf 2.59. # +# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## -# Defaults: -ac_help= +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_help="$ac_help - --enable-libada Builds libada directory" -ac_help="$ac_help - --enable-libssp Builds libssp directory" -ac_help="$ac_help - --enable-libgcc-math Builds libgcc-math directory" -ac_help="$ac_help - --with-mpfr-dir=PATH Specify source directory for MPFR library" -ac_help="$ac_help - --with-mpfr=PATH Specify directory for installed MPFR library" -ac_help="$ac_help - --with-gmp-dir=PATH Specify source directory for GMP library" -ac_help="$ac_help - --with-gmp=PATH Specify directory for installed GMP library" -ac_help="$ac_help - --with-build-sysroot=sysroot - use sysroot as the system root during the build" -ac_help="$ac_help - --enable-bootstrap Enable bootstrapping [yes if native build]" -ac_help="$ac_help - --enable-serial-[{host,target,build}-]configure - Force sequential configuration of - sub-packages for the host, target or build - machine, or all sub-packages" -ac_help="$ac_help - --with-build-time-tools=path - use given path to find target tools during the build" -ac_help="$ac_help - --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer" -ac_help="$ac_help - --enable-werror enable -Werror in bootstrap stage2 and later" -ac_help="$ac_help - --with-datarootdir Use datarootdir as the data root directory." -ac_help="$ac_help - --with-docdir Install documentation in this directory." -ac_help="$ac_help - --with-htmldir Install html in this directory." +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="move-if-change" +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os build_noncanonical host_noncanonical target_noncanonical host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN LN_S TOPLEVEL_CONFIGURE_ARGUMENTS build_libsubdir build_subdir host_subdir target_subdir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE do_compare gmplibs gmpinc stage1_languages SYSROOT_CFLAGS_FOR_TARGET RPATH_ENVVAR tooldir build_tooldir CONFIGURE_GDB_TK GDB_TK INSTALL_GDB_TK build_configargs build_configdirs host_configargs configdirs target_configargs CC_FOR_BUILD config_shell YACC BISON M4 LEX FLEX MAKEINFO EXPECT RUNTEST AR AS DLLTOOL LD LIPO NM RANLIB STRIP WINDRES OBJCOPY OBJDUMP CFLAGS_FOR_BUILD CC_FOR_TARGET CXX_FOR_TARGET GCC_FOR_TARGET GCJ_FOR_TARGET GFORTRAN_FOR_TARGET AR_FOR_TARGET AS_FOR_TARGET DLLTOOL_FOR_TARGET LD_FOR_TARGET LIPO_FOR_TARGET NM_FOR_TARGET OBJDUMP_FOR_TARGET RANLIB_FOR_TARGET STRIP_FOR_TARGET WINDRES_FOR_TARGET RAW_CXX_FOR_TARGET FLAGS_FOR_TARGET COMPILER_AS_FOR_TARGET COMPILER_LD_FOR_TARGET COMPILER_NM_FOR_TARGET MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT stage1_cflags stage1_checking stage2_werror_flag datarootdir docdir pdfdir htmldir LIBOBJS LTLIBOBJS' +ac_subst_files='serialization_dependencies host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag' # Initialize some variables set by options. +ac_init_help= +ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. -build=NONE -cache_file=./config.cache +cache_file=/dev/null exec_prefix=NONE -host=NONE no_create= -nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE @@ -67,10 +291,15 @@ program_transform_name=s,x,x, silent= site= srcdir= -target=NONE verbose= x_includes=NONE x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' @@ -84,17 +313,9 @@ oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - ac_prev= for ac_option do - # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" @@ -102,59 +323,59 @@ do continue fi - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. - case "$ac_option" in + case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; + bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) - ac_prev=build ;; + ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; + build_alias=$ac_optarg ;; -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=*) - cache_file="$ac_optarg" ;; + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) - datadir="$ac_optarg" ;; + datadir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "enable_${ac_feature}='$ac_optarg'" ;; + eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -163,95 +384,47 @@ do -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; + exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; -host | --host | --hos | --ho) - ac_prev=host ;; + ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; + host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; + includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; + infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; + libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; + libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ @@ -260,19 +433,19 @@ EOF -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; + localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; + mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) + | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ @@ -286,26 +459,26 @@ EOF -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; + oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; + prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; + program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; + program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ @@ -322,7 +495,7 @@ EOF | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; + program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) @@ -332,7 +505,7 @@ EOF ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; + sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ @@ -343,58 +516,57 @@ EOF | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; + sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; + site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; + srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; + sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; + ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; + target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "with_${ac_package}='$ac_optarg'" ;; + eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. @@ -405,99 +577,110 @@ EOF ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; + x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; + x_libraries=$ac_optarg ;; - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } fi -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; esac done -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=move-if-change # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. @@ -507,13 +690,660 @@ else fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } fi fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CXX_set=${CXX+set} +ac_env_CXX_value=$CXX +ac_cv_env_CXX_set=${CXX+set} +ac_cv_env_CXX_value=$CXX +ac_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_env_CXXFLAGS_value=$CXXFLAGS +ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_cv_env_CXXFLAGS_value=$CXXFLAGS +ac_env_AR_set=${AR+set} +ac_env_AR_value=$AR +ac_cv_env_AR_set=${AR+set} +ac_cv_env_AR_value=$AR +ac_env_AS_set=${AS+set} +ac_env_AS_value=$AS +ac_cv_env_AS_set=${AS+set} +ac_cv_env_AS_value=$AS +ac_env_DLLTOOL_set=${DLLTOOL+set} +ac_env_DLLTOOL_value=$DLLTOOL +ac_cv_env_DLLTOOL_set=${DLLTOOL+set} +ac_cv_env_DLLTOOL_value=$DLLTOOL +ac_env_LD_set=${LD+set} +ac_env_LD_value=$LD +ac_cv_env_LD_set=${LD+set} +ac_cv_env_LD_value=$LD +ac_env_LIPO_set=${LIPO+set} +ac_env_LIPO_value=$LIPO +ac_cv_env_LIPO_set=${LIPO+set} +ac_cv_env_LIPO_value=$LIPO +ac_env_NM_set=${NM+set} +ac_env_NM_value=$NM +ac_cv_env_NM_set=${NM+set} +ac_cv_env_NM_value=$NM +ac_env_RANLIB_set=${RANLIB+set} +ac_env_RANLIB_value=$RANLIB +ac_cv_env_RANLIB_set=${RANLIB+set} +ac_cv_env_RANLIB_value=$RANLIB +ac_env_STRIP_set=${STRIP+set} +ac_env_STRIP_value=$STRIP +ac_cv_env_STRIP_set=${STRIP+set} +ac_cv_env_STRIP_value=$STRIP +ac_env_WINDRES_set=${WINDRES+set} +ac_env_WINDRES_value=$WINDRES +ac_cv_env_WINDRES_set=${WINDRES+set} +ac_cv_env_WINDRES_value=$WINDRES +ac_env_OBJCOPY_set=${OBJCOPY+set} +ac_env_OBJCOPY_value=$OBJCOPY +ac_cv_env_OBJCOPY_set=${OBJCOPY+set} +ac_cv_env_OBJCOPY_value=$OBJCOPY +ac_env_OBJDUMP_set=${OBJDUMP+set} +ac_env_OBJDUMP_value=$OBJDUMP +ac_cv_env_OBJDUMP_set=${OBJDUMP+set} +ac_cv_env_OBJDUMP_value=$OBJDUMP +ac_env_CC_FOR_TARGET_set=${CC_FOR_TARGET+set} +ac_env_CC_FOR_TARGET_value=$CC_FOR_TARGET +ac_cv_env_CC_FOR_TARGET_set=${CC_FOR_TARGET+set} +ac_cv_env_CC_FOR_TARGET_value=$CC_FOR_TARGET +ac_env_CXX_FOR_TARGET_set=${CXX_FOR_TARGET+set} +ac_env_CXX_FOR_TARGET_value=$CXX_FOR_TARGET +ac_cv_env_CXX_FOR_TARGET_set=${CXX_FOR_TARGET+set} +ac_cv_env_CXX_FOR_TARGET_value=$CXX_FOR_TARGET +ac_env_GCC_FOR_TARGET_set=${GCC_FOR_TARGET+set} +ac_env_GCC_FOR_TARGET_value=$GCC_FOR_TARGET +ac_cv_env_GCC_FOR_TARGET_set=${GCC_FOR_TARGET+set} +ac_cv_env_GCC_FOR_TARGET_value=$GCC_FOR_TARGET +ac_env_GCJ_FOR_TARGET_set=${GCJ_FOR_TARGET+set} +ac_env_GCJ_FOR_TARGET_value=$GCJ_FOR_TARGET +ac_cv_env_GCJ_FOR_TARGET_set=${GCJ_FOR_TARGET+set} +ac_cv_env_GCJ_FOR_TARGET_value=$GCJ_FOR_TARGET +ac_env_GFORTRAN_FOR_TARGET_set=${GFORTRAN_FOR_TARGET+set} +ac_env_GFORTRAN_FOR_TARGET_value=$GFORTRAN_FOR_TARGET +ac_cv_env_GFORTRAN_FOR_TARGET_set=${GFORTRAN_FOR_TARGET+set} +ac_cv_env_GFORTRAN_FOR_TARGET_value=$GFORTRAN_FOR_TARGET +ac_env_AR_FOR_TARGET_set=${AR_FOR_TARGET+set} +ac_env_AR_FOR_TARGET_value=$AR_FOR_TARGET +ac_cv_env_AR_FOR_TARGET_set=${AR_FOR_TARGET+set} +ac_cv_env_AR_FOR_TARGET_value=$AR_FOR_TARGET +ac_env_AS_FOR_TARGET_set=${AS_FOR_TARGET+set} +ac_env_AS_FOR_TARGET_value=$AS_FOR_TARGET +ac_cv_env_AS_FOR_TARGET_set=${AS_FOR_TARGET+set} +ac_cv_env_AS_FOR_TARGET_value=$AS_FOR_TARGET +ac_env_DLLTOOL_FOR_TARGET_set=${DLLTOOL_FOR_TARGET+set} +ac_env_DLLTOOL_FOR_TARGET_value=$DLLTOOL_FOR_TARGET +ac_cv_env_DLLTOOL_FOR_TARGET_set=${DLLTOOL_FOR_TARGET+set} +ac_cv_env_DLLTOOL_FOR_TARGET_value=$DLLTOOL_FOR_TARGET +ac_env_LD_FOR_TARGET_set=${LD_FOR_TARGET+set} +ac_env_LD_FOR_TARGET_value=$LD_FOR_TARGET +ac_cv_env_LD_FOR_TARGET_set=${LD_FOR_TARGET+set} +ac_cv_env_LD_FOR_TARGET_value=$LD_FOR_TARGET +ac_env_LIPO_FOR_TARGET_set=${LIPO_FOR_TARGET+set} +ac_env_LIPO_FOR_TARGET_value=$LIPO_FOR_TARGET +ac_cv_env_LIPO_FOR_TARGET_set=${LIPO_FOR_TARGET+set} +ac_cv_env_LIPO_FOR_TARGET_value=$LIPO_FOR_TARGET +ac_env_NM_FOR_TARGET_set=${NM_FOR_TARGET+set} +ac_env_NM_FOR_TARGET_value=$NM_FOR_TARGET +ac_cv_env_NM_FOR_TARGET_set=${NM_FOR_TARGET+set} +ac_cv_env_NM_FOR_TARGET_value=$NM_FOR_TARGET +ac_env_OBJDUMP_FOR_TARGET_set=${OBJDUMP_FOR_TARGET+set} +ac_env_OBJDUMP_FOR_TARGET_value=$OBJDUMP_FOR_TARGET +ac_cv_env_OBJDUMP_FOR_TARGET_set=${OBJDUMP_FOR_TARGET+set} +ac_cv_env_OBJDUMP_FOR_TARGET_value=$OBJDUMP_FOR_TARGET +ac_env_RANLIB_FOR_TARGET_set=${RANLIB_FOR_TARGET+set} +ac_env_RANLIB_FOR_TARGET_value=$RANLIB_FOR_TARGET +ac_cv_env_RANLIB_FOR_TARGET_set=${RANLIB_FOR_TARGET+set} +ac_cv_env_RANLIB_FOR_TARGET_value=$RANLIB_FOR_TARGET +ac_env_STRIP_FOR_TARGET_set=${STRIP_FOR_TARGET+set} +ac_env_STRIP_FOR_TARGET_value=$STRIP_FOR_TARGET +ac_cv_env_STRIP_FOR_TARGET_set=${STRIP_FOR_TARGET+set} +ac_cv_env_STRIP_FOR_TARGET_value=$STRIP_FOR_TARGET +ac_env_WINDRES_FOR_TARGET_set=${WINDRES_FOR_TARGET+set} +ac_env_WINDRES_FOR_TARGET_value=$WINDRES_FOR_TARGET +ac_cv_env_WINDRES_FOR_TARGET_set=${WINDRES_FOR_TARGET+set} +ac_cv_env_WINDRES_FOR_TARGET_value=$WINDRES_FOR_TARGET +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-libada Builds libada directory + --enable-libssp Builds libssp directory + --enable-stage1-languages=all choose additional languages to build during + stage1. Mostly useful for compiler development. + --enable-objc-gc enable the use of Boehm's garbage collector with + the GNU Objective-C runtime. + --enable-bootstrap Enable bootstrapping yes if native build + --enable-serial-{host,target,build}-configure + Force sequential configuration of + sub-packages for the host, target or build + machine, or all sub-packages + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + --enable-stage1-checking=all choose additional checking for stage1 + of the compiler. + --enable-werror enable -Werror in bootstrap stage2 and later + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-build-libsubdir=DIR Directory where to find libraries for build system + --with-mpfr-dir=PATH This option has been REMOVED + --with-mpfr=PATH Specify prefix directory for installed MPFR package + Equivalent to --with-mpfr-include=PATH/include + plus --with-mpfr-lib=PATH/lib + --with-mpfr-include=PATH + Specify directory for installed MPFR include files + --with-mpfr-lib=PATH Specify the directory for the installed MPFR library + --with-gmp-dir=PATH This option has been REMOVED + --with-gmp=PATH Specify prefix directory for the installed GMP package + Equivalent to --with-gmp-include=PATH/include + plus --with-gmp-lib=PATH/lib + --with-gmp-include=PATH Specify directory for installed GMP include files + --with-gmp-lib=PATH Specify the directory for the installed GMP library + --with-build-sysroot=sysroot + use sysroot as the system root during the build + --with-build-time-tools=path + use given path to find target tools during the build + --with-datarootdir Use datarootdir as the data root directory. + --with-docdir Install documentation in this directory. + --with-pdfdir Install pdf in this directory. + --with-htmldir Install html in this directory. + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags + AR AR for the host + AS AS for the host + DLLTOOL DLLTOOL for the host + LD LD for the host + LIPO LIPO for the host + NM NM for the host + RANLIB RANLIB for the host + STRIP STRIP for the host + WINDRES WINDRES for the host + OBJCOPY OBJCOPY for the host + OBJDUMP OBJDUMP for the host + CC_FOR_TARGET + CC for the target + CXX_FOR_TARGET + CXX for the target + GCC_FOR_TARGET + GCC for the target + GCJ_FOR_TARGET + GCJ for the target + GFORTRAN_FOR_TARGET + GFORTRAN for the target + AR_FOR_TARGET + AR for the target + AS_FOR_TARGET + AS for the target + DLLTOOL_FOR_TARGET + DLLTOOL for the target + LD_FOR_TARGET + LD for the target + LIPO_FOR_TARGET + LIPO for the target + NM_FOR_TARGET + NM for the target + OBJDUMP_FOR_TARGET + OBJDUMP for the target + RANLIB_FOR_TARGET + RANLIB for the target + STRIP_FOR_TARGET + STRIP for the target + WINDRES_FOR_TARGET + WINDRES for the target + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF + +Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then @@ -524,42 +1354,108 @@ if test -z "$CONFIG_SITE"; then fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi else - echo "creating cache $cache_file" - > $cache_file + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } fi ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + +# Find the build, host, and target systems. ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then @@ -570,122 +1466,143 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break fi done if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -# Do some error checking and defaulting for the host and target type. -# The inputs are: -# configure --host=HOST --target=TARGET --build=BUILD NONOPT -# -# The rules are: -# 1. You are not allowed to specify --host, --target, and nonopt at the -# same time. -# 2. Host defaults to nonopt. -# 3. If nonopt is not specified, then host defaults to the current host, -# as determined by config.guess. -# 4. Target and build default to nonopt. -# 5. If nonopt is not specified, then target and build default to host. + case ${build_alias} in + "") build_noncanonical=${build} ;; + *) build_noncanonical=${build_alias} ;; +esac + + + + case ${host_alias} in + "") host_noncanonical=${build_noncanonical} ;; + *) host_noncanonical=${host_alias} ;; +esac + + + + case ${target_alias} in + "") target_noncanonical=${host_noncanonical} ;; + *) target_noncanonical=${target_alias} ;; +esac + + + + +test "$host_noncanonical" = "$target_noncanonical" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_transform_name=s,y,y, + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6 +if test "${ac_cv_target+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_target_alias=$target_alias +test "x$ac_cv_target_alias" = "x" && + ac_cv_target_alias=$ac_cv_host_alias +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6 +target=$ac_cv_target +target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + # The aliases save the names the user supplied, while $host etc. # will get canonicalized. -case $host---$target---$nonopt in -NONE---*---* | *---NONE---* | *---*---NONE) ;; -*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; -esac - - -# Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -fi - -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:611: checking host system type" >&5 - -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac - -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 - -echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:632: checking target system type" >&5 - -target_alias=$target -case "$target_alias" in -NONE) - case $nonopt in - NONE) target_alias=$host_alias ;; - *) target_alias=$nonopt ;; - esac ;; -esac - -target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` -target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$target" 1>&6 - -echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:650: checking build system type" >&5 - -build_alias=$build -case "$build_alias" in -NONE) - case $nonopt in - NONE) build_alias=$host_alias ;; - *) build_alias=$nonopt ;; - esac ;; -esac - -build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` -build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$build" 1>&6 - -test "$host_alias" != "$target_alias" && +test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- - -if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed -fi test "$program_prefix" != NONE && - program_transform_name="s,^,${program_prefix},; $program_transform_name" + program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && - program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," # Get 'install' or 'install-sh' and its variants. @@ -696,67 +1613,82 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x," # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:705: checking for a BSD compatible install" >&5 +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 fi fi done - ;; - esac - done - IFS="$ac_save_IFS" + done + ;; +esac +done + fi if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" + INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. - INSTALL="$ac_install_sh" + INSTALL=$ac_install_sh fi fi -echo "$ac_t""$INSTALL" 1>&6 +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -echo $ac_n "checking whether ln works""... $ac_c" 1>&6 -echo "configure:758: checking whether ln works" >&5 -if eval "test \"`echo '$''{'acx_cv_prog_LN'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking whether ln works" >&5 +echo $ECHO_N "checking whether ln works... $ECHO_C" >&6 +if test "${acx_cv_prog_LN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f conftestdata_t echo >conftestdata_f @@ -771,31 +1703,23 @@ rm -f conftestdata_f conftestdata_t fi if test $acx_cv_prog_LN = no; then LN="cp" - echo "$ac_t""no, using $LN" 1>&6 + echo "$as_me:$LINENO: result: no, using $LN" >&5 +echo "${ECHO_T}no, using $LN" >&6 else LN="$acx_cv_prog_LN" - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 fi -echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:782: checking whether ln -s works" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - rm -f conftestdata -if ln -s X conftestdata 2>/dev/null -then - rm -f conftestdata - ac_cv_prog_LN_S="ln -s" -else - ac_cv_prog_LN_S=ln -fi -fi -LN_S="$ac_cv_prog_LN_S" -if test "$ac_cv_prog_LN_S" = "ln -s"; then - echo "$ac_t""yes" 1>&6 -else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 fi @@ -837,14 +1761,25 @@ progname=$0 # if PWD already has a value, it is probably wrong. if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi -# Export original configure arguments for use by sub-configures. These -# will be expanded by make, so quote '$'. -tmp="$progname $@" -sed -e 's,\$,$$,g' < conftestsed.out -$tmp -EOF_SED -TOPLEVEL_CONFIGURE_ARGUMENTS=`cat conftestsed.out` -rm -f conftestsed.out +# Export original configure arguments for use by sub-configures. +# Quote arguments with shell meta charatcers. +TOPLEVEL_CONFIGURE_ARGUMENTS= +set -- "$progname" "$@" +for ac_arg +do + case "$ac_arg" in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` + # if the argument is of the form -foo=baz, quote the baz part only + ac_arg=`echo "'$ac_arg'" | sed "s/^'\([-a-zA-Z0-9]*=\)/\\1'/"` ;; + *) ;; + esac + # Add the quoted argument to the list. + TOPLEVEL_CONFIGURE_ARGUMENTS="$TOPLEVEL_CONFIGURE_ARGUMENTS $ac_arg" +done +# Remove the initial space we just introduced and, as these will be +# expanded by make, quote '$'. +TOPLEVEL_CONFIGURE_ARGUMENTS=`echo "x$TOPLEVEL_CONFIGURE_ARGUMENTS" | sed -e 's/^x *//' -e 's,\\$,$$,g'` moveifchange=${srcdir}/move-if-change @@ -872,11 +1807,11 @@ extra_host_args= ### or a host dependent tool. Then put it into the appropriate list ### (library or tools, host or target), doing a dependency sort. -# Subdirs will be configured in the order listed in build_configdirs, +# Subdirs will be configured in the order listed in build_configdirs, # configdirs, or target_configdirs; see the serialization section below. -# Dependency sorting is only needed when *configuration* must be done in -# a particular order. In all cases a dependency should be specified in +# Dependency sorting is only needed when *configuration* must be done in +# a particular order. In all cases a dependency should be specified in # the Makefile, whether or not it's implicitly specified here. # Double entries in build_configdirs, configdirs, or target_configdirs may @@ -892,7 +1827,7 @@ build_tools="build-texinfo build-byacc build-flex build-bison build-m4 build-fix # these libraries are used by various programs built for the host environment # -host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber" +host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber gmp mpfr" # these tools are built for the host environment # Note, the powerpc-eabi build depends on sim occurring before gdb in order to @@ -903,7 +1838,6 @@ host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc sid sim gdb # libgcj represents the runtime libraries only used by gcj. libgcj="target-libffi \ - target-boehm-gc \ target-zlib \ target-qthreads \ target-libjava" @@ -911,14 +1845,15 @@ libgcj="target-libffi \ # these libraries are built for the target environment, and are built after # the host libraries and the host tools (which may be a cross compiler) # -target_libraries="target-libiberty \ +target_libraries="target-libgcc \ + target-libiberty \ target-libgloss \ target-newlib \ target-libstdc++-v3 \ target-libmudflap \ target-libssp \ - target-libgcc-math \ target-libgfortran \ + target-boehm-gc \ ${libgcj} \ target-libobjc \ target-libada \ @@ -957,26 +1892,29 @@ if test x"${host}" = x"${target}" ; then is_cross_compiler=no else is_cross_compiler=yes -fi +fi # Find the build and target subdir names. - case ${build_alias} in - "") build_noncanonical=${build} ;; - *) build_noncanonical=${build_alias} ;; -esac - case ${host_alias} in - "") host_noncanonical=${build_noncanonical} ;; - *) host_noncanonical=${host_alias} ;; -esac +# post-stage1 host modules use a different CC_FOR_BUILD so, in order to +# have matching libraries, they should use host libraries: Makefile.tpl +# arranges to pass --with-build-libsubdir=$(HOST_SUBDIR). +# However, they still use the build modules, because the corresponding +# host modules (e.g. bison) are only built for the host when bootstrap +# finishes. So: +# - build_subdir is where we find build modules, and never changes. +# - build_libsubdir is where we find build libraries, and can be overridden. - case ${target_alias} in - "") target_noncanonical=${host_noncanonical} ;; - *) target_noncanonical=${target_alias} ;; -esac - - # Prefix 'build-' so this never conflicts with target_subdir. +# Prefix 'build-' so this never conflicts with target_subdir. build_subdir="build-${build_noncanonical}" + +# Check whether --with-build-libsubdir or --without-build-libsubdir was given. +if test "${with_build_libsubdir+set}" = set; then + withval="$with_build_libsubdir" + build_libsubdir="$withval" +else + build_libsubdir="$build_subdir" +fi; # --srcdir=. covers the toplevel, while "test -d" covers the subdirectories if ( test $srcdir = . && test -d gcc ) \ || test -d $srcdir/../host-${host_noncanonical}; then @@ -986,7 +1924,7 @@ else fi # No prefix. target_subdir=${target_noncanonical} - + # Skipdirs are removed silently. skipdirs= @@ -1007,7 +1945,7 @@ if test x$with_gnu_as = xno ; then noconfigdirs="$noconfigdirs gas" fi -# some tools are so dependent upon X11 that if we're not building with X, +# some tools are so dependent upon X11 that if we're not building with X, # it's not even worth trying to configure, much less build, that tool. case ${with_x} in @@ -1015,14 +1953,14 @@ case ${with_x} in no) skipdirs="${skipdirs} tk itcl libgui" # We won't be able to build gdbtk without X. - enable_gdbtk=no + enable_gdbtk=no ;; *) echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 ;; esac # Some tools are only suitable for building in a "native" situation. -# Remove these if host!=target. -native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" +# Remove these if host!=target. +native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" # Similarly, some are only suitable for cross toolchains. # Remove these if host=target. @@ -1059,7 +1997,7 @@ esac # Only spaces may be used in this macro; not newlines or tabs. unsupported_languages= -# Remove more programs from consideration, based on the host or +# Remove more programs from consideration, based on the host or # target this usually means that a port of the program doesn't # exist yet. @@ -1073,9 +2011,12 @@ case "${host}" in i[3456789]86-*-go32* | i[3456789]86-*-msdosdjgpp*) noconfigdirs="$noconfigdirs tcl tk expect dejagnu send-pr uudecode guile itcl gnuserv libffi" ;; + x86_64-*-mingw*) + noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool newlib" + ;; i[3456789]86-*-mingw32*) # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl gnuserv" - noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool" + noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool newlib" ;; i[3456789]86-*-beos*) noconfigdirs="$noconfigdirs tk itcl libgui gdb" @@ -1101,8 +2042,7 @@ if test "${enable_libada+set}" = set; then ENABLE_LIBADA=$enableval else ENABLE_LIBADA=yes -fi - +fi; if test "${ENABLE_LIBADA}" != "yes" ; then noconfigdirs="$noconfigdirs gnattools" fi @@ -1113,25 +2053,7 @@ if test "${enable_libssp+set}" = set; then ENABLE_LIBSSP=$enableval else ENABLE_LIBSSP=yes -fi - - -# Set the default so we build libgcc-math for ix86 and x86_64 -# Check whether --enable-libgcc-math or --disable-libgcc-math was given. -if test "${enable_libgcc_math+set}" = set; then - enableval="$enable_libgcc_math" - : -else - -case "${target}" in - i?86-* | x86_64-* ) - enable_libgcc_math=yes ;; - *) - enable_libgcc_math=no ;; -esac - -fi - +fi; # Save it here so that, even in case of --enable-libgcj, if the Java # front-end isn't enabled, we still get libgcj disabled. @@ -1153,7 +2075,7 @@ esac # Disable libmudflap on some systems. if test x$enable_libmudflap = x ; then case "${target}" in - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu) + *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc* | *-*-uclinux*) # Enable libmudflap by default in GNU and friends. ;; *-*-freebsd*) @@ -1174,7 +2096,7 @@ if test x$enable_libgomp = x ; then ;; *-*-netbsd* | *-*-freebsd* | *-*-openbsd*) ;; - *-*-solaris2* | *-*-sysv4* | *-*-irix* | *-*-osf* | *-*-hpux*) + *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11*) ;; *-*-darwin* | *-*-aix*) ;; @@ -1189,7 +2111,7 @@ case "${target}" in *-*-chorusos) noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" ;; - powerpc-*-darwin*) + powerpc-*-darwin* | i[3456789]86-*-darwin*) noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof" noconfigdirs="$noconfigdirs sim target-rda" ;; @@ -1253,9 +2175,6 @@ case "${target}" in *-*-vxworks*) noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty target-libstdc++-v3 ${libgcj}" ;; - m32c-*-*) - noconfigdirs="$noconfigdirs target-libstdc++-v3" - ;; alpha*-dec-osf*) # ld works, but does not support shared libraries. # newlib is not 64 bit ready. I'm not sure about fileutils. @@ -1278,7 +2197,7 @@ case "${target}" in ;; sh-*-linux*) noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" - ;; + ;; sh*-*-pe|mips*-*-pe|*arm-wince-pe) noconfigdirs="$noconfigdirs ${libgcj}" noconfigdirs="$noconfigdirs target-examples" @@ -1308,6 +2227,9 @@ case "${target}" in arm*-*-linux-gnueabi) noconfigdirs="$noconfigdirs target-libffi target-qthreads" noconfigdirs="$noconfigdirs target-libjava target-libobjc" + case ${with_newlib} in + no) noconfigdirs="$noconfigdirs target-newlib target-libgloss" + esac ;; arm*-*-symbianelf*) noconfigdirs="$noconfigdirs ${libgcj} target-libiberty" @@ -1331,7 +2253,7 @@ case "${target}" in noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}" ;; bfin-*-*) - noconfigdirs="$noconfigdirs target-libgloss gdb" + noconfigdirs="$noconfigdirs gdb" if test x${is_cross_compiler} != xno ; then target_configdirs="${target_configdirs} target-bsp target-cygmon" fi @@ -1395,6 +2317,9 @@ case "${target}" in hppa*64*-*-*) noconfigdirs="$noconfigdirs ${libgcj}" ;; + hppa*-hp-hpux11*) + noconfigdirs="$noconfigdirs ld shellutils" + ;; hppa*-*-*) # According to Alexandre Oliva , libjava won't # build on HP-UX 10.20. @@ -1436,33 +2361,23 @@ case "${target}" in # 'target-newlib' will appear in skipdirs. ;; i[3456789]86-*-mingw32*) - target_configdirs="$target_configdirs target-mingw" - noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj}" - - # Can't build gdb for mingw32 if not native. - case "${host}" in - i[3456789]86-*-mingw32) ;; # keep gdb tcl tk expect etc. - *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl gnuserv" - ;; - esac - ;; + target_configdirs="$target_configdirs target-winsup" + noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}" + ;; + x86_64-*-mingw*) + target_configdirs="$target_configdirs target-winsup" + noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}" + ;; *-*-cygwin*) target_configdirs="$target_configdirs target-libtermcap target-winsup" noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}" # always build newlib if winsup directory is present. - if test -d "$srcdir/winsup"; then + if test -d "$srcdir/winsup/cygwin"; then skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` elif test -d "$srcdir/newlib"; then - echo "Warning: winsup is missing so newlib can't be built." + echo "Warning: winsup/cygwin is missing so newlib can't be built." fi - - # Can't build gdb for Cygwin if not native. - case "${host}" in - *-*-cygwin*) ;; # keep gdb tcl tk expect etc. - *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl libgui gnuserv" - ;; - esac - ;; + ;; i[3456789]86-moss-msdos | i[3456789]86-*-moss* | \ i[3456789]86-*-uwin* | i[3456789]86-*-interix* ) ;; @@ -1563,17 +2478,11 @@ case "${target}" in # noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" ;; - mips*-dec-bsd*) - noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" - ;; mips*-*-bsd*) noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" ;; - mipstx39-*-*) - noconfigdirs="$noconfigdirs gprof ${libgcj}" # same as generic mips - ;; mips64*-*-linux*) - noconfigdirs="$noconfigdirs target-newlib ${libgcj}" + noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" ;; mips*-*-linux*) noconfigdirs="$noconfigdirs target-newlib target-libgloss" @@ -1615,6 +2524,9 @@ case "${target}" in ;; sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*) ;; + spu-*-*) + skipdirs="target-libssp" + ;; v810-*-*) noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}" ;; @@ -1644,7 +2556,7 @@ case "${target}" in ;; *-*-lynxos*) noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" - ;; + ;; *-*-*) noconfigdirs="$noconfigdirs ${libgcj}" ;; @@ -1771,6 +2683,8 @@ case "${host}" in ;; *-mingw32*) ;; + *-mingw64*) + ;; *-interix*) host_makefile_frag="config/mh-interix" ;; @@ -1841,233 +2755,664 @@ if test -z "${CC}" && test "${build}" = "${host}" ; then fi if test "${build}" != "${host}" ; then - # If we are doing a Canadian Cross, in which the host and build systems - # are not the same, we set reasonable default values for the tools. - - CC=${CC-${host_alias}-gcc} - CFLAGS=${CFLAGS-"-g -O2"} - CXX=${CXX-${host_alias}-c++} - CXXFLAGS=${CXXFLAGS-"-g -O2"} CC_FOR_BUILD=${CC_FOR_BUILD-gcc} - else - # Set reasonable default values for some tools even if not Canadian. - # Of course, these are different reasonable default values, originally - # specified directly in the Makefile. - # We don't export, so that autoconf can do its job. - # Note that all these settings are above the fragment inclusion point - # in Makefile.in, so can still be overridden by fragments. - # This is all going to change when we autoconfiscate... - CC_FOR_BUILD="\$(CC)" - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1867: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1897: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift - if test $# -gt 0; then + if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1948: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - ;; - esac + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1980: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + test -n "$ac_ct_CC" && break +done -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross + CC=$ac_ct_CC +fi -cat > conftest.$ac_ext << EOF +fi -#line 1991 "configure" -#include "confdefs.h" -main(){return(0);} -EOF -if { (eval echo configure:1996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no else - ac_cv_prog_cc_cross=yes + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2022: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:2027: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done else - cat > conftest.c <&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me #endif -EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2036: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes else - GCC= + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2055: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else - ac_cv_prog_cc_g=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" + CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" @@ -2081,111 +3426,812 @@ else CFLAGS= fi fi - - - # We must set the default linker to the linker used by gcc for the correct - # operation of libtool. If LD is not defined and we are using gcc, try to - # set the LD default to the ld used by gcc. - if test -z "$LD"; then - if test "$GCC" = yes; then - case $build in - *-*-mingw*) - gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;; - *) - gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;; - esac - case $gcc_prog_ld in - # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) - LD="$gcc_prog_ld" ;; - esac - fi - fi - - CXX=${CXX-"c++"} - CFLAGS=${CFLAGS-"-g"} - CXXFLAGS=${CXXFLAGS-"-g -O2"} -fi - -if test $host != $build; then - ac_tool_prefix=${host_alias}- +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_tool_prefix= + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CXX" && break +done +test -n "$ac_ct_CXX" || ac_ct_CXX="g++" + + CXX=$ac_ct_CXX +fi + + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cxx_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# We must set the default linker to the linker used by gcc for the correct +# operation of libtool. If LD is not defined and we are using gcc, try to +# set the LD default to the ld used by gcc. +if test -z "$LD"; then + if test "$GCC" = yes; then + case $build in + *-*-mingw*) + gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;; + *) + gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;; + esac + case $gcc_prog_ld in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + LD="$gcc_prog_ld" ;; + esac + fi fi -# Extract the first word of "${ac_tool_prefix}gnatbind", so it can be a program name with args. + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gnatbind", so it can be a program name with args. set dummy ${ac_tool_prefix}gnatbind; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2122: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_GNATBIND+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$GNATBIND"; then ac_cv_prog_GNATBIND="$GNATBIND" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_GNATBIND="${ac_tool_prefix}gnatbind" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GNATBIND="${ac_tool_prefix}gnatbind" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -GNATBIND="$ac_cv_prog_GNATBIND" +GNATBIND=$ac_cv_prog_GNATBIND if test -n "$GNATBIND"; then - echo "$ac_t""$GNATBIND" 1>&6 + echo "$as_me:$LINENO: result: $GNATBIND" >&5 +echo "${ECHO_T}$GNATBIND" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - +fi if test -z "$ac_cv_prog_GNATBIND"; then -if test -n "$ac_tool_prefix"; then + ac_ct_GNATBIND=$GNATBIND # Extract the first word of "gnatbind", so it can be a program name with args. set dummy gnatbind; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2154: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_GNATBIND+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$GNATBIND"; then - ac_cv_prog_GNATBIND="$GNATBIND" # Let the user override the test. + if test -n "$ac_ct_GNATBIND"; then + ac_cv_prog_ac_ct_GNATBIND="$ac_ct_GNATBIND" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_GNATBIND="gnatbind" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_GNATBIND" && ac_cv_prog_GNATBIND="no" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_GNATBIND="gnatbind" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_GNATBIND" && ac_cv_prog_ac_ct_GNATBIND="no" fi fi -GNATBIND="$ac_cv_prog_GNATBIND" -if test -n "$GNATBIND"; then - echo "$ac_t""$GNATBIND" 1>&6 +ac_ct_GNATBIND=$ac_cv_prog_ac_ct_GNATBIND +if test -n "$ac_ct_GNATBIND"; then + echo "$as_me:$LINENO: result: $ac_ct_GNATBIND" >&5 +echo "${ECHO_T}$ac_ct_GNATBIND" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi + GNATBIND=$ac_ct_GNATBIND else - GNATBIND="no" -fi + GNATBIND="$ac_cv_prog_GNATBIND" fi -echo $ac_n "checking whether compiler driver understands Ada""... $ac_c" 1>&6 -echo "configure:2187: checking whether compiler driver understands Ada" >&5 -if eval "test \"`echo '$''{'acx_cv_cc_gcc_supports_ada'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gnatmake", so it can be a program name with args. +set dummy ${ac_tool_prefix}gnatmake; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_GNATMAKE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$GNATMAKE"; then + ac_cv_prog_GNATMAKE="$GNATMAKE" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GNATMAKE="${ac_tool_prefix}gnatmake" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +GNATMAKE=$ac_cv_prog_GNATMAKE +if test -n "$GNATMAKE"; then + echo "$as_me:$LINENO: result: $GNATMAKE" >&5 +echo "${ECHO_T}$GNATMAKE" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_GNATMAKE"; then + ac_ct_GNATMAKE=$GNATMAKE + # Extract the first word of "gnatmake", so it can be a program name with args. +set dummy gnatmake; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_GNATMAKE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_GNATMAKE"; then + ac_cv_prog_ac_ct_GNATMAKE="$ac_ct_GNATMAKE" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_GNATMAKE="gnatmake" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_GNATMAKE" && ac_cv_prog_ac_ct_GNATMAKE="no" +fi +fi +ac_ct_GNATMAKE=$ac_cv_prog_ac_ct_GNATMAKE +if test -n "$ac_ct_GNATMAKE"; then + echo "$as_me:$LINENO: result: $ac_ct_GNATMAKE" >&5 +echo "${ECHO_T}$ac_ct_GNATMAKE" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + GNATMAKE=$ac_ct_GNATMAKE +else + GNATMAKE="$ac_cv_prog_GNATMAKE" +fi + +echo "$as_me:$LINENO: checking whether compiler driver understands Ada" >&5 +echo $ECHO_N "checking whether compiler driver understands Ada... $ECHO_C" >&6 +if test "${acx_cv_cc_gcc_supports_ada+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.adb <&5 +echo "${ECHO_T}$acx_cv_cc_gcc_supports_ada" >&6 -echo "$ac_t""$acx_cv_cc_gcc_supports_ada" 1>&6 - -if test x$GNATBIND != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then +if test x$GNATBIND != xno && test x$GNATMAKE != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then have_gnat=yes else have_gnat=no fi -echo $ac_n "checking how to compare bootstrapped objects""... $ac_c" 1>&6 -echo "configure:2219: checking how to compare bootstrapped objects" >&5 -if eval "test \"`echo '$''{'gcc_cv_prog_cmp_skip'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking how to compare bootstrapped objects" >&5 +echo $ECHO_N "checking how to compare bootstrapped objects... $ECHO_C" >&6 +if test "${gcc_cv_prog_cmp_skip+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else echo abfoo >t1 echo cdfoo >t2 @@ -2239,131 +4285,322 @@ else rm t1 t2 fi - -echo "$ac_t""$gcc_cv_prog_cmp_skip" 1>&6 +echo "$as_me:$LINENO: result: $gcc_cv_prog_cmp_skip" >&5 +echo "${ECHO_T}$gcc_cv_prog_cmp_skip" >&6 do_compare="$gcc_cv_prog_cmp_skip" # Check for GMP and MPFR -gmplibs= +gmplibs="-lmpfr -lgmp" gmpinc= -have_gmp=yes +have_gmp=no + # Specify a location for mpfr # check for this first so it ends up on the link line before gmp. + # Check whether --with-mpfr-dir or --without-mpfr-dir was given. if test "${with_mpfr_dir+set}" = set; then withval="$with_mpfr_dir" - : -fi + { { echo "$as_me:$LINENO: error: The --with-mpfr-dir=PATH option has been removed. +Use --with-mpfr=PATH or --with-mpfr-include=PATH plus --with-mpfr-lib=PATH" >&5 +echo "$as_me: error: The --with-mpfr-dir=PATH option has been removed. +Use --with-mpfr=PATH or --with-mpfr-include=PATH plus --with-mpfr-lib=PATH" >&2;} + { (exit 1); exit 1; }; } +fi; -if test "x$with_mpfr_dir" != x; then - gmpinc="-I$with_mpfr_dir" - gmplibs="$with_mpfr_dir/libmpfr.a" -else - gmplibs="-lmpfr" -fi - # Check whether --with-mpfr or --without-mpfr was given. if test "${with_mpfr+set}" = set; then withval="$with_mpfr" - : -fi +fi; + +# Check whether --with-mpfr_include or --without-mpfr_include was given. +if test "${with_mpfr_include+set}" = set; then + withval="$with_mpfr_include" + +fi; + +# Check whether --with-mpfr_lib or --without-mpfr_lib was given. +if test "${with_mpfr_lib+set}" = set; then + withval="$with_mpfr_lib" + +fi; if test "x$with_mpfr" != x; then gmplibs="-L$with_mpfr/lib $gmplibs" gmpinc="-I$with_mpfr/include" fi +if test "x$with_mpfr_include" != x; then + gmpinc="-I$with_mpfr_include" +fi +if test "x$with_mpfr_lib" != x; then + gmplibs="-L$with_mpfr_lib $gmplibs" +fi +if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then + gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/.libs -L$$r/$(HOST_SUBDIR)/mpfr/_libs '"$gmplibs" + gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr '"$gmpinc" + # Do not test the mpfr version. Assume that it is sufficient, since + # it is in the source tree, and the library has not been built yet + # but it would be included on the link line in the version check below + # hence making the test fail. + have_gmp=yes +fi # Specify a location for gmp + # Check whether --with-gmp-dir or --without-gmp-dir was given. if test "${with_gmp_dir+set}" = set; then withval="$with_gmp_dir" - : -fi + { { echo "$as_me:$LINENO: error: The --with-gmp-dir=PATH option has been removed. +Use --with-gmp=PATH or --with-gmp-include=PATH plus --with-gmp-lib=PATH" >&5 +echo "$as_me: error: The --with-gmp-dir=PATH option has been removed. +Use --with-gmp=PATH or --with-gmp-include=PATH plus --with-gmp-lib=PATH" >&2;} + { (exit 1); exit 1; }; } +fi; -if test "x$with_gmp_dir" != x; then - gmpinc="$gmpinc -I$with_gmp_dir" - if test -f "$with_gmp_dir/.libs/libgmp.a"; then - gmplibs="$gmplibs $with_gmp_dir/.libs/libgmp.a" - elif test -f "$with_gmp_dir/_libs/libgmp.a"; then - gmplibs="$gmplibs $with_gmp_dir/_libs/libgmp.a" - fi - # One of the later tests will catch the error if neither library is present. -else - gmplibs="$gmplibs -lgmp" -fi - # Check whether --with-gmp or --without-gmp was given. if test "${with_gmp+set}" = set; then withval="$with_gmp" - : -fi + +fi; + +# Check whether --with-gmp_include or --without-gmp_include was given. +if test "${with_gmp_include+set}" = set; then + withval="$with_gmp_include" + +fi; + +# Check whether --with-gmp_lib or --without-gmp_lib was given. +if test "${with_gmp_lib+set}" = set; then + withval="$with_gmp_lib" + +fi; if test "x$with_gmp" != x; then gmplibs="-L$with_gmp/lib $gmplibs" gmpinc="-I$with_gmp/include $gmpinc" fi +if test "x$with_gmp_include" != x; then + gmpinc="-I$with_gmp_include $gmpinc" +fi +if test "x$with_gmp_lib" != x; then + gmplibs="-L$with_gmp_lib $gmplibs" +fi +if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then + gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/.libs -L$$r/$(HOST_SUBDIR)/gmp/_libs '"$gmplibs" + gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp '"$gmpinc" + # Do not test the gmp version. Assume that it is sufficient, since + # it is in the source tree, and the library has not been built yet + # but it would be included on the link line in the version check below + # hence making the test fail. + have_gmp=yes +fi -saved_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS $gmpinc" -# Check GMP actually works -echo $ac_n "checking for correct version of gmp.h""... $ac_c" 1>&6 -echo "configure:2317: checking for correct version of gmp.h" >&5 -cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for correct version of gmp.h... $ECHO_C" >&6 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include "gmp.h" -int main() { +int +main () +{ -#if __GNU_MP_VERSION < 3 -choke me -#endif + #if __GNU_MP_VERSION < 4 || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR < 1) + choke me + #endif -; return 0; } -EOF -if { (eval echo configure:2330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - echo "$ac_t""yes" 1>&6 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - echo "$ac_t""no" 1>&6; have_gmp=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; have_gmp=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -if test x"$have_gmp" = xyes; then - echo $ac_n "checking for MPFR""... $ac_c" 1>&6 -echo "configure:2343: checking for MPFR" >&5 - - saved_LIBS="$LIBS" - LIBS="$LIBS $gmplibs" - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for correct version of mpfr.h... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -#include -int main() { -mpfr_t n; mpfr_init(n); -; return 0; } -EOF -if { (eval echo configure:2356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - echo "$ac_t""yes" 1>&6 + #include +int +main () +{ + + #if MPFR_VERSION < MPFR_VERSION_NUM(2,2,0) + choke me + #endif + mpfr_t n; + mpfr_t x; + int t; + mpfr_init (n); + mpfr_init (x); + mpfr_atan2 (n, n, x, GMP_RNDN); + mpfr_erfc (n, x, GMP_RNDN); + mpfr_subnormalize (x, t, GMP_RNDN); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include +int +main () +{ + + #if MPFR_VERSION < MPFR_VERSION_NUM(2,2,1) + choke me + #endif + mpfr_t n; mpfr_init(n); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - echo "$ac_t""no" 1>&6; have_gmp=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: buggy but acceptable" >&5 +echo "${ECHO_T}buggy but acceptable" >&6 fi -rm -f conftest* - LIBS="$saved_LIBS" +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; have_gmp=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$saved_LIBS" + fi CFLAGS="$saved_CFLAGS" + + if test x$have_gmp != xyes; then + { { echo "$as_me:$LINENO: error: Building GCC requires GMP 4.1+ and MPFR 2.2.1+. +Try the --with-gmp and/or --with-mpfr options to specify their locations. +Copies of these libraries' source code can be found at their respective +hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/. +See also http://gcc.gnu.org/install/prerequisites.html for additional info. +If you obtained GMP and/or MPFR from a vendor distribution package, make +sure that you have installed both the libraries and the header files. +They may be located in separate packages." >&5 +echo "$as_me: error: Building GCC requires GMP 4.1+ and MPFR 2.2.1+. +Try the --with-gmp and/or --with-mpfr options to specify their locations. +Copies of these libraries' source code can be found at their respective +hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/. +See also http://gcc.gnu.org/install/prerequisites.html for additional info. +If you obtained GMP and/or MPFR from a vendor distribution package, make +sure that you have installed both the libraries and the header files. +They may be located in separate packages." >&2;} + { (exit 1); exit 1; }; } + fi fi # Flags needed for both GMP and/or MPFR @@ -2371,8 +4608,7 @@ fi # By default, C is the only stage 1 language. -stage1_languages=c - +stage1_languages=,c, # Figure out what language subdirectories are present. # Look if the user specified --enable-languages="..."; if not, use @@ -2434,9 +4670,9 @@ if test -d ${srcdir}/gcc; then esac done - new_enable_languages=c + new_enable_languages=,c, missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ ` - potential_languages=c + potential_languages=,c, for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do case ${lang_frag} in @@ -2445,75 +4681,90 @@ if test -d ${srcdir}/gcc; then # an apparent bug in bash 1.12 on linux. ${srcdir}/gcc/[*]/config-lang.in) ;; *) - # From the config-lang.in, get $language, $target_libs, + # From the config-lang.in, get $language, $target_libs, # $lang_dirs, $boot_language, and $build_by_default language= target_libs= lang_dirs= - boot_language= - build_by_default= - need_gmp= + subdir_requires= + boot_language=no + build_by_default=yes . ${lang_frag} - potential_languages="${potential_languages},${language}" - # This is quite sensitive to the ordering of the case statement arms. - case ,${enable_languages},:${language}:${have_gnat}:${build_by_default} in - *::*:*) - echo "${lang_frag} doesn't set \$language." 1>&2 - exit 1 - ;; - *:ada:no:*) - # Ada was requested with no preexisting GNAT. Disable unconditionally. - add_this_lang=no - ;; - *,${language},*:*:*:*) + if test x${language} = x; then + echo "${lang_frag} doesn't set \$language." 1>&2 + exit 1 + fi + + case ,${enable_languages}, in + *,${language},*) # Language was explicitly selected; include it. add_this_lang=yes ;; - *,all,*:*:*:no) - # 'all' was selected, but this is not a default language - # so do not include it. - add_this_lang=no - ;; - *,all,*:*:*:*) - # 'all' was selected and this is a default language; include it. - add_this_lang=yes + *,all,*) + # 'all' was selected, select it if it is a default language + add_this_lang=${build_by_default} ;; *) add_this_lang=no ;; esac - # Disable languages that need GMP if it isn't available. - case ,${enable_languages},:${have_gmp}:${need_gmp} in - *,${language},*:no:yes) + # Disable languages that need other directories if these aren't available. + for i in $subdir_requires; do + test -f "$srcdir/gcc/$i/config-lang.in" && continue + case ,${enable_languages}, in + *,${language},*) + # Specifically requested language; tell them. + { { echo "$as_me:$LINENO: error: The gcc/$i directory contains parts of $language but is missing" >&5 +echo "$as_me: error: The gcc/$i directory contains parts of $language but is missing" >&2;} + { (exit 1); exit 1; }; } + ;; + *) + # Silently disable. + add_this_lang=unsupported + ;; + esac + done + + # Disable Ada if no preexisting GNAT is available. + case ,${enable_languages},:${language}:${have_gnat} in + *,${language},*:ada:no) # Specifically requested language; tell them. - { echo "configure: error: GMP with MPFR support is required to build $language" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: GNAT is required to build $language" >&5 +echo "$as_me: error: GNAT is required to build $language" >&2;} + { (exit 1); exit 1; }; } ;; - *:no:yes) + *:ada:no) # Silently disable. - add_this_lang=no + add_this_lang=unsupported ;; esac # Disable a language that is unsupported by the target. case " $unsupported_languages " in *" $language "*) - add_this_lang=no + add_this_lang=unsupported ;; esac case $add_this_lang in - no) + unsupported) # Remove language-dependent dirs. eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\" ;; - *) - new_enable_languages="$new_enable_languages,$language" + no) + # Remove language-dependent dirs; still show language as supported. + eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\" + potential_languages="${potential_languages}${language}," + ;; + yes) + new_enable_languages="${new_enable_languages}${language}," + potential_languages="${potential_languages}${language}," missing_languages=`echo "$missing_languages" | sed "s/,$language,/,/"` case ${boot_language} in yes) # Add to (comma-separated) list of stage 1 languages. - stage1_languages="${stage1_languages},${language}" + stage1_languages="${stage1_languages}${language}," ;; esac ;; @@ -2522,18 +4773,61 @@ if test -d ${srcdir}/gcc; then esac done - missing_languages=`echo "$missing_languages" | sed -e "s/^,//" -e "s/,$//"` - if test "x$missing_languages" != x; then - { echo "configure: error: -The following requested languages could not be built: ${missing_languages} -Recognised languages are: ${potential_languages}" 1>&2; exit 1; } - fi + # Check whether --enable-stage1-languages or --disable-stage1-languages was given. +if test "${enable_stage1_languages+set}" = set; then + enableval="$enable_stage1_languages" + case ,${enable_stage1_languages}, in + ,no,|,,) + # Set it to something that will have no effect in the loop below + enable_stage1_languages=c ;; + ,yes,) + enable_stage1_languages=`echo $new_enable_languages | \ + sed -e "s/^,//" -e "s/,$//" ` ;; + *,all,*) + enable_stage1_languages=`echo ,$enable_stage1_languages, | \ + sed -e "s/,all,/$new_enable_languages/" -e "s/^,//" -e "s/,$//" ` ;; + esac + # Add "good" languages from enable_stage1_languages to stage1_languages, + # while "bad" languages go in missing_languages. Leave no duplicates. + for i in `echo $enable_stage1_languages | sed 's/,/ /g' `; do + case $potential_languages in + *,$i,*) + case $stage1_languages in + *,$i,*) ;; + *) stage1_languages="$stage1_languages$i," ;; + esac ;; + *) + case $missing_languages in + *,$i,*) ;; + *) missing_languages="$missing_languages$i," ;; + esac ;; + esac + done +fi; + + # Remove leading/trailing commas that were added for simplicity + potential_languages=`echo "$potential_languages" | sed -e "s/^,//" -e "s/,$//"` + missing_languages=`echo "$missing_languages" | sed -e "s/^,//" -e "s/,$//"` + stage1_languages=`echo "$stage1_languages" | sed -e "s/^,//" -e "s/,$//"` + new_enable_languages=`echo "$new_enable_languages" | sed -e "s/^,//" -e "s/,$//"` + + if test "x$missing_languages" != x; then + { { echo "$as_me:$LINENO: error: +The following requested languages could not be built: ${missing_languages} +Supported languages are: ${potential_languages}" >&5 +echo "$as_me: error: +The following requested languages could not be built: ${missing_languages} +Supported languages are: ${potential_languages}" >&2;} + { (exit 1); exit 1; }; } + fi if test "x$new_enable_languages" != "x$enable_languages"; then echo The following languages will be built: ${new_enable_languages} + enable_languages="$new_enable_languages" fi - enable_languages="$new_enable_languages" - ac_configure_args=`echo " $ac_configure_args" | sed -e 's/ --enable-languages=[^ ]*//' -e 's/$/ --enable-languages='"$enable_languages"/ ` + + + ac_configure_args=`echo " $ac_configure_args" | sed -e "s/ '--enable-languages=[^ ]*'//g" -e "s/$/ '--enable-languages="$enable_languages"'/" ` fi # Handle --disable- generically. @@ -2544,6 +4838,32 @@ for dir in $configdirs $build_configdirs $target_configdirs ; do fi done +# Check for Boehm's garbage collector +# Check whether --enable-objc-gc or --disable-objc-gc was given. +if test "${enable_objc_gc+set}" = set; then + enableval="$enable_objc_gc" + case ,${enable_languages},:${enable_objc_gc}:${noconfigdirs} in + *,objc,*:*:yes:*target-boehm-gc*) + { { echo "$as_me:$LINENO: error: Boehm's garbage collector was requested yet not supported in this configuration" >&5 +echo "$as_me: error: Boehm's garbage collector was requested yet not supported in this configuration" >&2;} + { (exit 1); exit 1; }; } + ;; +esac +fi; + +# Make sure we only build Boehm's garbage collector if required. +case ,${enable_languages},:${enable_objc_gc} in + *,objc,*:yes) + # Keep target-boehm-gc if requested for Objective-C. + ;; + *) + # Otherwise remove target-boehm-gc depending on target-libjava. + if echo " ${noconfigdirs} " | grep "target-libjava" >/dev/null 2>&1; then + noconfigdirs="$noconfigdirs target-boehm-gc" + fi + ;; +esac + # Remove the entries in $skipdirs and $noconfigdirs from $configdirs, # $build_configdirs and $target_configdirs. # If we have the source for $noconfigdirs entries, add them to $notsupp. @@ -2585,10 +4905,14 @@ done # Sometimes the tools are distributed with libiberty but with no other # libraries. In that case, we don't want to build target-libiberty. +# Don't let libgcc imply libiberty either. if test -n "${target_configdirs}" ; then + libgcc= others= for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do - if test "$i" != "libiberty" ; then + if test "$i" = "libgcc"; then + libgcc=target-libgcc + elif test "$i" != "libiberty" ; then if test -r $srcdir/$i/configure ; then others=yes; break; @@ -2596,7 +4920,7 @@ if test -n "${target_configdirs}" ; then fi done if test -z "${others}" ; then - target_configdirs= + target_configdirs=$libgcc fi fi @@ -2606,7 +4930,7 @@ fi build_configdirs_all="$build_configdirs" build_configdirs= for i in ${build_configdirs_all} ; do - j=`echo $i | sed -e s/build-//g` + j=`echo $i | sed -e s/build-//g` if test -f ${srcdir}/$j/configure ; then build_configdirs="${build_configdirs} $i" fi @@ -2623,7 +4947,7 @@ done target_configdirs_all="$target_configdirs" target_configdirs= for i in ${target_configdirs_all} ; do - j=`echo $i | sed -e s/target-//g` + j=`echo $i | sed -e s/target-//g` if test -f ${srcdir}/$j/configure ; then target_configdirs="${target_configdirs} $i" fi @@ -2669,8 +4993,57 @@ case "$host" in enable_gdbtk=no ;; esac +# To find our prefix, in gcc_cv_tool_prefix. + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + +if test "x$exec_prefix" = xNONE; then + if test "x$prefix" = xNONE; then + gcc_cv_tool_prefix=$ac_default_prefix + else + gcc_cv_tool_prefix=$prefix + fi +else + gcc_cv_tool_prefix=$exec_prefix +fi + +# If there is no compiler in the tree, use the PATH only. In any +# case, if there is no compiler in the tree nobody should use +# AS_FOR_TARGET and LD_FOR_TARGET. +if test x$host = x$build && test -f $srcdir/gcc/BASE-VER; then + gcc_version=`cat $srcdir/gcc/BASE-VER` + gcc_cv_tool_dirs="$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR" + gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical$PATH_SEPARATOR" + gcc_cv_tool_dirs="$gcc_cv_tool_dirs/usr/lib/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR" + gcc_cv_tool_dirs="$gcc_cv_tool_dirs/usr/lib/gcc/$target_noncanonical$PATH_SEPARATOR" + gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version$PATH_SEPARATOR" + gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/$target_noncanonical/bin$PATH_SEPARATOR" +else + gcc_cv_tool_dirs= +fi + +if test x$build = x$target && test -n "$md_exec_prefix"; then + gcc_cv_tool_dirs="$gcc_cv_tool_dirs$md_exec_prefix$PATH_SEPARATOR" +fi + + + copy_dirs= + # Check whether --with-build-sysroot or --without-build-sysroot was given. if test "${with_build_sysroot+set}" = set; then withval="$with_build_sysroot" @@ -2679,8 +5052,7 @@ if test "${with_build_sysroot+set}" = set; then fi else SYSROOT_CFLAGS_FOR_TARGET= -fi - +fi; # Handle --with-headers=XXX. If the value is not "yes", the contents of @@ -2691,11 +5063,8 @@ if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then exit 1 fi if test x"${with_headers}" != xyes ; then - case "${exec_prefixoption}" in - "") x=${prefix} ;; - *) x=${exec_prefix} ;; - esac - copy_dirs="${copy_dirs} ${with_headers} $x/${target_alias}/sys-include" + x=${gcc_cv_tool_prefix} + copy_dirs="${copy_dirs} ${with_headers} $x/${target_noncanonical}/sys-include" fi fi @@ -2710,12 +5079,9 @@ if test x"${with_libs}" != x && test x"${with_libs}" != xno ; then if test x"${with_libs}" != xyes ; then # Copy the libraries in reverse order, so that files in the first named # library override files in subsequent libraries. - case "${exec_prefixoption}" in - "") x=${prefix} ;; - *) x=${exec_prefix} ;; - esac + x=${gcc_cv_tool_prefix} for l in ${with_libs}; do - copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}" + copy_dirs="$l $x/${target_noncanonical}/lib ${copy_dirs}" done fi fi @@ -2725,11 +5091,11 @@ fi # This is done by determining whether or not the appropriate directory # is available, and by checking whether or not specific configurations # have requested that this magic not happen. -# -# The command line options always override the explicit settings in +# +# The command line options always override the explicit settings in # configure.in, and the settings in configure.in override this magic. # -# If the default for a toolchain is to use GNU as and ld, and you don't +# If the default for a toolchain is to use GNU as and ld, and you don't # want to do that, then you should use the --without-gnu-as and # --without-gnu-ld options for the configure script. @@ -2838,6 +5204,12 @@ extra_nmflags_for_target= extra_ranlibflags_for_target= target_makefile_frag=/dev/null case "${target}" in + mep*-*-*) + target_makefile_frag="config/mt-mep" + ;; + spu-*-*) + target_makefile_frag="config/mt-spu" + ;; *-*-netware*) target_makefile_frag="config/mt-netware" ;; @@ -2845,7 +5217,7 @@ case "${target}" in target_makefile_frag="config/mt-gnu" ;; *-*-aix4.[3456789]* | *-*-aix[56789].*) - # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm + # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm # commands to handle both 32-bit and 64-bit objects. These flags are # harmless if we're using GNU nm or ar. extra_arflags_for_target=" -X32_64" @@ -2905,14 +5277,14 @@ fi # hpux11 in 64bit mode has libraries in a weird place. Arrange to find # them automatically. case "${host}" in - hppa*64*-*-hpux11*) + hppa*64*-*-hpux11*) extra_host_args="$extra_host_args -x-libraries=/usr/lib/pa20_64 -x-includes=/usr/X11R6/include" ;; esac # Some systems (e.g., one of the i386-aix systems the gas testers are # using) don't handle "\$" correctly, so don't use it here. -tooldir='${exec_prefix}'/${target_alias} +tooldir='${exec_prefix}'/${target_noncanonical} build_tooldir=${tooldir} # Create a .gdbinit file which runs the one in srcdir @@ -2942,7 +5314,7 @@ if test $? = 0 ; then if test -s conftest || test -s conftest.exe ; then we_are_ok=yes fi -fi +fi case $we_are_ok in no) echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed." @@ -3036,11 +5408,10 @@ INSTALL_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-install-/g` # Check whether --enable-bootstrap or --disable-bootstrap was given. if test "${enable_bootstrap+set}" = set; then enableval="$enable_bootstrap" - : + else enable_bootstrap=default -fi - +fi; # Issue errors and warnings for invalid/strange bootstrap combinations. case "$configdirs" in @@ -3066,16 +5437,21 @@ case "$have_compiler:$host:$target:$enable_bootstrap" in # Other configurations, but we have a compiler. Assume the user knows # what he's doing. yes:*:*:yes) - echo "configure: warning: trying to bootstrap a cross compiler" 1>&2 + { echo "$as_me:$LINENO: WARNING: trying to bootstrap a cross compiler" >&5 +echo "$as_me: WARNING: trying to bootstrap a cross compiler" >&2;} ;; # No compiler: if they passed --enable-bootstrap explicitly, fail no:*:*:yes) - { echo "configure: error: cannot bootstrap without a compiler" 1>&2; exit 1; } ;; + { { echo "$as_me:$LINENO: error: cannot bootstrap without a compiler" >&5 +echo "$as_me: error: cannot bootstrap without a compiler" >&2;} + { (exit 1); exit 1; }; } ;; # Fail if wrong command line *) - { echo "configure: error: invalid option for --enable-bootstrap" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: invalid option for --enable-bootstrap" >&5 +echo "$as_me: error: invalid option for --enable-bootstrap" >&2;} + { (exit 1); exit 1; }; } ;; esac @@ -3101,7 +5477,7 @@ for module in ${build_configdirs} ; do done for module in ${configdirs} ; do if test -z "${no_recursion}"; then - for file in stage*-${module}/Makefile ${module}/Makefile; do + for file in stage*-${module}/Makefile prev-${module}/Makefile ${module}/Makefile; do if test -f ${file}; then echo 1>&2 "*** removing ${file} to force reconfigure" rm -f ${file} @@ -3135,9 +5511,8 @@ extrasub="$extrasub # Check whether --enable-serial-configure or --disable-serial-configure was given. if test "${enable_serial_configure+set}" = set; then enableval="$enable_serial_configure" - : -fi +fi; case ${enable_serial_configure} in yes) @@ -3182,46 +5557,93 @@ serialization_dependencies=serdep.tmp # Base args. Strip norecursion, cache-file, srcdir, host, build, -# target and nonopt. These are the ones we might not want to pass -# down to subconfigures. Also strip program-prefix, program-suffix, -# and program-transform-name, so that we can pass down a consistent -# program-transform-name. If autoconf has put single quotes around -# any of these arguments (because they contain shell metacharacters) -# then this will fail; in practice this only happens for -# --program-transform-name, so be sure to override --program-transform-name -# at the end of the argument list. -# These will be expanded by make, so quote '$'. -cat <<\EOF_SED > conftestsed -s/ --no[^ ]*/ /g -s/ --c[a-z-]*[= ][^ ]*//g -s/ --sr[a-z-]*[= ][^ ]*//g -s/ --ho[a-z-]*[= ][^ ]*//g -s/ --bu[a-z-]*[= ][^ ]*//g -s/ --t[a-z-]*[= ][^ ]*//g -s/ --program-[pst][a-z-]*[= ][^ ]*//g -s/ -cache-file[= ][^ ]*//g -s/ -srcdir[= ][^ ]*//g -s/ -host[= ][^ ]*//g -s/ -build[= ][^ ]*//g -s/ -target[= ][^ ]*//g -s/ -program-prefix[= ][^ ]*//g -s/ -program-suffix[= ][^ ]*//g -s/ -program-transform-name[= ][^ ]*//g -s/ [^' -][^ ]* / / -s/^ *//;s/ *$// -s,\$,$$,g -EOF_SED -sed -f conftestsed < conftestsed.out - ${ac_configure_args} -EOF_SED -baseargs=`cat conftestsed.out` -rm -f conftestsed conftestsed.out +# target, nonopt, and variable assignments. These are the ones we +# might not want to pass down to subconfigures. Also strip +# program-prefix, program-suffix, and program-transform-name, so that +# we can pass down a consistent program-transform-name. +baseargs= +keep_next=no +skip_next=no +eval "set -- $ac_configure_args" +for ac_arg +do + if test X"$skip_next" = X"yes"; then + skip_next=no + continue + fi + if test X"$keep_next" = X"yes"; then + case $ac_arg in + *\'*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + baseargs="$baseargs '$ac_arg'" + keep_next=no + continue + fi + + # Handle separated arguments. Based on the logic generated by + # autoconf 2.59. + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + separate_arg=no + ;; + -*) + separate_arg=yes + ;; + *) + separate_arg=no + ;; + esac + + case "$ac_arg" in + --no*) + continue + ;; + --c* | \ + --sr* | \ + --ho* | \ + --bu* | \ + --t* | \ + --program-* | \ + -cache_file* | \ + -srcdir* | \ + -host* | \ + -build* | \ + -target* | \ + -program-prefix* | \ + -program-suffix* | \ + -program-transform-name* ) + skip_next=$separate_arg + continue + ;; + -*) + # An option. Add it. + case $ac_arg in + *\'*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + baseargs="$baseargs '$ac_arg'" + keep_next=$separate_arg + ;; + *) + # Either a variable assignment, or a nonopt (triplet). Don't + # pass it down; let the Makefile handle this. + continue + ;; + esac +done +# Remove the initial space we just introduced and, as these will be +# expanded by make, quote '$'. +baseargs=`echo "x$baseargs" | sed -e 's/^x *//' -e 's,\\$,$$,g'` # Add in --program-transform-name, after --program-prefix and # --program-suffix have been applied to it. Autoconf has already # doubled dollar signs and backslashes in program_transform_name; we want # the backslashes un-doubled, and then the entire thing wrapped in single -# quotes, because this will be expanded first by make and then by the shell. +# quotes, because this will be expanded first by make and then by the shell. # Also, because we want to override the logic in subdir configure scripts to # choose program_transform_name, replace any s,x,x, with s,y,y,. sed -e "s,\\\\\\\\,\\\\,g; s,','\\\\'',g; s/s,x,x,/s,y,y,/" < conftestsed.out @@ -3234,7 +5656,7 @@ baseargs="$baseargs --program-transform-name='${gcc_transform_name}'" # For the build-side libraries, we just need to pretend we're native, # and not use the same cache file. Multilibs are neither needed nor # desired. -build_configargs="--cache-file=../config.cache --build=${build_alias} --host=${build_alias} --target=${target_alias} ${baseargs}" +build_configargs="--cache-file=../config.cache ${baseargs}" # For host modules, accept cache file option, or specification as blank. case "${cache_file}" in @@ -3248,7 +5670,7 @@ esac # Host dirs don't like to share a cache file either, horribly enough. # This seems to be due to autoconf 2.5x stupidity. -host_configargs="--cache-file=./config.cache --build=${build_alias} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}" +host_configargs="--cache-file=./config.cache ${extra_host_args} ${baseargs}" target_configargs=${baseargs} @@ -3258,7 +5680,7 @@ target_configargs=${baseargs} # sorts of decisions they want to make on this basis. Please consider # this option to be deprecated. FIXME. if test x${is_cross_compiler} = xyes ; then - target_configargs="--with-cross-host=${host_alias} ${target_configargs}" + target_configargs="--with-cross-host=${host_noncanonical} ${target_configargs}" fi # Default to --enable-multilib. @@ -3284,7 +5706,7 @@ fi # Pass the appropriate --build, --host, --target and --cache-file arguments. # We need to pass --target, as newer autoconf's requires consistency # for target_alias and gcc doesn't manage it consistently. -target_configargs="--cache-file=./config.cache --build=${build_alias} --host=${target_alias} --target=${target_alias} ${target_configargs}" +target_configargs="--cache-file=./config.cache ${target_configargs}" FLAGS_FOR_TARGET= case " $target_configdirs " in @@ -3336,6 +5758,11 @@ case " $target_configdirs " in esac ;; esac +case "$target" in +*-mingw*) + # Can't be handled as Cygwin above since Mingw does not use newlib. + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/mingw -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/mingw/include -isystem $$s/winsup/w32api/include' ;; +esac # Allow the user to override the flags for # our build compiler if desired. @@ -3356,6 +5783,23 @@ if test "x${use_gnu_ld}" = x && FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(HOST_SUBDIR)/ld' fi +# Search for other target-specific linker scripts and such. +case "${target}" in + m32c-*-* ) + if test -d ${srcdir}/libgloss/m32c; then + # This is for crt0.o + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/libgloss/m32c' + # This is for r8c.ld + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/libgloss/m32c' + # This is for libnosys.a + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/libgloss/libnosys' + fi + ;; + mep*) + FLAGS_FOR_TARGET="$FLAGS_FOR_TARGET -mlibrary" + ;; +esac + # Makefile fragments. for frag in host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag; do @@ -3400,36 +5844,42 @@ MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing for ac_prog in 'bison -y' byacc yacc do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3407: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_YACC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_YACC="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_YACC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -YACC="$ac_cv_prog_YACC" +YACC=$ac_cv_prog_YACC if test -n "$YACC"; then - echo "$ac_t""$YACC" 1>&6 + echo "$as_me:$LINENO: result: $YACC" >&5 +echo "${ECHO_T}$YACC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$YACC" && break + test -n "$YACC" && break done test -n "$YACC" || YACC="$MISSING bison -y" @@ -3440,36 +5890,42 @@ esac for ac_prog in bison do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3447: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_BISON+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$BISON"; then ac_cv_prog_BISON="$BISON" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_BISON="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_BISON="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -BISON="$ac_cv_prog_BISON" +BISON=$ac_cv_prog_BISON if test -n "$BISON"; then - echo "$ac_t""$BISON" 1>&6 + echo "$as_me:$LINENO: result: $BISON" >&5 +echo "${ECHO_T}$BISON" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$BISON" && break + test -n "$BISON" && break done test -n "$BISON" || BISON="$MISSING bison" @@ -3479,36 +5935,42 @@ esac for ac_prog in gm4 gnum4 m4 do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3486: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_M4'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_M4+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$M4"; then ac_cv_prog_M4="$M4" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_M4="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_M4="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -M4="$ac_cv_prog_M4" +M4=$ac_cv_prog_M4 if test -n "$M4"; then - echo "$ac_t""$M4" 1>&6 + echo "$as_me:$LINENO: result: $M4" >&5 +echo "${ECHO_T}$M4" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$M4" && break + test -n "$M4" && break done test -n "$M4" || M4="$MISSING m4" @@ -3518,36 +5980,42 @@ esac for ac_prog in flex lex do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3525: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LEX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LEX="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LEX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -LEX="$ac_cv_prog_LEX" +LEX=$ac_cv_prog_LEX if test -n "$LEX"; then - echo "$ac_t""$LEX" 1>&6 + echo "$as_me:$LINENO: result: $LEX" >&5 +echo "${ECHO_T}$LEX" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$LEX" && break + test -n "$LEX" && break done test -n "$LEX" || LEX="$MISSING flex" @@ -3558,36 +6026,42 @@ esac for ac_prog in flex do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3565: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_FLEX'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_FLEX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$FLEX"; then ac_cv_prog_FLEX="$FLEX" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_FLEX="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_FLEX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -FLEX="$ac_cv_prog_FLEX" +FLEX=$ac_cv_prog_FLEX if test -n "$FLEX"; then - echo "$ac_t""$FLEX" 1>&6 + echo "$as_me:$LINENO: result: $FLEX" >&5 +echo "${ECHO_T}$FLEX" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$FLEX" && break + test -n "$FLEX" && break done test -n "$FLEX" || FLEX="$MISSING flex" @@ -3597,36 +6071,42 @@ esac for ac_prog in makeinfo do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3604: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_MAKEINFO+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MAKEINFO"; then ac_cv_prog_MAKEINFO="$MAKEINFO" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_MAKEINFO="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MAKEINFO="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -MAKEINFO="$ac_cv_prog_MAKEINFO" +MAKEINFO=$ac_cv_prog_MAKEINFO if test -n "$MAKEINFO"; then - echo "$ac_t""$MAKEINFO" 1>&6 + echo "$as_me:$LINENO: result: $MAKEINFO" >&5 +echo "${ECHO_T}$MAKEINFO" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$MAKEINFO" && break + test -n "$MAKEINFO" && break done test -n "$MAKEINFO" || MAKEINFO="$MISSING makeinfo" @@ -3650,36 +6130,42 @@ esac for ac_prog in expect do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3657: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_EXPECT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_EXPECT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$EXPECT"; then ac_cv_prog_EXPECT="$EXPECT" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_EXPECT="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_EXPECT="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -EXPECT="$ac_cv_prog_EXPECT" +EXPECT=$ac_cv_prog_EXPECT if test -n "$EXPECT"; then - echo "$ac_t""$EXPECT" 1>&6 + echo "$as_me:$LINENO: result: $EXPECT" >&5 +echo "${ECHO_T}$EXPECT" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$EXPECT" && break + test -n "$EXPECT" && break done test -n "$EXPECT" || EXPECT="expect" @@ -3691,42 +6177,48 @@ esac for ac_prog in runtest do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3698: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RUNTEST'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RUNTEST+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RUNTEST"; then ac_cv_prog_RUNTEST="$RUNTEST" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RUNTEST="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RUNTEST="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -RUNTEST="$ac_cv_prog_RUNTEST" +RUNTEST=$ac_cv_prog_RUNTEST if test -n "$RUNTEST"; then - echo "$ac_t""$RUNTEST" 1>&6 + echo "$as_me:$LINENO: result: $RUNTEST" >&5 +echo "${ECHO_T}$RUNTEST" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$RUNTEST" && break + test -n "$RUNTEST" && break done test -n "$RUNTEST" || RUNTEST="runtest" case " $configdirs " in *" dejagnu "*) - test $host = $build && RUNTEST='$$r/$(HOST_SUBDIR)/dejagnu/runtest' + test $host = $build && RUNTEST='$$s/$(HOST_SUBDIR)/dejagnu/runtest' ;; esac @@ -3737,68 +6229,128 @@ test -n "$host_alias" && ncn_tool_prefix=$host_alias- ncn_target_tool_prefix= test -n "$target_alias" && ncn_target_tool_prefix=$target_alias- - for ncn_progname in ar; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3746: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$AR"; then + ac_cv_prog_AR=$AR +elif test -n "$ac_cv_prog_AR"; then + AR=$ac_cv_prog_AR +fi + +if test -n "$ac_cv_prog_AR"; then + for ncn_progname in ar; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AR="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -AR="$ac_cv_prog_AR" +AR=$ac_cv_prog_AR if test -n "$AR"; then - echo "$ac_t""$AR" 1>&6 + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in ar; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ncn_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AR" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3777: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AR="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -AR="$ac_cv_prog_AR" +AR=$ac_cv_prog_AR if test -n "$AR"; then - echo "$ac_t""$AR" 1>&6 + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_AR" && break done @@ -3812,68 +6364,128 @@ if test -z "$ac_cv_prog_AR" ; then fi fi - for ncn_progname in as; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3821: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$AS"; then + ac_cv_prog_AS=$AS +elif test -n "$ac_cv_prog_AS"; then + AS=$ac_cv_prog_AS +fi + +if test -n "$ac_cv_prog_AS"; then + for ncn_progname in as; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AS="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -AS="$ac_cv_prog_AS" +AS=$ac_cv_prog_AS if test -n "$AS"; then - echo "$ac_t""$AS" 1>&6 + echo "$as_me:$LINENO: result: $AS" >&5 +echo "${ECHO_T}$AS" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in as; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="${ncn_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + echo "$as_me:$LINENO: result: $AS" >&5 +echo "${ECHO_T}$AS" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AS" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3852: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AS="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -AS="$ac_cv_prog_AS" +AS=$ac_cv_prog_AS if test -n "$AS"; then - echo "$ac_t""$AS" 1>&6 + echo "$as_me:$LINENO: result: $AS" >&5 +echo "${ECHO_T}$AS" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_AS" && break done @@ -3887,68 +6499,128 @@ if test -z "$ac_cv_prog_AS" ; then fi fi - for ncn_progname in dlltool; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3896: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL=$DLLTOOL +elif test -n "$ac_cv_prog_DLLTOOL"; then + DLLTOOL=$ac_cv_prog_DLLTOOL +fi + +if test -n "$ac_cv_prog_DLLTOOL"; then + for ncn_progname in dlltool; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_DLLTOOL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_DLLTOOL="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -DLLTOOL="$ac_cv_prog_DLLTOOL" +DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then - echo "$ac_t""$DLLTOOL" 1>&6 + echo "$as_me:$LINENO: result: $DLLTOOL" >&5 +echo "${ECHO_T}$DLLTOOL" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in dlltool; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_DLLTOOL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ncn_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + echo "$as_me:$LINENO: result: $DLLTOOL" >&5 +echo "${ECHO_T}$DLLTOOL" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_DLLTOOL" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3927: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_DLLTOOL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_DLLTOOL="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -DLLTOOL="$ac_cv_prog_DLLTOOL" +DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then - echo "$ac_t""$DLLTOOL" 1>&6 + echo "$as_me:$LINENO: result: $DLLTOOL" >&5 +echo "${ECHO_T}$DLLTOOL" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_DLLTOOL" && break done @@ -3962,68 +6634,128 @@ if test -z "$ac_cv_prog_DLLTOOL" ; then fi fi - for ncn_progname in ld; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3971: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$LD"; then + ac_cv_prog_LD=$LD +elif test -n "$ac_cv_prog_LD"; then + LD=$ac_cv_prog_LD +fi + +if test -n "$ac_cv_prog_LD"; then + for ncn_progname in ld; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LD"; then ac_cv_prog_LD="$LD" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LD="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LD="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -LD="$ac_cv_prog_LD" +LD=$ac_cv_prog_LD if test -n "$LD"; then - echo "$ac_t""$LD" 1>&6 + echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in ld; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$LD"; then + ac_cv_prog_LD="$LD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LD="${ncn_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +LD=$ac_cv_prog_LD +if test -n "$LD"; then + echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_LD" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4002: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LD"; then ac_cv_prog_LD="$LD" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LD="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LD="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -LD="$ac_cv_prog_LD" +LD=$ac_cv_prog_LD if test -n "$LD"; then - echo "$ac_t""$LD" 1>&6 + echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_LD" && break done @@ -4037,68 +6769,128 @@ if test -z "$ac_cv_prog_LD" ; then fi fi - for ncn_progname in lipo; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4046: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LIPO'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$LIPO"; then + ac_cv_prog_LIPO=$LIPO +elif test -n "$ac_cv_prog_LIPO"; then + LIPO=$ac_cv_prog_LIPO +fi + +if test -n "$ac_cv_prog_LIPO"; then + for ncn_progname in lipo; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LIPO+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LIPO="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -LIPO="$ac_cv_prog_LIPO" +LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then - echo "$ac_t""$LIPO" 1>&6 + echo "$as_me:$LINENO: result: $LIPO" >&5 +echo "${ECHO_T}$LIPO" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in lipo; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LIPO+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ncn_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + echo "$as_me:$LINENO: result: $LIPO" >&5 +echo "${ECHO_T}$LIPO" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_LIPO" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4077: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LIPO'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LIPO+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LIPO="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -LIPO="$ac_cv_prog_LIPO" +LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then - echo "$ac_t""$LIPO" 1>&6 + echo "$as_me:$LINENO: result: $LIPO" >&5 +echo "${ECHO_T}$LIPO" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_LIPO" && break done @@ -4112,68 +6904,128 @@ if test -z "$ac_cv_prog_LIPO" ; then fi fi - for ncn_progname in nm; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4121: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$NM"; then + ac_cv_prog_NM=$NM +elif test -n "$ac_cv_prog_NM"; then + NM=$ac_cv_prog_NM +fi + +if test -n "$ac_cv_prog_NM"; then + for ncn_progname in nm; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then ac_cv_prog_NM="$NM" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_NM="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NM="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -NM="$ac_cv_prog_NM" +NM=$ac_cv_prog_NM if test -n "$NM"; then - echo "$ac_t""$NM" 1>&6 + echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in nm; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM"; then + ac_cv_prog_NM="$NM" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NM="${ncn_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +NM=$ac_cv_prog_NM +if test -n "$NM"; then + echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_NM" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4152: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then ac_cv_prog_NM="$NM" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_NM="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NM="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -NM="$ac_cv_prog_NM" +NM=$ac_cv_prog_NM if test -n "$NM"; then - echo "$ac_t""$NM" 1>&6 + echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_NM" && break done @@ -4187,68 +7039,128 @@ if test -z "$ac_cv_prog_NM" ; then fi fi - for ncn_progname in ranlib; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4196: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$RANLIB"; then + ac_cv_prog_RANLIB=$RANLIB +elif test -n "$ac_cv_prog_RANLIB"; then + RANLIB=$ac_cv_prog_RANLIB +fi + +if test -n "$ac_cv_prog_RANLIB"; then + for ncn_progname in ranlib; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -RANLIB="$ac_cv_prog_RANLIB" +RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in ranlib; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ncn_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4227: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -RANLIB="$ac_cv_prog_RANLIB" +RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_RANLIB" && break done @@ -4257,68 +7169,128 @@ if test -z "$ac_cv_prog_RANLIB" ; then RANLIB=":" fi - for ncn_progname in strip; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4266: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$STRIP"; then + ac_cv_prog_STRIP=$STRIP +elif test -n "$ac_cv_prog_STRIP"; then + STRIP=$ac_cv_prog_STRIP +fi + +if test -n "$ac_cv_prog_STRIP"; then + for ncn_progname in strip; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_STRIP="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -STRIP="$ac_cv_prog_STRIP" +STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - echo "$ac_t""$STRIP" 1>&6 + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in strip; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ncn_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4297: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_STRIP="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -STRIP="$ac_cv_prog_STRIP" +STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - echo "$ac_t""$STRIP" 1>&6 + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_STRIP" && break done @@ -4327,68 +7299,128 @@ if test -z "$ac_cv_prog_STRIP" ; then STRIP=":" fi - for ncn_progname in windres; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4336: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$WINDRES"; then + ac_cv_prog_WINDRES=$WINDRES +elif test -n "$ac_cv_prog_WINDRES"; then + WINDRES=$ac_cv_prog_WINDRES +fi + +if test -n "$ac_cv_prog_WINDRES"; then + for ncn_progname in windres; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_WINDRES+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$WINDRES"; then ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_WINDRES="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_WINDRES="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -WINDRES="$ac_cv_prog_WINDRES" +WINDRES=$ac_cv_prog_WINDRES if test -n "$WINDRES"; then - echo "$ac_t""$WINDRES" 1>&6 + echo "$as_me:$LINENO: result: $WINDRES" >&5 +echo "${ECHO_T}$WINDRES" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in windres; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_WINDRES+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$WINDRES"; then + ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_WINDRES="${ncn_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +WINDRES=$ac_cv_prog_WINDRES +if test -n "$WINDRES"; then + echo "$as_me:$LINENO: result: $WINDRES" >&5 +echo "${ECHO_T}$WINDRES" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_WINDRES" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4367: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_WINDRES+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$WINDRES"; then ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_WINDRES="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_WINDRES="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -WINDRES="$ac_cv_prog_WINDRES" +WINDRES=$ac_cv_prog_WINDRES if test -n "$WINDRES"; then - echo "$ac_t""$WINDRES" 1>&6 + echo "$as_me:$LINENO: result: $WINDRES" >&5 +echo "${ECHO_T}$WINDRES" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_WINDRES" && break done @@ -4402,68 +7434,128 @@ if test -z "$ac_cv_prog_WINDRES" ; then fi fi - for ncn_progname in objcopy; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4411: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$OBJCOPY"; then + ac_cv_prog_OBJCOPY=$OBJCOPY +elif test -n "$ac_cv_prog_OBJCOPY"; then + OBJCOPY=$ac_cv_prog_OBJCOPY +fi + +if test -n "$ac_cv_prog_OBJCOPY"; then + for ncn_progname in objcopy; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_OBJCOPY+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OBJCOPY"; then ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_OBJCOPY="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJCOPY="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -OBJCOPY="$ac_cv_prog_OBJCOPY" +OBJCOPY=$ac_cv_prog_OBJCOPY if test -n "$OBJCOPY"; then - echo "$ac_t""$OBJCOPY" 1>&6 + echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +echo "${ECHO_T}$OBJCOPY" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in objcopy; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_OBJCOPY+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$OBJCOPY"; then + ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJCOPY="${ncn_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +OBJCOPY=$ac_cv_prog_OBJCOPY +if test -n "$OBJCOPY"; then + echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +echo "${ECHO_T}$OBJCOPY" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_OBJCOPY" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4442: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_OBJCOPY+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OBJCOPY"; then ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_OBJCOPY="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJCOPY="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -OBJCOPY="$ac_cv_prog_OBJCOPY" +OBJCOPY=$ac_cv_prog_OBJCOPY if test -n "$OBJCOPY"; then - echo "$ac_t""$OBJCOPY" 1>&6 + echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +echo "${ECHO_T}$OBJCOPY" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_OBJCOPY" && break done @@ -4477,68 +7569,128 @@ if test -z "$ac_cv_prog_OBJCOPY" ; then fi fi - for ncn_progname in objdump; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4486: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP=$OBJDUMP +elif test -n "$ac_cv_prog_OBJDUMP"; then + OBJDUMP=$ac_cv_prog_OBJDUMP +fi + +if test -n "$ac_cv_prog_OBJDUMP"; then + for ncn_progname in objdump; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_OBJDUMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_OBJDUMP="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -OBJDUMP="$ac_cv_prog_OBJDUMP" +OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then - echo "$ac_t""$OBJDUMP" 1>&6 + echo "$as_me:$LINENO: result: $OBJDUMP" >&5 +echo "${ECHO_T}$OBJDUMP" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in objdump; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_OBJDUMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ncn_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + echo "$as_me:$LINENO: result: $OBJDUMP" >&5 +echo "${ECHO_T}$OBJDUMP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_OBJDUMP" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4517: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_OBJDUMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_OBJDUMP="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -OBJDUMP="$ac_cv_prog_OBJDUMP" +OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then - echo "$ac_t""$OBJDUMP" 1>&6 + echo "$as_me:$LINENO: result: $OBJDUMP" >&5 +echo "${ECHO_T}$OBJDUMP" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_OBJDUMP" && break done @@ -4559,6 +7711,7 @@ fi # Target tools. + # Check whether --with-build-time-tools or --without-build-time-tools was given. if test "${with_build_time_tools+set}" = set; then withval="$with_build_time_tools" @@ -4566,24 +7719,74 @@ if test "${with_build_time_tools+set}" = set; then x/*) ;; *) with_build_time_tools= - echo "configure: warning: argument to --with-build-time-tools must be an absolute path" 1>&2 + { echo "$as_me:$LINENO: WARNING: argument to --with-build-time-tools must be an absolute path" >&5 +echo "$as_me: WARNING: argument to --with-build-time-tools must be an absolute path" >&2;} ;; esac else with_build_time_tools= +fi; + + + +if test -n "$CC_FOR_TARGET"; then + ac_cv_prog_CC_FOR_TARGET=$CC_FOR_TARGET +elif test -n "$ac_cv_prog_CC_FOR_TARGET"; then + CC_FOR_TARGET=$ac_cv_prog_CC_FOR_TARGET fi - - if test -n "$with_build_time_tools"; then +if test -n "$ac_cv_prog_CC_FOR_TARGET"; then for ncn_progname in cc gcc; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:4581: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC_FOR_TARGET"; then + ac_cv_prog_CC_FOR_TARGET="$CC_FOR_TARGET" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC_FOR_TARGET=$ac_cv_prog_CC_FOR_TARGET +if test -n "$CC_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $CC_FOR_TARGET" >&5 +echo "${ECHO_T}$CC_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_CC_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in cc gcc; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_CC_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -4593,69 +7796,81 @@ if test -z "$ac_cv_prog_CC_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4598: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC_FOR_TARGET"; then ac_cv_prog_CC_FOR_TARGET="$CC_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC_FOR_TARGET="$ac_cv_prog_CC_FOR_TARGET" +CC_FOR_TARGET=$ac_cv_prog_CC_FOR_TARGET if test -n "$CC_FOR_TARGET"; then - echo "$ac_t""$CC_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $CC_FOR_TARGET" >&5 +echo "${ECHO_T}$CC_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4629: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC_FOR_TARGET"; then ac_cv_prog_CC_FOR_TARGET="$CC_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC_FOR_TARGET="$ac_cv_prog_CC_FOR_TARGET" +CC_FOR_TARGET=$ac_cv_prog_CC_FOR_TARGET if test -n "$CC_FOR_TARGET"; then - echo "$ac_t""$CC_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $CC_FOR_TARGET" >&5 +echo "${ECHO_T}$CC_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_CC_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_CC_FOR_TARGET" ; then set dummy cc gcc if test $build = $target ; then @@ -4663,18 +7878,70 @@ if test -z "$ac_cv_prog_CC_FOR_TARGET" ; then else CC_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + CC_FOR_TARGET="$ac_cv_prog_CC_FOR_TARGET" fi - if test -n "$with_build_time_tools"; then + + +if test -n "$CXX_FOR_TARGET"; then + ac_cv_prog_CXX_FOR_TARGET=$CXX_FOR_TARGET +elif test -n "$ac_cv_prog_CXX_FOR_TARGET"; then + CXX_FOR_TARGET=$ac_cv_prog_CXX_FOR_TARGET +fi + +if test -n "$ac_cv_prog_CXX_FOR_TARGET"; then for ncn_progname in c++ g++ cxx gxx; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:4672: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX_FOR_TARGET"; then + ac_cv_prog_CXX_FOR_TARGET="$CXX_FOR_TARGET" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CXX_FOR_TARGET=$ac_cv_prog_CXX_FOR_TARGET +if test -n "$CXX_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $CXX_FOR_TARGET" >&5 +echo "${ECHO_T}$CXX_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_CXX_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in c++ g++ cxx gxx; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_CXX_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -4684,69 +7951,81 @@ if test -z "$ac_cv_prog_CXX_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4689: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CXX_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX_FOR_TARGET"; then ac_cv_prog_CXX_FOR_TARGET="$CXX_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CXX_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CXX_FOR_TARGET="$ac_cv_prog_CXX_FOR_TARGET" +CXX_FOR_TARGET=$ac_cv_prog_CXX_FOR_TARGET if test -n "$CXX_FOR_TARGET"; then - echo "$ac_t""$CXX_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $CXX_FOR_TARGET" >&5 +echo "${ECHO_T}$CXX_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CXX_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4720: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CXX_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX_FOR_TARGET"; then ac_cv_prog_CXX_FOR_TARGET="$CXX_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CXX_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CXX_FOR_TARGET="$ac_cv_prog_CXX_FOR_TARGET" +CXX_FOR_TARGET=$ac_cv_prog_CXX_FOR_TARGET if test -n "$CXX_FOR_TARGET"; then - echo "$ac_t""$CXX_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $CXX_FOR_TARGET" >&5 +echo "${ECHO_T}$CXX_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_CXX_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_CXX_FOR_TARGET" ; then set dummy c++ g++ cxx gxx if test $build = $target ; then @@ -4754,18 +8033,70 @@ if test -z "$ac_cv_prog_CXX_FOR_TARGET" ; then else CXX_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + CXX_FOR_TARGET="$ac_cv_prog_CXX_FOR_TARGET" fi - if test -n "$with_build_time_tools"; then + + +if test -n "$GCC_FOR_TARGET"; then + ac_cv_prog_GCC_FOR_TARGET=$GCC_FOR_TARGET +elif test -n "$ac_cv_prog_GCC_FOR_TARGET"; then + GCC_FOR_TARGET=$ac_cv_prog_GCC_FOR_TARGET +fi + +if test -n "$ac_cv_prog_GCC_FOR_TARGET"; then for ncn_progname in gcc; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:4763: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_GCC_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$GCC_FOR_TARGET"; then + ac_cv_prog_GCC_FOR_TARGET="$GCC_FOR_TARGET" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GCC_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +GCC_FOR_TARGET=$ac_cv_prog_GCC_FOR_TARGET +if test -n "$GCC_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $GCC_FOR_TARGET" >&5 +echo "${ECHO_T}$GCC_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_GCC_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in gcc; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_GCC_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -4775,83 +8106,147 @@ if test -z "$ac_cv_prog_GCC_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4780: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_GCC_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_GCC_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$GCC_FOR_TARGET"; then ac_cv_prog_GCC_FOR_TARGET="$GCC_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_GCC_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GCC_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -GCC_FOR_TARGET="$ac_cv_prog_GCC_FOR_TARGET" +GCC_FOR_TARGET=$ac_cv_prog_GCC_FOR_TARGET if test -n "$GCC_FOR_TARGET"; then - echo "$ac_t""$GCC_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $GCC_FOR_TARGET" >&5 +echo "${ECHO_T}$GCC_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_GCC_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4811: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_GCC_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_GCC_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$GCC_FOR_TARGET"; then ac_cv_prog_GCC_FOR_TARGET="$GCC_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_GCC_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GCC_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -GCC_FOR_TARGET="$ac_cv_prog_GCC_FOR_TARGET" +GCC_FOR_TARGET=$ac_cv_prog_GCC_FOR_TARGET if test -n "$GCC_FOR_TARGET"; then - echo "$ac_t""$GCC_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $GCC_FOR_TARGET" >&5 +echo "${ECHO_T}$GCC_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_GCC_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_GCC_FOR_TARGET" ; then GCC_FOR_TARGET="${CC_FOR_TARGET}" +else + GCC_FOR_TARGET="$ac_cv_prog_GCC_FOR_TARGET" fi - if test -n "$with_build_time_tools"; then + + +if test -n "$GCJ_FOR_TARGET"; then + ac_cv_prog_GCJ_FOR_TARGET=$GCJ_FOR_TARGET +elif test -n "$ac_cv_prog_GCJ_FOR_TARGET"; then + GCJ_FOR_TARGET=$ac_cv_prog_GCJ_FOR_TARGET +fi + +if test -n "$ac_cv_prog_GCJ_FOR_TARGET"; then for ncn_progname in gcj; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:4849: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_GCJ_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$GCJ_FOR_TARGET"; then + ac_cv_prog_GCJ_FOR_TARGET="$GCJ_FOR_TARGET" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GCJ_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +GCJ_FOR_TARGET=$ac_cv_prog_GCJ_FOR_TARGET +if test -n "$GCJ_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $GCJ_FOR_TARGET" >&5 +echo "${ECHO_T}$GCJ_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_GCJ_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in gcj; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_GCJ_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -4861,69 +8256,81 @@ if test -z "$ac_cv_prog_GCJ_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4866: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_GCJ_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_GCJ_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$GCJ_FOR_TARGET"; then ac_cv_prog_GCJ_FOR_TARGET="$GCJ_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_GCJ_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GCJ_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -GCJ_FOR_TARGET="$ac_cv_prog_GCJ_FOR_TARGET" +GCJ_FOR_TARGET=$ac_cv_prog_GCJ_FOR_TARGET if test -n "$GCJ_FOR_TARGET"; then - echo "$ac_t""$GCJ_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $GCJ_FOR_TARGET" >&5 +echo "${ECHO_T}$GCJ_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_GCJ_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4897: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_GCJ_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_GCJ_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$GCJ_FOR_TARGET"; then ac_cv_prog_GCJ_FOR_TARGET="$GCJ_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_GCJ_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GCJ_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -GCJ_FOR_TARGET="$ac_cv_prog_GCJ_FOR_TARGET" +GCJ_FOR_TARGET=$ac_cv_prog_GCJ_FOR_TARGET if test -n "$GCJ_FOR_TARGET"; then - echo "$ac_t""$GCJ_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $GCJ_FOR_TARGET" >&5 +echo "${ECHO_T}$GCJ_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_GCJ_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_GCJ_FOR_TARGET" ; then set dummy gcj if test $build = $target ; then @@ -4931,18 +8338,70 @@ if test -z "$ac_cv_prog_GCJ_FOR_TARGET" ; then else GCJ_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + GCJ_FOR_TARGET="$ac_cv_prog_GCJ_FOR_TARGET" fi - if test -n "$with_build_time_tools"; then + + +if test -n "$GFORTRAN_FOR_TARGET"; then + ac_cv_prog_GFORTRAN_FOR_TARGET=$GFORTRAN_FOR_TARGET +elif test -n "$ac_cv_prog_GFORTRAN_FOR_TARGET"; then + GFORTRAN_FOR_TARGET=$ac_cv_prog_GFORTRAN_FOR_TARGET +fi + +if test -n "$ac_cv_prog_GFORTRAN_FOR_TARGET"; then for ncn_progname in gfortran; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:4940: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_GFORTRAN_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$GFORTRAN_FOR_TARGET"; then + ac_cv_prog_GFORTRAN_FOR_TARGET="$GFORTRAN_FOR_TARGET" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GFORTRAN_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +GFORTRAN_FOR_TARGET=$ac_cv_prog_GFORTRAN_FOR_TARGET +if test -n "$GFORTRAN_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $GFORTRAN_FOR_TARGET" >&5 +echo "${ECHO_T}$GFORTRAN_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_GFORTRAN_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in gfortran; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_GFORTRAN_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -4952,69 +8411,81 @@ if test -z "$ac_cv_prog_GFORTRAN_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4957: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_GFORTRAN_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_GFORTRAN_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$GFORTRAN_FOR_TARGET"; then ac_cv_prog_GFORTRAN_FOR_TARGET="$GFORTRAN_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_GFORTRAN_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GFORTRAN_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -GFORTRAN_FOR_TARGET="$ac_cv_prog_GFORTRAN_FOR_TARGET" +GFORTRAN_FOR_TARGET=$ac_cv_prog_GFORTRAN_FOR_TARGET if test -n "$GFORTRAN_FOR_TARGET"; then - echo "$ac_t""$GFORTRAN_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $GFORTRAN_FOR_TARGET" >&5 +echo "${ECHO_T}$GFORTRAN_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_GFORTRAN_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4988: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_GFORTRAN_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_GFORTRAN_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$GFORTRAN_FOR_TARGET"; then ac_cv_prog_GFORTRAN_FOR_TARGET="$GFORTRAN_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_GFORTRAN_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GFORTRAN_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -GFORTRAN_FOR_TARGET="$ac_cv_prog_GFORTRAN_FOR_TARGET" +GFORTRAN_FOR_TARGET=$ac_cv_prog_GFORTRAN_FOR_TARGET if test -n "$GFORTRAN_FOR_TARGET"; then - echo "$ac_t""$GFORTRAN_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $GFORTRAN_FOR_TARGET" >&5 +echo "${ECHO_T}$GFORTRAN_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_GFORTRAN_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_GFORTRAN_FOR_TARGET" ; then set dummy gfortran if test $build = $target ; then @@ -5022,52 +8493,8 @@ if test -z "$ac_cv_prog_GFORTRAN_FOR_TARGET" ; then else GFORTRAN_FOR_TARGET="${ncn_target_tool_prefix}$2" fi -fi - - - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - -if test "x$exec_prefix" = xNONE; then - if test "x$prefix" = xNONE; then - gcc_cv_tool_prefix=$ac_default_prefix - else - gcc_cv_tool_prefix=$prefix - fi else - gcc_cv_tool_prefix=$exec_prefix -fi - -# If there is no compiler in the tree, use the PATH only. In any -# case, if there is no compiler in the tree nobody should use -# AS_FOR_TARGET and LD_FOR_TARGET. -if test x$host = x$build && test -f $srcdir/gcc/BASE-VER; then - gcc_version=`cat $srcdir/gcc/BASE-VER` - gcc_cv_tool_dirs="$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR" - gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical$PATH_SEPARATOR" - gcc_cv_tool_dirs="$gcc_cv_tool_dirs/usr/lib/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR" - gcc_cv_tool_dirs="$gcc_cv_tool_dirs/usr/lib/gcc/$target_noncanonical$PATH_SEPARATOR" - gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version$PATH_SEPARATOR" - gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/$target_noncanonical/bin$PATH_SEPARATOR" -else - gcc_cv_tool_dirs= -fi - -if test x$build = x$target && test -n "$md_exec_prefix"; then - gcc_cv_tool_dirs="$gcc_cv_tool_dirs$md_exec_prefix$PATH_SEPARATOR" + GFORTRAN_FOR_TARGET="$ac_cv_prog_GFORTRAN_FOR_TARGET" fi @@ -5090,69 +8517,125 @@ rm conftest.c if test -z "$ac_cv_path_AR_FOR_TARGET" ; then if test -n "$with_build_time_tools"; then - echo $ac_n "checking for ar in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5095: checking for ar in $with_build_time_tools" >&5 + echo "$as_me:$LINENO: checking for ar in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ar in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/ar; then AR_FOR_TARGET=`cd $with_build_time_tools && pwd`/ar ac_cv_path_AR_FOR_TARGET=$AR_FOR_TARGET - echo "$ac_t""$ac_cv_path_AR_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $ac_cv_path_AR_FOR_TARGET" >&5 +echo "${ECHO_T}$ac_cv_path_AR_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi elif test $build != $host && test $have_gcc_for_target = yes; then AR_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=ar` - test $AR_FOR_TARGET=ar && AR_FOR_TARGET= - ac_cv_path_AR_FOR_TARGET=$AR_FOR_TARGET + test $AR_FOR_TARGET = ar && AR_FOR_TARGET= + test -n "$AR_FOR_TARGET" && ac_cv_path_AR_FOR_TARGET=$AR_FOR_TARGET fi fi -if test -z "$ac_cv_path_AR_FOR_TARGET" ; then +if test -z "$ac_cv_path_AR_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5113: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_AR_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_AR_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$AR_FOR_TARGET" in - /*) + case $AR_FOR_TARGET in + [\\/]* | ?:[\\/]*) ac_cv_path_AR_FOR_TARGET="$AR_FOR_TARGET" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_AR_FOR_TARGET="$AR_FOR_TARGET" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$gcc_cv_tool_dirs" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_AR_FOR_TARGET="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $gcc_cv_tool_dirs +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_AR_FOR_TARGET="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + ;; esac fi -AR_FOR_TARGET="$ac_cv_path_AR_FOR_TARGET" +AR_FOR_TARGET=$ac_cv_path_AR_FOR_TARGET + if test -n "$AR_FOR_TARGET"; then - echo "$ac_t""$AR_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $AR_FOR_TARGET" >&5 +echo "${ECHO_T}$AR_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_AR_FOR_TARGET" ; then - if test -n "$with_build_time_tools"; then + + +if test -n "$AR_FOR_TARGET"; then + ac_cv_prog_AR_FOR_TARGET=$AR_FOR_TARGET +elif test -n "$ac_cv_prog_AR_FOR_TARGET"; then + AR_FOR_TARGET=$ac_cv_prog_AR_FOR_TARGET +fi + +if test -n "$ac_cv_prog_AR_FOR_TARGET"; then for ncn_progname in ar; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5150: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR_FOR_TARGET"; then + ac_cv_prog_AR_FOR_TARGET="$AR_FOR_TARGET" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AR_FOR_TARGET=$ac_cv_prog_AR_FOR_TARGET +if test -n "$AR_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $AR_FOR_TARGET" >&5 +echo "${ECHO_T}$AR_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_AR_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in ar; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_AR_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -5162,69 +8645,81 @@ if test -z "$ac_cv_prog_AR_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5167: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AR_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR_FOR_TARGET"; then ac_cv_prog_AR_FOR_TARGET="$AR_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AR_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -AR_FOR_TARGET="$ac_cv_prog_AR_FOR_TARGET" +AR_FOR_TARGET=$ac_cv_prog_AR_FOR_TARGET if test -n "$AR_FOR_TARGET"; then - echo "$ac_t""$AR_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $AR_FOR_TARGET" >&5 +echo "${ECHO_T}$AR_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AR_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5198: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AR_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR_FOR_TARGET"; then ac_cv_prog_AR_FOR_TARGET="$AR_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AR_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -AR_FOR_TARGET="$ac_cv_prog_AR_FOR_TARGET" +AR_FOR_TARGET=$ac_cv_prog_AR_FOR_TARGET if test -n "$AR_FOR_TARGET"; then - echo "$ac_t""$AR_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $AR_FOR_TARGET" >&5 +echo "${ECHO_T}$AR_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_AR_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_AR_FOR_TARGET" ; then set dummy ar if test $build = $target ; then @@ -5232,6 +8727,8 @@ if test -z "$ac_cv_prog_AR_FOR_TARGET" ; then else AR_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + AR_FOR_TARGET="$ac_cv_prog_AR_FOR_TARGET" fi else @@ -5243,69 +8740,125 @@ fi if test -z "$ac_cv_path_AS_FOR_TARGET" ; then if test -n "$with_build_time_tools"; then - echo $ac_n "checking for as in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5248: checking for as in $with_build_time_tools" >&5 + echo "$as_me:$LINENO: checking for as in $with_build_time_tools" >&5 +echo $ECHO_N "checking for as in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/as; then AS_FOR_TARGET=`cd $with_build_time_tools && pwd`/as ac_cv_path_AS_FOR_TARGET=$AS_FOR_TARGET - echo "$ac_t""$ac_cv_path_AS_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $ac_cv_path_AS_FOR_TARGET" >&5 +echo "${ECHO_T}$ac_cv_path_AS_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi elif test $build != $host && test $have_gcc_for_target = yes; then AS_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=as` - test $AS_FOR_TARGET=as && AS_FOR_TARGET= - ac_cv_path_AS_FOR_TARGET=$AS_FOR_TARGET + test $AS_FOR_TARGET = as && AS_FOR_TARGET= + test -n "$AS_FOR_TARGET" && ac_cv_path_AS_FOR_TARGET=$AS_FOR_TARGET fi fi -if test -z "$ac_cv_path_AS_FOR_TARGET" ; then +if test -z "$ac_cv_path_AS_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5266: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_AS_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_AS_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$AS_FOR_TARGET" in - /*) + case $AS_FOR_TARGET in + [\\/]* | ?:[\\/]*) ac_cv_path_AS_FOR_TARGET="$AS_FOR_TARGET" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_AS_FOR_TARGET="$AS_FOR_TARGET" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$gcc_cv_tool_dirs" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_AS_FOR_TARGET="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $gcc_cv_tool_dirs +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_AS_FOR_TARGET="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + ;; esac fi -AS_FOR_TARGET="$ac_cv_path_AS_FOR_TARGET" +AS_FOR_TARGET=$ac_cv_path_AS_FOR_TARGET + if test -n "$AS_FOR_TARGET"; then - echo "$ac_t""$AS_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $AS_FOR_TARGET" >&5 +echo "${ECHO_T}$AS_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_AS_FOR_TARGET" ; then - if test -n "$with_build_time_tools"; then + + +if test -n "$AS_FOR_TARGET"; then + ac_cv_prog_AS_FOR_TARGET=$AS_FOR_TARGET +elif test -n "$ac_cv_prog_AS_FOR_TARGET"; then + AS_FOR_TARGET=$ac_cv_prog_AS_FOR_TARGET +fi + +if test -n "$ac_cv_prog_AS_FOR_TARGET"; then for ncn_progname in as; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5303: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AS_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AS_FOR_TARGET"; then + ac_cv_prog_AS_FOR_TARGET="$AS_FOR_TARGET" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AS_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AS_FOR_TARGET=$ac_cv_prog_AS_FOR_TARGET +if test -n "$AS_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $AS_FOR_TARGET" >&5 +echo "${ECHO_T}$AS_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_AS_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in as; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_AS_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -5315,69 +8868,81 @@ if test -z "$ac_cv_prog_AS_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5320: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AS_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AS_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AS_FOR_TARGET"; then ac_cv_prog_AS_FOR_TARGET="$AS_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AS_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AS_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -AS_FOR_TARGET="$ac_cv_prog_AS_FOR_TARGET" +AS_FOR_TARGET=$ac_cv_prog_AS_FOR_TARGET if test -n "$AS_FOR_TARGET"; then - echo "$ac_t""$AS_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $AS_FOR_TARGET" >&5 +echo "${ECHO_T}$AS_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AS_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5351: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AS_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AS_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AS_FOR_TARGET"; then ac_cv_prog_AS_FOR_TARGET="$AS_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AS_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AS_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -AS_FOR_TARGET="$ac_cv_prog_AS_FOR_TARGET" +AS_FOR_TARGET=$ac_cv_prog_AS_FOR_TARGET if test -n "$AS_FOR_TARGET"; then - echo "$ac_t""$AS_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $AS_FOR_TARGET" >&5 +echo "${ECHO_T}$AS_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_AS_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_AS_FOR_TARGET" ; then set dummy as if test $build = $target ; then @@ -5385,6 +8950,8 @@ if test -z "$ac_cv_prog_AS_FOR_TARGET" ; then else AS_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + AS_FOR_TARGET="$ac_cv_prog_AS_FOR_TARGET" fi else @@ -5396,69 +8963,125 @@ fi if test -z "$ac_cv_path_DLLTOOL_FOR_TARGET" ; then if test -n "$with_build_time_tools"; then - echo $ac_n "checking for dlltool in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5401: checking for dlltool in $with_build_time_tools" >&5 + echo "$as_me:$LINENO: checking for dlltool in $with_build_time_tools" >&5 +echo $ECHO_N "checking for dlltool in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/dlltool; then DLLTOOL_FOR_TARGET=`cd $with_build_time_tools && pwd`/dlltool ac_cv_path_DLLTOOL_FOR_TARGET=$DLLTOOL_FOR_TARGET - echo "$ac_t""$ac_cv_path_DLLTOOL_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $ac_cv_path_DLLTOOL_FOR_TARGET" >&5 +echo "${ECHO_T}$ac_cv_path_DLLTOOL_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi elif test $build != $host && test $have_gcc_for_target = yes; then DLLTOOL_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=dlltool` - test $DLLTOOL_FOR_TARGET=dlltool && DLLTOOL_FOR_TARGET= - ac_cv_path_DLLTOOL_FOR_TARGET=$DLLTOOL_FOR_TARGET + test $DLLTOOL_FOR_TARGET = dlltool && DLLTOOL_FOR_TARGET= + test -n "$DLLTOOL_FOR_TARGET" && ac_cv_path_DLLTOOL_FOR_TARGET=$DLLTOOL_FOR_TARGET fi fi -if test -z "$ac_cv_path_DLLTOOL_FOR_TARGET" ; then +if test -z "$ac_cv_path_DLLTOOL_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5419: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_DLLTOOL_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$DLLTOOL_FOR_TARGET" in - /*) + case $DLLTOOL_FOR_TARGET in + [\\/]* | ?:[\\/]*) ac_cv_path_DLLTOOL_FOR_TARGET="$DLLTOOL_FOR_TARGET" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_DLLTOOL_FOR_TARGET="$DLLTOOL_FOR_TARGET" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$gcc_cv_tool_dirs" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_DLLTOOL_FOR_TARGET="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $gcc_cv_tool_dirs +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DLLTOOL_FOR_TARGET="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + ;; esac fi -DLLTOOL_FOR_TARGET="$ac_cv_path_DLLTOOL_FOR_TARGET" +DLLTOOL_FOR_TARGET=$ac_cv_path_DLLTOOL_FOR_TARGET + if test -n "$DLLTOOL_FOR_TARGET"; then - echo "$ac_t""$DLLTOOL_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $DLLTOOL_FOR_TARGET" >&5 +echo "${ECHO_T}$DLLTOOL_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_DLLTOOL_FOR_TARGET" ; then - if test -n "$with_build_time_tools"; then + + +if test -n "$DLLTOOL_FOR_TARGET"; then + ac_cv_prog_DLLTOOL_FOR_TARGET=$DLLTOOL_FOR_TARGET +elif test -n "$ac_cv_prog_DLLTOOL_FOR_TARGET"; then + DLLTOOL_FOR_TARGET=$ac_cv_prog_DLLTOOL_FOR_TARGET +fi + +if test -n "$ac_cv_prog_DLLTOOL_FOR_TARGET"; then for ncn_progname in dlltool; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5456: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_DLLTOOL_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$DLLTOOL_FOR_TARGET"; then + ac_cv_prog_DLLTOOL_FOR_TARGET="$DLLTOOL_FOR_TARGET" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +DLLTOOL_FOR_TARGET=$ac_cv_prog_DLLTOOL_FOR_TARGET +if test -n "$DLLTOOL_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $DLLTOOL_FOR_TARGET" >&5 +echo "${ECHO_T}$DLLTOOL_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in dlltool; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_DLLTOOL_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -5468,69 +9091,81 @@ if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5473: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_DLLTOOL_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DLLTOOL_FOR_TARGET"; then ac_cv_prog_DLLTOOL_FOR_TARGET="$DLLTOOL_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_DLLTOOL_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -DLLTOOL_FOR_TARGET="$ac_cv_prog_DLLTOOL_FOR_TARGET" +DLLTOOL_FOR_TARGET=$ac_cv_prog_DLLTOOL_FOR_TARGET if test -n "$DLLTOOL_FOR_TARGET"; then - echo "$ac_t""$DLLTOOL_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $DLLTOOL_FOR_TARGET" >&5 +echo "${ECHO_T}$DLLTOOL_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5504: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_DLLTOOL_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DLLTOOL_FOR_TARGET"; then ac_cv_prog_DLLTOOL_FOR_TARGET="$DLLTOOL_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_DLLTOOL_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -DLLTOOL_FOR_TARGET="$ac_cv_prog_DLLTOOL_FOR_TARGET" +DLLTOOL_FOR_TARGET=$ac_cv_prog_DLLTOOL_FOR_TARGET if test -n "$DLLTOOL_FOR_TARGET"; then - echo "$ac_t""$DLLTOOL_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $DLLTOOL_FOR_TARGET" >&5 +echo "${ECHO_T}$DLLTOOL_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_DLLTOOL_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET" ; then set dummy dlltool if test $build = $target ; then @@ -5538,6 +9173,8 @@ if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET" ; then else DLLTOOL_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + DLLTOOL_FOR_TARGET="$ac_cv_prog_DLLTOOL_FOR_TARGET" fi else @@ -5549,69 +9186,125 @@ fi if test -z "$ac_cv_path_LD_FOR_TARGET" ; then if test -n "$with_build_time_tools"; then - echo $ac_n "checking for ld in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5554: checking for ld in $with_build_time_tools" >&5 + echo "$as_me:$LINENO: checking for ld in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ld in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/ld; then LD_FOR_TARGET=`cd $with_build_time_tools && pwd`/ld ac_cv_path_LD_FOR_TARGET=$LD_FOR_TARGET - echo "$ac_t""$ac_cv_path_LD_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $ac_cv_path_LD_FOR_TARGET" >&5 +echo "${ECHO_T}$ac_cv_path_LD_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi elif test $build != $host && test $have_gcc_for_target = yes; then LD_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=ld` - test $LD_FOR_TARGET=ld && LD_FOR_TARGET= - ac_cv_path_LD_FOR_TARGET=$LD_FOR_TARGET + test $LD_FOR_TARGET = ld && LD_FOR_TARGET= + test -n "$LD_FOR_TARGET" && ac_cv_path_LD_FOR_TARGET=$LD_FOR_TARGET fi fi -if test -z "$ac_cv_path_LD_FOR_TARGET" ; then +if test -z "$ac_cv_path_LD_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5572: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_LD_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_LD_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$LD_FOR_TARGET" in - /*) + case $LD_FOR_TARGET in + [\\/]* | ?:[\\/]*) ac_cv_path_LD_FOR_TARGET="$LD_FOR_TARGET" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_LD_FOR_TARGET="$LD_FOR_TARGET" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$gcc_cv_tool_dirs" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_LD_FOR_TARGET="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $gcc_cv_tool_dirs +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_LD_FOR_TARGET="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + ;; esac fi -LD_FOR_TARGET="$ac_cv_path_LD_FOR_TARGET" +LD_FOR_TARGET=$ac_cv_path_LD_FOR_TARGET + if test -n "$LD_FOR_TARGET"; then - echo "$ac_t""$LD_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $LD_FOR_TARGET" >&5 +echo "${ECHO_T}$LD_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_LD_FOR_TARGET" ; then - if test -n "$with_build_time_tools"; then + + +if test -n "$LD_FOR_TARGET"; then + ac_cv_prog_LD_FOR_TARGET=$LD_FOR_TARGET +elif test -n "$ac_cv_prog_LD_FOR_TARGET"; then + LD_FOR_TARGET=$ac_cv_prog_LD_FOR_TARGET +fi + +if test -n "$ac_cv_prog_LD_FOR_TARGET"; then for ncn_progname in ld; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5609: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LD_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$LD_FOR_TARGET"; then + ac_cv_prog_LD_FOR_TARGET="$LD_FOR_TARGET" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LD_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +LD_FOR_TARGET=$ac_cv_prog_LD_FOR_TARGET +if test -n "$LD_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $LD_FOR_TARGET" >&5 +echo "${ECHO_T}$LD_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_LD_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in ld; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_LD_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -5621,69 +9314,81 @@ if test -z "$ac_cv_prog_LD_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5626: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LD_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LD_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LD_FOR_TARGET"; then ac_cv_prog_LD_FOR_TARGET="$LD_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LD_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LD_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -LD_FOR_TARGET="$ac_cv_prog_LD_FOR_TARGET" +LD_FOR_TARGET=$ac_cv_prog_LD_FOR_TARGET if test -n "$LD_FOR_TARGET"; then - echo "$ac_t""$LD_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $LD_FOR_TARGET" >&5 +echo "${ECHO_T}$LD_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_LD_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5657: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LD_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LD_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LD_FOR_TARGET"; then ac_cv_prog_LD_FOR_TARGET="$LD_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LD_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LD_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -LD_FOR_TARGET="$ac_cv_prog_LD_FOR_TARGET" +LD_FOR_TARGET=$ac_cv_prog_LD_FOR_TARGET if test -n "$LD_FOR_TARGET"; then - echo "$ac_t""$LD_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $LD_FOR_TARGET" >&5 +echo "${ECHO_T}$LD_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_LD_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_LD_FOR_TARGET" ; then set dummy ld if test $build = $target ; then @@ -5691,6 +9396,8 @@ if test -z "$ac_cv_prog_LD_FOR_TARGET" ; then else LD_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + LD_FOR_TARGET="$ac_cv_prog_LD_FOR_TARGET" fi else @@ -5702,69 +9409,125 @@ fi if test -z "$ac_cv_path_LIPO_FOR_TARGET" ; then if test -n "$with_build_time_tools"; then - echo $ac_n "checking for lipo in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5707: checking for lipo in $with_build_time_tools" >&5 + echo "$as_me:$LINENO: checking for lipo in $with_build_time_tools" >&5 +echo $ECHO_N "checking for lipo in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/lipo; then LIPO_FOR_TARGET=`cd $with_build_time_tools && pwd`/lipo ac_cv_path_LIPO_FOR_TARGET=$LIPO_FOR_TARGET - echo "$ac_t""$ac_cv_path_LIPO_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $ac_cv_path_LIPO_FOR_TARGET" >&5 +echo "${ECHO_T}$ac_cv_path_LIPO_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi elif test $build != $host && test $have_gcc_for_target = yes; then LIPO_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=lipo` - test $LIPO_FOR_TARGET=lipo && LIPO_FOR_TARGET= - ac_cv_path_LIPO_FOR_TARGET=$LIPO_FOR_TARGET + test $LIPO_FOR_TARGET = lipo && LIPO_FOR_TARGET= + test -n "$LIPO_FOR_TARGET" && ac_cv_path_LIPO_FOR_TARGET=$LIPO_FOR_TARGET fi fi -if test -z "$ac_cv_path_LIPO_FOR_TARGET" ; then +if test -z "$ac_cv_path_LIPO_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5725: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_LIPO_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_LIPO_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$LIPO_FOR_TARGET" in - /*) + case $LIPO_FOR_TARGET in + [\\/]* | ?:[\\/]*) ac_cv_path_LIPO_FOR_TARGET="$LIPO_FOR_TARGET" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_LIPO_FOR_TARGET="$LIPO_FOR_TARGET" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$gcc_cv_tool_dirs" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_LIPO_FOR_TARGET="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $gcc_cv_tool_dirs +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_LIPO_FOR_TARGET="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + ;; esac fi -LIPO_FOR_TARGET="$ac_cv_path_LIPO_FOR_TARGET" +LIPO_FOR_TARGET=$ac_cv_path_LIPO_FOR_TARGET + if test -n "$LIPO_FOR_TARGET"; then - echo "$ac_t""$LIPO_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $LIPO_FOR_TARGET" >&5 +echo "${ECHO_T}$LIPO_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_LIPO_FOR_TARGET" ; then - if test -n "$with_build_time_tools"; then + + +if test -n "$LIPO_FOR_TARGET"; then + ac_cv_prog_LIPO_FOR_TARGET=$LIPO_FOR_TARGET +elif test -n "$ac_cv_prog_LIPO_FOR_TARGET"; then + LIPO_FOR_TARGET=$ac_cv_prog_LIPO_FOR_TARGET +fi + +if test -n "$ac_cv_prog_LIPO_FOR_TARGET"; then for ncn_progname in lipo; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5762: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LIPO_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$LIPO_FOR_TARGET"; then + ac_cv_prog_LIPO_FOR_TARGET="$LIPO_FOR_TARGET" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +LIPO_FOR_TARGET=$ac_cv_prog_LIPO_FOR_TARGET +if test -n "$LIPO_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $LIPO_FOR_TARGET" >&5 +echo "${ECHO_T}$LIPO_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_LIPO_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in lipo; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_LIPO_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -5774,69 +9537,81 @@ if test -z "$ac_cv_prog_LIPO_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5779: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LIPO_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LIPO_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LIPO_FOR_TARGET"; then ac_cv_prog_LIPO_FOR_TARGET="$LIPO_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LIPO_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -LIPO_FOR_TARGET="$ac_cv_prog_LIPO_FOR_TARGET" +LIPO_FOR_TARGET=$ac_cv_prog_LIPO_FOR_TARGET if test -n "$LIPO_FOR_TARGET"; then - echo "$ac_t""$LIPO_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $LIPO_FOR_TARGET" >&5 +echo "${ECHO_T}$LIPO_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_LIPO_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5810: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LIPO_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LIPO_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LIPO_FOR_TARGET"; then ac_cv_prog_LIPO_FOR_TARGET="$LIPO_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LIPO_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -LIPO_FOR_TARGET="$ac_cv_prog_LIPO_FOR_TARGET" +LIPO_FOR_TARGET=$ac_cv_prog_LIPO_FOR_TARGET if test -n "$LIPO_FOR_TARGET"; then - echo "$ac_t""$LIPO_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $LIPO_FOR_TARGET" >&5 +echo "${ECHO_T}$LIPO_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_LIPO_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_LIPO_FOR_TARGET" ; then set dummy lipo if test $build = $target ; then @@ -5844,6 +9619,8 @@ if test -z "$ac_cv_prog_LIPO_FOR_TARGET" ; then else LIPO_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + LIPO_FOR_TARGET="$ac_cv_prog_LIPO_FOR_TARGET" fi else @@ -5855,69 +9632,125 @@ fi if test -z "$ac_cv_path_NM_FOR_TARGET" ; then if test -n "$with_build_time_tools"; then - echo $ac_n "checking for nm in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5860: checking for nm in $with_build_time_tools" >&5 + echo "$as_me:$LINENO: checking for nm in $with_build_time_tools" >&5 +echo $ECHO_N "checking for nm in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/nm; then NM_FOR_TARGET=`cd $with_build_time_tools && pwd`/nm ac_cv_path_NM_FOR_TARGET=$NM_FOR_TARGET - echo "$ac_t""$ac_cv_path_NM_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $ac_cv_path_NM_FOR_TARGET" >&5 +echo "${ECHO_T}$ac_cv_path_NM_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi elif test $build != $host && test $have_gcc_for_target = yes; then NM_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=nm` - test $NM_FOR_TARGET=nm && NM_FOR_TARGET= - ac_cv_path_NM_FOR_TARGET=$NM_FOR_TARGET + test $NM_FOR_TARGET = nm && NM_FOR_TARGET= + test -n "$NM_FOR_TARGET" && ac_cv_path_NM_FOR_TARGET=$NM_FOR_TARGET fi fi -if test -z "$ac_cv_path_NM_FOR_TARGET" ; then +if test -z "$ac_cv_path_NM_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5878: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_NM_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_NM_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$NM_FOR_TARGET" in - /*) + case $NM_FOR_TARGET in + [\\/]* | ?:[\\/]*) ac_cv_path_NM_FOR_TARGET="$NM_FOR_TARGET" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_NM_FOR_TARGET="$NM_FOR_TARGET" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$gcc_cv_tool_dirs" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_NM_FOR_TARGET="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $gcc_cv_tool_dirs +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_NM_FOR_TARGET="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + ;; esac fi -NM_FOR_TARGET="$ac_cv_path_NM_FOR_TARGET" +NM_FOR_TARGET=$ac_cv_path_NM_FOR_TARGET + if test -n "$NM_FOR_TARGET"; then - echo "$ac_t""$NM_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $NM_FOR_TARGET" >&5 +echo "${ECHO_T}$NM_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_NM_FOR_TARGET" ; then - if test -n "$with_build_time_tools"; then + + +if test -n "$NM_FOR_TARGET"; then + ac_cv_prog_NM_FOR_TARGET=$NM_FOR_TARGET +elif test -n "$ac_cv_prog_NM_FOR_TARGET"; then + NM_FOR_TARGET=$ac_cv_prog_NM_FOR_TARGET +fi + +if test -n "$ac_cv_prog_NM_FOR_TARGET"; then for ncn_progname in nm; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5915: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_NM_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM_FOR_TARGET"; then + ac_cv_prog_NM_FOR_TARGET="$NM_FOR_TARGET" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NM_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +NM_FOR_TARGET=$ac_cv_prog_NM_FOR_TARGET +if test -n "$NM_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $NM_FOR_TARGET" >&5 +echo "${ECHO_T}$NM_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_NM_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in nm; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_NM_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -5927,69 +9760,81 @@ if test -z "$ac_cv_prog_NM_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5932: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_NM_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_NM_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM_FOR_TARGET"; then ac_cv_prog_NM_FOR_TARGET="$NM_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_NM_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NM_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -NM_FOR_TARGET="$ac_cv_prog_NM_FOR_TARGET" +NM_FOR_TARGET=$ac_cv_prog_NM_FOR_TARGET if test -n "$NM_FOR_TARGET"; then - echo "$ac_t""$NM_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $NM_FOR_TARGET" >&5 +echo "${ECHO_T}$NM_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_NM_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5963: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_NM_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_NM_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM_FOR_TARGET"; then ac_cv_prog_NM_FOR_TARGET="$NM_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_NM_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NM_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -NM_FOR_TARGET="$ac_cv_prog_NM_FOR_TARGET" +NM_FOR_TARGET=$ac_cv_prog_NM_FOR_TARGET if test -n "$NM_FOR_TARGET"; then - echo "$ac_t""$NM_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $NM_FOR_TARGET" >&5 +echo "${ECHO_T}$NM_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_NM_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_NM_FOR_TARGET" ; then set dummy nm if test $build = $target ; then @@ -5997,6 +9842,8 @@ if test -z "$ac_cv_prog_NM_FOR_TARGET" ; then else NM_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + NM_FOR_TARGET="$ac_cv_prog_NM_FOR_TARGET" fi else @@ -6008,69 +9855,125 @@ fi if test -z "$ac_cv_path_OBJDUMP_FOR_TARGET" ; then if test -n "$with_build_time_tools"; then - echo $ac_n "checking for objdump in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:6013: checking for objdump in $with_build_time_tools" >&5 + echo "$as_me:$LINENO: checking for objdump in $with_build_time_tools" >&5 +echo $ECHO_N "checking for objdump in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/objdump; then OBJDUMP_FOR_TARGET=`cd $with_build_time_tools && pwd`/objdump ac_cv_path_OBJDUMP_FOR_TARGET=$OBJDUMP_FOR_TARGET - echo "$ac_t""$ac_cv_path_OBJDUMP_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $ac_cv_path_OBJDUMP_FOR_TARGET" >&5 +echo "${ECHO_T}$ac_cv_path_OBJDUMP_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi elif test $build != $host && test $have_gcc_for_target = yes; then OBJDUMP_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=objdump` - test $OBJDUMP_FOR_TARGET=objdump && OBJDUMP_FOR_TARGET= - ac_cv_path_OBJDUMP_FOR_TARGET=$OBJDUMP_FOR_TARGET + test $OBJDUMP_FOR_TARGET = objdump && OBJDUMP_FOR_TARGET= + test -n "$OBJDUMP_FOR_TARGET" && ac_cv_path_OBJDUMP_FOR_TARGET=$OBJDUMP_FOR_TARGET fi fi -if test -z "$ac_cv_path_OBJDUMP_FOR_TARGET" ; then +if test -z "$ac_cv_path_OBJDUMP_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6031: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_OBJDUMP_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_OBJDUMP_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$OBJDUMP_FOR_TARGET" in - /*) + case $OBJDUMP_FOR_TARGET in + [\\/]* | ?:[\\/]*) ac_cv_path_OBJDUMP_FOR_TARGET="$OBJDUMP_FOR_TARGET" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_OBJDUMP_FOR_TARGET="$OBJDUMP_FOR_TARGET" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$gcc_cv_tool_dirs" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_OBJDUMP_FOR_TARGET="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $gcc_cv_tool_dirs +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_OBJDUMP_FOR_TARGET="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + ;; esac fi -OBJDUMP_FOR_TARGET="$ac_cv_path_OBJDUMP_FOR_TARGET" +OBJDUMP_FOR_TARGET=$ac_cv_path_OBJDUMP_FOR_TARGET + if test -n "$OBJDUMP_FOR_TARGET"; then - echo "$ac_t""$OBJDUMP_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $OBJDUMP_FOR_TARGET" >&5 +echo "${ECHO_T}$OBJDUMP_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_OBJDUMP_FOR_TARGET" ; then - if test -n "$with_build_time_tools"; then + + +if test -n "$OBJDUMP_FOR_TARGET"; then + ac_cv_prog_OBJDUMP_FOR_TARGET=$OBJDUMP_FOR_TARGET +elif test -n "$ac_cv_prog_OBJDUMP_FOR_TARGET"; then + OBJDUMP_FOR_TARGET=$ac_cv_prog_OBJDUMP_FOR_TARGET +fi + +if test -n "$ac_cv_prog_OBJDUMP_FOR_TARGET"; then for ncn_progname in objdump; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:6068: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_OBJDUMP_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$OBJDUMP_FOR_TARGET"; then + ac_cv_prog_OBJDUMP_FOR_TARGET="$OBJDUMP_FOR_TARGET" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +OBJDUMP_FOR_TARGET=$ac_cv_prog_OBJDUMP_FOR_TARGET +if test -n "$OBJDUMP_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $OBJDUMP_FOR_TARGET" >&5 +echo "${ECHO_T}$OBJDUMP_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_OBJDUMP_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in objdump; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_OBJDUMP_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -6080,69 +9983,81 @@ if test -z "$ac_cv_prog_OBJDUMP_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6085: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_OBJDUMP_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OBJDUMP_FOR_TARGET"; then ac_cv_prog_OBJDUMP_FOR_TARGET="$OBJDUMP_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_OBJDUMP_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -OBJDUMP_FOR_TARGET="$ac_cv_prog_OBJDUMP_FOR_TARGET" +OBJDUMP_FOR_TARGET=$ac_cv_prog_OBJDUMP_FOR_TARGET if test -n "$OBJDUMP_FOR_TARGET"; then - echo "$ac_t""$OBJDUMP_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $OBJDUMP_FOR_TARGET" >&5 +echo "${ECHO_T}$OBJDUMP_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_OBJDUMP_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6116: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_OBJDUMP_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OBJDUMP_FOR_TARGET"; then ac_cv_prog_OBJDUMP_FOR_TARGET="$OBJDUMP_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_OBJDUMP_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -OBJDUMP_FOR_TARGET="$ac_cv_prog_OBJDUMP_FOR_TARGET" +OBJDUMP_FOR_TARGET=$ac_cv_prog_OBJDUMP_FOR_TARGET if test -n "$OBJDUMP_FOR_TARGET"; then - echo "$ac_t""$OBJDUMP_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $OBJDUMP_FOR_TARGET" >&5 +echo "${ECHO_T}$OBJDUMP_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_OBJDUMP_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_OBJDUMP_FOR_TARGET" ; then set dummy objdump if test $build = $target ; then @@ -6150,6 +10065,8 @@ if test -z "$ac_cv_prog_OBJDUMP_FOR_TARGET" ; then else OBJDUMP_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + OBJDUMP_FOR_TARGET="$ac_cv_prog_OBJDUMP_FOR_TARGET" fi else @@ -6161,69 +10078,125 @@ fi if test -z "$ac_cv_path_RANLIB_FOR_TARGET" ; then if test -n "$with_build_time_tools"; then - echo $ac_n "checking for ranlib in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:6166: checking for ranlib in $with_build_time_tools" >&5 + echo "$as_me:$LINENO: checking for ranlib in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ranlib in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/ranlib; then RANLIB_FOR_TARGET=`cd $with_build_time_tools && pwd`/ranlib ac_cv_path_RANLIB_FOR_TARGET=$RANLIB_FOR_TARGET - echo "$ac_t""$ac_cv_path_RANLIB_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $ac_cv_path_RANLIB_FOR_TARGET" >&5 +echo "${ECHO_T}$ac_cv_path_RANLIB_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi elif test $build != $host && test $have_gcc_for_target = yes; then RANLIB_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=ranlib` - test $RANLIB_FOR_TARGET=ranlib && RANLIB_FOR_TARGET= - ac_cv_path_RANLIB_FOR_TARGET=$RANLIB_FOR_TARGET + test $RANLIB_FOR_TARGET = ranlib && RANLIB_FOR_TARGET= + test -n "$RANLIB_FOR_TARGET" && ac_cv_path_RANLIB_FOR_TARGET=$RANLIB_FOR_TARGET fi fi -if test -z "$ac_cv_path_RANLIB_FOR_TARGET" ; then +if test -z "$ac_cv_path_RANLIB_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6184: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_RANLIB_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_RANLIB_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$RANLIB_FOR_TARGET" in - /*) + case $RANLIB_FOR_TARGET in + [\\/]* | ?:[\\/]*) ac_cv_path_RANLIB_FOR_TARGET="$RANLIB_FOR_TARGET" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_RANLIB_FOR_TARGET="$RANLIB_FOR_TARGET" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$gcc_cv_tool_dirs" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_RANLIB_FOR_TARGET="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $gcc_cv_tool_dirs +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_RANLIB_FOR_TARGET="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + ;; esac fi -RANLIB_FOR_TARGET="$ac_cv_path_RANLIB_FOR_TARGET" +RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET + if test -n "$RANLIB_FOR_TARGET"; then - echo "$ac_t""$RANLIB_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $RANLIB_FOR_TARGET" >&5 +echo "${ECHO_T}$RANLIB_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_RANLIB_FOR_TARGET" ; then - if test -n "$with_build_time_tools"; then + + +if test -n "$RANLIB_FOR_TARGET"; then + ac_cv_prog_RANLIB_FOR_TARGET=$RANLIB_FOR_TARGET +elif test -n "$ac_cv_prog_RANLIB_FOR_TARGET"; then + RANLIB_FOR_TARGET=$ac_cv_prog_RANLIB_FOR_TARGET +fi + +if test -n "$ac_cv_prog_RANLIB_FOR_TARGET"; then for ncn_progname in ranlib; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:6221: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB_FOR_TARGET"; then + ac_cv_prog_RANLIB_FOR_TARGET="$RANLIB_FOR_TARGET" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB_FOR_TARGET=$ac_cv_prog_RANLIB_FOR_TARGET +if test -n "$RANLIB_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $RANLIB_FOR_TARGET" >&5 +echo "${ECHO_T}$RANLIB_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_RANLIB_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in ranlib; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_RANLIB_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -6233,69 +10206,81 @@ if test -z "$ac_cv_prog_RANLIB_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6238: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB_FOR_TARGET"; then ac_cv_prog_RANLIB_FOR_TARGET="$RANLIB_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -RANLIB_FOR_TARGET="$ac_cv_prog_RANLIB_FOR_TARGET" +RANLIB_FOR_TARGET=$ac_cv_prog_RANLIB_FOR_TARGET if test -n "$RANLIB_FOR_TARGET"; then - echo "$ac_t""$RANLIB_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $RANLIB_FOR_TARGET" >&5 +echo "${ECHO_T}$RANLIB_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6269: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB_FOR_TARGET"; then ac_cv_prog_RANLIB_FOR_TARGET="$RANLIB_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -RANLIB_FOR_TARGET="$ac_cv_prog_RANLIB_FOR_TARGET" +RANLIB_FOR_TARGET=$ac_cv_prog_RANLIB_FOR_TARGET if test -n "$RANLIB_FOR_TARGET"; then - echo "$ac_t""$RANLIB_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $RANLIB_FOR_TARGET" >&5 +echo "${ECHO_T}$RANLIB_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_RANLIB_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_RANLIB_FOR_TARGET" ; then set dummy ranlib if test $build = $target ; then @@ -6303,6 +10288,8 @@ if test -z "$ac_cv_prog_RANLIB_FOR_TARGET" ; then else RANLIB_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + RANLIB_FOR_TARGET="$ac_cv_prog_RANLIB_FOR_TARGET" fi else @@ -6314,69 +10301,125 @@ fi if test -z "$ac_cv_path_STRIP_FOR_TARGET" ; then if test -n "$with_build_time_tools"; then - echo $ac_n "checking for strip in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:6319: checking for strip in $with_build_time_tools" >&5 + echo "$as_me:$LINENO: checking for strip in $with_build_time_tools" >&5 +echo $ECHO_N "checking for strip in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/strip; then STRIP_FOR_TARGET=`cd $with_build_time_tools && pwd`/strip ac_cv_path_STRIP_FOR_TARGET=$STRIP_FOR_TARGET - echo "$ac_t""$ac_cv_path_STRIP_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $ac_cv_path_STRIP_FOR_TARGET" >&5 +echo "${ECHO_T}$ac_cv_path_STRIP_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi elif test $build != $host && test $have_gcc_for_target = yes; then STRIP_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=strip` - test $STRIP_FOR_TARGET=strip && STRIP_FOR_TARGET= - ac_cv_path_STRIP_FOR_TARGET=$STRIP_FOR_TARGET + test $STRIP_FOR_TARGET = strip && STRIP_FOR_TARGET= + test -n "$STRIP_FOR_TARGET" && ac_cv_path_STRIP_FOR_TARGET=$STRIP_FOR_TARGET fi fi -if test -z "$ac_cv_path_STRIP_FOR_TARGET" ; then +if test -z "$ac_cv_path_STRIP_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6337: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_STRIP_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_STRIP_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$STRIP_FOR_TARGET" in - /*) + case $STRIP_FOR_TARGET in + [\\/]* | ?:[\\/]*) ac_cv_path_STRIP_FOR_TARGET="$STRIP_FOR_TARGET" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_STRIP_FOR_TARGET="$STRIP_FOR_TARGET" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$gcc_cv_tool_dirs" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_STRIP_FOR_TARGET="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $gcc_cv_tool_dirs +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_STRIP_FOR_TARGET="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + ;; esac fi -STRIP_FOR_TARGET="$ac_cv_path_STRIP_FOR_TARGET" +STRIP_FOR_TARGET=$ac_cv_path_STRIP_FOR_TARGET + if test -n "$STRIP_FOR_TARGET"; then - echo "$ac_t""$STRIP_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $STRIP_FOR_TARGET" >&5 +echo "${ECHO_T}$STRIP_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_STRIP_FOR_TARGET" ; then - if test -n "$with_build_time_tools"; then + + +if test -n "$STRIP_FOR_TARGET"; then + ac_cv_prog_STRIP_FOR_TARGET=$STRIP_FOR_TARGET +elif test -n "$ac_cv_prog_STRIP_FOR_TARGET"; then + STRIP_FOR_TARGET=$ac_cv_prog_STRIP_FOR_TARGET +fi + +if test -n "$ac_cv_prog_STRIP_FOR_TARGET"; then for ncn_progname in strip; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:6374: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP_FOR_TARGET"; then + ac_cv_prog_STRIP_FOR_TARGET="$STRIP_FOR_TARGET" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP_FOR_TARGET=$ac_cv_prog_STRIP_FOR_TARGET +if test -n "$STRIP_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $STRIP_FOR_TARGET" >&5 +echo "${ECHO_T}$STRIP_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_STRIP_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in strip; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_STRIP_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -6386,69 +10429,81 @@ if test -z "$ac_cv_prog_STRIP_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6391: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_STRIP_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP_FOR_TARGET"; then ac_cv_prog_STRIP_FOR_TARGET="$STRIP_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_STRIP_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -STRIP_FOR_TARGET="$ac_cv_prog_STRIP_FOR_TARGET" +STRIP_FOR_TARGET=$ac_cv_prog_STRIP_FOR_TARGET if test -n "$STRIP_FOR_TARGET"; then - echo "$ac_t""$STRIP_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $STRIP_FOR_TARGET" >&5 +echo "${ECHO_T}$STRIP_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6422: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_STRIP_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP_FOR_TARGET"; then ac_cv_prog_STRIP_FOR_TARGET="$STRIP_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_STRIP_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -STRIP_FOR_TARGET="$ac_cv_prog_STRIP_FOR_TARGET" +STRIP_FOR_TARGET=$ac_cv_prog_STRIP_FOR_TARGET if test -n "$STRIP_FOR_TARGET"; then - echo "$ac_t""$STRIP_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $STRIP_FOR_TARGET" >&5 +echo "${ECHO_T}$STRIP_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_STRIP_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_STRIP_FOR_TARGET" ; then set dummy strip if test $build = $target ; then @@ -6456,6 +10511,8 @@ if test -z "$ac_cv_prog_STRIP_FOR_TARGET" ; then else STRIP_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + STRIP_FOR_TARGET="$ac_cv_prog_STRIP_FOR_TARGET" fi else @@ -6467,69 +10524,125 @@ fi if test -z "$ac_cv_path_WINDRES_FOR_TARGET" ; then if test -n "$with_build_time_tools"; then - echo $ac_n "checking for windres in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:6472: checking for windres in $with_build_time_tools" >&5 + echo "$as_me:$LINENO: checking for windres in $with_build_time_tools" >&5 +echo $ECHO_N "checking for windres in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/windres; then WINDRES_FOR_TARGET=`cd $with_build_time_tools && pwd`/windres ac_cv_path_WINDRES_FOR_TARGET=$WINDRES_FOR_TARGET - echo "$ac_t""$ac_cv_path_WINDRES_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $ac_cv_path_WINDRES_FOR_TARGET" >&5 +echo "${ECHO_T}$ac_cv_path_WINDRES_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi elif test $build != $host && test $have_gcc_for_target = yes; then WINDRES_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=windres` - test $WINDRES_FOR_TARGET=windres && WINDRES_FOR_TARGET= - ac_cv_path_WINDRES_FOR_TARGET=$WINDRES_FOR_TARGET + test $WINDRES_FOR_TARGET = windres && WINDRES_FOR_TARGET= + test -n "$WINDRES_FOR_TARGET" && ac_cv_path_WINDRES_FOR_TARGET=$WINDRES_FOR_TARGET fi fi -if test -z "$ac_cv_path_WINDRES_FOR_TARGET" ; then +if test -z "$ac_cv_path_WINDRES_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6490: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_WINDRES_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_WINDRES_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$WINDRES_FOR_TARGET" in - /*) + case $WINDRES_FOR_TARGET in + [\\/]* | ?:[\\/]*) ac_cv_path_WINDRES_FOR_TARGET="$WINDRES_FOR_TARGET" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_WINDRES_FOR_TARGET="$WINDRES_FOR_TARGET" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$gcc_cv_tool_dirs" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_WINDRES_FOR_TARGET="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $gcc_cv_tool_dirs +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_WINDRES_FOR_TARGET="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + ;; esac fi -WINDRES_FOR_TARGET="$ac_cv_path_WINDRES_FOR_TARGET" +WINDRES_FOR_TARGET=$ac_cv_path_WINDRES_FOR_TARGET + if test -n "$WINDRES_FOR_TARGET"; then - echo "$ac_t""$WINDRES_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $WINDRES_FOR_TARGET" >&5 +echo "${ECHO_T}$WINDRES_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_WINDRES_FOR_TARGET" ; then - if test -n "$with_build_time_tools"; then + + +if test -n "$WINDRES_FOR_TARGET"; then + ac_cv_prog_WINDRES_FOR_TARGET=$WINDRES_FOR_TARGET +elif test -n "$ac_cv_prog_WINDRES_FOR_TARGET"; then + WINDRES_FOR_TARGET=$ac_cv_prog_WINDRES_FOR_TARGET +fi + +if test -n "$ac_cv_prog_WINDRES_FOR_TARGET"; then for ncn_progname in windres; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:6527: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_WINDRES_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$WINDRES_FOR_TARGET"; then + ac_cv_prog_WINDRES_FOR_TARGET="$WINDRES_FOR_TARGET" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_WINDRES_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +WINDRES_FOR_TARGET=$ac_cv_prog_WINDRES_FOR_TARGET +if test -n "$WINDRES_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $WINDRES_FOR_TARGET" >&5 +echo "${ECHO_T}$WINDRES_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_WINDRES_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in windres; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_WINDRES_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -6539,69 +10652,81 @@ if test -z "$ac_cv_prog_WINDRES_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6544: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_WINDRES_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_WINDRES_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$WINDRES_FOR_TARGET"; then ac_cv_prog_WINDRES_FOR_TARGET="$WINDRES_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_WINDRES_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_WINDRES_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -WINDRES_FOR_TARGET="$ac_cv_prog_WINDRES_FOR_TARGET" +WINDRES_FOR_TARGET=$ac_cv_prog_WINDRES_FOR_TARGET if test -n "$WINDRES_FOR_TARGET"; then - echo "$ac_t""$WINDRES_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $WINDRES_FOR_TARGET" >&5 +echo "${ECHO_T}$WINDRES_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_WINDRES_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6575: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_WINDRES_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_WINDRES_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$WINDRES_FOR_TARGET"; then ac_cv_prog_WINDRES_FOR_TARGET="$WINDRES_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_WINDRES_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_WINDRES_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -WINDRES_FOR_TARGET="$ac_cv_prog_WINDRES_FOR_TARGET" +WINDRES_FOR_TARGET=$ac_cv_prog_WINDRES_FOR_TARGET if test -n "$WINDRES_FOR_TARGET"; then - echo "$ac_t""$WINDRES_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $WINDRES_FOR_TARGET" >&5 +echo "${ECHO_T}$WINDRES_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_WINDRES_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_WINDRES_FOR_TARGET" ; then set dummy windres if test $build = $target ; then @@ -6609,6 +10734,8 @@ if test -z "$ac_cv_prog_WINDRES_FOR_TARGET" ; then else WINDRES_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + WINDRES_FOR_TARGET="$ac_cv_prog_WINDRES_FOR_TARGET" fi else @@ -6618,15 +10745,18 @@ fi RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET" -echo $ac_n "checking where to find the target ar""... $ac_c" 1>&6 -echo "configure:6623: checking where to find the target ar" >&5 +echo "$as_me:$LINENO: checking where to find the target ar" >&5 +echo $ECHO_N "checking where to find the target ar... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$AR_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $AR_FOR_TARGET`" 1>&6 + ac_dir=`dirname $AR_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6634,32 +10764,41 @@ else *" binutils "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it AR_FOR_TARGET='$$r/$(HOST_SUBDIR)/binutils/ar' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$AR_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $AR_FOR_TARGET`" 1>&6 + ac_dir=`dirname $AR_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool AR_FOR_TARGET='$(AR)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target as""... $ac_c" 1>&6 -echo "configure:6656: checking where to find the target as" >&5 + +echo "$as_me:$LINENO: checking where to find the target as" >&5 +echo $ECHO_N "checking where to find the target as... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$AS_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $AS_FOR_TARGET`" 1>&6 + ac_dir=`dirname $AS_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6667,32 +10806,41 @@ else *" gas "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it AS_FOR_TARGET='$$r/$(HOST_SUBDIR)/gas/as-new' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$AS_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $AS_FOR_TARGET`" 1>&6 + ac_dir=`dirname $AS_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool AS_FOR_TARGET='$(AS)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target cc""... $ac_c" 1>&6 -echo "configure:6689: checking where to find the target cc" >&5 + +echo "$as_me:$LINENO: checking where to find the target cc" >&5 +echo $ECHO_N "checking where to find the target cc... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$CC_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $CC_FOR_TARGET`" 1>&6 + ac_dir=`dirname $CC_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6700,32 +10848,41 @@ else *" gcc "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it CC_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$CC_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $CC_FOR_TARGET`" 1>&6 + ac_dir=`dirname $CC_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool CC_FOR_TARGET='$(CC)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target c++""... $ac_c" 1>&6 -echo "configure:6722: checking where to find the target c++" >&5 + +echo "$as_me:$LINENO: checking where to find the target c++" >&5 +echo $ECHO_N "checking where to find the target c++... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$CXX_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $CXX_FOR_TARGET`" 1>&6 + ac_dir=`dirname $CXX_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6740,28 +10897,37 @@ else if test $ok = yes; then # An in-tree tool is available and we can use it CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/g++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$CXX_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $CXX_FOR_TARGET`" 1>&6 + ac_dir=`dirname $CXX_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool CXX_FOR_TARGET='$(CXX)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target c++ for libstdc++""... $ac_c" 1>&6 -echo "configure:6758: checking where to find the target c++ for libstdc++" >&5 + +echo "$as_me:$LINENO: checking where to find the target c++ for libstdc++" >&5 +echo $ECHO_N "checking where to find the target c++ for libstdc++... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$RAW_CXX_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $RAW_CXX_FOR_TARGET`" 1>&6 + ac_dir=`dirname $RAW_CXX_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6776,28 +10942,37 @@ else if test $ok = yes; then # An in-tree tool is available and we can use it RAW_CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$RAW_CXX_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $RAW_CXX_FOR_TARGET`" 1>&6 + ac_dir=`dirname $RAW_CXX_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool RAW_CXX_FOR_TARGET='$(CXX)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target dlltool""... $ac_c" 1>&6 -echo "configure:6794: checking where to find the target dlltool" >&5 + +echo "$as_me:$LINENO: checking where to find the target dlltool" >&5 +echo $ECHO_N "checking where to find the target dlltool... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$DLLTOOL_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $DLLTOOL_FOR_TARGET`" 1>&6 + ac_dir=`dirname $DLLTOOL_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6805,32 +10980,41 @@ else *" binutils "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it DLLTOOL_FOR_TARGET='$$r/$(HOST_SUBDIR)/binutils/dlltool' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$DLLTOOL_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $DLLTOOL_FOR_TARGET`" 1>&6 + ac_dir=`dirname $DLLTOOL_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool DLLTOOL_FOR_TARGET='$(DLLTOOL)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target gcc""... $ac_c" 1>&6 -echo "configure:6827: checking where to find the target gcc" >&5 + +echo "$as_me:$LINENO: checking where to find the target gcc" >&5 +echo $ECHO_N "checking where to find the target gcc... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$GCC_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $GCC_FOR_TARGET`" 1>&6 + ac_dir=`dirname $GCC_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6838,32 +11022,41 @@ else *" gcc "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it GCC_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$GCC_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $GCC_FOR_TARGET`" 1>&6 + ac_dir=`dirname $GCC_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool GCC_FOR_TARGET='$()' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target gcj""... $ac_c" 1>&6 -echo "configure:6860: checking where to find the target gcj" >&5 + +echo "$as_me:$LINENO: checking where to find the target gcj" >&5 +echo $ECHO_N "checking where to find the target gcj... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$GCJ_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $GCJ_FOR_TARGET`" 1>&6 + ac_dir=`dirname $GCJ_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6878,28 +11071,37 @@ else if test $ok = yes; then # An in-tree tool is available and we can use it GCJ_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/gcj -B$$r/$(HOST_SUBDIR)/gcc/' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$GCJ_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $GCJ_FOR_TARGET`" 1>&6 + ac_dir=`dirname $GCJ_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool GCJ_FOR_TARGET='$(GCJ)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target gfortran""... $ac_c" 1>&6 -echo "configure:6896: checking where to find the target gfortran" >&5 + +echo "$as_me:$LINENO: checking where to find the target gfortran" >&5 +echo $ECHO_N "checking where to find the target gfortran... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$GFORTRAN_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $GFORTRAN_FOR_TARGET`" 1>&6 + ac_dir=`dirname $GFORTRAN_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6914,28 +11116,37 @@ else if test $ok = yes; then # An in-tree tool is available and we can use it GFORTRAN_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/gfortran -B$$r/$(HOST_SUBDIR)/gcc/' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$GFORTRAN_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $GFORTRAN_FOR_TARGET`" 1>&6 + ac_dir=`dirname $GFORTRAN_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool GFORTRAN_FOR_TARGET='$(GFORTRAN)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target ld""... $ac_c" 1>&6 -echo "configure:6932: checking where to find the target ld" >&5 + +echo "$as_me:$LINENO: checking where to find the target ld" >&5 +echo $ECHO_N "checking where to find the target ld... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$LD_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $LD_FOR_TARGET`" 1>&6 + ac_dir=`dirname $LD_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6943,55 +11154,72 @@ else *" ld "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it LD_FOR_TARGET='$$r/$(HOST_SUBDIR)/ld/ld-new' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$LD_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $LD_FOR_TARGET`" 1>&6 + ac_dir=`dirname $LD_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool LD_FOR_TARGET='$(LD)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target lipo""... $ac_c" 1>&6 -echo "configure:6965: checking where to find the target lipo" >&5 + +echo "$as_me:$LINENO: checking where to find the target lipo" >&5 +echo $ECHO_N "checking where to find the target lipo... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$LIPO_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $LIPO_FOR_TARGET`" 1>&6 + ac_dir=`dirname $LIPO_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else if expr "x$LIPO_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $LIPO_FOR_TARGET`" 1>&6 + ac_dir=`dirname $LIPO_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool LIPO_FOR_TARGET='$(LIPO)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target nm""... $ac_c" 1>&6 -echo "configure:6988: checking where to find the target nm" >&5 + +echo "$as_me:$LINENO: checking where to find the target nm" >&5 +echo $ECHO_N "checking where to find the target nm... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$NM_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $NM_FOR_TARGET`" 1>&6 + ac_dir=`dirname $NM_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6999,32 +11227,41 @@ else *" binutils "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it NM_FOR_TARGET='$$r/$(HOST_SUBDIR)/binutils/nm-new' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$NM_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $NM_FOR_TARGET`" 1>&6 + ac_dir=`dirname $NM_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool NM_FOR_TARGET='$(NM)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target objdump""... $ac_c" 1>&6 -echo "configure:7021: checking where to find the target objdump" >&5 + +echo "$as_me:$LINENO: checking where to find the target objdump" >&5 +echo $ECHO_N "checking where to find the target objdump... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$OBJDUMP_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $OBJDUMP_FOR_TARGET`" 1>&6 + ac_dir=`dirname $OBJDUMP_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -7032,32 +11269,41 @@ else *" binutils "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it OBJDUMP_FOR_TARGET='$$r/$(HOST_SUBDIR)/binutils/objdump' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$OBJDUMP_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $OBJDUMP_FOR_TARGET`" 1>&6 + ac_dir=`dirname $OBJDUMP_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool OBJDUMP_FOR_TARGET='$(OBJDUMP)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target ranlib""... $ac_c" 1>&6 -echo "configure:7054: checking where to find the target ranlib" >&5 + +echo "$as_me:$LINENO: checking where to find the target ranlib" >&5 +echo $ECHO_N "checking where to find the target ranlib... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$RANLIB_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $RANLIB_FOR_TARGET`" 1>&6 + ac_dir=`dirname $RANLIB_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -7065,32 +11311,41 @@ else *" binutils "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it RANLIB_FOR_TARGET='$$r/$(HOST_SUBDIR)/binutils/ranlib' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$RANLIB_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $RANLIB_FOR_TARGET`" 1>&6 + ac_dir=`dirname $RANLIB_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool RANLIB_FOR_TARGET='$(RANLIB)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target strip""... $ac_c" 1>&6 -echo "configure:7087: checking where to find the target strip" >&5 + +echo "$as_me:$LINENO: checking where to find the target strip" >&5 +echo $ECHO_N "checking where to find the target strip... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$STRIP_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $STRIP_FOR_TARGET`" 1>&6 + ac_dir=`dirname $STRIP_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -7098,32 +11353,41 @@ else *" binutils "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it STRIP_FOR_TARGET='$$r/$(HOST_SUBDIR)/binutils/strip' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$STRIP_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $STRIP_FOR_TARGET`" 1>&6 + ac_dir=`dirname $STRIP_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool STRIP_FOR_TARGET='$(STRIP)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target windres""... $ac_c" 1>&6 -echo "configure:7120: checking where to find the target windres" >&5 + +echo "$as_me:$LINENO: checking where to find the target windres" >&5 +echo $ECHO_N "checking where to find the target windres... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$WINDRES_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $WINDRES_FOR_TARGET`" 1>&6 + ac_dir=`dirname $WINDRES_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -7131,27 +11395,33 @@ else *" binutils "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it WINDRES_FOR_TARGET='$$r/$(HOST_SUBDIR)/binutils/windres' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$WINDRES_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $WINDRES_FOR_TARGET`" 1>&6 + ac_dir=`dirname $WINDRES_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool WINDRES_FOR_TARGET='$(WINDRES)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi + # Certain tools may need extra flags. AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target} RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target} @@ -7176,17 +11446,17 @@ fi -echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:7181: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no -fi - -echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 +fi; +echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 if test "$USE_MAINTAINER_MODE" = yes; then @@ -7195,7 +11465,7 @@ if test "$USE_MAINTAINER_MODE" = yes; then else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= -fi +fi MAINT=$MAINTAINER_MODE_TRUE # --------------------- @@ -7210,26 +11480,101 @@ case $build in yes) stage1_cflags="-g -Wa,-J" ;; *) stage1_cflags="-g -J" ;; esac ;; - powerpc-*-darwin*) - # The spiffy cpp-precomp chokes on some legitimate constructs in GCC - # sources; use -no-cpp-precomp to get to GNU cpp. - # Apple's GCC has bugs in designated initializer handling, so disable - # that too. - stage1_cflags="-g -no-cpp-precomp -DHAVE_DESIGNATED_INITIALIZERS=0" - ;; esac +# This is aimed to mimic bootstrap with a non-GCC compiler to catch problems. +if test "$GCC" = yes; then + saved_CFLAGS="$CFLAGS" + + # Pass -fkeep-inline-functions for stage 1 if the GCC version supports it. + CFLAGS="$CFLAGS -fkeep-inline-functions" + echo "$as_me:$LINENO: checking whether -fkeep-inline-functions is supported" >&5 +echo $ECHO_N "checking whether -fkeep-inline-functions is supported... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#if (__GNUC__ < 3) \ + || (__GNUC__ == 3 && (__GNUC_MINOR__ < 3 \ + || (__GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ < 1))) +#error http://gcc.gnu.org/PR29382 +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; stage1_cflags="$stage1_cflags -fkeep-inline-functions" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + + CFLAGS="$saved_CFLAGS" +fi + + + +# Enable --enable-checking in stage1 of the compiler. +# Check whether --enable-stage1-checking or --disable-stage1-checking was given. +if test "${enable_stage1_checking+set}" = set; then + enableval="$enable_stage1_checking" + stage1_checking=--enable-checking=${enable_stage1_checking} +else + if test "x$enable_checking" = xno; then + stage1_checking=--enable-checking +else + stage1_checking=--enable-checking${enable_checking+=}$enable_checking +fi +fi; + # Enable -Werror in bootstrap stage2 and later. -# Change the default to "no" on release branches. # Check whether --enable-werror or --disable-werror was given. if test "${enable_werror+set}" = set; then enableval="$enable_werror" - : -else - enable_werror=yes -fi +else + if test -d ${srcdir}/gcc && test x"`cat $srcdir/gcc/DEV-PHASE`" = xexperimental; then + enable_werror=yes +else + enable_werror=no +fi +fi; case ${enable_werror} in yes) stage2_werror_flag="--enable-werror-always" ;; *) stage2_werror_flag="" ;; @@ -7237,13 +11582,14 @@ esac # Flags needed to enable html installing and building + # Check whether --with-datarootdir or --without-datarootdir was given. if test "${with_datarootdir+set}" = set; then withval="$with_datarootdir" datarootdir="\${prefix}/${withval}" else datarootdir="\${prefix}/share" -fi +fi; # Check whether --with-docdir or --without-docdir was given. @@ -7252,7 +11598,16 @@ if test "${with_docdir+set}" = set; then docdir="\${prefix}/${withval}" else docdir="\${datarootdir}/doc" -fi +fi; + + +# Check whether --with-pdfdir or --without-pdfdir was given. +if test "${with_pdfdir+set}" = set; then + withval="$with_pdfdir" + pdfdir="\${prefix}/${withval}" +else + pdfdir="\${docdir}" +fi; # Check whether --with-htmldir or --without-htmldir was given. @@ -7261,76 +11616,88 @@ if test "${with_htmldir+set}" = set; then htmldir="\${prefix}/${withval}" else htmldir="\${docdir}" -fi +fi; -trap '' 1 2 15 -cat > confcache <<\EOF + ac_config_files="$ac_config_files Makefile" +cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. # -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. # -EOF +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' fi -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. @@ -7341,13 +11708,13 @@ trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 cat >confdef2opt.sed <<\_ACEOF t clear : clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g @@ -7364,286 +11731,918 @@ DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed -# Without the "./", some shells look in PATH for config.status. +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + : ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS <&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. # Run this file to recreate the current configuration. -# This directory was configured as follows, -# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# $0 $ac_configure_args -# # Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. +# configure, is in config.log if it exists. -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## -trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@host@%$host%g -s%@host_alias@%$host_alias%g -s%@host_cpu@%$host_cpu%g -s%@host_vendor@%$host_vendor%g -s%@host_os@%$host_os%g -s%@target@%$target%g -s%@target_alias@%$target_alias%g -s%@target_cpu@%$target_cpu%g -s%@target_vendor@%$target_vendor%g -s%@target_os@%$target_os%g -s%@build@%$build%g -s%@build_alias@%$build_alias%g -s%@build_cpu@%$build_cpu%g -s%@build_vendor@%$build_vendor%g -s%@build_os@%$build_os%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@LN@%$LN%g -s%@LN_S@%$LN_S%g -s%@TOPLEVEL_CONFIGURE_ARGUMENTS@%$TOPLEVEL_CONFIGURE_ARGUMENTS%g -s%@build_subdir@%$build_subdir%g -s%@host_subdir@%$host_subdir%g -s%@target_subdir@%$target_subdir%g -s%@CC@%$CC%g -s%@GNATBIND@%$GNATBIND%g -s%@do_compare@%$do_compare%g -s%@gmplibs@%$gmplibs%g -s%@gmpinc@%$gmpinc%g -s%@stage1_languages@%$stage1_languages%g -s%@SYSROOT_CFLAGS_FOR_TARGET@%$SYSROOT_CFLAGS_FOR_TARGET%g -/@serialization_dependencies@/r $serialization_dependencies -s%@serialization_dependencies@%%g -/@host_makefile_frag@/r $host_makefile_frag -s%@host_makefile_frag@%%g -/@target_makefile_frag@/r $target_makefile_frag -s%@target_makefile_frag@%%g -/@alphaieee_frag@/r $alphaieee_frag -s%@alphaieee_frag@%%g -/@ospace_frag@/r $ospace_frag -s%@ospace_frag@%%g -s%@RPATH_ENVVAR@%$RPATH_ENVVAR%g -s%@tooldir@%$tooldir%g -s%@build_tooldir@%$build_tooldir%g -s%@CONFIGURE_GDB_TK@%$CONFIGURE_GDB_TK%g -s%@GDB_TK@%$GDB_TK%g -s%@INSTALL_GDB_TK@%$INSTALL_GDB_TK%g -s%@build_configargs@%$build_configargs%g -s%@build_configdirs@%$build_configdirs%g -s%@host_configargs@%$host_configargs%g -s%@configdirs@%$configdirs%g -s%@target_configargs@%$target_configargs%g -s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g -s%@config_shell@%$config_shell%g -s%@YACC@%$YACC%g -s%@BISON@%$BISON%g -s%@M4@%$M4%g -s%@LEX@%$LEX%g -s%@FLEX@%$FLEX%g -s%@MAKEINFO@%$MAKEINFO%g -s%@EXPECT@%$EXPECT%g -s%@RUNTEST@%$RUNTEST%g -s%@AR@%$AR%g -s%@AS@%$AS%g -s%@DLLTOOL@%$DLLTOOL%g -s%@LD@%$LD%g -s%@LIPO@%$LIPO%g -s%@NM@%$NM%g -s%@RANLIB@%$RANLIB%g -s%@STRIP@%$STRIP%g -s%@WINDRES@%$WINDRES%g -s%@OBJCOPY@%$OBJCOPY%g -s%@OBJDUMP@%$OBJDUMP%g -s%@CXX@%$CXX%g -s%@CFLAGS_FOR_BUILD@%$CFLAGS_FOR_BUILD%g -s%@CC_FOR_TARGET@%$CC_FOR_TARGET%g -s%@CXX_FOR_TARGET@%$CXX_FOR_TARGET%g -s%@GCC_FOR_TARGET@%$GCC_FOR_TARGET%g -s%@GCJ_FOR_TARGET@%$GCJ_FOR_TARGET%g -s%@GFORTRAN_FOR_TARGET@%$GFORTRAN_FOR_TARGET%g -s%@AR_FOR_TARGET@%$AR_FOR_TARGET%g -s%@AS_FOR_TARGET@%$AS_FOR_TARGET%g -s%@DLLTOOL_FOR_TARGET@%$DLLTOOL_FOR_TARGET%g -s%@LD_FOR_TARGET@%$LD_FOR_TARGET%g -s%@LIPO_FOR_TARGET@%$LIPO_FOR_TARGET%g -s%@NM_FOR_TARGET@%$NM_FOR_TARGET%g -s%@OBJDUMP_FOR_TARGET@%$OBJDUMP_FOR_TARGET%g -s%@RANLIB_FOR_TARGET@%$RANLIB_FOR_TARGET%g -s%@STRIP_FOR_TARGET@%$STRIP_FOR_TARGET%g -s%@WINDRES_FOR_TARGET@%$WINDRES_FOR_TARGET%g -s%@FLAGS_FOR_TARGET@%$FLAGS_FOR_TARGET%g -s%@RAW_CXX_FOR_TARGET@%$RAW_CXX_FOR_TARGET%g -s%@COMPILER_AS_FOR_TARGET@%$COMPILER_AS_FOR_TARGET%g -s%@COMPILER_LD_FOR_TARGET@%$COMPILER_LD_FOR_TARGET%g -s%@COMPILER_NM_FOR_TARGET@%$COMPILER_NM_FOR_TARGET%g -s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g -s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g -s%@MAINT@%$MAINT%g -s%@stage1_cflags@%$stage1_cflags%g -s%@stage2_werror_flag@%$stage2_werror_flag%g -s%@datarootdir@%$datarootdir%g -s%@docdir@%$docdir%g -s%@htmldir@%$htmldir%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix fi -EOF +DUALCASE=1; export DUALCASE # for MKS sh -cat >> $CONFIG_STATUS </dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi -CONFIG_FILES=\${CONFIG_FILES-"Makefile"} -EOF -cat >> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; esac - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' else - ac_dir_suffix= ac_dots= + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by $as_me, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + + + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@build_noncanonical@,$build_noncanonical,;t t +s,@host_noncanonical@,$host_noncanonical,;t t +s,@target_noncanonical@,$target_noncanonical,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@target@,$target,;t t +s,@target_cpu@,$target_cpu,;t t +s,@target_vendor@,$target_vendor,;t t +s,@target_os@,$target_os,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@LN@,$LN,;t t +s,@LN_S@,$LN_S,;t t +s,@TOPLEVEL_CONFIGURE_ARGUMENTS@,$TOPLEVEL_CONFIGURE_ARGUMENTS,;t t +s,@build_libsubdir@,$build_libsubdir,;t t +s,@build_subdir@,$build_subdir,;t t +s,@host_subdir@,$host_subdir,;t t +s,@target_subdir@,$target_subdir,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@CXX@,$CXX,;t t +s,@CXXFLAGS@,$CXXFLAGS,;t t +s,@ac_ct_CXX@,$ac_ct_CXX,;t t +s,@GNATBIND@,$GNATBIND,;t t +s,@ac_ct_GNATBIND@,$ac_ct_GNATBIND,;t t +s,@GNATMAKE@,$GNATMAKE,;t t +s,@ac_ct_GNATMAKE@,$ac_ct_GNATMAKE,;t t +s,@do_compare@,$do_compare,;t t +s,@gmplibs@,$gmplibs,;t t +s,@gmpinc@,$gmpinc,;t t +s,@stage1_languages@,$stage1_languages,;t t +s,@SYSROOT_CFLAGS_FOR_TARGET@,$SYSROOT_CFLAGS_FOR_TARGET,;t t +s,@RPATH_ENVVAR@,$RPATH_ENVVAR,;t t +s,@tooldir@,$tooldir,;t t +s,@build_tooldir@,$build_tooldir,;t t +s,@CONFIGURE_GDB_TK@,$CONFIGURE_GDB_TK,;t t +s,@GDB_TK@,$GDB_TK,;t t +s,@INSTALL_GDB_TK@,$INSTALL_GDB_TK,;t t +s,@build_configargs@,$build_configargs,;t t +s,@build_configdirs@,$build_configdirs,;t t +s,@host_configargs@,$host_configargs,;t t +s,@configdirs@,$configdirs,;t t +s,@target_configargs@,$target_configargs,;t t +s,@CC_FOR_BUILD@,$CC_FOR_BUILD,;t t +s,@config_shell@,$config_shell,;t t +s,@YACC@,$YACC,;t t +s,@BISON@,$BISON,;t t +s,@M4@,$M4,;t t +s,@LEX@,$LEX,;t t +s,@FLEX@,$FLEX,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@EXPECT@,$EXPECT,;t t +s,@RUNTEST@,$RUNTEST,;t t +s,@AR@,$AR,;t t +s,@AS@,$AS,;t t +s,@DLLTOOL@,$DLLTOOL,;t t +s,@LD@,$LD,;t t +s,@LIPO@,$LIPO,;t t +s,@NM@,$NM,;t t +s,@RANLIB@,$RANLIB,;t t +s,@STRIP@,$STRIP,;t t +s,@WINDRES@,$WINDRES,;t t +s,@OBJCOPY@,$OBJCOPY,;t t +s,@OBJDUMP@,$OBJDUMP,;t t +s,@CFLAGS_FOR_BUILD@,$CFLAGS_FOR_BUILD,;t t +s,@CC_FOR_TARGET@,$CC_FOR_TARGET,;t t +s,@CXX_FOR_TARGET@,$CXX_FOR_TARGET,;t t +s,@GCC_FOR_TARGET@,$GCC_FOR_TARGET,;t t +s,@GCJ_FOR_TARGET@,$GCJ_FOR_TARGET,;t t +s,@GFORTRAN_FOR_TARGET@,$GFORTRAN_FOR_TARGET,;t t +s,@AR_FOR_TARGET@,$AR_FOR_TARGET,;t t +s,@AS_FOR_TARGET@,$AS_FOR_TARGET,;t t +s,@DLLTOOL_FOR_TARGET@,$DLLTOOL_FOR_TARGET,;t t +s,@LD_FOR_TARGET@,$LD_FOR_TARGET,;t t +s,@LIPO_FOR_TARGET@,$LIPO_FOR_TARGET,;t t +s,@NM_FOR_TARGET@,$NM_FOR_TARGET,;t t +s,@OBJDUMP_FOR_TARGET@,$OBJDUMP_FOR_TARGET,;t t +s,@RANLIB_FOR_TARGET@,$RANLIB_FOR_TARGET,;t t +s,@STRIP_FOR_TARGET@,$STRIP_FOR_TARGET,;t t +s,@WINDRES_FOR_TARGET@,$WINDRES_FOR_TARGET,;t t +s,@RAW_CXX_FOR_TARGET@,$RAW_CXX_FOR_TARGET,;t t +s,@FLAGS_FOR_TARGET@,$FLAGS_FOR_TARGET,;t t +s,@COMPILER_AS_FOR_TARGET@,$COMPILER_AS_FOR_TARGET,;t t +s,@COMPILER_LD_FOR_TARGET@,$COMPILER_LD_FOR_TARGET,;t t +s,@COMPILER_NM_FOR_TARGET@,$COMPILER_NM_FOR_TARGET,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;t t +s,@stage1_cflags@,$stage1_cflags,;t t +s,@stage1_checking@,$stage1_checking,;t t +s,@stage2_werror_flag@,$stage2_werror_flag,;t t +s,@datarootdir@,$datarootdir,;t t +s,@docdir@,$docdir,;t t +s,@pdfdir@,$pdfdir,;t t +s,@htmldir@,$htmldir,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +/@serialization_dependencies@/r $serialization_dependencies +s,@serialization_dependencies@,,;t t +/@host_makefile_frag@/r $host_makefile_frag +s,@host_makefile_frag@,,;t t +/@target_makefile_frag@/r $target_makefile_frag +s,@target_makefile_frag@,,;t t +/@alphaieee_frag@/r $alphaieee_frag +s,@alphaieee_frag@,,;t t +/@ospace_frag@/r $ospace_frag +s,@ospace_frag@,,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out fi - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac +done +_ACEOF - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac +cat >>$CONFIG_STATUS <<\_ACEOF - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF - -exit 0 -EOF +{ (exit 0); exit 0; } +_ACEOF chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi diff --git a/configure.in b/configure.ac similarity index 80% rename from configure.in rename to configure.ac index b6ef515e01d..0b4fc3333f8 100644 --- a/configure.in +++ b/configure.ac @@ -1,5 +1,5 @@ -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +# 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -21,10 +21,27 @@ sinclude(config/acx.m4) AC_INIT(move-if-change) -AC_PREREQ(2.13) +AC_PREREQ(2.59) + +# Find the build, host, and target systems. +ACX_NONCANONICAL_BUILD +ACX_NONCANONICAL_HOST +ACX_NONCANONICAL_TARGET + +dnl Autoconf 2.5x and later will set a default program prefix if +dnl --target was used, even if it was the same as --host. Disable +dnl that behavior. This must be done before AC_CANONICAL_SYSTEM +dnl to take effect. +test "$host_noncanonical" = "$target_noncanonical" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_transform_name=s,y,y, + AC_CANONICAL_SYSTEM AC_ARG_PROGRAM +m4_pattern_allow([^AS_FOR_TARGET$])dnl + # Get 'install' or 'install-sh' and its variants. AC_PROG_INSTALL ACX_PROG_LN @@ -68,14 +85,25 @@ progname=$0 # if PWD already has a value, it is probably wrong. if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi -# Export original configure arguments for use by sub-configures. These -# will be expanded by make, so quote '$'. -tmp="$progname $@" -sed -e 's,\$,$$,g' < conftestsed.out -$tmp -EOF_SED -TOPLEVEL_CONFIGURE_ARGUMENTS=`cat conftestsed.out` -rm -f conftestsed.out +# Export original configure arguments for use by sub-configures. +# Quote arguments with shell meta charatcers. +TOPLEVEL_CONFIGURE_ARGUMENTS= +set -- "$progname" "$@" +for ac_arg +do + case "$ac_arg" in + *" "*|*" "*|*[[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\']]*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` + # if the argument is of the form -foo=baz, quote the baz part only + ac_arg=`echo "'$ac_arg'" | sed "s/^'\([[-a-zA-Z0-9]]*=\)/\\1'/"` ;; + *) ;; + esac + # Add the quoted argument to the list. + TOPLEVEL_CONFIGURE_ARGUMENTS="$TOPLEVEL_CONFIGURE_ARGUMENTS $ac_arg" +done +# Remove the initial space we just introduced and, as these will be +# expanded by make, quote '$'. +TOPLEVEL_CONFIGURE_ARGUMENTS=`echo "x$TOPLEVEL_CONFIGURE_ARGUMENTS" | sed -e 's/^x *//' -e 's,\\$,$$,g'` AC_SUBST(TOPLEVEL_CONFIGURE_ARGUMENTS) moveifchange=${srcdir}/move-if-change @@ -123,7 +151,7 @@ build_tools="build-texinfo build-byacc build-flex build-bison build-m4 build-fix # these libraries are used by various programs built for the host environment # -host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber" +host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber gmp mpfr" # these tools are built for the host environment # Note, the powerpc-eabi build depends on sim occurring before gdb in order to @@ -134,7 +162,6 @@ host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc sid sim gdb # libgcj represents the runtime libraries only used by gcj. libgcj="target-libffi \ - target-boehm-gc \ target-zlib \ target-qthreads \ target-libjava" @@ -142,14 +169,15 @@ libgcj="target-libffi \ # these libraries are built for the target environment, and are built after # the host libraries and the host tools (which may be a cross compiler) # -target_libraries="target-libiberty \ +target_libraries="target-libgcc \ + target-libiberty \ target-libgloss \ target-newlib \ target-libstdc++-v3 \ target-libmudflap \ target-libssp \ - target-libgcc-math \ target-libgfortran \ + target-boehm-gc \ ${libgcj} \ target-libobjc \ target-libada \ @@ -227,7 +255,7 @@ esac # Some tools are only suitable for building in a "native" situation. # Remove these if host!=target. -native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" +native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" # Similarly, some are only suitable for cross toolchains. # Remove these if host=target. @@ -278,9 +306,12 @@ case "${host}" in i[[3456789]]86-*-go32* | i[[3456789]]86-*-msdosdjgpp*) noconfigdirs="$noconfigdirs tcl tk expect dejagnu send-pr uudecode guile itcl gnuserv libffi" ;; + x86_64-*-mingw*) + noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool newlib" + ;; i[[3456789]]86-*-mingw32*) # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl gnuserv" - noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool" + noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool newlib" ;; i[[3456789]]86-*-beos*) noconfigdirs="$noconfigdirs tk itcl libgui gdb" @@ -313,18 +344,6 @@ AC_ARG_ENABLE(libssp, ENABLE_LIBSSP=$enableval, ENABLE_LIBSSP=yes) -# Set the default so we build libgcc-math for ix86 and x86_64 -AC_ARG_ENABLE(libgcc-math, -[ --enable-libgcc-math Builds libgcc-math directory],, -[ -case "${target}" in - i?86-* | x86_64-* ) - enable_libgcc_math=yes ;; - *) - enable_libgcc_math=no ;; -esac -]) - # Save it here so that, even in case of --enable-libgcj, if the Java # front-end isn't enabled, we still get libgcj disabled. libgcj_saved=$libgcj @@ -345,7 +364,7 @@ esac # Disable libmudflap on some systems. if test x$enable_libmudflap = x ; then case "${target}" in - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu) + *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc* | *-*-uclinux*) # Enable libmudflap by default in GNU and friends. ;; *-*-freebsd*) @@ -366,7 +385,7 @@ if test x$enable_libgomp = x ; then ;; *-*-netbsd* | *-*-freebsd* | *-*-openbsd*) ;; - *-*-solaris2* | *-*-sysv4* | *-*-irix* | *-*-osf* | *-*-hpux*) + *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11*) ;; *-*-darwin* | *-*-aix*) ;; @@ -381,7 +400,7 @@ case "${target}" in *-*-chorusos) noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" ;; - powerpc-*-darwin*) + powerpc-*-darwin* | i[[3456789]]86-*-darwin*) noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof" noconfigdirs="$noconfigdirs sim target-rda" ;; @@ -445,9 +464,6 @@ case "${target}" in *-*-vxworks*) noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty target-libstdc++-v3 ${libgcj}" ;; - m32c-*-*) - noconfigdirs="$noconfigdirs target-libstdc++-v3" - ;; alpha*-dec-osf*) # ld works, but does not support shared libraries. # newlib is not 64 bit ready. I'm not sure about fileutils. @@ -500,6 +516,9 @@ case "${target}" in arm*-*-linux-gnueabi) noconfigdirs="$noconfigdirs target-libffi target-qthreads" noconfigdirs="$noconfigdirs target-libjava target-libobjc" + case ${with_newlib} in + no) noconfigdirs="$noconfigdirs target-newlib target-libgloss" + esac ;; arm*-*-symbianelf*) noconfigdirs="$noconfigdirs ${libgcj} target-libiberty" @@ -523,7 +542,7 @@ case "${target}" in noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}" ;; bfin-*-*) - noconfigdirs="$noconfigdirs target-libgloss gdb" + noconfigdirs="$noconfigdirs gdb" if test x${is_cross_compiler} != xno ; then target_configdirs="${target_configdirs} target-bsp target-cygmon" fi @@ -587,6 +606,9 @@ case "${target}" in hppa*64*-*-*) noconfigdirs="$noconfigdirs ${libgcj}" ;; + hppa*-hp-hpux11*) + noconfigdirs="$noconfigdirs ld shellutils" + ;; hppa*-*-*) # According to Alexandre Oliva , libjava won't # build on HP-UX 10.20. @@ -628,32 +650,22 @@ case "${target}" in # 'target-newlib' will appear in skipdirs. ;; i[[3456789]]86-*-mingw32*) - target_configdirs="$target_configdirs target-mingw" - noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj}" - - # Can't build gdb for mingw32 if not native. - case "${host}" in - i[[3456789]]86-*-mingw32) ;; # keep gdb tcl tk expect etc. - *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl gnuserv" - ;; - esac + target_configdirs="$target_configdirs target-winsup" + noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}" + ;; + x86_64-*-mingw*) + target_configdirs="$target_configdirs target-winsup" + noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}" ;; *-*-cygwin*) target_configdirs="$target_configdirs target-libtermcap target-winsup" noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}" # always build newlib if winsup directory is present. - if test -d "$srcdir/winsup"; then + if test -d "$srcdir/winsup/cygwin"; then skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` elif test -d "$srcdir/newlib"; then - echo "Warning: winsup is missing so newlib can't be built." + echo "Warning: winsup/cygwin is missing so newlib can't be built." fi - - # Can't build gdb for Cygwin if not native. - case "${host}" in - *-*-cygwin*) ;; # keep gdb tcl tk expect etc. - *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl libgui gnuserv" - ;; - esac ;; i[[3456789]]86-moss-msdos | i[[3456789]]86-*-moss* | \ i[[3456789]]86-*-uwin* | i[[3456789]]86-*-interix* ) @@ -755,17 +767,11 @@ case "${target}" in # noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" ;; - mips*-dec-bsd*) - noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" - ;; mips*-*-bsd*) noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" ;; - mipstx39-*-*) - noconfigdirs="$noconfigdirs gprof ${libgcj}" # same as generic mips - ;; mips64*-*-linux*) - noconfigdirs="$noconfigdirs target-newlib ${libgcj}" + noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" ;; mips*-*-linux*) noconfigdirs="$noconfigdirs target-newlib target-libgloss" @@ -807,6 +813,9 @@ case "${target}" in ;; sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*) ;; + spu-*-*) + skipdirs="target-libssp" + ;; v810-*-*) noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}" ;; @@ -963,6 +972,8 @@ case "${host}" in ;; *-mingw32*) ;; + *-mingw64*) + ;; *-interix*) host_makefile_frag="config/mh-interix" ;; @@ -1033,119 +1044,158 @@ if test -z "${CC}" && test "${build}" = "${host}" ; then fi if test "${build}" != "${host}" ; then - # If we are doing a Canadian Cross, in which the host and build systems - # are not the same, we set reasonable default values for the tools. - - CC=${CC-${host_alias}-gcc} - CFLAGS=${CFLAGS-"-g -O2"} - CXX=${CXX-${host_alias}-c++} - CXXFLAGS=${CXXFLAGS-"-g -O2"} CC_FOR_BUILD=${CC_FOR_BUILD-gcc} - else - # Set reasonable default values for some tools even if not Canadian. - # Of course, these are different reasonable default values, originally - # specified directly in the Makefile. - # We don't export, so that autoconf can do its job. - # Note that all these settings are above the fragment inclusion point - # in Makefile.in, so can still be overridden by fragments. - # This is all going to change when we autoconfiscate... - CC_FOR_BUILD="\$(CC)" - AC_PROG_CC +fi - # We must set the default linker to the linker used by gcc for the correct - # operation of libtool. If LD is not defined and we are using gcc, try to - # set the LD default to the ld used by gcc. - if test -z "$LD"; then - if test "$GCC" = yes; then - case $build in - *-*-mingw*) - gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;; - *) - gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;; - esac - case $gcc_prog_ld in - # Accept absolute paths. - [[\\/]* | [A-Za-z]:[\\/]*)] - LD="$gcc_prog_ld" ;; - esac - fi +AC_PROG_CC +AC_PROG_CXX + +# We must set the default linker to the linker used by gcc for the correct +# operation of libtool. If LD is not defined and we are using gcc, try to +# set the LD default to the ld used by gcc. +if test -z "$LD"; then + if test "$GCC" = yes; then + case $build in + *-*-mingw*) + gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;; + *) + gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;; + esac + case $gcc_prog_ld in + # Accept absolute paths. + [[\\/]* | [A-Za-z]:[\\/]*)] + LD="$gcc_prog_ld" ;; + esac fi - - CXX=${CXX-"c++"} - CFLAGS=${CFLAGS-"-g"} - CXXFLAGS=${CXXFLAGS-"-g -O2"} fi ACX_PROG_GNAT ACX_PROG_CMP_IGNORE_INITIAL # Check for GMP and MPFR -gmplibs= +gmplibs="-lmpfr -lgmp" gmpinc= -have_gmp=yes +have_gmp=no + # Specify a location for mpfr # check for this first so it ends up on the link line before gmp. -AC_ARG_WITH(mpfr-dir, [ --with-mpfr-dir=PATH Specify source directory for MPFR library]) +AC_ARG_WITH(mpfr-dir, [ --with-mpfr-dir=PATH This option has been REMOVED], + AC_MSG_ERROR([The --with-mpfr-dir=PATH option has been removed. +Use --with-mpfr=PATH or --with-mpfr-include=PATH plus --with-mpfr-lib=PATH])) -if test "x$with_mpfr_dir" != x; then - gmpinc="-I$with_mpfr_dir" - gmplibs="$with_mpfr_dir/libmpfr.a" -else - gmplibs="-lmpfr" -fi - -AC_ARG_WITH(mpfr, [ --with-mpfr=PATH Specify directory for installed MPFR library]) +AC_ARG_WITH(mpfr, [ --with-mpfr=PATH Specify prefix directory for installed MPFR package + Equivalent to --with-mpfr-include=PATH/include + plus --with-mpfr-lib=PATH/lib]) +AC_ARG_WITH(mpfr_include, [ --with-mpfr-include=PATH + Specify directory for installed MPFR include files]) +AC_ARG_WITH(mpfr_lib, [ --with-mpfr-lib=PATH Specify the directory for the installed MPFR library]) if test "x$with_mpfr" != x; then gmplibs="-L$with_mpfr/lib $gmplibs" gmpinc="-I$with_mpfr/include" fi - -# Specify a location for gmp -AC_ARG_WITH(gmp-dir, [ --with-gmp-dir=PATH Specify source directory for GMP library]) - -if test "x$with_gmp_dir" != x; then - gmpinc="$gmpinc -I$with_gmp_dir" - if test -f "$with_gmp_dir/.libs/libgmp.a"; then - gmplibs="$gmplibs $with_gmp_dir/.libs/libgmp.a" - elif test -f "$with_gmp_dir/_libs/libgmp.a"; then - gmplibs="$gmplibs $with_gmp_dir/_libs/libgmp.a" - fi - # One of the later tests will catch the error if neither library is present. -else - gmplibs="$gmplibs -lgmp" +if test "x$with_mpfr_include" != x; then + gmpinc="-I$with_mpfr_include" +fi +if test "x$with_mpfr_lib" != x; then + gmplibs="-L$with_mpfr_lib $gmplibs" +fi +if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then + gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/.libs -L$$r/$(HOST_SUBDIR)/mpfr/_libs '"$gmplibs" + gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr '"$gmpinc" + # Do not test the mpfr version. Assume that it is sufficient, since + # it is in the source tree, and the library has not been built yet + # but it would be included on the link line in the version check below + # hence making the test fail. + have_gmp=yes fi -AC_ARG_WITH(gmp, [ --with-gmp=PATH Specify directory for installed GMP library]) +# Specify a location for gmp +AC_ARG_WITH(gmp-dir, [ --with-gmp-dir=PATH This option has been REMOVED], + AC_MSG_ERROR([The --with-gmp-dir=PATH option has been removed. +Use --with-gmp=PATH or --with-gmp-include=PATH plus --with-gmp-lib=PATH])) + +AC_ARG_WITH(gmp, [ --with-gmp=PATH Specify prefix directory for the installed GMP package + Equivalent to --with-gmp-include=PATH/include + plus --with-gmp-lib=PATH/lib]) +AC_ARG_WITH(gmp_include, [ --with-gmp-include=PATH Specify directory for installed GMP include files]) +AC_ARG_WITH(gmp_lib, [ --with-gmp-lib=PATH Specify the directory for the installed GMP library]) + if test "x$with_gmp" != x; then gmplibs="-L$with_gmp/lib $gmplibs" gmpinc="-I$with_gmp/include $gmpinc" fi +if test "x$with_gmp_include" != x; then + gmpinc="-I$with_gmp_include $gmpinc" +fi +if test "x$with_gmp_lib" != x; then + gmplibs="-L$with_gmp_lib $gmplibs" +fi +if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then + gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/.libs -L$$r/$(HOST_SUBDIR)/gmp/_libs '"$gmplibs" + gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp '"$gmpinc" + # Do not test the gmp version. Assume that it is sufficient, since + # it is in the source tree, and the library has not been built yet + # but it would be included on the link line in the version check below + # hence making the test fail. + have_gmp=yes +fi -saved_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS $gmpinc" -# Check GMP actually works -AC_MSG_CHECKING([for correct version of gmp.h]) -AC_TRY_COMPILE([#include "gmp.h"],[ -#if __GNU_MP_VERSION < 3 -choke me -#endif -], [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]); have_gmp=no]) +if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then + have_gmp=yes + saved_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $gmpinc" + # Check GMP actually works + AC_MSG_CHECKING([for correct version of gmp.h]) + AC_TRY_COMPILE([#include "gmp.h"],[ + #if __GNU_MP_VERSION < 4 || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR < 1) + choke me + #endif + ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no]) -if test x"$have_gmp" = xyes; then - AC_MSG_CHECKING([for MPFR]) - - saved_LIBS="$LIBS" - LIBS="$LIBS $gmplibs" - AC_TRY_LINK([#include -#include ], [mpfr_t n; mpfr_init(n);], - [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no]) - LIBS="$saved_LIBS" + if test x"$have_gmp" = xyes; then + saved_LIBS="$LIBS" + LIBS="$LIBS $gmplibs" + dnl MPFR 2.2.0 is acceptable but buggy, MPFR 2.2.1 is better. + AC_MSG_CHECKING([for correct version of mpfr.h]) + AC_TRY_LINK([#include + #include ],[ + #if MPFR_VERSION < MPFR_VERSION_NUM(2,2,0) + choke me + #endif + mpfr_t n; + mpfr_t x; + int t; + mpfr_init (n); + mpfr_init (x); + mpfr_atan2 (n, n, x, GMP_RNDN); + mpfr_erfc (n, x, GMP_RNDN); + mpfr_subnormalize (x, t, GMP_RNDN); + ], [AC_TRY_LINK([#include + #include ],[ + #if MPFR_VERSION < MPFR_VERSION_NUM(2,2,1) + choke me + #endif + mpfr_t n; mpfr_init(n); + ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])], + [AC_MSG_RESULT([no]); have_gmp=no]) + LIBS="$saved_LIBS" + fi CFLAGS="$saved_CFLAGS" + + if test x$have_gmp != xyes; then + AC_MSG_ERROR([Building GCC requires GMP 4.1+ and MPFR 2.2.1+. +Try the --with-gmp and/or --with-mpfr options to specify their locations. +Copies of these libraries' source code can be found at their respective +hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/. +See also http://gcc.gnu.org/install/prerequisites.html for additional info. +If you obtained GMP and/or MPFR from a vendor distribution package, make +sure that you have installed both the libraries and the header files. +They may be located in separate packages.]) + fi fi # Flags needed for both GMP and/or MPFR @@ -1153,8 +1203,7 @@ AC_SUBST(gmplibs) AC_SUBST(gmpinc) # By default, C is the only stage 1 language. -stage1_languages=c -AC_SUBST(stage1_languages) +stage1_languages=,c, # Figure out what language subdirectories are present. # Look if the user specified --enable-languages="..."; if not, use @@ -1216,9 +1265,9 @@ if test -d ${srcdir}/gcc; then esac done - new_enable_languages=c + new_enable_languages=,c, missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ ` - potential_languages=c + potential_languages=,c, for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do case ${lang_frag} in @@ -1232,70 +1281,81 @@ if test -d ${srcdir}/gcc; then language= target_libs= lang_dirs= - boot_language= - build_by_default= - need_gmp= + subdir_requires= + boot_language=no + build_by_default=yes . ${lang_frag} - potential_languages="${potential_languages},${language}" - # This is quite sensitive to the ordering of the case statement arms. - case ,${enable_languages},:${language}:${have_gnat}:${build_by_default} in - *::*:*) - echo "${lang_frag} doesn't set \$language." 1>&2 - exit 1 - ;; - *:ada:no:*) - # Ada was requested with no preexisting GNAT. Disable unconditionally. - add_this_lang=no - ;; - *,${language},*:*:*:*) + if test x${language} = x; then + echo "${lang_frag} doesn't set \$language." 1>&2 + exit 1 + fi + + case ,${enable_languages}, in + *,${language},*) # Language was explicitly selected; include it. add_this_lang=yes ;; - *,all,*:*:*:no) - # 'all' was selected, but this is not a default language - # so do not include it. - add_this_lang=no - ;; - *,all,*:*:*:*) - # 'all' was selected and this is a default language; include it. - add_this_lang=yes + *,all,*) + # 'all' was selected, select it if it is a default language + add_this_lang=${build_by_default} ;; *) add_this_lang=no ;; esac - # Disable languages that need GMP if it isn't available. - case ,${enable_languages},:${have_gmp}:${need_gmp} in - *,${language},*:no:yes) + # Disable languages that need other directories if these aren't available. + for i in $subdir_requires; do + test -f "$srcdir/gcc/$i/config-lang.in" && continue + case ,${enable_languages}, in + *,${language},*) + # Specifically requested language; tell them. + AC_MSG_ERROR([The gcc/$i directory contains parts of $language but is missing]) + ;; + *) + # Silently disable. + add_this_lang=unsupported + ;; + esac + done + + # Disable Ada if no preexisting GNAT is available. + case ,${enable_languages},:${language}:${have_gnat} in + *,${language},*:ada:no) # Specifically requested language; tell them. - AC_MSG_ERROR([GMP with MPFR support is required to build $language]) + AC_MSG_ERROR([GNAT is required to build $language]) ;; - *:no:yes) + *:ada:no) # Silently disable. - add_this_lang=no + add_this_lang=unsupported ;; esac # Disable a language that is unsupported by the target. case " $unsupported_languages " in *" $language "*) - add_this_lang=no + add_this_lang=unsupported ;; esac case $add_this_lang in - no) + unsupported) # Remove language-dependent dirs. eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\" ;; - *) - new_enable_languages="$new_enable_languages,$language" + no) + # Remove language-dependent dirs; still show language as supported. + eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\" + potential_languages="${potential_languages}${language}," + ;; + yes) + new_enable_languages="${new_enable_languages}${language}," + potential_languages="${potential_languages}${language}," missing_languages=`echo "$missing_languages" | sed "s/,$language,/,/"` case ${boot_language} in yes) # Add to (comma-separated) list of stage 1 languages. - stage1_languages="${stage1_languages},${language}" + stage1_languages="${stage1_languages}${language}," ;; esac ;; @@ -1304,18 +1364,56 @@ if test -d ${srcdir}/gcc; then esac done + AC_ARG_ENABLE(stage1-languages, +[ --enable-stage1-languages[=all] choose additional languages to build during + stage1. Mostly useful for compiler development.], + [case ,${enable_stage1_languages}, in + ,no,|,,) + # Set it to something that will have no effect in the loop below + enable_stage1_languages=c ;; + ,yes,) + enable_stage1_languages=`echo $new_enable_languages | \ + sed -e "s/^,//" -e "s/,$//" ` ;; + *,all,*) + enable_stage1_languages=`echo ,$enable_stage1_languages, | \ + sed -e "s/,all,/$new_enable_languages/" -e "s/^,//" -e "s/,$//" ` ;; + esac + + # Add "good" languages from enable_stage1_languages to stage1_languages, + # while "bad" languages go in missing_languages. Leave no duplicates. + for i in `echo $enable_stage1_languages | sed 's/,/ /g' `; do + case $potential_languages in + *,$i,*) + case $stage1_languages in + *,$i,*) ;; + *) stage1_languages="$stage1_languages$i," ;; + esac ;; + *) + case $missing_languages in + *,$i,*) ;; + *) missing_languages="$missing_languages$i," ;; + esac ;; + esac + done]) + + # Remove leading/trailing commas that were added for simplicity + potential_languages=`echo "$potential_languages" | sed -e "s/^,//" -e "s/,$//"` missing_languages=`echo "$missing_languages" | sed -e "s/^,//" -e "s/,$//"` + stage1_languages=`echo "$stage1_languages" | sed -e "s/^,//" -e "s/,$//"` + new_enable_languages=`echo "$new_enable_languages" | sed -e "s/^,//" -e "s/,$//"` + if test "x$missing_languages" != x; then AC_MSG_ERROR([ The following requested languages could not be built: ${missing_languages} -Recognised languages are: ${potential_languages}]) +Supported languages are: ${potential_languages}]) fi - if test "x$new_enable_languages" != "x$enable_languages"; then echo The following languages will be built: ${new_enable_languages} + enable_languages="$new_enable_languages" fi - enable_languages="$new_enable_languages" - ac_configure_args=`echo " $ac_configure_args" | sed -e 's/ --enable-languages=[[^ ]]*//' -e 's/$/ --enable-languages='"$enable_languages"/ ` + + AC_SUBST(stage1_languages) + ac_configure_args=`echo " $ac_configure_args" | sed -e "s/ '--enable-languages=[[^ ]]*'//g" -e "s/$/ '--enable-languages="$enable_languages"'/" ` fi # Handle --disable- generically. @@ -1326,6 +1424,29 @@ for dir in $configdirs $build_configdirs $target_configdirs ; do fi done +# Check for Boehm's garbage collector +AC_ARG_ENABLE(objc-gc, +[ --enable-objc-gc enable the use of Boehm's garbage collector with + the GNU Objective-C runtime.], +[case ,${enable_languages},:${enable_objc_gc}:${noconfigdirs} in + *,objc,*:*:yes:*target-boehm-gc*) + AC_MSG_ERROR([Boehm's garbage collector was requested yet not supported in this configuration]) + ;; +esac]) + +# Make sure we only build Boehm's garbage collector if required. +case ,${enable_languages},:${enable_objc_gc} in + *,objc,*:yes) + # Keep target-boehm-gc if requested for Objective-C. + ;; + *) + # Otherwise remove target-boehm-gc depending on target-libjava. + if echo " ${noconfigdirs} " | grep "target-libjava" >/dev/null 2>&1; then + noconfigdirs="$noconfigdirs target-boehm-gc" + fi + ;; +esac + # Remove the entries in $skipdirs and $noconfigdirs from $configdirs, # $build_configdirs and $target_configdirs. # If we have the source for $noconfigdirs entries, add them to $notsupp. @@ -1367,10 +1488,14 @@ done # Sometimes the tools are distributed with libiberty but with no other # libraries. In that case, we don't want to build target-libiberty. +# Don't let libgcc imply libiberty either. if test -n "${target_configdirs}" ; then + libgcc= others= for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do - if test "$i" != "libiberty" ; then + if test "$i" = "libgcc"; then + libgcc=target-libgcc + elif test "$i" != "libiberty" ; then if test -r $srcdir/$i/configure ; then others=yes; break; @@ -1378,7 +1503,7 @@ if test -n "${target_configdirs}" ; then fi done if test -z "${others}" ; then - target_configdirs= + target_configdirs=$libgcc fi fi @@ -1451,6 +1576,9 @@ case "$host" in enable_gdbtk=no ;; esac +# To find our prefix, in gcc_cv_tool_prefix. +ACX_TOOL_DIRS + copy_dirs= AC_ARG_WITH([build-sysroot], @@ -1470,11 +1598,8 @@ if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then exit 1 fi if test x"${with_headers}" != xyes ; then - case "${exec_prefixoption}" in - "") x=${prefix} ;; - *) x=${exec_prefix} ;; - esac - copy_dirs="${copy_dirs} ${with_headers} $x/${target_alias}/sys-include" + x=${gcc_cv_tool_prefix} + copy_dirs="${copy_dirs} ${with_headers} $x/${target_noncanonical}/sys-include" fi fi @@ -1489,12 +1614,9 @@ if test x"${with_libs}" != x && test x"${with_libs}" != xno ; then if test x"${with_libs}" != xyes ; then # Copy the libraries in reverse order, so that files in the first named # library override files in subsequent libraries. - case "${exec_prefixoption}" in - "") x=${prefix} ;; - *) x=${exec_prefix} ;; - esac + x=${gcc_cv_tool_prefix} for l in ${with_libs}; do - copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}" + copy_dirs="$l $x/${target_noncanonical}/lib ${copy_dirs}" done fi fi @@ -1617,6 +1739,12 @@ extra_nmflags_for_target= extra_ranlibflags_for_target= target_makefile_frag=/dev/null case "${target}" in + mep*-*-*) + target_makefile_frag="config/mt-mep" + ;; + spu-*-*) + target_makefile_frag="config/mt-spu" + ;; *-*-netware*) target_makefile_frag="config/mt-netware" ;; @@ -1691,7 +1819,7 @@ esac # Some systems (e.g., one of the i386-aix systems the gas testers are # using) don't handle "\$" correctly, so don't use it here. -tooldir='${exec_prefix}'/${target_alias} +tooldir='${exec_prefix}'/${target_noncanonical} build_tooldir=${tooldir} # Create a .gdbinit file which runs the one in srcdir @@ -1875,7 +2003,7 @@ for module in ${build_configdirs} ; do done for module in ${configdirs} ; do if test -z "${no_recursion}"; then - for file in stage*-${module}/Makefile ${module}/Makefile; do + for file in stage*-${module}/Makefile prev-${module}/Makefile ${module}/Makefile; do if test -f ${file}; then echo 1>&2 "*** removing ${file} to force reconfigure" rm -f ${file} @@ -1955,40 +2083,87 @@ serialization_dependencies=serdep.tmp AC_SUBST_FILE(serialization_dependencies) # Base args. Strip norecursion, cache-file, srcdir, host, build, -# target and nonopt. These are the ones we might not want to pass -# down to subconfigures. Also strip program-prefix, program-suffix, -# and program-transform-name, so that we can pass down a consistent -# program-transform-name. If autoconf has put single quotes around -# any of these arguments (because they contain shell metacharacters) -# then this will fail; in practice this only happens for -# --program-transform-name, so be sure to override --program-transform-name -# at the end of the argument list. -# These will be expanded by make, so quote '$'. -cat <<\EOF_SED > conftestsed -s/ --no[[^ ]]*/ /g -s/ --c[[a-z-]]*[[= ]][[^ ]]*//g -s/ --sr[[a-z-]]*[[= ]][[^ ]]*//g -s/ --ho[[a-z-]]*[[= ]][[^ ]]*//g -s/ --bu[[a-z-]]*[[= ]][[^ ]]*//g -s/ --t[[a-z-]]*[[= ]][[^ ]]*//g -s/ --program-[[pst]][[a-z-]]*[[= ]][[^ ]]*//g -s/ -cache-file[[= ]][[^ ]]*//g -s/ -srcdir[[= ]][[^ ]]*//g -s/ -host[[= ]][[^ ]]*//g -s/ -build[[= ]][[^ ]]*//g -s/ -target[[= ]][[^ ]]*//g -s/ -program-prefix[[= ]][[^ ]]*//g -s/ -program-suffix[[= ]][[^ ]]*//g -s/ -program-transform-name[[= ]][[^ ]]*//g -s/ [[^' -][^ ]*] / / -s/^ *//;s/ *$// -s,\$,$$,g -EOF_SED -sed -f conftestsed < conftestsed.out - ${ac_configure_args} -EOF_SED -baseargs=`cat conftestsed.out` -rm -f conftestsed conftestsed.out +# target, nonopt, and variable assignments. These are the ones we +# might not want to pass down to subconfigures. Also strip +# program-prefix, program-suffix, and program-transform-name, so that +# we can pass down a consistent program-transform-name. +baseargs= +keep_next=no +skip_next=no +eval "set -- $ac_configure_args" +for ac_arg +do + if test X"$skip_next" = X"yes"; then + skip_next=no + continue + fi + if test X"$keep_next" = X"yes"; then + case $ac_arg in + *\'*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + baseargs="$baseargs '$ac_arg'" + keep_next=no + continue + fi + + # Handle separated arguments. Based on the logic generated by + # autoconf 2.59. + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + separate_arg=no + ;; + -*) + separate_arg=yes + ;; + *) + separate_arg=no + ;; + esac + + case "$ac_arg" in + --no*) + continue + ;; + --c* | \ + --sr* | \ + --ho* | \ + --bu* | \ + --t* | \ + --program-* | \ + -cache_file* | \ + -srcdir* | \ + -host* | \ + -build* | \ + -target* | \ + -program-prefix* | \ + -program-suffix* | \ + -program-transform-name* ) + skip_next=$separate_arg + continue + ;; + -*) + # An option. Add it. + case $ac_arg in + *\'*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + baseargs="$baseargs '$ac_arg'" + keep_next=$separate_arg + ;; + *) + # Either a variable assignment, or a nonopt (triplet). Don't + # pass it down; let the Makefile handle this. + continue + ;; + esac +done +# Remove the initial space we just introduced and, as these will be +# expanded by make, quote '$'. +baseargs=`echo "x$baseargs" | sed -e 's/^x *//' -e 's,\\$,$$,g'` # Add in --program-transform-name, after --program-prefix and # --program-suffix have been applied to it. Autoconf has already @@ -2007,7 +2182,7 @@ baseargs="$baseargs --program-transform-name='${gcc_transform_name}'" # For the build-side libraries, we just need to pretend we're native, # and not use the same cache file. Multilibs are neither needed nor # desired. -build_configargs="--cache-file=../config.cache --build=${build_alias} --host=${build_alias} --target=${target_alias} ${baseargs}" +build_configargs="--cache-file=../config.cache ${baseargs}" # For host modules, accept cache file option, or specification as blank. case "${cache_file}" in @@ -2021,7 +2196,7 @@ esac # Host dirs don't like to share a cache file either, horribly enough. # This seems to be due to autoconf 2.5x stupidity. -host_configargs="--cache-file=./config.cache --build=${build_alias} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}" +host_configargs="--cache-file=./config.cache ${extra_host_args} ${baseargs}" target_configargs=${baseargs} @@ -2031,7 +2206,7 @@ target_configargs=${baseargs} # sorts of decisions they want to make on this basis. Please consider # this option to be deprecated. FIXME. if test x${is_cross_compiler} = xyes ; then - target_configargs="--with-cross-host=${host_alias} ${target_configargs}" + target_configargs="--with-cross-host=${host_noncanonical} ${target_configargs}" fi # Default to --enable-multilib. @@ -2057,7 +2232,7 @@ fi # Pass the appropriate --build, --host, --target and --cache-file arguments. # We need to pass --target, as newer autoconf's requires consistency # for target_alias and gcc doesn't manage it consistently. -target_configargs="--cache-file=./config.cache --build=${build_alias} --host=${target_alias} --target=${target_alias} ${target_configargs}" +target_configargs="--cache-file=./config.cache ${target_configargs}" FLAGS_FOR_TARGET= case " $target_configdirs " in @@ -2109,6 +2284,11 @@ case " $target_configdirs " in esac ;; esac +case "$target" in +*-mingw*) + # Can't be handled as Cygwin above since Mingw does not use newlib. + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/mingw -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/mingw/include -isystem $$s/winsup/w32api/include' ;; +esac # Allow the user to override the flags for # our build compiler if desired. @@ -2129,6 +2309,23 @@ if test "x${use_gnu_ld}" = x && FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(HOST_SUBDIR)/ld' fi +# Search for other target-specific linker scripts and such. +case "${target}" in + m32c-*-* ) + if test -d ${srcdir}/libgloss/m32c; then + # This is for crt0.o + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/libgloss/m32c' + # This is for r8c.ld + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/libgloss/m32c' + # This is for libnosys.a + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/libgloss/libnosys' + fi + ;; + mep*) + FLAGS_FOR_TARGET="$FLAGS_FOR_TARGET -mlibrary" + ;; +esac + # Makefile fragments. for frag in host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag; do @@ -2227,7 +2424,7 @@ esac AC_CHECK_PROGS(RUNTEST, runtest, runtest) case " $configdirs " in *" dejagnu "*) - test $host = $build && RUNTEST='$$r/$(HOST_SUBDIR)/dejagnu/runtest' + test $host = $build && RUNTEST='$$s/$(HOST_SUBDIR)/dejagnu/runtest' ;; esac @@ -2363,21 +2560,50 @@ case $build in yes) stage1_cflags="-g -Wa,-J" ;; *) stage1_cflags="-g -J" ;; esac ;; - powerpc-*-darwin*) - # The spiffy cpp-precomp chokes on some legitimate constructs in GCC - # sources; use -no-cpp-precomp to get to GNU cpp. - # Apple's GCC has bugs in designated initializer handling, so disable - # that too. - stage1_cflags="-g -no-cpp-precomp -DHAVE_DESIGNATED_INITIALIZERS=0" - ;; esac + +# This is aimed to mimic bootstrap with a non-GCC compiler to catch problems. +if test "$GCC" = yes; then + saved_CFLAGS="$CFLAGS" + + # Pass -fkeep-inline-functions for stage 1 if the GCC version supports it. + CFLAGS="$CFLAGS -fkeep-inline-functions" + AC_MSG_CHECKING([whether -fkeep-inline-functions is supported]) + AC_TRY_COMPILE([ +#if (__GNUC__ < 3) \ + || (__GNUC__ == 3 && (__GNUC_MINOR__ < 3 \ + || (__GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ < 1))) +#error http://gcc.gnu.org/PR29382 +#endif + ],, + [AC_MSG_RESULT([yes]); stage1_cflags="$stage1_cflags -fkeep-inline-functions"], + [AC_MSG_RESULT([no])]) + + CFLAGS="$saved_CFLAGS" +fi + AC_SUBST(stage1_cflags) +# Enable --enable-checking in stage1 of the compiler. +AC_ARG_ENABLE(stage1-checking, +[ --enable-stage1-checking[=all] choose additional checking for stage1 + of the compiler.], +[stage1_checking=--enable-checking=${enable_stage1_checking}], +[if test "x$enable_checking" = xno; then + stage1_checking=--enable-checking +else + stage1_checking=--enable-checking${enable_checking+=}$enable_checking +fi]) +AC_SUBST(stage1_checking) + # Enable -Werror in bootstrap stage2 and later. -# Change the default to "no" on release branches. AC_ARG_ENABLE(werror, [ --enable-werror enable -Werror in bootstrap stage2 and later], [], -[enable_werror=yes]) +[if test -d ${srcdir}/gcc && test x"`cat $srcdir/gcc/DEV-PHASE`" = xexperimental; then + enable_werror=yes +else + enable_werror=no +fi]) case ${enable_werror} in yes) stage2_werror_flag="--enable-werror-always" ;; *) stage2_werror_flag="" ;; @@ -2395,6 +2621,11 @@ AC_ARG_WITH(docdir, [docdir="\${prefix}/${withval}"], [docdir="\${datarootdir}/doc"]) +AC_ARG_WITH(pdfdir, +[ --with-pdfdir Install pdf in this directory.], +[pdfdir="\${prefix}/${withval}"], +[pdfdir="\${docdir}"]) + AC_ARG_WITH(htmldir, [ --with-htmldir Install html in this directory.], [htmldir="\${prefix}/${withval}"], @@ -2402,6 +2633,7 @@ AC_ARG_WITH(htmldir, AC_SUBST(datarootdir) AC_SUBST(docdir) +AC_SUBST(pdfdir) AC_SUBST(htmldir) AC_OUTPUT(Makefile) diff --git a/cpu/ChangeLog b/cpu/ChangeLog index c0019d8f1c8..1fa7b9be4ab 100644 --- a/cpu/ChangeLog +++ b/cpu/ChangeLog @@ -1,3 +1,39 @@ +2007-04-30 Mark Salter + + * frv.cpu (spr-names): Support new coprocessor SPR registers. + +2007-04-20 Nick Clifton + + * xc16x.cpu: Restore after accidentally overwriting this file with + xc16x.opc. + +2007-03-29 DJ Delorie + + * m32c.cpu (Imm-8-s4n): Fix print hook. + (Lab-24-8, Lab-32-8, Lab-40-8): Fix. + (arith-jnz-imm4-dst-defn): Make relaxable. + (arith-jnz16-imm4-dst-defn): Fix encodings. + +2007-03-20 DJ Delorie + + * m32c.cpu (f-dsp-40-u20, f-dsp-48-u20, Dsp-40-u20, Dsp-40-u20, + mem20): New. + (src16-16-20-An-relative-*): New. + (dst16-*-20-An-relative-*): New. + (dst16-16-16sa-*): New + (dst16-16-16ar-*): New + (dst32-16-16sa-Unprefixed-*): New + (jsri): Fix operands. + (setzx): Fix encoding. + +2007-03-08 Alan Modra + + * m32r.opc: Formatting. + +2006-05-22 Nick Clifton + + * iq2000.cpu: Fix include paths for iq2000m.cpu and iq10.cpu. + 2006-04-10 DJ Delorie * m32c.opc (parse_unsigned_bitbase): Take a new parameter which diff --git a/cpu/frv.cpu b/cpu/frv.cpu index 03f22a55358..bae036dbed8 100644 --- a/cpu/frv.cpu +++ b/cpu/frv.cpu @@ -2808,12 +2808,21 @@ (dbmr20 2084) (dbmr21 2085) (dbmr22 2086) (dbmr23 2087) (dbmr30 2088) (dbmr31 2089) (dbmr32 2090) (dbmr33 2091) - (cpcfr 2092) (cpcr 2093) (cpsr 2094) + (cpcfr 2304) (cpcr 2305) (cpsr 2306) (cptr 2307) + (cphsr0 2308) (cphsr1 2309) (cpesr0 2320) (cpesr1 2321) + (cpemr0 2322) (cpemr1 2323) - (cpesr0 2096) (cpesr1 2097) - (cpemr0 2098) (cpemr1 2099) + (iperr0 2324) (iperr1 2325) (ipjsr 2326) (ipjrr 2327) + (ipcsr0 2336) (ipcsr1 2337) (ipcwer0 2338) (ipcwer1 2339) + (ipcwr 2340) - (ihsr8 3848) + (mbhsr 2352) (mbssr 2353) (mbrsr 2354) (mbsdr 2355) + (mbrdr 2356) (mbsmr 2357) (mbstr0 2359) (mbstr1 2360) + + (slpr 2368) (sldr 2369) (slhsr 2370) (sltr 2371) + (slwr 2372) + + (ihsr8 3848) (ihsr9 3849) (ihsr10 3850) ) ) diff --git a/cpu/iq2000.cpu b/cpu/iq2000.cpu index e186c7b515b..acb2648e0ae 100644 --- a/cpu/iq2000.cpu +++ b/cpu/iq2000.cpu @@ -1173,10 +1173,7 @@ (if (keep-mach? (iq2000)) -(include "../../cpu/iq2000m.cpu")) +(include "iq2000m.cpu")) (if (keep-mach? (iq10)) -(include "../../cpu/iq10.cpu")) - - - +(include "iq10.cpu")) diff --git a/cpu/m32c.cpu b/cpu/m32c.cpu index a645a48b59b..69eec8275d9 100644 --- a/cpu/m32c.cpu +++ b/cpu/m32c.cpu @@ -624,6 +624,18 @@ (and USI (sll UHI value 16) #xff0000))) ; extract ) +(df f-dsp-40-u20 "20 bit unsigned" (all-isas) 40 20 UINT + ((value pc) (or USI + (or USI + (and (srl value 16) #x0000ff) + (and value #x00ff00)) + (and (sll value 16) #x0f0000))) ; insert + ((value pc) (or USI + (or USI + (and USI (srl UHI value 16) #x0000ff) + (and USI value #x00ff00)) + (and USI (sll UHI value 16) #x0f0000))) ; extract +) (df f-dsp-40-u24 "24 bit unsigned" (all-isas) 40 24 UINT ((value pc) (or USI (or USI @@ -649,6 +661,17 @@ ) ) +(dnmf f-dsp-48-u20 "20 bit unsigned" (all-isas) UINT + (f-dsp-48-u16 f-dsp-64-u8) + (sequence () ; insert + (set (ifield f-dsp-64-u8) (and (srl (ifield f-dsp-48-u20) 16) #x0f)) + (set (ifield f-dsp-48-u16) (and (ifield f-dsp-48-u20) #xffff)) + ) + (sequence () ; extract + (set (ifield f-dsp-48-u20) (or (and (ifield f-dsp-48-u16) #xffff) + (and (sll (ifield f-dsp-64-u8) 16) #x0f0000))) + ) +) (dnmf f-dsp-48-u24 "24 bit unsigned" (all-isas) UINT (f-dsp-48-u16 f-dsp-64-u8) (sequence () ; insert @@ -1877,6 +1900,10 @@ h-sint DFLT f-dsp-40-s16 ((parse "signed16")) () () ) +(define-full-operand Dsp-40-u20 "unsigned 20 bit displacement at offset 40 bits" (all-isas) + h-uint DFLT f-dsp-40-u20 + ((parse "unsigned20")) () () +) (define-full-operand Dsp-40-u24 "unsigned 24 bit displacement at offset 40 bits" (all-isas) h-uint DFLT f-dsp-40-u24 ((parse "unsigned24")) () () @@ -1897,6 +1924,10 @@ h-sint DFLT f-dsp-48-s16 ((parse "signed16")) () () ) +(define-full-operand Dsp-48-u20 "unsigned 24 bit displacement at offset 40 bits" (all-isas) + h-uint DFLT f-dsp-48-u20 + ((parse "unsigned24")) () () +) (define-full-operand Dsp-48-u24 "unsigned 24 bit displacement at offset 48 bits" (all-isas) h-uint DFLT f-dsp-48-u24 ((parse "unsigned24")) () () @@ -1908,7 +1939,7 @@ ) (define-full-operand Imm-8-s4n "negated 4 bit immediate at offset 8 bits" (all-isas) h-sint DFLT f-imm-8-s4 - ((parse "signed4n")) () () + ((parse "signed4n") (print "signed4n")) () () ) (define-full-operand Imm-sh-8-s4 "signed 4 bit shift immediate at offset 8 bits" (all-isas) h-shimm DFLT f-imm-8-s4 @@ -2115,9 +2146,9 @@ (dnop Lab-8-16 "16 bit label" (all-isas RELAX) h-iaddr f-lab-8-16) (dnop Lab-8-24 "24 bit label" (all-isas RELAX) h-iaddr f-lab-8-24) (dnop Lab-16-8 "8 bit label" (all-isas RELAX) h-iaddr f-lab-16-8) -(dnop Lab-24-8 "8 bit label" (all-isas) h-iaddr f-lab-24-8) -(dnop Lab-32-8 "8 bit label" (all-isas) h-iaddr f-lab-32-8) -(dnop Lab-40-8 "8 bit label" (all-isas) h-iaddr f-lab-40-8) +(dnop Lab-24-8 "8 bit label" (all-isas RELAX) h-iaddr f-lab-24-8) +(dnop Lab-32-8 "8 bit label" (all-isas RELAX) h-iaddr f-lab-32-8) +(dnop Lab-40-8 "8 bit label" (all-isas RELAX) h-iaddr f-lab-40-8) ;------------------------------------------------------------- ; Condition code bits @@ -2209,6 +2240,9 @@ (define-pmacro (mem16 mode address) (mem mode (and #xffff address))) +(define-pmacro (mem20 mode address) + (mem mode (and #xfffff address))) + (define-pmacro (mem32 mode address) (mem mode (and #xffffff address))) @@ -2441,6 +2475,19 @@ (getter (mem16 xmode (add Dsp-16-u16 Src16An))) (setter (set (mem16 xmode (add Dsp-16-u16 Src16An)) newval)) ) + (define-derived-operand + (name (.sym src16-16-20-An-relative- xmode)) + (comment (.str "m16c dsp:20[An] relative destination " xmode)) + (attrs (machine 16)) + (mode xmode) + (args (Src16An Dsp-16-u20)) + (syntax "${Dsp-16-u20}[$Src16An]") + (base-ifield f-8-4) + (encoding (+ (f-8-2 3) (f-10-1 0) Dsp-16-u20 Src16An)) + (ifield-assertion (andif (eq f-8-2 3) (eq f-10-1 0))) + (getter (mem20 xmode (add Dsp-16-u20 Src16An))) + (setter (set (mem20 xmode (add Dsp-16-u20 Src16An)) newval)) + ) ) ) @@ -3157,6 +3204,19 @@ (getter (mem16 xmode (add (.sym Dsp- offset -u16) Dst16An))) (setter (set (mem16 xmode (add (.sym Dsp- offset -u16) Dst16An)) newval)) ) + (define-derived-operand + (name (.sym dst16- offset -20-An-relative- xmode)) + (comment (.str "m16c dsp:20[An] relative destination " xmode)) + (attrs (machine 16)) + (mode xmode) + (args (Dst16An (.sym Dsp- offset -u20))) + (syntax (.str "${Dsp-" offset "-u20}[$Dst16An]")) + (base-ifield f-12-4) + (encoding (+ (f-12-2 3) (f-14-1 0) (.sym Dsp- offset -u20) Dst16An)) + (ifield-assertion (andif (eq f-12-2 3) (eq f-14-1 0))) + (getter (mem16 xmode (add (.sym Dsp- offset -u20) Dst16An))) + (setter (set (mem16 xmode (add (.sym Dsp- offset -u20) Dst16An)) newval)) + ) ) ) @@ -4727,6 +4787,25 @@ (.sym dst16-16-16-absolute- xmode) ) ) + (define-anyof-operand + (name (.sym dst16-16-16sa- xmode)) + (comment (.str "m16c destination operand of size " xmode " with additional fields at offset 16")) + (attrs (machine 16)) + (mode xmode) + (choices + (.sym dst16-16-16-SB-relative- xmode) + (.sym dst16-16-16-absolute- xmode) + ) + ) + (define-anyof-operand + (name (.sym dst16-16-20ar- xmode)) + (comment (.str "m16c destination operand of size " xmode " with additional fields at offset 16")) + (attrs (machine 16)) + (mode xmode) + (choices + (.sym dst16-16-20-An-relative- xmode) + ) + ) ) ) @@ -5095,6 +5174,17 @@ (.sym dst32-16-16-absolute-Unprefixed- xmode) ) ) + (define-anyof-operand + (name (.sym dst32-16-16sa-Unprefixed- xmode)) + (comment (.str "m32c destination operand of size " xmode " with additional fields at offset 16")) + (attrs (machine 32)) + (mode xmode) + (choices + (.sym dst32-16-16-SB-relative-Unprefixed- xmode) + (.sym dst32-16-16-FB-relative-Unprefixed- xmode) + (.sym dst32-16-16-absolute-Unprefixed- xmode) + ) + ) (define-anyof-operand (name (.sym dst32-16-24-Unprefixed- xmode)) (comment (.str "m32c destination operand of size " xmode " with additional fields at offset 16")) @@ -6591,7 +6681,7 @@ (define-pmacro (arith-jnz-imm4-dst-defn mach src dstgroup label mode wstr op encoding sem) (dni (.sym op mach wstr - imm4 - dstgroup) (.str op wstr " " mach "-imm4-" dstgroup "-" label "-" mode) - ((machine mach)) + (RL_JUMP RELAXABLE (machine mach)) (.str op wstr " #${" src "},${dst" mach "-" dstgroup "-" mode "},${" label "}") encoding (sem mode src (.sym dst mach - dstgroup - mode) label) @@ -6605,10 +6695,10 @@ (+ opc1 opc2 (f-7-1 wbit) (.sym Imm-8- i4n) (.sym dst16-basic- mode) Lab-16-8) sem) (arith-jnz-imm4-dst-defn 16 (.sym Imm-8- i4n) 16-16 Lab-32-8 mode wstr op - (+ opc1 opc2 (f-7-1 wbit) (.sym Imm-8- i4n) (.sym dst16-16-16- mode) Lab-16-8) + (+ opc1 opc2 (f-7-1 wbit) (.sym Imm-8- i4n) (.sym dst16-16-16- mode) Lab-32-8) sem) (arith-jnz-imm4-dst-defn 16 (.sym Imm-8- i4n) 16-8 Lab-24-8 mode wstr op - (+ opc1 opc2 (f-7-1 wbit) (.sym Imm-8- i4n) (.sym dst16-16-8- mode) Lab-16-8) + (+ opc1 opc2 (f-7-1 wbit) (.sym Imm-8- i4n) (.sym dst16-16-8- mode) Lab-24-8) sem) ) ) @@ -8246,28 +8336,27 @@ ) ) ; jsri.w dst (m16 #1 m32 #1)) +(jsri-defn w dst16-16-20ar-HI (f-0-4 #x7) (f-4-4 #xD) (f-8-4 #x3) jsr16-sem + dst32-16-24-Unprefixed-HI (f-0-4 #xC) (f-7-1 1) (f-10-2 #x1) (f-12-4 #xF) jsr32-sem 4) +(jsri-defn w dst16-16-16sa-HI (f-0-4 #x7) (f-4-4 #xD) (f-8-4 #x3) jsr16-sem + dst32-16-16sa-Unprefixed-HI (f-0-4 #xC) (f-7-1 1) (f-10-2 #x1) (f-12-4 #xF) jsr32-sem 4) (jsri-defn w dst16-16-8-HI (f-0-4 #x7) (f-4-4 #xD) (f-8-4 #x3) jsr16-sem dst32-16-8-Unprefixed-HI (f-0-4 #xC) (f-7-1 1) (f-10-2 #x1) (f-12-4 #xF) jsr32-sem 3) -(jsri-defn w dst16-16-16-HI (f-0-4 #x7) (f-4-4 #xD) (f-8-4 #x3) jsr16-sem - dst32-16-16-Unprefixed-HI (f-0-4 #xC) (f-7-1 1) (f-10-2 #x1) (f-12-4 #xF) jsr32-sem 4) (jsri-defn w dst16-basic-HI (f-0-4 #x7) (f-4-4 #xD) (f-8-4 #x3) jsr16-sem dst32-basic-Unprefixed-HI (f-0-4 #xC) (f-7-1 1) (f-10-2 #x1) (f-12-4 #xF) jsr32-sem 2) -(dni jsri32.w "jsr.w dst32-16-24-Unprefixed-HI" (RL_1ADDR (machine 32)) - ("jsri.w ${dst32-16-24-Unprefixed-HI}") - (+ (f-0-4 #xC) (f-7-1 1) dst32-16-24-Unprefixed-HI (f-10-2 #x1) (f-12-4 #xF)) - (jsr32-sem 6 dst32-16-24-Unprefixed-HI) - ()) ; jsri.a (m16 #2 m32 #2) +(jsri-defn a dst16-16-20ar-SI (f-0-4 #x7) (f-4-4 #xD) (f-8-4 #x1) jsr16-sem + dst32-16-24-Unprefixed-SI (f-0-4 #x9) (f-7-1 0) (f-10-2 #x0) (f-12-4 #x1) jsr32-sem 4) (jsri-defn a dst16-16-8-SI (f-0-4 #x7) (f-4-4 #xD) (f-8-4 #x1) jsr16-sem dst32-16-8-Unprefixed-SI (f-0-4 #x9) (f-7-1 0) (f-10-2 #x0) (f-12-4 #x1) jsr32-sem 3) -(jsri-defn a dst16-16-16-SI (f-0-4 #x7) (f-4-4 #xD) (f-8-4 #x1) jsr16-sem - dst32-16-16-Unprefixed-SI (f-0-4 #x9) (f-7-1 0) (f-10-2 #x0) (f-12-4 #x1) jsr32-sem 4) +(jsri-defn a dst16-16-16sa-SI (f-0-4 #x7) (f-4-4 #xD) (f-8-4 #x1) jsr16-sem + dst32-16-16sa-Unprefixed-SI (f-0-4 #x9) (f-7-1 0) (f-10-2 #x0) (f-12-4 #x1) jsr32-sem 4) (jsri-defn a dst16-basic-SI (f-0-4 #x7) (f-4-4 #xD) (f-8-4 #x1) jsr16-sem dst32-basic-Unprefixed-SI (f-0-4 #x9) (f-7-1 0) (f-10-2 #x0) (f-12-4 #x1) jsr32-sem 2) (dni jsri32.a "jsr.w dst32-16-24-Unprefixed-HI" (RL_1ADDR (machine 32)) - ("jsri.w ${dst32-16-24-Unprefixed-SI}") + ("jsri.a ${dst32-16-24-Unprefixed-SI}") (+ (f-0-4 #x9) (f-7-1 0) dst32-16-24-Unprefixed-SI (f-10-2 #x0) (f-12-4 #x1)) (jsr32-sem 6 dst32-16-24-Unprefixed-SI) ()) @@ -10233,7 +10322,7 @@ ()) (dni stzx16-imm8-imm8-abs16 "stzx #Imm8,#Imm8,abs16" ((machine 16)) ("stzx #${Imm-8-QI},#${Imm-32-QI},${Dsp-16-u16}") - (+ (f-0-4 #xD) (f-4-4 #xE) Imm-8-QI Dsp-16-u16 Imm-32-QI) + (+ (f-0-4 #xD) (f-4-4 #xF) Imm-8-QI Dsp-16-u16 Imm-32-QI) (stzx-sem QI Imm-8-QI Imm-32-QI (mem16 QI Dsp-16-u16)) ()) ; stzx.BW #imm,dst (m32) diff --git a/cpu/m32r.opc b/cpu/m32r.opc index ab69d078c86..c51078c3434 100644 --- a/cpu/m32r.opc +++ b/cpu/m32r.opc @@ -1,6 +1,6 @@ /* M32R opcode support. -*- C -*- - Copyright 1998, 1999, 2000, 2001, 2004, 2005 + Copyright 1998, 1999, 2000, 2001, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Red Hat Inc; developed under contract from @@ -126,7 +126,7 @@ parse_hi16 (CGEN_CPU_DESC cd, return MISSING_CLOSING_PARENTHESIS; ++*strp; if (errmsg == NULL - && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) + && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) { value >>= 16; value &= 0xffff; @@ -138,17 +138,17 @@ parse_hi16 (CGEN_CPU_DESC cd, { *strp += 6; errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_M32R_HI16_SLO, - & result_type, & value); + & result_type, & value); if (**strp != ')') return MISSING_CLOSING_PARENTHESIS; ++*strp; if (errmsg == NULL && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) - { - value += 0x8000; - value >>= 16; + { + value += 0x8000; + value >>= 16; value &= 0xffff; - } + } *valuep = value; return errmsg; } @@ -183,7 +183,7 @@ parse_slo16 (CGEN_CPU_DESC cd, ++*strp; if (errmsg == NULL && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) - value = ((value & 0xffff) ^ 0x8000) - 0x8000; + value = ((value & 0xffff) ^ 0x8000) - 0x8000; *valuep = value; return errmsg; } @@ -247,7 +247,7 @@ parse_ulo16 (CGEN_CPU_DESC cd, do \ { \ if (CGEN_BOOL_ATTR ((attrs), CGEN_OPERAND_HASH_PREFIX)) \ - (*info->fprintf_func) (info->stream, "#"); \ + (*info->fprintf_func) (info->stream, "#"); \ } \ while (0) @@ -284,7 +284,7 @@ my_print_insn (CGEN_CPU_DESC cd, /* Read the base part of the insn. */ status = (*info->read_memory_func) (pc - ((!big_p && (pc & 3) != 0) ? 2 : 0), - buf, buflen, info); + buf, buflen, info); if (status != 0) { (*info->memory_error_func) (status, pc, info); diff --git a/cpu/xc16x.cpu b/cpu/xc16x.cpu index 29eaff3f44b..5537094fc42 100644 --- a/cpu/xc16x.cpu +++ b/cpu/xc16x.cpu @@ -1,245 +1,3129 @@ -/* XC16X opcode support. -*- C -*- +; Infineon XC16X CPU description. -*- Scheme -*- +; +; Copyright 2006 Free Software Foundation, Inc. +; +; Contributed by KPIT Cummins Infosystems Ltd.; developed under contract +; from Infineon Systems, GMBH , Germany. +; +; 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 2 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, 51 Franklin Street - Fifth Floor, Boston, MA +; 02110-1301, USA. - Copyright 2006 Free Software Foundation, Inc. +(include "simplify.inc") - Contributed by KPIT Cummins Infosystems Ltd.; developed under contract - from Infineon Systems, GMBH , Germany. +; define-arch appears first - This file is part of the GNU Binutils. +(define-arch + (name xc16x) ; name of cpu family + (comment "Infineon XC16X") + (default-alignment aligned) + (insn-lsb0? #t) + (machs xc16x) + (isas xc16x) +) - 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 2 of the License, or - (at your option) any later version. +; Attributes. +; An attribute to describe which pipeline an insn runs in generally OS. +(define-attr + (for insn) + (type enum) + (name PIPE) + (comment "parallel execution pipeline selection") + (values NONE OS) +) - 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. +; Instruction set parameters. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ +(define-isa + (name xc16x) + (default-insn-bitsize 32) + (base-insn-bitsize 32) + (default-insn-word-bitsize 16) + (decode-assist (15 14 13 12)) + ; The XC16X fetches 1 insn at a time. + (liw-insns 1) + (parallel-insns 1) +) + +; Cpu family definitions. + +(define-cpu + ; cpu names must be distinct from the architecture name and machine names. + ; The "b" suffix stands for "base" and is the convention. + ; The "f" suffix stands for "family" and is the convention. + (name xc16xbf) + (comment "Infineon XC16X base family") + (endian little) + (insn-chunk-bitsize 32) + (word-bitsize 16) + (parallel-insns 1) +) + +(define-mach + (name xc16x) + (comment "Infineon XC16X cpu") + (cpu xc16xbf) +) + +; Model descriptions. + +(define-model + (name xc16x) (comment "XC16X") (attrs) + (mach xc16x) + + (pipeline p-mem "" () ((prefetch) (fetch) (decode) (address) (memory) (execute) (writeback))) + + ; `state' is a list of variables for recording model state + (state + ; bit mask of h-gr registers, =1 means value being loaded from memory + (h-gr UINT) + ) + + (unit u-exec "Execution Unit" () + 1 1 ; issue done + () ; state + ((dr INT -1) (sr INT -1)) ; inputs + ((dr INT -1)) ; outputs + () ; profile action (default) + ) + (unit u-cmp "Compare Unit" () + 1 1 ; issue done + () ; state + ((src1 INT -1) (src2 INT -1)) ; inputs + () ; outputs + () ; profile action (default) + ) + (unit u-cti "Jump & Call Unit" () + 1 1 ; issue done + () ; state + ((condbit) (sr INT -1)) ; inputs + ((pc)) ; outputs + () ; profile action (default) + ) + (unit u-mov "Data Movement Unit" () + 1 1 ; issue done + () ;state + ((dr INT -1) (sr INT -1)) ; inputs + ((dr INT -1)) ; output + () ; profile action (default) + ) + ) + +; Instruction fields. +; +; Attributes: +; PCREL-ADDR: pc relative value (for reloc and disassembly purposes) +; ABS-ADDR: absolute address (for reloc and disassembly purposes) +; RELOC: there is a relocation associated with this field (experiment) + +(define-attr + (for ifield operand) + (type boolean) + (name RELOC) + (comment "there is a reloc associated with this field (experiment)") +) + +(dnf f-op1 "op1" () 7 4) +(dnf f-op2 "op2" () 3 4) +(dnf f-condcode "condcode" () 7 4) ;condition code required in other jmps and calls +(dnf f-icondcode "indrct condcode" () 15 4) ;condition code required in other jmpi and calli +(dnf f-rcond "relative-cond" () 7 4) ;condition code required in JMPR +(dnf f-qcond "qbit" () 7 4) ;used in enum of bset/bclear macro +(dnf f-extccode "extended condcode" () 15 5) ;condition code required in other jmpa and calla +(dnf f-r0 "r0" () 9 2) ;required where 2 bit register used(only R0-R3) +(dnf f-r1 "r1" () 15 4) +(dnf f-r2 "r2" () 11 4) +(dnf f-r3 "r3" () 12 4) +(dnf f-r4 "r4" () 11 4) +(dnf f-uimm2 "uimm2" () 13 2) ;used for immediate data,eg in ADD,MOV insns +(dnf f-uimm3 "uimm3" () 10 3) ;used for immediate data,eg in ADD,SUB insns +(dnf f-uimm4 "uimm4" () 15 4) ;used for immediate data,eg in MOV insns +(dnf f-uimm7 "uimm7" (PCREL-ADDR RELOC) 15 7) ;used in TRAP +(dnf f-uimm8 "uimm8" () 23 8) ;used in immediate byte data,eg in ADDB,MOVB insns +(dnf f-uimm16 "uimm16" () 31 16) ;used for immediate word data +(dnf f-memory "memory" () 31 16) ; used for memory operands +(dnf f-memgr8 "memory" () 31 16) ; memory location of gr +(dnf f-rel8 "rel8" (PCREL-ADDR RELOC) 15 8) ;used in JMPR,CALLR +(dnf f-relhi8 "relhi8" (PCREL-ADDR RELOC) 23 8) ;used in JB,JBC,JNB,JNBS +(dnf f-reg8 "reg8" () 15 8) ;required where 8bit gp register used +(dnf f-regmem8 "regmem8" () 15 8) ;required where 8bit register used +(dnf f-regoff8 "regoff8" () 15 8) ;required for offset calc +(dnf f-reghi8 "reghi8" () 23 8) ;required where 8bit register number used +(dnf f-regb8 "regb8" () 15 8) ;required for byte registers RL0,RH0, till RL8,RH8 +(dnf f-seg8 "seg8" () 15 8) ;used as segment number in JMPS,CALLS +(dnf f-segnum8 "segnum8" () 23 8) ;used in EXTS,EXTSR +(dnf f-mask8 "mask8" () 23 8) ;used as mask in BFLDH,BFLDL insns +(dnf f-pagenum "page num" () 25 10);used in EXTP,EXTPR +(dnf f-datahi8 "datahi8" () 31 8) ;used for filling with const data +(dnf f-data8 "data8" () 23 8) ;used for filling with const data +(dnf f-offset16 "address offset16" (ABS-ADDR RELOC) 31 16) ;used in JMPS,JMPA,CALLA,CALLS +(dnf f-op-bit1 "gap of 1 bit" () 11 1) ;used for filling with const data +(dnf f-op-bit2 "gap of 2 bits" () 11 2) ;used for filling with const data +(dnf f-op-bit4 "gap of 4 bits" () 11 4) ;used for filling with const data +(dnf f-op-bit3 "gap of 3 bits" () 10 3) ;used in CALLA, JMPA +(dnf f-op-2bit "gap of 2 bits" () 10 2) ;used in CALLA +(dnf f-op-bitone "gap of 1 bit " () 10 1) ;used in JMPA +(dnf f-op-onebit "gap of 1 bit " () 9 1) ;used in JMPA +(dnf f-op-1bit "gap of 1 bit " () 8 1) ;used in JMPA, CALLA +(dnf f-op-lbit4 "gap of 4 bits" () 15 4) ;used for filling with const data +(dnf f-op-lbit2 "gap of 2 bits" () 15 2) ;used for filling with const data +(dnf f-op-bit8 "gap of 8 bits" () 31 8) ;used for filling with const data +(dnf f-op-bit16 "gap of 16 bits" () 31 16) ;used for filling with const data +(dnf f-qbit "qbit" () 7 4) ;used in bit field of bset/bclear +(dnf f-qlobit "qlobit" () 31 4) ;used for filling with const data +(dnf f-qhibit "qhibit" () 27 4) ;used for filling with const data +(dnf f-qlobit2 "qlobit2" () 27 2) ;used for filling with const data +(dnf f-pof "upof16" () 31 16) ; used for memory operands + +; Enums. +; insn-op1: bits 0-3 +(define-normal-insn-enum insn-op1 "insn format enums" () OP1_ f-op1 + ("0" "1" "2" "3" "4" "5" "6" "7" + "8" "9" "10" "11" "12" "13" "14" "15") +) + +; insn-op2: bits 4-7 +(define-normal-insn-enum insn-op2 "op2 enums" () OP2_ f-op2 + ("0" "1" "2" "3" "4" "5" "6" "7" + "8" "9" "10" "11" "12" "13" "14" "15") +) + +;/*for bclr/bset*/ +; insn-rcond: bits 0-3 +(define-normal-insn-enum insn-qcond "bit set/clear enums" () QBIT_ f-qcond + (("0" 0) ("1" 1) ("2" 2) ("3" 3) ("4" 4) ("5" 5) ("6" 6) ("7" 7) ("8" 8) ("9" 9) ("10" 10) + ("11" 11) ("12" 12) ("13" 13) ("14" 14) ("15" 15)) +) +;/************/ +; insn-rcond: bits 0-3 +(define-normal-insn-enum insn-rcond "relative jump condition code op2 enums" () COND_ f-rcond + (("UC" 0) ("NET" 1) ("Z" 2) ("NE_NZ" 3) ("V" 4) ("NV" 5) ("N" 6) ("NN" 7) + ("C" 8) ("NC" 9) ("SGT" 10) ("SLE" 11) ("SLT" 12) ("SGE" 13) ("UGT" 14) ("ULE" 15) + ("EQ" 2) ("NE" 3) ("ULT" 8) ("UGE" 9)) +) -/* This file is an addendum to xc16x.cpu. Heavy use of C code isn't - appropriate in .cpu files, so it resides here. This especially applies - to assembly/disassembly where parsing/printing can be quite involved. - Such things aren't really part of the specification of the cpu, per se, - so .cpu files provide the general framework and .opc files handle the - nitty-gritty details as necessary. - Each section is delimited with start and end markers. +; Hardware pieces. +; These entries list the elements of the raw hardware. +; They're also used to provide tables and other elements of the assembly +; language. - -opc.h additions use: "-- opc.h" - -opc.c additions use: "-- opc.c" - -asm.c additions use: "-- asm.c" - -dis.c additions use: "-- dis.c" - -ibd.h additions use: "-- ibd.h" */ - -/* -- opc.h */ +(dnh h-pc "program counter" (PC) (pc) () () ()) -#define CGEN_DIS_HASH_SIZE 8 -#define CGEN_DIS_HASH(buf,value) (((* (unsigned char*) (buf)) >> 3) % CGEN_DIS_HASH_SIZE) +(define-keyword + (name gr-names) + (print-name h-gr) + (prefix "") + (values (r0 0) (r1 1) (r2 2) (r3 3) (r4 4) (r5 5) (r6 6) (r7 7) + (r8 8) (r9 9) (r10 10) (r11 11) (r12 12) (r13 13) (r14 14) (r15 15)) -/* -- */ - -/* -- opc.c */ - -/* -- */ - -/* -- asm.c */ -/* Handle '#' prefixes (i.e. skip over them). */ +) +(define-hardware + (name h-gr) + (comment "general registers") + (attrs PROFILE CACHE-ADDR) + (type register HI (16)) + (indices extern-keyword gr-names) +) -static const char * -parse_hash (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, - const char **strp, - int opindex ATTRIBUTE_UNUSED, - long *valuep ATTRIBUTE_UNUSED) -{ - if (**strp == '#') - { - ++*strp; - return NULL; - } - return _("Missing '#' prefix"); -} +(define-keyword + (name ext-names) + (print-name h-ext) + (prefix "") + (values (0x1 0) (0x2 1) (0x3 2) (0x4 3) + ("1" 0) ("2" 1) ("3" 2) ("4" 3)) -/* Handle '.' prefixes (i.e. skip over them). */ +) -static const char * -parse_dot (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, - const char **strp, - int opindex ATTRIBUTE_UNUSED, - long *valuep ATTRIBUTE_UNUSED) -{ - if (**strp == '.') - { - ++*strp; - return NULL; - } - return _("Missing '.' prefix"); -} +(define-hardware + (name h-ext) + (comment "ext values") + (attrs PROFILE CACHE-ADDR) + (type register HI (8)) + (indices extern-keyword ext-names) +) -/* Handle 'pof:' prefixes (i.e. skip over them). */ +(define-keyword + (name psw-names) + (print-name h-psw) + (prefix "") + (values ("IEN" 136) ("r0.11" 240) ("r1.11" 241) ("r2.11" 242) ("r3.11" 243) ("r4.11" 244) + ("r5.11" 245) ("r6.11" 246) ("r7.11" 247) ("r8.11" 248) + ("r9.11" 249) ("r10.11" 250) ("r11.11" 251) ("r12.11" 252) + ("r13.11" 253) ("r14.11" 254) ("r15.11" 255)) +) -static const char * -parse_pof (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, - const char **strp, - int opindex ATTRIBUTE_UNUSED, - long *valuep ATTRIBUTE_UNUSED) -{ - if (strncasecmp (*strp, "pof:", 4) == 0) - { - *strp += 4; - return NULL; - } - return _("Missing 'pof:' prefix"); -} +(define-hardware + (name h-psw) + (comment "ext values") + (attrs PROFILE CACHE-ADDR) + (type register HI (1)) + (indices extern-keyword psw-names) +) -/* Handle 'pag:' prefixes (i.e. skip over them). */ +(define-keyword + (name grb-names) + (print-name h-grb) + (prefix "") + (values (rl0 0) (rh0 1) (rl1 2) (rh1 3) (rl2 4) (rh2 5) (rl3 6) (rh3 7) + (rl4 8) (rh4 9) (rl5 10) (rh5 11) (rl6 12) (rh6 13) (rl7 14) (rh7 15)) +) -static const char * -parse_pag (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, - const char **strp, - int opindex ATTRIBUTE_UNUSED, - long *valuep ATTRIBUTE_UNUSED) -{ - if (strncasecmp (*strp, "pag:", 4) == 0) - { - *strp += 4; - return NULL; - } - return _("Missing 'pag:' prefix"); -} +(define-hardware + (name h-grb) + (comment "general registers") + (attrs PROFILE CACHE-ADDR) + (type register QI (16)) + (indices extern-keyword grb-names) +) -/* Handle 'sof' prefixes (i.e. skip over them). */ +(define-keyword + (name conditioncode-names) + (print-name h-cc) + (prefix "") + (values (cc_UC 0) (cc_NET 1) (cc_Z 2) (cc_EQ 2) (cc_NZ 3) (cc_NE 3) (cc_V 4) (cc_NV 5) (cc_N 6) (cc_NN 7) (cc_ULT 8) (cc_UGE 9) + (cc_C 8) (cc_NC 9) (cc_SGT 10) (cc_SLE 11) (cc_SLT 12) (cc_SGE 13) (cc_UGT 14) + (cc_ULE 15)) +) +(define-hardware + (name h-cc) + (comment "condition codes") + (attrs PROFILE CACHE-ADDR) + (type register QI (16)) + (indices extern-keyword conditioncode-names) +) -static const char * -parse_sof (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, - const char **strp, - int opindex ATTRIBUTE_UNUSED, - long *valuep ATTRIBUTE_UNUSED) -{ - if (strncasecmp (*strp, "sof:", 4) == 0) - { - *strp += 4; - return NULL; - } - return _("Missing 'sof:' prefix"); -} +(define-keyword + (name extconditioncode-names) + (print-name h-ecc) + (prefix "") + (values(cc_UC 0) (cc_NET 2) (cc_Z 4) (cc_EQ 4) (cc_NZ 6) (cc_NE 6) (cc_V 8) (cc_NV 10) (cc_N 12) (cc_NN 14) (cc_ULT 16) (cc_UGE 18) (cc_C 16) (cc_NC 18) (cc_SGT 20) + (cc_SLE 22) (cc_SLT 24) (cc_SGE 26) (cc_UGT 28) (cc_ULE 30) (cc_nusr0 1) + (cc_nusr1 3) (cc_usr0 5) (cc_usr1 7)) +) +(define-hardware + (name h-ecc) + (comment "extended condition codes") + (attrs PROFILE CACHE-ADDR) + (type register QI (4)) + (indices extern-keyword extconditioncode-names) +) -/* Handle 'seg' prefixes (i.e. skip over them). */ +(define-keyword + (name grb8-names) + (print-name h-grb8) + (prefix "") + (values (dpp0 0) (dpp1 1) (dpp2 2) (dpp3 3) + (psw 136) (cp 8) (mdl 7) (mdh 6) + (mdc 135) (sp 9) (csp 4) (vecseg 137) + (stkov 10) (stkun 11) (cpucon1 12) (cpucon2 13) + (zeros 142) (ones 143) (spseg 134) (tfr 214) + (rl0 240) (rh0 241) (rl1 242) (rh1 243) (rl2 244) (rh2 245) (rl3 246) (rh3 247) + (rl4 248) (rh4 249) (rl5 250) (rh5 251) (rl6 252) (rh6 253) (rl7 254) (rh7 255)) +) -static const char * -parse_seg (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, - const char **strp, - int opindex ATTRIBUTE_UNUSED, - long *valuep ATTRIBUTE_UNUSED) -{ - if (strncasecmp (*strp, "seg:", 4) == 0) - { - *strp += 4; - return NULL; - } - return _("Missing 'seg:' prefix"); -} -/* -- */ - -/* -- dis.c */ +(define-hardware + (name h-grb8) + (comment "general byte registers") + (attrs PROFILE CACHE-ADDR) + (type register QI (36)) + (indices extern-keyword grb8-names) +) -#define CGEN_PRINT_NORMAL(cd, info, value, attrs, pc, length) \ - do \ - { \ - if (CGEN_BOOL_ATTR ((attrs), CGEN_OPERAND_DOT_PREFIX)) \ - info->fprintf_func (info->stream, "."); \ - if (CGEN_BOOL_ATTR ((attrs), CGEN_OPERAND_POF_PREFIX)) \ - info->fprintf_func (info->stream, "#pof:"); \ - if (CGEN_BOOL_ATTR ((attrs), CGEN_OPERAND_PAG_PREFIX)) \ - info->fprintf_func (info->stream, "#pag:"); \ - } \ - while (0) +(define-keyword + (name r8-names) + (print-name h-r8) + (prefix "") + (values (dpp0 0) (dpp1 1) (dpp2 2) (dpp3 3) + (psw 136) (cp 8) (mdl 7) (mdh 6) + (mdc 135) (sp 9) (csp 4) (vecseg 137) + (stkov 10) (stkun 11) (cpucon1 12) (cpucon2 13) + (zeros 142) (ones 143) (spseg 134) (tfr 214) + (r0 240) (r1 241) (r2 242) (r3 243) (r4 244) (r5 245) (r6 246) (r7 247) + (r8 248) (r9 249) (r10 250) (r11 251) (r12 252) (r13 253) (r14 254) (r15 255)) +) -/* Print a 'pof:' prefix to an operand. */ +(define-hardware + (name h-r8) + (comment "registers") + (attrs PROFILE CACHE-ADDR) + (type register HI (36)) + (indices extern-keyword r8-names) +) -static void -print_pof (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, - void * dis_info ATTRIBUTE_UNUSED, - long value ATTRIBUTE_UNUSED, - unsigned int attrs ATTRIBUTE_UNUSED, - bfd_vma pc ATTRIBUTE_UNUSED, - int length ATTRIBUTE_UNUSED) -{ -} +(define-keyword + (name regmem8-names) + (print-name h-regmem8) + (prefix "") + (values (dpp0 0) (dpp1 1) (dpp2 2) (dpp3 3) + (psw 136) (cp 8) (mdl 7) (mdh 6) + (mdc 135) (sp 9) (csp 4) (vecseg 137) + (stkov 10) (stkun 11) (cpucon1 12) (cpucon2 13) + (zeros 142) (ones 143) (spseg 134) (tfr 214) + (r0 240) (r1 241) (r2 242) (r3 243) (r4 244) (r5 245) (r6 246) (r7 247) + (r8 248) (r9 249) (r10 250) (r11 251) (r12 252) (r13 253) (r14 254) (r15 255)) +) -/* Print a 'pag:' prefix to an operand. */ +(define-hardware + (name h-regmem8) + (comment "registers") + (attrs ) + (type register HI (16)) + (indices extern-keyword regmem8-names) +) -static void -print_pag (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, - void * dis_info ATTRIBUTE_UNUSED, - long value ATTRIBUTE_UNUSED, - unsigned int attrs ATTRIBUTE_UNUSED, - bfd_vma pc ATTRIBUTE_UNUSED, - int length ATTRIBUTE_UNUSED) -{ -} +(define-keyword + (name regdiv8-names) + (print-name h-regdiv8) + (prefix "") + (values (r0 0) (r1 17) (r2 34) (r3 51) (r4 68) (r5 85) (r6 102) (r7 119) + (r8 136) (r9 153) (r10 170) (r11 187) (r12 204) (r13 221) (r14 238) (r15 255)) +) -/* Print a 'sof:' prefix to an operand. */ +(define-hardware + (name h-regdiv8) + (comment "division insn registers") + (attrs PROFILE CACHE-ADDR) + (type register HI (16)) + (indices extern-keyword regdiv8-names) +) -static void -print_sof (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, - void * dis_info, - long value ATTRIBUTE_UNUSED, - unsigned int attrs ATTRIBUTE_UNUSED, - bfd_vma pc ATTRIBUTE_UNUSED, - int length ATTRIBUTE_UNUSED) -{ - disassemble_info *info = (disassemble_info *) dis_info; +(define-keyword + (name reg0-name) + (print-name h-reg0) + (prefix "") + (values (0x1 1) (0x2 2) (0x3 3) (0x4 4) (0x5 5) (0x6 6) (0x7 7) (0x8 8) (0x9 9) (0xa 10) (0xb 11) + (0xc 12) (0xd 13) (0xe 14) (0xf 15) + ("1" 1) ("2" 2) ("3" 3) ("4" 4) ("5" 5) ("6" 6) ("7" 7) ("8" 8) ("9" 9) ("10" 10) ("11" 11) + ("12" 12) ("13" 13) ("14" 14) ("15" 15)) +) - info->fprintf_func (info->stream, "sof:"); -} +(define-hardware + (name h-r0) + (comment "for 4-bit data excuding 0") + (attrs PROFILE CACHE-ADDR) + (type register HI (30)) + (indices extern-keyword reg0-name) +) -/* Print a 'seg:' prefix to an operand. */ +(define-keyword + (name reg0-name1) + (print-name h-reg01) + (prefix "") + (values (0x1 1) (0x2 2) (0x3 3) (0x4 4) (0x5 5) (0x6 6) (0x7 7) + ("1" 1) ("2" 2) ("3" 3) ("4" 4) ("5" 5) ("6" 6) ("7" 7)) +) -static void -print_seg (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, - void * dis_info, - long value ATTRIBUTE_UNUSED, - unsigned int attrs ATTRIBUTE_UNUSED, - bfd_vma pc ATTRIBUTE_UNUSED, - int length ATTRIBUTE_UNUSED) -{ - disassemble_info *info = (disassemble_info *) dis_info; +(define-hardware + (name h-r01) + (comment "for 4-bit data excuding 0") + (attrs PROFILE CACHE-ADDR) + (type register HI (14)) + (indices extern-keyword reg0-name1) +) - info->fprintf_func (info->stream, "seg:"); -} +(define-keyword + (name regbmem8-names) + (print-name h-regbmem8) + (prefix "") + (values (dpp0 0) (dpp1 1) (dpp2 2) (dpp3 3) + (psw 136) (cp 8) (mdl 7) (mdh 6) + (mdc 135) (sp 9) (csp 4) (vecseg 137) + (stkov 10) (stkun 11) (cpucon1 12) (cpucon2 13) + (zeros 142) (ones 143) (spseg 134) (tfr 214) + (rl0 240) (rh0 241) (rl1 242) (rh1 243) (rl2 244) (rh2 245) (rl3 246) (rh3 247) + (rl4 248) (rh4 249) (rl5 250) (rh5 251) (rl6 252) (rh6 253) (rl7 254) (rh7 255)) +) -/* Print a '#' prefix to an operand. */ +(define-hardware + (name h-regbmem8) + (comment "registers") + (attrs PROFILE CACHE-ADDR) + (type register HI (36)) + (indices extern-keyword regbmem8-names) +) -static void -print_hash (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, - void * dis_info, - long value ATTRIBUTE_UNUSED, - unsigned int attrs ATTRIBUTE_UNUSED, - bfd_vma pc ATTRIBUTE_UNUSED, - int length ATTRIBUTE_UNUSED) -{ - disassemble_info *info = (disassemble_info *) dis_info; +(define-keyword + (name memgr8-names) + (print-name h-memgr8) + (prefix "") + (values (dpp0 65024) (dpp1 65026) (dpp2 65028) (dpp3 65030) + (psw 65296) (cp 65040) (mdl 65038) (mdh 65036) + (mdc 65294) (sp 65042) (csp 65032) (vecseg 65298) + (stkov 65044) (stkun 65046) (cpucon1 65048) (cpucon2 65050) + (zeros 65308) (ones 65310) (spseg 65292) (tfr 65452) ) +) - info->fprintf_func (info->stream, "#"); -} +(define-hardware + (name h-memgr8) + (comment "memory location of registers") + (attrs ) + (type register HI (20)) + (indices extern-keyword memgr8-names) +) -/* Print a '.' prefix to an operand. */ +(dsh h-cond "condition bit" () (register BI)) ;any bit from PSW while comparison +; This bit is part of the PSW register +(dsh h-cbit "carry bit" () (register BI)) -static void -print_dot (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, - void * dis_info ATTRIBUTE_UNUSED, - long value ATTRIBUTE_UNUSED, - unsigned int attrs ATTRIBUTE_UNUSED, - bfd_vma pc ATTRIBUTE_UNUSED, - int length ATTRIBUTE_UNUSED) -{ -} +(dsh h-sgtdis "segmentation enable bit" () (register BI)) ;0 means segmentation enabled -/* -- */ +;Instruction operands +; -- layer between the assembler and the raw hardware description +; -- the main means of manipulating instruction fields in the semantic code + +; XC16X specific operand attributes: + +(define-attr + (for operand) + (type boolean) + (name HASH-PREFIX) + (comment "immediates have an optional '#' prefix") +) + +(define-attr + (for operand) + (type boolean) + (name DOT-PREFIX) + (comment "bit addr have an optional '.' prefix") +) + +(define-attr + (for operand) + (type boolean) + (name POF-PREFIX) + (comment "page offset ") +) + +(define-attr + (for operand) + (type boolean) + (name PAG-PREFIX) + (comment "page ") +) + +(define-attr + (for operand) + (type boolean) + (name SOF-PREFIX) + (comment "segment offset selection") +) + +(define-attr + (for operand) + (type boolean) + (name SEG-PREFIX) + (comment "segment") +) + +(dnop sr "source register" () h-gr f-r2) +(dnop dr "destination register" () h-gr f-r1) +(dnop dri "destination register" () h-gr f-r4) +(dnop srb "source register" () h-grb f-r2) +(dnop drb "destination register" () h-grb f-r1) +(dnop sr2 "2 bit source register" () h-gr f-r0) +(dnop src1 "source register 1" () h-gr f-r1) +(dnop src2 "source register 2" () h-gr f-r2) +(dnop srdiv "source register 2" () h-regdiv8 f-reg8) +(dnop RegNam "PSW bits" () h-psw f-reg8) +(dnop uimm2 "2 bit unsigned number" (HASH-PREFIX) h-ext f-uimm2) +(dnop uimm3 "3 bit unsigned number" (HASH-PREFIX) h-r01 f-uimm3) +(dnop uimm4 "4 bit unsigned number" (HASH-PREFIX) h-uint f-uimm4) +(dnop uimm7 "7 bit trap number" (HASH-PREFIX) h-uint f-uimm7) +(dnop uimm8 "8 bit unsigned immediate" (HASH-PREFIX) h-uint f-uimm8) +(dnop uimm16 "16 bit unsigned immediate" (HASH-PREFIX) h-uint f-uimm16) +(dnop upof16 "16 bit unsigned immediate" (POF-PREFIX) h-addr f-memory) +(dnop reg8 "8 bit word register number" () h-r8 f-reg8) +(dnop regmem8 "8 bit word register number" () h-regmem8 f-regmem8) +(dnop regbmem8 "8 bit byte register number" () h-regbmem8 f-regmem8) +(dnop regoff8 "8 bit word register number" () h-r8 f-regoff8) +(dnop reghi8 "8 bit word register number" () h-r8 f-reghi8) +(dnop regb8 "8 bit byte register number" () h-grb8 f-regb8) +(dnop genreg "8 bit word register number" () h-r8 f-regb8) +(dnop seg "8 bit segment number" () h-uint f-seg8) +(dnop seghi8 "8 bit hi segment number" () h-uint f-segnum8) +(dnop caddr "16 bit address offset" () h-addr f-offset16) +(dnop rel "8 bit signed relative offset" () h-sint f-rel8) +(dnop relhi "hi 8 bit signed relative offset" () h-sint f-relhi8) +(dnop condbit "condition bit" (SEM-ONLY) h-cond f-nil) +(dnop bit1 "gap of 1 bit" () h-uint f-op-bit1) +(dnop bit2 "gap of 2 bits" () h-uint f-op-bit2) +(dnop bit4 "gap of 4 bits" () h-uint f-op-bit4) +(dnop lbit4 "gap of 4 bits" () h-uint f-op-lbit4) +(dnop lbit2 "gap of 2 bits" () h-uint f-op-lbit2) +(dnop bit8 "gap of 8 bits" () h-uint f-op-bit8) +(dnop u4 "gap of 4 bits" () h-r0 f-uimm4) +(dnop bitone "field of 1 bit" () h-uint f-op-onebit) +(dnop bit01 "field of 1 bit" () h-uint f-op-1bit) +(dnop cond "condition code" () h-cc f-condcode) +(dnop icond "indirect condition code" () h-cc f-icondcode) +(dnop extcond "extended condition code" () h-ecc f-extccode) +(dnop memory "16 bit memory" () h-addr f-memory) +(dnop memgr8 "16 bit memory" () h-memgr8 f-memgr8) +(dnop cbit "carry bit" (SEM-ONLY) h-cbit f-nil) +(dnop qbit "bit addr" (DOT-PREFIX) h-uint f-qbit) +(dnop qlobit "bit addr" (DOT-PREFIX) h-uint f-qlobit) +(dnop qhibit "bit addr" (DOT-PREFIX) h-uint f-qhibit) +(dnop mask8 "8 bit mask" (HASH-PREFIX) h-uint f-mask8) +(dnop masklo8 "8 bit mask" (HASH-PREFIX) h-uint f-datahi8) +(dnop pagenum "10 bit page number" (HASH-PREFIX) h-uint f-pagenum) +(dnop data8 "8 bit data" (HASH-PREFIX) h-uint f-data8) +(dnop datahi8 "8 bit data" (HASH-PREFIX) h-uint f-datahi8) +(dnop sgtdisbit "segmentation enable bit" (SEM-ONLY) h-sgtdis f-nil) +(dnop upag16 "16 bit unsigned immediate" (PAG-PREFIX) h-uint f-uimm16) +(dnop useg8 "8 bit segment " (SEG-PREFIX) h-uint f-seg8) +(dnop useg16 "16 bit address offset" (SEG-PREFIX) h-uint f-offset16) +(dnop usof16 "16 bit address offset" (SOF-PREFIX) h-uint f-offset16) + +; define hash operator +(define-operand (name hash) (comment "# prefix") (attrs) + (type h-sint) + (index f-nil) + (handlers (parse "hash") (print "hash")) +) + +; define dot operator +(define-operand (name dot) (comment ". prefix") (attrs) + (type h-sint) + (index f-nil) + (handlers (parse "dot") (print "dot")) +) + +; define pof operator +(define-operand (name pof) (comment "pof: prefix") (attrs) + (type h-sint) + (index f-nil) + (handlers (parse "pof") (print "pof")) +) + +; define pag operator +(define-operand (name pag) (comment "pag: prefix") (attrs) + (type h-sint) + (index f-nil) + (handlers (parse "pag") (print "pag")) +) + +; define sof operator +(define-operand (name sof) (comment "sof: prefix") (attrs) + (type h-sint) + (index f-nil) + (handlers (parse "sof") (print "sof")) +) + +; define seg operator +(define-operand (name segm) (comment "seg: prefix") (attrs) + (type h-sint) + (index f-nil) + (handlers (parse "seg") (print "seg")) +) + +; IDOC attribute for instruction documentation. +(define-attr + (for insn) + (type enum) + (name IDOC) + (comment "insn kind for documentation") + (attrs META) + (values + (MOVE - () "Data Movement") + (ALU - () "Arithmatic & logical") + (CMP - () "Compare") + (JMP - () "Jump & Call") + (MISC - () "Miscellaneous") + (SYSC - () "System control") + ) +) + +; Include the instruction set descriptions from their respective +; source files. + +;Arithmatic insns +;****************************************************************** + +;add/sub register and immediate +(define-pmacro (arithmetic16 name insn insn1 opc1 opc2 op1 op2 mode dir) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$"dir"$"op2) + (+ opc1 opc2 op1 op2) + (set mode op1 (insn1 mode op1 (mem HI op2))) + () + ) +) +(arithmetic16 addrpof add add OP1_0 OP2_2 reg8 upof16 HI "pof") +(arithmetic16 subrpof sub sub OP1_2 OP2_2 reg8 upof16 HI "pof") +(arithmetic16 addbrpof addb add OP1_0 OP2_3 regb8 upof16 QI "pof") +(arithmetic16 subbrpof subb sub OP1_2 OP2_3 regb8 upof16 QI "pof") +(arithmetic16 addrpag add add OP1_0 OP2_2 reg8 upag16 HI "pag") +(arithmetic16 subrpag sub sub OP1_2 OP2_2 reg8 upag16 HI "pag") +(arithmetic16 addbrpag addb add OP1_0 OP2_3 regb8 upag16 QI "pag") +(arithmetic16 subbrpag subb sub OP1_2 OP2_3 regb8 upag16 QI "pag") + +;add/sub register and immediate +(define-pmacro (arithmetic17 name insn insn1 opc1 opc2 op1 op2 mode dir) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$"dir"$"op2) + (+ opc1 opc2 op1 op2) + (set mode op1 (insn1 mode op1 (mem HI op2) cbit)) + () + ) +) +(arithmetic17 addcrpof addc addc OP1_1 OP2_2 reg8 upof16 HI "pof") +(arithmetic17 subcrpof subc subc OP1_3 OP2_2 reg8 upof16 HI "pof") +(arithmetic17 addcbrpof addcb addc OP1_1 OP2_3 regb8 upof16 QI "pof") +(arithmetic17 subcbrpof subcb subc OP1_3 OP2_3 regb8 upof16 QI "pof") +(arithmetic17 addcrpag addc addc OP1_1 OP2_2 reg8 upag16 HI "pag") +(arithmetic17 subcrpag subc subc OP1_3 OP2_2 reg8 upag16 HI "pag") +(arithmetic17 addcbrpag addcb addc OP1_1 OP2_3 regb8 upag16 QI "pag") +(arithmetic17 subcbrpag subcb subc OP1_3 OP2_3 regb8 upag16 QI "pag") + +;add/sub register and immediate +(define-pmacro (arithmetic18 name insn insn1 opc1 opc2 op1 op2 mode dir) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"dir"$"op1 ",$"op2) + (+ opc1 opc2 op2 op1) + (set (mem HI op1) (insn1 (mem HI op1) op2 )) + () + ) +) +(arithmetic18 addrpofr add add OP1_0 OP2_4 upof16 reg8 HI "pof") +(arithmetic18 subrpofr sub sub OP1_2 OP2_4 upof16 reg8 HI "pof") +(arithmetic18 addbrpofr addb add OP1_0 OP2_5 upof16 regb8 QI "pof") +(arithmetic18 subbrpofr subb sub OP1_2 OP2_5 upof16 regb8 QI "pof") + +;add/sub register and immediate +(define-pmacro (arithmetic19 name insn insn1 opc1 opc2 op1 op2 mode dir) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"dir"$"op1 ",$"op2) + (+ opc1 opc2 op2 op1) + (set (mem HI op1) (insn1 mode (mem HI op1) op2 cbit)) + () + ) +) +(arithmetic19 addcrpofr addc addc OP1_1 OP2_4 upof16 reg8 HI "pof") +(arithmetic19 subcrpofr subc subc OP1_3 OP2_4 upof16 reg8 HI "pof") +(arithmetic19 addcbrpofr addcb addc OP1_1 OP2_5 upof16 regb8 QI "pof") +(arithmetic19 subcbrpofr subcb subc OP1_3 OP2_5 upof16 regb8 QI "pof") + +;add/sub register and immediate +(define-pmacro (arithmetic20 name insn insn1 opc1 opc2 op1 op2 mode dir) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$hash$"dir"$"op2) + (+ opc1 opc2 op1 op2) + (set mode op1 (insn1 mode op1 op2)) + () + ) +) +(arithmetic20 addrhpof add add OP1_0 OP2_6 reg8 uimm16 HI "pof") +(arithmetic20 subrhpof sub sub OP1_2 OP2_6 reg8 uimm16 HI "pof") +(arithmetic20 addbrhpof add add OP1_0 OP2_6 reg8 uimm16 HI "pag") +(arithmetic20 subbrhpof sub sub OP1_2 OP2_6 reg8 uimm16 HI "pag") + +;add/sub register and immediate +(define-pmacro (arithmetic21 name insn insn1 opc1 opc2 op1 op2 mode dir) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$hash$"dir"$"op2) + (+ opc1 opc2 op1 (f-op-bit1 0) op2) + (set mode op1 (insn1 mode op1 op2)) + () + ) +) +(arithmetic21 addrhpof3 add add OP1_0 OP2_8 dr uimm3 HI "pof") +(arithmetic21 subrhpof3 sub sub OP1_2 OP2_8 dr uimm3 HI "pof") +(arithmetic21 addbrhpag3 addb add OP1_0 OP2_9 drb uimm3 QI "pag") +(arithmetic21 subbrhpag3 subb sub OP1_2 OP2_9 drb uimm3 QI "pag") +(arithmetic21 addrhpag3 add add OP1_0 OP2_8 dr uimm3 HI "pag") +(arithmetic21 subrhpag3 sub sub OP1_2 OP2_8 dr uimm3 HI "pag") +(arithmetic21 addbrhpof3 addb add OP1_0 OP2_9 drb uimm3 QI "pof") +(arithmetic21 subbrhpof3 subb sub OP1_2 OP2_9 drb uimm3 QI "pof") + +;add/sub register and immediate +(define-pmacro (arithmetic22 name insn insn1 opc1 opc2 op1 op2 mode dir) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$hash$"dir"$"op2) + (+ opc1 opc2 op1 op2 (f-op-bit8 0)) + (set mode op1 (insn1 mode op1 op2)) + () + ) +) +(arithmetic22 addrbhpof addb add OP1_0 OP2_7 regb8 uimm8 QI "pof") +(arithmetic22 subrbhpof subb sub OP1_2 OP2_7 regb8 uimm8 QI "pof") +(arithmetic22 addbrhpag addb add OP1_0 OP2_7 regb8 uimm8 QI "pag") +(arithmetic22 subbrhpag subb sub OP1_2 OP2_7 regb8 uimm8 QI "pag") + +;add/sub register and immediate +(define-pmacro (arithmetic23 name insn insn1 opc1 opc2 op1 op2 mode dir) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$hash$"dir"$"op2) + (+ opc1 opc2 op1 op2) + (set mode op1 (insn1 mode op1 op2 cbit)) + () + ) +) +(arithmetic23 addcrhpof addc addc OP1_1 OP2_6 reg8 uimm16 HI "pof") +(arithmetic23 subcrhpof subc subc OP1_3 OP2_6 reg8 uimm16 HI "pof") +(arithmetic23 addcbrhpof addc addc OP1_1 OP2_6 reg8 uimm16 HI "pag") +(arithmetic23 subcbrhpof subc subc OP1_3 OP2_6 reg8 uimm16 HI "pag") + +;add/sub register and immediate +(define-pmacro (arithmetic24 name insn insn1 opc1 opc2 op1 op2 mode dir) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$hash$"dir"$"op2) + (+ opc1 opc2 op1 (f-op-bit1 0) op2) + (set mode op1 (insn1 mode op1 op2 cbit)) + () + ) +) +(arithmetic24 addcrhpof3 addc addc OP1_1 OP2_8 dr uimm3 HI "pof") +(arithmetic24 subcrhpof3 subc subc OP1_3 OP2_8 dr uimm3 HI "pof") +(arithmetic24 addcbrhpag3 addcb addc OP1_1 OP2_9 drb uimm3 QI "pag") +(arithmetic24 subcbrhpag3 subcb subc OP1_3 OP2_9 drb uimm3 QI "pag") +(arithmetic24 addcrhpag3 addc addc OP1_1 OP2_8 dr uimm3 HI "pag") +(arithmetic24 subcrhpag3 subc subc OP1_3 OP2_8 dr uimm3 HI "pag") +(arithmetic24 addcbrhpof3 addcb addc OP1_1 OP2_9 drb uimm3 QI "pof") +(arithmetic24 subcbrhpof3 subcb subc OP1_3 OP2_9 drb uimm3 QI "pof") + +;add/sub register and immediate +(define-pmacro (arithmetic25 name insn insn1 opc1 opc2 op1 op2 mode dir) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$hash$"dir"$"op2) + (+ opc1 opc2 op1 op2 (f-op-bit8 0)) + (set mode op1 (insn1 mode op1 op2 cbit)) + () + ) +) +(arithmetic25 addcrbhpof addcb addc OP1_1 OP2_7 regb8 uimm8 QI "pof") +(arithmetic25 subcrbhpof subcb subc OP1_3 OP2_7 regb8 uimm8 QI "pof") +(arithmetic25 addcbrhpag addcb addc OP1_1 OP2_7 regb8 uimm8 QI "pag") +(arithmetic25 subcbrhpag subcb subc OP1_3 OP2_7 regb8 uimm8 QI "pag") + +;add/sub register and immediate +(define-pmacro (arithmetic10 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$hash$"op2) + (+ opc1 opc2 op1 (f-op-bit1 0) op2) + (set mode op1 (insn1 mode op1 op2)) + () + ) +) +(arithmetic10 addri add add OP1_0 OP2_8 dr uimm3 HI) +(arithmetic10 subri sub sub OP1_2 OP2_8 dr uimm3 HI) +(arithmetic10 addbri addb add OP1_0 OP2_9 drb uimm3 QI) +(arithmetic10 subbri subb sub OP1_2 OP2_9 drb uimm3 QI) + +;add/sub register and immediate +(define-pmacro (arithmetic11 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$hash$"op2) + (+ opc1 opc2 op1 op2) + (set mode op1 (insn1 mode op1 op2)) + () + ) +) +(arithmetic11 addrim add add OP1_0 OP2_6 reg8 uimm16 HI) +(arithmetic11 subrim sub sub OP1_2 OP2_6 reg8 uimm16 HI) + +;add/sub register and immediate +(define-pmacro (arithmetic12 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$hash$"op2) + (+ opc1 opc2 op1 op2 (f-op-bit8 0)) + (set mode op1 (insn1 mode op1 op2)) + () + ) +) +(arithmetic12 addbrim addb add OP1_0 OP2_7 regb8 uimm8 QI) +(arithmetic12 subbrim subb sub OP1_2 OP2_7 regb8 uimm8 QI) + +;add/sub register and immediate with carry +(define-pmacro (arithmetic13 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$hash$"op2) + (+ opc1 opc2 op1 (f-op-bit1 0) op2) + (set mode op1 (insn1 mode op1 op2 cbit)) + () + ) +) +(arithmetic13 addcri addc addc OP1_1 OP2_8 dr uimm3 HI) +(arithmetic13 subcri subc subc OP1_3 OP2_8 dr uimm3 HI) +(arithmetic13 addcbri addcb addc OP1_1 OP2_9 drb uimm3 QI) +(arithmetic13 subcbri subcb subc OP1_3 OP2_9 drb uimm3 QI) + +;add/sub register and immediate with carry +(define-pmacro (arithmetic14 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$hash$"op2) + (+ opc1 opc2 op1 op2) + (set mode op1 (insn1 mode op1 op2 cbit)) + () + ) +) +(arithmetic14 addcrim addc addc OP1_1 OP2_6 reg8 uimm16 HI) +(arithmetic14 subcrim subc subc OP1_3 OP2_6 reg8 uimm16 HI) + +;add/sub register and immediate with carry +(define-pmacro (arithmetic15 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$hash$"op2) + (+ opc1 opc2 op1 op2 (f-op-bit8 0)) + (set mode op1 (insn1 mode op1 op2 cbit)) + () + ) +) +(arithmetic15 addcbrim addcb addc OP1_1 OP2_7 regb8 uimm8 QI) +(arithmetic15 subcbrim subcb subc OP1_3 OP2_7 regb8 uimm8 QI) + + +;add/sub registers +(define-pmacro (arithmetic name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$"op2) + (+ opc1 opc2 op1 op2) + (set mode op1 (insn1 mode op1 op2)) + () + ) +) +(arithmetic addr add add OP1_0 OP2_0 dr sr HI) +(arithmetic subr sub sub OP1_2 OP2_0 dr sr HI) +(arithmetic addbr addb add OP1_0 OP2_1 drb srb QI) +(arithmetic subbr subb sub OP1_2 OP2_1 drb srb QI) + +;add/sub register and indirect memory +(define-pmacro (arithmetic1 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",[$"op2"]") + (+ opc1 opc2 op1 (f-op-bit2 2) op2) + (set mode op1 (insn1 mode op1 (mem HI op2))) + () + ) +) +(arithmetic1 add2 add add OP1_0 OP2_8 dr sr2 HI) +(arithmetic1 sub2 sub sub OP1_2 OP2_8 dr sr2 HI) +(arithmetic1 addb2 addb add OP1_0 OP2_9 drb sr2 QI) +(arithmetic1 subb2 subb sub OP1_2 OP2_9 drb sr2 QI) + +;add/sub register and indirect memory post increment +(define-pmacro (arithmetic2 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",[$"op2"+]") + (+ opc1 opc2 op1 (f-op-bit2 3) op2) + (sequence () + (set mode op1 (insn1 mode op1 (mem HI op2))) + (set HI op2 (add HI op2 (const 2))) + ) + () + ) +) +(arithmetic2 add2i add add OP1_0 OP2_8 dr sr2 HI) +(arithmetic2 sub2i sub sub OP1_2 OP2_8 dr sr2 HI) +(arithmetic2 addb2i addb add OP1_0 OP2_9 drb sr2 QI) +(arithmetic2 subb2i subb sub OP1_2 OP2_9 drb sr2 QI) + +;add/sub registers with carry +(define-pmacro (arithmetic3 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$"op2) + (+ opc1 opc2 op1 op2) + (set mode op1 (insn1 mode op1 op2 cbit)) + () + ) +) +(arithmetic3 addcr addc addc OP1_1 OP2_0 dr sr HI) +(arithmetic3 subcr subc subc OP1_3 OP2_0 dr sr HI) +(arithmetic3 addbcr addcb addc OP1_1 OP2_1 drb srb QI) +(arithmetic3 subbcr subcb subc OP1_3 OP2_1 drb srb QI) + + +;add/sub register and indirect memory +(define-pmacro (arithmetic4 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",[$"op2"]") + (+ opc1 opc2 op1 (f-op-bit2 2) op2) + (set mode op1 (insn1 mode op1 (mem HI op2) cbit)) + () + ) +) +(arithmetic4 addcr2 addc addc OP1_1 OP2_8 dr sr2 HI) +(arithmetic4 subcr2 subc subc OP1_3 OP2_8 dr sr2 HI) +(arithmetic4 addbcr2 addcb addc OP1_1 OP2_9 drb sr2 QI) +(arithmetic4 subbcr2 subcb subc OP1_3 OP2_9 drb sr2 QI) + +;add/sub register and indirect memory post increment +(define-pmacro (arithmetic5 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",[$"op2"+]") + (+ opc1 opc2 op1 (f-op-bit2 3) op2) + (sequence () + (set mode op1 (insn1 mode op1 (mem HI op2) cbit)) + (set HI op2 (add HI op2 (const 2))) + ) + () + ) +) +(arithmetic5 addcr2i addc addc OP1_1 OP2_8 dr sr2 HI) +(arithmetic5 subcr2i subc subc OP1_3 OP2_8 dr sr2 HI) +(arithmetic5 addbcr2i addcb addc OP1_1 OP2_9 drb sr2 QI) +(arithmetic5 subbcr2i subcb subc OP1_3 OP2_9 drb sr2 QI) + +;add/sub register and direct memory +(define-pmacro (arithmetic6 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$"op2) + (+ opc1 opc2 op1 op2) + (set mode op1 (insn1 mode op1 op2)) + () + ) +) + +;add/sub register and direct memory +(define-pmacro (arithmetic7 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$"op2) + (+ opc1 opc2 op2 op1) + (set (mem HI op1) (insn1 (mem HI op1) op2)) + () + ) +) +(arithmetic6 addrm2 add add OP1_0 OP2_2 regmem8 memgr8 HI) +(arithmetic7 addrm3 add add OP1_0 OP2_4 memgr8 regmem8 HI) +(arithmetic6 addrm add add OP1_0 OP2_2 reg8 memory HI) +(arithmetic7 addrm1 add add OP1_0 OP2_4 memory reg8 HI) +(arithmetic6 subrm3 sub sub OP1_2 OP2_2 regmem8 memgr8 HI) +(arithmetic7 subrm2 sub sub OP1_2 OP2_4 memgr8 regmem8 HI) +(arithmetic6 subrm1 sub sub OP1_2 OP2_2 reg8 memory HI) +(arithmetic7 subrm sub sub OP1_2 OP2_4 memory reg8 HI) +(arithmetic6 addbrm2 addb add OP1_0 OP2_3 regbmem8 memgr8 QI) +(arithmetic7 addbrm3 addb add OP1_0 OP2_5 memgr8 regbmem8 QI) +(arithmetic6 addbrm addb add OP1_0 OP2_3 regb8 memory QI) +(arithmetic7 addbrm1 addb add OP1_0 OP2_5 memory regb8 QI) +(arithmetic6 subbrm3 subb sub OP1_2 OP2_3 regbmem8 memgr8 QI) +(arithmetic7 subbrm2 subb sub OP1_2 OP2_5 memgr8 regbmem8 QI) +(arithmetic6 subbrm1 subb sub OP1_2 OP2_3 regb8 memory QI) +(arithmetic7 subbrm subb sub OP1_2 OP2_5 memory regb8 QI) + +;add/sub registers with carry +(define-pmacro (arithmetic8 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$"op2) + (+ opc1 opc2 op1 op2) + (set mode op1 (insn1 mode op1 op2 cbit)) + () + ) +) + +;add/sub registers with carry +(define-pmacro (arithmetic9 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$"op2) + (+ opc1 opc2 op2 op1) + (set (mem HI op1) (insn1 (mem HI op1) op2 cbit)) + () + ) +) +(arithmetic8 addcrm2 addc addc OP1_1 OP2_2 regmem8 memgr8 HI) +(arithmetic9 addcrm3 addc addc OP1_1 OP2_4 memgr8 regmem8 HI) +(arithmetic8 addcrm addc addc OP1_1 OP2_2 reg8 memory HI) +(arithmetic9 addcrm1 addc addc OP1_1 OP2_4 memory reg8 HI) +(arithmetic8 subcrm3 subc subc OP1_3 OP2_2 regmem8 memgr8 HI) +(arithmetic9 subcrm2 subc subc OP1_3 OP2_4 memgr8 regmem8 HI) +(arithmetic8 subcrm1 subc subc OP1_3 OP2_2 reg8 memory HI) +(arithmetic9 subcrm subc subc OP1_3 OP2_4 memory reg8 HI) +(arithmetic8 addcbrm2 addcb addc OP1_1 OP2_3 regbmem8 memgr8 QI) +(arithmetic9 addcbrm3 addcb addc OP1_1 OP2_5 memgr8 regbmem8 QI) +(arithmetic8 addcbrm addcb addc OP1_1 OP2_3 regb8 memory QI) +(arithmetic9 addcbrm1 addcb addc OP1_1 OP2_5 memory regb8 QI) +(arithmetic8 subcbrm3 subcb subc OP1_3 OP2_3 regbmem8 memgr8 QI) +(arithmetic9 subcbrm2 subcb subc OP1_3 OP2_5 memgr8 regbmem8 QI) +(arithmetic8 subcbrm1 subcb subc OP1_3 OP2_3 regb8 memory QI) +(arithmetic9 subcbrm subcb subc OP1_3 OP2_5 memory regb8 QI) + +; MUL Rwn,Rwm +(dni muls "signed multiplication" + ((PIPE OS) (IDOC ALU)) + "mul $src1,$src2" + (+ OP1_0 OP2_11 src1 src2) + (reg SI h-md 0) + () +) +; MULU Rwn,Rwm +(dni mulu "unsigned multiplication" + ((PIPE OS) (IDOC ALU)) + "mulu $src1,$src2" + (+ OP1_1 OP2_11 src1 src2) + (reg SI h-md 0) + () +) +; DIV Rwn +(dni div "16-by-16 signed division" + ((PIPE OS) (IDOC ALU)) + "div $srdiv" + (+ OP1_4 OP2_11 srdiv ) + (sequence () + (set HI (reg HI h-cr 6) (div HI (reg HI h-cr 6) srdiv)) + (set HI (reg HI h-cr 7) (mod HI (reg HI h-cr 6) srdiv)) + ) + () +) +; DIVL Rwn +(dni divl "32-by16 signed division" + ((PIPE OS) (IDOC ALU)) + "divl $srdiv" + (+ OP1_6 OP2_11 srdiv ) + (sequence () + (set HI (reg HI h-cr 6) (div SI (reg SI h-md 0) srdiv)) + (set HI (reg HI h-cr 7) (mod SI (reg SI h-md 0) srdiv)) + ) + () +) +; DIVLU Rwn +(dni divlu "32-by16 unsigned division" + ((PIPE OS) (IDOC ALU)) + "divlu $srdiv" + (+ OP1_7 OP2_11 srdiv ) + (sequence () + (set HI (reg HI h-cr 6) (udiv SI (reg SI h-md 0) srdiv)) + (set HI (reg HI h-cr 7) (umod SI (reg SI h-md 0) srdiv)) + ) + () +) +; DIVU Rwn +(dni divu "16-by-16 unsigned division" + ((PIPE OS) (IDOC ALU)) + "divu $srdiv" + (+ OP1_5 OP2_11 srdiv ) + (sequence () + (set HI (reg HI h-cr 6) (udiv HI (reg HI h-cr 6) srdiv)) + (set HI (reg HI h-cr 7) (umod HI (reg HI h-cr 6) srdiv)) + ) + () +) + +;Integer one's complement +; CPL Rwn +(dni cpl "Integer Ones complement" + ((PIPE OS) (IDOC MISC)) + "cpl $dr" + (+ OP1_9 OP2_1 dr (f-op-bit4 0)) + (set dr (inv HI dr)) + () +) + +;Bytes one's complement +; CPLB Rbn +(dni cplb "Byte Ones complement" + ((PIPE OS) (IDOC MISC)) + "cplb $drb" + (+ OP1_11 OP2_1 drb (f-op-bit4 0)) + (set drb (inv QI drb)) + () +) +;Integer two's complement +; NEG Rwn +(dni neg "Integer two's complement" + ((PIPE OS) (IDOC MISC)) + "neg $dr" + (+ OP1_8 OP2_1 dr (f-op-bit4 0)) + (set dr (neg HI dr)) + () +) +;Bytes two's complement +; NEGB Rbn +(dni negb "byte twos complement" + ((PIPE OS) (IDOC MISC)) + "negb $drb" + (+ OP1_10 OP2_1 drb (f-op-bit4 0)) + (set drb (neg QI drb)) + () +) + +;**************************************************************** +;logical insn +;**************************************************************** +;and/or/xor registers +(define-pmacro (logical name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "logical" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$"op2) + (+ opc1 opc2 op1 op2) + (set mode op1 (insn1 mode op1 op2)) + () + ) +) + +(logical andr and and OP1_6 OP2_0 dr sr HI) +(logical orr or or OP1_7 OP2_0 dr sr HI) +(logical xorr xor xor OP1_5 OP2_0 dr sr HI) +(logical andbr andb and OP1_6 OP2_1 drb srb QI) +(logical orbr orb or OP1_7 OP2_1 drb srb QI) +(logical xorbr xorb xor OP1_5 OP2_1 drb srb QI) + +;and/or/xor register and immediate +(define-pmacro (logical1 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "logical" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$hash$"op2) + (+ opc1 opc2 op1 (f-op-bit1 0) op2) + (set mode op1 (insn1 mode op1 op2)) + () + ) +) +(logical1 andri and and OP1_6 OP2_8 dr uimm3 HI) +(logical1 orri or or OP1_7 OP2_8 dr uimm3 HI) +(logical1 xorri xor xor OP1_5 OP2_8 dr uimm3 HI) +(logical1 andbri andb and OP1_6 OP2_9 drb uimm3 QI) +(logical1 orbri orb or OP1_7 OP2_9 drb uimm3 QI) +(logical1 xorbri xorb xor OP1_5 OP2_9 drb uimm3 QI) + +;and/or/xor register and immediate +(define-pmacro (logical2 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "logical" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$hash$"op2) + (+ opc1 opc2 op1 op2) + (set mode op1 (insn1 mode op1 op2)) + () + ) +) +(logical2 andrim and and OP1_6 OP2_6 reg8 uimm16 HI) +(logical2 orrim or or OP1_7 OP2_6 reg8 uimm16 HI) +(logical2 xorrim xor xor OP1_5 OP2_6 reg8 uimm16 HI) + +;and/or/xor register and immediate +(define-pmacro (logical3 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "logical" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$hash$"op2) + (+ opc1 opc2 op1 op2 (f-op-bit8 0)) + (set mode op1 (insn1 mode op1 op2)) + () + ) +) +(logical3 andbrim andb and OP1_6 OP2_7 regb8 uimm8 QI) +(logical3 orbrim orb or OP1_7 OP2_7 regb8 uimm8 QI) +(logical3 xorbrim xorb xor OP1_5 OP2_7 regb8 uimm8 QI) + +;and/or/xor register and indirect memory +(define-pmacro (logical4 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "logical" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",[$"op2"]") + (+ opc1 opc2 op1 (f-op-bit2 2) op2) + (set mode op1 (insn1 mode op1 (mem HI op2))) + () + ) +) +(logical4 and2 and and OP1_6 OP2_8 dr sr2 HI) +(logical4 or2 or or OP1_7 OP2_8 dr sr2 HI) +(logical4 xor2 xor xor OP1_5 OP2_8 dr sr2 HI) +(logical4 andb2 andb and OP1_6 OP2_9 drb sr2 QI) +(logical4 orb2 orb or OP1_7 OP2_9 drb sr2 QI) +(logical4 xorb2 xorb xor OP1_5 OP2_9 drb sr2 QI) + +;and/or/xor register and indirect memory post increment +(define-pmacro (logical5 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "logical" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",[$"op2"+]") + (+ opc1 opc2 op1 (f-op-bit2 3) op2) + (sequence () + (set mode op1 (insn1 mode op1 (mem HI op2))) + (set HI op2 (add HI op2 (const 2))) + ) + () + ) +) +(logical5 and2i and and OP1_6 OP2_8 dr sr2 HI) +(logical5 or2i or or OP1_7 OP2_8 dr sr2 HI) +(logical5 xor2i xor xor OP1_5 OP2_8 dr sr2 HI) +(logical5 andb2i andb and OP1_6 OP2_9 drb sr2 QI) +(logical5 orb2i orb or OP1_7 OP2_9 drb sr2 QI) +(logical5 xorb2i xorb xor OP1_5 OP2_9 drb sr2 QI) + +;add/sub register and immediate +(define-pmacro (logical7 name insn insn1 opc1 opc2 op1 op2 mode dir) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"dir"$"op1 ",$"op2) + (+ opc1 opc2 op1 op2) + (set (mem HI op1) (insn1 (mem HI op1) op2 )) + () + ) +) +(logical7 andpofr and and OP1_6 OP2_2 reg8 upof16 HI "pof") +(logical7 orpofr or or OP1_7 OP2_2 reg8 upof16 HI "pof") +(logical7 xorpofr xor xor OP1_5 OP2_2 reg8 upof16 HI "pof") +(logical7 andbpofr andb and OP1_6 OP2_3 regb8 upof16 QI "pof") +(logical7 orbpofr orb or OP1_7 OP2_3 regb8 upof16 QI "pof") +(logical7 xorbpofr xorb xor OP1_5 OP2_3 regb8 upof16 QI "pof") + +;add/sub register and immediate +(define-pmacro (logical8 name insn insn1 opc1 opc2 op1 op2 mode dir) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"dir"$"op1 ",$"op2) + (+ opc1 opc2 op1 op2) + (set (mem HI op1) (insn1 (mem HI op1) op2 )) + () + ) +) +(logical8 andrpofr and and OP1_6 OP2_4 upof16 reg8 HI "pof") +(logical8 orrpofr or or OP1_7 OP2_4 upof16 reg8 HI "pof") +(logical8 xorrpofr xor xor OP1_5 OP2_4 upof16 reg8 HI "pof") +(logical8 andbrpofr andb and OP1_6 OP2_5 upof16 regb8 QI "pof") +(logical8 orbrpofr orb or OP1_7 OP2_5 upof16 regb8 QI "pof") +(logical8 xorbrpofr xorb xor OP1_5 OP2_5 upof16 regb8 QI "pof") + +;and/or/xor register and direct memory +(define-pmacro (logical6 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$"op2) + (+ opc1 opc2 op1 op2) + (set mode op1 (insn1 mode op1 op2)) + () + ) +) + +;and/or/xor register and direct memory +(define-pmacro (logical7 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "arithmetic" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$"op2) + (+ opc1 opc2 op2 op1) + (set (mem HI op1) (insn1 (mem HI op1) op2)) + () + ) +) +(logical6 andrm2 and and OP1_6 OP2_2 regmem8 memgr8 HI) +(logical7 andrm3 and and OP1_6 OP2_4 memgr8 regmem8 HI) +(logical6 andrm and and OP1_6 OP2_2 reg8 memory HI) +(logical7 andrm1 and and OP1_6 OP2_4 memory reg8 HI) +(logical6 orrm3 or or OP1_7 OP2_2 regmem8 memgr8 HI) +(logical7 orrm2 or or OP1_7 OP2_4 memgr8 regmem8 HI) +(logical6 orrm1 or or OP1_7 OP2_2 reg8 memory HI) +(logical7 orrm or or OP1_7 OP2_4 memory reg8 HI) +(logical6 xorrm3 xor xor OP1_5 OP2_2 regmem8 memgr8 HI) +(logical7 xorrm2 xor xor OP1_5 OP2_4 memgr8 regmem8 HI) +(logical6 xorrm1 xor xor OP1_5 OP2_2 reg8 memory HI) +(logical7 xorrm xor xor OP1_5 OP2_4 memory reg8 HI) +(logical6 andbrm2 andb and OP1_6 OP2_3 regbmem8 memgr8 QI) +(logical7 andbrm3 andb and OP1_6 OP2_5 memgr8 regbmem8 QI) +(logical6 andbrm andb and OP1_6 OP2_3 regb8 memory QI) +(logical7 andbrm1 andb and OP1_6 OP2_5 memory regb8 QI) +(logical6 orbrm3 orb or OP1_7 OP2_3 regbmem8 memgr8 QI) +(logical7 orbrm2 orb or OP1_7 OP2_5 memgr8 regbmem8 QI) +(logical6 orbrm1 orb or OP1_7 OP2_3 regb8 memory QI) +(logical7 orbrm orb or OP1_7 OP2_5 memory regb8 QI) +(logical6 xorbrm3 xorb xor OP1_5 OP2_3 regbmem8 memgr8 QI) +(logical7 xorbrm2 xorb xor OP1_5 OP2_5 memgr8 regbmem8 QI) +(logical6 xorbrm1 xorb xor OP1_5 OP2_3 regb8 memory QI) +(logical7 xorbrm xorb xor OP1_5 OP2_5 memory regb8 QI) + +;**************************************************************** +;logical insn +;**************************************************************** +;mov registers +(define-pmacro (move name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "mov registers" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " $"op1 ",$"op2) + (+ opc1 opc2 op1 op2) + (set mode op1 op2) + () + ) +) +(move movr mov OP1_15 OP2_0 dr sr HI) +(move movrb movb OP1_15 OP2_1 drb srb HI) + +;mov register and immediate +(define-pmacro (move1 name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " $"op1 ",$hash$"op2) + (+ opc1 opc2 op2 op1) + (set mode op1 op2) + () + ) +) +(move1 movri mov OP1_14 OP2_0 dri u4 HI) +(move1 movbri movb OP1_14 OP2_1 srb u4 QI) + +; MOV Rwn,#data16 +(dni movi "move immediate to register" + ((PIPE OS) (IDOC MOVE)) + "mov $reg8,$hash$uimm16" + (+ OP1_14 OP2_6 reg8 uimm16) + (set HI reg8 uimm16) + () +) + +; MOVB reg,#data8 +(dni movbi "move immediate to register" + ((PIPE OS) (IDOC MOVE)) + "movb $regb8,$hash$uimm8" + (+ OP1_14 OP2_7 regb8 uimm8 (f-op-bit8 0)) + (set QI regb8 uimm8) + () +) + +;move and indirect memory +(define-pmacro (mov2 name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " $"op1 ",[$"op2"]") + (+ opc1 opc2 op1 op2) + (set mode op1 (mem HI op2)) + () + ) +) +(mov2 movr2 mov OP1_10 OP2_8 dr sr HI) +(mov2 movbr2 movb OP1_10 OP2_9 drb sr QI) + +;move and indirect memory +(define-pmacro (mov3 name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " [$"op2 "],$"op1) + (+ opc1 opc2 op1 op2) + (set mode op1 (mem HI op2)) + () + ) +) +(mov3 movri2 mov OP1_11 OP2_8 dr sr HI) +(mov3 movbri2 movb OP1_11 OP2_9 drb sr QI) + +;move and indirect memory +(define-pmacro (mov4 name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " [-$"op2 "],$"op1) + (+ opc1 opc2 op1 op2) + (sequence HI () + (set op1 (sub op2 (const HI 2))) + (set HI (mem HI op2) op1) + ) + () + ) +) +(mov4 movri3 mov OP1_8 OP2_8 dr sr HI) +(mov4 movbri3 movb OP1_8 OP2_9 drb sr QI) + +;mov register and indirect memory post increment +(define-pmacro (mov5 name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " $"op1 ",[$"op2"+]") + (+ opc1 opc2 op1 op2) + (sequence () + (set mode op1 (mem HI op2)) + (set HI op2 (add HI op2 (const 2))) + ) + () + ) +) +(mov5 mov2i mov OP1_9 OP2_8 dr sr HI) +(mov5 movb2i movb OP1_9 OP2_9 drb sr HI) + +;mov indirect memory +(define-pmacro (mov6 name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " [$"op1 "],[$"op2"]") + (+ opc1 opc2 op1 op2) + (set HI (mem HI op1) (mem HI op2)) + () + ) +) +(mov6 mov6i mov OP1_12 OP2_8 dr sr HI) +(mov6 movb6i movb OP1_12 OP2_9 dr sr HI) + +;mov indirect memory +(define-pmacro (mov7 name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " [$"op1 "+],[$"op2"]") + (+ opc1 opc2 op1 op2) + (sequence () + (set mode (mem mode op1) (mem mode op2)) + (set mode op1 (add mode op1 (const mode 2))) + ) + () + ) +) +(mov7 mov7i mov OP1_13 OP2_8 dr sr HI) +(mov7 movb7i movb OP1_13 OP2_9 dr sr HI) + +;mov indirect memory +(define-pmacro (mov8 name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " [$"op1 "],[$"op2"+]") + (+ opc1 opc2 op1 op2) + (sequence () + (set mode (mem mode op1) (mem mode op2)) + (set mode op2 (add mode op2 (const mode 2))) + ) + () + ) +) +(mov8 mov8i mov OP1_14 OP2_8 dr sr HI) +(mov8 movb8i movb OP1_14 OP2_9 dr sr HI) + +;mov indirect memory +(define-pmacro (mov9 name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " $"op1 ",[$"op2"+$hash$"uimm16"]") + (+ opc1 opc2 op1 op2 uimm16) + (sequence mode ((mode tmp1)) + (set mode tmp1 (add HI op2 uimm16)) + (set mode op1 (mem HI tmp1)) + ) + () + ) +) +(mov9 mov9i mov OP1_13 OP2_4 dr sr HI) +(mov9 movb9i movb OP1_15 OP2_4 drb sr QI) + +;mov indirect memory +(define-pmacro (mov10 name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " [$"op2"+$hash$"uimm16 "],$"op1) + (+ opc1 opc2 op1 op2 uimm16) + (sequence mode ((mode tmp1)) + (set mode tmp1 (add HI op1 uimm16)) + (set mode (mem HI tmp1) op1) + ) + () + ) +) +(mov10 mov10i mov OP1_12 OP2_4 dr sr HI) +(mov10 movb10i movb OP1_14 OP2_4 drb sr QI) + +;move and indirect memory +(define-pmacro (mov11 name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " [$"op1 "],$"op2) + (+ opc1 opc2 (f-op-lbit4 0) op1 op2) + (set (mem mode op1) (mem HI op2)) + () + ) +) +(mov11 movri11 mov OP1_8 OP2_4 src2 memory HI) +(mov11 movbri11 movb OP1_10 OP2_4 src2 memory HI) + +;move and indirect memory +(define-pmacro (mov12 name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " $"op2 ",[$"op1"]") + (+ opc1 opc2 (f-op-lbit4 0) op1 op2) + (set (mem HI op2) (mem mode op1)) + () + ) +) +(mov12 movri12 mov OP1_9 OP2_4 src2 memory HI) +(mov12 movbri12 movb OP1_11 OP2_4 src2 memory HI) + +(define-pmacro (movemem3 name insn opc1 opc2 op1 op2 dir) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " $"op1 ",$hash$"dir"$"op2) + (+ opc1 opc2 op1 op2) + (set HI op1 op2) + () + ) +) +(movemem3 movehm5 mov OP1_14 OP2_6 regoff8 upof16 "pof") +(movemem3 movehm6 mov OP1_14 OP2_6 regoff8 upag16 "pag") +(movemem3 movehm7 mov OP1_14 OP2_6 regoff8 useg16 "segm") +(movemem3 movehm8 mov OP1_14 OP2_6 regoff8 usof16 "sof") + +(define-pmacro (movemem4 name insn opc1 opc2 op1 op2 dir) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " $"op1 ",$hash$"dir"$"op2) + (+ opc1 opc2 op1 op2 (f-op-bit8 0)) + (set QI op1 op2) + () + ) +) +(movemem4 movehm9 movb OP1_14 OP2_7 regb8 uimm8 "pof") +(movemem4 movehm10 movb OP1_14 OP2_7 regoff8 uimm8 "pag") + +(define-pmacro (movemem name insn opc1 opc2 op1 op2 mode dir) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " $"op1 ",$"dir"$"op2) + (+ opc1 opc2 op1 op2) + (set mode op1 (mem HI op2)) + () + ) +) +(movemem movrmp mov OP1_15 OP2_2 regoff8 upof16 HI "pof") +(movemem movrmp1 movb OP1_15 OP2_3 regb8 upof16 QI "pof") +(movemem movrmp2 mov OP1_15 OP2_2 regoff8 upag16 HI "pag") +(movemem movrmp3 movb OP1_15 OP2_3 regb8 upag16 QI "pag") + +(define-pmacro (movemem1 name insn opc1 opc2 op1 op2 dir) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " $"dir"$"op1 ",$"op2) + (+ opc1 opc2 op2 op1) + (set (mem HI op1) op2 ) + () + ) +) +(movemem1 movrmp4 mov OP1_15 OP2_6 upof16 regoff8 "pof") +(movemem1 movrmp5 movb OP1_15 OP2_7 upof16 regb8 "pof") + +(define-pmacro (movemem2 name insn opc1 opc2 op1 op2 mode dir) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " $"op1 ",$hash$"dir"$"op2) + (+ opc1 opc2 op2 op1) + (set mode op1 op2) + () + ) +) +(movemem2 movehm1 mov OP1_14 OP2_0 dri u4 HI "pof") +(movemem2 movehm2 movb OP1_14 OP2_1 srb u4 QI "pof") +(movemem2 movehm3 mov OP1_14 OP2_0 dri u4 HI "pag") +(movemem2 movehm4 movb OP1_14 OP2_1 srb u4 QI "pag") + +;move register and direct memory +(define-pmacro (move12 name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " $"op1 ",$"op2) + (+ opc1 opc2 op1 op2) + (set mode op1 (mem HI op2)) + () + ) +) + +;move register and direct memory +(define-pmacro (move13 name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " $"op1 ",$"op2) + (+ opc1 opc2 op2 op1) + (set (mem HI op1) op2) + () + ) +) +(move12 mve12 mov OP1_15 OP2_2 regmem8 memgr8 HI) +(move13 mve13 mov OP1_15 OP2_6 memgr8 regmem8 HI) +(move12 mover12 mov OP1_15 OP2_2 reg8 memory HI) +(move13 mvr13 mov OP1_15 OP2_6 memory reg8 HI) +(move12 mver12 movb OP1_15 OP2_3 regbmem8 memgr8 QI) +(move13 mver13 movb OP1_15 OP2_7 memgr8 regbmem8 QI) +(move12 movr12 movb OP1_15 OP2_3 regb8 memory QI) +(move13 movr13 movb OP1_15 OP2_7 memory regb8 QI) + +; MOVBS Rw,Rb +(dni movbsrr "mov byte register with sign extension to word register" + ((PIPE OS) (IDOC MOVE)) + "movbs $sr,$drb" + (+ OP1_13 OP2_0 drb sr) + (sequence () + (if QI (and QI drb (const 128)) + (set HI sr (or HI (const HI 65280) drb))) + (set HI sr (and HI (const HI 255) drb)) + ) + () +) + +; MOVBZ Rw,Rb +(dni movbzrr "mov byte register with zero extension to word register" + ((PIPE OS) (IDOC MOVE)) + "movbz $sr,$drb" + (+ OP1_12 OP2_0 drb sr) + (set HI sr (and HI (const HI 255) drb)) + () +) + +; MOVBS reg,POF mem +(dni movbsrpofm "mov memory to byte register" + ((PIPE OS) (IDOC MOVE)) + "movbs $regmem8,$pof$upof16" + (+ OP1_13 OP2_2 regmem8 upof16) + (set QI regmem8 (mem HI upof16)) + () +) + +; MOVBS pof,reg +(dni movbspofmr "mov memory to byte register" + ((PIPE OS) (IDOC MOVE)) + "movbs $pof$upof16,$regbmem8" + (+ OP1_13 OP2_5 upof16 regbmem8 ) + (set QI (mem HI upof16) regbmem8) + () +) + +; MOVBZ reg,POF mem +(dni movbzrpofm "mov memory to byte register" + ((PIPE OS) (IDOC MOVE)) + "movbz $reg8,$pof$upof16" + (+ OP1_12 OP2_2 reg8 upof16) + (set QI reg8 (mem HI upof16)) + () +) + +; MOVBZ pof,reg +(dni movbzpofmr "mov memory to byte register" + ((PIPE OS) (IDOC MOVE)) + "movbz $pof$upof16,$regb8" + (+ OP1_12 OP2_5 upof16 regb8 ) + (set QI (mem HI upof16) regb8) + () +) + +;move register and direct memory +(define-pmacro (move14 name insn opc1 opc2 op1 op2 ) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " $"op1 ",$"op2) + (+ opc1 opc2 op1 op2) + (set HI op1 (and HI (const HI 255) (mem QI op2))) + () + ) +) + +;move register and direct memory +(define-pmacro (move15 name insn opc1 opc2 op1 op2 ) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " $"op1 ",$"op2) + (+ opc1 opc2 op2 op1) + (set HI (mem HI op1) (and HI (const HI 255) op2)) + () + ) +) +(move14 movebs14 movbs OP1_13 OP2_2 regmem8 memgr8 ) +(move15 movebs15 movbs OP1_13 OP2_5 memgr8 regbmem8 ) +(move14 moverbs14 movbs OP1_13 OP2_2 reg8 memory ) +(move15 movrbs15 movbs OP1_13 OP2_5 memory regb8 ) +(move14 movebz14 movbz OP1_12 OP2_2 regmem8 memgr8 ) +(move15 movebz15 movbz OP1_12 OP2_5 memgr8 regbmem8 ) +(move14 moverbz14 movbz OP1_12 OP2_2 reg8 memory ) +(move15 movrbz15 movbz OP1_12 OP2_5 memory regb8 ) + + +;mov registers +(define-pmacro (moveb1 name insn opc1 opc2 op1 op2) + (dni name + (.str name "move" ) + ((PIPE OS) (IDOC MOVE)) + (.str insn " $"op2 ",$"op1) + (+ opc1 opc2 op1 op2) + (sequence () + (if QI (and QI op1 (const 128)) + (set HI op2 (or HI (const HI 65280) op1))) + (set HI op2 (and HI (const HI 255) op1)) + ) + () + ) +) +(moveb1 movrbs movbs OP1_13 OP2_0 drb sr ) +(moveb1 movrbz movbz OP1_12 OP2_0 drb sr ) + + + +;jump and call insns +;****************************************************************** +;Absolute conditional jump +(define-pmacro (jmpabs name insn) + (dni name + (.str name "Absolute conditional jump" ) + ((PIPE OS) (IDOC JMP)) + (.str insn " $extcond,$caddr") + (+ OP1_14 OP2_10 extcond (f-op-bitone 0) bitone bit01 caddr) + (sequence ((HI tmp1) (HI tmp2)) + (set tmp1 (mem HI caddr)) + (set tmp2 (sub HI pc (mem HI caddr))) + (if (gt tmp2 (const 0)) (lt tmp2 (const 32)) (eq tmp2 (const 32)) + (set bitone (const 1))) + (if (lt tmp2 (const 0)) (eq tmp2 (const 0)) (gt tmp2 (const 32)) + (set bitone (const 0))) + (if (eq extcond (const 1) (ne extcond cc_Z)) + (set bit01 (const 0)) + (set HI pc (mem HI caddr))) + (if (ne extcond (const 1) (eq extcond cc_Z)) + (set bit01 (const 1)) + (set HI pc (add HI pc (const 2)))) + ) + () + ) +) + +(jmpabs jmpa0 jmpa+) +(jmpabs jmpa1 jmpa) + +; JMPA- cc,caddr +(dni jmpa- "Absolute conditional jump" + (COND-CTI (PIPE OS) (IDOC JMP)) + "jmpa- $extcond,$caddr" + (+ OP1_14 OP2_10 extcond (f-op-bitone 0) bitone (f-op-1bit 1) caddr) + (sequence ((HI tmp1) (HI tmp2)) + (set tmp1 (mem HI caddr)) + (set tmp2 (sub HI pc (mem HI caddr))) + (if (gt tmp2 (const 0)) (lt tmp2 (const 32)) (eq tmp2 (const 32)) + (set bitone (const 1))) + (if (lt tmp2 (const 0)) (eq tmp2 (const 0)) (gt tmp2 (const 32)) + (set bitone (const 0))) + (set HI pc (add HI pc (const 2))) + ) + () +) + +; JMPI cc,[Rwn] +(dni jmpi "Indirect conditional jump" + (COND-CTI (PIPE OS) (IDOC JMP)) + "jmpi $icond,[$sr]" + (+ OP1_9 OP2_12 icond sr) + (sequence () + (if (eq icond (const 1)) + (set HI pc (mem HI sr))) + (set HI pc (add HI pc (const 2))) + ) + () +) + +(define-pmacro (jmprel name insn opc1) + (dni name + (.str name "conditional" ) + (COND-CTI (PIPE OS) (IDOC JMP)) + (.str insn " $cond,$rel") + (+ opc1 OP2_13 rel) + (sequence () + (if (eq cond (const 1)) + (sequence () + (if QI (lt QI rel (const 0)) + (sequence () + (neg QI rel) + (add QI rel (const 1)) + (mul QI rel (const 2)) + (set HI pc (sub HI pc rel)) + )) + (set HI pc (add HI pc (mul QI rel (const 2)))) + ) + ) + (set HI pc pc) + ) + () + ) +) + +(jmprel jmpr_nenz jmpr COND_NE_NZ ) +(jmprel jmpr_sgt jmpr COND_SGT ) +(jmprel jmpr_z jmpr COND_Z ) +(jmprel jmpr_v jmpr COND_V ) +(jmprel jmpr_nv jmpr COND_NV ) +(jmprel jmpr_n jmpr COND_N ) +(jmprel jmpr_nn jmpr COND_NN ) +(jmprel jmpr_c jmpr COND_C ) +(jmprel jmpr_nc jmpr COND_NC ) +(jmprel jmpr_eq jmpr COND_EQ ) +(jmprel jmpr_ne jmpr COND_NE ) +(jmprel jmpr_ult jmpr COND_ULT ) +(jmprel jmpr_ule jmpr COND_ULE ) +(jmprel jmpr_uge jmpr COND_UGE ) +(jmprel jmpr_ugt jmpr COND_UGT ) +(jmprel jmpr_sle jmpr COND_SLE ) +(jmprel jmpr_sge jmpr COND_SGE ) +(jmprel jmpr_net jmpr COND_NET ) +(jmprel jmpr_uc jmpr COND_UC ) +(jmprel jmpr_slt jmpr COND_SLT ) + + + + +; JMPS seg,caddr +(dni jmpseg "absolute inter-segment jump" + (UNCOND-CTI(PIPE OS) (IDOC JMP)) + "jmps $hash$segm$useg8,$hash$sof$usof16" + (+ OP1_15 OP2_10 seg usof16) + (sequence () + (if QI (eq BI sgtdisbit (const BI 0)) + (set QI (reg h-cr 10) useg8)) + (nop) + (set HI pc usof16) + ) + () +) + +; JMPS seg,caddr +(dni jmps "absolute inter-segment jump" + (UNCOND-CTI(PIPE OS) (IDOC JMP)) + "jmps $seg,$caddr" + (+ OP1_15 OP2_10 seg caddr) + (sequence () + (if QI (eq BI sgtdisbit (const BI 0)) + (set QI (reg h-cr 10) seg)) + (nop) + (set HI pc caddr) + ) + () +) + + +;relative jump if bit set +;JB bitaddrQ.q,rel +(dni jb "relative jump if bit set" + ((PIPE OS) (IDOC JMP)) + "jb $genreg$dot$qlobit,$relhi" + (+ OP1_8 OP2_10 genreg relhi qlobit (f-qhibit 0)) + (sequence ((HI tmp1) (HI tmp2)) + (set HI tmp1 genreg) + (set HI tmp2 (const 1)) + (sll HI tmp2 qlobit) + (set HI tmp2 (and tmp1 tmp2)) + (if (eq tmp2 (const 1)) + (sequence () + (if QI (lt QI relhi (const 0)) + (set HI pc (add HI pc (mul QI relhi (const 2))))) + )) + (set HI pc (add HI pc (const 4))) + ) + () +) + +;relative jump if bit set and clear bit +;JBC bitaddrQ.q,rel +(dni jbc "relative jump if bit set and clear bit" + ((PIPE OS) (IDOC JMP)) + "jbc $genreg$dot$qlobit,$relhi" + (+ OP1_10 OP2_10 genreg relhi qlobit (f-qhibit 0)) + (sequence ((HI tmp1) (HI tmp2)) + (set HI tmp1 genreg) + (set HI tmp2 (const 1)) + (sll HI tmp2 qlobit) + (set HI tmp2 (and tmp1 tmp2)) + (if (eq tmp2 (const 1)) + (sequence () + (if QI (lt QI relhi (const 0)) + (set tmp2 (const 1)) + (set tmp1 genreg) + (sll tmp2 qlobit) + (inv tmp2) + (set HI tmp1(and tmp1 tmp2)) + (set HI genreg tmp1) + (set HI pc (add HI pc (mul QI relhi (const 2))))) + )) + (set HI pc (add HI pc (const 4))) + ) + () +) + +;relative jump if bit set +;JNB bitaddrQ.q,rel +(dni jnb "relative jump if bit not set" + ((PIPE OS) (IDOC JMP)) + "jnb $genreg$dot$qlobit,$relhi" + (+ OP1_9 OP2_10 genreg relhi qlobit (f-qhibit 0)) + (sequence ((HI tmp1) (HI tmp2)) + (set HI tmp1 genreg) + (set HI tmp2 (const 1)) + (sll HI tmp2 qlobit) + (set HI tmp2 (and tmp1 tmp2)) + (if (eq tmp2 (const 0)) + (sequence () + (if QI (lt QI relhi (const 0)) + (set HI pc (add HI pc (mul QI relhi (const 2))))) + )) + (set HI pc (add HI pc (const 4))) + ) + () +) + +;relative jump if bit not set and set bit +;JNBS bitaddrQ.q,rel +(dni jnbs "relative jump if bit not set and set bit" + ((PIPE OS) (IDOC JMP)) + "jnbs $genreg$dot$qlobit,$relhi" + (+ OP1_11 OP2_10 genreg relhi qlobit (f-qhibit 0)) + (sequence ((HI tmp1) (HI tmp2)) + (set HI tmp1 genreg) + (set HI tmp2 (const 1)) + (sll HI tmp2 qlobit) + (set HI tmp2 (and tmp1 tmp2)) + (if (eq tmp2 (const 0)) + (sequence () + (if QI (lt QI relhi (const 0)) + (set tmp2 (const 1)) + (set tmp1 reg8) + (sll tmp2 qbit) + (set BI tmp1(or tmp1 tmp2)) + (set HI reg8 tmp1) + (set HI pc (add HI pc (mul QI relhi (const 2))))) + )) + (set HI pc (add HI pc (const 4))) + ) + () +) + + +;Absolute conditional call +(define-pmacro (callabs name insn) + (dni name + (.str name "Absolute conditional call" ) + ((PIPE OS) (IDOC JMP)) + (.str insn " $extcond,$caddr") + (+ OP1_12 OP2_10 extcond (f-op-2bit 0) bit01 caddr) + (sequence () + (if (eq extcond (const 1)) + (set bit01 (const 0)) + (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2))) + (set HI (mem HI (reg h-cr 9)) pc) + (set HI pc (mem HI caddr))) + (if (ne extcond (const 1)) + (set bit01 (const 1)) + (set HI pc (add HI pc (const 2)))) + ) + () + ) +) + +(callabs calla0 calla+) +(callabs calla1 calla) + +; CALLA- cc,caddr +(dni calla- "Absolute conditional call" + (COND-CTI (PIPE OS) (IDOC JMP)) + "calla- $extcond,$caddr" + (+ OP1_12 OP2_10 extcond (f-op-bit3 1) caddr) + (sequence () + (if (eq extcond (const 1)) + (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2))) + (set HI (mem HI (reg h-cr 9)) pc) + (set HI pc (mem HI caddr))) + (set HI pc (add HI pc (const 2))) + ) + () +) + +; CALLI cc,[Rwn] +(dni calli "indirect subroutine call" + (COND-CTI (PIPE OS) (IDOC JMP)) + "calli $icond,[$sr]" + (+ OP1_10 OP2_11 icond sr) + (sequence () + (if (eq icond (const 1)) + (sequence () + (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2))) + (set HI (mem HI (reg h-cr 9)) pc) + (set HI pc (mem HI sr)) + ) + ) + (set HI pc (add HI pc (const 2))) + ) + () +) + +; CALLR rel +(dni callr "Call subroutine with PC relative signed 8 bit offset" + ( COND-CTI (PIPE OS) (IDOC JMP)) + "callr $rel" + (+ OP1_11 OP2_11 rel) + (sequence () + (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2))) + (set HI (mem HI (reg h-cr 9)) pc) + (sequence () + (if QI (lt QI rel (const 0)) + (sequence () + (neg QI rel) + (add QI rel (const 1)) + (mul QI rel (const 2)) + (set HI pc (sub HI pc rel)) + )) + (set HI pc (add HI pc (mul QI rel (const 2)))) + ) + ) + () +) + + +; CALLS seg,caddr +(dni callseg "call inter-segment subroutine" + (UNCOND-CTI (PIPE OS) (IDOC JMP)) + "calls $hash$segm$useg8,$hash$sof$usof16" + (+ OP1_13 OP2_10 useg8 usof16) + (sequence () + (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2))) + (set HI (mem HI (reg h-cr 9)) (reg h-cr 10)) + (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2))) + (set HI (mem HI (reg h-cr 9)) pc) + (if QI (eq BI sgtdisbit (const BI 0)) + (set QI (reg h-cr 10) useg8)) + (nop) + (set HI pc usof16) + ) + () +) + +; CALLS seg,caddr +(dni calls "call inter-segment subroutine" + (UNCOND-CTI (PIPE OS) (IDOC JMP)) + "calls $seg,$caddr" + (+ OP1_13 OP2_10 seg caddr) + (sequence () + (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2))) + (set HI (mem HI (reg h-cr 9)) (reg h-cr 10)) + (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2))) + (set HI (mem HI (reg h-cr 9)) pc) + (if QI (eq BI sgtdisbit (const BI 0)) + (set QI (reg h-cr 10) seg)) + (nop) + (set HI pc caddr) + ) + () +) + +; PCALL reg,caddr +(dni pcall "push word and call absolute subroutine" + (UNCOND-CTI (PIPE OS) (IDOC JMP)) + "pcall $reg8,$caddr" + (+ OP1_14 OP2_2 reg8 caddr) + (sequence ((HI tmp1)) + (set HI tmp1 reg8) + (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2))) + (set HI (mem HI (reg h-cr 9)) tmp1) + (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2))) + (set HI (mem HI (reg h-cr 9)) pc) + (set HI pc caddr) + ) + () +) + +; TRAP #uimm7 +(dni trap "software trap" + (UNCOND-CTI (PIPE OS) (IDOC JMP)) + "trap $hash$uimm7" + (+ OP1_9 OP2_11 uimm7 (f-op-1bit 0)) + (sequence () + (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2))) + (set HI (mem HI (reg h-cr 9)) (reg h-cr 4)) + (if QI (eq BI sgtdisbit (const BI 0)) + (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2))) + (set HI (mem HI (reg h-cr 9)) (reg h-cr 10) ) + ) + (nop) + (set HI (reg h-cr 10) (reg h-cr 11)) + (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2))) + (set HI (mem HI (reg h-cr 9)) pc) + (set HI pc (mul QI uimm7 (const 4))) + ) + () +) + +;Return insns +; RET +(dni ret "return from subroutine" + (UNCOND-CTI (PIPE OS) (IDOC JMP)) + "ret" + (+ OP1_12 OP2_11 (f-op-bit8 0)) + (sequence () + (set HI pc (mem HI (reg h-cr 9))) + (set (reg h-cr 9) (add HI (reg h-cr 9) (const 2))) + ) + () +) + +; RETS +(dni rets "return from inter-segment sunroutine" + (UNCOND-CTI (PIPE OS) (IDOC JMP)) + "rets" + (+ OP1_13 OP2_11 (f-op-bit8 0)) + (sequence () + (set HI pc (mem HI (reg h-cr 9))) + (set (reg h-cr 9) (add HI (reg h-cr 9) (const 2))) + (if QI (eq BI sgtdisbit (const BI 0)) + (set HI (reg h-cr 10) (mem HI (reg h-cr 9))) + ) + (nop) + (set (reg h-cr 9) (add HI (reg h-cr 9) (const 2))) + ) + () +) + +; RETP reg +(dni retp "return from subroutine and pop word register" + (UNCOND-CTI (PIPE OS) (IDOC JMP)) + "retp $reg8" + (+ OP1_14 OP2_11 reg8) + (sequence ((HI tmp1)) + (set HI pc (mem HI (reg h-cr 9))) + (set (reg h-cr 9) (add HI (reg h-cr 9) (const 2))) + (set HI tmp1 (mem HI (reg h-cr 9))) + (set (reg h-cr 9) (add HI (reg h-cr 9) (const 2))) + (set HI reg8 tmp1) + ) + () +) + +; RETI +(dni reti "return from ISR" + (UNCOND-CTI (PIPE OS) (IDOC JMP)) + "reti" + (+ OP1_15 OP2_11 (f-op-lbit4 8) (f-op-bit4 8)) + (sequence () + (set HI pc (mem HI (reg h-cr 9))) + (set (reg h-cr 9) (add HI (reg h-cr 9) (const 2))) + (if QI (eq BI sgtdisbit (const BI 0)) + (sequence () + (set HI (reg h-cr 10) (mem HI (reg h-cr 9))) + (set (reg h-cr 9) (add HI (reg h-cr 9) (const 2))) + ) + ) + (nop) + (set HI (reg h-cr 4) (mem HI (reg h-cr 9))) + (set (reg h-cr 9) (add HI (reg h-cr 9) (const 2))) + ) + () +) + +;stack operation insn +;****************************************************************** +; POP reg +(dni pop "restore register from system stack" + ((PIPE OS) (IDOC MISC)) + "pop $reg8" + (+ OP1_15 OP2_12 reg8) + (sequence ((HI tmp1)) + (set HI tmp1 (mem HI (reg h-cr 9))) + (set (reg h-cr 9) (add HI (reg h-cr 9) (const 2))) + (set HI reg8 tmp1) + ) + () +) + +; PUSH reg +(dni push "save register on system stack" + ((PIPE OS) (IDOC MISC)) + "push $reg8" + (+ OP1_14 OP2_12 reg8) + (sequence ((HI tmp1)) + (set HI tmp1 reg8) + (set (reg h-cr 9) (sub HI (reg h-cr 9) (const 2))) + (set HI (mem HI (reg h-cr 9)) tmp1) + ) + () +) + +;context switching insns +; SCXT reg,#data16 +(dni scxti "Push word register on stack and update same with immediate data" + ((PIPE OS) (IDOC MISC)) + "scxt $reg8,$hash$uimm16" + (+ OP1_12 OP2_6 reg8 uimm16) + (sequence ((HI tmp1) (HI tmp2)) + (set HI tmp1 reg8) + (set HI tmp2 uimm16) + (sub HI (reg HI h-cr 9) (const 2)) + (set HI (reg HI h-cr 9) tmp1) + (set HI reg8 tmp2) + ) + () +) + +; SCXT reg,POF mem +(dni scxtrpofm "mov memory to byte register" + ((PIPE OS) (IDOC MOVE)) + "scxt $reg8,$pof$upof16" + (+ OP1_13 OP2_6 reg8 upof16) + (set QI reg8 (mem HI upof16)) + () +) + +; SCXT regmem8,memgr8 +(dni scxtmg "Push word register on stack and update same with direct memory" + ((PIPE OS) (IDOC MISC)) + "scxt $regmem8,$memgr8" + (+ OP1_13 OP2_6 regmem8 memgr8) + (sequence ((HI tmp1) (HI tmp2)) + (set HI tmp1 regmem8) + (set HI tmp2 memgr8) + (sub HI (reg HI h-cr 9) (const 2)) + (set HI (reg HI h-cr 9) tmp1) + (set HI regmem8 tmp2) + ) + () +) + +; SCXT reg,mem +(dni scxtm "Push word register on stack and update same with direct memory" + ((PIPE OS) (IDOC MISC)) + "scxt $reg8,$memory" + (+ OP1_13 OP2_6 reg8 memory) + (sequence ((HI tmp1) (HI tmp2)) + (set HI tmp1 reg8) + (set HI tmp2 memory) + (sub HI (reg HI h-cr 9) (const 2)) + (set HI (reg HI h-cr 9) tmp1) + (set HI reg8 tmp2) + ) + () +) + +;No operation +; NOP +(dni nop "nop" + ((PIPE OS) (IDOC MISC)) + "nop" + (+ OP1_12 OP2_12 (f-op-bit8 0)) + () + () +) + +;*********system control instructions *********************/ + +(define-pmacro (sysctrl name insn opc1 opc2 op1 op2 op3) + (dni name + (.str name "miscellaneous" ) + ((PIPE OS) (IDOC MISC)) + (.str insn ) + (+ opc1 opc2 (f-op-lbit4 op1) (f-op-bit4 op2) (f-data8 op3) (f-op-bit8 op3)) + () + () + ) +) +(sysctrl srstm srst OP1_11 OP2_7 4 8 183 ) +(sysctrl idlem idle OP1_8 OP2_7 7 8 135) +(sysctrl pwrdnm pwrdn OP1_9 OP2_7 6 8 151) +(sysctrl diswdtm diswdt OP1_10 OP2_5 5 10 165) +(sysctrl enwdtm enwdt OP1_8 OP2_5 7 10 133) +(sysctrl einitm einit OP1_11 OP2_5 4 10 181) +(sysctrl srvwdtm srvwdt OP1_10 OP2_7 5 8 167 ) + +;s/w brk +; SBRK +(dni sbrk "sbrk" + ((PIPE OS) (IDOC MISC)) + "sbrk" + (+ OP1_8 OP2_12 (f-op-bit8 0)) + () + () +) + +; atomic sequence +; ATOMIC #irang2 +(dni atomic "begin atomic sequence" + ((PIPE OS) (IDOC SYSC)) + "atomic $hash$uimm2" + (+ OP1_13 OP2_1 (f-op-lbit2 0) uimm2 (f-op-bit4 0)) + (sequence ((HI count)) + (set HI count uimm2) + (cond HI + ((ne HI count (const 0)) + (sequence () + (set HI pc (add HI pc (const 2))) + (set HI count (sub HI count (const 1))) + )) + ) + (set HI count (const 0)) + ) + () +) + +;extended register sequence +; EXTR #irang2 +(dni extr "begin extended register sequence" + ((PIPE OS) (IDOC SYSC)) + "extr $hash$uimm2" + (+ OP1_13 OP2_1 (f-op-lbit2 2) uimm2 (f-op-bit4 0)) + (sequence ((HI count)) + (set HI count uimm2) + (cond HI + ((ne HI count (const 0)) + (sequence () + (set HI pc (add HI pc (const 2))) + (set HI count (sub HI count (const 1))) + )) + ) + (set HI count (const 0)) + ) + () +) + +;extended page sequence +; EXTP Rw,#irang2 +(dni extp "begin extended page sequence" + ((PIPE OS) (IDOC SYSC)) + "extp $sr,$hash$uimm2" + (+ OP1_13 OP2_12 (f-op-lbit2 1) uimm2 sr) + (sequence ((HI count)) + (set HI count uimm2) + (cond HI + ((ne HI count (const 0)) + (sequence () + (set HI pc (add HI pc (const 2))) + (set HI count (sub HI count (const 1))) + )) + ) + (set HI count (const 0)) + ) + () +) + +;extended page sequence +; EXTP #pag10,#irang2 +(dni extp1 "begin extended page sequence" + ((PIPE OS) (IDOC SYSC)) + "extp $hash$pagenum,$hash$uimm2" + (+ OP1_13 OP2_7 (f-op-lbit2 1) uimm2 (f-op-bit4 0) pagenum (f-qlobit 0) (f-qlobit2 0)) + (sequence ((HI count)) + (set HI count uimm2) + (cond HI + ((ne HI count (const 0)) + (sequence () + (set HI pc (add HI pc (const 2))) + (set HI count (sub HI count (const 1))) + )) + ) + (set HI count (const 0)) + ) + () +) + +; EXTP #pag10,#irang2 +(dni extpg1 "begin extended page sequence" + ((PIPE OS) (IDOC SYSC)) + "extp $hash$pag$upag16,$hash$uimm2" + (+ OP1_13 OP2_7 (f-op-lbit2 1) uimm2 (f-op-bit4 0) upag16 ) + (sequence ((HI count)) + (set HI count uimm2) + (cond HI + ((ne HI count (const 0)) + (sequence () + (set HI pc (add HI pc (const 2))) + (set HI count (sub HI count (const 1))) + )) + ) + (set HI count (const 0)) + ) + () +) + +;extended page and register sequence +; EXTPR Rw,#irang2 +(dni extpr "begin extended page and register sequence" + ((PIPE OS) (IDOC SYSC)) + "extpr $sr,$hash$uimm2" + (+ OP1_13 OP2_12 (f-op-lbit2 3) uimm2 sr) + (sequence ((HI count)) + (set HI count uimm2) + (cond HI + ((ne HI count (const 0)) + (sequence () + (set HI pc (add HI pc (const 2))) + (set HI count (sub HI count (const 1))) + )) + ) + (set HI count (const 0)) + ) + () +) + +;extended page and register sequence +; EXTPR #pag10,#irang2 +(dni extpr1 "begin extended page sequence" + ((PIPE OS) (IDOC SYSC)) + "extpr $hash$pagenum,$hash$uimm2" + (+ OP1_13 OP2_7 (f-op-lbit2 3) uimm2 (f-op-bit4 0) pagenum (f-qlobit 0) (f-qlobit2 0)) + (sequence ((HI count)) + (set HI count uimm2) + (cond HI + ((ne HI count (const 0)) + (sequence () + (set HI pc (add HI pc (const 2))) + (set HI count (sub HI count (const 1))) + )) + ) + (set HI count (const 0)) + ) + () +) + +;extended segment sequence +; EXTS Rw,#irang2 +(dni exts "begin extended segment sequence" + ((PIPE OS) (IDOC SYSC)) + "exts $sr,$hash$uimm2" + (+ OP1_13 OP2_12 (f-op-lbit2 0) uimm2 sr) + (sequence ((HI count)) + (set HI count uimm2) + (cond HI + ((ne HI count (const 0)) + (sequence () + (set HI pc (add HI pc (const 2))) + (set HI count (sub HI count (const 1))) + )) + ) + (set HI count (const 0)) + ) + () +) + +;extended segment sequence +; EXTS #seg8,#irang2 +(dni exts1 "begin extended segment sequence" + ((PIPE OS) (IDOC SYSC)) + "exts $hash$seghi8,$hash$uimm2" + (+ OP1_13 OP2_7 (f-op-lbit2 0) uimm2 (f-op-bit4 0) seghi8 (f-op-bit8 0)) + (sequence ((HI count)) + (set HI count uimm2) + (cond HI + ((ne HI count (const 0)) + (sequence () + (set HI pc (add HI pc (const 2))) + (set HI count (sub HI count (const 1))) + )) + ) + (set HI count (const 0)) + ) + () +) + +;extended segment register sequence +; EXTSR Rwm,#irang2 +(dni extsr "begin extended segment and register sequence" + ((PIPE OS) (IDOC SYSC)) + "extsr $sr,$hash$uimm2" + (+ OP1_13 OP2_12 (f-op-lbit2 2) uimm2 sr) + (sequence ((HI count)) + (set HI count uimm2) + (cond HI + ((ne HI count (const 0)) + (sequence () + (set HI pc (add HI pc (const 2))) + (set HI count (sub HI count (const 1))) + )) + ) + (set HI count (const 0)) + ) + () +) + +;extended segment register sequence +; EXTSR #pag10,#irang2 +(dni extsr1 "begin extended segment and register sequence" + ((PIPE OS) (IDOC SYSC)) + "extsr $hash$seghi8,$hash$uimm2" + (+ OP1_13 OP2_7 (f-op-lbit2 2) uimm2 (f-op-bit4 0) seghi8 (f-op-bit8 0)) + (sequence ((HI count)) + (set HI count uimm2) + (cond HI + ((ne HI count (const 0)) + (sequence () + (set HI pc (add HI pc (const 2))) + (set HI count (sub HI count (const 1))) + )) + ) + (set HI count (const 0)) + ) + () +) + +;prioritize register +;PRIOR Rwn,Rwm +(dni prior "add registers" + ((PIPE OS) (IDOC ALU)) + "prior $dr,$sr" + (+ OP1_2 OP2_11 dr sr) + (sequence ((HI count) (HI tmp1) (HI tmp2)) + (set HI count (const 0)) + (set HI tmp1 sr) + (set HI tmp2 (and tmp1 (const 32768))) + (cond HI + ((ne HI tmp2 (const 1)) (ne HI sr (const 0)) + (sll HI tmp1 (const 1)) + (set HI tmp2 (and tmp1 (const 32768))) + (set HI count (add HI count (const 1))) + ) + ) + (set HI dr count) + ) + () +) + + +;bit instructions +;****************************************************************** +;bit clear +(define-pmacro (bclear name insn opc1) + (dni name + (.str name "bit clear" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $reg8$dot$qbit") + (+ opc1 OP2_14 reg8) + (sequence ((HI tmp1) (HI tmp2)) + (set tmp2 (const 1)) + (set tmp1 reg8) + (sll tmp2 qbit) + (inv tmp2) + (set BI tmp1(and tmp1 tmp2)) + (set HI reg8 tmp1)) + () + ) +) + +;clear direct bit +(dni bclr18 "bit logical MOVN" + ((PIPE OS) (IDOC ALU)) + "bclr $RegNam" + (+ OP1_11 OP2_14 RegNam) + (sequence ((HI tmp1) (HI tmp2)) + (set tmp2 (const 1)) + (set tmp1 reg8) + (sll tmp2 qbit) + (inv tmp2) + (set BI tmp1(and tmp1 tmp2)) + (set HI reg8 tmp1)) + () +) + + +(bclear bclr0 bclr QBIT_0 ) +(bclear bclr1 bclr QBIT_1 ) +(bclear bclr2 bclr QBIT_2 ) +(bclear bclr3 bclr QBIT_3 ) +(bclear bclr4 bclr QBIT_4 ) +(bclear bclr5 bclr QBIT_5 ) +(bclear bclr6 bclr QBIT_6 ) +(bclear bclr7 bclr QBIT_7 ) +(bclear bclr8 bclr QBIT_8 ) +(bclear bclr9 bclr QBIT_9 ) +(bclear bclr10 bclr QBIT_10 ) +(bclear bclr11 bclr QBIT_11 ) +(bclear bclr12 bclr QBIT_12 ) +(bclear bclr13 bclr QBIT_13 ) +(bclear bclr14 bclr QBIT_14 ) +(bclear bclr15 bclr QBIT_15 ) + +;set direct bit +(dni bset19 "bit logical MOVN" + ((PIPE OS) (IDOC ALU)) + "bset $RegNam" + (+ OP1_11 OP2_15 RegNam) + (sequence ((HI tmp1) (HI tmp2)) + (set tmp2 (const 1)) + (set tmp1 reg8) + (sll tmp2 qbit) + (set BI tmp1(or tmp1 tmp2)) + (set HI reg8 tmp1)) + () +) + +;bit set +(define-pmacro (bitset name insn opc1) + (dni name + (.str name "bit set" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $reg8$dot$qbit") + (+ opc1 OP2_15 reg8) + (sequence ((HI tmp1) (HI tmp2)) + (set tmp2 (const 1)) + (set tmp1 reg8) + (sll tmp2 qbit) + (set BI tmp1(or tmp1 tmp2)) + (set HI reg8 tmp1)) + () + ) +) + + +(bitset bset0 bset QBIT_0 ) +(bitset bset1 bset QBIT_1 ) +(bitset bset2 bset QBIT_2 ) +(bitset bset3 bset QBIT_3 ) +(bitset bset4 bset QBIT_4 ) +(bitset bset5 bset QBIT_5 ) +(bitset bset6 bset QBIT_6 ) +(bitset bset7 bset QBIT_7 ) +(bitset bset8 bset QBIT_8 ) +(bitset bset9 bset QBIT_9 ) +(bitset bset10 bset QBIT_10 ) +(bitset bset11 bset QBIT_11 ) +(bitset bset12 bset QBIT_12 ) +(bitset bset13 bset QBIT_13 ) +(bitset bset14 bset QBIT_14 ) +(bitset bset15 bset QBIT_15 ) + +;mov direct bit +;BMOV bitaddrZ.z,bitaddrQ.q +(dni bmov "bit logical MOV" + ((PIPE OS) (IDOC ALU)) + "bmov $reghi8$dot$qhibit,$reg8$dot$qlobit" + (+ OP1_4 OP2_10 reg8 reghi8 qhibit qlobit) + (sequence ((HI tmp1) (HI tmp2) (HI tmp3) (HI tmp4)) + (set HI tmp1 reghi8) + (set HI tmp2 reg8) + (set tmp3 (const 1)) + (set tmp4 (const 1)) + (sll tmp3 qlobit) + (sll tmp4 qhibit) + (and tmp1 tmp3) + (and tmp2 tmp4) + (set BI tmp1 tmp2) + (set HI reghi8 tmp1) + (set HI reg8 tmp2)) + () +) + +;movn direct bit +;BMOVN bitaddrZ.z,bitaddrQ.q +(dni bmovn "bit logical MOVN" + ((PIPE OS) (IDOC ALU)) + "bmovn $reghi8$dot$qhibit,$reg8$dot$qlobit" + (+ OP1_3 OP2_10 reg8 reghi8 qhibit qlobit) + (sequence ((HI tmp1) (HI tmp2) (HI tmp3) (HI tmp4)) + (set HI tmp1 reghi8) + (set HI tmp2 reg8) + (set tmp3 (const 1)) + (set tmp4 (const 1)) + (sll tmp3 qlobit) + (sll tmp4 qhibit) + (and tmp1 tmp3) + (and tmp2 tmp4) + (inv HI tmp2) + (set BI tmp1 tmp2) + (set HI reghi8 tmp1) + (set HI reg8 tmp2)) + () +) + +;and direct bit +;BAND bitaddrZ.z,bitaddrQ.q +(dni band "bit logical AND" + ((PIPE OS) (IDOC ALU)) + "band $reghi8$dot$qhibit,$reg8$dot$qlobit" + (+ OP1_6 OP2_10 reg8 reghi8 qhibit qlobit) + (sequence ((HI tmp1) (HI tmp2) (HI tmp3) (HI tmp4)) + (set HI tmp1 reghi8) + (set HI tmp2 reg8) + (set tmp3 (const 1)) + (set tmp4 (const 1)) + (sll tmp3 qlobit) + (sll tmp4 qhibit) + (and tmp1 tmp3) + (and tmp2 tmp4) + (set BI tmp1(and tmp1 tmp2)) + (set HI reghi8 tmp1) + (set HI reg8 tmp2)) + () +) + +;or direct bit +;BOR bitaddrZ.z,bitaddrQ.q +(dni bor "bit logical OR" + ((PIPE OS) (IDOC ALU)) + "bor $reghi8$dot$qhibit,$reg8$dot$qlobit" + (+ OP1_5 OP2_10 reg8 reghi8 qhibit qlobit) + (sequence ((HI tmp1) (HI tmp2) (HI tmp3) (HI tmp4)) + (set HI tmp1 reghi8) + (set HI tmp2 reg8) + (set tmp3 (const 1)) + (set tmp4 (const 1)) + (sll tmp3 qlobit) + (sll tmp4 qhibit) + (and tmp1 tmp3) + (and tmp2 tmp4) + (set BI tmp1(or tmp1 tmp2)) + (set HI reghi8 tmp1) + (set HI reg8 tmp2)) + () +) + +;xor direct bit +;BXOR bitaddrZ.z,bitaddrQ.q +(dni bxor "bit logical XOR" + ((PIPE OS) (IDOC ALU)) + "bxor $reghi8$dot$qhibit,$reg8$dot$qlobit" + (+ OP1_7 OP2_10 reg8 reghi8 qhibit qlobit) + (sequence ((HI tmp1) (HI tmp2) (HI tmp3) (HI tmp4)) + (set HI tmp1 reghi8) + (set HI tmp2 reg8) + (set tmp3 (const 1)) + (set tmp4 (const 1)) + (sll tmp3 qlobit) + (sll tmp4 qhibit) + (and tmp1 tmp3) + (and tmp2 tmp4) + (set BI tmp1(xor tmp1 tmp2)) + (set HI reghi8 tmp1) + (set HI reg8 tmp2)) + () +) + +;cmp direct bit to bit +;BCMP bitaddrZ.z,bitaddrQ.q +(dni bcmp "bit to bit compare" + ((PIPE OS) (IDOC ALU)) + "bcmp $reghi8$dot$qhibit,$reg8$dot$qlobit" + (+ OP1_2 OP2_10 reg8 reghi8 qhibit qlobit) + (sequence ((HI tmp1) (HI tmp2) (HI tmp3) (HI tmp4)) + (set HI tmp1 reghi8) + (set HI tmp2 reg8) + (set tmp3 (const 1)) + (set tmp4 (const 1)) + (sll tmp3 qlobit) + (sll tmp4 qhibit) + (and tmp1 tmp3) + (and tmp2 tmp4) + (set BI tmp1(xor tmp1 tmp2)) + (set HI reghi8 tmp1) + (set HI reg8 tmp2)) + () +) + +;bit field low byte +;BFLDL op1,op2,op3 +(dni bfldl "bit field low byte" + ((PIPE OS) (IDOC MOVE)) + "bfldl $reg8,$hash$mask8,$hash$datahi8" + (+ OP1_0 OP2_10 reg8 mask8 datahi8) + (sequence ((HI tmp1) (QI tmp2) (QI tmp3)) + (set HI tmp1 reg8) + (set QI tmp2 mask8) + (set QI tmp3 datahi8) + (inv QI tmp2) + (set HI tmp1 (and tmp1 tmp2)) + (set HI tmp1 (or tmp1 tmp3)) + (set HI reg8 tmp1) + ) + () +) + +;bit field high byte +;BFLDH op1,op2,op3 +(dni bfldh "bit field high byte" + ((PIPE OS) (IDOC MOVE)) + "bfldh $reg8,$hash$masklo8,$hash$data8" + (+ OP1_1 OP2_10 reg8 masklo8 data8) + (sequence ((HI tmp1) (HI tmp2) (HI tmp3)) + (set HI tmp1 reg8) + (set QI tmp2 masklo8) + (set HI tmp3 data8) + (sll tmp2 (const 8)) + (inv HI tmp2) + (sll tmp3 (const 8)) + (set HI tmp1 (and tmp1 tmp2)) + (set HI tmp1 (or tmp1 tmp3)) + (set HI reg8 tmp1) + ) + () +) + +;/**********compare instructions****************** + +;Compare register +;CMP Rwn,Rwm +(dni cmpr "compare two registers" + ((PIPE OS) (IDOC CMP)) + "cmp $src1,$src2" + (+ OP1_4 OP2_0 src1 src2) + (set condbit (lt HI src1 src2)) + () +) + +;Compare byte register +;CMPB Rbn,Rbm +(dni cmpbr "compare two byte registers" + ((PIPE OS) (IDOC CMP)) + "cmpb $drb,$srb" + (+ OP1_4 OP2_1 drb srb) + (set condbit (lt QI drb srb)) + () +) + +(define-pmacro (cmp1 name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "compare" ) + ((PIPE OS) (IDOC CMP)) + (.str insn " $"op1 ",$hash$"op2) + (+ opc1 opc2 op1 (f-op-bit1 0) op2) + (set condbit (lt mode op1 op2)) + () + ) +) +(cmp1 cmpri cmp OP1_4 OP2_8 src1 uimm3 HI) +(cmp1 cmpbri cmpb OP1_4 OP2_9 drb uimm3 QI) + +; CMP Rwn,#data16 +(dni cmpi "compare" + ((PIPE OS) (IDOC CMP)) + "cmp $reg8,$hash$uimm16" + (+ OP1_4 OP2_6 reg8 uimm16) + (set condbit (lt HI reg8 uimm16)) + () +) + +; CMPB reg,#data8 +(dni cmpbi "compare" + ((PIPE OS) (IDOC CMP)) + "cmpb $regb8,$hash$uimm8" + (+ OP1_4 OP2_7 regb8 uimm8 (f-op-bit8 0)) + (set condbit (lt QI regb8 uimm8)) + () +) + +;compare reg and indirect memory +(define-pmacro (cmp2 name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "compare" ) + ((PIPE OS) (IDOC CMP)) + (.str insn " $"op1 ",[$"op2"]") + (+ opc1 opc2 op1 (f-op-bit2 2) op2) + (set condbit (lt mode op1 op2)) + () + ) +) +(cmp2 cmpr2 cmp OP1_4 OP2_8 dr sr2 HI) +(cmp2 cmpbr2 cmpb OP1_4 OP2_9 drb sr2 QI) + +;compare register and indirect memory post increment +(define-pmacro (cmp3 name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "compare" ) + ((PIPE OS) (IDOC CMP)) + (.str insn " $"op1 ",[$"op2"+]") + (+ opc1 opc2 op1 (f-op-bit2 3) op2) + (sequence () + (set condbit (lt mode op1 op2)) + (set HI op2 (add HI op2 (const 2))) + ) + () + ) +) +(cmp3 cmp2i cmp OP1_4 OP2_8 dr sr2 HI) +(cmp3 cmpb2i cmpb OP1_4 OP2_9 drb sr2 QI) + +;compare register and direct memory +(define-pmacro (cmp4 name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "compare" ) + ((PIPE OS) (IDOC CMP)) + (.str insn " $"op1 ",$pof$"op2) + (+ opc1 opc2 op1 op2) + (set condbit (lt HI op1 (mem HI op2))) + () + ) +) +(cmp4 cmp04 cmp OP1_4 OP2_2 reg8 upof16 HI) +(cmp4 cmpb4 cmpb OP1_4 OP2_3 regb8 upof16 QI) + +;compare register and direct memory +(define-pmacro (cmp4 name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "compare" ) + ((PIPE OS) (IDOC CMP)) + (.str insn " $"op1 ",$"op2) + (+ opc1 opc2 op1 op2) + (set condbit (lt HI op1 (mem HI op2))) + () + ) +) +(cmp4 cmp004 cmp OP1_4 OP2_2 regmem8 memgr8 HI) +(cmp4 cmp0004 cmp OP1_4 OP2_2 reg8 memory HI) +(cmp4 cmpb04 cmpb OP1_4 OP2_3 regbmem8 memgr8 QI) +(cmp4 cmpb004 cmpb OP1_4 OP2_3 regb8 memory QI) + +;compare register and immediate +(define-pmacro (cmp5 name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "compare" ) + ((PIPE OS) (IDOC CMP)) + (.str insn " $"op1 ",$hash$"op2) + (+ opc1 opc2 op2 op1) + (sequence () + (set condbit (lt HI op1 op2)) + (set mode op1 (sub HI op1 (const 1))) + ) + () + ) +) +(cmp5 cmpd1ri cmpd1 OP1_10 OP2_0 sr uimm4 HI) +(cmp5 cmpd2ri cmpd2 OP1_11 OP2_0 sr uimm4 HI) +(cmp5 cmpi1ri cmpi1 OP1_8 OP2_0 sr uimm4 HI) +(cmp5 cmpi2ri cmpi2 OP1_9 OP2_0 sr uimm4 HI) +(cmp5 cmpd1rim cmpd1 OP1_10 OP2_6 reg8 uimm16 HI) +(cmp5 cmpd2rim cmpd2 OP1_11 OP2_6 reg8 uimm16 HI) +(cmp5 cmpi1rim cmpi1 OP1_8 OP2_6 reg8 uimm16 HI) +(cmp5 cmpi2rim cmpi2 OP1_9 OP2_6 reg8 uimm16 HI) + +;compare register and direct memory +(define-pmacro (cmp6 name insn opc1 opc2 op1 op2 mode ) + (dni name + (.str name "compare" ) + ((PIPE OS) (IDOC CMP)) + (.str insn " $"op1 ",$pof$"op2) + (+ opc1 opc2 op1 op2) + (sequence () + (set condbit (lt HI op1 (mem HI op2))) + (set mode op1 (sub HI op1 (const 1))) + ) + () + ) +) +(cmp6 cmpd1rp cmpd1 OP1_10 OP2_2 reg8 upof16 HI ) +(cmp6 cmpd2rp cmpd2 OP1_11 OP2_2 reg8 upof16 HI ) +(cmp6 cmpi1rp cmpi1 OP1_8 OP2_2 reg8 upof16 HI ) +(cmp6 cmpi2rp cmpi2 OP1_9 OP2_2 reg8 upof16 HI ) + +;compare register and direct memory +(define-pmacro (cmp7 name insn opc1 opc2 op1 op2 mode) + (dni name + (.str name "compare" ) + ((PIPE OS) (IDOC CMP)) + (.str insn " $"op1 ",$"op2) + (+ opc1 opc2 op1 op2) + (sequence () + (set condbit (lt HI op1 (mem HI op2))) + (set mode op1 (sub HI op1 (const 1))) + ) + () + ) +) +(cmp7 cmpd1rm cmpd1 OP1_10 OP2_2 regmem8 memgr8 HI) +(cmp7 cmpd2rm cmpd2 OP1_11 OP2_2 regmem8 memgr8 HI) +(cmp7 cmpi1rm cmpi1 OP1_8 OP2_2 regmem8 memgr8 HI) +(cmp7 cmpi2rm cmpi2 OP1_9 OP2_2 regmem8 memgr8 HI) +(cmp7 cmpd1rmi cmpd1 OP1_10 OP2_2 reg8 memory HI) +(cmp7 cmpd2rmi cmpd2 OP1_11 OP2_2 reg8 memory HI) +(cmp7 cmpi1rmi cmpi1 OP1_8 OP2_2 reg8 memory HI) +(cmp7 cmpi2rmi cmpi2 OP1_9 OP2_2 reg8 memory HI) + + +;Shift and rotate insns +;**************************************************************** +(define-pmacro (shift name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "shift" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$"op2) + (+ opc1 opc2 op1 op2) + (set mode op1 (insn1 mode op1 op2)) + () + ) +) +(shift shlr shl sll OP1_4 OP2_12 dr sr HI) +(shift shrr shr srl OP1_6 OP2_12 dr sr HI) +(shift rolr rol rol OP1_0 OP2_12 dr sr HI) +(shift rorr ror ror OP1_2 OP2_12 dr sr HI) +(shift ashrr ashr sra OP1_10 OP2_12 dr sr HI) + +(define-pmacro (shift1 name insn insn1 opc1 opc2 op1 op2 mode) + (dni name + (.str name "shift" ) + ((PIPE OS) (IDOC ALU)) + (.str insn " $"op1 ",$hash$"op2) + (+ opc1 opc2 op2 op1) + (set mode op1 (insn1 mode op1 op2)) + () + ) +) +(shift1 shlri shl sll OP1_5 OP2_12 sr uimm4 HI) +(shift1 shrri shr srl OP1_7 OP2_12 sr uimm4 HI) +(shift1 rolri rol rol OP1_1 OP2_12 sr uimm4 HI) +(shift1 rorri ror ror OP1_3 OP2_12 sr uimm4 HI) +(shift1 ashrri ashr sra OP1_11 OP2_12 sr uimm4 HI) diff --git a/djunpack.bat b/djunpack.bat new file mode 100755 index 00000000000..f09f5ed3251 --- /dev/null +++ b/djunpack.bat @@ -0,0 +1,52 @@ +@echo off +Rem +Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line +Rem format, or else stock DOS/Windows shells will refuse to run it. +Rem +Rem This batch file unpacks the GDB distribution while simultaneously +Rem renaming some of the files whose names are invalid on DOS or conflict +Rem with other file names after truncation to DOS 8+3 namespace. +Rem +Rem Invoke like this: +Rem +Rem djunpack gdb-XYZ.tar +Rem +Rem where XYZ is the version number. If the argument includes leading +Rem directories, it MUST use backslashes, not forward slashes. +Rem +Rem The following 2 lines need to be changed with each new GDB release, to +Rem be identical to the name of the top-level directory where the GDB +Rem distribution unpacks itself. +set GDBVER=gdb-5.0 +if "%GDBVER%"=="gdb-5.0" GoTo EnvOk +Rem If their environment space is too small, re-exec with a larger one +command.com /e:4096 /c %0 %1 +GoTo End +:EnvOk +if not exist %1 GoTo NoArchive +djtar -x -p -o %GDBVER%/gdb/config/djgpp/fnchange.lst %1 > fnchange.tmp +Rem The following uses a feature of COPY whereby it does not copy +Rem empty files. We need that because the previous line will create +Rem an empty fnchange.tmp even if the command failed for some reason. +copy fnchange.tmp junk.tmp > nul +if not exist junk.tmp GoTo NoDjTar +del junk.tmp +sed -e 's,@V@,%GDBVER%,g' < fnchange.tmp > fnchange.lst +Rem See the comment above about the reason for using COPY. +copy fnchange.lst junk.tmp > nul +if not exist junk.tmp GoTo NoSed +del junk.tmp +djtar -x -n fnchange.lst %1 +GoTo End +:NoSed +echo FAIL: Sed is not available. +GoTo End +:NoDjTar +echo FAIL: DJTAR is not available or no fnchange.lst file in %1. +GoTo End +:NoArchive +echo FAIL: the file %1 does not seem to exist. +echo Remember that %1 cannot use forward slashes, only backslashes. +GoTo End +:End +set GDBVER= diff --git a/elfcpp/README b/elfcpp/README new file mode 100644 index 00000000000..9eb07e8c479 --- /dev/null +++ b/elfcpp/README @@ -0,0 +1,9 @@ +elfcpp is a C++ library for reading and writing ELF information. This +was written to support gold, the ELF linker, and may not be generally +useful. + +elfcpp does not do file I/O. It deals only with offsets and memory +data. + +For efficiency, most accessors are templates with two arguments: the +ELF file class (32 or 64 bits) and the endianness. diff --git a/elfcpp/elfcpp.h b/elfcpp/elfcpp.h new file mode 100644 index 00000000000..305487f8bf0 --- /dev/null +++ b/elfcpp/elfcpp.h @@ -0,0 +1,1622 @@ +// elfcpp.h -- main header file for elfcpp -*- C++ -*- + +// This is the external interface for elfcpp. + +#ifndef ELFCPP_H +#define ELFCPP_H + +#include "elfcpp_config.h" +#include "elfcpp_swap.h" + +#include + +namespace elfcpp +{ + +// Basic ELF types. + +// These types are always the same size. + +typedef uint16_t Elf_Half; +typedef uint32_t Elf_Word; +typedef int32_t Elf_Sword; +typedef uint64_t Elf_Xword; +typedef int64_t Elf_Sxword; + +// These types vary in size depending on the ELF file class. The +// template parameter should be 32 or 64. + +template +struct Elf_types; + +template<> +struct Elf_types<32> +{ + typedef uint32_t Elf_Addr; + typedef uint32_t Elf_Off; + typedef uint32_t Elf_WXword; + typedef int32_t Elf_Swxword; +}; + +template<> +struct Elf_types<64> +{ + typedef uint64_t Elf_Addr; + typedef uint64_t Elf_Off; + typedef uint64_t Elf_WXword; + typedef int64_t Elf_Swxword; +}; + +// Offsets within the Ehdr e_ident field. + +const int EI_MAG0 = 0; +const int EI_MAG1 = 1; +const int EI_MAG2 = 2; +const int EI_MAG3 = 3; +const int EI_CLASS = 4; +const int EI_DATA = 5; +const int EI_VERSION = 6; +const int EI_OSABI = 7; +const int EI_ABIVERSION = 8; +const int EI_PAD = 9; +const int EI_NIDENT = 16; + +// The valid values found in Ehdr e_ident[EI_MAG0 through EI_MAG3]. + +const int ELFMAG0 = 0x7f; +const int ELFMAG1 = 'E'; +const int ELFMAG2 = 'L'; +const int ELFMAG3 = 'F'; + +// The valid values found in Ehdr e_ident[EI_CLASS]. + +enum +{ + ELFCLASSNONE = 0, + ELFCLASS32 = 1, + ELFCLASS64 = 2 +}; + +// The valid values found in Ehdr e_ident[EI_DATA]. + +enum +{ + ELFDATANONE = 0, + ELFDATA2LSB = 1, + ELFDATA2MSB = 2 +}; + +// The valid values found in Ehdr e_ident[EI_VERSION] and e_version. + +enum +{ + EV_NONE = 0, + EV_CURRENT = 1 +}; + +// The valid values found in Ehdr e_ident[EI_OSABI]. + +enum ELFOSABI +{ + ELFOSABI_NONE = 0, + ELFOSABI_HPUX = 1, + ELFOSABI_NETBSD = 2, + // ELFOSABI_LINUX is not listed in the ELF standard. + ELFOSABI_LINUX = 3, + // ELFOSABI_HURD is not listed in the ELF standard. + ELFOSABI_HURD = 4, + ELFOSABI_SOLARIS = 6, + ELFOSABI_AIX = 7, + ELFOSABI_IRIX = 8, + ELFOSABI_FREEBSD = 9, + ELFOSABI_TRU64 = 10, + ELFOSABI_MODESTO = 11, + ELFOSABI_OPENBSD = 12, + ELFOSABI_OPENVMS = 13, + ELFOSABI_NSK = 14, + ELFOSABI_AROS = 15, + // A GNU extension for the ARM. + ELFOSABI_ARM = 97, + // A GNU extension for the MSP. + ELFOSABI_STANDALONE = 255 +}; + +// The valid values found in the Ehdr e_type field. + +enum ET +{ + ET_NONE = 0, + ET_REL = 1, + ET_EXEC = 2, + ET_DYN = 3, + ET_CORE = 4, + ET_LOOS = 0xfe00, + ET_HIOS = 0xfeff, + ET_LOPROC = 0xff00, + ET_HIPROC = 0xffff +}; + +// The valid values found in the Ehdr e_machine field. + +enum EM +{ + EM_NONE = 0, + EM_M32 = 1, + EM_SPARC = 2, + EM_386 = 3, + EM_68K = 4, + EM_88K = 5, + // 6 used to be EM_486 + EM_860 = 7, + EM_MIPS = 8, + EM_S370 = 9, + EM_MIPS_RS3_LE = 10, + // 11 was the old Sparc V9 ABI. + // 12 through 14 are reserved. + EM_PARISC = 15, + // 16 is reserved. + // Some old PowerPC object files use 17. + EM_VPP500 = 17, + EM_SPARC32PLUS = 18, + EM_960 = 19, + EM_PPC = 20, + EM_PPC64 = 21, + EM_S390 = 22, + // 23 through 35 are served. + EM_V800 = 36, + EM_FR20 = 37, + EM_RH32 = 38, + EM_RCE = 39, + EM_ARM = 40, + EM_ALPHA = 41, + EM_SH = 42, + EM_SPARCV9 = 43, + EM_TRICORE = 44, + EM_ARC = 45, + EM_H8_300 = 46, + EM_H8_300H = 47, + EM_H8S = 48, + EM_H8_500 = 49, + EM_IA_64 = 50, + EM_MIPS_X = 51, + EM_COLDFIRE = 52, + EM_68HC12 = 53, + EM_MMA = 54, + EM_PCP = 55, + EM_NCPU = 56, + EM_NDR1 = 57, + EM_STARCORE = 58, + EM_ME16 = 59, + EM_ST100 = 60, + EM_TINYJ = 61, + EM_X86_64 = 62, + EM_PDSP = 63, + EM_PDP10 = 64, + EM_PDP11 = 65, + EM_FX66 = 66, + EM_ST9PLUS = 67, + EM_ST7 = 68, + EM_68HC16 = 69, + EM_68HC11 = 70, + EM_68HC08 = 71, + EM_68HC05 = 72, + EM_SVX = 73, + EM_ST19 = 74, + EM_VAX = 75, + EM_CRIS = 76, + EM_JAVELIN = 77, + EM_FIREPATH = 78, + EM_ZSP = 79, + EM_MMIX = 80, + EM_HUANY = 81, + EM_PRISM = 82, + EM_AVR = 83, + EM_FR30 = 84, + EM_D10V = 85, + EM_D30V = 86, + EM_V850 = 87, + EM_M32R = 88, + EM_MN10300 = 89, + EM_MN10200 = 90, + EM_PJ = 91, + EM_OPENRISC = 92, + EM_ARC_A5 = 93, + EM_XTENSA = 94, + EM_VIDEOCORE = 95, + EM_TMM_GPP = 96, + EM_NS32K = 97, + EM_TPC = 98, + // Some old picoJava object files use 99 (EM_PJ is correct). + EM_SNP1K = 99, + EM_ST200 = 100, + EM_IP2K = 101, + EM_MAX = 102, + EM_CR = 103, + EM_F2MC16 = 104, + EM_MSP430 = 105, + EM_BLACKFIN = 106, + EM_SE_C33 = 107, + EM_SEP = 108, + EM_ARCA = 109, + EM_UNICORE = 110, + EM_ALTERA_NIOS2 = 113, + EM_CRX = 114, + // The Morph MT. + EM_MT = 0x2530, + // DLX. + EM_DLX = 0x5aa5, + // FRV. + EM_FRV = 0x5441, + // Infineon Technologies 16-bit microcontroller with C166-V2 core. + EM_X16X = 0x4688, + // Xstorym16 + EM_XSTORMY16 = 0xad45, + // Renesas M32C + EM_M32C = 0xfeb0, + // Vitesse IQ2000 + EM_IQ2000 = 0xfeba, + // NIOS + EM_NIOS32 = 0xfebb + // Old AVR objects used 0x1057 (EM_AVR is correct). + // Old MSP430 objects used 0x1059 (EM_MSP430 is correct). + // Old FR30 objects used 0x3330 (EM_FR30 is correct). + // Old OpenRISC objects used 0x3426 and 0x8472 (EM_OPENRISC is correct). + // Old D10V objects used 0x7650 (EM_D10V is correct). + // Old D30V objects used 0x7676 (EM_D30V is correct). + // Old IP2X objects used 0x8217 (EM_IP2K is correct). + // Old PowerPC objects used 0x9025 (EM_PPC is correct). + // Old Alpha objects used 0x9026 (EM_ALPHA is correct). + // Old M32R objects used 0x9041 (EM_M32R is correct). + // Old V850 objects used 0x9080 (EM_V850 is correct). + // Old S/390 objects used 0xa390 (EM_S390 is correct). + // Old Xtensa objects used 0xabc7 (EM_XTENSA is correct). + // Old MN10300 objects used 0xbeef (EM_MN10300 is correct). + // Old MN10200 objects used 0xdead (EM_MN10200 is correct). +}; + +// Special section indices. + +enum +{ + SHN_UNDEF = 0, + SHN_LORESERVE = 0xff00, + SHN_LOPROC = 0xff00, + SHN_HIPROC = 0xff1f, + SHN_LOOS = 0xff20, + SHN_HIOS = 0xff3f, + SHN_ABS = 0xfff1, + SHN_COMMON = 0xfff2, + SHN_XINDEX = 0xffff, + SHN_HIRESERVE = 0xffff +}; + +// The valid values found in the Shdr sh_type field. + +enum SHT +{ + SHT_NULL = 0, + SHT_PROGBITS = 1, + SHT_SYMTAB = 2, + SHT_STRTAB = 3, + SHT_RELA = 4, + SHT_HASH = 5, + SHT_DYNAMIC = 6, + SHT_NOTE = 7, + SHT_NOBITS = 8, + SHT_REL = 9, + SHT_SHLIB = 10, + SHT_DYNSYM = 11, + SHT_INIT_ARRAY = 14, + SHT_FINI_ARRAY = 15, + SHT_PREINIT_ARRAY = 16, + SHT_GROUP = 17, + SHT_SYMTAB_SHNDX = 18, + SHT_LOOS = 0x60000000, + SHT_HIOS = 0x6fffffff, + SHT_LOPROC = 0x70000000, + SHT_HIPROC = 0x7fffffff, + SHT_LOUSER = 0x80000000, + SHT_HIUSER = 0xffffffff, + // The remaining values are not in the standard. + // List of prelink dependencies. + SHT_GNU_LIBLIST = 0x6ffffff7, + // Versions defined by file. + SHT_SUNW_verdef = 0x6ffffffd, + SHT_GNU_verdef = 0x6ffffffd, + // Versions needed by file. + SHT_SUNW_verneed = 0x6ffffffe, + SHT_GNU_verneed = 0x6ffffffe, + // Symbol versions, + SHT_SUNW_versym = 0x6fffffff, + SHT_GNU_versym = 0x6fffffff, +}; + +// The valid bit flags found in the Shdr sh_flags field. + +enum SHF +{ + SHF_WRITE = 0x1, + SHF_ALLOC = 0x2, + SHF_EXECINSTR = 0x4, + SHF_MERGE = 0x10, + SHF_STRINGS = 0x20, + SHF_INFO_LINK = 0x40, + SHF_LINK_ORDER = 0x80, + SHF_OS_NONCONFORMING = 0x100, + SHF_GROUP = 0x200, + SHF_TLS = 0x400, + SHF_MASKOS = 0x0ff00000, + SHF_MASKPROC = 0xf0000000 +}; + +// Bit flags which appear in the first 32-bit word of the section data +// of a SHT_GROUP section. + +enum +{ + GRP_COMDAT = 0x1, + GRP_MASKOS = 0x0ff00000, + GRP_MASKPROC = 0xf0000000 +}; + +// The valid values found in the Phdr p_type field. + +enum PT +{ + PT_NULL = 0, + PT_LOAD = 1, + PT_DYNAMIC = 2, + PT_INTERP = 3, + PT_NOTE = 4, + PT_SHLIB = 5, + PT_PHDR = 6, + PT_TLS = 7, + PT_LOOS = 0x60000000, + PT_HIOS = 0x6fffffff, + PT_LOPROC = 0x70000000, + PT_HIPROC = 0x7fffffff, + // The remaining values are not in the standard. + // Frame unwind information. + PT_GNU_EH_FRAME = 0x6474e550, + PT_SUNW_EH_FRAME = 0x6474e550, + // Stack flags. + PT_GNU_STACK = 0x6474e551, + // Read only after relocation. + PT_GNU_RELRO = 0x6474e552 +}; + +// The valid bit flags found in the Phdr p_flags field. + +enum PF +{ + PF_X = 0x1, + PF_W = 0x2, + PF_R = 0x4, + PF_MASKOS = 0x0ff00000, + PF_MASKPROC = 0xf0000000 +}; + +// Symbol binding from Sym st_info field. + +enum STB +{ + STB_LOCAL = 0, + STB_GLOBAL = 1, + STB_WEAK = 2, + STB_LOOS = 10, + STB_HIOS = 12, + STB_LOPROC = 13, + STB_HIPROC = 15 +}; + +// Symbol types from Sym st_info field. + +enum STT +{ + STT_NOTYPE = 0, + STT_OBJECT = 1, + STT_FUNC = 2, + STT_SECTION = 3, + STT_FILE = 4, + STT_COMMON = 5, + STT_TLS = 6, + STT_LOOS = 10, + STT_HIOS = 12, + STT_LOPROC = 13, + STT_HIPROC = 15 +}; + +inline STB +elf_st_bind(unsigned char info) +{ + return static_cast(info >> 4); +} + +inline STT +elf_st_type(unsigned char info) +{ + return static_cast(info & 0xf); +} + +inline unsigned char +elf_st_info(STB bind, STT type) +{ + return ((static_cast(bind) << 4) + + (static_cast(type) & 0xf)); +} + +// Symbol visibility from Sym st_other field. + +enum STV +{ + STV_DEFAULT = 0, + STV_INTERNAL = 1, + STV_HIDDEN = 2, + STV_PROTECTED = 3 +}; + +inline STV +elf_st_visibility(unsigned char other) +{ + return static_cast(other & 0x3); +} + +inline unsigned char +elf_st_nonvis(unsigned char other) +{ + return static_cast(other >> 2); +} + +inline unsigned char +elf_st_other(STV vis, unsigned char nonvis) +{ + return ((nonvis << 2) + + (static_cast(vis) & 3)); +} + +// Reloc information from Rel/Rela r_info field. + +template +unsigned int +elf_r_sym(typename Elf_types::Elf_WXword); + +template<> +inline unsigned int +elf_r_sym<32>(Elf_Word v) +{ + return v >> 8; +} + +template<> +inline unsigned int +elf_r_sym<64>(Elf_Xword v) +{ + return v >> 32; +} + +template +unsigned int +elf_r_type(typename Elf_types::Elf_WXword); + +template<> +inline unsigned int +elf_r_type<32>(Elf_Word v) +{ + return v & 0xff; +} + +template<> +inline unsigned int +elf_r_type<64>(Elf_Xword v) +{ + return v & 0xffffffff; +} + +template +typename Elf_types::Elf_WXword +elf_r_info(unsigned int s, unsigned int t); + +template<> +inline Elf_Word +elf_r_info<32>(unsigned int s, unsigned int t) +{ + return (s << 8) + (t & 0xff); +} + +template<> +inline Elf_Xword +elf_r_info<64>(unsigned int s, unsigned int t) +{ + return (static_cast(s) << 32) + (t & 0xffffffff); +} + +// Dynamic tags found in the PT_DYNAMIC segment. + +enum DT +{ + DT_NULL = 0, + DT_NEEDED = 1, + DT_PLTRELSZ = 2, + DT_PLTGOT = 3, + DT_HASH = 4, + DT_STRTAB = 5, + DT_SYMTAB = 6, + DT_RELA = 7, + DT_RELASZ = 8, + DT_RELAENT = 9, + DT_STRSZ = 10, + DT_SYMENT = 11, + DT_INIT = 12, + DT_FINI = 13, + DT_SONAME = 14, + DT_RPATH = 15, + DT_SYMBOLIC = 16, + DT_REL = 17, + DT_RELSZ = 18, + DT_RELENT = 19, + DT_PLTREL = 20, + DT_DEBUG = 21, + DT_TEXTREL = 22, + DT_JMPREL = 23, + DT_BIND_NOW = 24, + DT_INIT_ARRAY = 25, + DT_FINI_ARRAY = 26, + DT_INIT_ARRAYSZ = 27, + DT_FINI_ARRAYSZ = 28, + DT_RUNPATH = 29, + DT_FLAGS = 30, + DT_ENCODING = 32, + DT_PREINIT_ARRAY = 33, + DT_PREINIT_ARRAYSZ = 33, + DT_LOOS = 0x6000000d, + DT_HIOS = 0x6ffff000, + DT_LOPROC = 0x70000000, + DT_HIPROC = 0x7fffffff, + + // The remaining values are extensions used by GNU or Solaris. + DT_VALRNGLO = 0x6ffffd00, + DT_GNU_PRELINKED = 0x6ffffdf5, + DT_GNU_CONFLICTSZ = 0x6ffffdf6, + DT_GNU_LIBLISTSZ = 0x6ffffdf7, + DT_CHECKSUM = 0x6ffffdf8, + DT_PLTPADSZ = 0x6ffffdf9, + DT_MOVEENT = 0x6ffffdfa, + DT_MOVESZ = 0x6ffffdfb, + DT_FEATURE = 0x6ffffdfc, + DT_POSFLAG_1 = 0x6ffffdfd, + DT_SYMINSZ = 0x6ffffdfe, + DT_SYMINENT = 0x6ffffdff, + DT_VALRNGHI = 0x6ffffdff, + + DT_ADDRRNGLO = 0x6ffffe00, + DT_GNU_HASH = 0x6ffffef5, + DT_TLSDESC_PLT = 0x6ffffef6, + DT_TLSDESC_GOT = 0x6ffffef7, + DT_GNU_CONFLICT = 0x6ffffef8, + DT_GNU_LIBLIST = 0x6ffffef9, + DT_CONFIG = 0x6ffffefa, + DT_DEPAUDIT = 0x6ffffefb, + DT_AUDIT = 0x6ffffefc, + DT_PLTPAD = 0x6ffffefd, + DT_MOVETAB = 0x6ffffefe, + DT_SYMINFO = 0x6ffffeff, + DT_ADDRRNGHI = 0x6ffffeff, + + DT_RELACOUNT = 0x6ffffff9, + DT_RELCOUNT = 0x6ffffffa, + DT_FLAGS_1 = 0x6ffffffb, + DT_VERDEF = 0x6ffffffc, + DT_VERDEFNUM = 0x6ffffffd, + DT_VERNEED = 0x6ffffffe, + DT_VERNEEDNUM = 0x6fffffff, + + DT_VERSYM = 0x6ffffff0, + + DT_AUXILIARY = 0x7ffffffd, + DT_USED = 0x7ffffffe, + DT_FILTER = 0x7fffffff +}; + +// Flags found in the DT_FLAGS dynamic element. + +enum DF +{ + DF_ORIGIN = 0x1, + DF_SYMBOLIC = 0x2, + DF_TEXTREL = 0x4, + DF_BIND_NOW = 0x8, + DF_STATIC_TLS = 0x10 +}; + +// Version numbers which appear in the vd_version field of a Verdef +// structure. + +const int VER_DEF_NONE = 0; +const int VER_DEF_CURRENT = 1; + +// Version numbers which appear in the vn_version field of a Verneed +// structure. + +const int VER_NEED_NONE = 0; +const int VER_NEED_CURRENT = 1; + +// Bit flags which appear in vd_flags of Verdef and vna_flags of +// Vernaux. + +const int VER_FLG_BASE = 0x1; +const int VER_FLG_WEAK = 0x2; + +// Special constants found in the SHT_GNU_versym entries. + +const int VER_NDX_LOCAL = 0; +const int VER_NDX_GLOBAL = 1; + +// A SHT_GNU_versym section holds 16-bit words. This bit is set if +// the symbol is hidden and can only be seen when referenced using an +// explicit version number. This is a GNU extension. + +const int VERSYM_HIDDEN = 0x8000; + +// This is the mask for the rest of the data in a word read from a +// SHT_GNU_versym section. + +const int VERSYM_VERSION = 0x7fff; + +} // End namespace elfcpp. + +// Include internal details after defining the types. +#include "elfcpp_internal.h" + +namespace elfcpp +{ + +// The offset of the ELF file header in the ELF file. + +const int file_header_offset = 0; + +// ELF structure sizes. + +template +struct Elf_sizes +{ + // Size of ELF file header. + static const int ehdr_size = sizeof(internal::Ehdr_data); + // Size of ELF segment header. + static const int phdr_size = sizeof(internal::Phdr_data); + // Size of ELF section header. + static const int shdr_size = sizeof(internal::Shdr_data); + // Size of ELF symbol table entry. + static const int sym_size = sizeof(internal::Sym_data); + // Sizes of ELF reloc entries. + static const int rel_size = sizeof(internal::Rel_data); + static const int rela_size = sizeof(internal::Rela_data); + // Size of ELF dynamic entry. + static const int dyn_size = sizeof(internal::Dyn_data); + // Size of ELF version structures. + static const int verdef_size = sizeof(internal::Verdef_data); + static const int verdaux_size = sizeof(internal::Verdaux_data); + static const int verneed_size = sizeof(internal::Verneed_data); + static const int vernaux_size = sizeof(internal::Vernaux_data); +}; + +// Accessor class for the ELF file header. + +template +class Ehdr +{ + public: + Ehdr(const unsigned char* p) + : p_(reinterpret_cast*>(p)) + { } + + template + Ehdr(File* file, typename File::Location loc) + : p_(reinterpret_cast*>( + file->view(loc.file_offset, loc.data_size).data())) + { } + + const unsigned char* + get_e_ident() const + { return this->p_->e_ident; } + + Elf_Half + get_e_type() const + { return Convert<16, big_endian>::convert_host(this->p_->e_type); } + + Elf_Half + get_e_machine() const + { return Convert<16, big_endian>::convert_host(this->p_->e_machine); } + + Elf_Word + get_e_version() const + { return Convert<32, big_endian>::convert_host(this->p_->e_version); } + + typename Elf_types::Elf_Addr + get_e_entry() const + { return Convert::convert_host(this->p_->e_entry); } + + typename Elf_types::Elf_Off + get_e_phoff() const + { return Convert::convert_host(this->p_->e_phoff); } + + typename Elf_types::Elf_Off + get_e_shoff() const + { return Convert::convert_host(this->p_->e_shoff); } + + Elf_Word + get_e_flags() const + { return Convert<32, big_endian>::convert_host(this->p_->e_flags); } + + Elf_Half + get_e_ehsize() const + { return Convert<16, big_endian>::convert_host(this->p_->e_ehsize); } + + Elf_Half + get_e_phentsize() const + { return Convert<16, big_endian>::convert_host(this->p_->e_phentsize); } + + Elf_Half + get_e_phnum() const + { return Convert<16, big_endian>::convert_host(this->p_->e_phnum); } + + Elf_Half + get_e_shentsize() const + { return Convert<16, big_endian>::convert_host(this->p_->e_shentsize); } + + Elf_Half + get_e_shnum() const + { return Convert<16, big_endian>::convert_host(this->p_->e_shnum); } + + Elf_Half + get_e_shstrndx() const + { return Convert<16, big_endian>::convert_host(this->p_->e_shstrndx); } + + private: + const internal::Ehdr_data* p_; +}; + +// Write class for the ELF file header. + +template +class Ehdr_write +{ + public: + Ehdr_write(unsigned char* p) + : p_(reinterpret_cast*>(p)) + { } + + void + put_e_ident(const unsigned char v[EI_NIDENT]) const + { memcpy(this->p_->e_ident, v, EI_NIDENT); } + + void + put_e_type(Elf_Half v) + { this->p_->e_type = Convert<16, big_endian>::convert_host(v); } + + void + put_e_machine(Elf_Half v) + { this->p_->e_machine = Convert<16, big_endian>::convert_host(v); } + + void + put_e_version(Elf_Word v) + { this->p_->e_version = Convert<32, big_endian>::convert_host(v); } + + void + put_e_entry(typename Elf_types::Elf_Addr v) + { this->p_->e_entry = Convert::convert_host(v); } + + void + put_e_phoff(typename Elf_types::Elf_Off v) + { this->p_->e_phoff = Convert::convert_host(v); } + + void + put_e_shoff(typename Elf_types::Elf_Off v) + { this->p_->e_shoff = Convert::convert_host(v); } + + void + put_e_flags(Elf_Word v) + { this->p_->e_flags = Convert<32, big_endian>::convert_host(v); } + + void + put_e_ehsize(Elf_Half v) + { this->p_->e_ehsize = Convert<16, big_endian>::convert_host(v); } + + void + put_e_phentsize(Elf_Half v) + { this->p_->e_phentsize = Convert<16, big_endian>::convert_host(v); } + + void + put_e_phnum(Elf_Half v) + { this->p_->e_phnum = Convert<16, big_endian>::convert_host(v); } + + void + put_e_shentsize(Elf_Half v) + { this->p_->e_shentsize = Convert<16, big_endian>::convert_host(v); } + + void + put_e_shnum(Elf_Half v) + { this->p_->e_shnum = Convert<16, big_endian>::convert_host(v); } + + void + put_e_shstrndx(Elf_Half v) + { this->p_->e_shstrndx = Convert<16, big_endian>::convert_host(v); } + + private: + internal::Ehdr_data* p_; +}; + +// Accessor class for an ELF section header. + +template +class Shdr +{ + public: + Shdr(const unsigned char* p) + : p_(reinterpret_cast*>(p)) + { } + + template + Shdr(File* file, typename File::Location loc) + : p_(reinterpret_cast*>( + file->view(loc.file_offset, loc.data_size).data())) + { } + + Elf_Word + get_sh_name() const + { return Convert<32, big_endian>::convert_host(this->p_->sh_name); } + + Elf_Word + get_sh_type() const + { return Convert<32, big_endian>::convert_host(this->p_->sh_type); } + + typename Elf_types::Elf_WXword + get_sh_flags() const + { return Convert::convert_host(this->p_->sh_flags); } + + typename Elf_types::Elf_Addr + get_sh_addr() const + { return Convert::convert_host(this->p_->sh_addr); } + + typename Elf_types::Elf_Off + get_sh_offset() const + { return Convert::convert_host(this->p_->sh_offset); } + + typename Elf_types::Elf_WXword + get_sh_size() const + { return Convert::convert_host(this->p_->sh_size); } + + Elf_Word + get_sh_link() const + { return Convert<32, big_endian>::convert_host(this->p_->sh_link); } + + Elf_Word + get_sh_info() const + { return Convert<32, big_endian>::convert_host(this->p_->sh_info); } + + typename Elf_types::Elf_WXword + get_sh_addralign() const + { return + Convert::convert_host(this->p_->sh_addralign); } + + typename Elf_types::Elf_WXword + get_sh_entsize() const + { return Convert::convert_host(this->p_->sh_entsize); } + + private: + const internal::Shdr_data* p_; +}; + +// Write class for an ELF section header. + +template +class Shdr_write +{ + public: + Shdr_write(unsigned char* p) + : p_(reinterpret_cast*>(p)) + { } + + void + put_sh_name(Elf_Word v) + { this->p_->sh_name = Convert<32, big_endian>::convert_host(v); } + + void + put_sh_type(Elf_Word v) + { this->p_->sh_type = Convert<32, big_endian>::convert_host(v); } + + void + put_sh_flags(typename Elf_types::Elf_WXword v) + { this->p_->sh_flags = Convert::convert_host(v); } + + void + put_sh_addr(typename Elf_types::Elf_Addr v) + { this->p_->sh_addr = Convert::convert_host(v); } + + void + put_sh_offset(typename Elf_types::Elf_Off v) + { this->p_->sh_offset = Convert::convert_host(v); } + + void + put_sh_size(typename Elf_types::Elf_WXword v) + { this->p_->sh_size = Convert::convert_host(v); } + + void + put_sh_link(Elf_Word v) + { this->p_->sh_link = Convert<32, big_endian>::convert_host(v); } + + void + put_sh_info(Elf_Word v) + { this->p_->sh_info = Convert<32, big_endian>::convert_host(v); } + + void + put_sh_addralign(typename Elf_types::Elf_WXword v) + { this->p_->sh_addralign = Convert::convert_host(v); } + + void + put_sh_entsize(typename Elf_types::Elf_WXword v) + { this->p_->sh_entsize = Convert::convert_host(v); } + + private: + internal::Shdr_data* p_; +}; + +// Accessor class for an ELF segment header. + +template +class Phdr +{ + public: + Phdr(const unsigned char* p) + : p_(reinterpret_cast*>(p)) + { } + + template + Phdr(File* file, typename File::Location loc) + : p_(reinterpret_cast*>( + file->view(loc.file_offset, loc.data_size).data())) + { } + + Elf_Word + get_p_type() const + { return Convert<32, big_endian>::convert_host(this->p_->p_type); } + + typename Elf_types::Elf_Off + get_p_offset() const + { return Convert::convert_host(this->p_->p_offset); } + + typename Elf_types::Elf_Addr + get_p_vaddr() const + { return Convert::convert_host(this->p_->p_vaddr); } + + typename Elf_types::Elf_Addr + get_p_paddr() const + { return Convert::convert_host(this->p_->p_paddr); } + + typename Elf_types::Elf_WXword + get_p_filesz() const + { return Convert::convert_host(this->p_->p_filesz); } + + typename Elf_types::Elf_WXword + get_p_memsz() const + { return Convert::convert_host(this->p_->p_memsz); } + + Elf_Word + get_p_flags() const + { return Convert<32, big_endian>::convert_host(this->p_->p_flags); } + + typename Elf_types::Elf_WXword + get_p_align() const + { return Convert::convert_host(this->p_->p_align); } + + private: + const internal::Phdr_data* p_; +}; + +// Write class for an ELF segment header. + +template +class Phdr_write +{ + public: + Phdr_write(unsigned char* p) + : p_(reinterpret_cast*>(p)) + { } + + void + put_p_type(Elf_Word v) + { this->p_->p_type = Convert<32, big_endian>::convert_host(v); } + + void + put_p_offset(typename Elf_types::Elf_Off v) + { this->p_->p_offset = Convert::convert_host(v); } + + void + put_p_vaddr(typename Elf_types::Elf_Addr v) + { this->p_->p_vaddr = Convert::convert_host(v); } + + void + put_p_paddr(typename Elf_types::Elf_Addr v) + { this->p_->p_paddr = Convert::convert_host(v); } + + void + put_p_filesz(typename Elf_types::Elf_WXword v) + { this->p_->p_filesz = Convert::convert_host(v); } + + void + put_p_memsz(typename Elf_types::Elf_WXword v) + { this->p_->p_memsz = Convert::convert_host(v); } + + void + put_p_flags(Elf_Word v) + { this->p_->p_flags = Convert<32, big_endian>::convert_host(v); } + + void + put_p_align(typename Elf_types::Elf_WXword v) + { this->p_->p_align = Convert::convert_host(v); } + + private: + internal::Phdr_data* p_; +}; + +// Accessor class for an ELF symbol table entry. + +template +class Sym +{ + public: + Sym(const unsigned char* p) + : p_(reinterpret_cast*>(p)) + { } + + template + Sym(File* file, typename File::Location loc) + : p_(reinterpret_cast*>( + file->view(loc.file_offset, loc.data_size).data())) + { } + + Elf_Word + get_st_name() const + { return Convert<32, big_endian>::convert_host(this->p_->st_name); } + + typename Elf_types::Elf_Addr + get_st_value() const + { return Convert::convert_host(this->p_->st_value); } + + typename Elf_types::Elf_WXword + get_st_size() const + { return Convert::convert_host(this->p_->st_size); } + + unsigned char + get_st_info() const + { return this->p_->st_info; } + + STB + get_st_bind() const + { return elf_st_bind(this->get_st_info()); } + + STT + get_st_type() const + { return elf_st_type(this->get_st_info()); } + + unsigned char + get_st_other() const + { return this->p_->st_other; } + + STV + get_st_visibility() const + { return elf_st_visibility(this->get_st_other()); } + + unsigned char + get_st_nonvis() const + { return elf_st_nonvis(this->get_st_other()); } + + Elf_Half + get_st_shndx() const + { return Convert<16, big_endian>::convert_host(this->p_->st_shndx); } + + private: + const internal::Sym_data* p_; +}; + +// Writer class for an ELF symbol table entry. + +template +class Sym_write +{ + public: + Sym_write(unsigned char* p) + : p_(reinterpret_cast*>(p)) + { } + + void + put_st_name(Elf_Word v) + { this->p_->st_name = Convert<32, big_endian>::convert_host(v); } + + void + put_st_value(typename Elf_types::Elf_Addr v) + { this->p_->st_value = Convert::convert_host(v); } + + void + put_st_size(typename Elf_types::Elf_WXword v) + { this->p_->st_size = Convert::convert_host(v); } + + void + put_st_info(unsigned char v) + { this->p_->st_info = v; } + + void + put_st_info(STB bind, STT type) + { this->p_->st_info = elf_st_info(bind, type); } + + void + put_st_other(unsigned char v) + { this->p_->st_other = v; } + + void + put_st_other(STV vis, unsigned char nonvis) + { this->p_->st_other = elf_st_other(vis, nonvis); } + + void + put_st_shndx(Elf_Half v) + { this->p_->st_shndx = Convert<16, big_endian>::convert_host(v); } + + Sym + sym() + { return Sym(reinterpret_cast(this->p_)); } + + private: + internal::Sym_data* p_; +}; + +// Accessor classes for an ELF REL relocation entry. + +template +class Rel +{ + public: + Rel(const unsigned char* p) + : p_(reinterpret_cast*>(p)) + { } + + template + Rel(File* file, typename File::Location loc) + : p_(reinterpret_cast*>( + file->view(loc.file_offset, loc.data_size).data())) + { } + + typename Elf_types::Elf_Addr + get_r_offset() const + { return Convert::convert_host(this->p_->r_offset); } + + typename Elf_types::Elf_WXword + get_r_info() const + { return Convert::convert_host(this->p_->r_info); } + + private: + const internal::Rel_data* p_; +}; + +// Writer class for an ELF Rel relocation. + +template +class Rel_write +{ + public: + Rel_write(unsigned char* p) + : p_(reinterpret_cast*>(p)) + { } + + void + put_r_offset(typename Elf_types::Elf_Addr v) + { this->p_->r_offset = Convert::convert_host(v); } + + void + put_r_info(typename Elf_types::Elf_WXword v) + { this->p_->r_info = Convert::convert_host(v); } + + private: + internal::Rel_data* p_; +}; + +// Accessor class for an ELF Rela relocation. + +template +class Rela +{ + public: + Rela(const unsigned char* p) + : p_(reinterpret_cast*>(p)) + { } + + template + Rela(File* file, typename File::Location loc) + : p_(reinterpret_cast*>( + file->view(loc.file_offset, loc.data_size).data())) + { } + + typename Elf_types::Elf_Addr + get_r_offset() const + { return Convert::convert_host(this->p_->r_offset); } + + typename Elf_types::Elf_WXword + get_r_info() const + { return Convert::convert_host(this->p_->r_info); } + + typename Elf_types::Elf_Swxword + get_r_addend() const + { return Convert::convert_host(this->p_->r_addend); } + + private: + const internal::Rela_data* p_; +}; + +// Writer class for an ELF Rela relocation. + +template +class Rela_write +{ + public: + Rela_write(unsigned char* p) + : p_(reinterpret_cast*>(p)) + { } + + void + put_r_offset(typename Elf_types::Elf_Addr v) + { this->p_->r_offset = Convert::convert_host(v); } + + void + put_r_info(typename Elf_types::Elf_WXword v) + { this->p_->r_info = Convert::convert_host(v); } + + void + put_r_addend(typename Elf_types::Elf_Swxword v) + { this->p_->r_addend = Convert::convert_host(v); } + + private: + internal::Rela_data* p_; +}; + +// Accessor classes for entries in the ELF SHT_DYNAMIC section aka +// PT_DYNAMIC segment. + +template +class Dyn +{ + public: + Dyn(const unsigned char* p) + : p_(reinterpret_cast*>(p)) + { } + + template + Dyn(File* file, typename File::Location loc) + : p_(reinterpret_cast*>( + file->view(loc.file_offset, loc.data_size).data())) + { } + + typename Elf_types::Elf_Swxword + get_d_tag() const + { return Convert::convert_host(this->p_->d_tag); } + + typename Elf_types::Elf_WXword + get_d_val() const + { return Convert::convert_host(this->p_->d_val); } + + typename Elf_types::Elf_Addr + get_d_ptr() const + { return Convert::convert_host(this->p_->d_val); } + + private: + const internal::Dyn_data* p_; +}; + +// Write class for an entry in the SHT_DYNAMIC section. + +template +class Dyn_write +{ + public: + Dyn_write(unsigned char* p) + : p_(reinterpret_cast*>(p)) + { } + + void + put_d_tag(typename Elf_types::Elf_Swxword v) + { this->p_->d_tag = Convert::convert_host(v); } + + void + put_d_val(typename Elf_types::Elf_WXword v) + { this->p_->d_val = Convert::convert_host(v); } + + void + put_d_ptr(typename Elf_types::Elf_Addr v) + { this->p_->d_val = Convert::convert_host(v); } + + private: + internal::Dyn_data* p_; +}; + +// Accessor classes for entries in the ELF SHT_GNU_verdef section. + +template +class Verdef +{ + public: + Verdef(const unsigned char* p) + : p_(reinterpret_cast(p)) + { } + + template + Verdef(File* file, typename File::Location loc) + : p_(reinterpret_cast( + file->view(loc.file_offset, loc.data_size).data())) + { } + + Elf_Half + get_vd_version() const + { return Convert<16, big_endian>::convert_host(this->p_->vd_version); } + + Elf_Half + get_vd_flags() const + { return Convert<16, big_endian>::convert_host(this->p_->vd_flags); } + + Elf_Half + get_vd_ndx() const + { return Convert<16, big_endian>::convert_host(this->p_->vd_ndx); } + + Elf_Half + get_vd_cnt() const + { return Convert<16, big_endian>::convert_host(this->p_->vd_cnt); } + + Elf_Word + get_vd_hash() const + { return Convert<32, big_endian>::convert_host(this->p_->vd_hash); } + + Elf_Word + get_vd_aux() const + { return Convert<32, big_endian>::convert_host(this->p_->vd_aux); } + + Elf_Word + get_vd_next() const + { return Convert<32, big_endian>::convert_host(this->p_->vd_next); } + + private: + const internal::Verdef_data* p_; +}; + +template +class Verdef_write +{ + public: + Verdef_write(unsigned char* p) + : p_(reinterpret_cast(p)) + { } + + void + set_vd_version(Elf_Half v) + { this->p_->vd_version = Convert<16, big_endian>::convert_host(v); } + + void + set_vd_flags(Elf_Half v) + { this->p_->vd_flags = Convert<16, big_endian>::convert_host(v); } + + void + set_vd_ndx(Elf_Half v) + { this->p_->vd_ndx = Convert<16, big_endian>::convert_host(v); } + + void + set_vd_cnt(Elf_Half v) + { this->p_->vd_cnt = Convert<16, big_endian>::convert_host(v); } + + void + set_vd_hash(Elf_Word v) + { this->p_->vd_hash = Convert<32, big_endian>::convert_host(v); } + + void + set_vd_aux(Elf_Word v) + { this->p_->vd_aux = Convert<32, big_endian>::convert_host(v); } + + void + set_vd_next(Elf_Word v) + { this->p_->vd_next = Convert<32, big_endian>::convert_host(v); } + + private: + internal::Verdef_data* p_; +}; + +// Accessor classes for auxiliary entries in the ELF SHT_GNU_verdef +// section. + +template +class Verdaux +{ + public: + Verdaux(const unsigned char* p) + : p_(reinterpret_cast(p)) + { } + + template + Verdaux(File* file, typename File::Location loc) + : p_(reinterpret_cast( + file->view(loc.file_offset, loc.data_size).data())) + { } + + Elf_Word + get_vda_name() const + { return Convert<32, big_endian>::convert_host(this->p_->vda_name); } + + Elf_Word + get_vda_next() const + { return Convert<32, big_endian>::convert_host(this->p_->vda_next); } + + private: + const internal::Verdaux_data* p_; +}; + +template +class Verdaux_write +{ + public: + Verdaux_write(unsigned char* p) + : p_(reinterpret_cast(p)) + { } + + void + set_vda_name(Elf_Word v) + { this->p_->vda_name = Convert<32, big_endian>::convert_host(v); } + + void + set_vda_next(Elf_Word v) + { this->p_->vda_next = Convert<32, big_endian>::convert_host(v); } + + private: + internal::Verdaux_data* p_; +}; + +// Accessor classes for entries in the ELF SHT_GNU_verneed section. + +template +class Verneed +{ + public: + Verneed(const unsigned char* p) + : p_(reinterpret_cast(p)) + { } + + template + Verneed(File* file, typename File::Location loc) + : p_(reinterpret_cast( + file->view(loc.file_offset, loc.data_size).data())) + { } + + Elf_Half + get_vn_version() const + { return Convert<16, big_endian>::convert_host(this->p_->vn_version); } + + Elf_Half + get_vn_cnt() const + { return Convert<16, big_endian>::convert_host(this->p_->vn_cnt); } + + Elf_Word + get_vn_file() const + { return Convert<32, big_endian>::convert_host(this->p_->vn_file); } + + Elf_Word + get_vn_aux() const + { return Convert<32, big_endian>::convert_host(this->p_->vn_aux); } + + Elf_Word + get_vn_next() const + { return Convert<32, big_endian>::convert_host(this->p_->vn_next); } + + private: + const internal::Verneed_data* p_; +}; + +template +class Verneed_write +{ + public: + Verneed_write(unsigned char* p) + : p_(reinterpret_cast(p)) + { } + + void + set_vn_version(Elf_Half v) + { this->p_->vn_version = Convert<16, big_endian>::convert_host(v); } + + void + set_vn_cnt(Elf_Half v) + { this->p_->vn_cnt = Convert<16, big_endian>::convert_host(v); } + + void + set_vn_file(Elf_Word v) + { this->p_->vn_file = Convert<32, big_endian>::convert_host(v); } + + void + set_vn_aux(Elf_Word v) + { this->p_->vn_aux = Convert<32, big_endian>::convert_host(v); } + + void + set_vn_next(Elf_Word v) + { this->p_->vn_next = Convert<32, big_endian>::convert_host(v); } + + private: + internal::Verneed_data* p_; +}; + +// Accessor classes for auxiliary entries in the ELF SHT_GNU_verneed +// section. + +template +class Vernaux +{ + public: + Vernaux(const unsigned char* p) + : p_(reinterpret_cast(p)) + { } + + template + Vernaux(File* file, typename File::Location loc) + : p_(reinterpret_cast( + file->view(loc.file_offset, loc.data_size).data())) + { } + + Elf_Word + get_vna_hash() const + { return Convert<32, big_endian>::convert_host(this->p_->vna_hash); } + + Elf_Half + get_vna_flags() const + { return Convert<16, big_endian>::convert_host(this->p_->vna_flags); } + + Elf_Half + get_vna_other() const + { return Convert<16, big_endian>::convert_host(this->p_->vna_other); } + + Elf_Word + get_vna_name() const + { return Convert<32, big_endian>::convert_host(this->p_->vna_name); } + + Elf_Word + get_vna_next() const + { return Convert<32, big_endian>::convert_host(this->p_->vna_next); } + + private: + const internal::Vernaux_data* p_; +}; + +template +class Vernaux_write +{ + public: + Vernaux_write(unsigned char* p) + : p_(reinterpret_cast(p)) + { } + + void + set_vna_hash(Elf_Word v) + { this->p_->vna_hash = Convert<32, big_endian>::convert_host(v); } + + void + set_vna_flags(Elf_Half v) + { this->p_->vna_flags = Convert<16, big_endian>::convert_host(v); } + + void + set_vna_other(Elf_Half v) + { this->p_->vna_other = Convert<16, big_endian>::convert_host(v); } + + void + set_vna_name(Elf_Word v) + { this->p_->vna_name = Convert<32, big_endian>::convert_host(v); } + + void + set_vna_next(Elf_Word v) + { this->p_->vna_next = Convert<32, big_endian>::convert_host(v); } + + private: + internal::Vernaux_data* p_; +}; + +} // End namespace elfcpp. + +#endif // !defined(ELFPCP_H) diff --git a/bfd/doc/elfcode.texi b/elfcpp/elfcpp_config.h similarity index 100% rename from bfd/doc/elfcode.texi rename to elfcpp/elfcpp_config.h diff --git a/elfcpp/elfcpp_file.h b/elfcpp/elfcpp_file.h new file mode 100644 index 00000000000..c9563eeed74 --- /dev/null +++ b/elfcpp/elfcpp_file.h @@ -0,0 +1,278 @@ +// elfcpp_file.h -- file access for elfcpp -*- C++ -*- + +// This header file defines the class Elf_file which can be used to +// read useful data from an ELF file. The functions here are all +// templates which take a file interface object as a parameter. This +// type must have a subtype View. This type must support two methods: +// View view(off_t file_offset, off_t data_size) +// returns a View for the specified part of the file. +// void error(const char* printf_format, ...) +// prints an error message and does not return. The subtype View must +// support a method +// const unsigned char* data() +// which returns a pointer to a buffer containing the requested data. +// This general interface is used to read data from the file. Objects +// of type View will never survive longer than the elfcpp function. + +// Some of these functions must return a reference to part of the +// file. To use these, the file interface must support a subtype +// Location: +// Location(off_t file_offset, off_t data_size) +// To use this in conjunction with the accessors types Shdr, etc., the +// file interface should support an overload of view: +// View view(Location) +// This permits writing +// elfcpp::Shdr shdr(file, ef.section_header(n)); + +#ifndef ELFPCP_FILE_H +#define ELFCPP_FILE_H + +#include +#include + +namespace elfcpp +{ + +// This object is used to read an ELF file. +// SIZE: The size of file, 32 or 64. +// BIG_ENDIAN: Whether the file is in big-endian format. +// FILE: A file reading type as described above. + +template +class Elf_file +{ + private: + typedef Elf_file This; + + public: + static const int ehdr_size = Elf_sizes::ehdr_size; + static const int phdr_size = Elf_sizes::phdr_size; + static const int shdr_size = Elf_sizes::shdr_size; + static const int sym_size = Elf_sizes::sym_size; + static const int rel_size = Elf_sizes::rel_size; + static const int rela_size = Elf_sizes::rela_size; + + typedef Ehdr Ef_ehdr; + typedef Phdr Ef_phdr; + typedef Shdr Ef_shdr; + typedef Sym Ef_sym; + + // Construct an Elf_file given an ELF file header. + Elf_file(File* file, const Ef_ehdr& ehdr) + { this->construct(file, ehdr); } + + // Construct an ELF file. + inline + Elf_file(File* file); + + // Return the file offset to the section headers. + off_t + shoff() const + { return this->shoff_; } + + // Return the number of sections. + unsigned int + shnum() + { + this->initialize_shnum(); + return this->shnum_; + } + + // Return the section index of the section name string table. + unsigned int + shstrndx() + { + this->initialize_shnum(); + return this->shstrndx_; + } + + // Return the location of the header of section SHNDX. + typename File::Location + section_header(unsigned int shndx) + { + return typename File::Location(this->section_header_offset(shndx), + shdr_size); + } + + // Return the name of section SHNDX. + std::string + section_name(unsigned int shndx); + + // Return the location of the contents of section SHNDX. + typename File::Location + section_contents(unsigned int shndx); + + // Return the flags of section SHNDX. + typename Elf_types::Elf_WXword + section_flags(unsigned int shndx); + + private: + // Shared constructor code. + void + construct(File* file, const Ef_ehdr& ehdr); + + // Initialize shnum_ and shstrndx_. + void + initialize_shnum(); + + // Return the file offset of the header of section SHNDX. + off_t + section_header_offset(unsigned int shndx); + + // The file we are reading. + File* file_; + // The file offset to the section headers. + off_t shoff_; + // The number of sections. + unsigned int shnum_; + // The section index of the section name string table. + unsigned int shstrndx_; +}; + +// Template function definitions. + +// Construct an Elf_file given an ELF file header. + +template +void +Elf_file::construct(File* file, const Ef_ehdr& ehdr) +{ + this->file_ = file; + this->shoff_ = ehdr.get_e_shoff(); + this->shnum_ = ehdr.get_e_shnum(); + this->shstrndx_ = ehdr.get_e_shstrndx(); + if (ehdr.get_e_ehsize() != This::ehdr_size) + file->error(_("bad e_ehsize (%d != %d)"), + ehdr.get_e_ehsize(), This::ehdr_size); + if (ehdr.get_e_shentsize() != This::shdr_size) + file->error(_("bad e_shentsize (%d != %d)"), + ehdr.get_e_shentsize(), This::shdr_size); +} + +// Construct an ELF file. + +template +inline +Elf_file::Elf_file(File* file) +{ + typename File::View v(file->view(file_header_offset, This::ehdr_size)); + this->construct(file, Ef_ehdr(v.data())); +} + +// Initialize the shnum_ and shstrndx_ fields, handling overflow. + +template +void +Elf_file::initialize_shnum() +{ + if ((this->shnum_ == 0 || this->shstrndx_ == SHN_XINDEX) + && this->shoff_ != 0) + { + typename File::View v(this->file_->view(this->shoff_, This::shdr_size)); + Ef_shdr shdr(v.data()); + if (this->shnum_ == 0) + this->shnum_ = shdr.get_sh_size(); + if (this->shstrndx_ == SHN_XINDEX) + this->shstrndx_ = shdr.get_sh_link(); + } +} + +// Return the file offset of the section header of section SHNDX. + +template +off_t +Elf_file::section_header_offset(unsigned int shndx) +{ + if (shndx >= this->shnum()) + this->file_->error(_("section_header_offset: bad shndx %u >= %u"), + shndx, this->shnum()); + return this->shoff_ + This::shdr_size * shndx; +} + +// Return the name of section SHNDX. + +template +std::string +Elf_file::section_name(unsigned int shndx) +{ + File* const file = this->file_; + + // Get the section name offset. + unsigned int sh_name; + { + typename File::View v(file->view(this->section_header_offset(shndx), + This::shdr_size)); + Ef_shdr shdr(v.data()); + sh_name = shdr.get_sh_name(); + } + + // Get the file offset for the section name string table data. + off_t shstr_off; + off_t shstr_size; + { + const unsigned int shstrndx = this->shstrndx_; + typename File::View v(file->view(this->section_header_offset(shstrndx), + This::shdr_size)); + Ef_shdr shstr_shdr(v.data()); + shstr_off = shstr_shdr.get_sh_offset(); + shstr_size = shstr_shdr.get_sh_size(); + } + + if (sh_name >= shstr_size) + file->error(_("bad section name offset for section %u: %u"), + shndx, sh_name); + + typename File::View v(file->view(shstr_off, shstr_size)); + + const unsigned char* datau = v.data(); + const char* data = reinterpret_cast(datau); + const void* p = ::memchr(data + sh_name, '\0', shstr_size - sh_name); + if (p == NULL) + file->error(_("missing null terminator for name of section %u"), + shndx); + + size_t len = static_cast(p) - (data + sh_name); + + return std::string(data + sh_name, len); +} + +// Return the contents of section SHNDX. + +template +typename File::Location +Elf_file::section_contents(unsigned int shndx) +{ + File* const file = this->file_; + + if (shndx >= this->shnum()) + file->error(_("section_contents: bad shndx %u >= %u"), + shndx, this->shnum()); + + typename File::View v(file->view(this->section_header_offset(shndx), + This::shdr_size)); + Ef_shdr shdr(v.data()); + return typename File::Location(shdr.get_sh_offset(), shdr.get_sh_size()); +} + +// Return the section flags of section SHNDX. + +template +typename Elf_types::Elf_WXword +Elf_file::section_flags(unsigned int shndx) +{ + File* const file = this->file_; + + if (shndx >= this->shnum()) + file->error(_("section_flags: bad shndx %u >= %u"), + shndx, this->shnum()); + + typename File::View v(file->view(this->section_header_offset(shndx), + This::shdr_size)); + + Ef_shdr shdr(v.data()); + return shdr.get_sh_flags(); +} + +} // End namespace elfcpp. + +#endif // !defined(ELFCPP_FILE_H) diff --git a/elfcpp/elfcpp_internal.h b/elfcpp/elfcpp_internal.h new file mode 100644 index 00000000000..7a2b5d4836b --- /dev/null +++ b/elfcpp/elfcpp_internal.h @@ -0,0 +1,213 @@ +// elfcpp_internal.h -- internals for elfcpp -*- C++ -*- + +// This is included by elfcpp.h, the external interface, but holds +// information which we want to keep private. + +#include "elfcpp_config.h" + +#ifndef ELFCPP_INTERNAL_H +#define ELFCPP_INTERNAL_H + +namespace elfcpp +{ + +namespace internal +{ + +// The ELF file header. + +template +struct Ehdr_data +{ + unsigned char e_ident[EI_NIDENT]; + Elf_Half e_type; + Elf_Half e_machine; + Elf_Word e_version; + typename Elf_types::Elf_Addr e_entry; + typename Elf_types::Elf_Off e_phoff; + typename Elf_types::Elf_Off e_shoff; + Elf_Word e_flags; + Elf_Half e_ehsize; + Elf_Half e_phentsize; + Elf_Half e_phnum; + Elf_Half e_shentsize; + Elf_Half e_shnum; + Elf_Half e_shstrndx; +}; + +// An ELF section header. + +template +struct Shdr_data +{ + Elf_Word sh_name; + Elf_Word sh_type; + typename Elf_types::Elf_WXword sh_flags; + typename Elf_types::Elf_Addr sh_addr; + typename Elf_types::Elf_Off sh_offset; + typename Elf_types::Elf_WXword sh_size; + Elf_Word sh_link; + Elf_Word sh_info; + typename Elf_types::Elf_WXword sh_addralign; + typename Elf_types::Elf_WXword sh_entsize; +}; + +// An ELF segment header. We use template specialization for the +// 32-bit and 64-bit versions because the fields are in a different +// order. + +template +struct Phdr_data; + +template<> +struct Phdr_data<32> +{ + Elf_Word p_type; + Elf_types<32>::Elf_Off p_offset; + Elf_types<32>::Elf_Addr p_vaddr; + Elf_types<32>::Elf_Addr p_paddr; + Elf_Word p_filesz; + Elf_Word p_memsz; + Elf_Word p_flags; + Elf_Word p_align; +}; + +template<> +struct Phdr_data<64> +{ + Elf_Word p_type; + Elf_Word p_flags; + Elf_types<64>::Elf_Off p_offset; + Elf_types<64>::Elf_Addr p_vaddr; + Elf_types<64>::Elf_Addr p_paddr; + Elf_Xword p_filesz; + Elf_Xword p_memsz; + Elf_Xword p_align; +}; + +// An ELF symbol table entry. We use template specialization for the +// 32-bit and 64-bit versions because the fields are in a different +// order. + +template +struct Sym_data; + +template<> +struct Sym_data<32> +{ + Elf_Word st_name; + Elf_types<32>::Elf_Addr st_value; + Elf_Word st_size; + unsigned char st_info; + unsigned char st_other; + Elf_Half st_shndx; +}; + +template<> +struct Sym_data<64> +{ + Elf_Word st_name; + unsigned char st_info; + unsigned char st_other; + Elf_Half st_shndx; + Elf_types<64>::Elf_Addr st_value; + Elf_Xword st_size; +}; + +// ELF relocation table entries. + +template +struct Rel_data +{ + typename Elf_types::Elf_Addr r_offset; + typename Elf_types::Elf_WXword r_info; +}; + +template +struct Rela_data +{ + typename Elf_types::Elf_Addr r_offset; + typename Elf_types::Elf_WXword r_info; + typename Elf_types::Elf_Swxword r_addend; +}; + +// An entry in the ELF SHT_DYNAMIC section aka PT_DYNAMIC segment. + +template +struct Dyn_data +{ + typename Elf_types::Elf_Swxword d_tag; + typename Elf_types::Elf_WXword d_val; +}; + +// An entry in a SHT_GNU_verdef section. This structure is the same +// in 32-bit and 64-bit ELF files. + +struct Verdef_data +{ + // Version number of structure (VER_DEF_*). + Elf_Half vd_version; + // Bit flags (VER_FLG_*). + Elf_Half vd_flags; + // Version index. + Elf_Half vd_ndx; + // Number of auxiliary Verdaux entries. + Elf_Half vd_cnt; + // Hash of name. + Elf_Word vd_hash; + // Byte offset to first Verdaux entry. + Elf_Word vd_aux; + // Byte offset to next Verdef entry. + Elf_Word vd_next; +}; + +// An auxiliary entry in a SHT_GNU_verdef section. This structure is +// the same in 32-bit and 64-bit ELF files. + +struct Verdaux_data +{ + // Offset in string table of version name. + Elf_Word vda_name; + // Byte offset to next Verdaux entry. + Elf_Word vda_next; +}; + +// An entry in a SHT_GNU_verneed section. This structure is the same +// in 32-bit and 64-bit ELF files. + +struct Verneed_data +{ + // Version number of structure (VER_NEED_*). + Elf_Half vn_version; + // Number of auxiliary Vernaux entries. + Elf_Half vn_cnt; + // Offset in string table of library name. + Elf_Word vn_file; + // Byte offset to first Vernaux entry. + Elf_Word vn_aux; + // Byt eoffset to next Verneed entry. + Elf_Word vn_next; +}; + +// An auxiliary entry in a SHT_GNU_verneed section. This structure is +// the same in 32-bit and 64-bit ELF files. + +struct Vernaux_data +{ + // Hash of dependency name. + Elf_Word vna_hash; + // Bit flags (VER_FLG_*). + Elf_Half vna_flags; + // Version index used in SHT_GNU_versym entries. + Elf_Half vna_other; + // Offset in string table of version name. + Elf_Word vna_name; + // Byte offset to next Vernaux entry. + Elf_Word vna_next; +}; + +} // End namespace internal. + +} // End namespace elfcpp. + +#endif // !defined(ELFCPP_INTERNAL_H) diff --git a/elfcpp/elfcpp_swap.h b/elfcpp/elfcpp_swap.h new file mode 100644 index 00000000000..71b02eb8d36 --- /dev/null +++ b/elfcpp/elfcpp_swap.h @@ -0,0 +1,350 @@ +// elfcpp_swap.h -- Handle swapping for elfcpp -*- C++ -*- + +// This header file defines basic template classes to efficiently swap +// numbers between host form and target form. When the host and +// target have the same endianness, these turn into no-ops. + +#ifndef ELFCPP_SWAP_H +#define ELFCPP_SWAP_H + +#include +#include +#include + +namespace elfcpp +{ + +// Endian simply indicates whether the host is big endian or not. + +struct Endian +{ + public: + // Used for template specializations. + static const bool host_big_endian = __BYTE_ORDER == __BIG_ENDIAN; +}; + +// Valtype_base is a template based on size (8, 16, 32, 64) which +// defines the type Valtype as the unsigned integer of the specified +// size. + +template +struct Valtype_base; + +template<> +struct Valtype_base<8> +{ + typedef unsigned char Valtype; +}; + +template<> +struct Valtype_base<16> +{ + typedef uint16_t Valtype; +}; + +template<> +struct Valtype_base<32> +{ + typedef uint32_t Valtype; +}; + +template<> +struct Valtype_base<64> +{ + typedef uint64_t Valtype; +}; + +// Convert_endian is a template based on size and on whether the host +// and target have the same endianness. It defines the type Valtype +// as Valtype_base does, and also defines a function convert_host +// which takes an argument of type Valtype and returns the same value, +// but swapped if the host and target have different endianness. + +template +struct Convert_endian; + +template +struct Convert_endian +{ + typedef typename Valtype_base::Valtype Valtype; + + static inline Valtype + convert_host(Valtype v) + { return v; } +}; + +template<> +struct Convert_endian<8, false> +{ + typedef Valtype_base<8>::Valtype Valtype; + + static inline Valtype + convert_host(Valtype v) + { return v; } +}; + +template<> +struct Convert_endian<16, false> +{ + typedef Valtype_base<16>::Valtype Valtype; + + static inline Valtype + convert_host(Valtype v) + { return bswap_16(v); } +}; + +template<> +struct Convert_endian<32, false> +{ + typedef Valtype_base<32>::Valtype Valtype; + + static inline Valtype + convert_host(Valtype v) + { return bswap_32(v); } +}; + +template<> +struct Convert_endian<64, false> +{ + typedef Valtype_base<64>::Valtype Valtype; + + static inline Valtype + convert_host(Valtype v) + { return bswap_64(v); } +}; + +// Convert is a template based on size and on whether the target is +// big endian. It defines Valtype and convert_host like +// Convert_endian. That is, it is just like Convert_endian except in +// the meaning of the second template parameter. + +template +struct Convert +{ + typedef typename Valtype_base::Valtype Valtype; + + static inline Valtype + convert_host(Valtype v) + { + return Convert_endian + ::convert_host(v); + } +}; + +// Swap is a template based on size and on whether the target is big +// endian. It defines the type Valtype and the functions readval and +// writeval. The functions read and write values of the appropriate +// size out of buffers, swapping them if necessary. readval and +// writeval are overloaded to take pointers to the appropriate type or +// pointers to unsigned char. + +template +struct Swap +{ + typedef typename Valtype_base::Valtype Valtype; + + static inline Valtype + readval(const Valtype* wv) + { return Convert::convert_host(*wv); } + + static inline void + writeval(Valtype* wv, Valtype v) + { *wv = Convert::convert_host(v); } + + static inline Valtype + readval(const unsigned char* wv) + { return readval(reinterpret_cast(wv)); } + + static inline void + writeval(unsigned char* wv, Valtype v) + { writeval(reinterpret_cast(wv), v); } +}; + +// We need to specialize the 8-bit version of Swap to avoid +// conflicting overloads, since both versions of readval and writeval +// will have the same type parameters. + +template +struct Swap<8, big_endian> +{ + typedef typename Valtype_base<8>::Valtype Valtype; + + static inline Valtype + readval(const Valtype* wv) + { return *wv; } + + static inline void + writeval(Valtype* wv, Valtype v) + { *wv = v; } +}; + +// Swap_unaligned is a template based on size and on whether the +// target is big endian. It defines the type Valtype and the +// functions readval and writeval. The functions read and write +// values of the appropriate size out of buffers which may be +// misaligned. + +template +struct Swap_unaligned; + +template +struct Swap_unaligned<8, big_endian> +{ + typedef typename Valtype_base<8>::Valtype Valtype; + + static inline Valtype + readval(const unsigned char* wv) + { return *wv; } + + static inline void + writeval(unsigned char* wv, Valtype v) + { *wv = v; } +}; + +template<> +struct Swap_unaligned<16, false> +{ + typedef Valtype_base<16>::Valtype Valtype; + + static inline Valtype + readval(const unsigned char* wv) + { + return (wv[1] << 8) | wv[0]; + } + + static inline void + writeval(unsigned char* wv, Valtype v) + { + wv[1] = v >> 8; + wv[0] = v; + } +}; + +template<> +struct Swap_unaligned<16, true> +{ + typedef Valtype_base<16>::Valtype Valtype; + + static inline Valtype + readval(const unsigned char* wv) + { + return (wv[0] << 8) | wv[1]; + } + + static inline void + writeval(unsigned char* wv, Valtype v) + { + wv[0] = v >> 8; + wv[1] = v; + } +}; + +template<> +struct Swap_unaligned<32, false> +{ + typedef Valtype_base<32>::Valtype Valtype; + + static inline Valtype + readval(const unsigned char* wv) + { + return (wv[3] << 24) | (wv[2] << 16) | (wv[1] << 8) | wv[0]; + } + + static inline void + writeval(unsigned char* wv, Valtype v) + { + wv[3] = v >> 24; + wv[2] = v >> 16; + wv[1] = v >> 8; + wv[0] = v; + } +}; + +template<> +struct Swap_unaligned<32, true> +{ + typedef Valtype_base<32>::Valtype Valtype; + + static inline Valtype + readval(const unsigned char* wv) + { + return (wv[0] << 24) | (wv[1] << 16) | (wv[2] << 8) | wv[3]; + } + + static inline void + writeval(unsigned char* wv, Valtype v) + { + wv[0] = v >> 24; + wv[1] = v >> 16; + wv[2] = v >> 8; + wv[3] = v; + } +}; + +template<> +struct Swap_unaligned<64, false> +{ + typedef Valtype_base<64>::Valtype Valtype; + + static inline Valtype + readval(const unsigned char* wv) + { + return ((static_cast(wv[7]) << 56) + | (static_cast(wv[6]) << 48) + | (static_cast(wv[5]) << 40) + | (static_cast(wv[4]) << 32) + | (static_cast(wv[3]) << 24) + | (static_cast(wv[2]) << 16) + | (static_cast(wv[1]) << 8) + | static_cast(wv[0])); + } + + static inline void + writeval(unsigned char* wv, Valtype v) + { + wv[7] = v >> 56; + wv[6] = v >> 48; + wv[5] = v >> 40; + wv[4] = v >> 32; + wv[3] = v >> 24; + wv[2] = v >> 16; + wv[1] = v >> 8; + wv[0] = v; + } +}; + +template<> +struct Swap_unaligned<64, true> +{ + typedef Valtype_base<64>::Valtype Valtype; + + static inline Valtype + readval(const unsigned char* wv) + { + return ((static_cast(wv[0]) << 56) + | (static_cast(wv[1]) << 48) + | (static_cast(wv[2]) << 40) + | (static_cast(wv[3]) << 32) + | (static_cast(wv[4]) << 24) + | (static_cast(wv[5]) << 16) + | (static_cast(wv[6]) << 8) + | static_cast(wv[7])); + } + + static inline void + writeval(unsigned char* wv, Valtype v) + { + wv[7] = v >> 56; + wv[6] = v >> 48; + wv[5] = v >> 40; + wv[4] = v >> 32; + wv[3] = v >> 24; + wv[2] = v >> 16; + wv[1] = v >> 8; + wv[0] = v; + } +}; + +} // End namespace elfcpp. + +#endif // !defined(ELFCPP_SWAP_H) diff --git a/elfcpp/i386.h b/elfcpp/i386.h new file mode 100644 index 00000000000..01efd87b97a --- /dev/null +++ b/elfcpp/i386.h @@ -0,0 +1,63 @@ +// i386.h -- ELF definitions specific to EM_386 -*- C++ -*- + +#ifndef ELFCPP_I386_H +#define ELFCPP_I386_H + +namespace elfcpp +{ + +enum +{ + R_386_NONE = 0, + R_386_32 = 1, + R_386_PC32 = 2, + R_386_GOT32 = 3, + R_386_PLT32 = 4, + R_386_COPY = 5, + R_386_GLOB_DAT = 6, + R_386_JUMP_SLOT = 7, + R_386_RELATIVE = 8, + R_386_GOTOFF = 9, + R_386_GOTPC = 10, + // Used by Sun. + R_386_32PLT = 11, + // TLS extensions. + R_386_TLS_TPOFF = 14, + R_386_TLS_IE = 15, + R_386_TLS_GOTIE = 16, + R_386_TLS_LE = 17, + R_386_TLS_GD = 18, + R_386_TLS_LDM = 19, + // GNU extensions. + R_386_16 = 20, + R_386_PC16 = 21, + R_386_8 = 22, + R_386_PC8 = 23, + // More TLS relocs. + R_386_TLS_GD_32 = 24, + R_386_TLS_GD_PUSH = 25, + R_386_TLS_GD_CALL = 26, + R_386_TLS_GD_POP = 27, + R_386_TLS_LDM_32 = 28, + R_386_TLS_LDM_PUSH = 29, + R_386_TLS_LDM_CALL = 30, + R_386_TLS_LDM_POP = 31, + R_386_TLS_LDO_32 = 32, + R_386_TLS_IE_32 = 33, + R_386_TLS_LE_32 = 34, + R_386_TLS_DTPMOD32 = 35, + R_386_TLS_DTPOFF32 = 36, + R_386_TLS_TPOFF32 = 37, + R_386_TLS_GOTDESC = 39, + R_386_TLS_DESC_CALL = 40, + R_386_TLS_DESC = 41, + // Used by Intel. + R_386_USED_BY_INTEL_200 = 200, + // GNU vtable garbage collection extensions. + R_386_GNU_VTINHERIT = 250, + R_386_GNU_VTENTRY = 251 +}; + +} // End namespace elfcpp. + +#endif // !defined(ELFCPP_I386_H) diff --git a/etc/ChangeLog b/etc/ChangeLog index a5959c70a70..42e16c1acd7 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,26 @@ +2007-04-04 Eric Christopher + + Move from gcc: + 2007-04-04 Zack Weinberg + + * texi2pod.pl: Correct handling of @itemize with no argument. + + 2007-02-16 Matthias Klose + + * texi2pod.pl: Handle @subsubsection, ignore @anchor. + + 2007-02-06 Richard Sandiford + + * texi2pod.pl: Handle @multitable. + +2007-03-27 Brooks Moses + + * Makefile.in: Add support for "pdf" and "install-pdf" targets. + +2006-12-19 Paolo Bonzini + + * configure.texi: Fix botched commit. + 2006-05-31 Daniel Jacobowitz * texi2pod.pl: Correct handling of absolute @include. @@ -16,15 +39,15 @@ 2006-02-27 Carlos O'Donell - * Makefile.in: TEXI2HTML uses makeinfo. Define + * Makefile.in: TEXI2HTML uses makeinfo. Define HTMLFILES. Add html targets. - * configure.texi: Use ifnottex. Add alternative + * configure.texi: Use ifnottex. Add alternative image format specifier as jpg. * standards.texi: Use ifnottex. 2005-10-21 Mark Mitchell - * texi2pod.pl: Substitue for @value even when part of @include. + * texi2pod.pl: Substitue for @value even when part of @include. 2005-10-21 Bob Wilson @@ -594,4 +617,3 @@ Mon Nov 16 16:50:43 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) Sun Oct 11 16:05:48 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * intro.texi: added INFO-DIR-ENTRY - diff --git a/etc/Makefile.in b/etc/Makefile.in index 7d0607d960c..9642e076c1d 100644 --- a/etc/Makefile.in +++ b/etc/Makefile.in @@ -28,6 +28,7 @@ man9dir = $(mandir)/man9 datarootdir = @datarootdir@ docdir = @docdir@ infodir = @infodir@ +pdfdir = @docdir@ htmldir = @htmldir@ SHELL = /bin/sh @@ -42,6 +43,9 @@ MAKEINFO = `if [ -f ../texinfo/makeinfo/makeinfo ]; \ TEXI2DVI = `if [ -f ../texinfo/util/texi2dvi ]; \ then echo ../texinfo/util/texi2dvi; \ else echo texi2dvi; fi` +TEXI2PDF = `if [ -f ../texinfo/util/texi2dvi ]; \ + then echo "../texinfo/util/texi2dvi --pdf"; \ + else echo "texi2dvi --pdf"; fi` TEXI2HTML = `if [ -f ../texinfo/makeinfo/makeinfo ]; \ then echo "../texinfo/makeinfo/makeinfo --html"; \ else echo "makeinfo --html"; fi` @@ -56,6 +60,7 @@ TEXIDIR = $(srcdir)/../texinfo INFOFILES = standards.info configure.info DVIFILES = standards.dvi configure.dvi +PDFFILES = standards.pdf configure.pdf HTMLFILES = standards.html configure.html all: info @@ -126,6 +131,32 @@ dvi: fi; \ done +pdf: + for f in $(PDFFILES); do \ + if test -f $(srcdir)/`echo $$f | sed -e 's/.pdf$$/.texi/'`; then \ + if $(MAKE) "TEXI2PDF=$(TEXI2PDF)" $$f; then \ + true; \ + else \ + exit 1; \ + fi; \ + fi; \ + done + +install-pdf: pdf + $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(pdfdir)/etc + if test ! -f standards.pdf; then cd $(srcdir); fi; \ + if test -f standards.pdf; then \ + for i in standards.pdf*; do \ + $(INSTALL_DATA) $$i $(DESTDIR)$(pdfdir)/etc/$$i; \ + done; \ + fi + if test ! -f configure.pdf; then cd $(srcdir); fi; \ + if test -f configure.pdf; then \ + for i in configure.pdf*; do \ + $(INSTALL_DATA) $$i $(DESTDIR)$(pdfdir)/etc/$$i; \ + done; \ + fi + standards.info: $(srcdir)/standards.texi $(srcdir)/make-stds.texi $(MAKEINFO) --no-split -I$(srcdir) -o standards.info $(srcdir)/standards.texi @@ -138,6 +169,9 @@ standards.dvi: $(srcdir)/standards.texi standards.ps: standards.dvi $(DVIPS) standards.dvi -o standards.ps +standards.pdf: $(srcdir)/standards.texi + TEXINPUTS=$(TEXIDIR):$$TEXINPUTS $(TEXI2PDF) $(srcdir)/standards.texi + # makeinfo requires images to be in the current directory. configure.info: $(srcdir)/configure.texi $(srcdir)/configdev.tin $(srcdir)/configbuild.tin rm -f configdev.txt configbuild.txt @@ -166,6 +200,13 @@ configure.ps: configure.dvi $(srcdir)/configdev.ein $(srcdir)/configbuild.ein $(DVIPS) configure.dvi -o configure.ps rm -f configdev.eps configbuild.eps +configure.pdf: $(srcdir)/configure.texi $(srcdir)/configdev.tin $(srcdir)/configbuild.tin $(srcdir)/configdev.ein $(srcdir)/configbuild.ein + rm -f configdev.pdf configbuild.pdf + epstopdf $(srcdir)/configdev.ein -outfile=configdev.pdf + epstopdf $(srcdir)/configbuild.ein -outfile=configbuild.pdf + TEXINPUTS=$(TEXIDIR):$$TEXINPUTS $(TEXI2PDF) $(srcdir)/configure.texi + rm -f configdev.pdf configbuild.pdf + configure.html: $(srcdir)/configure.texi cp $(srcdir)/configdev.jin configdev.jpg cp $(srcdir)/configbuild.jin configbuild.jpg diff --git a/etc/configure.info b/etc/configure.info deleted file mode 100644 index 78cc7eba30c..00000000000 --- a/etc/configure.info +++ /dev/null @@ -1,2773 +0,0 @@ -This is configure.info, produced by makeinfo version 4.8 from -.././etc/configure.texi. - -INFO-DIR-SECTION GNU admin -START-INFO-DIR-ENTRY -* configure: (configure). The GNU configure and build system -END-INFO-DIR-ENTRY - - This file documents the GNU configure and build system. - - Copyright (C) 1998 Cygnus Solutions. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Foundation. - - -File: configure.info, Node: Top, Next: Introduction, Up: (dir) - -GNU configure and build system -****************************** - -The GNU configure and build system. - -* Menu: - -* Introduction:: Introduction. -* Getting Started:: Getting Started. -* Files:: Files. -* Configuration Names:: Configuration Names. -* Cross Compilation Tools:: Cross Compilation Tools. -* Canadian Cross:: Canadian Cross. -* Cygnus Configure:: Cygnus Configure. -* Multilibs:: Multilibs. -* FAQ:: Frequently Asked Questions. -* Index:: Index. - - -File: configure.info, Node: Introduction, Next: Getting Started, Prev: Top, Up: Top - -1 Introduction -************** - -This document describes the GNU configure and build systems. It -describes how autoconf, automake, libtool, and make fit together. It -also includes a discussion of the older Cygnus configure system. - - This document does not describe in detail how to use each of the -tools; see the respective manuals for that. Instead, it describes -which files the developer must write, which files are machine generated -and how they are generated, and where certain common problems should be -addressed. - - This document draws on several sources, including the autoconf -manual by David MacKenzie (*note autoconf overview: (autoconf)Top.), -the automake manual by David MacKenzie and Tom Tromey (*note automake -overview: (automake)Top.), the libtool manual by Gordon Matzigkeit -(*note libtool overview: (libtool)Top.), and the Cygnus configure -manual by K. Richard Pixley. - -* Menu: - -* Goals:: Goals. -* Tools:: The tools. -* History:: History. -* Building:: Building. - - -File: configure.info, Node: Goals, Next: Tools, Up: Introduction - -1.1 Goals -========= - -The GNU configure and build system has two main goals. - - The first is to simplify the development of portable programs. The -system permits the developer to concentrate on writing the program, -simplifying many details of portability across Unix and even Windows -systems, and permitting the developer to describe how to build the -program using simple rules rather than complex Makefiles. - - The second is to simplify the building of programs distributed as -source code. All programs are built using a simple, standardized, two -step process. The program builder need not install any special tools in -order to build the program. - - -File: configure.info, Node: Tools, Next: History, Prev: Goals, Up: Introduction - -1.2 Tools -========= - -The GNU configure and build system is comprised of several different -tools. Program developers must build and install all of these tools. - - People who just want to build programs from distributed sources -normally do not need any special tools beyond a Unix shell, a make -program, and a C compiler. - -autoconf - provides a general portability framework, based on testing the - features of the host system at build time. - -automake - a system for describing how to build a program, permitting the - developer to write a simplified `Makefile'. - -libtool - a standardized approach to building shared libraries. - -gettext - provides a framework for translation of text messages into other - languages; not really discussed in this document. - -m4 - autoconf requires the GNU version of m4; the standard Unix m4 does - not suffice. - -perl - automake requires perl. - - -File: configure.info, Node: History, Next: Building, Prev: Tools, Up: Introduction - -1.3 History -=========== - -This is a very brief and probably inaccurate history. - - As the number of Unix variants increased during the 1980s, it became -harder to write programs which could run on all variants. While it was -often possible to use `#ifdef' to identify particular systems, -developers frequently did not have access to every system, and the -characteristics of some systems changed from version to version. - - By 1992, at least three different approaches had been developed: - * The Metaconfig program, by Larry Wall, Harlan Stenn, and Raphael - Manfredi. - - * The Cygnus configure script, by K. Richard Pixley, and the gcc - configure script, by Richard Stallman. These use essentially the - same approach, and the developers communicated regularly. - - * The autoconf program, by David MacKenzie. - - The Metaconfig program is still used for Perl and a few other -programs. It is part of the Dist package. I do not know if it is -being developed. - - In 1994, David MacKenzie and others modified autoconf to incorporate -all the features of Cygnus configure. Since then, there has been a -slow but steady conversion of GNU programs from Cygnus configure to -autoconf. gcc has been converted, eliminating the gcc configure script. - - GNU autoconf was regularly maintained until late 1996. As of this -writing in June, 1998, it has no public maintainer. - - Most programs are built using the make program, which requires the -developer to write Makefiles describing how to build the programs. -Since most programs are built in pretty much the same way, this led to a -lot of duplication. - - The X Window system is built using the imake tool, which uses a -database of rules to eliminate the duplication. However, building a -tool which was developed using imake requires that the builder have -imake installed, violating one of the goals of the GNU system. - - The new BSD make provides a standard library of Makefile fragments, -which permits developers to write very simple Makefiles. However, this -requires that the builder install the new BSD make program. - - In 1994, David MacKenzie wrote the first version of automake, which -permitted writing a simple build description which was converted into a -Makefile which could be used by the standard make program. In 1995, Tom -Tromey completely rewrote automake in Perl, and he continues to enhance -it. - - Various free packages built libraries, and by around 1995 several -included support to build shared libraries on various platforms. -However, there was no consistent approach. In early 1996, Gordon -Matzigkeit began working on libtool, which provided a standardized -approach to building shared libraries. This was integrated into -automake from the start. - - The development of automake and libtool was driven by the GNITS -project, a group of GNU maintainers who designed standardized tools to -help meet the GNU coding standards. - - -File: configure.info, Node: Building, Prev: History, Up: Introduction - -1.4 Building -============ - -Most readers of this document should already know how to build a tool by -running `configure' and `make'. This section may serve as a quick -introduction or reminder. - - Building a tool is normally as simple as running `configure' -followed by `make'. You should normally run `configure' from an empty -directory, using some path to refer to the `configure' script in the -source directory. The directory in which you run `configure' is called -the "object directory". - - In order to use a object directory which is different from the source -directory, you must be using the GNU version of `make', which has the -required `VPATH' support. Despite this restriction, using a different -object directory is highly recommended: - * It keeps the files generated during the build from cluttering up - your sources. - - * It permits you to remove the built files by simply removing the - entire build directory. - - * It permits you to build from the same sources with several sets of - configure options simultaneously. - - If you don't have GNU `make', you will have to run `configure' in -the source directory. All GNU packages should support this; in -particular, GNU packages should not assume the presence of GNU `make'. - - After running `configure', you can build the tools by running `make'. - - To install the tools, run `make install'. Installing the tools will -copy the programs and any required support files to the "installation -directory". The location of the installation directory is controlled -by `configure' options, as described below. - - In the Cygnus tree at present, the info files are built and -installed as a separate step. To build them, run `make info'. To -install them, run `make install-info'. The equivalent html files are -also built and installed in a separate step. To build the html files, -run `make html'. To install the html files run `make install-html'. - - All `configure' scripts support a wide variety of options. The most -interesting ones are `--with' and `--enable' options which are -generally specific to particular tools. You can usually use the -`--help' option to get a list of interesting options for a particular -configure script. - - The only generic options you are likely to use are the `--prefix' -and `--exec-prefix' options. These options are used to specify the -installation directory. - - The directory named by the `--prefix' option will hold machine -independent files such as info files. - - The directory named by the `--exec-prefix' option, which is normally -a subdirectory of the `--prefix' directory, will hold machine dependent -files such as executables. - - The default for `--prefix' is `/usr/local'. The default for -`--exec-prefix' is the value used for `--prefix'. - - The convention used in Cygnus releases is to use a `--prefix' option -of `/usr/cygnus/RELEASE', where RELEASE is the name of the release, and -to use a `--exec-prefix' option of `/usr/cygnus/RELEASE/H-HOST', where -HOST is the configuration name of the host system (*note Configuration -Names::). - - Do not use either the source or the object directory as the -installation directory. That will just lead to confusion. - - -File: configure.info, Node: Getting Started, Next: Files, Prev: Introduction, Up: Top - -2 Getting Started -***************** - -To start using the GNU configure and build system with your software -package, you must write three files, and you must run some tools to -manually generate additional files. - -* Menu: - -* Write configure.in:: Write configure.in. -* Write Makefile.am:: Write Makefile.am. -* Write acconfig.h:: Write acconfig.h. -* Generate files:: Generate files. -* Getting Started Example:: Example. - - -File: configure.info, Node: Write configure.in, Next: Write Makefile.am, Up: Getting Started - -2.1 Write configure.in -====================== - -You must first write the file `configure.in'. This is an autoconf -input file, and the autoconf manual describes in detail what this file -should look like. - - You will write tests in your `configure.in' file to check for -conditions that may change from one system to another, such as the -presence of particular header files or functions. - - For example, not all systems support the `gettimeofday' function. -If you want to use the `gettimeofday' function when it is available, -and to use some other function when it is not, you would check for this -by putting `AC_CHECK_FUNCS(gettimeofday)' in `configure.in'. - - When the configure script is run at build time, this will arrange to -define the preprocessor macro `HAVE_GETTIMEOFDAY' to the value 1 if the -`gettimeofday' function is available, and to not define the macro at -all if the function is not available. Your code can then use `#ifdef' -to test whether it is safe to call `gettimeofday'. - - If you have an existing body of code, the `autoscan' program may -help identify potential portability problems, and hence configure tests -that you will want to use. *Note Invoking autoscan: (autoconf)Invoking -autoscan. - - Another handy tool for an existing body of code is `ifnames'. This -will show you all the preprocessor conditionals that the code already -uses. *Note Invoking ifnames: (autoconf)Invoking ifnames. - - Besides the portability tests which are specific to your particular -package, every `configure.in' file should contain the following macros. - -`AC_INIT' - This macro takes a single argument, which is the name of a file in - your package. For example, `AC_INIT(foo.c)'. - -`AC_PREREQ(VERSION)' - This macro is optional. It may be used to indicate the version of - `autoconf' that you are using. This will prevent users from - running an earlier version of `autoconf' and perhaps getting an - invalid `configure' script. For example, `AC_PREREQ(2.12)'. - -`AM_INIT_AUTOMAKE' - This macro takes two arguments: the name of the package, and a - version number. For example, `AM_INIT_AUTOMAKE(foo, 1.0)'. (This - macro is not needed if you are not using automake). - -`AM_CONFIG_HEADER' - This macro names the header file which will hold the preprocessor - macro definitions at run time. Normally this should be - `config.h'. Your sources would then use `#include "config.h"' to - include it. - - This macro may optionally name the input file for that header - file; by default, this is `config.h.in', but that file name works - poorly on DOS filesystems. Therefore, it is often better to name - it explicitly as `config.in'. - - This is what you should normally put in `configure.in': - AM_CONFIG_HEADER(config.h:config.in) - - (If you are not using automake, use `AC_CONFIG_HEADER' rather than - `AM_CONFIG_HEADER'). - -`AM_MAINTAINER_MODE' - This macro always appears in Cygnus configure scripts. Other - programs may or may not use it. - - If this macro is used, the `--enable-maintainer-mode' option is - required to enable automatic rebuilding of generated files used by - the configure system. This of course requires that developers be - aware of, and use, that option. - - If this macro is not used, then the generated files will always be - rebuilt automatically. This will cause problems if the wrong - versions of autoconf, automake, or others are in the builder's - `PATH'. - - (If you are not using automake, you do not need to use this macro). - -`AC_EXEEXT' - Either this macro or `AM_EXEEXT' always appears in Cygnus configure - files. Other programs may or may not use one of them. - - This macro looks for the executable suffix used on the host - system. On Unix systems, this is the empty string. On Windows - systems, this is `.exe'. This macro directs automake to use the - executable suffix as appropriate when creating programs. This - macro does not take any arguments. - - The `AC_EXEEXT' form is new, and is part of a Cygnus patch to - autoconf to support compiling with Visual C++. Older programs use - `AM_EXEEXT' instead. - - (Programs which do not use automake use neither `AC_EXEEXT' nor - `AM_EXEEXT'). - -`AC_PROG_CC' - If you are writing C code, you will normally want to use this - macro. It locates the C compiler to use. It does not take any - arguments. - - However, if this `configure.in' file is for a library which is to - be compiled by a cross compiler which may not fully work, then you - will not want to use `AC_PROG_CC'. Instead, you will want to use a - variant which does not call the macro `AC_PROG_CC_WORKS'. Examples - can be found in various `configure.in' files for libraries that are - compiled with cross compilers, such as libiberty or libgloss. - This is essentially a bug in autoconf, and there will probably be - a better workaround at some point. - -`AC_PROG_CXX' - If you are writing C++ code, you will want to use this macro. It - locates the C++ compiler to use. It does not take any arguments. - The same cross compiler comments apply as for `AC_PROG_CC'. - -`AM_PROG_LIBTOOL' - If you want to build libraries, and you want to permit them to be - shared, or you want to link against libraries which were built - using libtool, then you will need this macro. This macro is - required in order to use libtool. - - By default, this will cause all libraries to be built as shared - libraries. To prevent this-to change the default-use - `AM_DISABLE_SHARED' before `AM_PROG_LIBTOOL'. The configure - options `--enable-shared' and `--disable-shared' may be used to - override the default at build time. - -`AC_DEFINE(_GNU_SOURCE)' - GNU packages should normally include this line before any other - feature tests. This defines the macro `_GNU_SOURCE' when - compiling, which directs the libc header files to provide the - standard GNU system interfaces including all GNU extensions. If - this macro is not defined, certain GNU extensions may not be - available. - -`AC_OUTPUT' - This macro takes a list of file names which the configure process - should produce. This is normally a list of one or more `Makefile' - files in different directories. If your package lives entirely in - a single directory, you would use simply `AC_OUTPUT(Makefile)'. - If you also have, for example, a `lib' subdirectory, you would use - `AC_OUTPUT(Makefile lib/Makefile)'. - - If you want to use locally defined macros in your `configure.in' -file, then you will need to write a `acinclude.m4' file which defines -them (if not using automake, this file is called `aclocal.m4'). -Alternatively, you can put separate macros in an `m4' subdirectory, and -put `ACLOCAL_AMFLAGS = -I m4' in your `Makefile.am' file so that the -`aclocal' program will be able to find them. - - The different macro prefixes indicate which tool defines the macro. -Macros which start with `AC_' are part of autoconf. Macros which start -with `AM_' are provided by automake or libtool. - - -File: configure.info, Node: Write Makefile.am, Next: Write acconfig.h, Prev: Write configure.in, Up: Getting Started - -2.2 Write Makefile.am -===================== - -You must write the file `Makefile.am'. This is an automake input file, -and the automake manual describes in detail what this file should look -like. - - The automake commands in `Makefile.am' mostly look like variable -assignments in a `Makefile'. automake recognizes special variable -names, and automatically add make rules to the output as needed. - - There will be one `Makefile.am' file for each directory in your -package. For each directory with subdirectories, the `Makefile.am' -file should contain the line - SUBDIRS = DIR DIR ... - where each DIR is the name of a subdirectory. - - For each `Makefile.am', there should be a corresponding `Makefile' -in the `AC_OUTPUT' macro in `configure.in'. - - Every `Makefile.am' written at Cygnus should contain the line - AUTOMAKE_OPTIONS = cygnus - This puts automake into Cygnus mode. See the automake manual for -details. - - You may to include the version number of `automake' that you are -using on the `AUTOMAKE_OPTIONS' line. For example, - AUTOMAKE_OPTIONS = cygnus 1.3 - This will prevent users from running an earlier version of -`automake' and perhaps getting an invalid `Makefile.in'. - - If your package builds a program, then in the directory where that -program is built you will normally want a line like - bin_PROGRAMS = PROGRAM - where PROGRAM is the name of the program. You will then want a line -like - PROGRAM_SOURCES = FILE FILE ... - where each FILE is the name of a source file to link into the -program (e.g., `foo.c'). - - If your package builds a library, and you do not want the library to -ever be built as a shared library, then in the directory where that -library is built you will normally want a line like - lib_LIBRARIES = libNAME.a - where `libNAME.a' is the name of the library. You will then want a -line like - libNAME_a_SOURCES = FILE FILE ... - where each FILE is the name of a source file to add to the library. - - If your package builds a library, and you want to permit building the -library as a shared library, then in the directory where that library is -built you will normally want a line like - lib_LTLIBRARIES = libNAME.la - The use of `LTLIBRARIES', and the `.la' extension, indicate a -library to be built using libtool. As usual, you will then want a line -like - libNAME_la_SOURCES = FILE FILE ... - - The strings `bin' and `lib' that appear above in `bin_PROGRAMS' and -`lib_LIBRARIES' are not arbitrary. They refer to particular -directories, which may be set by the `--bindir' and `--libdir' options -to `configure'. If those options are not used, the default values are -based on the `--prefix' or `--exec-prefix' options to `configure'. It -is possible to use other names if the program or library should be -installed in some other directory. - - The `Makefile.am' file may also contain almost anything that may -appear in a normal `Makefile'. automake also supports many other -special variables, as well as conditionals. - - See the automake manual for more information. - - -File: configure.info, Node: Write acconfig.h, Next: Generate files, Prev: Write Makefile.am, Up: Getting Started - -2.3 Write acconfig.h -==================== - -If you are generating a portability header file, (i.e., you are using -`AM_CONFIG_HEADER' in `configure.in'), then you will have to write a -`acconfig.h' file. It will have to contain the following lines. - - /* Name of package. */ - #undef PACKAGE - - /* Version of package. */ - #undef VERSION - - This requirement is really a bug in the system, and the requirement -may be eliminated at some later date. - - The `acconfig.h' file will also similar comment and `#undef' lines -for any unusual macros in the `configure.in' file, including any macro -which appears in a `AC_DEFINE' macro. - - In particular, if you are writing a GNU package and therefore include -`AC_DEFINE(_GNU_SOURCE)' in `configure.in' as suggested above, you will -need lines like this in `acconfig.h': - /* Enable GNU extensions. */ - #undef _GNU_SOURCE - - Normally the `autoheader' program will inform you of any such -requirements by printing an error message when it is run. However, if -you do anything particular odd in your `configure.in' file, you will -have to make sure that the right entries appear in `acconfig.h', since -otherwise the results of the tests may not be available in the -`config.h' file which your code will use. - - (Thee `PACKAGE' and `VERSION' lines are not required if you are not -using automake, and in that case you may not need a `acconfig.h' file -at all). - - -File: configure.info, Node: Generate files, Next: Getting Started Example, Prev: Write acconfig.h, Up: Getting Started - -2.4 Generate files -================== - -Once you have written `configure.in', `Makefile.am', `acconfig.h', and -possibly `acinclude.m4', you must use autoconf and automake programs to -produce the first versions of the generated files. This is done by -executing the following sequence of commands. - - aclocal - autoconf - autoheader - automake - - The `aclocal' and `automake' commands are part of the automake -package, and the `autoconf' and `autoheader' commands are part of the -autoconf package. - - If you are using a `m4' subdirectory for your macros, you will need -to use the `-I m4' option when you run `aclocal'. - - If you are not using the Cygnus tree, use the `-a' option when -running `automake' command in order to copy the required support files -into your source directory. - - If you are using libtool, you must build and install the libtool -package with the same `--prefix' and `--exec-prefix' options as you -used with the autoconf and automake packages. You must do this before -running any of the above commands. If you are not using the Cygnus -tree, you will need to run the `libtoolize' program to copy the libtool -support files into your directory. - - Once you have managed to run these commands without getting any -errors, you should create a new empty directory, and run the `configure' -script which will have been created by `autoconf' with the -`--enable-maintainer-mode' option. This will give you a set of -Makefiles which will include rules to automatically rebuild all the -generated files. - - After doing that, whenever you have changed some of the input files -and want to regenerated the other files, go to your object directory -and run `make'. Doing this is more reliable than trying to rebuild the -files manually, because there are complex order dependencies and it is -easy to forget something. - - -File: configure.info, Node: Getting Started Example, Prev: Generate files, Up: Getting Started - -2.5 Example -=========== - -Let's consider a trivial example. - - Suppose we want to write a simple version of `touch'. Our program, -which we will call `poke', will take a single file name argument, and -use the `utime' system call to set the modification and access times of -the file to the current time. We want this program to be highly -portable. - - We'll first see what this looks like without using autoconf and -automake, and then see what it looks like with them. - -* Menu: - -* Getting Started Example 1:: First Try. -* Getting Started Example 2:: Second Try. -* Getting Started Example 3:: Third Try. -* Generate Files in Example:: Generate Files. - - -File: configure.info, Node: Getting Started Example 1, Next: Getting Started Example 2, Up: Getting Started Example - -2.5.1 First Try ---------------- - -Here is our first try at `poke.c'. Note that we've written it without -ANSI/ISO C prototypes, since we want it to be highly portable. - - #include - #include - #include - #include - - int - main (argc, argv) - int argc; - char **argv; - { - if (argc != 2) - { - fprintf (stderr, "Usage: poke file\n"); - exit (1); - } - - if (utime (argv[1], NULL) < 0) - { - perror ("utime"); - exit (1); - } - - exit (0); - } - - We also write a simple `Makefile'. - - CC = gcc - CFLAGS = -g -O2 - - all: poke - - poke: poke.o - $(CC) -o poke $(CFLAGS) $(LDFLAGS) poke.o - - So far, so good. - - Unfortunately, there are a few problems. - - On older Unix systems derived from BSD 4.3, the `utime' system call -does not accept a second argument of `NULL'. On those systems, we need -to pass a pointer to `struct utimbuf' structure. Unfortunately, even -older systems don't define that structure; on those systems, we need to -pass an array of two `long' values. - - The header file `stdlib.h' was invented by ANSI C, and older systems -don't have a copy. We included it above to get a declaration of `exit'. - - We can find some of these portability problems by running -`autoscan', which will create a `configure.scan' file which we can use -as a prototype for our `configure.in' file. I won't show the output, -but it will notice the potential problems with `utime' and `stdlib.h'. - - In our `Makefile', we don't provide any way to install the program. -This doesn't matter much for such a simple example, but a real program -will need an `install' target. For that matter, we will also want a -`clean' target. - - -File: configure.info, Node: Getting Started Example 2, Next: Getting Started Example 3, Prev: Getting Started Example 1, Up: Getting Started Example - -2.5.2 Second Try ----------------- - -Here is our second try at this program. - - We modify `poke.c' to use preprocessor macros to control what -features are available. (I've cheated a bit by using the same macro -names which autoconf will use). - - #include - - #ifdef STDC_HEADERS - #include - #endif - - #include - - #ifdef HAVE_UTIME_H - #include - #endif - - #ifndef HAVE_UTIME_NULL - - #include - - #ifndef HAVE_STRUCT_UTIMBUF - - struct utimbuf - { - long actime; - long modtime; - }; - - #endif - - static int - utime_now (file) - char *file; - { - struct utimbuf now; - - now.actime = now.modtime = time (NULL); - return utime (file, &now); - } - - #define utime(f, p) utime_now (f) - - #endif /* HAVE_UTIME_NULL */ - - int - main (argc, argv) - int argc; - char **argv; - { - if (argc != 2) - { - fprintf (stderr, "Usage: poke file\n"); - exit (1); - } - - if (utime (argv[1], NULL) < 0) - { - perror ("utime"); - exit (1); - } - - exit (0); - } - - Here is the associated `Makefile'. We've added support for the -preprocessor flags we use. We've also added `install' and `clean' -targets. - - # Set this to your installation directory. - bindir = /usr/local/bin - - # Uncomment this if you have the standard ANSI/ISO C header files. - # STDC_HDRS = -DSTDC_HEADERS - - # Uncomment this if you have utime.h. - # UTIME_H = -DHAVE_UTIME_H - - # Uncomment this if utime (FILE, NULL) works on your system. - # UTIME_NULL = -DHAVE_UTIME_NULL - - # Uncomment this if struct utimbuf is defined in utime.h. - # UTIMBUF = -DHAVE_STRUCT_UTIMBUF - - CC = gcc - CFLAGS = -g -O2 - - ALL_CFLAGS = $(STDC_HDRS) $(UTIME_H) $(UTIME_NULL) $(UTIMBUF) $(CFLAGS) - - all: poke - - poke: poke.o - $(CC) -o poke $(ALL_CFLAGS) $(LDFLAGS) poke.o - - .c.o: - $(CC) -c $(ALL_CFLAGS) poke.c - - install: poke - cp poke $(bindir)/poke - - clean: - rm poke poke.o - - Some problems with this approach should be clear. - - Users who want to compile poke will have to know how `utime' works -on their systems, so that they can uncomment the `Makefile' correctly. - - The installation is done using `cp', but many systems have an -`install' program which may be used, and which supports optional -features such as stripping debugging information out of the installed -binary. - - The use of `Makefile' variables like `CC', `CFLAGS' and `LDFLAGS' -follows the requirements of the GNU standards. This is convenient for -all packages, since it reduces surprises for users. However, it is -easy to get the details wrong, and wind up with a slightly nonstandard -distribution. - - -File: configure.info, Node: Getting Started Example 3, Next: Generate Files in Example, Prev: Getting Started Example 2, Up: Getting Started Example - -2.5.3 Third Try ---------------- - -For our third try at this program, we will write a `configure.in' -script to discover the configuration features on the host system, rather -than requiring the user to edit the `Makefile'. We will also write a -`Makefile.am' rather than a `Makefile'. - - The only change to `poke.c' is to add a line at the start of the -file: - #include "config.h" - - The new `configure.in' file is as follows. - - AC_INIT(poke.c) - AM_INIT_AUTOMAKE(poke, 1.0) - AM_CONFIG_HEADER(config.h:config.in) - AC_PROG_CC - AC_HEADER_STDC - AC_CHECK_HEADERS(utime.h) - AC_EGREP_HEADER(utimbuf, utime.h, AC_DEFINE(HAVE_STRUCT_UTIMBUF)) - AC_FUNC_UTIME_NULL - AC_OUTPUT(Makefile) - - The first four macros in this file, and the last one, were described -above; see *Note Write configure.in::. If we omit these macros, then -when we run `automake' we will get a reminder that we need them. - - The other macros are standard autoconf macros. - -`AC_HEADER_STDC' - Check for standard C headers. - -`AC_CHECK_HEADERS' - Check whether a particular header file exists. - -`AC_EGREP_HEADER' - Check for a particular string in a particular header file, in this - case checking for `utimbuf' in `utime.h'. - -`AC_FUNC_UTIME_NULL' - Check whether `utime' accepts a NULL second argument to set the - file change time to the current time. - - See the autoconf manual for a more complete description. - - The new `Makefile.am' file is as follows. Note how simple this is -compared to our earlier `Makefile'. - - bin_PROGRAMS = poke - - poke_SOURCES = poke.c - - This means that we should build a single program name `poke'. It -should be installed in the binary directory, which we called `bindir' -earlier. The program `poke' is built from the source file `poke.c'. - - We must also write a `acconfig.h' file. Besides `PACKAGE' and -`VERSION', which must be mentioned for all packages which use automake, -we must include `HAVE_STRUCT_UTIMBUF', since we mentioned it in an -`AC_DEFINE'. - - /* Name of package. */ - #undef PACKAGE - - /* Version of package. */ - #undef VERSION - - /* Whether utime.h defines struct utimbuf. */ - #undef HAVE_STRUCT_UTIMBUF - - -File: configure.info, Node: Generate Files in Example, Prev: Getting Started Example 3, Up: Getting Started Example - -2.5.4 Generate Files --------------------- - -We must now generate the other files, using the following commands. - - aclocal - autoconf - autoheader - automake - - When we run `autoheader', it will remind us of any macros we forgot -to add to `acconfig.h'. - - When we run `automake', it will want to add some files to our -distribution. It will add them automatically if we use the -`--add-missing' option. - - By default, `automake' will run in GNU mode, which means that it -will want us to create certain additional files; as of this writing, it -will want `NEWS', `README', `AUTHORS', and `ChangeLog', all of which -are files which should appear in a standard GNU distribution. We can -either add those files, or run `automake' with the `--foreign' option. - - Running these tools will generate the following files, all of which -are described in the next chapter. - - * `aclocal.m4' - - * `configure' - - * `config.in' - - * `Makefile.in' - - * `stamp-h.in' - - -File: configure.info, Node: Files, Next: Configuration Names, Prev: Getting Started, Up: Top - -3 Files -******* - -As was seen in the previous chapter, the GNU configure and build system -uses a number of different files. The developer must write a few files. -The others are generated by various tools. - - The system is rather flexible, and can be used in many different -ways. In describing the files that it uses, I will describe the common -case, and mention some other cases that may arise. - -* Menu: - -* Developer Files:: Developer Files. -* Build Files:: Build Files. -* Support Files:: Support Files. - - -File: configure.info, Node: Developer Files, Next: Build Files, Up: Files - -3.1 Developer Files -=================== - -This section describes the files written or generated by the developer -of a package. - -* Menu: - -* Developer Files Picture:: Developer Files Picture. -* Written Developer Files:: Written Developer Files. -* Generated Developer Files:: Generated Developer Files. - - -File: configure.info, Node: Developer Files Picture, Next: Written Developer Files, Up: Developer Files - -3.1.1 Developer Files Picture ------------------------------ - -Here is a picture of the files which are written by the developer, the -generated files which would be included with a complete source -distribution, and the tools which create those files. The file names -are plain text and the tool names are enclosed by `*' characters (e.g., -`autoheader' is the name of a tool, not the name of a file). - - acconfig.h configure.in Makefile.am - | | | - | --------------+---------------------- | - | | | | | - v v | acinclude.m4 | | - *autoheader* | | v v - | | v --->*automake* - v |--->*aclocal* | | - config.in | | | v - | v | Makefile.in - | aclocal.m4--- - | | - v v - *autoconf* - | - v - configure - - -File: configure.info, Node: Written Developer Files, Next: Generated Developer Files, Prev: Developer Files Picture, Up: Developer Files - -3.1.2 Written Developer Files ------------------------------ - -The following files would be written by the developer. - -`configure.in' - This is the configuration script. This script contains - invocations of autoconf macros. It may also contain ordinary - shell script code. This file will contain feature tests for - portability issues. The last thing in the file will normally be - an `AC_OUTPUT' macro listing which files to create when the - builder runs the configure script. This file is always required - when using the GNU configure system. *Note Write configure.in::. - -`Makefile.am' - This is the automake input file. It describes how the code should - be built. It consists of definitions of automake variables. It - may also contain ordinary Makefile targets. This file is only - needed when using automake (newer tools normally use automake, but - there are still older tools which have not been converted, in - which the developer writes `Makefile.in' directly). *Note Write - Makefile.am::. - -`acconfig.h' - When the configure script creates a portability header file, by - using `AM_CONFIG_HEADER' (or, if not using automake, - `AC_CONFIG_HEADER'), this file is used to describe macros which are - not recognized by the `autoheader' command. This is normally a - fairly uninteresting file, consisting of a collection of `#undef' - lines with comments. Normally any call to `AC_DEFINE' in - `configure.in' will require a line in this file. *Note Write - acconfig.h::. - -`acinclude.m4' - This file is not always required. It defines local autoconf - macros. These macros may then be used in `configure.in'. If you - don't need any local autoconf macros, then you don't need this - file at all. In fact, in general, you never need local autoconf - macros, since you can put everything in `configure.in', but - sometimes a local macro is convenient. - - Newer tools may omit `acinclude.m4', and instead use a - subdirectory, typically named `m4', and define `ACLOCAL_AMFLAGS = - -I m4' in `Makefile.am' to force `aclocal' to look there for macro - definitions. The macro definitions are then placed in separate - files in that directory. - - The `acinclude.m4' file is only used when using automake; in older - tools, the developer writes `aclocal.m4' directly, if it is needed. - - -File: configure.info, Node: Generated Developer Files, Prev: Written Developer Files, Up: Developer Files - -3.1.3 Generated Developer Files -------------------------------- - -The following files would be generated by the developer. - - When using automake, these files are normally not generated manually -after the first time. Instead, the generated `Makefile' contains rules -to automatically rebuild the files as required. When -`AM_MAINTAINER_MODE' is used in `configure.in' (the normal case in -Cygnus code), the automatic rebuilding rules will only be defined if -you configure using the `--enable-maintainer-mode' option. - - When using automatic rebuilding, it is important to ensure that all -the various tools have been built and installed on your `PATH'. Using -automatic rebuilding is highly recommended, so much so that I'm not -going to explain what you have to do if you don't use it. - -`configure' - This is the configure script which will be run when building the - package. This is generated by `autoconf' from `configure.in' and - `aclocal.m4'. This is a shell script. - -`Makefile.in' - This is the file which the configure script will turn into the - `Makefile' at build time. This file is generated by `automake' - from `Makefile.am'. If you aren't using automake, you must write - this file yourself. This file is pretty much a normal `Makefile', - with some configure substitutions for certain variables. - -`aclocal.m4' - This file is created by the `aclocal' program, based on the - contents of `configure.in' and `acinclude.m4' (or, as noted in the - description of `acinclude.m4' above, on the contents of an `m4' - subdirectory). This file contains definitions of autoconf macros - which `autoconf' will use when generating the file `configure'. - These autoconf macros may be defined by you in `acinclude.m4' or - they may be defined by other packages such as automake, libtool or - gettext. If you aren't using automake, you will normally write - this file yourself; in that case, if `configure.in' uses only - standard autoconf macros, this file will not be needed at all. - -`config.in' - This file is created by `autoheader' based on `acconfig.h' and - `configure.in'. At build time, the configure script will define - some of the macros in it to create `config.h', which may then be - included by your program. This permits your C code to use - preprocessor conditionals to change its behaviour based on the - characteristics of the host system. This file may also be called - `config.h.in'. - -`stamp.h-in' - This rather uninteresting file, which I omitted from the picture, - is generated by `automake'. It always contains the string - `timestamp'. It is used as a timestamp file indicating whether - `config.in' is up to date. Using a timestamp file means that - `config.in' can be marked as up to date without actually changing - its modification time. This is useful since `config.in' depends - upon `configure.in', but it is easy to change `configure.in' in a - way which does not affect `config.in'. - - -File: configure.info, Node: Build Files, Next: Support Files, Prev: Developer Files, Up: Files - -3.2 Build Files -=============== - -This section describes the files which are created at configure and -build time. These are the files which somebody who builds the package -will see. - - Of course, the developer will also build the package. The -distinction between developer files and build files is not that the -developer does not see the build files, but that somebody who only -builds the package does not have to worry about the developer files. - -* Menu: - -* Build Files Picture:: Build Files Picture. -* Build Files Description:: Build Files Description. - - -File: configure.info, Node: Build Files Picture, Next: Build Files Description, Up: Build Files - -3.2.1 Build Files Picture -------------------------- - -Here is a picture of the files which will be created at build time. -`config.status' is both a created file and a shell script which is run -to create other files, and the picture attempts to show that. - - config.in *configure* Makefile.in - | | | - | v | - | config.status | - | | | - *config.status*<======+==========>*config.status* - | | - v v - config.h Makefile - - -File: configure.info, Node: Build Files Description, Prev: Build Files Picture, Up: Build Files - -3.2.2 Build Files Description ------------------------------ - -This is a description of the files which are created at build time. - -`config.status' - The first step in building a package is to run the `configure' - script. The `configure' script will create the file - `config.status', which is itself a shell script. When you first - run `configure', it will automatically run `config.status'. An - `Makefile' derived from an automake generated `Makefile.in' will - contain rules to automatically run `config.status' again when - necessary to recreate certain files if their inputs change. - -`Makefile' - This is the file which make will read to build the program. The - `config.status' script will transform `Makefile.in' into - `Makefile'. - -`config.h' - This file defines C preprocessor macros which C code can use to - adjust its behaviour on different systems. The `config.status' - script will transform `config.in' into `config.h'. - -`config.cache' - This file did not fit neatly into the picture, and I omitted it. - It is used by the `configure' script to cache results between - runs. This can be an important speedup. If you modify - `configure.in' in such a way that the results of old tests should - change (perhaps you have added a new library to `LDFLAGS'), then - you will have to remove `config.cache' to force the tests to be - rerun. - - The autoconf manual explains how to set up a site specific cache - file. This can speed up running `configure' scripts on your - system. - -`stamp.h' - This file, which I omitted from the picture, is similar to - `stamp-h.in'. It is used as a timestamp file indicating whether - `config.h' is up to date. This is useful since `config.h' depends - upon `config.status', but it is easy for `config.status' to change - in a way which does not affect `config.h'. - - -File: configure.info, Node: Support Files, Prev: Build Files, Up: Files - -3.3 Support Files -================= - -The GNU configure and build system requires several support files to be -included with your distribution. You do not normally need to concern -yourself with these. If you are using the Cygnus tree, most are already -present. Otherwise, they will be installed with your source by -`automake' (with the `--add-missing' option) and `libtoolize'. - - You don't have to put the support files in the top level directory. -You can put them in a subdirectory, and use the `AC_CONFIG_AUX_DIR' -macro in `configure.in' to tell `automake' and the `configure' script -where they are. - - In this section, I describe the support files, so that you can know -what they are and why they are there. - -`ABOUT-NLS' - Added by automake if you are using gettext. This is a - documentation file about the gettext project. - -`ansi2knr.c' - Used by an automake generated `Makefile' if you put `ansi2knr' in - `AUTOMAKE_OPTIONS' in `Makefile.am'. This permits compiling ANSI - C code with a K&R C compiler. - -`ansi2knr.1' - The man page which goes with `ansi2knr.c'. - -`config.guess' - A shell script which determines the configuration name for the - system on which it is run. - -`config.sub' - A shell script which canonicalizes a configuration name entered by - a user. - -`elisp-comp' - Used to compile Emacs LISP files. - -`install-sh' - A shell script which installs a program. This is used if the - configure script can not find an install binary. - -`ltconfig' - Used by libtool. This is a shell script which configures libtool - for the particular system on which it is used. - -`ltmain.sh' - Used by libtool. This is the actual libtool script which is used, - after it is configured by `ltconfig' to build a library. - -`mdate-sh' - A shell script used by an automake generated `Makefile' to pretty - print the modification time of a file. This is used to maintain - version numbers for texinfo files. - -`missing' - A shell script used if some tool is missing entirely. This is - used by an automake generated `Makefile' to avoid certain sorts of - timestamp problems. - -`mkinstalldirs' - A shell script which creates a directory, including all parent - directories. This is used by an automake generated `Makefile' - during installation. - -`texinfo.tex' - Required if you have any texinfo files. This is used when - converting Texinfo files into DVI using `texi2dvi' and TeX. - -`ylwrap' - A shell script used by an automake generated `Makefile' to run - programs like `bison', `yacc', `flex', and `lex'. These programs - default to producing output files with a fixed name, and the - `ylwrap' script runs them in a subdirectory to avoid file name - conflicts when using a parallel make program. - - -File: configure.info, Node: Configuration Names, Next: Cross Compilation Tools, Prev: Files, Up: Top - -4 Configuration Names -********************* - -The GNU configure system names all systems using a "configuration -name". All such names used to be triplets (they may now contain four -parts in certain cases), and the term "configuration triplet" is still -seen. - -* Menu: - -* Configuration Name Definition:: Configuration Name Definition. -* Using Configuration Names:: Using Configuration Names. - - -File: configure.info, Node: Configuration Name Definition, Next: Using Configuration Names, Up: Configuration Names - -4.1 Configuration Name Definition -================================= - -This is a string of the form CPU-MANUFACTURER-OPERATING_SYSTEM. In -some cases, this is extended to a four part form: -CPU-MANUFACTURER-KERNEL-OPERATING_SYSTEM. - - When using a configuration name in a configure option, it is normally -not necessary to specify an entire name. In particular, the -MANUFACTURER field is often omitted, leading to strings such as -`i386-linux' or `sparc-sunos'. The shell script `config.sub' will -translate these shortened strings into the canonical form. autoconf -will arrange for `config.sub' to be run automatically when it is needed. - - The fields of a configuration name are as follows: - -CPU - The type of processor. This is typically something like `i386' or - `sparc'. More specific variants are used as well, such as - `mipsel' to indicate a little endian MIPS processor. - -MANUFACTURER - A somewhat freeform field which indicates the manufacturer of the - system. This is often simply `unknown'. Other common strings are - `pc' for an IBM PC compatible system, or the name of a workstation - vendor, such as `sun'. - -OPERATING_SYSTEM - The name of the operating system which is run on the system. This - will be something like `solaris2.5' or `irix6.3'. There is no - particular restriction on the version number, and strings like - `aix4.1.4.0' are seen. For an embedded system, which has no - operating system, this field normally indicates the type of object - file format, such as `elf' or `coff'. - -KERNEL - This is used mainly for GNU/Linux. A typical GNU/Linux - configuration name is `i586-pc-linux-gnulibc1'. In this case the - kernel, `linux', is separated from the operating system, - `gnulibc1'. - - The shell script `config.guess' will normally print the correct -configuration name for the system on which it is run. It does by -running `uname' and by examining other characteristics of the system. - - Because `config.guess' can normally determine the configuration name -for a machine, it is normally only necessary to specify a configuration -name when building a cross-compiler or when building using a -cross-compiler. - - -File: configure.info, Node: Using Configuration Names, Prev: Configuration Name Definition, Up: Configuration Names - -4.2 Using Configuration Names -============================= - -A configure script will sometimes have to make a decision based on a -configuration name. You will need to do this if you have to compile -code differently based on something which can not be tested using a -standard autoconf feature test. - - It is normally better to test for particular features, rather than to -test for a particular system. This is because as Unix evolves, -different systems copy features from one another. Even if you need to -determine whether the feature is supported based on a configuration -name, you should define a macro which describes the feature, rather than -defining a macro which describes the particular system you are on. - - Testing for a particular system is normally done using a case -statement in `configure.in'. The case statement might look something -like the following, assuming that `host' is a shell variable holding a -canonical configuration name (which will be the case if `configure.in' -uses the `AC_CANONICAL_HOST' or `AC_CANONICAL_SYSTEM' macro). - - case "${host}" in - i[3-7]86-*-linux-gnu*) do something ;; - sparc*-sun-solaris2.[56789]*) do something ;; - sparc*-sun-solaris*) do something ;; - mips*-*-elf*) do something ;; - esac - - It is particularly important to use `*' after the operating system -field, in order to match the version number which will be generated by -`config.guess'. - - In most cases you must be careful to match a range of processor -types. For most processor families, a trailing `*' suffices, as in -`mips*' above. For the i386 family, something along the lines of -`i[3-7]86' suffices at present. For the m68k family, you will need -something like `m68*'. Of course, if you do not need to match on the -processor, it is simpler to just replace the entire field by a `*', as -in `*-*-irix*'. - - -File: configure.info, Node: Cross Compilation Tools, Next: Canadian Cross, Prev: Configuration Names, Up: Top - -5 Cross Compilation Tools -************************* - -The GNU configure and build system can be used to build "cross -compilation" tools. A cross compilation tool is a tool which runs on -one system and produces code which runs on another system. - -* Menu: - -* Cross Compilation Concepts:: Cross Compilation Concepts. -* Host and Target:: Host and Target. -* Using the Host Type:: Using the Host Type. -* Specifying the Target:: Specifying the Target. -* Using the Target Type:: Using the Target Type. -* Cross Tools in the Cygnus Tree:: Cross Tools in the Cygnus Tree - - -File: configure.info, Node: Cross Compilation Concepts, Next: Host and Target, Up: Cross Compilation Tools - -5.1 Cross Compilation Concepts -============================== - -A compiler which produces programs which run on a different system is a -cross compilation compiler, or simply a "cross compiler". Similarly, -we speak of cross assemblers, cross linkers, etc. - - In the normal case, a compiler produces code which runs on the same -system as the one on which the compiler runs. When it is necessary to -distinguish this case from the cross compilation case, such a compiler -is called a "native compiler". Similarly, we speak of native -assemblers, etc. - - Although the debugger is not strictly speaking a compilation tool, -it is nevertheless meaningful to speak of a cross debugger: a debugger -which is used to debug code which runs on another system. Everything -that is said below about configuring cross compilation tools applies to -the debugger as well. - - -File: configure.info, Node: Host and Target, Next: Using the Host Type, Prev: Cross Compilation Concepts, Up: Cross Compilation Tools - -5.2 Host and Target -=================== - -When building cross compilation tools, there are two different systems -involved: the system on which the tools will run, and the system for -which the tools generate code. - - The system on which the tools will run is called the "host" system. - - The system for which the tools generate code is called the "target" -system. - - For example, suppose you have a compiler which runs on a GNU/Linux -system and generates ELF programs for a MIPS embedded system. In this -case the GNU/Linux system is the host, and the MIPS ELF system is the -target. Such a compiler could be called a GNU/Linux cross MIPS ELF -compiler, or, equivalently, a `i386-linux-gnu' cross `mips-elf' -compiler. - - Naturally, most programs are not cross compilation tools. For those -programs, it does not make sense to speak of a target. It only makes -sense to speak of a target for tools like `gcc' or the `binutils' which -actually produce running code. For example, it does not make sense to -speak of the target of a tool like `bison' or `make'. - - Most cross compilation tools can also serve as native tools. For a -native compilation tool, it is still meaningful to speak of a target. -For a native tool, the target is the same as the host. For example, for -a GNU/Linux native compiler, the host is GNU/Linux, and the target is -also GNU/Linux. - - -File: configure.info, Node: Using the Host Type, Next: Specifying the Target, Prev: Host and Target, Up: Cross Compilation Tools - -5.3 Using the Host Type -======================= - -In almost all cases the host system is the system on which you run the -`configure' script, and on which you build the tools (for the case when -they differ, *note Canadian Cross::). - - If your configure script needs to know the configuration name of the -host system, and the package is not a cross compilation tool and -therefore does not have a target, put `AC_CANONICAL_HOST' in -`configure.in'. This macro will arrange to define a few shell -variables when the `configure' script is run. - -`host' - The canonical configuration name of the host. This will normally - be determined by running the `config.guess' shell script, although - the user is permitted to override this by using an explicit - `--host' option. - -`host_alias' - In the unusual case that the user used an explicit `--host' option, - this will be the argument to `--host'. In the normal case, this - will be the same as the `host' variable. - -`host_cpu' -`host_vendor' -`host_os' - The first three parts of the canonical configuration name. - - The shell variables may be used by putting shell code in -`configure.in'. For an example, see *Note Using Configuration Names::. - - -File: configure.info, Node: Specifying the Target, Next: Using the Target Type, Prev: Using the Host Type, Up: Cross Compilation Tools - -5.4 Specifying the Target -========================= - -By default, the `configure' script will assume that the target is the -same as the host. This is the more common case; for example, it leads -to a native compiler rather than a cross compiler. - - If you want to build a cross compilation tool, you must specify the -target explicitly by using the `--target' option when you run -`configure'. The argument to `--target' is the configuration name of -the system for which you wish to generate code. *Note Configuration -Names::. - - For example, to build tools which generate code for a MIPS ELF -embedded system, you would use `--target mips-elf'. - - -File: configure.info, Node: Using the Target Type, Next: Cross Tools in the Cygnus Tree, Prev: Specifying the Target, Up: Cross Compilation Tools - -5.5 Using the Target Type -========================= - -When writing `configure.in' for a cross compilation tool, you will need -to use information about the target. To do this, put -`AC_CANONICAL_SYSTEM' in `configure.in'. - - `AC_CANONICAL_SYSTEM' will look for a `--target' option and -canonicalize it using the `config.sub' shell script. It will also run -`AC_CANONICAL_HOST' (*note Using the Host Type::). - - The target type will be recorded in the following shell variables. -Note that the host versions of these variables will also be defined by -`AC_CANONICAL_HOST'. - -`target' - The canonical configuration name of the target. - -`target_alias' - The argument to the `--target' option. If the user did not specify - a `--target' option, this will be the same as `host_alias'. - -`target_cpu' -`target_vendor' -`target_os' - The first three parts of the canonical target configuration name. - - Note that if `host' and `target' are the same string, you can assume -a native configuration. If they are different, you can assume a cross -configuration. - - It is arguably possible for `host' and `target' to represent the -same system, but for the strings to not be identical. For example, if -`config.guess' returns `sparc-sun-sunos4.1.4', and somebody configures -with `--target sparc-sun-sunos4.1', then the slight differences between -the two versions of SunOS may be unimportant for your tool. However, -in the general case it can be quite difficult to determine whether the -differences between two configuration names are significant or not. -Therefore, by convention, if the user specifies a `--target' option -without specifying a `--host' option, it is assumed that the user wants -to configure a cross compilation tool. - - The variables `target' and `target_alias' should be handled -differently. - - In general, whenever the user may actually see a string, -`target_alias' should be used. This includes anything which may appear -in the file system, such as a directory name or part of a tool name. -It also includes any tool output, unless it is clearly labelled as the -canonical target configuration name. This permits the user to use the -`--target' option to specify how the tool will appear to the outside -world. - - On the other hand, when checking for characteristics of the target -system, `target' should be used. This is because a wide variety of -`--target' options may map into the same canonical configuration name. -You should not attempt to duplicate the canonicalization done by -`config.sub' in your own code. - - By convention, cross tools are installed with a prefix of the -argument used with the `--target' option, also known as `target_alias' -(*note Using the Target Type::). If the user does not use the -`--target' option, and thus is building a native tool, no prefix is -used. - - For example, if gcc is configured with `--target mips-elf', then the -installed binary will be named `mips-elf-gcc'. If gcc is configured -without a `--target' option, then the installed binary will be named -`gcc'. - - The autoconf macro `AC_ARG_PROGRAM' will handle this for you. If -you are using automake, no more need be done; the programs will -automatically be installed with the correct prefixes. Otherwise, see -the autoconf documentation for `AC_ARG_PROGRAM'. - - -File: configure.info, Node: Cross Tools in the Cygnus Tree, Prev: Using the Target Type, Up: Cross Compilation Tools - -5.6 Cross Tools in the Cygnus Tree -================================== - -The Cygnus tree is used for various packages including gdb, the GNU -binutils, and egcs. It is also, of course, used for Cygnus releases. - - In the Cygnus tree, the top level `configure' script uses the old -Cygnus configure system, not autoconf. The top level `Makefile.in' is -written to build packages based on what is in the source tree, and -supports building a large number of tools in a single -`configure'/`make' step. - - The Cygnus tree may be configured with a `--target' option. The -`--target' option applies recursively to every subdirectory, and -permits building an entire set of cross tools at once. - -* Menu: - -* Host and Target Libraries:: Host and Target Libraries. -* Target Library Configure Scripts:: Target Library Configure Scripts. -* Make Targets in Cygnus Tree:: Make Targets in Cygnus Tree. -* Target libiberty:: Target libiberty - - -File: configure.info, Node: Host and Target Libraries, Next: Target Library Configure Scripts, Up: Cross Tools in the Cygnus Tree - -5.6.1 Host and Target Libraries -------------------------------- - -The Cygnus tree distinguishes host libraries from target libraries. - - Host libraries are built with the compiler used to build the programs -which run on the host, which is called the host compiler. This includes -libraries such as `bfd' and `tcl'. These libraries are built with the -host compiler, and are linked into programs like the binutils or gcc -which run on the host. - - Target libraries are built with the target compiler. If gcc is -present in the source tree, then the target compiler is the gcc that is -built using the host compiler. Target libraries are libraries such as -`newlib' and `libstdc++'. These libraries are not linked into the host -programs, but are instead made available for use with programs built -with the target compiler. - - For the rest of this section, assume that gcc is present in the -source tree, so that it will be used to build the target libraries. - - There is a complication here. The configure process needs to know -which compiler you are going to use to build a tool; otherwise, the -feature tests will not work correctly. The Cygnus tree handles this by -not configuring the target libraries until the target compiler is -built. In order to permit everything to build using a single -`configure'/`make', the configuration of the target libraries is -actually triggered during the make step. - - When the target libraries are configured, the `--target' option is -not used. Instead, the `--host' option is used with the argument of -the `--target' option for the overall configuration. If no `--target' -option was used for the overall configuration, the `--host' option will -be passed with the output of the `config.guess' shell script. Any -`--build' option is passed down unchanged. - - This translation of configuration options is done because since the -target libraries are compiled with the target compiler, they are being -built in order to run on the target of the overall configuration. By -the definition of host, this means that their host system is the same as -the target system of the overall configuration. - - The same process is used for both a native configuration and a cross -configuration. Even when using a native configuration, the target -libraries will be configured and built using the newly built compiler. -This is particularly important for the C++ libraries, since there is no -reason to assume that the C++ compiler used to build the host tools (if -there even is one) uses the same ABI as the g++ compiler which will be -used to build the target libraries. - - There is one difference between a native configuration and a cross -configuration. In a native configuration, the target libraries are -normally configured and built as siblings of the host tools. In a cross -configuration, the target libraries are normally built in a subdirectory -whose name is the argument to `--target'. This is mainly for -historical reasons. - - To summarize, running `configure' in the Cygnus tree configures all -the host libraries and tools, but does not configure any of the target -libraries. Running `make' then does the following steps: - - * Build the host libraries. - - * Build the host programs, including gcc. Note that we call gcc - both a host program (since it runs on the host) and a target - compiler (since it generates code for the target). - - * Using the newly built target compiler, configure the target - libraries. - - * Build the target libraries. - - The steps need not be done in precisely this order, since they are -actually controlled by `Makefile' targets. - - -File: configure.info, Node: Target Library Configure Scripts, Next: Make Targets in Cygnus Tree, Prev: Host and Target Libraries, Up: Cross Tools in the Cygnus Tree - -5.6.2 Target Library Configure Scripts --------------------------------------- - -There are a few things you must know in order to write a configure -script for a target library. This is just a quick sketch, and beginners -shouldn't worry if they don't follow everything here. - - The target libraries are configured and built using a newly built -target compiler. There may not be any startup files or libraries for -this target compiler. In fact, those files will probably be built as -part of some target library, which naturally means that they will not -exist when your target library is configured. - - This means that the configure script for a target library may not use -any test which requires doing a link. This unfortunately includes many -useful autoconf macros, such as `AC_CHECK_FUNCS'. autoconf macros -which do a compile but not a link, such as `AC_CHECK_HEADERS', may be -used. - - This is a severe restriction, but normally not a fatal one, as target -libraries can often assume the presence of other target libraries, and -thus know which functions will be available. - - As of this writing, the autoconf macro `AC_PROG_CC' does a link to -make sure that the compiler works. This may fail in a target library, -so target libraries must use a different set of macros to locate the -compiler. See the `configure.in' file in a directory like `libiberty' -or `libgloss' for an example. - - As noted in the previous section, target libraries are sometimes -built in directories which are siblings to the host tools, and are -sometimes built in a subdirectory. The `--with-target-subdir' configure -option will be passed when the library is configured. Its value will be -an empty string if the target library is a sibling. Its value will be -the name of the subdirectory if the target library is in a subdirectory. - - If the overall build is not a native build (i.e., the overall -configure used the `--target' option), then the library will be -configured with the `--with-cross-host' option. The value of this -option will be the host system of the overall build. Recall that the -host system of the library will be the target of the overall build. If -the overall build is a native build, the `--with-cross-host' option -will not be used. - - A library which can be built both standalone and as a target library -may want to install itself into different directories depending upon the -case. When built standalone, or when built native, the library should -be installed in `$(libdir)'. When built as a target library which is -not native, the library should be installed in `$(tooldir)/lib'. The -`--with-cross-host' option may be used to distinguish these cases. - - This same test of `--with-cross-host' may be used to see whether it -is OK to use link tests in the configure script. If the -`--with-cross-host' option is not used, then the library is being built -either standalone or native, and a link should work. - - -File: configure.info, Node: Make Targets in Cygnus Tree, Next: Target libiberty, Prev: Target Library Configure Scripts, Up: Cross Tools in the Cygnus Tree - -5.6.3 Make Targets in Cygnus Tree ---------------------------------- - -The top level `Makefile' in the Cygnus tree defines targets for every -known subdirectory. - - For every subdirectory DIR which holds a host library or program, -the `Makefile' target `all-DIR' will build that library or program. - - There are dependencies among host tools. For example, building gcc -requires first building gas, because the gcc build process invokes the -target assembler. These dependencies are reflected in the top level -`Makefile'. - - For every subdirectory DIR which holds a target library, the -`Makefile' target `configure-target-DIR' will configure that library. -The `Makefile' target `all-target-DIR' will build that library. - - Every `configure-target-DIR' target depends upon `all-gcc', since -gcc, the target compiler, is required to configure the tool. Every -`all-target-DIR' target depends upon the corresponding -`configure-target-DIR' target. - - There are several other targets which may be of interest for each -directory: `install-DIR', `clean-DIR', and `check-DIR'. There are also -corresponding `target' versions of these for the target libraries , -such as `install-target-DIR'. - - -File: configure.info, Node: Target libiberty, Prev: Make Targets in Cygnus Tree, Up: Cross Tools in the Cygnus Tree - -5.6.4 Target libiberty ----------------------- - -The `libiberty' subdirectory is currently a special case, in that it is -the only directory which is built both using the host compiler and -using the target compiler. - - This is because the files in `libiberty' are used when building the -host tools, and they are also incorporated into the `libstdc++' target -library as support code. - - This duality does not pose any particular difficulties. It means -that there are targets for both `all-libiberty' and -`all-target-libiberty'. - - In a native configuration, when target libraries are not built in a -subdirectory, the same objects are normally used as both the host build -and the target build. This is normally OK, since libiberty contains -only C code, and in a native configuration the results of the host -compiler and the target compiler are normally interoperable. - - Irix 6 is again an exception here, since the SGI native compiler -defaults to using the `O32' ABI, and gcc defaults to using the `N32' -ABI. On Irix 6, the target libraries are built in a subdirectory even -for a native configuration, avoiding this problem. - - There are currently no other libraries built for both the host and -the target, but there is no conceptual problem with adding more. - - -File: configure.info, Node: Canadian Cross, Next: Cygnus Configure, Prev: Cross Compilation Tools, Up: Top - -6 Canadian Cross -**************** - -It is possible to use the GNU configure and build system to build a -program which will run on a system which is different from the system on -which the tools are built. In other words, it is possible to build -programs using a cross compiler. - - This is referred to as a "Canadian Cross". - -* Menu: - -* Canadian Cross Example:: Canadian Cross Example. -* Canadian Cross Concepts:: Canadian Cross Concepts. -* Build Cross Host Tools:: Build Cross Host Tools. -* Build and Host Options:: Build and Host Options. -* CCross not in Cygnus Tree:: Canadian Cross not in Cygnus Tree. -* CCross in Cygnus Tree:: Canadian Cross in Cygnus Tree. -* Supporting Canadian Cross:: Supporting Canadian Cross. - - -File: configure.info, Node: Canadian Cross Example, Next: Canadian Cross Concepts, Up: Canadian Cross - -6.1 Canadian Cross Example -========================== - -Here is an example of a Canadian Cross. - - While running on a GNU/Linux, you can build a program which will run -on a Solaris system. You would use a GNU/Linux cross Solaris compiler -to build the program. - - Of course, you could not run the resulting program on your GNU/Linux -system. You would have to copy it over to a Solaris system before you -would run it. - - Of course, you could also simply build the programs on the Solaris -system in the first place. However, perhaps the Solaris system is not -available for some reason; perhaps you actually don't have one, but you -want to build the tools for somebody else to use. Or perhaps your -GNU/Linux system is much faster than your Solaris system. - - A Canadian Cross build is most frequently used when building -programs to run on a non-Unix system, such as DOS or Windows. It may -be simpler to configure and build on a Unix system than to support the -configuration machinery on a non-Unix system. - - -File: configure.info, Node: Canadian Cross Concepts, Next: Build Cross Host Tools, Prev: Canadian Cross Example, Up: Canadian Cross - -6.2 Canadian Cross Concepts -=========================== - -When building a Canadian Cross, there are at least two different systems -involved: the system on which the tools are being built, and the system -on which the tools will run. - - The system on which the tools are being built is called the "build" -system. - - The system on which the tools will run is called the host system. - - For example, if you are building a Solaris program on a GNU/Linux -system, as in the previous section, the build system would be GNU/Linux, -and the host system would be Solaris. - - It is, of course, possible to build a cross compiler using a Canadian -Cross (i.e., build a cross compiler using a cross compiler). In this -case, the system for which the resulting cross compiler generates code -is called the target system. (For a more complete discussion of host -and target systems, *note Host and Target::). - - An example of building a cross compiler using a Canadian Cross would -be building a Windows cross MIPS ELF compiler on a GNU/Linux system. In -this case the build system would be GNU/Linux, the host system would be -Windows, and the target system would be MIPS ELF. - - The name Canadian Cross comes from the case when the build, host, and -target systems are all different. At the time that these issues were -all being hashed out, Canada had three national political parties. - - -File: configure.info, Node: Build Cross Host Tools, Next: Build and Host Options, Prev: Canadian Cross Concepts, Up: Canadian Cross - -6.3 Build Cross Host Tools -========================== - -In order to configure a program for a Canadian Cross build, you must -first build and install the set of cross tools you will use to build the -program. - - These tools will be build cross host tools. That is, they will run -on the build system, and will produce code that runs on the host system. - - It is easy to confuse the meaning of build and host here. Always -remember that the build system is where you are doing the build, and the -host system is where the resulting program will run. Therefore, you -need a build cross host compiler. - - In general, you must have a complete cross environment in order to do -the build. This normally means a cross compiler, cross assembler, and -so forth, as well as libraries and include files for the host system. - - -File: configure.info, Node: Build and Host Options, Next: CCross not in Cygnus Tree, Prev: Build Cross Host Tools, Up: Canadian Cross - -6.4 Build and Host Options -========================== - -When you run `configure', you must use both the `--build' and `--host' -options. - - The `--build' option is used to specify the configuration name of -the build system. This can normally be the result of running the -`config.guess' shell script, and it is reasonable to use -`--build=`config.guess`'. - - The `--host' option is used to specify the configuration name of the -host system. - - As we explained earlier, `config.guess' is used to set the default -value for the `--host' option (*note Using the Host Type::). We can -now see that since `config.guess' returns the type of system on which -it is run, it really identifies the build system. Since the host -system is normally the same as the build system (i.e., people do not -normally build using a cross compiler), it is reasonable to use the -result of `config.guess' as the default for the host system when the -`--host' option is not used. - - It might seem that if the `--host' option were used without the -`--build' option that the configure script could run `config.guess' to -determine the build system, and presume a Canadian Cross if the result -of `config.guess' differed from the `--host' option. However, for -historical reasons, some configure scripts are routinely run using an -explicit `--host' option, rather than using the default from -`config.guess'. As noted earlier, it is difficult or impossible to -reliably compare configuration names (*note Using the Target Type::). -Therefore, by convention, if the `--host' option is used, but the -`--build' option is not used, then the build system defaults to the -host system. - - -File: configure.info, Node: CCross not in Cygnus Tree, Next: CCross in Cygnus Tree, Prev: Build and Host Options, Up: Canadian Cross - -6.5 Canadian Cross not in Cygnus Tree. -====================================== - -If you are not using the Cygnus tree, you must explicitly specify the -cross tools which you want to use to build the program. This is done by -setting environment variables before running the `configure' script. - - You must normally set at least the environment variables `CC', `AR', -and `RANLIB' to the cross tools which you want to use to build. - - For some programs, you must set additional cross tools as well, such -as `AS', `LD', or `NM'. - - You would set these environment variables to the build cross tools -which you are going to use. - - For example, if you are building a Solaris program on a GNU/Linux -system, and your GNU/Linux cross Solaris compiler were named -`solaris-gcc', then you would set the environment variable `CC' to -`solaris-gcc'. - - -File: configure.info, Node: CCross in Cygnus Tree, Next: Supporting Canadian Cross, Prev: CCross not in Cygnus Tree, Up: Canadian Cross - -6.6 Canadian Cross in Cygnus Tree -================================= - -This section describes configuring and building a Canadian Cross when -using the Cygnus tree. - -* Menu: - -* Standard Cygnus CCross:: Building a Normal Program. -* Cross Cygnus CCross:: Building a Cross Program. - - -File: configure.info, Node: Standard Cygnus CCross, Next: Cross Cygnus CCross, Up: CCross in Cygnus Tree - -6.6.1 Building a Normal Program -------------------------------- - -When configuring a Canadian Cross in the Cygnus tree, all the -appropriate environment variables are automatically set to `HOST-TOOL', -where HOST is the value used for the `--host' option, and TOOL is the -name of the tool (e.g., `gcc', `as', etc.). These tools must be on -your `PATH'. - - Adding a prefix of HOST will give the usual name for the build cross -host tools. To see this, consider that when these cross tools were -built, they were configured to run on the build system and to produce -code for the host system. That is, they were configured with a -`--target' option that is the same as the system which we are now -calling the host. Recall that the default name for installed cross -tools uses the target system as a prefix (*note Using the Target -Type::). Since that is the system which we are now calling the host, -HOST is the right prefix to use. - - For example, if you configure with `--build=i386-linux-gnu' and -`--host=solaris', then the Cygnus tree will automatically default to -using the compiler `solaris-gcc'. You must have previously built and -installed this compiler, probably by doing a build with no `--host' -option and with a `--target' option of `solaris'. - - -File: configure.info, Node: Cross Cygnus CCross, Prev: Standard Cygnus CCross, Up: CCross in Cygnus Tree - -6.6.2 Building a Cross Program ------------------------------- - -There are additional considerations if you want to build a cross -compiler, rather than a native compiler, in the Cygnus tree using a -Canadian Cross. - - When you build a cross compiler using the Cygnus tree, then the -target libraries will normally be built with the newly built target -compiler (*note Host and Target Libraries::). However, this will not -work when building with a Canadian Cross. This is because the newly -built target compiler will be a program which runs on the host system, -and therefore will not be able to run on the build system. - - Therefore, when building a cross compiler with the Cygnus tree, you -must first install a set of build cross target tools. These tools will -be used when building the target libraries. - - Note that this is not a requirement of a Canadian Cross in general. -For example, it would be possible to build just the host cross target -tools on the build system, to copy the tools to the host system, and to -build the target libraries on the host system. The requirement for -build cross target tools is imposed by the Cygnus tree, which expects -to be able to build both host programs and target libraries in a single -`configure'/`make' step. Because it builds these in a single step, it -expects to be able to build the target libraries on the build system, -which means that it must use a build cross target toolchain. - - For example, suppose you want to build a Windows cross MIPS ELF -compiler on a GNU/Linux system. You must have previously installed -both a GNU/Linux cross Windows compiler and a GNU/Linux cross MIPS ELF -compiler. - - In order to build the Windows (configuration name `i386-cygwin32') -cross MIPS ELF (configure name `mips-elf') compiler, you might execute -the following commands (long command lines are broken across lines with -a trailing backslash as a continuation character). - - mkdir linux-x-cygwin32 - cd linux-x-cygwin32 - SRCDIR/configure --target i386-cygwin32 --prefix=INSTALLDIR \ - --exec-prefix=INSTALLDIR/H-i386-linux - make - make install - cd .. - mkdir linux-x-mips-elf - cd linux-x-mips-elf - SRCDIR/configure --target mips-elf --prefix=INSTALLDIR \ - --exec-prefix=INSTALLDIR/H-i386-linux - make - make install - cd .. - mkdir cygwin32-x-mips-elf - cd cygwin32-x-mips-elf - SRCDIR/configure --build=i386-linux-gnu --host=i386-cygwin32 \ - --target=mips-elf --prefix=WININSTALLDIR \ - --exec-prefix=WININSTALLDIR/H-i386-cygwin32 - make - make install - - You would then copy the contents of WININSTALLDIR over to the -Windows machine, and run the resulting programs. - - -File: configure.info, Node: Supporting Canadian Cross, Prev: CCross in Cygnus Tree, Up: Canadian Cross - -6.7 Supporting Canadian Cross -============================= - -If you want to make it possible to build a program you are developing -using a Canadian Cross, you must take some care when writing your -configure and make rules. Simple cases will normally work correctly. -However, it is not hard to write configure and make tests which will -fail in a Canadian Cross. - -* Menu: - -* CCross in Configure:: Supporting Canadian Cross in Configure Scripts. -* CCross in Make:: Supporting Canadian Cross in Makefiles. - - -File: configure.info, Node: CCross in Configure, Next: CCross in Make, Up: Supporting Canadian Cross - -6.7.1 Supporting Canadian Cross in Configure Scripts ----------------------------------------------------- - -In a `configure.in' file, after calling `AC_PROG_CC', you can find out -whether this is a Canadian Cross configure by examining the shell -variable `cross_compiling'. In a Canadian Cross, which means that the -compiler is a cross compiler, `cross_compiling' will be `yes'. In a -normal configuration, `cross_compiling' will be `no'. - - You ordinarily do not need to know the type of the build system in a -configure script. However, if you do need that information, you can get -it by using the macro `AC_CANONICAL_SYSTEM', the same macro that is -used to determine the target system. This macro will set the variables -`build', `build_alias', `build_cpu', `build_vendor', and `build_os', -which correspond to the similar `target' and `host' variables, except -that they describe the build system. - - When writing tests in `configure.in', you must remember that you -want to test the host environment, not the build environment. - - Macros like `AC_CHECK_FUNCS' which use the compiler will test the -host environment. That is because the tests will be done by running the -compiler, which is actually a build cross host compiler. If the -compiler can find the function, that means that the function is present -in the host environment. - - Tests like `test -f /dev/ptyp0', on the other hand, will test the -build environment. Remember that the configure script is running on the -build system, not the host system. If your configure scripts examines -files, those files will be on the build system. Whatever you determine -based on those files may or may not be the case on the host system. - - Most autoconf macros will work correctly for a Canadian Cross. The -main exception is `AC_TRY_RUN'. This macro tries to compile and run a -test program. This will fail in a Canadian Cross, because the program -will be compiled for the host system, which means that it will not run -on the build system. - - The `AC_TRY_RUN' macro provides an optional argument to tell the -configure script what to do in a Canadian Cross. If that argument is -not present, you will get a warning when you run `autoconf': - warning: AC_TRY_RUN called without default to allow cross compiling - This tells you that the resulting `configure' script will not work -with a Canadian Cross. - - In some cases while it may better to perform a test at configure -time, it is also possible to perform the test at run time. In such a -case you can use the cross compiling argument to `AC_TRY_RUN' to tell -your program that the test could not be performed at configure time. - - There are a few other autoconf macros which will not work correctly -with a Canadian Cross: a partial list is `AC_FUNC_GETPGRP', -`AC_FUNC_SETPGRP', `AC_FUNC_SETVBUF_REVERSED', and -`AC_SYS_RESTARTABLE_SYSCALLS'. The `AC_CHECK_SIZEOF' macro is -generally not very useful with a Canadian Cross; it permits an optional -argument indicating the default size, but there is no way to know what -the correct default should be. - - -File: configure.info, Node: CCross in Make, Prev: CCross in Configure, Up: Supporting Canadian Cross - -6.7.2 Supporting Canadian Cross in Makefiles. ---------------------------------------------- - -The main Canadian Cross issue in a `Makefile' arises when you want to -use a subsidiary program to generate code or data which you will then -include in your real program. - - If you compile this subsidiary program using `$(CC)' in the usual -way, you will not be able to run it. This is because `$(CC)' will -build a program for the host system, but the program is being built on -the build system. - - You must instead use a compiler for the build system, rather than the -host system. In the Cygnus tree, this make variable `$(CC_FOR_BUILD)' -will hold a compiler for the build system. - - Note that you should not include `config.h' in a file you are -compiling with `$(CC_FOR_BUILD)'. The `configure' script will build -`config.h' with information for the host system. However, you are -compiling the file using a compiler for the build system (a native -compiler). Subsidiary programs are normally simple filters which do no -user interaction, and it is normally possible to write them in a highly -portable fashion so that the absence of `config.h' is not crucial. - - The gcc `Makefile.in' shows a complex situation in which certain -files, such as `rtl.c', must be compiled into both subsidiary programs -run on the build system and into the final program. This approach may -be of interest for advanced build system hackers. Note that the build -system compiler is rather confusingly called `HOST_CC'. - - -File: configure.info, Node: Cygnus Configure, Next: Multilibs, Prev: Canadian Cross, Up: Top - -7 Cygnus Configure -****************** - -The Cygnus configure script predates autoconf. All of its interesting -features have been incorporated into autoconf. No new programs should -be written to use the Cygnus configure script. - - However, the Cygnus configure script is still used in a few places: -at the top of the Cygnus tree and in a few target libraries in the -Cygnus tree. Until those uses have been replaced with autoconf, some -brief notes are appropriate here. This is not complete documentation, -but it should be possible to use this as a guide while examining the -scripts themselves. - -* Menu: - -* Cygnus Configure Basics:: Cygnus Configure Basics. -* Cygnus Configure in C++ Libraries:: Cygnus Configure in C++ Libraries. - - -File: configure.info, Node: Cygnus Configure Basics, Next: Cygnus Configure in C++ Libraries, Up: Cygnus Configure - -7.1 Cygnus Configure Basics -=========================== - -Cygnus configure does not use any generated files; there is no program -corresponding to `autoconf'. Instead, there is a single shell script -named `configure' which may be found at the top of the Cygnus tree. -This shell script was written by hand; it was not generated by -autoconf, and it is incorrect, and indeed harmful, to run `autoconf' in -the top level of a Cygnus tree. - - Cygnus configure works in a particular directory by examining the -file `configure.in' in that directory. That file is broken into four -separate shell scripts. - - The first is the contents of `configure.in' up to a line that starts -with `# per-host:'. This is the common part. - - The second is the rest of `configure.in' up to a line that starts -with `# per-target:'. This is the per host part. - - The third is the rest of `configure.in' up to a line that starts -with `# post-target:'. This is the per target part. - - The fourth is the remainder of `configure.in'. This is the post -target part. - - If any of these comment lines are missing, the corresponding shell -script is empty. - - Cygnus configure will first execute the common part. This must set -the shell variable `srctrigger' to the name of a source file, to -confirm that Cygnus configure is looking at the right directory. This -may set the shell variables `package_makefile_frag' and -`package_makefile_rules_frag'. - - Cygnus configure will next set the `build' and `host' shell -variables, and execute the per host part. This may set the shell -variable `host_makefile_frag'. - - Cygnus configure will next set the `target' variable, and execute -the per target part. This may set the shell variable -`target_makefile_frag'. - - Any of these scripts may set the `subdirs' shell variable. This -variable is a list of subdirectories where a `Makefile.in' file may be -found. Cygnus configure will automatically look for a `Makefile.in' -file in the current directory. The `subdirs' shell variable is not -normally used, and I believe that the only directory which uses it at -present is `newlib'. - - For each `Makefile.in', Cygnus configure will automatically create a -`Makefile' by adding definitions for `make' variables such as `host' -and `target', and automatically editing the values of `make' variables -such as `prefix' if they are present. - - Also, if any of the `makefile_frag' shell variables are set, Cygnus -configure will interpret them as file names relative to either the -working directory or the source directory, and will read the contents of -the file into the generated `Makefile'. The file contents will be read -in after the first line in `Makefile.in' which starts with `####'. - - These `Makefile' fragments are used to customize behaviour for a -particular host or target. They serve to select particular files to -compile, and to define particular preprocessor macros by providing -values for `make' variables which are then used during compilation. -Cygnus configure, unlike autoconf, normally does not do feature tests, -and normally requires support to be added manually for each new host. - - The `Makefile' fragment support is similar to the autoconf -`AC_SUBST_FILE' macro. - - After creating each `Makefile', the post target script will be run -(i.e., it may be run several times). This script may further customize -the `Makefile'. When it is run, the shell variable `Makefile' will -hold the name of the `Makefile', including the appropriate directory -component. - - Like an autoconf generated `configure' script, Cygnus configure will -create a file named `config.status' which, when run, will automatically -recreate the configuration. The `config.status' file will simply -execute the Cygnus configure script again with the appropriate -arguments. - - Any of the parts of `configure.in' may set the shell variables -`files' and `links'. Cygnus configure will set up symlinks from the -names in `links' to the files named in `files'. This is similar to the -autoconf `AC_LINK_FILES' macro. - - Finally, any of the parts of `configure.in' may set the shell -variable `configdirs' to a set of subdirectories. If it is set, Cygnus -configure will recursively run the configure process in each -subdirectory. If the subdirectory uses Cygnus configure, it will -contain a `configure.in' file but no `configure' file, in which case -Cygnus configure will invoke itself recursively. If the subdirectory -has a `configure' file, Cygnus configure assumes that it is an autoconf -generated `configure' script, and simply invokes it directly. - - -File: configure.info, Node: Cygnus Configure in C++ Libraries, Prev: Cygnus Configure Basics, Up: Cygnus Configure - -7.2 Cygnus Configure in C++ Libraries -===================================== - -The C++ library configure system, written by Per Bothner, deserves -special mention. It uses Cygnus configure, but it does feature testing -like that done by autoconf generated `configure' scripts. This -approach is used in the libraries `libio', `libstdc++', and `libg++'. - - Most of the `Makefile' information is written out by the shell -script `libio/config.shared'. Each `configure.in' file sets certain -shell variables, and then invokes `config.shared' to create two package -`Makefile' fragments. These fragments are then incorporated into the -resulting `Makefile' by the Cygnus configure script. - - The file `_G_config.h' is created in the `libio' object directory by -running the shell script `libio/gen-params'. This shell script uses -feature tests to define macros and typedefs in `_G_config.h'. - - -File: configure.info, Node: Multilibs, Next: FAQ, Prev: Cygnus Configure, Up: Top - -8 Multilibs -*********** - -For some targets gcc may have different processor requirements depending -upon command line options. An obvious example is the `-msoft-float' -option supported on several processors. This option means that the -floating point registers are not available, which means that floating -point operations must be done by calling an emulation subroutine rather -than by using machine instructions. - - For such options, gcc is often configured to compile target libraries -twice: once with `-msoft-float' and once without. When gcc compiles -target libraries more than once, the resulting libraries are called -"multilibs". - - Multilibs are not really part of the GNU configure and build system, -but we discuss them here since they require support in the `configure' -scripts and `Makefile's used for target libraries. - -* Menu: - -* Multilibs in gcc:: Multilibs in gcc. -* Multilibs in Target Libraries:: Multilibs in Target Libraries. - - -File: configure.info, Node: Multilibs in gcc, Next: Multilibs in Target Libraries, Up: Multilibs - -8.1 Multilibs in gcc -==================== - -In gcc, multilibs are defined by setting the variable -`MULTILIB_OPTIONS' in the target `Makefile' fragment. Several other -`MULTILIB' variables may also be defined there. *Note The Target -Makefile Fragment: (gcc)Target Fragment. - - If you have built gcc, you can see what multilibs it uses by running -it with the `-print-multi-lib' option. The output `.;' means that no -multilibs are used. In general, the output is a sequence of lines, one -per multilib. The first part of each line, up to the `;', is the name -of the multilib directory. The second part is a list of compiler -options separated by `@' characters. - - Multilibs are built in a tree of directories. The top of the tree, -represented by `.' in the list of multilib directories, is the default -library to use when no special compiler options are used. The -subdirectories of the tree hold versions of the library to use when -particular compiler options are used. - - -File: configure.info, Node: Multilibs in Target Libraries, Prev: Multilibs in gcc, Up: Multilibs - -8.2 Multilibs in Target Libraries -================================= - -The target libraries in the Cygnus tree are automatically built with -multilibs. That means that each library is built multiple times. - - This default is set in the top level `configure.in' file, by adding -`--enable-multilib' to the list of arguments passed to configure when -it is run for the target libraries (*note Host and Target Libraries::). - - Each target library uses the shell script `config-ml.in', written by -Doug Evans, to prepare to build target libraries. This shell script is -invoked after the `Makefile' has been created by the `configure' -script. If multilibs are not enabled, it does nothing, otherwise it -modifies the `Makefile' to support multilibs. - - The `config-ml.in' script makes one copy of the `Makefile' for each -multilib in the appropriate subdirectory. When configuring in the -source directory (which is not recommended), it will build a symlink -tree of the sources in each subdirectory. - - The `config-ml.in' script sets several variables in the various -`Makefile's. The `Makefile.in' must have definitions for these -variables already; `config-ml.in' simply changes the existing values. -The `Makefile' should use default values for these variables which will -do the right thing in the subdirectories. - -`MULTISRCTOP' - `config-ml.in' will set this to a sequence of `../' strings, where - the number of strings is the number of multilib levels in the - source tree. The default value should be the empty string. - -`MULTIBUILDTOP' - `config-ml.in' will set this to a sequence of `../' strings, where - the number of strings is number of multilib levels in the object - directory. The default value should be the empty string. This - will differ from `MULTISRCTOP' when configuring in the source tree - (which is not recommended). - -`MULTIDIRS' - In the top level `Makefile' only, `config-ml.in' will set this to - the list of multilib subdirectories. The default value should be - the empty string. - -`MULTISUBDIR' - `config-ml.in' will set this to the installed subdirectory name to - use for this subdirectory, with a leading `/'. The default value - shold be the empty string. - -`MULTIDO' -`MULTICLEAN' - In the top level `Makefile' only, `config-ml.in' will set these - variables to commands to use when doing a recursive make. These - variables should both default to the string `true', so that by - default nothing happens. - - All references to the parent of the source directory should use the -variable `MULTISRCTOP'. Instead of writing `$(srcdir)/..', you must -write `$(srcdir)/$(MULTISRCTOP)..'. - - Similarly, references to the parent of the object directory should -use the variable `MULTIBUILDTOP'. - - In the installation target, the libraries should be installed in the -subdirectory `MULTISUBDIR'. Instead of installing -`$(libdir)/libfoo.a', install `$(libdir)$(MULTISUBDIR)/libfoo.a'. - - The `config-ml.in' script also modifies the top level `Makefile' to -add `multi-do' and `multi-clean' targets which are used when building -multilibs. - - The default target of the `Makefile' should include the following -command: - @$(MULTIDO) $(FLAGS_TO_PASS) DO=all multi-do - This assumes that `$(FLAGS_TO_PASS)' is defined as a set of -variables to pass to a recursive invocation of `make'. This will build -all the multilibs. Note that the default value of `MULTIDO' is `true', -so by default this command will do nothing. It will only do something -in the top level `Makefile' if multilibs were enabled. - - The `install' target of the `Makefile' should include the following -command: - @$(MULTIDO) $(FLAGS_TO_PASS) DO=install multi-do - - In general, any operation, other than clean, which should be -performed on all the multilibs should use a `$(MULTIDO)' line, setting -the variable `DO' to the target of each recursive call to `make'. - - The `clean' targets (`clean', `mostlyclean', etc.) should use -`$(MULTICLEAN)'. For example, the `clean' target should do this: - @$(MULTICLEAN) DO=clean multi-clean - - -File: configure.info, Node: FAQ, Next: Index, Prev: Multilibs, Up: Top - -9 Frequently Asked Questions -**************************** - -Which do I run first, `autoconf' or `automake'? - Except when you first add autoconf or automake support to a - package, you shouldn't run either by hand. Instead, configure - with the `--enable-maintainer-mode' option, and let `make' take - care of it. - -`autoconf' says something about undefined macros. - This means that you have macros in your `configure.in' which are - not defined by `autoconf'. You may be using an old version of - `autoconf'; try building and installing a newer one. Make sure the - newly installled `autoconf' is first on your `PATH'. Also, see - the next question. - -My `configure' script has stuff like `CY_GNU_GETTEXT' in it. - This means that you have macros in your `configure.in' which should - be defined in your `aclocal.m4' file, but aren't. This usually - means that `aclocal' was not able to appropriate definitions of the - macros. Make sure that you have installed all the packages you - need. In particular, make sure that you have installed libtool - (this is where `AM_PROG_LIBTOOL' is defined) and gettext (this is - where `CY_GNU_GETTEXT' is defined, at least in the Cygnus version - of gettext). - -My `Makefile' has `@' characters in it. - This may mean that you tried to use an autoconf substitution in - your `Makefile.in' without adding the appropriate `AC_SUBST' call - to your `configure' script. Or it may just mean that you need to - rebuild `Makefile' in your build directory. To rebuild `Makefile' - from `Makefile.in', run the shell script `config.status' with no - arguments. If you need to force `configure' to run again, first - run `config.status --recheck'. These runs are normally done - automatically by `Makefile' targets, but if your `Makefile' has - gotten messed up you'll need to help them along. - -Why do I have to run both `config.status --recheck' and `config.status'? - Normally, you don't; they will be run automatically by `Makefile' - targets. If you do need to run them, use `config.status --recheck' - to run the `configure' script again with the same arguments as the - first time you ran it. Use `config.status' (with no arguments) to - regenerate all files (`Makefile', `config.h', etc.) based on the - results of the configure script. The two cases are separate - because it isn't always necessary to regenerate all the files - after running `config.status --recheck'. The `Makefile' targets - generated by automake will use the environment variables - `CONFIG_FILES' and `CONFIG_HEADERS' to only regenerate files as - they are needed. - -What is the Cygnus tree? - The Cygnus tree is used for various packages including gdb, the GNU - binutils, and egcs. It is also, of course, used for Cygnus - releases. It is the build system which was developed at Cygnus, - using the Cygnus configure script. It permits building many - different packages with a single configure and make. The - configure scripts in the tree are being converted to autoconf, but - the general build structure remains intact. - -Why do I have to keep rebuilding and reinstalling the tools? - I know, it's a pain. Unfortunately, there are bugs in the tools - themselves which need to be fixed, and each time that happens - everybody who uses the tools need to reinstall new versions of - them. I don't know if there is going to be a clever fix until the - tools stabilize. - -Why not just have a Cygnus tree `make' target to update the tools? - The tools unfortunately need to be installed before they can be - used. That means that they must be built using an appropriate - prefix, and it seems unwise to assume that every configuration - uses an appropriate prefix. It might be possible to make them - work in place, or it might be possible to install them in some - subdirectory; so far these approaches have not been implemented. - - -File: configure.info, Node: Index, Prev: FAQ, Up: Top - -Index -***** - -[index] -* Menu: - -* --build option: Build and Host Options. - (line 9) -* --host option: Build and Host Options. - (line 14) -* --target option: Specifying the Target. - (line 10) -* _GNU_SOURCE: Write configure.in. (line 134) -* AC_CANONICAL_HOST: Using the Host Type. (line 10) -* AC_CANONICAL_SYSTEM: Using the Target Type. - (line 6) -* AC_CONFIG_HEADER: Write configure.in. (line 66) -* AC_EXEEXT: Write configure.in. (line 86) -* AC_INIT: Write configure.in. (line 38) -* AC_OUTPUT: Write configure.in. (line 142) -* AC_PREREQ: Write configure.in. (line 42) -* AC_PROG_CC: Write configure.in. (line 103) -* AC_PROG_CXX: Write configure.in. (line 117) -* acconfig.h: Written Developer Files. - (line 27) -* acconfig.h, writing: Write acconfig.h. (line 6) -* acinclude.m4: Written Developer Files. - (line 37) -* aclocal.m4: Generated Developer Files. - (line 33) -* AM_CONFIG_HEADER: Write configure.in. (line 53) -* AM_DISABLE_SHARED: Write configure.in. (line 127) -* AM_EXEEXT: Write configure.in. (line 86) -* AM_INIT_AUTOMAKE: Write configure.in. (line 48) -* AM_MAINTAINER_MODE: Write configure.in. (line 70) -* AM_PROG_LIBTOOL: Write configure.in. (line 122) -* AM_PROG_LIBTOOL in configure: FAQ. (line 19) -* build option: Build and Host Options. - (line 9) -* building with a cross compiler: Canadian Cross. (line 6) -* canadian cross: Canadian Cross. (line 6) -* canadian cross in configure: CCross in Configure. (line 6) -* canadian cross in cygnus tree: CCross in Cygnus Tree. - (line 6) -* canadian cross in makefile: CCross in Make. (line 6) -* canadian cross, configuring: Build and Host Options. - (line 6) -* canonical system names: Configuration Names. (line 6) -* config.cache: Build Files Description. - (line 28) -* config.h: Build Files Description. - (line 23) -* config.h.in: Generated Developer Files. - (line 45) -* config.in: Generated Developer Files. - (line 45) -* config.status: Build Files Description. - (line 9) -* config.status --recheck: FAQ. (line 40) -* configuration names: Configuration Names. (line 6) -* configuration triplets: Configuration Names. (line 6) -* configure: Generated Developer Files. - (line 21) -* configure build system: Build and Host Options. - (line 9) -* configure host: Build and Host Options. - (line 14) -* configure target: Specifying the Target. - (line 10) -* configure.in: Written Developer Files. - (line 9) -* configure.in, writing: Write configure.in. (line 6) -* configuring a canadian cross: Build and Host Options. - (line 6) -* cross compiler: Cross Compilation Concepts. - (line 6) -* cross compiler, building with: Canadian Cross. (line 6) -* cross tools: Cross Compilation Tools. - (line 6) -* CY_GNU_GETTEXT in configure: FAQ. (line 19) -* cygnus configure: Cygnus Configure. (line 6) -* goals: Goals. (line 6) -* history: History. (line 6) -* host names: Configuration Names. (line 6) -* host option: Build and Host Options. - (line 14) -* host system: Host and Target. (line 6) -* host triplets: Configuration Names. (line 6) -* HOST_CC: CCross in Make. (line 27) -* libg++ configure: Cygnus Configure in C++ Libraries. - (line 6) -* libio configure: Cygnus Configure in C++ Libraries. - (line 6) -* libstdc++ configure: Cygnus Configure in C++ Libraries. - (line 6) -* Makefile: Build Files Description. - (line 18) -* Makefile, garbage characters: FAQ. (line 29) -* Makefile.am: Written Developer Files. - (line 18) -* Makefile.am, writing: Write Makefile.am. (line 6) -* Makefile.in: Generated Developer Files. - (line 26) -* multilibs: Multilibs. (line 6) -* stamp-h: Build Files Description. - (line 41) -* stamp-h.in: Generated Developer Files. - (line 54) -* system names: Configuration Names. (line 6) -* system types: Configuration Names. (line 6) -* target option: Specifying the Target. - (line 10) -* target system: Host and Target. (line 6) -* triplets: Configuration Names. (line 6) -* undefined macros: FAQ. (line 12) - - - -Tag Table: -Node: Top978 -Node: Introduction1506 -Node: Goals2588 -Node: Tools3312 -Node: History4306 -Node: Building7304 -Node: Getting Started10567 -Node: Write configure.in11080 -Node: Write Makefile.am18331 -Node: Write acconfig.h21508 -Node: Generate files23045 -Node: Getting Started Example25011 -Node: Getting Started Example 125766 -Node: Getting Started Example 227687 -Node: Getting Started Example 330682 -Node: Generate Files in Example33046 -Node: Files34136 -Node: Developer Files34747 -Node: Developer Files Picture35127 -Node: Written Developer Files36415 -Node: Generated Developer Files38967 -Node: Build Files42111 -Node: Build Files Picture42772 -Node: Build Files Description43536 -Node: Support Files45542 -Node: Configuration Names48424 -Node: Configuration Name Definition48924 -Node: Using Configuration Names51247 -Node: Cross Compilation Tools53217 -Node: Cross Compilation Concepts53908 -Node: Host and Target54876 -Node: Using the Host Type56377 -Node: Specifying the Target57726 -Node: Using the Target Type58515 -Node: Cross Tools in the Cygnus Tree61946 -Node: Host and Target Libraries63003 -Node: Target Library Configure Scripts66752 -Node: Make Targets in Cygnus Tree69844 -Node: Target libiberty71192 -Node: Canadian Cross72579 -Node: Canadian Cross Example73420 -Node: Canadian Cross Concepts74539 -Node: Build Cross Host Tools76051 -Node: Build and Host Options77003 -Node: CCross not in Cygnus Tree78789 -Node: CCross in Cygnus Tree79767 -Node: Standard Cygnus CCross80188 -Node: Cross Cygnus CCross81552 -Node: Supporting Canadian Cross84352 -Node: CCross in Configure84967 -Node: CCross in Make88135 -Node: Cygnus Configure89738 -Node: Cygnus Configure Basics90573 -Node: Cygnus Configure in C++ Libraries95251 -Node: Multilibs96258 -Node: Multilibs in gcc97303 -Node: Multilibs in Target Libraries98381 -Node: FAQ102572 -Node: Index106672 - -End Tag Table diff --git a/etc/standards.info b/etc/standards.info deleted file mode 100644 index 4fc9776e594..00000000000 --- a/etc/standards.info +++ /dev/null @@ -1,4930 +0,0 @@ -This is standards.info, produced by makeinfo version 4.8 from -.././etc/standards.texi. - -START-INFO-DIR-ENTRY -* Standards: (standards). GNU coding standards. -END-INFO-DIR-ENTRY - - GNU Coding Standards Copyright (C) 1992, 1993, 1994, 1995, 1996, -1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. - - Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.1 or -any later version published by the Free Software Foundation; with no -Invariant Sections, with no Front-Cover Texts, and with no Back-Cover -Texts. A copy of the license is included in the section entitled "GNU -Free Documentation License". - - -File: standards.info, Node: Top, Next: Preface, Prev: (dir), Up: (dir) - -Version -******* - -Last updated February 14, 2002. - -* Menu: - -* Preface:: About the GNU Coding Standards -* Legal Issues:: Keeping Free Software Free -* Design Advice:: General Program Design -* Program Behavior:: Program Behavior for All Programs -* Writing C:: Making The Best Use of C -* Documentation:: Documenting Programs -* Managing Releases:: The Release Process -* References:: References to Non-Free Software or Documentation -* Copying This Manual:: How to Make Copies of This Manual -* Index:: - - -File: standards.info, Node: Preface, Next: Legal Issues, Prev: Top, Up: Top - -1 About the GNU Coding Standards -******************************** - -The GNU Coding Standards were written by Richard Stallman and other GNU -Project volunteers. Their purpose is to make the GNU system clean, -consistent, and easy to install. This document can also be read as a -guide to writing portable, robust and reliable programs. It focuses on -programs written in C, but many of the rules and principles are useful -even if you write in another programming language. The rules often -state reasons for writing in a certain way. - - This release of the GNU Coding Standards was last updated February -14, 2002. - - If you did not obtain this file directly from the GNU project and -recently, please check for a newer version. You can ftp the GNU Coding -Standards from any GNU FTP host in the directory `/pub/gnu/standards/'. -The GNU Coding Standards are available there in several different -formats: `standards.text', `standards.info', and `standards.dvi', as -well as the Texinfo "source" which is divided in two files: -`standards.texi' and `make-stds.texi'. The GNU Coding Standards are -also available on the GNU World Wide Web server: -`http://www.gnu.org/prep/standards_toc.html'. - - Corrections or suggestions for this document should be sent to -. If you make a suggestion, please include a -suggested new wording for it; our time is limited. We prefer a context -diff to the `standards.texi' or `make-stds.texi' files, but if you -don't have those files, please mail your suggestion anyway. - - These standards cover the minimum of what is important when writing a -GNU package. Likely, the needs for additional standards will come up. -Sometimes, you might suggest that such standards be added to this -document. If you think your standards would be generally useful, please -do suggest them. - - You should also set standards for your package on many questions not -addressed or not firmly specified here. The most important point is to -be self-consistent--try to stick to the conventions you pick, and try -to document them as much as possible. That way, your program will be -more maintainable by others. - - -File: standards.info, Node: Legal Issues, Next: Design Advice, Prev: Preface, Up: Top - -2 Keeping Free Software Free -**************************** - -This node discusses how you can make sure that GNU software avoids -legal difficulties, and other related issues. - -* Menu: - -* Reading Non-Free Code:: Referring to Proprietary Programs -* Contributions:: Accepting Contributions -* Trademarks:: How We Deal with Trademark Issues - - -File: standards.info, Node: Reading Non-Free Code, Next: Contributions, Up: Legal Issues - -2.1 Referring to Proprietary Programs -===================================== - -Don't in any circumstances refer to Unix source code for or during your -work on GNU! (Or to any other proprietary programs.) - - If you have a vague recollection of the internals of a Unix program, -this does not absolutely mean you can't write an imitation of it, but -do try to organize the imitation internally along different lines, -because this is likely to make the details of the Unix version -irrelevant and dissimilar to your results. - - For example, Unix utilities were generally optimized to minimize -memory use; if you go for speed instead, your program will be very -different. You could keep the entire input file in core and scan it -there instead of using stdio. Use a smarter algorithm discovered more -recently than the Unix program. Eliminate use of temporary files. Do -it in one pass instead of two (we did this in the assembler). - - Or, on the contrary, emphasize simplicity instead of speed. For some -applications, the speed of today's computers makes simpler algorithms -adequate. - - Or go for generality. For example, Unix programs often have static -tables or fixed-size strings, which make for arbitrary limits; use -dynamic allocation instead. Make sure your program handles NULs and -other funny characters in the input files. Add a programming language -for extensibility and write part of the program in that language. - - Or turn some parts of the program into independently usable -libraries. Or use a simple garbage collector instead of tracking -precisely when to free memory, or use a new GNU facility such as -obstacks. - - -File: standards.info, Node: Contributions, Next: Trademarks, Prev: Reading Non-Free Code, Up: Legal Issues - -2.2 Accepting Contributions -=========================== - -If the program you are working on is copyrighted by the Free Software -Foundation, then when someone else sends you a piece of code to add to -the program, we need legal papers to use it--just as we asked you to -sign papers initially. _Each_ person who makes a nontrivial -contribution to a program must sign some sort of legal papers in order -for us to have clear title to the program; the main author alone is not -enough. - - So, before adding in any contributions from other people, please tell -us, so we can arrange to get the papers. Then wait until we tell you -that we have received the signed papers, before you actually use the -contribution. - - This applies both before you release the program and afterward. If -you receive diffs to fix a bug, and they make significant changes, we -need legal papers for that change. - - This also applies to comments and documentation files. For copyright -law, comments and code are just text. Copyright applies to all kinds of -text, so we need legal papers for all kinds. - - We know it is frustrating to ask for legal papers; it's frustrating -for us as well. But if you don't wait, you are going out on a limb--for -example, what if the contributor's employer won't sign a disclaimer? -You might have to take that code out again! - - You don't need papers for changes of a few lines here or there, since -they are not significant for copyright purposes. Also, you don't need -papers if all you get from the suggestion is some ideas, not actual code -which you use. For example, if someone send you one implementation, but -you write a different implementation of the same idea, you don't need to -get papers. - - The very worst thing is if you forget to tell us about the other -contributor. We could be very embarrassed in court some day as a -result. - - We have more detailed advice for maintainers of programs; if you have -reached the stage of actually maintaining a program for GNU (whether -released or not), please ask us for a copy. - - -File: standards.info, Node: Trademarks, Prev: Contributions, Up: Legal Issues - -2.3 Trademarks -============== - -Please do not include any trademark acknowledgements in GNU software -packages or documentation. - - Trademark acknowledgements are the statements that such-and-such is a -trademark of so-and-so. The GNU Project has no objection to the basic -idea of trademarks, but these acknowledgements feel like kowtowing, so -we don't use them. There is no legal requirement for them. - - What is legally required, as regards other people's trademarks, is to -avoid using them in ways which a reader might read as naming or labeling -our own programs or activities. For example, since "Objective C" is -(or at least was) a trademark, we made sure to say that we provide a -"compiler for the Objective C language" rather than an "Objective C -compiler". The latter is meant to be short for the former, but it does -not explicitly state the relationship, so it could be misinterpreted as -using "Objective C" as a label for the compiler rather than for the -language. - - -File: standards.info, Node: Design Advice, Next: Program Behavior, Prev: Legal Issues, Up: Top - -3 General Program Design -************************ - -This node discusses some of the issues you should take into account -when designing your program. - -* Menu: - -* Source Language:: Which languges to use. -* Compatibility:: Compatibility with other implementations -* Using Extensions:: Using non-standard features -* Standard C:: Using Standard C features -* Conditional Compilation:: Compiling Code Only If A Conditional is True - - -File: standards.info, Node: Source Language, Next: Compatibility, Up: Design Advice - -3.1 Which Languages to Use -========================== - -When you want to use a language that gets compiled and runs at high -speed, the best language to use is C. Using another language is like -using a non-standard feature: it will cause trouble for users. Even if -GCC supports the other language, users may find it inconvenient to have -to install the compiler for that other language in order to build your -program. For example, if you write your program in C++, people will -have to install the GNU C++ compiler in order to compile your program. - - C has one other advantage over C++ and other compiled languages: more -people know C, so more people will find it easy to read and modify the -program if it is written in C. - - So in general it is much better to use C, rather than the comparable -alternatives. - - But there are two exceptions to that conclusion: - - * It is no problem to use another language to write a tool - specifically intended for use with that language. That is because - the only people who want to build the tool will be those who have - installed the other language anyway. - - * If an application is of interest only to a narrow part of the - community, then the question of which language it is written in - has less effect on other people, so you may as well please - yourself. - - Many programs are designed to be extensible: they include an -interpreter for a language that is higher level than C. Often much of -the program is written in that language, too. The Emacs editor -pioneered this technique. - - The standard extensibility interpreter for GNU software is GUILE, -which implements the language Scheme (an especially clean and simple -dialect of Lisp). `http://www.gnu.org/software/guile/'. We don't -reject programs written in other "scripting languages" such as Perl and -Python, but using GUILE is very important for the overall consistency of -the GNU system. - - -File: standards.info, Node: Compatibility, Next: Using Extensions, Prev: Source Language, Up: Design Advice - -3.2 Compatibility with Other Implementations -============================================ - -With occasional exceptions, utility programs and libraries for GNU -should be upward compatible with those in Berkeley Unix, and upward -compatible with Standard C if Standard C specifies their behavior, and -upward compatible with POSIX if POSIX specifies their behavior. - - When these standards conflict, it is useful to offer compatibility -modes for each of them. - - Standard C and POSIX prohibit many kinds of extensions. Feel free -to make the extensions anyway, and include a `--ansi', `--posix', or -`--compatible' option to turn them off. However, if the extension has -a significant chance of breaking any real programs or scripts, then it -is not really upward compatible. So you should try to redesign its -interface to make it upward compatible. - - Many GNU programs suppress extensions that conflict with POSIX if the -environment variable `POSIXLY_CORRECT' is defined (even if it is -defined with a null value). Please make your program recognize this -variable if appropriate. - - When a feature is used only by users (not by programs or command -files), and it is done poorly in Unix, feel free to replace it -completely with something totally different and better. (For example, -`vi' is replaced with Emacs.) But it is nice to offer a compatible -feature as well. (There is a free `vi' clone, so we offer it.) - - Additional useful features are welcome regardless of whether there -is any precedent for them. - - -File: standards.info, Node: Using Extensions, Next: Standard C, Prev: Compatibility, Up: Design Advice - -3.3 Using Non-standard Features -=============================== - -Many GNU facilities that already exist support a number of convenient -extensions over the comparable Unix facilities. Whether to use these -extensions in implementing your program is a difficult question. - - On the one hand, using the extensions can make a cleaner program. -On the other hand, people will not be able to build the program unless -the other GNU tools are available. This might cause the program to -work on fewer kinds of machines. - - With some extensions, it might be easy to provide both alternatives. -For example, you can define functions with a "keyword" `INLINE' and -define that as a macro to expand into either `inline' or nothing, -depending on the compiler. - - In general, perhaps it is best not to use the extensions if you can -straightforwardly do without them, but to use the extensions if they -are a big improvement. - - An exception to this rule are the large, established programs (such -as Emacs) which run on a great variety of systems. Using GNU -extensions in such programs would make many users unhappy, so we don't -do that. - - Another exception is for programs that are used as part of -compilation: anything that must be compiled with other compilers in -order to bootstrap the GNU compilation facilities. If these require -the GNU compiler, then no one can compile them without having them -installed already. That would be extremely troublesome in certain -cases. - - -File: standards.info, Node: Standard C, Next: Conditional Compilation, Prev: Using Extensions, Up: Design Advice - -3.4 Standard C and Pre-Standard C -================================= - -1989 Standard C is widespread enough now that it is ok to use its -features in new programs. There is one exception: do not ever use the -"trigraph" feature of Standard C. - - 1999 Standard C is not widespread yet, so please do not require its -features in programs. It is ok to use its features if they are present. - - However, it is easy to support pre-standard compilers in most -programs, so if you know how to do that, feel free. If a program you -are maintaining has such support, you should try to keep it working. - - To support pre-standard C, instead of writing function definitions in -standard prototype form, - - int - foo (int x, int y) - ... - -write the definition in pre-standard style like this, - - int - foo (x, y) - int x, y; - ... - -and use a separate declaration to specify the argument prototype: - - int foo (int, int); - - You need such a declaration anyway, in a header file, to get the -benefit of prototypes in all the files where the function is called. -And once you have the declaration, you normally lose nothing by writing -the function definition in the pre-standard style. - - This technique does not work for integer types narrower than `int'. -If you think of an argument as being of a type narrower than `int', -declare it as `int' instead. - - There are a few special cases where this technique is hard to use. -For example, if a function argument needs to hold the system type -`dev_t', you run into trouble, because `dev_t' is shorter than `int' on -some machines; but you cannot use `int' instead, because `dev_t' is -wider than `int' on some machines. There is no type you can safely use -on all machines in a non-standard definition. The only way to support -non-standard C and pass such an argument is to check the width of -`dev_t' using Autoconf and choose the argument type accordingly. This -may not be worth the trouble. - - In order to support pre-standard compilers that do not recognize -prototypes, you may want to use a preprocessor macro like this: - - /* Declare the prototype for a general external function. */ - #if defined (__STDC__) || defined (WINDOWSNT) - #define P_(proto) proto - #else - #define P_(proto) () - #endif - - -File: standards.info, Node: Conditional Compilation, Prev: Standard C, Up: Design Advice - -3.5 Conditional Compilation -=========================== - -When supporting configuration options already known when building your -program we prefer using `if (... )' over conditional compilation, as in -the former case the compiler is able to perform more extensive checking -of all possible code paths. - - For example, please write - - if (HAS_FOO) - ... - else - ... - - instead of: - - #ifdef HAS_FOO - ... - #else - ... - #endif - - A modern compiler such as GCC will generate exactly the same code in -both cases, and we have been using similar techniques with good success -in several projects. - - While this is not a silver bullet solving all portability problems, -following this policy would have saved the GCC project alone many person -hours if not days per year. - - In the case of function-like macros like `REVERSIBLE_CC_MODE' in GCC -which cannot be simply used in `if( ...)' statements, there is an easy -workaround. Simply introduce another macro `HAS_REVERSIBLE_CC_MODE' as -in the following example: - - #ifdef REVERSIBLE_CC_MODE - #define HAS_REVERSIBLE_CC_MODE 1 - #else - #define HAS_REVERSIBLE_CC_MODE 0 - #endif - - -File: standards.info, Node: Program Behavior, Next: Writing C, Prev: Design Advice, Up: Top - -4 Program Behavior for All Programs -*********************************** - -This node describes conventions for writing robust software. It also -describes general standards for error messages, the command line -interface, and how libraries should behave. - -* Menu: - -* Semantics:: Writing robust programs -* Libraries:: Library behavior -* Errors:: Formatting error messages -* User Interfaces:: Standards about interfaces generally -* Graphical Interfaces:: Standards for graphical interfaces -* Command-Line Interfaces:: Standards for command line interfaces -* Option Table:: Table of long options -* Memory Usage:: When and how to care about memory needs -* File Usage:: Which files to use, and where - - -File: standards.info, Node: Semantics, Next: Libraries, Up: Program Behavior - -4.1 Writing Robust Programs -=========================== - -Avoid arbitrary limits on the length or number of _any_ data structure, -including file names, lines, files, and symbols, by allocating all data -structures dynamically. In most Unix utilities, "long lines are -silently truncated". This is not acceptable in a GNU utility. - - Utilities reading files should not drop NUL characters, or any other -nonprinting characters _including those with codes above 0177_. The -only sensible exceptions would be utilities specifically intended for -interface to certain types of terminals or printers that can't handle -those characters. Whenever possible, try to make programs work -properly with sequences of bytes that represent multibyte characters, -using encodings such as UTF-8 and others. - - Check every system call for an error return, unless you know you -wish to ignore errors. Include the system error text (from `perror' or -equivalent) in _every_ error message resulting from a failing system -call, as well as the name of the file if any and the name of the -utility. Just "cannot open foo.c" or "stat failed" is not sufficient. - - Check every call to `malloc' or `realloc' to see if it returned -zero. Check `realloc' even if you are making the block smaller; in a -system that rounds block sizes to a power of 2, `realloc' may get a -different block if you ask for less space. - - In Unix, `realloc' can destroy the storage block if it returns zero. -GNU `realloc' does not have this bug: if it fails, the original block -is unchanged. Feel free to assume the bug is fixed. If you wish to -run your program on Unix, and wish to avoid lossage in this case, you -can use the GNU `malloc'. - - You must expect `free' to alter the contents of the block that was -freed. Anything you want to fetch from the block, you must fetch before -calling `free'. - - If `malloc' fails in a noninteractive program, make that a fatal -error. In an interactive program (one that reads commands from the -user), it is better to abort the command and return to the command -reader loop. This allows the user to kill other processes to free up -virtual memory, and then try the command again. - - Use `getopt_long' to decode arguments, unless the argument syntax -makes this unreasonable. - - When static storage is to be written in during program execution, use -explicit C code to initialize it. Reserve C initialized declarations -for data that will not be changed. - - Try to avoid low-level interfaces to obscure Unix data structures -(such as file directories, utmp, or the layout of kernel memory), since -these are less likely to work compatibly. If you need to find all the -files in a directory, use `readdir' or some other high-level interface. -These are supported compatibly by GNU. - - The preferred signal handling facilities are the BSD variant of -`signal', and the POSIX `sigaction' function; the alternative USG -`signal' interface is an inferior design. - - Nowadays, using the POSIX signal functions may be the easiest way to -make a program portable. If you use `signal', then on GNU/Linux -systems running GNU libc version 1, you should include `bsd/signal.h' -instead of `signal.h', so as to get BSD behavior. It is up to you -whether to support systems where `signal' has only the USG behavior, or -give up on them. - - In error checks that detect "impossible" conditions, just abort. -There is usually no point in printing any message. These checks -indicate the existence of bugs. Whoever wants to fix the bugs will have -to read the source code and run a debugger. So explain the problem with -comments in the source. The relevant data will be in variables, which -are easy to examine with the debugger, so there is no point moving them -elsewhere. - - Do not use a count of errors as the exit status for a program. -_That does not work_, because exit status values are limited to 8 bits -(0 through 255). A single run of the program might have 256 errors; if -you try to return 256 as the exit status, the parent process will see 0 -as the status, and it will appear that the program succeeded. - - If you make temporary files, check the `TMPDIR' environment -variable; if that variable is defined, use the specified directory -instead of `/tmp'. - - In addition, be aware that there is a possible security problem when -creating temporary files in world-writable directories. In C, you can -avoid this problem by creating temporary files in this manner: - - fd = open(filename, O_WRONLY | O_CREAT | O_EXCL, 0600); - -or by using the `mkstemps' function from libiberty. - - In bash, use `set -C' to avoid this problem. - - -File: standards.info, Node: Libraries, Next: Errors, Prev: Semantics, Up: Program Behavior - -4.2 Library Behavior -==================== - -Try to make library functions reentrant. If they need to do dynamic -storage allocation, at least try to avoid any nonreentrancy aside from -that of `malloc' itself. - - Here are certain name conventions for libraries, to avoid name -conflicts. - - Choose a name prefix for the library, more than two characters long. -All external function and variable names should start with this prefix. -In addition, there should only be one of these in any given library -member. This usually means putting each one in a separate source file. - - An exception can be made when two external symbols are always used -together, so that no reasonable program could use one without the -other; then they can both go in the same file. - - External symbols that are not documented entry points for the user -should have names beginning with `_'. The `_' should be followed by -the chosen name prefix for the library, to prevent collisions with -other libraries. These can go in the same files with user entry points -if you like. - - Static functions and variables can be used as you like and need not -fit any naming convention. - - -File: standards.info, Node: Errors, Next: User Interfaces, Prev: Libraries, Up: Program Behavior - -4.3 Formatting Error Messages -============================= - -Error messages from compilers should look like this: - - SOURCE-FILE-NAME:LINENO: MESSAGE - -If you want to mention the column number, use this format: - - SOURCE-FILE-NAME:LINENO:COLUMN: MESSAGE - -Line numbers should start from 1 at the beginning of the file, and -column numbers should start from 1 at the beginning of the line. (Both -of these conventions are chosen for compatibility.) Calculate column -numbers assuming that space and all ASCII printing characters have -equal width, and assuming tab stops every 8 columns. - - Error messages from other noninteractive programs should look like -this: - - PROGRAM:SOURCE-FILE-NAME:LINENO: MESSAGE - -when there is an appropriate source file, or like this: - - PROGRAM: MESSAGE - -when there is no relevant source file. - - If you want to mention the column number, use this format: - - PROGRAM:SOURCE-FILE-NAME:LINENO:COLUMN: MESSAGE - - In an interactive program (one that is reading commands from a -terminal), it is better not to include the program name in an error -message. The place to indicate which program is running is in the -prompt or with the screen layout. (When the same program runs with -input from a source other than a terminal, it is not interactive and -would do best to print error messages using the noninteractive style.) - - The string MESSAGE should not begin with a capital letter when it -follows a program name and/or file name. Also, it should not end with -a period. - - Error messages from interactive programs, and other messages such as -usage messages, should start with a capital letter. But they should not -end with a period. - - -File: standards.info, Node: User Interfaces, Next: Graphical Interfaces, Prev: Errors, Up: Program Behavior - -4.4 Standards for Interfaces Generally -====================================== - -Please don't make the behavior of a utility depend on the name used to -invoke it. It is useful sometimes to make a link to a utility with a -different name, and that should not change what it does. - - Instead, use a run time option or a compilation switch or both to -select among the alternate behaviors. - - Likewise, please don't make the behavior of the program depend on the -type of output device it is used with. Device independence is an -important principle of the system's design; do not compromise it merely -to save someone from typing an option now and then. (Variation in error -message syntax when using a terminal is ok, because that is a side issue -that people do not depend on.) - - If you think one behavior is most useful when the output is to a -terminal, and another is most useful when the output is a file or a -pipe, then it is usually best to make the default behavior the one that -is useful with output to a terminal, and have an option for the other -behavior. - - Compatibility requires certain programs to depend on the type of -output device. It would be disastrous if `ls' or `sh' did not do so in -the way all users expect. In some of these cases, we supplement the -program with a preferred alternate version that does not depend on the -output device type. For example, we provide a `dir' program much like -`ls' except that its default output format is always multi-column -format. - - -File: standards.info, Node: Graphical Interfaces, Next: Command-Line Interfaces, Prev: User Interfaces, Up: Program Behavior - -4.5 Standards for Graphical Interfaces -====================================== - -When you write a program that provides a graphical user interface, -please make it work with X Windows and the GTK toolkit unless the -functionality specifically requires some alternative (for example, -"displaying jpeg images while in console mode"). - - In addition, please provide a command-line interface to control the -functionality. (In many cases, the graphical user interface can be a -separate program which invokes the command-line program.) This is so -that the same jobs can be done from scripts. - - Please also consider providing a CORBA interface (for use from -GNOME), a library interface (for use from C), and perhaps a -keyboard-driven console interface (for use by users from console mode). -Once you are doing the work to provide the functionality and the -graphical interface, these won't be much extra work. - - -File: standards.info, Node: Command-Line Interfaces, Next: Option Table, Prev: Graphical Interfaces, Up: Program Behavior - -4.6 Standards for Command Line Interfaces -========================================= - -It is a good idea to follow the POSIX guidelines for the command-line -options of a program. The easiest way to do this is to use `getopt' to -parse them. Note that the GNU version of `getopt' will normally permit -options anywhere among the arguments unless the special argument `--' -is used. This is not what POSIX specifies; it is a GNU extension. - - Please define long-named options that are equivalent to the -single-letter Unix-style options. We hope to make GNU more user -friendly this way. This is easy to do with the GNU function -`getopt_long'. - - One of the advantages of long-named options is that they can be -consistent from program to program. For example, users should be able -to expect the "verbose" option of any GNU program which has one, to be -spelled precisely `--verbose'. To achieve this uniformity, look at the -table of common long-option names when you choose the option names for -your program (*note Option Table::). - - It is usually a good idea for file names given as ordinary arguments -to be input files only; any output files would be specified using -options (preferably `-o' or `--output'). Even if you allow an output -file name as an ordinary argument for compatibility, try to provide an -option as another way to specify it. This will lead to more consistency -among GNU utilities, and fewer idiosyncracies for users to remember. - - All programs should support two standard options: `--version' and -`--help'. - -`--version' - This option should direct the program to print information about - its name, version, origin and legal status, all on standard - output, and then exit successfully. Other options and arguments - should be ignored once this is seen, and the program should not - perform its normal function. - - The first line is meant to be easy for a program to parse; the - version number proper starts after the last space. In addition, - it contains the canonical name for this program, in this format: - - GNU Emacs 19.30 - - The program's name should be a constant string; _don't_ compute it - from `argv[0]'. The idea is to state the standard or canonical - name for the program, not its file name. There are other ways to - find out the precise file name where a command is found in `PATH'. - - If the program is a subsidiary part of a larger package, mention - the package name in parentheses, like this: - - emacsserver (GNU Emacs) 19.30 - - If the package has a version number which is different from this - program's version number, you can mention the package version - number just before the close-parenthesis. - - If you *need* to mention the version numbers of libraries which - are distributed separately from the package which contains this - program, you can do so by printing an additional line of version - info for each library you want to mention. Use the same format - for these lines as for the first line. - - Please do not mention all of the libraries that the program uses - "just for completeness"--that would produce a lot of unhelpful - clutter. Please mention library version numbers only if you find - in practice that they are very important to you in debugging. - - The following line, after the version number line or lines, should - be a copyright notice. If more than one copyright notice is - called for, put each on a separate line. - - Next should follow a brief statement that the program is free - software, and that users are free to copy and change it on certain - conditions. If the program is covered by the GNU GPL, say so - here. Also mention that there is no warranty, to the extent - permitted by law. - - It is ok to finish the output with a list of the major authors of - the program, as a way of giving credit. - - Here's an example of output that follows these rules: - - GNU Emacs 19.34.5 - Copyright (C) 1996 Free Software Foundation, Inc. - GNU Emacs comes with NO WARRANTY, - to the extent permitted by law. - You may redistribute copies of GNU Emacs - under the terms of the GNU General Public License. - For more information about these matters, - see the files named COPYING. - - You should adapt this to your program, of course, filling in the - proper year, copyright holder, name of program, and the references - to distribution terms, and changing the rest of the wording as - necessary. - - This copyright notice only needs to mention the most recent year in - which changes were made--there's no need to list the years for - previous versions' changes. You don't have to mention the name of - the program in these notices, if that is inconvenient, since it - appeared in the first line. - - Translations of the above lines must preserve the validity of the - copyright notices (*note Internationalization::). If the - translation's character set supports it, the `(C)' should be - replaced with the copyright symbol, as follows: - - (the official copyright symbol, which is the letter C in a circle); - - Write the word "Copyright" exactly like that, in English. Do not - translate it into another language. International treaties - recognize the English word "Copyright"; translations into other - languages do not have legal significance. - -`--help' - This option should output brief documentation for how to invoke the - program, on standard output, then exit successfully. Other - options and arguments should be ignored once this is seen, and the - program should not perform its normal function. - - Near the end of the `--help' option's output there should be a line - that says where to mail bug reports. It should have this format: - - Report bugs to MAILING-ADDRESS. - - -File: standards.info, Node: Option Table, Next: Memory Usage, Prev: Command-Line Interfaces, Up: Program Behavior - -4.7 Table of Long Options -========================= - -Here is a table of long options used by GNU programs. It is surely -incomplete, but we aim to list all the options that a new program might -want to be compatible with. If you use names not already in the table, -please send a list of them, with their -meanings, so we can update the table. - -`after-date' - `-N' in `tar'. - -`all' - `-a' in `du', `ls', `nm', `stty', `uname', and `unexpand'. - -`all-text' - `-a' in `diff'. - -`almost-all' - `-A' in `ls'. - -`append' - `-a' in `etags', `tee', `time'; `-r' in `tar'. - -`archive' - `-a' in `cp'. - -`archive-name' - `-n' in `shar'. - -`arglength' - `-l' in `m4'. - -`ascii' - `-a' in `diff'. - -`assign' - `-v' in `gawk'. - -`assume-new' - `-W' in Make. - -`assume-old' - `-o' in Make. - -`auto-check' - `-a' in `recode'. - -`auto-pager' - `-a' in `wdiff'. - -`auto-reference' - `-A' in `ptx'. - -`avoid-wraps' - `-n' in `wdiff'. - -`background' - For server programs, run in the background. - -`backward-search' - `-B' in `ctags'. - -`basename' - `-f' in `shar'. - -`batch' - Used in GDB. - -`baud' - Used in GDB. - -`before' - `-b' in `tac'. - -`binary' - `-b' in `cpio' and `diff'. - -`bits-per-code' - `-b' in `shar'. - -`block-size' - Used in `cpio' and `tar'. - -`blocks' - `-b' in `head' and `tail'. - -`break-file' - `-b' in `ptx'. - -`brief' - Used in various programs to make output shorter. - -`bytes' - `-c' in `head', `split', and `tail'. - -`c++' - `-C' in `etags'. - -`catenate' - `-A' in `tar'. - -`cd' - Used in various programs to specify the directory to use. - -`changes' - `-c' in `chgrp' and `chown'. - -`classify' - `-F' in `ls'. - -`colons' - `-c' in `recode'. - -`command' - `-c' in `su'; `-x' in GDB. - -`compare' - `-d' in `tar'. - -`compat' - Used in `gawk'. - -`compress' - `-Z' in `tar' and `shar'. - -`concatenate' - `-A' in `tar'. - -`confirmation' - `-w' in `tar'. - -`context' - Used in `diff'. - -`copyleft' - `-W copyleft' in `gawk'. - -`copyright' - `-C' in `ptx', `recode', and `wdiff'; `-W copyright' in `gawk'. - -`core' - Used in GDB. - -`count' - `-q' in `who'. - -`count-links' - `-l' in `du'. - -`create' - Used in `tar' and `cpio'. - -`cut-mark' - `-c' in `shar'. - -`cxref' - `-x' in `ctags'. - -`date' - `-d' in `touch'. - -`debug' - `-d' in Make and `m4'; `-t' in Bison. - -`define' - `-D' in `m4'. - -`defines' - `-d' in Bison and `ctags'. - -`delete' - `-D' in `tar'. - -`dereference' - `-L' in `chgrp', `chown', `cpio', `du', `ls', and `tar'. - -`dereference-args' - `-D' in `du'. - -`device' - Specify an I/O device (special file name). - -`diacritics' - `-d' in `recode'. - -`dictionary-order' - `-d' in `look'. - -`diff' - `-d' in `tar'. - -`digits' - `-n' in `csplit'. - -`directory' - Specify the directory to use, in various programs. In `ls', it - means to show directories themselves rather than their contents. - In `rm' and `ln', it means to not treat links to directories - specially. - -`discard-all' - `-x' in `strip'. - -`discard-locals' - `-X' in `strip'. - -`dry-run' - `-n' in Make. - -`ed' - `-e' in `diff'. - -`elide-empty-files' - `-z' in `csplit'. - -`end-delete' - `-x' in `wdiff'. - -`end-insert' - `-z' in `wdiff'. - -`entire-new-file' - `-N' in `diff'. - -`environment-overrides' - `-e' in Make. - -`eof' - `-e' in `xargs'. - -`epoch' - Used in GDB. - -`error-limit' - Used in `makeinfo'. - -`error-output' - `-o' in `m4'. - -`escape' - `-b' in `ls'. - -`exclude-from' - `-X' in `tar'. - -`exec' - Used in GDB. - -`exit' - `-x' in `xargs'. - -`exit-0' - `-e' in `unshar'. - -`expand-tabs' - `-t' in `diff'. - -`expression' - `-e' in `sed'. - -`extern-only' - `-g' in `nm'. - -`extract' - `-i' in `cpio'; `-x' in `tar'. - -`faces' - `-f' in `finger'. - -`fast' - `-f' in `su'. - -`fatal-warnings' - `-E' in `m4'. - -`file' - `-f' in `info', `gawk', Make, `mt', and `tar'; `-n' in `sed'; `-r' - in `touch'. - -`field-separator' - `-F' in `gawk'. - -`file-prefix' - `-b' in Bison. - -`file-type' - `-F' in `ls'. - -`files-from' - `-T' in `tar'. - -`fill-column' - Used in `makeinfo'. - -`flag-truncation' - `-F' in `ptx'. - -`fixed-output-files' - `-y' in Bison. - -`follow' - `-f' in `tail'. - -`footnote-style' - Used in `makeinfo'. - -`force' - `-f' in `cp', `ln', `mv', and `rm'. - -`force-prefix' - `-F' in `shar'. - -`foreground' - For server programs, run in the foreground; in other words, don't - do anything special to run the server in the background. - -`format' - Used in `ls', `time', and `ptx'. - -`freeze-state' - `-F' in `m4'. - -`fullname' - Used in GDB. - -`gap-size' - `-g' in `ptx'. - -`get' - `-x' in `tar'. - -`graphic' - `-i' in `ul'. - -`graphics' - `-g' in `recode'. - -`group' - `-g' in `install'. - -`gzip' - `-z' in `tar' and `shar'. - -`hashsize' - `-H' in `m4'. - -`header' - `-h' in `objdump' and `recode' - -`heading' - `-H' in `who'. - -`help' - Used to ask for brief usage information. - -`here-delimiter' - `-d' in `shar'. - -`hide-control-chars' - `-q' in `ls'. - -`html' - In `makeinfo', output HTML. - -`idle' - `-u' in `who'. - -`ifdef' - `-D' in `diff'. - -`ignore' - `-I' in `ls'; `-x' in `recode'. - -`ignore-all-space' - `-w' in `diff'. - -`ignore-backups' - `-B' in `ls'. - -`ignore-blank-lines' - `-B' in `diff'. - -`ignore-case' - `-f' in `look' and `ptx'; `-i' in `diff' and `wdiff'. - -`ignore-errors' - `-i' in Make. - -`ignore-file' - `-i' in `ptx'. - -`ignore-indentation' - `-I' in `etags'. - -`ignore-init-file' - `-f' in Oleo. - -`ignore-interrupts' - `-i' in `tee'. - -`ignore-matching-lines' - `-I' in `diff'. - -`ignore-space-change' - `-b' in `diff'. - -`ignore-zeros' - `-i' in `tar'. - -`include' - `-i' in `etags'; `-I' in `m4'. - -`include-dir' - `-I' in Make. - -`incremental' - `-G' in `tar'. - -`info' - `-i', `-l', and `-m' in Finger. - -`init-file' - In some programs, specify the name of the file to read as the - user's init file. - -`initial' - `-i' in `expand'. - -`initial-tab' - `-T' in `diff'. - -`inode' - `-i' in `ls'. - -`interactive' - `-i' in `cp', `ln', `mv', `rm'; `-e' in `m4'; `-p' in `xargs'; - `-w' in `tar'. - -`intermix-type' - `-p' in `shar'. - -`iso-8601' - Used in `date' - -`jobs' - `-j' in Make. - -`just-print' - `-n' in Make. - -`keep-going' - `-k' in Make. - -`keep-files' - `-k' in `csplit'. - -`kilobytes' - `-k' in `du' and `ls'. - -`language' - `-l' in `etags'. - -`less-mode' - `-l' in `wdiff'. - -`level-for-gzip' - `-g' in `shar'. - -`line-bytes' - `-C' in `split'. - -`lines' - Used in `split', `head', and `tail'. - -`link' - `-l' in `cpio'. - -`lint' -`lint-old' - Used in `gawk'. - -`list' - `-t' in `cpio'; `-l' in `recode'. - -`list' - `-t' in `tar'. - -`literal' - `-N' in `ls'. - -`load-average' - `-l' in Make. - -`login' - Used in `su'. - -`machine' - No listing of which programs already use this; someone should - check to see if any actually do, and tell . - -`macro-name' - `-M' in `ptx'. - -`mail' - `-m' in `hello' and `uname'. - -`make-directories' - `-d' in `cpio'. - -`makefile' - `-f' in Make. - -`mapped' - Used in GDB. - -`max-args' - `-n' in `xargs'. - -`max-chars' - `-n' in `xargs'. - -`max-lines' - `-l' in `xargs'. - -`max-load' - `-l' in Make. - -`max-procs' - `-P' in `xargs'. - -`mesg' - `-T' in `who'. - -`message' - `-T' in `who'. - -`minimal' - `-d' in `diff'. - -`mixed-uuencode' - `-M' in `shar'. - -`mode' - `-m' in `install', `mkdir', and `mkfifo'. - -`modification-time' - `-m' in `tar'. - -`multi-volume' - `-M' in `tar'. - -`name-prefix' - `-a' in Bison. - -`nesting-limit' - `-L' in `m4'. - -`net-headers' - `-a' in `shar'. - -`new-file' - `-W' in Make. - -`no-builtin-rules' - `-r' in Make. - -`no-character-count' - `-w' in `shar'. - -`no-check-existing' - `-x' in `shar'. - -`no-common' - `-3' in `wdiff'. - -`no-create' - `-c' in `touch'. - -`no-defines' - `-D' in `etags'. - -`no-deleted' - `-1' in `wdiff'. - -`no-dereference' - `-d' in `cp'. - -`no-inserted' - `-2' in `wdiff'. - -`no-keep-going' - `-S' in Make. - -`no-lines' - `-l' in Bison. - -`no-piping' - `-P' in `shar'. - -`no-prof' - `-e' in `gprof'. - -`no-regex' - `-R' in `etags'. - -`no-sort' - `-p' in `nm'. - -`no-split' - Used in `makeinfo'. - -`no-static' - `-a' in `gprof'. - -`no-time' - `-E' in `gprof'. - -`no-timestamp' - `-m' in `shar'. - -`no-validate' - Used in `makeinfo'. - -`no-wait' - Used in `emacsclient'. - -`no-warn' - Used in various programs to inhibit warnings. - -`node' - `-n' in `info'. - -`nodename' - `-n' in `uname'. - -`nonmatching' - `-f' in `cpio'. - -`nstuff' - `-n' in `objdump'. - -`null' - `-0' in `xargs'. - -`number' - `-n' in `cat'. - -`number-nonblank' - `-b' in `cat'. - -`numeric-sort' - `-n' in `nm'. - -`numeric-uid-gid' - `-n' in `cpio' and `ls'. - -`nx' - Used in GDB. - -`old-archive' - `-o' in `tar'. - -`old-file' - `-o' in Make. - -`one-file-system' - `-l' in `tar', `cp', and `du'. - -`only-file' - `-o' in `ptx'. - -`only-prof' - `-f' in `gprof'. - -`only-time' - `-F' in `gprof'. - -`options' - `-o' in `getopt', `fdlist', `fdmount', `fdmountd', and `fdumount'. - -`output' - In various programs, specify the output file name. - -`output-prefix' - `-o' in `shar'. - -`override' - `-o' in `rm'. - -`overwrite' - `-c' in `unshar'. - -`owner' - `-o' in `install'. - -`paginate' - `-l' in `diff'. - -`paragraph-indent' - Used in `makeinfo'. - -`parents' - `-p' in `mkdir' and `rmdir'. - -`pass-all' - `-p' in `ul'. - -`pass-through' - `-p' in `cpio'. - -`port' - `-P' in `finger'. - -`portability' - `-c' in `cpio' and `tar'. - -`posix' - Used in `gawk'. - -`prefix-builtins' - `-P' in `m4'. - -`prefix' - `-f' in `csplit'. - -`preserve' - Used in `tar' and `cp'. - -`preserve-environment' - `-p' in `su'. - -`preserve-modification-time' - `-m' in `cpio'. - -`preserve-order' - `-s' in `tar'. - -`preserve-permissions' - `-p' in `tar'. - -`print' - `-l' in `diff'. - -`print-chars' - `-L' in `cmp'. - -`print-data-base' - `-p' in Make. - -`print-directory' - `-w' in Make. - -`print-file-name' - `-o' in `nm'. - -`print-symdefs' - `-s' in `nm'. - -`printer' - `-p' in `wdiff'. - -`prompt' - `-p' in `ed'. - -`proxy' - Specify an HTTP proxy. - -`query-user' - `-X' in `shar'. - -`question' - `-q' in Make. - -`quiet' - Used in many programs to inhibit the usual output. *Note_* every - program accepting `--quiet' should accept `--silent' as a synonym. - -`quiet-unshar' - `-Q' in `shar' - -`quote-name' - `-Q' in `ls'. - -`rcs' - `-n' in `diff'. - -`re-interval' - Used in `gawk'. - -`read-full-blocks' - `-B' in `tar'. - -`readnow' - Used in GDB. - -`recon' - `-n' in Make. - -`record-number' - `-R' in `tar'. - -`recursive' - Used in `chgrp', `chown', `cp', `ls', `diff', and `rm'. - -`reference-limit' - Used in `makeinfo'. - -`references' - `-r' in `ptx'. - -`regex' - `-r' in `tac' and `etags'. - -`release' - `-r' in `uname'. - -`reload-state' - `-R' in `m4'. - -`relocation' - `-r' in `objdump'. - -`rename' - `-r' in `cpio'. - -`replace' - `-i' in `xargs'. - -`report-identical-files' - `-s' in `diff'. - -`reset-access-time' - `-a' in `cpio'. - -`reverse' - `-r' in `ls' and `nm'. - -`reversed-ed' - `-f' in `diff'. - -`right-side-defs' - `-R' in `ptx'. - -`same-order' - `-s' in `tar'. - -`same-permissions' - `-p' in `tar'. - -`save' - `-g' in `stty'. - -`se' - Used in GDB. - -`sentence-regexp' - `-S' in `ptx'. - -`separate-dirs' - `-S' in `du'. - -`separator' - `-s' in `tac'. - -`sequence' - Used by `recode' to chose files or pipes for sequencing passes. - -`shell' - `-s' in `su'. - -`show-all' - `-A' in `cat'. - -`show-c-function' - `-p' in `diff'. - -`show-ends' - `-E' in `cat'. - -`show-function-line' - `-F' in `diff'. - -`show-tabs' - `-T' in `cat'. - -`silent' - Used in many programs to inhibit the usual output. *Note_* every - program accepting `--silent' should accept `--quiet' as a synonym. - -`size' - `-s' in `ls'. - -`socket' - Specify a file descriptor for a network server to use for its - socket, instead of opening and binding a new socket. This - provides a way to run, in a nonpriveledged process, a server that - normally needs a reserved port number. - -`sort' - Used in `ls'. - -`source' - `-W source' in `gawk'. - -`sparse' - `-S' in `tar'. - -`speed-large-files' - `-H' in `diff'. - -`split-at' - `-E' in `unshar'. - -`split-size-limit' - `-L' in `shar'. - -`squeeze-blank' - `-s' in `cat'. - -`start-delete' - `-w' in `wdiff'. - -`start-insert' - `-y' in `wdiff'. - -`starting-file' - Used in `tar' and `diff' to specify which file within a directory - to start processing with. - -`statistics' - `-s' in `wdiff'. - -`stdin-file-list' - `-S' in `shar'. - -`stop' - `-S' in Make. - -`strict' - `-s' in `recode'. - -`strip' - `-s' in `install'. - -`strip-all' - `-s' in `strip'. - -`strip-debug' - `-S' in `strip'. - -`submitter' - `-s' in `shar'. - -`suffix' - `-S' in `cp', `ln', `mv'. - -`suffix-format' - `-b' in `csplit'. - -`sum' - `-s' in `gprof'. - -`summarize' - `-s' in `du'. - -`symbolic' - `-s' in `ln'. - -`symbols' - Used in GDB and `objdump'. - -`synclines' - `-s' in `m4'. - -`sysname' - `-s' in `uname'. - -`tabs' - `-t' in `expand' and `unexpand'. - -`tabsize' - `-T' in `ls'. - -`terminal' - `-T' in `tput' and `ul'. `-t' in `wdiff'. - -`text' - `-a' in `diff'. - -`text-files' - `-T' in `shar'. - -`time' - Used in `ls' and `touch'. - -`timeout' - Specify how long to wait before giving up on some operation. - -`to-stdout' - `-O' in `tar'. - -`total' - `-c' in `du'. - -`touch' - `-t' in Make, `ranlib', and `recode'. - -`trace' - `-t' in `m4'. - -`traditional' - `-t' in `hello'; `-W traditional' in `gawk'; `-G' in `ed', `m4', - and `ptx'. - -`tty' - Used in GDB. - -`typedefs' - `-t' in `ctags'. - -`typedefs-and-c++' - `-T' in `ctags'. - -`typeset-mode' - `-t' in `ptx'. - -`uncompress' - `-z' in `tar'. - -`unconditional' - `-u' in `cpio'. - -`undefine' - `-U' in `m4'. - -`undefined-only' - `-u' in `nm'. - -`update' - `-u' in `cp', `ctags', `mv', `tar'. - -`usage' - Used in `gawk'; same as `--help'. - -`uuencode' - `-B' in `shar'. - -`vanilla-operation' - `-V' in `shar'. - -`verbose' - Print more information about progress. Many programs support this. - -`verify' - `-W' in `tar'. - -`version' - Print the version number. - -`version-control' - `-V' in `cp', `ln', `mv'. - -`vgrind' - `-v' in `ctags'. - -`volume' - `-V' in `tar'. - -`what-if' - `-W' in Make. - -`whole-size-limit' - `-l' in `shar'. - -`width' - `-w' in `ls' and `ptx'. - -`word-regexp' - `-W' in `ptx'. - -`writable' - `-T' in `who'. - -`zeros' - `-z' in `gprof'. - - -File: standards.info, Node: Memory Usage, Next: File Usage, Prev: Option Table, Up: Program Behavior - -4.8 Memory Usage -================ - -If a program typically uses just a few meg of memory, don't bother -making any effort to reduce memory usage. For example, if it is -impractical for other reasons to operate on files more than a few meg -long, it is reasonable to read entire input files into core to operate -on them. - - However, for programs such as `cat' or `tail', that can usefully -operate on very large files, it is important to avoid using a technique -that would artificially limit the size of files it can handle. If a -program works by lines and could be applied to arbitrary user-supplied -input files, it should keep only a line in memory, because this is not -very hard and users will want to be able to operate on input files that -are bigger than will fit in core all at once. - - If your program creates complicated data structures, just make them -in core and give a fatal error if `malloc' returns zero. - - -File: standards.info, Node: File Usage, Prev: Memory Usage, Up: Program Behavior - -4.9 File Usage -============== - -Programs should be prepared to operate when `/usr' and `/etc' are -read-only file systems. Thus, if the program manages log files, lock -files, backup files, score files, or any other files which are modified -for internal purposes, these files should not be stored in `/usr' or -`/etc'. - - There are two exceptions. `/etc' is used to store system -configuration information; it is reasonable for a program to modify -files in `/etc' when its job is to update the system configuration. -Also, if the user explicitly asks to modify one file in a directory, it -is reasonable for the program to store other files in the same -directory. - - -File: standards.info, Node: Writing C, Next: Documentation, Prev: Program Behavior, Up: Top - -5 Making The Best Use of C -************************** - -This node provides advice on how best to use the C language when -writing GNU software. - -* Menu: - -* Formatting:: Formatting Your Source Code -* Comments:: Commenting Your Work -* Syntactic Conventions:: Clean Use of C Constructs -* Names:: Naming Variables, Functions, and Files -* System Portability:: Portability between different operating systems -* CPU Portability:: Supporting the range of CPU types -* System Functions:: Portability and ``standard'' library functions -* Internationalization:: Techniques for internationalization -* Mmap:: How you can safely use `mmap'. - - -File: standards.info, Node: Formatting, Next: Comments, Up: Writing C - -5.1 Formatting Your Source Code -=============================== - -It is important to put the open-brace that starts the body of a C -function in column zero, and avoid putting any other open-brace or -open-parenthesis or open-bracket in column zero. Several tools look -for open-braces in column zero to find the beginnings of C functions. -These tools will not work on code not formatted that way. - - It is also important for function definitions to start the name of -the function in column zero. This helps people to search for function -definitions, and may also help certain tools recognize them. Thus, the -proper format is this: - - static char * - concat (s1, s2) /* Name starts in column zero here */ - char *s1, *s2; - { /* Open brace in column zero here */ - ... - } - -or, if you want to use Standard C syntax, format the definition like -this: - - static char * - concat (char *s1, char *s2) - { - ... - } - - In Standard C, if the arguments don't fit nicely on one line, split -it like this: - - int - lots_of_args (int an_integer, long a_long, short a_short, - double a_double, float a_float) - ... - - The rest of this section gives our recommendations for other aspects -of C formatting style, which is also the default style of the `indent' -program in version 1.2 and newer. It corresponds to the options - - -nbad -bap -nbc -bbo -bl -bli2 -bls -ncdb -nce -cp1 -cs -di2 - -ndj -nfc1 -nfca -hnl -i2 -ip5 -lp -pcs -psl -nsc -nsob - - We don't think of these recommendations as requirements, because it -causes no problems for users if two different programs have different -formatting styles. - - But whatever style you use, please use it consistently, since a -mixture of styles within one program tends to look ugly. If you are -contributing changes to an existing program, please follow the style of -that program. - - For the body of the function, our recommended style looks like this: - - if (x < foo (y, z)) - haha = bar[4] + 5; - else - { - while (z) - { - haha += foo (z, z); - z--; - } - return ++x + bar (); - } - - We find it easier to read a program when it has spaces before the -open-parentheses and after the commas. Especially after the commas. - - When you split an expression into multiple lines, split it before an -operator, not after one. Here is the right way: - - if (foo_this_is_long && bar > win (x, y, z) - && remaining_condition) - - Try to avoid having two operators of different precedence at the same -level of indentation. For example, don't write this: - - mode = (inmode[j] == VOIDmode - || GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j]) - ? outmode[j] : inmode[j]); - - Instead, use extra parentheses so that the indentation shows the -nesting: - - mode = ((inmode[j] == VOIDmode - || (GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j]))) - ? outmode[j] : inmode[j]); - - Insert extra parentheses so that Emacs will indent the code properly. -For example, the following indentation looks nice if you do it by hand, - - v = rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000 - + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000; - -but Emacs would alter it. Adding a set of parentheses produces -something that looks equally nice, and which Emacs will preserve: - - v = (rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000 - + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000); - - Format do-while statements like this: - - do - { - a = foo (a); - } - while (a > 0); - - Please use formfeed characters (control-L) to divide the program into -pages at logical places (but not within a function). It does not matter -just how long the pages are, since they do not have to fit on a printed -page. The formfeeds should appear alone on lines by themselves. - - -File: standards.info, Node: Comments, Next: Syntactic Conventions, Prev: Formatting, Up: Writing C - -5.2 Commenting Your Work -======================== - -Every program should start with a comment saying briefly what it is for. -Example: `fmt - filter for simple filling of text'. - - Please write the comments in a GNU program in English, because -English is the one language that nearly all programmers in all -countries can read. If you do not write English well, please write -comments in English as well as you can, then ask other people to help -rewrite them. If you can't write comments in English, please find -someone to work with you and translate your comments into English. - - Please put a comment on each function saying what the function does, -what sorts of arguments it gets, and what the possible values of -arguments mean and are used for. It is not necessary to duplicate in -words the meaning of the C argument declarations, if a C type is being -used in its customary fashion. If there is anything nonstandard about -its use (such as an argument of type `char *' which is really the -address of the second character of a string, not the first), or any -possible values that would not work the way one would expect (such as, -that strings containing newlines are not guaranteed to work), be sure -to say so. - - Also explain the significance of the return value, if there is one. - - Please put two spaces after the end of a sentence in your comments, -so that the Emacs sentence commands will work. Also, please write -complete sentences and capitalize the first word. If a lower-case -identifier comes at the beginning of a sentence, don't capitalize it! -Changing the spelling makes it a different identifier. If you don't -like starting a sentence with a lower case letter, write the sentence -differently (e.g., "The identifier lower-case is ..."). - - The comment on a function is much clearer if you use the argument -names to speak about the argument values. The variable name itself -should be lower case, but write it in upper case when you are speaking -about the value rather than the variable itself. Thus, "the inode -number NODE_NUM" rather than "an inode". - - There is usually no purpose in restating the name of the function in -the comment before it, because the reader can see that for himself. -There might be an exception when the comment is so long that the -function itself would be off the bottom of the screen. - - There should be a comment on each static variable as well, like this: - - /* Nonzero means truncate lines in the display; - zero means continue them. */ - int truncate_lines; - - Every `#endif' should have a comment, except in the case of short -conditionals (just a few lines) that are not nested. The comment should -state the condition of the conditional that is ending, _including its -sense_. `#else' should have a comment describing the condition _and -sense_ of the code that follows. For example: - - #ifdef foo - ... - #else /* not foo */ - ... - #endif /* not foo */ - #ifdef foo - ... - #endif /* foo */ - -but, by contrast, write the comments this way for a `#ifndef': - - #ifndef foo - ... - #else /* foo */ - ... - #endif /* foo */ - #ifndef foo - ... - #endif /* not foo */ - - -File: standards.info, Node: Syntactic Conventions, Next: Names, Prev: Comments, Up: Writing C - -5.3 Clean Use of C Constructs -============================= - -Please explicitly declare the types of all objects. For example, you -should explicitly declare all arguments to functions, and you should -declare functions to return `int' rather than omitting the `int'. - - Some programmers like to use the GCC `-Wall' option, and change the -code whenever it issues a warning. If you want to do this, then do. -Other programmers prefer not to use `-Wall', because it gives warnings -for valid and legitimate code which they do not want to change. If you -want to do this, then do. The compiler should be your servant, not -your master. - - Declarations of external functions and functions to appear later in -the source file should all go in one place near the beginning of the -file (somewhere before the first function definition in the file), or -else should go in a header file. Don't put `extern' declarations inside -functions. - - It used to be common practice to use the same local variables (with -names like `tem') over and over for different values within one -function. Instead of doing this, it is better declare a separate local -variable for each distinct purpose, and give it a name which is -meaningful. This not only makes programs easier to understand, it also -facilitates optimization by good compilers. You can also move the -declaration of each local variable into the smallest scope that includes -all its uses. This makes the program even cleaner. - - Don't use local variables or parameters that shadow global -identifiers. - - Don't declare multiple variables in one declaration that spans lines. -Start a new declaration on each line, instead. For example, instead of -this: - - int foo, - bar; - -write either this: - - int foo, bar; - -or this: - - int foo; - int bar; - -(If they are global variables, each should have a comment preceding it -anyway.) - - When you have an `if'-`else' statement nested in another `if' -statement, always put braces around the `if'-`else'. Thus, never write -like this: - - if (foo) - if (bar) - win (); - else - lose (); - -always like this: - - if (foo) - { - if (bar) - win (); - else - lose (); - } - - If you have an `if' statement nested inside of an `else' statement, -either write `else if' on one line, like this, - - if (foo) - ... - else if (bar) - ... - -with its `then'-part indented like the preceding `then'-part, or write -the nested `if' within braces like this: - - if (foo) - ... - else - { - if (bar) - ... - } - - Don't declare both a structure tag and variables or typedefs in the -same declaration. Instead, declare the structure tag separately and -then use it to declare the variables or typedefs. - - Try to avoid assignments inside `if'-conditions. For example, don't -write this: - - if ((foo = (char *) malloc (sizeof *foo)) == 0) - fatal ("virtual memory exhausted"); - -instead, write this: - - foo = (char *) malloc (sizeof *foo); - if (foo == 0) - fatal ("virtual memory exhausted"); - - Don't make the program ugly to placate `lint'. Please don't insert -any casts to `void'. Zero without a cast is perfectly fine as a null -pointer constant, except when calling a varargs function. - - -File: standards.info, Node: Names, Next: System Portability, Prev: Syntactic Conventions, Up: Writing C - -5.4 Naming Variables, Functions, and Files -========================================== - -The names of global variables and functions in a program serve as -comments of a sort. So don't choose terse names--instead, look for -names that give useful information about the meaning of the variable or -function. In a GNU program, names should be English, like other -comments. - - Local variable names can be shorter, because they are used only -within one context, where (presumably) comments explain their purpose. - - Try to limit your use of abbreviations in symbol names. It is ok to -make a few abbreviations, explain what they mean, and then use them -frequently, but don't use lots of obscure abbreviations. - - Please use underscores to separate words in a name, so that the Emacs -word commands can be useful within them. Stick to lower case; reserve -upper case for macros and `enum' constants, and for name-prefixes that -follow a uniform convention. - - For example, you should use names like `ignore_space_change_flag'; -don't use names like `iCantReadThis'. - - Variables that indicate whether command-line options have been -specified should be named after the meaning of the option, not after -the option-letter. A comment should state both the exact meaning of -the option and its letter. For example, - - /* Ignore changes in horizontal whitespace (-b). */ - int ignore_space_change_flag; - - When you want to define names with constant integer values, use -`enum' rather than `#define'. GDB knows about enumeration constants. - - You might want to make sure that none of the file names would -conflict the files were loaded onto an MS-DOS file system which -shortens the names. You can use the program `doschk' to test for this. - - Some GNU programs were designed to limit themselves to file names of -14 characters or less, to avoid file name conflicts if they are read -into older System V systems. Please preserve this feature in the -existing GNU programs that have it, but there is no need to do this in -new GNU programs. `doschk' also reports file names longer than 14 -characters. - - -File: standards.info, Node: System Portability, Next: CPU Portability, Prev: Names, Up: Writing C - -5.5 Portability between System Types -==================================== - -In the Unix world, "portability" refers to porting to different Unix -versions. For a GNU program, this kind of portability is desirable, but -not paramount. - - The primary purpose of GNU software is to run on top of the GNU -kernel, compiled with the GNU C compiler, on various types of CPU. So -the kinds of portability that are absolutely necessary are quite -limited. But it is important to support Linux-based GNU systems, since -they are the form of GNU that is popular. - - Beyond that, it is good to support the other free operating systems -(*BSD), and it is nice to support other Unix-like systems if you want -to. Supporting a variety of Unix-like systems is desirable, although -not paramount. It is usually not too hard, so you may as well do it. -But you don't have to consider it an obligation, if it does turn out to -be hard. - - The easiest way to achieve portability to most Unix-like systems is -to use Autoconf. It's unlikely that your program needs to know more -information about the host platform than Autoconf can provide, simply -because most of the programs that need such knowledge have already been -written. - - Avoid using the format of semi-internal data bases (e.g., -directories) when there is a higher-level alternative (`readdir'). - - As for systems that are not like Unix, such as MSDOS, Windows, the -Macintosh, VMS, and MVS, supporting them is often a lot of work. When -that is the case, it is better to spend your time adding features that -will be useful on GNU and GNU/Linux, rather than on supporting other -incompatible systems. - - It is a good idea to define the "feature test macro" `_GNU_SOURCE' -when compiling your C files. When you compile on GNU or GNU/Linux, -this will enable the declarations of GNU library extension functions, -and that will usually give you a compiler error message if you define -the same function names in some other way in your program. (You don't -have to actually _use_ these functions, if you prefer to make the -program more portable to other systems.) - - But whether or not you use these GNU extensions, you should avoid -using their names for any other meanings. Doing so would make it hard -to move your code into other GNU programs. - - -File: standards.info, Node: CPU Portability, Next: System Functions, Prev: System Portability, Up: Writing C - -5.6 Portability between CPUs -============================ - -Even GNU systems will differ because of differences among CPU -types--for example, difference in byte ordering and alignment -requirements. It is absolutely essential to handle these differences. -However, don't make any effort to cater to the possibility that an -`int' will be less than 32 bits. We don't support 16-bit machines in -GNU. - - Similarly, don't make any effort to cater to the possibility that -`long' will be smaller than predefined types like `size_t'. For -example, the following code is ok: - - printf ("size = %lu\n", (unsigned long) sizeof array); - printf ("diff = %ld\n", (long) (pointer2 - pointer1)); - - 1989 Standard C requires this to work, and we know of only one -counterexample: 64-bit programs on Microsoft Windows IA-64. We will -leave it to those who want to port GNU programs to that environment to -figure out how to do it. - - Predefined file-size types like `off_t' are an exception: they are -longer than `long' on many platforms, so code like the above won't work -with them. One way to print an `off_t' value portably is to print its -digits yourself, one by one. - - Don't assume that the address of an `int' object is also the address -of its least-significant byte. This is false on big-endian machines. -Thus, don't make the following mistake: - - int c; - ... - while ((c = getchar()) != EOF) - write(file_descriptor, &c, 1); - - When calling functions, you need not worry about the difference -between pointers of various types, or between pointers and integers. -On most machines, there's no difference anyway. As for the few -machines where there is a difference, all of them support Standard C -prototypes, so you can use prototypes (perhaps conditionalized to be -active only in Standard C) to make the code work on those systems. - - In certain cases, it is ok to pass integer and pointer arguments -indiscriminately to the same function, and use no prototype on any -system. For example, many GNU programs have error-reporting functions -that pass their arguments along to `printf' and friends: - - error (s, a1, a2, a3) - char *s; - char *a1, *a2, *a3; - { - fprintf (stderr, "error: "); - fprintf (stderr, s, a1, a2, a3); - } - -In practice, this works on all machines, since a pointer is generally -the widest possible kind of argument; it is much simpler than any -"correct" alternative. Be sure _not_ to use a prototype for such -functions. - - If you have decided to use Standard C, then you can instead define -`error' using `stdarg.h', and pass the arguments along to `vfprintf'. - - Avoid casting pointers to integers if you can. Such casts greatly -reduce portability, and in most programs they are easy to avoid. In the -cases where casting pointers to integers is essential--such as, a Lisp -interpreter which stores type information as well as an address in one -word--you'll have to make explicit provisions to handle different word -sizes. You will also need to make provision for systems in which the -normal range of addresses you can get from `malloc' starts far away -from zero. - - -File: standards.info, Node: System Functions, Next: Internationalization, Prev: CPU Portability, Up: Writing C - -5.7 Calling System Functions -============================ - -C implementations differ substantially. Standard C reduces but does -not eliminate the incompatibilities; meanwhile, many GNU packages still -support pre-standard compilers because this is not hard to do. This -chapter gives recommendations for how to use the more-or-less standard C -library functions to avoid unnecessary loss of portability. - - * Don't use the return value of `sprintf'. It returns the number of - characters written on some systems, but not on all systems. - - * Be aware that `vfprintf' is not always available. - - * `main' should be declared to return type `int'. It should - terminate either by calling `exit' or by returning the integer - status code; make sure it cannot ever return an undefined value. - - * Don't declare system functions explicitly. - - Almost any declaration for a system function is wrong on some - system. To minimize conflicts, leave it to the system header - files to declare system functions. If the headers don't declare a - function, let it remain undeclared. - - While it may seem unclean to use a function without declaring it, - in practice this works fine for most system library functions on - the systems where this really happens; thus, the disadvantage is - only theoretical. By contrast, actual declarations have - frequently caused actual conflicts. - - * If you must declare a system function, don't specify the argument - types. Use an old-style declaration, not a Standard C prototype. - The more you specify about the function, the more likely a - conflict. - - * In particular, don't unconditionally declare `malloc' or `realloc'. - - Most GNU programs use those functions just once, in functions - conventionally named `xmalloc' and `xrealloc'. These functions - call `malloc' and `realloc', respectively, and check the results. - - Because `xmalloc' and `xrealloc' are defined in your program, you - can declare them in other files without any risk of type conflict. - - On most systems, `int' is the same length as a pointer; thus, the - calls to `malloc' and `realloc' work fine. For the few - exceptional systems (mostly 64-bit machines), you can use - *conditionalized* declarations of `malloc' and `realloc'--or put - these declarations in configuration files specific to those - systems. - - * The string functions require special treatment. Some Unix systems - have a header file `string.h'; others have `strings.h'. Neither - file name is portable. There are two things you can do: use - Autoconf to figure out which file to include, or don't include - either file. - - * If you don't include either strings file, you can't get - declarations for the string functions from the header file in the - usual way. - - That causes less of a problem than you might think. The newer - standard string functions should be avoided anyway because many - systems still don't support them. The string functions you can - use are these: - - strcpy strncpy strcat strncat - strlen strcmp strncmp - strchr strrchr - - The copy and concatenate functions work fine without a declaration - as long as you don't use their values. Using their values without - a declaration fails on systems where the width of a pointer - differs from the width of `int', and perhaps in other cases. It - is trivial to avoid using their values, so do that. - - The compare functions and `strlen' work fine without a declaration - on most systems, possibly all the ones that GNU software runs on. - You may find it necessary to declare them *conditionally* on a few - systems. - - The search functions must be declared to return `char *'. Luckily, - there is no variation in the data type they return. But there is - variation in their names. Some systems give these functions the - names `index' and `rindex'; other systems use the names `strchr' - and `strrchr'. Some systems support both pairs of names, but - neither pair works on all systems. - - You should pick a single pair of names and use it throughout your - program. (Nowadays, it is better to choose `strchr' and `strrchr' - for new programs, since those are the standard names.) Declare - both of those names as functions returning `char *'. On systems - which don't support those names, define them as macros in terms of - the other pair. For example, here is what to put at the beginning - of your file (or in a header) if you want to use the names - `strchr' and `strrchr' throughout: - - #ifndef HAVE_STRCHR - #define strchr index - #endif - #ifndef HAVE_STRRCHR - #define strrchr rindex - #endif - - char *strchr (); - char *strrchr (); - - Here we assume that `HAVE_STRCHR' and `HAVE_STRRCHR' are macros -defined in systems where the corresponding functions exist. One way to -get them properly defined is to use Autoconf. - - -File: standards.info, Node: Internationalization, Next: Mmap, Prev: System Functions, Up: Writing C - -5.8 Internationalization -======================== - -GNU has a library called GNU gettext that makes it easy to translate the -messages in a program into various languages. You should use this -library in every program. Use English for the messages as they appear -in the program, and let gettext provide the way to translate them into -other languages. - - Using GNU gettext involves putting a call to the `gettext' macro -around each string that might need translation--like this: - - printf (gettext ("Processing file `%s'...")); - -This permits GNU gettext to replace the string `"Processing file -`%s'..."' with a translated version. - - Once a program uses gettext, please make a point of writing calls to -`gettext' when you add new strings that call for translation. - - Using GNU gettext in a package involves specifying a "text domain -name" for the package. The text domain name is used to separate the -translations for this package from the translations for other packages. -Normally, the text domain name should be the same as the name of the -package--for example, `fileutils' for the GNU file utilities. - - To enable gettext to work well, avoid writing code that makes -assumptions about the structure of words or sentences. When you want -the precise text of a sentence to vary depending on the data, use two or -more alternative string constants each containing a complete sentences, -rather than inserting conditionalized words or phrases into a single -sentence framework. - - Here is an example of what not to do: - - printf ("%d file%s processed", nfiles, - nfiles != 1 ? "s" : ""); - -The problem with that example is that it assumes that plurals are made -by adding `s'. If you apply gettext to the format string, like this, - - printf (gettext ("%d file%s processed"), nfiles, - nfiles != 1 ? "s" : ""); - -the message can use different words, but it will still be forced to use -`s' for the plural. Here is a better way: - - printf ((nfiles != 1 ? "%d files processed" - : "%d file processed"), - nfiles); - -This way, you can apply gettext to each of the two strings -independently: - - printf ((nfiles != 1 ? gettext ("%d files processed") - : gettext ("%d file processed")), - nfiles); - -This can be any method of forming the plural of the word for "file", and -also handles languages that require agreement in the word for -"processed". - - A similar problem appears at the level of sentence structure with -this code: - - printf ("# Implicit rule search has%s been done.\n", - f->tried_implicit ? "" : " not"); - -Adding `gettext' calls to this code cannot give correct results for all -languages, because negation in some languages requires adding words at -more than one place in the sentence. By contrast, adding `gettext' -calls does the job straightfowardly if the code starts out like this: - - printf (f->tried_implicit - ? "# Implicit rule search has been done.\n", - : "# Implicit rule search has not been done.\n"); - - -File: standards.info, Node: Mmap, Prev: Internationalization, Up: Writing C - -5.9 Mmap -======== - -Don't assume that `mmap' either works on all files or fails for all -files. It may work on some files and fail on others. - - The proper way to use `mmap' is to try it on the specific file for -which you want to use it--and if `mmap' doesn't work, fall back on -doing the job in another way using `read' and `write'. - - The reason this precaution is needed is that the GNU kernel (the -HURD) provides a user-extensible file system, in which there can be many -different kinds of "ordinary files." Many of them support `mmap', but -some do not. It is important to make programs handle all these kinds -of files. - - -File: standards.info, Node: Documentation, Next: Managing Releases, Prev: Writing C, Up: Top - -6 Documenting Programs -********************** - -A GNU program should ideally come with full free documentation, adequate -for both reference and tutorial purposes. If the package can be -programmed or extended, the documentation should cover programming or -extending it, as well as just using it. - -* Menu: - -* GNU Manuals:: Writing proper manuals. -* Doc Strings and Manuals:: Compiling doc strings doesn't make a manual. -* Manual Structure Details:: Specific structure conventions. -* License for Manuals:: Writing the distribution terms for a manual. -* Manual Credits:: Giving credit to documentation contributors. -* Printed Manuals:: Mentioning the printed manual. -* NEWS File:: NEWS files supplement manuals. -* Change Logs:: Recording Changes -* Man Pages:: Man pages are secondary. -* Reading other Manuals:: How far you can go in learning - from other manuals. - - -File: standards.info, Node: GNU Manuals, Next: Doc Strings and Manuals, Up: Documentation - -6.1 GNU Manuals -=============== - -The preferred document format for the GNU system is the Texinfo -formatting language. Every GNU package should (ideally) have -documentation in Texinfo both for reference and for learners. Texinfo -makes it possible to produce a good quality formatted book, using TeX, -and to generate an Info file. It is also possible to generate HTML -output from Texinfo source. See the Texinfo manual, either the -hardcopy, or the on-line version available through `info' or the Emacs -Info subsystem (`C-h i'). - - Nowadays some other formats such as Docbook and Sgmltexi can be -converted automatically into Texinfo. It is ok to produce the Texinfo -documentation by conversion this way, as long as it gives good results. - - Programmers often find it most natural to structure the documentation -following the structure of the implementation, which they know. But -this structure is not necessarily good for explaining how to use the -program; it may be irrelevant and confusing for a user. - - At every level, from the sentences in a paragraph to the grouping of -topics into separate manuals, the right way to structure documentation -is according to the concepts and questions that a user will have in mind -when reading it. Sometimes this structure of ideas matches the -structure of the implementation of the software being documented--but -often they are different. Often the most important part of learning to -write good documentation is learning to notice when you are structuring -the documentation like the implementation, and think about better -alternatives. - - For example, each program in the GNU system probably ought to be -documented in one manual; but this does not mean each program should -have its own manual. That would be following the structure of the -implementation, rather than the structure that helps the user -understand. - - Instead, each manual should cover a coherent _topic_. For example, -instead of a manual for `diff' and a manual for `diff3', we have one -manual for "comparison of files" which covers both of those programs, -as well as `cmp'. By documenting these programs together, we can make -the whole subject clearer. - - The manual which discusses a program should certainly document all of -the program's command-line options and all of its commands. It should -give examples of their use. But don't organize the manual as a list of -features. Instead, organize it logically, by subtopics. Address the -questions that a user will ask when thinking about the job that the -program does. - - In general, a GNU manual should serve both as tutorial and reference. -It should be set up for convenient access to each topic through Info, -and for reading straight through (appendixes aside). A GNU manual -should give a good introduction to a beginner reading through from the -start, and should also provide all the details that hackers want. The -Bison manual is a good example of this--please take a look at it to see -what we mean. - - That is not as hard as it first sounds. Arrange each chapter as a -logical breakdown of its topic, but order the sections, and write their -text, so that reading the chapter straight through makes sense. Do -likewise when structuring the book into chapters, and when structuring a -section into paragraphs. The watchword is, _at each point, address the -most fundamental and important issue raised by the preceding text._ - - If necessary, add extra chapters at the beginning of the manual which -are purely tutorial and cover the basics of the subject. These provide -the framework for a beginner to understand the rest of the manual. The -Bison manual provides a good example of how to do this. - - To serve as a reference, a manual should have an Index that list all -the functions, variables, options, and important concepts that are part -of the program. One combined Index should do for a short manual, but -sometimes for a complex package it is better to use multiple indices. -The Texinfo manual includes advice on preparing good index entries, see -*Note Making Index Entries: (texinfo)Index Entries, and see *Note -Defining the Entries of an Index: (texinfo)Indexing Commands. - - Don't use Unix man pages as a model for how to write GNU -documentation; most of them are terse, badly structured, and give -inadequate explanation of the underlying concepts. (There are, of -course, some exceptions.) Also, Unix man pages use a particular format -which is different from what we use in GNU manuals. - - Please include an email address in the manual for where to report -bugs _in the manual_. - - Please do not use the term "pathname" that is used in Unix -documentation; use "file name" (two words) instead. We use the term -"path" only for search paths, which are lists of directory names. - - Please do not use the term "illegal" to refer to erroneous input to a -computer program. Please use "invalid" for this, and reserve the term -"illegal" for activities punishable by law. - - -File: standards.info, Node: Doc Strings and Manuals, Next: Manual Structure Details, Prev: GNU Manuals, Up: Documentation - -6.2 Doc Strings and Manuals -=========================== - -Some programming systems, such as Emacs, provide a documentation string -for each function, command or variable. You may be tempted to write a -reference manual by compiling the documentation strings and writing a -little additional text to go around them--but you must not do it. That -approach is a fundamental mistake. The text of well-written -documentation strings will be entirely wrong for a manual. - - A documentation string needs to stand alone--when it appears on the -screen, there will be no other text to introduce or explain it. -Meanwhile, it can be rather informal in style. - - The text describing a function or variable in a manual must not stand -alone; it appears in the context of a section or subsection. Other text -at the beginning of the section should explain some of the concepts, and -should often make some general points that apply to several functions or -variables. The previous descriptions of functions and variables in the -section will also have given information about the topic. A description -written to stand alone would repeat some of that information; this -redundance looks bad. Meanwhile, the informality that is acceptable in -a documentation string is totally unacceptable in a manual. - - The only good way to use documentation strings in writing a good -manual is to use them as a source of information for writing good text. - - -File: standards.info, Node: Manual Structure Details, Next: License for Manuals, Prev: Doc Strings and Manuals, Up: Documentation - -6.3 Manual Structure Details -============================ - -The title page of the manual should state the version of the programs or -packages documented in the manual. The Top node of the manual should -also contain this information. If the manual is changing more -frequently than or independent of the program, also state a version -number for the manual in both of these places. - - Each program documented in the manual should have a node named -`PROGRAM Invocation' or `Invoking PROGRAM'. This node (together with -its subnodes, if any) should describe the program's command line -arguments and how to run it (the sort of information people would look -in a man page for). Start with an `@example' containing a template for -all the options and arguments that the program uses. - - Alternatively, put a menu item in some menu whose item name fits one -of the above patterns. This identifies the node which that item points -to as the node for this purpose, regardless of the node's actual name. - - The `--usage' feature of the Info reader looks for such a node or -menu item in order to find the relevant text, so it is essential for -every Texinfo file to have one. - - If one manual describes several programs, it should have such a node -for each program described in the manual. - - -File: standards.info, Node: License for Manuals, Next: Manual Credits, Prev: Manual Structure Details, Up: Documentation - -6.4 License for Manuals -======================= - -Please use the GNU Free Documentation License for all GNU manuals that -are more than a few pages long. Likewise for a collection of short -documents--you only need one copy of the GNU FDL for the whole -collection. For a single short document, you can use a very permissive -non-copyleft license, to avoid taking up space with a long license. - - See `http://www.gnu.org/copyleft/fdl-howto.html' for more explanation -of how to employ the GFDL. - - Note that it is not obligatory to include a copy of the GNU GPL or -GNU LGPL in a manual whose license is neither the GPL nor the LGPL. It -can be a good idea to include the program's license in a large manual; -in a short manual, whose size would be increased considerably by -including the program's license, it is probably better not to include -it. - - -File: standards.info, Node: Manual Credits, Next: Printed Manuals, Prev: License for Manuals, Up: Documentation - -6.5 Manual Credits -================== - -Please credit the principal human writers of the manual as the authors, -on the title page of the manual. If a company sponsored the work, thank -the company in a suitable place in the manual, but do not cite the -company as an author. - - -File: standards.info, Node: Printed Manuals, Next: NEWS File, Prev: Manual Credits, Up: Documentation - -6.6 Printed Manuals -=================== - -The FSF publishes some GNU manuals in printed form. To encourage sales -of these manuals, the on-line versions of the manual should mention at -the very start that the printed manual is available and should point at -information for getting it--for instance, with a link to the page -`http://www.gnu.org/order/order.html'. This should not be included in -the printed manual, though, because there it is redundant. - - It is also useful to explain in the on-line forms of the manual how -the user can print out the manual from the sources. - - -File: standards.info, Node: NEWS File, Next: Change Logs, Prev: Printed Manuals, Up: Documentation - -6.7 The NEWS File -================= - -In addition to its manual, the package should have a file named `NEWS' -which contains a list of user-visible changes worth mentioning. In -each new release, add items to the front of the file and identify the -version they pertain to. Don't discard old items; leave them in the -file after the newer items. This way, a user upgrading from any -previous version can see what is new. - - If the `NEWS' file gets very long, move some of the older items into -a file named `ONEWS' and put a note at the end referring the user to -that file. - - -File: standards.info, Node: Change Logs, Next: Man Pages, Prev: NEWS File, Up: Documentation - -6.8 Change Logs -=============== - -Keep a change log to describe all the changes made to program source -files. The purpose of this is so that people investigating bugs in the -future will know about the changes that might have introduced the bug. -Often a new bug can be found by looking at what was recently changed. -More importantly, change logs can help you eliminate conceptual -inconsistencies between different parts of a program, by giving you a -history of how the conflicting concepts arose and who they came from. - -* Menu: - -* Change Log Concepts:: -* Style of Change Logs:: -* Simple Changes:: -* Conditional Changes:: -* Indicating the Part Changed:: - - -File: standards.info, Node: Change Log Concepts, Next: Style of Change Logs, Up: Change Logs - -6.8.1 Change Log Concepts -------------------------- - -You can think of the change log as a conceptual "undo list" which -explains how earlier versions were different from the current version. -People can see the current version; they don't need the change log to -tell them what is in it. What they want from a change log is a clear -explanation of how the earlier version differed. - - The change log file is normally called `ChangeLog' and covers an -entire directory. Each directory can have its own change log, or a -directory can use the change log of its parent directory-it's up to you. - - Another alternative is to record change log information with a -version control system such as RCS or CVS. This can be converted -automatically to a `ChangeLog' file using `rcs2log'; in Emacs, the -command `C-x v a' (`vc-update-change-log') does the job. - - There's no need to describe the full purpose of the changes or how -they work together. If you think that a change calls for explanation, -you're probably right. Please do explain it--but please put the -explanation in comments in the code, where people will see it whenever -they see the code. For example, "New function" is enough for the -change log when you add a function, because there should be a comment -before the function definition to explain what it does. - - However, sometimes it is useful to write one line to describe the -overall purpose of a batch of changes. - - The easiest way to add an entry to `ChangeLog' is with the Emacs -command `M-x add-change-log-entry'. An entry should have an asterisk, -the name of the changed file, and then in parentheses the name of the -changed functions, variables or whatever, followed by a colon. Then -describe the changes you made to that function or variable. - - -File: standards.info, Node: Style of Change Logs, Next: Simple Changes, Prev: Change Log Concepts, Up: Change Logs - -6.8.2 Style of Change Logs --------------------------- - -Here are some simple examples of change log entries, starting with the -header line that says who made the change and when, followed by -descriptions of specific changes. (These examples are drawn from Emacs -and GCC.) - - 1998-08-17 Richard Stallman - - * register.el (insert-register): Return nil. - (jump-to-register): Likewise. - - * sort.el (sort-subr): Return nil. - - * tex-mode.el (tex-bibtex-file, tex-file, tex-region): - Restart the tex shell if process is gone or stopped. - (tex-shell-running): New function. - - * expr.c (store_one_arg): Round size up for move_block_to_reg. - (expand_call): Round up when emitting USE insns. - * stmt.c (assign_parms): Round size up for move_block_from_reg. - - It's important to name the changed function or variable in full. -Don't abbreviate function or variable names, and don't combine them. -Subsequent maintainers will often search for a function name to find all -the change log entries that pertain to it; if you abbreviate the name, -they won't find it when they search. - - For example, some people are tempted to abbreviate groups of function -names by writing `* register.el ({insert,jump-to}-register)'; this is -not a good idea, since searching for `jump-to-register' or -`insert-register' would not find that entry. - - Separate unrelated change log entries with blank lines. When two -entries represent parts of the same change, so that they work together, -then don't put blank lines between them. Then you can omit the file -name and the asterisk when successive entries are in the same file. - - Break long lists of function names by closing continued lines with -`)', rather than `,', and opening the continuation with `(' as in this -example: - - * keyboard.c (menu_bar_items, tool_bar_items) - (Fexecute_extended_command): Deal with `keymap' property. - - -File: standards.info, Node: Simple Changes, Next: Conditional Changes, Prev: Style of Change Logs, Up: Change Logs - -6.8.3 Simple Changes --------------------- - -Certain simple kinds of changes don't need much detail in the change -log. - - When you change the calling sequence of a function in a simple -fashion, and you change all the callers of the function to use the new -calling sequence, there is no need to make individual entries for all -the callers that you changed. Just write in the entry for the function -being called, "All callers changed"--like this: - - * keyboard.c (Fcommand_execute): New arg SPECIAL. - All callers changed. - - When you change just comments or doc strings, it is enough to write -an entry for the file, without mentioning the functions. Just "Doc -fixes" is enough for the change log. - - There's no need to make change log entries for documentation files. -This is because documentation is not susceptible to bugs that are hard -to fix. Documentation does not consist of parts that must interact in a -precisely engineered fashion. To correct an error, you need not know -the history of the erroneous passage; it is enough to compare what the -documentation says with the way the program actually works. - - -File: standards.info, Node: Conditional Changes, Next: Indicating the Part Changed, Prev: Simple Changes, Up: Change Logs - -6.8.4 Conditional Changes -------------------------- - -C programs often contain compile-time `#if' conditionals. Many changes -are conditional; sometimes you add a new definition which is entirely -contained in a conditional. It is very useful to indicate in the -change log the conditions for which the change applies. - - Our convention for indicating conditional changes is to use square -brackets around the name of the condition. - - Here is a simple example, describing a change which is conditional -but does not have a function or entity name associated with it: - - * xterm.c [SOLARIS2]: Include string.h. - - Here is an entry describing a new definition which is entirely -conditional. This new definition for the macro `FRAME_WINDOW_P' is -used only when `HAVE_X_WINDOWS' is defined: - - * frame.h [HAVE_X_WINDOWS] (FRAME_WINDOW_P): Macro defined. - - Here is an entry for a change within the function `init_display', -whose definition as a whole is unconditional, but the changes themselves -are contained in a `#ifdef HAVE_LIBNCURSES' conditional: - - * dispnew.c (init_display) [HAVE_LIBNCURSES]: If X, call tgetent. - - Here is an entry for a change that takes affect only when a certain -macro is _not_ defined: - - (gethostname) [!HAVE_SOCKETS]: Replace with winsock version. - - -File: standards.info, Node: Indicating the Part Changed, Prev: Conditional Changes, Up: Change Logs - -6.8.5 Indicating the Part Changed ---------------------------------- - -Indicate the part of a function which changed by using angle brackets -enclosing an indication of what the changed part does. Here is an entry -for a change in the part of the function `sh-while-getopts' that deals -with `sh' commands: - - * progmodes/sh-script.el (sh-while-getopts) : Handle case that - user-specified option string is empty. - - -File: standards.info, Node: Man Pages, Next: Reading other Manuals, Prev: Change Logs, Up: Documentation - -6.9 Man Pages -============= - -In the GNU project, man pages are secondary. It is not necessary or -expected for every GNU program to have a man page, but some of them do. -It's your choice whether to include a man page in your program. - - When you make this decision, consider that supporting a man page -requires continual effort each time the program is changed. The time -you spend on the man page is time taken away from more useful work. - - For a simple program which changes little, updating the man page may -be a small job. Then there is little reason not to include a man page, -if you have one. - - For a large program that changes a great deal, updating a man page -may be a substantial burden. If a user offers to donate a man page, -you may find this gift costly to accept. It may be better to refuse -the man page unless the same person agrees to take full responsibility -for maintaining it--so that you can wash your hands of it entirely. If -this volunteer later ceases to do the job, then don't feel obliged to -pick it up yourself; it may be better to withdraw the man page from the -distribution until someone else agrees to update it. - - When a program changes only a little, you may feel that the -discrepancies are small enough that the man page remains useful without -updating. If so, put a prominent note near the beginning of the man -page explaining that you don't maintain it and that the Texinfo manual -is more authoritative. The note should say how to access the Texinfo -documentation. - - -File: standards.info, Node: Reading other Manuals, Prev: Man Pages, Up: Documentation - -6.10 Reading other Manuals -========================== - -There may be non-free books or documentation files that describe the -program you are documenting. - - It is ok to use these documents for reference, just as the author of -a new algebra textbook can read other books on algebra. A large portion -of any non-fiction book consists of facts, in this case facts about how -a certain program works, and these facts are necessarily the same for -everyone who writes about the subject. But be careful not to copy your -outline structure, wording, tables or examples from preexisting non-free -documentation. Copying from free documentation may be ok; please check -with the FSF about the individual case. - - -File: standards.info, Node: Managing Releases, Next: References, Prev: Documentation, Up: Top - -7 The Release Process -********************* - -Making a release is more than just bundling up your source files in a -tar file and putting it up for FTP. You should set up your software so -that it can be configured to run on a variety of systems. Your Makefile -should conform to the GNU standards described below, and your directory -layout should also conform to the standards discussed below. Doing so -makes it easy to include your package into the larger framework of all -GNU software. - -* Menu: - -* Configuration:: How Configuration Should Work -* Makefile Conventions:: Makefile Conventions -* Releases:: Making Releases - - -File: standards.info, Node: Configuration, Next: Makefile Conventions, Up: Managing Releases - -7.1 How Configuration Should Work -================================= - -Each GNU distribution should come with a shell script named -`configure'. This script is given arguments which describe the kind of -machine and system you want to compile the program for. - - The `configure' script must record the configuration options so that -they affect compilation. - - One way to do this is to make a link from a standard name such as -`config.h' to the proper configuration file for the chosen system. If -you use this technique, the distribution should _not_ contain a file -named `config.h'. This is so that people won't be able to build the -program without configuring it first. - - Another thing that `configure' can do is to edit the Makefile. If -you do this, the distribution should _not_ contain a file named -`Makefile'. Instead, it should include a file `Makefile.in' which -contains the input used for editing. Once again, this is so that people -won't be able to build the program without configuring it first. - - If `configure' does write the `Makefile', then `Makefile' should -have a target named `Makefile' which causes `configure' to be rerun, -setting up the same configuration that was set up last time. The files -that `configure' reads should be listed as dependencies of `Makefile'. - - All the files which are output from the `configure' script should -have comments at the beginning explaining that they were generated -automatically using `configure'. This is so that users won't think of -trying to edit them by hand. - - The `configure' script should write a file named `config.status' -which describes which configuration options were specified when the -program was last configured. This file should be a shell script which, -if run, will recreate the same configuration. - - The `configure' script should accept an option of the form -`--srcdir=DIRNAME' to specify the directory where sources are found (if -it is not the current directory). This makes it possible to build the -program in a separate directory, so that the actual source directory is -not modified. - - If the user does not specify `--srcdir', then `configure' should -check both `.' and `..' to see if it can find the sources. If it finds -the sources in one of these places, it should use them from there. -Otherwise, it should report that it cannot find the sources, and should -exit with nonzero status. - - Usually the easy way to support `--srcdir' is by editing a -definition of `VPATH' into the Makefile. Some rules may need to refer -explicitly to the specified source directory. To make this possible, -`configure' can add to the Makefile a variable named `srcdir' whose -value is precisely the specified directory. - - The `configure' script should also take an argument which specifies -the type of system to build the program for. This argument should look -like this: - - CPU-COMPANY-SYSTEM - - For example, a Sun 3 might be `m68k-sun-sunos4.1'. - - The `configure' script needs to be able to decode all plausible -alternatives for how to describe a machine. Thus, `sun3-sunos4.1' -would be a valid alias. For many programs, `vax-dec-ultrix' would be -an alias for `vax-dec-bsd', simply because the differences between -Ultrix and BSD are rarely noticeable, but a few programs might need to -distinguish them. - - There is a shell script called `config.sub' that you can use as a -subroutine to validate system types and canonicalize aliases. - - Other options are permitted to specify in more detail the software -or hardware present on the machine, and include or exclude optional -parts of the package: - -`--enable-FEATURE[=PARAMETER]' - Configure the package to build and install an optional user-level - facility called FEATURE. This allows users to choose which - optional features to include. Giving an optional PARAMETER of - `no' should omit FEATURE, if it is built by default. - - No `--enable' option should *ever* cause one feature to replace - another. No `--enable' option should ever substitute one useful - behavior for another useful behavior. The only proper use for - `--enable' is for questions of whether to build part of the program - or exclude it. - -`--with-PACKAGE' - The package PACKAGE will be installed, so configure this package - to work with PACKAGE. - - Possible values of PACKAGE include `gnu-as' (or `gas'), `gnu-ld', - `gnu-libc', `gdb', `x', and `x-toolkit'. - - Do not use a `--with' option to specify the file name to use to - find certain files. That is outside the scope of what `--with' - options are for. - - All `configure' scripts should accept all of these "detail" options, -whether or not they make any difference to the particular package at -hand. In particular, they should accept any option that starts with -`--with-' or `--enable-'. This is so users will be able to configure -an entire GNU source tree at once with a single set of options. - - You will note that the categories `--with-' and `--enable-' are -narrow: they *do not* provide a place for any sort of option you might -think of. That is deliberate. We want to limit the possible -configuration options in GNU software. We do not want GNU programs to -have idiosyncratic configuration options. - - Packages that perform part of the compilation process may support -cross-compilation. In such a case, the host and target machines for the -program may be different. - - The `configure' script should normally treat the specified type of -system as both the host and the target, thus producing a program which -works for the same type of machine that it runs on. - - To configure a cross-compiler, cross-assembler, or what have you, you -should specify a target different from the host, using the configure -option `--target=TARGETTYPE'. The syntax for TARGETTYPE is the same as -for the host type. So the command would look like this: - - ./configure HOSTTYPE --target=TARGETTYPE - - Programs for which cross-operation is not meaningful need not accept -the `--target' option, because configuring an entire operating system -for cross-operation is not a meaningful operation. - - Bootstrapping a cross-compiler requires compiling it on a machine -other than the host it will run on. Compilation packages accept a -configuration option `--build=BUILDTYPE' for specifying the -configuration on which you will compile them, but the configure script -should normally guess the build machine type (using `config.guess'), so -this option is probably not necessary. The host and target types -normally default from the build type, so in bootstrapping a -cross-compiler you must specify them both explicitly. - - Some programs have ways of configuring themselves automatically. If -your program is set up to do this, your `configure' script can simply -ignore most of its arguments. - - -File: standards.info, Node: Makefile Conventions, Next: Releases, Prev: Configuration, Up: Managing Releases - -7.2 Makefile Conventions -======================== - -This node describes conventions for writing the Makefiles for GNU -programs. Using Automake will help you write a Makefile that follows -these conventions. - -* Menu: - -* Makefile Basics:: General Conventions for Makefiles -* Utilities in Makefiles:: Utilities in Makefiles -* Command Variables:: Variables for Specifying Commands -* Directory Variables:: Variables for Installation Directories -* Standard Targets:: Standard Targets for Users -* Install Command Categories:: Three categories of commands in the `install' - rule: normal, pre-install and post-install. - - -File: standards.info, Node: Makefile Basics, Next: Utilities in Makefiles, Up: Makefile Conventions - -7.2.1 General Conventions for Makefiles ---------------------------------------- - -Every Makefile should contain this line: - - SHELL = /bin/sh - -to avoid trouble on systems where the `SHELL' variable might be -inherited from the environment. (This is never a problem with GNU -`make'.) - - Different `make' programs have incompatible suffix lists and -implicit rules, and this sometimes creates confusion or misbehavior. So -it is a good idea to set the suffix list explicitly using only the -suffixes you need in the particular Makefile, like this: - - .SUFFIXES: - .SUFFIXES: .c .o - -The first line clears out the suffix list, the second introduces all -suffixes which may be subject to implicit rules in this Makefile. - - Don't assume that `.' is in the path for command execution. When -you need to run programs that are a part of your package during the -make, please make sure that it uses `./' if the program is built as -part of the make or `$(srcdir)/' if the file is an unchanging part of -the source code. Without one of these prefixes, the current search -path is used. - - The distinction between `./' (the "build directory") and -`$(srcdir)/' (the "source directory") is important because users can -build in a separate directory using the `--srcdir' option to -`configure'. A rule of the form: - - foo.1 : foo.man sedscript - sed -e sedscript foo.man > foo.1 - -will fail when the build directory is not the source directory, because -`foo.man' and `sedscript' are in the source directory. - - When using GNU `make', relying on `VPATH' to find the source file -will work in the case where there is a single dependency file, since -the `make' automatic variable `$<' will represent the source file -wherever it is. (Many versions of `make' set `$<' only in implicit -rules.) A Makefile target like - - foo.o : bar.c - $(CC) -I. -I$(srcdir) $(CFLAGS) -c bar.c -o foo.o - -should instead be written as - - foo.o : bar.c - $(CC) -I. -I$(srcdir) $(CFLAGS) -c $< -o $@ - -in order to allow `VPATH' to work correctly. When the target has -multiple dependencies, using an explicit `$(srcdir)' is the easiest way -to make the rule work well. For example, the target above for `foo.1' -is best written as: - - foo.1 : foo.man sedscript - sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@ - - GNU distributions usually contain some files which are not source -files--for example, Info files, and the output from Autoconf, Automake, -Bison or Flex. Since these files normally appear in the source -directory, they should always appear in the source directory, not in the -build directory. So Makefile rules to update them should put the -updated files in the source directory. - - However, if a file does not appear in the distribution, then the -Makefile should not put it in the source directory, because building a -program in ordinary circumstances should not modify the source directory -in any way. - - Try to make the build and installation targets, at least (and all -their subtargets) work correctly with a parallel `make'. - - -File: standards.info, Node: Utilities in Makefiles, Next: Command Variables, Prev: Makefile Basics, Up: Makefile Conventions - -7.2.2 Utilities in Makefiles ----------------------------- - -Write the Makefile commands (and any shell scripts, such as -`configure') to run in `sh', not in `csh'. Don't use any special -features of `ksh' or `bash'. - - The `configure' script and the Makefile rules for building and -installation should not use any utilities directly except these: - - cat cmp cp diff echo egrep expr false grep install-info - ln ls mkdir mv pwd rm rmdir sed sleep sort tar test touch true - - The compression program `gzip' can be used in the `dist' rule. - - Stick to the generally supported options for these programs. For -example, don't use `mkdir -p', convenient as it may be, because most -systems don't support it. - - It is a good idea to avoid creating symbolic links in makefiles, -since a few systems don't support them. - - The Makefile rules for building and installation can also use -compilers and related programs, but should do so via `make' variables -so that the user can substitute alternatives. Here are some of the -programs we mean: - - ar bison cc flex install ld ldconfig lex - make makeinfo ranlib texi2dvi yacc - - Use the following `make' variables to run those programs: - - $(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LDCONFIG) $(LEX) - $(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC) - - When you use `ranlib' or `ldconfig', you should make sure nothing -bad happens if the system does not have the program in question. -Arrange to ignore an error from that command, and print a message before -the command to tell the user that failure of this command does not mean -a problem. (The Autoconf `AC_PROG_RANLIB' macro can help with this.) - - If you use symbolic links, you should implement a fallback for -systems that don't have symbolic links. - - Additional utilities that can be used via Make variables are: - - chgrp chmod chown mknod - - It is ok to use other utilities in Makefile portions (or scripts) -intended only for particular systems where you know those utilities -exist. - - -File: standards.info, Node: Command Variables, Next: Directory Variables, Prev: Utilities in Makefiles, Up: Makefile Conventions - -7.2.3 Variables for Specifying Commands ---------------------------------------- - -Makefiles should provide variables for overriding certain commands, -options, and so on. - - In particular, you should run most utility programs via variables. -Thus, if you use Bison, have a variable named `BISON' whose default -value is set with `BISON = bison', and refer to it with `$(BISON)' -whenever you need to use Bison. - - File management utilities such as `ln', `rm', `mv', and so on, need -not be referred to through variables in this way, since users don't -need to replace them with other programs. - - Each program-name variable should come with an options variable that -is used to supply options to the program. Append `FLAGS' to the -program-name variable name to get the options variable name--for -example, `BISONFLAGS'. (The names `CFLAGS' for the C compiler, -`YFLAGS' for yacc, and `LFLAGS' for lex, are exceptions to this rule, -but we keep them because they are standard.) Use `CPPFLAGS' in any -compilation command that runs the preprocessor, and use `LDFLAGS' in -any compilation command that does linking as well as in any direct use -of `ld'. - - If there are C compiler options that _must_ be used for proper -compilation of certain files, do not include them in `CFLAGS'. Users -expect to be able to specify `CFLAGS' freely themselves. Instead, -arrange to pass the necessary options to the C compiler independently -of `CFLAGS', by writing them explicitly in the compilation commands or -by defining an implicit rule, like this: - - CFLAGS = -g - ALL_CFLAGS = -I. $(CFLAGS) - .c.o: - $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< - - Do include the `-g' option in `CFLAGS', because that is not -_required_ for proper compilation. You can consider it a default that -is only recommended. If the package is set up so that it is compiled -with GCC by default, then you might as well include `-O' in the default -value of `CFLAGS' as well. - - Put `CFLAGS' last in the compilation command, after other variables -containing compiler options, so the user can use `CFLAGS' to override -the others. - - `CFLAGS' should be used in every invocation of the C compiler, both -those which do compilation and those which do linking. - - Every Makefile should define the variable `INSTALL', which is the -basic command for installing a file into the system. - - Every Makefile should also define the variables `INSTALL_PROGRAM' -and `INSTALL_DATA'. (The default for `INSTALL_PROGRAM' should be -`$(INSTALL)'; the default for `INSTALL_DATA' should be `${INSTALL} -m -644'.) Then it should use those variables as the commands for actual -installation, for executables and nonexecutables respectively. Use -these variables as follows: - - $(INSTALL_PROGRAM) foo $(bindir)/foo - $(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a - - Optionally, you may prepend the value of `DESTDIR' to the target -filename. Doing this allows the installer to create a snapshot of the -installation to be copied onto the real target filesystem later. Do not -set the value of `DESTDIR' in your Makefile, and do not include it in -any installed files. With support for `DESTDIR', the above examples -become: - - $(INSTALL_PROGRAM) foo $(DESTDIR)$(bindir)/foo - $(INSTALL_DATA) libfoo.a $(DESTDIR)$(libdir)/libfoo.a - -Always use a file name, not a directory name, as the second argument of -the installation commands. Use a separate command for each file to be -installed. - - -File: standards.info, Node: Directory Variables, Next: Standard Targets, Prev: Command Variables, Up: Makefile Conventions - -7.2.4 Variables for Installation Directories --------------------------------------------- - -Installation directories should always be named by variables, so it is -easy to install in a nonstandard place. The standard names for these -variables are described below. They are based on a standard filesystem -layout; variants of it are used in SVR4, 4.4BSD, GNU/Linux, Ultrix v4, -and other modern operating systems. - - These two variables set the root for the installation. All the other -installation directories should be subdirectories of one of these two, -and nothing should be directly installed into these two directories. - -`prefix' - A prefix used in constructing the default values of the variables - listed below. The default value of `prefix' should be - `/usr/local'. When building the complete GNU system, the prefix - will be empty and `/usr' will be a symbolic link to `/'. (If you - are using Autoconf, write it as `@prefix@'.) - - Running `make install' with a different value of `prefix' from the - one used to build the program should _not_ recompile the program. - -`exec_prefix' - A prefix used in constructing the default values of some of the - variables listed below. The default value of `exec_prefix' should - be `$(prefix)'. (If you are using Autoconf, write it as - `@exec_prefix@'.) - - Generally, `$(exec_prefix)' is used for directories that contain - machine-specific files (such as executables and subroutine - libraries), while `$(prefix)' is used directly for other - directories. - - Running `make install' with a different value of `exec_prefix' - from the one used to build the program should _not_ recompile the - program. - - Executable programs are installed in one of the following -directories. - -`bindir' - The directory for installing executable programs that users can - run. This should normally be `/usr/local/bin', but write it as - `$(exec_prefix)/bin'. (If you are using Autoconf, write it as - `@bindir@'.) - -`sbindir' - The directory for installing executable programs that can be run - from the shell, but are only generally useful to system - administrators. This should normally be `/usr/local/sbin', but - write it as `$(exec_prefix)/sbin'. (If you are using Autoconf, - write it as `@sbindir@'.) - -`libexecdir' - The directory for installing executable programs to be run by other - programs rather than by users. This directory should normally be - `/usr/local/libexec', but write it as `$(exec_prefix)/libexec'. - (If you are using Autoconf, write it as `@libexecdir@'.) - - Data files used by the program during its execution are divided into -categories in two ways. - - * Some files are normally modified by programs; others are never - normally modified (though users may edit some of these). - - * Some files are architecture-independent and can be shared by all - machines at a site; some are architecture-dependent and can be - shared only by machines of the same kind and operating system; - others may never be shared between two machines. - - This makes for six different possibilities. However, we want to -discourage the use of architecture-dependent files, aside from object -files and libraries. It is much cleaner to make other data files -architecture-independent, and it is generally not hard. - - Therefore, here are the variables Makefiles should use to specify -directories: - -`datadir' - The directory for installing read-only architecture independent - data files. This should normally be `/usr/local/share', but write - it as `$(prefix)/share'. (If you are using Autoconf, write it as - `@datadir@'.) As a special exception, see `$(infodir)' and - `$(includedir)' below. - -`sysconfdir' - The directory for installing read-only data files that pertain to a - single machine-that is to say, files for configuring a host. - Mailer and network configuration files, `/etc/passwd', and so - forth belong here. All the files in this directory should be - ordinary ASCII text files. This directory should normally be - `/usr/local/etc', but write it as `$(prefix)/etc'. (If you are - using Autoconf, write it as `@sysconfdir@'.) - - Do not install executables here in this directory (they probably - belong in `$(libexecdir)' or `$(sbindir)'). Also do not install - files that are modified in the normal course of their use (programs - whose purpose is to change the configuration of the system - excluded). Those probably belong in `$(localstatedir)'. - -`sharedstatedir' - The directory for installing architecture-independent data files - which the programs modify while they run. This should normally be - `/usr/local/com', but write it as `$(prefix)/com'. (If you are - using Autoconf, write it as `@sharedstatedir@'.) - -`localstatedir' - The directory for installing data files which the programs modify - while they run, and that pertain to one specific machine. Users - should never need to modify files in this directory to configure - the package's operation; put such configuration information in - separate files that go in `$(datadir)' or `$(sysconfdir)'. - `$(localstatedir)' should normally be `/usr/local/var', but write - it as `$(prefix)/var'. (If you are using Autoconf, write it as - `@localstatedir@'.) - -`libdir' - The directory for object files and libraries of object code. Do - not install executables here, they probably ought to go in - `$(libexecdir)' instead. The value of `libdir' should normally be - `/usr/local/lib', but write it as `$(exec_prefix)/lib'. (If you - are using Autoconf, write it as `@libdir@'.) - -`infodir' - The directory for installing the Info files for this package. By - default, it should be `/usr/local/info', but it should be written - as `$(prefix)/info'. (If you are using Autoconf, write it as - `@infodir@'.) - -`lispdir' - The directory for installing any Emacs Lisp files in this package. - By default, it should be `/usr/local/share/emacs/site-lisp', but - it should be written as `$(prefix)/share/emacs/site-lisp'. - - If you are using Autoconf, write the default as `@lispdir@'. In - order to make `@lispdir@' work, you need the following lines in - your `configure.in' file: - - lispdir='${datadir}/emacs/site-lisp' - AC_SUBST(lispdir) - -`includedir' - The directory for installing header files to be included by user - programs with the C `#include' preprocessor directive. This - should normally be `/usr/local/include', but write it as - `$(prefix)/include'. (If you are using Autoconf, write it as - `@includedir@'.) - - Most compilers other than GCC do not look for header files in - directory `/usr/local/include'. So installing the header files - this way is only useful with GCC. Sometimes this is not a problem - because some libraries are only really intended to work with GCC. - But some libraries are intended to work with other compilers. - They should install their header files in two places, one - specified by `includedir' and one specified by `oldincludedir'. - -`oldincludedir' - The directory for installing `#include' header files for use with - compilers other than GCC. This should normally be `/usr/include'. - (If you are using Autoconf, you can write it as `@oldincludedir@'.) - - The Makefile commands should check whether the value of - `oldincludedir' is empty. If it is, they should not try to use - it; they should cancel the second installation of the header files. - - A package should not replace an existing header in this directory - unless the header came from the same package. Thus, if your Foo - package provides a header file `foo.h', then it should install the - header file in the `oldincludedir' directory if either (1) there - is no `foo.h' there or (2) the `foo.h' that exists came from the - Foo package. - - To tell whether `foo.h' came from the Foo package, put a magic - string in the file--part of a comment--and `grep' for that string. - - Unix-style man pages are installed in one of the following: - -`mandir' - The top-level directory for installing the man pages (if any) for - this package. It will normally be `/usr/local/man', but you should - write it as `$(prefix)/man'. (If you are using Autoconf, write it - as `@mandir@'.) - -`man1dir' - The directory for installing section 1 man pages. Write it as - `$(mandir)/man1'. - -`man2dir' - The directory for installing section 2 man pages. Write it as - `$(mandir)/man2' - -`...' - *Don't make the primary documentation for any GNU software be a - man page. Write a manual in Texinfo instead. Man pages are just - for the sake of people running GNU software on Unix, which is a - secondary application only.* - -`manext' - The file name extension for the installed man page. This should - contain a period followed by the appropriate digit; it should - normally be `.1'. - -`man1ext' - The file name extension for installed section 1 man pages. - -`man2ext' - The file name extension for installed section 2 man pages. - -`...' - Use these names instead of `manext' if the package needs to - install man pages in more than one section of the manual. - - And finally, you should set the following variable: - -`srcdir' - The directory for the sources being compiled. The value of this - variable is normally inserted by the `configure' shell script. - (If you are using Autconf, use `srcdir = @srcdir@'.) - - For example: - - # Common prefix for installation directories. - # NOTE: This directory must exist when you start the install. - prefix = /usr/local - exec_prefix = $(prefix) - # Where to put the executable for the command `gcc'. - bindir = $(exec_prefix)/bin - # Where to put the directories used by the compiler. - libexecdir = $(exec_prefix)/libexec - # Where to put the Info files. - infodir = $(prefix)/info - - If your program installs a large number of files into one of the -standard user-specified directories, it might be useful to group them -into a subdirectory particular to that program. If you do this, you -should write the `install' rule to create these subdirectories. - - Do not expect the user to include the subdirectory name in the value -of any of the variables listed above. The idea of having a uniform set -of variable names for installation directories is to enable the user to -specify the exact same values for several different GNU packages. In -order for this to be useful, all the packages must be designed so that -they will work sensibly when the user does so. - - -File: standards.info, Node: Standard Targets, Next: Install Command Categories, Prev: Directory Variables, Up: Makefile Conventions - -7.2.5 Standard Targets for Users --------------------------------- - -All GNU programs should have the following targets in their Makefiles: - -`all' - Compile the entire program. This should be the default target. - This target need not rebuild any documentation files; Info files - should normally be included in the distribution, and DVI files - should be made only when explicitly asked for. - - By default, the Make rules should compile and link with `-g', so - that executable programs have debugging symbols. Users who don't - mind being helpless can strip the executables later if they wish. - -`install' - Compile the program and copy the executables, libraries, and so on - to the file names where they should reside for actual use. If - there is a simple test to verify that a program is properly - installed, this target should run that test. - - Do not strip executables when installing them. Devil-may-care - users can use the `install-strip' target to do that. - - If possible, write the `install' target rule so that it does not - modify anything in the directory where the program was built, - provided `make all' has just been done. This is convenient for - building the program under one user name and installing it under - another. - - The commands should create all the directories in which files are - to be installed, if they don't already exist. This includes the - directories specified as the values of the variables `prefix' and - `exec_prefix', as well as all subdirectories that are needed. One - way to do this is by means of an `installdirs' target as described - below. - - Use `-' before any command for installing a man page, so that - `make' will ignore any errors. This is in case there are systems - that don't have the Unix man page documentation system installed. - - The way to install Info files is to copy them into `$(infodir)' - with `$(INSTALL_DATA)' (*note Command Variables::), and then run - the `install-info' program if it is present. `install-info' is a - program that edits the Info `dir' file to add or update the menu - entry for the given Info file; it is part of the Texinfo package. - Here is a sample rule to install an Info file: - - $(DESTDIR)$(infodir)/foo.info: foo.info - $(POST_INSTALL) - # There may be a newer info file in . than in srcdir. - -if test -f foo.info; then d=.; \ - else d=$(srcdir); fi; \ - $(INSTALL_DATA) $$d/foo.info $(DESTDIR)$@; \ - # Run install-info only if it exists. - # Use `if' instead of just prepending `-' to the - # line so we notice real errors from install-info. - # We use `$(SHELL) -c' because some shells do not - # fail gracefully when there is an unknown command. - if $(SHELL) -c 'install-info --version' \ - >/dev/null 2>&1; then \ - install-info --dir-file=$(DESTDIR)$(infodir)/dir \ - $(DESTDIR)$(infodir)/foo.info; \ - else true; fi - - When writing the `install' target, you must classify all the - commands into three categories: normal ones, "pre-installation" - commands and "post-installation" commands. *Note Install Command - Categories::. - -`uninstall' - Delete all the installed files--the copies that the `install' - target creates. - - This rule should not modify the directories where compilation is - done, only the directories where files are installed. - - The uninstallation commands are divided into three categories, - just like the installation commands. *Note Install Command - Categories::. - -`install-strip' - Like `install', but strip the executable files while installing - them. In simple cases, this target can use the `install' target in - a simple way: - - install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \ - install - - But if the package installs scripts as well as real executables, - the `install-strip' target can't just refer to the `install' - target; it has to strip the executables but not the scripts. - - `install-strip' should not strip the executables in the build - directory which are being copied for installation. It should only - strip the copies that are installed. - - Normally we do not recommend stripping an executable unless you - are sure the program has no bugs. However, it can be reasonable - to install a stripped executable for actual execution while saving - the unstripped executable elsewhere in case there is a bug. - -`clean' - Delete all files from the current directory that are normally - created by building the program. Don't delete the files that - record the configuration. Also preserve files that could be made - by building, but normally aren't because the distribution comes - with them. - - Delete `.dvi' files here if they are not part of the distribution. - -`distclean' - Delete all files from the current directory that are created by - configuring or building the program. If you have unpacked the - source and built the program without creating any other files, - `make distclean' should leave only the files that were in the - distribution. - -`mostlyclean' - Like `clean', but may refrain from deleting a few files that people - normally don't want to recompile. For example, the `mostlyclean' - target for GCC does not delete `libgcc.a', because recompiling it - is rarely necessary and takes a lot of time. - -`maintainer-clean' - Delete almost everything from the current directory that can be - reconstructed with this Makefile. This typically includes - everything deleted by `distclean', plus more: C source files - produced by Bison, tags tables, Info files, and so on. - - The reason we say "almost everything" is that running the command - `make maintainer-clean' should not delete `configure' even if - `configure' can be remade using a rule in the Makefile. More - generally, `make maintainer-clean' should not delete anything that - needs to exist in order to run `configure' and then begin to build - the program. This is the only exception; `maintainer-clean' should - delete everything else that can be rebuilt. - - The `maintainer-clean' target is intended to be used by a - maintainer of the package, not by ordinary users. You may need - special tools to reconstruct some of the files that `make - maintainer-clean' deletes. Since these files are normally - included in the distribution, we don't take care to make them easy - to reconstruct. If you find you need to unpack the full - distribution again, don't blame us. - - To help make users aware of this, the commands for the special - `maintainer-clean' target should start with these two: - - @echo 'This command is intended for maintainers to use; it' - @echo 'deletes files that may need special tools to rebuild.' - -`TAGS' - Update a tags table for this program. - -`info' - Generate any Info files needed. The best way to write the rules - is as follows: - - info: foo.info - - foo.info: foo.texi chap1.texi chap2.texi - $(MAKEINFO) $(srcdir)/foo.texi - - You must define the variable `MAKEINFO' in the Makefile. It should - run the `makeinfo' program, which is part of the Texinfo - distribution. - - Normally a GNU distribution comes with Info files, and that means - the Info files are present in the source directory. Therefore, - the Make rule for an info file should update it in the source - directory. When users build the package, ordinarily Make will not - update the Info files because they will already be up to date. - -`dvi' - Generate DVI files for all Texinfo documentation. For example: - - dvi: foo.dvi - - foo.dvi: foo.texi chap1.texi chap2.texi - $(TEXI2DVI) $(srcdir)/foo.texi - - You must define the variable `TEXI2DVI' in the Makefile. It should - run the program `texi2dvi', which is part of the Texinfo - distribution.(1) Alternatively, write just the dependencies, and - allow GNU `make' to provide the command. - -`dist' - Create a distribution tar file for this program. The tar file - should be set up so that the file names in the tar file start with - a subdirectory name which is the name of the package it is a - distribution for. This name can include the version number. - - For example, the distribution tar file of GCC version 1.40 unpacks - into a subdirectory named `gcc-1.40'. - - The easiest way to do this is to create a subdirectory - appropriately named, use `ln' or `cp' to install the proper files - in it, and then `tar' that subdirectory. - - Compress the tar file with `gzip'. For example, the actual - distribution file for GCC version 1.40 is called `gcc-1.40.tar.gz'. - - The `dist' target should explicitly depend on all non-source files - that are in the distribution, to make sure they are up to date in - the distribution. *Note Making Releases: Releases. - -`check' - Perform self-tests (if any). The user must build the program - before running the tests, but need not install the program; you - should write the self-tests so that they work when the program is - built but not installed. - - The following targets are suggested as conventional names, for -programs in which they are useful. - -`installcheck' - Perform installation tests (if any). The user must build and - install the program before running the tests. You should not - assume that `$(bindir)' is in the search path. - -`installdirs' - It's useful to add a target named `installdirs' to create the - directories where files are installed, and their parent - directories. There is a script called `mkinstalldirs' which is - convenient for this; you can find it in the Texinfo package. You - can use a rule like this: - - # Make sure all installation directories (e.g. $(bindir)) - # actually exist by making them if necessary. - installdirs: mkinstalldirs - $(srcdir)/mkinstalldirs $(bindir) $(datadir) \ - $(libdir) $(infodir) \ - $(mandir) - - or, if you wish to support `DESTDIR', - - # Make sure all installation directories (e.g. $(bindir)) - # actually exist by making them if necessary. - installdirs: mkinstalldirs - $(srcdir)/mkinstalldirs \ - $(DESTDIR)$(bindir) $(DESTDIR)$(datadir) \ - $(DESTDIR)$(libdir) $(DESTDIR)$(infodir) \ - $(DESTDIR)$(mandir) - - This rule should not modify the directories where compilation is - done. It should do nothing but create installation directories. - - ---------- Footnotes ---------- - - (1) `texi2dvi' uses TeX to do the real work of formatting. TeX is -not distributed with Texinfo. - - -File: standards.info, Node: Install Command Categories, Prev: Standard Targets, Up: Makefile Conventions - -7.2.6 Install Command Categories --------------------------------- - -When writing the `install' target, you must classify all the commands -into three categories: normal ones, "pre-installation" commands and -"post-installation" commands. - - Normal commands move files into their proper places, and set their -modes. They may not alter any files except the ones that come entirely -from the package they belong to. - - Pre-installation and post-installation commands may alter other -files; in particular, they can edit global configuration files or data -bases. - - Pre-installation commands are typically executed before the normal -commands, and post-installation commands are typically run after the -normal commands. - - The most common use for a post-installation command is to run -`install-info'. This cannot be done with a normal command, since it -alters a file (the Info directory) which does not come entirely and -solely from the package being installed. It is a post-installation -command because it needs to be done after the normal command which -installs the package's Info files. - - Most programs don't need any pre-installation commands, but we have -the feature just in case it is needed. - - To classify the commands in the `install' rule into these three -categories, insert "category lines" among them. A category line -specifies the category for the commands that follow. - - A category line consists of a tab and a reference to a special Make -variable, plus an optional comment at the end. There are three -variables you can use, one for each category; the variable name -specifies the category. Category lines are no-ops in ordinary execution -because these three Make variables are normally undefined (and you -_should not_ define them in the makefile). - - Here are the three possible category lines, each with a comment that -explains what it means: - - $(PRE_INSTALL) # Pre-install commands follow. - $(POST_INSTALL) # Post-install commands follow. - $(NORMAL_INSTALL) # Normal commands follow. - - If you don't use a category line at the beginning of the `install' -rule, all the commands are classified as normal until the first category -line. If you don't use any category lines, all the commands are -classified as normal. - - These are the category lines for `uninstall': - - $(PRE_UNINSTALL) # Pre-uninstall commands follow. - $(POST_UNINSTALL) # Post-uninstall commands follow. - $(NORMAL_UNINSTALL) # Normal commands follow. - - Typically, a pre-uninstall command would be used for deleting entries -from the Info directory. - - If the `install' or `uninstall' target has any dependencies which -act as subroutines of installation, then you should start _each_ -dependency's commands with a category line, and start the main target's -commands with a category line also. This way, you can ensure that each -command is placed in the right category regardless of which of the -dependencies actually run. - - Pre-installation and post-installation commands should not run any -programs except for these: - - [ basename bash cat chgrp chmod chown cmp cp dd diff echo - egrep expand expr false fgrep find getopt grep gunzip gzip - hostname install install-info kill ldconfig ln ls md5sum - mkdir mkfifo mknod mv printenv pwd rm rmdir sed sort tee - test touch true uname xargs yes - - The reason for distinguishing the commands in this way is for the -sake of making binary packages. Typically a binary package contains -all the executables and other files that need to be installed, and has -its own method of installing them--so it does not need to run the normal -installation commands. But installing the binary package does need to -execute the pre-installation and post-installation commands. - - Programs to build binary packages work by extracting the -pre-installation and post-installation commands. Here is one way of -extracting the pre-installation commands: - - make -n install -o all \ - PRE_INSTALL=pre-install \ - POST_INSTALL=post-install \ - NORMAL_INSTALL=normal-install \ - | gawk -f pre-install.awk - -where the file `pre-install.awk' could contain this: - - $0 ~ /^\t[ \t]*(normal_install|post_install)[ \t]*$/ {on = 0} - on {print $0} - $0 ~ /^\t[ \t]*pre_install[ \t]*$/ {on = 1} - - The resulting file of pre-installation commands is executed as a -shell script as part of installing the binary package. - - -File: standards.info, Node: Releases, Prev: Makefile Conventions, Up: Managing Releases - -7.3 Making Releases -=================== - -Package the distribution of `Foo version 69.96' up in a gzipped tar -file with the name `foo-69.96.tar.gz'. It should unpack into a -subdirectory named `foo-69.96'. - - Building and installing the program should never modify any of the -files contained in the distribution. This means that all the files -that form part of the program in any way must be classified into "source -files" and "non-source files". Source files are written by humans and -never changed automatically; non-source files are produced from source -files by programs under the control of the Makefile. - - The distribution should contain a file named `README' which gives -the name of the package, and a general description of what it does. It -is also good to explain the purpose of each of the first-level -subdirectories in the package, if there are any. The `README' file -should either state the version number of the package, or refer to where -in the package it can be found. - - The `README' file should refer to the file `INSTALL', which should -contain an explanation of the installation procedure. - - The `README' file should also refer to the file which contains the -copying conditions. The GNU GPL, if used, should be in a file called -`COPYING'. If the GNU LGPL is used, it should be in a file called -`COPYING.LIB'. - - Naturally, all the source files must be in the distribution. It is -okay to include non-source files in the distribution, provided they are -up-to-date and machine-independent, so that building the distribution -normally will never modify them. We commonly include non-source files -produced by Bison, `lex', TeX, and `makeinfo'; this helps avoid -unnecessary dependencies between our distributions, so that users can -install whichever packages they want to install. - - Non-source files that might actually be modified by building and -installing the program should *never* be included in the distribution. -So if you do distribute non-source files, always make sure they are up -to date when you make a new distribution. - - Make sure that the directory into which the distribution unpacks (as -well as any subdirectories) are all world-writable (octal mode 777). -This is so that old versions of `tar' which preserve the ownership and -permissions of the files from the tar archive will be able to extract -all the files even if the user is unprivileged. - - Make sure that all the files in the distribution are world-readable. - - Make sure that no file name in the distribution is more than 14 -characters long. Likewise, no file created by building the program -should have a name longer than 14 characters. The reason for this is -that some systems adhere to a foolish interpretation of the POSIX -standard, and refuse to open a longer name, rather than truncating as -they did in the past. - - Don't include any symbolic links in the distribution itself. If the -tar file contains symbolic links, then people cannot even unpack it on -systems that don't support symbolic links. Also, don't use multiple -names for one file in different directories, because certain file -systems cannot handle this and that prevents unpacking the distribution. - - Try to make sure that all the file names will be unique on MS-DOS. A -name on MS-DOS consists of up to 8 characters, optionally followed by a -period and up to three characters. MS-DOS will truncate extra -characters both before and after the period. Thus, `foobarhacker.c' -and `foobarhacker.o' are not ambiguous; they are truncated to -`foobarha.c' and `foobarha.o', which are distinct. - - Include in your distribution a copy of the `texinfo.tex' you used to -test print any `*.texinfo' or `*.texi' files. - - Likewise, if your program uses small GNU software packages like -regex, getopt, obstack, or termcap, include them in the distribution -file. Leaving them out would make the distribution file a little -smaller at the expense of possible inconvenience to a user who doesn't -know what other files to get. - - -File: standards.info, Node: References, Next: Copying This Manual, Prev: Managing Releases, Up: Top - -8 References to Non-Free Software and Documentation -*************************************************** - -A GNU program should not recommend use of any non-free program. We -can't stop some people from writing proprietary programs, or stop other -people from using them, but we can and should avoid helping to -advertise them to new potential customers. Proprietary software is a -social and ethical problem, and the point of GNU is to solve that -problem. - - When a non-free program or system is well known, you can mention it -in passing--that is harmless, since users who might want to use it -probably already know about it. For instance, it is fine to explain -how to build your package on top of some non-free operating system, or -how to use it together with some widely used non-free program. - - However, you should give only the necessary information to help those -who already use the non-free program to use your program with it--don't -give, or refer to, any further information about the proprietary -program, and don't imply that the proprietary program enhances your -program, or that its existence is in any way a good thing. The goal -should be that people already using the proprietary program will get -the advice they need about how to use your free program, while people -who don't already use the proprietary program will not see anything to -lead them to take an interest in it. - - If a non-free program or system is obscure in your program's domain, -your program should not mention or support it at all, since doing so -would tend to popularize the non-free program more than it popularizes -your program. (You cannot hope to find many additional users among the -users of Foobar if the users of Foobar are few.) - - A GNU package should not refer the user to any non-free documentation -for free software. Free documentation that can be included in free -operating systems is essential for completing the GNU system, so it is -a major focus of the GNU Project; to recommend use of documentation -that we are not allowed to use in GNU would undermine the efforts to -get documentation that we can include. So GNU packages should never -recommend non-free documentation. - - -File: standards.info, Node: Copying This Manual, Next: Index, Prev: References, Up: Top - -Appendix A Copying This Manual -****************************** - -* Menu: - -* GNU Free Documentation License:: License for copying this manual - - -File: standards.info, Node: GNU Free Documentation License, Up: Copying This Manual - -Appendix B GNU Free Documentation License -***************************************** - - Version 1.1, March 2000 - - Copyright (C) 2000 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - 0. PREAMBLE - - The purpose of this License is to make a manual, textbook, or other - written document "free" in the sense of freedom: to assure everyone - the effective freedom to copy and redistribute it, with or without - modifying it, either commercially or noncommercially. Secondarily, - this License preserves for the author and publisher a way to get - credit for their work, while not being considered responsible for - modifications made by others. - - This License is a kind of "copyleft", which means that derivative - works of the document must themselves be free in the same sense. - It complements the GNU General Public License, which is a copyleft - license designed for free software. - - We have designed this License in order to use it for manuals for - free software, because free software needs free documentation: a - free program should come with manuals providing the same freedoms - that the software does. But this License is not limited to - software manuals; it can be used for any textual work, regardless - of subject matter or whether it is published as a printed book. - We recommend this License principally for works whose purpose is - instruction or reference. - - - 1. APPLICABILITY AND DEFINITIONS - - This License applies to any manual or other work that contains a - notice placed by the copyright holder saying it can be distributed - under the terms of this License. The "Document", below, refers to - any such manual or work. Any member of the public is a licensee, - and is addressed as "you." - - A "Modified Version" of the Document means any work containing the - Document or a portion of it, either copied verbatim, or with - modifications and/or translated into another language. - - A "Secondary Section" is a named appendix or a front-matter - section of the Document that deals exclusively with the - relationship of the publishers or authors of the Document to the - Document's overall subject (or to related matters) and contains - nothing that could fall directly within that overall subject. - (For example, if the Document is in part a textbook of - mathematics, a Secondary Section may not explain any mathematics.) - The relationship could be a matter of historical connection with - the subject or with related matters, or of legal, commercial, - philosophical, ethical or political position regarding them. - - The "Invariant Sections" are certain Secondary Sections whose - titles are designated, as being those of Invariant Sections, in - the notice that says that the Document is released under this - License. - - The "Cover Texts" are certain short passages of text that are - listed, as Front-Cover Texts or Back-Cover Texts, in the notice - that says that the Document is released under this License. - - A "Transparent" copy of the Document means a machine-readable copy, - represented in a format whose specification is available to the - general public, whose contents can be viewed and edited directly - and straightforwardly with generic text editors or (for images - composed of pixels) generic paint programs or (for drawings) some - widely available drawing editor, and that is suitable for input to - text formatters or for automatic translation to a variety of - formats suitable for input to text formatters. A copy made in an - otherwise Transparent file format whose markup has been designed - to thwart or discourage subsequent modification by readers is not - Transparent. A copy that is not "Transparent" is called "Opaque." - - Examples of suitable formats for Transparent copies include plain - ASCII without markup, Texinfo input format, LaTeX input format, - SGML or XML using a publicly available DTD, and - standard-conforming simple HTML designed for human modification. - Opaque formats include PostScript, PDF, proprietary formats that - can be read and edited only by proprietary word processors, SGML - or XML for which the DTD and/or processing tools are not generally - available, and the machine-generated HTML produced by some word - processors for output purposes only. - - The "Title Page" means, for a printed book, the title page itself, - plus such following pages as are needed to hold, legibly, the - material this License requires to appear in the title page. For - works in formats which do not have any title page as such, "Title - Page" means the text near the most prominent appearance of the - work's title, preceding the beginning of the body of the text. - - 2. VERBATIM COPYING - - You may copy and distribute the Document in any medium, either - commercially or noncommercially, provided that this License, the - copyright notices, and the license notice saying this License - applies to the Document are reproduced in all copies, and that you - add no other conditions whatsoever to those of this License. You - may not use technical measures to obstruct or control the reading - or further copying of the copies you make or distribute. However, - you may accept compensation in exchange for copies. If you - distribute a large enough number of copies you must also follow - the conditions in section 3. - - You may also lend copies, under the same conditions stated above, - and you may publicly display copies. - - 3. COPYING IN QUANTITY - - If you publish printed copies of the Document numbering more than - 100, and the Document's license notice requires Cover Texts, you - must enclose the copies in covers that carry, clearly and legibly, - all these Cover Texts: Front-Cover Texts on the front cover, and - Back-Cover Texts on the back cover. Both covers must also clearly - and legibly identify you as the publisher of these copies. The - front cover must present the full title with all words of the - title equally prominent and visible. You may add other material - on the covers in addition. Copying with changes limited to the - covers, as long as they preserve the title of the Document and - satisfy these conditions, can be treated as verbatim copying in - other respects. - - If the required texts for either cover are too voluminous to fit - legibly, you should put the first ones listed (as many as fit - reasonably) on the actual cover, and continue the rest onto - adjacent pages. - - If you publish or distribute Opaque copies of the Document - numbering more than 100, you must either include a - machine-readable Transparent copy along with each Opaque copy, or - state in or with each Opaque copy a publicly-accessible - computer-network location containing a complete Transparent copy - of the Document, free of added material, which the general - network-using public has access to download anonymously at no - charge using public-standard network protocols. If you use the - latter option, you must take reasonably prudent steps, when you - begin distribution of Opaque copies in quantity, to ensure that - this Transparent copy will remain thus accessible at the stated - location until at least one year after the last time you - distribute an Opaque copy (directly or through your agents or - retailers) of that edition to the public. - - It is requested, but not required, that you contact the authors of - the Document well before redistributing any large number of - copies, to give them a chance to provide you with an updated - version of the Document. - - 4. MODIFICATIONS - - You may copy and distribute a Modified Version of the Document - under the conditions of sections 2 and 3 above, provided that you - release the Modified Version under precisely this License, with - the Modified Version filling the role of the Document, thus - licensing distribution and modification of the Modified Version to - whoever possesses a copy of it. In addition, you must do these - things in the Modified Version: - - A. Use in the Title Page (and on the covers, if any) a title - distinct from that of the Document, and from those of previous - versions (which should, if there were any, be listed in the - History section of the Document). You may use the same title - as a previous version if the original publisher of that version - gives permission. - B. List on the Title Page, as authors, one or more persons or - entities responsible for authorship of the modifications in the - Modified Version, together with at least five of the principal - authors of the Document (all of its principal authors, if it - has less than five). - C. State on the Title page the name of the publisher of the - Modified Version, as the publisher. - D. Preserve all the copyright notices of the Document. - E. Add an appropriate copyright notice for your modifications - adjacent to the other copyright notices. - F. Include, immediately after the copyright notices, a license - notice giving the public permission to use the Modified Version - under the terms of this License, in the form shown in the - Addendum below. - G. Preserve in that license notice the full lists of Invariant - Sections and required Cover Texts given in the Document's - license notice. - H. Include an unaltered copy of this License. - I. Preserve the section entitled "History", and its title, and add - to it an item stating at least the title, year, new authors, and - publisher of the Modified Version as given on the Title Page. - If there is no section entitled "History" in the Document, - create one stating the title, year, authors, and publisher of - the Document as given on its Title Page, then add an item - describing the Modified Version as stated in the previous - sentence. - J. Preserve the network location, if any, given in the Document for - public access to a Transparent copy of the Document, and - likewise the network locations given in the Document for - previous versions it was based on. These may be placed in the - "History" section. You may omit a network location for a work - that was published at least four years before the Document - itself, or if the original publisher of the version it refers - to gives permission. - K. In any section entitled "Acknowledgements" or "Dedications", - preserve the section's title, and preserve in the section all the - substance and tone of each of the contributor acknowledgements - and/or dedications given therein. - L. Preserve all the Invariant Sections of the Document, - unaltered in their text and in their titles. Section numbers - or the equivalent are not considered part of the section titles. - M. Delete any section entitled "Endorsements." Such a section - may not be included in the Modified Version. - N. Do not retitle any existing section as "Endorsements" or to - conflict in title with any Invariant Section. - - If the Modified Version includes new front-matter sections or - appendices that qualify as Secondary Sections and contain no - material copied from the Document, you may at your option - designate some or all of these sections as invariant. To do this, - add their titles to the list of Invariant Sections in the Modified - Version's license notice. These titles must be distinct from any - other section titles. - - You may add a section entitled "Endorsements", provided it contains - nothing but endorsements of your Modified Version by various - parties-for example, statements of peer review or that the text has - been approved by an organization as the authoritative definition - of a standard. - - You may add a passage of up to five words as a Front-Cover Text, - and a passage of up to 25 words as a Back-Cover Text, to the end - of the list of Cover Texts in the Modified Version. Only one - passage of Front-Cover Text and one of Back-Cover Text may be - added by (or through arrangements made by) any one entity. If the - Document already includes a cover text for the same cover, - previously added by you or by arrangement made by the same entity - you are acting on behalf of, you may not add another; but you may - replace the old one, on explicit permission from the previous - publisher that added the old one. - - The author(s) and publisher(s) of the Document do not by this - License give permission to use their names for publicity for or to - assert or imply endorsement of any Modified Version. - - 5. COMBINING DOCUMENTS - - You may combine the Document with other documents released under - this License, under the terms defined in section 4 above for - modified versions, provided that you include in the combination - all of the Invariant Sections of all of the original documents, - unmodified, and list them all as Invariant Sections of your - combined work in its license notice. - - The combined work need only contain one copy of this License, and - multiple identical Invariant Sections may be replaced with a single - copy. If there are multiple Invariant Sections with the same name - but different contents, make the title of each such section unique - by adding at the end of it, in parentheses, the name of the - original author or publisher of that section if known, or else a - unique number. Make the same adjustment to the section titles in - the list of Invariant Sections in the license notice of the - combined work. - - In the combination, you must combine any sections entitled - "History" in the various original documents, forming one section - entitled "History"; likewise combine any sections entitled - "Acknowledgements", and any sections entitled "Dedications." You - must delete all sections entitled "Endorsements." - - 6. COLLECTIONS OF DOCUMENTS - - You may make a collection consisting of the Document and other - documents released under this License, and replace the individual - copies of this License in the various documents with a single copy - that is included in the collection, provided that you follow the - rules of this License for verbatim copying of each of the - documents in all other respects. - - You may extract a single document from such a collection, and - distribute it individually under this License, provided you insert - a copy of this License into the extracted document, and follow - this License in all other respects regarding verbatim copying of - that document. - - 7. AGGREGATION WITH INDEPENDENT WORKS - - A compilation of the Document or its derivatives with other - separate and independent documents or works, in or on a volume of - a storage or distribution medium, does not as a whole count as a - Modified Version of the Document, provided no compilation - copyright is claimed for the compilation. Such a compilation is - called an "aggregate", and this License does not apply to the - other self-contained works thus compiled with the Document, on - account of their being thus compiled, if they are not themselves - derivative works of the Document. - - If the Cover Text requirement of section 3 is applicable to these - copies of the Document, then if the Document is less than one - quarter of the entire aggregate, the Document's Cover Texts may be - placed on covers that surround only the Document within the - aggregate. Otherwise they must appear on covers around the whole - aggregate. - - 8. TRANSLATION - - Translation is considered a kind of modification, so you may - distribute translations of the Document under the terms of section - 4. Replacing Invariant Sections with translations requires special - permission from their copyright holders, but you may include - translations of some or all Invariant Sections in addition to the - original versions of these Invariant Sections. You may include a - translation of this License provided that you also include the - original English version of this License. In case of a - disagreement between the translation and the original English - version of this License, the original English version will prevail. - - 9. TERMINATION - - You may not copy, modify, sublicense, or distribute the Document - except as expressly provided for under this License. Any other - attempt to copy, modify, sublicense or distribute the Document is - void, and will automatically terminate your rights under this - License. However, parties who have received copies, or rights, - from you under this License will not have their licenses - terminated so long as such parties remain in full compliance. - - 10. FUTURE REVISIONS OF THIS LICENSE - - The Free Software Foundation may publish new, revised versions of - the GNU Free Documentation License from time to time. Such new - versions will be similar in spirit to the present version, but may - differ in detail to address new problems or concerns. See - http://www.gnu.org/copyleft/. - - Each version of the License is given a distinguishing version - number. If the Document specifies that a particular numbered - version of this License "or any later version" applies to it, you - have the option of following the terms and conditions either of - that specified version or of any later version that has been - published (not as a draft) by the Free Software Foundation. If - the Document does not specify a version number of this License, - you may choose any version ever published (not as a draft) by the - Free Software Foundation. - - -ADDENDUM: How to use this License for your documents -==================================================== - -To use this License in a document you have written, include a copy of -the License in the document and put the following copyright and license -notices just after the title page: - - Copyright (C) YEAR YOUR NAME. - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.1 - or any later version published by the Free Software Foundation; - with the Invariant Sections being LIST THEIR TITLES, with the - Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. - A copy of the license is included in the section entitled "GNU - Free Documentation License." - - If you have no Invariant Sections, write "with no Invariant Sections" -instead of saying which ones are invariant. If you have no Front-Cover -Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being -LIST"; likewise for Back-Cover Texts. - - If your document contains nontrivial examples of program code, we -recommend releasing these examples in parallel under your choice of -free software license, such as the GNU General Public License, to -permit their use in free software. - - -File: standards.info, Node: Index, Prev: Copying This Manual, Up: Top - -Index -***** - -[index] -* Menu: - -* #endif, commenting: Comments. (line 54) -* --help option: Command-Line Interfaces. - (line 119) -* --version option: Command-Line Interfaces. - (line 34) -* -Wall compiler option: Syntactic Conventions. - (line 10) -* accepting contributions: Contributions. (line 6) -* address for bug reports: Command-Line Interfaces. - (line 125) -* ANSI C standard: Standard C. (line 6) -* arbitrary limits on data: Semantics. (line 6) -* autoconf: System Portability. (line 23) -* avoiding proprietary code: Reading Non-Free Code. - (line 6) -* behavior, dependent on program's name: User Interfaces. (line 6) -* binary packages: Install Command Categories. - (line 80) -* bindir: Directory Variables. (line 45) -* braces, in C source: Formatting. (line 6) -* bug reports: Command-Line Interfaces. - (line 125) -* canonical name of a program: Command-Line Interfaces. - (line 41) -* casting pointers to integers: CPU Portability. (line 67) -* change logs: Change Logs. (line 6) -* change logs, conditional changes: Conditional Changes. (line 6) -* change logs, style: Style of Change Logs. - (line 6) -* command-line arguments, decoding: Semantics. (line 46) -* command-line interface: Command-Line Interfaces. - (line 6) -* commenting: Comments. (line 6) -* compatibility with C and POSIX standards: Compatibility. (line 6) -* compiler warnings: Syntactic Conventions. - (line 10) -* conditional changes, and change logs: Conditional Changes. (line 6) -* conditionals, comments for: Comments. (line 54) -* configure: Configuration. (line 6) -* control-L: Formatting. (line 114) -* conventions for makefiles: Makefile Conventions. - (line 6) -* corba: Graphical Interfaces. - (line 16) -* credits for manuals: Manual Credits. (line 6) -* data types, and portability: CPU Portability. (line 6) -* declaration for system functions: System Functions. (line 21) -* documentation: Documentation. (line 6) -* doschk: Names. (line 38) -* downloading this manual: Preface. (line 17) -* error messages: Semantics. (line 19) -* error messages, formatting: Errors. (line 6) -* exec_prefix: Directory Variables. (line 27) -* expressions, splitting: Formatting. (line 77) -* file usage: File Usage. (line 6) -* file-name limitations: Names. (line 38) -* formatting error messages: Errors. (line 6) -* formatting source code: Formatting. (line 6) -* formfeed: Formatting. (line 114) -* function argument, declaring: Syntactic Conventions. - (line 6) -* function prototypes: Standard C. (line 17) -* getopt: Command-Line Interfaces. - (line 6) -* gettext: Internationalization. - (line 6) -* gnome: Graphical Interfaces. - (line 16) -* graphical user interface: Graphical Interfaces. - (line 6) -* gtk: Graphical Interfaces. - (line 6) -* GUILE: Source Language. (line 38) -* implicit int: Syntactic Conventions. - (line 6) -* impossible conditions: Semantics. (line 70) -* internationalization: Internationalization. - (line 6) -* legal aspects: Legal Issues. (line 6) -* legal papers: Contributions. (line 6) -* libexecdir: Directory Variables. (line 58) -* libraries: Libraries. (line 6) -* library functions, and portability: System Functions. (line 6) -* license for manuals: License for Manuals. (line 6) -* lint: Syntactic Conventions. - (line 109) -* long option names: Option Table. (line 6) -* long-named options: Command-Line Interfaces. - (line 12) -* makefile, conventions for: Makefile Conventions. - (line 6) -* malloc return value: Semantics. (line 25) -* man pages: Man Pages. (line 6) -* manual structure: Manual Structure Details. - (line 6) -* memory allocation failure: Semantics. (line 25) -* memory usage: Memory Usage. (line 6) -* message text, and internationalization: Internationalization. - (line 29) -* mmap: Mmap. (line 6) -* multiple variables in a line: Syntactic Conventions. - (line 35) -* names of variables, functions, and files: Names. (line 6) -* NEWS file: NEWS File. (line 6) -* non-POSIX systems, and portability: System Portability. (line 32) -* non-standard extensions: Using Extensions. (line 6) -* NUL characters: Semantics. (line 11) -* open brace: Formatting. (line 6) -* optional features, configure-time: Configuration. (line 76) -* options for compatibility: Compatibility. (line 14) -* output device and program's behavior: User Interfaces. (line 13) -* packaging: Releases. (line 6) -* portability, and data types: CPU Portability. (line 6) -* portability, and library functions: System Functions. (line 6) -* portability, between system types: System Portability. (line 6) -* POSIX compatibility: Compatibility. (line 6) -* POSIXLY_CORRECT, environment variable: Compatibility. (line 21) -* post-installation commands: Install Command Categories. - (line 6) -* pre-installation commands: Install Command Categories. - (line 6) -* prefix: Directory Variables. (line 17) -* program configuration: Configuration. (line 6) -* program design: Design Advice. (line 6) -* program name and its behavior: User Interfaces. (line 6) -* program's canonical name: Command-Line Interfaces. - (line 41) -* programming languges: Source Language. (line 6) -* proprietary programs: Reading Non-Free Code. - (line 6) -* README file: Releases. (line 17) -* references to non-free material: References. (line 6) -* releasing: Managing Releases. (line 6) -* sbindir: Directory Variables. (line 51) -* signal handling: Semantics. (line 59) -* spaces before open-paren: Formatting. (line 71) -* standard command-line options: Command-Line Interfaces. - (line 31) -* standards for makefiles: Makefile Conventions. - (line 6) -* string library functions: System Functions. (line 55) -* syntactic conventions: Syntactic Conventions. - (line 6) -* table of long options: Option Table. (line 6) -* temporary files: Semantics. (line 84) -* temporary variables: Syntactic Conventions. - (line 23) -* texinfo.tex, in a distribution: Releases. (line 73) -* TMPDIR environment variable: Semantics. (line 84) -* trademarks: Trademarks. (line 6) -* where to obtain standards.texi: Preface. (line 17) - - - -Tag Table: -Node: Top696 -Node: Preface1396 -Node: Legal Issues3616 -Node: Reading Non-Free Code4080 -Node: Contributions5808 -Node: Trademarks7962 -Node: Design Advice9025 -Node: Source Language9609 -Node: Compatibility11621 -Node: Using Extensions13249 -Node: Standard C14825 -Node: Conditional Compilation17228 -Node: Program Behavior18527 -Node: Semantics19446 -Node: Libraries24139 -Node: Errors25384 -Node: User Interfaces27165 -Node: Graphical Interfaces28770 -Node: Command-Line Interfaces29805 -Node: Option Table35876 -Node: Memory Usage50885 -Node: File Usage51910 -Node: Writing C52658 -Node: Formatting53508 -Node: Comments57571 -Node: Syntactic Conventions60873 -Node: Names64285 -Node: System Portability66494 -Node: CPU Portability68879 -Node: System Functions72135 -Node: Internationalization77332 -Node: Mmap80485 -Node: Documentation81195 -Node: GNU Manuals82300 -Node: Doc Strings and Manuals87357 -Node: Manual Structure Details88910 -Node: License for Manuals90328 -Node: Manual Credits91302 -Node: Printed Manuals91695 -Node: NEWS File92381 -Node: Change Logs93059 -Node: Change Log Concepts93813 -Node: Style of Change Logs95677 -Node: Simple Changes97712 -Node: Conditional Changes98956 -Node: Indicating the Part Changed100378 -Node: Man Pages100905 -Node: Reading other Manuals102529 -Node: Managing Releases103320 -Node: Configuration104083 -Node: Makefile Conventions110988 -Node: Makefile Basics111794 -Node: Utilities in Makefiles114968 -Node: Command Variables117113 -Node: Directory Variables120690 -Node: Standard Targets131584 -Ref: Standard Targets-Footnote-1142824 -Node: Install Command Categories142924 -Node: Releases147506 -Node: References151594 -Node: Copying This Manual153879 -Node: GNU Free Documentation License154115 -Node: Index173816 - -End Tag Table diff --git a/etc/texi2pod.pl b/etc/texi2pod.pl index ed0d102a1a5..cd0ffd9435f 100644 --- a/etc/texi2pod.pl +++ b/etc/texi2pod.pl @@ -162,6 +162,8 @@ while(<$inf>) { } elsif ($ended =~ /^(?:itemize|enumerate|[fv]?table)$/) { $_ = "\n=back\n"; $ic = pop @icstack; + } elsif ($ended eq "multitable") { + $_ = "\n=back\n"; } else { die "unknown command \@end $ended at line $.\n"; } @@ -252,6 +254,8 @@ while(<$inf>) { and $_ = "\n=head2 $1\n"; /^\@subsection\s+(.+)$/ and $_ = "\n=head3 $1\n"; + /^\@subsubsection\s+(.+)$/ + and $_ = "\n=head4 $1\n"; # Block command handlers: /^\@itemize(?:\s+(\@[a-z]+|\*|-))?/ and do { @@ -260,7 +264,7 @@ while(<$inf>) { if (defined $1) { $ic = $1; } else { - $ic = '@bullet'; + $ic = '*'; } $_ = "\n=over 4\n"; $endw = "itemize"; @@ -278,6 +282,12 @@ while(<$inf>) { $endw = "enumerate"; }; + /^\@multitable\s.*/ and do { + push @endwstack, $endw; + $endw = "multitable"; + $_ = "\n=over 4\n"; + }; + /^\@([fv]?table)\s+(\@[a-z]+)/ and do { push @endwstack, $endw; push @icstack, $ic; @@ -297,6 +307,16 @@ while(<$inf>) { $_ = ""; # need a paragraph break }; + /^\@item\s+(.*\S)\s*$/ and $endw eq "multitable" and do { + @columns = (); + for $column (split (/\s*\@tab\s*/, $1)) { + # @strong{...} is used a @headitem work-alike + $column =~ s/^\@strong{(.*)}$/$1/; + push @columns, $column; + } + $_ = "\n=item ".join (" : ", @columns)."\n"; + }; + /^\@itemx?\s*(.+)?$/ and do { if (defined $1) { # Entity escapes prevent munging by the <> processing below. @@ -382,6 +402,9 @@ sub postprocess s/\@gol//g; s/\@\*\s*\n?//g; + # Anchors are thrown away + s/\@anchor\{(?:[^\}]*)\}//g; + # @uref can take one, two, or three arguments, with different # semantics each time. @url and @email are just like @uref with # one argument, for our purposes. diff --git a/gas/ChangeLog b/gas/ChangeLog index 1723944a36e..704e6f90d4f 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,758 +1,1294 @@ -2006-07-19 Mat Hostetter +2007-07-03 Nathan Sidwell - * symbols.c (report_op_error): Fix pasto. Don't use as_bad_where - when file and line unknown. + * config/tc-m68k.c (m68k_ip): Add j & K operand types. + (install_operand): Add E encoding. + (md_begin): Check and skip initial '.' arg character. + (get_num): Add 0..511 case. -2006-06-07 Joseph S. Myers +2007-07-03 Alan Modra - * po/Make-in (pdf, ps): New dummy targets. + PR 4713 + * config/obj-elf.c (elf_ecoff_set_ext): Make static when OBJ_MAYBE_ELF. + * config/obj-elf.h (obj_ecoff_set_ext): Comment. -2006-06-02 Joseph S. Myers +2007-07-03 Mikkel Lauritsen - * doc/Makefile.am (TEXI2DVI): Define. - * doc/Makefile.in: Regenerate. - * doc/c-arc.texi: Fix typo. + PR 4722 + * app.c (do_scrub_chars ): Check for output buffer full + after memcpy. -2006-05-30 Nick Clifton +2007-07-02 Joseph Myers - * po/es.po: Updated Spanish translation. + * config/tc-mips.c (s_dtprelword, s_dtpreldword, + s_dtprel_internal): New. + (mips_pseudo_table): Add .dtprelword and .dtpreldword. + (md_apply_fix): Handle BFD_RELOC_MIPS_TLS_DTPREL32 and + BFD_RELOC_MIPS_TLS_DTPREL64. -2006-05-25 Nathan Sidwell +2007-07-02 Alan Modra - * gas/config/tc-m68k.c (m68k_init_arch): Move checking of - cfloat/m68881 to correct architecture before using it. - -2006-05-16 Nick Clifton - - * Import these patches from the mainline: - - 2006-05-16 Bjoern Haase - - * config/tc-avr.h (TC_VALIDATE_FIX): Allow fixups for immediate - constant values. - - 2006-05-05 Bjoern Haase - - * gas/config/tc-avr.h (TC_VALIDATE_FIX): Define. Disable fixups - for PMEM related expressions. - -2006-05-11 Thiemo Seufer - - * config/tc-mips.c (append_insn): Don't check the range of j or - jal addresses. - -2006-05-10 Alan Modra - - * dwarf2dbg.c (get_line_subseg): Attach new struct line_seg to end - of list rather than beginning. - -2006-05-10 Alan Modra - - * write.c (relax_segment): Add pass count arg. Don't error on - negative org/space on first two passes. - (relax_seg_info): New struct. - (relax_seg, write_object_file): Adjust. - * write.h (relax_segment): Update prototype. - -2006-05-02 Joseph Myers - - * config/tc-arm.c (do_iwmmxt_wldstbh): Don't multiply offset by 4 - here. - (md_apply_fix3): Multiply offset by 4 here for - BFD_RELOC_ARM_CP_OFF_IMM_S2 and BFD_RELOC_ARM_T32_CP_OFF_IMM_S2. - -2006-05-02 Daniel Jacobowitz - - * doc/Makefile.am (AM_MAKEINFOFLAGS): New. - (TEXI2POD): Use AM_MAKEINFOFLAGS. - (asconfig.texi): Don't set top_srcdir. - * doc/as.texinfo: Don't use top_srcdir. - * aclocal.m4, Makefile.in, doc/Makefile.in: Regenerated. - -2006-05-02 Paul Brook - - * config/tc-arm.c (arm_optimize_expr): New function. - * config/tc-arm.h (md_optimize_expr): Define - (arm_optimize_expr): Add prototype. - (TC_FORCE_RELOCATION_SUB_SAME): Define. - -2006-05-01 James Lemke - - * subsegs.c (subseg_set_rest): Always set seginfp->frchainP if NULL. - -2006-04-25 Bob Wilson - - * config/xtensa-relax.c (widen_spec_list): Use new "WIDE." - syntax instead of hardcoded opcodes with ".w18" suffixes. - (wide_branch_opcode): New. - (build_transition): Use it to check for wide branch opcodes with - either ".w18" or ".w15" suffixes. - -2006-04-25 Bob Wilson - - * config/tc-xtensa.c (xtensa_create_literal_symbol, - xg_assemble_literal, xg_assemble_literal_space): Do not set the - frag's is_literal flag. - -2006-04-25 Bob Wilson - - * config/xtensa-relax.c (XCHAL_HAVE_WIDE_BRANCHES): Provide default. - -2006-04-16 Daniel Jacobowitz - - * po/POTFILES.in: Regenerated. - -2006-04-14 Sterling Augustine - - * config/tc-xtensa.c (emit_single_op): Do not relax MOVI - instructions when such transformations have been disabled. - -2006-04-10 Sterling Augustine - - * config/tc-xtensa.c (xg_assemble_vliw_tokens): Record loop target - symbols in RELAX[_CHECK]_ALIGN_NEXT_OPCODE frags. - (xtensa_fix_close_loop_end_frags): Use the recorded values instead of - decoding the loop instructions. Remove current_offset variable. - (xtensa_fix_short_loop_frags): Likewise. - (min_bytes_to_other_loop_end): Remove current_offset argument. - -2006-04-09 Arnold Metselaar - - * config/tc-z80.c (z80_optimize_expr): Removed; redundant since 2006-04-04. - * config/tc-z80.h (z80_optimize_expr, md_optimize_expr): Removed. - -2006-04-07 Joerg Wunsch - - * gas/config/tc-avr.c (mcu_types): Add support for attiny261, - attiny461, attiny861, attiny25, attiny45, attiny85,attiny24, - attiny44, attiny84, at90pwm2, at90pwm3, atmega164, atmega324, - atmega644, atmega329, atmega3290, atmega649, atmega6490, - atmega406, atmega640, atmega1280, atmega1281, at90can32, - at90can64, at90usb646, at90usb647, at90usb1286 and - at90usb1287. - Move atmega48 and atmega88 from AVR_ISA_M8 to AVR_ISA_PWMx. - -2006-04-07 Paul Brook - - * config/tc-arm.c (parse_operands): Set default error message. - -2006-04-07 Paul Brook - - * config/tc-arm.c (parse_tb): Set inst.error before returning FAIL. - -2006-04-07 Paul Brook - - * config/tc-arm.c (md_apply_fix): Set H bit on blx instruction. - -2006-04-07 Paul Brook - - * config/tc-arm.c (THUMB2_LOAD_BIT): Define. - (move_or_literal_pool): Handle Thumb-2 instructions. - (do_t_ldst): Call move_or_literal_pool for =N addressing modes. - -2006-04-07 Alan Modra - - PR 2512. - * config/tc-i386.c (match_template): Move 64-bit operand tests - inside loop. - -2006-04-06 Carlos O'Donell - - * po/Make-in: Add install-html target. - * Makefile.am: Add install-html and install-html-recursive targets. + * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. - * configure.in: AC_SUBST datarootdir, docdir, htmldir. - * configure: Regenerate. - * doc/Makefile.am: Add install-html and install-html-am targets. + * aclocal.m4: Regenerate. + * config.in: Regenerate. * doc/Makefile.in: Regenerate. + * po/POTFILES.in: Regenerate. + * po/gas.pot: Regenerate. -2006-04-06 Alan Modra +2007-07-02 Alan Modra - * frags.c (frag_offset_fixed_p): Reinitialise offset before - second scan. + * config/tc-ppc.c (ppc_pe_section): Comment out code assigning + coff section flag values to bfd section flag. -2006-04-05 Richard Sandiford - Daniel Jacobowitz +2007-06-30 H.J. Lu - * config/tc-sparc.c (sparc_target_format): Handle TE_VXWORKS. - (GOTT_BASE, GOTT_INDEX): New. - (tc_gen_reloc): Don't alter relocations against GOTT_BASE and - GOTT_INDEX when generating VxWorks PIC. - * configure.tgt (sparc*-*-vxworks*): Remove this special case; - use the generic *-*-vxworks* stanza instead. + * aclocal.m4: Regenerated. + * doc/Makefile.in: Likewise. + * Makefile.in: Likewise. -2006-04-04 Alan Modra +2007-06-29 Joseph Myers - PR 997 - * frags.c (frag_offset_fixed_p): New function. - * frags.h (frag_offset_fixed_p): Declare. - * expr.c (expr): Use frag_offset_fixed_p when simplifying subtraction. - (resolve_expression): Likewise. + * as.c (main): Only call create_obj_attrs_section if IS_ELF. -2006-04-03 Sterling Augustine +2007-06-29 Joseph Myers - * config/tc-xtensa.c (init_op_placement_info_table): Check for formats - of the same length but different numbers of slots. + * as.c (create_obj_attrs_section): New. + (main): Call create_obj_attrs_section for ELF. + * read.c (s_gnu_attribute, skip_whitespace, skip_past_char, + skip_past_comma, s_vendor_attribute): New. + (potable): Add gnu_attribute for ELF. + * read.h (s_vendor_attribute): Declare. + * config/tc-arm.c (s_arm_eabi_attribute): Replace by wrapper + round s_vendor_attribute. + (aeabi_set_public_attributes): Update for new attributes + interfaces. + (arm_md_end): Remove attributes contents setting now done + generically. -2006-03-30 Andreas Schwab +2007-06-29 M R Swami Reddy - * configure.in: Fix help string for --enable-targets option. - * configure: Regenerate. - -2006-03-28 Nathan Sidwell - - * gas/config/tc-m68k.c (find_cf_chip): Merge into ... - (m68k_ip): ... here. Use for all chips. Protect against buffer - overrun and avoid excessive copying. - - * config/tc-m68k.c (m68000_control_regs, m68010_control_regs, - m68020_control_regs, m68040_control_regs, m68060_control_regs, - mcf_control_regs, mcf5208_control_regs, mcf5213_control_regs, - mcf5329_control_regs, mcf5249_control_regs, mcf528x_control_regs, - mcfv4e_control_regs, m68010_control_regs): Rename and reorder to ... - (m68000_ctrl, m68010_ctrl, m68020_ctrl, m68040_ctrl, m68060_ctrl, - mcf_ctrl, mcf5208_ctrl, mcf5213_ctrl, mcf5235_ctrl, mcf5249_ctrl, - mcf5216_ctrl, mcf5250_ctrl, mcf5271_ctrl, mcf5272_ctrl, - mcf5282_ctrl, mcfv4e_ctrl): ... these. - (mcf5275_ctrl, mcf5329_ctrl, mcf5373_ctrl): New. - (struct m68k_cpu): Change chip field to control_regs. - (current_chip): Remove. - (control_regs): New. - (m68k_archs, m68k_extensions): Adjust. - (m68k_cpus): Reorder to be in cpu number order. Adjust. - (CPU_ALLOW_MC, CPU_ALLOW_NEGATION): Remove. - (find_cf_chip): Reimplement for new organization of cpu table. - (select_control_regs): Remove. - (mri_chip): Adjust. - (struct save_opts): Save control regs, not chip. - (s_save, s_restore): Adjust. - (m68k_lookup_cpu): Give deprecated warning when necessary. - (m68k_init_arch): Adjust. - (md_show_usage): Adjust for new cpu table organization. - -2006-03-25 Bernd Schmidt - - * config/bfin-defs.h (Expr_Node_Type enum): Add Expr_Node_GOT_Reloc. - * config/bfin-lex.l: Recognize GOT17M4 and FUNCDESC_GOT17M4. - * config/bfin-parse.y: Include "libbfd.h", "elf/common.h" and - "elf/bfin.h". - (GOT17M4, FUNCDESC_GOT17M4): New tokens of type . - (any_gotrel): New rule. - (got): Use it, and create Expr_Node_GOT_Reloc nodes. - * config/tc-bfin.c: Include "libbfd.h", "elf/common.h" and - "elf/bfin.h". - (DEFAULT_FLAGS, bfin_flags, bfin_pic_flag): New. - (bfin_pic_ptr): New function. - (md_pseudo_table): Add it for ".picptr". - (OPTION_FDPIC): New macro. - (md_longopts): Add -mfdpic. - (md_parse_option): Handle it. - (md_begin): Set BFD flags. - (md_apply_fix3, bfin_fix_adjustable): Handle new relocs. - (bfin_gen_ldstidxi): Adjust to match the trees that the parser gives - us for GOT relocs. - * Makefile.am (bfin-parse.o): Update dependencies. - (DEPTC_bfin_elf): Likewise. + * Makefile.am: Add CR16 related entry. * Makefile.in: Regenerate. - -2006-03-25 Richard Sandiford - - * config/tc-m68k.c (m68k_cpus): Change cpu_cf5208 entries to use - mcfemac instead of mcfmac. - -2006-03-22 Richard Sandiford - Daniel Jacobowitz - Phil Edwards - Zack Weinberg - Mark Mitchell - Nathan Sidwell - - * config/tc-mips.c (mips_target_format): Handle vxworks targets. - (md_begin): Complain about -G being used for PIC. Don't change - the text, data and bss alignments on VxWorks. - (reloc_needs_lo_p): Don't return true for R_MIPS_GOT16 when - generating VxWorks PIC. - (load_address): Extend SVR4_PIC handling to VXWORKS_PIC. - (macro): Likewise, but do not treat la $25 specially for - VxWorks PIC, and do not handle jal. - (OPTION_MVXWORKS_PIC): New macro. - (md_longopts): Add -mvxworks-pic. - (md_parse_option): Don't complain about using PIC and -G together here. - Handle OPTION_MVXWORKS_PIC. - (md_estimate_size_before_relax): Always use the first relaxation - sequence on VxWorks. - * config/tc-mips.h (VXWORKS_PIC): New. - -2006-03-21 Paul Brook - - * config/tc-arm.c (md_apply_fix): Fix typo in offset mask. - -2006-03-21 Sterling Augustine - - * config/tc-xtensa.c (enforce_three_byte_loop_align): New flag. - (xtensa_setup_hw_workarounds): Set this new flag for older hardware. - (get_loop_align_size): New. - (xtensa_end): Skip xtensa_mark_narrow_branches when not aligning. - (xtensa_mark_zcl_first_insns): Prevent widening of first loop frag. - (get_text_align_power): Rewrite to handle inputs in the range 2-8. - (get_noop_aligned_address): Use get_loop_align_size. - (get_aligned_diff): Likewise. - -2006-03-21 Paul Brook - - * config/tc-arm.c (insns): Correct opcodes for ldrbt and strbt. - -2006-03-20 Paul Brook - - * config/tc-arm.c (BAD_BRANCH, BAD_NOT_IT): Define. - (do_t_branch): Encode branches inside IT blocks as unconditional. - (do_t_cps): New function. - (do_t_blx, do_t_bkpt, do_t_branch23, do_t_bx, do_t_bxj, do_t_cpsi, - do_t_czb, do_t_it, do_t_setend, do_t_tb): Add IT constaints. - (opcode_lookup): Allow conditional suffixes on all instructions in - Thumb mode. - (md_assemble): Advance condexec state before checking for errors. - (insns): Use do_t_cps. - -2006-03-20 Paul Brook - - * config/tc-arm.c (output_relax_insn): Call dwarf2_emit_insn before - outputting the insn. - -2006-03-18 Jan-Benedict Glaw - - * config/tc-vax.c: Update copyright year. - * config/tc-vax.h: Likewise. - -2006-03-18 Jan-Benedict Glaw - - * config/tc-vax.c (md_chars_to_number): Used only locally, so - make it static. - * config/tc-vax.h (md_chars_to_number): Remove obsolete declaration. - -2006-03-17 Paul Brook - - * config/tc-arm.c (insns): Add ldm and stm. - -2006-03-17 Ben Elliston - - PR gas/2446 - * doc/as.texinfo (Ident): Document this directive more thoroughly. - -2006-03-16 Paul Brook - - * config/tc-arm.c (insns): Add "svc". - -2006-03-13 Bob Wilson - - * config/tc-xtensa.c (xg_translate_sysreg_op): Remove has_underbar - flag and avoid double underscore prefixes. - -2006-03-10 Paul Brook - - * config/tc-arm.c (md_begin): Handle EABIv5. - (arm_eabis): Add EF_ARM_EABI_VER5. - * doc/c-arm.texi: Document -meabi=5. - -2006-03-10 Ben Elliston - - * app.c (do_scrub_chars): Simplify string handling. - -2006-03-07 Richard Sandiford - Daniel Jacobowitz - Zack Weinberg - Nathan Sidwell - Paul Brook - Ricardo Anguiano - Phil Edwards - - * config/tc-arm.c (md_apply_fix): Install a value of zero into a - BFD_RELOC_ARM_OFFSET_IMM field if we're going to generate a RELA - R_ARM_ABS12 reloc. - (tc_gen_reloc): Keep the original fx_offset for RELA pc-relative - relocs, but adjust by md_pcrel_from_section. Create R_ARM_ABS12 - relocations for BFD_RELOC_ARM_OFFSET_IMM on RELA targets. - -2006-03-06 Bob Wilson - - * config/tc-xtensa.c (xtensa_post_relax_hook): Generate literal tables - even when using the text-section-literals option. - -2006-03-06 Nathan Sidwell - - * config/tc-m68k.c (m68k_extensions): Allow 'float' on both m68k - and cf. - (m68k_ip): Check we have some control regs. - (md_parse_option): Allow raw arch switch. - (m68k_init_arch): Better detection of arch/cpu mismatch. Detect - whether 68881 or cfloat was meant by -mfloat. - (md_show_usage): Adjust extension display. - (m68k_elf_final_processing): Adjust. - -2006-03-03 Bjoern Haase - - * config/tc-avr.c (avr_mod_hash_value): New function. - (md_apply_fix, exp_mod): Use BFD_RELOC_HH8_LDI and - BFD_RELOC_MS8_LDI for hlo8() and hhi8() - (md_begin): Set linkrelax variable to 1, use avr_mod_hash_value - instead of int avr_ldi_expression: use avr_mod_hash_value instead - of (int). - (tc_gen_reloc): Handle substractions of symbols, if possible do - fixups, abort otherwise. - * config/tc-avr.h (TC_LINKRELAX_FIXUP, TC_VALIDATE_FIX, - tc_fix_adjustable): Define. - -2006-03-02 James E Wilson - - * config/tc-ia64.c (emit_one_bundle): For IA64_OPCODE_LAST, if we - change the template, then clear md.slot[curr].end_of_insn_group. - -2006-02-28 Jan Beulich - - * macro.c (get_any_string): Don't insert quotes for <>-quoted input. - -2006-02-28 Jan Beulich - - PR/1070 - * macro.c (getstring): Don't treat parentheses special anymore. - (get_any_string): Don't consider '(' and ')' as quoting anymore. - Special-case '(', ')', '[', and ']' when dealing with non-quoting - characters. - -2006-02-28 Mat - - * dwarf2dbg.c (get_filenum): Don't inadvertently decrease files_in_use. - -2006-02-27 Jakub Jelinek - - * dw2gencfi.c (struct fde_entry, struct cie_entry): Add signal_frame - field. - (CFI_signal_frame): Define. - (cfi_pseudo_table): Add .cfi_signal_frame. - (dot_cfi): Handle CFI_signal_frame. - (output_cie): Handle cie->signal_frame. - (select_cie_for_fde): Don't share CIE if signal_frame flag is - different. Copy signal_frame from FDE to newly created CIE. - * doc/as.texinfo: Document .cfi_signal_frame. - -2006-02-27 Carlos O'Donell - - * doc/Makefile.am: Add html target. - * doc/Makefile.in: Regenerate. - * po/Make-in: Add html target. - -2006-02-27 H.J. Lu - - * config/tc-i386.c (output_insn): Support Intel Merom New - Instructions. - - * config/tc-i386.h (CpuMNI): New. - (CpuUnknownFlags): Add CpuMNI. - -2006-02-24 David S. Miller - - * config/tc-sparc.c (priv_reg_table): Add entry for "gl". - (hpriv_reg_table): New table for hyperprivileged registers. - (sparc_ip): New cases '$' and '%' for wrhpr/rdhpr hyperprivileged - register encoding. - -2006-02-24 DJ Delorie - - * config/tc-m32c.h (md_apply_fix): Define to m32c_apply_fix. - (tc_gen_reloc): Don't define. - * config/tc-m32c.c (rl_for, relaxable): New convenience macros. - (OPTION_LINKRELAX): New. - (md_longopts): Add it. - (m32c_relax): New. - (md_parse_options): Set it. - (md_assemble): Emit relaxation relocs as needed. - (md_convert_frag): Emit relaxation relocs as needed. - (md_cgen_lookup_reloc): Add LAB_8_8 and LAB_8_16. - (m32c_apply_fix): New. - (tc_gen_reloc): New. - (m32c_force_relocation): Force out jump relocs when relaxing. - (m32c_fix_adjustable): Return false if relaxing. - -2006-02-24 Paul Brook - - * config/arm/tc-arm.c (arm_ext_v6_notm, arm_ext_div, arm_ext_v7, - arm_ext_v7a, arm_ext_v7r, arm_ext_v7m): New variables. - (struct asm_barrier_opt): Define. - (arm_v7m_psr_hsh, arm_barrier_opt_hsh): New variables. - (parse_psr): Accept V7M psr names. - (parse_barrier): New function. - (enum operand_parse_code): Add OP_oBARRIER. - (parse_operands): Implement OP_oBARRIER. - (do_barrier): New function. - (do_dbg, do_pli, do_t_barrier, do_t_dbg, do_t_div): New functions. - (do_t_cpsi): Add V7M restrictions. - (do_t_mrs, do_t_msr): Validate V7M variants. - (md_assemble): Check for NULL variants. - (v7m_psrs, barrier_opt_names): New tables. - (insns): Add V7 instructions. Mark V6 instructions absent from V7M. - (md_begin): Initialize arm_v7m_psr_hsh and arm_barrier_opt_hsh. - (arm_cpu_option_table): Add Cortex-M3, R4 and A8. - (arm_arch_option_table): Add armv7, armv7a, armv7r and armv7m. - (struct cpu_arch_ver_table): Define. - (cpu_arch_ver): New. - (aeabi_set_public_attributes): Use cpu_arch_ver. Set - Tag_CPU_arch_profile. - * doc/c-arm.texi: Document new cpu and arch options. - -2006-02-23 H.J. Lu - - * config/tc-ia64.c (operand_match): Handle IA64_OPND_IMMU5b. - -2006-02-23 H.J. Lu - - * config/tc-ia64.c: Update copyright years. - -2006-02-22 H.J. Lu - - * config/tc-ia64.c (specify_resource): Add the rule 17 from - SDM 2.2. - -2005-02-22 Paul Brook - - * config/tc-arm.c (do_pld): Remove incorrect write to - inst.instruction. - (encode_thumb32_addr_mode): Use correct operand. - -2006-02-21 Paul Brook - - * config/tc-arm.c (md_apply_fix): Fix off-by-one errors. - -2006-02-17 Shrirang Khisti - Anil Paranjape - Shilin Shakti - - * Makefile.am: Add xc16x related entry. - * Makefile.in: Regenerate. - * configure.in: Added xc16x related entry. - * configure: Regenerate. - * config/tc-xc16x.h: New file - * config/tc-xc16x.c: New file - * doc/c-xc16x.texi: New file for xc16x - * doc/all.texi: Entry for xc16x - * doc/Makefile.texi: Added c-xc16x.texi + * config/tc-cr16.h: New file + * config/tc-cr16.c: New file + * doc/c-cr16.texi: New file for cr16 + * doc/all.texi: Entry for cr16 + * doc/Makefile.am: Added c-cr16.texi + * doc/Makefile.in: Regenerate + * doc/as.texinfo: Entry for CR16 target * NEWS: Announce the support for the new target. -2006-02-16 Nick Hudson +2007-06-26 Paul Brook - * configure.tgt: set emulation for mips-*-netbsd* + * config/tc-arm.c (parse_operands): Accept generic coprocessor regs + for OP_RVC. + (reg_names): Add fpinst, pfinst2, mvfr0 and mvfr1. -2006-02-14 Jakub Jelinek +2007-06-25 H.J. Lu - * config.in: Rebuilt. + * config/tc-i386.c (process_operands): Replace regKludge + with RegKludge. -2006-02-13 Bob Wilson +2007-06-25 Richard Sandiford - * config/tc-xtensa.c (xg_add_opcode_fix): Number operands starting - from 1, not 0, in error messages. - (md_assemble): Simplify special-case check for ENTRY instructions. - (tinsn_has_invalid_symbolic_operands): Do not include opcode and - operand in error message. + * config/tc-mips.h (TC_SYMFIELD_TYPE): New. + * config/tc-mips.c (append_insn): Record which symbols have + R_MIPS16_26 relocations against them. + (mips_fix_adjustable): Don't reduce relocations against such symbols. -2006-02-13 Joseph S. Myers +2007-06-22 Sterling Augustine - * configure.tgt (arm-*-linux-gnueabi*): Change to - arm-*-linux-*eabi*. - -2006-02-10 Nick Clifton - - * config/tc-crx.c (check_range): Ensure that the sign bit of a - 32-bit value is propagated into the upper bits of a 64-bit long. - - * config/tc-arc.c (init_opcode_tables): Fix cast. - (arc_extoper, md_operand): Likewise. - -2006-02-09 David Heine - - * config/tc-xtensa.c (xg_assembly_relax): Increment steps_taken for - each relaxation step. - -2006-02-09 Eric Botcazou + * config/tc-xtensa.c (xg_assembly_relax): Comment termination rules. + (frag_format_size): Handle RELAX_IMMED_STEP3. + (xtensa_relax_frag, md_convert_frag): Likewise. + * config/tc-xtensa.h (xtensa_relax_statesE): Add RELAX_IMMED_STEP3. + (RELAX_IMMED_MAXSTEPS): Adjust. + * config/xtensa-relax.c (widen_spec_list): Add transitions from + wide branches to branch-over-jumps. + (build_transition): Handle wide branches in transition patterns. - * configure.in (CHECK_DECLS): Add vsnprintf. +2007-06-22 H.J. Lu + + * config/tc-i386.c (disp_size): New. + (imm_size): Likewise. + (output_disp): Use disp_size and imm_size. + (output_imm): Use imm_size. + +2007-06-19 Sterling Augustine + + * config/tc-xtensa.h (struct xtensa_frag_type): Update comment about + use of literal_frag field. + * config/tc-xtensa.c (xtensa_mark_literal_pool_location): Record frag + in the literal_frag field. + (xtensa_move_literals): Use it here instead of searching. Update + literal_frag field with new value. + +2007-06-14 Paul Brook + + * config/tc-arm.c (do_t_mov_cmp): Handle shift by register and + narrow shift by immediate. + +2007-06-14 H.J. Lu + + * Makefile.am (ACLOCAL_AMFLAGS): Add -I ../config -I ../bfd. + + * acinclude.m4: Don't include m4 files. + (BFD_BINARY_FOPEN): Removed. + Remove libtool kludge. + + * Makefile.in: Regenerated. + * doc/Makefile.in: Likewise. + * aclocal.m4: Likewise. + * configure: Likewise. + +2007-06-11 Sterling Augustine + Bob Wilson + + * config/tc-xtensa.c (XTENSA_PROP_INSN_NO_TRANSFORM): Renamed to... + (XTENSA_PROP_NO_TRANSFORM): ...this. + (frag_flags_struct): Move is_no_transform out of the insn sub-struct. + (xtensa_mark_frags_for_org): New. + (xtensa_handle_align): Set RELAX_ORG frag subtype for rs_org. + (xtensa_post_relax_hook): Call xtensa_mark_frags_for_org. + (get_frag_property_flags): Adjust reference to is_no_transform flag. + (xtensa_frag_flags_combinable): Likewise. + (frag_flags_to_number): Likewise. Use XTENSA_PROP_NO_TRANSFORM. + * config/tc-xtensa.h (xtensa_relax_statesE): Add RELAX_ORG. + +2007-06-06 Paul Brook + + * config/tc-arm.c (s_align): Pad code sections appropriately. + +2007-06-05 Paul Brook + + * config/tc-arm.c (insns): Correct Thumb-2 ldrd/strd opcodes. + +2007-06-05 Nick Clifton + + PR gas/4587 + * config/tc-sparc.c (sparc_ip): Terminate tls_ops array. + +2007-06-05 Alan Modra + + * config/tc-spu.c (spu_cons): Use deferred_expression. Handle + number@ppu. + (tc_gen_reloc): Abort if neither addsy or subsy is set. + (md_apply_fix): Don't attempt to resolve SPU_PPU relocs. + * config/tc-spu.h (md_operand): Handle @ppu without sym. + +2007-05-31 Paul Brook + + * config/tc-arm.c (insns): Allow strex on M profile cores. + +2007-05-29 David S. Miller + Jakub Jelinek + + PR gas/4558 + * config/tc-sparc.c (md_apply_fix): Fix relocation overflow checks + for BFD_RELOC_SPARC_WDISP16 and BFD_RELOC_SPARC_WDISP19. + +2007-05-29 Alan Modra + + * config/tc-spu.h: Wrap in #ifndef/#endif. Delete coff macros. + +2007-05-29 Alan Modra + + * config/tc-ppc.c: Convert to ISO C. + * config/tc-ppc.c: Likewise. + +2007-05-29 Alan Modra + + * write.h (EXEC_MACHINE_TYPE): Delete. + (string_byte_count, section_alignment): Delete. + +2007-05-28 Nathan Sidwell + + * app.c (do_scrub_chars): Cope with \ at end of buffer. + +2007-05-26 Alan Modra + + * config/tc-ppc.c (ppc_insert_operand): Truncate sign bits in + top 32 bits of 64 bit value if so doing results in passing + range check. Rewrite sign extension fudges similarly. Enable + fudges for powerpc64 too. Report user value if range check + fails rather than fudged value. Negate PPC_OPERAND_NEGATIVE + range rather than value, also to report user value on failure. + +2007-03-25 Paul Brook + + * config/tc-arm.c (T2_SUBS_PC_LR): Define. + (do_t_add_sub): Correctly encode subs pc, lr, #const. + (do_t_mov_cmp): Correctly encode movs pc, lr. + +2007-05-24 Steve Ellcey + + * Makefile.in: Regnerate. * configure: Regenerate. - * messages.c (errno.h, stdarg.h, varargs.h, va_list): Do not - include/declare here, but... - * as.h: Move code detecting VARARGS idiom to the top. - (errno.h, stdarg.h, varargs.h, va_list): ...here. - (vsnprintf): Declare if not already declared. + * aclocal.m4: Regenerate. + * doc/Makefile.in: Regenerate. -2006-02-08 H.J. Lu - - * as.c (close_output_file): New. - (main): Register close_output_file with xatexit before - dump_statistics. Don't call output_file_close. - -2006-02-07 Nathan Sidwell - - * config/tc-m68k.c (mcf5208_control_regs, mcf5213_control_regs, - mcf5329_control_regs): New. - (not_current_architecture, selected_arch, selected_cpu): New. - (m68k_archs, m68k_extensions): New. - (archs): Renamed to ... - (m68k_cpus): ... here. Adjust. - (n_arches): Remove. - (md_pseudo_table): Add arch and cpu directives. - (find_cf_chip, m68k_ip): Adjust table scanning. - (no_68851, no_68881): Remove. - (md_assemble): Lazily initialize. - (select_control_regs): Adjust cpu names. Add 5208, 5213, 5329. - (md_init_after_args): Move functionality to m68k_init_arch. - (mri_chip): Adjust table scanning. - (md_parse_option): Reimplement 'm' processing to add -march & -mcpu - options with saner parsing. - (m68k_lookup_cpu, m68k_set_arch, m68k_set_cpu, m68k_set_extension, - m68k_init_arch): New. - (s_m68k_cpu, s_m68k_arch): New. - (md_show_usage): Adjust. - (m68k_elf_final_processing): Set CF EF flags. - * config/tc-m68k.h (m68k_init_after_args): Remove. - (tc_init_after_args): Remove. - * doc/c-m68k.texi (M68K-Opts): Document -march, -mcpu options. - (M68k-Directives): Document .arch and .cpu directives. - -2006-02-05 Arnold Metselaar - - * config/tc-z80.c (z80_start_line_hook): allow .equ and .defl as - synonyms for equ and defl. - (z80_cons_fix_new): New function. - (emit_byte): Disallow relative jumps to absolute locations. - (emit_data): Only handle defb, prototype changed, because defb is - now handled as pseudo-op rather than an instruction. - (instab): Entries for defb,defw,db,dw moved from here... - (md_pseudo_table): ... to here, use generic cons() for defw,dw. - Add entries for def24,def32,d24,d32. - (md_assemble): Improved error handling. - (md_apply_fix): New case BFD_RELOC_24, set fixP->fx_no_overflow to one. - * config/tc-z80.h (TC_CONS_FIX_NEW): Define. - (z80_cons_fix_new): Declare. - * doc/c-z80.texi (defb, db): Mention warning on overflow. - (def24,d24,def32,d32): New pseudo-ops. +2007-05-22 Bob Wilson -2006-02-02 Paul Brook + * doc/c-xtensa.texi (Xtensa Automatic Alignment): Remove statements + and index entries about automatic alignment of ENTRY instructions. + +2007-05-22 Nick Clifton - * config/tc-arm.c (do_shift): Remove Thumb-1 constraint. + * doc/as.texinfo: Use @copying around the copyright notice. -2005-02-02 Paul Brook +2007-05-18 Joseph Myers - * config/tc-arm.c (T2_OPCODE_MASK, T2_DATA_OP_SHIFT, T2_OPCODE_AND, - T2_OPCODE_BIC, T2_OPCODE_ORR, T2_OPCODE_ORN, T2_OPCODE_EOR, - T2_OPCODE_ADD, T2_OPCODE_ADC, T2_OPCODE_SBC, T2_OPCODE_SUB, - T2_OPCODE_RSB): Define. - (thumb32_negate_data_op): New function. - (md_apply_fix): Use it. + * config/tc-mips.c (s_mipsset): Use generic s_set for directives + containing a comma. -2006-01-31 Bob Wilson +2007-05-17 H.J. Lu - * config/xtensa-istack.h (TInsn): Remove record_fix and sub_symbol - fields. - * config/tc-xtensa.h (xtensa_frag_type): Remove slot_sub_symbols field. - * config/tc-xtensa.c (md_apply_fix): Check for unexpected uses of - subtracted symbols. - (relaxation_requirements): Add pfinish_frag argument and use it to - replace setting tinsn->record_fix fields. - (xg_assemble_vliw_tokens): Adjust calls to relaxation_requirements - and vinsn_to_insnbuf. Remove references to record_fix and - slot_sub_symbols fields. - (xtensa_mark_narrow_branches): Delete unused code. - (is_narrow_branch_guaranteed_in_range): Handle expr that is not just - a symbol. - (convert_frag_immed): Adjust vinsn_to_insnbuf call and do not set - record_fix fields. - (tinsn_immed_from_frag): Remove code for handling slot_sub_symbols. - (vinsn_to_insnbuf): Change use of record_fixup argument, replacing use - of the record_fix field. Simplify error messages for unexpected - symbolic operands. - (set_expr_symbol_offset_diff): Delete. + PR gas/4517 + 2003-06-05 Michal Ludvig + * doc/as.texinfo: Document new directives: .cfi_restore, + .cfi_undefined, .cfi_same_value, .cfi_return_column, + .cfi_remember_state and .cfi_restore_state. -2006-01-31 Paul Brook +2007-05-17 Nathan Sidwell - * config/tc-arm.c (arm_reg_parse): Check if reg is non-NULL. + * config/tc-m68k.c (md_apply_fix): Show value of out of range + fixups in error message. + (md_conver_frag_1): Propagate the fix source location and use + as_bad_where rather than fatal, for better error messages. -2006-01-31 Paul Brook - Richard Earnshaw +2007-05-16 Paul Brook - * config/tc-arm.c: Use arm_feature_set. - (arm_ext_*, arm_arch_full, arm_arch_t2, arm_arch_none, - arm_cext_iwmmxt, arm_cext_xscale, arm_cext_maverick, fpu_fpa_ext_v1, - fpu_fpa_ext_v2, fpu_vfp_ext_v1xd, fpu_vfp_ext_v1, fpu_vfp_ext_v2): - New variables. - (insns): Use them. - (md_atof, opcode_select, opcode_select, md_assemble, md_assemble, - md_begin, arm_parse_extension, arm_parse_cpu, arm_parse_arch, - arm_parse_fpu, arm_parse_float_abi, aeabi_set_public_attributes, - s_arm_cpu, s_arm_arch, s_arm_fpu): Use macros for accessing CPU - feature flags. - (arm_legacy_option_table, arm_option_cpu_value_table): New types. - (arm_opts): Move old cpu/arch options from here... - (arm_legacy_opts): ... to here. - (md_parse_option): Search arm_legacy_opts. - (arm_cpus, arm_archs, arm_extensions, arm_fpus) - (arm_float_abis, arm_eabis): Make const. + * config/tc-arm.c (v7m_psrs): Add uppercase PSR names and xpsr. -2006-01-25 Bob Wilson +2007-05-15 Mark Shinwell - * config/tc-xtensa.c (md_apply_fix): Set value to zero for PLT relocs. + * app.c (do_scrub_chars): Don't damage \@ pseudo-variables. -2006-01-21 Jie Zhang +2007-05-15 Vincent Riviere - * config/bfin-parse.y (asm_1): Check value range for 16 bit immediate - in load immediate intruction. + PR gas/3041 + * config/tc-m68k.c (relaxable_symbol): Make sure that the correct + addend is stored for relocs against weak symbols. + (md_apply_fix): So not loose track of addend for relocs against + weak symbols. -2006-01-21 Jie Zhang +2007-05-14 Thiemo Seufer - * config/bfin-parse.y (value_match): Use correct conversion - specifications in template string for __FILE__ and __LINE__. - (binary): Ditto. - (unary): Ditto. + * config/tc-mips.c (md_parse_option): Fix parsing of -O option. -2006-01-18 Alexandre Oliva +2007-05-14 Mei Ligang - Introduce TLS descriptors for i386 and x86_64. - * config/tc-i386.c (tc_i386_fix_adjustable): Handle - BFD_RELOC_386_TLS_GOTDESC, BFD_RELOC_386_TLS_DESC_CALL, - BFD_RELOC_X86_64_GOTPC32_TLSDESC, BFD_RELOC_X86_64_TLSDESC_CALL. - (optimize_disp): Emit fix up for BFD_RELOC_386_TLS_DESC_CALL and - BFD_RELOC_X86_64_TLSDESC_CALL immediately, and clear the - displacement bits. - (build_modrm_byte): Set up zero modrm for TLS desc calls. - (lex_got): Handle @tlsdesc and @tlscall. - (md_apply_fix, tc_gen_reloc): Handle the new relocations. + * config/tc-score.c (data_op2, validate_immediate): Fix bug for + addri, addri.c, subi, and subi.c when immediate number is hex. + (score_insns): Remove subis and subis.c. + (do_sub_rdi16): Delete. + +2007-05-11 Alan Modra -2006-01-11 Nick Clifton + * config/tc-spu.c (md_pseudo_table): Add int, long, quad. Call + spu_cons for word. + (md_assemble): Tidy use of insn.flag. + (get_imm): Likewise. Handle uppercase input too. + (spu_cons): New function. + * config/tc-spu.h (tc_fix_adjustable): Don't adjust SPU_PPU relocs. + (TC_FORCE_RELOCATION): Don't resolve them either. - Fixes for building on 64-bit hosts: - * config/tc-avr.c (mod_index): New union to allow conversion - between pointers and integers. - (md_begin, avr_ldi_expression): Use it. - * config/tc-i370.c (md_assemble): Add cast for argument to print - statement. - * config/tc-tic54x.c (subsym_substitute): Likewise. - * config/tc-mn10200.c (md_assemble): Use a union to convert the - opindex field of fr_cgen structure into a pointer so that it can - be stored in a frag. - * config/tc-mn10300.c (md_assemble): Likewise. - * config/tc-frv.c (frv_debug_tomcat): Use %p to print pointer - types. - * config/tc-v850.c: Replace uses of (int) casts with correct - types. +2007-05-05 Mark Shinwell + + * config/tc-arm.c (md_apply_fix): Generate more accurate + diagnostic when 8-bit immediate range is exceeded for + BFD_RELOC_ARM_OFFSET_IMM8. -2006-01-09 H.J. Lu +2007-05-04 Alan Modra - PR gas/2117 - * symbols.c (snapshot_symbol): Don't change a defined symbol. + PR gas/4460 + * config/tc-i386.c (lex_got): Don't replace the reloc token with + a space if we already have a space. -2006-01-03 Hans-Peter Nilsson +2007-05-03 H.J. Lu - PR gas/2101 - * config/tc-mmix.c (mmix_handle_mmixal): Don't treat #[0-9][FB] as - a local-label reference. + * config/tc-i386.c (match_template): Don't explicitly check + suffix for crc32 in Intel mode. + (process_suffix): Issue an error for crc32 if the operand size + is ambiguous. -For older changes see ChangeLog-2005 +2007-05-03 Vincent Riviere + Nick Clifton + + PR gas/3041 + * config/tc-m68k.c (relaxable_symbol): Do not relax weak symbols. + (tc_gen_reloc): Adjust the addend of relocs against weak symbols. + (md_apply_fix): Put zero values into the frags referencing weak + symbols. + +2007-05-02 Alan Modra + + PR 4448 + * config/tc-ppc.c (ppc_insert_operand): Don't increase min for + PPC_OPERAND_PLUS1. + +2007-05-01 H.J. Lu + + * config/tc-i386.c (match_template): Check suffix for crc32 in + Intel mdoe. + (process_suffix): Default the suffix of 8bit crc32 to + BYTE_MNEM_SUFFIX. + (check_byte_reg): Skip check for 8bit crc32. + +2007-04-30 H.J. Lu + + * config/tc-i386.c (md_assemble): Use register_prefix in + error/warning message. + (check_byte_reg): Likewise. + (check_long_reg): Likewise. + (check_qword_reg): Likewise. + (check_word_reg): Likewise. + (process_operands): Likewise. + +2007-04-30 Alan Modra + + PR 4436 + * config/tc-ppc.c (ppc_insert_operand): Disable range check if + min > max. + +2007-04-28 Thiemo Seufer + + * config/tc-mips.c: Fix comment. + +2007-04-26 Anatoly Sokolov + + * config/tc-avr.c (mcu_types): Add support for atmega8hva and + atmega16hva devices. Move at90usb82 device to 'avr5' architecture. + * doc/c-avr.texi: Document new devices. + +2007-04-24 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2007-04-23 Nathan Sidwell + + * config/tc-m68k.c (mcf54455_ctrl): New. + (HAVE_LONG_DISP, HAVE_LONG_CALL, HAVE_LONG_COND): New. + (m68k_archs): Add isac. + (m68k_cpus): Add 54455 family. + (m68k_ip): Split Bg into Bb, Bs, Bg. + (m68k_elf_final_processing): Add ISA_C. + * doc/c-m68k.texi (M680x0 Options): Add isac. + +2007-04-22 Alan Modra + + * read.c (read_a_source_file): Skip multiple spaces to + cover hack in mmix md_start_line_hook which overwrites a + colon with a space. Delete sermon and needless assertion. + +2007-04-21 Alan Modra + + * config/atof-vax.c (atof_vax_sizeof): Change return type to unsigned. + (md_atof): Make number_of_chars unsigned. Revert last change. + * config/tc-or32.c (md_apply_fix): Delete bogus assertions. + * config/tc-sh.c (sh_optimize_expr): Only define for OBJ_ELF. + * config/tc-sh.h (md_optimize_expr): Likewise. + * config/tc-sh64.c (shmedia_md_pcrel_from_section): Delete bogus + assertion. + * config/tc-xtensa.c (convert_frag_immed_finish_loop): Likewise. + +2007-04-21 Nick Clifton + + * config/atof-vax.c (md_atof): Fix comparison inside know(). + + * config/tc-ia64.c (emit_one_bundle): Fix typo. + +2007-04-21 Alan Modra + + * expr.c (expr): Assert on rankarg, not rank which can be unsigned. + * read.c (read_a_source_file): Remove buffer_limit[-1] assertion. + Don't skip over NUL char. + (pseudo_set): Set X_op for registers to O_register. + * symbols.c (symbol_clone): Remove assertion that sym is defined. + (resolve_symbol_value): Resolve O_register symbols. + * config/tc-i386.c (parse_real_register): Don't use i386_float_regtab. + Instead find st(0) by hash lookup. + * config/tc-ppc.c (ppc_macro): Warning fix. + + * as.h (ENABLE_CHECKING): Default define to 0. + (know): Assert if ENABLE_CHECKING. + (struct relax_type): Remove superfluous declaration. + * configure.in (--enable-checking): New. + * configure: Regenerate. + * config.in: Regenerate. + * config/tc-ppc.c (ppc_setup_opcodes): Do checks when ENABLE_CHECKING. + Check for duplicate powerpc_operands entries. + +2007-04-20 Nathan Sidwell + + * config/tc-m68k.c (mcf5253_ctrl): New. + (mcf52223_ctrl): New. + (m68k_cpus): Add 5253, 52221, 52223. + + * config/m68k-parse.h (RAMBAR_ALT): New. + * config/tc-m68k.c (mcf5206_ctrl, mcf5307_ctrl): New. + (mcf_ctrl, mcf5208_ctrl, mcf5210a_ctrl, mcf5213_ctrl, mcf52235_ctrl, + mcf5225_ctrl, mcf5235_ctrl, mcf5271_ctrl, mcf5275_ctrl, + mcf5282_ctrl, mcf5329_ctrl, mcf5373_ctrl, mcfv4e_ctrl, + mcf5475_ctrl, mcf5485_ctrl): Add RAMBAR synonym for + RAMBAR1. + (mcf5272_ctrl): Add RAMBAR0, replace add RAMBAR with RAMBAR_ALT. + (m68k_cpus): Adjust 5206, 5206e & 5307 entries. + (m68k_ip) : Detect when RAMBAR_ALT should be used. Add it + to control register mapping. + +2007-04-20 Alan Modra + + * messages.c (as_internal_value_out_of_range): Fix typo in + error message. Return after printing domain error. + * config/tc-ppc.c (ppc_insert_operand): Preserve low zero bits + in max when shifting right. + +2007-04-20 Alan Modra + + * messages.c (as_internal_value_out_of_range): Extend to report + errors for values with invalid low bits set. + * config/tc-ppc.c (ppc_setup_opcodes): Check powerpc_operands bitm + fields. Check that operands and opcode fields are disjoint. + (ppc_insert_operand): Check operands using mask rather than bit + count. Check low bits too. Handle PPC_OPERAND_PLUS1. Adjust + insertion code. + (md_apply_fix): Adjust for struct powerpc_operand change. + +2007-04-19 Paul Brook + + * config/tc-arm.c (md_assemble): Only allow 16-bit instructions on + Thumb-1. Add sanity check for bogus relaxations. + +2007-04-19 Paul Brook + + * config/tc-arm.c (insns): Allow rsb and rsbs on Thumb-1. + +2007-04-19 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2007-04-19 Nathan Froyd + + * doc/c-ppc.texi (PowerPC-Opts): Document -me500, -me500x2, -mspe. + +2007-04-18 H.J. Lu + + * doc/c-i386.texi; Document .ssse3, .sse4.1, .sse4.2 and .sse4. + +2007-04-18 H.J. Lu + + * config/tc-i386.c (cpu_arch): Add .sse4.2 and .sse4. + (match_template): Handle operand size for crc32 in SSE4.2. + (process_suffix): Handle operand type for crc32 in SSE4.2. + (output_insn): Support SSE4.2. + +2007-04-18 H.J. Lu + + * config/tc-i386.c (cpu_arch): Add .sse4.1. + (process_operands): Adjust implicit operand for blendvpd, + blendvps and pblendvb in SSE4.1. + (output_insn): Support SSE4.1. + +2007-04-18 Paul Brook + + * config/tc-arm.c (do_t_rsb): Use 16-bit encoding when possible. + +2007-04-16 Kaz Kojima + + * config/tc-sh.c (sh_handle_align): Call as_bad_where instead + of as_warn_where for misaligned data. + +2007-04-15 Kaz Kojima + + * config/tc-sh.c (align_test_frag_offset_fixed_p): Handle + rs_fill frags. + +2007-04-14 Steve Ellcey + + * Makefile.am: Add ACLOCAL_AMFLAGS. + * Makefile.in: Regenerate. + +2007-04-14 Kaz Kojima + + * config/tc-sh.c (align_test_frag_offset_fixed_p): New. + (sh_optimize_expr): Likewise. + * config/tc-sh.h (md_optimize_expr): Define. + (sh_optimize_expr): Prototype. + +2007-04-06 Matt Thomas + + * config/tc-vax.c (vax_cons): Added to support %pcrel{8,16,32}(exp) + to emit pcrel relocations by DWARF2 in non-code sections. Borrowed + heavily from tc-sparc.c. (vax_cons_fix_new): Likewise. + +2007-04-04 Kazu Hirata + + * config/tc-m68k.c (HAVE_LONG_BRANCH): Add fido_a. + +2007-04-04 Paul Brook + + * config/tc-arm.c (do_neon_ext): Enforce immediate range. + (insns): Use I15 for vext. + +2007-04-04 Paul Brook + + * configure.tgt: Loosen checks for arm uclinux eabi targets. + +2007-04-02 Sterling Augustine + + * config/tc-xtensa.c (xtensa_flush_pending_output): Check + outputting_stabs_line_debug. + +2007-03-26 Anatoly Sokolov + + * config/tc-avr.c (mcu_types): Add support for at90pwm1, at90usb82, + at90usb162, atmega325p, atmega329p, atmega3250p and atmega3290p + devices. + * doc/c-avr.texi: Document new devices. + +2007-04-02 Richard Sandiford + + * doc/as.texinfo: Add -mvxworks-pic to the list of MIPS options. + * doc/c-mips.texi (-KPIC, -mvxworks-pic): Document. + * config/tc-mips.c (md_show_usage): Mention -mvxworks-pic. + +2007-03-30 Sterling Augustine + Bob Wilson + + * config/tc-xtensa.c (xtensa_move_labels): Remove loops_ok argument. + Do not check is_loop_target flag. + (xtensa_frob_label): Adjust calls to xtensa_move_labels. + (xg_assemble_vliw_tokens): Likewise. Also avoid calling + xtensa_move_labels for alignment of loop opcodes. + +2007-03-30 H.J. Lu + + * config/tc-i386.c (process_suffix): Reindent a bit. + +2007-03-30 Paul Brook + + * config/tc-arm.c (encode_thumb2_ldmstm): New function. + (do_t_ldmstm): Generate 16-bit push/pop. Use encode_thumb2_ldmstm. + (do_t_push_pop): Use encode_thumb2_ldmstm. + +2007-03-29 DJ Delorie + + * config/tc-m32c.c (rl_for, relaxable): Protect argument. + (md_relax_table): Add entries for ADJNZ macros. + (M32C_Macros): Add ADJNZ macros. + (subtype_mappings): Add entries for ADJNZ macros. + (insn_to_subtype): Check for adjnz and sbjnz insns. + (md_estimate_size_before_relax): Pass insn to insn_to_subtype. + (md_convert_frag): Convert adjnz and sbjnz. + +2007-03-29 Nick Clifton + + * itbl-ops.c (itbl_entry): Remove unnecessary and excessively long + initialization. + * itbl-ops.h (enum e_processor): Initialise the e_nprocs field + using ITBL_NUMBER_OF_PROCESSORS. + * itbl-parse.y (yyerror): Remove use of redundant macro PARAMS. + +2007-03-28 H.J. Lu + + * config/tc-i386.c (build_modrm_byte): For instructions with 2 + register operands, encode destination in i.rm.regmem if its + RegMem bit is set. + +2007-03-28 Richard Sandiford + Phil Edwards + + * doc/as.texinfo: Put the contents after the title page rather + than at the end of the document. + +2007-03-27 Alan Modra + + * NEWS: Mention ".reloc". + +2007-03-26 Sterling Augustine + + * config/tc-xtensa.c (xg_translate_idioms): Allow assembly idioms + in FLIX instructions. + +2007-03-26 Julian Brown + + * config/tc-arm.c (arm_it): Add immisfloat field. + (parse_qfloat_immediate): Disallow integer syntax for floating-point + immediates. Fix hex immediates, handle 0.0 and -0.0 specially. + (parse_neon_mov): Set immisfloat bit for operand if it parsed as a + float. + (neon_cmode_for_move_imm): Reject non-float immediates for float + operands. + (neon_move_immediate): Pass immisfloat bit to neon_cmode_for_move_imm. + +2007-03-26 Julian Brown + + * doc/c-arm.texi: Add documentation for .dn/.qn directives. + +2007-03-26 Alan Modra + + * doc/as.texinfo (Reloc): Document. + * read.c (potable): Add "reloc". + (s_reloc): New function. + * write.c (reloc_list): New global var. + (resolve_reloc_expr_symbols): New function. + (write_object_file): Call it. + (write_relocs): Process reloc_list. + * write.h (struct reloc_list): New. + (reloc_list): Declare. + +2007-03-24 Paul Brook + + * config/tc-arm.c (do_t_ldmstm): Error on Thumb-2 addressing modes. + +2007-03-24 Paul Brook + Mark Shinwell + + * config/tc-arm.c (operand_parse_code): Add OP_oRRw. + (parse_operands): Don't expect comma if first operand missing. + Handle OP_oRRw. + (do_srs): Encode register number, checking it is r13. Update comment. + (insns): Update SRS entries to take a register. + +2007-03-23 H.J. Lu + + * config/tc-i386.c (md_begin): Allow '.' in mnemonic. + +2007-03-23 Mark Shinwell + + * config/tc-arm.c (md_apply_fix): Turn CBZ instructions that + attempt to jump to the next instruction into NOPs. + +2007-03-23 Alan Modra + + * config/tc-spu.c: Don't include opcode/spu.h. + (md_assemble): Set tc_fix_data.insn_tag and arg_format. + (md_apply_fix): Adjust. + * config/tc-spu.h: Include opcode/spu.h. + (struct tc_fix_info): New. + (TC_FIX_TYPE, TC_INIT_FIX_DATA): Adjust. + (TC_FORCE_RELOCATION): Define. + +2007-03-22 Joseph Myers + + * doc/as.texinfo: Include VERSION_PACKAGE when reporting version. + +2007-03-21 H.J. Lu + + * config/tc-i386.c (process_suffix): Check 0x90 instead of + xchg for xchg %rax,%rax. + +2007-03-21 H.J. Lu + + * config/tc-i386.c: Replace REX_MODE64, REX_EXTX, REX_EXTY + and REX_EXTZ with REX_W, REX_R, REX_X and REX_B respectively. + +2007-03-21 H.J. Lu + + PR binutils/4218 + * config/tc-i386.c (match_template): Properly handle 64bit mode + "xchg %eax, %eax". + +2007-03-21 Anton Ertl + + PR gas/4124 + * config/tc-alpha.c (emit_ustX): Fix ustq code generation. + +2007-03-21 H.J. Lu + + * Makefile.am: Run dep-am. + * Makefile.in: Regenerated. + + * config/tc-i386.c: Don't include "opcodes/i386-opc.h". + + * config/tc-i386.h: Include "opcodes/i386-opc.h". + (NOP_OPCODE): Removed. + (template): Likewise. + +2007-03-21 Andreas Schwab + + * config/tc-i386.h (NOP_OPCODE): Restore. + +2007-03-18 Mark Shinwell + + * config/tc-arm.c (do_mul): Don't warn about overlapping + Rd and Rm operands when assembling for v6 or above. + Correctly capitalize register names in the messages. + (do_mlas): Likewise. Delete spurious blank line. + +2007-03-16 Kazu Hirata + + * config/tc-m68k.c (m68k_cpus): Add an entry for fidoa. + +2007-03-15 H.J. Lu + + * config/tc-i386.c (md_begin): Use i386_regtab_size to scan + i386_regtab. + (parse_register): Use i386_regtab_size instead of ARRAY_SIZE + on i386_regtab. + +2007-03-15 Alexandre Oliva + + PR gas/4184 + * app.c (do_scrub_chars): PUT after setting states. + +2007-03-15 H.J. Lu + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerated. + + * config/tc-i386.c: Include "opcodes/i386-opc.h" instead of + "opcode/i386.h". + (md_begin): Check reg_name != NULL for the last entry in + i386_regtab. + + * config/tc-i386.h: Move many entries to opcode/i386.h and + opcodes/i386-opc.h. + + * configure.in (need_opcodes): Set true for i386. + * configure: Regenerated. + +2007-03-15 H.J. Lu + + * Makefile.am (REPORT_BUGS_TO): Removed. + (INCLUDES): Remove -DREPORT_BUGS_TO. + * Makefile.in: Regenerated. + + * configure.in (--with-bugurl): Removed. + * configure: Regenerated. + + * doc/Makefile.am (as_TEXINFOS): Remove gasver.texi. + (AM_MAKEINFOFLAGS): Add -I ../../bfd/doc. + (TEXI2DVI): Likewise. + (gasver.texi): Removed. + (MOSTLYCLEANFILES): Remove gasver.texi. + (as.1): Don't depend on gasver.texi. + * doc/Makefile.in: Regenerated. + + * doc/as.texi: Include bfdver.texi instead of gasver.texi. + +2007-03-14 Daniel Jacobowitz + + * config/tc-arm.c (arm_copy_symbol_attributes): New. + * config/tc-arm.h (arm_copy_symbol_attributes): Declare. + (TC_COPY_SYMBOL_ATTRIBUTES): Define. + * gas/symbols.c (copy_symbol_attributes): Use + TC_COPY_SYMBOL_ATTRIBUTES. + +2007-03-14 Paul Brook + + * config/tc-arm.c (T16_32_TAB): Fix dec_sp encoding. + +2007-03-14 Alan Modra + + PR 4029 + * write.c (relax_segment): Insert extra alignment padding + to break infinite relax loop when given impossible + gcc_except_table assembly. + +2007-03-12 H.J. Lu + + * config/tc-i386.c (md_assemble): Use Opcode_XXX instead of XXX + on i.tm.base_opcode. + (match_template): Likewise. + (process_operands): Use ~0x3 mask to match MOV_AX_DISP32. + + * config/tc-i386.h (Opcode_D): New. + (Opcode_FloatR): Likewise. + (Opcode_FloatD): Likewise. + (D): Redefined. + (W): Likewise. + (FloatMF): Likewise. + (FloatR): Likewise. + (FloatD): Likewise. + +2007-03-09 Alexandre Oliva + + * app.c (do_scrub_chars): Recognize comments after # line "file". + * read.c (get_linefile_number): New. + (s_app_line): Accept ill-formed .linefile lines as comments. + +2007-03-09 Alan Modra + + * config/tc-i386.h (WORKING_DOT_WORD): Define. + +2007-03-09 Alexandre Oliva + + * app.c (do_scrub_chars): Turn #"file"flags into .linefile. + * as.h (new_logical_line_flags): New. + * input-scrub.c (new_logical_line): Turned into wrapper for... + (new_logical_line_flags): this. Handle flags. + * read.c (potable): Add linefile. Adjust appline argument. + (s_app_file): Fake .appfiles no more. + (s_app_line): For .linefile, accept file name and flags. + +2007-03-08 Alan Modra + + * symbols.c (symbol_relc_make_sym): Comment typo fixes. + +2007-03-08 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * po/POTFILES.in: Regenerate. + +2007-03-07 Joseph Myers + + * configure.in (REPORT_BUGS_TEXI): Define to Texinfo version of + bug-reporting URL. + * doc/Makefile.am (gasver.texi): Define BUGURL. + * doc/as.texinfo: Use BUGURL. + * Makefile.in, configure, doc/Makefile.in: Regenerate. + +2007-03-06 Andreas Krebbel + + * config/tc-s390.c (md_parse_option): z9-ec option added. + +2007-03-02 Paul Brook + + * config/tc-arm.c (relax_immediate): Always return positive values. + (relaxed_symbol_addr): New function. + (relax_adr, relax_branch): Use it. + (arm_relax_frag): Pass strect argument. Adjust infinite loop check. + +2007-03-01 Joseph Myers + + * as.c (parse_args): Update copyright date. + +2007-02-28 Nathan Sidwell + + * configure.tgt (sh-*-uclinux, sh[12]-*-uclinux): Specify as elf. + +2007-02-28 Nick Clifton + + PR gas/3797 + * config/tc-d10v.c (do_assemble): Do not generate error messages, + just return -1 whenever a problem is encountered. + (md_assemble): If do_assemble returns -1 generate a non-fatal + error message and return. + + PR gas/2623 + * config/tc-msp430.c (line_separator_char): Change to '{'. + +2007-02-27 Alan Modra + + * config/tc-m68hc11.c (fixup24): Correct fixup size. + (build_jump_insn): Likewise. + (build_insn): Likewise. + (s_m68hc11_relax): Likewise. + +2007-02-27 Alan Modra + + * config/obj-elf.c (elf_frob_file): frag_wane any new frags. + +2007-02-25 Mark Shinwell + + * config/tc-arm.c (do_vfp_nsyn_pop): Use fldmias/fldmiad. + +2007-02-23 Alan Modra + + * config/tc-mn10300.c (md_convert_frag): Correct fixup size. + (md_assemble): Likewise. + +2007-02-22 Alan Modra + + * write.c (size_seg): Always clear SEC_RELOC here. + (install_reloc): New function, extracted from.. + (write_relocs): ..here. Combine RELOC_EXPANSION_POSSIBLE code + with !RELOC_EXPANSION_POSSIBLE code. Don't add fr_offset when + testing frag size. Set SEC_RELOC here. + +2007-02-21 Alan Modra + + PR 4082 + * config/tc-avr.h (TC_FX_SIZE_SLACK): Define. + +2007-02-20 Thiemo Seufer + + * doc/c-mips.texi: Document 74kc, 74kf, 74kx. + +2007-02-20 Thiemo Seufer + + * config/tc-mips.c (mips_cpu_info_table): Add 74K configurations. + +2007-02-20 Thiemo Seufer + Chao-Ying Fu + + * config/tc-mips.c (mips_set_options, mips_opts, file_ase_dspr2, + ISA_SUPPORTS_DSPR2_ASE, MIPS_CPU_ASE_DSPR2): Add DSP R2 ASE support. + (macro_build): Add case '2'. + (macro): Expand M_BALIGN to nop, packrl.ph or balign. + (validate_mips_insn): Add support for balign instruction. + (mips_ip): Handle DSP R2 instructions. Support balign instruction. + (OPTION_DSPR2, OPTION_NO_DSPR2, OPTION_COMPAT_ARCH_BASE, + md_parse_option, mips_after_parse_args): Add -mdspr2 and -mno-dspr2 + command line options. + (s_mipsset): Add support for .set dspr2 and .set nodspr2 directives. + (md_show_usage): Add -mdspr2 and -mno-dspr2 help output. + * doc/c-mips.texi, doc/as.texinfo: Document -mdspr2, -mno-dspr2, + .set dspr2, .set nodspr2. + +2007-02-20 Nathan Sidwell + + * config/tc-m68k.c (mcf5210a_ctrl, mcf52235_ctrl, mcf5225_ctrl): New. + (m68k_cpus): Add 5210a..5211a, 52230..52235 5224..5225. + +2007-02-18 Alan Modra + + * write.c (TC_FX_SIZE_SLACK): Define. + (write_relocs): Reinstate check for fixup within frag. + * config/tc-bfin.h (TC_FX_SIZE_SLACK): Define. + * config/tc-h8300.h (TC_FX_SIZE_SLACK): Define. + * config/tc-mmix.h (TC_FX_SIZE_SLACK): Define. + * config/tc-sh.h (TC_FX_SIZE_SLACK): Define. + * config/tc-xstormy16.h (TC_FX_SIZE_SLACK): Define. + +2007-02-17 Mark Mitchell + Nathan Sidwell + Vladimir Prus + + * configure.in (--with-bugurl): New option. + * configure: Regenerate. + * dep-in.sed: Remove bin-bugs.h. + * Makefile.am (REPORT_BUGS_TO): Define. + (INCLUDES): Define REPORT_BUGS_TO. + (DEP_INCLUDES): Likewise. + ($(OBJS)): No longer depend on bin-bugs.h. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + * as.c (show_usage): Don't print empty REPORT_BUGS_TO. + * as.h: Remove include of bin-bugs.h. + +2007-02-17 Alan Modra + + * write.c: White space fixes. + (fixup_segment): Move symbol_mri_common_p adjustments.. + (write_relocs): ..and symbol_equated_reloc_p adjustments.. + (adjust_reloc_syms): ..to here. + +2007-02-16 Alan Modra + + * subsegs.c (subseg_change, subseg_get): Use xcalloc rather than + xmalloc, memset. Don't bother assigning NULL to known zero mem. + (subseg_set_rest): Remove unnecessary cast. + * write.c: Include libbfd.h. Replace PTR with void * throughout. + Remove unnecessary forward declarations and casts. + (set_symtab): Delete extern bfd_alloc. + (fixup_segment): Move. + +2007-02-15 Nathan Sidwell + + * config/m68k-parse.h (m68k_register): Add ROMBAR0, ASID. + * config/tc-m68k.c (mcfv4e_ctrl): Add ColdFire specific names. + (mcf5475_ctrl, mcf5485_ctrl): New. + (m68k_cpus): Use mcf5485_ctrl and mcf5485_ctrl for those families. + (m68k_ip): Add ASID, MMUBAR, ROMBAR0 handling. + (init_table): Add asid, mmubar, adjust rombar0. + +2007-02-14 Alan Modra + + * config/tc-i386.h (Seg2ShortForm, Seg3ShortForm): Delete. + * config/tc-i386.c: Wrap overly long lines, whitespace fixes. + (process_operands): Move old Seg2ShortForm and Seg3ShortForm + code, and test for these insns using a combination of + opcode_modifier and operand_types. + +2007-02-07 Paul Brook + + * configure.tgt: Add arm*-*-uclinux-*eabi. + +2007-02-05 Dave Brolley + Richard Sandiford + DJ Delorie + Stan Cox + Jim Blandy + Nick Clifton + Jim Wilson + Frank Ch. Eigler + Graydon Hoare + Ben Elliston + John Healy + Richard Henderson + + * Makefile.am (CPU_TYPES): Add mep. + (TARGET_CPU_CFILES): Add tc-mep.c. + (TARGET_CPU_HFILES): Add tc-mep.h. + (DEPTC_mep_elf): New variable. + (DEPTC_mep_coff): Likewise. + (DEPOBJ_mep_coff, DEPOBJ_mep_elf, DEP_mep_coff, DEP_mep_elf): Likewise. + * configure.in: Support mep. + * configure.tgt: Likewise. + * config/tc-mep.c: New file. + * config/obj-elf.c: New file. + * config/tc-mep.c: New file. + * config/tc-mep.h: New file. + * testsuite/gas/mep: New testsuite with content. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2007-02-05 Dave Brolley + + * cgen.c (gas_cgen_install_complex_reloc): Removed. + (complex_reloc_installation_howto): Removed. + +2007-02-05 Dave Brolley + Graydon Hoare + DJ Delorie + Catherine Moore + Michael Chastain + Frank Ch. Eigler + + * symbols.c (use_complex_relocs_for): New, to decide + when to use complex relocs. Add signed RELC support. + (resolve_symbol_value): Call use_complex_relocs_for. Unconditionally + encode expression symbols as mangled complex relocation symbols (when + compiled with -DOBJ_COMPLEX_RELOC). + (symbol_relc_make_sym,value,expr): New traversal/conversion routines. + * cgen.c (gas_cgen_md_apply_fix3): Only set signed_p if RELC. Call + encode_addend with new args. Modify to get start, length from + ifield whenever it is set. Also change condition on which + self-describing relocs are encoded. Add hook into + gas_cgen_encode_addend. + (queue_fixup_recursively): Add signed RELC support. Change from masked + expr to trunc flag. Restore assignment of sub-field value to + temporary in fixups array. Reflect changed meaning of last arg to + queue_fixup_recursively. + (fixup): Add cgen_maybe_multi_ifield member. + (make_right_shifted_expr): New function. + (queue_fixup): Change to recursive function that fragments + fixups if operand has a multi-ifield. + (gas_cgen_parse_operand): Add RELC code to wrap expressions in + symbols, call weak_operand_overflow_check, and fragment call + queue_fixup with operand fields. + (gas_cgen_finish_insn) Modify to manage ifield pointer. + (weak_operand_overflow_check): New function to try to select + insns correctly. + (gas_cgen_encode_addend): New function for relc. + (gas_cgen_install_complex_reloc): Likewise. + (gas_cgen_tc_gen_reloc): Add hook into gas_cgen_install_complex_reloc. + * write.h (struct fix): Add msb_field_p to fx_cgen sub-struct. Add + cgen_maybe_multi_ifield field to fx_cgen substructure. + * cgen.h (GAS_CGEN_MAX_FIXUPS): Bump from 3 up to 32. + * symbols.h (symbol_relc_make_sym,value,expr): New prototypes. + +2007-02-03 DJ Delorie + + * config/tc-m32c.c (m32c_cons_fix_new): New. Added to support 3 + byte relocs. + * config/tc-m32c.h (TC_CONS_FIX_NEW): Define. + (m32c_cons_fix_new): Prototype. + +2007-02-02 Bob Wilson + + * config/tc-xtensa.c (xg_build_to_insn): Use tinsn_init. + (xg_expand_assembly_insn, istack_push_space, istack_pop): Likewise. + +2007-02-02 Bob Wilson + + * config/tc-xtensa.c (SUFFIX_MAP, suffix_relocs): New. + (xtensa_elf_suffix): Use suffix_relocs instead of local mapping table. + (map_suffix_reloc_to_operator): New. + (map_operator_to_reloc): New. + (expression_maybe_register): Fix incorrect test of return value from + xtensa_elf_suffix. Rearrange to use map_suffix_reloc_to_operator. + (xg_assemble_literal, convert_frag_immed): Use map_operator_to_reloc. + +2007-02-02 Bob Wilson + + * config/xtensa-istack.h (struct tinsn_struct): Delete fixup field. + (tinsn_get_tok): Delete prototype. + * config/tc-xtensa.c (tinsn_get_tok): Delete. + +2007-02-02 Bob Wilson + + * config/xtensa-relax.h (struct build_instr): Delete id field. + * config/xtensa-relax.c (widen_spec_list): Remove zeros from LITERAL + and LABEL tokens. + (append_literal_op, append_label_op): Remove litnum/labnum arguments; + set op_data fields to zero. + (parse_id_constant): Delete. + (build_transition): Remove code to handle numbered literals and labels. + +2007-02-02 Bob Wilson + + * config/xtensa-relax.c (build_transition): Remove code after as_fatal. + (build_transition_table): Likewise. + +2007-02-01 Bob Wilson + + * config/tc-xtensa.c (xg_add_opcode_fix, md_apply_fix): Delete use of + fx_tcbit. + * config/tc-xtensa.h (TC_FORCE_RELOCATION_LOCAL): Remove. + +2007-02-02 Alan Modra + + * write.h (struct fix ): Move. + (struct fix ): Rename to tcbit2. + * write.c (fix_new_internal): Adjust. + (TC_FORCE_RELOCATION_LOCAL): Don't test fx_plt. + * config/tc-arm.h (TC_FORCE_RELOCATION_LOCAL): Likewise. + * config/tc-cris.h (TC_FORCE_RELOCATION_LOCAL): Likewise. + * config/tc-i386.h (TC_FORCE_RELOCATION_LOCAL): Likewise. + * config/tc-i960.h (TC_FORCE_RELOCATION_LOCAL): Likewise. + * config/tc-sh.h (TC_FORCE_RELOCATION_LOCAL): Likewise. + * config/tc-sh64.h (TC_FORCE_RELOCATION_LOCAL): Likewise. + * config/tc-sparc.h (TC_FORCE_RELOCATION_LOCAL): Likewise. + * config/tc-msp430.c (msp430_force_relocation_local): Likewise. + * config/tc-ia64.c (emit_one_bundle): Don't set fx_plt. + * config/tc-ia64.h (TC_FORCE_RELOCATION_LOCAL): Don't test fx_plt. + Instead, compare fx_r_type. + * config/tc-xtensa.c (xg_add_opcode_fix, md_apply_fix): Use + fx_tcbit in place of fx_plt. + * config/tc-xtensa.h (TC_FORCE_RELOCATION_LOCAL): Define. + * doc/internals.texi (TC_FORCE_RELOCATION_LOCAL): Remove reference + to fx_plt. + +2007-01-30 Nick Clifton + + * as.c (main): Mark symbols created via the --defsym command line + option as volatile so that they can be overridden later on by a + .set directive. This maintains compatibility with the behaviour + of earlier versions of the assembler. + * doc/as.texinfo (--defsym): Document that the defined symbol's + value can be overridden via a .set directive. + +2007-01-28 H.J. Lu + + * config/tc-i386.c (swap_imm_operands): Renamed to ... + (swap_2_operands): This. Take 2 ints. + (md_assemble): Updated. + (swap_operands): Call swap_2_operands to swap 2 operands. + +2007-01-24 DJ Delorie + + * config/tc-m32c.c (md_pseudo_table): Add .3byte. + +2007-01-22 Nick Clifton + + PR gas/3871 + * tc-score.c: Remove unnecessary uses of _(). + Make the err_msg[] a file level local array in order to save + storage space. + Remove unnecessary sprintf()s. + +2007-01-18 Mei Ligang + + PR gas/3871 + * config/tc-score.c : Using _() for const string. + Do not assign inst.error with a local string pointer. + (md_section_align): Pad section. + +2007-01-13 H.J. Lu + + * config/tc-i386.c (build_modrm_byte): Check number of operands + when procssing memory/register operand. + +2007-01-12 Nick Clifton + + PR gas/3856 + * macro.c (expand_irp): Do not ignore spaces inside quoted + strings. + +2007-01-12 Alan Modra + + * config/tc-spu.h (TC_RELOC_RTSYM_LOC_FIXUP): Delete. + * config/tc-m32r.h (TC_RELOC_RTSYM_LOC_FIXUP): Delete. + * config/tc-mn10300.h (TC_RELOC_RTSYM_LOC_FIXUP): Delete. + (TC_FORCE_RELOCATION): Define. + (TC_FORCE_RELOCATION_LOCAL): Define. + * config/tc-mn10300.c (mn10300_fix_adjustable): Adjust. + +2007-01-12 Alan Modra + + * input-file.c (input_file_open): Check fgets return. + +2007-01-11 Paul Brook + + * config/tc-arm.c (do_t_add_sub): Use Rd and Rs. + +2007-01-11 Nick Clifton + + PR gas/3707 + * config/tc-arm.c (md_begin): Cope with an NULL mcpu_fpu_opt + variable. + + * config/tc-mcore.c (md_number_to_chars): Use + number_to_chars_{big|little}endian. + +2007-01-08 Kazu Hirata + + * config/tc-m68k.c (m68k_archs, m68k_cpus): Treat Fido as an + architecture by itself. + (m68k_ip): Don't issue a warning for tbl instructions on fido. + (m68k_elf_final_processing): Treat Fido as an architecture by + itself. + +2007-01-08 Kai Tietz + + * configure.tgt: Renamed target x86_64-*-mingw64 to x86_64-*-mingw* + +2007-01-05 H.J. Lu + + * config/tc-i386.c (set_intel_syntax): Update set_intel_syntax + depending on allow_naked_reg. + +2007-01-04 Paul Brook + + * config/tc-arm.c (do_cpsi): Set mmod bit for 2 argument form. + +2007-01-04 H.J. Lu + + PR gas/3830 + * config/tc-i386.c (register_prefix): New. + (set_intel_syntax): Set set_intel_syntax to "" if register + prefix isn't needed. + (check_byte_reg): Use register_prefix for error message. + (check_long_reg): Likewise. + (check_qword_reg): Likewise. + (check_word_reg): Likewise. + +2006-01-04 Julian Brown + + * config/tc-arm.c (do_neon_shl_imm): Swap rN, rM. + (do_neon_qshl_imm): Likewise. + (do_neon_rshl): New function. Handle rounding variants of + v{q}shl-by-register. + (insns): Use do_neon_rshl for vrshl, vqrshl. + +2007-01-04 Paul Brook + + * config/tc-arm.c (NEON_ENC_TAB): Fix encoding of vclt, vcle, vaclt + and vacle. + +2007-01-03 H.J. Lu + + * config/tc-i386.c (swap_operands): Remove branches. + +2007-01-03 H.J. Lu + + * config/tc-i386.c: Update copyright year. + * config/tc-i386.h: Likewise. + +2007-01-03 H.J. Lu + + * config/tc-i386.c (smallest_imm_type): Return unsigned int + instead of int. + +2007-01-03 H.J. Lu + + * config/tc-i386.c: Convert to ISO C90 formatting + * config/tc-i386.h: Likewise. + +2007-01-03 David Daney + + * config/tc-mips.c (md_show_usage): Clean up -mno-shared + documentation. + +For older changes see ChangeLog-2006 Local Variables: mode: change-log diff --git a/gas/ChangeLog-2006 b/gas/ChangeLog-2006 new file mode 100644 index 00000000000..dc933e5b050 --- /dev/null +++ b/gas/ChangeLog-2006 @@ -0,0 +1,2756 @@ +2006-12-30 H.J. Lu + + * config/tc-i386.h (ShiftCount): Fix a comment typo. + +2006-12-30 H.J. Lu + + * config/tc-i386.c (md_show_usage): Mention --32/--64. + +2006-12-29 H.J. Lu + + * config/tc-i386.c (build_modrm_byte): Handle shift count + register with 3 operands. + +2006-12-28 H.J. Lu + + * config/tc-i386.c (process_operands): Check i.reg_operands + and increment i.operands when adding a register operand. + (build_modrm_byte): Fix 4 operand instruction handling. + +2006-12-27 H.J. Lu + + * config/tc-i386.c (disp_expressions): Use MAX_MEMORY_OPERANDS + for array size instead of 2. + (im_expressions): Use MAX_IMMEDIATE_OPERANDS for for array size + instead of 2. + (i386_immediate): Update immediate operand overflow error + message. + (i386_displacement): Check displacement operand overflow. + +2006-12-27 H.J. Lu + + * config/tc-i386.c: Document tc-i386.c, not i386.c. + +2006-12-27 Kazu Hirata + + * config/m68k-parse.h (m68k_register): Add CAC and MBB. + * config/tc-m68k.c (fido_ctrl): New. + (m68k_archs): Use fido_ctrl for -mfidoa. + (m68k_cpus): Use fido_ctrl on fido-*-*. + (m68k_ip): Add support for CAC and MBB. + (init_table): Add CAC and MBB. + +2006-12-26 H.J. Lu + + * config/tc-i386.c (i386_immediate): Remove prototype. + +2006-12-25 Kazu Hirata + + * config/tc-m68k.c (cpu_of_arch): Add fido. + (m68k_archs, m68k_cpu): Add entries for fido. + (m68k_elf_final_processing): Handle EF_M68K_CPU32_FIDO_A. + +2006-12-25 Mei Ligang + + * config/tc-score.c (build_lw_pic): Rename as build_lwst_pic. + Delete the code handling large constant for PIC. + Modify some comments. + (score_relax_frag): Decrease insn_addr in certain situation. + (s_score_cprestore): Change .cprestore syntax from ".cprestore offset" + to ".cprestore reg, offset". + +2006-12-23 Kazu Hirata + + * configure.tgt: Recognize fido. + +2006-12-15 H.J. Lu + + * config/tc-i386.c: Add a blank line bewteen function bodies. + +2006-12-15 H.J. Lu + + * config/tc-i386.c (build_modrm_byte): Reformat to 72 columns. + +2006-12-14 Daniel Jacobowitz + + * Makefile.am (YFLAGS): Define. + * Makefile.in: Regenerated. + +2006-12-14 H.J. Lu + + * config/tc-i386.c (match_template): Simplify 3 and 4 operand + match. + +2006-12-13 H.J. Lu + + * config/tc-i386.c (build_modrm_byte): Set the Operand_PCrel + bit only. + +2006-12-13 H.J. Lu + + * config/tc-i386.c (match_template): Use a for loop to set + operand_types array. + +2006-12-13 H.J. Lu + + PR gas/3712 + * config/tc-i386.c (match_template): Use MAX_OPERANDS for the + number of operands. Issue an error if MAX_OPERANDS != 4. Add + the 4th operand check. + +2006-12-13 Paul Brook + + * config/tc-arm.c (arm_arch_option_table): Add v7-{a,r,m}. + * doc/c-arm.texi: Fix spelling of ARMv7 profile variants. + +2006-12-12 H.J. Lu + + * config/tc-i386.h (WordMem): Document it for 64 bit memory + reference. + +2006-12-12 Daniel Jacobowitz + + * doc/Makefile.am (as_TEXINFOS): Set. + (as.info as.dvi as.html): Delete rule. + * doc/Makefile.in: Regenerated. + +2006-12-11 Daniel Jacobowitz + + * configure.in: Define GENINSRC_NEVER. + * doc/Makefile.am (as.info): Remove srcdir prefix. + (MAINTAINERCLEANFILES): Add info file. + (DISTCLEANFILES): Pretend to add info file. + * po/Make-in (.po.gmo): Put gmo files in objdir. + * configure, Makefile.in, doc/Makefile.in: Regenerated. + +2006-12-09 H.J. Lu + + * config/tc-i386.h (template): Use MAX_OPERANDS instead of 4 + for operand_types array. + +2006-12-08 Christian Groessler + + * config/tc-z8k.c (whatreg): Add comment describing function. + Return NULL if symbol name characters follow the register number. + (parse_reg): Use NULL instead of 0 for pointer values. Stop + processing if whatreg returned NULL. + +2006-12-07 Kazu Hirata + + * config/tc-m68k.c: Update uses of EF_M68K_*. + +2006-12-06 H.J. Lu + + * config/tc-i386.h: Change the prefix order to SEG_PREFIX, + ADDR_PREFIX, DATA_PREFIX, LOCKREP_PREFIX. + +2006-12-02 Jakub Jelinek + + PR gas/3607 + * subsegs.c (subseg_set_rest): Clear frch_cfi_data field. + +2006-12-01 Paul Brook + + * config/tc-arm.c (arm_force_relocation): Return 1 for relocs against + function symbols. + +2006-11-29 Paul Brook + + * config/tc-arm.c (arm_is_eabi): New function. + * config/tc-arm.h (arm_is_eabi): New prototype. + (THUMB_IS_FUNC): Use ELF function type for EABI objects. + * doc/c-arm.texi (.thumb_func): Update documentation. + +2006-11-29 Paul Brook + + * config/tc-arm.c (do_vfp_sp_const, do_vfp_dp_const): Fix operans + encoding. + +2006-11-27 Sterling Augustine + + * config/tc-xtensa.c (xtensa_sanity_check): Check for RELAX_IMMED + as the first slot_subtype, not the frag subtype. + +2006-11-27 Bob Wilson + + * config/tc-xtensa.c (XSHAL_ABI): Add default definition. + (directive_state): Disable scheduling by default. + (xtensa_add_config_info): New. + (xtensa_end): Call xtensa_add_config_info. + +2006-11-27 Eric Botcazou + + * config/tc-sparc.c (tc_gen_reloc): Turn aligned relocs into + their unaligned counterparts in debugging sections. + +2006-11-24 Alan Modra + + * config/tc-spu.c (md_pseudo_table): Add eqv and .eqv. + +2006-11-22 Daniel Jacobowitz + + * config/tc-arm.h (md_cons_align): Define. + (mapping_state): New prototype. + * config/tc-arm.c (mapping_state): Make global. + +2006-11-22 Alan Modra + + * config/obj-elf.c (obj_elf_version): Use memcpy rather than strcpy. + +2006-11-16 Mei ligang + + * config/tc-score.c (score_relax_frag): If next frag contains 32 bit + branch instruction, handle it specially. + (score_insns): Modify 32 bit branch instruction. + +2006-11-16 Alan Modra + + * symbols.c (resolve_symbol_value): Formatting. + +2006-11-15 Jan Beulich + + PR/3469 + * symbols.c (symbol_clone): Mark symbol ending up not on symbol + chain by linking it to itself. + (resolve_symbol_value): Also check symbol_shadow_p(). + (symbol_shadow_p): New. + * symbols.h (symbol_shadow_p): Declare. + +2006-11-12 Mark Shinwell + + * config/tc-arm.c (do_t_czb): Rename to do_t_cbz. + (insns): Adjust accordingly. + (md_apply_fix): Alter comments to use CBZ instead of CZB. + +2006-11-10 Pedro Alves + + * config/tc-arm.c (arm_fix_adjustable) [OBJ_COFF]: Delete. + (arm_fix_adjustable) [OBJ_ELF]: Use it on coff targets too. + +2006-11-10 Nick Clifton + + PR gas/3456: + * config/obj-elf.c (obj_elf_version): Do not include the name + field's padding in the namesz value. + +2006-11-09 Thiemo Seufer + + * config/tc-mips.c: Fix outdated comment. + +2006-11-08 H.J. Lu + + * config/tc-i386.h (CpuPNI): Removed. + (CpuUnknownFlags): Replace CpuPNI with CpuSSE3. + * config/tc-i386.c (md_assemble): Likewise. + +2006-11-08 Alan Modra + + * symbols.c (symbol_create, symbol_clone): Don't set udata.p. + +2006-11-06 David Daney + + * config/tc-mips.c (pic_need_relax): Return true for section symbols. + +2006-11-06 Thiemo Seufer + + * doc/c-mips.texi (-march): Document sb1a. + +2006-11-06 Thiemo Seufer + + * config/tc-mips.c (mips_cpu_info_table): Remove 24k/24ke aliases. + 34k always has DSP ASE. + +2006-11-03 Thiemo Seufer + + * config/tc-mips.c (md_pcrel_from_section): Disallow PC relative + MIPS16 instructions referencing other sections, unless they are + external branches. + +2006-11-03 Thiemo Seufer + + * config/tc-mips.c (mips_cpu_info_table): The 25Kf is a MIPS64 + release 1 CPU. + +2006-11-03 Jakub Jelinek + + * dw2gencfi.c (struct fde_entry): Add per_encoding, lsda_encoding, + personality and lsda. + (struct cie_entry): Add per_encoding, lsda_encoding and personality. + (alloc_fde_entry): Initialize per_encoding and lsda_encoding. + (cfi_pseudo_table): Handle .cfi_personality and .cfi_lsda. + (dot_cfi_personality, dot_cfi_lsda, encoding_size): New functions. + (output_cie): Output personality including its encoding and LSDA encoding. + (output_fde): Output LSDA. + (select_cie_for_fde): Don't share CIE if personality, its encoding or + LSDA encoding are different. Copy the 3 fields from fde_entry to + cie_entry. + * doc/as.texinfo (.cfi_personality, .cfi_lsda): Document. + + * subsegs.h (struct frchain): Add frch_cfi_data field. + * dw2gencfi.c: Include subsegs.h. + (cur_fde_data, last_address, cur_cfa_offset, cfa_save_stack): Removed. + (struct frch_cfi_data): New type. + (unused_cfi_data): New variable. + (alloc_fde_entry): Move cur_fde_data, last_address, cur_cfa_offset + and cfa_save_stack static vars into a structure pointed from + each frchain. + (alloc_cfi_insn_data, cfi_new_fde, cfi_end_fde, cfi_set_return_column, + cfi_add_advance_loc, cfi_add_CFA_def_cfa, cfi_add_CFA_def_cfa_offset, + cfi_add_CFA_remember_state, cfi_add_CFA_restore_state, dot_cfi, + dot_cfi_escape, dot_cfi_startproc, dot_cfi_endproc, cfi_finish): + Likewise. + +2006-11-02 Daniel Jacobowitz + + * config/tc-h8300.c (build_bytes): Fix const warning. + +2006-11-01 Mei Ligang + + * tc-score.c (do16_rdrs): Handle not! instruction especially. + +2006-10-31 Paul Brook + + * config/tc-arm.c (arm_adjust_symtab): Don't use STT_ARM_16BIT + for EABIv4. + +2006-10-31 Paul Brook + + gas/ + * config/tc-arm.c (object_arch): New variable. + (s_arm_object_arch): New function. + (md_pseudo_table): Add object_arch. + (aeabi_set_public_attributes): Obey object_arch. + * doc/c-arm.texi: Document .object_arch. + +2006-10-31 Mei Ligang + + * tc-score.c (data_op2): Check invalid operands. + (my_get_expression): Const operand of some instructions can not be + symbol in assembly. + (get_insn_class_from_type): Handle instruction type Insn_internal. + (do_macro_ldst_label): Modify inst.type. + (Insn_PIC): Delete. + (data_op2): The immediate value in lw is 15 bit signed. + +2006-10-29 Randolph Chung + + * config/tc-hppa.c (hppa_cfi_frame_initial_instructions) + (hppa_regname_to_dw2regnum): New funcions. + * config/tc-hppa.h [OBJ_ELF] (TARGET_USE_CFIPOP): Define. + (tc_cfi_frame_initial_instructions) + (tc_regname_to_dw2regnum): Define. + (hppa_cfi_frame_initial_instructions) + (hppa_regname_to_dw2regnum): Declare. + (DWARF2_LINE_MIN_INSN_LENGTH, DWARF2_DEFAULT_RETURN_COLUMN) + (DWARF2_CIE_DATA_ALIGNMENT): Define. + +2006-10-29 Nick Clifton + + * config/tc-spu.c (md_assemble): Cast printf string size parameter + to int in order to avoid a compiler warning. + +2006-10-27 Andrew Stubbs + + * config/tc-sh.c (md_assemble): Define size of branches. + +2006-10-26 Ben Elliston + + * dw2gencfi.c (cfi_add_CFA_offset): + Assert DWARF2_CIE_DATA_ALIGNMENT is non-zero. + + * write.c (chain_frchains_together_1): Assert that this function + never returns a pointer to the auto variable `dummy'. + +2006-10-25 Trevor Smigiel + Yukishige Shibata + Nobuhisa Fujinami + Takeaki Fukuoka + Alan Modra + + * config/tc-spu.c: New file. + * config/tc-spu.h: New file. + * configure.tgt: Add SPU support. + * Makefile.am: Likewise. Run "make dep-am". + * Makefile.in: Regenerate. + * po/POTFILES.in: Regenerate. + +2006-10-25 Ben Elliston + + * expr.c (expr): Replace O_add case in switch (op_left) explaining + why it can never occur. + +2006-10-24 Andrew Pinski + + * doc/c-ppc.texi (-mcell): Document. + * config/tc-ppc.c (parse_cpu): Parse -mcell. + (md_show_usage): Document -mcell. + +2006-10-23 Dwarakanath Rajagopal + + * doc/c-i386.texi : Document amdfam10,.sse4a and .abm in cpu_type. + +2006-10-23 Alan Modra + + * config/tc-m68hc11.c (md_assemble): Quiet warning. + +2006-10-19 Mike Frysinger + + * config/tc-i386.c (md_parse_option): Use CONST_STRNEQ. + (x86_64_section_letter): Likewise. + +2006-10-19 Mei Ligang + + * config/tc-score.c (build_relax_frag): Compute correct + tc_frag_data.fixp. + +2006-10-18 Roy Marples + + * config/tc-sparc.c (md_parse_option): Treat any target starting with + elf32-sparc as a viable target for the -32 switch and any target + starting with elf64-sparc as a viable target for the -64 switch. + (sparc_target_format): For 64-bit ELF flavoured output use + ELF_TARGET_FORMAT64 while for 32-bit ELF flavoured output use + ELF_TARGET_FORMAT. + * config/tc-sparc.h (ELF_TARGET_FORMAT, ELF_TARGET_FORMAT64): Define. + +2006-10-17 H.J. Lu + + * configure: Regenerated. + +2006-10-16 Bernd Schmidt + + * input-scrub.c (input_scrub_next_buffer): Use TC_EOL_IN_INSN + in addition to testing for '\n'. + (TC_EOL_IN_INSN): Provide a default definition if necessary. + +2006-10-13 Sterling Augstine + + * dwarf2dbg.c (out_debug_info): Use TC_DWARF2_EMIT_OFFSET to emit + a disjoint DW_AT range. + +2006-10-13 Mei Ligang + + * config/tc-score.c (md_show_usage): Print -KPIC option usage. + +2006-10-08 Paul Brook + + * config/tc-arm.c (parse_big_immediate): 64-bit host fix. + (parse_operands): Use parse_big_immediate for OP_NILO. + (neon_cmode_for_logic_imm): Try smaller element sizes. + (neon_cmode_for_move_imm): Ditto. + (do_neon_logic): Handle .i64 pseudo-op. + +2006-09-29 Alan Modra + + * po/POTFILES.in: Regenerate. + +2006-09-28 H.J. Lu + + * config/tc-i386.h (CpuMNI): Renamed to ... + (CpuSSSE3): This. + (CpuUnknownFlags): Updated. + (processor_type): Replace PROCESSOR_YONAH with PROCESSOR_CORE + and PROCESSOR_MEROM with PROCESSOR_CORE2. + * config/tc-i386.c: Updated. + * doc/c-i386.texi: Likewise. + + * config/tc-i386.c (cpu_arch): Add ".ssse3", "core" and "core2". + +2006-09-28 Bridge Wu + + * config/tc-arm.c (md_apply_fix): Do not clear write_back bit. + +2006-09-27 Nick Clifton + + * output-file.c (output_file_close): Prevent an infinite loop + reporting that stdoutput could not be closed. + +2006-09-26 Mark Shinwell + Joseph Myers + Ian Lance Taylor + Ben Elliston + + * config/tc-arm.c (arm_cext_iwmmxt2): New. + (enum operand_parse_code): New code OP_RIWR_I32z. + (parse_operands): Handle OP_RIWR_I32z. + (do_iwmmxt_wmerge): New function. + (do_iwmmxt_wldstd): Handle iwmmxt2 case where second operand is + a register. + (do_iwmmxt_wrwrwr_or_imm5): New function. + (insns): Mark instructions as RIWR_I32z as appropriate. + Also add torvsc, wabs, wabsdiff, + waddbhus, waddhc, waddwc, waddsubhx, wavg4{r}, wmaddu{x,n}, + wmadds{x,n}, wmerge, wmiaxy{n}, wmiawxy{n}, wmul{r}, + wmulw{r}, wqmiaxy{n}, wqmulm{r}, wqmulwm{r}, wsubaddhx. + (md_begin): Handle IWMMXT2. + (arm_cpus): Add iwmmxt2. + (arm_extensions): Likewise. + (arm_archs): Likewise. + +2006-09-25 Bob Wilson + + * doc/as.texinfo (Overview): Revise description of --keep-locals. + Add xref to "Symbol Names". + (L): Refer to "local symbols" instead of "local labels". Move + definition to "Symbol Names" section; add xref to that section. + (Symbol Names): Use "Local Symbol Names" section to define local + symbols. Add "Local Labels" heading for description of temporary + forward/backward labels, and refer to those as "local labels". + +2006-09-23 H.J. Lu + + PR binutils/3235 + * config/tc-i386.c (match_template): Check address size prefix + to turn Disp64/Disp32/Disp16 operand into Disp32/Disp16/Disp32 + operand. + +2006-09-22 Alan Modra + + * config/tc-ppc.c (ppc_symbol_chars): Remove '+' and '-'. + +2006-09-22 Alan Modra + + * as.h (as_perror): Delete declaration. + * gdbinit.in (as_perror): Delete breakpoint. + * messages.c (as_perror): Delete function. + * doc/internals.texi: Remove as_perror description. + * listing.c (listing_print: Don't use as_perror. + * output-file.c (output_file_create, output_file_close): Likewise. + * symbols.c (symbol_create, symbol_clone): Likewise. + * write.c (write_contents): Likewise. + * config/obj-som.c (obj_som_version, obj_som_copyright): Likewise. + * config/tc-tic54x.c (tic54x_mlib): Likewise. + +2006-09-22 Alan Modra + + * config/tc-ppc.c (md_section_align): Don't round up address for ELF. + (ppc_handle_align): New function. + * config/tc-ppc.h (HANDLE_ALIGN): Use ppc_handle_align. + (SUB_SEGMENT_ALIGN): Define as zero. + +2006-09-20 Bob Wilson + + * doc/as.texinfo: Fix cross reference usage, typos and grammar. + (Overview): Skip cross reference in man page. + +2006-09-20 Kai Tietz + + * configure.in: Add new target x86_64-pc-mingw64. + * configure: Regenerate. + * configure.tgt: Add new target x86_64-pc-mingw64. + * config/obj-coff.h: Add handling for TE_PEP target specific code + and definitions. + * config/tc-i386.c: Add new targets. + (md_parse_option): Add targets to OPTION_64. + (x86_64_target_format): Add new method for setup proper default + target cpu mode. + * config/te-pep.h: Add new target definition header. + (TE_PEP): New macro: Identifies new target architecture. + (COFF_WITH_pex64): Set proper includes in bfd. + * NEWS: Mention new target. + +2006-09-18 Bernd Schmidt + + * config/bfin-parse.y (binary): Change sub of const to add of negated + const. + +2006-09-17 Mei Ligang + + * config/tc-score.c: New file. + * config/tc-score.h: Newf file. + * configure.tgt: Add Score target. + * Makefile.am: Add Score files. + * Makefile.in: Regenerate. + * NEWS: Mention new target support. + +2006-09-16 Paul Brook + + * config/tc-arm.c (s_arm_unwind_movsp): Add offset argument. + * doc/c-arm.texi (movsp): Document offset argument. + +2006-09-16 Paul Brook + + * config/tc-arm.c (thumb32_negate_data_op): Consistently use + unsigned int to avoid 64-bit host problems. + +2006-09-15 Bernd Schmidt + + * config/bfin-parse.y (binary): Do some more constant folding for + additions. + +2006-09-13 Jan Beulich + + * input-file.c (input_file_give_next_buffer): Demote as_bad to + as_warn. + +2006-09-13 Alan Modra + + PR gas/3165 + * config/tc-sh (DWARF2_CIE_DATA_ALIGNMENT): Wrap negative number + in parens. + +2006-09-13 Alan Modra + + * input-file.c (input_file_open): Replace as_perror with as_bad + so that gas exits with error on file errors. Correct error + message. + (input_file_get, input_file_give_next_buffer): Likewise. + * input-file.h: Update comment. + +2006-09-11 Tomas Frydrych + + PR gas/3172 + * config/tc-arm.c (parse_typed_reg_or_scalar): Accept wCg class + registers as a sub-class of wC registers. + +2006-09-11 Alan Modra + + PR gas/3165 + * config/tc-mips.h (enum dwarf2_format): Forward declare. + (DWARF2_CIE_DATA_ALIGNMENT): Wrap negative number in parens. + * config/tc-alpha.h (DWARF2_CIE_DATA_ALIGNMENT): Likewise. + * config/tc-arm.h (DWARF2_CIE_DATA_ALIGNMENT): Likewise. + +2006-09-08 Nick Clifton + + PR gas/3129 + * doc/as.texinfo (Macro): Improve documentation about separating + macro arguments from following text. + +2006-09-08 Paul Brook + + * config/tc-arm.c (insns): Allow ARM IT pseudo-insn on all cores. + +2006-09-07 Paul Brook + + * config/tc-arm.c (parse_operands): Mark operand as present. + +2006-09-04 Paul Brook + + * config/tc-arm.c (do_neon_dyadic_if_i): Remove. + (do_neon_dyadic_if_i_d): Avoid setting U bit. + (do_neon_mac_maybe_scalar): Ditto. + (do_neon_dyadic_narrow): Force operand type to NT_integer. + (insns): Remove out of date comments. + +2006-08-29 Nick Clifton + + * read.c (s_align): Initialize the 'stopc' variable to prevent + compiler complaints about it being used without being + initialized. + (s_comm_internal, s_mri_common, s_fail, s_globl, s_space, + s_float_space, s_struct, cons_worker, equals): Likewise. + +2006-08-29 Malcolm Parsons + + * ecoff.c (ecoff_directive_val): Fix message typo. + * config/tc-ns32k.c (convert_iif): Likewise. + * config/tc-sh64.c (shmedia_check_limits): Likewise. + +2006-08-25 Sterling Augustine + Bob Wilson + + * config/tc-xtensa.c (xtensa_mark_literal_pool_location): Do not check + the state of the absolute_literals directive. Remove align frag at + the start of the literal pool position. + +2006-08-25 Bob Wilson + + * doc/c-xtensa.texi: Add @group commands in examples. + +2006-08-24 Bob Wilson + + * config/tc-xtensa.c (FINI_LITERAL_SECTION_NAME): Delete. + (INIT_LITERAL_SECTION_NAME): Delete. + (lit_state struct): Remove segment names, init_lit_seg, and + fini_lit_seg. Add lit_prefix and current_text_seg. + (init_literal_head_h, init_literal_head): Delete. + (fini_literal_head_h, fini_literal_head): Delete. + (xtensa_begin_directive): Move argument parsing to + xtensa_literal_prefix function. + (xtensa_end_directive): Deallocate lit_prefix field of lit_state. + (xtensa_literal_prefix): Parse the directive argument here and + record it in the lit_prefix field. Remove code to derive literal + section names. + (linkonce_len): New. + (get_is_linkonce_section): Use linkonce_len. Check for any + ".gnu.linkonce.*" section, not just text sections. + (md_begin): Remove initialization of deleted lit_state fields. + (xtensa_reorder_segments, xtensa_post_relax_hook): Remove references + to init_literal_head and fini_literal_head. + (xtensa_move_literals): Likewise. Skip literals for .init and .fini + when traversing literal_head list. + (match_section_group): New. + (cache_literal_section): Rewrite to determine the literal section + name on the fly, create the section and return it. + (xtensa_switch_to_literal_fragment): Adjust for cache_literal_section. + (xtensa_switch_to_non_abs_literal_fragment): Likewise. + (xtensa_create_property_segments, xtensa_create_xproperty_segments): + Use xtensa_get_property_section from bfd. + (retrieve_xtensa_section): Delete. + * doc/c-xtensa.texi (Xtensa Options): Fix --text-section-literals + description to refer to plural literal sections and add xref to + the Literal Directive section. + (Literal Directive): Describe new rules for deriving literal section + names. Add footnote for special case of .init/.fini with + --text-section-literals. + (Literal Prefix Directive): Replace old naming rules with xref to the + Literal Directive section. + +2006-08-21 Joseph Myers + + * config/tc-arm.c (s_arm_unwind_save_mmxwr): Correct condition for + merging with previous long opcode. + +2006-08-22 Pedro Alves + + * Makefile.am (TARG_ENV_HFILES): Add te-wince-pe.h. + * Makefile.in: Regenerate. + * config/tc-arm.h [TARGET_FORMAT]: ARM wince bfd names were + renamed. Adjust. + +2006-08-16 Julian Brown + + * config/tc-arm.c (md_assemble): Improve diagnostic when attempting + to use ARM instructions on non-ARM-supporting cores. + (autoselect_thumb_from_cpu_variant): New function. Switch on Thumb + mode automatically based on cpu variant. + (md_begin): Call above function. + +2006-08-16 Julian Brown + + * config/tc-arm.c (opcode_lookup): Allow Neon type suffixes to be + recognized in non-unified syntax mode. + +2006-08-15 Thiemo Seufer + Nigel Stephens + David Ung + + * configure.tgt: Handle mips*-sde-elf*. + +2006-08-12 Thiemo Seufer + + * config/tc-mips.c (mips16_ip): Fix argument register handling + for restore instruction. + +2006-08-08 Bob Wilson + + * dwarf2dbg.c (DWARF2_USE_FIXED_ADVANCE_PC): New. + (out_sleb128): New. + (out_fixed_inc_line_addr): New. + (process_entries): Use out_fixed_inc_line_addr when + DWARF2_USE_FIXED_ADVANCE_PC is set. + * config/tc-xtensa.h (DWARF2_USE_FIXED_ADVANCE_PC): Define. + +2006-08-08 DJ Delorie + + * config/tc-sh.c (sh_frob_section): Canonicalize pointers to local + vs full symbols so that we never have more than one pointer value + for any given symbol in our symbol table. + +2006-08-08 Sterling Augustine + + * dwarf2dbg.c (out_debug_info): Add new parameter ranges_seg + and emit DW_AT_ranges when code in compilation unit is not + contiguous. + (out_debug_abbrev): Emit DW_AT_ranges abbreviation if code in + is not contiguous. + (dwarf2_finish): Create and pass ranges_seg to out_debug_info. + (out_debug_ranges): New function to emit .debug_ranges section + when code is not contiguous. + +2006-08-08 Nick Clifton + + * config/tc-arm.c (WARN_DEPRECATED): Enable. + +2006-08-05 Pedro Alves + + * config/tc-arm.c: Move "dwarf2dbg.h" inclusion out of OBJ_ELF + only block. + (pe_directive_secrel) [TE_PE]: New function. + (md_pseudo_table) [!OBJ_ELF]: Handle 2byte, 4byte, 8byte, file, + loc, loc_mark_labels. + [TE_PE]: Handle secrel32. + (output_relax_insn): Remove OBJ_ELF around dwarf2_emit_insn + call. + (output_inst): Remove OBJ_ELF around dwarf2_emit_insn call. + (arm_frob_label): Remove OBJ_ELF around dwarf2_emit_label call. + (md_section_align): Only round section sizes here for AOUT + targets. + (tc_arm_regname_to_dw2regnum): Move out for OBJ_ELF only block. + (tc_pe_dwarf2_emit_offset): New function. + (md_apply_fix) [TE_PE]: Handle BFD_RELOC_32_SECREL. + (cons_fix_new_arm): Handle O_secrel. + * config/tc-arm.h : Move DWARF2_LINE_MIN_INSN_LENGTH, + DWARF2_DEFAULT_RETURN_COLUMN and DWARF2_CIE_DATA_ALIGNMENT out + of OBJ_ELF only block. + [TE_PE]: Define O_secrel, TC_DWARF2_EMIT_OFFSET, and declare + tc_pe_dwarf2_emit_offset. + +2006-08-04 Richard Sandiford + + * config/tc-sh.c (apply_full_field_fix): New function. + (md_apply_fix): Use it instead of md_number_to_chars. Do not fill + in fx_addnumber for BFD_RELOC_32_PLT_PCREL. + (tc_gen_reloc): Use fx_addnumber rather than 0 as the default case. + * config/tc-sh.h (TARGET_FORMAT): Override for TE_VXWORKS. + +2006-08-03 Nick Clifton + + PR gas/2991 + * config.in: Regenerate. + +2006-08-03 Joseph Myers + + * config/tc-arm.c (parse_operands): Handle invalid register name + for OP_RIWR_RIWC. + +2006-08-03 Joseph Myers + + * config/tc-arm.c (enum operand_parse_code): Add OP_RIWC_RIWG. + (parse_operands): Handle it. + (insns): Use it for tmcr and tmrc. + +2006-08-02 Petr Salinger + + PR binutils/2983 + * config/tc-i386.c (md_parse_option): Treat any target starting + with elf64_x86_64 as a viable target for the -64 switch. + (i386_target_format): For 64-bit ELF flavoured output use + ELF_TARGET_FORMAT64. + * config/tc-i386.h (ELF_TARGET_FORMAT64): Define. + +2006-08-02 Nick Clifton + + PR gas/2991 + * acinclude.m4 (BFD_BINARY_FOPEN): Import this function from + bfd/aclocal.m4. + * configure.in: Run BFD_BINARY_FOPEN. + * configure: Regenerate. + * as.h: Look at USE_BINARY_FOPEN to decide which fopen-*.h header + file to include. + +2006-08-01 H.J. Lu + + * config/tc-i386.c (md_assemble): Don't update + cpu_arch_isa_flags. + +2006-08-01 Thiemo Seufer + + * config/tc-mips.c (md_section_align): Check ELF-ness at runtime. + +2006-08-01 Thiemo Seufer + + * config/tc-mips.c (macro_build_lui): Fix comment formatting. + (md_apply_fix): Likewise. Unify handling of BFD_RELOC_RVA, + BFD_RELOC_32 and BFD_RELOC_16. + (s_align, s_cpload, s_cplocal, s_cprestore, s_mips_stab, + md_convert_frag, md_obj_end): Fix comment formatting. + +2006-07-31 Thiemo Seufer + + * config/tc-mips.c (md_apply_fix, tc_gen_reloc): Remove special + handling for BFD_RELOC_MIPS16_JMP. + +2006-07-24 Andreas Schwab + + PR/2756 + * read.c (read_a_source_file): Ignore unknown text after line + comment character. Fix misleading comment. + +2006-07-24 Ralk Wildenhues + + * doc/all.texi, doc/as.texinfo, doc/c-arc.texi, doc/c-arm.texi, + doc/c-avr.texi, doc/c-bfin.texi, doc/c-i386.texi, + doc/c-i960.texi, doc/c-m32r.texi, doc/c-m68k.texi, + doc/c-mmix.texi, doc/c-pdp11.texi, doc/c-ppc.texi, + doc/c-tic54x.texi, doc/c-v850.texi, doc/c-xtensa.texi, + doc/c-z80.texi, doc/internals.texi: Fix some typos. + +2006-07-21 Nick Clifton + + * config/tc-sh.c (md_longopts): Add -EL and -EB for use by the + linker testsuite. + +2006-07-20 Thiemo Seufer + Nigel Stephens + + * config/tc-mips.c (md_parse_option): Don't infer optimisation + options from debug options. + +2006-07-20 Thiemo Seufer + + * config/tc-mips.c (mips_fix_adjustable): Handle BFD_RELOC_MIPS16_JMP. + (tc_gen_reloc): Handle mips16 jumps to section symbol offsets. + +2006-07-19 Paul Brook + + * config/tc-arm.c (insns): Fix rbit Arm opcode. + +2006-07-18 Paul Brook + + * tc-arm.c (do_t_add_sub): Use addw/subw when source is PC. + (md_convert_frag): Use correct reloc for add_pc. Use + BFD_RELOC_ARM_T32_ADD_IMM for normal add/sum. + (md_apply_fix): Handle BFD_RELOC_ARM_T32_ADD_IMM. + (arm_force_relocation): Handle BFD_RELOC_ARM_T32_ADD_IMM. + +2006-07-17 Mat Hostetter + + * symbols.c (report_op_error): Fix pasto. Don't use as_bad_where + when file and line unknown. + +2006-07-17 Thiemo Seufer + + * read.c (s_struct): Use IS_ELF. + * config/tc-mips.c (md_begin, mips16_mark_labels, mips_ip, + md_parse_option, s_change_sec, pic_need_relax, mips_fix_adjustable, + tc_gen_reloc, mips_frob_file_after_relocs, s_mips_end, s_mips_frame, + s_mips_mask): Likewise. + +2006-07-16 Thiemo Seufer + David Ung + + * read.c (s_struct): Handle ELF section changing. + * config/tc-mips.c (s_align): Leave enabling auto-align to the + generic code. + (s_change_sec): Try section changing only if we output ELF. + +2006-07-15 H.J. Lu + + * config/tc-i386.c (cpu_arch): Remove Cpu086, CpuAthlon and + CpuAmdFam10. + (smallest_imm_type): Remove Cpu086. + (i386_target_format): Likewise. + + * config/tc-i386.h: Remove Cpu086, CpuAthlon and CpuAmdFam10. + Update CpuXXX. + +2006-07-13 Dwarakanath Rajagopal + Michael Meissner + + * config/tc-i386.h (PROCESSOR_AMDFAM10): New processor_type. + (CpuSSE4a, CpuABM, CpuAmdFam10): New Cpu directives. + * config/tc-i386.c (cpu_arch): Add support for AmdFam10 + architecture. + (i386_align_code): Ditto. + (md_assemble_code): Add support for insertq/extrq instructions, + swapping as needed for intel syntax. + (swap_imm_operands): New function to swap immediate operands. + (swap_operands): Deal with 4 operand instructions. + (build_modrm_byte): Add support for insertq instruction. + +2006-07-13 H.J. Lu + + * config/tc-i386.h (Size64): Fix a typo in comment. + +2006-07-12 Nick Clifton + + * config/tc-sh.c (md_apply_fix): Do not allow the generic code in + fixup_segment() to repeat a range check on a value that has + already been checked here. + +2006-07-07 James E Wilson + + * config/tc-mips.c (mips_cpu_info_table): Add sb1a. + +2006-07-06 Mohammed Adnène Trojette + Nick Clifton + + PR binutils/2877 + * doc/as.texi: Fix spelling typo: branchs => branches. + * doc/c-m68hc11.texi: Likewise. + * config/tc-m68hc11.c: Likewise. + Support old spelling of command line switch for backwards + compatibility. + +2006-07-04 Thiemo Seufer + David Ung + + * config/tc-mips.c (s_is_linkonce): New function. + (mips16_mark_labels): Don't adjust mips16 symbol addresses for + weak, external, and linkonce symbols. + (pic_need_relax): Use s_is_linkonce. + +2006-06-24 H.J. Lu + + * doc/as.texinfo (Org): Remove space. + (P2align): Add "@var{abs-expr},". + +2006-06-23 H.J. Lu + + * config/tc-i386.c (cpu_arch_tune_set): New. + (cpu_arch_isa): Likewise. + (i386_align_code): Use xchg %ax,%ax for 2 byte nop. Optimize + nops with short or long nop sequences based on -march=/.arch + and -mtune=. + (set_cpu_arch): Set cpu_arch_isa. If cpu_arch_tune_set is 0, + set cpu_arch_tune and cpu_arch_tune_flags. + (md_parse_option): For -march=, set cpu_arch_isa and set + cpu_arch_tune and cpu_arch_tune_flags if cpu_arch_tune_set is + 0. Set cpu_arch_tune_set to 1 for -mtune=. + (i386_target_format): Don't set cpu_arch_tune. + +2006-06-23 Nigel Stephens + + * config/tc-mips.c (nopic_need_relax): Handle -fdata-sections + generated .sbss.* and .gnu.linkonce.sb.*. + +2006-06-23 Thiemo Seufer + David Ung + + * config/tc-mips.h (TC_SEGMENT_INFO_TYPE): Declare per-segment + label_list. + * config/tc-mips.c (label_list): Define per-segment label_list. + (mips_clear_insn_labels, mips_move_labels, mips16_mark_labels, + append_insn, s_align, s_cons, s_float_cons, s_gpword, s_gpdword, + mips_from_file_after_relocs, mips_define_label): Use per-segment + label_list. + +2006-06-22 Thiemo Seufer + + * config/tc-mips.c (ISA_SUPPORTS_MIPS16E): New macro. + (append_insn): Use it. + (md_apply_fix): Whitespace formatting. + (md_begin, append_insn, macro, macro2, mips16_immed, mips_align, + mips16_extended_frag): Remove register specifier. + (md_convert_frag): Likewise. Use TRUE ans FALSE instead of numeric + constants. + +2006-06-21 Mark Shinwell + + * config/tc-arm.c (s_arm_unwind_save_vfp_armv6): New. Parse + a directive saving VFP registers for ARMv6 or later. + (s_arm_unwind_save): Add parameter arch_v6 and call + s_arm_unwind_save_vfp or s_arm_unwind_save_vfp_armv6 as + appropriate. + (md_pseudo_table): Add entry for new "vsave" directive. + * doc/c-arm.texi: Correct error in example for "save" + directive (fstmdf -> fstmdx). Also document "vsave" directive. + +2006-06-18 Joerg Wunsch + Anatoly Sokolov + + * config/tc-avr.c (mcu_types): Add support for atmega165p, atmega169p + and atmega644p devices. Rename atmega164/atmega324 devices to + atmega164p/atmega324p. + * doc/c-avr.texi: Document new mcu and arch options. + +2006-06-17 Nick Clifton + + * config/tc-arm.c (enum parse_operand_result): Move outside of + #ifdef OBJ_ELF so that non-ELF targeted ARM ports can build. + +2006-06-16 H.J. Lu + + * config/tc-i386.h (processor_type): New. + (arch_entry): Add type. + + * config/tc-i386.c (cpu_arch_tune): New. + (cpu_arch_tune_flags): Likewise. + (cpu_arch_isa_flags): Likewise. + (cpu_arch): Updated. + (set_cpu_arch): Also update cpu_arch_isa_flags. + (md_assemble): Update cpu_arch_isa_flags. + (OPTION_MARCH): New. + (OPTION_MTUNE): Likewise. + (md_longopts): Add -march= and -mtune=. + (md_parse_option): Support -march= and -mtune=. + (md_show_usage): Add -march=CPU/-mtune=CPU. + (i386_target_format): Also update cpu_arch_isa_flags, + cpu_arch_tune and cpu_arch_tune_flags. + + * doc/as.texinfo: Add -march=CPU/-mtune=CPU. + + * doc/c-i386.texi: Document -march=CPU/-mtune=CPU. + +2006-06-15 Mark Shinwell + + * config/tc-arm.c (enum parse_operand_result): New. + (struct group_reloc_table_entry): New. + (enum group_reloc_type): New. + (group_reloc_table): New array. + (find_group_reloc_table_entry): New function. + (parse_shifter_operand_group_reloc): New function. + (parse_address_main): New function, incorporating code + from the old parse_address function. To be used via... + (parse_address): wrapper for parse_address_main; and + (parse_address_group_reloc): new function, likewise. + (enum operand_parse_code): New codes OP_SHG, OP_ADDRGLDR, + OP_ADDRGLDRS, OP_ADDRGLDC. + (parse_operands): Support for these new operand codes. + New macro po_misc_or_fail_no_backtrack. + (encode_arm_cp_address): Preserve group relocations. + (insns): Modify to use the above operand codes where group + relocations are permitted. + (md_apply_fix): Handle the group relocations + ALU_PC_G0_NC through LDC_SB_G2. + (tc_gen_reloc): Likewise. + (arm_force_relocation): Leave group relocations for the linker. + (arm_fix_adjustable): Likewise. + +2006-06-15 Julian Brown + + * config/tc-arm.c (do_vfp_nsyn_ldr_str): Remove, fold into... + (do_neon_ldr_str): Always defer to VFP encoding routines, which handle + relocs properly. + +2006-06-12 H.J. Lu + + * config/tc-i386.c (process_suffix): Don't add rex64 for + "xchg %rax,%rax". + +2006-06-09 Thiemo Seufer + + * config/tc-mips.c (mips_ip): Maintain argument count. + +2006-06-09 Alan Modra + + * config/tc-iq2000.c: Include sb.h. + +2006-06-08 Nigel Stephens + + * config/tc-mips.c (mips_pseudo_table): Add "origin" and "repeat" + aliases for better compatibility with SGI tools. + +2006-06-08 Alan Modra + + * configure.in (BFDLIB, BFDVER_H, ALL_OBJ_DEPS): Delete. + * Makefile.am (GASLIBS): Expand @BFDLIB@. + (BFDVER_H): Delete. + (OBJS): Expand @ALL_OBJ_DEPS@. Depend on all fopen-*.h variants. + (obj-aout.o): Depend on $(DEP_@target_get_type@_aout) + (obj-coff.o, obj-ecoff.o, obj-elf.o): Similarly. + Run "make dep-am". + * dep-in.sed: Don't substitute bfdver.h. Do remove symcat.h. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + * configure: Regenerate. + +2006-06-07 Joseph S. Myers + + * po/Make-in (pdf, ps): New dummy targets. + +2006-06-07 Julian Brown + + * config/tc-arm.c (stdarg.h): include. + (arm_it): Add uncond_value field. Add isvec and issingle to operand + array. + (arm_reg_type): Add REG_TYPE_VFSD (single or double VFP reg) and + REG_TYPE_NSDQ (single, double or quad vector reg). + (reg_expected_msgs): Update. + (BAD_FPU): Add macro for unsupported FPU instruction error. + (parse_neon_type): Support 'd' as an alias for .f64. + (parse_typed_reg_or_scalar): Support REG_TYPE_VFSD, REG_TYPE_NSDQ + sets of registers. + (parse_vfp_reg_list): Don't update first arg on error. + (parse_neon_mov): Support extra syntax for VFP moves. + (operand_parse_code): Add OP_RVSD, OP_RNSDQ, OP_VRSDLST, OP_RVSD_IO, + OP_RNSDQ_RNSC, OP_RVC_PSR, OP_APSR_RR, OP_oRNSDQ. + (parse_operands): Support isvec, issingle operands fields, new parse + codes above. + (do_vfp_nsyn_mrs, do_vfp_nsyn_msr): New functions. Support VFP mrs, + msr variants. + (do_mrs, do_msr, do_t_mrs, do_t_msr): Add support for above. + (NEON_ENC_TAB): Add vnmul, vnmla, vnmls, vcmp, vcmpz, vcmpe, vcmpez. + (NEON_ENC_SINGLE, NEON_ENC_DOUBLE): Define macros. + (NEON_SHAPE_DEF): New macro. Define table of possible instruction + shapes. + (neon_shape): Redefine in terms of above. + (neon_shape_class): New enumeration, table of shape classes. + (neon_shape_el): New enumeration. One element of a shape. + (neon_shape_el_size): Register widths of above, where appropriate. + (neon_shape_info): New struct. Info for shape table. + (neon_shape_tab): New array. + (neon_type_mask): Add N_F64, N_VFP. Update N_MAX_NONSPECIAL. + (neon_check_shape): Rewrite as... + (neon_select_shape): New function to classify instruction shapes, + driven by new table neon_shape_tab array. + (neon_quad): New function. Return 1 if shape should set Q flag in + instructions (or equivalent), 0 otherwise. + (type_chk_of_el_type): Support F64. + (el_type_of_type_chk): Likewise. + (neon_check_type): Add support for VFP type checking (VFP data + elements fill their containing registers). + (do_vfp_cond_or_thumb): Fill in condition field in ARM mode, or 0xE + in thumb mode for VFP instructions. + (do_vfp_nsyn_opcode): New function. Look up the opcode in argument, + and encode the current instruction as if it were that opcode. + (try_vfp_nsyn): New. If this looks like a VFP instruction with ARGS + arguments, call function in PFN. + (do_vfp_nsyn_add_sub, do_vfp_nsyn_mla_mls, do_vfp_nsyn_mul) + (do_vfp_nsyn_abs_neg, do_vfp_nsyn_ldm_stm, do_vfp_nsyn_ldr_str) + (do_vfp_nsyn_sqrt, do_vfp_nsyn_div, do_vfp_nsyn_nmul) + (do_vfp_nsyn_cmp, nsyn_insert_sp, do_vfp_nsyn_push) + (do_vfp_nsyn_pop, do_vfp_nsyn_cvt, do_vfp_nsyn_cvtz): New functions. + Redirect Neon-syntax VFP instructions to VFP instruction handlers. + (do_neon_dyadic_i_su, do_neon_dyadic_i64_su, do_neon_shl_imm) + (do_neon_qshl_imm, do_neon_logic, do_neon_bitfield) + (neon_dyadic_misc, neon_compare, do_neon_tst, do_neon_qdmulh) + (do_neon_fcmp_absolute, do_neon_step, do_neon_sli, do_neon_sri) + (do_neon_qshlu_imm, neon_move_immediate, do_neon_mvn, do_neon_ext) + (do_neon_rev, do_neon_dup, do_neon_rshift_round_imm, do_neon_trn) + (do_neon_zip_uzp, do_neon_sat_abs_neg, do_neon_pair_long) + (do_neon_recip_est, do_neon_cls, do_neon_clz, do_neon_cnt) + (do_neon_swp): Use neon_select_shape not neon_check_shape. Use + neon_quad. + (vfp_or_neon_is_neon): New function. Call if a mnemonic shared + between VFP and Neon turns out to belong to Neon. Perform + architecture check and fill in condition field if appropriate. + (do_neon_addsub_if_i, do_neon_mac_maybe_scalar, do_neon_abs_neg) + (do_neon_cvt): Add support for VFP variants of instructions. + (neon_cvt_flavour): Extend to cover VFP conversions. + (do_neon_mov): Rewrite to use neon_select_shape. Add support for VFP + vmov variants. + (do_neon_ldr_str): Handle single-precision VFP load/store. + (do_neon_ld_st_interleave, do_neon_ld_st_lane, do_neon_ld_dup): Use + NS_NULL not NS_IGNORE. + (opcode_tag): Add OT_csuffixF for operands which either take a + conditional suffix, or have 0xF in the condition field. + (md_assemble): Add support for OT_csuffixF. + (NCE): Replace macro with... + (NCE_tag, NCE, NCEF): New macros. + (nCE): Replace macro with... + (nCE_tag, nCE, nCEF): New macros. + (insns): Add support for VFP insns or VFP versions of insns msr, + mrs, vsqrt, vdiv, vnmul, vnmla, vnmls, vcmp, vcmpe, vpush, vpop, + vcvtz, vmul, vmla, vmls, vadd, vsub, vabs, vneg, vldm, vldmia, + vldbdb, vstm, vstmia, vstmdb, vldr, vstr, vcvt, vmov. Group shared + VFP/Neon insns together. + +2006-06-07 Alan Modra + Ladislav Michl + + * app.c: Don't include headers already included by as.h. + * as.c: Likewise. + * atof-generic.c: Likewise. + * cgen.c: Likewise. + * dwarf2dbg.c: Likewise. + * expr.c: Likewise. + * input-file.c: Likewise. + * input-scrub.c: Likewise. + * macro.c: Likewise. + * output-file.c: Likewise. + * read.c: Likewise. + * sb.c: Likewise. + * config/bfin-lex.l: Likewise. + * config/obj-coff.h: Likewise. + * config/obj-elf.h: Likewise. + * config/obj-som.h: Likewise. + * config/tc-arc.c: Likewise. + * config/tc-arm.c: Likewise. + * config/tc-avr.c: Likewise. + * config/tc-bfin.c: Likewise. + * config/tc-cris.c: Likewise. + * config/tc-d10v.c: Likewise. + * config/tc-d30v.c: Likewise. + * config/tc-dlx.h: Likewise. + * config/tc-fr30.c: Likewise. + * config/tc-frv.c: Likewise. + * config/tc-h8300.c: Likewise. + * config/tc-hppa.c: Likewise. + * config/tc-i370.c: Likewise. + * config/tc-i860.c: Likewise. + * config/tc-i960.c: Likewise. + * config/tc-ip2k.c: Likewise. + * config/tc-iq2000.c: Likewise. + * config/tc-m32c.c: Likewise. + * config/tc-m32r.c: Likewise. + * config/tc-maxq.c: Likewise. + * config/tc-mcore.c: Likewise. + * config/tc-mips.c: Likewise. + * config/tc-mmix.c: Likewise. + * config/tc-mn10200.c: Likewise. + * config/tc-mn10300.c: Likewise. + * config/tc-msp430.c: Likewise. + * config/tc-mt.c: Likewise. + * config/tc-ns32k.c: Likewise. + * config/tc-openrisc.c: Likewise. + * config/tc-ppc.c: Likewise. + * config/tc-s390.c: Likewise. + * config/tc-sh.c: Likewise. + * config/tc-sh64.c: Likewise. + * config/tc-sparc.c: Likewise. + * config/tc-tic30.c: Likewise. + * config/tc-tic4x.c: Likewise. + * config/tc-tic54x.c: Likewise. + * config/tc-v850.c: Likewise. + * config/tc-vax.c: Likewise. + * config/tc-xc16x.c: Likewise. + * config/tc-xstormy16.c: Likewise. + * config/tc-xtensa.c: Likewise. + * config/tc-z80.c: Likewise. + * config/tc-z8k.c: Likewise. + * macro.h: Don't include sb.h or ansidecl.h. + * sb.h: Don't include stdio.h or ansidecl.h. + * cond.c: Include sb.h. + * itbl-lex.l: Include as.h instead of other system headers. + * itbl-parse.y: Likewise. + * itbl-ops.c: Similarly. + * itbl-ops.h: Don't include as.h or ansidecl.h. + * config/bfin-defs.h: Don't include bfd.h or as.h. + * config/bfin-parse.y: Include as.h instead of other system headers. + +2006-06-06 Ben Elliston + Anton Blanchard + + * config/tc-ppc.c (parse_cpu): Handle "-mpower6". + (md_show_usage): Document it. + (ppc_setup_opcodes): Test power6 opcode flag bits. + * doc/c-ppc.texi (PowerPC-Opts): Document "-mpower6". + +2006-06-06 Thiemo Seufer + Chao-ying Fu + + * config/tc-mips.c (ISA_SUPPORTS_DSP64): New macro. + (CPU_HAS_MIPS3D, CPU_HAS_MDMX, CPU_HAS_DSP, CPU_HAS_MT): Delete. + (macro_build): Update comment. + (mips_ip): Allow DSP64 instructions for MIPS64R2. + (mips_after_parse_args): Remove uses of CPU_HAS_MIPS3D and + CPU_HAS_MDMX. + (mips_cpu_info): Fix formatting. Add MIPS_CPU_ASE_MIPS3D and + MIPS_CPU_ASE_MDMX flags for sb1. + +2006-06-05 Thiemo Seufer + + * config/tc-mips.c (macro_build): Use INSERT_OPERAND wherew + appropriate. + (mips16_macro_build): Use MIPS16_INSERT_OPERAND where appropriate. + (mips_ip): Make overflowed/underflowed constant arguments in DSP + and MT instructions a fatal error. Use INSERT_OPERAND where + appropriate. Improve warnings for break and wait code overflows. + Use symbolic constant of OP_MASK_COPZ. + (mips16_ip): Use MIPS16_INSERT_OPERAND where appropriate. + +2006-06-05 Daniel Jacobowitz + + * po/Make-in (top_builddir): Define. + +2006-06-02 Joseph S. Myers + + * doc/Makefile.am (TEXI2DVI): Define. + * doc/Makefile.in: Regenerate. + * doc/c-arc.texi: Fix typo. + +2006-06-01 Alan Modra + + * config/obj-ieee.c: Delete. + * config/obj-ieee.h: Delete. + * Makefile.am (OBJ_FORMATS): Remove ieee. + (OBJ_FORMAT_CFILES, OBJ_FORMAT_HFILES): Similarly. + (obj-ieee.o): Remove rule. + * Makefile.in: Regenerate. + * configure.in (atof): Remove tahoe. + (OBJ_MAYBE_IEEE): Don't define. + * configure: Regenerate. + * config.in: Regenerate. + * doc/Makefile.in: Regenerate. + * po/POTFILES.in: Regenerate. + +2006-05-31 Daniel Jacobowitz + + * Makefile.am: Replace INTLLIBS and INTLDEPS with LIBINTL + and LIBINTL_DEP everywhere. + (INTLLIBS): Remove. + (INCLUDES, DEP_INCLUDES): Use @INCINTL@. + * acinclude.m4: Include new gettext macros. + * configure.in: Use ZW_GNU_GETTEXT_SISTER_DIR and AM_PO_SUBDIRS. + Remove local code for po/Makefile. + * Makefile.in, configure, doc/Makefile.in: Regenerated. + +2006-05-30 Nick Clifton + + * po/es.po: Updated Spanish translation. + +2006-05-06 Denis Chertykov + + * doc/c-avr.texi: New file. + * doc/Makefile.am (CPU_DOCS): Add c-avr.texi + * doc/all.texi: Set AVR + * doc/as.texinfo: Include c-avr.texi + +2006-05-28 Jie Zhang + + * config/bfin-parse.y (check_macfunc): Loose the condition of + calling check_multiply_halfregs (). + +2006-05-25 Jie Zhang + + * config/bfin-parse.y (asm_1): Better check and deal with + vector and scalar Multiply 16-Bit Operands instructions. + +2006-05-24 Nick Clifton + + * config/tc-hppa.c: Convert to ISO C90 format. + * config/tc-hppa.h: Likewise. + +2006-05-24 Carlos O'Donell + Randolph Chung + + * config/tc-hppa.c (is_tls_gdidx, is_tls_ldidx, is_tls_dtpoff, + is_tls_ieoff, is_tls_leoff): Define. + (fix_new_hppa): Handle TLS. + (cons_fix_new_hppa): Likewise. + (pa_ip): Likewise. + (md_apply_fix): Handle TLS relocs. + * config/tc-hppa.h (hppa_fix_adjustable): Handle TLS. + +2006-05-24 Bjoern Haase + + * config/tc-avr.c: Add new cpu targets avr6, avr2560 and avr2561. + +2006-05-23 Thiemo Seufer + David Ung + Nigel Stephens + + [ gas/ChangeLog ] + * config/tc-mips.c (ISA_SUPPORTS_SMARTMIPS): Rename. + (ISA_SUPPORTS_DSP_ASE, ISA_SUPPORTS_MT_ASE, ISA_HAS_64BIT_FPRS, + ISA_HAS_MXHC1): New macros. + (HAVE_32BIT_FPRS): Use ISA_HAS_64BIT_FPRS instead of + ISA_HAS_64BIT_REGS. Formatting fixes. Improved comments. + (mips_cpu_info): Change to use combined ASE/IS_ISA flag. + (MIPS_CPU_IS_ISA, MIPS_CPU_ASE_SMARTMIPS, MIPS_CPU_ASE_DSP, + MIPS_CPU_ASE_MT, MIPS_CPU_ASE_MIPS3D, MIPS_CPU_ASE_MDMX): New defines. + (mips_after_parse_args): Change default handling of float register + size to account for 32bit code with 64bit FP. Better sanity checking + of ISA/ASE/ABI option combinations. + (s_mipsset): Support switching of GPR and FPR sizes via + .set {g,f}p={32,64,default}. Better sanity checking for .set ASE + options. + (mips_elf_final_processing): We should record the use of 64bit FP + registers in 32bit code but we don't, because ELF header flags are + a scarce ressource. + (mips_cpu_info_table): Add ASE flags for CPUs with mandatory ASE + extensions. Add 4ksc, 4kec, 4kem, 4kep, 4ksd, m4kp, 24kec, 24kef, + 24kex, 34kc, 34kf, 34kx, 25kf CPU definitions. + (mips_cpu_info_from_isa): Use MIPS_CPU_IS_ISA. + * doc/c-mips.texi: Document .set {g,f}p={32,64,default}. Document + missing -march options. Document .set arch=CPU. Move .set smartmips + to ASE page. Use @code for .set FOO examples. + +2006-05-23 Jie Zhang + + * config/tc-bfin.c (bfin_start_line_hook): Bump line counters + if needed. + +2006-05-23 Jie Zhang + + * config/bfin-defs.h (bfin_equals): Remove declaration. + * config/bfin-parse.y (asm_1): Remove "expr ASSIGN expr". + * config/tc-bfin.c (bfin_name_is_register): Remove. + (bfin_equals): Remove. + * config/tc-bfin.h (TC_EQUAL_IN_INSN): Redefine as 1. + (bfin_name_is_register): Remove declaration. + +2006-05-19 Thiemo Seufer + Nigel Stephens + + * config/tc-mipc.c (ISA_HAS_ODD_SINGLE_FPR): New define. + (mips_oddfpreg_ok): New function. + (mips_ip): Use it. + +2006-05-19 Thiemo Seufer + David Ung + + * config/tc-mips.h (tc_mips_regname_to_dw2regnum): Declare. + * config/tc-mipc.c (ABI_NEEDS_64BIT_REGS, ISA_HAS_64BIT_REGS, + ISA_HAS_DROR, ISA_HAS_ROR): Reformat. + (regname, RTYPE_MASK, RTYPE_NUM, RTYPE_FPU, RTYPE_FCC, RTYPE_VEC, + RTYPE_GP, RTYPE_CP0, RTYPE_PC, RTYPE_ACC, RTYPE_CCC, RNUM_MASK, + RWARN, GENERIC_REGISTER_NUMBERS, FPU_REGISTER_NAMES, + FPU_CONDITION_CODE_NAMES, COPROC_CONDITION_CODE_NAMES, + N32N64_SYMBOLIC_REGISTER_NAMES, O32_SYMBOLIC_REGISTER_NAMES, + SYMBOLIC_REGISTER_NAMES, MIPS16_SPECIAL_REGISTER_NAMES, + MDMX_VECTOR_REGISTER_NAMES, MIPS_DSP_ACCUMULATOR_NAMES, reg_names, + reg_names_o32, reg_names_n32n64): Define register classes. + (reg_lookup): New function, use register classes. + (md_begin): Reserve register names in the symbol table. Simplify + OBJ_ELF defines. + (mips_ip): Fix comment formatting. Handle symbolic COP0 registers. + Use reg_lookup. + (mips16_ip): Use reg_lookup. + (tc_get_register): Likewise. + (tc_mips_regname_to_dw2regnum): New function. + +2006-05-19 Thiemo Seufer + + * config/tc-arm.c, config/tc-arm.h (tc_arm_regname_to_dw2regnum): + Un-constify string argument. + * config/tc-i386.c, config/tc-i386.h (tc_x86_regname_to_dw2regnum): + Likewise. + * config/tc-m68k.c, config/tc-m68k.h (tc_m68k_regname_to_dw2regnum): + Likewise. + * config/tc-ppc.c, config/tc-ppc.h (tc_ppc_regname_to_dw2regnum): + Likewise. + * config/tc-s390.c, config/tc-s390.h (tc_s390_regname_to_dw2regnum): + Likewise. + * config/tc-sh.c, config/tc-sh.h (sh_regname_to_dw2regnum): + Likewise. + * config/tc-sparc.c, config/tc-sparc.h (sparc_regname_to_dw2regnum): + Likewise. + +2006-05-19 Nathan Sidwell + + * gas/config/tc-m68k.c (m68k_init_arch): Move checking of + cfloat/m68881 to correct architecture before using it. + +2006-05-16 Bjoern Haase + + * config/tc-avr.h (TC_VALIDATE_FIX): Allow fixups for immediate + constant values. + +2006-05-15 Paul Brook + + * config/tc-arm.c (arm_adjust_symtab): Use + bfd_is_arm_special_symbol_name. + +2006-05-15 Bob Wilson + + * config/tc-xtensa.c (is_direct_call_opcode, is_branch_jmp_to_next, + xg_assemble_vliw_tokens, xtensa_mark_narrow_branches, + xtensa_fix_short_loop_frags, is_local_forward_loop, relax_frag_immed): + Handle errors from calls to xtensa_opcode_is_* functions. + +2006-05-14 Thiemo Seufer + + * config/tc-mips.c (macro_build): Test for currently active + mips16 option. + (mips16_ip): Reject invalid opcodes. + +2006-05-11 Carlos O'Donell + + * doc/as.texinfo: Rename "Index" to "AS Index", + and "ABORT" to "ABORT (COFF)". + +2006-05-11 Paul Brook + + * config/tc-arm.c (parse_half): New function. + (operand_parse_code): Remove OP_Iffff. Add OP_HALF. + (parse_operands): Ditto. + (do_mov16): Reject invalid relocations. + (do_t_mov16): Ditto. Use Thumb reloc numbers. + (insns): Replace Iffff with HALF. + (md_apply_fix): Add MOVW and MOVT relocs. + (tc_gen_reloc): Ditto. + * doc/c-arm.texi: Document relocation operators + +2006-05-11 Paul Brook + + * config/tc-arm.c (arm_fix_adjustable): Return 0 for function symbols. + +2006-05-11 Thiemo Seufer + + * config/tc-mips.c (append_insn): Don't check the range of j or + jal addresses. + +2006-05-11 Pedro Alves + + * config/tc-arm.c (md_pcrel_from_section): Force a bias for + relocs against external symbols for WinCE targets. + (md_apply_fix): Likewise. + +2006-05-09 David Ung + + * config/tc-mips.c (append_insn): Only warn about an out-of-range + j or jal address. + +2006-05-09 Nick Clifton + + * config/tc-arm.c (arm_fix_adjustable): For COFF, convert fixups + against symbols which are not going to be placed into the symbol + table. + +2006-05-09 Ben Elliston + + * expr.c (operand): Remove `if (0 && ..)' statement and + subsequently unused target_op label. Collapse `if (1 || ..)' + statement. + * app.c (do_scrub_chars): Remove unused case 0, as it is handled + separately above the switch. + +2006-05-08 Nick Clifton + + PR gas/2623 + * config/tc-msp430.c (line_separator_character): Define as |. + +2006-05-08 Thiemo Seufer + Nigel Stephens + David Ung + + * config/tc-mips.c (mips_set_options): Add ase_smartmips flag. + (mips_opts): Likewise. + (file_ase_smartmips): New variable. + (ISA_HAS_ROR): SmartMIPS implements rotate instructions. + (macro_build): Handle SmartMIPS instructions. + (mips_ip): Likewise. + (md_longopts): Add argument handling for smartmips. + (md_parse_options, mips_after_parse_args): Likewise. + (s_mipsset): Add .set smartmips support. + (md_show_usage): Document -msmartmips/-mno-smartmips. + * doc/as.texinfo: Document -msmartmips/-mno-smartmips and + .set smartmips. + * doc/c-mips.texi: Likewise. + +2006-05-08 Alan Modra + + * write.c (relax_segment): Add pass count arg. Don't error on + negative org/space on first two passes. + (relax_seg_info): New struct. + (relax_seg, write_object_file): Adjust. + * write.h (relax_segment): Update prototype. + +2006-05-05 Julian Brown + + * config/tc-arm.c (parse_vfp_reg_list): Improve register bounds + checking. + (do_neon_mov): Enable several VMOV variants for VFP. Add suitable + architecture version checks. + (insns): Allow overlapping instructions to be used in VFP mode. + +2006-05-05 H.J. Lu + + PR gas/2598 + * config/obj-elf.c (obj_elf_change_section): Allow user + specified SHF_ALPHA_GPREL. + +2006-05-05 Bjoern Haase + + * gas/config/tc-avr.h (TC_VALIDATE_FIX): Define. Disable fixups + for PMEM related expressions. + +2006-05-05 Nick Clifton + + PR gas/2582 + * dwarf2dbg.c (INSERT_DIR_SEPARATOR): New macro. Handles the + insertion of a directory separator character into a string at a + given offset. Uses heuristics to decide when to use a backslash + character rather than a forward-slash character. + (dwarf2_directive_loc): Use the macro. + (out_debug_info): Likewise. + +2006-05-05 Thiemo Seufer + David Ung + + * config/tc-mips.c (macro_build): Add case 'k' to handle cache + instruction. + (macro): Add new case M_CACHE_AB. + +2006-05-04 Kazu Hirata + + * config/tc-arm.c (opcode_tag): Add OT_cinfix3_deprecated. + (opcode_lookup): Issue a warning for opcode with + OT_cinfix3_deprecated. Otherwise treat OT_cinfix3_deprecated + identical to OT_cinfix3. + (TxC3w, TC3w, tC3w): New. + (insns): Use tC3w and TC3w for comparison instructions with + 's' suffix. + +2006-05-04 Alan Modra + + * subsegs.h (struct frchain): Delete frch_seg. + (frchain_root): Delete. + (seg_info): Define as macro. + * subsegs.c (frchain_root): Delete. + (abs_seg_info, und_seg_info, absolute_frchain): Delete. + (subsegs_begin, subseg_change): Adjust for above. + (subseg_set_rest): Likewise. Add new frchain structs to seginfo + rather than to one big list. + (subseg_get): Don't special case abs, und sections. + (subseg_new, subseg_force_new): Don't set frchainP here. + (seg_info): Delete. + (subsegs_print_statistics): Adjust frag chain control list traversal. + * debug.c (dmp_frags): Likewise. + * dwarf2dbg.c (first_frag_for_seg): Don't start looking for frag + at frchain_root. Make use of known frchain ordering. + (last_frag_for_seg): Likewise. + (get_frag_fix): Likewise. Add seg param. + (process_entries, out_debug_aranges): Adjust get_frag_fix calls. + * write.c (chain_frchains_together_1): Adjust for struct frchain. + (SUB_SEGMENT_ALIGN): Likewise. + (subsegs_finish): Adjust frchain list traversal. + * config/tc-xtensa.c (xtensa_cleanup_align_frags): Likewise. + (xtensa_fix_target_frags, xtensa_mark_narrow_branches): Likewise. + (xtensa_mark_zcl_first_insns, xtensa_fix_a0_b_retw_frags): Likewise. + (xtensa_fix_b_j_loop_end_frags): Likewise. + (xtensa_fix_close_loop_end_frags): Likewise. + (xtensa_fix_short_loop_frags, xtensa_sanity_check): Likewise. + (retrieve_segment_info): Delete frch_seg initialisation. + +2006-05-03 Alan Modra + + * subsegs.c (subseg_get): Don't call obj_sec_set_private_data. + * config/obj-elf.h (obj_sec_set_private_data): Delete. + * config/tc-hppa.c (tc_gen_reloc): Don't use bfd_abs_symbol. + * config/tc-mn10300.c (tc_gen_reloc): Likewise. + +2006-05-02 Joseph Myers + + * config/tc-arm.c (do_iwmmxt_wldstbh): Don't multiply offset by 4 + here. + (md_apply_fix3): Multiply offset by 4 here for + BFD_RELOC_ARM_CP_OFF_IMM_S2 and BFD_RELOC_ARM_T32_CP_OFF_IMM_S2. + +2006-05-02 H.J. Lu + Jan Beulich + + * config/tc-i386.c (output_invalid_buf): Change size for + unsigned char. + * config/tc-tic30.c (output_invalid_buf): Likewise. + + * config/tc-i386.c (output_invalid): Cast none-ascii char to + unsigned char. + * config/tc-tic30.c (output_invalid): Likewise. + +2006-05-02 Daniel Jacobowitz + + * doc/Makefile.am (AM_MAKEINFOFLAGS): New. + (TEXI2POD): Use AM_MAKEINFOFLAGS. + (asconfig.texi): Don't set top_srcdir. + * doc/as.texinfo: Don't use top_srcdir. + * aclocal.m4, Makefile.in, doc/Makefile.in: Regenerated. + +2006-05-02 H.J. Lu + + * config/tc-i386.c (output_invalid_buf): Change size to 16. + * config/tc-tic30.c (output_invalid_buf): Likewise. + + * config/tc-i386.c (output_invalid): Use snprintf instead of + sprintf. + * config/tc-ia64.c (declare_register_set): Likewise. + (emit_one_bundle): Likewise. + (check_dependencies): Likewise. + * config/tc-tic30.c (output_invalid): Likewise. + +2006-05-02 Paul Brook + + * config/tc-arm.c (arm_optimize_expr): New function. + * config/tc-arm.h (md_optimize_expr): Define + (arm_optimize_expr): Add prototype. + (TC_FORCE_RELOCATION_SUB_SAME): Define. + +2006-05-02 Ben Elliston + + * config/obj-elf.h (ELF_TARGET_SYMBOL_FIELDS): Make single bit + field unsigned. + + * sb.h (sb_list_vector): Move to sb.c. + * sb.c (free_list): Use type of sb_list_vector directly. + (sb_build): Fix off-by-one error in assertion about `size'. + +2006-05-01 Ben Elliston + + * listing.c (listing_listing): Remove useless loop. + * macro.c (macro_expand): Remove is_positional local variable. + * read.c (s_comm_internal): Simplify `if' condition 1 || x -> 1 + and simplify surrounding expressions, where possible. + (assign_symbol): Likewise. + (s_weakref): Likewise. + * symbols.c (colon): Likewise. + +2006-05-01 James Lemke + + * subsegs.c (subseg_set_rest): Always set seginfp->frchainP if NULL. + +2006-04-30 Thiemo Seufer + David Ung + + * config/tc-mips.c (validate_mips_insn): Handling of udi cases. + (mips_immed): New table that records various handling of udi + instruction patterns. + (mips_ip): Adds udi handling. + +2006-04-28 Alan Modra + + * dwarf2dbg.c (get_line_subseg): Attach new struct line_seg to end + of list rather than beginning. + +2006-04-26 Julian Brown + + * gas/config/tc-arm.c (neon_is_quarter_float): Move, and rename to... + (is_quarter_float): Rename from above. Simplify slightly. + (parse_qfloat_immediate): Parse a "quarter precision" floating-point + number. + (parse_neon_mov): Parse floating-point constants. + (neon_qfloat_bits): Fix encoding. + (neon_cmode_for_move_imm): Tweak to use floating-point encoding in + preference to integer encoding when using the F32 type. + +2006-04-26 Julian Brown + + * config/tc-arm.c (neon_el_type): Make NT_invtype be the zero (so + zero-initialising structures containing it will lead to invalid types). + (arm_it): Add vectype to each operand. + (NTA_HASTYPE, NTA_HASINDEX): Constants used in neon_typed_alias + defined field. + (neon_typed_alias): New structure. Extra information for typed + register aliases. + (reg_entry): Add neon type info field. + (arm_reg_parse): Remove RTYPE argument (revert to previous arguments). + Break out alternative syntax for coprocessor registers, etc. into... + (arm_reg_alt_syntax): New function. Alternate syntax handling broken + out from arm_reg_parse. + (parse_neon_type): Move. Return SUCCESS/FAIL. + (first_error): New function. Call to ensure first error which occurs is + reported. + (parse_neon_operand_type): Parse exactly one type. + (NEON_ALL_LANES, NEON_INTERLEAVE_LANES): Move. + (parse_typed_reg_or_scalar): New function. Handle core of both + arm_typed_reg_parse and parse_scalar. + (arm_typed_reg_parse): Parse a register with an optional type. + (NEON_SCALAR_REG, NEON_SCALAR_INDEX): Extract parts of parse_scalar + result. + (parse_scalar): Parse a Neon scalar with optional type. + (parse_reg_list): Use first_error. + (parse_vfp_reg_list): Use arm_typed_reg_parse instead of arm_reg_parse. + (neon_alias_types_same): New function. Return true if two (alias) types + are the same. + (parse_neon_el_struct_list): Use parse_typed_reg_or_scalar. Return type + of elements. + (insert_reg_alias): Return new reg_entry not void. + (insert_neon_reg_alias): New function. Insert type/index information as + well as register for alias. + (create_neon_reg_alias): New function. Parse .dn/.qn directives and + make typed register aliases accordingly. + (s_dn, s_qn): New functions. Handle incorrectly used .dn/.qn at start + of line. + (s_unreq): Delete type information if present. + (s_arm_unwind_save_mmxwr): Remove arg 3 from arm_reg_parse calls. + (s_arm_unwind_save_mmxwcg): Likewise. + (s_arm_unwind_movsp): Likewise. + (s_arm_unwind_setfp): Likewise. + (parse_shift): Likewise. + (parse_shifter_operand): Likewise. + (parse_address): Likewise. + (parse_tb): Likewise. + (tc_arm_regname_to_dw2regnum): Likewise. + (md_pseudo_table): Add dn, qn. + (parse_neon_mov): Handle typed operands. + (parse_operands): Likewise. + (neon_type_mask): Add N_SIZ. + (N_ALLMODS): New macro. + (neon_check_shape): Fix typo in NS_DDD_QQQ case. Use first_error. + (el_type_of_type_chk): Add some safeguards. + (modify_types_allowed): Fix logic bug. + (neon_check_type): Handle operands with types. + (neon_three_same): Remove redundant optional arg handling. + (do_neon_dyadic_i64_su, do_neon_shl_imm, do_neon_qshl_imm) + (do_neon_logic, do_neon_qdmulh, do_neon_fcmp_absolute) + (do_neon_step): Adjust accordingly. + (neon_cmode_for_logic_imm): Use first_error. + (do_neon_bitfield): Call neon_check_type. + (neon_dyadic): Rename to... + (neon_dyadic_misc): ...this. New name for neon_dyadic. Add bitfield + to allow modification of type of the destination. + (do_neon_dyadic_if_su, do_neon_dyadic_if_i, do_neon_dyadic_if_i_d) + (do_neon_addsub_if_i, do_neon_mul): Adjust accordingly. + (do_neon_compare): Make destination be an untyped bitfield. + (neon_scalar_for_mul): Use NEON_SCALAR_REG, NEON_SCALAR_INDEX. + (neon_mul_mac): Return early in case of errors. + (neon_move_immediate): Use first_error. + (neon_mac_reg_scalar_long): Fix type to include scalar. + (do_neon_dup): Likewise. + (do_neon_mov): Likewise (in several places). + (do_neon_tbl_tbx): Fix type. + (do_neon_ld_st_interleave, neon_alignment_bit, do_neon_ld_st_lane) + (do_neon_ld_dup): Exit early in case of errors and/or use + first_error. + (opcode_lookup): Update for parse_neon_type returning SUCCESS/FAIL. + Handle .dn/.qn directives. + (REGDEF): Add zero for reg_entry neon field. + +2006-04-26 Julian Brown + + * config/tc-arm.c (limits.h): Include. + (fpu_arch_vfp_v3, fpu_vfp_ext_v3, fpu_neon_ext_v1) + (fpu_vfp_v3_or_neon_ext): Declare constants. + (neon_el_type): New enumeration of types for Neon vector elements. + (neon_type_el): New struct. Define type and size of a vector element. + (NEON_MAX_TYPE_ELS): Define constant. The maximum number of types per + instruction. + (neon_type): Define struct. The type of an instruction. + (arm_it): Add 'vectype' for the current instruction. + (isscalar, immisalign, regisimm, isquad): New predicates for operands. + (vfp_sp_reg_pos): Rename to... + (vfp_reg_pos): ...this, and add VFP_REG_Dd, VFP_REG_Dm, VFP_REG_Dn + tags. + (arm_reg_type): Add REG_TYPE_NQ (Neon Q register) and REG_TYPE_NDQ + (Neon D or Q register). + (reg_expected_msgs): Sync with above. Allow VFD to mean VFP or Neon D + register. + (GE_OPT_PREFIX_BIG): Define constant, for use in... + (my_get_expression): Allow above constant as argument to accept + 64-bit constants with optional prefix. + (arm_reg_parse): Add extra argument to return the specific type of + register in when either a D or Q register (REG_TYPE_NDQ) is + requested. Can be NULL. + (parse_scalar): New function. Parse Neon scalar (vector reg and index). + (parse_reg_list): Update for new arm_reg_parse args. + (parse_vfp_reg_list): Allow parsing of Neon D/Q register lists. + (parse_neon_el_struct_list): New function. Parse element/structure + register lists for VLD/VST instructions. + (s_arm_unwind_save_vfp): Update for new parse_vfp_reg_list args. + (s_arm_unwind_save_mmxwr): Likewise. + (s_arm_unwind_save_mmxwcg): Likewise. + (s_arm_unwind_movsp): Likewise. + (s_arm_unwind_setfp): Likewise. + (parse_big_immediate): New function. Parse an immediate, which may be + 64 bits wide. Put results in inst.operands[i]. + (parse_shift): Update for new arm_reg_parse args. + (parse_address): Likewise. Add parsing of alignment specifiers. + (parse_neon_mov): Parse the operands of a VMOV instruction. + (operand_parse_code): Add OP_RND, OP_RNQ, OP_RNDQ, OP_RNSC, OP_NRDLST, + OP_NSTRLST, OP_NILO, OP_RNDQ_I0, OP_RR_RNSC, OP_RNDQ_RNSC, OP_RND_RNSC, + OP_VMOV, OP_RNDQ_IMVNb, OP_RNDQ_I63b, OP_I0, OP_I16z, OP_I32z, OP_I64, + OP_I64z, OP_oI32b, OP_oRND, OP_oRNQ, OP_oRNDQ. + (parse_operands): Handle new codes above. + (encode_arm_vfp_sp_reg): Rename to... + (encode_arm_vfp_reg): ...this. Handle D regs (0-31) too. Complain if + selected VFP version only supports D0-D15. + (do_vfp_sp_monadic, do_vfp_sp_dyadic, do_vfp_sp_compare_z) + (do_vfp_dp_sp_cvt, do_vfp_reg_from_sp, do_vfp_reg2_from_sp2) + (do_vfp_sp_from_reg, do_vfp_sp2_from_reg2, do_vfp_sp_ldst) + (do_vfp_dp_ldst, vfp_sp_ldstm, vfp_dp_ldstm): Update for new + encode_arm_vfp_reg name, and allow 32 D regs. + (do_vfp_dp_rd_rm, do_vfp_dp_rn_rd, do_vfp_dp_rd_rn, do_vfp_dp_rd_rn_rm) + (do_vfp_rm_rd_rn): New functions to encode VFP insns allowing 32 D + regs. + (do_vfp_sp_const, do_vfp_dp_const, vfp_conv, do_vfp_sp_conv_16) + (do_vfp_dp_conv_16, do_vfp_sp_conv_32, do_vfp_dp_conv_32): Handle + constant-load and conversion insns introduced with VFPv3. + (neon_tab_entry): New struct. + (NEON_ENC_TAB): Bit patterns for overloaded Neon instructions, and + those which are the targets of pseudo-instructions. + (neon_opc): Enumerate opcodes, use as indices into... + (neon_enc_tab): ...this. Hold data from NEON_ENC_TAB. + (NEON_ENC_INTEGER, NEON_ENC_ARMREG, NEON_ENC_POLY, NEON_ENC_FLOAT) + (NEON_ENC_SCALAR, NEON_ENC_IMMED, NEON_ENC_INTERLV, NEON_ENC_LANE) + (NEON_ENC_DUP): Define meaningful helper macros to look up values in + neon_enc_tab. + (neon_shape): Enumerate shapes (permitted register widths, etc.) for + Neon instructions. + (neon_type_mask): New. Compact type representation for type checking. + (N_SU_ALL, N_SU_32, N_SU_16_64, N_SUF_32, N_I_ALL, N_IF_32): Common + permitted type combinations. + (N_IGNORE_TYPE): New macro. + (neon_check_shape): New function. Check an instruction shape for + multiple alternatives. Return the specific shape for the current + instruction. + (neon_modify_type_size): New function. Modify a vector type and size, + depending on the bit mask in argument 1. + (neon_type_promote): New function. Convert a given "key" type (of an + operand) into the correct type for a different operand, based on a bit + mask. + (type_chk_of_el_type): New function. Convert a type and size into the + compact representation used for type checking. + (el_type_of_type_ckh): New function. Reverse of above (only when a + single bit is set in the bit mask). + (modify_types_allowed): New function. Alter a mask of allowed types + based on a bit mask of modifications. + (neon_check_type): New function. Check the type of the current + instruction against the variable argument list. The "key" type of the + instruction is returned. + (neon_dp_fixup): New function. Fill in and modify instruction bits for + a Neon data-processing instruction depending on whether we're in ARM + mode or Thumb-2 mode. + (neon_logbits): New function. + (neon_three_same, neon_two_same, do_neon_dyadic_i_su) + (do_neon_dyadic_i64_su, neon_imm_shift, do_neon_shl_imm) + (do_neon_qshl_imm, neon_cmode_for_logic_imm, neon_bits_same_in_bytes) + (neon_squash_bits, neon_is_quarter_float, neon_qfloat_bits) + (neon_cmode_for_move_imm, neon_write_immbits, neon_invert_size) + (do_neon_logic, do_neon_bitfield, neon_dyadic, do_neon_dyadic_if_su) + (do_neon_dyadic_if_su_d, do_neon_dyadic_if_i, do_neon_dyadic_if_i_d) + (do_neon_addsub_if_i, neon_exchange_operands, neon_compare) + (do_neon_cmp, do_neon_cmp_inv, do_neon_ceq, neon_scalar_for_mul) + (neon_mul_mac, do_neon_mac_maybe_scalar, do_neon_tst, do_neon_mul) + (do_neon_qdmulh, do_neon_fcmp_absolute, do_neon_fcmp_absolute_inv) + (do_neon_step, do_neon_abs_neg, do_neon_sli, do_neon_sri) + (do_neon_qshlu_imm, do_neon_qmovn, do_neon_qmovun) + (do_neon_rshift_sat_narrow, do_neon_rshift_sat_narrow_u, do_neon_movn) + (do_neon_rshift_narrow, do_neon_shll, neon_cvt_flavour, do_neon_cvt) + (neon_move_immediate, do_neon_mvn, neon_mixed_length) + (do_neon_dyadic_long, do_neon_abal, neon_mac_reg_scalar_long) + (do_neon_mac_maybe_scalar_long, do_neon_dyadic_wide, do_neon_vmull) + (do_neon_ext, do_neon_rev, do_neon_dup, do_neon_mov) + (do_neon_rshift_round_imm, do_neon_movl, do_neon_trn, do_neon_zip_uzp) + (do_neon_sat_abs_neg, do_neon_pair_long, do_neon_recip_est) + (do_neon_cls, do_neon_clz, do_neon_cnt, do_neon_swp, do_neon_tbl_tbx) + (do_neon_ldm_stm, do_neon_ldr_str, do_neon_ld_st_interleave) + (neon_alignment_bit, do_neon_ld_st_lane, do_neon_ld_dup) + (do_neon_ldx_stx): New functions. Neon bit encoding and encoding + helpers. + (parse_neon_type): New function. Parse Neon type specifier. + (opcode_lookup): Allow parsing of Neon type specifiers. + (REGNUM2, REGSETH, REGSET2): New macros. + (reg_names): Add new VFPv3 and Neon registers. + (NUF, nUF, NCE, nCE): New macros for opcode table. + (insns): More VFP registers allowed in fcpyd, fmdhr, fmdlr, fmrdh, + fmrdl, fabsd, fnegd, fsqrtd, faddd, fsubd, fmuld, fdivd, fmacd, fmscd, + fnmuld, fnmacd, fnmscd, fcmpd, fcmpzd, fcmped, fcmpezd, fmdrr, fmrrd. + Add Neon instructions vaba, vhadd, vrhadd, vhsub, vqadd, vqsub, vrshl, + vqrshl, vshl, vqshl{u}, vand, vbic, vorr, vorn, veor, vbsl, vbit, vbif, + vabd, vmax, vmin, vcge, vcgt, vclt, vcle, vceq, vpmax, vpmin, vmla, + vmls, vpadd, vadd, vsub, vtst, vmul, vqdmulh, vqrdmulh, vacge, vacgt, + vaclt, vacle, vrecps, vrsqrts, vabs, vneg, v{r}shr, v{r}sra, vsli, + vsri, vqshrn, vq{r}shr{u}n, v{r}shrn, vshll, vcvt, vmov, vmvn, vabal, + vabdl, vaddl, vsubl, vmlal, vmlsl, vaddw, vsubw, v{r}addhn, v{r}subhn, + vqdmlal, vqdmlsl, vqdmull, vmull, vext, vrev64, vrev32, vrev16, vdup, + vmovl, v{q}movn, vzip, vuzp, vqabs, vqneg, vpadal, vpaddl, vrecpe, + vrsqrte, vcls, vclz, vcnt, vswp, vtrn, vtbl, vtbx, vldm, vstm, vldr, + vstr, vld[1234], vst[1234], fconst[sd], f[us][lh]to[sd], + fto[us][lh][sd]. + (tc_arm_regname_to_dw2regnum): Update for arm_reg_parse args. + (arm_cpu_option_table): Add Neon and VFPv3 to Cortex-A8. + (arm_option_cpu_value): Add vfp3 and neon. + (aeabi_set_public_attributes): Support VFPv3 and NEON attributes. Fix + VFPv1 attribute. + +2006-04-25 Bob Wilson + + * config/xtensa-relax.c (widen_spec_list): Use new "WIDE." + syntax instead of hardcoded opcodes with ".w18" suffixes. + (wide_branch_opcode): New. + (build_transition): Use it to check for wide branch opcodes with + either ".w18" or ".w15" suffixes. + +2006-04-25 Bob Wilson + + * config/tc-xtensa.c (xtensa_create_literal_symbol, + xg_assemble_literal, xg_assemble_literal_space): Do not set the + frag's is_literal flag. + +2006-04-25 Bob Wilson + + * config/xtensa-relax.c (XCHAL_HAVE_WIDE_BRANCHES): Provide default. + +2006-04-23 Kazu Hirata + + * config/obj-coff.c, config/tc-arm.c, config/tc-bfin.c, + config/tc-cris.c, config/tc-crx.c, config/tc-i386.c, + config/tc-ia64.c, config/tc-maxq.c, config/tc-maxq.h, + config/tc-mips.c, config/tc-msp430.c, config/tc-sh.c, + config/tc-tic4x.c, config/tc-xtensa.c: Fix comment typos. + +2005-04-20 Paul Brook + + * config/tc-arm.c (s_arm_arch, s_arm_cpu, s_arm_fpu): Enable for + all targets. + (md_pseudo_table): Enable .arch, .cpu and .fpu for all targets. + +2006-04-19 Alan Modra + + * Makefile.am (CPU_TYPES): Add maxq and mt. Sort. + (CPU_OBJ_VALID): Change sense of COFF test to default to invalid. + Make some cpus unsupported on ELF. Run "make dep-am". + * Makefile.in: Regenerate. + +2006-04-19 Alan Modra + + * configure.in (--enable-targets): Indent help message. + * configure: Regenerate. + +2006-04-18 H.J. Lu + + PR gas/2533 + * config/tc-i386.c (i386_immediate): Check illegal immediate + register operand. + +2006-04-18 Alan Modra + + * config/tc-i386.c: Formatting. + (output_disp, output_imm): ISO C90 params. + + * frags.c (frag_offset_fixed_p): Constify args. + * frags.h (frag_offset_fixed_p): Ditto. + + * config/tc-dlx.h (tc_coff_symbol_emit_hook): Delete. + (COFF_MAGIC): Delete. + + * config/tc-xc16x.h (TC_LINKRELAX_FIXUP): Delete. + +2006-04-16 Daniel Jacobowitz + + * po/POTFILES.in: Regenerated. + +2006-04-16 Mark Mitchell + + * doc/as.texinfo: Mention that some .type syntaxes are not + supported on all architectures. + +2006-04-14 Sterling Augustine + + * config/tc-xtensa.c (emit_single_op): Do not relax MOVI + instructions when such transformations have been disabled. + +2006-04-10 Sterling Augustine + + * config/tc-xtensa.c (xg_assemble_vliw_tokens): Record loop target + symbols in RELAX[_CHECK]_ALIGN_NEXT_OPCODE frags. + (xtensa_fix_close_loop_end_frags): Use the recorded values instead of + decoding the loop instructions. Remove current_offset variable. + (xtensa_fix_short_loop_frags): Likewise. + (min_bytes_to_other_loop_end): Remove current_offset argument. + +2006-04-09 Arnold Metselaar + + * config/tc-z80.c (z80_optimize_expr): Removed. + * config/tc-z80.h (z80_optimize_expr, md_optimize_expr): Removed. + +2006-04-07 Joerg Wunsch + + * gas/config/tc-avr.c (mcu_types): Add support for attiny261, + attiny461, attiny861, attiny25, attiny45, attiny85,attiny24, + attiny44, attiny84, at90pwm2, at90pwm3, atmega164, atmega324, + atmega644, atmega329, atmega3290, atmega649, atmega6490, + atmega406, atmega640, atmega1280, atmega1281, at90can32, + at90can64, at90usb646, at90usb647, at90usb1286 and + at90usb1287. + Move atmega48 and atmega88 from AVR_ISA_M8 to AVR_ISA_PWMx. + +2006-04-07 Paul Brook + + * config/tc-arm.c (parse_operands): Set default error message. + +2006-04-07 Paul Brook + + * config/tc-arm.c (parse_tb): Set inst.error before returning FAIL. + +2006-04-07 Paul Brook + + * config/tc-arm.c (md_apply_fix): Set H bit on blx instruction. + +2006-04-07 Paul Brook + + * config/tc-arm.c (THUMB2_LOAD_BIT): Define. + (move_or_literal_pool): Handle Thumb-2 instructions. + (do_t_ldst): Call move_or_literal_pool for =N addressing modes. + +2006-04-07 Alan Modra + + PR 2512. + * config/tc-i386.c (match_template): Move 64-bit operand tests + inside loop. + +2006-04-06 Carlos O'Donell + + * po/Make-in: Add install-html target. + * Makefile.am: Add install-html and install-html-recursive targets. + * Makefile.in: Regenerate. + * configure.in: AC_SUBST datarootdir, docdir, htmldir. + * configure: Regenerate. + * doc/Makefile.am: Add install-html and install-html-am targets. + * doc/Makefile.in: Regenerate. + +2006-04-06 Alan Modra + + * frags.c (frag_offset_fixed_p): Reinitialise offset before + second scan. + +2006-04-05 Richard Sandiford + Daniel Jacobowitz + + * config/tc-sparc.c (sparc_target_format): Handle TE_VXWORKS. + (GOTT_BASE, GOTT_INDEX): New. + (tc_gen_reloc): Don't alter relocations against GOTT_BASE and + GOTT_INDEX when generating VxWorks PIC. + * configure.tgt (sparc*-*-vxworks*): Remove this special case; + use the generic *-*-vxworks* stanza instead. + +2006-04-04 Alan Modra + + PR 997 + * frags.c (frag_offset_fixed_p): New function. + * frags.h (frag_offset_fixed_p): Declare. + * expr.c (expr): Use frag_offset_fixed_p when simplifying subtraction. + (resolve_expression): Likewise. + +2006-04-03 Sterling Augustine + + * config/tc-xtensa.c (init_op_placement_info_table): Check for formats + of the same length but different numbers of slots. + +2006-03-30 Andreas Schwab + + * configure.in: Fix help string for --enable-targets option. + * configure: Regenerate. + +2006-03-28 Nathan Sidwell + + * gas/config/tc-m68k.c (find_cf_chip): Merge into ... + (m68k_ip): ... here. Use for all chips. Protect against buffer + overrun and avoid excessive copying. + + * config/tc-m68k.c (m68000_control_regs, m68010_control_regs, + m68020_control_regs, m68040_control_regs, m68060_control_regs, + mcf_control_regs, mcf5208_control_regs, mcf5213_control_regs, + mcf5329_control_regs, mcf5249_control_regs, mcf528x_control_regs, + mcfv4e_control_regs, m68010_control_regs): Rename and reorder to ... + (m68000_ctrl, m68010_ctrl, m68020_ctrl, m68040_ctrl, m68060_ctrl, + mcf_ctrl, mcf5208_ctrl, mcf5213_ctrl, mcf5235_ctrl, mcf5249_ctrl, + mcf5216_ctrl, mcf5250_ctrl, mcf5271_ctrl, mcf5272_ctrl, + mcf5282_ctrl, mcfv4e_ctrl): ... these. + (mcf5275_ctrl, mcf5329_ctrl, mcf5373_ctrl): New. + (struct m68k_cpu): Change chip field to control_regs. + (current_chip): Remove. + (control_regs): New. + (m68k_archs, m68k_extensions): Adjust. + (m68k_cpus): Reorder to be in cpu number order. Adjust. + (CPU_ALLOW_MC, CPU_ALLOW_NEGATION): Remove. + (find_cf_chip): Reimplement for new organization of cpu table. + (select_control_regs): Remove. + (mri_chip): Adjust. + (struct save_opts): Save control regs, not chip. + (s_save, s_restore): Adjust. + (m68k_lookup_cpu): Give deprecated warning when necessary. + (m68k_init_arch): Adjust. + (md_show_usage): Adjust for new cpu table organization. + +2006-03-25 Bernd Schmidt + + * config/bfin-defs.h (Expr_Node_Type enum): Add Expr_Node_GOT_Reloc. + * config/bfin-lex.l: Recognize GOT17M4 and FUNCDESC_GOT17M4. + * config/bfin-parse.y: Include "libbfd.h", "elf/common.h" and + "elf/bfin.h". + (GOT17M4, FUNCDESC_GOT17M4): New tokens of type . + (any_gotrel): New rule. + (got): Use it, and create Expr_Node_GOT_Reloc nodes. + * config/tc-bfin.c: Include "libbfd.h", "elf/common.h" and + "elf/bfin.h". + (DEFAULT_FLAGS, bfin_flags, bfin_pic_flag): New. + (bfin_pic_ptr): New function. + (md_pseudo_table): Add it for ".picptr". + (OPTION_FDPIC): New macro. + (md_longopts): Add -mfdpic. + (md_parse_option): Handle it. + (md_begin): Set BFD flags. + (md_apply_fix3, bfin_fix_adjustable): Handle new relocs. + (bfin_gen_ldstidxi): Adjust to match the trees that the parser gives + us for GOT relocs. + * Makefile.am (bfin-parse.o): Update dependencies. + (DEPTC_bfin_elf): Likewise. + * Makefile.in: Regenerate. + +2006-03-25 Richard Sandiford + + * config/tc-m68k.c (m68k_cpus): Change cpu_cf5208 entries to use + mcfemac instead of mcfmac. + +2006-03-23 Michael Matz + + * config/tc-i386.c (type_names): Correct placement of 'static'. + (reloc): Map some more relocs to their 64 bit counterpart when + size is 8. + (output_insn): Work around breakage if DEBUG386 is defined. + (output_disp): A BFD_RELOC_64 with GOT_symbol as operand also + needs to be mapped to BFD_RELOC_X86_64_GOTPC64 or + BFD_RELOC_X86_64_GOTPC32. Also x86-64 handles pcrel addressing + different from i386. + (output_imm): Ditto. + (lex_got): Recognize @PLTOFF and @GOTPLT. Make @GOT accept also + Imm64. + (md_convert_frag): Jumps can now be larger than 2GB away, error + out in that case. + (tc_gen_reloc): New relocs are passed through. BFD_RELOC_64 + and BFD_RELOC_64_PCREL are mapped to BFD_RELOC_X86_64_GOTPC64. + +2006-03-22 Richard Sandiford + Daniel Jacobowitz + Phil Edwards + Zack Weinberg + Mark Mitchell + Nathan Sidwell + + * config/tc-mips.c (mips_target_format): Handle vxworks targets. + (md_begin): Complain about -G being used for PIC. Don't change + the text, data and bss alignments on VxWorks. + (reloc_needs_lo_p): Don't return true for R_MIPS_GOT16 when + generating VxWorks PIC. + (load_address): Extend SVR4_PIC handling to VXWORKS_PIC. + (macro): Likewise, but do not treat la $25 specially for + VxWorks PIC, and do not handle jal. + (OPTION_MVXWORKS_PIC): New macro. + (md_longopts): Add -mvxworks-pic. + (md_parse_option): Don't complain about using PIC and -G together here. + Handle OPTION_MVXWORKS_PIC. + (md_estimate_size_before_relax): Always use the first relaxation + sequence on VxWorks. + * config/tc-mips.h (VXWORKS_PIC): New. + +2006-03-21 Paul Brook + + * config/tc-arm.c (md_apply_fix): Fix typo in offset mask. + +2006-03-21 Sterling Augustine + + * config/tc-xtensa.c (enforce_three_byte_loop_align): New flag. + (xtensa_setup_hw_workarounds): Set this new flag for older hardware. + (get_loop_align_size): New. + (xtensa_end): Skip xtensa_mark_narrow_branches when not aligning. + (xtensa_mark_zcl_first_insns): Prevent widening of first loop frag. + (get_text_align_power): Rewrite to handle inputs in the range 2-8. + (get_noop_aligned_address): Use get_loop_align_size. + (get_aligned_diff): Likewise. + +2006-03-21 Paul Brook + + * config/tc-arm.c (insns): Correct opcodes for ldrbt and strbt. + +2006-03-20 Paul Brook + + * config/tc-arm.c (BAD_BRANCH, BAD_NOT_IT): Define. + (do_t_branch): Encode branches inside IT blocks as unconditional. + (do_t_cps): New function. + (do_t_blx, do_t_bkpt, do_t_branch23, do_t_bx, do_t_bxj, do_t_cpsi, + do_t_czb, do_t_it, do_t_setend, do_t_tb): Add IT constaints. + (opcode_lookup): Allow conditional suffixes on all instructions in + Thumb mode. + (md_assemble): Advance condexec state before checking for errors. + (insns): Use do_t_cps. + +2006-03-20 Paul Brook + + * config/tc-arm.c (output_relax_insn): Call dwarf2_emit_insn before + outputting the insn. + +2006-03-18 Jan-Benedict Glaw + + * config/tc-vax.c: Update copyright year. + * config/tc-vax.h: Likewise. + +2006-03-18 Jan-Benedict Glaw + + * config/tc-vax.c (md_chars_to_number): Used only locally, so + make it static. + * config/tc-vax.h (md_chars_to_number): Remove obsolete declaration. + +2006-03-17 Paul Brook + + * config/tc-arm.c (insns): Add ldm and stm. + +2006-03-17 Ben Elliston + + PR gas/2446 + * doc/as.texinfo (Ident): Document this directive more thoroughly. + +2006-03-16 Paul Brook + + * config/tc-arm.c (insns): Add "svc". + +2006-03-13 Bob Wilson + + * config/tc-xtensa.c (xg_translate_sysreg_op): Remove has_underbar + flag and avoid double underscore prefixes. + +2006-03-10 Paul Brook + + * config/tc-arm.c (md_begin): Handle EABIv5. + (arm_eabis): Add EF_ARM_EABI_VER5. + * doc/c-arm.texi: Document -meabi=5. + +2006-03-10 Ben Elliston + + * app.c (do_scrub_chars): Simplify string handling. + +2006-03-07 Richard Sandiford + Daniel Jacobowitz + Zack Weinberg + Nathan Sidwell + Paul Brook + Ricardo Anguiano + Phil Edwards + + * config/tc-arm.c (md_apply_fix): Install a value of zero into a + BFD_RELOC_ARM_OFFSET_IMM field if we're going to generate a RELA + R_ARM_ABS12 reloc. + (tc_gen_reloc): Keep the original fx_offset for RELA pc-relative + relocs, but adjust by md_pcrel_from_section. Create R_ARM_ABS12 + relocations for BFD_RELOC_ARM_OFFSET_IMM on RELA targets. + +2006-03-06 Bob Wilson + + * config/tc-xtensa.c (xtensa_post_relax_hook): Generate literal tables + even when using the text-section-literals option. + +2006-03-06 Nathan Sidwell + + * config/tc-m68k.c (m68k_extensions): Allow 'float' on both m68k + and cf. + (m68k_ip): Check we have some control regs. + (md_parse_option): Allow raw arch switch. + (m68k_init_arch): Better detection of arch/cpu mismatch. Detect + whether 68881 or cfloat was meant by -mfloat. + (md_show_usage): Adjust extension display. + (m68k_elf_final_processing): Adjust. + +2006-03-03 Bjoern Haase + + * config/tc-avr.c (avr_mod_hash_value): New function. + (md_apply_fix, exp_mod): Use BFD_RELOC_HH8_LDI and + BFD_RELOC_MS8_LDI for hlo8() and hhi8() + (md_begin): Set linkrelax variable to 1, use avr_mod_hash_value + instead of int avr_ldi_expression: use avr_mod_hash_value instead + of (int). + (tc_gen_reloc): Handle substractions of symbols, if possible do + fixups, abort otherwise. + * config/tc-avr.h (TC_LINKRELAX_FIXUP, TC_VALIDATE_FIX, + tc_fix_adjustable): Define. + +2006-03-02 James E Wilson + + * config/tc-ia64.c (emit_one_bundle): For IA64_OPCODE_LAST, if we + change the template, then clear md.slot[curr].end_of_insn_group. + +2006-02-28 Jan Beulich + + * macro.c (get_any_string): Don't insert quotes for <>-quoted input. + +2006-02-28 Jan Beulich + + PR/1070 + * macro.c (getstring): Don't treat parentheses special anymore. + (get_any_string): Don't consider '(' and ')' as quoting anymore. + Special-case '(', ')', '[', and ']' when dealing with non-quoting + characters. + +2006-02-28 Mat + + * dwarf2dbg.c (get_filenum): Don't inadvertently decrease files_in_use. + +2006-02-27 Jakub Jelinek + + * dw2gencfi.c (struct fde_entry, struct cie_entry): Add signal_frame + field. + (CFI_signal_frame): Define. + (cfi_pseudo_table): Add .cfi_signal_frame. + (dot_cfi): Handle CFI_signal_frame. + (output_cie): Handle cie->signal_frame. + (select_cie_for_fde): Don't share CIE if signal_frame flag is + different. Copy signal_frame from FDE to newly created CIE. + * doc/as.texinfo: Document .cfi_signal_frame. + +2006-02-27 Carlos O'Donell + + * doc/Makefile.am: Add html target. + * doc/Makefile.in: Regenerate. + * po/Make-in: Add html target. + +2006-02-27 H.J. Lu + + * config/tc-i386.c (output_insn): Support Intel Merom New + Instructions. + + * config/tc-i386.h (CpuMNI): New. + (CpuUnknownFlags): Add CpuMNI. + +2006-02-24 David S. Miller + + * config/tc-sparc.c (priv_reg_table): Add entry for "gl". + (hpriv_reg_table): New table for hyperprivileged registers. + (sparc_ip): New cases '$' and '%' for wrhpr/rdhpr hyperprivileged + register encoding. + +2006-02-24 DJ Delorie + + * config/tc-m32c.h (md_apply_fix): Define to m32c_apply_fix. + (tc_gen_reloc): Don't define. + * config/tc-m32c.c (rl_for, relaxable): New convenience macros. + (OPTION_LINKRELAX): New. + (md_longopts): Add it. + (m32c_relax): New. + (md_parse_options): Set it. + (md_assemble): Emit relaxation relocs as needed. + (md_convert_frag): Emit relaxation relocs as needed. + (md_cgen_lookup_reloc): Add LAB_8_8 and LAB_8_16. + (m32c_apply_fix): New. + (tc_gen_reloc): New. + (m32c_force_relocation): Force out jump relocs when relaxing. + (m32c_fix_adjustable): Return false if relaxing. + +2006-02-24 Paul Brook + + * config/arm/tc-arm.c (arm_ext_v6_notm, arm_ext_div, arm_ext_v7, + arm_ext_v7a, arm_ext_v7r, arm_ext_v7m): New variables. + (struct asm_barrier_opt): Define. + (arm_v7m_psr_hsh, arm_barrier_opt_hsh): New variables. + (parse_psr): Accept V7M psr names. + (parse_barrier): New function. + (enum operand_parse_code): Add OP_oBARRIER. + (parse_operands): Implement OP_oBARRIER. + (do_barrier): New function. + (do_dbg, do_pli, do_t_barrier, do_t_dbg, do_t_div): New functions. + (do_t_cpsi): Add V7M restrictions. + (do_t_mrs, do_t_msr): Validate V7M variants. + (md_assemble): Check for NULL variants. + (v7m_psrs, barrier_opt_names): New tables. + (insns): Add V7 instructions. Mark V6 instructions absent from V7M. + (md_begin): Initialize arm_v7m_psr_hsh and arm_barrier_opt_hsh. + (arm_cpu_option_table): Add Cortex-M3, R4 and A8. + (arm_arch_option_table): Add armv7, armv7a, armv7r and armv7m. + (struct cpu_arch_ver_table): Define. + (cpu_arch_ver): New. + (aeabi_set_public_attributes): Use cpu_arch_ver. Set + Tag_CPU_arch_profile. + * doc/c-arm.texi: Document new cpu and arch options. + +2006-02-23 H.J. Lu + + * config/tc-ia64.c (operand_match): Handle IA64_OPND_IMMU5b. + +2006-02-23 H.J. Lu + + * config/tc-ia64.c: Update copyright years. + +2006-02-22 H.J. Lu + + * config/tc-ia64.c (specify_resource): Add the rule 17 from + SDM 2.2. + +2005-02-22 Paul Brook + + * config/tc-arm.c (do_pld): Remove incorrect write to + inst.instruction. + (encode_thumb32_addr_mode): Use correct operand. + +2006-02-21 Paul Brook + + * config/tc-arm.c (md_apply_fix): Fix off-by-one errors. + +2006-02-17 Shrirang Khisti + Anil Paranjape + Shilin Shakti + + * Makefile.am: Add xc16x related entry. + * Makefile.in: Regenerate. + * configure.in: Added xc16x related entry. + * configure: Regenerate. + * config/tc-xc16x.h: New file + * config/tc-xc16x.c: New file + * doc/c-xc16x.texi: New file for xc16x + * doc/all.texi: Entry for xc16x + * doc/Makefile.texi: Added c-xc16x.texi + * NEWS: Announce the support for the new target. + +2006-02-16 Nick Hudson + + * configure.tgt: set emulation for mips-*-netbsd* + +2006-02-14 Jakub Jelinek + + * config.in: Rebuilt. + +2006-02-13 Bob Wilson + + * config/tc-xtensa.c (xg_add_opcode_fix): Number operands starting + from 1, not 0, in error messages. + (md_assemble): Simplify special-case check for ENTRY instructions. + (tinsn_has_invalid_symbolic_operands): Do not include opcode and + operand in error message. + +2006-02-13 Joseph S. Myers + + * configure.tgt (arm-*-linux-gnueabi*): Change to + arm-*-linux-*eabi*. + +2006-02-10 Nick Clifton + + * config/tc-crx.c (check_range): Ensure that the sign bit of a + 32-bit value is propagated into the upper bits of a 64-bit long. + + * config/tc-arc.c (init_opcode_tables): Fix cast. + (arc_extoper, md_operand): Likewise. + +2006-02-09 David Heine + + * config/tc-xtensa.c (xg_assembly_relax): Increment steps_taken for + each relaxation step. + +2006-02-09 Eric Botcazou + + * configure.in (CHECK_DECLS): Add vsnprintf. + * configure: Regenerate. + * messages.c (errno.h, stdarg.h, varargs.h, va_list): Do not + include/declare here, but... + * as.h: Move code detecting VARARGS idiom to the top. + (errno.h, stdarg.h, varargs.h, va_list): ...here. + (vsnprintf): Declare if not already declared. + +2006-02-08 H.J. Lu + + * as.c (close_output_file): New. + (main): Register close_output_file with xatexit before + dump_statistics. Don't call output_file_close. + +2006-02-07 Nathan Sidwell + + * config/tc-m68k.c (mcf5208_control_regs, mcf5213_control_regs, + mcf5329_control_regs): New. + (not_current_architecture, selected_arch, selected_cpu): New. + (m68k_archs, m68k_extensions): New. + (archs): Renamed to ... + (m68k_cpus): ... here. Adjust. + (n_arches): Remove. + (md_pseudo_table): Add arch and cpu directives. + (find_cf_chip, m68k_ip): Adjust table scanning. + (no_68851, no_68881): Remove. + (md_assemble): Lazily initialize. + (select_control_regs): Adjust cpu names. Add 5208, 5213, 5329. + (md_init_after_args): Move functionality to m68k_init_arch. + (mri_chip): Adjust table scanning. + (md_parse_option): Reimplement 'm' processing to add -march & -mcpu + options with saner parsing. + (m68k_lookup_cpu, m68k_set_arch, m68k_set_cpu, m68k_set_extension, + m68k_init_arch): New. + (s_m68k_cpu, s_m68k_arch): New. + (md_show_usage): Adjust. + (m68k_elf_final_processing): Set CF EF flags. + * config/tc-m68k.h (m68k_init_after_args): Remove. + (tc_init_after_args): Remove. + * doc/c-m68k.texi (M68K-Opts): Document -march, -mcpu options. + (M68k-Directives): Document .arch and .cpu directives. + +2006-02-05 Arnold Metselaar + + * config/tc-z80.c (z80_start_line_hook): allow .equ and .defl as + synonyms for equ and defl. + (z80_cons_fix_new): New function. + (emit_byte): Disallow relative jumps to absolute locations. + (emit_data): Only handle defb, prototype changed, because defb is + now handled as pseudo-op rather than an instruction. + (instab): Entries for defb,defw,db,dw moved from here... + (md_pseudo_table): ... to here, use generic cons() for defw,dw. + Add entries for def24,def32,d24,d32. + (md_assemble): Improved error handling. + (md_apply_fix): New case BFD_RELOC_24, set fixP->fx_no_overflow to one. + * config/tc-z80.h (TC_CONS_FIX_NEW): Define. + (z80_cons_fix_new): Declare. + * doc/c-z80.texi (defb, db): Mention warning on overflow. + (def24,d24,def32,d32): New pseudo-ops. + +2006-02-02 Paul Brook + + * config/tc-arm.c (do_shift): Remove Thumb-1 constraint. + +2005-02-02 Paul Brook + + * config/tc-arm.c (T2_OPCODE_MASK, T2_DATA_OP_SHIFT, T2_OPCODE_AND, + T2_OPCODE_BIC, T2_OPCODE_ORR, T2_OPCODE_ORN, T2_OPCODE_EOR, + T2_OPCODE_ADD, T2_OPCODE_ADC, T2_OPCODE_SBC, T2_OPCODE_SUB, + T2_OPCODE_RSB): Define. + (thumb32_negate_data_op): New function. + (md_apply_fix): Use it. + +2006-01-31 Bob Wilson + + * config/xtensa-istack.h (TInsn): Remove record_fix and sub_symbol + fields. + * config/tc-xtensa.h (xtensa_frag_type): Remove slot_sub_symbols field. + * config/tc-xtensa.c (md_apply_fix): Check for unexpected uses of + subtracted symbols. + (relaxation_requirements): Add pfinish_frag argument and use it to + replace setting tinsn->record_fix fields. + (xg_assemble_vliw_tokens): Adjust calls to relaxation_requirements + and vinsn_to_insnbuf. Remove references to record_fix and + slot_sub_symbols fields. + (xtensa_mark_narrow_branches): Delete unused code. + (is_narrow_branch_guaranteed_in_range): Handle expr that is not just + a symbol. + (convert_frag_immed): Adjust vinsn_to_insnbuf call and do not set + record_fix fields. + (tinsn_immed_from_frag): Remove code for handling slot_sub_symbols. + (vinsn_to_insnbuf): Change use of record_fixup argument, replacing use + of the record_fix field. Simplify error messages for unexpected + symbolic operands. + (set_expr_symbol_offset_diff): Delete. + +2006-01-31 Paul Brook + + * config/tc-arm.c (arm_reg_parse): Check if reg is non-NULL. + +2006-01-31 Paul Brook + Richard Earnshaw + + * config/tc-arm.c: Use arm_feature_set. + (arm_ext_*, arm_arch_full, arm_arch_t2, arm_arch_none, + arm_cext_iwmmxt, arm_cext_xscale, arm_cext_maverick, fpu_fpa_ext_v1, + fpu_fpa_ext_v2, fpu_vfp_ext_v1xd, fpu_vfp_ext_v1, fpu_vfp_ext_v2): + New variables. + (insns): Use them. + (md_atof, opcode_select, opcode_select, md_assemble, md_assemble, + md_begin, arm_parse_extension, arm_parse_cpu, arm_parse_arch, + arm_parse_fpu, arm_parse_float_abi, aeabi_set_public_attributes, + s_arm_cpu, s_arm_arch, s_arm_fpu): Use macros for accessing CPU + feature flags. + (arm_legacy_option_table, arm_option_cpu_value_table): New types. + (arm_opts): Move old cpu/arch options from here... + (arm_legacy_opts): ... to here. + (md_parse_option): Search arm_legacy_opts. + (arm_cpus, arm_archs, arm_extensions, arm_fpus) + (arm_float_abis, arm_eabis): Make const. + +2006-01-25 Bob Wilson + + * config/tc-xtensa.c (md_apply_fix): Set value to zero for PLT relocs. + +2006-01-21 Jie Zhang + + * config/bfin-parse.y (asm_1): Check value range for 16 bit immediate + in load immediate intruction. + +2006-01-21 Jie Zhang + + * config/bfin-parse.y (value_match): Use correct conversion + specifications in template string for __FILE__ and __LINE__. + (binary): Ditto. + (unary): Ditto. + +2006-01-18 Alexandre Oliva + + Introduce TLS descriptors for i386 and x86_64. + * config/tc-i386.c (tc_i386_fix_adjustable): Handle + BFD_RELOC_386_TLS_GOTDESC, BFD_RELOC_386_TLS_DESC_CALL, + BFD_RELOC_X86_64_GOTPC32_TLSDESC, BFD_RELOC_X86_64_TLSDESC_CALL. + (optimize_disp): Emit fix up for BFD_RELOC_386_TLS_DESC_CALL and + BFD_RELOC_X86_64_TLSDESC_CALL immediately, and clear the + displacement bits. + (build_modrm_byte): Set up zero modrm for TLS desc calls. + (lex_got): Handle @tlsdesc and @tlscall. + (md_apply_fix, tc_gen_reloc): Handle the new relocations. + +2006-01-11 Nick Clifton + + Fixes for building on 64-bit hosts: + * config/tc-avr.c (mod_index): New union to allow conversion + between pointers and integers. + (md_begin, avr_ldi_expression): Use it. + * config/tc-i370.c (md_assemble): Add cast for argument to print + statement. + * config/tc-tic54x.c (subsym_substitute): Likewise. + * config/tc-mn10200.c (md_assemble): Use a union to convert the + opindex field of fr_cgen structure into a pointer so that it can + be stored in a frag. + * config/tc-mn10300.c (md_assemble): Likewise. + * config/tc-frv.c (frv_debug_tomcat): Use %p to print pointer + types. + * config/tc-v850.c: Replace uses of (int) casts with correct + types. + +2006-01-09 H.J. Lu + + PR gas/2117 + * symbols.c (snapshot_symbol): Don't change a defined symbol. + +2006-01-03 Hans-Peter Nilsson + + PR gas/2101 + * config/tc-mmix.c (mmix_handle_mmixal): Don't treat #[0-9][FB] as + a local-label reference. + +For older changes see ChangeLog-2005 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/gas/Makefile.am b/gas/Makefile.am index 08b9842fc6b..670423660d0 100644 --- a/gas/Makefile.am +++ b/gas/Makefile.am @@ -1,9 +1,7 @@ ## Process this file with automake to generate Makefile.in -## Work around apparent automake bug. -INTLLIBS = @INTLLIBS@ - AUTOMAKE_OPTIONS = 1.8 cygnus dejagnu +ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd SUBDIRS = doc po # Automake should figure this out on its own. It doesn't, because @@ -15,6 +13,10 @@ tooldir = $(exec_prefix)/$(target_alias) YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo @YACC@ ; fi` LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo @LEX@ ; fi` +# We have to set this, because autoconf 2.59 does not substitute YFLAGS. +# Autoconf 2.61 does, so this can be removed when we upgrade. +YFLAGS = + WARN_CFLAGS = @WARN_CFLAGS@ NO_WERROR = @NO_WERROR@ AM_CFLAGS = $(WARN_CFLAGS) @@ -33,7 +35,7 @@ ATOF_TARG_C = $(srcdir)/config/atof-@atof@.c ATOF_TARG_O = atof-@atof@.o # use @target_cpu_type@ for refering to configured target name -IT_HDRS=itbl-parse.h $(srcdir)/itbl-ops.h +IT_HDRS=itbl-parse.h $(srcdir)/itbl-ops.h IT_SRCS=itbl-parse.c itbl-lex.c $(srcdir)/itbl-ops.c IT_DEPS=$(srcdir)/itbl-parse.y $(srcdir)/itbl-lex.l $(srcdir)/config/itbl-@target_cpu_type@.h IT_OBJS=itbl-parse.o itbl-lex.o itbl-ops.o @@ -46,6 +48,7 @@ CPU_TYPES = \ arm \ avr \ bfin \ + cr16 \ cris \ crx \ d10v \ @@ -55,22 +58,25 @@ CPU_TYPES = \ frv \ h8300 \ hppa \ - ia64 \ i370 \ i386 \ i860 \ i960 \ + ia64 \ ip2k \ m32c \ m32r \ m68hc11 \ m68k \ + maxq \ mcore \ + mep \ mips \ mmix \ mn10200 \ mn10300 \ msp430 \ + mt \ ns32k \ openrisc \ or32 \ @@ -78,16 +84,18 @@ CPU_TYPES = \ pj \ ppc \ s390 \ + score \ sh \ sh64 \ sparc \ + spu \ tic30 \ tic4x \ tic54x \ - vax \ v850 \ - xstormy16 \ + vax \ xc16x \ + xstormy16 \ xtensa \ z80 \ z8k @@ -100,8 +108,7 @@ OBJ_FORMATS = \ coff \ ecoff \ elf \ - evax \ - ieee + evax # This is an sh case which sets valid according to whether the CPU # type in the shell variable c and the OS type in the shell variable o @@ -116,16 +123,20 @@ CPU_OBJ_VALID = \ arm | cris | i386 | m68k | ns32k | pdp11 | sparc | tic30 | vax) \ valid=yes ;; \ esac ;; \ - coff) valid=yes; \ + coff) \ case $$c in \ - cris | i860 | mmix | sh64) \ - valid= ;; \ + arm | h8300 | i386 | i960 | m68k | maxq | mcore | mips | or32 \ + | ppc | sh | sparc | tic* | xscale | z80 | z8k) \ + valid=yes ;; \ esac ;; \ ecoff) \ case $$c in \ mips | alpha) valid=yes ;; \ esac ;; \ - elf) valid=yes ;; \ + elf) valid=yes ; \ + case $$c in \ + maxq | ns32k | tic* | z80 | z8k) valid= ;; \ + esac ;; \ evax) \ case $$c in \ alpha) valid=yes ;; \ @@ -230,6 +241,7 @@ TARGET_CPU_CFILES = \ config/tc-arm.c \ config/tc-avr.c \ config/tc-bfin.c \ + config/tc-cr16.c \ config/tc-cris.c \ config/tc-crx.c \ config/tc-d10v.c \ @@ -250,6 +262,7 @@ TARGET_CPU_CFILES = \ config/tc-m68hc11.c \ config/tc-m68k.c \ config/tc-mcore.c \ + config/tc-mep.c \ config/tc-mips.c \ config/tc-mmix.c \ config/tc-mn10200.c \ @@ -262,9 +275,11 @@ TARGET_CPU_CFILES = \ config/tc-pj.c \ config/tc-ppc.c \ config/tc-s390.c \ + config/tc-score.c \ config/tc-sh.c \ config/tc-sh64.c \ config/tc-sparc.c \ + config/tc-spu.c \ config/tc-tic30.c \ config/tc-tic54x.c \ config/tc-vax.c \ @@ -281,6 +296,7 @@ TARGET_CPU_HFILES = \ config/tc-arm.h \ config/tc-avr.h \ config/tc-bfin.h \ + config/tc-cr16.h \ config/tc-cris.h \ config/tc-crx.h \ config/tc-d10v.h \ @@ -301,6 +317,7 @@ TARGET_CPU_HFILES = \ config/tc-m68hc11.h \ config/tc-m68k.h \ config/tc-mcore.h \ + config/tc-mep.h \ config/tc-mips.h \ config/tc-mmix.h \ config/tc-mn10200.h \ @@ -313,9 +330,11 @@ TARGET_CPU_HFILES = \ config/tc-pj.h \ config/tc-ppc.h \ config/tc-s390.h \ + config/tc-score.h \ config/tc-sh.h \ config/tc-sh64.h \ config/tc-sparc.h \ + config/tc-spu.h \ config/tc-tic30.h \ config/tc-tic54x.h \ config/tc-vax.h \ @@ -334,7 +353,6 @@ OBJ_FORMAT_CFILES = \ config/obj-ecoff.c \ config/obj-elf.c \ config/obj-evax.c \ - config/obj-ieee.c \ config/obj-som.c OBJ_FORMAT_HFILES = \ @@ -343,7 +361,6 @@ OBJ_FORMAT_HFILES = \ config/obj-ecoff.h \ config/obj-elf.h \ config/obj-evax.h \ - config/obj-ieee.h \ config/obj-som.h # Emulation header files in config @@ -381,7 +398,8 @@ TARG_ENV_HFILES = \ config/te-sun3.h \ config/te-svr4.h \ config/te-symbian.h \ - config/te-tmips.h + config/te-tmips.h \ + config/te-wince-pe.h # Multi files in config @@ -464,13 +482,18 @@ INCDIR = $(BASEDIR)/include # Both . and srcdir are used, in that order, # so that tm.h and config.h will be found in the compilation # subdirectory rather than in the source directory. -INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR) -I$(srcdir)/../intl -I../intl -DLOCALEDIR="\"$(datadir)/locale\"" +INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(srcdir)/config \ + -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR) @INCINTL@ \ + -DLOCALEDIR="\"$(datadir)/locale\"" # This should be parallel to INCLUDES, but should replace $(srcdir) # with $${srcdir}, and should work in a subdirectory. This is used # when building dependencies, because the dependency building is done # in a subdirectory. -DEP_INCLUDES = -D_GNU_SOURCE -I.. -I$${srcdir} -I../../bfd -I$${srcdir}/config -I$${srcdir}/../include -I$${srcdir}/.. -I$${srcdir}/../bfd -I$${srcdir}/../intl -I../../intl -DLOCALEDIR="\"$(datadir)/locale\"" +DEP_INCLUDES = -D_GNU_SOURCE -I.. -I$${srcdir} -I../../bfd \ + -I$${srcdir}/config -I$${srcdir}/../include -I$${srcdir}/.. \ + -I$${srcdir}/../bfd @INCINTL@ \ + -DLOCALEDIR="\"$(datadir)/locale\"" DEP_FLAGS = -DOBJ_MAYBE_ELF \ -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) @@ -478,25 +501,22 @@ DEP_FLAGS = -DOBJ_MAYBE_ELF \ # How to link with both our special library facilities # and the system's installed libraries. -GASLIBS = @OPCODES_LIB@ @BFDLIB@ ../libiberty/libiberty.a +GASLIBS = @OPCODES_LIB@ ../bfd/libbfd.la ../libiberty/libiberty.a # Files to be copied away after each stage in building. STAGESTUFF = *.o $(noinst_PROGRAMS) -BFDVER_H = @BFDVER_H@ - -$(OBJS): @ALL_OBJ_DEPS@ - as_new_SOURCES = $(GAS_CFILES) as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \ - $(extra_objects) $(GASLIBS) $(INTLLIBS) $(LIBM) + $(extra_objects) $(GASLIBS) $(LIBINTL) $(LIBM) as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \ - $(extra_objects) $(GASLIBS) $(INTLDEPS) + $(extra_objects) $(GASLIBS) $(LIBINTL_DEP) # Stuff that every object file depends upon. If anything is removed # from this list, remove it from dep-in.sed as well. -$(OBJS): $(INCDIR)/bin-bugs.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ - $(INCDIR)/progress.h $(INCDIR)/fopen-same.h \ +$(OBJS): ../bfd/bfd.h $(INCDIR)/symcat.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h $(INCDIR)/progress.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/fopen-bin.h $(INCDIR)/fopen-vms.h \ $(OBJ_FORMAT_H) $(TARG_CPU_H) $(TARG_ENV_H) \ as.h asintl.h bignum.h bit_fix.h config.h emul.h expr.h flonum.h \ frags.h hash.h listing.h obj.h read.h symbols.h tc.h write.h @@ -540,18 +560,16 @@ ecoff.o : ecoff.c ecoff.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \ # We need all these explicit rules for the multi stuff. Because of # these rules, we don't need one for OBJ_FORMAT_O. -obj-aout.o : $(srcdir)/config/obj-aout.c +obj-aout.o : $(srcdir)/config/obj-aout.c $(DEP_@target_cpu_type@_aout) $(COMPILE) -c $(srcdir)/config/obj-aout.c -obj-coff.o: $(srcdir)/config/obj-coff.c +obj-coff.o: $(srcdir)/config/obj-coff.c $(DEP_@target_cpu_type@_coff) $(COMPILE) -c $(srcdir)/config/obj-coff.c -obj-ecoff.o : $(srcdir)/config/obj-ecoff.c +obj-ecoff.o : $(srcdir)/config/obj-ecoff.c $(DEP_@target_cpu_type@_ecoff) $(COMPILE) -c $(srcdir)/config/obj-ecoff.c -obj-elf.o : $(srcdir)/config/obj-elf.c +obj-elf.o : $(srcdir)/config/obj-elf.c $(DEP_@target_cpu_type@_elf) $(COMPILE) -c $(srcdir)/config/obj-elf.c obj-evax.o : $(srcdir)/config/obj-evax.c $(COMPILE) -c $(srcdir)/config/obj-evax.c -obj-ieee.o : $(srcdir)/config/obj-ieee.c - $(COMPILE) -c $(srcdir)/config/obj-ieee.c obj-multi.o : $(srcdir)/config/obj-multi.c $(COMPILE) -c $(srcdir)/config/obj-multi.c obj-som.o : $(srcdir)/config/obj-som.c @@ -602,7 +620,7 @@ m68k-parse.c: $(srcdir)/config/m68k-parse.y rm -f m68k-parse.y; \ else true; fi # Disable -Werror, if it has been enabled, since old versions of bison/ -# yacc will produce working code which contain compile time warnings. +# yacc will produce working code which contain compile time warnings. m68k-parse.o: m68k-parse.c $(srcdir)/config/m68k-parse.h $(COMPILE) -c $< $(NO_WERROR) @@ -629,12 +647,12 @@ bfin-lex.o: bfin-lex.c bfin-parse.h $(srcdir)/config/bfin-defs.h itbl-lex.c: $(srcdir)/itbl-lex.l # Disable -Werror, if it has been enabled, since old versions of bison/ -# yacc will produce working code which contain compile time warnings. +# yacc will produce working code which contain compile time warnings. itbl-lex.o: itbl-lex.c itbl-parse.h $(srcdir)/itbl-lex.h $(COMPILE) -c $< $(NO_WERROR) # Disable -Werror, if it has been enabled, since old versions of bison/ -# yacc will produce working code which contain compile time warnings. +# yacc will produce working code which contain compile time warnings. itbl-parse.o: itbl-parse.c itbl-parse.h $(srcdir)/itbl-ops.h $(srcdir)/itbl-lex.h $(COMPILE) -c $< $(NO_WERROR) @@ -988,582 +1006,443 @@ dep-am: DEP .PHONY: dep dep-in dep-am AMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW. -DEPTC_alpha_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-alpha.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h ecoff.h $(INCDIR)/opcode/alpha.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c -DEPTC_alpha_ecoff = $(INCDIR)/symcat.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-alpha.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/opcode/alpha.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c -DEPTC_alpha_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h \ +DEPTC_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ subsegs.h $(INCDIR)/obstack.h struc-symbol.h ecoff.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h $(INCDIR)/opcode/alpha.h \ - $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ - dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h \ - $(srcdir)/config/atof-vax.c -DEPTC_alpha_evax = $(INCDIR)/symcat.h $(srcdir)/config/obj-evax.h \ - $(srcdir)/config/tc-alpha.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h ecoff.h $(INCDIR)/opcode/alpha.h dw2gencfi.h \ + $(INCDIR)/opcode/alpha.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c +DEPTC_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h subsegs.h \ + $(INCDIR)/obstack.h struc-symbol.h ecoff.h $(INCDIR)/coff/sym.h \ + $(INCDIR)/coff/ecoff.h $(INCDIR)/opcode/alpha.h $(INCDIR)/elf/alpha.h \ + $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h dw2gencfi.h \ $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c -DEPTC_arc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h struc-symbol.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ +DEPTC_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h \ + subsegs.h $(INCDIR)/obstack.h struc-symbol.h ecoff.h \ + $(INCDIR)/opcode/alpha.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c +DEPTC_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h dwarf2dbg.h \ + struc-symbol.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/arc.h $(srcdir)/../opcodes/arc-ext.h \ $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h -DEPTC_arc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h \ - dwarf2dbg.h struc-symbol.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/arc.h $(srcdir)/../opcodes/arc-ext.h \ - $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h -DEPTC_arm_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-arm.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/arm.h -DEPTC_arm_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arm.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h -DEPTC_arm_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/arm.h $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \ - dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h -DEPTC_avr_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-avr.h $(INCDIR)/coff/internal.h \ +DEPTC_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h \ + dwarf2dbg.h +DEPTC_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/avr.h -DEPTC_avr_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h \ + dwarf2dbg.h +DEPTC_arm_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h \ + $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h dwarf2dbg.h +DEPTC_avr_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/avr.h -DEPTC_bfin_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-bfin.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h struc-symbol.h \ - $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h dwarf2dbg.h \ - $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ - $(srcdir)/config/bfin-aux.h $(INCDIR)/opcode/bfin.h \ - $(srcdir)/config/bfin-defs.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h -DEPTC_bfin_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h \ - dwarf2dbg.h struc-symbol.h $(srcdir)/config/bfin-defs.h \ - $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h $(srcdir)/config/bfin-aux.h \ - $(INCDIR)/opcode/bfin.h $(srcdir)/config/bfin-defs.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h -DEPTC_cris_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-cris.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ +DEPTC_bfin_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h dwarf2dbg.h \ + struc-symbol.h $(srcdir)/config/bfin-defs.h $(INCDIR)/obstack.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h $(BFDDIR)/libbfd.h \ + $(INCDIR)/hashtab.h $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h \ + $(INCDIR)/elf/reloc-macros.h $(srcdir)/config/bfin-aux.h \ + $(srcdir)/config/bfin-defs.h $(INCDIR)/opcode/bfin.h +DEPTC_cr16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cr16.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h $(INCDIR)/opcode/cr16.h \ + $(INCDIR)/elf/cr16.h $(INCDIR)/elf/reloc-macros.h +DEPTC_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/cris.h \ + dwarf2dbg.h +DEPTC_cris_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h dwarf2dbg.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/cris.h dwarf2dbg.h -DEPTC_cris_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/cris.h -DEPTC_crx_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-crx.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - dwarf2dbg.h $(INCDIR)/opcode/crx.h $(INCDIR)/elf/crx.h \ - $(INCDIR)/elf/reloc-macros.h -DEPTC_crx_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/crx.h \ +DEPTC_crx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h $(INCDIR)/opcode/crx.h \ $(INCDIR)/elf/crx.h $(INCDIR)/elf/reloc-macros.h -DEPTC_d10v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d10v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ +DEPTC_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/d10v.h \ $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h -DEPTC_d10v_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/d10v.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h -DEPTC_d30v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d30v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ +DEPTC_d30v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/d30v.h -DEPTC_d30v_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ +DEPTC_dlx_elf = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h \ + dwarf2dbg.h $(srcdir)/config/tc-dlx.h $(INCDIR)/opcode/dlx.h +DEPTC_fr30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h dwarf2dbg.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/d30v.h -DEPTC_dlx_coff = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-dlx.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/opcode/dlx.h -DEPTC_dlx_elf = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(srcdir)/config/tc-dlx.h dwarf2dbg.h $(INCDIR)/opcode/dlx.h -DEPTC_fr30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-fr30.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/fr30-desc.h \ - $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/fr30-opc.h cgen.h -DEPTC_fr30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(srcdir)/../opcodes/fr30-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/fr30-opc.h \ - cgen.h -DEPTC_frv_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-frv.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/frv-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/frv-opc.h \ + $(INCDIR)/opcode/cgen.h $(INCDIR)/opcode/cgen-bitset.h \ + $(srcdir)/../opcodes/fr30-opc.h cgen.h +DEPTC_frv_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h subsegs.h \ + $(INCDIR)/obstack.h $(srcdir)/../opcodes/frv-desc.h \ + $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/frv-opc.h \ cgen.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/frv.h $(INCDIR)/elf/reloc-macros.h -DEPTC_frv_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/frv-desc.h \ - $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/frv-opc.h cgen.h $(BFDDIR)/libbfd.h \ - $(INCDIR)/hashtab.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/reloc-macros.h -DEPTC_h8300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \ - $(INCDIR)/opcode/h8300.h $(INCDIR)/safe-ctype.h -DEPTC_h8300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h \ +DEPTC_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + dwarf2dbg.h $(INCDIR)/opcode/h8300.h $(INCDIR)/safe-ctype.h +DEPTC_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(INCDIR)/opcode/h8300.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h -DEPTC_hppa_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-hppa.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h -DEPTC_hppa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h \ - $(BFDDIR)/elf32-hppa.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ +DEPTC_hppa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h $(BFDDIR)/elf32-hppa.h \ + $(BFDDIR)/elf-bfd.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/hppa.h \ - dwarf2dbg.h -DEPTC_ia64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ - $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h -DEPTC_ia64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h \ - $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/safe-ctype.h dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h -DEPTC_i370_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i370.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/i370.h -DEPTC_i370_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h dwarf2dbg.h +DEPTC_i370_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ struc-symbol.h $(INCDIR)/opcode/i370.h $(INCDIR)/elf/i370.h \ $(INCDIR)/elf/reloc-macros.h -DEPTC_i386_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-i386.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ +DEPTC_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h +DEPTC_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h +DEPTC_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \ + $(INCDIR)/opcode/i386.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h +DEPTC_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h dwarf2dbg.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/i386.h \ - $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h -DEPTC_i386_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i386.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ - $(INCDIR)/opcode/i386.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h -DEPTC_i386_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/i386.h \ - $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h -DEPTC_i860_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/i860.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h -DEPTC_i960_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i960.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h -DEPTC_i960_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ +DEPTC_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/i960.h -DEPTC_ip2k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ip2k.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/ip2k-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/ip2k-opc.h \ +DEPTC_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h +DEPTC_ia64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ + $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ + dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/ia64.h \ + $(INCDIR)/elf/ia64.h +DEPTC_ip2k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/ip2k-desc.h \ + $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/ip2k-opc.h \ cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/ip2k.h \ $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h -DEPTC_ip2k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/ip2k-desc.h \ - $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/ip2k-opc.h cgen.h $(INCDIR)/elf/ip2k.h \ - $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h -DEPTC_m32c_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m32c.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/m32c-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/m32c-opc.h \ - $(srcdir)/../opcodes/cgen-types.h $(srcdir)/../opcodes/cgen-ops.h \ - cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/m32c.h \ - $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h \ - $(INCDIR)/safe-ctype.h -DEPTC_m32c_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/m32c-desc.h \ - $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/m32c-opc.h $(srcdir)/../opcodes/cgen-types.h \ - $(srcdir)/../opcodes/cgen-ops.h cgen.h $(INCDIR)/elf/m32c.h \ - $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h \ - $(INCDIR)/safe-ctype.h -DEPTC_m32r_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m32r.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/m32r-desc.h \ +DEPTC_m32c_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/m32c-desc.h \ $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/m32c-opc.h \ + $(srcdir)/../opcodes/cgen-types.h ../bfd/bfd_stdint.h \ + $(srcdir)/../opcodes/cgen-ops.h cgen.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/m32c.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h \ + $(INCDIR)/hashtab.h $(INCDIR)/safe-ctype.h +DEPTC_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/m32r-desc.h $(INCDIR)/opcode/cgen-bitset.h \ + $(INCDIR)/opcode/cgen.h $(INCDIR)/opcode/cgen-bitset.h \ $(srcdir)/../opcodes/m32r-opc.h cgen.h $(INCDIR)/elf/m32r.h \ $(INCDIR)/elf/reloc-macros.h -DEPTC_m32r_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/m32r-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/m32r-opc.h \ - cgen.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h -DEPTC_m68hc11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m68hc11.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h \ - $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/reloc-macros.h -DEPTC_m68hc11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/m68hc11.h $(INCDIR)/elf/m68hc11.h \ +DEPTC_m68hc11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h $(INCDIR)/elf/m68hc11.h \ $(INCDIR)/elf/reloc-macros.h -DEPTC_m68k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h subsegs.h \ - dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ +DEPTC_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ $(srcdir)/config/m68k-parse.h -DEPTC_m68k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m68k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ - subsegs.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ - $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h -DEPTC_m68k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h subsegs.h \ - dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ +DEPTC_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ + $(srcdir)/config/m68k-parse.h +DEPTC_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ $(srcdir)/config/m68k-parse.h $(INCDIR)/elf/m68k.h \ $(INCDIR)/elf/reloc-macros.h -DEPTC_mcore_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h \ - $(INCDIR)/safe-ctype.h -DEPTC_mcore_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/elf/mcore.h $(INCDIR)/elf/reloc-macros.h -DEPTC_mips_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mips.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/opcode/mips.h itbl-ops.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ +DEPTC_maxq_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-maxq.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/maxq.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(srcdir)/config/tc-maxq.h \ + $(INCDIR)/opcode/maxq.h +DEPTC_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/mcore-opc.h $(INCDIR)/safe-ctype.h +DEPTC_mcore_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h ecoff.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h -DEPTC_mips_ecoff = $(INCDIR)/symcat.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-mips.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/elf/mcore.h $(INCDIR)/elf/reloc-macros.h +DEPTC_mep_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mep.h dwarf2dbg.h \ + dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mep-desc.h \ + $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/mep-opc.h \ + cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/mep.h $(INCDIR)/elf/reloc-macros.h \ + $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h $(INCDIR)/xregex.h \ + $(INCDIR)/xregex2.h +DEPTC_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/mips.h itbl-ops.h \ dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mips.h \ - $(INCDIR)/elf/reloc-macros.h -DEPTC_mips_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h +DEPTC_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/opcode/mips.h itbl-ops.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/elf/dwarf2.h $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ + ecoff.h +DEPTC_mips_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/mips.h \ + itbl-ops.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(srcdir)/config/obj-elf.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h -DEPTC_mmix_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/mmix.h \ +DEPTC_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/mmix.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/mmix.h \ - $(INCDIR)/safe-ctype.h -DEPTC_mn10200_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10200.h -DEPTC_mn10200_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h $(INCDIR)/obstack.h +DEPTC_mn10200_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/mn10200.h -DEPTC_mn10300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10300.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10300.h \ - dwarf2dbg.h -DEPTC_mn10300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/mn10300.h -DEPTC_msp430_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-msp430.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/msp430.h $(INCDIR)/safe-ctype.h dwarf2dbg.h -DEPTC_msp430_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/msp430.h \ - $(INCDIR)/safe-ctype.h -DEPTC_ns32k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/opcode/ns32k.h $(INCDIR)/obstack.h -DEPTC_ns32k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ns32k.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ns32k.h \ +DEPTC_mn10300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/mn10300.h dwarf2dbg.h +DEPTC_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/msp430.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h +DEPTC_mt_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mt.h dwarf2dbg.h \ + dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mt-desc.h \ + $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/mt-opc.h \ + cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/mt.h $(INCDIR)/elf/reloc-macros.h \ + $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h +DEPTC_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ns32k.h \ $(INCDIR)/obstack.h -DEPTC_ns32k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ns32k.h \ - dwarf2dbg.h $(INCDIR)/opcode/ns32k.h $(INCDIR)/obstack.h -DEPTC_openrisc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-openrisc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/openrisc-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/openrisc-opc.h \ - cgen.h -DEPTC_openrisc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ +DEPTC_openrisc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/openrisc-desc.h \ $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/openrisc-opc.h cgen.h -DEPTC_or32_coff = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-or32.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/opcode/or32.h $(INCDIR)/elf/or32.h \ - $(INCDIR)/elf/reloc-macros.h -DEPTC_or32_elf = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(srcdir)/config/tc-or32.h dwarf2dbg.h $(INCDIR)/opcode/or32.h \ - $(INCDIR)/elf/or32.h $(INCDIR)/elf/reloc-macros.h -DEPTC_pdp11_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-pdp11.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pdp11.h -DEPTC_pdp11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-pdp11.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/opcode/pdp11.h -DEPTC_pdp11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pdp11.h -DEPTC_pj_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-pj.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/opcode/pj.h -DEPTC_pj_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pj.h -DEPTC_ppc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ppc.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/ppc.h -DEPTC_ppc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/ppc.h \ - $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h -DEPTC_s390_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-s390.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/s390.h \ - $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h -DEPTC_s390_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/s390.h \ - $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h -DEPTC_sh_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \ - $(INCDIR)/safe-ctype.h struc-symbol.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h -DEPTC_sh_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \ - $(INCDIR)/safe-ctype.h struc-symbol.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h -DEPTC_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(BFDDIR)/elf32-sh64.h $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/sh64-opc.h \ - $(srcdir)/config/tc-sh.c subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/sh-opc.h struc-symbol.h dwarf2dbg.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h -DEPTC_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/sparc.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h -DEPTC_sparc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sparc.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h -DEPTC_sparc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/sparc.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ - $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h -DEPTC_tic30_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h -DEPTC_tic30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic30.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h -DEPTC_tic30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h -DEPTC_tic4x_coff = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic4x.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/tic4x.h \ - subsegs.h $(INCDIR)/obstack.h -DEPTC_tic4x_elf = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(srcdir)/config/tc-tic4x.h dwarf2dbg.h $(INCDIR)/opcode/tic4x.h \ - subsegs.h $(INCDIR)/obstack.h -DEPTC_tic54x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic54x.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h sb.h macro.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/tic54x.h -DEPTC_tic54x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic54x.h \ - $(INCDIR)/safe-ctype.h sb.h macro.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/opcode/tic54x.h $(srcdir)/config/obj-coff.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ - $(BFDDIR)/libcoff.h -DEPTC_vax_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-vax.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h subsegs.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/vax.h -DEPTC_vax_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-vax.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(srcdir)/config/vax-inst.h \ - $(INCDIR)/obstack.h subsegs.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/opcode/vax.h -DEPTC_vax_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h \ - dwarf2dbg.h $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h \ - subsegs.h $(INCDIR)/safe-ctype.h $(INCDIR)/elf/vax.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/vax.h -DEPTC_v850_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/v850.h dwarf2dbg.h -DEPTC_v850_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/v850.h -DEPTC_xstormy16_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-xstormy16.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/xstormy16-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/xstormy16-opc.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/openrisc-opc.h \ cgen.h -DEPTC_xstormy16_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ +DEPTC_or32_coff = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-or32.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/opcode/or32.h $(INCDIR)/elf/or32.h $(INCDIR)/elf/reloc-macros.h +DEPTC_or32_elf = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h \ + dwarf2dbg.h $(INCDIR)/opcode/or32.h $(INCDIR)/elf/or32.h \ + $(INCDIR)/elf/reloc-macros.h +DEPTC_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/pdp11.h +DEPTC_pdp11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pdp11.h +DEPTC_pj_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pj.h +DEPTC_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ + $(INCDIR)/obstack.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/opcode/ppc.h +DEPTC_ppc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/ppc.h \ + $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h +DEPTC_s390_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + struc-symbol.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/opcode/s390.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h +DEPTC_score_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-score.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/score-inst.h $(INCDIR)/opcode/score-datadep.h \ + struc-symbol.h $(INCDIR)/elf/score.h $(INCDIR)/elf/reloc-macros.h \ + dwarf2dbg.h +DEPTC_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/sh-opc.h $(INCDIR)/safe-ctype.h \ + struc-symbol.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h +DEPTC_sh_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h subsegs.h \ + $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h $(INCDIR)/safe-ctype.h \ + struc-symbol.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ + dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h +DEPTC_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/elf32-sh64.h \ + $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/sh64-opc.h \ + $(srcdir)/config/tc-sh.c subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/sh-opc.h $(INCDIR)/safe-ctype.h \ + struc-symbol.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h +DEPTC_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h +DEPTC_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h +DEPTC_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/sparc.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ + dwarf2dbg.h +DEPTC_spu_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-spu.h $(INCDIR)/opcode/spu.h \ + $(INCDIR)/opcode/spu-insns.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(INCDIR)/opcode/spu-insns.h +DEPTC_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/tic30.h +DEPTC_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/tic30.h +DEPTC_tic4x_coff = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-tic4x.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/opcode/tic4x.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/obstack.h +DEPTC_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + sb.h macro.h subsegs.h $(INCDIR)/obstack.h struc-symbol.h \ + $(INCDIR)/opcode/tic54x.h $(srcdir)/config/obj-coff.h +DEPTC_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h \ + $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/v850.h \ + dwarf2dbg.h +DEPTC_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(srcdir)/config/vax-inst.h \ + $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/vax.h +DEPTC_vax_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h dwarf2dbg.h \ + $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h $(INCDIR)/elf/vax.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/vax.h +DEPTC_xc16x_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/xc16x-desc.h $(INCDIR)/opcode/cgen-bitset.h \ + $(INCDIR)/opcode/cgen.h $(INCDIR)/opcode/cgen-bitset.h \ + $(srcdir)/../opcodes/xc16x-opc.h cgen.h dwarf2dbg.h \ + $(INCDIR)/elf/xc16x.h $(INCDIR)/elf/reloc-macros.h +DEPTC_xstormy16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/xstormy16-desc.h \ $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/xstormy16-opc.h cgen.h -DEPTC_xc16x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/xc16x-desc.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/xc16x-opc.h cgen.h -DEPTC_xtensa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h \ - $(INCDIR)/xtensa-isa.h $(INCDIR)/xtensa-config.h sb.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/xstormy16-opc.h \ + cgen.h +DEPTC_xtensa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h $(INCDIR)/xtensa-isa.h \ + $(INCDIR)/xtensa-config.h sb.h $(INCDIR)/safe-ctype.h \ + $(srcdir)/config/tc-xtensa.h subsegs.h $(INCDIR)/obstack.h \ $(srcdir)/config/xtensa-relax.h $(srcdir)/config/xtensa-istack.h \ - dwarf2dbg.h struc-symbol.h -DEPTC_z80_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-z80.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h -DEPTC_z80_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z80.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h -DEPTC_z8k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-z8k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/z8k-opc.h -DEPTC_z8k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z8k.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/z8k-opc.h + dwarf2dbg.h struc-symbol.h $(INCDIR)/xtensa-config.h +DEPTC_z80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z80.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h +DEPTC_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(srcdir)/../opcodes/z8k-opc.h DEPTC_hppa_som = $(srcdir)/config/tc-hppa.h subsegs.h \ $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h \ $(BFDDIR)/som.h @@ -1572,483 +1451,364 @@ DEPTC_i386_multi = $(DEPTC_i386_aout) $(DEPTC_i386_coff) \ DEPTC_mips_multi = $(DEPTC_mips_coff) $(DEPTC_mips_ecoff) \ $(DEPTC_mips_elf) DEPTC_cris_multi = $(DEPTC_cris_aout) $(DEPTC_cris_elf) -DEPOBJ_alpha_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-alpha.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_alpha_ecoff = $(INCDIR)/symcat.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-alpha.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(BFDDIR)/libecoff.h -DEPOBJ_alpha_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/aout/aout64.h -DEPOBJ_alpha_evax = $(INCDIR)/symcat.h $(srcdir)/config/obj-evax.h \ - $(srcdir)/config/tc-alpha.h -DEPOBJ_arc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_arc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_arm_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-arm.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_arm_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arm.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_arm_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_avr_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-avr.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_avr_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_bfin_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-bfin.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_bfin_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_cris_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-cris.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_cris_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_crx_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-crx.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_crx_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_d10v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d10v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_d10v_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_d30v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d30v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_d30v_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_dlx_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-dlx.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_dlx_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_fr30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-fr30.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_fr30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_frv_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-frv.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_frv_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_h8300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_h8300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_hppa_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-hppa.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_hppa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h \ - $(BFDDIR)/elf32-hppa.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h \ - $(INCDIR)/aout/aout64.h -DEPOBJ_ia64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ - $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_ia64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h \ - $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_i370_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i370.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_i370_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/elf/i370.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/aout/aout64.h -DEPOBJ_i386_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-i386.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_i386_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i386.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_i386_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/aout/aout64.h -DEPOBJ_i860_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_i960_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i960.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h -DEPOBJ_i960_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_ip2k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ip2k.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_ip2k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_m32c_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m32c.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_m32c_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_m32r_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m32r.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_m32r_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_m68hc11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m68hc11.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_m68hc11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_m68k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_m68k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m68k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_m68k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_mcore_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_mcore_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_mips_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mips.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_mips_ecoff = $(INCDIR)/symcat.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-mips.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(BFDDIR)/libecoff.h -DEPOBJ_mips_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/aout/aout64.h -DEPOBJ_mmix_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_mn10200_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_mn10200_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_mn10300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10300.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_mn10300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_msp430_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-msp430.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_msp430_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_ns32k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_ns32k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ns32k.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_ns32k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ns32k.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_openrisc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-openrisc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_openrisc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_or32_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-or32.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h -DEPOBJ_or32_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_pdp11_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-pdp11.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_pdp11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-pdp11.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_pdp11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_pj_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-pj.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_pj_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_ppc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ppc.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h -DEPOBJ_ppc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/aout/aout64.h -DEPOBJ_s390_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-s390.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_s390_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_sh_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_sh_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(BFDDIR)/elf32-sh64.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_sparc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sparc.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_sparc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_tic30_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_tic30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic30.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_tic30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_tic4x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic4x.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_tic4x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic4x.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_tic54x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic54x.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_tic54x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic54x.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_vax_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-vax.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_vax_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-vax.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_vax_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_v850_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ +DEPOBJ_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h -DEPOBJ_v850_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_xstormy16_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-xstormy16.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_xstormy16_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_xc16x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_xtensa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h \ - $(INCDIR)/xtensa-isa.h $(INCDIR)/xtensa-config.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h \ + $(BFDDIR)/libecoff.h +DEPOBJ_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ + $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/aout/aout64.h -DEPOBJ_z80_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-z80.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_z80_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z80.h \ +DEPOBJ_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h +DEPOBJ_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h +DEPOBJ_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_arm_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_avr_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_bfin_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h +DEPOBJ_cris_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_crx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_d30v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_dlx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_fr30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_frv_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_hppa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h $(BFDDIR)/elf32-hppa.h \ + $(BFDDIR)/elf-bfd.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_i370_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/i370.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h +DEPOBJ_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h +DEPOBJ_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \ + $(INCDIR)/opcode/i386.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h +DEPOBJ_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_ia64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ + $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_ip2k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_m32c_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_m68hc11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h +DEPOBJ_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_maxq_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-maxq.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/maxq.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_mcore_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_mep_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mep.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/mep.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h +DEPOBJ_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ + $(BFDDIR)/libecoff.h +DEPOBJ_mips_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ + $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h +DEPOBJ_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_mn10200_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_mn10300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_mt_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mt.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h +DEPOBJ_openrisc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_z8k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-z8k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_z8k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z8k.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_or32_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-or32.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h +DEPOBJ_or32_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h +DEPOBJ_pdp11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_pj_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h +DEPOBJ_ppc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/ppc.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h +DEPOBJ_s390_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_score_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-score.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_sh_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/elf32-sh64.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h +DEPOBJ_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_spu_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-spu.h $(INCDIR)/opcode/spu.h \ + $(INCDIR)/opcode/spu-insns.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h +DEPOBJ_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_tic4x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic4x.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h \ + $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h +DEPOBJ_vax_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_xc16x_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_xstormy16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_xtensa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h $(INCDIR)/xtensa-isa.h \ + $(INCDIR)/xtensa-config.h $(INCDIR)/safe-ctype.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_z80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z80.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h DEPOBJ_hppa_som = $(srcdir)/config/obj-som.h subsegs.h \ $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(BFDDIR)/som.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def @@ -2057,354 +1817,309 @@ DEPOBJ_i386_multi = $(DEPOBJ_i386_aout) $(DEPOBJ_i386_coff) \ DEPOBJ_mips_multi = $(DEPOBJ_mips_coff) $(DEPOBJ_mips_ecoff) \ $(DEPOBJ_mips_elf) DEPOBJ_cris_multi = $(DEPOBJ_cris_aout) $(DEPOBJ_cris_elf) -DEP_alpha_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-alpha.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h DEP_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h -DEP_alpha_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h +DEP_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h DEP_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h -DEP_arc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arc.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_arc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h \ - dwarf2dbg.h +DEP_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_arm_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h -DEP_avr_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-avr.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_avr_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h \ - dwarf2dbg.h -DEP_bfin_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-bfin.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_bfin_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_arm_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h +DEP_avr_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_bfin_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_cr16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cr16.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_cris_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h \ - dwarf2dbg.h -DEP_crx_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-crx.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_crx_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h \ - dwarf2dbg.h -DEP_d10v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d10v.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_d10v_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h -DEP_d30v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d30v.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_d30v_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h -DEP_dlx_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-dlx.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_dlx_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h \ - dwarf2dbg.h -DEP_fr30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-fr30.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_fr30_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h \ - dwarf2dbg.h -DEP_frv_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-frv.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_frv_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h +DEP_cris_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_crx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h +DEP_d30v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h +DEP_dlx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_fr30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_frv_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h DEP_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_h8300_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h \ - dwarf2dbg.h -DEP_hppa_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-hppa.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_hppa_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h \ - $(BFDDIR)/elf32-hppa.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ - $(INCDIR)/elf/reloc-macros.h -DEP_ia64_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ia64.h \ - $(INCDIR)/opcode/ia64.h $(INCDIR)/symcat.h $(INCDIR)/elf/ia64.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_ia64_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h \ - $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h -DEP_i370_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i370.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_i370_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h \ - dwarf2dbg.h +DEP_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h +DEP_hppa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h $(BFDDIR)/elf32-hppa.h \ + $(BFDDIR)/elf-bfd.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ + $(INCDIR)/elf/reloc-macros.h +DEP_i370_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_i386_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h \ - dwarf2dbg.h -DEP_i860_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h \ - dwarf2dbg.h -DEP_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_i960_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h \ - dwarf2dbg.h -DEP_ip2k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ip2k.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ +DEP_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \ + $(INCDIR)/opcode/i386.h dwarf2dbg.h $(srcdir)/config/obj-coff.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h +DEP_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h -DEP_ip2k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h \ - dwarf2dbg.h -DEP_m32c_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m32c.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_m32c_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h \ - dwarf2dbg.h -DEP_m32r_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m32r.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_m32r_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h \ - dwarf2dbg.h -DEP_m68hc11_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68hc11.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_m68hc11_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h \ - dwarf2dbg.h +DEP_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h +DEP_ia64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ + $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h +DEP_ip2k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_m32c_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_m68hc11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h DEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_m68k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h +DEP_maxq_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-maxq.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/maxq.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_mcore_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_mcore_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h +DEP_mep_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mep.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h -DEP_mips_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h -DEP_mmix_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h \ - dwarf2dbg.h -DEP_mn10200_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10200.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_mn10200_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h \ - dwarf2dbg.h -DEP_mn10300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10300.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_mn10300_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h \ - dwarf2dbg.h -DEP_msp430_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-msp430.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_msp430_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h \ - dwarf2dbg.h +DEP_mips_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h +DEP_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_mn10200_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_mn10300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_mt_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mt.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_ns32k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ns32k.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_ns32k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ns32k.h \ - dwarf2dbg.h -DEP_openrisc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-openrisc.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_openrisc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ - dwarf2dbg.h +DEP_openrisc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ + dwarf2dbg.h $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_or32_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-or32.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/or32.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_or32_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h +DEP_or32_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h DEP_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_pdp11_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-pdp11.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_pdp11_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h \ - dwarf2dbg.h -DEP_pj_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-pj.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_pj_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h \ - dwarf2dbg.h +DEP_pdp11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_pj_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_ppc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h \ - dwarf2dbg.h -DEP_s390_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-s390.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h -DEP_s390_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h \ - dwarf2dbg.h +DEP_ppc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h +DEP_s390_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_score_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-score.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_sh_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h -DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(BFDDIR)/elf32-sh64.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_sh_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h +DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/elf32-sh64.h DEP_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_sparc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h +DEP_spu_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-spu.h $(INCDIR)/opcode/spu.h \ + $(INCDIR)/opcode/spu-insns.h dwarf2dbg.h $(srcdir)/config/obj-coff.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h DEP_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_tic30_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_tic4x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic4x.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h \ - $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_tic4x_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic4x.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h \ - $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_tic54x_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic54x.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h \ + $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h $(srcdir)/config/obj-coff.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h DEP_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_vax_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-vax.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_vax_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h \ - dwarf2dbg.h -DEP_v850_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-v850.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/symcat.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_v850_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h -DEP_xstormy16_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-xstormy16.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_xstormy16_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ - dwarf2dbg.h -DEP_xc16x_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h -DEP_xtensa_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h \ - $(INCDIR)/xtensa-isa.h $(INCDIR)/xtensa-config.h +DEP_vax_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_xc16x_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_xstormy16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ + dwarf2dbg.h $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_xtensa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h $(INCDIR)/xtensa-isa.h \ + $(INCDIR)/xtensa-config.h DEP_z80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z80.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_z80_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z80.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_z8k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z8k.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_hppa_som = $(BFDDIR)/som.h DEP_i386_multi = $(DEP_i386_aout) $(DEP_i386_coff) \ $(DEP_i386_elf) @@ -2413,66 +2128,52 @@ DEP_mips_multi = $(DEP_mips_coff) $(DEP_mips_ecoff) \ DEP_cris_multi = $(DEP_cris_aout) $(DEP_cris_elf) BMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING ABOVE. #MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW. -app.o: app.c $(INCDIR)/symcat.h -as.o: as.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ - output-file.h sb.h macro.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(BFDVER_H) -atof-generic.o: atof-generic.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h -cond.o: cond.c $(INCDIR)/symcat.h macro.h sb.h $(INCDIR)/obstack.h -depend.o: depend.c $(INCDIR)/symcat.h -dwarf2dbg.o: dwarf2dbg.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - dwarf2dbg.h $(INCDIR)/filenames.h subsegs.h $(INCDIR)/obstack.h \ +app.o: app.c +as.o: as.c subsegs.h $(INCDIR)/obstack.h output-file.h \ + sb.h macro.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + ../bfd/bfdver.h +atof-generic.o: atof-generic.c $(INCDIR)/safe-ctype.h +cond.o: cond.c sb.h macro.h $(INCDIR)/obstack.h +depend.o: depend.c +dwarf2dbg.o: dwarf2dbg.c $(INCDIR)/safe-ctype.h dwarf2dbg.h \ + $(INCDIR)/filenames.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/elf/dwarf2.h -dw2gencfi.o: dw2gencfi.c $(INCDIR)/symcat.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h -ecoff.o: ecoff.c $(INCDIR)/symcat.h ecoff.h -ehopt.o: ehopt.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/elf/dwarf2.h -expr.o: expr.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/obstack.h -flonum-copy.o: flonum-copy.c $(INCDIR)/symcat.h +dw2gencfi.o: dw2gencfi.c dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + subsegs.h $(INCDIR)/obstack.h +ecoff.o: ecoff.c ecoff.h +ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h +expr.o: expr.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h +flonum-copy.o: flonum-copy.c flonum-konst.o: flonum-konst.c flonum-mult.o: flonum-mult.c -frags.o: frags.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h -hash.o: hash.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/obstack.h -input-file.o: input-file.c $(INCDIR)/symcat.h input-file.h \ - $(INCDIR)/safe-ctype.h -input-scrub.o: input-scrub.c $(INCDIR)/symcat.h input-file.h \ - sb.h -listing.o: listing.c $(INCDIR)/symcat.h $(INCDIR)/obstack.h \ - $(INCDIR)/safe-ctype.h input-file.h subsegs.h -literal.o: literal.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h -macro.o: macro.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - sb.h macro.h -messages.o: messages.c $(INCDIR)/symcat.h -output-file.o: output-file.c $(INCDIR)/symcat.h output-file.h -read.o: read.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h sb.h macro.h ecoff.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h -sb.o: sb.c sb.h $(INCDIR)/symcat.h -stabs.o: stabs.c $(INCDIR)/symcat.h $(INCDIR)/obstack.h \ - subsegs.h ecoff.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def -subsegs.o: subsegs.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h -symbols.o: symbols.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/obstack.h subsegs.h struc-symbol.h -write.o: write.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ - output-file.h dwarf2dbg.h -itbl-ops.o: itbl-ops.c itbl-ops.h $(INCDIR)/symcat.h -e-crisaout.o: $(srcdir)/config/e-crisaout.c $(INCDIR)/symcat.h \ - emul-target.h -e-criself.o: $(srcdir)/config/e-criself.c $(INCDIR)/symcat.h \ - emul-target.h -e-i386aout.o: $(srcdir)/config/e-i386aout.c $(INCDIR)/symcat.h \ - emul-target.h -e-i386coff.o: $(srcdir)/config/e-i386coff.c $(INCDIR)/symcat.h \ - emul-target.h -e-i386elf.o: $(srcdir)/config/e-i386elf.c $(INCDIR)/symcat.h \ - emul-target.h -e-mipsecoff.o: $(srcdir)/config/e-mipsecoff.c $(INCDIR)/symcat.h \ - emul-target.h -e-mipself.o: $(srcdir)/config/e-mipself.c $(INCDIR)/symcat.h \ - emul-target.h +frags.o: frags.c subsegs.h $(INCDIR)/obstack.h +hash.o: hash.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h +input-file.o: input-file.c input-file.h $(INCDIR)/safe-ctype.h +input-scrub.o: input-scrub.c input-file.h sb.h +listing.o: listing.c $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ + input-file.h subsegs.h +literal.o: literal.c subsegs.h $(INCDIR)/obstack.h +macro.o: macro.c $(INCDIR)/safe-ctype.h sb.h macro.h +messages.o: messages.c +output-file.o: output-file.c output-file.h +read.o: read.c $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + sb.h macro.h ecoff.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h +sb.o: sb.c sb.h +stabs.o: stabs.c $(INCDIR)/obstack.h subsegs.h ecoff.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def +subsegs.o: subsegs.c subsegs.h $(INCDIR)/obstack.h +symbols.o: symbols.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ + subsegs.h struc-symbol.h +write.o: write.c subsegs.h $(INCDIR)/obstack.h output-file.h \ + dwarf2dbg.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h +itbl-ops.o: itbl-ops.c itbl-ops.h +e-crisaout.o: $(srcdir)/config/e-crisaout.c emul-target.h +e-criself.o: $(srcdir)/config/e-criself.c emul-target.h +e-i386aout.o: $(srcdir)/config/e-i386aout.c emul-target.h +e-i386coff.o: $(srcdir)/config/e-i386coff.c emul-target.h +e-i386elf.o: $(srcdir)/config/e-i386elf.c emul-target.h +e-mipsecoff.o: $(srcdir)/config/e-mipsecoff.c emul-target.h +e-mipself.o: $(srcdir)/config/e-mipself.c emul-target.h $(OBJS): $(DEP_@target_cpu_type@_@obj_format@) $(TARG_CPU_O): $(DEPTC_@target_cpu_type@_@obj_format@) $(OBJ_FORMAT_O): $(DEPOBJ_@target_cpu_type@_@obj_format@) diff --git a/gas/Makefile.in b/gas/Makefile.in index 4cc485f9683..6a43ccaeb48 100644 --- a/gas/Makefile.in +++ b/gas/Makefile.in @@ -51,9 +51,16 @@ DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub NEWS \ $(srcdir)/../config.sub subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/../gettext.m4 $(top_srcdir)/configure.in +am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \ + $(top_srcdir)/../bfd/warning.m4 \ + $(top_srcdir)/../config/depstand.m4 \ + $(top_srcdir)/../config/gettext-sister.m4 \ + $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/nls.m4 $(top_srcdir)/../config/po.m4 \ + $(top_srcdir)/../config/progtest.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -78,7 +85,7 @@ am__DEPENDENCIES_1 = tc-@target_cpu_type@.o am__DEPENDENCIES_2 = obj-@obj_format@.o am__DEPENDENCIES_3 = atof-@atof@.o am__DEPENDENCIES_4 = -am__DEPENDENCIES_5 = ../libiberty/libiberty.a +am__DEPENDENCIES_5 = ../bfd/libbfd.la ../libiberty/libiberty.a am_itbl_test_OBJECTS = itbl-parse.$(OBJEXT) itbl-lex.$(OBJEXT) itbl_test_OBJECTS = $(am_itbl_test_OBJECTS) itbl_test_DEPENDENCIES = itbl-tops.o itbl-test.o $(am__DEPENDENCIES_5) @@ -88,11 +95,11 @@ depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) LTLEXCOMPILE = $(LIBTOOL) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS) @@ -114,16 +121,14 @@ DEJATOOL = $(PACKAGE) RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ -ALL_OBJ_DEPS = @ALL_OBJ_DEPS@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ -BFDLIB = @BFDLIB@ -BFDVER_H = @BFDVER_H@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ @@ -135,29 +140,32 @@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +FGREP = @FGREP@ GDBINIT = @GDBINIT@ -GMOFILES = @GMOFILES@ +GENCAT = @GENCAT@ +GENINSRC_NEVER_FALSE = @GENINSRC_NEVER_FALSE@ +GENINSRC_NEVER_TRUE = @GENINSRC_NEVER_TRUE@ GMSGFMT = @GMSGFMT@ -GT_NO = @GT_NO@ -GT_YES = @GT_YES@ -INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +GREP = @GREP@ +INCINTL = @INCINTL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ -INTLDEPS = @INTLDEPS@ -INTLLIBS = @INTLLIBS@ -INTLOBJS = @INTLOBJS@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo @LEX@ ; fi` LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBINTL = @LIBINTL@ +LIBINTL_DEP = @LIBINTL_DEP@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ @@ -170,6 +178,8 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ NO_WERROR = @NO_WERROR@ OBJEXT = @OBJEXT@ OPCODES_LIB = @OPCODES_LIB@ @@ -180,19 +190,20 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ -USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ XGETTEXT = @XGETTEXT@ YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo @YACC@ ; fi` +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ @@ -225,10 +236,10 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ install_tooldir = @install_tooldir@ -l = @l@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ obj_format = @obj_format@ @@ -246,11 +257,16 @@ target_os = @target_os@ target_vendor = @target_vendor@ te_file = @te_file@ AUTOMAKE_OPTIONS = 1.8 cygnus dejagnu +ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd SUBDIRS = doc po # Automake should figure this out on its own. It doesn't, because # of the "cygnus" option. But distclean still wants it. DIST_SUBDIRS = $(SUBDIRS) tooldir = $(exec_prefix)/$(target_alias) + +# We have to set this, because autoconf 2.59 does not substitute YFLAGS. +# Autoconf 2.61 does, so this can be removed when we upgrade. +YFLAGS = AM_CFLAGS = $(WARN_CFLAGS) MKDEP = gcc -MM TARG_CPU = @target_cpu_type@ @@ -265,7 +281,7 @@ ATOF_TARG_C = $(srcdir)/config/atof-@atof@.c ATOF_TARG_O = atof-@atof@.o # use @target_cpu_type@ for refering to configured target name -IT_HDRS = itbl-parse.h $(srcdir)/itbl-ops.h +IT_HDRS = itbl-parse.h $(srcdir)/itbl-ops.h IT_SRCS = itbl-parse.c itbl-lex.c $(srcdir)/itbl-ops.c IT_DEPS = $(srcdir)/itbl-parse.y $(srcdir)/itbl-lex.l $(srcdir)/config/itbl-@target_cpu_type@.h IT_OBJS = itbl-parse.o itbl-lex.o itbl-ops.o @@ -277,6 +293,7 @@ CPU_TYPES = \ arm \ avr \ bfin \ + cr16 \ cris \ crx \ d10v \ @@ -286,22 +303,25 @@ CPU_TYPES = \ frv \ h8300 \ hppa \ - ia64 \ i370 \ i386 \ i860 \ i960 \ + ia64 \ ip2k \ m32c \ m32r \ m68hc11 \ m68k \ + maxq \ mcore \ + mep \ mips \ mmix \ mn10200 \ mn10300 \ msp430 \ + mt \ ns32k \ openrisc \ or32 \ @@ -309,16 +329,18 @@ CPU_TYPES = \ pj \ ppc \ s390 \ + score \ sh \ sh64 \ sparc \ + spu \ tic30 \ tic4x \ tic54x \ - vax \ v850 \ - xstormy16 \ + vax \ xc16x \ + xstormy16 \ xtensa \ z80 \ z8k @@ -331,8 +353,7 @@ OBJ_FORMATS = \ coff \ ecoff \ elf \ - evax \ - ieee + evax # This is an sh case which sets valid according to whether the CPU @@ -347,16 +368,20 @@ CPU_OBJ_VALID = \ arm | cris | i386 | m68k | ns32k | pdp11 | sparc | tic30 | vax) \ valid=yes ;; \ esac ;; \ - coff) valid=yes; \ + coff) \ case $$c in \ - cris | i860 | mmix | sh64) \ - valid= ;; \ + arm | h8300 | i386 | i960 | m68k | maxq | mcore | mips | or32 \ + | ppc | sh | sparc | tic* | xscale | z80 | z8k) \ + valid=yes ;; \ esac ;; \ ecoff) \ case $$c in \ mips | alpha) valid=yes ;; \ esac ;; \ - elf) valid=yes ;; \ + elf) valid=yes ; \ + case $$c in \ + maxq | ns32k | tic* | z80 | z8k) valid= ;; \ + esac ;; \ evax) \ case $$c in \ alpha) valid=yes ;; \ @@ -459,6 +484,7 @@ TARGET_CPU_CFILES = \ config/tc-arm.c \ config/tc-avr.c \ config/tc-bfin.c \ + config/tc-cr16.c \ config/tc-cris.c \ config/tc-crx.c \ config/tc-d10v.c \ @@ -479,6 +505,7 @@ TARGET_CPU_CFILES = \ config/tc-m68hc11.c \ config/tc-m68k.c \ config/tc-mcore.c \ + config/tc-mep.c \ config/tc-mips.c \ config/tc-mmix.c \ config/tc-mn10200.c \ @@ -491,9 +518,11 @@ TARGET_CPU_CFILES = \ config/tc-pj.c \ config/tc-ppc.c \ config/tc-s390.c \ + config/tc-score.c \ config/tc-sh.c \ config/tc-sh64.c \ config/tc-sparc.c \ + config/tc-spu.c \ config/tc-tic30.c \ config/tc-tic54x.c \ config/tc-vax.c \ @@ -510,6 +539,7 @@ TARGET_CPU_HFILES = \ config/tc-arm.h \ config/tc-avr.h \ config/tc-bfin.h \ + config/tc-cr16.h \ config/tc-cris.h \ config/tc-crx.h \ config/tc-d10v.h \ @@ -530,6 +560,7 @@ TARGET_CPU_HFILES = \ config/tc-m68hc11.h \ config/tc-m68k.h \ config/tc-mcore.h \ + config/tc-mep.h \ config/tc-mips.h \ config/tc-mmix.h \ config/tc-mn10200.h \ @@ -542,9 +573,11 @@ TARGET_CPU_HFILES = \ config/tc-pj.h \ config/tc-ppc.h \ config/tc-s390.h \ + config/tc-score.h \ config/tc-sh.h \ config/tc-sh64.h \ config/tc-sparc.h \ + config/tc-spu.h \ config/tc-tic30.h \ config/tc-tic54x.h \ config/tc-vax.h \ @@ -563,7 +596,6 @@ OBJ_FORMAT_CFILES = \ config/obj-ecoff.c \ config/obj-elf.c \ config/obj-evax.c \ - config/obj-ieee.c \ config/obj-som.c OBJ_FORMAT_HFILES = \ @@ -572,7 +604,6 @@ OBJ_FORMAT_HFILES = \ config/obj-ecoff.h \ config/obj-elf.h \ config/obj-evax.h \ - config/obj-ieee.h \ config/obj-som.h @@ -610,7 +641,8 @@ TARG_ENV_HFILES = \ config/te-sun3.h \ config/te-svr4.h \ config/te-symbian.h \ - config/te-tmips.h + config/te-tmips.h \ + config/te-wince-pe.h # Multi files in config @@ -681,29 +713,36 @@ INCDIR = $(BASEDIR)/include # Both . and srcdir are used, in that order, # so that tm.h and config.h will be found in the compilation # subdirectory rather than in the source directory. -INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR) -I$(srcdir)/../intl -I../intl -DLOCALEDIR="\"$(datadir)/locale\"" +INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(srcdir)/config \ + -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR) @INCINTL@ \ + -DLOCALEDIR="\"$(datadir)/locale\"" + # This should be parallel to INCLUDES, but should replace $(srcdir) # with $${srcdir}, and should work in a subdirectory. This is used # when building dependencies, because the dependency building is done # in a subdirectory. -DEP_INCLUDES = -D_GNU_SOURCE -I.. -I$${srcdir} -I../../bfd -I$${srcdir}/config -I$${srcdir}/../include -I$${srcdir}/.. -I$${srcdir}/../bfd -I$${srcdir}/../intl -I../../intl -DLOCALEDIR="\"$(datadir)/locale\"" +DEP_INCLUDES = -D_GNU_SOURCE -I.. -I$${srcdir} -I../../bfd \ + -I$${srcdir}/config -I$${srcdir}/../include -I$${srcdir}/.. \ + -I$${srcdir}/../bfd @INCINTL@ \ + -DLOCALEDIR="\"$(datadir)/locale\"" + DEP_FLAGS = -DOBJ_MAYBE_ELF \ -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) # How to link with both our special library facilities # and the system's installed libraries. -GASLIBS = @OPCODES_LIB@ @BFDLIB@ ../libiberty/libiberty.a +GASLIBS = @OPCODES_LIB@ ../bfd/libbfd.la ../libiberty/libiberty.a # Files to be copied away after each stage in building. STAGESTUFF = *.o $(noinst_PROGRAMS) as_new_SOURCES = $(GAS_CFILES) as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \ - $(extra_objects) $(GASLIBS) $(INTLLIBS) $(LIBM) + $(extra_objects) $(GASLIBS) $(LIBINTL) $(LIBM) as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \ - $(extra_objects) $(GASLIBS) $(INTLDEPS) + $(extra_objects) $(GASLIBS) $(LIBINTL_DEP) EXPECT = expect RUNTEST = runtest @@ -729,687 +768,520 @@ DEP_FILE_DEPS = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \ CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in $(srcdir)/configure.tgt AMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW. -DEPTC_alpha_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-alpha.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h ecoff.h $(INCDIR)/opcode/alpha.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c - -DEPTC_alpha_ecoff = $(INCDIR)/symcat.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-alpha.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/opcode/alpha.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c - -DEPTC_alpha_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h \ +DEPTC_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ subsegs.h $(INCDIR)/obstack.h struc-symbol.h ecoff.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h $(INCDIR)/opcode/alpha.h \ - $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ - dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h \ - $(srcdir)/config/atof-vax.c + $(INCDIR)/opcode/alpha.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c -DEPTC_alpha_evax = $(INCDIR)/symcat.h $(srcdir)/config/obj-evax.h \ - $(srcdir)/config/tc-alpha.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h ecoff.h $(INCDIR)/opcode/alpha.h dw2gencfi.h \ +DEPTC_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h subsegs.h \ + $(INCDIR)/obstack.h struc-symbol.h ecoff.h $(INCDIR)/coff/sym.h \ + $(INCDIR)/coff/ecoff.h $(INCDIR)/opcode/alpha.h $(INCDIR)/elf/alpha.h \ + $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h dw2gencfi.h \ $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c -DEPTC_arc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h struc-symbol.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ +DEPTC_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h \ + subsegs.h $(INCDIR)/obstack.h struc-symbol.h ecoff.h \ + $(INCDIR)/opcode/alpha.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c + +DEPTC_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h dwarf2dbg.h \ + struc-symbol.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/arc.h $(srcdir)/../opcodes/arc-ext.h \ $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h -DEPTC_arc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h \ - dwarf2dbg.h struc-symbol.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/arc.h $(srcdir)/../opcodes/arc-ext.h \ - $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h +DEPTC_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h \ + dwarf2dbg.h -DEPTC_arm_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-arm.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/arm.h - -DEPTC_arm_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arm.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h - -DEPTC_arm_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/arm.h $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \ - dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h - -DEPTC_avr_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-avr.h $(INCDIR)/coff/internal.h \ +DEPTC_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/avr.h + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h \ + dwarf2dbg.h -DEPTC_avr_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ +DEPTC_arm_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h \ + $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h dwarf2dbg.h + +DEPTC_avr_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/avr.h -DEPTC_bfin_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-bfin.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h struc-symbol.h \ - $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h dwarf2dbg.h \ - $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ - $(srcdir)/config/bfin-aux.h $(INCDIR)/opcode/bfin.h \ - $(srcdir)/config/bfin-defs.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h +DEPTC_bfin_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h dwarf2dbg.h \ + struc-symbol.h $(srcdir)/config/bfin-defs.h $(INCDIR)/obstack.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h $(BFDDIR)/libbfd.h \ + $(INCDIR)/hashtab.h $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h \ + $(INCDIR)/elf/reloc-macros.h $(srcdir)/config/bfin-aux.h \ + $(srcdir)/config/bfin-defs.h $(INCDIR)/opcode/bfin.h -DEPTC_bfin_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h \ - dwarf2dbg.h struc-symbol.h $(srcdir)/config/bfin-defs.h \ - $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h $(srcdir)/config/bfin-aux.h \ - $(INCDIR)/opcode/bfin.h $(srcdir)/config/bfin-defs.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h +DEPTC_cr16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cr16.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h $(INCDIR)/opcode/cr16.h \ + $(INCDIR)/elf/cr16.h $(INCDIR)/elf/reloc-macros.h -DEPTC_cris_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-cris.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ +DEPTC_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/cris.h \ + dwarf2dbg.h + +DEPTC_cris_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h dwarf2dbg.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/cris.h dwarf2dbg.h -DEPTC_cris_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/cris.h - -DEPTC_crx_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-crx.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - dwarf2dbg.h $(INCDIR)/opcode/crx.h $(INCDIR)/elf/crx.h \ - $(INCDIR)/elf/reloc-macros.h - -DEPTC_crx_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/crx.h \ +DEPTC_crx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h $(INCDIR)/opcode/crx.h \ $(INCDIR)/elf/crx.h $(INCDIR)/elf/reloc-macros.h -DEPTC_d10v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d10v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ +DEPTC_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/d10v.h \ $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h -DEPTC_d10v_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/d10v.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_d30v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d30v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ +DEPTC_d30v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/d30v.h -DEPTC_d30v_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ +DEPTC_dlx_elf = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h \ + dwarf2dbg.h $(srcdir)/config/tc-dlx.h $(INCDIR)/opcode/dlx.h + +DEPTC_fr30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h dwarf2dbg.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/d30v.h - -DEPTC_dlx_coff = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-dlx.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/opcode/dlx.h - -DEPTC_dlx_elf = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(srcdir)/config/tc-dlx.h dwarf2dbg.h $(INCDIR)/opcode/dlx.h - -DEPTC_fr30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-fr30.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/fr30-desc.h \ - $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ + $(srcdir)/../opcodes/fr30-desc.h $(INCDIR)/opcode/cgen-bitset.h \ + $(INCDIR)/opcode/cgen.h $(INCDIR)/opcode/cgen-bitset.h \ $(srcdir)/../opcodes/fr30-opc.h cgen.h -DEPTC_fr30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/fr30-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/fr30-opc.h \ - cgen.h - -DEPTC_frv_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-frv.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/frv-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/frv-opc.h \ +DEPTC_frv_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h subsegs.h \ + $(INCDIR)/obstack.h $(srcdir)/../opcodes/frv-desc.h \ + $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/frv-opc.h \ cgen.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/frv.h $(INCDIR)/elf/reloc-macros.h -DEPTC_frv_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/frv-desc.h \ - $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/frv-opc.h cgen.h $(BFDDIR)/libbfd.h \ - $(INCDIR)/hashtab.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/reloc-macros.h +DEPTC_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + dwarf2dbg.h $(INCDIR)/opcode/h8300.h $(INCDIR)/safe-ctype.h -DEPTC_h8300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \ - $(INCDIR)/opcode/h8300.h $(INCDIR)/safe-ctype.h - -DEPTC_h8300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h \ +DEPTC_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(INCDIR)/opcode/h8300.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h -DEPTC_hppa_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-hppa.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h - -DEPTC_hppa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h \ - $(BFDDIR)/elf32-hppa.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ +DEPTC_hppa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h $(BFDDIR)/elf32-hppa.h \ + $(BFDDIR)/elf-bfd.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/hppa.h \ - dwarf2dbg.h + subsegs.h $(INCDIR)/obstack.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h dwarf2dbg.h -DEPTC_ia64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ - $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h - -DEPTC_ia64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h \ - $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/safe-ctype.h dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h - -DEPTC_i370_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i370.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/i370.h - -DEPTC_i370_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ +DEPTC_i370_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ struc-symbol.h $(INCDIR)/opcode/i370.h $(INCDIR)/elf/i370.h \ $(INCDIR)/elf/reloc-macros.h -DEPTC_i386_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-i386.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ +DEPTC_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h + +DEPTC_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h + +DEPTC_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \ + $(INCDIR)/opcode/i386.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h + +DEPTC_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h dwarf2dbg.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/i386.h \ - $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_i386_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i386.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ - $(INCDIR)/opcode/i386.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_i386_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/i386.h \ - $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_i860_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/i860.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h -DEPTC_i960_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i960.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h - -DEPTC_i960_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ +DEPTC_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/i960.h -DEPTC_ip2k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ip2k.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/ip2k-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/ip2k-opc.h \ +DEPTC_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h + +DEPTC_ia64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ + $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ + dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/ia64.h \ + $(INCDIR)/elf/ia64.h + +DEPTC_ip2k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/ip2k-desc.h \ + $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/ip2k-opc.h \ cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/ip2k.h \ $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h -DEPTC_ip2k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/ip2k-desc.h \ +DEPTC_m32c_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/m32c-desc.h \ $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/ip2k-opc.h cgen.h $(INCDIR)/elf/ip2k.h \ - $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/m32c-opc.h \ + $(srcdir)/../opcodes/cgen-types.h ../bfd/bfd_stdint.h \ + $(srcdir)/../opcodes/cgen-ops.h cgen.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/m32c.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h \ + $(INCDIR)/hashtab.h $(INCDIR)/safe-ctype.h -DEPTC_m32c_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m32c.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/m32c-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/m32c-opc.h \ - $(srcdir)/../opcodes/cgen-types.h $(srcdir)/../opcodes/cgen-ops.h \ - cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/m32c.h \ - $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h \ - $(INCDIR)/safe-ctype.h - -DEPTC_m32c_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/m32c-desc.h \ - $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/m32c-opc.h $(srcdir)/../opcodes/cgen-types.h \ - $(srcdir)/../opcodes/cgen-ops.h cgen.h $(INCDIR)/elf/m32c.h \ - $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h \ - $(INCDIR)/safe-ctype.h - -DEPTC_m32r_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m32r.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/m32r-desc.h \ - $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ +DEPTC_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/m32r-desc.h $(INCDIR)/opcode/cgen-bitset.h \ + $(INCDIR)/opcode/cgen.h $(INCDIR)/opcode/cgen-bitset.h \ $(srcdir)/../opcodes/m32r-opc.h cgen.h $(INCDIR)/elf/m32r.h \ $(INCDIR)/elf/reloc-macros.h -DEPTC_m32r_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/m32r-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/m32r-opc.h \ - cgen.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_m68hc11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m68hc11.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h \ - $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_m68hc11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/m68hc11.h $(INCDIR)/elf/m68hc11.h \ +DEPTC_m68hc11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h $(INCDIR)/elf/m68hc11.h \ $(INCDIR)/elf/reloc-macros.h -DEPTC_m68k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h subsegs.h \ - dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ +DEPTC_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ $(srcdir)/config/m68k-parse.h -DEPTC_m68k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m68k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ - subsegs.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ - $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h +DEPTC_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ + $(srcdir)/config/m68k-parse.h -DEPTC_m68k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h subsegs.h \ - dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ +DEPTC_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ $(srcdir)/config/m68k-parse.h $(INCDIR)/elf/m68k.h \ $(INCDIR)/elf/reloc-macros.h -DEPTC_mcore_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h \ - $(INCDIR)/safe-ctype.h +DEPTC_maxq_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-maxq.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/maxq.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(srcdir)/config/tc-maxq.h \ + $(INCDIR)/opcode/maxq.h -DEPTC_mcore_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h \ +DEPTC_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/mcore-opc.h $(INCDIR)/safe-ctype.h + +DEPTC_mcore_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/elf/mcore.h $(INCDIR)/elf/reloc-macros.h -DEPTC_mips_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mips.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/opcode/mips.h itbl-ops.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ +DEPTC_mep_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h ecoff.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mep.h dwarf2dbg.h \ + dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mep-desc.h \ + $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/mep-opc.h \ + cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/mep.h $(INCDIR)/elf/reloc-macros.h \ + $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h $(INCDIR)/xregex.h \ + $(INCDIR)/xregex2.h -DEPTC_mips_ecoff = $(INCDIR)/symcat.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-mips.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h subsegs.h $(INCDIR)/obstack.h \ +DEPTC_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/mips.h itbl-ops.h \ dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mips.h \ - $(INCDIR)/elf/reloc-macros.h - -DEPTC_mips_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/opcode/mips.h itbl-ops.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h -DEPTC_mmix_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/mmix.h \ +DEPTC_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/mips.h itbl-ops.h dwarf2dbg.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ + ecoff.h + +DEPTC_mips_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/mips.h \ + itbl-ops.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(srcdir)/config/obj-elf.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h + +DEPTC_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/mmix.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/mmix.h \ - $(INCDIR)/safe-ctype.h + $(INCDIR)/safe-ctype.h dwarf2dbg.h $(INCDIR)/obstack.h -DEPTC_mn10200_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10200.h - -DEPTC_mn10200_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ +DEPTC_mn10200_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/mn10200.h -DEPTC_mn10300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10300.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10300.h \ - dwarf2dbg.h +DEPTC_mn10300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/mn10300.h dwarf2dbg.h -DEPTC_mn10300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/mn10300.h +DEPTC_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/msp430.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h -DEPTC_msp430_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-msp430.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/msp430.h $(INCDIR)/safe-ctype.h dwarf2dbg.h +DEPTC_mt_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mt.h dwarf2dbg.h \ + dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mt-desc.h \ + $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/mt-opc.h \ + cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/mt.h $(INCDIR)/elf/reloc-macros.h \ + $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h -DEPTC_msp430_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/msp430.h \ - $(INCDIR)/safe-ctype.h - -DEPTC_ns32k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/opcode/ns32k.h $(INCDIR)/obstack.h - -DEPTC_ns32k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ns32k.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ns32k.h \ +DEPTC_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ns32k.h \ $(INCDIR)/obstack.h -DEPTC_ns32k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ns32k.h \ - dwarf2dbg.h $(INCDIR)/opcode/ns32k.h $(INCDIR)/obstack.h - -DEPTC_openrisc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-openrisc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/openrisc-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/openrisc-opc.h \ - cgen.h - -DEPTC_openrisc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ +DEPTC_openrisc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/openrisc-desc.h \ $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/openrisc-opc.h cgen.h - -DEPTC_or32_coff = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-or32.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/opcode/or32.h $(INCDIR)/elf/or32.h \ - $(INCDIR)/elf/reloc-macros.h - -DEPTC_or32_elf = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(srcdir)/config/tc-or32.h dwarf2dbg.h $(INCDIR)/opcode/or32.h \ - $(INCDIR)/elf/or32.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_pdp11_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-pdp11.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pdp11.h - -DEPTC_pdp11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-pdp11.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/opcode/pdp11.h - -DEPTC_pdp11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pdp11.h - -DEPTC_pj_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-pj.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/opcode/pj.h - -DEPTC_pj_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pj.h - -DEPTC_ppc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ppc.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/ppc.h - -DEPTC_ppc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/ppc.h \ - $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_s390_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-s390.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/s390.h \ - $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_s390_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/s390.h \ - $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_sh_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \ - $(INCDIR)/safe-ctype.h struc-symbol.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h - -DEPTC_sh_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \ - $(INCDIR)/safe-ctype.h struc-symbol.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h - -DEPTC_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(BFDDIR)/elf32-sh64.h $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/sh64-opc.h \ - $(srcdir)/config/tc-sh.c subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/sh-opc.h struc-symbol.h dwarf2dbg.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h - -DEPTC_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/sparc.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h - -DEPTC_sparc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sparc.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h - -DEPTC_sparc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/sparc.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ - $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_tic30_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h - -DEPTC_tic30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic30.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h - -DEPTC_tic30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h - -DEPTC_tic4x_coff = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic4x.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/tic4x.h \ - subsegs.h $(INCDIR)/obstack.h - -DEPTC_tic4x_elf = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(srcdir)/config/tc-tic4x.h dwarf2dbg.h $(INCDIR)/opcode/tic4x.h \ - subsegs.h $(INCDIR)/obstack.h - -DEPTC_tic54x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic54x.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h sb.h macro.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/tic54x.h - -DEPTC_tic54x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic54x.h \ - $(INCDIR)/safe-ctype.h sb.h macro.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/opcode/tic54x.h $(srcdir)/config/obj-coff.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ - $(BFDDIR)/libcoff.h - -DEPTC_vax_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-vax.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h subsegs.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/vax.h - -DEPTC_vax_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-vax.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(srcdir)/config/vax-inst.h \ - $(INCDIR)/obstack.h subsegs.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/opcode/vax.h - -DEPTC_vax_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h \ - dwarf2dbg.h $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h \ - subsegs.h $(INCDIR)/safe-ctype.h $(INCDIR)/elf/vax.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/vax.h - -DEPTC_v850_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/v850.h dwarf2dbg.h - -DEPTC_v850_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/v850.h - -DEPTC_xstormy16_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-xstormy16.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/xstormy16-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/xstormy16-opc.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/openrisc-opc.h \ cgen.h -DEPTC_xstormy16_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ +DEPTC_or32_coff = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-or32.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/opcode/or32.h $(INCDIR)/elf/or32.h $(INCDIR)/elf/reloc-macros.h + +DEPTC_or32_elf = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h \ + dwarf2dbg.h $(INCDIR)/opcode/or32.h $(INCDIR)/elf/or32.h \ + $(INCDIR)/elf/reloc-macros.h + +DEPTC_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/pdp11.h + +DEPTC_pdp11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pdp11.h + +DEPTC_pj_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pj.h + +DEPTC_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ + $(INCDIR)/obstack.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/opcode/ppc.h + +DEPTC_ppc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/ppc.h \ + $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h + +DEPTC_s390_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + struc-symbol.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/opcode/s390.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h + +DEPTC_score_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-score.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/score-inst.h $(INCDIR)/opcode/score-datadep.h \ + struc-symbol.h $(INCDIR)/elf/score.h $(INCDIR)/elf/reloc-macros.h \ + dwarf2dbg.h + +DEPTC_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/sh-opc.h $(INCDIR)/safe-ctype.h \ + struc-symbol.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h + +DEPTC_sh_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h subsegs.h \ + $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h $(INCDIR)/safe-ctype.h \ + struc-symbol.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ + dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h + +DEPTC_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/elf32-sh64.h \ + $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/sh64-opc.h \ + $(srcdir)/config/tc-sh.c subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/sh-opc.h $(INCDIR)/safe-ctype.h \ + struc-symbol.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h + +DEPTC_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h + +DEPTC_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h + +DEPTC_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/sparc.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ + dwarf2dbg.h + +DEPTC_spu_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-spu.h $(INCDIR)/opcode/spu.h \ + $(INCDIR)/opcode/spu-insns.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(INCDIR)/opcode/spu-insns.h + +DEPTC_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/tic30.h + +DEPTC_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/tic30.h + +DEPTC_tic4x_coff = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-tic4x.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/opcode/tic4x.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/obstack.h + +DEPTC_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + sb.h macro.h subsegs.h $(INCDIR)/obstack.h struc-symbol.h \ + $(INCDIR)/opcode/tic54x.h $(srcdir)/config/obj-coff.h + +DEPTC_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h \ + $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/v850.h \ + dwarf2dbg.h + +DEPTC_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(srcdir)/config/vax-inst.h \ + $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/vax.h + +DEPTC_vax_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h dwarf2dbg.h \ + $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h $(INCDIR)/elf/vax.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/vax.h + +DEPTC_xc16x_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/xc16x-desc.h $(INCDIR)/opcode/cgen-bitset.h \ + $(INCDIR)/opcode/cgen.h $(INCDIR)/opcode/cgen-bitset.h \ + $(srcdir)/../opcodes/xc16x-opc.h cgen.h dwarf2dbg.h \ + $(INCDIR)/elf/xc16x.h $(INCDIR)/elf/reloc-macros.h + +DEPTC_xstormy16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/xstormy16-desc.h \ $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/xstormy16-opc.h cgen.h + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/xstormy16-opc.h \ + cgen.h -DEPTC_xc16x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/xc16x-desc.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/xc16x-opc.h cgen.h - -DEPTC_xtensa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h \ - $(INCDIR)/xtensa-isa.h $(INCDIR)/xtensa-config.h sb.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ +DEPTC_xtensa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h $(INCDIR)/xtensa-isa.h \ + $(INCDIR)/xtensa-config.h sb.h $(INCDIR)/safe-ctype.h \ + $(srcdir)/config/tc-xtensa.h subsegs.h $(INCDIR)/obstack.h \ $(srcdir)/config/xtensa-relax.h $(srcdir)/config/xtensa-istack.h \ - dwarf2dbg.h struc-symbol.h + dwarf2dbg.h struc-symbol.h $(INCDIR)/xtensa-config.h -DEPTC_z80_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-z80.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h +DEPTC_z80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z80.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h -DEPTC_z80_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z80.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h - -DEPTC_z8k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-z8k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/z8k-opc.h - -DEPTC_z8k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z8k.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/z8k-opc.h +DEPTC_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(srcdir)/../opcodes/z8k-opc.h DEPTC_hppa_som = $(srcdir)/config/tc-hppa.h subsegs.h \ $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h \ @@ -1422,588 +1294,439 @@ DEPTC_mips_multi = $(DEPTC_mips_coff) $(DEPTC_mips_ecoff) \ $(DEPTC_mips_elf) DEPTC_cris_multi = $(DEPTC_cris_aout) $(DEPTC_cris_elf) -DEPOBJ_alpha_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-alpha.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h +DEPOBJ_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ + $(BFDDIR)/libecoff.h -DEPOBJ_alpha_ecoff = $(INCDIR)/symcat.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-alpha.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(BFDDIR)/libecoff.h - -DEPOBJ_alpha_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ +DEPOBJ_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ + $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/aout/aout64.h -DEPOBJ_alpha_evax = $(INCDIR)/symcat.h $(srcdir)/config/obj-evax.h \ - $(srcdir)/config/tc-alpha.h - -DEPOBJ_arc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_arc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_arm_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-arm.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_arm_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arm.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_arm_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h \ +DEPOBJ_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h +DEPOBJ_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h dwarf2dbg.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - -DEPOBJ_avr_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-avr.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_avr_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_bfin_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-bfin.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_bfin_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_cris_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-cris.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_cris_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_crx_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-crx.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_crx_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_d10v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d10v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_d10v_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - -DEPOBJ_d30v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d30v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_d30v_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - -DEPOBJ_dlx_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-dlx.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_dlx_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_fr30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-fr30.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_fr30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_frv_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-frv.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_frv_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - -DEPOBJ_h8300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_h8300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_hppa_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-hppa.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_hppa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h \ - $(BFDDIR)/elf32-hppa.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h \ - $(INCDIR)/aout/aout64.h - -DEPOBJ_ia64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ - $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_ia64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h \ - $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - -DEPOBJ_i370_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i370.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_i370_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/elf/i370.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/aout/aout64.h - -DEPOBJ_i386_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-i386.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_i386_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i386.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_i386_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/aout/aout64.h - -DEPOBJ_i860_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_i960_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i960.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_i960_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_ip2k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ip2k.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_ip2k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_m32c_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m32c.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_m32c_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_m32r_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m32r.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_m32r_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_m68hc11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m68hc11.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_m68hc11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_m68k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_m68k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m68k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_m68k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - -DEPOBJ_mcore_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_mcore_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_mips_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mips.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_mips_ecoff = $(INCDIR)/symcat.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-mips.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(BFDDIR)/libecoff.h - -DEPOBJ_mips_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/aout/aout64.h - -DEPOBJ_mmix_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_mn10200_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_mn10200_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_mn10300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10300.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_mn10300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_msp430_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-msp430.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_msp430_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_ns32k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_ns32k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ns32k.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_ns32k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ns32k.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_openrisc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-openrisc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_openrisc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_or32_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-or32.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_or32_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_pdp11_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-pdp11.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_pdp11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-pdp11.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_pdp11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_pj_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-pj.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_pj_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_ppc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ppc.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_ppc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/aout/aout64.h - -DEPOBJ_s390_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-s390.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_s390_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_sh_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_sh_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - -DEPOBJ_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(BFDDIR)/elf32-sh64.h $(INCDIR)/safe-ctype.h subsegs.h \ $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h +DEPOBJ_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h -DEPOBJ_sparc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sparc.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_sparc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_tic30_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_tic30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic30.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_tic30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_tic4x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic4x.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_tic4x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic4x.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_tic54x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic54x.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_tic54x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic54x.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - -DEPOBJ_vax_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-vax.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_vax_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-vax.h $(INCDIR)/coff/internal.h \ +DEPOBJ_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h + subsegs.h $(INCDIR)/obstack.h -DEPOBJ_vax_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h +DEPOBJ_arm_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_v850_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_v850_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h \ +DEPOBJ_avr_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h dwarf2dbg.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_xstormy16_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-xstormy16.h $(INCDIR)/coff/internal.h \ +DEPOBJ_bfin_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h + +DEPOBJ_cris_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_crx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_d30v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_dlx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_fr30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_frv_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h + subsegs.h $(INCDIR)/obstack.h -DEPOBJ_xstormy16_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_xc16x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h \ +DEPOBJ_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h dwarf2dbg.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_xtensa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h \ - $(INCDIR)/xtensa-isa.h $(INCDIR)/xtensa-config.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h \ +DEPOBJ_hppa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h $(BFDDIR)/elf32-hppa.h \ + $(BFDDIR)/elf-bfd.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_i370_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/i370.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h + +DEPOBJ_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h + +DEPOBJ_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \ + $(INCDIR)/opcode/i386.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/aout/aout64.h -DEPOBJ_z80_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-z80.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h +DEPOBJ_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_z80_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z80.h \ +DEPOBJ_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_ia64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ + $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_ip2k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_m32c_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_m68hc11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h + +DEPOBJ_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_maxq_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-maxq.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/maxq.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_mcore_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_mep_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mep.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/mep.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h + +DEPOBJ_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ + $(BFDDIR)/libecoff.h + +DEPOBJ_mips_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ + $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h + +DEPOBJ_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_mn10200_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_mn10300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_mt_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mt.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h + +DEPOBJ_openrisc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_z8k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-z8k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h +DEPOBJ_or32_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-or32.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h -DEPOBJ_z8k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z8k.h \ +DEPOBJ_or32_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h + +DEPOBJ_pdp11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_pj_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_ppc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/ppc.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h + +DEPOBJ_s390_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_score_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-score.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_sh_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/elf32-sh64.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h + +DEPOBJ_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_spu_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-spu.h $(INCDIR)/opcode/spu.h \ + $(INCDIR)/opcode/spu-insns.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h + +DEPOBJ_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_tic4x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic4x.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h \ + $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h + +DEPOBJ_vax_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_xc16x_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_xstormy16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_xtensa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h $(INCDIR)/xtensa-isa.h \ + $(INCDIR)/xtensa-config.h $(INCDIR)/safe-ctype.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_z80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z80.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h DEPOBJ_hppa_som = $(srcdir)/config/obj-som.h subsegs.h \ $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(BFDDIR)/som.h \ @@ -2016,458 +1739,385 @@ DEPOBJ_mips_multi = $(DEPOBJ_mips_coff) $(DEPOBJ_mips_ecoff) \ $(DEPOBJ_mips_elf) DEPOBJ_cris_multi = $(DEPOBJ_cris_aout) $(DEPOBJ_cris_elf) -DEP_alpha_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-alpha.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - DEP_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h -DEP_alpha_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h +DEP_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h DEP_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h -DEP_arc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arc.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_arc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h \ - dwarf2dbg.h +DEP_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_arm_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h +DEP_arm_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h -DEP_avr_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-avr.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_avr_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_avr_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h \ - dwarf2dbg.h +DEP_bfin_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_bfin_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-bfin.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_bfin_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h \ - dwarf2dbg.h +DEP_cr16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cr16.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_cris_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h \ - dwarf2dbg.h +DEP_cris_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_crx_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-crx.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_crx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_crx_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h \ - dwarf2dbg.h +DEP_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h -DEP_d10v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d10v.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_d30v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h -DEP_d10v_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h +DEP_dlx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_d30v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d30v.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_fr30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_d30v_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h - -DEP_dlx_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-dlx.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_dlx_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h \ - dwarf2dbg.h - -DEP_fr30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-fr30.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_fr30_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h \ - dwarf2dbg.h - -DEP_frv_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-frv.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_frv_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h +DEP_frv_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h DEP_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - -DEP_h8300_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h \ - dwarf2dbg.h - -DEP_hppa_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-hppa.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_hppa_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h \ - $(BFDDIR)/elf32-hppa.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ - $(INCDIR)/elf/reloc-macros.h - -DEP_ia64_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ia64.h \ - $(INCDIR)/opcode/ia64.h $(INCDIR)/symcat.h $(INCDIR)/elf/ia64.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_ia64_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h \ - $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h +DEP_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h -DEP_i370_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i370.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_hppa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h $(BFDDIR)/elf32-hppa.h \ + $(BFDDIR)/elf-bfd.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ + $(INCDIR)/elf/reloc-macros.h -DEP_i370_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h \ - dwarf2dbg.h +DEP_i370_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - -DEP_i386_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h \ - dwarf2dbg.h - -DEP_i860_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h \ - dwarf2dbg.h - -DEP_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_i960_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h \ - dwarf2dbg.h +DEP_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \ + $(INCDIR)/opcode/i386.h dwarf2dbg.h $(srcdir)/config/obj-coff.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h -DEP_ip2k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ip2k.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ +DEP_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h + +DEP_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h -DEP_ip2k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h \ - dwarf2dbg.h +DEP_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h -DEP_m32c_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m32c.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_ia64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ + $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h -DEP_m32c_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h \ - dwarf2dbg.h +DEP_ip2k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_m32r_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m32r.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_m32c_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_m32r_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h \ - dwarf2dbg.h +DEP_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_m68hc11_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68hc11.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - -DEP_m68hc11_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h \ - dwarf2dbg.h +DEP_m68hc11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h DEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_m68k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h +DEP_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h + +DEP_maxq_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-maxq.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/maxq.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_mcore_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h \ - dwarf2dbg.h +DEP_mcore_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h + +DEP_mep_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mep.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h -DEP_mips_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h +DEP_mips_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h -DEP_mmix_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h \ - dwarf2dbg.h +DEP_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_mn10200_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10200.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_mn10200_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_mn10200_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h \ - dwarf2dbg.h +DEP_mn10300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_mn10300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10300.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_mn10300_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h \ - dwarf2dbg.h - -DEP_msp430_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-msp430.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_msp430_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h \ - dwarf2dbg.h +DEP_mt_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mt.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_ns32k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ns32k.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_ns32k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ns32k.h \ - dwarf2dbg.h - -DEP_openrisc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-openrisc.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_openrisc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ - dwarf2dbg.h +DEP_openrisc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ + dwarf2dbg.h $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_or32_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-or32.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/or32.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h -DEP_or32_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h \ - dwarf2dbg.h +DEP_or32_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h DEP_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_pdp11_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-pdp11.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_pdp11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_pdp11_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h \ - dwarf2dbg.h - -DEP_pj_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-pj.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_pj_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h \ - dwarf2dbg.h +DEP_pj_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - -DEP_ppc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h \ - dwarf2dbg.h - -DEP_s390_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-s390.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h -DEP_s390_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h \ - dwarf2dbg.h +DEP_ppc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h + +DEP_s390_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h + +DEP_score_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-score.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_sh_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h +DEP_sh_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h -DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(BFDDIR)/elf32-sh64.h +DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/elf32-sh64.h DEP_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_sparc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h \ - dwarf2dbg.h +DEP_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h + +DEP_spu_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-spu.h $(INCDIR)/opcode/spu.h \ + $(INCDIR)/opcode/spu-insns.h dwarf2dbg.h $(srcdir)/config/obj-coff.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h DEP_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - -DEP_tic30_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_tic4x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic4x.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h \ - $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - -DEP_tic4x_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic4x.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h \ - $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_tic54x_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic54x.h +DEP_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h \ + $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h $(srcdir)/config/obj-coff.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h DEP_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_vax_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-vax.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_vax_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_vax_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h \ - dwarf2dbg.h +DEP_xc16x_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_v850_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-v850.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/symcat.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_xstormy16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ + dwarf2dbg.h $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_v850_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h - -DEP_xstormy16_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-xstormy16.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_xstormy16_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ - dwarf2dbg.h - -DEP_xc16x_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h - -DEP_xtensa_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h \ - $(INCDIR)/xtensa-isa.h $(INCDIR)/xtensa-config.h +DEP_xtensa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h $(INCDIR)/xtensa-isa.h \ + $(INCDIR)/xtensa-config.h DEP_z80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z80.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - -DEP_z80_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z80.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - -DEP_z8k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z8k.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_hppa_som = $(BFDDIR)/som.h DEP_i386_multi = $(DEP_i386_aout) $(DEP_i386_coff) \ @@ -2489,15 +2139,15 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ - cd $(srcdir) && $(AUTOMAKE) --foreign \ + echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus '; \ + cd $(srcdir) && $(AUTOMAKE) --cygnus \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile + $(AUTOMAKE) --cygnus Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -2856,12 +2506,11 @@ po/POTFILES.in: @MAINT@ Makefile diststuff: $(EXTRA_DIST) info all: info -$(OBJS): @ALL_OBJ_DEPS@ - # Stuff that every object file depends upon. If anything is removed # from this list, remove it from dep-in.sed as well. -$(OBJS): $(INCDIR)/bin-bugs.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ - $(INCDIR)/progress.h $(INCDIR)/fopen-same.h \ +$(OBJS): ../bfd/bfd.h $(INCDIR)/symcat.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h $(INCDIR)/progress.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/fopen-bin.h $(INCDIR)/fopen-vms.h \ $(OBJ_FORMAT_H) $(TARG_CPU_H) $(TARG_ENV_H) \ as.h asintl.h bignum.h bit_fix.h config.h emul.h expr.h flonum.h \ frags.h hash.h listing.h obj.h read.h symbols.h tc.h write.h @@ -2901,18 +2550,16 @@ ecoff.o : ecoff.c ecoff.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \ # We need all these explicit rules for the multi stuff. Because of # these rules, we don't need one for OBJ_FORMAT_O. -obj-aout.o : $(srcdir)/config/obj-aout.c +obj-aout.o : $(srcdir)/config/obj-aout.c $(DEP_@target_cpu_type@_aout) $(COMPILE) -c $(srcdir)/config/obj-aout.c -obj-coff.o: $(srcdir)/config/obj-coff.c +obj-coff.o: $(srcdir)/config/obj-coff.c $(DEP_@target_cpu_type@_coff) $(COMPILE) -c $(srcdir)/config/obj-coff.c -obj-ecoff.o : $(srcdir)/config/obj-ecoff.c +obj-ecoff.o : $(srcdir)/config/obj-ecoff.c $(DEP_@target_cpu_type@_ecoff) $(COMPILE) -c $(srcdir)/config/obj-ecoff.c -obj-elf.o : $(srcdir)/config/obj-elf.c +obj-elf.o : $(srcdir)/config/obj-elf.c $(DEP_@target_cpu_type@_elf) $(COMPILE) -c $(srcdir)/config/obj-elf.c obj-evax.o : $(srcdir)/config/obj-evax.c $(COMPILE) -c $(srcdir)/config/obj-evax.c -obj-ieee.o : $(srcdir)/config/obj-ieee.c - $(COMPILE) -c $(srcdir)/config/obj-ieee.c obj-multi.o : $(srcdir)/config/obj-multi.c $(COMPILE) -c $(srcdir)/config/obj-multi.c obj-som.o : $(srcdir)/config/obj-som.c @@ -2959,7 +2606,7 @@ m68k-parse.c: $(srcdir)/config/m68k-parse.y rm -f m68k-parse.y; \ else true; fi # Disable -Werror, if it has been enabled, since old versions of bison/ -# yacc will produce working code which contain compile time warnings. +# yacc will produce working code which contain compile time warnings. m68k-parse.o: m68k-parse.c $(srcdir)/config/m68k-parse.h $(COMPILE) -c $< $(NO_WERROR) @@ -2986,12 +2633,12 @@ bfin-lex.o: bfin-lex.c bfin-parse.h $(srcdir)/config/bfin-defs.h itbl-lex.c: $(srcdir)/itbl-lex.l # Disable -Werror, if it has been enabled, since old versions of bison/ -# yacc will produce working code which contain compile time warnings. +# yacc will produce working code which contain compile time warnings. itbl-lex.o: itbl-lex.c itbl-parse.h $(srcdir)/itbl-lex.h $(COMPILE) -c $< $(NO_WERROR) # Disable -Werror, if it has been enabled, since old versions of bison/ -# yacc will produce working code which contain compile time warnings. +# yacc will produce working code which contain compile time warnings. itbl-parse.o: itbl-parse.c itbl-parse.h $(srcdir)/itbl-ops.h $(srcdir)/itbl-lex.h $(COMPILE) -c $< $(NO_WERROR) @@ -3319,66 +2966,52 @@ dep-am: DEP # ANYTHING CHANGED OR ADDED BETWEEN THE WARNING LINES MAY GO AWAY. .PHONY: dep dep-in dep-am #MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW. -app.o: app.c $(INCDIR)/symcat.h -as.o: as.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ - output-file.h sb.h macro.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(BFDVER_H) -atof-generic.o: atof-generic.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h -cond.o: cond.c $(INCDIR)/symcat.h macro.h sb.h $(INCDIR)/obstack.h -depend.o: depend.c $(INCDIR)/symcat.h -dwarf2dbg.o: dwarf2dbg.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - dwarf2dbg.h $(INCDIR)/filenames.h subsegs.h $(INCDIR)/obstack.h \ +app.o: app.c +as.o: as.c subsegs.h $(INCDIR)/obstack.h output-file.h \ + sb.h macro.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + ../bfd/bfdver.h +atof-generic.o: atof-generic.c $(INCDIR)/safe-ctype.h +cond.o: cond.c sb.h macro.h $(INCDIR)/obstack.h +depend.o: depend.c +dwarf2dbg.o: dwarf2dbg.c $(INCDIR)/safe-ctype.h dwarf2dbg.h \ + $(INCDIR)/filenames.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/elf/dwarf2.h -dw2gencfi.o: dw2gencfi.c $(INCDIR)/symcat.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h -ecoff.o: ecoff.c $(INCDIR)/symcat.h ecoff.h -ehopt.o: ehopt.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/elf/dwarf2.h -expr.o: expr.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/obstack.h -flonum-copy.o: flonum-copy.c $(INCDIR)/symcat.h +dw2gencfi.o: dw2gencfi.c dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + subsegs.h $(INCDIR)/obstack.h +ecoff.o: ecoff.c ecoff.h +ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h +expr.o: expr.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h +flonum-copy.o: flonum-copy.c flonum-konst.o: flonum-konst.c flonum-mult.o: flonum-mult.c -frags.o: frags.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h -hash.o: hash.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/obstack.h -input-file.o: input-file.c $(INCDIR)/symcat.h input-file.h \ - $(INCDIR)/safe-ctype.h -input-scrub.o: input-scrub.c $(INCDIR)/symcat.h input-file.h \ - sb.h -listing.o: listing.c $(INCDIR)/symcat.h $(INCDIR)/obstack.h \ - $(INCDIR)/safe-ctype.h input-file.h subsegs.h -literal.o: literal.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h -macro.o: macro.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - sb.h macro.h -messages.o: messages.c $(INCDIR)/symcat.h -output-file.o: output-file.c $(INCDIR)/symcat.h output-file.h -read.o: read.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h sb.h macro.h ecoff.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h -sb.o: sb.c sb.h $(INCDIR)/symcat.h -stabs.o: stabs.c $(INCDIR)/symcat.h $(INCDIR)/obstack.h \ - subsegs.h ecoff.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def -subsegs.o: subsegs.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h -symbols.o: symbols.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/obstack.h subsegs.h struc-symbol.h -write.o: write.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ - output-file.h dwarf2dbg.h -itbl-ops.o: itbl-ops.c itbl-ops.h $(INCDIR)/symcat.h -e-crisaout.o: $(srcdir)/config/e-crisaout.c $(INCDIR)/symcat.h \ - emul-target.h -e-criself.o: $(srcdir)/config/e-criself.c $(INCDIR)/symcat.h \ - emul-target.h -e-i386aout.o: $(srcdir)/config/e-i386aout.c $(INCDIR)/symcat.h \ - emul-target.h -e-i386coff.o: $(srcdir)/config/e-i386coff.c $(INCDIR)/symcat.h \ - emul-target.h -e-i386elf.o: $(srcdir)/config/e-i386elf.c $(INCDIR)/symcat.h \ - emul-target.h -e-mipsecoff.o: $(srcdir)/config/e-mipsecoff.c $(INCDIR)/symcat.h \ - emul-target.h -e-mipself.o: $(srcdir)/config/e-mipself.c $(INCDIR)/symcat.h \ - emul-target.h +frags.o: frags.c subsegs.h $(INCDIR)/obstack.h +hash.o: hash.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h +input-file.o: input-file.c input-file.h $(INCDIR)/safe-ctype.h +input-scrub.o: input-scrub.c input-file.h sb.h +listing.o: listing.c $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ + input-file.h subsegs.h +literal.o: literal.c subsegs.h $(INCDIR)/obstack.h +macro.o: macro.c $(INCDIR)/safe-ctype.h sb.h macro.h +messages.o: messages.c +output-file.o: output-file.c output-file.h +read.o: read.c $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + sb.h macro.h ecoff.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h +sb.o: sb.c sb.h +stabs.o: stabs.c $(INCDIR)/obstack.h subsegs.h ecoff.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def +subsegs.o: subsegs.c subsegs.h $(INCDIR)/obstack.h +symbols.o: symbols.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ + subsegs.h struc-symbol.h +write.o: write.c subsegs.h $(INCDIR)/obstack.h output-file.h \ + dwarf2dbg.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h +itbl-ops.o: itbl-ops.c itbl-ops.h +e-crisaout.o: $(srcdir)/config/e-crisaout.c emul-target.h +e-criself.o: $(srcdir)/config/e-criself.c emul-target.h +e-i386aout.o: $(srcdir)/config/e-i386aout.c emul-target.h +e-i386coff.o: $(srcdir)/config/e-i386coff.c emul-target.h +e-i386elf.o: $(srcdir)/config/e-i386elf.c emul-target.h +e-mipsecoff.o: $(srcdir)/config/e-mipsecoff.c emul-target.h +e-mipself.o: $(srcdir)/config/e-mipself.c emul-target.h $(OBJS): $(DEP_@target_cpu_type@_@obj_format@) $(TARG_CPU_O): $(DEPTC_@target_cpu_type@_@obj_format@) $(OBJ_FORMAT_O): $(DEPOBJ_@target_cpu_type@_@obj_format@) diff --git a/gas/NEWS b/gas/NEWS index 4b4d029685a..bf278ef65a8 100644 --- a/gas/NEWS +++ b/gas/NEWS @@ -1,4 +1,12 @@ -*- text -*- +* Support for the National Semiconductor CR16 target has been added. + +* Added gas .reloc pseudo. This is a low-level interface for creating + relocations. + +* Add support for x86_64 PE+ target. + +* Add support for Score target. * Support for the Infineon XC16X has been added by KPIT Cummins Infosystems. diff --git a/gas/acinclude.m4 b/gas/acinclude.m4 index 0946e724f12..fa4c1bc6e9f 100644 --- a/gas/acinclude.m4 +++ b/gas/acinclude.m4 @@ -1,5 +1,3 @@ -sinclude(../bfd/warning.m4) - dnl GAS_CHECK_DECL_NEEDED(name, typedefname, typedef, headers) AC_DEFUN([GAS_CHECK_DECL_NEEDED],[ AC_MSG_CHECKING(whether declaration is required for $1) @@ -56,19 +54,3 @@ for _gas_uniq_i in _gas_uniq_dummy [$]_gas_uniq_list ; do done $1=[$]_gas_uniq_newlist ])dnl - -sinclude(../libtool.m4) -dnl The lines below arrange for aclocal not to bring libtool.m4 -dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake -dnl to add a definition of LIBTOOL to Makefile.in. -ifelse(yes,no,[ -AC_DEFUN([AM_PROG_LIBTOOL],) -AC_DEFUN([AC_CHECK_LIBM],) -AC_SUBST(LIBTOOL) -]) - -sinclude(../gettext.m4) -ifelse(yes,no,[ -AC_DEFUN([CY_WITH_NLS],) -AC_SUBST(INTLLIBS) -]) diff --git a/gas/aclocal.m4 b/gas/aclocal.m4 index cd4267338b7..1182e3622d1 100644 --- a/gas/aclocal.m4 +++ b/gas/aclocal.m4 @@ -480,27 +480,6 @@ AC_DEFUN([AM_PROG_INSTALL_SH], install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 # Free Software Foundation, Inc. # @@ -910,4 +889,16 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR +m4_include([../bfd/acinclude.m4]) +m4_include([../bfd/warning.m4]) +m4_include([../config/depstand.m4]) +m4_include([../config/gettext-sister.m4]) +m4_include([../config/lead-dot.m4]) +m4_include([../config/nls.m4]) +m4_include([../config/po.m4]) +m4_include([../config/progtest.m4]) +m4_include([../libtool.m4]) +m4_include([../ltoptions.m4]) +m4_include([../ltsugar.m4]) +m4_include([../ltversion.m4]) m4_include([acinclude.m4]) diff --git a/gas/app.c b/gas/app.c index 275ad68ebb0..e5f177801fd 100644 --- a/gas/app.c +++ b/gas/app.c @@ -1,6 +1,6 @@ /* This is the Assembler Pre-Processor Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003 + 1999, 2000, 2001, 2002, 2003, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -21,13 +21,12 @@ 02110-1301, USA. */ /* Modified by Allen Wirfs-Brock, Instantiations Inc 2/90. */ -/* App, the assembler pre-processor. This pre-processor strips out excess - spaces, turns single-quoted characters into a decimal constant, and turns - # into a .line \n.file - pair. This needs better error-handling. */ +/* App, the assembler pre-processor. This pre-processor strips out + excess spaces, turns single-quoted characters into a decimal + constant, and turns the # in # into a + .linefile. This needs better error-handling. */ -#include -#include "as.h" /* For BAD_CASE() only. */ +#include "as.h" #if (__STDC__ != 1) #ifndef const @@ -352,11 +351,11 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) 1: After first whitespace on line (flush more white) 2: After first non-white (opcode) on line (keep 1white) 3: after second white on line (into operands) (flush white) - 4: after putting out a .line, put out digits + 4: after putting out a .linefile, put out digits 5: parsing a string, then go to old-state 6: putting out \ escape in a "d string. - 7: After putting out a .appfile, put out string. - 8: After putting out a .appfile string, flush until newline. + 7: no longer used + 8: no longer used 9: After seeing symbol char in state 3 (keep 1white after symchar) 10: After seeing whitespace in state 9 (keep white before symchar) 11: After seeing a symbol character in state 0 (eg a label definition) @@ -511,14 +510,10 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) ch = GET (); if (ch == '"') { - UNGET (ch); - if (scrub_m68k_mri) - out_string = "\n\tappfile "; - else - out_string = "\n\t.appfile "; - old_state = 7; - state = -1; - PUT (*out_string++); + quotechar = ch; + state = 5; + old_state = 3; + PUT (ch); } else { @@ -555,6 +550,8 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) memcpy (to, from, len); to += len; from += len; + if (to >= toend) + goto tofull; } } @@ -639,24 +636,6 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) PUT (ch); continue; - case 7: - ch = GET (); - quotechar = ch; - state = 5; - old_state = 8; - PUT (ch); - continue; - - case 8: - do - ch = GET (); - while (ch != '\n' && ch != EOF); - if (ch == EOF) - goto fromeof; - state = 0; - PUT (ch); - continue; - #ifdef DOUBLEBAR_PARALLEL case 13: ch = GET (); @@ -888,9 +867,6 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) switch (state) { - case 0: - state++; - goto recycle; /* Punted leading sp */ case 1: /* We can arrive here if we leave a leading whitespace character at the beginning of a line. */ @@ -1200,9 +1176,9 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) old_state = 4; state = -1; if (scrub_m68k_mri) - out_string = "\tappline "; + out_string = "\tlinefile "; else - out_string = "\t.appline "; + out_string = "\t.linefile "; PUT (*out_string++); break; } @@ -1245,6 +1221,15 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) if ((symver_state != NULL) && (*symver_state == 0)) goto de_fault; #endif + +#ifdef TC_ARM + /* For the ARM, care is needed not to damage occurrences of \@ + by stripping the @ onwards. Yuck. */ + if (to > tostart && *(to - 1) == '\\') + /* Do not treat the @ as a start-of-comment. */ + goto de_fault; +#endif + #ifdef WARN_COMMENTS if (!found_comment) as_where (&found_comment_file, &found_comment); @@ -1377,7 +1362,15 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) the space. We don't have enough information to make the right choice, so here we are making the choice which is more likely to be correct. */ - PUT (' '); + if (to + 1 >= toend) + { + /* If we're near the end of the buffer, save the + character for the next time round. Otherwise + we'll lose our state. */ + UNGET (ch); + goto tofull; + } + *to++ = ' '; } state = 3; diff --git a/gas/as.c b/gas/as.c index 727a1dd40ee..b05f9d514a3 100644 --- a/gas/as.c +++ b/gas/as.c @@ -1,6 +1,6 @@ /* as.c - GAS main program. Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -31,8 +31,6 @@ Since no-one else says they will support them in future: I don't support them now. */ -#include "ansidecl.h" - #define COMMON #include "as.h" @@ -42,7 +40,6 @@ #include "macro.h" #include "dwarf2dbg.h" #include "dw2gencfi.h" -#include "hash.h" #include "bfdver.h" #ifdef HAVE_ITBL_CPU @@ -352,7 +349,9 @@ Options:\n\ md_show_usage (stream); fputc ('\n', stream); - fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); + + if (REPORT_BUGS_TO[0] && stream == stdout) + fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); } /* Since it is easy to do here we interpret the special arg "-" @@ -591,7 +590,7 @@ parse_args (int * pargc, char *** pargv) case OPTION_VERSION: /* This output is intended to follow the GNU standards document. */ printf (_("GNU assembler %s\n"), BFD_VERSION_STRING); - printf (_("Copyright 2005 Free Software Foundation, Inc.\n")); + printf (_("Copyright 2007 Free Software Foundation, Inc.\n")); printf (_("\ This program is free software; you may redistribute it under the terms of\n\ the GNU General Public License. This program has absolutely no warranty.\n")); @@ -1032,6 +1031,33 @@ perform_an_assembly_pass (int argc, char ** argv) read_a_source_file (""); } +#ifdef OBJ_ELF +static void +create_obj_attrs_section (void) +{ + segT s; + char *p; + addressT addr; + offsetT size; + const char *name; + + size = bfd_elf_obj_attr_size (stdoutput); + if (size) + { + name = get_elf_backend_data (stdoutput)->obj_attrs_section; + if (!name) + name = ".gnu.attributes"; + s = subseg_new (name, 0); + elf_section_type (s) + = get_elf_backend_data (stdoutput)->obj_attrs_section_type; + bfd_set_section_flags (stdoutput, s, SEC_READONLY | SEC_DATA); + addr = frag_now_fix (); + p = frag_more (size); + bfd_elf_set_obj_attr_contents (stdoutput, (bfd_byte *)p, size); + } +} +#endif + int main (int argc, char ** argv) @@ -1125,6 +1151,11 @@ main (int argc, char ** argv) sym = symbol_new (defsyms->name, absolute_section, defsyms->value, &zero_address_frag); + /* Make symbols defined on the command line volatile, so that they + can be redefined inside a source file. This makes this assembler's + behaviour compatible with earlier versions, but it may not be + completely intuitive. */ + S_SET_VOLATILE (sym); symbol_table_insert (sym); next = defsyms->next; free (defsyms); @@ -1142,6 +1173,11 @@ main (int argc, char ** argv) md_end (); #endif +#ifdef OBJ_ELF + if (IS_ELF) + create_obj_attrs_section (); +#endif + #if defined OBJ_ELF || defined OBJ_MAYBE_ELF if ((flag_execstack || flag_noexecstack) && OUTPUT_FLAVOR == bfd_target_elf_flavour) diff --git a/gas/as.h b/gas/as.h index 2f92c2ed774..4ea63abeea9 100644 --- a/gas/as.h +++ b/gas/as.h @@ -1,6 +1,6 @@ /* as.h - global header file Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -37,7 +37,6 @@ If TEST is #defined, then we are testing a module: #define COMMON as "". */ #include "config.h" -#include "bin-bugs.h" /* This is the code recommended in the autoconf documentation, almost verbatim. If it doesn't work for you, let me know, and notify @@ -210,7 +209,7 @@ extern int vsnprintf(char *, size_t, const char *, va_list); #endif /* __FILE__ */ #ifndef FOPEN_WB -#if defined GO32 || defined __MINGW32__ +#ifdef USE_BINARY_FOPEN #include "fopen-bin.h" #else #include "fopen-same.h" @@ -259,7 +258,11 @@ typedef addressT valueT; #endif /* COMMON now defined */ -#ifdef DEBUG +#ifndef ENABLE_CHECKING +#define ENABLE_CHECKING 0 +#endif + +#if ENABLE_CHECKING || defined (DEBUG) #ifndef know #define know(p) assert(p) /* Verify our assumptions! */ #endif /* not yet defined */ @@ -544,7 +547,6 @@ void cond_finish_check (int); void cond_exit_macro (int); int seen_at_least_1_file (void); void app_pop (char *); -void as_perror (const char *, const char *); void as_where (char **, unsigned int *); void bump_line_counters (void); void do_scrub_begin (int); @@ -552,6 +554,7 @@ void input_scrub_begin (void); void input_scrub_close (void); void input_scrub_end (void); int new_logical_line (char *, int); +int new_logical_line_flags (char *, int, int); void subsegs_begin (void); void subseg_change (segT, int); segT subseg_new (const char *, subsegT); @@ -567,7 +570,6 @@ segT subseg_get (const char *, int); struct expressionS; struct fix; typedef struct symbol symbolS; -struct relax_type; typedef struct frag fragS; /* literal.c */ diff --git a/gas/atof-generic.c b/gas/atof-generic.c index 6a5c2f15b3c..3021c4c861b 100644 --- a/gas/atof-generic.c +++ b/gas/atof-generic.c @@ -1,6 +1,6 @@ /* atof_generic.c - turn a string of digits into a Flonum Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, - 2001, 2003, 2005 Free Software Foundation, Inc. + 2001, 2003, 2005, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -19,8 +19,6 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include - #include "as.h" #include "safe-ctype.h" diff --git a/gas/bfin-lex.c b/gas/bfin-lex.c deleted file mode 100644 index cfc1fe7f30c..00000000000 --- a/gas/bfin-lex.c +++ /dev/null @@ -1,3368 +0,0 @@ -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /cvs/src/src/gas/Attic/bfin-lex.c,v 1.1.2.1 2006/04/16 18:36:43 drow Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include -#include - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#ifndef _WIN32 -#include -#endif - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 238 -#define YY_END_OF_BUFFER 239 -static yyconst short int yy_accept[559] = - { 0, - 0, 0, 0, 0, 239, 237, 235, 235, 220, 233, - 219, 218, 200, 201, 216, 214, 211, 210, 203, 232, - 232, 202, 221, 199, 195, 237, 224, 233, 148, 233, - 233, 233, 233, 233, 233, 233, 233, 233, 70, 233, - 233, 233, 54, 19, 18, 233, 12, 10, 8, 7, - 189, 188, 187, 233, 185, 183, 233, 233, 233, 233, - 233, 233, 217, 215, 213, 212, 0, 209, 204, 0, - 0, 0, 232, 234, 0, 232, 234, 198, 196, 222, - 194, 193, 178, 175, 233, 233, 233, 150, 151, 233, - 233, 149, 0, 147, 233, 140, 233, 233, 136, 233, - - 125, 233, 123, 233, 233, 233, 233, 233, 233, 233, - 103, 102, 101, 233, 100, 99, 233, 233, 97, 233, - 95, 94, 93, 91, 233, 85, 233, 233, 77, 86, - 233, 71, 69, 233, 233, 233, 233, 65, 233, 233, - 233, 59, 233, 56, 233, 233, 53, 233, 233, 233, - 233, 233, 233, 233, 233, 233, 233, 233, 233, 25, - 233, 233, 233, 233, 233, 15, 14, 233, 233, 159, - 233, 186, 233, 184, 223, 233, 233, 95, 233, 233, - 233, 205, 207, 206, 208, 0, 0, 232, 232, 232, - 232, 197, 191, 192, 233, 233, 171, 152, 153, 233, - - 233, 162, 163, 233, 154, 156, 232, 233, 233, 233, - 233, 233, 233, 124, 233, 233, 119, 233, 233, 233, - 233, 233, 233, 233, 233, 233, 179, 98, 233, 233, - 233, 233, 233, 233, 80, 83, 78, 81, 233, 233, - 233, 79, 82, 233, 67, 66, 233, 63, 62, 233, - 233, 233, 233, 233, 233, 233, 233, 233, 233, 44, - 39, 38, 37, 36, 35, 34, 233, 32, 31, 233, - 233, 233, 233, 233, 233, 233, 21, 233, 233, 16, - 13, 233, 9, 233, 233, 233, 233, 233, 233, 233, - 236, 190, 170, 168, 177, 176, 169, 167, 174, 173, - - 233, 233, 233, 155, 157, 146, 233, 233, 233, 233, - 139, 138, 233, 127, 233, 233, 118, 233, 233, 233, - 233, 111, 110, 233, 233, 233, 233, 233, 233, 233, - 105, 104, 233, 233, 233, 96, 233, 92, 89, 84, - 74, 233, 233, 68, 64, 233, 61, 60, 58, 57, - 233, 55, 45, 233, 50, 47, 49, 46, 48, 233, - 233, 43, 42, 233, 233, 233, 233, 233, 27, 24, - 23, 233, 233, 233, 233, 233, 233, 228, 233, 227, - 233, 233, 233, 233, 160, 233, 233, 233, 233, 233, - 233, 233, 233, 233, 233, 122, 233, 117, 116, 233, - - 233, 233, 233, 233, 233, 233, 233, 108, 233, 233, - 233, 233, 233, 233, 233, 233, 233, 233, 2, 182, - 52, 41, 40, 33, 233, 233, 233, 30, 233, 22, - 233, 233, 233, 172, 231, 233, 233, 233, 233, 233, - 164, 161, 145, 144, 143, 142, 141, 233, 233, 233, - 233, 126, 121, 233, 233, 233, 233, 233, 51, 233, - 233, 107, 233, 233, 233, 233, 233, 88, 87, 90, - 233, 233, 73, 72, 29, 233, 233, 233, 20, 233, - 233, 233, 229, 233, 226, 165, 166, 233, 233, 233, - 233, 233, 233, 120, 233, 114, 113, 233, 233, 233, - - 5, 106, 233, 180, 233, 233, 233, 233, 28, 233, - 233, 17, 11, 233, 233, 233, 233, 135, 133, 134, - 132, 129, 233, 115, 233, 6, 109, 233, 233, 3, - 233, 76, 1, 26, 230, 225, 137, 130, 131, 233, - 233, 233, 233, 233, 128, 233, 233, 4, 75, 233, - 233, 112, 233, 233, 233, 233, 181, 0 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 4, 1, 5, 6, 7, 8, 1, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 1, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 1, 60, 61, 62, 1, 63, 64, 35, 36, - - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 65, 48, 49, 66, 51, 67, 53, 54, 55, 56, - 57, 58, 1, 68, 1, 69, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[70] = - { 0, - 1, 1, 2, 1, 1, 3, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 1, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, - 1, 1, 5, 4, 5, 5, 5, 4, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, - 1, 3, 5, 4, 3, 3, 3, 1, 1 - } ; - -static yyconst short int yy_base[565] = - { 0, - 0, 0, 32, 33, 814, 815, 815, 815, 815, 0, - 815, 783, 815, 815, 782, 60, 815, 61, 800, 113, - 44, 815, 815, 54, 75, 779, 815, 161, 221, 59, - 84, 42, 92, 105, 109, 148, 756, 271, 141, 48, - 110, 322, 372, 421, 153, 757, 60, 787, 0, 0, - 815, 815, 776, 741, 58, 815, 141, 64, 763, 43, - 61, 0, 815, 815, 815, 815, 105, 815, 815, 129, - 792, 210, 225, 235, 472, 275, 815, 772, 815, 815, - 815, 145, 786, 785, 748, 163, 757, 0, 0, 263, - 185, 0, 0, 782, 131, 0, 759, 97, 154, 751, - - 0, 753, 0, 736, 757, 752, 742, 69, 736, 279, - 773, 741, 0, 156, 0, 0, 157, 749, 770, 740, - 0, 0, 732, 0, 737, 766, 196, 199, 0, 153, - 226, 247, 765, 723, 732, 220, 280, 0, 221, 740, - 170, 761, 740, 0, 250, 728, 758, 731, 252, 735, - 257, 308, 260, 248, 269, 288, 281, 729, 730, 753, - 710, 725, 714, 713, 710, 0, 0, 714, 298, 0, - 742, 815, 219, 815, 815, 707, 715, 714, 711, 174, - 712, 815, 815, 815, 815, 744, 138, 356, 408, 0, - 0, 815, 815, 724, 312, 343, 0, 0, 0, 714, - - 711, 0, 0, 249, 700, 699, 0, 232, 369, 695, - 303, 711, 703, 0, 700, 701, 375, 337, 337, 122, - 238, 338, 378, 347, 239, 709, 725, 0, 356, 318, - 705, 722, 692, 363, 0, 0, 0, 0, 691, 390, - 697, 0, 0, 372, 0, 0, 689, 0, 0, 700, - 684, 699, 403, 690, 684, 393, 436, 680, 474, 431, - 0, 0, 0, 0, 0, 0, 684, 0, 0, 398, - 678, 401, 690, 681, 437, 680, 0, 690, 401, 0, - 0, 662, 0, 657, 671, 684, 667, 676, 680, 676, - 705, 815, 0, 0, 0, 0, 0, 0, 0, 0, - - 669, 676, 434, 0, 0, 0, 669, 659, 674, 448, - 0, 659, 466, 694, 673, 670, 439, 661, 411, 654, - 660, 0, 0, 419, 422, 647, 649, 450, 665, 470, - 0, 0, 664, 675, 462, 0, 636, 0, 682, 0, - 634, 642, 656, 0, 0, 656, 0, 0, 0, 0, - 657, 0, 0, 654, 0, 0, 0, 0, 0, 671, - 672, 0, 0, 652, 652, 470, 649, 471, 470, 0, - 0, 650, 646, 632, 637, 614, 640, 617, 627, 0, - 640, 630, 521, 474, 0, 466, 619, 475, 630, 477, - 633, 624, 485, 625, 614, 0, 618, 0, 0, 620, - - 623, 625, 626, 611, 491, 628, 611, 0, 619, 625, - 622, 613, 622, 495, 503, 487, 608, 497, 0, 0, - 0, 0, 0, 0, 615, 517, 603, 0, 612, 0, - 613, 614, 519, 0, 609, 609, 501, 605, 624, 625, - 0, 0, 0, 0, 0, 0, 0, 604, 537, 609, - 595, 0, 623, 597, 508, 510, 594, 588, 0, 590, - 600, 0, 511, 585, 614, 532, 597, 0, 0, 0, - 596, 586, 0, 0, 0, 514, 594, 517, 0, 518, - 574, 583, 0, 593, 0, 0, 0, 589, 544, 315, - 578, 582, 538, 0, 568, 0, 0, 586, 578, 520, - - 0, 0, 575, 0, 551, 554, 563, 564, 0, 521, - 548, 0, 0, 543, 556, 522, 418, 0, 0, 0, - 0, 0, 558, 0, 535, 0, 0, 524, 528, 0, - 424, 0, 0, 0, 0, 0, 0, 0, 0, 403, - 388, 378, 324, 279, 0, 272, 529, 0, 0, 531, - 538, 0, 262, 168, 82, 83, 0, 815, 603, 608, - 92, 613, 615, 617 - } ; - -static yyconst short int yy_def[565] = - { 0, - 558, 1, 1, 1, 558, 558, 558, 558, 558, 559, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 560, - 561, 558, 558, 558, 558, 558, 558, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 558, 558, 558, 28, 558, 558, 559, 36, 38, 42, - 559, 559, 558, 558, 558, 558, 558, 558, 558, 558, - 562, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 563, 559, 559, 559, 559, 559, 559, 559, - - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 558, 559, 558, 558, 559, 559, 559, 559, 559, - 559, 558, 558, 558, 558, 562, 562, 558, 558, 75, - 564, 558, 558, 558, 559, 559, 559, 559, 559, 559, - - 559, 559, 559, 559, 559, 559, 563, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 562, 558, 559, 559, 559, 559, 559, 559, 559, 559, - - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 0, 558, 558, - 558, 558, 558, 558 - } ; - -static yyconst short int yy_nxt[885] = - { 0, - 6, 7, 8, 9, 6, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 10, 19, 20, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 10, 38, 39, 40, 41, 42, 10, 43, - 44, 45, 46, 47, 48, 49, 10, 50, 51, 52, - 53, 10, 54, 29, 41, 43, 45, 55, 56, 57, - 57, 65, 58, 58, 68, 59, 59, 77, 80, 60, - 60, 77, 78, 79, 61, 61, 109, 174, 93, 66, - 69, 100, 180, 101, 137, 76, 93, 110, 138, 177, - - 169, 178, 102, 557, 81, 103, 181, 77, 180, 104, - 170, 168, 137, 93, 93, 105, 182, 106, 183, 219, - 107, 100, 220, 103, 108, 175, 556, 67, 70, 73, - 73, 73, 73, 73, 73, 73, 73, 73, 73, 111, - 184, 113, 185, 211, 112, 93, 74, 106, 187, 116, - 74, 114, 117, 291, 139, 140, 115, 133, 133, 133, - 133, 211, 141, 118, 119, 119, 119, 119, 75, 114, - 322, 115, 323, 134, 193, 194, 74, 83, 84, 198, - 199, 135, 209, 120, 176, 121, 136, 122, 111, 164, - 165, 555, 166, 112, 85, 86, 167, 209, 123, 239, - - 124, 205, 206, 134, 87, 212, 88, 227, 228, 89, - 289, 90, 235, 236, 91, 237, 238, 239, 92, 256, - 212, 252, 227, 228, 85, 93, 188, 188, 188, 188, - 188, 188, 188, 188, 188, 188, 252, 94, 94, 94, - 94, 189, 189, 189, 189, 189, 189, 189, 189, 189, - 189, 188, 188, 188, 188, 188, 188, 188, 188, 188, - 188, 95, 240, 242, 243, 241, 247, 250, 96, 197, - 97, 306, 324, 325, 326, 306, 98, 99, 331, 554, - 268, 303, 332, 284, 247, 250, 97, 126, 126, 126, - 126, 76, 76, 76, 76, 76, 76, 76, 76, 76, - - 76, 255, 201, 259, 127, 128, 202, 129, 261, 267, - 268, 303, 203, 222, 204, 269, 255, 130, 259, 550, - 270, 131, 132, 261, 549, 267, 223, 248, 203, 204, - 224, 249, 272, 269, 127, 130, 271, 132, 142, 142, - 142, 142, 142, 142, 262, 224, 249, 272, 263, 282, - 270, 293, 312, 264, 143, 294, 144, 336, 265, 519, - 548, 336, 520, 266, 282, 145, 295, 296, 312, 321, - 327, 146, 188, 188, 188, 188, 188, 188, 188, 188, - 188, 188, 297, 320, 143, 328, 298, 146, 147, 147, - 147, 147, 147, 147, 147, 147, 330, 299, 300, 321, - - 327, 320, 340, 307, 148, 335, 340, 317, 149, 318, - 329, 344, 330, 308, 319, 344, 547, 150, 151, 309, - 310, 335, 546, 152, 189, 189, 189, 189, 189, 189, - 189, 189, 189, 189, 148, 310, 151, 317, 152, 153, - 329, 342, 349, 401, 352, 545, 349, 365, 360, 361, - 367, 404, 374, 154, 405, 155, 342, 156, 157, 352, - 158, 159, 538, 365, 544, 539, 367, 374, 160, 353, - 362, 161, 162, 401, 363, 353, 370, 163, 398, 353, - 371, 404, 399, 154, 405, 385, 389, 162, 190, 190, - 190, 190, 190, 190, 190, 190, 190, 190, 390, 353, - - 385, 408, 410, 429, 191, 191, 191, 191, 191, 191, - 355, 413, 392, 393, 356, 443, 408, 450, 394, 357, - 471, 426, 428, 472, 358, 442, 445, 413, 447, 359, - 392, 443, 410, 429, 191, 191, 426, 428, 439, 440, - 442, 445, 459, 447, 467, 441, 468, 450, 474, 476, - 471, 481, 484, 469, 489, 490, 491, 459, 470, 496, - 467, 497, 502, 474, 505, 509, 517, 484, 511, 512, - 523, 527, 533, 537, 496, 551, 497, 502, 543, 476, - 509, 481, 552, 511, 512, 542, 527, 533, 537, 553, - 541, 518, 540, 551, 505, 536, 535, 552, 534, 532, - - 523, 531, 530, 529, 553, 62, 62, 62, 72, 528, - 72, 72, 72, 186, 526, 186, 186, 186, 207, 207, - 191, 191, 525, 524, 522, 521, 516, 515, 514, 513, - 510, 508, 507, 506, 504, 503, 501, 500, 499, 498, - 495, 494, 493, 492, 488, 487, 486, 485, 483, 482, - 480, 479, 478, 477, 475, 473, 466, 465, 464, 463, - 462, 461, 460, 458, 457, 456, 455, 454, 453, 452, - 451, 449, 448, 446, 444, 438, 437, 436, 414, 435, - 434, 433, 432, 431, 430, 427, 425, 424, 423, 422, - 421, 420, 419, 418, 417, 416, 415, 414, 412, 411, - - 409, 407, 406, 403, 402, 400, 397, 396, 395, 391, - 388, 387, 386, 384, 383, 187, 382, 381, 380, 379, - 378, 377, 376, 375, 373, 372, 369, 368, 366, 364, - 354, 351, 350, 348, 347, 346, 345, 343, 341, 339, - 338, 337, 334, 333, 316, 315, 314, 313, 311, 305, - 304, 302, 301, 292, 187, 290, 288, 287, 286, 285, - 283, 281, 280, 279, 278, 277, 276, 275, 274, 273, - 260, 258, 257, 256, 254, 253, 251, 246, 245, 244, - 234, 233, 232, 231, 230, 229, 226, 225, 221, 218, - 217, 216, 215, 214, 213, 210, 208, 200, 197, 196, - - 195, 192, 187, 179, 173, 172, 171, 168, 125, 82, - 71, 64, 63, 558, 5, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558 - } ; - -static yyconst short int yy_chk[885] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 4, 16, 3, 4, 18, 3, 4, 21, 25, 3, - 4, 21, 24, 24, 3, 4, 32, 55, 31, 16, - 18, 30, 60, 30, 40, 561, 33, 32, 40, 58, - - 47, 58, 30, 556, 25, 30, 61, 21, 60, 30, - 47, 61, 40, 35, 41, 30, 67, 31, 67, 108, - 31, 30, 108, 30, 31, 55, 555, 16, 18, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 33, - 70, 34, 70, 98, 33, 57, 20, 31, 187, 35, - 20, 34, 35, 187, 41, 41, 34, 39, 39, 39, - 39, 98, 41, 35, 36, 36, 36, 36, 20, 34, - 220, 34, 220, 39, 82, 82, 20, 28, 28, 86, - 86, 39, 95, 36, 57, 36, 39, 36, 57, 45, - 45, 554, 45, 57, 28, 28, 45, 95, 36, 130, - - 36, 91, 91, 39, 28, 99, 28, 114, 117, 28, - 180, 28, 127, 127, 28, 128, 128, 130, 28, 180, - 99, 141, 114, 117, 28, 29, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 141, 29, 29, 29, - 29, 73, 73, 73, 73, 73, 73, 73, 73, 73, - 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 29, 131, 132, 132, 131, 136, 139, 29, 173, - 29, 208, 221, 221, 221, 208, 29, 29, 225, 553, - 154, 204, 225, 173, 136, 139, 29, 38, 38, 38, - 38, 76, 76, 76, 76, 76, 76, 76, 76, 76, - - 76, 145, 90, 149, 38, 38, 90, 38, 151, 153, - 154, 204, 90, 110, 90, 155, 145, 38, 149, 546, - 156, 38, 38, 151, 544, 153, 110, 137, 90, 90, - 110, 137, 157, 155, 38, 38, 156, 38, 42, 42, - 42, 42, 42, 42, 152, 110, 137, 157, 152, 169, - 156, 195, 211, 152, 42, 195, 42, 230, 152, 490, - 543, 230, 490, 152, 169, 42, 195, 195, 211, 219, - 222, 42, 188, 188, 188, 188, 188, 188, 188, 188, - 188, 188, 196, 218, 42, 222, 196, 42, 43, 43, - 43, 43, 43, 43, 43, 43, 224, 196, 196, 219, - - 222, 218, 234, 209, 43, 229, 234, 217, 43, 217, - 223, 244, 224, 209, 217, 244, 542, 43, 43, 209, - 209, 229, 541, 43, 189, 189, 189, 189, 189, 189, - 189, 189, 189, 189, 43, 209, 43, 217, 43, 44, - 223, 240, 253, 319, 256, 540, 253, 270, 260, 260, - 272, 324, 279, 44, 325, 44, 240, 44, 44, 256, - 44, 44, 517, 270, 531, 517, 272, 279, 44, 257, - 260, 44, 44, 319, 260, 257, 275, 44, 317, 257, - 275, 324, 317, 44, 325, 303, 310, 44, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 310, 257, - - 303, 328, 330, 369, 75, 75, 75, 75, 75, 75, - 259, 335, 313, 313, 259, 386, 328, 393, 313, 259, - 416, 366, 368, 416, 259, 384, 388, 335, 390, 259, - 313, 386, 330, 369, 75, 75, 366, 368, 383, 383, - 384, 388, 405, 390, 414, 383, 415, 393, 418, 426, - 416, 433, 437, 415, 449, 449, 449, 405, 415, 455, - 414, 456, 463, 418, 466, 476, 489, 437, 478, 480, - 493, 500, 510, 516, 455, 547, 456, 463, 529, 426, - 476, 433, 550, 478, 480, 528, 500, 510, 516, 551, - 525, 489, 523, 547, 466, 515, 514, 550, 511, 508, - - 493, 507, 506, 505, 551, 559, 559, 559, 560, 503, - 560, 560, 560, 562, 499, 562, 562, 562, 563, 563, - 564, 564, 498, 495, 492, 491, 488, 484, 482, 481, - 477, 472, 471, 467, 465, 464, 461, 460, 458, 457, - 454, 453, 451, 450, 448, 440, 439, 438, 436, 435, - 432, 431, 429, 427, 425, 417, 413, 412, 411, 410, - 409, 407, 406, 404, 403, 402, 401, 400, 397, 395, - 394, 392, 391, 389, 387, 382, 381, 379, 378, 377, - 376, 375, 374, 373, 372, 367, 365, 364, 361, 360, - 354, 351, 346, 343, 342, 341, 339, 337, 334, 333, - - 329, 327, 326, 321, 320, 318, 316, 315, 314, 312, - 309, 308, 307, 302, 301, 291, 290, 289, 288, 287, - 286, 285, 284, 282, 278, 276, 274, 273, 271, 267, - 258, 255, 254, 252, 251, 250, 247, 241, 239, 233, - 232, 231, 227, 226, 216, 215, 213, 212, 210, 206, - 205, 201, 200, 194, 186, 181, 179, 178, 177, 176, - 171, 168, 165, 164, 163, 162, 161, 160, 159, 158, - 150, 148, 147, 146, 143, 142, 140, 135, 134, 133, - 126, 125, 123, 120, 119, 118, 112, 111, 109, 107, - 106, 105, 104, 102, 100, 97, 94, 87, 85, 84, - - 83, 78, 71, 59, 54, 53, 48, 46, 37, 26, - 19, 15, 12, 5, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "bfin-lex.l" -#define INITIAL 0 -/* bfin-lex.l ADI Blackfin lexer - Copyright 2005 - Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS 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 2, or (at your option) - any later version. - - GAS 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 GAS; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ -#line 22 "bfin-lex.l" - -#include -#include -#include "bfin-defs.h" -#include "bfin-parse.h" -#include "as.h" - -static long parse_int (char **end); -static int parse_halfreg (Register *r, int cl, char *hr); -static int parse_reg (Register *r, int type, char *rt); -int yylex (void); - -#define _REG yylval.reg - - -/* Define Start States ... Actually we will use exclusion. - If no start state is specified it should match any state - and would match some keyword rules only with - initial. */ -#define KEYWORD 1 - -#line 788 "bfin-lex.c" - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - } -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 45 "bfin-lex.l" - -#line 952 "bfin-lex.c" - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 559 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 815 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 46 "bfin-lex.l" -_REG.regno = REG_sftreset; return REG; - YY_BREAK -case 2: -YY_RULE_SETUP -#line 47 "bfin-lex.l" -_REG.regno = REG_omode; return REG; - YY_BREAK -case 3: -YY_RULE_SETUP -#line 48 "bfin-lex.l" -_REG.regno = REG_idle_req; return REG; - YY_BREAK -case 4: -YY_RULE_SETUP -#line 49 "bfin-lex.l" -_REG.regno = REG_hwerrcause; return REG; - YY_BREAK -case 5: -YY_RULE_SETUP -#line 50 "bfin-lex.l" -_REG.regno = REG_excause; return REG; - YY_BREAK -case 6: -YY_RULE_SETUP -#line 51 "bfin-lex.l" -_REG.regno = REG_emucause; return REG; - YY_BREAK -case 7: -YY_RULE_SETUP -#line 52 "bfin-lex.l" -return Z; - YY_BREAK -case 8: -YY_RULE_SETUP -#line 53 "bfin-lex.l" -return X; - YY_BREAK -case 9: -YY_RULE_SETUP -#line 54 "bfin-lex.l" -yylval.value = M_W32; return MMOD; - YY_BREAK -case 10: -YY_RULE_SETUP -#line 55 "bfin-lex.l" -return W; - YY_BREAK -case 11: -YY_RULE_SETUP -#line 56 "bfin-lex.l" -return VIT_MAX; - YY_BREAK -case 12: -YY_RULE_SETUP -#line 57 "bfin-lex.l" -return V; /* Special: V is a statflag and a modifier. */ - YY_BREAK -case 13: -YY_RULE_SETUP -#line 58 "bfin-lex.l" -_REG.regno = REG_USP; return REG; - YY_BREAK -case 14: -YY_RULE_SETUP -#line 59 "bfin-lex.l" -return TL; - YY_BREAK -case 15: -YY_RULE_SETUP -#line 60 "bfin-lex.l" -return TH; - YY_BREAK -case 16: -YY_RULE_SETUP -#line 61 "bfin-lex.l" -yylval.value = M_TFU; return MMOD; - YY_BREAK -case 17: -YY_RULE_SETUP -#line 62 "bfin-lex.l" -return TESTSET; - YY_BREAK -case 18: -YY_RULE_SETUP -#line 63 "bfin-lex.l" -yylval.value = M_T; return MMOD; - YY_BREAK -case 19: -YY_RULE_SETUP -#line 64 "bfin-lex.l" -return S; - YY_BREAK -case 20: -YY_RULE_SETUP -#line 65 "bfin-lex.l" -_REG.regno = REG_SYSCFG; return REG; - YY_BREAK -case 21: -YY_RULE_SETUP -#line 66 "bfin-lex.l" -return STI; - YY_BREAK -case 22: -YY_RULE_SETUP -#line 67 "bfin-lex.l" -return SSYNC; - YY_BREAK -case 23: -YY_RULE_SETUP -#line 68 "bfin-lex.l" -_REG.regno = REG_SP; return HALF_REG; - YY_BREAK -case 24: -YY_RULE_SETUP -#line 69 "bfin-lex.l" -_REG.regno = REG_SP | F_REG_HIGH; return HALF_REG; - YY_BREAK -case 25: -YY_RULE_SETUP -#line 70 "bfin-lex.l" -_REG.regno = REG_SP; return REG; - YY_BREAK -case 26: -YY_RULE_SETUP -#line 71 "bfin-lex.l" -return SIGNBITS; - YY_BREAK -case 27: -YY_RULE_SETUP -#line 72 "bfin-lex.l" -return SIGN; - YY_BREAK -case 28: -YY_RULE_SETUP -#line 73 "bfin-lex.l" -_REG.regno = REG_SEQSTAT; return REG; - YY_BREAK -case 29: -YY_RULE_SETUP -#line 74 "bfin-lex.l" -return SEARCH; - YY_BREAK -case 30: -YY_RULE_SETUP -#line 75 "bfin-lex.l" -return SHIFT; - YY_BREAK -case 31: -YY_RULE_SETUP -#line 76 "bfin-lex.l" -return SCO; - YY_BREAK -case 32: -YY_RULE_SETUP -#line 78 "bfin-lex.l" -return SAA; - YY_BREAK -case 33: -YY_RULE_SETUP -#line 79 "bfin-lex.l" -yylval.value = M_S2RND; return MMOD; - YY_BREAK -case 34: -YY_RULE_SETUP -#line 80 "bfin-lex.l" -return RTX; - YY_BREAK -case 35: -YY_RULE_SETUP -#line 81 "bfin-lex.l" -return RTS; - YY_BREAK -case 36: -YY_RULE_SETUP -#line 82 "bfin-lex.l" -return RTN; - YY_BREAK -case 37: -YY_RULE_SETUP -#line 83 "bfin-lex.l" -return RTI; - YY_BREAK -case 38: -YY_RULE_SETUP -#line 84 "bfin-lex.l" -return RTE; - YY_BREAK -case 39: -YY_RULE_SETUP -#line 85 "bfin-lex.l" -return ROT; - YY_BREAK -case 40: -YY_RULE_SETUP -#line 86 "bfin-lex.l" -return RND20; - YY_BREAK -case 41: -YY_RULE_SETUP -#line 87 "bfin-lex.l" -return RND12; - YY_BREAK -case 42: -YY_RULE_SETUP -#line 88 "bfin-lex.l" -return RNDL; - YY_BREAK -case 43: -YY_RULE_SETUP -#line 89 "bfin-lex.l" -return RNDH; - YY_BREAK -case 44: -YY_RULE_SETUP -#line 90 "bfin-lex.l" -return RND; - YY_BREAK -case 45: -YY_RULE_SETUP -#line 92 "bfin-lex.l" -return parse_halfreg(&yylval.reg, T_REG_R, yytext); - YY_BREAK -case 46: -YY_RULE_SETUP -#line 94 "bfin-lex.l" -_REG.regno = REG_RETS; return REG; - YY_BREAK -case 47: -YY_RULE_SETUP -#line 95 "bfin-lex.l" -_REG.regno = REG_RETI; return REG; - YY_BREAK -case 48: -YY_RULE_SETUP -#line 96 "bfin-lex.l" -_REG.regno = REG_RETX; return REG; - YY_BREAK -case 49: -YY_RULE_SETUP -#line 97 "bfin-lex.l" -_REG.regno = REG_RETN; return REG; - YY_BREAK -case 50: -YY_RULE_SETUP -#line 98 "bfin-lex.l" -_REG.regno = REG_RETE; return REG; - YY_BREAK -case 51: -YY_RULE_SETUP -#line 99 "bfin-lex.l" -_REG.regno = REG_EMUDAT; return REG; - YY_BREAK -case 52: -YY_RULE_SETUP -#line 100 "bfin-lex.l" -return RAISE; - YY_BREAK -case 53: -YY_RULE_SETUP -#line 102 "bfin-lex.l" -return parse_reg (&yylval.reg, T_REG_R, yytext); - YY_BREAK -case 54: -YY_RULE_SETUP -#line 104 "bfin-lex.l" -return R; - YY_BREAK -case 55: -YY_RULE_SETUP -#line 105 "bfin-lex.l" -return PRNT; - YY_BREAK -case 56: -YY_RULE_SETUP -#line 106 "bfin-lex.l" -return PC; - YY_BREAK -case 57: -YY_RULE_SETUP -#line 107 "bfin-lex.l" -return PACK; - YY_BREAK -case 58: -YY_RULE_SETUP -#line 109 "bfin-lex.l" -return parse_halfreg (&yylval.reg, T_REG_P, yytext); - YY_BREAK -case 59: -YY_RULE_SETUP -#line 110 "bfin-lex.l" -return parse_reg (&yylval.reg, T_REG_P, yytext); - YY_BREAK -case 60: -YY_RULE_SETUP -#line 112 "bfin-lex.l" -return OUTC; - YY_BREAK -case 61: -YY_RULE_SETUP -#line 113 "bfin-lex.l" -return ONES; - YY_BREAK -case 62: -YY_RULE_SETUP -#line 115 "bfin-lex.l" -return NOT; - YY_BREAK -case 63: -YY_RULE_SETUP -#line 116 "bfin-lex.l" -return NOP; - YY_BREAK -case 64: -YY_RULE_SETUP -#line 117 "bfin-lex.l" -return MNOP; - YY_BREAK -case 65: -YY_RULE_SETUP -#line 118 "bfin-lex.l" -return NS; - YY_BREAK -case 66: -YY_RULE_SETUP -#line 121 "bfin-lex.l" -return MIN; - YY_BREAK -case 67: -YY_RULE_SETUP -#line 122 "bfin-lex.l" -return MAX; - YY_BREAK -case 68: -YY_RULE_SETUP -#line 124 "bfin-lex.l" -return parse_halfreg (&yylval.reg, T_REG_M, yytext); - YY_BREAK -case 69: -YY_RULE_SETUP -#line 125 "bfin-lex.l" -return parse_reg (&yylval.reg, T_REG_M, yytext); - YY_BREAK -case 70: -YY_RULE_SETUP -#line 127 "bfin-lex.l" -return M; - YY_BREAK -case 71: -YY_RULE_SETUP -#line 128 "bfin-lex.l" -return LT; - YY_BREAK -case 72: -YY_RULE_SETUP -#line 129 "bfin-lex.l" -return LSHIFT; - YY_BREAK -case 73: -YY_RULE_SETUP -#line 130 "bfin-lex.l" -return LSETUP; - YY_BREAK -case 74: -YY_RULE_SETUP -#line 131 "bfin-lex.l" -return LOOP; - YY_BREAK -case 75: -YY_RULE_SETUP -#line 132 "bfin-lex.l" -return LOOP_BEGIN; - YY_BREAK -case 76: -YY_RULE_SETUP -#line 133 "bfin-lex.l" -return LOOP_END; - YY_BREAK -case 77: -YY_RULE_SETUP -#line 135 "bfin-lex.l" -return LE; - YY_BREAK -case 78: -YY_RULE_SETUP -#line 136 "bfin-lex.l" -_REG.regno = REG_LC0; return REG; - YY_BREAK -case 79: -YY_RULE_SETUP -#line 137 "bfin-lex.l" -_REG.regno = REG_LT0; return REG; - YY_BREAK -case 80: -YY_RULE_SETUP -#line 138 "bfin-lex.l" -_REG.regno = REG_LB0; return REG; - YY_BREAK -case 81: -YY_RULE_SETUP -#line 139 "bfin-lex.l" -_REG.regno = REG_LC1; return REG; - YY_BREAK -case 82: -YY_RULE_SETUP -#line 140 "bfin-lex.l" -_REG.regno = REG_LT1; return REG; - YY_BREAK -case 83: -YY_RULE_SETUP -#line 141 "bfin-lex.l" -_REG.regno = REG_LB1; return REG; - YY_BREAK -case 84: -YY_RULE_SETUP -#line 143 "bfin-lex.l" -return parse_halfreg (&yylval.reg, T_REG_L, yytext); - YY_BREAK -case 85: -YY_RULE_SETUP -#line 144 "bfin-lex.l" -return parse_reg (&yylval.reg, T_REG_L, yytext); - YY_BREAK -case 86: -YY_RULE_SETUP -#line 145 "bfin-lex.l" -return LO; - YY_BREAK -case 87: -YY_RULE_SETUP -#line 146 "bfin-lex.l" -{ BEGIN 0; return JUMP_DOT_S;} - YY_BREAK -case 88: -YY_RULE_SETUP -#line 147 "bfin-lex.l" -{ BEGIN 0; return JUMP_DOT_L;} - YY_BREAK -case 89: -YY_RULE_SETUP -#line 148 "bfin-lex.l" -{ BEGIN 0; return JUMP;} - YY_BREAK -case 90: -YY_RULE_SETUP -#line 149 "bfin-lex.l" -{ BEGIN 0; return JUMP_DOT_L; } - YY_BREAK -case 91: -YY_RULE_SETUP -#line 150 "bfin-lex.l" -yylval.value = M_IU; return MMOD; - YY_BREAK -case 92: -YY_RULE_SETUP -#line 151 "bfin-lex.l" -yylval.value = M_ISS2; return MMOD; - YY_BREAK -case 93: -YY_RULE_SETUP -#line 152 "bfin-lex.l" -yylval.value = M_IS; return MMOD; - YY_BREAK -case 94: -YY_RULE_SETUP -#line 153 "bfin-lex.l" -yylval.value = M_IH; return MMOD; - YY_BREAK -case 95: -YY_RULE_SETUP -#line 154 "bfin-lex.l" -return IF; - YY_BREAK -case 96: -YY_RULE_SETUP -#line 155 "bfin-lex.l" -return parse_halfreg (&yylval.reg, T_REG_I, yytext); - YY_BREAK -case 97: -YY_RULE_SETUP -#line 156 "bfin-lex.l" -return parse_reg (&yylval.reg, T_REG_I, yytext); - YY_BREAK -case 98: -YY_RULE_SETUP -#line 157 "bfin-lex.l" -return HLT; - YY_BREAK -case 99: -YY_RULE_SETUP -#line 158 "bfin-lex.l" -return HI; - YY_BREAK -case 100: -YY_RULE_SETUP -#line 159 "bfin-lex.l" -return GT; - YY_BREAK -case 101: -YY_RULE_SETUP -#line 160 "bfin-lex.l" -return GE; - YY_BREAK -case 102: -YY_RULE_SETUP -#line 161 "bfin-lex.l" -yylval.value = M_FU; return MMOD; - YY_BREAK -case 103: -YY_RULE_SETUP -#line 162 "bfin-lex.l" -_REG.regno = REG_FP; return REG; - YY_BREAK -case 104: -YY_RULE_SETUP -#line 163 "bfin-lex.l" -_REG.regno = REG_FP; return HALF_REG; - YY_BREAK -case 105: -YY_RULE_SETUP -#line 164 "bfin-lex.l" -_REG.regno = REG_FP | F_REG_HIGH; return HALF_REG; - YY_BREAK -case 106: -YY_RULE_SETUP -#line 166 "bfin-lex.l" -return EXTRACT; - YY_BREAK -case 107: -YY_RULE_SETUP -#line 167 "bfin-lex.l" -return EXPADJ; - YY_BREAK -case 108: -YY_RULE_SETUP -#line 168 "bfin-lex.l" -return EXCPT; - YY_BREAK -case 109: -YY_RULE_SETUP -#line 169 "bfin-lex.l" -return EMUEXCPT; - YY_BREAK -case 110: -YY_RULE_SETUP -#line 170 "bfin-lex.l" -return DIVS; - YY_BREAK -case 111: -YY_RULE_SETUP -#line 171 "bfin-lex.l" -return DIVQ; - YY_BREAK -case 112: -YY_RULE_SETUP -#line 172 "bfin-lex.l" -return DISALGNEXCPT; - YY_BREAK -case 113: -YY_RULE_SETUP -#line 173 "bfin-lex.l" -return DEPOSIT; - YY_BREAK -case 114: -YY_RULE_SETUP -#line 174 "bfin-lex.l" -return DBGHALT; - YY_BREAK -case 115: -YY_RULE_SETUP -#line 175 "bfin-lex.l" -return DBGCMPLX; - YY_BREAK -case 116: -YY_RULE_SETUP -#line 176 "bfin-lex.l" -return DBGAL; - YY_BREAK -case 117: -YY_RULE_SETUP -#line 177 "bfin-lex.l" -return DBGAH; - YY_BREAK -case 118: -YY_RULE_SETUP -#line 178 "bfin-lex.l" -return DBGA; - YY_BREAK -case 119: -YY_RULE_SETUP -#line 179 "bfin-lex.l" -return DBG; - YY_BREAK -case 120: -YY_RULE_SETUP -#line 180 "bfin-lex.l" -{ _REG.regno = REG_CYCLES2; return REG; } - YY_BREAK -case 121: -YY_RULE_SETUP -#line 181 "bfin-lex.l" -{ _REG.regno = REG_CYCLES; return REG; } - YY_BREAK -case 122: -YY_RULE_SETUP -#line 182 "bfin-lex.l" -return CSYNC; - YY_BREAK -case 123: -YY_RULE_SETUP -#line 183 "bfin-lex.l" -return CO; - YY_BREAK -case 124: -YY_RULE_SETUP -#line 184 "bfin-lex.l" -return CLI; - YY_BREAK -case 125: -YY_RULE_SETUP -#line 186 "bfin-lex.l" -_REG.regno = REG_CC; return CCREG; - YY_BREAK -case 126: -YY_RULE_SETUP -#line 187 "bfin-lex.l" -{ BEGIN 0; return CALL;} - YY_BREAK -case 127: -YY_RULE_SETUP -#line 188 "bfin-lex.l" -{ BEGIN 0; return CALL;} - YY_BREAK -case 128: -YY_RULE_SETUP -#line 189 "bfin-lex.l" -return BYTEUNPACK; - YY_BREAK -case 129: -YY_RULE_SETUP -#line 190 "bfin-lex.l" -return BYTEPACK; - YY_BREAK -case 130: -YY_RULE_SETUP -#line 191 "bfin-lex.l" -return BYTEOP16M; - YY_BREAK -case 131: -YY_RULE_SETUP -#line 192 "bfin-lex.l" -return BYTEOP16P; - YY_BREAK -case 132: -YY_RULE_SETUP -#line 193 "bfin-lex.l" -return BYTEOP3P; - YY_BREAK -case 133: -YY_RULE_SETUP -#line 194 "bfin-lex.l" -return BYTEOP2M; - YY_BREAK -case 134: -YY_RULE_SETUP -#line 195 "bfin-lex.l" -return BYTEOP2P; - YY_BREAK -case 135: -YY_RULE_SETUP -#line 196 "bfin-lex.l" -return BYTEOP1P; - YY_BREAK -case 136: -YY_RULE_SETUP -#line 197 "bfin-lex.l" -return BY; - YY_BREAK -case 137: -YY_RULE_SETUP -#line 198 "bfin-lex.l" -return BXORSHIFT; - YY_BREAK -case 138: -YY_RULE_SETUP -#line 199 "bfin-lex.l" -return BXOR; - YY_BREAK -case 139: -YY_RULE_SETUP -#line 201 "bfin-lex.l" -return BREV; - YY_BREAK -case 140: -YY_RULE_SETUP -#line 202 "bfin-lex.l" -return BP; - YY_BREAK -case 141: -YY_RULE_SETUP -#line 203 "bfin-lex.l" -return BITTST; - YY_BREAK -case 142: -YY_RULE_SETUP -#line 204 "bfin-lex.l" -return BITTGL; - YY_BREAK -case 143: -YY_RULE_SETUP -#line 205 "bfin-lex.l" -return BITSET; - YY_BREAK -case 144: -YY_RULE_SETUP -#line 206 "bfin-lex.l" -return BITMUX; - YY_BREAK -case 145: -YY_RULE_SETUP -#line 207 "bfin-lex.l" -return BITCLR; - YY_BREAK -case 146: -YY_RULE_SETUP -#line 208 "bfin-lex.l" -return parse_halfreg (&yylval.reg, T_REG_B, yytext); - YY_BREAK -case 147: -YY_RULE_SETUP -#line 209 "bfin-lex.l" -return parse_reg (&yylval.reg, T_REG_B, yytext); - YY_BREAK -case 148: -YY_RULE_SETUP -#line 210 "bfin-lex.l" -return B; - YY_BREAK -case 149: -YY_RULE_SETUP -#line 211 "bfin-lex.l" -_REG.regno = S_AZ; return STATUS_REG; - YY_BREAK -case 150: -YY_RULE_SETUP -#line 212 "bfin-lex.l" -_REG.regno = S_AN; return STATUS_REG; - YY_BREAK -case 151: -YY_RULE_SETUP -#line 213 "bfin-lex.l" -_REG.regno = S_AQ; return STATUS_REG; - YY_BREAK -case 152: -YY_RULE_SETUP -#line 214 "bfin-lex.l" -_REG.regno = S_AC0; return STATUS_REG; - YY_BREAK -case 153: -YY_RULE_SETUP -#line 215 "bfin-lex.l" -_REG.regno = S_AC1; return STATUS_REG; - YY_BREAK -case 154: -YY_RULE_SETUP -#line 216 "bfin-lex.l" -_REG.regno = S_AV0; return STATUS_REG; - YY_BREAK -case 155: -YY_RULE_SETUP -#line 217 "bfin-lex.l" -_REG.regno = S_AV0S; return STATUS_REG; - YY_BREAK -case 156: -YY_RULE_SETUP -#line 218 "bfin-lex.l" -_REG.regno = S_AV1; return STATUS_REG; - YY_BREAK -case 157: -YY_RULE_SETUP -#line 219 "bfin-lex.l" -_REG.regno = S_AV1S; return STATUS_REG; - YY_BREAK -case 158: -YY_RULE_SETUP -#line 220 "bfin-lex.l" -_REG.regno = S_V; return STATUS_REG; - YY_BREAK -case 159: -YY_RULE_SETUP -#line 221 "bfin-lex.l" -_REG.regno = S_VS; return STATUS_REG; - YY_BREAK -case 160: -YY_RULE_SETUP -#line 224 "bfin-lex.l" -_REG.regno = REG_ASTAT; return REG; - YY_BREAK -case 161: -YY_RULE_SETUP -#line 225 "bfin-lex.l" -return ASHIFT; - YY_BREAK -case 162: -YY_RULE_SETUP -#line 226 "bfin-lex.l" -return ASL; - YY_BREAK -case 163: -YY_RULE_SETUP -#line 227 "bfin-lex.l" -return ASR; - YY_BREAK -case 164: -YY_RULE_SETUP -#line 228 "bfin-lex.l" -return ALIGN8; - YY_BREAK -case 165: -YY_RULE_SETUP -#line 229 "bfin-lex.l" -return ALIGN16; - YY_BREAK -case 166: -YY_RULE_SETUP -#line 230 "bfin-lex.l" -return ALIGN24; - YY_BREAK -case 167: -YY_RULE_SETUP -#line 231 "bfin-lex.l" -return A_ONE_DOT_L; - YY_BREAK -case 168: -YY_RULE_SETUP -#line 232 "bfin-lex.l" -return A_ZERO_DOT_L; - YY_BREAK -case 169: -YY_RULE_SETUP -#line 233 "bfin-lex.l" -return A_ONE_DOT_H; - YY_BREAK -case 170: -YY_RULE_SETUP -#line 234 "bfin-lex.l" -return A_ZERO_DOT_H; - YY_BREAK -case 171: -YY_RULE_SETUP -#line 235 "bfin-lex.l" -return ABS; - YY_BREAK -case 172: -YY_RULE_SETUP -#line 236 "bfin-lex.l" -return ABORT; - YY_BREAK -case 173: -YY_RULE_SETUP -#line 237 "bfin-lex.l" -_REG.regno = REG_A1x; return REG; - YY_BREAK -case 174: -YY_RULE_SETUP -#line 238 "bfin-lex.l" -_REG.regno = REG_A1w; return REG; - YY_BREAK -case 175: -YY_RULE_SETUP -#line 239 "bfin-lex.l" -_REG.regno = REG_A1; return REG_A_DOUBLE_ONE; - YY_BREAK -case 176: -YY_RULE_SETUP -#line 240 "bfin-lex.l" -_REG.regno = REG_A0x; return REG; - YY_BREAK -case 177: -YY_RULE_SETUP -#line 241 "bfin-lex.l" -_REG.regno = REG_A0w; return REG; - YY_BREAK -case 178: -YY_RULE_SETUP -#line 242 "bfin-lex.l" -_REG.regno = REG_A0; return REG_A_DOUBLE_ZERO; - YY_BREAK -case 179: -YY_RULE_SETUP -#line 243 "bfin-lex.l" -return GOT; - YY_BREAK -case 180: -YY_RULE_SETUP -#line 244 "bfin-lex.l" -return GOT17M4; - YY_BREAK -case 181: -YY_RULE_SETUP -#line 245 "bfin-lex.l" -return FUNCDESC_GOT17M4; - YY_BREAK -case 182: -YY_RULE_SETUP -#line 246 "bfin-lex.l" -return PLTPC; - YY_BREAK -case 183: -YY_RULE_SETUP -#line 249 "bfin-lex.l" -return TILDA; - YY_BREAK -case 184: -YY_RULE_SETUP -#line 250 "bfin-lex.l" -return _BAR_ASSIGN; - YY_BREAK -case 185: -YY_RULE_SETUP -#line 251 "bfin-lex.l" -return BAR; - YY_BREAK -case 186: -YY_RULE_SETUP -#line 252 "bfin-lex.l" -return _CARET_ASSIGN; - YY_BREAK -case 187: -YY_RULE_SETUP -#line 253 "bfin-lex.l" -return CARET; - YY_BREAK -case 188: -YY_RULE_SETUP -#line 254 "bfin-lex.l" -return RBRACK; - YY_BREAK -case 189: -YY_RULE_SETUP -#line 255 "bfin-lex.l" -return LBRACK; - YY_BREAK -case 190: -YY_RULE_SETUP -#line 256 "bfin-lex.l" -return _GREATER_GREATER_GREATER_THAN_ASSIGN; - YY_BREAK -case 191: -YY_RULE_SETUP -#line 257 "bfin-lex.l" -return _GREATER_GREATER_ASSIGN; - YY_BREAK -case 192: -YY_RULE_SETUP -#line 258 "bfin-lex.l" -return _GREATER_GREATER_GREATER; - YY_BREAK -case 193: -YY_RULE_SETUP -#line 259 "bfin-lex.l" -return GREATER_GREATER; - YY_BREAK -case 194: -YY_RULE_SETUP -#line 260 "bfin-lex.l" -return _ASSIGN_ASSIGN; - YY_BREAK -case 195: -YY_RULE_SETUP -#line 261 "bfin-lex.l" -return ASSIGN; - YY_BREAK -case 196: -YY_RULE_SETUP -#line 262 "bfin-lex.l" -return _LESS_THAN_ASSIGN; - YY_BREAK -case 197: -YY_RULE_SETUP -#line 263 "bfin-lex.l" -return _LESS_LESS_ASSIGN; - YY_BREAK -case 198: -YY_RULE_SETUP -#line 264 "bfin-lex.l" -return LESS_LESS; - YY_BREAK -case 199: -YY_RULE_SETUP -#line 265 "bfin-lex.l" -return LESS_THAN; - YY_BREAK -case 200: -YY_RULE_SETUP -#line 266 "bfin-lex.l" -return LPAREN; - YY_BREAK -case 201: -YY_RULE_SETUP -#line 267 "bfin-lex.l" -return RPAREN; - YY_BREAK -case 202: -YY_RULE_SETUP -#line 268 "bfin-lex.l" -return COLON; - YY_BREAK -case 203: -YY_RULE_SETUP -#line 269 "bfin-lex.l" -return SLASH; - YY_BREAK -case 204: -YY_RULE_SETUP -#line 270 "bfin-lex.l" -return _MINUS_ASSIGN; - YY_BREAK -case 205: -YY_RULE_SETUP -#line 271 "bfin-lex.l" -return _PLUS_BAR_PLUS; - YY_BREAK -case 206: -YY_RULE_SETUP -#line 272 "bfin-lex.l" -return _MINUS_BAR_PLUS; - YY_BREAK -case 207: -YY_RULE_SETUP -#line 273 "bfin-lex.l" -return _PLUS_BAR_MINUS; - YY_BREAK -case 208: -YY_RULE_SETUP -#line 274 "bfin-lex.l" -return _MINUS_BAR_MINUS; - YY_BREAK -case 209: -YY_RULE_SETUP -#line 275 "bfin-lex.l" -return _MINUS_MINUS; - YY_BREAK -case 210: -YY_RULE_SETUP -#line 276 "bfin-lex.l" -return MINUS; - YY_BREAK -case 211: -YY_RULE_SETUP -#line 277 "bfin-lex.l" -return COMMA; - YY_BREAK -case 212: -YY_RULE_SETUP -#line 278 "bfin-lex.l" -return _PLUS_ASSIGN; - YY_BREAK -case 213: -YY_RULE_SETUP -#line 279 "bfin-lex.l" -return _PLUS_PLUS; - YY_BREAK -case 214: -YY_RULE_SETUP -#line 280 "bfin-lex.l" -return PLUS; - YY_BREAK -case 215: -YY_RULE_SETUP -#line 281 "bfin-lex.l" -return _STAR_ASSIGN; - YY_BREAK -case 216: -YY_RULE_SETUP -#line 282 "bfin-lex.l" -return STAR; - YY_BREAK -case 217: -YY_RULE_SETUP -#line 283 "bfin-lex.l" -return _AMPERSAND_ASSIGN; - YY_BREAK -case 218: -YY_RULE_SETUP -#line 284 "bfin-lex.l" -return AMPERSAND; - YY_BREAK -case 219: -YY_RULE_SETUP -#line 285 "bfin-lex.l" -return PERCENT; - YY_BREAK -case 220: -YY_RULE_SETUP -#line 286 "bfin-lex.l" -return BANG; - YY_BREAK -case 221: -YY_RULE_SETUP -#line 287 "bfin-lex.l" -return SEMICOLON; - YY_BREAK -case 222: -YY_RULE_SETUP -#line 288 "bfin-lex.l" -return _ASSIGN_BANG; - YY_BREAK -case 223: -YY_RULE_SETUP -#line 289 "bfin-lex.l" -return DOUBLE_BAR; - YY_BREAK -case 224: -YY_RULE_SETUP -#line 290 "bfin-lex.l" -return AT; - YY_BREAK -case 225: -YY_RULE_SETUP -#line 291 "bfin-lex.l" -return PREFETCH; - YY_BREAK -case 226: -YY_RULE_SETUP -#line 292 "bfin-lex.l" -return UNLINK; - YY_BREAK -case 227: -YY_RULE_SETUP -#line 293 "bfin-lex.l" -return LINK; - YY_BREAK -case 228: -YY_RULE_SETUP -#line 294 "bfin-lex.l" -return IDLE; - YY_BREAK -case 229: -YY_RULE_SETUP -#line 295 "bfin-lex.l" -return IFLUSH; - YY_BREAK -case 230: -YY_RULE_SETUP -#line 296 "bfin-lex.l" -return FLUSHINV; - YY_BREAK -case 231: -YY_RULE_SETUP -#line 297 "bfin-lex.l" -return FLUSH; - YY_BREAK -case 232: -YY_RULE_SETUP -#line 298 "bfin-lex.l" -{ - yylval.value = parse_int (&yytext); - return NUMBER; - } - YY_BREAK -case 233: -YY_RULE_SETUP -#line 302 "bfin-lex.l" -{ - yylval.symbol = symbol_find_or_make (yytext); - symbol_mark_used (yylval.symbol); - return SYMBOL; - } - YY_BREAK -case 234: -YY_RULE_SETUP -#line 307 "bfin-lex.l" -{ - char *name; - char *ref = strdup (yytext); - if (ref[1] == 'b' || ref[1] == 'B') - { - name = fb_label_name ((int) (ref[0] - '0'), 0); - yylval.symbol = symbol_find (name); - - if ((yylval.symbol != NULL) - && (S_IS_DEFINED (yylval.symbol))) - return SYMBOL; - as_bad ("backward reference to unknown label %d:", - (int) (ref[0] - '0')); - } - else if (ref[1] == 'f' || ref[1] == 'F') - { - /* Forward reference. Expect symbol to be undefined or - unknown. undefined: seen it before. unknown: never seen - it before. - - Construct a local label name, then an undefined symbol. - Just return it as never seen before. */ - - name = fb_label_name ((int) (ref[0] - '0'), 1); - yylval.symbol = symbol_find_or_make (name); - /* We have no need to check symbol properties. */ - return SYMBOL; - } - } - YY_BREAK -case 235: -YY_RULE_SETUP -#line 336 "bfin-lex.l" -; - YY_BREAK -case 236: -YY_RULE_SETUP -#line 337 "bfin-lex.l" -; - YY_BREAK -case 237: -YY_RULE_SETUP -#line 338 "bfin-lex.l" -return yytext[0]; - YY_BREAK -case 238: -YY_RULE_SETUP -#line 339 "bfin-lex.l" -ECHO; - YY_BREAK -#line 2260 "bfin-lex.c" -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(KEYWORD): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 559 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 559 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 558); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - - return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef _WIN32 -#include -#else -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -#line 339 "bfin-lex.l" - -static long parse_int (char **end) -{ - char fmt = '\0'; - int not_done = 1; - int shiftvalue = 0; - char * char_bag; - long value = 0; - char c; - char *arg = *end; - - while (*arg && *arg == ' ') - arg++; - - switch (*arg) - { - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - fmt = 'd'; - break; - - case '0': /* Accept different formated integers hex octal and binary. */ - { - c = *++arg; - arg++; - if (c == 'x' || c == 'X') /* Hex input. */ - fmt = 'h'; - else if (c == 'b' || c == 'B') - fmt = 'b'; - else if (c == '.') - fmt = 'f'; - else - { /* Octal. */ - arg--; - fmt = 'o'; - } - break; - } - - case 'd': - case 'D': - case 'h': - case 'H': - case 'o': - case 'O': - case 'b': - case 'B': - case 'f': - case 'F': - { - fmt = *arg++; - if (*arg == '#') - arg++; - } - } - - switch (fmt) - { - case 'h': - case 'H': - shiftvalue = 4; - char_bag = "0123456789ABCDEFabcdef"; - break; - - case 'o': - case 'O': - shiftvalue = 3; - char_bag = "01234567"; - break; - - case 'b': - case 'B': - shiftvalue = 1; - char_bag = "01"; - break; - -/* The assembler allows for fractional constants to be created - by either the 0.xxxx or the f#xxxx format - - i.e. 0.5 would result in 0x4000 - - note .5 would result in the identifier .5. - - The assembler converts to fractional format 1.15 by the simple rule: - - value = (short) (finput * (1 << 15)). */ - - case 'f': - case 'F': - { - float fval = 0.0; - float pos = 10.0; - while (1) - { - int c; - c = *arg++; - - if (c >= '0' && c <= '9') - { - float digit = (c - '0') / pos; - fval = fval + digit; - pos = pos * 10.0; - } - else - { - *--arg = c; - value = (short) (fval * (1 << 15)); - break; - } - } - *end = arg+1; - return value; - } - - case 'd': - case 'D': - default: - { - while (1) - { - int c; - c = *arg++; - if (c >= '0' && c <= '9') - value = (value * 10) + (c - '0'); - else - { - /* Constants that are suffixed with k|K are multiplied by 1024 - This suffix is only allowed on decimal constants. */ - if (c == 'k' || c == 'K') - value *= 1024; - else - *--arg = c; - break; - } - } - *end = arg+1; - return value; - } - } - - while (not_done) - { - char c; - c = *arg++; - if (c == 0 || !index (char_bag, c)) - { - not_done = 0; - *--arg = c; - } - else - { - if (c >= 'a' && c <= 'z') - c = c - ('a' - '9') + 1; - else if (c >= 'A' && c <= 'Z') - c = c - ('A' - '9') + 1; - - c -= '0'; - value = (value << shiftvalue) + c; - } - } - *end = arg+1; - return value; -} - - -static int parse_reg (Register *r, int cl, char *rt) -{ - r->regno = cl | (rt[1] - '0'); - return REG; -} - -static int parse_halfreg (Register *r, int cl, char *rt) -{ - r->regno = cl | (rt[1] - '0'); - - switch (rt[3]) - { - case 'b': - case 'B': - return BYTE_DREG; - - case 'l': - case 'L': - break; - - case 'h': - case 'H': - r->regno |= F_REG_HIGH; - break; - } - - return HALF_REG; -} - -/* Our start state is KEYWORD as we have - command keywords such as PREFETCH. */ - -void -set_start_state (void) -{ - BEGIN KEYWORD; -} - - -#ifndef yywrap -int -yywrap () -{ - return 1; -} -#endif diff --git a/gas/bfin-parse.c b/gas/bfin-parse.c deleted file mode 100644 index bc6728b659b..00000000000 --- a/gas/bfin-parse.c +++ /dev/null @@ -1,7491 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - 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 2, 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. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - BYTEOP16P = 258, - BYTEOP16M = 259, - BYTEOP1P = 260, - BYTEOP2P = 261, - BYTEOP2M = 262, - BYTEOP3P = 263, - BYTEUNPACK = 264, - BYTEPACK = 265, - PACK = 266, - SAA = 267, - ALIGN8 = 268, - ALIGN16 = 269, - ALIGN24 = 270, - VIT_MAX = 271, - EXTRACT = 272, - DEPOSIT = 273, - EXPADJ = 274, - SEARCH = 275, - ONES = 276, - SIGN = 277, - SIGNBITS = 278, - LINK = 279, - UNLINK = 280, - REG = 281, - PC = 282, - CCREG = 283, - BYTE_DREG = 284, - REG_A_DOUBLE_ZERO = 285, - REG_A_DOUBLE_ONE = 286, - A_ZERO_DOT_L = 287, - A_ZERO_DOT_H = 288, - A_ONE_DOT_L = 289, - A_ONE_DOT_H = 290, - HALF_REG = 291, - NOP = 292, - RTI = 293, - RTS = 294, - RTX = 295, - RTN = 296, - RTE = 297, - HLT = 298, - IDLE = 299, - STI = 300, - CLI = 301, - CSYNC = 302, - SSYNC = 303, - EMUEXCPT = 304, - RAISE = 305, - EXCPT = 306, - LSETUP = 307, - LOOP = 308, - LOOP_BEGIN = 309, - LOOP_END = 310, - DISALGNEXCPT = 311, - JUMP = 312, - JUMP_DOT_S = 313, - JUMP_DOT_L = 314, - CALL = 315, - ABORT = 316, - NOT = 317, - TILDA = 318, - BANG = 319, - AMPERSAND = 320, - BAR = 321, - PERCENT = 322, - CARET = 323, - BXOR = 324, - MINUS = 325, - PLUS = 326, - STAR = 327, - SLASH = 328, - NEG = 329, - MIN = 330, - MAX = 331, - ABS = 332, - DOUBLE_BAR = 333, - _PLUS_BAR_PLUS = 334, - _PLUS_BAR_MINUS = 335, - _MINUS_BAR_PLUS = 336, - _MINUS_BAR_MINUS = 337, - _MINUS_MINUS = 338, - _PLUS_PLUS = 339, - SHIFT = 340, - LSHIFT = 341, - ASHIFT = 342, - BXORSHIFT = 343, - _GREATER_GREATER_GREATER_THAN_ASSIGN = 344, - ROT = 345, - LESS_LESS = 346, - GREATER_GREATER = 347, - _GREATER_GREATER_GREATER = 348, - _LESS_LESS_ASSIGN = 349, - _GREATER_GREATER_ASSIGN = 350, - DIVS = 351, - DIVQ = 352, - ASSIGN = 353, - _STAR_ASSIGN = 354, - _BAR_ASSIGN = 355, - _CARET_ASSIGN = 356, - _AMPERSAND_ASSIGN = 357, - _MINUS_ASSIGN = 358, - _PLUS_ASSIGN = 359, - _ASSIGN_BANG = 360, - _LESS_THAN_ASSIGN = 361, - _ASSIGN_ASSIGN = 362, - GE = 363, - LT = 364, - LE = 365, - GT = 366, - LESS_THAN = 367, - FLUSHINV = 368, - FLUSH = 369, - IFLUSH = 370, - PREFETCH = 371, - PRNT = 372, - OUTC = 373, - WHATREG = 374, - TESTSET = 375, - ASL = 376, - ASR = 377, - B = 378, - W = 379, - NS = 380, - S = 381, - CO = 382, - SCO = 383, - TH = 384, - TL = 385, - BP = 386, - BREV = 387, - X = 388, - Z = 389, - M = 390, - MMOD = 391, - R = 392, - RND = 393, - RNDL = 394, - RNDH = 395, - RND12 = 396, - RND20 = 397, - V = 398, - LO = 399, - HI = 400, - BITTGL = 401, - BITCLR = 402, - BITSET = 403, - BITTST = 404, - BITMUX = 405, - DBGAL = 406, - DBGAH = 407, - DBGHALT = 408, - DBG = 409, - DBGA = 410, - DBGCMPLX = 411, - IF = 412, - COMMA = 413, - BY = 414, - COLON = 415, - SEMICOLON = 416, - RPAREN = 417, - LPAREN = 418, - LBRACK = 419, - RBRACK = 420, - STATUS_REG = 421, - MNOP = 422, - SYMBOL = 423, - NUMBER = 424, - GOT = 425, - GOT17M4 = 426, - FUNCDESC_GOT17M4 = 427, - AT = 428, - PLTPC = 429 - }; -#endif -/* Tokens. */ -#define BYTEOP16P 258 -#define BYTEOP16M 259 -#define BYTEOP1P 260 -#define BYTEOP2P 261 -#define BYTEOP2M 262 -#define BYTEOP3P 263 -#define BYTEUNPACK 264 -#define BYTEPACK 265 -#define PACK 266 -#define SAA 267 -#define ALIGN8 268 -#define ALIGN16 269 -#define ALIGN24 270 -#define VIT_MAX 271 -#define EXTRACT 272 -#define DEPOSIT 273 -#define EXPADJ 274 -#define SEARCH 275 -#define ONES 276 -#define SIGN 277 -#define SIGNBITS 278 -#define LINK 279 -#define UNLINK 280 -#define REG 281 -#define PC 282 -#define CCREG 283 -#define BYTE_DREG 284 -#define REG_A_DOUBLE_ZERO 285 -#define REG_A_DOUBLE_ONE 286 -#define A_ZERO_DOT_L 287 -#define A_ZERO_DOT_H 288 -#define A_ONE_DOT_L 289 -#define A_ONE_DOT_H 290 -#define HALF_REG 291 -#define NOP 292 -#define RTI 293 -#define RTS 294 -#define RTX 295 -#define RTN 296 -#define RTE 297 -#define HLT 298 -#define IDLE 299 -#define STI 300 -#define CLI 301 -#define CSYNC 302 -#define SSYNC 303 -#define EMUEXCPT 304 -#define RAISE 305 -#define EXCPT 306 -#define LSETUP 307 -#define LOOP 308 -#define LOOP_BEGIN 309 -#define LOOP_END 310 -#define DISALGNEXCPT 311 -#define JUMP 312 -#define JUMP_DOT_S 313 -#define JUMP_DOT_L 314 -#define CALL 315 -#define ABORT 316 -#define NOT 317 -#define TILDA 318 -#define BANG 319 -#define AMPERSAND 320 -#define BAR 321 -#define PERCENT 322 -#define CARET 323 -#define BXOR 324 -#define MINUS 325 -#define PLUS 326 -#define STAR 327 -#define SLASH 328 -#define NEG 329 -#define MIN 330 -#define MAX 331 -#define ABS 332 -#define DOUBLE_BAR 333 -#define _PLUS_BAR_PLUS 334 -#define _PLUS_BAR_MINUS 335 -#define _MINUS_BAR_PLUS 336 -#define _MINUS_BAR_MINUS 337 -#define _MINUS_MINUS 338 -#define _PLUS_PLUS 339 -#define SHIFT 340 -#define LSHIFT 341 -#define ASHIFT 342 -#define BXORSHIFT 343 -#define _GREATER_GREATER_GREATER_THAN_ASSIGN 344 -#define ROT 345 -#define LESS_LESS 346 -#define GREATER_GREATER 347 -#define _GREATER_GREATER_GREATER 348 -#define _LESS_LESS_ASSIGN 349 -#define _GREATER_GREATER_ASSIGN 350 -#define DIVS 351 -#define DIVQ 352 -#define ASSIGN 353 -#define _STAR_ASSIGN 354 -#define _BAR_ASSIGN 355 -#define _CARET_ASSIGN 356 -#define _AMPERSAND_ASSIGN 357 -#define _MINUS_ASSIGN 358 -#define _PLUS_ASSIGN 359 -#define _ASSIGN_BANG 360 -#define _LESS_THAN_ASSIGN 361 -#define _ASSIGN_ASSIGN 362 -#define GE 363 -#define LT 364 -#define LE 365 -#define GT 366 -#define LESS_THAN 367 -#define FLUSHINV 368 -#define FLUSH 369 -#define IFLUSH 370 -#define PREFETCH 371 -#define PRNT 372 -#define OUTC 373 -#define WHATREG 374 -#define TESTSET 375 -#define ASL 376 -#define ASR 377 -#define B 378 -#define W 379 -#define NS 380 -#define S 381 -#define CO 382 -#define SCO 383 -#define TH 384 -#define TL 385 -#define BP 386 -#define BREV 387 -#define X 388 -#define Z 389 -#define M 390 -#define MMOD 391 -#define R 392 -#define RND 393 -#define RNDL 394 -#define RNDH 395 -#define RND12 396 -#define RND20 397 -#define V 398 -#define LO 399 -#define HI 400 -#define BITTGL 401 -#define BITCLR 402 -#define BITSET 403 -#define BITTST 404 -#define BITMUX 405 -#define DBGAL 406 -#define DBGAH 407 -#define DBGHALT 408 -#define DBG 409 -#define DBGA 410 -#define DBGCMPLX 411 -#define IF 412 -#define COMMA 413 -#define BY 414 -#define COLON 415 -#define SEMICOLON 416 -#define RPAREN 417 -#define LPAREN 418 -#define LBRACK 419 -#define RBRACK 420 -#define STATUS_REG 421 -#define MNOP 422 -#define SYMBOL 423 -#define NUMBER 424 -#define GOT 425 -#define GOT17M4 426 -#define FUNCDESC_GOT17M4 427 -#define AT 428 -#define PLTPC 429 - - - - -/* Copy the first part of user declarations. */ -#line 21 "bfin-parse.y" - - -#include -#include -#include - -#include "bfin-aux.h" // opcode generating auxiliaries -#include "libbfd.h" -#include "elf/common.h" -#include "elf/bfin.h" - -#define DSP32ALU(aopcde, HL, dst1, dst0, src0, src1, s, x, aop) \ - bfin_gen_dsp32alu (HL, aopcde, aop, s, x, dst0, dst1, src0, src1) - -#define DSP32MAC(op1, MM, mmod, w1, P, h01, h11, h00, h10, dst, op0, src0, src1, w0) \ - bfin_gen_dsp32mac (op1, MM, mmod, w1, P, h01, h11, h00, h10, op0, \ - dst, src0, src1, w0) - -#define DSP32MULT(op1, MM, mmod, w1, P, h01, h11, h00, h10, dst, op0, src0, src1, w0) \ - bfin_gen_dsp32mult (op1, MM, mmod, w1, P, h01, h11, h00, h10, op0, \ - dst, src0, src1, w0) - -#define DSP32SHIFT(sopcde, dst0, src0, src1, sop, hls) \ - bfin_gen_dsp32shift (sopcde, dst0, src0, src1, sop, hls) - -#define DSP32SHIFTIMM(sopcde, dst0, immag, src1, sop, hls) \ - bfin_gen_dsp32shiftimm (sopcde, dst0, immag, src1, sop, hls) - -#define LDIMMHALF_R(reg, h, s, z, hword) \ - bfin_gen_ldimmhalf (reg, h, s, z, hword, 1) - -#define LDIMMHALF_R5(reg, h, s, z, hword) \ - bfin_gen_ldimmhalf (reg, h, s, z, hword, 2) - -#define LDSTIDXI(ptr, reg, w, sz, z, offset) \ - bfin_gen_ldstidxi (ptr, reg, w, sz, z, offset) - -#define LDST(ptr, reg, aop, sz, z, w) \ - bfin_gen_ldst (ptr, reg, aop, sz, z, w) - -#define LDSTII(ptr, reg, offset, w, op) \ - bfin_gen_ldstii (ptr, reg, offset, w, op) - -#define DSPLDST(i, m, reg, aop, w) \ - bfin_gen_dspldst (i, reg, aop, w, m) - -#define LDSTPMOD(ptr, reg, idx, aop, w) \ - bfin_gen_ldstpmod (ptr, reg, aop, w, idx) - -#define LDSTIIFP(offset, reg, w) \ - bfin_gen_ldstiifp (reg, offset, w) - -#define LOGI2OP(dst, src, opc) \ - bfin_gen_logi2op (opc, src, dst.regno & CODE_MASK) - -#define ALU2OP(dst, src, opc) \ - bfin_gen_alu2op (dst, src, opc) - -#define BRCC(t, b, offset) \ - bfin_gen_brcc (t, b, offset) - -#define UJUMP(offset) \ - bfin_gen_ujump (offset) - -#define PROGCTRL(prgfunc, poprnd) \ - bfin_gen_progctrl (prgfunc, poprnd) - -#define PUSHPOPMULTIPLE(dr, pr, d, p, w) \ - bfin_gen_pushpopmultiple (dr, pr, d, p, w) - -#define PUSHPOPREG(reg, w) \ - bfin_gen_pushpopreg (reg, w) - -#define CALLA(addr, s) \ - bfin_gen_calla (addr, s) - -#define LINKAGE(r, framesize) \ - bfin_gen_linkage (r, framesize) - -#define COMPI2OPD(dst, src, op) \ - bfin_gen_compi2opd (dst, src, op) - -#define COMPI2OPP(dst, src, op) \ - bfin_gen_compi2opp (dst, src, op) - -#define DAGMODIK(i, op) \ - bfin_gen_dagmodik (i, op) - -#define DAGMODIM(i, m, op, br) \ - bfin_gen_dagmodim (i, m, op, br) - -#define COMP3OP(dst, src0, src1, opc) \ - bfin_gen_comp3op (src0, src1, dst, opc) - -#define PTR2OP(dst, src, opc) \ - bfin_gen_ptr2op (dst, src, opc) - -#define CCFLAG(x, y, opc, i, g) \ - bfin_gen_ccflag (x, y, opc, i, g) - -#define CCMV(src, dst, t) \ - bfin_gen_ccmv (src, dst, t) - -#define CACTRL(reg, a, op) \ - bfin_gen_cactrl (reg, a, op) - -#define LOOPSETUP(soffset, c, rop, eoffset, reg) \ - bfin_gen_loopsetup (soffset, c, rop, eoffset, reg) - -#define HL2(r1, r0) (IS_H (r1) << 1 | IS_H (r0)) -#define IS_RANGE(bits, expr, sign, mul) \ - value_match(expr, bits, sign, mul, 1) -#define IS_URANGE(bits, expr, sign, mul) \ - value_match(expr, bits, sign, mul, 0) -#define IS_CONST(expr) (expr->type == Expr_Node_Constant) -#define IS_RELOC(expr) (expr->type != Expr_Node_Constant) -#define IS_IMM(expr, bits) value_match (expr, bits, 0, 1, 1) -#define IS_UIMM(expr, bits) value_match (expr, bits, 0, 1, 0) - -#define IS_PCREL4(expr) \ - (value_match (expr, 4, 0, 2, 0)) - -#define IS_LPPCREL10(expr) \ - (value_match (expr, 10, 0, 2, 0)) - -#define IS_PCREL10(expr) \ - (value_match (expr, 10, 0, 2, 1)) - -#define IS_PCREL12(expr) \ - (value_match (expr, 12, 0, 2, 1)) - -#define IS_PCREL24(expr) \ - (value_match (expr, 24, 0, 2, 1)) - - -static int value_match (Expr_Node *expr, int sz, int sign, int mul, int issigned); - -extern FILE *errorf; -extern INSTR_T insn; - -static Expr_Node *binary (Expr_Op_Type, Expr_Node *, Expr_Node *); -static Expr_Node *unary (Expr_Op_Type, Expr_Node *); - -static void notethat (char *format, ...); - -char *current_inputline; -extern char *yytext; -int yyerror (char *msg); - -void error (char *format, ...) -{ - va_list ap; - char buffer[2000]; - - va_start (ap, format); - vsprintf (buffer, format, ap); - va_end (ap); - - as_bad (buffer); -} - -int -yyerror (char *msg) -{ - if (msg[0] == '\0') - error ("%s", msg); - - else if (yytext[0] != ';') - error ("%s. Input text was %s.", msg, yytext); - else - error ("%s.", msg); - - return -1; -} - -static int -in_range_p (Expr_Node *expr, int from, int to, unsigned int mask) -{ - int val = EXPR_VALUE (expr); - if (expr->type != Expr_Node_Constant) - return 0; - if (val < from || val > to) - return 0; - return (val & mask) == 0; -} - -extern int yylex (void); - -#define imm3(x) EXPR_VALUE (x) -#define imm4(x) EXPR_VALUE (x) -#define uimm4(x) EXPR_VALUE (x) -#define imm5(x) EXPR_VALUE (x) -#define uimm5(x) EXPR_VALUE (x) -#define imm6(x) EXPR_VALUE (x) -#define imm7(x) EXPR_VALUE (x) -#define imm16(x) EXPR_VALUE (x) -#define uimm16s4(x) ((EXPR_VALUE (x)) >> 2) -#define uimm16(x) EXPR_VALUE (x) - -/* Return true if a value is inside a range. */ -#define IN_RANGE(x, low, high) \ - (((EXPR_VALUE(x)) >= (low)) && (EXPR_VALUE(x)) <= ((high))) - -/* Auxiliary functions. */ - -static void -neg_value (Expr_Node *expr) -{ - expr->value.i_value = -expr->value.i_value; -} - -static int -valid_dreg_pair (Register *reg1, Expr_Node *reg2) -{ - if (!IS_DREG (*reg1)) - { - yyerror ("Dregs expected"); - return 0; - } - - if (reg1->regno != 1 && reg1->regno != 3) - { - yyerror ("Bad register pair"); - return 0; - } - - if (imm7 (reg2) != reg1->regno - 1) - { - yyerror ("Bad register pair"); - return 0; - } - - reg1->regno--; - return 1; -} - -static int -check_multiply_halfregs (Macfunc *aa, Macfunc *ab) -{ - if ((!REG_EQUAL (aa->s0, ab->s0) && !REG_EQUAL (aa->s0, ab->s1)) - || (!REG_EQUAL (aa->s1, ab->s1) && !REG_EQUAL (aa->s1, ab->s0))) - return yyerror ("Source multiplication register mismatch"); - - return 0; -} - - -/* Check (vector) mac funcs and ops. */ - -static int -check_macfuncs (Macfunc *aa, Opt_mode *opa, - Macfunc *ab, Opt_mode *opb) -{ - /* Variables for swapping. */ - Macfunc mtmp; - Opt_mode otmp; - - /* If a0macfunc comes before a1macfunc, swap them. */ - - if (aa->n == 0) - { - /* (M) is not allowed here. */ - if (opa->MM != 0) - return yyerror ("(M) not allowed with A0MAC"); - if (ab->n != 1) - return yyerror ("Vector AxMACs can't be same"); - - mtmp = *aa; *aa = *ab; *ab = mtmp; - otmp = *opa; *opa = *opb; *opb = otmp; - } - else - { - if (opb->MM != 0) - return yyerror ("(M) not allowed with A0MAC"); - if (opa->mod != 0) - return yyerror ("Bad opt mode"); - if (ab->n != 0) - return yyerror ("Vector AxMACs can't be same"); - } - - /* If both ops are != 3, we have multiply_halfregs in both - assignment_or_macfuncs. */ - if (aa->op == ab->op && aa->op != 3) - { - if (check_multiply_halfregs (aa, ab) < 0) - return -1; - } - else - { - /* Only one of the assign_macfuncs has a half reg multiply - Evil trick: Just 'OR' their source register codes: - We can do that, because we know they were initialized to 0 - in the rules that don't use multiply_halfregs. */ - aa->s0.regno |= (ab->s0.regno & CODE_MASK); - aa->s1.regno |= (ab->s1.regno & CODE_MASK); - } - - if (aa->w == ab->w && aa->P != ab->P) - { - return yyerror ("macfuncs must differ"); - if (aa->w && (aa->dst.regno - ab->dst.regno != 1)) - return yyerror ("Destination Dregs must differ by one"); - } - /* We assign to full regs, thus obey even/odd rules. */ - else if ((aa->w && aa->P && IS_EVEN (aa->dst)) - || (ab->w && ab->P && !IS_EVEN (ab->dst))) - return yyerror ("Even/Odd register assignment mismatch"); - /* We assign to half regs, thus obey hi/low rules. */ - else if ( (aa->w && !aa->P && !IS_H (aa->dst)) - || (ab->w && !aa->P && IS_H (ab->dst))) - return yyerror ("High/Low register assignment mismatch"); - - /* Make sure first macfunc has got both P flags ORed. */ - aa->P |= ab->P; - - /* Make sure mod flags get ORed, too. */ - opb->mod |= opa->mod; - return 0; -} - - -static int -is_group1 (INSTR_T x) -{ - /* Group1 is dpsLDST, LDSTpmod, LDST, LDSTiiFP, LDSTii. */ - if ((x->value & 0xc000) == 0x8000 || (x->value == 0x0000)) - return 1; - - return 0; -} - -static int -is_group2 (INSTR_T x) -{ - if ((((x->value & 0xfc00) == 0x9c00) /* dspLDST. */ - && !((x->value & 0xfde0) == 0x9c60) /* dagMODim. */ - && !((x->value & 0xfde0) == 0x9ce0) /* dagMODim with bit rev. */ - && !((x->value & 0xfde0) == 0x9d60)) /* pick dagMODik. */ - || (x->value == 0x0000)) - return 1; - return 0; -} - - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 366 "bfin-parse.y" -typedef union YYSTYPE { - INSTR_T instr; - Expr_Node *expr; - SYMBOL_T symbol; - long value; - Register reg; - Macfunc macfunc; - struct { int r0; int s0; int x0; int aop; } modcodes; - struct { int r0; } r0; - Opt_mode mod; -} YYSTYPE; -/* Line 196 of yacc.c. */ -#line 790 "bfin-parse.c" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 219 of yacc.c. */ -#line 802 "bfin-parse.c" - -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -#if ! defined (yyoverflow) || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# else -# define YYSTACK_ALLOC alloca -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYINCLUDED_STDLIB_H -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) -# endif -# ifdef __cplusplus -extern "C" { -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifdef __cplusplus -} -# endif -# endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ - - -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short int yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short int yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 149 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1315 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 175 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 47 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 349 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 1024 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 429 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const unsigned short int yyprhs[] = -{ - 0, 0, 3, 4, 6, 9, 16, 21, 23, 25, - 28, 34, 36, 43, 50, 54, 58, 76, 94, 106, - 118, 130, 143, 156, 169, 175, 179, 183, 187, 196, - 210, 223, 237, 251, 265, 274, 292, 299, 309, 313, - 320, 324, 330, 337, 346, 355, 358, 361, 366, 370, - 373, 378, 382, 389, 394, 402, 410, 414, 418, 425, - 429, 434, 438, 442, 446, 458, 470, 480, 486, 492, - 502, 508, 514, 521, 528, 534, 540, 546, 553, 560, - 566, 568, 572, 576, 580, 584, 589, 594, 604, 614, - 620, 628, 633, 640, 646, 653, 661, 671, 680, 689, - 701, 711, 716, 722, 729, 737, 744, 749, 756, 762, - 769, 776, 781, 790, 801, 812, 825, 831, 838, 844, - 851, 856, 861, 866, 874, 884, 894, 904, 911, 918, - 925, 934, 943, 950, 956, 962, 971, 976, 984, 986, - 988, 990, 992, 994, 996, 998, 1000, 1002, 1004, 1007, - 1010, 1015, 1020, 1027, 1034, 1037, 1040, 1045, 1048, 1051, - 1054, 1057, 1060, 1063, 1070, 1077, 1083, 1088, 1092, 1096, - 1100, 1104, 1108, 1112, 1117, 1120, 1125, 1128, 1133, 1136, - 1141, 1144, 1152, 1161, 1170, 1178, 1186, 1194, 1204, 1212, - 1221, 1231, 1240, 1247, 1255, 1264, 1274, 1283, 1291, 1299, - 1306, 1310, 1322, 1330, 1342, 1350, 1354, 1357, 1359, 1367, - 1377, 1389, 1393, 1399, 1407, 1409, 1412, 1415, 1420, 1422, - 1429, 1436, 1443, 1445, 1447, 1448, 1454, 1460, 1464, 1468, - 1472, 1476, 1477, 1479, 1481, 1483, 1485, 1487, 1488, 1492, - 1493, 1497, 1501, 1502, 1506, 1510, 1516, 1522, 1523, 1527, - 1531, 1532, 1536, 1540, 1541, 1545, 1549, 1553, 1559, 1565, - 1566, 1570, 1571, 1575, 1577, 1579, 1581, 1583, 1584, 1588, - 1592, 1596, 1602, 1608, 1610, 1612, 1614, 1615, 1619, 1620, - 1624, 1629, 1634, 1636, 1638, 1640, 1642, 1644, 1646, 1648, - 1650, 1654, 1658, 1662, 1666, 1672, 1678, 1684, 1690, 1694, - 1698, 1704, 1710, 1711, 1713, 1715, 1718, 1721, 1724, 1728, - 1730, 1736, 1742, 1746, 1749, 1752, 1755, 1759, 1761, 1763, - 1765, 1767, 1771, 1775, 1779, 1783, 1785, 1787, 1789, 1791, - 1795, 1797, 1799, 1803, 1805, 1807, 1811, 1814, 1817, 1819, - 1823, 1827, 1831, 1835, 1839, 1843, 1847, 1851, 1855, 1859 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const short int yyrhs[] = -{ - 176, 0, -1, -1, 177, -1, 178, 161, -1, 178, - 78, 178, 78, 178, 161, -1, 178, 78, 178, 161, - -1, 1, -1, 167, -1, 209, 180, -1, 209, 180, - 158, 209, 180, -1, 56, -1, 26, 98, 163, 208, - 179, 162, -1, 36, 98, 163, 208, 179, 162, -1, - 33, 98, 36, -1, 35, 98, 36, -1, 163, 26, - 158, 26, 162, 98, 3, 163, 26, 160, 220, 158, - 26, 160, 220, 162, 193, -1, 163, 26, 158, 26, - 162, 98, 4, 163, 26, 160, 220, 158, 26, 160, - 220, 162, 193, -1, 163, 26, 158, 26, 162, 98, - 9, 26, 160, 220, 193, -1, 163, 26, 158, 26, - 162, 98, 20, 26, 163, 192, 162, -1, 26, 98, - 34, 71, 35, 158, 26, 98, 32, 71, 33, -1, - 26, 98, 179, 71, 179, 158, 26, 98, 179, 70, - 179, 185, -1, 26, 98, 26, 202, 26, 158, 26, - 98, 26, 202, 26, 185, -1, 26, 98, 26, 201, - 26, 158, 26, 98, 26, 201, 26, 186, -1, 26, - 98, 77, 26, 190, -1, 206, 77, 179, -1, 32, - 98, 36, -1, 34, 98, 36, -1, 26, 98, 195, - 163, 26, 158, 26, 162, -1, 26, 98, 5, 163, - 26, 160, 220, 158, 26, 160, 220, 162, 194, -1, - 26, 98, 5, 163, 26, 160, 220, 158, 26, 160, - 220, 162, -1, 26, 98, 6, 163, 26, 160, 220, - 158, 26, 160, 220, 162, 203, -1, 26, 98, 7, - 163, 26, 160, 220, 158, 26, 160, 220, 162, 203, - -1, 26, 98, 8, 163, 26, 160, 220, 158, 26, - 160, 220, 162, 204, -1, 26, 98, 10, 163, 26, - 158, 26, 162, -1, 36, 98, 36, 98, 22, 163, - 36, 162, 72, 36, 71, 22, 163, 36, 162, 72, - 36, -1, 26, 98, 26, 202, 26, 185, -1, 26, - 98, 200, 163, 26, 158, 26, 162, 190, -1, 206, - 70, 179, -1, 36, 98, 36, 202, 36, 185, -1, - 206, 206, 220, -1, 206, 179, 163, 126, 162, -1, - 36, 98, 26, 163, 138, 162, -1, 36, 98, 26, - 202, 26, 163, 141, 162, -1, 36, 98, 26, 202, - 26, 163, 142, 162, -1, 206, 179, -1, 206, 26, - -1, 26, 98, 36, 187, -1, 36, 98, 220, -1, - 206, 220, -1, 26, 98, 220, 188, -1, 36, 98, - 26, -1, 26, 98, 26, 201, 26, 184, -1, 26, - 98, 29, 187, -1, 206, 77, 179, 158, 206, 77, - 179, -1, 206, 70, 179, 158, 206, 70, 179, -1, - 207, 179, 196, -1, 26, 103, 220, -1, 26, 104, - 26, 163, 132, 162, -1, 26, 103, 26, -1, 179, - 104, 179, 196, -1, 26, 104, 26, -1, 26, 104, - 220, -1, 26, 99, 26, -1, 12, 163, 26, 160, - 220, 158, 26, 160, 220, 162, 193, -1, 206, 179, - 163, 126, 162, 158, 206, 179, 163, 126, 162, -1, - 26, 98, 163, 26, 71, 26, 162, 91, 220, -1, - 26, 98, 26, 66, 26, -1, 26, 98, 26, 68, - 26, -1, 26, 98, 26, 71, 163, 26, 91, 220, - 162, -1, 28, 98, 179, 107, 179, -1, 28, 98, - 179, 112, 179, -1, 28, 98, 26, 112, 26, 197, - -1, 28, 98, 26, 112, 220, 197, -1, 28, 98, - 26, 107, 26, -1, 28, 98, 26, 107, 220, -1, - 28, 98, 179, 106, 179, -1, 28, 98, 26, 106, - 26, 197, -1, 28, 98, 26, 106, 220, 197, -1, - 26, 98, 26, 65, 26, -1, 213, -1, 26, 98, - 26, -1, 28, 98, 26, -1, 26, 98, 28, -1, - 28, 105, 28, -1, 36, 98, 211, 180, -1, 26, - 98, 211, 180, -1, 36, 98, 211, 180, 158, 36, - 98, 211, 180, -1, 26, 98, 211, 180, 158, 26, - 98, 211, 180, -1, 206, 87, 179, 159, 36, -1, - 36, 98, 87, 36, 159, 36, 191, -1, 206, 179, - 91, 220, -1, 26, 98, 26, 91, 220, 189, -1, - 36, 98, 36, 91, 220, -1, 36, 98, 36, 91, - 220, 191, -1, 26, 98, 87, 26, 159, 36, 189, - -1, 36, 98, 19, 163, 26, 158, 36, 162, 190, - -1, 36, 98, 19, 163, 36, 158, 36, 162, -1, - 26, 98, 18, 163, 26, 158, 26, 162, -1, 26, - 98, 18, 163, 26, 158, 26, 162, 163, 133, 162, - -1, 26, 98, 17, 163, 26, 158, 36, 162, 187, - -1, 206, 179, 93, 220, -1, 206, 86, 179, 159, - 36, -1, 36, 98, 86, 36, 159, 36, -1, 26, - 98, 86, 26, 159, 36, 190, -1, 26, 98, 85, - 26, 159, 36, -1, 206, 179, 92, 220, -1, 26, - 98, 26, 92, 220, 190, -1, 36, 98, 36, 92, - 220, -1, 36, 98, 36, 93, 220, 191, -1, 26, - 98, 26, 93, 220, 189, -1, 36, 98, 21, 26, - -1, 26, 98, 11, 163, 36, 158, 36, 162, -1, - 36, 98, 28, 98, 88, 163, 179, 158, 26, 162, - -1, 36, 98, 28, 98, 69, 163, 179, 158, 26, - 162, -1, 36, 98, 28, 98, 69, 163, 179, 158, - 179, 158, 28, 162, -1, 206, 90, 179, 159, 36, - -1, 26, 98, 90, 26, 159, 36, -1, 206, 90, - 179, 159, 220, -1, 26, 98, 90, 26, 159, 220, - -1, 36, 98, 23, 179, -1, 36, 98, 23, 26, - -1, 36, 98, 23, 36, -1, 36, 98, 16, 163, - 26, 162, 181, -1, 26, 98, 16, 163, 26, 158, - 26, 162, 181, -1, 150, 163, 26, 158, 26, 158, - 179, 162, 181, -1, 206, 88, 163, 179, 158, 179, - 158, 28, 162, -1, 147, 163, 26, 158, 220, 162, - -1, 148, 163, 26, 158, 220, 162, -1, 146, 163, - 26, 158, 220, 162, -1, 28, 105, 149, 163, 26, - 158, 220, 162, -1, 28, 98, 149, 163, 26, 158, - 220, 162, -1, 157, 64, 28, 26, 98, 26, -1, - 157, 28, 26, 98, 26, -1, 157, 64, 28, 57, - 220, -1, 157, 64, 28, 57, 220, 163, 131, 162, - -1, 157, 28, 57, 220, -1, 157, 28, 57, 220, - 163, 131, 162, -1, 37, -1, 39, -1, 38, -1, - 40, -1, 41, -1, 42, -1, 44, -1, 47, -1, - 48, -1, 49, -1, 46, 26, -1, 45, 26, -1, - 57, 163, 26, 162, -1, 60, 163, 26, 162, -1, - 60, 163, 27, 71, 26, 162, -1, 57, 163, 27, - 71, 26, 162, -1, 50, 220, -1, 51, 220, -1, - 120, 163, 26, 162, -1, 57, 220, -1, 58, 220, - -1, 59, 220, -1, 59, 218, -1, 60, 220, -1, - 60, 218, -1, 97, 163, 26, 158, 26, 162, -1, - 96, 163, 26, 158, 26, 162, -1, 26, 98, 70, - 26, 189, -1, 26, 98, 63, 26, -1, 26, 95, - 26, -1, 26, 95, 220, -1, 26, 89, 26, -1, - 26, 94, 26, -1, 26, 94, 220, -1, 26, 89, - 220, -1, 114, 164, 26, 165, -1, 114, 199, -1, - 113, 164, 26, 165, -1, 113, 199, -1, 115, 164, - 26, 165, -1, 115, 199, -1, 116, 164, 26, 165, - -1, 116, 199, -1, 123, 164, 26, 205, 165, 98, - 26, -1, 123, 164, 26, 202, 220, 165, 98, 26, - -1, 124, 164, 26, 202, 220, 165, 98, 26, -1, - 124, 164, 26, 205, 165, 98, 26, -1, 124, 164, - 26, 205, 165, 98, 36, -1, 164, 26, 202, 220, - 165, 98, 26, -1, 26, 98, 124, 164, 26, 202, - 220, 165, 187, -1, 36, 98, 124, 164, 26, 205, - 165, -1, 26, 98, 124, 164, 26, 205, 165, 187, - -1, 26, 98, 124, 164, 26, 84, 26, 165, 187, - -1, 36, 98, 124, 164, 26, 84, 26, 165, -1, - 164, 26, 205, 165, 98, 26, -1, 164, 26, 84, - 26, 165, 98, 26, -1, 124, 164, 26, 84, 26, - 165, 98, 36, -1, 26, 98, 123, 164, 26, 202, - 220, 165, 187, -1, 26, 98, 123, 164, 26, 205, - 165, 187, -1, 26, 98, 164, 26, 84, 26, 165, - -1, 26, 98, 164, 26, 202, 217, 165, -1, 26, - 98, 164, 26, 205, 165, -1, 220, 98, 220, -1, - 198, 98, 163, 26, 160, 220, 158, 26, 160, 220, - 162, -1, 198, 98, 163, 26, 160, 220, 162, -1, - 163, 26, 160, 220, 158, 26, 160, 220, 162, 98, - 199, -1, 163, 26, 160, 220, 162, 98, 199, -1, - 198, 98, 26, -1, 24, 220, -1, 25, -1, 52, - 163, 220, 158, 220, 162, 26, -1, 52, 163, 220, - 158, 220, 162, 26, 98, 26, -1, 52, 163, 220, - 158, 220, 162, 26, 98, 26, 92, 220, -1, 53, - 220, 26, -1, 53, 220, 26, 98, 26, -1, 53, - 220, 26, 98, 26, 92, 220, -1, 154, -1, 154, - 179, -1, 154, 26, -1, 156, 163, 26, 162, -1, - 153, -1, 155, 163, 36, 158, 220, 162, -1, 152, - 163, 26, 158, 220, 162, -1, 151, 163, 26, 158, - 220, 162, -1, 30, -1, 31, -1, -1, 163, 135, - 158, 136, 162, -1, 163, 136, 158, 135, 162, -1, - 163, 136, 162, -1, 163, 135, 162, -1, 163, 121, - 162, -1, 163, 122, 162, -1, -1, 126, -1, 127, - -1, 128, -1, 121, -1, 122, -1, -1, 163, 182, - 162, -1, -1, 163, 125, 162, -1, 163, 126, 162, - -1, -1, 163, 183, 162, -1, 163, 182, 162, -1, - 163, 183, 158, 182, 162, -1, 163, 182, 158, 183, - 162, -1, -1, 163, 134, 162, -1, 163, 133, 162, - -1, -1, 163, 133, 162, -1, 163, 134, 162, -1, - -1, 163, 125, 162, -1, 163, 126, 162, -1, 163, - 143, 162, -1, 163, 143, 158, 126, 162, -1, 163, - 126, 158, 143, 162, -1, -1, 163, 143, 162, -1, - -1, 163, 126, 162, -1, 108, -1, 111, -1, 110, - -1, 109, -1, -1, 163, 137, 162, -1, 163, 137, - 162, -1, 163, 136, 162, -1, 163, 136, 158, 137, - 162, -1, 163, 137, 158, 136, 162, -1, 13, -1, - 14, -1, 15, -1, -1, 163, 136, 162, -1, -1, - 163, 136, 162, -1, 164, 83, 26, 165, -1, 164, - 26, 84, 165, -1, 75, -1, 76, -1, 79, -1, - 80, -1, 81, -1, 82, -1, 71, -1, 70, -1, - 163, 140, 162, -1, 163, 129, 162, -1, 163, 139, - 162, -1, 163, 130, 162, -1, 163, 140, 158, 137, - 162, -1, 163, 129, 158, 137, 162, -1, 163, 139, - 158, 137, 162, -1, 163, 130, 158, 137, 162, -1, - 163, 144, 162, -1, 163, 145, 162, -1, 163, 144, - 158, 137, 162, -1, 163, 145, 158, 137, 162, -1, - -1, 84, -1, 83, -1, 179, 98, -1, 179, 103, - -1, 179, 104, -1, 26, 98, 179, -1, 210, -1, - 26, 98, 163, 210, 162, -1, 36, 98, 163, 210, - 162, -1, 36, 98, 179, -1, 206, 211, -1, 208, - 211, -1, 207, 211, -1, 36, 72, 36, -1, 98, - -1, 100, -1, 102, -1, 101, -1, 28, 212, 166, - -1, 28, 212, 143, -1, 166, 212, 28, -1, 143, - 212, 28, -1, 168, -1, 170, -1, 171, -1, 172, - -1, 214, 173, 215, -1, 216, -1, 220, -1, 214, - 173, 174, -1, 169, -1, 214, -1, 163, 221, 162, - -1, 63, 221, -1, 70, 221, -1, 221, -1, 221, - 72, 221, -1, 221, 73, 221, -1, 221, 67, 221, - -1, 221, 71, 221, -1, 221, 70, 221, -1, 221, - 91, 221, -1, 221, 92, 221, -1, 221, 65, 221, - -1, 221, 68, 221, -1, 221, 66, 221, -1, 219, - -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short int yyrline[] = -{ - 0, 567, 567, 568, 580, 582, 615, 642, 653, 657, - 692, 712, 717, 727, 737, 742, 747, 763, 779, 791, - 801, 814, 833, 851, 874, 896, 901, 911, 922, 933, - 947, 962, 978, 994, 1010, 1021, 1035, 1061, 1079, 1084, - 1090, 1102, 1113, 1124, 1135, 1146, 1157, 1168, 1194, 1208, - 1218, 1263, 1282, 1293, 1304, 1315, 1326, 1337, 1353, 1370, - 1386, 1397, 1408, 1439, 1450, 1463, 1474, 1513, 1523, 1533, - 1553, 1563, 1573, 1583, 1594, 1602, 1612, 1622, 1633, 1657, - 1668, 1674, 1685, 1696, 1707, 1715, 1736, 1761, 1788, 1822, - 1836, 1847, 1861, 1895, 1905, 1915, 1940, 1952, 1970, 1981, - 1992, 2003, 2016, 2027, 2038, 2049, 2060, 2071, 2104, 2114, - 2127, 2147, 2158, 2169, 2182, 2195, 2206, 2217, 2228, 2239, - 2249, 2260, 2271, 2283, 2294, 2305, 2316, 2329, 2341, 2353, - 2364, 2375, 2386, 2398, 2410, 2421, 2432, 2443, 2453, 2459, - 2465, 2471, 2477, 2483, 2489, 2495, 2501, 2507, 2513, 2524, - 2535, 2546, 2557, 2568, 2579, 2590, 2596, 2607, 2618, 2629, - 2640, 2651, 2661, 2674, 2682, 2690, 2714, 2725, 2736, 2747, - 2758, 2769, 2781, 2794, 2803, 2814, 2825, 2837, 2848, 2859, - 2870, 2884, 2896, 2911, 2930, 2941, 2959, 2993, 3011, 3028, - 3039, 3050, 3061, 3082, 3101, 3114, 3128, 3140, 3156, 3196, - 3229, 3237, 3253, 3272, 3286, 3305, 3321, 3329, 3338, 3349, - 3361, 3375, 3383, 3393, 3405, 3410, 3415, 3421, 3429, 3435, - 3441, 3447, 3460, 3464, 3474, 3478, 3483, 3488, 3493, 3500, - 3504, 3511, 3515, 3520, 3525, 3533, 3537, 3544, 3548, 3556, - 3561, 3567, 3576, 3581, 3587, 3593, 3599, 3608, 3611, 3615, - 3622, 3625, 3629, 3636, 3641, 3647, 3653, 3659, 3664, 3672, - 3675, 3682, 3685, 3692, 3696, 3700, 3704, 3711, 3714, 3721, - 3726, 3733, 3740, 3752, 3756, 3760, 3767, 3770, 3780, 3783, - 3792, 3798, 3807, 3811, 3818, 3822, 3826, 3830, 3837, 3841, - 3848, 3856, 3864, 3872, 3880, 3887, 3894, 3902, 3912, 3917, - 3922, 3927, 3935, 3938, 3942, 3951, 3958, 3965, 3972, 3987, - 3993, 4001, 4009, 4027, 4034, 4041, 4051, 4064, 4068, 4072, - 4076, 4083, 4089, 4095, 4101, 4111, 4120, 4122, 4124, 4128, - 4136, 4140, 4147, 4153, 4159, 4163, 4167, 4171, 4177, 4183, - 4187, 4191, 4195, 4199, 4203, 4207, 4211, 4215, 4219, 4223 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "BYTEOP16P", "BYTEOP16M", "BYTEOP1P", - "BYTEOP2P", "BYTEOP2M", "BYTEOP3P", "BYTEUNPACK", "BYTEPACK", "PACK", - "SAA", "ALIGN8", "ALIGN16", "ALIGN24", "VIT_MAX", "EXTRACT", "DEPOSIT", - "EXPADJ", "SEARCH", "ONES", "SIGN", "SIGNBITS", "LINK", "UNLINK", "REG", - "PC", "CCREG", "BYTE_DREG", "REG_A_DOUBLE_ZERO", "REG_A_DOUBLE_ONE", - "A_ZERO_DOT_L", "A_ZERO_DOT_H", "A_ONE_DOT_L", "A_ONE_DOT_H", "HALF_REG", - "NOP", "RTI", "RTS", "RTX", "RTN", "RTE", "HLT", "IDLE", "STI", "CLI", - "CSYNC", "SSYNC", "EMUEXCPT", "RAISE", "EXCPT", "LSETUP", "LOOP", - "LOOP_BEGIN", "LOOP_END", "DISALGNEXCPT", "JUMP", "JUMP_DOT_S", - "JUMP_DOT_L", "CALL", "ABORT", "NOT", "TILDA", "BANG", "AMPERSAND", - "BAR", "PERCENT", "CARET", "BXOR", "MINUS", "PLUS", "STAR", "SLASH", - "NEG", "MIN", "MAX", "ABS", "DOUBLE_BAR", "_PLUS_BAR_PLUS", - "_PLUS_BAR_MINUS", "_MINUS_BAR_PLUS", "_MINUS_BAR_MINUS", "_MINUS_MINUS", - "_PLUS_PLUS", "SHIFT", "LSHIFT", "ASHIFT", "BXORSHIFT", - "_GREATER_GREATER_GREATER_THAN_ASSIGN", "ROT", "LESS_LESS", - "GREATER_GREATER", "_GREATER_GREATER_GREATER", "_LESS_LESS_ASSIGN", - "_GREATER_GREATER_ASSIGN", "DIVS", "DIVQ", "ASSIGN", "_STAR_ASSIGN", - "_BAR_ASSIGN", "_CARET_ASSIGN", "_AMPERSAND_ASSIGN", "_MINUS_ASSIGN", - "_PLUS_ASSIGN", "_ASSIGN_BANG", "_LESS_THAN_ASSIGN", "_ASSIGN_ASSIGN", - "GE", "LT", "LE", "GT", "LESS_THAN", "FLUSHINV", "FLUSH", "IFLUSH", - "PREFETCH", "PRNT", "OUTC", "WHATREG", "TESTSET", "ASL", "ASR", "B", "W", - "NS", "S", "CO", "SCO", "TH", "TL", "BP", "BREV", "X", "Z", "M", "MMOD", - "R", "RND", "RNDL", "RNDH", "RND12", "RND20", "V", "LO", "HI", "BITTGL", - "BITCLR", "BITSET", "BITTST", "BITMUX", "DBGAL", "DBGAH", "DBGHALT", - "DBG", "DBGA", "DBGCMPLX", "IF", "COMMA", "BY", "COLON", "SEMICOLON", - "RPAREN", "LPAREN", "LBRACK", "RBRACK", "STATUS_REG", "MNOP", "SYMBOL", - "NUMBER", "GOT", "GOT17M4", "FUNCDESC_GOT17M4", "AT", "PLTPC", "$accept", - "statement", "asm", "asm_1", "REG_A", "opt_mode", "asr_asl", "sco", - "asr_asl_0", "amod0", "amod1", "amod2", "xpmod", "xpmod1", "vsmod", - "vmod", "smod", "searchmod", "aligndir", "byteop_mod", "c_align", - "w32_or_nothing", "iu_or_nothing", "reg_with_predec", "reg_with_postinc", - "min_max", "op_bar_op", "plus_minus", "rnd_op", "b3_op", "post_op", - "a_assign", "a_minusassign", "a_plusassign", "assign_macfunc", - "a_macfunc", "multiply_halfregs", "cc_op", "ccstat", "symbol", - "any_gotrel", "got", "got_or_expr", "pltpc", "eterm", "expr", "expr_1", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const unsigned short int yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 426, 427, 428, 429 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = -{ - 0, 175, 176, 176, 177, 177, 177, 177, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 179, 179, 180, 180, 180, 180, 180, 181, - 181, 182, 182, 182, 182, 183, 183, 184, 184, 185, - 185, 185, 186, 186, 186, 186, 186, 187, 187, 187, - 188, 188, 188, 189, 189, 189, 189, 189, 189, 190, - 190, 191, 191, 192, 192, 192, 192, 193, 193, 194, - 194, 194, 194, 195, 195, 195, 196, 196, 197, 197, - 198, 199, 200, 200, 201, 201, 201, 201, 202, 202, - 203, 203, 203, 203, 203, 203, 203, 203, 204, 204, - 204, 204, 205, 205, 205, 206, 207, 208, 209, 209, - 209, 209, 209, 210, 210, 210, 211, 212, 212, 212, - 212, 213, 213, 213, 213, 214, 215, 215, 215, 216, - 217, 217, 218, 219, 219, 219, 219, 219, 220, 221, - 221, 221, 221, 221, 221, 221, 221, 221, 221, 221 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = -{ - 0, 2, 0, 1, 2, 6, 4, 1, 1, 2, - 5, 1, 6, 6, 3, 3, 17, 17, 11, 11, - 11, 12, 12, 12, 5, 3, 3, 3, 8, 13, - 12, 13, 13, 13, 8, 17, 6, 9, 3, 6, - 3, 5, 6, 8, 8, 2, 2, 4, 3, 2, - 4, 3, 6, 4, 7, 7, 3, 3, 6, 3, - 4, 3, 3, 3, 11, 11, 9, 5, 5, 9, - 5, 5, 6, 6, 5, 5, 5, 6, 6, 5, - 1, 3, 3, 3, 3, 4, 4, 9, 9, 5, - 7, 4, 6, 5, 6, 7, 9, 8, 8, 11, - 9, 4, 5, 6, 7, 6, 4, 6, 5, 6, - 6, 4, 8, 10, 10, 12, 5, 6, 5, 6, - 4, 4, 4, 7, 9, 9, 9, 6, 6, 6, - 8, 8, 6, 5, 5, 8, 4, 7, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, - 4, 4, 6, 6, 2, 2, 4, 2, 2, 2, - 2, 2, 2, 6, 6, 5, 4, 3, 3, 3, - 3, 3, 3, 4, 2, 4, 2, 4, 2, 4, - 2, 7, 8, 8, 7, 7, 7, 9, 7, 8, - 9, 8, 6, 7, 8, 9, 8, 7, 7, 6, - 3, 11, 7, 11, 7, 3, 2, 1, 7, 9, - 11, 3, 5, 7, 1, 2, 2, 4, 1, 6, - 6, 6, 1, 1, 0, 5, 5, 3, 3, 3, - 3, 0, 1, 1, 1, 1, 1, 0, 3, 0, - 3, 3, 0, 3, 3, 5, 5, 0, 3, 3, - 0, 3, 3, 0, 3, 3, 3, 5, 5, 0, - 3, 0, 3, 1, 1, 1, 1, 0, 3, 3, - 3, 5, 5, 1, 1, 1, 0, 3, 0, 3, - 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, - 3, 3, 3, 3, 5, 5, 5, 5, 3, 3, - 5, 5, 0, 1, 1, 2, 2, 2, 3, 1, - 5, 5, 3, 2, 2, 2, 3, 1, 1, 1, - 1, 3, 3, 3, 3, 1, 1, 1, 1, 3, - 1, 1, 3, 1, 1, 3, 2, 2, 1, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 1 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const unsigned short int yydefact[] = -{ - 0, 7, 0, 0, 207, 0, 0, 222, 223, 0, - 0, 0, 0, 0, 138, 140, 139, 141, 142, 143, - 144, 0, 0, 145, 146, 147, 0, 0, 0, 0, - 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 218, 214, 0, 0, 0, 0, 0, - 0, 8, 325, 333, 0, 3, 0, 0, 0, 0, - 0, 0, 224, 309, 80, 334, 349, 0, 338, 0, - 0, 206, 0, 0, 0, 0, 0, 0, 0, 317, - 318, 320, 319, 0, 0, 0, 0, 0, 0, 0, - 149, 148, 154, 155, 0, 0, 0, 157, 158, 334, - 160, 159, 0, 162, 161, 336, 337, 0, 0, 0, - 176, 0, 174, 0, 178, 0, 180, 0, 0, 0, - 317, 0, 0, 0, 0, 0, 0, 0, 216, 215, - 0, 0, 0, 0, 0, 0, 302, 0, 0, 1, - 0, 4, 305, 306, 307, 0, 46, 0, 0, 0, - 0, 0, 0, 0, 45, 0, 313, 49, 276, 315, - 314, 0, 9, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 169, 172, 170, 171, 167, - 168, 0, 0, 0, 0, 0, 0, 273, 274, 275, - 0, 0, 0, 81, 83, 247, 0, 247, 0, 0, - 282, 283, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 308, 0, 0, 224, 250, 63, 59, 57, 61, - 62, 82, 0, 0, 84, 0, 322, 321, 26, 14, - 27, 15, 0, 0, 0, 0, 51, 0, 0, 0, - 0, 0, 0, 312, 224, 48, 0, 211, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 302, 302, 324, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 335, 289, 288, 304, - 303, 0, 0, 0, 323, 0, 276, 205, 0, 0, - 38, 25, 0, 0, 0, 0, 0, 0, 0, 0, - 40, 0, 56, 0, 0, 0, 200, 346, 348, 341, - 347, 343, 342, 339, 340, 344, 345, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 288, 284, 285, 286, 287, 0, 0, 0, 0, 0, - 0, 53, 0, 47, 166, 253, 259, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 302, - 0, 0, 0, 86, 0, 50, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 111, 121, 122, - 120, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 85, 0, 0, 150, 0, 332, - 151, 0, 0, 0, 0, 175, 173, 177, 179, 156, - 303, 0, 0, 303, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 217, 0, 136, 0, 0, 0, 0, - 0, 0, 0, 280, 0, 6, 60, 0, 316, 0, - 0, 0, 0, 0, 0, 91, 106, 101, 0, 0, - 0, 228, 0, 227, 0, 0, 224, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 79, 67, 68, - 0, 253, 259, 253, 237, 239, 0, 0, 0, 0, - 165, 0, 24, 0, 0, 0, 0, 302, 302, 0, - 307, 0, 310, 303, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 278, 278, 74, 75, 278, 278, 0, - 76, 70, 71, 0, 0, 0, 0, 0, 0, 0, - 0, 93, 108, 261, 0, 239, 0, 0, 302, 0, - 311, 0, 0, 212, 0, 0, 0, 0, 281, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 133, 0, 0, 134, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 102, 89, 0, 116, - 118, 41, 277, 0, 0, 0, 0, 10, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, - 107, 110, 0, 231, 52, 0, 0, 36, 249, 248, - 0, 0, 0, 0, 0, 105, 259, 253, 117, 119, - 0, 0, 303, 0, 0, 0, 12, 0, 334, 330, - 0, 331, 199, 0, 0, 0, 0, 251, 252, 58, - 0, 77, 78, 72, 73, 0, 0, 0, 0, 0, - 42, 0, 0, 0, 0, 94, 109, 0, 39, 103, - 261, 303, 0, 13, 0, 0, 0, 153, 152, 164, - 163, 0, 0, 0, 0, 0, 129, 127, 128, 0, - 221, 220, 219, 0, 132, 0, 0, 0, 0, 0, - 0, 192, 5, 0, 0, 0, 0, 0, 225, 226, - 0, 308, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 232, 233, 234, 0, 0, - 0, 0, 0, 254, 0, 255, 0, 256, 260, 104, - 95, 0, 247, 0, 0, 247, 0, 197, 0, 198, - 0, 0, 0, 0, 0, 0, 0, 0, 123, 0, - 0, 0, 0, 0, 0, 0, 0, 90, 0, 188, - 0, 208, 213, 0, 181, 0, 0, 184, 185, 0, - 137, 0, 0, 0, 0, 0, 0, 0, 204, 193, - 186, 0, 202, 55, 54, 0, 0, 0, 0, 0, - 0, 0, 34, 112, 0, 247, 98, 0, 0, 238, - 0, 240, 241, 0, 0, 0, 247, 196, 247, 247, - 189, 0, 326, 327, 328, 329, 0, 28, 259, 224, - 279, 131, 130, 0, 0, 259, 97, 43, 44, 0, - 0, 262, 0, 191, 224, 0, 182, 194, 183, 0, - 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 124, 100, 0, 69, 0, - 0, 0, 258, 257, 195, 190, 187, 66, 0, 37, - 88, 229, 230, 96, 0, 0, 0, 0, 87, 209, - 125, 0, 0, 0, 0, 0, 0, 126, 0, 267, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 114, - 0, 113, 0, 0, 0, 0, 267, 263, 266, 265, - 264, 0, 0, 0, 0, 0, 64, 0, 0, 0, - 0, 99, 242, 239, 20, 239, 0, 0, 210, 0, - 0, 18, 19, 203, 201, 65, 0, 30, 0, 0, - 0, 231, 23, 22, 21, 115, 0, 0, 0, 268, - 0, 29, 0, 31, 32, 0, 33, 235, 236, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 244, 231, 243, 0, 0, 0, 0, - 270, 0, 269, 0, 291, 0, 293, 0, 292, 0, - 290, 0, 298, 0, 299, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 246, 245, - 0, 267, 267, 271, 272, 295, 297, 296, 294, 300, - 301, 35, 16, 17 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const short int yydefgoto[] = -{ - -1, 64, 65, 66, 364, 172, 748, 718, 960, 604, - 607, 942, 351, 375, 490, 492, 655, 911, 916, 951, - 222, 312, 641, 68, 120, 223, 348, 291, 953, 956, - 292, 365, 366, 71, 72, 73, 170, 94, 74, 75, - 815, 629, 630, 110, 76, 77, 78 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -903 -static const short int yypact[] = -{ - 697, -903, -94, 277, -903, 676, 315, -903, -903, 23, - 32, 41, 58, 65, -903, -903, -903, -903, -903, -903, - -903, 121, 158, -903, -903, -903, 277, 277, 29, 277, - -903, 318, 277, 277, 320, 277, 277, 94, 100, 64, - 104, 108, 131, 137, 152, 165, 376, 160, 171, 176, - 182, 219, 238, -903, 566, 244, 251, 79, 96, 44, - 376, -903, -903, -903, 350, -903, -57, 187, 337, 63, - 245, 394, 278, -903, -903, -903, -903, 349, 563, 436, - 277, -903, 146, 159, 167, 489, 438, 186, 188, 37, - -903, -903, -903, 15, -118, 446, 462, 480, 485, 28, - -903, -903, -903, -903, 277, 513, 50, -903, -903, 353, - -903, -903, 85, -903, -903, -903, -903, 521, 534, 537, - -903, 542, -903, 567, -903, 575, -903, 578, 583, 585, - -903, 619, 590, 598, 630, 651, 656, 680, -903, -903, - 677, 693, 62, 692, 204, 470, 200, 698, 712, -903, - 886, -903, -903, -903, 180, -6, -903, 419, 302, 180, - 180, 180, 589, 180, 97, 277, -903, -903, 595, -903, - -903, 297, 568, 277, 277, 277, 277, 277, 277, 277, - 277, 277, 277, 277, 591, -903, -903, -903, -903, -903, - -903, 599, 600, 601, 603, 605, 606, -903, -903, -903, - 609, 613, 614, 580, -903, 615, 688, -38, 210, 226, - -903, -903, 735, 755, 756, 757, 759, 622, 623, 98, - 762, 718, 627, 628, 278, 629, -903, -903, -903, 632, - -903, 205, 633, 332, -903, 634, -903, -903, -903, -903, - -903, -903, 635, 636, 774, 449, -25, 703, 227, 766, - 768, 641, 302, -903, 278, -903, 648, 709, 647, 743, - 642, 653, 747, 661, 664, -62, -31, -19, 16, 662, - 326, 372, -903, 665, 667, 668, 669, 670, 671, 672, - 673, 733, 277, 84, 806, 277, -903, -903, -903, -903, - 808, 277, 674, 690, -903, -16, 595, -903, 810, 801, - 683, 684, 679, 699, 180, 700, 277, 277, 277, 730, - -903, 721, -903, -26, 116, 520, -903, 441, 616, -903, - 457, 313, 313, -903, -903, 500, 500, 277, 836, 841, - 842, 843, 844, 835, 846, 848, 849, 850, 851, 852, - 716, -903, -903, -903, -903, 277, 277, 277, 855, 856, - 316, -903, 857, -903, -903, 722, 723, 725, 732, 734, - 736, 868, 870, 826, 487, 394, 394, 245, 737, 389, - 180, 877, 878, 748, 324, -903, 773, 243, 268, 300, - 881, 180, 180, 180, 882, 883, 189, -903, -903, -903, - -903, 775, 903, 110, 277, 277, 277, 918, 905, 788, - 789, 924, 245, 790, 793, 277, 927, -903, 928, -903, - -903, 929, 931, 932, 794, -903, -903, -903, -903, -903, - -903, 277, 795, 935, 277, 797, 277, 277, 277, 937, - 277, 277, 277, -903, 938, 802, 869, 277, 804, 179, - 803, 805, 871, -903, 886, -903, -903, 811, -903, 180, - 180, 936, 940, 815, 72, -903, -903, -903, 816, 817, - 845, -903, 853, -903, 879, 887, 278, 822, 824, 827, - 829, 830, 828, 833, 834, 837, 838, -903, -903, -903, - 967, 722, 723, 722, -66, 92, 832, 854, 839, 95, - -903, 860, -903, 962, 968, 969, 124, 326, 474, 981, - -903, 858, -903, 982, 277, 847, 859, 861, 863, 985, - 862, 864, 865, 867, 867, -903, -903, 867, 867, 873, - -903, -903, -903, 888, 866, 889, 890, 894, 872, 895, - 896, 897, -903, 897, 898, 899, 977, 978, 426, 901, - -903, 979, 902, 926, 904, 906, 907, 908, -903, 880, - 925, 892, 900, 946, 909, 910, 911, 893, 912, 913, - 914, -903, 891, 999, 915, 983, 1041, 984, 986, 987, - 1051, 919, 277, 988, 1009, 1006, -903, -903, 180, -903, - -903, 930, -903, 933, 934, 2, 6, -903, 1061, 277, - 277, 277, 277, 1063, 1054, 1065, 1056, 1067, 1003, -903, - -903, -903, 1071, 427, -903, 1072, 455, -903, -903, -903, - 1073, 939, 190, 209, 941, -903, 723, 722, -903, -903, - 277, 942, 1074, 277, 943, 944, -903, 945, 947, -903, - 948, -903, -903, 1076, 1078, 1079, 1011, -903, -903, -903, - 975, -903, -903, -903, -903, 277, 277, 949, 1080, 1081, - -903, 497, 180, 180, 989, -903, -903, 1082, -903, -903, - 897, 1088, 954, -903, 1023, 1096, 277, -903, -903, -903, - -903, 1025, 1098, 1027, 1028, 191, -903, -903, -903, 180, - -903, -903, -903, 965, -903, 997, 357, 970, 971, 1103, - 1105, -903, -903, 246, 180, 180, 974, 180, -903, -903, - 180, -903, 180, 973, 976, 980, 990, 991, 992, 993, - 994, 995, 996, 277, 1038, -903, -903, -903, 998, 1039, - 1000, 1001, 1042, -903, 1002, -903, 1013, -903, -903, -903, - -903, 1004, 615, 1005, 1007, 615, 1050, -903, 533, -903, - 1044, 1012, 1014, 394, 1015, 1016, 1017, 477, -903, 1018, - 1019, 1020, 1021, 1008, 1010, 1022, 1024, -903, 1026, -903, - 394, 1045, -903, 1118, -903, 1110, 1121, -903, -903, 1030, - -903, 1031, 1032, 1033, 1124, 1125, 277, 1126, -903, -903, - -903, 1127, -903, -903, -903, 1131, 180, 277, 1135, 1138, - 1139, 1141, -903, -903, 949, 615, 1034, 1036, 1145, -903, - 1147, -903, -903, 1143, 1037, 1040, 615, -903, 615, 615, - -903, 277, -903, -903, -903, -903, 180, -903, 723, 278, - -903, -903, -903, 1043, 1046, 723, -903, -903, -903, 588, - 1159, -903, 1115, -903, 278, 1162, -903, -903, -903, 949, - -903, 1163, 1164, 1047, 1048, 1052, 1116, 1049, 1053, 1055, - 1057, 1060, 1062, 1064, 1066, -903, -903, 1068, -903, 586, - 624, 1123, -903, -903, -903, -903, -903, -903, 1133, -903, - -903, -903, -903, -903, 1059, 1058, 1069, 1168, -903, 1114, - -903, 1070, 1075, 277, 582, 1112, 277, -903, 1086, 1077, - 277, 277, 277, 277, 1083, 1187, 1191, 1190, 180, -903, - 1197, -903, 1156, 277, 277, 277, 1077, -903, -903, -903, - -903, 1084, 971, 1085, 1087, 1091, -903, 1089, 1090, 1092, - 1093, -903, 1094, 899, -903, 899, 1097, 1207, -903, 1095, - 1100, -903, -903, -903, -903, -903, 1099, 1101, 1102, 1102, - 1104, 456, -903, -903, -903, -903, 1106, 1206, 1208, -903, - 579, -903, 229, -903, -903, 555, -903, -903, -903, 264, - 448, 1200, 1108, 1111, 463, 464, 465, 479, 482, 516, - 517, 518, 596, -903, 427, -903, 1113, 277, 277, 1107, - -903, 1120, -903, 1129, -903, 1136, -903, 1137, -903, 1140, - -903, 1142, -903, 1144, -903, 1122, 1128, 1161, 1130, 1132, - 1134, 1146, 1148, 1149, 1150, 1151, 1152, 1153, -903, -903, - 1201, 1077, 1077, -903, -903, -903, -903, -903, -903, -903, - -903, -903, -903, -903 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const short int yypgoto[] = -{ - -903, -903, -903, -134, 17, -219, -716, -902, 266, -903, - -520, -903, -201, -903, -443, -472, -478, -903, -788, -903, - -903, 952, -275, -903, -39, -903, 380, -196, 303, -903, - -252, 4, 8, -162, 955, -210, -58, 49, -903, -20, - -903, -903, -903, 1209, -903, -3, 25 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -3 -static const short int yytable[] = -{ - 81, 122, 124, 126, 69, 373, 353, 349, 70, 368, - 600, 166, 169, 109, 109, 658, 295, 67, 422, 425, - 297, 150, 414, 102, 103, 236, 105, 224, 107, 108, - 111, 114, 7, 8, 299, 404, 7, 8, 599, 959, - 601, 254, 403, 234, 242, 287, 288, 243, 237, 244, - 392, 245, 398, 414, 246, 656, 247, 367, 7, 8, - 115, 116, 444, 231, 248, 414, 167, 7, 8, 79, - 146, 139, 996, 165, 421, 424, 258, 259, 855, 186, - 188, 190, 225, 145, 228, 230, 164, 168, 281, 156, - 402, 35, 602, 7, 8, 131, 255, 603, 36, 157, - 414, 256, 221, 415, 151, 145, 233, 142, 579, 148, - 436, 261, 262, 35, 249, 250, 253, 505, 931, 282, - 36, 95, 144, 880, 363, 350, 35, 147, 7, 8, - 96, 145, 460, 158, 416, 35, 461, 145, 391, 97, - 159, 437, 36, 143, 729, 445, 417, 100, 35, 160, - 161, 162, 251, 163, 69, 36, 98, 298, 70, 35, - 618, 35, 310, 99, 235, 700, 36, 67, 36, 702, - 316, 296, 185, 504, 730, 300, 301, 302, 303, 529, - 305, 418, 757, 116, 101, 187, 232, 35, 306, 307, - 308, 252, 104, 189, 36, 152, 62, 63, 530, 317, - 318, 319, 320, 321, 322, 323, 324, 325, 326, 35, - 7, 8, 227, 80, 229, 525, 36, 767, 62, 63, - 611, 612, 35, 1022, 1023, 526, 80, 768, 119, 36, - 35, 62, 63, 115, 116, 80, 354, 36, 613, 642, - 62, 63, 643, 644, 145, 621, 624, 587, 80, 35, - 605, 35, 355, 62, 63, 606, 36, 117, 36, 80, - 309, 80, 390, 118, 62, 63, 62, 63, 121, 513, - 287, 288, 123, 35, 462, 7, 8, 145, 463, 435, - 36, 157, 439, 289, 290, 152, 662, 80, 441, 35, - 153, 154, 62, 63, 515, 125, 36, 287, 288, 299, - 127, 620, 623, 455, 456, 457, 35, 166, 169, 80, - 571, 377, 378, 36, 62, 63, 128, 379, 394, 395, - 396, 453, 80, 132, 467, 397, 517, 62, 63, 129, - 80, 35, 7, 8, 133, 62, 63, 566, 36, 134, - 35, 567, 481, 482, 483, 135, 869, 36, 724, 80, - 149, 80, 725, 873, 62, 63, 62, 63, 966, 967, - 772, 773, 284, 35, 285, 35, 774, 726, 968, 969, - 36, 727, 36, 80, 514, 516, 518, 775, 62, 63, - 176, 35, 136, 35, 501, 180, 181, 506, 36, 80, - 36, 531, 532, 533, 62, 63, 287, 288, 520, 521, - 522, 137, 542, 943, 781, 944, 80, 140, 782, 289, - 420, 62, 63, 89, 141, 90, 91, 92, 549, 539, - 93, 552, 972, 554, 555, 556, 973, 558, 559, 560, - 157, 80, 313, 314, 564, 155, 62, 63, 381, 382, - 80, 171, 287, 288, 383, 62, 63, 173, 69, 486, - 487, 580, 70, 574, 575, 289, 423, 510, 511, 287, - 288, 67, 184, 80, 226, 80, 573, 573, 62, 63, - 62, 63, 289, 503, 130, 388, 90, 91, 92, 7, - 8, 106, 238, 112, 628, 389, 62, 63, 62, 63, - 368, 299, 403, 619, 191, 192, 193, 194, 239, 195, - 196, 631, 197, 198, 199, 200, 201, 202, 176, 289, - 661, 178, 179, 180, 181, 203, 240, 204, 205, 7, - 8, 241, 174, 206, 176, 207, 260, 178, 179, 180, - 181, 807, 182, 183, 810, 174, 175, 176, 177, 257, - 178, 179, 180, 181, 287, 288, 464, 263, 182, 183, - 7, 8, 208, 715, 716, 717, 465, 289, 622, 209, - 264, 182, 183, 265, 210, 211, 212, 176, 266, 693, - 178, 179, 180, 181, 213, 214, 215, 957, 958, 216, - 720, 721, 715, 716, 717, 152, 704, 705, 706, 707, - 153, 500, 138, 267, 856, 696, 7, 8, 823, 824, - 870, 268, 701, 253, 269, 864, 974, 865, 866, 270, - 975, 271, 217, 218, 874, 878, 273, 731, 7, 8, - 734, 979, 981, 983, 274, 980, 982, 984, 174, 175, - 176, 177, 286, 178, 179, 180, 181, 985, 751, 752, - 987, 986, 745, 746, 988, 337, 338, 272, 339, 778, - 287, 340, 219, 220, 182, 183, 275, 62, 63, 341, - 342, 343, 344, 762, 896, 341, 342, 343, 344, 753, - 754, 345, 346, 347, 989, 991, 993, 276, 990, 992, - 994, 174, 277, 176, 177, 819, 178, 179, 180, 181, - 907, 908, 909, 910, 287, 288, 769, -2, 1, 970, - 971, 786, 834, 812, 813, 814, 278, 182, 183, 2, - 797, 783, 784, 279, 573, 964, 965, 957, 958, 280, - 283, 3, 4, 5, 293, 6, 315, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 294, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 327, 304, 30, 31, 32, 33, 34, 311, 352, - 35, 356, 328, 329, 330, 82, 331, 36, 332, 333, - 83, 84, 334, 845, 85, 86, 335, 336, 350, 87, - 88, 357, 358, 359, 850, 360, 361, 362, 369, 370, - 371, 372, 374, 37, 38, 376, 380, 384, 385, 386, - 387, 393, 399, 849, 400, 401, 405, 406, 867, 407, - 39, 40, 41, 42, 408, 410, 409, 43, 411, 412, - 44, 45, 413, 426, 419, 427, 428, 429, 430, 431, - 432, 434, 438, 868, 440, 433, 447, 448, 451, 442, - 46, 449, 450, 47, 48, 49, 875, 50, 51, 52, - 53, 54, 55, 56, 57, 443, 458, 459, 452, 454, - 58, 59, 468, 60, 61, 62, 63, 469, 470, 471, - 472, 473, 474, 933, 475, 476, 477, 478, 479, 480, - 906, 484, 485, 913, 493, 489, 491, 917, 918, 919, - 920, 494, 488, 495, 497, 496, 498, 499, 2, 502, - 928, 929, 930, 507, 508, 512, 509, 519, 523, 524, - 3, 4, 5, 527, 6, 925, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 528, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 534, 535, 30, 31, 32, 33, 34, 536, 537, 35, - 538, 541, 540, 543, 544, 545, 36, 546, 547, 548, - 550, 551, 553, 557, 561, 562, 565, 563, 568, 570, - 569, 572, 576, 578, 998, 999, 577, 585, 581, 582, - 588, 583, 37, 38, 589, 586, 593, 590, 584, 591, - 592, 594, 595, 598, 608, 596, 597, 610, 615, 39, - 40, 41, 42, 614, 616, 617, 43, 625, 627, 44, - 45, 636, 632, 659, 660, 664, 609, 633, 666, 634, - 626, 635, 683, 672, 637, 684, 638, 639, 647, 46, - 640, 645, 47, 48, 49, 651, 50, 51, 52, 53, - 54, 55, 56, 57, 675, 671, 646, 648, 649, 58, - 59, 679, 60, 61, 62, 63, 650, 673, 652, 653, - 654, 657, 606, 663, 665, 674, 667, 687, 668, 669, - 670, 676, 677, 678, 680, 681, 682, 691, 685, 694, - 692, 686, 688, 695, 689, 690, 152, 703, 697, 708, - 709, 710, 711, 712, 713, 698, 699, 714, 719, 722, - 733, 723, 740, 728, 741, 742, 736, 732, 735, 743, - 737, 744, 747, 739, 758, 755, 749, 750, 756, 759, - 738, 760, 761, 763, 764, 765, 766, 770, 771, 779, - 776, 780, 785, 787, 788, 777, 798, 800, 789, 805, - 803, 811, 816, 835, 836, 804, 837, 838, 790, 791, - 843, 844, 846, 847, 792, 793, 794, 795, 796, 848, - 799, 851, 801, 802, 852, 853, 829, 854, 830, 806, - 808, 859, 809, 860, 817, 861, 818, 820, 821, 822, - 825, 826, 827, 828, 831, 876, 832, 877, 879, 881, - 882, 833, 839, 840, 897, 841, 842, 857, 858, 862, - 414, 894, 863, 898, 902, 871, 903, 883, 872, 886, - 912, 884, 914, 922, 885, 887, 900, 923, 888, 889, - 890, 899, 891, 924, 892, 926, 893, 927, 936, 946, - 904, 901, 962, 1010, 963, 905, 976, 1021, 995, 895, - 915, 0, 954, 113, 1000, 921, 932, 934, 446, 935, - 0, 937, 938, 947, 939, 940, 1001, 941, 948, 945, - 0, 949, 0, 0, 950, 952, 1002, 955, 977, 961, - 466, 978, 0, 1003, 1004, 997, 0, 1005, 0, 1006, - 0, 1007, 0, 0, 1008, 0, 0, 0, 0, 0, - 1009, 0, 1011, 0, 1012, 0, 1013, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1014, 0, - 1015, 1016, 1017, 1018, 1019, 1020 -}; - -static const short int yycheck[] = -{ - 3, 40, 41, 42, 0, 224, 207, 203, 0, 219, - 482, 69, 70, 33, 34, 535, 150, 0, 270, 271, - 26, 78, 84, 26, 27, 143, 29, 85, 31, 32, - 33, 34, 30, 31, 72, 254, 30, 31, 481, 941, - 483, 99, 252, 28, 16, 70, 71, 19, 166, 21, - 246, 23, 248, 84, 26, 533, 28, 219, 30, 31, - 35, 36, 78, 26, 36, 84, 69, 30, 31, 163, - 26, 54, 974, 69, 270, 271, 26, 27, 794, 82, - 83, 84, 85, 58, 87, 88, 69, 70, 26, 26, - 252, 63, 158, 30, 31, 46, 99, 163, 70, 36, - 84, 104, 85, 165, 161, 80, 89, 28, 36, 60, - 26, 26, 27, 63, 86, 87, 99, 369, 906, 57, - 70, 98, 26, 839, 26, 163, 63, 83, 30, 31, - 98, 106, 158, 70, 165, 63, 162, 112, 163, 98, - 77, 57, 70, 64, 616, 161, 165, 26, 63, 86, - 87, 88, 124, 90, 150, 70, 98, 163, 150, 63, - 36, 63, 165, 98, 149, 163, 70, 150, 70, 163, - 173, 154, 26, 369, 617, 158, 159, 160, 161, 69, - 163, 165, 660, 158, 26, 26, 149, 63, 91, 92, - 93, 163, 163, 26, 70, 98, 168, 169, 88, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 63, - 30, 31, 26, 163, 26, 26, 70, 26, 168, 169, - 125, 126, 63, 1011, 1012, 36, 163, 36, 164, 70, - 63, 168, 169, 208, 209, 163, 26, 70, 143, 514, - 168, 169, 517, 518, 219, 497, 498, 466, 163, 63, - 158, 63, 26, 168, 169, 163, 70, 163, 70, 163, - 163, 163, 245, 163, 168, 169, 168, 169, 164, 26, - 70, 71, 164, 63, 158, 30, 31, 252, 162, 282, - 70, 36, 285, 83, 84, 98, 538, 163, 291, 63, - 103, 104, 168, 169, 26, 164, 70, 70, 71, 72, - 163, 497, 498, 306, 307, 308, 63, 365, 366, 163, - 444, 106, 107, 70, 168, 169, 164, 112, 91, 92, - 93, 304, 163, 163, 327, 98, 26, 168, 169, 164, - 163, 63, 30, 31, 163, 168, 169, 158, 70, 163, - 63, 162, 345, 346, 347, 163, 818, 70, 158, 163, - 0, 163, 162, 825, 168, 169, 168, 169, 129, 130, - 3, 4, 158, 63, 160, 63, 9, 158, 139, 140, - 70, 162, 70, 163, 377, 378, 379, 20, 168, 169, - 67, 63, 163, 63, 367, 72, 73, 370, 70, 163, - 70, 394, 395, 396, 168, 169, 70, 71, 381, 382, - 383, 163, 405, 923, 158, 925, 163, 163, 162, 83, - 84, 168, 169, 98, 163, 100, 101, 102, 421, 402, - 105, 424, 158, 426, 427, 428, 162, 430, 431, 432, - 36, 163, 135, 136, 437, 98, 168, 169, 106, 107, - 163, 163, 70, 71, 112, 168, 169, 98, 444, 133, - 134, 454, 444, 449, 450, 83, 84, 133, 134, 70, - 71, 444, 26, 163, 26, 163, 449, 450, 168, 169, - 168, 169, 83, 84, 98, 26, 100, 101, 102, 30, - 31, 163, 36, 163, 504, 36, 168, 169, 168, 169, - 700, 72, 702, 496, 5, 6, 7, 8, 36, 10, - 11, 504, 13, 14, 15, 16, 17, 18, 67, 83, - 84, 70, 71, 72, 73, 26, 36, 28, 29, 30, - 31, 36, 65, 34, 67, 36, 173, 70, 71, 72, - 73, 732, 91, 92, 735, 65, 66, 67, 68, 26, - 70, 71, 72, 73, 70, 71, 26, 26, 91, 92, - 30, 31, 63, 126, 127, 128, 36, 83, 84, 70, - 26, 91, 92, 26, 75, 76, 77, 67, 26, 572, - 70, 71, 72, 73, 85, 86, 87, 121, 122, 90, - 125, 126, 126, 127, 128, 98, 589, 590, 591, 592, - 103, 104, 26, 26, 795, 578, 30, 31, 121, 122, - 819, 26, 585, 586, 26, 806, 158, 808, 809, 26, - 162, 26, 123, 124, 26, 834, 26, 620, 30, 31, - 623, 158, 158, 158, 26, 162, 162, 162, 65, 66, - 67, 68, 162, 70, 71, 72, 73, 158, 141, 142, - 158, 162, 645, 646, 162, 65, 66, 28, 68, 688, - 70, 71, 163, 164, 91, 92, 26, 168, 169, 79, - 80, 81, 82, 666, 860, 79, 80, 81, 82, 652, - 653, 91, 92, 93, 158, 158, 158, 26, 162, 162, - 162, 65, 26, 67, 68, 743, 70, 71, 72, 73, - 108, 109, 110, 111, 70, 71, 679, 0, 1, 144, - 145, 697, 760, 170, 171, 172, 26, 91, 92, 12, - 713, 694, 695, 36, 697, 136, 137, 121, 122, 26, - 28, 24, 25, 26, 26, 28, 158, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 28, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 160, 163, 56, 57, 58, 59, 60, 163, 71, - 63, 26, 163, 163, 163, 89, 163, 70, 163, 163, - 94, 95, 163, 776, 98, 99, 163, 163, 163, 103, - 104, 26, 26, 26, 787, 26, 164, 164, 26, 71, - 163, 163, 163, 96, 97, 163, 163, 163, 163, 163, - 26, 98, 36, 786, 36, 164, 158, 98, 811, 162, - 113, 114, 115, 116, 71, 162, 174, 120, 71, 158, - 123, 124, 158, 158, 162, 158, 158, 158, 158, 158, - 158, 98, 26, 816, 26, 162, 26, 36, 159, 165, - 143, 158, 158, 146, 147, 148, 829, 150, 151, 152, - 153, 154, 155, 156, 157, 165, 126, 136, 159, 159, - 163, 164, 26, 166, 167, 168, 169, 26, 26, 26, - 26, 36, 26, 912, 26, 26, 26, 26, 26, 163, - 883, 26, 26, 886, 159, 163, 163, 890, 891, 892, - 893, 159, 35, 159, 26, 159, 26, 71, 12, 162, - 903, 904, 905, 26, 26, 132, 158, 26, 26, 26, - 24, 25, 26, 138, 28, 898, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 26, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 22, 36, 56, 57, 58, 59, 60, 159, 159, 63, - 26, 158, 162, 26, 26, 26, 70, 26, 26, 165, - 165, 26, 165, 26, 26, 163, 162, 98, 165, 98, - 165, 160, 36, 158, 977, 978, 36, 98, 162, 162, - 158, 136, 96, 97, 160, 98, 158, 160, 135, 160, - 160, 158, 158, 26, 162, 158, 158, 158, 36, 113, - 114, 115, 116, 143, 36, 36, 120, 26, 26, 123, - 124, 26, 165, 36, 36, 36, 162, 158, 92, 158, - 162, 158, 131, 98, 162, 26, 162, 162, 162, 143, - 163, 158, 146, 147, 148, 163, 150, 151, 152, 153, - 154, 155, 156, 157, 98, 165, 158, 158, 158, 163, - 164, 158, 166, 167, 168, 169, 162, 165, 163, 163, - 163, 163, 163, 162, 162, 165, 162, 26, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 26, 163, 70, - 161, 98, 98, 77, 98, 98, 98, 26, 158, 26, - 36, 26, 36, 26, 91, 162, 162, 26, 26, 26, - 26, 162, 26, 162, 26, 26, 162, 165, 165, 98, - 165, 136, 163, 165, 26, 126, 36, 36, 36, 165, - 173, 98, 26, 98, 26, 98, 98, 162, 131, 26, - 160, 26, 158, 160, 158, 164, 98, 98, 158, 126, - 98, 91, 98, 98, 26, 143, 36, 26, 158, 158, - 26, 26, 26, 26, 162, 162, 162, 162, 162, 28, - 162, 26, 162, 162, 26, 26, 158, 26, 158, 165, - 165, 26, 165, 26, 162, 32, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 26, 162, 72, 26, 26, - 26, 165, 162, 162, 71, 163, 163, 163, 162, 162, - 84, 133, 162, 70, 36, 162, 92, 160, 162, 160, - 98, 163, 126, 26, 162, 162, 158, 26, 163, 162, - 160, 162, 160, 33, 160, 28, 160, 71, 137, 22, - 160, 162, 26, 72, 26, 160, 36, 36, 972, 859, - 163, -1, 939, 34, 137, 162, 162, 162, 296, 162, - -1, 162, 162, 158, 162, 162, 136, 163, 158, 162, - -1, 162, -1, -1, 163, 163, 137, 163, 160, 163, - 315, 160, -1, 137, 137, 162, -1, 137, -1, 137, - -1, 137, -1, -1, 162, -1, -1, -1, -1, -1, - 162, -1, 162, -1, 162, -1, 162, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 162, -1, - 162, 162, 162, 162, 162, 162 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const unsigned char yystos[] = -{ - 0, 1, 12, 24, 25, 26, 28, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 56, 57, 58, 59, 60, 63, 70, 96, 97, 113, - 114, 115, 116, 120, 123, 124, 143, 146, 147, 148, - 150, 151, 152, 153, 154, 155, 156, 157, 163, 164, - 166, 167, 168, 169, 176, 177, 178, 179, 198, 206, - 207, 208, 209, 210, 213, 214, 219, 220, 221, 163, - 163, 220, 89, 94, 95, 98, 99, 103, 104, 98, - 100, 101, 102, 105, 212, 98, 98, 98, 98, 98, - 26, 26, 220, 220, 163, 220, 163, 220, 220, 214, - 218, 220, 163, 218, 220, 221, 221, 163, 163, 164, - 199, 164, 199, 164, 199, 164, 199, 163, 164, 164, - 98, 212, 163, 163, 163, 163, 163, 163, 26, 179, - 163, 163, 28, 64, 26, 221, 26, 83, 212, 0, - 78, 161, 98, 103, 104, 98, 26, 36, 70, 77, - 86, 87, 88, 90, 179, 206, 211, 220, 179, 211, - 211, 163, 180, 98, 65, 66, 67, 68, 70, 71, - 72, 73, 91, 92, 26, 26, 220, 26, 220, 26, - 220, 5, 6, 7, 8, 10, 11, 13, 14, 15, - 16, 17, 18, 26, 28, 29, 34, 36, 63, 70, - 75, 76, 77, 85, 86, 87, 90, 123, 124, 163, - 164, 179, 195, 200, 211, 220, 26, 26, 220, 26, - 220, 26, 149, 179, 28, 149, 143, 166, 36, 36, - 36, 36, 16, 19, 21, 23, 26, 28, 36, 86, - 87, 124, 163, 179, 211, 220, 220, 26, 26, 27, - 173, 26, 27, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 28, 26, 26, 26, 26, 26, 26, 36, - 26, 26, 57, 28, 158, 160, 162, 70, 71, 83, - 84, 202, 205, 26, 28, 178, 179, 26, 163, 72, - 179, 179, 179, 179, 163, 179, 91, 92, 93, 163, - 220, 163, 196, 135, 136, 158, 220, 221, 221, 221, - 221, 221, 221, 221, 221, 221, 221, 160, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 65, 66, 68, - 71, 79, 80, 81, 82, 91, 92, 93, 201, 202, - 163, 187, 71, 187, 26, 26, 26, 26, 26, 26, - 26, 164, 164, 26, 179, 206, 207, 208, 210, 26, - 71, 163, 163, 180, 163, 188, 163, 106, 107, 112, - 163, 106, 107, 112, 163, 163, 163, 26, 26, 36, - 179, 163, 202, 98, 91, 92, 93, 98, 202, 36, - 36, 164, 208, 210, 180, 158, 98, 162, 71, 174, - 162, 71, 158, 158, 84, 165, 165, 165, 165, 162, - 84, 202, 205, 84, 202, 205, 158, 158, 158, 158, - 158, 158, 158, 162, 98, 220, 26, 57, 26, 220, - 26, 220, 165, 165, 78, 161, 196, 26, 36, 158, - 158, 159, 159, 179, 159, 220, 220, 220, 126, 136, - 158, 162, 158, 162, 26, 36, 209, 220, 26, 26, - 26, 26, 26, 36, 26, 26, 26, 26, 26, 26, - 163, 220, 220, 220, 26, 26, 133, 134, 35, 163, - 189, 163, 190, 159, 159, 159, 159, 26, 26, 71, - 104, 179, 162, 84, 202, 205, 179, 26, 26, 158, - 133, 134, 132, 26, 220, 26, 220, 26, 220, 26, - 179, 179, 179, 26, 26, 26, 36, 138, 26, 69, - 88, 220, 220, 220, 22, 36, 159, 159, 26, 179, - 162, 158, 220, 26, 26, 26, 26, 26, 165, 220, - 165, 26, 220, 165, 220, 220, 220, 26, 220, 220, - 220, 26, 163, 98, 220, 162, 158, 162, 165, 165, - 98, 178, 160, 179, 206, 206, 36, 36, 158, 36, - 220, 162, 162, 136, 135, 98, 98, 180, 158, 160, - 160, 160, 160, 158, 158, 158, 158, 158, 26, 189, - 190, 189, 158, 163, 184, 158, 163, 185, 162, 162, - 158, 125, 126, 143, 143, 36, 36, 36, 36, 220, - 202, 205, 84, 202, 205, 26, 162, 26, 214, 216, - 217, 220, 165, 158, 158, 158, 26, 162, 162, 162, - 163, 197, 197, 197, 197, 158, 158, 162, 158, 158, - 162, 163, 163, 163, 163, 191, 191, 163, 185, 36, - 36, 84, 205, 162, 36, 162, 92, 162, 162, 162, - 162, 165, 98, 165, 165, 98, 162, 162, 162, 158, - 162, 162, 162, 131, 26, 163, 98, 26, 98, 98, - 98, 26, 161, 220, 70, 77, 179, 158, 162, 162, - 163, 179, 163, 26, 220, 220, 220, 220, 26, 36, - 26, 36, 26, 91, 26, 126, 127, 128, 182, 26, - 125, 126, 26, 162, 158, 162, 158, 162, 162, 190, - 189, 220, 165, 26, 220, 165, 162, 165, 173, 165, - 26, 26, 26, 98, 136, 220, 220, 163, 181, 36, - 36, 141, 142, 179, 179, 126, 36, 191, 26, 165, - 98, 26, 220, 98, 26, 98, 98, 26, 36, 179, - 162, 131, 3, 4, 9, 20, 160, 164, 199, 26, - 26, 158, 162, 179, 179, 158, 206, 160, 158, 158, - 158, 158, 162, 162, 162, 162, 162, 220, 98, 162, - 98, 162, 162, 98, 143, 126, 165, 187, 165, 165, - 187, 91, 170, 171, 172, 215, 98, 162, 162, 211, - 162, 162, 162, 121, 122, 162, 162, 162, 162, 158, - 158, 162, 162, 165, 211, 98, 26, 36, 26, 162, - 162, 163, 163, 26, 26, 220, 26, 26, 28, 179, - 220, 26, 26, 26, 26, 181, 187, 163, 162, 26, - 26, 32, 162, 162, 187, 187, 187, 220, 179, 190, - 180, 162, 162, 190, 26, 179, 26, 72, 180, 26, - 181, 26, 26, 160, 163, 162, 160, 162, 163, 162, - 160, 160, 160, 160, 133, 201, 202, 71, 70, 162, - 158, 162, 36, 92, 160, 160, 220, 108, 109, 110, - 111, 192, 98, 220, 126, 163, 193, 220, 220, 220, - 220, 162, 26, 26, 33, 179, 28, 71, 220, 220, - 220, 193, 162, 199, 162, 162, 137, 162, 162, 162, - 162, 163, 186, 185, 185, 162, 22, 158, 158, 162, - 163, 194, 163, 203, 203, 163, 204, 121, 122, 182, - 183, 163, 26, 26, 136, 137, 129, 130, 139, 140, - 144, 145, 158, 162, 158, 162, 36, 160, 160, 158, - 162, 158, 162, 158, 162, 158, 162, 158, 162, 158, - 162, 158, 162, 158, 162, 183, 182, 162, 220, 220, - 137, 136, 137, 137, 137, 137, 137, 137, 162, 162, - 72, 162, 162, 162, 162, 162, 162, 162, 162, 162, - 162, 36, 193, 193 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (0) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_stack_print (short int *bottom, short int *top) -#else -static void -yy_stack_print (bottom, top) - short int *bottom; - short int *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_reduce_print (int yyrule) -#else -static void -yy_reduce_print (yyrule) - int yyrule; -#endif -{ - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; -} -# endif -# endif - -# ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - size_t yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -#endif /* YYERROR_VERBOSE */ - - - -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - switch (yytype) - { - default: - break; - } - YYFPRINTF (yyoutput, ")"); -} - -#endif /* ! YYDEBUG */ -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM); -# else -int yyparse (); -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int -yyparse (void) -#else -int -yyparse () - ; -#endif -#endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short int yyssa[YYINITDEPTH]; - short int *yyss = yyssa; - short int *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK (yyvsp--, yyssp--) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short int *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - short int *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a look-ahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to look-ahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; - - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 3: -#line 569 "bfin-parse.y" - { - insn = (yyvsp[0].instr); - if (insn == (INSTR_T) 0) - return NO_INSN_GENERATED; - else if (insn == (INSTR_T) - 1) - return SEMANTIC_ERROR; - else - return INSN_GENERATED; - } - break; - - case 5: -#line 583 "bfin-parse.y" - { - if (((yyvsp[-5].instr)->value & 0xf800) == 0xc000) - { - if (is_group1 ((yyvsp[-3].instr)) && is_group2 ((yyvsp[-1].instr))) - (yyval.instr) = bfin_gen_multi_instr ((yyvsp[-5].instr), (yyvsp[-3].instr), (yyvsp[-1].instr)); - else if (is_group2 ((yyvsp[-3].instr)) && is_group1 ((yyvsp[-1].instr))) - (yyval.instr) = bfin_gen_multi_instr ((yyvsp[-5].instr), (yyvsp[-1].instr), (yyvsp[-3].instr)); - else - return yyerror ("Wrong 16 bit instructions groups, slot 2 and slot 3 must be 16-bit instrution group"); - } - else if (((yyvsp[-3].instr)->value & 0xf800) == 0xc000) - { - if (is_group1 ((yyvsp[-5].instr)) && is_group2 ((yyvsp[-1].instr))) - (yyval.instr) = bfin_gen_multi_instr ((yyvsp[-3].instr), (yyvsp[-5].instr), (yyvsp[-1].instr)); - else if (is_group2 ((yyvsp[-5].instr)) && is_group1 ((yyvsp[-1].instr))) - (yyval.instr) = bfin_gen_multi_instr ((yyvsp[-3].instr), (yyvsp[-1].instr), (yyvsp[-5].instr)); - else - return yyerror ("Wrong 16 bit instructions groups, slot 1 and slot 3 must be 16-bit instrution group"); - } - else if (((yyvsp[-1].instr)->value & 0xf800) == 0xc000) - { - if (is_group1 ((yyvsp[-5].instr)) && is_group2 ((yyvsp[-3].instr))) - (yyval.instr) = bfin_gen_multi_instr ((yyvsp[-1].instr), (yyvsp[-5].instr), (yyvsp[-3].instr)); - else if (is_group2 ((yyvsp[-5].instr)) && is_group1 ((yyvsp[-3].instr))) - (yyval.instr) = bfin_gen_multi_instr ((yyvsp[-1].instr), (yyvsp[-3].instr), (yyvsp[-5].instr)); - else - return yyerror ("Wrong 16 bit instructions groups, slot 1 and slot 2 must be 16-bit instrution group"); - } - else - error ("\nIllegal Multi Issue Construct, at least any one of the slot must be DSP32 instruction group\n"); - } - break; - - case 6: -#line 616 "bfin-parse.y" - { - if (((yyvsp[-3].instr)->value & 0xf800) == 0xc000) - { - if (is_group1 ((yyvsp[-1].instr))) - (yyval.instr) = bfin_gen_multi_instr ((yyvsp[-3].instr), (yyvsp[-1].instr), 0); - else if (is_group2 ((yyvsp[-1].instr))) - (yyval.instr) = bfin_gen_multi_instr ((yyvsp[-3].instr), 0, (yyvsp[-1].instr)); - else - return yyerror ("Wrong 16 bit instructions groups, slot 2 must be the 16-bit instruction group"); - } - else if (((yyvsp[-1].instr)->value & 0xf800) == 0xc000) - { - if (is_group1 ((yyvsp[-3].instr))) - (yyval.instr) = bfin_gen_multi_instr ((yyvsp[-1].instr), (yyvsp[-3].instr), 0); - else if (is_group2 ((yyvsp[-3].instr))) - (yyval.instr) = bfin_gen_multi_instr ((yyvsp[-1].instr), 0, (yyvsp[-3].instr)); - else - return yyerror ("Wrong 16 bit instructions groups, slot 1 must be the 16-bit instruction group"); - } - else if (is_group1 ((yyvsp[-3].instr)) && is_group2 ((yyvsp[-1].instr))) - (yyval.instr) = bfin_gen_multi_instr (0, (yyvsp[-3].instr), (yyvsp[-1].instr)); - else if (is_group2 ((yyvsp[-3].instr)) && is_group1 ((yyvsp[-1].instr))) - (yyval.instr) = bfin_gen_multi_instr (0, (yyvsp[-1].instr), (yyvsp[-3].instr)); - else - return yyerror ("Wrong 16 bit instructions groups, slot 1 and slot 2 must be the 16-bit instruction group"); - } - break; - - case 7: -#line 643 "bfin-parse.y" - { - (yyval.instr) = 0; - yyerror (""); - yyerrok; - } - break; - - case 8: -#line 654 "bfin-parse.y" - { - (yyval.instr) = DSP32MAC (3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0); - } - break; - - case 9: -#line 658 "bfin-parse.y" - { - int op0, op1; - int w0 = 0, w1 = 0; - int h00, h10, h01, h11; - - if ((yyvsp[-1].macfunc).n == 0) - { - if ((yyvsp[0].mod).MM) - return yyerror ("(m) not allowed with a0 unit"); - op1 = 3; - op0 = (yyvsp[-1].macfunc).op; - w1 = 0; - w0 = (yyvsp[-1].macfunc).w; - h00 = IS_H ((yyvsp[-1].macfunc).s0); - h10 = IS_H ((yyvsp[-1].macfunc).s1); - h01 = h11 = 0; - } - else - { - op1 = (yyvsp[-1].macfunc).op; - op0 = 3; - w1 = (yyvsp[-1].macfunc).w; - w0 = 0; - h00 = h10 = 0; - h01 = IS_H ((yyvsp[-1].macfunc).s0); - h11 = IS_H ((yyvsp[-1].macfunc).s1); - } - (yyval.instr) = DSP32MAC (op1, (yyvsp[0].mod).MM, (yyvsp[0].mod).mod, w1, (yyvsp[-1].macfunc).P, h01, h11, h00, h10, - &(yyvsp[-1].macfunc).dst, op0, &(yyvsp[-1].macfunc).s0, &(yyvsp[-1].macfunc).s1, w0); - } - break; - - case 10: -#line 693 "bfin-parse.y" - { - Register *dst; - - if (check_macfuncs (&(yyvsp[-4].macfunc), &(yyvsp[-3].mod), &(yyvsp[-1].macfunc), &(yyvsp[0].mod)) < 0) - return -1; - notethat ("assign_macfunc (.), assign_macfunc (.)\n"); - - if ((yyvsp[-4].macfunc).w) - dst = &(yyvsp[-4].macfunc).dst; - else - dst = &(yyvsp[-1].macfunc).dst; - - (yyval.instr) = DSP32MAC ((yyvsp[-4].macfunc).op, (yyvsp[-3].mod).MM, (yyvsp[0].mod).mod, (yyvsp[-4].macfunc).w, (yyvsp[-4].macfunc).P, - IS_H ((yyvsp[-4].macfunc).s0), IS_H ((yyvsp[-4].macfunc).s1), IS_H ((yyvsp[-1].macfunc).s0), IS_H ((yyvsp[-1].macfunc).s1), - dst, (yyvsp[-1].macfunc).op, &(yyvsp[-4].macfunc).s0, &(yyvsp[-4].macfunc).s1, (yyvsp[-1].macfunc).w); - } - break; - - case 11: -#line 713 "bfin-parse.y" - { - notethat ("dsp32alu: DISALGNEXCPT\n"); - (yyval.instr) = DSP32ALU (18, 0, 0, 0, 0, 0, 0, 0, 3); - } - break; - - case 12: -#line 718 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-5].reg)) && !IS_A1 ((yyvsp[-2].reg)) && IS_A1 ((yyvsp[-1].reg))) - { - notethat ("dsp32alu: dregs = ( A0 += A1 )\n"); - (yyval.instr) = DSP32ALU (11, 0, 0, &(yyvsp[-5].reg), 0, 0, 0, 0, 0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 13: -#line 728 "bfin-parse.y" - { - if (!IS_A1 ((yyvsp[-2].reg)) && IS_A1 ((yyvsp[-1].reg))) - { - notethat ("dsp32alu: dregs_half = ( A0 += A1 )\n"); - (yyval.instr) = DSP32ALU (11, IS_H ((yyvsp[-5].reg)), 0, &(yyvsp[-5].reg), 0, 0, 0, 0, 1); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 14: -#line 738 "bfin-parse.y" - { - notethat ("dsp32alu: A_ZERO_DOT_H = dregs_hi\n"); - (yyval.instr) = DSP32ALU (9, IS_H ((yyvsp[0].reg)), 0, 0, &(yyvsp[0].reg), 0, 0, 0, 0); - } - break; - - case 15: -#line 743 "bfin-parse.y" - { - notethat ("dsp32alu: A_ZERO_DOT_H = dregs_hi\n"); - (yyval.instr) = DSP32ALU (9, IS_H ((yyvsp[0].reg)), 0, 0, &(yyvsp[0].reg), 0, 0, 0, 2); - } - break; - - case 16: -#line 749 "bfin-parse.y" - { - if (!IS_DREG ((yyvsp[-15].reg)) || !IS_DREG ((yyvsp[-13].reg))) - return yyerror ("Dregs expected"); - else if (!valid_dreg_pair (&(yyvsp[-8].reg), (yyvsp[-6].expr))) - return yyerror ("Bad dreg pair"); - else if (!valid_dreg_pair (&(yyvsp[-4].reg), (yyvsp[-2].expr))) - return yyerror ("Bad dreg pair"); - else - { - notethat ("dsp32alu: (dregs , dregs ) = BYTEOP16P (dregs_pair , dregs_pair ) (half)\n"); - (yyval.instr) = DSP32ALU (21, 0, &(yyvsp[-15].reg), &(yyvsp[-13].reg), &(yyvsp[-8].reg), &(yyvsp[-4].reg), (yyvsp[0].r0).r0, 0, 0); - } - } - break; - - case 17: -#line 765 "bfin-parse.y" - { - if (!IS_DREG ((yyvsp[-15].reg)) || !IS_DREG((yyvsp[-13].reg))) - return yyerror ("Dregs expected"); - else if (!valid_dreg_pair (&(yyvsp[-8].reg), (yyvsp[-6].expr))) - return yyerror ("Bad dreg pair"); - else if (!valid_dreg_pair (&(yyvsp[-4].reg), (yyvsp[-2].expr))) - return yyerror ("Bad dreg pair"); - else - { - notethat ("dsp32alu: (dregs , dregs ) = BYTEOP16M (dregs_pair , dregs_pair ) (aligndir)\n"); - (yyval.instr) = DSP32ALU (21, 0, &(yyvsp[-15].reg), &(yyvsp[-13].reg), &(yyvsp[-8].reg), &(yyvsp[-4].reg), (yyvsp[0].r0).r0, 0, 1); - } - } - break; - - case 18: -#line 780 "bfin-parse.y" - { - if (!IS_DREG ((yyvsp[-9].reg)) || !IS_DREG ((yyvsp[-7].reg))) - return yyerror ("Dregs expected"); - else if (!valid_dreg_pair (&(yyvsp[-3].reg), (yyvsp[-1].expr))) - return yyerror ("Bad dreg pair"); - else - { - notethat ("dsp32alu: (dregs , dregs ) = BYTEUNPACK dregs_pair (aligndir)\n"); - (yyval.instr) = DSP32ALU (24, 0, &(yyvsp[-9].reg), &(yyvsp[-7].reg), &(yyvsp[-3].reg), 0, (yyvsp[0].r0).r0, 0, 1); - } - } - break; - - case 19: -#line 792 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-9].reg)) && IS_DREG ((yyvsp[-7].reg)) && IS_DREG ((yyvsp[-3].reg))) - { - notethat ("dsp32alu: (dregs , dregs ) = SEARCH dregs (searchmod)\n"); - (yyval.instr) = DSP32ALU (13, 0, &(yyvsp[-9].reg), &(yyvsp[-7].reg), &(yyvsp[-3].reg), 0, 0, 0, (yyvsp[-1].r0).r0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 20: -#line 803 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-10].reg)) && IS_DREG ((yyvsp[-4].reg))) - { - notethat ("dsp32alu: dregs = A1.l + A1.h, dregs = A0.l + A0.h \n"); - (yyval.instr) = DSP32ALU (12, 0, &(yyvsp[-10].reg), &(yyvsp[-4].reg), 0, 0, 0, 0, 1); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 21: -#line 815 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-11].reg)) && IS_DREG ((yyvsp[-5].reg)) && !REG_SAME ((yyvsp[-9].reg), (yyvsp[-7].reg)) - && IS_A1 ((yyvsp[-3].reg)) && !IS_A1 ((yyvsp[-1].reg))) - { - notethat ("dsp32alu: dregs = A1 + A0 , dregs = A1 - A0 (amod1)\n"); - (yyval.instr) = DSP32ALU (17, 0, &(yyvsp[-11].reg), &(yyvsp[-5].reg), 0, 0, (yyvsp[0].modcodes).s0, (yyvsp[0].modcodes).x0, 0); - - } - else if (IS_DREG ((yyvsp[-11].reg)) && IS_DREG ((yyvsp[-5].reg)) && !REG_SAME ((yyvsp[-9].reg), (yyvsp[-7].reg)) - && !IS_A1 ((yyvsp[-3].reg)) && IS_A1 ((yyvsp[-1].reg))) - { - notethat ("dsp32alu: dregs = A0 + A1 , dregs = A0 - A1 (amod1)\n"); - (yyval.instr) = DSP32ALU (17, 0, &(yyvsp[-11].reg), &(yyvsp[-5].reg), 0, 0, (yyvsp[0].modcodes).s0, (yyvsp[0].modcodes).x0, 1); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 22: -#line 834 "bfin-parse.y" - { - if ((yyvsp[-8].r0).r0 == (yyvsp[-2].r0).r0) - return yyerror ("Operators must differ"); - - if (IS_DREG ((yyvsp[-11].reg)) && IS_DREG ((yyvsp[-9].reg)) && IS_DREG ((yyvsp[-7].reg)) - && REG_SAME ((yyvsp[-9].reg), (yyvsp[-3].reg)) && REG_SAME ((yyvsp[-7].reg), (yyvsp[-1].reg))) - { - notethat ("dsp32alu: dregs = dregs + dregs," - "dregs = dregs - dregs (amod1)\n"); - (yyval.instr) = DSP32ALU (4, 0, &(yyvsp[-11].reg), &(yyvsp[-5].reg), &(yyvsp[-9].reg), &(yyvsp[-7].reg), (yyvsp[0].modcodes).s0, (yyvsp[0].modcodes).x0, 2); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 23: -#line 852 "bfin-parse.y" - { - if (!REG_SAME ((yyvsp[-9].reg), (yyvsp[-3].reg)) || !REG_SAME ((yyvsp[-7].reg), (yyvsp[-1].reg))) - return yyerror ("Differing source registers"); - - if (!IS_DREG ((yyvsp[-11].reg)) || !IS_DREG ((yyvsp[-9].reg)) || !IS_DREG ((yyvsp[-7].reg)) || !IS_DREG ((yyvsp[-5].reg))) - return yyerror ("Dregs expected"); - - - if ((yyvsp[-8].r0).r0 == 1 && (yyvsp[-2].r0).r0 == 2) - { - notethat ("dsp32alu: dregs = dregs .|. dregs , dregs = dregs .|. dregs (amod2)\n"); - (yyval.instr) = DSP32ALU (1, 1, &(yyvsp[-11].reg), &(yyvsp[-5].reg), &(yyvsp[-9].reg), &(yyvsp[-7].reg), (yyvsp[0].modcodes).s0, (yyvsp[0].modcodes).x0, (yyvsp[0].modcodes).r0); - } - else if ((yyvsp[-8].r0).r0 == 0 && (yyvsp[-2].r0).r0 == 3) - { - notethat ("dsp32alu: dregs = dregs .|. dregs , dregs = dregs .|. dregs (amod2)\n"); - (yyval.instr) = DSP32ALU (1, 0, &(yyvsp[-11].reg), &(yyvsp[-5].reg), &(yyvsp[-9].reg), &(yyvsp[-7].reg), (yyvsp[0].modcodes).s0, (yyvsp[0].modcodes).x0, (yyvsp[0].modcodes).r0); - } - else - return yyerror ("Bar operand mismatch"); - } - break; - - case 24: -#line 875 "bfin-parse.y" - { - int op; - - if (IS_DREG ((yyvsp[-4].reg)) && IS_DREG ((yyvsp[-1].reg))) - { - if ((yyvsp[0].r0).r0) - { - notethat ("dsp32alu: dregs = ABS dregs (v)\n"); - op = 6; - } - else - { - /* Vector version of ABS. */ - notethat ("dsp32alu: dregs = ABS dregs\n"); - op = 7; - } - (yyval.instr) = DSP32ALU (op, 0, 0, &(yyvsp[-4].reg), &(yyvsp[-1].reg), 0, 0, 0, 2); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 25: -#line 897 "bfin-parse.y" - { - notethat ("dsp32alu: Ax = ABS Ax\n"); - (yyval.instr) = DSP32ALU (16, IS_A1 ((yyvsp[-2].reg)), 0, 0, 0, 0, 0, 0, IS_A1 ((yyvsp[0].reg))); - } - break; - - case 26: -#line 902 "bfin-parse.y" - { - if (IS_DREG_L ((yyvsp[0].reg))) - { - notethat ("dsp32alu: A0.l = reg_half\n"); - (yyval.instr) = DSP32ALU (9, IS_H ((yyvsp[0].reg)), 0, 0, &(yyvsp[0].reg), 0, 0, 0, 0); - } - else - return yyerror ("A0.l = Rx.l expected"); - } - break; - - case 27: -#line 912 "bfin-parse.y" - { - if (IS_DREG_L ((yyvsp[0].reg))) - { - notethat ("dsp32alu: A1.l = reg_half\n"); - (yyval.instr) = DSP32ALU (9, IS_H ((yyvsp[0].reg)), 0, 0, &(yyvsp[0].reg), 0, 0, 0, 2); - } - else - return yyerror ("A1.l = Rx.l expected"); - } - break; - - case 28: -#line 923 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-7].reg)) && IS_DREG ((yyvsp[-3].reg)) && IS_DREG ((yyvsp[-1].reg))) - { - notethat ("dsp32shift: dregs = ALIGN8 (dregs , dregs )\n"); - (yyval.instr) = DSP32SHIFT (13, &(yyvsp[-7].reg), &(yyvsp[-1].reg), &(yyvsp[-3].reg), (yyvsp[-5].r0).r0, 0); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 29: -#line 934 "bfin-parse.y" - { - if (!IS_DREG ((yyvsp[-12].reg))) - return yyerror ("Dregs expected"); - else if (!valid_dreg_pair (&(yyvsp[-8].reg), (yyvsp[-6].expr))) - return yyerror ("Bad dreg pair"); - else if (!valid_dreg_pair (&(yyvsp[-4].reg), (yyvsp[-2].expr))) - return yyerror ("Bad dreg pair"); - else - { - notethat ("dsp32alu: dregs = BYTEOP1P (dregs_pair , dregs_pair ) (T)\n"); - (yyval.instr) = DSP32ALU (20, 0, 0, &(yyvsp[-12].reg), &(yyvsp[-8].reg), &(yyvsp[-4].reg), (yyvsp[0].modcodes).s0, 0, (yyvsp[0].modcodes).r0); - } - } - break; - - case 30: -#line 948 "bfin-parse.y" - { - if (!IS_DREG ((yyvsp[-11].reg))) - return yyerror ("Dregs expected"); - else if (!valid_dreg_pair (&(yyvsp[-7].reg), (yyvsp[-5].expr))) - return yyerror ("Bad dreg pair"); - else if (!valid_dreg_pair (&(yyvsp[-3].reg), (yyvsp[-1].expr))) - return yyerror ("Bad dreg pair"); - else - { - notethat ("dsp32alu: dregs = BYTEOP1P (dregs_pair , dregs_pair ) (T)\n"); - (yyval.instr) = DSP32ALU (20, 0, 0, &(yyvsp[-11].reg), &(yyvsp[-7].reg), &(yyvsp[-3].reg), 0, 0, 0); - } - } - break; - - case 31: -#line 964 "bfin-parse.y" - { - if (!IS_DREG ((yyvsp[-12].reg))) - return yyerror ("Dregs expected"); - else if (!valid_dreg_pair (&(yyvsp[-8].reg), (yyvsp[-6].expr))) - return yyerror ("Bad dreg pair"); - else if (!valid_dreg_pair (&(yyvsp[-4].reg), (yyvsp[-2].expr))) - return yyerror ("Bad dreg pair"); - else - { - notethat ("dsp32alu: dregs = BYTEOP2P (dregs_pair , dregs_pair ) (rnd_op)\n"); - (yyval.instr) = DSP32ALU (22, (yyvsp[0].modcodes).r0, 0, &(yyvsp[-12].reg), &(yyvsp[-8].reg), &(yyvsp[-4].reg), (yyvsp[0].modcodes).s0, (yyvsp[0].modcodes).x0, (yyvsp[0].modcodes).aop); - } - } - break; - - case 32: -#line 980 "bfin-parse.y" - { - if (!IS_DREG ((yyvsp[-12].reg))) - return yyerror ("Dregs expected"); - else if (!valid_dreg_pair (&(yyvsp[-8].reg), (yyvsp[-6].expr))) - return yyerror ("Bad dreg pair"); - else if (!valid_dreg_pair (&(yyvsp[-4].reg), (yyvsp[-2].expr))) - return yyerror ("Bad dreg pair"); - else - { - notethat ("dsp32alu: dregs = BYTEOP2P (dregs_pair , dregs_pair ) (rnd_op)\n"); - (yyval.instr) = DSP32ALU (22, (yyvsp[0].modcodes).r0, 0, &(yyvsp[-12].reg), &(yyvsp[-8].reg), &(yyvsp[-4].reg), (yyvsp[0].modcodes).s0, 0, (yyvsp[0].modcodes).x0); - } - } - break; - - case 33: -#line 996 "bfin-parse.y" - { - if (!IS_DREG ((yyvsp[-12].reg))) - return yyerror ("Dregs expected"); - else if (!valid_dreg_pair (&(yyvsp[-8].reg), (yyvsp[-6].expr))) - return yyerror ("Bad dreg pair"); - else if (!valid_dreg_pair (&(yyvsp[-4].reg), (yyvsp[-2].expr))) - return yyerror ("Bad dreg pair"); - else - { - notethat ("dsp32alu: dregs = BYTEOP3P (dregs_pair , dregs_pair ) (b3_op)\n"); - (yyval.instr) = DSP32ALU (23, (yyvsp[0].modcodes).x0, 0, &(yyvsp[-12].reg), &(yyvsp[-8].reg), &(yyvsp[-4].reg), (yyvsp[0].modcodes).s0, 0, 0); - } - } - break; - - case 34: -#line 1011 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-7].reg)) && IS_DREG ((yyvsp[-3].reg)) && IS_DREG ((yyvsp[-1].reg))) - { - notethat ("dsp32alu: dregs = BYTEPACK (dregs , dregs )\n"); - (yyval.instr) = DSP32ALU (24, 0, 0, &(yyvsp[-7].reg), &(yyvsp[-3].reg), &(yyvsp[-1].reg), 0, 0, 0); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 35: -#line 1023 "bfin-parse.y" - { - if (IS_HCOMPL ((yyvsp[-16].reg), (yyvsp[-14].reg)) && IS_HCOMPL ((yyvsp[-10].reg), (yyvsp[-3].reg)) && IS_HCOMPL ((yyvsp[-7].reg), (yyvsp[0].reg))) - { - notethat ("dsp32alu: dregs_hi = dregs_lo =" - "SIGN (dregs_hi) * dregs_hi + " - "SIGN (dregs_lo) * dregs_lo \n"); - - (yyval.instr) = DSP32ALU (12, 0, 0, &(yyvsp[-16].reg), &(yyvsp[-10].reg), &(yyvsp[-7].reg), 0, 0, 0); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 36: -#line 1036 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-5].reg)) && IS_DREG ((yyvsp[-3].reg)) && IS_DREG ((yyvsp[-1].reg))) - { - if ((yyvsp[0].modcodes).aop == 0) - { - /* No saturation flag specified, generate the 16 bit variant. */ - notethat ("COMP3op: dregs = dregs +- dregs\n"); - (yyval.instr) = COMP3OP (&(yyvsp[-5].reg), &(yyvsp[-3].reg), &(yyvsp[-1].reg), (yyvsp[-2].r0).r0); - } - else - { - /* Saturation flag specified, generate the 32 bit variant. */ - notethat ("dsp32alu: dregs = dregs +- dregs (amod1)\n"); - (yyval.instr) = DSP32ALU (4, 0, 0, &(yyvsp[-5].reg), &(yyvsp[-3].reg), &(yyvsp[-1].reg), (yyvsp[0].modcodes).s0, (yyvsp[0].modcodes).x0, (yyvsp[-2].r0).r0); - } - } - else - if (IS_PREG ((yyvsp[-5].reg)) && IS_PREG ((yyvsp[-3].reg)) && IS_PREG ((yyvsp[-1].reg)) && (yyvsp[-2].r0).r0 == 0) - { - notethat ("COMP3op: pregs = pregs + pregs\n"); - (yyval.instr) = COMP3OP (&(yyvsp[-5].reg), &(yyvsp[-3].reg), &(yyvsp[-1].reg), 5); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 37: -#line 1062 "bfin-parse.y" - { - int op; - - if (IS_DREG ((yyvsp[-8].reg)) && IS_DREG ((yyvsp[-4].reg)) && IS_DREG ((yyvsp[-2].reg))) - { - if ((yyvsp[0].r0).r0) - op = 6; - else - op = 7; - - notethat ("dsp32alu: dregs = {MIN|MAX} (dregs, dregs)\n"); - (yyval.instr) = DSP32ALU (op, 0, 0, &(yyvsp[-8].reg), &(yyvsp[-4].reg), &(yyvsp[-2].reg), 0, 0, (yyvsp[-6].r0).r0); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 38: -#line 1080 "bfin-parse.y" - { - notethat ("dsp32alu: Ax = - Ax\n"); - (yyval.instr) = DSP32ALU (14, IS_A1 ((yyvsp[-2].reg)), 0, 0, 0, 0, 0, 0, IS_A1 ((yyvsp[0].reg))); - } - break; - - case 39: -#line 1085 "bfin-parse.y" - { - notethat ("dsp32alu: dregs_lo = dregs_lo +- dregs_lo (amod1)\n"); - (yyval.instr) = DSP32ALU (2 | (yyvsp[-2].r0).r0, IS_H ((yyvsp[-5].reg)), 0, &(yyvsp[-5].reg), &(yyvsp[-3].reg), &(yyvsp[-1].reg), - (yyvsp[0].modcodes).s0, (yyvsp[0].modcodes).x0, HL2 ((yyvsp[-3].reg), (yyvsp[-1].reg))); - } - break; - - case 40: -#line 1091 "bfin-parse.y" - { - if (EXPR_VALUE ((yyvsp[0].expr)) == 0 && !REG_SAME ((yyvsp[-2].reg), (yyvsp[-1].reg))) - { - notethat ("dsp32alu: A1 = A0 = 0\n"); - (yyval.instr) = DSP32ALU (8, 0, 0, 0, 0, 0, 0, 0, 2); - } - else - return yyerror ("Bad value, 0 expected"); - } - break; - - case 41: -#line 1103 "bfin-parse.y" - { - if (REG_SAME ((yyvsp[-4].reg), (yyvsp[-3].reg))) - { - notethat ("dsp32alu: Ax = Ax (S)\n"); - (yyval.instr) = DSP32ALU (8, 0, 0, 0, 0, 0, 1, 0, IS_A1 ((yyvsp[-4].reg))); - } - else - return yyerror ("Registers must be equal"); - } - break; - - case 42: -#line 1114 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-3].reg))) - { - notethat ("dsp32alu: dregs_half = dregs (RND)\n"); - (yyval.instr) = DSP32ALU (12, IS_H ((yyvsp[-5].reg)), 0, &(yyvsp[-5].reg), &(yyvsp[-3].reg), 0, 0, 0, 3); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 43: -#line 1125 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-5].reg)) && IS_DREG ((yyvsp[-3].reg))) - { - notethat ("dsp32alu: dregs_half = dregs (+-) dregs (RND12)\n"); - (yyval.instr) = DSP32ALU (5, IS_H ((yyvsp[-7].reg)), 0, &(yyvsp[-7].reg), &(yyvsp[-5].reg), &(yyvsp[-3].reg), 0, 0, (yyvsp[-4].r0).r0); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 44: -#line 1136 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-5].reg)) && IS_DREG ((yyvsp[-3].reg))) - { - notethat ("dsp32alu: dregs_half = dregs -+ dregs (RND20)\n"); - (yyval.instr) = DSP32ALU (5, IS_H ((yyvsp[-7].reg)), 0, &(yyvsp[-7].reg), &(yyvsp[-5].reg), &(yyvsp[-3].reg), 0, 1, (yyvsp[-4].r0).r0 | 2); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 45: -#line 1147 "bfin-parse.y" - { - if (!REG_SAME ((yyvsp[-1].reg), (yyvsp[0].reg))) - { - notethat ("dsp32alu: An = Am\n"); - (yyval.instr) = DSP32ALU (8, 0, 0, 0, 0, 0, IS_A1 ((yyvsp[-1].reg)), 0, 3); - } - else - return yyerror ("Accu reg arguments must differ"); - } - break; - - case 46: -#line 1158 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[0].reg))) - { - notethat ("dsp32alu: An = dregs\n"); - (yyval.instr) = DSP32ALU (9, 0, 0, 0, &(yyvsp[0].reg), 0, 1, 0, IS_A1 ((yyvsp[-1].reg)) << 1); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 47: -#line 1169 "bfin-parse.y" - { - if (!IS_H ((yyvsp[-1].reg))) - { - if ((yyvsp[-3].reg).regno == REG_A0x && IS_DREG ((yyvsp[-1].reg))) - { - notethat ("dsp32alu: A0.x = dregs_lo\n"); - (yyval.instr) = DSP32ALU (9, 0, 0, 0, &(yyvsp[-1].reg), 0, 0, 0, 1); - } - else if ((yyvsp[-3].reg).regno == REG_A1x && IS_DREG ((yyvsp[-1].reg))) - { - notethat ("dsp32alu: A1.x = dregs_lo\n"); - (yyval.instr) = DSP32ALU (9, 0, 0, 0, &(yyvsp[-1].reg), 0, 0, 0, 3); - } - else if (IS_DREG ((yyvsp[-3].reg)) && IS_DREG ((yyvsp[-1].reg))) - { - notethat ("ALU2op: dregs = dregs_lo\n"); - (yyval.instr) = ALU2OP (&(yyvsp[-3].reg), &(yyvsp[-1].reg), 10 | ((yyvsp[0].r0).r0 ? 0: 1)); - } - else - return yyerror ("Register mismatch"); - } - else - return yyerror ("Low reg expected"); - } - break; - - case 48: -#line 1195 "bfin-parse.y" - { - notethat ("LDIMMhalf: pregs_half = imm16\n"); - - if (!IS_DREG ((yyvsp[-2].reg)) && !IS_PREG ((yyvsp[-2].reg)) && !IS_IREG ((yyvsp[-2].reg)) - && !IS_MREG ((yyvsp[-2].reg)) && !IS_BREG ((yyvsp[-2].reg)) && !IS_LREG ((yyvsp[-2].reg))) - return yyerror ("Wrong register for load immediate"); - - if (!IS_IMM ((yyvsp[0].expr), 16) && !IS_UIMM ((yyvsp[0].expr), 16)) - return yyerror ("Constant out of range"); - - (yyval.instr) = LDIMMHALF_R (&(yyvsp[-2].reg), IS_H ((yyvsp[-2].reg)), 0, 0, (yyvsp[0].expr)); - } - break; - - case 49: -#line 1209 "bfin-parse.y" - { - notethat ("dsp32alu: An = 0\n"); - - if (imm7 ((yyvsp[0].expr)) != 0) - return yyerror ("0 expected"); - - (yyval.instr) = DSP32ALU (8, 0, 0, 0, 0, 0, 0, 0, IS_A1 ((yyvsp[-1].reg))); - } - break; - - case 50: -#line 1219 "bfin-parse.y" - { - if (!IS_DREG ((yyvsp[-3].reg)) && !IS_PREG ((yyvsp[-3].reg)) && !IS_IREG ((yyvsp[-3].reg)) - && !IS_MREG ((yyvsp[-3].reg)) && !IS_BREG ((yyvsp[-3].reg)) && !IS_LREG ((yyvsp[-3].reg))) - return yyerror ("Wrong register for load immediate"); - - if ((yyvsp[0].r0).r0 == 0) - { - /* 7 bit immediate value if possible. - We will check for that constant value for efficiency - If it goes to reloc, it will be 16 bit. */ - if (IS_CONST ((yyvsp[-1].expr)) && IS_IMM ((yyvsp[-1].expr), 7) && IS_DREG ((yyvsp[-3].reg))) - { - notethat ("COMPI2opD: dregs = imm7 (x) \n"); - (yyval.instr) = COMPI2OPD (&(yyvsp[-3].reg), imm7 ((yyvsp[-1].expr)), 0); - } - else if (IS_CONST ((yyvsp[-1].expr)) && IS_IMM ((yyvsp[-1].expr), 7) && IS_PREG ((yyvsp[-3].reg))) - { - notethat ("COMPI2opP: pregs = imm7 (x)\n"); - (yyval.instr) = COMPI2OPP (&(yyvsp[-3].reg), imm7 ((yyvsp[-1].expr)), 0); - } - else - { - if (IS_CONST ((yyvsp[-1].expr)) && !IS_IMM ((yyvsp[-1].expr), 16)) - return yyerror ("Immediate value out of range"); - - notethat ("LDIMMhalf: regs = luimm16 (x)\n"); - /* reg, H, S, Z. */ - (yyval.instr) = LDIMMHALF_R5 (&(yyvsp[-3].reg), 0, 1, 0, (yyvsp[-1].expr)); - } - } - else - { - /* (z) There is no 7 bit zero extended instruction. - If the expr is a relocation, generate it. */ - - if (IS_CONST ((yyvsp[-1].expr)) && !IS_UIMM ((yyvsp[-1].expr), 16)) - return yyerror ("Immediate value out of range"); - - notethat ("LDIMMhalf: regs = luimm16 (x)\n"); - /* reg, H, S, Z. */ - (yyval.instr) = LDIMMHALF_R5 (&(yyvsp[-3].reg), 0, 0, 1, (yyvsp[-1].expr)); - } - } - break; - - case 51: -#line 1264 "bfin-parse.y" - { - if (IS_H ((yyvsp[-2].reg))) - return yyerror ("Low reg expected"); - - if (IS_DREG ((yyvsp[-2].reg)) && (yyvsp[0].reg).regno == REG_A0x) - { - notethat ("dsp32alu: dregs_lo = A0.x\n"); - (yyval.instr) = DSP32ALU (10, 0, 0, &(yyvsp[-2].reg), 0, 0, 0, 0, 0); - } - else if (IS_DREG ((yyvsp[-2].reg)) && (yyvsp[0].reg).regno == REG_A1x) - { - notethat ("dsp32alu: dregs_lo = A1.x\n"); - (yyval.instr) = DSP32ALU (10, 0, 0, &(yyvsp[-2].reg), 0, 0, 0, 0, 1); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 52: -#line 1283 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-5].reg)) && IS_DREG ((yyvsp[-3].reg)) && IS_DREG ((yyvsp[-1].reg))) - { - notethat ("dsp32alu: dregs = dregs .|. dregs (amod0)\n"); - (yyval.instr) = DSP32ALU (0, 0, 0, &(yyvsp[-5].reg), &(yyvsp[-3].reg), &(yyvsp[-1].reg), (yyvsp[0].modcodes).s0, (yyvsp[0].modcodes).x0, (yyvsp[-2].r0).r0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 53: -#line 1294 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-3].reg)) && IS_DREG ((yyvsp[-1].reg))) - { - notethat ("ALU2op: dregs = dregs_byte\n"); - (yyval.instr) = ALU2OP (&(yyvsp[-3].reg), &(yyvsp[-1].reg), 12 | ((yyvsp[0].r0).r0 ? 0: 1)); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 54: -#line 1305 "bfin-parse.y" - { - if (REG_SAME ((yyvsp[-6].reg), (yyvsp[-4].reg)) && REG_SAME ((yyvsp[-2].reg), (yyvsp[0].reg)) && !REG_SAME ((yyvsp[-6].reg), (yyvsp[-2].reg))) - { - notethat ("dsp32alu: A1 = ABS A1 , A0 = ABS A0\n"); - (yyval.instr) = DSP32ALU (16, 0, 0, 0, 0, 0, 0, 0, 3); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 55: -#line 1316 "bfin-parse.y" - { - if (REG_SAME ((yyvsp[-6].reg), (yyvsp[-4].reg)) && REG_SAME ((yyvsp[-2].reg), (yyvsp[0].reg)) && !REG_SAME ((yyvsp[-6].reg), (yyvsp[-2].reg))) - { - notethat ("dsp32alu: A1 = - A1 , A0 = - A0\n"); - (yyval.instr) = DSP32ALU (14, 0, 0, 0, 0, 0, 0, 0, 3); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 56: -#line 1327 "bfin-parse.y" - { - if (!IS_A1 ((yyvsp[-2].reg)) && IS_A1 ((yyvsp[-1].reg))) - { - notethat ("dsp32alu: A0 -= A1\n"); - (yyval.instr) = DSP32ALU (11, 0, 0, 0, 0, 0, (yyvsp[0].r0).r0, 0, 3); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 57: -#line 1338 "bfin-parse.y" - { - if (IS_IREG ((yyvsp[-2].reg)) && EXPR_VALUE ((yyvsp[0].expr)) == 4) - { - notethat ("dagMODik: iregs -= 4\n"); - (yyval.instr) = DAGMODIK (&(yyvsp[-2].reg), 3); - } - else if (IS_IREG ((yyvsp[-2].reg)) && EXPR_VALUE ((yyvsp[0].expr)) == 2) - { - notethat ("dagMODik: iregs -= 2\n"); - (yyval.instr) = DAGMODIK (&(yyvsp[-2].reg), 1); - } - else - return yyerror ("Register or value mismatch"); - } - break; - - case 58: -#line 1354 "bfin-parse.y" - { - if (IS_IREG ((yyvsp[-5].reg)) && IS_MREG ((yyvsp[-3].reg))) - { - notethat ("dagMODim: iregs += mregs (opt_brev)\n"); - /* i, m, op, br. */ - (yyval.instr) = DAGMODIM (&(yyvsp[-5].reg), &(yyvsp[-3].reg), 0, 1); - } - else if (IS_PREG ((yyvsp[-5].reg)) && IS_PREG ((yyvsp[-3].reg))) - { - notethat ("PTR2op: pregs += pregs (BREV )\n"); - (yyval.instr) = PTR2OP (&(yyvsp[-5].reg), &(yyvsp[-3].reg), 5); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 59: -#line 1371 "bfin-parse.y" - { - if (IS_IREG ((yyvsp[-2].reg)) && IS_MREG ((yyvsp[0].reg))) - { - notethat ("dagMODim: iregs -= mregs\n"); - (yyval.instr) = DAGMODIM (&(yyvsp[-2].reg), &(yyvsp[0].reg), 1, 0); - } - else if (IS_PREG ((yyvsp[-2].reg)) && IS_PREG ((yyvsp[0].reg))) - { - notethat ("PTR2op: pregs -= pregs\n"); - (yyval.instr) = PTR2OP (&(yyvsp[-2].reg), &(yyvsp[0].reg), 0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 60: -#line 1387 "bfin-parse.y" - { - if (!IS_A1 ((yyvsp[-3].reg)) && IS_A1 ((yyvsp[-1].reg))) - { - notethat ("dsp32alu: A0 += A1 (W32)\n"); - (yyval.instr) = DSP32ALU (11, 0, 0, 0, 0, 0, (yyvsp[0].r0).r0, 0, 2); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 61: -#line 1398 "bfin-parse.y" - { - if (IS_IREG ((yyvsp[-2].reg)) && IS_MREG ((yyvsp[0].reg))) - { - notethat ("dagMODim: iregs += mregs\n"); - (yyval.instr) = DAGMODIM (&(yyvsp[-2].reg), &(yyvsp[0].reg), 0, 0); - } - else - return yyerror ("iregs += mregs expected"); - } - break; - - case 62: -#line 1409 "bfin-parse.y" - { - if (IS_IREG ((yyvsp[-2].reg))) - { - if (EXPR_VALUE ((yyvsp[0].expr)) == 4) - { - notethat ("dagMODik: iregs += 4\n"); - (yyval.instr) = DAGMODIK (&(yyvsp[-2].reg), 2); - } - else if (EXPR_VALUE ((yyvsp[0].expr)) == 2) - { - notethat ("dagMODik: iregs += 2\n"); - (yyval.instr) = DAGMODIK (&(yyvsp[-2].reg), 0); - } - else - return yyerror ("iregs += [ 2 | 4 "); - } - else if (IS_PREG ((yyvsp[-2].reg)) && IS_IMM ((yyvsp[0].expr), 7)) - { - notethat ("COMPI2opP: pregs += imm7\n"); - (yyval.instr) = COMPI2OPP (&(yyvsp[-2].reg), imm7 ((yyvsp[0].expr)), 1); - } - else if (IS_DREG ((yyvsp[-2].reg)) && IS_IMM ((yyvsp[0].expr), 7)) - { - notethat ("COMPI2opD: dregs += imm7\n"); - (yyval.instr) = COMPI2OPD (&(yyvsp[-2].reg), imm7 ((yyvsp[0].expr)), 1); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 63: -#line 1440 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-2].reg)) && IS_DREG ((yyvsp[0].reg))) - { - notethat ("ALU2op: dregs *= dregs\n"); - (yyval.instr) = ALU2OP (&(yyvsp[-2].reg), &(yyvsp[0].reg), 3); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 64: -#line 1451 "bfin-parse.y" - { - if (!valid_dreg_pair (&(yyvsp[-8].reg), (yyvsp[-6].expr))) - return yyerror ("Bad dreg pair"); - else if (!valid_dreg_pair (&(yyvsp[-4].reg), (yyvsp[-2].expr))) - return yyerror ("Bad dreg pair"); - else - { - notethat ("dsp32alu: SAA (dregs_pair , dregs_pair ) (aligndir)\n"); - (yyval.instr) = DSP32ALU (18, 0, 0, 0, &(yyvsp[-8].reg), &(yyvsp[-4].reg), (yyvsp[0].r0).r0, 0, 0); - } - } - break; - - case 65: -#line 1464 "bfin-parse.y" - { - if (REG_SAME ((yyvsp[-10].reg), (yyvsp[-9].reg)) && REG_SAME ((yyvsp[-4].reg), (yyvsp[-3].reg)) && !REG_SAME ((yyvsp[-10].reg), (yyvsp[-4].reg))) - { - notethat ("dsp32alu: A1 = A1 (S) , A0 = A0 (S)\n"); - (yyval.instr) = DSP32ALU (8, 0, 0, 0, 0, 0, 1, 0, 2); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 66: -#line 1475 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-8].reg)) && IS_DREG ((yyvsp[-5].reg)) && IS_DREG ((yyvsp[-3].reg)) - && REG_SAME ((yyvsp[-8].reg), (yyvsp[-5].reg))) - { - if (EXPR_VALUE ((yyvsp[0].expr)) == 1) - { - notethat ("ALU2op: dregs = (dregs + dregs) << 1\n"); - (yyval.instr) = ALU2OP (&(yyvsp[-8].reg), &(yyvsp[-3].reg), 4); - } - else if (EXPR_VALUE ((yyvsp[0].expr)) == 2) - { - notethat ("ALU2op: dregs = (dregs + dregs) << 2\n"); - (yyval.instr) = ALU2OP (&(yyvsp[-8].reg), &(yyvsp[-3].reg), 5); - } - else - return yyerror ("Bad shift value"); - } - else if (IS_PREG ((yyvsp[-8].reg)) && IS_PREG ((yyvsp[-5].reg)) && IS_PREG ((yyvsp[-3].reg)) - && REG_SAME ((yyvsp[-8].reg), (yyvsp[-5].reg))) - { - if (EXPR_VALUE ((yyvsp[0].expr)) == 1) - { - notethat ("PTR2op: pregs = (pregs + pregs) << 1\n"); - (yyval.instr) = PTR2OP (&(yyvsp[-8].reg), &(yyvsp[-3].reg), 6); - } - else if (EXPR_VALUE ((yyvsp[0].expr)) == 2) - { - notethat ("PTR2op: pregs = (pregs + pregs) << 2\n"); - (yyval.instr) = PTR2OP (&(yyvsp[-8].reg), &(yyvsp[-3].reg), 7); - } - else - return yyerror ("Bad shift value"); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 67: -#line 1514 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-4].reg)) && IS_DREG ((yyvsp[-2].reg)) && IS_DREG ((yyvsp[0].reg))) - { - notethat ("COMP3op: dregs = dregs | dregs\n"); - (yyval.instr) = COMP3OP (&(yyvsp[-4].reg), &(yyvsp[-2].reg), &(yyvsp[0].reg), 3); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 68: -#line 1524 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-4].reg)) && IS_DREG ((yyvsp[-2].reg)) && IS_DREG ((yyvsp[0].reg))) - { - notethat ("COMP3op: dregs = dregs ^ dregs\n"); - (yyval.instr) = COMP3OP (&(yyvsp[-4].reg), &(yyvsp[-2].reg), &(yyvsp[0].reg), 4); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 69: -#line 1534 "bfin-parse.y" - { - if (IS_PREG ((yyvsp[-8].reg)) && IS_PREG ((yyvsp[-6].reg)) && IS_PREG ((yyvsp[-3].reg))) - { - if (EXPR_VALUE ((yyvsp[-1].expr)) == 1) - { - notethat ("COMP3op: pregs = pregs + (pregs << 1)\n"); - (yyval.instr) = COMP3OP (&(yyvsp[-8].reg), &(yyvsp[-6].reg), &(yyvsp[-3].reg), 6); - } - else if (EXPR_VALUE ((yyvsp[-1].expr)) == 2) - { - notethat ("COMP3op: pregs = pregs + (pregs << 2)\n"); - (yyval.instr) = COMP3OP (&(yyvsp[-8].reg), &(yyvsp[-6].reg), &(yyvsp[-3].reg), 7); - } - else - return yyerror ("Bad shift value"); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 70: -#line 1554 "bfin-parse.y" - { - if (!REG_SAME ((yyvsp[-2].reg), (yyvsp[0].reg))) - { - notethat ("CCflag: CC = A0 == A1\n"); - (yyval.instr) = CCFLAG (0, 0, 5, 0, 0); - } - else - return yyerror ("CC register expected"); - } - break; - - case 71: -#line 1564 "bfin-parse.y" - { - if (!REG_SAME ((yyvsp[-2].reg), (yyvsp[0].reg))) - { - notethat ("CCflag: CC = A0 < A1\n"); - (yyval.instr) = CCFLAG (0, 0, 6, 0, 0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 72: -#line 1574 "bfin-parse.y" - { - if (REG_CLASS((yyvsp[-3].reg)) == REG_CLASS((yyvsp[-1].reg))) - { - notethat ("CCflag: CC = dpregs < dpregs\n"); - (yyval.instr) = CCFLAG (&(yyvsp[-3].reg), (yyvsp[-1].reg).regno & CODE_MASK, (yyvsp[0].r0).r0, 0, IS_PREG ((yyvsp[-3].reg)) ? 1 : 0); - } - else - return yyerror ("Compare only of same register class"); - } - break; - - case 73: -#line 1584 "bfin-parse.y" - { - if (((yyvsp[0].r0).r0 == 1 && IS_IMM ((yyvsp[-1].expr), 3)) - || ((yyvsp[0].r0).r0 == 3 && IS_UIMM ((yyvsp[-1].expr), 3))) - { - notethat ("CCflag: CC = dpregs < (u)imm3\n"); - (yyval.instr) = CCFLAG (&(yyvsp[-3].reg), imm3 ((yyvsp[-1].expr)), (yyvsp[0].r0).r0, 1, IS_PREG ((yyvsp[-3].reg)) ? 1 : 0); - } - else - return yyerror ("Bad constant value"); - } - break; - - case 74: -#line 1595 "bfin-parse.y" - { - if (REG_CLASS((yyvsp[-2].reg)) == REG_CLASS((yyvsp[0].reg))) - { - notethat ("CCflag: CC = dpregs == dpregs\n"); - (yyval.instr) = CCFLAG (&(yyvsp[-2].reg), (yyvsp[0].reg).regno & CODE_MASK, 0, 0, IS_PREG ((yyvsp[-2].reg)) ? 1 : 0); - } - } - break; - - case 75: -#line 1603 "bfin-parse.y" - { - if (IS_IMM ((yyvsp[0].expr), 3)) - { - notethat ("CCflag: CC = dpregs == imm3\n"); - (yyval.instr) = CCFLAG (&(yyvsp[-2].reg), imm3 ((yyvsp[0].expr)), 0, 1, IS_PREG ((yyvsp[-2].reg)) ? 1 : 0); - } - else - return yyerror ("Bad constant range"); - } - break; - - case 76: -#line 1613 "bfin-parse.y" - { - if (!REG_SAME ((yyvsp[-2].reg), (yyvsp[0].reg))) - { - notethat ("CCflag: CC = A0 <= A1\n"); - (yyval.instr) = CCFLAG (0, 0, 7, 0, 0); - } - else - return yyerror ("CC register expected"); - } - break; - - case 77: -#line 1623 "bfin-parse.y" - { - if (REG_CLASS((yyvsp[-3].reg)) == REG_CLASS((yyvsp[-1].reg))) - { - notethat ("CCflag: CC = pregs <= pregs (..)\n"); - (yyval.instr) = CCFLAG (&(yyvsp[-3].reg), (yyvsp[-1].reg).regno & CODE_MASK, - 1 + (yyvsp[0].r0).r0, 0, IS_PREG ((yyvsp[-3].reg)) ? 1 : 0); - } - else - return yyerror ("Compare only of same register class"); - } - break; - - case 78: -#line 1634 "bfin-parse.y" - { - if (((yyvsp[0].r0).r0 == 1 && IS_IMM ((yyvsp[-1].expr), 3)) - || ((yyvsp[0].r0).r0 == 3 && IS_UIMM ((yyvsp[-1].expr), 3))) - { - if (IS_DREG ((yyvsp[-3].reg))) - { - notethat ("CCflag: CC = dregs <= (u)imm3\n"); - /* x y opc I G */ - (yyval.instr) = CCFLAG (&(yyvsp[-3].reg), imm3 ((yyvsp[-1].expr)), 1 + (yyvsp[0].r0).r0, 1, 0); - } - else if (IS_PREG ((yyvsp[-3].reg))) - { - notethat ("CCflag: CC = pregs <= (u)imm3\n"); - /* x y opc I G */ - (yyval.instr) = CCFLAG (&(yyvsp[-3].reg), imm3 ((yyvsp[-1].expr)), 1 + (yyvsp[0].r0).r0, 1, 1); - } - else - return yyerror ("Dreg or Preg expected"); - } - else - return yyerror ("Bad constant value"); - } - break; - - case 79: -#line 1658 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-4].reg)) && IS_DREG ((yyvsp[-2].reg)) && IS_DREG ((yyvsp[0].reg))) - { - notethat ("COMP3op: dregs = dregs & dregs\n"); - (yyval.instr) = COMP3OP (&(yyvsp[-4].reg), &(yyvsp[-2].reg), &(yyvsp[0].reg), 2); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 80: -#line 1669 "bfin-parse.y" - { - notethat ("CC2stat operation\n"); - (yyval.instr) = bfin_gen_cc2stat ((yyvsp[0].modcodes).r0, (yyvsp[0].modcodes).x0, (yyvsp[0].modcodes).s0); - } - break; - - case 81: -#line 1675 "bfin-parse.y" - { - if (IS_ALLREG ((yyvsp[-2].reg)) && IS_ALLREG ((yyvsp[0].reg))) - { - notethat ("REGMV: allregs = allregs\n"); - (yyval.instr) = bfin_gen_regmv (&(yyvsp[0].reg), &(yyvsp[-2].reg)); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 82: -#line 1686 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[0].reg))) - { - notethat ("CC2dreg: CC = dregs\n"); - (yyval.instr) = bfin_gen_cc2dreg (1, &(yyvsp[0].reg)); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 83: -#line 1697 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-2].reg))) - { - notethat ("CC2dreg: dregs = CC\n"); - (yyval.instr) = bfin_gen_cc2dreg (0, &(yyvsp[-2].reg)); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 84: -#line 1708 "bfin-parse.y" - { - notethat ("CC2dreg: CC =! CC\n"); - (yyval.instr) = bfin_gen_cc2dreg (3, 0); - } - break; - - case 85: -#line 1716 "bfin-parse.y" - { - notethat ("dsp32mult: dregs_half = multiply_halfregs (opt_mode)\n"); - - if (!IS_H ((yyvsp[-3].reg)) && (yyvsp[0].mod).MM) - return yyerror ("(M) not allowed with MAC0"); - - if (IS_H ((yyvsp[-3].reg))) - { - (yyval.instr) = DSP32MULT (0, (yyvsp[0].mod).MM, (yyvsp[0].mod).mod, 1, 0, - IS_H ((yyvsp[-1].macfunc).s0), IS_H ((yyvsp[-1].macfunc).s1), 0, 0, - &(yyvsp[-3].reg), 0, &(yyvsp[-1].macfunc).s0, &(yyvsp[-1].macfunc).s1, 0); - } - else - { - (yyval.instr) = DSP32MULT (0, 0, (yyvsp[0].mod).mod, 0, 0, - 0, 0, IS_H ((yyvsp[-1].macfunc).s0), IS_H ((yyvsp[-1].macfunc).s1), - &(yyvsp[-3].reg), 0, &(yyvsp[-1].macfunc).s0, &(yyvsp[-1].macfunc).s1, 1); - } - } - break; - - case 86: -#line 1737 "bfin-parse.y" - { - /* Odd registers can use (M). */ - if (!IS_DREG ((yyvsp[-3].reg))) - return yyerror ("Dreg expected"); - - if (!IS_EVEN ((yyvsp[-3].reg))) - { - notethat ("dsp32mult: dregs = multiply_halfregs (opt_mode)\n"); - - (yyval.instr) = DSP32MULT (0, (yyvsp[0].mod).MM, (yyvsp[0].mod).mod, 1, 1, - IS_H ((yyvsp[-1].macfunc).s0), IS_H ((yyvsp[-1].macfunc).s1), 0, 0, - &(yyvsp[-3].reg), 0, &(yyvsp[-1].macfunc).s0, &(yyvsp[-1].macfunc).s1, 0); - } - else if ((yyvsp[0].mod).MM == 0) - { - notethat ("dsp32mult: dregs = multiply_halfregs opt_mode\n"); - (yyval.instr) = DSP32MULT (0, 0, (yyvsp[0].mod).mod, 0, 1, - 0, 0, IS_H ((yyvsp[-1].macfunc).s0), IS_H ((yyvsp[-1].macfunc).s1), - &(yyvsp[-3].reg), 0, &(yyvsp[-1].macfunc).s0, &(yyvsp[-1].macfunc).s1, 1); - } - else - return yyerror ("Register or mode mismatch"); - } - break; - - case 87: -#line 1763 "bfin-parse.y" - { - if (!IS_DREG ((yyvsp[-8].reg)) || !IS_DREG ((yyvsp[-3].reg))) - return yyerror ("Dregs expected"); - - if (check_multiply_halfregs (&(yyvsp[-6].macfunc), &(yyvsp[-1].macfunc)) < 0) - return -1; - - if (IS_H ((yyvsp[-8].reg)) && !IS_H ((yyvsp[-3].reg))) - { - notethat ("dsp32mult: dregs_hi = multiply_halfregs mxd_mod, " - "dregs_lo = multiply_halfregs opt_mode\n"); - (yyval.instr) = DSP32MULT (0, (yyvsp[-5].mod).MM, (yyvsp[0].mod).mod, 1, 0, - IS_H ((yyvsp[-6].macfunc).s0), IS_H ((yyvsp[-6].macfunc).s1), IS_H ((yyvsp[-1].macfunc).s0), IS_H ((yyvsp[-1].macfunc).s1), - &(yyvsp[-8].reg), 0, &(yyvsp[-6].macfunc).s0, &(yyvsp[-6].macfunc).s1, 1); - } - else if (!IS_H ((yyvsp[-8].reg)) && IS_H ((yyvsp[-3].reg)) && (yyvsp[-5].mod).MM == 0) - { - (yyval.instr) = DSP32MULT (0, (yyvsp[0].mod).MM, (yyvsp[0].mod).mod, 1, 0, - IS_H ((yyvsp[-1].macfunc).s0), IS_H ((yyvsp[-1].macfunc).s1), IS_H ((yyvsp[-6].macfunc).s0), IS_H ((yyvsp[-6].macfunc).s1), - &(yyvsp[-8].reg), 0, &(yyvsp[-6].macfunc).s0, &(yyvsp[-6].macfunc).s1, 1); - } - else - return yyerror ("Multfunc Register or mode mismatch"); - } - break; - - case 88: -#line 1789 "bfin-parse.y" - { - if (!IS_DREG ((yyvsp[-8].reg)) || !IS_DREG ((yyvsp[-3].reg))) - return yyerror ("Dregs expected"); - - if (check_multiply_halfregs (&(yyvsp[-6].macfunc), &(yyvsp[-1].macfunc)) < 0) - return -1; - - notethat ("dsp32mult: dregs = multiply_halfregs mxd_mod, " - "dregs = multiply_halfregs opt_mode\n"); - if (IS_EVEN ((yyvsp[-8].reg))) - { - if ((yyvsp[-3].reg).regno - (yyvsp[-8].reg).regno != 1 || (yyvsp[-5].mod).MM != 0) - return yyerror ("Dest registers or mode mismatch"); - - /* op1 MM mmod */ - (yyval.instr) = DSP32MULT (0, 0, (yyvsp[0].mod).mod, 1, 1, - IS_H ((yyvsp[-1].macfunc).s0), IS_H ((yyvsp[-1].macfunc).s1), IS_H ((yyvsp[-6].macfunc).s0), IS_H ((yyvsp[-6].macfunc).s1), - &(yyvsp[-8].reg), 0, &(yyvsp[-6].macfunc).s0, &(yyvsp[-6].macfunc).s1, 1); - - } - else - { - if ((yyvsp[-8].reg).regno - (yyvsp[-3].reg).regno != 1) - return yyerror ("Dest registers mismatch"); - - (yyval.instr) = DSP32MULT (0, (yyvsp[0].mod).MM, (yyvsp[0].mod).mod, 1, 1, - IS_H ((yyvsp[-6].macfunc).s0), IS_H ((yyvsp[-6].macfunc).s1), IS_H ((yyvsp[-1].macfunc).s0), IS_H ((yyvsp[-1].macfunc).s1), - &(yyvsp[-8].reg), 0, &(yyvsp[-6].macfunc).s0, &(yyvsp[-6].macfunc).s1, 1); - } - } - break; - - case 89: -#line 1823 "bfin-parse.y" - { - if (!REG_SAME ((yyvsp[-4].reg), (yyvsp[-2].reg))) - return yyerror ("Aregs must be same"); - - if (IS_DREG ((yyvsp[0].reg)) && !IS_H ((yyvsp[0].reg))) - { - notethat ("dsp32shift: A0 = ASHIFT A0 BY dregs_lo\n"); - (yyval.instr) = DSP32SHIFT (3, 0, &(yyvsp[0].reg), 0, 0, IS_A1 ((yyvsp[-4].reg))); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 90: -#line 1837 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-1].reg)) && !IS_H ((yyvsp[-1].reg))) - { - notethat ("dsp32shift: dregs_half = ASHIFT dregs_half BY dregs_lo\n"); - (yyval.instr) = DSP32SHIFT (0, &(yyvsp[-6].reg), &(yyvsp[-1].reg), &(yyvsp[-3].reg), (yyvsp[0].modcodes).s0, HL2 ((yyvsp[-6].reg), (yyvsp[-3].reg))); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 91: -#line 1848 "bfin-parse.y" - { - if (!REG_SAME ((yyvsp[-3].reg), (yyvsp[-2].reg))) - return yyerror ("Aregs must be same"); - - if (IS_UIMM ((yyvsp[0].expr), 5)) - { - notethat ("dsp32shiftimm: A0 = A0 << uimm5\n"); - (yyval.instr) = DSP32SHIFTIMM (3, 0, imm5 ((yyvsp[0].expr)), 0, 0, IS_A1 ((yyvsp[-3].reg))); - } - else - return yyerror ("Bad shift value"); - } - break; - - case 92: -#line 1862 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-5].reg)) && IS_DREG ((yyvsp[-3].reg)) && IS_UIMM ((yyvsp[-1].expr), 5)) - { - if ((yyvsp[0].modcodes).r0) - { - /* Vector? */ - notethat ("dsp32shiftimm: dregs = dregs << expr (V, .)\n"); - (yyval.instr) = DSP32SHIFTIMM (1, &(yyvsp[-5].reg), imm4 ((yyvsp[-1].expr)), &(yyvsp[-3].reg), (yyvsp[0].modcodes).s0 ? 1 : 2, 0); - } - else - { - notethat ("dsp32shiftimm: dregs = dregs << uimm5 (.)\n"); - (yyval.instr) = DSP32SHIFTIMM (2, &(yyvsp[-5].reg), imm6 ((yyvsp[-1].expr)), &(yyvsp[-3].reg), (yyvsp[0].modcodes).s0 ? 1 : 2, 0); - } - } - else if ((yyvsp[0].modcodes).s0 == 0 && IS_PREG ((yyvsp[-5].reg)) && IS_PREG ((yyvsp[-3].reg))) - { - if (EXPR_VALUE ((yyvsp[-1].expr)) == 2) - { - notethat ("PTR2op: pregs = pregs << 2\n"); - (yyval.instr) = PTR2OP (&(yyvsp[-5].reg), &(yyvsp[-3].reg), 1); - } - else if (EXPR_VALUE ((yyvsp[-1].expr)) == 1) - { - notethat ("COMP3op: pregs = pregs << 1\n"); - (yyval.instr) = COMP3OP (&(yyvsp[-5].reg), &(yyvsp[-3].reg), &(yyvsp[-3].reg), 5); - } - else - return yyerror ("Bad shift value"); - } - else - return yyerror ("Bad shift value or register"); - } - break; - - case 93: -#line 1896 "bfin-parse.y" - { - if (IS_UIMM ((yyvsp[0].expr), 4)) - { - notethat ("dsp32shiftimm: dregs_half = dregs_half << uimm4\n"); - (yyval.instr) = DSP32SHIFTIMM (0x0, &(yyvsp[-4].reg), imm5 ((yyvsp[0].expr)), &(yyvsp[-2].reg), 2, HL2 ((yyvsp[-4].reg), (yyvsp[-2].reg))); - } - else - return yyerror ("Bad shift value"); - } - break; - - case 94: -#line 1906 "bfin-parse.y" - { - if (IS_UIMM ((yyvsp[-1].expr), 4)) - { - notethat ("dsp32shiftimm: dregs_half = dregs_half << uimm4\n"); - (yyval.instr) = DSP32SHIFTIMM (0x0, &(yyvsp[-5].reg), imm5 ((yyvsp[-1].expr)), &(yyvsp[-3].reg), (yyvsp[0].modcodes).s0, HL2 ((yyvsp[-5].reg), (yyvsp[-3].reg))); - } - else - return yyerror ("Bad shift value"); - } - break; - - case 95: -#line 1916 "bfin-parse.y" - { - int op; - - if (IS_DREG ((yyvsp[-6].reg)) && IS_DREG ((yyvsp[-3].reg)) && IS_DREG ((yyvsp[-1].reg)) && !IS_H ((yyvsp[-1].reg))) - { - if ((yyvsp[0].modcodes).r0) - { - op = 1; - notethat ("dsp32shift: dregs = ASHIFT dregs BY " - "dregs_lo (V, .)\n"); - } - else - { - - op = 2; - notethat ("dsp32shift: dregs = ASHIFT dregs BY dregs_lo (.)\n"); - } - (yyval.instr) = DSP32SHIFT (op, &(yyvsp[-6].reg), &(yyvsp[-1].reg), &(yyvsp[-3].reg), (yyvsp[0].modcodes).s0, 0); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 96: -#line 1941 "bfin-parse.y" - { - if (IS_DREG_L ((yyvsp[-8].reg)) && IS_DREG_L ((yyvsp[-4].reg)) && IS_DREG_L ((yyvsp[-2].reg))) - { - notethat ("dsp32shift: dregs_lo = EXPADJ (dregs , dregs_lo )\n"); - (yyval.instr) = DSP32SHIFT (7, &(yyvsp[-8].reg), &(yyvsp[-2].reg), &(yyvsp[-4].reg), (yyvsp[0].r0).r0, 0); - } - else - return yyerror ("Bad shift value or register"); - } - break; - - case 97: -#line 1953 "bfin-parse.y" - { - if (IS_DREG_L ((yyvsp[-7].reg)) && IS_DREG_L ((yyvsp[-3].reg)) && IS_DREG_L ((yyvsp[-1].reg))) - { - notethat ("dsp32shift: dregs_lo = EXPADJ (dregs_lo, dregs_lo)\n"); - (yyval.instr) = DSP32SHIFT (7, &(yyvsp[-7].reg), &(yyvsp[-1].reg), &(yyvsp[-3].reg), 2, 0); - } - else if (IS_DREG_L ((yyvsp[-7].reg)) && IS_DREG_H ((yyvsp[-3].reg)) && IS_DREG_L ((yyvsp[-1].reg))) - { - notethat ("dsp32shift: dregs_lo = EXPADJ (dregs_hi, dregs_lo)\n"); - (yyval.instr) = DSP32SHIFT (7, &(yyvsp[-7].reg), &(yyvsp[-1].reg), &(yyvsp[-3].reg), 3, 0); - } - else - return yyerror ("Bad shift value or register"); - } - break; - - case 98: -#line 1971 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-7].reg)) && IS_DREG ((yyvsp[-3].reg)) && IS_DREG ((yyvsp[-1].reg))) - { - notethat ("dsp32shift: dregs = DEPOSIT (dregs , dregs )\n"); - (yyval.instr) = DSP32SHIFT (10, &(yyvsp[-7].reg), &(yyvsp[-1].reg), &(yyvsp[-3].reg), 2, 0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 99: -#line 1982 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-10].reg)) && IS_DREG ((yyvsp[-6].reg)) && IS_DREG ((yyvsp[-4].reg))) - { - notethat ("dsp32shift: dregs = DEPOSIT (dregs , dregs ) (X)\n"); - (yyval.instr) = DSP32SHIFT (10, &(yyvsp[-10].reg), &(yyvsp[-4].reg), &(yyvsp[-6].reg), 3, 0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 100: -#line 1993 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-8].reg)) && IS_DREG ((yyvsp[-4].reg)) && IS_DREG_L ((yyvsp[-2].reg))) - { - notethat ("dsp32shift: dregs = EXTRACT (dregs, dregs_lo ) (.)\n"); - (yyval.instr) = DSP32SHIFT (10, &(yyvsp[-8].reg), &(yyvsp[-2].reg), &(yyvsp[-4].reg), (yyvsp[0].r0).r0, 0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 101: -#line 2004 "bfin-parse.y" - { - if (!REG_SAME ((yyvsp[-3].reg), (yyvsp[-2].reg))) - return yyerror ("Aregs must be same"); - - if (IS_UIMM ((yyvsp[0].expr), 5)) - { - notethat ("dsp32shiftimm: Ax = Ax >>> uimm5\n"); - (yyval.instr) = DSP32SHIFTIMM (3, 0, -imm6 ((yyvsp[0].expr)), 0, 0, IS_A1 ((yyvsp[-3].reg))); - } - else - return yyerror ("Shift value range error"); - } - break; - - case 102: -#line 2017 "bfin-parse.y" - { - if (REG_SAME ((yyvsp[-4].reg), (yyvsp[-2].reg)) && IS_DREG_L ((yyvsp[0].reg))) - { - notethat ("dsp32shift: Ax = LSHIFT Ax BY dregs_lo\n"); - (yyval.instr) = DSP32SHIFT (3, 0, &(yyvsp[0].reg), 0, 1, IS_A1 ((yyvsp[-4].reg))); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 103: -#line 2028 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-5].reg)) && IS_DREG ((yyvsp[-2].reg)) && IS_DREG_L ((yyvsp[0].reg))) - { - notethat ("dsp32shift: dregs_lo = LSHIFT dregs_hi BY dregs_lo\n"); - (yyval.instr) = DSP32SHIFT (0, &(yyvsp[-5].reg), &(yyvsp[0].reg), &(yyvsp[-2].reg), 2, HL2 ((yyvsp[-5].reg), (yyvsp[-2].reg))); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 104: -#line 2039 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-6].reg)) && IS_DREG ((yyvsp[-3].reg)) && IS_DREG_L ((yyvsp[-1].reg))) - { - notethat ("dsp32shift: dregs = LSHIFT dregs BY dregs_lo (V )\n"); - (yyval.instr) = DSP32SHIFT ((yyvsp[0].r0).r0 ? 1: 2, &(yyvsp[-6].reg), &(yyvsp[-1].reg), &(yyvsp[-3].reg), 2, 0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 105: -#line 2050 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-5].reg)) && IS_DREG ((yyvsp[-2].reg)) && IS_DREG_L ((yyvsp[0].reg))) - { - notethat ("dsp32shift: dregs = SHIFT dregs BY dregs_lo\n"); - (yyval.instr) = DSP32SHIFT (2, &(yyvsp[-5].reg), &(yyvsp[0].reg), &(yyvsp[-2].reg), 2, 0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 106: -#line 2061 "bfin-parse.y" - { - if (REG_SAME ((yyvsp[-3].reg), (yyvsp[-2].reg)) && IS_IMM ((yyvsp[0].expr), 6) >= 0) - { - notethat ("dsp32shiftimm: Ax = Ax >> imm6\n"); - (yyval.instr) = DSP32SHIFTIMM (3, 0, -imm6 ((yyvsp[0].expr)), 0, 1, IS_A1 ((yyvsp[-3].reg))); - } - else - return yyerror ("Accu register expected"); - } - break; - - case 107: -#line 2072 "bfin-parse.y" - { - if ((yyvsp[0].r0).r0 == 1) - { - if (IS_DREG ((yyvsp[-5].reg)) && IS_DREG ((yyvsp[-3].reg)) && IS_UIMM ((yyvsp[-1].expr), 5)) - { - notethat ("dsp32shiftimm: dregs = dregs >> uimm5 (V)\n"); - (yyval.instr) = DSP32SHIFTIMM (1, &(yyvsp[-5].reg), -uimm5 ((yyvsp[-1].expr)), &(yyvsp[-3].reg), 2, 0); - } - else - return yyerror ("Register mismatch"); - } - else - { - if (IS_DREG ((yyvsp[-5].reg)) && IS_DREG ((yyvsp[-3].reg)) && IS_UIMM ((yyvsp[-1].expr), 5)) - { - notethat ("dsp32shiftimm: dregs = dregs >> uimm5\n"); - (yyval.instr) = DSP32SHIFTIMM (2, &(yyvsp[-5].reg), -imm6 ((yyvsp[-1].expr)), &(yyvsp[-3].reg), 2, 0); - } - else if (IS_PREG ((yyvsp[-5].reg)) && IS_PREG ((yyvsp[-3].reg)) && EXPR_VALUE ((yyvsp[-1].expr)) == 2) - { - notethat ("PTR2op: pregs = pregs >> 2\n"); - (yyval.instr) = PTR2OP (&(yyvsp[-5].reg), &(yyvsp[-3].reg), 3); - } - else if (IS_PREG ((yyvsp[-5].reg)) && IS_PREG ((yyvsp[-3].reg)) && EXPR_VALUE ((yyvsp[-1].expr)) == 1) - { - notethat ("PTR2op: pregs = pregs >> 1\n"); - (yyval.instr) = PTR2OP (&(yyvsp[-5].reg), &(yyvsp[-3].reg), 4); - } - else - return yyerror ("Register mismatch"); - } - } - break; - - case 108: -#line 2105 "bfin-parse.y" - { - if (IS_UIMM ((yyvsp[0].expr), 5)) - { - notethat ("dsp32shiftimm: dregs_half = dregs_half >> uimm5\n"); - (yyval.instr) = DSP32SHIFTIMM (0, &(yyvsp[-4].reg), -uimm5 ((yyvsp[0].expr)), &(yyvsp[-2].reg), 2, HL2 ((yyvsp[-4].reg), (yyvsp[-2].reg))); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 109: -#line 2115 "bfin-parse.y" - { - if (IS_UIMM ((yyvsp[-1].expr), 5)) - { - notethat ("dsp32shiftimm: dregs_half = dregs_half >>> uimm5\n"); - (yyval.instr) = DSP32SHIFTIMM (0, &(yyvsp[-5].reg), -uimm5 ((yyvsp[-1].expr)), &(yyvsp[-3].reg), - (yyvsp[0].modcodes).s0, HL2 ((yyvsp[-5].reg), (yyvsp[-3].reg))); - } - else - return yyerror ("Register or modifier mismatch"); - } - break; - - case 110: -#line 2128 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-5].reg)) && IS_DREG ((yyvsp[-3].reg)) && IS_UIMM ((yyvsp[-1].expr), 5)) - { - if ((yyvsp[0].modcodes).r0) - { - /* Vector? */ - notethat ("dsp32shiftimm: dregs = dregs >>> uimm5 (V, .)\n"); - (yyval.instr) = DSP32SHIFTIMM (1, &(yyvsp[-5].reg), -uimm5 ((yyvsp[-1].expr)), &(yyvsp[-3].reg), (yyvsp[0].modcodes).s0, 0); - } - else - { - notethat ("dsp32shiftimm: dregs = dregs >>> uimm5 (.)\n"); - (yyval.instr) = DSP32SHIFTIMM (2, &(yyvsp[-5].reg), -uimm5 ((yyvsp[-1].expr)), &(yyvsp[-3].reg), (yyvsp[0].modcodes).s0, 0); - } - } - else - return yyerror ("Register mismatch"); - } - break; - - case 111: -#line 2148 "bfin-parse.y" - { - if (IS_DREG_L ((yyvsp[-3].reg)) && IS_DREG ((yyvsp[0].reg))) - { - notethat ("dsp32shift: dregs_lo = ONES dregs\n"); - (yyval.instr) = DSP32SHIFT (6, &(yyvsp[-3].reg), 0, &(yyvsp[0].reg), 3, 0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 112: -#line 2159 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-7].reg)) && IS_DREG ((yyvsp[-3].reg)) && IS_DREG ((yyvsp[-1].reg))) - { - notethat ("dsp32shift: dregs = PACK (dregs_hi , dregs_hi )\n"); - (yyval.instr) = DSP32SHIFT (4, &(yyvsp[-7].reg), &(yyvsp[-1].reg), &(yyvsp[-3].reg), HL2 ((yyvsp[-3].reg), (yyvsp[-1].reg)), 0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 113: -#line 2170 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-9].reg)) - && (yyvsp[-3].reg).regno == REG_A0 - && IS_DREG ((yyvsp[-1].reg)) && !IS_H ((yyvsp[-9].reg)) && !IS_A1 ((yyvsp[-3].reg))) - { - notethat ("dsp32shift: dregs_lo = CC = BXORSHIFT (A0 , dregs )\n"); - (yyval.instr) = DSP32SHIFT (11, &(yyvsp[-9].reg), &(yyvsp[-1].reg), 0, 0, 0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 114: -#line 2183 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-9].reg)) - && (yyvsp[-3].reg).regno == REG_A0 - && IS_DREG ((yyvsp[-1].reg)) && !IS_H ((yyvsp[-9].reg)) && !IS_A1 ((yyvsp[-3].reg))) - { - notethat ("dsp32shift: dregs_lo = CC = BXOR (A0 , dregs)\n"); - (yyval.instr) = DSP32SHIFT (11, &(yyvsp[-9].reg), &(yyvsp[-1].reg), 0, 1, 0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 115: -#line 2196 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-11].reg)) && !IS_H ((yyvsp[-11].reg)) && !REG_SAME ((yyvsp[-5].reg), (yyvsp[-3].reg))) - { - notethat ("dsp32shift: dregs_lo = CC = BXOR (A0 , A1 , CC)\n"); - (yyval.instr) = DSP32SHIFT (12, &(yyvsp[-11].reg), 0, 0, 1, 0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 116: -#line 2207 "bfin-parse.y" - { - if (REG_SAME ((yyvsp[-4].reg), (yyvsp[-2].reg)) && IS_DREG_L ((yyvsp[0].reg))) - { - notethat ("dsp32shift: Ax = ROT Ax BY dregs_lo\n"); - (yyval.instr) = DSP32SHIFT (3, 0, &(yyvsp[0].reg), 0, 2, IS_A1 ((yyvsp[-4].reg))); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 117: -#line 2218 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-5].reg)) && IS_DREG ((yyvsp[-2].reg)) && IS_DREG_L ((yyvsp[0].reg))) - { - notethat ("dsp32shift: dregs = ROT dregs BY dregs_lo\n"); - (yyval.instr) = DSP32SHIFT (2, &(yyvsp[-5].reg), &(yyvsp[0].reg), &(yyvsp[-2].reg), 3, 0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 118: -#line 2229 "bfin-parse.y" - { - if (IS_IMM ((yyvsp[0].expr), 6)) - { - notethat ("dsp32shiftimm: An = ROT An BY imm6\n"); - (yyval.instr) = DSP32SHIFTIMM (3, 0, imm6 ((yyvsp[0].expr)), 0, 2, IS_A1 ((yyvsp[-4].reg))); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 119: -#line 2240 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-5].reg)) && IS_DREG ((yyvsp[-2].reg)) && IS_IMM ((yyvsp[0].expr), 6)) - { - (yyval.instr) = DSP32SHIFTIMM (2, &(yyvsp[-5].reg), imm6 ((yyvsp[0].expr)), &(yyvsp[-2].reg), 3, IS_A1 ((yyvsp[-5].reg))); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 120: -#line 2250 "bfin-parse.y" - { - if (IS_DREG_L ((yyvsp[-3].reg))) - { - notethat ("dsp32shift: dregs_lo = SIGNBITS An\n"); - (yyval.instr) = DSP32SHIFT (6, &(yyvsp[-3].reg), 0, 0, IS_A1 ((yyvsp[0].reg)), 0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 121: -#line 2261 "bfin-parse.y" - { - if (IS_DREG_L ((yyvsp[-3].reg)) && IS_DREG ((yyvsp[0].reg))) - { - notethat ("dsp32shift: dregs_lo = SIGNBITS dregs\n"); - (yyval.instr) = DSP32SHIFT (5, &(yyvsp[-3].reg), 0, &(yyvsp[0].reg), 0, 0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 122: -#line 2272 "bfin-parse.y" - { - if (IS_DREG_L ((yyvsp[-3].reg))) - { - notethat ("dsp32shift: dregs_lo = SIGNBITS dregs_lo\n"); - (yyval.instr) = DSP32SHIFT (5, &(yyvsp[-3].reg), 0, &(yyvsp[0].reg), 1 + IS_H ((yyvsp[0].reg)), 0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 123: -#line 2284 "bfin-parse.y" - { - if (IS_DREG_L ((yyvsp[-6].reg)) && IS_DREG ((yyvsp[-2].reg))) - { - notethat ("dsp32shift: dregs_lo = VIT_MAX (dregs) (..)\n"); - (yyval.instr) = DSP32SHIFT (9, &(yyvsp[-6].reg), 0, &(yyvsp[-2].reg), ((yyvsp[0].r0).r0 ? 0 : 1), 0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 124: -#line 2295 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-8].reg)) && IS_DREG ((yyvsp[-4].reg)) && IS_DREG ((yyvsp[-2].reg))) - { - notethat ("dsp32shift: dregs = VIT_MAX (dregs, dregs) (ASR)\n"); - (yyval.instr) = DSP32SHIFT (9, &(yyvsp[-8].reg), &(yyvsp[-2].reg), &(yyvsp[-4].reg), 2 | ((yyvsp[0].r0).r0 ? 0 : 1), 0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 125: -#line 2306 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-6].reg)) && IS_DREG ((yyvsp[-4].reg)) && !IS_A1 ((yyvsp[-2].reg))) - { - notethat ("dsp32shift: BITMUX (dregs , dregs , A0) (ASR)\n"); - (yyval.instr) = DSP32SHIFT (8, 0, &(yyvsp[-6].reg), &(yyvsp[-4].reg), (yyvsp[0].r0).r0, 0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 126: -#line 2317 "bfin-parse.y" - { - if (!IS_A1 ((yyvsp[-8].reg)) && !IS_A1 ((yyvsp[-5].reg)) && IS_A1 ((yyvsp[-3].reg))) - { - notethat ("dsp32shift: A0 = BXORSHIFT (A0 , A1 , CC )\n"); - (yyval.instr) = DSP32SHIFT (12, 0, 0, 0, 0, 0); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 127: -#line 2330 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-3].reg)) && IS_UIMM ((yyvsp[-1].expr), 5)) - { - notethat ("LOGI2op: BITCLR (dregs , uimm5 )\n"); - (yyval.instr) = LOGI2OP ((yyvsp[-3].reg), uimm5 ((yyvsp[-1].expr)), 4); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 128: -#line 2342 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-3].reg)) && IS_UIMM ((yyvsp[-1].expr), 5)) - { - notethat ("LOGI2op: BITCLR (dregs , uimm5 )\n"); - (yyval.instr) = LOGI2OP ((yyvsp[-3].reg), uimm5 ((yyvsp[-1].expr)), 2); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 129: -#line 2354 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-3].reg)) && IS_UIMM ((yyvsp[-1].expr), 5)) - { - notethat ("LOGI2op: BITCLR (dregs , uimm5 )\n"); - (yyval.instr) = LOGI2OP ((yyvsp[-3].reg), uimm5 ((yyvsp[-1].expr)), 3); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 130: -#line 2365 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-3].reg)) && IS_UIMM ((yyvsp[-1].expr), 5)) - { - notethat ("LOGI2op: CC =! BITTST (dregs , uimm5 )\n"); - (yyval.instr) = LOGI2OP ((yyvsp[-3].reg), uimm5 ((yyvsp[-1].expr)), 0); - } - else - return yyerror ("Register mismatch or value error"); - } - break; - - case 131: -#line 2376 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-3].reg)) && IS_UIMM ((yyvsp[-1].expr), 5)) - { - notethat ("LOGI2op: CC = BITTST (dregs , uimm5 )\n"); - (yyval.instr) = LOGI2OP ((yyvsp[-3].reg), uimm5 ((yyvsp[-1].expr)), 1); - } - else - return yyerror ("Register mismatch or value error"); - } - break; - - case 132: -#line 2387 "bfin-parse.y" - { - if ((IS_DREG ((yyvsp[-2].reg)) || IS_PREG ((yyvsp[-2].reg))) - && (IS_DREG ((yyvsp[0].reg)) || IS_PREG ((yyvsp[0].reg)))) - { - notethat ("ccMV: IF ! CC gregs = gregs\n"); - (yyval.instr) = CCMV (&(yyvsp[0].reg), &(yyvsp[-2].reg), 0); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 133: -#line 2399 "bfin-parse.y" - { - if ((IS_DREG ((yyvsp[0].reg)) || IS_PREG ((yyvsp[0].reg))) - && (IS_DREG ((yyvsp[-2].reg)) || IS_PREG ((yyvsp[-2].reg)))) - { - notethat ("ccMV: IF CC gregs = gregs\n"); - (yyval.instr) = CCMV (&(yyvsp[0].reg), &(yyvsp[-2].reg), 1); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 134: -#line 2411 "bfin-parse.y" - { - if (IS_PCREL10 ((yyvsp[0].expr))) - { - notethat ("BRCC: IF !CC JUMP pcrel11m2\n"); - (yyval.instr) = BRCC (0, 0, (yyvsp[0].expr)); - } - else - return yyerror ("Bad jump offset"); - } - break; - - case 135: -#line 2422 "bfin-parse.y" - { - if (IS_PCREL10 ((yyvsp[-3].expr))) - { - notethat ("BRCC: IF !CC JUMP pcrel11m2\n"); - (yyval.instr) = BRCC (0, 1, (yyvsp[-3].expr)); - } - else - return yyerror ("Bad jump offset"); - } - break; - - case 136: -#line 2433 "bfin-parse.y" - { - if (IS_PCREL10 ((yyvsp[0].expr))) - { - notethat ("BRCC: IF CC JUMP pcrel11m2\n"); - (yyval.instr) = BRCC (1, 0, (yyvsp[0].expr)); - } - else - return yyerror ("Bad jump offset"); - } - break; - - case 137: -#line 2444 "bfin-parse.y" - { - if (IS_PCREL10 ((yyvsp[-3].expr))) - { - notethat ("BRCC: IF !CC JUMP pcrel11m2\n"); - (yyval.instr) = BRCC (1, 1, (yyvsp[-3].expr)); - } - else - return yyerror ("Bad jump offset"); - } - break; - - case 138: -#line 2454 "bfin-parse.y" - { - notethat ("ProgCtrl: NOP\n"); - (yyval.instr) = PROGCTRL (0, 0); - } - break; - - case 139: -#line 2460 "bfin-parse.y" - { - notethat ("ProgCtrl: RTS\n"); - (yyval.instr) = PROGCTRL (1, 0); - } - break; - - case 140: -#line 2466 "bfin-parse.y" - { - notethat ("ProgCtrl: RTI\n"); - (yyval.instr) = PROGCTRL (1, 1); - } - break; - - case 141: -#line 2472 "bfin-parse.y" - { - notethat ("ProgCtrl: RTX\n"); - (yyval.instr) = PROGCTRL (1, 2); - } - break; - - case 142: -#line 2478 "bfin-parse.y" - { - notethat ("ProgCtrl: RTN\n"); - (yyval.instr) = PROGCTRL (1, 3); - } - break; - - case 143: -#line 2484 "bfin-parse.y" - { - notethat ("ProgCtrl: RTE\n"); - (yyval.instr) = PROGCTRL (1, 4); - } - break; - - case 144: -#line 2490 "bfin-parse.y" - { - notethat ("ProgCtrl: IDLE\n"); - (yyval.instr) = PROGCTRL (2, 0); - } - break; - - case 145: -#line 2496 "bfin-parse.y" - { - notethat ("ProgCtrl: CSYNC\n"); - (yyval.instr) = PROGCTRL (2, 3); - } - break; - - case 146: -#line 2502 "bfin-parse.y" - { - notethat ("ProgCtrl: SSYNC\n"); - (yyval.instr) = PROGCTRL (2, 4); - } - break; - - case 147: -#line 2508 "bfin-parse.y" - { - notethat ("ProgCtrl: EMUEXCPT\n"); - (yyval.instr) = PROGCTRL (2, 5); - } - break; - - case 148: -#line 2514 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[0].reg))) - { - notethat ("ProgCtrl: CLI dregs\n"); - (yyval.instr) = PROGCTRL (3, (yyvsp[0].reg).regno & CODE_MASK); - } - else - return yyerror ("Dreg expected for CLI"); - } - break; - - case 149: -#line 2525 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[0].reg))) - { - notethat ("ProgCtrl: STI dregs\n"); - (yyval.instr) = PROGCTRL (4, (yyvsp[0].reg).regno & CODE_MASK); - } - else - return yyerror ("Dreg expected for STI"); - } - break; - - case 150: -#line 2536 "bfin-parse.y" - { - if (IS_PREG ((yyvsp[-1].reg))) - { - notethat ("ProgCtrl: JUMP (pregs )\n"); - (yyval.instr) = PROGCTRL (5, (yyvsp[-1].reg).regno & CODE_MASK); - } - else - return yyerror ("Bad register for indirect jump"); - } - break; - - case 151: -#line 2547 "bfin-parse.y" - { - if (IS_PREG ((yyvsp[-1].reg))) - { - notethat ("ProgCtrl: CALL (pregs )\n"); - (yyval.instr) = PROGCTRL (6, (yyvsp[-1].reg).regno & CODE_MASK); - } - else - return yyerror ("Bad register for indirect call"); - } - break; - - case 152: -#line 2558 "bfin-parse.y" - { - if (IS_PREG ((yyvsp[-1].reg))) - { - notethat ("ProgCtrl: CALL (PC + pregs )\n"); - (yyval.instr) = PROGCTRL (7, (yyvsp[-1].reg).regno & CODE_MASK); - } - else - return yyerror ("Bad register for indirect call"); - } - break; - - case 153: -#line 2569 "bfin-parse.y" - { - if (IS_PREG ((yyvsp[-1].reg))) - { - notethat ("ProgCtrl: JUMP (PC + pregs )\n"); - (yyval.instr) = PROGCTRL (8, (yyvsp[-1].reg).regno & CODE_MASK); - } - else - return yyerror ("Bad register for indirect jump"); - } - break; - - case 154: -#line 2580 "bfin-parse.y" - { - if (IS_UIMM ((yyvsp[0].expr), 4)) - { - notethat ("ProgCtrl: RAISE uimm4\n"); - (yyval.instr) = PROGCTRL (9, uimm4 ((yyvsp[0].expr))); - } - else - return yyerror ("Bad value for RAISE"); - } - break; - - case 155: -#line 2591 "bfin-parse.y" - { - notethat ("ProgCtrl: EMUEXCPT\n"); - (yyval.instr) = PROGCTRL (10, uimm4 ((yyvsp[0].expr))); - } - break; - - case 156: -#line 2597 "bfin-parse.y" - { - if (IS_PREG ((yyvsp[-1].reg))) - { - notethat ("ProgCtrl: TESTSET (pregs )\n"); - (yyval.instr) = PROGCTRL (11, (yyvsp[-1].reg).regno & CODE_MASK); - } - else - return yyerror ("Preg expected"); - } - break; - - case 157: -#line 2608 "bfin-parse.y" - { - if (IS_PCREL12 ((yyvsp[0].expr))) - { - notethat ("UJUMP: JUMP pcrel12\n"); - (yyval.instr) = UJUMP ((yyvsp[0].expr)); - } - else - return yyerror ("Bad value for relative jump"); - } - break; - - case 158: -#line 2619 "bfin-parse.y" - { - if (IS_PCREL12 ((yyvsp[0].expr))) - { - notethat ("UJUMP: JUMP_DOT_S pcrel12\n"); - (yyval.instr) = UJUMP((yyvsp[0].expr)); - } - else - return yyerror ("Bad value for relative jump"); - } - break; - - case 159: -#line 2630 "bfin-parse.y" - { - if (IS_PCREL24 ((yyvsp[0].expr))) - { - notethat ("CALLa: jump.l pcrel24\n"); - (yyval.instr) = CALLA ((yyvsp[0].expr), 0); - } - else - return yyerror ("Bad value for long jump"); - } - break; - - case 160: -#line 2641 "bfin-parse.y" - { - if (IS_PCREL24 ((yyvsp[0].expr))) - { - notethat ("CALLa: jump.l pcrel24\n"); - (yyval.instr) = CALLA ((yyvsp[0].expr), 2); - } - else - return yyerror ("Bad value for long jump"); - } - break; - - case 161: -#line 2652 "bfin-parse.y" - { - if (IS_PCREL24 ((yyvsp[0].expr))) - { - notethat ("CALLa: CALL pcrel25m2\n"); - (yyval.instr) = CALLA ((yyvsp[0].expr), 1); - } - else - return yyerror ("Bad call address"); - } - break; - - case 162: -#line 2662 "bfin-parse.y" - { - if (IS_PCREL24 ((yyvsp[0].expr))) - { - notethat ("CALLa: CALL pcrel25m2\n"); - (yyval.instr) = CALLA ((yyvsp[0].expr), 2); - } - else - return yyerror ("Bad call address"); - } - break; - - case 163: -#line 2675 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-3].reg)) && IS_DREG ((yyvsp[-1].reg))) - (yyval.instr) = ALU2OP (&(yyvsp[-3].reg), &(yyvsp[-1].reg), 8); - else - return yyerror ("Bad registers for DIVQ"); - } - break; - - case 164: -#line 2683 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-3].reg)) && IS_DREG ((yyvsp[-1].reg))) - (yyval.instr) = ALU2OP (&(yyvsp[-3].reg), &(yyvsp[-1].reg), 9); - else - return yyerror ("Bad registers for DIVS"); - } - break; - - case 165: -#line 2691 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-4].reg)) && IS_DREG ((yyvsp[-1].reg))) - { - if ((yyvsp[0].modcodes).r0 == 0 && (yyvsp[0].modcodes).s0 == 0 && (yyvsp[0].modcodes).aop == 0) - { - notethat ("ALU2op: dregs = - dregs\n"); - (yyval.instr) = ALU2OP (&(yyvsp[-4].reg), &(yyvsp[-1].reg), 14); - } - else if ((yyvsp[0].modcodes).r0 == 1 && (yyvsp[0].modcodes).s0 == 0 && (yyvsp[0].modcodes).aop == 3) - { - notethat ("dsp32alu: dregs = - dregs (.)\n"); - (yyval.instr) = DSP32ALU (15, 0, 0, &(yyvsp[-4].reg), &(yyvsp[-1].reg), 0, (yyvsp[0].modcodes).s0, 0, 3); - } - else - { - notethat ("dsp32alu: dregs = - dregs (.)\n"); - (yyval.instr) = DSP32ALU (7, 0, 0, &(yyvsp[-4].reg), &(yyvsp[-1].reg), 0, (yyvsp[0].modcodes).s0, 0, 3); - } - } - else - return yyerror ("Dregs expected"); - } - break; - - case 166: -#line 2715 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-3].reg)) && IS_DREG ((yyvsp[0].reg))) - { - notethat ("ALU2op: dregs = ~dregs\n"); - (yyval.instr) = ALU2OP (&(yyvsp[-3].reg), &(yyvsp[0].reg), 15); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 167: -#line 2726 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-2].reg)) && IS_DREG ((yyvsp[0].reg))) - { - notethat ("ALU2op: dregs >>= dregs\n"); - (yyval.instr) = ALU2OP (&(yyvsp[-2].reg), &(yyvsp[0].reg), 1); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 168: -#line 2737 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-2].reg)) && IS_UIMM ((yyvsp[0].expr), 5)) - { - notethat ("LOGI2op: dregs >>= uimm5\n"); - (yyval.instr) = LOGI2OP ((yyvsp[-2].reg), uimm5 ((yyvsp[0].expr)), 6); - } - else - return yyerror ("Dregs expected or value error"); - } - break; - - case 169: -#line 2748 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-2].reg)) && IS_DREG ((yyvsp[0].reg))) - { - notethat ("ALU2op: dregs >>>= dregs\n"); - (yyval.instr) = ALU2OP (&(yyvsp[-2].reg), &(yyvsp[0].reg), 0); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 170: -#line 2759 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-2].reg)) && IS_DREG ((yyvsp[0].reg))) - { - notethat ("ALU2op: dregs <<= dregs\n"); - (yyval.instr) = ALU2OP (&(yyvsp[-2].reg), &(yyvsp[0].reg), 2); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 171: -#line 2770 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-2].reg)) && IS_UIMM ((yyvsp[0].expr), 5)) - { - notethat ("LOGI2op: dregs <<= uimm5\n"); - (yyval.instr) = LOGI2OP ((yyvsp[-2].reg), uimm5 ((yyvsp[0].expr)), 7); - } - else - return yyerror ("Dregs expected or const value error"); - } - break; - - case 172: -#line 2782 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-2].reg)) && IS_UIMM ((yyvsp[0].expr), 5)) - { - notethat ("LOGI2op: dregs >>>= uimm5\n"); - (yyval.instr) = LOGI2OP ((yyvsp[-2].reg), uimm5 ((yyvsp[0].expr)), 5); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 173: -#line 2795 "bfin-parse.y" - { - notethat ("CaCTRL: FLUSH [ pregs ]\n"); - if (IS_PREG ((yyvsp[-1].reg))) - (yyval.instr) = CACTRL (&(yyvsp[-1].reg), 0, 2); - else - return yyerror ("Bad register(s) for FLUSH"); - } - break; - - case 174: -#line 2804 "bfin-parse.y" - { - if (IS_PREG ((yyvsp[0].reg))) - { - notethat ("CaCTRL: FLUSH [ pregs ++ ]\n"); - (yyval.instr) = CACTRL (&(yyvsp[0].reg), 1, 2); - } - else - return yyerror ("Bad register(s) for FLUSH"); - } - break; - - case 175: -#line 2815 "bfin-parse.y" - { - if (IS_PREG ((yyvsp[-1].reg))) - { - notethat ("CaCTRL: FLUSHINV [ pregs ]\n"); - (yyval.instr) = CACTRL (&(yyvsp[-1].reg), 0, 1); - } - else - return yyerror ("Bad register(s) for FLUSH"); - } - break; - - case 176: -#line 2826 "bfin-parse.y" - { - if (IS_PREG ((yyvsp[0].reg))) - { - notethat ("CaCTRL: FLUSHINV [ pregs ++ ]\n"); - (yyval.instr) = CACTRL (&(yyvsp[0].reg), 1, 1); - } - else - return yyerror ("Bad register(s) for FLUSH"); - } - break; - - case 177: -#line 2838 "bfin-parse.y" - { - if (IS_PREG ((yyvsp[-1].reg))) - { - notethat ("CaCTRL: IFLUSH [ pregs ]\n"); - (yyval.instr) = CACTRL (&(yyvsp[-1].reg), 0, 3); - } - else - return yyerror ("Bad register(s) for FLUSH"); - } - break; - - case 178: -#line 2849 "bfin-parse.y" - { - if (IS_PREG ((yyvsp[0].reg))) - { - notethat ("CaCTRL: IFLUSH [ pregs ++ ]\n"); - (yyval.instr) = CACTRL (&(yyvsp[0].reg), 1, 3); - } - else - return yyerror ("Bad register(s) for FLUSH"); - } - break; - - case 179: -#line 2860 "bfin-parse.y" - { - if (IS_PREG ((yyvsp[-1].reg))) - { - notethat ("CaCTRL: PREFETCH [ pregs ]\n"); - (yyval.instr) = CACTRL (&(yyvsp[-1].reg), 0, 0); - } - else - return yyerror ("Bad register(s) for PREFETCH"); - } - break; - - case 180: -#line 2871 "bfin-parse.y" - { - if (IS_PREG ((yyvsp[0].reg))) - { - notethat ("CaCTRL: PREFETCH [ pregs ++ ]\n"); - (yyval.instr) = CACTRL (&(yyvsp[0].reg), 1, 0); - } - else - return yyerror ("Bad register(s) for PREFETCH"); - } - break; - - case 181: -#line 2885 "bfin-parse.y" - { - if (IS_PREG ((yyvsp[-4].reg)) && IS_DREG ((yyvsp[0].reg))) - { - notethat ("LDST: B [ pregs ] = dregs\n"); - (yyval.instr) = LDST (&(yyvsp[-4].reg), &(yyvsp[0].reg), (yyvsp[-3].modcodes).x0, 2, 0, 1); - } - else - return yyerror ("Register mismatch"); - } - break; - - case 182: -#line 2897 "bfin-parse.y" - { - if (IS_PREG ((yyvsp[-5].reg)) && IS_RANGE(16, (yyvsp[-3].expr), (yyvsp[-4].r0).r0, 1) && IS_DREG ((yyvsp[0].reg))) - { - notethat ("LDST: B [ pregs + imm16 ] = dregs\n"); - if ((yyvsp[-4].r0).r0) - neg_value ((yyvsp[-3].expr)); - (yyval.instr) = LDSTIDXI (&(yyvsp[-5].reg), &(yyvsp[0].reg), 1, 2, 0, (yyvsp[-3].expr)); - } - else - return yyerror ("Register mismatch or const size wrong"); - } - break; - - case 183: -#line 2912 "bfin-parse.y" - { - if (IS_PREG ((yyvsp[-5].reg)) && IS_URANGE (4, (yyvsp[-3].expr), (yyvsp[-4].r0).r0, 2) && IS_DREG ((yyvsp[0].reg))) - { - notethat ("LDSTii: W [ pregs +- uimm5m2 ] = dregs\n"); - (yyval.instr) = LDSTII (&(yyvsp[-5].reg), &(yyvsp[0].reg), (yyvsp[-3].expr), 1, 1); - } - else if (IS_PREG ((yyvsp[-5].reg)) && IS_RANGE(16, (yyvsp[-3].expr), (yyvsp[-4].r0).r0, 2) && IS_DREG ((yyvsp[0].reg))) - { - notethat ("LDSTidxI: W [ pregs + imm17m2 ] = dregs\n"); - if ((yyvsp[-4].r0).r0) - neg_value ((yyvsp[-3].expr)); - (yyval.instr) = LDSTIDXI (&(yyvsp[-5].reg), &(yyvsp[0].reg), 1, 1, 0, (yyvsp[-3].expr)); - } - else - return yyerror ("Bad register(s) or wrong constant size"); - } - break; - - case 184: -#line 2931 "bfin-parse.y" - { - if (IS_PREG ((yyvsp[-4].reg)) && IS_DREG ((yyvsp[0].reg))) - { - notethat ("LDST: W [ pregs ] = dregs\n"); - (yyval.instr) = LDST (&(yyvsp[-4].reg), &(yyvsp[0].reg), (yyvsp[-3].modcodes).x0, 1, 0, 1); - } - else - return yyerror ("Bad register(s) for STORE"); - } - break; - - case 185: -#line 2942 "bfin-parse.y" - { - if (IS_IREG ((yyvsp[-4].reg))) - { - notethat ("dspLDST: W [ iregs ] = dregs_half\n"); - (yyval.instr) = DSPLDST (&(yyvsp[-4].reg), 1 + IS_H ((yyvsp[0].reg)), &(yyvsp[0].reg), (yyvsp[-3].modcodes).x0, 1); - } - else if ((yyvsp[-3].modcodes).x0 == 2 && IS_PREG ((yyvsp[-4].reg)) && IS_DREG ((yyvsp[0].reg))) - { - notethat ("LDSTpmod: W [ pregs ] = dregs_half\n"); - (yyval.instr) = LDSTPMOD (&(yyvsp[-4].reg), &(yyvsp[0].reg), &(yyvsp[-4].reg), 1 + IS_H ((yyvsp[0].reg)), 1); - - } - else - return yyerror ("Bad register(s) for STORE"); - } - break; - - case 186: -#line 2960 "bfin-parse.y" - { - Expr_Node *tmp = (yyvsp[-3].expr); - int ispreg = IS_PREG ((yyvsp[0].reg)); - - if (!IS_PREG ((yyvsp[-5].reg))) - return yyerror ("Preg expected for indirect"); - - if (!IS_DREG ((yyvsp[0].reg)) && !ispreg) - return yyerror ("Bad source register for STORE"); - - if ((yyvsp[-4].r0).r0) - tmp = unary (Expr_Op_Type_NEG, tmp); - - if (in_range_p (tmp, 0, 63, 3)) - { - notethat ("LDSTii: dpregs = [ pregs + uimm6m4 ]\n"); - (yyval.instr) = LDSTII (&(yyvsp[-5].reg), &(yyvsp[0].reg), tmp, 1, ispreg ? 3 : 0); - } - else if ((yyvsp[-5].reg).regno == REG_FP && in_range_p (tmp, -128, 0, 3)) - { - notethat ("LDSTiiFP: dpregs = [ FP - uimm7m4 ]\n"); - tmp = unary (Expr_Op_Type_NEG, tmp); - (yyval.instr) = LDSTIIFP (tmp, &(yyvsp[0].reg), 1); - } - else if (in_range_p (tmp, -131072, 131071, 3)) - { - notethat ("LDSTidxI: [ pregs + imm18m4 ] = dpregs\n"); - (yyval.instr) = LDSTIDXI (&(yyvsp[-5].reg), &(yyvsp[0].reg), 1, 0, ispreg ? 1: 0, tmp); - } - else - return yyerror ("Displacement out of range for store"); - } - break; - - case 187: -#line 2994 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-8].reg)) && IS_PREG ((yyvsp[-4].reg)) && IS_URANGE (4, (yyvsp[-2].expr), (yyvsp[-3].r0).r0, 2)) - { - notethat ("LDSTii: dregs = W [ pregs + uimm4s2 ] (.)\n"); - (yyval.instr) = LDSTII (&(yyvsp[-4].reg), &(yyvsp[-8].reg), (yyvsp[-2].expr), 0, 1 << (yyvsp[0].r0).r0); - } - else if (IS_DREG ((yyvsp[-8].reg)) && IS_PREG ((yyvsp[-4].reg)) && IS_RANGE(16, (yyvsp[-2].expr), (yyvsp[-3].r0).r0, 2)) - { - notethat ("LDSTidxI: dregs = W [ pregs + imm17m2 ] (.)\n"); - if ((yyvsp[-3].r0).r0) - neg_value ((yyvsp[-2].expr)); - (yyval.instr) = LDSTIDXI (&(yyvsp[-4].reg), &(yyvsp[-8].reg), 0, 1, (yyvsp[0].r0).r0, (yyvsp[-2].expr)); - } - else - return yyerror ("Bad register or constant for LOAD"); - } - break; - - case 188: -#line 3012 "bfin-parse.y" - { - if (IS_IREG ((yyvsp[-2].reg))) - { - notethat ("dspLDST: dregs_half = W [ iregs ]\n"); - (yyval.instr) = DSPLDST(&(yyvsp[-2].reg), 1 + IS_H ((yyvsp[-6].reg)), &(yyvsp[-6].reg), (yyvsp[-1].modcodes).x0, 0); - } - else if ((yyvsp[-1].modcodes).x0 == 2 && IS_DREG ((yyvsp[-6].reg)) && IS_PREG ((yyvsp[-2].reg))) - { - notethat ("LDSTpmod: dregs_half = W [ pregs ]\n"); - (yyval.instr) = LDSTPMOD (&(yyvsp[-2].reg), &(yyvsp[-6].reg), &(yyvsp[-2].reg), 1 + IS_H ((yyvsp[-6].reg)), 0); - } - else - return yyerror ("Bad register or post_op for LOAD"); - } - break; - - case 189: -#line 3029 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-7].reg)) && IS_PREG ((yyvsp[-3].reg))) - { - notethat ("LDST: dregs = W [ pregs ] (.)\n"); - (yyval.instr) = LDST (&(yyvsp[-3].reg), &(yyvsp[-7].reg), (yyvsp[-2].modcodes).x0, 1, (yyvsp[0].r0).r0, 0); - } - else - return yyerror ("Bad register for LOAD"); - } - break; - - case 190: -#line 3040 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-8].reg)) && IS_PREG ((yyvsp[-4].reg)) && IS_PREG ((yyvsp[-2].reg))) - { - notethat ("LDSTpmod: dregs = W [ pregs ++ pregs ] (.)\n"); - (yyval.instr) = LDSTPMOD (&(yyvsp[-4].reg), &(yyvsp[-8].reg), &(yyvsp[-2].reg), 3, (yyvsp[0].r0).r0); - } - else - return yyerror ("Bad register for LOAD"); - } - break; - - case 191: -#line 3051 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-7].reg)) && IS_PREG ((yyvsp[-3].reg)) && IS_PREG ((yyvsp[-1].reg))) - { - notethat ("LDSTpmod: dregs_half = W [ pregs ++ pregs ]\n"); - (yyval.instr) = LDSTPMOD (&(yyvsp[-3].reg), &(yyvsp[-7].reg), &(yyvsp[-1].reg), 1 + IS_H ((yyvsp[-7].reg)), 0); - } - else - return yyerror ("Bad register for LOAD"); - } - break; - - case 192: -#line 3062 "bfin-parse.y" - { - if (IS_IREG ((yyvsp[-4].reg)) && IS_DREG ((yyvsp[0].reg))) - { - notethat ("dspLDST: [ iregs ] = dregs\n"); - (yyval.instr) = DSPLDST(&(yyvsp[-4].reg), 0, &(yyvsp[0].reg), (yyvsp[-3].modcodes).x0, 1); - } - else if (IS_PREG ((yyvsp[-4].reg)) && IS_DREG ((yyvsp[0].reg))) - { - notethat ("LDST: [ pregs ] = dregs\n"); - (yyval.instr) = LDST (&(yyvsp[-4].reg), &(yyvsp[0].reg), (yyvsp[-3].modcodes).x0, 0, 0, 1); - } - else if (IS_PREG ((yyvsp[-4].reg)) && IS_PREG ((yyvsp[0].reg))) - { - notethat ("LDST: [ pregs ] = pregs\n"); - (yyval.instr) = LDST (&(yyvsp[-4].reg), &(yyvsp[0].reg), (yyvsp[-3].modcodes).x0, 0, 1, 1); - } - else - return yyerror ("Bad register for STORE"); - } - break; - - case 193: -#line 3083 "bfin-parse.y" - { - if (! IS_DREG ((yyvsp[0].reg))) - return yyerror ("Expected Dreg for last argument"); - - if (IS_IREG ((yyvsp[-5].reg)) && IS_MREG ((yyvsp[-3].reg))) - { - notethat ("dspLDST: [ iregs ++ mregs ] = dregs\n"); - (yyval.instr) = DSPLDST(&(yyvsp[-5].reg), (yyvsp[-3].reg).regno & CODE_MASK, &(yyvsp[0].reg), 3, 1); - } - else if (IS_PREG ((yyvsp[-5].reg)) && IS_PREG ((yyvsp[-3].reg))) - { - notethat ("LDSTpmod: [ pregs ++ pregs ] = dregs\n"); - (yyval.instr) = LDSTPMOD (&(yyvsp[-5].reg), &(yyvsp[0].reg), &(yyvsp[-3].reg), 0, 1); - } - else - return yyerror ("Bad register for STORE"); - } - break; - - case 194: -#line 3102 "bfin-parse.y" - { - if (!IS_DREG ((yyvsp[0].reg))) - return yyerror ("Expect Dreg as last argument"); - if (IS_PREG ((yyvsp[-5].reg)) && IS_PREG ((yyvsp[-3].reg))) - { - notethat ("LDSTpmod: W [ pregs ++ pregs ] = dregs_half\n"); - (yyval.instr) = LDSTPMOD (&(yyvsp[-5].reg), &(yyvsp[0].reg), &(yyvsp[-3].reg), 1 + IS_H ((yyvsp[0].reg)), 1); - } - else - return yyerror ("Bad register for STORE"); - } - break; - - case 195: -#line 3115 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-8].reg)) && IS_PREG ((yyvsp[-4].reg)) && IS_RANGE(16, (yyvsp[-2].expr), (yyvsp[-3].r0).r0, 1)) - { - notethat ("LDSTidxI: dregs = B [ pregs + imm16 ] (%c)\n", - (yyvsp[0].r0).r0 ? 'X' : 'Z'); - if ((yyvsp[-3].r0).r0) - neg_value ((yyvsp[-2].expr)); - (yyval.instr) = LDSTIDXI (&(yyvsp[-4].reg), &(yyvsp[-8].reg), 0, 2, (yyvsp[0].r0).r0, (yyvsp[-2].expr)); - } - else - return yyerror ("Bad register or value for LOAD"); - } - break; - - case 196: -#line 3129 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-7].reg)) && IS_PREG ((yyvsp[-3].reg))) - { - notethat ("LDST: dregs = B [ pregs ] (%c)\n", - (yyvsp[0].r0).r0 ? 'X' : 'Z'); - (yyval.instr) = LDST (&(yyvsp[-3].reg), &(yyvsp[-7].reg), (yyvsp[-2].modcodes).x0, 2, (yyvsp[0].r0).r0, 0); - } - else - return yyerror ("Bad register for LOAD"); - } - break; - - case 197: -#line 3141 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-6].reg)) && IS_IREG ((yyvsp[-3].reg)) && IS_MREG ((yyvsp[-1].reg))) - { - notethat ("dspLDST: dregs = [ iregs ++ mregs ]\n"); - (yyval.instr) = DSPLDST(&(yyvsp[-3].reg), (yyvsp[-1].reg).regno & CODE_MASK, &(yyvsp[-6].reg), 3, 0); - } - else if (IS_DREG ((yyvsp[-6].reg)) && IS_PREG ((yyvsp[-3].reg)) && IS_PREG ((yyvsp[-1].reg))) - { - notethat ("LDSTpmod: dregs = [ pregs ++ pregs ]\n"); - (yyval.instr) = LDSTPMOD (&(yyvsp[-3].reg), &(yyvsp[-6].reg), &(yyvsp[-1].reg), 0, 0); - } - else - return yyerror ("Bad register for LOAD"); - } - break; - - case 198: -#line 3157 "bfin-parse.y" - { - Expr_Node *tmp = (yyvsp[-1].expr); - int ispreg = IS_PREG ((yyvsp[-6].reg)); - int isgot = IS_RELOC((yyvsp[-1].expr)); - - if (!IS_PREG ((yyvsp[-3].reg))) - return yyerror ("Preg expected for indirect"); - - if (!IS_DREG ((yyvsp[-6].reg)) && !ispreg) - return yyerror ("Bad destination register for LOAD"); - - if ((yyvsp[-2].r0).r0) - tmp = unary (Expr_Op_Type_NEG, tmp); - - if(isgot){ - notethat ("LDSTidxI: dpregs = [ pregs + sym@got ]\n"); - (yyval.instr) = LDSTIDXI (&(yyvsp[-3].reg), &(yyvsp[-6].reg), 0, 0, ispreg ? 1: 0, tmp); - } - else if (in_range_p (tmp, 0, 63, 3)) - { - notethat ("LDSTii: dpregs = [ pregs + uimm7m4 ]\n"); - (yyval.instr) = LDSTII (&(yyvsp[-3].reg), &(yyvsp[-6].reg), tmp, 0, ispreg ? 3 : 0); - } - else if ((yyvsp[-3].reg).regno == REG_FP && in_range_p (tmp, -128, 0, 3)) - { - notethat ("LDSTiiFP: dpregs = [ FP - uimm7m4 ]\n"); - tmp = unary (Expr_Op_Type_NEG, tmp); - (yyval.instr) = LDSTIIFP (tmp, &(yyvsp[-6].reg), 0); - } - else if (in_range_p (tmp, -131072, 131071, 3)) - { - notethat ("LDSTidxI: dpregs = [ pregs + imm18m4 ]\n"); - (yyval.instr) = LDSTIDXI (&(yyvsp[-3].reg), &(yyvsp[-6].reg), 0, 0, ispreg ? 1: 0, tmp); - - } - else - return yyerror ("Displacement out of range for load"); - } - break; - - case 199: -#line 3197 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-5].reg)) && IS_IREG ((yyvsp[-2].reg))) - { - notethat ("dspLDST: dregs = [ iregs ]\n"); - (yyval.instr) = DSPLDST (&(yyvsp[-2].reg), 0, &(yyvsp[-5].reg), (yyvsp[-1].modcodes).x0, 0); - } - else if (IS_DREG ((yyvsp[-5].reg)) && IS_PREG ((yyvsp[-2].reg))) - { - notethat ("LDST: dregs = [ pregs ]\n"); - (yyval.instr) = LDST (&(yyvsp[-2].reg), &(yyvsp[-5].reg), (yyvsp[-1].modcodes).x0, 0, 0, 0); - } - else if (IS_PREG ((yyvsp[-5].reg)) && IS_PREG ((yyvsp[-2].reg))) - { - if (REG_SAME ((yyvsp[-5].reg), (yyvsp[-2].reg)) && (yyvsp[-1].modcodes).x0 != 2) - return yyerror ("Pregs can't be same"); - - notethat ("LDST: pregs = [ pregs ]\n"); - (yyval.instr) = LDST (&(yyvsp[-2].reg), &(yyvsp[-5].reg), (yyvsp[-1].modcodes).x0, 0, 1, 0); - } - else if ((yyvsp[-2].reg).regno == REG_SP && IS_ALLREG ((yyvsp[-5].reg)) && (yyvsp[-1].modcodes).x0 == 0) - { - notethat ("PushPopReg: allregs = [ SP ++ ]\n"); - (yyval.instr) = PUSHPOPREG (&(yyvsp[-5].reg), 0); - } - else - return yyerror ("Bad register or value"); - } - break; - - case 200: -#line 3230 "bfin-parse.y" - { - bfin_equals ((yyvsp[-2].expr)); - (yyval.instr) = 0; - } - break; - - case 201: -#line 3238 "bfin-parse.y" - { - if ((yyvsp[-10].reg).regno != REG_SP) - yyerror ("Stack Pointer expected"); - if ((yyvsp[-7].reg).regno == REG_R7 - && IN_RANGE ((yyvsp[-5].expr), 0, 7) - && (yyvsp[-3].reg).regno == REG_P5 - && IN_RANGE ((yyvsp[-1].expr), 0, 5)) - { - notethat ("PushPopMultiple: [ -- SP ] = (R7 : reglim , P5 : reglim )\n"); - (yyval.instr) = PUSHPOPMULTIPLE (imm5 ((yyvsp[-5].expr)), imm5 ((yyvsp[-1].expr)), 1, 1, 1); - } - else - return yyerror ("Bad register for PushPopMultiple"); - } - break; - - case 202: -#line 3254 "bfin-parse.y" - { - if ((yyvsp[-6].reg).regno != REG_SP) - yyerror ("Stack Pointer expected"); - - if ((yyvsp[-3].reg).regno == REG_R7 && IN_RANGE ((yyvsp[-1].expr), 0, 7)) - { - notethat ("PushPopMultiple: [ -- SP ] = (R7 : reglim )\n"); - (yyval.instr) = PUSHPOPMULTIPLE (imm5 ((yyvsp[-1].expr)), 0, 1, 0, 1); - } - else if ((yyvsp[-3].reg).regno == REG_P5 && IN_RANGE ((yyvsp[-1].expr), 0, 6)) - { - notethat ("PushPopMultiple: [ -- SP ] = (P5 : reglim )\n"); - (yyval.instr) = PUSHPOPMULTIPLE (0, imm5 ((yyvsp[-1].expr)), 0, 1, 1); - } - else - return yyerror ("Bad register for PushPopMultiple"); - } - break; - - case 203: -#line 3273 "bfin-parse.y" - { - if ((yyvsp[0].reg).regno != REG_SP) - yyerror ("Stack Pointer expected"); - if ((yyvsp[-9].reg).regno == REG_R7 && (IN_RANGE ((yyvsp[-7].expr), 0, 7)) - && (yyvsp[-5].reg).regno == REG_P5 && (IN_RANGE ((yyvsp[-3].expr), 0, 6))) - { - notethat ("PushPopMultiple: (R7 : reglim , P5 : reglim ) = [ SP ++ ]\n"); - (yyval.instr) = PUSHPOPMULTIPLE (imm5 ((yyvsp[-7].expr)), imm5 ((yyvsp[-3].expr)), 1, 1, 0); - } - else - return yyerror ("Bad register range for PushPopMultiple"); - } - break; - - case 204: -#line 3287 "bfin-parse.y" - { - if ((yyvsp[0].reg).regno != REG_SP) - yyerror ("Stack Pointer expected"); - - if ((yyvsp[-5].reg).regno == REG_R7 && IN_RANGE ((yyvsp[-3].expr), 0, 7)) - { - notethat ("PushPopMultiple: (R7 : reglim ) = [ SP ++ ]\n"); - (yyval.instr) = PUSHPOPMULTIPLE (imm5 ((yyvsp[-3].expr)), 0, 1, 0, 0); - } - else if ((yyvsp[-5].reg).regno == REG_P5 && IN_RANGE ((yyvsp[-3].expr), 0, 6)) - { - notethat ("PushPopMultiple: (P5 : reglim ) = [ SP ++ ]\n"); - (yyval.instr) = PUSHPOPMULTIPLE (0, imm5 ((yyvsp[-3].expr)), 0, 1, 0); - } - else - return yyerror ("Bad register range for PushPopMultiple"); - } - break; - - case 205: -#line 3306 "bfin-parse.y" - { - if ((yyvsp[-2].reg).regno != REG_SP) - yyerror ("Stack Pointer expected"); - - if (IS_ALLREG ((yyvsp[0].reg))) - { - notethat ("PushPopReg: [ -- SP ] = allregs\n"); - (yyval.instr) = PUSHPOPREG (&(yyvsp[0].reg), 1); - } - else - return yyerror ("Bad register for PushPopReg"); - } - break; - - case 206: -#line 3322 "bfin-parse.y" - { - if (IS_URANGE (16, (yyvsp[0].expr), 0, 4)) - (yyval.instr) = LINKAGE (0, uimm16s4 ((yyvsp[0].expr))); - else - return yyerror ("Bad constant for LINK"); - } - break; - - case 207: -#line 3330 "bfin-parse.y" - { - notethat ("linkage: UNLINK\n"); - (yyval.instr) = LINKAGE (1, 0); - } - break; - - case 208: -#line 3339 "bfin-parse.y" - { - if (IS_PCREL4 ((yyvsp[-4].expr)) && IS_LPPCREL10 ((yyvsp[-2].expr)) && IS_CREG ((yyvsp[0].reg))) - { - notethat ("LoopSetup: LSETUP (pcrel4 , lppcrel10 ) counters\n"); - (yyval.instr) = LOOPSETUP ((yyvsp[-4].expr), &(yyvsp[0].reg), 0, (yyvsp[-2].expr), 0); - } - else - return yyerror ("Bad register or values for LSETUP"); - - } - break; - - case 209: -#line 3350 "bfin-parse.y" - { - if (IS_PCREL4 ((yyvsp[-6].expr)) && IS_LPPCREL10 ((yyvsp[-4].expr)) - && IS_PREG ((yyvsp[0].reg)) && IS_CREG ((yyvsp[-2].reg))) - { - notethat ("LoopSetup: LSETUP (pcrel4 , lppcrel10 ) counters = pregs\n"); - (yyval.instr) = LOOPSETUP ((yyvsp[-6].expr), &(yyvsp[-2].reg), 1, (yyvsp[-4].expr), &(yyvsp[0].reg)); - } - else - return yyerror ("Bad register or values for LSETUP"); - } - break; - - case 210: -#line 3362 "bfin-parse.y" - { - if (IS_PCREL4 ((yyvsp[-8].expr)) && IS_LPPCREL10 ((yyvsp[-6].expr)) - && IS_PREG ((yyvsp[-2].reg)) && IS_CREG ((yyvsp[-4].reg)) - && EXPR_VALUE ((yyvsp[0].expr)) == 1) - { - notethat ("LoopSetup: LSETUP (pcrel4 , lppcrel10 ) counters = pregs >> 1\n"); - (yyval.instr) = LOOPSETUP ((yyvsp[-8].expr), &(yyvsp[-4].reg), 3, (yyvsp[-6].expr), &(yyvsp[-2].reg)); - } - else - return yyerror ("Bad register or values for LSETUP"); - } - break; - - case 211: -#line 3376 "bfin-parse.y" - { - if (!IS_RELOC ((yyvsp[-1].expr))) - return yyerror ("Invalid expression in loop statement"); - if (!IS_CREG ((yyvsp[0].reg))) - return yyerror ("Invalid loop counter register"); - (yyval.instr) = bfin_gen_loop ((yyvsp[-1].expr), &(yyvsp[0].reg), 0, 0); - } - break; - - case 212: -#line 3384 "bfin-parse.y" - { - if (IS_RELOC ((yyvsp[-3].expr)) && IS_PREG ((yyvsp[0].reg)) && IS_CREG ((yyvsp[-2].reg))) - { - notethat ("Loop: LOOP expr counters = pregs\n"); - (yyval.instr) = bfin_gen_loop ((yyvsp[-3].expr), &(yyvsp[-2].reg), 1, &(yyvsp[0].reg)); - } - else - return yyerror ("Bad register or values for LOOP"); - } - break; - - case 213: -#line 3394 "bfin-parse.y" - { - if (IS_RELOC ((yyvsp[-5].expr)) && IS_PREG ((yyvsp[-2].reg)) && IS_CREG ((yyvsp[-4].reg)) && EXPR_VALUE ((yyvsp[0].expr)) == 1) - { - notethat ("Loop: LOOP expr counters = pregs >> 1\n"); - (yyval.instr) = bfin_gen_loop ((yyvsp[-5].expr), &(yyvsp[-4].reg), 3, &(yyvsp[-2].reg)); - } - else - return yyerror ("Bad register or values for LOOP"); - } - break; - - case 214: -#line 3406 "bfin-parse.y" - { - notethat ("pseudoDEBUG: DBG\n"); - (yyval.instr) = bfin_gen_pseudodbg (3, 7, 0); - } - break; - - case 215: -#line 3411 "bfin-parse.y" - { - notethat ("pseudoDEBUG: DBG REG_A\n"); - (yyval.instr) = bfin_gen_pseudodbg (3, IS_A1 ((yyvsp[0].reg)), 0); - } - break; - - case 216: -#line 3416 "bfin-parse.y" - { - notethat ("pseudoDEBUG: DBG allregs\n"); - (yyval.instr) = bfin_gen_pseudodbg (0, (yyvsp[0].reg).regno & CODE_MASK, (yyvsp[0].reg).regno & CLASS_MASK); - } - break; - - case 217: -#line 3422 "bfin-parse.y" - { - if (!IS_DREG ((yyvsp[-1].reg))) - return yyerror ("Dregs expected"); - notethat ("pseudoDEBUG: DBGCMPLX (dregs )\n"); - (yyval.instr) = bfin_gen_pseudodbg (3, 6, (yyvsp[-1].reg).regno & CODE_MASK); - } - break; - - case 218: -#line 3430 "bfin-parse.y" - { - notethat ("psedoDEBUG: DBGHALT\n"); - (yyval.instr) = bfin_gen_pseudodbg (3, 5, 0); - } - break; - - case 219: -#line 3436 "bfin-parse.y" - { - notethat ("pseudodbg_assert: DBGA (dregs_lo , uimm16 )\n"); - (yyval.instr) = bfin_gen_pseudodbg_assert (IS_H ((yyvsp[-3].reg)), &(yyvsp[-3].reg), uimm16 ((yyvsp[-1].expr))); - } - break; - - case 220: -#line 3442 "bfin-parse.y" - { - notethat ("pseudodbg_assert: DBGAH (dregs , uimm16 )\n"); - (yyval.instr) = bfin_gen_pseudodbg_assert (3, &(yyvsp[-3].reg), uimm16 ((yyvsp[-1].expr))); - } - break; - - case 221: -#line 3448 "bfin-parse.y" - { - notethat ("psedodbg_assert: DBGAL (dregs , uimm16 )\n"); - (yyval.instr) = bfin_gen_pseudodbg_assert (2, &(yyvsp[-3].reg), uimm16 ((yyvsp[-1].expr))); - } - break; - - case 222: -#line 3461 "bfin-parse.y" - { - (yyval.reg) = (yyvsp[0].reg); - } - break; - - case 223: -#line 3465 "bfin-parse.y" - { - (yyval.reg) = (yyvsp[0].reg); - } - break; - - case 224: -#line 3474 "bfin-parse.y" - { - (yyval.mod).MM = 0; - (yyval.mod).mod = 0; - } - break; - - case 225: -#line 3479 "bfin-parse.y" - { - (yyval.mod).MM = 1; - (yyval.mod).mod = (yyvsp[-1].value); - } - break; - - case 226: -#line 3484 "bfin-parse.y" - { - (yyval.mod).MM = 1; - (yyval.mod).mod = (yyvsp[-3].value); - } - break; - - case 227: -#line 3489 "bfin-parse.y" - { - (yyval.mod).MM = 0; - (yyval.mod).mod = (yyvsp[-1].value); - } - break; - - case 228: -#line 3494 "bfin-parse.y" - { - (yyval.mod).MM = 1; - (yyval.mod).mod = 0; - } - break; - - case 229: -#line 3501 "bfin-parse.y" - { - (yyval.r0).r0 = 1; - } - break; - - case 230: -#line 3505 "bfin-parse.y" - { - (yyval.r0).r0 = 0; - } - break; - - case 231: -#line 3511 "bfin-parse.y" - { - (yyval.modcodes).s0 = 0; - (yyval.modcodes).x0 = 0; - } - break; - - case 232: -#line 3516 "bfin-parse.y" - { - (yyval.modcodes).s0 = 1; - (yyval.modcodes).x0 = 0; - } - break; - - case 233: -#line 3521 "bfin-parse.y" - { - (yyval.modcodes).s0 = 0; - (yyval.modcodes).x0 = 1; - } - break; - - case 234: -#line 3526 "bfin-parse.y" - { - (yyval.modcodes).s0 = 1; - (yyval.modcodes).x0 = 1; - } - break; - - case 235: -#line 3534 "bfin-parse.y" - { - (yyval.r0).r0 = 1; - } - break; - - case 236: -#line 3538 "bfin-parse.y" - { - (yyval.r0).r0 = 0; - } - break; - - case 237: -#line 3544 "bfin-parse.y" - { - (yyval.modcodes).s0 = 0; - (yyval.modcodes).x0 = 0; - } - break; - - case 238: -#line 3549 "bfin-parse.y" - { - (yyval.modcodes).s0 = (yyvsp[-1].modcodes).s0; - (yyval.modcodes).x0 = (yyvsp[-1].modcodes).x0; - } - break; - - case 239: -#line 3556 "bfin-parse.y" - { - (yyval.modcodes).s0 = 0; - (yyval.modcodes).x0 = 0; - (yyval.modcodes).aop = 0; - } - break; - - case 240: -#line 3562 "bfin-parse.y" - { - (yyval.modcodes).s0 = 0; - (yyval.modcodes).x0 = 0; - (yyval.modcodes).aop = 1; - } - break; - - case 241: -#line 3568 "bfin-parse.y" - { - (yyval.modcodes).s0 = 1; - (yyval.modcodes).x0 = 0; - (yyval.modcodes).aop = 1; - } - break; - - case 242: -#line 3576 "bfin-parse.y" - { - (yyval.modcodes).r0 = 0; - (yyval.modcodes).s0 = 0; - (yyval.modcodes).x0 = 0; - } - break; - - case 243: -#line 3582 "bfin-parse.y" - { - (yyval.modcodes).r0 = 2 + (yyvsp[-1].r0).r0; - (yyval.modcodes).s0 = 0; - (yyval.modcodes).x0 = 0; - } - break; - - case 244: -#line 3588 "bfin-parse.y" - { - (yyval.modcodes).r0 = 0; - (yyval.modcodes).s0 = (yyvsp[-1].modcodes).s0; - (yyval.modcodes).x0 = (yyvsp[-1].modcodes).x0; - } - break; - - case 245: -#line 3594 "bfin-parse.y" - { - (yyval.modcodes).r0 = 2 + (yyvsp[-3].r0).r0; - (yyval.modcodes).s0 = (yyvsp[-1].modcodes).s0; - (yyval.modcodes).x0 = (yyvsp[-1].modcodes).x0; - } - break; - - case 246: -#line 3600 "bfin-parse.y" - { - (yyval.modcodes).r0 = 2 + (yyvsp[-1].r0).r0; - (yyval.modcodes).s0 = (yyvsp[-3].modcodes).s0; - (yyval.modcodes).x0 = (yyvsp[-3].modcodes).x0; - } - break; - - case 247: -#line 3608 "bfin-parse.y" - { - (yyval.r0).r0 = 0; - } - break; - - case 248: -#line 3612 "bfin-parse.y" - { - (yyval.r0).r0 = 0; - } - break; - - case 249: -#line 3616 "bfin-parse.y" - { - (yyval.r0).r0 = 1; - } - break; - - case 250: -#line 3622 "bfin-parse.y" - { - (yyval.r0).r0 = 0; - } - break; - - case 251: -#line 3626 "bfin-parse.y" - { - (yyval.r0).r0 = 0; - } - break; - - case 252: -#line 3630 "bfin-parse.y" - { - (yyval.r0).r0 = 1; - } - break; - - case 253: -#line 3636 "bfin-parse.y" - { - (yyval.modcodes).r0 = 0; - (yyval.modcodes).s0 = 0; - (yyval.modcodes).aop = 0; - } - break; - - case 254: -#line 3642 "bfin-parse.y" - { - (yyval.modcodes).r0 = 0; - (yyval.modcodes).s0 = 0; - (yyval.modcodes).aop = 3; - } - break; - - case 255: -#line 3648 "bfin-parse.y" - { - (yyval.modcodes).r0 = 0; - (yyval.modcodes).s0 = 1; - (yyval.modcodes).aop = 3; - } - break; - - case 256: -#line 3654 "bfin-parse.y" - { - (yyval.modcodes).r0 = 1; - (yyval.modcodes).s0 = 0; - (yyval.modcodes).aop = 3; - } - break; - - case 257: -#line 3660 "bfin-parse.y" - { - (yyval.modcodes).r0 = 1; - (yyval.modcodes).s0 = 1; - } - break; - - case 258: -#line 3665 "bfin-parse.y" - { - (yyval.modcodes).r0 = 1; - (yyval.modcodes).s0 = 1; - } - break; - - case 259: -#line 3672 "bfin-parse.y" - { - (yyval.r0).r0 = 0; - } - break; - - case 260: -#line 3676 "bfin-parse.y" - { - (yyval.r0).r0 = 1; - } - break; - - case 261: -#line 3682 "bfin-parse.y" - { - (yyval.modcodes).s0 = 0; - } - break; - - case 262: -#line 3686 "bfin-parse.y" - { - (yyval.modcodes).s0 = 1; - } - break; - - case 263: -#line 3693 "bfin-parse.y" - { - (yyval.r0).r0 = 1; - } - break; - - case 264: -#line 3697 "bfin-parse.y" - { - (yyval.r0).r0 = 0; - } - break; - - case 265: -#line 3701 "bfin-parse.y" - { - (yyval.r0).r0 = 3; - } - break; - - case 266: -#line 3705 "bfin-parse.y" - { - (yyval.r0).r0 = 2; - } - break; - - case 267: -#line 3711 "bfin-parse.y" - { - (yyval.r0).r0 = 0; - } - break; - - case 268: -#line 3715 "bfin-parse.y" - { - (yyval.r0).r0 = 1; - } - break; - - case 269: -#line 3722 "bfin-parse.y" - { - (yyval.modcodes).r0 = 0; - (yyval.modcodes).s0 = 1; - } - break; - - case 270: -#line 3727 "bfin-parse.y" - { - if ((yyvsp[-1].value) != M_T) - return yyerror ("Bad modifier"); - (yyval.modcodes).r0 = 1; - (yyval.modcodes).s0 = 0; - } - break; - - case 271: -#line 3734 "bfin-parse.y" - { - if ((yyvsp[-3].value) != M_T) - return yyerror ("Bad modifier"); - (yyval.modcodes).r0 = 1; - (yyval.modcodes).s0 = 1; - } - break; - - case 272: -#line 3741 "bfin-parse.y" - { - if ((yyvsp[-1].value) != M_T) - return yyerror ("Bad modifier"); - (yyval.modcodes).r0 = 1; - (yyval.modcodes).s0 = 1; - } - break; - - case 273: -#line 3753 "bfin-parse.y" - { - (yyval.r0).r0 = 0; - } - break; - - case 274: -#line 3757 "bfin-parse.y" - { - (yyval.r0).r0 = 1; - } - break; - - case 275: -#line 3761 "bfin-parse.y" - { - (yyval.r0).r0 = 2; - } - break; - - case 276: -#line 3767 "bfin-parse.y" - { - (yyval.r0).r0 = 0; - } - break; - - case 277: -#line 3771 "bfin-parse.y" - { - if ((yyvsp[-1].value) == M_W32) - (yyval.r0).r0 = 1; - else - return yyerror ("Only (W32) allowed"); - } - break; - - case 278: -#line 3780 "bfin-parse.y" - { - (yyval.r0).r0 = 1; - } - break; - - case 279: -#line 3784 "bfin-parse.y" - { - if ((yyvsp[-1].value) == M_IU) - (yyval.r0).r0 = 3; - else - return yyerror ("(IU) expected"); - } - break; - - case 280: -#line 3793 "bfin-parse.y" - { - (yyval.reg) = (yyvsp[-1].reg); - } - break; - - case 281: -#line 3799 "bfin-parse.y" - { - (yyval.reg) = (yyvsp[-2].reg); - } - break; - - case 282: -#line 3808 "bfin-parse.y" - { - (yyval.r0).r0 = 1; - } - break; - - case 283: -#line 3812 "bfin-parse.y" - { - (yyval.r0).r0 = 0; - } - break; - - case 284: -#line 3819 "bfin-parse.y" - { - (yyval.r0).r0 = 0; - } - break; - - case 285: -#line 3823 "bfin-parse.y" - { - (yyval.r0).r0 = 1; - } - break; - - case 286: -#line 3827 "bfin-parse.y" - { - (yyval.r0).r0 = 2; - } - break; - - case 287: -#line 3831 "bfin-parse.y" - { - (yyval.r0).r0 = 3; - } - break; - - case 288: -#line 3838 "bfin-parse.y" - { - (yyval.r0).r0 = 0; - } - break; - - case 289: -#line 3842 "bfin-parse.y" - { - (yyval.r0).r0 = 1; - } - break; - - case 290: -#line 3849 "bfin-parse.y" - { - (yyval.modcodes).r0 = 1; /* HL. */ - (yyval.modcodes).s0 = 0; /* s. */ - (yyval.modcodes).x0 = 0; /* x. */ - (yyval.modcodes).aop = 0; /* aop. */ - } - break; - - case 291: -#line 3857 "bfin-parse.y" - { - (yyval.modcodes).r0 = 1; /* HL. */ - (yyval.modcodes).s0 = 0; /* s. */ - (yyval.modcodes).x0 = 0; /* x. */ - (yyval.modcodes).aop = 1; /* aop. */ - } - break; - - case 292: -#line 3865 "bfin-parse.y" - { - (yyval.modcodes).r0 = 0; /* HL. */ - (yyval.modcodes).s0 = 0; /* s. */ - (yyval.modcodes).x0 = 0; /* x. */ - (yyval.modcodes).aop = 0; /* aop. */ - } - break; - - case 293: -#line 3873 "bfin-parse.y" - { - (yyval.modcodes).r0 = 0; /* HL. */ - (yyval.modcodes).s0 = 0; /* s. */ - (yyval.modcodes).x0 = 0; /* x. */ - (yyval.modcodes).aop = 1; - } - break; - - case 294: -#line 3881 "bfin-parse.y" - { - (yyval.modcodes).r0 = 1; /* HL. */ - (yyval.modcodes).s0 = 1; /* s. */ - (yyval.modcodes).x0 = 0; /* x. */ - (yyval.modcodes).aop = 0; /* aop. */ - } - break; - - case 295: -#line 3888 "bfin-parse.y" - { - (yyval.modcodes).r0 = 1; /* HL. */ - (yyval.modcodes).s0 = 1; /* s. */ - (yyval.modcodes).x0 = 0; /* x. */ - (yyval.modcodes).aop = 1; /* aop. */ - } - break; - - case 296: -#line 3895 "bfin-parse.y" - { - (yyval.modcodes).r0 = 0; /* HL. */ - (yyval.modcodes).s0 = 1; /* s. */ - (yyval.modcodes).x0 = 0; /* x. */ - (yyval.modcodes).aop = 0; /* aop. */ - } - break; - - case 297: -#line 3903 "bfin-parse.y" - { - (yyval.modcodes).r0 = 0; /* HL. */ - (yyval.modcodes).s0 = 1; /* s. */ - (yyval.modcodes).x0 = 0; /* x. */ - (yyval.modcodes).aop = 1; /* aop. */ - } - break; - - case 298: -#line 3913 "bfin-parse.y" - { - (yyval.modcodes).s0 = 0; /* s. */ - (yyval.modcodes).x0 = 0; /* HL. */ - } - break; - - case 299: -#line 3918 "bfin-parse.y" - { - (yyval.modcodes).s0 = 0; /* s. */ - (yyval.modcodes).x0 = 1; /* HL. */ - } - break; - - case 300: -#line 3923 "bfin-parse.y" - { - (yyval.modcodes).s0 = 1; /* s. */ - (yyval.modcodes).x0 = 0; /* HL. */ - } - break; - - case 301: -#line 3928 "bfin-parse.y" - { - (yyval.modcodes).s0 = 1; /* s. */ - (yyval.modcodes).x0 = 1; /* HL. */ - } - break; - - case 302: -#line 3935 "bfin-parse.y" - { - (yyval.modcodes).x0 = 2; - } - break; - - case 303: -#line 3939 "bfin-parse.y" - { - (yyval.modcodes).x0 = 0; - } - break; - - case 304: -#line 3943 "bfin-parse.y" - { - (yyval.modcodes).x0 = 1; - } - break; - - case 305: -#line 3952 "bfin-parse.y" - { - (yyval.reg) = (yyvsp[-1].reg); - } - break; - - case 306: -#line 3959 "bfin-parse.y" - { - (yyval.reg) = (yyvsp[-1].reg); - } - break; - - case 307: -#line 3966 "bfin-parse.y" - { - (yyval.reg) = (yyvsp[-1].reg); - } - break; - - case 308: -#line 3973 "bfin-parse.y" - { - (yyval.macfunc).w = 1; - (yyval.macfunc).P = 1; - (yyval.macfunc).n = IS_A1 ((yyvsp[0].reg)); - (yyval.macfunc).op = 3; - (yyval.macfunc).dst = (yyvsp[-2].reg); - (yyval.macfunc).s0.regno = 0; - (yyval.macfunc).s1.regno = 0; - - if (IS_A1 ((yyvsp[0].reg)) && IS_EVEN ((yyvsp[-2].reg))) - return yyerror ("Cannot move A1 to even register"); - else if (!IS_A1 ((yyvsp[0].reg)) && !IS_EVEN ((yyvsp[-2].reg))) - return yyerror ("Cannot move A0 to odd register"); - } - break; - - case 309: -#line 3988 "bfin-parse.y" - { - (yyval.macfunc) = (yyvsp[0].macfunc); - (yyval.macfunc).w = 0; (yyval.macfunc).P = 0; - (yyval.macfunc).dst.regno = 0; - } - break; - - case 310: -#line 3994 "bfin-parse.y" - { - (yyval.macfunc) = (yyvsp[-1].macfunc); - (yyval.macfunc).w = 1; - (yyval.macfunc).P = 1; - (yyval.macfunc).dst = (yyvsp[-4].reg); - } - break; - - case 311: -#line 4002 "bfin-parse.y" - { - (yyval.macfunc) = (yyvsp[-1].macfunc); - (yyval.macfunc).w = 1; - (yyval.macfunc).P = 0; - (yyval.macfunc).dst = (yyvsp[-4].reg); - } - break; - - case 312: -#line 4010 "bfin-parse.y" - { - (yyval.macfunc).w = 1; - (yyval.macfunc).P = 0; - (yyval.macfunc).n = IS_A1 ((yyvsp[0].reg)); - (yyval.macfunc).op = 3; - (yyval.macfunc).dst = (yyvsp[-2].reg); - (yyval.macfunc).s0.regno = 0; - (yyval.macfunc).s1.regno = 0; - - if (IS_A1 ((yyvsp[0].reg)) && !IS_H ((yyvsp[-2].reg))) - return yyerror ("Cannot move A1 to low half of register"); - else if (!IS_A1 ((yyvsp[0].reg)) && IS_H ((yyvsp[-2].reg))) - return yyerror ("Cannot move A0 to high half of register"); - } - break; - - case 313: -#line 4028 "bfin-parse.y" - { - (yyval.macfunc).n = IS_A1 ((yyvsp[-1].reg)); - (yyval.macfunc).op = 0; - (yyval.macfunc).s0 = (yyvsp[0].macfunc).s0; - (yyval.macfunc).s1 = (yyvsp[0].macfunc).s1; - } - break; - - case 314: -#line 4035 "bfin-parse.y" - { - (yyval.macfunc).n = IS_A1 ((yyvsp[-1].reg)); - (yyval.macfunc).op = 1; - (yyval.macfunc).s0 = (yyvsp[0].macfunc).s0; - (yyval.macfunc).s1 = (yyvsp[0].macfunc).s1; - } - break; - - case 315: -#line 4042 "bfin-parse.y" - { - (yyval.macfunc).n = IS_A1 ((yyvsp[-1].reg)); - (yyval.macfunc).op = 2; - (yyval.macfunc).s0 = (yyvsp[0].macfunc).s0; - (yyval.macfunc).s1 = (yyvsp[0].macfunc).s1; - } - break; - - case 316: -#line 4052 "bfin-parse.y" - { - if (IS_DREG ((yyvsp[-2].reg)) && IS_DREG ((yyvsp[0].reg))) - { - (yyval.macfunc).s0 = (yyvsp[-2].reg); - (yyval.macfunc).s1 = (yyvsp[0].reg); - } - else - return yyerror ("Dregs expected"); - } - break; - - case 317: -#line 4065 "bfin-parse.y" - { - (yyval.r0).r0 = 0; - } - break; - - case 318: -#line 4069 "bfin-parse.y" - { - (yyval.r0).r0 = 1; - } - break; - - case 319: -#line 4073 "bfin-parse.y" - { - (yyval.r0).r0 = 2; - } - break; - - case 320: -#line 4077 "bfin-parse.y" - { - (yyval.r0).r0 = 3; - } - break; - - case 321: -#line 4084 "bfin-parse.y" - { - (yyval.modcodes).r0 = (yyvsp[0].reg).regno; - (yyval.modcodes).x0 = (yyvsp[-1].r0).r0; - (yyval.modcodes).s0 = 0; - } - break; - - case 322: -#line 4090 "bfin-parse.y" - { - (yyval.modcodes).r0 = 0x18; - (yyval.modcodes).x0 = (yyvsp[-1].r0).r0; - (yyval.modcodes).s0 = 0; - } - break; - - case 323: -#line 4096 "bfin-parse.y" - { - (yyval.modcodes).r0 = (yyvsp[-2].reg).regno; - (yyval.modcodes).x0 = (yyvsp[-1].r0).r0; - (yyval.modcodes).s0 = 1; - } - break; - - case 324: -#line 4102 "bfin-parse.y" - { - (yyval.modcodes).r0 = 0x18; - (yyval.modcodes).x0 = (yyvsp[-1].r0).r0; - (yyval.modcodes).s0 = 1; - } - break; - - case 325: -#line 4112 "bfin-parse.y" - { - Expr_Node_Value val; - val.s_value = S_GET_NAME((yyvsp[0].symbol)); - (yyval.expr) = Expr_Node_Create (Expr_Node_Reloc, val, NULL, NULL); - } - break; - - case 326: -#line 4121 "bfin-parse.y" - { (yyval.value) = BFD_RELOC_BFIN_GOT; } - break; - - case 327: -#line 4123 "bfin-parse.y" - { (yyval.value) = BFD_RELOC_BFIN_GOT17M4; } - break; - - case 328: -#line 4125 "bfin-parse.y" - { (yyval.value) = BFD_RELOC_BFIN_FUNCDESC_GOT17M4; } - break; - - case 329: -#line 4129 "bfin-parse.y" - { - Expr_Node_Value val; - val.i_value = (yyvsp[0].value); - (yyval.expr) = Expr_Node_Create (Expr_Node_GOT_Reloc, val, (yyvsp[-2].expr), NULL); - } - break; - - case 330: -#line 4137 "bfin-parse.y" - { - (yyval.expr) = (yyvsp[0].expr); - } - break; - - case 331: -#line 4141 "bfin-parse.y" - { - (yyval.expr) = (yyvsp[0].expr); - } - break; - - case 332: -#line 4148 "bfin-parse.y" - { - (yyval.expr) = (yyvsp[-2].expr); - } - break; - - case 333: -#line 4154 "bfin-parse.y" - { - Expr_Node_Value val; - val.i_value = (yyvsp[0].value); - (yyval.expr) = Expr_Node_Create (Expr_Node_Constant, val, NULL, NULL); - } - break; - - case 334: -#line 4160 "bfin-parse.y" - { - (yyval.expr) = (yyvsp[0].expr); - } - break; - - case 335: -#line 4164 "bfin-parse.y" - { - (yyval.expr) = (yyvsp[-1].expr); - } - break; - - case 336: -#line 4168 "bfin-parse.y" - { - (yyval.expr) = unary (Expr_Op_Type_COMP, (yyvsp[0].expr)); - } - break; - - case 337: -#line 4172 "bfin-parse.y" - { - (yyval.expr) = unary (Expr_Op_Type_NEG, (yyvsp[0].expr)); - } - break; - - case 338: -#line 4178 "bfin-parse.y" - { - (yyval.expr) = (yyvsp[0].expr); - } - break; - - case 339: -#line 4184 "bfin-parse.y" - { - (yyval.expr) = binary (Expr_Op_Type_Mult, (yyvsp[-2].expr), (yyvsp[0].expr)); - } - break; - - case 340: -#line 4188 "bfin-parse.y" - { - (yyval.expr) = binary (Expr_Op_Type_Div, (yyvsp[-2].expr), (yyvsp[0].expr)); - } - break; - - case 341: -#line 4192 "bfin-parse.y" - { - (yyval.expr) = binary (Expr_Op_Type_Mod, (yyvsp[-2].expr), (yyvsp[0].expr)); - } - break; - - case 342: -#line 4196 "bfin-parse.y" - { - (yyval.expr) = binary (Expr_Op_Type_Add, (yyvsp[-2].expr), (yyvsp[0].expr)); - } - break; - - case 343: -#line 4200 "bfin-parse.y" - { - (yyval.expr) = binary (Expr_Op_Type_Sub, (yyvsp[-2].expr), (yyvsp[0].expr)); - } - break; - - case 344: -#line 4204 "bfin-parse.y" - { - (yyval.expr) = binary (Expr_Op_Type_Lshift, (yyvsp[-2].expr), (yyvsp[0].expr)); - } - break; - - case 345: -#line 4208 "bfin-parse.y" - { - (yyval.expr) = binary (Expr_Op_Type_Rshift, (yyvsp[-2].expr), (yyvsp[0].expr)); - } - break; - - case 346: -#line 4212 "bfin-parse.y" - { - (yyval.expr) = binary (Expr_Op_Type_BAND, (yyvsp[-2].expr), (yyvsp[0].expr)); - } - break; - - case 347: -#line 4216 "bfin-parse.y" - { - (yyval.expr) = binary (Expr_Op_Type_LOR, (yyvsp[-2].expr), (yyvsp[0].expr)); - } - break; - - case 348: -#line 4220 "bfin-parse.y" - { - (yyval.expr) = binary (Expr_Op_Type_BOR, (yyvsp[-2].expr), (yyvsp[0].expr)); - } - break; - - case 349: -#line 4224 "bfin-parse.y" - { - (yyval.expr) = (yyvsp[0].expr); - } - break; - - - default: break; - } - -/* Line 1126 of yacc.c. */ -#line 7065 "bfin-parse.c" - - yyvsp -= yylen; - yyssp -= yylen; - - - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - char *yymsg = 0; -# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -#if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -#endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - - if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yymsg; - int yyi = 0; - while ((*yyp = *yyf)) - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - { - yyerror (YY_("syntax error")); - goto yyexhaustedlab; - } - } - else -#endif /* YYERROR_VERBOSE */ - yyerror (YY_("syntax error")); - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (0) - goto yyerrorlab; - -yyvsp -= yylen; - yyssp -= yylen; - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK; - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK; - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif - return yyresult; -} - - -#line 4230 "bfin-parse.y" - - -EXPR_T -mkexpr (int x, SYMBOL_T s) -{ - EXPR_T e = (EXPR_T) ALLOCATE (sizeof (struct expression_cell)); - e->value = x; - EXPR_SYMBOL(e) = s; - return e; -} - -static int -value_match (Expr_Node *expr, int sz, int sign, int mul, int issigned) -{ - long umax = (1L << sz) - 1; - long min = -1L << (sz - 1); - long max = (1L << (sz - 1)) - 1; - - long v = EXPR_VALUE (expr); - - if ((v % mul) != 0) - { - error ("%s:%d: Value Error -- Must align to %d\n", __FILE__, __LINE__, mul); - return 0; - } - - v /= mul; - - if (sign) - v = -v; - - if (issigned) - { - if (v >= min && v <= max) return 1; - -#ifdef DEBUG - fprintf(stderr, "signed value %lx out of range\n", v * mul); -#endif - return 0; - } - if (v <= umax && v >= 0) - return 1; -#ifdef DEBUG - fprintf(stderr, "unsigned value %lx out of range\n", v * mul); -#endif - return 0; -} - -/* Return the expression structure that allows symbol operations. - If the left and right children are constants, do the operation. */ -static Expr_Node * -binary (Expr_Op_Type op, Expr_Node *x, Expr_Node *y) -{ - if (x->type == Expr_Node_Constant && y->type == Expr_Node_Constant) - { - switch (op) - { - case Expr_Op_Type_Add: - x->value.i_value += y->value.i_value; - break; - case Expr_Op_Type_Sub: - x->value.i_value -= y->value.i_value; - break; - case Expr_Op_Type_Mult: - x->value.i_value *= y->value.i_value; - break; - case Expr_Op_Type_Div: - if (y->value.i_value == 0) - error ("Illegal Expression: Division by zero."); - else - x->value.i_value /= y->value.i_value; - break; - case Expr_Op_Type_Mod: - x->value.i_value %= y->value.i_value; - break; - case Expr_Op_Type_Lshift: - x->value.i_value <<= y->value.i_value; - break; - case Expr_Op_Type_Rshift: - x->value.i_value >>= y->value.i_value; - break; - case Expr_Op_Type_BAND: - x->value.i_value &= y->value.i_value; - break; - case Expr_Op_Type_BOR: - x->value.i_value |= y->value.i_value; - break; - case Expr_Op_Type_BXOR: - x->value.i_value ^= y->value.i_value; - break; - case Expr_Op_Type_LAND: - x->value.i_value = x->value.i_value && y->value.i_value; - break; - case Expr_Op_Type_LOR: - x->value.i_value = x->value.i_value || y->value.i_value; - break; - - default: - error ("%s:%d: Internal compiler error\n", __FILE__, __LINE__); - } - return x; - } - else - { - /* Create a new expression structure. */ - Expr_Node_Value val; - val.op_value = op; - return Expr_Node_Create (Expr_Node_Binop, val, x, y); - } -} - -static Expr_Node * -unary (Expr_Op_Type op, Expr_Node *x) -{ - if (x->type == Expr_Node_Constant) - { - switch (op) - { - case Expr_Op_Type_NEG: - x->value.i_value = -x->value.i_value; - break; - case Expr_Op_Type_COMP: - x->value.i_value = ~x->value.i_value; - break; - default: - error ("%s:%d: Internal compiler error\n", __FILE__, __LINE__); - } - return x; - } - else - { - /* Create a new expression structure. */ - Expr_Node_Value val; - val.op_value = op; - return Expr_Node_Create (Expr_Node_Unop, val, x, NULL); - } -} - -int debug_codeselection = 0; -static void -notethat (char *format, ...) -{ - va_list ap; - va_start (ap, format); - if (debug_codeselection) - { - vfprintf (errorf, format, ap); - } - va_end (ap); -} - -#ifdef TEST -main (int argc, char **argv) -{ - yyparse(); -} -#endif - - diff --git a/gas/bfin-parse.h b/gas/bfin-parse.h deleted file mode 100644 index 06403c81ec0..00000000000 --- a/gas/bfin-parse.h +++ /dev/null @@ -1,406 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.1. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - - 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 2, 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. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - BYTEOP16P = 258, - BYTEOP16M = 259, - BYTEOP1P = 260, - BYTEOP2P = 261, - BYTEOP2M = 262, - BYTEOP3P = 263, - BYTEUNPACK = 264, - BYTEPACK = 265, - PACK = 266, - SAA = 267, - ALIGN8 = 268, - ALIGN16 = 269, - ALIGN24 = 270, - VIT_MAX = 271, - EXTRACT = 272, - DEPOSIT = 273, - EXPADJ = 274, - SEARCH = 275, - ONES = 276, - SIGN = 277, - SIGNBITS = 278, - LINK = 279, - UNLINK = 280, - REG = 281, - PC = 282, - CCREG = 283, - BYTE_DREG = 284, - REG_A_DOUBLE_ZERO = 285, - REG_A_DOUBLE_ONE = 286, - A_ZERO_DOT_L = 287, - A_ZERO_DOT_H = 288, - A_ONE_DOT_L = 289, - A_ONE_DOT_H = 290, - HALF_REG = 291, - NOP = 292, - RTI = 293, - RTS = 294, - RTX = 295, - RTN = 296, - RTE = 297, - HLT = 298, - IDLE = 299, - STI = 300, - CLI = 301, - CSYNC = 302, - SSYNC = 303, - EMUEXCPT = 304, - RAISE = 305, - EXCPT = 306, - LSETUP = 307, - LOOP = 308, - LOOP_BEGIN = 309, - LOOP_END = 310, - DISALGNEXCPT = 311, - JUMP = 312, - JUMP_DOT_S = 313, - JUMP_DOT_L = 314, - CALL = 315, - ABORT = 316, - NOT = 317, - TILDA = 318, - BANG = 319, - AMPERSAND = 320, - BAR = 321, - PERCENT = 322, - CARET = 323, - BXOR = 324, - MINUS = 325, - PLUS = 326, - STAR = 327, - SLASH = 328, - NEG = 329, - MIN = 330, - MAX = 331, - ABS = 332, - DOUBLE_BAR = 333, - _PLUS_BAR_PLUS = 334, - _PLUS_BAR_MINUS = 335, - _MINUS_BAR_PLUS = 336, - _MINUS_BAR_MINUS = 337, - _MINUS_MINUS = 338, - _PLUS_PLUS = 339, - SHIFT = 340, - LSHIFT = 341, - ASHIFT = 342, - BXORSHIFT = 343, - _GREATER_GREATER_GREATER_THAN_ASSIGN = 344, - ROT = 345, - LESS_LESS = 346, - GREATER_GREATER = 347, - _GREATER_GREATER_GREATER = 348, - _LESS_LESS_ASSIGN = 349, - _GREATER_GREATER_ASSIGN = 350, - DIVS = 351, - DIVQ = 352, - ASSIGN = 353, - _STAR_ASSIGN = 354, - _BAR_ASSIGN = 355, - _CARET_ASSIGN = 356, - _AMPERSAND_ASSIGN = 357, - _MINUS_ASSIGN = 358, - _PLUS_ASSIGN = 359, - _ASSIGN_BANG = 360, - _LESS_THAN_ASSIGN = 361, - _ASSIGN_ASSIGN = 362, - GE = 363, - LT = 364, - LE = 365, - GT = 366, - LESS_THAN = 367, - FLUSHINV = 368, - FLUSH = 369, - IFLUSH = 370, - PREFETCH = 371, - PRNT = 372, - OUTC = 373, - WHATREG = 374, - TESTSET = 375, - ASL = 376, - ASR = 377, - B = 378, - W = 379, - NS = 380, - S = 381, - CO = 382, - SCO = 383, - TH = 384, - TL = 385, - BP = 386, - BREV = 387, - X = 388, - Z = 389, - M = 390, - MMOD = 391, - R = 392, - RND = 393, - RNDL = 394, - RNDH = 395, - RND12 = 396, - RND20 = 397, - V = 398, - LO = 399, - HI = 400, - BITTGL = 401, - BITCLR = 402, - BITSET = 403, - BITTST = 404, - BITMUX = 405, - DBGAL = 406, - DBGAH = 407, - DBGHALT = 408, - DBG = 409, - DBGA = 410, - DBGCMPLX = 411, - IF = 412, - COMMA = 413, - BY = 414, - COLON = 415, - SEMICOLON = 416, - RPAREN = 417, - LPAREN = 418, - LBRACK = 419, - RBRACK = 420, - STATUS_REG = 421, - MNOP = 422, - SYMBOL = 423, - NUMBER = 424, - GOT = 425, - GOT17M4 = 426, - FUNCDESC_GOT17M4 = 427, - AT = 428, - PLTPC = 429 - }; -#endif -/* Tokens. */ -#define BYTEOP16P 258 -#define BYTEOP16M 259 -#define BYTEOP1P 260 -#define BYTEOP2P 261 -#define BYTEOP2M 262 -#define BYTEOP3P 263 -#define BYTEUNPACK 264 -#define BYTEPACK 265 -#define PACK 266 -#define SAA 267 -#define ALIGN8 268 -#define ALIGN16 269 -#define ALIGN24 270 -#define VIT_MAX 271 -#define EXTRACT 272 -#define DEPOSIT 273 -#define EXPADJ 274 -#define SEARCH 275 -#define ONES 276 -#define SIGN 277 -#define SIGNBITS 278 -#define LINK 279 -#define UNLINK 280 -#define REG 281 -#define PC 282 -#define CCREG 283 -#define BYTE_DREG 284 -#define REG_A_DOUBLE_ZERO 285 -#define REG_A_DOUBLE_ONE 286 -#define A_ZERO_DOT_L 287 -#define A_ZERO_DOT_H 288 -#define A_ONE_DOT_L 289 -#define A_ONE_DOT_H 290 -#define HALF_REG 291 -#define NOP 292 -#define RTI 293 -#define RTS 294 -#define RTX 295 -#define RTN 296 -#define RTE 297 -#define HLT 298 -#define IDLE 299 -#define STI 300 -#define CLI 301 -#define CSYNC 302 -#define SSYNC 303 -#define EMUEXCPT 304 -#define RAISE 305 -#define EXCPT 306 -#define LSETUP 307 -#define LOOP 308 -#define LOOP_BEGIN 309 -#define LOOP_END 310 -#define DISALGNEXCPT 311 -#define JUMP 312 -#define JUMP_DOT_S 313 -#define JUMP_DOT_L 314 -#define CALL 315 -#define ABORT 316 -#define NOT 317 -#define TILDA 318 -#define BANG 319 -#define AMPERSAND 320 -#define BAR 321 -#define PERCENT 322 -#define CARET 323 -#define BXOR 324 -#define MINUS 325 -#define PLUS 326 -#define STAR 327 -#define SLASH 328 -#define NEG 329 -#define MIN 330 -#define MAX 331 -#define ABS 332 -#define DOUBLE_BAR 333 -#define _PLUS_BAR_PLUS 334 -#define _PLUS_BAR_MINUS 335 -#define _MINUS_BAR_PLUS 336 -#define _MINUS_BAR_MINUS 337 -#define _MINUS_MINUS 338 -#define _PLUS_PLUS 339 -#define SHIFT 340 -#define LSHIFT 341 -#define ASHIFT 342 -#define BXORSHIFT 343 -#define _GREATER_GREATER_GREATER_THAN_ASSIGN 344 -#define ROT 345 -#define LESS_LESS 346 -#define GREATER_GREATER 347 -#define _GREATER_GREATER_GREATER 348 -#define _LESS_LESS_ASSIGN 349 -#define _GREATER_GREATER_ASSIGN 350 -#define DIVS 351 -#define DIVQ 352 -#define ASSIGN 353 -#define _STAR_ASSIGN 354 -#define _BAR_ASSIGN 355 -#define _CARET_ASSIGN 356 -#define _AMPERSAND_ASSIGN 357 -#define _MINUS_ASSIGN 358 -#define _PLUS_ASSIGN 359 -#define _ASSIGN_BANG 360 -#define _LESS_THAN_ASSIGN 361 -#define _ASSIGN_ASSIGN 362 -#define GE 363 -#define LT 364 -#define LE 365 -#define GT 366 -#define LESS_THAN 367 -#define FLUSHINV 368 -#define FLUSH 369 -#define IFLUSH 370 -#define PREFETCH 371 -#define PRNT 372 -#define OUTC 373 -#define WHATREG 374 -#define TESTSET 375 -#define ASL 376 -#define ASR 377 -#define B 378 -#define W 379 -#define NS 380 -#define S 381 -#define CO 382 -#define SCO 383 -#define TH 384 -#define TL 385 -#define BP 386 -#define BREV 387 -#define X 388 -#define Z 389 -#define M 390 -#define MMOD 391 -#define R 392 -#define RND 393 -#define RNDL 394 -#define RNDH 395 -#define RND12 396 -#define RND20 397 -#define V 398 -#define LO 399 -#define HI 400 -#define BITTGL 401 -#define BITCLR 402 -#define BITSET 403 -#define BITTST 404 -#define BITMUX 405 -#define DBGAL 406 -#define DBGAH 407 -#define DBGHALT 408 -#define DBG 409 -#define DBGA 410 -#define DBGCMPLX 411 -#define IF 412 -#define COMMA 413 -#define BY 414 -#define COLON 415 -#define SEMICOLON 416 -#define RPAREN 417 -#define LPAREN 418 -#define LBRACK 419 -#define RBRACK 420 -#define STATUS_REG 421 -#define MNOP 422 -#define SYMBOL 423 -#define NUMBER 424 -#define GOT 425 -#define GOT17M4 426 -#define FUNCDESC_GOT17M4 427 -#define AT 428 -#define PLTPC 429 - - - - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 366 "bfin-parse.y" -typedef union YYSTYPE { - INSTR_T instr; - Expr_Node *expr; - SYMBOL_T symbol; - long value; - Register reg; - Macfunc macfunc; - struct { int r0; int s0; int x0; int aop; } modcodes; - struct { int r0; } r0; - Opt_mode mod; -} YYSTYPE; -/* Line 1447 of yacc.c. */ -#line 398 "bfin-parse.h" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE yylval; - - - diff --git a/gas/cgen.c b/gas/cgen.c index 363c05e5318..5b0694b03e2 100644 --- a/gas/cgen.c +++ b/gas/cgen.c @@ -1,6 +1,6 @@ /* GAS interface for targets using CGEN: Cpu tools GENerator. - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -19,16 +19,34 @@ Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #include -#include "ansidecl.h" -#include "libiberty.h" -#include "bfd.h" +#include "as.h" #include "symcat.h" #include "cgen-desc.h" -#include "as.h" #include "subsegs.h" #include "cgen.h" #include "dwarf2dbg.h" +#include "symbols.h" +#include "struc-symbol.h" + +#ifdef OBJ_COMPLEX_RELC +static expressionS * make_right_shifted_expr + (expressionS *, const int, const int); + +static unsigned long gas_cgen_encode_addend + (const unsigned long, const unsigned long, const unsigned long, \ + const unsigned long, const unsigned long, const unsigned long, \ + const unsigned long); + +static char * weak_operand_overflow_check + (const expressionS *, const CGEN_OPERAND *); + +static void queue_fixup_recursively + (const int, const int, expressionS *, \ + const CGEN_MAYBE_MULTI_IFLD *, const int, const int); + +static int rightshift = 0; +#endif static void queue_fixup (int, int, expressionS *); /* Opcode table descriptor, must be set by md_begin. */ @@ -66,6 +84,8 @@ struct fixup int opindex; int opinfo; expressionS exp; + struct cgen_maybe_multi_ifield * field; + int msb_field_p; }; static struct fixup fixups[GAS_CGEN_MAX_FIXUPS]; @@ -249,6 +269,8 @@ gas_cgen_record_fixup (frag, where, insn, length, operand, opinfo, symbol, offse + (int) operand->type)); fixP->fx_cgen.insn = insn; fixP->fx_cgen.opinfo = opinfo; + fixP->fx_cgen.field = NULL; + fixP->fx_cgen.msb_field_p = 0; return fixP; } @@ -287,10 +309,26 @@ gas_cgen_record_fixup_exp (frag, where, insn, length, operand, opinfo, exp) + (int) operand->type)); fixP->fx_cgen.insn = insn; fixP->fx_cgen.opinfo = opinfo; + fixP->fx_cgen.field = NULL; + fixP->fx_cgen.msb_field_p = 0; return fixP; } +#ifdef OBJ_COMPLEX_RELC +static symbolS * +expr_build_binary (operatorT op, symbolS * s1, symbolS * s2) +{ + expressionS e; + + e.X_op = op; + e.X_add_symbol = s1; + e.X_op_symbol = s2; + e.X_add_number = 0; + return make_expr_symbol (& e); +} +#endif + /* Used for communication between the next two procedures. */ static jmp_buf expr_jmp_buf; static int expr_jmp_buf_p; @@ -308,7 +346,12 @@ static int expr_jmp_buf_p; const char * gas_cgen_parse_operand (cd, want, strP, opindex, opinfo, resultP, valueP) + +#ifdef OBJ_COMPLEX_RELC + CGEN_CPU_DESC cd; +#else CGEN_CPU_DESC cd ATTRIBUTE_UNUSED; +#endif enum cgen_parse_operand_type want; const char **strP; int opindex; @@ -329,6 +372,13 @@ gas_cgen_parse_operand (cd, want, strP, opindex, opinfo, resultP, valueP) const char *errmsg; expressionS exp; +#ifdef OBJ_COMPLEX_RELC + volatile int signed_p = 0; + symbolS * stmp = NULL; + bfd_reloc_code_real_type reloc_type; + const CGEN_OPERAND * operand; + fixS dummy_fixup; +#endif if (want == CGEN_PARSE_OPERAND_INIT) { gas_cgen_init_parse (); @@ -386,9 +436,82 @@ gas_cgen_parse_operand (cd, want, strP, opindex, opinfo, resultP, valueP) break; de_fault: default: +#ifdef OBJ_COMPLEX_RELC + /* Look up operand, check to see if there's an obvious + overflow (this helps disambiguate some insn parses). */ + operand = cgen_operand_lookup_by_num (cd, opindex); + errmsg = weak_operand_overflow_check (& exp, operand); + + if (! errmsg) + { + /* Fragment the expression as necessary, and queue a reloc. */ + memset (& dummy_fixup, 0, sizeof (fixS)); + + reloc_type = md_cgen_lookup_reloc (0, operand, & dummy_fixup); + + if (exp.X_op == O_symbol + && reloc_type == BFD_RELOC_RELC + && exp.X_add_symbol->sy_value.X_op == O_constant + && exp.X_add_symbol->bsym->section != expr_section + && exp.X_add_symbol->bsym->section != absolute_section + && exp.X_add_symbol->bsym->section != undefined_section) + { + /* Local labels will have been (eagerly) turned into constants + by now, due to the inappropriately deep insight of the + expression parser. Unfortunately make_expr_symbol + prematurely dives into the symbol evaluator, and in this + case it gets a bad answer, so we manually create the + expression symbol we want here. */ + stmp = symbol_create (FAKE_LABEL_NAME, expr_section, 0, + & zero_address_frag); + symbol_set_value_expression (stmp, & exp); + } + else + stmp = make_expr_symbol (& exp); + + /* If this is a pc-relative RELC operand, we + need to subtract "." from the expression. */ + if (reloc_type == BFD_RELOC_RELC + && CGEN_OPERAND_ATTR_VALUE (operand, CGEN_OPERAND_PCREL_ADDR)) + stmp = expr_build_binary (O_subtract, stmp, expr_build_dot ()); + + /* FIXME: this is not a perfect heuristic for figuring out + whether an operand is signed: it only works when the operand + is an immediate. it's not terribly likely that any other + values will be signed relocs, but it's possible. */ + if (operand && (operand->hw_type == HW_H_SINT)) + signed_p = 1; + + if (stmp->bsym && (stmp->bsym->section == expr_section)) + { + if (signed_p) + stmp->bsym->flags |= BSF_SRELC; + else + stmp->bsym->flags |= BSF_RELC; + } + + /* Now package it all up for the fixup emitter. */ + exp.X_op = O_symbol; + exp.X_op_symbol = 0; + exp.X_add_symbol = stmp; + exp.X_add_number = 0; + + /* Re-init rightshift quantity, just in case. */ + rightshift = operand->length; + queue_fixup_recursively (opindex, opinfo_1, & exp, + (reloc_type == BFD_RELOC_RELC) ? + & (operand->index_fields) : 0, + signed_p, -1); + } + * resultP = errmsg + ? CGEN_PARSE_OPERAND_RESULT_ERROR + : CGEN_PARSE_OPERAND_RESULT_QUEUED; + *valueP = 0; +#else queue_fixup (opindex, opinfo_1, &exp); *valueP = 0; *resultP = CGEN_PARSE_OPERAND_RESULT_QUEUED; +#endif break; } @@ -556,6 +679,8 @@ gas_cgen_finish_insn (insn, buf, length, relax_p, result) insn, length, operand, fixups[i].opinfo, &fixups[i].exp); + fixP->fx_cgen.field = fixups[i].field; + fixP->fx_cgen.msb_field_p = fixups[i].msb_field_p; if (result) result->fixups[i] = fixP; } @@ -567,6 +692,167 @@ gas_cgen_finish_insn (insn, buf, length, relax_p, result) } } +#ifdef OBJ_COMPLEX_RELC +/* Queue many fixups, recursively. If the field is a multi-ifield, + repeatedly queue its sub-parts, right shifted to fit into the field (we + assume here multi-fields represent a left-to-right, MSB0-LSB0 + reading). */ + +static void +queue_fixup_recursively (const int opindex, + const int opinfo, + expressionS * expP, + const CGEN_MAYBE_MULTI_IFLD * field, + const int signed_p, + const int part_of_multi) +{ + if (field && field->count) + { + int i; + + for (i = 0; i < field->count; ++ i) + queue_fixup_recursively (opindex, opinfo, expP, + & (field->val.multi[i]), signed_p, i); + } + else + { + expressionS * new_exp = expP; + +#ifdef DEBUG + printf ("queueing fixup for field %s\n", + (field ? field->val.leaf->name : "??")); + print_symbol_value (expP->X_add_symbol); +#endif + if (field && part_of_multi != -1) + { + rightshift -= field->val.leaf->length; + + /* Shift reloc value by number of bits remaining after this + field. */ + if (rightshift) + new_exp = make_right_shifted_expr (expP, rightshift, signed_p); + } + + /* Truncate reloc values to length, *after* leftmost one. */ + fixups[num_fixups].msb_field_p = (part_of_multi <= 0); + fixups[num_fixups].field = (CGEN_MAYBE_MULTI_IFLD *) field; + + queue_fixup (opindex, opinfo, new_exp); + } +} + +/* Encode the self-describing RELC reloc format's addend. */ + +static unsigned long +gas_cgen_encode_addend (const unsigned long start, /* in bits */ + const unsigned long len, /* in bits */ + const unsigned long oplen, /* in bits */ + const unsigned long wordsz, /* in bytes */ + const unsigned long chunksz, /* in bytes */ + const unsigned long signed_p, + const unsigned long trunc_p) +{ + unsigned long res = 0L; + + res |= start & 0x3F; + res |= (oplen & 0x3F) << 6; + res |= (len & 0x3F) << 12; + res |= (wordsz & 0xF) << 18; + res |= (chunksz & 0xF) << 22; + res |= (CGEN_INSN_LSB0_P ? 1 : 0) << 27; + res |= signed_p << 28; + res |= trunc_p << 29; + + return res; +} + +/* Purpose: make a weak check that the expression doesn't overflow the + operand it's to be inserted into. + + Rationale: some insns used to use %operators to disambiguate during a + parse. when these %operators are translated to expressions by the macro + expander, the ambiguity returns. we attempt to disambiguate by field + size. + + Method: check to see if the expression's top node is an O_and operator, + and the mask is larger than the operand length. This would be an + overflow, so signal it by returning an error string. Any other case is + ambiguous, so we assume it's OK and return NULL. */ + +static char * +weak_operand_overflow_check (const expressionS * exp, + const CGEN_OPERAND * operand) +{ + const unsigned long len = operand->length; + unsigned long mask; + unsigned long opmask = (((1L << (len - 1)) - 1) << 1) | 1; + + if (!exp) + return NULL; + + if (exp->X_op != O_bit_and) + { + /* Check for implicit overflow flag. */ + if (CGEN_OPERAND_ATTR_VALUE + (operand, CGEN_OPERAND_RELOC_IMPLIES_OVERFLOW)) + return _("a reloc on this operand implies an overflow"); + return NULL; + } + + mask = exp->X_add_number; + + if (exp->X_add_symbol && + exp->X_add_symbol->sy_value.X_op == O_constant) + mask |= exp->X_add_symbol->sy_value.X_add_number; + + if (exp->X_op_symbol && + exp->X_op_symbol->sy_value.X_op == O_constant) + mask |= exp->X_op_symbol->sy_value.X_add_number; + + /* Want to know if mask covers more bits than opmask. + this is the same as asking if mask has any bits not in opmask, + or whether (mask & ~opmask) is nonzero. */ + if (mask && (mask & ~opmask)) + { +#ifdef DEBUG + printf ("overflow: (mask = %8.8x, ~opmask = %8.8x, AND = %8.8x)\n", + mask, ~opmask, (mask & ~opmask)); +#endif + return _("operand mask overflow"); + } + + return NULL; +} + + +static expressionS * +make_right_shifted_expr (expressionS * exp, + const int amount, + const int signed_p) +{ + symbolS * stmp = 0; + expressionS * new_exp; + + stmp = expr_build_binary (O_right_shift, + make_expr_symbol (exp), + expr_build_uconstant (amount)); + + if (signed_p) + stmp->bsym->flags |= BSF_SRELC; + else + stmp->bsym->flags |= BSF_RELC; + + /* Then wrap that in a "symbol expr" for good measure. */ + new_exp = xmalloc (sizeof (expressionS)); + memset (new_exp, 0, sizeof (expressionS)); + new_exp->X_op = O_symbol; + new_exp->X_op_symbol = 0; + new_exp->X_add_symbol = stmp; + new_exp->X_add_number = 0; + + return new_exp; +} +#endif /* Apply a fixup to the object code. This is called for all the fixups we generated by the call to fix_new_exp, above. In the call above we used a reloc code which was the largest legal reloc code @@ -605,6 +891,30 @@ gas_cgen_md_apply_fix (fixP, valP, seg) bfd_reloc_code_real_type reloc_type; CGEN_FIELDS *fields = alloca (CGEN_CPU_SIZEOF_FIELDS (cd)); const CGEN_INSN *insn = fixP->fx_cgen.insn; + int start; + int length; + int signed_p = 0; + + if (fixP->fx_cgen.field) + { + /* Use the twisty little pointer path + back to the ifield if it exists. */ + start = fixP->fx_cgen.field->val.leaf->start; + length = fixP->fx_cgen.field->val.leaf->length; + } + else + { + /* Or the far less useful operand-size guesstimate. */ + start = operand->start; + length = operand->length; + } + + /* FIXME: this is not a perfect heuristic for figuring out + whether an operand is signed: it only works when the operand + is an immediate. it's not terribly likely that any other + values will be signed relocs, but it's possible. */ + if (operand && (operand->hw_type == HW_H_SINT)) + signed_p = 1; /* If the reloc has been fully resolved finish the operand here. */ /* FIXME: This duplicates the capabilities of code in BFD. */ @@ -647,6 +957,18 @@ gas_cgen_md_apply_fix (fixP, valP, seg) partial_inplace == false. */ reloc_type = md_cgen_lookup_reloc (insn, operand, fixP); +#ifdef OBJ_COMPLEX_RELC + if (reloc_type == BFD_RELOC_RELC) + { + /* Change addend to "self-describing" form, + for BFD to handle in the linker. */ + value = gas_cgen_encode_addend (start, operand->length, + length, fixP->fx_size, + cd->insn_chunk_bitsize / 8, + signed_p, + ! (fixP->fx_cgen.msb_field_p)); + } +#endif if (reloc_type != BFD_RELOC_NONE) fixP->fx_r_type = reloc_type; @@ -702,7 +1024,6 @@ gas_cgen_tc_gen_reloc (section, fixP) fixS * fixP; { arelent *reloc; - reloc = (arelent *) xmalloc (sizeof (arelent)); reloc->howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type); @@ -740,3 +1061,4 @@ gas_cgen_begin () else cgen_clear_signed_overflow_ok (gas_cgen_cpu_desc); } + diff --git a/gas/cond.c b/gas/cond.c index d6c32acc253..d76e4d98d9a 100644 --- a/gas/cond.c +++ b/gas/cond.c @@ -1,6 +1,6 @@ /* cond.c - conditional assembly pseudo-ops, and .include Copyright 1990, 1991, 1992, 1993, 1995, 1997, 1998, 2000, 2001, 2002, - 2003 Free Software Foundation, Inc. + 2003, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -20,6 +20,7 @@ 02110-1301, USA. */ #include "as.h" +#include "sb.h" #include "macro.h" #include "obstack.h" diff --git a/gas/config.in b/gas/config.in index b15d8024aba..20d5df9a4e2 100644 --- a/gas/config.in +++ b/gas/config.in @@ -29,7 +29,11 @@ /* Supported emulations. */ #undef EMULATIONS -/* Define to 1 if NLS is requested */ +/* Define if you want run-time sanity checks. */ +#undef ENABLE_CHECKING + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ #undef ENABLE_NLS /* Define to 1 if you have `alloca', as a function or macro. */ @@ -39,12 +43,6 @@ */ #undef HAVE_ALLOCA_H -/* Define to 1 if you have the header file. */ -#undef HAVE_ARGZ_H - -/* Define to 1 if you have the `dcgettext' function. */ -#undef HAVE_DCGETTEXT - /* Is the prototype for getopt in in the expected format? */ #undef HAVE_DECL_GETOPT @@ -52,60 +50,24 @@ don't. */ #undef HAVE_DECL_VSNPRINTF +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H -/* Define to 1 if you have the `getcwd' function. */ -#undef HAVE_GETCWD - -/* Define to 1 if you have the `getpagesize' function. */ -#undef HAVE_GETPAGESIZE - -/* Define as 1 if you have gettext and don't want to use GNU gettext. */ -#undef HAVE_GETTEXT - /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define if your locale.h file contains LC_MESSAGES. */ -#undef HAVE_LC_MESSAGES - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LOCALE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MALLOC_H - /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H -/* Define to 1 if you have a working `mmap' system call. */ -#undef HAVE_MMAP - -/* Define to 1 if you have the `munmap' function. */ -#undef HAVE_MUNMAP - -/* Define to 1 if you have the header file. */ -#undef HAVE_NL_TYPES_H - -/* Define to 1 if you have the `putenv' function. */ -#undef HAVE_PUTENV - /* Define to 1 if you have the `remove' function. */ #undef HAVE_REMOVE /* Define to 1 if you have the `sbrk' function. */ #undef HAVE_SBRK -/* Define to 1 if you have the `setenv' function. */ -#undef HAVE_SETENV - -/* Define to 1 if you have the `setlocale' function. */ -#undef HAVE_SETLOCALE - /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H @@ -115,24 +77,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H -/* Define if you have the stpcpy function */ -#undef HAVE_STPCPY - -/* Define to 1 if you have the `strcasecmp' function. */ -#undef HAVE_STRCASECMP - -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR - /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PARAM_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H @@ -145,24 +95,16 @@ /* Define to 1 if you have the `unlink' function. */ #undef HAVE_UNLINK -/* Define to 1 if you have the header file. */ -#undef HAVE_VALUES_H - /* Define to 1 if you have the header file. */ #undef HAVE_VARARGS_H -/* Define to 1 if you have the `__argz_count' function. */ -#undef HAVE___ARGZ_COUNT - -/* Define to 1 if you have the `__argz_next' function. */ -#undef HAVE___ARGZ_NEXT - -/* Define to 1 if you have the `__argz_stringify' function. */ -#undef HAVE___ARGZ_STRINGIFY - /* Using i386 COFF? */ #undef I386COFF +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + /* Using m68k COFF? */ #undef M68KCOFF @@ -217,9 +159,6 @@ /* generic support? */ #undef OBJ_MAYBE_GENERIC -/* IEEE support? */ -#undef OBJ_MAYBE_IEEE - /* SOM support? */ #undef OBJ_MAYBE_SOM @@ -282,6 +221,9 @@ /* Target vendor. */ #undef TARGET_VENDOR +/* Use b modifier when opening binary files? */ +#undef USE_BINARY_FOPEN + /* Use emulation support? */ #undef USE_EMULATIONS @@ -302,17 +244,8 @@ `char[]'. */ #undef YYTEXT_POINTER -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif - -/* Define to `long' if does not define. */ -#undef off_t - -/* Define to `unsigned' if does not define. */ -#undef size_t diff --git a/gas/config/atof-vax.c b/gas/config/atof-vax.c index 75756904fb8..fe9f8b9b106 100644 --- a/gas/config/atof-vax.c +++ b/gas/config/atof-vax.c @@ -1,5 +1,5 @@ /* atof_vax.c - turn a Flonum into a VAX floating point number - Copyright 1987, 1992, 1993, 1995, 1997, 1999, 2000, 2005 + Copyright 1987, 1992, 1993, 1995, 1997, 1999, 2000, 2005, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -35,7 +35,7 @@ int flonum_gen2vax (int, FLONUM_TYPE *, LITTLENUM_TYPE *); /* Number of chars in flonum type 'letter'. */ -static int +static unsigned int atof_vax_sizeof (int letter) { int return_value; @@ -395,7 +395,7 @@ md_atof (int what_statement_type, { LITTLENUM_TYPE words[MAXIMUM_NUMBER_OF_LITTLENUMS]; char kind_of_float; - int number_of_chars; + unsigned int number_of_chars; LITTLENUM_TYPE *littlenumP; switch (what_statement_type) diff --git a/gas/config/bfin-defs.h b/gas/config/bfin-defs.h index 48bacb3ed7d..f94107136cf 100644 --- a/gas/config/bfin-defs.h +++ b/gas/config/bfin-defs.h @@ -1,5 +1,5 @@ /* bfin-defs.h ADI Blackfin gas header file - Copyright 2005 + Copyright 2005, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -22,9 +22,6 @@ #ifndef BFIN_PARSE_H #define BFIN_PARSE_H -#include -#include "as.h" - #define PCREL 1 #define CODE_FRAG_SIZE 4096 /* 1 page. */ @@ -374,7 +371,6 @@ void semantic_error_2 (char *syntax); EXPR_T mkexpr (int, SYMBOL_T); -extern void bfin_equals (Expr_Node *sym); /* Defined in bfin-lex.l. */ void set_start_state (void); diff --git a/gas/config/bfin-lex.l b/gas/config/bfin-lex.l index 3a0077cd985..21f28454132 100644 --- a/gas/config/bfin-lex.l +++ b/gas/config/bfin-lex.l @@ -1,5 +1,5 @@ /* bfin-lex.l ADI Blackfin lexer - Copyright 2005 + Copyright 2005, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -20,11 +20,9 @@ 02110-1301, USA. */ %{ -#include -#include +#include "as.h" #include "bfin-defs.h" #include "bfin-parse.h" -#include "as.h" static long parse_int (char **end); static int parse_halfreg (Register *r, int cl, char *hr); diff --git a/gas/config/bfin-parse.y b/gas/config/bfin-parse.y index 917c2d27ba0..b3416aa1130 100644 --- a/gas/config/bfin-parse.y +++ b/gas/config/bfin-parse.y @@ -1,5 +1,5 @@ /* bfin-parse.y ADI Blackfin parser - Copyright 2005 + Copyright 2005, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -20,8 +20,7 @@ 02110-1301, USA. */ %{ -#include -#include +#include "as.h" #include #include "bfin-aux.h" // opcode generating auxiliaries @@ -298,9 +297,10 @@ check_macfuncs (Macfunc *aa, Opt_mode *opa, return yyerror ("Vector AxMACs can't be same"); } - /* If both ops are != 3, we have multiply_halfregs in both + /* If both ops are one of 0, 1, or 2, we have multiply_halfregs in both assignment_or_macfuncs. */ - if (aa->op == ab->op && aa->op != 3) + if (aa->op < 3 && aa->op >=0 + && ab->op < 3 && ab->op >= 0) { if (check_multiply_halfregs (aa, ab) < 0) return -1; @@ -1730,7 +1730,7 @@ asm_1: $$ = DSP32MULT (0, 0, $4.mod, 0, 0, 0, 0, IS_H ($3.s0), IS_H ($3.s1), &$1, 0, &$3.s0, &$3.s1, 1); - } + } } | REG ASSIGN multiply_halfregs opt_mode @@ -1739,6 +1739,9 @@ asm_1: if (!IS_DREG ($1)) return yyerror ("Dreg expected"); + if (IS_EVEN ($1) && $4.MM) + return yyerror ("(M) not allowed with MAC0"); + if (!IS_EVEN ($1)) { notethat ("dsp32mult: dregs = multiply_halfregs (opt_mode)\n"); @@ -1747,15 +1750,13 @@ asm_1: IS_H ($3.s0), IS_H ($3.s1), 0, 0, &$1, 0, &$3.s0, &$3.s1, 0); } - else if ($4.MM == 0) + else { notethat ("dsp32mult: dregs = multiply_halfregs opt_mode\n"); $$ = DSP32MULT (0, 0, $4.mod, 0, 1, 0, 0, IS_H ($3.s0), IS_H ($3.s1), &$1, 0, &$3.s0, &$3.s1, 1); } - else - return yyerror ("Register or mode mismatch"); } | HALF_REG ASSIGN multiply_halfregs opt_mode COMMA @@ -1764,57 +1765,56 @@ asm_1: if (!IS_DREG ($1) || !IS_DREG ($6)) return yyerror ("Dregs expected"); + if (!IS_HCOMPL($1, $6)) + return yyerror ("Dest registers mismatch"); + if (check_multiply_halfregs (&$3, &$8) < 0) return -1; - if (IS_H ($1) && !IS_H ($6)) - { - notethat ("dsp32mult: dregs_hi = multiply_halfregs mxd_mod, " - "dregs_lo = multiply_halfregs opt_mode\n"); - $$ = DSP32MULT (0, $4.MM, $9.mod, 1, 0, - IS_H ($3.s0), IS_H ($3.s1), IS_H ($8.s0), IS_H ($8.s1), - &$1, 0, &$3.s0, &$3.s1, 1); - } - else if (!IS_H ($1) && IS_H ($6) && $4.MM == 0) - { - $$ = DSP32MULT (0, $9.MM, $9.mod, 1, 0, - IS_H ($8.s0), IS_H ($8.s1), IS_H ($3.s0), IS_H ($3.s1), - &$1, 0, &$3.s0, &$3.s1, 1); - } + if ((!IS_H ($1) && $4.MM) + || (!IS_H ($6) && $9.MM)) + return yyerror ("(M) not allowed with MAC0"); + + notethat ("dsp32mult: dregs_hi = multiply_halfregs mxd_mod, " + "dregs_lo = multiply_halfregs opt_mode\n"); + + if (IS_H ($1)) + $$ = DSP32MULT (0, $4.MM, $9.mod, 1, 0, + IS_H ($3.s0), IS_H ($3.s1), IS_H ($8.s0), IS_H ($8.s1), + &$1, 0, &$3.s0, &$3.s1, 1); else - return yyerror ("Multfunc Register or mode mismatch"); + $$ = DSP32MULT (0, $9.MM, $9.mod, 1, 0, + IS_H ($8.s0), IS_H ($8.s1), IS_H ($3.s0), IS_H ($3.s1), + &$1, 0, &$3.s0, &$3.s1, 1); } - | REG ASSIGN multiply_halfregs opt_mode COMMA REG ASSIGN multiply_halfregs opt_mode + | REG ASSIGN multiply_halfregs opt_mode COMMA REG ASSIGN multiply_halfregs opt_mode { if (!IS_DREG ($1) || !IS_DREG ($6)) return yyerror ("Dregs expected"); + if ((IS_EVEN ($1) && $6.regno - $1.regno != 1) + || (IS_EVEN ($6) && $1.regno - $6.regno != 1)) + return yyerror ("Dest registers mismatch"); + if (check_multiply_halfregs (&$3, &$8) < 0) return -1; + if ((IS_EVEN ($1) && $4.MM) + || (IS_EVEN ($6) && $9.MM)) + return yyerror ("(M) not allowed with MAC0"); + notethat ("dsp32mult: dregs = multiply_halfregs mxd_mod, " "dregs = multiply_halfregs opt_mode\n"); - if (IS_EVEN ($1)) - { - if ($6.regno - $1.regno != 1 || $4.MM != 0) - return yyerror ("Dest registers or mode mismatch"); - /* op1 MM mmod */ - $$ = DSP32MULT (0, 0, $9.mod, 1, 1, - IS_H ($8.s0), IS_H ($8.s1), IS_H ($3.s0), IS_H ($3.s1), - &$1, 0, &$3.s0, &$3.s1, 1); - - } + if (IS_EVEN ($1)) + $$ = DSP32MULT (0, $9.MM, $9.mod, 1, 1, + IS_H ($8.s0), IS_H ($8.s1), IS_H ($3.s0), IS_H ($3.s1), + &$1, 0, &$3.s0, &$3.s1, 1); else - { - if ($1.regno - $6.regno != 1) - return yyerror ("Dest registers mismatch"); - - $$ = DSP32MULT (0, $9.MM, $9.mod, 1, 1, - IS_H ($3.s0), IS_H ($3.s1), IS_H ($8.s0), IS_H ($8.s1), - &$1, 0, &$3.s0, &$3.s1, 1); - } + $$ = DSP32MULT (0, $4.MM, $9.mod, 1, 1, + IS_H ($3.s0), IS_H ($3.s1), IS_H ($8.s0), IS_H ($8.s1), + &$1, 0, &$3.s0, &$3.s1, 1); } @@ -3223,16 +3223,6 @@ asm_1: } - -/* Expression Assignment. */ - - | expr ASSIGN expr - { - bfin_equals ($1); - $$ = 0; - } - - /* PushPopMultiple. */ | reg_with_predec ASSIGN LPAREN REG COLON expr COMMA REG COLON expr RPAREN { @@ -4280,6 +4270,8 @@ value_match (Expr_Node *expr, int sz, int sign, int mul, int issigned) static Expr_Node * binary (Expr_Op_Type op, Expr_Node *x, Expr_Node *y) { + Expr_Node_Value val; + if (x->type == Expr_Node_Constant && y->type == Expr_Node_Constant) { switch (op) @@ -4329,13 +4321,32 @@ binary (Expr_Op_Type op, Expr_Node *x, Expr_Node *y) } return x; } - else + /* Canonicalize order to EXPR OP CONSTANT. */ + if (x->type == Expr_Node_Constant) { - /* Create a new expression structure. */ - Expr_Node_Value val; - val.op_value = op; - return Expr_Node_Create (Expr_Node_Binop, val, x, y); - } + Expr_Node *t = x; + x = y; + y = t; + } + /* Canonicalize subtraction of const to addition of negated const. */ + if (op == Expr_Op_Type_Sub && y->type == Expr_Node_Constant) + { + op = Expr_Op_Type_Add; + y->value.i_value = -y->value.i_value; + } + if (y->type == Expr_Node_Constant && x->type == Expr_Node_Binop + && x->Right_Child->type == Expr_Node_Constant) + { + if (op == x->value.op_value && x->value.op_value == Expr_Op_Type_Add) + { + x->Right_Child->value.i_value += y->value.i_value; + return x; + } + } + + /* Create a new expression structure. */ + val.op_value = op; + return Expr_Node_Create (Expr_Node_Binop, val, x, y); } static Expr_Node * diff --git a/gas/config/m68k-parse.h b/gas/config/m68k-parse.h index e7af8536a80..4351609cc38 100644 --- a/gas/config/m68k-parse.h +++ b/gas/config/m68k-parse.h @@ -113,9 +113,12 @@ enum m68k_register BUSCR, /* 68060 added these. */ PCR, ROMBAR, /* mcf5200 added these. */ + RAMBAR_ALT, /* Some CF chips have RAMBAR using + RAMBAR0's number */ RAMBAR0, RAMBAR1, MMUBAR, /* mcfv4e added these. */ + ROMBAR0, /* mcfv4e added these. */ ROMBAR1, /* mcfv4e added these. */ MPCR, EDRAMBAR, SECMBAR, /* mcfv4e added these. */ PCR1U0, PCR1L0, PCR1U1, PCR1L1,/* mcfv4e added these. */ @@ -126,7 +129,10 @@ enum m68k_register FLASHBAR, RAMBAR, /* mcf528x added these. */ MBAR2, /* mcf5249 added this. */ MBAR, -#define last_movec_reg MBAR + ASID, /* m5475. */ + CAC, /* fido added this. */ + MBB, +#define last_movec_reg MBB /* End of movec ordering constraints. */ FPI, diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c index a5a76ff3da0..1ac8a138f08 100644 --- a/gas/config/obj-coff.c +++ b/gas/config/obj-coff.c @@ -1026,7 +1026,7 @@ weak_name2altname (const char * name) } /* Return the name of the weak symbol corresponding to an - alterate symbol. */ + alternate symbol. */ static const char * weak_altname2name (const char * name) @@ -1579,7 +1579,7 @@ obj_coff_section (int ignore ATTRIBUTE_UNUSED) if (! load_removed) flags |= SEC_LOAD; /* Note - the READONLY flag is set here, even for the 'x' - attrbiute in order to be compatible with the MSVC + attribute in order to be compatible with the MSVC linker. */ if (! readonly_removed) flags |= SEC_READONLY; diff --git a/gas/config/obj-coff.h b/gas/config/obj-coff.h index 6fcbc9f06cb..d2b212565ef 100644 --- a/gas/config/obj-coff.h +++ b/gas/config/obj-coff.h @@ -1,6 +1,6 @@ /* coff object file format Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GAS. @@ -27,8 +27,6 @@ #include "targ-cpu.h" -#include "bfd.h" - /* This internal_lineno crap is to stop namespace pollution from the bfd internal coff headerfile. */ #define internal_lineno bfd_internal_lineno @@ -57,16 +55,30 @@ #endif #ifdef TC_I386 +#ifndef TE_PEP +#include "coff/x86_64.h" +#else #include "coff/i386.h" +#endif #ifdef TE_PE +#ifdef TE_PEP +extern const char * x86_64_target_format (void); +#define TARGET_FORMAT x86_64_target_format () +#define COFF_TARGET_FORMAT "pe-x86-64" +#else #define TARGET_FORMAT "pe-i386" #endif +#endif #ifndef TARGET_FORMAT +#ifdef TE_PEP +#define TARGET_FORMAT "coff-x86-64" +#else #define TARGET_FORMAT "coff-i386" #endif #endif +#endif #ifdef TC_M68K #include "coff/m68k.h" diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index f922149cae0..2f93990e721 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -1,6 +1,7 @@ /* ELF object file format Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -57,6 +58,10 @@ #include "elf/x86-64.h" #endif +#ifdef TC_MEP +#include "elf/mep.h" +#endif + static void obj_elf_line (int); static void obj_elf_size (int); static void obj_elf_type (int); @@ -632,6 +637,11 @@ obj_elf_change_section (const char *name, else if (attr == SHF_EXECINSTR && strcmp (name, ".note.GNU-stack") == 0) override = TRUE; +#ifdef TC_ALPHA + /* A section on Alpha may have SHF_ALPHA_GPREL. */ + else if ((attr & ~ssect->attr) == SHF_ALPHA_GPREL) + override = TRUE; +#endif else { if (group_name == NULL) @@ -1414,11 +1424,12 @@ obj_elf_version (int ignore ATTRIBUTE_UNUSED) Elf_Internal_Note i_note; Elf_External_Note e_note; asection *note_secp = NULL; - int len; SKIP_WHITESPACE (); if (*input_line_pointer == '\"') { + unsigned int len; + ++input_line_pointer; /* -> 1st char of string. */ name = input_line_pointer; @@ -1429,19 +1440,19 @@ obj_elf_version (int ignore ATTRIBUTE_UNUSED) *(input_line_pointer - 1) = '\0'; *input_line_pointer = c; - /* create the .note section */ - + /* Create the .note section. */ note_secp = subseg_new (".note", 0); bfd_set_section_flags (stdoutput, note_secp, SEC_HAS_CONTENTS | SEC_READONLY); - /* process the version string */ + /* Process the version string. */ + len = strlen (name) + 1; - len = strlen (name); - - i_note.namesz = ((len + 1) + 3) & ~3; /* round this to word boundary */ - i_note.descsz = 0; /* no description */ + /* PR 3456: Although the name field is padded out to an 4-byte + boundary, the namesz field should not be adjusted. */ + i_note.namesz = len; + i_note.descsz = 0; /* No description. */ i_note.type = NT_VERSION; p = frag_more (sizeof (e_note.namesz)); md_number_to_chars (p, i_note.namesz, sizeof (e_note.namesz)); @@ -1449,17 +1460,16 @@ obj_elf_version (int ignore ATTRIBUTE_UNUSED) md_number_to_chars (p, i_note.descsz, sizeof (e_note.descsz)); p = frag_more (sizeof (e_note.type)); md_number_to_chars (p, i_note.type, sizeof (e_note.type)); - p = frag_more (len + 1); - strcpy (p, name); + p = frag_more (len); + memcpy (p, name, len); frag_align (2, 0, 0); subseg_set (seg, subseg); } else - { - as_bad (_("expected quoted string")); - } + as_bad (_("expected quoted string")); + demand_empty_rest_of_line (); } @@ -1684,6 +1694,9 @@ adjust_stab_sections (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED) this at the moment, so we do it ourselves. We save the information in the symbol. */ +#ifdef OBJ_MAYBE_ELF +static +#endif void elf_ecoff_set_ext (symbolS *sym, struct ecoff_extr *ext) { @@ -1978,6 +1991,7 @@ elf_frob_file (void) bfd_set_section_size (stdoutput, s, size); s->contents = (unsigned char *) frag_more (size); frag_now->fr_fix = frag_now_fix_octets (); + frag_wane (frag_now); } #ifdef elf_tc_final_processing diff --git a/gas/config/obj-elf.h b/gas/config/obj-elf.h index 7ff9ef09aa3..29356ab3b06 100644 --- a/gas/config/obj-elf.h +++ b/gas/config/obj-elf.h @@ -1,6 +1,6 @@ /* ELF object file format. Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004 Free Software Foundation, Inc. + 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -34,8 +34,6 @@ #define OUTPUT_FLAVOR bfd_target_elf_flavour #endif -#include "bfd.h" - #define BYTES_IN_WORD 4 /* for now */ #include "bfd/elf-bfd.h" @@ -83,15 +81,13 @@ struct elf_obj_sy #define OBJ_SYMFIELD_TYPE struct elf_obj_sy /* Symbol fields used by the ELF back end. */ -#define ELF_TARGET_SYMBOL_FIELDS int local:1; +#define ELF_TARGET_SYMBOL_FIELDS unsigned int local:1; /* Don't change this; change ELF_TARGET_SYMBOL_FIELDS instead. */ #ifndef TARGET_SYMBOL_FIELDS #define TARGET_SYMBOL_FIELDS ELF_TARGET_SYMBOL_FIELDS #endif -/* #include "targ-cpu.h" */ - #ifndef FALSE #define FALSE 0 #define TRUE !FALSE @@ -134,13 +130,6 @@ int elf_s_get_other (symbolS *); extern asection *gdb_section; -#ifndef obj_sec_set_private_data -#define obj_sec_set_private_data(B, S) \ - if (! BFD_SEND ((B), _new_section_hook, ((B), (S)))) \ - as_fatal (_("can't allocate ELF private section data: %s"), \ - bfd_errmsg (bfd_get_error ())) -#endif - #ifndef obj_frob_file #define obj_frob_file elf_frob_file #endif @@ -247,6 +236,7 @@ extern void elf_pop_insert (void); #endif #ifndef OBJ_MAYBE_ELF +/* If OBJ_MAYBE_ELF then obj-multi.h will define obj_ecoff_set_ext. */ #define obj_ecoff_set_ext elf_ecoff_set_ext struct ecoff_extr; extern void elf_ecoff_set_ext (symbolS *, struct ecoff_extr *); diff --git a/gas/config/obj-ieee.c b/gas/config/obj-ieee.c deleted file mode 100644 index bac46757c13..00000000000 --- a/gas/config/obj-ieee.c +++ /dev/null @@ -1,613 +0,0 @@ -/* obj-format for ieee-695 records. - Copyright 1991, 1992, 1993, 1994, 1997, 2000, 2001, 2002, 2003, 2005 - Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS 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 2, or (at your option) - any later version. - - GAS 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 GAS; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -/* Created by Steve Chamberlain . */ - -/* This will hopefully become the port through which bfd and gas talk, - for the moment, only ieee is known to work well. */ - -#include "bfd.h" -#include "as.h" -#include "subsegs.h" -#include "output-file.h" -#include "frags.h" - -bfd *abfd; - -/* How many addresses does the .align take? */ - -static relax_addressT -relax_align (address, alignment) - /* Address now. */ - register relax_addressT address; - - /* Alignment (binary). */ - register long alignment; -{ - relax_addressT mask; - relax_addressT new_address; - - mask = ~((~0) << alignment); - new_address = (address + mask) & (~mask); - return (new_address - address); -} - -/* Calculate the size of the frag chain - and create a bfd section to contain all of it. */ - -static void -size_section (abfd, idx) - bfd *abfd; - unsigned int idx; -{ - asection *sec; - unsigned int size = 0; - fragS *frag = segment_info[idx].frag_root; - - while (frag) - { - if (frag->fr_address != size) - { - printf (_("Out of step\n")); - size = frag->fr_address; - } - size += frag->fr_fix; - switch (frag->fr_type) - { - case rs_fill: - case rs_org: - size += frag->fr_offset * frag->fr_var; - break; - case rs_align: - case rs_align_code: - { - addressT off; - - off = relax_align (size, frag->fr_offset); - if (frag->fr_subtype != 0 && off > frag->fr_subtype) - off = 0; - size += off; - } - } - frag = frag->fr_next; - } - if (size) - { - char *name = segment_info[idx].name; - - if (name == (char *) NULL) - name = ".data"; - - segment_info[idx].user_stuff = - (char *) (sec = bfd_make_section (abfd, name)); - /* Make it output through itself. */ - sec->output_section = sec; - sec->flags |= SEC_HAS_CONTENTS; - bfd_set_section_size (abfd, sec, size); - } -} - -/* Run through a frag chain and write out the data to go with it. */ - -static void -fill_section (abfd, idx) - bfd *abfd; - unsigned int idx; -{ - asection *sec = segment_info[idx].user_stuff; - - if (sec) - { - fragS *frag = segment_info[idx].frag_root; - unsigned int offset = 0; - while (frag) - { - unsigned int fill_size; - unsigned int count; - switch (frag->fr_type) - { - case rs_fill: - case rs_align: - case rs_org: - if (frag->fr_fix) - { - bfd_set_section_contents (abfd, - sec, - frag->fr_literal, - frag->fr_address, - frag->fr_fix); - } - offset += frag->fr_fix; - fill_size = frag->fr_var; - if (fill_size) - { - unsigned int off = frag->fr_fix; - for (count = frag->fr_offset; count; count--) - { - bfd_set_section_contents (abfd, sec, - frag->fr_literal + - frag->fr_fix, - frag->fr_address + off, - fill_size); - off += fill_size; - } - } - break; - default: - abort (); - } - frag = frag->fr_next; - } - } -} - -/* Count the relocations in a chain. */ - -static unsigned int -count_entries_in_chain (idx) - unsigned int idx; -{ - unsigned int nrelocs; - fixS *fixup_ptr; - - /* Count the relocations. */ - fixup_ptr = segment_info[idx].fix_root; - nrelocs = 0; - while (fixup_ptr != (fixS *) NULL) - { - fixup_ptr = fixup_ptr->fx_next; - nrelocs++; - } - return nrelocs; -} - -/* Output all the relocations for a section. */ - -void -do_relocs_for (idx) - unsigned int idx; -{ - unsigned int nrelocs; - arelent **reloc_ptr_vector; - arelent *reloc_vector; - asymbol **ptrs; - asection *section = (asection *) (segment_info[idx].user_stuff); - unsigned int i; - fixS *from; - - if (section) - { - nrelocs = count_entries_in_chain (idx); - - reloc_ptr_vector = - (arelent **) malloc ((nrelocs + 1) * sizeof (arelent *)); - reloc_vector = (arelent *) malloc (nrelocs * sizeof (arelent)); - ptrs = (asymbol **) malloc (nrelocs * sizeof (asymbol *)); - from = segment_info[idx].fix_root; - for (i = 0; i < nrelocs; i++) - { - arelent *to = reloc_vector + i; - asymbol *s; - reloc_ptr_vector[i] = to; - to->howto = (reloc_howto_type *) (from->fx_r_type); - - s = &(from->fx_addsy->sy_symbol.sy); - to->address = ((char *) (from->fx_frag->fr_address + - from->fx_where)) - - ((char *) (&(from->fx_frag->fr_literal))); - to->addend = from->fx_offset; - /* If we know the symbol which we want to relocate to, turn - this reloaction into a section relative. - - If this relocation is pcrelative, and we know the - destination, we still want to keep the relocation - since - the linker might relax some of the bytes, but it stops - being pc relative and turns into an absolute relocation. */ - if (s) - { - if ((s->flags & BSF_UNDEFINED) == 0) - { - to->section = s->section; - - /* We can refer directly to the value field here, - rather than using S_GET_VALUE, because this is - only called after do_symbols, which sets up the - value field. */ - to->addend += s->value; - - to->sym_ptr_ptr = 0; - if (to->howto->pcrel_offset) - /* This is a pcrel relocation, the addend should - be adjusted. */ - to->addend -= to->address + 1; - } - else - { - to->section = 0; - *ptrs = &(from->fx_addsy->sy_symbol.sy); - to->sym_ptr_ptr = ptrs; - - if (to->howto->pcrel_offset) - /* This is a pcrel relocation, the addend should - be adjusted. */ - to->addend -= to->address - 1; - } - } - else - to->section = 0; - - ptrs++; - from = from->fx_next; - } - - /* Attach to the section. */ - section->orelocation = reloc_ptr_vector; - section->reloc_count = nrelocs; - section->flags |= SEC_LOAD; - } -} - -/* Do the symbols. */ - -static void -do_symbols (abfd) - bfd *abfd; -{ - extern symbolS *symbol_rootP; - symbolS *ptr; - asymbol **symbol_ptr_vec; - asymbol *symbol_vec; - unsigned int count = 0; - unsigned int index; - - for (ptr = symbol_rootP; - ptr != (symbolS *) NULL; - ptr = ptr->sy_next) - { - if (SEG_NORMAL (ptr->sy_symbol.seg)) - { - ptr->sy_symbol.sy.section = - (asection *) (segment_info[ptr->sy_symbol.seg].user_stuff); - S_SET_VALUE (ptr, S_GET_VALUE (ptr)); - if (ptr->sy_symbol.sy.flags == 0) - ptr->sy_symbol.sy.flags = BSF_LOCAL; - } - else - { - switch (ptr->sy_symbol.seg) - { - case SEG_ABSOLUTE: - ptr->sy_symbol.sy.flags |= BSF_ABSOLUTE; - ptr->sy_symbol.sy.section = 0; - break; - case SEG_UNKNOWN: - ptr->sy_symbol.sy.flags = BSF_UNDEFINED; - ptr->sy_symbol.sy.section = 0; - break; - default: - abort (); - } - } - ptr->sy_symbol.sy.value = S_GET_VALUE (ptr); - count++; - } - symbol_ptr_vec = (asymbol **) malloc ((count + 1) * sizeof (asymbol *)); - - index = 0; - for (ptr = symbol_rootP; - ptr != (symbolS *) NULL; - ptr = ptr->sy_next) - { - symbol_ptr_vec[index] = &(ptr->sy_symbol.sy); - index++; - } - symbol_ptr_vec[index] = 0; - abfd->outsymbols = symbol_ptr_vec; - abfd->symcount = count; -} - -/* The generic as->bfd converter. Other backends may have special case - code. */ - -void -bfd_as_write_hook () -{ - int i; - - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - size_section (abfd, i); - - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - fill_section (abfd, i); - - do_symbols (abfd); - - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - do_relocs_for (i); -} - -S_SET_SEGMENT (x, y) - symbolS *x; - int y; -{ - x->sy_symbol.seg = y; -} - -S_IS_DEFINED (x) - symbolS *x; -{ - if (SEG_NORMAL (x->sy_symbol.seg)) - { - return 1; - } - switch (x->sy_symbol.seg) - { - case SEG_UNKNOWN: - return 0; - default: - abort (); - } -} - -S_IS_EXTERNAL (x) -{ - abort (); -} - -S_GET_DESC (x) -{ - abort (); -} - -S_GET_SEGMENT (x) - symbolS *x; -{ - return x->sy_symbol.seg; -} - -S_SET_EXTERNAL (x) - symbolS *x; -{ - x->sy_symbol.sy.flags |= BSF_GLOBAL | BSF_EXPORT; -} - -S_SET_NAME (x, y) - symbolS *x; - char *y; -{ - x->sy_symbol.sy.name = y; -} - -S_GET_OTHER (x) -{ - abort (); -} - -S_IS_DEBUG (x) -{ - abort (); -} - -#ifndef segment_name -char * -segment_name () -{ - abort (); -} -#endif - -void -obj_read_begin_hook () -{ -} - -static void -obj_ieee_section (ignore) - int ignore; -{ - extern char *input_line_pointer; - extern char is_end_of_line[]; - char *p = input_line_pointer; - char *s = p; - int i; - - /* Look up the name, if it doesn't exist, make it. */ - while (*p && *p != ' ' && *p != ',' && !is_end_of_line[*p]) - { - p++; - } - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - { - if (segment_info[i].hadone) - { - if (strncmp (segment_info[i].name, s, p - s) == 0) - goto ok; - } - else - break; - } - if (i == SEG_UNKNOWN) - { - as_bad (_("too many sections")); - return; - } - - segment_info[i].hadone = 1; - segment_info[i].name = malloc (p - s + 1); - memcpy (segment_info[i].name, s, p - s); - segment_info[i].name[p - s] = 0; -ok: - subseg_set (i, 0); - while (!is_end_of_line[*p]) - p++; - input_line_pointer = p; -} - -const pseudo_typeS obj_pseudo_table[] = -{ - {"section", obj_ieee_section, 0}, - {"data.b" , cons , 1}, - {"data.w" , cons , 2}, - {"data.l" , cons , 4}, - {"export" , s_globl , 0}, - {"option" , s_ignore , 0}, - {"end" , s_ignore , 0}, - {"import" , s_ignore , 0}, - {"sdata" , stringer , 0}, - 0, -}; - -void -obj_symbol_new_hook (symbolP) - symbolS *symbolP; -{ - symbolP->sy_symbol.sy.the_bfd = abfd; -} - -#if 1 - -#ifndef SUB_SEGMENT_ALIGN -#ifdef HANDLE_ALIGN -/* The last subsegment gets an alignment corresponding to the alignment - of the section. This allows proper nop-filling at the end of - code-bearing sections. */ -#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) \ - (!(FRCHAIN)->frch_next || (FRCHAIN)->frch_next->frch_seg != (SEG) \ - ? get_recorded_alignment (SEG) : 0) -#else -#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) 2 -#endif -#endif - -extern void -write_object_file () -{ - int i; - struct frchain *frchain_ptr; - struct frag *frag_ptr; - - abfd = bfd_openw (out_file_name, "ieee"); - - if (abfd == 0) - { - as_perror (_("FATAL: Can't create %s"), out_file_name); - exit (EXIT_FAILURE); - } - bfd_set_format (abfd, bfd_object); - bfd_set_arch_mach (abfd, bfd_arch_h8300, 0); - subseg_set (1, 0); - subseg_set (2, 0); - subseg_set (3, 0); - - /* Run through all the sub-segments and align them up. Also - close any open frags. We tack a .fill onto the end of the - frag chain so that any .align's size can be worked by looking - at the next frag. */ - for (frchain_ptr = frchain_root; - frchain_ptr != (struct frchain *) NULL; - frchain_ptr = frchain_ptr->frch_next) - { - int alignment; - - subseg_set (frchain_ptr->frch_seg, frchain_ptr->frch_subseg); - - alignment = SUB_SEGMENT_ALIGN (now_seg, frchain_ptr) - -#ifdef md_do_align - md_do_align (alignment, (char *) NULL, 0, 0, alignment_done); -#endif - if (subseg_text_p (now_seg)) - frag_align_code (alignment, 0); - else - frag_align (alignment, 0, 0); - -#ifdef md_do_align - alignment_done: -#endif - - frag_wane (frag_now); - frag_now->fr_fix = 0; - know (frag_now->fr_next == NULL); - } - - /* Now build one big frag chain for each segment, linked through - fr_next. */ - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - { - fragS **prev_frag_ptr_ptr; - struct frchain *next_frchain_ptr; - - segment_info[i].frag_root = segment_info[i].frchainP->frch_root; - } - - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - relax_segment (segment_info[i].frag_root, i); - - /* Relaxation has completed. Freeze all syms. */ - finalize_syms = 1; - - /* Now the addresses of the frags are correct within the segment. */ - - bfd_as_write_hook (); - bfd_close (abfd); -} - -#endif - -H_SET_TEXT_SIZE (a, b) -{ - abort (); -} - -H_GET_TEXT_SIZE () -{ - abort (); -} - -H_SET_BSS_SIZE () -{ - abort (); -} - -H_SET_STRING_SIZE () -{ - abort (); -} - -H_SET_RELOCATION_SIZE () -{ - abort (); -} - -H_SET_MAGIC_NUMBER () -{ - abort (); -} - -H_GET_FILE_SIZE () -{ - abort (); -} - -H_GET_TEXT_RELOCATION_SIZE () -{ - abort (); -} diff --git a/gas/config/obj-ieee.h b/gas/config/obj-ieee.h deleted file mode 100644 index 29654296e83..00000000000 --- a/gas/config/obj-ieee.h +++ /dev/null @@ -1,46 +0,0 @@ -/* This file is obj-ieee.h - Copyright 1987, 1988, 1989, 1990, 1991, 1992, 2000, 2002, 2003 - Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS 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 2, or (at your option) - any later version. - - GAS 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 GAS; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -#include "bfd.h" - -typedef struct -{ - asymbol sy; - int seg; -} -obj_symbol_type; - -#define S_GET_NAME(s) (((s)->sy_symbol.sy.name)) - -/* Return true for symbols that should not be reduced to section - symbols or eliminated from expressions, because they may be - overridden by the linker. */ -#define S_FORCE_RELOC(s, strict) (!SEG_NORMAL (x->sy_symbol.seg)) - -typedef struct - { - int x; - } -object_headers; - -int lineno_rootP; - -#define IEEE_STYLE diff --git a/gas/config/obj-som.c b/gas/config/obj-som.c index 571330efcb4..f41df58182b 100644 --- a/gas/config/obj-som.c +++ b/gas/config/obj-som.c @@ -1,5 +1,5 @@ /* SOM object file format. - Copyright 1993, 1994, 1998, 2000, 2002, 2003, 2004, 2005 + Copyright 1993, 1994, 1998, 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -150,12 +150,9 @@ obj_som_version (int unused ATTRIBUTE_UNUSED) version_seen = 1; if (!bfd_som_attach_aux_hdr (stdoutput, VERSION_AUX_ID, version)) - { - bfd_perror (stdoutput->filename); - as_perror (_("FATAL: Attaching version header %s"), - stdoutput->filename); - exit (EXIT_FAILURE); - } + as_fatal (_("attaching version header %s: %s"), + stdoutput->filename, bfd_errmsg (bfd_get_error ())); + *input_line_pointer = c; demand_empty_rest_of_line (); } @@ -195,12 +192,9 @@ obj_som_copyright (int unused ATTRIBUTE_UNUSED) copyright_seen = 1; if (!bfd_som_attach_aux_hdr (stdoutput, COPYRIGHT_AUX_ID, copyright)) - { - bfd_perror (stdoutput->filename); - as_perror (_("FATAL: Attaching copyright header %s"), - stdoutput->filename); - exit (EXIT_FAILURE); - } + as_fatal (_("attaching copyright header %s: %s"), + stdoutput->filename, bfd_errmsg (bfd_get_error ())); + *input_line_pointer = c; demand_empty_rest_of_line (); } diff --git a/gas/config/obj-som.h b/gas/config/obj-som.h index 85f3f72bb40..16ca21e1c6e 100644 --- a/gas/config/obj-som.h +++ b/gas/config/obj-som.h @@ -1,5 +1,5 @@ /* SOM object file format. - Copyright 1993, 1994, 1995, 1998, 2000, 2004, 2005 + Copyright 1993, 1994, 1995, 1998, 2000, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -27,7 +27,6 @@ #define OBJ_SOM 1 -#include "bfd.h" #include "bfd/som.h" #include "targ-cpu.h" diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c index 3765b08c73a..e8f0bad55f3 100644 --- a/gas/config/tc-alpha.c +++ b/gas/config/tc-alpha.c @@ -1,6 +1,6 @@ /* tc-alpha.c - Processor-specific code for the DEC Alpha AXP CPU. Copyright 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Carnegie Mellon University, 1993. Written by Alessandro Forin, based on earlier gas-1.38 target CPU files. Modified by Ken Raeburn for gas-2.x and ECOFF support. @@ -2383,15 +2383,15 @@ emit_ustX (const expressionS *tok, newtok[2] = newtok[0]; assemble_tokens ("or", newtok, 3, 1); - /* Emit "stq_u $t9, 0($at)". */ - set_tok_reg (newtok[0], AXP_REG_T9); - set_tok_const (newtok[1], 0); - set_tok_preg (newtok[2], AXP_REG_AT); - assemble_tokens ("stq_u", newtok, 3, 1); - /* Emit "stq_u $t10, size-1($at)". */ set_tok_reg (newtok[0], AXP_REG_T10); set_tok_const (newtok[1], (1 << lgsize) - 1); + set_tok_preg (newtok[2], AXP_REG_AT); + assemble_tokens ("stq_u", newtok, 3, 1); + + /* Emit "stq_u $t9, 0($at)". */ + set_tok_reg (newtok[0], AXP_REG_T9); + set_tok_const (newtok[1], 0); assemble_tokens ("stq_u", newtok, 3, 1); } diff --git a/gas/config/tc-alpha.h b/gas/config/tc-alpha.h index 42e004e4148..d28ab9ff35a 100644 --- a/gas/config/tc-alpha.h +++ b/gas/config/tc-alpha.h @@ -1,6 +1,6 @@ /* This file is tc-alpha.h Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 - 2005 + 2005, 2006 Free Software Foundation, Inc. Written by Ken Raeburn . @@ -180,4 +180,4 @@ extern void alpha_cfi_frame_initial_instructions (void); #define DWARF2_LINE_MIN_INSN_LENGTH 4 #define DWARF2_DEFAULT_RETURN_COLUMN 26 -#define DWARF2_CIE_DATA_ALIGNMENT -8 +#define DWARF2_CIE_DATA_ALIGNMENT (-8) diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c index 525b54083fb..490f327efd4 100644 --- a/gas/config/tc-arc.c +++ b/gas/config/tc-arc.c @@ -20,8 +20,6 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include "libiberty.h" #include "as.h" #include "struc-symbol.h" #include "safe-ctype.h" diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index ae420b35347..ac88be63c45 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -1,6 +1,6 @@ /* tc-arm.c -- Assemble for the ARM Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005 + 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) Modified by David Taylor (dtaylor@armltd.co.uk) @@ -25,28 +25,24 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include +#include #define NO_RELOC 0 #include "as.h" #include "safe-ctype.h" - -/* Need TARGET_CPU. */ -#include "config.h" #include "subsegs.h" #include "obstack.h" -#include "symbols.h" -#include "listing.h" #include "opcode/arm.h" #ifdef OBJ_ELF #include "elf/arm.h" -#include "dwarf2dbg.h" #include "dw2gencfi.h" #endif -/* XXX Set this to 1 after the next binutils release. */ -#define WARN_DEPRECATED 0 +#include "dwarf2dbg.h" + +#define WARN_DEPRECATED 1 #ifdef OBJ_ELF /* Must be at least the size of the largest unwind opcode (currently two). */ @@ -90,6 +86,15 @@ static unsigned int marked_pr_dependency = 0; #endif /* OBJ_ELF */ +/* Results from operand parsing worker functions. */ + +typedef enum +{ + PARSE_OPERAND_SUCCESS, + PARSE_OPERAND_FAIL, + PARSE_OPERAND_FAIL_NO_BACKTRACK +} parse_operand_result; + enum arm_float_abi { ARM_FLOAT_ABI_HARD, @@ -150,11 +155,14 @@ static const arm_feature_set *mcpu_fpu_opt = NULL; static const arm_feature_set *march_cpu_opt = NULL; static const arm_feature_set *march_fpu_opt = NULL; static const arm_feature_set *mfpu_opt = NULL; +static const arm_feature_set *object_arch = NULL; /* Constants for known architecture features. */ static const arm_feature_set fpu_default = FPU_DEFAULT; static const arm_feature_set fpu_arch_vfp_v1 = FPU_ARCH_VFP_V1; static const arm_feature_set fpu_arch_vfp_v2 = FPU_ARCH_VFP_V2; +static const arm_feature_set fpu_arch_vfp_v3 = FPU_ARCH_VFP_V3; +static const arm_feature_set fpu_arch_neon_v1 = FPU_ARCH_NEON_V1; static const arm_feature_set fpu_arch_fpa = FPU_ARCH_FPA; static const arm_feature_set fpu_any_hard = FPU_ANY_HARD; static const arm_feature_set fpu_arch_maverick = FPU_ARCH_MAVERICK; @@ -194,6 +202,8 @@ static const arm_feature_set arm_arch_full = ARM_FEATURE (-1, -1); static const arm_feature_set arm_arch_t2 = ARM_ARCH_THUMB2; static const arm_feature_set arm_arch_none = ARM_ARCH_NONE; +static const arm_feature_set arm_cext_iwmmxt2 = + ARM_FEATURE (0, ARM_CEXT_IWMMXT2); static const arm_feature_set arm_cext_iwmmxt = ARM_FEATURE (0, ARM_CEXT_IWMMXT); static const arm_feature_set arm_cext_xscale = @@ -206,6 +216,10 @@ static const arm_feature_set fpu_vfp_ext_v1xd = ARM_FEATURE (0, FPU_VFP_EXT_V1xD); static const arm_feature_set fpu_vfp_ext_v1 = ARM_FEATURE (0, FPU_VFP_EXT_V1); static const arm_feature_set fpu_vfp_ext_v2 = ARM_FEATURE (0, FPU_VFP_EXT_V2); +static const arm_feature_set fpu_vfp_ext_v3 = ARM_FEATURE (0, FPU_VFP_EXT_V3); +static const arm_feature_set fpu_neon_ext_v1 = ARM_FEATURE (0, FPU_NEON_EXT_V1); +static const arm_feature_set fpu_vfp_v3_or_neon_ext = + ARM_FEATURE (0, FPU_NEON_EXT_V1 | FPU_VFP_EXT_V3); static int mfloat_abi_opt = -1; /* Record user cpu selection for object attributes. */ @@ -218,6 +232,12 @@ static int meabi_flags = EABI_DEFAULT; # else static int meabi_flags = EF_ARM_EABI_UNKNOWN; # endif + +bfd_boolean +arm_is_eabi(void) +{ + return (EF_ARM_EABI_VERSION (meabi_flags) >= EF_ARM_EABI_VER4); +} #endif #ifdef OBJ_ELF @@ -256,6 +276,31 @@ static int thumb_mode = 0; static bfd_boolean unified_syntax = FALSE; +enum neon_el_type +{ + NT_invtype, + NT_untyped, + NT_integer, + NT_float, + NT_poly, + NT_signed, + NT_unsigned +}; + +struct neon_type_el +{ + enum neon_el_type type; + unsigned size; +}; + +#define NEON_MAX_TYPE_ELS 4 + +struct neon_type +{ + struct neon_type_el el[NEON_MAX_TYPE_ELS]; + unsigned elems; +}; + struct arm_it { const char * error; @@ -263,6 +308,11 @@ struct arm_it int size; int size_req; int cond; + /* "uncond_value" is set to the value in place of the conditional field in + unconditional versions of the instruction, or -1 if nothing is + appropriate. */ + int uncond_value; + struct neon_type vectype; /* Set to the opcode if the instruction needs relaxation. Zero if the instruction is not relaxed. */ unsigned long relax; @@ -277,9 +327,19 @@ struct arm_it { unsigned reg; signed int imm; + struct neon_type_el vectype; unsigned present : 1; /* Operand present. */ unsigned isreg : 1; /* Operand was a register. */ unsigned immisreg : 1; /* .imm field is a second register. */ + unsigned isscalar : 1; /* Operand is a (Neon) scalar. */ + unsigned immisalign : 1; /* Immediate is an alignment specifier. */ + unsigned immisfloat : 1; /* Immediate was parsed as a float. */ + /* Note: we abuse "regisimm" to mean "is Neon register" in VMOV + instructions. This allows us to disambiguate ARM <-> vector insns. */ + unsigned regisimm : 1; /* 64-bit immediate, reg forms high 32 bits. */ + unsigned isvec : 1; /* Is a single, double or quad VFP/Neon reg. */ + unsigned isquad : 1; /* Operand is Neon quad-precision register. */ + unsigned issingle : 1; /* Operand is VFP single-precision register. */ unsigned hasreloc : 1; /* Operand has relocation suffix. */ unsigned writeback : 1; /* Operand has trailing ! */ unsigned preind : 1; /* Preindexed address. */ @@ -355,9 +415,10 @@ struct reloc_entry bfd_reloc_code_real_type reloc; }; -enum vfp_sp_reg_pos +enum vfp_reg_pos { - VFP_REG_Sd, VFP_REG_Sm, VFP_REG_Sn + VFP_REG_Sd, VFP_REG_Sm, VFP_REG_Sn, + VFP_REG_Dd, VFP_REG_Dm, VFP_REG_Dn }; enum vfp_ldstm_type @@ -365,6 +426,17 @@ enum vfp_ldstm_type VFP_LDSTMIA, VFP_LDSTMDB, VFP_LDSTMIAX, VFP_LDSTMDBX }; +/* Bits for DEFINED field in neon_typed_alias. */ +#define NTA_HASTYPE 1 +#define NTA_HASINDEX 2 + +struct neon_typed_alias +{ + unsigned char defined; + unsigned char index; + struct neon_type_el eltype; +}; + /* ARM register categories. This includes coprocessor numbers and various architecture extensions' registers. */ enum arm_reg_type @@ -375,6 +447,10 @@ enum arm_reg_type REG_TYPE_FN, REG_TYPE_VFS, REG_TYPE_VFD, + REG_TYPE_NQ, + REG_TYPE_VFSD, + REG_TYPE_NDQ, + REG_TYPE_NSDQ, REG_TYPE_VFC, REG_TYPE_MVF, REG_TYPE_MVD, @@ -388,13 +464,17 @@ enum arm_reg_type REG_TYPE_XSCALE, }; -/* Structure for a hash table entry for a register. */ +/* Structure for a hash table entry for a register. + If TYPE is REG_TYPE_VFD or REG_TYPE_NQ, the NEON field can point to extra + information which states whether a vector type or index is specified (for a + register alias created with .dn or .qn). Otherwise NEON should be NULL. */ struct reg_entry { - const char *name; - unsigned char number; - unsigned char type; - unsigned char builtin; + const char *name; + unsigned char number; + unsigned char type; + unsigned char builtin; + struct neon_typed_alias *neon; }; /* Diagnostics used when we don't get a register of the expected type. */ @@ -405,7 +485,11 @@ const char *const reg_expected_msgs[] = N_("co-processor register expected"), N_("FPA register expected"), N_("VFP single precision register expected"), - N_("VFP double precision register expected"), + N_("VFP/Neon double precision register expected"), + N_("Neon quad precision register expected"), + N_("VFP single or double precision register expected"), + N_("Neon double or quad precision register expected"), + N_("VFP single, double or Neon quad precision register expected"), N_("VFP system register expected"), N_("Maverick MVF register expected"), N_("Maverick MVD register expected"), @@ -465,11 +549,14 @@ struct asm_opcode #define INDEX_UP 0x00800000 #define WRITE_BACK 0x00200000 #define LDM_TYPE_2_OR_3 0x00400000 +#define CPSI_MMOD 0x00020000 #define LITERAL_MASK 0xf000f000 #define OPCODE_MASK 0xfe1fffff #define V4_STR_BIT 0x00000020 +#define T2_SUBS_PC_LR 0xf3de8f00 + #define DATA_OP_SHIFT 21 #define T2_OPCODE_MASK 0xfe1fffff @@ -571,6 +658,7 @@ struct asm_opcode #define BAD_ADDR_MODE _("instruction does not accept this addressing mode"); #define BAD_BRANCH _("branch must be last instruction in IT block") #define BAD_NOT_IT _("instruction not allowed in IT block") +#define BAD_FPU _("selected FPU does not support instruction") static struct hash_control *arm_ops_hsh; static struct hash_control *arm_cond_hsh; @@ -691,6 +779,9 @@ static int in_my_get_expression = 0; #define GE_NO_PREFIX 0 #define GE_IMM_PREFIX 1 #define GE_OPT_PREFIX 2 +/* This is a bit of a hack. Use an optional prefix, and also allow big (64-bit) + immediates, as can be used in Neon VMVN and VMOV immediate instructions. */ +#define GE_OPT_PREFIX_BIG 3 static int my_get_expression (expressionS * ep, char ** str, int prefix_mode) @@ -700,7 +791,8 @@ my_get_expression (expressionS * ep, char ** str, int prefix_mode) /* In unified syntax, all prefixes are optional. */ if (unified_syntax) - prefix_mode = GE_OPT_PREFIX; + prefix_mode = (prefix_mode == GE_OPT_PREFIX_BIG) ? prefix_mode + : GE_OPT_PREFIX; switch (prefix_mode) { @@ -714,6 +806,7 @@ my_get_expression (expressionS * ep, char ** str, int prefix_mode) (*str)++; break; case GE_OPT_PREFIX: + case GE_OPT_PREFIX_BIG: if (is_immediate_prefix (**str)) (*str)++; break; @@ -755,11 +848,12 @@ my_get_expression (expressionS * ep, char ** str, int prefix_mode) /* Get rid of any bignums now, so that we don't generate an error for which we can't establish a line number later on. Big numbers are never valid in instructions, which is where this routine is always called. */ - if (ep->X_op == O_big - || (ep->X_add_symbol - && (walk_no_bignums (ep->X_add_symbol) - || (ep->X_op_symbol - && walk_no_bignums (ep->X_op_symbol))))) + if (prefix_mode != GE_OPT_PREFIX_BIG + && (ep->X_op == O_big + || (ep->X_add_symbol + && (walk_no_bignums (ep->X_add_symbol) + || (ep->X_op_symbol + && walk_no_bignums (ep->X_op_symbol)))))) { inst.error = _("invalid constant"); *str = input_line_pointer; @@ -939,18 +1033,10 @@ arm_reg_parse_multi (char **ccp) return reg; } -/* As above, but the register must be of type TYPE, and the return - value is the register number or FAIL. */ - static int -arm_reg_parse (char **ccp, enum arm_reg_type type) +arm_reg_alt_syntax (char **ccp, char *start, struct reg_entry *reg, + enum arm_reg_type type) { - char *start = *ccp; - struct reg_entry *reg = arm_reg_parse_multi (ccp); - - if (reg && reg->type == type) - return reg->number; - /* Alternative syntaxes are accepted for a few register classes. */ switch (type) { @@ -982,10 +1068,354 @@ arm_reg_parse (char **ccp, enum arm_reg_type type) break; } + return FAIL; +} + +/* As arm_reg_parse_multi, but the register must be of type TYPE, and the + return value is the register number or FAIL. */ + +static int +arm_reg_parse (char **ccp, enum arm_reg_type type) +{ + char *start = *ccp; + struct reg_entry *reg = arm_reg_parse_multi (ccp); + int ret; + + /* Do not allow a scalar (reg+index) to parse as a register. */ + if (reg && reg->neon && (reg->neon->defined & NTA_HASINDEX)) + return FAIL; + + if (reg && reg->type == type) + return reg->number; + + if ((ret = arm_reg_alt_syntax (ccp, start, reg, type)) != FAIL) + return ret; + *ccp = start; return FAIL; } +/* Parse a Neon type specifier. *STR should point at the leading '.' + character. Does no verification at this stage that the type fits the opcode + properly. E.g., + + .i32.i32.s16 + .s32.f32 + .u16 + + Can all be legally parsed by this function. + + Fills in neon_type struct pointer with parsed information, and updates STR + to point after the parsed type specifier. Returns SUCCESS if this was a legal + type, FAIL if not. */ + +static int +parse_neon_type (struct neon_type *type, char **str) +{ + char *ptr = *str; + + if (type) + type->elems = 0; + + while (type->elems < NEON_MAX_TYPE_ELS) + { + enum neon_el_type thistype = NT_untyped; + unsigned thissize = -1u; + + if (*ptr != '.') + break; + + ptr++; + + /* Just a size without an explicit type. */ + if (ISDIGIT (*ptr)) + goto parsesize; + + switch (TOLOWER (*ptr)) + { + case 'i': thistype = NT_integer; break; + case 'f': thistype = NT_float; break; + case 'p': thistype = NT_poly; break; + case 's': thistype = NT_signed; break; + case 'u': thistype = NT_unsigned; break; + case 'd': + thistype = NT_float; + thissize = 64; + ptr++; + goto done; + default: + as_bad (_("unexpected character `%c' in type specifier"), *ptr); + return FAIL; + } + + ptr++; + + /* .f is an abbreviation for .f32. */ + if (thistype == NT_float && !ISDIGIT (*ptr)) + thissize = 32; + else + { + parsesize: + thissize = strtoul (ptr, &ptr, 10); + + if (thissize != 8 && thissize != 16 && thissize != 32 + && thissize != 64) + { + as_bad (_("bad size %d in type specifier"), thissize); + return FAIL; + } + } + + done: + if (type) + { + type->el[type->elems].type = thistype; + type->el[type->elems].size = thissize; + type->elems++; + } + } + + /* Empty/missing type is not a successful parse. */ + if (type->elems == 0) + return FAIL; + + *str = ptr; + + return SUCCESS; +} + +/* Errors may be set multiple times during parsing or bit encoding + (particularly in the Neon bits), but usually the earliest error which is set + will be the most meaningful. Avoid overwriting it with later (cascading) + errors by calling this function. */ + +static void +first_error (const char *err) +{ + if (!inst.error) + inst.error = err; +} + +/* Parse a single type, e.g. ".s32", leading period included. */ +static int +parse_neon_operand_type (struct neon_type_el *vectype, char **ccp) +{ + char *str = *ccp; + struct neon_type optype; + + if (*str == '.') + { + if (parse_neon_type (&optype, &str) == SUCCESS) + { + if (optype.elems == 1) + *vectype = optype.el[0]; + else + { + first_error (_("only one type should be specified for operand")); + return FAIL; + } + } + else + { + first_error (_("vector type expected")); + return FAIL; + } + } + else + return FAIL; + + *ccp = str; + + return SUCCESS; +} + +/* Special meanings for indices (which have a range of 0-7), which will fit into + a 4-bit integer. */ + +#define NEON_ALL_LANES 15 +#define NEON_INTERLEAVE_LANES 14 + +/* Parse either a register or a scalar, with an optional type. Return the + register number, and optionally fill in the actual type of the register + when multiple alternatives were given (NEON_TYPE_NDQ) in *RTYPE, and + type/index information in *TYPEINFO. */ + +static int +parse_typed_reg_or_scalar (char **ccp, enum arm_reg_type type, + enum arm_reg_type *rtype, + struct neon_typed_alias *typeinfo) +{ + char *str = *ccp; + struct reg_entry *reg = arm_reg_parse_multi (&str); + struct neon_typed_alias atype; + struct neon_type_el parsetype; + + atype.defined = 0; + atype.index = -1; + atype.eltype.type = NT_invtype; + atype.eltype.size = -1; + + /* Try alternate syntax for some types of register. Note these are mutually + exclusive with the Neon syntax extensions. */ + if (reg == NULL) + { + int altreg = arm_reg_alt_syntax (&str, *ccp, reg, type); + if (altreg != FAIL) + *ccp = str; + if (typeinfo) + *typeinfo = atype; + return altreg; + } + + /* Undo polymorphism when a set of register types may be accepted. */ + if ((type == REG_TYPE_NDQ + && (reg->type == REG_TYPE_NQ || reg->type == REG_TYPE_VFD)) + || (type == REG_TYPE_VFSD + && (reg->type == REG_TYPE_VFS || reg->type == REG_TYPE_VFD)) + || (type == REG_TYPE_NSDQ + && (reg->type == REG_TYPE_VFS || reg->type == REG_TYPE_VFD + || reg->type == REG_TYPE_NQ)) + || (type == REG_TYPE_MMXWC + && (reg->type == REG_TYPE_MMXWCG))) + type = reg->type; + + if (type != reg->type) + return FAIL; + + if (reg->neon) + atype = *reg->neon; + + if (parse_neon_operand_type (&parsetype, &str) == SUCCESS) + { + if ((atype.defined & NTA_HASTYPE) != 0) + { + first_error (_("can't redefine type for operand")); + return FAIL; + } + atype.defined |= NTA_HASTYPE; + atype.eltype = parsetype; + } + + if (skip_past_char (&str, '[') == SUCCESS) + { + if (type != REG_TYPE_VFD) + { + first_error (_("only D registers may be indexed")); + return FAIL; + } + + if ((atype.defined & NTA_HASINDEX) != 0) + { + first_error (_("can't change index for operand")); + return FAIL; + } + + atype.defined |= NTA_HASINDEX; + + if (skip_past_char (&str, ']') == SUCCESS) + atype.index = NEON_ALL_LANES; + else + { + expressionS exp; + + my_get_expression (&exp, &str, GE_NO_PREFIX); + + if (exp.X_op != O_constant) + { + first_error (_("constant expression required")); + return FAIL; + } + + if (skip_past_char (&str, ']') == FAIL) + return FAIL; + + atype.index = exp.X_add_number; + } + } + + if (typeinfo) + *typeinfo = atype; + + if (rtype) + *rtype = type; + + *ccp = str; + + return reg->number; +} + +/* Like arm_reg_parse, but allow allow the following extra features: + - If RTYPE is non-zero, return the (possibly restricted) type of the + register (e.g. Neon double or quad reg when either has been requested). + - If this is a Neon vector type with additional type information, fill + in the struct pointed to by VECTYPE (if non-NULL). + This function will fault on encountering a scalar. +*/ + +static int +arm_typed_reg_parse (char **ccp, enum arm_reg_type type, + enum arm_reg_type *rtype, struct neon_type_el *vectype) +{ + struct neon_typed_alias atype; + char *str = *ccp; + int reg = parse_typed_reg_or_scalar (&str, type, rtype, &atype); + + if (reg == FAIL) + return FAIL; + + /* Do not allow a scalar (reg+index) to parse as a register. */ + if ((atype.defined & NTA_HASINDEX) != 0) + { + first_error (_("register operand expected, but got scalar")); + return FAIL; + } + + if (vectype) + *vectype = atype.eltype; + + *ccp = str; + + return reg; +} + +#define NEON_SCALAR_REG(X) ((X) >> 4) +#define NEON_SCALAR_INDEX(X) ((X) & 15) + +/* Parse a Neon scalar. Most of the time when we're parsing a scalar, we don't + have enough information to be able to do a good job bounds-checking. So, we + just do easy checks here, and do further checks later. */ + +static int +parse_scalar (char **ccp, int elsize, struct neon_type_el *type) +{ + int reg; + char *str = *ccp; + struct neon_typed_alias atype; + + reg = parse_typed_reg_or_scalar (&str, REG_TYPE_VFD, NULL, &atype); + + if (reg == FAIL || (atype.defined & NTA_HASINDEX) == 0) + return FAIL; + + if (atype.index == NEON_ALL_LANES) + { + first_error (_("scalar must have an index")); + return FAIL; + } + else if (atype.index >= 64 / elsize) + { + first_error (_("scalar index out of range")); + return FAIL; + } + + if (type) + *type = atype.eltype; + + *ccp = str; + + return reg * 16 + atype.index; +} + /* Parse an ARM register list. Returns the bitmask, or FAIL. */ static long parse_reg_list (char ** strp) @@ -1011,7 +1441,7 @@ parse_reg_list (char ** strp) if ((reg = arm_reg_parse (&str, REG_TYPE_RN)) == FAIL) { - inst.error = _(reg_expected_msgs[REG_TYPE_RN]); + first_error (_(reg_expected_msgs[REG_TYPE_RN])); return FAIL; } @@ -1021,7 +1451,7 @@ parse_reg_list (char ** strp) if (reg <= cur_reg) { - inst.error = _("bad range in register list"); + first_error (_("bad range in register list")); return FAIL; } @@ -1052,7 +1482,7 @@ parse_reg_list (char ** strp) if (*str++ != '}') { - inst.error = _("missing `}'"); + first_error (_("missing `}'")); return FAIL; } } @@ -1111,55 +1541,117 @@ parse_reg_list (char ** strp) return range; } +/* Types of registers in a list. */ + +enum reg_list_els +{ + REGLIST_VFP_S, + REGLIST_VFP_D, + REGLIST_NEON_D +}; + /* Parse a VFP register list. If the string is invalid return FAIL. Otherwise return the number of registers, and set PBASE to the first - register. Double precision registers are matched if DP is nonzero. */ + register. Parses registers of type ETYPE. + If REGLIST_NEON_D is used, several syntax enhancements are enabled: + - Q registers can be used to specify pairs of D registers + - { } can be omitted from around a singleton register list + FIXME: This is not implemented, as it would require backtracking in + some cases, e.g.: + vtbl.8 d3,d4,d5 + This could be done (the meaning isn't really ambiguous), but doesn't + fit in well with the current parsing framework. + - 32 D registers may be used (also true for VFPv3). + FIXME: Types are ignored in these register lists, which is probably a + bug. */ static int -parse_vfp_reg_list (char **str, unsigned int *pbase, int dp) +parse_vfp_reg_list (char **ccp, unsigned int *pbase, enum reg_list_els etype) { + char *str = *ccp; int base_reg; int new_base; - int regtype; - int max_regs; + enum arm_reg_type regtype = 0; + int max_regs = 0; int count = 0; int warned = 0; unsigned long mask = 0; int i; - if (**str != '{') - return FAIL; - - (*str)++; - - if (dp) + if (*str != '{') { - regtype = REG_TYPE_VFD; - max_regs = 16; + inst.error = _("expecting {"); + return FAIL; } - else + + str++; + + switch (etype) { + case REGLIST_VFP_S: regtype = REG_TYPE_VFS; max_regs = 32; + break; + + case REGLIST_VFP_D: + regtype = REG_TYPE_VFD; + break; + + case REGLIST_NEON_D: + regtype = REG_TYPE_NDQ; + break; + } + + if (etype != REGLIST_VFP_S) + { + /* VFPv3 allows 32 D registers. */ + if (ARM_CPU_HAS_FEATURE (cpu_variant, fpu_vfp_ext_v3)) + { + max_regs = 32; + if (thumb_mode) + ARM_MERGE_FEATURE_SETS (thumb_arch_used, thumb_arch_used, + fpu_vfp_ext_v3); + else + ARM_MERGE_FEATURE_SETS (arm_arch_used, arm_arch_used, + fpu_vfp_ext_v3); + } + else + max_regs = 16; } base_reg = max_regs; do { - new_base = arm_reg_parse (str, regtype); + int setmask = 1, addregs = 1; + + new_base = arm_typed_reg_parse (&str, regtype, ®type, NULL); + if (new_base == FAIL) { - inst.error = gettext (reg_expected_msgs[regtype]); + first_error (_(reg_expected_msgs[regtype])); return FAIL; } + + if (new_base >= max_regs) + { + first_error (_("register out of range in list")); + return FAIL; + } + + /* Note: a value of 2 * n is returned for the register Q. */ + if (regtype == REG_TYPE_NQ) + { + setmask = 3; + addregs = 2; + } if (new_base < base_reg) base_reg = new_base; - if (mask & (1 << new_base)) + if (mask & (setmask << new_base)) { - inst.error = _("invalid register list"); + first_error (_("invalid register list")); return FAIL; } @@ -1169,43 +1661,53 @@ parse_vfp_reg_list (char **str, unsigned int *pbase, int dp) warned = 1; } - mask |= 1 << new_base; - count++; + mask |= setmask << new_base; + count += addregs; - if (**str == '-') /* We have the start of a range expression */ + if (*str == '-') /* We have the start of a range expression */ { int high_range; - (*str)++; + str++; - if ((high_range = arm_reg_parse (str, regtype)) == FAIL) + if ((high_range = arm_typed_reg_parse (&str, regtype, NULL, NULL)) + == FAIL) { inst.error = gettext (reg_expected_msgs[regtype]); return FAIL; } + if (high_range >= max_regs) + { + first_error (_("register out of range in list")); + return FAIL; + } + + if (regtype == REG_TYPE_NQ) + high_range = high_range + 1; + if (high_range <= new_base) { inst.error = _("register range not in ascending order"); return FAIL; } - for (new_base++; new_base <= high_range; new_base++) + for (new_base += addregs; new_base <= high_range; new_base += addregs) { - if (mask & (1 << new_base)) + if (mask & (setmask << new_base)) { inst.error = _("invalid register list"); return FAIL; } - mask |= 1 << new_base; - count++; + mask |= setmask << new_base; + count += addregs; } } } - while (skip_past_comma (str) != FAIL); + while (skip_past_comma (&str) != FAIL); - (*str)++; + str++; /* Sanity check -- should have raised a parse error above. */ if (count == 0 || count > max_regs) @@ -1224,9 +1726,204 @@ parse_vfp_reg_list (char **str, unsigned int *pbase, int dp) } } + *ccp = str; + return count; } +/* True if two alias types are the same. */ + +static int +neon_alias_types_same (struct neon_typed_alias *a, struct neon_typed_alias *b) +{ + if (!a && !b) + return 1; + + if (!a || !b) + return 0; + + if (a->defined != b->defined) + return 0; + + if ((a->defined & NTA_HASTYPE) != 0 + && (a->eltype.type != b->eltype.type + || a->eltype.size != b->eltype.size)) + return 0; + + if ((a->defined & NTA_HASINDEX) != 0 + && (a->index != b->index)) + return 0; + + return 1; +} + +/* Parse element/structure lists for Neon VLD and VST instructions. + The base register is put in *PBASE. + The lane (or one of the NEON_*_LANES constants) is placed in bits [3:0] of + the return value. + The register stride (minus one) is put in bit 4 of the return value. + Bits [6:5] encode the list length (minus one). + The type of the list elements is put in *ELTYPE, if non-NULL. */ + +#define NEON_LANE(X) ((X) & 0xf) +#define NEON_REG_STRIDE(X) ((((X) >> 4) & 1) + 1) +#define NEON_REGLIST_LENGTH(X) ((((X) >> 5) & 3) + 1) + +static int +parse_neon_el_struct_list (char **str, unsigned *pbase, + struct neon_type_el *eltype) +{ + char *ptr = *str; + int base_reg = -1; + int reg_incr = -1; + int count = 0; + int lane = -1; + int leading_brace = 0; + enum arm_reg_type rtype = REG_TYPE_NDQ; + int addregs = 1; + const char *const incr_error = "register stride must be 1 or 2"; + const char *const type_error = "mismatched element/structure types in list"; + struct neon_typed_alias firsttype; + + if (skip_past_char (&ptr, '{') == SUCCESS) + leading_brace = 1; + + do + { + struct neon_typed_alias atype; + int getreg = parse_typed_reg_or_scalar (&ptr, rtype, &rtype, &atype); + + if (getreg == FAIL) + { + first_error (_(reg_expected_msgs[rtype])); + return FAIL; + } + + if (base_reg == -1) + { + base_reg = getreg; + if (rtype == REG_TYPE_NQ) + { + reg_incr = 1; + addregs = 2; + } + firsttype = atype; + } + else if (reg_incr == -1) + { + reg_incr = getreg - base_reg; + if (reg_incr < 1 || reg_incr > 2) + { + first_error (_(incr_error)); + return FAIL; + } + } + else if (getreg != base_reg + reg_incr * count) + { + first_error (_(incr_error)); + return FAIL; + } + + if (!neon_alias_types_same (&atype, &firsttype)) + { + first_error (_(type_error)); + return FAIL; + } + + /* Handle Dn-Dm or Qn-Qm syntax. Can only be used with non-indexed list + modes. */ + if (ptr[0] == '-') + { + struct neon_typed_alias htype; + int hireg, dregs = (rtype == REG_TYPE_NQ) ? 2 : 1; + if (lane == -1) + lane = NEON_INTERLEAVE_LANES; + else if (lane != NEON_INTERLEAVE_LANES) + { + first_error (_(type_error)); + return FAIL; + } + if (reg_incr == -1) + reg_incr = 1; + else if (reg_incr != 1) + { + first_error (_("don't use Rn-Rm syntax with non-unit stride")); + return FAIL; + } + ptr++; + hireg = parse_typed_reg_or_scalar (&ptr, rtype, NULL, &htype); + if (hireg == FAIL) + { + first_error (_(reg_expected_msgs[rtype])); + return FAIL; + } + if (!neon_alias_types_same (&htype, &firsttype)) + { + first_error (_(type_error)); + return FAIL; + } + count += hireg + dregs - getreg; + continue; + } + + /* If we're using Q registers, we can't use [] or [n] syntax. */ + if (rtype == REG_TYPE_NQ) + { + count += 2; + continue; + } + + if ((atype.defined & NTA_HASINDEX) != 0) + { + if (lane == -1) + lane = atype.index; + else if (lane != atype.index) + { + first_error (_(type_error)); + return FAIL; + } + } + else if (lane == -1) + lane = NEON_INTERLEAVE_LANES; + else if (lane != NEON_INTERLEAVE_LANES) + { + first_error (_(type_error)); + return FAIL; + } + count++; + } + while ((count != 1 || leading_brace) && skip_past_comma (&ptr) != FAIL); + + /* No lane set by [x]. We must be interleaving structures. */ + if (lane == -1) + lane = NEON_INTERLEAVE_LANES; + + /* Sanity check. */ + if (lane == -1 || base_reg == -1 || count < 1 || count > 4 + || (count > 1 && reg_incr == -1)) + { + first_error (_("error parsing element/structure list")); + return FAIL; + } + + if ((count > 1 || leading_brace) && skip_past_char (&ptr, '}') == FAIL) + { + first_error (_("expected }")); + return FAIL; + } + + if (reg_incr == -1) + reg_incr = 1; + + if (eltype) + *eltype = firsttype.eltype; + + *pbase = base_reg; + *str = ptr; + + return lane | ((reg_incr - 1) << 4) | ((count - 1) << 5); +} + /* Parse an explicit relocation suffix on an expression. This is either nothing, or a word in parentheses. Note that if !OBJ_ELF, arm_reloc_hsh contains no entries, so this function can only @@ -1258,7 +1955,7 @@ parse_reloc (char **str) /* Directives: register aliases. */ -static void +static struct reg_entry * insert_reg_alias (char *str, int number, int type) { struct reg_entry *new; @@ -1274,7 +1971,7 @@ insert_reg_alias (char *str, int number, int type) else if (new->number != number || new->type != type) as_warn (_("ignoring redefinition of register alias '%s'"), str); - return; + return 0; } name = xstrdup (str); @@ -1284,9 +1981,31 @@ insert_reg_alias (char *str, int number, int type) new->number = number; new->type = type; new->builtin = FALSE; + new->neon = NULL; if (hash_insert (arm_reg_hsh, name, (PTR) new)) abort (); + + return new; +} + +static void +insert_neon_reg_alias (char *str, int number, int type, + struct neon_typed_alias *atype) +{ + struct reg_entry *reg = insert_reg_alias (str, number, type); + + if (!reg) + { + first_error (_("attempt to redefine typed alias")); + return; + } + + if (atype) + { + reg->neon = xmalloc (sizeof (struct neon_typed_alias)); + *reg->neon = *atype; + } } /* Look for the .req directive. This is of the form: @@ -1354,6 +2073,148 @@ create_register_alias (char * newname, char *p) return 1; } +/* Create a Neon typed/indexed register alias using directives, e.g.: + X .dn d5.s32[1] + Y .qn 6.s16 + Z .dn d7 + T .dn Z[0] + These typed registers can be used instead of the types specified after the + Neon mnemonic, so long as all operands given have types. Types can also be + specified directly, e.g.: + vadd d0.s32, d1.s32, d2.s32 +*/ + +static int +create_neon_reg_alias (char *newname, char *p) +{ + enum arm_reg_type basetype; + struct reg_entry *basereg; + struct reg_entry mybasereg; + struct neon_type ntype; + struct neon_typed_alias typeinfo; + char *namebuf, *nameend; + int namelen; + + typeinfo.defined = 0; + typeinfo.eltype.type = NT_invtype; + typeinfo.eltype.size = -1; + typeinfo.index = -1; + + nameend = p; + + if (strncmp (p, " .dn ", 5) == 0) + basetype = REG_TYPE_VFD; + else if (strncmp (p, " .qn ", 5) == 0) + basetype = REG_TYPE_NQ; + else + return 0; + + p += 5; + + if (*p == '\0') + return 0; + + basereg = arm_reg_parse_multi (&p); + + if (basereg && basereg->type != basetype) + { + as_bad (_("bad type for register")); + return 0; + } + + if (basereg == NULL) + { + expressionS exp; + /* Try parsing as an integer. */ + my_get_expression (&exp, &p, GE_NO_PREFIX); + if (exp.X_op != O_constant) + { + as_bad (_("expression must be constant")); + return 0; + } + basereg = &mybasereg; + basereg->number = (basetype == REG_TYPE_NQ) ? exp.X_add_number * 2 + : exp.X_add_number; + basereg->neon = 0; + } + + if (basereg->neon) + typeinfo = *basereg->neon; + + if (parse_neon_type (&ntype, &p) == SUCCESS) + { + /* We got a type. */ + if (typeinfo.defined & NTA_HASTYPE) + { + as_bad (_("can't redefine the type of a register alias")); + return 0; + } + + typeinfo.defined |= NTA_HASTYPE; + if (ntype.elems != 1) + { + as_bad (_("you must specify a single type only")); + return 0; + } + typeinfo.eltype = ntype.el[0]; + } + + if (skip_past_char (&p, '[') == SUCCESS) + { + expressionS exp; + /* We got a scalar index. */ + + if (typeinfo.defined & NTA_HASINDEX) + { + as_bad (_("can't redefine the index of a scalar alias")); + return 0; + } + + my_get_expression (&exp, &p, GE_NO_PREFIX); + + if (exp.X_op != O_constant) + { + as_bad (_("scalar index must be constant")); + return 0; + } + + typeinfo.defined |= NTA_HASINDEX; + typeinfo.index = exp.X_add_number; + + if (skip_past_char (&p, ']') == FAIL) + { + as_bad (_("expecting ]")); + return 0; + } + } + + namelen = nameend - newname; + namebuf = alloca (namelen + 1); + strncpy (namebuf, newname, namelen); + namebuf[namelen] = '\0'; + + insert_neon_reg_alias (namebuf, basereg->number, basetype, + typeinfo.defined != 0 ? &typeinfo : NULL); + + /* Insert name in all uppercase. */ + for (p = namebuf; *p; p++) + *p = TOUPPER (*p); + + if (strncmp (namebuf, newname, namelen)) + insert_neon_reg_alias (namebuf, basereg->number, basetype, + typeinfo.defined != 0 ? &typeinfo : NULL); + + /* Insert name in all lowercase. */ + for (p = namebuf; *p; p++) + *p = TOLOWER (*p); + + if (strncmp (namebuf, newname, namelen)) + insert_neon_reg_alias (namebuf, basereg->number, basetype, + typeinfo.defined != 0 ? &typeinfo : NULL); + + return 1; +} + /* Should never be called, as .req goes between the alias and the register name, not at the beginning of the line. */ static void @@ -1362,6 +2223,18 @@ s_req (int a ATTRIBUTE_UNUSED) as_bad (_("invalid syntax for .req directive")); } +static void +s_dn (int a ATTRIBUTE_UNUSED) +{ + as_bad (_("invalid syntax for .dn directive")); +} + +static void +s_qn (int a ATTRIBUTE_UNUSED) +{ + as_bad (_("invalid syntax for .qn directive")); +} + /* The .unreq directive deletes an alias which was previously defined by .req. For example: @@ -1399,6 +2272,8 @@ s_unreq (int a ATTRIBUTE_UNUSED) { hash_delete (arm_reg_hsh, name); free ((char *) reg->name); + if (reg->neon) + free (reg->neon); free (reg); } } @@ -1417,7 +2292,7 @@ s_unreq (int a ATTRIBUTE_UNUSED) static enum mstate mapstate = MAP_UNDEFINED; -static void +void mapping_state (enum mstate state) { symbolS * symbolP; @@ -1738,6 +2613,7 @@ static void s_align (int unused ATTRIBUTE_UNUSED) { int temp; + bfd_boolean fill_p; long temp_fill; long max_alignment = 15; @@ -1754,16 +2630,25 @@ s_align (int unused ATTRIBUTE_UNUSED) { input_line_pointer++; temp_fill = get_absolute_expression (); + fill_p = TRUE; } else - temp_fill = 0; + { + fill_p = FALSE; + temp_fill = 0; + } if (!temp) temp = 2; /* Only make a frag if we HAVE to. */ if (temp && !need_pass_2) - frag_align (temp, (int) temp_fill, 0); + { + if (!fill_p && subseg_text_p (now_seg)) + frag_align_code (temp, 0); + else + frag_align (temp, (int) temp_fill, 0); + } demand_empty_rest_of_line (); record_alignment (now_seg, temp); @@ -2414,7 +3299,57 @@ s_arm_unwind_save_fpa (int reg) } -/* Parse a directive saving VFP registers. */ +/* Parse a directive saving VFP registers for ARMv6 and above. */ + +static void +s_arm_unwind_save_vfp_armv6 (void) +{ + int count; + unsigned int start; + valueT op; + int num_vfpv3_regs = 0; + int num_regs_below_16; + + count = parse_vfp_reg_list (&input_line_pointer, &start, REGLIST_VFP_D); + if (count == FAIL) + { + as_bad (_("expected register list")); + ignore_rest_of_line (); + return; + } + + demand_empty_rest_of_line (); + + /* We always generate FSTMD/FLDMD-style unwinding opcodes (rather + than FSTMX/FLDMX-style ones). */ + + /* Generate opcode for (VFPv3) registers numbered in the range 16 .. 31. */ + if (start >= 16) + num_vfpv3_regs = count; + else if (start + count > 16) + num_vfpv3_regs = start + count - 16; + + if (num_vfpv3_regs > 0) + { + int start_offset = start > 16 ? start - 16 : 0; + op = 0xc800 | (start_offset << 4) | (num_vfpv3_regs - 1); + add_unwind_opcode (op, 2); + } + + /* Generate opcode for registers numbered in the range 0 .. 15. */ + num_regs_below_16 = num_vfpv3_regs > 0 ? 16 - (int) start : count; + assert (num_regs_below_16 + num_vfpv3_regs == count); + if (num_regs_below_16 > 0) + { + op = 0xc900 | (start << 4) | (num_regs_below_16 - 1); + add_unwind_opcode (op, 2); + } + + unwind.frame_size += count * 8; +} + + +/* Parse a directive saving VFP registers for pre-ARMv6. */ static void s_arm_unwind_save_vfp (void) @@ -2423,7 +3358,7 @@ s_arm_unwind_save_vfp (void) unsigned int reg; valueT op; - count = parse_vfp_reg_list (&input_line_pointer, ®, 1); + count = parse_vfp_reg_list (&input_line_pointer, ®, REGLIST_VFP_D); if (count == FAIL) { as_bad (_("expected register list")); @@ -2502,7 +3437,7 @@ s_arm_unwind_save_mmxwr (void) demand_empty_rest_of_line (); - /* Generate any deferred opcodes becuuse we're going to be looking at + /* Generate any deferred opcodes because we're going to be looking at the list. */ flush_pending_unwind (); @@ -2538,7 +3473,7 @@ s_arm_unwind_save_mmxwr (void) op = 0xffff << (reg - 1); if (reg > 0 - || ((mask & op) == (1u << (reg - 1)))) + && ((mask & op) == (1u << (reg - 1)))) { op = (1 << (reg + i + 1)) - 1; op &= ~((1 << reg) - 1); @@ -2635,7 +3570,7 @@ s_arm_unwind_save_mmxwcg (void) demand_empty_rest_of_line (); - /* Generate any deferred opcodes becuuse we're going to be looking at + /* Generate any deferred opcodes because we're going to be looking at the list. */ flush_pending_unwind (); @@ -2652,10 +3587,11 @@ error: } -/* Parse an unwind_save directive. */ +/* Parse an unwind_save directive. + If the argument is non-zero, this is a .vsave directive. */ static void -s_arm_unwind_save (int ignored ATTRIBUTE_UNUSED) +s_arm_unwind_save (int arch_v6) { char *peek; struct reg_entry *reg; @@ -2692,7 +3628,12 @@ s_arm_unwind_save (int ignored ATTRIBUTE_UNUSED) return; case REG_TYPE_RN: s_arm_unwind_save_core (); return; - case REG_TYPE_VFD: s_arm_unwind_save_vfp (); return; + case REG_TYPE_VFD: + if (arch_v6) + s_arm_unwind_save_vfp_armv6 (); + else + s_arm_unwind_save_vfp (); + return; case REG_TYPE_MMXWR: s_arm_unwind_save_mmxwr (); return; case REG_TYPE_MMXWCG: s_arm_unwind_save_mmxwcg (); return; @@ -2710,6 +3651,7 @@ s_arm_unwind_movsp (int ignored ATTRIBUTE_UNUSED) { int reg; valueT op; + int offset; reg = arm_reg_parse (&input_line_pointer, REG_TYPE_RN); if (reg == FAIL) @@ -2718,6 +3660,16 @@ s_arm_unwind_movsp (int ignored ATTRIBUTE_UNUSED) ignore_rest_of_line (); return; } + + /* Optional constant. */ + if (skip_past_comma (&input_line_pointer) != FAIL) + { + if (immediate_for_directive (&offset) == FAIL) + return; + } + else + offset = 0; + demand_empty_rest_of_line (); if (reg == REG_SP || reg == REG_PC) @@ -2735,7 +3687,7 @@ s_arm_unwind_movsp (int ignored ATTRIBUTE_UNUSED) /* Record the information for later. */ unwind.fp_reg = reg; - unwind.fp_offset = unwind.frame_size; + unwind.fp_offset = unwind.frame_size - offset; unwind.sp_restored = 1; } @@ -2818,7 +3770,7 @@ static void s_arm_unwind_raw (int ignored ATTRIBUTE_UNUSED) { expressionS exp; - /* This is an arbitary limit. */ + /* This is an arbitrary limit. */ unsigned char op[16]; int count; @@ -2877,90 +3829,36 @@ s_arm_unwind_raw (int ignored ATTRIBUTE_UNUSED) static void s_arm_eabi_attribute (int ignored ATTRIBUTE_UNUSED) { - expressionS exp; - bfd_boolean is_string; - int tag; - unsigned int i = 0; - char *s = NULL; - char saved_char; - - expression (& exp); - if (exp.X_op != O_constant) - goto bad; - - tag = exp.X_add_number; - if (tag == 4 || tag == 5 || tag == 32 || (tag > 32 && (tag & 1) != 0)) - is_string = 1; - else - is_string = 0; - - if (skip_past_comma (&input_line_pointer) == FAIL) - goto bad; - if (tag == 32 || !is_string) - { - expression (& exp); - if (exp.X_op != O_constant) - { - as_bad (_("expected numeric constant")); - ignore_rest_of_line (); - return; - } - i = exp.X_add_number; - } - if (tag == Tag_compatibility - && skip_past_comma (&input_line_pointer) == FAIL) - { - as_bad (_("expected comma")); - ignore_rest_of_line (); - return; - } - if (is_string) - { - skip_whitespace(input_line_pointer); - if (*input_line_pointer != '"') - goto bad_string; - input_line_pointer++; - s = input_line_pointer; - while (*input_line_pointer && *input_line_pointer != '"') - input_line_pointer++; - if (*input_line_pointer != '"') - goto bad_string; - saved_char = *input_line_pointer; - *input_line_pointer = 0; - } - else - { - s = NULL; - saved_char = 0; - } - - if (tag == Tag_compatibility) - elf32_arm_add_eabi_attr_compat (stdoutput, i, s); - else if (is_string) - elf32_arm_add_eabi_attr_string (stdoutput, tag, s); - else - elf32_arm_add_eabi_attr_int (stdoutput, tag, i); - - if (s) - { - *input_line_pointer = saved_char; - input_line_pointer++; - } - demand_empty_rest_of_line (); - return; -bad_string: - as_bad (_("bad string constant")); - ignore_rest_of_line (); - return; -bad: - as_bad (_("expected , ")); - ignore_rest_of_line (); + s_vendor_attribute (OBJ_ATTR_PROC); } +#endif /* OBJ_ELF */ static void s_arm_arch (int); +static void s_arm_object_arch (int); static void s_arm_cpu (int); static void s_arm_fpu (int); -#endif /* OBJ_ELF */ + +#ifdef TE_PE + +static void +pe_directive_secrel (int dummy ATTRIBUTE_UNUSED) +{ + expressionS exp; + + do + { + expression (&exp); + if (exp.X_op == O_symbol) + exp.X_op = O_secrel; + + emit_expr (&exp, 4); + } + while (*input_line_pointer++ == ','); + + input_line_pointer--; + demand_empty_rest_of_line (); +} +#endif /* TE_PE */ /* This table describes all the machine specific pseudo-ops the assembler has to support. The fields are: @@ -2972,6 +3870,9 @@ const pseudo_typeS md_pseudo_table[] = { /* Never called because '.req' does not start a line. */ { "req", s_req, 0 }, + /* Following two are likewise never called. */ + { "dn", s_dn, 0 }, + { "qn", s_qn, 0 }, { "unreq", s_unreq, 0 }, { "bss", s_bss, 0 }, { "align", s_align, 0 }, @@ -2985,6 +3886,10 @@ const pseudo_typeS md_pseudo_table[] = { "ltorg", s_ltorg, 0 }, { "pool", s_ltorg, 0 }, { "syntax", s_syntax, 0 }, + { "cpu", s_arm_cpu, 0 }, + { "arch", s_arm_arch, 0 }, + { "object_arch", s_arm_object_arch, 0 }, + { "fpu", s_arm_fpu, 0 }, #ifdef OBJ_ELF { "word", s_arm_elf_cons, 4 }, { "long", s_arm_elf_cons, 4 }, @@ -2996,20 +3901,30 @@ const pseudo_typeS md_pseudo_table[] = { "personalityindex", s_arm_unwind_personalityindex, 0 }, { "handlerdata", s_arm_unwind_handlerdata, 0 }, { "save", s_arm_unwind_save, 0 }, + { "vsave", s_arm_unwind_save, 1 }, { "movsp", s_arm_unwind_movsp, 0 }, { "pad", s_arm_unwind_pad, 0 }, { "setfp", s_arm_unwind_setfp, 0 }, { "unwind_raw", s_arm_unwind_raw, 0 }, - { "cpu", s_arm_cpu, 0 }, - { "arch", s_arm_arch, 0 }, - { "fpu", s_arm_fpu, 0 }, { "eabi_attribute", s_arm_eabi_attribute, 0 }, #else { "word", cons, 4}, + + /* These are used for dwarf. */ + {"2byte", cons, 2}, + {"4byte", cons, 4}, + {"8byte", cons, 8}, + /* These are used for dwarf2. */ + { "file", (void (*) (int)) dwarf2_directive_file, 0 }, + { "loc", dwarf2_directive_loc, 0 }, + { "loc_mark_labels", dwarf2_directive_loc_mark_labels, 0 }, #endif { "extend", float_cons, 'x' }, { "ldouble", float_cons, 'x' }, { "packed", float_cons, 'p' }, +#ifdef TE_PE + {"secrel32", pe_directive_secrel, 0}, +#endif { 0, 0, 0 } }; @@ -3043,6 +3958,58 @@ parse_immediate (char **str, int *val, int min, int max, return SUCCESS; } +/* Less-generic immediate-value read function with the possibility of loading a + big (64-bit) immediate, as required by Neon VMOV, VMVN and logic immediate + instructions. Puts the result directly in inst.operands[i]. */ + +static int +parse_big_immediate (char **str, int i) +{ + expressionS exp; + char *ptr = *str; + + my_get_expression (&exp, &ptr, GE_OPT_PREFIX_BIG); + + if (exp.X_op == O_constant) + { + inst.operands[i].imm = exp.X_add_number & 0xffffffff; + /* If we're on a 64-bit host, then a 64-bit number can be returned using + O_constant. We have to be careful not to break compilation for + 32-bit X_add_number, though. */ + if ((exp.X_add_number & ~0xffffffffl) != 0) + { + /* X >> 32 is illegal if sizeof (exp.X_add_number) == 4. */ + inst.operands[i].reg = ((exp.X_add_number >> 16) >> 16) & 0xffffffff; + inst.operands[i].regisimm = 1; + } + } + else if (exp.X_op == O_big + && LITTLENUM_NUMBER_OF_BITS * exp.X_add_number > 32 + && LITTLENUM_NUMBER_OF_BITS * exp.X_add_number <= 64) + { + unsigned parts = 32 / LITTLENUM_NUMBER_OF_BITS, j, idx = 0; + /* Bignums have their least significant bits in + generic_bignum[0]. Make sure we put 32 bits in imm and + 32 bits in reg, in a (hopefully) portable way. */ + assert (parts != 0); + inst.operands[i].imm = 0; + for (j = 0; j < parts; j++, idx++) + inst.operands[i].imm |= generic_bignum[idx] + << (LITTLENUM_NUMBER_OF_BITS * j); + inst.operands[i].reg = 0; + for (j = 0; j < parts; j++, idx++) + inst.operands[i].reg |= generic_bignum[idx] + << (LITTLENUM_NUMBER_OF_BITS * j); + inst.operands[i].regisimm = 1; + } + else + return FAIL; + + *str = ptr; + + return SUCCESS; +} + /* Returns the pseudo-register number of an FPA immediate constant, or FAIL if there isn't a valid constant here. */ @@ -3134,6 +4101,80 @@ parse_fpa_immediate (char ** str) return FAIL; } +/* Returns 1 if a number has "quarter-precision" float format + 0baBbbbbbc defgh000 00000000 00000000. */ + +static int +is_quarter_float (unsigned imm) +{ + int bs = (imm & 0x20000000) ? 0x3e000000 : 0x40000000; + return (imm & 0x7ffff) == 0 && ((imm & 0x7e000000) ^ bs) == 0; +} + +/* Parse an 8-bit "quarter-precision" floating point number of the form: + 0baBbbbbbc defgh000 00000000 00000000. + The zero and minus-zero cases need special handling, since they can't be + encoded in the "quarter-precision" float format, but can nonetheless be + loaded as integer constants. */ + +static unsigned +parse_qfloat_immediate (char **ccp, int *immed) +{ + char *str = *ccp; + char *fpnum; + LITTLENUM_TYPE words[MAX_LITTLENUMS]; + int found_fpchar = 0; + + skip_past_char (&str, '#'); + + /* We must not accidentally parse an integer as a floating-point number. Make + sure that the value we parse is not an integer by checking for special + characters '.' or 'e'. + FIXME: This is a horrible hack, but doing better is tricky because type + information isn't in a very usable state at parse time. */ + fpnum = str; + skip_whitespace (fpnum); + + if (strncmp (fpnum, "0x", 2) == 0) + return FAIL; + else + { + for (; *fpnum != '\0' && *fpnum != ' ' && *fpnum != '\n'; fpnum++) + if (*fpnum == '.' || *fpnum == 'e' || *fpnum == 'E') + { + found_fpchar = 1; + break; + } + + if (!found_fpchar) + return FAIL; + } + + if ((str = atof_ieee (str, 's', words)) != NULL) + { + unsigned fpword = 0; + int i; + + /* Our FP word must be 32 bits (single-precision FP). */ + for (i = 0; i < 32 / LITTLENUM_NUMBER_OF_BITS; i++) + { + fpword <<= LITTLENUM_NUMBER_OF_BITS; + fpword |= words[i]; + } + + if (is_quarter_float (fpword) || (fpword & 0x7fffffff) == 0) + *immed = fpword; + else + return FAIL; + + *ccp = str; + + return SUCCESS; + } + + return FAIL; +} + /* Shift operands. */ enum shift_kind { @@ -3317,6 +4358,168 @@ parse_shifter_operand (char **str, int i) return SUCCESS; } +/* Group relocation information. Each entry in the table contains the + textual name of the relocation as may appear in assembler source + and must end with a colon. + Along with this textual name are the relocation codes to be used if + the corresponding instruction is an ALU instruction (ADD or SUB only), + an LDR, an LDRS, or an LDC. */ + +struct group_reloc_table_entry +{ + const char *name; + int alu_code; + int ldr_code; + int ldrs_code; + int ldc_code; +}; + +typedef enum +{ + /* Varieties of non-ALU group relocation. */ + + GROUP_LDR, + GROUP_LDRS, + GROUP_LDC +} group_reloc_type; + +static struct group_reloc_table_entry group_reloc_table[] = + { /* Program counter relative: */ + { "pc_g0_nc", + BFD_RELOC_ARM_ALU_PC_G0_NC, /* ALU */ + 0, /* LDR */ + 0, /* LDRS */ + 0 }, /* LDC */ + { "pc_g0", + BFD_RELOC_ARM_ALU_PC_G0, /* ALU */ + BFD_RELOC_ARM_LDR_PC_G0, /* LDR */ + BFD_RELOC_ARM_LDRS_PC_G0, /* LDRS */ + BFD_RELOC_ARM_LDC_PC_G0 }, /* LDC */ + { "pc_g1_nc", + BFD_RELOC_ARM_ALU_PC_G1_NC, /* ALU */ + 0, /* LDR */ + 0, /* LDRS */ + 0 }, /* LDC */ + { "pc_g1", + BFD_RELOC_ARM_ALU_PC_G1, /* ALU */ + BFD_RELOC_ARM_LDR_PC_G1, /* LDR */ + BFD_RELOC_ARM_LDRS_PC_G1, /* LDRS */ + BFD_RELOC_ARM_LDC_PC_G1 }, /* LDC */ + { "pc_g2", + BFD_RELOC_ARM_ALU_PC_G2, /* ALU */ + BFD_RELOC_ARM_LDR_PC_G2, /* LDR */ + BFD_RELOC_ARM_LDRS_PC_G2, /* LDRS */ + BFD_RELOC_ARM_LDC_PC_G2 }, /* LDC */ + /* Section base relative */ + { "sb_g0_nc", + BFD_RELOC_ARM_ALU_SB_G0_NC, /* ALU */ + 0, /* LDR */ + 0, /* LDRS */ + 0 }, /* LDC */ + { "sb_g0", + BFD_RELOC_ARM_ALU_SB_G0, /* ALU */ + BFD_RELOC_ARM_LDR_SB_G0, /* LDR */ + BFD_RELOC_ARM_LDRS_SB_G0, /* LDRS */ + BFD_RELOC_ARM_LDC_SB_G0 }, /* LDC */ + { "sb_g1_nc", + BFD_RELOC_ARM_ALU_SB_G1_NC, /* ALU */ + 0, /* LDR */ + 0, /* LDRS */ + 0 }, /* LDC */ + { "sb_g1", + BFD_RELOC_ARM_ALU_SB_G1, /* ALU */ + BFD_RELOC_ARM_LDR_SB_G1, /* LDR */ + BFD_RELOC_ARM_LDRS_SB_G1, /* LDRS */ + BFD_RELOC_ARM_LDC_SB_G1 }, /* LDC */ + { "sb_g2", + BFD_RELOC_ARM_ALU_SB_G2, /* ALU */ + BFD_RELOC_ARM_LDR_SB_G2, /* LDR */ + BFD_RELOC_ARM_LDRS_SB_G2, /* LDRS */ + BFD_RELOC_ARM_LDC_SB_G2 } }; /* LDC */ + +/* Given the address of a pointer pointing to the textual name of a group + relocation as may appear in assembler source, attempt to find its details + in group_reloc_table. The pointer will be updated to the character after + the trailing colon. On failure, FAIL will be returned; SUCCESS + otherwise. On success, *entry will be updated to point at the relevant + group_reloc_table entry. */ + +static int +find_group_reloc_table_entry (char **str, struct group_reloc_table_entry **out) +{ + unsigned int i; + for (i = 0; i < ARRAY_SIZE (group_reloc_table); i++) + { + int length = strlen (group_reloc_table[i].name); + + if (strncasecmp (group_reloc_table[i].name, *str, length) == 0 && + (*str)[length] == ':') + { + *out = &group_reloc_table[i]; + *str += (length + 1); + return SUCCESS; + } + } + + return FAIL; +} + +/* Parse a for an ARM data processing instruction + (as for parse_shifter_operand) where group relocations are allowed: + + # + #, + #:: + + , + + where is one of the strings defined in group_reloc_table. + The hashes are optional. + + Everything else is as for parse_shifter_operand. */ + +static parse_operand_result +parse_shifter_operand_group_reloc (char **str, int i) +{ + /* Determine if we have the sequence of characters #: or just : + coming next. If we do, then we check for a group relocation. + If we don't, punt the whole lot to parse_shifter_operand. */ + + if (((*str)[0] == '#' && (*str)[1] == ':') + || (*str)[0] == ':') + { + struct group_reloc_table_entry *entry; + + if ((*str)[0] == '#') + (*str) += 2; + else + (*str)++; + + /* Try to parse a group relocation. Anything else is an error. */ + if (find_group_reloc_table_entry (str, &entry) == FAIL) + { + inst.error = _("unknown group relocation"); + return PARSE_OPERAND_FAIL_NO_BACKTRACK; + } + + /* We now have the group relocation table entry corresponding to + the name in the assembler source. Next, we parse the expression. */ + if (my_get_expression (&inst.reloc.exp, str, GE_NO_PREFIX)) + return PARSE_OPERAND_FAIL_NO_BACKTRACK; + + /* Record the relocation type (always the ALU variant here). */ + inst.reloc.type = entry->alu_code; + assert (inst.reloc.type != 0); + + return PARSE_OPERAND_SUCCESS; + } + else + return parse_shifter_operand (str, i) == SUCCESS + ? PARSE_OPERAND_SUCCESS : PARSE_OPERAND_FAIL; + + /* Never reached. */ +} + /* Parse all forms of an ARM address expression. Information is written to inst.operands[i] and/or inst.reloc. @@ -3349,8 +4552,9 @@ parse_shifter_operand (char **str, int i) It is the caller's responsibility to check for addressing modes not supported by the instruction, and to set inst.reloc.type. */ -static int -parse_address (char **str, int i) +static parse_operand_result +parse_address_main (char **str, int i, int group_relocations, + group_reloc_type group_type) { char *p = *str; int reg; @@ -3368,16 +4572,16 @@ parse_address (char **str, int i) /* else a load-constant pseudo op, no special treatment needed here */ if (my_get_expression (&inst.reloc.exp, &p, GE_NO_PREFIX)) - return FAIL; + return PARSE_OPERAND_FAIL; *str = p; - return SUCCESS; + return PARSE_OPERAND_SUCCESS; } if ((reg = arm_reg_parse (&p, REG_TYPE_RN)) == FAIL) { inst.error = _(reg_expected_msgs[REG_TYPE_RN]); - return FAIL; + return PARSE_OPERAND_FAIL; } inst.operands[i].reg = reg; inst.operands[i].isreg = 1; @@ -3396,8 +4600,25 @@ parse_address (char **str, int i) if (skip_past_comma (&p) == SUCCESS) if (parse_shift (&p, i, SHIFT_IMMEDIATE) == FAIL) - return FAIL; + return PARSE_OPERAND_FAIL; } + else if (skip_past_char (&p, ':') == SUCCESS) + { + /* FIXME: '@' should be used here, but it's filtered out by generic + code before we get to see it here. This may be subject to + change. */ + expressionS exp; + my_get_expression (&exp, &p, GE_NO_PREFIX); + if (exp.X_op != O_constant) + { + inst.error = _("alignment must be constant"); + return PARSE_OPERAND_FAIL; + } + inst.operands[i].imm = exp.X_add_number << 8; + inst.operands[i].immisalign = 1; + /* Alignments are not pre-indexes. */ + inst.operands[i].preind = 0; + } else { if (inst.operands[i].negative) @@ -3405,15 +4626,68 @@ parse_address (char **str, int i) inst.operands[i].negative = 0; p--; } - if (my_get_expression (&inst.reloc.exp, &p, GE_IMM_PREFIX)) - return FAIL; + + if (group_relocations && + ((*p == '#' && *(p + 1) == ':') || *p == ':')) + + { + struct group_reloc_table_entry *entry; + + /* Skip over the #: or : sequence. */ + if (*p == '#') + p += 2; + else + p++; + + /* Try to parse a group relocation. Anything else is an + error. */ + if (find_group_reloc_table_entry (&p, &entry) == FAIL) + { + inst.error = _("unknown group relocation"); + return PARSE_OPERAND_FAIL_NO_BACKTRACK; + } + + /* We now have the group relocation table entry corresponding to + the name in the assembler source. Next, we parse the + expression. */ + if (my_get_expression (&inst.reloc.exp, &p, GE_NO_PREFIX)) + return PARSE_OPERAND_FAIL_NO_BACKTRACK; + + /* Record the relocation type. */ + switch (group_type) + { + case GROUP_LDR: + inst.reloc.type = entry->ldr_code; + break; + + case GROUP_LDRS: + inst.reloc.type = entry->ldrs_code; + break; + + case GROUP_LDC: + inst.reloc.type = entry->ldc_code; + break; + + default: + assert (0); + } + + if (inst.reloc.type == 0) + { + inst.error = _("this group relocation is not allowed on this instruction"); + return PARSE_OPERAND_FAIL_NO_BACKTRACK; + } + } + else + if (my_get_expression (&inst.reloc.exp, &p, GE_IMM_PREFIX)) + return PARSE_OPERAND_FAIL; } } if (skip_past_char (&p, ']') == FAIL) { inst.error = _("']' expected"); - return FAIL; + return PARSE_OPERAND_FAIL; } if (skip_past_char (&p, '!') == SUCCESS) @@ -3426,20 +4700,20 @@ parse_address (char **str, int i) /* [Rn], {expr} - unindexed, with option */ if (parse_immediate (&p, &inst.operands[i].imm, 0, 255, TRUE) == FAIL) - return FAIL; + return PARSE_OPERAND_FAIL; if (skip_past_char (&p, '}') == FAIL) { inst.error = _("'}' expected at end of 'option' field"); - return FAIL; + return PARSE_OPERAND_FAIL; } if (inst.operands[i].preind) { inst.error = _("cannot combine index with option"); - return FAIL; + return PARSE_OPERAND_FAIL; } *str = p; - return SUCCESS; + return PARSE_OPERAND_SUCCESS; } else { @@ -3449,7 +4723,7 @@ parse_address (char **str, int i) if (inst.operands[i].preind) { inst.error = _("cannot combine pre- and post-indexing"); - return FAIL; + return PARSE_OPERAND_FAIL; } if (*p == '+') p++; @@ -3457,12 +4731,17 @@ parse_address (char **str, int i) if ((reg = arm_reg_parse (&p, REG_TYPE_RN)) != FAIL) { - inst.operands[i].imm = reg; + /* We might be using the immediate for alignment already. If we + are, OR the register number into the low-order bits. */ + if (inst.operands[i].immisalign) + inst.operands[i].imm |= reg; + else + inst.operands[i].imm = reg; inst.operands[i].immisreg = 1; if (skip_past_comma (&p) == SUCCESS) if (parse_shift (&p, i, SHIFT_IMMEDIATE) == FAIL) - return FAIL; + return PARSE_OPERAND_FAIL; } else { @@ -3472,7 +4751,7 @@ parse_address (char **str, int i) p--; } if (my_get_expression (&inst.reloc.exp, &p, GE_IMM_PREFIX)) - return FAIL; + return PARSE_OPERAND_FAIL; } } } @@ -3486,6 +4765,59 @@ parse_address (char **str, int i) inst.reloc.exp.X_add_number = 0; } *str = p; + return PARSE_OPERAND_SUCCESS; +} + +static int +parse_address (char **str, int i) +{ + return parse_address_main (str, i, 0, 0) == PARSE_OPERAND_SUCCESS + ? SUCCESS : FAIL; +} + +static parse_operand_result +parse_address_group_reloc (char **str, int i, group_reloc_type type) +{ + return parse_address_main (str, i, 1, type); +} + +/* Parse an operand for a MOVW or MOVT instruction. */ +static int +parse_half (char **str) +{ + char * p; + + p = *str; + skip_past_char (&p, '#'); + if (strncasecmp (p, ":lower16:", 9) == 0) + inst.reloc.type = BFD_RELOC_ARM_MOVW; + else if (strncasecmp (p, ":upper16:", 9) == 0) + inst.reloc.type = BFD_RELOC_ARM_MOVT; + + if (inst.reloc.type != BFD_RELOC_UNUSED) + { + p += 9; + skip_whitespace(p); + } + + if (my_get_expression (&inst.reloc.exp, &p, GE_NO_PREFIX)) + return FAIL; + + if (inst.reloc.type == BFD_RELOC_UNUSED) + { + if (inst.reloc.exp.X_op != O_constant) + { + inst.error = _("constant expression expected"); + return FAIL; + } + if (inst.reloc.exp.X_add_number < 0 + || inst.reloc.exp.X_add_number > 0xffff) + { + inst.error = _("immediate value out of range"); + return FAIL; + } + } + *str = p; return SUCCESS; } @@ -3752,6 +5084,228 @@ parse_tb (char **str) return SUCCESS; } +/* Parse the operands of a Neon VMOV instruction. See do_neon_mov for more + information on the types the operands can take and how they are encoded. + Up to four operands may be read; this function handles setting the + ".present" field for each read operand itself. + Updates STR and WHICH_OPERAND if parsing is successful and returns SUCCESS, + else returns FAIL. */ + +static int +parse_neon_mov (char **str, int *which_operand) +{ + int i = *which_operand, val; + enum arm_reg_type rtype; + char *ptr = *str; + struct neon_type_el optype; + + if ((val = parse_scalar (&ptr, 8, &optype)) != FAIL) + { + /* Case 4: VMOV. , . */ + inst.operands[i].reg = val; + inst.operands[i].isscalar = 1; + inst.operands[i].vectype = optype; + inst.operands[i++].present = 1; + + if (skip_past_comma (&ptr) == FAIL) + goto wanted_comma; + + if ((val = arm_reg_parse (&ptr, REG_TYPE_RN)) == FAIL) + goto wanted_arm; + + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i].present = 1; + } + else if ((val = arm_typed_reg_parse (&ptr, REG_TYPE_NSDQ, &rtype, &optype)) + != FAIL) + { + /* Cases 0, 1, 2, 3, 5 (D only). */ + if (skip_past_comma (&ptr) == FAIL) + goto wanted_comma; + + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i].isquad = (rtype == REG_TYPE_NQ); + inst.operands[i].issingle = (rtype == REG_TYPE_VFS); + inst.operands[i].isvec = 1; + inst.operands[i].vectype = optype; + inst.operands[i++].present = 1; + + if ((val = arm_reg_parse (&ptr, REG_TYPE_RN)) != FAIL) + { + /* Case 5: VMOV , , . + Case 13: VMOV , */ + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i].present = 1; + + if (rtype == REG_TYPE_NQ) + { + first_error (_("can't use Neon quad register here")); + return FAIL; + } + else if (rtype != REG_TYPE_VFS) + { + i++; + if (skip_past_comma (&ptr) == FAIL) + goto wanted_comma; + if ((val = arm_reg_parse (&ptr, REG_TYPE_RN)) == FAIL) + goto wanted_arm; + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i].present = 1; + } + } + else if (parse_qfloat_immediate (&ptr, &inst.operands[i].imm) == SUCCESS) + /* Case 2: VMOV.
, # + Case 3: VMOV.
, # + Case 10: VMOV.F32 , # + Case 11: VMOV.F64
, # */ + inst.operands[i].immisfloat = 1; + else if (parse_big_immediate (&ptr, i) == SUCCESS) + /* Case 2: VMOV.
, # + Case 3: VMOV.
, # */ + ; + else if ((val = arm_typed_reg_parse (&ptr, REG_TYPE_NSDQ, &rtype, + &optype)) != FAIL) + { + /* Case 0: VMOV , + Case 1: VMOV
, + Case 8: VMOV.F32 , + Case 15: VMOV , , , */ + + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i].isquad = (rtype == REG_TYPE_NQ); + inst.operands[i].issingle = (rtype == REG_TYPE_VFS); + inst.operands[i].isvec = 1; + inst.operands[i].vectype = optype; + inst.operands[i].present = 1; + + if (skip_past_comma (&ptr) == SUCCESS) + { + /* Case 15. */ + i++; + + if ((val = arm_reg_parse (&ptr, REG_TYPE_RN)) == FAIL) + goto wanted_arm; + + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i++].present = 1; + + if (skip_past_comma (&ptr) == FAIL) + goto wanted_comma; + + if ((val = arm_reg_parse (&ptr, REG_TYPE_RN)) == FAIL) + goto wanted_arm; + + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i++].present = 1; + } + } + else + { + first_error (_("expected or or operand")); + return FAIL; + } + } + else if ((val = arm_reg_parse (&ptr, REG_TYPE_RN)) != FAIL) + { + /* Cases 6, 7. */ + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i++].present = 1; + + if (skip_past_comma (&ptr) == FAIL) + goto wanted_comma; + + if ((val = parse_scalar (&ptr, 8, &optype)) != FAIL) + { + /* Case 6: VMOV.
, */ + inst.operands[i].reg = val; + inst.operands[i].isscalar = 1; + inst.operands[i].present = 1; + inst.operands[i].vectype = optype; + } + else if ((val = arm_reg_parse (&ptr, REG_TYPE_RN)) != FAIL) + { + /* Case 7: VMOV , , */ + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i++].present = 1; + + if (skip_past_comma (&ptr) == FAIL) + goto wanted_comma; + + if ((val = arm_typed_reg_parse (&ptr, REG_TYPE_VFSD, &rtype, &optype)) + == FAIL) + { + first_error (_(reg_expected_msgs[REG_TYPE_VFSD])); + return FAIL; + } + + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i].isvec = 1; + inst.operands[i].issingle = (rtype == REG_TYPE_VFS); + inst.operands[i].vectype = optype; + inst.operands[i].present = 1; + + if (rtype == REG_TYPE_VFS) + { + /* Case 14. */ + i++; + if (skip_past_comma (&ptr) == FAIL) + goto wanted_comma; + if ((val = arm_typed_reg_parse (&ptr, REG_TYPE_VFS, NULL, + &optype)) == FAIL) + { + first_error (_(reg_expected_msgs[REG_TYPE_VFS])); + return FAIL; + } + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i].isvec = 1; + inst.operands[i].issingle = 1; + inst.operands[i].vectype = optype; + inst.operands[i].present = 1; + } + } + else if ((val = arm_typed_reg_parse (&ptr, REG_TYPE_VFS, NULL, &optype)) + != FAIL) + { + /* Case 13. */ + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i].isvec = 1; + inst.operands[i].issingle = 1; + inst.operands[i].vectype = optype; + inst.operands[i++].present = 1; + } + } + else + { + first_error (_("parse error")); + return FAIL; + } + + /* Successfully parsed the operands. Update args. */ + *which_operand = i; + *str = ptr; + return SUCCESS; + + wanted_comma: + first_error (_("expected comma")); + return FAIL; + + wanted_arm: + first_error (_(reg_expected_msgs[REG_TYPE_RN])); + return FAIL; +} + /* Matcher codes for parse_operands. */ enum operand_parse_code { @@ -3765,7 +5319,13 @@ enum operand_parse_code OP_RCN, /* Coprocessor register */ OP_RF, /* FPA register */ OP_RVS, /* VFP single precision register */ - OP_RVD, /* VFP double precision register */ + OP_RVD, /* VFP double precision register (0..15) */ + OP_RND, /* Neon double precision register (0..31) */ + OP_RNQ, /* Neon quad precision register */ + OP_RVSD, /* VFP single or double precision register */ + OP_RNDQ, /* Neon double or quad precision register */ + OP_RNSDQ, /* Neon single, double or quad precision register */ + OP_RNSC, /* Neon scalar D[X] */ OP_RVC, /* VFP control register */ OP_RMF, /* Maverick F register */ OP_RMD, /* Maverick D register */ @@ -3781,16 +5341,36 @@ enum operand_parse_code OP_REGLST, /* ARM register list */ OP_VRSLST, /* VFP single-precision register list */ OP_VRDLST, /* VFP double-precision register list */ + OP_VRSDLST, /* VFP single or double-precision register list (& quad) */ + OP_NRDLST, /* Neon double-precision register list (d0-d31, qN aliases) */ + OP_NSTRLST, /* Neon element/structure list */ + OP_NILO, /* Neon immediate/logic operands 2 or 2+3. (VBIC, VORR...) */ + OP_RNDQ_I0, /* Neon D or Q reg, or immediate zero. */ + OP_RVSD_I0, /* VFP S or D reg, or immediate zero. */ + OP_RR_RNSC, /* ARM reg or Neon scalar. */ + OP_RNSDQ_RNSC, /* Vector S, D or Q reg, or Neon scalar. */ + OP_RNDQ_RNSC, /* Neon D or Q reg, or Neon scalar. */ + OP_RND_RNSC, /* Neon D reg, or Neon scalar. */ + OP_VMOV, /* Neon VMOV operands. */ + OP_RNDQ_IMVNb,/* Neon D or Q reg, or immediate good for VMVN. */ + OP_RNDQ_I63b, /* Neon D or Q reg, or immediate for shift. */ + OP_RIWR_I32z, /* iWMMXt wR register, or immediate 0 .. 32 for iWMMXt2. */ + + OP_I0, /* immediate zero */ OP_I7, /* immediate value 0 .. 7 */ OP_I15, /* 0 .. 15 */ OP_I16, /* 1 .. 16 */ + OP_I16z, /* 0 .. 16 */ OP_I31, /* 0 .. 31 */ OP_I31w, /* 0 .. 31, optional trailing ! */ OP_I32, /* 1 .. 32 */ + OP_I32z, /* 0 .. 32 */ + OP_I63, /* 0 .. 63 */ OP_I63s, /* -64 .. 63 */ + OP_I64, /* 1 .. 64 */ + OP_I64z, /* 0 .. 64 */ OP_I255, /* 0 .. 255 */ - OP_Iffff, /* 0 .. 65535 */ OP_I4b, /* immediate, prefix optional, 1 .. 4 */ OP_I7b, /* 0 .. 7 */ @@ -3798,10 +5378,15 @@ enum operand_parse_code OP_I31b, /* 0 .. 31 */ OP_SH, /* shifter operand */ + OP_SHG, /* shifter operand with possible group relocation */ OP_ADDR, /* Memory address expression (any mode) */ + OP_ADDRGLDR, /* Mem addr expr (any mode) with possible LDR group reloc */ + OP_ADDRGLDRS, /* Mem addr expr (any mode) with possible LDRS group reloc */ + OP_ADDRGLDC, /* Mem addr expr (any mode) with possible LDC group reloc */ OP_EXP, /* arbitrary expression */ OP_EXPi, /* same, with optional immediate prefix */ OP_EXPr, /* same, with optional relocation suffix */ + OP_HALF, /* 0 .. 65535 or low/high reloc. */ OP_CPSF, /* CPS flags */ OP_ENDI, /* Endianness specifier */ @@ -3809,20 +5394,30 @@ enum operand_parse_code OP_COND, /* conditional code */ OP_TB, /* Table branch. */ + OP_RVC_PSR, /* CPSR/SPSR mask for msr, or VFP control register. */ + OP_APSR_RR, /* ARM register or "APSR_nzcv". */ + OP_RRnpc_I0, /* ARM register or literal 0 */ OP_RR_EXr, /* ARM register or expression with opt. reloc suff. */ OP_RR_EXi, /* ARM register or expression with imm prefix */ OP_RF_IF, /* FPA register or immediate */ OP_RIWR_RIWC, /* iWMMXt R or C reg */ + OP_RIWC_RIWG, /* iWMMXt wC or wCG reg */ /* Optional operands. */ OP_oI7b, /* immediate, prefix optional, 0 .. 7 */ OP_oI31b, /* 0 .. 31 */ + OP_oI32b, /* 1 .. 32 */ OP_oIffffb, /* 0 .. 65535 */ OP_oI255c, /* curly-brace enclosed, 0 .. 255 */ OP_oRR, /* ARM register */ OP_oRRnpc, /* ARM register, not the PC */ + OP_oRRw, /* ARM register, not r15, optional trailing ! */ + OP_oRND, /* Optional Neon double precision register */ + OP_oRNQ, /* Optional Neon quad precision register */ + OP_oRNDQ, /* Optional Neon double or quad precision register */ + OP_oRNSDQ, /* Optional single, double or quad precision vector register */ OP_oSHll, /* LSL immediate */ OP_oSHar, /* ASR immediate */ OP_oSHllar, /* LSL or ASR immediate */ @@ -3843,30 +5438,44 @@ parse_operands (char *str, const unsigned char *pattern) char *backtrack_pos = 0; const char *backtrack_error = 0; int i, val, backtrack_index = 0; + enum arm_reg_type rtype; + parse_operand_result result; #define po_char_or_fail(chr) do { \ if (skip_past_char (&str, chr) == FAIL) \ goto bad_args; \ } while (0) -#define po_reg_or_fail(regtype) do { \ - val = arm_reg_parse (&str, regtype); \ - if (val == FAIL) \ - { \ - inst.error = _(reg_expected_msgs[regtype]); \ - goto failure; \ - } \ - inst.operands[i].reg = val; \ - inst.operands[i].isreg = 1; \ +#define po_reg_or_fail(regtype) do { \ + val = arm_typed_reg_parse (&str, regtype, &rtype, \ + &inst.operands[i].vectype); \ + if (val == FAIL) \ + { \ + first_error (_(reg_expected_msgs[regtype])); \ + goto failure; \ + } \ + inst.operands[i].reg = val; \ + inst.operands[i].isreg = 1; \ + inst.operands[i].isquad = (rtype == REG_TYPE_NQ); \ + inst.operands[i].issingle = (rtype == REG_TYPE_VFS); \ + inst.operands[i].isvec = (rtype == REG_TYPE_VFS \ + || rtype == REG_TYPE_VFD \ + || rtype == REG_TYPE_NQ); \ } while (0) -#define po_reg_or_goto(regtype, label) do { \ - val = arm_reg_parse (&str, regtype); \ - if (val == FAIL) \ - goto label; \ - \ - inst.operands[i].reg = val; \ - inst.operands[i].isreg = 1; \ +#define po_reg_or_goto(regtype, label) do { \ + val = arm_typed_reg_parse (&str, regtype, &rtype, \ + &inst.operands[i].vectype); \ + if (val == FAIL) \ + goto label; \ + \ + inst.operands[i].reg = val; \ + inst.operands[i].isreg = 1; \ + inst.operands[i].isquad = (rtype == REG_TYPE_NQ); \ + inst.operands[i].issingle = (rtype == REG_TYPE_VFS); \ + inst.operands[i].isvec = (rtype == REG_TYPE_VFS \ + || rtype == REG_TYPE_VFD \ + || rtype == REG_TYPE_NQ); \ } while (0) #define po_imm_or_fail(min, max, popt) do { \ @@ -3875,11 +5484,27 @@ parse_operands (char *str, const unsigned char *pattern) inst.operands[i].imm = val; \ } while (0) +#define po_scalar_or_goto(elsz, label) do { \ + val = parse_scalar (&str, elsz, &inst.operands[i].vectype); \ + if (val == FAIL) \ + goto label; \ + inst.operands[i].reg = val; \ + inst.operands[i].isscalar = 1; \ +} while (0) + #define po_misc_or_fail(expr) do { \ if (expr) \ goto failure; \ } while (0) +#define po_misc_or_fail_no_backtrack(expr) do { \ + result = expr; \ + if (result == PARSE_OPERAND_FAIL_NO_BACKTRACK)\ + backtrack_pos = 0; \ + if (result != PARSE_OPERAND_SUCCESS) \ + goto failure; \ +} while (0) + skip_whitespace (str); for (i = 0; upat[i] != OP_stop; i++) @@ -3893,7 +5518,7 @@ parse_operands (char *str, const unsigned char *pattern) backtrack_index = i; } - if (i > 0) + if (i > 0 && (i > 1 || inst.operands[0].present)) po_char_or_fail (','); switch (upat[i]) @@ -3908,7 +5533,15 @@ parse_operands (char *str, const unsigned char *pattern) case OP_RF: po_reg_or_fail (REG_TYPE_FN); break; case OP_RVS: po_reg_or_fail (REG_TYPE_VFS); break; case OP_RVD: po_reg_or_fail (REG_TYPE_VFD); break; - case OP_RVC: po_reg_or_fail (REG_TYPE_VFC); break; + case OP_oRND: + case OP_RND: po_reg_or_fail (REG_TYPE_VFD); break; + case OP_RVC: + po_reg_or_goto (REG_TYPE_VFC, coproc_reg); + break; + /* Also accept generic coprocessor regs for unknown registers. */ + coproc_reg: + po_reg_or_fail (REG_TYPE_CN); + break; case OP_RMF: po_reg_or_fail (REG_TYPE_MVF); break; case OP_RMD: po_reg_or_fail (REG_TYPE_MVD); break; case OP_RMFX: po_reg_or_fail (REG_TYPE_MVFX); break; @@ -3919,6 +5552,126 @@ parse_operands (char *str, const unsigned char *pattern) case OP_RIWC: po_reg_or_fail (REG_TYPE_MMXWC); break; case OP_RIWG: po_reg_or_fail (REG_TYPE_MMXWCG); break; case OP_RXA: po_reg_or_fail (REG_TYPE_XSCALE); break; + case OP_oRNQ: + case OP_RNQ: po_reg_or_fail (REG_TYPE_NQ); break; + case OP_oRNDQ: + case OP_RNDQ: po_reg_or_fail (REG_TYPE_NDQ); break; + case OP_RVSD: po_reg_or_fail (REG_TYPE_VFSD); break; + case OP_oRNSDQ: + case OP_RNSDQ: po_reg_or_fail (REG_TYPE_NSDQ); break; + + /* Neon scalar. Using an element size of 8 means that some invalid + scalars are accepted here, so deal with those in later code. */ + case OP_RNSC: po_scalar_or_goto (8, failure); break; + + /* WARNING: We can expand to two operands here. This has the potential + to totally confuse the backtracking mechanism! It will be OK at + least as long as we don't try to use optional args as well, + though. */ + case OP_NILO: + { + po_reg_or_goto (REG_TYPE_NDQ, try_imm); + inst.operands[i].present = 1; + i++; + skip_past_comma (&str); + po_reg_or_goto (REG_TYPE_NDQ, one_reg_only); + break; + one_reg_only: + /* Optional register operand was omitted. Unfortunately, it's in + operands[i-1] and we need it to be in inst.operands[i]. Fix that + here (this is a bit grotty). */ + inst.operands[i] = inst.operands[i-1]; + inst.operands[i-1].present = 0; + break; + try_imm: + /* There's a possibility of getting a 64-bit immediate here, so + we need special handling. */ + if (parse_big_immediate (&str, i) == FAIL) + { + inst.error = _("immediate value is out of range"); + goto failure; + } + } + break; + + case OP_RNDQ_I0: + { + po_reg_or_goto (REG_TYPE_NDQ, try_imm0); + break; + try_imm0: + po_imm_or_fail (0, 0, TRUE); + } + break; + + case OP_RVSD_I0: + po_reg_or_goto (REG_TYPE_VFSD, try_imm0); + break; + + case OP_RR_RNSC: + { + po_scalar_or_goto (8, try_rr); + break; + try_rr: + po_reg_or_fail (REG_TYPE_RN); + } + break; + + case OP_RNSDQ_RNSC: + { + po_scalar_or_goto (8, try_nsdq); + break; + try_nsdq: + po_reg_or_fail (REG_TYPE_NSDQ); + } + break; + + case OP_RNDQ_RNSC: + { + po_scalar_or_goto (8, try_ndq); + break; + try_ndq: + po_reg_or_fail (REG_TYPE_NDQ); + } + break; + + case OP_RND_RNSC: + { + po_scalar_or_goto (8, try_vfd); + break; + try_vfd: + po_reg_or_fail (REG_TYPE_VFD); + } + break; + + case OP_VMOV: + /* WARNING: parse_neon_mov can move the operand counter, i. If we're + not careful then bad things might happen. */ + po_misc_or_fail (parse_neon_mov (&str, &i) == FAIL); + break; + + case OP_RNDQ_IMVNb: + { + po_reg_or_goto (REG_TYPE_NDQ, try_mvnimm); + break; + try_mvnimm: + /* There's a possibility of getting a 64-bit immediate here, so + we need special handling. */ + if (parse_big_immediate (&str, i) == FAIL) + { + inst.error = _("immediate value is out of range"); + goto failure; + } + } + break; + + case OP_RNDQ_I63b: + { + po_reg_or_goto (REG_TYPE_NDQ, try_shimm); + break; + try_shimm: + po_imm_or_fail (0, 63, TRUE); + } + break; case OP_RRnpcb: po_char_or_fail ('['); @@ -3927,6 +5680,7 @@ parse_operands (char *str, const unsigned char *pattern) break; case OP_RRw: + case OP_oRRw: po_reg_or_fail (REG_TYPE_RN); if (skip_past_char (&str, '!') == SUCCESS) inst.operands[i].writeback = 1; @@ -3936,11 +5690,15 @@ parse_operands (char *str, const unsigned char *pattern) case OP_I7: po_imm_or_fail ( 0, 7, FALSE); break; case OP_I15: po_imm_or_fail ( 0, 15, FALSE); break; case OP_I16: po_imm_or_fail ( 1, 16, FALSE); break; + case OP_I16z: po_imm_or_fail ( 0, 16, FALSE); break; case OP_I31: po_imm_or_fail ( 0, 31, FALSE); break; case OP_I32: po_imm_or_fail ( 1, 32, FALSE); break; + case OP_I32z: po_imm_or_fail ( 0, 32, FALSE); break; case OP_I63s: po_imm_or_fail (-64, 63, FALSE); break; + case OP_I63: po_imm_or_fail ( 0, 63, FALSE); break; + case OP_I64: po_imm_or_fail ( 1, 64, FALSE); break; + case OP_I64z: po_imm_or_fail ( 0, 64, FALSE); break; case OP_I255: po_imm_or_fail ( 0, 255, FALSE); break; - case OP_Iffff: po_imm_or_fail ( 0, 0xffff, FALSE); break; case OP_I4b: po_imm_or_fail ( 1, 4, TRUE); break; case OP_oI7b: @@ -3948,6 +5706,7 @@ parse_operands (char *str, const unsigned char *pattern) case OP_I15b: po_imm_or_fail ( 0, 15, TRUE); break; case OP_oI31b: case OP_I31b: po_imm_or_fail ( 0, 31, TRUE); break; + case OP_oI32b: po_imm_or_fail ( 1, 32, TRUE); break; case OP_oIffffb: po_imm_or_fail ( 0, 0xffff, TRUE); break; /* Immediate variants */ @@ -4005,6 +5764,11 @@ parse_operands (char *str, const unsigned char *pattern) } break; + /* Operand for MOVW or MOVT. */ + case OP_HALF: + po_misc_or_fail (parse_half (&str)); + break; + /* Register or expression */ case OP_RR_EXr: po_reg_or_goto (REG_TYPE_RN, EXPr); break; case OP_RR_EXi: po_reg_or_goto (REG_TYPE_RN, EXPi); break; @@ -4027,13 +5791,17 @@ parse_operands (char *str, const unsigned char *pattern) inst.operands[i].isreg = 1; break; + case OP_RIWR_I32z: po_reg_or_goto (REG_TYPE_MMXWR, I32z); break; + I32z: po_imm_or_fail (0, 32, FALSE); break; + /* Two kinds of register */ case OP_RIWR_RIWC: { struct reg_entry *rege = arm_reg_parse_multi (&str); - if (rege->type != REG_TYPE_MMXWR - && rege->type != REG_TYPE_MMXWC - && rege->type != REG_TYPE_MMXWCG) + if (!rege + || (rege->type != REG_TYPE_MMXWR + && rege->type != REG_TYPE_MMXWC + && rege->type != REG_TYPE_MMXWCG)) { inst.error = _("iWMMXt data or control register expected"); goto failure; @@ -4043,6 +5811,21 @@ parse_operands (char *str, const unsigned char *pattern) } break; + case OP_RIWC_RIWG: + { + struct reg_entry *rege = arm_reg_parse_multi (&str); + if (!rege + || (rege->type != REG_TYPE_MMXWC + && rege->type != REG_TYPE_MMXWCG)) + { + inst.error = _("iWMMXt control register expected"); + goto failure; + } + inst.operands[i].reg = rege->number; + inst.operands[i].isreg = 1; + } + break; + /* Misc */ case OP_CPSF: val = parse_cps_flags (&str); break; case OP_ENDI: val = parse_endian_specifier (&str); break; @@ -4051,6 +5834,41 @@ parse_operands (char *str, const unsigned char *pattern) case OP_COND: val = parse_cond (&str); break; case OP_oBARRIER:val = parse_barrier (&str); break; + case OP_RVC_PSR: + po_reg_or_goto (REG_TYPE_VFC, try_psr); + inst.operands[i].isvec = 1; /* Mark VFP control reg as vector. */ + break; + try_psr: + val = parse_psr (&str); + break; + + case OP_APSR_RR: + po_reg_or_goto (REG_TYPE_RN, try_apsr); + break; + try_apsr: + /* Parse "APSR_nvzc" operand (for FMSTAT-equivalent MRS + instruction). */ + if (strncasecmp (str, "APSR_", 5) == 0) + { + unsigned found = 0; + str += 5; + while (found < 15) + switch (*str++) + { + case 'c': found = (found & 1) ? 16 : found | 1; break; + case 'n': found = (found & 2) ? 16 : found | 2; break; + case 'z': found = (found & 4) ? 16 : found | 4; break; + case 'v': found = (found & 8) ? 16 : found | 8; break; + default: found = 16; + } + if (found != 15) + goto failure; + inst.operands[i].isvec = 1; + } + else + goto failure; + break; + case OP_TB: po_misc_or_fail (parse_tb (&str)); break; @@ -4066,22 +5884,65 @@ parse_operands (char *str, const unsigned char *pattern) break; case OP_VRSLST: - val = parse_vfp_reg_list (&str, &inst.operands[i].reg, 0); + val = parse_vfp_reg_list (&str, &inst.operands[i].reg, REGLIST_VFP_S); break; case OP_VRDLST: - val = parse_vfp_reg_list (&str, &inst.operands[i].reg, 1); + val = parse_vfp_reg_list (&str, &inst.operands[i].reg, REGLIST_VFP_D); break; + case OP_VRSDLST: + /* Allow Q registers too. */ + val = parse_vfp_reg_list (&str, &inst.operands[i].reg, + REGLIST_NEON_D); + if (val == FAIL) + { + inst.error = NULL; + val = parse_vfp_reg_list (&str, &inst.operands[i].reg, + REGLIST_VFP_S); + inst.operands[i].issingle = 1; + } + break; + + case OP_NRDLST: + val = parse_vfp_reg_list (&str, &inst.operands[i].reg, + REGLIST_NEON_D); + break; + + case OP_NSTRLST: + val = parse_neon_el_struct_list (&str, &inst.operands[i].reg, + &inst.operands[i].vectype); + break; + /* Addressing modes */ case OP_ADDR: po_misc_or_fail (parse_address (&str, i)); break; + case OP_ADDRGLDR: + po_misc_or_fail_no_backtrack ( + parse_address_group_reloc (&str, i, GROUP_LDR)); + break; + + case OP_ADDRGLDRS: + po_misc_or_fail_no_backtrack ( + parse_address_group_reloc (&str, i, GROUP_LDRS)); + break; + + case OP_ADDRGLDC: + po_misc_or_fail_no_backtrack ( + parse_address_group_reloc (&str, i, GROUP_LDC)); + break; + case OP_SH: po_misc_or_fail (parse_shifter_operand (&str, i)); break; + case OP_SHG: + po_misc_or_fail_no_backtrack ( + parse_shifter_operand_group_reloc (&str, i)); + break; + case OP_oSHll: po_misc_or_fail (parse_shift (&str, i, SHIFT_LSL_IMMEDIATE)); break; @@ -4107,6 +5968,7 @@ parse_operands (char *str, const unsigned char *pattern) case OP_RRnpc: case OP_RRnpcb: case OP_RRw: + case OP_oRRw: case OP_RRnpc_I0: if (inst.operands[i].isreg && inst.operands[i].reg == REG_PC) inst.error = BAD_PC; @@ -4116,11 +5978,15 @@ parse_operands (char *str, const unsigned char *pattern) case OP_ENDI: case OP_oROR: case OP_PSR: + case OP_RVC_PSR: case OP_COND: case OP_oBARRIER: case OP_REGLST: case OP_VRSLST: case OP_VRDLST: + case OP_VRSDLST: + case OP_NRDLST: + case OP_NSTRLST: if (val == FAIL) goto failure; inst.operands[i].imm = val; @@ -4178,6 +6044,7 @@ parse_operands (char *str, const unsigned char *pattern) #undef po_reg_or_fail #undef po_reg_or_goto #undef po_imm_or_fail +#undef po_scalar_or_fail /* Shorthand macro for instruction encoding functions issuing errors. */ #define constraint(expr, err) do { \ @@ -4236,11 +6103,30 @@ encode_thumb32_immediate (unsigned int val) return FAIL; } -/* Encode a VFP SP register number into inst.instruction. */ +/* Encode a VFP SP or DP register number into inst.instruction. */ static void -encode_arm_vfp_sp_reg (int reg, enum vfp_sp_reg_pos pos) +encode_arm_vfp_reg (int reg, enum vfp_reg_pos pos) { + if ((pos == VFP_REG_Dd || pos == VFP_REG_Dn || pos == VFP_REG_Dm) + && reg > 15) + { + if (ARM_CPU_HAS_FEATURE (cpu_variant, fpu_vfp_ext_v3)) + { + if (thumb_mode) + ARM_MERGE_FEATURE_SETS (thumb_arch_used, thumb_arch_used, + fpu_vfp_ext_v3); + else + ARM_MERGE_FEATURE_SETS (arm_arch_used, arm_arch_used, + fpu_vfp_ext_v3); + } + else + { + first_error (_("D register out of range for selected VFP version")); + return; + } + } + switch (pos) { case VFP_REG_Sd: @@ -4255,6 +6141,18 @@ encode_arm_vfp_sp_reg (int reg, enum vfp_sp_reg_pos pos) inst.instruction |= ((reg >> 1) << 0) | ((reg & 1) << 5); break; + case VFP_REG_Dd: + inst.instruction |= ((reg & 15) << 12) | ((reg >> 4) << 22); + break; + + case VFP_REG_Dn: + inst.instruction |= ((reg & 15) << 16) | ((reg >> 4) << 7); + break; + + case VFP_REG_Dm: + inst.instruction |= (reg & 15) | ((reg >> 4) << 5); + break; + default: abort (); } @@ -4399,7 +6297,8 @@ encode_arm_addr_mode_3 (int i, bfd_boolean is_t) into a coprocessor load/store instruction. If wb_ok is false, reject use of writeback; if unind_ok is false, reject use of unindexed addressing. If reloc_override is not 0, use it instead - of BFD_ARM_CP_OFF_IMM. */ + of BFD_ARM_CP_OFF_IMM, unless the initial relocation is a group one + (in which case it is preserved). */ static int encode_arm_cp_address (int i, int wb_ok, int unind_ok, int reloc_override) @@ -4441,10 +6340,16 @@ encode_arm_cp_address (int i, int wb_ok, int unind_ok, int reloc_override) if (reloc_override) inst.reloc.type = reloc_override; - else if (thumb_mode) - inst.reloc.type = BFD_RELOC_ARM_T32_CP_OFF_IMM; - else - inst.reloc.type = BFD_RELOC_ARM_CP_OFF_IMM; + else if ((inst.reloc.type < BFD_RELOC_ARM_ALU_PC_G0_NC + || inst.reloc.type > BFD_RELOC_ARM_LDC_SB_G2) + && inst.reloc.type != BFD_RELOC_ARM_LDR_PC_G0) + { + if (thumb_mode) + inst.reloc.type = BFD_RELOC_ARM_T32_CP_OFF_IMM; + else + inst.reloc.type = BFD_RELOC_ARM_CP_OFF_IMM; + } + return SUCCESS; } @@ -4570,7 +6475,7 @@ static void do_rd_rm_rn (void) { unsigned Rn = inst.operands[2].reg; - /* Enforce resutrictions on SWP instruction. */ + /* Enforce restrictions on SWP instruction. */ if ((inst.instruction & 0x0fbfffff) == 0x01000090) constraint (Rn == inst.operands[0].reg || Rn == inst.operands[1].reg, _("Rn must not overlap other operands")); @@ -4894,7 +6799,11 @@ static void do_cpsi (void) { inst.instruction |= inst.operands[0].imm << 6; - inst.instruction |= inst.operands[1].imm; + if (inst.operands[1].present) + { + inst.instruction |= CPSI_MMOD; + inst.instruction |= inst.operands[1].imm; + } } static void @@ -5112,17 +7021,16 @@ do_lstc (void) static void do_mlas (void) { - /* This restriction does not apply to mls (nor to mla in v6, but - that's hard to detect at present). */ + /* This restriction does not apply to mls (nor to mla in v6 or later). */ if (inst.operands[0].reg == inst.operands[1].reg + && !ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_v6) && !(inst.instruction & 0x00400000)) - as_tsktsk (_("rd and rm should be different in mla")); + as_tsktsk (_("Rd and Rm should be different in mla")); inst.instruction |= inst.operands[0].reg << 16; inst.instruction |= inst.operands[1].reg; inst.instruction |= inst.operands[2].reg << 8; inst.instruction |= inst.operands[3].reg << 12; - } static void @@ -5136,15 +7044,62 @@ do_mov (void) static void do_mov16 (void) { + bfd_vma imm; + bfd_boolean top; + + top = (inst.instruction & 0x00400000) != 0; + constraint (top && inst.reloc.type == BFD_RELOC_ARM_MOVW, + _(":lower16: not allowed this instruction")); + constraint (!top && inst.reloc.type == BFD_RELOC_ARM_MOVT, + _(":upper16: not allowed instruction")); inst.instruction |= inst.operands[0].reg << 12; - /* The value is in two pieces: 0:11, 16:19. */ - inst.instruction |= (inst.operands[1].imm & 0x00000fff); - inst.instruction |= (inst.operands[1].imm & 0x0000f000) << 4; + if (inst.reloc.type == BFD_RELOC_UNUSED) + { + imm = inst.reloc.exp.X_add_number; + /* The value is in two pieces: 0:11, 16:19. */ + inst.instruction |= (imm & 0x00000fff); + inst.instruction |= (imm & 0x0000f000) << 4; + } +} + +static void do_vfp_nsyn_opcode (const char *); + +static int +do_vfp_nsyn_mrs (void) +{ + if (inst.operands[0].isvec) + { + if (inst.operands[1].reg != 1) + first_error (_("operand 1 must be FPSCR")); + memset (&inst.operands[0], '\0', sizeof (inst.operands[0])); + memset (&inst.operands[1], '\0', sizeof (inst.operands[1])); + do_vfp_nsyn_opcode ("fmstat"); + } + else if (inst.operands[1].isvec) + do_vfp_nsyn_opcode ("fmrx"); + else + return FAIL; + + return SUCCESS; +} + +static int +do_vfp_nsyn_msr (void) +{ + if (inst.operands[0].isvec) + do_vfp_nsyn_opcode ("fmxr"); + else + return FAIL; + + return SUCCESS; } static void do_mrs (void) { + if (do_vfp_nsyn_mrs () == SUCCESS) + return; + /* mrs only accepts CPSR/SPSR/CPSR_all/SPSR_all. */ constraint ((inst.operands[1].imm & (PSR_c|PSR_x|PSR_s|PSR_f)) != (PSR_c|PSR_f), @@ -5160,6 +7115,9 @@ do_mrs (void) static void do_msr (void) { + if (do_vfp_nsyn_msr () == SUCCESS) + return; + inst.instruction |= inst.operands[0].imm; if (inst.operands[1].isreg) inst.instruction |= inst.operands[1].reg; @@ -5180,8 +7138,9 @@ do_mul (void) inst.instruction |= inst.operands[1].reg; inst.instruction |= inst.operands[2].reg << 8; - if (inst.operands[0].reg == inst.operands[1].reg) - as_tsktsk (_("rd and rm should be different in mul")); + if (inst.operands[0].reg == inst.operands[1].reg + && !ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_v6)) + as_tsktsk (_("Rd and Rm should be different in mul")); } /* Long Multiply Parser @@ -5447,13 +7406,25 @@ do_smul (void) inst.instruction |= inst.operands[2].reg << 8; } -/* ARM V6 srs (argument parse). */ +/* ARM V6 srs (argument parse). The variable fields in the encoding are + the same for both ARM and Thumb-2. */ static void do_srs (void) { - inst.instruction |= inst.operands[0].imm; - if (inst.operands[0].writeback) + int reg; + + if (inst.operands[0].present) + { + reg = inst.operands[0].reg; + constraint (reg != 13, _("SRS base register must be r13")); + } + else + reg = 13; + + inst.instruction |= reg << 16; + inst.instruction |= inst.operands[1].imm; + if (inst.operands[0].writeback || inst.operands[1].writeback) inst.instruction |= WRITE_BACK; } @@ -5542,43 +7513,43 @@ do_sxth (void) static void do_vfp_sp_monadic (void) { - encode_arm_vfp_sp_reg (inst.operands[0].reg, VFP_REG_Sd); - encode_arm_vfp_sp_reg (inst.operands[1].reg, VFP_REG_Sm); + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Sd); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Sm); } static void do_vfp_sp_dyadic (void) { - encode_arm_vfp_sp_reg (inst.operands[0].reg, VFP_REG_Sd); - encode_arm_vfp_sp_reg (inst.operands[1].reg, VFP_REG_Sn); - encode_arm_vfp_sp_reg (inst.operands[2].reg, VFP_REG_Sm); + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Sd); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Sn); + encode_arm_vfp_reg (inst.operands[2].reg, VFP_REG_Sm); } static void do_vfp_sp_compare_z (void) { - encode_arm_vfp_sp_reg (inst.operands[0].reg, VFP_REG_Sd); + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Sd); } static void do_vfp_dp_sp_cvt (void) { - inst.instruction |= inst.operands[0].reg << 12; - encode_arm_vfp_sp_reg (inst.operands[1].reg, VFP_REG_Sm); + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dd); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Sm); } static void do_vfp_sp_dp_cvt (void) { - encode_arm_vfp_sp_reg (inst.operands[0].reg, VFP_REG_Sd); - inst.instruction |= inst.operands[1].reg; + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Sd); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Dm); } static void do_vfp_reg_from_sp (void) { inst.instruction |= inst.operands[0].reg << 12; - encode_arm_vfp_sp_reg (inst.operands[1].reg, VFP_REG_Sn); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Sn); } static void @@ -5588,13 +7559,13 @@ do_vfp_reg2_from_sp2 (void) _("only two consecutive VFP SP registers allowed here")); inst.instruction |= inst.operands[0].reg << 12; inst.instruction |= inst.operands[1].reg << 16; - encode_arm_vfp_sp_reg (inst.operands[2].reg, VFP_REG_Sm); + encode_arm_vfp_reg (inst.operands[2].reg, VFP_REG_Sm); } static void do_vfp_sp_from_reg (void) { - encode_arm_vfp_sp_reg (inst.operands[0].reg, VFP_REG_Sn); + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Sn); inst.instruction |= inst.operands[1].reg << 12; } @@ -5603,7 +7574,7 @@ do_vfp_sp2_from_reg2 (void) { constraint (inst.operands[0].imm != 2, _("only two consecutive VFP SP registers allowed here")); - encode_arm_vfp_sp_reg (inst.operands[0].reg, VFP_REG_Sm); + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Sm); inst.instruction |= inst.operands[1].reg << 12; inst.instruction |= inst.operands[2].reg << 16; } @@ -5611,14 +7582,14 @@ do_vfp_sp2_from_reg2 (void) static void do_vfp_sp_ldst (void) { - encode_arm_vfp_sp_reg (inst.operands[0].reg, VFP_REG_Sd); + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Sd); encode_arm_cp_address (1, FALSE, TRUE, 0); } static void do_vfp_dp_ldst (void) { - inst.instruction |= inst.operands[0].reg << 12; + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dd); encode_arm_cp_address (1, FALSE, TRUE, 0); } @@ -5632,7 +7603,7 @@ vfp_sp_ldstm (enum vfp_ldstm_type ldstm_type) constraint (ldstm_type != VFP_LDSTMIA, _("this addressing mode requires base-register writeback")); inst.instruction |= inst.operands[0].reg << 16; - encode_arm_vfp_sp_reg (inst.operands[1].reg, VFP_REG_Sd); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Sd); inst.instruction |= inst.operands[1].imm; } @@ -5648,7 +7619,7 @@ vfp_dp_ldstm (enum vfp_ldstm_type ldstm_type) _("this addressing mode requires base-register writeback")); inst.instruction |= inst.operands[0].reg << 16; - inst.instruction |= inst.operands[1].reg << 12; + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Dd); count = inst.operands[1].imm << 1; if (ldstm_type == VFP_LDSTMIAX || ldstm_type == VFP_LDSTMDBX) @@ -5692,6 +7663,103 @@ do_vfp_xp_ldstmdb (void) { vfp_dp_ldstm (VFP_LDSTMDBX); } + +static void +do_vfp_dp_rd_rm (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dd); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Dm); +} + +static void +do_vfp_dp_rn_rd (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dn); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Dd); +} + +static void +do_vfp_dp_rd_rn (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dd); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Dn); +} + +static void +do_vfp_dp_rd_rn_rm (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dd); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Dn); + encode_arm_vfp_reg (inst.operands[2].reg, VFP_REG_Dm); +} + +static void +do_vfp_dp_rd (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dd); +} + +static void +do_vfp_dp_rm_rd_rn (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dm); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Dd); + encode_arm_vfp_reg (inst.operands[2].reg, VFP_REG_Dn); +} + +/* VFPv3 instructions. */ +static void +do_vfp_sp_const (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Sd); + inst.instruction |= (inst.operands[1].imm & 0xf0) << 12; + inst.instruction |= (inst.operands[1].imm & 0x0f); +} + +static void +do_vfp_dp_const (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dd); + inst.instruction |= (inst.operands[1].imm & 0xf0) << 12; + inst.instruction |= (inst.operands[1].imm & 0x0f); +} + +static void +vfp_conv (int srcsize) +{ + unsigned immbits = srcsize - inst.operands[1].imm; + inst.instruction |= (immbits & 1) << 5; + inst.instruction |= (immbits >> 1); +} + +static void +do_vfp_sp_conv_16 (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Sd); + vfp_conv (16); +} + +static void +do_vfp_dp_conv_16 (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dd); + vfp_conv (16); +} + +static void +do_vfp_sp_conv_32 (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Sd); + vfp_conv (32); +} + +static void +do_vfp_dp_conv_32 (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dd); + vfp_conv (32); +} + /* FPA instructions. Also in a logical order. */ @@ -5740,6 +7808,7 @@ do_fpa_ldmstm (void) encode_arm_cp_address (2, TRUE, TRUE, 0); } + /* iWMMXt instructions: strictly in alphabetical order. */ @@ -5789,6 +7858,15 @@ do_iwmmxt_waligni (void) inst.instruction |= inst.operands[3].imm << 20; } +static void +do_iwmmxt_wmerge (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[2].reg; + inst.instruction |= inst.operands[3].imm << 21; +} + static void do_iwmmxt_wmov (void) { @@ -5828,7 +7906,23 @@ static void do_iwmmxt_wldstd (void) { inst.instruction |= inst.operands[0].reg << 12; - encode_arm_cp_address (1, TRUE, FALSE, 0); + if (ARM_CPU_HAS_FEATURE (cpu_variant, arm_cext_iwmmxt2) + && inst.operands[1].immisreg) + { + inst.instruction &= ~0x1a000ff; + inst.instruction |= (0xf << 28); + if (inst.operands[1].preind) + inst.instruction |= PRE_INDEX; + if (!inst.operands[1].negative) + inst.instruction |= INDEX_UP; + if (inst.operands[1].writeback) + inst.instruction |= WRITE_BACK; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.reloc.exp.X_add_number << 4; + inst.instruction |= inst.operands[1].imm; + } + else + encode_arm_cp_address (1, TRUE, FALSE, 0); } static void @@ -5848,6 +7942,56 @@ do_iwmmxt_wzero (void) inst.instruction |= inst.operands[0].reg << 12; inst.instruction |= inst.operands[0].reg << 16; } + +static void +do_iwmmxt_wrwrwr_or_imm5 (void) +{ + if (inst.operands[2].isreg) + do_rd_rn_rm (); + else { + constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, arm_cext_iwmmxt2), + _("immediate operand requires iWMMXt2")); + do_rd_rn (); + if (inst.operands[2].imm == 0) + { + switch ((inst.instruction >> 20) & 0xf) + { + case 4: + case 5: + case 6: + case 7: + /* w...h wrd, wrn, #0 -> wrorh wrd, wrn, #16. */ + inst.operands[2].imm = 16; + inst.instruction = (inst.instruction & 0xff0fffff) | (0x7 << 20); + break; + case 8: + case 9: + case 10: + case 11: + /* w...w wrd, wrn, #0 -> wrorw wrd, wrn, #32. */ + inst.operands[2].imm = 32; + inst.instruction = (inst.instruction & 0xff0fffff) | (0xb << 20); + break; + case 12: + case 13: + case 14: + case 15: + { + /* w...d wrd, wrn, #0 -> wor wrd, wrn, wrn. */ + unsigned long wrn; + wrn = (inst.instruction >> 16) & 0xf; + inst.instruction &= 0xff0fff0f; + inst.instruction |= wrn; + /* Bail out here; the instruction is now assembled. */ + return; + } + } + } + /* Map 32 -> 0, etc. */ + inst.operands[2].imm &= 0x1f; + inst.instruction |= (0xf << 28) | ((inst.operands[2].imm & 0x10) << 4) | (inst.operands[2].imm & 0xf); + } +} /* Cirrus Maverick instructions. Simple 2-, 3-, and 4-register operations first, then control, shift, and load/store. */ @@ -6082,7 +8226,7 @@ encode_thumb32_addr_mode (int i, bfd_boolean is_t, bfd_boolean is_d) X(cpsie, b660, f3af8400), \ X(cpsid, b670, f3af8600), \ X(cpy, 4600, ea4f0000), \ - X(dec_sp,80dd, f1bd0d00), \ + X(dec_sp,80dd, f1ad0d00), \ X(eor, 4040, ea800000), \ X(eors, 4040, ea900000), \ X(inc_sp,00dd, f10d0d00), \ @@ -6200,13 +8344,13 @@ do_t_add_sub (void) narrow = (current_it_mask != 0); if (!inst.operands[2].isreg) { + int add; + + add = (inst.instruction == T_MNEM_add + || inst.instruction == T_MNEM_adds); opcode = 0; if (inst.size_req != 4) { - int add; - - add = (inst.instruction == T_MNEM_add - || inst.instruction == T_MNEM_adds); /* Attempt to use a narrow opcode, with relaxation if appropriate. */ if (Rd == REG_SP && Rs == REG_SP && !flags) @@ -6236,12 +8380,38 @@ do_t_add_sub (void) if (inst.size_req == 4 || (inst.size_req != 2 && !opcode)) { - /* ??? Convert large immediates to addw/subw. */ - inst.instruction = THUMB_OP32 (inst.instruction); - inst.instruction = (inst.instruction & 0xe1ffffff) | 0x10000000; - inst.instruction |= inst.operands[0].reg << 8; - inst.instruction |= inst.operands[1].reg << 16; - inst.reloc.type = BFD_RELOC_ARM_T32_IMMEDIATE; + if (Rd == REG_PC) + { + constraint (Rs != REG_LR || inst.instruction != T_MNEM_subs, + _("only SUBS PC, LR, #const allowed")); + constraint (inst.reloc.exp.X_op != O_constant, + _("expression too complex")); + constraint (inst.reloc.exp.X_add_number < 0 + || inst.reloc.exp.X_add_number > 0xff, + _("immediate value out of range")); + inst.instruction = T2_SUBS_PC_LR + | inst.reloc.exp.X_add_number; + inst.reloc.type = BFD_RELOC_UNUSED; + return; + } + else if (Rs == REG_PC) + { + /* Always use addw/subw. */ + inst.instruction = add ? 0xf20f0000 : 0xf2af0000; + inst.reloc.type = BFD_RELOC_ARM_T32_IMM12; + } + else + { + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction = (inst.instruction & 0xe1ffffff) + | 0x10000000; + if (flags) + inst.reloc.type = BFD_RELOC_ARM_T32_IMMEDIATE; + else + inst.reloc.type = BFD_RELOC_ARM_T32_ADD_IMM; + } + inst.instruction |= Rd << 8; + inst.instruction |= Rs << 16; } } else @@ -6807,7 +8977,7 @@ do_t_cpy (void) } static void -do_t_czb (void) +do_t_cbz (void) { constraint (current_it_mask, BAD_NOT_IT); constraint (inst.operands[0].reg > 7, BAD_HIREG); @@ -6871,6 +9041,68 @@ do_t_it (void) inst.instruction |= cond << 4; } +/* Helper function used for both push/pop and ldm/stm. */ +static void +encode_thumb2_ldmstm (int base, unsigned mask, bfd_boolean writeback) +{ + bfd_boolean load; + + load = (inst.instruction & (1 << 20)) != 0; + + if (mask & (1 << 13)) + inst.error = _("SP not allowed in register list"); + if (load) + { + if (mask & (1 << 14) + && mask & (1 << 15)) + inst.error = _("LR and PC should not both be in register list"); + + if ((mask & (1 << base)) != 0 + && writeback) + as_warn (_("base register should not be in register list " + "when written back")); + } + else + { + if (mask & (1 << 15)) + inst.error = _("PC not allowed in register list"); + + if (mask & (1 << base)) + as_warn (_("value stored for r%d is UNPREDICTABLE"), base); + } + + if ((mask & (mask - 1)) == 0) + { + /* Single register transfers implemented as str/ldr. */ + if (writeback) + { + if (inst.instruction & (1 << 23)) + inst.instruction = 0x00000b04; /* ia! -> [base], #4 */ + else + inst.instruction = 0x00000d04; /* db! -> [base, #-4]! */ + } + else + { + if (inst.instruction & (1 << 23)) + inst.instruction = 0x00800000; /* ia -> [base] */ + else + inst.instruction = 0x00000c04; /* db -> [base, #-4] */ + } + + inst.instruction |= 0xf8400000; + if (load) + inst.instruction |= 0x00100000; + + mask = ffs(mask) - 1; + mask <<= 12; + } + else if (writeback) + inst.instruction |= WRITE_BACK; + + inst.instruction |= mask; + inst.instruction |= base << 16; +} + static void do_t_ldmstm (void) { @@ -6882,60 +9114,60 @@ do_t_ldmstm (void) if (unified_syntax) { + bfd_boolean narrow; + unsigned mask; + + narrow = FALSE; /* See if we can use a 16-bit instruction. */ if (inst.instruction < 0xffff /* not ldmdb/stmdb */ && inst.size_req != 4 - && inst.operands[0].reg <= 7 - && !(inst.operands[1].imm & ~0xff) - && (inst.instruction == T_MNEM_stmia - ? inst.operands[0].writeback - : (inst.operands[0].writeback - == !(inst.operands[1].imm & (1 << inst.operands[0].reg))))) + && !(inst.operands[1].imm & ~0xff)) { - if (inst.instruction == T_MNEM_stmia - && (inst.operands[1].imm & (1 << inst.operands[0].reg)) - && (inst.operands[1].imm & ((1 << inst.operands[0].reg) - 1))) - as_warn (_("value stored for r%d is UNPREDICTABLE"), - inst.operands[0].reg); + mask = 1 << inst.operands[0].reg; - inst.instruction = THUMB_OP16 (inst.instruction); - inst.instruction |= inst.operands[0].reg << 8; - inst.instruction |= inst.operands[1].imm; - } - else - { - if (inst.operands[1].imm & (1 << 13)) - as_warn (_("SP should not be in register list")); - if (inst.instruction == T_MNEM_stmia) + if (inst.operands[0].reg <= 7 + && (inst.instruction == T_MNEM_stmia + ? inst.operands[0].writeback + : (inst.operands[0].writeback + == !(inst.operands[1].imm & mask)))) { - if (inst.operands[1].imm & (1 << 15)) - as_warn (_("PC should not be in register list")); - if (inst.operands[1].imm & (1 << inst.operands[0].reg)) + if (inst.instruction == T_MNEM_stmia + && (inst.operands[1].imm & mask) + && (inst.operands[1].imm & (mask - 1))) as_warn (_("value stored for r%d is UNPREDICTABLE"), inst.operands[0].reg); + + inst.instruction = THUMB_OP16 (inst.instruction); + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].imm; + narrow = TRUE; } - else + else if (inst.operands[0] .reg == REG_SP + && inst.operands[0].writeback) { - if (inst.operands[1].imm & (1 << 14) - && inst.operands[1].imm & (1 << 15)) - as_warn (_("LR and PC should not both be in register list")); - if ((inst.operands[1].imm & (1 << inst.operands[0].reg)) - && inst.operands[0].writeback) - as_warn (_("base register should not be in register list " - "when written back")); + inst.instruction = THUMB_OP16 (inst.instruction == T_MNEM_stmia + ? T_MNEM_push : T_MNEM_pop); + inst.instruction |= inst.operands[1].imm; + narrow = TRUE; } + } + + if (!narrow) + { if (inst.instruction < 0xffff) inst.instruction = THUMB_OP32 (inst.instruction); - inst.instruction |= inst.operands[0].reg << 16; - inst.instruction |= inst.operands[1].imm; - if (inst.operands[0].writeback) - inst.instruction |= WRITE_BACK; + + encode_thumb2_ldmstm(inst.operands[0].reg, inst.operands[1].imm, + inst.operands[0].writeback); } } else { constraint (inst.operands[0].reg > 7 || (inst.operands[1].imm & ~0xff), BAD_HIREG); + constraint (inst.instruction != T_MNEM_ldmia + && inst.instruction != T_MNEM_stmia, + _("Thumb-2 instruction only valid in unified syntax")); if (inst.instruction == T_MNEM_stmia) { if (!inst.operands[0].writeback) @@ -7209,6 +9441,16 @@ do_t_mov_cmp (void) || inst.operands[1].shifted) narrow = FALSE; + /* MOVS PC, LR is encoded as SUBS PC, LR, #0. */ + if (opcode == T_MNEM_movs && inst.operands[1].isreg + && !inst.operands[1].shifted + && inst.operands[0].reg == REG_PC + && inst.operands[1].reg == REG_LR) + { + inst.instruction = T2_SUBS_PC_LR; + return; + } + if (!inst.operands[1].isreg) { /* Immediate operand. */ @@ -7231,11 +9473,98 @@ do_t_mov_cmp (void) inst.reloc.type = BFD_RELOC_ARM_T32_IMMEDIATE; } } + else if (inst.operands[1].shifted && inst.operands[1].immisreg + && (inst.instruction == T_MNEM_mov + || inst.instruction == T_MNEM_movs)) + { + /* Register shifts are encoded as separate shift instructions. */ + bfd_boolean flags = (inst.instruction == T_MNEM_movs); + + if (current_it_mask) + narrow = !flags; + else + narrow = flags; + + if (inst.size_req == 4) + narrow = FALSE; + + if (!low_regs || inst.operands[1].imm > 7) + narrow = FALSE; + + if (inst.operands[0].reg != inst.operands[1].reg) + narrow = FALSE; + + switch (inst.operands[1].shift_kind) + { + case SHIFT_LSL: + opcode = narrow ? T_OPCODE_LSL_R : THUMB_OP32 (T_MNEM_lsl); + break; + case SHIFT_ASR: + opcode = narrow ? T_OPCODE_ASR_R : THUMB_OP32 (T_MNEM_asr); + break; + case SHIFT_LSR: + opcode = narrow ? T_OPCODE_LSR_R : THUMB_OP32 (T_MNEM_lsr); + break; + case SHIFT_ROR: + opcode = narrow ? T_OPCODE_ROR_R : THUMB_OP32 (T_MNEM_ror); + break; + default: + abort(); + } + + inst.instruction = opcode; + if (narrow) + { + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[1].imm << 3; + } + else + { + if (flags) + inst.instruction |= CONDS_BIT; + + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[1].imm; + } + } else if (!narrow) { - inst.instruction = THUMB_OP32 (inst.instruction); - inst.instruction |= inst.operands[0].reg << r0off; - encode_thumb32_shifted_operand (1); + /* Some mov with immediate shift have narrow variants. + Register shifts are handled above. */ + if (low_regs && inst.operands[1].shifted + && (inst.instruction == T_MNEM_mov + || inst.instruction == T_MNEM_movs)) + { + if (current_it_mask) + narrow = (inst.instruction == T_MNEM_mov); + else + narrow = (inst.instruction == T_MNEM_movs); + } + + if (narrow) + { + switch (inst.operands[1].shift_kind) + { + case SHIFT_LSL: inst.instruction = T_OPCODE_LSL_I; break; + case SHIFT_LSR: inst.instruction = T_OPCODE_LSR_I; break; + case SHIFT_ASR: inst.instruction = T_OPCODE_ASR_I; break; + default: narrow = FALSE; break; + } + } + + if (narrow) + { + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[1].reg << 3; + inst.reloc.type = BFD_RELOC_ARM_THUMB_SHIFT; + } + else + { + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction |= inst.operands[0].reg << r0off; + encode_thumb32_shifted_operand (1); + } } else switch (inst.instruction) @@ -7310,11 +9639,30 @@ do_t_mov_cmp (void) static void do_t_mov16 (void) { + bfd_vma imm; + bfd_boolean top; + + top = (inst.instruction & 0x00800000) != 0; + if (inst.reloc.type == BFD_RELOC_ARM_MOVW) + { + constraint (top, _(":lower16: not allowed this instruction")); + inst.reloc.type = BFD_RELOC_ARM_THUMB_MOVW; + } + else if (inst.reloc.type == BFD_RELOC_ARM_MOVT) + { + constraint (!top, _(":upper16: not allowed this instruction")); + inst.reloc.type = BFD_RELOC_ARM_THUMB_MOVT; + } + inst.instruction |= inst.operands[0].reg << 8; - inst.instruction |= (inst.operands[1].imm & 0xf000) << 4; - inst.instruction |= (inst.operands[1].imm & 0x0800) << 15; - inst.instruction |= (inst.operands[1].imm & 0x0700) << 4; - inst.instruction |= (inst.operands[1].imm & 0x00ff); + if (inst.reloc.type == BFD_RELOC_UNUSED) + { + imm = inst.reloc.exp.X_add_number; + inst.instruction |= (imm & 0xf000) << 4; + inst.instruction |= (imm & 0x0800) << 15; + inst.instruction |= (imm & 0x0700) << 4; + inst.instruction |= (imm & 0x00ff); + } } static void @@ -7388,6 +9736,10 @@ static void do_t_mrs (void) { int flags; + + if (do_vfp_nsyn_mrs () == SUCCESS) + return; + flags = inst.operands[1].imm & (PSR_c|PSR_x|PSR_s|PSR_f|SPSR_BIT); if (flags == 0) { @@ -7415,6 +9767,9 @@ do_t_msr (void) { int flags; + if (do_vfp_nsyn_msr () == SUCCESS) + return; + constraint (!inst.operands[1].isreg, _("Thumb encoding does not support an immediate here")); flags = inst.operands[0].imm; @@ -7589,7 +9944,7 @@ do_t_push_pop (void) mask = inst.operands[0].imm; if ((mask & ~0xff) == 0) - inst.instruction = THUMB_OP16 (inst.instruction); + inst.instruction = THUMB_OP16 (inst.instruction) | mask; else if ((inst.instruction == T_MNEM_push && (mask & ~0xff) == 1 << REG_LR) || (inst.instruction == T_MNEM_pop @@ -7597,43 +9952,18 @@ do_t_push_pop (void) { inst.instruction = THUMB_OP16 (inst.instruction); inst.instruction |= THUMB_PP_PC_LR; - mask &= 0xff; + inst.instruction |= mask & 0xff; } else if (unified_syntax) { - if (mask & (1 << 13)) - inst.error = _("SP not allowed in register list"); - if (inst.instruction == T_MNEM_push) - { - if (mask & (1 << 15)) - inst.error = _("PC not allowed in register list"); - } - else - { - if (mask & (1 << 14) - && mask & (1 << 15)) - inst.error = _("LR and PC should not both be in register list"); - } - if ((mask & (mask - 1)) == 0) - { - /* Single register push/pop implemented as str/ldr. */ - if (inst.instruction == T_MNEM_push) - inst.instruction = 0xf84d0d04; /* str reg, [sp, #-4]! */ - else - inst.instruction = 0xf85d0b04; /* ldr reg, [sp], #4 */ - mask = ffs(mask) - 1; - mask <<= 12; - } - else - inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction = THUMB_OP32 (inst.instruction); + encode_thumb2_ldmstm(13, mask, TRUE); } else { inst.error = _("invalid register list to push/pop instruction"); return; } - - inst.instruction |= mask; } static void @@ -7678,8 +10008,37 @@ do_t_rsb (void) inst.instruction |= Rs << 16; if (!inst.operands[2].isreg) { - inst.instruction = (inst.instruction & 0xe1ffffff) | 0x10000000; - inst.reloc.type = BFD_RELOC_ARM_T32_IMMEDIATE; + bfd_boolean narrow; + + if ((inst.instruction & 0x00100000) != 0) + narrow = (current_it_mask == 0); + else + narrow = (current_it_mask != 0); + + if (Rd > 7 || Rs > 7) + narrow = FALSE; + + if (inst.size_req == 4 || !unified_syntax) + narrow = FALSE; + + if (inst.reloc.exp.X_op != O_constant + || inst.reloc.exp.X_add_number != 0) + narrow = FALSE; + + /* Turn rsb #0 into 16-bit neg. We should probably do this via + relaxation, but it doesn't seem worth the hassle. */ + if (narrow) + { + inst.reloc.type = BFD_RELOC_UNUSED; + inst.instruction = THUMB_OP16 (T_MNEM_negs); + inst.instruction |= Rs << 3; + inst.instruction |= Rd; + } + else + { + inst.instruction = (inst.instruction & 0xe1ffffff) | 0x10000000; + inst.reloc.type = BFD_RELOC_ARM_T32_IMMEDIATE; + } } else encode_thumb32_shifted_operand (2); @@ -7997,6 +10356,3387 @@ do_t_usat16 (void) inst.instruction |= inst.operands[1].imm; inst.instruction |= inst.operands[2].reg << 16; } + +/* Neon instruction encoder helpers. */ + +/* Encodings for the different types for various Neon opcodes. */ + +/* An "invalid" code for the following tables. */ +#define N_INV -1u + +struct neon_tab_entry +{ + unsigned integer; + unsigned float_or_poly; + unsigned scalar_or_imm; +}; + +/* Map overloaded Neon opcodes to their respective encodings. */ +#define NEON_ENC_TAB \ + X(vabd, 0x0000700, 0x1200d00, N_INV), \ + X(vmax, 0x0000600, 0x0000f00, N_INV), \ + X(vmin, 0x0000610, 0x0200f00, N_INV), \ + X(vpadd, 0x0000b10, 0x1000d00, N_INV), \ + X(vpmax, 0x0000a00, 0x1000f00, N_INV), \ + X(vpmin, 0x0000a10, 0x1200f00, N_INV), \ + X(vadd, 0x0000800, 0x0000d00, N_INV), \ + X(vsub, 0x1000800, 0x0200d00, N_INV), \ + X(vceq, 0x1000810, 0x0000e00, 0x1b10100), \ + X(vcge, 0x0000310, 0x1000e00, 0x1b10080), \ + X(vcgt, 0x0000300, 0x1200e00, 0x1b10000), \ + /* Register variants of the following two instructions are encoded as + vcge / vcgt with the operands reversed. */ \ + X(vclt, 0x0000300, 0x1200e00, 0x1b10200), \ + X(vcle, 0x0000310, 0x1000e00, 0x1b10180), \ + X(vmla, 0x0000900, 0x0000d10, 0x0800040), \ + X(vmls, 0x1000900, 0x0200d10, 0x0800440), \ + X(vmul, 0x0000910, 0x1000d10, 0x0800840), \ + X(vmull, 0x0800c00, 0x0800e00, 0x0800a40), /* polynomial not float. */ \ + X(vmlal, 0x0800800, N_INV, 0x0800240), \ + X(vmlsl, 0x0800a00, N_INV, 0x0800640), \ + X(vqdmlal, 0x0800900, N_INV, 0x0800340), \ + X(vqdmlsl, 0x0800b00, N_INV, 0x0800740), \ + X(vqdmull, 0x0800d00, N_INV, 0x0800b40), \ + X(vqdmulh, 0x0000b00, N_INV, 0x0800c40), \ + X(vqrdmulh, 0x1000b00, N_INV, 0x0800d40), \ + X(vshl, 0x0000400, N_INV, 0x0800510), \ + X(vqshl, 0x0000410, N_INV, 0x0800710), \ + X(vand, 0x0000110, N_INV, 0x0800030), \ + X(vbic, 0x0100110, N_INV, 0x0800030), \ + X(veor, 0x1000110, N_INV, N_INV), \ + X(vorn, 0x0300110, N_INV, 0x0800010), \ + X(vorr, 0x0200110, N_INV, 0x0800010), \ + X(vmvn, 0x1b00580, N_INV, 0x0800030), \ + X(vshll, 0x1b20300, N_INV, 0x0800a10), /* max shift, immediate. */ \ + X(vcvt, 0x1b30600, N_INV, 0x0800e10), /* integer, fixed-point. */ \ + X(vdup, 0xe800b10, N_INV, 0x1b00c00), /* arm, scalar. */ \ + X(vld1, 0x0200000, 0x0a00000, 0x0a00c00), /* interlv, lane, dup. */ \ + X(vst1, 0x0000000, 0x0800000, N_INV), \ + X(vld2, 0x0200100, 0x0a00100, 0x0a00d00), \ + X(vst2, 0x0000100, 0x0800100, N_INV), \ + X(vld3, 0x0200200, 0x0a00200, 0x0a00e00), \ + X(vst3, 0x0000200, 0x0800200, N_INV), \ + X(vld4, 0x0200300, 0x0a00300, 0x0a00f00), \ + X(vst4, 0x0000300, 0x0800300, N_INV), \ + X(vmovn, 0x1b20200, N_INV, N_INV), \ + X(vtrn, 0x1b20080, N_INV, N_INV), \ + X(vqmovn, 0x1b20200, N_INV, N_INV), \ + X(vqmovun, 0x1b20240, N_INV, N_INV), \ + X(vnmul, 0xe200a40, 0xe200b40, N_INV), \ + X(vnmla, 0xe000a40, 0xe000b40, N_INV), \ + X(vnmls, 0xe100a40, 0xe100b40, N_INV), \ + X(vcmp, 0xeb40a40, 0xeb40b40, N_INV), \ + X(vcmpz, 0xeb50a40, 0xeb50b40, N_INV), \ + X(vcmpe, 0xeb40ac0, 0xeb40bc0, N_INV), \ + X(vcmpez, 0xeb50ac0, 0xeb50bc0, N_INV) + +enum neon_opc +{ +#define X(OPC,I,F,S) N_MNEM_##OPC +NEON_ENC_TAB +#undef X +}; + +static const struct neon_tab_entry neon_enc_tab[] = +{ +#define X(OPC,I,F,S) { (I), (F), (S) } +NEON_ENC_TAB +#undef X +}; + +#define NEON_ENC_INTEGER(X) (neon_enc_tab[(X) & 0x0fffffff].integer) +#define NEON_ENC_ARMREG(X) (neon_enc_tab[(X) & 0x0fffffff].integer) +#define NEON_ENC_POLY(X) (neon_enc_tab[(X) & 0x0fffffff].float_or_poly) +#define NEON_ENC_FLOAT(X) (neon_enc_tab[(X) & 0x0fffffff].float_or_poly) +#define NEON_ENC_SCALAR(X) (neon_enc_tab[(X) & 0x0fffffff].scalar_or_imm) +#define NEON_ENC_IMMED(X) (neon_enc_tab[(X) & 0x0fffffff].scalar_or_imm) +#define NEON_ENC_INTERLV(X) (neon_enc_tab[(X) & 0x0fffffff].integer) +#define NEON_ENC_LANE(X) (neon_enc_tab[(X) & 0x0fffffff].float_or_poly) +#define NEON_ENC_DUP(X) (neon_enc_tab[(X) & 0x0fffffff].scalar_or_imm) +#define NEON_ENC_SINGLE(X) \ + ((neon_enc_tab[(X) & 0x0fffffff].integer) | ((X) & 0xf0000000)) +#define NEON_ENC_DOUBLE(X) \ + ((neon_enc_tab[(X) & 0x0fffffff].float_or_poly) | ((X) & 0xf0000000)) + +/* Define shapes for instruction operands. The following mnemonic characters + are used in this table: + + F - VFP S register + D - Neon D register + Q - Neon Q register + I - Immediate + S - Scalar + R - ARM register + L - D register list + + This table is used to generate various data: + - enumerations of the form NS_DDR to be used as arguments to + neon_select_shape. + - a table classifying shapes into single, double, quad, mixed. + - a table used to drive neon_select_shape. +*/ + +#define NEON_SHAPE_DEF \ + X(3, (D, D, D), DOUBLE), \ + X(3, (Q, Q, Q), QUAD), \ + X(3, (D, D, I), DOUBLE), \ + X(3, (Q, Q, I), QUAD), \ + X(3, (D, D, S), DOUBLE), \ + X(3, (Q, Q, S), QUAD), \ + X(2, (D, D), DOUBLE), \ + X(2, (Q, Q), QUAD), \ + X(2, (D, S), DOUBLE), \ + X(2, (Q, S), QUAD), \ + X(2, (D, R), DOUBLE), \ + X(2, (Q, R), QUAD), \ + X(2, (D, I), DOUBLE), \ + X(2, (Q, I), QUAD), \ + X(3, (D, L, D), DOUBLE), \ + X(2, (D, Q), MIXED), \ + X(2, (Q, D), MIXED), \ + X(3, (D, Q, I), MIXED), \ + X(3, (Q, D, I), MIXED), \ + X(3, (Q, D, D), MIXED), \ + X(3, (D, Q, Q), MIXED), \ + X(3, (Q, Q, D), MIXED), \ + X(3, (Q, D, S), MIXED), \ + X(3, (D, Q, S), MIXED), \ + X(4, (D, D, D, I), DOUBLE), \ + X(4, (Q, Q, Q, I), QUAD), \ + X(2, (F, F), SINGLE), \ + X(3, (F, F, F), SINGLE), \ + X(2, (F, I), SINGLE), \ + X(2, (F, D), MIXED), \ + X(2, (D, F), MIXED), \ + X(3, (F, F, I), MIXED), \ + X(4, (R, R, F, F), SINGLE), \ + X(4, (F, F, R, R), SINGLE), \ + X(3, (D, R, R), DOUBLE), \ + X(3, (R, R, D), DOUBLE), \ + X(2, (S, R), SINGLE), \ + X(2, (R, S), SINGLE), \ + X(2, (F, R), SINGLE), \ + X(2, (R, F), SINGLE) + +#define S2(A,B) NS_##A##B +#define S3(A,B,C) NS_##A##B##C +#define S4(A,B,C,D) NS_##A##B##C##D + +#define X(N, L, C) S##N L + +enum neon_shape +{ + NEON_SHAPE_DEF, + NS_NULL +}; + +#undef X +#undef S2 +#undef S3 +#undef S4 + +enum neon_shape_class +{ + SC_SINGLE, + SC_DOUBLE, + SC_QUAD, + SC_MIXED +}; + +#define X(N, L, C) SC_##C + +static enum neon_shape_class neon_shape_class[] = +{ + NEON_SHAPE_DEF +}; + +#undef X + +enum neon_shape_el +{ + SE_F, + SE_D, + SE_Q, + SE_I, + SE_S, + SE_R, + SE_L +}; + +/* Register widths of above. */ +static unsigned neon_shape_el_size[] = +{ + 32, + 64, + 128, + 0, + 32, + 32, + 0 +}; + +struct neon_shape_info +{ + unsigned els; + enum neon_shape_el el[NEON_MAX_TYPE_ELS]; +}; + +#define S2(A,B) { SE_##A, SE_##B } +#define S3(A,B,C) { SE_##A, SE_##B, SE_##C } +#define S4(A,B,C,D) { SE_##A, SE_##B, SE_##C, SE_##D } + +#define X(N, L, C) { N, S##N L } + +static struct neon_shape_info neon_shape_tab[] = +{ + NEON_SHAPE_DEF +}; + +#undef X +#undef S2 +#undef S3 +#undef S4 + +/* Bit masks used in type checking given instructions. + 'N_EQK' means the type must be the same as (or based on in some way) the key + type, which itself is marked with the 'N_KEY' bit. If the 'N_EQK' bit is + set, various other bits can be set as well in order to modify the meaning of + the type constraint. */ + +enum neon_type_mask +{ + N_S8 = 0x000001, + N_S16 = 0x000002, + N_S32 = 0x000004, + N_S64 = 0x000008, + N_U8 = 0x000010, + N_U16 = 0x000020, + N_U32 = 0x000040, + N_U64 = 0x000080, + N_I8 = 0x000100, + N_I16 = 0x000200, + N_I32 = 0x000400, + N_I64 = 0x000800, + N_8 = 0x001000, + N_16 = 0x002000, + N_32 = 0x004000, + N_64 = 0x008000, + N_P8 = 0x010000, + N_P16 = 0x020000, + N_F32 = 0x040000, + N_F64 = 0x080000, + N_KEY = 0x100000, /* key element (main type specifier). */ + N_EQK = 0x200000, /* given operand has the same type & size as the key. */ + N_VFP = 0x400000, /* VFP mode: operand size must match register width. */ + N_DBL = 0x000001, /* if N_EQK, this operand is twice the size. */ + N_HLF = 0x000002, /* if N_EQK, this operand is half the size. */ + N_SGN = 0x000004, /* if N_EQK, this operand is forced to be signed. */ + N_UNS = 0x000008, /* if N_EQK, this operand is forced to be unsigned. */ + N_INT = 0x000010, /* if N_EQK, this operand is forced to be integer. */ + N_FLT = 0x000020, /* if N_EQK, this operand is forced to be float. */ + N_SIZ = 0x000040, /* if N_EQK, this operand is forced to be size-only. */ + N_UTYP = 0, + N_MAX_NONSPECIAL = N_F64 +}; + +#define N_ALLMODS (N_DBL | N_HLF | N_SGN | N_UNS | N_INT | N_FLT | N_SIZ) + +#define N_SU_ALL (N_S8 | N_S16 | N_S32 | N_S64 | N_U8 | N_U16 | N_U32 | N_U64) +#define N_SU_32 (N_S8 | N_S16 | N_S32 | N_U8 | N_U16 | N_U32) +#define N_SU_16_64 (N_S16 | N_S32 | N_S64 | N_U16 | N_U32 | N_U64) +#define N_SUF_32 (N_SU_32 | N_F32) +#define N_I_ALL (N_I8 | N_I16 | N_I32 | N_I64) +#define N_IF_32 (N_I8 | N_I16 | N_I32 | N_F32) + +/* Pass this as the first type argument to neon_check_type to ignore types + altogether. */ +#define N_IGNORE_TYPE (N_KEY | N_EQK) + +/* Select a "shape" for the current instruction (describing register types or + sizes) from a list of alternatives. Return NS_NULL if the current instruction + doesn't fit. For non-polymorphic shapes, checking is usually done as a + function of operand parsing, so this function doesn't need to be called. + Shapes should be listed in order of decreasing length. */ + +static enum neon_shape +neon_select_shape (enum neon_shape shape, ...) +{ + va_list ap; + enum neon_shape first_shape = shape; + + /* Fix missing optional operands. FIXME: we don't know at this point how + many arguments we should have, so this makes the assumption that we have + > 1. This is true of all current Neon opcodes, I think, but may not be + true in the future. */ + if (!inst.operands[1].present) + inst.operands[1] = inst.operands[0]; + + va_start (ap, shape); + + for (; shape != NS_NULL; shape = va_arg (ap, int)) + { + unsigned j; + int matches = 1; + + for (j = 0; j < neon_shape_tab[shape].els; j++) + { + if (!inst.operands[j].present) + { + matches = 0; + break; + } + + switch (neon_shape_tab[shape].el[j]) + { + case SE_F: + if (!(inst.operands[j].isreg + && inst.operands[j].isvec + && inst.operands[j].issingle + && !inst.operands[j].isquad)) + matches = 0; + break; + + case SE_D: + if (!(inst.operands[j].isreg + && inst.operands[j].isvec + && !inst.operands[j].isquad + && !inst.operands[j].issingle)) + matches = 0; + break; + + case SE_R: + if (!(inst.operands[j].isreg + && !inst.operands[j].isvec)) + matches = 0; + break; + + case SE_Q: + if (!(inst.operands[j].isreg + && inst.operands[j].isvec + && inst.operands[j].isquad + && !inst.operands[j].issingle)) + matches = 0; + break; + + case SE_I: + if (!(!inst.operands[j].isreg + && !inst.operands[j].isscalar)) + matches = 0; + break; + + case SE_S: + if (!(!inst.operands[j].isreg + && inst.operands[j].isscalar)) + matches = 0; + break; + + case SE_L: + break; + } + } + if (matches) + break; + } + + va_end (ap); + + if (shape == NS_NULL && first_shape != NS_NULL) + first_error (_("invalid instruction shape")); + + return shape; +} + +/* True if SHAPE is predominantly a quadword operation (most of the time, this + means the Q bit should be set). */ + +static int +neon_quad (enum neon_shape shape) +{ + return neon_shape_class[shape] == SC_QUAD; +} + +static void +neon_modify_type_size (unsigned typebits, enum neon_el_type *g_type, + unsigned *g_size) +{ + /* Allow modification to be made to types which are constrained to be + based on the key element, based on bits set alongside N_EQK. */ + if ((typebits & N_EQK) != 0) + { + if ((typebits & N_HLF) != 0) + *g_size /= 2; + else if ((typebits & N_DBL) != 0) + *g_size *= 2; + if ((typebits & N_SGN) != 0) + *g_type = NT_signed; + else if ((typebits & N_UNS) != 0) + *g_type = NT_unsigned; + else if ((typebits & N_INT) != 0) + *g_type = NT_integer; + else if ((typebits & N_FLT) != 0) + *g_type = NT_float; + else if ((typebits & N_SIZ) != 0) + *g_type = NT_untyped; + } +} + +/* Return operand OPNO promoted by bits set in THISARG. KEY should be the "key" + operand type, i.e. the single type specified in a Neon instruction when it + is the only one given. */ + +static struct neon_type_el +neon_type_promote (struct neon_type_el *key, unsigned thisarg) +{ + struct neon_type_el dest = *key; + + assert ((thisarg & N_EQK) != 0); + + neon_modify_type_size (thisarg, &dest.type, &dest.size); + + return dest; +} + +/* Convert Neon type and size into compact bitmask representation. */ + +static enum neon_type_mask +type_chk_of_el_type (enum neon_el_type type, unsigned size) +{ + switch (type) + { + case NT_untyped: + switch (size) + { + case 8: return N_8; + case 16: return N_16; + case 32: return N_32; + case 64: return N_64; + default: ; + } + break; + + case NT_integer: + switch (size) + { + case 8: return N_I8; + case 16: return N_I16; + case 32: return N_I32; + case 64: return N_I64; + default: ; + } + break; + + case NT_float: + switch (size) + { + case 32: return N_F32; + case 64: return N_F64; + default: ; + } + break; + + case NT_poly: + switch (size) + { + case 8: return N_P8; + case 16: return N_P16; + default: ; + } + break; + + case NT_signed: + switch (size) + { + case 8: return N_S8; + case 16: return N_S16; + case 32: return N_S32; + case 64: return N_S64; + default: ; + } + break; + + case NT_unsigned: + switch (size) + { + case 8: return N_U8; + case 16: return N_U16; + case 32: return N_U32; + case 64: return N_U64; + default: ; + } + break; + + default: ; + } + + return N_UTYP; +} + +/* Convert compact Neon bitmask type representation to a type and size. Only + handles the case where a single bit is set in the mask. */ + +static int +el_type_of_type_chk (enum neon_el_type *type, unsigned *size, + enum neon_type_mask mask) +{ + if ((mask & N_EQK) != 0) + return FAIL; + + if ((mask & (N_S8 | N_U8 | N_I8 | N_8 | N_P8)) != 0) + *size = 8; + else if ((mask & (N_S16 | N_U16 | N_I16 | N_16 | N_P16)) != 0) + *size = 16; + else if ((mask & (N_S32 | N_U32 | N_I32 | N_32 | N_F32)) != 0) + *size = 32; + else if ((mask & (N_S64 | N_U64 | N_I64 | N_64 | N_F64)) != 0) + *size = 64; + else + return FAIL; + + if ((mask & (N_S8 | N_S16 | N_S32 | N_S64)) != 0) + *type = NT_signed; + else if ((mask & (N_U8 | N_U16 | N_U32 | N_U64)) != 0) + *type = NT_unsigned; + else if ((mask & (N_I8 | N_I16 | N_I32 | N_I64)) != 0) + *type = NT_integer; + else if ((mask & (N_8 | N_16 | N_32 | N_64)) != 0) + *type = NT_untyped; + else if ((mask & (N_P8 | N_P16)) != 0) + *type = NT_poly; + else if ((mask & (N_F32 | N_F64)) != 0) + *type = NT_float; + else + return FAIL; + + return SUCCESS; +} + +/* Modify a bitmask of allowed types. This is only needed for type + relaxation. */ + +static unsigned +modify_types_allowed (unsigned allowed, unsigned mods) +{ + unsigned size; + enum neon_el_type type; + unsigned destmask; + int i; + + destmask = 0; + + for (i = 1; i <= N_MAX_NONSPECIAL; i <<= 1) + { + if (el_type_of_type_chk (&type, &size, allowed & i) == SUCCESS) + { + neon_modify_type_size (mods, &type, &size); + destmask |= type_chk_of_el_type (type, size); + } + } + + return destmask; +} + +/* Check type and return type classification. + The manual states (paraphrase): If one datatype is given, it indicates the + type given in: + - the second operand, if there is one + - the operand, if there is no second operand + - the result, if there are no operands. + This isn't quite good enough though, so we use a concept of a "key" datatype + which is set on a per-instruction basis, which is the one which matters when + only one data type is written. + Note: this function has side-effects (e.g. filling in missing operands). All + Neon instructions should call it before performing bit encoding. */ + +static struct neon_type_el +neon_check_type (unsigned els, enum neon_shape ns, ...) +{ + va_list ap; + unsigned i, pass, key_el = 0; + unsigned types[NEON_MAX_TYPE_ELS]; + enum neon_el_type k_type = NT_invtype; + unsigned k_size = -1u; + struct neon_type_el badtype = {NT_invtype, -1}; + unsigned key_allowed = 0; + + /* Optional registers in Neon instructions are always (not) in operand 1. + Fill in the missing operand here, if it was omitted. */ + if (els > 1 && !inst.operands[1].present) + inst.operands[1] = inst.operands[0]; + + /* Suck up all the varargs. */ + va_start (ap, ns); + for (i = 0; i < els; i++) + { + unsigned thisarg = va_arg (ap, unsigned); + if (thisarg == N_IGNORE_TYPE) + { + va_end (ap); + return badtype; + } + types[i] = thisarg; + if ((thisarg & N_KEY) != 0) + key_el = i; + } + va_end (ap); + + if (inst.vectype.elems > 0) + for (i = 0; i < els; i++) + if (inst.operands[i].vectype.type != NT_invtype) + { + first_error (_("types specified in both the mnemonic and operands")); + return badtype; + } + + /* Duplicate inst.vectype elements here as necessary. + FIXME: No idea if this is exactly the same as the ARM assembler, + particularly when an insn takes one register and one non-register + operand. */ + if (inst.vectype.elems == 1 && els > 1) + { + unsigned j; + inst.vectype.elems = els; + inst.vectype.el[key_el] = inst.vectype.el[0]; + for (j = 0; j < els; j++) + if (j != key_el) + inst.vectype.el[j] = neon_type_promote (&inst.vectype.el[key_el], + types[j]); + } + else if (inst.vectype.elems == 0 && els > 0) + { + unsigned j; + /* No types were given after the mnemonic, so look for types specified + after each operand. We allow some flexibility here; as long as the + "key" operand has a type, we can infer the others. */ + for (j = 0; j < els; j++) + if (inst.operands[j].vectype.type != NT_invtype) + inst.vectype.el[j] = inst.operands[j].vectype; + + if (inst.operands[key_el].vectype.type != NT_invtype) + { + for (j = 0; j < els; j++) + if (inst.operands[j].vectype.type == NT_invtype) + inst.vectype.el[j] = neon_type_promote (&inst.vectype.el[key_el], + types[j]); + } + else + { + first_error (_("operand types can't be inferred")); + return badtype; + } + } + else if (inst.vectype.elems != els) + { + first_error (_("type specifier has the wrong number of parts")); + return badtype; + } + + for (pass = 0; pass < 2; pass++) + { + for (i = 0; i < els; i++) + { + unsigned thisarg = types[i]; + unsigned types_allowed = ((thisarg & N_EQK) != 0 && pass != 0) + ? modify_types_allowed (key_allowed, thisarg) : thisarg; + enum neon_el_type g_type = inst.vectype.el[i].type; + unsigned g_size = inst.vectype.el[i].size; + + /* Decay more-specific signed & unsigned types to sign-insensitive + integer types if sign-specific variants are unavailable. */ + if ((g_type == NT_signed || g_type == NT_unsigned) + && (types_allowed & N_SU_ALL) == 0) + g_type = NT_integer; + + /* If only untyped args are allowed, decay any more specific types to + them. Some instructions only care about signs for some element + sizes, so handle that properly. */ + if ((g_size == 8 && (types_allowed & N_8) != 0) + || (g_size == 16 && (types_allowed & N_16) != 0) + || (g_size == 32 && (types_allowed & N_32) != 0) + || (g_size == 64 && (types_allowed & N_64) != 0)) + g_type = NT_untyped; + + if (pass == 0) + { + if ((thisarg & N_KEY) != 0) + { + k_type = g_type; + k_size = g_size; + key_allowed = thisarg & ~N_KEY; + } + } + else + { + if ((thisarg & N_VFP) != 0) + { + enum neon_shape_el regshape = neon_shape_tab[ns].el[i]; + unsigned regwidth = neon_shape_el_size[regshape], match; + + /* In VFP mode, operands must match register widths. If we + have a key operand, use its width, else use the width of + the current operand. */ + if (k_size != -1u) + match = k_size; + else + match = g_size; + + if (regwidth != match) + { + first_error (_("operand size must match register width")); + return badtype; + } + } + + if ((thisarg & N_EQK) == 0) + { + unsigned given_type = type_chk_of_el_type (g_type, g_size); + + if ((given_type & types_allowed) == 0) + { + first_error (_("bad type in Neon instruction")); + return badtype; + } + } + else + { + enum neon_el_type mod_k_type = k_type; + unsigned mod_k_size = k_size; + neon_modify_type_size (thisarg, &mod_k_type, &mod_k_size); + if (g_type != mod_k_type || g_size != mod_k_size) + { + first_error (_("inconsistent types in Neon instruction")); + return badtype; + } + } + } + } + } + + return inst.vectype.el[key_el]; +} + +/* Neon-style VFP instruction forwarding. */ + +/* Thumb VFP instructions have 0xE in the condition field. */ + +static void +do_vfp_cond_or_thumb (void) +{ + if (thumb_mode) + inst.instruction |= 0xe0000000; + else + inst.instruction |= inst.cond << 28; +} + +/* Look up and encode a simple mnemonic, for use as a helper function for the + Neon-style VFP syntax. This avoids duplication of bits of the insns table, + etc. It is assumed that operand parsing has already been done, and that the + operands are in the form expected by the given opcode (this isn't necessarily + the same as the form in which they were parsed, hence some massaging must + take place before this function is called). + Checks current arch version against that in the looked-up opcode. */ + +static void +do_vfp_nsyn_opcode (const char *opname) +{ + const struct asm_opcode *opcode; + + opcode = hash_find (arm_ops_hsh, opname); + + if (!opcode) + abort (); + + constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, + thumb_mode ? *opcode->tvariant : *opcode->avariant), + _(BAD_FPU)); + + if (thumb_mode) + { + inst.instruction = opcode->tvalue; + opcode->tencode (); + } + else + { + inst.instruction = (inst.cond << 28) | opcode->avalue; + opcode->aencode (); + } +} + +static void +do_vfp_nsyn_add_sub (enum neon_shape rs) +{ + int is_add = (inst.instruction & 0x0fffffff) == N_MNEM_vadd; + + if (rs == NS_FFF) + { + if (is_add) + do_vfp_nsyn_opcode ("fadds"); + else + do_vfp_nsyn_opcode ("fsubs"); + } + else + { + if (is_add) + do_vfp_nsyn_opcode ("faddd"); + else + do_vfp_nsyn_opcode ("fsubd"); + } +} + +/* Check operand types to see if this is a VFP instruction, and if so call + PFN (). */ + +static int +try_vfp_nsyn (int args, void (*pfn) (enum neon_shape)) +{ + enum neon_shape rs; + struct neon_type_el et; + + switch (args) + { + case 2: + rs = neon_select_shape (NS_FF, NS_DD, NS_NULL); + et = neon_check_type (2, rs, + N_EQK | N_VFP, N_F32 | N_F64 | N_KEY | N_VFP); + break; + + case 3: + rs = neon_select_shape (NS_FFF, NS_DDD, NS_NULL); + et = neon_check_type (3, rs, + N_EQK | N_VFP, N_EQK | N_VFP, N_F32 | N_F64 | N_KEY | N_VFP); + break; + + default: + abort (); + } + + if (et.type != NT_invtype) + { + pfn (rs); + return SUCCESS; + } + else + inst.error = NULL; + + return FAIL; +} + +static void +do_vfp_nsyn_mla_mls (enum neon_shape rs) +{ + int is_mla = (inst.instruction & 0x0fffffff) == N_MNEM_vmla; + + if (rs == NS_FFF) + { + if (is_mla) + do_vfp_nsyn_opcode ("fmacs"); + else + do_vfp_nsyn_opcode ("fmscs"); + } + else + { + if (is_mla) + do_vfp_nsyn_opcode ("fmacd"); + else + do_vfp_nsyn_opcode ("fmscd"); + } +} + +static void +do_vfp_nsyn_mul (enum neon_shape rs) +{ + if (rs == NS_FFF) + do_vfp_nsyn_opcode ("fmuls"); + else + do_vfp_nsyn_opcode ("fmuld"); +} + +static void +do_vfp_nsyn_abs_neg (enum neon_shape rs) +{ + int is_neg = (inst.instruction & 0x80) != 0; + neon_check_type (2, rs, N_EQK | N_VFP, N_F32 | N_F64 | N_VFP | N_KEY); + + if (rs == NS_FF) + { + if (is_neg) + do_vfp_nsyn_opcode ("fnegs"); + else + do_vfp_nsyn_opcode ("fabss"); + } + else + { + if (is_neg) + do_vfp_nsyn_opcode ("fnegd"); + else + do_vfp_nsyn_opcode ("fabsd"); + } +} + +/* Encode single-precision (only!) VFP fldm/fstm instructions. Double precision + insns belong to Neon, and are handled elsewhere. */ + +static void +do_vfp_nsyn_ldm_stm (int is_dbmode) +{ + int is_ldm = (inst.instruction & (1 << 20)) != 0; + if (is_ldm) + { + if (is_dbmode) + do_vfp_nsyn_opcode ("fldmdbs"); + else + do_vfp_nsyn_opcode ("fldmias"); + } + else + { + if (is_dbmode) + do_vfp_nsyn_opcode ("fstmdbs"); + else + do_vfp_nsyn_opcode ("fstmias"); + } +} + +static void +do_vfp_nsyn_sqrt (void) +{ + enum neon_shape rs = neon_select_shape (NS_FF, NS_DD, NS_NULL); + neon_check_type (2, rs, N_EQK | N_VFP, N_F32 | N_F64 | N_KEY | N_VFP); + + if (rs == NS_FF) + do_vfp_nsyn_opcode ("fsqrts"); + else + do_vfp_nsyn_opcode ("fsqrtd"); +} + +static void +do_vfp_nsyn_div (void) +{ + enum neon_shape rs = neon_select_shape (NS_FFF, NS_DDD, NS_NULL); + neon_check_type (3, rs, N_EQK | N_VFP, N_EQK | N_VFP, + N_F32 | N_F64 | N_KEY | N_VFP); + + if (rs == NS_FFF) + do_vfp_nsyn_opcode ("fdivs"); + else + do_vfp_nsyn_opcode ("fdivd"); +} + +static void +do_vfp_nsyn_nmul (void) +{ + enum neon_shape rs = neon_select_shape (NS_FFF, NS_DDD, NS_NULL); + neon_check_type (3, rs, N_EQK | N_VFP, N_EQK | N_VFP, + N_F32 | N_F64 | N_KEY | N_VFP); + + if (rs == NS_FFF) + { + inst.instruction = NEON_ENC_SINGLE (inst.instruction); + do_vfp_sp_dyadic (); + } + else + { + inst.instruction = NEON_ENC_DOUBLE (inst.instruction); + do_vfp_dp_rd_rn_rm (); + } + do_vfp_cond_or_thumb (); +} + +static void +do_vfp_nsyn_cmp (void) +{ + if (inst.operands[1].isreg) + { + enum neon_shape rs = neon_select_shape (NS_FF, NS_DD, NS_NULL); + neon_check_type (2, rs, N_EQK | N_VFP, N_F32 | N_F64 | N_KEY | N_VFP); + + if (rs == NS_FF) + { + inst.instruction = NEON_ENC_SINGLE (inst.instruction); + do_vfp_sp_monadic (); + } + else + { + inst.instruction = NEON_ENC_DOUBLE (inst.instruction); + do_vfp_dp_rd_rm (); + } + } + else + { + enum neon_shape rs = neon_select_shape (NS_FI, NS_DI, NS_NULL); + neon_check_type (2, rs, N_F32 | N_F64 | N_KEY | N_VFP, N_EQK); + + switch (inst.instruction & 0x0fffffff) + { + case N_MNEM_vcmp: + inst.instruction += N_MNEM_vcmpz - N_MNEM_vcmp; + break; + case N_MNEM_vcmpe: + inst.instruction += N_MNEM_vcmpez - N_MNEM_vcmpe; + break; + default: + abort (); + } + + if (rs == NS_FI) + { + inst.instruction = NEON_ENC_SINGLE (inst.instruction); + do_vfp_sp_compare_z (); + } + else + { + inst.instruction = NEON_ENC_DOUBLE (inst.instruction); + do_vfp_dp_rd (); + } + } + do_vfp_cond_or_thumb (); +} + +static void +nsyn_insert_sp (void) +{ + inst.operands[1] = inst.operands[0]; + memset (&inst.operands[0], '\0', sizeof (inst.operands[0])); + inst.operands[0].reg = 13; + inst.operands[0].isreg = 1; + inst.operands[0].writeback = 1; + inst.operands[0].present = 1; +} + +static void +do_vfp_nsyn_push (void) +{ + nsyn_insert_sp (); + if (inst.operands[1].issingle) + do_vfp_nsyn_opcode ("fstmdbs"); + else + do_vfp_nsyn_opcode ("fstmdbd"); +} + +static void +do_vfp_nsyn_pop (void) +{ + nsyn_insert_sp (); + if (inst.operands[1].issingle) + do_vfp_nsyn_opcode ("fldmias"); + else + do_vfp_nsyn_opcode ("fldmiad"); +} + +/* Fix up Neon data-processing instructions, ORing in the correct bits for + ARM mode or Thumb mode and moving the encoded bit 24 to bit 28. */ + +static unsigned +neon_dp_fixup (unsigned i) +{ + if (thumb_mode) + { + /* The U bit is at bit 24 by default. Move to bit 28 in Thumb mode. */ + if (i & (1 << 24)) + i |= 1 << 28; + + i &= ~(1 << 24); + + i |= 0xef000000; + } + else + i |= 0xf2000000; + + return i; +} + +/* Turn a size (8, 16, 32, 64) into the respective bit number minus 3 + (0, 1, 2, 3). */ + +static unsigned +neon_logbits (unsigned x) +{ + return ffs (x) - 4; +} + +#define LOW4(R) ((R) & 0xf) +#define HI1(R) (((R) >> 4) & 1) + +/* Encode insns with bit pattern: + + |28/24|23|22 |21 20|19 16|15 12|11 8|7|6|5|4|3 0| + | U |x |D |size | Rn | Rd |x x x x|N|Q|M|x| Rm | + + SIZE is passed in bits. -1 means size field isn't changed, in case it has a + different meaning for some instruction. */ + +static void +neon_three_same (int isquad, int ubit, int size) +{ + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg) << 16; + inst.instruction |= HI1 (inst.operands[1].reg) << 7; + inst.instruction |= LOW4 (inst.operands[2].reg); + inst.instruction |= HI1 (inst.operands[2].reg) << 5; + inst.instruction |= (isquad != 0) << 6; + inst.instruction |= (ubit != 0) << 24; + if (size != -1) + inst.instruction |= neon_logbits (size) << 20; + + inst.instruction = neon_dp_fixup (inst.instruction); +} + +/* Encode instructions of the form: + + |28/24|23|22|21 20|19 18|17 16|15 12|11 7|6|5|4|3 0| + | U |x |D |x x |size |x x | Rd |x x x x x|Q|M|x| Rm | + + Don't write size if SIZE == -1. */ + +static void +neon_two_same (int qbit, int ubit, int size) +{ + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg); + inst.instruction |= HI1 (inst.operands[1].reg) << 5; + inst.instruction |= (qbit != 0) << 6; + inst.instruction |= (ubit != 0) << 24; + + if (size != -1) + inst.instruction |= neon_logbits (size) << 18; + + inst.instruction = neon_dp_fixup (inst.instruction); +} + +/* Neon instruction encoders, in approximate order of appearance. */ + +static void +do_neon_dyadic_i_su (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, + N_EQK, N_EQK, N_SU_32 | N_KEY); + neon_three_same (neon_quad (rs), et.type == NT_unsigned, et.size); +} + +static void +do_neon_dyadic_i64_su (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, + N_EQK, N_EQK, N_SU_ALL | N_KEY); + neon_three_same (neon_quad (rs), et.type == NT_unsigned, et.size); +} + +static void +neon_imm_shift (int write_ubit, int uval, int isquad, struct neon_type_el et, + unsigned immbits) +{ + unsigned size = et.size >> 3; + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg); + inst.instruction |= HI1 (inst.operands[1].reg) << 5; + inst.instruction |= (isquad != 0) << 6; + inst.instruction |= immbits << 16; + inst.instruction |= (size >> 3) << 7; + inst.instruction |= (size & 0x7) << 19; + if (write_ubit) + inst.instruction |= (uval != 0) << 24; + + inst.instruction = neon_dp_fixup (inst.instruction); +} + +static void +do_neon_shl_imm (void) +{ + if (!inst.operands[2].isreg) + { + enum neon_shape rs = neon_select_shape (NS_DDI, NS_QQI, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, N_EQK, N_KEY | N_I_ALL); + inst.instruction = NEON_ENC_IMMED (inst.instruction); + neon_imm_shift (FALSE, 0, neon_quad (rs), et, inst.operands[2].imm); + } + else + { + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, + N_EQK, N_SU_ALL | N_KEY, N_EQK | N_SGN); + unsigned int tmp; + + /* VSHL/VQSHL 3-register variants have syntax such as: + vshl.xx Dd, Dm, Dn + whereas other 3-register operations encoded by neon_three_same have + syntax like: + vadd.xx Dd, Dn, Dm + (i.e. with Dn & Dm reversed). Swap operands[1].reg and operands[2].reg + here. */ + tmp = inst.operands[2].reg; + inst.operands[2].reg = inst.operands[1].reg; + inst.operands[1].reg = tmp; + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + neon_three_same (neon_quad (rs), et.type == NT_unsigned, et.size); + } +} + +static void +do_neon_qshl_imm (void) +{ + if (!inst.operands[2].isreg) + { + enum neon_shape rs = neon_select_shape (NS_DDI, NS_QQI, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, N_EQK, N_SU_ALL | N_KEY); + + inst.instruction = NEON_ENC_IMMED (inst.instruction); + neon_imm_shift (TRUE, et.type == NT_unsigned, neon_quad (rs), et, + inst.operands[2].imm); + } + else + { + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, + N_EQK, N_SU_ALL | N_KEY, N_EQK | N_SGN); + unsigned int tmp; + + /* See note in do_neon_shl_imm. */ + tmp = inst.operands[2].reg; + inst.operands[2].reg = inst.operands[1].reg; + inst.operands[1].reg = tmp; + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + neon_three_same (neon_quad (rs), et.type == NT_unsigned, et.size); + } +} + +static void +do_neon_rshl (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, + N_EQK, N_EQK, N_SU_ALL | N_KEY); + unsigned int tmp; + + tmp = inst.operands[2].reg; + inst.operands[2].reg = inst.operands[1].reg; + inst.operands[1].reg = tmp; + neon_three_same (neon_quad (rs), et.type == NT_unsigned, et.size); +} + +static int +neon_cmode_for_logic_imm (unsigned immediate, unsigned *immbits, int size) +{ + /* Handle .I8 pseudo-instructions. */ + if (size == 8) + { + /* Unfortunately, this will make everything apart from zero out-of-range. + FIXME is this the intended semantics? There doesn't seem much point in + accepting .I8 if so. */ + immediate |= immediate << 8; + size = 16; + } + + if (size >= 32) + { + if (immediate == (immediate & 0x000000ff)) + { + *immbits = immediate; + return 0x1; + } + else if (immediate == (immediate & 0x0000ff00)) + { + *immbits = immediate >> 8; + return 0x3; + } + else if (immediate == (immediate & 0x00ff0000)) + { + *immbits = immediate >> 16; + return 0x5; + } + else if (immediate == (immediate & 0xff000000)) + { + *immbits = immediate >> 24; + return 0x7; + } + if ((immediate & 0xffff) != (immediate >> 16)) + goto bad_immediate; + immediate &= 0xffff; + } + + if (immediate == (immediate & 0x000000ff)) + { + *immbits = immediate; + return 0x9; + } + else if (immediate == (immediate & 0x0000ff00)) + { + *immbits = immediate >> 8; + return 0xb; + } + + bad_immediate: + first_error (_("immediate value out of range")); + return FAIL; +} + +/* True if IMM has form 0bAAAAAAAABBBBBBBBCCCCCCCCDDDDDDDD for bits + A, B, C, D. */ + +static int +neon_bits_same_in_bytes (unsigned imm) +{ + return ((imm & 0x000000ff) == 0 || (imm & 0x000000ff) == 0x000000ff) + && ((imm & 0x0000ff00) == 0 || (imm & 0x0000ff00) == 0x0000ff00) + && ((imm & 0x00ff0000) == 0 || (imm & 0x00ff0000) == 0x00ff0000) + && ((imm & 0xff000000) == 0 || (imm & 0xff000000) == 0xff000000); +} + +/* For immediate of above form, return 0bABCD. */ + +static unsigned +neon_squash_bits (unsigned imm) +{ + return (imm & 0x01) | ((imm & 0x0100) >> 7) | ((imm & 0x010000) >> 14) + | ((imm & 0x01000000) >> 21); +} + +/* Compress quarter-float representation to 0b...000 abcdefgh. */ + +static unsigned +neon_qfloat_bits (unsigned imm) +{ + return ((imm >> 19) & 0x7f) | ((imm >> 24) & 0x80); +} + +/* Returns CMODE. IMMBITS [7:0] is set to bits suitable for inserting into + the instruction. *OP is passed as the initial value of the op field, and + may be set to a different value depending on the constant (i.e. + "MOV I64, 0bAAAAAAAABBBB..." which uses OP = 1 despite being MOV not + MVN). If the immediate looks like a repeated parttern then also + try smaller element sizes. */ + +static int +neon_cmode_for_move_imm (unsigned immlo, unsigned immhi, int float_p, + unsigned *immbits, int *op, int size, + enum neon_el_type type) +{ + /* Only permit float immediates (including 0.0/-0.0) if the operand type is + float. */ + if (type == NT_float && !float_p) + return FAIL; + + if (type == NT_float && is_quarter_float (immlo) && immhi == 0) + { + if (size != 32 || *op == 1) + return FAIL; + *immbits = neon_qfloat_bits (immlo); + return 0xf; + } + + if (size == 64) + { + if (neon_bits_same_in_bytes (immhi) + && neon_bits_same_in_bytes (immlo)) + { + if (*op == 1) + return FAIL; + *immbits = (neon_squash_bits (immhi) << 4) + | neon_squash_bits (immlo); + *op = 1; + return 0xe; + } + + if (immhi != immlo) + return FAIL; + } + + if (size >= 32) + { + if (immlo == (immlo & 0x000000ff)) + { + *immbits = immlo; + return 0x0; + } + else if (immlo == (immlo & 0x0000ff00)) + { + *immbits = immlo >> 8; + return 0x2; + } + else if (immlo == (immlo & 0x00ff0000)) + { + *immbits = immlo >> 16; + return 0x4; + } + else if (immlo == (immlo & 0xff000000)) + { + *immbits = immlo >> 24; + return 0x6; + } + else if (immlo == ((immlo & 0x0000ff00) | 0x000000ff)) + { + *immbits = (immlo >> 8) & 0xff; + return 0xc; + } + else if (immlo == ((immlo & 0x00ff0000) | 0x0000ffff)) + { + *immbits = (immlo >> 16) & 0xff; + return 0xd; + } + + if ((immlo & 0xffff) != (immlo >> 16)) + return FAIL; + immlo &= 0xffff; + } + + if (size >= 16) + { + if (immlo == (immlo & 0x000000ff)) + { + *immbits = immlo; + return 0x8; + } + else if (immlo == (immlo & 0x0000ff00)) + { + *immbits = immlo >> 8; + return 0xa; + } + + if ((immlo & 0xff) != (immlo >> 8)) + return FAIL; + immlo &= 0xff; + } + + if (immlo == (immlo & 0x000000ff)) + { + /* Don't allow MVN with 8-bit immediate. */ + if (*op == 1) + return FAIL; + *immbits = immlo; + return 0xe; + } + + return FAIL; +} + +/* Write immediate bits [7:0] to the following locations: + + |28/24|23 19|18 16|15 4|3 0| + | a |x x x x x|b c d|x x x x x x x x x x x x|e f g h| + + This function is used by VMOV/VMVN/VORR/VBIC. */ + +static void +neon_write_immbits (unsigned immbits) +{ + inst.instruction |= immbits & 0xf; + inst.instruction |= ((immbits >> 4) & 0x7) << 16; + inst.instruction |= ((immbits >> 7) & 0x1) << 24; +} + +/* Invert low-order SIZE bits of XHI:XLO. */ + +static void +neon_invert_size (unsigned *xlo, unsigned *xhi, int size) +{ + unsigned immlo = xlo ? *xlo : 0; + unsigned immhi = xhi ? *xhi : 0; + + switch (size) + { + case 8: + immlo = (~immlo) & 0xff; + break; + + case 16: + immlo = (~immlo) & 0xffff; + break; + + case 64: + immhi = (~immhi) & 0xffffffff; + /* fall through. */ + + case 32: + immlo = (~immlo) & 0xffffffff; + break; + + default: + abort (); + } + + if (xlo) + *xlo = immlo; + + if (xhi) + *xhi = immhi; +} + +static void +do_neon_logic (void) +{ + if (inst.operands[2].present && inst.operands[2].isreg) + { + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + neon_check_type (3, rs, N_IGNORE_TYPE); + /* U bit and size field were set as part of the bitmask. */ + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + neon_three_same (neon_quad (rs), 0, -1); + } + else + { + enum neon_shape rs = neon_select_shape (NS_DI, NS_QI, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_I8 | N_I16 | N_I32 | N_I64 | N_F32 | N_KEY, N_EQK); + enum neon_opc opcode = inst.instruction & 0x0fffffff; + unsigned immbits; + int cmode; + + if (et.type == NT_invtype) + return; + + inst.instruction = NEON_ENC_IMMED (inst.instruction); + + immbits = inst.operands[1].imm; + if (et.size == 64) + { + /* .i64 is a pseudo-op, so the immediate must be a repeating + pattern. */ + if (immbits != (inst.operands[1].regisimm ? + inst.operands[1].reg : 0)) + { + /* Set immbits to an invalid constant. */ + immbits = 0xdeadbeef; + } + } + + switch (opcode) + { + case N_MNEM_vbic: + cmode = neon_cmode_for_logic_imm (immbits, &immbits, et.size); + break; + + case N_MNEM_vorr: + cmode = neon_cmode_for_logic_imm (immbits, &immbits, et.size); + break; + + case N_MNEM_vand: + /* Pseudo-instruction for VBIC. */ + neon_invert_size (&immbits, 0, et.size); + cmode = neon_cmode_for_logic_imm (immbits, &immbits, et.size); + break; + + case N_MNEM_vorn: + /* Pseudo-instruction for VORR. */ + neon_invert_size (&immbits, 0, et.size); + cmode = neon_cmode_for_logic_imm (immbits, &immbits, et.size); + break; + + default: + abort (); + } + + if (cmode == FAIL) + return; + + inst.instruction |= neon_quad (rs) << 6; + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= cmode << 8; + neon_write_immbits (immbits); + + inst.instruction = neon_dp_fixup (inst.instruction); + } +} + +static void +do_neon_bitfield (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + neon_check_type (3, rs, N_IGNORE_TYPE); + neon_three_same (neon_quad (rs), 0, -1); +} + +static void +neon_dyadic_misc (enum neon_el_type ubit_meaning, unsigned types, + unsigned destbits) +{ + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, N_EQK | destbits, N_EQK, + types | N_KEY); + if (et.type == NT_float) + { + inst.instruction = NEON_ENC_FLOAT (inst.instruction); + neon_three_same (neon_quad (rs), 0, -1); + } + else + { + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + neon_three_same (neon_quad (rs), et.type == ubit_meaning, et.size); + } +} + +static void +do_neon_dyadic_if_su (void) +{ + neon_dyadic_misc (NT_unsigned, N_SUF_32, 0); +} + +static void +do_neon_dyadic_if_su_d (void) +{ + /* This version only allow D registers, but that constraint is enforced during + operand parsing so we don't need to do anything extra here. */ + neon_dyadic_misc (NT_unsigned, N_SUF_32, 0); +} + +static void +do_neon_dyadic_if_i_d (void) +{ + /* The "untyped" case can't happen. Do this to stop the "U" bit being + affected if we specify unsigned args. */ + neon_dyadic_misc (NT_untyped, N_IF_32, 0); +} + +enum vfp_or_neon_is_neon_bits +{ + NEON_CHECK_CC = 1, + NEON_CHECK_ARCH = 2 +}; + +/* Call this function if an instruction which may have belonged to the VFP or + Neon instruction sets, but turned out to be a Neon instruction (due to the + operand types involved, etc.). We have to check and/or fix-up a couple of + things: + + - Make sure the user hasn't attempted to make a Neon instruction + conditional. + - Alter the value in the condition code field if necessary. + - Make sure that the arch supports Neon instructions. + + Which of these operations take place depends on bits from enum + vfp_or_neon_is_neon_bits. + + WARNING: This function has side effects! If NEON_CHECK_CC is used and the + current instruction's condition is COND_ALWAYS, the condition field is + changed to inst.uncond_value. This is necessary because instructions shared + between VFP and Neon may be conditional for the VFP variants only, and the + unconditional Neon version must have, e.g., 0xF in the condition field. */ + +static int +vfp_or_neon_is_neon (unsigned check) +{ + /* Conditions are always legal in Thumb mode (IT blocks). */ + if (!thumb_mode && (check & NEON_CHECK_CC)) + { + if (inst.cond != COND_ALWAYS) + { + first_error (_(BAD_COND)); + return FAIL; + } + if (inst.uncond_value != -1) + inst.instruction |= inst.uncond_value << 28; + } + + if ((check & NEON_CHECK_ARCH) + && !ARM_CPU_HAS_FEATURE (cpu_variant, fpu_neon_ext_v1)) + { + first_error (_(BAD_FPU)); + return FAIL; + } + + return SUCCESS; +} + +static void +do_neon_addsub_if_i (void) +{ + if (try_vfp_nsyn (3, do_vfp_nsyn_add_sub) == SUCCESS) + return; + + if (vfp_or_neon_is_neon (NEON_CHECK_CC | NEON_CHECK_ARCH) == FAIL) + return; + + /* The "untyped" case can't happen. Do this to stop the "U" bit being + affected if we specify unsigned args. */ + neon_dyadic_misc (NT_untyped, N_IF_32 | N_I64, 0); +} + +/* Swaps operands 1 and 2. If operand 1 (optional arg) was omitted, we want the + result to be: + V A,B (A is operand 0, B is operand 2) + to mean: + V A,B,A + not: + V A,B,B + so handle that case specially. */ + +static void +neon_exchange_operands (void) +{ + void *scratch = alloca (sizeof (inst.operands[0])); + if (inst.operands[1].present) + { + /* Swap operands[1] and operands[2]. */ + memcpy (scratch, &inst.operands[1], sizeof (inst.operands[0])); + inst.operands[1] = inst.operands[2]; + memcpy (&inst.operands[2], scratch, sizeof (inst.operands[0])); + } + else + { + inst.operands[1] = inst.operands[2]; + inst.operands[2] = inst.operands[0]; + } +} + +static void +neon_compare (unsigned regtypes, unsigned immtypes, int invert) +{ + if (inst.operands[2].isreg) + { + if (invert) + neon_exchange_operands (); + neon_dyadic_misc (NT_unsigned, regtypes, N_SIZ); + } + else + { + enum neon_shape rs = neon_select_shape (NS_DDI, NS_QQI, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK | N_SIZ, immtypes | N_KEY); + + inst.instruction = NEON_ENC_IMMED (inst.instruction); + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg); + inst.instruction |= HI1 (inst.operands[1].reg) << 5; + inst.instruction |= neon_quad (rs) << 6; + inst.instruction |= (et.type == NT_float) << 10; + inst.instruction |= neon_logbits (et.size) << 18; + + inst.instruction = neon_dp_fixup (inst.instruction); + } +} + +static void +do_neon_cmp (void) +{ + neon_compare (N_SUF_32, N_S8 | N_S16 | N_S32 | N_F32, FALSE); +} + +static void +do_neon_cmp_inv (void) +{ + neon_compare (N_SUF_32, N_S8 | N_S16 | N_S32 | N_F32, TRUE); +} + +static void +do_neon_ceq (void) +{ + neon_compare (N_IF_32, N_IF_32, FALSE); +} + +/* For multiply instructions, we have the possibility of 16-bit or 32-bit + scalars, which are encoded in 5 bits, M : Rm. + For 16-bit scalars, the register is encoded in Rm[2:0] and the index in + M:Rm[3], and for 32-bit scalars, the register is encoded in Rm[3:0] and the + index in M. */ + +static unsigned +neon_scalar_for_mul (unsigned scalar, unsigned elsize) +{ + unsigned regno = NEON_SCALAR_REG (scalar); + unsigned elno = NEON_SCALAR_INDEX (scalar); + + switch (elsize) + { + case 16: + if (regno > 7 || elno > 3) + goto bad_scalar; + return regno | (elno << 3); + + case 32: + if (regno > 15 || elno > 1) + goto bad_scalar; + return regno | (elno << 4); + + default: + bad_scalar: + first_error (_("scalar out of range for multiply instruction")); + } + + return 0; +} + +/* Encode multiply / multiply-accumulate scalar instructions. */ + +static void +neon_mul_mac (struct neon_type_el et, int ubit) +{ + unsigned scalar; + + /* Give a more helpful error message if we have an invalid type. */ + if (et.type == NT_invtype) + return; + + scalar = neon_scalar_for_mul (inst.operands[2].reg, et.size); + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg) << 16; + inst.instruction |= HI1 (inst.operands[1].reg) << 7; + inst.instruction |= LOW4 (scalar); + inst.instruction |= HI1 (scalar) << 5; + inst.instruction |= (et.type == NT_float) << 8; + inst.instruction |= neon_logbits (et.size) << 20; + inst.instruction |= (ubit != 0) << 24; + + inst.instruction = neon_dp_fixup (inst.instruction); +} + +static void +do_neon_mac_maybe_scalar (void) +{ + if (try_vfp_nsyn (3, do_vfp_nsyn_mla_mls) == SUCCESS) + return; + + if (vfp_or_neon_is_neon (NEON_CHECK_CC | NEON_CHECK_ARCH) == FAIL) + return; + + if (inst.operands[2].isscalar) + { + enum neon_shape rs = neon_select_shape (NS_DDS, NS_QQS, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, + N_EQK, N_EQK, N_I16 | N_I32 | N_F32 | N_KEY); + inst.instruction = NEON_ENC_SCALAR (inst.instruction); + neon_mul_mac (et, neon_quad (rs)); + } + else + { + /* The "untyped" case can't happen. Do this to stop the "U" bit being + affected if we specify unsigned args. */ + neon_dyadic_misc (NT_untyped, N_IF_32, 0); + } +} + +static void +do_neon_tst (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, + N_EQK, N_EQK, N_8 | N_16 | N_32 | N_KEY); + neon_three_same (neon_quad (rs), 0, et.size); +} + +/* VMUL with 3 registers allows the P8 type. The scalar version supports the + same types as the MAC equivalents. The polynomial type for this instruction + is encoded the same as the integer type. */ + +static void +do_neon_mul (void) +{ + if (try_vfp_nsyn (3, do_vfp_nsyn_mul) == SUCCESS) + return; + + if (vfp_or_neon_is_neon (NEON_CHECK_CC | NEON_CHECK_ARCH) == FAIL) + return; + + if (inst.operands[2].isscalar) + do_neon_mac_maybe_scalar (); + else + neon_dyadic_misc (NT_poly, N_I8 | N_I16 | N_I32 | N_F32 | N_P8, 0); +} + +static void +do_neon_qdmulh (void) +{ + if (inst.operands[2].isscalar) + { + enum neon_shape rs = neon_select_shape (NS_DDS, NS_QQS, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, + N_EQK, N_EQK, N_S16 | N_S32 | N_KEY); + inst.instruction = NEON_ENC_SCALAR (inst.instruction); + neon_mul_mac (et, neon_quad (rs)); + } + else + { + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, + N_EQK, N_EQK, N_S16 | N_S32 | N_KEY); + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + /* The U bit (rounding) comes from bit mask. */ + neon_three_same (neon_quad (rs), 0, et.size); + } +} + +static void +do_neon_fcmp_absolute (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + neon_check_type (3, rs, N_EQK, N_EQK, N_F32 | N_KEY); + /* Size field comes from bit mask. */ + neon_three_same (neon_quad (rs), 1, -1); +} + +static void +do_neon_fcmp_absolute_inv (void) +{ + neon_exchange_operands (); + do_neon_fcmp_absolute (); +} + +static void +do_neon_step (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + neon_check_type (3, rs, N_EQK, N_EQK, N_F32 | N_KEY); + neon_three_same (neon_quad (rs), 0, -1); +} + +static void +do_neon_abs_neg (void) +{ + enum neon_shape rs; + struct neon_type_el et; + + if (try_vfp_nsyn (2, do_vfp_nsyn_abs_neg) == SUCCESS) + return; + + if (vfp_or_neon_is_neon (NEON_CHECK_CC | NEON_CHECK_ARCH) == FAIL) + return; + + rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + et = neon_check_type (2, rs, N_EQK, N_S8 | N_S16 | N_S32 | N_F32 | N_KEY); + + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg); + inst.instruction |= HI1 (inst.operands[1].reg) << 5; + inst.instruction |= neon_quad (rs) << 6; + inst.instruction |= (et.type == NT_float) << 10; + inst.instruction |= neon_logbits (et.size) << 18; + + inst.instruction = neon_dp_fixup (inst.instruction); +} + +static void +do_neon_sli (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDI, NS_QQI, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK, N_8 | N_16 | N_32 | N_64 | N_KEY); + int imm = inst.operands[2].imm; + constraint (imm < 0 || (unsigned)imm >= et.size, + _("immediate out of range for insert")); + neon_imm_shift (FALSE, 0, neon_quad (rs), et, imm); +} + +static void +do_neon_sri (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDI, NS_QQI, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK, N_8 | N_16 | N_32 | N_64 | N_KEY); + int imm = inst.operands[2].imm; + constraint (imm < 1 || (unsigned)imm > et.size, + _("immediate out of range for insert")); + neon_imm_shift (FALSE, 0, neon_quad (rs), et, et.size - imm); +} + +static void +do_neon_qshlu_imm (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDI, NS_QQI, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK | N_UNS, N_S8 | N_S16 | N_S32 | N_S64 | N_KEY); + int imm = inst.operands[2].imm; + constraint (imm < 0 || (unsigned)imm >= et.size, + _("immediate out of range for shift")); + /* Only encodes the 'U present' variant of the instruction. + In this case, signed types have OP (bit 8) set to 0. + Unsigned types have OP set to 1. */ + inst.instruction |= (et.type == NT_unsigned) << 8; + /* The rest of the bits are the same as other immediate shifts. */ + neon_imm_shift (FALSE, 0, neon_quad (rs), et, imm); +} + +static void +do_neon_qmovn (void) +{ + struct neon_type_el et = neon_check_type (2, NS_DQ, + N_EQK | N_HLF, N_SU_16_64 | N_KEY); + /* Saturating move where operands can be signed or unsigned, and the + destination has the same signedness. */ + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + if (et.type == NT_unsigned) + inst.instruction |= 0xc0; + else + inst.instruction |= 0x80; + neon_two_same (0, 1, et.size / 2); +} + +static void +do_neon_qmovun (void) +{ + struct neon_type_el et = neon_check_type (2, NS_DQ, + N_EQK | N_HLF | N_UNS, N_S16 | N_S32 | N_S64 | N_KEY); + /* Saturating move with unsigned results. Operands must be signed. */ + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + neon_two_same (0, 1, et.size / 2); +} + +static void +do_neon_rshift_sat_narrow (void) +{ + /* FIXME: Types for narrowing. If operands are signed, results can be signed + or unsigned. If operands are unsigned, results must also be unsigned. */ + struct neon_type_el et = neon_check_type (2, NS_DQI, + N_EQK | N_HLF, N_SU_16_64 | N_KEY); + int imm = inst.operands[2].imm; + /* This gets the bounds check, size encoding and immediate bits calculation + right. */ + et.size /= 2; + + /* VQ{R}SHRN.I
, , #0 is a synonym for + VQMOVN.I
, . */ + if (imm == 0) + { + inst.operands[2].present = 0; + inst.instruction = N_MNEM_vqmovn; + do_neon_qmovn (); + return; + } + + constraint (imm < 1 || (unsigned)imm > et.size, + _("immediate out of range")); + neon_imm_shift (TRUE, et.type == NT_unsigned, 0, et, et.size - imm); +} + +static void +do_neon_rshift_sat_narrow_u (void) +{ + /* FIXME: Types for narrowing. If operands are signed, results can be signed + or unsigned. If operands are unsigned, results must also be unsigned. */ + struct neon_type_el et = neon_check_type (2, NS_DQI, + N_EQK | N_HLF | N_UNS, N_S16 | N_S32 | N_S64 | N_KEY); + int imm = inst.operands[2].imm; + /* This gets the bounds check, size encoding and immediate bits calculation + right. */ + et.size /= 2; + + /* VQSHRUN.I
, , #0 is a synonym for + VQMOVUN.I
, . */ + if (imm == 0) + { + inst.operands[2].present = 0; + inst.instruction = N_MNEM_vqmovun; + do_neon_qmovun (); + return; + } + + constraint (imm < 1 || (unsigned)imm > et.size, + _("immediate out of range")); + /* FIXME: The manual is kind of unclear about what value U should have in + VQ{R}SHRUN instructions, but U=0, op=0 definitely encodes VRSHR, so it + must be 1. */ + neon_imm_shift (TRUE, 1, 0, et, et.size - imm); +} + +static void +do_neon_movn (void) +{ + struct neon_type_el et = neon_check_type (2, NS_DQ, + N_EQK | N_HLF, N_I16 | N_I32 | N_I64 | N_KEY); + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + neon_two_same (0, 1, et.size / 2); +} + +static void +do_neon_rshift_narrow (void) +{ + struct neon_type_el et = neon_check_type (2, NS_DQI, + N_EQK | N_HLF, N_I16 | N_I32 | N_I64 | N_KEY); + int imm = inst.operands[2].imm; + /* This gets the bounds check, size encoding and immediate bits calculation + right. */ + et.size /= 2; + + /* If immediate is zero then we are a pseudo-instruction for + VMOVN.I
, */ + if (imm == 0) + { + inst.operands[2].present = 0; + inst.instruction = N_MNEM_vmovn; + do_neon_movn (); + return; + } + + constraint (imm < 1 || (unsigned)imm > et.size, + _("immediate out of range for narrowing operation")); + neon_imm_shift (FALSE, 0, 0, et, et.size - imm); +} + +static void +do_neon_shll (void) +{ + /* FIXME: Type checking when lengthening. */ + struct neon_type_el et = neon_check_type (2, NS_QDI, + N_EQK | N_DBL, N_I8 | N_I16 | N_I32 | N_KEY); + unsigned imm = inst.operands[2].imm; + + if (imm == et.size) + { + /* Maximum shift variant. */ + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg); + inst.instruction |= HI1 (inst.operands[1].reg) << 5; + inst.instruction |= neon_logbits (et.size) << 18; + + inst.instruction = neon_dp_fixup (inst.instruction); + } + else + { + /* A more-specific type check for non-max versions. */ + et = neon_check_type (2, NS_QDI, + N_EQK | N_DBL, N_SU_32 | N_KEY); + inst.instruction = NEON_ENC_IMMED (inst.instruction); + neon_imm_shift (TRUE, et.type == NT_unsigned, 0, et, imm); + } +} + +/* Check the various types for the VCVT instruction, and return which version + the current instruction is. */ + +static int +neon_cvt_flavour (enum neon_shape rs) +{ +#define CVT_VAR(C,X,Y) \ + et = neon_check_type (2, rs, whole_reg | (X), whole_reg | (Y)); \ + if (et.type != NT_invtype) \ + { \ + inst.error = NULL; \ + return (C); \ + } + struct neon_type_el et; + unsigned whole_reg = (rs == NS_FFI || rs == NS_FD || rs == NS_DF + || rs == NS_FF) ? N_VFP : 0; + /* The instruction versions which take an immediate take one register + argument, which is extended to the width of the full register. Thus the + "source" and "destination" registers must have the same width. Hack that + here by making the size equal to the key (wider, in this case) operand. */ + unsigned key = (rs == NS_QQI || rs == NS_DDI || rs == NS_FFI) ? N_KEY : 0; + + CVT_VAR (0, N_S32, N_F32); + CVT_VAR (1, N_U32, N_F32); + CVT_VAR (2, N_F32, N_S32); + CVT_VAR (3, N_F32, N_U32); + + whole_reg = N_VFP; + + /* VFP instructions. */ + CVT_VAR (4, N_F32, N_F64); + CVT_VAR (5, N_F64, N_F32); + CVT_VAR (6, N_S32, N_F64 | key); + CVT_VAR (7, N_U32, N_F64 | key); + CVT_VAR (8, N_F64 | key, N_S32); + CVT_VAR (9, N_F64 | key, N_U32); + /* VFP instructions with bitshift. */ + CVT_VAR (10, N_F32 | key, N_S16); + CVT_VAR (11, N_F32 | key, N_U16); + CVT_VAR (12, N_F64 | key, N_S16); + CVT_VAR (13, N_F64 | key, N_U16); + CVT_VAR (14, N_S16, N_F32 | key); + CVT_VAR (15, N_U16, N_F32 | key); + CVT_VAR (16, N_S16, N_F64 | key); + CVT_VAR (17, N_U16, N_F64 | key); + + return -1; +#undef CVT_VAR +} + +/* Neon-syntax VFP conversions. */ + +static void +do_vfp_nsyn_cvt (enum neon_shape rs, int flavour) +{ + const char *opname = 0; + + if (rs == NS_DDI || rs == NS_QQI || rs == NS_FFI) + { + /* Conversions with immediate bitshift. */ + const char *enc[] = + { + "ftosls", + "ftouls", + "fsltos", + "fultos", + NULL, + NULL, + "ftosld", + "ftould", + "fsltod", + "fultod", + "fshtos", + "fuhtos", + "fshtod", + "fuhtod", + "ftoshs", + "ftouhs", + "ftoshd", + "ftouhd" + }; + + if (flavour >= 0 && flavour < (int) ARRAY_SIZE (enc)) + { + opname = enc[flavour]; + constraint (inst.operands[0].reg != inst.operands[1].reg, + _("operands 0 and 1 must be the same register")); + inst.operands[1] = inst.operands[2]; + memset (&inst.operands[2], '\0', sizeof (inst.operands[2])); + } + } + else + { + /* Conversions without bitshift. */ + const char *enc[] = + { + "ftosis", + "ftouis", + "fsitos", + "fuitos", + "fcvtsd", + "fcvtds", + "ftosid", + "ftouid", + "fsitod", + "fuitod" + }; + + if (flavour >= 0 && flavour < (int) ARRAY_SIZE (enc)) + opname = enc[flavour]; + } + + if (opname) + do_vfp_nsyn_opcode (opname); +} + +static void +do_vfp_nsyn_cvtz (void) +{ + enum neon_shape rs = neon_select_shape (NS_FF, NS_FD, NS_NULL); + int flavour = neon_cvt_flavour (rs); + const char *enc[] = + { + "ftosizs", + "ftouizs", + NULL, + NULL, + NULL, + NULL, + "ftosizd", + "ftouizd" + }; + + if (flavour >= 0 && flavour < (int) ARRAY_SIZE (enc) && enc[flavour]) + do_vfp_nsyn_opcode (enc[flavour]); +} + +static void +do_neon_cvt (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDI, NS_QQI, NS_FFI, NS_DD, NS_QQ, + NS_FD, NS_DF, NS_FF, NS_NULL); + int flavour = neon_cvt_flavour (rs); + + /* VFP rather than Neon conversions. */ + if (flavour >= 4) + { + do_vfp_nsyn_cvt (rs, flavour); + return; + } + + switch (rs) + { + case NS_DDI: + case NS_QQI: + { + if (vfp_or_neon_is_neon (NEON_CHECK_CC | NEON_CHECK_ARCH) == FAIL) + return; + + /* Fixed-point conversion with #0 immediate is encoded as an + integer conversion. */ + if (inst.operands[2].present && inst.operands[2].imm == 0) + goto int_encode; + unsigned immbits = 32 - inst.operands[2].imm; + unsigned enctab[] = { 0x0000100, 0x1000100, 0x0, 0x1000000 }; + inst.instruction = NEON_ENC_IMMED (inst.instruction); + if (flavour != -1) + inst.instruction |= enctab[flavour]; + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg); + inst.instruction |= HI1 (inst.operands[1].reg) << 5; + inst.instruction |= neon_quad (rs) << 6; + inst.instruction |= 1 << 21; + inst.instruction |= immbits << 16; + + inst.instruction = neon_dp_fixup (inst.instruction); + } + break; + + case NS_DD: + case NS_QQ: + int_encode: + { + unsigned enctab[] = { 0x100, 0x180, 0x0, 0x080 }; + + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + + if (vfp_or_neon_is_neon (NEON_CHECK_CC | NEON_CHECK_ARCH) == FAIL) + return; + + if (flavour != -1) + inst.instruction |= enctab[flavour]; + + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg); + inst.instruction |= HI1 (inst.operands[1].reg) << 5; + inst.instruction |= neon_quad (rs) << 6; + inst.instruction |= 2 << 18; + + inst.instruction = neon_dp_fixup (inst.instruction); + } + break; + + default: + /* Some VFP conversions go here (s32 <-> f32, u32 <-> f32). */ + do_vfp_nsyn_cvt (rs, flavour); + } +} + +static void +neon_move_immediate (void) +{ + enum neon_shape rs = neon_select_shape (NS_DI, NS_QI, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_I8 | N_I16 | N_I32 | N_I64 | N_F32 | N_KEY, N_EQK); + unsigned immlo, immhi = 0, immbits; + int op, cmode, float_p; + + constraint (et.type == NT_invtype, + _("operand size must be specified for immediate VMOV")); + + /* We start out as an MVN instruction if OP = 1, MOV otherwise. */ + op = (inst.instruction & (1 << 5)) != 0; + + immlo = inst.operands[1].imm; + if (inst.operands[1].regisimm) + immhi = inst.operands[1].reg; + + constraint (et.size < 32 && (immlo & ~((1 << et.size) - 1)) != 0, + _("immediate has bits set outside the operand size")); + + float_p = inst.operands[1].immisfloat; + + if ((cmode = neon_cmode_for_move_imm (immlo, immhi, float_p, &immbits, &op, + et.size, et.type)) == FAIL) + { + /* Invert relevant bits only. */ + neon_invert_size (&immlo, &immhi, et.size); + /* Flip from VMOV/VMVN to VMVN/VMOV. Some immediate types are unavailable + with one or the other; those cases are caught by + neon_cmode_for_move_imm. */ + op = !op; + if ((cmode = neon_cmode_for_move_imm (immlo, immhi, float_p, &immbits, + &op, et.size, et.type)) == FAIL) + { + first_error (_("immediate out of range")); + return; + } + } + + inst.instruction &= ~(1 << 5); + inst.instruction |= op << 5; + + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= neon_quad (rs) << 6; + inst.instruction |= cmode << 8; + + neon_write_immbits (immbits); +} + +static void +do_neon_mvn (void) +{ + if (inst.operands[1].isreg) + { + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg); + inst.instruction |= HI1 (inst.operands[1].reg) << 5; + inst.instruction |= neon_quad (rs) << 6; + } + else + { + inst.instruction = NEON_ENC_IMMED (inst.instruction); + neon_move_immediate (); + } + + inst.instruction = neon_dp_fixup (inst.instruction); +} + +/* Encode instructions of form: + + |28/24|23|22|21 20|19 16|15 12|11 8|7|6|5|4|3 0| + | U |x |D |size | Rn | Rd |x x x x|N|x|M|x| Rm | + +*/ + +static void +neon_mixed_length (struct neon_type_el et, unsigned size) +{ + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg) << 16; + inst.instruction |= HI1 (inst.operands[1].reg) << 7; + inst.instruction |= LOW4 (inst.operands[2].reg); + inst.instruction |= HI1 (inst.operands[2].reg) << 5; + inst.instruction |= (et.type == NT_unsigned) << 24; + inst.instruction |= neon_logbits (size) << 20; + + inst.instruction = neon_dp_fixup (inst.instruction); +} + +static void +do_neon_dyadic_long (void) +{ + /* FIXME: Type checking for lengthening op. */ + struct neon_type_el et = neon_check_type (3, NS_QDD, + N_EQK | N_DBL, N_EQK, N_SU_32 | N_KEY); + neon_mixed_length (et, et.size); +} + +static void +do_neon_abal (void) +{ + struct neon_type_el et = neon_check_type (3, NS_QDD, + N_EQK | N_INT | N_DBL, N_EQK, N_SU_32 | N_KEY); + neon_mixed_length (et, et.size); +} + +static void +neon_mac_reg_scalar_long (unsigned regtypes, unsigned scalartypes) +{ + if (inst.operands[2].isscalar) + { + struct neon_type_el et = neon_check_type (3, NS_QDS, + N_EQK | N_DBL, N_EQK, regtypes | N_KEY); + inst.instruction = NEON_ENC_SCALAR (inst.instruction); + neon_mul_mac (et, et.type == NT_unsigned); + } + else + { + struct neon_type_el et = neon_check_type (3, NS_QDD, + N_EQK | N_DBL, N_EQK, scalartypes | N_KEY); + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + neon_mixed_length (et, et.size); + } +} + +static void +do_neon_mac_maybe_scalar_long (void) +{ + neon_mac_reg_scalar_long (N_S16 | N_S32 | N_U16 | N_U32, N_SU_32); +} + +static void +do_neon_dyadic_wide (void) +{ + struct neon_type_el et = neon_check_type (3, NS_QQD, + N_EQK | N_DBL, N_EQK | N_DBL, N_SU_32 | N_KEY); + neon_mixed_length (et, et.size); +} + +static void +do_neon_dyadic_narrow (void) +{ + struct neon_type_el et = neon_check_type (3, NS_QDD, + N_EQK | N_DBL, N_EQK, N_I16 | N_I32 | N_I64 | N_KEY); + /* Operand sign is unimportant, and the U bit is part of the opcode, + so force the operand type to integer. */ + et.type = NT_integer; + neon_mixed_length (et, et.size / 2); +} + +static void +do_neon_mul_sat_scalar_long (void) +{ + neon_mac_reg_scalar_long (N_S16 | N_S32, N_S16 | N_S32); +} + +static void +do_neon_vmull (void) +{ + if (inst.operands[2].isscalar) + do_neon_mac_maybe_scalar_long (); + else + { + struct neon_type_el et = neon_check_type (3, NS_QDD, + N_EQK | N_DBL, N_EQK, N_SU_32 | N_P8 | N_KEY); + if (et.type == NT_poly) + inst.instruction = NEON_ENC_POLY (inst.instruction); + else + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + /* For polynomial encoding, size field must be 0b00 and the U bit must be + zero. Should be OK as-is. */ + neon_mixed_length (et, et.size); + } +} + +static void +do_neon_ext (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDDI, NS_QQQI, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, + N_EQK, N_EQK, N_8 | N_16 | N_32 | N_64 | N_KEY); + unsigned imm = (inst.operands[3].imm * et.size) / 8; + constraint (imm >= (neon_quad (rs) ? 16 : 8), _("shift out of range")); + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg) << 16; + inst.instruction |= HI1 (inst.operands[1].reg) << 7; + inst.instruction |= LOW4 (inst.operands[2].reg); + inst.instruction |= HI1 (inst.operands[2].reg) << 5; + inst.instruction |= neon_quad (rs) << 6; + inst.instruction |= imm << 8; + + inst.instruction = neon_dp_fixup (inst.instruction); +} + +static void +do_neon_rev (void) +{ + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK, N_8 | N_16 | N_32 | N_KEY); + unsigned op = (inst.instruction >> 7) & 3; + /* N (width of reversed regions) is encoded as part of the bitmask. We + extract it here to check the elements to be reversed are smaller. + Otherwise we'd get a reserved instruction. */ + unsigned elsize = (op == 2) ? 16 : (op == 1) ? 32 : (op == 0) ? 64 : 0; + assert (elsize != 0); + constraint (et.size >= elsize, + _("elements must be smaller than reversal region")); + neon_two_same (neon_quad (rs), 1, et.size); +} + +static void +do_neon_dup (void) +{ + if (inst.operands[1].isscalar) + { + enum neon_shape rs = neon_select_shape (NS_DS, NS_QS, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK, N_8 | N_16 | N_32 | N_KEY); + unsigned sizebits = et.size >> 3; + unsigned dm = NEON_SCALAR_REG (inst.operands[1].reg); + int logsize = neon_logbits (et.size); + unsigned x = NEON_SCALAR_INDEX (inst.operands[1].reg) << logsize; + + if (vfp_or_neon_is_neon (NEON_CHECK_CC) == FAIL) + return; + + inst.instruction = NEON_ENC_SCALAR (inst.instruction); + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (dm); + inst.instruction |= HI1 (dm) << 5; + inst.instruction |= neon_quad (rs) << 6; + inst.instruction |= x << 17; + inst.instruction |= sizebits << 16; + + inst.instruction = neon_dp_fixup (inst.instruction); + } + else + { + enum neon_shape rs = neon_select_shape (NS_DR, NS_QR, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_8 | N_16 | N_32 | N_KEY, N_EQK); + /* Duplicate ARM register to lanes of vector. */ + inst.instruction = NEON_ENC_ARMREG (inst.instruction); + switch (et.size) + { + case 8: inst.instruction |= 0x400000; break; + case 16: inst.instruction |= 0x000020; break; + case 32: inst.instruction |= 0x000000; break; + default: break; + } + inst.instruction |= LOW4 (inst.operands[1].reg) << 12; + inst.instruction |= LOW4 (inst.operands[0].reg) << 16; + inst.instruction |= HI1 (inst.operands[0].reg) << 7; + inst.instruction |= neon_quad (rs) << 21; + /* The encoding for this instruction is identical for the ARM and Thumb + variants, except for the condition field. */ + do_vfp_cond_or_thumb (); + } +} + +/* VMOV has particularly many variations. It can be one of: + 0. VMOV , + 1. VMOV
, + (Register operations, which are VORR with Rm = Rn.) + 2. VMOV.
, # + 3. VMOV.
, # + (Immediate loads.) + 4. VMOV. , + (ARM register to scalar.) + 5. VMOV , , + (Two ARM registers to vector.) + 6. VMOV.
, + (Scalar to ARM register.) + 7. VMOV , , + (Vector to two ARM registers.) + 8. VMOV.F32 , + 9. VMOV.F64
, + (VFP register moves.) + 10. VMOV.F32 , #imm + 11. VMOV.F64
, #imm + (VFP float immediate load.) + 12. VMOV , + (VFP single to ARM reg.) + 13. VMOV , + (ARM reg to VFP single.) + 14. VMOV , , , + (Two ARM regs to two VFP singles.) + 15. VMOV , , , + (Two VFP singles to two ARM regs.) + + These cases can be disambiguated using neon_select_shape, except cases 1/9 + and 3/11 which depend on the operand type too. + + All the encoded bits are hardcoded by this function. + + Cases 4, 6 may be used with VFPv1 and above (only 32-bit transfers!). + Cases 5, 7 may be used with VFPv2 and above. + + FIXME: Some of the checking may be a bit sloppy (in a couple of cases you + can specify a type where it doesn't make sense to, and is ignored). +*/ + +static void +do_neon_mov (void) +{ + enum neon_shape rs = neon_select_shape (NS_RRFF, NS_FFRR, NS_DRR, NS_RRD, + NS_QQ, NS_DD, NS_QI, NS_DI, NS_SR, NS_RS, NS_FF, NS_FI, NS_RF, NS_FR, + NS_NULL); + struct neon_type_el et; + const char *ldconst = 0; + + switch (rs) + { + case NS_DD: /* case 1/9. */ + et = neon_check_type (2, rs, N_EQK, N_F64 | N_KEY); + /* It is not an error here if no type is given. */ + inst.error = NULL; + if (et.type == NT_float && et.size == 64) + { + do_vfp_nsyn_opcode ("fcpyd"); + break; + } + /* fall through. */ + + case NS_QQ: /* case 0/1. */ + { + if (vfp_or_neon_is_neon (NEON_CHECK_CC | NEON_CHECK_ARCH) == FAIL) + return; + /* The architecture manual I have doesn't explicitly state which + value the U bit should have for register->register moves, but + the equivalent VORR instruction has U = 0, so do that. */ + inst.instruction = 0x0200110; + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg); + inst.instruction |= HI1 (inst.operands[1].reg) << 5; + inst.instruction |= LOW4 (inst.operands[1].reg) << 16; + inst.instruction |= HI1 (inst.operands[1].reg) << 7; + inst.instruction |= neon_quad (rs) << 6; + + inst.instruction = neon_dp_fixup (inst.instruction); + } + break; + + case NS_DI: /* case 3/11. */ + et = neon_check_type (2, rs, N_EQK, N_F64 | N_KEY); + inst.error = NULL; + if (et.type == NT_float && et.size == 64) + { + /* case 11 (fconstd). */ + ldconst = "fconstd"; + goto encode_fconstd; + } + /* fall through. */ + + case NS_QI: /* case 2/3. */ + if (vfp_or_neon_is_neon (NEON_CHECK_CC | NEON_CHECK_ARCH) == FAIL) + return; + inst.instruction = 0x0800010; + neon_move_immediate (); + inst.instruction = neon_dp_fixup (inst.instruction); + break; + + case NS_SR: /* case 4. */ + { + unsigned bcdebits = 0; + struct neon_type_el et = neon_check_type (2, NS_NULL, + N_8 | N_16 | N_32 | N_KEY, N_EQK); + int logsize = neon_logbits (et.size); + unsigned dn = NEON_SCALAR_REG (inst.operands[0].reg); + unsigned x = NEON_SCALAR_INDEX (inst.operands[0].reg); + + constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, fpu_vfp_ext_v1), + _(BAD_FPU)); + constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, fpu_neon_ext_v1) + && et.size != 32, _(BAD_FPU)); + constraint (et.type == NT_invtype, _("bad type for scalar")); + constraint (x >= 64 / et.size, _("scalar index out of range")); + + switch (et.size) + { + case 8: bcdebits = 0x8; break; + case 16: bcdebits = 0x1; break; + case 32: bcdebits = 0x0; break; + default: ; + } + + bcdebits |= x << logsize; + + inst.instruction = 0xe000b10; + do_vfp_cond_or_thumb (); + inst.instruction |= LOW4 (dn) << 16; + inst.instruction |= HI1 (dn) << 7; + inst.instruction |= inst.operands[1].reg << 12; + inst.instruction |= (bcdebits & 3) << 5; + inst.instruction |= (bcdebits >> 2) << 21; + } + break; + + case NS_DRR: /* case 5 (fmdrr). */ + constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, fpu_vfp_ext_v2), + _(BAD_FPU)); + + inst.instruction = 0xc400b10; + do_vfp_cond_or_thumb (); + inst.instruction |= LOW4 (inst.operands[0].reg); + inst.instruction |= HI1 (inst.operands[0].reg) << 5; + inst.instruction |= inst.operands[1].reg << 12; + inst.instruction |= inst.operands[2].reg << 16; + break; + + case NS_RS: /* case 6. */ + { + struct neon_type_el et = neon_check_type (2, NS_NULL, + N_EQK, N_S8 | N_S16 | N_U8 | N_U16 | N_32 | N_KEY); + unsigned logsize = neon_logbits (et.size); + unsigned dn = NEON_SCALAR_REG (inst.operands[1].reg); + unsigned x = NEON_SCALAR_INDEX (inst.operands[1].reg); + unsigned abcdebits = 0; + + constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, fpu_vfp_ext_v1), + _(BAD_FPU)); + constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, fpu_neon_ext_v1) + && et.size != 32, _(BAD_FPU)); + constraint (et.type == NT_invtype, _("bad type for scalar")); + constraint (x >= 64 / et.size, _("scalar index out of range")); + + switch (et.size) + { + case 8: abcdebits = (et.type == NT_signed) ? 0x08 : 0x18; break; + case 16: abcdebits = (et.type == NT_signed) ? 0x01 : 0x11; break; + case 32: abcdebits = 0x00; break; + default: ; + } + + abcdebits |= x << logsize; + inst.instruction = 0xe100b10; + do_vfp_cond_or_thumb (); + inst.instruction |= LOW4 (dn) << 16; + inst.instruction |= HI1 (dn) << 7; + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= (abcdebits & 3) << 5; + inst.instruction |= (abcdebits >> 2) << 21; + } + break; + + case NS_RRD: /* case 7 (fmrrd). */ + constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, fpu_vfp_ext_v2), + _(BAD_FPU)); + + inst.instruction = 0xc500b10; + do_vfp_cond_or_thumb (); + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= LOW4 (inst.operands[2].reg); + inst.instruction |= HI1 (inst.operands[2].reg) << 5; + break; + + case NS_FF: /* case 8 (fcpys). */ + do_vfp_nsyn_opcode ("fcpys"); + break; + + case NS_FI: /* case 10 (fconsts). */ + ldconst = "fconsts"; + encode_fconstd: + if (is_quarter_float (inst.operands[1].imm)) + { + inst.operands[1].imm = neon_qfloat_bits (inst.operands[1].imm); + do_vfp_nsyn_opcode (ldconst); + } + else + first_error (_("immediate out of range")); + break; + + case NS_RF: /* case 12 (fmrs). */ + do_vfp_nsyn_opcode ("fmrs"); + break; + + case NS_FR: /* case 13 (fmsr). */ + do_vfp_nsyn_opcode ("fmsr"); + break; + + /* The encoders for the fmrrs and fmsrr instructions expect three operands + (one of which is a list), but we have parsed four. Do some fiddling to + make the operands what do_vfp_reg2_from_sp2 and do_vfp_sp2_from_reg2 + expect. */ + case NS_RRFF: /* case 14 (fmrrs). */ + constraint (inst.operands[3].reg != inst.operands[2].reg + 1, + _("VFP registers must be adjacent")); + inst.operands[2].imm = 2; + memset (&inst.operands[3], '\0', sizeof (inst.operands[3])); + do_vfp_nsyn_opcode ("fmrrs"); + break; + + case NS_FFRR: /* case 15 (fmsrr). */ + constraint (inst.operands[1].reg != inst.operands[0].reg + 1, + _("VFP registers must be adjacent")); + inst.operands[1] = inst.operands[2]; + inst.operands[2] = inst.operands[3]; + inst.operands[0].imm = 2; + memset (&inst.operands[3], '\0', sizeof (inst.operands[3])); + do_vfp_nsyn_opcode ("fmsrr"); + break; + + default: + abort (); + } +} + +static void +do_neon_rshift_round_imm (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDI, NS_QQI, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, N_EQK, N_SU_ALL | N_KEY); + int imm = inst.operands[2].imm; + + /* imm == 0 case is encoded as VMOV for V{R}SHR. */ + if (imm == 0) + { + inst.operands[2].present = 0; + do_neon_mov (); + return; + } + + constraint (imm < 1 || (unsigned)imm > et.size, + _("immediate out of range for shift")); + neon_imm_shift (TRUE, et.type == NT_unsigned, neon_quad (rs), et, + et.size - imm); +} + +static void +do_neon_movl (void) +{ + struct neon_type_el et = neon_check_type (2, NS_QD, + N_EQK | N_DBL, N_SU_32 | N_KEY); + unsigned sizebits = et.size >> 3; + inst.instruction |= sizebits << 19; + neon_two_same (0, et.type == NT_unsigned, -1); +} + +static void +do_neon_trn (void) +{ + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK, N_8 | N_16 | N_32 | N_KEY); + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + neon_two_same (neon_quad (rs), 1, et.size); +} + +static void +do_neon_zip_uzp (void) +{ + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK, N_8 | N_16 | N_32 | N_KEY); + if (rs == NS_DD && et.size == 32) + { + /* Special case: encode as VTRN.32
, . */ + inst.instruction = N_MNEM_vtrn; + do_neon_trn (); + return; + } + neon_two_same (neon_quad (rs), 1, et.size); +} + +static void +do_neon_sat_abs_neg (void) +{ + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK, N_S8 | N_S16 | N_S32 | N_KEY); + neon_two_same (neon_quad (rs), 1, et.size); +} + +static void +do_neon_pair_long (void) +{ + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, N_EQK, N_SU_32 | N_KEY); + /* Unsigned is encoded in OP field (bit 7) for these instruction. */ + inst.instruction |= (et.type == NT_unsigned) << 7; + neon_two_same (neon_quad (rs), 1, et.size); +} + +static void +do_neon_recip_est (void) +{ + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK | N_FLT, N_F32 | N_U32 | N_KEY); + inst.instruction |= (et.type == NT_float) << 8; + neon_two_same (neon_quad (rs), 1, et.size); +} + +static void +do_neon_cls (void) +{ + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK, N_S8 | N_S16 | N_S32 | N_KEY); + neon_two_same (neon_quad (rs), 1, et.size); +} + +static void +do_neon_clz (void) +{ + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK, N_I8 | N_I16 | N_I32 | N_KEY); + neon_two_same (neon_quad (rs), 1, et.size); +} + +static void +do_neon_cnt (void) +{ + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK | N_INT, N_8 | N_KEY); + neon_two_same (neon_quad (rs), 1, et.size); +} + +static void +do_neon_swp (void) +{ + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + neon_two_same (neon_quad (rs), 1, -1); +} + +static void +do_neon_tbl_tbx (void) +{ + unsigned listlenbits; + neon_check_type (3, NS_DLD, N_EQK, N_EQK, N_8 | N_KEY); + + if (inst.operands[1].imm < 1 || inst.operands[1].imm > 4) + { + first_error (_("bad list length for table lookup")); + return; + } + + listlenbits = inst.operands[1].imm - 1; + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg) << 16; + inst.instruction |= HI1 (inst.operands[1].reg) << 7; + inst.instruction |= LOW4 (inst.operands[2].reg); + inst.instruction |= HI1 (inst.operands[2].reg) << 5; + inst.instruction |= listlenbits << 8; + + inst.instruction = neon_dp_fixup (inst.instruction); +} + +static void +do_neon_ldm_stm (void) +{ + /* P, U and L bits are part of bitmask. */ + int is_dbmode = (inst.instruction & (1 << 24)) != 0; + unsigned offsetbits = inst.operands[1].imm * 2; + + if (inst.operands[1].issingle) + { + do_vfp_nsyn_ldm_stm (is_dbmode); + return; + } + + constraint (is_dbmode && !inst.operands[0].writeback, + _("writeback (!) must be used for VLDMDB and VSTMDB")); + + constraint (inst.operands[1].imm < 1 || inst.operands[1].imm > 16, + _("register list must contain at least 1 and at most 16 " + "registers")); + + inst.instruction |= inst.operands[0].reg << 16; + inst.instruction |= inst.operands[0].writeback << 21; + inst.instruction |= LOW4 (inst.operands[1].reg) << 12; + inst.instruction |= HI1 (inst.operands[1].reg) << 22; + + inst.instruction |= offsetbits; + + do_vfp_cond_or_thumb (); +} + +static void +do_neon_ldr_str (void) +{ + int is_ldr = (inst.instruction & (1 << 20)) != 0; + + if (inst.operands[0].issingle) + { + if (is_ldr) + do_vfp_nsyn_opcode ("flds"); + else + do_vfp_nsyn_opcode ("fsts"); + } + else + { + if (is_ldr) + do_vfp_nsyn_opcode ("fldd"); + else + do_vfp_nsyn_opcode ("fstd"); + } +} + +/* "interleave" version also handles non-interleaving register VLD1/VST1 + instructions. */ + +static void +do_neon_ld_st_interleave (void) +{ + struct neon_type_el et = neon_check_type (1, NS_NULL, + N_8 | N_16 | N_32 | N_64); + unsigned alignbits = 0; + unsigned idx; + /* The bits in this table go: + 0: register stride of one (0) or two (1) + 1,2: register list length, minus one (1, 2, 3, 4). + 3,4: in instruction type, minus one (VLD / VST). + We use -1 for invalid entries. */ + const int typetable[] = + { + 0x7, -1, 0xa, -1, 0x6, -1, 0x2, -1, /* VLD1 / VST1. */ + -1, -1, 0x8, 0x9, -1, -1, 0x3, -1, /* VLD2 / VST2. */ + -1, -1, -1, -1, 0x4, 0x5, -1, -1, /* VLD3 / VST3. */ + -1, -1, -1, -1, -1, -1, 0x0, 0x1 /* VLD4 / VST4. */ + }; + int typebits; + + if (et.type == NT_invtype) + return; + + if (inst.operands[1].immisalign) + switch (inst.operands[1].imm >> 8) + { + case 64: alignbits = 1; break; + case 128: + if (NEON_REGLIST_LENGTH (inst.operands[0].imm) == 3) + goto bad_alignment; + alignbits = 2; + break; + case 256: + if (NEON_REGLIST_LENGTH (inst.operands[0].imm) == 3) + goto bad_alignment; + alignbits = 3; + break; + default: + bad_alignment: + first_error (_("bad alignment")); + return; + } + + inst.instruction |= alignbits << 4; + inst.instruction |= neon_logbits (et.size) << 6; + + /* Bits [4:6] of the immediate in a list specifier encode register stride + (minus 1) in bit 4, and list length in bits [5:6]. We put the of + VLD/VST in bits [9:8] of the initial bitmask. Suck it out here, look + up the right value for "type" in a table based on this value and the given + list style, then stick it back. */ + idx = ((inst.operands[0].imm >> 4) & 7) + | (((inst.instruction >> 8) & 3) << 3); + + typebits = typetable[idx]; + + constraint (typebits == -1, _("bad list type for instruction")); + + inst.instruction &= ~0xf00; + inst.instruction |= typebits << 8; +} + +/* Check alignment is valid for do_neon_ld_st_lane and do_neon_ld_dup. + *DO_ALIGN is set to 1 if the relevant alignment bit should be set, 0 + otherwise. The variable arguments are a list of pairs of legal (size, align) + values, terminated with -1. */ + +static int +neon_alignment_bit (int size, int align, int *do_align, ...) +{ + va_list ap; + int result = FAIL, thissize, thisalign; + + if (!inst.operands[1].immisalign) + { + *do_align = 0; + return SUCCESS; + } + + va_start (ap, do_align); + + do + { + thissize = va_arg (ap, int); + if (thissize == -1) + break; + thisalign = va_arg (ap, int); + + if (size == thissize && align == thisalign) + result = SUCCESS; + } + while (result != SUCCESS); + + va_end (ap); + + if (result == SUCCESS) + *do_align = 1; + else + first_error (_("unsupported alignment for instruction")); + + return result; +} + +static void +do_neon_ld_st_lane (void) +{ + struct neon_type_el et = neon_check_type (1, NS_NULL, N_8 | N_16 | N_32); + int align_good, do_align = 0; + int logsize = neon_logbits (et.size); + int align = inst.operands[1].imm >> 8; + int n = (inst.instruction >> 8) & 3; + int max_el = 64 / et.size; + + if (et.type == NT_invtype) + return; + + constraint (NEON_REGLIST_LENGTH (inst.operands[0].imm) != n + 1, + _("bad list length")); + constraint (NEON_LANE (inst.operands[0].imm) >= max_el, + _("scalar index out of range")); + constraint (n != 0 && NEON_REG_STRIDE (inst.operands[0].imm) == 2 + && et.size == 8, + _("stride of 2 unavailable when element size is 8")); + + switch (n) + { + case 0: /* VLD1 / VST1. */ + align_good = neon_alignment_bit (et.size, align, &do_align, 16, 16, + 32, 32, -1); + if (align_good == FAIL) + return; + if (do_align) + { + unsigned alignbits = 0; + switch (et.size) + { + case 16: alignbits = 0x1; break; + case 32: alignbits = 0x3; break; + default: ; + } + inst.instruction |= alignbits << 4; + } + break; + + case 1: /* VLD2 / VST2. */ + align_good = neon_alignment_bit (et.size, align, &do_align, 8, 16, 16, 32, + 32, 64, -1); + if (align_good == FAIL) + return; + if (do_align) + inst.instruction |= 1 << 4; + break; + + case 2: /* VLD3 / VST3. */ + constraint (inst.operands[1].immisalign, + _("can't use alignment with this instruction")); + break; + + case 3: /* VLD4 / VST4. */ + align_good = neon_alignment_bit (et.size, align, &do_align, 8, 32, + 16, 64, 32, 64, 32, 128, -1); + if (align_good == FAIL) + return; + if (do_align) + { + unsigned alignbits = 0; + switch (et.size) + { + case 8: alignbits = 0x1; break; + case 16: alignbits = 0x1; break; + case 32: alignbits = (align == 64) ? 0x1 : 0x2; break; + default: ; + } + inst.instruction |= alignbits << 4; + } + break; + + default: ; + } + + /* Reg stride of 2 is encoded in bit 5 when size==16, bit 6 when size==32. */ + if (n != 0 && NEON_REG_STRIDE (inst.operands[0].imm) == 2) + inst.instruction |= 1 << (4 + logsize); + + inst.instruction |= NEON_LANE (inst.operands[0].imm) << (logsize + 5); + inst.instruction |= logsize << 10; +} + +/* Encode single n-element structure to all lanes VLD instructions. */ + +static void +do_neon_ld_dup (void) +{ + struct neon_type_el et = neon_check_type (1, NS_NULL, N_8 | N_16 | N_32); + int align_good, do_align = 0; + + if (et.type == NT_invtype) + return; + + switch ((inst.instruction >> 8) & 3) + { + case 0: /* VLD1. */ + assert (NEON_REG_STRIDE (inst.operands[0].imm) != 2); + align_good = neon_alignment_bit (et.size, inst.operands[1].imm >> 8, + &do_align, 16, 16, 32, 32, -1); + if (align_good == FAIL) + return; + switch (NEON_REGLIST_LENGTH (inst.operands[0].imm)) + { + case 1: break; + case 2: inst.instruction |= 1 << 5; break; + default: first_error (_("bad list length")); return; + } + inst.instruction |= neon_logbits (et.size) << 6; + break; + + case 1: /* VLD2. */ + align_good = neon_alignment_bit (et.size, inst.operands[1].imm >> 8, + &do_align, 8, 16, 16, 32, 32, 64, -1); + if (align_good == FAIL) + return; + constraint (NEON_REGLIST_LENGTH (inst.operands[0].imm) != 2, + _("bad list length")); + if (NEON_REG_STRIDE (inst.operands[0].imm) == 2) + inst.instruction |= 1 << 5; + inst.instruction |= neon_logbits (et.size) << 6; + break; + + case 2: /* VLD3. */ + constraint (inst.operands[1].immisalign, + _("can't use alignment with this instruction")); + constraint (NEON_REGLIST_LENGTH (inst.operands[0].imm) != 3, + _("bad list length")); + if (NEON_REG_STRIDE (inst.operands[0].imm) == 2) + inst.instruction |= 1 << 5; + inst.instruction |= neon_logbits (et.size) << 6; + break; + + case 3: /* VLD4. */ + { + int align = inst.operands[1].imm >> 8; + align_good = neon_alignment_bit (et.size, align, &do_align, 8, 32, + 16, 64, 32, 64, 32, 128, -1); + if (align_good == FAIL) + return; + constraint (NEON_REGLIST_LENGTH (inst.operands[0].imm) != 4, + _("bad list length")); + if (NEON_REG_STRIDE (inst.operands[0].imm) == 2) + inst.instruction |= 1 << 5; + if (et.size == 32 && align == 128) + inst.instruction |= 0x3 << 6; + else + inst.instruction |= neon_logbits (et.size) << 6; + } + break; + + default: ; + } + + inst.instruction |= do_align << 4; +} + +/* Disambiguate VLD and VST instructions, and fill in common bits (those + apart from bits [11:4]. */ + +static void +do_neon_ldx_stx (void) +{ + switch (NEON_LANE (inst.operands[0].imm)) + { + case NEON_INTERLEAVE_LANES: + inst.instruction = NEON_ENC_INTERLV (inst.instruction); + do_neon_ld_st_interleave (); + break; + + case NEON_ALL_LANES: + inst.instruction = NEON_ENC_DUP (inst.instruction); + do_neon_ld_dup (); + break; + + default: + inst.instruction = NEON_ENC_LANE (inst.instruction); + do_neon_ld_st_lane (); + } + + /* L bit comes from bit mask. */ + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= inst.operands[1].reg << 16; + + if (inst.operands[1].postind) + { + int postreg = inst.operands[1].imm & 0xf; + constraint (!inst.operands[1].immisreg, + _("post-index must be a register")); + constraint (postreg == 0xd || postreg == 0xf, + _("bad register for post-index")); + inst.instruction |= postreg; + } + else if (inst.operands[1].writeback) + { + inst.instruction |= 0xd; + } + else + inst.instruction |= 0xf; + + if (thumb_mode) + inst.instruction |= 0xf9000000; + else + inst.instruction |= 0xf4000000; +} + /* Overall per-instruction processing. */ @@ -8045,11 +13785,9 @@ output_relax_insn (void) symbolS *sym; int offset; -#ifdef OBJ_ELF /* The size of the instruction is unknown, so tie the debug info to the start of the instruction. */ dwarf2_emit_insn (0); -#endif switch (inst.reloc.exp.X_op) { @@ -8117,9 +13855,7 @@ output_inst (const char * str) inst.size, & inst.reloc.exp, inst.reloc.pc_rel, inst.reloc.type); -#ifdef OBJ_ELF dwarf2_emit_insn (inst.size); -#endif } /* Tag values used in struct asm_opcode's tag field. */ @@ -8130,9 +13866,14 @@ enum opcode_tag OT_unconditionalF, /* Instruction cannot be conditionalized and carries 0xF in its ARM condition field. */ OT_csuffix, /* Instruction takes a conditional suffix. */ + OT_csuffixF, /* Some forms of the instruction take a conditional + suffix, others place 0xF where the condition field + would be. */ OT_cinfix3, /* Instruction takes a conditional infix, beginning at character index 3. (In unified mode, it becomes a suffix.) */ + OT_cinfix3_deprecated, /* The same as OT_cinfix3. This is used for + tsts, cmps, cmns, and teqs. */ OT_cinfix3_legacy, /* Legacy instruction takes a conditional infix at character index 3, even in unified mode. Used for legacy instructions where suffix and infix forms @@ -8211,27 +13952,46 @@ opcode_lookup (char **str) const struct asm_opcode *opcode; const struct asm_cond *cond; char save[2]; + bfd_boolean neon_supported; + + neon_supported = ARM_CPU_HAS_FEATURE (cpu_variant, fpu_neon_ext_v1); /* Scan up to the end of the mnemonic, which must end in white space, - '.' (in unified mode only), or end of string. */ + '.' (in unified mode, or for Neon instructions), or end of string. */ for (base = end = *str; *end != '\0'; end++) - if (*end == ' ' || (unified_syntax && *end == '.')) + if (*end == ' ' || ((unified_syntax || neon_supported) && *end == '.')) break; if (end == base) return 0; - /* Handle a possible width suffix. */ + /* Handle a possible width suffix and/or Neon type suffix. */ if (end[0] == '.') { - if (end[1] == 'w' && (end[2] == ' ' || end[2] == '\0')) + int offset = 2; + + /* The .w and .n suffixes are only valid if the unified syntax is in + use. */ + if (unified_syntax && end[1] == 'w') inst.size_req = 4; - else if (end[1] == 'n' && (end[2] == ' ' || end[2] == '\0')) + else if (unified_syntax && end[1] == 'n') inst.size_req = 2; else - return 0; + offset = 0; - *str = end + 2; + inst.vectype.elems = 0; + + *str = end + offset; + + if (end[offset] == '.') + { + /* See if we have a Neon type suffix (possible in either unified or + non-unified ARM syntax mode). */ + if (parse_neon_type (&inst.vectype, str) == FAIL) + return 0; + } + else if (end[offset] != '\0' && end[offset] != ' ') + return 0; } else *str = end; @@ -8276,12 +14036,14 @@ opcode_lookup (char **str) break; case OT_cinfix3: + case OT_cinfix3_deprecated: case OT_odd_infix_unc: if (!unified_syntax) return 0; /* else fall through */ case OT_csuffix: + case OT_csuffixF: case OT_csuf_or_in3: inst.cond = cond->value; return opcode; @@ -8322,11 +14084,16 @@ opcode_lookup (char **str) memmove (affix + 2, affix, (end - affix) - 2); memcpy (affix, save, 2); - if (opcode && (opcode->tag == OT_cinfix3 || opcode->tag == OT_csuf_or_in3 - || opcode->tag == OT_cinfix3_legacy)) + if (opcode + && (opcode->tag == OT_cinfix3 + || opcode->tag == OT_cinfix3_deprecated + || opcode->tag == OT_csuf_or_in3 + || opcode->tag == OT_cinfix3_legacy)) { /* step CM */ - if (unified_syntax && opcode->tag == OT_cinfix3) + if (unified_syntax + && (opcode->tag == OT_cinfix3 + || opcode->tag == OT_cinfix3_deprecated)) as_warn (_("conditional infixes are deprecated in unified syntax")); inst.cond = cond->value; @@ -8357,13 +14124,21 @@ md_assemble (char *str) if (!opcode) { /* It wasn't an instruction, but it might be a register alias of - the form alias .req reg. */ - if (!create_register_alias (str, p)) + the form alias .req reg, or a Neon .dn/.qn directive. */ + if (!create_register_alias (str, p) + && !create_neon_reg_alias (str, p)) as_bad (_("bad instruction `%s'"), str); return; } + if (opcode->tag == OT_cinfix3_deprecated) + as_warn (_("s suffix on comparison instruction is deprecated")); + + /* The value which unconditional instructions should have in place of the + condition field. */ + inst.uncond_value = (opcode->tag == OT_csuffixF) ? 0xf : -1; + if (thumb_mode) { arm_feature_set variant; @@ -8387,6 +14162,14 @@ md_assemble (char *str) return; } + if (!ARM_CPU_HAS_FEATURE (variant, arm_ext_v6t2) && !inst.size_req) + { + /* Implicit require narrow instructions on Thumb-1. This avoids + relaxation accidentally introducing Thumb-2 instructions. */ + if (opcode->tencode != do_t_blx && opcode->tencode != do_t_branch23) + inst.size_req = 2; + } + /* Check conditional suffixes. */ if (current_it_mask) { @@ -8428,10 +14211,15 @@ md_assemble (char *str) return; } } + + /* Something has gone badly wrong if we try to relax a fixed size + instruction. */ + assert (inst.size_req == 0 || !inst.relax); + ARM_MERGE_FEATURE_SETS (thumb_arch_used, thumb_arch_used, *opcode->tvariant); /* Many Thumb-2 instructions also have Thumb-1 variants, so explicitly - set those bits when Thumb-2 32-bit instuctions are seen. ie. + set those bits when Thumb-2 32-bit instructions are seen. ie. anything other than bl/blx. This is overly pessimistic for relaxable instructions. */ if ((inst.size == 4 && (inst.instruction & 0xf800e800) != 0xf000e800) @@ -8439,7 +14227,7 @@ md_assemble (char *str) ARM_MERGE_FEATURE_SETS (thumb_arch_used, thumb_arch_used, arm_ext_v6t2); } - else + else if (ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_v1)) { /* Check that this instruction is supported for this CPU. */ if (!opcode->avariant || @@ -8472,6 +14260,12 @@ md_assemble (char *str) ARM_MERGE_FEATURE_SETS (arm_arch_used, arm_arch_used, *opcode->avariant); } + else + { + as_bad (_("attempt to use an ARM instruction on a Thumb-only processor " + "-- `%s'"), str); + return; + } output_inst (str); } @@ -8537,9 +14331,7 @@ arm_frob_label (symbolS * sym) label_is_thumb_function_name = FALSE; } -#ifdef OBJ_ELF dwarf2_emit_label (sym); -#endif } int @@ -8573,13 +14365,24 @@ arm_canonicalize_symbol_name (char * name) should appear in both upper and lowercase variants. Some registers also have mixed-case names. */ -#define REGDEF(s,n,t) { #s, n, REG_TYPE_##t, TRUE } +#define REGDEF(s,n,t) { #s, n, REG_TYPE_##t, TRUE, 0 } #define REGNUM(p,n,t) REGDEF(p##n, n, t) +#define REGNUM2(p,n,t) REGDEF(p##n, 2 * n, t) #define REGSET(p,t) \ REGNUM(p, 0,t), REGNUM(p, 1,t), REGNUM(p, 2,t), REGNUM(p, 3,t), \ REGNUM(p, 4,t), REGNUM(p, 5,t), REGNUM(p, 6,t), REGNUM(p, 7,t), \ REGNUM(p, 8,t), REGNUM(p, 9,t), REGNUM(p,10,t), REGNUM(p,11,t), \ REGNUM(p,12,t), REGNUM(p,13,t), REGNUM(p,14,t), REGNUM(p,15,t) +#define REGSETH(p,t) \ + REGNUM(p,16,t), REGNUM(p,17,t), REGNUM(p,18,t), REGNUM(p,19,t), \ + REGNUM(p,20,t), REGNUM(p,21,t), REGNUM(p,22,t), REGNUM(p,23,t), \ + REGNUM(p,24,t), REGNUM(p,25,t), REGNUM(p,26,t), REGNUM(p,27,t), \ + REGNUM(p,28,t), REGNUM(p,29,t), REGNUM(p,30,t), REGNUM(p,31,t) +#define REGSET2(p,t) \ + REGNUM2(p, 0,t), REGNUM2(p, 1,t), REGNUM2(p, 2,t), REGNUM2(p, 3,t), \ + REGNUM2(p, 4,t), REGNUM2(p, 5,t), REGNUM2(p, 6,t), REGNUM2(p, 7,t), \ + REGNUM2(p, 8,t), REGNUM2(p, 9,t), REGNUM2(p,10,t), REGNUM2(p,11,t), \ + REGNUM2(p,12,t), REGNUM2(p,13,t), REGNUM2(p,14,t), REGNUM2(p,15,t) static const struct reg_entry reg_names[] = { @@ -8618,24 +14421,24 @@ static const struct reg_entry reg_names[] = REGNUM(F,4,FN), REGNUM(F,5,FN), REGNUM(F,6,FN), REGNUM(F,7, FN), /* VFP SP registers. */ - REGSET(s,VFS), - REGNUM(s,16,VFS), REGNUM(s,17,VFS), REGNUM(s,18,VFS), REGNUM(s,19,VFS), - REGNUM(s,20,VFS), REGNUM(s,21,VFS), REGNUM(s,22,VFS), REGNUM(s,23,VFS), - REGNUM(s,24,VFS), REGNUM(s,25,VFS), REGNUM(s,26,VFS), REGNUM(s,27,VFS), - REGNUM(s,28,VFS), REGNUM(s,29,VFS), REGNUM(s,30,VFS), REGNUM(s,31,VFS), - - REGSET(S,VFS), - REGNUM(S,16,VFS), REGNUM(S,17,VFS), REGNUM(S,18,VFS), REGNUM(S,19,VFS), - REGNUM(S,20,VFS), REGNUM(S,21,VFS), REGNUM(S,22,VFS), REGNUM(S,23,VFS), - REGNUM(S,24,VFS), REGNUM(S,25,VFS), REGNUM(S,26,VFS), REGNUM(S,27,VFS), - REGNUM(S,28,VFS), REGNUM(S,29,VFS), REGNUM(S,30,VFS), REGNUM(S,31,VFS), + REGSET(s,VFS), REGSET(S,VFS), + REGSETH(s,VFS), REGSETH(S,VFS), /* VFP DP Registers. */ - REGSET(d,VFD), REGSET(D,VFS), + REGSET(d,VFD), REGSET(D,VFD), + /* Extra Neon DP registers. */ + REGSETH(d,VFD), REGSETH(D,VFD), + + /* Neon QP registers. */ + REGSET2(q,NQ), REGSET2(Q,NQ), /* VFP control registers. */ REGDEF(fpsid,0,VFC), REGDEF(fpscr,1,VFC), REGDEF(fpexc,8,VFC), REGDEF(FPSID,0,VFC), REGDEF(FPSCR,1,VFC), REGDEF(FPEXC,8,VFC), + REGDEF(fpinst,9,VFC), REGDEF(fpinst2,10,VFC), + REGDEF(FPINST,9,VFC), REGDEF(FPINST2,10,VFC), + REGDEF(mvfr0,7,VFC), REGDEF(mvfr1,6,VFC), + REGDEF(MVFR0,7,VFC), REGDEF(MVFR1,6,VFC), /* Maverick DSP coprocessor registers. */ REGSET(mvf,MVF), REGSET(mvd,MVD), REGSET(mvfx,MVFX), REGSET(mvdx,MVDX), @@ -8752,20 +14555,21 @@ static const struct asm_psr psrs[] = /* Table of V7M psr names. */ static const struct asm_psr v7m_psrs[] = { - {"apsr", 0 }, - {"iapsr", 1 }, - {"eapsr", 2 }, - {"psr", 3 }, - {"ipsr", 5 }, - {"epsr", 6 }, - {"iepsr", 7 }, - {"msp", 8 }, - {"psp", 9 }, - {"primask", 16}, - {"basepri", 17}, - {"basepri_max", 18}, - {"faultmask", 19}, - {"control", 20} + {"apsr", 0 }, {"APSR", 0 }, + {"iapsr", 1 }, {"IAPSR", 1 }, + {"eapsr", 2 }, {"EAPSR", 2 }, + {"psr", 3 }, {"PSR", 3 }, + {"xpsr", 3 }, {"XPSR", 3 }, {"xPSR", 3 }, + {"ipsr", 5 }, {"IPSR", 5 }, + {"epsr", 6 }, {"EPSR", 6 }, + {"iepsr", 7 }, {"IEPSR", 7 }, + {"msp", 8 }, {"MSP", 8 }, + {"psp", 9 }, {"PSP", 9 }, + {"primask", 16}, {"PRIMASK", 16}, + {"basepri", 17}, {"BASEPRI", 17}, + {"basepri_max", 18}, {"BASEPRI_MAX", 18}, + {"faultmask", 19}, {"FAULTMASK", 19}, + {"control", 20}, {"CONTROL", 20} }; /* Table of all shift-in-operand names. */ @@ -8858,10 +14662,17 @@ static struct asm_barrier_opt barrier_opt_names[] = #define TxC3(mnem, op, top, nops, ops, ae, te) \ { #mnem, OPS##nops ops, OT_cinfix3, 0x##op, top, ARM_VARIANT, \ THUMB_VARIANT, do_##ae, do_##te } +#define TxC3w(mnem, op, top, nops, ops, ae, te) \ + { #mnem, OPS##nops ops, OT_cinfix3_deprecated, 0x##op, top, ARM_VARIANT, \ + THUMB_VARIANT, do_##ae, do_##te } #define TC3(mnem, aop, top, nops, ops, ae, te) \ TxC3(mnem, aop, 0x##top, nops, ops, ae, te) +#define TC3w(mnem, aop, top, nops, ops, ae, te) \ + TxC3w(mnem, aop, 0x##top, nops, ops, ae, te) #define tC3(mnem, aop, top, nops, ops, ae, te) \ TxC3(mnem, aop, T_MNEM_##top, nops, ops, ae, te) +#define tC3w(mnem, aop, top, nops, ops, ae, te) \ + TxC3w(mnem, aop, T_MNEM_##top, nops, ops, ae, te) /* Mnemonic with a conditional infix in an unusual place. Each and every variant has to appear in the condition table. */ @@ -8970,6 +14781,42 @@ static struct asm_barrier_opt barrier_opt_names[] = #define UF(mnem, op, nops, ops, ae) \ { #mnem, OPS##nops ops, OT_unconditionalF, 0x##op, 0, ARM_VARIANT, 0, do_##ae, NULL } +/* Neon data-processing. ARM versions are unconditional with cond=0xf. + The Thumb and ARM variants are mostly the same (bits 0-23 and 24/28), so we + use the same encoding function for each. */ +#define NUF(mnem, op, nops, ops, enc) \ + { #mnem, OPS##nops ops, OT_unconditionalF, 0x##op, 0x##op, \ + ARM_VARIANT, THUMB_VARIANT, do_##enc, do_##enc } + +/* Neon data processing, version which indirects through neon_enc_tab for + the various overloaded versions of opcodes. */ +#define nUF(mnem, op, nops, ops, enc) \ + { #mnem, OPS##nops ops, OT_unconditionalF, N_MNEM_##op, N_MNEM_##op, \ + ARM_VARIANT, THUMB_VARIANT, do_##enc, do_##enc } + +/* Neon insn with conditional suffix for the ARM version, non-overloaded + version. */ +#define NCE_tag(mnem, op, nops, ops, enc, tag) \ + { #mnem, OPS##nops ops, tag, 0x##op, 0x##op, ARM_VARIANT, \ + THUMB_VARIANT, do_##enc, do_##enc } + +#define NCE(mnem, op, nops, ops, enc) \ + NCE_tag(mnem, op, nops, ops, enc, OT_csuffix) + +#define NCEF(mnem, op, nops, ops, enc) \ + NCE_tag(mnem, op, nops, ops, enc, OT_csuffixF) + +/* Neon insn with conditional suffix for the ARM version, overloaded types. */ +#define nCE_tag(mnem, op, nops, ops, enc, tag) \ + { #mnem, OPS##nops ops, tag, N_MNEM_##op, N_MNEM_##op, \ + ARM_VARIANT, THUMB_VARIANT, do_##enc, do_##enc } + +#define nCE(mnem, op, nops, ops, enc) \ + nCE_tag(mnem, op, nops, ops, enc, OT_csuffix) + +#define nCEF(mnem, op, nops, ops, enc) \ + nCE_tag(mnem, op, nops, ops, enc, OT_csuffixF) + #define do_0 0 /* Thumb-only, unconditional. */ @@ -8985,8 +14832,8 @@ static const struct asm_opcode insns[] = tC3(eors, 0300000, eors, 3, (RR, oRR, SH), arit, t_arit3c), tCE(sub, 0400000, sub, 3, (RR, oRR, SH), arit, t_add_sub), tC3(subs, 0500000, subs, 3, (RR, oRR, SH), arit, t_add_sub), - tCE(add, 0800000, add, 3, (RR, oRR, SH), arit, t_add_sub), - tC3(adds, 0900000, adds, 3, (RR, oRR, SH), arit, t_add_sub), + tCE(add, 0800000, add, 3, (RR, oRR, SHG), arit, t_add_sub), + tC3(adds, 0900000, adds, 3, (RR, oRR, SHG), arit, t_add_sub), tCE(adc, 0a00000, adc, 3, (RR, oRR, SH), arit, t_arit3c), tC3(adcs, 0b00000, adcs, 3, (RR, oRR, SH), arit, t_arit3c), tCE(sbc, 0c00000, sbc, 3, (RR, oRR, SH), arit, t_arit3), @@ -9000,13 +14847,13 @@ static const struct asm_opcode insns[] = for setting PSR flag bits. They are obsolete in V6 and do not have Thumb equivalents. */ tCE(tst, 1100000, tst, 2, (RR, SH), cmp, t_mvn_tst), - tC3(tsts, 1100000, tst, 2, (RR, SH), cmp, t_mvn_tst), + tC3w(tsts, 1100000, tst, 2, (RR, SH), cmp, t_mvn_tst), CL(tstp, 110f000, 2, (RR, SH), cmp), tCE(cmp, 1500000, cmp, 2, (RR, SH), cmp, t_mov_cmp), - tC3(cmps, 1500000, cmp, 2, (RR, SH), cmp, t_mov_cmp), + tC3w(cmps, 1500000, cmp, 2, (RR, SH), cmp, t_mov_cmp), CL(cmpp, 150f000, 2, (RR, SH), cmp), tCE(cmn, 1700000, cmn, 2, (RR, SH), cmp, t_mvn_tst), - tC3(cmns, 1700000, cmn, 2, (RR, SH), cmp, t_mvn_tst), + tC3w(cmns, 1700000, cmn, 2, (RR, SH), cmp, t_mvn_tst), CL(cmnp, 170f000, 2, (RR, SH), cmp), tCE(mov, 1a00000, mov, 2, (RR, SH), mov, t_mov_cmp), @@ -9014,10 +14861,10 @@ static const struct asm_opcode insns[] = tCE(mvn, 1e00000, mvn, 2, (RR, SH), mov, t_mvn_tst), tC3(mvns, 1f00000, mvns, 2, (RR, SH), mov, t_mvn_tst), - tCE(ldr, 4100000, ldr, 2, (RR, ADDR), ldst, t_ldst), - tC3(ldrb, 4500000, ldrb, 2, (RR, ADDR), ldst, t_ldst), - tCE(str, 4000000, str, 2, (RR, ADDR), ldst, t_ldst), - tC3(strb, 4400000, strb, 2, (RR, ADDR), ldst, t_ldst), + tCE(ldr, 4100000, ldr, 2, (RR, ADDRGLDR),ldst, t_ldst), + tC3(ldrb, 4500000, ldrb, 2, (RR, ADDRGLDR),ldst, t_ldst), + tCE(str, 4000000, str, 2, (RR, ADDRGLDR),ldst, t_ldst), + tC3(strb, 4400000, strb, 2, (RR, ADDRGLDR),ldst, t_ldst), tCE(stm, 8800000, stmia, 2, (RRw, REGLST), ldmstm, t_ldmstm), tC3(stmia, 8800000, stmia, 2, (RRw, REGLST), ldmstm, t_ldmstm), @@ -9050,6 +14897,10 @@ static const struct asm_opcode insns[] = tCE(push, 92d0000, push, 1, (REGLST), push_pop, t_push_pop), tCE(pop, 8bd0000, pop, 1, (REGLST), push_pop, t_push_pop), + /* These may simplify to neg. */ + TCE(rsb, 0600000, ebc00000, 3, (RR, oRR, SH), arit, t_rsb), + TC3(rsbs, 0700000, ebd00000, 3, (RR, oRR, SH), arit, t_rsb), + #undef THUMB_VARIANT #define THUMB_VARIANT &arm_ext_v6 TCE(cpy, 1a00000, 4600, 2, (RR, RR), rd_rm, t_cpy), @@ -9057,10 +14908,8 @@ static const struct asm_opcode insns[] = /* V1 instructions with no Thumb analogue prior to V6T2. */ #undef THUMB_VARIANT #define THUMB_VARIANT &arm_ext_v6t2 - TCE(rsb, 0600000, ebc00000, 3, (RR, oRR, SH), arit, t_rsb), - TC3(rsbs, 0700000, ebd00000, 3, (RR, oRR, SH), arit, t_rsb), TCE(teq, 1300000, ea900f00, 2, (RR, SH), cmp, t_mvn_tst), - TC3(teqs, 1300000, ea900f00, 2, (RR, SH), cmp, t_mvn_tst), + TC3w(teqs, 1300000, ea900f00, 2, (RR, SH), cmp, t_mvn_tst), CL(teqp, 130f000, 2, (RR, SH), cmp), TC3(ldrt, 4300000, f8500e00, 2, (RR, ADDR), ldstt, t_ldstt), @@ -9101,10 +14950,10 @@ static const struct asm_opcode insns[] = /* Generic coprocessor instructions. */ TCE(cdp, e000000, ee000000, 6, (RCP, I15b, RCN, RCN, RCN, oI7b), cdp, cdp), - TCE(ldc, c100000, ec100000, 3, (RCP, RCN, ADDR), lstc, lstc), - TC3(ldcl, c500000, ec500000, 3, (RCP, RCN, ADDR), lstc, lstc), - TCE(stc, c000000, ec000000, 3, (RCP, RCN, ADDR), lstc, lstc), - TC3(stcl, c400000, ec400000, 3, (RCP, RCN, ADDR), lstc, lstc), + TCE(ldc, c100000, ec100000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), + TC3(ldcl, c500000, ec500000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), + TCE(stc, c000000, ec000000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), + TC3(stcl, c400000, ec400000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), TCE(mcr, e000010, ee000010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), TCE(mrc, e100010, ee100010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), @@ -9115,8 +14964,8 @@ static const struct asm_opcode insns[] = #undef ARM_VARIANT #define ARM_VARIANT &arm_ext_v3 /* ARM 6 Status register instructions. */ - TCE(mrs, 10f0000, f3ef8000, 2, (RR, PSR), mrs, t_mrs), - TCE(msr, 120f000, f3808000, 2, (PSR, RR_EXi), msr, t_msr), + TCE(mrs, 10f0000, f3ef8000, 2, (APSR_RR, RVC_PSR), mrs, t_mrs), + TCE(msr, 120f000, f3808000, 2, (RVC_PSR, RR_EXi), msr, t_msr), #undef ARM_VARIANT #define ARM_VARIANT &arm_ext_v3m /* ARM 7M long multiplies. */ @@ -9133,12 +14982,12 @@ static const struct asm_opcode insns[] = #define ARM_VARIANT &arm_ext_v4 /* ARM Architecture 4. */ #undef THUMB_VARIANT #define THUMB_VARIANT &arm_ext_v4t - tC3(ldrh, 01000b0, ldrh, 2, (RR, ADDR), ldstv4, t_ldst), - tC3(strh, 00000b0, strh, 2, (RR, ADDR), ldstv4, t_ldst), - tC3(ldrsh, 01000f0, ldrsh, 2, (RR, ADDR), ldstv4, t_ldst), - tC3(ldrsb, 01000d0, ldrsb, 2, (RR, ADDR), ldstv4, t_ldst), - tCM(ld,sh, 01000f0, ldrsh, 2, (RR, ADDR), ldstv4, t_ldst), - tCM(ld,sb, 01000d0, ldrsb, 2, (RR, ADDR), ldstv4, t_ldst), + tC3(ldrh, 01000b0, ldrh, 2, (RR, ADDRGLDRS), ldstv4, t_ldst), + tC3(strh, 00000b0, strh, 2, (RR, ADDRGLDRS), ldstv4, t_ldst), + tC3(ldrsh, 01000f0, ldrsh, 2, (RR, ADDRGLDRS), ldstv4, t_ldst), + tC3(ldrsb, 01000d0, ldrsb, 2, (RR, ADDRGLDRS), ldstv4, t_ldst), + tCM(ld,sh, 01000f0, ldrsh, 2, (RR, ADDRGLDRS), ldstv4, t_ldst), + tCM(ld,sb, 01000d0, ldrsb, 2, (RR, ADDRGLDRS), ldstv4, t_ldst), #undef ARM_VARIANT #define ARM_VARIANT &arm_ext_v4t_5 @@ -9159,10 +15008,10 @@ static const struct asm_opcode insns[] = #undef THUMB_VARIANT #define THUMB_VARIANT &arm_ext_v6t2 TCE(clz, 16f0f10, fab0f080, 2, (RRnpc, RRnpc), rd_rm, t_clz), - TUF(ldc2, c100000, fc100000, 3, (RCP, RCN, ADDR), lstc, lstc), - TUF(ldc2l, c500000, fc500000, 3, (RCP, RCN, ADDR), lstc, lstc), - TUF(stc2, c000000, fc000000, 3, (RCP, RCN, ADDR), lstc, lstc), - TUF(stc2l, c400000, fc400000, 3, (RCP, RCN, ADDR), lstc, lstc), + TUF(ldc2, c100000, fc100000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), + TUF(ldc2l, c500000, fc500000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), + TUF(stc2, c000000, fc000000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), + TUF(stc2l, c400000, fc400000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), TUF(cdp2, e000000, fe000000, 6, (RCP, I15b, RCN, RCN, RCN, oI7b), cdp, cdp), TUF(mcr2, e000010, fe000010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), TUF(mrc2, e100010, fe100010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), @@ -9198,8 +15047,8 @@ static const struct asm_opcode insns[] = #undef ARM_VARIANT #define ARM_VARIANT &arm_ext_v5e /* ARM Architecture 5TE. */ TUF(pld, 450f000, f810f000, 1, (ADDR), pld, t_pld), - TC3(ldrd, 00000d0, e9500000, 3, (RRnpc, oRRnpc, ADDR), ldrd, t_ldstd), - TC3(strd, 00000f0, e9400000, 3, (RRnpc, oRRnpc, ADDR), ldrd, t_ldstd), + TC3(ldrd, 00000d0, e8500000, 3, (RRnpc, oRRnpc, ADDRGLDRS), ldrd, t_ldstd), + TC3(strd, 00000f0, e8400000, 3, (RRnpc, oRRnpc, ADDRGLDRS), ldrd, t_ldstd), TCE(mcrr, c400000, ec400000, 5, (RCP, I15b, RRnpc, RRnpc, RCN), co_reg2c, co_reg2c), TCE(mrrc, c500000, ec500000, 5, (RCP, I15b, RRnpc, RRnpc, RCN), co_reg2c, co_reg2c), @@ -9226,6 +15075,7 @@ static const struct asm_opcode insns[] = #undef THUMB_VARIANT #define THUMB_VARIANT &arm_ext_v6t2 TCE(ldrex, 1900f9f, e8500f00, 2, (RRnpc, ADDR), ldrex, t_ldrex), + TCE(strex, 1800f90, e8400000, 3, (RRnpc, RRnpc, ADDR), strex, t_strex), TUF(mcrr2, c400000, fc400000, 5, (RCP, I15b, RRnpc, RRnpc, RCN), co_reg2c, co_reg2c), TUF(mrrc2, c500000, fc500000, 5, (RCP, I15b, RRnpc, RRnpc, RCN), co_reg2c, co_reg2c), @@ -9309,12 +15159,11 @@ static const struct asm_opcode insns[] = TCE(smuadx, 700f030, fb20f010, 3, (RRnpc, RRnpc, RRnpc), smul, t_simd), TCE(smusd, 700f050, fb40f000, 3, (RRnpc, RRnpc, RRnpc), smul, t_simd), TCE(smusdx, 700f070, fb40f010, 3, (RRnpc, RRnpc, RRnpc), smul, t_simd), - TUF(srsia, 8cd0500, e980c000, 1, (I31w), srs, srs), - UF(srsib, 9cd0500, 1, (I31w), srs), - UF(srsda, 84d0500, 1, (I31w), srs), - TUF(srsdb, 94d0500, e800c000, 1, (I31w), srs, srs), + TUF(srsia, 8c00500, e980c000, 2, (oRRw, I31w), srs, srs), + UF(srsib, 9c00500, 2, (oRRw, I31w), srs), + UF(srsda, 8400500, 2, (oRRw, I31w), srs), + TUF(srsdb, 9400500, e800c000, 2, (oRRw, I31w), srs, srs), TCE(ssat16, 6a00f30, f3200000, 3, (RRnpc, I16, RRnpc), ssat16, t_ssat16), - TCE(strex, 1800f90, e8400000, 3, (RRnpc, RRnpc, ADDR), strex, t_strex), TCE(umaal, 0400090, fbe00060, 4, (RRnpc, RRnpc, RRnpc, RRnpc),smlal, t_mlal), TCE(usad8, 780f010, fb70f000, 3, (RRnpc, RRnpc, RRnpc), smul, t_simd), TCE(usada8, 7800010, fb700000, 4, (RRnpc, RRnpc, RRnpc, RRnpc),smla, t_mla), @@ -9354,18 +15203,20 @@ static const struct asm_opcode insns[] = TCE(ubfx, 7e00050, f3c00000, 4, (RR, RR, I31, I32), bfx, t_bfx), TCE(mls, 0600090, fb000010, 4, (RRnpc, RRnpc, RRnpc, RRnpc), mlas, t_mla), - TCE(movw, 3000000, f2400000, 2, (RRnpc, Iffff), mov16, t_mov16), - TCE(movt, 3400000, f2c00000, 2, (RRnpc, Iffff), mov16, t_mov16), - TCE(rbit, 3ff0f30, fa90f0a0, 2, (RR, RR), rd_rm, t_rbit), + TCE(movw, 3000000, f2400000, 2, (RRnpc, HALF), mov16, t_mov16), + TCE(movt, 3400000, f2c00000, 2, (RRnpc, HALF), mov16, t_mov16), + TCE(rbit, 6ff0f30, fa90f0a0, 2, (RR, RR), rd_rm, t_rbit), TC3(ldrht, 03000b0, f8300e00, 2, (RR, ADDR), ldsttv4, t_ldstt), TC3(ldrsht, 03000f0, f9300e00, 2, (RR, ADDR), ldsttv4, t_ldstt), TC3(ldrsbt, 03000d0, f9100e00, 2, (RR, ADDR), ldsttv4, t_ldstt), TC3(strht, 02000b0, f8200e00, 2, (RR, ADDR), ldsttv4, t_ldstt), - UT(cbnz, b900, 2, (RR, EXP), t_czb), - UT(cbz, b100, 2, (RR, EXP), t_czb), - /* ARM does not really have an IT instruction. */ + UT(cbnz, b900, 2, (RR, EXP), t_cbz), + UT(cbz, b100, 2, (RR, EXP), t_cbz), + /* ARM does not really have an IT instruction, so always allow it. */ +#undef ARM_VARIANT +#define ARM_VARIANT &arm_ext_v1 TUE(it, 0, bf08, 1, (COND), it, t_it), TUE(itt, 0, bf0c, 1, (COND), it, t_it), TUE(ite, 0, bf04, 1, (COND), it, t_it), @@ -9415,15 +15266,15 @@ static const struct asm_opcode insns[] = cCE(wfc, e400110, 1, (RR), rd), cCE(rfc, e500110, 1, (RR), rd), - cCL(ldfs, c100100, 2, (RF, ADDR), rd_cpaddr), - cCL(ldfd, c108100, 2, (RF, ADDR), rd_cpaddr), - cCL(ldfe, c500100, 2, (RF, ADDR), rd_cpaddr), - cCL(ldfp, c508100, 2, (RF, ADDR), rd_cpaddr), + cCL(ldfs, c100100, 2, (RF, ADDRGLDC), rd_cpaddr), + cCL(ldfd, c108100, 2, (RF, ADDRGLDC), rd_cpaddr), + cCL(ldfe, c500100, 2, (RF, ADDRGLDC), rd_cpaddr), + cCL(ldfp, c508100, 2, (RF, ADDRGLDC), rd_cpaddr), - cCL(stfs, c000100, 2, (RF, ADDR), rd_cpaddr), - cCL(stfd, c008100, 2, (RF, ADDR), rd_cpaddr), - cCL(stfe, c400100, 2, (RF, ADDR), rd_cpaddr), - cCL(stfp, c408100, 2, (RF, ADDR), rd_cpaddr), + cCL(stfs, c000100, 2, (RF, ADDRGLDC), rd_cpaddr), + cCL(stfd, c008100, 2, (RF, ADDRGLDC), rd_cpaddr), + cCL(stfe, c400100, 2, (RF, ADDRGLDC), rd_cpaddr), + cCL(stfp, c408100, 2, (RF, ADDRGLDC), rd_cpaddr), cCL(mvfs, e008100, 2, (RF, RF_IF), rd_rm), cCL(mvfsp, e008120, 2, (RF, RF_IF), rd_rm), @@ -9866,8 +15717,8 @@ static const struct asm_opcode insns[] = cCE(fmxr, ee00a10, 2, (RVC, RR), rn_rd), /* Memory operations. */ - cCE(flds, d100a00, 2, (RVS, ADDR), vfp_sp_ldst), - cCE(fsts, d000a00, 2, (RVS, ADDR), vfp_sp_ldst), + cCE(flds, d100a00, 2, (RVS, ADDRGLDC), vfp_sp_ldst), + cCE(fsts, d000a00, 2, (RVS, ADDRGLDC), vfp_sp_ldst), cCE(fldmias, c900a00, 2, (RRw, VRSLST), vfp_sp_ldstmia), cCE(fldmfds, c900a00, 2, (RRw, VRSLST), vfp_sp_ldstmia), cCE(fldmdbs, d300a00, 2, (RRw, VRSLST), vfp_sp_ldstmdb), @@ -9910,13 +15761,13 @@ static const struct asm_opcode insns[] = #undef ARM_VARIANT #define ARM_VARIANT &fpu_vfp_ext_v1 /* VFP V1 (Double precision). */ /* Moves and type conversions. */ - cCE(fcpyd, eb00b40, 2, (RVD, RVD), rd_rm), + cCE(fcpyd, eb00b40, 2, (RVD, RVD), vfp_dp_rd_rm), cCE(fcvtds, eb70ac0, 2, (RVD, RVS), vfp_dp_sp_cvt), cCE(fcvtsd, eb70bc0, 2, (RVS, RVD), vfp_sp_dp_cvt), - cCE(fmdhr, e200b10, 2, (RVD, RR), rn_rd), - cCE(fmdlr, e000b10, 2, (RVD, RR), rn_rd), - cCE(fmrdh, e300b10, 2, (RR, RVD), rd_rn), - cCE(fmrdl, e100b10, 2, (RR, RVD), rd_rn), + cCE(fmdhr, e200b10, 2, (RVD, RR), vfp_dp_rn_rd), + cCE(fmdlr, e000b10, 2, (RVD, RR), vfp_dp_rn_rd), + cCE(fmrdh, e300b10, 2, (RR, RVD), vfp_dp_rd_rn), + cCE(fmrdl, e100b10, 2, (RR, RVD), vfp_dp_rd_rn), cCE(fsitod, eb80bc0, 2, (RVD, RVS), vfp_dp_sp_cvt), cCE(fuitod, eb80b40, 2, (RVD, RVS), vfp_dp_sp_cvt), cCE(ftosid, ebd0b40, 2, (RVS, RVD), vfp_sp_dp_cvt), @@ -9925,8 +15776,8 @@ static const struct asm_opcode insns[] = cCE(ftouizd, ebc0bc0, 2, (RVS, RVD), vfp_sp_dp_cvt), /* Memory operations. */ - cCE(fldd, d100b00, 2, (RVD, ADDR), vfp_dp_ldst), - cCE(fstd, d000b00, 2, (RVD, ADDR), vfp_dp_ldst), + cCE(fldd, d100b00, 2, (RVD, ADDRGLDC), vfp_dp_ldst), + cCE(fstd, d000b00, 2, (RVD, ADDRGLDC), vfp_dp_ldst), cCE(fldmiad, c900b00, 2, (RRw, VRDLST), vfp_dp_ldstmia), cCE(fldmfdd, c900b00, 2, (RRw, VRDLST), vfp_dp_ldstmia), cCE(fldmdbd, d300b00, 2, (RRw, VRDLST), vfp_dp_ldstmdb), @@ -9937,34 +15788,347 @@ static const struct asm_opcode insns[] = cCE(fstmfdd, d200b00, 2, (RRw, VRDLST), vfp_dp_ldstmdb), /* Monadic operations. */ - cCE(fabsd, eb00bc0, 2, (RVD, RVD), rd_rm), - cCE(fnegd, eb10b40, 2, (RVD, RVD), rd_rm), - cCE(fsqrtd, eb10bc0, 2, (RVD, RVD), rd_rm), + cCE(fabsd, eb00bc0, 2, (RVD, RVD), vfp_dp_rd_rm), + cCE(fnegd, eb10b40, 2, (RVD, RVD), vfp_dp_rd_rm), + cCE(fsqrtd, eb10bc0, 2, (RVD, RVD), vfp_dp_rd_rm), /* Dyadic operations. */ - cCE(faddd, e300b00, 3, (RVD, RVD, RVD), rd_rn_rm), - cCE(fsubd, e300b40, 3, (RVD, RVD, RVD), rd_rn_rm), - cCE(fmuld, e200b00, 3, (RVD, RVD, RVD), rd_rn_rm), - cCE(fdivd, e800b00, 3, (RVD, RVD, RVD), rd_rn_rm), - cCE(fmacd, e000b00, 3, (RVD, RVD, RVD), rd_rn_rm), - cCE(fmscd, e100b00, 3, (RVD, RVD, RVD), rd_rn_rm), - cCE(fnmuld, e200b40, 3, (RVD, RVD, RVD), rd_rn_rm), - cCE(fnmacd, e000b40, 3, (RVD, RVD, RVD), rd_rn_rm), - cCE(fnmscd, e100b40, 3, (RVD, RVD, RVD), rd_rn_rm), + cCE(faddd, e300b00, 3, (RVD, RVD, RVD), vfp_dp_rd_rn_rm), + cCE(fsubd, e300b40, 3, (RVD, RVD, RVD), vfp_dp_rd_rn_rm), + cCE(fmuld, e200b00, 3, (RVD, RVD, RVD), vfp_dp_rd_rn_rm), + cCE(fdivd, e800b00, 3, (RVD, RVD, RVD), vfp_dp_rd_rn_rm), + cCE(fmacd, e000b00, 3, (RVD, RVD, RVD), vfp_dp_rd_rn_rm), + cCE(fmscd, e100b00, 3, (RVD, RVD, RVD), vfp_dp_rd_rn_rm), + cCE(fnmuld, e200b40, 3, (RVD, RVD, RVD), vfp_dp_rd_rn_rm), + cCE(fnmacd, e000b40, 3, (RVD, RVD, RVD), vfp_dp_rd_rn_rm), + cCE(fnmscd, e100b40, 3, (RVD, RVD, RVD), vfp_dp_rd_rn_rm), /* Comparisons. */ - cCE(fcmpd, eb40b40, 2, (RVD, RVD), rd_rm), - cCE(fcmpzd, eb50b40, 1, (RVD), rd), - cCE(fcmped, eb40bc0, 2, (RVD, RVD), rd_rm), - cCE(fcmpezd, eb50bc0, 1, (RVD), rd), + cCE(fcmpd, eb40b40, 2, (RVD, RVD), vfp_dp_rd_rm), + cCE(fcmpzd, eb50b40, 1, (RVD), vfp_dp_rd), + cCE(fcmped, eb40bc0, 2, (RVD, RVD), vfp_dp_rd_rm), + cCE(fcmpezd, eb50bc0, 1, (RVD), vfp_dp_rd), #undef ARM_VARIANT #define ARM_VARIANT &fpu_vfp_ext_v2 cCE(fmsrr, c400a10, 3, (VRSLST, RR, RR), vfp_sp2_from_reg2), cCE(fmrrs, c500a10, 3, (RR, RR, VRSLST), vfp_reg2_from_sp2), - cCE(fmdrr, c400b10, 3, (RVD, RR, RR), rm_rd_rn), - cCE(fmrrd, c500b10, 3, (RR, RR, RVD), rd_rn_rm), + cCE(fmdrr, c400b10, 3, (RVD, RR, RR), vfp_dp_rm_rd_rn), + cCE(fmrrd, c500b10, 3, (RR, RR, RVD), vfp_dp_rd_rn_rm), +/* Instructions which may belong to either the Neon or VFP instruction sets. + Individual encoder functions perform additional architecture checks. */ +#undef ARM_VARIANT +#define ARM_VARIANT &fpu_vfp_ext_v1xd +#undef THUMB_VARIANT +#define THUMB_VARIANT &fpu_vfp_ext_v1xd + /* These mnemonics are unique to VFP. */ + NCE(vsqrt, 0, 2, (RVSD, RVSD), vfp_nsyn_sqrt), + NCE(vdiv, 0, 3, (RVSD, RVSD, RVSD), vfp_nsyn_div), + nCE(vnmul, vnmul, 3, (RVSD, RVSD, RVSD), vfp_nsyn_nmul), + nCE(vnmla, vnmla, 3, (RVSD, RVSD, RVSD), vfp_nsyn_nmul), + nCE(vnmls, vnmls, 3, (RVSD, RVSD, RVSD), vfp_nsyn_nmul), + nCE(vcmp, vcmp, 2, (RVSD, RVSD_I0), vfp_nsyn_cmp), + nCE(vcmpe, vcmpe, 2, (RVSD, RVSD_I0), vfp_nsyn_cmp), + NCE(vpush, 0, 1, (VRSDLST), vfp_nsyn_push), + NCE(vpop, 0, 1, (VRSDLST), vfp_nsyn_pop), + NCE(vcvtz, 0, 2, (RVSD, RVSD), vfp_nsyn_cvtz), + + /* Mnemonics shared by Neon and VFP. */ + nCEF(vmul, vmul, 3, (RNSDQ, oRNSDQ, RNSDQ_RNSC), neon_mul), + nCEF(vmla, vmla, 3, (RNSDQ, oRNSDQ, RNSDQ_RNSC), neon_mac_maybe_scalar), + nCEF(vmls, vmls, 3, (RNSDQ, oRNSDQ, RNSDQ_RNSC), neon_mac_maybe_scalar), + + nCEF(vadd, vadd, 3, (RNSDQ, oRNSDQ, RNSDQ), neon_addsub_if_i), + nCEF(vsub, vsub, 3, (RNSDQ, oRNSDQ, RNSDQ), neon_addsub_if_i), + + NCEF(vabs, 1b10300, 2, (RNSDQ, RNSDQ), neon_abs_neg), + NCEF(vneg, 1b10380, 2, (RNSDQ, RNSDQ), neon_abs_neg), + + NCE(vldm, c900b00, 2, (RRw, VRSDLST), neon_ldm_stm), + NCE(vldmia, c900b00, 2, (RRw, VRSDLST), neon_ldm_stm), + NCE(vldmdb, d100b00, 2, (RRw, VRSDLST), neon_ldm_stm), + NCE(vstm, c800b00, 2, (RRw, VRSDLST), neon_ldm_stm), + NCE(vstmia, c800b00, 2, (RRw, VRSDLST), neon_ldm_stm), + NCE(vstmdb, d000b00, 2, (RRw, VRSDLST), neon_ldm_stm), + NCE(vldr, d100b00, 2, (RVSD, ADDRGLDC), neon_ldr_str), + NCE(vstr, d000b00, 2, (RVSD, ADDRGLDC), neon_ldr_str), + + nCEF(vcvt, vcvt, 3, (RNSDQ, RNSDQ, oI32b), neon_cvt), + + /* NOTE: All VMOV encoding is special-cased! */ + NCE(vmov, 0, 1, (VMOV), neon_mov), + NCE(vmovq, 0, 1, (VMOV), neon_mov), + +#undef THUMB_VARIANT +#define THUMB_VARIANT &fpu_neon_ext_v1 +#undef ARM_VARIANT +#define ARM_VARIANT &fpu_neon_ext_v1 + /* Data processing with three registers of the same length. */ + /* integer ops, valid types S8 S16 S32 U8 U16 U32. */ + NUF(vaba, 0000710, 3, (RNDQ, RNDQ, RNDQ), neon_dyadic_i_su), + NUF(vabaq, 0000710, 3, (RNQ, RNQ, RNQ), neon_dyadic_i_su), + NUF(vhadd, 0000000, 3, (RNDQ, oRNDQ, RNDQ), neon_dyadic_i_su), + NUF(vhaddq, 0000000, 3, (RNQ, oRNQ, RNQ), neon_dyadic_i_su), + NUF(vrhadd, 0000100, 3, (RNDQ, oRNDQ, RNDQ), neon_dyadic_i_su), + NUF(vrhaddq, 0000100, 3, (RNQ, oRNQ, RNQ), neon_dyadic_i_su), + NUF(vhsub, 0000200, 3, (RNDQ, oRNDQ, RNDQ), neon_dyadic_i_su), + NUF(vhsubq, 0000200, 3, (RNQ, oRNQ, RNQ), neon_dyadic_i_su), + /* integer ops, valid types S8 S16 S32 S64 U8 U16 U32 U64. */ + NUF(vqadd, 0000010, 3, (RNDQ, oRNDQ, RNDQ), neon_dyadic_i64_su), + NUF(vqaddq, 0000010, 3, (RNQ, oRNQ, RNQ), neon_dyadic_i64_su), + NUF(vqsub, 0000210, 3, (RNDQ, oRNDQ, RNDQ), neon_dyadic_i64_su), + NUF(vqsubq, 0000210, 3, (RNQ, oRNQ, RNQ), neon_dyadic_i64_su), + NUF(vrshl, 0000500, 3, (RNDQ, oRNDQ, RNDQ), neon_rshl), + NUF(vrshlq, 0000500, 3, (RNQ, oRNQ, RNQ), neon_rshl), + NUF(vqrshl, 0000510, 3, (RNDQ, oRNDQ, RNDQ), neon_rshl), + NUF(vqrshlq, 0000510, 3, (RNQ, oRNQ, RNQ), neon_rshl), + /* If not immediate, fall back to neon_dyadic_i64_su. + shl_imm should accept I8 I16 I32 I64, + qshl_imm should accept S8 S16 S32 S64 U8 U16 U32 U64. */ + nUF(vshl, vshl, 3, (RNDQ, oRNDQ, RNDQ_I63b), neon_shl_imm), + nUF(vshlq, vshl, 3, (RNQ, oRNQ, RNDQ_I63b), neon_shl_imm), + nUF(vqshl, vqshl, 3, (RNDQ, oRNDQ, RNDQ_I63b), neon_qshl_imm), + nUF(vqshlq, vqshl, 3, (RNQ, oRNQ, RNDQ_I63b), neon_qshl_imm), + /* Logic ops, types optional & ignored. */ + nUF(vand, vand, 2, (RNDQ, NILO), neon_logic), + nUF(vandq, vand, 2, (RNQ, NILO), neon_logic), + nUF(vbic, vbic, 2, (RNDQ, NILO), neon_logic), + nUF(vbicq, vbic, 2, (RNQ, NILO), neon_logic), + nUF(vorr, vorr, 2, (RNDQ, NILO), neon_logic), + nUF(vorrq, vorr, 2, (RNQ, NILO), neon_logic), + nUF(vorn, vorn, 2, (RNDQ, NILO), neon_logic), + nUF(vornq, vorn, 2, (RNQ, NILO), neon_logic), + nUF(veor, veor, 3, (RNDQ, oRNDQ, RNDQ), neon_logic), + nUF(veorq, veor, 3, (RNQ, oRNQ, RNQ), neon_logic), + /* Bitfield ops, untyped. */ + NUF(vbsl, 1100110, 3, (RNDQ, RNDQ, RNDQ), neon_bitfield), + NUF(vbslq, 1100110, 3, (RNQ, RNQ, RNQ), neon_bitfield), + NUF(vbit, 1200110, 3, (RNDQ, RNDQ, RNDQ), neon_bitfield), + NUF(vbitq, 1200110, 3, (RNQ, RNQ, RNQ), neon_bitfield), + NUF(vbif, 1300110, 3, (RNDQ, RNDQ, RNDQ), neon_bitfield), + NUF(vbifq, 1300110, 3, (RNQ, RNQ, RNQ), neon_bitfield), + /* Int and float variants, types S8 S16 S32 U8 U16 U32 F32. */ + nUF(vabd, vabd, 3, (RNDQ, oRNDQ, RNDQ), neon_dyadic_if_su), + nUF(vabdq, vabd, 3, (RNQ, oRNQ, RNQ), neon_dyadic_if_su), + nUF(vmax, vmax, 3, (RNDQ, oRNDQ, RNDQ), neon_dyadic_if_su), + nUF(vmaxq, vmax, 3, (RNQ, oRNQ, RNQ), neon_dyadic_if_su), + nUF(vmin, vmin, 3, (RNDQ, oRNDQ, RNDQ), neon_dyadic_if_su), + nUF(vminq, vmin, 3, (RNQ, oRNQ, RNQ), neon_dyadic_if_su), + /* Comparisons. Types S8 S16 S32 U8 U16 U32 F32. Non-immediate versions fall + back to neon_dyadic_if_su. */ + nUF(vcge, vcge, 3, (RNDQ, oRNDQ, RNDQ_I0), neon_cmp), + nUF(vcgeq, vcge, 3, (RNQ, oRNQ, RNDQ_I0), neon_cmp), + nUF(vcgt, vcgt, 3, (RNDQ, oRNDQ, RNDQ_I0), neon_cmp), + nUF(vcgtq, vcgt, 3, (RNQ, oRNQ, RNDQ_I0), neon_cmp), + nUF(vclt, vclt, 3, (RNDQ, oRNDQ, RNDQ_I0), neon_cmp_inv), + nUF(vcltq, vclt, 3, (RNQ, oRNQ, RNDQ_I0), neon_cmp_inv), + nUF(vcle, vcle, 3, (RNDQ, oRNDQ, RNDQ_I0), neon_cmp_inv), + nUF(vcleq, vcle, 3, (RNQ, oRNQ, RNDQ_I0), neon_cmp_inv), + /* Comparison. Type I8 I16 I32 F32. */ + nUF(vceq, vceq, 3, (RNDQ, oRNDQ, RNDQ_I0), neon_ceq), + nUF(vceqq, vceq, 3, (RNQ, oRNQ, RNDQ_I0), neon_ceq), + /* As above, D registers only. */ + nUF(vpmax, vpmax, 3, (RND, oRND, RND), neon_dyadic_if_su_d), + nUF(vpmin, vpmin, 3, (RND, oRND, RND), neon_dyadic_if_su_d), + /* Int and float variants, signedness unimportant. */ + nUF(vmlaq, vmla, 3, (RNQ, oRNQ, RNDQ_RNSC), neon_mac_maybe_scalar), + nUF(vmlsq, vmls, 3, (RNQ, oRNQ, RNDQ_RNSC), neon_mac_maybe_scalar), + nUF(vpadd, vpadd, 3, (RND, oRND, RND), neon_dyadic_if_i_d), + /* Add/sub take types I8 I16 I32 I64 F32. */ + nUF(vaddq, vadd, 3, (RNQ, oRNQ, RNQ), neon_addsub_if_i), + nUF(vsubq, vsub, 3, (RNQ, oRNQ, RNQ), neon_addsub_if_i), + /* vtst takes sizes 8, 16, 32. */ + NUF(vtst, 0000810, 3, (RNDQ, oRNDQ, RNDQ), neon_tst), + NUF(vtstq, 0000810, 3, (RNQ, oRNQ, RNQ), neon_tst), + /* VMUL takes I8 I16 I32 F32 P8. */ + nUF(vmulq, vmul, 3, (RNQ, oRNQ, RNDQ_RNSC), neon_mul), + /* VQD{R}MULH takes S16 S32. */ + nUF(vqdmulh, vqdmulh, 3, (RNDQ, oRNDQ, RNDQ_RNSC), neon_qdmulh), + nUF(vqdmulhq, vqdmulh, 3, (RNQ, oRNQ, RNDQ_RNSC), neon_qdmulh), + nUF(vqrdmulh, vqrdmulh, 3, (RNDQ, oRNDQ, RNDQ_RNSC), neon_qdmulh), + nUF(vqrdmulhq, vqrdmulh, 3, (RNQ, oRNQ, RNDQ_RNSC), neon_qdmulh), + NUF(vacge, 0000e10, 3, (RNDQ, oRNDQ, RNDQ), neon_fcmp_absolute), + NUF(vacgeq, 0000e10, 3, (RNQ, oRNQ, RNQ), neon_fcmp_absolute), + NUF(vacgt, 0200e10, 3, (RNDQ, oRNDQ, RNDQ), neon_fcmp_absolute), + NUF(vacgtq, 0200e10, 3, (RNQ, oRNQ, RNQ), neon_fcmp_absolute), + NUF(vaclt, 0200e10, 3, (RNDQ, oRNDQ, RNDQ), neon_fcmp_absolute_inv), + NUF(vacltq, 0200e10, 3, (RNQ, oRNQ, RNQ), neon_fcmp_absolute_inv), + NUF(vacle, 0000e10, 3, (RNDQ, oRNDQ, RNDQ), neon_fcmp_absolute_inv), + NUF(vacleq, 0000e10, 3, (RNQ, oRNQ, RNQ), neon_fcmp_absolute_inv), + NUF(vrecps, 0000f10, 3, (RNDQ, oRNDQ, RNDQ), neon_step), + NUF(vrecpsq, 0000f10, 3, (RNQ, oRNQ, RNQ), neon_step), + NUF(vrsqrts, 0200f10, 3, (RNDQ, oRNDQ, RNDQ), neon_step), + NUF(vrsqrtsq, 0200f10, 3, (RNQ, oRNQ, RNQ), neon_step), + + /* Two address, int/float. Types S8 S16 S32 F32. */ + NUF(vabsq, 1b10300, 2, (RNQ, RNQ), neon_abs_neg), + NUF(vnegq, 1b10380, 2, (RNQ, RNQ), neon_abs_neg), + + /* Data processing with two registers and a shift amount. */ + /* Right shifts, and variants with rounding. + Types accepted S8 S16 S32 S64 U8 U16 U32 U64. */ + NUF(vshr, 0800010, 3, (RNDQ, oRNDQ, I64z), neon_rshift_round_imm), + NUF(vshrq, 0800010, 3, (RNQ, oRNQ, I64z), neon_rshift_round_imm), + NUF(vrshr, 0800210, 3, (RNDQ, oRNDQ, I64z), neon_rshift_round_imm), + NUF(vrshrq, 0800210, 3, (RNQ, oRNQ, I64z), neon_rshift_round_imm), + NUF(vsra, 0800110, 3, (RNDQ, oRNDQ, I64), neon_rshift_round_imm), + NUF(vsraq, 0800110, 3, (RNQ, oRNQ, I64), neon_rshift_round_imm), + NUF(vrsra, 0800310, 3, (RNDQ, oRNDQ, I64), neon_rshift_round_imm), + NUF(vrsraq, 0800310, 3, (RNQ, oRNQ, I64), neon_rshift_round_imm), + /* Shift and insert. Sizes accepted 8 16 32 64. */ + NUF(vsli, 1800510, 3, (RNDQ, oRNDQ, I63), neon_sli), + NUF(vsliq, 1800510, 3, (RNQ, oRNQ, I63), neon_sli), + NUF(vsri, 1800410, 3, (RNDQ, oRNDQ, I64), neon_sri), + NUF(vsriq, 1800410, 3, (RNQ, oRNQ, I64), neon_sri), + /* QSHL{U} immediate accepts S8 S16 S32 S64 U8 U16 U32 U64. */ + NUF(vqshlu, 1800610, 3, (RNDQ, oRNDQ, I63), neon_qshlu_imm), + NUF(vqshluq, 1800610, 3, (RNQ, oRNQ, I63), neon_qshlu_imm), + /* Right shift immediate, saturating & narrowing, with rounding variants. + Types accepted S16 S32 S64 U16 U32 U64. */ + NUF(vqshrn, 0800910, 3, (RND, RNQ, I32z), neon_rshift_sat_narrow), + NUF(vqrshrn, 0800950, 3, (RND, RNQ, I32z), neon_rshift_sat_narrow), + /* As above, unsigned. Types accepted S16 S32 S64. */ + NUF(vqshrun, 0800810, 3, (RND, RNQ, I32z), neon_rshift_sat_narrow_u), + NUF(vqrshrun, 0800850, 3, (RND, RNQ, I32z), neon_rshift_sat_narrow_u), + /* Right shift narrowing. Types accepted I16 I32 I64. */ + NUF(vshrn, 0800810, 3, (RND, RNQ, I32z), neon_rshift_narrow), + NUF(vrshrn, 0800850, 3, (RND, RNQ, I32z), neon_rshift_narrow), + /* Special case. Types S8 S16 S32 U8 U16 U32. Handles max shift variant. */ + nUF(vshll, vshll, 3, (RNQ, RND, I32), neon_shll), + /* CVT with optional immediate for fixed-point variant. */ + nUF(vcvtq, vcvt, 3, (RNQ, RNQ, oI32b), neon_cvt), + + nUF(vmvn, vmvn, 2, (RNDQ, RNDQ_IMVNb), neon_mvn), + nUF(vmvnq, vmvn, 2, (RNQ, RNDQ_IMVNb), neon_mvn), + + /* Data processing, three registers of different lengths. */ + /* Dyadic, long insns. Types S8 S16 S32 U8 U16 U32. */ + NUF(vabal, 0800500, 3, (RNQ, RND, RND), neon_abal), + NUF(vabdl, 0800700, 3, (RNQ, RND, RND), neon_dyadic_long), + NUF(vaddl, 0800000, 3, (RNQ, RND, RND), neon_dyadic_long), + NUF(vsubl, 0800200, 3, (RNQ, RND, RND), neon_dyadic_long), + /* If not scalar, fall back to neon_dyadic_long. + Vector types as above, scalar types S16 S32 U16 U32. */ + nUF(vmlal, vmlal, 3, (RNQ, RND, RND_RNSC), neon_mac_maybe_scalar_long), + nUF(vmlsl, vmlsl, 3, (RNQ, RND, RND_RNSC), neon_mac_maybe_scalar_long), + /* Dyadic, widening insns. Types S8 S16 S32 U8 U16 U32. */ + NUF(vaddw, 0800100, 3, (RNQ, oRNQ, RND), neon_dyadic_wide), + NUF(vsubw, 0800300, 3, (RNQ, oRNQ, RND), neon_dyadic_wide), + /* Dyadic, narrowing insns. Types I16 I32 I64. */ + NUF(vaddhn, 0800400, 3, (RND, RNQ, RNQ), neon_dyadic_narrow), + NUF(vraddhn, 1800400, 3, (RND, RNQ, RNQ), neon_dyadic_narrow), + NUF(vsubhn, 0800600, 3, (RND, RNQ, RNQ), neon_dyadic_narrow), + NUF(vrsubhn, 1800600, 3, (RND, RNQ, RNQ), neon_dyadic_narrow), + /* Saturating doubling multiplies. Types S16 S32. */ + nUF(vqdmlal, vqdmlal, 3, (RNQ, RND, RND_RNSC), neon_mul_sat_scalar_long), + nUF(vqdmlsl, vqdmlsl, 3, (RNQ, RND, RND_RNSC), neon_mul_sat_scalar_long), + nUF(vqdmull, vqdmull, 3, (RNQ, RND, RND_RNSC), neon_mul_sat_scalar_long), + /* VMULL. Vector types S8 S16 S32 U8 U16 U32 P8, scalar types + S16 S32 U16 U32. */ + nUF(vmull, vmull, 3, (RNQ, RND, RND_RNSC), neon_vmull), + + /* Extract. Size 8. */ + NUF(vext, 0b00000, 4, (RNDQ, oRNDQ, RNDQ, I15), neon_ext), + NUF(vextq, 0b00000, 4, (RNQ, oRNQ, RNQ, I15), neon_ext), + + /* Two registers, miscellaneous. */ + /* Reverse. Sizes 8 16 32 (must be < size in opcode). */ + NUF(vrev64, 1b00000, 2, (RNDQ, RNDQ), neon_rev), + NUF(vrev64q, 1b00000, 2, (RNQ, RNQ), neon_rev), + NUF(vrev32, 1b00080, 2, (RNDQ, RNDQ), neon_rev), + NUF(vrev32q, 1b00080, 2, (RNQ, RNQ), neon_rev), + NUF(vrev16, 1b00100, 2, (RNDQ, RNDQ), neon_rev), + NUF(vrev16q, 1b00100, 2, (RNQ, RNQ), neon_rev), + /* Vector replicate. Sizes 8 16 32. */ + nCE(vdup, vdup, 2, (RNDQ, RR_RNSC), neon_dup), + nCE(vdupq, vdup, 2, (RNQ, RR_RNSC), neon_dup), + /* VMOVL. Types S8 S16 S32 U8 U16 U32. */ + NUF(vmovl, 0800a10, 2, (RNQ, RND), neon_movl), + /* VMOVN. Types I16 I32 I64. */ + nUF(vmovn, vmovn, 2, (RND, RNQ), neon_movn), + /* VQMOVN. Types S16 S32 S64 U16 U32 U64. */ + nUF(vqmovn, vqmovn, 2, (RND, RNQ), neon_qmovn), + /* VQMOVUN. Types S16 S32 S64. */ + nUF(vqmovun, vqmovun, 2, (RND, RNQ), neon_qmovun), + /* VZIP / VUZP. Sizes 8 16 32. */ + NUF(vzip, 1b20180, 2, (RNDQ, RNDQ), neon_zip_uzp), + NUF(vzipq, 1b20180, 2, (RNQ, RNQ), neon_zip_uzp), + NUF(vuzp, 1b20100, 2, (RNDQ, RNDQ), neon_zip_uzp), + NUF(vuzpq, 1b20100, 2, (RNQ, RNQ), neon_zip_uzp), + /* VQABS / VQNEG. Types S8 S16 S32. */ + NUF(vqabs, 1b00700, 2, (RNDQ, RNDQ), neon_sat_abs_neg), + NUF(vqabsq, 1b00700, 2, (RNQ, RNQ), neon_sat_abs_neg), + NUF(vqneg, 1b00780, 2, (RNDQ, RNDQ), neon_sat_abs_neg), + NUF(vqnegq, 1b00780, 2, (RNQ, RNQ), neon_sat_abs_neg), + /* Pairwise, lengthening. Types S8 S16 S32 U8 U16 U32. */ + NUF(vpadal, 1b00600, 2, (RNDQ, RNDQ), neon_pair_long), + NUF(vpadalq, 1b00600, 2, (RNQ, RNQ), neon_pair_long), + NUF(vpaddl, 1b00200, 2, (RNDQ, RNDQ), neon_pair_long), + NUF(vpaddlq, 1b00200, 2, (RNQ, RNQ), neon_pair_long), + /* Reciprocal estimates. Types U32 F32. */ + NUF(vrecpe, 1b30400, 2, (RNDQ, RNDQ), neon_recip_est), + NUF(vrecpeq, 1b30400, 2, (RNQ, RNQ), neon_recip_est), + NUF(vrsqrte, 1b30480, 2, (RNDQ, RNDQ), neon_recip_est), + NUF(vrsqrteq, 1b30480, 2, (RNQ, RNQ), neon_recip_est), + /* VCLS. Types S8 S16 S32. */ + NUF(vcls, 1b00400, 2, (RNDQ, RNDQ), neon_cls), + NUF(vclsq, 1b00400, 2, (RNQ, RNQ), neon_cls), + /* VCLZ. Types I8 I16 I32. */ + NUF(vclz, 1b00480, 2, (RNDQ, RNDQ), neon_clz), + NUF(vclzq, 1b00480, 2, (RNQ, RNQ), neon_clz), + /* VCNT. Size 8. */ + NUF(vcnt, 1b00500, 2, (RNDQ, RNDQ), neon_cnt), + NUF(vcntq, 1b00500, 2, (RNQ, RNQ), neon_cnt), + /* Two address, untyped. */ + NUF(vswp, 1b20000, 2, (RNDQ, RNDQ), neon_swp), + NUF(vswpq, 1b20000, 2, (RNQ, RNQ), neon_swp), + /* VTRN. Sizes 8 16 32. */ + nUF(vtrn, vtrn, 2, (RNDQ, RNDQ), neon_trn), + nUF(vtrnq, vtrn, 2, (RNQ, RNQ), neon_trn), + + /* Table lookup. Size 8. */ + NUF(vtbl, 1b00800, 3, (RND, NRDLST, RND), neon_tbl_tbx), + NUF(vtbx, 1b00840, 3, (RND, NRDLST, RND), neon_tbl_tbx), + +#undef THUMB_VARIANT +#define THUMB_VARIANT &fpu_vfp_v3_or_neon_ext +#undef ARM_VARIANT +#define ARM_VARIANT &fpu_vfp_v3_or_neon_ext + /* Neon element/structure load/store. */ + nUF(vld1, vld1, 2, (NSTRLST, ADDR), neon_ldx_stx), + nUF(vst1, vst1, 2, (NSTRLST, ADDR), neon_ldx_stx), + nUF(vld2, vld2, 2, (NSTRLST, ADDR), neon_ldx_stx), + nUF(vst2, vst2, 2, (NSTRLST, ADDR), neon_ldx_stx), + nUF(vld3, vld3, 2, (NSTRLST, ADDR), neon_ldx_stx), + nUF(vst3, vst3, 2, (NSTRLST, ADDR), neon_ldx_stx), + nUF(vld4, vld4, 2, (NSTRLST, ADDR), neon_ldx_stx), + nUF(vst4, vst4, 2, (NSTRLST, ADDR), neon_ldx_stx), + +#undef THUMB_VARIANT +#define THUMB_VARIANT &fpu_vfp_ext_v3 +#undef ARM_VARIANT +#define ARM_VARIANT &fpu_vfp_ext_v3 + cCE(fconsts, eb00a00, 2, (RVS, I255), vfp_sp_const), + cCE(fconstd, eb00b00, 2, (RVD, I255), vfp_dp_const), + cCE(fshtos, eba0a40, 2, (RVS, I16z), vfp_sp_conv_16), + cCE(fshtod, eba0b40, 2, (RVD, I16z), vfp_dp_conv_16), + cCE(fsltos, eba0ac0, 2, (RVS, I32), vfp_sp_conv_32), + cCE(fsltod, eba0bc0, 2, (RVD, I32), vfp_dp_conv_32), + cCE(fuhtos, ebb0a40, 2, (RVS, I16z), vfp_sp_conv_16), + cCE(fuhtod, ebb0b40, 2, (RVD, I16z), vfp_dp_conv_16), + cCE(fultos, ebb0ac0, 2, (RVS, I32), vfp_sp_conv_32), + cCE(fultod, ebb0bc0, 2, (RVD, I32), vfp_dp_conv_32), + cCE(ftoshs, ebe0a40, 2, (RVS, I16z), vfp_sp_conv_16), + cCE(ftoshd, ebe0b40, 2, (RVD, I16z), vfp_dp_conv_16), + cCE(ftosls, ebe0ac0, 2, (RVS, I32), vfp_sp_conv_32), + cCE(ftosld, ebe0bc0, 2, (RVD, I32), vfp_dp_conv_32), + cCE(ftouhs, ebf0a40, 2, (RVS, I16z), vfp_sp_conv_16), + cCE(ftouhd, ebf0b40, 2, (RVD, I16z), vfp_dp_conv_16), + cCE(ftouls, ebf0ac0, 2, (RVS, I32), vfp_sp_conv_32), + cCE(ftould, ebf0bc0, 2, (RVD, I32), vfp_dp_conv_32), + +#undef THUMB_VARIANT #undef ARM_VARIANT #define ARM_VARIANT &arm_cext_xscale /* Intel XScale extensions. */ cCE(mia, e200010, 3, (RXA, RRnpc, RRnpc), xsc_mia), @@ -9996,7 +16160,7 @@ static const struct asm_opcode insns[] = cCE(tinsrb, e600010, 3, (RIWR, RR, I7), iwmmxt_tinsr), cCE(tinsrh, e600050, 3, (RIWR, RR, I7), iwmmxt_tinsr), cCE(tinsrw, e600090, 3, (RIWR, RR, I7), iwmmxt_tinsr), - cCE(tmcr, e000110, 2, (RIWC, RR), rn_rd), + cCE(tmcr, e000110, 2, (RIWC_RIWG, RR), rn_rd), cCE(tmcrr, c400000, 3, (RIWR, RR, RR), rm_rd_rn), cCE(tmia, e200010, 3, (RIWR, RR, RR), iwmmxt_tmia), cCE(tmiaph, e280010, 3, (RIWR, RR, RR), iwmmxt_tmia), @@ -10007,7 +16171,7 @@ static const struct asm_opcode insns[] = cCE(tmovmskb, e100030, 2, (RR, RIWR), rd_rn), cCE(tmovmskh, e500030, 2, (RR, RIWR), rd_rn), cCE(tmovmskw, e900030, 2, (RR, RIWR), rd_rn), - cCE(tmrc, e100110, 2, (RR, RIWC), rd_rn), + cCE(tmrc, e100110, 2, (RR, RIWC_RIWG), rd_rn), cCE(tmrrc, c500000, 3, (RR, RR, RIWR), rd_rn_rm), cCE(torcb, e13f150, 1, (RR), iwmmxt_tandorc), cCE(torch, e53f150, 1, (RR), iwmmxt_tandorc), @@ -10078,34 +16242,34 @@ static const struct asm_opcode insns[] = cCE(wpackwus, e900080, 3, (RIWR, RIWR, RIWR), rd_rn_rm), cCE(wpackdss, ef00080, 3, (RIWR, RIWR, RIWR), rd_rn_rm), cCE(wpackdus, ed00080, 3, (RIWR, RIWR, RIWR), rd_rn_rm), - cCE(wrorh, e700040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wrorh, e700040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wrorhg, e700148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), - cCE(wrorw, eb00040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wrorw, eb00040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wrorwg, eb00148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), - cCE(wrord, ef00040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wrord, ef00040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wrordg, ef00148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), cCE(wsadb, e000120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), cCE(wsadbz, e100120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), cCE(wsadh, e400120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), cCE(wsadhz, e500120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), cCE(wshufh, e0001e0, 3, (RIWR, RIWR, I255), iwmmxt_wshufh), - cCE(wsllh, e500040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wsllh, e500040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wsllhg, e500148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), - cCE(wsllw, e900040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wsllw, e900040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wsllwg, e900148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), - cCE(wslld, ed00040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wslld, ed00040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wslldg, ed00148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), - cCE(wsrah, e400040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wsrah, e400040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wsrahg, e400148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), - cCE(wsraw, e800040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wsraw, e800040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wsrawg, e800148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), - cCE(wsrad, ec00040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wsrad, ec00040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wsradg, ec00148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), - cCE(wsrlh, e600040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wsrlh, e600040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wsrlhg, e600148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), - cCE(wsrlw, ea00040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wsrlw, ea00040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wsrlwg, ea00148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), - cCE(wsrld, ee00040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wsrld, ee00040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wsrldg, ee00148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), cCE(wstrb, c000000, 2, (RIWR, ADDR), iwmmxt_wldstbh), cCE(wstrh, c400000, 2, (RIWR, ADDR), iwmmxt_wldstbh), @@ -10141,16 +16305,76 @@ static const struct asm_opcode insns[] = cCE(wxor, e100000, 3, (RIWR, RIWR, RIWR), rd_rn_rm), cCE(wzero, e300000, 1, (RIWR), iwmmxt_wzero), +#undef ARM_VARIANT +#define ARM_VARIANT &arm_cext_iwmmxt2 /* Intel Wireless MMX technology, version 2. */ + cCE(torvscb, e13f190, 1, (RR), iwmmxt_tandorc), + cCE(torvsch, e53f190, 1, (RR), iwmmxt_tandorc), + cCE(torvscw, e93f190, 1, (RR), iwmmxt_tandorc), + cCE(wabsb, e2001c0, 2, (RIWR, RIWR), rd_rn), + cCE(wabsh, e6001c0, 2, (RIWR, RIWR), rd_rn), + cCE(wabsw, ea001c0, 2, (RIWR, RIWR), rd_rn), + cCE(wabsdiffb, e1001c0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wabsdiffh, e5001c0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wabsdiffw, e9001c0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(waddbhusl, e2001a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(waddbhusm, e6001a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(waddhc, e600180, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(waddwc, ea00180, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(waddsubhx, ea001a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wavg4, e400000, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wavg4r, e500000, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmaddsn, ee00100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmaddsx, eb00100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmaddun, ec00100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmaddux, e900100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmerge, e000080, 4, (RIWR, RIWR, RIWR, I7), iwmmxt_wmerge), + cCE(wmiabb, e0000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiabt, e1000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiatb, e2000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiatt, e3000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiabbn, e4000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiabtn, e5000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiatbn, e6000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiattn, e7000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiawbb, e800120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiawbt, e900120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiawtb, ea00120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiawtt, eb00120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiawbbn, ec00120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiawbtn, ed00120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiawtbn, ee00120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiawttn, ef00120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmulsmr, ef00100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmulumr, ed00100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmulwumr, ec000c0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmulwsmr, ee000c0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmulwum, ed000c0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmulwsm, ef000c0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmulwl, eb000c0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmiabb, e8000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmiabt, e9000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmiatb, ea000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmiatt, eb000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmiabbn, ec000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmiabtn, ed000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmiatbn, ee000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmiattn, ef000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmulm, e100080, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmulmr, e300080, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmulwm, ec000e0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmulwmr, ee000e0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wsubaddhx, ed001c0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + #undef ARM_VARIANT #define ARM_VARIANT &arm_cext_maverick /* Cirrus Maverick instructions. */ - cCE(cfldrs, c100400, 2, (RMF, ADDR), rd_cpaddr), - cCE(cfldrd, c500400, 2, (RMD, ADDR), rd_cpaddr), - cCE(cfldr32, c100500, 2, (RMFX, ADDR), rd_cpaddr), - cCE(cfldr64, c500500, 2, (RMDX, ADDR), rd_cpaddr), - cCE(cfstrs, c000400, 2, (RMF, ADDR), rd_cpaddr), - cCE(cfstrd, c400400, 2, (RMD, ADDR), rd_cpaddr), - cCE(cfstr32, c000500, 2, (RMFX, ADDR), rd_cpaddr), - cCE(cfstr64, c400500, 2, (RMDX, ADDR), rd_cpaddr), + cCE(cfldrs, c100400, 2, (RMF, ADDRGLDC), rd_cpaddr), + cCE(cfldrd, c500400, 2, (RMD, ADDRGLDC), rd_cpaddr), + cCE(cfldr32, c100500, 2, (RMFX, ADDRGLDC), rd_cpaddr), + cCE(cfldr64, c500500, 2, (RMDX, ADDRGLDC), rd_cpaddr), + cCE(cfstrs, c000400, 2, (RMF, ADDRGLDC), rd_cpaddr), + cCE(cfstrd, c400400, 2, (RMD, ADDRGLDC), rd_cpaddr), + cCE(cfstr32, c000500, 2, (RMFX, ADDRGLDC), rd_cpaddr), + cCE(cfstr64, c400500, 2, (RMDX, ADDRGLDC), rd_cpaddr), cCE(cfmvsr, e000450, 2, (RMF, RR), rn_rd), cCE(cfmvrs, e100450, 2, (RR, RMF), rd_rn), cCE(cfmvdlr, e000410, 2, (RMD, RR), rn_rd), @@ -10235,6 +16459,10 @@ static const struct asm_opcode insns[] = #undef UE #undef UF #undef UT +#undef NUF +#undef nUF +#undef NCE +#undef nCE #undef OPS0 #undef OPS1 #undef OPS2 @@ -10428,7 +16656,10 @@ md_convert_frag (bfd *abfd, segT asec ATTRIBUTE_UNUSED, fragS *fragp) insn = THUMB_OP32 (opcode); insn |= (old_op & 0xf0) << 4; put_thumb32_insn (buf, insn); - reloc_type = BFD_RELOC_ARM_T32_IMMEDIATE; + if (opcode == T_MNEM_add_pc) + reloc_type = BFD_RELOC_ARM_T32_IMM12; + else + reloc_type = BFD_RELOC_ARM_T32_ADD_IMM; } else reloc_type = BFD_RELOC_ARM_THUMB_ADD; @@ -10445,7 +16676,10 @@ md_convert_frag (bfd *abfd, segT asec ATTRIBUTE_UNUSED, fragS *fragp) insn |= (old_op & 0xf0) << 4; insn |= (old_op & 0xf) << 16; put_thumb32_insn (buf, insn); - reloc_type = BFD_RELOC_ARM_T32_IMMEDIATE; + if (insn & (1 << 20)) + reloc_type = BFD_RELOC_ARM_T32_ADD_IMM; + else + reloc_type = BFD_RELOC_ARM_T32_IMMEDIATE; } else reloc_type = BFD_RELOC_ARM_THUMB_ADD; @@ -10479,16 +16713,42 @@ relax_immediate (fragS *fragp, int size, int shift) offset = fragp->fr_offset; /* Force misaligned offsets to 32-bit variant. */ if (offset & low) - return -4; + return 4; if (offset & ~mask) return 4; return 2; } +/* Get the address of a symbol during relaxation. */ +static addressT +relaxed_symbol_addr(fragS *fragp, long stretch) +{ + fragS *sym_frag; + addressT addr; + symbolS *sym; + + sym = fragp->fr_symbol; + sym_frag = symbol_get_frag (sym); + know (S_GET_SEGMENT (sym) != absolute_section + || sym_frag == &zero_address_frag); + addr = S_GET_VALUE (sym) + fragp->fr_offset; + + /* If frag has yet to be reached on this pass, assume it will + move by STRETCH just as we did. If this is not so, it will + be because some frag between grows, and that will force + another pass. */ + + if (stretch != 0 + && sym_frag->relax_marker != fragp->relax_marker) + addr += stretch; + + return addr; +} + /* Return the size of a relaxable adr pseudo-instruction or PC-relative load. */ static int -relax_adr (fragS *fragp, asection *sec) +relax_adr (fragS *fragp, asection *sec, long stretch) { addressT addr; offsetT val; @@ -10498,14 +16758,12 @@ relax_adr (fragS *fragp, asection *sec) || sec != S_GET_SEGMENT (fragp->fr_symbol)) return 4; - val = S_GET_VALUE(fragp->fr_symbol) + fragp->fr_offset; + val = relaxed_symbol_addr(fragp, stretch); addr = fragp->fr_address + fragp->fr_fix; addr = (addr + 4) & ~3; - /* Fix the insn as the 4-byte version if the target address is not - sufficiently aligned. This is prevents an infinite loop when two - instructions have contradictory range/alignment requirements. */ + /* Force misaligned targets to 32-bit variant. */ if (val & 3) - return -4; + return 4; val -= addr; if (val < 0 || val > 1020) return 4; @@ -10532,7 +16790,7 @@ relax_addsub (fragS *fragp, asection *sec) size of the offset field in the narrow instruction. */ static int -relax_branch (fragS *fragp, asection *sec, int bits) +relax_branch (fragS *fragp, asection *sec, int bits, long stretch) { addressT addr; offsetT val; @@ -10543,7 +16801,7 @@ relax_branch (fragS *fragp, asection *sec, int bits) || sec != S_GET_SEGMENT (fragp->fr_symbol)) return 4; - val = S_GET_VALUE(fragp->fr_symbol) + fragp->fr_offset; + val = relaxed_symbol_addr(fragp, stretch); addr = fragp->fr_address + fragp->fr_fix + 4; val -= addr; @@ -10559,7 +16817,7 @@ relax_branch (fragS *fragp, asection *sec, int bits) the current size of the frag should change. */ int -arm_relax_frag (asection *sec, fragS *fragp, long stretch ATTRIBUTE_UNUSED) +arm_relax_frag (asection *sec, fragS *fragp, long stretch) { int oldsize; int newsize; @@ -10568,7 +16826,7 @@ arm_relax_frag (asection *sec, fragS *fragp, long stretch ATTRIBUTE_UNUSED) switch (fragp->fr_subtype) { case T_MNEM_ldr_pc2: - newsize = relax_adr(fragp, sec); + newsize = relax_adr(fragp, sec, stretch); break; case T_MNEM_ldr_pc: case T_MNEM_ldr_sp: @@ -10588,7 +16846,7 @@ arm_relax_frag (asection *sec, fragS *fragp, long stretch ATTRIBUTE_UNUSED) newsize = relax_immediate(fragp, 5, 0); break; case T_MNEM_adr: - newsize = relax_adr(fragp, sec); + newsize = relax_adr(fragp, sec, stretch); break; case T_MNEM_mov: case T_MNEM_movs: @@ -10597,10 +16855,10 @@ arm_relax_frag (asection *sec, fragS *fragp, long stretch ATTRIBUTE_UNUSED) newsize = relax_immediate(fragp, 8, 0); break; case T_MNEM_b: - newsize = relax_branch(fragp, sec, 11); + newsize = relax_branch(fragp, sec, 11, stretch); break; case T_MNEM_bcond: - newsize = relax_branch(fragp, sec, 8); + newsize = relax_branch(fragp, sec, 8, stretch); break; case T_MNEM_add_sp: case T_MNEM_add_pc: @@ -10619,14 +16877,18 @@ arm_relax_frag (asection *sec, fragS *fragp, long stretch ATTRIBUTE_UNUSED) default: abort(); } - if (newsize < 0) + + fragp->fr_var = newsize; + /* Freeze wide instructions that are at or before the same location as + in the previous pass. This avoids infinite loops. + Don't freeze them unconditionally because targets may be artificialy + misaligned by the expansion of preceeding frags. */ + if (stretch <= 0 && newsize > 2) { - fragp->fr_var = -newsize; md_convert_frag (sec->owner, sec, fragp); frag_wane(fragp); - return -(newsize + oldsize); } - fragp->fr_var = newsize; + return newsize - oldsize; } @@ -10636,12 +16898,22 @@ valueT md_section_align (segT segment ATTRIBUTE_UNUSED, valueT size) { -#ifdef OBJ_ELF - return size; -#else - /* Round all sects to multiple of 4. */ - return (size + 3) & ~3; +#if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT)) + if (OUTPUT_FLAVOR == bfd_target_aout_flavour) + { + /* For a.out, force the section size to be aligned. If we don't do + this, BFD will align it for us, but it will not write out the + final bytes of the section. This may be a bug in BFD, but it is + easier to fix it here since that is how the other a.out targets + work. */ + int align; + + align = bfd_get_section_alignment (stdoutput, segment); + size = ((size + (1 << align) - 1) & ((valueT) -1 << align)); + } #endif + + return size; } /* This is called from HANDLE_ALIGN in write.c. Fill in the contents @@ -10893,7 +17165,7 @@ finish_unwind_opcodes (void) if (unwind.fp_used) { - /* Adjust sp as neccessary. */ + /* Adjust sp as necessary. */ unwind.pending_offset += unwind.fp_offset - unwind.frame_size; flush_pending_unwind (); @@ -11141,18 +17413,6 @@ create_unwind_entry (int have_data) return 0; } -/* Convert REGNAME to a DWARF-2 register number. */ - -int -tc_arm_regname_to_dw2regnum (const char *regname) -{ - int reg = arm_reg_parse ((char **) ®name, REG_TYPE_RN); - - if (reg == FAIL) - return -1; - - return reg; -} /* Initialize the DWARF-2 unwind information for this procedure. */ @@ -11163,6 +17423,31 @@ tc_arm_frame_initial_instructions (void) } #endif /* OBJ_ELF */ +/* Convert REGNAME to a DWARF-2 register number. */ + +int +tc_arm_regname_to_dw2regnum (char *regname) +{ + int reg = arm_reg_parse (®name, REG_TYPE_RN); + + if (reg == FAIL) + return -1; + + return reg; +} + +#ifdef TE_PE +void +tc_pe_dwarf2_emit_offset (symbolS *symbol, unsigned int size) +{ + expressionS expr; + + expr.X_op = O_secrel; + expr.X_add_symbol = symbol; + expr.X_add_number = 0; + emit_expr (&expr, size); +} +#endif /* MD interface: Symbol and relocation handling. */ @@ -11179,10 +17464,16 @@ md_pcrel_from_section (fixS * fixP, segT seg) /* If this is pc-relative and we are going to emit a relocation then we just want to put out any pipeline compensation that the linker - will need. Otherwise we want to use the calculated base. */ + will need. Otherwise we want to use the calculated base. + For WinCE we skip the bias for externals as well, since this + is how the MS ARM-CE assembler behaves and we want to be compatible. */ if (fixP->fx_pcrel && ((fixP->fx_addsy && S_GET_SEGMENT (fixP->fx_addsy) != seg) - || arm_force_relocation (fixP))) + || (arm_force_relocation (fixP) +#ifdef TE_WINCE + && !S_IS_EXTERNAL (fixP->fx_addsy) +#endif + ))) base = 0; switch (fixP->fx_r_type) @@ -11219,6 +17510,17 @@ md_pcrel_from_section (fixS * fixP, segT seg) case BFD_RELOC_ARM_PCREL_BLX: case BFD_RELOC_ARM_PLT32: #ifdef TE_WINCE + /* When handling fixups immediately, because we have already + discovered the value of a symbol, or the address of the frag involved + we must account for the offset by +8, as the OS loader will never see the reloc. + see fixup_segment() in write.c + The S_IS_EXTERNAL test handles the case of global symbols. + Those need the calculated base, not just the pipe compensation the linker will need. */ + if (fixP->fx_pcrel + && fixP->fx_addsy != NULL + && (S_GET_SEGMENT (fixP->fx_addsy) == seg) + && (S_IS_EXTERNAL (fixP->fx_addsy) || !arm_force_relocation (fixP))) + return base + 8; return base; #else return base + 8; @@ -11406,11 +17708,11 @@ negate_data_op (unsigned long * instruction, /* Like negate_data_op, but for Thumb-2. */ static unsigned int -thumb32_negate_data_op (offsetT *instruction, offsetT value) +thumb32_negate_data_op (offsetT *instruction, unsigned int value) { int op, new_inst; int rd; - offsetT negated, inverted; + unsigned int negated, inverted; negated = encode_thumb32_immediate (-value); inverted = encode_thumb32_immediate (~value); @@ -11471,7 +17773,7 @@ thumb32_negate_data_op (offsetT *instruction, offsetT value) return FAIL; } - if (value == FAIL) + if (value == (unsigned int)FAIL) return FAIL; *instruction &= T2_OPCODE_MASK; @@ -11528,6 +17830,7 @@ md_apply_fix (fixS * fixP, assert (fixP->fx_r_type <= BFD_RELOC_UNUSED); /* Note whether this will delete the relocation. */ + if (fixP->fx_addsy == 0 && !fixP->fx_pcrel) fixP->fx_done = 1; @@ -11676,7 +17979,7 @@ md_apply_fix (fixS * fixP, as_bad_where (fixP->fx_file, fixP->fx_line, _("invalid literal constant: pool needs to be closer")); else - as_bad (_("bad immediate value for half-word offset (%ld)"), + as_bad (_("bad immediate value for 8-bit offset (%ld)"), (long) value); break; } @@ -11835,6 +18138,7 @@ md_apply_fix (fixS * fixP, break; case BFD_RELOC_ARM_T32_IMMEDIATE: + case BFD_RELOC_ARM_T32_ADD_IMM: case BFD_RELOC_ARM_T32_IMM12: case BFD_RELOC_ARM_T32_ADD_PC12: /* We claim that this fixup has been processed here, @@ -11855,15 +18159,21 @@ md_apply_fix (fixS * fixP, newval <<= 16; newval |= md_chars_to_number (buf+2, THUMB_SIZE); - /* FUTURE: Implement analogue of negate_data_op for T32. */ - if (fixP->fx_r_type == BFD_RELOC_ARM_T32_IMMEDIATE) + newimm = FAIL; + if (fixP->fx_r_type == BFD_RELOC_ARM_T32_IMMEDIATE + || fixP->fx_r_type == BFD_RELOC_ARM_T32_ADD_IMM) { newimm = encode_thumb32_immediate (value); if (newimm == (unsigned int) FAIL) newimm = thumb32_negate_data_op (&newval, value); } - else + if (fixP->fx_r_type != BFD_RELOC_ARM_T32_IMMEDIATE + && newimm == (unsigned int) FAIL) { + /* Turn add/sum into addw/subw. */ + if (fixP->fx_r_type == BFD_RELOC_ARM_T32_ADD_IMM) + newval = (newval & 0xfeffffff) | 0x02000000; + /* 12 bit immediate for addw/subw. */ if (value < 0) { @@ -11977,18 +18287,34 @@ md_apply_fix (fixS * fixP, } break; - case BFD_RELOC_THUMB_PCREL_BRANCH7: /* CZB */ - /* CZB can only branch forward. */ - if (value & ~0x7e) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("branch out of range")); + case BFD_RELOC_THUMB_PCREL_BRANCH7: /* CBZ */ + /* CBZ can only branch forward. */ - if (fixP->fx_done || !seg->use_rela_p) + /* Attempts to use CBZ to branch to the next instruction + (which, strictly speaking, are prohibited) will be turned into + no-ops. + + FIXME: It may be better to remove the instruction completely and + perform relaxation. */ + if (value == -2) { newval = md_chars_to_number (buf, THUMB_SIZE); - newval |= ((value & 0x3e) << 2) | ((value & 0x40) << 3); + newval = 0xbf00; /* NOP encoding T1 */ md_number_to_chars (buf, newval, THUMB_SIZE); } + else + { + if (value & ~0x7e) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("branch out of range")); + + if (fixP->fx_done || !seg->use_rela_p) + { + newval = md_chars_to_number (buf, THUMB_SIZE); + newval |= ((value & 0x3e) << 2) | ((value & 0x40) << 3); + md_number_to_chars (buf, newval, THUMB_SIZE); + } + } break; case BFD_RELOC_THUMB_PCREL_BRANCH9: /* Conditional branch. */ @@ -12129,8 +18455,15 @@ md_apply_fix (fixS * fixP, case BFD_RELOC_ARM_ROSEGREL32: case BFD_RELOC_ARM_SBREL32: case BFD_RELOC_32_PCREL: +#ifdef TE_PE + case BFD_RELOC_32_SECREL: +#endif if (fixP->fx_done || !seg->use_rela_p) - md_number_to_chars (buf, value, 4); +#ifdef TE_WINCE + /* For WinCE we only do this for pcrel fixups. */ + if (fixP->fx_done || fixP->fx_pcrel) +#endif + md_number_to_chars (buf, value, 4); break; #ifdef OBJ_ELF @@ -12165,8 +18498,6 @@ md_apply_fix (fixS * fixP, newval = get_thumb32_insn (buf); newval &= 0xff7fff00; newval |= (value >> 2) | (sign ? INDEX_UP : 0); - if (value == 0) - newval &= ~WRITE_BACK; if (fixP->fx_r_type == BFD_RELOC_ARM_CP_OFF_IMM || fixP->fx_r_type == BFD_RELOC_ARM_CP_OFF_IMM_S2) md_number_to_chars (buf, newval, INSN_SIZE); @@ -12358,6 +18689,216 @@ md_apply_fix (fixS * fixP, fixP->fx_done = 0; return; + case BFD_RELOC_ARM_MOVW: + case BFD_RELOC_ARM_MOVT: + case BFD_RELOC_ARM_THUMB_MOVW: + case BFD_RELOC_ARM_THUMB_MOVT: + if (fixP->fx_done || !seg->use_rela_p) + { + /* REL format relocations are limited to a 16-bit addend. */ + if (!fixP->fx_done) + { + if (value < -0x1000 || value > 0xffff) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("offset too big")); + } + else if (fixP->fx_r_type == BFD_RELOC_ARM_MOVT + || fixP->fx_r_type == BFD_RELOC_ARM_THUMB_MOVT) + { + value >>= 16; + } + + if (fixP->fx_r_type == BFD_RELOC_ARM_THUMB_MOVW + || fixP->fx_r_type == BFD_RELOC_ARM_THUMB_MOVT) + { + newval = get_thumb32_insn (buf); + newval &= 0xfbf08f00; + newval |= (value & 0xf000) << 4; + newval |= (value & 0x0800) << 15; + newval |= (value & 0x0700) << 4; + newval |= (value & 0x00ff); + put_thumb32_insn (buf, newval); + } + else + { + newval = md_chars_to_number (buf, 4); + newval &= 0xfff0f000; + newval |= value & 0x0fff; + newval |= (value & 0xf000) << 4; + md_number_to_chars (buf, newval, 4); + } + } + return; + + case BFD_RELOC_ARM_ALU_PC_G0_NC: + case BFD_RELOC_ARM_ALU_PC_G0: + case BFD_RELOC_ARM_ALU_PC_G1_NC: + case BFD_RELOC_ARM_ALU_PC_G1: + case BFD_RELOC_ARM_ALU_PC_G2: + case BFD_RELOC_ARM_ALU_SB_G0_NC: + case BFD_RELOC_ARM_ALU_SB_G0: + case BFD_RELOC_ARM_ALU_SB_G1_NC: + case BFD_RELOC_ARM_ALU_SB_G1: + case BFD_RELOC_ARM_ALU_SB_G2: + assert (!fixP->fx_done); + if (!seg->use_rela_p) + { + bfd_vma insn; + bfd_vma encoded_addend; + bfd_vma addend_abs = abs (value); + + /* Check that the absolute value of the addend can be + expressed as an 8-bit constant plus a rotation. */ + encoded_addend = encode_arm_immediate (addend_abs); + if (encoded_addend == (unsigned int) FAIL) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("the offset 0x%08lX is not representable"), + addend_abs); + + /* Extract the instruction. */ + insn = md_chars_to_number (buf, INSN_SIZE); + + /* If the addend is positive, use an ADD instruction. + Otherwise use a SUB. Take care not to destroy the S bit. */ + insn &= 0xff1fffff; + if (value < 0) + insn |= 1 << 22; + else + insn |= 1 << 23; + + /* Place the encoded addend into the first 12 bits of the + instruction. */ + insn &= 0xfffff000; + insn |= encoded_addend; + + /* Update the instruction. */ + md_number_to_chars (buf, insn, INSN_SIZE); + } + break; + + case BFD_RELOC_ARM_LDR_PC_G0: + case BFD_RELOC_ARM_LDR_PC_G1: + case BFD_RELOC_ARM_LDR_PC_G2: + case BFD_RELOC_ARM_LDR_SB_G0: + case BFD_RELOC_ARM_LDR_SB_G1: + case BFD_RELOC_ARM_LDR_SB_G2: + assert (!fixP->fx_done); + if (!seg->use_rela_p) + { + bfd_vma insn; + bfd_vma addend_abs = abs (value); + + /* Check that the absolute value of the addend can be + encoded in 12 bits. */ + if (addend_abs >= 0x1000) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("bad offset 0x%08lX (only 12 bits available for the magnitude)"), + addend_abs); + + /* Extract the instruction. */ + insn = md_chars_to_number (buf, INSN_SIZE); + + /* If the addend is negative, clear bit 23 of the instruction. + Otherwise set it. */ + if (value < 0) + insn &= ~(1 << 23); + else + insn |= 1 << 23; + + /* Place the absolute value of the addend into the first 12 bits + of the instruction. */ + insn &= 0xfffff000; + insn |= addend_abs; + + /* Update the instruction. */ + md_number_to_chars (buf, insn, INSN_SIZE); + } + break; + + case BFD_RELOC_ARM_LDRS_PC_G0: + case BFD_RELOC_ARM_LDRS_PC_G1: + case BFD_RELOC_ARM_LDRS_PC_G2: + case BFD_RELOC_ARM_LDRS_SB_G0: + case BFD_RELOC_ARM_LDRS_SB_G1: + case BFD_RELOC_ARM_LDRS_SB_G2: + assert (!fixP->fx_done); + if (!seg->use_rela_p) + { + bfd_vma insn; + bfd_vma addend_abs = abs (value); + + /* Check that the absolute value of the addend can be + encoded in 8 bits. */ + if (addend_abs >= 0x100) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("bad offset 0x%08lX (only 8 bits available for the magnitude)"), + addend_abs); + + /* Extract the instruction. */ + insn = md_chars_to_number (buf, INSN_SIZE); + + /* If the addend is negative, clear bit 23 of the instruction. + Otherwise set it. */ + if (value < 0) + insn &= ~(1 << 23); + else + insn |= 1 << 23; + + /* Place the first four bits of the absolute value of the addend + into the first 4 bits of the instruction, and the remaining + four into bits 8 .. 11. */ + insn &= 0xfffff0f0; + insn |= (addend_abs & 0xf) | ((addend_abs & 0xf0) << 4); + + /* Update the instruction. */ + md_number_to_chars (buf, insn, INSN_SIZE); + } + break; + + case BFD_RELOC_ARM_LDC_PC_G0: + case BFD_RELOC_ARM_LDC_PC_G1: + case BFD_RELOC_ARM_LDC_PC_G2: + case BFD_RELOC_ARM_LDC_SB_G0: + case BFD_RELOC_ARM_LDC_SB_G1: + case BFD_RELOC_ARM_LDC_SB_G2: + assert (!fixP->fx_done); + if (!seg->use_rela_p) + { + bfd_vma insn; + bfd_vma addend_abs = abs (value); + + /* Check that the absolute value of the addend is a multiple of + four and, when divided by four, fits in 8 bits. */ + if (addend_abs & 0x3) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("bad offset 0x%08lX (must be word-aligned)"), + addend_abs); + + if ((addend_abs >> 2) > 0xff) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("bad offset 0x%08lX (must be an 8-bit number of words)"), + addend_abs); + + /* Extract the instruction. */ + insn = md_chars_to_number (buf, INSN_SIZE); + + /* If the addend is negative, clear bit 23 of the instruction. + Otherwise set it. */ + if (value < 0) + insn &= ~(1 << 23); + else + insn |= 1 << 23; + + /* Place the addend (divided by four) into the first eight + bits of the instruction. */ + insn &= 0xfffffff0; + insn |= addend_abs >> 2; + + /* Update the instruction. */ + md_number_to_chars (buf, insn, INSN_SIZE); + } + break; + case BFD_RELOC_UNUSED: default: as_bad_where (fixP->fx_file, fixP->fx_line, @@ -12412,6 +18953,34 @@ tc_gen_reloc (asection *section, fixS *fixp) break; } + case BFD_RELOC_ARM_MOVW: + if (fixp->fx_pcrel) + { + code = BFD_RELOC_ARM_MOVW_PCREL; + break; + } + + case BFD_RELOC_ARM_MOVT: + if (fixp->fx_pcrel) + { + code = BFD_RELOC_ARM_MOVT_PCREL; + break; + } + + case BFD_RELOC_ARM_THUMB_MOVW: + if (fixp->fx_pcrel) + { + code = BFD_RELOC_ARM_THUMB_MOVW_PCREL; + break; + } + + case BFD_RELOC_ARM_THUMB_MOVT: + if (fixp->fx_pcrel) + { + code = BFD_RELOC_ARM_THUMB_MOVT_PCREL; + break; + } + case BFD_RELOC_NONE: case BFD_RELOC_ARM_PCREL_BRANCH: case BFD_RELOC_ARM_PCREL_BLX: @@ -12425,6 +18994,9 @@ tc_gen_reloc (asection *section, fixS *fixp) case BFD_RELOC_THUMB_PCREL_BLX: case BFD_RELOC_VTABLE_ENTRY: case BFD_RELOC_VTABLE_INHERIT: +#ifdef TE_PE + case BFD_RELOC_32_SECREL: +#endif code = fixp->fx_r_type; break; @@ -12449,6 +19021,34 @@ tc_gen_reloc (asection *section, fixS *fixp) case BFD_RELOC_ARM_TLS_LDO32: case BFD_RELOC_ARM_PCREL_CALL: case BFD_RELOC_ARM_PCREL_JUMP: + case BFD_RELOC_ARM_ALU_PC_G0_NC: + case BFD_RELOC_ARM_ALU_PC_G0: + case BFD_RELOC_ARM_ALU_PC_G1_NC: + case BFD_RELOC_ARM_ALU_PC_G1: + case BFD_RELOC_ARM_ALU_PC_G2: + case BFD_RELOC_ARM_LDR_PC_G0: + case BFD_RELOC_ARM_LDR_PC_G1: + case BFD_RELOC_ARM_LDR_PC_G2: + case BFD_RELOC_ARM_LDRS_PC_G0: + case BFD_RELOC_ARM_LDRS_PC_G1: + case BFD_RELOC_ARM_LDRS_PC_G2: + case BFD_RELOC_ARM_LDC_PC_G0: + case BFD_RELOC_ARM_LDC_PC_G1: + case BFD_RELOC_ARM_LDC_PC_G2: + case BFD_RELOC_ARM_ALU_SB_G0_NC: + case BFD_RELOC_ARM_ALU_SB_G0: + case BFD_RELOC_ARM_ALU_SB_G1_NC: + case BFD_RELOC_ARM_ALU_SB_G1: + case BFD_RELOC_ARM_ALU_SB_G2: + case BFD_RELOC_ARM_LDR_SB_G0: + case BFD_RELOC_ARM_LDR_SB_G1: + case BFD_RELOC_ARM_LDR_SB_G2: + case BFD_RELOC_ARM_LDRS_SB_G0: + case BFD_RELOC_ARM_LDRS_SB_G1: + case BFD_RELOC_ARM_LDRS_SB_G2: + case BFD_RELOC_ARM_LDC_SB_G0: + case BFD_RELOC_ARM_LDC_SB_G1: + case BFD_RELOC_ARM_LDC_SB_G2: code = fixp->fx_r_type; break; @@ -12579,6 +19179,14 @@ cons_fix_new_arm (fragS * frag, break; } +#ifdef TE_PE + if (exp->X_op == O_secrel) + { + exp->X_op = O_symbol; + type = BFD_RELOC_32_SECREL; + } +#endif + fix_new_exp (frag, where, (int) size, exp, pcrel, type); } @@ -12612,34 +19220,31 @@ arm_force_relocation (struct fix * fixp) if (fixp->fx_r_type == BFD_RELOC_ARM_IMMEDIATE || fixp->fx_r_type == BFD_RELOC_ARM_OFFSET_IMM || fixp->fx_r_type == BFD_RELOC_ARM_ADRL_IMMEDIATE + || fixp->fx_r_type == BFD_RELOC_ARM_T32_ADD_IMM || fixp->fx_r_type == BFD_RELOC_ARM_T32_IMMEDIATE || fixp->fx_r_type == BFD_RELOC_ARM_T32_IMM12 || fixp->fx_r_type == BFD_RELOC_ARM_T32_ADD_PC12) return 0; + /* Always leave these relocations for the linker. */ + if ((fixp->fx_r_type >= BFD_RELOC_ARM_ALU_PC_G0_NC + && fixp->fx_r_type <= BFD_RELOC_ARM_LDC_SB_G2) + || fixp->fx_r_type == BFD_RELOC_ARM_LDR_PC_G0) + return 1; + + /* Always generate relocations against function symbols. */ + if (fixp->fx_r_type == BFD_RELOC_32 + && fixp->fx_addsy + && (symbol_get_bfdsym (fixp->fx_addsy)->flags & BSF_FUNCTION)) + return 1; + return generic_force_reloc (fixp); } -#ifdef OBJ_COFF -/* This is a little hack to help the gas/arm/adrl.s test. It prevents - local labels from being added to the output symbol table when they - are used with the ADRL pseudo op. The ADRL relocation should always - be resolved before the binbary is emitted, so it is safe to say that - it is adjustable. */ - -bfd_boolean -arm_fix_adjustable (fixS * fixP) -{ - if (fixP->fx_r_type == BFD_RELOC_ARM_ADRL_IMMEDIATE) - return 1; - return 0; -} -#endif - -#ifdef OBJ_ELF -/* Relocations against Thumb function names must be left unadjusted, - so that the linker can use this information to correctly set the - bottom bit of their addresses. The MIPS version of this function +#if defined (OBJ_ELF) || defined (OBJ_COFF) +/* Relocations against function names must be left unadjusted, + so that the linker can use this information to generate interworking + stubs. The MIPS version of this function also prevents relocations that are mips-16 specific, but I do not know why it does this. @@ -12656,6 +19261,10 @@ arm_fix_adjustable (fixS * fixP) if (fixP->fx_addsy == NULL) return 1; + /* Preserve relocations against symbols with function type. */ + if (symbol_get_bfdsym (fixP->fx_addsy)->flags & BSF_FUNCTION) + return 0; + if (THUMB_IS_FUNC (fixP->fx_addsy) && fixP->fx_subsy == NULL) return 0; @@ -12677,8 +19286,17 @@ arm_fix_adjustable (fixS * fixP) || fixP->fx_r_type == BFD_RELOC_ARM_TARGET2) return 0; + /* Similarly for group relocations. */ + if ((fixP->fx_r_type >= BFD_RELOC_ARM_ALU_PC_G0_NC + && fixP->fx_r_type <= BFD_RELOC_ARM_LDC_SB_G2) + || fixP->fx_r_type == BFD_RELOC_ARM_LDR_PC_G0) + return 0; + return 1; } +#endif /* defined (OBJ_ELF) || defined (OBJ_COFF) */ + +#ifdef OBJ_ELF const char * elf32_arm_target_format (void) @@ -12789,14 +19407,15 @@ arm_adjust_symtab (void) elf_sym = elf_symbol (symbol_get_bfdsym (sym)); bind = ELF_ST_BIND (elf_sym->internal_elf_sym.st_info); - if (! bfd_is_arm_mapping_symbol_name (elf_sym->symbol.name)) + if (! bfd_is_arm_special_symbol_name (elf_sym->symbol.name, + BFD_ARM_SPECIAL_SYM_TYPE_ANY)) { /* If it's a .thumb_func, declare it as so, otherwise tag label as .code 16. */ if (THUMB_IS_FUNC (sym)) elf_sym->internal_elf_sym.st_info = ELF_ST_INFO (bind, STT_ARM_TFUNC); - else + else if (EF_ARM_EABI_VERSION (meabi_flags) < EF_ARM_EABI_VER4) elf_sym->internal_elf_sym.st_info = ELF_ST_INFO (bind, STT_ARM_16BIT); } @@ -12817,6 +19436,16 @@ set_constant_flonums (void) abort (); } +/* Auto-select Thumb mode if it's the only available instruction set for the + given architecture. */ + +static void +autoselect_thumb_from_cpu_variant (void) +{ + if (!ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_v1)) + opcode_select (16); +} + void md_begin (void) { @@ -12894,9 +19523,9 @@ md_begin (void) if (!mfpu_opt) { - if (!mcpu_cpu_opt) + if (mcpu_cpu_opt != NULL) mfpu_opt = &fpu_default; - else if (ARM_CPU_HAS_FEATURE (*mcpu_fpu_opt, arm_ext_v5)) + else if (mcpu_fpu_opt != NULL && ARM_CPU_HAS_FEATURE (*mcpu_fpu_opt, arm_ext_v5)) mfpu_opt = &fpu_arch_vfp_v2; else mfpu_opt = &fpu_arch_fpa; @@ -12917,6 +19546,8 @@ md_begin (void) ARM_MERGE_FEATURE_SETS (cpu_variant, *mcpu_cpu_opt, *mfpu_opt); + autoselect_thumb_from_cpu_variant (); + arm_arch_used = thumb_arch_used = arm_arch_none; #if defined OBJ_COFF || defined OBJ_ELF @@ -12992,7 +19623,9 @@ md_begin (void) #endif /* Record the CPU type as well. */ - if (ARM_CPU_HAS_FEATURE (cpu_variant, arm_cext_iwmmxt)) + if (ARM_CPU_HAS_FEATURE (cpu_variant, arm_cext_iwmmxt2)) + mach = bfd_mach_arm_iWMMXt2; + else if (ARM_CPU_HAS_FEATURE (cpu_variant, arm_cext_iwmmxt)) mach = bfd_mach_arm_iWMMXt; else if (ARM_CPU_HAS_FEATURE (cpu_variant, arm_cext_xscale)) mach = bfd_mach_arm_XScale; @@ -13362,13 +19995,16 @@ static const struct arm_cpu_option_table arm_cpus[] = {"arm1156t2f-s", ARM_ARCH_V6T2, FPU_ARCH_VFP_V2, NULL}, {"arm1176jz-s", ARM_ARCH_V6ZK, FPU_NONE, NULL}, {"arm1176jzf-s", ARM_ARCH_V6ZK, FPU_ARCH_VFP_V2, NULL}, - {"cortex-a8", ARM_ARCH_V7A, FPU_ARCH_VFP_V2, NULL}, + {"cortex-a8", ARM_ARCH_V7A, ARM_FEATURE(0, FPU_VFP_V3 + | FPU_NEON_EXT_V1), + NULL}, {"cortex-r4", ARM_ARCH_V7R, FPU_NONE, NULL}, {"cortex-m3", ARM_ARCH_V7M, FPU_NONE, NULL}, /* ??? XSCALE is really an architecture. */ {"xscale", ARM_ARCH_XSCALE, FPU_ARCH_VFP_V2, NULL}, /* ??? iwmmxt is not a processor. */ {"iwmmxt", ARM_ARCH_IWMMXT, FPU_ARCH_VFP_V2, NULL}, + {"iwmmxt2", ARM_ARCH_IWMMXT2,FPU_ARCH_VFP_V2, NULL}, {"i80200", ARM_ARCH_XSCALE, FPU_ARCH_VFP_V2, NULL}, /* Maverick */ {"ep9312", ARM_FEATURE(ARM_AEXT_V4T, ARM_CEXT_MAVERICK), FPU_ARCH_MAVERICK, "ARM920T"}, @@ -13413,11 +20049,17 @@ static const struct arm_arch_option_table arm_archs[] = {"armv6zt2", ARM_ARCH_V6ZT2, FPU_ARCH_VFP}, {"armv6zkt2", ARM_ARCH_V6ZKT2, FPU_ARCH_VFP}, {"armv7", ARM_ARCH_V7, FPU_ARCH_VFP}, + /* The official spelling of the ARMv7 profile variants is the dashed form. + Accept the non-dashed form for compatibility with old toolchains. */ {"armv7a", ARM_ARCH_V7A, FPU_ARCH_VFP}, {"armv7r", ARM_ARCH_V7R, FPU_ARCH_VFP}, {"armv7m", ARM_ARCH_V7M, FPU_ARCH_VFP}, + {"armv7-a", ARM_ARCH_V7A, FPU_ARCH_VFP}, + {"armv7-r", ARM_ARCH_V7R, FPU_ARCH_VFP}, + {"armv7-m", ARM_ARCH_V7M, FPU_ARCH_VFP}, {"xscale", ARM_ARCH_XSCALE, FPU_ARCH_VFP}, {"iwmmxt", ARM_ARCH_IWMMXT, FPU_ARCH_VFP}, + {"iwmmxt2", ARM_ARCH_IWMMXT2,FPU_ARCH_VFP}, {NULL, ARM_ARCH_NONE, ARM_ARCH_NONE} }; @@ -13433,6 +20075,7 @@ static const struct arm_option_cpu_value_table arm_extensions[] = {"maverick", ARM_FEATURE (0, ARM_CEXT_MAVERICK)}, {"xscale", ARM_FEATURE (0, ARM_CEXT_XSCALE)}, {"iwmmxt", ARM_FEATURE (0, ARM_CEXT_IWMMXT)}, + {"iwmmxt2", ARM_FEATURE (0, ARM_CEXT_IWMMXT2)}, {NULL, ARM_ARCH_NONE} }; @@ -13452,6 +20095,7 @@ static const struct arm_option_cpu_value_table arm_fpus[] = {"softvfp+vfp", FPU_ARCH_VFP_V2}, {"vfp", FPU_ARCH_VFP_V2}, {"vfp9", FPU_ARCH_VFP_V2}, + {"vfp3", FPU_ARCH_VFP_V3}, {"vfp10", FPU_ARCH_VFP_V2}, {"vfp10-r0", FPU_ARCH_VFP_V1}, {"vfpxd", FPU_ARCH_VFP_V1xD}, @@ -13460,6 +20104,7 @@ static const struct arm_option_cpu_value_table arm_fpus[] = {"arm1136jfs", FPU_ARCH_VFP_V2}, {"arm1136jf-s", FPU_ARCH_VFP_V2}, {"maverick", FPU_ARCH_MAVERICK}, + {"neon", FPU_ARCH_VFP_V3_PLUS_NEON_V1}, {NULL, ARM_ARCH_NONE} }; @@ -13855,7 +20500,13 @@ aeabi_set_public_attributes (void) ARM_MERGE_FEATURE_SETS (flags, arm_arch_used, thumb_arch_used); ARM_MERGE_FEATURE_SETS (flags, flags, *mfpu_opt); ARM_MERGE_FEATURE_SETS (flags, flags, selected_cpu); - + /*Allow the user to override the reported architecture. */ + if (object_arch) + { + ARM_CLEAR_FEATURE (flags, flags, arm_arch_any); + ARM_MERGE_FEATURE_SETS (flags, flags, *object_arch); + } + tmp = flags; arch = 0; for (p = cpu_arch_ver; p->val; p++) @@ -13881,57 +20532,56 @@ aeabi_set_public_attributes (void) for (i = 0; p[i]; i++) p[i] = TOUPPER (p[i]); } - elf32_arm_add_eabi_attr_string (stdoutput, 5, p); + bfd_elf_add_proc_attr_string (stdoutput, 5, p); } /* Tag_CPU_arch. */ - elf32_arm_add_eabi_attr_int (stdoutput, 6, arch); + bfd_elf_add_proc_attr_int (stdoutput, 6, arch); /* Tag_CPU_arch_profile. */ if (ARM_CPU_HAS_FEATURE (flags, arm_ext_v7a)) - elf32_arm_add_eabi_attr_int (stdoutput, 7, 'A'); + bfd_elf_add_proc_attr_int (stdoutput, 7, 'A'); else if (ARM_CPU_HAS_FEATURE (flags, arm_ext_v7r)) - elf32_arm_add_eabi_attr_int (stdoutput, 7, 'R'); + bfd_elf_add_proc_attr_int (stdoutput, 7, 'R'); else if (ARM_CPU_HAS_FEATURE (flags, arm_ext_v7m)) - elf32_arm_add_eabi_attr_int (stdoutput, 7, 'M'); + bfd_elf_add_proc_attr_int (stdoutput, 7, 'M'); /* Tag_ARM_ISA_use. */ if (ARM_CPU_HAS_FEATURE (arm_arch_used, arm_arch_full)) - elf32_arm_add_eabi_attr_int (stdoutput, 8, 1); + bfd_elf_add_proc_attr_int (stdoutput, 8, 1); /* Tag_THUMB_ISA_use. */ if (ARM_CPU_HAS_FEATURE (thumb_arch_used, arm_arch_full)) - elf32_arm_add_eabi_attr_int (stdoutput, 9, + bfd_elf_add_proc_attr_int (stdoutput, 9, ARM_CPU_HAS_FEATURE (thumb_arch_used, arm_arch_t2) ? 2 : 1); /* Tag_VFP_arch. */ - if (ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_arch_vfp_v2) - || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_arch_vfp_v2)) - elf32_arm_add_eabi_attr_int (stdoutput, 10, 2); - else if (ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_arch_vfp_v1) - || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_arch_vfp_v1)) - elf32_arm_add_eabi_attr_int (stdoutput, 10, 1); + if (ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_vfp_ext_v3) + || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_vfp_ext_v3)) + bfd_elf_add_proc_attr_int (stdoutput, 10, 3); + else if (ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_vfp_ext_v2) + || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_vfp_ext_v2)) + bfd_elf_add_proc_attr_int (stdoutput, 10, 2); + else if (ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_vfp_ext_v1) + || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_vfp_ext_v1) + || ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_vfp_ext_v1xd) + || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_vfp_ext_v1xd)) + bfd_elf_add_proc_attr_int (stdoutput, 10, 1); /* Tag_WMMX_arch. */ if (ARM_CPU_HAS_FEATURE (thumb_arch_used, arm_cext_iwmmxt) || ARM_CPU_HAS_FEATURE (arm_arch_used, arm_cext_iwmmxt)) - elf32_arm_add_eabi_attr_int (stdoutput, 11, 1); + bfd_elf_add_proc_attr_int (stdoutput, 11, 1); + /* Tag_NEON_arch. */ + if (ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_neon_ext_v1) + || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_neon_ext_v1)) + bfd_elf_add_proc_attr_int (stdoutput, 12, 1); } -/* Add the .ARM.attributes section. */ +/* Add the default contents for the .ARM.attributes section. */ void arm_md_end (void) { - segT s; - char *p; - addressT addr; - offsetT size; - if (EF_ARM_EABI_VERSION (meabi_flags) < EF_ARM_EABI_VER4) return; aeabi_set_public_attributes (); - size = elf32_arm_eabi_attr_size (stdoutput); - s = subseg_new (".ARM.attributes", 0); - bfd_set_section_flags (stdoutput, s, SEC_READONLY | SEC_DATA); - addr = frag_now_fix (); - p = frag_more (size); - elf32_arm_set_eabi_attr_contents (stdoutput, (bfd_byte *)p, size); } +#endif /* OBJ_ELF */ /* Parse a .cpu directive. */ @@ -14009,6 +20659,37 @@ s_arm_arch (int ignored ATTRIBUTE_UNUSED) } +/* Parse a .object_arch directive. */ + +static void +s_arm_object_arch (int ignored ATTRIBUTE_UNUSED) +{ + const struct arm_arch_option_table *opt; + char saved_char; + char *name; + + name = input_line_pointer; + while (*input_line_pointer && !ISSPACE(*input_line_pointer)) + input_line_pointer++; + saved_char = *input_line_pointer; + *input_line_pointer = 0; + + /* Skip the first "all" entry. */ + for (opt = arm_archs + 1; opt->name != NULL; opt++) + if (streq (opt->name, name)) + { + object_arch = &opt->value; + *input_line_pointer = saved_char; + demand_empty_rest_of_line (); + return; + } + + as_bad (_("unknown architecture `%s'\n"), name); + *input_line_pointer = saved_char; + ignore_rest_of_line (); +} + + /* Parse a .fpu directive. */ static void @@ -14038,5 +20719,10 @@ s_arm_fpu (int ignored ATTRIBUTE_UNUSED) *input_line_pointer = saved_char; ignore_rest_of_line (); } -#endif /* OBJ_ELF */ +/* Copy symbol information. */ +void +arm_copy_symbol_attributes (symbolS *dest, symbolS *src) +{ + ARM_GET_FLAG (dest) = ARM_GET_FLAG (src); +} diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h index f2615770c47..d6dee9b1a9a 100644 --- a/gas/config/tc-arm.h +++ b/gas/config/tc-arm.h @@ -1,6 +1,6 @@ /* This file is tc-arm.h Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) Modified by David Taylor (dtaylor@armltd.co.uk) @@ -66,6 +66,8 @@ struct fix; # if defined TE_PE # if defined TE_EPOC # define TARGET_FORMAT (target_big_endian ? "epoc-pe-arm-big" : "epoc-pe-arm-little") +# elif defined TE_WINCE +# define TARGET_FORMAT (target_big_endian ? "pe-arm-wince-big" : "pe-arm-wince-little") # else # define TARGET_FORMAT (target_big_endian ? "pe-arm-big" : "pe-arm-little") # endif @@ -98,6 +100,7 @@ extern int arm_optimize_expr (expressionS *, operatorT, expressionS *); #ifdef OBJ_ELF #define md_end arm_md_end extern void arm_md_end (void); +bfd_boolean arm_is_eabi (void); #endif /* NOTE: The fake label creation in stabs.c:s_stab_generic() has @@ -120,12 +123,30 @@ extern void arm_md_end (void); #define ARM_IS_THUMB(s) (ARM_GET_FLAG (s) & ARM_FLAG_THUMB) #define ARM_IS_INTERWORK(s) (ARM_GET_FLAG (s) & ARM_FLAG_INTERWORK) +#ifdef OBJ_ELF + +/* For ELF objects THUMB_IS_FUNC is inferred from + ARM_IS_TUMB and the function type. */ +#define THUMB_IS_FUNC(s) \ + ((arm_is_eabi () \ + && (ARM_IS_THUMB (s)) \ + && (symbol_get_bfdsym (s)->flags & BSF_FUNCTION)) \ + || (ARM_GET_FLAG (s) & THUMB_FLAG_FUNC)) + +#else #define THUMB_IS_FUNC(s) (ARM_GET_FLAG (s) & THUMB_FLAG_FUNC) +#endif #define ARM_SET_THUMB(s,t) ((t) ? ARM_SET_FLAG (s, ARM_FLAG_THUMB) : ARM_RESET_FLAG (s, ARM_FLAG_THUMB)) #define ARM_SET_INTERWORK(s,t) ((t) ? ARM_SET_FLAG (s, ARM_FLAG_INTERWORK) : ARM_RESET_FLAG (s, ARM_FLAG_INTERWORK)) #define THUMB_SET_FUNC(s,t) ((t) ? ARM_SET_FLAG (s, THUMB_FLAG_FUNC) : ARM_RESET_FLAG (s, THUMB_FLAG_FUNC)) +void arm_copy_symbol_attributes (symbolS *, symbolS *); +#ifndef TC_COPY_SYMBOL_ATTRIBUTES +#define TC_COPY_SYMBOL_ATTRIBUTES(DEST, SRC) \ + (arm_copy_symbol_attributes (DEST, SRC)) +#endif + #define TC_START_LABEL(C,STR) (c == ':' || (c == '/' && arm_data_in_code ())) #define tc_canonicalize_symbol_name(str) arm_canonicalize_symbol_name (str); #define obj_adjust_symtab() arm_adjust_symtab () @@ -146,7 +167,6 @@ extern void arm_md_end (void); #define TC_FORCE_RELOCATION_LOCAL(FIX) \ (!(FIX)->fx_pcrel \ - || (FIX)->fx_plt \ || (FIX)->fx_r_type == BFD_RELOC_ARM_GOT32 \ || (FIX)->fx_r_type == BFD_RELOC_32 \ || TC_FORCE_RELOCATION (FIX)) @@ -175,14 +195,27 @@ extern void arm_md_end (void); goto LABEL; \ } +#define DWARF2_LINE_MIN_INSN_LENGTH 2 + +/* The lr register is r14. */ +#define DWARF2_DEFAULT_RETURN_COLUMN 14 + +/* Registers are generally saved at negative offsets to the CFA. */ +#define DWARF2_CIE_DATA_ALIGNMENT (-4) + #ifdef OBJ_ELF -# define DWARF2_LINE_MIN_INSN_LENGTH 2 # define obj_frob_symbol(sym, punt) armelf_frob_symbol ((sym), & (punt)) # define md_elf_section_change_hook() arm_elf_change_section () # define md_elf_section_type(str, len) arm_elf_section_type (str, len) # define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_" # define TC_SEGMENT_INFO_TYPE struct arm_segment_info_type +/* This is not really an alignment operation, but it's something we + need to do at the same time: whenever we are figuring out the + alignment for data, we should check whether a $d symbol is + necessary. */ +# define md_cons_align(nbytes) mapping_state (MAP_DATA) + enum mstate { MAP_UNDEFINED = 0, /* Must be zero, for seginfo in new sections. */ @@ -191,6 +224,8 @@ enum mstate MAP_THUMB }; +void mapping_state (enum mstate); + struct arm_segment_info_type { enum mstate mapstate; @@ -200,12 +235,6 @@ struct arm_segment_info_type /* We want .cfi_* pseudo-ops for generating unwind info. */ #define TARGET_USE_CFIPOP 1 -/* The lr register is r14. */ -#define DWARF2_DEFAULT_RETURN_COLUMN 14 - -/* Registers are generally saved at negative offsets to the CFA. */ -#define DWARF2_CIE_DATA_ALIGNMENT -4 - /* CFI hooks. */ #define tc_regname_to_dw2regnum tc_arm_regname_to_dw2regnum #define tc_cfi_frame_initial_instructions tc_arm_frame_initial_instructions @@ -244,5 +273,14 @@ extern void arm_init_frag (struct frag *); extern void arm_handle_align (struct frag *); extern bfd_boolean arm_fix_adjustable (struct fix *); extern int arm_elf_section_type (const char *, size_t); -extern int tc_arm_regname_to_dw2regnum (const char *regname); +extern int tc_arm_regname_to_dw2regnum (char *regname); extern void tc_arm_frame_initial_instructions (void); + +#ifdef TE_PE + +#define O_secrel O_md1 + +#define TC_DWARF2_EMIT_OFFSET tc_pe_dwarf2_emit_offset +void tc_pe_dwarf2_emit_offset (symbolS *, unsigned int); + +#endif /* TE_PE */ diff --git a/gas/config/tc-avr.c b/gas/config/tc-avr.c index 7a95033d53a..2de962dd2b2 100644 --- a/gas/config/tc-avr.c +++ b/gas/config/tc-avr.c @@ -21,11 +21,9 @@ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "as.h" #include "safe-ctype.h" #include "subsegs.h" -#include "libiberty.h" struct avr_opcodes_s { @@ -63,89 +61,104 @@ struct mcu_type_s static struct mcu_type_s mcu_types[] = { - {"avr1", AVR_ISA_TINY1, bfd_mach_avr1}, - {"avr2", AVR_ISA_TINY2, bfd_mach_avr2}, - {"avr3", AVR_ISA_M103, bfd_mach_avr3}, - {"avr4", AVR_ISA_M8, bfd_mach_avr4}, - {"avr5", AVR_ISA_ALL, bfd_mach_avr5}, - {"at90s1200", AVR_ISA_1200, bfd_mach_avr1}, - {"attiny10", AVR_ISA_TINY1, bfd_mach_avr1}, /* XXX -> tn11 */ - {"attiny11", AVR_ISA_TINY1, bfd_mach_avr1}, - {"attiny12", AVR_ISA_TINY1, bfd_mach_avr1}, - {"attiny15", AVR_ISA_TINY1, bfd_mach_avr1}, - {"attiny28", AVR_ISA_TINY1, bfd_mach_avr1}, - {"at90s2313", AVR_ISA_2xxx, bfd_mach_avr2}, - {"at90s2323", AVR_ISA_2xxx, bfd_mach_avr2}, - {"at90s2333", AVR_ISA_2xxx, bfd_mach_avr2}, /* XXX -> 4433 */ - {"at90s2343", AVR_ISA_2xxx, bfd_mach_avr2}, - {"attiny22", AVR_ISA_2xxx, bfd_mach_avr2}, /* XXX -> 2343 */ - {"attiny26", AVR_ISA_2xxx, bfd_mach_avr2}, - {"at90s4433", AVR_ISA_2xxx, bfd_mach_avr2}, - {"at90s4414", AVR_ISA_2xxx, bfd_mach_avr2}, /* XXX -> 8515 */ - {"at90s4434", AVR_ISA_2xxx, bfd_mach_avr2}, /* XXX -> 8535 */ - {"at90s8515", AVR_ISA_2xxx, bfd_mach_avr2}, - {"at90s8535", AVR_ISA_2xxx, bfd_mach_avr2}, - {"at90c8534", AVR_ISA_2xxx, bfd_mach_avr2}, - {"at86rf401", AVR_ISA_2xxx, bfd_mach_avr2}, - {"attiny13", AVR_ISA_TINY2, bfd_mach_avr2}, - {"attiny2313",AVR_ISA_TINY2, bfd_mach_avr2}, - {"attiny261", AVR_ISA_TINY2, bfd_mach_avr2}, - {"attiny461", AVR_ISA_TINY2, bfd_mach_avr2}, - {"attiny861", AVR_ISA_TINY2, bfd_mach_avr2}, - {"attiny24", AVR_ISA_TINY2, bfd_mach_avr2}, - {"attiny44", AVR_ISA_TINY2, bfd_mach_avr2}, - {"attiny84", AVR_ISA_TINY2, bfd_mach_avr2}, - {"attiny25", AVR_ISA_TINY2, bfd_mach_avr2}, - {"attiny45", AVR_ISA_TINY2, bfd_mach_avr2}, - {"attiny85", AVR_ISA_TINY2, bfd_mach_avr2}, - {"atmega603", AVR_ISA_M603, bfd_mach_avr3}, /* XXX -> m103 */ - {"atmega103", AVR_ISA_M103, bfd_mach_avr3}, - {"at43usb320",AVR_ISA_M103, bfd_mach_avr3}, - {"at43usb355",AVR_ISA_M603, bfd_mach_avr3}, - {"at76c711", AVR_ISA_M603, bfd_mach_avr3}, - {"atmega48", AVR_ISA_PWMx, bfd_mach_avr4}, - {"atmega8", AVR_ISA_M8, bfd_mach_avr4}, - {"atmega83", AVR_ISA_M8, bfd_mach_avr4}, /* XXX -> m8535 */ - {"atmega85", AVR_ISA_M8, bfd_mach_avr4}, /* XXX -> m8 */ - {"atmega88", AVR_ISA_PWMx, bfd_mach_avr4}, - {"atmega8515",AVR_ISA_M8, bfd_mach_avr4}, - {"atmega8535",AVR_ISA_M8, bfd_mach_avr4}, - {"at90pwm2", AVR_ISA_PWMx, bfd_mach_avr4}, - {"at90pwm3", AVR_ISA_PWMx, bfd_mach_avr4}, - {"atmega16", AVR_ISA_M323, bfd_mach_avr5}, - {"atmega161", AVR_ISA_M161, bfd_mach_avr5}, - {"atmega162", AVR_ISA_M323, bfd_mach_avr5}, - {"atmega163", AVR_ISA_M161, bfd_mach_avr5}, - {"atmega164", AVR_ISA_M323, bfd_mach_avr5}, - {"atmega165", AVR_ISA_M323, bfd_mach_avr5}, - {"atmega168", AVR_ISA_M323, bfd_mach_avr5}, - {"atmega169", AVR_ISA_M323, bfd_mach_avr5}, - {"atmega32", AVR_ISA_M323, bfd_mach_avr5}, - {"atmega323", AVR_ISA_M323, bfd_mach_avr5}, - {"atmega324", AVR_ISA_M323, bfd_mach_avr5}, - {"atmega325", AVR_ISA_M323, bfd_mach_avr5}, - {"atmega329", AVR_ISA_M323, bfd_mach_avr5}, - {"atmega3250",AVR_ISA_M323, bfd_mach_avr5}, - {"atmega3290",AVR_ISA_M323, bfd_mach_avr5}, - {"atmega406", AVR_ISA_M323, bfd_mach_avr5}, - {"atmega64", AVR_ISA_M323, bfd_mach_avr5}, - {"atmega640", AVR_ISA_M323, bfd_mach_avr5}, - {"atmega644", AVR_ISA_M323, bfd_mach_avr5}, - {"atmega128", AVR_ISA_M128, bfd_mach_avr5}, - {"atmega1280",AVR_ISA_M128, bfd_mach_avr5}, - {"atmega1281",AVR_ISA_M128, bfd_mach_avr5}, - {"atmega645", AVR_ISA_M323, bfd_mach_avr5}, - {"atmega649", AVR_ISA_M323, bfd_mach_avr5}, - {"atmega6450",AVR_ISA_M323, bfd_mach_avr5}, - {"atmega6490",AVR_ISA_M323, bfd_mach_avr5}, - {"at90can32" ,AVR_ISA_M323, bfd_mach_avr5}, - {"at90can64" ,AVR_ISA_M323, bfd_mach_avr5}, - {"at90can128",AVR_ISA_M128, bfd_mach_avr5}, + {"avr1", AVR_ISA_TINY1, bfd_mach_avr1}, + {"avr2", AVR_ISA_TINY2, bfd_mach_avr2}, + {"avr3", AVR_ISA_M103, bfd_mach_avr3}, + {"avr4", AVR_ISA_M8, bfd_mach_avr4}, + {"avr5", AVR_ISA_ALL, bfd_mach_avr5}, + {"avr6", AVR_ISA_ALL, bfd_mach_avr6}, + {"at90s1200", AVR_ISA_1200, bfd_mach_avr1}, + {"attiny10", AVR_ISA_TINY1, bfd_mach_avr1}, /* XXX -> tn11 */ + {"attiny11", AVR_ISA_TINY1, bfd_mach_avr1}, + {"attiny12", AVR_ISA_TINY1, bfd_mach_avr1}, + {"attiny15", AVR_ISA_TINY1, bfd_mach_avr1}, + {"attiny28", AVR_ISA_TINY1, bfd_mach_avr1}, + {"at90s2313", AVR_ISA_2xxx, bfd_mach_avr2}, + {"at90s2323", AVR_ISA_2xxx, bfd_mach_avr2}, + {"at90s2333", AVR_ISA_2xxx, bfd_mach_avr2}, /* XXX -> 4433 */ + {"at90s2343", AVR_ISA_2xxx, bfd_mach_avr2}, + {"attiny22", AVR_ISA_2xxx, bfd_mach_avr2}, /* XXX -> 2343 */ + {"attiny26", AVR_ISA_2xxx, bfd_mach_avr2}, + {"at90s4433", AVR_ISA_2xxx, bfd_mach_avr2}, + {"at90s4414", AVR_ISA_2xxx, bfd_mach_avr2}, /* XXX -> 8515 */ + {"at90s4434", AVR_ISA_2xxx, bfd_mach_avr2}, /* XXX -> 8535 */ + {"at90s8515", AVR_ISA_2xxx, bfd_mach_avr2}, + {"at90s8535", AVR_ISA_2xxx, bfd_mach_avr2}, + {"at90c8534", AVR_ISA_2xxx, bfd_mach_avr2}, + {"at86rf401", AVR_ISA_2xxx, bfd_mach_avr2}, + {"attiny13", AVR_ISA_TINY2, bfd_mach_avr2}, + {"attiny2313", AVR_ISA_TINY2, bfd_mach_avr2}, + {"attiny261", AVR_ISA_TINY2, bfd_mach_avr2}, + {"attiny461", AVR_ISA_TINY2, bfd_mach_avr2}, + {"attiny861", AVR_ISA_TINY2, bfd_mach_avr2}, + {"attiny24", AVR_ISA_TINY2, bfd_mach_avr2}, + {"attiny44", AVR_ISA_TINY2, bfd_mach_avr2}, + {"attiny84", AVR_ISA_TINY2, bfd_mach_avr2}, + {"attiny25", AVR_ISA_TINY2, bfd_mach_avr2}, + {"attiny45", AVR_ISA_TINY2, bfd_mach_avr2}, + {"attiny85", AVR_ISA_TINY2, bfd_mach_avr2}, + {"atmega603", AVR_ISA_M603, bfd_mach_avr3}, /* XXX -> m103 */ + {"atmega103", AVR_ISA_M103, bfd_mach_avr3}, + {"at43usb320", AVR_ISA_M103, bfd_mach_avr3}, + {"at43usb355", AVR_ISA_M603, bfd_mach_avr3}, + {"at76c711", AVR_ISA_M603, bfd_mach_avr3}, + {"atmega48", AVR_ISA_PWMx, bfd_mach_avr4}, + {"atmega8", AVR_ISA_M8, bfd_mach_avr4}, + {"atmega83", AVR_ISA_M8, bfd_mach_avr4}, /* XXX -> m8535 */ + {"atmega85", AVR_ISA_M8, bfd_mach_avr4}, /* XXX -> m8 */ + {"atmega88", AVR_ISA_PWMx, bfd_mach_avr4}, + {"atmega8515", AVR_ISA_M8, bfd_mach_avr4}, + {"atmega8535", AVR_ISA_M8, bfd_mach_avr4}, + {"atmega8hva", AVR_ISA_PWMx, bfd_mach_avr4}, + {"at90pwm1", AVR_ISA_PWMx, bfd_mach_avr4}, + {"at90pwm2", AVR_ISA_PWMx, bfd_mach_avr4}, + {"at90pwm3", AVR_ISA_PWMx, bfd_mach_avr4}, + {"atmega16", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega161", AVR_ISA_M161, bfd_mach_avr5}, + {"atmega162", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega163", AVR_ISA_M161, bfd_mach_avr5}, + {"atmega164p", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega165", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega165p", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega168", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega169", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega169p", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega32", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega323", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega324p", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega325", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega325p", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega329", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega329p", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega3250", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega3250p",AVR_ISA_M323, bfd_mach_avr5}, + {"atmega3290", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega3290p",AVR_ISA_M323, bfd_mach_avr5}, + {"atmega406", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega64", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega640", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega644", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega644p", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega128", AVR_ISA_M128, bfd_mach_avr5}, + {"atmega1280", AVR_ISA_M128, bfd_mach_avr5}, + {"atmega1281", AVR_ISA_M128, bfd_mach_avr5}, + {"atmega645", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega649", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega6450", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega6490", AVR_ISA_M323, bfd_mach_avr5}, + {"atmega16hva",AVR_ISA_M323, bfd_mach_avr5}, + {"at90can32" , AVR_ISA_M323, bfd_mach_avr5}, + {"at90can64" , AVR_ISA_M323, bfd_mach_avr5}, + {"at90can128", AVR_ISA_M128, bfd_mach_avr5}, + {"at90usb82", AVR_ISA_M323, bfd_mach_avr5}, + {"at90usb162", AVR_ISA_M323, bfd_mach_avr5}, {"at90usb646", AVR_ISA_M323, bfd_mach_avr5}, {"at90usb647", AVR_ISA_M323, bfd_mach_avr5}, {"at90usb1286",AVR_ISA_M128, bfd_mach_avr5}, {"at90usb1287",AVR_ISA_M128, bfd_mach_avr5}, - {"at94k", AVR_ISA_94K, bfd_mach_avr5}, + {"at94k", AVR_ISA_94K, bfd_mach_avr5}, + {"atmega2560", AVR_ISA_ALL, bfd_mach_avr6}, + {"atmega2561", AVR_ISA_ALL, bfd_mach_avr6}, {NULL, 0, 0} }; @@ -512,7 +525,7 @@ avr_offset_expression (expressionS *exp) if (exp->X_op == O_constant) { int x = exp->X_add_number; - + if (x < -255 || x > 255) as_warn (_("constant out of 8-bit range: %d"), x); } @@ -544,6 +557,8 @@ avr_ldi_expression (expressionS *exp) char *tmp; char op[8]; int mod; + int linker_stubs_should_be_generated = 0; + tmp = str; str = extract_word (str, op, sizeof (op)); @@ -551,7 +566,7 @@ avr_ldi_expression (expressionS *exp) if (op[0]) { mod_index m; - + m.ptr = hash_find (avr_mod_hash, op); mod = m.index; @@ -564,11 +579,14 @@ avr_ldi_expression (expressionS *exp) if (*str == '(') { + bfd_reloc_code_real_type reloc_to_return; int neg_p = 0; ++str; if (strncmp ("pm(", str, 3) == 0 + || strncmp ("gs(",str,3) == 0 + || strncmp ("-(gs(",str,5) == 0 || strncmp ("-(pm(", str, 5) == 0) { if (HAVE_PM_P (mod)) @@ -579,6 +597,9 @@ avr_ldi_expression (expressionS *exp) else as_bad (_("illegal expression")); + if (str[0] == 'g' || str[2] == 'g') + linker_stubs_should_be_generated = 1; + if (*str == '-') { neg_p = 1; @@ -610,7 +631,24 @@ avr_ldi_expression (expressionS *exp) } while (closes--); - return neg_p ? EXP_MOD_NEG_RELOC (mod) : EXP_MOD_RELOC (mod); + reloc_to_return = + neg_p ? EXP_MOD_NEG_RELOC (mod) : EXP_MOD_RELOC (mod); + if (linker_stubs_should_be_generated) + { + switch (reloc_to_return) + { + case BFD_RELOC_AVR_LO8_LDI_PM: + reloc_to_return = BFD_RELOC_AVR_LO8_LDI_GS; + break; + case BFD_RELOC_AVR_HI8_LDI_PM: + reloc_to_return = BFD_RELOC_AVR_HI8_LDI_GS; + break; + + default: + as_warn (_("expression dangerous with linker stubs")); + } + } + return reloc_to_return; } } } @@ -1227,7 +1265,7 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, return NULL; } - /* We are dealing with two symbols defined in the same section. + /* We are dealing with two symbols defined in the same section. Let us fix-up them here. */ value += S_GET_VALUE (fixp->fx_addsy); value -= S_GET_VALUE (fixp->fx_subsy); @@ -1310,7 +1348,8 @@ md_assemble (char *str) static int exp_mod_pm = 0; /* Parse special CONS expression: pm (expression) - which is used for addressing to a program memory. + or alternatively: gs (expression). + These are used for addressing program memory. Relocation: BFD_RELOC_AVR_16_PM. */ void @@ -1324,10 +1363,13 @@ avr_parse_cons_expression (expressionS *exp, int nbytes) if (nbytes == 2) { - char *pm_name = "pm"; - int len = strlen (pm_name); + char *pm_name1 = "pm"; + char *pm_name2 = "gs"; + int len = strlen (pm_name1); + /* len must be the same for both pm identifiers. */ - if (strncasecmp (input_line_pointer, pm_name, len) == 0) + if (strncasecmp (input_line_pointer, pm_name1, len) == 0 + || strncasecmp (input_line_pointer, pm_name2, len) == 0) { input_line_pointer = skip_space (input_line_pointer + len); diff --git a/gas/config/tc-avr.h b/gas/config/tc-avr.h index 61fc5941cd2..02f82896531 100644 --- a/gas/config/tc-avr.h +++ b/gas/config/tc-avr.h @@ -1,5 +1,6 @@ /* This file is tc-avr.h - Copyright 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2005, 2006, 2007 + Free Software Foundation, Inc. Contributed by Denis Chertykov @@ -109,7 +110,7 @@ extern long md_pcrel_from_section (struct fix *, segT); would print `12 34 56 78'. The default value is 4. */ #define LISTING_WORD_SIZE 2 -/* AVR port uses `$' as a logical line separator */ +/* AVR port uses `$' as a logical line separator. */ #define LEX_DOLLAR 0 /* An `.lcomm' directive with no explicit alignment parameter will @@ -125,16 +126,24 @@ extern long md_pcrel_from_section (struct fix *, segT); We will need them in case that we want to do linker relaxation. We could in principle keep these fixups in gas when not relaxing. However, there is no serious performance penilty when making the linker - make the fixup work. */ -#define TC_VALIDATE_FIX(FIXP,SEG,SKIP) \ - if ( (FIXP->fx_r_type == BFD_RELOC_AVR_7_PCREL \ - || FIXP->fx_r_type == BFD_RELOC_AVR_13_PCREL \ - || FIXP->fx_r_type == BFD_RELOC_AVR_LO8_LDI_PM \ - || FIXP->fx_r_type == BFD_RELOC_AVR_HI8_LDI_PM \ - || FIXP->fx_r_type == BFD_RELOC_AVR_HH8_LDI_PM \ - || FIXP->fx_r_type == BFD_RELOC_AVR_16_PM) \ - && (FIXP->fx_addsy)) \ - { \ - goto SKIP; \ + make the fixup work. Check also that fx_addsy is not NULL, in order to make + sure that the fixup refers to some sort of lable. */ +#define TC_VALIDATE_FIX(FIXP,SEG,SKIP) \ + if ( (FIXP->fx_r_type == BFD_RELOC_AVR_7_PCREL \ + || FIXP->fx_r_type == BFD_RELOC_AVR_13_PCREL \ + || FIXP->fx_r_type == BFD_RELOC_AVR_LO8_LDI_PM \ + || FIXP->fx_r_type == BFD_RELOC_AVR_LO8_LDI_GS \ + || FIXP->fx_r_type == BFD_RELOC_AVR_HI8_LDI_PM \ + || FIXP->fx_r_type == BFD_RELOC_AVR_HI8_LDI_GS \ + || FIXP->fx_r_type == BFD_RELOC_AVR_HH8_LDI_PM \ + || FIXP->fx_r_type == BFD_RELOC_AVR_LO8_LDI_PM_NEG \ + || FIXP->fx_r_type == BFD_RELOC_AVR_HI8_LDI_PM_NEG \ + || FIXP->fx_r_type == BFD_RELOC_AVR_HH8_LDI_PM_NEG \ + || FIXP->fx_r_type == BFD_RELOC_AVR_16_PM) \ + && (FIXP->fx_addsy)) \ + { \ + goto SKIP; \ } +/* This target is buggy, and sets fix size too large. */ +#define TC_FX_SIZE_SLACK(FIX) 2 diff --git a/gas/config/tc-bfin.c b/gas/config/tc-bfin.c index 43d48d624ea..aff8ed8a8fd 100644 --- a/gas/config/tc-bfin.c +++ b/gas/config/tc-bfin.c @@ -1,5 +1,5 @@ /* tc-bfin.c -- Assembler for the ADI Blackfin. - Copyright 2005 + Copyright 2005, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -21,7 +21,6 @@ #include "as.h" #include "struc-symbol.h" -#include "obj-elf.h" #include "bfin-defs.h" #include "obstack.h" #include "safe-ctype.h" @@ -834,9 +833,14 @@ bfin_start_line_hook () char *c1, *label_name; symbolS *line_label; char *c = input_line_pointer; + int cr_num = 0; while (ISSPACE (*c)) - c++; + { + if (*c == '\n') + cr_num++; + c++; + } /* Look for Loop_Begin or Loop_End statements. */ @@ -902,6 +906,12 @@ bfin_start_line_hook () c1 = c; while (ISALPHA (*c) || ISDIGIT (*c) || *c == '_') c++; + if (input_line_pointer[-1] == '\n') + bump_line_counters (); + + while (cr_num--) + bump_line_counters (); + input_line_pointer = c; if (maybe_end) { @@ -929,11 +939,7 @@ bfin_start_line_hook () /* Special extra functions that help bfin-parse.y perform its job. */ -#include #include -#include -#include -#include "bfin-defs.h" struct obstack mempool; @@ -1054,7 +1060,7 @@ Expr_Node_Gen_Reloc (Expr_Node * head, int parent_reloc) } switch (parent_reloc) { - /* Some reloctions will need to allocate extra words. */ + /* Some relocations will need to allocate extra words. */ case BFD_RELOC_BFIN_16_IMM: case BFD_RELOC_BFIN_16_LOW: case BFD_RELOC_BFIN_16_HIGH: @@ -1968,42 +1974,6 @@ bfin_eol_in_insn (char *line) return FALSE; } -bfd_boolean -bfin_name_is_register (char *name) -{ - int i; - - if (*name == '[' || *name == '(') - return TRUE; - - if ((name[0] == 'W' || name[0] == 'w') && name[1] == '[') - return TRUE; - - if ((name[0] == 'B' || name[0] == 'b') && name[1] == '[') - return TRUE; - - for (i=0; bfin_reg_info[i].name != 0; i++) - { - if (!strcasecmp (bfin_reg_info[i].name, name)) - return TRUE; - } - return FALSE; -} - -void -bfin_equals (Expr_Node *sym) -{ - char *c; - - c = input_line_pointer; - while (*c != '=') - c--; - - input_line_pointer = c; - - equals ((char *) sym->value.s_value, 1); -} - bfd_boolean bfin_start_label (char *ptr) { diff --git a/gas/config/tc-bfin.h b/gas/config/tc-bfin.h index 773030cbb72..e1f95a9e57c 100644 --- a/gas/config/tc-bfin.h +++ b/gas/config/tc-bfin.h @@ -52,9 +52,9 @@ extern bfd_boolean bfin_start_label PARAMS ((char *)); #define TC_EOL_IN_INSN(PTR) (bfin_eol_in_insn(PTR) ? 1 : 0) extern bfd_boolean bfin_eol_in_insn PARAMS ((char *)); -/* The instruction is permitted to contain an = character. */ -#define TC_EQUAL_IN_INSN(C, NAME) (bfin_name_is_register (NAME) ? 1 : 0) -extern bfd_boolean bfin_name_is_register PARAMS ((char *)); +/* Almost all instructions of Blackfin contain an = character. */ +#define TC_EQUAL_IN_INSN(C, NAME) 1 + #define NOP_OPCODE 0x0000 #define LOCAL_LABELS_FB 1 @@ -75,4 +75,7 @@ extern long md_pcrel_from_section PARAMS ((struct fix *, segT)); /* Values passed to md_apply_fix3 don't include symbol values. */ #define MD_APPLY_SYM_VALUE(FIX) 0 +/* This target is buggy, and sets fix size too large. */ +#define TC_FX_SIZE_SLACK(FIX) 2 + /* end of tc-bfin.h */ diff --git a/gas/config/tc-cr16.c b/gas/config/tc-cr16.c new file mode 100644 index 00000000000..2c4c6a47684 --- /dev/null +++ b/gas/config/tc-cr16.c @@ -0,0 +1,2444 @@ +/* tc-cr16.c -- Assembler code for the CR16 CPU core. + Copyright 2007 Free Software Foundation, Inc. + + Contributed by M R Swami Reddy + + This file is part of GAS, the GNU Assembler. + + GAS 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 2, or (at your option) + any later version. + + GAS 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 GAS; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "as.h" +#include "safe-ctype.h" +#include "dwarf2dbg.h" +#include "opcode/cr16.h" +#include "elf/cr16.h" + + +/* Word is considered here as a 16-bit unsigned short int. */ +#define WORD_SHIFT 16 + +/* Register is 2-byte size. */ +#define REG_SIZE 2 + +/* Maximum size of a single instruction (in words). */ +#define INSN_MAX_SIZE 3 + +/* Maximum bits which may be set in a `mask16' operand. */ +#define MAX_REGS_IN_MASK16 8 + +/* Assign a number NUM, shifted by SHIFT bytes, into a location + pointed by index BYTE of array 'output_opcode'. */ +#define CR16_PRINT(BYTE, NUM, SHIFT) output_opcode[BYTE] |= (NUM << SHIFT) + +/* Operand errors. */ +typedef enum + { + OP_LEGAL = 0, /* Legal operand. */ + OP_OUT_OF_RANGE, /* Operand not within permitted range. */ + OP_NOT_EVEN /* Operand is Odd number, should be even. */ + } +op_err; + +/* Opcode mnemonics hash table. */ +static struct hash_control *cr16_inst_hash; +/* CR16 registers hash table. */ +static struct hash_control *reg_hash; +/* CR16 register pair hash table. */ +static struct hash_control *regp_hash; +/* CR16 processor registers hash table. */ +static struct hash_control *preg_hash; +/* CR16 processor registers 32 bit hash table. */ +static struct hash_control *pregp_hash; +/* Current instruction we're assembling. */ +const inst *instruction; + + +static int code_label = 0; + +/* Global variables. */ + +/* Array to hold an instruction encoding. */ +long output_opcode[2]; + +/* Nonzero means a relocatable symbol. */ +int relocatable; + +/* A copy of the original instruction (used in error messages). */ +char ins_parse[MAX_INST_LEN]; + +/* The current processed argument number. */ +int cur_arg_num; + +/* Generic assembler global variables which must be defined by all targets. */ + +/* Characters which always start a comment. */ +const char comment_chars[] = "#"; + +/* Characters which start a comment at the beginning of a line. */ +const char line_comment_chars[] = "#"; + +/* This array holds machine specific line separator characters. */ +const char line_separator_chars[] = ";"; + +/* Chars that can be used to separate mant from exp in floating point nums. */ +const char EXP_CHARS[] = "eE"; + +/* Chars that mean this number is a floating point constant as in 0f12.456 */ +const char FLT_CHARS[] = "f'"; + +/* Target-specific multicharacter options, not const-declared at usage. */ +const char *md_shortopts = ""; +struct option md_longopts[] = +{ + {NULL, no_argument, NULL, 0} +}; +size_t md_longopts_size = sizeof (md_longopts); + +static void +l_cons (int nbytes) +{ + int c; + expressionS exp; + +#ifdef md_flush_pending_output + md_flush_pending_output (); +#endif + + if (is_it_end_of_statement ()) + { + demand_empty_rest_of_line (); + return; + } + +#ifdef TC_ADDRESS_BYTES + if (nbytes == 0) + nbytes = TC_ADDRESS_BYTES (); +#endif + +#ifdef md_cons_align + md_cons_align (nbytes); +#endif + + c = 0; + do + { + unsigned int bits_available = BITS_PER_CHAR * nbytes; + char *hold = input_line_pointer; + + expression (&exp); + + if (*input_line_pointer == ':') + { + /* Bitfields. */ + long value = 0; + + for (;;) + { + unsigned long width; + + if (*input_line_pointer != ':') + { + input_line_pointer = hold; + break; + } + if (exp.X_op == O_absent) + { + as_warn (_("using a bit field width of zero")); + exp.X_add_number = 0; + exp.X_op = O_constant; + } + + if (exp.X_op != O_constant) + { + *input_line_pointer = '\0'; + as_bad (_("field width \"%s\" too complex for a bitfield"), hold); + *input_line_pointer = ':'; + demand_empty_rest_of_line (); + return; + } + + if ((width = exp.X_add_number) > + (unsigned int)(BITS_PER_CHAR * nbytes)) + { + as_warn (_("field width %lu too big to fit in %d bytes: truncated to %d bits"), width, nbytes, (BITS_PER_CHAR * nbytes)); + width = BITS_PER_CHAR * nbytes; + } /* Too big. */ + + + if (width > bits_available) + { + /* FIXME-SOMEDAY: backing up and reparsing is wasteful. */ + input_line_pointer = hold; + exp.X_add_number = value; + break; + } + + /* Skip ':'. */ + hold = ++input_line_pointer; + + expression (&exp); + if (exp.X_op != O_constant) + { + char cache = *input_line_pointer; + + *input_line_pointer = '\0'; + as_bad (_("field value \"%s\" too complex for a bitfield"), hold); + *input_line_pointer = cache; + demand_empty_rest_of_line (); + return; + } + + value |= ((~(-1 << width) & exp.X_add_number) + << ((BITS_PER_CHAR * nbytes) - bits_available)); + + if ((bits_available -= width) == 0 + || is_it_end_of_statement () + || *input_line_pointer != ',') + break; + + hold = ++input_line_pointer; + expression (&exp); + } + + exp.X_add_number = value; + exp.X_op = O_constant; + exp.X_unsigned = 1; + } + + if ((*(input_line_pointer) == '@') && (*(input_line_pointer +1) == 'c')) + code_label = 1; + emit_expr (&exp, (unsigned int) nbytes); + ++c; + if ((*(input_line_pointer) == '@') && (*(input_line_pointer +1) == 'c')) + { + input_line_pointer +=3; + break; + } + } + while ((*input_line_pointer++ == ',')); + + /* Put terminator back into stream. */ + input_line_pointer--; + + demand_empty_rest_of_line (); +} + + +/* This table describes all the machine specific pseudo-ops + the assembler has to support. The fields are: + *** Pseudo-op name without dot. + *** Function to call to execute this pseudo-op. + *** Integer arg to pass to the function. */ + +const pseudo_typeS md_pseudo_table[] = +{ + /* In CR16 machine, align is in bytes (not a ptwo boundary). */ + {"align", s_align_bytes, 0}, + {"long", l_cons, 4 }, + {0, 0, 0} +}; + +/* CR16 relaxation table. */ +const relax_typeS md_relax_table[] = +{ + /* bCC */ + {0xfa, -0x100, 2, 1}, /* 8 */ + {0xfffe, -0x10000, 4, 2}, /* 16 */ + {0xfffffe, -0x1000000, 6, 0}, /* 24 */ +}; + +/* Return the bit size for a given operand. */ + +static int +get_opbits (operand_type op) +{ + if (op < MAX_OPRD) + return cr16_optab[op].bit_size; + + return 0; +} + +/* Return the argument type of a given operand. */ + +static argtype +get_optype (operand_type op) +{ + if (op < MAX_OPRD) + return cr16_optab[op].arg_type; + else + return nullargs; +} + +/* Return the flags of a given operand. */ + +static int +get_opflags (operand_type op) +{ + if (op < MAX_OPRD) + return cr16_optab[op].flags; + + return 0; +} + +/* Get the cc code. */ + +static int +get_cc (char *cc_name) +{ + unsigned int i; + + for (i = 0; i < cr16_num_cc; i++) + if (strcmp (cc_name, cr16_b_cond_tab[i]) == 0) + return i; + + return -1; +} + +/* Get the core processor register 'reg_name'. */ + +static reg +get_register (char *reg_name) +{ + const reg_entry *reg; + + reg = (const reg_entry *) hash_find (reg_hash, reg_name); + + if (reg != NULL) + return reg->value.reg_val; + + return nullregister; +} +/* Get the core processor register-pair 'reg_name'. */ + +static reg +get_register_pair (char *reg_name) +{ + const reg_entry *reg; + char tmp_rp[16]="\0"; + + /* Add '(' and ')' to the reg pair, if its not present. */ + if (reg_name[0] != '(') + { + tmp_rp[0] = '('; + strcat (tmp_rp, reg_name); + strcat (tmp_rp,")"); + reg = (const reg_entry *) hash_find (regp_hash, tmp_rp); + } + else + reg = (const reg_entry *) hash_find (regp_hash, reg_name); + + if (reg != NULL) + return reg->value.reg_val; + + return nullregister; +} + +/* Get the index register 'reg_name'. */ + +static reg +get_index_register (char *reg_name) +{ + const reg_entry *reg; + + reg = (const reg_entry *) hash_find (reg_hash, reg_name); + + if ((reg != NULL) + && ((reg->value.reg_val == 12) || (reg->value.reg_val == 13))) + return reg->value.reg_val; + + return nullregister; +} +/* Get the core processor index register-pair 'reg_name'. */ + +static reg +get_index_register_pair (char *reg_name) +{ + const reg_entry *reg; + + reg = (const reg_entry *) hash_find (regp_hash, reg_name); + + if (reg != NULL) + { + if ((reg->value.reg_val != 1) || (reg->value.reg_val != 7) + || (reg->value.reg_val != 9) || (reg->value.reg_val > 10)) + return reg->value.reg_val; + + as_bad (_("Unknown register pair - index relative mode: `%d'"), reg->value.reg_val); + } + + return nullregister; +} + +/* Get the processor register 'preg_name'. */ + +static preg +get_pregister (char *preg_name) +{ + const reg_entry *preg; + + preg = (const reg_entry *) hash_find (preg_hash, preg_name); + + if (preg != NULL) + return preg->value.preg_val; + + return nullpregister; +} + +/* Get the processor register 'preg_name 32 bit'. */ + +static preg +get_pregisterp (char *preg_name) +{ + const reg_entry *preg; + + preg = (const reg_entry *) hash_find (pregp_hash, preg_name); + + if (preg != NULL) + return preg->value.preg_val; + + return nullpregister; +} + + +/* Round up a section size to the appropriate boundary. */ + +valueT +md_section_align (segT seg, valueT val) +{ + /* Round .text section to a multiple of 2. */ + if (seg == text_section) + return (val + 1) & ~1; + return val; +} + +/* Parse an operand that is machine-specific (remove '*'). */ + +void +md_operand (expressionS * exp) +{ + char c = *input_line_pointer; + + switch (c) + { + case '*': + input_line_pointer++; + expression (exp); + break; + default: + break; + } +} + +/* Reset global variables before parsing a new instruction. */ + +static void +reset_vars (char *op) +{ + cur_arg_num = relocatable = 0; + memset (& output_opcode, '\0', sizeof (output_opcode)); + + /* Save a copy of the original OP (used in error messages). */ + strncpy (ins_parse, op, sizeof ins_parse - 1); + ins_parse [sizeof ins_parse - 1] = 0; +} + +/* This macro decides whether a particular reloc is an entry in a + switch table. It is used when relaxing, because the linker needs + to know about all such entries so that it can adjust them if + necessary. */ + +#define SWITCH_TABLE(fix) \ + ( (fix)->fx_addsy != NULL \ + && (fix)->fx_subsy != NULL \ + && S_GET_SEGMENT ((fix)->fx_addsy) == \ + S_GET_SEGMENT ((fix)->fx_subsy) \ + && S_GET_SEGMENT (fix->fx_addsy) != undefined_section \ + && ( (fix)->fx_r_type == BFD_RELOC_CR16_NUM8 \ + || (fix)->fx_r_type == BFD_RELOC_CR16_NUM16 \ + || (fix)->fx_r_type == BFD_RELOC_CR16_NUM32 \ + || (fix)->fx_r_type == BFD_RELOC_CR16_NUM32a)) + +/* See whether we need to force a relocation into the output file. + This is used to force out switch and PC relative relocations when + relaxing. */ + +int +cr16_force_relocation (fixS *fix) +{ + /* REVISIT: Check if the "SWITCH_TABLE (fix)" should be added + if (generic_force_reloc (fix) || SWITCH_TABLE (fix)) */ + if (generic_force_reloc (fix)) + return 1; + + return 0; +} + +/* Record a fixup for a cons expression. */ + +void +cr16_cons_fix_new (fragS *frag, int offset, int len, expressionS *exp) +{ + int rtype; + switch (len) + { + default: rtype = BFD_RELOC_NONE; break; + case 1: rtype = BFD_RELOC_CR16_NUM8 ; break; + case 2: rtype = BFD_RELOC_CR16_NUM16; break; + case 4: + if (code_label) + { + rtype = BFD_RELOC_CR16_NUM32a; + code_label = 0; + } + else + rtype = BFD_RELOC_CR16_NUM32; + break; + } + + fix_new_exp (frag, offset, len, exp, 0, rtype); +} + +/* Generate a relocation entry for a fixup. */ + +arelent * +tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS * fixP) +{ + arelent * reloc; + + reloc = xmalloc (sizeof (arelent)); + reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *)); + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy); + reloc->address = fixP->fx_frag->fr_address + fixP->fx_where; + reloc->addend = fixP->fx_offset; + + if (fixP->fx_subsy != NULL) + { + if (SWITCH_TABLE (fixP)) + { + /* Keep the current difference in the addend. */ + reloc->addend = (S_GET_VALUE (fixP->fx_addsy) + - S_GET_VALUE (fixP->fx_subsy) + fixP->fx_offset); + + switch (fixP->fx_r_type) + { + case BFD_RELOC_CR16_NUM8: + fixP->fx_r_type = BFD_RELOC_CR16_NUM8; + break; + case BFD_RELOC_CR16_NUM16: + fixP->fx_r_type = BFD_RELOC_CR16_NUM16; + break; + case BFD_RELOC_CR16_NUM32: + fixP->fx_r_type = BFD_RELOC_CR16_NUM32; + break; + case BFD_RELOC_CR16_NUM32a: + fixP->fx_r_type = BFD_RELOC_CR16_NUM32a; + break; + default: + abort (); + break; + } + } + else + { + /* We only resolve difference expressions in the same section. */ + as_bad_where (fixP->fx_file, fixP->fx_line, + _("can't resolve `%s' {%s section} - `%s' {%s section}"), + fixP->fx_addsy ? S_GET_NAME (fixP->fx_addsy) : "0", + segment_name (fixP->fx_addsy + ? S_GET_SEGMENT (fixP->fx_addsy) + : absolute_section), + S_GET_NAME (fixP->fx_subsy), + segment_name (S_GET_SEGMENT (fixP->fx_addsy))); + } + } + + assert ((int) fixP->fx_r_type > 0); + reloc->howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type); + + if (reloc->howto == NULL) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _("internal error: reloc %d (`%s') not supported by object file format"), + fixP->fx_r_type, + bfd_get_reloc_code_name (fixP->fx_r_type)); + return NULL; + } + assert (!fixP->fx_pcrel == !reloc->howto->pc_relative); + + return reloc; +} + +/* Prepare machine-dependent frags for relaxation. */ + +int +md_estimate_size_before_relax (fragS *fragp, asection *seg) +{ + /* If symbol is undefined or located in a different section, + select the largest supported relocation. */ + relax_substateT subtype; + relax_substateT rlx_state[] = {0, 2}; + + for (subtype = 0; subtype < ARRAY_SIZE (rlx_state); subtype += 2) + { + if (fragp->fr_subtype == rlx_state[subtype] + && (!S_IS_DEFINED (fragp->fr_symbol) + || seg != S_GET_SEGMENT (fragp->fr_symbol))) + { + fragp->fr_subtype = rlx_state[subtype + 1]; + break; + } + } + + if (fragp->fr_subtype >= ARRAY_SIZE (md_relax_table)) + abort (); + + return md_relax_table[fragp->fr_subtype].rlx_length; +} + +void +md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, fragS *fragP) +{ + /* 'opcode' points to the start of the instruction, whether + we need to change the instruction's fixed encoding. */ + bfd_reloc_code_real_type reloc = BFD_RELOC_NONE; + + subseg_change (sec, 0); + + fix_new (fragP, fragP->fr_fix, + bfd_get_reloc_size (bfd_reloc_type_lookup (stdoutput, reloc)), + fragP->fr_symbol, fragP->fr_offset, 1, reloc); + fragP->fr_var = 0; + fragP->fr_fix += md_relax_table[fragP->fr_subtype].rlx_length; +} + +/* Process machine-dependent command line options. Called once for + each option on the command line that the machine-independent part of + GAS does not understand. */ + +int +md_parse_option (int c ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED) +{ + return 0; +} + +/* Machine-dependent usage-output. */ + +void +md_show_usage (FILE *stream ATTRIBUTE_UNUSED) +{ + return; +} + +/* Turn a string in input_line_pointer into a floating point constant + of type TYPE, and store the appropriate bytes in *LITP. The number + of LITTLENUMS emitted is stored in *SIZEP. An error message is + returned, or NULL on OK. */ + +char * +md_atof (int type, char *litP, int *sizeP) +{ + int prec; + int i; + LITTLENUM_TYPE words[4]; + char *t; + + switch (type) + { + case 'f': + prec = 2; + break; + + case 'd': + prec = 4; + break; + + default: + *sizeP = 0; + return _("bad call to md_atof"); + } + + t = atof_ieee (input_line_pointer, type, words); + if (t) + input_line_pointer = t; + + *sizeP = prec * 2; + + if (! target_big_endian) + { + for (i = prec - 1; i >= 0; i--) + { + md_number_to_chars (litP, (valueT) words[i], 2); + litP += 2; + } + } + else + { + for (i = 0; i < prec; i++) + { + md_number_to_chars (litP, (valueT) words[i], 2); + litP += 2; + } + } + + return NULL; +} + +/* Apply a fixS (fixup of an instruction or data that we didn't have + enough info to complete immediately) to the data in a frag. + Since linkrelax is nonzero and TC_LINKRELAX_FIXUP is defined to disable + relaxation of debug sections, this function is called only when + fixuping relocations of debug sections. */ + +void +md_apply_fix (fixS *fixP, valueT *valP, segT seg) +{ + valueT val = * valP; + char *buf = fixP->fx_frag->fr_literal + fixP->fx_where; + fixP->fx_offset = 0; + + switch (fixP->fx_r_type) + { + case BFD_RELOC_CR16_NUM8: + bfd_put_8 (stdoutput, (unsigned char) val, buf); + break; + case BFD_RELOC_CR16_NUM16: + bfd_put_16 (stdoutput, val, buf); + break; + case BFD_RELOC_CR16_NUM32: + bfd_put_32 (stdoutput, val, buf); + break; + case BFD_RELOC_CR16_NUM32a: + bfd_put_32 (stdoutput, val, buf); + break; + default: + /* We shouldn't ever get here because linkrelax is nonzero. */ + abort (); + break; + } + + fixP->fx_done = 0; + + if (fixP->fx_addsy == NULL + && fixP->fx_pcrel == 0) + fixP->fx_done = 1; + + if (fixP->fx_pcrel == 1 + && fixP->fx_addsy != NULL + && S_GET_SEGMENT (fixP->fx_addsy) == seg) + fixP->fx_done = 1; +} + +/* The location from which a PC relative jump should be calculated, + given a PC relative reloc. */ + +long +md_pcrel_from (fixS *fixp) +{ + return fixp->fx_frag->fr_address + fixp->fx_where; +} + +static void +initialise_reg_hash_table (struct hash_control ** hash_table, + const reg_entry * register_table, + const unsigned int num_entries) +{ + const reg_entry * reg; + const char *hashret; + + if ((* hash_table = hash_new ()) == NULL) + as_fatal (_("Virtual memory exhausted")); + + for (reg = register_table; + reg < (register_table + num_entries); + reg++) + { + hashret = hash_insert (* hash_table, reg->name, (char *) reg); + if (hashret) + as_fatal (_("Internal Error: Can't hash %s: %s"), + reg->name, hashret); + } +} + +/* This function is called once, at assembler startup time. This should + set up all the tables, etc that the MD part of the assembler needs. */ + +void +md_begin (void) +{ + int i = 0; + + /* Set up a hash table for the instructions. */ + if ((cr16_inst_hash = hash_new ()) == NULL) + as_fatal (_("Virtual memory exhausted")); + + while (cr16_instruction[i].mnemonic != NULL) + { + const char *hashret; + const char *mnemonic = cr16_instruction[i].mnemonic; + + hashret = hash_insert (cr16_inst_hash, mnemonic, + (char *)(cr16_instruction + i)); + + if (hashret != NULL && *hashret != '\0') + as_fatal (_("Can't hash `%s': %s\n"), cr16_instruction[i].mnemonic, + *hashret == 0 ? _("(unknown reason)") : hashret); + + /* Insert unique names into hash table. The CR16 instruction set + has many identical opcode names that have different opcodes based + on the operands. This hash table then provides a quick index to + the first opcode with a particular name in the opcode table. */ + do + { + ++i; + } + while (cr16_instruction[i].mnemonic != NULL + && streq (cr16_instruction[i].mnemonic, mnemonic)); + } + + /* Initialize reg_hash hash table. */ + initialise_reg_hash_table (& reg_hash, cr16_regtab, NUMREGS); + /* Initialize regp_hash hash table. */ + initialise_reg_hash_table (& regp_hash, cr16_regptab, NUMREGPS); + /* Initialize preg_hash hash table. */ + initialise_reg_hash_table (& preg_hash, cr16_pregtab, NUMPREGS); + /* Initialize pregp_hash hash table. */ + initialise_reg_hash_table (& pregp_hash, cr16_pregptab, NUMPREGPS); + + /* Set linkrelax here to avoid fixups in most sections. */ + linkrelax = 1; +} + +/* Process constants (immediate/absolute) + and labels (jump targets/Memory locations). */ + +static void +process_label_constant (char *str, ins * cr16_ins) +{ + char *saved_input_line_pointer; + int symbol_with_at = 0; + int symbol_with_s = 0; + int symbol_with_m = 0; + int symbol_with_l = 0; + argument *cur_arg = cr16_ins->arg + cur_arg_num; /* Current argument. */ + + saved_input_line_pointer = input_line_pointer; + input_line_pointer = str; + + expression (&cr16_ins->exp); + + switch (cr16_ins->exp.X_op) + { + case O_big: + case O_absent: + /* Missing or bad expr becomes absolute 0. */ + as_bad (_("missing or invalid displacement expression `%s' taken as 0"), + str); + cr16_ins->exp.X_op = O_constant; + cr16_ins->exp.X_add_number = 0; + cr16_ins->exp.X_add_symbol = NULL; + cr16_ins->exp.X_op_symbol = NULL; + /* Fall through. */ + + case O_constant: + cur_arg->X_op = O_constant; + cur_arg->constant = cr16_ins->exp.X_add_number; + break; + + case O_symbol: + case O_subtract: + case O_add: + cur_arg->X_op = O_symbol; + cr16_ins->rtype = BFD_RELOC_NONE; + relocatable = 1; + + if (strneq (input_line_pointer, "@c", 2)) + symbol_with_at = 1; + + if (strneq (input_line_pointer, "@l", 2) + || strneq (input_line_pointer, ":l", 2)) + symbol_with_l = 1; + + if (strneq (input_line_pointer, "@m", 2) + || strneq (input_line_pointer, ":m", 2)) + symbol_with_m = 1; + + if (strneq (input_line_pointer, "@s", 2) + || strneq (input_line_pointer, ":s", 2)) + symbol_with_s = 1; + + switch (cur_arg->type) + { + case arg_cr: + if (IS_INSN_TYPE (LD_STOR_INS) || IS_INSN_TYPE (CSTBIT_INS)) + { + if (cur_arg->size == 20) + cr16_ins->rtype = BFD_RELOC_CR16_REGREL20; + else + cr16_ins->rtype = BFD_RELOC_CR16_REGREL20a; + } + break; + + case arg_crp: + if (IS_INSN_TYPE (LD_STOR_INS) || IS_INSN_TYPE (CSTBIT_INS)) + switch (instruction->size) + { + case 1: + switch (cur_arg->size) + { + case 0: + cr16_ins->rtype = BFD_RELOC_CR16_REGREL0; + break; + case 4: + if (IS_INSN_MNEMONIC ("loadb") || IS_INSN_MNEMONIC ("storb")) + cr16_ins->rtype = BFD_RELOC_CR16_REGREL4; + else + cr16_ins->rtype = BFD_RELOC_CR16_REGREL4a; + break; + default: break; + } + break; + case 2: + cr16_ins->rtype = BFD_RELOC_CR16_REGREL16; + break; + case 3: + if (cur_arg->size == 20) + cr16_ins->rtype = BFD_RELOC_CR16_REGREL20; + else + cr16_ins->rtype = BFD_RELOC_CR16_REGREL20a; + break; + default: + break; + } + break; + + case arg_idxr: + if (IS_INSN_TYPE (LD_STOR_INS) || IS_INSN_TYPE (CSTBIT_INS)) + cr16_ins->rtype = BFD_RELOC_CR16_REGREL20; + break; + + case arg_idxrp: + if (IS_INSN_TYPE (LD_STOR_INS) || IS_INSN_TYPE (CSTBIT_INS)) + switch (instruction->size) + { + case 1: cr16_ins->rtype = BFD_RELOC_CR16_REGREL0; break; + case 2: cr16_ins->rtype = BFD_RELOC_CR16_REGREL14; break; + case 3: cr16_ins->rtype = BFD_RELOC_CR16_REGREL20; break; + default: break; + } + break; + + case arg_c: + if (IS_INSN_MNEMONIC ("bal")) + cr16_ins->rtype = BFD_RELOC_CR16_DISP24; + else if (IS_INSN_TYPE (BRANCH_INS)) + { + if (symbol_with_s) + cr16_ins->rtype = BFD_RELOC_CR16_DISP8; + else if (symbol_with_m) + cr16_ins->rtype = BFD_RELOC_CR16_DISP16; + else + cr16_ins->rtype = BFD_RELOC_CR16_DISP24; + } + else if (IS_INSN_TYPE (STOR_IMM_INS) || IS_INSN_TYPE (LD_STOR_INS) + || IS_INSN_TYPE (CSTBIT_INS)) + { + if (symbol_with_s) + as_bad (_("operand %d: illegal use expression: `%s`"), cur_arg_num + 1, str); + if (symbol_with_m) + cr16_ins->rtype = BFD_RELOC_CR16_ABS20; + else /* Default to (symbol_with_l) */ + cr16_ins->rtype = BFD_RELOC_CR16_ABS24; + } + else if (IS_INSN_TYPE (BRANCH_NEQ_INS)) + cr16_ins->rtype = BFD_RELOC_CR16_DISP4; + break; + + case arg_ic: + if (IS_INSN_TYPE (ARITH_INS)) + { + if (symbol_with_s) + cr16_ins->rtype = BFD_RELOC_CR16_IMM4; + else if (symbol_with_m) + cr16_ins->rtype = BFD_RELOC_CR16_IMM20; + else if (symbol_with_at) + cr16_ins->rtype = BFD_RELOC_CR16_IMM32a; + else /* Default to (symbol_with_l) */ + cr16_ins->rtype = BFD_RELOC_CR16_IMM32; + } + else if (IS_INSN_TYPE (ARITH_BYTE_INS)) + { + cr16_ins->rtype = BFD_RELOC_CR16_IMM16; + } + break; + default: + break; + } + break; + + default: + cur_arg->X_op = cr16_ins->exp.X_op; + break; + } + + input_line_pointer = saved_input_line_pointer; + return; +} + +/* Retrieve the opcode image of a given register. + If the register is illegal for the current instruction, + issue an error. */ + +static int +getreg_image (reg r) +{ + const reg_entry *reg; + char *reg_name; + int is_procreg = 0; /* Nonzero means argument should be processor reg. */ + + /* Check whether the register is in registers table. */ + if (r < MAX_REG) + reg = cr16_regtab + r; + else /* Register not found. */ + { + as_bad (_("Unknown register: `%d'"), r); + return 0; + } + + reg_name = reg->name; + +/* Issue a error message when register is illegal. */ +#define IMAGE_ERR \ + as_bad (_("Illegal register (`%s') in Instruction: `%s'"), \ + reg_name, ins_parse); \ + break; + + switch (reg->type) + { + case CR16_R_REGTYPE: + if (! is_procreg) + return reg->image; + else + IMAGE_ERR; + + case CR16_P_REGTYPE: + return reg->image; + break; + + default: + IMAGE_ERR; + } + + return 0; +} + +/* Parsing different types of operands + -> constants Immediate/Absolute/Relative numbers + -> Labels Relocatable symbols + -> (reg pair base) Register pair base + -> (rbase) Register base + -> disp(rbase) Register relative + -> [rinx]disp(reg pair) Register index with reg pair mode + -> disp(rbase,ridx,scl) Register index mode. */ + +static void +set_operand (char *operand, ins * cr16_ins) +{ + char *operandS; /* Pointer to start of sub-opearand. */ + char *operandE; /* Pointer to end of sub-opearand. */ + + argument *cur_arg = &cr16_ins->arg[cur_arg_num]; /* Current argument. */ + + /* Initialize pointers. */ + operandS = operandE = operand; + + switch (cur_arg->type) + { + case arg_ic: /* Case $0x18. */ + operandS++; + case arg_c: /* Case 0x18. */ + /* Set constant. */ + process_label_constant (operandS, cr16_ins); + + if (cur_arg->type != arg_ic) + cur_arg->type = arg_c; + break; + + case arg_icr: /* Case $0x18(r1). */ + operandS++; + case arg_cr: /* Case 0x18(r1). */ + /* Set displacement constant. */ + while (*operandE != '(') + operandE++; + *operandE = '\0'; + process_label_constant (operandS, cr16_ins); + operandS = operandE; + case arg_rbase: /* Case (r1) or (r1,r0). */ + operandS++; + /* Set register base. */ + while (*operandE != ')') + operandE++; + *operandE = '\0'; + if ((cur_arg->r = get_register (operandS)) == nullregister) + as_bad (_("Illegal register `%s' in Instruction `%s'"), + operandS, ins_parse); + + /* set the arg->rp, if reg is "r12" or "r13" or "14" or "15" */ + if ((cur_arg->type != arg_rbase) + && ((getreg_image (cur_arg->r) == 12) + || (getreg_image (cur_arg->r) == 13) + || (getreg_image (cur_arg->r) == 14) + || (getreg_image (cur_arg->r) == 15))) + { + cur_arg->type = arg_crp; + cur_arg->rp = cur_arg->r; + } + break; + + case arg_crp: /* Case 0x18(r1,r0). */ + /* Set displacement constant. */ + while (*operandE != '(') + operandE++; + *operandE = '\0'; + process_label_constant (operandS, cr16_ins); + operandS = operandE; + operandS++; + /* Set register pair base. */ + while (*operandE != ')') + operandE++; + *operandE = '\0'; + if ((cur_arg->rp = get_register_pair (operandS)) == nullregister) + as_bad (_("Illegal register pair `%s' in Instruction `%s'"), + operandS, ins_parse); + break; + + case arg_idxr: + /* Set register pair base. */ + if ((strchr (operandS,'(') != NULL)) + { + while ((*operandE != '(') && (! ISSPACE (*operandE))) + operandE++; + if ((cur_arg->rp = get_index_register_pair (operandE)) == nullregister) + as_bad (_("Illegal register pair `%s' in Instruction `%s'"), + operandS, ins_parse); + *operandE++ = '\0'; + cur_arg->type = arg_idxrp; + } + else + cur_arg->rp = -1; + + operandE = operandS; + /* Set displacement constant. */ + while (*operandE != ']') + operandE++; + process_label_constant (++operandE, cr16_ins); + *operandE++ = '\0'; + operandE = operandS; + + /* Set index register . */ + operandS = strchr (operandE,'['); + if (operandS != NULL) + { /* Eliminate '[', detach from rest of operand. */ + *operandS++ = '\0'; + + operandE = strchr (operandS, ']'); + + if (operandE == NULL) + as_bad (_("unmatched '['")); + else + { /* Eliminate ']' and make sure it was the last thing + in the string. */ + *operandE = '\0'; + if (*(operandE + 1) != '\0') + as_bad (_("garbage after index spec ignored")); + } + } + + if ((cur_arg->i_r = get_index_register (operandS)) == nullregister) + as_bad (_("Illegal register `%s' in Instruction `%s'"), + operandS, ins_parse); + *operandE = '\0'; + *operandS = '\0'; + break; + + default: + break; + } +} + +/* Parse a single operand. + operand - Current operand to parse. + cr16_ins - Current assembled instruction. */ + +static void +parse_operand (char *operand, ins * cr16_ins) +{ + int ret_val; + argument *cur_arg = cr16_ins->arg + cur_arg_num; /* Current argument. */ + + /* Initialize the type to NULL before parsing. */ + cur_arg->type = nullargs; + + /* Check whether this is a condition code . */ + if ((IS_INSN_MNEMONIC ("b")) && ((ret_val = get_cc (operand)) != -1)) + { + cur_arg->type = arg_cc; + cur_arg->cc = ret_val; + cur_arg->X_op = O_register; + return; + } + + /* Check whether this is a general processor register. */ + if ((ret_val = get_register (operand)) != nullregister) + { + cur_arg->type = arg_r; + cur_arg->r = ret_val; + cur_arg->X_op = 0; + return; + } + + /* Check whether this is a general processor register pair. */ + if ((operand[0] == '(') + && ((ret_val = get_register_pair (operand)) != nullregister)) + { + cur_arg->type = arg_rp; + cur_arg->rp = ret_val; + cur_arg->X_op = O_register; + return; + } + + /* Check whether the operand is a processor register. + For "lprd" and "sprd" instruction, only 32 bit + processor registers used. */ + if (!(IS_INSN_MNEMONIC ("lprd") || (IS_INSN_MNEMONIC ("sprd"))) + && ((ret_val = get_pregister (operand)) != nullpregister)) + { + cur_arg->type = arg_pr; + cur_arg->pr = ret_val; + cur_arg->X_op = O_register; + return; + } + + /* Check whether this is a processor register - 32 bit. */ + if ((ret_val = get_pregisterp (operand)) != nullpregister) + { + cur_arg->type = arg_prp; + cur_arg->prp = ret_val; + cur_arg->X_op = O_register; + return; + } + + /* Deal with special characters. */ + switch (operand[0]) + { + case '$': + if (strchr (operand, '(') != NULL) + cur_arg->type = arg_icr; + else + cur_arg->type = arg_ic; + goto set_params; + break; + + case '(': + cur_arg->type = arg_rbase; + goto set_params; + break; + + case '[': + cur_arg->type = arg_idxr; + goto set_params; + break; + + default: + break; + } + + if (strchr (operand, '(') != NULL) + { + if (strchr (operand, ',') != NULL + && (strchr (operand, ',') > strchr (operand, '('))) + cur_arg->type = arg_crp; + else + cur_arg->type = arg_cr; + } + else + cur_arg->type = arg_c; + +/* Parse an operand according to its type. */ + set_params: + cur_arg->constant = 0; + set_operand (operand, cr16_ins); +} + +/* Parse the various operands. Each operand is then analyzed to fillup + the fields in the cr16_ins data structure. */ + +static void +parse_operands (ins * cr16_ins, char *operands) +{ + char *operandS; /* Operands string. */ + char *operandH, *operandT; /* Single operand head/tail pointers. */ + int allocated = 0; /* Indicates a new operands string was allocated.*/ + char *operand[MAX_OPERANDS];/* Separating the operands. */ + int op_num = 0; /* Current operand number we are parsing. */ + int bracket_flag = 0; /* Indicates a bracket '(' was found. */ + int sq_bracket_flag = 0; /* Indicates a square bracket '[' was found. */ + + /* Preprocess the list of registers, if necessary. */ + operandS = operandH = operandT = operands; + + while (*operandT != '\0') + { + if (*operandT == ',' && bracket_flag != 1 && sq_bracket_flag != 1) + { + *operandT++ = '\0'; + operand[op_num++] = strdup (operandH); + operandH = operandT; + continue; + } + + if (*operandT == ' ') + as_bad (_("Illegal operands (whitespace): `%s'"), ins_parse); + + if (*operandT == '(') + bracket_flag = 1; + else if (*operandT == '[') + sq_bracket_flag = 1; + + if (*operandT == ')') + { + if (bracket_flag) + bracket_flag = 0; + else + as_fatal (_("Missing matching brackets : `%s'"), ins_parse); + } + else if (*operandT == ']') + { + if (sq_bracket_flag) + sq_bracket_flag = 0; + else + as_fatal (_("Missing matching brackets : `%s'"), ins_parse); + } + + if (bracket_flag == 1 && *operandT == ')') + bracket_flag = 0; + else if (sq_bracket_flag == 1 && *operandT == ']') + sq_bracket_flag = 0; + + operandT++; + } + + /* Adding the last operand. */ + operand[op_num++] = strdup (operandH); + cr16_ins->nargs = op_num; + + /* Verifying correct syntax of operands (all brackets should be closed). */ + if (bracket_flag || sq_bracket_flag) + as_fatal (_("Missing matching brackets : `%s'"), ins_parse); + + /* Now we parse each operand separately. */ + for (op_num = 0; op_num < cr16_ins->nargs; op_num++) + { + cur_arg_num = op_num; + parse_operand (operand[op_num], cr16_ins); + free (operand[op_num]); + } + + if (allocated) + free (operandS); +} + +/* Get the trap index in dispatch table, given its name. + This routine is used by assembling the 'excp' instruction. */ + +static int +gettrap (char *s) +{ + const trap_entry *trap; + + for (trap = cr16_traps; trap < (cr16_traps + NUMTRAPS); trap++) + if (strcasecmp (trap->name, s) == 0) + return trap->entry; + + /* To make compatable with CR16 4.1 tools, the below 3-lines of + * code added. Refer: Development Tracker item #123 */ + for (trap = cr16_traps; trap < (cr16_traps + NUMTRAPS); trap++) + if (trap->entry == (unsigned int) atoi (s)) + return trap->entry; + + as_bad (_("Unknown exception: `%s'"), s); + return 0; +} + +/* Top level module where instruction parsing starts. + cr16_ins - data structure holds some information. + operands - holds the operands part of the whole instruction. */ + +static void +parse_insn (ins *insn, char *operands) +{ + int i; + + /* Handle instructions with no operands. */ + for (i = 0; cr16_no_op_insn[i] != NULL; i++) + { + if (streq (cr16_no_op_insn[i], instruction->mnemonic)) + { + insn->nargs = 0; + return; + } + } + + /* Handle 'excp' instructions. */ + if (IS_INSN_MNEMONIC ("excp")) + { + insn->nargs = 1; + insn->arg[0].type = arg_ic; + insn->arg[0].constant = gettrap (operands); + insn->arg[0].X_op = O_constant; + return; + } + + if (operands != NULL) + parse_operands (insn, operands); +} + +/* bCC instruction requires special handling. */ +static char * +get_b_cc (char * op) +{ + unsigned int i; + char op1[5]; + + for (i = 1; i < strlen (op); i++) + op1[i-1] = op[i]; + + op1[i-1] = '\0'; + + for (i = 0; i < cr16_num_cc ; i++) + if (streq (op1, cr16_b_cond_tab[i])) + return (char *) cr16_b_cond_tab[i]; + + return NULL; +} + +/* bCC instruction requires special handling. */ +static int +is_bcc_insn (char * op) +{ + if (!(streq (op, "bal") || streq (op, "beq0b") || streq (op, "bnq0b") + || streq (op, "beq0w") || streq (op, "bnq0w"))) + if ((op[0] == 'b') && (get_b_cc (op) != NULL)) + return 1; + return 0; +} + +/* Cinv instruction requires special handling. */ + +static int +check_cinv_options (char * operand) +{ + char *p = operand; + int i_used = 0, u_used = 0, d_used = 0; + + while (*++p != ']') + { + if (*p == ',' || *p == ' ') + continue; + + else if (*p == 'i') + i_used = 1; + else if (*p == 'u') + u_used = 1; + else if (*p == 'd') + d_used = 1; + else + as_bad (_("Illegal `cinv' parameter: `%c'"), *p); + } + + return 0; +} + +/* Retrieve the opcode image of a given register pair. + If the register is illegal for the current instruction, + issue an error. */ + +static int +getregp_image (reg r) +{ + const reg_entry *reg; + char *reg_name; + + /* Check whether the register is in registers table. */ + if (r < MAX_REG) + reg = cr16_regptab + r; + /* Register not found. */ + else + { + as_bad (_("Unknown register pair: `%d'"), r); + return 0; + } + + reg_name = reg->name; + +/* Issue a error message when register pair is illegal. */ +#define RPAIR_IMAGE_ERR \ + as_bad (_("Illegal register pair (`%s') in Instruction: `%s'"), \ + reg_name, ins_parse); \ + break; + + switch (reg->type) + { + case CR16_RP_REGTYPE: + return reg->image; + default: + RPAIR_IMAGE_ERR; + } + + return 0; +} + +/* Retrieve the opcode image of a given index register pair. + If the register is illegal for the current instruction, + issue an error. */ + +static int +getidxregp_image (reg r) +{ + const reg_entry *reg; + char *reg_name; + + /* Check whether the register is in registers table. */ + if (r < MAX_REG) + reg = cr16_regptab + r; + /* Register not found. */ + else + { + as_bad (_("Unknown register pair: `%d'"), r); + return 0; + } + + reg_name = reg->name; + +/* Issue a error message when register pair is illegal. */ +#define IDX_RPAIR_IMAGE_ERR \ + as_bad (_("Illegal index register pair (`%s') in Instruction: `%s'"), \ + reg_name, ins_parse); \ + + if (reg->type == CR16_RP_REGTYPE) + { + switch (reg->image) + { + case 0: return 0; break; + case 2: return 1; break; + case 4: return 2; break; + case 6: return 3; break; + case 8: return 4; break; + case 10: return 5; break; + case 3: return 6; break; + case 5: return 7; break; + default: + break; + } + } + + IDX_RPAIR_IMAGE_ERR; + return 0; +} + +/* Retrieve the opcode image of a given processort register. + If the register is illegal for the current instruction, + issue an error. */ +static int +getprocreg_image (reg r) +{ + const reg_entry *reg; + char *reg_name; + + /* Check whether the register is in registers table. */ + if (r < MAX_PREG) + reg = &cr16_pregtab[r - MAX_REG]; + /* Register not found. */ + else + { + as_bad (_("Unknown processor register : `%d'"), r); + return 0; + } + + reg_name = reg->name; + +/* Issue a error message when register pair is illegal. */ +#define PROCREG_IMAGE_ERR \ + as_bad (_("Illegal processor register (`%s') in Instruction: `%s'"), \ + reg_name, ins_parse); \ + break; + + switch (reg->type) + { + case CR16_P_REGTYPE: + return reg->image; + default: + PROCREG_IMAGE_ERR; + } + + return 0; +} + +/* Retrieve the opcode image of a given processort register. + If the register is illegal for the current instruction, + issue an error. */ +static int +getprocregp_image (reg r) +{ + const reg_entry *reg; + char *reg_name; + int pregptab_disp = 0; + + /* Check whether the register is in registers table. */ + if (r < MAX_PREG) + { + r = r - MAX_REG; + switch (r) + { + case 4: pregptab_disp = 1; break; + case 6: pregptab_disp = 2; break; + case 8: + case 9: + case 10: + pregptab_disp = 3; break; + case 12: + pregptab_disp = 4; break; + case 14: + pregptab_disp = 5; break; + default: break; + } + reg = &cr16_pregptab[r - pregptab_disp]; + } + /* Register not found. */ + else + { + as_bad (_("Unknown processor register (32 bit) : `%d'"), r); + return 0; + } + + reg_name = reg->name; + +/* Issue a error message when register pair is illegal. */ +#define PROCREGP_IMAGE_ERR \ + as_bad (_("Illegal 32 bit - processor register (`%s') in Instruction: `%s'"),\ + reg_name, ins_parse); \ + break; + + switch (reg->type) + { + case CR16_P_REGTYPE: + return reg->image; + default: + PROCREGP_IMAGE_ERR; + } + + return 0; +} + +/* Routine used to represent integer X using NBITS bits. */ + +static long +getconstant (long x, int nbits) +{ + /* The following expression avoids overflow if + 'nbits' is the number of bits in 'bfd_vma'. */ + return (x & ((((1 << (nbits - 1)) - 1) << 1) | 1)); +} + +/* Print a constant value to 'output_opcode': + ARG holds the operand's type and value. + SHIFT represents the location of the operand to be print into. + NBITS determines the size (in bits) of the constant. */ + +static void +print_constant (int nbits, int shift, argument *arg) +{ + unsigned long mask = 0; + + long constant = getconstant (arg->constant, nbits); + + switch (nbits) + { + case 32: + case 28: + /* mask the upper part of the constant, that is, the bits + going to the lowest byte of output_opcode[0]. + The upper part of output_opcode[1] is always filled, + therefore it is always masked with 0xFFFF. */ + mask = (1 << (nbits - 16)) - 1; + /* Divide the constant between two consecutive words : + 0 1 2 3 + +---------+---------+---------+---------+ + | | X X X X | x X x X | | + +---------+---------+---------+---------+ + output_opcode[0] output_opcode[1] */ + + CR16_PRINT (0, (constant >> WORD_SHIFT) & mask, 0); + CR16_PRINT (1, (constant & 0xFFFF), WORD_SHIFT); + break; + + case 21: + if ((nbits == 21) && (IS_INSN_TYPE (LD_STOR_INS))) nbits = 20; + case 24: + case 22: + case 20: + /* mask the upper part of the constant, that is, the bits + going to the lowest byte of output_opcode[0]. + The upper part of output_opcode[1] is always filled, + therefore it is always masked with 0xFFFF. */ + mask = (1 << (nbits - 16)) - 1; + /* Divide the constant between two consecutive words : + 0 1 2 3 + +---------+---------+---------+---------+ + | | X X X X | - X - X | | + +---------+---------+---------+---------+ + output_opcode[0] output_opcode[1] */ + + if ((instruction->size > 2) && (shift == WORD_SHIFT)) + { + if (arg->type == arg_idxrp) + { + CR16_PRINT (0, ((constant >> WORD_SHIFT) & mask) << 8, 0); + CR16_PRINT (1, (constant & 0xFFFF), WORD_SHIFT); + } + else + { + CR16_PRINT (0, (((((constant >> WORD_SHIFT) & mask) << 8) & 0x0f00) | ((((constant >> WORD_SHIFT) & mask) >> 4) & 0xf)),0); + CR16_PRINT (1, (constant & 0xFFFF), WORD_SHIFT); + } + } + else + CR16_PRINT (0, constant, shift); + break; + + case 14: + if (arg->type == arg_idxrp) + { + if (instruction->size == 2) + { + CR16_PRINT (0, ((constant)&0xf), shift); // 0-3 bits + CR16_PRINT (0, ((constant>>4)&0x3), (shift+20)); // 4-5 bits + CR16_PRINT (0, ((constant>>6)&0x3), (shift+14)); // 6-7 bits + CR16_PRINT (0, ((constant>>8)&0x3f), (shift+8)); // 8-13 bits + } + else + CR16_PRINT (0, constant, shift); + } + break; + + case 16: + case 12: + /* When instruction size is 3 and 'shift' is 16, a 16-bit constant is + always filling the upper part of output_opcode[1]. If we mistakenly + write it to output_opcode[0], the constant prefix (that is, 'match') + will be overriden. + 0 1 2 3 + +---------+---------+---------+---------+ + | 'match' | | X X X X | | + +---------+---------+---------+---------+ + output_opcode[0] output_opcode[1] */ + + if ((instruction->size > 2) && (shift == WORD_SHIFT)) + CR16_PRINT (1, constant, WORD_SHIFT); + else + CR16_PRINT (0, constant, shift); + break; + + case 8: + CR16_PRINT (0, ((constant/2)&0xf), shift); + CR16_PRINT (0, ((constant/2)>>4), (shift+8)); + break; + + default: + CR16_PRINT (0, constant, shift); + break; + } +} + +/* Print an operand to 'output_opcode', which later on will be + printed to the object file: + ARG holds the operand's type, size and value. + SHIFT represents the printing location of operand. + NBITS determines the size (in bits) of a constant operand. */ + +static void +print_operand (int nbits, int shift, argument *arg) +{ + switch (arg->type) + { + case arg_cc: + CR16_PRINT (0, arg->cc, shift); + break; + + case arg_r: + CR16_PRINT (0, getreg_image (arg->r), shift); + break; + + case arg_rp: + CR16_PRINT (0, getregp_image (arg->rp), shift); + break; + + case arg_pr: + CR16_PRINT (0, getprocreg_image (arg->pr), shift); + break; + + case arg_prp: + CR16_PRINT (0, getprocregp_image (arg->prp), shift); + break; + + case arg_idxrp: + /* 16 12 8 6 0 + +-----------------------------+ + | r_index | disp | rp_base | + +-----------------------------+ */ + + if (instruction->size == 3) + { + CR16_PRINT (0, getidxregp_image (arg->rp), 0); + if (getreg_image (arg->i_r) == 12) + CR16_PRINT (0, 0, 3); + else + CR16_PRINT (0, 1, 3); + } + else + { + CR16_PRINT (0, getidxregp_image (arg->rp), 16); + if (getreg_image (arg->i_r) == 12) + CR16_PRINT (0, 0, 19); + else + CR16_PRINT (0, 1, 19); + } + print_constant (nbits, shift, arg); + break; + + case arg_idxr: + if (getreg_image (arg->i_r) == 12) + if (IS_INSN_MNEMONIC ("cbitb") || IS_INSN_MNEMONIC ("sbitb") + || IS_INSN_MNEMONIC ("tbitb")) + CR16_PRINT (0, 0, 23); + else CR16_PRINT (0, 0, 24); + else + if (IS_INSN_MNEMONIC ("cbitb") || IS_INSN_MNEMONIC ("sbitb") + || IS_INSN_MNEMONIC ("tbitb")) + CR16_PRINT (0, 1, 23); + else CR16_PRINT (0, 1, 24); + + print_constant (nbits, shift, arg); + break; + + case arg_ic: + case arg_c: + print_constant (nbits, shift, arg); + break; + + case arg_rbase: + CR16_PRINT (0, getreg_image (arg->r), shift); + break; + + case arg_cr: + print_constant (nbits, shift , arg); + /* Add the register argument to the output_opcode. */ + CR16_PRINT (0, getreg_image (arg->r), (shift+16)); + break; + + case arg_crp: + print_constant (nbits, shift , arg); + if (instruction->size > 1) + CR16_PRINT (0, getregp_image (arg->rp), (shift + 16)); + else if (IS_INSN_TYPE (LD_STOR_INS) || (IS_INSN_TYPE (CSTBIT_INS))) + { + if (instruction->size == 2) + CR16_PRINT (0, getregp_image (arg->rp), (shift - 8)); + else if (instruction->size == 1) + CR16_PRINT (0, getregp_image (arg->rp), 16); + } + else + CR16_PRINT (0, getregp_image (arg->rp), shift); + break; + + default: + break; + } +} + +/* Retrieve the number of operands for the current assembled instruction. */ + +static int +get_number_of_operands (void) +{ + int i; + + for (i = 0; instruction->operands[i].op_type && i < MAX_OPERANDS; i++) + ; + return i; +} + +/* Verify that the number NUM can be represented in BITS bits (that is, + within its permitted range), based on the instruction's FLAGS. + If UPDATE is nonzero, update the value of NUM if necessary. + Return OP_LEGAL upon success, actual error type upon failure. */ + +static op_err +check_range (long *num, int bits, int unsigned flags, int update) +{ + long min, max; + int retval = OP_LEGAL; + long value = *num; + + if (bits == 0 && value > 0) return OP_OUT_OF_RANGE; + + /* For hosts witah longs bigger than 32-bits make sure that the top + bits of a 32-bit negative value read in by the parser are set, + so that the correct comparisons are made. */ + if (value & 0x80000000) + value |= (-1L << 31); + + + /* Verify operand value is even. */ + if (flags & OP_EVEN) + { + if (value % 2) + return OP_NOT_EVEN; + } + + if (flags & OP_DEC) + { + value -= 1; + if (update) + *num = value; + } + + if (flags & OP_SHIFT) + { + value >>= 1; + if (update) + *num = value; + } + else if (flags & OP_SHIFT_DEC) + { + value = (value >> 1) - 1; + if (update) + *num = value; + } + + if (flags & OP_ABS20) + { + if (value > 0xEFFFF) + return OP_OUT_OF_RANGE; + } + + if (flags & OP_ESC) + { + if (value == 0xB || value == 0x9) + return OP_OUT_OF_RANGE; + else if (value == -1) + { + if (update) + *num = 9; + return retval; + } + } + + if (flags & OP_ESC1) + { + if (value > 13) + return OP_OUT_OF_RANGE; + } + + if (flags & OP_SIGNED) + { + max = (1 << (bits - 1)) - 1; + min = - (1 << (bits - 1)); + if ((value > max) || (value < min)) + retval = OP_OUT_OF_RANGE; + } + else if (flags & OP_UNSIGNED) + { + max = ((((1 << (bits - 1)) - 1) << 1) | 1); + min = 0; + if (((unsigned long) value > (unsigned long) max) + || ((unsigned long) value < (unsigned long) min)) + retval = OP_OUT_OF_RANGE; + } + else if (flags & OP_NEG) + { + max = - 1; + min = - ((1 << (bits - 1))-1); + if ((value > max) || (value < min)) + retval = OP_OUT_OF_RANGE; + } + return retval; +} + +/* Bunch of error checkings. + The checks are made after a matching instruction was found. */ + +static void +warn_if_needed (ins *insn) +{ + /* If the post-increment address mode is used and the load/store + source register is the same as rbase, the result of the + instruction is undefined. */ + if (IS_INSN_TYPE (LD_STOR_INS_INC)) + { + /* Enough to verify that one of the arguments is a simple reg. */ + if ((insn->arg[0].type == arg_r) || (insn->arg[1].type == arg_r)) + if (insn->arg[0].r == insn->arg[1].r) + as_bad (_("Same src/dest register is used (`r%d'), result is undefined"), insn->arg[0].r); + } + + if (IS_INSN_MNEMONIC ("pop") + || IS_INSN_MNEMONIC ("push") + || IS_INSN_MNEMONIC ("popret")) + { + unsigned int count = insn->arg[0].constant, reg_val; + + /* Check if count operand caused to save/retrive the RA twice + to generate warning message. */ + if (insn->nargs > 2) + { + reg_val = getreg_image (insn->arg[1].r); + + if ( ((reg_val == 9) && (count > 7)) + || ((reg_val == 10) && (count > 6)) + || ((reg_val == 11) && (count > 5)) + || ((reg_val == 12) && (count > 4)) + || ((reg_val == 13) && (count > 2)) + || ((reg_val == 14) && (count > 0))) + as_warn (_("RA register is saved twice.")); + + /* Check if the third operand is "RA" or "ra" */ + if (!(((insn->arg[2].r) == ra) || ((insn->arg[2].r) == RA))) + as_bad (_("`%s' Illegal use of registers."), ins_parse); + } + + if (insn->nargs > 1) + { + reg_val = getreg_image (insn->arg[1].r); + + /* If register is a register pair ie r12/r13/r14 in operand1, then + the count constant should be validated. */ + if (((reg_val == 11) && (count > 7)) + || ((reg_val == 12) && (count > 6)) + || ((reg_val == 13) && (count > 4)) + || ((reg_val == 14) && (count > 2)) + || ((reg_val == 15) && (count > 0))) + as_bad (_("`%s' Illegal count-register combination."), ins_parse); + } + else + { + /* Check if the operand is "RA" or "ra" */ + if (!(((insn->arg[0].r) == ra) || ((insn->arg[0].r) == RA))) + as_bad (_("`%s' Illegal use of register."), ins_parse); + } + } + + /* Some instruction assume the stack pointer as rptr operand. + Issue an error when the register to be loaded is also SP. */ + if (instruction->flags & NO_SP) + { + if (getreg_image (insn->arg[1].r) == getreg_image (sp)) + as_bad (_("`%s' has undefined result"), ins_parse); + } + + /* If the rptr register is specified as one of the registers to be loaded, + the final contents of rptr are undefined. Thus, we issue an error. */ + if (instruction->flags & NO_RPTR) + { + if ((1 << getreg_image (insn->arg[0].r)) & insn->arg[1].constant) + as_bad (_("Same src/dest register is used (`r%d'),result is undefined"), + getreg_image (insn->arg[0].r)); + } +} + +/* In some cases, we need to adjust the instruction pointer although a + match was already found. Here, we gather all these cases. + Returns 1 if instruction pointer was adjusted, otherwise 0. */ + +static int +adjust_if_needed (ins *insn ATTRIBUTE_UNUSED) +{ + int ret_value = 0; + + if ((IS_INSN_TYPE (CSTBIT_INS)) || (IS_INSN_TYPE (LD_STOR_INS))) + { + if ((instruction->operands[0].op_type == abs24) + && ((insn->arg[0].constant) > 0xF00000)) + { + insn->arg[0].constant &= 0xFFFFF; + instruction--; + ret_value = 1; + } + } + + return ret_value; +} + +/* Assemble a single instruction: + INSN is already parsed (that is, all operand values and types are set). + For instruction to be assembled, we need to find an appropriate template in + the instruction table, meeting the following conditions: + 1: Has the same number of operands. + 2: Has the same operand types. + 3: Each operand size is sufficient to represent the instruction's values. + Returns 1 upon success, 0 upon failure. */ + +static int +assemble_insn (char *mnemonic, ins *insn) +{ + /* Type of each operand in the current template. */ + argtype cur_type[MAX_OPERANDS]; + /* Size (in bits) of each operand in the current template. */ + unsigned int cur_size[MAX_OPERANDS]; + /* Flags of each operand in the current template. */ + unsigned int cur_flags[MAX_OPERANDS]; + /* Instruction type to match. */ + unsigned int ins_type; + /* Boolean flag to mark whether a match was found. */ + int match = 0; + int i; + /* Nonzero if an instruction with same number of operands was found. */ + int found_same_number_of_operands = 0; + /* Nonzero if an instruction with same argument types was found. */ + int found_same_argument_types = 0; + /* Nonzero if a constant was found within the required range. */ + int found_const_within_range = 0; + /* Argument number of an operand with invalid type. */ + int invalid_optype = -1; + /* Argument number of an operand with invalid constant value. */ + int invalid_const = -1; + /* Operand error (used for issuing various constant error messages). */ + op_err op_error, const_err = OP_LEGAL; + +/* Retrieve data (based on FUNC) for each operand of a given instruction. */ +#define GET_CURRENT_DATA(FUNC, ARRAY) \ + for (i = 0; i < insn->nargs; i++) \ + ARRAY[i] = FUNC (instruction->operands[i].op_type) + +#define GET_CURRENT_TYPE GET_CURRENT_DATA (get_optype, cur_type) +#define GET_CURRENT_SIZE GET_CURRENT_DATA (get_opbits, cur_size) +#define GET_CURRENT_FLAGS GET_CURRENT_DATA (get_opflags, cur_flags) + + /* Instruction has no operands -> only copy the constant opcode. */ + if (insn->nargs == 0) + { + output_opcode[0] = BIN (instruction->match, instruction->match_bits); + return 1; + } + + /* In some case, same mnemonic can appear with different instruction types. + For example, 'storb' is supported with 3 different types : + LD_STOR_INS, LD_STOR_INS_INC, STOR_IMM_INS. + We assume that when reaching this point, the instruction type was + pre-determined. We need to make sure that the type stays the same + during a search for matching instruction. */ + ins_type = CR16_INS_TYPE (instruction->flags); + + while (/* Check that match is still not found. */ + match != 1 + /* Check we didn't get to end of table. */ + && instruction->mnemonic != NULL + /* Check that the actual mnemonic is still available. */ + && IS_INSN_MNEMONIC (mnemonic) + /* Check that the instruction type wasn't changed. */ + && IS_INSN_TYPE (ins_type)) + { + /* Check whether number of arguments is legal. */ + if (get_number_of_operands () != insn->nargs) + goto next_insn; + found_same_number_of_operands = 1; + + /* Initialize arrays with data of each operand in current template. */ + GET_CURRENT_TYPE; + GET_CURRENT_SIZE; + GET_CURRENT_FLAGS; + + /* Check for type compatibility. */ + for (i = 0; i < insn->nargs; i++) + { + if (cur_type[i] != insn->arg[i].type) + { + if (invalid_optype == -1) + invalid_optype = i + 1; + goto next_insn; + } + } + found_same_argument_types = 1; + + for (i = 0; i < insn->nargs; i++) + { + /* If 'bal' instruction size is '2' and reg operand is not 'ra' + then goto next instruction. */ + if (IS_INSN_MNEMONIC ("bal") && (i == 0) + && (instruction->size == 2) && (insn->arg[i].rp != 14)) + goto next_insn; + + /* If 'storb' instruction with 'sp' reg and 16-bit disp of + * reg-pair, leads to undifined trap, so this should use + * 20-bit disp of reg-pair. */ + if (IS_INSN_MNEMONIC ("storb") && (instruction->size == 2) + && (insn->arg[i].r == 15) && (insn->arg[i + 1].type == arg_crp)) + goto next_insn; + + /* Only check range - don't update the constant's value, since the + current instruction may not be the last we try to match. + The constant's value will be updated later, right before printing + it to the object file. */ + if ((insn->arg[i].X_op == O_constant) + && (op_error = check_range (&insn->arg[i].constant, cur_size[i], + cur_flags[i], 0))) + { + if (invalid_const == -1) + { + invalid_const = i + 1; + const_err = op_error; + } + goto next_insn; + } + /* For symbols, we make sure the relocation size (which was already + determined) is sufficient. */ + else if ((insn->arg[i].X_op == O_symbol) + && ((bfd_reloc_type_lookup (stdoutput, insn->rtype))->bitsize + > cur_size[i])) + goto next_insn; + } + found_const_within_range = 1; + + /* If we got till here -> Full match is found. */ + match = 1; + break; + +/* Try again with next instruction. */ +next_insn: + instruction++; + } + + if (!match) + { + /* We haven't found a match - instruction can't be assembled. */ + if (!found_same_number_of_operands) + as_bad (_("Incorrect number of operands")); + else if (!found_same_argument_types) + as_bad (_("Illegal type of operand (arg %d)"), invalid_optype); + else if (!found_const_within_range) + { + switch (const_err) + { + case OP_OUT_OF_RANGE: + as_bad (_("Operand out of range (arg %d)"), invalid_const); + break; + case OP_NOT_EVEN: + as_bad (_("Operand has odd displacement (arg %d)"), invalid_const); + break; + default: + as_bad (_("Illegal operand (arg %d)"), invalid_const); + break; + } + } + + return 0; + } + else + /* Full match - print the encoding to output file. */ + { + /* Make further checkings (such that couldn't be made earlier). + Warn the user if necessary. */ + warn_if_needed (insn); + + /* Check whether we need to adjust the instruction pointer. */ + if (adjust_if_needed (insn)) + /* If instruction pointer was adjusted, we need to update + the size of the current template operands. */ + GET_CURRENT_SIZE; + + for (i = 0; i < insn->nargs; i++) + { + int j = instruction->flags & REVERSE_MATCH ? + i == 0 ? 1 : + i == 1 ? 0 : i : + i; + + /* This time, update constant value before printing it. */ + if ((insn->arg[j].X_op == O_constant) + && (check_range (&insn->arg[j].constant, cur_size[j], + cur_flags[j], 1) != OP_LEGAL)) + as_fatal (_("Illegal operand (arg %d)"), j+1); + } + + /* First, copy the instruction's opcode. */ + output_opcode[0] = BIN (instruction->match, instruction->match_bits); + + for (i = 0; i < insn->nargs; i++) + { + /* For BAL (ra),disp17 instuction only. And also set the + DISP24a relocation type. */ + if (IS_INSN_MNEMONIC ("bal") && (instruction->size == 2) && i == 0) + { + insn->rtype = BFD_RELOC_CR16_DISP24a; + continue; + } + cur_arg_num = i; + print_operand (cur_size[i], instruction->operands[i].shift, + &insn->arg[i]); + } + } + + return 1; +} + +/* Print the instruction. + Handle also cases where the instruction is relaxable/relocatable. */ + +static void +print_insn (ins *insn) +{ + unsigned int i, j, insn_size; + char *this_frag; + unsigned short words[4]; + int addr_mod; + + /* Arrange the insn encodings in a WORD size array. */ + for (i = 0, j = 0; i < 2; i++) + { + words[j++] = (output_opcode[i] >> 16) & 0xFFFF; + words[j++] = output_opcode[i] & 0xFFFF; + } + + insn_size = instruction->size; + this_frag = frag_more (insn_size * 2); + + /* Handle relocation. */ + if ((relocatable) && (insn->rtype != BFD_RELOC_NONE)) + { + reloc_howto_type *reloc_howto; + int size; + + reloc_howto = bfd_reloc_type_lookup (stdoutput, insn->rtype); + + if (!reloc_howto) + abort (); + + size = bfd_get_reloc_size (reloc_howto); + + if (size < 1 || size > 4) + abort (); + + fix_new_exp (frag_now, this_frag - frag_now->fr_literal, + size, &insn->exp, reloc_howto->pc_relative, + insn->rtype); + } + + /* Verify a 2-byte code alignment. */ + addr_mod = frag_now_fix () & 1; + if (frag_now->has_code && frag_now->insn_addr != addr_mod) + as_bad (_("instruction address is not a multiple of 2")); + frag_now->insn_addr = addr_mod; + frag_now->has_code = 1; + + /* Write the instruction encoding to frag. */ + for (i = 0; i < insn_size; i++) + { + md_number_to_chars (this_frag, (valueT) words[i], 2); + this_frag += 2; + } +} + +/* This is the guts of the machine-dependent assembler. OP points to a + machine dependent instruction. This function is supposed to emit + the frags/bytes it assembles to. */ + +void +md_assemble (char *op) +{ + ins cr16_ins; + char *param, param1[32]; + char c; + + /* Reset global variables for a new instruction. */ + reset_vars (op); + + /* Strip the mnemonic. */ + for (param = op; *param != 0 && !ISSPACE (*param); param++) + ; + c = *param; + *param++ = '\0'; + + /* bCC instuctions and adjust the mnemonic by adding extra white spaces. */ + if (is_bcc_insn (op)) + { + strcpy (param1, get_b_cc (op)); + op = "b"; + strcat (param1,","); + strcat (param1, param); + param = (char *) ¶m1; + } + + /* Checking the cinv options and adjust the mnemonic by removing the + extra white spaces. */ + if (streq ("cinv", op)) + { + /* Validate the cinv options. */ + check_cinv_options (param); + strcat (op, param); + } + + /* MAPPING - SHIFT INSN, if imm4/imm16 positive values + lsh[b/w] imm4/imm6, reg ==> ashu[b/w] imm4/imm16, reg + as CR16 core doesn't support lsh[b/w] right shift operaions. */ + if ((streq ("lshb", op) || streq ("lshw", op) || streq ("lshd", op)) + && (param [0] == '$')) + { + strcpy (param1, param); + /* Find the instruction. */ + instruction = (const inst *) hash_find (cr16_inst_hash, op); + parse_operands (&cr16_ins, param1); + if (((&cr16_ins)->arg[0].type == arg_ic) + && ((&cr16_ins)->arg[0].constant >= 0)) + { + if (streq ("lshb", op)) + op = "ashub"; + else if (streq ("lshd", op)) + op = "ashud"; + else + op = "ashuw"; + } + } + + /* Find the instruction. */ + instruction = (const inst *) hash_find (cr16_inst_hash, op); + if (instruction == NULL) + { + as_bad (_("Unknown opcode: `%s'"), op); + return; + } + + /* Tie dwarf2 debug info to the address at the start of the insn. */ + dwarf2_emit_insn (0); + + /* Parse the instruction's operands. */ + parse_insn (&cr16_ins, param); + + /* Assemble the instruction - return upon failure. */ + if (assemble_insn (op, &cr16_ins) == 0) + return; + + /* Print the instruction. */ + print_insn (&cr16_ins); +} diff --git a/gas/config/tc-cr16.h b/gas/config/tc-cr16.h new file mode 100644 index 00000000000..6d06151eb16 --- /dev/null +++ b/gas/config/tc-cr16.h @@ -0,0 +1,73 @@ +/* tc-cr16.h -- Header file for tc-cr16.c, the CR16 GAS port. + Copyright 2007 Free Software Foundation, Inc. + + Contributed by M R Swami Reddy + + This file is part of GAS, the GNU Assembler. + + GAS 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 2, or (at your option) + any later version. + + GAS 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 GAS; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef TC_CR16_H +#define TC_CR16_H + +#define TC_CR16 1 + +#define TARGET_BYTES_BIG_ENDIAN 0 + +#define TARGET_FORMAT "elf32-cr16" +#define TARGET_ARCH bfd_arch_cr16 + +#define WORKING_DOT_WORD +#define LOCAL_LABEL_PREFIX '.' + +#define md_undefined_symbol(s) 0 +#define md_number_to_chars number_to_chars_littleendian + +/* We do relaxing in the assembler as well as the linker. */ +extern const struct relax_type md_relax_table[]; +#define TC_GENERIC_RELAX_TABLE md_relax_table + +/* We do not want to adjust any relocations to make implementation of + linker relaxations easier. */ +#define tc_fix_adjustable(fixP) 0 + +/* We need to force out some relocations when relaxing. */ +#define TC_FORCE_RELOCATION(FIXP) cr16_force_relocation (FIXP) +extern int cr16_force_relocation (struct fix *); + +/* Fixup debug sections since we will never relax them. */ +#define TC_LINKRELAX_FIXUP(seg) (seg->flags & SEC_ALLOC) + +/* CR16 instructions, with operands included, are a multiple + of two bytes long. */ +#define DWARF2_LINE_MIN_INSN_LENGTH 2 + +extern void cr16_cons_fix_new (struct frag *, int, int, struct expressionS *); +/* This is called by emit_expr when creating a reloc for a cons. + We could use the definition there, except that we want to handle + the CR16 reloc type specially, rather than the BFD_RELOC type. */ +#define TC_CONS_FIX_NEW(FRAG, OFF, LEN, EXP) \ + cr16_cons_fix_new (FRAG, OFF, LEN, EXP) + +/* Give an error if a frag containing code is not aligned to a 2-byte + boundary. */ +#define md_frag_check(FRAGP) \ + if ((FRAGP)->has_code \ + && (((FRAGP)->fr_address + (FRAGP)->insn_addr) & 1) != 0) \ + as_bad_where ((FRAGP)->fr_file, (FRAGP)->fr_line, \ + _("instruction address is not a multiple of 2")); + +#endif /* TC_CR16_H */ diff --git a/gas/config/tc-cris.c b/gas/config/tc-cris.c index 1c8e6dc6452..83e01c58954 100644 --- a/gas/config/tc-cris.c +++ b/gas/config/tc-cris.c @@ -1,5 +1,6 @@ /* tc-cris.c -- Assembler code for the CRIS CPU core. - Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003, 2004, 2006 + Free Software Foundation, Inc. Contributed by Axis Communications AB, Lund, Sweden. Originally written for GAS 1.38.1 by Mikael Asker. @@ -22,7 +23,6 @@ Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "as.h" #include "safe-ctype.h" #include "subsegs.h" @@ -991,7 +991,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED, break; case ENCODE_RELAX (STATE_MUL, STATE_BYTE): - /* This is the only time we check position and aligmnent of the + /* This is the only time we check position and alignment of the placement-tracking frag. */ if (sec->alignment_power < 2) as_bad_where (fragP->fr_file, fragP->fr_line, diff --git a/gas/config/tc-cris.h b/gas/config/tc-cris.h index 34e6ef8153c..59bbc071637 100644 --- a/gas/config/tc-cris.h +++ b/gas/config/tc-cris.h @@ -1,5 +1,5 @@ /* tc-cris.h -- Header file for tc-cris.c, the CRIS GAS port. - Copyright 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Axis Communications AB, Lund, Sweden. @@ -99,10 +99,9 @@ extern int md_cris_force_relocation (struct fix *); || (RTYPE) == BFD_RELOC_CRIS_32_PLT_PCREL) /* Make sure we don't resolve fixups for which we want to emit dynamic - relocations. FIXME: Set fx_plt instead of using IS_CRIS_PIC_RELOC. */ + relocations. */ #define TC_FORCE_RELOCATION_LOCAL(FIX) \ (!(FIX)->fx_pcrel \ - || (FIX)->fx_plt \ || IS_CRIS_PIC_RELOC ((FIX)->fx_r_type) \ || TC_FORCE_RELOCATION (FIX)) diff --git a/gas/config/tc-crx.c b/gas/config/tc-crx.c index 34448cd8dca..961776f9e3a 100644 --- a/gas/config/tc-crx.c +++ b/gas/config/tc-crx.c @@ -1271,7 +1271,7 @@ print_constant (int nbits, int shift, argument *arg) /* When instruction size is 3 and 'shift' is 16, a 16-bit constant is always filling the upper part of output_opcode[1]. If we mistakenly write it to output_opcode[0], the constant prefix (that is, 'match') - will be overriden. + will be overridden. 0 1 2 3 +---------+---------+---------+---------+ | 'match' | | X X X X | | diff --git a/gas/config/tc-d10v.c b/gas/config/tc-d10v.c index 6c94edbb4ef..245162a50d9 100644 --- a/gas/config/tc-d10v.c +++ b/gas/config/tc-d10v.c @@ -1,5 +1,5 @@ /* tc-d10v.c -- Assembler code for the Mitsubishi D10V - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -19,7 +19,6 @@ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "as.h" #include "safe-ctype.h" #include "subsegs.h" @@ -1441,7 +1440,6 @@ do_assemble (char *str, struct d10v_opcode **opcode) char name[20]; int nlen = 0; expressionS myops[6]; - unsigned long insn; /* Drop leading whitespace. */ while (*str == ' ') @@ -1463,7 +1461,7 @@ do_assemble (char *str, struct d10v_opcode **opcode) /* Find the first opcode with the proper name. */ *opcode = (struct d10v_opcode *) hash_find (d10v_hash, name); if (*opcode == NULL) - as_fatal (_("unknown opcode: %s"), name); + return -1; save = input_line_pointer; input_line_pointer = (char *) op_end; @@ -1472,8 +1470,7 @@ do_assemble (char *str, struct d10v_opcode **opcode) return -1; input_line_pointer = save; - insn = build_insn ((*opcode), myops, 0); - return insn; + return build_insn ((*opcode), myops, 0); } /* If while processing a fixup, a reloc really needs to be created. @@ -1779,7 +1776,7 @@ md_assemble (char *str) prev_seg = now_seg; prev_subseg = now_subseg; if (prev_insn == (unsigned long) -1) - as_fatal (_("can't find opcode ")); + as_fatal (_("can't find previous opcode ")); fixups = fixups->next; str = str2 + 2; } @@ -1789,11 +1786,10 @@ md_assemble (char *str) if (insn == (unsigned long) -1) { if (extype != PACK_UNSPEC) - { - etype = extype; - return; - } - as_fatal (_("can't find opcode ")); + etype = extype; + else + as_bad (_("could not assemble: %s"), str); + return; } if (etype != PACK_UNSPEC) diff --git a/gas/config/tc-d30v.c b/gas/config/tc-d30v.c index 848ad0341f0..fb7776a3953 100644 --- a/gas/config/tc-d30v.c +++ b/gas/config/tc-d30v.c @@ -1,5 +1,5 @@ /* tc-d30v.c -- Assembler code for the Mitsubishi D30V - Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -19,7 +19,6 @@ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "as.h" #include "safe-ctype.h" #include "subsegs.h" diff --git a/gas/config/tc-dlx.h b/gas/config/tc-dlx.h index 309f0373816..2cf3d8163a3 100644 --- a/gas/config/tc-dlx.h +++ b/gas/config/tc-dlx.h @@ -1,5 +1,5 @@ /* tc-dlx.h -- Assemble for the DLX - Copyright 2002, 2003, 2005 Free Software Foundation, Inc. + Copyright 2002, 2003, 2005, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -22,10 +22,6 @@ #define TC_DLX -#ifndef __BFD_H_SEEN__ -#include "bfd.h" -#endif - /* The target BFD architecture. */ #define TARGET_ARCH bfd_arch_dlx #define TARGET_FORMAT "elf32-dlx" @@ -48,10 +44,6 @@ extern bfd_boolean md_dlx_fix_adjustable (struct fix *); #define tc_unrecognized_line(c) dlx_unrecognized_line (c) -#define tc_coff_symbol_emit_hook(a) ; /* Not used. */ - -#define COFF_MAGIC DLXMAGIC - /* No shared lib support, so we don't need to ensure externally visible symbols can be overridden. */ #define EXTERN_FORCE_RELOC 0 diff --git a/gas/config/tc-fr30.c b/gas/config/tc-fr30.c index b0f2204c7f0..b7004c01755 100644 --- a/gas/config/tc-fr30.c +++ b/gas/config/tc-fr30.c @@ -1,5 +1,5 @@ /* tc-fr30.c -- Assembler for the Fujitsu FR30. - Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2005 + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -19,7 +19,6 @@ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "as.h" #include "safe-ctype.h" #include "subsegs.h" diff --git a/gas/config/tc-frv.c b/gas/config/tc-frv.c index a2f4ccef4a6..77787719bcd 100644 --- a/gas/config/tc-frv.c +++ b/gas/config/tc-frv.c @@ -18,7 +18,6 @@ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "as.h" #include "subsegs.h" #include "symcat.h" diff --git a/gas/config/tc-h8300.c b/gas/config/tc-h8300.c index 7db600c72bb..bfea9920762 100644 --- a/gas/config/tc-h8300.c +++ b/gas/config/tc-h8300.c @@ -1,6 +1,6 @@ /* tc-h8300.c -- Assemble code for the Renesas H8/300 Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, - 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -21,10 +21,8 @@ /* Written By Steve Chamberlain . */ -#include #include "as.h" #include "subsegs.h" -#include "bfd.h" #include "dwarf2dbg.h" #define DEFINE_TABLE @@ -1391,7 +1389,7 @@ build_bytes (const struct h8_instruction *this_try, struct h8_op *operand) { int i; char *output = frag_more (this_try->length); - op_type *nibble_ptr = this_try->opcode->data.nib; + const op_type *nibble_ptr = this_try->opcode->data.nib; op_type c; unsigned int nibble_count = 0; int op_at[3]; diff --git a/gas/config/tc-h8300.h b/gas/config/tc-h8300.h index bfc8f724c54..7191181e5c0 100644 --- a/gas/config/tc-h8300.h +++ b/gas/config/tc-h8300.h @@ -86,3 +86,6 @@ extern int Nmode; extern int SXmode; #define md_operand(x) + +/* This target is buggy, and sets fix size too large. */ +#define TC_FX_SIZE_SLACK(FIX) 1 diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c index 8ae5a57e903..71968c0383d 100644 --- a/gas/config/tc-hppa.c +++ b/gas/config/tc-hppa.c @@ -1,6 +1,6 @@ /* tc-hppa.c -- Assemble for the PA Copyright 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -22,11 +22,10 @@ /* HP PA-RISC support was contributed by the Center for Software Science at the University of Utah. */ -#include - #include "as.h" #include "safe-ctype.h" #include "subsegs.h" +#include "dw2gencfi.h" #include "bfd/libhppa.h" @@ -490,112 +489,42 @@ struct selector_entry /* Prototypes for functions local to tc-hppa.c. */ #ifdef OBJ_SOM -static void pa_check_current_space_and_subspace PARAMS ((void)); +static void pa_check_current_space_and_subspace (void); #endif #if !(defined (OBJ_ELF) && (defined (TE_LINUX) || defined (TE_NetBSD))) -static void pa_text PARAMS ((int)); -static void pa_data PARAMS ((int)); -static void pa_comm PARAMS ((int)); +static void pa_text (int); +static void pa_data (int); +static void pa_comm (int); #endif -static fp_operand_format pa_parse_fp_format PARAMS ((char **s)); -static void pa_cons PARAMS ((int)); -static void pa_float_cons PARAMS ((int)); -static void pa_fill PARAMS ((int)); -static void pa_lcomm PARAMS ((int)); -static void pa_lsym PARAMS ((int)); -static void pa_stringer PARAMS ((int)); -static void pa_version PARAMS ((int)); -static int pa_parse_fp_cmp_cond PARAMS ((char **)); -static int get_expression PARAMS ((char *)); -static int pa_get_absolute_expression PARAMS ((struct pa_it *, char **)); -static int evaluate_absolute PARAMS ((struct pa_it *)); -static unsigned int pa_build_arg_reloc PARAMS ((char *)); -static unsigned int pa_align_arg_reloc PARAMS ((unsigned int, unsigned int)); -static int pa_parse_nullif PARAMS ((char **)); -static int pa_parse_nonneg_cmpsub_cmpltr PARAMS ((char **)); -static int pa_parse_neg_cmpsub_cmpltr PARAMS ((char **)); -static int pa_parse_neg_add_cmpltr PARAMS ((char **)); -static int pa_parse_nonneg_add_cmpltr PARAMS ((char **)); -static int pa_parse_cmpb_64_cmpltr PARAMS ((char **)); -static int pa_parse_cmpib_64_cmpltr PARAMS ((char **)); -static int pa_parse_addb_64_cmpltr PARAMS ((char **)); -static void pa_block PARAMS ((int)); -static void pa_brtab PARAMS ((int)); -static void pa_try PARAMS ((int)); -static void pa_call PARAMS ((int)); -static void pa_call_args PARAMS ((struct call_desc *)); -static void pa_callinfo PARAMS ((int)); -static void pa_copyright PARAMS ((int)); -static void pa_end PARAMS ((int)); -static void pa_enter PARAMS ((int)); -static void pa_entry PARAMS ((int)); -static void pa_equ PARAMS ((int)); -static void pa_exit PARAMS ((int)); -static void pa_export PARAMS ((int)); -static void pa_type_args PARAMS ((symbolS *, int)); -static void pa_import PARAMS ((int)); -static void pa_label PARAMS ((int)); -static void pa_leave PARAMS ((int)); -static void pa_level PARAMS ((int)); -static void pa_origin PARAMS ((int)); -static void pa_proc PARAMS ((int)); -static void pa_procend PARAMS ((int)); -static void pa_param PARAMS ((int)); -static void pa_undefine_label PARAMS ((void)); -static int need_pa11_opcode PARAMS ((void)); -static int pa_parse_number PARAMS ((char **, int)); -static label_symbol_struct *pa_get_label PARAMS ((void)); #ifdef OBJ_SOM -static int exact_log2 PARAMS ((int)); -static void pa_compiler PARAMS ((int)); -static void pa_align PARAMS ((int)); -static void pa_space PARAMS ((int)); -static void pa_spnum PARAMS ((int)); -static void pa_subspace PARAMS ((int)); -static sd_chain_struct *create_new_space PARAMS ((char *, int, int, +static int exact_log2 (int); +static void pa_compiler (int); +static void pa_align (int); +static void pa_space (int); +static void pa_spnum (int); +static void pa_subspace (int); +static sd_chain_struct *create_new_space (char *, int, int, int, int, int, - asection *, int)); -static ssd_chain_struct *create_new_subspace PARAMS ((sd_chain_struct *, + asection *, int); +static ssd_chain_struct *create_new_subspace (sd_chain_struct *, char *, int, int, int, int, int, int, int, int, int, int, - int, asection *)); -static ssd_chain_struct *update_subspace PARAMS ((sd_chain_struct *, + int, asection *); +static ssd_chain_struct *update_subspace (sd_chain_struct *, char *, int, int, int, int, int, int, int, int, int, int, int, - asection *)); -static sd_chain_struct *is_defined_space PARAMS ((char *)); -static ssd_chain_struct *is_defined_subspace PARAMS ((char *)); -static sd_chain_struct *pa_segment_to_space PARAMS ((asection *)); -static ssd_chain_struct *pa_subsegment_to_subspace PARAMS ((asection *, - subsegT)); -static sd_chain_struct *pa_find_space_by_number PARAMS ((int)); -static unsigned int pa_subspace_start PARAMS ((sd_chain_struct *, int)); -static sd_chain_struct *pa_parse_space_stmt PARAMS ((char *, int)); -static void pa_spaces_begin PARAMS ((void)); -#endif -static void pa_ip PARAMS ((char *)); -static void fix_new_hppa PARAMS ((fragS *, int, int, symbolS *, - offsetT, expressionS *, int, - bfd_reloc_code_real_type, - enum hppa_reloc_field_selector_type_alt, - int, unsigned int, int)); -static int is_end_of_statement PARAMS ((void)); -static int reg_name_search PARAMS ((char *)); -static int pa_chk_field_selector PARAMS ((char **)); -static int is_same_frag PARAMS ((fragS *, fragS *)); -static void process_exit PARAMS ((void)); -static unsigned int pa_stringer_aux PARAMS ((char *)); -static fp_operand_format pa_parse_fp_cnv_format PARAMS ((char **s)); -static int pa_parse_ftest_gfx_completer PARAMS ((char **)); - -#ifdef OBJ_ELF -static void hppa_elf_mark_end_of_function PARAMS ((void)); -static void pa_build_unwind_subspace PARAMS ((struct call_info *)); -static void pa_vtable_entry PARAMS ((int)); -static void pa_vtable_inherit PARAMS ((int)); + asection *); +static sd_chain_struct *is_defined_space (char *); +static ssd_chain_struct *is_defined_subspace (char *); +static sd_chain_struct *pa_segment_to_space (asection *); +static ssd_chain_struct *pa_subsegment_to_subspace (asection *, + subsegT); +static sd_chain_struct *pa_find_space_by_number (int); +static unsigned int pa_subspace_start (sd_chain_struct *, int); +static sd_chain_struct *pa_parse_space_stmt (char *, int); #endif /* File and globally scoped variable declarations. */ @@ -629,96 +558,6 @@ static struct hash_control *op_hash = NULL; as they never appear followed by meaningful whitespace. */ const char hppa_symbol_chars[] = "*?=<>"; -/* Table of pseudo ops for the PA. FIXME -- how many of these - are now redundant with the overall GAS and the object file - dependent tables? */ -const pseudo_typeS md_pseudo_table[] = -{ - /* align pseudo-ops on the PA specify the actual alignment requested, - not the log2 of the requested alignment. */ -#ifdef OBJ_SOM - {"align", pa_align, 8}, -#endif -#ifdef OBJ_ELF - {"align", s_align_bytes, 8}, -#endif - {"begin_brtab", pa_brtab, 1}, - {"begin_try", pa_try, 1}, - {"block", pa_block, 1}, - {"blockz", pa_block, 0}, - {"byte", pa_cons, 1}, - {"call", pa_call, 0}, - {"callinfo", pa_callinfo, 0}, -#if defined (OBJ_ELF) && (defined (TE_LINUX) || defined (TE_NetBSD)) - {"code", obj_elf_text, 0}, -#else - {"code", pa_text, 0}, - {"comm", pa_comm, 0}, -#endif -#ifdef OBJ_SOM - {"compiler", pa_compiler, 0}, -#endif - {"copyright", pa_copyright, 0}, -#if !(defined (OBJ_ELF) && (defined (TE_LINUX) || defined (TE_NetBSD))) - {"data", pa_data, 0}, -#endif - {"double", pa_float_cons, 'd'}, - {"dword", pa_cons, 8}, - {"end", pa_end, 0}, - {"end_brtab", pa_brtab, 0}, -#if !(defined (OBJ_ELF) && (defined (TE_LINUX) || defined (TE_NetBSD))) - {"end_try", pa_try, 0}, -#endif - {"enter", pa_enter, 0}, - {"entry", pa_entry, 0}, - {"equ", pa_equ, 0}, - {"exit", pa_exit, 0}, - {"export", pa_export, 0}, - {"fill", pa_fill, 0}, - {"float", pa_float_cons, 'f'}, - {"half", pa_cons, 2}, - {"import", pa_import, 0}, - {"int", pa_cons, 4}, - {"label", pa_label, 0}, - {"lcomm", pa_lcomm, 0}, - {"leave", pa_leave, 0}, - {"level", pa_level, 0}, - {"long", pa_cons, 4}, - {"lsym", pa_lsym, 0}, -#ifdef OBJ_SOM - {"nsubspa", pa_subspace, 1}, -#endif - {"octa", pa_cons, 16}, - {"org", pa_origin, 0}, - {"origin", pa_origin, 0}, - {"param", pa_param, 0}, - {"proc", pa_proc, 0}, - {"procend", pa_procend, 0}, - {"quad", pa_cons, 8}, - {"reg", pa_equ, 1}, - {"short", pa_cons, 2}, - {"single", pa_float_cons, 'f'}, -#ifdef OBJ_SOM - {"space", pa_space, 0}, - {"spnum", pa_spnum, 0}, -#endif - {"string", pa_stringer, 0}, - {"stringz", pa_stringer, 1}, -#ifdef OBJ_SOM - {"subspa", pa_subspace, 0}, -#endif -#if !(defined (OBJ_ELF) && (defined (TE_LINUX) || defined (TE_NetBSD))) - {"text", pa_text, 0}, -#endif - {"version", pa_version, 0}, -#ifdef OBJ_ELF - {"vtable_entry", pa_vtable_entry, 0}, - {"vtable_inherit", pa_vtable_inherit, 0}, -#endif - {"word", pa_cons, 4}, - {NULL, 0, 0} -}; - /* This array holds the chars that only start a comment at the beginning of a line. If the line seems to have the form '# 123 filename' .line and .file directives will appear in the pre-processed output. @@ -1215,6 +1054,26 @@ static struct default_space_dict pa_def_spaces[] = ((exp).X_op == O_subtract \ && strcmp (S_GET_NAME ((exp).X_op_symbol), "$PIC_pcrel$0") == 0) +#define is_tls_gdidx(exp) \ + ((exp).X_op == O_subtract \ + && strcmp (S_GET_NAME ((exp).X_op_symbol), "$tls_gdidx$") == 0) + +#define is_tls_ldidx(exp) \ + ((exp).X_op == O_subtract \ + && strcmp (S_GET_NAME ((exp).X_op_symbol), "$tls_ldidx$") == 0) + +#define is_tls_dtpoff(exp) \ + ((exp).X_op == O_subtract \ + && strcmp (S_GET_NAME ((exp).X_op_symbol), "$tls_dtpoff$") == 0) + +#define is_tls_ieoff(exp) \ + ((exp).X_op == O_subtract \ + && strcmp (S_GET_NAME ((exp).X_op_symbol), "$tls_ieoff$") == 0) + +#define is_tls_leoff(exp) \ + ((exp).X_op == O_subtract \ + && strcmp (S_GET_NAME ((exp).X_op_symbol), "$tls_leoff$") == 0) + /* We need some complex handling for stabs (sym1 - sym2). Luckily, we'll always be able to reduce the expression to a constant, so we don't need real complex handling yet. */ @@ -1227,7 +1086,7 @@ static struct default_space_dict pa_def_spaces[] = proc/procend pairs match. */ void -pa_check_eof () +pa_check_eof (void) { if (within_entry_exit) as_fatal (_("Missing .exit\n")); @@ -1240,7 +1099,7 @@ pa_check_eof () or NULL if no label_symbol_struct exists for the current space. */ static label_symbol_struct * -pa_get_label () +pa_get_label (void) { label_symbol_struct *label_chain; @@ -1265,8 +1124,7 @@ pa_get_label () this function will replace it with the new label. */ void -pa_define_label (symbol) - symbolS *symbol; +pa_define_label (symbolS *symbol) { label_symbol_struct *label_chain = pa_get_label (); @@ -1275,8 +1133,7 @@ pa_define_label (symbol) else { /* Create a new label entry and add it to the head of the chain. */ - label_chain - = (label_symbol_struct *) xmalloc (sizeof (label_symbol_struct)); + label_chain = xmalloc (sizeof (label_symbol_struct)); label_chain->lss_label = symbol; #ifdef OBJ_SOM label_chain->lss_space = current_space; @@ -1301,7 +1158,7 @@ pa_define_label (symbol) If there is no label_symbol_struct entry, then no action is taken. */ static void -pa_undefine_label () +pa_undefine_label (void) { label_symbol_struct *label_chain; label_symbol_struct *prev_label_chain = NULL; @@ -1340,25 +1197,21 @@ pa_undefine_label () tc_fix_data field. */ static void -fix_new_hppa (frag, where, size, add_symbol, offset, exp, pcrel, - r_type, r_field, r_format, arg_reloc, unwind_bits) - fragS *frag; - int where; - int size; - symbolS *add_symbol; - offsetT offset; - expressionS *exp; - int pcrel; - bfd_reloc_code_real_type r_type; - enum hppa_reloc_field_selector_type_alt r_field; - int r_format; - unsigned int arg_reloc; - int unwind_bits ATTRIBUTE_UNUSED; +fix_new_hppa (fragS *frag, + int where, + int size, + symbolS *add_symbol, + offsetT offset, + expressionS *exp, + int pcrel, + bfd_reloc_code_real_type r_type, + enum hppa_reloc_field_selector_type_alt r_field, + int r_format, + unsigned int arg_reloc, + int unwind_bits ATTRIBUTE_UNUSED) { fixS *new_fix; - - struct hppa_fix_struct *hppa_fix = (struct hppa_fix_struct *) - obstack_alloc (¬es, sizeof (struct hppa_fix_struct)); + struct hppa_fix_struct *hppa_fix = obstack_alloc (¬es, sizeof (struct hppa_fix_struct)); if (exp != NULL) new_fix = fix_new_exp (frag, where, size, exp, pcrel, r_type); @@ -1380,30 +1233,20 @@ fix_new_hppa (frag, where, size, add_symbol, offset, exp, pcrel, it now so as not to confuse write.c. Ditto for $PIC_pcrel$0. */ if (new_fix->fx_subsy && (strcmp (S_GET_NAME (new_fix->fx_subsy), "$global$") == 0 - || strcmp (S_GET_NAME (new_fix->fx_subsy), "$PIC_pcrel$0") == 0)) + || strcmp (S_GET_NAME (new_fix->fx_subsy), "$PIC_pcrel$0") == 0 + || strcmp (S_GET_NAME (new_fix->fx_subsy), "$tls_gdidx$") == 0 + || strcmp (S_GET_NAME (new_fix->fx_subsy), "$tls_ldidx$") == 0 + || strcmp (S_GET_NAME (new_fix->fx_subsy), "$tls_dtpoff$") == 0 + || strcmp (S_GET_NAME (new_fix->fx_subsy), "$tls_ieoff$") == 0 + || strcmp (S_GET_NAME (new_fix->fx_subsy), "$tls_leoff$") == 0)) new_fix->fx_subsy = NULL; } -/* Parse a .byte, .word, .long expression for the HPPA. Called by - cons via the TC_PARSE_CONS_EXPRESSION macro. */ - -void -parse_cons_expression_hppa (exp) - expressionS *exp; -{ - hppa_field_selector = pa_chk_field_selector (&input_line_pointer); - expression (exp); -} - /* This fix_new is called by cons via TC_CONS_FIX_NEW. hppa_field_selector is set by the parse_cons_expression_hppa. */ void -cons_fix_new_hppa (frag, where, size, exp) - fragS *frag; - int where; - int size; - expressionS *exp; +cons_fix_new_hppa (fragS *frag, int where, int size, expressionS *exp) { unsigned int rel_type; @@ -1412,6 +1255,18 @@ cons_fix_new_hppa (frag, where, size, exp) rel_type = R_HPPA_GOTOFF; else if (is_PC_relative (*exp)) rel_type = R_HPPA_PCREL_CALL; +#ifdef OBJ_ELF + else if (is_tls_gdidx (*exp)) + rel_type = R_PARISC_TLS_GD21L; + else if (is_tls_ldidx (*exp)) + rel_type = R_PARISC_TLS_LDM21L; + else if (is_tls_dtpoff (*exp)) + rel_type = R_PARISC_TLS_LDO21L; + else if (is_tls_ieoff (*exp)) + rel_type = R_PARISC_TLS_IE21L; + else if (is_tls_leoff (*exp)) + rel_type = R_PARISC_TLS_LE21L; +#endif else if (is_complex (*exp)) rel_type = R_HPPA_COMPLEX; else @@ -1431,155 +1286,1936 @@ cons_fix_new_hppa (frag, where, size, exp) hppa_field_selector = 0; } -/* This function is called once, at assembler startup time. It should - set up all the tables, etc. that the MD part of the assembler will need. */ +/* Mark (via expr_end) the end of an expression (I think). FIXME. */ -void -md_begin () +static void +get_expression (char *str) { - const char *retval = NULL; - int lose = 0; - unsigned int i = 0; + char *save_in; + asection *seg; - last_call_info = NULL; - call_info_root = NULL; - - /* Set the default machine type. */ - if (!bfd_set_arch_mach (stdoutput, bfd_arch_hppa, DEFAULT_LEVEL)) - as_warn (_("could not set architecture and machine")); - - /* Folding of text and data segments fails miserably on the PA. - Warn user and disable "-R" option. */ - if (flag_readonly_data_in_text) + save_in = input_line_pointer; + input_line_pointer = str; + seg = expression (&the_insn.exp); + if (!(seg == absolute_section + || seg == undefined_section + || SEG_NORMAL (seg))) { - as_warn (_("-R option not supported on this target.")); - flag_readonly_data_in_text = 0; + as_warn (_("Bad segment in expression.")); + expr_end = input_line_pointer; + input_line_pointer = save_in; + return; } - -#ifdef OBJ_SOM - pa_spaces_begin (); -#endif - - op_hash = hash_new (); - - while (i < NUMOPCODES) - { - const char *name = pa_opcodes[i].name; - retval = hash_insert (op_hash, name, (struct pa_opcode *) &pa_opcodes[i]); - if (retval != NULL && *retval != '\0') - { - as_fatal (_("Internal error: can't hash `%s': %s\n"), name, retval); - lose = 1; - } - do - { - if ((pa_opcodes[i].match & pa_opcodes[i].mask) - != pa_opcodes[i].match) - { - fprintf (stderr, _("internal error: losing opcode: `%s' \"%s\"\n"), - pa_opcodes[i].name, pa_opcodes[i].args); - lose = 1; - } - ++i; - } - while (i < NUMOPCODES && !strcmp (pa_opcodes[i].name, name)); - } - - if (lose) - as_fatal (_("Broken assembler. No assembly attempted.")); - -#ifdef OBJ_SOM - /* SOM will change text_section. To make sure we never put - anything into the old one switch to the new one now. */ - subseg_set (text_section, 0); -#endif - -#ifdef OBJ_SOM - dummy_symbol = symbol_find_or_make ("L$dummy"); - S_SET_SEGMENT (dummy_symbol, text_section); - /* Force the symbol to be converted to a real symbol. */ - (void) symbol_get_bfdsym (dummy_symbol); -#endif + expr_end = input_line_pointer; + input_line_pointer = save_in; } -/* Assemble a single instruction storing it into a frag. */ -void -md_assemble (str) - char *str; +/* Parse a PA nullification completer (,n). Return nonzero if the + completer was found; return zero if no completer was found. */ + +static int +pa_parse_nullif (char **s) { - char *to; + int nullif; - /* The had better be something to assemble. */ - assert (str); - - /* If we are within a procedure definition, make sure we've - defined a label for the procedure; handle case where the - label was defined after the .PROC directive. - - Note there's not need to diddle with the segment or fragment - for the label symbol in this case. We have already switched - into the new $CODE$ subspace at this point. */ - if (within_procedure && last_call_info->start_symbol == NULL) + nullif = 0; + if (**s == ',') { - label_symbol_struct *label_symbol = pa_get_label (); - - if (label_symbol) - { - if (label_symbol->lss_label) - { - last_call_info->start_symbol = label_symbol->lss_label; - symbol_get_bfdsym (label_symbol->lss_label)->flags - |= BSF_FUNCTION; -#ifdef OBJ_SOM - /* Also handle allocation of a fixup to hold the unwind - information when the label appears after the proc/procend. */ - if (within_entry_exit) - { - char *where; - unsigned int u; - - where = frag_more (0); - u = UNWIND_LOW32 (&last_call_info->ci_unwind.descriptor); - fix_new_hppa (frag_now, where - frag_now->fr_literal, 0, - NULL, (offsetT) 0, NULL, - 0, R_HPPA_ENTRY, e_fsel, 0, 0, u); - } -#endif - } - else - as_bad (_("Missing function name for .PROC (corrupted label chain)")); - } + *s = *s + 1; + if (strncasecmp (*s, "n", 1) == 0) + nullif = 1; else - as_bad (_("Missing function name for .PROC")); + { + as_bad (_("Invalid Nullification: (%c)"), **s); + nullif = 0; + } + *s = *s + 1; } - /* Assemble the instruction. Results are saved into "the_insn". */ - pa_ip (str); + return nullif; +} - /* Get somewhere to put the assembled instruction. */ - to = frag_more (4); +/* Turn a string in input_line_pointer into a floating point constant of type + type, and store the appropriate bytes in *litP. The number of LITTLENUMS + emitted is stored in *sizeP . An error message or NULL is returned. */ - /* Output the opcode. */ - md_number_to_chars (to, the_insn.opcode, 4); +#define MAX_LITTLENUMS 6 - /* If necessary output more stuff. */ - if (the_insn.reloc != R_HPPA_NONE) - fix_new_hppa (frag_now, (to - frag_now->fr_literal), 4, NULL, - (offsetT) 0, &the_insn.exp, the_insn.pcrel, - the_insn.reloc, the_insn.field_selector, - the_insn.format, the_insn.arg_reloc, 0); +char * +md_atof (int type, char *litP, int *sizeP) +{ + int prec; + LITTLENUM_TYPE words[MAX_LITTLENUMS]; + LITTLENUM_TYPE *wordP; + char *t; + + switch (type) + { + + case 'f': + case 'F': + case 's': + case 'S': + prec = 2; + break; + + case 'd': + case 'D': + case 'r': + case 'R': + prec = 4; + break; + + case 'x': + case 'X': + prec = 6; + break; + + case 'p': + case 'P': + prec = 6; + break; + + default: + *sizeP = 0; + return _("Bad call to MD_ATOF()"); + } + t = atof_ieee (input_line_pointer, type, words); + if (t) + input_line_pointer = t; + *sizeP = prec * sizeof (LITTLENUM_TYPE); + for (wordP = words; prec--;) + { + md_number_to_chars (litP, (valueT) (*wordP++), sizeof (LITTLENUM_TYPE)); + litP += sizeof (LITTLENUM_TYPE); + } + return NULL; +} + +/* Write out big-endian. */ + +void +md_number_to_chars (char *buf, valueT val, int n) +{ + number_to_chars_bigendian (buf, val, n); +} + +/* Translate internal representation of relocation info to BFD target + format. */ + +arelent ** +tc_gen_reloc (asection *section, fixS *fixp) +{ + arelent *reloc; + struct hppa_fix_struct *hppa_fixp; + static arelent *no_relocs = NULL; + arelent **relocs; + reloc_type **codes; + reloc_type code; + int n_relocs; + int i; + + hppa_fixp = (struct hppa_fix_struct *) fixp->tc_fix_data; + if (fixp->fx_addsy == 0) + return &no_relocs; + + assert (hppa_fixp != 0); + assert (section != 0); + + reloc = xmalloc (sizeof (arelent)); + + reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *)); + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); + codes = hppa_gen_reloc_type (stdoutput, + fixp->fx_r_type, + hppa_fixp->fx_r_format, + hppa_fixp->fx_r_field, + fixp->fx_subsy != NULL, + symbol_get_bfdsym (fixp->fx_addsy)); + + if (codes == NULL) + { + as_bad_where (fixp->fx_file, fixp->fx_line, _("Cannot handle fixup")); + abort (); + } + + for (n_relocs = 0; codes[n_relocs]; n_relocs++) + ; + + relocs = xmalloc (sizeof (arelent *) * n_relocs + 1); + reloc = xmalloc (sizeof (arelent) * n_relocs); + for (i = 0; i < n_relocs; i++) + relocs[i] = &reloc[i]; + + relocs[n_relocs] = NULL; #ifdef OBJ_ELF - dwarf2_emit_insn (4); + switch (fixp->fx_r_type) + { + default: + assert (n_relocs == 1); + + code = *codes[0]; + + /* Now, do any processing that is dependent on the relocation type. */ + switch (code) + { + case R_PARISC_DLTREL21L: + case R_PARISC_DLTREL14R: + case R_PARISC_DLTREL14F: + case R_PARISC_PLABEL32: + case R_PARISC_PLABEL21L: + case R_PARISC_PLABEL14R: + /* For plabel relocations, the addend of the + relocation should be either 0 (no static link) or 2 + (static link required). This adjustment is done in + bfd/elf32-hppa.c:elf32_hppa_relocate_section. + + We also slam a zero addend into the DLT relative relocs; + it doesn't make a lot of sense to use any addend since + it gets you a different (eg unknown) DLT entry. */ + reloc->addend = 0; + break; + +#ifdef ELF_ARG_RELOC + case R_PARISC_PCREL17R: + case R_PARISC_PCREL17F: + case R_PARISC_PCREL17C: + case R_PARISC_DIR17R: + case R_PARISC_DIR17F: + case R_PARISC_PCREL21L: + case R_PARISC_DIR21L: + reloc->addend = HPPA_R_ADDEND (hppa_fixp->fx_arg_reloc, + fixp->fx_offset); + break; #endif + + case R_PARISC_DIR32: + /* Facilitate hand-crafted unwind info. */ + if (strcmp (section->name, UNWIND_SECTION_NAME) == 0) + code = R_PARISC_SEGREL32; + /* Fall thru */ + + default: + reloc->addend = fixp->fx_offset; + break; + } + + reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *)); + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); + reloc->howto = bfd_reloc_type_lookup (stdoutput, + (bfd_reloc_code_real_type) code); + reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; + + assert (reloc->howto && (unsigned int) code == reloc->howto->type); + break; + } +#else /* OBJ_SOM */ + + /* Walk over reach relocation returned by the BFD backend. */ + for (i = 0; i < n_relocs; i++) + { + code = *codes[i]; + + relocs[i]->sym_ptr_ptr = xmalloc (sizeof (asymbol *)); + *relocs[i]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); + relocs[i]->howto = + bfd_reloc_type_lookup (stdoutput, + (bfd_reloc_code_real_type) code); + relocs[i]->address = fixp->fx_frag->fr_address + fixp->fx_where; + + switch (code) + { + case R_COMP2: + /* The only time we ever use a R_COMP2 fixup is for the difference + of two symbols. With that in mind we fill in all four + relocs now and break out of the loop. */ + assert (i == 1); + relocs[0]->sym_ptr_ptr + = (asymbol **) bfd_abs_section_ptr->symbol_ptr_ptr; + relocs[0]->howto + = bfd_reloc_type_lookup (stdoutput, + (bfd_reloc_code_real_type) *codes[0]); + relocs[0]->address = fixp->fx_frag->fr_address + fixp->fx_where; + relocs[0]->addend = 0; + relocs[1]->sym_ptr_ptr = xmalloc (sizeof (asymbol *)); + *relocs[1]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); + relocs[1]->howto + = bfd_reloc_type_lookup (stdoutput, + (bfd_reloc_code_real_type) *codes[1]); + relocs[1]->address = fixp->fx_frag->fr_address + fixp->fx_where; + relocs[1]->addend = 0; + relocs[2]->sym_ptr_ptr = xmalloc (sizeof (asymbol *)); + *relocs[2]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_subsy); + relocs[2]->howto + = bfd_reloc_type_lookup (stdoutput, + (bfd_reloc_code_real_type) *codes[2]); + relocs[2]->address = fixp->fx_frag->fr_address + fixp->fx_where; + relocs[2]->addend = 0; + relocs[3]->sym_ptr_ptr + = (asymbol **) bfd_abs_section_ptr->symbol_ptr_ptr; + relocs[3]->howto + = bfd_reloc_type_lookup (stdoutput, + (bfd_reloc_code_real_type) *codes[3]); + relocs[3]->address = fixp->fx_frag->fr_address + fixp->fx_where; + relocs[3]->addend = 0; + relocs[4]->sym_ptr_ptr + = (asymbol **) bfd_abs_section_ptr->symbol_ptr_ptr; + relocs[4]->howto + = bfd_reloc_type_lookup (stdoutput, + (bfd_reloc_code_real_type) *codes[4]); + relocs[4]->address = fixp->fx_frag->fr_address + fixp->fx_where; + relocs[4]->addend = 0; + goto done; + case R_PCREL_CALL: + case R_ABS_CALL: + relocs[i]->addend = HPPA_R_ADDEND (hppa_fixp->fx_arg_reloc, 0); + break; + + case R_DLT_REL: + case R_DATA_PLABEL: + case R_CODE_PLABEL: + /* For plabel relocations, the addend of the + relocation should be either 0 (no static link) or 2 + (static link required). + + FIXME: We always assume no static link! + + We also slam a zero addend into the DLT relative relocs; + it doesn't make a lot of sense to use any addend since + it gets you a different (eg unknown) DLT entry. */ + relocs[i]->addend = 0; + break; + + case R_N_MODE: + case R_S_MODE: + case R_D_MODE: + case R_R_MODE: + case R_FSEL: + case R_LSEL: + case R_RSEL: + case R_BEGIN_BRTAB: + case R_END_BRTAB: + case R_BEGIN_TRY: + case R_N0SEL: + case R_N1SEL: + /* There is no symbol or addend associated with these fixups. */ + relocs[i]->sym_ptr_ptr = xmalloc (sizeof (asymbol *)); + *relocs[i]->sym_ptr_ptr = symbol_get_bfdsym (dummy_symbol); + relocs[i]->addend = 0; + break; + + case R_END_TRY: + case R_ENTRY: + case R_EXIT: + /* There is no symbol associated with these fixups. */ + relocs[i]->sym_ptr_ptr = xmalloc (sizeof (asymbol *)); + *relocs[i]->sym_ptr_ptr = symbol_get_bfdsym (dummy_symbol); + relocs[i]->addend = fixp->fx_offset; + break; + + default: + relocs[i]->addend = fixp->fx_offset; + } + } + + done: +#endif + + return relocs; +} + +/* Process any machine dependent frag types. */ + +void +md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, + asection *sec ATTRIBUTE_UNUSED, + fragS *fragP) +{ + unsigned int address; + + if (fragP->fr_type == rs_machine_dependent) + { + switch ((int) fragP->fr_subtype) + { + case 0: + fragP->fr_type = rs_fill; + know (fragP->fr_var == 1); + know (fragP->fr_next); + address = fragP->fr_address + fragP->fr_fix; + if (address % fragP->fr_offset) + { + fragP->fr_offset = + fragP->fr_next->fr_address + - fragP->fr_address + - fragP->fr_fix; + } + else + fragP->fr_offset = 0; + break; + } + } +} + +/* Round up a section size to the appropriate boundary. */ + +valueT +md_section_align (asection *segment, valueT size) +{ + int align = bfd_get_section_alignment (stdoutput, segment); + int align2 = (1 << align) - 1; + + return (size + align2) & ~align2; +} + +/* Return the approximate size of a frag before relaxation has occurred. */ + +int +md_estimate_size_before_relax (fragS *fragP, asection *segment ATTRIBUTE_UNUSED) +{ + int size; + + size = 0; + + while ((fragP->fr_fix + size) % fragP->fr_offset) + size++; + + return size; +} + +#ifdef OBJ_ELF +# ifdef WARN_COMMENTS +const char *md_shortopts = "Vc"; +# else +const char *md_shortopts = "V"; +# endif +#else +# ifdef WARN_COMMENTS +const char *md_shortopts = "c"; +# else +const char *md_shortopts = ""; +# endif +#endif + +struct option md_longopts[] = +{ +#ifdef WARN_COMMENTS + {"warn-comment", no_argument, NULL, 'c'}, +#endif + {NULL, no_argument, NULL, 0} +}; +size_t md_longopts_size = sizeof (md_longopts); + +int +md_parse_option (int c, char *arg ATTRIBUTE_UNUSED) +{ + switch (c) + { + default: + return 0; + +#ifdef OBJ_ELF + case 'V': + print_version_id (); + break; +#endif +#ifdef WARN_COMMENTS + case 'c': + warn_comment = 1; + break; +#endif + } + + return 1; +} + +void +md_show_usage (FILE *stream ATTRIBUTE_UNUSED) +{ +#ifdef OBJ_ELF + fprintf (stream, _("\ + -Q ignored\n")); +#endif +#ifdef WARN_COMMENTS + fprintf (stream, _("\ + -c print a warning if a comment is found\n")); +#endif +} + +/* We have no need to default values of symbols. */ + +symbolS * +md_undefined_symbol (char *name ATTRIBUTE_UNUSED) +{ + return NULL; +} + +#if defined (OBJ_SOM) || defined (ELF_ARG_RELOC) +#define nonzero_dibits(x) \ + ((x) | (((x) & 0x55555555) << 1) | (((x) & 0xAAAAAAAA) >> 1)) +#define arg_reloc_stub_needed(CALLER, CALLEE) \ + (((CALLER) ^ (CALLEE)) & nonzero_dibits (CALLER) & nonzero_dibits (CALLEE)) +#else +#define arg_reloc_stub_needed(CALLER, CALLEE) 0 +#endif + +/* Apply a fixup to an instruction. */ + +void +md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) +{ + char *fixpos; + struct hppa_fix_struct *hppa_fixP; + offsetT new_val; + int insn, val, fmt; + + /* SOM uses R_HPPA_ENTRY and R_HPPA_EXIT relocations which can + never be "applied" (they are just markers). Likewise for + R_HPPA_BEGIN_BRTAB and R_HPPA_END_BRTAB. */ +#ifdef OBJ_SOM + if (fixP->fx_r_type == R_HPPA_ENTRY + || fixP->fx_r_type == R_HPPA_EXIT + || fixP->fx_r_type == R_HPPA_BEGIN_BRTAB + || fixP->fx_r_type == R_HPPA_END_BRTAB + || fixP->fx_r_type == R_HPPA_BEGIN_TRY) + return; + + /* Disgusting. We must set fx_offset ourselves -- R_HPPA_END_TRY + fixups are considered not adjustable, which in turn causes + adjust_reloc_syms to not set fx_offset. Ugh. */ + if (fixP->fx_r_type == R_HPPA_END_TRY) + { + fixP->fx_offset = * valP; + return; + } +#endif +#ifdef OBJ_ELF + if (fixP->fx_r_type == (int) R_PARISC_GNU_VTENTRY + || fixP->fx_r_type == (int) R_PARISC_GNU_VTINHERIT) + return; +#endif + + if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0) + fixP->fx_done = 1; + + /* There should be a HPPA specific fixup associated with the GAS fixup. */ + hppa_fixP = (struct hppa_fix_struct *) fixP->tc_fix_data; + if (hppa_fixP == NULL) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _("no hppa_fixup entry for fixup type 0x%x"), + fixP->fx_r_type); + return; + } + + fixpos = fixP->fx_frag->fr_literal + fixP->fx_where; + + if (fixP->fx_size != 4 || hppa_fixP->fx_r_format == 32) + { + /* Handle constant output. */ + number_to_chars_bigendian (fixpos, *valP, fixP->fx_size); + return; + } + + insn = bfd_get_32 (stdoutput, fixpos); + fmt = bfd_hppa_insn2fmt (stdoutput, insn); + + /* If there is a symbol associated with this fixup, then it's something + which will need a SOM relocation (except for some PC-relative relocs). + In such cases we should treat the "val" or "addend" as zero since it + will be added in as needed from fx_offset in tc_gen_reloc. */ + if ((fixP->fx_addsy != NULL + || fixP->fx_r_type == (int) R_HPPA_NONE) +#ifdef OBJ_SOM + && fmt != 32 +#endif + ) + new_val = ((fmt == 12 || fmt == 17 || fmt == 22) ? 8 : 0); +#ifdef OBJ_SOM + /* These field selectors imply that we do not want an addend. */ + else if (hppa_fixP->fx_r_field == e_psel + || hppa_fixP->fx_r_field == e_rpsel + || hppa_fixP->fx_r_field == e_lpsel + || hppa_fixP->fx_r_field == e_tsel + || hppa_fixP->fx_r_field == e_rtsel + || hppa_fixP->fx_r_field == e_ltsel) + new_val = ((fmt == 12 || fmt == 17 || fmt == 22) ? 8 : 0); +#endif + else + new_val = hppa_field_adjust (* valP, 0, hppa_fixP->fx_r_field); + + /* Handle pc-relative exceptions from above. */ + if ((fmt == 12 || fmt == 17 || fmt == 22) + && fixP->fx_addsy + && fixP->fx_pcrel + && !arg_reloc_stub_needed (symbol_arg_reloc_info (fixP->fx_addsy), + hppa_fixP->fx_arg_reloc) +#ifdef OBJ_ELF + && (* valP - 8 + 8192 < 16384 + || (fmt == 17 && * valP - 8 + 262144 < 524288) + || (fmt == 22 && * valP - 8 + 8388608 < 16777216)) +#endif +#ifdef OBJ_SOM + && (* valP - 8 + 262144 < 524288 + || (fmt == 22 && * valP - 8 + 8388608 < 16777216)) +#endif + && !S_IS_EXTERNAL (fixP->fx_addsy) + && !S_IS_WEAK (fixP->fx_addsy) + && S_GET_SEGMENT (fixP->fx_addsy) == hppa_fixP->segment + && !(fixP->fx_subsy + && S_GET_SEGMENT (fixP->fx_subsy) != hppa_fixP->segment)) + { + new_val = hppa_field_adjust (* valP, 0, hppa_fixP->fx_r_field); + } + + switch (fmt) + { + case 10: + CHECK_FIELD_WHERE (new_val, 8191, -8192, + fixP->fx_file, fixP->fx_line); + val = new_val; + + insn = (insn & ~ 0x3ff1) | (((val & 0x1ff8) << 1) + | ((val & 0x2000) >> 13)); + break; + case -11: + CHECK_FIELD_WHERE (new_val, 8191, -8192, + fixP->fx_file, fixP->fx_line); + val = new_val; + + insn = (insn & ~ 0x3ff9) | (((val & 0x1ffc) << 1) + | ((val & 0x2000) >> 13)); + break; + /* Handle all opcodes with the 'j' operand type. */ + case 14: + CHECK_FIELD_WHERE (new_val, 8191, -8192, + fixP->fx_file, fixP->fx_line); + val = new_val; + + insn = ((insn & ~ 0x3fff) | low_sign_unext (val, 14)); + break; + + /* Handle all opcodes with the 'k' operand type. */ + case 21: + CHECK_FIELD_WHERE (new_val, 1048575, -1048576, + fixP->fx_file, fixP->fx_line); + val = new_val; + + insn = (insn & ~ 0x1fffff) | re_assemble_21 (val); + break; + + /* Handle all the opcodes with the 'i' operand type. */ + case 11: + CHECK_FIELD_WHERE (new_val, 1023, -1024, + fixP->fx_file, fixP->fx_line); + val = new_val; + + insn = (insn & ~ 0x7ff) | low_sign_unext (val, 11); + break; + + /* Handle all the opcodes with the 'w' operand type. */ + case 12: + CHECK_FIELD_WHERE (new_val - 8, 8191, -8192, + fixP->fx_file, fixP->fx_line); + val = new_val - 8; + + insn = (insn & ~ 0x1ffd) | re_assemble_12 (val >> 2); + break; + + /* Handle some of the opcodes with the 'W' operand type. */ + case 17: + { + offsetT distance = * valP; + + /* If this is an absolute branch (ie no link) with an out of + range target, then we want to complain. */ + if (fixP->fx_r_type == (int) R_HPPA_PCREL_CALL + && (insn & 0xffe00000) == 0xe8000000) + CHECK_FIELD_WHERE (distance - 8, 262143, -262144, + fixP->fx_file, fixP->fx_line); + + CHECK_FIELD_WHERE (new_val - 8, 262143, -262144, + fixP->fx_file, fixP->fx_line); + val = new_val - 8; + + insn = (insn & ~ 0x1f1ffd) | re_assemble_17 (val >> 2); + break; + } + + case 22: + { + offsetT distance = * valP; + + /* If this is an absolute branch (ie no link) with an out of + range target, then we want to complain. */ + if (fixP->fx_r_type == (int) R_HPPA_PCREL_CALL + && (insn & 0xffe00000) == 0xe8000000) + CHECK_FIELD_WHERE (distance - 8, 8388607, -8388608, + fixP->fx_file, fixP->fx_line); + + CHECK_FIELD_WHERE (new_val - 8, 8388607, -8388608, + fixP->fx_file, fixP->fx_line); + val = new_val - 8; + + insn = (insn & ~ 0x3ff1ffd) | re_assemble_22 (val >> 2); + break; + } + + case -10: + val = new_val; + insn = (insn & ~ 0xfff1) | re_assemble_16 (val & -8); + break; + + case -16: + val = new_val; + insn = (insn & ~ 0xfff9) | re_assemble_16 (val & -4); + break; + + case 16: + val = new_val; + insn = (insn & ~ 0xffff) | re_assemble_16 (val); + break; + + case 32: + insn = new_val; + break; + + default: + as_bad_where (fixP->fx_file, fixP->fx_line, + _("Unknown relocation encountered in md_apply_fix.")); + return; + } + +#ifdef OBJ_ELF + switch (fixP->fx_r_type) + { + case R_PARISC_TLS_GD21L: + case R_PARISC_TLS_GD14R: + case R_PARISC_TLS_LDM21L: + case R_PARISC_TLS_LDM14R: + case R_PARISC_TLS_LE21L: + case R_PARISC_TLS_LE14R: + case R_PARISC_TLS_IE21L: + case R_PARISC_TLS_IE14R: + if (fixP->fx_addsy) + S_SET_THREAD_LOCAL (fixP->fx_addsy); + break; + default: + break; + } +#endif + + /* Insert the relocation. */ + bfd_put_32 (stdoutput, insn, fixpos); +} + +/* Exactly what point is a PC-relative offset relative TO? + On the PA, they're relative to the address of the offset. */ + +long +md_pcrel_from (fixS *fixP) +{ + return fixP->fx_where + fixP->fx_frag->fr_address; +} + +/* Return nonzero if the input line pointer is at the end of + a statement. */ + +static int +is_end_of_statement (void) +{ + return ((*input_line_pointer == '\n') + || (*input_line_pointer == ';') + || (*input_line_pointer == '!')); +} + +#define REG_NAME_CNT (sizeof (pre_defined_registers) / sizeof (struct pd_reg)) + +/* Given NAME, find the register number associated with that name, return + the integer value associated with the given name or -1 on failure. */ + +static int +reg_name_search (char *name) +{ + int middle, low, high; + int cmp; + + low = 0; + high = REG_NAME_CNT - 1; + + do + { + middle = (low + high) / 2; + cmp = strcasecmp (name, pre_defined_registers[middle].name); + if (cmp < 0) + high = middle - 1; + else if (cmp > 0) + low = middle + 1; + else + return pre_defined_registers[middle].value; + } + while (low <= high); + + return -1; +} + +/* Read a number from S. The number might come in one of many forms, + the most common will be a hex or decimal constant, but it could be + a pre-defined register (Yuk!), or an absolute symbol. + + Return 1 on success or 0 on failure. If STRICT, then a missing + register prefix will cause a failure. The number itself is + returned in `pa_number'. + + IS_FLOAT indicates that a PA-89 FP register number should be + parsed; A `l' or `r' suffix is checked for if but 2 of IS_FLOAT is + not set. + + pa_parse_number can not handle negative constants and will fail + horribly if it is passed such a constant. */ + +static int +pa_parse_number (char **s, int is_float) +{ + int num; + char *name; + char c; + symbolS *sym; + int status; + char *p = *s; + bfd_boolean have_prefix; + + /* Skip whitespace before the number. */ + while (*p == ' ' || *p == '\t') + p = p + 1; + + pa_number = -1; + have_prefix = 0; + num = 0; + if (!strict && ISDIGIT (*p)) + { + /* Looks like a number. */ + + if (*p == '0' && (*(p + 1) == 'x' || *(p + 1) == 'X')) + { + /* The number is specified in hex. */ + p += 2; + while (ISDIGIT (*p) || ((*p >= 'a') && (*p <= 'f')) + || ((*p >= 'A') && (*p <= 'F'))) + { + if (ISDIGIT (*p)) + num = num * 16 + *p - '0'; + else if (*p >= 'a' && *p <= 'f') + num = num * 16 + *p - 'a' + 10; + else + num = num * 16 + *p - 'A' + 10; + ++p; + } + } + else + { + /* The number is specified in decimal. */ + while (ISDIGIT (*p)) + { + num = num * 10 + *p - '0'; + ++p; + } + } + + pa_number = num; + + /* Check for a `l' or `r' suffix. */ + if (is_float) + { + pa_number += FP_REG_BASE; + if (! (is_float & 2)) + { + if (IS_R_SELECT (p)) + { + pa_number += FP_REG_RSEL; + ++p; + } + else if (IS_L_SELECT (p)) + { + ++p; + } + } + } + } + else if (*p == '%') + { + /* The number might be a predefined register. */ + have_prefix = 1; + name = p; + p++; + c = *p; + /* Tege hack: Special case for general registers as the general + code makes a binary search with case translation, and is VERY + slow. */ + if (c == 'r') + { + p++; + if (*p == 'e' && *(p + 1) == 't' + && (*(p + 2) == '0' || *(p + 2) == '1')) + { + p += 2; + num = *p - '0' + 28; + p++; + } + else if (*p == 'p') + { + num = 2; + p++; + } + else if (!ISDIGIT (*p)) + { + if (print_errors) + as_bad (_("Undefined register: '%s'."), name); + num = -1; + } + else + { + do + num = num * 10 + *p++ - '0'; + while (ISDIGIT (*p)); + } + } + else + { + /* Do a normal register search. */ + while (is_part_of_name (c)) + { + p = p + 1; + c = *p; + } + *p = 0; + status = reg_name_search (name); + if (status >= 0) + num = status; + else + { + if (print_errors) + as_bad (_("Undefined register: '%s'."), name); + num = -1; + } + *p = c; + } + + pa_number = num; + } + else + { + /* And finally, it could be a symbol in the absolute section which + is effectively a constant, or a register alias symbol. */ + name = p; + c = *p; + while (is_part_of_name (c)) + { + p = p + 1; + c = *p; + } + *p = 0; + if ((sym = symbol_find (name)) != NULL) + { + if (S_GET_SEGMENT (sym) == reg_section) + { + num = S_GET_VALUE (sym); + /* Well, we don't really have one, but we do have a + register, so... */ + have_prefix = TRUE; + } + else if (S_GET_SEGMENT (sym) == &bfd_abs_section) + num = S_GET_VALUE (sym); + else if (!strict) + { + if (print_errors) + as_bad (_("Non-absolute symbol: '%s'."), name); + num = -1; + } + } + else if (!strict) + { + /* There is where we'd come for an undefined symbol + or for an empty string. For an empty string we + will return zero. That's a concession made for + compatibility with the braindamaged HP assemblers. */ + if (*name == 0) + num = 0; + else + { + if (print_errors) + as_bad (_("Undefined absolute constant: '%s'."), name); + num = -1; + } + } + *p = c; + + pa_number = num; + } + + if (!strict || have_prefix) + { + *s = p; + return 1; + } + return 0; +} + +/* Return nonzero if the given INSN and L/R information will require + a new PA-1.1 opcode. */ + +static int +need_pa11_opcode (void) +{ + if ((pa_number & FP_REG_RSEL) != 0 + && !(the_insn.fpof1 == DBL && the_insn.fpof2 == DBL)) + { + /* If this instruction is specific to a particular architecture, + then set a new architecture. */ + if (bfd_get_mach (stdoutput) < pa11) + { + if (!bfd_set_arch_mach (stdoutput, bfd_arch_hppa, pa11)) + as_warn (_("could not update architecture and machine")); + } + return TRUE; + } + else + return FALSE; +} + +/* Parse a condition for a fcmp instruction. Return the numerical + code associated with the condition. */ + +static int +pa_parse_fp_cmp_cond (char **s) +{ + int cond, i; + + cond = 0; + + for (i = 0; i < 32; i++) + { + if (strncasecmp (*s, fp_cond_map[i].string, + strlen (fp_cond_map[i].string)) == 0) + { + cond = fp_cond_map[i].cond; + *s += strlen (fp_cond_map[i].string); + /* If not a complete match, back up the input string and + report an error. */ + if (**s != ' ' && **s != '\t') + { + *s -= strlen (fp_cond_map[i].string); + break; + } + while (**s == ' ' || **s == '\t') + *s = *s + 1; + return cond; + } + } + + as_bad (_("Invalid FP Compare Condition: %s"), *s); + + /* Advance over the bogus completer. */ + while (**s != ',' && **s != ' ' && **s != '\t') + *s += 1; + + return 0; +} + +/* Parse a graphics test complete for ftest. */ + +static int +pa_parse_ftest_gfx_completer (char **s) +{ + int value; + + value = 0; + if (strncasecmp (*s, "acc8", 4) == 0) + { + value = 5; + *s += 4; + } + else if (strncasecmp (*s, "acc6", 4) == 0) + { + value = 9; + *s += 4; + } + else if (strncasecmp (*s, "acc4", 4) == 0) + { + value = 13; + *s += 4; + } + else if (strncasecmp (*s, "acc2", 4) == 0) + { + value = 17; + *s += 4; + } + else if (strncasecmp (*s, "acc", 3) == 0) + { + value = 1; + *s += 3; + } + else if (strncasecmp (*s, "rej8", 4) == 0) + { + value = 6; + *s += 4; + } + else if (strncasecmp (*s, "rej", 3) == 0) + { + value = 2; + *s += 3; + } + else + { + value = 0; + as_bad (_("Invalid FTEST completer: %s"), *s); + } + + return value; +} + +/* Parse an FP operand format completer returning the completer + type. */ + +static fp_operand_format +pa_parse_fp_cnv_format (char **s) +{ + int format; + + format = SGL; + if (**s == ',') + { + *s += 1; + if (strncasecmp (*s, "sgl", 3) == 0) + { + format = SGL; + *s += 4; + } + else if (strncasecmp (*s, "dbl", 3) == 0) + { + format = DBL; + *s += 4; + } + else if (strncasecmp (*s, "quad", 4) == 0) + { + format = QUAD; + *s += 5; + } + else if (strncasecmp (*s, "w", 1) == 0) + { + format = W; + *s += 2; + } + else if (strncasecmp (*s, "uw", 2) == 0) + { + format = UW; + *s += 3; + } + else if (strncasecmp (*s, "dw", 2) == 0) + { + format = DW; + *s += 3; + } + else if (strncasecmp (*s, "udw", 3) == 0) + { + format = UDW; + *s += 4; + } + else if (strncasecmp (*s, "qw", 2) == 0) + { + format = QW; + *s += 3; + } + else if (strncasecmp (*s, "uqw", 3) == 0) + { + format = UQW; + *s += 4; + } + else + { + format = ILLEGAL_FMT; + as_bad (_("Invalid FP Operand Format: %3s"), *s); + } + } + + return format; +} + +/* Parse an FP operand format completer returning the completer + type. */ + +static fp_operand_format +pa_parse_fp_format (char **s) +{ + int format; + + format = SGL; + if (**s == ',') + { + *s += 1; + if (strncasecmp (*s, "sgl", 3) == 0) + { + format = SGL; + *s += 4; + } + else if (strncasecmp (*s, "dbl", 3) == 0) + { + format = DBL; + *s += 4; + } + else if (strncasecmp (*s, "quad", 4) == 0) + { + format = QUAD; + *s += 5; + } + else + { + format = ILLEGAL_FMT; + as_bad (_("Invalid FP Operand Format: %3s"), *s); + } + } + + return format; +} + +/* Convert from a selector string into a selector type. */ + +static int +pa_chk_field_selector (char **str) +{ + int middle, low, high; + int cmp; + char name[4]; + + /* Read past any whitespace. */ + /* FIXME: should we read past newlines and formfeeds??? */ + while (**str == ' ' || **str == '\t' || **str == '\n' || **str == '\f') + *str = *str + 1; + + if ((*str)[1] == '\'' || (*str)[1] == '%') + name[0] = TOLOWER ((*str)[0]), + name[1] = 0; + else if ((*str)[2] == '\'' || (*str)[2] == '%') + name[0] = TOLOWER ((*str)[0]), + name[1] = TOLOWER ((*str)[1]), + name[2] = 0; + else if ((*str)[3] == '\'' || (*str)[3] == '%') + name[0] = TOLOWER ((*str)[0]), + name[1] = TOLOWER ((*str)[1]), + name[2] = TOLOWER ((*str)[2]), + name[3] = 0; + else + return e_fsel; + + low = 0; + high = sizeof (selector_table) / sizeof (struct selector_entry) - 1; + + do + { + middle = (low + high) / 2; + cmp = strcmp (name, selector_table[middle].prefix); + if (cmp < 0) + high = middle - 1; + else if (cmp > 0) + low = middle + 1; + else + { + *str += strlen (name) + 1; +#ifndef OBJ_SOM + if (selector_table[middle].field_selector == e_nsel) + return e_fsel; +#endif + return selector_table[middle].field_selector; + } + } + while (low <= high); + + return e_fsel; +} + +/* Parse a .byte, .word, .long expression for the HPPA. Called by + cons via the TC_PARSE_CONS_EXPRESSION macro. */ + +void +parse_cons_expression_hppa (expressionS *exp) +{ + hppa_field_selector = pa_chk_field_selector (&input_line_pointer); + expression (exp); +} + +/* Evaluate an absolute expression EXP which may be modified by + the selector FIELD_SELECTOR. Return the value of the expression. */ +static int +evaluate_absolute (struct pa_it *insn) +{ + offsetT value; + expressionS exp; + int field_selector = insn->field_selector; + + exp = insn->exp; + value = exp.X_add_number; + + return hppa_field_adjust (0, value, field_selector); +} + +/* Mark (via expr_end) the end of an absolute expression. FIXME. */ + +static int +pa_get_absolute_expression (struct pa_it *insn, char **strp) +{ + char *save_in; + + insn->field_selector = pa_chk_field_selector (strp); + save_in = input_line_pointer; + input_line_pointer = *strp; + expression (&insn->exp); + /* This is not perfect, but is a huge improvement over doing nothing. + + The PA assembly syntax is ambiguous in a variety of ways. Consider + this string "4 %r5" Is that the number 4 followed by the register + r5, or is that 4 MOD r5? + + If we get a modulo expression when looking for an absolute, we try + again cutting off the input string at the first whitespace character. */ + if (insn->exp.X_op == O_modulus) + { + char *s, c; + int retval; + + input_line_pointer = *strp; + s = *strp; + while (*s != ',' && *s != ' ' && *s != '\t') + s++; + + c = *s; + *s = 0; + + retval = pa_get_absolute_expression (insn, strp); + + input_line_pointer = save_in; + *s = c; + return evaluate_absolute (insn); + } + /* When in strict mode we have a non-match, fix up the pointers + and return to our caller. */ + if (insn->exp.X_op != O_constant && strict) + { + expr_end = input_line_pointer; + input_line_pointer = save_in; + return 0; + } + if (insn->exp.X_op != O_constant) + { + as_bad (_("Bad segment (should be absolute).")); + expr_end = input_line_pointer; + input_line_pointer = save_in; + return 0; + } + expr_end = input_line_pointer; + input_line_pointer = save_in; + return evaluate_absolute (insn); +} + +/* Given an argument location specification return the associated + argument location number. */ + +static unsigned int +pa_build_arg_reloc (char *type_name) +{ + + if (strncasecmp (type_name, "no", 2) == 0) + return 0; + if (strncasecmp (type_name, "gr", 2) == 0) + return 1; + else if (strncasecmp (type_name, "fr", 2) == 0) + return 2; + else if (strncasecmp (type_name, "fu", 2) == 0) + return 3; + else + as_bad (_("Invalid argument location: %s\n"), type_name); + + return 0; +} + +/* Encode and return an argument relocation specification for + the given register in the location specified by arg_reloc. */ + +static unsigned int +pa_align_arg_reloc (unsigned int reg, unsigned int arg_reloc) +{ + unsigned int new_reloc; + + new_reloc = arg_reloc; + switch (reg) + { + case 0: + new_reloc <<= 8; + break; + case 1: + new_reloc <<= 6; + break; + case 2: + new_reloc <<= 4; + break; + case 3: + new_reloc <<= 2; + break; + default: + as_bad (_("Invalid argument description: %d"), reg); + } + + return new_reloc; +} + +/* Parse a non-negated compare/subtract completer returning the + number (for encoding in instructions) of the given completer. */ + +static int +pa_parse_nonneg_cmpsub_cmpltr (char **s) +{ + int cmpltr; + char *name = *s + 1; + char c; + char *save_s = *s; + int nullify = 0; + + cmpltr = 0; + if (**s == ',') + { + *s += 1; + while (**s != ',' && **s != ' ' && **s != '\t') + *s += 1; + c = **s; + **s = 0x00; + + if (strcmp (name, "=") == 0) + { + cmpltr = 1; + } + else if (strcmp (name, "<") == 0) + { + cmpltr = 2; + } + else if (strcmp (name, "<=") == 0) + { + cmpltr = 3; + } + else if (strcmp (name, "<<") == 0) + { + cmpltr = 4; + } + else if (strcmp (name, "<<=") == 0) + { + cmpltr = 5; + } + else if (strcasecmp (name, "sv") == 0) + { + cmpltr = 6; + } + else if (strcasecmp (name, "od") == 0) + { + cmpltr = 7; + } + /* If we have something like addb,n then there is no condition + completer. */ + else if (strcasecmp (name, "n") == 0) + { + cmpltr = 0; + nullify = 1; + } + else + { + cmpltr = -1; + } + **s = c; + } + + /* Reset pointers if this was really a ,n for a branch instruction. */ + if (nullify) + *s = save_s; + + return cmpltr; +} + +/* Parse a negated compare/subtract completer returning the + number (for encoding in instructions) of the given completer. */ + +static int +pa_parse_neg_cmpsub_cmpltr (char **s) +{ + int cmpltr; + char *name = *s + 1; + char c; + char *save_s = *s; + int nullify = 0; + + cmpltr = 0; + if (**s == ',') + { + *s += 1; + while (**s != ',' && **s != ' ' && **s != '\t') + *s += 1; + c = **s; + **s = 0x00; + + if (strcasecmp (name, "tr") == 0) + { + cmpltr = 0; + } + else if (strcmp (name, "<>") == 0) + { + cmpltr = 1; + } + else if (strcmp (name, ">=") == 0) + { + cmpltr = 2; + } + else if (strcmp (name, ">") == 0) + { + cmpltr = 3; + } + else if (strcmp (name, ">>=") == 0) + { + cmpltr = 4; + } + else if (strcmp (name, ">>") == 0) + { + cmpltr = 5; + } + else if (strcasecmp (name, "nsv") == 0) + { + cmpltr = 6; + } + else if (strcasecmp (name, "ev") == 0) + { + cmpltr = 7; + } + /* If we have something like addb,n then there is no condition + completer. */ + else if (strcasecmp (name, "n") == 0) + { + cmpltr = 0; + nullify = 1; + } + else + { + cmpltr = -1; + } + **s = c; + } + + /* Reset pointers if this was really a ,n for a branch instruction. */ + if (nullify) + *s = save_s; + + return cmpltr; +} + +/* Parse a 64 bit compare and branch completer returning the number (for + encoding in instructions) of the given completer. + + Nonnegated comparisons are returned as 0-7, negated comparisons are + returned as 8-15. */ + +static int +pa_parse_cmpb_64_cmpltr (char **s) +{ + int cmpltr; + char *name = *s + 1; + char c; + + cmpltr = -1; + if (**s == ',') + { + *s += 1; + while (**s != ',' && **s != ' ' && **s != '\t') + *s += 1; + c = **s; + **s = 0x00; + + if (strcmp (name, "*") == 0) + { + cmpltr = 0; + } + else if (strcmp (name, "*=") == 0) + { + cmpltr = 1; + } + else if (strcmp (name, "*<") == 0) + { + cmpltr = 2; + } + else if (strcmp (name, "*<=") == 0) + { + cmpltr = 3; + } + else if (strcmp (name, "*<<") == 0) + { + cmpltr = 4; + } + else if (strcmp (name, "*<<=") == 0) + { + cmpltr = 5; + } + else if (strcasecmp (name, "*sv") == 0) + { + cmpltr = 6; + } + else if (strcasecmp (name, "*od") == 0) + { + cmpltr = 7; + } + else if (strcasecmp (name, "*tr") == 0) + { + cmpltr = 8; + } + else if (strcmp (name, "*<>") == 0) + { + cmpltr = 9; + } + else if (strcmp (name, "*>=") == 0) + { + cmpltr = 10; + } + else if (strcmp (name, "*>") == 0) + { + cmpltr = 11; + } + else if (strcmp (name, "*>>=") == 0) + { + cmpltr = 12; + } + else if (strcmp (name, "*>>") == 0) + { + cmpltr = 13; + } + else if (strcasecmp (name, "*nsv") == 0) + { + cmpltr = 14; + } + else if (strcasecmp (name, "*ev") == 0) + { + cmpltr = 15; + } + else + { + cmpltr = -1; + } + **s = c; + } + + return cmpltr; +} + +/* Parse a 64 bit compare immediate and branch completer returning the number + (for encoding in instructions) of the given completer. */ + +static int +pa_parse_cmpib_64_cmpltr (char **s) +{ + int cmpltr; + char *name = *s + 1; + char c; + + cmpltr = -1; + if (**s == ',') + { + *s += 1; + while (**s != ',' && **s != ' ' && **s != '\t') + *s += 1; + c = **s; + **s = 0x00; + + if (strcmp (name, "*<<") == 0) + { + cmpltr = 0; + } + else if (strcmp (name, "*=") == 0) + { + cmpltr = 1; + } + else if (strcmp (name, "*<") == 0) + { + cmpltr = 2; + } + else if (strcmp (name, "*<=") == 0) + { + cmpltr = 3; + } + else if (strcmp (name, "*>>=") == 0) + { + cmpltr = 4; + } + else if (strcmp (name, "*<>") == 0) + { + cmpltr = 5; + } + else if (strcasecmp (name, "*>=") == 0) + { + cmpltr = 6; + } + else if (strcasecmp (name, "*>") == 0) + { + cmpltr = 7; + } + else + { + cmpltr = -1; + } + **s = c; + } + + return cmpltr; +} + +/* Parse a non-negated addition completer returning the number + (for encoding in instructions) of the given completer. */ + +static int +pa_parse_nonneg_add_cmpltr (char **s) +{ + int cmpltr; + char *name = *s + 1; + char c; + char *save_s = *s; + int nullify = 0; + + cmpltr = 0; + if (**s == ',') + { + *s += 1; + while (**s != ',' && **s != ' ' && **s != '\t') + *s += 1; + c = **s; + **s = 0x00; + if (strcmp (name, "=") == 0) + { + cmpltr = 1; + } + else if (strcmp (name, "<") == 0) + { + cmpltr = 2; + } + else if (strcmp (name, "<=") == 0) + { + cmpltr = 3; + } + else if (strcasecmp (name, "nuv") == 0) + { + cmpltr = 4; + } + else if (strcasecmp (name, "znv") == 0) + { + cmpltr = 5; + } + else if (strcasecmp (name, "sv") == 0) + { + cmpltr = 6; + } + else if (strcasecmp (name, "od") == 0) + { + cmpltr = 7; + } + /* If we have something like addb,n then there is no condition + completer. */ + else if (strcasecmp (name, "n") == 0) + { + cmpltr = 0; + nullify = 1; + } + else + { + cmpltr = -1; + } + **s = c; + } + + /* Reset pointers if this was really a ,n for a branch instruction. */ + if (nullify) + *s = save_s; + + return cmpltr; +} + +/* Parse a negated addition completer returning the number + (for encoding in instructions) of the given completer. */ + +static int +pa_parse_neg_add_cmpltr (char **s) +{ + int cmpltr; + char *name = *s + 1; + char c; + char *save_s = *s; + int nullify = 0; + + cmpltr = 0; + if (**s == ',') + { + *s += 1; + while (**s != ',' && **s != ' ' && **s != '\t') + *s += 1; + c = **s; + **s = 0x00; + if (strcasecmp (name, "tr") == 0) + { + cmpltr = 0; + } + else if (strcmp (name, "<>") == 0) + { + cmpltr = 1; + } + else if (strcmp (name, ">=") == 0) + { + cmpltr = 2; + } + else if (strcmp (name, ">") == 0) + { + cmpltr = 3; + } + else if (strcasecmp (name, "uv") == 0) + { + cmpltr = 4; + } + else if (strcasecmp (name, "vnz") == 0) + { + cmpltr = 5; + } + else if (strcasecmp (name, "nsv") == 0) + { + cmpltr = 6; + } + else if (strcasecmp (name, "ev") == 0) + { + cmpltr = 7; + } + /* If we have something like addb,n then there is no condition + completer. */ + else if (strcasecmp (name, "n") == 0) + { + cmpltr = 0; + nullify = 1; + } + else + { + cmpltr = -1; + } + **s = c; + } + + /* Reset pointers if this was really a ,n for a branch instruction. */ + if (nullify) + *s = save_s; + + return cmpltr; +} + +/* Parse a 64 bit wide mode add and branch completer returning the number (for + encoding in instructions) of the given completer. */ + +static int +pa_parse_addb_64_cmpltr (char **s) +{ + int cmpltr; + char *name = *s + 1; + char c; + char *save_s = *s; + int nullify = 0; + + cmpltr = 0; + if (**s == ',') + { + *s += 1; + while (**s != ',' && **s != ' ' && **s != '\t') + *s += 1; + c = **s; + **s = 0x00; + if (strcmp (name, "=") == 0) + { + cmpltr = 1; + } + else if (strcmp (name, "<") == 0) + { + cmpltr = 2; + } + else if (strcmp (name, "<=") == 0) + { + cmpltr = 3; + } + else if (strcasecmp (name, "nuv") == 0) + { + cmpltr = 4; + } + else if (strcasecmp (name, "*=") == 0) + { + cmpltr = 5; + } + else if (strcasecmp (name, "*<") == 0) + { + cmpltr = 6; + } + else if (strcasecmp (name, "*<=") == 0) + { + cmpltr = 7; + } + else if (strcmp (name, "tr") == 0) + { + cmpltr = 8; + } + else if (strcmp (name, "<>") == 0) + { + cmpltr = 9; + } + else if (strcmp (name, ">=") == 0) + { + cmpltr = 10; + } + else if (strcmp (name, ">") == 0) + { + cmpltr = 11; + } + else if (strcasecmp (name, "uv") == 0) + { + cmpltr = 12; + } + else if (strcasecmp (name, "*<>") == 0) + { + cmpltr = 13; + } + else if (strcasecmp (name, "*>=") == 0) + { + cmpltr = 14; + } + else if (strcasecmp (name, "*>") == 0) + { + cmpltr = 15; + } + /* If we have something like addb,n then there is no condition + completer. */ + else if (strcasecmp (name, "n") == 0) + { + cmpltr = 0; + nullify = 1; + } + else + { + cmpltr = -1; + } + **s = c; + } + + /* Reset pointers if this was really a ,n for a branch instruction. */ + if (nullify) + *s = save_s; + + return cmpltr; } /* Do the real work for assembling a single instruction. Store results into the global "the_insn" variable. */ static void -pa_ip (str) - char *str; +pa_ip (char *str) { char *error_message = ""; char *s, c, *argstart, *name, *save_s; @@ -1634,9 +3270,7 @@ pa_ip (str) } if (comma) - { - *--s = ','; - } + *--s = ','; /* Mark the location where arguments for the instruction start, then start processing them. */ @@ -1664,7 +3298,6 @@ pa_ip (str) switch (*args) { - /* End of arguments. */ case '\0': if (*s == '\0') @@ -2974,6 +4607,18 @@ pa_ip (str) the_insn.reloc = R_HPPA_GOTOFF; else if (is_PC_relative (the_insn.exp)) the_insn.reloc = R_HPPA_PCREL_CALL; +#ifdef OBJ_ELF + else if (is_tls_gdidx (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_GD21L; + else if (is_tls_ldidx (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LDM21L; + else if (is_tls_dtpoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LDO21L; + else if (is_tls_ieoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_IE21L; + else if (is_tls_leoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LE21L; +#endif else the_insn.reloc = R_HPPA; the_insn.format = 11; @@ -3093,6 +4738,18 @@ pa_ip (str) the_insn.reloc = R_HPPA_GOTOFF; else if (is_PC_relative (the_insn.exp)) the_insn.reloc = R_HPPA_PCREL_CALL; +#ifdef OBJ_ELF + else if (is_tls_gdidx (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_GD21L; + else if (is_tls_ldidx (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LDM21L; + else if (is_tls_dtpoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LDO21L; + else if (is_tls_ieoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_IE21L; + else if (is_tls_leoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LE21L; +#endif else the_insn.reloc = R_HPPA; the_insn.format = 14; @@ -3123,6 +4780,18 @@ pa_ip (str) the_insn.reloc = R_HPPA_GOTOFF; else if (is_PC_relative (the_insn.exp)) the_insn.reloc = R_HPPA_PCREL_CALL; +#ifdef OBJ_ELF + else if (is_tls_gdidx (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_GD21L; + else if (is_tls_ldidx (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LDM21L; + else if (is_tls_dtpoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LDO21L; + else if (is_tls_ieoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_IE21L; + else if (is_tls_leoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LE21L; +#endif else the_insn.reloc = R_HPPA; the_insn.format = 14; @@ -3147,6 +4816,18 @@ pa_ip (str) the_insn.reloc = R_HPPA_GOTOFF; else if (is_PC_relative (the_insn.exp)) the_insn.reloc = R_HPPA_PCREL_CALL; +#ifdef OBJ_ELF + else if (is_tls_gdidx (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_GD21L; + else if (is_tls_ldidx (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LDM21L; + else if (is_tls_dtpoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LDO21L; + else if (is_tls_ieoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_IE21L; + else if (is_tls_leoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LE21L; +#endif else the_insn.reloc = R_HPPA; the_insn.format = 14; @@ -3171,6 +4852,18 @@ pa_ip (str) the_insn.reloc = R_HPPA_GOTOFF; else if (is_PC_relative (the_insn.exp)) the_insn.reloc = R_HPPA_PCREL_CALL; +#ifdef OBJ_ELF + else if (is_tls_gdidx (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_GD21L; + else if (is_tls_ldidx (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LDM21L; + else if (is_tls_dtpoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LDO21L; + else if (is_tls_ieoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_IE21L; + else if (is_tls_leoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LE21L; +#endif else the_insn.reloc = R_HPPA; the_insn.format = 21; @@ -3196,6 +4889,18 @@ pa_ip (str) the_insn.reloc = R_HPPA_GOTOFF; else if (is_PC_relative (the_insn.exp)) the_insn.reloc = R_HPPA_PCREL_CALL; +#ifdef OBJ_ELF + else if (is_tls_gdidx (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_GD21L; + else if (is_tls_ldidx (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LDM21L; + else if (is_tls_dtpoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LDO21L; + else if (is_tls_ieoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_IE21L; + else if (is_tls_leoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LE21L; +#endif else the_insn.reloc = R_HPPA; the_insn.format = 14; @@ -3222,6 +4927,18 @@ pa_ip (str) the_insn.reloc = R_HPPA_GOTOFF; else if (is_PC_relative (the_insn.exp)) the_insn.reloc = R_HPPA_PCREL_CALL; +#ifdef OBJ_ELF + else if (is_tls_gdidx (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_GD21L; + else if (is_tls_ldidx (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LDM21L; + else if (is_tls_dtpoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LDO21L; + else if (is_tls_ieoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_IE21L; + else if (is_tls_leoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LE21L; +#endif else the_insn.reloc = R_HPPA; the_insn.format = 14; @@ -3248,6 +4965,18 @@ pa_ip (str) the_insn.reloc = R_HPPA_GOTOFF; else if (is_PC_relative (the_insn.exp)) the_insn.reloc = R_HPPA_PCREL_CALL; +#ifdef OBJ_ELF + else if (is_tls_gdidx (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_GD21L; + else if (is_tls_ldidx (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LDM21L; + else if (is_tls_dtpoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LDO21L; + else if (is_tls_ieoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_IE21L; + else if (is_tls_leoff (the_insn.exp)) + the_insn.reloc = R_PARISC_TLS_LE21L; +#endif else the_insn.reloc = R_HPPA; the_insn.format = 14; @@ -3992,1947 +5721,83 @@ pa_ip (str) the_insn.opcode = opcode; } -/* Turn a string in input_line_pointer into a floating point constant of type - type, and store the appropriate bytes in *litP. The number of LITTLENUMS - emitted is stored in *sizeP . An error message or NULL is returned. */ - -#define MAX_LITTLENUMS 6 - -char * -md_atof (type, litP, sizeP) - char type; - char *litP; - int *sizeP; -{ - int prec; - LITTLENUM_TYPE words[MAX_LITTLENUMS]; - LITTLENUM_TYPE *wordP; - char *t; - - switch (type) - { - - case 'f': - case 'F': - case 's': - case 'S': - prec = 2; - break; - - case 'd': - case 'D': - case 'r': - case 'R': - prec = 4; - break; - - case 'x': - case 'X': - prec = 6; - break; - - case 'p': - case 'P': - prec = 6; - break; - - default: - *sizeP = 0; - return _("Bad call to MD_ATOF()"); - } - t = atof_ieee (input_line_pointer, type, words); - if (t) - input_line_pointer = t; - *sizeP = prec * sizeof (LITTLENUM_TYPE); - for (wordP = words; prec--;) - { - md_number_to_chars (litP, (valueT) (*wordP++), sizeof (LITTLENUM_TYPE)); - litP += sizeof (LITTLENUM_TYPE); - } - return NULL; -} - -/* Write out big-endian. */ +/* Assemble a single instruction storing it into a frag. */ void -md_number_to_chars (buf, val, n) - char *buf; - valueT val; - int n; +md_assemble (char *str) { - number_to_chars_bigendian (buf, val, n); -} + char *to; -/* Translate internal representation of relocation info to BFD target - format. */ + /* The had better be something to assemble. */ + assert (str); -arelent ** -tc_gen_reloc (section, fixp) - asection *section; - fixS *fixp; -{ - arelent *reloc; - struct hppa_fix_struct *hppa_fixp; - static arelent *no_relocs = NULL; - arelent **relocs; - reloc_type **codes; - reloc_type code; - int n_relocs; - int i; + /* If we are within a procedure definition, make sure we've + defined a label for the procedure; handle case where the + label was defined after the .PROC directive. - hppa_fixp = (struct hppa_fix_struct *) fixp->tc_fix_data; - if (fixp->fx_addsy == 0) - return &no_relocs; - - assert (hppa_fixp != 0); - assert (section != 0); - - reloc = (arelent *) xmalloc (sizeof (arelent)); - - reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); - *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); - codes = hppa_gen_reloc_type (stdoutput, - fixp->fx_r_type, - hppa_fixp->fx_r_format, - hppa_fixp->fx_r_field, - fixp->fx_subsy != NULL, - symbol_get_bfdsym (fixp->fx_addsy)); - - if (codes == NULL) + Note there's not need to diddle with the segment or fragment + for the label symbol in this case. We have already switched + into the new $CODE$ subspace at this point. */ + if (within_procedure && last_call_info->start_symbol == NULL) { - as_bad_where (fixp->fx_file, fixp->fx_line, _("Cannot handle fixup")); - abort (); - } + label_symbol_struct *label_symbol = pa_get_label (); - for (n_relocs = 0; codes[n_relocs]; n_relocs++) - ; - - relocs = (arelent **) xmalloc (sizeof (arelent *) * n_relocs + 1); - reloc = (arelent *) xmalloc (sizeof (arelent) * n_relocs); - for (i = 0; i < n_relocs; i++) - relocs[i] = &reloc[i]; - - relocs[n_relocs] = NULL; - -#ifdef OBJ_ELF - switch (fixp->fx_r_type) - { - default: - assert (n_relocs == 1); - - code = *codes[0]; - - /* Now, do any processing that is dependent on the relocation type. */ - switch (code) + if (label_symbol) { - case R_PARISC_DLTREL21L: - case R_PARISC_DLTREL14R: - case R_PARISC_DLTREL14F: - case R_PARISC_PLABEL32: - case R_PARISC_PLABEL21L: - case R_PARISC_PLABEL14R: - /* For plabel relocations, the addend of the - relocation should be either 0 (no static link) or 2 - (static link required). This adjustment is done in - bfd/elf32-hppa.c:elf32_hppa_relocate_section. - - We also slam a zero addend into the DLT relative relocs; - it doesn't make a lot of sense to use any addend since - it gets you a different (eg unknown) DLT entry. */ - reloc->addend = 0; - break; - -#ifdef ELF_ARG_RELOC - case R_PARISC_PCREL17R: - case R_PARISC_PCREL17F: - case R_PARISC_PCREL17C: - case R_PARISC_DIR17R: - case R_PARISC_DIR17F: - case R_PARISC_PCREL21L: - case R_PARISC_DIR21L: - reloc->addend = HPPA_R_ADDEND (hppa_fixp->fx_arg_reloc, - fixp->fx_offset); - break; -#endif - - case R_PARISC_DIR32: - /* Facilitate hand-crafted unwind info. */ - if (strcmp (section->name, UNWIND_SECTION_NAME) == 0) - code = R_PARISC_SEGREL32; - /* Fall thru */ - - default: - reloc->addend = fixp->fx_offset; - break; - } - - reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); - *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); - reloc->howto = bfd_reloc_type_lookup (stdoutput, - (bfd_reloc_code_real_type) code); - reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; - - assert (reloc->howto && (unsigned int) code == reloc->howto->type); - break; - } -#else /* OBJ_SOM */ - - /* Walk over reach relocation returned by the BFD backend. */ - for (i = 0; i < n_relocs; i++) - { - code = *codes[i]; - - relocs[i]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); - *relocs[i]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); - relocs[i]->howto = - bfd_reloc_type_lookup (stdoutput, - (bfd_reloc_code_real_type) code); - relocs[i]->address = fixp->fx_frag->fr_address + fixp->fx_where; - - switch (code) - { - case R_COMP2: - /* The only time we ever use a R_COMP2 fixup is for the difference - of two symbols. With that in mind we fill in all four - relocs now and break out of the loop. */ - assert (i == 1); - relocs[0]->sym_ptr_ptr = (asymbol **) &(bfd_abs_symbol); - relocs[0]->howto = - bfd_reloc_type_lookup (stdoutput, - (bfd_reloc_code_real_type) *codes[0]); - relocs[0]->address = fixp->fx_frag->fr_address + fixp->fx_where; - relocs[0]->addend = 0; - relocs[1]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); - *relocs[1]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); - relocs[1]->howto = - bfd_reloc_type_lookup (stdoutput, - (bfd_reloc_code_real_type) *codes[1]); - relocs[1]->address = fixp->fx_frag->fr_address + fixp->fx_where; - relocs[1]->addend = 0; - relocs[2]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); - *relocs[2]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_subsy); - relocs[2]->howto = - bfd_reloc_type_lookup (stdoutput, - (bfd_reloc_code_real_type) *codes[2]); - relocs[2]->address = fixp->fx_frag->fr_address + fixp->fx_where; - relocs[2]->addend = 0; - relocs[3]->sym_ptr_ptr = (asymbol **) &(bfd_abs_symbol); - relocs[3]->howto = - bfd_reloc_type_lookup (stdoutput, - (bfd_reloc_code_real_type) *codes[3]); - relocs[3]->address = fixp->fx_frag->fr_address + fixp->fx_where; - relocs[3]->addend = 0; - relocs[4]->sym_ptr_ptr = (asymbol **) &(bfd_abs_symbol); - relocs[4]->howto = - bfd_reloc_type_lookup (stdoutput, - (bfd_reloc_code_real_type) *codes[4]); - relocs[4]->address = fixp->fx_frag->fr_address + fixp->fx_where; - relocs[4]->addend = 0; - goto done; - case R_PCREL_CALL: - case R_ABS_CALL: - relocs[i]->addend = HPPA_R_ADDEND (hppa_fixp->fx_arg_reloc, 0); - break; - - case R_DLT_REL: - case R_DATA_PLABEL: - case R_CODE_PLABEL: - /* For plabel relocations, the addend of the - relocation should be either 0 (no static link) or 2 - (static link required). - - FIXME: We always assume no static link! - - We also slam a zero addend into the DLT relative relocs; - it doesn't make a lot of sense to use any addend since - it gets you a different (eg unknown) DLT entry. */ - relocs[i]->addend = 0; - break; - - case R_N_MODE: - case R_S_MODE: - case R_D_MODE: - case R_R_MODE: - case R_FSEL: - case R_LSEL: - case R_RSEL: - case R_BEGIN_BRTAB: - case R_END_BRTAB: - case R_BEGIN_TRY: - case R_N0SEL: - case R_N1SEL: - /* There is no symbol or addend associated with these fixups. */ - relocs[i]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); - *relocs[i]->sym_ptr_ptr = symbol_get_bfdsym (dummy_symbol); - relocs[i]->addend = 0; - break; - - case R_END_TRY: - case R_ENTRY: - case R_EXIT: - /* There is no symbol associated with these fixups. */ - relocs[i]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); - *relocs[i]->sym_ptr_ptr = symbol_get_bfdsym (dummy_symbol); - relocs[i]->addend = fixp->fx_offset; - break; - - default: - relocs[i]->addend = fixp->fx_offset; - } - } - - done: -#endif - - return relocs; -} - -/* Process any machine dependent frag types. */ - -void -md_convert_frag (abfd, sec, fragP) - register bfd *abfd ATTRIBUTE_UNUSED; - register asection *sec ATTRIBUTE_UNUSED; - register fragS *fragP; -{ - unsigned int address; - - if (fragP->fr_type == rs_machine_dependent) - { - switch ((int) fragP->fr_subtype) - { - case 0: - fragP->fr_type = rs_fill; - know (fragP->fr_var == 1); - know (fragP->fr_next); - address = fragP->fr_address + fragP->fr_fix; - if (address % fragP->fr_offset) + if (label_symbol->lss_label) { - fragP->fr_offset = - fragP->fr_next->fr_address - - fragP->fr_address - - fragP->fr_fix; - } - else - fragP->fr_offset = 0; - break; - } - } -} - -/* Round up a section size to the appropriate boundary. */ - -valueT -md_section_align (segment, size) - asection *segment; - valueT size; -{ - int align = bfd_get_section_alignment (stdoutput, segment); - int align2 = (1 << align) - 1; - - return (size + align2) & ~align2; -} - -/* Return the approximate size of a frag before relaxation has occurred. */ -int -md_estimate_size_before_relax (fragP, segment) - register fragS *fragP; - asection *segment ATTRIBUTE_UNUSED; -{ - int size; - - size = 0; - - while ((fragP->fr_fix + size) % fragP->fr_offset) - size++; - - return size; -} - -#ifdef OBJ_ELF -# ifdef WARN_COMMENTS -const char *md_shortopts = "Vc"; -# else -const char *md_shortopts = "V"; -# endif -#else -# ifdef WARN_COMMENTS -const char *md_shortopts = "c"; -# else -const char *md_shortopts = ""; -# endif -#endif - -struct option md_longopts[] = { -#ifdef WARN_COMMENTS - {"warn-comment", no_argument, NULL, 'c'}, -#endif - {NULL, no_argument, NULL, 0} -}; -size_t md_longopts_size = sizeof (md_longopts); - -int -md_parse_option (c, arg) - int c ATTRIBUTE_UNUSED; - char *arg ATTRIBUTE_UNUSED; -{ - switch (c) - { - default: - return 0; - -#ifdef OBJ_ELF - case 'V': - print_version_id (); - break; -#endif -#ifdef WARN_COMMENTS - case 'c': - warn_comment = 1; - break; -#endif - } - - return 1; -} - -void -md_show_usage (stream) - FILE *stream ATTRIBUTE_UNUSED; -{ -#ifdef OBJ_ELF - fprintf (stream, _("\ - -Q ignored\n")); -#endif -#ifdef WARN_COMMENTS - fprintf (stream, _("\ - -c print a warning if a comment is found\n")); -#endif -} - -/* We have no need to default values of symbols. */ - -symbolS * -md_undefined_symbol (name) - char *name ATTRIBUTE_UNUSED; -{ - return 0; -} - -#if defined (OBJ_SOM) || defined (ELF_ARG_RELOC) -#define nonzero_dibits(x) \ - ((x) | (((x) & 0x55555555) << 1) | (((x) & 0xAAAAAAAA) >> 1)) -#define arg_reloc_stub_needed(CALLER, CALLEE) \ - (((CALLER) ^ (CALLEE)) & nonzero_dibits (CALLER) & nonzero_dibits (CALLEE)) -#else -#define arg_reloc_stub_needed(CALLER, CALLEE) 0 -#endif - -/* Apply a fixup to an instruction. */ - -void -md_apply_fix (fixP, valP, seg) - fixS *fixP; - valueT *valP; - segT seg ATTRIBUTE_UNUSED; -{ - char *fixpos; - struct hppa_fix_struct *hppa_fixP; - offsetT new_val; - int insn, val, fmt; - - /* SOM uses R_HPPA_ENTRY and R_HPPA_EXIT relocations which can - never be "applied" (they are just markers). Likewise for - R_HPPA_BEGIN_BRTAB and R_HPPA_END_BRTAB. */ + last_call_info->start_symbol = label_symbol->lss_label; + symbol_get_bfdsym (label_symbol->lss_label)->flags + |= BSF_FUNCTION; #ifdef OBJ_SOM - if (fixP->fx_r_type == R_HPPA_ENTRY - || fixP->fx_r_type == R_HPPA_EXIT - || fixP->fx_r_type == R_HPPA_BEGIN_BRTAB - || fixP->fx_r_type == R_HPPA_END_BRTAB - || fixP->fx_r_type == R_HPPA_BEGIN_TRY) - return; - - /* Disgusting. We must set fx_offset ourselves -- R_HPPA_END_TRY - fixups are considered not adjustable, which in turn causes - adjust_reloc_syms to not set fx_offset. Ugh. */ - if (fixP->fx_r_type == R_HPPA_END_TRY) - { - fixP->fx_offset = * valP; - return; - } -#endif -#ifdef OBJ_ELF - if (fixP->fx_r_type == (int) R_PARISC_GNU_VTENTRY - || fixP->fx_r_type == (int) R_PARISC_GNU_VTINHERIT) - return; -#endif - - if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0) - fixP->fx_done = 1; - - /* There should be a HPPA specific fixup associated with the GAS fixup. */ - hppa_fixP = (struct hppa_fix_struct *) fixP->tc_fix_data; - if (hppa_fixP == NULL) - { - as_bad_where (fixP->fx_file, fixP->fx_line, - _("no hppa_fixup entry for fixup type 0x%x"), - fixP->fx_r_type); - return; - } - - fixpos = fixP->fx_frag->fr_literal + fixP->fx_where; - - if (fixP->fx_size != 4 || hppa_fixP->fx_r_format == 32) - { - /* Handle constant output. */ - number_to_chars_bigendian (fixpos, *valP, fixP->fx_size); - return; - } - - insn = bfd_get_32 (stdoutput, fixpos); - fmt = bfd_hppa_insn2fmt (stdoutput, insn); - - /* If there is a symbol associated with this fixup, then it's something - which will need a SOM relocation (except for some PC-relative relocs). - In such cases we should treat the "val" or "addend" as zero since it - will be added in as needed from fx_offset in tc_gen_reloc. */ - if ((fixP->fx_addsy != NULL - || fixP->fx_r_type == (int) R_HPPA_NONE) -#ifdef OBJ_SOM - && fmt != 32 -#endif - ) - new_val = ((fmt == 12 || fmt == 17 || fmt == 22) ? 8 : 0); -#ifdef OBJ_SOM - /* These field selectors imply that we do not want an addend. */ - else if (hppa_fixP->fx_r_field == e_psel - || hppa_fixP->fx_r_field == e_rpsel - || hppa_fixP->fx_r_field == e_lpsel - || hppa_fixP->fx_r_field == e_tsel - || hppa_fixP->fx_r_field == e_rtsel - || hppa_fixP->fx_r_field == e_ltsel) - new_val = ((fmt == 12 || fmt == 17 || fmt == 22) ? 8 : 0); -#endif - else - new_val = hppa_field_adjust (* valP, 0, hppa_fixP->fx_r_field); - - /* Handle pc-relative exceptions from above. */ - if ((fmt == 12 || fmt == 17 || fmt == 22) - && fixP->fx_addsy - && fixP->fx_pcrel - && !arg_reloc_stub_needed (symbol_arg_reloc_info (fixP->fx_addsy), - hppa_fixP->fx_arg_reloc) -#ifdef OBJ_ELF - && (* valP - 8 + 8192 < 16384 - || (fmt == 17 && * valP - 8 + 262144 < 524288) - || (fmt == 22 && * valP - 8 + 8388608 < 16777216)) -#endif -#ifdef OBJ_SOM - && (* valP - 8 + 262144 < 524288 - || (fmt == 22 && * valP - 8 + 8388608 < 16777216)) -#endif - && !S_IS_EXTERNAL (fixP->fx_addsy) - && !S_IS_WEAK (fixP->fx_addsy) - && S_GET_SEGMENT (fixP->fx_addsy) == hppa_fixP->segment - && !(fixP->fx_subsy - && S_GET_SEGMENT (fixP->fx_subsy) != hppa_fixP->segment)) - { - new_val = hppa_field_adjust (* valP, 0, hppa_fixP->fx_r_field); - } - - switch (fmt) - { - case 10: - CHECK_FIELD_WHERE (new_val, 8191, -8192, - fixP->fx_file, fixP->fx_line); - val = new_val; - - insn = (insn & ~ 0x3ff1) | (((val & 0x1ff8) << 1) - | ((val & 0x2000) >> 13)); - break; - case -11: - CHECK_FIELD_WHERE (new_val, 8191, -8192, - fixP->fx_file, fixP->fx_line); - val = new_val; - - insn = (insn & ~ 0x3ff9) | (((val & 0x1ffc) << 1) - | ((val & 0x2000) >> 13)); - break; - /* Handle all opcodes with the 'j' operand type. */ - case 14: - CHECK_FIELD_WHERE (new_val, 8191, -8192, - fixP->fx_file, fixP->fx_line); - val = new_val; - - insn = ((insn & ~ 0x3fff) | low_sign_unext (val, 14)); - break; - - /* Handle all opcodes with the 'k' operand type. */ - case 21: - CHECK_FIELD_WHERE (new_val, 1048575, -1048576, - fixP->fx_file, fixP->fx_line); - val = new_val; - - insn = (insn & ~ 0x1fffff) | re_assemble_21 (val); - break; - - /* Handle all the opcodes with the 'i' operand type. */ - case 11: - CHECK_FIELD_WHERE (new_val, 1023, -1024, - fixP->fx_file, fixP->fx_line); - val = new_val; - - insn = (insn & ~ 0x7ff) | low_sign_unext (val, 11); - break; - - /* Handle all the opcodes with the 'w' operand type. */ - case 12: - CHECK_FIELD_WHERE (new_val - 8, 8191, -8192, - fixP->fx_file, fixP->fx_line); - val = new_val - 8; - - insn = (insn & ~ 0x1ffd) | re_assemble_12 (val >> 2); - break; - - /* Handle some of the opcodes with the 'W' operand type. */ - case 17: - { - offsetT distance = * valP; - - /* If this is an absolute branch (ie no link) with an out of - range target, then we want to complain. */ - if (fixP->fx_r_type == (int) R_HPPA_PCREL_CALL - && (insn & 0xffe00000) == 0xe8000000) - CHECK_FIELD_WHERE (distance - 8, 262143, -262144, - fixP->fx_file, fixP->fx_line); - - CHECK_FIELD_WHERE (new_val - 8, 262143, -262144, - fixP->fx_file, fixP->fx_line); - val = new_val - 8; - - insn = (insn & ~ 0x1f1ffd) | re_assemble_17 (val >> 2); - break; - } - - case 22: - { - offsetT distance = * valP; - - /* If this is an absolute branch (ie no link) with an out of - range target, then we want to complain. */ - if (fixP->fx_r_type == (int) R_HPPA_PCREL_CALL - && (insn & 0xffe00000) == 0xe8000000) - CHECK_FIELD_WHERE (distance - 8, 8388607, -8388608, - fixP->fx_file, fixP->fx_line); - - CHECK_FIELD_WHERE (new_val - 8, 8388607, -8388608, - fixP->fx_file, fixP->fx_line); - val = new_val - 8; - - insn = (insn & ~ 0x3ff1ffd) | re_assemble_22 (val >> 2); - break; - } - - case -10: - val = new_val; - insn = (insn & ~ 0xfff1) | re_assemble_16 (val & -8); - break; - - case -16: - val = new_val; - insn = (insn & ~ 0xfff9) | re_assemble_16 (val & -4); - break; - - case 16: - val = new_val; - insn = (insn & ~ 0xffff) | re_assemble_16 (val); - break; - - case 32: - insn = new_val; - break; - - default: - as_bad_where (fixP->fx_file, fixP->fx_line, - _("Unknown relocation encountered in md_apply_fix.")); - return; - } - - /* Insert the relocation. */ - bfd_put_32 (stdoutput, insn, fixpos); -} - -/* Exactly what point is a PC-relative offset relative TO? - On the PA, they're relative to the address of the offset. */ - -long -md_pcrel_from (fixP) - fixS *fixP; -{ - return fixP->fx_where + fixP->fx_frag->fr_address; -} - -/* Return nonzero if the input line pointer is at the end of - a statement. */ - -static int -is_end_of_statement () -{ - return ((*input_line_pointer == '\n') - || (*input_line_pointer == ';') - || (*input_line_pointer == '!')); -} - -/* Read a number from S. The number might come in one of many forms, - the most common will be a hex or decimal constant, but it could be - a pre-defined register (Yuk!), or an absolute symbol. - - Return 1 on success or 0 on failure. If STRICT, then a missing - register prefix will cause a failure. The number itself is - returned in `pa_number'. - - IS_FLOAT indicates that a PA-89 FP register number should be - parsed; A `l' or `r' suffix is checked for if but 2 of IS_FLOAT is - not set. - - pa_parse_number can not handle negative constants and will fail - horribly if it is passed such a constant. */ - -static int -pa_parse_number (s, is_float) - char **s; - int is_float; -{ - int num; - char *name; - char c; - symbolS *sym; - int status; - char *p = *s; - bfd_boolean have_prefix; - - /* Skip whitespace before the number. */ - while (*p == ' ' || *p == '\t') - p = p + 1; - - pa_number = -1; - have_prefix = 0; - num = 0; - if (!strict && ISDIGIT (*p)) - { - /* Looks like a number. */ - - if (*p == '0' && (*(p + 1) == 'x' || *(p + 1) == 'X')) - { - /* The number is specified in hex. */ - p += 2; - while (ISDIGIT (*p) || ((*p >= 'a') && (*p <= 'f')) - || ((*p >= 'A') && (*p <= 'F'))) - { - if (ISDIGIT (*p)) - num = num * 16 + *p - '0'; - else if (*p >= 'a' && *p <= 'f') - num = num * 16 + *p - 'a' + 10; - else - num = num * 16 + *p - 'A' + 10; - ++p; - } - } - else - { - /* The number is specified in decimal. */ - while (ISDIGIT (*p)) - { - num = num * 10 + *p - '0'; - ++p; - } - } - - pa_number = num; - - /* Check for a `l' or `r' suffix. */ - if (is_float) - { - pa_number += FP_REG_BASE; - if (! (is_float & 2)) - { - if (IS_R_SELECT (p)) + /* Also handle allocation of a fixup to hold the unwind + information when the label appears after the proc/procend. */ + if (within_entry_exit) { - pa_number += FP_REG_RSEL; - ++p; + char *where; + unsigned int u; + + where = frag_more (0); + u = UNWIND_LOW32 (&last_call_info->ci_unwind.descriptor); + fix_new_hppa (frag_now, where - frag_now->fr_literal, 0, + NULL, (offsetT) 0, NULL, + 0, R_HPPA_ENTRY, e_fsel, 0, 0, u); } - else if (IS_L_SELECT (p)) - { - ++p; - } - } - } - } - else if (*p == '%') - { - /* The number might be a predefined register. */ - have_prefix = 1; - name = p; - p++; - c = *p; - /* Tege hack: Special case for general registers as the general - code makes a binary search with case translation, and is VERY - slow. */ - if (c == 'r') - { - p++; - if (*p == 'e' && *(p + 1) == 't' - && (*(p + 2) == '0' || *(p + 2) == '1')) - { - p += 2; - num = *p - '0' + 28; - p++; - } - else if (*p == 'p') - { - num = 2; - p++; - } - else if (!ISDIGIT (*p)) - { - if (print_errors) - as_bad (_("Undefined register: '%s'."), name); - num = -1; - } - else - { - do - num = num * 10 + *p++ - '0'; - while (ISDIGIT (*p)); - } - } - else - { - /* Do a normal register search. */ - while (is_part_of_name (c)) - { - p = p + 1; - c = *p; - } - *p = 0; - status = reg_name_search (name); - if (status >= 0) - num = status; - else - { - if (print_errors) - as_bad (_("Undefined register: '%s'."), name); - num = -1; - } - *p = c; - } - - pa_number = num; - } - else - { - /* And finally, it could be a symbol in the absolute section which - is effectively a constant, or a register alias symbol. */ - name = p; - c = *p; - while (is_part_of_name (c)) - { - p = p + 1; - c = *p; - } - *p = 0; - if ((sym = symbol_find (name)) != NULL) - { - if (S_GET_SEGMENT (sym) == reg_section) - { - num = S_GET_VALUE (sym); - /* Well, we don't really have one, but we do have a - register, so... */ - have_prefix = TRUE; - } - else if (S_GET_SEGMENT (sym) == &bfd_abs_section) - num = S_GET_VALUE (sym); - else if (!strict) - { - if (print_errors) - as_bad (_("Non-absolute symbol: '%s'."), name); - num = -1; - } - } - else if (!strict) - { - /* There is where we'd come for an undefined symbol - or for an empty string. For an empty string we - will return zero. That's a concession made for - compatibility with the braindamaged HP assemblers. */ - if (*name == 0) - num = 0; - else - { - if (print_errors) - as_bad (_("Undefined absolute constant: '%s'."), name); - num = -1; - } - } - *p = c; - - pa_number = num; - } - - if (!strict || have_prefix) - { - *s = p; - return 1; - } - return 0; -} - -#define REG_NAME_CNT (sizeof (pre_defined_registers) / sizeof (struct pd_reg)) - -/* Given NAME, find the register number associated with that name, return - the integer value associated with the given name or -1 on failure. */ - -static int -reg_name_search (name) - char *name; -{ - int middle, low, high; - int cmp; - - low = 0; - high = REG_NAME_CNT - 1; - - do - { - middle = (low + high) / 2; - cmp = strcasecmp (name, pre_defined_registers[middle].name); - if (cmp < 0) - high = middle - 1; - else if (cmp > 0) - low = middle + 1; - else - return pre_defined_registers[middle].value; - } - while (low <= high); - - return -1; -} - -/* Return nonzero if the given INSN and L/R information will require - a new PA-1.1 opcode. */ - -static int -need_pa11_opcode () -{ - if ((pa_number & FP_REG_RSEL) != 0 - && !(the_insn.fpof1 == DBL && the_insn.fpof2 == DBL)) - { - /* If this instruction is specific to a particular architecture, - then set a new architecture. */ - if (bfd_get_mach (stdoutput) < pa11) - { - if (!bfd_set_arch_mach (stdoutput, bfd_arch_hppa, pa11)) - as_warn (_("could not update architecture and machine")); - } - return TRUE; - } - else - return FALSE; -} - -/* Parse a condition for a fcmp instruction. Return the numerical - code associated with the condition. */ - -static int -pa_parse_fp_cmp_cond (s) - char **s; -{ - int cond, i; - - cond = 0; - - for (i = 0; i < 32; i++) - { - if (strncasecmp (*s, fp_cond_map[i].string, - strlen (fp_cond_map[i].string)) == 0) - { - cond = fp_cond_map[i].cond; - *s += strlen (fp_cond_map[i].string); - /* If not a complete match, back up the input string and - report an error. */ - if (**s != ' ' && **s != '\t') - { - *s -= strlen (fp_cond_map[i].string); - break; - } - while (**s == ' ' || **s == '\t') - *s = *s + 1; - return cond; - } - } - - as_bad (_("Invalid FP Compare Condition: %s"), *s); - - /* Advance over the bogus completer. */ - while (**s != ',' && **s != ' ' && **s != '\t') - *s += 1; - - return 0; -} - -/* Parse a graphics test complete for ftest. */ - -static int -pa_parse_ftest_gfx_completer (s) - char **s; -{ - int value; - - value = 0; - if (strncasecmp (*s, "acc8", 4) == 0) - { - value = 5; - *s += 4; - } - else if (strncasecmp (*s, "acc6", 4) == 0) - { - value = 9; - *s += 4; - } - else if (strncasecmp (*s, "acc4", 4) == 0) - { - value = 13; - *s += 4; - } - else if (strncasecmp (*s, "acc2", 4) == 0) - { - value = 17; - *s += 4; - } - else if (strncasecmp (*s, "acc", 3) == 0) - { - value = 1; - *s += 3; - } - else if (strncasecmp (*s, "rej8", 4) == 0) - { - value = 6; - *s += 4; - } - else if (strncasecmp (*s, "rej", 3) == 0) - { - value = 2; - *s += 3; - } - else - { - value = 0; - as_bad (_("Invalid FTEST completer: %s"), *s); - } - - return value; -} - -/* Parse an FP operand format completer returning the completer - type. */ - -static fp_operand_format -pa_parse_fp_cnv_format (s) - char **s; -{ - int format; - - format = SGL; - if (**s == ',') - { - *s += 1; - if (strncasecmp (*s, "sgl", 3) == 0) - { - format = SGL; - *s += 4; - } - else if (strncasecmp (*s, "dbl", 3) == 0) - { - format = DBL; - *s += 4; - } - else if (strncasecmp (*s, "quad", 4) == 0) - { - format = QUAD; - *s += 5; - } - else if (strncasecmp (*s, "w", 1) == 0) - { - format = W; - *s += 2; - } - else if (strncasecmp (*s, "uw", 2) == 0) - { - format = UW; - *s += 3; - } - else if (strncasecmp (*s, "dw", 2) == 0) - { - format = DW; - *s += 3; - } - else if (strncasecmp (*s, "udw", 3) == 0) - { - format = UDW; - *s += 4; - } - else if (strncasecmp (*s, "qw", 2) == 0) - { - format = QW; - *s += 3; - } - else if (strncasecmp (*s, "uqw", 3) == 0) - { - format = UQW; - *s += 4; - } - else - { - format = ILLEGAL_FMT; - as_bad (_("Invalid FP Operand Format: %3s"), *s); - } - } - - return format; -} - -/* Parse an FP operand format completer returning the completer - type. */ - -static fp_operand_format -pa_parse_fp_format (s) - char **s; -{ - int format; - - format = SGL; - if (**s == ',') - { - *s += 1; - if (strncasecmp (*s, "sgl", 3) == 0) - { - format = SGL; - *s += 4; - } - else if (strncasecmp (*s, "dbl", 3) == 0) - { - format = DBL; - *s += 4; - } - else if (strncasecmp (*s, "quad", 4) == 0) - { - format = QUAD; - *s += 5; - } - else - { - format = ILLEGAL_FMT; - as_bad (_("Invalid FP Operand Format: %3s"), *s); - } - } - - return format; -} - -/* Convert from a selector string into a selector type. */ - -static int -pa_chk_field_selector (str) - char **str; -{ - int middle, low, high; - int cmp; - char name[4]; - - /* Read past any whitespace. */ - /* FIXME: should we read past newlines and formfeeds??? */ - while (**str == ' ' || **str == '\t' || **str == '\n' || **str == '\f') - *str = *str + 1; - - if ((*str)[1] == '\'' || (*str)[1] == '%') - name[0] = TOLOWER ((*str)[0]), - name[1] = 0; - else if ((*str)[2] == '\'' || (*str)[2] == '%') - name[0] = TOLOWER ((*str)[0]), - name[1] = TOLOWER ((*str)[1]), - name[2] = 0; - else if ((*str)[3] == '\'' || (*str)[3] == '%') - name[0] = TOLOWER ((*str)[0]), - name[1] = TOLOWER ((*str)[1]), - name[2] = TOLOWER ((*str)[2]), - name[3] = 0; - else - return e_fsel; - - low = 0; - high = sizeof (selector_table) / sizeof (struct selector_entry) - 1; - - do - { - middle = (low + high) / 2; - cmp = strcmp (name, selector_table[middle].prefix); - if (cmp < 0) - high = middle - 1; - else if (cmp > 0) - low = middle + 1; - else - { - *str += strlen (name) + 1; -#ifndef OBJ_SOM - if (selector_table[middle].field_selector == e_nsel) - return e_fsel; #endif - return selector_table[middle].field_selector; - } - } - while (low <= high); - - return e_fsel; -} - -/* Mark (via expr_end) the end of an expression (I think). FIXME. */ - -static int -get_expression (str) - char *str; -{ - char *save_in; - asection *seg; - - save_in = input_line_pointer; - input_line_pointer = str; - seg = expression (&the_insn.exp); - if (!(seg == absolute_section - || seg == undefined_section - || SEG_NORMAL (seg))) - { - as_warn (_("Bad segment in expression.")); - expr_end = input_line_pointer; - input_line_pointer = save_in; - return 1; - } - expr_end = input_line_pointer; - input_line_pointer = save_in; - return 0; -} - -/* Mark (via expr_end) the end of an absolute expression. FIXME. */ -static int -pa_get_absolute_expression (insn, strp) - struct pa_it *insn; - char **strp; -{ - char *save_in; - - insn->field_selector = pa_chk_field_selector (strp); - save_in = input_line_pointer; - input_line_pointer = *strp; - expression (&insn->exp); - /* This is not perfect, but is a huge improvement over doing nothing. - - The PA assembly syntax is ambiguous in a variety of ways. Consider - this string "4 %r5" Is that the number 4 followed by the register - r5, or is that 4 MOD r5? - - If we get a modulo expression when looking for an absolute, we try - again cutting off the input string at the first whitespace character. */ - if (insn->exp.X_op == O_modulus) - { - char *s, c; - int retval; - - input_line_pointer = *strp; - s = *strp; - while (*s != ',' && *s != ' ' && *s != '\t') - s++; - - c = *s; - *s = 0; - - retval = pa_get_absolute_expression (insn, strp); - - input_line_pointer = save_in; - *s = c; - return evaluate_absolute (insn); - } - /* When in strict mode we have a non-match, fix up the pointers - and return to our caller. */ - if (insn->exp.X_op != O_constant && strict) - { - expr_end = input_line_pointer; - input_line_pointer = save_in; - return 0; - } - if (insn->exp.X_op != O_constant) - { - as_bad (_("Bad segment (should be absolute).")); - expr_end = input_line_pointer; - input_line_pointer = save_in; - return 0; - } - expr_end = input_line_pointer; - input_line_pointer = save_in; - return evaluate_absolute (insn); -} - -/* Evaluate an absolute expression EXP which may be modified by - the selector FIELD_SELECTOR. Return the value of the expression. */ -static int -evaluate_absolute (insn) - struct pa_it *insn; -{ - offsetT value; - expressionS exp; - int field_selector = insn->field_selector; - - exp = insn->exp; - value = exp.X_add_number; - - return hppa_field_adjust (0, value, field_selector); -} - -/* Given an argument location specification return the associated - argument location number. */ - -static unsigned int -pa_build_arg_reloc (type_name) - char *type_name; -{ - - if (strncasecmp (type_name, "no", 2) == 0) - return 0; - if (strncasecmp (type_name, "gr", 2) == 0) - return 1; - else if (strncasecmp (type_name, "fr", 2) == 0) - return 2; - else if (strncasecmp (type_name, "fu", 2) == 0) - return 3; - else - as_bad (_("Invalid argument location: %s\n"), type_name); - - return 0; -} - -/* Encode and return an argument relocation specification for - the given register in the location specified by arg_reloc. */ - -static unsigned int -pa_align_arg_reloc (reg, arg_reloc) - unsigned int reg; - unsigned int arg_reloc; -{ - unsigned int new_reloc; - - new_reloc = arg_reloc; - switch (reg) - { - case 0: - new_reloc <<= 8; - break; - case 1: - new_reloc <<= 6; - break; - case 2: - new_reloc <<= 4; - break; - case 3: - new_reloc <<= 2; - break; - default: - as_bad (_("Invalid argument description: %d"), reg); - } - - return new_reloc; -} - -/* Parse a PA nullification completer (,n). Return nonzero if the - completer was found; return zero if no completer was found. */ - -static int -pa_parse_nullif (s) - char **s; -{ - int nullif; - - nullif = 0; - if (**s == ',') - { - *s = *s + 1; - if (strncasecmp (*s, "n", 1) == 0) - nullif = 1; - else - { - as_bad (_("Invalid Nullification: (%c)"), **s); - nullif = 0; - } - *s = *s + 1; - } - - return nullif; -} - -/* Parse a non-negated compare/subtract completer returning the - number (for encoding in instructions) of the given completer. */ - -static int -pa_parse_nonneg_cmpsub_cmpltr (s) - char **s; -{ - int cmpltr; - char *name = *s + 1; - char c; - char *save_s = *s; - int nullify = 0; - - cmpltr = 0; - if (**s == ',') - { - *s += 1; - while (**s != ',' && **s != ' ' && **s != '\t') - *s += 1; - c = **s; - **s = 0x00; - - if (strcmp (name, "=") == 0) - { - cmpltr = 1; - } - else if (strcmp (name, "<") == 0) - { - cmpltr = 2; - } - else if (strcmp (name, "<=") == 0) - { - cmpltr = 3; - } - else if (strcmp (name, "<<") == 0) - { - cmpltr = 4; - } - else if (strcmp (name, "<<=") == 0) - { - cmpltr = 5; - } - else if (strcasecmp (name, "sv") == 0) - { - cmpltr = 6; - } - else if (strcasecmp (name, "od") == 0) - { - cmpltr = 7; - } - /* If we have something like addb,n then there is no condition - completer. */ - else if (strcasecmp (name, "n") == 0) - { - cmpltr = 0; - nullify = 1; + } + else + as_bad (_("Missing function name for .PROC (corrupted label chain)")); } else - { - cmpltr = -1; - } - **s = c; + as_bad (_("Missing function name for .PROC")); } - /* Reset pointers if this was really a ,n for a branch instruction. */ - if (nullify) - *s = save_s; + /* Assemble the instruction. Results are saved into "the_insn". */ + pa_ip (str); - return cmpltr; -} + /* Get somewhere to put the assembled instruction. */ + to = frag_more (4); -/* Parse a negated compare/subtract completer returning the - number (for encoding in instructions) of the given completer. */ + /* Output the opcode. */ + md_number_to_chars (to, the_insn.opcode, 4); -static int -pa_parse_neg_cmpsub_cmpltr (s) - char **s; -{ - int cmpltr; - char *name = *s + 1; - char c; - char *save_s = *s; - int nullify = 0; + /* If necessary output more stuff. */ + if (the_insn.reloc != R_HPPA_NONE) + fix_new_hppa (frag_now, (to - frag_now->fr_literal), 4, NULL, + (offsetT) 0, &the_insn.exp, the_insn.pcrel, + the_insn.reloc, the_insn.field_selector, + the_insn.format, the_insn.arg_reloc, 0); - cmpltr = 0; - if (**s == ',') - { - *s += 1; - while (**s != ',' && **s != ' ' && **s != '\t') - *s += 1; - c = **s; - **s = 0x00; - - if (strcasecmp (name, "tr") == 0) - { - cmpltr = 0; - } - else if (strcmp (name, "<>") == 0) - { - cmpltr = 1; - } - else if (strcmp (name, ">=") == 0) - { - cmpltr = 2; - } - else if (strcmp (name, ">") == 0) - { - cmpltr = 3; - } - else if (strcmp (name, ">>=") == 0) - { - cmpltr = 4; - } - else if (strcmp (name, ">>") == 0) - { - cmpltr = 5; - } - else if (strcasecmp (name, "nsv") == 0) - { - cmpltr = 6; - } - else if (strcasecmp (name, "ev") == 0) - { - cmpltr = 7; - } - /* If we have something like addb,n then there is no condition - completer. */ - else if (strcasecmp (name, "n") == 0) - { - cmpltr = 0; - nullify = 1; - } - else - { - cmpltr = -1; - } - **s = c; - } - - /* Reset pointers if this was really a ,n for a branch instruction. */ - if (nullify) - *s = save_s; - - return cmpltr; -} - -/* Parse a 64 bit compare and branch completer returning the number (for - encoding in instructions) of the given completer. - - Nonnegated comparisons are returned as 0-7, negated comparisons are - returned as 8-15. */ - -static int -pa_parse_cmpb_64_cmpltr (s) - char **s; -{ - int cmpltr; - char *name = *s + 1; - char c; - - cmpltr = -1; - if (**s == ',') - { - *s += 1; - while (**s != ',' && **s != ' ' && **s != '\t') - *s += 1; - c = **s; - **s = 0x00; - - if (strcmp (name, "*") == 0) - { - cmpltr = 0; - } - else if (strcmp (name, "*=") == 0) - { - cmpltr = 1; - } - else if (strcmp (name, "*<") == 0) - { - cmpltr = 2; - } - else if (strcmp (name, "*<=") == 0) - { - cmpltr = 3; - } - else if (strcmp (name, "*<<") == 0) - { - cmpltr = 4; - } - else if (strcmp (name, "*<<=") == 0) - { - cmpltr = 5; - } - else if (strcasecmp (name, "*sv") == 0) - { - cmpltr = 6; - } - else if (strcasecmp (name, "*od") == 0) - { - cmpltr = 7; - } - else if (strcasecmp (name, "*tr") == 0) - { - cmpltr = 8; - } - else if (strcmp (name, "*<>") == 0) - { - cmpltr = 9; - } - else if (strcmp (name, "*>=") == 0) - { - cmpltr = 10; - } - else if (strcmp (name, "*>") == 0) - { - cmpltr = 11; - } - else if (strcmp (name, "*>>=") == 0) - { - cmpltr = 12; - } - else if (strcmp (name, "*>>") == 0) - { - cmpltr = 13; - } - else if (strcasecmp (name, "*nsv") == 0) - { - cmpltr = 14; - } - else if (strcasecmp (name, "*ev") == 0) - { - cmpltr = 15; - } - else - { - cmpltr = -1; - } - **s = c; - } - - return cmpltr; -} - -/* Parse a 64 bit compare immediate and branch completer returning the number - (for encoding in instructions) of the given completer. */ - -static int -pa_parse_cmpib_64_cmpltr (s) - char **s; -{ - int cmpltr; - char *name = *s + 1; - char c; - - cmpltr = -1; - if (**s == ',') - { - *s += 1; - while (**s != ',' && **s != ' ' && **s != '\t') - *s += 1; - c = **s; - **s = 0x00; - - if (strcmp (name, "*<<") == 0) - { - cmpltr = 0; - } - else if (strcmp (name, "*=") == 0) - { - cmpltr = 1; - } - else if (strcmp (name, "*<") == 0) - { - cmpltr = 2; - } - else if (strcmp (name, "*<=") == 0) - { - cmpltr = 3; - } - else if (strcmp (name, "*>>=") == 0) - { - cmpltr = 4; - } - else if (strcmp (name, "*<>") == 0) - { - cmpltr = 5; - } - else if (strcasecmp (name, "*>=") == 0) - { - cmpltr = 6; - } - else if (strcasecmp (name, "*>") == 0) - { - cmpltr = 7; - } - else - { - cmpltr = -1; - } - **s = c; - } - - return cmpltr; -} - -/* Parse a non-negated addition completer returning the number - (for encoding in instructions) of the given completer. */ - -static int -pa_parse_nonneg_add_cmpltr (s) - char **s; -{ - int cmpltr; - char *name = *s + 1; - char c; - char *save_s = *s; - int nullify = 0; - - cmpltr = 0; - if (**s == ',') - { - *s += 1; - while (**s != ',' && **s != ' ' && **s != '\t') - *s += 1; - c = **s; - **s = 0x00; - if (strcmp (name, "=") == 0) - { - cmpltr = 1; - } - else if (strcmp (name, "<") == 0) - { - cmpltr = 2; - } - else if (strcmp (name, "<=") == 0) - { - cmpltr = 3; - } - else if (strcasecmp (name, "nuv") == 0) - { - cmpltr = 4; - } - else if (strcasecmp (name, "znv") == 0) - { - cmpltr = 5; - } - else if (strcasecmp (name, "sv") == 0) - { - cmpltr = 6; - } - else if (strcasecmp (name, "od") == 0) - { - cmpltr = 7; - } - /* If we have something like addb,n then there is no condition - completer. */ - else if (strcasecmp (name, "n") == 0) - { - cmpltr = 0; - nullify = 1; - } - else - { - cmpltr = -1; - } - **s = c; - } - - /* Reset pointers if this was really a ,n for a branch instruction. */ - if (nullify) - *s = save_s; - - return cmpltr; -} - -/* Parse a negated addition completer returning the number - (for encoding in instructions) of the given completer. */ - -static int -pa_parse_neg_add_cmpltr (s) - char **s; -{ - int cmpltr; - char *name = *s + 1; - char c; - char *save_s = *s; - int nullify = 0; - - cmpltr = 0; - if (**s == ',') - { - *s += 1; - while (**s != ',' && **s != ' ' && **s != '\t') - *s += 1; - c = **s; - **s = 0x00; - if (strcasecmp (name, "tr") == 0) - { - cmpltr = 0; - } - else if (strcmp (name, "<>") == 0) - { - cmpltr = 1; - } - else if (strcmp (name, ">=") == 0) - { - cmpltr = 2; - } - else if (strcmp (name, ">") == 0) - { - cmpltr = 3; - } - else if (strcasecmp (name, "uv") == 0) - { - cmpltr = 4; - } - else if (strcasecmp (name, "vnz") == 0) - { - cmpltr = 5; - } - else if (strcasecmp (name, "nsv") == 0) - { - cmpltr = 6; - } - else if (strcasecmp (name, "ev") == 0) - { - cmpltr = 7; - } - /* If we have something like addb,n then there is no condition - completer. */ - else if (strcasecmp (name, "n") == 0) - { - cmpltr = 0; - nullify = 1; - } - else - { - cmpltr = -1; - } - **s = c; - } - - /* Reset pointers if this was really a ,n for a branch instruction. */ - if (nullify) - *s = save_s; - - return cmpltr; -} - -/* Parse a 64 bit wide mode add and branch completer returning the number (for - encoding in instructions) of the given completer. */ - -static int -pa_parse_addb_64_cmpltr (s) - char **s; -{ - int cmpltr; - char *name = *s + 1; - char c; - char *save_s = *s; - int nullify = 0; - - cmpltr = 0; - if (**s == ',') - { - *s += 1; - while (**s != ',' && **s != ' ' && **s != '\t') - *s += 1; - c = **s; - **s = 0x00; - if (strcmp (name, "=") == 0) - { - cmpltr = 1; - } - else if (strcmp (name, "<") == 0) - { - cmpltr = 2; - } - else if (strcmp (name, "<=") == 0) - { - cmpltr = 3; - } - else if (strcasecmp (name, "nuv") == 0) - { - cmpltr = 4; - } - else if (strcasecmp (name, "*=") == 0) - { - cmpltr = 5; - } - else if (strcasecmp (name, "*<") == 0) - { - cmpltr = 6; - } - else if (strcasecmp (name, "*<=") == 0) - { - cmpltr = 7; - } - else if (strcmp (name, "tr") == 0) - { - cmpltr = 8; - } - else if (strcmp (name, "<>") == 0) - { - cmpltr = 9; - } - else if (strcmp (name, ">=") == 0) - { - cmpltr = 10; - } - else if (strcmp (name, ">") == 0) - { - cmpltr = 11; - } - else if (strcasecmp (name, "uv") == 0) - { - cmpltr = 12; - } - else if (strcasecmp (name, "*<>") == 0) - { - cmpltr = 13; - } - else if (strcasecmp (name, "*>=") == 0) - { - cmpltr = 14; - } - else if (strcasecmp (name, "*>") == 0) - { - cmpltr = 15; - } - /* If we have something like addb,n then there is no condition - completer. */ - else if (strcasecmp (name, "n") == 0) - { - cmpltr = 0; - nullify = 1; - } - else - { - cmpltr = -1; - } - **s = c; - } - - /* Reset pointers if this was really a ,n for a branch instruction. */ - if (nullify) - *s = save_s; - - return cmpltr; +#ifdef OBJ_ELF + dwarf2_emit_insn (4); +#endif } #ifdef OBJ_SOM /* Handle an alignment directive. Special so that we can update the alignment of the subspace if necessary. */ static void -pa_align (bytes) - int bytes; +pa_align (int bytes) { /* We must have a valid space and subspace. */ pa_check_current_space_and_subspace (); @@ -5950,8 +5815,7 @@ pa_align (bytes) /* Handle a .BLOCK type pseudo-op. */ static void -pa_block (z) - int z ATTRIBUTE_UNUSED; +pa_block (int z ATTRIBUTE_UNUSED) { unsigned int temp_size; @@ -5981,8 +5845,7 @@ pa_block (z) /* Handle a .begin_brtab and .end_brtab pseudo-op. */ static void -pa_brtab (begin) - int begin ATTRIBUTE_UNUSED; +pa_brtab (int begin ATTRIBUTE_UNUSED) { #ifdef OBJ_SOM @@ -6002,8 +5865,7 @@ pa_brtab (begin) /* Handle a .begin_try and .end_try pseudo-op. */ static void -pa_try (begin) - int begin ATTRIBUTE_UNUSED; +pa_try (int begin ATTRIBUTE_UNUSED) { #ifdef OBJ_SOM expressionS exp; @@ -6024,29 +5886,11 @@ pa_try (begin) demand_empty_rest_of_line (); } -/* Handle a .CALL pseudo-op. This involves storing away information - about where arguments are to be found so the linker can detect - (and correct) argument location mismatches between caller and callee. */ - -static void -pa_call (unused) - int unused ATTRIBUTE_UNUSED; -{ -#ifdef OBJ_SOM - /* We must have a valid space and subspace. */ - pa_check_current_space_and_subspace (); -#endif - - pa_call_args (&last_call_desc); - demand_empty_rest_of_line (); -} - /* Do the dirty work of building a call descriptor which describes where the caller placed arguments to a function call. */ static void -pa_call_args (call_desc) - struct call_desc *call_desc; +pa_call_args (struct call_desc *call_desc) { char *name, c, *p; unsigned int temp, arg_reloc; @@ -6089,24 +5933,38 @@ pa_call_args (call_desc) } } +/* Handle a .CALL pseudo-op. This involves storing away information + about where arguments are to be found so the linker can detect + (and correct) argument location mismatches between caller and callee. */ + +static void +pa_call (int unused ATTRIBUTE_UNUSED) +{ +#ifdef OBJ_SOM + /* We must have a valid space and subspace. */ + pa_check_current_space_and_subspace (); +#endif + + pa_call_args (&last_call_desc); + demand_empty_rest_of_line (); +} + /* Return TRUE if FRAG1 and FRAG2 are the same. */ -static int -is_same_frag (frag1, frag2) - fragS *frag1; - fragS *frag2; +static bfd_boolean +is_same_frag (fragS *frag1, fragS *frag2) { if (frag1 == NULL) - return (FALSE); + return FALSE; else if (frag2 == NULL) - return (FALSE); + return FALSE; else if (frag1 == frag2) - return (TRUE); + return TRUE; else if (frag2->fr_type == rs_fill && frag2->fr_fix == 0) return (is_same_frag (frag1, frag2->fr_next)); else - return (FALSE); + return FALSE; } #ifdef OBJ_ELF @@ -6116,8 +5974,7 @@ is_same_frag (frag1, frag2) of the unwind spaces. */ static void -pa_build_unwind_subspace (call_info) - struct call_info *call_info; +pa_build_unwind_subspace (struct call_info *call_info) { asection *seg, *save_seg; subsegT save_subseg; @@ -6189,8 +6046,7 @@ pa_build_unwind_subspace (call_info) .ENTER and .LEAVE. */ static void -pa_callinfo (unused) - int unused ATTRIBUTE_UNUSED; +pa_callinfo (int unused ATTRIBUTE_UNUSED) { char *name, c, *p; int temp; @@ -6332,9 +6188,9 @@ pa_callinfo (unused) #if !(defined (OBJ_ELF) && (defined (TE_LINUX) || defined (TE_NetBSD))) /* Switch to the text space. Like s_text, but delete our label when finished. */ + static void -pa_text (unused) - int unused ATTRIBUTE_UNUSED; +pa_text (int unused ATTRIBUTE_UNUSED) { #ifdef OBJ_SOM current_space = is_defined_space ("$TEXT$"); @@ -6347,9 +6203,9 @@ pa_text (unused) } /* Switch to the data space. As usual delete our label. */ + static void -pa_data (unused) - int unused ATTRIBUTE_UNUSED; +pa_data (int unused ATTRIBUTE_UNUSED) { #ifdef OBJ_SOM current_space = is_defined_space ("$PRIVATE$"); @@ -6381,8 +6237,7 @@ pa_data (unused) This also makes error detection all but impossible. */ static void -pa_comm (unused) - int unused ATTRIBUTE_UNUSED; +pa_comm (int unused ATTRIBUTE_UNUSED) { unsigned int size; symbolS *symbol; @@ -6415,16 +6270,15 @@ pa_comm (unused) /* Process a .END pseudo-op. */ static void -pa_end (unused) - int unused ATTRIBUTE_UNUSED; +pa_end (int unused ATTRIBUTE_UNUSED) { demand_empty_rest_of_line (); } /* Process a .ENTER pseudo-op. This is not supported. */ + static void -pa_enter (unused) - int unused ATTRIBUTE_UNUSED; +pa_enter (int unused ATTRIBUTE_UNUSED) { #ifdef OBJ_SOM /* We must have a valid space and subspace. */ @@ -6437,9 +6291,9 @@ pa_enter (unused) /* Process a .ENTRY pseudo-op. .ENTRY marks the beginning of the procedure. */ + static void -pa_entry (unused) - int unused ATTRIBUTE_UNUSED; +pa_entry (int unused ATTRIBUTE_UNUSED) { #ifdef OBJ_SOM /* We must have a valid space and subspace. */ @@ -6486,10 +6340,9 @@ pa_entry (unused) static int fudge_reg_expressions; int -hppa_force_reg_syms_absolute (resultP, op, rightP) - expressionS *resultP; - operatorT op ATTRIBUTE_UNUSED; - expressionS *rightP; +hppa_force_reg_syms_absolute (expressionS *resultP, + operatorT op ATTRIBUTE_UNUSED, + expressionS *rightP) { if (fudge_reg_expressions && rightP->X_op == O_register @@ -6504,8 +6357,7 @@ hppa_force_reg_syms_absolute (resultP, op, rightP) /* Handle a .EQU pseudo-op. */ static void -pa_equ (reg) - int reg; +pa_equ (int reg) { label_symbol_struct *label_symbol = pa_get_label (); symbolS *symbol; @@ -6553,12 +6405,75 @@ pa_equ (reg) demand_empty_rest_of_line (); } +#ifdef OBJ_ELF +/* Mark the end of a function so that it's possible to compute + the size of the function in elf_hppa_final_processing. */ + +static void +hppa_elf_mark_end_of_function (void) +{ + /* ELF does not have EXIT relocations. All we do is create a + temporary symbol marking the end of the function. */ + char *name; + + if (last_call_info == NULL || last_call_info->start_symbol == NULL) + { + /* We have already warned about a missing label, + or other problems. */ + return; + } + + name = xmalloc (strlen ("L$\001end_") + + strlen (S_GET_NAME (last_call_info->start_symbol)) + + 1); + if (name) + { + symbolS *symbolP; + + strcpy (name, "L$\001end_"); + strcat (name, S_GET_NAME (last_call_info->start_symbol)); + + /* If we have a .exit followed by a .procend, then the + symbol will have already been defined. */ + symbolP = symbol_find (name); + if (symbolP) + { + /* The symbol has already been defined! This can + happen if we have a .exit followed by a .procend. + + This is *not* an error. All we want to do is free + the memory we just allocated for the name and continue. */ + xfree (name); + } + else + { + /* symbol value should be the offset of the + last instruction of the function */ + symbolP = symbol_new (name, now_seg, (valueT) (frag_now_fix () - 4), + frag_now); + + assert (symbolP); + S_CLEAR_EXTERNAL (symbolP); + symbol_table_insert (symbolP); + } + + if (symbolP) + last_call_info->end_symbol = symbolP; + else + as_bad (_("Symbol '%s' could not be created."), name); + + } + else + as_bad (_("No memory for symbol name.")); +} +#endif + /* Helper function. Does processing for the end of a function. This usually involves creating some relocations or building special symbols to mark the end of the function. */ static void -process_exit () +process_exit (void) { char *where; @@ -6590,8 +6505,7 @@ process_exit () /* Process a .EXIT pseudo-op. */ static void -pa_exit (unused) - int unused ATTRIBUTE_UNUSED; +pa_exit (int unused ATTRIBUTE_UNUSED) { #ifdef OBJ_SOM /* We must have a valid space and subspace. */ @@ -6618,54 +6532,10 @@ pa_exit (unused) demand_empty_rest_of_line (); } -/* Process a .EXPORT directive. This makes functions external - and provides information such as argument relocation entries - to callers. */ - -static void -pa_export (unused) - int unused ATTRIBUTE_UNUSED; -{ - char *name, c, *p; - symbolS *symbol; - - name = input_line_pointer; - c = get_symbol_end (); - /* Make sure the given symbol exists. */ - if ((symbol = symbol_find_or_make (name)) == NULL) - { - as_bad (_("Cannot define export symbol: %s\n"), name); - p = input_line_pointer; - *p = c; - input_line_pointer++; - } - else - { - /* OK. Set the external bits and process argument relocations. - For the HP, weak and global are not mutually exclusive. - S_SET_EXTERNAL will not set BSF_GLOBAL if WEAK is set. - Call S_SET_EXTERNAL to get the other processing. Manually - set BSF_GLOBAL when we get back. */ - S_SET_EXTERNAL (symbol); - symbol_get_bfdsym (symbol)->flags |= BSF_GLOBAL; - p = input_line_pointer; - *p = c; - if (!is_end_of_statement ()) - { - input_line_pointer++; - pa_type_args (symbol, 1); - } - } - - demand_empty_rest_of_line (); -} - /* Helper function to process arguments to a .EXPORT pseudo-op. */ static void -pa_type_args (symbolP, is_export) - symbolS *symbolP; - int is_export; +pa_type_args (symbolS *symbolP, int is_export) { char *name, c, *p; unsigned int temp, arg_reloc; @@ -6673,7 +6543,6 @@ pa_type_args (symbolP, is_export) asymbol *bfdsym = symbol_get_bfdsym (symbolP); if (strncasecmp (input_line_pointer, "absolute", 8) == 0) - { input_line_pointer += 8; bfdsym->flags &= ~BSF_FUNCTION; @@ -6818,13 +6687,53 @@ pa_type_args (symbolP, is_export) } } +/* Process a .EXPORT directive. This makes functions external + and provides information such as argument relocation entries + to callers. */ + +static void +pa_export (int unused ATTRIBUTE_UNUSED) +{ + char *name, c, *p; + symbolS *symbol; + + name = input_line_pointer; + c = get_symbol_end (); + /* Make sure the given symbol exists. */ + if ((symbol = symbol_find_or_make (name)) == NULL) + { + as_bad (_("Cannot define export symbol: %s\n"), name); + p = input_line_pointer; + *p = c; + input_line_pointer++; + } + else + { + /* OK. Set the external bits and process argument relocations. + For the HP, weak and global are not mutually exclusive. + S_SET_EXTERNAL will not set BSF_GLOBAL if WEAK is set. + Call S_SET_EXTERNAL to get the other processing. Manually + set BSF_GLOBAL when we get back. */ + S_SET_EXTERNAL (symbol); + symbol_get_bfdsym (symbol)->flags |= BSF_GLOBAL; + p = input_line_pointer; + *p = c; + if (!is_end_of_statement ()) + { + input_line_pointer++; + pa_type_args (symbol, 1); + } + } + + demand_empty_rest_of_line (); +} + /* Handle an .IMPORT pseudo-op. Any symbol referenced in a given assembly file must either be defined in the assembly file, or explicitly IMPORTED from another. */ static void -pa_import (unused) - int unused ATTRIBUTE_UNUSED; +pa_import (int unused ATTRIBUTE_UNUSED) { char *name, c, *p; symbolS *symbol; @@ -6875,8 +6784,7 @@ pa_import (unused) /* Handle a .LABEL pseudo-op. */ static void -pa_label (unused) - int unused ATTRIBUTE_UNUSED; +pa_label (int unused ATTRIBUTE_UNUSED) { char *name, c, *p; @@ -6905,8 +6813,7 @@ pa_label (unused) /* Handle a .LEAVE pseudo-op. This is not supported yet. */ static void -pa_leave (unused) - int unused ATTRIBUTE_UNUSED; +pa_leave (int unused ATTRIBUTE_UNUSED) { #ifdef OBJ_SOM /* We must have a valid space and subspace. */ @@ -6920,8 +6827,7 @@ pa_leave (unused) /* Handle a .LEVEL pseudo-op. */ static void -pa_level (unused) - int unused ATTRIBUTE_UNUSED; +pa_level (int unused ATTRIBUTE_UNUSED) { char *level; @@ -6961,8 +6867,7 @@ pa_level (unused) /* Handle a .ORIGIN pseudo-op. */ static void -pa_origin (unused) - int unused ATTRIBUTE_UNUSED; +pa_origin (int unused ATTRIBUTE_UNUSED) { #ifdef OBJ_SOM /* We must have a valid space and subspace. */ @@ -6977,8 +6882,7 @@ pa_origin (unused) is for static functions. FIXME. Should share more code with .EXPORT. */ static void -pa_param (unused) - int unused ATTRIBUTE_UNUSED; +pa_param (int unused ATTRIBUTE_UNUSED) { char *name, c, *p; symbolS *symbol; @@ -7012,8 +6916,7 @@ pa_param (unused) of a procedure from a syntactical point of view. */ static void -pa_proc (unused) - int unused ATTRIBUTE_UNUSED; +pa_proc (int unused ATTRIBUTE_UNUSED) { struct call_info *call_info; @@ -7030,7 +6933,7 @@ pa_proc (unused) within_procedure = TRUE; /* Create another call_info structure. */ - call_info = (struct call_info *) xmalloc (sizeof (struct call_info)); + call_info = xmalloc (sizeof (struct call_info)); if (!call_info) as_fatal (_("Cannot allocate unwind descriptor\n")); @@ -7082,10 +6985,8 @@ pa_proc (unused) appropriate pseudo-ops were found within the procedure. */ static void -pa_procend (unused) - int unused ATTRIBUTE_UNUSED; +pa_procend (int unused ATTRIBUTE_UNUSED) { - #ifdef OBJ_SOM /* We must have a valid space and subspace. */ pa_check_current_space_and_subspace (); @@ -7157,8 +7058,7 @@ pa_procend (unused) return log2 (VALUE). Else return -1. */ static int -exact_log2 (value) - int value; +exact_log2 (int value) { int shift = 0; @@ -7174,7 +7074,7 @@ exact_log2 (value) /* Check to make sure we have a valid space and subspace. */ static void -pa_check_current_space_and_subspace () +pa_check_current_space_and_subspace (void) { if (current_space == NULL) as_fatal (_("Not in a space.\n")); @@ -7188,9 +7088,7 @@ pa_check_current_space_and_subspace () by the parameters to the .SPACE directive. */ static sd_chain_struct * -pa_parse_space_stmt (space_name, create_flag) - char *space_name; - int create_flag; +pa_parse_space_stmt (char *space_name, int create_flag) { char *name, *ptemp, c; char loadable, defined, private, sort; @@ -7198,7 +7096,7 @@ pa_parse_space_stmt (space_name, create_flag) asection *seg = NULL; sd_chain_struct *space; - /* load default values */ + /* Load default values. */ spnum = 0; sort = 0; loadable = TRUE; @@ -7310,8 +7208,7 @@ pa_parse_space_stmt (space_name, create_flag) given space, creating the new space if necessary. */ static void -pa_space (unused) - int unused ATTRIBUTE_UNUSED; +pa_space (int unused ATTRIBUTE_UNUSED) { char *name, c, *space_name, *save_s; sd_chain_struct *sd_chain; @@ -7430,8 +7327,7 @@ pa_space (unused) /* Switch to a new space. (I think). FIXME. */ static void -pa_spnum (unused) - int unused ATTRIBUTE_UNUSED; +pa_spnum (int unused ATTRIBUTE_UNUSED) { char *name; char c; @@ -7460,8 +7356,7 @@ pa_spnum (unused) they're broken up into subroutines. */ static void -pa_subspace (create_new) - int create_new; +pa_subspace (int create_new) { char *name, *ss_name, c; char loadable, code_only, comdat, common, dup_common, zero, sort; @@ -7699,7 +7594,7 @@ pa_subspace (create_new) /* Create default space and subspace dictionaries. */ static void -pa_spaces_begin () +pa_spaces_begin (void) { int i; @@ -7826,25 +7721,23 @@ pa_spaces_begin () by the given parameters. */ static sd_chain_struct * -create_new_space (name, spnum, loadable, defined, private, - sort, seg, user_defined) - char *name; - int spnum; - int loadable ATTRIBUTE_UNUSED; - int defined; - int private; - int sort; - asection *seg; - int user_defined; +create_new_space (char *name, + int spnum, + int loadable ATTRIBUTE_UNUSED, + int defined, + int private, + int sort, + asection *seg, + int user_defined) { sd_chain_struct *chain_entry; - chain_entry = (sd_chain_struct *) xmalloc (sizeof (sd_chain_struct)); + chain_entry = xmalloc (sizeof (sd_chain_struct)); if (!chain_entry) as_fatal (_("Out of memory: could not allocate new space chain entry: %s\n"), name); - SPACE_NAME (chain_entry) = (char *) xmalloc (strlen (name) + 1); + SPACE_NAME (chain_entry) = xmalloc (strlen (name) + 1); strcpy (SPACE_NAME (chain_entry), name); SPACE_DEFINED (chain_entry) = defined; SPACE_USER_DEFINED (chain_entry) = user_defined; @@ -7910,29 +7803,28 @@ create_new_space (name, spnum, loadable, defined, private, order as defined by the SORT entries. */ static ssd_chain_struct * -create_new_subspace (space, name, loadable, code_only, comdat, common, - dup_common, is_zero, sort, access, space_index, - alignment, quadrant, seg) - sd_chain_struct *space; - char *name; - int loadable ATTRIBUTE_UNUSED; - int code_only ATTRIBUTE_UNUSED; - int comdat, common, dup_common; - int is_zero ATTRIBUTE_UNUSED; - int sort; - int access; - int space_index ATTRIBUTE_UNUSED; - int alignment ATTRIBUTE_UNUSED; - int quadrant; - asection *seg; +create_new_subspace (sd_chain_struct *space, + char *name, + int loadable ATTRIBUTE_UNUSED, + int code_only ATTRIBUTE_UNUSED, + int comdat, + int common, + int dup_common, + int is_zero ATTRIBUTE_UNUSED, + int sort, + int access, + int space_index ATTRIBUTE_UNUSED, + int alignment ATTRIBUTE_UNUSED, + int quadrant, + asection *seg) { ssd_chain_struct *chain_entry; - chain_entry = (ssd_chain_struct *) xmalloc (sizeof (ssd_chain_struct)); + chain_entry = xmalloc (sizeof (ssd_chain_struct)); if (!chain_entry) as_fatal (_("Out of memory: could not allocate new subspace chain entry: %s\n"), name); - SUBSPACE_NAME (chain_entry) = (char *) xmalloc (strlen (name) + 1); + SUBSPACE_NAME (chain_entry) = xmalloc (strlen (name) + 1); strcpy (SUBSPACE_NAME (chain_entry), name); /* Initialize subspace_defined. When we hit a .subspace directive @@ -7986,22 +7878,20 @@ create_new_subspace (space, name, loadable, code_only, comdat, common, various arguments. Return the modified subspace chain entry. */ static ssd_chain_struct * -update_subspace (space, name, loadable, code_only, comdat, common, dup_common, - sort, zero, access, space_index, alignment, quadrant, section) - sd_chain_struct *space; - char *name; - int loadable ATTRIBUTE_UNUSED; - int code_only ATTRIBUTE_UNUSED; - int comdat; - int common; - int dup_common; - int zero ATTRIBUTE_UNUSED; - int sort; - int access; - int space_index ATTRIBUTE_UNUSED; - int alignment ATTRIBUTE_UNUSED; - int quadrant; - asection *section; +update_subspace (sd_chain_struct *space, + char *name, + int loadable ATTRIBUTE_UNUSED, + int code_only ATTRIBUTE_UNUSED, + int comdat, + int common, + int dup_common, + int sort, + int zero ATTRIBUTE_UNUSED, + int access, + int space_index ATTRIBUTE_UNUSED, + int alignment ATTRIBUTE_UNUSED, + int quadrant, + asection *section) { ssd_chain_struct *chain_entry; @@ -8019,18 +7909,15 @@ update_subspace (space, name, loadable, code_only, comdat, common, dup_common, NULL if no such space exists. */ static sd_chain_struct * -is_defined_space (name) - char *name; +is_defined_space (char *name) { sd_chain_struct *chain_pointer; for (chain_pointer = space_dict_root; chain_pointer; chain_pointer = chain_pointer->sd_next) - { - if (strcmp (SPACE_NAME (chain_pointer), name) == 0) - return chain_pointer; - } + if (strcmp (SPACE_NAME (chain_pointer), name) == 0) + return chain_pointer; /* No mapping from segment to space was found. Return NULL. */ return NULL; @@ -8043,8 +7930,7 @@ is_defined_space (name) so a linear exhaustive search is OK here. */ static sd_chain_struct * -pa_segment_to_space (seg) - asection *seg; +pa_segment_to_space (asection *seg) { sd_chain_struct *space_chain; @@ -8052,10 +7938,8 @@ pa_segment_to_space (seg) for (space_chain = space_dict_root; space_chain; space_chain = space_chain->sd_next) - { - if (space_chain->sd_seg == seg) - return space_chain; - } + if (space_chain->sd_seg == seg) + return space_chain; /* Mapping was not found. Return NULL. */ return NULL; @@ -8068,14 +7952,13 @@ pa_segment_to_space (seg) the first (i.e., default) subspace is preferable in most situations. For example, it wouldn't be desirable to merge COMDAT data with non COMDAT data. - + Uses a linear search through all the spaces and subspaces, this may not be appropriate if we ever being placing each function in its own subspace. */ static ssd_chain_struct * -is_defined_subspace (name) - char *name; +is_defined_subspace (char *name) { sd_chain_struct *space_chain; ssd_chain_struct *subspace_chain; @@ -8105,9 +7988,7 @@ is_defined_subspace (name) to become more efficient. */ static ssd_chain_struct * -pa_subsegment_to_subspace (seg, subseg) - asection *seg; - subsegT subseg; +pa_subsegment_to_subspace (asection *seg, subsegT subseg) { sd_chain_struct *space_chain; ssd_chain_struct *subspace_chain; @@ -8139,8 +8020,7 @@ pa_subsegment_to_subspace (seg, subseg) that was found or NULL on failure. */ static sd_chain_struct * -pa_find_space_by_number (number) - int number; +pa_find_space_by_number (int number) { sd_chain_struct *space_chain; @@ -8160,9 +8040,7 @@ pa_find_space_by_number (number) address is unknown then return zero. */ static unsigned int -pa_subspace_start (space, quadrant) - sd_chain_struct *space; - int quadrant; +pa_subspace_start (sd_chain_struct *space, int quadrant) { /* FIXME. Assumes everyone puts read/write data at 0x4000000, this is not correct for the PA OSF1 port. */ @@ -8180,8 +8058,7 @@ pa_subspace_start (space, quadrant) a string. */ static unsigned int -pa_stringer_aux (s) - char *s; +pa_stringer_aux (char *s) { unsigned int c = *s & CHAR_MASK; @@ -8199,8 +8076,7 @@ pa_stringer_aux (s) /* Handle a .STRING type pseudo-op. */ static void -pa_stringer (append_zero) - int append_zero; +pa_stringer (int append_zero) { char *s, num_buf[4]; unsigned int c; @@ -8281,8 +8157,7 @@ pa_stringer (append_zero) /* Handle a .VERSION pseudo-op. */ static void -pa_version (unused) - int unused ATTRIBUTE_UNUSED; +pa_version (int unused ATTRIBUTE_UNUSED) { obj_version (0); pa_undefine_label (); @@ -8293,8 +8168,7 @@ pa_version (unused) /* Handle a .COMPILER pseudo-op. */ static void -pa_compiler (unused) - int unused ATTRIBUTE_UNUSED; +pa_compiler (int unused ATTRIBUTE_UNUSED) { obj_som_compiler (0); pa_undefine_label (); @@ -8305,8 +8179,7 @@ pa_compiler (unused) /* Handle a .COPYRIGHT pseudo-op. */ static void -pa_copyright (unused) - int unused ATTRIBUTE_UNUSED; +pa_copyright (int unused ATTRIBUTE_UNUSED) { obj_copyright (0); pa_undefine_label (); @@ -8316,8 +8189,7 @@ pa_copyright (unused) the latest space label. */ static void -pa_cons (nbytes) - int nbytes; +pa_cons (int nbytes) { cons (nbytes); pa_undefine_label (); @@ -8326,8 +8198,7 @@ pa_cons (nbytes) /* Like float_cons, but we need to undefine our label. */ static void -pa_float_cons (float_type) - int float_type; +pa_float_cons (int float_type) { float_cons (float_type); pa_undefine_label (); @@ -8336,8 +8207,7 @@ pa_float_cons (float_type) /* Like s_fill, but delete our label when finished. */ static void -pa_fill (unused) - int unused ATTRIBUTE_UNUSED; +pa_fill (int unused ATTRIBUTE_UNUSED) { #ifdef OBJ_SOM /* We must have a valid space and subspace. */ @@ -8351,8 +8221,7 @@ pa_fill (unused) /* Like lcomm, but delete our label when finished. */ static void -pa_lcomm (needs_align) - int needs_align; +pa_lcomm (int needs_align) { #ifdef OBJ_SOM /* We must have a valid space and subspace. */ @@ -8366,8 +8235,7 @@ pa_lcomm (needs_align) /* Like lsym, but delete our label when finished. */ static void -pa_lsym (unused) - int unused ATTRIBUTE_UNUSED; +pa_lsym (int unused ATTRIBUTE_UNUSED) { #ifdef OBJ_SOM /* We must have a valid space and subspace. */ @@ -8378,6 +8246,79 @@ pa_lsym (unused) pa_undefine_label (); } +/* This function is called once, at assembler startup time. It should + set up all the tables, etc. that the MD part of the assembler will need. */ + +void +md_begin (void) +{ + const char *retval = NULL; + int lose = 0; + unsigned int i = 0; + + last_call_info = NULL; + call_info_root = NULL; + + /* Set the default machine type. */ + if (!bfd_set_arch_mach (stdoutput, bfd_arch_hppa, DEFAULT_LEVEL)) + as_warn (_("could not set architecture and machine")); + + /* Folding of text and data segments fails miserably on the PA. + Warn user and disable "-R" option. */ + if (flag_readonly_data_in_text) + { + as_warn (_("-R option not supported on this target.")); + flag_readonly_data_in_text = 0; + } + +#ifdef OBJ_SOM + pa_spaces_begin (); +#endif + + op_hash = hash_new (); + + while (i < NUMOPCODES) + { + const char *name = pa_opcodes[i].name; + + retval = hash_insert (op_hash, name, (struct pa_opcode *) &pa_opcodes[i]); + if (retval != NULL && *retval != '\0') + { + as_fatal (_("Internal error: can't hash `%s': %s\n"), name, retval); + lose = 1; + } + + do + { + if ((pa_opcodes[i].match & pa_opcodes[i].mask) + != pa_opcodes[i].match) + { + fprintf (stderr, _("internal error: losing opcode: `%s' \"%s\"\n"), + pa_opcodes[i].name, pa_opcodes[i].args); + lose = 1; + } + ++i; + } + while (i < NUMOPCODES && !strcmp (pa_opcodes[i].name, name)); + } + + if (lose) + as_fatal (_("Broken assembler. No assembly attempted.")); + +#ifdef OBJ_SOM + /* SOM will change text_section. To make sure we never put + anything into the old one switch to the new one now. */ + subseg_set (text_section, 0); +#endif + +#ifdef OBJ_SOM + dummy_symbol = symbol_find_or_make ("L$dummy"); + S_SET_SEGMENT (dummy_symbol, text_section); + /* Force the symbol to be converted to a real symbol. */ + (void) symbol_get_bfdsym (dummy_symbol); +#endif +} + /* On the PA relocations which involve function symbols must not be adjusted. This so that the linker can know when/how to create argument relocation stubs for indirect calls and calls to static functions. @@ -8400,8 +8341,7 @@ pa_lsym (unused) reductions make life a living hell for object file editors. */ int -hppa_fix_adjustable (fixp) - fixS *fixp; +hppa_fix_adjustable (fixS *fixp) { #ifdef OBJ_ELF reloc_type code; @@ -8522,8 +8462,7 @@ hppa_fix_adjustable (fixp) within GAS. */ int -hppa_force_relocation (fixp) - struct fix *fixp; +hppa_force_relocation (struct fix *fixp) { struct hppa_fix_struct *hppa_fixp; @@ -8597,75 +8536,13 @@ hppa_force_relocation (fixp) /* Now for some ELF specific code. FIXME. */ #ifdef OBJ_ELF -/* Mark the end of a function so that it's possible to compute - the size of the function in elf_hppa_final_processing. */ - -static void -hppa_elf_mark_end_of_function () -{ - /* ELF does not have EXIT relocations. All we do is create a - temporary symbol marking the end of the function. */ - char *name; - - if (last_call_info == NULL || last_call_info->start_symbol == NULL) - { - /* We have already warned about a missing label, - or other problems. */ - return; - } - - name = (char *) xmalloc (strlen ("L$\001end_") - + strlen (S_GET_NAME (last_call_info->start_symbol)) - + 1); - if (name) - { - symbolS *symbolP; - - strcpy (name, "L$\001end_"); - strcat (name, S_GET_NAME (last_call_info->start_symbol)); - - /* If we have a .exit followed by a .procend, then the - symbol will have already been defined. */ - symbolP = symbol_find (name); - if (symbolP) - { - /* The symbol has already been defined! This can - happen if we have a .exit followed by a .procend. - - This is *not* an error. All we want to do is free - the memory we just allocated for the name and continue. */ - xfree (name); - } - else - { - /* symbol value should be the offset of the - last instruction of the function */ - symbolP = symbol_new (name, now_seg, (valueT) (frag_now_fix () - 4), - frag_now); - - assert (symbolP); - S_CLEAR_EXTERNAL (symbolP); - symbol_table_insert (symbolP); - } - - if (symbolP) - last_call_info->end_symbol = symbolP; - else - as_bad (_("Symbol '%s' could not be created."), name); - - } - else - as_bad (_("No memory for symbol name.")); - -} - /* For ELF, this function serves one purpose: to setup the st_size field of STT_FUNC symbols. To do this, we need to scan the call_info structure list, determining st_size in by taking the difference in the address of the beginning/end marker symbols. */ void -elf_hppa_final_processing () +elf_hppa_final_processing (void) { struct call_info *call_info_pointer; @@ -8683,8 +8560,7 @@ elf_hppa_final_processing () } static void -pa_vtable_entry (ignore) - int ignore ATTRIBUTE_UNUSED; +pa_vtable_entry (int ignore ATTRIBUTE_UNUSED) { struct fix *new_fix; @@ -8692,8 +8568,8 @@ pa_vtable_entry (ignore) if (new_fix) { - struct hppa_fix_struct *hppa_fix = (struct hppa_fix_struct *) - obstack_alloc (¬es, sizeof (struct hppa_fix_struct)); + struct hppa_fix_struct * hppa_fix = obstack_alloc (¬es, sizeof (struct hppa_fix_struct)); + hppa_fix->fx_r_type = R_HPPA; hppa_fix->fx_r_field = e_fsel; hppa_fix->fx_r_format = 32; @@ -8705,8 +8581,7 @@ pa_vtable_entry (ignore) } static void -pa_vtable_inherit (ignore) - int ignore ATTRIBUTE_UNUSED; +pa_vtable_inherit (int ignore ATTRIBUTE_UNUSED) { struct fix *new_fix; @@ -8714,8 +8589,8 @@ pa_vtable_inherit (ignore) if (new_fix) { - struct hppa_fix_struct *hppa_fix = (struct hppa_fix_struct *) - obstack_alloc (¬es, sizeof (struct hppa_fix_struct)); + struct hppa_fix_struct * hppa_fix = obstack_alloc (¬es, sizeof (struct hppa_fix_struct)); + hppa_fix->fx_r_type = R_HPPA; hppa_fix->fx_r_field = e_fsel; hppa_fix->fx_r_format = 32; @@ -8726,3 +8601,135 @@ pa_vtable_inherit (ignore) } } #endif + +/* Table of pseudo ops for the PA. FIXME -- how many of these + are now redundant with the overall GAS and the object file + dependent tables? */ +const pseudo_typeS md_pseudo_table[] = +{ + /* align pseudo-ops on the PA specify the actual alignment requested, + not the log2 of the requested alignment. */ +#ifdef OBJ_SOM + {"align", pa_align, 8}, +#endif +#ifdef OBJ_ELF + {"align", s_align_bytes, 8}, +#endif + {"begin_brtab", pa_brtab, 1}, + {"begin_try", pa_try, 1}, + {"block", pa_block, 1}, + {"blockz", pa_block, 0}, + {"byte", pa_cons, 1}, + {"call", pa_call, 0}, + {"callinfo", pa_callinfo, 0}, +#if defined (OBJ_ELF) && (defined (TE_LINUX) || defined (TE_NetBSD)) + {"code", obj_elf_text, 0}, +#else + {"code", pa_text, 0}, + {"comm", pa_comm, 0}, +#endif +#ifdef OBJ_SOM + {"compiler", pa_compiler, 0}, +#endif + {"copyright", pa_copyright, 0}, +#if !(defined (OBJ_ELF) && (defined (TE_LINUX) || defined (TE_NetBSD))) + {"data", pa_data, 0}, +#endif + {"double", pa_float_cons, 'd'}, + {"dword", pa_cons, 8}, + {"end", pa_end, 0}, + {"end_brtab", pa_brtab, 0}, +#if !(defined (OBJ_ELF) && (defined (TE_LINUX) || defined (TE_NetBSD))) + {"end_try", pa_try, 0}, +#endif + {"enter", pa_enter, 0}, + {"entry", pa_entry, 0}, + {"equ", pa_equ, 0}, + {"exit", pa_exit, 0}, + {"export", pa_export, 0}, + {"fill", pa_fill, 0}, + {"float", pa_float_cons, 'f'}, + {"half", pa_cons, 2}, + {"import", pa_import, 0}, + {"int", pa_cons, 4}, + {"label", pa_label, 0}, + {"lcomm", pa_lcomm, 0}, + {"leave", pa_leave, 0}, + {"level", pa_level, 0}, + {"long", pa_cons, 4}, + {"lsym", pa_lsym, 0}, +#ifdef OBJ_SOM + {"nsubspa", pa_subspace, 1}, +#endif + {"octa", pa_cons, 16}, + {"org", pa_origin, 0}, + {"origin", pa_origin, 0}, + {"param", pa_param, 0}, + {"proc", pa_proc, 0}, + {"procend", pa_procend, 0}, + {"quad", pa_cons, 8}, + {"reg", pa_equ, 1}, + {"short", pa_cons, 2}, + {"single", pa_float_cons, 'f'}, +#ifdef OBJ_SOM + {"space", pa_space, 0}, + {"spnum", pa_spnum, 0}, +#endif + {"string", pa_stringer, 0}, + {"stringz", pa_stringer, 1}, +#ifdef OBJ_SOM + {"subspa", pa_subspace, 0}, +#endif +#if !(defined (OBJ_ELF) && (defined (TE_LINUX) || defined (TE_NetBSD))) + {"text", pa_text, 0}, +#endif + {"version", pa_version, 0}, +#ifdef OBJ_ELF + {"vtable_entry", pa_vtable_entry, 0}, + {"vtable_inherit", pa_vtable_inherit, 0}, +#endif + {"word", pa_cons, 4}, + {NULL, 0, 0} +}; + +#ifdef OBJ_ELF +void +hppa_cfi_frame_initial_instructions (void) +{ + cfi_add_CFA_def_cfa (30, 0); +} + +int +hppa_regname_to_dw2regnum (char *regname) +{ + unsigned int regnum = -1; + unsigned int i; + const char *p; + char *q; + static struct { char *name; int dw2regnum; } regnames[] = + { + { "sp", 30 }, { "rp", 2 }, + }; + + for (i = 0; i < ARRAY_SIZE (regnames); ++i) + if (strcmp (regnames[i].name, regname) == 0) + return regnames[i].dw2regnum; + + if (regname[0] == 'r') + { + p = regname + 1; + regnum = strtoul (p, &q, 10); + if (p == q || *q || regnum >= 32) + return -1; + } + else if (regname[0] == 'f' && regname[1] == 'r') + { + p = regname + 2; + regnum = strtoul (p, &q, 10); + if (p == q || *q || regnum <= 4 || regnum >= 32) + return -1; + regnum += 32 - 4; + } + return regnum; +} +#endif diff --git a/gas/config/tc-hppa.h b/gas/config/tc-hppa.h index 9b3edc1878f..f7bc8f8d97a 100644 --- a/gas/config/tc-hppa.h +++ b/gas/config/tc-hppa.h @@ -1,6 +1,6 @@ /* tc-hppa.h -- Header file for the PA Copyright 1989, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -90,15 +90,14 @@ #define ASEC_NULL (asection *)0 /* pa_define_label gets used outside of tc-hppa.c via tc_frob_label. */ -extern void pa_define_label PARAMS ((symbolS *)); - -extern void parse_cons_expression_hppa PARAMS ((expressionS *)); -extern void cons_fix_new_hppa PARAMS ((fragS *, int, int, expressionS *)); -extern int hppa_force_relocation PARAMS ((struct fix *)); +extern void pa_define_label (symbolS *); +extern void parse_cons_expression_hppa (expressionS *); +extern void cons_fix_new_hppa (fragS *, int, int, expressionS *); +extern int hppa_force_relocation (struct fix *); /* This gets called before writing the object file to make sure things like entry/exit and proc/procend pairs match. */ -extern void pa_check_eof PARAMS ((void)); +extern void pa_check_eof (void); #define tc_frob_file pa_check_eof #define tc_frob_label(sym) pa_define_label (sym) @@ -120,7 +119,7 @@ extern const char hppa_symbol_chars[]; When used in an instruction it will always follow a comma. */ #define TC_EOL_IN_INSN(PTR) (*(PTR) == '!' && (PTR)[-1] == ',') -int hppa_fix_adjustable PARAMS((struct fix *)); +int hppa_fix_adjustable (struct fix *); #define tc_fix_adjustable hppa_fix_adjustable #define EXTERN_FORCE_RELOC 1 @@ -170,17 +169,23 @@ int hppa_fix_adjustable PARAMS((struct fix *)); #define tc_frob_symbol(sym,punt) \ { \ - if ((S_GET_SEGMENT (sym) == &bfd_und_section && ! symbol_used_p (sym) && \ - ELF_ST_VISIBILITY (S_GET_OTHER (sym)) == STV_DEFAULT) \ + if ((S_GET_SEGMENT (sym) == &bfd_und_section \ + && ! symbol_used_p (sym) \ + && ELF_ST_VISIBILITY (S_GET_OTHER (sym)) == STV_DEFAULT) \ || (S_GET_SEGMENT (sym) == &bfd_abs_section \ && ! S_IS_EXTERNAL (sym)) \ || strcmp (S_GET_NAME (sym), "$global$") == 0 \ - || strcmp (S_GET_NAME (sym), "$PIC_pcrel$0") == 0) \ + || strcmp (S_GET_NAME (sym), "$PIC_pcrel$0") == 0 \ + || strcmp (S_GET_NAME (sym), "$tls_gdidx$") == 0 \ + || strcmp (S_GET_NAME (sym), "$tls_ldidx$") == 0 \ + || strcmp (S_GET_NAME (sym), "$tls_dtpoff$") == 0 \ + || strcmp (S_GET_NAME (sym), "$tls_ieoff$") == 0 \ + || strcmp (S_GET_NAME (sym), "$tls_leoff$") == 0) \ punt = 1; \ } #define elf_tc_final_processing elf_hppa_final_processing -void elf_hppa_final_processing PARAMS ((void)); +void elf_hppa_final_processing (void); #define DWARF2_LINE_MIN_INSN_LENGTH 4 #endif /* OBJ_ELF */ @@ -191,10 +196,27 @@ void elf_hppa_final_processing PARAMS ((void)); A silly fudge required for backwards compatibility. */ #define md_optimize_expr hppa_force_reg_syms_absolute -int hppa_force_reg_syms_absolute - PARAMS ((expressionS *, operatorT, expressionS *)); +int hppa_force_reg_syms_absolute (expressionS *, operatorT, expressionS *); #define TC_FIX_TYPE PTR #define TC_INIT_FIX_DATA(FIX) ((FIX)->tc_fix_data = NULL) +#ifdef OBJ_ELF +#define TARGET_USE_CFIPOP 1 + +#define tc_cfi_frame_initial_instructions hppa_cfi_frame_initial_instructions +extern void hppa_cfi_frame_initial_instructions (void); + +#define tc_regname_to_dw2regnum hppa_regname_to_dw2regnum +extern int hppa_regname_to_dw2regnum (char *regname); + +#define DWARF2_LINE_MIN_INSN_LENGTH 4 +#define DWARF2_DEFAULT_RETURN_COLUMN 2 +#if TARGET_ARCH_SIZE == 64 +#define DWARF2_CIE_DATA_ALIGNMENT -8 +#else +#define DWARF2_CIE_DATA_ALIGNMENT -4 +#endif +#endif + #endif /* _TC_HPPA_H */ diff --git a/gas/config/tc-i370.c b/gas/config/tc-i370.c index d87d2d9f808..4445abeb406 100644 --- a/gas/config/tc-i370.c +++ b/gas/config/tc-i370.c @@ -27,7 +27,6 @@ similarities between HLASM and the MRI assemblers, such as section names, lack of leading . in pseudo-ops, DC and DS, etc. */ -#include #include "as.h" #include "safe-ctype.h" #include "subsegs.h" diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index be384bc99a7..296fdcdde41 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -1,6 +1,6 @@ -/* i386.c -- Assemble code for the Intel 80386 +/* tc-i386.c -- Assemble code for the Intel 80386 Copyright 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -32,7 +32,6 @@ #include "subsegs.h" #include "dwarf2dbg.h" #include "dw2gencfi.h" -#include "opcode/i386.h" #include "elf/x86-64.h" #ifndef REGISTER_WARNINGS @@ -63,54 +62,39 @@ #endif #endif -static INLINE unsigned int mode_from_disp_size PARAMS ((unsigned int)); -static INLINE int fits_in_signed_byte PARAMS ((offsetT)); -static INLINE int fits_in_unsigned_byte PARAMS ((offsetT)); -static INLINE int fits_in_unsigned_word PARAMS ((offsetT)); -static INLINE int fits_in_signed_word PARAMS ((offsetT)); -static INLINE int fits_in_unsigned_long PARAMS ((offsetT)); -static INLINE int fits_in_signed_long PARAMS ((offsetT)); -static int smallest_imm_type PARAMS ((offsetT)); -static offsetT offset_in_range PARAMS ((offsetT, int)); -static int add_prefix PARAMS ((unsigned int)); -static void set_code_flag PARAMS ((int)); -static void set_16bit_gcc_code_flag PARAMS ((int)); -static void set_intel_syntax PARAMS ((int)); -static void set_cpu_arch PARAMS ((int)); +static void set_code_flag (int); +static void set_16bit_gcc_code_flag (int); +static void set_intel_syntax (int); +static void set_cpu_arch (int); #ifdef TE_PE -static void pe_directive_secrel PARAMS ((int)); +static void pe_directive_secrel (int); #endif -static void signed_cons PARAMS ((int)); -static char *output_invalid PARAMS ((int c)); -static int i386_operand PARAMS ((char *operand_string)); -static int i386_intel_operand PARAMS ((char *operand_string, int got_a_float)); -static const reg_entry *parse_register PARAMS ((char *reg_string, - char **end_op)); -static char *parse_insn PARAMS ((char *, char *)); -static char *parse_operands PARAMS ((char *, const char *)); -static void swap_operands PARAMS ((void)); -static void optimize_imm PARAMS ((void)); -static void optimize_disp PARAMS ((void)); -static int match_template PARAMS ((void)); -static int check_string PARAMS ((void)); -static int process_suffix PARAMS ((void)); -static int check_byte_reg PARAMS ((void)); -static int check_long_reg PARAMS ((void)); -static int check_qword_reg PARAMS ((void)); -static int check_word_reg PARAMS ((void)); -static int finalize_imm PARAMS ((void)); -static int process_operands PARAMS ((void)); -static const seg_entry *build_modrm_byte PARAMS ((void)); -static void output_insn PARAMS ((void)); -static void output_branch PARAMS ((void)); -static void output_jump PARAMS ((void)); -static void output_interseg_jump PARAMS ((void)); -static void output_imm PARAMS ((fragS *insn_start_frag, - offsetT insn_start_off)); -static void output_disp PARAMS ((fragS *insn_start_frag, - offsetT insn_start_off)); +static void signed_cons (int); +static char *output_invalid (int c); +static int i386_operand (char *); +static int i386_intel_operand (char *, int); +static const reg_entry *parse_register (char *, char **); +static char *parse_insn (char *, char *); +static char *parse_operands (char *, const char *); +static void swap_operands (void); +static void swap_2_operands (int, int); +static void optimize_imm (void); +static void optimize_disp (void); +static int match_template (void); +static int check_string (void); +static int process_suffix (void); +static int check_byte_reg (void); +static int check_long_reg (void); +static int check_qword_reg (void); +static int check_word_reg (void); +static int finalize_imm (void); +static int process_operands (void); +static const seg_entry *build_modrm_byte (void); +static void output_insn (void); +static void output_imm (fragS *, offsetT); +static void output_disp (fragS *, offsetT); #ifndef I386COFF -static void s_bss PARAMS ((int)); +static void s_bss (int); #endif #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) static void handle_large_common (int small ATTRIBUTE_UNUSED); @@ -271,8 +255,9 @@ static i386_insn i; /* Possible templates for current insn. */ static const templates *current_templates; -/* Per instruction expressionS buffers: 2 displacements & 2 immediate max. */ -static expressionS disp_expressions[2], im_expressions[2]; +/* Per instruction expressionS buffers: max displacements & immediates. */ +static expressionS disp_expressions[MAX_MEMORY_OPERANDS]; +static expressionS im_expressions[MAX_IMMEDIATE_OPERANDS]; /* Current operand we are working on. */ static int this_operand; @@ -305,6 +290,9 @@ static int intel_syntax = 0; /* 1 if register prefix % not required. */ static int allow_naked_reg = 0; +/* Register prefix used for error message. */ +static const char *register_prefix = "%"; + /* Used in 16 bit gcc mode to add an l suffix to call, ret, enter, leave, push, and pop instructions so that gcc has the same stack frame as in 32 bit mode. */ @@ -323,6 +311,21 @@ static const char *cpu_sub_arch_name = NULL; /* CPU feature flags. */ static unsigned int cpu_arch_flags = CpuUnknownFlags | CpuNo64; +/* If we have selected a cpu we are generating instructions for. */ +static int cpu_arch_tune_set = 0; + +/* Cpu we are generating instructions for. */ +static enum processor_type cpu_arch_tune = PROCESSOR_UNKNOWN; + +/* CPU feature flags of cpu we are generating instructions for. */ +static unsigned int cpu_arch_tune_flags = 0; + +/* CPU instruction set architecture used. */ +static enum processor_type cpu_arch_isa = PROCESSOR_UNKNOWN; + +/* CPU feature flags of instruction set architecture used. */ +static unsigned int cpu_arch_isa_flags = 0; + /* If set, conditional jumps are not automatically promoted to handle larger than a byte offset. */ static unsigned int no_cond_jump_promotion = 0; @@ -415,35 +418,106 @@ const relax_typeS md_relax_table[] = {0, 0, 4, 0} }; -static const arch_entry cpu_arch[] = { - {"i8086", Cpu086 }, - {"i186", Cpu086|Cpu186 }, - {"i286", Cpu086|Cpu186|Cpu286 }, - {"i386", Cpu086|Cpu186|Cpu286|Cpu386 }, - {"i486", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486 }, - {"i586", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586 }, - {"i686", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686 }, - {"pentium", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586 }, - {"pentiumpro",Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686 }, - {"pentiumii", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuMMX }, - {"pentiumiii",Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuMMX|CpuMMX2|CpuSSE }, - {"pentium4", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuMMX|CpuMMX2|CpuSSE|CpuSSE2 }, - {"prescott", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuPNI }, - {"k6", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|CpuK6|CpuMMX }, - {"k6_2", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|CpuK6|CpuMMX|Cpu3dnow }, - {"athlon", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuK6|CpuAthlon|CpuMMX|CpuMMX2|Cpu3dnow|Cpu3dnowA }, - {"sledgehammer",Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuK6|CpuAthlon|CpuSledgehammer|CpuMMX|CpuMMX2|Cpu3dnow|Cpu3dnowA|CpuSSE|CpuSSE2 }, - {"opteron", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuK6|CpuAthlon|CpuSledgehammer|CpuMMX|CpuMMX2|Cpu3dnow|Cpu3dnowA|CpuSSE|CpuSSE2 }, - {".mmx", CpuMMX }, - {".sse", CpuMMX|CpuMMX2|CpuSSE }, - {".sse2", CpuMMX|CpuMMX2|CpuSSE|CpuSSE2 }, - {".sse3", CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3 }, - {".3dnow", CpuMMX|Cpu3dnow }, - {".3dnowa", CpuMMX|CpuMMX2|Cpu3dnow|Cpu3dnowA }, - {".padlock", CpuPadLock }, - {".pacifica", CpuSVME }, - {".svme", CpuSVME }, - {NULL, 0 } +static const arch_entry cpu_arch[] = +{ + {"generic32", PROCESSOR_GENERIC32, + Cpu186|Cpu286|Cpu386}, + {"generic64", PROCESSOR_GENERIC64, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuMMX + |CpuMMX2|CpuSSE|CpuSSE2}, + {"i8086", PROCESSOR_UNKNOWN, + 0}, + {"i186", PROCESSOR_UNKNOWN, + Cpu186}, + {"i286", PROCESSOR_UNKNOWN, + Cpu186|Cpu286}, + {"i386", PROCESSOR_GENERIC32, + Cpu186|Cpu286|Cpu386}, + {"i486", PROCESSOR_I486, + Cpu186|Cpu286|Cpu386|Cpu486}, + {"i586", PROCESSOR_PENTIUM, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586}, + {"i686", PROCESSOR_PENTIUMPRO, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686}, + {"pentium", PROCESSOR_PENTIUM, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586}, + {"pentiumpro",PROCESSOR_PENTIUMPRO, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686}, + {"pentiumii", PROCESSOR_PENTIUMPRO, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuMMX}, + {"pentiumiii",PROCESSOR_PENTIUMPRO, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuMMX|CpuMMX2|CpuSSE}, + {"pentium4", PROCESSOR_PENTIUM4, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuMMX + |CpuMMX2|CpuSSE|CpuSSE2}, + {"prescott", PROCESSOR_NOCONA, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuMMX + |CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3}, + {"nocona", PROCESSOR_NOCONA, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuMMX + |CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3}, + {"yonah", PROCESSOR_CORE, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuMMX + |CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3}, + {"core", PROCESSOR_CORE, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuMMX + |CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3}, + {"merom", PROCESSOR_CORE2, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuMMX + |CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3}, + {"core2", PROCESSOR_CORE2, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuMMX + |CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3}, + {"k6", PROCESSOR_K6, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|CpuK6|CpuMMX}, + {"k6_2", PROCESSOR_K6, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|CpuK6|CpuMMX|Cpu3dnow}, + {"athlon", PROCESSOR_ATHLON, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuK6 + |CpuMMX|CpuMMX2|Cpu3dnow|Cpu3dnowA}, + {"sledgehammer", PROCESSOR_K8, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuK6 + |CpuSledgehammer|CpuMMX|CpuMMX2|Cpu3dnow|Cpu3dnowA|CpuSSE|CpuSSE2}, + {"opteron", PROCESSOR_K8, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuK6 + |CpuSledgehammer|CpuMMX|CpuMMX2|Cpu3dnow|Cpu3dnowA|CpuSSE|CpuSSE2}, + {"k8", PROCESSOR_K8, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuK6 + |CpuSledgehammer|CpuMMX|CpuMMX2|Cpu3dnow|Cpu3dnowA|CpuSSE|CpuSSE2}, + {"amdfam10", PROCESSOR_AMDFAM10, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuK6|CpuSledgehammer + |CpuMMX|CpuMMX2|Cpu3dnow|Cpu3dnowA|CpuSSE|CpuSSE2|CpuSSE3|CpuSSE4a + |CpuABM}, + {".mmx", PROCESSOR_UNKNOWN, + CpuMMX}, + {".sse", PROCESSOR_UNKNOWN, + CpuMMX|CpuMMX2|CpuSSE}, + {".sse2", PROCESSOR_UNKNOWN, + CpuMMX|CpuMMX2|CpuSSE|CpuSSE2}, + {".sse3", PROCESSOR_UNKNOWN, + CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3}, + {".ssse3", PROCESSOR_UNKNOWN, + CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3}, + {".sse4.1", PROCESSOR_UNKNOWN, + CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3|CpuSSE4_1}, + {".sse4.2", PROCESSOR_UNKNOWN, + CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3|CpuSSE4}, + {".sse4", PROCESSOR_UNKNOWN, + CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3|CpuSSE4}, + {".3dnow", PROCESSOR_UNKNOWN, + CpuMMX|Cpu3dnow}, + {".3dnowa", PROCESSOR_UNKNOWN, + CpuMMX|CpuMMX2|Cpu3dnow|Cpu3dnowA}, + {".padlock", PROCESSOR_UNKNOWN, + CpuPadLock}, + {".pacifica", PROCESSOR_UNKNOWN, + CpuSVME}, + {".svme", PROCESSOR_UNKNOWN, + CpuSVME}, + {".sse4a", PROCESSOR_UNKNOWN, + CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuSSE4a}, + {".abm", PROCESSOR_UNKNOWN, + CpuABM} }; const pseudo_typeS md_pseudo_table[] = @@ -473,7 +547,7 @@ const pseudo_typeS md_pseudo_table[] = #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) {"largecomm", handle_large_common, 0}, #else - {"file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0}, + {"file", (void (*) (int)) dwarf2_directive_file, 0}, {"loc", dwarf2_directive_loc, 0}, {"loc_mark_labels", dwarf2_directive_loc_mark_labels, 0}, #endif @@ -493,9 +567,7 @@ static struct hash_control *op_hash; static struct hash_control *reg_hash; void -i386_align_code (fragP, count) - fragS *fragP; - int count; +i386_align_code (fragS *fragP, int count) { /* Various efficient no-op patterns for aligning code labels. Note: Don't try to assemble the instructions in the comments. @@ -503,7 +575,7 @@ i386_align_code (fragP, count) static const char f32_1[] = {0x90}; /* nop */ static const char f32_2[] = - {0x89,0xf6}; /* movl %esi,%esi */ + {0x66,0x90}; /* xchg %ax,%ax */ static const char f32_3[] = {0x8d,0x76,0x00}; /* leal 0(%esi),%esi */ static const char f32_4[] = @@ -563,13 +635,141 @@ i386_align_code (fragP, count) f32_1, f32_2, f16_3, f16_4, f16_5, f16_6, f16_7, f16_8, f32_15, f32_15, f32_15, f32_15, f32_15, f32_15, f32_15 }; + /* nopl (%[re]ax) */ + static const char alt_3[] = + {0x0f,0x1f,0x00}; + /* nopl 0(%[re]ax) */ + static const char alt_4[] = + {0x0f,0x1f,0x40,0x00}; + /* nopl 0(%[re]ax,%[re]ax,1) */ + static const char alt_5[] = + {0x0f,0x1f,0x44,0x00,0x00}; + /* nopw 0(%[re]ax,%[re]ax,1) */ + static const char alt_6[] = + {0x66,0x0f,0x1f,0x44,0x00,0x00}; + /* nopl 0L(%[re]ax) */ + static const char alt_7[] = + {0x0f,0x1f,0x80,0x00,0x00,0x00,0x00}; + /* nopl 0L(%[re]ax,%[re]ax,1) */ + static const char alt_8[] = + {0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; + /* nopw 0L(%[re]ax,%[re]ax,1) */ + static const char alt_9[] = + {0x66,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; + /* nopw %cs:0L(%[re]ax,%[re]ax,1) */ + static const char alt_10[] = + {0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; + /* data16 + nopw %cs:0L(%[re]ax,%[re]ax,1) */ + static const char alt_long_11[] = + {0x66, + 0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; + /* data16 + data16 + nopw %cs:0L(%[re]ax,%[re]ax,1) */ + static const char alt_long_12[] = + {0x66, + 0x66, + 0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; + /* data16 + data16 + data16 + nopw %cs:0L(%[re]ax,%[re]ax,1) */ + static const char alt_long_13[] = + {0x66, + 0x66, + 0x66, + 0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; + /* data16 + data16 + data16 + data16 + nopw %cs:0L(%[re]ax,%[re]ax,1) */ + static const char alt_long_14[] = + {0x66, + 0x66, + 0x66, + 0x66, + 0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; + /* data16 + data16 + data16 + data16 + data16 + nopw %cs:0L(%[re]ax,%[re]ax,1) */ + static const char alt_long_15[] = + {0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; + /* nopl 0(%[re]ax,%[re]ax,1) + nopw 0(%[re]ax,%[re]ax,1) */ + static const char alt_short_11[] = + {0x0f,0x1f,0x44,0x00,0x00, + 0x66,0x0f,0x1f,0x44,0x00,0x00}; + /* nopw 0(%[re]ax,%[re]ax,1) + nopw 0(%[re]ax,%[re]ax,1) */ + static const char alt_short_12[] = + {0x66,0x0f,0x1f,0x44,0x00,0x00, + 0x66,0x0f,0x1f,0x44,0x00,0x00}; + /* nopw 0(%[re]ax,%[re]ax,1) + nopl 0L(%[re]ax) */ + static const char alt_short_13[] = + {0x66,0x0f,0x1f,0x44,0x00,0x00, + 0x0f,0x1f,0x80,0x00,0x00,0x00,0x00}; + /* nopl 0L(%[re]ax) + nopl 0L(%[re]ax) */ + static const char alt_short_14[] = + {0x0f,0x1f,0x80,0x00,0x00,0x00,0x00, + 0x0f,0x1f,0x80,0x00,0x00,0x00,0x00}; + /* nopl 0L(%[re]ax) + nopl 0L(%[re]ax,%[re]ax,1) */ + static const char alt_short_15[] = + {0x0f,0x1f,0x80,0x00,0x00,0x00,0x00, + 0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; + static const char *const alt_short_patt[] = { + f32_1, f32_2, alt_3, alt_4, alt_5, alt_6, alt_7, alt_8, + alt_9, alt_10, alt_short_11, alt_short_12, alt_short_13, + alt_short_14, alt_short_15 + }; + static const char *const alt_long_patt[] = { + f32_1, f32_2, alt_3, alt_4, alt_5, alt_6, alt_7, alt_8, + alt_9, alt_10, alt_long_11, alt_long_12, alt_long_13, + alt_long_14, alt_long_15 + }; if (count <= 0 || count > 15) return; - /* The recommended way to pad 64bit code is to use NOPs preceded by - maximally four 0x66 prefixes. Balance the size of nops. */ - if (flag_code == CODE_64BIT) + /* We need to decide which NOP sequence to use for 32bit and + 64bit. When -mtune= is used: + + 1. For PROCESSOR_I486, PROCESSOR_PENTIUM and PROCESSOR_GENERIC32, + f32_patt will be used. + 2. For PROCESSOR_K8 and PROCESSOR_AMDFAM10 in 64bit, NOPs with + 0x66 prefix will be used. + 3. For PROCESSOR_CORE2, alt_long_patt will be used. + 4. For PROCESSOR_PENTIUMPRO, PROCESSOR_PENTIUM4, PROCESSOR_NOCONA, + PROCESSOR_CORE, PROCESSOR_CORE2, PROCESSOR_K6, PROCESSOR_ATHLON + and PROCESSOR_GENERIC64, alt_short_patt will be used. + + When -mtune= isn't used, alt_short_patt will be used if + cpu_arch_isa_flags has Cpu686. Otherwise, f32_patt will be used. + + When -march= or .arch is used, we can't use anything beyond + cpu_arch_isa_flags. */ + + if (flag_code == CODE_16BIT) + { + memcpy (fragP->fr_literal + fragP->fr_fix, + f16_patt[count - 1], count); + if (count > 8) + /* Adjust jump offset. */ + fragP->fr_literal[fragP->fr_fix + 1] = count - 2; + } + else if (flag_code == CODE_64BIT && cpu_arch_tune == PROCESSOR_K8) { int i; int nnops = (count + 3) / 4; @@ -577,6 +777,8 @@ i386_align_code (fragP, count) int remains = count - nnops * len; int pos = 0; + /* The recommended way to pad 64bit code is to use NOPs preceded + by maximally four 0x66 prefixes. Balance the size of nops. */ for (i = 0; i < remains; i++) { memset (fragP->fr_literal + fragP->fr_fix + pos, 0x66, len); @@ -591,57 +793,121 @@ i386_align_code (fragP, count) } } else - if (flag_code == CODE_16BIT) - { - memcpy (fragP->fr_literal + fragP->fr_fix, - f16_patt[count - 1], count); - if (count > 8) - /* Adjust jump offset. */ - fragP->fr_literal[fragP->fr_fix + 1] = count - 2; - } - else + { + const char *const *patt = NULL; + + if (cpu_arch_isa == PROCESSOR_UNKNOWN) + { + /* PROCESSOR_UNKNOWN means that all ISAs may be used. */ + switch (cpu_arch_tune) + { + case PROCESSOR_UNKNOWN: + /* We use cpu_arch_isa_flags to check if we SHOULD + optimize for Cpu686. */ + if ((cpu_arch_isa_flags & Cpu686) != 0) + patt = alt_short_patt; + else + patt = f32_patt; + break; + case PROCESSOR_CORE2: + patt = alt_long_patt; + break; + case PROCESSOR_PENTIUMPRO: + case PROCESSOR_PENTIUM4: + case PROCESSOR_NOCONA: + case PROCESSOR_CORE: + case PROCESSOR_K6: + case PROCESSOR_ATHLON: + case PROCESSOR_K8: + case PROCESSOR_GENERIC64: + case PROCESSOR_AMDFAM10: + patt = alt_short_patt; + break; + case PROCESSOR_I486: + case PROCESSOR_PENTIUM: + case PROCESSOR_GENERIC32: + patt = f32_patt; + break; + } + } + else + { + switch (cpu_arch_tune) + { + case PROCESSOR_UNKNOWN: + /* When cpu_arch_isa is net, cpu_arch_tune shouldn't be + PROCESSOR_UNKNOWN. */ + abort (); + break; + + case PROCESSOR_I486: + case PROCESSOR_PENTIUM: + case PROCESSOR_PENTIUMPRO: + case PROCESSOR_PENTIUM4: + case PROCESSOR_NOCONA: + case PROCESSOR_CORE: + case PROCESSOR_K6: + case PROCESSOR_ATHLON: + case PROCESSOR_K8: + case PROCESSOR_AMDFAM10: + case PROCESSOR_GENERIC32: + /* We use cpu_arch_isa_flags to check if we CAN optimize + for Cpu686. */ + if ((cpu_arch_isa_flags & Cpu686) != 0) + patt = alt_short_patt; + else + patt = f32_patt; + break; + case PROCESSOR_CORE2: + if ((cpu_arch_isa_flags & Cpu686) != 0) + patt = alt_long_patt; + else + patt = f32_patt; + break; + case PROCESSOR_GENERIC64: + patt = alt_short_patt; + break; + } + } + memcpy (fragP->fr_literal + fragP->fr_fix, - f32_patt[count - 1], count); + patt[count - 1], count); + } fragP->fr_var = count; } static INLINE unsigned int -mode_from_disp_size (t) - unsigned int t; +mode_from_disp_size (unsigned int t) { return (t & Disp8) ? 1 : (t & (Disp16 | Disp32 | Disp32S)) ? 2 : 0; } static INLINE int -fits_in_signed_byte (num) - offsetT num; +fits_in_signed_byte (offsetT num) { return (num >= -128) && (num <= 127); } static INLINE int -fits_in_unsigned_byte (num) - offsetT num; +fits_in_unsigned_byte (offsetT num) { return (num & 0xff) == num; } static INLINE int -fits_in_unsigned_word (num) - offsetT num; +fits_in_unsigned_word (offsetT num) { return (num & 0xffff) == num; } static INLINE int -fits_in_signed_word (num) - offsetT num; +fits_in_signed_word (offsetT num) { return (-32768 <= num) && (num <= 32767); } + static INLINE int -fits_in_signed_long (num) - offsetT num ATTRIBUTE_UNUSED; +fits_in_signed_long (offsetT num ATTRIBUTE_UNUSED) { #ifndef BFD64 return 1; @@ -650,9 +916,9 @@ fits_in_signed_long (num) || (((offsetT) -1 << 31) & num) == ((offsetT) -1 << 31)); #endif } /* fits_in_signed_long() */ + static INLINE int -fits_in_unsigned_long (num) - offsetT num ATTRIBUTE_UNUSED; +fits_in_unsigned_long (offsetT num ATTRIBUTE_UNUSED) { #ifndef BFD64 return 1; @@ -661,11 +927,10 @@ fits_in_unsigned_long (num) #endif } /* fits_in_unsigned_long() */ -static int -smallest_imm_type (num) - offsetT num; +static unsigned int +smallest_imm_type (offsetT num) { - if (cpu_arch_flags != (Cpu086 | Cpu186 | Cpu286 | Cpu386 | Cpu486 | CpuNo64)) + if (cpu_arch_flags != (Cpu186 | Cpu286 | Cpu386 | Cpu486 | CpuNo64)) { /* This code is disabled on the 486 because all the Imm1 forms in the opcode table are slower on the i486. They're the @@ -689,9 +954,7 @@ smallest_imm_type (num) } static offsetT -offset_in_range (val, size) - offsetT val; - int size; +offset_in_range (offsetT val, int size) { addressT mask; @@ -726,8 +989,7 @@ offset_in_range (val, size) class already exists, 1 if non rep/repne added, 2 if rep/repne added. */ static int -add_prefix (prefix) - unsigned int prefix; +add_prefix (unsigned int prefix) { int ret = 1; unsigned int q; @@ -735,9 +997,9 @@ add_prefix (prefix) if (prefix >= REX_OPCODE && prefix < REX_OPCODE + 16 && flag_code == CODE_64BIT) { - if ((i.prefix[REX_PREFIX] & prefix & REX_MODE64) - || ((i.prefix[REX_PREFIX] & (REX_EXTX | REX_EXTY | REX_EXTZ)) - && (prefix & (REX_EXTX | REX_EXTY | REX_EXTZ)))) + if ((i.prefix[REX_PREFIX] & prefix & REX_W) + || ((i.prefix[REX_PREFIX] & (REX_R | REX_X | REX_B)) + && (prefix & (REX_R | REX_X | REX_B)))) ret = 0; q = REX_PREFIX; } @@ -794,8 +1056,7 @@ add_prefix (prefix) } static void -set_code_flag (value) - int value; +set_code_flag (int value) { flag_code = value; cpu_arch_flags &= ~(Cpu64 | CpuNo64); @@ -812,8 +1073,7 @@ set_code_flag (value) } static void -set_16bit_gcc_code_flag (new_code_flag) - int new_code_flag; +set_16bit_gcc_code_flag (int new_code_flag) { flag_code = new_code_flag; cpu_arch_flags &= ~(Cpu64 | CpuNo64); @@ -822,8 +1082,7 @@ set_16bit_gcc_code_flag (new_code_flag) } static void -set_intel_syntax (syntax_flag) - int syntax_flag; +set_intel_syntax (int syntax_flag) { /* Find out if register prefixing is specified. */ int ask_naked_reg = 0; @@ -854,11 +1113,11 @@ set_intel_syntax (syntax_flag) identifier_chars['%'] = intel_syntax && allow_naked_reg ? '%' : 0; identifier_chars['$'] = intel_syntax ? '$' : 0; + register_prefix = allow_naked_reg ? "" : "%"; } static void -set_cpu_arch (dummy) - int dummy ATTRIBUTE_UNUSED; +set_cpu_arch (int dummy ATTRIBUTE_UNUSED) { SKIP_WHITESPACE (); @@ -866,9 +1125,9 @@ set_cpu_arch (dummy) { char *string = input_line_pointer; int e = get_symbol_end (); - int i; + unsigned int i; - for (i = 0; cpu_arch[i].name; i++) + for (i = 0; i < ARRAY_SIZE (cpu_arch); i++) { if (strcmp (string, cpu_arch[i].name) == 0) { @@ -877,7 +1136,15 @@ set_cpu_arch (dummy) cpu_arch_name = cpu_arch[i].name; cpu_sub_arch_name = NULL; cpu_arch_flags = (cpu_arch[i].flags - | (flag_code == CODE_64BIT ? Cpu64 : CpuNo64)); + | (flag_code == CODE_64BIT + ? Cpu64 : CpuNo64)); + cpu_arch_isa = cpu_arch[i].type; + cpu_arch_isa_flags = cpu_arch[i].flags; + if (!cpu_arch_tune_set) + { + cpu_arch_tune = cpu_arch_isa; + cpu_arch_tune_flags = cpu_arch_isa_flags; + } break; } if ((cpu_arch_flags | cpu_arch[i].flags) != cpu_arch_flags) @@ -890,7 +1157,7 @@ set_cpu_arch (dummy) return; } } - if (!cpu_arch[i].name) + if (i >= ARRAY_SIZE (cpu_arch)) as_bad (_("no such architecture: `%s'"), string); *input_line_pointer = e; @@ -976,10 +1243,9 @@ md_begin () reg_hash = hash_new (); { const reg_entry *regtab; + unsigned int regtab_size = i386_regtab_size; - for (regtab = i386_regtab; - regtab < i386_regtab + sizeof (i386_regtab) / sizeof (i386_regtab[0]); - regtab++) + for (regtab = i386_regtab; regtab_size--; regtab++) { hash_err = hash_insert (reg_hash, regtab->reg_name, (PTR) regtab); if (hash_err) @@ -1034,6 +1300,7 @@ md_begin () #endif digit_chars['-'] = '-'; mnemonic_chars['-'] = '-'; + mnemonic_chars['.'] = '.'; identifier_chars['_'] = '_'; identifier_chars['.'] = '.'; @@ -1063,8 +1330,7 @@ md_begin () } void -i386_print_statistics (file) - FILE *file; +i386_print_statistics (FILE *file) { hash_print_statistics (file, "i386 opcode", op_hash); hash_print_statistics (file, "i386 register", reg_hash); @@ -1073,16 +1339,13 @@ i386_print_statistics (file) #ifdef DEBUG386 /* Debugging routines for md_assemble. */ -static void pi PARAMS ((char *, i386_insn *)); -static void pte PARAMS ((template *)); -static void pt PARAMS ((unsigned int)); -static void pe PARAMS ((expressionS *)); -static void ps PARAMS ((symbolS *)); +static void pte (template *); +static void pt (unsigned int); +static void pe (expressionS *); +static void ps (symbolS *); static void -pi (line, x) - char *line; - i386_insn *x; +pi (char *line, i386_insn *x) { unsigned int i; @@ -1097,10 +1360,10 @@ pi (line, x) fprintf (stdout, " sib: base %x index %x scale %x\n", x->sib.base, x->sib.index, x->sib.scale); fprintf (stdout, " rex: 64bit %x extX %x extY %x extZ %x\n", - (x->rex & REX_MODE64) != 0, - (x->rex & REX_EXTX) != 0, - (x->rex & REX_EXTY) != 0, - (x->rex & REX_EXTZ) != 0); + (x->rex & REX_W) != 0, + (x->rex & REX_R) != 0, + (x->rex & REX_X) != 0, + (x->rex & REX_B) != 0); for (i = 0; i < x->operands; i++) { fprintf (stdout, " #%d: ", i + 1); @@ -1117,8 +1380,7 @@ pi (line, x) } static void -pte (t) - template *t; +pte (template *t) { unsigned int i; fprintf (stdout, " %d operands ", t->operands); @@ -1139,8 +1401,7 @@ pte (t) } static void -pe (e) - expressionS *e; +pe (expressionS *e) { fprintf (stdout, " operation %d\n", e->X_op); fprintf (stdout, " add_number %ld (%lx)\n", @@ -1160,8 +1421,7 @@ pe (e) } static void -ps (s) - symbolS *s; +ps (symbolS *s) { fprintf (stdout, "%s type %s%s", S_GET_NAME (s), @@ -1226,9 +1486,9 @@ pt (t) static bfd_reloc_code_real_type reloc (unsigned int size, - int pcrel, - int sign, - bfd_reloc_code_real_type other) + int pcrel, + int sign, + bfd_reloc_code_real_type other) { if (other != NO_RELOC) { @@ -1237,26 +1497,26 @@ reloc (unsigned int size, if (size == 8) switch (other) { - case BFD_RELOC_X86_64_GOT32: - return BFD_RELOC_X86_64_GOT64; - break; - case BFD_RELOC_X86_64_PLTOFF64: - return BFD_RELOC_X86_64_PLTOFF64; - break; - case BFD_RELOC_X86_64_GOTPC32: - other = BFD_RELOC_X86_64_GOTPC64; - break; - case BFD_RELOC_X86_64_GOTPCREL: - other = BFD_RELOC_X86_64_GOTPCREL64; - break; - case BFD_RELOC_X86_64_TPOFF32: - other = BFD_RELOC_X86_64_TPOFF64; - break; - case BFD_RELOC_X86_64_DTPOFF32: - other = BFD_RELOC_X86_64_DTPOFF64; - break; - default: - break; + case BFD_RELOC_X86_64_GOT32: + return BFD_RELOC_X86_64_GOT64; + break; + case BFD_RELOC_X86_64_PLTOFF64: + return BFD_RELOC_X86_64_PLTOFF64; + break; + case BFD_RELOC_X86_64_GOTPC32: + other = BFD_RELOC_X86_64_GOTPC64; + break; + case BFD_RELOC_X86_64_GOTPCREL: + other = BFD_RELOC_X86_64_GOTPCREL64; + break; + case BFD_RELOC_X86_64_TPOFF32: + other = BFD_RELOC_X86_64_TPOFF64; + break; + case BFD_RELOC_X86_64_DTPOFF32: + other = BFD_RELOC_X86_64_DTPOFF64; + break; + default: + break; } /* Sign-checking 4-byte relocations in 16-/32-bit code is pointless. */ @@ -1275,7 +1535,7 @@ reloc (unsigned int size, else if ((reloc->complain_on_overflow == complain_overflow_signed && !sign) || (reloc->complain_on_overflow == complain_overflow_unsigned - && sign > 0)) + && sign > 0)) as_bad (_("relocated field and relocation type differ in signedness")); else return other; @@ -1324,8 +1584,7 @@ reloc (unsigned int size, some cases we force the original symbol to be used. */ int -tc_i386_fix_adjustable (fixP) - fixS *fixP ATTRIBUTE_UNUSED; +tc_i386_fix_adjustable (fixS *fixP ATTRIBUTE_UNUSED) { #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) if (!IS_ELF) @@ -1378,11 +1637,8 @@ tc_i386_fix_adjustable (fixP) return 1; } -static int intel_float_operand PARAMS ((const char *mnemonic)); - static int -intel_float_operand (mnemonic) - const char *mnemonic; +intel_float_operand (const char *mnemonic) { /* Note that the value returned is meaningful only for opcodes with (memory) operands, hence the code here is free to improperly handle opcodes that @@ -1465,16 +1721,29 @@ md_assemble (line) if (line == NULL) return; + /* The order of the immediates should be reversed + for 2 immediates extrq and insertq instructions */ + if ((i.imm_operands == 2) + && ((strcmp (mnemonic, "extrq") == 0) + || (strcmp (mnemonic, "insertq") == 0))) + { + swap_2_operands (0, 1); + /* "extrq" and insertq" are the only two instructions whose operands + have to be reversed even though they have two immediate operands. + */ + if (intel_syntax) + swap_operands (); + } + /* Now we've parsed the mnemonic into a set of templates, and have the operands at hand. */ /* All intel opcodes have reversed operands except for "bound" and "enter". We also don't reverse intersegment "jmp" and "call" instructions with 2 immediate operands so that the immediate segment - precedes the offset, as it does when in AT&T mode. "enter" and the - intersegment "jmp" and "call" instructions are the only ones that - have two immediate operands. */ - if (intel_syntax && i.operands > 1 + precedes the offset, as it does when in AT&T mode. */ + if (intel_syntax + && i.operands > 1 && (strcmp (mnemonic, "bound") != 0) && (strcmp (mnemonic, "invlpga") != 0) && !((i.types[0] & Imm) && (i.types[1] & Imm))) @@ -1502,7 +1771,7 @@ md_assemble (line) /* Undo SYSV386_COMPAT brokenness when in Intel mode. See i386.h */ if (SYSV386_COMPAT && (i.tm.base_opcode & 0xfffffde0) == 0xdce0) - i.tm.base_opcode ^= FloatR; + i.tm.base_opcode ^= Opcode_FloatR; /* Zap movzx and movsx suffix. The suffix may have been set from "word ptr" or "byte ptr" on the source operand, but we'll use @@ -1556,9 +1825,9 @@ md_assemble (line) { expressionS *exp; - if ((i.tm.cpu_flags & CpuPNI) && i.operands > 0) + if ((i.tm.cpu_flags & CpuSSE3) && i.operands > 0) { - /* These Intel Prescott New Instructions have the fixed + /* Streaming SIMD extensions 3 Instructions have the fixed operands with an opcode suffix which is coded in the same place as an 8-bit immediate field would be. Here we check those operands and remove them afterwards. */ @@ -1566,8 +1835,11 @@ md_assemble (line) for (x = 0; x < i.operands; x++) if (i.op[x].regs->reg_num != x) - as_bad (_("can't use register '%%%s' as operand %d in '%s'."), - i.op[x].regs->reg_name, x + 1, i.tm.name); + as_bad (_("can't use register '%s%s' as operand %d in '%s'."), + register_prefix, + i.op[x].regs->reg_name, + x + 1, + i.tm.name); i.operands = 0; } @@ -1616,7 +1888,7 @@ md_assemble (line) } if ((i.tm.opcode_modifier & Rex64) != 0) - i.rex |= REX_MODE64; + i.rex |= REX_W; /* For 8 bit registers we need an empty rex prefix. Also if the instruction already has a prefix, we need to convert old @@ -1640,8 +1912,9 @@ md_assemble (line) { /* In case it is "hi" register, give up. */ if (i.op[x].regs->reg_num > 3) - as_bad (_("can't encode register '%%%s' in an instruction requiring REX prefix."), - i.op[x].regs->reg_name); + as_bad (_("can't encode register '%s%s' in an " + "instruction requiring REX prefix."), + register_prefix, i.op[x].regs->reg_name); /* Otherwise it is equivalent to the extended register. Since the encoding doesn't change this is merely @@ -1660,9 +1933,7 @@ md_assemble (line) } static char * -parse_insn (line, mnemonic) - char *line; - char *mnemonic; +parse_insn (char *line, char *mnemonic) { char *l = line; char *token_start = l; @@ -1832,9 +2103,9 @@ parse_insn (line, mnemonic) { if (!((t->cpu_flags & ~(Cpu64 | CpuNo64)) & ~(cpu_arch_flags & ~(Cpu64 | CpuNo64)))) - supported |= 1; + supported |= 1; if (!(t->cpu_flags & (flag_code == CODE_64BIT ? CpuNo64 : Cpu64))) - supported |= 2; + supported |= 2; } if (!(supported & 2)) { @@ -1867,7 +2138,7 @@ parse_insn (line, mnemonic) if (t >= current_templates->end) { as_bad (_("expecting string instruction after `%s'"), - expecting_string_instruction); + expecting_string_instruction); return NULL; } for (override.start = t; t < current_templates->end; ++t) @@ -1881,9 +2152,7 @@ parse_insn (line, mnemonic) } static char * -parse_operands (l, mnemonic) - char *l; - const char *mnemonic; +parse_operands (char *l, const char *mnemonic) { char *token_start; @@ -2001,24 +2270,12 @@ parse_operands (l, mnemonic) } static void -swap_operands () +swap_2_operands (int xchg1, int xchg2) { union i386_op temp_op; unsigned int temp_type; enum bfd_reloc_code_real temp_reloc; - int xchg1 = 0; - int xchg2 = 0; - if (i.operands == 2) - { - xchg1 = 0; - xchg2 = 1; - } - else if (i.operands == 3) - { - xchg1 = 0; - xchg2 = 2; - } temp_type = i.types[xchg2]; i.types[xchg2] = i.types[xchg1]; i.types[xchg1] = temp_type; @@ -2028,6 +2285,22 @@ swap_operands () temp_reloc = i.reloc[xchg2]; i.reloc[xchg2] = i.reloc[xchg1]; i.reloc[xchg1] = temp_reloc; +} + +static void +swap_operands (void) +{ + switch (i.operands) + { + case 4: + swap_2_operands (1, i.operands - 2); + case 3: + case 2: + swap_2_operands (0, i.operands - 1); + break; + default: + abort (); + } if (i.mem_operands == 2) { @@ -2041,7 +2314,7 @@ swap_operands () /* Try to ensure constant immediates are represented in the smallest opcode possible. */ static void -optimize_imm () +optimize_imm (void) { char guess_suffix = 0; int op; @@ -2131,8 +2404,10 @@ optimize_imm () unsigned int mask, allowed = 0; const template *t; - for (t = current_templates->start; t < current_templates->end; ++t) - allowed |= t->operand_types[op]; + for (t = current_templates->start; + t < current_templates->end; + ++t) + allowed |= t->operand_types[op]; switch (guess_suffix) { case QWORD_MNEM_SUFFIX: @@ -2151,8 +2426,8 @@ optimize_imm () mask = 0; break; } - if (mask & allowed) - i.types[op] &= mask; + if (mask & allowed) + i.types[op] &= mask; } break; } @@ -2161,7 +2436,7 @@ optimize_imm () /* Try to use the smallest displacement type too. */ static void -optimize_disp () +optimize_disp (void) { int op; @@ -2225,13 +2500,20 @@ optimize_disp () } static int -match_template () +match_template (void) { /* Points to template once we've found it. */ const template *t; - unsigned int overlap0, overlap1, overlap2; + unsigned int overlap0, overlap1, overlap2, overlap3; unsigned int found_reverse_match; int suffix_check; + unsigned int operand_types [MAX_OPERANDS]; + int addr_prefix_disp; + unsigned int j; + +#if MAX_OPERANDS != 4 +# error "MAX_OPERANDS must be 4." +#endif #define MATCH(overlap, given, template) \ ((overlap & ~JumpAbsolute) \ @@ -2249,7 +2531,11 @@ match_template () overlap0 = 0; overlap1 = 0; overlap2 = 0; + overlap3 = 0; found_reverse_match = 0; + for (j = 0; j < MAX_OPERANDS; j++) + operand_types [j] = 0; + addr_prefix_disp = -1; suffix_check = (i.suffix == BYTE_MNEM_SUFFIX ? No_bSuf : (i.suffix == WORD_MNEM_SUFFIX @@ -2265,6 +2551,8 @@ match_template () for (t = current_templates->start; t < current_templates->end; t++) { + addr_prefix_disp = -1; + /* Must have right number of operands. */ if (i.operands != t->operands) continue; @@ -2275,6 +2563,9 @@ match_template () && (t->opcode_modifier & IgnoreSize))) continue; + for (j = 0; j < MAX_OPERANDS; j++) + operand_types [j] = t->operand_types [j]; + /* In general, don't allow 64-bit operands in 32-bit mode. */ if (i.suffix == QWORD_MNEM_SUFFIX && flag_code != CODE_64BIT @@ -2282,8 +2573,8 @@ match_template () ? (!(t->opcode_modifier & IgnoreSize) && !intel_float_operand (t->name)) : intel_float_operand (t->name) != 2) - && (!(t->operand_types[0] & (RegMMX | RegXMM)) - || !(t->operand_types[t->operands > 1] & (RegMMX | RegXMM))) + && (!(operand_types[0] & (RegMMX | RegXMM)) + || !(operand_types[t->operands > 1] & (RegMMX | RegXMM))) && (t->base_opcode != 0x0fc7 || t->extension_opcode != 1 /* cmpxchg8b */)) continue; @@ -2297,66 +2588,142 @@ match_template () break; } - overlap0 = i.types[0] & t->operand_types[0]; + /* Address size prefix will turn Disp64/Disp32/Disp16 operand + into Disp32/Disp16/Disp32 operand. */ + if (i.prefix[ADDR_PREFIX] != 0) + { + unsigned int DispOn = 0, DispOff = 0; + + switch (flag_code) + { + case CODE_16BIT: + DispOn = Disp32; + DispOff = Disp16; + break; + case CODE_32BIT: + DispOn = Disp16; + DispOff = Disp32; + break; + case CODE_64BIT: + DispOn = Disp32; + DispOff = Disp64; + break; + } + + for (j = 0; j < MAX_OPERANDS; j++) + { + /* There should be only one Disp operand. */ + if ((operand_types[j] & DispOff)) + { + addr_prefix_disp = j; + operand_types[j] |= DispOn; + operand_types[j] &= ~DispOff; + break; + } + } + } + + overlap0 = i.types[0] & operand_types[0]; switch (t->operands) { case 1: - if (!MATCH (overlap0, i.types[0], t->operand_types[0])) + if (!MATCH (overlap0, i.types[0], operand_types[0])) continue; break; case 2: + /* xchg %eax, %eax is a special case. It is an aliase for nop + only in 32bit mode and we can use opcode 0x90. In 64bit + mode, we can't use 0x90 for xchg %eax, %eax since it should + zero-extend %eax to %rax. */ + if (flag_code == CODE_64BIT + && t->base_opcode == 0x90 + && i.types [0] == (Acc | Reg32) + && i.types [1] == (Acc | Reg32)) + continue; case 3: - overlap1 = i.types[1] & t->operand_types[1]; - if (!MATCH (overlap0, i.types[0], t->operand_types[0]) - || !MATCH (overlap1, i.types[1], t->operand_types[1]) + case 4: + overlap1 = i.types[1] & operand_types[1]; + if (!MATCH (overlap0, i.types[0], operand_types[0]) + || !MATCH (overlap1, i.types[1], operand_types[1]) /* monitor in SSE3 is a very special case. The first - register and the second register may have differnet - sizes. */ + register and the second register may have different + sizes. The same applies to crc32 in SSE4.2. */ || !((t->base_opcode == 0x0f01 && t->extension_opcode == 0xc8) + || t->base_opcode == 0xf20f38f1 || CONSISTENT_REGISTER_MATCH (overlap0, i.types[0], - t->operand_types[0], + operand_types[0], overlap1, i.types[1], - t->operand_types[1]))) + operand_types[1]))) { /* Check if other direction is valid ... */ if ((t->opcode_modifier & (D | FloatD)) == 0) continue; /* Try reversing direction of operands. */ - overlap0 = i.types[0] & t->operand_types[1]; - overlap1 = i.types[1] & t->operand_types[0]; - if (!MATCH (overlap0, i.types[0], t->operand_types[1]) - || !MATCH (overlap1, i.types[1], t->operand_types[0]) + overlap0 = i.types[0] & operand_types[1]; + overlap1 = i.types[1] & operand_types[0]; + if (!MATCH (overlap0, i.types[0], operand_types[1]) + || !MATCH (overlap1, i.types[1], operand_types[0]) || !CONSISTENT_REGISTER_MATCH (overlap0, i.types[0], - t->operand_types[1], + operand_types[1], overlap1, i.types[1], - t->operand_types[0])) + operand_types[0])) { /* Does not match either direction. */ continue; } /* found_reverse_match holds which of D or FloatDR we've found. */ - found_reverse_match = t->opcode_modifier & (D | FloatDR); + if ((t->opcode_modifier & D)) + found_reverse_match = Opcode_D; + else if ((t->opcode_modifier & FloatD)) + found_reverse_match = Opcode_FloatD; + else + found_reverse_match = 0; + if ((t->opcode_modifier & FloatR)) + found_reverse_match |= Opcode_FloatR; } - /* Found a forward 2 operand match here. */ - else if (t->operands == 3) + else { - /* Here we make use of the fact that there are no - reverse match 3 operand instructions, and all 3 - operand instructions only need to be checked for - register consistency between operands 2 and 3. */ - overlap2 = i.types[2] & t->operand_types[2]; - if (!MATCH (overlap2, i.types[2], t->operand_types[2]) - || !CONSISTENT_REGISTER_MATCH (overlap1, i.types[1], - t->operand_types[1], - overlap2, i.types[2], - t->operand_types[2])) + /* Found a forward 2 operand match here. */ + switch (t->operands) + { + case 4: + overlap3 = i.types[3] & operand_types[3]; + case 3: + overlap2 = i.types[2] & operand_types[2]; + break; + } - continue; + switch (t->operands) + { + case 4: + if (!MATCH (overlap3, i.types[3], operand_types[3]) + || !CONSISTENT_REGISTER_MATCH (overlap2, + i.types[2], + operand_types[2], + overlap3, + i.types[3], + operand_types[3])) + continue; + case 3: + /* Here we make use of the fact that there are no + reverse match 3 operand instructions, and all 3 + operand instructions only need to be checked for + register consistency between operands 2 and 3. */ + if (!MATCH (overlap2, i.types[2], operand_types[2]) + || !CONSISTENT_REGISTER_MATCH (overlap1, + i.types[1], + operand_types[1], + overlap2, + i.types[2], + operand_types[2])) + continue; + break; + } } - /* Found either forward/reverse 2 or 3 operand match here: + /* Found either forward/reverse 2, 3 or 4 operand match here: slip through to break. */ } if (t->cpu_flags & ~cpu_arch_flags) @@ -2380,7 +2747,7 @@ match_template () { if (!intel_syntax && ((i.types[0] & JumpAbsolute) - != (t->operand_types[0] & JumpAbsolute))) + != (operand_types[0] & JumpAbsolute))) { as_warn (_("indirect %s without `*'"), t->name); } @@ -2396,6 +2763,11 @@ match_template () /* Copy the template we found. */ i.tm = *t; + + if (addr_prefix_disp != -1) + i.tm.operand_types[addr_prefix_disp] + = operand_types[addr_prefix_disp]; + if (found_reverse_match) { /* If we found a reverse match we must alter the opcode @@ -2404,15 +2776,15 @@ match_template () i.tm.base_opcode ^= found_reverse_match; - i.tm.operand_types[0] = t->operand_types[1]; - i.tm.operand_types[1] = t->operand_types[0]; + i.tm.operand_types[0] = operand_types[1]; + i.tm.operand_types[1] = operand_types[0]; } return 1; } static int -check_string () +check_string (void) { int mem_op = (i.types[0] & AnyMem) ? 0 : 1; if ((i.tm.operand_types[mem_op] & EsSeg) != 0) @@ -2465,19 +2837,44 @@ process_suffix (void) { /* We take i.suffix from the last register operand specified, Destination register type is more significant than source - register type. */ - int op; - - for (op = i.operands; --op >= 0;) - if ((i.types[op] & Reg) - && !(i.tm.operand_types[op] & InOutPortReg)) - { - i.suffix = ((i.types[op] & Reg8) ? BYTE_MNEM_SUFFIX : - (i.types[op] & Reg16) ? WORD_MNEM_SUFFIX : - (i.types[op] & Reg64) ? QWORD_MNEM_SUFFIX : + register type. crc32 in SSE4.2 prefers source register + type. */ + if (i.tm.base_opcode == 0xf20f38f1) + { + if ((i.types[0] & Reg)) + i.suffix = ((i.types[0] & Reg16) ? WORD_MNEM_SUFFIX : LONG_MNEM_SUFFIX); - break; - } + } + else if (i.tm.base_opcode == 0xf20f38f0) + { + if ((i.types[0] & Reg8)) + i.suffix = BYTE_MNEM_SUFFIX; + } + + if (!i.suffix) + { + int op; + + if (i.tm.base_opcode == 0xf20f38f1 + || i.tm.base_opcode == 0xf20f38f0) + { + /* We have to know the operand size for crc32. */ + as_bad (_("ambiguous memory operand size for `%s`"), + i.tm.name); + return 0; + } + + for (op = i.operands; --op >= 0;) + if ((i.types[op] & Reg) + && !(i.tm.operand_types[op] & InOutPortReg)) + { + i.suffix = ((i.types[op] & Reg8) ? BYTE_MNEM_SUFFIX : + (i.types[op] & Reg16) ? WORD_MNEM_SUFFIX : + (i.types[op] & Reg64) ? QWORD_MNEM_SUFFIX : + LONG_MNEM_SUFFIX); + break; + } + } } else if (i.suffix == BYTE_MNEM_SUFFIX) { @@ -2515,9 +2912,9 @@ process_suffix (void) else if (intel_syntax && !i.suffix && ((i.tm.operand_types[0] & JumpAbsolute) - || (i.tm.opcode_modifier & (JumpByte|JumpInterSegment)) - || (i.tm.base_opcode == 0x0f01 /* [ls][gi]dt */ - && i.tm.extension_opcode <= 3))) + || (i.tm.opcode_modifier & (JumpByte|JumpInterSegment)) + || (i.tm.base_opcode == 0x0f01 /* [ls][gi]dt */ + && i.tm.extension_opcode <= 3))) { switch (flag_code) { @@ -2544,19 +2941,20 @@ process_suffix (void) { if (i.tm.opcode_modifier & W) { - as_bad (_("no instruction mnemonic suffix given and no register operands; can't size instruction")); + as_bad (_("no instruction mnemonic suffix given and " + "no register operands; can't size instruction")); return 0; } } else { - unsigned int suffixes = ~i.tm.opcode_modifier - & (No_bSuf - | No_wSuf - | No_lSuf - | No_sSuf - | No_xSuf - | No_qSuf); + unsigned int suffixes = (~i.tm.opcode_modifier + & (No_bSuf + | No_wSuf + | No_lSuf + | No_sSuf + | No_xSuf + | No_qSuf)); if ((i.tm.opcode_modifier & W) || ((suffixes & (suffixes - 1)) @@ -2615,7 +3013,15 @@ process_suffix (void) if (i.suffix == QWORD_MNEM_SUFFIX && flag_code == CODE_64BIT && (i.tm.opcode_modifier & NoRex64) == 0) - i.rex |= REX_MODE64; + { + /* Special case for xchg %rax,%rax. It is NOP and doesn't + need rex64. */ + if (i.operands != 2 + || i.types [0] != (Acc | Reg64) + || i.types [1] != (Acc | Reg64) + || i.tm.base_opcode != 0x90) + i.rex |= REX_W; + } /* Size floating point instruction. */ if (i.suffix == LONG_MNEM_SUFFIX) @@ -2648,6 +3054,10 @@ check_byte_reg (void) || i.tm.base_opcode == 0xfbf)) continue; + /* crc32 doesn't generate this warning. */ + if (i.tm.base_opcode == 0xf20f38f0) + continue; + if ((i.types[op] & WordReg) && i.op[op].regs->reg_num < 4) { /* Prohibit these changes in the 64bit mode, since the @@ -2655,18 +3065,20 @@ check_byte_reg (void) if (flag_code == CODE_64BIT && (i.tm.operand_types[op] & InOutPortReg) == 0) { - as_bad (_("Incorrect register `%%%s' used with `%c' suffix"), - i.op[op].regs->reg_name, + as_bad (_("Incorrect register `%s%s' used with `%c' suffix"), + register_prefix, i.op[op].regs->reg_name, i.suffix); return 0; } #if REGISTER_WARNINGS if (!quiet_warnings && (i.tm.operand_types[op] & InOutPortReg) == 0) - as_warn (_("using `%%%s' instead of `%%%s' due to `%c' suffix"), + as_warn (_("using `%s%s' instead of `%s%s' due to `%c' suffix"), + register_prefix, (i.op[op].regs + (i.types[op] & Reg16 ? REGNAM_AL - REGNAM_AX : REGNAM_AL - REGNAM_EAX))->reg_name, + register_prefix, i.op[op].regs->reg_name, i.suffix); #endif @@ -2678,7 +3090,8 @@ check_byte_reg (void) | Control | Debug | Test | FloatReg | FloatAcc)) { - as_bad (_("`%%%s' not allowed with `%s%c'"), + as_bad (_("`%s%s' not allowed with `%s%c'"), + register_prefix, i.op[op].regs->reg_name, i.tm.name, i.suffix); @@ -2689,7 +3102,7 @@ check_byte_reg (void) } static int -check_long_reg () +check_long_reg (void) { int op; @@ -2699,7 +3112,8 @@ check_long_reg () if ((i.types[op] & Reg8) != 0 && (i.tm.operand_types[op] & (Reg16 | Reg32 | Acc)) != 0) { - as_bad (_("`%%%s' not allowed with `%s%c'"), + as_bad (_("`%s%s' not allowed with `%s%c'"), + register_prefix, i.op[op].regs->reg_name, i.tm.name, i.suffix); @@ -2714,15 +3128,17 @@ check_long_reg () lowering is more complicated. */ if (flag_code == CODE_64BIT) { - as_bad (_("Incorrect register `%%%s' used with `%c' suffix"), - i.op[op].regs->reg_name, + as_bad (_("Incorrect register `%s%s' used with `%c' suffix"), + register_prefix, i.op[op].regs->reg_name, i.suffix); return 0; } #if REGISTER_WARNINGS else - as_warn (_("using `%%%s' instead of `%%%s' due to `%c' suffix"), + as_warn (_("using `%s%s' instead of `%s%s' due to `%c' suffix"), + register_prefix, (i.op[op].regs + REGNAM_EAX - REGNAM_AX)->reg_name, + register_prefix, i.op[op].regs->reg_name, i.suffix); #endif @@ -2731,8 +3147,8 @@ check_long_reg () else if ((i.types[op] & Reg64) != 0 && (i.tm.operand_types[op] & (Reg32 | Acc)) != 0) { - as_bad (_("Incorrect register `%%%s' used with `%c' suffix"), - i.op[op].regs->reg_name, + as_bad (_("Incorrect register `%s%s' used with `%c' suffix"), + register_prefix, i.op[op].regs->reg_name, i.suffix); return 0; } @@ -2740,7 +3156,7 @@ check_long_reg () } static int -check_qword_reg () +check_qword_reg (void) { int op; @@ -2750,7 +3166,8 @@ check_qword_reg () if ((i.types[op] & Reg8) != 0 && (i.tm.operand_types[op] & (Reg16 | Reg32 | Acc)) != 0) { - as_bad (_("`%%%s' not allowed with `%s%c'"), + as_bad (_("`%s%s' not allowed with `%s%c'"), + register_prefix, i.op[op].regs->reg_name, i.tm.name, i.suffix); @@ -2763,8 +3180,8 @@ check_qword_reg () { /* Prohibit these changes in the 64bit mode, since the lowering is more complicated. */ - as_bad (_("Incorrect register `%%%s' used with `%c' suffix"), - i.op[op].regs->reg_name, + as_bad (_("Incorrect register `%s%s' used with `%c' suffix"), + register_prefix, i.op[op].regs->reg_name, i.suffix); return 0; } @@ -2772,7 +3189,7 @@ check_qword_reg () } static int -check_word_reg () +check_word_reg (void) { int op; for (op = i.operands; --op >= 0;) @@ -2781,7 +3198,8 @@ check_word_reg () if ((i.types[op] & Reg8) != 0 && (i.tm.operand_types[op] & (Reg16 | Reg32 | Acc)) != 0) { - as_bad (_("`%%%s' not allowed with `%s%c'"), + as_bad (_("`%s%s' not allowed with `%s%c'"), + register_prefix, i.op[op].regs->reg_name, i.tm.name, i.suffix); @@ -2796,15 +3214,17 @@ check_word_reg () lowering is more complicated. */ if (flag_code == CODE_64BIT) { - as_bad (_("Incorrect register `%%%s' used with `%c' suffix"), - i.op[op].regs->reg_name, + as_bad (_("Incorrect register `%s%s' used with `%c' suffix"), + register_prefix, i.op[op].regs->reg_name, i.suffix); return 0; } else #if REGISTER_WARNINGS - as_warn (_("using `%%%s' instead of `%%%s' due to `%c' suffix"), + as_warn (_("using `%s%s' instead of `%s%s' due to `%c' suffix"), + register_prefix, (i.op[op].regs + REGNAM_AX - REGNAM_EAX)->reg_name, + register_prefix, i.op[op].regs->reg_name, i.suffix); #endif @@ -2813,7 +3233,7 @@ check_word_reg () } static int -finalize_imm () +finalize_imm (void) { unsigned int overlap0, overlap1, overlap2; @@ -2844,7 +3264,8 @@ finalize_imm () && overlap0 != Imm16 && overlap0 != Imm32S && overlap0 != Imm32 && overlap0 != Imm64) { - as_bad (_("no instruction mnemonic suffix given; can't determine immediate size")); + as_bad (_("no instruction mnemonic suffix given; " + "can't determine immediate size")); return 0; } } @@ -2877,7 +3298,9 @@ finalize_imm () && overlap1 != Imm16 && overlap1 != Imm32S && overlap1 != Imm32 && overlap1 != Imm64) { - as_bad (_("no instruction mnemonic suffix given; can't determine immediate size %x %c"),overlap1, i.suffix); + as_bad (_("no instruction mnemonic suffix given; " + "can't determine immediate size %x %c"), + overlap1, i.suffix); return 0; } } @@ -2891,7 +3314,7 @@ finalize_imm () } static int -process_operands () +process_operands (void) { /* Default segment register this instruction will use for memory accesses. 0 means unknown. This is only for optimizing out @@ -2901,40 +3324,90 @@ process_operands () /* The imul $imm, %reg instruction is converted into imul $imm, %reg, %reg, and the clr %reg instruction is converted into xor %reg, %reg. */ - if (i.tm.opcode_modifier & regKludge) + if (i.tm.opcode_modifier & RegKludge) { - unsigned int first_reg_op = (i.types[0] & Reg) ? 0 : 1; - /* Pretend we saw the extra register operand. */ - assert (i.op[first_reg_op + 1].regs == 0); - i.op[first_reg_op + 1].regs = i.op[first_reg_op].regs; - i.types[first_reg_op + 1] = i.types[first_reg_op]; - i.reg_operands = 2; + if ((i.tm.cpu_flags & CpuSSE4_1)) + { + /* The first operand in instruction blendvpd, blendvps and + pblendvb in SSE4.1 is implicit and must be xmm0. */ + assert (i.operands == 3 + && i.reg_operands >= 2 + && i.types[0] == RegXMM); + if (i.op[0].regs->reg_num != 0) + { + if (intel_syntax) + as_bad (_("the last operand of `%s' must be `%sxmm0'"), + i.tm.name, register_prefix); + else + as_bad (_("the first operand of `%s' must be `%sxmm0'"), + i.tm.name, register_prefix); + return 0; + } + i.op[0] = i.op[1]; + i.op[1] = i.op[2]; + i.types[0] = i.types[1]; + i.types[1] = i.types[2]; + i.operands--; + i.reg_operands--; + + /* We need to adjust fields in i.tm since they are used by + build_modrm_byte. */ + i.tm.operand_types [0] = i.tm.operand_types [1]; + i.tm.operand_types [1] = i.tm.operand_types [2]; + i.tm.operands--; + } + else + { + unsigned int first_reg_op = (i.types[0] & Reg) ? 0 : 1; + /* Pretend we saw the extra register operand. */ + assert (i.reg_operands == 1 + && i.op[first_reg_op + 1].regs == 0); + i.op[first_reg_op + 1].regs = i.op[first_reg_op].regs; + i.types[first_reg_op + 1] = i.types[first_reg_op]; + i.operands++; + i.reg_operands++; + } } if (i.tm.opcode_modifier & ShortForm) { - /* The register or float register operand is in operand 0 or 1. */ - unsigned int op = (i.types[0] & (Reg | FloatReg)) ? 0 : 1; - /* Register goes in low 3 bits of opcode. */ - i.tm.base_opcode |= i.op[op].regs->reg_num; - if ((i.op[op].regs->reg_flags & RegRex) != 0) - i.rex |= REX_EXTZ; - if (!quiet_warnings && (i.tm.opcode_modifier & Ugh) != 0) + if (i.types[0] & (SReg2 | SReg3)) { - /* Warn about some common errors, but press on regardless. - The first case can be generated by gcc (<= 2.8.1). */ - if (i.operands == 2) + if (i.tm.base_opcode == POP_SEG_SHORT + && i.op[0].regs->reg_num == 1) { - /* Reversed arguments on faddp, fsubp, etc. */ - as_warn (_("translating to `%s %%%s,%%%s'"), i.tm.name, - i.op[1].regs->reg_name, - i.op[0].regs->reg_name); + as_bad (_("you can't `pop %%cs'")); + return 0; } - else + i.tm.base_opcode |= (i.op[0].regs->reg_num << 3); + if ((i.op[0].regs->reg_flags & RegRex) != 0) + i.rex |= REX_B; + } + else + { + /* The register or float register operand is in operand 0 or 1. */ + unsigned int op = (i.types[0] & (Reg | FloatReg)) ? 0 : 1; + /* Register goes in low 3 bits of opcode. */ + i.tm.base_opcode |= i.op[op].regs->reg_num; + if ((i.op[op].regs->reg_flags & RegRex) != 0) + i.rex |= REX_B; + if (!quiet_warnings && (i.tm.opcode_modifier & Ugh) != 0) { - /* Extraneous `l' suffix on fp insn. */ - as_warn (_("translating to `%s %%%s'"), i.tm.name, - i.op[0].regs->reg_name); + /* Warn about some common errors, but press on regardless. + The first case can be generated by gcc (<= 2.8.1). */ + if (i.operands == 2) + { + /* Reversed arguments on faddp, fsubp, etc. */ + as_warn (_("translating to `%s %s%s,%s%s'"), i.tm.name, + register_prefix, i.op[1].regs->reg_name, + register_prefix, i.op[0].regs->reg_name); + } + else + { + /* Extraneous `l' suffix on fp insn. */ + as_warn (_("translating to `%s %s%s'"), i.tm.name, + register_prefix, i.op[0].regs->reg_name); + } } } } @@ -2946,19 +3419,7 @@ process_operands () default_seg = build_modrm_byte (); } - else if (i.tm.opcode_modifier & (Seg2ShortForm | Seg3ShortForm)) - { - if (i.tm.base_opcode == POP_SEG_SHORT - && i.op[0].regs->reg_num == 1) - { - as_bad (_("you can't `pop %%cs'")); - return 0; - } - i.tm.base_opcode |= (i.op[0].regs->reg_num << 3); - if ((i.op[0].regs->reg_flags & RegRex) != 0) - i.rex |= REX_EXTZ; - } - else if ((i.tm.base_opcode & ~(D | W)) == MOV_AX_DISP32) + else if ((i.tm.base_opcode & ~0x3) == MOV_AX_DISP32) { default_seg = &ds; } @@ -2988,7 +3449,7 @@ process_operands () } static const seg_entry * -build_modrm_byte () +build_modrm_byte (void) { const seg_entry *default_seg = 0; @@ -2997,11 +3458,33 @@ build_modrm_byte () if (i.reg_operands == 2) { unsigned int source, dest; - source = ((i.types[0] - & (Reg | RegMMX | RegXMM - | SReg2 | SReg3 - | Control | Debug | Test)) - ? 0 : 1); + + switch (i.operands) + { + case 2: + source = 0; + break; + case 3: + /* When there are 3 operands, one of them may be immediate, + which may be the first or the last operand. Otherwise, + the first operand must be shift count register (cl). */ + assert (i.imm_operands == 1 + || (i.imm_operands == 0 + && (i.types[0] & ShiftCount))); + source = (i.types[0] & (Imm | ShiftCount)) ? 1 : 0; + break; + case 4: + /* When there are 4 operands, the first two must be immediate + operands. The source operand will be the 3rd one. */ + assert (i.imm_operands == 2 + && (i.types[0] & Imm) + && (i.types[1] & Imm)); + source = 2; + break; + default: + abort (); + } + dest = source + 1; i.rm.mode = 3; @@ -3011,29 +3494,29 @@ build_modrm_byte () destination operand, then we assume the source operand may sometimes be a memory operand and so we need to store the destination in the i.rm.reg field. */ - if ((i.tm.operand_types[dest] & AnyMem) == 0) + if ((i.tm.operand_types[dest] & (AnyMem | RegMem)) == 0) { i.rm.reg = i.op[dest].regs->reg_num; i.rm.regmem = i.op[source].regs->reg_num; if ((i.op[dest].regs->reg_flags & RegRex) != 0) - i.rex |= REX_EXTX; + i.rex |= REX_R; if ((i.op[source].regs->reg_flags & RegRex) != 0) - i.rex |= REX_EXTZ; + i.rex |= REX_B; } else { i.rm.reg = i.op[source].regs->reg_num; i.rm.regmem = i.op[dest].regs->reg_num; if ((i.op[dest].regs->reg_flags & RegRex) != 0) - i.rex |= REX_EXTZ; + i.rex |= REX_B; if ((i.op[source].regs->reg_flags & RegRex) != 0) - i.rex |= REX_EXTX; + i.rex |= REX_R; } - if (flag_code != CODE_64BIT && (i.rex & (REX_EXTX | REX_EXTZ))) + if (flag_code != CODE_64BIT && (i.rex & (REX_R | REX_B))) { if (!((i.types[0] | i.types[1]) & Control)) abort (); - i.rex &= ~(REX_EXTX | REX_EXTZ); + i.rex &= ~(REX_R | REX_B); add_prefix (LOCK_PREFIX_OPCODE); } } @@ -3042,9 +3525,12 @@ build_modrm_byte () if (i.mem_operands) { unsigned int fake_zero_displacement = 0; - unsigned int op = ((i.types[0] & AnyMem) - ? 0 - : (i.types[1] & AnyMem) ? 1 : 2); + unsigned int op; + + for (op = 0; op < i.operands; op++) + if ((i.types[op] & AnyMem)) + break; + assert (op < i.operands); default_seg = &ds; @@ -3065,9 +3551,11 @@ build_modrm_byte () i.rm.regmem = ESCAPE_TO_TWO_BYTE_ADDRESSING; i.sib.base = NO_BASE_REGISTER; i.sib.index = NO_INDEX_REGISTER; - i.types[op] = ((i.prefix[ADDR_PREFIX] == 0) ? Disp32S : Disp32); + i.types[op] = ((i.prefix[ADDR_PREFIX] == 0) + ? Disp32S : Disp32); } - else if ((flag_code == CODE_16BIT) ^ (i.prefix[ADDR_PREFIX] != 0)) + else if ((flag_code == CODE_16BIT) + ^ (i.prefix[ADDR_PREFIX] != 0)) { i.rm.regmem = NO_BASE_REGISTER_16; i.types[op] = Disp16; @@ -3090,7 +3578,7 @@ build_modrm_byte () else i.types[op] |= Disp32S; if ((i.index_reg->reg_flags & RegRex) != 0) - i.rex |= REX_EXTY; + i.rex |= REX_X; } } /* RIP addressing for 64bit mode. */ @@ -3099,7 +3587,7 @@ build_modrm_byte () i.rm.regmem = NO_BASE_REGISTER; i.types[op] &= ~ Disp; i.types[op] |= Disp32S; - i.flags[op] = Operand_PCrel; + i.flags[op] |= Operand_PCrel; if (! i.disp_operands) fake_zero_displacement = 1; } @@ -3137,11 +3625,13 @@ build_modrm_byte () { if (flag_code == CODE_64BIT && (i.types[op] & Disp)) - i.types[op] = (i.types[op] & Disp8) | (i.prefix[ADDR_PREFIX] == 0 ? Disp32S : Disp32); + i.types[op] = ((i.types[op] & Disp8) + | (i.prefix[ADDR_PREFIX] == 0 + ? Disp32S : Disp32)); i.rm.regmem = i.base_reg->reg_num; if ((i.base_reg->reg_flags & RegRex) != 0) - i.rex |= REX_EXTZ; + i.rex |= REX_B; i.sib.base = i.base_reg->reg_num; /* x86-64 ignores REX prefix bit here to avoid decoder complications. */ @@ -3178,7 +3668,7 @@ build_modrm_byte () i.sib.index = i.index_reg->reg_num; i.rm.regmem = ESCAPE_TO_TWO_BYTE_ADDRESSING; if ((i.index_reg->reg_flags & RegRex) != 0) - i.rex |= REX_EXTY; + i.rex |= REX_X; } if (i.disp_operands @@ -3211,31 +3701,28 @@ build_modrm_byte () registers are coded into the i.rm.reg field. */ if (i.reg_operands) { - unsigned int op = - ((i.types[0] - & (Reg | RegMMX | RegXMM - | SReg2 | SReg3 - | Control | Debug | Test)) - ? 0 - : ((i.types[1] - & (Reg | RegMMX | RegXMM - | SReg2 | SReg3 - | Control | Debug | Test)) - ? 1 - : 2)); + unsigned int op; + + for (op = 0; op < i.operands; op++) + if ((i.types[op] & (Reg | RegMMX | RegXMM + | SReg2 | SReg3 + | Control | Debug | Test))) + break; + assert (op < i.operands); + /* If there is an extension opcode to put here, the register number must be put into the regmem field. */ if (i.tm.extension_opcode != None) { i.rm.regmem = i.op[op].regs->reg_num; if ((i.op[op].regs->reg_flags & RegRex) != 0) - i.rex |= REX_EXTZ; + i.rex |= REX_B; } else { i.rm.reg = i.op[op].regs->reg_num; if ((i.op[op].regs->reg_flags & RegRex) != 0) - i.rex |= REX_EXTX; + i.rex |= REX_R; } /* Now, if no memory operand has set i.rm.mode = 0, 1, 2 we @@ -3253,7 +3740,7 @@ build_modrm_byte () } static void -output_branch () +output_branch (void) { char *p; int code16; @@ -3331,7 +3818,7 @@ output_branch () } static void -output_jump () +output_jump (void) { char *p; int size; @@ -3397,7 +3884,7 @@ output_jump () } static void -output_interseg_jump () +output_interseg_jump (void) { char *p; int size; @@ -3461,7 +3948,7 @@ output_interseg_jump () } static void -output_insn () +output_insn (void) { fragS *insn_start_frag; offsetT insn_start_off; @@ -3488,10 +3975,12 @@ output_insn () unsigned char *q; unsigned int prefix; - /* All opcodes on i386 have either 1 or 2 bytes. Merom New - Instructions have 3 bytes. We may use one more higher byte - to specify a prefix the instruction requires. */ - if ((i.tm.cpu_flags & CpuMNI) != 0) + /* All opcodes on i386 have either 1 or 2 bytes. SSSE3 and + SSE4 instructions have 3 bytes. We may use one more higher + byte to specify a prefix the instruction requires. Exclude + instructions which are in both SSE4 and ABM. */ + if ((i.tm.cpu_flags & (CpuSSSE3 | CpuSSE4)) != 0 + && (i.tm.cpu_flags & CpuABM) == 0) { if (i.tm.base_opcode & 0xff000000) { @@ -3504,7 +3993,7 @@ output_insn () prefix = (i.tm.base_opcode >> 16) & 0xff; if ((i.tm.cpu_flags & CpuPadLock) != 0) { -check_prefix: + check_prefix: if (prefix != REPE_PREFIX_OPCODE || i.prefix[LOCKREP_PREFIX] != REPE_PREFIX_OPCODE) add_prefix (prefix); @@ -3532,7 +4021,8 @@ check_prefix: } else { - if ((i.tm.cpu_flags & CpuMNI) != 0) + if ((i.tm.cpu_flags & (CpuSSSE3 | CpuSSE4)) != 0 + && (i.tm.cpu_flags & CpuABM) == 0) { p = frag_more (3); *p++ = (i.tm.base_opcode >> 16) & 0xff; @@ -3586,10 +4076,42 @@ check_prefix: #endif /* DEBUG386 */ } +/* Return the size of the displacement operand N. */ + +static int +disp_size (unsigned int n) +{ + int size = 4; + if (i.types[n] & (Disp8 | Disp16 | Disp64)) + { + size = 2; + if (i.types[n] & Disp8) + size = 1; + if (i.types[n] & Disp64) + size = 8; + } + return size; +} + +/* Return the size of the immediate operand N. */ + +static int +imm_size (unsigned int n) +{ + int size = 4; + if (i.types[n] & (Imm8 | Imm8S | Imm16 | Imm64)) + { + size = 2; + if (i.types[n] & (Imm8 | Imm8S)) + size = 1; + if (i.types[n] & Imm64) + size = 8; + } + return size; +} + static void -output_disp (insn_start_frag, insn_start_off) - fragS *insn_start_frag; - offsetT insn_start_off; +output_disp (fragS *insn_start_frag, offsetT insn_start_off) { char *p; unsigned int n; @@ -3600,18 +4122,9 @@ output_disp (insn_start_frag, insn_start_off) { if (i.op[n].disps->X_op == O_constant) { - int size; + int size = disp_size (n); offsetT val; - size = 4; - if (i.types[n] & (Disp8 | Disp16 | Disp64)) - { - size = 2; - if (i.types[n] & Disp8) - size = 1; - if (i.types[n] & Disp64) - size = 8; - } val = offset_in_range (i.op[n].disps->X_add_number, size); p = frag_more (size); @@ -3620,45 +4133,32 @@ output_disp (insn_start_frag, insn_start_off) else { enum bfd_reloc_code_real reloc_type; - int size = 4; - int sign = 0; + int size = disp_size (n); + int sign = (i.types[n] & Disp32S) != 0; int pcrel = (i.flags[n] & Operand_PCrel) != 0; + /* We can't have 8 bit displacement here. */ + assert ((i.types[n] & Disp8) == 0); + /* The PC relative address is computed relative to the instruction boundary, so in case immediate fields follows, we need to adjust the value. */ if (pcrel && i.imm_operands) { - int imm_size = 4; unsigned int n1; + int sz = 0; for (n1 = 0; n1 < i.operands; n1++) if (i.types[n1] & Imm) { - if (i.types[n1] & (Imm8 | Imm8S | Imm16 | Imm64)) - { - imm_size = 2; - if (i.types[n1] & (Imm8 | Imm8S)) - imm_size = 1; - if (i.types[n1] & Imm64) - imm_size = 8; - } - break; + /* Only one immediate is allowed for PC + relative address. */ + assert (sz == 0); + sz = imm_size (n1); + i.op[n].disps->X_add_number -= sz; } /* We should find the immediate. */ - if (n1 == i.operands) - abort (); - i.op[n].disps->X_add_number -= imm_size; - } - - if (i.types[n] & Disp32S) - sign = 1; - - if (i.types[n] & (Disp16 | Disp64)) - { - size = 2; - if (i.types[n] & Disp64) - size = 8; + assert (sz != 0); } p = frag_more (size); @@ -3712,9 +4212,7 @@ output_disp (insn_start_frag, insn_start_off) } static void -output_imm (insn_start_frag, insn_start_off) - fragS *insn_start_frag; - offsetT insn_start_off; +output_imm (fragS *insn_start_frag, offsetT insn_start_off) { char *p; unsigned int n; @@ -3725,18 +4223,9 @@ output_imm (insn_start_frag, insn_start_off) { if (i.op[n].imms->X_op == O_constant) { - int size; + int size = imm_size (n); offsetT val; - size = 4; - if (i.types[n] & (Imm8 | Imm8S | Imm16 | Imm64)) - { - size = 2; - if (i.types[n] & (Imm8 | Imm8S)) - size = 1; - else if (i.types[n] & Imm64) - size = 8; - } val = offset_in_range (i.op[n].imms->X_add_number, size); p = frag_more (size); @@ -3749,21 +4238,15 @@ output_imm (insn_start_frag, insn_start_off) non-absolute imms). Try to support other sizes ... */ enum bfd_reloc_code_real reloc_type; - int size = 4; - int sign = 0; + int size = imm_size (n); + int sign; if ((i.types[n] & (Imm32S)) && (i.suffix == QWORD_MNEM_SUFFIX || (!i.suffix && (i.tm.opcode_modifier & No_lSuf)))) sign = 1; - if (i.types[n] & (Imm8 | Imm8S | Imm16 | Imm64)) - { - size = 2; - if (i.types[n] & (Imm8 | Imm8S)) - size = 1; - if (i.types[n] & Imm64) - size = 8; - } + else + sign = 0; p = frag_more (size); reloc_type = reloc (size, 0, sign, i.reloc[n]); @@ -3857,10 +4340,8 @@ static enum bfd_reloc_code_real got_reloc = NO_RELOC; static int cons_sign = -1; void -x86_cons_fix_new (fragS *frag, - unsigned int off, - unsigned int len, - expressionS *exp) +x86_cons_fix_new (fragS *frag, unsigned int off, unsigned int len, + expressionS *exp) { enum bfd_reloc_code_real r = reloc (len, 0, cons_sign, got_reloc); @@ -3891,8 +4372,8 @@ x86_cons_fix_new (fragS *frag, input line. Otherwise return NULL. */ static char * lex_got (enum bfd_reloc_code_real *reloc, - int *adjust, - unsigned int *types) + int *adjust, + unsigned int *types) { /* Some of the relocations depend on the size of what field is to be relocated. But in our callers i386_immediate and i386_displacement @@ -3904,23 +4385,57 @@ lex_got (enum bfd_reloc_code_real *reloc, const enum bfd_reloc_code_real rel[2]; const unsigned int types64; } gotrel[] = { - { "PLTOFF", { 0, BFD_RELOC_X86_64_PLTOFF64 }, Imm64 }, - { "PLT", { BFD_RELOC_386_PLT32, BFD_RELOC_X86_64_PLT32 }, Imm32|Imm32S|Disp32 }, - { "GOTPLT", { 0, BFD_RELOC_X86_64_GOTPLT64 }, Imm64|Disp64 }, - { "GOTOFF", { BFD_RELOC_386_GOTOFF, BFD_RELOC_X86_64_GOTOFF64 }, Imm64|Disp64 }, - { "GOTPCREL", { 0, BFD_RELOC_X86_64_GOTPCREL }, Imm32|Imm32S|Disp32 }, - { "TLSGD", { BFD_RELOC_386_TLS_GD, BFD_RELOC_X86_64_TLSGD }, Imm32|Imm32S|Disp32 }, - { "TLSLDM", { BFD_RELOC_386_TLS_LDM, 0 }, 0 }, - { "TLSLD", { 0, BFD_RELOC_X86_64_TLSLD }, Imm32|Imm32S|Disp32 }, - { "GOTTPOFF", { BFD_RELOC_386_TLS_IE_32, BFD_RELOC_X86_64_GOTTPOFF }, Imm32|Imm32S|Disp32 }, - { "TPOFF", { BFD_RELOC_386_TLS_LE_32, BFD_RELOC_X86_64_TPOFF32 }, Imm32|Imm32S|Imm64|Disp32|Disp64 }, - { "NTPOFF", { BFD_RELOC_386_TLS_LE, 0 }, 0 }, - { "DTPOFF", { BFD_RELOC_386_TLS_LDO_32, BFD_RELOC_X86_64_DTPOFF32 }, Imm32|Imm32S|Imm64|Disp32|Disp64 }, - { "GOTNTPOFF",{ BFD_RELOC_386_TLS_GOTIE, 0 }, 0 }, - { "INDNTPOFF",{ BFD_RELOC_386_TLS_IE, 0 }, 0 }, - { "GOT", { BFD_RELOC_386_GOT32, BFD_RELOC_X86_64_GOT32 }, Imm32|Imm32S|Disp32|Imm64 }, - { "TLSDESC", { BFD_RELOC_386_TLS_GOTDESC, BFD_RELOC_X86_64_GOTPC32_TLSDESC }, Imm32|Imm32S|Disp32 }, - { "TLSCALL", { BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_X86_64_TLSDESC_CALL }, Imm32|Imm32S|Disp32 } + { "PLTOFF", { 0, + BFD_RELOC_X86_64_PLTOFF64 }, + Imm64 }, + { "PLT", { BFD_RELOC_386_PLT32, + BFD_RELOC_X86_64_PLT32 }, + Imm32 | Imm32S | Disp32 }, + { "GOTPLT", { 0, + BFD_RELOC_X86_64_GOTPLT64 }, + Imm64 | Disp64 }, + { "GOTOFF", { BFD_RELOC_386_GOTOFF, + BFD_RELOC_X86_64_GOTOFF64 }, + Imm64 | Disp64 }, + { "GOTPCREL", { 0, + BFD_RELOC_X86_64_GOTPCREL }, + Imm32 | Imm32S | Disp32 }, + { "TLSGD", { BFD_RELOC_386_TLS_GD, + BFD_RELOC_X86_64_TLSGD }, + Imm32 | Imm32S | Disp32 }, + { "TLSLDM", { BFD_RELOC_386_TLS_LDM, + 0 }, + 0 }, + { "TLSLD", { 0, + BFD_RELOC_X86_64_TLSLD }, + Imm32 | Imm32S | Disp32 }, + { "GOTTPOFF", { BFD_RELOC_386_TLS_IE_32, + BFD_RELOC_X86_64_GOTTPOFF }, + Imm32 | Imm32S | Disp32 }, + { "TPOFF", { BFD_RELOC_386_TLS_LE_32, + BFD_RELOC_X86_64_TPOFF32 }, + Imm32 | Imm32S | Imm64 | Disp32 | Disp64 }, + { "NTPOFF", { BFD_RELOC_386_TLS_LE, + 0 }, + 0 }, + { "DTPOFF", { BFD_RELOC_386_TLS_LDO_32, + BFD_RELOC_X86_64_DTPOFF32 }, + Imm32 | Imm32S | Imm64 | Disp32 | Disp64 }, + { "GOTNTPOFF",{ BFD_RELOC_386_TLS_GOTIE, + 0 }, + 0 }, + { "INDNTPOFF",{ BFD_RELOC_386_TLS_IE, + 0 }, + 0 }, + { "GOT", { BFD_RELOC_386_GOT32, + BFD_RELOC_X86_64_GOT32 }, + Imm32 | Imm32S | Disp32 | Imm64 }, + { "TLSDESC", { BFD_RELOC_386_TLS_GOTDESC, + BFD_RELOC_X86_64_GOTPC32_TLSDESC }, + Imm32 | Imm32S | Disp32 }, + { "TLSCALL", { BFD_RELOC_386_TLS_DESC_CALL, + BFD_RELOC_X86_64_TLSDESC_CALL }, + Imm32 | Imm32S | Disp32 } }; char *cp; unsigned int j; @@ -3951,7 +4466,7 @@ lex_got (enum bfd_reloc_code_real *reloc, if (types) { if (flag_code != CODE_64BIT) - *types = Imm32|Disp32; + *types = Imm32 | Disp32; else *types = gotrel[j].types64; } @@ -3959,9 +4474,6 @@ lex_got (enum bfd_reloc_code_real *reloc, if (GOT_symbol == NULL) GOT_symbol = symbol_find_or_make (GLOBAL_OFFSET_TABLE_NAME); - /* Replace the relocation token with ' ', so that - errors like foo@GOTOFF1 will be detected. */ - /* The length of the first part of our input line. */ first = cp - input_line_pointer; @@ -3977,9 +4489,12 @@ lex_got (enum bfd_reloc_code_real *reloc, be necessary, but be safe. */ tmpbuf = xmalloc (first + second + 2); memcpy (tmpbuf, input_line_pointer, first); - tmpbuf[first] = ' '; - memcpy (tmpbuf + first + 1, past_reloc, second); - tmpbuf[first + second + 1] = '\0'; + if (second != 0 && *past_reloc != ' ') + /* Replace the relocation token with ' ', so that + errors like foo@GOTOFF1 will be detected. */ + tmpbuf[first++] = ' '; + memcpy (tmpbuf + first, past_reloc, second); + tmpbuf[first + second] = '\0'; return tmpbuf; } @@ -3994,9 +4509,7 @@ lex_got (enum bfd_reloc_code_real *reloc, } void -x86_cons (exp, size) - expressionS *exp; - int size; +x86_cons (expressionS *exp, int size) { if (size == 4 || (object_64bit && size == 8)) { @@ -4058,11 +4571,8 @@ pe_directive_secrel (dummy) } #endif -static int i386_immediate PARAMS ((char *)); - static int -i386_immediate (imm_start) - char *imm_start; +i386_immediate (char *imm_start) { char *save_input_line_pointer; char *gotfree_input_line; @@ -4072,7 +4582,8 @@ i386_immediate (imm_start) if (i.imm_operands == MAX_IMMEDIATE_OPERANDS) { - as_bad (_("only 1 or 2 immediate operands are allowed")); + as_bad (_("at most %d immediate operands are allowed"), + MAX_IMMEDIATE_OPERANDS); return 0; } @@ -4114,9 +4625,10 @@ i386_immediate (imm_start) /* Size it properly later. */ i.types[this_operand] |= Imm64; /* If BFD64, sign extend val. */ - if (!use_rela_relocations) - if ((exp->X_add_number & ~(((addressT) 2 << 31) - 1)) == 0) - exp->X_add_number = (exp->X_add_number ^ ((addressT) 1 << 31)) - ((addressT) 1 << 31); + if (!use_rela_relocations + && (exp->X_add_number & ~(((addressT) 2 << 31) - 1)) == 0) + exp->X_add_number + = (exp->X_add_number ^ ((addressT) 1 << 31)) - ((addressT) 1 << 31); } #if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT)) else if (OUTPUT_FLAVOR == bfd_target_aout_flavour @@ -4131,6 +4643,11 @@ i386_immediate (imm_start) return 0; } #endif + else if (!intel_syntax && exp->X_op == O_register) + { + as_bad (_("illegal immediate register operand %s"), imm_start); + return 0; + } else { /* This is an address. The size of the address will be @@ -4143,11 +4660,8 @@ i386_immediate (imm_start) return 1; } -static char *i386_scale PARAMS ((char *)); - static char * -i386_scale (scale) - char *scale; +i386_scale (char *scale) { offsetT val; char *save = input_line_pointer; @@ -4194,12 +4708,8 @@ i386_scale (scale) return scale; } -static int i386_displacement PARAMS ((char *, char *)); - static int -i386_displacement (disp_start, disp_end) - char *disp_start; - char *disp_end; +i386_displacement (char *disp_start, char *disp_end) { expressionS *exp; segT exp_seg = 0; @@ -4208,6 +4718,13 @@ i386_displacement (disp_start, disp_end) int bigdisp, override; unsigned int types = Disp; + if (i.disp_operands == MAX_MEMORY_OPERANDS) + { + as_bad (_("at most %d displacement operands are allowed"), + MAX_MEMORY_OPERANDS); + return 0; + } + if ((i.types[this_operand] & JumpAbsolute) || !(current_templates->start->opcode_modifier & (Jump | JumpDword))) { @@ -4224,9 +4741,9 @@ i386_displacement (disp_start, disp_end) if (flag_code == CODE_64BIT) { if (!bigdisp) - bigdisp = (override || i.suffix == WORD_MNEM_SUFFIX) - ? Disp16 - : Disp32S | Disp32; + bigdisp = ((override || i.suffix == WORD_MNEM_SUFFIX) + ? Disp16 + : Disp32S | Disp32); else if (!override) bigdisp = Disp64 | Disp32S | Disp32; } @@ -4374,14 +4891,11 @@ i386_displacement (disp_start, disp_end) return 1; } -static int i386_index_check PARAMS ((const char *)); - /* Make sure the memory operand we've been dealt is valid. Return 1 on success, 0 on a failure. */ static int -i386_index_check (operand_string) - const char *operand_string; +i386_index_check (const char *operand_string) { int ok; #if INFER_ADDR_PREFIX @@ -4403,9 +4917,9 @@ i386_index_check (operand_string) else if (flag_code == CODE_64BIT) RegXX = i.prefix[ADDR_PREFIX] == 0 ? Reg64 : Reg32; else - RegXX = (flag_code == CODE_16BIT) ^ (i.prefix[ADDR_PREFIX] != 0) - ? Reg16 - : Reg32; + RegXX = ((flag_code == CODE_16BIT) ^ (i.prefix[ADDR_PREFIX] != 0) + ? Reg16 + : Reg32); if (!i.base_reg || !(i.base_reg->reg_type & Acc) || !(i.base_reg->reg_type & RegXX) @@ -4414,17 +4928,17 @@ i386_index_check (operand_string) ok = 0; } else if (flag_code == CODE_64BIT) - { - unsigned RegXX = (i.prefix[ADDR_PREFIX] == 0 ? Reg64 : Reg32); + { + unsigned RegXX = (i.prefix[ADDR_PREFIX] == 0 ? Reg64 : Reg32); - if ((i.base_reg - && ((i.base_reg->reg_type & RegXX) == 0) - && (i.base_reg->reg_type != BaseIndex - || i.index_reg)) - || (i.index_reg - && ((i.index_reg->reg_type & (RegXX | BaseIndex)) - != (RegXX | BaseIndex)))) - ok = 0; + if ((i.base_reg + && ((i.base_reg->reg_type & RegXX) == 0) + && (i.base_reg->reg_type != BaseIndex + || i.index_reg)) + || (i.index_reg + && ((i.index_reg->reg_type & (RegXX | BaseIndex)) + != (RegXX | BaseIndex)))) + ok = 0; } else { @@ -4466,8 +4980,9 @@ i386_index_check (operand_string) FIXME. There doesn't seem to be any real need for separate Disp16 and Disp32 flags. The same goes for Imm16 and Imm32. Removing them would probably clean up the code quite a lot. */ - if (flag_code != CODE_64BIT && (i.types[this_operand] & (Disp16 | Disp32))) - i.types[this_operand] ^= (Disp16 | Disp32); + if (flag_code != CODE_64BIT + && (i.types[this_operand] & (Disp16 | Disp32))) + i.types[this_operand] ^= (Disp16 | Disp32); fudged = 1; goto tryprefix; } @@ -4487,8 +5002,7 @@ i386_index_check (operand_string) on error. */ static int -i386_operand (operand_string) - char *operand_string; +i386_operand (char *operand_string) { const reg_entry *r; char *end_op; @@ -4646,7 +5160,8 @@ i386_operand (operand_string) ++base_string; if (*base_string == ',' - || ((i.base_reg = parse_register (base_string, &end_op)) != NULL)) + || ((i.base_reg = parse_register (base_string, &end_op)) + != NULL)) { displacement_string_end = temp_string; @@ -4666,7 +5181,8 @@ i386_operand (operand_string) if (is_space_char (*base_string)) ++base_string; - if ((i.index_reg = parse_register (base_string, &end_op)) != NULL) + if ((i.index_reg = parse_register (base_string, &end_op)) + != NULL) { base_string = end_op; if (is_space_char (*base_string)) @@ -4679,7 +5195,8 @@ i386_operand (operand_string) } else if (*base_string != ')') { - as_bad (_("expecting `,' or `)' after index register in `%s'"), + as_bad (_("expecting `,' or `)' " + "after index register in `%s'"), operand_string); return 0; } @@ -4703,21 +5220,24 @@ i386_operand (operand_string) ++base_string; if (*base_string != ')') { - as_bad (_("expecting `)' after scale factor in `%s'"), + as_bad (_("expecting `)' " + "after scale factor in `%s'"), operand_string); return 0; } } else if (!i.index_reg) { - as_bad (_("expecting index register or scale factor after `,'; got '%c'"), + as_bad (_("expecting index register or scale factor " + "after `,'; got '%c'"), *base_string); return 0; } } else if (*base_string != ')') { - as_bad (_("expecting `,' or `)' after base register in `%s'"), + as_bad (_("expecting `,' or `)' " + "after base register in `%s'"), operand_string); return 0; } @@ -4933,7 +5453,8 @@ md_convert_frag (abfd, sec, fragP) { if (no_cond_jump_promotion && TYPE_FROM_RELAX_STATE (fragP->fr_subtype) != UNCOND_JUMP) - as_warn_where (fragP->fr_file, fragP->fr_line, _("long jump required")); + as_warn_where (fragP->fr_file, fragP->fr_line, + _("long jump required")); switch (fragP->fr_subtype) { @@ -4984,8 +5505,8 @@ md_convert_frag (abfd, sec, fragP) if (DISP_SIZE_FROM_RELAX_STATE (fragP->fr_subtype) == 4 && object_64bit && ((addressT) (displacement_from_opcode_start - extension - + ((addressT) 1 << 31)) - > (((addressT) 2 << 31) - 1))) + + ((addressT) 1 << 31)) + > (((addressT) 2 << 31) - 1))) { as_bad_where (fragP->fr_file, fragP->fr_line, _("jump target out of range")); @@ -5250,16 +5771,17 @@ md_atof (type, litP, sizeP) return 0; } -static char output_invalid_buf[8]; +static char output_invalid_buf[sizeof (unsigned char) * 2 + 6]; static char * -output_invalid (c) - int c; +output_invalid (int c) { if (ISPRINT (c)) - sprintf (output_invalid_buf, "'%c'", c); + snprintf (output_invalid_buf, sizeof (output_invalid_buf), + "'%c'", c); else - sprintf (output_invalid_buf, "(0x%x)", (unsigned) c); + snprintf (output_invalid_buf, sizeof (output_invalid_buf), + "(0x%x)", (unsigned char) c); return output_invalid_buf; } @@ -5310,14 +5832,16 @@ parse_real_register (char *reg_string, char **end_op) ++s; if (*s >= '0' && *s <= '7') { - r = &i386_float_regtab[*s - '0']; + int fpr = *s - '0'; ++s; if (is_space_char (*s)) ++s; if (*s == ')') { *end_op = s + 1; - return r; + r = hash_find (reg_hash, "st(0)"); + know (r); + return r + fpr; } } /* We have "%st(" then garbage. */ @@ -5359,7 +5883,8 @@ parse_register (char *reg_string, char **end_op) const expressionS *e = symbol_get_value_expression (symbolP); know (e->X_op == O_register); - know (e->X_add_number >= 0 && (valueT) e->X_add_number < ARRAY_SIZE (i386_regtab)); + know (e->X_add_number >= 0 + && (valueT) e->X_add_number < i386_regtab_size); r = i386_regtab + e->X_add_number; *end_op = input_line_pointer; } @@ -5417,22 +5942,27 @@ const char *md_shortopts = "qn"; #define OPTION_32 (OPTION_MD_BASE + 0) #define OPTION_64 (OPTION_MD_BASE + 1) #define OPTION_DIVIDE (OPTION_MD_BASE + 2) +#define OPTION_MARCH (OPTION_MD_BASE + 3) +#define OPTION_MTUNE (OPTION_MD_BASE + 4) -struct option md_longopts[] = { +struct option md_longopts[] = +{ {"32", no_argument, NULL, OPTION_32}, -#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) +#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) || defined(TE_PEP) {"64", no_argument, NULL, OPTION_64}, #endif {"divide", no_argument, NULL, OPTION_DIVIDE}, + {"march", required_argument, NULL, OPTION_MARCH}, + {"mtune", required_argument, NULL, OPTION_MTUNE}, {NULL, no_argument, NULL, 0} }; size_t md_longopts_size = sizeof (md_longopts); int -md_parse_option (c, arg) - int c; - char *arg ATTRIBUTE_UNUSED; +md_parse_option (int c, char *arg) { + unsigned int i; + switch (c) { case 'n': @@ -5462,14 +5992,18 @@ md_parse_option (c, arg) /* -s: On i386 Solaris, this tells the native assembler to use .stab instead of .stab.excl. We always use .stab anyhow. */ break; - +#endif +#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) || defined(TE_PEP) case OPTION_64: { const char **list, **l; list = bfd_target_list (); for (l = list; *l != NULL; l++) - if (strcmp (*l, "elf64-x86-64") == 0) + if (CONST_STRNEQ (*l, "elf64-x86-64") + || strcmp (*l, "coff-x86-64") == 0 + || strcmp (*l, "pe-x86-64") == 0 + || strcmp (*l, "pei-x86-64") == 0) { default_arch = "x86_64"; break; @@ -5502,6 +6036,44 @@ md_parse_option (c, arg) #endif break; + case OPTION_MARCH: + if (*arg == '.') + as_fatal (_("Invalid -march= option: `%s'"), arg); + for (i = 0; i < ARRAY_SIZE (cpu_arch); i++) + { + if (strcmp (arg, cpu_arch [i].name) == 0) + { + cpu_arch_isa = cpu_arch[i].type; + cpu_arch_isa_flags = cpu_arch[i].flags; + if (!cpu_arch_tune_set) + { + cpu_arch_tune = cpu_arch_isa; + cpu_arch_tune_flags = cpu_arch_isa_flags; + } + break; + } + } + if (i >= ARRAY_SIZE (cpu_arch)) + as_fatal (_("Invalid -march= option: `%s'"), arg); + break; + + case OPTION_MTUNE: + if (*arg == '.') + as_fatal (_("Invalid -mtune= option: `%s'"), arg); + for (i = 0; i < ARRAY_SIZE (cpu_arch); i++) + { + if (strcmp (arg, cpu_arch [i].name) == 0) + { + cpu_arch_tune_set = 1; + cpu_arch_tune = cpu_arch [i].type; + cpu_arch_tune_flags = cpu_arch[i].flags; + break; + } + } + if (i >= ARRAY_SIZE (cpu_arch)) + as_fatal (_("Invalid -mtune= option: `%s'"), arg); + break; + default: return 0; } @@ -5525,6 +6097,10 @@ md_show_usage (stream) fprintf (stream, _("\ -s ignored\n")); #endif +#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) || defined(TE_PEP) + fprintf (stream, _("\ + --32/--64 generate 32bit/64bit code\n")); +#endif #ifdef SVR4_COMMENT_CHARS fprintf (stream, _("\ --divide do not treat `/' as a comment character\n")); @@ -5532,20 +6108,61 @@ md_show_usage (stream) fprintf (stream, _("\ --divide ignored\n")); #endif + fprintf (stream, _("\ + -march=CPU/-mtune=CPU generate code/optimize for CPU, where CPU is one of:\n\ + i386, i486, pentium, pentiumpro, pentium4, nocona,\n\ + core, core2, k6, athlon, k8, generic32, generic64\n")); + } +#if defined(TE_PEP) +const char * +x86_64_target_format (void) +{ + if (strcmp (default_arch, "x86_64") == 0) + { + set_code_flag (CODE_64BIT); + return COFF_TARGET_FORMAT; + } + else if (strcmp (default_arch, "i386") == 0) + { + set_code_flag (CODE_32BIT); + return "coff-i386"; + } + + as_fatal (_("Unknown architecture")); + return NULL; +} +#endif + #if ((defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT)) \ || defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) /* Pick the target format to use. */ const char * -i386_target_format () +i386_target_format (void) { if (!strcmp (default_arch, "x86_64")) - set_code_flag (CODE_64BIT); + { + set_code_flag (CODE_64BIT); + if (cpu_arch_isa_flags == 0) + cpu_arch_isa_flags = Cpu186|Cpu286|Cpu386|Cpu486 + |Cpu586|Cpu686|CpuP4|CpuMMX|CpuMMX2 + |CpuSSE|CpuSSE2; + if (cpu_arch_tune_flags == 0) + cpu_arch_tune_flags = Cpu186|Cpu286|Cpu386|Cpu486 + |Cpu586|Cpu686|CpuP4|CpuMMX|CpuMMX2 + |CpuSSE|CpuSSE2; + } else if (!strcmp (default_arch, "i386")) - set_code_flag (CODE_32BIT); + { + set_code_flag (CODE_32BIT); + if (cpu_arch_isa_flags == 0) + cpu_arch_isa_flags = Cpu186|Cpu286|Cpu386; + if (cpu_arch_tune_flags == 0) + cpu_arch_tune_flags = Cpu186|Cpu286|Cpu386; + } else as_fatal (_("Unknown architecture")); switch (OUTPUT_FLAVOR) @@ -5566,7 +6183,7 @@ i386_target_format () object_64bit = 1; use_rela_relocations = 1; } - return flag_code == CODE_64BIT ? "elf64-x86-64" : ELF_TARGET_FORMAT; + return flag_code == CODE_64BIT ? ELF_TARGET_FORMAT64 : ELF_TARGET_FORMAT; } #endif default: @@ -5578,7 +6195,8 @@ i386_target_format () #endif /* OBJ_MAYBE_ more than one */ #if (defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) -void i386_elf_emit_arch_note () +void +i386_elf_emit_arch_note (void) { if (IS_ELF && cpu_arch_name != NULL) { @@ -5669,8 +6287,7 @@ md_section_align (segment, size) size, since the offset is always the last part of the insn. */ long -md_pcrel_from (fixP) - fixS *fixP; +md_pcrel_from (fixS *fixP) { return fixP->fx_size + fixP->fx_where + fixP->fx_frag->fr_address; } @@ -5678,8 +6295,7 @@ md_pcrel_from (fixP) #ifndef I386COFF static void -s_bss (ignore) - int ignore ATTRIBUTE_UNUSED; +s_bss (int ignore ATTRIBUTE_UNUSED) { int temp; @@ -5695,8 +6311,7 @@ s_bss (ignore) #endif void -i386_validate_fix (fixp) - fixS *fixp; +i386_validate_fix (fixS *fixp) { if (fixp->fx_subsy && fixp->fx_subsy == GOT_symbol) { @@ -6045,8 +6660,8 @@ struct intel_parser_s int got_a_float; /* Whether the operand is a float. */ int op_modifier; /* Operand modifier. */ int is_mem; /* 1 if operand is memory reference. */ - int in_offset; /* >=1 if parsing operand of offset. */ - int in_bracket; /* >=1 if parsing operand in brackets. */ + int in_offset; /* >=1 if parsing operand of offset. */ + int in_bracket; /* >=1 if parsing operand in brackets. */ const reg_entry *reg; /* Last register reference found. */ char *disp; /* Displacement string being built. */ char *next_operand; /* Resume point when splitting operands. */ @@ -6085,22 +6700,19 @@ static struct intel_token cur_token, prev_token; #define T_SHR 15 /* Prototypes for intel parser functions. */ -static int intel_match_token PARAMS ((int code)); -static void intel_get_token PARAMS ((void)); -static void intel_putback_token PARAMS ((void)); -static int intel_expr PARAMS ((void)); -static int intel_e04 PARAMS ((void)); -static int intel_e05 PARAMS ((void)); -static int intel_e06 PARAMS ((void)); -static int intel_e09 PARAMS ((void)); -static int intel_bracket_expr PARAMS ((void)); -static int intel_e10 PARAMS ((void)); -static int intel_e11 PARAMS ((void)); +static int intel_match_token (int); +static void intel_putback_token (void); +static void intel_get_token (void); +static int intel_expr (void); +static int intel_e04 (void); +static int intel_e05 (void); +static int intel_e06 (void); +static int intel_e09 (void); +static int intel_e10 (void); +static int intel_e11 (void); static int -i386_intel_operand (operand_string, got_a_float) - char *operand_string; - int got_a_float; +i386_intel_operand (char *operand_string, int got_a_float) { int ret; char *p; @@ -6190,7 +6802,7 @@ i386_intel_operand (operand_string, got_a_float) ret = i386_immediate (intel_parser.disp); if (intel_parser.next_operand && this_operand >= MAX_OPERANDS - 1) - ret = 0; + ret = 0; if (!ret || !intel_parser.next_operand) break; intel_parser.op_string = intel_parser.next_operand; @@ -6210,7 +6822,7 @@ i386_intel_operand (operand_string, got_a_float) expr' cmpOp e04 expr' | Empty */ static int -intel_expr () +intel_expr (void) { /* XXX Implement the comparison operators. */ return intel_e04 (); @@ -6221,7 +6833,7 @@ intel_expr () e04' addOp e05 e04' | Empty */ static int -intel_e04 () +intel_e04 (void) { int nregs = -1; @@ -6250,7 +6862,7 @@ intel_e04 () e05' binOp e06 e05' | Empty */ static int -intel_e05 () +intel_e05 (void) { int nregs = ~NUM_ADDRESS_REGS; @@ -6259,7 +6871,9 @@ intel_e05 () if (!intel_e06()) return 0; - if (cur_token.code == '&' || cur_token.code == '|' || cur_token.code == '^') + if (cur_token.code == '&' + || cur_token.code == '|' + || cur_token.code == '^') { char str[2]; @@ -6285,7 +6899,7 @@ intel_e05 () e06' mulOp e09 e06' | Empty */ static int -intel_e06 () +intel_e06 (void) { int nregs = ~NUM_ADDRESS_REGS; @@ -6294,7 +6908,9 @@ intel_e06 () if (!intel_e09()) return 0; - if (cur_token.code == '*' || cur_token.code == '/' || cur_token.code == '%') + if (cur_token.code == '*' + || cur_token.code == '/' + || cur_token.code == '%') { char str[2]; @@ -6309,7 +6925,7 @@ intel_e06 () else break; - intel_match_token (cur_token.code); + intel_match_token (cur_token.code); if (nregs < 0) nregs = ~nregs; @@ -6331,7 +6947,7 @@ intel_e06 () | : e10 e09' | Empty */ static int -intel_e09 () +intel_e09 (void) { int nregs = ~NUM_ADDRESS_REGS; int in_offset = 0; @@ -6545,7 +7161,7 @@ intel_e09 () } static int -intel_bracket_expr () +intel_bracket_expr (void) { int was_offset = intel_parser.op_modifier & (1 << T_OFFSET); const char *start = intel_parser.op_string; @@ -6581,7 +7197,7 @@ intel_bracket_expr () intel_parser.op_modifier &= ~was_offset; } else - strcat (intel_parser.disp, "["); + strcat (intel_parser.disp, "["); /* Add a '+' to the displacement string if necessary. */ if (*intel_parser.disp != '\0' @@ -6606,7 +7222,8 @@ intel_bracket_expr () /* Defer the warning until all of the operand was parsed. */ intel_parser.is_mem = -1; else if (!quiet_warnings) - as_warn (_("`[%.*s]' taken to mean just `%.*s'"), len, start, len, start); + as_warn (_("`[%.*s]' taken to mean just `%.*s'"), + len, start, len, start); } } intel_parser.op_modifier |= was_offset; @@ -6621,7 +7238,7 @@ intel_bracket_expr () e10' [ expr ] e10' | Empty */ static int -intel_e10 () +intel_e10 (void) { if (!intel_e11 ()) return 0; @@ -6651,7 +7268,7 @@ intel_e10 () | id | constant */ static int -intel_e11 () +intel_e11 (void) { switch (cur_token.code) { @@ -6696,7 +7313,8 @@ intel_e11 () { if (!(reg->reg_type & (SReg2 | SReg3))) { - as_bad (_("`%s' is not a valid segment register"), reg->reg_name); + as_bad (_("`%s' is not a valid segment register"), + reg->reg_name); return 0; } else if (i.seg[i.mem_operands]) @@ -6886,7 +7504,8 @@ intel_e11 () /* Get the next token to check for register scaling. */ intel_match_token (cur_token.code); - /* Check if this constant is a scaling factor for an index register. */ + /* Check if this constant is a scaling factor for an + index register. */ if (cur_token.code == '*') { if (intel_match_token ('*') && cur_token.code == T_REG) @@ -6895,14 +7514,17 @@ intel_e11 () if (!intel_parser.in_bracket) { - as_bad (_("Register scaling only allowed in memory operands")); + as_bad (_("Register scaling only allowed " + "in memory operands")); return 0; } - if (reg->reg_type & Reg16) /* Disallow things like [1*si]. */ - reg = i386_regtab + REGNAM_AX + 4; /* sp is invalid as index */ + /* Disallow things like [1*si]. + sp and esp are invalid as index. */ + if (reg->reg_type & Reg16) + reg = i386_regtab + REGNAM_AX + 4; else if (i.index_reg) - reg = i386_regtab + REGNAM_EAX + 4; /* esp is invalid as index */ + reg = i386_regtab + REGNAM_EAX + 4; /* The constant is followed by `* reg', so it must be a valid scale. */ @@ -6952,8 +7574,7 @@ intel_e11 () /* Match the given token against cur_token. If they match, read the next token from the operand string. */ static int -intel_match_token (code) - int code; +intel_match_token (int code) { if (cur_token.code == code) { @@ -6969,7 +7590,7 @@ intel_match_token (code) /* Read a new token from intel_parser.op_string and store it in cur_token. */ static void -intel_get_token () +intel_get_token (void) { char *end_op; const reg_entry *reg; @@ -7154,7 +7775,7 @@ intel_get_token () /* Put cur_token back into the token stream and make cur_token point to prev_token. */ static void -intel_putback_token () +intel_putback_token (void) { if (cur_token.code != T_NIL) { @@ -7170,7 +7791,7 @@ intel_putback_token () } int -tc_x86_regname_to_dw2regnum (const char *regname) +tc_x86_regname_to_dw2regnum (char *regname) { unsigned int regnum; unsigned int regnames_count; @@ -7281,16 +7902,16 @@ x86_64_section_letter (int letter, char **ptr_msg) return SHF_X86_64_LARGE; *ptr_msg = _("Bad .section directive: want a,l,w,x,M,S,G,T in string"); - } + } else - *ptr_msg = _("Bad .section directive: want a,w,x,M,S,G,T in string"); + *ptr_msg = _("Bad .section directive: want a,w,x,M,S,G,T in string"); return -1; } int x86_64_section_word (char *str, size_t len) { - if (len == 5 && flag_code == CODE_64BIT && strncmp (str, "large", 5) == 0) + if (len == 5 && flag_code == CODE_64BIT && CONST_STRNEQ (str, "large")) return SHF_X86_64_LARGE; return -1; diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h index 98517041dad..51638b08033 100644 --- a/gas/config/tc-i386.h +++ b/gas/config/tc-i386.h @@ -1,6 +1,6 @@ /* tc-i386.h -- Header file for tc-i386.c Copyright 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005 + 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -23,6 +23,8 @@ #ifndef TC_I386 #define TC_I386 1 +#include "opcodes/i386-opc.h" + struct fix; #define TARGET_BYTES_BIG_ENDIAN 0 @@ -55,6 +57,7 @@ extern unsigned long i386_mach (void); #ifdef TE_FreeBSD #define ELF_TARGET_FORMAT "elf32-i386-freebsd" +#define ELF_TARGET_FORMAT64 "elf64-x86-64-freebsd" #elif defined (TE_VXWORKS) #define ELF_TARGET_FORMAT "elf32-i386-vxworks" #endif @@ -63,9 +66,13 @@ extern unsigned long i386_mach (void); #define ELF_TARGET_FORMAT "elf32-i386" #endif +#ifndef ELF_TARGET_FORMAT64 +#define ELF_TARGET_FORMAT64 "elf64-x86-64" +#endif + #if ((defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT)) \ || defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) -extern const char *i386_target_format PARAMS ((void)); +extern const char *i386_target_format (void); #define TARGET_FORMAT i386_target_format () #else #ifdef OBJ_ELF @@ -78,7 +85,7 @@ extern const char *i386_target_format PARAMS ((void)); #if (defined (OBJ_MAYBE_ELF) || defined (OBJ_ELF)) #define md_end i386_elf_emit_arch_note -extern void i386_elf_emit_arch_note PARAMS ((void)); +extern void i386_elf_emit_arch_note (void); #endif #define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) 0 @@ -91,18 +98,16 @@ extern const char extra_symbol_chars[]; extern const char *i386_comment_chars; #define tc_comment_chars i386_comment_chars -#define MAX_OPERANDS 3 /* max operands per insn */ -#define MAX_IMMEDIATE_OPERANDS 2/* max immediates per insn (lcall, ljmp) */ -#define MAX_MEMORY_OPERANDS 2 /* max memory refs per insn (string ops) */ - /* Prefixes will be emitted in the order defined below. WAIT_PREFIX must be the first prefix since FWAIT is really is an - instruction, and so must come before any prefixes. */ + instruction, and so must come before any prefixes. + The preferred prefix order is SEG_PREFIX, ADDR_PREFIX, DATA_PREFIX, + LOCKREP_PREFIX. */ #define WAIT_PREFIX 0 -#define LOCKREP_PREFIX 1 +#define SEG_PREFIX 1 #define ADDR_PREFIX 2 #define DATA_PREFIX 3 -#define SEG_PREFIX 4 +#define LOCKREP_PREFIX 4 #define REX_PREFIX 5 /* must come last. */ #define MAX_PREFIXES 6 /* max prefixes per opcode */ @@ -111,21 +116,6 @@ extern const char *i386_comment_chars; #define IMMEDIATE_PREFIX '$' #define ABSOLUTE_PREFIX '*' -#define TWO_BYTE_OPCODE_ESCAPE 0x0f -#define NOP_OPCODE (char) 0x90 - -/* register numbers */ -#define EBP_REG_NUM 5 -#define ESP_REG_NUM 4 - -/* modrm_byte.regmem for twobyte escape */ -#define ESCAPE_TO_TWO_BYTE_ADDRESSING ESP_REG_NUM -/* index_base_byte.index for no index register addressing */ -#define NO_INDEX_REGISTER ESP_REG_NUM -/* index_base_byte.base for no base register addressing */ -#define NO_BASE_REGISTER EBP_REG_NUM -#define NO_BASE_REGISTER_16 6 - /* these are the instruction mnemonic suffixes. */ #define WORD_MNEM_SUFFIX 'w' #define BYTE_MNEM_SUFFIX 'b' @@ -135,184 +125,8 @@ extern const char *i386_comment_chars; /* Intel Syntax */ #define LONG_DOUBLE_MNEM_SUFFIX 'x' -/* modrm.mode = REGMEM_FIELD_HAS_REG when a register is in there */ -#define REGMEM_FIELD_HAS_REG 0x3/* always = 0x3 */ -#define REGMEM_FIELD_HAS_MEM (~REGMEM_FIELD_HAS_REG) - #define END_OF_INSN '\0' -typedef struct -{ - /* instruction name sans width suffix ("mov" for movl insns) */ - char *name; - - /* how many operands */ - unsigned int operands; - - /* base_opcode is the fundamental opcode byte without optional - prefix(es). */ - unsigned int base_opcode; - - /* extension_opcode is the 3 bit extension for group insns. - This field is also used to store the 8-bit opcode suffix for the - AMD 3DNow! instructions. - If this template has no extension opcode (the usual case) use None */ - unsigned int extension_opcode; -#define None 0xffff /* If no extension_opcode is possible. */ - - /* cpu feature flags */ - unsigned int cpu_flags; -#define Cpu086 0x1 /* Any old cpu will do, 0 does the same */ -#define Cpu186 0x2 /* i186 or better required */ -#define Cpu286 0x4 /* i286 or better required */ -#define Cpu386 0x8 /* i386 or better required */ -#define Cpu486 0x10 /* i486 or better required */ -#define Cpu586 0x20 /* i585 or better required */ -#define Cpu686 0x40 /* i686 or better required */ -#define CpuP4 0x80 /* Pentium4 or better required */ -#define CpuK6 0x100 /* AMD K6 or better required*/ -#define CpuAthlon 0x200 /* AMD Athlon or better required*/ -#define CpuSledgehammer 0x400 /* Sledgehammer or better required */ -#define CpuMMX 0x800 /* MMX support required */ -#define CpuMMX2 0x1000 /* extended MMX support (with SSE or 3DNow!Ext) required */ -#define CpuSSE 0x2000 /* Streaming SIMD extensions required */ -#define CpuSSE2 0x4000 /* Streaming SIMD extensions 2 required */ -#define Cpu3dnow 0x8000 /* 3dnow! support required */ -#define Cpu3dnowA 0x10000 /* 3dnow!Extensions support required */ -#define CpuSSE3 0x20000 /* Streaming SIMD extensions 3 required */ -#define CpuPNI CpuSSE3 /* Prescott New Instructions required */ -#define CpuPadLock 0x40000 /* VIA PadLock required */ -#define CpuSVME 0x80000 /* AMD Secure Virtual Machine Ext-s required */ -#define CpuVMX 0x100000 /* VMX Instructions required */ -#define CpuMNI 0x200000 /* Merom New Instructions required */ - - /* These flags are set by gas depending on the flag_code. */ -#define Cpu64 0x4000000 /* 64bit support required */ -#define CpuNo64 0x8000000 /* Not supported in the 64bit mode */ - - /* The default value for unknown CPUs - enable all features to avoid problems. */ -#define CpuUnknownFlags (Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686 \ - |CpuP4|CpuSledgehammer|CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuPNI|CpuVMX \ - |Cpu3dnow|Cpu3dnowA|CpuK6|CpuAthlon|CpuPadLock|CpuSVME|CpuMNI) - - /* the bits in opcode_modifier are used to generate the final opcode from - the base_opcode. These bits also are used to detect alternate forms of - the same instruction */ - unsigned int opcode_modifier; - - /* opcode_modifier bits: */ -#define W 0x1 /* set if operands can be words or dwords - encoded the canonical way */ -#define D 0x2 /* D = 0 if Reg --> Regmem; - D = 1 if Regmem --> Reg: MUST BE 0x2 */ -#define Modrm 0x4 -#define FloatR 0x8 /* src/dest swap for floats: MUST BE 0x8 */ -#define ShortForm 0x10 /* register is in low 3 bits of opcode */ -#define FloatMF 0x20 /* FP insn memory format bit, sized by 0x4 */ -#define Jump 0x40 /* special case for jump insns. */ -#define JumpDword 0x80 /* call and jump */ -#define JumpByte 0x100 /* loop and jecxz */ -#define JumpInterSegment 0x200 /* special case for intersegment leaps/calls */ -#define FloatD 0x400 /* direction for float insns: MUST BE 0x400 */ -#define Seg2ShortForm 0x800 /* encoding of load segment reg insns */ -#define Seg3ShortForm 0x1000 /* fs/gs segment register insns. */ -#define Size16 0x2000 /* needs size prefix if in 32-bit mode */ -#define Size32 0x4000 /* needs size prefix if in 16-bit mode */ -#define Size64 0x8000 /* needs size prefix if in 16-bit mode */ -#define IgnoreSize 0x10000 /* instruction ignores operand size prefix */ -#define DefaultSize 0x20000 /* default insn size depends on mode */ -#define No_bSuf 0x40000 /* b suffix on instruction illegal */ -#define No_wSuf 0x80000 /* w suffix on instruction illegal */ -#define No_lSuf 0x100000 /* l suffix on instruction illegal */ -#define No_sSuf 0x200000 /* s suffix on instruction illegal */ -#define No_qSuf 0x400000 /* q suffix on instruction illegal */ -#define No_xSuf 0x800000 /* x suffix on instruction illegal */ -#define FWait 0x1000000 /* instruction needs FWAIT */ -#define IsString 0x2000000 /* quick test for string instructions */ -#define regKludge 0x4000000 /* fake an extra reg operand for clr, imul */ -#define IsPrefix 0x8000000 /* opcode is a prefix */ -#define ImmExt 0x10000000 /* instruction has extension in 8 bit imm */ -#define NoRex64 0x20000000 /* instruction don't need Rex64 prefix. */ -#define Rex64 0x40000000 /* instruction require Rex64 prefix. */ -#define Ugh 0x80000000 /* deprecated fp insn, gets a warning */ - - /* operand_types[i] describes the type of operand i. This is made - by OR'ing together all of the possible type masks. (e.g. - 'operand_types[i] = Reg|Imm' specifies that operand i can be - either a register or an immediate operand. */ - unsigned int operand_types[3]; - - /* operand_types[i] bits */ - /* register */ -#define Reg8 0x1 /* 8 bit reg */ -#define Reg16 0x2 /* 16 bit reg */ -#define Reg32 0x4 /* 32 bit reg */ -#define Reg64 0x8 /* 64 bit reg */ - /* immediate */ -#define Imm8 0x10 /* 8 bit immediate */ -#define Imm8S 0x20 /* 8 bit immediate sign extended */ -#define Imm16 0x40 /* 16 bit immediate */ -#define Imm32 0x80 /* 32 bit immediate */ -#define Imm32S 0x100 /* 32 bit immediate sign extended */ -#define Imm64 0x200 /* 64 bit immediate */ -#define Imm1 0x400 /* 1 bit immediate */ - /* memory */ -#define BaseIndex 0x800 - /* Disp8,16,32 are used in different ways, depending on the - instruction. For jumps, they specify the size of the PC relative - displacement, for baseindex type instructions, they specify the - size of the offset relative to the base register, and for memory - offset instructions such as `mov 1234,%al' they specify the size of - the offset relative to the segment base. */ -#define Disp8 0x1000 /* 8 bit displacement */ -#define Disp16 0x2000 /* 16 bit displacement */ -#define Disp32 0x4000 /* 32 bit displacement */ -#define Disp32S 0x8000 /* 32 bit signed displacement */ -#define Disp64 0x10000 /* 64 bit displacement */ - /* specials */ -#define InOutPortReg 0x20000 /* register to hold in/out port addr = dx */ -#define ShiftCount 0x40000 /* register to hold shift cound = cl */ -#define Control 0x80000 /* Control register */ -#define Debug 0x100000 /* Debug register */ -#define Test 0x200000 /* Test register */ -#define FloatReg 0x400000 /* Float register */ -#define FloatAcc 0x800000 /* Float stack top %st(0) */ -#define SReg2 0x1000000 /* 2 bit segment register */ -#define SReg3 0x2000000 /* 3 bit segment register */ -#define Acc 0x4000000 /* Accumulator %al or %ax or %eax */ -#define JumpAbsolute 0x8000000 -#define RegMMX 0x10000000 /* MMX register */ -#define RegXMM 0x20000000 /* XMM registers in PIII */ -#define EsSeg 0x40000000 /* String insn operand with fixed es segment */ - - /* InvMem is for instructions with a modrm byte that only allow a - general register encoding in the i.tm.mode and i.tm.regmem fields, - eg. control reg moves. They really ought to support a memory form, - but don't, so we add an InvMem flag to the register operand to - indicate that it should be encoded in the i.tm.regmem field. */ -#define InvMem 0x80000000 - -#define Reg (Reg8|Reg16|Reg32|Reg64) /* gen'l register */ -#define WordReg (Reg16|Reg32|Reg64) -#define ImplicitRegister (InOutPortReg|ShiftCount|Acc|FloatAcc) -#define Imm (Imm8|Imm8S|Imm16|Imm32S|Imm32|Imm64) /* gen'l immediate */ -#define EncImm (Imm8|Imm16|Imm32|Imm32S) /* Encodable gen'l immediate */ -#define Disp (Disp8|Disp16|Disp32|Disp32S|Disp64) /* General displacement */ -#define AnyMem (Disp8|Disp16|Disp32|Disp32S|BaseIndex|InvMem) /* General memory */ - /* The following aliases are defined because the opcode table - carefully specifies the allowed memory types for each instruction. - At the moment we can only tell a memory reference size by the - instruction suffix, so there's not much point in defining Mem8, - Mem16, Mem32 and Mem64 opcode modifiers - We might as well just use - the suffix directly to check memory operands. */ -#define LLongMem AnyMem /* 64 bits (or more) */ -#define LongMem AnyMem /* 32 bit memory ref */ -#define ShortMem AnyMem /* 16 bit memory ref */ -#define WordMem AnyMem /* 16 or 32 bit memory ref */ -#define ByteMem AnyMem /* 8 bit memory ref */ -} -template; - /* 'templates' is for grouping together 'template' structures for opcodes of the same name. This is only used for storing the insns in the grand @@ -327,25 +141,6 @@ typedef struct } templates; -/* these are for register name --> number & type hash lookup */ -typedef struct -{ - char *reg_name; - unsigned int reg_type; - unsigned int reg_flags; -#define RegRex 0x1 /* Extended register. */ -#define RegRex64 0x2 /* Extended 8 bit register. */ - unsigned int reg_num; -} -reg_entry; - -typedef struct -{ - char *seg_name; - unsigned int seg_prefix; -} -seg_entry; - /* 386 operand encoding bytes: see 386 book for details of this. */ typedef struct { @@ -357,16 +152,6 @@ modrm_byte; /* x86-64 extension prefix. */ typedef int rex_byte; -#define REX_OPCODE 0x40 - -/* Indicates 64 bit operand size. */ -#define REX_MODE64 8 -/* High extension to reg field of modrm byte. */ -#define REX_EXTX 4 -/* High extension to SIB index field. */ -#define REX_EXTY 2 -/* High extension to base field of modrm or SIB, or reg field of opcode. */ -#define REX_EXTZ 1 /* 386 opcode byte to code indirect addressing. */ typedef struct @@ -377,11 +162,30 @@ typedef struct } sib_byte; -/* x86 arch names and features */ +enum processor_type +{ + PROCESSOR_UNKNOWN, + PROCESSOR_I486, + PROCESSOR_PENTIUM, + PROCESSOR_PENTIUMPRO, + PROCESSOR_PENTIUM4, + PROCESSOR_NOCONA, + PROCESSOR_CORE, + PROCESSOR_CORE2, + PROCESSOR_K6, + PROCESSOR_ATHLON, + PROCESSOR_K8, + PROCESSOR_GENERIC32, + PROCESSOR_GENERIC64, + PROCESSOR_AMDFAM10 +}; + +/* x86 arch names, types and features */ typedef struct { - const char *name; /* arch name */ - unsigned int flags; /* cpu feature flags */ + const char *name; /* arch name */ + enum processor_type type; /* arch type */ + unsigned int flags; /* cpu feature flags */ } arch_entry; @@ -393,22 +197,22 @@ arch_entry; #if (defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) && !defined (LEX_AT) #define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) x86_cons (EXP, NBYTES) -extern void x86_cons PARAMS ((expressionS *, int)); +extern void x86_cons (expressionS *, int); #endif #define TC_CONS_FIX_NEW(FRAG,OFF,LEN,EXP) x86_cons_fix_new(FRAG, OFF, LEN, EXP) extern void x86_cons_fix_new - PARAMS ((fragS *, unsigned int, unsigned int, expressionS *)); + (fragS *, unsigned int, unsigned int, expressionS *); #define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs */ #define NO_RELOC BFD_RELOC_NONE -void i386_validate_fix PARAMS ((struct fix *)); +void i386_validate_fix (struct fix *); #define TC_VALIDATE_FIX(FIX,SEGTYPE,SKIP) i386_validate_fix(FIX) #define tc_fix_adjustable(X) tc_i386_fix_adjustable(X) -extern int tc_i386_fix_adjustable PARAMS ((struct fix *)); +extern int tc_i386_fix_adjustable (struct fix *); /* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 @@ -432,7 +236,6 @@ extern int tc_i386_fix_adjustable PARAMS ((struct fix *)); #define TC_FORCE_RELOCATION_LOCAL(FIX) \ (!(FIX)->fx_pcrel \ - || (FIX)->fx_plt \ || (FIX)->fx_r_type == BFD_RELOC_386_PLT32 \ || (FIX)->fx_r_type == BFD_RELOC_386_GOT32 \ || (FIX)->fx_r_type == BFD_RELOC_386_GOTPC \ @@ -460,7 +263,7 @@ if ((n) \ #define MAX_MEM_FOR_RS_ALIGN_CODE 15 -extern void i386_align_code PARAMS ((fragS *, int)); +extern void i386_align_code (fragS *, int); #define HANDLE_ALIGN(fragP) \ if (fragP->fr_type == rs_align_code) \ @@ -468,16 +271,18 @@ if (fragP->fr_type == rs_align_code) \ - fragP->fr_address \ - fragP->fr_fix)); -void i386_print_statistics PARAMS ((FILE *)); +void i386_print_statistics (FILE *); #define tc_print_statistics i386_print_statistics #define md_number_to_chars number_to_chars_littleendian #ifdef SCO_ELF #define tc_init_after_args() sco_id () -extern void sco_id PARAMS ((void)); +extern void sco_id (void); #endif +#define WORKING_DOT_WORD 1 + /* We want .cfi_* pseudo-ops for generating unwind info. */ #define TARGET_USE_CFIPOP 1 @@ -488,17 +293,17 @@ extern int x86_cie_data_alignment; #define DWARF2_CIE_DATA_ALIGNMENT x86_cie_data_alignment #define tc_regname_to_dw2regnum tc_x86_regname_to_dw2regnum -extern int tc_x86_regname_to_dw2regnum PARAMS ((const char *regname)); +extern int tc_x86_regname_to_dw2regnum (char *); #define tc_cfi_frame_initial_instructions tc_x86_frame_initial_instructions -extern void tc_x86_frame_initial_instructions PARAMS ((void)); +extern void tc_x86_frame_initial_instructions (void); #define md_elf_section_type(str,len) i386_elf_section_type (str, len) -extern int i386_elf_section_type PARAMS ((const char *, size_t len)); +extern int i386_elf_section_type (const char *, size_t); /* Support for SHF_X86_64_LARGE */ -extern int x86_64_section_word PARAMS ((char *, size_t)); -extern int x86_64_section_letter PARAMS ((int letter, char **ptr_msg)); +extern int x86_64_section_word (char *, size_t); +extern int x86_64_section_letter (int, char **); #define md_elf_section_letter(LETTER, PTR_MSG) x86_64_section_letter (LETTER, PTR_MSG) #define md_elf_section_word(STR, LEN) x86_64_section_word (STR, LEN) diff --git a/gas/config/tc-i860.c b/gas/config/tc-i860.c index 4a87c540576..c5aca38e450 100644 --- a/gas/config/tc-i860.c +++ b/gas/config/tc-i860.c @@ -1,6 +1,6 @@ /* tc-i860.c -- Assembler for the Intel i860 architecture. - Copyright 1989, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003 - Free Software Foundation, Inc. + Copyright 1989, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, + 2003, 2006 Free Software Foundation, Inc. Brought back from the dead and completely reworked by Jason Eckhardt . @@ -21,8 +21,6 @@ with GAS; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include #include "as.h" #include "safe-ctype.h" #include "subsegs.h" diff --git a/gas/config/tc-i960.c b/gas/config/tc-i960.c index a3206bbf2d0..0af3a80c35e 100644 --- a/gas/config/tc-i960.c +++ b/gas/config/tc-i960.c @@ -1,6 +1,6 @@ /* tc-i960.c - All the i80960-specific stuff Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2005 + 1999, 2000, 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. This file is part of GAS. @@ -63,8 +63,6 @@ less than 4096 is specified, in which case we need neither a fixup nor a relocation directive. */ -#include - #include "as.h" #include "safe-ctype.h" diff --git a/gas/config/tc-i960.h b/gas/config/tc-i960.h index 05db36e40d5..c5c33d37e07 100644 --- a/gas/config/tc-i960.h +++ b/gas/config/tc-i960.h @@ -1,6 +1,6 @@ /* tc-i960.h - Basic 80960 instruction formats. Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 1999, - 2000, 2001, 2002, 2003 + 2000, 2001, 2002, 2003, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -139,7 +139,6 @@ extern int reloc_callj PARAMS ((struct fix *)); #define TC_FORCE_RELOCATION_LOCAL(FIX) \ (!(FIX)->fx_pcrel \ - || (FIX)->fx_plt \ || TC_FORCE_RELOCATION (FIX) \ || reloc_callj (FIX)) diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c index 426b60f589a..5ed9ba82ad2 100644 --- a/gas/config/tc-ia64.c +++ b/gas/config/tc-ia64.c @@ -1,5 +1,5 @@ /* tc-ia64.c -- Assembler for the HP/Intel IA-64 architecture. - Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by David Mosberger-Tang @@ -5634,7 +5634,7 @@ declare_register_set (prefix, num_regs, base_regnum) for (i = 0; i < num_regs; ++i) { - sprintf (name, "%s%u", prefix, i); + snprintf (name, sizeof (name), "%s%u", prefix, i); declare_register (name, base_regnum + i); } } @@ -6691,7 +6691,7 @@ emit_one_bundle () int addr_mod; first = (md.curr_slot + NUM_SLOTS - md.num_slots_in_use) % NUM_SLOTS; - know (first >= 0 & first < NUM_SLOTS); + know (first >= 0 && first < NUM_SLOTS); n = MIN (3, md.num_slots_in_use); /* Determine template: user user_template if specified, best match @@ -6971,7 +6971,8 @@ emit_one_bundle () else as_fatal ("emit_one_bundle: unexpected dynamic op"); - sprintf (mnemonic, "%s.%c", idesc->name, "?imbfxx"[insn_unit]); + snprintf (mnemonic, sizeof (mnemonic), "%s.%c", + idesc->name, "?imbfxx"[insn_unit]); opnd1 = idesc->operands[0]; opnd2 = idesc->operands[1]; ia64_free_opcode (idesc); @@ -7066,7 +7067,6 @@ emit_one_bundle () fix = fix_new_exp (frag_now, frag_now_fix () - 16 + i, 8, &ifix->expr, ifix->is_pcrel, ifix->code); fix->tc_fix_data.opnd = ifix->opnd; - fix->fx_plt = (fix->fx_r_type == BFD_RELOC_IA64_PLTOFF22); fix->fx_file = md.slot[curr].src_file; fix->fx_line = md.slot[curr].src_line; } @@ -10544,12 +10544,15 @@ check_dependencies (idesc) int certain = (matchtype == 1 && CURR_SLOT.qp_regno == 0); if (path != 0) - sprintf (pathmsg, " when entry is at label '%s'", + snprintf (pathmsg, sizeof (pathmsg), + " when entry is at label '%s'", md.entry_labels[path - 1]); if (matchtype == 1 && rs->index >= 0) - sprintf (indexmsg, ", specific resource number is %d", + snprintf (indexmsg, sizeof (indexmsg), + ", specific resource number is %d", rs->index); - sprintf (msg, "Use of '%s' %s %s dependency '%s' (%s)%s%s", + snprintf (msg, sizeof (msg), + "Use of '%s' %s %s dependency '%s' (%s)%s%s", idesc->name, (certain ? "violates" : "may violate"), dv_mode[dep->mode], dep->name, @@ -11862,7 +11865,7 @@ struct alias { char *file; /* The file where the directive is seen. */ unsigned int line; /* The line number the directive is at. */ - const char *name; /* The orignale name of the symbol. */ + const char *name; /* The original name of the symbol. */ }; /* Called for .alias and .secalias directives. If SECTION is 1, it is diff --git a/gas/config/tc-ia64.h b/gas/config/tc-ia64.h index c17494beb16..b851b9f37eb 100644 --- a/gas/config/tc-ia64.h +++ b/gas/config/tc-ia64.h @@ -1,5 +1,5 @@ /* tc-ia64.h -- Header file for tc-ia64.c. - Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by David Mosberger-Tang @@ -315,5 +315,5 @@ typedef struct unwind_record #define TC_FORCE_RELOCATION_LOCAL(FIX) \ ((FIX)->fx_r_type != BFD_RELOC_UNUSED \ && (!(FIX)->fx_pcrel \ - || (FIX)->fx_plt \ + || (FIX)->fx_r_type == BFD_RELOC_IA64_PLTOFF22 \ || TC_FORCE_RELOCATION (FIX))) diff --git a/gas/config/tc-ip2k.c b/gas/config/tc-ip2k.c index 10e9e2f3fa2..7c3f77513d8 100644 --- a/gas/config/tc-ip2k.c +++ b/gas/config/tc-ip2k.c @@ -1,5 +1,5 @@ /* tc-ip2k.c -- Assembler for the Scenix IP2xxx. - Copyright (C) 2000, 2002, 2003, 2005 Free Software Foundation. + Copyright (C) 2000, 2002, 2003, 2005, 2006 Free Software Foundation. This file is part of GAS, the GNU Assembler. @@ -18,7 +18,6 @@ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "as.h" #include "subsegs.h" #include "symcat.h" diff --git a/gas/config/tc-iq2000.c b/gas/config/tc-iq2000.c index 0d689c09a21..b7fddc5be3f 100644 --- a/gas/config/tc-iq2000.c +++ b/gas/config/tc-iq2000.c @@ -1,5 +1,5 @@ /* tc-iq2000.c -- Assembler for the Sitera IQ2000. - Copyright (C) 2003, 2004, 2005 Free Software Foundation. + Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation. This file is part of GAS, the GNU Assembler. @@ -18,7 +18,6 @@ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "as.h" #include "safe-ctype.h" #include "subsegs.h" @@ -29,7 +28,7 @@ #include "elf/common.h" #include "elf/iq2000.h" #include "libbfd.h" -#include "hash.h" +#include "sb.h" #include "macro.h" /* Structure to hold all of the different components describing diff --git a/gas/config/tc-m32c.c b/gas/config/tc-m32c.c index 5f174d39c0d..8194a673084 100644 --- a/gas/config/tc-m32c.c +++ b/gas/config/tc-m32c.c @@ -1,5 +1,5 @@ /* tc-m32c.c -- Assembler for the Renesas M32C. - Copyright (C) 2005 Free Software Foundation. + Copyright (C) 2005, 2006 Free Software Foundation. Contributed by RedHat. This file is part of GAS, the GNU Assembler. @@ -19,7 +19,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include "as.h" #include "subsegs.h" #include "symcat.h" @@ -29,9 +28,7 @@ #include "elf/common.h" #include "elf/m32c.h" #include "libbfd.h" -#include "libiberty.h" #include "safe-ctype.h" -#include "bfd.h" /* Structure to hold all of the different components describing an individual instruction. */ @@ -55,8 +52,8 @@ typedef struct } m32c_insn; -#define rl_for(insn) (CGEN_ATTR_CGEN_INSN_RL_TYPE_VALUE (&(insn.insn->base->attrs))) -#define relaxable(insn) (CGEN_ATTR_CGEN_INSN_RELAXABLE_VALUE (&(insn.insn->base->attrs))) +#define rl_for(_insn) (CGEN_ATTR_CGEN_INSN_RL_TYPE_VALUE (&((_insn).insn->base->attrs))) +#define relaxable(_insn) (CGEN_ATTR_CGEN_INSN_RELAXABLE_VALUE (&((_insn).insn->base->attrs))) const char comment_chars[] = ";"; const char line_comment_chars[] = "#"; @@ -154,6 +151,7 @@ s_bss (int ignore ATTRIBUTE_UNUSED) const pseudo_typeS md_pseudo_table[] = { { "bss", s_bss, 0}, + { "3byte", cons, 3 }, { "word", cons, 4 }, { NULL, NULL, 0 } }; @@ -450,7 +448,12 @@ const relax_typeS md_relax_table[] = /* 19 */ { 32767, -32768, 3, 20 }, /* jsr16.w */ /* 20 */ { 0, 0, 4, 0 }, /* jsr16.a */ /* 21 */ { 32767, -32768, 3, 11 }, /* jsr32.w */ - /* 22 */ { 0, 0, 4, 0 } /* jsr32.a */ + /* 22 */ { 0, 0, 4, 0 }, /* jsr32.a */ + + /* 23 */ { 0, 0, 3, 0 }, /* adjnz pc8 */ + /* 24 */ { 0, 0, 4, 0 }, /* adjnz disp8 pc8 */ + /* 25 */ { 0, 0, 5, 0 }, /* adjnz disp16 pc8 */ + /* 26 */ { 0, 0, 6, 0 } /* adjnz disp24 pc8 */ }; enum { @@ -460,6 +463,11 @@ enum { M32C_MACRO_JCND16_A, M32C_MACRO_JCND32_W, M32C_MACRO_JCND32_A, + /* the digit is the array index of the pcrel byte */ + M32C_MACRO_ADJNZ_2, + M32C_MACRO_ADJNZ_3, + M32C_MACRO_ADJNZ_4, + M32C_MACRO_ADJNZ_5, } M32C_Macros; static struct { @@ -496,7 +504,12 @@ static struct { /* 19 */ { M32C_INSN_JSR16_W, 3, M32C_INSN_JSR16_A, 2 }, /* 20 */ { M32C_INSN_JSR16_A, 4, M32C_INSN_JSR16_A, 0 }, /* 21 */ { M32C_INSN_JSR32_W, 3, M32C_INSN_JSR32_A, 2 }, - /* 22 */ { M32C_INSN_JSR32_A, 4, M32C_INSN_JSR32_A, 0 } + /* 22 */ { M32C_INSN_JSR32_A, 4, M32C_INSN_JSR32_A, 0 }, + + /* 23 */ { -M32C_MACRO_ADJNZ_2, 3, -M32C_MACRO_ADJNZ_2, 0 }, + /* 24 */ { -M32C_MACRO_ADJNZ_3, 4, -M32C_MACRO_ADJNZ_3, 0 }, + /* 25 */ { -M32C_MACRO_ADJNZ_4, 5, -M32C_MACRO_ADJNZ_4, 0 }, + /* 26 */ { -M32C_MACRO_ADJNZ_5, 6, -M32C_MACRO_ADJNZ_5, 0 } }; #define NUM_MAPPINGS (sizeof (subtype_mappings) / sizeof (subtype_mappings[0])) @@ -511,11 +524,21 @@ m32c_prepare_relax_scan (fragS *fragP, offsetT *aim, relax_substateT this_state) } static int -insn_to_subtype (int insn) +insn_to_subtype (int inum, const CGEN_INSN *insn) { unsigned int i; + + if (insn + && (strncmp (insn->base->mnemonic, "adjnz", 5) == 0 + || strncmp (insn->base->mnemonic, "sbjnz", 5) == 0)) + { + i = 23 + insn->base->bitsize/8 - 3; + /*printf("mapping %d used for %s\n", i, insn->base->mnemonic);*/ + return i; + } + for (i=0; ifr_opcode - fragP->fr_literal; if (fragP->fr_subtype == 1) - fragP->fr_subtype = insn_to_subtype (fragP->fr_cgen.insn->base->num); + fragP->fr_subtype = insn_to_subtype (fragP->fr_cgen.insn->base->num, fragP->fr_cgen.insn); if (S_GET_SEGMENT (fragP->fr_symbol) != segment) { int new_insn; new_insn = subtype_mappings[fragP->fr_subtype].insn_for_extern; - fragP->fr_subtype = insn_to_subtype (new_insn); + fragP->fr_subtype = insn_to_subtype (new_insn, 0); } if (fragP->fr_cgen.insn->base @@ -835,6 +858,26 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED, rl_addend = 0x41; break; + case -M32C_MACRO_ADJNZ_2: + rl_addend = 0x31; + op[2] = addend; + operand = M32C_OPERAND_LAB_16_8; + break; + case -M32C_MACRO_ADJNZ_3: + rl_addend = 0x41; + op[3] = addend; + operand = M32C_OPERAND_LAB_24_8; + break; + case -M32C_MACRO_ADJNZ_4: + rl_addend = 0x51; + op[4] = addend; + operand = M32C_OPERAND_LAB_32_8; + break; + case -M32C_MACRO_ADJNZ_5: + rl_addend = 0x61; + op[5] = addend; + operand = M32C_OPERAND_LAB_40_8; + break; default: @@ -860,15 +903,16 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED, || (m32c_relax && (operand != M32C_OPERAND_LAB_5_3 && operand != M32C_OPERAND_LAB32_JMP_S))) { + fixS *fixP; assert (fragP->fr_cgen.insn != 0); - gas_cgen_record_fixup (fragP, - where, - fragP->fr_cgen.insn, - (fragP->fr_fix - where) * 8, - cgen_operand_lookup_by_num (gas_cgen_cpu_desc, - operand), - fragP->fr_cgen.opinfo, - fragP->fr_symbol, fragP->fr_offset); + fixP = gas_cgen_record_fixup (fragP, + where, + fragP->fr_cgen.insn, + (fragP->fr_fix - where) * 8, + cgen_operand_lookup_by_num (gas_cgen_cpu_desc, + operand), + fragP->fr_cgen.opinfo, + fragP->fr_symbol, fragP->fr_offset); } } @@ -1020,6 +1064,37 @@ md_cgen_lookup_reloc (const CGEN_INSN * insn ATTRIBUTE_UNUSED, return BFD_RELOC_NONE; } +void +m32c_cons_fix_new (fragS * frag, + int where, + int size, + expressionS *exp) +{ + bfd_reloc_code_real_type type; + + switch (size) + { + case 1: + type = BFD_RELOC_8; + break; + case 2: + type = BFD_RELOC_16; + break; + case 3: + type = BFD_RELOC_24; + break; + case 4: + default: + type = BFD_RELOC_32; + break; + case 8: + type = BFD_RELOC_64; + break; + } + + fix_new_exp (frag, where, (int) size, exp, 0, type); +} + void m32c_apply_fix (struct fix *f, valueT *t, segT s) { diff --git a/gas/config/tc-m32c.h b/gas/config/tc-m32c.h index 3cdd1a14e4f..697e130e19d 100644 --- a/gas/config/tc-m32c.h +++ b/gas/config/tc-m32c.h @@ -57,6 +57,10 @@ extern bfd_boolean m32c_fix_adjustable PARAMS ((struct fix *)); #define TC_FORCE_RELOCATION(fix) m32c_force_relocation (fix) extern int m32c_force_relocation PARAMS ((struct fix *)); +#define TC_CONS_FIX_NEW(FRAG, WHERE, NBYTES, EXP) \ + m32c_cons_fix_new (FRAG, WHERE, NBYTES, EXP) +extern void m32c_cons_fix_new (fragS *, int, int, expressionS *); + extern const struct relax_type md_relax_table[]; #define TC_GENERIC_RELAX_TABLE md_relax_table diff --git a/gas/config/tc-m32r.c b/gas/config/tc-m32r.c index 51b160a98f7..bec2a8ced1a 100644 --- a/gas/config/tc-m32r.c +++ b/gas/config/tc-m32r.c @@ -1,6 +1,6 @@ /* tc-m32r.c -- Assembler for the Renesas M32R. - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -19,7 +19,6 @@ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "as.h" #include "safe-ctype.h" #include "subsegs.h" diff --git a/gas/config/tc-m32r.h b/gas/config/tc-m32r.h index 69fe9453cc3..e5373cc160f 100644 --- a/gas/config/tc-m32r.h +++ b/gas/config/tc-m32r.h @@ -1,6 +1,6 @@ /* tc-m32r.h -- Header file for tc-m32r.c. - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -88,13 +88,6 @@ extern bfd_boolean m32r_fix_adjustable (struct fix *); obj_fix_adjustable() says it is not adjustable. */ #define TC_FIX_ADJUSTABLE(fixP) obj_fix_adjustable (fixP) -#define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \ - ((FIX)->fx_addsy == NULL \ - || (! S_IS_EXTERNAL ((FIX)->fx_addsy) \ - && ! S_IS_WEAK ((FIX)->fx_addsy) \ - && S_IS_DEFINED ((FIX)->fx_addsy) \ - && ! S_IS_COMMON ((FIX)->fx_addsy))) - #define tc_frob_file_before_fix() m32r_frob_file () extern void m32r_frob_file (void); diff --git a/gas/config/tc-m68hc11.c b/gas/config/tc-m68hc11.c index e6d4235d769..822174fa11e 100644 --- a/gas/config/tc-m68hc11.c +++ b/gas/config/tc-m68hc11.c @@ -1,5 +1,5 @@ /* tc-m68hc11.c -- Assembler code for the Motorola 68HC11 & 68HC12. - Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Stephane Carrez (stcarrez@nerim.fr) @@ -210,7 +210,7 @@ static void s_m68hc11_mark_symbol (int); jmp L Setting the flag forbidds this. */ -static short flag_fixed_branchs = 0; +static short flag_fixed_branches = 0; /* Force to use long jumps (absolute) instead of relative branches. */ static short flag_force_long_jumps = 0; @@ -290,10 +290,12 @@ const char *md_shortopts = "Sm:"; struct option md_longopts[] = { #define OPTION_FORCE_LONG_BRANCH (OPTION_MD_BASE) - {"force-long-branchs", no_argument, NULL, OPTION_FORCE_LONG_BRANCH}, + {"force-long-branches", no_argument, NULL, OPTION_FORCE_LONG_BRANCH}, + {"force-long-branchs", no_argument, NULL, OPTION_FORCE_LONG_BRANCH}, /* Misspelt version kept for backwards compatibility. */ -#define OPTION_SHORT_BRANCHS (OPTION_MD_BASE + 1) - {"short-branchs", no_argument, NULL, OPTION_SHORT_BRANCHS}, +#define OPTION_SHORT_BRANCHES (OPTION_MD_BASE + 1) + {"short-branches", no_argument, NULL, OPTION_SHORT_BRANCHES}, + {"short-branchs", no_argument, NULL, OPTION_SHORT_BRANCHES}, /* Misspelt version kept for backwards compatibility. */ #define OPTION_STRICT_DIRECT_MODE (OPTION_MD_BASE + 2) {"strict-direct-mode", no_argument, NULL, OPTION_STRICT_DIRECT_MODE}, @@ -374,8 +376,8 @@ Motorola 68HC11/68HC12/68HCS12 options:\n\ -mlong use 32-bit int ABI\n\ -mshort-double use 32-bit double ABI\n\ -mlong-double use 64-bit double ABI (default)\n\ - --force-long-branchs always turn relative branchs into absolute ones\n\ - -S,--short-branchs do not turn relative branchs into absolute ones\n\ + --force-long-branches always turn relative branches into absolute ones\n\ + -S,--short-branches do not turn relative branches into absolute ones\n\ when the offset is out of range\n\ --strict-direct-mode do not turn the direct mode into extended mode\n\ when the instruction does not support direct mode\n\ @@ -447,9 +449,9 @@ md_parse_option (int c, char *arg) switch (c) { /* -S means keep external to 2 bit offset rather than 16 bit one. */ - case OPTION_SHORT_BRANCHS: + case OPTION_SHORT_BRANCHES: case 'S': - flag_fixed_branchs = 1; + flag_fixed_branches = 1; break; case OPTION_FORCE_LONG_BRANCH: @@ -1516,7 +1518,7 @@ fixup24 (expressionS *oper, int mode, int opmode ATTRIBUTE_UNUSED) fixS *fixp; /* Now create a 24-bit fixup. */ - fixp = fix_new_exp (frag_now, f - frag_now->fr_literal, 2, + fixp = fix_new_exp (frag_now, f - frag_now->fr_literal, 3, oper, FALSE, BFD_RELOC_M68HC11_24); number_to_chars_bigendian (f, 0, 3); } @@ -1587,12 +1589,12 @@ build_jump_insn (struct m68hc11_opcode *opcode, operand operands[], if ((jmp_mode == 0 && flag_force_long_jumps) || (operands[0].exp.X_op == O_constant && (!check_range (n, opcode->format) && - (jmp_mode == 1 || flag_fixed_branchs == 0)))) + (jmp_mode == 1 || flag_fixed_branches == 0)))) { frag = frag_now; where = frag_now_fix (); - fix_new (frag_now, frag_now_fix (), 1, + fix_new (frag_now, frag_now_fix (), 0, &abs_symbol, 0, 1, BFD_RELOC_M68HC11_RL_JUMP); if (code == M6811_BSR || code == M6811_BRA || code == M6812_BSR) @@ -1652,7 +1654,7 @@ build_jump_insn (struct m68hc11_opcode *opcode, operand operands[], frag = frag_now; where = frag_now_fix (); - fix_new (frag_now, frag_now_fix (), 1, + fix_new (frag_now, frag_now_fix (), 0, &abs_symbol, 0, 1, BFD_RELOC_M68HC11_RL_JUMP); f = m68hc11_new_insn (2); @@ -1667,11 +1669,11 @@ build_jump_insn (struct m68hc11_opcode *opcode, operand operands[], frag = frag_now; where = frag_now_fix (); - fix_new (frag_now, frag_now_fix (), 1, + fix_new (frag_now, frag_now_fix (), 0, &abs_symbol, 0, 1, BFD_RELOC_M68HC11_RL_JUMP); /* Branch offset must fit in 8-bits, don't do some relax. */ - if (jmp_mode == 0 && flag_fixed_branchs) + if (jmp_mode == 0 && flag_fixed_branches) { opcode = m68hc11_new_insn (1); number_to_chars_bigendian (opcode, code, 1); @@ -1753,7 +1755,7 @@ build_dbranch_insn (struct m68hc11_opcode *opcode, operand operands[], if ((jmp_mode == 0 && flag_force_long_jumps) || (operands[1].exp.X_op == O_constant && (!check_range (n, M6812_OP_IBCC_MARKER) && - (jmp_mode == 1 || flag_fixed_branchs == 0)))) + (jmp_mode == 1 || flag_fixed_branches == 0)))) { f = frag_more (2); code ^= 0x20; @@ -1784,7 +1786,7 @@ build_dbranch_insn (struct m68hc11_opcode *opcode, operand operands[], else { /* Branch offset must fit in 8-bits, don't do some relax. */ - if (jmp_mode == 0 && flag_fixed_branchs) + if (jmp_mode == 0 && flag_fixed_branches) { fixup8 (&operands[0].exp, M6811_OP_JUMP_REL, M6811_OP_JUMP_REL); } @@ -2100,7 +2102,7 @@ build_insn (struct m68hc11_opcode *opcode, operand operands[], format = opcode->format; if (format & M6811_OP_BRANCH) - fix_new (frag_now, frag_now_fix (), 1, + fix_new (frag_now, frag_now_fix (), 0, &abs_symbol, 0, 1, BFD_RELOC_M68HC11_RL_JUMP); if (format & OP_EXTENDED) @@ -2455,7 +2457,7 @@ md_assemble (char *str) char name[20]; int nlen = 0; operand operands[M6811_MAX_OPERANDS]; - int nb_operands; + int nb_operands = 0; int branch_optimize = 0; int alias_id = -1; @@ -2484,8 +2486,8 @@ md_assemble (char *str) opc = (struct m68hc11_opcode_def *) hash_find (m68hc11_hash, name); /* If it's not recognized, look for 'jbsr' and 'jbxx'. These are - pseudo insns for relative branch. For these branchs, we always - optimize them (turned into absolute branchs) even if --short-branchs + pseudo insns for relative branch. For these branches, we always + optimize them (turned into absolute branches) even if --short-branches is given. */ if (opc == NULL && name[0] == 'j' && name[1] == 'b') { @@ -2702,7 +2704,7 @@ s_m68hc11_relax (int ignore ATTRIBUTE_UNUSED) return; } - fix_new_exp (frag_now, frag_now_fix (), 2, &ex, 1, + fix_new_exp (frag_now, frag_now_fix (), 0, &ex, 1, BFD_RELOC_M68HC11_RL_GROUP); demand_empty_rest_of_line (); @@ -3018,7 +3020,7 @@ md_estimate_size_before_relax (fragS *fragP, asection *segment) || IS_OPCODE (fragP->fr_opcode[0], M6811_BRA) || IS_OPCODE (fragP->fr_opcode[0], M6812_BSR)); - if (flag_fixed_branchs) + if (flag_fixed_branches) as_bad_where (fragP->fr_file, fragP->fr_line, _("bra or bsr with undefined symbol.")); diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c index 6cf85d7e603..32c985324c2 100644 --- a/gas/config/tc-m68k.c +++ b/gas/config/tc-m68k.c @@ -1,6 +1,6 @@ /* tc-m68k.c -- Assemble for the m68k family Copyright 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -173,62 +173,130 @@ static const enum m68k_register m68060_ctrl[] = { }; static const enum m68k_register mcf_ctrl[] = { CACR, TC, ACR0, ACR1, ACR2, ACR3, VBR, ROMBAR, - RAMBAR0, RAMBAR1, MBAR, + RAMBAR0, RAMBAR1, RAMBAR, MBAR, + 0 +}; +static const enum m68k_register mcf5206_ctrl[] = { + CACR, ACR0, ACR1, VBR, RAMBAR0, RAMBAR_ALT, MBAR, 0 }; static const enum m68k_register mcf5208_ctrl[] = { - CACR, ACR0, ACR1, VBR, RAMBAR1, + CACR, ACR0, ACR1, VBR, RAMBAR, RAMBAR1, + 0 +}; +static const enum m68k_register mcf5210a_ctrl[] = { + VBR, CACR, ACR0, ACR1, ROMBAR, RAMBAR, RAMBAR1, MBAR, 0 }; static const enum m68k_register mcf5213_ctrl[] = { - VBR, RAMBAR, FLASHBAR, + VBR, RAMBAR, RAMBAR1, FLASHBAR, 0 }; static const enum m68k_register mcf5216_ctrl[] = { - VBR, CACR, ACR0, ACR1, FLASHBAR, RAMBAR, + VBR, CACR, ACR0, ACR1, FLASHBAR, RAMBAR, RAMBAR1, + 0 +}; +static const enum m68k_register mcf52223_ctrl[] = { + VBR, CACR, ACR0, ACR1, FLASHBAR, RAMBAR, RAMBAR1, + 0 +}; +static const enum m68k_register mcf52235_ctrl[] = { + VBR, FLASHBAR, RAMBAR, RAMBAR1, + 0 +}; +static const enum m68k_register mcf5225_ctrl[] = { + VBR, CACR, ACR0, ACR1, FLASHBAR, RAMBAR, MBAR, RAMBAR1, 0 }; static const enum m68k_register mcf5235_ctrl[] = { - VBR, CACR, ACR0, ACR1, RAMBAR, + VBR, CACR, ACR0, ACR1, RAMBAR, RAMBAR1, 0 }; static const enum m68k_register mcf5249_ctrl[] = { - VBR, CACR, ACR0, ACR1, RAMBAR0, RAMBAR1, MBAR, MBAR2, + VBR, CACR, ACR0, ACR1, RAMBAR0, RAMBAR1, RAMBAR, MBAR, MBAR2, 0 }; static const enum m68k_register mcf5250_ctrl[] = { VBR, 0 }; +static const enum m68k_register mcf5253_ctrl[] = { + VBR, CACR, ACR0, ACR1, RAMBAR0, RAMBAR1, MBAR, + 0 +}; static const enum m68k_register mcf5271_ctrl[] = { - VBR, CACR, ACR0, ACR1, RAMBAR, + VBR, CACR, ACR0, ACR1, RAMBAR, RAMBAR1, 0 }; static const enum m68k_register mcf5272_ctrl[] = { - VBR, CACR, ACR0, ACR1, ROMBAR, RAMBAR, MBAR, + VBR, CACR, ACR0, ACR1, ROMBAR, RAMBAR_ALT, RAMBAR0, MBAR, 0 }; static const enum m68k_register mcf5275_ctrl[] = { - VBR, CACR, ACR0, ACR1, RAMBAR, + VBR, CACR, ACR0, ACR1, RAMBAR, RAMBAR1, 0 }; static const enum m68k_register mcf5282_ctrl[] = { - VBR, CACR, ACR0, ACR1, FLASHBAR, RAMBAR, + VBR, CACR, ACR0, ACR1, FLASHBAR, RAMBAR, RAMBAR1, + 0 +}; +static const enum m68k_register mcf5307_ctrl[] = { + CACR, ACR0, ACR1, VBR, RAMBAR0, RAMBAR_ALT, MBAR, 0 }; static const enum m68k_register mcf5329_ctrl[] = { - VBR, CACR, ACR0, ACR1, RAMBAR, + VBR, CACR, ACR0, ACR1, RAMBAR, RAMBAR1, 0 }; static const enum m68k_register mcf5373_ctrl[] = { - VBR, CACR, ACR0, ACR1, RAMBAR, + VBR, CACR, ACR0, ACR1, RAMBAR, RAMBAR1, 0 }; static const enum m68k_register mcfv4e_ctrl[] = { - CACR, TC, ITT0, ITT1, DTT0, DTT1, BUSCR, VBR, PC, ROMBAR, - ROMBAR1, RAMBAR0, RAMBAR1, MPCR, EDRAMBAR, SECMBAR, MBAR, MBAR0, MBAR1, + CACR, ASID, ACR0, ACR1, ACR2, ACR3, MMUBAR, + VBR, PC, ROMBAR0, ROMBAR1, RAMBAR0, RAMBAR1, + MBAR, SECMBAR, + MPCR /* Multiprocessor Control register */, + EDRAMBAR /* Embedded DRAM Base Address Register */, + /* Permutation control registers. */ PCR1U0, PCR1L0, PCR1U1, PCR1L1, PCR2U0, PCR2L0, PCR2U1, PCR2L1, PCR3U0, PCR3L0, PCR3U1, PCR3L1, + /* Legacy names */ + TC /* ASID */, BUSCR /* MMUBAR */, + ITT0 /* ACR0 */, ITT1 /* ACR1 */, DTT0 /* ACR2 */, DTT1 /* ACR3 */, + MBAR1 /* MBAR */, MBAR2 /* SECMBAR */, MBAR0 /* SECMBAR */, + ROMBAR /* ROMBAR0 */, RAMBAR /* RAMBAR1 */, + 0 +}; +static const enum m68k_register mcf54455_ctrl[] = { + CACR, ASID, ACR0, ACR1, ACR2, ACR3, MMUBAR, + VBR, PC, RAMBAR1, MBAR, + /* Legacy names */ + TC /* ASID */, BUSCR /* MMUBAR */, + ITT0 /* ACR0 */, ITT1 /* ACR1 */, DTT0 /* ACR2 */, DTT1 /* ACR3 */, + MBAR1 /* MBAR */, RAMBAR /* RAMBAR1 */, + 0 +}; +static const enum m68k_register mcf5475_ctrl[] = { + CACR, ASID, ACR0, ACR1, ACR2, ACR3, MMUBAR, + VBR, PC, RAMBAR0, RAMBAR1, MBAR, + /* Legacy names */ + TC /* ASID */, BUSCR /* MMUBAR */, + ITT0 /* ACR0 */, ITT1 /* ACR1 */, DTT0 /* ACR2 */, DTT1 /* ACR3 */, + MBAR1 /* MBAR */, RAMBAR /* RAMBAR1 */, + 0 +}; +static const enum m68k_register mcf5485_ctrl[] = { + CACR, ASID, ACR0, ACR1, ACR2, ACR3, MMUBAR, + VBR, PC, RAMBAR0, RAMBAR1, MBAR, + /* Legacy names */ + TC /* ASID */, BUSCR /* MMUBAR */, + ITT0 /* ACR0 */, ITT1 /* ACR1 */, DTT0 /* ACR2 */, DTT1 /* ACR3 */, + MBAR1 /* MBAR */, RAMBAR /* RAMBAR1 */, + 0 +}; +static const enum m68k_register fido_ctrl[] = { + SFC, DFC, USP, VBR, CAC, MBB, 0 }; #define cpu32_ctrl m68010_ctrl @@ -284,14 +352,21 @@ struct m68k_it reloc[5]; /* Five is enough??? */ }; -#define cpu_of_arch(x) ((x) & (m68000up | mcfisa_a)) +#define cpu_of_arch(x) ((x) & (m68000up | mcfisa_a | fido_a)) #define float_of_arch(x) ((x) & mfloat) #define mmu_of_arch(x) ((x) & mmmu) #define arch_coldfire_p(x) ((x) & mcfisa_a) #define arch_coldfire_fpu(x) ((x) & cfloat) /* Macros for determining if cpu supports a specific addressing mode. */ -#define HAVE_LONG_BRANCH(x) ((x) & (m68020|m68030|m68040|m68060|cpu32|mcfisa_b)) +#define HAVE_LONG_DISP(x) \ + ((x) & (m68020|m68030|m68040|m68060|cpu32|fido_a|mcfisa_b|mcfisa_c)) +#define HAVE_LONG_CALL(x) \ + ((x) & (m68020|m68030|m68040|m68060|cpu32|fido_a|mcfisa_b|mcfisa_c)) +#define HAVE_LONG_COND(x) \ + ((x) & (m68020|m68030|m68040|m68060|cpu32|fido_a|mcfisa_b|mcfisa_c)) +#define HAVE_LONG_BRANCH(x) \ + ((x) & (m68020|m68030|m68040|m68060|cpu32|fido_a|mcfisa_b)) static struct m68k_it the_ins; /* The instruction being assembled. */ @@ -421,9 +496,11 @@ static const struct m68k_cpu m68k_archs[] = {m68040, m68040_ctrl, "68040", 0}, {m68060, m68060_ctrl, "68060", 0}, {cpu32|m68881, cpu32_ctrl, "cpu32", 0}, + {fido_a, fido_ctrl, "fidoa", 0}, {mcfisa_a|mcfhwdiv, NULL, "isaa", 0}, {mcfisa_a|mcfhwdiv|mcfisa_aa|mcfusp, NULL, "isaaplus", 0}, {mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp, NULL, "isab", 0}, + {mcfisa_a|mcfhwdiv|mcfisa_c|mcfusp, NULL, "isac", 0}, {mcfisa_a|mcfhwdiv|mcfisa_b|mcfmac|mcfusp, mcf_ctrl, "cfv4", 0}, {mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "cfv4e", 0}, {0,0,NULL, 0} @@ -486,13 +563,16 @@ static const struct m68k_cpu m68k_cpus[] = {mcfisa_a, mcf_ctrl, "5200", 0}, {mcfisa_a, mcf_ctrl, "5202", 1}, {mcfisa_a, mcf_ctrl, "5204", 1}, - {mcfisa_a, mcf_ctrl, "5206", 1}, + {mcfisa_a, mcf5206_ctrl, "5206", 1}, - {mcfisa_a|mcfhwdiv|mcfmac, mcf_ctrl, "5206e", 0}, + {mcfisa_a|mcfhwdiv|mcfmac, mcf5206_ctrl, "5206e", 0}, {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5208_ctrl, "5207", -1}, {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5208_ctrl, "5208", 0}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp, mcf5210a_ctrl, "5210a", 0}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp, mcf5210a_ctrl, "5211a", 1}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp, mcf5213_ctrl, "5211", -1}, {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp, mcf5213_ctrl, "5212", -1}, {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp, mcf5213_ctrl, "5213", 0}, @@ -501,6 +581,17 @@ static const struct m68k_cpu m68k_cpus[] = {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5216_ctrl, "5216", 0}, {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5216_ctrl, "521x", 2}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp, mcf52223_ctrl, "52221", -1}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp, mcf52223_ctrl, "52223", 0}, + + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf52235_ctrl, "52230", -1}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf52235_ctrl, "52233", -1}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf52235_ctrl, "52234", -1}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf52235_ctrl, "52235", 0}, + + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp, mcf5225_ctrl, "5224", -1}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp, mcf5225_ctrl, "5225", 0}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5235_ctrl, "5232", -1}, {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5235_ctrl, "5233", -1}, {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5235_ctrl, "5234", -1}, @@ -509,6 +600,7 @@ static const struct m68k_cpu m68k_cpus[] = {mcfisa_a|mcfhwdiv|mcfemac, mcf5249_ctrl, "5249", 0}, {mcfisa_a|mcfhwdiv|mcfemac, mcf5250_ctrl, "5250", 0}, + {mcfisa_a|mcfhwdiv|mcfemac, mcf5253_ctrl, "5253", 0}, {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5271_ctrl, "5270", -1}, {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5271_ctrl, "5271", 0}, @@ -523,7 +615,7 @@ static const struct m68k_cpu m68k_cpus[] = {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5282_ctrl, "5282", -1}, {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5282_ctrl, "528x", 0}, - {mcfisa_a|mcfhwdiv|mcfmac, mcf_ctrl, "5307", 0}, + {mcfisa_a|mcfhwdiv|mcfmac, mcf5307_ctrl, "5307", 0}, {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5329_ctrl, "5327", -1}, {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5329_ctrl, "5328", -1}, @@ -535,23 +627,33 @@ static const struct m68k_cpu m68k_cpus[] = {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5373_ctrl, "537x", 0}, {mcfisa_a|mcfisa_b|mcfhwdiv|mcfmac, mcf_ctrl, "5407",0}, + + {mcfisa_a|mcfisa_c|mcfhwdiv|mcfemac|mcfusp, mcf54455_ctrl, "54450", -1}, + {mcfisa_a|mcfisa_c|mcfhwdiv|mcfemac|mcfusp, mcf54455_ctrl, "54451", -1}, + {mcfisa_a|mcfisa_c|mcfhwdiv|mcfemac|mcfusp, mcf54455_ctrl, "54452", -1}, + {mcfisa_a|mcfisa_c|mcfhwdiv|mcfemac|mcfusp, mcf54455_ctrl, "54453", -1}, + {mcfisa_a|mcfisa_c|mcfhwdiv|mcfemac|mcfusp, mcf54455_ctrl, "54454", -1}, + {mcfisa_a|mcfisa_c|mcfhwdiv|mcfemac|mcfusp, mcf54455_ctrl, "54455", 0}, - {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5470", -1}, - {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5471", -1}, - {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5472", -1}, - {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5473", -1}, - {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5474", -1}, - {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5475", -1}, - {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "547x", 0}, + {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcf5475_ctrl, "5470", -1}, + {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcf5475_ctrl, "5471", -1}, + {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcf5475_ctrl, "5472", -1}, + {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcf5475_ctrl, "5473", -1}, + {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcf5475_ctrl, "5474", -1}, + {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcf5475_ctrl, "5475", -1}, + {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcf5475_ctrl, "547x", 0}, - {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5480", -1}, - {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5481", -1}, - {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5482", -1}, - {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5483", -1}, - {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5484", -1}, - {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5485", -1}, - {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "548x", 0}, + {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcf5485_ctrl, "5480", -1}, + {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcf5485_ctrl, "5481", -1}, + {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcf5485_ctrl, "5482", -1}, + {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcf5485_ctrl, "5483", -1}, + {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcf5485_ctrl, "5484", -1}, + {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcf5485_ctrl, "5485", -1}, + {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcf5485_ctrl, "548x", 0}, + {fido_a, fido_ctrl, "fidoa", 0}, + {fido_a, fido_ctrl, "fido", 1}, + {0,NULL,NULL, 0} }; @@ -957,7 +1059,9 @@ tc_m68k_fix_adjustable (fixS *fixP) #define get_reloc_code(SIZE,PCREL,OTHER) NO_RELOC -#define relaxable_symbol(symbol) 1 +/* PR gas/3041 Weak symbols are not relaxable + because they must be treated as extern. */ +#define relaxable_symbol(symbol) (!(S_IS_WEAK (symbol))) #endif /* OBJ_ELF */ @@ -1051,6 +1155,14 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp) #ifndef OBJ_ELF if (fixp->fx_pcrel) reloc->addend = fixp->fx_addnumber; + else if (OUTPUT_FLAVOR == bfd_target_aout_flavour + && fixp->fx_addsy + && S_IS_WEAK (fixp->fx_addsy) + && ! bfd_is_und_section (S_GET_SEGMENT (fixp->fx_addsy))) + /* PR gas/3041 Adjust addend in order to force bfd_install_relocation() + to put the symbol offset into frags referencing a weak symbol. */ + reloc->addend = fixp->fx_addnumber + - (S_GET_VALUE (fixp->fx_addsy) * 2); else reloc->addend = 0; #else @@ -1685,8 +1797,18 @@ m68k_ip (char *instring) const enum m68k_register *rp; for (rp = control_regs; *rp; rp++) - if (*rp == opP->reg) - break; + { + if (*rp == opP->reg) + break; + /* In most CPUs RAMBAR refers to control reg + c05 (RAMBAR1), but a few CPUs have it + refer to c04 (RAMBAR0). */ + else if (*rp == RAMBAR_ALT && opP->reg == RAMBAR) + { + opP->reg = RAMBAR_ALT; + break; + } + } if (*rp == 0) losing++; } @@ -1843,6 +1965,22 @@ m68k_ip (char *instring) losing++; break; + case 'j': + if (opP->mode != IMMED) + losing++; + else if (opP->disp.exp.X_op != O_constant + || TRUNC (opP->disp.exp.X_add_number) - 1 > 7) + losing++; + break; + + case 'K': + if (opP->mode != IMMED) + losing++; + else if (opP->disp.exp.X_op != O_constant + || TRUNC (opP->disp.exp.X_add_number) > 511) + losing++; + break; + /* JF these are out of order. We could put them in order if we were willing to put up with bunches of #ifdef m68851s in the code. @@ -2061,29 +2199,31 @@ m68k_ip (char *instring) if (!cpu->alias && (cpu->arch & ok_arch)) { const struct m68k_cpu *alias; - + int seen_master = 0; + if (any) APPEND (", "); any = 0; APPEND (cpu->name); - APPEND (" ["); - if (cpu != m68k_cpus) - for (alias = cpu - 1; alias->alias; alias--) + for (alias = cpu; alias != m68k_cpus; alias--) + if (alias[-1].alias >= 0) + break; + for (; !seen_master || alias->alias > 0; alias++) { - if (any) - APPEND (", "); - APPEND (alias->name); - any = 1; + if (!alias->alias) + seen_master = 1; + else + { + if (any) + APPEND (", "); + else + APPEND (" ["); + APPEND (alias->name); + any = 1; + } } - for (alias = cpu + 1; alias->alias; alias++) - { - if (any) - APPEND (", "); - APPEND (alias->name); - any = 1; - } - - APPEND ("]"); + if (any) + APPEND ("]"); any = 1; } if (paren) @@ -2116,6 +2256,8 @@ m68k_ip (char *instring) for (s = the_ins.args, opP = &the_ins.operands[0]; *s; s += 2, opP++) { + int have_disp = 0; + /* This switch is a doozy. Watch the first step; its a big one! */ switch (s[0]) @@ -2775,6 +2917,7 @@ m68k_ip (char *instring) case 'B': tmpreg = get_num (&opP->disp, 90); + switch (s[1]) { case 'B': @@ -2786,23 +2929,36 @@ m68k_ip (char *instring) break; case 'L': long_branch: - if (! HAVE_LONG_BRANCH (current_architecture)) - as_warn (_("Can't use long branches on 68000/68010/5200")); the_ins.opcode[0] |= 0xff; add_fix ('l', &opP->disp, 1, 0); addword (0); addword (0); break; - case 'g': - if (subs (&opP->disp)) /* We can't relax it. */ - goto long_branch; - + case 'g': /* Conditional branch */ + have_disp = HAVE_LONG_CALL (current_architecture); + goto var_branch; + + case 'b': /* Unconditional branch */ + have_disp = HAVE_LONG_BRANCH (current_architecture); + goto var_branch; + + case 's': /* Unconditional subroutine */ + have_disp = HAVE_LONG_CALL (current_architecture); + + var_branch: + if (subs (&opP->disp) /* We can't relax it. */ #ifdef OBJ_ELF - /* If the displacement needs pic relocation it cannot be - relaxed. */ - if (opP->disp.pic_reloc != pic_none) - goto long_branch; + /* If the displacement needs pic relocation it cannot be + relaxed. */ + || opP->disp.pic_reloc != pic_none #endif + || 0) + { + if (!have_disp) + as_warn (_("Can't use long branches on this architecture")); + goto long_branch; + } + /* This could either be a symbol, or an absolute address. If it's an absolute address, turn it into an absolute jump right here and keep it out of the @@ -2828,7 +2984,7 @@ m68k_ip (char *instring) /* Now we know it's going into the relaxer. Now figure out which mode. We try in this order of preference: long branch, absolute jump, byte/word branches only. */ - if (HAVE_LONG_BRANCH (current_architecture)) + if (have_disp) add_frag (adds (&opP->disp), SEXT (offs (&opP->disp)), TAB (BRANCHBWL, SZ_UNDEF)); @@ -2857,7 +3013,7 @@ m68k_ip (char *instring) jumps. */ if (((the_ins.opcode[0] & 0xf0f8) == 0x50c8) && (HAVE_LONG_BRANCH (current_architecture) - || (! flag_keep_pcrel))) + || ! flag_keep_pcrel)) { if (HAVE_LONG_BRANCH (current_architecture)) add_frag (adds (&opP->disp), @@ -2955,6 +3111,7 @@ m68k_ip (char *instring) tmpreg = 0x002; break; case TC: + case ASID: tmpreg = 0x003; break; case ACR0: @@ -2974,6 +3131,7 @@ m68k_ip (char *instring) tmpreg = 0x007; break; case BUSCR: + case MMUBAR: tmpreg = 0x008; break; @@ -3005,6 +3163,7 @@ m68k_ip (char *instring) tmpreg = 0x808; break; case ROMBAR: + case ROMBAR0: tmpreg = 0xC00; break; case ROMBAR1: @@ -3012,6 +3171,7 @@ m68k_ip (char *instring) break; case FLASHBAR: case RAMBAR0: + case RAMBAR_ALT: tmpreg = 0xC04; break; case RAMBAR: @@ -3069,6 +3229,12 @@ m68k_ip (char *instring) case PCR3U1: tmpreg = 0xD0F; break; + case CAC: + tmpreg = 0xFFE; + break; + case MBB: + tmpreg = 0xFFF; + break; default: abort (); } @@ -3332,6 +3498,14 @@ m68k_ip (char *instring) tmpreg = 0; install_operand (s[1], tmpreg); break; + case 'j': + tmpreg = get_num (&opP->disp, 10); + install_operand (s[1], tmpreg - 1); + break; + case 'K': + tmpreg = get_num (&opP->disp, 65); + install_operand (s[1], tmpreg); + break; default: abort (); } @@ -3400,6 +3574,9 @@ install_operand (int mode, int val) case 'd': the_ins.opcode[0] |= val << 9; break; + case 'E': + the_ins.opcode[1] |= val << 9; + break; case '1': the_ins.opcode[1] |= val << 12; break; @@ -3744,7 +3921,7 @@ static const struct init_entry init_table[] = { "dacr0", DTT0 }, /* Data Access Control Register 0. */ { "dacr1", DTT1 }, /* Data Access Control Register 0. */ - /* mcf5200 versions of same. The ColdFire programmer's reference + /* Coldfire versions of same. The ColdFire programmer's reference manual indicated that the order is 2,3,0,1, but Ken Rose says that 0,1,2,3 is the correct order. */ { "acr0", ACR0 }, /* Access Control Unit 0. */ @@ -3754,12 +3931,14 @@ static const struct init_entry init_table[] = { "tc", TC }, /* MMU Translation Control Register. */ { "tcr", TC }, + { "asid", ASID }, { "mmusr", MMUSR }, /* MMU Status Register. */ { "srp", SRP }, /* User Root Pointer. */ { "urp", URP }, /* Supervisor Root Pointer. */ { "buscr", BUSCR }, + { "mmubar", MMUBAR }, { "pcr", PCR }, { "rombar", ROMBAR }, /* ROM Base Address Register. */ @@ -3769,7 +3948,7 @@ static const struct init_entry init_table[] = { "mbar0", MBAR0 }, /* mcfv4e registers. */ { "mbar1", MBAR1 }, /* mcfv4e registers. */ - { "rombar0", ROMBAR }, /* mcfv4e registers. */ + { "rombar0", ROMBAR0 }, /* mcfv4e registers. */ { "rombar1", ROMBAR1 }, /* mcfv4e registers. */ { "mpcr", MPCR }, /* mcfv4e registers. */ { "edrambar", EDRAMBAR }, /* mcfv4e registers. */ @@ -3793,6 +3972,9 @@ static const struct init_entry init_table[] = { "rambar", RAMBAR }, /* mcf528x registers. */ { "mbar2", MBAR2 }, /* mcf5249 registers. */ + + { "cac", CAC }, /* fido registers. */ + { "mbb", MBB }, /* fido registers. */ /* End of control registers. */ { "ac", AC }, @@ -4207,14 +4389,28 @@ md_begin (void) { ins = m68k_sorted_opcodes[i]; - /* We *could* ignore insns that don't match our - arch here by just leaving them out of the hash. */ + /* We must enter all insns into the table, because .arch and + .cpu directives can change things. */ slak->m_operands = ins->args; - slak->m_opnum = strlen (slak->m_operands) / 2; slak->m_arch = ins->arch; slak->m_opcode = ins->opcode; - /* This is kludgey. */ - slak->m_codenum = ((ins->match) & 0xffffL) ? 2 : 1; + + /* In most cases we can determine the number of opcode words + by checking the second word of the mask. Unfortunately + some instructions have 2 opcode words, but no fixed bits + in the second word. A leading dot in the operands + string also indicates 2 opcodes. */ + if (*slak->m_operands == '.') + { + slak->m_operands++; + slak->m_codenum = 2; + } + else if (ins->match & 0xffffL) + slak->m_codenum = 2; + else + slak->m_codenum = 1; + slak->m_opnum = strlen (slak->m_operands) / 2; + if (i + 1 != m68k_numopcodes && !strcmp (ins->name, m68k_sorted_opcodes[i + 1]->name)) { @@ -4547,6 +4743,14 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) S_SET_WEAK (fixP->fx_addsy); return; } +#elif defined(OBJ_AOUT) + /* PR gas/3041 Do not fix frags referencing a weak symbol. */ + if (fixP->fx_addsy && S_IS_WEAK (fixP->fx_addsy)) + { + memset (buf, 0, fixP->fx_size); + fixP->fx_addnumber = val; /* Remember value for emit_reloc. */ + return; + } #endif if (fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT @@ -4597,7 +4801,8 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) if ((addressT) val > upper_limit && (val > 0 || val < lower_limit)) - as_bad_where (fixP->fx_file, fixP->fx_line, _("value out of range")); + as_bad_where (fixP->fx_file, fixP->fx_line, + _("value %ld out of range"), (long)val); /* A one byte PC-relative reloc means a short branch. We can't use a short branch with a value of 0 or -1, because those indicate @@ -4610,7 +4815,8 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) && (fixP->fx_addsy == NULL || S_IS_DEFINED (fixP->fx_addsy)) && (val == 0 || val == -1)) - as_bad_where (fixP->fx_file, fixP->fx_line, _("invalid byte branch offset")); + as_bad_where (fixP->fx_file, fixP->fx_line, + _("invalid byte branch offset")); } /* *fragP has been relaxed to its final size, and now needs to have @@ -4621,7 +4827,7 @@ static void md_convert_frag_1 (fragS *fragP) { long disp; - fixS *fixP; + fixS *fixP = NULL; /* Address in object code of the displacement. */ register int object_address = fragP->fr_fix + fragP->fr_address; @@ -4656,35 +4862,37 @@ md_convert_frag_1 (fragS *fragP) case TAB (BRABSJCOND, SHORT): case TAB (BRANCHBW, SHORT): fragP->fr_opcode[1] = 0x00; - fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, fragP->fr_offset, - 1, RELAX_RELOC_PC16); + fixP = fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, + fragP->fr_offset, 1, RELAX_RELOC_PC16); fragP->fr_fix += 2; break; case TAB (BRANCHBWL, LONG): fragP->fr_opcode[1] = (char) 0xFF; - fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, fragP->fr_offset, - 1, RELAX_RELOC_PC32); + fixP = fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, + fragP->fr_offset, 1, RELAX_RELOC_PC32); fragP->fr_fix += 4; break; case TAB (BRABSJUNC, LONG): if (fragP->fr_opcode[0] == 0x61) /* jbsr */ { if (flag_keep_pcrel) - as_fatal (_("Tried to convert PC relative BSR to absolute JSR")); + as_bad_where (fragP->fr_file, fragP->fr_line, + _("Conversion of PC relative BSR to absolute JSR")); fragP->fr_opcode[0] = 0x4E; fragP->fr_opcode[1] = (char) 0xB9; /* JSR with ABSL LONG operand. */ - fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, fragP->fr_offset, - 0, RELAX_RELOC_ABS32); + fixP = fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, + fragP->fr_offset, 0, RELAX_RELOC_ABS32); fragP->fr_fix += 4; } else if (fragP->fr_opcode[0] == 0x60) /* jbra */ { if (flag_keep_pcrel) - as_fatal (_("Tried to convert PC relative branch to absolute jump")); + as_bad_where (fragP->fr_file, fragP->fr_line, + _("Conversion of PC relative branch to absolute jump")); fragP->fr_opcode[0] = 0x4E; fragP->fr_opcode[1] = (char) 0xF9; /* JMP with ABSL LONG operand. */ - fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, fragP->fr_offset, - 0, RELAX_RELOC_ABS32); + fixP = fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, + fragP->fr_offset, 0, RELAX_RELOC_ABS32); fragP->fr_fix += 4; } else @@ -4696,7 +4904,8 @@ md_convert_frag_1 (fragS *fragP) break; case TAB (BRABSJCOND, LONG): if (flag_keep_pcrel) - as_fatal (_("Tried to convert PC relative conditional branch to absolute jump")); + as_bad_where (fragP->fr_file, fragP->fr_line, + _("Conversion of PC relative conditional branch to absolute jump")); /* Only Bcc 68000 instructions can come here Change bcc into b!cc/jmp absl long. */ @@ -4709,26 +4918,26 @@ md_convert_frag_1 (fragS *fragP) *buffer_address++ = 0x4e; /* put in jmp long (0x4ef9) */ *buffer_address++ = (char) 0xf9; fragP->fr_fix += 2; /* Account for jmp instruction. */ - fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, - fragP->fr_offset, 0, RELAX_RELOC_ABS32); + fixP = fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, + fragP->fr_offset, 0, RELAX_RELOC_ABS32); fragP->fr_fix += 4; break; case TAB (FBRANCH, SHORT): know ((fragP->fr_opcode[1] & 0x40) == 0); - fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, fragP->fr_offset, - 1, RELAX_RELOC_PC16); + fixP = fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, + fragP->fr_offset, 1, RELAX_RELOC_PC16); fragP->fr_fix += 2; break; case TAB (FBRANCH, LONG): fragP->fr_opcode[1] |= 0x40; /* Turn on LONG bit. */ - fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, fragP->fr_offset, - 1, RELAX_RELOC_PC32); + fixP = fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, + fragP->fr_offset, 1, RELAX_RELOC_PC32); fragP->fr_fix += 4; break; case TAB (DBCCLBR, SHORT): case TAB (DBCCABSJ, SHORT): - fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, fragP->fr_offset, - 1, RELAX_RELOC_PC16); + fixP = fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, + fragP->fr_offset, 1, RELAX_RELOC_PC16); fragP->fr_fix += 2; break; case TAB (DBCCLBR, LONG): @@ -4736,7 +4945,8 @@ md_convert_frag_1 (fragS *fragP) Change dbcc into dbcc/bral. JF: these used to be fr_opcode[2-7], but that's wrong. */ if (flag_keep_pcrel) - as_fatal (_("Tried to convert DBcc to absolute jump")); + as_bad_where (fragP->fr_file, fragP->fr_line, + _("Conversion of DBcc to absolute jump")); *buffer_address++ = 0x00; /* Branch offset = 4. */ *buffer_address++ = 0x04; @@ -4746,8 +4956,8 @@ md_convert_frag_1 (fragS *fragP) *buffer_address++ = (char) 0xff; fragP->fr_fix += 6; /* Account for bra/jmp instructions. */ - fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, fragP->fr_offset, 1, - RELAX_RELOC_PC32); + fixP = fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, + fragP->fr_offset, 1, RELAX_RELOC_PC32); fragP->fr_fix += 4; break; case TAB (DBCCABSJ, LONG): @@ -4755,7 +4965,8 @@ md_convert_frag_1 (fragS *fragP) Change dbcc into dbcc/jmp. JF: these used to be fr_opcode[2-7], but that's wrong. */ if (flag_keep_pcrel) - as_fatal (_("Tried to convert PC relative conditional branch to absolute jump")); + as_bad_where (fragP->fr_file, fragP->fr_line, + _("Conversion of PC relative conditional branch to absolute jump")); *buffer_address++ = 0x00; /* Branch offset = 4. */ *buffer_address++ = 0x04; @@ -4765,15 +4976,15 @@ md_convert_frag_1 (fragS *fragP) *buffer_address++ = (char) 0xf9; fragP->fr_fix += 6; /* Account for bra/jmp instructions. */ - fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, fragP->fr_offset, 0, - RELAX_RELOC_ABS32); + fixP = fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, + fragP->fr_offset, 0, RELAX_RELOC_ABS32); fragP->fr_fix += 4; break; case TAB (PCREL1632, SHORT): fragP->fr_opcode[1] &= ~0x3F; fragP->fr_opcode[1] |= 0x3A; /* 072 - mode 7.2 */ - fix_new (fragP, (int) (fragP->fr_fix), 2, fragP->fr_symbol, - fragP->fr_offset, 1, RELAX_RELOC_PC16); + fixP = fix_new (fragP, (int) (fragP->fr_fix), 2, fragP->fr_symbol, + fragP->fr_offset, 1, RELAX_RELOC_PC16); fragP->fr_fix += 2; break; case TAB (PCREL1632, LONG): @@ -4813,24 +5024,29 @@ md_convert_frag_1 (fragS *fragP) fragP->fr_fix += 4; break; case TAB (ABSTOPCREL, SHORT): - fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, fragP->fr_offset, - 1, RELAX_RELOC_PC16); + fixP = fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, + fragP->fr_offset, 1, RELAX_RELOC_PC16); fragP->fr_fix += 2; break; case TAB (ABSTOPCREL, LONG): if (flag_keep_pcrel) - as_fatal (_("Tried to convert PC relative conditional branch to absolute jump")); + as_fatal (_("Conversion of PC relative displacement to absolute")); /* The thing to do here is force it to ABSOLUTE LONG, since ABSTOPCREL is really trying to shorten an ABSOLUTE address anyway. */ if ((fragP->fr_opcode[1] & 0x3F) != 0x3A) abort (); fragP->fr_opcode[1] &= ~0x3F; fragP->fr_opcode[1] |= 0x39; /* Mode 7.1 */ - fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, fragP->fr_offset, - 0, RELAX_RELOC_ABS32); + fixP = fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, + fragP->fr_offset, 0, RELAX_RELOC_ABS32); fragP->fr_fix += 4; break; } + if (fixP) + { + fixP->fx_file = fragP->fr_file; + fixP->fx_line = fragP->fr_line; + } } void @@ -5054,6 +5270,7 @@ md_create_long_jump (char *ptr, addressT from_addr, addressT to_addr, 50: absolute 0:127 only 55: absolute -64:63 only 60: absolute -128:127 only + 65: absolute 0:511 only 70: absolute 0:4095 only 80: absolute -1, 1:7 only 90: No bignums. */ @@ -5109,6 +5326,10 @@ get_num (struct m68k_exp *exp, int ok) if ((valueT) SEXT (offs (exp)) + 128 > 255) goto outrange; break; + case 65: + if ((valueT) TRUNC (offs (exp)) > 511) + goto outrange; + break; case 70: if ((valueT) TRUNC (offs (exp)) > 4095) { @@ -7497,6 +7718,8 @@ m68k_elf_final_processing (void) /* Set file-specific flags if this is a cpu32 processor. */ if (cpu_of_arch (current_architecture) & cpu32) flags |= EF_M68K_CPU32; + else if (cpu_of_arch (current_architecture) & fido_a) + flags |= EF_M68K_FIDO; else if ((cpu_of_arch (current_architecture) & m68000up) && !(cpu_of_arch (current_architecture) & m68020up)) flags |= EF_M68K_M68000; @@ -7505,24 +7728,25 @@ m68k_elf_final_processing (void) { static const unsigned isa_features[][2] = { - {EF_M68K_ISA_A_NODIV, mcfisa_a}, - {EF_M68K_ISA_A, mcfisa_a|mcfhwdiv}, - {EF_M68K_ISA_A_PLUS,mcfisa_a|mcfisa_aa|mcfhwdiv|mcfusp}, - {EF_M68K_ISA_B_NOUSP,mcfisa_a|mcfisa_b|mcfhwdiv}, - {EF_M68K_ISA_B, mcfisa_a|mcfisa_b|mcfhwdiv|mcfusp}, + {EF_M68K_CF_ISA_A_NODIV,mcfisa_a}, + {EF_M68K_CF_ISA_A, mcfisa_a|mcfhwdiv}, + {EF_M68K_CF_ISA_A_PLUS, mcfisa_a|mcfisa_aa|mcfhwdiv|mcfusp}, + {EF_M68K_CF_ISA_B_NOUSP,mcfisa_a|mcfisa_b|mcfhwdiv}, + {EF_M68K_CF_ISA_B, mcfisa_a|mcfisa_b|mcfhwdiv|mcfusp}, + {EF_M68K_CF_ISA_C, mcfisa_a|mcfisa_c|mcfhwdiv|mcfusp}, {0,0}, }; static const unsigned mac_features[][2] = { - {EF_M68K_MAC, mcfmac}, - {EF_M68K_EMAC, mcfemac}, + {EF_M68K_CF_MAC, mcfmac}, + {EF_M68K_CF_EMAC, mcfemac}, {0,0}, }; unsigned ix; unsigned pattern; pattern = (current_architecture - & (mcfisa_a|mcfisa_aa|mcfisa_b|mcfhwdiv|mcfusp)); + & (mcfisa_a|mcfisa_aa|mcfisa_b|mcfisa_c|mcfhwdiv|mcfusp)); for (ix = 0; isa_features[ix][1]; ix++) { if (pattern == isa_features[ix][1]) @@ -7539,7 +7763,7 @@ m68k_elf_final_processing (void) else { if (current_architecture & cfloat) - flags |= EF_M68K_FLOAT | EF_M68K_CFV4E; + flags |= EF_M68K_CF_FLOAT | EF_M68K_CFV4E; pattern = current_architecture & (mcfmac|mcfemac); if (pattern) @@ -7562,7 +7786,7 @@ m68k_elf_final_processing (void) #endif int -tc_m68k_regname_to_dw2regnum (const char *regname) +tc_m68k_regname_to_dw2regnum (char *regname) { unsigned int regnum; static const char *const regnames[] = diff --git a/gas/config/tc-m68k.h b/gas/config/tc-m68k.h index fc05a9264e6..f1464fdbfc5 100644 --- a/gas/config/tc-m68k.h +++ b/gas/config/tc-m68k.h @@ -174,7 +174,7 @@ extern struct relax_type md_relax_table[]; #define DWARF2_CIE_DATA_ALIGNMENT (-4) #define tc_regname_to_dw2regnum tc_m68k_regname_to_dw2regnum -extern int tc_m68k_regname_to_dw2regnum (const char *regname); +extern int tc_m68k_regname_to_dw2regnum (char *regname); #define tc_cfi_frame_initial_instructions tc_m68k_frame_initial_instructions extern void tc_m68k_frame_initial_instructions (void); diff --git a/gas/config/tc-maxq.c b/gas/config/tc-maxq.c index c1a11afc05f..293d7000398 100644 --- a/gas/config/tc-maxq.c +++ b/gas/config/tc-maxq.c @@ -1,6 +1,6 @@ /* tc-maxq.c -- assembler code for a MAXQ chip. - Copyright 2004, 2005 Free Software Foundation, Inc. + Copyright 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by HCL Technologies Pvt. Ltd. @@ -34,10 +34,6 @@ #define MAXQ10S 1 #endif -#ifndef _STRING_H -#include "string.h" -#endif - #ifndef DEFAULT_ARCH #define DEFAULT_ARCH "MAXQ20" #endif @@ -451,7 +447,7 @@ maxq20_cons_fix_new (fragS * frag, unsigned int off, unsigned int len, } /* GAS will call this for every rs_machine_dependent fragment. The - instruction is compleated using the data from the relaxation pass. It may + instruction is completed using the data from the relaxation pass. It may also create any necessary relocations. */ void md_convert_frag (bfd * headers ATTRIBUTE_UNUSED, @@ -687,7 +683,7 @@ const pseudo_typeS md_pseudo_table[] = #define SET_PFX_ARG(x) (PFX_INSN[1] = x) -/* This function sets the PFX value coresponding to the specs. Source +/* This function sets the PFX value corresponding to the specs. Source Destination Index Selection ---------------------------------- Write To| SourceRegRange | Dest Addr Range ------------------------------------------------------ PFX[0] | 0h-Fh | @@ -1150,7 +1146,7 @@ maxq20_immediate (char *imm_start) return 1; } - /* Check For Sign Charcater. */ + /* Check For Sign Character. */ sign_val = 0; do @@ -1600,7 +1596,7 @@ maxq20_operand (char *operand_string) return 1; } - /* Get the origanal string. */ + /* Get the original string. */ memcpy (op_string, operand_string, strlen (operand_string) + 1); ii = strlen (operand_string) + 1; @@ -3101,7 +3097,7 @@ md_assemble (char *line) if (!match_filters ()) return; - /* Check for the approprate PFX register. */ + /* Check for the appropriate PFX register. */ set_prefix (); pfx_for_imm_val (0); diff --git a/gas/config/tc-maxq.h b/gas/config/tc-maxq.h index 12b7a9497ac..dfa37f59ed6 100644 --- a/gas/config/tc-maxq.h +++ b/gas/config/tc-maxq.h @@ -1,4 +1,4 @@ -/* tc-maxq.h -- Header file for the asssembler(MAXQ) +/* tc-maxq.h -- Header file for the assembler(MAXQ) Copyright 2004, 2005 Free Software Foundation, Inc. @@ -116,10 +116,10 @@ extern void maxq20_cons_fix_new (fragS *, unsigned int, unsigned int, expression extern void maxq_number_to_chars (char *, valueT, int); /* If this macro is defined, it is a pointer to a NULL terminated list of - chracters which may appear in an operand. GAS already assumes that all - alphanumeric chracters, and '$', '.', and '_' may appear in an + characters which may appear in an operand. GAS already assumes that all + alphanumeric characters, and '$', '.', and '_' may appear in an operand("symbol_char"in app.c). This macro may be defined to treat - additional chracters as appearing in an operand. This affects the way in + additional characters as appearing in an operand. This affects the way in which GAS removes whitespaces before passing the string to md_assemble. */ #define tc_symbol_chars_extra_symbol_chars diff --git a/gas/config/tc-mcore.c b/gas/config/tc-mcore.c index a795a555036..e4adf058354 100644 --- a/gas/config/tc-mcore.c +++ b/gas/config/tc-mcore.c @@ -1,5 +1,5 @@ /* tc-mcore.c -- Assemble code for M*Core - Copyright 1999, 2000, 2001, 2002, 2003, 2005 + Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -19,14 +19,11 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "as.h" -#include "bfd.h" #include "subsegs.h" #define DEFINE_TABLE #include "../opcodes/mcore-opc.h" #include "safe-ctype.h" -#include #ifdef OBJ_ELF #include "elf/mcore.h" @@ -2173,24 +2170,10 @@ md_estimate_size_before_relax (fragS * fragP, segT segment_type) void md_number_to_chars (char * ptr, valueT use, int nbytes) { - if (! target_big_endian) - switch (nbytes) - { - case 4: ptr[3] = (use >> 24) & 0xff; /* Fall through. */ - case 3: ptr[2] = (use >> 16) & 0xff; /* Fall through. */ - case 2: ptr[1] = (use >> 8) & 0xff; /* Fall through. */ - case 1: ptr[0] = (use >> 0) & 0xff; break; - default: abort (); - } + if (target_big_endian) + number_to_chars_bigendian (ptr, use, nbytes); else - switch (nbytes) - { - case 4: *ptr++ = (use >> 24) & 0xff; /* Fall through. */ - case 3: *ptr++ = (use >> 16) & 0xff; /* Fall through. */ - case 2: *ptr++ = (use >> 8) & 0xff; /* Fall through. */ - case 1: *ptr++ = (use >> 0) & 0xff; break; - default: abort (); - } + number_to_chars_littleendian (ptr, use, nbytes); } /* Round up a section size to the appropriate boundary. */ diff --git a/gas/config/tc-mep.c b/gas/config/tc-mep.c new file mode 100644 index 00000000000..b3b17d3c7a1 --- /dev/null +++ b/gas/config/tc-mep.c @@ -0,0 +1,1886 @@ +/* tc-mep.c -- Assembler for the Toshiba Media Processor. + Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation. + + This file is part of GAS, the GNU Assembler. + + GAS 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 2, or (at your option) + any later version. + + GAS 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 GAS; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +#include +#include "as.h" +#include "dwarf2dbg.h" +#include "subsegs.h" +#include "symcat.h" +#include "opcodes/mep-desc.h" +#include "opcodes/mep-opc.h" +#include "cgen.h" +#include "elf/common.h" +#include "elf/mep.h" +#include "libbfd.h" +#include "xregex.h" + +/* Structure to hold all of the different components describing + an individual instruction. */ +typedef struct +{ + const CGEN_INSN * insn; + const CGEN_INSN * orig_insn; + CGEN_FIELDS fields; +#if CGEN_INT_INSN_P + CGEN_INSN_INT buffer [1]; +#define INSN_VALUE(buf) (*(buf)) +#else + unsigned char buffer [CGEN_MAX_INSN_SIZE]; +#define INSN_VALUE(buf) (buf) +#endif + char * addr; + fragS * frag; + int num_fixups; + fixS * fixups [GAS_CGEN_MAX_FIXUPS]; + int indices [MAX_OPERAND_INSTANCES]; +} mep_insn; + +static int mode = CORE; /* Start in core mode. */ +static int pluspresent = 0; +static int allow_disabled_registers = 0; +static int library_flag = 0; + +/* We're going to need to store all of the instructions along with + their fixups so that we can parallelization grouping rules. */ + +static mep_insn saved_insns[MAX_SAVED_FIXUP_CHAINS]; +static int num_insns_saved = 0; + +const char comment_chars[] = "#"; +const char line_comment_chars[] = ";#"; +const char line_separator_chars[] = ";"; +const char EXP_CHARS[] = "eE"; +const char FLT_CHARS[] = "dD"; + +static void mep_switch_to_vliw_mode (int); +static void mep_switch_to_core_mode (int); +static void mep_s_vtext (int); +static void mep_noregerr (int); + +/* The target specific pseudo-ops which we support. */ +const pseudo_typeS md_pseudo_table[] = +{ + { "word", cons, 4 }, + { "file", (void (*) (int)) dwarf2_directive_file, 0 }, + { "loc", dwarf2_directive_loc, 0 }, + { "vliw", mep_switch_to_vliw_mode, 0 }, + { "core", mep_switch_to_core_mode, 0 }, + { "vtext", mep_s_vtext, 0 }, + { "noregerr", mep_noregerr, 0 }, + { NULL, NULL, 0 } +}; + +/* Relocations against symbols are done in two + parts, with a HI relocation and a LO relocation. Each relocation + has only 16 bits of space to store an addend. This means that in + order for the linker to handle carries correctly, it must be able + to locate both the HI and the LO relocation. This means that the + relocations must appear in order in the relocation table. + + In order to implement this, we keep track of each unmatched HI + relocation. We then sort them so that they immediately precede the + corresponding LO relocation. */ + +struct mep_hi_fixup +{ + struct mep_hi_fixup * next; /* Next HI fixup. */ + fixS * fixp; /* This fixup. */ + segT seg; /* The section this fixup is in. */ +}; + +/* The list of unmatched HI relocs. */ +static struct mep_hi_fixup * mep_hi_fixup_list; + + +#define OPTION_EB (OPTION_MD_BASE + 0) +#define OPTION_EL (OPTION_MD_BASE + 1) +#define OPTION_CONFIG (OPTION_MD_BASE + 2) +#define OPTION_AVERAGE (OPTION_MD_BASE + 3) +#define OPTION_NOAVERAGE (OPTION_MD_BASE + 4) +#define OPTION_MULT (OPTION_MD_BASE + 5) +#define OPTION_NOMULT (OPTION_MD_BASE + 6) +#define OPTION_DIV (OPTION_MD_BASE + 7) +#define OPTION_NODIV (OPTION_MD_BASE + 8) +#define OPTION_BITOPS (OPTION_MD_BASE + 9) +#define OPTION_NOBITOPS (OPTION_MD_BASE + 10) +#define OPTION_LEADZ (OPTION_MD_BASE + 11) +#define OPTION_NOLEADZ (OPTION_MD_BASE + 12) +#define OPTION_ABSDIFF (OPTION_MD_BASE + 13) +#define OPTION_NOABSDIFF (OPTION_MD_BASE + 14) +#define OPTION_MINMAX (OPTION_MD_BASE + 15) +#define OPTION_NOMINMAX (OPTION_MD_BASE + 16) +#define OPTION_CLIP (OPTION_MD_BASE + 17) +#define OPTION_NOCLIP (OPTION_MD_BASE + 18) +#define OPTION_SATUR (OPTION_MD_BASE + 19) +#define OPTION_NOSATUR (OPTION_MD_BASE + 20) +#define OPTION_COP32 (OPTION_MD_BASE + 21) +#define OPTION_REPEAT (OPTION_MD_BASE + 25) +#define OPTION_NOREPEAT (OPTION_MD_BASE + 26) +#define OPTION_DEBUG (OPTION_MD_BASE + 27) +#define OPTION_NODEBUG (OPTION_MD_BASE + 28) +#define OPTION_LIBRARY (OPTION_MD_BASE + 29) + +struct option md_longopts[] = { + { "EB", no_argument, NULL, OPTION_EB}, + { "EL", no_argument, NULL, OPTION_EL}, + { "mconfig", required_argument, NULL, OPTION_CONFIG}, + { "maverage", no_argument, NULL, OPTION_AVERAGE}, + { "mno-average", no_argument, NULL, OPTION_NOAVERAGE}, + { "mmult", no_argument, NULL, OPTION_MULT}, + { "mno-mult", no_argument, NULL, OPTION_NOMULT}, + { "mdiv", no_argument, NULL, OPTION_DIV}, + { "mno-div", no_argument, NULL, OPTION_NODIV}, + { "mbitops", no_argument, NULL, OPTION_BITOPS}, + { "mno-bitops", no_argument, NULL, OPTION_NOBITOPS}, + { "mleadz", no_argument, NULL, OPTION_LEADZ}, + { "mno-leadz", no_argument, NULL, OPTION_NOLEADZ}, + { "mabsdiff", no_argument, NULL, OPTION_ABSDIFF}, + { "mno-absdiff", no_argument, NULL, OPTION_NOABSDIFF}, + { "mminmax", no_argument, NULL, OPTION_MINMAX}, + { "mno-minmax", no_argument, NULL, OPTION_NOMINMAX}, + { "mclip", no_argument, NULL, OPTION_CLIP}, + { "mno-clip", no_argument, NULL, OPTION_NOCLIP}, + { "msatur", no_argument, NULL, OPTION_SATUR}, + { "mno-satur", no_argument, NULL, OPTION_NOSATUR}, + { "mcop32", no_argument, NULL, OPTION_COP32}, + { "mdebug", no_argument, NULL, OPTION_DEBUG}, + { "mno-debug", no_argument, NULL, OPTION_NODEBUG}, + { "mlibrary", no_argument, NULL, OPTION_LIBRARY}, + { NULL, 0, NULL, 0 } }; +size_t md_longopts_size = sizeof (md_longopts); + +const char * md_shortopts = ""; +static int optbits = 0; +static int optbitset = 0; + +int +md_parse_option (int c, char *arg ATTRIBUTE_UNUSED) +{ + int i, idx; + switch (c) + { + case OPTION_EB: + target_big_endian = 1; + break; + case OPTION_EL: + target_big_endian = 0; + break; + case OPTION_CONFIG: + idx = 0; + for (i=1; mep_config_map[i].name; i++) + if (strcmp (mep_config_map[i].name, arg) == 0) + { + idx = i; + break; + } + if (!idx) + { + fprintf (stderr, "Error: unknown configuration %s\n", arg); + return 0; + } + mep_config_index = idx; + target_big_endian = mep_config_map[idx].big_endian; + break; + case OPTION_AVERAGE: + optbits |= 1 << CGEN_INSN_OPTIONAL_AVE_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_AVE_INSN; + break; + case OPTION_NOAVERAGE: + optbits &= ~(1 << CGEN_INSN_OPTIONAL_AVE_INSN); + optbitset |= 1 << CGEN_INSN_OPTIONAL_AVE_INSN; + break; + case OPTION_MULT: + optbits |= 1 << CGEN_INSN_OPTIONAL_MUL_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_MUL_INSN; + break; + case OPTION_NOMULT: + optbits &= ~(1 << CGEN_INSN_OPTIONAL_MUL_INSN); + optbitset |= 1 << CGEN_INSN_OPTIONAL_MUL_INSN; + break; + case OPTION_DIV: + optbits |= 1 << CGEN_INSN_OPTIONAL_DIV_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_DIV_INSN; + break; + case OPTION_NODIV: + optbits &= ~(1 << CGEN_INSN_OPTIONAL_DIV_INSN); + optbitset |= 1 << CGEN_INSN_OPTIONAL_DIV_INSN; + break; + case OPTION_BITOPS: + optbits |= 1 << CGEN_INSN_OPTIONAL_BIT_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_BIT_INSN; + break; + case OPTION_NOBITOPS: + optbits &= ~(1 << CGEN_INSN_OPTIONAL_BIT_INSN); + optbitset |= 1 << CGEN_INSN_OPTIONAL_BIT_INSN; + break; + case OPTION_LEADZ: + optbits |= 1 << CGEN_INSN_OPTIONAL_LDZ_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_LDZ_INSN; + break; + case OPTION_NOLEADZ: + optbits &= ~(1 << CGEN_INSN_OPTIONAL_LDZ_INSN); + optbitset |= 1 << CGEN_INSN_OPTIONAL_LDZ_INSN; + break; + case OPTION_ABSDIFF: + optbits |= 1 << CGEN_INSN_OPTIONAL_ABS_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_ABS_INSN; + break; + case OPTION_NOABSDIFF: + optbits &= ~(1 << CGEN_INSN_OPTIONAL_ABS_INSN); + optbitset |= 1 << CGEN_INSN_OPTIONAL_ABS_INSN; + break; + case OPTION_MINMAX: + optbits |= 1 << CGEN_INSN_OPTIONAL_MINMAX_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_MINMAX_INSN; + break; + case OPTION_NOMINMAX: + optbits &= ~(1 << CGEN_INSN_OPTIONAL_MINMAX_INSN); + optbitset |= 1 << CGEN_INSN_OPTIONAL_MINMAX_INSN; + break; + case OPTION_CLIP: + optbits |= 1 << CGEN_INSN_OPTIONAL_CLIP_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_CLIP_INSN; + break; + case OPTION_NOCLIP: + optbits &= ~(1 << CGEN_INSN_OPTIONAL_CLIP_INSN); + optbitset |= 1 << CGEN_INSN_OPTIONAL_CLIP_INSN; + break; + case OPTION_SATUR: + optbits |= 1 << CGEN_INSN_OPTIONAL_SAT_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_SAT_INSN; + break; + case OPTION_NOSATUR: + optbits &= ~(1 << CGEN_INSN_OPTIONAL_SAT_INSN); + optbitset |= 1 << CGEN_INSN_OPTIONAL_SAT_INSN; + break; + case OPTION_COP32: + optbits |= 1 << CGEN_INSN_OPTIONAL_CP_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_CP_INSN; + break; + case OPTION_DEBUG: + optbits |= 1 << CGEN_INSN_OPTIONAL_DEBUG_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_DEBUG_INSN; + break; + case OPTION_NODEBUG: + optbits &= ~(1 << CGEN_INSN_OPTIONAL_DEBUG_INSN); + optbitset |= 1 << CGEN_INSN_OPTIONAL_DEBUG_INSN; + break; + case OPTION_LIBRARY: + library_flag = EF_MEP_LIBRARY; + break; + case OPTION_REPEAT: + case OPTION_NOREPEAT: + break; + default: + return 0; + } + return 1; +} + +void +md_show_usage (FILE *stream) +{ + fprintf (stream, _("MeP specific command line options:\n\ + -EB assemble for a big endian system (default)\n\ + -EL assemble for a little endian system\n\ + -mconfig= specify a chip configuration to use\n\ + -maverage -mno-average -mmult -mno-mult -mdiv -mno-div\n\ + -mbitops -mno-bitops -mleadz -mno-leadz -mabsdiff -mno-absdiff\n\ + -mminmax -mno-minmax -mclip -mno-clip -msatur -mno-satur -mcop32\n\ + enable/disable the given opcodes\n\ +\n\ + If -mconfig is given, the other -m options modify it. Otherwise,\n\ + if no -m options are given, all core opcodes are enabled;\n\ + if any enabling -m options are given, only those are enabled;\n\ + if only disabling -m options are given, only those are disabled.\n\ +")); + if (mep_config_map[1].name) + { + int i; + fprintf (stream, " -mconfig=STR specify the configuration to use\n"); + fprintf (stream, " Configurations:"); + for (i=0; mep_config_map[i].name; i++) + fprintf (stream, " %s", mep_config_map[i].name); + fprintf (stream, "\n"); + } +} + + + +static void +mep_check_for_disabled_registers (mep_insn *insn) +{ + static int initted = 0; + static int has_mul_div = 0; + static int has_cop = 0; + static int has_debug = 0; + unsigned int b, r; + + if (allow_disabled_registers) + return; + +#if !CGEN_INT_INSN_P + if (target_big_endian) + b = insn->buffer[0] * 256 + insn->buffer[1]; + else + b = insn->buffer[1] * 256 + insn->buffer[0]; +#else + b = insn->buffer[0]; +#endif + + if ((b & 0xfffff00e) == 0x7008 /* stc */ + || (b & 0xfffff00e) == 0x700a /* ldc */) + { + if (!initted) + { + initted = 1; + if ((MEP_OMASK & (1 << CGEN_INSN_OPTIONAL_MUL_INSN)) + || (MEP_OMASK & (1 << CGEN_INSN_OPTIONAL_DIV_INSN))) + has_mul_div = 1; + if (MEP_OMASK & (1 << CGEN_INSN_OPTIONAL_DEBUG_INSN)) + has_debug = 1; + if (MEP_OMASK & (1 << CGEN_INSN_OPTIONAL_CP_INSN)) + has_cop = 1; + } + + r = ((b & 0x00f0) >> 4) | ((b & 0x0001) << 4); + switch (r) + { + case 7: /* $hi */ + case 8: /* $lo */ + if (!has_mul_div) + as_bad ("$hi and $lo are disabled when MUL and DIV are off"); + break; + case 12: /* $mb0 */ + case 13: /* $me0 */ + case 14: /* $mb1 */ + case 15: /* $me1 */ + if (!has_cop) + as_bad ("$mb0, $me0, $mb1, and $me1 are disabled when COP is off"); + break; + case 24: /* $dbg */ + case 25: /* $depc */ + if (!has_debug) + as_bad ("$dbg and $depc are disabled when DEBUG is off"); + break; + } + } +} + +static int +mep_machine (void) +{ + switch (MEP_CPU) + { + default: break; + case EF_MEP_CPU_C2: return bfd_mach_mep; + case EF_MEP_CPU_C3: return bfd_mach_mep; + case EF_MEP_CPU_C4: return bfd_mach_mep; + case EF_MEP_CPU_H1: return bfd_mach_mep_h1; + } + + return bfd_mach_mep; +} + +/* The MeP version of the cgen parse_operand function. The only difference + from the standard version is that we want to avoid treating '$foo' and + '($foo...)' as references to a symbol called '$foo'. The chances are + that '$foo' is really a misspelt register. */ + +static const char * +mep_parse_operand (CGEN_CPU_DESC cd, enum cgen_parse_operand_type want, + const char **strP, int opindex, int opinfo, + enum cgen_parse_operand_result *resultP, bfd_vma *valueP) +{ + if (want == CGEN_PARSE_OPERAND_INTEGER || want == CGEN_PARSE_OPERAND_ADDRESS) + { + const char *next; + + next = *strP; + while (*next == '(') + next++; + if (*next == '$') + return "Not a valid literal"; + } + return gas_cgen_parse_operand (cd, want, strP, opindex, opinfo, + resultP, valueP); +} + +void +md_begin () +{ + /* Initialize the `cgen' interface. */ + + /* If the user specifies no options, we default to allowing + everything. If the user specifies any enabling options, we + default to allowing only what is specified. If the user + specifies only disabling options, we only disable what is + specified. If the user specifies options and a config, the + options modify the config. */ + if (optbits && mep_config_index == 0) + MEP_OMASK = optbits; + else + MEP_OMASK = (MEP_OMASK & ~optbitset) | optbits; + + /* Set the machine number and endian. */ + gas_cgen_cpu_desc = mep_cgen_cpu_open (CGEN_CPU_OPEN_MACHS, 0, + CGEN_CPU_OPEN_ENDIAN, + target_big_endian + ? CGEN_ENDIAN_BIG + : CGEN_ENDIAN_LITTLE, + CGEN_CPU_OPEN_ISAS, 0, + CGEN_CPU_OPEN_END); + mep_cgen_init_asm (gas_cgen_cpu_desc); + + /* This is a callback from cgen to gas to parse operands. */ + cgen_set_parse_operand_fn (gas_cgen_cpu_desc, mep_parse_operand); + + /* Identify the architecture. */ + bfd_default_set_arch_mach (stdoutput, bfd_arch_mep, mep_machine ()); + + /* Store the configuration number and core. */ + bfd_set_private_flags (stdoutput, MEP_CPU | MEP_CONFIG | library_flag); + + /* Initialize the array we'll be using to store fixups. */ + gas_cgen_initialize_saved_fixups_array(); +} + +/* Variant of mep_cgen_assemble_insn. Assemble insn STR of cpu CD as a + coprocessor instruction, if possible, into FIELDS, BUF, and INSN. */ + +static const CGEN_INSN * +mep_cgen_assemble_cop_insn (CGEN_CPU_DESC cd, + const char *str, + CGEN_FIELDS *fields, + CGEN_INSN_BYTES_PTR buf, + const struct cgen_insn *pinsn) +{ + const char *start; + CGEN_INSN_LIST *ilist; + const char *errmsg = NULL; + + /* The instructions are stored in hashed lists. */ + ilist = CGEN_ASM_LOOKUP_INSN (gas_cgen_cpu_desc, + CGEN_INSN_MNEMONIC (pinsn)); + + start = str; + for ( ; ilist != NULL ; ilist = CGEN_ASM_NEXT_INSN (ilist)) + { + const CGEN_INSN *insn = ilist->insn; + if (strcmp (CGEN_INSN_MNEMONIC (ilist->insn), + CGEN_INSN_MNEMONIC (pinsn)) == 0 + && MEP_INSN_COP_P (ilist->insn) + && mep_cgen_insn_supported (cd, insn)) + { + str = start; + + /* skip this insn if str doesn't look right lexically */ + if (CGEN_INSN_RX (insn) != NULL && + regexec ((regex_t *) CGEN_INSN_RX (insn), str, 0, NULL, 0) == REG_NOMATCH) + continue; + + /* Allow parse/insert handlers to obtain length of insn. */ + CGEN_FIELDS_BITSIZE (fields) = CGEN_INSN_BITSIZE (insn); + + errmsg = CGEN_PARSE_FN (cd, insn) (cd, insn, & str, fields); + if (errmsg != NULL) + continue; + + errmsg = CGEN_INSERT_FN (cd, insn) (cd, insn, fields, buf, + (bfd_vma) 0); + if (errmsg != NULL) + continue; + + return insn; + } + } + return pinsn; +} + +static void +mep_save_insn (mep_insn insn) +{ + /* Consider change MAX_SAVED_FIXUP_CHAINS to MAX_PARALLEL_INSNS. */ + if (num_insns_saved < 0 || num_insns_saved >= MAX_SAVED_FIXUP_CHAINS) + { + as_fatal("index into saved_insns[] out of bounds."); + return; + } + saved_insns[num_insns_saved] = insn; + gas_cgen_save_fixups(num_insns_saved); + num_insns_saved++; +} + +static void +mep_check_parallel32_scheduling (void) +{ + int insn0iscopro, insn1iscopro, insn0length, insn1length; + + /* More than two instructions means that either someone is referring to + an internally parallel core or an internally parallel coprocessor, + neither of which are supported at this time. */ + if ( num_insns_saved > 2 ) + as_fatal("Internally paralled cores and coprocessors not supported."); + + /* If there are no insns saved, that's ok. Just return. This will + happen when mep_process_saved_insns is called when the end of the + source file is reached and there are no insns left to be processed. */ + if (num_insns_saved == 0) + return; + + /* Check some of the attributes of the first insn. */ + insn0iscopro = MEP_INSN_COP_P (saved_insns[0].insn); + insn0length = CGEN_FIELDS_BITSIZE (& saved_insns[0].fields); + + if (num_insns_saved == 2) + { + /* Check some of the attributes of the first insn. */ + insn1iscopro = MEP_INSN_COP_P (saved_insns[1].insn); + insn1length = CGEN_FIELDS_BITSIZE (& saved_insns[1].fields); + + if ((insn0iscopro && !insn1iscopro) + || (insn1iscopro && !insn0iscopro)) + { + /* We have one core and one copro insn. If their sizes + add up to 32, then the combination is valid. */ + if (insn0length + insn1length == 32) + return; + else + as_bad ("core and copro insn lengths must total 32 bits."); + } + else + as_bad ("vliw group must consist of 1 core and 1 copro insn."); + } + else + { + /* If we arrive here, we have one saved instruction. There are a + number of possible cases: + + 1. The instruction is a 32 bit core or coprocessor insn and + can be executed by itself. Valid. + + 2. The instrucion is a core instruction for which a cop nop + exists. In this case, insert the cop nop into the saved + insn array after the core insn and return. Valid. + + 3. The instruction is a coprocessor insn for which a core nop + exists. In this case, move the coprocessor insn to the + second element of the array and put the nop in the first + element then return. Valid. + + 4. The instruction is a core or coprocessor instruction for + which there is no matching coprocessor or core nop to use + to form a valid vliw insn combination. In this case, we + we have to abort. */ + + if (insn0length > 32) + as_fatal ("Cannot use 48- or 64-bit insns with a 32 bit datapath."); + + if (insn0length == 32) + return; + + /* Insn is smaller than datapath. If there are no matching + nops for this insn, then terminate assembly. */ + if (CGEN_INSN_ATTR_VALUE (saved_insns[0].insn, + CGEN_INSN_VLIW32_NO_MATCHING_NOP)) + as_fatal ("No valid nop."); + + /* At this point we know that we have a single 16-bit insn that has + a matching nop. We have to assemble it and put it into the saved + insn and fixup chain arrays. */ + + if (insn0iscopro) + { + char *errmsg; + mep_insn insn; + + /* Move the insn and it's fixups to the second element of the + saved insns arrary and insert a 16 bit core nope into the + first element. */ + insn.insn = mep_cgen_assemble_insn (gas_cgen_cpu_desc, "nop", + &insn.fields, insn.buffer, + &errmsg); + if (!insn.insn) + { + as_bad ("%s", errmsg); + return; + } + + /* Move the insn in element 0 to element 1 and insert the + nop into element 0. Move the fixups in element 0 to + element 1 and save the current fixups to element 0. + Really there aren't any fixups at this point because we're + inserting a nop but we might as well be general so that + if there's ever a need to insert a general insn, we'll + have an example. */ + saved_insns[1] = saved_insns[0]; + saved_insns[0] = insn; + num_insns_saved++; + gas_cgen_swap_fixups (0); + gas_cgen_save_fixups (1); + } + else + { + char * errmsg; + mep_insn insn; + int insn_num = saved_insns[0].insn->base->num; + + /* Use 32 bit branches and skip the nop. */ + if (insn_num == MEP_INSN_BSR12 + || insn_num == MEP_INSN_BEQZ + || insn_num == MEP_INSN_BNEZ) + return; + + /* Insert a 16-bit coprocessor nop. Note that at the time */ + /* this was done, no 16-bit coprocessor nop was defined. */ + insn.insn = mep_cgen_assemble_insn (gas_cgen_cpu_desc, "cpnop16", + &insn.fields, insn.buffer, + &errmsg); + if (!insn.insn) + { + as_bad ("%s", errmsg); + return; + } + + /* Now put the insn and fixups into the arrays. */ + mep_save_insn (insn); + } + } +} + +static void +mep_check_parallel64_scheduling (void) +{ + int insn0iscopro, insn1iscopro, insn0length, insn1length; + + /* More than two instructions means that someone is referring to an + internally parallel core or an internally parallel coprocessor. */ + /* These are not currently supported. */ + if (num_insns_saved > 2) + as_fatal ("Internally parallel cores of coprocessors not supported."); + + /* If there are no insns saved, that's ok. Just return. This will + happen when mep_process_saved_insns is called when the end of the + source file is reached and there are no insns left to be processed. */ + if (num_insns_saved == 0) + return; + + /* Check some of the attributes of the first insn. */ + insn0iscopro = MEP_INSN_COP_P (saved_insns[0].insn); + insn0length = CGEN_FIELDS_BITSIZE (& saved_insns[0].fields); + + if (num_insns_saved == 2) + { + /* Check some of the attributes of the first insn. */ + insn1iscopro = MEP_INSN_COP_P (saved_insns[1].insn); + insn1length = CGEN_FIELDS_BITSIZE (& saved_insns[1].fields); + + if ((insn0iscopro && !insn1iscopro) + || (insn1iscopro && !insn0iscopro)) + { + /* We have one core and one copro insn. If their sizes + add up to 64, then the combination is valid. */ + if (insn0length + insn1length == 64) + return; + else + as_bad ("core and copro insn lengths must total 64 bits."); + } + else + as_bad ("vliw group must consist of 1 core and 1 copro insn."); + } + else + { + /* If we arrive here, we have one saved instruction. There are a + number of possible cases: + + 1. The instruction is a 64 bit coprocessor insn and can be + executed by itself. Valid. + + 2. The instrucion is a core instruction for which a cop nop + exists. In this case, insert the cop nop into the saved + insn array after the core insn and return. Valid. + + 3. The instruction is a coprocessor insn for which a core nop + exists. In this case, move the coprocessor insn to the + second element of the array and put the nop in the first + element then return. Valid. + + 4. The instruction is a core or coprocessor instruction for + which there is no matching coprocessor or core nop to use + to form a valid vliw insn combination. In this case, we + we have to abort. */ + + /* If the insn is 64 bits long, it can run alone. The size check + is done indepependantly of whether the insn is core or copro + in case 64 bit coprocessor insns are added later. */ + if (insn0length == 64) + return; + + /* Insn is smaller than datapath. If there are no matching + nops for this insn, then terminate assembly. */ + if (CGEN_INSN_ATTR_VALUE (saved_insns[0].insn, + CGEN_INSN_VLIW64_NO_MATCHING_NOP)) + as_fatal ("No valid nop."); + + if (insn0iscopro) + { + char *errmsg; + mep_insn insn; + int i; + + /* Initialize the insn buffer. */ + for (i = 0; i < 64; i++) + insn.buffer[i] = '\0'; + + /* We have a coprocessor insn. At this point in time there + are is 32-bit core nop. There is only a 16-bit core + nop. The idea is to allow for a relatively arbitrary + coprocessor to be specified. We aren't looking at + trying to cover future changes in the core at this time + since it is assumed that the core will remain fairly + static. If there ever are 32 or 48 bit core nops added, + they will require entries below. */ + + if (insn0length == 48) + { + /* Move the insn and fixups to the second element of the + arrays then assemble and insert a 16 bit core nop. */ + insn.insn = mep_cgen_assemble_insn (gas_cgen_cpu_desc, "nop", + & insn.fields, insn.buffer, + & errmsg); + } + else + { + /* If this is reached, then we have a single coprocessor + insn that is not 48 bits long, but for which the assembler + thinks there is a matching core nop. If a 32-bit core + nop has been added, then make the necessary changes and + handle its assembly and insertion here. Otherwise, + go figure out why either: + + 1. The assembler thinks that there is a 32-bit core nop + to match a 32-bit coprocessor insn, or + 2. The assembler thinks that there is a 48-bit core nop + to match a 16-bit coprocessor insn. */ + + as_fatal ("Assembler expects a non-existent core nop."); + } + + if (!insn.insn) + { + as_bad ("%s", errmsg); + return; + } + + /* Move the insn in element 0 to element 1 and insert the + nop into element 0. Move the fixups in element 0 to + element 1 and save the current fixups to element 0. + Really there aren't any fixups at this point because we're + inserting a nop but we might as well be general so that + if there's ever a need to insert a general insn, we'll + have an example. */ + + saved_insns[1] = saved_insns[0]; + saved_insns[0] = insn; + num_insns_saved++; + gas_cgen_swap_fixups(0); + gas_cgen_save_fixups(1); + + } + else + { + char * errmsg; + mep_insn insn; + int i; + + /* Initialize the insn buffer */ + for (i = 0; i < 64; i++) + insn.buffer[i] = '\0'; + + /* We have a core insn. We have to handle all possible nop + lengths. If a coprocessor doesn't have a nop of a certain + length but there exists core insns that when combined with + a nop of that length would fill the datapath, those core + insns will be flagged with the VLIW_NO_CORRESPONDING_NOP + attribute. That will ensure that when used in a way that + requires a nop to be inserted, assembly will terminate + before reaching this section of code. This guarantees + that cases below which would result in the attempted + insertion of nop that doesn't exist will never be entered. */ + if (insn0length == 16) + { + /* Insert 48 bit coprocessor nop. */ + /* Assemble it and put it into the arrays. */ + insn.insn = mep_cgen_assemble_insn (gas_cgen_cpu_desc, "cpnop48", + &insn.fields, insn.buffer, + &errmsg); + } + else if (insn0length == 32) + { + /* Insert 32 bit coprocessor nop. */ + insn.insn = mep_cgen_assemble_insn (gas_cgen_cpu_desc, "cpnop32", + &insn.fields, insn.buffer, + &errmsg); + } + else if (insn0length == 48) + { + /* Insert 16 bit coprocessor nop. */ + insn.insn = mep_cgen_assemble_insn (gas_cgen_cpu_desc, "cpnop16", + &insn.fields, insn.buffer, + &errmsg); + } + else + /* Core insn has an invalid length. Something has gone wrong. */ + as_fatal ("Core insn has invalid length! Something is wrong!"); + + if (!insn.insn) + { + as_bad ("%s", errmsg); + return; + } + + /* Now put the insn and fixups into the arrays. */ + mep_save_insn (insn); + } + } +} + +/* The scheduling functions are just filters for invalid combinations. + If there is a violation, they terminate assembly. Otherise they + just fall through. Succesful combinations cause no side effects + other than valid nop insertion. */ + +static void +mep_check_parallel_scheduling (void) +{ + /* This is where we will eventually read the config information + and choose which scheduling checking function to call. */ + if (MEP_VLIW64) + mep_check_parallel64_scheduling (); + else + mep_check_parallel32_scheduling (); +} + +static void +mep_process_saved_insns (void) +{ + int i; + + gas_cgen_save_fixups (MAX_SAVED_FIXUP_CHAINS - 1); + + /* We have to check for valid scheduling here. */ + mep_check_parallel_scheduling (); + + /* If the last call didn't cause assembly to terminate, we have + a valid vliw insn/insn pair saved. Restore this instructions' + fixups and process the insns. */ + for (i = 0;iisas = isas; + + if (mode == VLIW) + { + /* VLIW mode. */ + + int thisInsnIsCopro = 0; + mep_insn insn; + int i; + + /* Initialize the insn buffer */ + + if (! CGEN_INT_INSN_P) + for (i=0; i < CGEN_MAX_INSN_SIZE; i++) + insn.buffer[i]='\0'; + + /* Can't tell core / copro insns apart at parse time! */ + cgen_bitset_union (isas, & MEP_COP_ISA, isas); + + /* Assemble the insn so we can examine its attributes. */ + insn.insn = mep_cgen_assemble_insn (gas_cgen_cpu_desc, str, + &insn.fields, insn.buffer, + &errmsg); + if (!insn.insn) + { + as_bad ("%s", errmsg); + return; + } + mep_check_for_disabled_registers (&insn); + + /* Check to see if it's a coprocessor instruction. */ + thisInsnIsCopro = MEP_INSN_COP_P (insn.insn); + + if (!thisInsnIsCopro) + { + insn.insn = mep_cgen_assemble_cop_insn (gas_cgen_cpu_desc, str, + &insn.fields, insn.buffer, + insn.insn); + thisInsnIsCopro = MEP_INSN_COP_P (insn.insn); + mep_check_for_disabled_registers (&insn); + } + + if (pluspresent) + { + /* A plus was present. */ + /* Check for a + with a core insn and abort if found. */ + if (!thisInsnIsCopro) + { + as_fatal("A core insn cannot be preceeded by a +.\n"); + return; + } + + if (num_insns_saved > 0) + { + /* There are insns in the queue. Add this one. */ + mep_save_insn (insn); + } + else + { + /* There are no insns in the queue and a plus is present. + This is a syntax error. Let's not tolerate this. + We can relax this later if necessary. */ + as_bad (_("Invalid use of parallelization operator.")); + return; + } + } + else + { + /* No plus was present. */ + if (num_insns_saved > 0) + { + /* There are insns saved and we came across an insn without a + leading +. That's the signal to process the saved insns + before proceeding then treat the current insn as the first + in a new vliw group. */ + mep_process_saved_insns (); + num_insns_saved = 0; + /* mep_save_insn (insn); */ + } + mep_save_insn (insn); +#if 0 + else + { + + /* Core Insn. Add it to the beginning of the queue. */ + mep_save_insn (insn); + /* gas_cgen_save_fixups(num_insns_saved); */ + } +#endif + } + + pluspresent = 0; + } + else + { + /* Core mode. */ + + /* Only single instructions are assembled in core mode. */ + mep_insn insn; + + /* If a leading '+' was present, issue an error. + That's not allowed in core mode. */ + if (pluspresent) + { + as_bad (_("Leading plus sign not allowed in core mode")); + return; + } + + insn.insn = mep_cgen_assemble_insn + (gas_cgen_cpu_desc, str, & insn.fields, insn.buffer, & errmsg); + + if (!insn.insn) + { + as_bad ("%s", errmsg); + return; + } + gas_cgen_finish_insn (insn.insn, insn.buffer, + CGEN_FIELDS_BITSIZE (& insn.fields), 1, NULL); + mep_check_for_disabled_registers (&insn); + } +} + +valueT +md_section_align (segT segment, valueT size) +{ + int align = bfd_get_section_alignment (stdoutput, segment); + return ((size + (1 << align) - 1) & (-1 << align)); +} + + +symbolS * +md_undefined_symbol (char *name ATTRIBUTE_UNUSED) +{ + return 0; +} + +/* Interface to relax_segment. */ + + +const relax_typeS md_relax_table[] = +{ + /* The fields are: + 1) most positive reach of this state, + 2) most negative reach of this state, + 3) how many bytes this mode will have in the variable part of the frag + 4) which index into the table to try if we can't fit into this one. */ + /* Note that we use "beq" because "jmp" has a peculiarity - it cannot + jump to addresses with any bits 27..24 set. So, we use beq as a + 17-bit pc-relative branch to avoid using jmp, just in case. */ + + /* 0 */ { 0, 0, 0, 0 }, /* unused */ + /* 1 */ { 0, 0, 0, 0 }, /* marker for "don't know yet" */ + + /* 2 */ { 2047, -2048, 0, 3 }, /* bsr12 */ + /* 3 */ { 0, 0, 2, 0 }, /* bsr16 */ + + /* 4 */ { 2047, -2048, 0, 5 }, /* bra */ + /* 5 */ { 65535, -65536, 2, 6 }, /* beq $0,$0 */ + /* 6 */ { 0, 0, 2, 0 }, /* jmp24 */ + + /* 7 */ { 65535, -65536, 0, 8 }, /* beqi */ + /* 8 */ { 0, 0, 4, 0 }, /* bnei/jmp */ + + /* 9 */ { 127, -128, 0, 10 }, /* beqz */ + /* 10 */ { 65535, -65536, 2, 11 }, /* beqi */ + /* 11 */ { 0, 0, 4, 0 }, /* bnei/jmp */ + + /* 12 */ { 65535, -65536, 0, 13 }, /* bnei */ + /* 13 */ { 0, 0, 4, 0 }, /* beqi/jmp */ + + /* 14 */ { 127, -128, 0, 15 }, /* bnez */ + /* 15 */ { 65535, -65536, 2, 16 }, /* bnei */ + /* 16 */ { 0, 0, 4, 0 }, /* beqi/jmp */ + + /* 17 */ { 65535, -65536, 0, 13 }, /* bgei */ + /* 18 */ { 0, 0, 4, 0 }, + /* 19 */ { 65535, -65536, 0, 13 }, /* blti */ + /* 20 */ { 0, 0, 4, 0 }, + /* 19 */ { 65535, -65536, 0, 13 }, /* bcpeq */ + /* 20 */ { 0, 0, 4, 0 }, + /* 19 */ { 65535, -65536, 0, 13 }, /* bcpne */ + /* 20 */ { 0, 0, 4, 0 }, + /* 19 */ { 65535, -65536, 0, 13 }, /* bcpat */ + /* 20 */ { 0, 0, 4, 0 }, + /* 19 */ { 65535, -65536, 0, 13 }, /* bcpaf */ + /* 20 */ { 0, 0, 4, 0 } +}; + +/* Pseudo-values for 64 bit "insns" which are combinations of two 32 + bit insns. */ +typedef enum { + MEP_PSEUDO64_NONE, + MEP_PSEUDO64_16BITCC, + MEP_PSEUDO64_32BITCC, +} MepPseudo64Values; + +static struct { + int insn; + int growth; + int insn_for_extern; +} subtype_mappings[] = { + { 0, 0, 0 }, + { 0, 0, 0 }, + { MEP_INSN_BSR12, 0, MEP_INSN_BSR24 }, + { MEP_INSN_BSR24, 2, MEP_INSN_BSR24 }, + { MEP_INSN_BRA, 0, MEP_INSN_BRA }, + { MEP_INSN_BEQ, 2, MEP_INSN_BEQ }, + { MEP_INSN_JMP, 2, MEP_INSN_JMP }, + { MEP_INSN_BEQI, 0, MEP_INSN_BEQI }, + { -1, 4, MEP_PSEUDO64_32BITCC }, + { MEP_INSN_BEQZ, 0, MEP_INSN_BEQZ }, + { MEP_INSN_BEQI, 2, MEP_INSN_BEQI }, + { -1, 4, MEP_PSEUDO64_16BITCC }, + { MEP_INSN_BNEI, 0, MEP_INSN_BNEI }, + { -1, 4, MEP_PSEUDO64_32BITCC }, + { MEP_INSN_BNEZ, 0, MEP_INSN_BNEZ }, + { MEP_INSN_BNEI, 2, MEP_INSN_BNEI }, + { -1, 4, MEP_PSEUDO64_16BITCC }, + { MEP_INSN_BGEI, 0, MEP_INSN_BGEI }, + { -1, 4, MEP_PSEUDO64_32BITCC }, + { MEP_INSN_BLTI, 0, MEP_INSN_BLTI }, + { -1, 4, MEP_PSEUDO64_32BITCC }, + { MEP_INSN_BCPEQ, 0, MEP_INSN_BCPEQ }, + { -1, 4, MEP_PSEUDO64_32BITCC }, + { MEP_INSN_BCPNE, 0, MEP_INSN_BCPNE }, + { -1, 4, MEP_PSEUDO64_32BITCC }, + { MEP_INSN_BCPAT, 0, MEP_INSN_BCPAT }, + { -1, 4, MEP_PSEUDO64_32BITCC }, + { MEP_INSN_BCPAF, 0, MEP_INSN_BCPAF }, + { -1, 4, MEP_PSEUDO64_32BITCC } +}; +#define NUM_MAPPINGS (sizeof (subtype_mappings) / sizeof (subtype_mappings[0])) + +void +mep_prepare_relax_scan (fragS *fragP, offsetT *aim, relax_substateT this_state) +{ + symbolS *symbolP = fragP->fr_symbol; + if (symbolP && !S_IS_DEFINED (symbolP)) + *aim = 0; + /* Adjust for MeP pcrel not being relative to the next opcode. */ + *aim += 2 + md_relax_table[this_state].rlx_length; +} + +static int +insn_to_subtype (int insn) +{ + unsigned int i; + for (i=0; ifr_subtype == 1) + fragP->fr_subtype = insn_to_subtype (fragP->fr_cgen.insn->base->num); + + if (S_GET_SEGMENT (fragP->fr_symbol) != segment) + { + int new_insn; + + new_insn = subtype_mappings[fragP->fr_subtype].insn_for_extern; + fragP->fr_subtype = insn_to_subtype (new_insn); + } + + if (MEP_VLIW && ! MEP_VLIW64 + && (bfd_get_section_flags (stdoutput, segment) & SEC_MEP_VLIW)) + { + /* Use 32 bit branches for vliw32 so the vliw word is not split. */ + switch (fragP->fr_cgen.insn->base->num) + { + case MEP_INSN_BSR12: + fragP->fr_subtype = insn_to_subtype + (subtype_mappings[fragP->fr_subtype].insn_for_extern); + break; + case MEP_INSN_BEQZ: + fragP->fr_subtype ++; + break; + case MEP_INSN_BNEZ: + fragP->fr_subtype ++; + break; + } + } + + if (fragP->fr_cgen.insn->base + && fragP->fr_cgen.insn->base->num + != subtype_mappings[fragP->fr_subtype].insn) + { + int new_insn= subtype_mappings[fragP->fr_subtype].insn; + if (new_insn != -1) + { + fragP->fr_cgen.insn = (fragP->fr_cgen.insn + - fragP->fr_cgen.insn->base->num + + new_insn); + } + } + + return subtype_mappings[fragP->fr_subtype].growth; +} + +/* *fragP has been relaxed to its final size, and now needs to have + the bytes inside it modified to conform to the new size. + + Called after relaxation is finished. + fragP->fr_type == rs_machine_dependent. + fragP->fr_subtype is the subtype of what the address relaxed to. */ + +static int +target_address_for (fragS *frag) +{ + int rv = frag->fr_offset; + symbolS *sym = frag->fr_symbol; + + if (sym) + rv += S_GET_VALUE (sym); + + return rv; +} + +void +md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, + segT sec ATTRIBUTE_UNUSED, + fragS *fragP) +{ + int addend, rn, bit = 0; + int operand; + int where = fragP->fr_opcode - fragP->fr_literal; + int e = target_big_endian ? 0 : 1; + + addend = target_address_for (fragP) - (fragP->fr_address + where); + + if (subtype_mappings[fragP->fr_subtype].insn == -1) + { + fragP->fr_fix += subtype_mappings[fragP->fr_subtype].growth; + switch (subtype_mappings[fragP->fr_subtype].insn_for_extern) + { + case MEP_PSEUDO64_16BITCC: + fragP->fr_opcode[1^e] = ((fragP->fr_opcode[1^e] & 1) ^ 1) | 0x06; + fragP->fr_opcode[2^e] = 0xd8; + fragP->fr_opcode[3^e] = 0x08; + fragP->fr_opcode[4^e] = 0; + fragP->fr_opcode[5^e] = 0; + where += 2; + break; + case MEP_PSEUDO64_32BITCC: + if (fragP->fr_opcode[0^e] & 0x10) + fragP->fr_opcode[1^e] ^= 0x01; + else + fragP->fr_opcode[1^e] ^= 0x04; + fragP->fr_opcode[2^e] = 0; + fragP->fr_opcode[3^e] = 4; + fragP->fr_opcode[4^e] = 0xd8; + fragP->fr_opcode[5^e] = 0x08; + fragP->fr_opcode[6^e] = 0; + fragP->fr_opcode[7^e] = 0; + where += 4; + break; + default: + abort (); + } + fragP->fr_cgen.insn = (fragP->fr_cgen.insn + - fragP->fr_cgen.insn->base->num + + MEP_INSN_JMP); + operand = MEP_OPERAND_PCABS24A2; + } + else + switch (fragP->fr_cgen.insn->base->num) + { + case MEP_INSN_BSR12: + fragP->fr_opcode[0^e] = 0xb0 | ((addend >> 8) & 0x0f); + fragP->fr_opcode[1^e] = 0x01 | (addend & 0xfe); + operand = MEP_OPERAND_PCREL12A2; + break; + + case MEP_INSN_BSR24: + fragP->fr_fix += 2; + fragP->fr_opcode[0^e] = 0xd8 | ((addend >> 5) & 0x07); + fragP->fr_opcode[1^e] = 0x09 | ((addend << 3) & 0xf0); + fragP->fr_opcode[2^e] = 0x00 | ((addend >>16) & 0xff); + fragP->fr_opcode[3^e] = 0x00 | ((addend >> 8) & 0xff); + operand = MEP_OPERAND_PCREL24A2; + break; + + case MEP_INSN_BRA: + fragP->fr_opcode[0^e] = 0xb0 | ((addend >> 8) & 0x0f); + fragP->fr_opcode[1^e] = 0x00 | (addend & 0xfe); + operand = MEP_OPERAND_PCREL12A2; + break; + + case MEP_INSN_BEQ: + /* The default relax_frag doesn't change the state if there is no + growth, so we must manually handle converting out-of-range BEQ + instructions to JMP. */ + if (addend <= 65535 && addend >= -65536) + { + fragP->fr_fix += 2; + fragP->fr_opcode[0^e] = 0xe0; + fragP->fr_opcode[1^e] = 0x01; + fragP->fr_opcode[2^e] = 0x00 | ((addend >> 9) & 0xff); + fragP->fr_opcode[3^e] = 0x00 | ((addend >> 1) & 0xff); + operand = MEP_OPERAND_PCREL17A2; + break; + } + /* ...FALLTHROUGH... */ + + case MEP_INSN_JMP: + addend = target_address_for (fragP); + fragP->fr_fix += 2; + fragP->fr_opcode[0^e] = 0xd8 | ((addend >> 5) & 0x07); + fragP->fr_opcode[1^e] = 0x08 | ((addend << 3) & 0xf0); + fragP->fr_opcode[2^e] = 0x00 | ((addend >>16) & 0xff); + fragP->fr_opcode[3^e] = 0x00 | ((addend >> 8) & 0xff); + operand = MEP_OPERAND_PCABS24A2; + break; + + case MEP_INSN_BNEZ: + bit = 1; + case MEP_INSN_BEQZ: + fragP->fr_opcode[1^e] = bit | (addend & 0xfe); + operand = MEP_OPERAND_PCREL8A2; + break; + + case MEP_INSN_BNEI: + bit = 4; + case MEP_INSN_BEQI: + if (subtype_mappings[fragP->fr_subtype].growth) + { + fragP->fr_fix += subtype_mappings[fragP->fr_subtype].growth; + rn = fragP->fr_opcode[0^e] & 0x0f; + fragP->fr_opcode[0^e] = 0xe0 | rn; + fragP->fr_opcode[1^e] = bit; + } + fragP->fr_opcode[2^e] = 0x00 | ((addend >> 9) & 0xff); + fragP->fr_opcode[3^e] = 0x00 | ((addend >> 1) & 0xff); + operand = MEP_OPERAND_PCREL17A2; + break; + + case MEP_INSN_BLTI: + case MEP_INSN_BGEI: + case MEP_INSN_BCPEQ: + case MEP_INSN_BCPNE: + case MEP_INSN_BCPAT: + case MEP_INSN_BCPAF: + /* No opcode change needed, just operand. */ + fragP->fr_opcode[2^e] = (addend >> 9) & 0xff; + fragP->fr_opcode[3^e] = (addend >> 1) & 0xff; + operand = MEP_OPERAND_PCREL17A2; + break; + + default: + abort (); + } + + if (S_GET_SEGMENT (fragP->fr_symbol) != sec + || operand == MEP_OPERAND_PCABS24A2) + { + assert (fragP->fr_cgen.insn != 0); + gas_cgen_record_fixup (fragP, + where, + fragP->fr_cgen.insn, + (fragP->fr_fix - where) * 8, + cgen_operand_lookup_by_num (gas_cgen_cpu_desc, + operand), + fragP->fr_cgen.opinfo, + fragP->fr_symbol, fragP->fr_offset); + } +} + + +/* Functions concerning relocs. */ + +void +mep_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) +{ + /* If we already know the fixup value, adjust it in the same + way that the linker would have done. */ + if (fixP->fx_addsy == 0) + switch (fixP->fx_cgen.opinfo) + { + case BFD_RELOC_MEP_LOW16: + *valP = ((long)(*valP & 0xffff)) << 16 >> 16; + break; + case BFD_RELOC_MEP_HI16U: + *valP >>= 16; + break; + case BFD_RELOC_MEP_HI16S: + *valP = (*valP + 0x8000) >> 16; + break; + } + + /* Now call cgen's md_aply_fix. */ + gas_cgen_md_apply_fix (fixP, valP, seg); +} + +long +md_pcrel_from_section (fixS *fixP, segT sec) +{ + if (fixP->fx_addsy != (symbolS *) NULL + && (! S_IS_DEFINED (fixP->fx_addsy) + || S_GET_SEGMENT (fixP->fx_addsy) != sec)) + /* The symbol is undefined (or is defined but not in this section). + Let the linker figure it out. */ + return 0; + + /* Return the address of the opcode - cgen adjusts for opcode size + itself, to be consistent with the disassembler, which must do + so. */ + return fixP->fx_where + fixP->fx_frag->fr_address; +} + +/* Return the bfd reloc type for OPERAND of INSN at fixup FIXP. + Returns BFD_RELOC_NONE if no reloc type can be found. + *FIXP may be modified if desired. */ + +#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) +#define MAP(n) case MEP_OPERAND_##n: return BFD_RELOC_MEP_##n; +#else +#define MAP(n) case MEP_OPERAND_/**/n: return BFD_RELOC_MEP_/**/n; +#endif + +bfd_reloc_code_real_type +md_cgen_lookup_reloc (const CGEN_INSN *insn ATTRIBUTE_UNUSED, + const CGEN_OPERAND *operand, + fixS *fixP) +{ + enum bfd_reloc_code_real reloc = fixP->fx_cgen.opinfo; + static char printed[MEP_OPERAND_MAX] = { 0 }; + + /* If there's a reloc here, it's because the parser saw a %foo() and + is giving us the correct reloc to use, or because we converted to + a different size reloc below and want to avoid "converting" more + than once. */ + if (reloc && reloc != BFD_RELOC_NONE) + return reloc; + + switch (operand->type) + { + MAP (PCREL8A2); /* beqz */ + MAP (PCREL12A2); /* bsr16 */ + MAP (PCREL17A2); /* beqi */ + MAP (PCREL24A2); /* bsr24 */ + MAP (PCABS24A2); /* jmp */ + MAP (UIMM24); /* mov */ + MAP (ADDR24A4); /* sw/lw */ + + /* The rest of the relocs should be generated by the parser, + for things such as %tprel(), etc. */ + case MEP_OPERAND_SIMM16: +#ifdef OBJ_COMPLEX_RELC + /* coalescing this into RELOC_MEP_16 is actually a bug, + since it's a signed operand. let the relc code handle it. */ + return BFD_RELOC_RELC; +#endif + + case MEP_OPERAND_UIMM16: + case MEP_OPERAND_SDISP16: + case MEP_OPERAND_CODE16: + fixP->fx_where += 2; + /* to avoid doing the above add twice */ + fixP->fx_cgen.opinfo = BFD_RELOC_MEP_16; + return BFD_RELOC_MEP_16; + + default: +#ifdef OBJ_COMPLEX_RELC + /* this is not an error, yet. + pass it to the linker. */ + return BFD_RELOC_RELC; +#endif + if (printed[operand->type]) + return BFD_RELOC_NONE; + printed[operand->type] = 1; + + as_bad_where (fixP->fx_file, fixP->fx_line, + _("Don't know how to relocate plain operands of type %s"), + operand->name); + + /* Print some helpful hints for the user. */ + switch (operand->type) + { + case MEP_OPERAND_UDISP7: + case MEP_OPERAND_UDISP7A2: + case MEP_OPERAND_UDISP7A4: + as_bad_where (fixP->fx_file, fixP->fx_line, + _("Perhaps you are missing %%tpoff()?")); + break; + default: + break; + } + return BFD_RELOC_NONE; + } +} + +/* Called while parsing an instruction to create a fixup. + We need to check for HI16 relocs and queue them up for later sorting. */ + +fixS * +mep_cgen_record_fixup_exp (fragS *frag, + int where, + const CGEN_INSN *insn, + int length, + const CGEN_OPERAND *operand, + int opinfo, + expressionS *exp) +{ + fixS * fixP = gas_cgen_record_fixup_exp (frag, where, insn, length, + operand, opinfo, exp); + return fixP; +} + +/* Return BFD reloc type from opinfo field in a fixS. + It's tricky using fx_r_type in mep_frob_file because the values + are BFD_RELOC_UNUSED + operand number. */ +#define FX_OPINFO_R_TYPE(f) ((f)->fx_cgen.opinfo) + +/* Sort any unmatched HI16 relocs so that they immediately precede + the corresponding LO16 reloc. This is called before md_apply_fix and + tc_gen_reloc. */ + +void +mep_frob_file () +{ + struct mep_hi_fixup * l; + + for (l = mep_hi_fixup_list; l != NULL; l = l->next) + { + segment_info_type * seginfo; + int pass; + + assert (FX_OPINFO_R_TYPE (l->fixp) == BFD_RELOC_HI16 + || FX_OPINFO_R_TYPE (l->fixp) == BFD_RELOC_LO16); + + /* Check quickly whether the next fixup happens to be a matching low. */ + if (l->fixp->fx_next != NULL + && FX_OPINFO_R_TYPE (l->fixp->fx_next) == BFD_RELOC_LO16 + && l->fixp->fx_addsy == l->fixp->fx_next->fx_addsy + && l->fixp->fx_offset == l->fixp->fx_next->fx_offset) + continue; + + /* Look through the fixups for this segment for a matching + `low'. When we find one, move the high just in front of it. + We do this in two passes. In the first pass, we try to find + a unique `low'. In the second pass, we permit multiple + high's relocs for a single `low'. */ + seginfo = seg_info (l->seg); + for (pass = 0; pass < 2; pass++) + { + fixS * f; + fixS * prev; + + prev = NULL; + for (f = seginfo->fix_root; f != NULL; f = f->fx_next) + { + /* Check whether this is a `low' fixup which matches l->fixp. */ + if (FX_OPINFO_R_TYPE (f) == BFD_RELOC_LO16 + && f->fx_addsy == l->fixp->fx_addsy + && f->fx_offset == l->fixp->fx_offset + && (pass == 1 + || prev == NULL + || (FX_OPINFO_R_TYPE (prev) != BFD_RELOC_HI16) + || prev->fx_addsy != f->fx_addsy + || prev->fx_offset != f->fx_offset)) + { + fixS ** pf; + + /* Move l->fixp before f. */ + for (pf = &seginfo->fix_root; + * pf != l->fixp; + pf = & (* pf)->fx_next) + assert (* pf != NULL); + + * pf = l->fixp->fx_next; + + l->fixp->fx_next = f; + if (prev == NULL) + seginfo->fix_root = l->fixp; + else + prev->fx_next = l->fixp; + + break; + } + + prev = f; + } + + if (f != NULL) + break; + + if (pass == 1) + as_warn_where (l->fixp->fx_file, l->fixp->fx_line, + _("Unmatched high relocation")); + } + } +} + +/* See whether we need to force a relocation into the output file. */ + +int +mep_force_relocation (fixS *fixp) +{ + if ( fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT + || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY) + return 1; + + /* Allow branches to global symbols to be resolved at assembly time. + This is consistent with way relaxable branches are handled, since + branches to both global and local symbols are relaxed. It also + corresponds to the assumptions made in md_pcrel_from_section. */ + return S_FORCE_RELOC (fixp->fx_addsy, !fixp->fx_pcrel); +} + +/* Write a value out to the object file, using the appropriate endianness. */ + +void +md_number_to_chars (char *buf, valueT val, int n) +{ + if (target_big_endian) + number_to_chars_bigendian (buf, val, n); + else + number_to_chars_littleendian (buf, val, n); +} + +/* Turn a string in input_line_pointer into a floating point constant + of type type, and store the appropriate bytes in *litP. The number + of LITTLENUMS emitted is stored in *sizeP . An error message is + returned, or NULL on OK. */ + +/* Equal to MAX_PRECISION in atof-ieee.c */ +#define MAX_LITTLENUMS 6 + +char * +md_atof (int type, char *litP, int *sizeP) +{ + int i; + int prec; + LITTLENUM_TYPE words [MAX_LITTLENUMS]; + char * t; + + switch (type) + { + case 'f': + case 'F': + case 's': + case 'S': + prec = 2; + break; + + case 'd': + case 'D': + case 'r': + case 'R': + prec = 4; + break; + + /* FIXME: Some targets allow other format chars for bigger sizes here. */ + default: + *sizeP = 0; + return _("Bad call to md_atof()"); + } + + t = atof_ieee (input_line_pointer, type, words); + if (t) + input_line_pointer = t; + * sizeP = prec * sizeof (LITTLENUM_TYPE); + + for (i = 0; i < prec; i++) + { + md_number_to_chars (litP, (valueT) words[i], + sizeof (LITTLENUM_TYPE)); + litP += sizeof (LITTLENUM_TYPE); + } + + return 0; +} + + +bfd_boolean +mep_fix_adjustable (fixS *fixP) +{ + bfd_reloc_code_real_type reloc_type; + + if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED) + { + const CGEN_INSN *insn = NULL; + int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED; + const CGEN_OPERAND *operand + = cgen_operand_lookup_by_num(gas_cgen_cpu_desc, opindex); + reloc_type = md_cgen_lookup_reloc (insn, operand, fixP); + } + else + reloc_type = fixP->fx_r_type; + + if (fixP->fx_addsy == NULL) + return 1; + + /* Prevent all adjustments to global symbols. */ + if (S_IS_EXTERNAL (fixP->fx_addsy)) + return 0; + + if (S_IS_WEAK (fixP->fx_addsy)) + return 0; + + /* We need the symbol name for the VTABLE entries */ + if (reloc_type == BFD_RELOC_VTABLE_INHERIT + || reloc_type == BFD_RELOC_VTABLE_ENTRY) + return 0; + + return 1; +} + +int +mep_elf_section_letter (int letter, char **ptrmsg) +{ + if (letter == 'v') + return SHF_MEP_VLIW; + + *ptrmsg = _("Bad .section directive: want a,v,w,x,M,S in string"); + return 0; +} + +flagword +mep_elf_section_flags (flagword flags, int attr, int type ATTRIBUTE_UNUSED) +{ + if (attr & SHF_MEP_VLIW) + flags |= SEC_MEP_VLIW; + return flags; +} + +/* In vliw mode, the default section is .vtext. We have to be able + to switch into .vtext using only the .vtext directive. */ + +static segT +mep_vtext_section (void) +{ + static segT vtext_section; + + if (! vtext_section) + { + flagword applicable = bfd_applicable_section_flags (stdoutput); + vtext_section = subseg_new (VTEXT_SECTION_NAME, 0); + bfd_set_section_flags (stdoutput, vtext_section, + applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC + | SEC_CODE | SEC_READONLY + | SEC_MEP_VLIW)); + } + + return vtext_section; +} + +static void +mep_s_vtext (int ignore ATTRIBUTE_UNUSED) +{ + int temp; + + /* Record previous_section and previous_subsection. */ + obj_elf_section_change_hook (); + + temp = get_absolute_expression (); + subseg_set (mep_vtext_section (), (subsegT) temp); + demand_empty_rest_of_line (); +} + +static void +mep_switch_to_core_mode (int dummy ATTRIBUTE_UNUSED) +{ + mep_process_saved_insns (); + pluspresent = 0; + mode = CORE; +} + +static void +mep_switch_to_vliw_mode (int dummy ATTRIBUTE_UNUSED) +{ + if (! MEP_VLIW) + as_bad (_(".vliw unavailable when VLIW is disabled.")); + mode = VLIW; + /* Switch into .vtext here too. */ + /* mep_s_vtext(); */ +} + +/* This is an undocumented pseudo-op used to disable gas's + "disabled_registers" check. Used for code which checks for those + registers at runtime. */ +static void +mep_noregerr (int i ATTRIBUTE_UNUSED) +{ + allow_disabled_registers = 1; +} + +/* mep_unrecognized_line: This is called when a line that can't be parsed + is encountered. We use it to check for a leading '+' sign which indicates + that the current instruction is a coprocessor instruction that is to be + parallelized with a previous core insn. This function accepts the '+' and + rejects all other characters that might indicate garbage at the beginning + of the line. The '+' character gets lost as the calling loop continues, + so we need to indicate that we saw it. */ + +int +mep_unrecognized_line (int ch) +{ + switch (ch) + { + case '+': + pluspresent = 1; + return 1; /* '+' indicates an instruction to be parallelized. */ + default: + return 0; /* If it's not a '+', the line can't be parsed. */ + } +} + +void +mep_cleanup (void) +{ + /* Take care of any insns left to be parallelized when the file ends. + This is mainly here to handle the case where the file ends with an + insn preceeded by a + or the file ends unexpectedly. */ + if (mode == VLIW) + mep_process_saved_insns (); +} + +int +mep_flush_pending_output (void) +{ + if (mode == VLIW) + { + mep_process_saved_insns (); + pluspresent = 0; + } + + return 1; +} diff --git a/gas/config/tc-mep.h b/gas/config/tc-mep.h new file mode 100644 index 00000000000..1d48bd4c9a4 --- /dev/null +++ b/gas/config/tc-mep.h @@ -0,0 +1,119 @@ +/* tc-mep.h -- Header file for tc-mep.c. + Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc. + + This file is part of GAS, the GNU Assembler. + + GAS 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 2, or (at your option) + any later version. + + GAS 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 GAS; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +#define TC_MEP + +/* Support computed relocations. */ +#define OBJ_COMPLEX_RELC + +/* Support many operands per instruction. */ +#define GAS_CGEN_MAX_FIXUPS 10 + +#define LISTING_HEADER "MEP GAS " + +/* The target BFD architecture. */ +#define TARGET_ARCH bfd_arch_mep + +#define TARGET_FORMAT (target_big_endian ? "elf32-mep" : "elf32-mep-little") + +/* This is the default. */ +#define TARGET_BYTES_BIG_ENDIAN 1 + +/* Permit temporary numeric labels. */ +#define LOCAL_LABELS_FB 1 + +/* .-foo gets turned into PC relative relocs. */ +#define DIFF_EXPR_OK + +/* We don't need to handle .word strangely. */ +#define WORKING_DOT_WORD + +/* Values passed to md_apply_fix don't include the symbol value. */ +#define MD_APPLY_SYM_VALUE(FIX) 0 + +#define MD_APPLY_FIX +#define md_apply_fix mep_apply_fix +extern void mep_apply_fix (struct fix *, valueT *, segT); + +/* Call md_pcrel_from_section(), not md_pcrel_from(). */ +#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC) +extern long md_pcrel_from_section (struct fix *, segT); + +#define tc_frob_file() mep_frob_file () +extern void mep_frob_file (void); + +#define tc_fix_adjustable(fixP) mep_fix_adjustable (fixP) +extern bfd_boolean mep_fix_adjustable (struct fix *); + +/* After creating a fixup for an instruction operand, we need + to check for HI16 relocs and queue them up for later sorting. */ +#define md_cgen_record_fixup_exp mep_cgen_record_fixup_exp + +/* When relaxing, we need to emit various relocs we otherwise wouldn't. */ +#define TC_FORCE_RELOCATION(fix) mep_force_relocation (fix) +extern int mep_force_relocation (struct fix *); + +#define tc_gen_reloc gas_cgen_tc_gen_reloc + +extern void gas_cgen_md_operand (expressionS *); +#define md_operand(x) gas_cgen_md_operand (x) + +#define md_flush_pending_output() mep_flush_pending_output() +extern int mep_flush_pending_output(void); + +extern const struct relax_type md_relax_table[]; +#define TC_GENERIC_RELAX_TABLE md_relax_table + +/* Account for inserting a jmp after the insn. */ +#define TC_CGEN_MAX_RELAX(insn, len) ((len) + 4) + +extern void mep_prepare_relax_scan (fragS *, offsetT *, relax_substateT); +#define md_prepare_relax_scan(FRAGP, ADDR, AIM, STATE, TYPE) \ + mep_prepare_relax_scan (FRAGP, &AIM, STATE) + +#define skip_whitespace(str) while (*(str) == ' ') ++(str) + +/* Support for core/vliw mode switching. */ +#define CORE 0 +#define VLIW 1 +#define MAX_PARALLEL_INSNS 56 /* From email from Toshiba. */ +#define VTEXT_SECTION_NAME ".vtext" + +/* Needed to process pending instructions when a label is encountered. */ +#define TC_START_LABEL(ch, ptr) ((ch == ':') && mep_flush_pending_output ()) + +#define tc_unrecognized_line(c) mep_unrecognized_line (c) +extern int mep_unrecognized_line (int); +#define md_cleanup mep_cleanup +extern void mep_cleanup (void); + +#define md_elf_section_letter mep_elf_section_letter +extern int mep_elf_section_letter (int, char **); +#define md_elf_section_flags mep_elf_section_flags +extern flagword mep_elf_section_flags (flagword, int, int); + +#define ELF_TC_SPECIAL_SECTIONS \ + { VTEXT_SECTION_NAME, SHT_PROGBITS, SHF_ALLOC|SHF_EXECINSTR|SHF_MEP_VLIW }, + +/* The values of the following enum are for use with parinsnum, which + is a variable in md_assemble that keeps track of whether or not the + next instruction is expected to be the first or second instrucion in + a parallelization group. */ +typedef enum exp_par_insn_{FIRST, SECOND} EXP_PAR_INSN; diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index c885205dad4..c2867bec72b 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -1,6 +1,6 @@ /* tc-mips.c -- assemble code for a MIPS chip. Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by the OSF and Ralph Campbell. Written by Keith Knowles and Ralph Campbell, working independently. Modified for ECOFF and R4000 support by Ian Lance Taylor of Cygnus @@ -28,8 +28,6 @@ #include "subsegs.h" #include "safe-ctype.h" -#include - #include "opcode/mips.h" #include "itbl-ops.h" #include "dwarf2dbg.h" @@ -150,7 +148,7 @@ struct mips_cl_insn /* True if this entry cannot be moved from its current position. */ unsigned int fixed_p : 1; - /* True if this instruction occured in a .set noreorder block. */ + /* True if this instruction occurred in a .set noreorder block. */ unsigned int noreorder_p : 1; /* True for mips16 instructions that jump to an absolute address. */ @@ -193,7 +191,9 @@ struct mips_set_options command line options, and based on the default architecture. */ int ase_mips3d; int ase_mdmx; + int ase_smartmips; int ase_dsp; + int ase_dspr2; int ase_mt; /* Whether we are assembling for the mips16 processor. 0 if we are not, 1 if we are, and -1 if the value has not been initialized. @@ -245,7 +245,7 @@ static int file_mips_fp32 = -1; static struct mips_set_options mips_opts = { - ISA_UNKNOWN, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, CPU_UNKNOWN, FALSE + ISA_UNKNOWN, -1, -1, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, CPU_UNKNOWN, FALSE }; /* These variables are filled in with the masks of registers used. @@ -261,6 +261,11 @@ static int file_mips_isa = ISA_UNKNOWN; command line (e.g., by -march). */ static int file_ase_mips16; +#define ISA_SUPPORTS_MIPS16E (mips_opts.isa == ISA_MIPS32 \ + || mips_opts.isa == ISA_MIPS32R2 \ + || mips_opts.isa == ISA_MIPS64 \ + || mips_opts.isa == ISA_MIPS64R2) + /* True if -mips3d was passed or implied by arguments passed on the command line (e.g., by -march). */ static int file_ase_mips3d; @@ -269,14 +274,36 @@ static int file_ase_mips3d; command line (e.g., by -march). */ static int file_ase_mdmx; +/* True if -msmartmips was passed or implied by arguments passed on the + command line (e.g., by -march). */ +static int file_ase_smartmips; + +#define ISA_SUPPORTS_SMARTMIPS (mips_opts.isa == ISA_MIPS32 \ + || mips_opts.isa == ISA_MIPS32R2) + /* True if -mdsp was passed or implied by arguments passed on the command line (e.g., by -march). */ static int file_ase_dsp; +#define ISA_SUPPORTS_DSP_ASE (mips_opts.isa == ISA_MIPS32R2 \ + || mips_opts.isa == ISA_MIPS64R2) + +#define ISA_SUPPORTS_DSP64_ASE (mips_opts.isa == ISA_MIPS64R2) + +/* True if -mdspr2 was passed or implied by arguments passed on the + command line (e.g., by -march). */ +static int file_ase_dspr2; + +#define ISA_SUPPORTS_DSPR2_ASE (mips_opts.isa == ISA_MIPS32R2 \ + || mips_opts.isa == ISA_MIPS64R2) + /* True if -mmt was passed or implied by arguments passed on the command line (e.g., by -march). */ static int file_ase_mt; +#define ISA_SUPPORTS_MT_ASE (mips_opts.isa == ISA_MIPS32R2 \ + || mips_opts.isa == ISA_MIPS64R2) + /* The argument of the -march= flag. The architecture we are assembling. */ static int file_mips_arch = CPU_UNKNOWN; static const char *mips_arch_string; @@ -293,41 +320,61 @@ static int mips_32bitmode = 0; #define ABI_NEEDS_32BIT_REGS(ABI) ((ABI) == O32_ABI) /* Likewise 64-bit registers. */ -#define ABI_NEEDS_64BIT_REGS(ABI) \ - ((ABI) == N32_ABI \ - || (ABI) == N64_ABI \ +#define ABI_NEEDS_64BIT_REGS(ABI) \ + ((ABI) == N32_ABI \ + || (ABI) == N64_ABI \ || (ABI) == O64_ABI) -/* Return true if ISA supports 64 bit gp register instructions. */ -#define ISA_HAS_64BIT_REGS(ISA) ( \ - (ISA) == ISA_MIPS3 \ - || (ISA) == ISA_MIPS4 \ - || (ISA) == ISA_MIPS5 \ - || (ISA) == ISA_MIPS64 \ - || (ISA) == ISA_MIPS64R2 \ - ) +/* Return true if ISA supports 64 bit wide gp registers. */ +#define ISA_HAS_64BIT_REGS(ISA) \ + ((ISA) == ISA_MIPS3 \ + || (ISA) == ISA_MIPS4 \ + || (ISA) == ISA_MIPS5 \ + || (ISA) == ISA_MIPS64 \ + || (ISA) == ISA_MIPS64R2) + +/* Return true if ISA supports 64 bit wide float registers. */ +#define ISA_HAS_64BIT_FPRS(ISA) \ + ((ISA) == ISA_MIPS3 \ + || (ISA) == ISA_MIPS4 \ + || (ISA) == ISA_MIPS5 \ + || (ISA) == ISA_MIPS32R2 \ + || (ISA) == ISA_MIPS64 \ + || (ISA) == ISA_MIPS64R2) /* Return true if ISA supports 64-bit right rotate (dror et al.) instructions. */ -#define ISA_HAS_DROR(ISA) ( \ - (ISA) == ISA_MIPS64R2 \ - ) +#define ISA_HAS_DROR(ISA) \ + ((ISA) == ISA_MIPS64R2) /* Return true if ISA supports 32-bit right rotate (ror et al.) instructions. */ -#define ISA_HAS_ROR(ISA) ( \ - (ISA) == ISA_MIPS32R2 \ - || (ISA) == ISA_MIPS64R2 \ - ) +#define ISA_HAS_ROR(ISA) \ + ((ISA) == ISA_MIPS32R2 \ + || (ISA) == ISA_MIPS64R2 \ + || mips_opts.ase_smartmips) + +/* Return true if ISA supports single-precision floats in odd registers. */ +#define ISA_HAS_ODD_SINGLE_FPR(ISA) \ + ((ISA) == ISA_MIPS32 \ + || (ISA) == ISA_MIPS32R2 \ + || (ISA) == ISA_MIPS64 \ + || (ISA) == ISA_MIPS64R2) + +/* Return true if ISA supports move to/from high part of a 64-bit + floating-point register. */ +#define ISA_HAS_MXHC1(ISA) \ + ((ISA) == ISA_MIPS32R2 \ + || (ISA) == ISA_MIPS64R2) #define HAVE_32BIT_GPRS \ - (mips_opts.gp32 || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) + (mips_opts.gp32 || !ISA_HAS_64BIT_REGS (mips_opts.isa)) #define HAVE_32BIT_FPRS \ - (mips_opts.fp32 || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) + (mips_opts.fp32 || !ISA_HAS_64BIT_FPRS (mips_opts.isa)) -#define HAVE_64BIT_GPRS (! HAVE_32BIT_GPRS) -#define HAVE_64BIT_FPRS (! HAVE_32BIT_FPRS) +#define HAVE_64BIT_GPRS (!HAVE_32BIT_GPRS) +#define HAVE_64BIT_FPRS (!HAVE_32BIT_FPRS) #define HAVE_NEWABI (mips_abi == N32_ABI || mips_abi == N64_ABI) @@ -367,22 +414,6 @@ static int mips_32bitmode = 0; (strncmp (TARGET_CPU, "mips16", sizeof ("mips16") - 1) == 0 \ || strncmp (TARGET_CANONICAL, "mips-lsi-elf", sizeof ("mips-lsi-elf") - 1) == 0) -/* Return true if the given CPU supports the MIPS3D ASE. */ -#define CPU_HAS_MIPS3D(cpu) ((cpu) == CPU_SB1 \ - ) - -/* Return true if the given CPU supports the MDMX ASE. */ -#define CPU_HAS_MDMX(cpu) (FALSE \ - ) - -/* Return true if the given CPU supports the DSP ASE. */ -#define CPU_HAS_DSP(cpu) (FALSE \ - ) - -/* Return true if the given CPU supports the MT ASE. */ -#define CPU_HAS_MT(cpu) (FALSE \ - ) - /* True if CPU has a dror instruction. */ #define CPU_HAS_DROR(CPU) ((CPU) == CPU_VR5400 || (CPU) == CPU_VR5500) @@ -476,7 +507,7 @@ static int mips_any_noreorder; an mfhi/mflo instruction is read in the next two instructions. */ static int mips_7000_hilo_fix; -/* The size of the small data section. */ +/* The size of objects in the small data section. */ static unsigned int g_switch_value = 8; /* Whether the -G option was used. */ static int g_switch_seen = 0; @@ -993,6 +1024,8 @@ static void s_cpsetup (int); static void s_cplocal (int); static void s_cprestore (int); static void s_cpreturn (int); +static void s_dtprelword (int); +static void s_dtpreldword (int); static void s_gpvalue (int); static void s_gpword (int); static void s_gpdword (int); @@ -1018,11 +1051,19 @@ static int validate_mips_insn (const struct mips_opcode *); struct mips_cpu_info { const char *name; /* CPU or ISA name. */ - int is_isa; /* Is this an ISA? (If 0, a CPU.) */ + int flags; /* ASEs available, or ISA flag. */ int isa; /* ISA level. */ int cpu; /* CPU number (default CPU if ISA). */ }; +#define MIPS_CPU_IS_ISA 0x0001 /* Is this an ISA? (If 0, a CPU.) */ +#define MIPS_CPU_ASE_SMARTMIPS 0x0002 /* CPU implements SmartMIPS ASE */ +#define MIPS_CPU_ASE_DSP 0x0004 /* CPU implements DSP ASE */ +#define MIPS_CPU_ASE_MT 0x0008 /* CPU implements MT ASE */ +#define MIPS_CPU_ASE_MIPS3D 0x0010 /* CPU implements MIPS-3D ASE */ +#define MIPS_CPU_ASE_MDMX 0x0020 /* CPU implements MDMX ASE */ +#define MIPS_CPU_ASE_DSPR2 0x0040 /* CPU implements DSP R2 ASE */ + static const struct mips_cpu_info *mips_parse_cpu (const char *, const char *); static const struct mips_cpu_info *mips_cpu_info_from_isa (int); static const struct mips_cpu_info *mips_cpu_info_from_arch (int); @@ -1042,8 +1083,7 @@ static const struct mips_cpu_info *mips_cpu_info_from_arch (int); The following pseudo-ops from the Kane and Heinrich MIPS book are not MIPS CPU specific, but are also not specific to the object file format. This file is probably the best place to define them, but - they are not currently supported: .asm0, .endr, .lab, .repeat, - .struct. */ + they are not currently supported: .asm0, .endr, .lab, .struct. */ static const pseudo_typeS mips_pseudo_table[] = { @@ -1059,6 +1099,8 @@ static const pseudo_typeS mips_pseudo_table[] = {"cplocal", s_cplocal, 0}, {"cprestore", s_cprestore, 0}, {"cpreturn", s_cpreturn, 0}, + {"dtprelword", s_dtprelword, 0}, + {"dtpreldword", s_dtpreldword, 0}, {"gpvalue", s_gpvalue, 0}, {"gpword", s_gpword, 0}, {"gpdword", s_gpdword, 0}, @@ -1073,6 +1115,8 @@ static const pseudo_typeS mips_pseudo_table[] = {"half", s_cons, 1}, {"dword", s_cons, 3}, {"weakext", s_mips_weakext, 0}, + {"origin", s_org, 0}, + {"repeat", s_rept, 0}, /* These pseudo-ops are defined in read.c, but must be overridden here for one reason or another. */ @@ -1136,8 +1180,8 @@ struct insn_label_list symbolS *label; }; -static struct insn_label_list *insn_labels; static struct insn_label_list *free_insn_labels; +#define label_list tc_segment_info_data static void mips_clear_insn_labels (void); @@ -1145,12 +1189,19 @@ static inline void mips_clear_insn_labels (void) { register struct insn_label_list **pl; + segment_info_type *si; - for (pl = &free_insn_labels; *pl != NULL; pl = &(*pl)->next) - ; - *pl = insn_labels; - insn_labels = NULL; + if (now_seg) + { + for (pl = &free_insn_labels; *pl != NULL; pl = &(*pl)->next) + ; + + si = seg_info (now_seg); + *pl = si->label_list; + si->label_list = NULL; + } } + static char *expr_end; @@ -1393,13 +1444,302 @@ init_vr4120_conflicts (void) #undef CONFLICT } -/* This function is called once, at assembler startup time. It should - set up all the tables, etc. that the MD part of the assembler will need. */ +struct regname { + const char *name; + unsigned int num; +}; + +#define RTYPE_MASK 0x1ff00 +#define RTYPE_NUM 0x00100 +#define RTYPE_FPU 0x00200 +#define RTYPE_FCC 0x00400 +#define RTYPE_VEC 0x00800 +#define RTYPE_GP 0x01000 +#define RTYPE_CP0 0x02000 +#define RTYPE_PC 0x04000 +#define RTYPE_ACC 0x08000 +#define RTYPE_CCC 0x10000 +#define RNUM_MASK 0x000ff +#define RWARN 0x80000 + +#define GENERIC_REGISTER_NUMBERS \ + {"$0", RTYPE_NUM | 0}, \ + {"$1", RTYPE_NUM | 1}, \ + {"$2", RTYPE_NUM | 2}, \ + {"$3", RTYPE_NUM | 3}, \ + {"$4", RTYPE_NUM | 4}, \ + {"$5", RTYPE_NUM | 5}, \ + {"$6", RTYPE_NUM | 6}, \ + {"$7", RTYPE_NUM | 7}, \ + {"$8", RTYPE_NUM | 8}, \ + {"$9", RTYPE_NUM | 9}, \ + {"$10", RTYPE_NUM | 10}, \ + {"$11", RTYPE_NUM | 11}, \ + {"$12", RTYPE_NUM | 12}, \ + {"$13", RTYPE_NUM | 13}, \ + {"$14", RTYPE_NUM | 14}, \ + {"$15", RTYPE_NUM | 15}, \ + {"$16", RTYPE_NUM | 16}, \ + {"$17", RTYPE_NUM | 17}, \ + {"$18", RTYPE_NUM | 18}, \ + {"$19", RTYPE_NUM | 19}, \ + {"$20", RTYPE_NUM | 20}, \ + {"$21", RTYPE_NUM | 21}, \ + {"$22", RTYPE_NUM | 22}, \ + {"$23", RTYPE_NUM | 23}, \ + {"$24", RTYPE_NUM | 24}, \ + {"$25", RTYPE_NUM | 25}, \ + {"$26", RTYPE_NUM | 26}, \ + {"$27", RTYPE_NUM | 27}, \ + {"$28", RTYPE_NUM | 28}, \ + {"$29", RTYPE_NUM | 29}, \ + {"$30", RTYPE_NUM | 30}, \ + {"$31", RTYPE_NUM | 31} + +#define FPU_REGISTER_NAMES \ + {"$f0", RTYPE_FPU | 0}, \ + {"$f1", RTYPE_FPU | 1}, \ + {"$f2", RTYPE_FPU | 2}, \ + {"$f3", RTYPE_FPU | 3}, \ + {"$f4", RTYPE_FPU | 4}, \ + {"$f5", RTYPE_FPU | 5}, \ + {"$f6", RTYPE_FPU | 6}, \ + {"$f7", RTYPE_FPU | 7}, \ + {"$f8", RTYPE_FPU | 8}, \ + {"$f9", RTYPE_FPU | 9}, \ + {"$f10", RTYPE_FPU | 10}, \ + {"$f11", RTYPE_FPU | 11}, \ + {"$f12", RTYPE_FPU | 12}, \ + {"$f13", RTYPE_FPU | 13}, \ + {"$f14", RTYPE_FPU | 14}, \ + {"$f15", RTYPE_FPU | 15}, \ + {"$f16", RTYPE_FPU | 16}, \ + {"$f17", RTYPE_FPU | 17}, \ + {"$f18", RTYPE_FPU | 18}, \ + {"$f19", RTYPE_FPU | 19}, \ + {"$f20", RTYPE_FPU | 20}, \ + {"$f21", RTYPE_FPU | 21}, \ + {"$f22", RTYPE_FPU | 22}, \ + {"$f23", RTYPE_FPU | 23}, \ + {"$f24", RTYPE_FPU | 24}, \ + {"$f25", RTYPE_FPU | 25}, \ + {"$f26", RTYPE_FPU | 26}, \ + {"$f27", RTYPE_FPU | 27}, \ + {"$f28", RTYPE_FPU | 28}, \ + {"$f29", RTYPE_FPU | 29}, \ + {"$f30", RTYPE_FPU | 30}, \ + {"$f31", RTYPE_FPU | 31} + +#define FPU_CONDITION_CODE_NAMES \ + {"$fcc0", RTYPE_FCC | 0}, \ + {"$fcc1", RTYPE_FCC | 1}, \ + {"$fcc2", RTYPE_FCC | 2}, \ + {"$fcc3", RTYPE_FCC | 3}, \ + {"$fcc4", RTYPE_FCC | 4}, \ + {"$fcc5", RTYPE_FCC | 5}, \ + {"$fcc6", RTYPE_FCC | 6}, \ + {"$fcc7", RTYPE_FCC | 7} + +#define COPROC_CONDITION_CODE_NAMES \ + {"$cc0", RTYPE_FCC | RTYPE_CCC | 0}, \ + {"$cc1", RTYPE_FCC | RTYPE_CCC | 1}, \ + {"$cc2", RTYPE_FCC | RTYPE_CCC | 2}, \ + {"$cc3", RTYPE_FCC | RTYPE_CCC | 3}, \ + {"$cc4", RTYPE_FCC | RTYPE_CCC | 4}, \ + {"$cc5", RTYPE_FCC | RTYPE_CCC | 5}, \ + {"$cc6", RTYPE_FCC | RTYPE_CCC | 6}, \ + {"$cc7", RTYPE_FCC | RTYPE_CCC | 7} + +#define N32N64_SYMBOLIC_REGISTER_NAMES \ + {"$a4", RTYPE_GP | 8}, \ + {"$a5", RTYPE_GP | 9}, \ + {"$a6", RTYPE_GP | 10}, \ + {"$a7", RTYPE_GP | 11}, \ + {"$ta0", RTYPE_GP | 8}, /* alias for $a4 */ \ + {"$ta1", RTYPE_GP | 9}, /* alias for $a5 */ \ + {"$ta2", RTYPE_GP | 10}, /* alias for $a6 */ \ + {"$ta3", RTYPE_GP | 11}, /* alias for $a7 */ \ + {"$t0", RTYPE_GP | 12}, \ + {"$t1", RTYPE_GP | 13}, \ + {"$t2", RTYPE_GP | 14}, \ + {"$t3", RTYPE_GP | 15} + +#define O32_SYMBOLIC_REGISTER_NAMES \ + {"$t0", RTYPE_GP | 8}, \ + {"$t1", RTYPE_GP | 9}, \ + {"$t2", RTYPE_GP | 10}, \ + {"$t3", RTYPE_GP | 11}, \ + {"$t4", RTYPE_GP | 12}, \ + {"$t5", RTYPE_GP | 13}, \ + {"$t6", RTYPE_GP | 14}, \ + {"$t7", RTYPE_GP | 15}, \ + {"$ta0", RTYPE_GP | 12}, /* alias for $t4 */ \ + {"$ta1", RTYPE_GP | 13}, /* alias for $t5 */ \ + {"$ta2", RTYPE_GP | 14}, /* alias for $t6 */ \ + {"$ta3", RTYPE_GP | 15} /* alias for $t7 */ + +/* Remaining symbolic register names */ +#define SYMBOLIC_REGISTER_NAMES \ + {"$zero", RTYPE_GP | 0}, \ + {"$at", RTYPE_GP | 1}, \ + {"$AT", RTYPE_GP | 1}, \ + {"$v0", RTYPE_GP | 2}, \ + {"$v1", RTYPE_GP | 3}, \ + {"$a0", RTYPE_GP | 4}, \ + {"$a1", RTYPE_GP | 5}, \ + {"$a2", RTYPE_GP | 6}, \ + {"$a3", RTYPE_GP | 7}, \ + {"$s0", RTYPE_GP | 16}, \ + {"$s1", RTYPE_GP | 17}, \ + {"$s2", RTYPE_GP | 18}, \ + {"$s3", RTYPE_GP | 19}, \ + {"$s4", RTYPE_GP | 20}, \ + {"$s5", RTYPE_GP | 21}, \ + {"$s6", RTYPE_GP | 22}, \ + {"$s7", RTYPE_GP | 23}, \ + {"$t8", RTYPE_GP | 24}, \ + {"$t9", RTYPE_GP | 25}, \ + {"$k0", RTYPE_GP | 26}, \ + {"$kt0", RTYPE_GP | 26}, \ + {"$k1", RTYPE_GP | 27}, \ + {"$kt1", RTYPE_GP | 27}, \ + {"$gp", RTYPE_GP | 28}, \ + {"$sp", RTYPE_GP | 29}, \ + {"$s8", RTYPE_GP | 30}, \ + {"$fp", RTYPE_GP | 30}, \ + {"$ra", RTYPE_GP | 31} + +#define MIPS16_SPECIAL_REGISTER_NAMES \ + {"$pc", RTYPE_PC | 0} + +#define MDMX_VECTOR_REGISTER_NAMES \ + /* {"$v0", RTYPE_VEC | 0}, clash with REG 2 above */ \ + /* {"$v1", RTYPE_VEC | 1}, clash with REG 3 above */ \ + {"$v2", RTYPE_VEC | 2}, \ + {"$v3", RTYPE_VEC | 3}, \ + {"$v4", RTYPE_VEC | 4}, \ + {"$v5", RTYPE_VEC | 5}, \ + {"$v6", RTYPE_VEC | 6}, \ + {"$v7", RTYPE_VEC | 7}, \ + {"$v8", RTYPE_VEC | 8}, \ + {"$v9", RTYPE_VEC | 9}, \ + {"$v10", RTYPE_VEC | 10}, \ + {"$v11", RTYPE_VEC | 11}, \ + {"$v12", RTYPE_VEC | 12}, \ + {"$v13", RTYPE_VEC | 13}, \ + {"$v14", RTYPE_VEC | 14}, \ + {"$v15", RTYPE_VEC | 15}, \ + {"$v16", RTYPE_VEC | 16}, \ + {"$v17", RTYPE_VEC | 17}, \ + {"$v18", RTYPE_VEC | 18}, \ + {"$v19", RTYPE_VEC | 19}, \ + {"$v20", RTYPE_VEC | 20}, \ + {"$v21", RTYPE_VEC | 21}, \ + {"$v22", RTYPE_VEC | 22}, \ + {"$v23", RTYPE_VEC | 23}, \ + {"$v24", RTYPE_VEC | 24}, \ + {"$v25", RTYPE_VEC | 25}, \ + {"$v26", RTYPE_VEC | 26}, \ + {"$v27", RTYPE_VEC | 27}, \ + {"$v28", RTYPE_VEC | 28}, \ + {"$v29", RTYPE_VEC | 29}, \ + {"$v30", RTYPE_VEC | 30}, \ + {"$v31", RTYPE_VEC | 31} + +#define MIPS_DSP_ACCUMULATOR_NAMES \ + {"$ac0", RTYPE_ACC | 0}, \ + {"$ac1", RTYPE_ACC | 1}, \ + {"$ac2", RTYPE_ACC | 2}, \ + {"$ac3", RTYPE_ACC | 3} + +static const struct regname reg_names[] = { + GENERIC_REGISTER_NUMBERS, + FPU_REGISTER_NAMES, + FPU_CONDITION_CODE_NAMES, + COPROC_CONDITION_CODE_NAMES, + + /* The $txx registers depends on the abi, + these will be added later into the symbol table from + one of the tables below once mips_abi is set after + parsing of arguments from the command line. */ + SYMBOLIC_REGISTER_NAMES, + + MIPS16_SPECIAL_REGISTER_NAMES, + MDMX_VECTOR_REGISTER_NAMES, + MIPS_DSP_ACCUMULATOR_NAMES, + {0, 0} +}; + +static const struct regname reg_names_o32[] = { + O32_SYMBOLIC_REGISTER_NAMES, + {0, 0} +}; + +static const struct regname reg_names_n32n64[] = { + N32N64_SYMBOLIC_REGISTER_NAMES, + {0, 0} +}; + +static int +reg_lookup (char **s, unsigned int types, unsigned int *regnop) +{ + symbolS *symbolP; + char *e; + char save_c; + int reg = -1; + + /* Find end of name. */ + e = *s; + if (is_name_beginner (*e)) + ++e; + while (is_part_of_name (*e)) + ++e; + + /* Terminate name. */ + save_c = *e; + *e = '\0'; + + /* Look for a register symbol. */ + if ((symbolP = symbol_find (*s)) && S_GET_SEGMENT (symbolP) == reg_section) + { + int r = S_GET_VALUE (symbolP); + if (r & types) + reg = r & RNUM_MASK; + else if ((types & RTYPE_VEC) && (r & ~1) == (RTYPE_GP | 2)) + /* Convert GP reg $v0/1 to MDMX reg $v0/1! */ + reg = (r & RNUM_MASK) - 2; + } + /* Else see if this is a register defined in an itbl entry. */ + else if ((types & RTYPE_GP) && itbl_have_entries) + { + char *n = *s; + unsigned long r; + + if (*n == '$') + ++n; + if (itbl_get_reg_val (n, &r)) + reg = r & RNUM_MASK; + } + + /* Advance to next token if a register was recognised. */ + if (reg >= 0) + *s = e; + else if (types & RWARN) + as_warn ("Unrecognized register name `%s'", *s); + + *e = save_c; + if (regnop) + *regnop = reg; + return reg >= 0; +} + +/* This function is called once, at assembler startup time. It should set up + all the tables, etc. that the MD part of the assembler will need. */ void md_begin (void) { - register const char *retval = NULL; + const char *retval = NULL; int i = 0; int broken = 0; @@ -1481,46 +1821,20 @@ md_begin (void) /* We add all the general register names to the symbol table. This helps us detect invalid uses of them. */ - for (i = 0; i < 32; i++) - { - char buf[5]; - - sprintf (buf, "$%d", i); - symbol_table_insert (symbol_new (buf, reg_section, i, + for (i = 0; reg_names[i].name; i++) + symbol_table_insert (symbol_new (reg_names[i].name, reg_section, + reg_names[i].num, // & RNUM_MASK, + &zero_address_frag)); + if (HAVE_NEWABI) + for (i = 0; reg_names_n32n64[i].name; i++) + symbol_table_insert (symbol_new (reg_names_n32n64[i].name, reg_section, + reg_names_n32n64[i].num, // & RNUM_MASK, &zero_address_frag)); - } - symbol_table_insert (symbol_new ("$ra", reg_section, RA, - &zero_address_frag)); - symbol_table_insert (symbol_new ("$fp", reg_section, FP, - &zero_address_frag)); - symbol_table_insert (symbol_new ("$sp", reg_section, SP, - &zero_address_frag)); - symbol_table_insert (symbol_new ("$gp", reg_section, GP, - &zero_address_frag)); - symbol_table_insert (symbol_new ("$at", reg_section, AT, - &zero_address_frag)); - symbol_table_insert (symbol_new ("$kt0", reg_section, KT0, - &zero_address_frag)); - symbol_table_insert (symbol_new ("$kt1", reg_section, KT1, - &zero_address_frag)); - symbol_table_insert (symbol_new ("$zero", reg_section, ZERO, - &zero_address_frag)); - symbol_table_insert (symbol_new ("$pc", reg_section, -1, - &zero_address_frag)); - - /* If we don't add these register names to the symbol table, they - may end up being added as regular symbols by operand(), and then - make it to the object file as undefined in case they're not - regarded as local symbols. They're local in o32, since `$' is a - local symbol prefix, but not in n32 or n64. */ - for (i = 0; i < 8; i++) - { - char buf[6]; - - sprintf (buf, "$fcc%i", i); - symbol_table_insert (symbol_new (buf, reg_section, -1, + else + for (i = 0; reg_names_o32[i].name; i++) + symbol_table_insert (symbol_new (reg_names_o32[i].name, reg_section, + reg_names_o32[i].num, // & RNUM_MASK, &zero_address_frag)); - } mips_no_prev_insn (); @@ -1535,7 +1849,8 @@ md_begin (void) bfd_set_gp_size (stdoutput, g_switch_value); - if (OUTPUT_FLAVOR == bfd_target_elf_flavour) +#ifdef OBJ_ELF + if (IS_ELF) { /* On a native system other than VxWorks, sections must be aligned to 16 byte boundaries. When configured for an embedded ELF @@ -1573,9 +1888,7 @@ md_begin (void) bfd_set_section_flags (stdoutput, sec, flags); bfd_set_section_alignment (stdoutput, sec, HAVE_NEWABI ? 3 : 2); -#ifdef OBJ_ELF mips_regmask_frag = frag_more (sizeof (Elf32_External_RegInfo)); -#endif } else { @@ -1585,7 +1898,6 @@ md_begin (void) bfd_set_section_flags (stdoutput, sec, flags); bfd_set_section_alignment (stdoutput, sec, 3); -#ifdef OBJ_ELF /* Set up the option header. */ { Elf_Internal_Options opthdr; @@ -1602,7 +1914,6 @@ md_begin (void) mips_regmask_frag = frag_more (sizeof (Elf64_External_RegInfo)); } -#endif } if (ECOFF_DEBUGGING) @@ -1612,8 +1923,7 @@ md_begin (void) SEC_HAS_CONTENTS | SEC_READONLY); (void) bfd_set_section_alignment (stdoutput, sec, 2); } -#ifdef OBJ_ELF - else if (OUTPUT_FLAVOR == bfd_target_elf_flavour && mips_flag_pdr) + else if (mips_flag_pdr) { pdr_seg = subseg_new (".pdr", (subsegT) 0); (void) bfd_set_section_flags (stdoutput, pdr_seg, @@ -1621,11 +1931,11 @@ md_begin (void) | SEC_DEBUGGING); (void) bfd_set_section_alignment (stdoutput, pdr_seg, 2); } -#endif subseg_set (seg, subseg); } } +#endif /* OBJ_ELF */ if (! ECOFF_DEBUGGING) md_obj_begin (); @@ -1824,10 +2134,11 @@ reg_needs_delay (unsigned int reg) static void mips_move_labels (void) { + segment_info_type *si = seg_info (now_seg); struct insn_label_list *l; valueT val; - for (l = insn_labels; l != NULL; l = l->next) + for (l = si->label_list; l != NULL; l = l->next) { assert (S_GET_SEGMENT (l->label) == now_seg); symbol_set_frag (l->label, frag_now); @@ -1839,6 +2150,28 @@ mips_move_labels (void) } } +static bfd_boolean +s_is_linkonce (symbolS *sym, segT from_seg) +{ + bfd_boolean linkonce = FALSE; + segT symseg = S_GET_SEGMENT (sym); + + if (symseg != from_seg && !S_IS_LOCAL (sym)) + { + if ((bfd_get_section_flags (stdoutput, symseg) & SEC_LINK_ONCE)) + linkonce = TRUE; +#ifdef OBJ_ELF + /* The GNU toolchain uses an extension for ELF: a section + beginning with the magic string .gnu.linkonce is a + linkonce section. */ + if (strncmp (segment_name (symseg), ".gnu.linkonce", + sizeof ".gnu.linkonce" - 1) == 0) + linkonce = TRUE; +#endif + } + return linkonce; +} + /* Mark instruction labels in mips16 mode. This permits the linker to handle them specially, such as generating jalx instructions when needed. We also make them odd for the duration of the assembly, in @@ -1850,21 +2183,29 @@ mips_move_labels (void) static void mips16_mark_labels (void) { - if (mips_opts.mips16) - { - struct insn_label_list *l; - valueT val; + segment_info_type *si = seg_info (now_seg); + struct insn_label_list *l; - for (l = insn_labels; l != NULL; l = l->next) - { -#ifdef OBJ_ELF - if (OUTPUT_FLAVOR == bfd_target_elf_flavour) - S_SET_OTHER (l->label, STO_MIPS16); + if (!mips_opts.mips16) + return; + + for (l = si->label_list; l != NULL; l = l->next) + { + symbolS *label = l->label; + +#if defined(OBJ_ELF) || defined(OBJ_MAYBE_ELF) + if (IS_ELF) + S_SET_OTHER (label, STO_MIPS16); #endif - val = S_GET_VALUE (l->label); - if ((val & 1) == 0) - S_SET_VALUE (l->label, val + 1); - } + if ((S_GET_VALUE (label) & 1) == 0 + /* Don't adjust the address if the label is global or weak, or + in a link-once section, since we'll be emitting symbol reloc + references to it which will be patched up by the linker, and + the final value of the symbol may or may not be MIPS16. */ + && ! S_IS_WEAK (label) + && ! S_IS_EXTERNAL (label) + && ! s_is_linkonce (label, now_seg)) + S_SET_VALUE (label, S_GET_VALUE (label) | 1); } } @@ -2189,9 +2530,10 @@ static void append_insn (struct mips_cl_insn *ip, expressionS *address_expr, bfd_reloc_code_real_type *reloc_type) { - register unsigned long prev_pinfo, pinfo; + unsigned long prev_pinfo, pinfo; relax_stateT prev_insn_frag_type = 0; bfd_boolean relaxed_branch = FALSE; + segment_info_type *si = seg_info (now_seg); /* Mark instruction labels in mips16 mode. */ mips16_mark_labels (); @@ -2454,6 +2796,11 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr, reloc_type[0] == BFD_RELOC_16_PCREL_S2, reloc_type[0]); + /* Tag symbols that have a R_MIPS16_26 relocation against them. */ + if (reloc_type[0] == BFD_RELOC_MIPS16_JMP + && ip->fixp[0]->fx_addsy) + *symbol_get_tc (ip->fixp[0]->fx_addsy) = 1; + /* These relocations can have an addend that won't fit in 4 octets for 64bit assembly. */ if (HAVE_64BIT_GPRS @@ -2608,7 +2955,7 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr, whether there is a label on this instruction. If there are any branches to anything other than a label, users must use .set noreorder. */ - || insn_labels != NULL + || si->label_list != NULL /* If the previous instruction is in a variant frag other than this branch's one, we cannot do the swap. This does not apply to the mips16, which uses variant @@ -2715,10 +3062,7 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr, if (mips_opts.mips16 && (pinfo & INSN_UNCOND_BRANCH_DELAY) && (pinfo & (MIPS16_INSN_READ_X | MIPS16_INSN_READ_31)) - && (mips_opts.isa == ISA_MIPS32 - || mips_opts.isa == ISA_MIPS32R2 - || mips_opts.isa == ISA_MIPS64 - || mips_opts.isa == ISA_MIPS64R2)) + && ISA_SUPPORTS_MIPS16E) { /* Convert MIPS16 jr/jalr into a "compact" jump. */ ip->insn_opcode |= 0x0080; @@ -3000,16 +3344,24 @@ macro_build (expressionS *ep, const char *name, const char *fmt, ...) assert (mo); assert (strcmp (name, mo->name) == 0); - /* Search until we get a match for NAME. It is assumed here that - macros will never generate MDMX or MIPS-3D instructions. */ - while (strcmp (fmt, mo->args) != 0 - || mo->pinfo == INSN_MACRO - || !OPCODE_IS_MEMBER (mo, - (mips_opts.isa - | (file_ase_mips16 ? INSN_MIPS16 : 0)), - mips_opts.arch) - || (mips_opts.arch == CPU_R4650 && (mo->pinfo & FP_D) != 0)) + while (1) { + /* Search until we get a match for NAME. It is assumed here that + macros will never generate MDMX, MIPS-3D, or MT instructions. */ + if (strcmp (fmt, mo->args) == 0 + && mo->pinfo != INSN_MACRO + && OPCODE_IS_MEMBER (mo, + (mips_opts.isa + | (mips_opts.mips16 ? INSN_MIPS16 : 0) + | (mips_opts.ase_dsp ? INSN_DSP : 0) + | ((mips_opts.ase_dsp && ISA_SUPPORTS_DSP64_ASE) + ? INSN_DSP64 : 0) + | (mips_opts.ase_dspr2 ? INSN_DSPR2 : 0) + | (mips_opts.ase_smartmips ? INSN_SMARTMIPS : 0)), + mips_opts.arch) + && (mips_opts.arch != CPU_R4650 || (mo->pinfo & FP_D) == 0)) + break; + ++mo; assert (mo->name); assert (strcmp (name, mo->name) == 0); @@ -3060,6 +3412,10 @@ macro_build (expressionS *ep, const char *name, const char *fmt, ...) } continue; + case '2': + INSERT_OPERAND (BP, insn, va_arg (args, int)); + continue; + case 't': case 'w': case 'E': @@ -3187,7 +3543,11 @@ macro_build (expressionS *ep, const char *name, const char *fmt, ...) continue; case 'C': - insn.insn_opcode |= va_arg (args, unsigned long); + INSERT_OPERAND (COPZ, insn, va_arg (args, unsigned long)); + continue; + + case 'k': + INSERT_OPERAND (CACHE, insn, va_arg (args, unsigned long)); continue; default: @@ -3271,7 +3631,7 @@ mips16_macro_build (expressionS *ep, const char *name, const char *fmt, regno = va_arg (args, int); regno = ((regno & 7) << 2) | ((regno & 0x18) >> 3); - insn.insn_opcode |= regno << MIPS16OP_SH_REG32R; + MIPS16_INSERT_OPERAND (REG32R, insn, regno); } continue; @@ -3387,7 +3747,7 @@ macro_build_lui (expressionS *ep, int regnum) if (high_expr.X_op == O_constant) { - /* we can compute the instruction now without a relocation entry */ + /* We can compute the instruction now without a relocation entry. */ high_expr.X_add_number = ((high_expr.X_add_number + 0x8000) >> 16) & 0xffff; *r = BFD_RELOC_UNUSED; @@ -4164,7 +4524,7 @@ add_got_offset_hilo (int dest, expressionS *local, int tmp) static void macro (struct mips_cl_insn *ip) { - register int treg, sreg, dreg, breg; + int treg, sreg, dreg, breg; int tempreg; int mask; int used_at = 0; @@ -4284,6 +4644,22 @@ macro (struct mips_cl_insn *ip) macro_build (NULL, s2, "d,v,t", treg, sreg, AT); break; + case M_BALIGN: + switch (imm_expr.X_add_number) + { + case 0: + macro_build (NULL, "nop", ""); + break; + case 2: + macro_build (NULL, "packrl.ph", "d,s,t", treg, treg, sreg); + break; + default: + macro_build (NULL, "balign", "t,s,2", treg, sreg, + (int)imm_expr.X_add_number); + break; + } + break; + case M_BEQ_I: s = "beq"; goto beq_i; @@ -5814,6 +6190,9 @@ macro (struct mips_cl_insn *ip) case M_SCD_AB: s = "scd"; goto st; + case M_CACHE_AB: + s = "cache"; + goto st; case M_SDC1_AB: if (mips_opts.arch == CPU_R4650) { @@ -5851,6 +6230,8 @@ macro (struct mips_cl_insn *ip) || mask == M_L_DAB || mask == M_S_DAB) fmt = "T,o(b)"; + else if (mask == M_CACHE_AB) + fmt = "k,o(b)"; else if (coproc) fmt = "E,o(b)"; else @@ -6763,7 +7144,7 @@ macro (struct mips_cl_insn *ip) static void macro2 (struct mips_cl_insn *ip) { - register int treg, sreg, dreg, breg; + int treg, sreg, dreg, breg; int tempreg; int mask; int used_at; @@ -7808,6 +8189,10 @@ validate_mips_insn (const struct mips_opcode *opc) case '+': switch (c = *p++) { + case '1': USE_BITS (OP_MASK_UDI1, OP_SH_UDI1); break; + case '2': USE_BITS (OP_MASK_UDI2, OP_SH_UDI2); break; + case '3': USE_BITS (OP_MASK_UDI3, OP_SH_UDI3); break; + case '4': USE_BITS (OP_MASK_UDI4, OP_SH_UDI4); break; case 'A': USE_BITS (OP_MASK_SHAMT, OP_SH_SHAMT); break; case 'B': USE_BITS (OP_MASK_INSMSB, OP_SH_INSMSB); break; case 'C': USE_BITS (OP_MASK_EXTMSBD, OP_SH_EXTMSBD); break; @@ -7882,6 +8267,7 @@ validate_mips_insn (const struct mips_opcode *opc) case '%': USE_BITS (OP_MASK_VECALIGN, OP_SH_VECALIGN); break; case '[': break; case ']': break; + case '2': USE_BITS (OP_MASK_BP, OP_SH_BP); break; case '3': USE_BITS (OP_MASK_SA3, OP_SH_SA3); break; case '4': USE_BITS (OP_MASK_SA4, OP_SH_SA4); break; case '5': USE_BITS (OP_MASK_IMM8, OP_SH_IMM8); break; @@ -7913,6 +8299,62 @@ validate_mips_insn (const struct mips_opcode *opc) return 1; } +/* UDI immediates. */ +struct mips_immed { + char type; + unsigned int shift; + unsigned long mask; + const char * desc; +}; + +static const struct mips_immed mips_immed[] = { + { '1', OP_SH_UDI1, OP_MASK_UDI1, 0}, + { '2', OP_SH_UDI2, OP_MASK_UDI2, 0}, + { '3', OP_SH_UDI3, OP_MASK_UDI3, 0}, + { '4', OP_SH_UDI4, OP_MASK_UDI4, 0}, + { 0,0,0,0 } +}; + +/* Check whether an odd floating-point register is allowed. */ +static int +mips_oddfpreg_ok (const struct mips_opcode *insn, int argnum) +{ + const char *s = insn->name; + + if (insn->pinfo == INSN_MACRO) + /* Let a macro pass, we'll catch it later when it is expanded. */ + return 1; + + if (ISA_HAS_ODD_SINGLE_FPR (mips_opts.isa)) + { + /* Allow odd registers for single-precision ops. */ + switch (insn->pinfo & (FP_S | FP_D)) + { + case FP_S: + case 0: + return 1; /* both single precision - ok */ + case FP_D: + return 0; /* both double precision - fail */ + default: + break; + } + + /* Cvt.w.x and cvt.x.w allow an odd register for a 'w' or 's' operand. */ + s = strchr (insn->name, '.'); + if (argnum == 2) + s = s != NULL ? strchr (s + 1, '.') : NULL; + return (s != NULL && (s[1] == 'w' || s[1] == 's')); + } + + /* Single-precision coprocessor loads and moves are OK too. */ + if ((insn->pinfo & FP_S) + && (insn->pinfo & (INSN_COPROC_MEMORY_DELAY | INSN_STORE_MEMORY + | INSN_LOAD_COPROC_DELAY | INSN_COPROC_MOVE_DELAY))) + return 1; + + return 0; +} + /* This routine assembles an instruction into its binary format. As a side effect, it sets one of the global variables imm_reloc or offset_reloc to the type of relocation to do if one of the operands @@ -7933,6 +8375,8 @@ mips_ip (char *str, struct mips_cl_insn *ip) char *s_reset; char save_c = 0; offsetT min_range, max_range; + int argnum; + unsigned int rtype; insn_error = NULL; @@ -7993,11 +8437,18 @@ mips_ip (char *str, struct mips_cl_insn *ip) if (OPCODE_IS_MEMBER (insn, (mips_opts.isa + /* We don't check for mips_opts.mips16 here since + we want to allow jalx if -mips16 was specified + on the command line. */ | (file_ase_mips16 ? INSN_MIPS16 : 0) | (mips_opts.ase_mdmx ? INSN_MDMX : 0) | (mips_opts.ase_dsp ? INSN_DSP : 0) + | ((mips_opts.ase_dsp && ISA_SUPPORTS_DSP64_ASE) + ? INSN_DSP64 : 0) + | (mips_opts.ase_dspr2 ? INSN_DSPR2 : 0) | (mips_opts.ase_mt ? INSN_MT : 0) - | (mips_opts.ase_mips3d ? INSN_MIPS3D : 0)), + | (mips_opts.ase_mips3d ? INSN_MIPS3D : 0) + | (mips_opts.ase_smartmips ? INSN_SMARTMIPS : 0)), mips_opts.arch)) ok = TRUE; else @@ -8036,6 +8487,7 @@ mips_ip (char *str, struct mips_cl_insn *ip) create_insn (ip, insn); insn_error = NULL; + argnum = 1; for (args = insn->args;; ++args) { int is_mdmx; @@ -8049,16 +8501,29 @@ mips_ip (char *str, struct mips_cl_insn *ip) return; break; + case '2': /* dsp 2-bit unsigned immediate in bit 11 */ + my_getExpression (&imm_expr, s); + check_absolute_expr (ip, &imm_expr); + if ((unsigned long) imm_expr.X_add_number != 1 + && (unsigned long) imm_expr.X_add_number != 3) + { + as_bad (_("BALIGN immediate not 1 or 3 (%lu)"), + (unsigned long) imm_expr.X_add_number); + } + INSERT_OPERAND (BP, *ip, imm_expr.X_add_number); + imm_expr.X_op = O_absent; + s = expr_end; + continue; + case '3': /* dsp 3-bit unsigned immediate in bit 21 */ my_getExpression (&imm_expr, s); check_absolute_expr (ip, &imm_expr); if (imm_expr.X_add_number & ~OP_MASK_SA3) { - as_warn (_("DSP immediate not in range 0..%d (%lu)"), - OP_MASK_SA3, (unsigned long) imm_expr.X_add_number); - imm_expr.X_add_number &= OP_MASK_SA3; + as_bad (_("DSP immediate not in range 0..%d (%lu)"), + OP_MASK_SA3, (unsigned long) imm_expr.X_add_number); } - ip->insn_opcode |= imm_expr.X_add_number << OP_SH_SA3; + INSERT_OPERAND (SA3, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; @@ -8068,11 +8533,10 @@ mips_ip (char *str, struct mips_cl_insn *ip) check_absolute_expr (ip, &imm_expr); if (imm_expr.X_add_number & ~OP_MASK_SA4) { - as_warn (_("DSP immediate not in range 0..%d (%lu)"), - OP_MASK_SA4, (unsigned long) imm_expr.X_add_number); - imm_expr.X_add_number &= OP_MASK_SA4; + as_bad (_("DSP immediate not in range 0..%d (%lu)"), + OP_MASK_SA4, (unsigned long) imm_expr.X_add_number); } - ip->insn_opcode |= imm_expr.X_add_number << OP_SH_SA4; + INSERT_OPERAND (SA4, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; @@ -8082,11 +8546,10 @@ mips_ip (char *str, struct mips_cl_insn *ip) check_absolute_expr (ip, &imm_expr); if (imm_expr.X_add_number & ~OP_MASK_IMM8) { - as_warn (_("DSP immediate not in range 0..%d (%lu)"), - OP_MASK_IMM8, (unsigned long) imm_expr.X_add_number); - imm_expr.X_add_number &= OP_MASK_IMM8; + as_bad (_("DSP immediate not in range 0..%d (%lu)"), + OP_MASK_IMM8, (unsigned long) imm_expr.X_add_number); } - ip->insn_opcode |= imm_expr.X_add_number << OP_SH_IMM8; + INSERT_OPERAND (IMM8, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; @@ -8096,11 +8559,10 @@ mips_ip (char *str, struct mips_cl_insn *ip) check_absolute_expr (ip, &imm_expr); if (imm_expr.X_add_number & ~OP_MASK_RS) { - as_warn (_("DSP immediate not in range 0..%d (%lu)"), - OP_MASK_RS, (unsigned long) imm_expr.X_add_number); - imm_expr.X_add_number &= OP_MASK_RS; + as_bad (_("DSP immediate not in range 0..%d (%lu)"), + OP_MASK_RS, (unsigned long) imm_expr.X_add_number); } - ip->insn_opcode |= imm_expr.X_add_number << OP_SH_RS; + INSERT_OPERAND (RS, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; @@ -8111,7 +8573,7 @@ mips_ip (char *str, struct mips_cl_insn *ip) { regno = s[3] - '0'; s += 4; - ip->insn_opcode |= regno << OP_SH_DSPACC; + INSERT_OPERAND (DSPACC, *ip, regno); continue; } else @@ -8123,12 +8585,11 @@ mips_ip (char *str, struct mips_cl_insn *ip) check_absolute_expr (ip, &imm_expr); if (imm_expr.X_add_number & ~OP_MASK_WRDSP) { - as_warn (_("DSP immediate not in range 0..%d (%lu)"), - OP_MASK_WRDSP, - (unsigned long) imm_expr.X_add_number); - imm_expr.X_add_number &= OP_MASK_WRDSP; + as_bad (_("DSP immediate not in range 0..%d (%lu)"), + OP_MASK_WRDSP, + (unsigned long) imm_expr.X_add_number); } - ip->insn_opcode |= imm_expr.X_add_number << OP_SH_WRDSP; + INSERT_OPERAND (WRDSP, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; @@ -8139,7 +8600,7 @@ mips_ip (char *str, struct mips_cl_insn *ip) { regno = s[3] - '0'; s += 4; - ip->insn_opcode |= regno << OP_SH_DSPACC_S; + INSERT_OPERAND (DSPACC_S, *ip, regno); continue; } else @@ -8154,13 +8615,11 @@ mips_ip (char *str, struct mips_cl_insn *ip) if (imm_expr.X_add_number < min_range || imm_expr.X_add_number > max_range) { - as_warn (_("DSP immediate not in range %ld..%ld (%ld)"), - (long) min_range, (long) max_range, - (long) imm_expr.X_add_number); + as_bad (_("DSP immediate not in range %ld..%ld (%ld)"), + (long) min_range, (long) max_range, + (long) imm_expr.X_add_number); } - imm_expr.X_add_number &= OP_MASK_DSPSFT; - ip->insn_opcode |= ((unsigned long) imm_expr.X_add_number - << OP_SH_DSPSFT); + INSERT_OPERAND (DSPSFT, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; @@ -8170,12 +8629,11 @@ mips_ip (char *str, struct mips_cl_insn *ip) check_absolute_expr (ip, &imm_expr); if (imm_expr.X_add_number & ~OP_MASK_RDDSP) { - as_warn (_("DSP immediate not in range 0..%d (%lu)"), - OP_MASK_RDDSP, - (unsigned long) imm_expr.X_add_number); - imm_expr.X_add_number &= OP_MASK_RDDSP; + as_bad (_("DSP immediate not in range 0..%d (%lu)"), + OP_MASK_RDDSP, + (unsigned long) imm_expr.X_add_number); } - ip->insn_opcode |= imm_expr.X_add_number << OP_SH_RDDSP; + INSERT_OPERAND (RDDSP, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; @@ -8188,13 +8646,11 @@ mips_ip (char *str, struct mips_cl_insn *ip) if (imm_expr.X_add_number < min_range || imm_expr.X_add_number > max_range) { - as_warn (_("DSP immediate not in range %ld..%ld (%ld)"), - (long) min_range, (long) max_range, - (long) imm_expr.X_add_number); + as_bad (_("DSP immediate not in range %ld..%ld (%ld)"), + (long) min_range, (long) max_range, + (long) imm_expr.X_add_number); } - imm_expr.X_add_number &= OP_MASK_DSPSFT_7; - ip->insn_opcode |= ((unsigned long) imm_expr.X_add_number - << OP_SH_DSPSFT_7); + INSERT_OPERAND (DSPSFT_7, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; @@ -8207,41 +8663,33 @@ mips_ip (char *str, struct mips_cl_insn *ip) if (imm_expr.X_add_number < min_range || imm_expr.X_add_number > max_range) { - as_warn (_("DSP immediate not in range %ld..%ld (%ld)"), - (long) min_range, (long) max_range, - (long) imm_expr.X_add_number); + as_bad (_("DSP immediate not in range %ld..%ld (%ld)"), + (long) min_range, (long) max_range, + (long) imm_expr.X_add_number); } - imm_expr.X_add_number &= OP_MASK_IMM10; - ip->insn_opcode |= ((unsigned long) imm_expr.X_add_number - << OP_SH_IMM10); + INSERT_OPERAND (IMM10, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; - case '!': /* mt 1-bit unsigned immediate in bit 5 */ + case '!': /* MT usermode flag bit. */ my_getExpression (&imm_expr, s); check_absolute_expr (ip, &imm_expr); if (imm_expr.X_add_number & ~OP_MASK_MT_U) - { - as_warn (_("MT immediate not in range 0..%d (%lu)"), - OP_MASK_MT_U, (unsigned long) imm_expr.X_add_number); - imm_expr.X_add_number &= OP_MASK_MT_U; - } - ip->insn_opcode |= imm_expr.X_add_number << OP_SH_MT_U; + as_bad (_("MT usermode bit not 0 or 1 (%lu)"), + (unsigned long) imm_expr.X_add_number); + INSERT_OPERAND (MT_U, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; - case '$': /* mt 1-bit unsigned immediate in bit 4 */ + case '$': /* MT load high flag bit. */ my_getExpression (&imm_expr, s); check_absolute_expr (ip, &imm_expr); if (imm_expr.X_add_number & ~OP_MASK_MT_H) - { - as_warn (_("MT immediate not in range 0..%d (%lu)"), - OP_MASK_MT_H, (unsigned long) imm_expr.X_add_number); - imm_expr.X_add_number &= OP_MASK_MT_H; - } - ip->insn_opcode |= imm_expr.X_add_number << OP_SH_MT_H; + as_bad (_("MT load high bit not 0 or 1 (%lu)"), + (unsigned long) imm_expr.X_add_number); + INSERT_OPERAND (MT_H, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; @@ -8252,7 +8700,7 @@ mips_ip (char *str, struct mips_cl_insn *ip) { regno = s[3] - '0'; s += 4; - ip->insn_opcode |= regno << OP_SH_MTACC_T; + INSERT_OPERAND (MTACC_T, *ip, regno); continue; } else @@ -8265,7 +8713,7 @@ mips_ip (char *str, struct mips_cl_insn *ip) { regno = s[3] - '0'; s += 4; - ip->insn_opcode |= regno << OP_SH_MTACC_D; + INSERT_OPERAND (MTACC_D, *ip, regno); continue; } else @@ -8273,6 +8721,7 @@ mips_ip (char *str, struct mips_cl_insn *ip) break; case ',': + ++argnum; if (*s++ == *args) continue; s--; @@ -8318,6 +8767,34 @@ mips_ip (char *str, struct mips_cl_insn *ip) case '+': /* Opcode extension character. */ switch (*++args) { + case '1': /* UDI immediates. */ + case '2': + case '3': + case '4': + { + const struct mips_immed *imm = mips_immed; + + while (imm->type && imm->type != *args) + ++imm; + if (! imm->type) + internalError (); + my_getExpression (&imm_expr, s); + check_absolute_expr (ip, &imm_expr); + if ((unsigned long) imm_expr.X_add_number & ~imm->mask) + { + as_warn (_("Illegal %s number (%lu, 0x%lx)"), + imm->desc ? imm->desc : ip->insn_mo->name, + (unsigned long) imm_expr.X_add_number, + (unsigned long) imm_expr.X_add_number); + imm_expr.X_add_number &= imm->mask; + } + ip->insn_opcode |= ((unsigned long) imm_expr.X_add_number + << imm->shift); + imm_expr.X_op = O_absent; + s = expr_end; + } + continue; + case 'A': /* ins/ext position, becomes LSB. */ limlo = 0; limhi = 31; @@ -8424,11 +8901,11 @@ do_msbd: s = expr_end; continue; - case 'T': /* Coprocessor register */ + case 'T': /* Coprocessor register. */ /* +T is for disassembly only; never match. */ break; - case 't': /* Coprocessor register number */ + case 't': /* Coprocessor register number. */ if (s[0] == '$' && ISDIGIT (s[1])) { ++s; @@ -8444,7 +8921,7 @@ do_msbd: as_bad (_("Invalid register number (%d)"), regno); else { - ip->insn_opcode |= regno << OP_SH_RT; + INSERT_OPERAND (RT, *ip, regno); continue; } } @@ -8507,8 +8984,9 @@ do_msbd: case 'c': /* break code */ my_getExpression (&imm_expr, s); check_absolute_expr (ip, &imm_expr); - if ((unsigned long) imm_expr.X_add_number > 1023) - as_warn (_("Illegal break code (%lu)"), + if ((unsigned long) imm_expr.X_add_number > OP_MASK_CODE) + as_warn (_("Code for %s not in range 0..1023 (%lu)"), + ip->insn_mo->name, (unsigned long) imm_expr.X_add_number); INSERT_OPERAND (CODE, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; @@ -8518,8 +8996,9 @@ do_msbd: case 'q': /* lower break code */ my_getExpression (&imm_expr, s); check_absolute_expr (ip, &imm_expr); - if ((unsigned long) imm_expr.X_add_number > 1023) - as_warn (_("Illegal lower break code (%lu)"), + if ((unsigned long) imm_expr.X_add_number > OP_MASK_CODE2) + as_warn (_("Lower code for %s not in range 0..1023 (%lu)"), + ip->insn_mo->name, (unsigned long) imm_expr.X_add_number); INSERT_OPERAND (CODE2, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; @@ -8530,7 +9009,8 @@ do_msbd: my_getExpression (&imm_expr, s); check_absolute_expr (ip, &imm_expr); if ((unsigned long) imm_expr.X_add_number > OP_MASK_CODE20) - as_warn (_("Illegal 20-bit code (%lu)"), + as_warn (_("Code for %s not in range 0..1048575 (%lu)"), + ip->insn_mo->name, (unsigned long) imm_expr.X_add_number); INSERT_OPERAND (CODE20, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; @@ -8540,13 +9020,13 @@ do_msbd: case 'C': /* Coprocessor code */ my_getExpression (&imm_expr, s); check_absolute_expr (ip, &imm_expr); - if ((unsigned long) imm_expr.X_add_number >= (1 << 25)) + if ((unsigned long) imm_expr.X_add_number > OP_MASK_COPZ) { as_warn (_("Coproccesor code > 25 bits (%lu)"), (unsigned long) imm_expr.X_add_number); - imm_expr.X_add_number &= ((1 << 25) - 1); + imm_expr.X_add_number &= OP_MASK_COPZ; } - ip->insn_opcode |= imm_expr.X_add_number; + INSERT_OPERAND (COPZ, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; @@ -8555,14 +9035,17 @@ do_msbd: my_getExpression (&imm_expr, s); check_absolute_expr (ip, &imm_expr); if ((unsigned long) imm_expr.X_add_number > OP_MASK_CODE19) - as_warn (_("Illegal 19-bit code (%lu)"), - (unsigned long) imm_expr.X_add_number); + { + as_warn (_("Illegal 19-bit code (%lu)"), + (unsigned long) imm_expr.X_add_number); + imm_expr.X_add_number &= OP_MASK_CODE19; + } INSERT_OPERAND (CODE19, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; - case 'P': /* Performance register */ + case 'P': /* Performance register. */ my_getExpression (&imm_expr, s); check_absolute_expr (ip, &imm_expr); if (imm_expr.X_add_number != 0 && imm_expr.X_add_number != 1) @@ -8573,6 +9056,20 @@ do_msbd: s = expr_end; continue; + case 'G': /* Coprocessor destination register. */ + if (((ip->insn_opcode >> OP_SH_OP) & OP_MASK_OP) == OP_OP_COP0) + ok = reg_lookup (&s, RTYPE_NUM | RTYPE_CP0, ®no); + else + ok = reg_lookup (&s, RTYPE_NUM | RTYPE_GP, ®no); + INSERT_OPERAND (RD, *ip, regno); + if (ok) + { + lastregno = regno; + continue; + } + else + break; + case 'b': /* base register */ case 'd': /* destination register */ case 's': /* source register */ @@ -8581,106 +9078,22 @@ do_msbd: case 'v': /* both dest and source */ case 'w': /* both dest and target */ case 'E': /* coprocessor target register */ - case 'G': /* coprocessor destination register */ case 'K': /* 'rdhwr' destination register */ case 'x': /* ignore register name */ case 'z': /* must be zero register */ case 'U': /* destination register (clo/clz). */ case 'g': /* coprocessor destination register */ - s_reset = s; - if (s[0] == '$') + s_reset = s; + if (*args == 'E' || *args == 'K') + ok = reg_lookup (&s, RTYPE_NUM, ®no); + else + { + ok = reg_lookup (&s, RTYPE_NUM | RTYPE_GP, ®no); + if (regno == AT && ! mips_opts.noat) + as_warn ("Used $at without \".set noat\""); + } + if (ok) { - if (ISDIGIT (s[1])) - { - ++s; - regno = 0; - do - { - regno *= 10; - regno += *s - '0'; - ++s; - } - while (ISDIGIT (*s)); - if (regno > 31) - as_bad (_("Invalid register number (%d)"), regno); - } - else if (*args == 'E' || *args == 'G' || *args == 'K') - goto notreg; - else - { - if (s[1] == 'r' && s[2] == 'a') - { - s += 3; - regno = RA; - } - else if (s[1] == 'f' && s[2] == 'p') - { - s += 3; - regno = FP; - } - else if (s[1] == 's' && s[2] == 'p') - { - s += 3; - regno = SP; - } - else if (s[1] == 'g' && s[2] == 'p') - { - s += 3; - regno = GP; - } - else if (s[1] == 'a' && s[2] == 't') - { - s += 3; - regno = AT; - } - else if (s[1] == 'k' && s[2] == 't' && s[3] == '0') - { - s += 4; - regno = KT0; - } - else if (s[1] == 'k' && s[2] == 't' && s[3] == '1') - { - s += 4; - regno = KT1; - } - else if (s[1] == 'z' && s[2] == 'e' && s[3] == 'r' && s[4] == 'o') - { - s += 5; - regno = ZERO; - } - else if (itbl_have_entries) - { - char *p, *n; - unsigned long r; - - p = s + 1; /* advance past '$' */ - n = itbl_get_field (&p); /* n is name */ - - /* See if this is a register defined in an - itbl entry. */ - if (itbl_get_reg_val (n, &r)) - { - /* Get_field advances to the start of - the next field, so we need to back - rack to the end of the last field. */ - if (p) - s = p - 1; - else - s = strchr (s, '\0'); - regno = r; - } - else - goto notreg; - } - else - goto notreg; - } - if (regno == AT - && ! mips_opts.noat - && *args != 'E' - && *args != 'G' - && *args != 'K') - as_warn (_("Used $at without \".set noat\"")); c = *args; if (*s == ' ') ++s; @@ -8746,7 +9159,6 @@ do_msbd: lastregno = regno; continue; } - notreg: switch (*args++) { case 'r': @@ -8799,40 +9211,22 @@ do_msbd: case 'R': /* floating point source register */ case 'V': case 'W': + rtype = RTYPE_FPU; + if (is_mdmx + || (mips_opts.ase_mdmx + && (ip->insn_mo->pinfo & FP_D) + && (ip->insn_mo->pinfo & (INSN_COPROC_MOVE_DELAY + | INSN_COPROC_MEMORY_DELAY + | INSN_LOAD_COPROC_DELAY + | INSN_LOAD_MEMORY_DELAY + | INSN_STORE_MEMORY)))) + rtype |= RTYPE_VEC; s_reset = s; - /* Accept $fN for FP and MDMX register numbers, and in - addition accept $vN for MDMX register numbers. */ - if ((s[0] == '$' && s[1] == 'f' && ISDIGIT (s[2])) - || (is_mdmx != 0 && s[0] == '$' && s[1] == 'v' - && ISDIGIT (s[2]))) + if (reg_lookup (&s, rtype, ®no)) { - s += 2; - regno = 0; - do - { - regno *= 10; - regno += *s - '0'; - ++s; - } - while (ISDIGIT (*s)); - - if (regno > 31) - as_bad (_("Invalid float register number (%d)"), regno); - if ((regno & 1) != 0 && HAVE_32BIT_FPRS - && ! (strcmp (str, "mtc1") == 0 - || strcmp (str, "mfc1") == 0 - || strcmp (str, "lwc1") == 0 - || strcmp (str, "swc1") == 0 - || strcmp (str, "l.s") == 0 - || strcmp (str, "s.s") == 0 - || strcmp (str, "mftc1") == 0 - || strcmp (str, "mfthc1") == 0 - || strcmp (str, "cftc1") == 0 - || strcmp (str, "mttc1") == 0 - || strcmp (str, "mtthc1") == 0 - || strcmp (str, "cttc1") == 0)) + && ! mips_oddfpreg_ok (ip->insn_mo, argnum)) as_warn (_("Float register should be even, was %d"), regno); @@ -9094,15 +9488,14 @@ do_msbd: break; } new_seg = subseg_new (newname, (subsegT) 0); - if (OUTPUT_FLAVOR == bfd_target_elf_flavour) + if (IS_ELF) bfd_set_section_flags (stdoutput, new_seg, (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA)); frag_align (*args == 'l' ? 2 : 3, 0, 0); - if (OUTPUT_FLAVOR == bfd_target_elf_flavour - && strcmp (TARGET_OS, "elf") != 0) + if (IS_ELF && strcmp (TARGET_OS, "elf") != 0) record_alignment (new_seg, 4); else record_alignment (new_seg, *args == 'l' ? 2 : 3); @@ -9220,19 +9613,11 @@ do_msbd: case 'N': /* 3 bit branch condition code */ case 'M': /* 3 bit compare condition code */ - if (strncmp (s, "$fcc", 4) != 0) + rtype = RTYPE_CCC; + if (ip->insn_mo->pinfo & (FP_D| FP_S)) + rtype |= RTYPE_FCC; + if (!reg_lookup (&s, rtype, ®no)) break; - s += 4; - regno = 0; - do - { - regno *= 10; - regno += *s - '0'; - ++s; - } - while (ISDIGIT (*s)); - if (regno > 7) - as_bad (_("Invalid condition code register $fcc%d"), regno); if ((strcmp(str + strlen(str) - 3, ".ps") == 0 || strcmp(str + strlen(str) - 5, "any2f") == 0 || strcmp(str + strlen(str) - 5, "any2t") == 0) @@ -9399,8 +9784,38 @@ mips16_ip (char *str, struct mips_cl_insn *ip) argsstart = s; for (;;) { + bfd_boolean ok; + assert (strcmp (insn->name, str) == 0); + if (OPCODE_IS_MEMBER (insn, mips_opts.isa, mips_opts.arch)) + ok = TRUE; + else + ok = FALSE; + + if (! ok) + { + if (insn + 1 < &mips16_opcodes[bfd_mips16_num_opcodes] + && strcmp (insn->name, insn[1].name) == 0) + { + ++insn; + continue; + } + else + { + if (!insn_error) + { + static char buf[100]; + sprintf (buf, + _("opcode not supported on this processor: %s (%s)"), + mips_cpu_info_from_arch (mips_opts.arch)->name, + mips_cpu_info_from_isa (mips_opts.isa)->name); + insn_error = buf; + } + return; + } + } + create_insn (ip, insn); imm_expr.X_op = O_absent; imm_reloc[0] = BFD_RELOC_UNUSED; @@ -9513,70 +9928,19 @@ mips16_ip (char *str, struct mips_cl_insn *ip) case 'R': case 'X': case 'Y': - if (s[0] != '$') - break; - s_reset = s; - if (ISDIGIT (s[1])) + s_reset = s; + if (!reg_lookup (&s, RTYPE_NUM | RTYPE_GP, ®no)) { - ++s; - regno = 0; - do + if (c == 'v' || c == 'w') { - regno *= 10; - regno += *s - '0'; - ++s; + if (c == 'v') + MIPS16_INSERT_OPERAND (RX, *ip, lastregno); + else + MIPS16_INSERT_OPERAND (RY, *ip, lastregno); + ++args; + continue; } - while (ISDIGIT (*s)); - if (regno > 31) - { - as_bad (_("invalid register number (%d)"), regno); - regno = 2; - } - } - else - { - if (s[1] == 'r' && s[2] == 'a') - { - s += 3; - regno = RA; - } - else if (s[1] == 'f' && s[2] == 'p') - { - s += 3; - regno = FP; - } - else if (s[1] == 's' && s[2] == 'p') - { - s += 3; - regno = SP; - } - else if (s[1] == 'g' && s[2] == 'p') - { - s += 3; - regno = GP; - } - else if (s[1] == 'a' && s[2] == 't') - { - s += 3; - regno = AT; - } - else if (s[1] == 'k' && s[2] == 't' && s[3] == '0') - { - s += 4; - regno = KT0; - } - else if (s[1] == 'k' && s[2] == 't' && s[3] == '1') - { - s += 4; - regno = KT1; - } - else if (s[1] == 'z' && s[2] == 'e' && s[3] == 'r' && s[4] == 'o') - { - s += 5; - regno = ZERO; - } - else - break; + break; } if (*s == ' ') @@ -9782,30 +10146,19 @@ mips16_ip (char *str, struct mips_cl_insn *ip) mask = 7 << 3; while (*s != '\0') { - int freg, reg1, reg2; + unsigned int freg, reg1, reg2; while (*s == ' ' || *s == ',') ++s; - if (*s != '$') + if (reg_lookup (&s, RTYPE_GP | RTYPE_NUM, ®1)) + freg = 0; + else if (reg_lookup (&s, RTYPE_FPU, ®1)) + freg = 1; + else { as_bad (_("can't parse register list")); break; } - ++s; - if (*s != 'f') - freg = 0; - else - { - freg = 1; - ++s; - } - reg1 = 0; - while (ISDIGIT (*s)) - { - reg1 *= 10; - reg1 += *s - '0'; - ++s; - } if (*s == ' ') ++s; if (*s != '-') @@ -9813,25 +10166,11 @@ mips16_ip (char *str, struct mips_cl_insn *ip) else { ++s; - if (*s != '$') - break; - ++s; - if (freg) + if (!reg_lookup (&s, freg ? RTYPE_FPU + : (RTYPE_GP | RTYPE_NUM), ®2)) { - if (*s == 'f') - ++s; - else - { - as_bad (_("invalid register list")); - break; - } - } - reg2 = 0; - while (ISDIGIT (*s)) - { - reg2 *= 10; - reg2 += *s - '0'; - ++s; + as_bad (_("invalid register list")); + break; } } if (freg && reg1 == 0 && reg2 == 0 && c == 'L') @@ -9896,46 +10235,33 @@ mips16_ip (char *str, struct mips_cl_insn *ip) continue; } - if (*s != '$') + if (! reg_lookup (&s, RTYPE_GP | RTYPE_NUM, ®1)) { as_bad (_("can't parse register list")); break; } - ++s; - reg1 = 0; - while (ISDIGIT (*s)) - { - reg1 *= 10; - reg1 += *s - '0'; - ++s; - } - SKIP_SPACE_TABS (s); + while (*s == ' ') + ++s; + if (*s != '-') reg2 = reg1; else { ++s; - if (*s != '$') + if (! reg_lookup (&s, RTYPE_GP | RTYPE_NUM, ®2) + || reg2 < reg1) { as_bad (_("can't parse register list")); break; } - ++s; - reg2 = 0; - while (ISDIGIT (*s)) - { - reg2 *= 10; - reg2 += *s - '0'; - ++s; - } } while (reg1 <= reg2) { if (reg1 >= 4 && reg1 <= 7) { - if (c == 'm' && !seen_framesz) + if (!seen_framesz) /* args $a0-$a3 */ args |= 1 << (reg1 - 4); else @@ -10147,7 +10473,7 @@ mips16_immed (char *file, unsigned int line, int type, offsetT val, unsigned long *insn, bfd_boolean *use_extend, unsigned short *extend) { - register const struct mips16_immed_operand *op; + const struct mips16_immed_operand *op; int mintiny, maxtiny; bfd_boolean needext; @@ -10557,9 +10883,17 @@ struct option md_longopts[] = {"mmt", no_argument, NULL, OPTION_MT}, #define OPTION_NO_MT (OPTION_ASE_BASE + 9) {"mno-mt", no_argument, NULL, OPTION_NO_MT}, +#define OPTION_SMARTMIPS (OPTION_ASE_BASE + 10) + {"msmartmips", no_argument, NULL, OPTION_SMARTMIPS}, +#define OPTION_NO_SMARTMIPS (OPTION_ASE_BASE + 11) + {"mno-smartmips", no_argument, NULL, OPTION_NO_SMARTMIPS}, +#define OPTION_DSPR2 (OPTION_ASE_BASE + 12) + {"mdspr2", no_argument, NULL, OPTION_DSPR2}, +#define OPTION_NO_DSPR2 (OPTION_ASE_BASE + 13) + {"mno-dspr2", no_argument, NULL, OPTION_NO_DSPR2}, /* Old-style architecture options. Don't add more of these. */ -#define OPTION_COMPAT_ARCH_BASE (OPTION_ASE_BASE + 10) +#define OPTION_COMPAT_ARCH_BASE (OPTION_ASE_BASE + 14) #define OPTION_M4650 (OPTION_COMPAT_ARCH_BASE + 0) {"m4650", no_argument, NULL, OPTION_M4650}, #define OPTION_NO_M4650 (OPTION_COMPAT_ARCH_BASE + 1) @@ -10711,7 +11045,7 @@ md_parse_option (int c, char *arg) break; case 'O': - if (arg && arg[1] == '0') + if (arg && arg[0] == '0') mips_optimize = 1; else mips_optimize = 2; @@ -10722,11 +11056,6 @@ md_parse_option (int c, char *arg) mips_debug = 2; else mips_debug = atoi (arg); - /* When the MIPS assembler sees -g or -g2, it does not do - optimizations which limit full symbolic debugging. We take - that to be equivalent to -O0. */ - if (mips_debug == 2) - mips_optimize = 1; break; case OPTION_MIPS1: @@ -10815,9 +11144,21 @@ md_parse_option (int c, char *arg) case OPTION_DSP: mips_opts.ase_dsp = 1; + mips_opts.ase_dspr2 = 0; break; case OPTION_NO_DSP: + mips_opts.ase_dsp = 0; + mips_opts.ase_dspr2 = 0; + break; + + case OPTION_DSPR2: + mips_opts.ase_dspr2 = 1; + mips_opts.ase_dsp = 1; + break; + + case OPTION_NO_DSPR2: + mips_opts.ase_dspr2 = 0; mips_opts.ase_dsp = 0; break; @@ -10847,6 +11188,14 @@ md_parse_option (int c, char *arg) mips_opts.ase_mips3d = 0; break; + case OPTION_SMARTMIPS: + mips_opts.ase_smartmips = 1; + break; + + case OPTION_NO_SMARTMIPS: + mips_opts.ase_smartmips = 0; + break; + case OPTION_FIX_VR4120: mips_fix_vr4120 = 1; break; @@ -10892,7 +11241,7 @@ md_parse_option (int c, char *arg) select SVR4_PIC, and -non_shared to select no PIC. This is intended to be compatible with Irix 5. */ case OPTION_CALL_SHARED: - if (OUTPUT_FLAVOR != bfd_target_elf_flavour) + if (!IS_ELF) { as_bad (_("-call_shared is supported only for ELF format")); return 0; @@ -10902,7 +11251,7 @@ md_parse_option (int c, char *arg) break; case OPTION_NON_SHARED: - if (OUTPUT_FLAVOR != bfd_target_elf_flavour) + if (!IS_ELF) { as_bad (_("-non_shared is supported only for ELF format")); return 0; @@ -10928,7 +11277,7 @@ md_parse_option (int c, char *arg) /* The -32, -n32 and -64 options are shortcuts for -mabi=32, -mabi=n32 and -mabi=64. */ case OPTION_32: - if (OUTPUT_FLAVOR != bfd_target_elf_flavour) + if (!IS_ELF) { as_bad (_("-32 is supported for ELF format only")); return 0; @@ -10937,7 +11286,7 @@ md_parse_option (int c, char *arg) break; case OPTION_N32: - if (OUTPUT_FLAVOR != bfd_target_elf_flavour) + if (!IS_ELF) { as_bad (_("-n32 is supported for ELF format only")); return 0; @@ -10946,13 +11295,13 @@ md_parse_option (int c, char *arg) break; case OPTION_64: - if (OUTPUT_FLAVOR != bfd_target_elf_flavour) + if (!IS_ELF) { as_bad (_("-64 is supported for ELF format only")); return 0; } mips_abi = N64_ABI; - if (! support_64bit_objects()) + if (!support_64bit_objects()) as_fatal (_("No compiled in support for 64 bit object file format")); break; #endif /* OBJ_ELF */ @@ -10975,7 +11324,7 @@ md_parse_option (int c, char *arg) #ifdef OBJ_ELF case OPTION_MABI: - if (OUTPUT_FLAVOR != bfd_target_elf_flavour) + if (!IS_ELF) { as_bad (_("-mabi is supported for ELF format only")); return 0; @@ -11147,14 +11496,43 @@ mips_after_parse_args (void) || !ISA_HAS_64BIT_REGS (mips_opts.isa)); } - /* ??? GAS treats single-float processors as though they had 64-bit - float registers (although it complains when double-precision - instructions are used). As things stand, saying they have 32-bit - registers would lead to spurious "register must be even" messages. - So here we assume float registers are always the same size as - integer ones, unless the user says otherwise. */ - if (file_mips_fp32 < 0) - file_mips_fp32 = file_mips_gp32; + switch (file_mips_fp32) + { + default: + case -1: + /* No user specified float register size. + ??? GAS treats single-float processors as though they had 64-bit + float registers (although it complains when double-precision + instructions are used). As things stand, saying they have 32-bit + registers would lead to spurious "register must be even" messages. + So here we assume float registers are never smaller than the + integer ones. */ + if (file_mips_gp32 == 0) + /* 64-bit integer registers implies 64-bit float registers. */ + file_mips_fp32 = 0; + else if ((mips_opts.ase_mips3d > 0 || mips_opts.ase_mdmx > 0) + && ISA_HAS_64BIT_FPRS (mips_opts.isa)) + /* -mips3d and -mdmx imply 64-bit float registers, if possible. */ + file_mips_fp32 = 0; + else + /* 32-bit float registers. */ + file_mips_fp32 = 1; + break; + + /* The user specified the size of the float registers. Check if it + agrees with the ABI and ISA. */ + case 0: + if (!ISA_HAS_64BIT_FPRS (mips_opts.isa)) + as_bad (_("-mfp64 used with a 32-bit fpu")); + else if (ABI_NEEDS_32BIT_REGS (mips_abi) + && !ISA_HAS_MXHC1 (mips_opts.isa)) + as_warn (_("-mfp64 used with a 32-bit ABI")); + break; + case 1: + if (ABI_NEEDS_64BIT_REGS (mips_abi)) + as_warn (_("-mfp32 used with a 64-bit ABI")); + break; + } /* End of GCC-shared inference code. */ @@ -11173,19 +11551,51 @@ mips_after_parse_args (void) if (mips_opts.mips16 == -1) mips_opts.mips16 = (CPU_HAS_MIPS16 (file_mips_arch)) ? 1 : 0; if (mips_opts.ase_mips3d == -1) - mips_opts.ase_mips3d = (CPU_HAS_MIPS3D (file_mips_arch)) ? 1 : 0; + mips_opts.ase_mips3d = ((arch_info->flags & MIPS_CPU_ASE_MIPS3D) + && file_mips_fp32 == 0) ? 1 : 0; + if (mips_opts.ase_mips3d && file_mips_fp32 == 1) + as_bad (_("-mfp32 used with -mips3d")); + if (mips_opts.ase_mdmx == -1) - mips_opts.ase_mdmx = (CPU_HAS_MDMX (file_mips_arch)) ? 1 : 0; + mips_opts.ase_mdmx = ((arch_info->flags & MIPS_CPU_ASE_MDMX) + && file_mips_fp32 == 0) ? 1 : 0; + if (mips_opts.ase_mdmx && file_mips_fp32 == 1) + as_bad (_("-mfp32 used with -mdmx")); + + if (mips_opts.ase_smartmips == -1) + mips_opts.ase_smartmips = (arch_info->flags & MIPS_CPU_ASE_SMARTMIPS) ? 1 : 0; + if (mips_opts.ase_smartmips && !ISA_SUPPORTS_SMARTMIPS) + as_warn ("%s ISA does not support SmartMIPS", + mips_cpu_info_from_isa (mips_opts.isa)->name); + if (mips_opts.ase_dsp == -1) - mips_opts.ase_dsp = (CPU_HAS_DSP (file_mips_arch)) ? 1 : 0; + mips_opts.ase_dsp = (arch_info->flags & MIPS_CPU_ASE_DSP) ? 1 : 0; + if (mips_opts.ase_dsp && !ISA_SUPPORTS_DSP_ASE) + as_warn ("%s ISA does not support DSP ASE", + mips_cpu_info_from_isa (mips_opts.isa)->name); + + if (mips_opts.ase_dspr2 == -1) + { + mips_opts.ase_dspr2 = (arch_info->flags & MIPS_CPU_ASE_DSPR2) ? 1 : 0; + mips_opts.ase_dsp = (arch_info->flags & MIPS_CPU_ASE_DSP) ? 1 : 0; + } + if (mips_opts.ase_dspr2 && !ISA_SUPPORTS_DSPR2_ASE) + as_warn ("%s ISA does not support DSP R2 ASE", + mips_cpu_info_from_isa (mips_opts.isa)->name); + if (mips_opts.ase_mt == -1) - mips_opts.ase_mt = (CPU_HAS_MT (file_mips_arch)) ? 1 : 0; + mips_opts.ase_mt = (arch_info->flags & MIPS_CPU_ASE_MT) ? 1 : 0; + if (mips_opts.ase_mt && !ISA_SUPPORTS_MT_ASE) + as_warn ("%s ISA does not support MT ASE", + mips_cpu_info_from_isa (mips_opts.isa)->name); file_mips_isa = mips_opts.isa; file_ase_mips16 = mips_opts.mips16; file_ase_mips3d = mips_opts.ase_mips3d; file_ase_mdmx = mips_opts.ase_mdmx; + file_ase_smartmips = mips_opts.ase_smartmips; file_ase_dsp = mips_opts.ase_dsp; + file_ase_dspr2 = mips_opts.ase_dspr2; file_ase_mt = mips_opts.ase_mt; mips_opts.gp32 = file_mips_gp32; mips_opts.fp32 = file_mips_fp32; @@ -11220,6 +11630,10 @@ md_pcrel_from (fixS *fixP) /* Return the address of the delay slot. */ return addr + 4; default: + /* We have no relocation type for PC relative MIPS16 instructions. */ + if (fixP->fx_addsy && S_GET_SEGMENT (fixP->fx_addsy) != now_seg) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("PC relative MIPS16 instruction references a different section")); return addr; } } @@ -11402,11 +11816,12 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) || fixP->fx_r_type == BFD_RELOC_CTOR || fixP->fx_r_type == BFD_RELOC_MIPS_SUB || fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT - || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY); + || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY + || fixP->fx_r_type == BFD_RELOC_MIPS_TLS_DTPREL64); buf = (bfd_byte *) (fixP->fx_frag->fr_literal + fixP->fx_where); - assert (! fixP->fx_pcrel || fixP->fx_r_type == BFD_RELOC_16_PCREL_S2); + assert (!fixP->fx_pcrel || fixP->fx_r_type == BFD_RELOC_16_PCREL_S2); /* Don't treat parts of a composite relocation as done. There are two reasons for this: @@ -11418,13 +11833,15 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) constants. The easiest way of dealing with the pathological exceptions is to generate a relocation against STN_UNDEF and leave everything up to the linker. */ - if (fixP->fx_addsy == NULL && ! fixP->fx_pcrel && fixP->fx_tcbit == 0) + if (fixP->fx_addsy == NULL && !fixP->fx_pcrel && fixP->fx_tcbit == 0) fixP->fx_done = 1; switch (fixP->fx_r_type) { case BFD_RELOC_MIPS_TLS_GD: case BFD_RELOC_MIPS_TLS_LDM: + case BFD_RELOC_MIPS_TLS_DTPREL32: + case BFD_RELOC_MIPS_TLS_DTPREL64: case BFD_RELOC_MIPS_TLS_DTPREL_HI16: case BFD_RELOC_MIPS_TLS_DTPREL_LO16: case BFD_RELOC_MIPS_TLS_GOTTPREL: @@ -11463,14 +11880,8 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) case BFD_RELOC_MIPS16_GPREL: case BFD_RELOC_MIPS16_HI16: case BFD_RELOC_MIPS16_HI16_S: - /* Nothing needed to do. The value comes from the reloc entry */ - break; - case BFD_RELOC_MIPS16_JMP: - /* We currently always generate a reloc against a symbol, which - means that we don't want an addend even if the symbol is - defined. */ - *valP = 0; + /* Nothing needed to do. The value comes from the reloc entry. */ break; case BFD_RELOC_64: @@ -11498,18 +11909,12 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) case BFD_RELOC_RVA: case BFD_RELOC_32: - /* If we are deleting this reloc entry, we must fill in the - value now. This can happen if we have a .word which is not - resolved when it appears but is later defined. */ - if (fixP->fx_done) - md_number_to_chars ((char *) buf, *valP, 4); - break; - case BFD_RELOC_16: /* If we are deleting this reloc entry, we must fill in the - value now. */ + value now. This can happen if we have a .word which is not + resolved when it appears but is later defined. */ if (fixP->fx_done) - md_number_to_chars ((char *) buf, *valP, 2); + md_number_to_chars ((char *) buf, *valP, fixP->fx_size); break; case BFD_RELOC_LO16: @@ -11534,15 +11939,13 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) as_bad_where (fixP->fx_file, fixP->fx_line, _("Branch to misaligned address (%lx)"), (long) *valP); - /* - * We need to save the bits in the instruction since fixup_segment() - * might be deleting the relocation entry (i.e., a branch within - * the current segment). - */ + /* We need to save the bits in the instruction since fixup_segment() + might be deleting the relocation entry (i.e., a branch within + the current segment). */ if (! fixP->fx_done) break; - /* update old instruction data */ + /* Update old instruction data. */ if (target_big_endian) insn = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; else @@ -11642,21 +12045,17 @@ mips_align (int to, int fill, symbolS *label) static void s_align (int x ATTRIBUTE_UNUSED) { - register int temp; - register long temp_fill; + int temp; + long temp_fill; long max_alignment = 15; - /* - - o Note that the assembler pulls down any immediately preceding label + /* o Note that the assembler pulls down any immediately preceding label to the aligned address. - o It's not documented but auto alignment is reinstated by + o It's not documented but auto alignment is reinstated by a .align pseudo instruction. - o Note also that after auto alignment is turned off the mips assembler + o Note also that after auto alignment is turned off the mips assembler issues an error on attempt to assemble an improperly aligned data item. - We don't. - - */ + We don't. */ temp = get_absolute_expression (); if (temp > max_alignment) @@ -11675,9 +12074,11 @@ s_align (int x ATTRIBUTE_UNUSED) temp_fill = 0; if (temp) { + segment_info_type *si = seg_info (now_seg); + struct insn_label_list *l = si->label_list; + /* Auto alignment should be switched on by next section change. */ auto_align = 1; - mips_align (temp, (int) temp_fill, - insn_labels != NULL ? insn_labels->label : NULL); + mips_align (temp, (int) temp_fill, l != NULL ? l->label : NULL); } else { @@ -11699,7 +12100,8 @@ s_change_sec (int sec) as it would not be appropriate to use it in the section changing functions in read.c, since obj-elf.c intercepts those. FIXME: This should be cleaner, somehow. */ - obj_elf_section_change_hook (); + if (IS_ELF) + obj_elf_section_change_hook (); #endif mips_emit_delays (); @@ -11719,7 +12121,7 @@ s_change_sec (int sec) case 'r': seg = subseg_new (RDATA_SECTION_NAME, (subsegT) get_absolute_expression ()); - if (OUTPUT_FLAVOR == bfd_target_elf_flavour) + if (IS_ELF) { bfd_set_section_flags (stdoutput, seg, (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_RELOC @@ -11732,7 +12134,7 @@ s_change_sec (int sec) case 's': seg = subseg_new (".sdata", (subsegT) get_absolute_expression ()); - if (OUTPUT_FLAVOR == bfd_target_elf_flavour) + if (IS_ELF) { bfd_set_section_flags (stdoutput, seg, SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA); @@ -11758,7 +12160,7 @@ s_change_section (int ignore ATTRIBUTE_UNUSED) int section_entry_size; int section_alignment; - if (OUTPUT_FLAVOR != bfd_target_elf_flavour) + if (!IS_ELF) return; section_name = input_line_pointer; @@ -11803,7 +12205,7 @@ s_change_section (int ignore ATTRIBUTE_UNUSED) There's nothing really harmful in this, since bfd will correct SHT_PROGBITS to SHT_MIPS_DWARF before writing out the file. But it - means that, for backwards compatibiltiy, the special_section entries + means that, for backwards compatibility, the special_section entries for dwarf sections must use SHT_PROGBITS rather than SHT_MIPS_DWARF. Even so, we shouldn't force users of the MIPS .section syntax to @@ -11830,9 +12232,11 @@ mips_enable_auto_align (void) static void s_cons (int log_size) { + segment_info_type *si = seg_info (now_seg); + struct insn_label_list *l = si->label_list; symbolS *label; - label = insn_labels != NULL ? insn_labels->label : NULL; + label = l != NULL ? l->label : NULL; mips_emit_delays (); if (log_size > 0 && auto_align) mips_align (log_size, 0, label); @@ -11843,9 +12247,11 @@ s_cons (int log_size) static void s_float_cons (int type) { + segment_info_type *si = seg_info (now_seg); + struct insn_label_list *l = si->label_list; symbolS *label; - label = insn_labels != NULL ? insn_labels->label : NULL; + label = l != NULL ? l->label : NULL; mips_emit_delays (); @@ -12032,12 +12438,43 @@ s_mipsset (int x ATTRIBUTE_UNUSED) { mips_opts.nobopt = 1; } + else if (strcmp (name, "gp=default") == 0) + mips_opts.gp32 = file_mips_gp32; + else if (strcmp (name, "gp=32") == 0) + mips_opts.gp32 = 1; + else if (strcmp (name, "gp=64") == 0) + { + if (!ISA_HAS_64BIT_REGS (mips_opts.isa)) + as_warn ("%s isa does not support 64-bit registers", + mips_cpu_info_from_isa (mips_opts.isa)->name); + mips_opts.gp32 = 0; + } + else if (strcmp (name, "fp=default") == 0) + mips_opts.fp32 = file_mips_fp32; + else if (strcmp (name, "fp=32") == 0) + mips_opts.fp32 = 1; + else if (strcmp (name, "fp=64") == 0) + { + if (!ISA_HAS_64BIT_FPRS (mips_opts.isa)) + as_warn ("%s isa does not support 64-bit floating point registers", + mips_cpu_info_from_isa (mips_opts.isa)->name); + mips_opts.fp32 = 0; + } else if (strcmp (name, "mips16") == 0 || strcmp (name, "MIPS-16") == 0) mips_opts.mips16 = 1; else if (strcmp (name, "nomips16") == 0 || strcmp (name, "noMIPS-16") == 0) mips_opts.mips16 = 0; + else if (strcmp (name, "smartmips") == 0) + { + if (!ISA_SUPPORTS_SMARTMIPS) + as_warn ("%s ISA does not support SmartMIPS ASE", + mips_cpu_info_from_isa (mips_opts.isa)->name); + mips_opts.ase_smartmips = 1; + } + else if (strcmp (name, "nosmartmips") == 0) + mips_opts.ase_smartmips = 0; else if (strcmp (name, "mips3d") == 0) mips_opts.ase_mips3d = 1; else if (strcmp (name, "nomips3d") == 0) @@ -12047,11 +12484,38 @@ s_mipsset (int x ATTRIBUTE_UNUSED) else if (strcmp (name, "nomdmx") == 0) mips_opts.ase_mdmx = 0; else if (strcmp (name, "dsp") == 0) - mips_opts.ase_dsp = 1; + { + if (!ISA_SUPPORTS_DSP_ASE) + as_warn ("%s ISA does not support DSP ASE", + mips_cpu_info_from_isa (mips_opts.isa)->name); + mips_opts.ase_dsp = 1; + mips_opts.ase_dspr2 = 0; + } else if (strcmp (name, "nodsp") == 0) - mips_opts.ase_dsp = 0; + { + mips_opts.ase_dsp = 0; + mips_opts.ase_dspr2 = 0; + } + else if (strcmp (name, "dspr2") == 0) + { + if (!ISA_SUPPORTS_DSPR2_ASE) + as_warn ("%s ISA does not support DSP R2 ASE", + mips_cpu_info_from_isa (mips_opts.isa)->name); + mips_opts.ase_dspr2 = 1; + mips_opts.ase_dsp = 1; + } + else if (strcmp (name, "nodspr2") == 0) + { + mips_opts.ase_dspr2 = 0; + mips_opts.ase_dsp = 0; + } else if (strcmp (name, "mt") == 0) - mips_opts.ase_mt = 1; + { + if (!ISA_SUPPORTS_MT_ASE) + as_warn ("%s ISA does not support MT ASE", + mips_cpu_info_from_isa (mips_opts.isa)->name); + mips_opts.ase_mt = 1; + } else if (strcmp (name, "nomt") == 0) mips_opts.ase_mt = 0; else if (strncmp (name, "mips", 4) == 0 || strncmp (name, "arch=", 5) == 0) @@ -12162,6 +12626,14 @@ s_mipsset (int x ATTRIBUTE_UNUSED) mips_opts.sym32 = TRUE; else if (strcmp (name, "nosym32") == 0) mips_opts.sym32 = FALSE; + else if (strchr (name, ',')) + { + /* Generic ".set" directive; use the generic handler. */ + *input_line_pointer = ch; + input_line_pointer = name; + s_set (0); + return; + } else { as_warn (_("Tried to set unrecognized symbol: %s\n"), name); @@ -12269,8 +12741,7 @@ s_cpload (int ignore ATTRIBUTE_UNUSED) The -mno-shared option replaces the last three instructions with lui $gp,%hi(_gp) - addiu $gp,$gp,%lo(_gp) - */ + addiu $gp,$gp,%lo(_gp) */ static void s_cpsetup (int ignore ATTRIBUTE_UNUSED) @@ -12372,7 +12843,7 @@ static void s_cplocal (int ignore ATTRIBUTE_UNUSED) { /* If we are not generating SVR4 PIC code, or if this is not NewABI code, - .cplocal is ignored. */ + .cplocal is ignored. */ if (mips_pic != SVR4_PIC || ! HAVE_NEWABI) { s_ignore (0); @@ -12421,8 +12892,8 @@ s_cprestore (int ignore ATTRIBUTE_UNUSED) ld $gp, offset($sp) If a register $reg2 was given there, it results in: - daddu $gp, $reg2, $0 - */ + daddu $gp, $reg2, $0 */ + static void s_cpreturn (int ignore ATTRIBUTE_UNUSED) { @@ -12454,6 +12925,52 @@ s_cpreturn (int ignore ATTRIBUTE_UNUSED) demand_empty_rest_of_line (); } +/* Handle the .dtprelword and .dtpreldword pseudo-ops. They generate + a 32-bit or 64-bit DTP-relative relocation (BYTES says which) for + use in DWARF debug information. */ + +static void +s_dtprel_internal (size_t bytes) +{ + expressionS ex; + char *p; + + expression (&ex); + + if (ex.X_op != O_symbol) + { + as_bad (_("Unsupported use of %s"), (bytes == 8 + ? ".dtpreldword" + : ".dtprelword")); + ignore_rest_of_line (); + } + + p = frag_more (bytes); + md_number_to_chars (p, 0, bytes); + fix_new_exp (frag_now, p - frag_now->fr_literal, bytes, &ex, FALSE, + (bytes == 8 + ? BFD_RELOC_MIPS_TLS_DTPREL64 + : BFD_RELOC_MIPS_TLS_DTPREL32)); + + demand_empty_rest_of_line (); +} + +/* Handle .dtprelword. */ + +static void +s_dtprelword (int ignore ATTRIBUTE_UNUSED) +{ + s_dtprel_internal (4); +} + +/* Handle .dtpreldword. */ + +static void +s_dtpreldword (int ignore ATTRIBUTE_UNUSED) +{ + s_dtprel_internal (8); +} + /* Handle the .gpvalue pseudo-op. This is used when generating NewABI PIC code. It sets the offset to use in gp_rel relocations. */ @@ -12479,6 +12996,8 @@ s_gpvalue (int ignore ATTRIBUTE_UNUSED) static void s_gpword (int ignore ATTRIBUTE_UNUSED) { + segment_info_type *si; + struct insn_label_list *l; symbolS *label; expressionS ex; char *p; @@ -12490,7 +13009,9 @@ s_gpword (int ignore ATTRIBUTE_UNUSED) return; } - label = insn_labels != NULL ? insn_labels->label : NULL; + si = seg_info (now_seg); + l = si->label_list; + label = l != NULL ? l->label : NULL; mips_emit_delays (); if (auto_align) mips_align (2, 0, label); @@ -12515,6 +13036,8 @@ s_gpword (int ignore ATTRIBUTE_UNUSED) static void s_gpdword (int ignore ATTRIBUTE_UNUSED) { + segment_info_type *si; + struct insn_label_list *l; symbolS *label; expressionS ex; char *p; @@ -12526,7 +13049,9 @@ s_gpdword (int ignore ATTRIBUTE_UNUSED) return; } - label = insn_labels != NULL ? insn_labels->label : NULL; + si = seg_info (now_seg); + l = si->label_list; + label = l != NULL ? l->label : NULL; mips_emit_delays (); if (auto_align) mips_align (3, 0, label); @@ -12608,8 +13133,7 @@ s_mips_stab (int type) s_stab (type); } -/* Handle the .weakext pseudo-op as defined in Kane and Heinrich. - */ +/* Handle the .weakext pseudo-op as defined in Kane and Heinrich. */ static void s_mips_weakext (int ignore ATTRIBUTE_UNUSED) @@ -12663,73 +13187,11 @@ s_mips_weakext (int ignore ATTRIBUTE_UNUSED) int tc_get_register (int frame) { - int reg; + unsigned int reg; SKIP_WHITESPACE (); - if (*input_line_pointer++ != '$') - { - as_warn (_("expected `$'")); - reg = ZERO; - } - else if (ISDIGIT (*input_line_pointer)) - { - reg = get_absolute_expression (); - if (reg < 0 || reg >= 32) - { - as_warn (_("Bad register number")); - reg = ZERO; - } - } - else - { - if (strncmp (input_line_pointer, "ra", 2) == 0) - { - reg = RA; - input_line_pointer += 2; - } - else if (strncmp (input_line_pointer, "fp", 2) == 0) - { - reg = FP; - input_line_pointer += 2; - } - else if (strncmp (input_line_pointer, "sp", 2) == 0) - { - reg = SP; - input_line_pointer += 2; - } - else if (strncmp (input_line_pointer, "gp", 2) == 0) - { - reg = GP; - input_line_pointer += 2; - } - else if (strncmp (input_line_pointer, "at", 2) == 0) - { - reg = AT; - input_line_pointer += 2; - } - else if (strncmp (input_line_pointer, "kt0", 3) == 0) - { - reg = KT0; - input_line_pointer += 3; - } - else if (strncmp (input_line_pointer, "kt1", 3) == 0) - { - reg = KT1; - input_line_pointer += 3; - } - else if (strncmp (input_line_pointer, "zero", 4) == 0) - { - reg = ZERO; - input_line_pointer += 4; - } - else - { - as_warn (_("Unrecognized register name")); - reg = ZERO; - while (ISALNUM(*input_line_pointer)) - input_line_pointer++; - } - } + if (! reg_lookup (&input_line_pointer, RWARN | RTYPE_NUM | RTYPE_GP, ®)) + reg = 0; if (frame) { mips_frame_reg = reg != 0 ? reg : SP; @@ -12744,16 +13206,17 @@ md_section_align (asection *seg, valueT addr) { int align = bfd_get_section_alignment (stdoutput, seg); -#ifdef OBJ_ELF - /* We don't need to align ELF sections to the full alignment. - However, Irix 5 may prefer that we align them at least to a 16 - byte boundary. We don't bother to align the sections if we are - targeted for an embedded system. */ - if (strcmp (TARGET_OS, "elf") == 0) - return addr; - if (align > 4) - align = 4; -#endif + if (IS_ELF) + { + /* We don't need to align ELF sections to the full alignment. + However, Irix 5 may prefer that we align them at least to a 16 + byte boundary. We don't bother to align the sections if we + are targeted for an embedded system. */ + if (strcmp (TARGET_OS, "elf") == 0) + return addr; + if (align > 4) + align = 4; + } return ((addr + (1 << align) - 1) & (-1 << align)); } @@ -12819,6 +13282,8 @@ nopic_need_relax (symbolS *sym, int before_relaxing) change = (strcmp (segname, ".sdata") != 0 && strcmp (segname, ".sbss") != 0 && strncmp (segname, ".sdata.", 7) != 0 + && strncmp (segname, ".sbss.", 6) != 0 + && strncmp (segname, ".gnu.linkonce.sb.", 17) != 0 && strncmp (segname, ".gnu.linkonce.s.", 16) != 0); } return change; @@ -12835,48 +13300,32 @@ static bfd_boolean pic_need_relax (symbolS *sym, asection *segtype) { asection *symsec; - bfd_boolean linkonce; /* Handle the case of a symbol equated to another symbol. */ while (symbol_equated_reloc_p (sym)) { symbolS *n; - /* It's possible to get a loop here in a badly written - program. */ + /* It's possible to get a loop here in a badly written program. */ n = symbol_get_value_expression (sym)->X_add_symbol; if (n == sym) break; sym = n; } + if (symbol_section_p (sym)) + return TRUE; + symsec = S_GET_SEGMENT (sym); - /* duplicate the test for LINK_ONCE sections as in adjust_reloc_syms */ - linkonce = FALSE; - if (symsec != segtype && ! S_IS_LOCAL (sym)) - { - if ((bfd_get_section_flags (stdoutput, symsec) & SEC_LINK_ONCE) - != 0) - linkonce = TRUE; - - /* The GNU toolchain uses an extension for ELF: a section - beginning with the magic string .gnu.linkonce is a linkonce - section. */ - if (strncmp (segment_name (symsec), ".gnu.linkonce", - sizeof ".gnu.linkonce" - 1) == 0) - linkonce = TRUE; - } - /* This must duplicate the test in adjust_reloc_syms. */ return (symsec != &bfd_und_section && symsec != &bfd_abs_section - && ! bfd_is_com_section (symsec) - && !linkonce + && !bfd_is_com_section (symsec) + && !s_is_linkonce (sym, segtype) #ifdef OBJ_ELF /* A global or weak symbol is treated as external. */ - && (OUTPUT_FLAVOR != bfd_target_elf_flavour - || (! S_IS_WEAK (sym) && ! S_IS_EXTERNAL (sym))) + && (!IS_ELF || (! S_IS_WEAK (sym) && ! S_IS_EXTERNAL (sym))) #endif ); } @@ -12889,7 +13338,7 @@ static int mips16_extended_frag (fragS *fragp, asection *sec, long stretch) { int type; - register const struct mips16_immed_operand *op; + const struct mips16_immed_operand *op; offsetT val; int mintiny, maxtiny; segT symsec; @@ -13192,11 +13641,6 @@ md_estimate_size_before_relax (fragS *fragp, asection *segtype) int mips_fix_adjustable (fixS *fixp) { - /* Don't adjust MIPS16 jump relocations, so we don't have to worry - about the format of the offset in the .o file. */ - if (fixp->fx_r_type == BFD_RELOC_MIPS16_JMP) - return 0; - if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY) return 0; @@ -13226,11 +13670,50 @@ mips_fix_adjustable (fixS *fixp) return 0; #ifdef OBJ_ELF - /* Don't adjust relocations against mips16 symbols, so that the linker - can find them if it needs to set up a stub. */ - if (OUTPUT_FLAVOR == bfd_target_elf_flavour - && S_GET_OTHER (fixp->fx_addsy) == STO_MIPS16 - && fixp->fx_subsy == NULL) + /* R_MIPS16_26 relocations against non-MIPS16 functions might resolve + to a floating-point stub. The same is true for non-R_MIPS16_26 + relocations against MIPS16 functions; in this case, the stub becomes + the function's canonical address. + + Floating-point stubs are stored in unique .mips16.call.* or + .mips16.fn.* sections. If a stub T for function F is in section S, + the first relocation in section S must be against F; this is how the + linker determines the target function. All relocations that might + resolve to T must also be against F. We therefore have the following + restrictions, which are given in an intentionally-redundant way: + + 1. We cannot reduce R_MIPS16_26 relocations against non-MIPS16 + symbols. + + 2. We cannot reduce a stub's relocations against non-MIPS16 symbols + if that stub might be used. + + 3. We cannot reduce non-R_MIPS16_26 relocations against MIPS16 + symbols. + + 4. We cannot reduce a stub's relocations against MIPS16 symbols if + that stub might be used. + + There is a further restriction: + + 5. We cannot reduce R_MIPS16_26 relocations against MIPS16 symbols + on targets with in-place addends; the relocation field cannot + encode the low bit. + + For simplicity, we deal with (3)-(5) by not reducing _any_ relocation + against a MIPS16 symbol. + + We deal with (1)-(2) by saying that, if there's a R_MIPS16_26 + relocation against some symbol R, no relocation against R may be + reduced. (Note that this deals with (2) as well as (1) because + relocations against global symbols will never be reduced on ELF + targets.) This approach is a little simpler than trying to detect + stub sections, and gives the "all or nothing" per-symbol consistency + that we have for MIPS16 symbols. */ + if (IS_ELF + && fixp->fx_subsy == NULL + && (S_GET_OTHER (fixp->fx_addsy) == STO_MIPS16 + || *symbol_get_tc (fixp->fx_addsy))) return 0; #endif @@ -13260,7 +13743,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp) /* At this point, fx_addnumber is "symbol offset - pcrel address". Relocations want only the symbol offset. */ reloc->addend = fixp->fx_addnumber + reloc->address; - if (OUTPUT_FLAVOR != bfd_target_elf_flavour) + if (!IS_ELF) { /* A gruesome hack which is a result of the gruesome gas reloc handling. What's worse, for COFF (as opposed to @@ -13359,7 +13842,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) exp.X_add_number = fragp->fr_offset; fixp = fix_new_exp (fragp, buf - (bfd_byte *)fragp->fr_literal, - 4, &exp, 1, BFD_RELOC_16_PCREL_S2); + 4, &exp, TRUE, BFD_RELOC_16_PCREL_S2); fixp->fx_file = fragp->fr_file; fixp->fx_line = fragp->fr_line; @@ -13391,14 +13874,14 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) case 0: /* bltz 0x04000000 bgez 0x04010000 - bltzal 0x04100000 bgezal 0x04110000 */ + bltzal 0x04100000 bgezal 0x04110000 */ assert ((insn & 0xfc0e0000) == 0x04000000); insn ^= 0x00010000; break; case 1: /* beq 0x10000000 bne 0x14000000 - blez 0x18000000 bgtz 0x1c000000 */ + blez 0x18000000 bgtz 0x1c000000 */ insn ^= 0x04000000; break; @@ -13412,8 +13895,8 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) /* Clear the and-link bit. */ assert ((insn & 0xfc1c0000) == 0x04100000); - /* bltzal 0x04100000 bgezal 0x04110000 - bltzall 0x04120000 bgezall 0x04130000 */ + /* bltzal 0x04100000 bgezal 0x04110000 + bltzall 0x04120000 bgezall 0x04130000 */ insn &= ~0x00100000; } @@ -13438,7 +13921,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) md_number_to_chars ((char *) buf, insn, 4); buf += 4; - /* Nop */ + /* nop */ md_number_to_chars ((char *) buf, 0, 4); buf += 4; @@ -13476,7 +13959,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) exp.X_add_number = fragp->fr_offset; fixp = fix_new_exp (fragp, buf - (bfd_byte *)fragp->fr_literal, - 4, &exp, 0, BFD_RELOC_MIPS_JMP); + 4, &exp, FALSE, BFD_RELOC_MIPS_JMP); fixp->fx_file = fragp->fr_file; fixp->fx_line = fragp->fr_line; @@ -13498,7 +13981,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) } fixp = fix_new_exp (fragp, buf - (bfd_byte *)fragp->fr_literal, - 4, &exp, 0, BFD_RELOC_MIPS_GOT16); + 4, &exp, FALSE, BFD_RELOC_MIPS_GOT16); fixp->fx_file = fragp->fr_file; fixp->fx_line = fragp->fr_line; @@ -13516,7 +13999,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) insn = HAVE_64BIT_ADDRESSES ? 0x64210000 : 0x24210000; fixp = fix_new_exp (fragp, buf - (bfd_byte *)fragp->fr_literal, - 4, &exp, 0, BFD_RELOC_LO16); + 4, &exp, FALSE, BFD_RELOC_LO16); fixp->fx_file = fragp->fr_file; fixp->fx_line = fragp->fr_line; @@ -13545,7 +14028,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) if (RELAX_MIPS16_P (fragp->fr_subtype)) { int type; - register const struct mips16_immed_operand *op; + const struct mips16_immed_operand *op; bfd_boolean small, ext; offsetT val; bfd_byte *buf; @@ -13699,7 +14182,7 @@ mips_frob_file_after_relocs (void) asymbol **syms; unsigned int count, i; - if (OUTPUT_FLAVOR != bfd_target_elf_flavour) + if (!IS_ELF) return; syms = bfd_get_outsymbols (stdoutput); @@ -13727,6 +14210,7 @@ mips_frob_file_after_relocs (void) void mips_define_label (symbolS *sym) { + segment_info_type *si = seg_info (now_seg); struct insn_label_list *l; if (free_insn_labels == NULL) @@ -13738,8 +14222,8 @@ mips_define_label (symbolS *sym) } l->label = sym; - l->next = insn_labels; - insn_labels = l; + l->next = si->label_list; + si->label_list = l; #ifdef OBJ_ELF dwarf2_emit_label (sym); @@ -13801,6 +14285,7 @@ mips_elf_final_processing (void) /* Set MIPS ELF flags for ASEs. */ /* We may need to define a new flag for DSP ASE, and set this flag when file_ase_dsp is true. */ + /* Same for DSP R2. */ /* We may need to define a new flag for MT ASE, and set this flag when file_ase_mt is true. */ if (file_ase_mips16) @@ -13831,6 +14316,12 @@ mips_elf_final_processing (void) if (mips_32bitmode) elf_elfheader (stdoutput)->e_flags |= EF_MIPS_32BITMODE; + +#if 0 /* XXX FIXME */ + /* 32 bit code with 64 bit FP registers. */ + if (!file_mips_fp32 && ABI_NEEDS_32BIT_REGS (mips_abi)) + elf_elfheader (stdoutput)->e_flags |= ???; +#endif } #endif /* OBJ_ELF || OBJ_MAYBE_ELF */ @@ -13891,7 +14382,7 @@ md_obj_begin (void) static void md_obj_end (void) { - /* check for premature end, nesting errors, etc */ + /* Check for premature end, nesting errors, etc. */ if (cur_proc_ptr) as_warn (_("missing .end at end of assembly")); } @@ -14048,8 +14539,7 @@ s_mips_end (int x ATTRIBUTE_UNUSED) } /* Generate a .pdr section. */ - if (OUTPUT_FLAVOR == bfd_target_elf_flavour && ! ECOFF_DEBUGGING - && mips_flag_pdr) + if (IS_ELF && !ECOFF_DEBUGGING && mips_flag_pdr) { segT saved_seg = now_seg; subsegT saved_subseg = now_subseg; @@ -14143,7 +14633,7 @@ static void s_mips_frame (int ignore ATTRIBUTE_UNUSED) { #ifdef OBJ_ELF - if (OUTPUT_FLAVOR == bfd_target_elf_flavour && ! ECOFF_DEBUGGING) + if (IS_ELF && !ECOFF_DEBUGGING) { long val; @@ -14186,7 +14676,7 @@ static void s_mips_mask (int reg_type) { #ifdef OBJ_ELF - if (OUTPUT_FLAVOR == bfd_target_elf_flavour && ! ECOFF_DEBUGGING) + if (IS_ELF && !ECOFF_DEBUGGING) { long mask, off; @@ -14233,72 +14723,102 @@ s_mips_mask (int reg_type) static const struct mips_cpu_info mips_cpu_info_table[] = { /* Entries for generic ISAs */ - { "mips1", 1, ISA_MIPS1, CPU_R3000 }, - { "mips2", 1, ISA_MIPS2, CPU_R6000 }, - { "mips3", 1, ISA_MIPS3, CPU_R4000 }, - { "mips4", 1, ISA_MIPS4, CPU_R8000 }, - { "mips5", 1, ISA_MIPS5, CPU_MIPS5 }, - { "mips32", 1, ISA_MIPS32, CPU_MIPS32 }, - { "mips32r2", 1, ISA_MIPS32R2, CPU_MIPS32R2 }, - { "mips64", 1, ISA_MIPS64, CPU_MIPS64 }, - { "mips64r2", 1, ISA_MIPS64R2, CPU_MIPS64R2 }, + { "mips1", MIPS_CPU_IS_ISA, ISA_MIPS1, CPU_R3000 }, + { "mips2", MIPS_CPU_IS_ISA, ISA_MIPS2, CPU_R6000 }, + { "mips3", MIPS_CPU_IS_ISA, ISA_MIPS3, CPU_R4000 }, + { "mips4", MIPS_CPU_IS_ISA, ISA_MIPS4, CPU_R8000 }, + { "mips5", MIPS_CPU_IS_ISA, ISA_MIPS5, CPU_MIPS5 }, + { "mips32", MIPS_CPU_IS_ISA, ISA_MIPS32, CPU_MIPS32 }, + { "mips32r2", MIPS_CPU_IS_ISA, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "mips64", MIPS_CPU_IS_ISA, ISA_MIPS64, CPU_MIPS64 }, + { "mips64r2", MIPS_CPU_IS_ISA, ISA_MIPS64R2, CPU_MIPS64R2 }, /* MIPS I */ - { "r3000", 0, ISA_MIPS1, CPU_R3000 }, - { "r2000", 0, ISA_MIPS1, CPU_R3000 }, - { "r3900", 0, ISA_MIPS1, CPU_R3900 }, + { "r3000", 0, ISA_MIPS1, CPU_R3000 }, + { "r2000", 0, ISA_MIPS1, CPU_R3000 }, + { "r3900", 0, ISA_MIPS1, CPU_R3900 }, /* MIPS II */ - { "r6000", 0, ISA_MIPS2, CPU_R6000 }, + { "r6000", 0, ISA_MIPS2, CPU_R6000 }, /* MIPS III */ - { "r4000", 0, ISA_MIPS3, CPU_R4000 }, - { "r4010", 0, ISA_MIPS2, CPU_R4010 }, - { "vr4100", 0, ISA_MIPS3, CPU_VR4100 }, - { "vr4111", 0, ISA_MIPS3, CPU_R4111 }, - { "vr4120", 0, ISA_MIPS3, CPU_VR4120 }, - { "vr4130", 0, ISA_MIPS3, CPU_VR4120 }, - { "vr4181", 0, ISA_MIPS3, CPU_R4111 }, - { "vr4300", 0, ISA_MIPS3, CPU_R4300 }, - { "r4400", 0, ISA_MIPS3, CPU_R4400 }, - { "r4600", 0, ISA_MIPS3, CPU_R4600 }, - { "orion", 0, ISA_MIPS3, CPU_R4600 }, - { "r4650", 0, ISA_MIPS3, CPU_R4650 }, + { "r4000", 0, ISA_MIPS3, CPU_R4000 }, + { "r4010", 0, ISA_MIPS2, CPU_R4010 }, + { "vr4100", 0, ISA_MIPS3, CPU_VR4100 }, + { "vr4111", 0, ISA_MIPS3, CPU_R4111 }, + { "vr4120", 0, ISA_MIPS3, CPU_VR4120 }, + { "vr4130", 0, ISA_MIPS3, CPU_VR4120 }, + { "vr4181", 0, ISA_MIPS3, CPU_R4111 }, + { "vr4300", 0, ISA_MIPS3, CPU_R4300 }, + { "r4400", 0, ISA_MIPS3, CPU_R4400 }, + { "r4600", 0, ISA_MIPS3, CPU_R4600 }, + { "orion", 0, ISA_MIPS3, CPU_R4600 }, + { "r4650", 0, ISA_MIPS3, CPU_R4650 }, /* MIPS IV */ - { "r8000", 0, ISA_MIPS4, CPU_R8000 }, - { "r10000", 0, ISA_MIPS4, CPU_R10000 }, - { "r12000", 0, ISA_MIPS4, CPU_R12000 }, - { "vr5000", 0, ISA_MIPS4, CPU_R5000 }, - { "vr5400", 0, ISA_MIPS4, CPU_VR5400 }, - { "vr5500", 0, ISA_MIPS4, CPU_VR5500 }, - { "rm5200", 0, ISA_MIPS4, CPU_R5000 }, - { "rm5230", 0, ISA_MIPS4, CPU_R5000 }, - { "rm5231", 0, ISA_MIPS4, CPU_R5000 }, - { "rm5261", 0, ISA_MIPS4, CPU_R5000 }, - { "rm5721", 0, ISA_MIPS4, CPU_R5000 }, - { "rm7000", 0, ISA_MIPS4, CPU_RM7000 }, - { "rm9000", 0, ISA_MIPS4, CPU_RM9000 }, + { "r8000", 0, ISA_MIPS4, CPU_R8000 }, + { "r10000", 0, ISA_MIPS4, CPU_R10000 }, + { "r12000", 0, ISA_MIPS4, CPU_R12000 }, + { "vr5000", 0, ISA_MIPS4, CPU_R5000 }, + { "vr5400", 0, ISA_MIPS4, CPU_VR5400 }, + { "vr5500", 0, ISA_MIPS4, CPU_VR5500 }, + { "rm5200", 0, ISA_MIPS4, CPU_R5000 }, + { "rm5230", 0, ISA_MIPS4, CPU_R5000 }, + { "rm5231", 0, ISA_MIPS4, CPU_R5000 }, + { "rm5261", 0, ISA_MIPS4, CPU_R5000 }, + { "rm5721", 0, ISA_MIPS4, CPU_R5000 }, + { "rm7000", 0, ISA_MIPS4, CPU_RM7000 }, + { "rm9000", 0, ISA_MIPS4, CPU_RM9000 }, /* MIPS 32 */ - { "4kc", 0, ISA_MIPS32, CPU_MIPS32 }, - { "4km", 0, ISA_MIPS32, CPU_MIPS32 }, - { "4kp", 0, ISA_MIPS32, CPU_MIPS32 }, + { "4kc", 0, ISA_MIPS32, CPU_MIPS32 }, + { "4km", 0, ISA_MIPS32, CPU_MIPS32 }, + { "4kp", 0, ISA_MIPS32, CPU_MIPS32 }, + { "4ksc", MIPS_CPU_ASE_SMARTMIPS, ISA_MIPS32, CPU_MIPS32 }, - /* MIPS32 Release 2 */ - { "m4k", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, - { "24k", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, - { "24kc", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, - { "24kf", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, - { "24kx", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + /* MIPS 32 Release 2 */ + { "4kec", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "4kem", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "4kep", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "4ksd", MIPS_CPU_ASE_SMARTMIPS, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "m4k", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "m4kp", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "24kc", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "24kf", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "24kx", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + /* 24KE is a 24K with DSP ASE, other ASEs are optional. */ + { "24kec", MIPS_CPU_ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "24kef", MIPS_CPU_ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "24kex", MIPS_CPU_ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 }, + /* 34K is a 24K with DSP and MT ASE, other ASEs are optional. */ + { "34kc", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT, + ISA_MIPS32R2, CPU_MIPS32R2 }, + { "34kf", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT, + ISA_MIPS32R2, CPU_MIPS32R2 }, + { "34kx", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT, + ISA_MIPS32R2, CPU_MIPS32R2 }, + /* 74K with DSP and DSPR2 ASE, other ASEs are optional. */ + { "74kc", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2, + ISA_MIPS32R2, CPU_MIPS32R2 }, + { "74kf", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2, + ISA_MIPS32R2, CPU_MIPS32R2 }, + { "74kx", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2, + ISA_MIPS32R2, CPU_MIPS32R2 }, /* MIPS 64 */ - { "5kc", 0, ISA_MIPS64, CPU_MIPS64 }, - { "5kf", 0, ISA_MIPS64, CPU_MIPS64 }, - { "20kc", 0, ISA_MIPS64, CPU_MIPS64 }, + { "5kc", 0, ISA_MIPS64, CPU_MIPS64 }, + { "5kf", 0, ISA_MIPS64, CPU_MIPS64 }, + { "20kc", MIPS_CPU_ASE_MIPS3D, ISA_MIPS64, CPU_MIPS64 }, + { "25kf", MIPS_CPU_ASE_MIPS3D, ISA_MIPS64, CPU_MIPS64 }, + + /* MIPS 64 Release 2 */ /* Broadcom SB-1 CPU core */ - { "sb1", 0, ISA_MIPS64, CPU_SB1 }, + { "sb1", MIPS_CPU_ASE_MIPS3D | MIPS_CPU_ASE_MDMX, + ISA_MIPS64, CPU_SB1 }, + /* Broadcom SB-1A CPU core */ + { "sb1a", MIPS_CPU_ASE_MIPS3D | MIPS_CPU_ASE_MDMX, + ISA_MIPS64, CPU_SB1 }, /* End marker */ { NULL, 0, 0, 0 } @@ -14413,7 +14933,7 @@ mips_cpu_info_from_isa (int isa) int i; for (i = 0; mips_cpu_info_table[i].name != NULL; i++) - if (mips_cpu_info_table[i].is_isa + if ((mips_cpu_info_table[i].flags & MIPS_CPU_IS_ISA) && isa == mips_cpu_info_table[i].isa) return (&mips_cpu_info_table[i]); @@ -14507,9 +15027,15 @@ MIPS options:\n\ -mips16 generate mips16 instructions\n\ -no-mips16 do not generate mips16 instructions\n")); fprintf (stream, _("\ +-msmartmips generate smartmips instructions\n\ +-mno-smartmips do not generate smartmips instructions\n")); + fprintf (stream, _("\ -mdsp generate DSP instructions\n\ -mno-dsp do not generate DSP instructions\n")); fprintf (stream, _("\ +-mdspr2 generate DSP R2 instructions\n\ +-mno-dspr2 do not generate DSP R2 instructions\n")); + fprintf (stream, _("\ -mmt generate MT instructions\n\ -mno-mt do not generate MT instructions\n")); fprintf (stream, _("\ @@ -14517,7 +15043,6 @@ MIPS options:\n\ -mfix-vr4130 work around VR4130 mflo/mfhi errata\n\ -mgp32 use 32-bit GPRs, regardless of the chosen ISA\n\ -mfp32 use 32-bit FPRs, regardless of the chosen ISA\n\ --mno-shared optimize output for executables\n\ -msym32 assume all symbols have 32-bit values\n\ -O0 remove unneeded NOPs, do not swap branches\n\ -O remove unneeded NOPs and swap branches\n\ @@ -14527,11 +15052,12 @@ MIPS options:\n\ #ifdef OBJ_ELF fprintf (stream, _("\ -KPIC, -call_shared generate SVR4 position independent code\n\ +-mvxworks-pic generate VxWorks position independent code\n\ -non_shared do not generate position independent code\n\ -xgot assume a 32 bit GOT\n\ -mpdr, -mno-pdr enable/disable creation of .pdr sections\n\ -mshared, -mno-shared disable/enable .cpload optimization for\n\ - non-shared code\n\ + position dependent (non shared) code\n\ -mabi=ABI create ABI conformant object file for:\n")); first = 1; @@ -14582,3 +15108,14 @@ mips_cfi_frame_initial_instructions (void) cfi_add_CFA_def_cfa_register (SP); } +int +tc_mips_regname_to_dw2regnum (char *regname) +{ + unsigned int regnum = -1; + unsigned int reg; + + if (reg_lookup (®name, RTYPE_GP | RTYPE_NUM, ®)) + regnum = reg; + + return regnum; +} diff --git a/gas/config/tc-mips.h b/gas/config/tc-mips.h index 5665d3decdd..117417cfed5 100644 --- a/gas/config/tc-mips.h +++ b/gas/config/tc-mips.h @@ -1,6 +1,6 @@ /* tc-mips.h -- header file for tc-mips.c. - Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003, 2004, + 2005, 2006 Free Software Foundation, Inc. Contributed by the OSF and Ralph Campbell. Written by Keith Knowles and Ralph Campbell, working independently. Modified for ECOFF support by Ian Lance Taylor of Cygnus Support. @@ -58,6 +58,12 @@ extern void mips_handle_align (struct frag *); #define MAX_MEM_FOR_RS_ALIGN_CODE (1 + 2) +struct insn_label_list; +#define TC_SEGMENT_INFO_TYPE struct insn_label_list * + +/* This field is nonzero if the symbol is the target of a MIPS16 jump. */ +#define TC_SYMFIELD_TYPE int + /* Tell assembler that we have an itbl_mips.h header file to include. */ #define HAVE_ITBL_CPU @@ -149,6 +155,7 @@ extern void mips_emit_delays (void); extern void mips_enable_auto_align (void); #define md_elf_section_change_hook() mips_enable_auto_align() +enum dwarf2_format; extern enum dwarf2_format mips_dwarf2_format (void); #define DWARF2_FORMAT() mips_dwarf2_format () @@ -160,7 +167,10 @@ extern int mips_dwarf2_addr_size (void); #define tc_cfi_frame_initial_instructions mips_cfi_frame_initial_instructions extern void mips_cfi_frame_initial_instructions (void); +#define tc_regname_to_dw2regnum tc_mips_regname_to_dw2regnum +extern int tc_mips_regname_to_dw2regnum (char *regname); + #define DWARF2_DEFAULT_RETURN_COLUMN 31 -#define DWARF2_CIE_DATA_ALIGNMENT -4 +#define DWARF2_CIE_DATA_ALIGNMENT (-4) #endif /* TC_MIPS */ diff --git a/gas/config/tc-mmix.c b/gas/config/tc-mmix.c index c1a8d536b18..ff522f62ad7 100644 --- a/gas/config/tc-mmix.c +++ b/gas/config/tc-mmix.c @@ -1,5 +1,6 @@ /* tc-mmix.c -- Assembler for Don Knuth's MMIX. - Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation. + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation. This file is part of GAS, the GNU Assembler. @@ -26,11 +27,9 @@ compatible syntax, but the main purpose is to serve GCC. */ -#include #include #include "as.h" #include "subsegs.h" -#include "bfd.h" #include "elf/mmix.h" #include "opcode/mmix.h" #include "safe-ctype.h" diff --git a/gas/config/tc-mmix.h b/gas/config/tc-mmix.h index 61bc881d126..b4ab0c7482f 100644 --- a/gas/config/tc-mmix.h +++ b/gas/config/tc-mmix.h @@ -221,3 +221,6 @@ extern void mmix_md_do_align (int, char *, int, int); sequences sprinkled in, we can get unaligned DWARF2 offsets, so let's explicitly say one byte. */ #define DWARF2_LINE_MIN_INSN_LENGTH 1 + +/* This target is buggy, and sets fix size too large. */ +#define TC_FX_SIZE_SLACK(FIX) 6 diff --git a/gas/config/tc-mn10200.c b/gas/config/tc-mn10200.c index 909652ef6e0..9eecf47ea58 100644 --- a/gas/config/tc-mn10200.c +++ b/gas/config/tc-mn10200.c @@ -19,7 +19,6 @@ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "as.h" #include "safe-ctype.h" #include "subsegs.h" diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c index 102c2eacef8..306e90c12e7 100644 --- a/gas/config/tc-mn10300.c +++ b/gas/config/tc-mn10300.c @@ -1,6 +1,6 @@ /* tc-mn10300.c -- Assembler code for the Matsushita 10300 Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006 Free Software Foundation, Inc. + 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -19,7 +19,6 @@ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "as.h" #include "safe-ctype.h" #include "subsegs.h" @@ -692,7 +691,7 @@ void md_show_usage (stream) FILE *stream; { - fprintf (stream, _("MN10300 options:\n\ + fprintf (stream, _("MN10300 assembler options:\n\ none yet\n")); } @@ -1020,7 +1019,7 @@ md_convert_frag (abfd, sec, fragP) int offset = fragP->fr_fix; fragP->fr_literal[offset] = 0xcc; - fix_new (fragP, fragP->fr_fix + 1, 4, fragP->fr_symbol, + fix_new (fragP, fragP->fr_fix + 1, 2, fragP->fr_symbol, fragP->fr_offset + 1, 1, BFD_RELOC_16_PCREL); fragP->fr_var = 0; fragP->fr_fix += 3; @@ -2281,17 +2280,8 @@ keep_going: abort (); } - /* Convert the size of the reloc into what fix_new_exp wants. */ - reloc_size = reloc_size / 8; - if (reloc_size == 8) - reloc_size = 0; - else if (reloc_size == 16) - reloc_size = 1; - else if (reloc_size == 32) - reloc_size = 2; - fixP = fix_new_exp (frag_now, f - frag_now->fr_literal + offset, - reloc_size, &fixups[i].exp, pcrel, + reloc_size / 8, &fixups[i].exp, pcrel, ((bfd_reloc_code_real_type) reloc)); if (pcrel) @@ -2407,7 +2397,8 @@ tc_gen_reloc (seg, fixp) break; default: - reloc->sym_ptr_ptr = (asymbol **) &bfd_abs_symbol; + reloc->sym_ptr_ptr + = (asymbol **) bfd_abs_section_ptr->symbol_ptr_ptr; return reloc; } } @@ -2545,7 +2536,7 @@ bfd_boolean mn10300_fix_adjustable (fixp) struct fix *fixp; { - if (! TC_RELOC_RTSYM_LOC_FIXUP (fixp)) + if (TC_FORCE_RELOCATION_LOCAL (fixp)) return 0; if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT diff --git a/gas/config/tc-mn10300.h b/gas/config/tc-mn10300.h index dff663d29ad..8f5c81356de 100644 --- a/gas/config/tc-mn10300.h +++ b/gas/config/tc-mn10300.h @@ -1,5 +1,5 @@ /* tc-mn10300.h -- Header file for tc-mn10300.c. - Copyright 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -26,15 +26,15 @@ #define DIFF_EXPR_OK #define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_" -#define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \ - ((FIX)->fx_r_type != BFD_RELOC_32_PLT_PCREL \ - && (FIX)->fx_r_type != BFD_RELOC_MN10300_GOT32 \ - && (FIX)->fx_r_type != BFD_RELOC_32_GOT_PCREL \ - && ((FIX)->fx_addsy == NULL \ - || (! S_IS_EXTERNAL ((FIX)->fx_addsy) \ - && ! S_IS_WEAK ((FIX)->fx_addsy) \ - && S_IS_DEFINED ((FIX)->fx_addsy) \ - && ! S_IS_COMMON ((FIX)->fx_addsy)))) +#define TC_FORCE_RELOCATION(FIX) \ + (generic_force_reloc (FIX)) + +#define TC_FORCE_RELOCATION_LOCAL(FIX) \ + (!(FIX)->fx_pcrel \ + || (FIX)->fx_r_type == BFD_RELOC_32_PLT_PCREL \ + || (FIX)->fx_r_type == BFD_RELOC_MN10300_GOT32 \ + || (FIX)->fx_r_type == BFD_RELOC_32_GOT_PCREL \ + || TC_FORCE_RELOCATION (FIX)) #define md_parse_name(name, exprP, mode, nextcharP) \ mn10300_parse_name ((name), (exprP), (mode), (nextcharP)) diff --git a/gas/config/tc-msp430.c b/gas/config/tc-msp430.c index 6978b85a3e1..6bf21549d45 100644 --- a/gas/config/tc-msp430.c +++ b/gas/config/tc-msp430.c @@ -1,6 +1,7 @@ /* tc-msp430.c -- Assembler code for the Texas Instruments MSP430 - Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Contributed by Dmitry Diky This file is part of GAS, the GNU Assembler. @@ -20,9 +21,6 @@ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include -#include #include #define PUSH_1X_WORKAROUND @@ -34,7 +32,7 @@ /* We will disable polymorphs by default because it is dangerous. - The potencial problem here is the following: assume we got the + The potential problem here is the following: assume we got the following code: jump .l1 @@ -168,7 +166,7 @@ static struct hcodes_s msp430_hcodes[] = const char comment_chars[] = ";"; const char line_comment_chars[] = "#"; -const char line_separator_chars[] = ""; +const char line_separator_chars[] = "{"; const char EXP_CHARS[] = "eE"; const char FLT_CHARS[] = "dD"; @@ -487,7 +485,7 @@ skip_space (char * s) return s; } -/* Extract one word from FROM and copy it to TO. Delimeters are ",;\n" */ +/* Extract one word from FROM and copy it to TO. Delimiters are ",;\n" */ static char * extract_operand (char * from, char * to, int limit) @@ -1918,7 +1916,6 @@ msp430_force_relocation_local(fixS *fixp) return 1; else return (!fixp->fx_pcrel - || fixp->fx_plt || generic_force_reloc(fixp)); } diff --git a/gas/config/tc-mt.c b/gas/config/tc-mt.c index f9a610e049c..f2b9aa81306 100644 --- a/gas/config/tc-mt.c +++ b/gas/config/tc-mt.c @@ -1,5 +1,5 @@ /* tc-mt.c -- Assembler for the Morpho Technologies mt . - Copyright (C) 2005 Free Software Foundation. + Copyright (C) 2005, 2006 Free Software Foundation. This file is part of GAS, the GNU Assembler. @@ -18,7 +18,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include "as.h" #include "dwarf2dbg.h" #include "subsegs.h" diff --git a/gas/config/tc-ns32k.c b/gas/config/tc-ns32k.c index 1a8c3cb3eea..58e124e76e0 100644 --- a/gas/config/tc-ns32k.c +++ b/gas/config/tc-ns32k.c @@ -1,6 +1,6 @@ /* ns32k.c -- Assemble on the National Semiconductor 32k series Copyright 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2005 + 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -22,8 +22,6 @@ /*#define SHOW_NUM 1*//* Uncomment for debugging. */ -#include - #include "as.h" #include "opcode/ns32k.h" @@ -1863,7 +1861,7 @@ convert_iif (void) size = 4; else { - as_bad (_("Displacement to large for :d")); + as_bad (_("Displacement too large for :d")); size = 4; } } diff --git a/gas/config/tc-openrisc.c b/gas/config/tc-openrisc.c index 50597a7f9dc..b27e022fecd 100644 --- a/gas/config/tc-openrisc.c +++ b/gas/config/tc-openrisc.c @@ -1,5 +1,5 @@ /* tc-openrisc.c -- Assembler for the OpenRISC family. - Copyright 2001, 2002, 2003, 2005 Free Software Foundation. + Copyright 2001, 2002, 2003, 2005, 2006 Free Software Foundation. Contributed by Johan Rydberg, jrydberg@opencores.org This file is part of GAS, the GNU Assembler. @@ -19,7 +19,6 @@ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "as.h" #include "subsegs.h" #include "symcat.h" diff --git a/gas/config/tc-or32.c b/gas/config/tc-or32.c index 3099e9f5862..1d98b73f977 100644 --- a/gas/config/tc-or32.c +++ b/gas/config/tc-or32.c @@ -1,5 +1,6 @@ /* Assembly backend for the OpenRISC 1000. - Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2005, 2007 + Free Software Foundation, Inc. Contributed by Damjan Lampret . Modified bu Johan Rydberg, . Based upon a29k port. @@ -616,9 +617,6 @@ md_apply_fix (fixS * fixP, valueT * val, segT seg ATTRIBUTE_UNUSED) fixP->fx_addnumber = t_val; /* Remember value for emit_reloc. */ - know (fixP->fx_size == 4); - know (fixP->fx_r_type < BFD_RELOC_NONE); - switch (fixP->fx_r_type) { case BFD_RELOC_32: /* XXXXXXXX pattern in a word. */ diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index d5bdb9e643e..a86a3bea92c 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -1,6 +1,6 @@ /* tc-ppc.c -- Assemble for the PowerPC or POWER (RS/6000) Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of GAS, the GNU Assembler. @@ -20,7 +20,6 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "as.h" #include "safe-ctype.h" #include "subsegs.h" @@ -85,67 +84,57 @@ static int set_target_endian = 0; static bfd_boolean reg_names_p = TARGET_REG_NAMES_P; -static bfd_boolean register_name PARAMS ((expressionS *)); -static void ppc_set_cpu PARAMS ((void)); -static unsigned long ppc_insert_operand - PARAMS ((unsigned long insn, const struct powerpc_operand *operand, - offsetT val, char *file, unsigned int line)); -static void ppc_macro PARAMS ((char *str, const struct powerpc_macro *macro)); -static void ppc_byte PARAMS ((int)); +static void ppc_macro (char *, const struct powerpc_macro *); +static void ppc_byte (int); #if defined (OBJ_XCOFF) || defined (OBJ_ELF) -static int ppc_is_toc_sym PARAMS ((symbolS *sym)); -static void ppc_tc PARAMS ((int)); -static void ppc_machine PARAMS ((int)); +static void ppc_tc (int); +static void ppc_machine (int); #endif #ifdef OBJ_XCOFF -static void ppc_comm PARAMS ((int)); -static void ppc_bb PARAMS ((int)); -static void ppc_bc PARAMS ((int)); -static void ppc_bf PARAMS ((int)); -static void ppc_biei PARAMS ((int)); -static void ppc_bs PARAMS ((int)); -static void ppc_eb PARAMS ((int)); -static void ppc_ec PARAMS ((int)); -static void ppc_ef PARAMS ((int)); -static void ppc_es PARAMS ((int)); -static void ppc_csect PARAMS ((int)); -static void ppc_change_csect PARAMS ((symbolS *, offsetT)); -static void ppc_function PARAMS ((int)); -static void ppc_extern PARAMS ((int)); -static void ppc_lglobl PARAMS ((int)); -static void ppc_section PARAMS ((int)); -static void ppc_named_section PARAMS ((int)); -static void ppc_stabx PARAMS ((int)); -static void ppc_rename PARAMS ((int)); -static void ppc_toc PARAMS ((int)); -static void ppc_xcoff_cons PARAMS ((int)); -static void ppc_vbyte PARAMS ((int)); +static void ppc_comm (int); +static void ppc_bb (int); +static void ppc_bc (int); +static void ppc_bf (int); +static void ppc_biei (int); +static void ppc_bs (int); +static void ppc_eb (int); +static void ppc_ec (int); +static void ppc_ef (int); +static void ppc_es (int); +static void ppc_csect (int); +static void ppc_change_csect (symbolS *, offsetT); +static void ppc_function (int); +static void ppc_extern (int); +static void ppc_lglobl (int); +static void ppc_section (int); +static void ppc_named_section (int); +static void ppc_stabx (int); +static void ppc_rename (int); +static void ppc_toc (int); +static void ppc_xcoff_cons (int); +static void ppc_vbyte (int); #endif #ifdef OBJ_ELF -static bfd_reloc_code_real_type ppc_elf_suffix PARAMS ((char **, expressionS *)); -static void ppc_elf_cons PARAMS ((int)); -static void ppc_elf_rdata PARAMS ((int)); -static void ppc_elf_lcomm PARAMS ((int)); -static void ppc_elf_validate_fix PARAMS ((fixS *, segT)); -static void ppc_apuinfo_section_add PARAMS ((unsigned int apu, unsigned int version)); +static void ppc_elf_cons (int); +static void ppc_elf_rdata (int); +static void ppc_elf_lcomm (int); #endif #ifdef TE_PE -static void ppc_set_current_section PARAMS ((segT)); -static void ppc_previous PARAMS ((int)); -static void ppc_pdata PARAMS ((int)); -static void ppc_ydata PARAMS ((int)); -static void ppc_reldata PARAMS ((int)); -static void ppc_rdata PARAMS ((int)); -static void ppc_ualong PARAMS ((int)); -static void ppc_znop PARAMS ((int)); -static void ppc_pe_comm PARAMS ((int)); -static void ppc_pe_section PARAMS ((int)); -static void ppc_pe_function PARAMS ((int)); -static void ppc_pe_tocd PARAMS ((int)); +static void ppc_previous (int); +static void ppc_pdata (int); +static void ppc_ydata (int); +static void ppc_reldata (int); +static void ppc_rdata (int); +static void ppc_ualong (int); +static void ppc_znop (int); +static void ppc_pe_comm (int); +static void ppc_pe_section (int); +static void ppc_pe_function (int); +static void ppc_pe_tocd (int); #endif /* Generic assembler global variables which must be defined by all @@ -183,11 +172,9 @@ const char EXP_CHARS[] = "eE"; as in 0d1.0. */ const char FLT_CHARS[] = "dD"; -/* '+' and '-' can be used as postfix predicate predictors for conditional - branches. So they need to be accepted as symbol characters. - Also, anything that can start an operand needs to be mentioned here, +/* Anything that can start an operand needs to be mentioned here, to stop the input scrubber eating whitespace. */ -const char ppc_symbol_chars[] = "+-%["; +const char ppc_symbol_chars[] = "%["; /* The dwarf2 data alignment, adjusted for 32 or 64 bit. */ int ppc_cie_data_alignment; @@ -567,14 +554,8 @@ static const struct pd_reg pre_defined_registers[] = /* Given NAME, find the register number associated with that name, return the integer value associated with the given name or -1 on failure. */ -static int reg_name_search - PARAMS ((const struct pd_reg *, int, const char * name)); - static int -reg_name_search (regs, regcount, name) - const struct pd_reg *regs; - int regcount; - const char *name; +reg_name_search (const struct pd_reg *regs, int regcount, const char *name) { int middle, low, high; int cmp; @@ -611,8 +592,7 @@ reg_name_search (regs, regcount, name) */ static bfd_boolean -register_name (expressionP) - expressionS *expressionP; +register_name (expressionS *expressionP) { int reg_number; char *name; @@ -679,9 +659,7 @@ static const struct pd_reg cr_names[] = expression. */ int -ppc_parse_name (name, expr) - const char *name; - expressionS *expr; +ppc_parse_name (const char *name, expressionS *expr) { int val; @@ -917,6 +895,18 @@ parse_cpu (const char *arg) | PPC_OPCODE_64 | PPC_OPCODE_POWER4 | PPC_OPCODE_POWER5); } + else if (strcmp (arg, "power6") == 0) + { + ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC + | PPC_OPCODE_64 | PPC_OPCODE_POWER4 + | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6); + } + else if (strcmp (arg, "cell") == 0) + { + ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC + | PPC_OPCODE_64 | PPC_OPCODE_POWER4 + | PPC_OPCODE_CELL); + } /* -mcom means assemble for the common intersection between Power and PowerPC. At present, we just allow the union, rather than the intersection. */ @@ -932,9 +922,7 @@ parse_cpu (const char *arg) } int -md_parse_option (c, arg) - int c; - char *arg; +md_parse_option (int c, char *arg) { switch (c) { @@ -1088,8 +1076,7 @@ md_parse_option (c, arg) } void -md_show_usage (stream) - FILE *stream; +md_show_usage (FILE *stream) { fprintf (stream, _("\ PowerPC options:\n\ @@ -1112,6 +1099,8 @@ PowerPC options:\n\ -mbooke, mbooke32 generate code for 32-bit PowerPC BookE\n\ -mpower4 generate code for Power4 architecture\n\ -mpower5 generate code for Power5 architecture\n\ +-mpower6 generate code for Power6 architecture\n\ +-mcell generate code for Cell Broadband Engine architecture\n\ -mcom generate code Power/PowerPC common instructions\n\ -many generate code for any architecture (PWR/PWRX/PPC)\n")); fprintf (stream, _("\ @@ -1140,7 +1129,7 @@ PowerPC options:\n\ /* Set ppc_cpu if it is not already set. */ static void -ppc_set_cpu () +ppc_set_cpu (void) { const char *default_os = TARGET_OS; const char *default_cpu = TARGET_CPU; @@ -1168,7 +1157,7 @@ ppc_set_cpu () are called well before md_begin, when the output file is opened. */ enum bfd_architecture -ppc_arch () +ppc_arch (void) { const char *default_cpu = TARGET_CPU; ppc_set_cpu (); @@ -1190,7 +1179,7 @@ ppc_arch () } unsigned long -ppc_mach () +ppc_mach (void) { if (ppc_obj64) return bfd_mach_ppc64; @@ -1201,7 +1190,7 @@ ppc_mach () } extern char* -ppc_target_format () +ppc_target_format (void) { #ifdef OBJ_COFF #ifdef TE_PE @@ -1233,11 +1222,11 @@ ppc_target_format () static void ppc_setup_opcodes (void) { - register const struct powerpc_opcode *op; + const struct powerpc_opcode *op; const struct powerpc_opcode *op_end; const struct powerpc_macro *macro; const struct powerpc_macro *macro_end; - bfd_boolean dup_insn = FALSE; + bfd_boolean bad_insn = FALSE; if (ppc_hash != NULL) hash_die (ppc_hash); @@ -1247,10 +1236,77 @@ ppc_setup_opcodes (void) /* Insert the opcodes into a hash table. */ ppc_hash = hash_new (); + if (ENABLE_CHECKING) + { + unsigned int i; + + /* Check operand masks. Code here and in the disassembler assumes + all the 1's in the mask are contiguous. */ + for (i = 0; i < num_powerpc_operands; ++i) + { + unsigned long mask = powerpc_operands[i].bitm; + unsigned long right_bit; + unsigned int j; + + right_bit = mask & -mask; + mask += right_bit; + right_bit = mask & -mask; + if (mask != right_bit) + { + as_bad (_("powerpc_operands[%d].bitm invalid"), i); + bad_insn = TRUE; + } + for (j = i + 1; j < num_powerpc_operands; ++j) + if (memcmp (&powerpc_operands[i], &powerpc_operands[j], + sizeof (powerpc_operands[0])) == 0) + { + as_bad (_("powerpc_operands[%d] duplicates powerpc_operands[%d]"), + j, i); + bad_insn = TRUE; + } + } + } + op_end = powerpc_opcodes + powerpc_num_opcodes; for (op = powerpc_opcodes; op < op_end; op++) { - know ((op->opcode & op->mask) == op->opcode); + if (ENABLE_CHECKING) + { + const unsigned char *o; + unsigned long omask = op->mask; + + /* The mask had better not trim off opcode bits. */ + if ((op->opcode & omask) != op->opcode) + { + as_bad (_("mask trims opcode bits for %s"), + op->name); + bad_insn = TRUE; + } + + /* The operands must not overlap the opcode or each other. */ + for (o = op->operands; *o; ++o) + if (*o >= num_powerpc_operands) + { + as_bad (_("operand index error for %s"), + op->name); + bad_insn = TRUE; + } + else + { + const struct powerpc_operand *operand = &powerpc_operands[*o]; + if (operand->shift >= 0) + { + unsigned long mask = operand->bitm << operand->shift; + if (omask & mask) + { + as_bad (_("operand %d overlap in %s"), + (int) (o - op->operands), op->name); + bad_insn = TRUE; + } + omask |= mask; + } + } + } if ((op->flags & ppc_cpu & ~(PPC_OPCODE_32 | PPC_OPCODE_64)) != 0 && ((op->flags & (PPC_OPCODE_32 | PPC_OPCODE_64)) == 0 @@ -1270,11 +1326,14 @@ ppc_setup_opcodes (void) == (ppc_cpu & PPC_OPCODE_POWER4))) && ((op->flags & PPC_OPCODE_POWER5) == 0 || ((op->flags & PPC_OPCODE_POWER5) - == (ppc_cpu & PPC_OPCODE_POWER5)))) + == (ppc_cpu & PPC_OPCODE_POWER5))) + && ((op->flags & PPC_OPCODE_POWER6) == 0 + || ((op->flags & PPC_OPCODE_POWER6) + == (ppc_cpu & PPC_OPCODE_POWER6)))) { const char *retval; - retval = hash_insert (ppc_hash, op->name, (PTR) op); + retval = hash_insert (ppc_hash, op->name, (void *) op); if (retval != NULL) { /* Ignore Power duplicates for -m601. */ @@ -1282,16 +1341,16 @@ ppc_setup_opcodes (void) && (op->flags & PPC_OPCODE_POWER) != 0) continue; - as_bad (_("Internal assembler error for instruction %s"), + as_bad (_("duplicate instruction %s"), op->name); - dup_insn = TRUE; + bad_insn = TRUE; } } } if ((ppc_cpu & PPC_OPCODE_ANY) != 0) for (op = powerpc_opcodes; op < op_end; op++) - hash_insert (ppc_hash, op->name, (PTR) op); + hash_insert (ppc_hash, op->name, (void *) op); /* Insert the macros into a hash table. */ ppc_macro_hash = hash_new (); @@ -1303,16 +1362,16 @@ ppc_setup_opcodes (void) { const char *retval; - retval = hash_insert (ppc_macro_hash, macro->name, (PTR) macro); + retval = hash_insert (ppc_macro_hash, macro->name, (void *) macro); if (retval != (const char *) NULL) { - as_bad (_("Internal assembler error for macro %s"), macro->name); - dup_insn = TRUE; + as_bad (_("duplicate macro %s"), macro->name); + bad_insn = TRUE; } } } - if (dup_insn) + if (bad_insn) abort (); } @@ -1321,7 +1380,7 @@ ppc_setup_opcodes (void) opened. */ void -md_begin () +md_begin (void) { ppc_set_cpu (); @@ -1364,7 +1423,7 @@ md_begin () } void -ppc_cleanup () +ppc_cleanup (void) { #ifdef OBJ_ELF if (ppc_apuinfo_list == NULL) @@ -1426,54 +1485,60 @@ ppc_cleanup () /* Insert an operand value into an instruction. */ static unsigned long -ppc_insert_operand (insn, operand, val, file, line) - unsigned long insn; - const struct powerpc_operand *operand; - offsetT val; - char *file; - unsigned int line; +ppc_insert_operand (unsigned long insn, + const struct powerpc_operand *operand, + offsetT val, + char *file, + unsigned int line) { - if (operand->bits != 32) + long min, max, right; + + max = operand->bitm; + right = max & -max; + min = 0; + + if ((operand->flags & PPC_OPERAND_SIGNED) != 0) { - long min, max; - offsetT test; + if ((operand->flags & PPC_OPERAND_SIGNOPT) == 0) + max = (max >> 1) & -right; + min = ~max & -right; + } - if ((operand->flags & PPC_OPERAND_SIGNED) != 0) - { - if ((operand->flags & PPC_OPERAND_SIGNOPT) != 0) - max = (1 << operand->bits) - 1; - else - max = (1 << (operand->bits - 1)) - 1; - min = - (1 << (operand->bits - 1)); + if ((operand->flags & PPC_OPERAND_PLUS1) != 0) + max++; - if (!ppc_obj64) - { - /* Some people write 32 bit hex constants with the sign - extension done by hand. This shouldn't really be - valid, but, to permit this code to assemble on a 64 - bit host, we sign extend the 32 bit value. */ - if (val > 0 - && (val & (offsetT) 0x80000000) != 0 - && (val & (offsetT) 0xffffffff) == val) - { - val -= 0x80000000; - val -= 0x80000000; - } - } - } - else - { - max = (1 << operand->bits) - 1; - min = 0; - } + if ((operand->flags & PPC_OPERAND_NEGATIVE) != 0) + { + long tmp = min; + min = -max; + max = -tmp; + } - if ((operand->flags & PPC_OPERAND_NEGATIVE) != 0) - test = - val; - else - test = val; + if (min <= max) + { + /* Some people write constants with the sign extension done by + hand but only up to 32 bits. This shouldn't really be valid, + but, to permit this code to assemble on a 64-bit host, we + sign extend the 32-bit value to 64 bits if so doing makes the + value valid. */ + if (val > max + && (offsetT) (val - 0x80000000 - 0x80000000) >= min + && (offsetT) (val - 0x80000000 - 0x80000000) <= max + && ((val - 0x80000000 - 0x80000000) & (right - 1)) == 0) + val = val - 0x80000000 - 0x80000000; - if (test < (offsetT) min || test > (offsetT) max) - as_bad_value_out_of_range (_("operand"), test, (offsetT) min, (offsetT) max, file, line); + /* Similarly, people write expressions like ~(1<<15), and expect + this to be OK for a 32-bit unsigned value. */ + else if (val < min + && (offsetT) (val + 0x80000000 + 0x80000000) >= min + && (offsetT) (val + 0x80000000 + 0x80000000) <= max + && ((val + 0x80000000 + 0x80000000) & (right - 1)) == 0) + val = val + 0x80000000 + 0x80000000; + + else if (val < min + || val > max + || (val & (right - 1)) != 0) + as_bad_value_out_of_range (_("operand"), val, min, max, file, line); } if (operand->insert) @@ -1486,8 +1551,7 @@ ppc_insert_operand (insn, operand, val, file, line) as_bad_where (file, line, errmsg); } else - insn |= (((long) val & ((1 << operand->bits) - 1)) - << operand->shift); + insn |= ((long) val & operand->bitm) << operand->shift; return insn; } @@ -1496,9 +1560,7 @@ ppc_insert_operand (insn, operand, val, file, line) #ifdef OBJ_ELF /* Parse @got, etc. and return the desired relocation. */ static bfd_reloc_code_real_type -ppc_elf_suffix (str_p, exp_p) - char **str_p; - expressionS *exp_p; +ppc_elf_suffix (char **str_p, expressionS *exp_p) { struct map_bfd { char *string; @@ -1676,8 +1738,7 @@ ppc_elf_suffix (str_p, exp_p) /* Like normal .long/.short/.word, except support @got, etc. Clobbers input_line_pointer, checks end-of-line. */ static void -ppc_elf_cons (nbytes) - register int nbytes; /* 1=.byte, 2=.word, 4=.long, 8=.llong. */ +ppc_elf_cons (int nbytes /* 1=.byte, 2=.word, 4=.long, 8=.llong */) { expressionS exp; bfd_reloc_code_real_type reloc; @@ -1732,8 +1793,7 @@ ppc_elf_cons (nbytes) /* Solaris pseduo op to change to the .rodata section. */ static void -ppc_elf_rdata (xxx) - int xxx; +ppc_elf_rdata (int xxx) { char *save_line = input_line_pointer; static char section[] = ".rodata\n"; @@ -1747,14 +1807,13 @@ ppc_elf_rdata (xxx) /* Pseudo op to make file scope bss items. */ static void -ppc_elf_lcomm (xxx) - int xxx ATTRIBUTE_UNUSED; +ppc_elf_lcomm (int xxx ATTRIBUTE_UNUSED) { - register char *name; - register char c; - register char *p; + char *name; + char c; + char *p; offsetT size; - register symbolS *symbolP; + symbolS *symbolP; offsetT align; segT old_sec; int old_subsec; @@ -1857,9 +1916,7 @@ ppc_elf_lcomm (xxx) fixups for word relocations in writable segments, so we can adjust them at runtime. */ static void -ppc_elf_validate_fix (fixp, seg) - fixS *fixp; - segT seg; +ppc_elf_validate_fix (fixS *fixp, segT seg) { if (fixp->fx_done || fixp->fx_pcrel) return; @@ -1904,7 +1961,7 @@ ppc_elf_validate_fix (fixp, seg) function descriptor sym if the corresponding code sym is used. */ void -ppc_frob_file_before_adjust () +ppc_frob_file_before_adjust (void) { symbolS *symp; asection *toc; @@ -1987,8 +2044,7 @@ enum toc_size_qualifier }; static int -parse_toc_entry (toc_kind) - enum toc_size_qualifier *toc_kind; +parse_toc_entry (enum toc_size_qualifier *toc_kind) { char *start; char *toc_spec; @@ -2052,8 +2108,7 @@ parse_toc_entry (toc_kind) #ifdef OBJ_ELF #define APUID(a,v) ((((a) & 0xffff) << 16) | ((v) & 0xffff)) static void -ppc_apuinfo_section_add (apu, version) - unsigned int apu, version; +ppc_apuinfo_section_add (unsigned int apu, unsigned int version) { unsigned int i; @@ -2099,8 +2154,7 @@ struct ppc_fixup /* This routine is called for each instruction to be assembled. */ void -md_assemble (str) - char *str; +md_assemble (char *str) { char *s; const struct powerpc_opcode *opcode; @@ -2724,16 +2778,14 @@ md_assemble (str) around operands here. */ static void -ppc_macro (str, macro) - char *str; - const struct powerpc_macro *macro; +ppc_macro (char *str, const struct powerpc_macro *macro) { char *operands[10]; unsigned int count; char *s; unsigned int len; const char *format; - int arg; + unsigned int arg; char *send; char *complete; @@ -2771,7 +2823,7 @@ ppc_macro (str, macro) else { arg = strtol (format + 1, &send, 10); - know (send != format && arg >= 0 && arg < count); + know (send != format && arg < count); len += strlen (operands[arg]); format = send; } @@ -2802,9 +2854,7 @@ ppc_macro (str, macro) /* For ELF, add support for SHF_EXCLUDE and SHT_ORDERED. */ int -ppc_section_letter (letter, ptr_msg) - int letter; - char **ptr_msg; +ppc_section_letter (int letter, char **ptr_msg) { if (letter == 'e') return SHF_EXCLUDE; @@ -2814,9 +2864,7 @@ ppc_section_letter (letter, ptr_msg) } int -ppc_section_word (str, len) - char *str; - size_t len; +ppc_section_word (char *str, size_t len) { if (len == 7 && strncmp (str, "exclude", 7) == 0) return SHF_EXCLUDE; @@ -2825,9 +2873,7 @@ ppc_section_word (str, len) } int -ppc_section_type (str, len) - char *str; - size_t len; +ppc_section_type (char *str, size_t len) { if (len == 7 && strncmp (str, "ordered", 7) == 0) return SHT_ORDERED; @@ -2836,10 +2882,7 @@ ppc_section_type (str, len) } int -ppc_section_flags (flags, attr, type) - int flags; - int attr; - int type; +ppc_section_flags (int flags, int attr, int type) { if (type == SHT_ORDERED) flags |= SEC_ALLOC | SEC_LOAD | SEC_SORT_ENTRIES; @@ -2858,8 +2901,7 @@ ppc_section_flags (flags, attr, type) pseudo-op, but it can also take a single ASCII string. */ static void -ppc_byte (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_byte (int ignore ATTRIBUTE_UNUSED) { if (*input_line_pointer != '\"') { @@ -2903,8 +2945,7 @@ static bfd_boolean ppc_stab_symbol; aligns .comm and .lcomm to 4 bytes. */ static void -ppc_comm (lcomm) - int lcomm; +ppc_comm (int lcomm) { asection *current_seg = now_seg; subsegT current_subseg = now_subseg; @@ -3058,8 +3099,7 @@ ppc_comm (lcomm) optional second argument is the alignment (the default is 2). */ static void -ppc_csect (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_csect (int ignore ATTRIBUTE_UNUSED) { char *name; char endc; @@ -3094,9 +3134,7 @@ ppc_csect (ignore) /* Change to a different csect. */ static void -ppc_change_csect (sym, align) - symbolS *sym; - offsetT align; +ppc_change_csect (symbolS *sym, offsetT align) { if (S_IS_DEFINED (sym)) subseg_set (S_GET_SEGMENT (sym), symbol_get_tc (sym)->subseg); @@ -3196,8 +3234,7 @@ ppc_change_csect (sym, align) convenience of people who aren't used to XCOFF. */ static void -ppc_section (type) - int type; +ppc_section (int type) { const char *name; symbolS *sym; @@ -3221,8 +3258,7 @@ ppc_section (type) we do permit the user to name the text or data section. */ static void -ppc_named_section (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_named_section (int ignore ATTRIBUTE_UNUSED) { char *user_name; const char *real_name; @@ -3256,8 +3292,7 @@ ppc_named_section (ignore) /* The .extern pseudo-op. We create an undefined symbol. */ static void -ppc_extern (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_extern (int ignore ATTRIBUTE_UNUSED) { char *name; char endc; @@ -3275,8 +3310,7 @@ ppc_extern (ignore) /* The .lglobl pseudo-op. Keep the symbol in the symbol table. */ static void -ppc_lglobl (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_lglobl (int ignore ATTRIBUTE_UNUSED) { char *name; char endc; @@ -3298,8 +3332,7 @@ ppc_lglobl (ignore) although I don't know why it bothers. */ static void -ppc_rename (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_rename (int ignore ATTRIBUTE_UNUSED) { char *name; char endc; @@ -3334,8 +3367,7 @@ ppc_rename (ignore) always zero, and I am assuming it is the type. */ static void -ppc_stabx (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_stabx (int ignore ATTRIBUTE_UNUSED) { char *name; int len; @@ -3461,8 +3493,7 @@ ppc_stabx (ignore) gets an aux entry like that used for a csect. */ static void -ppc_function (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_function (int ignore ATTRIBUTE_UNUSED) { char *name; char endc; @@ -3555,8 +3586,7 @@ ppc_function (ignore) static symbolS *saved_bi_sym = 0; static void -ppc_bf (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_bf (int ignore ATTRIBUTE_UNUSED) { symbolS *sym; @@ -3591,8 +3621,7 @@ ppc_bf (ignore) most recent ".bf" symbol. */ static void -ppc_ef (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_ef (int ignore ATTRIBUTE_UNUSED) { symbolS *sym; @@ -3616,8 +3645,7 @@ ppc_ef (ignore) is encountered. */ static void -ppc_biei (ei) - int ei; +ppc_biei (int ei) { static symbolS *last_biei; @@ -3671,8 +3699,7 @@ ppc_biei (ei) .bs symbol is the index of this csect symbol. */ static void -ppc_bs (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_bs (int ignore ATTRIBUTE_UNUSED) { char *name; char endc; @@ -3707,8 +3734,7 @@ ppc_bs (ignore) /* The .es pseudo-op. Generate a C_ESTART symbol named .es. */ static void -ppc_es (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_es (int ignore ATTRIBUTE_UNUSED) { symbolS *sym; @@ -3732,8 +3758,7 @@ ppc_es (ignore) line number. */ static void -ppc_bb (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_bb (int ignore ATTRIBUTE_UNUSED) { symbolS *sym; @@ -3759,8 +3784,7 @@ ppc_bb (ignore) line number. */ static void -ppc_eb (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_eb (int ignore ATTRIBUTE_UNUSED) { symbolS *sym; @@ -3784,8 +3808,7 @@ ppc_eb (ignore) specified name. */ static void -ppc_bc (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_bc (int ignore ATTRIBUTE_UNUSED) { char *name; int len; @@ -3807,8 +3830,7 @@ ppc_bc (ignore) /* The .ec pseudo-op. This just creates a C_ECOMM symbol. */ static void -ppc_ec (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_ec (int ignore ATTRIBUTE_UNUSED) { symbolS *sym; @@ -3827,8 +3849,7 @@ ppc_ec (ignore) /* The .toc pseudo-op. Switch to the .toc subsegment. */ static void -ppc_toc (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_toc (int ignore ATTRIBUTE_UNUSED) { if (ppc_toc_csect != (symbolS *) NULL) subseg_set (data_section, symbol_get_tc (ppc_toc_csect)->subseg); @@ -3874,8 +3895,7 @@ ppc_toc (ignore) .short pseudo-op, and we want to be compatible. */ static void -ppc_xcoff_cons (log_size) - int log_size; +ppc_xcoff_cons (int log_size) { frag_align (log_size, 0, 0); record_alignment (now_seg, log_size); @@ -3883,8 +3903,7 @@ ppc_xcoff_cons (log_size) } static void -ppc_vbyte (dummy) - int dummy ATTRIBUTE_UNUSED; +ppc_vbyte (int dummy ATTRIBUTE_UNUSED) { expressionS exp; int byte_count; @@ -3927,8 +3946,7 @@ ppc_vbyte (dummy) the first argument is simply ignored. */ static void -ppc_tc (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_tc (int ignore ATTRIBUTE_UNUSED) { #ifdef OBJ_XCOFF @@ -4014,8 +4032,7 @@ ppc_tc (ignore) /* Pseudo-op .machine. */ static void -ppc_machine (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_machine (int ignore ATTRIBUTE_UNUSED) { char *cpu_string; #define MAX_HISTORY 100 @@ -4078,8 +4095,7 @@ ppc_machine (ignore) /* See whether a symbol is in the TOC section. */ static int -ppc_is_toc_sym (sym) - symbolS *sym; +ppc_is_toc_sym (symbolS *sym) { #ifdef OBJ_XCOFF return symbol_get_tc (sym)->class == XMC_TC; @@ -4100,8 +4116,7 @@ ppc_is_toc_sym (sym) /* Set the current section. */ static void -ppc_set_current_section (new) - segT new; +ppc_set_current_section (segT new) { ppc_previous_section = ppc_current_section; ppc_current_section = new; @@ -4113,8 +4128,7 @@ ppc_set_current_section (new) warnings: "No previous section" */ static void -ppc_previous (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_previous (int ignore ATTRIBUTE_UNUSED) { symbolS *tmp; @@ -4145,8 +4159,7 @@ ppc_previous (ignore) handling, debugging, etc. */ static void -ppc_pdata (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_pdata (int ignore ATTRIBUTE_UNUSED) { if (pdata_section == 0) { @@ -4180,8 +4193,7 @@ ppc_pdata (ignore) debugging, etc. */ static void -ppc_ydata (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_ydata (int ignore ATTRIBUTE_UNUSED) { if (ydata_section == 0) { @@ -4217,8 +4229,7 @@ ppc_ydata (ignore) function descriptors, etc. */ static void -ppc_reldata (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_reldata (int ignore ATTRIBUTE_UNUSED) { if (reldata_section == 0) { @@ -4248,8 +4259,7 @@ ppc_reldata (ignore) 3 - double word aligned (that would be 4 byte boundary) */ static void -ppc_rdata (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_rdata (int ignore ATTRIBUTE_UNUSED) { if (rdata_section == 0) { @@ -4275,8 +4285,7 @@ ppc_rdata (ignore) warnings: None */ static void -ppc_ualong (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_ualong (int ignore ATTRIBUTE_UNUSED) { /* Try for long. */ cons (4); @@ -4290,8 +4299,7 @@ ppc_ualong (ignore) warnings: Missing symbol name */ static void -ppc_znop (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_znop (int ignore ATTRIBUTE_UNUSED) { unsigned long insn; const struct powerpc_opcode *opcode; @@ -4343,14 +4351,13 @@ ppc_znop (ignore) warnings: */ static void -ppc_pe_comm (lcomm) - int lcomm; +ppc_pe_comm (int lcomm) { - register char *name; - register char c; - register char *p; + char *name; + char c; + char *p; offsetT temp; - register symbolS *symbolP; + symbolS *symbolP; offsetT align; name = input_line_pointer; @@ -4473,8 +4480,7 @@ ppc_pe_comm (lcomm) */ void -ppc_pe_section (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_pe_section (int ignore ATTRIBUTE_UNUSED) { /* Strip out the section name. */ char *section_name; @@ -4562,7 +4568,7 @@ ppc_pe_section (ignore) case 'R': /* Remove section at link time */ flags |= SEC_NEVER_LOAD; break; - +#if IFLICT_BRAIN_DAMAGE /* Section Protection */ case 'r': /* section is readable */ flags |= IMAGE_SCN_MEM_READ; @@ -4606,7 +4612,7 @@ ppc_pe_section (ignore) flags |= IMAGE_SCN_ALIGN_64BYTES; align = 6; break; - +#endif default: as_bad (_("unknown section attribute '%c'"), *input_line_pointer); @@ -4632,12 +4638,10 @@ ppc_pe_section (ignore) } bfd_set_section_alignment (stdoutput, sec, align); - } static void -ppc_pe_function (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_pe_function (int ignore ATTRIBUTE_UNUSED) { char *name; char endc; @@ -4659,8 +4663,7 @@ ppc_pe_function (ignore) } static void -ppc_pe_tocd (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_pe_tocd (int ignore ATTRIBUTE_UNUSED) { if (tocdata_section == 0) { @@ -4685,8 +4688,7 @@ ppc_pe_tocd (ignore) /* Don't adjust TOC relocs to use the section symbol. */ int -ppc_pe_fix_adjustable (fix) - fixS *fix; +ppc_pe_fix_adjustable (fixS *fix) { return fix->fx_r_type != BFD_RELOC_PPC_TOC16; } @@ -4701,8 +4703,7 @@ ppc_pe_fix_adjustable (fix) any, to use square brackets, and to be in upper case. */ char * -ppc_canonicalize_symbol_name (name) - char *name; +ppc_canonicalize_symbol_name (char *name) { char *s; @@ -4739,8 +4740,7 @@ ppc_canonicalize_symbol_name (name) called whenever a new symbol is created. */ void -ppc_symbol_new_hook (sym) - symbolS *sym; +ppc_symbol_new_hook (symbolS *sym) { struct ppc_tc_sy *tc; const char *s; @@ -4828,8 +4828,7 @@ ppc_symbol_new_hook (sym) follows the csect symbol. */ void -ppc_frob_label (sym) - symbolS *sym; +ppc_frob_label (symbolS *sym) { if (ppc_current_csect != (symbolS *) NULL) { @@ -4859,8 +4858,7 @@ static bfd_boolean ppc_saw_abs; symbol table. */ int -ppc_frob_symbol (sym) - symbolS *sym; +ppc_frob_symbol (symbolS *sym) { static symbolS *ppc_last_function; static symbolS *set_end; @@ -5123,7 +5121,7 @@ ppc_frob_symbol (sym) absolute symbols. */ void -ppc_adjust_symtab () +ppc_adjust_symtab (void) { symbolS *sym; @@ -5169,8 +5167,7 @@ ppc_adjust_symtab () turn. */ void -ppc_frob_section (sec) - asection *sec; +ppc_frob_section (asection *sec) { static bfd_vma vma = 0; @@ -5187,10 +5184,7 @@ ppc_frob_section (sec) returned, or NULL on OK. */ char * -md_atof (type, litp, sizep) - int type; - char *litp; - int *sizep; +md_atof (int type, char *litp, int *sizep) { int prec; LITTLENUM_TYPE words[4]; @@ -5242,10 +5236,7 @@ md_atof (type, litp, sizep) endianness. */ void -md_number_to_chars (buf, val, n) - char *buf; - valueT val; - int n; +md_number_to_chars (char *buf, valueT val, int n) { if (target_big_endian) number_to_chars_bigendian (buf, val, n); @@ -5256,21 +5247,22 @@ md_number_to_chars (buf, val, n) /* Align a section (I don't know why this is machine dependent). */ valueT -md_section_align (seg, addr) - asection *seg; - valueT addr; +md_section_align (asection *seg ATTRIBUTE_UNUSED, valueT addr) { +#ifdef OBJ_ELF + return addr; +#else int align = bfd_get_section_alignment (stdoutput, seg); return ((addr + (1 << align) - 1) & (-1 << align)); +#endif } /* We don't have any form of relaxing. */ int -md_estimate_size_before_relax (fragp, seg) - fragS *fragp ATTRIBUTE_UNUSED; - asection *seg ATTRIBUTE_UNUSED; +md_estimate_size_before_relax (fragS *fragp ATTRIBUTE_UNUSED, + asection *seg ATTRIBUTE_UNUSED) { abort (); return 0; @@ -5279,10 +5271,9 @@ md_estimate_size_before_relax (fragp, seg) /* Convert a machine dependent frag. We never generate these. */ void -md_convert_frag (abfd, sec, fragp) - bfd *abfd ATTRIBUTE_UNUSED; - asection *sec ATTRIBUTE_UNUSED; - fragS *fragp ATTRIBUTE_UNUSED; +md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, + asection *sec ATTRIBUTE_UNUSED, + fragS *fragp ATTRIBUTE_UNUSED) { abort (); } @@ -5290,8 +5281,7 @@ md_convert_frag (abfd, sec, fragp) /* We have no need to default values of symbols. */ symbolS * -md_undefined_symbol (name) - char *name ATTRIBUTE_UNUSED; +md_undefined_symbol (char *name ATTRIBUTE_UNUSED) { return 0; } @@ -5302,9 +5292,7 @@ md_undefined_symbol (name) given a PC relative reloc. */ long -md_pcrel_from_section (fixp, sec) - fixS *fixp; - segT sec ATTRIBUTE_UNUSED; +md_pcrel_from_section (fixS *fixp, segT sec ATTRIBUTE_UNUSED) { return fixp->fx_frag->fr_address + fixp->fx_where; } @@ -5317,8 +5305,7 @@ md_pcrel_from_section (fixp, sec) corresponding .tc symbol. */ int -ppc_fix_adjustable (fix) - fixS *fix; +ppc_fix_adjustable (fixS *fix) { valueT val = resolve_symbol_value (fix->fx_addsy); segT symseg = S_GET_SEGMENT (fix->fx_addsy); @@ -5443,8 +5430,7 @@ ppc_fix_adjustable (fix) between two csects in the same section. */ int -ppc_force_relocation (fix) - fixS *fix; +ppc_force_relocation (fixS *fix) { /* At this point fix->fx_addsy should already have been converted to a csect symbol. If the csect does not include the fragment, then @@ -5469,8 +5455,7 @@ ppc_force_relocation (fix) will be emitted for a fixup. */ int -ppc_force_relocation (fix) - fixS *fix; +ppc_force_relocation (fixS *fix) { /* Branch prediction relocations must force a relocation, as must the vtable description relocs. */ @@ -5495,8 +5480,7 @@ ppc_force_relocation (fix) } int -ppc_fix_adjustable (fix) - fixS *fix; +ppc_fix_adjustable (fixS *fix) { return (fix->fx_r_type != BFD_RELOC_16_GOTOFF && fix->fx_r_type != BFD_RELOC_LO16_GOTOFF @@ -5510,6 +5494,47 @@ ppc_fix_adjustable (fix) } #endif +/* Implement HANDLE_ALIGN. This writes the NOP pattern into an + rs_align_code frag. */ + +void +ppc_handle_align (struct frag *fragP) +{ + valueT count = (fragP->fr_next->fr_address + - (fragP->fr_address + fragP->fr_fix)); + + if (count != 0 && (count & 3) == 0) + { + char *dest = fragP->fr_literal + fragP->fr_fix; + + fragP->fr_var = 4; + md_number_to_chars (dest, 0x60000000, 4); + + if ((ppc_cpu & PPC_OPCODE_POWER6) != 0) + { + /* For power6, we want the last nop to be a group terminating + one, "ori 1,1,0". Do this by inserting an rs_fill frag + immediately after this one, with its address set to the last + nop location. This will automatically reduce the number of + nops in the current frag by one. */ + if (count > 4) + { + struct frag *group_nop = xmalloc (SIZEOF_STRUCT_FRAG + 4); + + memcpy (group_nop, fragP, SIZEOF_STRUCT_FRAG); + group_nop->fr_address = group_nop->fr_next->fr_address - 4; + group_nop->fr_fix = 0; + group_nop->fr_offset = 1; + group_nop->fr_type = rs_fill; + fragP->fr_next = group_nop; + dest = group_nop->fr_literal; + } + + md_number_to_chars (dest, 0x60210000, 4); + } + } +} + /* Apply a fixup to the object code. This is called for all the fixups we generated by the call to fix_new_exp, above. In the call above we used a reloc code which was the largest legal reloc code @@ -5520,10 +5545,7 @@ ppc_fix_adjustable (fix) fixup. */ void -md_apply_fix (fixP, valP, seg) - fixS *fixP; - valueT * valP; - segT seg ATTRIBUTE_UNUSED; +md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) { valueT value = * valP; @@ -5580,7 +5602,7 @@ md_apply_fix (fixP, valP, seg) csect. Other usages, such as `.long sym', generate relocs. This is the documented behaviour of non-TOC symbols. */ if ((operand->flags & PPC_OPERAND_PARENS) != 0 - && operand->bits == 16 + && (operand->bitm & 0xfff0) == 0xfff0 && operand->shift == 0 && (operand->insert == NULL || ppc_obj64) && fixP->fx_addsy != NULL @@ -5618,11 +5640,11 @@ md_apply_fix (fixP, valP, seg) We are only prepared to turn a few of the operands into relocs. */ if ((operand->flags & PPC_OPERAND_RELATIVE) != 0 - && operand->bits == 26 + && operand->bitm == 0x3fffffc && operand->shift == 0) fixP->fx_r_type = BFD_RELOC_PPC_B26; else if ((operand->flags & PPC_OPERAND_RELATIVE) != 0 - && operand->bits == 16 + && operand->bitm == 0xfffc && operand->shift == 0) { fixP->fx_r_type = BFD_RELOC_PPC_B16; @@ -5633,11 +5655,11 @@ md_apply_fix (fixP, valP, seg) #endif } else if ((operand->flags & PPC_OPERAND_ABSOLUTE) != 0 - && operand->bits == 26 + && operand->bitm == 0x3fffffc && operand->shift == 0) fixP->fx_r_type = BFD_RELOC_PPC_BA26; else if ((operand->flags & PPC_OPERAND_ABSOLUTE) != 0 - && operand->bits == 16 + && operand->bitm == 0xfffc && operand->shift == 0) { fixP->fx_r_type = BFD_RELOC_PPC_BA16; @@ -5649,7 +5671,7 @@ md_apply_fix (fixP, valP, seg) } #if defined (OBJ_XCOFF) || defined (OBJ_ELF) else if ((operand->flags & PPC_OPERAND_PARENS) != 0 - && operand->bits == 16 + && (operand->bitm & 0xfff0) == 0xfff0 && operand->shift == 0) { if (ppc_is_toc_sym (fixP->fx_addsy)) @@ -6047,9 +6069,7 @@ md_apply_fix (fixP, valP, seg) /* Generate a reloc for a fixup. */ arelent * -tc_gen_reloc (seg, fixp) - asection *seg ATTRIBUTE_UNUSED; - fixS *fixp; +tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp) { arelent *reloc; @@ -6072,13 +6092,13 @@ tc_gen_reloc (seg, fixp) } void -ppc_cfi_frame_initial_instructions () +ppc_cfi_frame_initial_instructions (void) { cfi_add_CFA_def_cfa (1, 0); } int -tc_ppc_regname_to_dw2regnum (const char *regname) +tc_ppc_regname_to_dw2regnum (char *regname) { unsigned int regnum = -1; unsigned int i; diff --git a/gas/config/tc-ppc.h b/gas/config/tc-ppc.h index f7c2da619cb..1e856497959 100644 --- a/gas/config/tc-ppc.h +++ b/gas/config/tc-ppc.h @@ -1,6 +1,6 @@ /* tc-ppc.h -- Header file for tc-ppc.c. Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of GAS, the GNU Assembler. @@ -42,15 +42,15 @@ struct fix; /* The target BFD architecture. */ #define TARGET_ARCH (ppc_arch ()) #define TARGET_MACH (ppc_mach ()) -extern enum bfd_architecture ppc_arch PARAMS ((void)); -extern unsigned long ppc_mach PARAMS ((void)); +extern enum bfd_architecture ppc_arch (void); +extern unsigned long ppc_mach (void); /* Whether or not the target is big endian */ extern int target_big_endian; /* The target BFD format. */ #define TARGET_FORMAT (ppc_target_format ()) -extern char *ppc_target_format PARAMS ((void)); +extern char *ppc_target_format (void); /* Permit temporary numeric labels. */ #define LOCAL_LABELS_FB 1 @@ -78,31 +78,12 @@ extern char *ppc_target_format PARAMS ((void)); #define MAX_MEM_FOR_RS_ALIGN_CODE 4 #define HANDLE_ALIGN(FRAGP) \ - if ((FRAGP)->fr_type == rs_align_code) \ - { \ - valueT count = ((FRAGP)->fr_next->fr_address \ - - ((FRAGP)->fr_address + (FRAGP)->fr_fix)); \ - if (count != 0 && (count & 3) == 0) \ - { \ - char *dest = (FRAGP)->fr_literal + (FRAGP)->fr_fix; \ - \ - (FRAGP)->fr_var = 4; \ - if (target_big_endian) \ - { \ - *dest++ = 0x60; \ - *dest++ = 0; \ - *dest++ = 0; \ - *dest++ = 0; \ - } \ - else \ - { \ - *dest++ = 0; \ - *dest++ = 0; \ - *dest++ = 0; \ - *dest++ = 0x60; \ - } \ - } \ - } + if ((FRAGP)->fr_type == rs_align_code) \ + ppc_handle_align (FRAGP); + +extern void ppc_handle_align (struct frag *); + +#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) 0 #define md_frag_check(FRAGP) \ if ((FRAGP)->has_code \ @@ -117,7 +98,7 @@ extern char *ppc_target_format PARAMS ((void)); /* Don't adjust TOC relocs. */ #define tc_fix_adjustable(FIX) ppc_pe_fix_adjustable (FIX) -extern int ppc_pe_fix_adjustable PARAMS ((struct fix *)); +extern int ppc_pe_fix_adjustable (struct fix *); #endif @@ -165,31 +146,31 @@ struct ppc_tc_sy /* Canonicalize the symbol name. */ #define tc_canonicalize_symbol_name(name) ppc_canonicalize_symbol_name (name) -extern char *ppc_canonicalize_symbol_name PARAMS ((char *)); +extern char *ppc_canonicalize_symbol_name (char *); /* Get the symbol class from the name. */ #define tc_symbol_new_hook(sym) ppc_symbol_new_hook (sym) -extern void ppc_symbol_new_hook PARAMS ((symbolS *)); +extern void ppc_symbol_new_hook (symbolS *); /* Set the symbol class of a label based on the csect. */ #define tc_frob_label(sym) ppc_frob_label (sym) -extern void ppc_frob_label PARAMS ((symbolS *)); +extern void ppc_frob_label (symbolS *); /* TOC relocs requires special handling. */ #define tc_fix_adjustable(FIX) ppc_fix_adjustable (FIX) -extern int ppc_fix_adjustable PARAMS ((struct fix *)); +extern int ppc_fix_adjustable (struct fix *); /* We need to set the section VMA. */ #define tc_frob_section(sec) ppc_frob_section (sec) -extern void ppc_frob_section PARAMS ((asection *)); +extern void ppc_frob_section (asection *); /* Finish up the symbol. */ #define tc_frob_symbol(sym, punt) punt = ppc_frob_symbol (sym) -extern int ppc_frob_symbol PARAMS ((symbolS *)); +extern int ppc_frob_symbol (symbolS *); /* Finish up the entire symtab. */ #define tc_adjust_symtab() ppc_adjust_symtab () -extern void ppc_adjust_symtab PARAMS ((void)); +extern void ppc_adjust_symtab (void); /* We also need to copy, in particular, the class of the symbol, over what obj-coff would otherwise have copied. */ @@ -211,10 +192,10 @@ extern const char ppc_symbol_chars[]; #ifdef OBJ_ELF /* Support for SHF_EXCLUDE and SHT_ORDERED */ -extern int ppc_section_letter PARAMS ((int, char **)); -extern int ppc_section_type PARAMS ((char *, size_t)); -extern int ppc_section_word PARAMS ((char *, size_t)); -extern int ppc_section_flags PARAMS ((int, int, int)); +extern int ppc_section_letter (int, char **); +extern int ppc_section_type (char *, size_t); +extern int ppc_section_word (char *, size_t); +extern int ppc_section_flags (int, int, int); #define md_elf_section_letter(LETTER, PTR_MSG) ppc_section_letter (LETTER, PTR_MSG) #define md_elf_section_type(STR, LEN) ppc_section_type (STR, LEN) @@ -226,40 +207,40 @@ extern const char *ppc_comment_chars; /* Keep relocations relative to the GOT, or non-PC relative. */ #define tc_fix_adjustable(FIX) ppc_fix_adjustable (FIX) -extern int ppc_fix_adjustable PARAMS ((struct fix *)); +extern int ppc_fix_adjustable (struct fix *); /* Values passed to md_apply_fix don't include symbol values. */ #define MD_APPLY_SYM_VALUE(FIX) 0 #define tc_frob_file_before_adjust ppc_frob_file_before_adjust -extern void ppc_frob_file_before_adjust PARAMS ((void)); +extern void ppc_frob_file_before_adjust (void); #endif /* OBJ_ELF */ #if defined (OBJ_ELF) || defined (OBJ_XCOFF) #define TC_FORCE_RELOCATION(FIX) ppc_force_relocation (FIX) -extern int ppc_force_relocation PARAMS ((struct fix *)); +extern int ppc_force_relocation (struct fix *); #endif /* call md_pcrel_from_section, not md_pcrel_from */ #define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section(FIX, SEC) -extern long md_pcrel_from_section PARAMS ((struct fix *, segT)); +extern long md_pcrel_from_section (struct fix *, segT); #define md_parse_name(name, exp, mode, c) ppc_parse_name (name, exp) -extern int ppc_parse_name PARAMS ((const char *, struct expressionS *)); +extern int ppc_parse_name (const char *, struct expressionS *); #define md_operand(x) #define md_cleanup() ppc_cleanup () - extern void ppc_cleanup PARAMS ((void)); +extern void ppc_cleanup (void); #define TARGET_USE_CFIPOP 1 #define tc_cfi_frame_initial_instructions ppc_cfi_frame_initial_instructions -extern void ppc_cfi_frame_initial_instructions PARAMS ((void)); +extern void ppc_cfi_frame_initial_instructions (void); #define tc_regname_to_dw2regnum tc_ppc_regname_to_dw2regnum -extern int tc_ppc_regname_to_dw2regnum PARAMS ((const char *regname)); +extern int tc_ppc_regname_to_dw2regnum (char *); extern int ppc_cie_data_alignment; diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c index 56b5b2594f8..6ca31f7b43b 100644 --- a/gas/config/tc-s390.c +++ b/gas/config/tc-s390.c @@ -1,5 +1,5 @@ /* tc-s390.c -- Assemble for the S390 - Copyright 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). @@ -20,7 +20,6 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "as.h" #include "safe-ctype.h" #include "subsegs.h" @@ -412,6 +411,8 @@ md_parse_option (c, arg) current_cpu = S390_OPCODE_Z990; else if (strcmp (arg + 5, "z9-109") == 0) current_cpu = S390_OPCODE_Z9_109; + else if (strcmp (arg + 5, "z9-ec") == 0) + current_cpu = S390_OPCODE_Z9_EC; else { as_bad (_("invalid switch -m%s"), arg); @@ -2322,7 +2323,7 @@ s390_cfi_frame_initial_instructions () } int -tc_s390_regname_to_dw2regnum (const char *regname) +tc_s390_regname_to_dw2regnum (char *regname) { int regnum = -1; diff --git a/gas/config/tc-s390.h b/gas/config/tc-s390.h index dbecfef3a55..b387c3b867d 100644 --- a/gas/config/tc-s390.h +++ b/gas/config/tc-s390.h @@ -88,7 +88,7 @@ extern void s390_md_end PARAMS ((void)); extern void s390_cfi_frame_initial_instructions PARAMS ((void)); #define tc_regname_to_dw2regnum tc_s390_regname_to_dw2regnum -extern int tc_s390_regname_to_dw2regnum PARAMS ((const char *regname)); +extern int tc_s390_regname_to_dw2regnum PARAMS ((char *regname)); extern int s390_cie_data_alignment; diff --git a/gas/config/tc-score.c b/gas/config/tc-score.c new file mode 100644 index 00000000000..fe45b00bad6 --- /dev/null +++ b/gas/config/tc-score.c @@ -0,0 +1,6661 @@ +/* tc-score.c -- Assembler for Score + Copyright 2006 Free Software Foundation, Inc. + Contributed by: + Mei Ligang (ligang@sunnorth.com.cn) + Pei-Lin Tsai (pltsai@sunplus.com) + + This file is part of GAS, the GNU Assembler. + + GAS 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 2, or (at your option) + any later version. + + GAS 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 GAS; see the file COPYING. If not, write to the Free + Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ + +#include "as.h" +#include "config.h" +#include "subsegs.h" +#include "safe-ctype.h" +#include "opcode/score-inst.h" +#include "opcode/score-datadep.h" +#include "struc-symbol.h" + +#ifdef OBJ_ELF +#include "elf/score.h" +#include "dwarf2dbg.h" +#endif + +#define GP 28 +#define PIC_CALL_REG 29 +#define MAX_LITERAL_POOL_SIZE 1024 +#define FAIL 0x80000000 +#define SUCCESS 0 +#define INSN_SIZE 4 +#define INSN16_SIZE 2 +#define RELAX_INST_NUM 3 + +/* For score5u : div/mul will pop warning message, mmu/alw/asw will pop error message. */ +#define BAD_ARGS _("bad arguments to instruction") +#define BAD_PC _("r15 not allowed here") +#define BAD_COND _("instruction is not conditional") +#define ERR_NO_ACCUM _("acc0 expected") +#define ERR_FOR_SCORE5U_MUL_DIV _("div / mul are reserved instructions") +#define ERR_FOR_SCORE5U_MMU _("This architecture doesn't support mmu") +#define ERR_FOR_SCORE5U_ATOMIC _("This architecture doesn't support atomic instruction") +#define LONG_LABEL_LEN _("the label length is longer than 1024"); +#define BAD_SKIP_COMMA BAD_ARGS +#define BAD_GARBAGE _("garbage following instruction"); + +#define skip_whitespace(str) while (*(str) == ' ') ++(str) + +/* The name of the readonly data section. */ +#define RDATA_SECTION_NAME (OUTPUT_FLAVOR == bfd_target_aout_flavour \ + ? ".data" \ + : OUTPUT_FLAVOR == bfd_target_ecoff_flavour \ + ? ".rdata" \ + : OUTPUT_FLAVOR == bfd_target_coff_flavour \ + ? ".rdata" \ + : OUTPUT_FLAVOR == bfd_target_elf_flavour \ + ? ".rodata" \ + : (abort (), "")) + +#define RELAX_ENCODE(old, new, type, reloc1, reloc2, opt) \ + ((relax_substateT) \ + (((old) << 23) \ + | ((new) << 16) \ + | ((type) << 9) \ + | ((reloc1) << 5) \ + | ((reloc2) << 1) \ + | ((opt) ? 1 : 0))) + +#define RELAX_OLD(i) (((i) >> 23) & 0x7f) +#define RELAX_NEW(i) (((i) >> 16) & 0x7f) +#define RELAX_TYPE(i) (((i) >> 9) & 0x7f) +#define RELAX_RELOC1(i) ((valueT) ((i) >> 5) & 0xf) +#define RELAX_RELOC2(i) ((valueT) ((i) >> 1) & 0xf) +#define RELAX_OPT(i) ((i) & 1) +#define RELAX_OPT_CLEAR(i) ((i) & ~1) + +#define SET_INSN_ERROR(s) (inst.error = (s)) +#define INSN_IS_PCE_P(s) (strstr (str, "||") != NULL) + +#define GET_INSN_CLASS(type) (get_insn_class_from_type (type)) + +#define GET_INSN_SIZE(type) ((GET_INSN_CLASS (type) == INSN_CLASS_16) \ + ? INSN16_SIZE : INSN_SIZE) + +/* This array holds the chars that always start a comment. If the + pre-processor is disabled, these aren't very useful. */ +const char comment_chars[] = "#"; +const char line_comment_chars[] = "#"; +const char line_separator_chars[] = ";"; + +/* Chars that can be used to separate mant from exp in floating point numbers. */ +const char EXP_CHARS[] = "eE"; +const char FLT_CHARS[] = "rRsSfFdDxXeEpP"; + +/* Used to contain constructed error messages. */ +static char err_msg[255]; + +fragS *score_fragp = 0; +static int fix_data_dependency = 0; +static int warn_fix_data_dependency = 1; +static int score7 = 1; +static int university_version = 0; + +static int in_my_get_expression = 0; + +#define USE_GLOBAL_POINTER_OPT 1 +#define SCORE_BI_ENDIAN + +/* Default, pop warning message when using r1. */ +static int nor1 = 1; + +/* Default will do instruction relax, -O0 will set g_opt = 0. */ +static unsigned int g_opt = 1; + +/* The size of the small data section. */ +static unsigned int g_switch_value = 8; + +#ifdef OBJ_ELF +/* Pre-defined "_GLOBAL_OFFSET_TABLE_" */ +symbolS *GOT_symbol; +#endif +static segT pdr_seg; + +enum score_pic_level score_pic = NO_PIC; + +#define INSN_NAME_LEN 16 +struct score_it +{ + char name[INSN_NAME_LEN]; + unsigned long instruction; + unsigned long relax_inst; + int size; + int relax_size; + enum score_insn_type type; + char str[MAX_LITERAL_POOL_SIZE]; + const char *error; + int bwarn; + char reg[INSN_NAME_LEN]; + struct + { + bfd_reloc_code_real_type type; + expressionS exp; + int pc_rel; + }reloc; +}; +struct score_it inst; + +typedef struct proc +{ + symbolS *isym; + unsigned long reg_mask; + unsigned long reg_offset; + unsigned long fpreg_mask; + unsigned long leaf; + unsigned long frame_offset; + unsigned long frame_reg; + unsigned long pc_reg; +} +procS; + +static procS cur_proc; +static procS *cur_proc_ptr; +static int numprocs; + +#define SCORE7_PIPELINE 7 +#define SCORE5_PIPELINE 5 +static int vector_size = SCORE7_PIPELINE; +struct score_it dependency_vector[SCORE7_PIPELINE]; + +/* Relax will need some padding for alignment. */ +#define RELAX_PAD_BYTE 3 + +/* Number of littlenums required to hold an extended precision number. For md_atof. */ +#define NUM_FLOAT_VALS 8 +#define MAX_LITTLENUMS 6 +LITTLENUM_TYPE fp_values[NUM_FLOAT_VALS][MAX_LITTLENUMS]; + +/* Structure for a hash table entry for a register. */ +struct reg_entry +{ + const char *name; + int number; +}; + +static const struct reg_entry score_rn_table[] = +{ + {"r0", 0}, {"r1", 1}, {"r2", 2}, {"r3", 3}, + {"r4", 4}, {"r5", 5}, {"r6", 6}, {"r7", 7}, + {"r8", 8}, {"r9", 9}, {"r10", 10}, {"r11", 11}, + {"r12", 12}, {"r13", 13}, {"r14", 14}, {"r15", 15}, + {"r16", 16}, {"r17", 17}, {"r18", 18}, {"r19", 19}, + {"r20", 20}, {"r21", 21}, {"r22", 22}, {"r23", 23}, + {"r24", 24}, {"r25", 25}, {"r26", 26}, {"r27", 27}, + {"r28", 28}, {"r29", 29}, {"r30", 30}, {"r31", 31}, + {NULL, 0} +}; + +static const struct reg_entry score_srn_table[] = +{ + {"sr0", 0}, {"sr1", 1}, {"sr2", 2}, + {NULL, 0} +}; + +static const struct reg_entry score_crn_table[] = +{ + {"cr0", 0}, {"cr1", 1}, {"cr2", 2}, {"cr3", 3}, + {"cr4", 4}, {"cr5", 5}, {"cr6", 6}, {"cr7", 7}, + {"cr8", 8}, {"cr9", 9}, {"cr10", 10}, {"cr11", 11}, + {"cr12", 12}, {"cr13", 13}, {"cr14", 14}, {"cr15", 15}, + {"cr16", 16}, {"cr17", 17}, {"cr18", 18}, {"cr19", 19}, + {"cr20", 20}, {"cr21", 21}, {"cr22", 22}, {"cr23", 23}, + {"cr24", 24}, {"cr25", 25}, {"cr26", 26}, {"cr27", 27}, + {"cr28", 28}, {"cr29", 29}, {"cr30", 30}, {"cr31", 31}, + {NULL, 0} +}; + +struct reg_map +{ + const struct reg_entry *names; + int max_regno; + struct hash_control *htab; + const char *expected; +}; + +struct reg_map all_reg_maps[] = +{ + {score_rn_table, 31, NULL, N_("S+core register expected")}, + {score_srn_table, 2, NULL, N_("S+core special-register expected")}, + {score_crn_table, 31, NULL, N_("S+core co-processor register expected")}, +}; + +static struct hash_control *score_ops_hsh = NULL; + +static struct hash_control *dependency_insn_hsh = NULL; + +/* Enumeration matching entries in table above. */ +enum score_reg_type +{ + REG_TYPE_SCORE = 0, +#define REG_TYPE_FIRST REG_TYPE_SCORE + REG_TYPE_SCORE_SR = 1, + REG_TYPE_SCORE_CR = 2, + REG_TYPE_MAX = 3 +}; + +typedef struct literalS +{ + struct expressionS exp; + struct score_it *inst; +} +literalT; + +literalT literals[MAX_LITERAL_POOL_SIZE]; + +static void do_ldst_insn (char *); +static void do_crdcrscrsimm5 (char *); +static void do_ldst_unalign (char *); +static void do_ldst_atomic (char *); +static void do_ldst_cop (char *); +static void do_macro_li_rdi32 (char *); +static void do_macro_la_rdi32 (char *); +static void do_macro_rdi32hi (char *); +static void do_macro_rdi32lo (char *); +static void do_macro_mul_rdrsrs (char *); +static void do_macro_ldst_label (char *); +static void do_branch (char *); +static void do_jump (char *); +static void do_empty (char *); +static void do_rdrsrs (char *); +static void do_rdsi16 (char *); +static void do_rdrssi14 (char *); +static void do_sub_rdsi16 (char *); +static void do_sub_rdrssi14 (char *); +static void do_rdrsi5 (char *); +static void do_rdrsi14 (char *); +static void do_rdi16 (char *); +static void do_xrsi5 (char *); +static void do_rdrs (char *); +static void do_rdxrs (char *); +static void do_rsrs (char *); +static void do_rdcrs (char *); +static void do_rdsrs (char *); +static void do_rd (char *); +static void do_rs (char *); +static void do_i15 (char *); +static void do_xi5x (char *); +static void do_ceinst (char *); +static void do_cache (char *); +static void do16_rdrs (char *); +static void do16_rs (char *); +static void do16_xrs (char *); +static void do16_mv_rdrs (char *); +static void do16_hrdrs (char *); +static void do16_rdhrs (char *); +static void do16_rdi4 (char *); +static void do16_rdi5 (char *); +static void do16_xi5 (char *); +static void do16_ldst_insn (char *); +static void do16_ldst_imm_insn (char *); +static void do16_push_pop (char *); +static void do16_branch (char *); +static void do16_jump (char *); +static void do_rdi16_pic (char *); +static void do_addi_s_pic (char *); +static void do_addi_u_pic (char *); +static void do_lw_pic (char *); + +static const struct asm_opcode score_ldst_insns[] = +{ + {"lw", 0x20000000, 0x3e000000, 0x2008, Rd_rvalueRs_SI15, do_ldst_insn}, + {"lw", 0x06000000, 0x3e000007, 0x8000, Rd_rvalueRs_preSI12, do_ldst_insn}, + {"lw", 0x0e000000, 0x3e000007, 0x200a, Rd_rvalueRs_postSI12, do_ldst_insn}, + {"lh", 0x22000000, 0x3e000000, 0x2009, Rd_rvalueRs_SI15, do_ldst_insn}, + {"lh", 0x06000001, 0x3e000007, 0x8000, Rd_rvalueRs_preSI12, do_ldst_insn}, + {"lh", 0x0e000001, 0x3e000007, 0x8000, Rd_rvalueRs_postSI12, do_ldst_insn}, + {"lhu", 0x24000000, 0x3e000000, 0x8000, Rd_rvalueRs_SI15, do_ldst_insn}, + {"lhu", 0x06000002, 0x3e000007, 0x8000, Rd_rvalueRs_preSI12, do_ldst_insn}, + {"lhu", 0x0e000002, 0x3e000007, 0x8000, Rd_rvalueRs_postSI12, do_ldst_insn}, + {"lb", 0x26000000, 0x3e000000, 0x8000, Rd_rvalueRs_SI15, do_ldst_insn}, + {"lb", 0x06000003, 0x3e000007, 0x8000, Rd_rvalueRs_preSI12, do_ldst_insn}, + {"lb", 0x0e000003, 0x3e000007, 0x8000, Rd_rvalueRs_postSI12, do_ldst_insn}, + {"sw", 0x28000000, 0x3e000000, 0x200c, Rd_lvalueRs_SI15, do_ldst_insn}, + {"sw", 0x06000004, 0x3e000007, 0x200e, Rd_lvalueRs_preSI12, do_ldst_insn}, + {"sw", 0x0e000004, 0x3e000007, 0x8000, Rd_lvalueRs_postSI12, do_ldst_insn}, + {"sh", 0x2a000000, 0x3e000000, 0x200d, Rd_lvalueRs_SI15, do_ldst_insn}, + {"sh", 0x06000005, 0x3e000007, 0x8000, Rd_lvalueRs_preSI12, do_ldst_insn}, + {"sh", 0x0e000005, 0x3e000007, 0x8000, Rd_lvalueRs_postSI12, do_ldst_insn}, + {"lbu", 0x2c000000, 0x3e000000, 0x200b, Rd_rvalueRs_SI15, do_ldst_insn}, + {"lbu", 0x06000006, 0x3e000007, 0x8000, Rd_rvalueRs_preSI12, do_ldst_insn}, + {"lbu", 0x0e000006, 0x3e000007, 0x8000, Rd_rvalueRs_postSI12, do_ldst_insn}, + {"sb", 0x2e000000, 0x3e000000, 0x200f, Rd_lvalueRs_SI15, do_ldst_insn}, + {"sb", 0x06000007, 0x3e000007, 0x8000, Rd_lvalueRs_preSI12, do_ldst_insn}, + {"sb", 0x0e000007, 0x3e000007, 0x8000, Rd_lvalueRs_postSI12, do_ldst_insn}, +}; + +static const struct asm_opcode score_insns[] = +{ + {"abs", 0x3800000a, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"abs.s", 0x3800004b, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"add", 0x00000010, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"add.c", 0x00000011, 0x3e0003ff, 0x2000, Rd_Rs_Rs, do_rdrsrs}, + {"add.s", 0x38000048, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"addc", 0x00000012, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"addc.c", 0x00000013, 0x3e0003ff, 0x0009, Rd_Rs_Rs, do_rdrsrs}, + {"addi", 0x02000000, 0x3e0e0001, 0x8000, Rd_SI16, do_rdsi16}, + {"addi.c", 0x02000001, 0x3e0e0001, 0x8000, Rd_SI16, do_rdsi16}, + {"addis", 0x0a000000, 0x3e0e0001, 0x8000, Rd_SI16, do_rdi16}, + {"addis.c", 0x0a000001, 0x3e0e0001, 0x8000, Rd_SI16, do_rdi16}, + {"addri", 0x10000000, 0x3e000001, 0x8000, Rd_Rs_SI14, do_rdrssi14}, + {"addri.c", 0x10000001, 0x3e000001, 0x8000, Rd_Rs_SI14, do_rdrssi14}, + {"addc!", 0x0009, 0x700f, 0x00000013, Rd_Rs, do16_rdrs}, + {"add!", 0x2000, 0x700f, 0x00000011, Rd_Rs, do16_rdrs}, + {"addei!", 0x6000 , 0x7087, 0x02000001, Rd_I4, do16_rdi4}, + {"subi", 0x02000000, 0x3e0e0001, 0x8000, Rd_SI16, do_sub_rdsi16}, + {"subi.c", 0x02000001, 0x3e0e0001, 0x8000, Rd_SI16, do_sub_rdsi16}, + {"subri", 0x10000000, 0x3e000001, 0x8000, Rd_Rs_SI14, do_sub_rdrssi14}, + {"subri.c", 0x10000001, 0x3e000001, 0x8000, Rd_Rs_SI14, do_sub_rdrssi14}, + {"and", 0x00000020, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"and.c", 0x00000021, 0x3e0003ff, 0x2004, Rd_Rs_Rs, do_rdrsrs}, + {"andi", 0x02080000, 0x3e0e0001, 0x8000, Rd_I16, do_rdi16}, + {"andi.c", 0x02080001, 0x3e0e0001, 0x8000, Rd_I16, do_rdi16}, + {"andis", 0x0a080000, 0x3e0e0001, 0x8000, Rd_I16, do_rdi16}, + {"andis.c", 0x0a080001, 0x3e0e0001, 0x8000, Rd_I16, do_rdi16}, + {"andri", 0x18000000, 0x3e000001, 0x8000, Rd_Rs_I14, do_rdrsi14}, + {"andri.c", 0x18000001, 0x3e000001, 0x8000, Rd_Rs_I14, do_rdrsi14}, + {"and!", 0x2004, 0x700f, 0x00000021, Rd_Rs, do16_rdrs}, + {"bcs", 0x08000000, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bcc", 0x08000400, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bcnz", 0x08003800, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bcsl", 0x08000001, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bccl", 0x08000401, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bcnzl", 0x08003801, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bcs!", 0x4000, 0x7f00, 0x08000000, PC_DISP8div2, do16_branch}, + {"bcc!", 0x4100, 0x7f00, 0x08000400, PC_DISP8div2, do16_branch}, + {"bcnz!", 0x4e00, 0x7f00, 0x08003800, PC_DISP8div2, do16_branch}, + {"beq", 0x08001000, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"beql", 0x08001001, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"beq!", 0x4400, 0x7f00, 0x08001000, PC_DISP8div2, do16_branch}, + {"bgtu", 0x08000800, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bgt", 0x08001800, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bge", 0x08002000, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bgtul", 0x08000801, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bgtl", 0x08001801, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bgel", 0x08002001, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bgtu!", 0x4200, 0x7f00, 0x08000800, PC_DISP8div2, do16_branch}, + {"bgt!", 0x4600, 0x7f00, 0x08001800, PC_DISP8div2, do16_branch}, + {"bge!", 0x4800, 0x7f00, 0x08002000, PC_DISP8div2, do16_branch}, + {"bitclr.c", 0x00000029, 0x3e0003ff, 0x6004, Rd_Rs_I5, do_rdrsi5}, + {"bitrev", 0x3800000c, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"bitset.c", 0x0000002b, 0x3e0003ff, 0x6005, Rd_Rs_I5, do_rdrsi5}, + {"bittst.c", 0x0000002d, 0x3e0003ff, 0x6006, x_Rs_I5, do_xrsi5}, + {"bittgl.c", 0x0000002f, 0x3e0003ff, 0x6007, Rd_Rs_I5, do_rdrsi5}, + {"bitclr!", 0x6004, 0x7007, 0x00000029, Rd_I5, do16_rdi5}, + {"bitset!", 0x6005, 0x7007, 0x0000002b, Rd_I5, do16_rdi5}, + {"bittst!", 0x6006, 0x7007, 0x0000002d, Rd_I5, do16_rdi5}, + {"bittgl!", 0x6007, 0x7007, 0x0000002f, Rd_I5, do16_rdi5}, + {"bleu", 0x08000c00, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"ble", 0x08001c00, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"blt", 0x08002400, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bleul", 0x08000c01, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"blel", 0x08001c01, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bltl", 0x08002401, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bl", 0x08003c01, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bleu!", 0x4300, 0x7f00, 0x08000c00, PC_DISP8div2, do16_branch}, + {"ble!", 0x4700, 0x7f00, 0x08001c00, PC_DISP8div2, do16_branch}, + {"blt!", 0x4900, 0x7f00, 0x08002400, PC_DISP8div2, do16_branch}, + {"bmi", 0x08002800, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bmil", 0x08002801, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bmi!", 0x00004a00, 0x00007f00, 0x08002800, PC_DISP8div2, do16_branch}, + {"bne", 0x08001400, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bnel", 0x08001401, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bne!", 0x4500, 0x7f00, 0x08001400, PC_DISP8div2, do16_branch}, + {"bpl", 0x08002c00, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bpll", 0x08002c01, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bpl!", 0x4b00, 0x7f00, 0x08002c00, PC_DISP8div2, do16_branch}, + {"brcs", 0x00000008, 0x3e007fff, 0x0004, x_Rs_x, do_rs}, + {"brcc", 0x00000408, 0x3e007fff, 0x0104, x_Rs_x, do_rs}, + {"brgtu", 0x00000808, 0x3e007fff, 0x0204, x_Rs_x, do_rs}, + {"brleu", 0x00000c08, 0x3e007fff, 0x0304, x_Rs_x, do_rs}, + {"breq", 0x00001008, 0x3e007fff, 0x0404, x_Rs_x, do_rs}, + {"brne", 0x00001408, 0x3e007fff, 0x0504, x_Rs_x, do_rs}, + {"brgt", 0x00001808, 0x3e007fff, 0x0604, x_Rs_x, do_rs}, + {"brle", 0x00001c08, 0x3e007fff, 0x0704, x_Rs_x, do_rs}, + {"brge", 0x00002008, 0x3e007fff, 0x0804, x_Rs_x, do_rs}, + {"brlt", 0x00002408, 0x3e007fff, 0x0904, x_Rs_x, do_rs}, + {"brmi", 0x00002808, 0x3e007fff, 0x0a04, x_Rs_x, do_rs}, + {"brpl", 0x00002c08, 0x3e007fff, 0x0b04, x_Rs_x, do_rs}, + {"brvs", 0x00003008, 0x3e007fff, 0x0c04, x_Rs_x, do_rs}, + {"brvc", 0x00003408, 0x3e007fff, 0x0d04, x_Rs_x, do_rs}, + {"brcnz", 0x00003808, 0x3e007fff, 0x0e04, x_Rs_x, do_rs}, + {"br", 0x00003c08, 0x3e007fff, 0x0f04, x_Rs_x, do_rs}, + {"brcsl", 0x00000009, 0x3e007fff, 0x000c, x_Rs_x, do_rs}, + {"brccl", 0x00000409, 0x3e007fff, 0x010c, x_Rs_x, do_rs}, + {"brgtul", 0x00000809, 0x3e007fff, 0x020c, x_Rs_x, do_rs}, + {"brleul", 0x00000c09, 0x3e007fff, 0x030c, x_Rs_x, do_rs}, + {"breql", 0x00001009, 0x3e007fff, 0x040c, x_Rs_x, do_rs}, + {"brnel", 0x00001409, 0x3e007fff, 0x050c, x_Rs_x, do_rs}, + {"brgtl", 0x00001809, 0x3e007fff, 0x060c, x_Rs_x, do_rs}, + {"brlel", 0x00001c09, 0x3e007fff, 0x070c, x_Rs_x, do_rs}, + {"brgel", 0x00002009, 0x3e007fff, 0x080c, x_Rs_x, do_rs}, + {"brltl", 0x00002409, 0x3e007fff, 0x090c, x_Rs_x, do_rs}, + {"brmil", 0x00002809, 0x3e007fff, 0x0a0c, x_Rs_x, do_rs}, + {"brpll", 0x00002c09, 0x3e007fff, 0x0b0c, x_Rs_x, do_rs}, + {"brvsl", 0x00003009, 0x3e007fff, 0x0c0c, x_Rs_x, do_rs}, + {"brvcl", 0x00003409, 0x3e007fff, 0x0d0c, x_Rs_x, do_rs}, + {"brcnzl", 0x00003809, 0x3e007fff, 0x0e0c, x_Rs_x, do_rs}, + {"brl", 0x00003c09, 0x3e007fff, 0x0f0c, x_Rs_x, do_rs}, + {"brcs!", 0x0004, 0x7f0f, 0x00000008, x_Rs, do16_xrs}, + {"brcc!", 0x0104, 0x7f0f, 0x00000408, x_Rs, do16_xrs}, + {"brgtu!", 0x0204, 0x7f0f, 0x00000808, x_Rs, do16_xrs}, + {"brleu!", 0x0304, 0x7f0f, 0x00000c08, x_Rs, do16_xrs}, + {"breq!", 0x0404, 0x7f0f, 0x00001008, x_Rs, do16_xrs}, + {"brne!", 0x0504, 0x7f0f, 0x00001408, x_Rs, do16_xrs}, + {"brgt!", 0x0604, 0x7f0f, 0x00001808, x_Rs, do16_xrs}, + {"brle!", 0x0704, 0x7f0f, 0x00001c08, x_Rs, do16_xrs}, + {"brge!", 0x0804, 0x7f0f, 0x00002008, x_Rs, do16_xrs}, + {"brlt!", 0x0904, 0x7f0f, 0x00002408, x_Rs, do16_xrs}, + {"brmi!", 0x0a04, 0x7f0f, 0x00002808, x_Rs, do16_xrs}, + {"brpl!", 0x0b04, 0x7f0f, 0x00002c08, x_Rs, do16_xrs}, + {"brvs!", 0x0c04, 0x7f0f, 0x00003008, x_Rs, do16_xrs}, + {"brvc!", 0x0d04, 0x7f0f, 0x00003408, x_Rs, do16_xrs}, + {"brcnz!", 0x0e04, 0x7f0f, 0x00003808, x_Rs, do16_xrs}, + {"br!", 0x0f04, 0x7f0f, 0x00003c08, x_Rs, do16_xrs}, + {"brcsl!", 0x000c, 0x7f0f, 0x00000009, x_Rs, do16_xrs}, + {"brccl!", 0x010c, 0x7f0f, 0x00000409, x_Rs, do16_xrs}, + {"brgtul!", 0x020c, 0x7f0f, 0x00000809, x_Rs, do16_xrs}, + {"brleul!", 0x030c, 0x7f0f, 0x00000c09, x_Rs, do16_xrs}, + {"breql!", 0x040c, 0x7f0f, 0x00001009, x_Rs, do16_xrs}, + {"brnel!", 0x050c, 0x7f0f, 0x00001409, x_Rs, do16_xrs}, + {"brgtl!", 0x060c, 0x7f0f, 0x00001809, x_Rs, do16_xrs}, + {"brlel!", 0x070c, 0x7f0f, 0x00001c09, x_Rs, do16_xrs}, + {"brgel!", 0x080c, 0x7f0f, 0x00002009, x_Rs, do16_xrs}, + {"brltl!", 0x090c, 0x7f0f, 0x00002409, x_Rs, do16_xrs}, + {"brmil!", 0x0a0c, 0x7f0f, 0x00002809, x_Rs, do16_xrs}, + {"brpll!", 0x0b0c, 0x7f0f, 0x00002c09, x_Rs, do16_xrs}, + {"brvsl!", 0x0c0c, 0x7f0f, 0x00003009, x_Rs, do16_xrs}, + {"brvcl!", 0x0d0c, 0x7f0f, 0x00003409, x_Rs, do16_xrs}, + {"brcnzl!", 0x0e0c, 0x7f0f, 0x00003809, x_Rs, do16_xrs}, + {"brl!", 0x0f0c, 0x7f0f, 0x00003c09, x_Rs, do16_xrs}, + {"bvs", 0x08003000, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bvc", 0x08003400, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bvsl", 0x08003001, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bvcl", 0x08003401, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bvs!", 0x4c00, 0x7f00, 0x08003000, PC_DISP8div2, do16_branch}, + {"bvc!", 0x4d00, 0x7f00, 0x08003400, PC_DISP8div2, do16_branch}, + {"b!", 0x4f00, 0x7f00, 0x08003c00, PC_DISP8div2, do16_branch}, + {"b", 0x08003c00, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"cache", 0x30000000, 0x3ff00000, 0x8000, OP5_rvalueRs_SI15, do_cache}, + {"ceinst", 0x38000000, 0x3e000000, 0x8000, I5_Rs_Rs_I5_OP5, do_ceinst}, + {"clz", 0x3800000d, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"cmpteq.c", 0x00000019, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"cmptmi.c", 0x00100019, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"cmp.c", 0x00300019, 0x3ff003ff, 0x2003, x_Rs_Rs, do_rsrs}, + {"cmpzteq.c", 0x0000001b, 0x3ff07fff, 0x8000, x_Rs_x, do_rs}, + {"cmpztmi.c", 0x0010001b, 0x3ff07fff, 0x8000, x_Rs_x, do_rs}, + {"cmpz.c", 0x0030001b, 0x3ff07fff, 0x8000, x_Rs_x, do_rs}, + {"cmpi.c", 0x02040001, 0x3e0e0001, 0x8000, Rd_SI16, do_rdsi16}, + {"cmp!", 0x2003, 0x700f, 0x00300019, Rd_Rs, do16_rdrs}, + {"cop1", 0x0c00000c, 0x3e00001f, 0x8000, Rd_Rs_Rs_imm, do_crdcrscrsimm5}, + {"cop2", 0x0c000014, 0x3e00001f, 0x8000, Rd_Rs_Rs_imm, do_crdcrscrsimm5}, + {"cop3", 0x0c00001c, 0x3e00001f, 0x8000, Rd_Rs_Rs_imm, do_crdcrscrsimm5}, + {"drte", 0x0c0000a4, 0x3e0003ff, 0x8000, NO_OPD, do_empty}, + {"extsb", 0x00000058, 0x3e0003ff, 0x8000, Rd_Rs_x, do_rdrs}, + {"extsb.c", 0x00000059, 0x3e0003ff, 0x8000, Rd_Rs_x, do_rdrs}, + {"extsh", 0x0000005a, 0x3e0003ff, 0x8000, Rd_Rs_x, do_rdrs}, + {"extsh.c", 0x0000005b, 0x3e0003ff, 0x8000, Rd_Rs_x, do_rdrs}, + {"extzb", 0x0000005c, 0x3e0003ff, 0x8000, Rd_Rs_x, do_rdrs}, + {"extzb.c", 0x0000005d, 0x3e0003ff, 0x8000, Rd_Rs_x, do_rdrs}, + {"extzh", 0x0000005e, 0x3e0003ff, 0x8000, Rd_Rs_x, do_rdrs}, + {"extzh.c", 0x0000005f, 0x3e0003ff, 0x8000, Rd_Rs_x, do_rdrs}, + {"jl", 0x04000001, 0x3e000001, 0x8000, PC_DISP24div2, do_jump}, + {"jl!", 0x3001, 0x7001, 0x04000001, PC_DISP11div2, do16_jump}, + {"j!", 0x3000, 0x7001, 0x04000000, PC_DISP11div2, do16_jump}, + {"j", 0x04000000, 0x3e000001, 0x8000, PC_DISP24div2, do_jump}, + {"lbu!", 0x200b, 0x0000700f, 0x2c000000, Rd_rvalueRs, do16_ldst_insn}, + {"lbup!", 0x7003, 0x7007, 0x2c000000, Rd_rvalueBP_I5, do16_ldst_imm_insn}, + {"alw", 0x0000000c, 0x3e0003ff, 0x8000, Rd_rvalue32Rs, do_ldst_atomic}, + {"lcb", 0x00000060, 0x3e0003ff, 0x8000, x_rvalueRs_post4, do_ldst_unalign}, + {"lcw", 0x00000062, 0x3e0003ff, 0x8000, Rd_rvalueRs_post4, do_ldst_unalign}, + {"lce", 0x00000066, 0x3e0003ff, 0x8000, Rd_rvalueRs_post4, do_ldst_unalign}, + {"ldc1", 0x0c00000a, 0x3e00001f, 0x8000, Rd_rvalueRs_SI10, do_ldst_cop}, + {"ldc2", 0x0c000012, 0x3e00001f, 0x8000, Rd_rvalueRs_SI10, do_ldst_cop}, + {"ldc3", 0x0c00001a, 0x3e00001f, 0x8000, Rd_rvalueRs_SI10, do_ldst_cop}, + {"lh!", 0x2009, 0x700f, 0x22000000, Rd_rvalueRs, do16_ldst_insn}, + {"lhp!", 0x7001, 0x7007, 0x22000000, Rd_rvalueBP_I5, do16_ldst_imm_insn}, + {"ldi", 0x020c0000, 0x3e0e0000, 0x5000, Rd_SI16, do_rdsi16}, + {"ldis", 0x0a0c0000, 0x3e0e0000, 0x8000, Rd_I16, do_rdi16}, + {"ldiu!", 0x5000, 0x7000, 0x020c0000, Rd_I8, do16_ldst_imm_insn}, + {"lw!", 0x2008, 0x700f, 0x20000000, Rd_rvalueRs, do16_ldst_insn}, + {"lwp!", 0x7000, 0x7007, 0x20000000, Rd_rvalueBP_I5, do16_ldst_imm_insn}, + {"mfcel", 0x00000448, 0x3e007fff, 0x8000, Rd_x_x, do_rd}, + {"mfcel!", 0x1001, 0x7f0f, 0x00000448, x_Rs, do16_rs}, + {"mad", 0x38000000, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"mad.f!", 0x1004, 0x700f, 0x38000080, Rd_Rs, do16_rdrs}, + {"madh", 0x38000203, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"madh.fs", 0x380002c3, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"madh.fs!", 0x100b, 0x700f, 0x380002c3, Rd_Rs, do16_rdrs}, + {"madl", 0x38000002, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"madl.fs", 0x380000c2, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"madl.fs!", 0x100a, 0x700f, 0x380000c2, Rd_Rs, do16_rdrs}, + {"madu", 0x38000020, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"madu!", 0x1005, 0x700f, 0x38000020, Rd_Rs, do16_rdrs}, + {"mad.f", 0x38000080, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"max", 0x38000007, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"mazh", 0x38000303, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"mazh.f", 0x38000383, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"mazh.f!", 0x1009, 0x700f, 0x3800038c, Rd_Rs, do16_rdrs}, + {"mazl", 0x38000102, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"mazl.f", 0x38000182, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"mazl.f!", 0x1008, 0x700f, 0x38000182, Rd_Rs, do16_rdrs}, + {"mfceh", 0x00000848, 0x3e007fff, 0x8000, Rd_x_x, do_rd}, + {"mfceh!", 0x1101, 0x7f0f, 0x00000848, x_Rs, do16_rs}, + {"mfcehl", 0x00000c48, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mfsr", 0x00000050, 0x3e0003ff, 0x8000, Rd_x_I5, do_rdsrs}, + {"mfcr", 0x0c000001, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mfc1", 0x0c000009, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mfc2", 0x0c000011, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mfc3", 0x0c000019, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mfcc1", 0x0c00000f, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mfcc2", 0x0c000017, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mfcc3", 0x0c00001f, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mhfl!", 0x0002, 0x700f, 0x00003c56, Rd_LowRs, do16_hrdrs}, + {"min", 0x38000006, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"mlfh!", 0x0001, 0x700f, 0x00003c56, Rd_HighRs, do16_rdhrs}, + {"msb", 0x38000001, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"msb.f!", 0x1006, 0x700f, 0x38000081, Rd_Rs, do16_rdrs}, + {"msbh", 0x38000205, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"msbh.fs", 0x380002c5, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"msbh.fs!", 0x100f, 0x700f, 0x380002c5, Rd_Rs, do16_rdrs}, + {"msbl", 0x38000004, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"msbl.fs", 0x380000c4, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"msbl.fs!", 0x100e, 0x700f, 0x380000c4, Rd_Rs, do16_rdrs}, + {"msbu", 0x38000021, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"msbu!", 0x1007, 0x700f, 0x38000021, Rd_Rs, do16_rdrs}, + {"msb.f", 0x38000081, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"mszh", 0x38000305, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"mszh.f", 0x38000385, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"mszh.f!", 0x100d, 0x700f, 0x38000385, Rd_Rs, do16_rdrs}, + {"mszl", 0x38000104, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"mszl.f", 0x38000184, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"mszl.f!", 0x100c, 0x700f, 0x38000184, Rd_Rs, do16_rdrs}, + {"mtcel!", 0x1000, 0x7f0f, 0x0000044a, x_Rs, do16_rs}, + {"mtcel", 0x0000044a, 0x3e007fff, 0x8000, Rd_x_x, do_rd}, + {"mtceh", 0x0000084a, 0x3e007fff, 0x8000, Rd_x_x, do_rd}, + {"mtceh!", 0x1100, 0x7f0f, 0x0000084a, x_Rs, do16_rs}, + {"mtcehl", 0x00000c4a, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mtsr", 0x00000052, 0x3e0003ff, 0x8000, x_Rs_I5, do_rdsrs}, + {"mtcr", 0x0c000000, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mtc1", 0x0c000008, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mtc2", 0x0c000010, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mtc3", 0x0c000018, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mtcc1", 0x0c00000e, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mtcc2", 0x0c000016, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mtcc3", 0x0c00001e, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mul.f!", 0x1002, 0x700f, 0x00000041, Rd_Rs, do16_rdrs}, + {"mulu!", 0x1003, 0x700f, 0x00000042, Rd_Rs, do16_rdrs}, + {"mvcs", 0x00000056, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvcc", 0x00000456, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvgtu", 0x00000856, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvleu", 0x00000c56, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mveq", 0x00001056, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvne", 0x00001456, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvgt", 0x00001856, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvle", 0x00001c56, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvge", 0x00002056, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvlt", 0x00002456, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvmi", 0x00002856, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvpl", 0x00002c56, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvvs", 0x00003056, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvvc", 0x00003456, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mv", 0x00003c56, 0x3e007fff, 0x0003, Rd_Rs_x, do_rdrs}, + {"mv!", 0x0003, 0x700f, 0x00003c56, Rd_Rs, do16_mv_rdrs}, + {"neg", 0x0000001e, 0x3e0003ff, 0x8000, Rd_x_Rs, do_rdxrs}, + {"neg.c", 0x0000001f, 0x3e0003ff, 0x2002, Rd_x_Rs, do_rdxrs}, + {"neg!", 0x2002, 0x700f, 0x0000001f, Rd_Rs, do16_rdrs}, + {"nop", 0x00000000, 0x3e0003ff, 0x0000, NO_OPD, do_empty}, + {"not", 0x00000024, 0x3e0003ff, 0x8000, Rd_Rs_x, do_rdrs}, + {"not.c", 0x00000025, 0x3e0003ff, 0x2006, Rd_Rs_x, do_rdrs}, + {"nop!", 0x0000, 0x700f, 0x00000000, NO16_OPD, do_empty}, + {"not!", 0x2006, 0x700f, 0x00000025, Rd_Rs, do16_rdrs}, + {"or", 0x00000022, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"or.c", 0x00000023, 0x3e0003ff, 0x2005, Rd_Rs_Rs, do_rdrsrs}, + {"ori", 0x020a0000, 0x3e0e0001, 0x8000, Rd_I16, do_rdi16}, + {"ori.c", 0x020a0001, 0x3e0e0001, 0x8000, Rd_I16, do_rdi16}, + {"oris", 0x0a0a0000, 0x3e0e0001, 0x8000, Rd_I16, do_rdi16}, + {"oris.c", 0x0a0a0001, 0x3e0e0001, 0x8000, Rd_I16, do_rdi16}, + {"orri", 0x1a000000, 0x3e000001, 0x8000, Rd_Rs_I14, do_rdrsi14}, + {"orri.c", 0x1a000001, 0x3e000001, 0x8000, Rd_Rs_I14, do_rdrsi14}, + {"or!", 0x2005, 0x700f, 0x00000023, Rd_Rs, do16_rdrs}, + {"pflush", 0x0000000a, 0x3e0003ff, 0x8000, NO_OPD, do_empty}, + {"pop!", 0x200a, 0x700f, 0x0e000000, Rd_rvalueRs, do16_push_pop}, + {"push!", 0x200e, 0x700f, 0x06000004, Rd_lvalueRs, do16_push_pop}, + {"ror", 0x00000038, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"ror.c", 0x00000039, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"rorc.c", 0x0000003b, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"rol", 0x0000003c, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"rol.c", 0x0000003d, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"rolc.c", 0x0000003f, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"rori", 0x00000078, 0x3e0003ff, 0x8000, Rd_Rs_I5, do_rdrsi5}, + {"rori.c", 0x00000079, 0x3e0003ff, 0x8000, Rd_Rs_I5, do_rdrsi5}, + {"roric.c", 0x0000007b, 0x3e0003ff, 0x8000, Rd_Rs_I5, do_rdrsi5}, + {"roli", 0x0000007c, 0x3e0003ff, 0x8000, Rd_Rs_I5, do_rdrsi5}, + {"roli.c", 0x0000007d, 0x3e0003ff, 0x8000, Rd_Rs_I5, do_rdrsi5}, + {"rolic.c", 0x0000007f, 0x3e0003ff, 0x8000, Rd_Rs_I5, do_rdrsi5}, + {"rte", 0x0c000084, 0x3e0003ff, 0x8000, NO_OPD, do_empty}, + {"sb!", 0x200f, 0x700f, 0x2e000000, Rd_lvalueRs, do16_ldst_insn}, + {"sbp!", 0x7007, 0x7007, 0x2e000000, Rd_lvalueBP_I5, do16_ldst_imm_insn}, + {"asw", 0x0000000e, 0x3e0003ff, 0x8000, Rd_lvalue32Rs, do_ldst_atomic}, + {"scb", 0x00000068, 0x3e0003ff, 0x8000, Rd_lvalueRs_post4, do_ldst_unalign}, + {"scw", 0x0000006a, 0x3e0003ff, 0x8000, Rd_lvalueRs_post4, do_ldst_unalign}, + {"sce", 0x0000006e, 0x3e0003ff, 0x8000, x_lvalueRs_post4, do_ldst_unalign}, + {"sdbbp", 0x00000006, 0x3e0003ff, 0x6002, x_I5_x, do_xi5x}, + {"sdbbp!", 0x6002, 0x7007, 0x00000006, Rd_I5, do16_xi5}, + {"sh!", 0x200d, 0x700f, 0x2a000000, Rd_lvalueRs, do16_ldst_insn}, + {"shp!", 0x7005, 0x7007, 0x2a000000, Rd_lvalueBP_I5, do16_ldst_imm_insn}, + {"sleep", 0x0c0000c4, 0x3e0003ff, 0x8000, NO_OPD, do_empty}, + {"sll", 0x00000030, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"sll.c", 0x00000031, 0x3e0003ff, 0x0008, Rd_Rs_Rs, do_rdrsrs}, + {"sll.s", 0x3800004e, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"slli", 0x00000070, 0x3e0003ff, 0x8000, Rd_Rs_I5, do_rdrsi5}, + {"slli.c", 0x00000071, 0x3e0003ff, 0x6001, Rd_Rs_I5, do_rdrsi5}, + {"sll!", 0x0008, 0x700f, 0x00000031, Rd_Rs, do16_rdrs}, + {"slli!", 0x6001, 0x7007, 0x00000071, Rd_I5, do16_rdi5}, + {"srl", 0x00000034, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"srl.c", 0x00000035, 0x3e0003ff, 0x000a, Rd_Rs_Rs, do_rdrsrs}, + {"sra", 0x00000036, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"sra.c", 0x00000037, 0x3e0003ff, 0x000b, Rd_Rs_Rs, do_rdrsrs}, + {"srli", 0x00000074, 0x3e0003ff, 0x8000, Rd_Rs_I5, do_rdrsi5}, + {"srli.c", 0x00000075, 0x3e0003ff, 0x6003, Rd_Rs_I5, do_rdrsi5}, + {"srai", 0x00000076, 0x3e0003ff, 0x8000, Rd_Rs_I5, do_rdrsi5}, + {"srai.c", 0x00000077, 0x3e0003ff, 0x8000, Rd_Rs_I5, do_rdrsi5}, + {"srl!", 0x000a, 0x700f, 0x00000035, Rd_Rs, do16_rdrs}, + {"sra!", 0x000b, 0x700f, 0x00000037, Rd_Rs, do16_rdrs}, + {"srli!", 0x6003, 0x7007, 0x00000075, Rd_Rs, do16_rdi5}, + {"stc1", 0x0c00000b, 0x3e00001f, 0x8000, Rd_lvalueRs_SI10, do_ldst_cop}, + {"stc2", 0x0c000013, 0x3e00001f, 0x8000, Rd_lvalueRs_SI10, do_ldst_cop}, + {"stc3", 0x0c00001b, 0x3e00001f, 0x8000, Rd_lvalueRs_SI10, do_ldst_cop}, + {"sub", 0x00000014, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"sub.c", 0x00000015, 0x3e0003ff, 0x2001, Rd_Rs_Rs, do_rdrsrs}, + {"sub.s", 0x38000049, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"subc", 0x00000016, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"subc.c", 0x00000017, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"sub!", 0x2001, 0x700f, 0x00000015, Rd_Rs, do16_rdrs}, + {"subei!", 0x6080, 0x7087, 0x02000001, Rd_I4, do16_rdi4}, + {"sw!", 0x200c, 0x700f, 0x28000000, Rd_lvalueRs, do16_ldst_insn}, + {"swp!", 0x7004, 0x7007, 0x28000000, Rd_lvalueBP_I5, do16_ldst_imm_insn}, + {"syscall", 0x00000002, 0x3e0003ff, 0x8000, I15, do_i15}, + {"tcs", 0x00000054, 0x3e007fff, 0x0005, NO_OPD, do_empty}, + {"tcc", 0x00000454, 0x3e007fff, 0x0105, NO_OPD, do_empty}, + {"tcnz", 0x00003854, 0x3e007fff, 0x0e05, NO_OPD, do_empty}, + {"tcs!", 0x0005, 0x7f0f, 0x00000054, NO16_OPD, do_empty}, + {"tcc!", 0x0105, 0x7f0f, 0x00000454, NO16_OPD, do_empty}, + {"tcnz!", 0x0e05, 0x7f0f, 0x00003854, NO16_OPD, do_empty}, + {"teq", 0x00001054, 0x3e007fff, 0x0405, NO_OPD, do_empty}, + {"teq!", 0x0405, 0x7f0f, 0x00001054, NO16_OPD, do_empty}, + {"tgtu", 0x00000854, 0x3e007fff, 0x0205, NO_OPD, do_empty}, + {"tgt", 0x00001854, 0x3e007fff, 0x0605, NO_OPD, do_empty}, + {"tge", 0x00002054, 0x3e007fff, 0x0805, NO_OPD, do_empty}, + {"tgtu!", 0x0205, 0x7f0f, 0x00000854, NO16_OPD, do_empty}, + {"tgt!", 0x0605, 0x7f0f, 0x00001854, NO16_OPD, do_empty}, + {"tge!", 0x0805, 0x7f0f, 0x00002054, NO16_OPD, do_empty}, + {"tleu", 0x00000c54, 0x3e007fff, 0x0305, NO_OPD, do_empty}, + {"tle", 0x00001c54, 0x3e007fff, 0x0705, NO_OPD, do_empty}, + {"tlt", 0x00002454, 0x3e007fff, 0x0905, NO_OPD, do_empty}, + {"stlb", 0x0c000004, 0x3e0003ff, 0x8000, NO_OPD, do_empty}, + {"mftlb", 0x0c000024, 0x3e0003ff, 0x8000, NO_OPD, do_empty}, + {"mtptlb", 0x0c000044, 0x3e0003ff, 0x8000, NO_OPD, do_empty}, + {"mtrtlb", 0x0c000064, 0x3e0003ff, 0x8000, NO_OPD, do_empty}, + {"tleu!", 0x0305, 0x7f0f, 0x00000c54, NO16_OPD, do_empty}, + {"tle!", 0x0705, 0x7f0f, 0x00001c54, NO16_OPD, do_empty}, + {"tlt!", 0x0905, 0x7f0f, 0x00002454, NO16_OPD, do_empty}, + {"tmi", 0x00002854, 0x3e007fff, 0x0a05, NO_OPD, do_empty}, + {"tmi!", 0x0a05, 0x7f0f, 0x00002854, NO16_OPD, do_empty}, + {"tne", 0x00001454, 0x3e007fff, 0x0505, NO_OPD, do_empty}, + {"tne!", 0x0505, 0x7f0f, 0x00001454, NO16_OPD, do_empty}, + {"tpl", 0x00002c54, 0x3e007fff, 0x0b05, NO_OPD, do_empty}, + {"tpl!", 0x0b05, 0x7f0f, 0x00002c54, NO16_OPD, do_empty}, + {"trapcs", 0x00000004, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trapcc", 0x00000404, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trapgtu", 0x00000804, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trapleu", 0x00000c04, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trapeq", 0x00001004, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trapne", 0x00001404, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trapgt", 0x00001804, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"traple", 0x00001c04, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trapge", 0x00002004, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"traplt", 0x00002404, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trapmi", 0x00002804, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trappl", 0x00002c04, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trapvs", 0x00003004, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trapvc", 0x00003404, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trap", 0x00003c04, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"tset", 0x00003c54, 0x3e007fff, 0x0f05, NO_OPD, do_empty}, + {"tset!", 0x0f05, 0x00007f0f, 0x00003c54, NO16_OPD, do_empty}, + {"tvs", 0x00003054, 0x3e007fff, 0x0c05, NO_OPD, do_empty}, + {"tvc", 0x00003454, 0x3e007fff, 0x0d05, NO_OPD, do_empty}, + {"tvs!", 0x0c05, 0x7f0f, 0x00003054, NO16_OPD, do_empty}, + {"tvc!", 0x0d05, 0x7f0f, 0x00003454, NO16_OPD, do_empty}, + {"xor", 0x00000026, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"xor.c", 0x00000027, 0x3e0003ff, 0x2007, Rd_Rs_Rs, do_rdrsrs}, + {"xor!", 0x2007, 0x700f, 0x00000027, Rd_Rs, do16_rdrs}, + /* Macro instruction. */ + {"li", 0x020c0000, 0x3e0e0000, 0x8000, Insn_Type_SYN, do_macro_li_rdi32}, + /* la reg, imm32 -->(1) ldi reg, simm16 + (2) ldis reg, %HI(imm32) + ori reg, %LO(imm32) + + la reg, symbol -->(1) lis reg, %HI(imm32) + ori reg, %LO(imm32) */ + {"la", 0x020c0000, 0x3e0e0000, 0x8000, Insn_Type_SYN, do_macro_la_rdi32}, + {"div", 0x00000044, 0x3e0003ff, 0x8000, Insn_Type_SYN, do_macro_mul_rdrsrs}, + {"divu", 0x00000046, 0x3e0003ff, 0x8000, Insn_Type_SYN, do_macro_mul_rdrsrs}, + {"rem", 0x00000044, 0x3e0003ff, 0x8000, Insn_Type_SYN, do_macro_mul_rdrsrs}, + {"remu", 0x00000046, 0x3e0003ff, 0x8000, Insn_Type_SYN, do_macro_mul_rdrsrs}, + {"mul", 0x00000040, 0x3e0003ff, 0x8000, Insn_Type_SYN, do_macro_mul_rdrsrs}, + {"mulu", 0x00000042, 0x3e0003ff, 0x8000, Insn_Type_SYN, do_macro_mul_rdrsrs}, + {"maz", 0x00000040, 0x3e0003ff, 0x8000, Insn_Type_SYN, do_macro_mul_rdrsrs}, + {"mazu", 0x00000042, 0x3e0003ff, 0x8000, Insn_Type_SYN, do_macro_mul_rdrsrs}, + {"mul.f", 0x00000041, 0x3e0003ff, 0x8000, Insn_Type_SYN, do_macro_mul_rdrsrs}, + {"maz.f", 0x00000041, 0x3e0003ff, 0x8000, Insn_Type_SYN, do_macro_mul_rdrsrs}, + {"lb", INSN_LB, 0x00000000, 0x8000, Insn_Type_SYN, do_macro_ldst_label}, + {"lbu", INSN_LBU, 0x00000000, 0x200b, Insn_Type_SYN, do_macro_ldst_label}, + {"lh", INSN_LH, 0x00000000, 0x2009, Insn_Type_SYN, do_macro_ldst_label}, + {"lhu", INSN_LHU, 0x00000000, 0x8000, Insn_Type_SYN, do_macro_ldst_label}, + {"lw", INSN_LW, 0x00000000, 0x2008, Insn_Type_SYN, do_macro_ldst_label}, + {"sb", INSN_SB, 0x00000000, 0x200f, Insn_Type_SYN, do_macro_ldst_label}, + {"sh", INSN_SH, 0x00000000, 0x200d, Insn_Type_SYN, do_macro_ldst_label}, + {"sw", INSN_SW, 0x00000000, 0x200c, Insn_Type_SYN, do_macro_ldst_label}, + /* Assembler use internal. */ + {"ld_i32hi", 0x0a0c0000, 0x3e0e0000, 0x8000, Insn_internal, do_macro_rdi32hi}, + {"ld_i32lo", 0x020a0000, 0x3e0e0001, 0x8000, Insn_internal, do_macro_rdi32lo}, + {"ldis_pic", 0x0a0c0000, 0x3e0e0000, 0x5000, Insn_internal, do_rdi16_pic}, + {"addi_s_pic",0x02000000, 0x3e0e0001, 0x8000, Insn_internal, do_addi_s_pic}, + {"addi_u_pic",0x02000000, 0x3e0e0001, 0x8000, Insn_internal, do_addi_u_pic}, + {"lw_pic", 0x20000000, 0x3e000000, 0x8000, Insn_internal, do_lw_pic}, +}; + +/* Next free entry in the pool. */ +int next_literal_pool_place = 0; + +/* Next literal pool number. */ +int lit_pool_num = 1; +symbolS *current_poolP = NULL; + + +static int +end_of_line (char *str) +{ + int retval = SUCCESS; + + skip_whitespace (str); + if (*str != '\0') + { + retval = (int) FAIL; + + if (!inst.error) + inst.error = BAD_GARBAGE; + } + + return retval; +} + +static int +score_reg_parse (char **ccp, struct hash_control *htab) +{ + char *start = *ccp; + char c; + char *p; + struct reg_entry *reg; + + p = start; + if (!ISALPHA (*p) || !is_name_beginner (*p)) + return (int) FAIL; + + c = *p++; + + while (ISALPHA (c) || ISDIGIT (c) || c == '_') + c = *p++; + + *--p = 0; + reg = (struct reg_entry *) hash_find (htab, start); + *p = c; + + if (reg) + { + *ccp = p; + return reg->number; + } + return (int) FAIL; +} + +/* If shift <= 0, only return reg. */ + +static int +reg_required_here (char **str, int shift, enum score_reg_type reg_type) +{ + static char buff[MAX_LITERAL_POOL_SIZE]; + int reg = (int) FAIL; + char *start = *str; + + if ((reg = score_reg_parse (str, all_reg_maps[reg_type].htab)) != (int) FAIL) + { + if (reg_type == REG_TYPE_SCORE) + { + if ((reg == 1) && (nor1 == 1) && (inst.bwarn == 0)) + { + as_warn (_("Using temp register(r1)")); + inst.bwarn = 1; + } + } + if (shift >= 0) + { + if (reg_type == REG_TYPE_SCORE_CR) + strcpy (inst.reg, score_crn_table[reg].name); + else if (reg_type == REG_TYPE_SCORE_SR) + strcpy (inst.reg, score_srn_table[reg].name); + else + strcpy (inst.reg, ""); + + inst.instruction |= reg << shift; + } + } + else + { + *str = start; + sprintf (buff, _("register expected, not '%.100s'"), start); + inst.error = buff; + } + + return reg; +} + +static int +skip_past_comma (char **str) +{ + char *p = *str; + char c; + int comma = 0; + + while ((c = *p) == ' ' || c == ',') + { + p++; + if (c == ',' && comma++) + { + inst.error = BAD_SKIP_COMMA; + return (int) FAIL; + } + } + + if ((c == '\0') || (comma == 0)) + { + inst.error = BAD_SKIP_COMMA; + return (int) FAIL; + } + + *str = p; + return comma ? SUCCESS : (int) FAIL; +} + +static void +do_rdrsrs (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reg_required_here (&str, 15, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reg_required_here (&str, 10, REG_TYPE_SCORE) == (int) FAIL + || end_of_line (str) == (int) FAIL) + { + return; + } + else + { + if ((((inst.instruction >> 15) & 0x10) == 0) + && (((inst.instruction >> 10) & 0x10) == 0) + && (((inst.instruction >> 20) & 0x10) == 0) + && (inst.relax_inst != 0x8000) + && (((inst.instruction >> 20) & 0xf) == ((inst.instruction >> 15) & 0xf))) + { + inst.relax_inst |= (((inst.instruction >> 10) & 0xf) << 4) + | (((inst.instruction >> 15) & 0xf) << 8); + inst.relax_size = 2; + } + else + { + inst.relax_inst = 0x8000; + } + } +} + +static int +walk_no_bignums (symbolS * sp) +{ + if (symbol_get_value_expression (sp)->X_op == O_big) + return 1; + + if (symbol_get_value_expression (sp)->X_add_symbol) + return (walk_no_bignums (symbol_get_value_expression (sp)->X_add_symbol) + || (symbol_get_value_expression (sp)->X_op_symbol + && walk_no_bignums (symbol_get_value_expression (sp)->X_op_symbol))); + + return 0; +} + +static int +my_get_expression (expressionS * ep, char **str) +{ + char *save_in; + segT seg; + + save_in = input_line_pointer; + input_line_pointer = *str; + in_my_get_expression = 1; + seg = expression (ep); + in_my_get_expression = 0; + + if (ep->X_op == O_illegal) + { + *str = input_line_pointer; + input_line_pointer = save_in; + inst.error = _("illegal expression"); + return (int) FAIL; + } + /* Get rid of any bignums now, so that we don't generate an error for which + we can't establish a line number later on. Big numbers are never valid + in instructions, which is where this routine is always called. */ + if (ep->X_op == O_big + || (ep->X_add_symbol + && (walk_no_bignums (ep->X_add_symbol) + || (ep->X_op_symbol && walk_no_bignums (ep->X_op_symbol))))) + { + inst.error = _("invalid constant"); + *str = input_line_pointer; + input_line_pointer = save_in; + return (int) FAIL; + } + + if ((ep->X_add_symbol != NULL) + && (inst.type != PC_DISP19div2) + && (inst.type != PC_DISP8div2) + && (inst.type != PC_DISP24div2) + && (inst.type != PC_DISP11div2) + && (inst.type != Insn_Type_SYN) + && (inst.type != Rd_rvalueRs_SI15) + && (inst.type != Rd_lvalueRs_SI15) + && (inst.type != Insn_internal)) + { + inst.error = BAD_ARGS; + *str = input_line_pointer; + input_line_pointer = save_in; + return (int) FAIL; + } + + *str = input_line_pointer; + input_line_pointer = save_in; + return SUCCESS; +} + +/* Check if an immediate is valid. If so, convert it to the right format. */ + +static int +validate_immediate (int val, unsigned int data_type, int hex_p) +{ + switch (data_type) + { + case _VALUE_HI16: + { + int val_hi = ((val & 0xffff0000) >> 16); + + if (score_df_range[data_type].range[0] <= val_hi + && val_hi <= score_df_range[data_type].range[1]) + return val_hi; + } + break; + + case _VALUE_LO16: + { + int val_lo = (val & 0xffff); + + if (score_df_range[data_type].range[0] <= val_lo + && val_lo <= score_df_range[data_type].range[1]) + return val_lo; + } + break; + + case _VALUE: + return val; + break; + + case _SIMM14: + if (hex_p == 1) + { + if (!(val >= -0x2000 && val <= 0x3fff)) + { + return (int) FAIL; + } + } + else + { + if (!(val >= -8192 && val <= 8191)) + { + return (int) FAIL; + } + } + + return val; + break; + + case _SIMM16_NEG: + if (hex_p == 1) + { + if (!(val >= -0x7fff && val <= 0xffff && val != 0x8000)) + { + return (int) FAIL; + } + } + else + { + if (!(val >= -32767 && val <= 32768)) + { + return (int) FAIL; + } + } + + val = -val; + return val; + break; + + default: + if (data_type == _SIMM14_NEG || data_type == _IMM16_NEG) + val = -val; + + if (score_df_range[data_type].range[0] <= val + && val <= score_df_range[data_type].range[1]) + return val; + + break; + } + + return (int) FAIL; +} + +static int +data_op2 (char **str, int shift, enum score_data_type data_type) +{ + int value; + char data_exp[MAX_LITERAL_POOL_SIZE]; + char *dataptr; + int cnt = 0; + char *pp = NULL; + + skip_whitespace (*str); + inst.error = NULL; + dataptr = * str; + + /* Set hex_p to zero. */ + int hex_p = 0; + + while ((*dataptr != '\0') && (*dataptr != '|') && (cnt <= MAX_LITERAL_POOL_SIZE)) /* 0x7c = ='|' */ + { + data_exp[cnt] = *dataptr; + dataptr++; + cnt++; + } + + data_exp[cnt] = '\0'; + pp = (char *)&data_exp; + + if (*dataptr == '|') /* process PCE */ + { + if (my_get_expression (&inst.reloc.exp, &pp) == (int) FAIL) + return (int) FAIL; + end_of_line (pp); + if (inst.error != 0) + return (int) FAIL; /* to ouptut_inst to printf out the error */ + *str = dataptr; + } + else /* process 16 bit */ + { + if (my_get_expression (&inst.reloc.exp, str) == (int) FAIL) + { + return (int) FAIL; + } + + dataptr = (char *)data_exp; + for (; *dataptr != '\0'; dataptr++) + { + *dataptr = TOLOWER (*dataptr); + if (*dataptr == '!' || *dataptr == ' ') + break; + } + dataptr = (char *)data_exp; + + if ((dataptr != NULL) + && (((strstr (dataptr, "0x")) != NULL) + || ((strstr (dataptr, "0X")) != NULL))) + { + hex_p = 1; + if ((data_type != _SIMM16_LA) + && (data_type != _VALUE_HI16) + && (data_type != _VALUE_LO16) + && (data_type != _IMM16) + && (data_type != _IMM15) + && (data_type != _IMM14) + && (data_type != _IMM4) + && (data_type != _IMM5) + && (data_type != _IMM8) + && (data_type != _IMM5_RSHIFT_1) + && (data_type != _IMM5_RSHIFT_2) + && (data_type != _SIMM14) + && (data_type != _SIMM14_NEG) + && (data_type != _SIMM16_NEG) + && (data_type != _IMM10_RSHIFT_2) + && (data_type != _GP_IMM15)) + { + data_type += 24; + } + } + + if ((inst.reloc.exp.X_add_number == 0) + && (inst.type != Insn_Type_SYN) + && (inst.type != Rd_rvalueRs_SI15) + && (inst.type != Rd_lvalueRs_SI15) + && (inst.type != Insn_internal) + && (((*dataptr >= 'a') && (*dataptr <= 'z')) + || ((*dataptr == '0') && (*(dataptr + 1) == 'x') && (*(dataptr + 2) != '0')) + || ((*dataptr == '+') && (*(dataptr + 1) != '0')) + || ((*dataptr == '-') && (*(dataptr + 1) != '0')))) + { + inst.error = BAD_ARGS; + return (int) FAIL; + } + } + + if ((inst.reloc.exp.X_add_symbol) + && ((data_type == _SIMM16) + || (data_type == _SIMM16_NEG) + || (data_type == _IMM16_NEG) + || (data_type == _SIMM14) + || (data_type == _SIMM14_NEG) + || (data_type == _IMM5) + || (data_type == _IMM14) + || (data_type == _IMM20) + || (data_type == _IMM16) + || (data_type == _IMM15) + || (data_type == _IMM4))) + { + inst.error = BAD_ARGS; + return (int) FAIL; + } + + if (inst.reloc.exp.X_add_symbol) + { + switch (data_type) + { + case _SIMM16_LA: + return (int) FAIL; + case _VALUE_HI16: + inst.reloc.type = BFD_RELOC_HI16_S; + inst.reloc.pc_rel = 0; + break; + case _VALUE_LO16: + inst.reloc.type = BFD_RELOC_LO16; + inst.reloc.pc_rel = 0; + break; + case _GP_IMM15: + inst.reloc.type = BFD_RELOC_SCORE_GPREL15; + inst.reloc.pc_rel = 0; + break; + case _SIMM16_pic: + case _IMM16_LO16_pic: + inst.reloc.type = BFD_RELOC_SCORE_GOT_LO16; + inst.reloc.pc_rel = 0; + break; + default: + inst.reloc.type = BFD_RELOC_32; + inst.reloc.pc_rel = 0; + break; + } + } + else + { + if (data_type == _IMM16_pic) + { + inst.reloc.type = BFD_RELOC_SCORE_DUMMY_HI16; + inst.reloc.pc_rel = 0; + } + + if (data_type == _SIMM16_LA && inst.reloc.exp.X_unsigned == 1) + { + value = validate_immediate (inst.reloc.exp.X_add_number, _SIMM16_LA_POS, hex_p); + if (value == (int) FAIL) /* for advance to check if this is ldis */ + if ((inst.reloc.exp.X_add_number & 0xffff) == 0) + { + inst.instruction |= 0x8000000; + inst.instruction |= ((inst.reloc.exp.X_add_number >> 16) << 1) & 0x1fffe; + return SUCCESS; + } + } + else + { + value = validate_immediate (inst.reloc.exp.X_add_number, data_type, hex_p); + } + + if (value == (int) FAIL) + { + if ((data_type != _SIMM14_NEG) && (data_type != _SIMM16_NEG) && (data_type != _IMM16_NEG)) + { + sprintf (err_msg, + _("invalid constant: %d bit expression not in range %d..%d"), + score_df_range[data_type].bits, + score_df_range[data_type].range[0], score_df_range[data_type].range[1]); + } + else + { + sprintf (err_msg, + _("invalid constant: %d bit expression not in range %d..%d"), + score_df_range[data_type].bits, + -score_df_range[data_type].range[1], -score_df_range[data_type].range[0]); + } + + inst.error = err_msg; + return (int) FAIL; + } + + if ((score_df_range[data_type].range[0] != 0) || (data_type == _IMM5_RANGE_8_31)) + { + value &= (1 << score_df_range[data_type].bits) - 1; + } + + inst.instruction |= value << shift; + } + + if ((inst.instruction & 0xf0000000) == 0x30000000) + { + if ((((inst.instruction >> 20) & 0x1F) != 0) + && (((inst.instruction >> 20) & 0x1F) != 1) + && (((inst.instruction >> 20) & 0x1F) != 2) + && (((inst.instruction >> 20) & 0x1F) != 3) + && (((inst.instruction >> 20) & 0x1F) != 4) + && (((inst.instruction >> 20) & 0x1F) != 8) + && (((inst.instruction >> 20) & 0x1F) != 9) + && (((inst.instruction >> 20) & 0x1F) != 0xa) + && (((inst.instruction >> 20) & 0x1F) != 0xb) + && (((inst.instruction >> 20) & 0x1F) != 0xc) + && (((inst.instruction >> 20) & 0x1F) != 0xd) + && (((inst.instruction >> 20) & 0x1F) != 0xe) + && (((inst.instruction >> 20) & 0x1F) != 0x10) + && (((inst.instruction >> 20) & 0x1F) != 0x11) + && (((inst.instruction >> 20) & 0x1F) != 0x18) + && (((inst.instruction >> 20) & 0x1F) != 0x1A) + && (((inst.instruction >> 20) & 0x1F) != 0x1B) + && (((inst.instruction >> 20) & 0x1F) != 0x1d) + && (((inst.instruction >> 20) & 0x1F) != 0x1e) + && (((inst.instruction >> 20) & 0x1F) != 0x1f)) + { + inst.error = _("invalid constant: bit expression not defined"); + return (int) FAIL; + } + } + + return SUCCESS; +} + +/* Handle addi/addi.c/addis.c/cmpi.c/addis.c/ldi. */ + +static void +do_rdsi16 (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || data_op2 (&str, 1, _SIMM16) == (int) FAIL + || end_of_line (str) == (int) FAIL) + return; + + /* ldi. */ + if ((inst.instruction & 0x20c0000) == 0x20c0000) + { + if ((((inst.instruction >> 20) & 0x10) == 0x10) || ((inst.instruction & 0x1fe00) != 0)) + { + inst.relax_inst = 0x8000; + } + else + { + inst.relax_inst |= (inst.instruction >> 1) & 0xff; + inst.relax_inst |= (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + } + else if (((inst.instruction >> 20) & 0x10) == 0x10) + { + inst.relax_inst = 0x8000; + } +} + +/* Handle subi/subi.c. */ + +static void +do_sub_rdsi16 (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && data_op2 (&str, 1, _SIMM16_NEG) != (int) FAIL) + end_of_line (str); +} + +/* Handle addri/addri.c. */ + +static void +do_rdrssi14 (char *str) /* -(2^13)~((2^13)-1) */ +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && reg_required_here (&str, 15, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL) + data_op2 (&str, 1, _SIMM14); +} + +/* Handle subri.c/subri. */ +static void +do_sub_rdrssi14 (char *str) /* -(2^13)~((2^13)-1) */ +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && reg_required_here (&str, 15, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && data_op2 (&str, 1, _SIMM14_NEG) != (int) FAIL) + end_of_line (str); +} + +/* Handle bitclr.c/bitset.c/bittgl.c/slli.c/srai.c/srli.c/roli.c/rori.c/rolic.c. */ +static void +do_rdrsi5 (char *str) /* 0~((2^14)-1) */ +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reg_required_here (&str, 15, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || data_op2 (&str, 10, _IMM5) == (int) FAIL + || end_of_line (str) == (int) FAIL) + return; + + if ((((inst.instruction >> 20) & 0x1f) == ((inst.instruction >> 15) & 0x1f)) + && (inst.relax_inst != 0x8000) && (((inst.instruction >> 15) & 0x10) == 0)) + { + inst.relax_inst |= (((inst.instruction >> 10) & 0x1f) << 3) | (((inst.instruction >> 15) & 0xf) << 8); + inst.relax_size = 2; + } + else + inst.relax_inst = 0x8000; +} + +/* Handle andri/orri/andri.c/orri.c. */ + +static void +do_rdrsi14 (char *str) /* 0 ~ ((2^14)-1) */ +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && reg_required_here (&str, 15, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && data_op2 (&str, 1, _IMM14) != (int) FAIL) + end_of_line (str); +} + +/* Handle bittst.c. */ +static void +do_xrsi5 (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 15, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || data_op2 (&str, 10, _IMM5) == (int) FAIL + || end_of_line (str) == (int) FAIL) + return; + + if ((inst.relax_inst != 0x8000) && (((inst.instruction >> 15) & 0x10) == 0)) + { + inst.relax_inst |= (((inst.instruction >> 10) & 0x1f) << 3) | (((inst.instruction >> 15) & 0xf) << 8); + inst.relax_size = 2; + } + else + inst.relax_inst = 0x8000; +} + +/* Handle addis/andi/ori/andis/oris/ldis. */ +static void +do_rdi16 (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || data_op2 (&str, 1, _IMM16) == (int) FAIL + || end_of_line (str) == (int) FAIL) + return; + /* + if (((inst.instruction & 0xa0dfffe) != 0xa0c0000) || ((((inst.instruction >> 20) & 0x1f) & 0x10) == 0x10)) + inst.relax_inst = 0x8000; + else + inst.relax_size = 2; + */ +} + +static void +do_macro_rdi32hi (char *str) +{ + skip_whitespace (str); + + /* Do not handle end_of_line(). */ + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL) + data_op2 (&str, 1, _VALUE_HI16); +} + +static void +do_macro_rdi32lo (char *str) +{ + skip_whitespace (str); + + /* Do not handle end_of_line(). */ + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL) + data_op2 (&str, 1, _VALUE_LO16); +} + +/* Handle ldis_pic. */ + +static void +do_rdi16_pic (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && data_op2 (&str, 1, _IMM16_pic) != (int) FAIL) + end_of_line (str); +} + +/* Handle addi_s_pic to generate R_SCORE_GOT_LO16 . */ + +static void +do_addi_s_pic (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && data_op2 (&str, 1, _SIMM16_pic) != (int) FAIL) + end_of_line (str); +} + +/* Handle addi_u_pic to generate R_SCORE_GOT_LO16 . */ + +static void +do_addi_u_pic (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && data_op2 (&str, 1, _IMM16_LO16_pic) != (int) FAIL) + end_of_line (str); +} + +/* Handle mfceh/mfcel/mtceh/mtchl. */ + +static void +do_rd (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL) + end_of_line (str); +} + +static void +do_rs (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 15, REG_TYPE_SCORE) == (int) FAIL + || end_of_line (str) == (int) FAIL) + return; + + if ((inst.relax_inst != 0x8000) && (((inst.instruction >> 15) & 0x10) == 0)) + { + inst.relax_inst |= (((inst.instruction >> 10) & 0xf) << 8) | (((inst.instruction >> 15) & 0xf) << 4); + inst.relax_size = 2; + } + else + inst.relax_inst = 0x8000; +} + +static void +do_i15 (char *str) +{ + skip_whitespace (str); + + if (data_op2 (&str, 10, _IMM15) != (int) FAIL) + end_of_line (str); +} + +static void +do_xi5x (char *str) +{ + skip_whitespace (str); + + if (data_op2 (&str, 15, _IMM5) == (int) FAIL || end_of_line (str) == (int) FAIL) + return; + + if (inst.relax_inst != 0x8000) + { + inst.relax_inst |= (((inst.instruction >> 15) & 0x1f) << 3); + inst.relax_size = 2; + } +} + +static void +do_rdrs (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reg_required_here (&str, 15, REG_TYPE_SCORE) == (int) FAIL + || end_of_line (str) == (int) FAIL) + return; + + if (inst.relax_inst != 0x8000) + { + if (((inst.instruction & 0x7f) == 0x56)) /* adjust mv -> mv! / mlfh! / mhfl! */ + { + /* mlfh */ + if ((((inst.instruction >> 15) & 0x10) != 0x0) && (((inst.instruction >> 20) & 0x10) == 0)) + { + inst.relax_inst = 0x00000001 | (((inst.instruction >> 15) & 0xf) << 4) + | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + /* mhfl */ + else if ((((inst.instruction >> 15) & 0x10) == 0x0) && ((inst.instruction >> 20) & 0x10) != 0) + { + inst.relax_inst = 0x00000002 | (((inst.instruction >> 15) & 0xf) << 4) + | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + else if ((((inst.instruction >> 15) & 0x10) == 0x0) && (((inst.instruction >> 20) & 0x10) == 0)) + { + inst.relax_inst |= (((inst.instruction >> 15) & 0xf) << 4) + | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + else + { + inst.relax_inst = 0x8000; + } + } + else if ((((inst.instruction >> 15) & 0x10) == 0x0) && (((inst.instruction >> 20) & 0x10) == 0)) + { + inst.relax_inst |= (((inst.instruction >> 15) & 0xf) << 4) + | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + else + { + inst.relax_inst = 0x8000; + } + } +} + +/* Handle mfcr/mtcr. */ +static void +do_rdcrs (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && reg_required_here (&str, 15, REG_TYPE_SCORE_CR) != (int) FAIL) + end_of_line (str); +} + +/* Handle mfsr/mtsr. */ + +static void +do_rdsrs (char *str) +{ + skip_whitespace (str); + + /* mfsr */ + if ((inst.instruction & 0xff) == 0x50) + { + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && reg_required_here (&str, 10, REG_TYPE_SCORE_SR) != (int) FAIL) + end_of_line (str); + } + else + { + if (reg_required_here (&str, 15, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL) + reg_required_here (&str, 10, REG_TYPE_SCORE_SR); + } +} + +/* Handle neg. */ + +static void +do_rdxrs (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reg_required_here (&str, 10, REG_TYPE_SCORE) == (int) FAIL + || end_of_line (str) == (int) FAIL) + return; + + if ((inst.relax_inst != 0x8000) && (((inst.instruction >> 10) & 0x10) == 0) + && (((inst.instruction >> 20) & 0x10) == 0)) + { + inst.relax_inst |= (((inst.instruction >> 10) & 0xf) << 4) | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + else + inst.relax_inst = 0x8000; +} + +/* Handle cmp.c/cmp. */ +static void +do_rsrs (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 15, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reg_required_here (&str, 10, REG_TYPE_SCORE) == (int) FAIL + || end_of_line (str) == (int) FAIL) + return; + + if ((inst.relax_inst != 0x8000) && (((inst.instruction >> 20) & 0x1f) == 3) + && (((inst.instruction >> 10) & 0x10) == 0) && (((inst.instruction >> 15) & 0x10) == 0)) + { + inst.relax_inst |= (((inst.instruction >> 10) & 0xf) << 4) | (((inst.instruction >> 15) & 0xf) << 8); + inst.relax_size = 2; + } + else + inst.relax_inst = 0x8000; +} + +static void +do_ceinst (char *str) +{ + char *strbak; + + strbak = str; + skip_whitespace (str); + + if (data_op2 (&str, 20, _IMM5) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reg_required_here (&str, 15, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reg_required_here (&str, 10, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || data_op2 (&str, 5, _IMM5) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || data_op2 (&str, 0, _IMM5) == (int) FAIL + || end_of_line (str) == (int) FAIL) + { + return; + } + else + { + str = strbak; + if (data_op2 (&str, 0, _IMM25) == (int) FAIL) + return; + } +} + +static int +reglow_required_here (char **str, int shift) +{ + static char buff[MAX_LITERAL_POOL_SIZE]; + int reg; + char *start = *str; + + if ((reg = score_reg_parse (str, all_reg_maps[REG_TYPE_SCORE].htab)) != (int) FAIL) + { + if ((reg == 1) && (nor1 == 1) && (inst.bwarn == 0)) + { + as_warn (_("Using temp register(r1)")); + inst.bwarn = 1; + } + if (reg < 16) + { + if (shift >= 0) + inst.instruction |= reg << shift; + + return reg; + } + } + + /* Restore the start point, we may have got a reg of the wrong class. */ + *str = start; + sprintf (buff, _("low register(r0-r15)expected, not '%.100s'"), start); + inst.error = buff; + return (int) FAIL; +} + +/* Handle addc!/add!/and!/cmp!/neg!/not!/or!/sll!/srl!/sra!/xor!/sub!. */ +static void +do16_rdrs (char *str) +{ + skip_whitespace (str); + + if (reglow_required_here (&str, 8) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reglow_required_here (&str, 4) == (int) FAIL + || end_of_line (str) == (int) FAIL) + { + return; + } + else + { + if ((inst.instruction & 0x700f) == 0x2003) /* cmp! */ + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 15) + | (((inst.instruction >> 4) & 0xf) << 10); + } + else if ((inst.instruction & 0x700f) == 0x2006) /* not! */ + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 20) + | (((inst.instruction >> 4) & 0xf) << 15); + } + else + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 20) + | (((inst.instruction >> 8) & 0xf) << 15) | (((inst.instruction >> 4) & 0xf) << 10); + } + inst.relax_size = 4; + } +} + +static void +do16_rs (char *str) +{ + int rd = 0; + + skip_whitespace (str); + + if ((rd = reglow_required_here (&str, 4)) == (int) FAIL + || end_of_line (str) == (int) FAIL) + { + return; + } + else + { + inst.relax_inst |= rd << 20; + inst.relax_size = 4; + } +} + +/* Handle br!/brl!. */ +static void +do16_xrs (char *str) +{ + skip_whitespace (str); + + if (reglow_required_here (&str, 4) == (int) FAIL || end_of_line (str) == (int) FAIL) + { + return; + } + else + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 10) + | (((inst.instruction >> 4) & 0xf) << 15); + inst.relax_size = 4; + } +} + +static int +reghigh_required_here (char **str, int shift) +{ + static char buff[MAX_LITERAL_POOL_SIZE]; + int reg; + char *start = *str; + + if ((reg = score_reg_parse (str, all_reg_maps[REG_TYPE_SCORE].htab)) != (int) FAIL) + { + if (15 < reg && reg < 32) + { + if (shift >= 0) + inst.instruction |= (reg & 0xf) << shift; + + return reg; + } + } + + *str = start; + sprintf (buff, _("high register(r16-r31)expected, not '%.100s'"), start); + inst.error = buff; + return (int) FAIL; +} + +/* Handle mhfl!. */ +static void +do16_hrdrs (char *str) +{ + skip_whitespace (str); + + if (reghigh_required_here (&str, 8) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && reglow_required_here (&str, 4) != (int) FAIL + && end_of_line (str) != (int) FAIL) + { + inst.relax_inst |= ((((inst.instruction >> 8) & 0xf) | 0x10) << 20) + | (((inst.instruction >> 4) & 0xf) << 15) | (0xf << 10); + inst.relax_size = 4; + } +} + +/* Handle mlfh!. */ +static void +do16_rdhrs (char *str) +{ + skip_whitespace (str); + + if (reglow_required_here (&str, 8) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && reghigh_required_here (&str, 4) != (int) FAIL + && end_of_line (str) != (int) FAIL) + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 20) + | ((((inst.instruction >> 4) & 0xf) | 0x10) << 15) | (0xf << 10); + inst.relax_size = 4; + } +} + +/* We need to be able to fix up arbitrary expressions in some statements. + This is so that we can handle symbols that are an arbitrary distance from + the pc. The most common cases are of the form ((+/-sym -/+ . - 8) & mask), + which returns part of an address in a form which will be valid for + a data instruction. We do this by pushing the expression into a symbol + in the expr_section, and creating a fix for that. */ +static fixS * +fix_new_score (fragS * frag, int where, short int size, expressionS * exp, int pc_rel, int reloc) +{ + fixS *new_fix; + + switch (exp->X_op) + { + case O_constant: + case O_symbol: + case O_add: + case O_subtract: + new_fix = fix_new_exp (frag, where, size, exp, pc_rel, reloc); + break; + default: + new_fix = fix_new (frag, where, size, make_expr_symbol (exp), 0, pc_rel, reloc); + break; + } + return new_fix; +} + +static void +init_dependency_vector (void) +{ + int i; + + for (i = 0; i < vector_size; i++) + memset (&dependency_vector[i], '\0', sizeof (dependency_vector[i])); + + return; +} + +static enum insn_type_for_dependency +dependency_type_from_insn (char *insn_name) +{ + char name[INSN_NAME_LEN]; + const struct insn_to_dependency *tmp; + + strcpy (name, insn_name); + tmp = (const struct insn_to_dependency *) hash_find (dependency_insn_hsh, name); + + if (tmp) + return tmp->type; + + return D_all_insn; +} + +static int +check_dependency (char *pre_insn, char *pre_reg, + char *cur_insn, char *cur_reg, int *warn_or_error) +{ + int bubbles = 0; + unsigned int i; + enum insn_type_for_dependency pre_insn_type; + enum insn_type_for_dependency cur_insn_type; + + pre_insn_type = dependency_type_from_insn (pre_insn); + cur_insn_type = dependency_type_from_insn (cur_insn); + + for (i = 0; i < sizeof (data_dependency_table) / sizeof (data_dependency_table[0]); i++) + { + if ((pre_insn_type == data_dependency_table[i].pre_insn_type) + && (D_all_insn == data_dependency_table[i].cur_insn_type + || cur_insn_type == data_dependency_table[i].cur_insn_type) + && (strcmp (data_dependency_table[i].pre_reg, "") == 0 + || strcmp (data_dependency_table[i].pre_reg, pre_reg) == 0) + && (strcmp (data_dependency_table[i].cur_reg, "") == 0 + || strcmp (data_dependency_table[i].cur_reg, cur_reg) == 0)) + { + bubbles = (score7) ? data_dependency_table[i].bubblenum_7 : data_dependency_table[i].bubblenum_5; + *warn_or_error = data_dependency_table[i].warn_or_error; + break; + } + } + + return bubbles; +} + +static void +build_one_frag (struct score_it one_inst) +{ + char *p; + int relaxable_p = g_opt; + int relax_size = 0; + + /* Start a new frag if frag_now is not empty. */ + if (frag_now_fix () != 0) + { + if (!frag_now->tc_frag_data.is_insn) + frag_wane (frag_now); + + frag_new (0); + } + frag_grow (20); + + p = frag_more (one_inst.size); + md_number_to_chars (p, one_inst.instruction, one_inst.size); + +#ifdef OBJ_ELF + dwarf2_emit_insn (one_inst.size); +#endif + + relaxable_p &= (one_inst.relax_size != 0); + relax_size = relaxable_p ? one_inst.relax_size : 0; + + p = frag_var (rs_machine_dependent, relax_size + RELAX_PAD_BYTE, 0, + RELAX_ENCODE (one_inst.size, one_inst.relax_size, + one_inst.type, 0, 0, relaxable_p), + NULL, 0, NULL); + + if (relaxable_p) + md_number_to_chars (p, one_inst.relax_inst, relax_size); +} + +static void +handle_dependency (struct score_it *theinst) +{ + int i; + int warn_or_error = 0; /* warn - 0; error - 1 */ + int bubbles = 0; + int remainder_bubbles = 0; + char cur_insn[INSN_NAME_LEN]; + char pre_insn[INSN_NAME_LEN]; + struct score_it nop_inst; + struct score_it pflush_inst; + + nop_inst.instruction = 0x0000; + nop_inst.size = 2; + nop_inst.relax_inst = 0x80008000; + nop_inst.relax_size = 4; + nop_inst.type = NO16_OPD; + + pflush_inst.instruction = 0x8000800a; + pflush_inst.size = 4; + pflush_inst.relax_inst = 0x8000; + pflush_inst.relax_size = 0; + pflush_inst.type = NO_OPD; + + /* pflush will clear all data dependency. */ + if (strcmp (theinst->name, "pflush") == 0) + { + init_dependency_vector (); + return; + } + + /* Push current instruction to dependency_vector[0]. */ + for (i = vector_size - 1; i > 0; i--) + memcpy (&dependency_vector[i], &dependency_vector[i - 1], sizeof (dependency_vector[i])); + + memcpy (&dependency_vector[0], theinst, sizeof (dependency_vector[i])); + + /* There is no dependency between nop and any instruction. */ + if (strcmp (dependency_vector[0].name, "nop") == 0 + || strcmp (dependency_vector[0].name, "nop!") == 0) + return; + + /* "pce" is defined in insn_to_dependency_table. */ +#define PCE_NAME "pce" + + if (dependency_vector[0].type == Insn_Type_PCE) + strcpy (cur_insn, PCE_NAME); + else + strcpy (cur_insn, dependency_vector[0].name); + + for (i = 1; i < vector_size; i++) + { + /* The element of dependency_vector is NULL. */ + if (dependency_vector[i].name[0] == '\0') + continue; + + if (dependency_vector[i].type == Insn_Type_PCE) + strcpy (pre_insn, PCE_NAME); + else + strcpy (pre_insn, dependency_vector[i].name); + + bubbles = check_dependency (pre_insn, dependency_vector[i].reg, + cur_insn, dependency_vector[0].reg, &warn_or_error); + remainder_bubbles = bubbles - i + 1; + + if (remainder_bubbles > 0) + { + int j; + + if (fix_data_dependency == 1) + { + if (remainder_bubbles <= 2) + { + if (warn_fix_data_dependency) + as_warn (_("Fix data dependency: %s %s -- %s %s (insert %d nop!/%d)"), + dependency_vector[i].name, dependency_vector[i].reg, + dependency_vector[0].name, dependency_vector[0].reg, + remainder_bubbles, bubbles); + + for (j = (vector_size - 1); (j - remainder_bubbles) > 0; j--) + memcpy (&dependency_vector[j], &dependency_vector[j - remainder_bubbles], + sizeof (dependency_vector[j])); + + for (j = 1; j <= remainder_bubbles; j++) + { + memset (&dependency_vector[j], '\0', sizeof (dependency_vector[j])); + /* Insert nop!. */ + build_one_frag (nop_inst); + } + } + else + { + if (warn_fix_data_dependency) + as_warn (_("Fix data dependency: %s %s -- %s %s (insert 1 pflush/%d)"), + dependency_vector[i].name, dependency_vector[i].reg, + dependency_vector[0].name, dependency_vector[0].reg, + bubbles); + + for (j = 1; j < vector_size; j++) + memset (&dependency_vector[j], '\0', sizeof (dependency_vector[j])); + + /* Insert pflush. */ + build_one_frag (pflush_inst); + } + } + else + { + if (warn_or_error) + { + as_bad (_("data dependency: %s %s -- %s %s (%d/%d bubble)"), + dependency_vector[i].name, dependency_vector[i].reg, + dependency_vector[0].name, dependency_vector[0].reg, + remainder_bubbles, bubbles); + } + else + { + as_warn (_("data dependency: %s %s -- %s %s (%d/%d bubble)"), + dependency_vector[i].name, dependency_vector[i].reg, + dependency_vector[0].name, dependency_vector[0].reg, + remainder_bubbles, bubbles); + } + } + } + } +} + +static enum insn_class +get_insn_class_from_type (enum score_insn_type type) +{ + enum insn_class retval = (int) FAIL; + + switch (type) + { + case Rd_I4: + case Rd_I5: + case Rd_rvalueBP_I5: + case Rd_lvalueBP_I5: + case Rd_I8: + case PC_DISP8div2: + case PC_DISP11div2: + case Rd_Rs: + case Rd_HighRs: + case Rd_lvalueRs: + case Rd_rvalueRs: + case x_Rs: + case Rd_LowRs: + case NO16_OPD: + retval = INSN_CLASS_16; + break; + case Rd_Rs_I5: + case x_Rs_I5: + case x_I5_x: + case Rd_Rs_I14: + case I15: + case Rd_I16: + case Rd_SI16: + case Rd_rvalueRs_SI10: + case Rd_lvalueRs_SI10: + case Rd_rvalueRs_preSI12: + case Rd_rvalueRs_postSI12: + case Rd_lvalueRs_preSI12: + case Rd_lvalueRs_postSI12: + case Rd_Rs_SI14: + case Rd_rvalueRs_SI15: + case Rd_lvalueRs_SI15: + case PC_DISP19div2: + case PC_DISP24div2: + case Rd_Rs_Rs: + case x_Rs_x: + case x_Rs_Rs: + case Rd_Rs_x: + case Rd_x_Rs: + case Rd_x_x: + case OP5_rvalueRs_SI15: + case I5_Rs_Rs_I5_OP5: + case x_rvalueRs_post4: + case Rd_rvalueRs_post4: + case Rd_x_I5: + case Rd_lvalueRs_post4: + case x_lvalueRs_post4: + case Rd_Rs_Rs_imm: + case NO_OPD: + case Rd_lvalue32Rs: + case Rd_rvalue32Rs: + case Insn_GP: + case Insn_PIC: + case Insn_internal: + retval = INSN_CLASS_32; + break; + case Insn_Type_PCE: + retval = INSN_CLASS_PCE; + break; + case Insn_Type_SYN: + retval = INSN_CLASS_SYN; + break; + default: + abort (); + break; + } + return retval; +} + +static unsigned long +adjust_paritybit (unsigned long m_code, enum insn_class class) +{ + unsigned long result = 0; + unsigned long m_code_high = 0; + unsigned long m_code_low = 0; + unsigned long pb_high = 0; + unsigned long pb_low = 0; + + if (class == INSN_CLASS_32) + { + pb_high = 0x80000000; + pb_low = 0x00008000; + } + else if (class == INSN_CLASS_16) + { + pb_high = 0; + pb_low = 0; + } + else if (class == INSN_CLASS_PCE) + { + pb_high = 0; + pb_low = 0x00008000; + } + else if (class == INSN_CLASS_SYN) + { + /* FIXME. at this time, INSN_CLASS_SYN must be 32 bit, but, instruction type should + be changed if macro instruction has been expanded. */ + pb_high = 0x80000000; + pb_low = 0x00008000; + } + else + { + abort (); + } + + m_code_high = m_code & 0x3fff8000; + m_code_low = m_code & 0x00007fff; + result = pb_high | (m_code_high << 1) | pb_low | m_code_low; + return result; + +} + +static void +gen_insn_frag (struct score_it *part_1, struct score_it *part_2) +{ + char *p; + bfd_boolean pce_p = FALSE; + int relaxable_p = g_opt; + int relax_size = 0; + struct score_it *inst1 = part_1; + struct score_it *inst2 = part_2; + struct score_it backup_inst1; + + pce_p = (inst2) ? TRUE : FALSE; + memcpy (&backup_inst1, inst1, sizeof (struct score_it)); + + /* Adjust instruction opcode and to be relaxed instruction opcode. */ + if (pce_p) + { + backup_inst1.instruction = ((backup_inst1.instruction & 0x7FFF) << 15) + | (inst2->instruction & 0x7FFF); + backup_inst1.instruction = adjust_paritybit (backup_inst1.instruction, INSN_CLASS_PCE); + backup_inst1.relax_inst = 0x8000; + backup_inst1.size = INSN_SIZE; + backup_inst1.relax_size = 0; + backup_inst1.type = Insn_Type_PCE; + } + else + { + backup_inst1.instruction = adjust_paritybit (backup_inst1.instruction, + GET_INSN_CLASS (backup_inst1.type)); + } + + if (backup_inst1.relax_size != 0) + { + enum insn_class tmp; + + tmp = (backup_inst1.size == INSN_SIZE) ? INSN_CLASS_16 : INSN_CLASS_32; + backup_inst1.relax_inst = adjust_paritybit (backup_inst1.relax_inst, tmp); + } + + /* Check data dependency. */ + handle_dependency (&backup_inst1); + + /* Start a new frag if frag_now is not empty and is not instruction frag, maybe it contains + data produced by .ascii etc. Doing this is to make one instruction per frag. */ + if (frag_now_fix () != 0) + { + if (!frag_now->tc_frag_data.is_insn) + frag_wane (frag_now); + + frag_new (0); + } + + /* Here, we must call frag_grow in order to keep the instruction frag type is + rs_machine_dependent. + For, frag_var may change frag_now->fr_type to rs_fill by calling frag_grow which + acturally will call frag_wane. + Calling frag_grow first will create a new frag_now which free size is 20 that is enough + for frag_var. */ + frag_grow (20); + + p = frag_more (backup_inst1.size); + md_number_to_chars (p, backup_inst1.instruction, backup_inst1.size); + +#ifdef OBJ_ELF + dwarf2_emit_insn (backup_inst1.size); +#endif + + /* Generate fixup structure. */ + if (pce_p) + { + if (inst1->reloc.type != BFD_RELOC_NONE) + fix_new_score (frag_now, p - frag_now->fr_literal, + inst1->size, &inst1->reloc.exp, + inst1->reloc.pc_rel, inst1->reloc.type); + + if (inst2->reloc.type != BFD_RELOC_NONE) + fix_new_score (frag_now, p - frag_now->fr_literal + 2, + inst2->size, &inst2->reloc.exp, inst2->reloc.pc_rel, inst2->reloc.type); + } + else + { + if (backup_inst1.reloc.type != BFD_RELOC_NONE) + fix_new_score (frag_now, p - frag_now->fr_literal, + backup_inst1.size, &backup_inst1.reloc.exp, + backup_inst1.reloc.pc_rel, backup_inst1.reloc.type); + } + + /* relax_size may be 2, 4, 12 or 0, 0 indicates no relaxation. */ + relaxable_p &= (backup_inst1.relax_size != 0); + relax_size = relaxable_p ? backup_inst1.relax_size : 0; + + p = frag_var (rs_machine_dependent, relax_size + RELAX_PAD_BYTE, 0, + RELAX_ENCODE (backup_inst1.size, backup_inst1.relax_size, + backup_inst1.type, 0, 0, relaxable_p), + backup_inst1.reloc.exp.X_add_symbol, 0, NULL); + + if (relaxable_p) + md_number_to_chars (p, backup_inst1.relax_inst, relax_size); + + memcpy (inst1, &backup_inst1, sizeof (struct score_it)); +} + +static void +parse_16_32_inst (char *insnstr, bfd_boolean gen_frag_p) +{ + char c; + char *p; + char *operator = insnstr; + const struct asm_opcode *opcode; + + /* Parse operator and operands. */ + skip_whitespace (operator); + + for (p = operator; *p != '\0'; p++) + if ((*p == ' ') || (*p == '!')) + break; + + if (*p == '!') + p++; + + c = *p; + *p = '\0'; + + opcode = (const struct asm_opcode *) hash_find (score_ops_hsh, operator); + *p = c; + + memset (&inst, '\0', sizeof (inst)); + sprintf (inst.str, "%s", insnstr); + if (opcode) + { + inst.instruction = opcode->value; + inst.relax_inst = opcode->relax_value; + inst.type = opcode->type; + inst.size = GET_INSN_SIZE (inst.type); + inst.relax_size = 0; + inst.bwarn = 0; + sprintf (inst.name, "%s", opcode->template); + strcpy (inst.reg, ""); + inst.error = NULL; + inst.reloc.type = BFD_RELOC_NONE; + + (*opcode->parms) (p); + + /* It indicates current instruction is a macro instruction if inst.bwarn equals -1. */ + if ((inst.bwarn != -1) && (!inst.error) && (gen_frag_p)) + gen_insn_frag (&inst, NULL); + } + else + inst.error = _("unrecognized opcode"); +} + +static int +append_insn (char *str, bfd_boolean gen_frag_p) +{ + int retval = SUCCESS; + + parse_16_32_inst (str, gen_frag_p); + + if (inst.error) + { + retval = (int) FAIL; + as_bad (_("%s -- `%s'"), inst.error, inst.str); + inst.error = NULL; + } + + return retval; +} + +/* Handle mv! reg_high, reg_low; + mv! reg_low, reg_high; + mv! reg_low, reg_low; */ +static void +do16_mv_rdrs (char *str) +{ + int reg_rd; + int reg_rs; + char *backupstr = NULL; + + backupstr = str; + skip_whitespace (str); + + if ((reg_rd = reg_required_here (&str, 8, REG_TYPE_SCORE)) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || (reg_rs = reg_required_here (&str, 4, REG_TYPE_SCORE)) == (int) FAIL + || end_of_line (str) == (int) FAIL) + { + return; + } + else + { + /* Case 1 : mv! or mlfh!. */ + if (reg_rd < 16) + { + if (reg_rs < 16) + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 20) + | (((inst.instruction >> 4) & 0xf) << 15) | (0xf << 10); + inst.relax_size = 4; + } + else + { + char append_str[MAX_LITERAL_POOL_SIZE]; + + sprintf (append_str, "mlfh! %s", backupstr); + if (append_insn (append_str, TRUE) == (int) FAIL) + return; + /* Set bwarn as -1, so macro instruction itself will not be generated frag. */ + inst.bwarn = -1; + } + } + /* Case 2 : mhfl!. */ + else + { + if (reg_rs > 16) + { + SET_INSN_ERROR (BAD_ARGS); + return; + } + else + { + char append_str[MAX_LITERAL_POOL_SIZE]; + + sprintf (append_str, "mhfl! %s", backupstr); + if (append_insn (append_str, TRUE) == (int) FAIL) + return; + + /* Set bwarn as -1, so macro instruction itself will not be generated frag. */ + inst.bwarn = -1; + } + } + } +} + +static void +do16_rdi4 (char *str) +{ + skip_whitespace (str); + + if (reglow_required_here (&str, 8) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || data_op2 (&str, 3, _IMM4) == (int) FAIL + || end_of_line (str) == (int) FAIL) + { + return; + } + else + { + if (((inst.instruction >> 3) & 0x10) == 0) /* for judge is addei or subei : bit 5 =0 : addei */ + { + if (((inst.instruction >> 3) & 0xf) != 0xf) + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 20) + | ((1 << ((inst.instruction >> 3) & 0xf)) << 1); + inst.relax_size = 4; + } + else + { + inst.relax_inst = 0x8000; + } + } + else + { + if (((inst.instruction >> 3) & 0xf) != 0xf) + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 20) + | (((-(1 << ((inst.instruction >> 3) & 0xf))) & 0xffff) << 1); + inst.relax_size = 4; + } + else + { + inst.relax_inst = 0x8000; + } + } + } +} + +static void +do16_rdi5 (char *str) +{ + skip_whitespace (str); + + if (reglow_required_here (&str, 8) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || data_op2 (&str, 3, _IMM5) == (int) FAIL + || end_of_line (str) == (int) FAIL) + return; + else + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 20) + | (((inst.instruction >> 8) & 0xf) << 15) | (((inst.instruction >> 3) & 0x1f) << 10); + inst.relax_size = 4; + } +} + +/* Handle sdbbp. */ +static void +do16_xi5 (char *str) +{ + skip_whitespace (str); + + if (data_op2 (&str, 3, _IMM5) == (int) FAIL || end_of_line (str) == (int) FAIL) + return; + else + { + inst.relax_inst |= (((inst.instruction >> 3) & 0x1f) << 15); + inst.relax_size = 4; + } +} + +/* Check that an immediate is word alignment or half word alignment. + If so, convert it to the right format. */ +static int +validate_immediate_align (int val, unsigned int data_type) +{ + if (data_type == _IMM5_RSHIFT_1) + { + if (val % 2) + { + inst.error = _("address offset must be half word alignment"); + return (int) FAIL; + } + } + else if ((data_type == _IMM5_RSHIFT_2) || (data_type == _IMM10_RSHIFT_2)) + { + if (val % 4) + { + inst.error = _("address offset must be word alignment"); + return (int) FAIL; + } + } + + return SUCCESS; +} + +static int +exp_ldst_offset (char **str, int shift, unsigned int data_type) +{ + char *dataptr; + + dataptr = * str; + + if ((*dataptr == '0') && (*(dataptr + 1) == 'x') + && (data_type != _SIMM16_LA) + && (data_type != _VALUE_HI16) + && (data_type != _VALUE_LO16) + && (data_type != _IMM16) + && (data_type != _IMM15) + && (data_type != _IMM14) + && (data_type != _IMM4) + && (data_type != _IMM5) + && (data_type != _IMM8) + && (data_type != _IMM5_RSHIFT_1) + && (data_type != _IMM5_RSHIFT_2) + && (data_type != _SIMM14_NEG) + && (data_type != _IMM10_RSHIFT_2)) + { + data_type += 24; + } + + if (my_get_expression (&inst.reloc.exp, str) == (int) FAIL) + return (int) FAIL; + + if (inst.reloc.exp.X_op == O_constant) + { + /* Need to check the immediate align. */ + int value = validate_immediate_align (inst.reloc.exp.X_add_number, data_type); + + if (value == (int) FAIL) + return (int) FAIL; + + value = validate_immediate (inst.reloc.exp.X_add_number, data_type, 0); + if (value == (int) FAIL) + { + if (data_type < 30) + sprintf (err_msg, + _("invalid constant: %d bit expression not in range %d..%d"), + score_df_range[data_type].bits, + score_df_range[data_type].range[0], score_df_range[data_type].range[1]); + else + sprintf (err_msg, + _("invalid constant: %d bit expression not in range %d..%d"), + score_df_range[data_type - 24].bits, + score_df_range[data_type - 24].range[0], score_df_range[data_type - 24].range[1]); + inst.error = err_msg; + return (int) FAIL; + } + + if (data_type == _IMM5_RSHIFT_1) + { + value >>= 1; + } + else if ((data_type == _IMM5_RSHIFT_2) || (data_type == _IMM10_RSHIFT_2)) + { + value >>= 2; + } + + if (score_df_range[data_type].range[0] != 0) + { + value &= (1 << score_df_range[data_type].bits) - 1; + } + + inst.instruction |= value << shift; + } + else + { + inst.reloc.pc_rel = 0; + } + + return SUCCESS; +} + +static void +do_ldst_insn (char *str) +{ + int pre_inc = 0; + int conflict_reg; + int value; + char * temp; + char *strbak; + char *dataptr; + int reg; + int ldst_idx = 0; + + strbak = str; + skip_whitespace (str); + + if (((conflict_reg = reg_required_here (&str, 20, REG_TYPE_SCORE)) == (int) FAIL) + || (skip_past_comma (&str) == (int) FAIL)) + return; + + /* ld/sw rD, [rA, simm15] ld/sw rD, [rA]+, simm12 ld/sw rD, [rA, simm12]+. */ + if (*str == '[') + { + str++; + skip_whitespace (str); + + if ((reg = reg_required_here (&str, 15, REG_TYPE_SCORE)) == (int) FAIL) + return; + + /* Conflicts can occur on stores as well as loads. */ + conflict_reg = (conflict_reg == reg); + skip_whitespace (str); + temp = str + 1; /* The latter will process decimal/hex expression. */ + + /* ld/sw rD, [rA]+, simm12 ld/sw rD, [rA]+. */ + if (*str == ']') + { + str++; + if (*str == '+') + { + str++; + /* ld/sw rD, [rA]+, simm12. */ + if (skip_past_comma (&str) == SUCCESS) + { + if ((exp_ldst_offset (&str, 3, _SIMM12) == (int) FAIL) + || (end_of_line (str) == (int) FAIL)) + return; + + if (conflict_reg) + { + unsigned int ldst_func = inst.instruction & OPC_PSEUDOLDST_MASK; + + if ((ldst_func == INSN_LH) + || (ldst_func == INSN_LHU) + || (ldst_func == INSN_LW) + || (ldst_func == INSN_LB) + || (ldst_func == INSN_LBU)) + { + inst.error = _("register same as write-back base"); + return; + } + } + + ldst_idx = inst.instruction & OPC_PSEUDOLDST_MASK; + inst.instruction &= ~OPC_PSEUDOLDST_MASK; + inst.instruction |= score_ldst_insns[ldst_idx * 3 + LDST_POST].value; + + /* lw rD, [rA]+, 4 convert to pop rD, [rA]. */ + if ((inst.instruction & 0x3e000007) == 0x0e000000) + { + /* rs = r0-r7, offset = 4 */ + if ((((inst.instruction >> 15) & 0x18) == 0) + && (((inst.instruction >> 3) & 0xfff) == 4)) + { + /* Relax to pophi. */ + if ((((inst.instruction >> 20) & 0x10) == 0x10)) + { + inst.relax_inst = 0x0000200a | (((inst.instruction >> 20) & 0xf) + << 8) | 1 << 7 | + (((inst.instruction >> 15) & 0x7) << 4); + } + /* Relax to pop. */ + else + { + inst.relax_inst = 0x0000200a | (((inst.instruction >> 20) & 0xf) + << 8) | 0 << 7 | + (((inst.instruction >> 15) & 0x7) << 4); + } + inst.relax_size = 2; + } + } + return; + } + /* ld/sw rD, [rA]+ convert to ld/sw rD, [rA, 0]+. */ + else + { + SET_INSN_ERROR (NULL); + if (end_of_line (str) == (int) FAIL) + { + return; + } + + pre_inc = 1; + value = validate_immediate (inst.reloc.exp.X_add_number, _SIMM12, 0); + value &= (1 << score_df_range[_SIMM12].bits) - 1; + ldst_idx = inst.instruction & OPC_PSEUDOLDST_MASK; + inst.instruction &= ~OPC_PSEUDOLDST_MASK; + inst.instruction |= score_ldst_insns[ldst_idx * 3 + pre_inc].value; + inst.instruction |= value << 3; + inst.relax_inst = 0x8000; + return; + } + } + /* ld/sw rD, [rA] convert to ld/sw rD, [rA, simm15]. */ + else + { + if (end_of_line (str) == (int) FAIL) + return; + + ldst_idx = inst.instruction & OPC_PSEUDOLDST_MASK; + inst.instruction &= ~OPC_PSEUDOLDST_MASK; + inst.instruction |= score_ldst_insns[ldst_idx * 3 + LDST_NOUPDATE].value; + + /* lbu rd, [rs] -> lbu! rd, [rs] */ + if (ldst_idx == INSN_LBU) + { + inst.relax_inst = INSN16_LBU; + } + else if (ldst_idx == INSN_LH) + { + inst.relax_inst = INSN16_LH; + } + else if (ldst_idx == INSN_LW) + { + inst.relax_inst = INSN16_LW; + } + else if (ldst_idx == INSN_SB) + { + inst.relax_inst = INSN16_SB; + } + else if (ldst_idx == INSN_SH) + { + inst.relax_inst = INSN16_SH; + } + else if (ldst_idx == INSN_SW) + { + inst.relax_inst = INSN16_SW; + } + else + { + inst.relax_inst = 0x8000; + } + + /* lw/lh/lbu/sw/sh/sb, offset = 0, relax to 16 bit instruction. */ + if ((ldst_idx == INSN_LBU) + || (ldst_idx == INSN_LH) + || (ldst_idx == INSN_LW) + || (ldst_idx == INSN_SB) || (ldst_idx == INSN_SH) || (ldst_idx == INSN_SW)) + { + if ((((inst.instruction >> 15) & 0x10) == 0) && (((inst.instruction >> 20) & 0x10) == 0)) + { + inst.relax_inst |= (2 << 12) | (((inst.instruction >> 20) & 0xf) << 8) | + (((inst.instruction >> 15) & 0xf) << 4); + inst.relax_size = 2; + } + } + + return; + } + } + /* ld/sw rD, [rA, simm15] ld/sw rD, [rA, simm12]+. */ + else + { + if (skip_past_comma (&str) == (int) FAIL) + { + inst.error = _("pre-indexed expression expected"); + return; + } + + if (my_get_expression (&inst.reloc.exp, &str) == (int) FAIL) + return; + + skip_whitespace (str); + if (*str++ != ']') + { + inst.error = _("missing ]"); + return; + } + + skip_whitespace (str); + /* ld/sw rD, [rA, simm12]+. */ + if (*str == '+') + { + str++; + pre_inc = 1; + if (conflict_reg) + { + unsigned int ldst_func = inst.instruction & OPC_PSEUDOLDST_MASK; + + if ((ldst_func == INSN_LH) + || (ldst_func == INSN_LHU) + || (ldst_func == INSN_LW) + || (ldst_func == INSN_LB) + || (ldst_func == INSN_LBU)) + { + inst.error = _("register same as write-back base"); + return; + } + } + } + + if (end_of_line (str) == (int) FAIL) + return; + + if (inst.reloc.exp.X_op == O_constant) + { + int value; + unsigned int data_type; + + if (pre_inc == 1) + data_type = _SIMM12; + else + data_type = _SIMM15; + dataptr = temp; + + if ((*dataptr == '0') && (*(dataptr + 1) == 'x') + && (data_type != _SIMM16_LA) + && (data_type != _VALUE_HI16) + && (data_type != _VALUE_LO16) + && (data_type != _IMM16) + && (data_type != _IMM15) + && (data_type != _IMM14) + && (data_type != _IMM4) + && (data_type != _IMM5) + && (data_type != _IMM8) + && (data_type != _IMM5_RSHIFT_1) + && (data_type != _IMM5_RSHIFT_2) + && (data_type != _SIMM14_NEG) + && (data_type != _IMM10_RSHIFT_2)) + { + data_type += 24; + } + + value = validate_immediate (inst.reloc.exp.X_add_number, data_type, 0); + if (value == (int) FAIL) + { + if (data_type < 30) + sprintf (err_msg, + _("invalid constant: %d bit expression not in range %d..%d"), + score_df_range[data_type].bits, + score_df_range[data_type].range[0], score_df_range[data_type].range[1]); + else + sprintf (err_msg, + _("invalid constant: %d bit expression not in range %d..%d"), + score_df_range[data_type - 24].bits, + score_df_range[data_type - 24].range[0], + score_df_range[data_type - 24].range[1]); + inst.error = err_msg; + return; + } + + value &= (1 << score_df_range[data_type].bits) - 1; + ldst_idx = inst.instruction & OPC_PSEUDOLDST_MASK; + inst.instruction &= ~OPC_PSEUDOLDST_MASK; + inst.instruction |= score_ldst_insns[ldst_idx * 3 + pre_inc].value; + if (pre_inc == 1) + inst.instruction |= value << 3; + else + inst.instruction |= value; + + /* lw rD, [rA, simm15] */ + if ((inst.instruction & 0x3e000000) == 0x20000000) + { + /* Both rD and rA are in [r0 - r15]. */ + if ((((inst.instruction >> 15) & 0x10) == 0) + && (((inst.instruction >> 20) & 0x10) == 0)) + { + /* simm15 = 0, lw -> lw!. */ + if ((inst.instruction & 0x7fff) == 0) + { + inst.relax_inst |= (((inst.instruction >> 15) & 0xf) << 4) + | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + /* rA = r2, lw -> lwp!. */ + else if ((((inst.instruction >> 15) & 0xf) == 2) + && ((inst.instruction & 0x3) == 0) + && ((inst.instruction & 0x7fff) < 128)) + { + inst.relax_inst = 0x7000 | (((inst.instruction >> 20) & 0xf) << 8) + | (((inst.instruction & 0x7fff) >> 2) << 3); + inst.relax_size = 2; + } + else + { + inst.relax_inst = 0x8000; + } + } + else + { + inst.relax_inst = 0x8000; + } + } + /* sw rD, [rA, simm15] */ + else if ((inst.instruction & 0x3e000000) == 0x28000000) + { + /* Both rD and rA are in [r0 - r15]. */ + if ((((inst.instruction >> 15) & 0x10) == 0) && (((inst.instruction >> 20) & 0x10) == 0)) + { + /* simm15 = 0, sw -> sw!. */ + if ((inst.instruction & 0x7fff) == 0) + { + inst.relax_inst |= (((inst.instruction >> 15) & 0xf) << 4) + | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + /* rA = r2, sw -> swp!. */ + else if ((((inst.instruction >> 15) & 0xf) == 2) + && ((inst.instruction & 0x3) == 0) + && ((inst.instruction & 0x7fff) < 128)) + { + inst.relax_inst = 0x7004 | (((inst.instruction >> 20) & 0xf) << 8) + | (((inst.instruction & 0x7fff) >> 2) << 3); + inst.relax_size = 2; + } + else + { + inst.relax_inst = 0x8000; + } + } + else + { + inst.relax_inst = 0x8000; + } + } + /* sw rD, [rA, simm15]+ sw pre. */ + else if ((inst.instruction & 0x3e000007) == 0x06000004) + { + /* rA is in [r0 - r7], and simm15 = -4. */ + if ((((inst.instruction >> 15) & 0x18) == 0) + && (((inst.instruction >> 3) & 0xfff) == 0xffc)) + { + /* sw -> pushhi!. */ + if ((((inst.instruction >> 20) & 0x10) == 0x10)) + { + inst.relax_inst = 0x0000200e | (((inst.instruction >> 20) & 0xf) << 8) + | 1 << 7 | (((inst.instruction >> 15) & 0x7) << 4); + inst.relax_size = 2; + } + /* sw -> push!. */ + else + { + inst.relax_inst = 0x0000200e | (((inst.instruction >> 20) & 0xf) << 8) + | 0 << 7 | (((inst.instruction >> 15) & 0x7) << 4); + inst.relax_size = 2; + } + } + else + { + inst.relax_inst = 0x8000; + } + } + /* lh rD, [rA, simm15] */ + else if ((inst.instruction & 0x3e000000) == 0x22000000) + { + /* Both rD and rA are in [r0 - r15]. */ + if ((((inst.instruction >> 15) & 0x10) == 0) && (((inst.instruction >> 20) & 0x10) == 0)) + { + /* simm15 = 0, lh -> lh!. */ + if ((inst.instruction & 0x7fff) == 0) + { + inst.relax_inst |= (((inst.instruction >> 15) & 0xf) << 4) + | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + /* rA = r2, lh -> lhp!. */ + else if ((((inst.instruction >> 15) & 0xf) == 2) + && ((inst.instruction & 0x1) == 0) + && ((inst.instruction & 0x7fff) < 64)) + { + inst.relax_inst = 0x7001 | (((inst.instruction >> 20) & 0xf) << 8) + | (((inst.instruction & 0x7fff) >> 1) << 3); + inst.relax_size = 2; + } + else + { + inst.relax_inst = 0x8000; + } + } + else + { + inst.relax_inst = 0x8000; + } + } + /* sh rD, [rA, simm15] */ + else if ((inst.instruction & 0x3e000000) == 0x2a000000) + { + /* Both rD and rA are in [r0 - r15]. */ + if ((((inst.instruction >> 15) & 0x10) == 0) && (((inst.instruction >> 20) & 0x10) == 0)) + { + /* simm15 = 0, sh -> sh!. */ + if ((inst.instruction & 0x7fff) == 0) + { + inst.relax_inst |= (((inst.instruction >> 15) & 0xf) << 4) + | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + /* rA = r2, sh -> shp!. */ + else if ((((inst.instruction >> 15) & 0xf) == 2) + && ((inst.instruction & 0x1) == 0) + && ((inst.instruction & 0x7fff) < 64)) + { + inst.relax_inst = 0x7005 | (((inst.instruction >> 20) & 0xf) << 8) + | (((inst.instruction & 0x7fff) >> 1) << 3); + inst.relax_size = 2; + } + else + { + inst.relax_inst = 0x8000; + } + } + else + { + inst.relax_inst = 0x8000; + } + } + /* lbu rD, [rA, simm15] */ + else if ((inst.instruction & 0x3e000000) == 0x2c000000) + { + /* Both rD and rA are in [r0 - r15]. */ + if ((((inst.instruction >> 15) & 0x10) == 0) && (((inst.instruction >> 20) & 0x10) == 0)) + { + /* simm15 = 0, lbu -> lbu!. */ + if ((inst.instruction & 0x7fff) == 0) + { + inst.relax_inst |= (((inst.instruction >> 15) & 0xf) << 4) + | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + /* rA = r2, lbu -> lbup!. */ + else if ((((inst.instruction >> 15) & 0xf) == 2) + && ((inst.instruction & 0x7fff) < 32)) + { + inst.relax_inst = 0x7003 | (((inst.instruction >> 20) & 0xf) << 8) + | ((inst.instruction & 0x7fff) << 3); + inst.relax_size = 2; + } + else + { + inst.relax_inst = 0x8000; + } + } + else + { + inst.relax_inst = 0x8000; + } + } + /* sb rD, [rA, simm15] */ + else if ((inst.instruction & 0x3e000000) == 0x2e000000) + { + /* Both rD and rA are in [r0 - r15]. */ + if ((((inst.instruction >> 15) & 0x10) == 0) && (((inst.instruction >> 20) & 0x10) == 0)) + { + /* simm15 = 0, sb -> sb!. */ + if ((inst.instruction & 0x7fff) == 0) + { + inst.relax_inst |= (((inst.instruction >> 15) & 0xf) << 4) + | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + /* rA = r2, sb -> sb!. */ + else if ((((inst.instruction >> 15) & 0xf) == 2) + && ((inst.instruction & 0x7fff) < 32)) + { + inst.relax_inst = 0x7007 | (((inst.instruction >> 20) & 0xf) << 8) + | ((inst.instruction & 0x7fff) << 3); + inst.relax_size = 2; + } + else + { + inst.relax_inst = 0x8000; + } + } + else + { + inst.relax_inst = 0x8000; + } + } + else + { + inst.relax_inst = 0x8000; + } + + return; + } + else + { + /* FIXME: may set error, for there is no ld/sw rD, [rA, label] */ + inst.reloc.pc_rel = 0; + } + } + } + else + { + inst.error = BAD_ARGS; + } +} + +/* Handle cache. */ + +static void +do_cache (char *str) +{ + skip_whitespace (str); + + if ((data_op2 (&str, 20, _IMM5) == (int) FAIL) || (skip_past_comma (&str) == (int) FAIL)) + { + return; + } + else + { + int cache_op; + + cache_op = (inst.instruction >> 20) & 0x1F; + sprintf (inst.name, "cache %d", cache_op); + } + + if (*str == '[') + { + str++; + skip_whitespace (str); + + if (reg_required_here (&str, 15, REG_TYPE_SCORE) == (int) FAIL) + return; + + skip_whitespace (str); + + /* cache op, [rA] */ + if (skip_past_comma (&str) == (int) FAIL) + { + SET_INSN_ERROR (NULL); + if (*str != ']') + { + inst.error = _("missing ]"); + return; + } + str++; + } + /* cache op, [rA, simm15] */ + else + { + if (exp_ldst_offset (&str, 0, _SIMM15) == (int) FAIL) + { + return; + } + + skip_whitespace (str); + if (*str++ != ']') + { + inst.error = _("missing ]"); + return; + } + } + + if (end_of_line (str) == (int) FAIL) + return; + } + else + { + inst.error = BAD_ARGS; + } +} + +static void +do_crdcrscrsimm5 (char *str) +{ + char *strbak; + + strbak = str; + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE_CR) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reg_required_here (&str, 15, REG_TYPE_SCORE_CR) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reg_required_here (&str, 10, REG_TYPE_SCORE_CR) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL) + { + str = strbak; + /* cop1 cop_code20. */ + if (data_op2 (&str, 5, _IMM20) == (int) FAIL) + return; + } + else + { + if (data_op2 (&str, 5, _IMM5) == (int) FAIL) + return; + } + + end_of_line (str); +} + +/* Handle ldc/stc. */ +static void +do_ldst_cop (char *str) +{ + skip_whitespace (str); + + if ((reg_required_here (&str, 15, REG_TYPE_SCORE_CR) == (int) FAIL) + || (skip_past_comma (&str) == (int) FAIL)) + return; + + if (*str == '[') + { + str++; + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) == (int) FAIL) + return; + + skip_whitespace (str); + + if (*str++ != ']') + { + if (exp_ldst_offset (&str, 5, _IMM10_RSHIFT_2) == (int) FAIL) + return; + + skip_whitespace (str); + if (*str++ != ']') + { + inst.error = _("missing ]"); + return; + } + } + + end_of_line (str); + } + else + inst.error = BAD_ARGS; +} + +static void +do16_ldst_insn (char *str) +{ + skip_whitespace (str); + + if ((reglow_required_here (&str, 8) == (int) FAIL) || (skip_past_comma (&str) == (int) FAIL)) + return; + + if (*str == '[') + { + int reg; + + str++; + skip_whitespace (str); + + if ((reg = reglow_required_here (&str, 4)) == (int) FAIL) + return; + + skip_whitespace (str); + if (*str++ == ']') + { + if (end_of_line (str) == (int) FAIL) + return; + else + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 20) + | (((inst.instruction >> 4) & 0xf) << 15); + inst.relax_size = 4; + } + } + else + { + inst.error = _("missing ]"); + } + } + else + { + inst.error = BAD_ARGS; + } +} + +/* Handle lbup!/lhp!/ldiu!/lwp!/sbp!/shp!/swp!. */ +static void +do16_ldst_imm_insn (char *str) +{ + char data_exp[MAX_LITERAL_POOL_SIZE]; + int reg_rd; + char *dataptr = NULL, *pp = NULL; + int cnt = 0; + int assign_data = (int) FAIL; + unsigned int ldst_func; + + skip_whitespace (str); + + if (((reg_rd = reglow_required_here (&str, 8)) == (int) FAIL) + || (skip_past_comma (&str) == (int) FAIL)) + return; + + skip_whitespace (str); + dataptr = str; + + while ((*dataptr != '\0') && (*dataptr != '|') && (cnt <= MAX_LITERAL_POOL_SIZE)) + { + data_exp[cnt] = *dataptr; + dataptr++; + cnt++; + } + + data_exp[cnt] = '\0'; + pp = &data_exp[0]; + + str = dataptr; + + ldst_func = inst.instruction & LDST16_RI_MASK; + if (ldst_func == N16_LIU) + assign_data = exp_ldst_offset (&pp, 0, _IMM8); + else if (ldst_func == N16_LHP || ldst_func == N16_SHP) + assign_data = exp_ldst_offset (&pp, 3, _IMM5_RSHIFT_1); + else if (ldst_func == N16_LWP || ldst_func == N16_SWP) + assign_data = exp_ldst_offset (&pp, 3, _IMM5_RSHIFT_2); + else + assign_data = exp_ldst_offset (&pp, 3, _IMM5); + + if ((assign_data == (int) FAIL) || (end_of_line (pp) == (int) FAIL)) + return; + else + { + if ((inst.instruction & 0x7000) == N16_LIU) + { + inst.relax_inst |= ((inst.instruction >> 8) & 0xf) << 20 + | ((inst.instruction & 0xff) << 1); + } + else if (((inst.instruction & 0x7007) == N16_LHP) + || ((inst.instruction & 0x7007) == N16_SHP)) + { + inst.relax_inst |= ((inst.instruction >> 8) & 0xf) << 20 | 2 << 15 + | (((inst.instruction >> 3) & 0x1f) << 1); + } + else if (((inst.instruction & 0x7007) == N16_LWP) + || ((inst.instruction & 0x7007) == N16_SWP)) + { + inst.relax_inst |= ((inst.instruction >> 8) & 0xf) << 20 | 2 << 15 + | (((inst.instruction >> 3) & 0x1f) << 2); + } + else if (((inst.instruction & 0x7007) == N16_LBUP) + || ((inst.instruction & 0x7007) == N16_SBP)) + { + inst.relax_inst |= ((inst.instruction >> 8) & 0xf) << 20 | 2 << 15 + | (((inst.instruction >> 3) & 0x1f)); + } + + inst.relax_size = 4; + } +} + +static void +do16_push_pop (char *str) +{ + int reg_rd; + int H_bit_mask = 0; + + skip_whitespace (str); + if (((reg_rd = reg_required_here (&str, 8, REG_TYPE_SCORE)) == (int) FAIL) + || (skip_past_comma (&str) == (int) FAIL)) + return; + + if (reg_rd >= 16) + H_bit_mask = 1; + + /* reg_required_here will change bit 12 of opcode, so we must restore bit 12. */ + inst.instruction &= ~(1 << 12); + + inst.instruction |= H_bit_mask << 7; + + if (*str == '[') + { + int reg; + + str++; + skip_whitespace (str); + if ((reg = reg_required_here (&str, 4, REG_TYPE_SCORE)) == (int) FAIL) + return; + else if (reg > 7) + { + if (!inst.error) + inst.error = _("base register nums are over 3 bit"); + + return; + } + + skip_whitespace (str); + if ((*str++ != ']') || (end_of_line (str) == (int) FAIL)) + { + if (!inst.error) + inst.error = _("missing ]"); + + return; + } + + /* pop! */ + if ((inst.instruction & 0xf) == 0xa) + { + if (H_bit_mask) + { + inst.relax_inst |= ((((inst.instruction >> 8) & 0xf) | 0x10) << 20) + | (((inst.instruction >> 4) & 0x7) << 15) | (4 << 3); + } + else + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 20) + | (((inst.instruction >> 4) & 0x7) << 15) | (4 << 3); + } + } + /* push! */ + else + { + if (H_bit_mask) + { + inst.relax_inst |= ((((inst.instruction >> 8) & 0xf) | 0x10) << 20) + | (((inst.instruction >> 4) & 0x7) << 15) | (((-4) & 0xfff) << 3); + } + else + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 20) + | (((inst.instruction >> 4) & 0x7) << 15) | (((-4) & 0xfff) << 3); + } + } + inst.relax_size = 4; + } + else + { + inst.error = BAD_ARGS; + } +} + +/* Handle lcb/lcw/lce/scb/scw/sce. */ +static void +do_ldst_unalign (char *str) +{ + int conflict_reg; + + if (university_version == 1) + { + inst.error = ERR_FOR_SCORE5U_ATOMIC; + return; + } + + skip_whitespace (str); + + /* lcb/scb [rA]+. */ + if (*str == '[') + { + str++; + skip_whitespace (str); + + if (reg_required_here (&str, 15, REG_TYPE_SCORE) == (int) FAIL) + return; + + if (*str++ == ']') + { + if (*str++ != '+') + { + inst.error = _("missing +"); + return; + } + } + else + { + inst.error = _("missing ]"); + return; + } + + if (end_of_line (str) == (int) FAIL) + return; + } + /* lcw/lce/scb/sce rD, [rA]+. */ + else + { + if (((conflict_reg = reg_required_here (&str, 20, REG_TYPE_SCORE)) == (int) FAIL) + || (skip_past_comma (&str) == (int) FAIL)) + { + return; + } + + skip_whitespace (str); + if (*str++ == '[') + { + int reg; + + skip_whitespace (str); + if ((reg = reg_required_here (&str, 15, REG_TYPE_SCORE)) == (int) FAIL) + { + return; + } + + /* Conflicts can occur on stores as well as loads. */ + conflict_reg = (conflict_reg == reg); + skip_whitespace (str); + if (*str++ == ']') + { + unsigned int ldst_func = inst.instruction & LDST_UNALIGN_MASK; + + if (*str++ == '+') + { + if (conflict_reg) + { + as_warn (_("%s register same as write-back base"), + ((ldst_func & UA_LCE) || (ldst_func & UA_LCW) + ? _("destination") : _("source"))); + } + } + else + { + inst.error = _("missing +"); + return; + } + + if (end_of_line (str) == (int) FAIL) + return; + } + else + { + inst.error = _("missing ]"); + return; + } + } + else + { + inst.error = BAD_ARGS; + return; + } + } +} + +/* Handle alw/asw. */ +static void +do_ldst_atomic (char *str) +{ + if (university_version == 1) + { + inst.error = ERR_FOR_SCORE5U_ATOMIC; + return; + } + + skip_whitespace (str); + + if ((reg_required_here (&str, 20, REG_TYPE_SCORE) == (int) FAIL) + || (skip_past_comma (&str) == (int) FAIL)) + { + return; + } + else + { + + skip_whitespace (str); + if (*str++ == '[') + { + int reg; + + skip_whitespace (str); + if ((reg = reg_required_here (&str, 15, REG_TYPE_SCORE)) == (int) FAIL) + { + return; + } + + skip_whitespace (str); + if (*str++ != ']') + { + inst.error = _("missing ]"); + return; + } + + end_of_line (str); + } + else + inst.error = BAD_ARGS; + } +} + +static void +build_relax_frag (struct score_it fix_insts[RELAX_INST_NUM], int fix_num ATTRIBUTE_UNUSED, + struct score_it var_insts[RELAX_INST_NUM], int var_num, + symbolS *add_symbol) +{ + int i; + char *p; + fixS *fixp = NULL; + fixS *cur_fixp = NULL; + long where; + struct score_it inst_main; + + memcpy (&inst_main, &fix_insts[0], sizeof (struct score_it)); + + /* Adjust instruction opcode and to be relaxed instruction opcode. */ + inst_main.instruction = adjust_paritybit (inst_main.instruction, GET_INSN_CLASS (inst_main.type)); + inst_main.type = Insn_PIC; + + for (i = 0; i < var_num; i++) + { + inst_main.relax_size += var_insts[i].size; + var_insts[i].instruction = adjust_paritybit (var_insts[i].instruction, + GET_INSN_CLASS (var_insts[i].type)); + } + + /* Check data dependency. */ + handle_dependency (&inst_main); + + /* Start a new frag if frag_now is not empty. */ + if (frag_now_fix () != 0) + { + if (!frag_now->tc_frag_data.is_insn) + { + frag_wane (frag_now); + } + frag_new (0); + } + frag_grow (20); + + /* Write fr_fix part. */ + p = frag_more (inst_main.size); + md_number_to_chars (p, inst_main.instruction, inst_main.size); + + if (inst_main.reloc.type != BFD_RELOC_NONE) + fixp = fix_new_score (frag_now, p - frag_now->fr_literal, inst_main.size, + &inst_main.reloc.exp, inst_main.reloc.pc_rel, inst_main.reloc.type); + + frag_now->tc_frag_data.fixp = fixp; + cur_fixp = frag_now->tc_frag_data.fixp; + +#ifdef OBJ_ELF + dwarf2_emit_insn (inst_main.size); +#endif + + where = p - frag_now->fr_literal + inst_main.size; + for (i = 0; i < var_num; i++) + { + if (i > 0) + where += var_insts[i - 1].size; + + if (var_insts[i].reloc.type != BFD_RELOC_NONE) + { + fixp = fix_new_score (frag_now, where, var_insts[i].size, + &var_insts[i].reloc.exp, var_insts[i].reloc.pc_rel, + var_insts[i].reloc.type); + if (fixp) + { + if (cur_fixp) + { + cur_fixp->fx_next = fixp; + cur_fixp = cur_fixp->fx_next; + } + else + { + frag_now->tc_frag_data.fixp = fixp; + cur_fixp = frag_now->tc_frag_data.fixp; + } + } + } + } + + p = frag_var (rs_machine_dependent, inst_main.relax_size + RELAX_PAD_BYTE, 0, + RELAX_ENCODE (inst_main.size, inst_main.relax_size, inst_main.type, + 0, inst_main.size, 0), add_symbol, 0, NULL); + + /* Write fr_var part. + no calling gen_insn_frag, no fixS will be generated. */ + for (i = 0; i < var_num; i++) + { + md_number_to_chars (p, var_insts[i].instruction, var_insts[i].size); + p += var_insts[i].size; + } + /* Set bwarn as -1, so macro instruction itself will not be generated frag. */ + inst.bwarn = -1; +} + +/* Build a relax frag for la instruction when generating PIC, + external symbol first and local symbol second. */ + +static void +build_la_pic (int reg_rd, expressionS exp) +{ + symbolS *add_symbol = exp.X_add_symbol; + offsetT add_number = exp.X_add_number; + struct score_it fix_insts[RELAX_INST_NUM]; + struct score_it var_insts[RELAX_INST_NUM]; + int fix_num = 0; + int var_num = 0; + char tmp[MAX_LITERAL_POOL_SIZE]; + int r1_bak; + + r1_bak = nor1; + nor1 = 0; + + if (add_number == 0) + { + fix_num = 1; + var_num = 2; + + /* For an external symbol, only one insn is generated; + For a local symbol, two insns are generated. */ + /* Fix part + For an external symbol: lw rD, ($gp) + (BFD_RELOC_SCORE_GOT15 or BFD_RELOC_SCORE_CALL15) */ + sprintf (tmp, "lw_pic r%d, %s", reg_rd, add_symbol->bsym->name); + if (append_insn (tmp, FALSE) == (int) FAIL) + return; + + if (reg_rd == PIC_CALL_REG) + inst.reloc.type = BFD_RELOC_SCORE_CALL15; + memcpy (&fix_insts[0], &inst, sizeof (struct score_it)); + + /* Var part + For a local symbol : + lw rD, ($gp) (BFD_RELOC_SCORE_GOT15) + addi rD, (BFD_RELOC_GOT_LO16) */ + inst.reloc.type = BFD_RELOC_SCORE_GOT15; + memcpy (&var_insts[0], &inst, sizeof (struct score_it)); + sprintf (tmp, "addi_s_pic r%d, %s", reg_rd, add_symbol->bsym->name); + if (append_insn (tmp, FALSE) == (int) FAIL) + return; + + memcpy (&var_insts[1], &inst, sizeof (struct score_it)); + build_relax_frag (fix_insts, fix_num, var_insts, var_num, add_symbol); + } + else if (add_number >= -0x8000 && add_number <= 0x7fff) + { + /* Insn 1: lw rD, ($gp) (BFD_RELOC_SCORE_GOT15) */ + sprintf (tmp, "lw_pic r%d, %s", reg_rd, add_symbol->bsym->name); + if (append_insn (tmp, TRUE) == (int) FAIL) + return; + + /* Insn 2 */ + fix_num = 1; + var_num = 1; + /* Fix part + For an external symbol: addi rD, */ + sprintf (tmp, "addi r%d, %d", reg_rd, (int)add_number); + if (append_insn (tmp, FALSE) == (int) FAIL) + return; + + memcpy (&fix_insts[0], &inst, sizeof (struct score_it)); + + /* Var part + For a local symbol: addi rD, + (BFD_RELOC_GOT_LO16) */ + sprintf (tmp, "addi_s_pic r%d, %s + %d", reg_rd, add_symbol->bsym->name, (int)add_number); + if (append_insn (tmp, FALSE) == (int) FAIL) + return; + + memcpy (&var_insts[0], &inst, sizeof (struct score_it)); + build_relax_frag (fix_insts, fix_num, var_insts, var_num, add_symbol); + } + else + { + int hi = (add_number >> 16) & 0x0000FFFF; + int lo = add_number & 0x0000FFFF; + + /* Insn 1: lw rD, ($gp) (BFD_RELOC_SCORE_GOT15) */ + sprintf (tmp, "lw_pic r%d, %s", reg_rd, add_symbol->bsym->name); + if (append_insn (tmp, TRUE) == (int) FAIL) + return; + + /* Insn 2 */ + fix_num = 1; + var_num = 1; + /* Fix part + For an external symbol: ldis r1, HI% */ + sprintf (tmp, "ldis r1, %d", hi); + if (append_insn (tmp, FALSE) == (int) FAIL) + return; + + memcpy (&fix_insts[0], &inst, sizeof (struct score_it)); + + /* Var part + For a local symbol: ldis r1, HI% + but, if lo is outof 16 bit, make hi plus 1 */ + if ((lo < -0x8000) || (lo > 0x7fff)) + { + hi += 1; + } + sprintf (tmp, "ldis_pic r1, %d", hi); + if (append_insn (tmp, FALSE) == (int) FAIL) + return; + + memcpy (&var_insts[0], &inst, sizeof (struct score_it)); + build_relax_frag (fix_insts, fix_num, var_insts, var_num, add_symbol); + + /* Insn 3 */ + fix_num = 1; + var_num = 1; + /* Fix part + For an external symbol: ori r1, LO% */ + sprintf (tmp, "ori r1, %d", lo); + if (append_insn (tmp, FALSE) == (int) FAIL) + return; + + memcpy (&fix_insts[0], &inst, sizeof (struct score_it)); + + /* Var part + For a local symbol: addi r1, +LO% (BFD_RELOC_GOT_LO16) */ + sprintf (tmp, "addi_u_pic r1, %s + %d", add_symbol->bsym->name, lo); + if (append_insn (tmp, FALSE) == (int) FAIL) + return; + + memcpy (&var_insts[0], &inst, sizeof (struct score_it)); + build_relax_frag (fix_insts, fix_num, var_insts, var_num, add_symbol); + + /* Insn 4: add rD, rD, r1 */ + sprintf (tmp, "add r%d, r%d, r1", reg_rd, reg_rd); + if (append_insn (tmp, TRUE) == (int) FAIL) + return; + + /* Set bwarn as -1, so macro instruction itself will not be generated frag. */ + inst.bwarn = -1; + } + + nor1 = r1_bak; +} + +/* Handle la. */ +static void +do_macro_la_rdi32 (char *str) +{ + int reg_rd; + + skip_whitespace (str); + if ((reg_rd = reg_required_here (&str, 20, REG_TYPE_SCORE)) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL) + { + return; + } + else + { + char append_str[MAX_LITERAL_POOL_SIZE]; + char *keep_data = str; + + /* la rd, simm16. */ + if (data_op2 (&str, 1, _SIMM16_LA) != (int) FAIL) + { + end_of_line (str); + return; + } + /* la rd, imm32 or la rd, label. */ + else + { + SET_INSN_ERROR (NULL); + str = keep_data; + if ((data_op2 (&str, 1, _VALUE_HI16) == (int) FAIL) + || (end_of_line (str) == (int) FAIL)) + { + return; + } + else + { + if ((score_pic == NO_PIC) || (!inst.reloc.exp.X_add_symbol)) + { + sprintf (append_str, "ld_i32hi r%d, %s", reg_rd, keep_data); + if (append_insn (append_str, TRUE) == (int) FAIL) + return; + + sprintf (append_str, "ld_i32lo r%d, %s", reg_rd, keep_data); + if (append_insn (append_str, TRUE) == (int) FAIL) + return; + } + else + { + assert (inst.reloc.exp.X_add_symbol); + build_la_pic (reg_rd, inst.reloc.exp); + } + + /* Set bwarn as -1, so macro instruction itself will not be generated frag. */ + inst.bwarn = -1; + } + } + } +} + +/* Handle li. */ +static void +do_macro_li_rdi32 (char *str){ + + int reg_rd; + + skip_whitespace (str); + if ((reg_rd = reg_required_here (&str, 20, REG_TYPE_SCORE)) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL) + { + return; + } + else + { + char *keep_data = str; + + /* li rd, simm16. */ + if (data_op2 (&str, 1, _SIMM16_LA) != (int) FAIL) + { + end_of_line (str); + return; + } + /* li rd, imm32. */ + else + { + char append_str[MAX_LITERAL_POOL_SIZE]; + + str = keep_data; + + if ((data_op2 (&str, 1, _VALUE_HI16) == (int) FAIL) + || (end_of_line (str) == (int) FAIL)) + { + return; + } + else if (inst.reloc.exp.X_add_symbol) + { + inst.error = _("li rd label isn't correct instruction form"); + return; + } + else + { + sprintf (append_str, "ld_i32hi r%d, %s", reg_rd, keep_data); + + if (append_insn (append_str, TRUE) == (int) FAIL) + return; + else + { + sprintf (append_str, "ld_i32lo r%d, %s", reg_rd, keep_data); + if (append_insn (append_str, TRUE) == (int) FAIL) + return; + + /* Set bwarn as -1, so macro instruction itself will not be generated frag. */ + inst.bwarn = -1; + } + } + } + } +} + +/* Handle mul/mulu/div/divu/rem/remu. */ +static void +do_macro_mul_rdrsrs (char *str) +{ + int reg_rd; + int reg_rs1; + int reg_rs2; + char *backupstr; + char append_str[MAX_LITERAL_POOL_SIZE]; + + if (university_version == 1) + as_warn ("%s", ERR_FOR_SCORE5U_MUL_DIV); + + strcpy (append_str, str); + backupstr = append_str; + skip_whitespace (backupstr); + if (((reg_rd = reg_required_here (&backupstr, -1, REG_TYPE_SCORE)) == (int) FAIL) + || (skip_past_comma (&backupstr) == (int) FAIL) + || ((reg_rs1 = reg_required_here (&backupstr, -1, REG_TYPE_SCORE)) == (int) FAIL)) + { + inst.error = BAD_ARGS; + return; + } + + if (skip_past_comma (&backupstr) == (int) FAIL) + { + /* rem/remu rA, rB is error format. */ + if (strcmp (inst.name, "rem") == 0 || strcmp (inst.name, "remu") == 0) + { + SET_INSN_ERROR (BAD_ARGS); + } + else + { + SET_INSN_ERROR (NULL); + do_rsrs (str); + } + return; + } + else + { + SET_INSN_ERROR (NULL); + if (((reg_rs2 = reg_required_here (&backupstr, -1, REG_TYPE_SCORE)) == (int) FAIL) + || (end_of_line (backupstr) == (int) FAIL)) + { + return; + } + else + { + char append_str1[MAX_LITERAL_POOL_SIZE]; + + if (strcmp (inst.name, "rem") == 0) + { + sprintf (append_str, "mul r%d, r%d", reg_rs1, reg_rs2); + sprintf (append_str1, "mfceh r%d", reg_rd); + } + else if (strcmp (inst.name, "remu") == 0) + { + sprintf (append_str, "mulu r%d, r%d", reg_rs1, reg_rs2); + sprintf (append_str1, "mfceh r%d", reg_rd); + } + else + { + sprintf (append_str, "%s r%d, r%d", inst.name, reg_rs1, reg_rs2); + sprintf (append_str1, "mfcel r%d", reg_rd); + } + + /* Output mul/mulu or div/divu or rem/remu. */ + if (append_insn (append_str, TRUE) == (int) FAIL) + return; + + /* Output mfcel or mfceh. */ + if (append_insn (append_str1, TRUE) == (int) FAIL) + return; + + /* Set bwarn as -1, so macro instruction itself will not be generated frag. */ + inst.bwarn = -1; + } + } +} + +static void +exp_macro_ldst_abs (char *str) +{ + int reg_rd; + char *backupstr, *tmp; + char append_str[MAX_LITERAL_POOL_SIZE]; + char verifystr[MAX_LITERAL_POOL_SIZE]; + struct score_it inst_backup; + int r1_bak = 0; + + r1_bak = nor1; + nor1 = 0; + memcpy (&inst_backup, &inst, sizeof (struct score_it)); + + strcpy (verifystr, str); + backupstr = verifystr; + skip_whitespace (backupstr); + if ((reg_rd = reg_required_here (&backupstr, -1, REG_TYPE_SCORE)) == (int) FAIL) + return; + + tmp = backupstr; + if (skip_past_comma (&backupstr) == (int) FAIL) + return; + + backupstr = tmp; + sprintf (append_str, "li r1 %s", backupstr); + append_insn (append_str, TRUE); + + memcpy (&inst, &inst_backup, sizeof (struct score_it)); + sprintf (append_str, " r%d, [r1,0]", reg_rd); + do_ldst_insn (append_str); + + nor1 = r1_bak; +} + +static int +nopic_need_relax (symbolS * sym, int before_relaxing) +{ + if (sym == NULL) + return 0; + else if (USE_GLOBAL_POINTER_OPT && g_switch_value > 0) + { + const char *symname; + const char *segname; + + /* Find out whether this symbol can be referenced off the $gp + register. It can be if it is smaller than the -G size or if + it is in the .sdata or .sbss section. Certain symbols can + not be referenced off the $gp, although it appears as though + they can. */ + symname = S_GET_NAME (sym); + if (symname != (const char *)NULL + && (strcmp (symname, "eprol") == 0 + || strcmp (symname, "etext") == 0 + || strcmp (symname, "_gp") == 0 + || strcmp (symname, "edata") == 0 + || strcmp (symname, "_fbss") == 0 + || strcmp (symname, "_fdata") == 0 + || strcmp (symname, "_ftext") == 0 + || strcmp (symname, "end") == 0 + || strcmp (symname, GP_DISP_LABEL) == 0)) + { + return 1; + } + else if ((!S_IS_DEFINED (sym) || S_IS_COMMON (sym)) && (0 + /* We must defer this decision until after the whole file has been read, + since there might be a .extern after the first use of this symbol. */ + || (before_relaxing + && S_GET_VALUE (sym) == 0) + || (S_GET_VALUE (sym) != 0 + && S_GET_VALUE (sym) <= g_switch_value))) + { + return 0; + } + + segname = segment_name (S_GET_SEGMENT (sym)); + return (strcmp (segname, ".sdata") != 0 + && strcmp (segname, ".sbss") != 0 + && strncmp (segname, ".sdata.", 7) != 0 + && strncmp (segname, ".gnu.linkonce.s.", 16) != 0); + } + /* We are not optimizing for the $gp register. */ + else + return 1; +} + +/* Build a relax frag for lw/st instruction when generating PIC, + external symbol first and local symbol second. */ + +static void +build_lwst_pic (int reg_rd, expressionS exp, const char *insn_name) +{ + symbolS *add_symbol = exp.X_add_symbol; + int add_number = exp.X_add_number; + struct score_it fix_insts[RELAX_INST_NUM]; + struct score_it var_insts[RELAX_INST_NUM]; + int fix_num = 0; + int var_num = 0; + char tmp[MAX_LITERAL_POOL_SIZE]; + int r1_bak; + + r1_bak = nor1; + nor1 = 0; + + if ((add_number == 0) || (add_number >= -0x8000 && add_number <= 0x7fff)) + { + fix_num = 1; + var_num = 2; + + /* For an external symbol, two insns are generated; + For a local symbol, three insns are generated. */ + /* Fix part + For an external symbol: lw rD, ($gp) + (BFD_RELOC_SCORE_GOT15) */ + sprintf (tmp, "lw_pic r1, %s", add_symbol->bsym->name); + if (append_insn (tmp, FALSE) == (int) FAIL) + return; + + memcpy (&fix_insts[0], &inst, sizeof (struct score_it)); + + /* Var part + For a local symbol : + lw rD, ($gp) (BFD_RELOC_SCORE_GOT15) + addi rD, (BFD_RELOC_GOT_LO16) */ + inst.reloc.type = BFD_RELOC_SCORE_GOT15; + memcpy (&var_insts[0], &inst, sizeof (struct score_it)); + sprintf (tmp, "addi_s_pic r1, %s", add_symbol->bsym->name); + if (append_insn (tmp, FALSE) == (int) FAIL) + return; + + memcpy (&var_insts[1], &inst, sizeof (struct score_it)); + build_relax_frag (fix_insts, fix_num, var_insts, var_num, add_symbol); + + /* Insn 2 or Insn 3: lw/st rD, [r1, constant] */ + sprintf (tmp, "%s r%d, [r1, %d]", insn_name, reg_rd, add_number); + if (append_insn (tmp, TRUE) == (int) FAIL) + return; + + /* Set bwarn as -1, so macro instruction itself will not be generated frag. */ + inst.bwarn = -1; + } + else + { + inst.error = _("PIC code offset overflow (max 16 signed bits)"); + return; + } + + nor1 = r1_bak; +} + +static void +do_macro_ldst_label (char *str) +{ + int i; + int ldst_gp_p = 0; + int reg_rd; + int r1_bak; + char *backup_str; + char *label_str; + char *absolute_value; + char append_str[3][MAX_LITERAL_POOL_SIZE]; + char verifystr[MAX_LITERAL_POOL_SIZE]; + struct score_it inst_backup; + struct score_it inst_expand[3]; + struct score_it inst_main; + + memcpy (&inst_backup, &inst, sizeof (struct score_it)); + strcpy (verifystr, str); + backup_str = verifystr; + + skip_whitespace (backup_str); + if ((reg_rd = reg_required_here (&backup_str, -1, REG_TYPE_SCORE)) == (int) FAIL) + return; + + if (skip_past_comma (&backup_str) == (int) FAIL) + return; + + label_str = backup_str; + + /* Ld/st rD, [rA, imm] ld/st rD, [rA]+, imm ld/st rD, [rA, imm]+. */ + if (*backup_str == '[') + { + inst.type = Rd_rvalueRs_preSI12; + do_ldst_insn (str); + return; + } + + /* Ld/st rD, imm. */ + absolute_value = backup_str; + inst.type = Rd_rvalueRs_SI15; + if ((my_get_expression (&inst.reloc.exp, &backup_str) == (int) FAIL) + || (validate_immediate (inst.reloc.exp.X_add_number, _VALUE, 0) == (int) FAIL) + || (end_of_line (backup_str) == (int) FAIL)) + { + return; + } + else + { + if (inst.reloc.exp.X_add_symbol == 0) + { + memcpy (&inst, &inst_backup, sizeof (struct score_it)); + exp_macro_ldst_abs (str); + return; + } + } + + /* Ld/st rD, label. */ + inst.type = Rd_rvalueRs_SI15; + backup_str = absolute_value; + if ((data_op2 (&backup_str, 1, _GP_IMM15) == (int) FAIL) + || (end_of_line (backup_str) == (int) FAIL)) + { + return; + } + else + { + if (inst.reloc.exp.X_add_symbol == 0) + { + if (!inst.error) + inst.error = BAD_ARGS; + + return; + } + + if (score_pic == PIC) + { + int ldst_idx = 0; + ldst_idx = inst.instruction & OPC_PSEUDOLDST_MASK; + build_lwst_pic (reg_rd, inst.reloc.exp, score_ldst_insns[ldst_idx * 3 + 0].template); + return; + } + else + { + if ((inst.reloc.exp.X_add_number <= 0x3fff) + && (inst.reloc.exp.X_add_number >= -0x4000) + && (!nopic_need_relax (inst.reloc.exp.X_add_symbol, 1))) + { + int ldst_idx = 0; + + /* Assign the real opcode. */ + ldst_idx = inst.instruction & OPC_PSEUDOLDST_MASK; + inst.instruction &= ~OPC_PSEUDOLDST_MASK; + inst.instruction |= score_ldst_insns[ldst_idx * 3 + 0].value; + inst.instruction |= reg_rd << 20; + inst.instruction |= GP << 15; + inst.relax_inst = 0x8000; + inst.relax_size = 0; + ldst_gp_p = 1; + } + } + } + + /* Backup inst. */ + memcpy (&inst_main, &inst, sizeof (struct score_it)); + r1_bak = nor1; + nor1 = 0; + + /* Determine which instructions should be output. */ + sprintf (append_str[0], "ld_i32hi r1, %s", label_str); + sprintf (append_str[1], "ld_i32lo r1, %s", label_str); + sprintf (append_str[2], "%s r%d, [r1, 0]", inst_backup.name, reg_rd); + + /* Generate three instructions. + la r1, label + ld/st rd, [r1, 0] */ + for (i = 0; i < 3; i++) + { + if (append_insn (append_str[i], FALSE) == (int) FAIL) + return; + + memcpy (&inst_expand[i], &inst, sizeof (struct score_it)); + } + + if (ldst_gp_p) + { + char *p; + + /* Adjust instruction opcode and to be relaxed instruction opcode. */ + inst_main.instruction = adjust_paritybit (inst_main.instruction, GET_INSN_CLASS (inst_main.type)); + inst_main.relax_size = inst_expand[0].size + inst_expand[1].size + inst_expand[2].size; + inst_main.type = Insn_GP; + + for (i = 0; i < 3; i++) + inst_expand[i].instruction = adjust_paritybit (inst_expand[i].instruction + , GET_INSN_CLASS (inst_expand[i].type)); + + /* Check data dependency. */ + handle_dependency (&inst_main); + + /* Start a new frag if frag_now is not empty. */ + if (frag_now_fix () != 0) + { + if (!frag_now->tc_frag_data.is_insn) + frag_wane (frag_now); + + frag_new (0); + } + frag_grow (20); + + /* Write fr_fix part. */ + p = frag_more (inst_main.size); + md_number_to_chars (p, inst_main.instruction, inst_main.size); + + if (inst_main.reloc.type != BFD_RELOC_NONE) + { + fix_new_score (frag_now, p - frag_now->fr_literal, inst_main.size, + &inst_main.reloc.exp, inst_main.reloc.pc_rel, inst_main.reloc.type); + } + +#ifdef OBJ_ELF + dwarf2_emit_insn (inst_main.size); +#endif + + /* GP instruction can not do optimization, only can do relax between + 1 instruction and 3 instructions. */ + p = frag_var (rs_machine_dependent, inst_main.relax_size + RELAX_PAD_BYTE, 0, + RELAX_ENCODE (inst_main.size, inst_main.relax_size, inst_main.type, 0, 4, 0), + inst_main.reloc.exp.X_add_symbol, 0, NULL); + + /* Write fr_var part. + no calling gen_insn_frag, no fixS will be generated. */ + md_number_to_chars (p, inst_expand[0].instruction, inst_expand[0].size); + p += inst_expand[0].size; + md_number_to_chars (p, inst_expand[1].instruction, inst_expand[1].size); + p += inst_expand[1].size; + md_number_to_chars (p, inst_expand[2].instruction, inst_expand[2].size); + } + else + { + gen_insn_frag (&inst_expand[0], NULL); + gen_insn_frag (&inst_expand[1], NULL); + gen_insn_frag (&inst_expand[2], NULL); + } + nor1 = r1_bak; + + /* Set bwarn as -1, so macro instruction itself will not be generated frag. */ + inst.bwarn = -1; +} + +static void +do_lw_pic (char *str) +{ + int reg_rd; + + skip_whitespace (str); + if (((reg_rd = reg_required_here (&str, 20, REG_TYPE_SCORE)) == (int) FAIL) + || (skip_past_comma (&str) == (int) FAIL) + || (my_get_expression (&inst.reloc.exp, &str) == (int) FAIL) + || (end_of_line (str) == (int) FAIL)) + { + return; + } + else + { + if (inst.reloc.exp.X_add_symbol == 0) + { + if (!inst.error) + inst.error = BAD_ARGS; + + return; + } + + inst.instruction |= GP << 15; + inst.reloc.type = BFD_RELOC_SCORE_GOT15; + } +} + +static void +do_empty (char *str) +{ + str = str; + if (university_version == 1) + { + if (((inst.instruction & 0x3e0003ff) == 0x0c000004) + || ((inst.instruction & 0x3e0003ff) == 0x0c000024) + || ((inst.instruction & 0x3e0003ff) == 0x0c000044) + || ((inst.instruction & 0x3e0003ff) == 0x0c000064)) + { + inst.error = ERR_FOR_SCORE5U_MMU; + return; + } + } + if (end_of_line (str) == (int) FAIL) + return; + + if (inst.relax_inst != 0x8000) + { + if (inst.type == NO_OPD) + { + inst.relax_size = 2; + } + else + { + inst.relax_size = 4; + } + } +} + +static void +do_jump (char *str) +{ + char *save_in; + + skip_whitespace (str); + if (my_get_expression (&inst.reloc.exp, &str) == (int) FAIL + || end_of_line (str) == (int) FAIL) + return; + + if (inst.reloc.exp.X_add_symbol == 0) + { + inst.error = _("lacking label "); + return; + } + + if (((inst.reloc.exp.X_add_number & 0xff000000) != 0) + && ((inst.reloc.exp.X_add_number & 0xff000000) != 0xff000000)) + { + inst.error = _("invalid constant: 25 bit expression not in range -2^24..2^24"); + return; + } + + save_in = input_line_pointer; + input_line_pointer = str; + inst.reloc.type = BFD_RELOC_SCORE_JMP; + inst.reloc.pc_rel = 1; + input_line_pointer = save_in; +} + +static void +do16_jump (char *str) +{ + skip_whitespace (str); + if (my_get_expression (&inst.reloc.exp, &str) == (int) FAIL + || end_of_line (str) == (int) FAIL) + { + return; + } + else if (inst.reloc.exp.X_add_symbol == 0) + { + inst.error = _("lacking label "); + return; + } + else if (((inst.reloc.exp.X_add_number & 0xfffff800) != 0) + && ((inst.reloc.exp.X_add_number & 0xfffff800) != 0xfffff800)) + { + inst.error = _("invalid constant: 12 bit expression not in range -2^11..2^11"); + return; + } + + inst.reloc.type = BFD_RELOC_SCORE16_JMP; + inst.reloc.pc_rel = 1; +} + +static void +do_branch (char *str) +{ + unsigned long abs_value = 0; + + if (my_get_expression (&inst.reloc.exp, &str) == (int) FAIL + || end_of_line (str) == (int) FAIL) + { + return; + } + else if (inst.reloc.exp.X_add_symbol == 0) + { + inst.error = _("lacking label "); + return; + } + else if (((inst.reloc.exp.X_add_number & 0xff000000) != 0) + && ((inst.reloc.exp.X_add_number & 0xff000000) != 0xff000000)) + { + inst.error = _("invalid constant: 20 bit expression not in range -2^19..2^19"); + return; + } + + inst.reloc.type = BFD_RELOC_SCORE_BRANCH; + inst.reloc.pc_rel = 1; + + /* Branch 32 offset field : 20 bit, 16 bit branch offset field : 8 bit. */ + inst.instruction |= (inst.reloc.exp.X_add_number & 0x3fe) | ((inst.reloc.exp.X_add_number & 0xffc00) << 5); + + /* Compute 16 bit branch instruction. */ + if ((inst.relax_inst != 0x8000) && (abs_value & 0xfffffe00) == 0) + { + inst.relax_inst |= (((inst.instruction >> 10) & 0xf) << 8); + inst.relax_inst |= ((inst.reloc.exp.X_add_number >> 1) & 0xff); + inst.relax_size = 2; + } + else + { + inst.relax_inst = 0x8000; + } +} + +static void +do16_branch (char *str) +{ + if ((my_get_expression (&inst.reloc.exp, &str) == (int) FAIL + || end_of_line (str) == (int) FAIL)) + { + ; + } + else if (inst.reloc.exp.X_add_symbol == 0) + { + inst.error = _("lacking label"); + } + else if (((inst.reloc.exp.X_add_number & 0xffffff00) != 0) + && ((inst.reloc.exp.X_add_number & 0xffffff00) != 0xffffff00)) + { + inst.error = _("invalid constant: 9 bit expression not in range -2^8..2^8"); + } + else + { + inst.reloc.type = BFD_RELOC_SCORE16_BRANCH; + inst.reloc.pc_rel = 1; + inst.instruction |= ((inst.reloc.exp.X_add_number >> 1) & 0xff); + } +} + +/* Iterate over the base tables to create the instruction patterns. */ +static void +build_score_ops_hsh (void) +{ + unsigned int i; + static struct obstack insn_obstack; + + obstack_begin (&insn_obstack, 4000); + for (i = 0; i < sizeof (score_insns) / sizeof (struct asm_opcode); i++) + { + const struct asm_opcode *insn = score_insns + i; + unsigned len = strlen (insn->template); + struct asm_opcode *new; + char *template; + new = obstack_alloc (&insn_obstack, sizeof (struct asm_opcode)); + template = obstack_alloc (&insn_obstack, len + 1); + + strcpy (template, insn->template); + new->template = template; + new->parms = insn->parms; + new->value = insn->value; + new->relax_value = insn->relax_value; + new->type = insn->type; + new->bitmask = insn->bitmask; + hash_insert (score_ops_hsh, new->template, (void *) new); + } +} + +static void +build_dependency_insn_hsh (void) +{ + unsigned int i; + static struct obstack dependency_obstack; + + obstack_begin (&dependency_obstack, 4000); + for (i = 0; i < sizeof (insn_to_dependency_table) / sizeof (insn_to_dependency_table[0]); i++) + { + const struct insn_to_dependency *tmp = insn_to_dependency_table + i; + unsigned len = strlen (tmp->insn_name); + struct insn_to_dependency *new; + + new = obstack_alloc (&dependency_obstack, sizeof (struct insn_to_dependency)); + new->insn_name = obstack_alloc (&dependency_obstack, len + 1); + + strcpy (new->insn_name, tmp->insn_name); + new->type = tmp->type; + hash_insert (dependency_insn_hsh, new->insn_name, (void *) new); + } +} + +/* Turn an integer of n bytes (in val) into a stream of bytes appropriate + for use in the a.out file, and stores them in the array pointed to by buf. + This knows about the endian-ness of the target machine and does + THE RIGHT THING, whatever it is. Possible values for n are 1 (byte) + 2 (short) and 4 (long) Floating numbers are put out as a series of + LITTLENUMS (shorts, here at least). */ + +void +md_number_to_chars (char *buf, valueT val, int n) +{ + if (target_big_endian) + number_to_chars_bigendian (buf, val, n); + else + number_to_chars_littleendian (buf, val, n); +} + +static valueT +md_chars_to_number (char *buf, int n) +{ + valueT result = 0; + unsigned char *where = (unsigned char *)buf; + + if (target_big_endian) + { + while (n--) + { + result <<= 8; + result |= (*where++ & 255); + } + } + else + { + while (n--) + { + result <<= 8; + result |= (where[n] & 255); + } + } + + return result; +} + +/* Turn a string in input_line_pointer into a floating point constant + of type TYPE, and store the appropriate bytes in *LITP. The number + of LITTLENUMS emitted is stored in *SIZEP. An error message is + returned, or NULL on OK. + + Note that fp constants aren't represent in the normal way on the ARM. + In big endian mode, things are as expected. However, in little endian + mode fp constants are big-endian word-wise, and little-endian byte-wise + within the words. For example, (double) 1.1 in big endian mode is + the byte sequence 3f f1 99 99 99 99 99 9a, and in little endian mode is + the byte sequence 99 99 f1 3f 9a 99 99 99. */ + +char * +md_atof (int type, char *litP, int *sizeP) +{ + int prec; + LITTLENUM_TYPE words[MAX_LITTLENUMS]; + char *t; + int i; + + switch (type) + { + case 'f': + case 'F': + case 's': + case 'S': + prec = 2; + break; + case 'd': + case 'D': + case 'r': + case 'R': + prec = 4; + break; + case 'x': + case 'X': + case 'p': + case 'P': + prec = 6; + break; + default: + *sizeP = 0; + return _("bad call to MD_ATOF()"); + } + + t = atof_ieee (input_line_pointer, type, words); + if (t) + input_line_pointer = t; + *sizeP = prec * 2; + + if (target_big_endian) + { + for (i = 0; i < prec; i++) + { + md_number_to_chars (litP, (valueT) words[i], 2); + litP += 2; + } + } + else + { + for (i = 0; i < prec; i += 2) + { + md_number_to_chars (litP, (valueT) words[i + 1], 2); + md_number_to_chars (litP + 2, (valueT) words[i], 2); + litP += 4; + } + } + + return 0; +} + +/* Return true if the given symbol should be considered local for PIC. */ + +static bfd_boolean +pic_need_relax (symbolS *sym, asection *segtype) +{ + asection *symsec; + bfd_boolean linkonce; + + /* Handle the case of a symbol equated to another symbol. */ + while (symbol_equated_reloc_p (sym)) + { + symbolS *n; + + /* It's possible to get a loop here in a badly written + program. */ + n = symbol_get_value_expression (sym)->X_add_symbol; + if (n == sym) + break; + sym = n; + } + + symsec = S_GET_SEGMENT (sym); + + /* duplicate the test for LINK_ONCE sections as in adjust_reloc_syms */ + linkonce = FALSE; + if (symsec != segtype && ! S_IS_LOCAL (sym)) + { + if ((bfd_get_section_flags (stdoutput, symsec) & SEC_LINK_ONCE) != 0) + linkonce = TRUE; + + /* The GNU toolchain uses an extension for ELF: a section + beginning with the magic string .gnu.linkonce is a linkonce + section. */ + if (strncmp (segment_name (symsec), ".gnu.linkonce", + sizeof ".gnu.linkonce" - 1) == 0) + linkonce = TRUE; + } + + /* This must duplicate the test in adjust_reloc_syms. */ + return (symsec != &bfd_und_section + && symsec != &bfd_abs_section + && ! bfd_is_com_section (symsec) + && !linkonce +#ifdef OBJ_ELF + /* A global or weak symbol is treated as external. */ + && (OUTPUT_FLAVOR != bfd_target_elf_flavour + || (! S_IS_WEAK (sym) && ! S_IS_EXTERNAL (sym))) +#endif + ); +} + +static int +judge_size_before_relax (fragS * fragp, asection *sec) +{ + int change = 0; + + if (score_pic == NO_PIC) + change = nopic_need_relax (fragp->fr_symbol, 0); + else + change = pic_need_relax (fragp->fr_symbol, sec); + + if (change == 1) + { + /* Only at the first time determining whether GP instruction relax should be done, + return the difference between insntruction size and instruction relax size. */ + if (fragp->fr_opcode == NULL) + { + fragp->fr_fix = RELAX_NEW (fragp->fr_subtype); + fragp->fr_opcode = fragp->fr_literal + RELAX_RELOC1 (fragp->fr_subtype); + return RELAX_NEW (fragp->fr_subtype) - RELAX_OLD (fragp->fr_subtype); + } + } + + return 0; +} + +/* In this function, we determine whether GP instruction should do relaxation, + for the label being against was known now. + Doing this here but not in md_relax_frag() can induce iteration times + in stage of doing relax. */ +int +md_estimate_size_before_relax (fragS * fragp, asection * sec ATTRIBUTE_UNUSED) +{ + if ((RELAX_TYPE (fragp->fr_subtype) == Insn_GP) + || (RELAX_TYPE (fragp->fr_subtype) == Insn_PIC)) + return judge_size_before_relax (fragp, sec); + + return 0; +} + +static int +b32_relax_to_b16 (fragS * fragp) +{ + int grows = 0; + int relaxable_p = 0; + int old; + int new; + int frag_addr = fragp->fr_address + fragp->insn_addr; + + addressT symbol_address = 0; + symbolS *s; + offsetT offset; + unsigned long value; + unsigned long abs_value; + + /* FIXME : here may be able to modify better . + I don't know how to get the fragp's section , + so in relax stage , it may be wrong to calculate the symbol's offset when the frag's section + is different from the symbol's. */ + + old = RELAX_OLD (fragp->fr_subtype); + new = RELAX_NEW (fragp->fr_subtype); + relaxable_p = RELAX_OPT (fragp->fr_subtype); + + s = fragp->fr_symbol; + /* b/bl immediate */ + if (s == NULL) + frag_addr = 0; + else + { + if (s->bsym != 0) + symbol_address = (addressT) s->sy_frag->fr_address; + } + + value = md_chars_to_number (fragp->fr_literal, INSN_SIZE); + + /* b 32's offset : 20 bit, b 16's tolerate field : 0xff. */ + offset = ((value & 0x3ff0000) >> 6) | (value & 0x3fe); + if ((offset & 0x80000) == 0x80000) + offset |= 0xfff00000; + + abs_value = offset + symbol_address - frag_addr; + if ((abs_value & 0x80000000) == 0x80000000) + abs_value = 0xffffffff - abs_value + 1; + + /* Relax branch 32 to branch 16. */ + if (relaxable_p && (s->bsym != NULL) && ((abs_value & 0xffffff00) == 0) + && (S_IS_DEFINED (s) && !S_IS_COMMON (s) && !S_IS_EXTERNAL (s))) + { + /* do nothing. */ + } + else + { + /* Branch 32 can not be relaxed to b 16, so clear OPT bit. */ + fragp->fr_opcode = NULL; + fragp->fr_subtype = RELAX_OPT_CLEAR (fragp->fr_subtype); + } + + return grows; +} + +/* Main purpose is to determine whether one frag should do relax. + frag->fr_opcode indicates this point. */ + +int +score_relax_frag (asection * sec ATTRIBUTE_UNUSED, fragS * fragp, long stretch ATTRIBUTE_UNUSED) +{ + int grows = 0; + int insn_size; + int insn_relax_size; + int do_relax_p = 0; /* Indicate doing relaxation for this frag. */ + int relaxable_p = 0; + bfd_boolean word_align_p = FALSE; + fragS *next_fragp; + + /* If the instruction address is odd, make it half word align first. */ + if ((fragp->fr_address) % 2 != 0) + { + if ((fragp->fr_address + fragp->insn_addr) % 2 != 0) + { + fragp->insn_addr = 1; + grows += 1; + } + } + + word_align_p = ((fragp->fr_address + fragp->insn_addr) % 4 == 0) ? TRUE : FALSE; + + /* Get instruction size and relax size after the last relaxation. */ + if (fragp->fr_opcode) + { + insn_size = RELAX_NEW (fragp->fr_subtype); + insn_relax_size = RELAX_OLD (fragp->fr_subtype); + } + else + { + insn_size = RELAX_OLD (fragp->fr_subtype); + insn_relax_size = RELAX_NEW (fragp->fr_subtype); + } + + /* Handle specially for GP instruction. for, judge_size_before_relax() has already determine + whether the GP instruction should do relax. */ + if ((RELAX_TYPE (fragp->fr_subtype) == Insn_GP) + || (RELAX_TYPE (fragp->fr_subtype) == Insn_PIC)) + { + if (!word_align_p) + { + if (fragp->insn_addr < 2) + { + fragp->insn_addr += 2; + grows += 2; + } + else + { + fragp->insn_addr -= 2; + grows -= 2; + } + } + + if (fragp->fr_opcode) + fragp->fr_fix = RELAX_NEW (fragp->fr_subtype) + fragp->insn_addr; + else + fragp->fr_fix = RELAX_OLD (fragp->fr_subtype) + fragp->insn_addr; + } + else + { + if (RELAX_TYPE (fragp->fr_subtype) == PC_DISP19div2) + b32_relax_to_b16 (fragp); + + relaxable_p = RELAX_OPT (fragp->fr_subtype); + next_fragp = fragp->fr_next; + while ((next_fragp) && (next_fragp->fr_type != rs_machine_dependent)) + { + next_fragp = next_fragp->fr_next; + } + + if (next_fragp) + { + int n_insn_size; + int n_relaxable_p = 0; + + if (next_fragp->fr_opcode) + { + n_insn_size = RELAX_NEW (next_fragp->fr_subtype); + } + else + { + n_insn_size = RELAX_OLD (next_fragp->fr_subtype); + } + + if (RELAX_TYPE (next_fragp->fr_subtype) == PC_DISP19div2) + b32_relax_to_b16 (next_fragp); + n_relaxable_p = RELAX_OPT (next_fragp->fr_subtype); + + if (word_align_p) + { + if (insn_size == 4) + { + /* 32 -> 16. */ + if (relaxable_p && ((n_insn_size == 2) || n_relaxable_p)) + { + grows -= 2; + do_relax_p = 1; + } + } + else if (insn_size == 2) + { + /* 16 -> 32. */ + if (relaxable_p && (((n_insn_size == 4) && !n_relaxable_p) || (n_insn_size > 4))) + { + grows += 2; + do_relax_p = 1; + } + } + else + { + abort (); + } + } + else + { + if (insn_size == 4) + { + /* 32 -> 16. */ + if (relaxable_p) + { + grows -= 2; + do_relax_p = 1; + } + /* Make the 32 bit insturction word align. */ + else + { + fragp->insn_addr += 2; + grows += 2; + } + } + else if (insn_size == 2) + { + /* Do nothing. */ + } + else + { + abort (); + } + } + } + else + { + /* Here, try best to do relax regardless fragp->fr_next->fr_type. */ + if (word_align_p == FALSE) + { + if (insn_size % 4 == 0) + { + /* 32 -> 16. */ + if (relaxable_p) + { + grows -= 2; + do_relax_p = 1; + } + else + { + fragp->insn_addr += 2; + grows += 2; + } + } + } + else + { + /* Do nothing. */ + } + } + + /* fragp->fr_opcode indicates whether this frag should be relaxed. */ + if (do_relax_p) + { + if (fragp->fr_opcode) + { + fragp->fr_opcode = NULL; + /* Guarantee estimate stage is correct. */ + fragp->fr_fix = RELAX_OLD (fragp->fr_subtype); + fragp->fr_fix += fragp->insn_addr; + } + else + { + fragp->fr_opcode = fragp->fr_literal + RELAX_RELOC1 (fragp->fr_subtype); + /* Guarantee estimate stage is correct. */ + fragp->fr_fix = RELAX_NEW (fragp->fr_subtype); + fragp->fr_fix += fragp->insn_addr; + } + } + else + { + if (fragp->fr_opcode) + { + /* Guarantee estimate stage is correct. */ + fragp->fr_fix = RELAX_NEW (fragp->fr_subtype); + fragp->fr_fix += fragp->insn_addr; + } + else + { + /* Guarantee estimate stage is correct. */ + fragp->fr_fix = RELAX_OLD (fragp->fr_subtype); + fragp->fr_fix += fragp->insn_addr; + } + } + } + + return grows; +} + +void +md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED, fragS * fragp) +{ + int old; + int new; + char backup[20]; + fixS *fixp; + + old = RELAX_OLD (fragp->fr_subtype); + new = RELAX_NEW (fragp->fr_subtype); + + /* fragp->fr_opcode indicates whether this frag should be relaxed. */ + if (fragp->fr_opcode == NULL) + { + memcpy (backup, fragp->fr_literal, old); + fragp->fr_fix = old; + } + else + { + memcpy (backup, fragp->fr_literal + old, new); + fragp->fr_fix = new; + } + + fixp = fragp->tc_frag_data.fixp; + while (fixp && fixp->fx_frag == fragp && fixp->fx_where < old) + { + if (fragp->fr_opcode) + fixp->fx_done = 1; + fixp = fixp->fx_next; + } + while (fixp && fixp->fx_frag == fragp) + { + if (fragp->fr_opcode) + fixp->fx_where -= old + fragp->insn_addr; + else + fixp->fx_done = 1; + fixp = fixp->fx_next; + } + + if (fragp->insn_addr) + { + md_number_to_chars (fragp->fr_literal, 0x0, fragp->insn_addr); + } + memcpy (fragp->fr_literal + fragp->insn_addr, backup, fragp->fr_fix); + fragp->fr_fix += fragp->insn_addr; +} + +/* Implementation of md_frag_check. + Called after md_convert_frag(). */ + +void +score_frag_check (fragS * fragp ATTRIBUTE_UNUSED) +{ + know (fragp->insn_addr <= RELAX_PAD_BYTE); +} + +bfd_boolean +score_fix_adjustable (fixS * fixP) +{ + if (fixP->fx_addsy == NULL) + { + return 1; + } + else if (OUTPUT_FLAVOR == bfd_target_elf_flavour + && (S_IS_EXTERNAL (fixP->fx_addsy) || S_IS_WEAK (fixP->fx_addsy))) + { + return 0; + } + else if (fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT + || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY) + { + return 0; + } + + return 1; +} + +/* Implementation of TC_VALIDATE_FIX. + Called before md_apply_fix() and after md_convert_frag(). */ +void +score_validate_fix (fixS *fixP) +{ + fixP->fx_where += fixP->fx_frag->insn_addr; +} + +long +md_pcrel_from (fixS * fixP) +{ + long retval = 0; + + if (fixP->fx_addsy + && (S_GET_SEGMENT (fixP->fx_addsy) == undefined_section) + && (fixP->fx_subsy == NULL)) + { + retval = 0; + } + else + { + retval = fixP->fx_where + fixP->fx_frag->fr_address; + } + + return retval; +} + +int +score_force_relocation (struct fix *fixp) +{ + int retval = 0; + + if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT + || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY + || fixp->fx_r_type == BFD_RELOC_SCORE_JMP + || fixp->fx_r_type == BFD_RELOC_SCORE_BRANCH + || fixp->fx_r_type == BFD_RELOC_SCORE16_JMP + || fixp->fx_r_type == BFD_RELOC_SCORE16_BRANCH) + { + retval = 1; + } + + return retval; +} + +/* Round up a section size to the appropriate boundary. */ +valueT +md_section_align (segT segment ATTRIBUTE_UNUSED, valueT size) +{ + int align = bfd_get_section_alignment (stdoutput, segment); + + return ((size + (1 << align) - 1) & (-1 << align)); +} + +void +md_apply_fix (fixS *fixP, valueT *valP, segT seg) +{ + offsetT value = *valP; + offsetT abs_value = 0; + offsetT newval; + offsetT content; + unsigned short HI, LO; + + char *buf = fixP->fx_frag->fr_literal + fixP->fx_where; + + assert (fixP->fx_r_type < BFD_RELOC_UNUSED); + if (fixP->fx_addsy == 0 && !fixP->fx_pcrel) + { + if (fixP->fx_r_type != BFD_RELOC_SCORE_DUMMY_HI16) + fixP->fx_done = 1; + } + + /* If this symbol is in a different section then we need to leave it for + the linker to deal with. Unfortunately, md_pcrel_from can't tell, + so we have to undo it's effects here. */ + if (fixP->fx_pcrel) + { + if (fixP->fx_addsy != NULL + && S_IS_DEFINED (fixP->fx_addsy) + && S_GET_SEGMENT (fixP->fx_addsy) != seg) + value += md_pcrel_from (fixP); + } + + /* Remember value for emit_reloc. */ + fixP->fx_addnumber = value; + + switch (fixP->fx_r_type) + { + case BFD_RELOC_HI16_S: + if (fixP->fx_done) + { /* For la rd, imm32. */ + newval = md_chars_to_number (buf, INSN_SIZE); + HI = (value) >> 16; /* mul to 2, then take the hi 16 bit. */ + newval |= (HI & 0x3fff) << 1; + newval |= ((HI >> 14) & 0x3) << 16; + md_number_to_chars (buf, newval, INSN_SIZE); + } + break; + case BFD_RELOC_LO16: + if (fixP->fx_done) /* For la rd, imm32. */ + { + newval = md_chars_to_number (buf, INSN_SIZE); + LO = (value) & 0xffff; + newval |= (LO & 0x3fff) << 1; /* 16 bit: imm -> 14 bit in lo, 2 bit in hi. */ + newval |= ((LO >> 14) & 0x3) << 16; + md_number_to_chars (buf, newval, INSN_SIZE); + } + break; + case BFD_RELOC_SCORE_JMP: + { + content = md_chars_to_number (buf, INSN_SIZE); + value = fixP->fx_offset; + content = (content & ~0x3ff7ffe) | ((value << 1) & 0x3ff0000) | (value & 0x7fff); + md_number_to_chars (buf, content, INSN_SIZE); + } + break; + case BFD_RELOC_SCORE_BRANCH: + if ((S_GET_SEGMENT (fixP->fx_addsy) != seg) || (fixP->fx_addsy != NULL && S_IS_EXTERNAL (fixP->fx_addsy))) + value = fixP->fx_offset; + else + fixP->fx_done = 1; + + content = md_chars_to_number (buf, INSN_SIZE); + if ((fixP->fx_frag->fr_opcode != 0) && ((content & 0x80008000) != 0x80008000)) + { + if ((value & 0x80000000) == 0x80000000) + abs_value = 0xffffffff - value + 1; + if ((abs_value & 0xffffff00) != 0) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _(" branch relocation truncate (0x%x) [-2^8 ~ 2^8]"), (unsigned int)value); + return; + } + content = md_chars_to_number (buf, INSN16_SIZE); + content &= 0xff00; + content = (content & 0xff00) | ((value >> 1) & 0xff); + md_number_to_chars (buf, content, INSN16_SIZE); + fixP->fx_r_type = BFD_RELOC_SCORE16_BRANCH; + fixP->fx_size = 2; + } + else + { + if ((value & 0x80000000) == 0x80000000) + abs_value = 0xffffffff - value + 1; + if ((abs_value & 0xfff80000) != 0) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _(" branch relocation truncate (0x%x) [-2^19 ~ 2^19]"), (unsigned int)value); + return; + } + content = md_chars_to_number (buf, INSN_SIZE); + content &= 0xfc00fc01; + content = (content & 0xfc00fc01) | (value & 0x3fe) | ((value << 6) & 0x3ff0000); + md_number_to_chars (buf, content, INSN_SIZE); + } + break; + case BFD_RELOC_SCORE16_JMP: + content = md_chars_to_number (buf, INSN16_SIZE); + content &= 0xf001; + value = fixP->fx_offset & 0xfff; + content = (content & 0xfc01) | (value & 0xffe); + md_number_to_chars (buf, content, INSN16_SIZE); + break; + case BFD_RELOC_SCORE16_BRANCH: + content = md_chars_to_number (buf, INSN_SIZE); + if ((fixP->fx_frag->fr_opcode != 0) && ((content & 0x80008000) == 0x80008000)) + { + if ((S_GET_SEGMENT (fixP->fx_addsy) != seg) || + (fixP->fx_addsy != NULL && S_IS_EXTERNAL (fixP->fx_addsy))) + value = fixP->fx_offset; + else + fixP->fx_done = 1; + if ((value & 0x80000000) == 0x80000000) + abs_value = 0xffffffff - value + 1; + if ((abs_value & 0xfff80000) != 0) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _(" branch relocation truncate (0x%x) [-2^19 ~ 2^19]"), (unsigned int)value); + return; + } + content = md_chars_to_number (buf, INSN_SIZE); + content = (content & 0xfc00fc01) | (value & 0x3fe) | ((value << 6) & 0x3ff0000); + md_number_to_chars (buf, content, INSN_SIZE); + fixP->fx_r_type = BFD_RELOC_SCORE_BRANCH; + fixP->fx_size = 4; + break; + } + else + { + /* In differnt section. */ + if ((S_GET_SEGMENT (fixP->fx_addsy) != seg) || + (fixP->fx_addsy != NULL && S_IS_EXTERNAL (fixP->fx_addsy))) + value = fixP->fx_offset; + else + fixP->fx_done = 1; + + if ((value & 0x80000000) == 0x80000000) + abs_value = 0xffffffff - value + 1; + if ((abs_value & 0xffffff00) != 0) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _(" branch relocation truncate (0x%x) [-2^8 ~ 2^8]"), (unsigned int)value); + return; + } + content = md_chars_to_number (buf, INSN16_SIZE); + content = (content & 0xff00) | ((value >> 1) & 0xff); + md_number_to_chars (buf, content, INSN16_SIZE); + break; + } + case BFD_RELOC_8: + if (fixP->fx_done || fixP->fx_pcrel) + md_number_to_chars (buf, value, 1); +#ifdef OBJ_ELF + else + { + value = fixP->fx_offset; + md_number_to_chars (buf, value, 1); + } +#endif + break; + + case BFD_RELOC_16: + if (fixP->fx_done || fixP->fx_pcrel) + md_number_to_chars (buf, value, 2); +#ifdef OBJ_ELF + else + { + value = fixP->fx_offset; + md_number_to_chars (buf, value, 2); + } +#endif + break; + case BFD_RELOC_RVA: + case BFD_RELOC_32: + if (fixP->fx_done || fixP->fx_pcrel) + md_number_to_chars (buf, value, 4); +#ifdef OBJ_ELF + else + { + value = fixP->fx_offset; + md_number_to_chars (buf, value, 4); + } +#endif + break; + case BFD_RELOC_VTABLE_INHERIT: + fixP->fx_done = 0; + if (fixP->fx_addsy && !S_IS_DEFINED (fixP->fx_addsy) && !S_IS_WEAK (fixP->fx_addsy)) + S_SET_WEAK (fixP->fx_addsy); + break; + case BFD_RELOC_VTABLE_ENTRY: + fixP->fx_done = 0; + break; + case BFD_RELOC_SCORE_GPREL15: + content = md_chars_to_number (buf, INSN_SIZE); + if ((fixP->fx_frag->fr_opcode != 0) && ((content & 0xfc1c8000) != 0x94188000)) + fixP->fx_r_type = BFD_RELOC_NONE; + fixP->fx_done = 0; + break; + case BFD_RELOC_SCORE_GOT15: + case BFD_RELOC_SCORE_DUMMY_HI16: + case BFD_RELOC_SCORE_GOT_LO16: + case BFD_RELOC_SCORE_CALL15: + case BFD_RELOC_GPREL32: + break; + case BFD_RELOC_NONE: + default: + as_bad_where (fixP->fx_file, fixP->fx_line, _("bad relocation fixup type (%d)"), fixP->fx_r_type); + } +} + +/* Translate internal representation of relocation info to BFD target format. */ +arelent ** +tc_gen_reloc (asection * section ATTRIBUTE_UNUSED, fixS * fixp) +{ + static arelent *retval[MAX_RELOC_EXPANSION + 1]; /* MAX_RELOC_EXPANSION equals 2. */ + arelent *reloc; + bfd_reloc_code_real_type code; + char *type; + fragS *f; + symbolS *s; + expressionS e; + + reloc = retval[0] = xmalloc (sizeof (arelent)); + retval[1] = NULL; + + reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *)); + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); + reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; + reloc->addend = fixp->fx_offset; + + /* If this is a variant frag, we may need to adjust the existing + reloc and generate a new one. */ + if (fixp->fx_frag->fr_opcode != NULL && (fixp->fx_r_type == BFD_RELOC_SCORE_GPREL15)) + { + /* Update instruction imm bit. */ + offsetT newval; + unsigned short off; + char *buf; + + buf = fixp->fx_frag->fr_literal + fixp->fx_frag->insn_addr; + newval = md_chars_to_number (buf, INSN_SIZE); + off = fixp->fx_offset >> 16; + newval |= (off & 0x3fff) << 1; + newval |= ((off >> 14) & 0x3) << 16; + md_number_to_chars (buf, newval, INSN_SIZE); + + buf += INSN_SIZE; + newval = md_chars_to_number (buf, INSN_SIZE); + off = fixp->fx_offset & 0xffff; + newval |= ((off & 0x3fff) << 1); + newval |= (((off >> 14) & 0x3) << 16); + md_number_to_chars (buf, newval, INSN_SIZE); + + retval[1] = xmalloc (sizeof (arelent)); + retval[2] = NULL; + retval[1]->sym_ptr_ptr = xmalloc (sizeof (asymbol *)); + *retval[1]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); + retval[1]->address = (reloc->address + RELAX_RELOC2 (fixp->fx_frag->fr_subtype)); + + f = fixp->fx_frag; + s = f->fr_symbol; + e = s->sy_value; + + retval[1]->addend = 0; + retval[1]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_LO16); + assert (retval[1]->howto != NULL); + + fixp->fx_r_type = BFD_RELOC_HI16_S; + } + + code = fixp->fx_r_type; + switch (fixp->fx_r_type) + { + case BFD_RELOC_32: + if (fixp->fx_pcrel) + { + code = BFD_RELOC_32_PCREL; + break; + } + case BFD_RELOC_HI16_S: + case BFD_RELOC_LO16: + case BFD_RELOC_SCORE_JMP: + case BFD_RELOC_SCORE_BRANCH: + case BFD_RELOC_SCORE16_JMP: + case BFD_RELOC_SCORE16_BRANCH: + case BFD_RELOC_VTABLE_ENTRY: + case BFD_RELOC_VTABLE_INHERIT: + case BFD_RELOC_SCORE_GPREL15: + case BFD_RELOC_SCORE_GOT15: + case BFD_RELOC_SCORE_DUMMY_HI16: + case BFD_RELOC_SCORE_GOT_LO16: + case BFD_RELOC_SCORE_CALL15: + case BFD_RELOC_GPREL32: + case BFD_RELOC_NONE: + code = fixp->fx_r_type; + break; + default: + type = _(""); + as_bad_where (fixp->fx_file, fixp->fx_line, + _("cannot represent %s relocation in this object file format"), type); + return NULL; + } + + reloc->howto = bfd_reloc_type_lookup (stdoutput, code); + if (reloc->howto == NULL) + { + as_bad_where (fixp->fx_file, fixp->fx_line, + _("cannot represent %s relocation in this object file format1"), + bfd_get_reloc_code_name (code)); + return NULL; + } + /* HACK: Since arm ELF uses Rel instead of Rela, encode the + vtable entry to be used in the relocation's section offset. */ + if (fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY) + reloc->address = fixp->fx_offset; + + return retval; +} + +void +score_elf_final_processing (void) +{ + if (fix_data_dependency == 1) + { + elf_elfheader (stdoutput)->e_flags |= EF_SCORE_FIXDEP; + } + if (score_pic == PIC) + { + elf_elfheader (stdoutput)->e_flags |= EF_SCORE_PIC; + } +} + +static void +parse_pce_inst (char *insnstr) +{ + char c; + char *p; + char first[MAX_LITERAL_POOL_SIZE]; + char second[MAX_LITERAL_POOL_SIZE]; + struct score_it pec_part_1; + + /* Get first part string of PCE. */ + p = strstr (insnstr, "||"); + c = *p; + *p = '\0'; + sprintf (first, "%s", insnstr); + + /* Get second part string of PCE. */ + *p = c; + p += 2; + sprintf (second, "%s", p); + + parse_16_32_inst (first, FALSE); + if (inst.error) + return; + + memcpy (&pec_part_1, &inst, sizeof (inst)); + + parse_16_32_inst (second, FALSE); + if (inst.error) + return; + + if ( ((pec_part_1.size == INSN_SIZE) && (inst.size == INSN_SIZE)) + || ((pec_part_1.size == INSN_SIZE) && (inst.size == INSN16_SIZE)) + || ((pec_part_1.size == INSN16_SIZE) && (inst.size == INSN_SIZE))) + { + inst.error = _("pce instruction error (16 bit || 16 bit)'"); + sprintf (inst.str, insnstr); + return; + } + + if (!inst.error) + gen_insn_frag (&pec_part_1, &inst); +} + +void +md_assemble (char *str) +{ + know (str); + know (strlen (str) < MAX_LITERAL_POOL_SIZE); + + memset (&inst, '\0', sizeof (inst)); + if (INSN_IS_PCE_P (str)) + parse_pce_inst (str); + else + parse_16_32_inst (str, TRUE); + + if (inst.error) + as_bad (_("%s -- `%s'"), inst.error, inst.str); +} + +/* We handle all bad expressions here, so that we can report the faulty + instruction in the error message. */ +void +md_operand (expressionS * expr) +{ + if (in_my_get_expression) + { + expr->X_op = O_illegal; + if (inst.error == NULL) + { + inst.error = _("bad expression"); + } + } +} + +const char *md_shortopts = "nO::g::G:"; + +#ifdef SCORE_BI_ENDIAN +#define OPTION_EB (OPTION_MD_BASE + 0) +#define OPTION_EL (OPTION_MD_BASE + 1) +#else +#if TARGET_BYTES_BIG_ENDIAN +#define OPTION_EB (OPTION_MD_BASE + 0) +#else +#define OPTION_EL (OPTION_MD_BASE + 1) +#endif +#endif +#define OPTION_FIXDD (OPTION_MD_BASE + 2) +#define OPTION_NWARN (OPTION_MD_BASE + 3) +#define OPTION_SCORE5 (OPTION_MD_BASE + 4) +#define OPTION_SCORE5U (OPTION_MD_BASE + 5) +#define OPTION_SCORE7 (OPTION_MD_BASE + 6) +#define OPTION_R1 (OPTION_MD_BASE + 7) +#define OPTION_O0 (OPTION_MD_BASE + 8) +#define OPTION_SCORE_VERSION (OPTION_MD_BASE + 9) +#define OPTION_PIC (OPTION_MD_BASE + 10) + +struct option md_longopts[] = +{ +#ifdef OPTION_EB + {"EB" , no_argument, NULL, OPTION_EB}, +#endif +#ifdef OPTION_EL + {"EL" , no_argument, NULL, OPTION_EL}, +#endif + {"FIXDD" , no_argument, NULL, OPTION_FIXDD}, + {"NWARN" , no_argument, NULL, OPTION_NWARN}, + {"SCORE5" , no_argument, NULL, OPTION_SCORE5}, + {"SCORE5U", no_argument, NULL, OPTION_SCORE5U}, + {"SCORE7" , no_argument, NULL, OPTION_SCORE7}, + {"USE_R1" , no_argument, NULL, OPTION_R1}, + {"O0" , no_argument, NULL, OPTION_O0}, + {"V" , no_argument, NULL, OPTION_SCORE_VERSION}, + {"KPIC" , no_argument, NULL, OPTION_PIC}, + {NULL , no_argument, NULL, 0} +}; + +size_t md_longopts_size = sizeof (md_longopts); + +int +md_parse_option (int c, char *arg) +{ + switch (c) + { +#ifdef OPTION_EB + case OPTION_EB: + target_big_endian = 1; + break; +#endif +#ifdef OPTION_EL + case OPTION_EL: + target_big_endian = 0; + break; +#endif + case OPTION_FIXDD: + fix_data_dependency = 1; + break; + case OPTION_NWARN: + warn_fix_data_dependency = 0; + break; + case OPTION_SCORE5: + score7 = 0; + university_version = 0; + vector_size = SCORE5_PIPELINE; + break; + case OPTION_SCORE5U: + score7 = 0; + university_version = 1; + vector_size = SCORE5_PIPELINE; + break; + case OPTION_SCORE7: + score7 = 1; + university_version = 0; + vector_size = SCORE7_PIPELINE; + break; + case OPTION_R1: + nor1 = 0; + break; + case 'G': + g_switch_value = atoi (arg); + break; + case OPTION_O0: + g_opt = 0; + break; + case OPTION_SCORE_VERSION: + printf (_("Sunplus-v2-0-0-20060510\n")); + break; + case OPTION_PIC: + score_pic = PIC; + g_switch_value = 0; /* Must set -G num as 0 to generate PIC code. */ + break; + default: + /* as_bad (_("unrecognized option `-%c%s'"), c, arg ? arg : ""); */ + return 0; + } + return 1; +} + +void +md_show_usage (FILE * fp) +{ + fprintf (fp, _(" Score-specific assembler options:\n")); +#ifdef OPTION_EB + fprintf (fp, _("\ + -EB\t\tassemble code for a big-endian cpu\n")); +#endif + +#ifdef OPTION_EL + fprintf (fp, _("\ + -EL\t\tassemble code for a little-endian cpu\n")); +#endif + + fprintf (fp, _("\ + -FIXDD\t\tassemble code for fix data dependency\n")); + fprintf (fp, _("\ + -NWARN\t\tassemble code for no warning message for fix data dependency\n")); + fprintf (fp, _("\ + -SCORE5\t\tassemble code for target is SCORE5\n")); + fprintf (fp, _("\ + -SCORE5U\tassemble code for target is SCORE5U\n")); + fprintf (fp, _("\ + -SCORE7\t\tassemble code for target is SCORE7, this is default setting\n")); + fprintf (fp, _("\ + -USE_R1\t\tassemble code for no warning message when using temp register r1\n")); + fprintf (fp, _("\ + -KPIC\t\tassemble code for PIC\n")); + fprintf (fp, _("\ + -O0\t\tassembler will not perform any optimizations\n")); + fprintf (fp, _("\ + -G gpnum\tassemble code for setting gpsize and default is 8 byte\n")); + fprintf (fp, _("\ + -V \t\tSunplus release version \n")); +} + + +/* Pesudo handling functions. */ + +/* If we change section we must dump the literal pool first. */ +static void +s_score_bss (int ignore ATTRIBUTE_UNUSED) +{ + subseg_set (bss_section, (subsegT) get_absolute_expression ()); + demand_empty_rest_of_line (); +} + +static void +s_score_text (int ignore) +{ + obj_elf_text (ignore); + record_alignment (now_seg, 2); +} + +static void +score_s_section (int ignore) +{ + obj_elf_section (ignore); + if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0) + record_alignment (now_seg, 2); + +} + +static void +s_change_sec (int sec) +{ + segT seg; + +#ifdef OBJ_ELF + /* The ELF backend needs to know that we are changing sections, so + that .previous works correctly. We could do something like check + for an obj_section_change_hook macro, but that might be confusing + as it would not be appropriate to use it in the section changing + functions in read.c, since obj-elf.c intercepts those. FIXME: + This should be cleaner, somehow. */ + obj_elf_section_change_hook (); +#endif + switch (sec) + { + case 'r': + seg = subseg_new (RDATA_SECTION_NAME, (subsegT) get_absolute_expression ()); + bfd_set_section_flags (stdoutput, seg, (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_RELOC | SEC_DATA)); + if (strcmp (TARGET_OS, "elf") != 0) + record_alignment (seg, 4); + demand_empty_rest_of_line (); + break; + case 's': + seg = subseg_new (".sdata", (subsegT) get_absolute_expression ()); + bfd_set_section_flags (stdoutput, seg, SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA); + if (strcmp (TARGET_OS, "elf") != 0) + record_alignment (seg, 4); + demand_empty_rest_of_line (); + break; + } +} + +static void +s_score_mask (int reg_type ATTRIBUTE_UNUSED) +{ + long mask, off; + + if (cur_proc_ptr == (procS *) NULL) + { + as_warn (_(".mask outside of .ent")); + demand_empty_rest_of_line (); + return; + } + if (get_absolute_expression_and_terminator (&mask) != ',') + { + as_warn (_("Bad .mask directive")); + --input_line_pointer; + demand_empty_rest_of_line (); + return; + } + off = get_absolute_expression (); + cur_proc_ptr->reg_mask = mask; + cur_proc_ptr->reg_offset = off; + demand_empty_rest_of_line (); +} + +static symbolS * +get_symbol (void) +{ + int c; + char *name; + symbolS *p; + + name = input_line_pointer; + c = get_symbol_end (); + p = (symbolS *) symbol_find_or_make (name); + *input_line_pointer = c; + return p; +} + +static long +get_number (void) +{ + int negative = 0; + long val = 0; + + if (*input_line_pointer == '-') + { + ++input_line_pointer; + negative = 1; + } + if (!ISDIGIT (*input_line_pointer)) + as_bad (_("expected simple number")); + if (input_line_pointer[0] == '0') + { + if (input_line_pointer[1] == 'x') + { + input_line_pointer += 2; + while (ISXDIGIT (*input_line_pointer)) + { + val <<= 4; + val |= hex_value (*input_line_pointer++); + } + return negative ? -val : val; + } + else + { + ++input_line_pointer; + while (ISDIGIT (*input_line_pointer)) + { + val <<= 3; + val |= *input_line_pointer++ - '0'; + } + return negative ? -val : val; + } + } + if (!ISDIGIT (*input_line_pointer)) + { + printf (_(" *input_line_pointer == '%c' 0x%02x\n"), *input_line_pointer, *input_line_pointer); + as_warn (_("invalid number")); + return -1; + } + while (ISDIGIT (*input_line_pointer)) + { + val *= 10; + val += *input_line_pointer++ - '0'; + } + return negative ? -val : val; +} + +/* The .aent and .ent directives. */ + +static void +s_score_ent (int aent) +{ + symbolS *symbolP; + int maybe_text; + + symbolP = get_symbol (); + if (*input_line_pointer == ',') + ++input_line_pointer; + SKIP_WHITESPACE (); + if (ISDIGIT (*input_line_pointer) || *input_line_pointer == '-') + get_number (); + +#ifdef BFD_ASSEMBLER + if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0) + maybe_text = 1; + else + maybe_text = 0; +#else + if (now_seg != data_section && now_seg != bss_section) + maybe_text = 1; + else + maybe_text = 0; +#endif + if (!maybe_text) + as_warn (_(".ent or .aent not in text section.")); + if (!aent && cur_proc_ptr) + as_warn (_("missing .end")); + if (!aent) + { + cur_proc_ptr = &cur_proc; + cur_proc_ptr->reg_mask = 0xdeadbeaf; + cur_proc_ptr->reg_offset = 0xdeadbeaf; + cur_proc_ptr->fpreg_mask = 0xdeafbeaf; + cur_proc_ptr->leaf = 0xdeafbeaf; + cur_proc_ptr->frame_offset = 0xdeafbeaf; + cur_proc_ptr->frame_reg = 0xdeafbeaf; + cur_proc_ptr->pc_reg = 0xdeafbeaf; + cur_proc_ptr->isym = symbolP; + symbol_get_bfdsym (symbolP)->flags |= BSF_FUNCTION; + ++numprocs; + if (debug_type == DEBUG_STABS) + stabs_generate_asm_func (S_GET_NAME (symbolP), S_GET_NAME (symbolP)); + } + demand_empty_rest_of_line (); +} + +static void +s_score_frame (int ignore ATTRIBUTE_UNUSED) +{ + char *backupstr; + char str[30]; + long val; + int i = 0; + + backupstr = input_line_pointer; + +#ifdef OBJ_ELF + if (cur_proc_ptr == (procS *) NULL) + { + as_warn (_(".frame outside of .ent")); + demand_empty_rest_of_line (); + return; + } + cur_proc_ptr->frame_reg = reg_required_here ((&backupstr), 0, REG_TYPE_SCORE); + SKIP_WHITESPACE (); + skip_past_comma (&backupstr); + while (*backupstr != ',') + { + str[i] = *backupstr; + i++; + backupstr++; + } + str[i] = '\0'; + val = atoi (str); + + SKIP_WHITESPACE (); + skip_past_comma (&backupstr); + cur_proc_ptr->frame_offset = val; + cur_proc_ptr->pc_reg = reg_required_here ((&backupstr), 0, REG_TYPE_SCORE); + + SKIP_WHITESPACE (); + skip_past_comma (&backupstr); + i = 0; + while (*backupstr != '\n') + { + str[i] = *backupstr; + i++; + backupstr++; + } + str[i] = '\0'; + val = atoi (str); + cur_proc_ptr->leaf = val; + SKIP_WHITESPACE (); + skip_past_comma (&backupstr); + +#endif /* OBJ_ELF */ + while (input_line_pointer != backupstr) + input_line_pointer++; +} + +/* The .end directive. */ +static void +s_score_end (int x ATTRIBUTE_UNUSED) +{ + symbolS *p; + int maybe_text; + + /* Generate a .pdr section. */ + segT saved_seg = now_seg; + subsegT saved_subseg = now_subseg; + valueT dot; + expressionS exp; + char *fragp; + + if (!is_end_of_line[(unsigned char)*input_line_pointer]) + { + p = get_symbol (); + demand_empty_rest_of_line (); + } + else + p = NULL; + +#ifdef BFD_ASSEMBLER + if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0) + maybe_text = 1; + else + maybe_text = 0; +#else + if (now_seg != data_section && now_seg != bss_section) + maybe_text = 1; + else + maybe_text = 0; +#endif + + if (!maybe_text) + as_warn (_(".end not in text section")); + if (!cur_proc_ptr) + { + as_warn (_(".end directive without a preceding .ent directive.")); + demand_empty_rest_of_line (); + return; + } + if (p != NULL) + { + assert (S_GET_NAME (p)); + if (strcmp (S_GET_NAME (p), S_GET_NAME (cur_proc_ptr->isym))) + as_warn (_(".end symbol does not match .ent symbol.")); + if (debug_type == DEBUG_STABS) + stabs_generate_asm_endfunc (S_GET_NAME (p), S_GET_NAME (p)); + } + else + as_warn (_(".end directive missing or unknown symbol")); + + if ((cur_proc_ptr->reg_mask == 0xdeadbeaf) || + (cur_proc_ptr->reg_offset == 0xdeadbeaf) || + (cur_proc_ptr->leaf == 0xdeafbeaf) || + (cur_proc_ptr->frame_offset == 0xdeafbeaf) || + (cur_proc_ptr->frame_reg == 0xdeafbeaf) || (cur_proc_ptr->pc_reg == 0xdeafbeaf)); + + else + { + dot = frag_now_fix (); + assert (pdr_seg); + subseg_set (pdr_seg, 0); + /* Write the symbol. */ + exp.X_op = O_symbol; + exp.X_add_symbol = p; + exp.X_add_number = 0; + emit_expr (&exp, 4); + fragp = frag_more (7 * 4); + md_number_to_chars (fragp, (valueT) cur_proc_ptr->reg_mask, 4); + md_number_to_chars (fragp + 4, (valueT) cur_proc_ptr->reg_offset, 4); + md_number_to_chars (fragp + 8, (valueT) cur_proc_ptr->fpreg_mask, 4); + md_number_to_chars (fragp + 12, (valueT) cur_proc_ptr->leaf, 4); + md_number_to_chars (fragp + 16, (valueT) cur_proc_ptr->frame_offset, 4); + md_number_to_chars (fragp + 20, (valueT) cur_proc_ptr->frame_reg, 4); + md_number_to_chars (fragp + 24, (valueT) cur_proc_ptr->pc_reg, 4); + subseg_set (saved_seg, saved_subseg); + + } + cur_proc_ptr = NULL; +} + +/* Handle the .set pseudo-op. */ +static void +s_score_set (int x ATTRIBUTE_UNUSED) +{ + int i = 0; + char name[MAX_LITERAL_POOL_SIZE]; + char * orig_ilp = input_line_pointer; + + while (!is_end_of_line[(unsigned char)*input_line_pointer]) + { + name[i] = (char) * input_line_pointer; + i++; + ++input_line_pointer; + } + + name[i] = '\0'; + + if (strcmp (name, "nwarn") == 0) + { + warn_fix_data_dependency = 0; + } + else if (strcmp (name, "fixdd") == 0) + { + fix_data_dependency = 1; + } + else if (strcmp (name, "nofixdd") == 0) + { + fix_data_dependency = 0; + } + else if (strcmp (name, "r1") == 0) + { + nor1 = 0; + } + else if (strcmp (name, "nor1") == 0) + { + nor1 = 1; + } + else if (strcmp (name, "optimize") == 0) + { + g_opt = 1; + } + else if (strcmp (name, "volatile") == 0) + { + g_opt = 0; + } + else if (strcmp (name, "pic") == 0) + { + score_pic = PIC; + } + else + { + input_line_pointer = orig_ilp; + s_set (0); + } +} + +/* Handle the .cpload pseudo-op. This is used when generating PIC code. It sets the + $gp register for the function based on the function address, which is in the register + named in the argument. This uses a relocation against GP_DISP_LABEL, which is handled + specially by the linker. The result is: + ldis gp, %hi(GP_DISP_LABEL) + ori gp, %low(GP_DISP_LABEL) + add gp, gp, .cpload argument + The .cpload argument is normally r29. */ + +static void +s_score_cpload (int ignore ATTRIBUTE_UNUSED) +{ + int reg; + char insn_str[MAX_LITERAL_POOL_SIZE]; + + /* If we are not generating PIC code, .cpload is ignored. */ + if (score_pic == NO_PIC) + { + s_ignore (0); + return; + } + + if ((reg = reg_required_here (&input_line_pointer, -1, REG_TYPE_SCORE)) == (int) FAIL) + return; + + demand_empty_rest_of_line (); + + sprintf (insn_str, "ld_i32hi r%d, %s", GP, GP_DISP_LABEL); + if (append_insn (insn_str, TRUE) == (int) FAIL) + return; + + sprintf (insn_str, "ld_i32lo r%d, %s", GP, GP_DISP_LABEL); + if (append_insn (insn_str, TRUE) == (int) FAIL) + return; + + sprintf (insn_str, "add r%d, r%d, r%d", GP, GP, reg); + if (append_insn (insn_str, TRUE) == (int) FAIL) + return; +} + +/* Handle the .cprestore pseudo-op. This stores $gp into a given + offset from $sp. The offset is remembered, and after making a PIC + call $gp is restored from that location. */ + +static void +s_score_cprestore (int ignore ATTRIBUTE_UNUSED) +{ + int reg; + int cprestore_offset; + char insn_str[MAX_LITERAL_POOL_SIZE]; + + /* If we are not generating PIC code, .cprestore is ignored. */ + if (score_pic == NO_PIC) + { + s_ignore (0); + return; + } + + if ((reg = reg_required_here (&input_line_pointer, -1, REG_TYPE_SCORE)) == (int) FAIL + || skip_past_comma (&input_line_pointer) == (int) FAIL) + { + return; + } + + cprestore_offset = get_absolute_expression (); + + if (cprestore_offset <= 0x3fff) + { + sprintf (insn_str, "sw r%d, [r%d, %d]", GP, reg, cprestore_offset); + if (append_insn (insn_str, TRUE) == (int) FAIL) + return; + } + else + { + int r1_bak; + + r1_bak = nor1; + nor1 = 0; + + sprintf (insn_str, "li r1, %d", cprestore_offset); + if (append_insn (insn_str, TRUE) == (int) FAIL) + return; + + sprintf (insn_str, "add r1, r1, r%d", reg); + if (append_insn (insn_str, TRUE) == (int) FAIL) + return; + + sprintf (insn_str, "sw r%d, [r1]", GP); + if (append_insn (insn_str, TRUE) == (int) FAIL) + return; + + nor1 = r1_bak; + } + + demand_empty_rest_of_line (); +} + +/* Handle the .gpword pseudo-op. This is used when generating PIC + code. It generates a 32 bit GP relative reloc. */ +static void +s_score_gpword (int ignore ATTRIBUTE_UNUSED) +{ + expressionS ex; + char *p; + + /* When not generating PIC code, this is treated as .word. */ + if (score_pic == NO_PIC) + { + cons (4); + return; + } + expression (&ex); + if (ex.X_op != O_symbol || ex.X_add_number != 0) + { + as_bad (_("Unsupported use of .gpword")); + ignore_rest_of_line (); + } + p = frag_more (4); + md_number_to_chars (p, (valueT) 0, 4); + fix_new_exp (frag_now, p - frag_now->fr_literal, 4, &ex, FALSE, BFD_RELOC_GPREL32); + demand_empty_rest_of_line (); +} + +/* Handle the .cpadd pseudo-op. This is used when dealing with switch + tables in PIC code. */ + +static void +s_score_cpadd (int ignore ATTRIBUTE_UNUSED) +{ + int reg; + char insn_str[MAX_LITERAL_POOL_SIZE]; + + /* If we are not generating PIC code, .cpload is ignored. */ + if (score_pic == NO_PIC) + { + s_ignore (0); + return; + } + + if ((reg = reg_required_here (&input_line_pointer, -1, REG_TYPE_SCORE)) == (int) FAIL) + { + return; + } + demand_empty_rest_of_line (); + + /* Add $gp to the register named as an argument. */ + sprintf (insn_str, "add r%d, r%d, r%d", reg, reg, GP); + if (append_insn (insn_str, TRUE) == (int) FAIL) + return; +} + +#ifndef TC_IMPLICIT_LCOMM_ALIGNMENT +#define TC_IMPLICIT_LCOMM_ALIGNMENT(SIZE, P2VAR) \ + do \ + { \ + if ((SIZE) >= 8) \ + (P2VAR) = 3; \ + else if ((SIZE) >= 4) \ + (P2VAR) = 2; \ + else if ((SIZE) >= 2) \ + (P2VAR) = 1; \ + else \ + (P2VAR) = 0; \ + } \ + while (0) +#endif + +static void +s_score_lcomm (int bytes_p) +{ + char *name; + char c; + char *p; + int temp; + symbolS *symbolP; + segT current_seg = now_seg; + subsegT current_subseg = now_subseg; + const int max_alignment = 15; + int align = 0; + segT bss_seg = bss_section; + int needs_align = 0; + + name = input_line_pointer; + c = get_symbol_end (); + p = input_line_pointer; + *p = c; + + if (name == p) + { + as_bad (_("expected symbol name")); + discard_rest_of_line (); + return; + } + + SKIP_WHITESPACE (); + + /* Accept an optional comma after the name. The comma used to be + required, but Irix 5 cc does not generate it. */ + if (*input_line_pointer == ',') + { + ++input_line_pointer; + SKIP_WHITESPACE (); + } + + if (is_end_of_line[(unsigned char)*input_line_pointer]) + { + as_bad (_("missing size expression")); + return; + } + + if ((temp = get_absolute_expression ()) < 0) + { + as_warn (_("BSS length (%d) < 0 ignored"), temp); + ignore_rest_of_line (); + return; + } + +#if defined (TC_SCORE) + if (OUTPUT_FLAVOR == bfd_target_ecoff_flavour || OUTPUT_FLAVOR == bfd_target_elf_flavour) + { + /* For Score and Alpha ECOFF or ELF, small objects are put in .sbss. */ + if ((unsigned)temp <= bfd_get_gp_size (stdoutput)) + { + bss_seg = subseg_new (".sbss", 1); + seg_info (bss_seg)->bss = 1; +#ifdef BFD_ASSEMBLER + if (!bfd_set_section_flags (stdoutput, bss_seg, SEC_ALLOC)) + as_warn (_("error setting flags for \".sbss\": %s"), bfd_errmsg (bfd_get_error ())); +#endif + } + } +#endif + + SKIP_WHITESPACE (); + if (*input_line_pointer == ',') + { + ++input_line_pointer; + SKIP_WHITESPACE (); + + if (is_end_of_line[(unsigned char)*input_line_pointer]) + { + as_bad (_("missing alignment")); + return; + } + else + { + align = get_absolute_expression (); + needs_align = 1; + } + } + + if (!needs_align) + { + TC_IMPLICIT_LCOMM_ALIGNMENT (temp, align); + + /* Still zero unless TC_IMPLICIT_LCOMM_ALIGNMENT set it. */ + if (align) + record_alignment (bss_seg, align); + } + + if (needs_align) + { + if (bytes_p) + { + /* Convert to a power of 2. */ + if (align != 0) + { + unsigned int i; + + for (i = 0; align != 0; align >>= 1, ++i) + ; + align = i - 1; + } + } + + if (align > max_alignment) + { + align = max_alignment; + as_warn (_("alignment too large; %d assumed"), align); + } + else if (align < 0) + { + align = 0; + as_warn (_("alignment negative; 0 assumed")); + } + + record_alignment (bss_seg, align); + } + else + { + /* Assume some objects may require alignment on some systems. */ +#if defined (TC_ALPHA) && ! defined (VMS) + if (temp > 1) + { + align = ffs (temp) - 1; + if (temp % (1 << align)) + abort (); + } +#endif + } + + *p = 0; + symbolP = symbol_find_or_make (name); + *p = c; + + if ( +#if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT) \ + || defined (OBJ_BOUT) || defined (OBJ_MAYBE_BOUT)) +#ifdef BFD_ASSEMBLER + (OUTPUT_FLAVOR != bfd_target_aout_flavour + || (S_GET_OTHER (symbolP) == 0 && S_GET_DESC (symbolP) == 0)) && +#else + (S_GET_OTHER (symbolP) == 0 && S_GET_DESC (symbolP) == 0) && +#endif +#endif + (S_GET_SEGMENT (symbolP) == bss_seg || (!S_IS_DEFINED (symbolP) && S_GET_VALUE (symbolP) == 0))) + { + char *pfrag; + + subseg_set (bss_seg, 1); + + if (align) + frag_align (align, 0, 0); + + /* Detach from old frag. */ + if (S_GET_SEGMENT (symbolP) == bss_seg) + symbol_get_frag (symbolP)->fr_symbol = NULL; + + symbol_set_frag (symbolP, frag_now); + pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP, (offsetT) temp, NULL); + *pfrag = 0; + + + S_SET_SEGMENT (symbolP, bss_seg); + +#ifdef OBJ_COFF + /* The symbol may already have been created with a preceding + ".globl" directive -- be careful not to step on storage class + in that case. Otherwise, set it to static. */ + if (S_GET_STORAGE_CLASS (symbolP) != C_EXT) + { + S_SET_STORAGE_CLASS (symbolP, C_STAT); + } +#endif /* OBJ_COFF */ + +#ifdef S_SET_SIZE + S_SET_SIZE (symbolP, temp); +#endif + } + else + as_bad (_("symbol `%s' is already defined"), S_GET_NAME (symbolP)); + + subseg_set (current_seg, current_subseg); + + demand_empty_rest_of_line (); +} + +static void +insert_reg (const struct reg_entry *r, struct hash_control *htab) +{ + int i = 0; + int len = strlen (r->name) + 2; + char *buf = xmalloc (len); + char *buf2 = xmalloc (len); + + strcpy (buf + i, r->name); + for (i = 0; buf[i]; i++) + { + buf2[i] = TOUPPER (buf[i]); + } + buf2[i] = '\0'; + + hash_insert (htab, buf, (void *) r); + hash_insert (htab, buf2, (void *) r); +} + +static void +build_reg_hsh (struct reg_map *map) +{ + const struct reg_entry *r; + + if ((map->htab = hash_new ()) == NULL) + { + as_fatal (_("virtual memory exhausted")); + } + for (r = map->names; r->name != NULL; r++) + { + insert_reg (r, map->htab); + } +} + +void +md_begin (void) +{ + unsigned int i; + segT seg; + subsegT subseg; + + if ((score_ops_hsh = hash_new ()) == NULL) + as_fatal (_("virtual memory exhausted")); + + build_score_ops_hsh (); + + if ((dependency_insn_hsh = hash_new ()) == NULL) + as_fatal (_("virtual memory exhausted")); + + build_dependency_insn_hsh (); + + for (i = (int)REG_TYPE_FIRST; i < (int)REG_TYPE_MAX; i++) + build_reg_hsh (all_reg_maps + i); + + /* Initialize dependency vector. */ + init_dependency_vector (); + + bfd_set_arch_mach (stdoutput, TARGET_ARCH, 0); + seg = now_seg; + subseg = now_subseg; + pdr_seg = subseg_new (".pdr", (subsegT) 0); + (void)bfd_set_section_flags (stdoutput, pdr_seg, SEC_READONLY | SEC_RELOC | SEC_DEBUGGING); + (void)bfd_set_section_alignment (stdoutput, pdr_seg, 2); + subseg_set (seg, subseg); + + if (USE_GLOBAL_POINTER_OPT) + bfd_set_gp_size (stdoutput, g_switch_value); +} + + +const pseudo_typeS md_pseudo_table[] = +{ + {"bss", s_score_bss, 0}, + {"text", s_score_text, 0}, + {"word", cons, 4}, + {"long", cons, 4}, + {"extend", float_cons, 'x'}, + {"ldouble", float_cons, 'x'}, + {"packed", float_cons, 'p'}, + {"end", s_score_end, 0}, + {"ent", s_score_ent, 0}, + {"frame", s_score_frame, 0}, + {"rdata", s_change_sec, 'r'}, + {"sdata", s_change_sec, 's'}, + {"set", s_score_set, 0}, + {"mask", s_score_mask, 'R'}, + {"dword", cons, 8}, + {"lcomm", s_score_lcomm, 1}, + {"section", score_s_section, 0}, + {"cpload", s_score_cpload, 0}, + {"cprestore", s_score_cprestore, 0}, + {"gpword", s_score_gpword, 0}, + {"cpadd", s_score_cpadd, 0}, + {0, 0, 0} +}; + diff --git a/gas/config/tc-score.h b/gas/config/tc-score.h new file mode 100644 index 00000000000..2cd40395688 --- /dev/null +++ b/gas/config/tc-score.h @@ -0,0 +1,83 @@ +/* tc-score.h -- Score specific file for assembler + Copyright 2006 Free Software Foundation, Inc. + Contributed by: + Mei Ligang (ligang@sunnorth.com.cn) + Pei-Lin Tsai (pltsai@sunplus.com) + + This file is part of GAS, the GNU Assembler. + + GAS 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 2, or (at your option) + any later version. + + GAS 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 GAS; see the file COPYING. If not, write to the Free + Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef TC_SCORE +#define TC_SCORE + +#define TARGET_ARCH bfd_arch_score +#define WORKING_DOT_WORD +#define DIFF_EXPR_OK +#define RELOC_EXPANSION_POSSIBLE +#define MAX_RELOC_EXPANSION 2 +#define MAX_MEM_FOR_RS_ALIGN_CODE (3 + 4) + +#define md_undefined_symbol(name) NULL + +#define TARGET_FORMAT (target_big_endian ? "elf32-bigscore" : "elf32-littlescore") + +#define md_relax_frag(segment, fragp, stretch) score_relax_frag (segment, fragp, stretch) +extern int score_relax_frag (asection *, struct frag *, long); + +#define md_frag_check(fragp) score_frag_check (fragp) +extern void score_frag_check (fragS *); + +#define TC_VALIDATE_FIX(FIXP, SEGTYPE, SKIP) score_validate_fix (FIXP) +extern void score_validate_fix (struct fix *); + +#define TC_FORCE_RELOCATION(FIXP) score_force_relocation (FIXP) +extern int score_force_relocation (struct fix *); + +#define tc_fix_adjustable(fixp) score_fix_adjustable (fixp) +extern bfd_boolean score_fix_adjustable (struct fix *); + +#define elf_tc_final_processing score_elf_final_processing +extern void score_elf_final_processing (void); + +struct score_tc_frag_data +{ + unsigned int is_insn; + struct fix *fixp; +}; + +#define TC_FRAG_TYPE struct score_tc_frag_data + +#define TC_FRAG_INIT(FRAGP) \ + do \ + { \ + (FRAGP)->tc_frag_data.is_insn = (((FRAGP)->fr_type == rs_machine_dependent) ? 1 : 0); \ + } \ + while (0) + +#ifdef OBJ_ELF +#define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_" +#else +#define GLOBAL_OFFSET_TABLE_NAME "__GLOBAL_OFFSET_TABLE_" +#endif + +enum score_pic_level +{ + NO_PIC, + PIC +}; + +#endif /*TC_SCORE */ diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c index acf62aef21d..5545e94cbf2 100644 --- a/gas/config/tc-sh.c +++ b/gas/config/tc-sh.c @@ -1,6 +1,6 @@ /* tc-sh.c -- Assemble code for the Renesas / SuperH SH Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -21,9 +21,7 @@ /* Written By Steve Chamberlain */ -#include #include "as.h" -#include "bfd.h" #include "subsegs.h" #define DEFINE_TABLE #include "opcodes/sh-opc.h" @@ -827,8 +825,97 @@ sh_elf_cons (register int nbytes) else demand_empty_rest_of_line (); } -#endif /* OBJ_ELF */ +/* The regular frag_offset_fixed_p doesn't work for rs_align_test + frags. */ + +static bfd_boolean +align_test_frag_offset_fixed_p (const fragS *frag1, const fragS *frag2, + bfd_vma *offset) +{ + const fragS *frag; + bfd_vma off; + + /* Start with offset initialised to difference between the two frags. + Prior to assigning frag addresses this will be zero. */ + off = frag1->fr_address - frag2->fr_address; + if (frag1 == frag2) + { + *offset = off; + return TRUE; + } + + /* Maybe frag2 is after frag1. */ + frag = frag1; + while (frag->fr_type == rs_fill + || frag->fr_type == rs_align_test) + { + if (frag->fr_type == rs_fill) + off += frag->fr_fix + frag->fr_offset * frag->fr_var; + else + off += frag->fr_fix; + frag = frag->fr_next; + if (frag == NULL) + break; + if (frag == frag2) + { + *offset = off; + return TRUE; + } + } + + /* Maybe frag1 is after frag2. */ + off = frag1->fr_address - frag2->fr_address; + frag = frag2; + while (frag->fr_type == rs_fill + || frag->fr_type == rs_align_test) + { + if (frag->fr_type == rs_fill) + off -= frag->fr_fix + frag->fr_offset * frag->fr_var; + else + off -= frag->fr_fix; + frag = frag->fr_next; + if (frag == NULL) + break; + if (frag == frag1) + { + *offset = off; + return TRUE; + } + } + + return FALSE; +} + +/* Optimize a difference of symbols which have rs_align_test frag if + possible. */ + +int +sh_optimize_expr (expressionS *l, operatorT op, expressionS *r) +{ + bfd_vma frag_off; + + if (op == O_subtract + && l->X_op == O_symbol + && r->X_op == O_symbol + && S_GET_SEGMENT (l->X_add_symbol) == S_GET_SEGMENT (r->X_add_symbol) + && (SEG_NORMAL (S_GET_SEGMENT (l->X_add_symbol)) + || r->X_add_symbol == l->X_add_symbol) + && align_test_frag_offset_fixed_p (symbol_get_frag (l->X_add_symbol), + symbol_get_frag (r->X_add_symbol), + &frag_off)) + { + l->X_add_number -= r->X_add_number; + l->X_add_number -= frag_off / OCTETS_PER_BYTE; + l->X_add_number += (S_GET_VALUE (l->X_add_symbol) + - S_GET_VALUE (r->X_add_symbol)); + l->X_op = O_constant; + l->X_add_symbol = 0; + return 1; + } + return 0; +} +#endif /* OBJ_ELF */ /* This function is called once, at assembler startup time. This should set up all the tables, etc that the MD part of the assembler needs. */ @@ -2798,7 +2885,7 @@ md_assemble (char *str) if (opcode == NULL) { /* The opcode is not in the hash table. - This means we definately have an assembly failure, + This means we definitely have an assembly failure, but the instruction may be valid in another CPU variant. In this case emit something better than 'unknown opcode'. Search the full table in sh-opc.h to check. */ @@ -2867,6 +2954,9 @@ md_assemble (char *str) as_bad (_("Delayed branches not available on SH1")); parse_exp (op_end + 1, &operand[0]); build_relax (opcode, &operand[0]); + + /* All branches are currently 16 bit. */ + size = 2; } else { @@ -3065,6 +3155,10 @@ struct option md_longopts[] = {"relax", no_argument, NULL, OPTION_RELAX}, {"big", no_argument, NULL, OPTION_BIG}, {"little", no_argument, NULL, OPTION_LITTLE}, + /* The next two switches are here because the + generic parts of the linker testsuite uses them. */ + {"EB", no_argument, NULL, OPTION_BIG}, + {"EL", no_argument, NULL, OPTION_LITTLE}, {"small", no_argument, NULL, OPTION_SMALL}, {"dsp", no_argument, NULL, OPTION_DSP}, {"isa", required_argument, NULL, OPTION_ISA}, @@ -3313,6 +3407,21 @@ sh_frob_section (bfd *abfd ATTRIBUTE_UNUSED, segT sec, if (seginfo == NULL) return; + for (fix = seginfo->fix_root; fix != NULL; fix = fix->fx_next) + { + symbolS *sym; + + sym = fix->fx_addsy; + /* Check for a local_symbol. */ + if (sym && sym->bsym == NULL) + { + struct local_symbol *ls = (struct local_symbol *)sym; + /* See if it's been converted. If so, canonicalize. */ + if (local_symbol_converted_p (ls)) + fix->fx_addsy = local_symbol_get_real_symbol (ls); + } + } + for (fix = seginfo->fix_root; fix != NULL; fix = fix->fx_next) { symbolS *sym; @@ -3666,7 +3775,7 @@ sh_handle_align (fragS *frag) else if (frag->fr_type == rs_align_test) { if (bytes != 0) - as_warn_where (frag->fr_file, frag->fr_line, _("misaligned data")); + as_bad_where (frag->fr_file, frag->fr_line, _("misaligned data")); } if (sh_relax @@ -3780,6 +3889,28 @@ sh_elf_final_processing (void) } #endif +/* Apply fixup FIXP to SIZE-byte field BUF given that VAL is its + assembly-time value. If we're generating a reloc for FIXP, + see whether the addend should be stored in-place or whether + it should be in an ELF r_addend field. */ + +static void +apply_full_field_fix (fixS *fixP, char *buf, bfd_vma val, int size) +{ + reloc_howto_type *howto; + + if (fixP->fx_addsy != NULL || fixP->fx_pcrel) + { + howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type); + if (howto && !howto->partial_inplace) + { + fixP->fx_addnumber = val; + return; + } + } + md_number_to_chars (buf, val, size); +} + /* Apply a fixup to the object file. */ void @@ -3980,11 +4111,11 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) case BFD_RELOC_32: case BFD_RELOC_32_PCREL: - md_number_to_chars (buf, val, 4); + apply_full_field_fix (fixP, buf, val, 4); break; case BFD_RELOC_16: - md_number_to_chars (buf, val, 2); + apply_full_field_fix (fixP, buf, val, 2); break; case BFD_RELOC_SH_USES: @@ -4016,8 +4147,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) val = fixP->fx_offset; if (fixP->fx_subsy) val -= S_GET_VALUE (fixP->fx_subsy); - fixP->fx_addnumber = val; - md_number_to_chars (buf, val, 4); + apply_full_field_fix (fixP, buf, val, 4); break; case BFD_RELOC_SH_GOTPC: @@ -4038,7 +4168,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) was used to store the correction, but since the expression is not pcrel, I felt it would be confusing to do it this way. */ * valP -= 1; - md_number_to_chars (buf, val, 4); + apply_full_field_fix (fixP, buf, val, 4); break; case BFD_RELOC_SH_TLS_GD_32: @@ -4049,7 +4179,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) case BFD_RELOC_32_GOT_PCREL: case BFD_RELOC_SH_GOTPLT32: * valP = 0; /* Fully resolved at runtime. No addend. */ - md_number_to_chars (buf, 0, 4); + apply_full_field_fix (fixP, buf, 0, 4); break; case BFD_RELOC_SH_TLS_LDO_32: @@ -4057,7 +4187,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) S_SET_THREAD_LOCAL (fixP->fx_addsy); /* Fallthrough */ case BFD_RELOC_32_GOTOFF: - md_number_to_chars (buf, val, 4); + apply_full_field_fix (fixP, buf, val, 4); break; #endif @@ -4082,6 +4212,11 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) } if (max != 0 && (val < min || val > max)) as_bad_where (fixP->fx_file, fixP->fx_line, _("offset out of range")); + else if (max != 0) + /* Stop the generic code from trying to overlow check the value as well. + It may not have the correct value anyway, as we do not store val back + into *valP. */ + fixP->fx_no_overflow = 1; if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0) fixP->fx_done = 1; @@ -4255,12 +4390,8 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp) else if (shmedia_init_reloc (rel, fixp)) ; #endif - else if (fixp->fx_pcrel) - rel->addend = fixp->fx_addnumber; - else if (r_type == BFD_RELOC_32 || r_type == BFD_RELOC_32_GOTOFF) - rel->addend = fixp->fx_addnumber; else - rel->addend = 0; + rel->addend = fixp->fx_addnumber; rel->howto = bfd_reloc_type_lookup (stdoutput, r_type); @@ -4382,7 +4513,7 @@ sh_cfi_frame_initial_instructions (void) } int -sh_regname_to_dw2regnum (const char *regname) +sh_regname_to_dw2regnum (char *regname) { unsigned int regnum = -1; unsigned int i; diff --git a/gas/config/tc-sh.h b/gas/config/tc-sh.h index a812036fcd5..80542f46554 100644 --- a/gas/config/tc-sh.h +++ b/gas/config/tc-sh.h @@ -1,6 +1,6 @@ /* This file is tc-sh.h Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -44,6 +44,14 @@ extern int sh_small; #define md_cons_align(nbytes) sh_cons_align (nbytes) extern void sh_cons_align (int); +/* We need to optimize expr with taking account of rs_align_test + frags. */ + +#ifdef OBJ_ELF +#define md_optimize_expr(l,o,r) sh_optimize_expr (l, o, r) +extern int sh_optimize_expr (expressionS *, operatorT, expressionS *); +#endif + /* When relaxing, we need to generate relocations for alignment directives. */ #define HANDLE_ALIGN(frag) sh_handle_align (frag) @@ -81,6 +89,11 @@ extern int sh_force_relocation (struct fix *); #define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section (FIX, SEC) extern long md_pcrel_from_section (struct fix *, segT); +/* SH_COUNT relocs are allowed outside of frag. + The target is also buggy and sets fix size too large for other relocs. */ +#define TC_FX_SIZE_SLACK(FIX) \ + ((FIX)->fx_r_type == BFD_RELOC_SH_COUNT ? -1 : 2) + #define IGNORE_NONSTANDARD_ESCAPES #define LISTING_HEADER \ @@ -149,6 +162,8 @@ extern int target_big_endian; #define TARGET_FORMAT (!target_big_endian ? "elf32-shl-nbsd" : "elf32-sh-nbsd") #elif defined TARGET_SYMBIAN #define TARGET_FORMAT (!target_big_endian ? "elf32-shl-symbian" : "elf32-sh-symbian") +#elif defined (TE_VXWORKS) +#define TARGET_FORMAT (!target_big_endian ? "elf32-shl-vxworks" : "elf32-sh-vxworks") #else #define TARGET_FORMAT (!target_big_endian ? "elf32-shl" : "elf32-sh") #endif @@ -187,7 +202,6 @@ extern bfd_boolean sh_fix_adjustable (struct fix *); #define TC_FORCE_RELOCATION_LOCAL(FIX) \ (!(FIX)->fx_pcrel \ - || (FIX)->fx_plt \ || (FIX)->fx_r_type == BFD_RELOC_32_PLT_PCREL \ || (FIX)->fx_r_type == BFD_RELOC_32_GOT_PCREL \ || (FIX)->fx_r_type == BFD_RELOC_SH_GOTPC \ @@ -225,11 +239,11 @@ void sh_cons_fix_new (fragS *, int, int, expressionS *); extern void sh_cfi_frame_initial_instructions (void); #define tc_regname_to_dw2regnum sh_regname_to_dw2regnum -extern int sh_regname_to_dw2regnum (const char *regname); +extern int sh_regname_to_dw2regnum (char *regname); /* All SH instructions are multiples of 16 bits. */ #define DWARF2_LINE_MIN_INSN_LENGTH 2 #define DWARF2_DEFAULT_RETURN_COLUMN 17 -#define DWARF2_CIE_DATA_ALIGNMENT -4 +#define DWARF2_CIE_DATA_ALIGNMENT (-4) #endif /* OBJ_ELF */ diff --git a/gas/config/tc-sh64.c b/gas/config/tc-sh64.c index 74330612e43..a306c1b8ddf 100644 --- a/gas/config/tc-sh64.c +++ b/gas/config/tc-sh64.c @@ -1,5 +1,6 @@ /* tc-sh64.c -- Assemble code for the SuperH SH SHcompact and SHmedia. - Copyright 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation. + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation. This file is part of GAS, the GNU Assembler. @@ -25,7 +26,6 @@ #define HAVE_SH64 -#include #include "as.h" #include "safe-ctype.h" #include "opcodes/sh64-opc.h" @@ -1533,7 +1533,7 @@ shmedia_check_limits (offsetT *valp, bfd_reloc_code_real_type reloc, case BFD_RELOC_SH_IMMU16: if (val < 0 || val > (1 << 16) - 1) - msg = _("invalid operand, not an 16-bit unsigned value: %d"); + msg = _("invalid operand, not a 16-bit unsigned value: %d"); break; case BFD_RELOC_SH_PT_16: @@ -3035,8 +3035,6 @@ sh64_target_mach (void) valueT shmedia_md_pcrel_from_section (struct fix *fixP, segT sec ATTRIBUTE_UNUSED) { - know (fixP->fx_frag->fr_type == rs_machine_dependent); - /* Use the ISA for the instruction to decide which offset to use. We can glean it from the fisup type. */ switch (fixP->fx_r_type) diff --git a/gas/config/tc-sh64.h b/gas/config/tc-sh64.h index 21f5d59f4c5..f31f7501b00 100644 --- a/gas/config/tc-sh64.h +++ b/gas/config/tc-sh64.h @@ -1,5 +1,6 @@ /* This file is tc-sh64.h - Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003, 2007 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -79,7 +80,6 @@ extern int sh64_target_mach (void); #undef TC_FORCE_RELOCATION_LOCAL #define TC_FORCE_RELOCATION_LOCAL(FIX) \ (!(FIX)->fx_pcrel \ - || (FIX)->fx_plt \ || (FIX)->fx_r_type == BFD_RELOC_32_PLT_PCREL \ || (FIX)->fx_r_type == BFD_RELOC_SH_PLT_LOW16 \ || (FIX)->fx_r_type == BFD_RELOC_SH_PLT_MEDLOW16 \ diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index 10a1411b526..d4a409fbc34 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -1,6 +1,6 @@ /* tc-sparc.c -- Assemble for the SPARC Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -19,8 +19,6 @@ to the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include - #include "as.h" #include "safe-ctype.h" #include "subsegs.h" @@ -339,7 +337,7 @@ sparc_target_format () #endif #ifdef OBJ_ELF - return sparc_arch_size == 64 ? "elf64-sparc" : "elf32-sparc"; + return sparc_arch_size == 64 ? ELF64_TARGET_FORMAT : ELF_TARGET_FORMAT; #endif abort (); @@ -547,12 +545,12 @@ md_parse_option (c, arg) { if (sparc_arch_size == 32) { - if (strcmp (*l, "elf32-sparc") == 0) + if (CONST_STRNEQ (*l, "elf32-sparc")) break; } else { - if (strcmp (*l, "elf64-sparc") == 0) + if (CONST_STRNEQ (*l, "elf64-sparc")) break; } } @@ -1862,7 +1860,8 @@ sparc_ip (str, pinsn) case '\0': /* End of args. */ if (s[0] == ',' && s[1] == '%') { - static const struct tls_ops { + static const struct tls_ops + { /* The name as it appears in assembler. */ char *name; /* strlen (name), precomputed for speed */ @@ -1871,7 +1870,9 @@ sparc_ip (str, pinsn) int reloc; /* 1 if call. */ int call; - } tls_ops[] = { + } + tls_ops[] = + { { "tgd_add", 7, BFD_RELOC_SPARC_TLS_GD_ADD, 0 }, { "tgd_call", 8, BFD_RELOC_SPARC_TLS_GD_CALL, 1 }, { "tldm_add", 8, BFD_RELOC_SPARC_TLS_LDM_ADD, 0 }, @@ -1879,7 +1880,8 @@ sparc_ip (str, pinsn) { "tldo_add", 8, BFD_RELOC_SPARC_TLS_LDO_ADD, 0 }, { "tie_ldx", 7, BFD_RELOC_SPARC_TLS_IE_LDX, 0 }, { "tie_ld", 6, BFD_RELOC_SPARC_TLS_IE_LD, 0 }, - { "tie_add", 7, BFD_RELOC_SPARC_TLS_IE_ADD, 0 } + { "tie_add", 7, BFD_RELOC_SPARC_TLS_IE_ADD, 0 }, + { NULL, 0, 0, 0 } }; const struct tls_ops *o; char *s1; @@ -3311,9 +3313,9 @@ md_apply_fix (fixP, valP, segment) break; case BFD_RELOC_SPARC_WDISP16: - /* FIXME: simplify. */ - if (((val > 0) && (val & ~0x3fffc)) - || ((val < 0) && (~(val - 1) & ~0x3fffc))) + if ((val & 3) + || val >= 0x1fffc + || val <= -(offsetT) 0x20008) as_bad_where (fixP->fx_file, fixP->fx_line, _("relocation overflow")); /* FIXME: The +1 deserves a comment. */ @@ -3322,9 +3324,9 @@ md_apply_fix (fixP, valP, segment) break; case BFD_RELOC_SPARC_WDISP19: - /* FIXME: simplify. */ - if (((val > 0) && (val & ~0x1ffffc)) - || ((val < 0) && (~(val - 1) & ~0x1ffffc))) + if ((val & 3) + || val >= 0xffffc + || val <= -(offsetT) 0x100008) as_bad_where (fixP->fx_file, fixP->fx_line, _("relocation overflow")); /* FIXME: The +1 deserves a comment. */ @@ -3439,7 +3441,7 @@ md_apply_fix (fixP, valP, segment) arelent ** tc_gen_reloc (section, fixp) - asection *section ATTRIBUTE_UNUSED; + asection *section; fixS *fixp; { static arelent *relocs[3]; @@ -3582,6 +3584,16 @@ tc_gen_reloc (section, fixp) } #endif /* defined (OBJ_ELF) || defined (OBJ_AOUT) */ + /* Nothing is aligned in DWARF debugging sections. */ + if (bfd_get_section_flags (stdoutput, section) & SEC_DEBUGGING) + switch (code) + { + case BFD_RELOC_16: code = BFD_RELOC_SPARC_UA16; break; + case BFD_RELOC_32: code = BFD_RELOC_SPARC_UA32; break; + case BFD_RELOC_64: code = BFD_RELOC_SPARC_UA64; break; + default: break; + } + if (code == BFD_RELOC_SPARC_OLO10) reloc->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_LO10); else @@ -4602,7 +4614,7 @@ sparc_cfi_frame_initial_instructions () } int -sparc_regname_to_dw2regnum (const char *regname) +sparc_regname_to_dw2regnum (char *regname) { char *p, *q; diff --git a/gas/config/tc-sparc.h b/gas/config/tc-sparc.h index 14da16ad627..90c0e95d0f5 100644 --- a/gas/config/tc-sparc.h +++ b/gas/config/tc-sparc.h @@ -1,6 +1,7 @@ /* tc-sparc.h - Macros and type defines for the sparc. Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2005, 2007 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -31,6 +32,19 @@ struct frag; #define TARGET_ARCH bfd_arch_sparc +#ifdef TE_FreeBSD +#define ELF_TARGET_FORMAT "elf32-sparc-freebsd" +#define ELF64_TARGET_FORMAT "elf64-sparc-freebsd" +#endif + +#ifndef ELF_TARGET_FORMAT +#define ELF_TARGET_FORMAT "elf32-sparc" +#endif + +#ifndef ELF64_TARGET_FORMAT +#define ELF64_TARGET_FORMAT "elf64-sparc" +#endif + extern const char *sparc_target_format PARAMS ((void)); #define TARGET_FORMAT sparc_target_format () @@ -78,7 +92,6 @@ extern void sparc_handle_align PARAMS ((struct frag *)); #define TC_FORCE_RELOCATION_LOCAL(FIX) \ (!(FIX)->fx_pcrel \ - || (FIX)->fx_plt \ || (sparc_pic_code \ && S_IS_EXTERNAL ((FIX)->fx_addsy)) \ || TC_FORCE_RELOCATION (FIX)) @@ -171,7 +184,7 @@ extern void cons_fix_new_sparc extern void sparc_cfi_frame_initial_instructions PARAMS ((void)); #define tc_regname_to_dw2regnum sparc_regname_to_dw2regnum -extern int sparc_regname_to_dw2regnum PARAMS ((const char *regname)); +extern int sparc_regname_to_dw2regnum PARAMS ((char *regname)); #define tc_cfi_emit_pcrel_expr sparc_cfi_emit_pcrel_expr extern void sparc_cfi_emit_pcrel_expr PARAMS ((expressionS *, unsigned int)); diff --git a/gas/config/tc-spu.c b/gas/config/tc-spu.c new file mode 100644 index 00000000000..ef801df9a76 --- /dev/null +++ b/gas/config/tc-spu.c @@ -0,0 +1,1083 @@ +/* spu.c -- Assembler for the IBM Synergistic Processing Unit (SPU) + + Copyright 2006, 2007 Free Software Foundation, Inc. + + This file is part of GAS, the GNU Assembler. + + GAS 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 2, or (at your option) + any later version. + + GAS 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 GAS; see the file COPYING. If not, write to the Free + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ + +#include "as.h" +#include "safe-ctype.h" +#include "subsegs.h" +#include "dwarf2dbg.h" + +const struct spu_opcode spu_opcodes[] = { +#define APUOP(TAG,MACFORMAT,OPCODE,MNEMONIC,ASMFORMAT,DEP,PIPE) \ + { MACFORMAT, (OPCODE) << (32-11), MNEMONIC, ASMFORMAT }, +#define APUOPFB(TAG,MACFORMAT,OPCODE,FB,MNEMONIC,ASMFORMAT,DEP,PIPE) \ + { MACFORMAT, ((OPCODE) << (32-11)) | ((FB) << (32-18)), MNEMONIC, ASMFORMAT }, +#include "opcode/spu-insns.h" +#undef APUOP +#undef APUOPFB +}; + +static const int spu_num_opcodes = + sizeof (spu_opcodes) / sizeof (spu_opcodes[0]); + +#define MAX_RELOCS 2 + +struct spu_insn +{ + unsigned int opcode; + expressionS exp[MAX_RELOCS]; + int reloc_arg[MAX_RELOCS]; + int flag[MAX_RELOCS]; + enum spu_insns tag; +}; + +static const char *get_imm (const char *param, struct spu_insn *insn, int arg); +static const char *get_reg (const char *param, struct spu_insn *insn, int arg, + int accept_expr); +static int calcop (struct spu_opcode *format, const char *param, + struct spu_insn *insn); +static void spu_cons (int); + +extern char *myname; +static struct hash_control *op_hash = NULL; + +/* These bits should be turned off in the first address of every segment */ +int md_seg_align = 7; + +/* These chars start a comment anywhere in a source file (except inside + another comment */ +const char comment_chars[] = "#"; + +/* These chars only start a comment at the beginning of a line. */ +const char line_comment_chars[] = "#"; + +/* gods own line continuation char */ +const char line_separator_chars[] = ";"; + +/* Chars that can be used to separate mant from exp in floating point nums */ +const char EXP_CHARS[] = "eE"; + +/* Chars that mean this number is a floating point constant */ +/* as in 0f123.456 */ +/* or 0H1.234E-12 (see exp chars above) */ +const char FLT_CHARS[] = "dDfF"; + +const pseudo_typeS md_pseudo_table[] = +{ + {"align", s_align_ptwo, 4}, + {"bss", s_lcomm_bytes, 1}, + {"def", s_set, 0}, + {"dfloat", float_cons, 'd'}, + {"ffloat", float_cons, 'f'}, + {"global", s_globl, 0}, + {"half", cons, 2}, + {"int", spu_cons, 4}, + {"long", spu_cons, 4}, + {"quad", spu_cons, 8}, + {"string", stringer, 1}, + {"word", spu_cons, 4}, + /* Force set to be treated as an instruction. */ + {"set", NULL, 0}, + {".set", s_set, 0}, + /* Likewise for eqv. */ + {"eqv", NULL, 0}, + {".eqv", s_set, -1}, + {"file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0 }, + {"loc", dwarf2_directive_loc, 0}, + {0,0,0} +}; + +void +md_begin (void) +{ + const char *retval = NULL; + int i; + + /* initialize hash table */ + + op_hash = hash_new (); + + /* loop until you see the end of the list */ + + for (i = 0; i < spu_num_opcodes; i++) + { + /* hash each mnemonic and record its position */ + + retval = hash_insert (op_hash, spu_opcodes[i].mnemonic, (PTR)&spu_opcodes[i]); + + if (retval != NULL && strcmp (retval, "exists") != 0) + as_fatal (_("Can't hash instruction '%s':%s"), + spu_opcodes[i].mnemonic, retval); + } +} + +const char *md_shortopts = ""; +struct option md_longopts[] = { +#define OPTION_APUASM (OPTION_MD_BASE) + {"apuasm", no_argument, NULL, OPTION_APUASM}, +#define OPTION_DD2 (OPTION_MD_BASE+1) + {"mdd2.0", no_argument, NULL, OPTION_DD2}, +#define OPTION_DD1 (OPTION_MD_BASE+2) + {"mdd1.0", no_argument, NULL, OPTION_DD1}, +#define OPTION_DD3 (OPTION_MD_BASE+3) + {"mdd3.0", no_argument, NULL, OPTION_DD3}, + { NULL, no_argument, NULL, 0 } +}; +size_t md_longopts_size = sizeof (md_longopts); + +/* When set (by -apuasm) our assembler emulates the behaviour of apuasm. + * e.g. don't add bias to float conversion and don't right shift + * immediate values. */ +static int emulate_apuasm; + +/* Use the dd2.0 instructions set. The only differences are some new + * register names and the orx insn */ +static int use_dd2 = 1; + +int +md_parse_option (int c, char *arg ATTRIBUTE_UNUSED) +{ + switch (c) + { + case OPTION_APUASM: + emulate_apuasm = 1; + break; + case OPTION_DD3: + use_dd2 = 1; + break; + case OPTION_DD2: + use_dd2 = 1; + break; + case OPTION_DD1: + use_dd2 = 0; + break; + default: + return 0; + } + return 1; +} + +void +md_show_usage (FILE *stream) +{ + fputs (_("\ +SPU options:\n\ + --apuasm emulate behaviour of apuasm\n"), + stream); +} + + +struct arg_encode { + int size; + int pos; + int rshift; + int lo, hi; + int wlo, whi; + bfd_reloc_code_real_type reloc; +}; + +static struct arg_encode arg_encode[A_MAX] = { + { 7, 0, 0, 0, 127, 0, -1, 0 }, /* A_T */ + { 7, 7, 0, 0, 127, 0, -1, 0 }, /* A_A */ + { 7, 14, 0, 0, 127, 0, -1, 0 }, /* A_B */ + { 7, 21, 0, 0, 127, 0, -1, 0 }, /* A_C */ + { 7, 7, 0, 0, 127, 0, -1, 0 }, /* A_S */ + { 7, 7, 0, 0, 127, 0, -1, 0 }, /* A_H */ + { 0, 0, 0, 0, -1, 0, -1, 0 }, /* A_P */ + { 7, 14, 0, 0, -1, 0, -1, BFD_RELOC_SPU_IMM7 }, /* A_S3 */ + { 7, 14, 0, -32, 31, -31, 0, BFD_RELOC_SPU_IMM7 }, /* A_S6 */ + { 7, 14, 0, 0, -1, 0, -1, BFD_RELOC_SPU_IMM7 }, /* A_S7N */ + { 7, 14, 0, -64, 63, -63, 0, BFD_RELOC_SPU_IMM7 }, /* A_S7 */ + { 8, 14, 0, 0, 127, 0, -1, BFD_RELOC_SPU_IMM8 }, /* A_U7A */ + { 8, 14, 0, 0, 127, 0, -1, BFD_RELOC_SPU_IMM8 }, /* A_U7B */ + { 10, 14, 0, -512, 511, -128, 255, BFD_RELOC_SPU_IMM10 }, /* A_S10B */ + { 10, 14, 0, -512, 511, 0, -1, BFD_RELOC_SPU_IMM10 }, /* A_S10 */ + { 2, 23, 9, -1024, 1023, 0, -1, BFD_RELOC_SPU_PCREL9a }, /* A_S11 */ + { 2, 14, 9, -1024, 1023, 0, -1, BFD_RELOC_SPU_PCREL9b }, /* A_S11I */ + { 10, 14, 4, -8192, 8191, 0, -1, BFD_RELOC_SPU_IMM10W }, /* A_S14 */ + { 16, 7, 0, -32768, 32767, 0, -1, BFD_RELOC_SPU_IMM16 }, /* A_S16 */ + { 16, 7, 2, -131072, 262143, 0, -1, BFD_RELOC_SPU_IMM16W }, /* A_S18 */ + { 16, 7, 2, -262144, 262143, 0, -1, BFD_RELOC_SPU_PCREL16 }, /* A_R18 */ + { 7, 14, 0, 0, -1, 0, -1, BFD_RELOC_SPU_IMM7 }, /* A_U3 */ + { 7, 14, 0, 0, 127, 0, 31, BFD_RELOC_SPU_IMM7 }, /* A_U5 */ + { 7, 14, 0, 0, 127, 0, 63, BFD_RELOC_SPU_IMM7 }, /* A_U6 */ + { 7, 14, 0, 0, -1, 0, -1, BFD_RELOC_SPU_IMM7 }, /* A_U7 */ + { 14, 0, 0, 0, 16383, 0, -1, 0 }, /* A_U14 */ + { 16, 7, 0, -32768, 65535, 0, -1, BFD_RELOC_SPU_IMM16 }, /* A_X16 */ + { 18, 7, 0, 0, 262143, 0, -1, BFD_RELOC_SPU_IMM18 }, /* A_U18 */ +}; + +/* Some flags for handling errors. This is very hackish and added after + * the fact. */ +static int syntax_error_arg; +static const char *syntax_error_param; +static int syntax_reg; + +static char * +insn_fmt_string (struct spu_opcode *format) +{ + static char buf[64]; + int len = 0; + int i; + + len += sprintf (&buf[len], "%s\t", format->mnemonic); + for (i = 1; i <= format->arg[0]; i++) + { + int arg = format->arg[i]; + char *exp; + if (i > 1 && arg != A_P && format->arg[i-1] != A_P) + buf[len++] = ','; + if (arg == A_P) + exp = "("; + else if (arg < A_P) + exp = i == syntax_error_arg ? "REG" : "reg"; + else + exp = i == syntax_error_arg ? "IMM" : "imm"; + len += sprintf (&buf[len], "%s", exp); + if (i > 1 && format->arg[i-1] == A_P) + buf[len++] = ')'; + } + buf[len] = 0; + return buf; +} + +void +md_assemble (char *op) +{ + char *param, *thisfrag; + char c; + struct spu_opcode *format; + struct spu_insn insn; + int i; + + assert (op); + + /* skip over instruction to find parameters */ + + for (param = op; *param != 0 && !ISSPACE (*param); param++) + ; + c = *param; + *param = 0; + + if (c != 0 && c != '\n') + param++; + + /* try to find the instruction in the hash table */ + + if ((format = (struct spu_opcode *) hash_find (op_hash, op)) == NULL) + { + as_bad (_("Invalid mnemonic '%s'"), op); + return; + } + + if (!use_dd2 && strcmp (format->mnemonic, "orx") == 0) + { + as_bad (_("'%s' is only available in DD2.0 or higher."), op); + return; + } + + while (1) + { + /* try parsing this instruction into insn */ + for (i = 0; i < MAX_RELOCS; i++) + { + insn.exp[i].X_add_symbol = 0; + insn.exp[i].X_op_symbol = 0; + insn.exp[i].X_add_number = 0; + insn.exp[i].X_op = O_illegal; + insn.reloc_arg[i] = -1; + insn.flag[i] = 0; + } + insn.opcode = format->opcode; + insn.tag = (enum spu_insns) (format - spu_opcodes); + + syntax_error_arg = 0; + syntax_error_param = 0; + syntax_reg = 0; + if (calcop (format, param, &insn)) + break; + + /* if it doesn't parse try the next instruction */ + if (!strcmp (format[0].mnemonic, format[1].mnemonic)) + format++; + else + { + int parg = format[0].arg[syntax_error_arg-1]; + + as_fatal (_("Error in argument %d. Expecting: \"%s\""), + syntax_error_arg - (parg == A_P), + insn_fmt_string (format)); + return; + } + } + + if ((syntax_reg & 4) + && ! (insn.tag == M_RDCH + || insn.tag == M_RCHCNT + || insn.tag == M_WRCH)) + as_warn (_("Mixing register syntax, with and without '$'.")); + if (syntax_error_param) + { + const char *d = syntax_error_param; + while (*d != '$') + d--; + as_warn (_("Treating '%-*s' as a symbol."), (int)(syntax_error_param - d), d); + } + + /* grow the current frag and plop in the opcode */ + + thisfrag = frag_more (4); + md_number_to_chars (thisfrag, insn.opcode, 4); + + /* if this instruction requires labels mark it for later */ + + for (i = 0; i < MAX_RELOCS; i++) + if (insn.reloc_arg[i] >= 0) + { + fixS *fixP; + bfd_reloc_code_real_type reloc = arg_encode[insn.reloc_arg[i]].reloc; + int pcrel = 0; + + if (reloc == BFD_RELOC_SPU_PCREL9a + || reloc == BFD_RELOC_SPU_PCREL9b + || reloc == BFD_RELOC_SPU_PCREL16) + pcrel = 1; + if (insn.flag[i] == 1) + reloc = BFD_RELOC_SPU_HI16; + else if (insn.flag[i] == 2) + reloc = BFD_RELOC_SPU_LO16; + fixP = fix_new_exp (frag_now, + thisfrag - frag_now->fr_literal, + 4, + &insn.exp[i], + pcrel, + reloc); + fixP->tc_fix_data.arg_format = insn.reloc_arg[i]; + fixP->tc_fix_data.insn_tag = insn.tag; + } + dwarf2_emit_insn (4); +} + +static int +calcop (struct spu_opcode *format, const char *param, struct spu_insn *insn) +{ + int i; + int paren = 0; + int arg; + + for (i = 1; i <= format->arg[0]; i++) + { + arg = format->arg[i]; + syntax_error_arg = i; + + while (ISSPACE (*param)) + param++; + if (*param == 0 || *param == ',') + return 0; + if (arg < A_P) + param = get_reg (param, insn, arg, 1); + else if (arg > A_P) + param = get_imm (param, insn, arg); + else if (arg == A_P) + { + paren++; + if ('(' != *param++) + return 0; + } + + if (!param) + return 0; + + while (ISSPACE (*param)) + param++; + + if (arg != A_P && paren) + { + paren--; + if (')' != *param++) + return 0; + } + else if (i < format->arg[0] + && format->arg[i] != A_P + && format->arg[i+1] != A_P) + { + if (',' != *param++) + { + syntax_error_arg++; + return 0; + } + } + } + while (ISSPACE (*param)) + param++; + return !paren && (*param == 0 || *param == '\n'); +} + +struct reg_name { + unsigned int regno; + unsigned int length; + char name[32]; +}; + +#define REG_NAME(NO,NM) { NO, sizeof (NM) - 1, NM } + +static struct reg_name reg_name[] = { + REG_NAME (0, "lr"), /* link register */ + REG_NAME (1, "sp"), /* stack pointer */ + REG_NAME (0, "rp"), /* link register */ + REG_NAME (127, "fp"), /* frame pointer */ +}; + +static struct reg_name sp_reg_name[] = { +}; + +static struct reg_name ch_reg_name[] = { + REG_NAME ( 0, "SPU_RdEventStat"), + REG_NAME ( 1, "SPU_WrEventMask"), + REG_NAME ( 2, "SPU_WrEventAck"), + REG_NAME ( 3, "SPU_RdSigNotify1"), + REG_NAME ( 4, "SPU_RdSigNotify2"), + REG_NAME ( 7, "SPU_WrDec"), + REG_NAME ( 8, "SPU_RdDec"), + REG_NAME ( 11, "SPU_RdEventMask"), /* DD2.0 only */ + REG_NAME ( 13, "SPU_RdMachStat"), + REG_NAME ( 14, "SPU_WrSRR0"), + REG_NAME ( 15, "SPU_RdSRR0"), + REG_NAME ( 28, "SPU_WrOutMbox"), + REG_NAME ( 29, "SPU_RdInMbox"), + REG_NAME ( 30, "SPU_WrOutIntrMbox"), + REG_NAME ( 9, "MFC_WrMSSyncReq"), + REG_NAME ( 12, "MFC_RdTagMask"), /* DD2.0 only */ + REG_NAME ( 16, "MFC_LSA"), + REG_NAME ( 17, "MFC_EAH"), + REG_NAME ( 18, "MFC_EAL"), + REG_NAME ( 19, "MFC_Size"), + REG_NAME ( 20, "MFC_TagID"), + REG_NAME ( 21, "MFC_Cmd"), + REG_NAME ( 22, "MFC_WrTagMask"), + REG_NAME ( 23, "MFC_WrTagUpdate"), + REG_NAME ( 24, "MFC_RdTagStat"), + REG_NAME ( 25, "MFC_RdListStallStat"), + REG_NAME ( 26, "MFC_WrListStallAck"), + REG_NAME ( 27, "MFC_RdAtomicStat"), +}; +#undef REG_NAME + +static const char * +get_reg (const char *param, struct spu_insn *insn, int arg, int accept_expr) +{ + unsigned regno; + int saw_prefix = 0; + + if (*param == '$') + { + saw_prefix = 1; + param++; + } + + if (arg == A_H) /* Channel */ + { + if ((param[0] == 'c' || param[0] == 'C') + && (param[1] == 'h' || param[1] == 'H') + && ISDIGIT (param[2])) + param += 2; + } + else if (arg == A_S) /* Special purpose register */ + { + if ((param[0] == 's' || param[0] == 'S') + && (param[1] == 'p' || param[1] == 'P') + && ISDIGIT (param[2])) + param += 2; + } + + if (ISDIGIT (*param)) + { + regno = 0; + while (ISDIGIT (*param)) + regno = regno * 10 + *param++ - '0'; + } + else + { + struct reg_name *rn; + unsigned int i, n, l = 0; + + if (arg == A_H) /* Channel */ + { + rn = ch_reg_name; + n = sizeof (ch_reg_name) / sizeof (*ch_reg_name); + } + else if (arg == A_S) /* Special purpose register */ + { + rn = sp_reg_name; + n = sizeof (sp_reg_name) / sizeof (*sp_reg_name); + } + else + { + rn = reg_name; + n = sizeof (reg_name) / sizeof (*reg_name); + } + regno = 128; + for (i = 0; i < n; i++) + if (rn[i].length > l + && 0 == strncasecmp (param, rn[i].name, rn[i].length)) + { + l = rn[i].length; + regno = rn[i].regno; + } + param += l; + } + + if (!use_dd2 + && arg == A_H) + { + if (regno == 11) + as_bad (_("'SPU_RdEventMask' (channel 11) is only available in DD2.0 or higher.")); + else if (regno == 12) + as_bad (_("'MFC_RdTagMask' (channel 12) is only available in DD2.0 or higher.")); + } + + if (regno < 128) + { + insn->opcode |= regno << arg_encode[arg].pos; + if ((!saw_prefix && syntax_reg == 1) + || (saw_prefix && syntax_reg == 2)) + syntax_reg |= 4; + syntax_reg |= saw_prefix ? 1 : 2; + return param; + } + + if (accept_expr) + { + char *save_ptr; + expressionS ex; + save_ptr = input_line_pointer; + input_line_pointer = (char *)param; + expression (&ex); + param = input_line_pointer; + input_line_pointer = save_ptr; + if (ex.X_op == O_register || ex.X_op == O_constant) + { + insn->opcode |= ex.X_add_number << arg_encode[arg].pos; + return param; + } + } + return 0; +} + +static const char * +get_imm (const char *param, struct spu_insn *insn, int arg) +{ + int val; + char *save_ptr; + int low = 0, high = 0; + int reloc_i = insn->reloc_arg[0] >= 0 ? 1 : 0; + + if (strncasecmp (param, "%lo(", 4) == 0) + { + param += 3; + low = 1; + as_warn (_("Using old style, %%lo(expr), please change to PPC style, expr@l.")); + } + else if (strncasecmp (param, "%hi(", 4) == 0) + { + param += 3; + high = 1; + as_warn (_("Using old style, %%hi(expr), please change to PPC style, expr@h.")); + } + else if (strncasecmp (param, "%pic(", 5) == 0) + { + /* Currently we expect %pic(expr) == expr, so do nothing here. + i.e. for code loaded at address 0 $toc will be 0. */ + param += 4; + } + + if (*param == '$') + { + /* Symbols can start with $, but if this symbol matches a register + name, it's probably a mistake. The only way to avoid this + warning is to rename the symbol. */ + struct spu_insn tmp_insn; + const char *np = get_reg (param, &tmp_insn, arg, 0); + + if (np) + syntax_error_param = np; + } + + save_ptr = input_line_pointer; + input_line_pointer = (char *) param; + expression (&insn->exp[reloc_i]); + param = input_line_pointer; + input_line_pointer = save_ptr; + + /* Similar to ppc_elf_suffix in tc-ppc.c. We have so few cases to + handle we do it inlined here. */ + if (param[0] == '@' && !ISALNUM (param[2]) && param[2] != '@') + { + if (param[1] == 'h' || param[1] == 'H') + { + high = 1; + param += 2; + } + else if (param[1] == 'l' || param[1] == 'L') + { + low = 1; + param += 2; + } + } + + if (insn->exp[reloc_i].X_op == O_constant) + { + val = insn->exp[reloc_i].X_add_number; + + if (emulate_apuasm) + { + /* Convert the value to a format we expect. */ + val <<= arg_encode[arg].rshift; + if (arg == A_U7A) + val = 173 - val; + else if (arg == A_U7B) + val = 155 - val; + } + + if (high) + val = val >> 16; + else if (low) + val = val & 0xffff; + + /* Warn about out of range expressions. */ + { + int hi = arg_encode[arg].hi; + int lo = arg_encode[arg].lo; + int whi = arg_encode[arg].whi; + int wlo = arg_encode[arg].wlo; + + if (hi > lo && (val < lo || val > hi)) + as_fatal (_("Constant expression %d out of range, [%d, %d]."), + val, lo, hi); + else if (whi > wlo && (val < wlo || val > whi)) + as_warn (_("Constant expression %d out of range, [%d, %d]."), + val, wlo, whi); + } + + if (arg == A_U7A) + val = 173 - val; + else if (arg == A_U7B) + val = 155 - val; + + /* Branch hints have a split encoding. Do the bottom part. */ + if (arg == A_S11 || arg == A_S11I) + insn->opcode |= ((val >> 2) & 0x7f); + + insn->opcode |= (((val >> arg_encode[arg].rshift) + & ((1 << arg_encode[arg].size) - 1)) + << arg_encode[arg].pos); + insn->reloc_arg[reloc_i] = -1; + insn->flag[reloc_i] = 0; + } + else + { + insn->reloc_arg[reloc_i] = arg; + if (high) + insn->flag[reloc_i] = 1; + else if (low) + insn->flag[reloc_i] = 2; + } + + return param; +} + +#define MAX_LITTLENUMS 6 + +/* Turn a string in input_line_pointer into a floating point constant of type + type, and store the appropriate bytes in *litP. The number of LITTLENUMS + emitted is stored in *sizeP . An error message is returned, or NULL on OK. + */ +char * +md_atof (int type, char *litP, int *sizeP) +{ + int prec; + LITTLENUM_TYPE words[MAX_LITTLENUMS]; + LITTLENUM_TYPE *wordP; + char *t; + + switch (type) + { + case 'f': + case 'F': + case 's': + case 'S': + prec = 2; + break; + + case 'd': + case 'D': + case 'r': + case 'R': + prec = 4; + break; + + case 'x': + case 'X': + prec = 6; + break; + + case 'p': + case 'P': + prec = 6; + break; + + default: + *sizeP = 0; + return _("Bad call to MD_ATOF()"); + } + t = atof_ieee (input_line_pointer, type, words); + if (t) + input_line_pointer = t; + + *sizeP = prec * sizeof (LITTLENUM_TYPE); + for (wordP = words; prec--;) + { + md_number_to_chars (litP, (long) (*wordP++), sizeof (LITTLENUM_TYPE)); + litP += sizeof (LITTLENUM_TYPE); + } + return 0; +} + +#ifndef WORKING_DOT_WORD +int md_short_jump_size = 4; + +void +md_create_short_jump (char *ptr, + addressT from_addr ATTRIBUTE_UNUSED, + addressT to_addr ATTRIBUTE_UNUSED, + fragS *frag, + symbolS *to_symbol) +{ + ptr[0] = (char) 0xc0; + ptr[1] = 0x00; + ptr[2] = 0x00; + ptr[3] = 0x00; + fix_new (frag, + ptr - frag->fr_literal, + 4, + to_symbol, + (offsetT) 0, + 0, + BFD_RELOC_SPU_PCREL16); +} + +int md_long_jump_size = 4; + +void +md_create_long_jump (char *ptr, + addressT from_addr ATTRIBUTE_UNUSED, + addressT to_addr ATTRIBUTE_UNUSED, + fragS *frag, + symbolS *to_symbol) +{ + ptr[0] = (char) 0xc0; + ptr[1] = 0x00; + ptr[2] = 0x00; + ptr[3] = 0x00; + fix_new (frag, + ptr - frag->fr_literal, + 4, + to_symbol, + (offsetT) 0, + 0, + BFD_RELOC_SPU_PCREL16); +} +#endif + +/* Support @ppu on symbols referenced in .int/.long/.word/.quad. */ +static void +spu_cons (int nbytes) +{ + expressionS exp; + + if (is_it_end_of_statement ()) + { + demand_empty_rest_of_line (); + return; + } + + do + { + deferred_expression (&exp); + if ((exp.X_op == O_symbol + || exp.X_op == O_constant) + && strncasecmp (input_line_pointer, "@ppu", 4) == 0) + { + char *p = frag_more (nbytes); + enum bfd_reloc_code_real reloc; + + /* Check for identifier@suffix+constant. */ + input_line_pointer += 4; + if (*input_line_pointer == '-' || *input_line_pointer == '+') + { + expressionS new_exp; + + expression (&new_exp); + if (new_exp.X_op == O_constant) + exp.X_add_number += new_exp.X_add_number; + } + + reloc = nbytes == 4 ? BFD_RELOC_SPU_PPU32 : BFD_RELOC_SPU_PPU64; + fix_new_exp (frag_now, p - frag_now->fr_literal, nbytes, + &exp, 0, reloc); + } + else + emit_expr (&exp, nbytes); + } + while (*input_line_pointer++ == ','); + + /* Put terminator back into stream. */ + input_line_pointer--; + demand_empty_rest_of_line (); +} + +int +md_estimate_size_before_relax (fragS *fragP ATTRIBUTE_UNUSED, + segT segment_type ATTRIBUTE_UNUSED) +{ + as_fatal (_("Relaxation should never occur")); + return -1; +} + +/* If while processing a fixup, a reloc really needs to be created, + then it is done here. */ + +arelent * +tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp) +{ + arelent *reloc; + reloc = (arelent *) xmalloc (sizeof (arelent)); + reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + if (fixp->fx_addsy) + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); + else if (fixp->fx_subsy) + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_subsy); + else + abort (); + reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; + reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type); + if (reloc->howto == (reloc_howto_type *) NULL) + { + as_bad_where (fixp->fx_file, fixp->fx_line, + _("reloc %d not supported by object file format"), + (int) fixp->fx_r_type); + return NULL; + } + reloc->addend = fixp->fx_addnumber; + return reloc; +} + +/* Round up a section's size to the appropriate boundary. */ + +valueT +md_section_align (segT seg, valueT size) +{ + int align = bfd_get_section_alignment (stdoutput, seg); + valueT mask = ((valueT) 1 << align) - 1; + + return (size + mask) & ~mask; +} + +/* Where a PC relative offset is calculated from. On the spu they + are calculated from the beginning of the branch instruction. */ + +long +md_pcrel_from (fixS *fixp) +{ + return fixp->fx_frag->fr_address + fixp->fx_where; +} + +/* Fill in rs_align_code fragments. */ + +void +spu_handle_align (fragS *fragp) +{ + static const unsigned char nop_pattern[8] = { + 0x40, 0x20, 0x00, 0x00, /* even nop */ + 0x00, 0x20, 0x00, 0x00, /* odd nop */ + }; + + int bytes; + char *p; + + if (fragp->fr_type != rs_align_code) + return; + + bytes = fragp->fr_next->fr_address - fragp->fr_address - fragp->fr_fix; + p = fragp->fr_literal + fragp->fr_fix; + + if (bytes & 3) + { + int fix = bytes & 3; + memset (p, 0, fix); + p += fix; + bytes -= fix; + fragp->fr_fix += fix; + } + if (bytes & 4) + { + memcpy (p, &nop_pattern[4], 4); + p += 4; + bytes -= 4; + fragp->fr_fix += 4; + } + + memcpy (p, nop_pattern, 8); + fragp->fr_var = 8; +} + +void +md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) +{ + unsigned int res; + valueT val = *valP; + char *place = fixP->fx_where + fixP->fx_frag->fr_literal; + + if (fixP->fx_subsy != (symbolS *) NULL) + { + /* We can't actually support subtracting a symbol. */ + as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex")); + } + + if (fixP->fx_addsy != NULL) + { + if (fixP->fx_pcrel) + { + /* Hack around bfd_install_relocation brain damage. */ + val += fixP->fx_frag->fr_address + fixP->fx_where; + + switch (fixP->fx_r_type) + { + case BFD_RELOC_32: + fixP->fx_r_type = BFD_RELOC_32_PCREL; + break; + + case BFD_RELOC_SPU_PCREL16: + case BFD_RELOC_SPU_PCREL9a: + case BFD_RELOC_SPU_PCREL9b: + case BFD_RELOC_32_PCREL: + break; + + default: + as_bad_where (fixP->fx_file, fixP->fx_line, + _("expression too complex")); + break; + } + } + } + + fixP->fx_addnumber = val; + + if (fixP->fx_r_type == BFD_RELOC_SPU_PPU32 + || fixP->fx_r_type == BFD_RELOC_SPU_PPU64) + return; + + if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0) + { + fixP->fx_done = 1; + res = 0; + if (fixP->tc_fix_data.arg_format > A_P) + { + int hi = arg_encode[fixP->tc_fix_data.arg_format].hi; + int lo = arg_encode[fixP->tc_fix_data.arg_format].lo; + if (hi > lo && ((offsetT) val < lo || (offsetT) val > hi)) + as_bad_where (fixP->fx_file, fixP->fx_line, + "Relocation doesn't fit. (relocation value = 0x%lx)", + (long) val); + } + + switch (fixP->fx_r_type) + { + case BFD_RELOC_8: + md_number_to_chars (place, val, 1); + return; + + case BFD_RELOC_16: + md_number_to_chars (place, val, 2); + return; + + case BFD_RELOC_32: + md_number_to_chars (place, val, 4); + return; + + case BFD_RELOC_64: + md_number_to_chars (place, val, 8); + return; + + case BFD_RELOC_SPU_IMM7: + res = (val & 0x7f) << 14; + break; + + case BFD_RELOC_SPU_IMM8: + res = (val & 0xff) << 14; + break; + + case BFD_RELOC_SPU_IMM10: + res = (val & 0x3ff) << 14; + break; + + case BFD_RELOC_SPU_IMM10W: + res = (val & 0x3ff0) << 10; + break; + + case BFD_RELOC_SPU_IMM16: + res = (val & 0xffff) << 7; + break; + + case BFD_RELOC_SPU_IMM16W: + res = (val & 0x3fffc) << 5; + break; + + case BFD_RELOC_SPU_IMM18: + res = (val & 0x3ffff) << 7; + break; + + case BFD_RELOC_SPU_PCREL9a: + res = ((val & 0x1fc) >> 2) | ((val & 0x600) << 14); + break; + + case BFD_RELOC_SPU_PCREL9b: + res = ((val & 0x1fc) >> 2) | ((val & 0x600) << 5); + break; + + case BFD_RELOC_SPU_PCREL16: + res = (val & 0x3fffc) << 5; + break; + + default: + as_bad_where (fixP->fx_file, fixP->fx_line, + _("reloc %d not supported by object file format"), + (int) fixP->fx_r_type); + } + + if (res != 0) + { + place[0] |= (res >> 24) & 0xff; + place[1] |= (res >> 16) & 0xff; + place[2] |= (res >> 8) & 0xff; + place[3] |= (res) & 0xff; + } + } +} diff --git a/gas/config/tc-spu.h b/gas/config/tc-spu.h new file mode 100644 index 00000000000..4c6c2d4566e --- /dev/null +++ b/gas/config/tc-spu.h @@ -0,0 +1,107 @@ +/* spu.h -- Assembler for spu + + Copyright 2006, 2007 Free Software Foundation, Inc. + + This file is part of GAS, the GNU Assembler. + + GAS 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 2, or (at your option) + any later version. + + GAS 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 GAS; see the file COPYING. If not, write to the Free + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ + +#ifndef TC_SPU +#define TC_SPU 1 + +#include "opcode/spu.h" + +#define TARGET_FORMAT "elf32-spu" +#define TARGET_ARCH bfd_arch_spu +#define TARGET_NAME "elf32-spu" + +#define TARGET_BYTES_BIG_ENDIAN 1 + +struct tc_fix_info { + unsigned short arg_format; + unsigned short insn_tag; +}; + +/* fixS will have a member named tc_fix_data of this type. */ +#define TC_FIX_TYPE struct tc_fix_info +#define TC_INIT_FIX_DATA(FIXP) \ + do \ + { \ + (FIXP)->tc_fix_data.arg_format = 0; \ + (FIXP)->tc_fix_data.insn_tag = 0; \ + } \ + while (0) + +/* Don't reduce function symbols to section symbols, and don't adjust + references to PPU symbols. */ +#define tc_fix_adjustable(FIXP) \ + (!(S_IS_FUNCTION ((FIXP)->fx_addsy) \ + || (FIXP)->fx_r_type == BFD_RELOC_SPU_PPU32 \ + || (FIXP)->fx_r_type == BFD_RELOC_SPU_PPU64)) + +/* Keep relocs on calls. Branches to function symbols are tail or + sibling calls. */ +#define TC_FORCE_RELOCATION(FIXP) \ + ((FIXP)->tc_fix_data.insn_tag == M_BRSL \ + || (FIXP)->tc_fix_data.insn_tag == M_BRASL \ + || (((FIXP)->tc_fix_data.insn_tag == M_BR \ + || (FIXP)->tc_fix_data.insn_tag == M_BRA) \ + && (FIXP)->fx_addsy != NULL \ + && S_IS_FUNCTION ((FIXP)->fx_addsy)) \ + || (FIXP)->fx_r_type == BFD_RELOC_SPU_PPU32 \ + || (FIXP)->fx_r_type == BFD_RELOC_SPU_PPU64 \ + || generic_force_reloc (FIXP)) + +/* Values passed to md_apply_fix don't include symbol values. */ +#define MD_APPLY_SYM_VALUE(FIX) 0 + +/* The spu uses pseudo-ops with no leading period. */ +#define NO_PSEUDO_DOT 1 + +/* Don't warn on word overflow; it happens on %hi relocs. */ +#undef WARN_SIGNED_OVERFLOW_WORD + +#define DIFF_EXPR_OK + +#define WORKING_DOT_WORD + +#define md_number_to_chars number_to_chars_bigendian + +#define md_convert_frag(b,s,f) {as_fatal (_("spu convert_frag\n"));} + +/* We don't need to do anything special for undefined symbols. */ +#define md_undefined_symbol(s) 0 + +extern symbolS *section_symbol (asection *); +#define md_operand(e) \ + do { \ + if (strncasecmp (input_line_pointer, "@ppu", 4) == 0) \ + { \ + e->X_op = O_symbol; \ + if (abs_section_sym == NULL) \ + abs_section_sym = section_symbol (absolute_section); \ + e->X_add_symbol = abs_section_sym; \ + e->X_add_number = 0; \ + } \ + } while (0) + +/* Fill in rs_align_code fragments. */ +extern void spu_handle_align PARAMS ((fragS *)); +#define HANDLE_ALIGN(frag) spu_handle_align (frag) + +#define MAX_MEM_FOR_RS_ALIGN_CODE (7 + 8) + +#endif /* TC_SPU */ diff --git a/gas/config/tc-tic30.c b/gas/config/tc-tic30.c index b4acccc59bf..e6ffbb8226d 100644 --- a/gas/config/tc-tic30.c +++ b/gas/config/tc-tic30.c @@ -1,5 +1,5 @@ /* tc-c30.c -- Assembly code for the Texas Instruments TMS320C30 - Copyright 1998, 1999, 2000, 2001, 2002, 2003 + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2006 Free Software Foundation, Inc. Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au) @@ -28,7 +28,6 @@ #include "as.h" #include "safe-ctype.h" #include "opcode/tic30.h" -#include /* Put here all non-digit non-letter characters that may occur in an operand. */ @@ -273,15 +272,17 @@ struct tic30_insn struct tic30_insn insn; static int found_parallel_insn; -static char output_invalid_buf[8]; +static char output_invalid_buf[sizeof (unsigned char) * 2 + 6]; static char * output_invalid (char c) { if (ISPRINT (c)) - sprintf (output_invalid_buf, "'%c'", c); + snprintf (output_invalid_buf, sizeof (output_invalid_buf), + "'%c'", c); else - sprintf (output_invalid_buf, "(0x%x)", (unsigned) c); + snprintf (output_invalid_buf, sizeof (output_invalid_buf), + "(0x%x)", (unsigned char) c); return output_invalid_buf; } diff --git a/gas/config/tc-tic4x.c b/gas/config/tc-tic4x.c index 8707180c132..a92d6a6d22a 100644 --- a/gas/config/tc-tic4x.c +++ b/gas/config/tc-tic4x.c @@ -1,5 +1,5 @@ /* tc-tic4x.c -- Assemble for the Texas Instruments TMS320C[34]x. - Copyright (C) 1997,1998, 2002, 2003, 2005 Free Software Foundation. + Copyright (C) 1997,1998, 2002, 2003, 2005, 2006 Free Software Foundation. Contributed by Michael P. Hayes (m.hayes@elec.canterbury.ac.nz) @@ -45,14 +45,11 @@ o Support 'abc' constants (that is 0x616263) */ -#include #include "safe-ctype.h" #include "as.h" #include "opcode/tic4x.h" #include "subsegs.h" #include "obstack.h" -#include "symbols.h" -#include "listing.h" /* OK, we accept a syntax similar to the other well known C30 assembly tools. With TIC4X_ALT_SYNTAX defined we are more @@ -2640,7 +2637,7 @@ md_assemble (str) if ((i = tic4x_operands_parse (s, insn->operands, 0)) < 0) { - insn->inst = NULL; /* Flag that error occured. */ + insn->inst = NULL; /* Flag that error occurred. */ insn->parallel = 0; insn->in_use = 0; return; diff --git a/gas/config/tc-tic54x.c b/gas/config/tc-tic54x.c index f84afcd838e..412473b98e1 100644 --- a/gas/config/tc-tic54x.c +++ b/gas/config/tc-tic54x.c @@ -45,9 +45,7 @@ COFF1 limits section names to 8 characters. Some of the default behavior changed from COFF1 to COFF2. */ -#include #include -#include #include "as.h" #include "safe-ctype.h" #include "sb.h" @@ -2514,8 +2512,8 @@ tic54x_mlib (ignore) abfd = bfd_openr (path, NULL); if (!abfd) { - as_bad (_("Can't open macro library file '%s' for reading."), path); - as_perror ("%s", path); + as_bad (_("can't open macro library file '%s' for reading: %s"), + path, bfd_errmsg (bfd_get_error ())); ignore_rest_of_line (); return; } diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c index 79849561601..dc98bd5a1f5 100644 --- a/gas/config/tc-v850.c +++ b/gas/config/tc-v850.c @@ -19,7 +19,6 @@ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "as.h" #include "safe-ctype.h" #include "subsegs.h" diff --git a/gas/config/tc-vax.c b/gas/config/tc-vax.c index b0ac3f745f3..93cacd6e69b 100644 --- a/gas/config/tc-vax.c +++ b/gas/config/tc-vax.c @@ -2035,8 +2035,6 @@ main (void) We declare arrays non-local in case some of our tiny-minded machines default to small stacks. Also, helps with some debuggers. */ -#include - char answer[100]; /* Human types into here. */ char *p; /* */ char *myerr; @@ -3267,3 +3265,143 @@ md_begin (void) fP->high = &big_operand_bits[i][SIZE_OF_LARGE_NUMBER - 1]; } } + +static char *vax_cons_special_reloc; + +void +vax_cons (expressionS *exp, int size) +{ + char *save; + + SKIP_WHITESPACE (); + vax_cons_special_reloc = NULL; + save = input_line_pointer; + if (input_line_pointer[0] == '%') + { + if (strncmp (input_line_pointer + 1, "pcrel", 5) == 0) + { + input_line_pointer += 6; + vax_cons_special_reloc = "pcrel"; + } + if (vax_cons_special_reloc) + { + int bad = 0; + + switch (size) + { + case 1: + if (*input_line_pointer != '8') + bad = 1; + input_line_pointer--; + break; + case 2: + if (input_line_pointer[0] != '1' || input_line_pointer[1] != '6') + bad = 1; + break; + case 4: + if (input_line_pointer[0] != '3' || input_line_pointer[1] != '2') + bad = 1; + break; + default: + bad = 1; + break; + } + + if (bad) + { + as_bad (_("Illegal operands: Only %%r_%s%d allowed in %d-byte data fields"), + vax_cons_special_reloc, size * 8, size); + } + else + { + input_line_pointer += 2; + if (*input_line_pointer != '(') + { + as_bad (_("Illegal operands: %%r_%s%d requires arguments in ()"), + vax_cons_special_reloc, size * 8); + bad = 1; + } + } + + if (bad) + { + input_line_pointer = save; + vax_cons_special_reloc = NULL; + } + else + { + int c; + char *end = ++input_line_pointer; + int npar = 0; + + while (! is_end_of_line[(c = *end)]) + { + if (c == '(') + npar++; + else if (c == ')') + { + if (!npar) + break; + npar--; + } + end++; + } + + if (c != ')') + as_bad (_("Illegal operands: %%r_%s%d requires arguments in ()"), + vax_cons_special_reloc, size * 8); + else + { + *end = '\0'; + expression (exp); + *end = c; + if (input_line_pointer != end) + { + as_bad (_("Illegal operands: %%r_%s%d requires arguments in ()"), + vax_cons_special_reloc, size * 8); + } + else + { + input_line_pointer++; + SKIP_WHITESPACE (); + c = *input_line_pointer; + if (! is_end_of_line[c] && c != ',') + as_bad (_("Illegal operands: garbage after %%r_%s%d()"), + vax_cons_special_reloc, size * 8); + } + } + } + } + } + if (vax_cons_special_reloc == NULL) + expression (exp); +} + +/* This is called by emit_expr via TC_CONS_FIX_NEW when creating a + reloc for a cons. */ + +void +vax_cons_fix_new (fragS *frag, int where, unsigned int nbytes, expressionS *exp) +{ + bfd_reloc_code_real_type r; + + r = (nbytes == 1 ? BFD_RELOC_8 : + (nbytes == 2 ? BFD_RELOC_16 : BFD_RELOC_32)); + + if (vax_cons_special_reloc) + { + if (*vax_cons_special_reloc == 'p') + { + switch (nbytes) + { + case 1: r = BFD_RELOC_8_PCREL; break; + case 2: r = BFD_RELOC_16_PCREL; break; + case 4: r = BFD_RELOC_32_PCREL; break; + default: abort (); + } + } + } + + fix_new_exp (frag, where, (int) nbytes, exp, 0, r); + vax_cons_special_reloc = NULL; +} diff --git a/gas/config/tc-vax.h b/gas/config/tc-vax.h index 715d54a812f..4f16e5837d3 100644 --- a/gas/config/tc-vax.h +++ b/gas/config/tc-vax.h @@ -47,6 +47,13 @@ #define md_operand(x) +#ifdef OBJ_ELF +#define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) vax_cons (EXP, NBYTES) +#define TC_CONS_FIX_NEW vax_cons_fix_new +void vax_cons (expressionS *, int); +void vax_cons_fix_new (struct frag *, int, unsigned int, struct expressionS *); +#endif + extern const struct relax_type md_relax_table[]; #define TC_GENERIC_RELAX_TABLE md_relax_table diff --git a/gas/config/tc-xc16x.c b/gas/config/tc-xc16x.c index 7a369b42ec2..2027dbdcaac 100644 --- a/gas/config/tc-xc16x.c +++ b/gas/config/tc-xc16x.c @@ -20,7 +20,6 @@ 02110-1301, USA. */ -#include #include "as.h" #include "safe-ctype.h" #include "subsegs.h" @@ -28,7 +27,6 @@ #include "opcodes/xc16x-desc.h" #include "opcodes/xc16x-opc.h" #include "cgen.h" -#include "bfd.h" #include "dwarf2dbg.h" diff --git a/gas/config/tc-xc16x.h b/gas/config/tc-xc16x.h index aa510d8e1a5..8aa6d07785f 100644 --- a/gas/config/tc-xc16x.h +++ b/gas/config/tc-xc16x.h @@ -25,11 +25,6 @@ #define TARGET_ARCH bfd_arch_xc16x -#ifdef BFD_ASSEMBLER -/* Fixup debug sections since we will never relax them. */ -#define TC_LINKRELAX_FIXUP(seg) (seg->flags & SEC_ALLOC) -#endif - #ifdef OBJ_ELF #define TARGET_FORMAT "elf32-xc16x" #define LOCAL_LABEL_PREFIX '.' diff --git a/gas/config/tc-xstormy16.c b/gas/config/tc-xstormy16.c index 29e01994245..e2f4631a8ec 100644 --- a/gas/config/tc-xstormy16.c +++ b/gas/config/tc-xstormy16.c @@ -1,5 +1,6 @@ /* tc-xstormy16.c -- Assembler for the Sanyo XSTORMY16. - Copyright 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation. + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation. This file is part of GAS, the GNU Assembler. @@ -18,7 +19,6 @@ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "as.h" #include "subsegs.h" #include "symcat.h" diff --git a/gas/config/tc-xstormy16.h b/gas/config/tc-xstormy16.h index 542587452a4..727a4964e5c 100644 --- a/gas/config/tc-xstormy16.h +++ b/gas/config/tc-xstormy16.h @@ -63,3 +63,6 @@ extern void xstormy16_cons_fix_new (fragS *f, int, int, expressionS *); /* Minimum instruction is two bytes. */ #define DWARF2_LINE_MIN_INSN_LENGTH 2 + +/* This target is buggy, and sets fix size too large. */ +#define TC_FX_SIZE_SLACK(FIX) 2 diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index d7f059e6f5e..aef6b65e77b 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -1,5 +1,5 @@ /* tc-xtensa.c -- Assemble Xtensa instructions. - Copyright 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -18,13 +18,11 @@ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include #include "as.h" #include "sb.h" #include "safe-ctype.h" #include "tc-xtensa.h" -#include "frags.h" #include "subsegs.h" #include "xtensa-relax.h" #include "xtensa-istack.h" @@ -32,6 +30,11 @@ #include "struc-symbol.h" #include "xtensa-config.h" +/* Provide default values for new configuration settings. */ +#ifndef XSHAL_ABI +#define XSHAL_ABI 0 +#endif + #ifndef uint32 #define uint32 unsigned int #endif @@ -97,33 +100,32 @@ static bfd_boolean past_xtensa_end = FALSE; #define LITERAL_SECTION_NAME xtensa_section_rename (".literal") #define LIT4_SECTION_NAME xtensa_section_rename (".lit4") -#define FINI_SECTION_NAME xtensa_section_rename (".fini") #define INIT_SECTION_NAME xtensa_section_rename (".init") -#define FINI_LITERAL_SECTION_NAME xtensa_section_rename (".fini.literal") -#define INIT_LITERAL_SECTION_NAME xtensa_section_rename (".init.literal") +#define FINI_SECTION_NAME xtensa_section_rename (".fini") /* This type is used for the directive_stack to keep track of the - state of the literal collection pools. */ + state of the literal collection pools. If lit_prefix is set, it is + used to determine the literal section names; otherwise, the literal + sections are determined based on the current text section. The + lit_seg and lit4_seg fields cache these literal sections, with the + current_text_seg field used a tag to indicate whether the cached + values are valid. */ typedef struct lit_state_struct { - const char *lit_seg_name; - const char *lit4_seg_name; - const char *init_lit_seg_name; - const char *fini_lit_seg_name; + char *lit_prefix; + segT current_text_seg; segT lit_seg; segT lit4_seg; - segT init_lit_seg; - segT fini_lit_seg; } lit_state; static lit_state default_lit_sections; -/* We keep lists of literal segments. The seg_list type is the node - for such a list. The *_literal_head locals are the heads of the - various lists. All of these lists have a dummy node at the start. */ +/* We keep a list of literal segments. The seg_list type is the node + for this list. The literal_head pointer is the head of the list, + with the literal_head_h dummy node at the start. */ typedef struct seg_list_struct { @@ -133,10 +135,6 @@ typedef struct seg_list_struct static seg_list literal_head_h; static seg_list *literal_head = &literal_head_h; -static seg_list init_literal_head_h; -static seg_list *init_literal_head = &init_literal_head_h; -static seg_list fini_literal_head_h; -static seg_list *fini_literal_head = &fini_literal_head_h; /* Lists of symbols. We keep a list of symbols that label the current @@ -189,7 +187,9 @@ int generating_literals = 0; /* Instruction only properties about code. */ #define XTENSA_PROP_INSN_NO_DENSITY 0x00000040 #define XTENSA_PROP_INSN_NO_REORDER 0x00000080 -#define XTENSA_PROP_INSN_NO_TRANSFORM 0x00000100 +/* Historically, NO_TRANSFORM was a property of instructions, + but it should apply to literals under certain circumstances. */ +#define XTENSA_PROP_NO_TRANSFORM 0x00000100 /* Branch target alignment information. This transmits information to the linker optimization about the priority of aligning a @@ -265,6 +265,9 @@ struct frag_flags_struct unsigned is_data : 1; unsigned is_unreachable : 1; + /* is_specific_opcode implies no_transform. */ + unsigned is_no_transform : 1; + struct { unsigned is_loop_target : 1; @@ -273,8 +276,6 @@ struct frag_flags_struct unsigned is_no_density : 1; /* no_longcalls flag does not need to be placed in the object file. */ - /* is_specific_opcode implies no_transform. */ - unsigned is_no_transform : 1; unsigned is_no_reorder : 1; @@ -354,6 +355,24 @@ op_placement_info_table op_placement_table; #define O_hi16 O_md2 /* use high 16 bits of symbolic value */ #define O_lo16 O_md3 /* use low 16 bits of symbolic value */ +struct suffix_reloc_map +{ + char *suffix; + int length; + bfd_reloc_code_real_type reloc; + unsigned char operator; +}; + +#define SUFFIX_MAP(str, reloc, op) { str, sizeof (str) - 1, reloc, op } + +static struct suffix_reloc_map suffix_relocs[] = +{ + SUFFIX_MAP ("l", BFD_RELOC_LO16, O_lo16), + SUFFIX_MAP ("h", BFD_RELOC_HI16, O_hi16), + SUFFIX_MAP ("plt", BFD_RELOC_XTENSA_PLT, O_pltrel), + { (char *) 0, 0, BFD_RELOC_UNUSED, 0 } +}; + /* Directives. */ @@ -403,7 +422,7 @@ bfd_boolean directive_state[] = FALSE, /* freeregs */ FALSE, /* longcalls */ FALSE, /* literal_prefix */ - TRUE, /* schedule */ + FALSE, /* schedule */ #if XSHAL_USE_ABSOLUTE_LITERALS TRUE /* absolute_literals */ #else @@ -416,7 +435,7 @@ bfd_boolean directive_state[] = static void xtensa_begin_directive (int); static void xtensa_end_directive (int); -static void xtensa_literal_prefix (char const *, int); +static void xtensa_literal_prefix (void); static void xtensa_literal_position (int); static void xtensa_literal_pseudo (int); static void xtensa_frequency_pseudo (int); @@ -465,12 +484,11 @@ static void xtensa_switch_to_literal_fragment (emit_state *); static void xtensa_switch_to_non_abs_literal_fragment (emit_state *); static void xtensa_switch_section_emit_state (emit_state *, segT, subsegT); static void xtensa_restore_emit_state (emit_state *); -static void cache_literal_section - (seg_list *, const char *, segT *, bfd_boolean); +static segT cache_literal_section (bfd_boolean); /* Import from elf32-xtensa.c in BFD library. */ -extern char *xtensa_get_property_section_name (asection *, const char *); +extern asection *xtensa_get_property_section (asection *, const char *); /* op_placement_info functions. */ @@ -944,43 +962,16 @@ xtensa_clear_insn_labels (void) } -/* The "loops_ok" argument is provided to allow ignoring labels that - define loop ends. This fixes a bug where the NOPs to align a - loop opcode were included in a previous zero-cost loop: - - loop a0, loopend - - loopend: - - loop a2, loopend2 - - - would become: - - loop a0, loopend - - nop.n <===== bad! - loopend: - - loop a2, loopend2 - - - This argument is used to prevent moving the NOP to before the - loop-end label, which is what you want in this special case. */ - static void -xtensa_move_labels (fragS *new_frag, valueT new_offset, bfd_boolean loops_ok) +xtensa_move_labels (fragS *new_frag, valueT new_offset) { sym_list *lit; for (lit = insn_labels; lit; lit = lit->next) { symbolS *lit_sym = lit->sym; - if (loops_ok || ! symbol_get_tc (lit_sym)->is_loop_target) - { - S_SET_VALUE (lit_sym, new_offset); - symbol_set_frag (lit_sym, new_frag); - } + S_SET_VALUE (lit_sym, new_offset); + symbol_set_frag (lit_sym, new_frag); } } @@ -1175,7 +1166,6 @@ xtensa_begin_directive (int ignore ATTRIBUTE_UNUSED) directiveE directive; bfd_boolean negated; emit_state *state; - int len; lit_state *ls; get_directive (&directive, &negated); @@ -1222,20 +1212,10 @@ xtensa_begin_directive (int ignore ATTRIBUTE_UNUSED) assert (ls); *ls = default_lit_sections; - directive_push (directive_literal_prefix, negated, ls); - /* Parse the new prefix from the input_line_pointer. */ - SKIP_WHITESPACE (); - len = strspn (input_line_pointer, - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz_/0123456789.$"); - /* Process the new prefix. */ - xtensa_literal_prefix (input_line_pointer, len); - - /* Skip the name in the input line. */ - input_line_pointer += len; + xtensa_literal_prefix (); break; case directive_freeregs: @@ -1355,10 +1335,10 @@ xtensa_end_directive (int ignore ATTRIBUTE_UNUSED) /* Restore the default collection sections from saved state. */ s = (lit_state *) state; assert (s); - default_lit_sections = *s; - /* free the state storage */ + /* Free the state storage. */ + free (s->lit_prefix); free (s); break; @@ -1465,62 +1445,31 @@ xtensa_literal_pseudo (int ignored ATTRIBUTE_UNUSED) static void -xtensa_literal_prefix (char const *start, int len) +xtensa_literal_prefix (void) { - char *name, *linkonce_suffix; - char *newname, *newname4; - size_t linkonce_len; + char *name; + int len; + + /* Parse the new prefix from the input_line_pointer. */ + SKIP_WHITESPACE (); + len = strspn (input_line_pointer, + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz_/0123456789.$"); /* Get a null-terminated copy of the name. */ name = xmalloc (len + 1); assert (name); - - strncpy (name, start, len); + strncpy (name, input_line_pointer, len); name[len] = 0; - /* Allocate the sections (interesting note: the memory pointing to - the name is actually used for the name by the new section). */ + /* Skip the name in the input line. */ + input_line_pointer += len; - newname = xmalloc (len + strlen (".literal") + 1); - newname4 = xmalloc (len + strlen (".lit4") + 1); + default_lit_sections.lit_prefix = name; - linkonce_len = sizeof (".gnu.linkonce.") - 1; - if (strncmp (name, ".gnu.linkonce.", linkonce_len) == 0 - && (linkonce_suffix = strchr (name + linkonce_len, '.')) != 0) - { - strcpy (newname, ".gnu.linkonce.literal"); - strcpy (newname4, ".gnu.linkonce.lit4"); - - strcat (newname, linkonce_suffix); - strcat (newname4, linkonce_suffix); - } - else - { - int suffix_pos = len; - - /* If the section name ends with ".text", then replace that suffix - instead of appending an additional suffix. */ - if (len >= 5 && strcmp (name + len - 5, ".text") == 0) - suffix_pos -= 5; - - strcpy (newname, name); - strcpy (newname4, name); - - strcpy (newname + suffix_pos, ".literal"); - strcpy (newname4 + suffix_pos, ".lit4"); - } - - /* Note that cache_literal_section does not create a segment if - it already exists. */ + /* Clear cached literal sections, since the prefix has changed. */ default_lit_sections.lit_seg = NULL; default_lit_sections.lit4_seg = NULL; - - /* Canonicalizing section names allows renaming literal - sections to occur correctly. */ - default_lit_sections.lit_seg_name = tc_canonicalize_symbol_name (newname); - default_lit_sections.lit4_seg_name = tc_canonicalize_symbol_name (newname4); - - free (name); } @@ -1619,29 +1568,12 @@ xtensa_elf_cons (int nbytes) static bfd_reloc_code_real_type xtensa_elf_suffix (char **str_p, expressionS *exp_p) { - struct map_bfd - { - char *string; - int length; - bfd_reloc_code_real_type reloc; - }; - char ident[20]; char *str = *str_p; char *str2; int ch; int len; - struct map_bfd *ptr; - -#define MAP(str,reloc) { str, sizeof (str) - 1, reloc } - - static struct map_bfd mapping[] = - { - MAP ("l", BFD_RELOC_LO16), - MAP ("h", BFD_RELOC_HI16), - MAP ("plt", BFD_RELOC_XTENSA_PLT), - { (char *) 0, 0, BFD_RELOC_UNUSED } - }; + struct suffix_reloc_map *ptr; if (*str++ != '@') return BFD_RELOC_NONE; @@ -1658,10 +1590,10 @@ xtensa_elf_suffix (char **str_p, expressionS *exp_p) len = str2 - ident; ch = ident[0]; - for (ptr = &mapping[0]; ptr->length > 0; ptr++) - if (ch == ptr->string[0] + for (ptr = &suffix_relocs[0]; ptr->length > 0; ptr++) + if (ch == ptr->suffix[0] && len == ptr->length - && memcmp (ident, ptr->string, ptr->length) == 0) + && memcmp (ident, ptr->suffix, ptr->length) == 0) { /* Now check for "identifier@suffix+constant". */ if (*str == '-' || *str == '+') @@ -1689,6 +1621,49 @@ xtensa_elf_suffix (char **str_p, expressionS *exp_p) } +/* Find the matching operator type. */ +static unsigned char +map_suffix_reloc_to_operator (bfd_reloc_code_real_type reloc) +{ + struct suffix_reloc_map *sfx; + unsigned char operator = (unsigned char) -1; + + for (sfx = &suffix_relocs[0]; sfx->suffix; sfx++) + { + if (sfx->reloc == reloc) + { + operator = sfx->operator; + break; + } + } + assert (operator != (unsigned char) -1); + return operator; +} + + +/* Find the matching reloc type. */ +static bfd_reloc_code_real_type +map_operator_to_reloc (unsigned char operator) +{ + struct suffix_reloc_map *sfx; + bfd_reloc_code_real_type reloc = BFD_RELOC_UNUSED; + + for (sfx = &suffix_relocs[0]; sfx->suffix; sfx++) + { + if (sfx->operator == operator) + { + reloc = sfx->reloc; + break; + } + } + + if (reloc == BFD_RELOC_UNUSED) + return BFD_RELOC_32; + + return reloc; +} + + static const char * expression_end (const char *name) { @@ -1789,34 +1764,32 @@ expression_maybe_register (xtensa_opcode opc, int opnd, expressionS *tok) } if ((tok->X_op == O_constant || tok->X_op == O_symbol) - && (reloc = xtensa_elf_suffix (&input_line_pointer, tok)) - && (reloc != BFD_RELOC_NONE)) + && ((reloc = xtensa_elf_suffix (&input_line_pointer, tok)) + != BFD_RELOC_NONE)) { - switch (reloc) + if (reloc == BFD_RELOC_UNUSED) { - default: - case BFD_RELOC_UNUSED: - as_bad (_("unsupported relocation")); - break; - - case BFD_RELOC_XTENSA_PLT: - tok->X_op = O_pltrel; - break; - - case BFD_RELOC_LO16: - if (tok->X_op == O_constant) - tok->X_add_number &= 0xffff; - else - tok->X_op = O_lo16; - break; - - case BFD_RELOC_HI16: - if (tok->X_op == O_constant) - tok->X_add_number = ((unsigned) tok->X_add_number) >> 16; - else - tok->X_op = O_hi16; - break; + as_bad (_("unsupported relocation")); + return; } + + if (tok->X_op == O_constant) + { + switch (reloc) + { + case BFD_RELOC_LO16: + tok->X_add_number &= 0xffff; + return; + + case BFD_RELOC_HI16: + tok->X_add_number = ((unsigned) tok->X_add_number) >> 16; + return; + + default: + break; + } + } + tok->X_op = map_suffix_reloc_to_operator (reloc); } } else @@ -2340,9 +2313,6 @@ xg_translate_idioms (char **popname, int *pnum_args, char **arg_strings) char *opname = *popname; bfd_boolean has_underbar = FALSE; - if (cur_vinsn.inside_bundle) - return 0; - if (*opname == '_') { has_underbar = TRUE; @@ -2385,7 +2355,11 @@ xg_translate_idioms (char **popname, int *pnum_args, char **arg_strings) return 0; } - if (xtensa_nop_opcode == XTENSA_UNDEFINED + /* Don't do anything special with NOPs inside FLIX instructions. They + are handled elsewhere. Real NOP instructions are always available + in configurations with FLIX, so this should never be an issue but + check for it anyway. */ + if (!cur_vinsn.inside_bundle && xtensa_nop_opcode == XTENSA_UNDEFINED && strcmp (opname, "nop") == 0) { if (use_transform () && !has_underbar && density_supported) @@ -2589,7 +2563,7 @@ is_direct_call_opcode (xtensa_opcode opcode) xtensa_isa isa = xtensa_default_isa; int n, num_operands; - if (xtensa_opcode_is_call (isa, opcode) == 0) + if (xtensa_opcode_is_call (isa, opcode) != 1) return FALSE; num_operands = xtensa_opcode_num_operands (isa, opcode); @@ -3312,7 +3286,7 @@ xg_build_to_insn (TInsn *targ, TInsn *insn, BuildInstr *bi) BuildOp *op; symbolS *sym; - memset (targ, 0, sizeof (TInsn)); + tinsn_init (targ); targ->linenum = insn->linenum; switch (bi->typ) { @@ -3524,7 +3498,33 @@ xg_expand_to_stack (IStack *istack, TInsn *insn, int lateral_steps) /* Relax the assembly instruction at least "min_steps". - Return the number of steps taken. */ + Return the number of steps taken. + + For relaxation to correctly terminate, every relaxation chain must + terminate in one of two ways: + + 1. If the chain from one instruction to the next consists entirely of + single instructions, then the chain *must* handle all possible + immediates without failing. It must not ever fail because an + immediate is out of range. The MOVI.N -> MOVI -> L32R relaxation + chain is one example. L32R loads 32 bits, and there cannot be an + immediate larger than 32 bits, so it satisfies this condition. + Single instruction relaxation chains are as defined by + xg_is_single_relaxable_instruction. + + 2. Otherwise, the chain must end in a multi-instruction expansion: e.g., + BNEZ.N -> BNEZ -> BNEZ.W15 -> BENZ.N/J + + Strictly speaking, in most cases you can violate condition 1 and be OK + -- in particular when the last two instructions have the same single + size. But nevertheless, you should guarantee the above two conditions. + + We could fix this so that single-instruction expansions correctly + terminate when they can't handle the range, but the error messages are + worse, and it actually turns out that in every case but one (18-bit wide + branches), you need a multi-instruction expansion to get the full range + anyway. And because 18-bit branches are handled identically to 15-bit + branches, there isn't any point in changing it. */ static int xg_assembly_relax (IStack *istack, @@ -3537,12 +3537,9 @@ xg_assembly_relax (IStack *istack, { int steps_taken = 0; - /* assert (has no symbolic operands) - Some of its immeds don't fit. - Try to build a relaxed version. - This may go through a couple of stages - of single instruction transformations before - we get there. */ + /* Some of its immeds don't fit. Try to build a relaxed version. + This may go through a couple of stages of single instruction + transformations before we get there. */ TInsn single_target; TInsn current_insn; @@ -3680,8 +3677,8 @@ is_branch_jmp_to_next (TInsn *insn, fragS *fragP) symbolS *sym; fragS *target_frag; - if (xtensa_opcode_is_branch (isa, insn->opcode) == 0 - && xtensa_opcode_is_jump (isa, insn->opcode) == 0) + if (xtensa_opcode_is_branch (isa, insn->opcode) != 1 + && xtensa_opcode_is_jump (isa, insn->opcode) != 1) return FALSE; for (i = 0; i < num_ops; i++) @@ -3861,7 +3858,7 @@ xg_expand_assembly_insn (IStack *istack, TInsn *orig_insn) TInsn new_insn; bfd_boolean do_expand; - memset (&new_insn, 0, sizeof (TInsn)); + tinsn_init (&new_insn); /* Narrow it if we can. xg_simplify_insn now does all the appropriate checking (e.g., for the density option). */ @@ -3923,7 +3920,9 @@ xg_expand_assembly_insn (IStack *istack, TInsn *orig_insn) /* Return TRUE if the section flags are marked linkonce - or the name is .gnu.linkonce*. */ + or the name is .gnu.linkonce.*. */ + +static int linkonce_len = sizeof (".gnu.linkonce.") - 1; static bfd_boolean get_is_linkonce_section (bfd *abfd ATTRIBUTE_UNUSED, segT sec) @@ -3934,13 +3933,10 @@ get_is_linkonce_section (bfd *abfd ATTRIBUTE_UNUSED, segT sec) link_once_flags = (flags & SEC_LINK_ONCE); /* Flags might not be set yet. */ - if (!link_once_flags) - { - static size_t len = sizeof ".gnu.linkonce.t."; + if (!link_once_flags + && strncmp (segment_name (sec), ".gnu.linkonce.", linkonce_len) == 0) + link_once_flags = SEC_LINK_ONCE; - if (strncmp (segment_name (sec), ".gnu.linkonce.t.", len - 1) == 0) - link_once_flags = SEC_LINK_ONCE; - } return (link_once_flags != 0); } @@ -3992,6 +3988,8 @@ xg_assemble_literal (/* const */ TInsn *insn) { emit_state state; symbolS *lit_sym = NULL; + bfd_reloc_code_real_type reloc; + char *p; /* size = 4 for L32R. It could easily be larger when we move to larger constants. Add a parameter later. */ @@ -4027,19 +4025,24 @@ xg_assemble_literal (/* const */ TInsn *insn) frag_align (litalign, 0, 0); record_alignment (now_seg, litalign); - if (emit_val->X_op == O_pltrel) + switch (emit_val->X_op) { - char *p = frag_more (litsize); + case O_pltrel: + p = frag_more (litsize); xtensa_set_frag_assembly_state (frag_now); + reloc = map_operator_to_reloc (emit_val->X_op); if (emit_val->X_add_symbol) emit_val->X_op = O_symbol; else emit_val->X_op = O_constant; fix_new_exp (frag_now, p - frag_now->fr_literal, - litsize, emit_val, 0, BFD_RELOC_XTENSA_PLT); + litsize, emit_val, 0, reloc); + break; + + default: + emit_expr (emit_val, litsize); + break; } - else - emit_expr (emit_val, litsize); assert (frag_now->tc_frag_data.literal_frag == NULL); frag_now->tc_frag_data.literal_frag = get_literal_pool_location (now_seg); @@ -4160,12 +4163,6 @@ xg_add_opcode_fix (TInsn *tinsn, the_fix = fix_new_exp (fragP, offset, fmt_length, expr, howto->pc_relative, reloc); the_fix->fx_no_overflow = 1; - - if (expr->X_add_symbol - && (S_IS_EXTERNAL (expr->X_add_symbol) - || S_IS_WEAK (expr->X_add_symbol))) - the_fix->fx_plt = TRUE; - the_fix->tc_fix_data.X_add_symbol = expr->X_add_symbol; the_fix->tc_fix_data.X_add_number = expr->X_add_number; the_fix->tc_fix_data.slot = slot; @@ -4410,7 +4407,8 @@ frag_format_size (const fragS *fragP) /* If an instruction is about to grow, return the longer size. */ if (fragP->tc_frag_data.slot_subtypes[0] == RELAX_IMMED_STEP1 - || fragP->tc_frag_data.slot_subtypes[0] == RELAX_IMMED_STEP2) + || fragP->tc_frag_data.slot_subtypes[0] == RELAX_IMMED_STEP2 + || fragP->tc_frag_data.slot_subtypes[0] == RELAX_IMMED_STEP3) return 3; if (fragP->tc_frag_data.slot_subtypes[0] == RELAX_NARROW) @@ -4567,16 +4565,14 @@ xtensa_mark_literal_pool_location (void) emit_state s; fragS *pool_location; - if (use_literal_section && !directive_state[directive_absolute_literals]) + if (use_literal_section) return; - frag_align (2, 0, 0); - record_alignment (now_seg, 2); - /* We stash info in these frags so we can later move the literal's fixes into this frchain's fix list. */ pool_location = frag_now; frag_now->tc_frag_data.lit_frchain = frchain_now; + frag_now->tc_frag_data.literal_frag = frag_now; frag_variant (rs_machine_dependent, 0, 0, RELAX_LITERAL_POOL_BEGIN, NULL, 0, NULL); xtensa_set_frag_assembly_state (frag_now); @@ -4721,6 +4717,55 @@ relaxable_section (asection *sec) } +static void +xtensa_mark_frags_for_org (void) +{ + segT *seclist; + + /* Walk over each fragment of all of the current segments. If we find + a .org frag in any of the segments, mark all frags prior to it as + "no transform", which will prevent linker optimizations from messing + up the .org distance. This should be done after + xtensa_find_unmarked_state_frags, because we don't want to worry here + about that function trashing the data we save here. */ + + for (seclist = &stdoutput->sections; + seclist && *seclist; + seclist = &(*seclist)->next) + { + segT sec = *seclist; + segment_info_type *seginfo; + fragS *fragP; + flagword flags; + flags = bfd_get_section_flags (stdoutput, sec); + if (flags & SEC_DEBUGGING) + continue; + if (!(flags & SEC_ALLOC)) + continue; + + seginfo = seg_info (sec); + if (seginfo && seginfo->frchainP) + { + fragS *last_fragP = seginfo->frchainP->frch_root; + for (fragP = seginfo->frchainP->frch_root; fragP; + fragP = fragP->fr_next) + { + /* cvt_frag_to_fill has changed the fr_type of org frags to + rs_fill, so use the value as cached in rs_subtype here. */ + if (fragP->fr_subtype == RELAX_ORG) + { + while (last_fragP != fragP->fr_next) + { + last_fragP->tc_frag_data.is_no_transform = TRUE; + last_fragP = last_fragP->fr_next; + } + } + } + } + } +} + + static void xtensa_find_unmarked_state_frags (void) { @@ -4948,12 +4993,8 @@ md_begin (void) linkrelax = 1; - /* Set up the .literal, .fini.literal and .init.literal sections. */ + /* Set up the literal sections. */ memset (&default_lit_sections, 0, sizeof (default_lit_sections)); - default_lit_sections.init_lit_seg_name = INIT_LITERAL_SECTION_NAME; - default_lit_sections.fini_lit_seg_name = FINI_LITERAL_SECTION_NAME; - default_lit_sections.lit_seg_name = LITERAL_SECTION_NAME; - default_lit_sections.lit4_seg_name = LIT4_SECTION_NAME; subseg_set (current_section, current_subsec); @@ -5044,7 +5085,7 @@ xtensa_frob_label (symbolS *sym) frag_now->fr_symbol, frag_now->fr_offset, NULL); xtensa_set_frag_assembly_state (frag_now); - xtensa_move_labels (frag_now, 0, TRUE); + xtensa_move_labels (frag_now, 0); } /* No target aligning in the absolute section. */ @@ -5060,7 +5101,7 @@ xtensa_frob_label (symbolS *sym) RELAX_DESIRE_ALIGN_IF_TARGET, frag_now->fr_symbol, frag_now->fr_offset, NULL); xtensa_set_frag_assembly_state (frag_now); - xtensa_move_labels (frag_now, 0, TRUE); + xtensa_move_labels (frag_now, 0); } /* We need to mark the following properties even if we aren't aligning. */ @@ -5129,6 +5170,15 @@ xtensa_unrecognized_line (int ch) void xtensa_flush_pending_output (void) { + /* This line fixes a bug where automatically generated gstabs info + separates a function label from its entry instruction, ending up + with the literal position between the function label and the entry + instruction and crashing code. It only happens with --gstabs and + --text-section-literals, and when several other obscure relaxation + conditions are met. */ + if (outputting_stabs_line_debug) + return; + if (cur_vinsn.inside_bundle) as_bad (_("missing closing brace")); @@ -5325,6 +5375,9 @@ xtensa_handle_align (fragS *fragP) as_bad_where (fragP->fr_file, fragP->fr_line, _("unaligned entry instruction")); } + + if (linkrelax && fragP->fr_type == rs_org) + fragP->fr_subtype = RELAX_ORG; } @@ -5619,7 +5672,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg) readable when all branch targets are encoded in relocations. */ assert (fixP->fx_addsy); - if (S_GET_SEGMENT (fixP->fx_addsy) == seg && !fixP->fx_plt + if (S_GET_SEGMENT (fixP->fx_addsy) == seg && !S_FORCE_RELOC (fixP->fx_addsy, 1)) { val = (S_GET_VALUE (fixP->fx_addsy) + fixP->fx_offset @@ -6743,15 +6796,13 @@ xg_assemble_vliw_tokens (vliw_insn *vinsn) frag_var (rs_machine_dependent, 0, 0, RELAX_CHECK_ALIGN_NEXT_OPCODE, target_sym, 0, NULL); xtensa_set_frag_assembly_state (frag_now); - - xtensa_move_labels (frag_now, 0, FALSE); } if (vinsn->slots[0].opcode == xtensa_entry_opcode && !vinsn->slots[0].is_specific_opcode) { xtensa_mark_literal_pool_location (); - xtensa_move_labels (frag_now, 0, TRUE); + xtensa_move_labels (frag_now, 0); frag_var (rs_align_test, 1, 1, 0, NULL, 2, NULL); } @@ -6831,7 +6882,7 @@ xg_assemble_vliw_tokens (vliw_insn *vinsn) when converting them. */ /* "short_loop": Add a NOP if the loop is < 4 bytes. */ - if (xtensa_opcode_is_loop (isa, vinsn->slots[0].opcode) + if (xtensa_opcode_is_loop (isa, vinsn->slots[0].opcode) == 1 && !vinsn->slots[0].is_specific_opcode) { if (workaround_short_loop && use_transform ()) @@ -6917,6 +6968,7 @@ static void xtensa_fix_b_j_loop_end_frags (void); static void xtensa_fix_close_loop_end_frags (void); static void xtensa_fix_short_loop_frags (void); static void xtensa_sanity_check (void); +static void xtensa_add_config_info (void); void xtensa_end (void) @@ -6947,6 +6999,8 @@ xtensa_end (void) xtensa_mark_zcl_first_insns (); xtensa_sanity_check (); + + xtensa_add_config_info (); } @@ -6954,44 +7008,46 @@ static void xtensa_cleanup_align_frags (void) { frchainS *frchP; + asection *s; - for (frchP = frchain_root; frchP; frchP = frchP->frch_next) - { - fragS *fragP; - /* Walk over all of the fragments in a subsection. */ - for (fragP = frchP->frch_root; fragP; fragP = fragP->fr_next) - { - if ((fragP->fr_type == rs_align - || fragP->fr_type == rs_align_code - || (fragP->fr_type == rs_machine_dependent - && (fragP->fr_subtype == RELAX_DESIRE_ALIGN - || fragP->fr_subtype == RELAX_DESIRE_ALIGN_IF_TARGET))) - && fragP->fr_fix == 0) - { - fragS *next = fragP->fr_next; + for (s = stdoutput->sections; s; s = s->next) + for (frchP = seg_info (s)->frchainP; frchP; frchP = frchP->frch_next) + { + fragS *fragP; + /* Walk over all of the fragments in a subsection. */ + for (fragP = frchP->frch_root; fragP; fragP = fragP->fr_next) + { + if ((fragP->fr_type == rs_align + || fragP->fr_type == rs_align_code + || (fragP->fr_type == rs_machine_dependent + && (fragP->fr_subtype == RELAX_DESIRE_ALIGN + || fragP->fr_subtype == RELAX_DESIRE_ALIGN_IF_TARGET))) + && fragP->fr_fix == 0) + { + fragS *next = fragP->fr_next; - while (next - && next->fr_fix == 0 - && next->fr_type == rs_machine_dependent - && next->fr_subtype == RELAX_DESIRE_ALIGN_IF_TARGET) - { - frag_wane (next); - next = next->fr_next; - } - } - /* If we don't widen branch targets, then they - will be easier to align. */ - if (fragP->tc_frag_data.is_branch_target - && fragP->fr_opcode == fragP->fr_literal - && fragP->fr_type == rs_machine_dependent - && fragP->fr_subtype == RELAX_SLOTS - && fragP->tc_frag_data.slot_subtypes[0] == RELAX_NARROW) - frag_wane (fragP); - if (fragP->fr_type == rs_machine_dependent - && fragP->fr_subtype == RELAX_UNREACHABLE) - fragP->tc_frag_data.is_unreachable = TRUE; - } - } + while (next + && next->fr_fix == 0 + && next->fr_type == rs_machine_dependent + && next->fr_subtype == RELAX_DESIRE_ALIGN_IF_TARGET) + { + frag_wane (next); + next = next->fr_next; + } + } + /* If we don't widen branch targets, then they + will be easier to align. */ + if (fragP->tc_frag_data.is_branch_target + && fragP->fr_opcode == fragP->fr_literal + && fragP->fr_type == rs_machine_dependent + && fragP->fr_subtype == RELAX_SLOTS + && fragP->tc_frag_data.slot_subtypes[0] == RELAX_NARROW) + frag_wane (fragP); + if (fragP->fr_type == rs_machine_dependent + && fragP->fr_subtype == RELAX_UNREACHABLE) + fragP->tc_frag_data.is_unreachable = TRUE; + } + } } @@ -7004,26 +7060,28 @@ static void xtensa_fix_target_frags (void) { frchainS *frchP; + asection *s; /* When this routine is called, all of the subsections are still intact so we walk over subsections instead of sections. */ - for (frchP = frchain_root; frchP; frchP = frchP->frch_next) - { - fragS *fragP; + for (s = stdoutput->sections; s; s = s->next) + for (frchP = seg_info (s)->frchainP; frchP; frchP = frchP->frch_next) + { + fragS *fragP; - /* Walk over all of the fragments in a subsection. */ - for (fragP = frchP->frch_root; fragP; fragP = fragP->fr_next) - { - if (fragP->fr_type == rs_machine_dependent - && fragP->fr_subtype == RELAX_DESIRE_ALIGN_IF_TARGET) - { - if (next_frag_is_branch_target (fragP)) - fragP->fr_subtype = RELAX_DESIRE_ALIGN; - else - frag_wane (fragP); - } - } - } + /* Walk over all of the fragments in a subsection. */ + for (fragP = frchP->frch_root; fragP; fragP = fragP->fr_next) + { + if (fragP->fr_type == rs_machine_dependent + && fragP->fr_subtype == RELAX_DESIRE_ALIGN_IF_TARGET) + { + if (next_frag_is_branch_target (fragP)) + fragP->fr_subtype = RELAX_DESIRE_ALIGN; + else + frag_wane (fragP); + } + } + } } @@ -7033,36 +7091,38 @@ static void xtensa_mark_narrow_branches (void) { frchainS *frchP; + asection *s; - for (frchP = frchain_root; frchP; frchP = frchP->frch_next) - { - fragS *fragP; - /* Walk over all of the fragments in a subsection. */ - for (fragP = frchP->frch_root; fragP; fragP = fragP->fr_next) - { - if (fragP->fr_type == rs_machine_dependent - && fragP->fr_subtype == RELAX_SLOTS - && fragP->tc_frag_data.slot_subtypes[0] == RELAX_IMMED) - { - vliw_insn vinsn; + for (s = stdoutput->sections; s; s = s->next) + for (frchP = seg_info (s)->frchainP; frchP; frchP = frchP->frch_next) + { + fragS *fragP; + /* Walk over all of the fragments in a subsection. */ + for (fragP = frchP->frch_root; fragP; fragP = fragP->fr_next) + { + if (fragP->fr_type == rs_machine_dependent + && fragP->fr_subtype == RELAX_SLOTS + && fragP->tc_frag_data.slot_subtypes[0] == RELAX_IMMED) + { + vliw_insn vinsn; - vinsn_from_chars (&vinsn, fragP->fr_opcode); - tinsn_immed_from_frag (&vinsn.slots[0], fragP, 0); + vinsn_from_chars (&vinsn, fragP->fr_opcode); + tinsn_immed_from_frag (&vinsn.slots[0], fragP, 0); - if (vinsn.num_slots == 1 - && xtensa_opcode_is_branch (xtensa_default_isa, - vinsn.slots[0].opcode) - && xg_get_single_size (vinsn.slots[0].opcode) == 2 - && is_narrow_branch_guaranteed_in_range (fragP, - &vinsn.slots[0])) - { - fragP->fr_subtype = RELAX_SLOTS; - fragP->tc_frag_data.slot_subtypes[0] = RELAX_NARROW; - fragP->tc_frag_data.is_aligning_branch = 1; - } - } - } - } + if (vinsn.num_slots == 1 + && xtensa_opcode_is_branch (xtensa_default_isa, + vinsn.slots[0].opcode) == 1 + && xg_get_single_size (vinsn.slots[0].opcode) == 2 + && is_narrow_branch_guaranteed_in_range (fragP, + &vinsn.slots[0])) + { + fragP->fr_subtype = RELAX_SLOTS; + fragP->tc_frag_data.slot_subtypes[0] = RELAX_NARROW; + fragP->tc_frag_data.is_aligning_branch = 1; + } + } + } + } } @@ -7119,48 +7179,50 @@ static void xtensa_mark_zcl_first_insns (void) { frchainS *frchP; + asection *s; - for (frchP = frchain_root; frchP; frchP = frchP->frch_next) - { - fragS *fragP; - /* Walk over all of the fragments in a subsection. */ - for (fragP = frchP->frch_root; fragP; fragP = fragP->fr_next) - { - if (fragP->fr_type == rs_machine_dependent - && (fragP->fr_subtype == RELAX_ALIGN_NEXT_OPCODE - || fragP->fr_subtype == RELAX_CHECK_ALIGN_NEXT_OPCODE)) - { - /* Find the loop frag. */ - fragS *targ_frag = next_non_empty_frag (fragP); - /* Find the first insn frag. */ - targ_frag = next_non_empty_frag (targ_frag); + for (s = stdoutput->sections; s; s = s->next) + for (frchP = seg_info (s)->frchainP; frchP; frchP = frchP->frch_next) + { + fragS *fragP; + /* Walk over all of the fragments in a subsection. */ + for (fragP = frchP->frch_root; fragP; fragP = fragP->fr_next) + { + if (fragP->fr_type == rs_machine_dependent + && (fragP->fr_subtype == RELAX_ALIGN_NEXT_OPCODE + || fragP->fr_subtype == RELAX_CHECK_ALIGN_NEXT_OPCODE)) + { + /* Find the loop frag. */ + fragS *targ_frag = next_non_empty_frag (fragP); + /* Find the first insn frag. */ + targ_frag = next_non_empty_frag (targ_frag); - /* Of course, sometimes (mostly for toy test cases) a - zero-cost loop instruction is the last in a section. */ - if (targ_frag) - { - targ_frag->tc_frag_data.is_first_loop_insn = TRUE; - /* Do not widen a frag that is the first instruction of a - zero-cost loop. It makes that loop harder to align. */ - if (targ_frag->fr_type == rs_machine_dependent - && targ_frag->fr_subtype == RELAX_SLOTS - && (targ_frag->tc_frag_data.slot_subtypes[0] - == RELAX_NARROW)) - { - if (targ_frag->tc_frag_data.is_aligning_branch) - targ_frag->tc_frag_data.slot_subtypes[0] = RELAX_IMMED; - else - { - frag_wane (targ_frag); - targ_frag->tc_frag_data.slot_subtypes[0] = 0; - } - } - } - if (fragP->fr_subtype == RELAX_CHECK_ALIGN_NEXT_OPCODE) - frag_wane (fragP); - } - } - } + /* Of course, sometimes (mostly for toy test cases) a + zero-cost loop instruction is the last in a section. */ + if (targ_frag) + { + targ_frag->tc_frag_data.is_first_loop_insn = TRUE; + /* Do not widen a frag that is the first instruction of a + zero-cost loop. It makes that loop harder to align. */ + if (targ_frag->fr_type == rs_machine_dependent + && targ_frag->fr_subtype == RELAX_SLOTS + && (targ_frag->tc_frag_data.slot_subtypes[0] + == RELAX_NARROW)) + { + if (targ_frag->tc_frag_data.is_aligning_branch) + targ_frag->tc_frag_data.slot_subtypes[0] = RELAX_IMMED; + else + { + frag_wane (targ_frag); + targ_frag->tc_frag_data.slot_subtypes[0] = 0; + } + } + } + if (fragP->fr_subtype == RELAX_CHECK_ALIGN_NEXT_OPCODE) + frag_wane (fragP); + } + } + } } @@ -7175,30 +7237,32 @@ static void xtensa_fix_a0_b_retw_frags (void) { frchainS *frchP; + asection *s; /* When this routine is called, all of the subsections are still intact so we walk over subsections instead of sections. */ - for (frchP = frchain_root; frchP; frchP = frchP->frch_next) - { - fragS *fragP; + for (s = stdoutput->sections; s; s = s->next) + for (frchP = seg_info (s)->frchainP; frchP; frchP = frchP->frch_next) + { + fragS *fragP; - /* Walk over all of the fragments in a subsection. */ - for (fragP = frchP->frch_root; fragP; fragP = fragP->fr_next) - { - if (fragP->fr_type == rs_machine_dependent - && fragP->fr_subtype == RELAX_ADD_NOP_IF_A0_B_RETW) - { - if (next_instrs_are_b_retw (fragP)) - { - if (fragP->tc_frag_data.is_no_transform) - as_bad (_("instruction sequence (write a0, branch, retw) may trigger hardware errata")); - else - relax_frag_add_nop (fragP); - } - frag_wane (fragP); - } - } - } + /* Walk over all of the fragments in a subsection. */ + for (fragP = frchP->frch_root; fragP; fragP = fragP->fr_next) + { + if (fragP->fr_type == rs_machine_dependent + && fragP->fr_subtype == RELAX_ADD_NOP_IF_A0_B_RETW) + { + if (next_instrs_are_b_retw (fragP)) + { + if (fragP->tc_frag_data.is_no_transform) + as_bad (_("instruction sequence (write a0, branch, retw) may trigger hardware errata")); + else + relax_frag_add_nop (fragP); + } + frag_wane (fragP); + } + } + } } @@ -7285,30 +7349,32 @@ static void xtensa_fix_b_j_loop_end_frags (void) { frchainS *frchP; + asection *s; /* When this routine is called, all of the subsections are still intact so we walk over subsections instead of sections. */ - for (frchP = frchain_root; frchP; frchP = frchP->frch_next) - { - fragS *fragP; + for (s = stdoutput->sections; s; s = s->next) + for (frchP = seg_info (s)->frchainP; frchP; frchP = frchP->frch_next) + { + fragS *fragP; - /* Walk over all of the fragments in a subsection. */ - for (fragP = frchP->frch_root; fragP; fragP = fragP->fr_next) - { - if (fragP->fr_type == rs_machine_dependent - && fragP->fr_subtype == RELAX_ADD_NOP_IF_PRE_LOOP_END) - { - if (next_instr_is_loop_end (fragP)) - { - if (fragP->tc_frag_data.is_no_transform) - as_bad (_("branching or jumping to a loop end may trigger hardware errata")); - else - relax_frag_add_nop (fragP); - } - frag_wane (fragP); - } - } - } + /* Walk over all of the fragments in a subsection. */ + for (fragP = frchP->frch_root; fragP; fragP = fragP->fr_next) + { + if (fragP->fr_type == rs_machine_dependent + && fragP->fr_subtype == RELAX_ADD_NOP_IF_PRE_LOOP_END) + { + if (next_instr_is_loop_end (fragP)) + { + if (fragP->tc_frag_data.is_no_transform) + as_bad (_("branching or jumping to a loop end may trigger hardware errata")); + else + relax_frag_add_nop (fragP); + } + frag_wane (fragP); + } + } + } } @@ -7349,66 +7415,68 @@ static void xtensa_fix_close_loop_end_frags (void) { frchainS *frchP; + asection *s; /* When this routine is called, all of the subsections are still intact so we walk over subsections instead of sections. */ - for (frchP = frchain_root; frchP; frchP = frchP->frch_next) - { - fragS *fragP; + for (s = stdoutput->sections; s; s = s->next) + for (frchP = seg_info (s)->frchainP; frchP; frchP = frchP->frch_next) + { + fragS *fragP; - fragS *current_target = NULL; + fragS *current_target = NULL; - /* Walk over all of the fragments in a subsection. */ - for (fragP = frchP->frch_root; fragP; fragP = fragP->fr_next) - { - if (fragP->fr_type == rs_machine_dependent - && ((fragP->fr_subtype == RELAX_ALIGN_NEXT_OPCODE) - || (fragP->fr_subtype == RELAX_CHECK_ALIGN_NEXT_OPCODE))) + /* Walk over all of the fragments in a subsection. */ + for (fragP = frchP->frch_root; fragP; fragP = fragP->fr_next) + { + if (fragP->fr_type == rs_machine_dependent + && ((fragP->fr_subtype == RELAX_ALIGN_NEXT_OPCODE) + || (fragP->fr_subtype == RELAX_CHECK_ALIGN_NEXT_OPCODE))) current_target = symbol_get_frag (fragP->fr_symbol); - if (current_target - && fragP->fr_type == rs_machine_dependent - && fragP->fr_subtype == RELAX_ADD_NOP_IF_CLOSE_LOOP_END) - { - offsetT min_bytes; - int bytes_added = 0; + if (current_target + && fragP->fr_type == rs_machine_dependent + && fragP->fr_subtype == RELAX_ADD_NOP_IF_CLOSE_LOOP_END) + { + offsetT min_bytes; + int bytes_added = 0; #define REQUIRED_LOOP_DIVIDING_BYTES 12 - /* Max out at 12. */ - min_bytes = min_bytes_to_other_loop_end - (fragP->fr_next, current_target, REQUIRED_LOOP_DIVIDING_BYTES); + /* Max out at 12. */ + min_bytes = min_bytes_to_other_loop_end + (fragP->fr_next, current_target, REQUIRED_LOOP_DIVIDING_BYTES); - if (min_bytes < REQUIRED_LOOP_DIVIDING_BYTES) - { - if (fragP->tc_frag_data.is_no_transform) - as_bad (_("loop end too close to another loop end may trigger hardware errata")); - else - { - while (min_bytes + bytes_added - < REQUIRED_LOOP_DIVIDING_BYTES) - { - int length = 3; + if (min_bytes < REQUIRED_LOOP_DIVIDING_BYTES) + { + if (fragP->tc_frag_data.is_no_transform) + as_bad (_("loop end too close to another loop end may trigger hardware errata")); + else + { + while (min_bytes + bytes_added + < REQUIRED_LOOP_DIVIDING_BYTES) + { + int length = 3; - if (fragP->fr_var < length) - as_fatal (_("fr_var %lu < length %d"), - (long) fragP->fr_var, length); - else - { - assemble_nop (length, - fragP->fr_literal + fragP->fr_fix); - fragP->fr_fix += length; - fragP->fr_var -= length; - } - bytes_added += length; - } - } - } - frag_wane (fragP); - } - assert (fragP->fr_type != rs_machine_dependent - || fragP->fr_subtype != RELAX_ADD_NOP_IF_CLOSE_LOOP_END); - } - } + if (fragP->fr_var < length) + as_fatal (_("fr_var %lu < length %d"), + (long) fragP->fr_var, length); + else + { + assemble_nop (length, + fragP->fr_literal + fragP->fr_fix); + fragP->fr_fix += length; + fragP->fr_var -= length; + } + bytes_added += length; + } + } + } + frag_wane (fragP); + } + assert (fragP->fr_type != rs_machine_dependent + || fragP->fr_subtype != RELAX_ADD_NOP_IF_CLOSE_LOOP_END); + } + } } @@ -7512,49 +7580,51 @@ static void xtensa_fix_short_loop_frags (void) { frchainS *frchP; + asection *s; /* When this routine is called, all of the subsections are still intact so we walk over subsections instead of sections. */ - for (frchP = frchain_root; frchP; frchP = frchP->frch_next) - { - fragS *fragP; - fragS *current_target = NULL; - xtensa_opcode current_opcode = XTENSA_UNDEFINED; + for (s = stdoutput->sections; s; s = s->next) + for (frchP = seg_info (s)->frchainP; frchP; frchP = frchP->frch_next) + { + fragS *fragP; + fragS *current_target = NULL; + xtensa_opcode current_opcode = XTENSA_UNDEFINED; - /* Walk over all of the fragments in a subsection. */ - for (fragP = frchP->frch_root; fragP; fragP = fragP->fr_next) - { - if (fragP->fr_type == rs_machine_dependent - && ((fragP->fr_subtype == RELAX_ALIGN_NEXT_OPCODE) - || (fragP->fr_subtype == RELAX_CHECK_ALIGN_NEXT_OPCODE))) - { - TInsn t_insn; - fragS *loop_frag = next_non_empty_frag (fragP); - tinsn_from_chars (&t_insn, loop_frag->fr_opcode, 0); - current_target = symbol_get_frag (fragP->fr_symbol); - current_opcode = t_insn.opcode; - assert (xtensa_opcode_is_loop (xtensa_default_isa, - current_opcode)); - } + /* Walk over all of the fragments in a subsection. */ + for (fragP = frchP->frch_root; fragP; fragP = fragP->fr_next) + { + if (fragP->fr_type == rs_machine_dependent + && ((fragP->fr_subtype == RELAX_ALIGN_NEXT_OPCODE) + || (fragP->fr_subtype == RELAX_CHECK_ALIGN_NEXT_OPCODE))) + { + TInsn t_insn; + fragS *loop_frag = next_non_empty_frag (fragP); + tinsn_from_chars (&t_insn, loop_frag->fr_opcode, 0); + current_target = symbol_get_frag (fragP->fr_symbol); + current_opcode = t_insn.opcode; + assert (xtensa_opcode_is_loop (xtensa_default_isa, + current_opcode) == 1); + } - if (fragP->fr_type == rs_machine_dependent - && fragP->fr_subtype == RELAX_ADD_NOP_IF_SHORT_LOOP) - { - if (count_insns_to_loop_end (fragP->fr_next, TRUE, 3) < 3 - && (branch_before_loop_end (fragP->fr_next) - || (workaround_all_short_loops - && current_opcode != XTENSA_UNDEFINED - && current_opcode != xtensa_loop_opcode))) - { - if (fragP->tc_frag_data.is_no_transform) - as_bad (_("loop containing less than three instructions may trigger hardware errata")); - else - relax_frag_add_nop (fragP); - } - frag_wane (fragP); - } - } - } + if (fragP->fr_type == rs_machine_dependent + && fragP->fr_subtype == RELAX_ADD_NOP_IF_SHORT_LOOP) + { + if (count_insns_to_loop_end (fragP->fr_next, TRUE, 3) < 3 + && (branch_before_loop_end (fragP->fr_next) + || (workaround_all_short_loops + && current_opcode != XTENSA_UNDEFINED + && current_opcode != xtensa_loop_opcode))) + { + if (fragP->tc_frag_data.is_no_transform) + as_bad (_("loop containing less than three instructions may trigger hardware errata")); + else + relax_frag_add_nop (fragP); + } + frag_wane (fragP); + } + } + } } @@ -7697,50 +7767,51 @@ xtensa_sanity_check (void) { char *file_name; unsigned line; - frchainS *frchP; + asection *s; as_where (&file_name, &line); - for (frchP = frchain_root; frchP; frchP = frchP->frch_next) - { - fragS *fragP; + for (s = stdoutput->sections; s; s = s->next) + for (frchP = seg_info (s)->frchainP; frchP; frchP = frchP->frch_next) + { + fragS *fragP; - /* Walk over all of the fragments in a subsection. */ - for (fragP = frchP->frch_root; fragP; fragP = fragP->fr_next) - { - /* Currently we only check for empty loops here. */ - if (fragP->fr_type == rs_machine_dependent - && fragP->fr_subtype == RELAX_IMMED) - { - static xtensa_insnbuf insnbuf = NULL; - TInsn t_insn; + /* Walk over all of the fragments in a subsection. */ + for (fragP = frchP->frch_root; fragP; fragP = fragP->fr_next) + { + if (fragP->fr_type == rs_machine_dependent + && fragP->fr_subtype == RELAX_SLOTS + && fragP->tc_frag_data.slot_subtypes[0] == RELAX_IMMED) + { + static xtensa_insnbuf insnbuf = NULL; + TInsn t_insn; - if (fragP->fr_opcode != NULL) - { - if (!insnbuf) - insnbuf = xtensa_insnbuf_alloc (xtensa_default_isa); - tinsn_from_chars (&t_insn, fragP->fr_opcode, 0); - tinsn_immed_from_frag (&t_insn, fragP, 0); + if (fragP->fr_opcode != NULL) + { + if (!insnbuf) + insnbuf = xtensa_insnbuf_alloc (xtensa_default_isa); + tinsn_from_chars (&t_insn, fragP->fr_opcode, 0); + tinsn_immed_from_frag (&t_insn, fragP, 0); - if (xtensa_opcode_is_loop (xtensa_default_isa, - t_insn.opcode) == 1) - { - if (is_empty_loop (&t_insn, fragP)) - { - new_logical_line (fragP->fr_file, fragP->fr_line); - as_bad (_("invalid empty loop")); - } - if (!is_local_forward_loop (&t_insn, fragP)) - { - new_logical_line (fragP->fr_file, fragP->fr_line); - as_bad (_("loop target does not follow " - "loop instruction in section")); - } - } - } - } - } - } + if (xtensa_opcode_is_loop (xtensa_default_isa, + t_insn.opcode) == 1) + { + if (is_empty_loop (&t_insn, fragP)) + { + new_logical_line (fragP->fr_file, fragP->fr_line); + as_bad (_("invalid empty loop")); + } + if (!is_local_forward_loop (&t_insn, fragP)) + { + new_logical_line (fragP->fr_file, fragP->fr_line); + as_bad (_("loop target does not follow " + "loop instruction in section")); + } + } + } + } + } + } new_logical_line (file_name, line); } @@ -7806,7 +7877,7 @@ is_local_forward_loop (const TInsn *insn, fragS *fragP) if (insn->insn_type != ITYPE_INSN) return FALSE; - if (xtensa_opcode_is_loop (xtensa_default_isa, insn->opcode) == 0) + if (xtensa_opcode_is_loop (xtensa_default_isa, insn->opcode) != 1) return FALSE; if (insn->ntok <= LOOP_IMMED_OPN) @@ -7838,6 +7909,55 @@ is_local_forward_loop (const TInsn *insn, fragS *fragP) return FALSE; } + +#define XTINFO_NAME "Xtensa_Info" +#define XTINFO_NAMESZ 12 +#define XTINFO_TYPE 1 + +static void +xtensa_add_config_info (void) +{ + asection *info_sec; + char *data, *p; + int sz; + + info_sec = subseg_new (".xtensa.info", 0); + bfd_set_section_flags (stdoutput, info_sec, SEC_HAS_CONTENTS | SEC_READONLY); + + data = xmalloc (100); + sprintf (data, "USE_ABSOLUTE_LITERALS=%d\nABI=%d\n", + XSHAL_USE_ABSOLUTE_LITERALS, XSHAL_ABI); + sz = strlen (data) + 1; + + /* Add enough null terminators to pad to a word boundary. */ + do + data[sz++] = 0; + while ((sz & 3) != 0); + + /* Follow the standard note section layout: + First write the length of the name string. */ + p = frag_more (4); + md_number_to_chars (p, (valueT) XTINFO_NAMESZ, 4); + + /* Next comes the length of the "descriptor", i.e., the actual data. */ + p = frag_more (4); + md_number_to_chars (p, (valueT) sz, 4); + + /* Write the note type. */ + p = frag_more (4); + md_number_to_chars (p, (valueT) XTINFO_TYPE, 4); + + /* Write the name field. */ + p = frag_more (XTINFO_NAMESZ); + memcpy (p, XTINFO_NAME, XTINFO_NAMESZ); + + /* Finally, write the descriptor. */ + p = frag_more (sz); + memcpy (p, data, sz); + + free (data); +} + /* Alignment Functions. */ @@ -8228,6 +8348,7 @@ xtensa_relax_frag (fragS *fragP, long stretch, int *stretched_p) case RELAX_IMMED: case RELAX_IMMED_STEP1: case RELAX_IMMED_STEP2: + case RELAX_IMMED_STEP3: /* Place the immediate. */ new_stretch += relax_frag_immed (now_seg, fragP, stretch, @@ -8612,7 +8733,7 @@ future_alignment_required (fragS *fragP, long stretch ATTRIBUTE_UNUSED) c 0 2 1 (case 5b makes this case unnecessary) 6a 2 0 0 b 1 0 3 - c 0 1 4 (case 6b makes this case unneccesary) + c 0 1 4 (case 6b makes this case unnecessary) d 1 1 1 (case 6a makes this case unnecessary) e 0 2 2 (case 6a makes this case unnecessary) f 0 3 0 (case 6a makes this case unnecessary) @@ -8792,7 +8913,7 @@ relax_frag_immed (segT segP, tinsn = cur_vinsn.slots[slot]; tinsn_immed_from_frag (&tinsn, fragP, slot); - if (estimate_only && xtensa_opcode_is_loop (isa, tinsn.opcode)) + if (estimate_only && xtensa_opcode_is_loop (isa, tinsn.opcode) == 1) return 0; if (workaround_b_j_loop_end && ! fragP->tc_frag_data.is_no_transform) @@ -8945,6 +9066,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT sec, fragS *fragp) case RELAX_IMMED: case RELAX_IMMED_STEP1: case RELAX_IMMED_STEP2: + case RELAX_IMMED_STEP3: /* Place the immediate. */ convert_frag_immed (sec, fragp, @@ -9292,10 +9414,7 @@ convert_frag_immed (segT segP, /* Add a fixup. */ target_seg = S_GET_SEGMENT (lit_sym); assert (target_seg); - if (tinsn->tok[0].X_op == O_pltrel) - reloc_type = BFD_RELOC_XTENSA_PLT; - else - reloc_type = BFD_RELOC_32; + reloc_type = map_operator_to_reloc (tinsn->tok[0].X_op); fix_new_exp_in_seg (target_seg, 0, lit_frag, 0, 4, &tinsn->tok[0], FALSE, reloc_type); break; @@ -9476,11 +9595,6 @@ convert_frag_immed_finish_loop (segT segP, fragS *fragP, TInsn *tinsn) target = 0; } - know (symbolP); - know (symbolP->sy_frag); - know (!(S_GET_SEGMENT (symbolP) == absolute_section) - || symbol_get_frag (symbolP) == &zero_address_frag); - loop_length = target - (fragP->fr_address + fragP->fr_fix); loop_length_hi = loop_length & ~0x0ff; loop_length_lo = loop_length & 0x0ff; @@ -9679,15 +9793,17 @@ xtensa_move_literals (void) sym_list *lit; mark_literal_frags (literal_head->next); - mark_literal_frags (init_literal_head->next); - mark_literal_frags (fini_literal_head->next); if (use_literal_section) return; - segment = literal_head->next; - while (segment) + for (segment = literal_head->next; segment; segment = segment->next) { + /* Keep the literals for .init and .fini in separate sections. */ + if (!strcmp (segment_name (segment->seg), INIT_SECTION_NAME) + || !strcmp (segment_name (segment->seg), FINI_SECTION_NAME)) + continue; + frchain_from = seg_info (segment->seg)->frchainP; search_frag = frchain_from->frch_root; literal_pool = NULL; @@ -9728,17 +9844,14 @@ xtensa_move_literals (void) frchain_to = literal_pool->tc_frag_data.lit_frchain; assert (frchain_to); } - insert_after = literal_pool; - - while (insert_after->fr_next->fr_subtype != RELAX_LITERAL_POOL_END) - insert_after = insert_after->fr_next; - + insert_after = literal_pool->tc_frag_data.literal_frag; dest_seg = insert_after->fr_next->tc_frag_data.lit_seg; *frag_splice = next_frag; search_frag->fr_next = insert_after->fr_next; insert_after->fr_next = search_frag; search_frag->tc_frag_data.lit_seg = dest_seg; + literal_pool->tc_frag_data.literal_frag = search_frag; /* Now move any fixups associated with this frag to the right section. */ @@ -9771,7 +9884,6 @@ xtensa_move_literals (void) } frchain_from->fix_tail = NULL; xtensa_restore_emit_state (&state); - segment = segment->next; } /* Now fix up the SEGMENT value for all the literal symbols. */ @@ -9852,8 +9964,6 @@ xtensa_reorder_segments (void) /* Now that we have the last section, push all the literal sections to the end. */ xtensa_reorder_seg_list (literal_head, last_sec); - xtensa_reorder_seg_list (init_literal_head, last_sec); - xtensa_reorder_seg_list (fini_literal_head, last_sec); /* Now perform the final error check. */ for (sec = stdoutput->sections; sec != NULL; sec = sec->next) @@ -9871,10 +9981,8 @@ xtensa_switch_to_literal_fragment (emit_state *result) { if (directive_state[directive_absolute_literals]) { - cache_literal_section (0, default_lit_sections.lit4_seg_name, - &default_lit_sections.lit4_seg, FALSE); - xtensa_switch_section_emit_state (result, - default_lit_sections.lit4_seg, 0); + segT lit4_seg = cache_literal_section (TRUE); + xtensa_switch_section_emit_state (result, lit4_seg, 0); } else xtensa_switch_to_non_abs_literal_fragment (result); @@ -9888,17 +9996,11 @@ xtensa_switch_to_literal_fragment (emit_state *result) static void xtensa_switch_to_non_abs_literal_fragment (emit_state *result) { - /* When we mark a literal pool location, we want to put a frag in - the literal pool that points to it. But to do that, we want to - switch_to_literal_fragment. But literal sections don't have - literal pools, so their location is always null, so we would - recurse forever. This is kind of hacky, but it works. */ - static bfd_boolean recursive = FALSE; fragS *pool_location = get_literal_pool_location (now_seg); + segT lit_seg; bfd_boolean is_init = (now_seg && !strcmp (segment_name (now_seg), INIT_SECTION_NAME)); - bfd_boolean is_fini = (now_seg && !strcmp (segment_name (now_seg), FINI_SECTION_NAME)); @@ -9908,39 +10010,20 @@ xtensa_switch_to_non_abs_literal_fragment (emit_state *result) && !is_init && ! is_fini) { as_bad (_("literal pool location required for text-section-literals; specify with .literal_position")); + + /* When we mark a literal pool location, we want to put a frag in + the literal pool that points to it. But to do that, we want to + switch_to_literal_fragment. But literal sections don't have + literal pools, so their location is always null, so we would + recurse forever. This is kind of hacky, but it works. */ + recursive = TRUE; xtensa_mark_literal_pool_location (); recursive = FALSE; } - /* Special case: If we are in the ".fini" or ".init" section, then - we will ALWAYS be generating to the ".fini.literal" and - ".init.literal" sections. */ - - if (is_init) - { - cache_literal_section (init_literal_head, - default_lit_sections.init_lit_seg_name, - &default_lit_sections.init_lit_seg, TRUE); - xtensa_switch_section_emit_state (result, - default_lit_sections.init_lit_seg, 0); - } - else if (is_fini) - { - cache_literal_section (fini_literal_head, - default_lit_sections.fini_lit_seg_name, - &default_lit_sections.fini_lit_seg, TRUE); - xtensa_switch_section_emit_state (result, - default_lit_sections.fini_lit_seg, 0); - } - else - { - cache_literal_section (literal_head, - default_lit_sections.lit_seg_name, - &default_lit_sections.lit_seg, TRUE); - xtensa_switch_section_emit_state (result, - default_lit_sections.lit_seg, 0); - } + lit_seg = cache_literal_section (FALSE); + xtensa_switch_section_emit_state (result, lit_seg, 0); if (!use_literal_section && !is_init && !is_fini @@ -9984,49 +10067,129 @@ xtensa_restore_emit_state (emit_state *state) } -/* Get a segment of a given name. If the segment is already - present, return it; otherwise, create a new one. */ +/* Predicate function used to look up a section in a particular group. */ -static void -cache_literal_section (seg_list *head, - const char *name, - segT *pseg, - bfd_boolean is_code) +static bfd_boolean +match_section_group (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *inf) { - segT current_section = now_seg; - int current_subsec = now_subseg; - segT seg; + const char *gname = inf; + const char *group_name = elf_group_name (sec); + + return (group_name == gname + || (group_name != NULL + && gname != NULL + && strcmp (group_name, gname) == 0)); +} - if (*pseg != 0) - return; - /* Check if the named section exists. */ - for (seg = stdoutput->sections; seg; seg = seg->next) +/* Get the literal section to be used for the current text section. + The result may be cached in the default_lit_sections structure. */ + +static segT +cache_literal_section (bfd_boolean use_abs_literals) +{ + const char *text_name, *group_name = 0; + char *base_name, *name, *suffix; + segT *pcached; + segT seg, current_section; + int current_subsec; + bfd_boolean linkonce = FALSE; + + /* Save the current section/subsection. */ + current_section = now_seg; + current_subsec = now_subseg; + + /* Clear the cached values if they are no longer valid. */ + if (now_seg != default_lit_sections.current_text_seg) { - if (!strcmp (segment_name (seg), name)) - break; + default_lit_sections.current_text_seg = now_seg; + default_lit_sections.lit_seg = NULL; + default_lit_sections.lit4_seg = NULL; } - if (!seg) + /* Check if the literal section is already cached. */ + if (use_abs_literals) + pcached = &default_lit_sections.lit4_seg; + else + pcached = &default_lit_sections.lit_seg; + + if (*pcached) + return *pcached; + + text_name = default_lit_sections.lit_prefix; + if (! text_name || ! *text_name) { - /* Create a new literal section. */ - seg = subseg_new (name, (subsegT) 0); - if (head) + text_name = segment_name (current_section); + group_name = elf_group_name (current_section); + linkonce = (current_section->flags & SEC_LINK_ONCE) != 0; + } + + base_name = use_abs_literals ? ".lit4" : ".literal"; + if (group_name) + { + name = xmalloc (strlen (base_name) + strlen (group_name) + 2); + sprintf (name, "%s.%s", base_name, group_name); + } + else if (strncmp (text_name, ".gnu.linkonce.", linkonce_len) == 0) + { + suffix = strchr (text_name + linkonce_len, '.'); + + name = xmalloc (linkonce_len + strlen (base_name) + 1 + + (suffix ? strlen (suffix) : 0)); + strcpy (name, ".gnu.linkonce"); + strcat (name, base_name); + if (suffix) + strcat (name, suffix); + linkonce = TRUE; + } + else + { + /* If the section name ends with ".text", then replace that suffix + instead of appending an additional suffix. */ + size_t len = strlen (text_name); + if (len >= 5 && strcmp (text_name + len - 5, ".text") == 0) + len -= 5; + + name = xmalloc (len + strlen (base_name) + 1); + strcpy (name, text_name); + strcpy (name + len, base_name); + } + + /* Canonicalize section names to allow renaming literal sections. + The group name, if any, came from the current text section and + has already been canonicalized. */ + name = tc_canonicalize_symbol_name (name); + + seg = bfd_get_section_by_name_if (stdoutput, name, match_section_group, + (void *) group_name); + if (! seg) + { + flagword flags; + + seg = subseg_force_new (name, 0); + + if (! use_abs_literals) { - /* Add the newly created literal segment to the specified list. */ + /* Add the newly created literal segment to the list. */ seg_list *n = (seg_list *) xmalloc (sizeof (seg_list)); n->seg = seg; - n->next = head->next; - head->next = n; + n->next = literal_head->next; + literal_head->next = n; } - bfd_set_section_flags (stdoutput, seg, SEC_HAS_CONTENTS | - SEC_READONLY | SEC_ALLOC | SEC_LOAD - | (is_code ? SEC_CODE : SEC_DATA)); + + flags = (SEC_HAS_CONTENTS | SEC_READONLY | SEC_ALLOC | SEC_LOAD + | (linkonce ? (SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD) : 0) + | (use_abs_literals ? SEC_DATA : SEC_CODE)); + + elf_group_name (seg) = group_name; + + bfd_set_section_flags (stdoutput, seg, flags); bfd_set_section_alignment (stdoutput, seg, 2); } - *pseg = seg; + *pcached = seg; subseg_set (current_section, current_subsec); + return seg; } @@ -10045,7 +10208,6 @@ static void xtensa_create_property_segments static void xtensa_create_xproperty_segments (frag_flags_fn, const char *, xt_section_type); static segment_info_type *retrieve_segment_info (segT); -static segT retrieve_xtensa_section (char *); static bfd_boolean section_has_property (segT, frag_predicate); static bfd_boolean section_has_xproperty (segT, frag_flags_fn); static void add_xt_block_frags @@ -10063,10 +10225,9 @@ void xtensa_post_relax_hook (void) { xtensa_move_seg_list_to_beginning (literal_head); - xtensa_move_seg_list_to_beginning (init_literal_head); - xtensa_move_seg_list_to_beginning (fini_literal_head); xtensa_find_unmarked_state_frags (); + xtensa_mark_frags_for_org (); xtensa_create_property_segments (get_frag_is_literal, NULL, @@ -10120,9 +10281,8 @@ xtensa_create_property_segments (frag_predicate property_function, if (section_has_property (sec, property_function)) { - char *property_section_name = - xtensa_get_property_section_name (sec, section_name_base); - segT insn_sec = retrieve_xtensa_section (property_section_name); + segT insn_sec = + xtensa_get_property_section (sec, section_name_base); segment_info_type *xt_seg_info = retrieve_segment_info (insn_sec); xtensa_block_info **xt_blocks = &xt_seg_info->tc_segment_info_data.blocks[sec_type]; @@ -10253,9 +10413,8 @@ xtensa_create_xproperty_segments (frag_flags_fn flag_fn, if (section_has_xproperty (sec, flag_fn)) { - char *property_section_name = - xtensa_get_property_section_name (sec, section_name_base); - segT insn_sec = retrieve_xtensa_section (property_section_name); + segT insn_sec = + xtensa_get_property_section (sec, section_name_base); segment_info_type *xt_seg_info = retrieve_segment_info (insn_sec); xtensa_block_info **xt_blocks = &xt_seg_info->tc_segment_info_data.blocks[sec_type]; @@ -10384,7 +10543,6 @@ retrieve_segment_info (segT seg) frchainP->frch_root = NULL; frchainP->frch_last = NULL; frchainP->frch_next = NULL; - frchainP->frch_seg = seg; frchainP->frch_subseg = 0; frchainP->fix_root = NULL; frchainP->fix_tail = NULL; @@ -10400,29 +10558,6 @@ retrieve_segment_info (segT seg) } -static segT -retrieve_xtensa_section (char *sec_name) -{ - bfd *abfd = stdoutput; - flagword flags, out_flags, link_once_flags; - segT s; - - flags = bfd_get_section_flags (abfd, now_seg); - link_once_flags = (flags & SEC_LINK_ONCE); - if (link_once_flags) - link_once_flags |= (flags & SEC_LINK_DUPLICATES); - out_flags = (SEC_RELOC | SEC_HAS_CONTENTS | SEC_READONLY | link_once_flags); - - s = bfd_make_section_old_way (abfd, sec_name); - if (s == NULL) - as_bad (_("could not create section %s"), sec_name); - if (!bfd_set_section_flags (abfd, s, out_flags)) - as_bad (_("invalid flag combination on section %s"), sec_name); - - return s; -} - - static bfd_boolean section_has_property (segT sec, frag_predicate property_function) { @@ -10553,6 +10688,9 @@ get_frag_property_flags (const fragS *fragP, frag_flags *prop_flags) xtensa_frag_flags_init (prop_flags); if (fragP->tc_frag_data.is_literal) prop_flags->is_literal = TRUE; + if (fragP->tc_frag_data.is_specific_opcode + || fragP->tc_frag_data.is_no_transform) + prop_flags->is_no_transform = TRUE; if (fragP->tc_frag_data.is_unreachable) prop_flags->is_unreachable = TRUE; else if (fragP->tc_frag_data.is_insn) @@ -10562,9 +10700,6 @@ get_frag_property_flags (const fragS *fragP, frag_flags *prop_flags) prop_flags->insn.is_loop_target = TRUE; if (fragP->tc_frag_data.is_branch_target) prop_flags->insn.is_branch_target = TRUE; - if (fragP->tc_frag_data.is_specific_opcode - || fragP->tc_frag_data.is_no_transform) - prop_flags->insn.is_no_transform = TRUE; if (fragP->tc_frag_data.is_no_density) prop_flags->insn.is_no_density = TRUE; if (fragP->tc_frag_data.use_absolute_literals) @@ -10602,8 +10737,8 @@ frag_flags_to_number (const frag_flags *prop_flags) if (prop_flags->insn.is_no_density) num |= XTENSA_PROP_INSN_NO_DENSITY; - if (prop_flags->insn.is_no_transform) - num |= XTENSA_PROP_INSN_NO_TRANSFORM; + if (prop_flags->is_no_transform) + num |= XTENSA_PROP_NO_TRANSFORM; if (prop_flags->insn.is_no_reorder) num |= XTENSA_PROP_INSN_NO_REORDER; if (prop_flags->insn.is_abslit) @@ -10642,8 +10777,8 @@ xtensa_frag_flags_combinable (const frag_flags *prop_flags_1, if (prop_flags_1->insn.is_no_density != prop_flags_2->insn.is_no_density) return FALSE; - if (prop_flags_1->insn.is_no_transform != - prop_flags_2->insn.is_no_transform) + if (prop_flags_1->is_no_transform != + prop_flags_2->is_no_transform) return FALSE; if (prop_flags_1->insn.is_no_reorder != prop_flags_2->insn.is_no_reorder) @@ -10930,7 +11065,7 @@ istack_push_space (IStack *stack) TInsn *insn; assert (!istack_full (stack)); insn = &stack->insn[rec]; - memset (insn, 0, sizeof (TInsn)); + tinsn_init (insn); stack->ninsn++; return insn; } @@ -10945,7 +11080,7 @@ istack_pop (IStack *stack) int rec = stack->ninsn - 1; assert (!istack_empty (stack)); stack->ninsn--; - memset (&stack->insn[rec], 0, sizeof (TInsn)); + tinsn_init (&stack->insn[rec]); } @@ -10958,17 +11093,6 @@ tinsn_init (TInsn *dst) } -/* Get the ``num''th token of the TInsn. - It is illegal to call this if num > insn->ntoks. */ - -expressionS * -tinsn_get_tok (TInsn *insn, int num) -{ - assert (num < insn->ntok); - return &insn->tok[num]; -} - - /* Return TRUE if ANY of the operands in the insn are symbolic. */ static bfd_boolean diff --git a/gas/config/tc-xtensa.h b/gas/config/tc-xtensa.h index 71f1ebbd3b3..40653213d31 100644 --- a/gas/config/tc-xtensa.h +++ b/gas/config/tc-xtensa.h @@ -1,5 +1,5 @@ /* tc-xtensa.h -- Header file for tc-xtensa.c. - Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -131,18 +131,20 @@ enum xtensa_relax_statesE RELAX_IMMED, /* The last instruction in this fragment (at->fr_opcode) contains - the value defined by fr_symbol (fr_offset = 0). If the value - does not fit, use the specified expansion. This is similar to - "NARROW", except that these may not be expanded in order to align - code. */ + an immediate or symbol. If the value does not fit, relax the + opcode using expansions from the relax table. */ RELAX_IMMED_STEP1, /* The last instruction in this fragment (at->fr_opcode) contains a - literal. It has already been expanded at least 1 step. */ + literal. It has already been expanded 1 step. */ RELAX_IMMED_STEP2, /* The last instruction in this fragment (at->fr_opcode) contains a - literal. It has already been expanded at least 2 steps. */ + literal. It has already been expanded 2 steps. */ + + RELAX_IMMED_STEP3, + /* The last instruction in this fragment (at->fr_opcode) contains a + literal. It has already been expanded 3 steps. */ RELAX_SLOTS, /* There are instructions within the last VLIW instruction that need @@ -167,12 +169,19 @@ enum xtensa_relax_statesE branch is relaxed, then this frag will be converted to a RELAX_UNREACHABLE frag. */ + RELAX_ORG, + /* This marks the location as having previously been an rs_org frag. + rs_org frags are converted to fill-zero frags immediately after + relaxation. However, we need to remember where they were so we can + prevent the linker from changing the size of any frag between the + section start and the org frag. */ + RELAX_NONE }; /* This is used as a stopper to bound the number of steps that can be taken. */ -#define RELAX_IMMED_MAXSTEPS (RELAX_IMMED_STEP2 - RELAX_IMMED) +#define RELAX_IMMED_MAXSTEPS (RELAX_IMMED_STEP3 - RELAX_IMMED) struct xtensa_frag_type { @@ -221,7 +230,9 @@ struct xtensa_frag_type variable points to the frag where the literal will be stored. For literal frags, this variable points to the nearest literal pool location frag. This literal frag will be moved to after this - location. */ + location. For RELAX_LITERAL_POOL_BEGIN frags, this field points + to the frag immediately before the corresponding RELAX_LITERAL_POOL_END + frag, to make moving frags for this literal pool efficient. */ fragS *literal_frag; /* The destination segment for literal frags. (Note that this is only @@ -371,6 +382,9 @@ extern char *xtensa_section_rename (char *); #define MD_APPLY_SYM_VALUE(FIX) 0 #define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) 0 +/* Use line number format that is amenable to linker relaxation. */ +#define DWARF2_USE_FIXED_ADVANCE_PC (linkrelax != 0) + /* Resource reservation info functions. */ diff --git a/gas/config/tc-z80.c b/gas/config/tc-z80.c index 413e336a2c8..73b3fc83150 100644 --- a/gas/config/tc-z80.c +++ b/gas/config/tc-z80.c @@ -1,5 +1,5 @@ /* tc-z80.c -- Assemble code for the Zilog Z80 and ASCII R800 - Copyright 2005 Free Software Foundation, Inc. + Copyright 2005, 2006 Free Software Foundation, Inc. Contributed by Arnold Metselaar This file is part of GAS, the GNU Assembler. @@ -20,12 +20,8 @@ 02110-1301, USA. */ #include "as.h" -#include "listing.h" -#include "bfd.h" #include "safe-ctype.h" #include "subsegs.h" -#include "symbols.h" -#include "libiberty.h" /* Exported constants. */ const char comment_chars[] = ";\0"; diff --git a/gas/config/tc-z8k.c b/gas/config/tc-z8k.c index 355ac12c2bb..e3893668ff1 100644 --- a/gas/config/tc-z8k.c +++ b/gas/config/tc-z8k.c @@ -1,6 +1,6 @@ /* tc-z8k.c -- Assemble code for the Zilog Z800n Copyright 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001, 2002, 2003, - 2005 Free Software Foundation, Inc. + 2005, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -21,10 +21,7 @@ /* Written By Steve Chamberlain . */ -#include - #include "as.h" -#include "bfd.h" #include "safe-ctype.h" #define DEFINE_TABLE #include "opcodes/z8k-opc.h" @@ -199,19 +196,34 @@ static int the_ctrl; static int the_flags; static int the_interrupt; +/* Determine register number. src points to the ascii number + (after "rl", "rh", "r", "rr", or "rq"). If a character + outside the set of {0,',',')','('} follows the number, + return NULL to indicate that it's not a valid register + number. */ + static char * whatreg (unsigned int *reg, char *src) { + unsigned int new_reg; + + /* src[0] is already known to be a digit. */ if (ISDIGIT (src[1])) { - *reg = (src[0] - '0') * 10 + src[1] - '0'; - return src + 2; + new_reg = (src[0] - '0') * 10 + src[1] - '0'; + src += 2; } else { - *reg = (src[0] - '0'); - return src + 1; + new_reg = (src[0] - '0'); + src += 1; } + + if (src[0] != 0 && src[0] != ',' && src[0] != '(' && src[0] != ')') + return NULL; + + *reg = new_reg; + return src; } /* Parse operands @@ -234,7 +246,7 @@ whatreg (unsigned int *reg, char *src) static char * parse_reg (char *src, int *mode, unsigned int *reg) { - char *res = 0; + char *res = NULL; char regno; /* Check for stack pointer "sp" alias. */ @@ -260,9 +272,11 @@ parse_reg (char *src, int *mode, unsigned int *reg) if (src[1] == 'r' || src[1] == 'R') { if (src[2] < '0' || src[2] > '9') - return res; /* Assume no register name but a label starting with 'rr'. */ + return NULL; /* Assume no register name but a label starting with 'rr'. */ *mode = CLASS_REG_LONG; res = whatreg (reg, src + 2); + if (res == NULL) + return NULL; /* Not a valid register name. */ regno = *reg; if (regno > 14) as_bad (_("register rr%d out of range"), regno); @@ -272,9 +286,11 @@ parse_reg (char *src, int *mode, unsigned int *reg) else if (src[1] == 'h' || src[1] == 'H') { if (src[2] < '0' || src[2] > '9') - return res; /* Assume no register name but a label starting with 'rh'. */ + return NULL; /* Assume no register name but a label starting with 'rh'. */ *mode = CLASS_REG_BYTE; res = whatreg (reg, src + 2); + if (res == NULL) + return NULL; /* Not a valid register name. */ regno = *reg; if (regno > 7) as_bad (_("register rh%d out of range"), regno); @@ -282,9 +298,11 @@ parse_reg (char *src, int *mode, unsigned int *reg) else if (src[1] == 'l' || src[1] == 'L') { if (src[2] < '0' || src[2] > '9') - return res; /* Assume no register name but a label starting with 'rl'. */ + return NULL; /* Assume no register name but a label starting with 'rl'. */ *mode = CLASS_REG_BYTE; res = whatreg (reg, src + 2); + if (res == NULL) + return NULL; /* Not a valid register name. */ regno = *reg; if (regno > 7) as_bad (_("register rl%d out of range"), regno); @@ -293,9 +311,11 @@ parse_reg (char *src, int *mode, unsigned int *reg) else if (src[1] == 'q' || src[1] == 'Q') { if (src[2] < '0' || src[2] > '9') - return res; /* Assume no register name but a label starting with 'rq'. */ + return NULL; /* Assume no register name but a label starting with 'rq'. */ *mode = CLASS_REG_QUAD; res = whatreg (reg, src + 2); + if (res == NULL) + return NULL; /* Not a valid register name. */ regno = *reg; if (regno > 12) as_bad (_("register rq%d out of range"), regno); @@ -305,9 +325,11 @@ parse_reg (char *src, int *mode, unsigned int *reg) else { if (src[1] < '0' || src[1] > '9') - return res; /* Assume no register name but a label starting with 'r'. */ + return NULL; /* Assume no register name but a label starting with 'r'. */ *mode = CLASS_REG_WORD; res = whatreg (reg, src + 1); + if (res == NULL) + return NULL; /* Not a valid register name. */ regno = *reg; if (regno > 15) as_bad (_("register r%d out of range"), regno); diff --git a/gas/config/te-pep.h b/gas/config/te-pep.h new file mode 100644 index 00000000000..164b22d9840 --- /dev/null +++ b/gas/config/te-pep.h @@ -0,0 +1,10 @@ +#define TE_PEP +#define COFF_WITH_pex64 + +#define TE_PE +#define LEX_AT (LEX_BEGIN_NAME | LEX_NAME) /* Can have @'s inside labels. */ + +/* The PE format supports long section names. */ +#define COFF_LONG_SECTION_NAMES + +#include "obj-format.h" diff --git a/gas/config/xtensa-istack.h b/gas/config/xtensa-istack.h index 7d2471abd46..a6ec40b8388 100644 --- a/gas/config/xtensa-istack.h +++ b/gas/config/xtensa-istack.h @@ -1,5 +1,5 @@ /* Declarations for stacks of tokenized Xtensa instructions. - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -48,8 +48,6 @@ typedef struct tinsn_struct expressionS tok[MAX_INSN_ARGS]; unsigned linenum; - struct fixP *fixup; - /* Filled out by relaxation_requirements: */ enum xtensa_relax_statesE subtype; int literal_space; @@ -79,7 +77,6 @@ void istack_pop (IStack *); /* TInsn utilities. */ void tinsn_init (TInsn *); -expressionS *tinsn_get_tok (TInsn *, int); /* vliw_insn: bundles of TInsns. */ diff --git a/gas/config/xtensa-relax.c b/gas/config/xtensa-relax.c index a0848820eb3..779c9076a42 100644 --- a/gas/config/xtensa-relax.c +++ b/gas/config/xtensa-relax.c @@ -1,5 +1,5 @@ /* Table of relaxations for Xtensa assembly. - Copyright 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -49,8 +49,8 @@ The replacement language INSN_REPL ::= INSN_LABEL_LIT ( ';' INSN_LABEL_LIT )* INSN_LABEL_LIT ::= INSN_TEMPL - | 'LABEL' num - | 'LITERAL' num ' ' VARIABLE + | 'LABEL' + | 'LITERAL' VARIABLE The operands in a PRECOND must be constants or variables bound by the INSN_PATTERN. @@ -72,12 +72,12 @@ movi.n instruction to the wide movi instruction. A more complex example of a branch around: - {"beqz %as,%label", "bnez %as,%LABEL0;j %label;LABEL0"} + {"beqz %as,%label", "bnez %as,%LABEL;j %label;LABEL"} would convert a branch to a negated branch to the following instruction with a jump to the original label. An Xtensa-specific example that generates a literal: - {"movi %at,%imm", "LITERAL0 %imm; l32r %at,%LITERAL0"} + {"movi %at,%imm", "LITERAL %imm; l32r %at,%LITERAL"} will convert a movi instruction to an l32r of a literal literal defined in the literal pool. @@ -87,7 +87,7 @@ when the first and second operands are not the same as specified by the "| %at!=%as" precondition clause. {"l32i %at,%as,%imm | %at!=%as", - "LITERAL0 %imm; l32r %at,%LITERAL0; add %at,%at,%as; l32i %at,%at,0"} + "LITERAL %imm; l32r %at,%LITERAL; add %at,%at,%as; l32i %at,%at,0"} There is special case for loop instructions here, but because we do not currently have the ability to represent the difference of two @@ -247,7 +247,10 @@ struct string_pattern_pair_struct addi.n a4, 0x1010 => addi a4, 0x1010 => addmi a4, 0x1010 - => addmi a4, 0x1000, addi a4, 0x10. */ + => addmi a4, 0x1000, addi a4, 0x10. + + See the comments in xg_assembly_relax for some important details + regarding how these chains must be built. */ static string_pattern_pair widen_spec_list[] = { @@ -268,7 +271,7 @@ static string_pattern_pair widen_spec_list[] = /* Widening with literals or const16. */ {"movi %at,%imm ? IsaUseL32R ", - "LITERAL0 %imm; l32r %at,%LITERAL0"}, + "LITERAL %imm; l32r %at,%LITERAL"}, {"movi %at,%imm ? IsaUseConst16", "const16 %at,HI16U(%imm); const16 %at,LOW16U(%imm)"}, @@ -279,19 +282,19 @@ static string_pattern_pair widen_spec_list[] = /* In the end convert to either an l32r or const16. */ {"addmi %ar,%as,%imm | %ar!=%as ? IsaUseL32R", - "LITERAL0 %imm; l32r %ar,%LITERAL0; add %ar,%as,%ar"}, + "LITERAL %imm; l32r %ar,%LITERAL; add %ar,%as,%ar"}, {"addmi %ar,%as,%imm | %ar!=%as ? IsaUseConst16", "const16 %ar,HI16U(%imm); const16 %ar,LOW16U(%imm); add %ar,%as,%ar"}, /* Widening the load instructions with too-large immediates */ {"l8ui %at,%as,%imm | %at!=%as ? IsaUseL32R", - "LITERAL0 %imm; l32r %at,%LITERAL0; add %at,%at,%as; l8ui %at,%at,0"}, + "LITERAL %imm; l32r %at,%LITERAL; add %at,%at,%as; l8ui %at,%at,0"}, {"l16si %at,%as,%imm | %at!=%as ? IsaUseL32R", - "LITERAL0 %imm; l32r %at,%LITERAL0; add %at,%at,%as; l16si %at,%at,0"}, + "LITERAL %imm; l32r %at,%LITERAL; add %at,%at,%as; l16si %at,%at,0"}, {"l16ui %at,%as,%imm | %at!=%as ? IsaUseL32R", - "LITERAL0 %imm; l32r %at,%LITERAL0; add %at,%at,%as; l16ui %at,%at,0"}, + "LITERAL %imm; l32r %at,%LITERAL; add %at,%at,%as; l16ui %at,%at,0"}, {"l32i %at,%as,%imm | %at!=%as ? IsaUseL32R", - "LITERAL0 %imm; l32r %at,%LITERAL0; add %at,%at,%as; l32i %at,%at,0"}, + "LITERAL %imm; l32r %at,%LITERAL; add %at,%at,%as; l32i %at,%at,0"}, /* Widening load instructions with const16s. */ {"l8ui %at,%as,%imm | %at!=%as ? IsaUseConst16", @@ -307,7 +310,7 @@ static string_pattern_pair widen_spec_list[] = hardcoded into its use is a modification of the final operand in the instruction in bytes 9 and 12. */ {"loop %as,%label | %as!=1 ? IsaUseLoops", - "loop %as,%LABEL0;" + "loop %as,%LABEL;" "rsr.lend %as;" /* LEND */ "wsr.lbeg %as;" /* LBEG */ "addi %as, %as, 0;" /* lo8(%label-%LABEL1) */ @@ -316,11 +319,11 @@ static string_pattern_pair widen_spec_list[] = "isync;" "rsr.lcount %as;" /* LCOUNT */ "addi %as, %as, 1;" /* density -> addi.n %as, %as, 1 */ - "LABEL0"}, + "LABEL"}, {"loopgtz %as,%label | %as!=1 ? IsaUseLoops", "beqz %as,%label;" "bltz %as,%label;" - "loopgtz %as,%LABEL0;" + "loopgtz %as,%LABEL;" "rsr.lend %as;" /* LEND */ "wsr.lbeg %as;" /* LBEG */ "addi %as, %as, 0;" /* lo8(%label-%LABEL1) */ @@ -329,10 +332,10 @@ static string_pattern_pair widen_spec_list[] = "isync;" "rsr.lcount %as;" /* LCOUNT */ "addi %as, %as, 1;" /* density -> addi.n %as, %as, 1 */ - "LABEL0"}, + "LABEL"}, {"loopnez %as,%label | %as!=1 ? IsaUseLoops", "beqz %as,%label;" - "loopnez %as,%LABEL0;" + "loopnez %as,%LABEL;" "rsr.lend %as;" /* LEND */ "wsr.lbeg %as;" /* LBEG */ "addi %as, %as, 0;" /* lo8(%label-%LABEL1) */ @@ -341,7 +344,7 @@ static string_pattern_pair widen_spec_list[] = "isync;" "rsr.lcount %as;" /* LCOUNT */ "addi %as, %as, 1;" /* density -> addi.n %as, %as, 1 */ - "LABEL0"}, + "LABEL"}, /* Relaxing to wide branches. Order is important here. With wide branches, there is more than one correct relaxation for an @@ -376,54 +379,81 @@ static string_pattern_pair widen_spec_list[] = /* Widening branch comparisons eq/ne to zero. Prefer relaxing to narrow branches if the density option is available. */ - {"beqz %as,%label ? IsaUseDensityInstruction", "bnez.n %as,%LABEL0;j %label;LABEL0"}, - {"bnez %as,%label ? IsaUseDensityInstruction", "beqz.n %as,%LABEL0;j %label;LABEL0"}, - {"beqz %as,%label", "bnez %as,%LABEL0;j %label;LABEL0"}, - {"bnez %as,%label", "beqz %as,%LABEL0;j %label;LABEL0"}, + {"beqz %as,%label ? IsaUseDensityInstruction", "bnez.n %as,%LABEL;j %label;LABEL"}, + {"bnez %as,%label ? IsaUseDensityInstruction", "beqz.n %as,%LABEL;j %label;LABEL"}, + {"beqz %as,%label", "bnez %as,%LABEL;j %label;LABEL"}, + {"bnez %as,%label", "beqz %as,%LABEL;j %label;LABEL"}, + {"WIDE.beqz %as,%label ? IsaUseDensityInstruction", "bnez.n %as,%LABEL;j %label;LABEL"}, + {"WIDE.bnez %as,%label ? IsaUseDensityInstruction", "beqz.n %as,%LABEL;j %label;LABEL"}, + {"WIDE.beqz %as,%label", "bnez %as,%LABEL;j %label;LABEL"}, + {"WIDE.bnez %as,%label", "beqz %as,%LABEL;j %label;LABEL"}, /* Widening expect-taken branches. */ - {"beqzt %as,%label ? IsaUsePredictedBranches", "bnez %as,%LABEL0;j %label;LABEL0"}, - {"bnezt %as,%label ? IsaUsePredictedBranches", "beqz %as,%LABEL0;j %label;LABEL0"}, - {"beqt %as,%at,%label ? IsaUsePredictedBranches", "bne %as,%at,%LABEL0;j %label;LABEL0"}, - {"bnet %as,%at,%label ? IsaUsePredictedBranches", "beq %as,%at,%LABEL0;j %label;LABEL0"}, + {"beqzt %as,%label ? IsaUsePredictedBranches", "bnez %as,%LABEL;j %label;LABEL"}, + {"bnezt %as,%label ? IsaUsePredictedBranches", "beqz %as,%LABEL;j %label;LABEL"}, + {"beqt %as,%at,%label ? IsaUsePredictedBranches", "bne %as,%at,%LABEL;j %label;LABEL"}, + {"bnet %as,%at,%label ? IsaUsePredictedBranches", "beq %as,%at,%LABEL;j %label;LABEL"}, /* Widening branches from the Xtensa boolean option. */ - {"bt %bs,%label ? IsaUseBooleans", "bf %bs,%LABEL0;j %label;LABEL0"}, - {"bf %bs,%label ? IsaUseBooleans", "bt %bs,%LABEL0;j %label;LABEL0"}, + {"bt %bs,%label ? IsaUseBooleans", "bf %bs,%LABEL;j %label;LABEL"}, + {"bf %bs,%label ? IsaUseBooleans", "bt %bs,%LABEL;j %label;LABEL"}, /* Other branch-around-jump widenings. */ - {"bgez %as,%label", "bltz %as,%LABEL0;j %label;LABEL0"}, - {"bltz %as,%label", "bgez %as,%LABEL0;j %label;LABEL0"}, - {"beqi %as,%imm,%label", "bnei %as,%imm,%LABEL0;j %label;LABEL0"}, - {"bnei %as,%imm,%label", "beqi %as,%imm,%LABEL0;j %label;LABEL0"}, - {"bgei %as,%imm,%label", "blti %as,%imm,%LABEL0;j %label;LABEL0"}, - {"blti %as,%imm,%label", "bgei %as,%imm,%LABEL0;j %label;LABEL0"}, - {"bgeui %as,%imm,%label", "bltui %as,%imm,%LABEL0;j %label;LABEL0"}, - {"bltui %as,%imm,%label", "bgeui %as,%imm,%LABEL0;j %label;LABEL0"}, - {"bbci %as,%imm,%label", "bbsi %as,%imm,%LABEL0;j %label;LABEL0"}, - {"bbsi %as,%imm,%label", "bbci %as,%imm,%LABEL0;j %label;LABEL0"}, - {"beq %as,%at,%label", "bne %as,%at,%LABEL0;j %label;LABEL0"}, - {"bne %as,%at,%label", "beq %as,%at,%LABEL0;j %label;LABEL0"}, - {"bge %as,%at,%label", "blt %as,%at,%LABEL0;j %label;LABEL0"}, - {"blt %as,%at,%label", "bge %as,%at,%LABEL0;j %label;LABEL0"}, - {"bgeu %as,%at,%label", "bltu %as,%at,%LABEL0;j %label;LABEL0"}, - {"bltu %as,%at,%label", "bgeu %as,%at,%LABEL0;j %label;LABEL0"}, - {"bany %as,%at,%label", "bnone %as,%at,%LABEL0;j %label;LABEL0"}, - {"bnone %as,%at,%label", "bany %as,%at,%LABEL0;j %label;LABEL0"}, - {"ball %as,%at,%label", "bnall %as,%at,%LABEL0;j %label;LABEL0"}, - {"bnall %as,%at,%label", "ball %as,%at,%LABEL0;j %label;LABEL0"}, - {"bbc %as,%at,%label", "bbs %as,%at,%LABEL0;j %label;LABEL0"}, - {"bbs %as,%at,%label", "bbc %as,%at,%LABEL0;j %label;LABEL0"}, + {"bgez %as,%label", "bltz %as,%LABEL;j %label;LABEL"}, + {"bltz %as,%label", "bgez %as,%LABEL;j %label;LABEL"}, + {"beqi %as,%imm,%label", "bnei %as,%imm,%LABEL;j %label;LABEL"}, + {"bnei %as,%imm,%label", "beqi %as,%imm,%LABEL;j %label;LABEL"}, + {"bgei %as,%imm,%label", "blti %as,%imm,%LABEL;j %label;LABEL"}, + {"blti %as,%imm,%label", "bgei %as,%imm,%LABEL;j %label;LABEL"}, + {"bgeui %as,%imm,%label", "bltui %as,%imm,%LABEL;j %label;LABEL"}, + {"bltui %as,%imm,%label", "bgeui %as,%imm,%LABEL;j %label;LABEL"}, + {"bbci %as,%imm,%label", "bbsi %as,%imm,%LABEL;j %label;LABEL"}, + {"bbsi %as,%imm,%label", "bbci %as,%imm,%LABEL;j %label;LABEL"}, + {"beq %as,%at,%label", "bne %as,%at,%LABEL;j %label;LABEL"}, + {"bne %as,%at,%label", "beq %as,%at,%LABEL;j %label;LABEL"}, + {"bge %as,%at,%label", "blt %as,%at,%LABEL;j %label;LABEL"}, + {"blt %as,%at,%label", "bge %as,%at,%LABEL;j %label;LABEL"}, + {"bgeu %as,%at,%label", "bltu %as,%at,%LABEL;j %label;LABEL"}, + {"bltu %as,%at,%label", "bgeu %as,%at,%LABEL;j %label;LABEL"}, + {"bany %as,%at,%label", "bnone %as,%at,%LABEL;j %label;LABEL"}, + {"bnone %as,%at,%label", "bany %as,%at,%LABEL;j %label;LABEL"}, + {"ball %as,%at,%label", "bnall %as,%at,%LABEL;j %label;LABEL"}, + {"bnall %as,%at,%label", "ball %as,%at,%LABEL;j %label;LABEL"}, + {"bbc %as,%at,%label", "bbs %as,%at,%LABEL;j %label;LABEL"}, + {"bbs %as,%at,%label", "bbc %as,%at,%LABEL;j %label;LABEL"}, + + {"WIDE.bgez %as,%label", "bltz %as,%LABEL;j %label;LABEL"}, + {"WIDE.bltz %as,%label", "bgez %as,%LABEL;j %label;LABEL"}, + {"WIDE.beqi %as,%imm,%label", "bnei %as,%imm,%LABEL;j %label;LABEL"}, + {"WIDE.bnei %as,%imm,%label", "beqi %as,%imm,%LABEL;j %label;LABEL"}, + {"WIDE.bgei %as,%imm,%label", "blti %as,%imm,%LABEL;j %label;LABEL"}, + {"WIDE.blti %as,%imm,%label", "bgei %as,%imm,%LABEL;j %label;LABEL"}, + {"WIDE.bgeui %as,%imm,%label", "bltui %as,%imm,%LABEL;j %label;LABEL"}, + {"WIDE.bltui %as,%imm,%label", "bgeui %as,%imm,%LABEL;j %label;LABEL"}, + {"WIDE.bbci %as,%imm,%label", "bbsi %as,%imm,%LABEL;j %label;LABEL"}, + {"WIDE.bbsi %as,%imm,%label", "bbci %as,%imm,%LABEL;j %label;LABEL"}, + {"WIDE.beq %as,%at,%label", "bne %as,%at,%LABEL;j %label;LABEL"}, + {"WIDE.bne %as,%at,%label", "beq %as,%at,%LABEL;j %label;LABEL"}, + {"WIDE.bge %as,%at,%label", "blt %as,%at,%LABEL;j %label;LABEL"}, + {"WIDE.blt %as,%at,%label", "bge %as,%at,%LABEL;j %label;LABEL"}, + {"WIDE.bgeu %as,%at,%label", "bltu %as,%at,%LABEL;j %label;LABEL"}, + {"WIDE.bltu %as,%at,%label", "bgeu %as,%at,%LABEL;j %label;LABEL"}, + {"WIDE.bany %as,%at,%label", "bnone %as,%at,%LABEL;j %label;LABEL"}, + {"WIDE.bnone %as,%at,%label", "bany %as,%at,%LABEL;j %label;LABEL"}, + {"WIDE.ball %as,%at,%label", "bnall %as,%at,%LABEL;j %label;LABEL"}, + {"WIDE.bnall %as,%at,%label", "ball %as,%at,%LABEL;j %label;LABEL"}, + {"WIDE.bbc %as,%at,%label", "bbs %as,%at,%LABEL;j %label;LABEL"}, + {"WIDE.bbs %as,%at,%label", "bbc %as,%at,%LABEL;j %label;LABEL"}, /* Expanding calls with literals. */ {"call0 %label,%ar0 ? IsaUseL32R", - "LITERAL0 %label; l32r a0,%LITERAL0; callx0 a0,%ar0"}, + "LITERAL %label; l32r a0,%LITERAL; callx0 a0,%ar0"}, {"call4 %label,%ar4 ? IsaUseL32R", - "LITERAL0 %label; l32r a4,%LITERAL0; callx4 a4,%ar4"}, + "LITERAL %label; l32r a4,%LITERAL; callx4 a4,%ar4"}, {"call8 %label,%ar8 ? IsaUseL32R", - "LITERAL0 %label; l32r a8,%LITERAL0; callx8 a8,%ar8"}, + "LITERAL %label; l32r a8,%LITERAL; callx8 a8,%ar8"}, {"call12 %label,%ar12 ? IsaUseL32R", - "LITERAL0 %label; l32r a12,%LITERAL0; callx12 a12,%ar12"}, + "LITERAL %label; l32r a12,%LITERAL; callx12 a12,%ar12"}, /* Expanding calls with const16. */ {"call0 %label,%ar0 ? IsaUseConst16", @@ -615,26 +645,26 @@ append_op (BuildInstr *bi, BuildOp *b_op) static void -append_literal_op (BuildInstr *bi, unsigned op1, unsigned litnum) +append_literal_op (BuildInstr *bi, unsigned op1) { BuildOp *b_op = (BuildOp *) xmalloc (sizeof (BuildOp)); b_op->op_num = op1; b_op->typ = OP_LITERAL; - b_op->op_data = litnum; + b_op->op_data = 0; b_op->next = NULL; append_op (bi, b_op); } static void -append_label_op (BuildInstr *bi, unsigned op1, unsigned labnum) +append_label_op (BuildInstr *bi, unsigned op1) { BuildOp *b_op = (BuildOp *) xmalloc (sizeof (BuildOp)); b_op->op_num = op1; b_op->typ = OP_LABEL; - b_op->op_data = labnum; + b_op->op_data = 0; b_op->next = NULL; append_op (bi, b_op); } @@ -982,30 +1012,6 @@ parse_constant (const char *in, unsigned *val_p) } -/* Match a pattern like "foo1" with - parse_id_constant("foo1", "foo", &num). - This may also be used to just match a number. */ - -static bfd_boolean -parse_id_constant (const char *in, const char *name, unsigned *val_p) -{ - unsigned namelen = 0; - const char *p; - - if (in == NULL) - return FALSE; - - if (name != NULL) - namelen = strlen (name); - - if (name != NULL && strncmp (in, name, namelen) != 0) - return FALSE; - - p = &in[namelen]; - return parse_constant (p, val_p); -} - - static bfd_boolean parse_special_fn (const char *name, const char **fn_name_p, @@ -1594,12 +1600,11 @@ build_transition (insn_pattern *initial_insn, precond_e *precond; insn_repl_e *r; - unsigned label_count = 0; - unsigned max_label_count = 0; - bfd_boolean has_label = FALSE; - unsigned literal_count = 0; - opcode = xtensa_opcode_lookup (isa, initial_insn->t.opcode_name); + if (!wide_branch_opcode (initial_insn->t.opcode_name, ".w18", &opcode) + && !wide_branch_opcode (initial_insn->t.opcode_name, ".w15", &opcode)) + opcode = xtensa_opcode_lookup (isa, initial_insn->t.opcode_name); + if (opcode == XTENSA_UNDEFINED) { /* It is OK to not be able to translate some of these opcodes. */ @@ -1661,35 +1666,26 @@ build_transition (insn_pattern *initial_insn, { op1 = get_opmatch (&initial_insn->t.operand_map, precond->opname1); if (op1 == NULL) - { - as_fatal (_("opcode '%s': no bound opname '%s' " - "for precondition in '%s'"), - xtensa_opcode_name (isa, opcode), - precond->opname1, from_string); - return NULL; - } + as_fatal (_("opcode '%s': no bound opname '%s' " + "for precondition in '%s'"), + xtensa_opcode_name (isa, opcode), + precond->opname1, from_string); } if (precond->opname2) { op2 = get_opmatch (&initial_insn->t.operand_map, precond->opname2); if (op2 == NULL) - { - as_fatal (_("opcode '%s': no bound opname '%s' " - "for precondition in %s"), - xtensa_opcode_name (isa, opcode), - precond->opname2, from_string); - return NULL; - } + as_fatal (_("opcode '%s': no bound opname '%s' " + "for precondition in %s"), + xtensa_opcode_name (isa, opcode), + precond->opname2, from_string); } if (op1 == NULL && op2 == NULL) - { - as_fatal (_("opcode '%s': precondition only contains " - "constants in '%s'"), - xtensa_opcode_name (isa, opcode), from_string); - return NULL; - } + as_fatal (_("opcode '%s': precondition only contains " + "constants in '%s'"), + xtensa_opcode_name (isa, opcode), from_string); else if (op1 != NULL && op2 != NULL) append_value_condition (tr, precond->cmpop, op1->operand_num, op2->operand_num); @@ -1704,12 +1700,11 @@ build_transition (insn_pattern *initial_insn, tr->options = clone_req_option_list (initial_insn->options); /* Generate the replacement instructions. Some of these - "instructions" are actually labels and literals. The literals - must be defined in order 0..n and a literal must be defined - (e.g., "LITERAL0 %imm") before use (e.g., "%LITERAL0"). The - labels must be defined in order, but they can be used before they - are defined. Also there are a number of special operands (e.g., - HI24S). */ + "instructions" are actually labels and literals. There can be at + most one literal and at most one label. A literal must be defined + (e.g., "LITERAL %imm") before use (e.g., "%LITERAL"). The labels + can be used before they are defined. Also there are a number of + special operands (e.g., HI24S). */ for (r = replace_insns->head; r != NULL; r = r->next) { @@ -1717,14 +1712,12 @@ build_transition (insn_pattern *initial_insn, const char *opcode_name; int operand_count; opname_map_e *op; - unsigned idnum = 0; const char *fn_name; const char *operand_arg_name; bi = (BuildInstr *) xmalloc (sizeof (BuildInstr)); append_build_insn (tr, bi); - bi->id = 0; bi->opcode = XTENSA_UNDEFINED; bi->ops = NULL; bi->next = NULL; @@ -1732,24 +1725,15 @@ build_transition (insn_pattern *initial_insn, opcode_name = r->t.opcode_name; operand_count = insn_templ_operand_count (&r->t); - if (parse_id_constant (opcode_name, "LITERAL", &idnum)) + if (strcmp (opcode_name, "LITERAL") == 0) { bi->typ = INSTR_LITERAL_DEF; - bi->id = idnum; - if (idnum != literal_count) - as_fatal (_("generated literals must be numbered consecutively")); - ++literal_count; if (operand_count != 1) as_fatal (_("expected one operand for generated literal")); - } - else if (parse_id_constant (opcode_name, "LABEL", &idnum)) + else if (strcmp (opcode_name, "LABEL") == 0) { bi->typ = INSTR_LABEL_DEF; - bi->id = idnum; - if (idnum != label_count) - as_fatal (_("generated labels must be numbered consecutively")); - ++label_count; if (operand_count != 0) as_fatal (_("expected 0 operands for generated label")); } @@ -1783,22 +1767,12 @@ build_transition (insn_pattern *initial_insn, if (op_is_constant (op)) append_constant_op (bi, op->operand_num, op_get_constant (op)); - else if (parse_id_constant (op->operand_name, "%LITERAL", &idnum)) - { - if (idnum >= literal_count) - as_fatal (_("opcode %s: replacement " - "literal %d >= literal_count(%d)"), - opcode_name, idnum, literal_count); - append_literal_op (bi, op->operand_num, idnum); - } - else if (parse_id_constant (op->operand_name, "%LABEL", &idnum)) - { - has_label = TRUE; - if (idnum > max_label_count) - max_label_count = idnum; - append_label_op (bi, op->operand_num, idnum); - } - else if (parse_id_constant (op->operand_name, "a", &idnum)) + else if (strcmp (op->operand_name, "%LITERAL") == 0) + append_literal_op (bi, op->operand_num); + else if (strcmp (op->operand_name, "%LABEL") == 0) + append_label_op (bi, op->operand_num); + else if (op->operand_name[0] == 'a' + && parse_constant (op->operand_name + 1, &idnum)) append_constant_op (bi, op->operand_num, idnum); else if (op->operand_name[0] == '%') { @@ -1806,14 +1780,9 @@ build_transition (insn_pattern *initial_insn, orig_op = get_opmatch (&initial_insn->t.operand_map, op->operand_name); if (orig_op == NULL) - { - as_fatal (_("opcode %s: unidentified operand '%s' in '%s'"), - opcode_name, op->operand_name, to_string); - - append_constant_op (bi, op->operand_num, 0); - } - else - append_field_op (bi, op->operand_num, orig_op->operand_num); + as_fatal (_("opcode %s: unidentified operand '%s' in '%s'"), + opcode_name, op->operand_name, to_string); + append_field_op (bi, op->operand_num, orig_op->operand_num); } else if (parse_special_fn (op->operand_name, &fn_name, &operand_arg_name)) @@ -1837,30 +1806,16 @@ build_transition (insn_pattern *initial_insn, orig_op = get_opmatch (&initial_insn->t.operand_map, operand_arg_name); if (orig_op == NULL) - { - as_fatal (_("opcode %s: unidentified operand '%s' in '%s'"), - opcode_name, op->operand_name, to_string); - append_constant_op (bi, op->operand_num, 0); - } - else - append_user_fn_field_op (bi, op->operand_num, - typ, orig_op->operand_num); + as_fatal (_("opcode %s: unidentified operand '%s' in '%s'"), + opcode_name, op->operand_name, to_string); + append_user_fn_field_op (bi, op->operand_num, + typ, orig_op->operand_num); } else - { - as_fatal (_("opcode %s: could not parse operand '%s' in '%s'"), - opcode_name, op->operand_name, to_string); - append_constant_op (bi, op->operand_num, 0); - } + as_fatal (_("opcode %s: could not parse operand '%s' in '%s'"), + opcode_name, op->operand_name, to_string); } } - if (has_label && max_label_count >= label_count) - { - as_fatal (_("opcode %s: replacement label %d >= label_count(%d)"), - xtensa_opcode_name (isa, opcode), - max_label_count, label_count); - return NULL; - } return tr; } @@ -1898,20 +1853,11 @@ build_transition_table (const string_pattern_pair *transitions, init_insn_pattern (&initial_insn); if (!parse_insn_pattern (from_string, &initial_insn)) - { - as_fatal (_("could not parse INSN_PATTERN '%s'"), from_string); - clear_insn_pattern (&initial_insn); - continue; - } + as_fatal (_("could not parse INSN_PATTERN '%s'"), from_string); init_insn_repl (&replace_insns); if (!parse_insn_repl (to_string, &replace_insns)) - { - as_fatal (_("could not parse INSN_REPL '%s'"), to_string); - clear_insn_pattern (&initial_insn); - clear_insn_repl (&replace_insns); - continue; - } + as_fatal (_("could not parse INSN_REPL '%s'"), to_string); if (transition_applies (&initial_insn, from_string, to_string)) { diff --git a/gas/config/xtensa-relax.h b/gas/config/xtensa-relax.h index 6ae11e379ce..fa1abb07020 100644 --- a/gas/config/xtensa-relax.h +++ b/gas/config/xtensa-relax.h @@ -1,5 +1,5 @@ /* Table of relaxations for Xtensa assembly. - Copyright 2003, 2004 Free Software Foundation, Inc. + Copyright 2003, 2004, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -135,10 +135,7 @@ struct build_op OPERAND: op_data is the field in the source instruction to take the value from and encode in the op_num field here. - LITERAL or LABEL: op_data is the ordinal - that identifies the appropriate one, i.e., - there can be more than one literal or - label in an expansion. */ + LITERAL or LABEL: unused. */ BuildOp *next; }; @@ -155,8 +152,6 @@ enum instr_type struct build_instr { InstrType typ; - unsigned id; /* LITERAL_DEF or LABEL_DEF: an ordinal to - identify which one. */ xtensa_opcode opcode; /* Unused for LITERAL_DEF or LABEL_DEF. */ BuildOp *ops; BuildInstr *next; diff --git a/gas/configure b/gas/configure index dca6497031c..d2cc2e704e0 100755 --- a/gas/configure +++ b/gas/configure @@ -241,6 +241,155 @@ IFS=" $as_nl" $as_unset CDPATH + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +$* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. @@ -309,7 +458,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S RANLIB ac_ct_RANLIB LIBTOOL WARN_CFLAGS NO_WERROR GDBINIT cgen_cpu_prefix extra_objects target_cpu_type obj_format te_file install_tooldir atof BFDLIB OPCODES_LIB BFDVER_H ALL_OBJ_DEPS YACC LEX LEXLIB LEX_OUTPUT_ROOT CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBM datarootdir docdir htmldir LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LIBTOOL SED EGREP FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S AR ac_ct_AR RANLIB ac_ct_RANLIB lt_ECHO CPP WARN_CFLAGS NO_WERROR GDBINIT cgen_cpu_prefix extra_objects target_cpu_type obj_format te_file install_tooldir atof OPCODES_LIB YACC LEX LEXLIB LEX_OUTPUT_ROOT USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT MKINSTALLDIRS MSGFMT MSGMERGE MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT GENINSRC_NEVER_TRUE GENINSRC_NEVER_FALSE ALLOCA LIBM datarootdir docdir htmldir LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -852,14 +1001,18 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors - --enable-shared=PKGS build shared libraries default=yes - --enable-static=PKGS build static libraries default=yes - --enable-fast-install=PKGS optimize for fast installation default=yes + --enable-shared[=PKGS] + build shared libraries [default=yes] + --enable-static[=PKGS] + build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) - --enable-targets alternative target configurations besides the primary + --enable-targets alternative target configurations besides the primary --enable-commonbfdlib build shared BFD/opcodes/libiberty library - --enable-werror treat compile warnings as errors - --enable-build-warnings Enable build-time compiler warnings + --enable-checking enable run-time checks + --enable-werror treat compile warnings as errors + --enable-build-warnings enable build-time compiler warnings --disable-nls do not use Native Language Support --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer @@ -867,9 +1020,9 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-gnu-ld assume the C compiler uses GNU ld default=no - --with-pic try to use only PIC/non-PIC objects default=use both - --with-included-gettext use the GNU gettext library included here + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] Some influential environment variables: CC C compiler command @@ -3072,73 +3225,264 @@ fi + + +macro_version='2.1a' +macro_revision='1.2435' + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Set options + +enable_dlopen=no + + +enable_win32_dll=no + + # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} -case $enableval in -yes) enable_shared=yes ;; -no) enable_shared=no ;; -*) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac else enable_shared=yes fi; + + + + + + + + # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} -case $enableval in -yes) enable_static=yes ;; -no) enable_static=no ;; -*) - enable_static=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac else enable_static=yes fi; + + + + + + + + + +# Check whether --with-pic or --without-pic was given. +if test "${with_pic+set}" = set; then + withval="$with_pic" + pic_mode="$withval" +else + pic_mode=default +fi; + +test -z "$pic_mode" && pic_mode=default + + + + + + + # Check whether --enable-fast-install or --disable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" p=${PACKAGE-default} -case $enableval in -yes) enable_fast_install=yes ;; -no) enable_fast_install=no ;; -*) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac else enable_fast_install=yes fi; + + + + + + + +echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done + +fi + +SED=$lt_cv_path_SED + +echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6 + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +echo "$as_me:$LINENO: checking for fgrep" >&5 +echo $ECHO_N "checking for fgrep... $ECHO_C" >&6 +if test "${ac_cv_prog_fgrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo 'ab*c' | (grep -F 'ab*c') >/dev/null 2>&1 + then ac_cv_prog_fgrep='grep -F' + else ac_cv_prog_fgrep='fgrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_fgrep" >&5 +echo "${ECHO_T}$ac_cv_prog_fgrep" >&6 + FGREP=$ac_cv_prog_fgrep + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" @@ -3149,8 +3493,8 @@ fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by GCC" >&5 -echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 + echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -3160,12 +3504,12 @@ echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 esac case $ac_prog in # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) + [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; @@ -3189,22 +3533,26 @@ if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do + IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. + # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. - if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + case `"$lt_cv_path_LD" -v 2>&1 &6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld -echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 -echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 -if test "${lt_cv_ld_reload_flag+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_ld_reload_flag='-r' -fi -echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 -reload_flag=$lt_cv_ld_reload_flag -test -n "$reload_flag" && reload_flag=" $reload_flag" -echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 -echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 + + + + + + + +echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5 +echo $ECHO_N "checking for BSD- or MS-compatible name lister (nm)... $ECHO_C" >&6 if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3259,35 +3606,173 @@ else # Let the user override the test. lt_cv_path_NM="$NM" else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/${ac_tool_prefix}nm - if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then - lt_cv_path_NM="$tmp_nm -B" - break - elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - lt_cv_path_NM="$tmp_nm -p" - break - else - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac fi - fi + done + IFS="$lt_save_ifs" done - IFS="$ac_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm + : ${lt_cv_path_NM=no} fi +fi +echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6 +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$ac_tool_prefix"; then + for ac_prog in "dumpbin -symbols" "link -dump -symbols" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_DUMPBIN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + echo "$as_me:$LINENO: result: $DUMPBIN" >&5 +echo "${ECHO_T}$DUMPBIN" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -NM="$lt_cv_path_NM" -echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6 + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in "dumpbin -symbols" "link -dump -symbols" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 +echo "${ECHO_T}$ac_ct_DUMPBIN" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_DUMPBIN" && break +done +test -n "$ac_ct_DUMPBIN" || ac_ct_DUMPBIN=":" + + DUMPBIN=$ac_ct_DUMPBIN +fi + + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 +echo $ECHO_N "checking the name lister ($NM) interface... $ECHO_C" >&6 +if test "${lt_cv_nm_interface+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:3761: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:3764: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:3767: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 +echo "${ECHO_T}$lt_cv_nm_interface" >&6 echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 @@ -3300,179 +3785,6 @@ else echo "${ECHO_T}no, using $LN_S" >&6 fi -echo "$as_me:$LINENO: checking how to recognise dependant libraries" >&5 -echo $ECHO_N "checking how to recognise dependant libraries... $ECHO_C" >&6 -if test "${lt_cv_deplibs_check_method+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [regex]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given egrep regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi4*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin* | mingw* |pw32*) - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - # this will be overwritten by pass_all, but leave it in just in case - lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' - lt_cv_file_magic_cmd='/usr/bin/file -L' - case "$host_os" in - rhapsody* | darwin1.012) - lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System' - ;; - *) # Darwin 1.3 on - lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' - ;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | kfreebsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20*|hpux11*) - case $host_cpu in - hppa*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - esac - ;; - -irix5* | irix6*) - case $host_os in - irix5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" - ;; - *) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" - ;; - esac - lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux-gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$' - fi - ;; - -newsos6) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -osf3* | osf4* | osf5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' - lt_cv_file_magic_test_file=/shlib/libc.so - lt_cv_deplibs_check_method=pass_all - ;; - -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - lt_cv_file_magic_test_file=/lib/libc.so - ;; - -sysv5uw[78]* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - esac - ;; -esac - -fi -echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method - - - - -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! - # find the maximum length of command line arguments echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 @@ -3491,6 +3803,13 @@ else lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. @@ -3515,174 +3834,400 @@ else elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else - lt_cv_sys_max_cmd_len=65536 # usable default for *BSD + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`getconf ARG_MAX 2> /dev/null` + if test -n $lt_cv_sys_max_cmd_len; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; esac fi -if test -n "$lt_cv_sys_max_cmd_len" ; then +if test -n $lt_cv_sys_max_cmd_len ; then echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 else echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 fi +max_cmd_len=$lt_cv_sys_max_cmd_len -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 +echo $ECHO_N "checking whether the shell understands some XSI constructs... $ECHO_C" >&6 +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, ) >/dev/null 2>&1 \ + && xsi_shell=yes +echo "$as_me:$LINENO: result: $xsi_shell" >&5 +echo "${ECHO_T}$xsi_shell" >&6 + + +echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 +echo $ECHO_N "checking whether the shell understands \"+=\"... $ECHO_C" >&6 +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +echo "$as_me:$LINENO: result: $lt_shell_append" >&5 +echo "${ECHO_T}$lt_shell_append" >&6 + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset else - case $MAGIC_CMD in - /*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; - ?:/*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. - ;; - *) - ac_save_MAGIC_CMD="$MAGIC_CMD" - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="/usr/bin:$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then - : - else - cat <&2 + lt_unset=false +fi -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org -EOF - fi ;; - esac - fi - break - fi - done - IFS="$ac_save_ifs" - MAGIC_CMD="$ac_save_MAGIC_CMD" + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' ;; esac -fi -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - echo "$as_me:$LINENO: checking for file" >&5 -echo $ECHO_N "checking for file... $ECHO_C" >&6 -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + + + + + + + +echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 +if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $MAGIC_CMD in - /*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; - ?:/*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. - ;; - *) - ac_save_MAGIC_CMD="$MAGIC_CMD" - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="/usr/bin:$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$ac_save_ifs" - MAGIC_CMD="$ac_save_MAGIC_CMD" - ;; + lt_cv_ld_reload_flag='-r' +fi +echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; esac -fi -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 + + + + + + + + + +echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 +echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6 +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' else - MAGIC_CMD=: - fi -fi - + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; esac +fi +echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_RANLIB+set}" = set; then +if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -3691,7 +4236,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -3700,27 +4245,27 @@ done fi fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -3729,30 +4274,43 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" + ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" + test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" fi fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi - RANLIB=$ac_ct_RANLIB + AR=$ac_ct_AR else - RANLIB="$ac_cv_prog_RANLIB" + AR="$ac_cv_prog_AR" fi +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru + + + + + + + + + + + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 @@ -3833,14 +4391,401 @@ else STRIP="$ac_cv_prog_STRIP" fi +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6 +else + echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6 +fi + + + + + + + + + + + + + + -# Check for any special flags to pass to ltconfig. -libtool_flags="--cache-file=$cache_file" -test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" -test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" -test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" -test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc" -test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" # Check whether --enable-libtool-lock or --disable-libtool-lock was given. @@ -3848,60 +4793,11 @@ if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; -test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" -test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" - - -# Check whether --with-pic or --without-pic was given. -if test "${with_pic+set}" = set; then - withval="$with_pic" - pic_mode="$withval" -else - pic_mode=default -fi; -test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic" -test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in -*-*-irix6*) - # Find out which ABI we are using. - echo '#line 3870 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext @@ -3910,19 +4806,56 @@ ia64-*-hpux*) ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - case "`/usr/bin/file conftest.o`" in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; esac fi rm -rf conftest* ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 4822 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -3930,39 +4863,45 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - case "`/usr/bin/file conftest.o`" in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; esac fi rm -rf conftest* @@ -3977,9 +4916,7 @@ echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - - - ac_ext=c + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -4045,108 +4982,571 @@ echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 CFLAGS="$SAVE_CFLAGS" fi ;; - - -esac - - -# Save cache, so that ltconfig can load it -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -{ - (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} | - sed ' - t clear - : clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -# Actually configure libtool. ac_aux_dir is where install-sh is found. -AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ -MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ -LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \ -AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \ -objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \ -deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \ -${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ -$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \ -|| { { echo "$as_me:$LINENO: error: libtool configure failed" >&5 -echo "$as_me: error: libtool configure failed" >&2;} - { (exit 1); exit 1; }; } - -# Reload cache, that may have been modified by ltconfig -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; esac fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_header in dlfcn.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + # This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh" +LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' -# Redirect the config.log output again, so that the ltconfig log is not -# clobbered by the next message. -exec 5>>./config.log @@ -4154,6 +5554,3982 @@ exec 5>>./config.log + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6 +if test "${lt_cv_objdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$lt_cv_objdir" >&6 +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + + + + + + + + + + + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:5922: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:5926: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + if test "$host_cpu" = m68k; then + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + fi + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic='-qnocommon' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6 + + + + + + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:6244: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:6248: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 + +if test x"$lt_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works=yes + fi + else + lt_prog_compiler_static_works=yes + fi + fi + $RM conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 + +if test x"$lt_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:6349: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:6353: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 + + + + + + + echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:6404: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:6408: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +_LT_EOF + fi + ;; + + amigaos*) + if test "$host_cpu" = m68k; then + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + fi + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + *) + tmp_sharedflag='-shared' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + if test "$host_cpu" = m68k; then + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + fi + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[012]) + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + ;; + esac + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + if test "$GCC" = yes ; then + if test "${lt_cv_apple_cc_single_mod+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi-module to the + # link flags. + echo "int foo(void){return 1;}" > conftest.c + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib ${wl}-single_module conftest.c + if test -f libconftest.dylib; then + lt_cv_apple_cc_single_mod=yes + rm libconftest.dylib + fi + rm conftest.$ac_ext + fi +fi + + output_verbose_link_cmd=echo + if test "X$lt_cv_apple_cc_single_mod" = Xyes ; then + archive_cmds='$CC -dynamiclib $single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + archive_expsym_cmds='sed "s,^,_," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $single_module -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + archive_expsym_cmds='sed "s,^,_," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + module_expsym_cmds='sed -e "s,^,_," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd=echo + archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`$ECHO $rpath/$soname` $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed "s,^,_," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed "s,^,_," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat >conftest.$ac_ext <<_ACEOF +int foo(void) {} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6 +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6 + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +withGCC=$GCC +if test "$withGCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + if test "$host_cpu" = m68k; then + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + else + dynamic_linker=no + fi + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $withGCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[3-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir"; then + shlibpath_overrides_runpath=yes +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$hardcode_action" >&6 + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shl_load) || defined (__stub___shl_load) +choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dlopen) || defined (__stub___dlopen) +choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main () +{ +dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line 9201 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +_LT_EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line 9301 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +_LT_EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 + + echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 + + echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6 + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + # Check whether --enable-targets or --disable-targets was given. if test "${enable_targets+set}" = set; then enableval="$enable_targets" @@ -4165,7 +9541,8 @@ echo "$as_me: error: enable-targets option must specify target names or 'all'" > no) enable_targets= ;; *) enable_targets=$enableval ;; esac -fi; # Check whether --enable-commonbfdlib or --disable-commonbfdlib was given. +fi; +# Check whether --enable-commonbfdlib or --disable-commonbfdlib was given. if test "${enable_commonbfdlib+set}" = set; then enableval="$enable_commonbfdlib" case "${enableval}" in @@ -4176,6 +9553,25 @@ echo "$as_me: error: bad value ${enableval} for BFD commonbfdlib option" >&2;} { (exit 1); exit 1; }; } ;; esac fi; +ac_checking=yes +if grep '^RELEASE=y' ${srcdir}/../bfd/Makefile.am >/dev/null 2>/dev/null ; then + ac_checking= +fi +# Check whether --enable-checking or --disable-checking was given. +if test "${enable_checking+set}" = set; then + enableval="$enable_checking" + case "${enableval}" in + no|none) ac_checking= ;; + *) ac_checking=yes ;; +esac +fi; if test x$ac_checking != x ; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_CHECKING 1 +_ACEOF + +fi + using_cgen=no @@ -4733,7 +10129,7 @@ _ACEOF # Do we need the opcodes library? case ${cpu_type} in - vax | i386 | tic30) + vax | tic30) ;; *) @@ -4779,6 +10175,10 @@ _ACEOF esac ;; + mep) + using_cgen=yes + ;; + mips) echo ${extra_objects} | grep -s "itbl-parse.o" if test $? -ne 0 ; then @@ -4896,6 +10296,19 @@ if test ${all_targets} = "yes"; then ;; esac ;; + x86_64) + case ${obj_format} in + aout) + emulations="$emulations i386coff i386elf" + ;; + coff) + emulations="$emulations i386aout i386elf" + ;; + elf) + emulations="$emulations i386aout i386coff" + ;; + esac + ;; esac fi @@ -4903,8 +10316,7 @@ fi # IEEE FP. On those that don't support FP at all, usually IEEE # is emulated. case ${target_cpu} in - vax | tahoe ) atof=${target_cpu} ;; - pdp11) atof=vax ;; + vax | pdp11 ) atof=vax ;; *) atof=ieee ;; esac @@ -4958,6 +10370,11 @@ _ACEOF m88k) cat >>confdefs.h <<\_ACEOF #define M88KCOFF 1 +_ACEOF + ;; + x86_64) +cat >>confdefs.h <<\_ACEOF +#define I386COFF 1 _ACEOF ;; esac @@ -5069,11 +10486,6 @@ cat >>confdefs.h <<\_ACEOF #define OBJ_MAYBE_GENERIC 1 _ACEOF ;; - ieee) -cat >>confdefs.h <<\_ACEOF -#define OBJ_MAYBE_IEEE 1 -_ACEOF - ;; som) cat >>confdefs.h <<\_ACEOF #define OBJ_MAYBE_SOM 1 @@ -5134,14 +10546,6 @@ yes) ;; esac -BFDLIB=../bfd/libbfd.la -BFDVER_H=../bfd/bfdver.h -ALL_OBJ_DEPS="$ALL_OBJ_DEPS"' ../bfd/bfd.h $(INCDIR)/symcat.h' - - - - - @@ -6220,2479 +11624,138 @@ if test "$LEX" = :; then fi ALL_LINGUAS="fr tr es rw" -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - RANLIB=$ac_ct_RANLIB -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep - - -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 -if test "${ac_cv_c_const+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset x; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *ccp; - char **p; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - ccp = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++ccp; - p = (char**) ccp; - ccp = (char const *const *) p; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - } -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_const=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_c_const=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6 -if test $ac_cv_c_const = no; then - -cat >>confdefs.h <<\_ACEOF -#define const -_ACEOF - -fi - -echo "$as_me:$LINENO: checking for inline" >&5 -echo $ECHO_N "checking for inline... $ECHO_C" >&6 -if test "${ac_cv_c_inline+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif - -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_inline=$ac_kw; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done - -fi -echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 -echo "${ECHO_T}$ac_cv_c_inline" >&6 - - -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6 -if test "${ac_cv_type_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((off_t *) 0) - return 0; -if (sizeof (off_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_off_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_off_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6 -if test $ac_cv_type_off_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define off_t long -_ACEOF - -fi - -echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6 -if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((size_t *) 0) - return 0; -if (sizeof (size_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_size_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_size_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6 -if test $ac_cv_type_size_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned -_ACEOF - -fi - -# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works -# for constant arguments. Useless! -echo "$as_me:$LINENO: checking for working alloca.h" >&5 -echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 -if test "${ac_cv_working_alloca_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -char *p = (char *) alloca (2 * sizeof (int)); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_working_alloca_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_working_alloca_h=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 -echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 -if test $ac_cv_working_alloca_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA_H 1 -_ACEOF - -fi - -echo "$as_me:$LINENO: checking for alloca" >&5 -echo $ECHO_N "checking for alloca... $ECHO_C" >&6 -if test "${ac_cv_func_alloca_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER -# include -# define alloca _alloca -# else -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -# endif -#endif - -int -main () -{ -char *p = (char *) alloca (1); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_alloca_works=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_alloca_works=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 -echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 - -if test $ac_cv_func_alloca_works = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA 1 -_ACEOF - -else - # The SVR3 libPW and SVR4 libucb both contain incompatible functions -# that cause trouble. Some versions do not even contain alloca or -# contain a buggy version. If you still want to use their alloca, -# use ar to extract alloca.o from them instead of compiling alloca.c. - -ALLOCA=alloca.$ac_objext - -cat >>confdefs.h <<\_ACEOF -#define C_ALLOCA 1 -_ACEOF - - -echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 -echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 -if test "${ac_cv_os_cray+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if defined(CRAY) && ! defined(CRAY2) -webecray -#else -wenotbecray -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then - ac_cv_os_cray=yes -else - ac_cv_os_cray=no -fi -rm -f conftest* - -fi -echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 -echo "${ECHO_T}$ac_cv_os_cray" >&6 -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - -cat >>confdefs.h <<_ACEOF -#define CRAY_STACKSEG_END $ac_func -_ACEOF - - break -fi - - done -fi - -echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 -echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 -if test "${ac_cv_c_stack_direction+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_c_stack_direction=0 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -find_stack_direction () -{ - static char *addr = 0; - auto char dummy; - if (addr == 0) - { - addr = &dummy; - return find_stack_direction (); - } - else - return (&dummy > addr) ? 1 : -1; -} - -int -main () -{ - exit (find_stack_direction () < 0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_stack_direction=1 -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_stack_direction=-1 -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 -echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 - -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -_ACEOF - - -fi - - - -for ac_header in stdlib.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_func in getpagesize -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -echo "$as_me:$LINENO: checking for working mmap" >&5 -echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 -if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_mmap_fixed_mapped=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -/* malloc might have been renamed as rpl_malloc. */ -#undef malloc - -/* Thanks to Mike Haertel and Jim Avera for this test. - Here is a matrix of mmap possibilities: - mmap private not fixed - mmap private fixed at somewhere currently unmapped - mmap private fixed at somewhere already mapped - mmap shared not fixed - mmap shared fixed at somewhere currently unmapped - mmap shared fixed at somewhere already mapped - For private mappings, we should verify that changes cannot be read() - back from the file, nor mmap's back from the file at a different - address. (There have been systems where private was not correctly - implemented like the infamous i386 svr4.0, and systems where the - VM page cache was not coherent with the file system buffer cache - like early versions of FreeBSD and possibly contemporary NetBSD.) - For shared mappings, we should conversely verify that changes get - propagated back to all the places they're supposed to be. - - Grep wants private fixed already mapped. - The main things grep needs to know about mmap are: - * does it exist and is it safe to write into the mmap'd area - * how to use it (BSD variants) */ - -#include -#include - -#if !STDC_HEADERS && !HAVE_STDLIB_H -char *malloc (); -#endif - -/* This mess was copied from the GNU getpagesize.h. */ -#if !HAVE_GETPAGESIZE -/* Assume that all systems that can run configure have sys/param.h. */ -# if !HAVE_SYS_PARAM_H -# define HAVE_SYS_PARAM_H 1 -# endif - -# ifdef _SC_PAGESIZE -# define getpagesize() sysconf(_SC_PAGESIZE) -# else /* no _SC_PAGESIZE */ -# if HAVE_SYS_PARAM_H -# include -# ifdef EXEC_PAGESIZE -# define getpagesize() EXEC_PAGESIZE -# else /* no EXEC_PAGESIZE */ -# ifdef NBPG -# define getpagesize() NBPG * CLSIZE -# ifndef CLSIZE -# define CLSIZE 1 -# endif /* no CLSIZE */ -# else /* no NBPG */ -# ifdef NBPC -# define getpagesize() NBPC -# else /* no NBPC */ -# ifdef PAGESIZE -# define getpagesize() PAGESIZE -# endif /* PAGESIZE */ -# endif /* no NBPC */ -# endif /* no NBPG */ -# endif /* no EXEC_PAGESIZE */ -# else /* no HAVE_SYS_PARAM_H */ -# define getpagesize() 8192 /* punt totally */ -# endif /* no HAVE_SYS_PARAM_H */ -# endif /* no _SC_PAGESIZE */ - -#endif /* no HAVE_GETPAGESIZE */ - -int -main () -{ - char *data, *data2, *data3; - int i, pagesize; - int fd; - - pagesize = getpagesize (); - - /* First, make a file with some known garbage in it. */ - data = (char *) malloc (pagesize); - if (!data) - exit (1); - for (i = 0; i < pagesize; ++i) - *(data + i) = rand (); - umask (0); - fd = creat ("conftest.mmap", 0600); - if (fd < 0) - exit (1); - if (write (fd, data, pagesize) != pagesize) - exit (1); - close (fd); - - /* Next, try to mmap the file at a fixed address which already has - something else allocated at it. If we can, also make sure that - we see the same garbage. */ - fd = open ("conftest.mmap", O_RDWR); - if (fd < 0) - exit (1); - data2 = (char *) malloc (2 * pagesize); - if (!data2) - exit (1); - data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); - if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_FIXED, fd, 0L)) - exit (1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data2 + i)) - exit (1); - - /* Finally, make sure that changes to the mapped area do not - percolate back to the file as seen by read(). (This is a bug on - some variants of i386 svr4.0.) */ - for (i = 0; i < pagesize; ++i) - *(data2 + i) = *(data2 + i) + 1; - data3 = (char *) malloc (pagesize); - if (!data3) - exit (1); - if (read (fd, data3, pagesize) != pagesize) - exit (1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data3 + i)) - exit (1); - close (fd); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_mmap_fixed_mapped=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_mmap_fixed_mapped=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 -echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 -if test $ac_cv_func_mmap_fixed_mapped = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MMAP 1 -_ACEOF - -fi -rm -f conftest.mmap - - - - - - - - - - - -for ac_header in argz.h limits.h locale.h nl_types.h malloc.h string.h \ -unistd.h values.h sys/param.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - - - - - - -for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \ -__argz_count __argz_stringify __argz_next -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - if test "${ac_cv_func_stpcpy+set}" != "set"; then - -for ac_func in stpcpy -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - fi - if test "${ac_cv_func_stpcpy}" = "yes"; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STPCPY 1 -_ACEOF - - fi - - if test $ac_cv_header_locale_h = yes; then - echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 -echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6 -if test "${am_cv_val_LC_MESSAGES+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -return LC_MESSAGES - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - am_cv_val_LC_MESSAGES=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -am_cv_val_LC_MESSAGES=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5 -echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6 - if test $am_cv_val_LC_MESSAGES = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LC_MESSAGES 1 -_ACEOF - - fi - fi - echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +# If we haven't got the data from the intl directory, +# assume NLS is disabled. +USE_NLS=no +LIBINTL= +LIBINTL_DEP= +INCINTL= +XGETTEXT= +GMSGFMT= +POSUB= + +if test -f ../intl/config.intl; then + . ../intl/config.intl +fi +echo "$as_me:$LINENO: checking whether NLS is requested" >&5 echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 - # Check whether --enable-nls or --disable-nls was given. +if test x"$USE_NLS" != xyes; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_NLS 1 +_ACEOF + + + echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 +echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 + # Look for .po and .gmo files in the source directory. + CATALOGS= + XLINGUAS= + for cat in $srcdir/po/*.gmo $srcdir/po/*.po; do + # If there aren't any .gmo files the shell will give us the + # literal string "../path/to/srcdir/po/*.gmo" which has to be + # weeded out. + case "$cat" in *\**) + continue;; + esac + # The quadruple backslash is collapsed to a double backslash + # by the backticks, then collapsed again by the double quotes, + # leaving us with one backslash in the sed expression (right + # before the dot that mustn't act as a wildcard). + cat=`echo $cat | sed -e "s!$srcdir/po/!!" -e "s!\\\\.po!.gmo!"` + lang=`echo $cat | sed -e "s!\\\\.gmo!!"` + # The user is allowed to set LINGUAS to a list of languages to + # install catalogs for. If it's empty that means "all of them." + if test "x$LINGUAS" = x; then + CATALOGS="$CATALOGS $cat" + XLINGUAS="$XLINGUAS $lang" + else + case "$LINGUAS" in *$lang*) + CATALOGS="$CATALOGS $cat" + XLINGUAS="$XLINGUAS $lang" + ;; + esac + fi + done + LINGUAS="$XLINGUAS" + echo "$as_me:$LINENO: result: $LINGUAS" >&5 +echo "${ECHO_T}$LINGUAS" >&6 + + + DATADIRNAME=share + + INSTOBJEXT=.mo + + GENCAT=gencat + + CATOBJEXT=.gmo + +fi + + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + case "$ac_aux_dir" in + /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; + *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; + esac + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + + + + echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 + # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" USE_NLS=$enableval else USE_NLS=yes fi; - echo "$as_me:$LINENO: result: $USE_NLS" >&5 + echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6 - USE_INCLUDED_LIBINTL=no - if test "$USE_NLS" = "yes"; then - echo "$as_me:$LINENO: checking whether included gettext is requested" >&5 -echo $ECHO_N "checking whether included gettext is requested... $ECHO_C" >&6 -# Check whether --with-included-gettext or --without-included-gettext was given. -if test "${with_included_gettext+set}" = set; then - withval="$with_included_gettext" - nls_cv_force_use_gnu_gettext=$withval -else - nls_cv_force_use_gnu_gettext=no -fi; - echo "$as_me:$LINENO: result: $nls_cv_force_use_gnu_gettext" >&5 -echo "${ECHO_T}$nls_cv_force_use_gnu_gettext" >&6 - nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" - if test "$nls_cv_force_use_gnu_gettext" != "yes"; then - nls_cv_header_intl= - nls_cv_header_libgt= - CATOBJEXT= - if test "${ac_cv_header_libintl_h+set}" = set; then - echo "$as_me:$LINENO: checking for libintl.h" >&5 -echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6 -if test "${ac_cv_header_libintl_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 -echo "${ECHO_T}$ac_cv_header_libintl_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking libintl.h usability" >&5 -echo $ECHO_N "checking libintl.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking libintl.h presence" >&5 -echo $ECHO_N "checking libintl.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' else - ac_cpp_err= + PATH_SEPARATOR=: fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" else - ac_cpp_err=yes + ac_executable_p="test -f" fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +rm -f conf$$.file - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: libintl.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: libintl.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: libintl.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: libintl.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: libintl.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: libintl.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: libintl.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for libintl.h" >&5 -echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6 -if test "${ac_cv_header_libintl_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_libintl_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 -echo "${ECHO_T}$ac_cv_header_libintl_h" >&6 - -fi -if test $ac_cv_header_libintl_h = yes; then - echo "$as_me:$LINENO: checking for gettext in libc" >&5 -echo $ECHO_N "checking for gettext in libc... $ECHO_C" >&6 -if test "${gt_cv_func_gettext_libc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -return (int) gettext ("") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gt_cv_func_gettext_libc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gt_cv_func_gettext_libc=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $gt_cv_func_gettext_libc" >&5 -echo "${ECHO_T}$gt_cv_func_gettext_libc" >&6 - - if test "$gt_cv_func_gettext_libc" != "yes"; then - echo "$as_me:$LINENO: checking for bindtextdomain in -lintl" >&5 -echo $ECHO_N "checking for bindtextdomain in -lintl... $ECHO_C" >&6 -if test "${ac_cv_lib_intl_bindtextdomain+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lintl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char bindtextdomain (); -int -main () -{ -bindtextdomain (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_intl_bindtextdomain=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_intl_bindtextdomain=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_intl_bindtextdomain" >&5 -echo "${ECHO_T}$ac_cv_lib_intl_bindtextdomain" >&6 -if test $ac_cv_lib_intl_bindtextdomain = yes; then - echo "$as_me:$LINENO: checking for gettext in libintl" >&5 -echo $ECHO_N "checking for gettext in libintl... $ECHO_C" >&6 -if test "${gt_cv_func_gettext_libintl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -return (int) gettext ("") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gt_cv_func_gettext_libintl=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gt_cv_func_gettext_libintl=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $gt_cv_func_gettext_libintl" >&5 -echo "${ECHO_T}$gt_cv_func_gettext_libintl" >&6 -fi - - fi - - if test "$gt_cv_func_gettext_libc" = "yes" \ - || test "$gt_cv_func_gettext_libintl" = "yes"; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_GETTEXT 1 -_ACEOF - - # Extract the first word of "msgfmt", so it can be a program name with args. +# Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -8700,308 +11763,31 @@ if test "${ac_cv_path_MSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in - /*) - ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then - ac_cv_path_MSGFMT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" - ;; -esac -fi -MSGFMT="$ac_cv_path_MSGFMT" -if test -n "$MSGFMT"; then - echo "$as_me:$LINENO: result: $MSGFMT" >&5 -echo "${ECHO_T}$MSGFMT" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - if test "$MSGFMT" != "no"; then - -for ac_func in dcgettext -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - # Extract the first word of "gmsgfmt", so it can be a program name with args. -set dummy gmsgfmt; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_GMSGFMT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $GMSGFMT in [\\/]* | ?:[\\/]*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. - ;; + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" - ;; -esac -fi -GMSGFMT=$ac_cv_path_GMSGFMT - -if test -n "$GMSGFMT"; then - echo "$as_me:$LINENO: result: $GMSGFMT" >&5 -echo "${ECHO_T}$GMSGFMT" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - # Extract the first word of "xgettext", so it can be a program name with args. -set dummy xgettext; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_XGETTEXT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case "$XGETTEXT" in - /*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then - ac_cv_path_XGETTEXT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" - ;; -esac -fi -XGETTEXT="$ac_cv_path_XGETTEXT" -if test -n "$XGETTEXT"; then - echo "$as_me:$LINENO: result: $XGETTEXT" >&5 -echo "${ECHO_T}$XGETTEXT" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -extern int _nl_msg_cat_cntr; - return _nl_msg_cat_cntr - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - CATOBJEXT=.gmo - DATADIRNAME=share -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -CATOBJEXT=.mo - DATADIRNAME=lib -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - INSTOBJEXT=.mo - fi - fi - -fi - - - - - if test x"$CATOBJEXT" = x && test -d $srcdir/../intl; then - # Neither gettext nor catgets in included in the C library. - # Fall back on GNU gettext library (assuming it is present). - nls_cv_use_gnu_gettext=yes + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi fi - fi - - if test "$nls_cv_use_gnu_gettext" = "yes"; then - INTLOBJS="\$(GETTOBJS)" - # Extract the first word of "msgfmt", so it can be a program name with args. -set dummy msgfmt; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_MSGFMT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case "$MSGFMT" in - /*) - ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then - ac_cv_path_MSGFMT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="msgfmt" - ;; + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" -if test -n "$MSGFMT"; then +if test "$MSGFMT" != ":"; then echo "$as_me:$LINENO: result: $MSGFMT" >&5 echo "${ECHO_T}$MSGFMT" >&6 else @@ -9009,7 +11795,7 @@ else echo "${ECHO_T}no" >&6 fi - # Extract the first word of "gmsgfmt", so it can be a program name with args. + # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -9049,7 +11835,37 @@ else echo "${ECHO_T}no" >&6 fi - # Extract the first word of "xgettext", so it can be a program name with args. + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -9057,27 +11873,31 @@ if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in - /*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then - ac_cv_path_XGETTEXT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" - ;; + ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" -if test -n "$XGETTEXT"; then +if test "$XGETTEXT" != ":"; then echo "$as_me:$LINENO: result: $XGETTEXT" >&5 echo "${ECHO_T}$XGETTEXT" >&6 else @@ -9085,284 +11905,105 @@ else echo "${ECHO_T}no" >&6 fi - - USE_INCLUDED_LIBINTL=yes - CATOBJEXT=.gmo - INSTOBJEXT=.mo - DATADIRNAME=share - INTLDEPS='$(top_builddir)/../intl/libintl.a' - INTLLIBS=$INTLDEPS - LIBS=`echo $LIBS | sed -e 's/-lintl//'` - nls_cv_header_intl=libintl.h - nls_cv_header_libgt=libgettext.h - fi - - if test "$XGETTEXT" != ":"; then - if $XGETTEXT --omit-header /dev/null 2> /dev/null; then - : ; - else - echo "$as_me:$LINENO: result: found xgettext programs is not GNU xgettext; ignore it" >&5 -echo "${ECHO_T}found xgettext programs is not GNU xgettext; ignore it" >&6 - XGETTEXT=":" - fi - fi - - # We need to process the po/ directory. - POSUB=po - else - DATADIRNAME=share - nls_cv_header_intl=libintl.h - nls_cv_header_libgt=libgettext.h - fi - - # If this is used in GNU gettext we have to set USE_NLS to `yes' - # because some of the sources are only built for this goal. - if test "$PACKAGE" = gettext; then - USE_NLS=yes - USE_INCLUDED_LIBINTL=yes - fi - - for lang in $ALL_LINGUAS; do - GMOFILES="$GMOFILES $lang.gmo" - POFILES="$POFILES $lang.po" - done + rm -f messages.po - - - - - - - - - - - if test "x$CATOBJEXT" != "x"; then - -cat >>confdefs.h <<\_ACEOF -#define ENABLE_NLS 1 -_ACEOF - - fi - - - if test "x$CATOBJEXT" != "x"; then - if test "x$ALL_LINGUAS" = "x"; then - LINGUAS= - else - echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 -echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 - NEW_LINGUAS= - for lang in ${LINGUAS=$ALL_LINGUAS}; do - case "$ALL_LINGUAS" in - *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; - esac - done - LINGUAS=$NEW_LINGUAS - echo "$as_me:$LINENO: result: $LINGUAS" >&5 -echo "${ECHO_T}$LINGUAS" >&6 - fi - - if test -n "$LINGUAS"; then - for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done - fi - fi - - if test $ac_cv_header_locale_h = yes; then - INCLUDE_LOCALE_H="#include " - else - INCLUDE_LOCALE_H="\ -/* The system does not provide the header . Take care yourself. */" - fi - - - if test -f $srcdir/po2tbl.sed.in; then - if test "$CATOBJEXT" = ".cat"; then - if test "${ac_cv_header_linux_version_h+set}" = set; then - echo "$as_me:$LINENO: checking for linux/version.h" >&5 -echo $ECHO_N "checking for linux/version.h... $ECHO_C" >&6 -if test "${ac_cv_header_linux_version_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_linux_version_h" >&5 -echo "${ECHO_T}$ac_cv_header_linux_version_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking linux/version.h usability" >&5 -echo $ECHO_N "checking linux/version.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking linux/version.h presence" >&5 -echo $ECHO_N "checking linux/version.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' else - ac_cpp_err= + PATH_SEPARATOR=: fi -else - ac_cpp_err=yes + rm -f conf$$.sh fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no + ac_executable_p="test -f" fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +rm -f conf$$.file -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: linux/version.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: linux/version.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: linux/version.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes +# Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MSGMERGE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case "$MSGMERGE" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: linux/version.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: linux/version.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: linux/version.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: linux/version.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: linux/version.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: linux/version.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: linux/version.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: linux/version.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac -echo "$as_me:$LINENO: checking for linux/version.h" >&5 -echo $ECHO_N "checking for linux/version.h... $ECHO_C" >&6 -if test "${ac_cv_header_linux_version_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + echo "$as_me:$LINENO: result: $MSGMERGE" >&5 +echo "${ECHO_T}$MSGMERGE" >&6 else - ac_cv_header_linux_version_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_linux_version_h" >&5 -echo "${ECHO_T}$ac_cv_header_linux_version_h" >&6 - -fi -if test $ac_cv_header_linux_version_h = yes; then - msgformat=linux -else - msgformat=xopen + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi + if test "$GMSGFMT" != ":"; then + if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && + (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` + echo "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 +echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6 + GMSGFMT=":" + fi + fi - sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed - fi - sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ - $srcdir/po2tbl.sed.in > po2tbl.sed - fi + if test "$XGETTEXT" != ":"; then + if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 +echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6 + XGETTEXT=":" + fi + rm -f messages.po + fi - if test "$PACKAGE" = "gettext"; then - GT_NO="#NO#" - GT_YES= - else - GT_NO= - GT_YES="#YES#" - fi + ac_config_commands="$ac_config_commands default-1" - MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs" - - - l= - - - if test -f $srcdir/po/POTFILES.in; then - test -d po || mkdir po - if test "x$srcdir" != "x."; then - if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then - posrcprefix="$srcdir/" - else - posrcprefix="../$srcdir/" - fi - else - posrcprefix="../" - fi - rm -f po/POTFILES - sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ - < $srcdir/po/POTFILES.in > po/POTFILES - fi - - echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. @@ -9389,6 +12030,16 @@ fi +if false; then + GENINSRC_NEVER_TRUE= + GENINSRC_NEVER_FALSE='#' +else + GENINSRC_NEVER_TRUE='#' + GENINSRC_NEVER_FALSE= +fi + + + @@ -10211,8 +12862,7 @@ yes) LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) - # These system don't have libm - # on darwin the libm is a symbolic link to libSystem.dylib + # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) echo "$as_me:$LINENO: checking for _mwvalidcheckl in -lmw" >&5 @@ -10283,9 +12933,9 @@ if test $ac_cv_lib_mw__mwvalidcheckl = yes; then LIBM="-lmw" fi - echo "$as_me:$LINENO: checking for main in -lm" >&5 -echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6 -if test "${ac_cv_lib_m_main+set}" = set; then + echo "$as_me:$LINENO: checking for cos in -lm" >&5 +echo $ECHO_N "checking for cos in -lm... $ECHO_C" >&6 +if test "${ac_cv_lib_m_cos+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS @@ -10297,11 +12947,17 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char cos (); int main () { -main (); +cos (); ; return 0; } @@ -10328,28 +12984,28 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_m_main=yes + ac_cv_lib_m_cos=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_m_main=no +ac_cv_lib_m_cos=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5 -echo "${ECHO_T}$ac_cv_lib_m_main" >&6 -if test $ac_cv_lib_m_main = yes; then +echo "$as_me:$LINENO: result: $ac_cv_lib_m_cos" >&5 +echo "${ECHO_T}$ac_cv_lib_m_cos" >&6 +if test $ac_cv_lib_m_cos = yes; then LIBM="$LIBM -lm" fi ;; *) - echo "$as_me:$LINENO: checking for main in -lm" >&5 -echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6 -if test "${ac_cv_lib_m_main+set}" = set; then + echo "$as_me:$LINENO: checking for cos in -lm" >&5 +echo $ECHO_N "checking for cos in -lm... $ECHO_C" >&6 +if test "${ac_cv_lib_m_cos+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS @@ -10361,11 +13017,17 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char cos (); int main () { -main (); +cos (); ; return 0; } @@ -10392,20 +13054,20 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_m_main=yes + ac_cv_lib_m_cos=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_m_main=no +ac_cv_lib_m_cos=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5 -echo "${ECHO_T}$ac_cv_lib_m_main" >&6 -if test $ac_cv_lib_m_main = yes; then +echo "$as_me:$LINENO: result: $ac_cv_lib_m_cos" >&5 +echo "${ECHO_T}$ac_cv_lib_m_cos" >&6 +if test $ac_cv_lib_m_cos = yes; then LIBM="-lm" fi @@ -10413,6 +13075,7 @@ fi esac + ;; esac @@ -11124,6 +13787,16 @@ fi +case "${host}" in +*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) + +cat >>confdefs.h <<\_ACEOF +#define USE_BINARY_FOPEN 1 +_ACEOF + ;; +esac + + @@ -11246,6 +13919,13 @@ echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${GENINSRC_NEVER_TRUE}" && test -z "${GENINSRC_NEVER_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"GENINSRC_NEVER\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"GENINSRC_NEVER\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files @@ -11680,6 +14360,254 @@ cat >>$CONFIG_STATUS <<_ACEOF # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' +macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' +enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' +pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' +host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' +host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' +host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' +build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' +build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' +build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' +SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' +Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' +GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' +EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' +FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' +LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' +NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' +LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' +ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' +exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' +lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' +reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' +AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' +STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' +RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' +compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' +GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' +objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' +SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' +ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' +need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' +libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' +version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' +runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' +libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' +soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' +old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' +striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +AR \ +AR_FLAGS \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +SHELL \ +ECHO \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_wl \ +lt_prog_compiler_pic \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_flag_spec_ld \ +hardcode_libdir_separator \ +fix_srcfile_path \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` + ;; +esac + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + +# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it + # from automake. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + target_cpu_type=${target_cpu_type} cgen_cpu_prefix=${cgen_cpu_prefix} obj_format=${obj_format} @@ -11700,6 +14628,8 @@ do "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in:po/Make-in" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool" ) CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 @@ -11837,10 +14767,22 @@ s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@LIBTOOL@,$LIBTOOL,;t t +s,@SED@,$SED,;t t +s,@EGREP@,$EGREP,;t t +s,@FGREP@,$FGREP,;t t +s,@GREP@,$GREP,;t t +s,@LD@,$LD,;t t +s,@DUMPBIN@,$DUMPBIN,;t t +s,@ac_ct_DUMPBIN@,$ac_ct_DUMPBIN,;t t +s,@NM@,$NM,;t t s,@LN_S@,$LN_S,;t t +s,@AR@,$AR,;t t +s,@ac_ct_AR@,$ac_ct_AR,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@LIBTOOL@,$LIBTOOL,;t t +s,@lt_ECHO@,$lt_ECHO,;t t +s,@CPP@,$CPP,;t t s,@WARN_CFLAGS@,$WARN_CFLAGS,;t t s,@NO_WERROR@,$NO_WERROR,;t t s,@GDBINIT@,$GDBINIT,;t t @@ -11851,40 +14793,32 @@ s,@obj_format@,$obj_format,;t t s,@te_file@,$te_file,;t t s,@install_tooldir@,$install_tooldir,;t t s,@atof@,$atof,;t t -s,@BFDLIB@,$BFDLIB,;t t s,@OPCODES_LIB@,$OPCODES_LIB,;t t -s,@BFDVER_H@,$BFDVER_H,;t t -s,@ALL_OBJ_DEPS@,$ALL_OBJ_DEPS,;t t s,@YACC@,$YACC,;t t s,@LEX@,$LEX,;t t s,@LEXLIB@,$LEXLIB,;t t s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@ALLOCA@,$ALLOCA,;t t s,@USE_NLS@,$USE_NLS,;t t -s,@MSGFMT@,$MSGFMT,;t t -s,@GMSGFMT@,$GMSGFMT,;t t +s,@LIBINTL@,$LIBINTL,;t t +s,@LIBINTL_DEP@,$LIBINTL_DEP,;t t +s,@INCINTL@,$INCINTL,;t t s,@XGETTEXT@,$XGETTEXT,;t t -s,@USE_INCLUDED_LIBINTL@,$USE_INCLUDED_LIBINTL,;t t -s,@CATALOGS@,$CATALOGS,;t t -s,@CATOBJEXT@,$CATOBJEXT,;t t -s,@DATADIRNAME@,$DATADIRNAME,;t t -s,@GMOFILES@,$GMOFILES,;t t -s,@INSTOBJEXT@,$INSTOBJEXT,;t t -s,@INTLDEPS@,$INTLDEPS,;t t -s,@INTLLIBS@,$INTLLIBS,;t t -s,@INTLOBJS@,$INTLOBJS,;t t -s,@POFILES@,$POFILES,;t t +s,@GMSGFMT@,$GMSGFMT,;t t s,@POSUB@,$POSUB,;t t -s,@INCLUDE_LOCALE_H@,$INCLUDE_LOCALE_H,;t t -s,@GT_NO@,$GT_NO,;t t -s,@GT_YES@,$GT_YES,;t t +s,@CATALOGS@,$CATALOGS,;t t +s,@DATADIRNAME@,$DATADIRNAME,;t t +s,@INSTOBJEXT@,$INSTOBJEXT,;t t +s,@GENCAT@,$GENCAT,;t t +s,@CATOBJEXT@,$CATOBJEXT,;t t s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t -s,@l@,$l,;t t +s,@MSGFMT@,$MSGFMT,;t t +s,@MSGMERGE@,$MSGMERGE,;t t s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t s,@MAINT@,$MAINT,;t t +s,@GENINSRC_NEVER_TRUE@,$GENINSRC_NEVER_TRUE,;t t +s,@GENINSRC_NEVER_FALSE@,$GENINSRC_NEVER_FALSE,;t t +s,@ALLOCA@,$ALLOCA,;t t s,@LIBM@,$LIBM,;t t s,@datarootdir@,$datarootdir,;t t s,@docdir@,$docdir,;t t @@ -12573,6 +15507,656 @@ echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} done done ;; + libtool ) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me (GNU $PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007 Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# 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 2 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, a copy can be downloaded from +# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that does not interpret backslashes. +ECHO=$lt_ECHO + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[^=]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=\$$1\$2" +} +_LT_EOF + ;; + esac + + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + default-1 ) + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assigment from automake. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + GMOFILES= + UPDATEPOFILES= + DUMMYPOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done ;; default ) rm -f targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c itbl-cpu.h echo '#include "tc-'"${target_cpu_type}"'.h"' > targ-cpu.h echo '#include "obj-'"${obj_format}"'.h"' > obj-format.h @@ -12580,9 +16164,7 @@ done echo '#include "itbl-'"${target_cpu_type}"'.h"' > itbl-cpu.h if test "x$cgen_cpu_prefix" != x ; then echo '#include "opcodes/'"${cgen_cpu_prefix}"'-desc.h"' > cgen-desc.h - fi - - sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;; + fi ;; esac done _ACEOF diff --git a/gas/configure.in b/gas/configure.in index fe69a51c925..02e8e53af4f 100644 --- a/gas/configure.in +++ b/gas/configure.in @@ -23,13 +23,14 @@ AM_INIT_AUTOMAKE(gas, ${BFD_VERSION}) AM_PROG_LIBTOOL AC_ARG_ENABLE(targets, -[ --enable-targets alternative target configurations besides the primary], +[ --enable-targets alternative target configurations besides the primary], [case "${enableval}" in yes | "") AC_ERROR(enable-targets option must specify target names or 'all') ;; no) enable_targets= ;; *) enable_targets=$enableval ;; esac])dnl + AC_ARG_ENABLE(commonbfdlib, [ --enable-commonbfdlib build shared BFD/opcodes/libiberty library], [case "${enableval}" in @@ -38,6 +39,20 @@ AC_ARG_ENABLE(commonbfdlib, *) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;; esac])dnl +ac_checking=yes +if grep '^RELEASE=y' ${srcdir}/../bfd/Makefile.am >/dev/null 2>/dev/null ; then + ac_checking= +fi +AC_ARG_ENABLE(checking, +[ --enable-checking enable run-time checks], +[case "${enableval}" in + no|none) ac_checking= ;; + *) ac_checking=yes ;; +esac])dnl +if test x$ac_checking != x ; then + AC_DEFINE(ENABLE_CHECKING, 1, [Define if you want run-time sanity checks.]) +fi + using_cgen=no AM_BINUTILS_WARNINGS @@ -258,7 +273,7 @@ changequote([,])dnl # Do we need the opcodes library? case ${cpu_type} in - vax | i386 | tic30) + vax | tic30) ;; *) @@ -304,18 +319,22 @@ changequote([,])dnl esac ;; + mep) + using_cgen=yes + ;; + mips) - echo ${extra_objects} | grep -s "itbl-parse.o" + echo ${extra_objects} | grep -s "itbl-parse.o" if test $? -ne 0 ; then extra_objects="$extra_objects itbl-parse.o" fi - echo ${extra_objects} | grep -s "itbl-lex.o" + echo ${extra_objects} | grep -s "itbl-lex.o" if test $? -ne 0 ; then extra_objects="$extra_objects itbl-lex.o" fi - echo ${extra_objects} | grep -s "itbl-ops.o" + echo ${extra_objects} | grep -s "itbl-ops.o" if test $? -ne 0 ; then extra_objects="$extra_objects itbl-ops.o" fi @@ -417,6 +436,19 @@ if test ${all_targets} = "yes"; then ;; esac ;; + x86_64) + case ${obj_format} in + aout) + emulations="$emulations i386coff i386elf" + ;; + coff) + emulations="$emulations i386aout i386elf" + ;; + elf) + emulations="$emulations i386aout i386coff" + ;; + esac + ;; esac fi @@ -424,8 +456,7 @@ fi # IEEE FP. On those that don't support FP at all, usually IEEE # is emulated. case ${target_cpu} in - vax | tahoe ) atof=${target_cpu} ;; - pdp11) atof=vax ;; + vax | pdp11 ) atof=vax ;; *) atof=ieee ;; esac @@ -462,6 +493,7 @@ case ${obj_format} in i386) AC_DEFINE(I386COFF, 1, [Using i386 COFF?]) ;; m68k) AC_DEFINE(M68KCOFF, 1, [Using m68k COFF?]) ;; m88k) AC_DEFINE(M88KCOFF, 1, [Using m88k COFF?]) ;; + x86_64) AC_DEFINE(I386COFF, 1, [Using i386 COFF?]) ;; esac ;; esac @@ -511,7 +543,6 @@ if test `set . $formats ; shift ; echo $#` -gt 1 ; then ecoff) AC_DEFINE(OBJ_MAYBE_ECOFF, 1, [ECOFF support?]) ;; elf) AC_DEFINE(OBJ_MAYBE_ELF, 1, [ELF support?]) ;; generic) AC_DEFINE(OBJ_MAYBE_GENERIC, 1, [generic support?]) ;; - ieee) AC_DEFINE(OBJ_MAYBE_IEEE, 1, [IEEE support?]) ;; som) AC_DEFINE(OBJ_MAYBE_SOM, 1, [SOM support?]) ;; esac extra_objects="$extra_objects obj-$fmt.o" @@ -556,16 +587,8 @@ yes) ;; esac -BFDLIB=../bfd/libbfd.la -BFDVER_H=../bfd/bfdver.h -ALL_OBJ_DEPS="$ALL_OBJ_DEPS"' ../bfd/bfd.h $(INCDIR)/symcat.h' - -AC_SUBST(BFDLIB) AC_SUBST(OPCODES_LIB) -AC_SUBST(BFDVER_H) -AC_SUBST(ALL_OBJ_DEPS) - AC_DEFINE_UNQUOTED(TARGET_ALIAS, "${target_alias}", [Target alias.]) AC_DEFINE_UNQUOTED(TARGET_CANONICAL, "${target}", [Canonical target.]) AC_DEFINE_UNQUOTED(TARGET_CPU, "${target_cpu}", [Target CPU.]) @@ -578,9 +601,11 @@ AC_PROG_YACC AM_PROG_LEX ALL_LINGUAS="fr tr es rw" -CY_GNU_GETTEXT +ZW_GNU_GETTEXT_SISTER_DIR +AM_PO_SUBDIRS AM_MAINTAINER_MODE +AM_CONDITIONAL(GENINSRC_NEVER, false) AC_EXEEXT AC_CHECK_HEADERS(string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h errno.h sys/types.h) @@ -609,7 +634,7 @@ AC_CHECK_FUNCS(sbrk) # do we need the math library? case "${need_libm}" in -yes) +yes) AC_CHECK_LIBM AC_SUBST(LIBM) ;; @@ -669,6 +694,8 @@ GAS_CHECK_DECL_NEEDED(strstr, f, char *(*f)(), $gas_test_headers) AC_CHECK_DECLS([vsnprintf]) +BFD_BINARY_FOPEN + dnl Required for html and install-html targets. AC_SUBST(datarootdir) AC_SUBST(docdir) @@ -691,9 +718,7 @@ AC_CONFIG_COMMANDS([default], echo '#include "itbl-'"${target_cpu_type}"'.h"' > itbl-cpu.h if test "x$cgen_cpu_prefix" != x ; then echo '#include "opcodes/'"${cgen_cpu_prefix}"'-desc.h"' > cgen-desc.h - fi - - sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile], + fi], [target_cpu_type=${target_cpu_type} cgen_cpu_prefix=${cgen_cpu_prefix} obj_format=${obj_format} diff --git a/gas/configure.tgt b/gas/configure.tgt index 696daaa128f..3b7fb19f310 100644 --- a/gas/configure.tgt +++ b/gas/configure.tgt @@ -35,8 +35,10 @@ case ${cpu} in arm*) cpu_type=arm endian=little ;; bfin*) cpu_type=bfin endian=little ;; c4x*) cpu_type=tic4x ;; + cr16*) cpu_type=cr16 endian=little ;; crisv32) cpu_type=cris arch=crisv32 ;; crx*) cpu_type=crx endian=little ;; + fido) cpu_type=m68k ;; hppa*) cpu_type=hppa ;; i[3-7]86) cpu_type=i386 arch=i386;; ia64) cpu_type=ia64 ;; @@ -51,6 +53,7 @@ case ${cpu} in m6811|m6812|m68hc12) cpu_type=m68hc11 ;; m683??) cpu_type=m68k ;; maxq) cpu_type=maxq ;; + mep-*-elf) cpu_type=mep endian=big ;; mips*el) cpu_type=mips endian=little ;; mips*) cpu_type=mips endian=big ;; mt) cpu_type=mt endian=big ;; @@ -62,6 +65,8 @@ case ${cpu} in rs6000*) cpu_type=ppc ;; s390x*) cpu_type=s390 arch=s390x ;; s390*) cpu_type=s390 arch=s390 ;; + score*l) cpu_type=score endian=little ;; + score*) cpu_type=score endian=big ;; sh5le*) cpu_type=sh64 endian=little ;; sh5*) cpu_type=sh64 endian=big ;; sh64le*) cpu_type=sh64 endian=little ;; @@ -77,7 +82,7 @@ case ${cpu} in strongarm*b) cpu_type=arm endian=big ;; strongarm*) cpu_type=arm endian=little ;; v850*) cpu_type=v850 ;; - x86_64) cpu_type=i386 arch=x86_64;; + x86_64*) cpu_type=i386 arch=x86_64;; xscale*be|xscale*b) cpu_type=arm endian=big ;; xscale*) cpu_type=arm endian=little ;; xtensa*) cpu_type=xtensa arch=xtensa ;; @@ -109,6 +114,7 @@ case ${generic_target} in arm-*-linux*aout*) fmt=aout em=linux ;; arm-*-linux-*eabi*) fmt=elf em=armlinuxeabi ;; arm-*-linux-*) fmt=elf em=linux ;; + arm-*-uclinux*eabi*) fmt=elf em=armlinuxeabi ;; arm-*-uclinux*) fmt=elf em=linux ;; arm-*-netbsdelf*) fmt=elf em=nbsd ;; arm-*-*n*bsd*) fmt=aout em=nbsd ;; @@ -121,6 +127,7 @@ case ${generic_target} in avr-*-*) fmt=elf bfd_gas=yes ;; bfin-*-*) fmt=elf bfd_gas=yes ;; bfin-*elf) fmt=elf ;; + cr16-*-elf*) fmt=elf ;; cris-*-linux-* | crisv32-*-linux-*) fmt=multi em=linux ;; @@ -209,7 +216,11 @@ case ${generic_target} in i386-*-pe) fmt=coff em=pe ;; i386-*-cygwin*) fmt=coff em=pe ;; i386-*-interix*) fmt=coff em=interix ;; - i386-*-mingw32*) fmt=coff em=pe ;; + i386-*-mingw*) + case ${cpu} in + x86_64*) fmt=coff em=pep ;; + i*) fmt=coff em=pe ;; + esac ;; i386-*-nto-qnx*) fmt=elf ;; i386-*-*nt*) fmt=coff em=pe ;; i386-*-chaos) fmt=elf ;; @@ -250,6 +261,8 @@ case ${generic_target} in maxq-*-coff) fmt=coff bfd_gas=yes ;; + mep-*-elf) fmt=elf ;; + mcore-*-elf) fmt=elf ;; mcore-*-pe) fmt=coff em=pe bfd_gas=yes ;; @@ -266,6 +279,7 @@ case ${generic_target} in mips-*-riscos*) fmt=ecoff ;; mips*-*-linux*) fmt=elf em=tmips ;; mips-*-sysv4*MP* | mips-*-gnu*) fmt=elf em=tmips ;; + mips*-sde-elf*) fmt=elf em=tmips ;; mips-*-sysv*) fmt=ecoff ;; mips-*-elf* | mips-*-rtems*) fmt=elf ;; mips-*-netbsd*) fmt=elf em=tmips ;; @@ -314,6 +328,8 @@ case ${generic_target} in s390-*-linux-*) fmt=elf em=linux ;; s390-*-tpf*) fmt=elf ;; + score-*-elf) fmt=elf ;; + sh*-*-linux*) fmt=elf em=linux case ${cpu} in sh*eb) endian=big ;; @@ -323,7 +339,7 @@ case ${generic_target} in sh64*-*-netbsd*) fmt=elf em=nbsd ;; sh*-*-netbsdelf*) fmt=elf em=nbsd ;; sh*-*-symbianelf*) fmt=elf endian=little ;; - sh-*-elf*) fmt=elf ;; + sh-*-elf* | sh-*-uclinux* | sh[12]-*-uclinux*) fmt=elf ;; sh-*-coff*) fmt=coff ;; sh-*-nto*) fmt=elf ;; sh-*-pe*) fmt=coff em=pe bfd_gas=yes endian=little ;; @@ -357,6 +373,8 @@ case ${generic_target} in esac ;; sparc-*-openbsd*) fmt=elf em=nbsd ;; + spu-*-elf) fmt=elf ;; + tic30-*-*aout*) fmt=aout bfd_gas=yes ;; tic30-*-*coff*) fmt=coff bfd_gas=yes ;; tic4x-*-* | c4x-*-*) fmt=coff bfd_gas=yes ;; diff --git a/gas/debug.c b/gas/debug.c index fe2ed8c6536..3218fff538a 100644 --- a/gas/debug.c +++ b/gas/debug.c @@ -1,5 +1,5 @@ /* This file is debug.c - Copyright 1987, 1988, 1989, 1990, 1991, 1992, 2000 + Copyright 1987, 1988, 1989, 1990, 1991, 1992, 2000, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -25,26 +25,28 @@ dmp_frags () { + asection *s; frchainS *chp; char *p; - for (chp = frchain_root; chp; chp = chp->frch_next) - { - switch (chp->frch_seg) - { - case SEG_DATA: - p = "Data"; - break; - case SEG_TEXT: - p = "Text"; - break; - default: - p = "???"; - break; - } - printf ("\nSEGMENT %s %d\n", p, chp->frch_subseg); - dmp_frag (chp->frch_root, "\t"); - } + for (s = stdoutput->sections; s; s = s->next) + for (chp = seg_info (s)->frchainP; chp; chp = chp->frch_next) + { + switch (s) + { + case SEG_DATA: + p = "Data"; + break; + case SEG_TEXT: + p = "Text"; + break; + default: + p = "???"; + break; + } + printf ("\nSEGMENT %s %d\n", p, chp->frch_subseg); + dmp_frag (chp->frch_root, "\t"); + } } dmp_frag (fp, indent) diff --git a/gas/dep-in.sed b/gas/dep-in.sed index f23c2018fe9..d81c4609b9c 100644 --- a/gas/dep-in.sed +++ b/gas/dep-in.sed @@ -12,14 +12,13 @@ s!@SRCDIR@/config!$(srcdir)/config!g s!@SRCDIR@/\.\./opcodes!$(srcdir)/../opcodes!g s!@TOPDIR@/opcodes!$(srcdir)/../opcodes!g s!@SRCDIR@/!!g -s!\.\./bfd/bfdver\.h!$(BFDVER_H)!g s! \$(srcdir)/config/te-generic\.h!!g -s! \.\./bfd/bfd\.h!!g s! itbl-cpu\.h!!g s! itbl-parse\.h!!g s! \.\./intl/libintl\.h!!g -s! \$(INCDIR)/bin-bugs\.h!!g +s! \.\./bfd/bfd\.h!!g +s! \$(INCDIR)/symcat\.h!!g s! \$(INCDIR)/ansidecl\.h!!g s! \$(INCDIR)/libiberty\.h!!g s! \$(INCDIR)/progress\.h!!g diff --git a/gas/doc/Makefile.am b/gas/doc/Makefile.am index d48a9ccb241..4f6ff9294c0 100644 --- a/gas/doc/Makefile.am +++ b/gas/doc/Makefile.am @@ -16,9 +16,12 @@ POD2MAN = pod2man --center="GNU Development Tools" \ man_MANS = as.1 info_TEXINFOS = as.texinfo +as_TEXINFOS = asconfig.texi $(CPU_DOCS) -AM_MAKEINFOFLAGS = -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" -TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" +AM_MAKEINFOFLAGS = -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" \ + -I ../../bfd/doc +TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" \ + -I ../../bfd/doc asconfig.texi: $(CONFIG).texi rm -f asconfig.texi @@ -29,7 +32,9 @@ CPU_DOCS = \ c-alpha.texi \ c-arc.texi \ c-arm.texi \ + c-avr.texi \ c-bfin.texi \ + c-cr16.texi \ c-d10v.texi \ c-cris.texi \ c-h8300.texi \ @@ -61,13 +66,6 @@ CPU_DOCS = \ c-z80.texi \ c-z8k.texi -gasver.texi: $(srcdir)/../../bfd/configure - rm -f $@ - eval `grep '^ *VERSION=' $(srcdir)/../../bfd/configure`; \ - echo "@set VERSION $$VERSION" > $@ - -$(srcdir)/as.info as.dvi as.html: $(srcdir)/as.texinfo asconfig.texi gasver.texi $(CPU_DOCS) - # We want install to imply install-info as per GNU standards, despite the # cygnus option. install-data-local: install-info @@ -97,7 +95,7 @@ install-html-am: $(HTMLS) noinst_TEXINFOS = internals.texi -MAINTAINERCLEANFILES = asconfig.texi gasver.texi +MAINTAINERCLEANFILES = asconfig.texi BASEDIR = $(srcdir)/../.. BFDDIR = $(BASEDIR)/bfd @@ -112,7 +110,7 @@ info-local: $(MANS) # Build the man page from the texinfo file # The sed command removes the no-adjust Nroff command so that # the man output looks standard. -as.1: $(srcdir)/as.texinfo asconfig.texi gasver.texi $(CPU_DOCS) +as.1: $(srcdir)/as.texinfo asconfig.texi $(CPU_DOCS) touch $@ -$(TEXI2POD) $(MANCONF) < $(srcdir)/as.texinfo > as.pod -($(POD2MAN) as.pod | \ @@ -120,3 +118,12 @@ as.1: $(srcdir)/as.texinfo asconfig.texi gasver.texi $(CPU_DOCS) mv -f $@.T$$$$ $@) || \ (rm -f $@.T$$$$ && exit 1) rm -f as.pod + +MAINTAINERCLEANFILES += as.info + +# Automake 1.9 will only build info files in the objdir if they are +# mentioned in DISTCLEANFILES. It doesn't have to be unconditional, +# though, so we use a bogus condition. +if GENINSRC_NEVER +DISTCLEANFILES = as.info +endif diff --git a/gas/doc/Makefile.in b/gas/doc/Makefile.in index cd9dad2baaf..86f3d7a4269 100644 --- a/gas/doc/Makefile.in +++ b/gas/doc/Makefile.in @@ -37,11 +37,19 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(as_TEXINFOS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/../gettext.m4 $(top_srcdir)/configure.in +am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \ + $(top_srcdir)/../bfd/warning.m4 \ + $(top_srcdir)/../config/depstand.m4 \ + $(top_srcdir)/../config/gettext-sister.m4 \ + $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/nls.m4 $(top_srcdir)/../config/po.m4 \ + $(top_srcdir)/../config/progtest.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs @@ -50,7 +58,7 @@ CONFIG_CLEAN_FILES = depcomp = am__depfiles_maybe = SOURCES = -INFO_DEPS = $(srcdir)/as.info +INFO_DEPS = as.info TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex am__TEXINFO_TEX_DIR = $(top_srcdir)/../texinfo DVIS = as.dvi @@ -68,16 +76,14 @@ NROFF = nroff MANS = $(man_MANS) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ -ALL_OBJ_DEPS = @ALL_OBJ_DEPS@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ -BFDLIB = @BFDLIB@ -BFDVER_H = @BFDVER_H@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ @@ -89,29 +95,32 @@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +FGREP = @FGREP@ GDBINIT = @GDBINIT@ -GMOFILES = @GMOFILES@ +GENCAT = @GENCAT@ +GENINSRC_NEVER_FALSE = @GENINSRC_NEVER_FALSE@ +GENINSRC_NEVER_TRUE = @GENINSRC_NEVER_TRUE@ GMSGFMT = @GMSGFMT@ -GT_NO = @GT_NO@ -GT_YES = @GT_YES@ -INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +GREP = @GREP@ +INCINTL = @INCINTL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ -INTLDEPS = @INTLDEPS@ -INTLLIBS = @INTLLIBS@ -INTLOBJS = @INTLOBJS@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBINTL = @LIBINTL@ +LIBINTL_DEP = @LIBINTL_DEP@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ @@ -124,6 +133,8 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ NO_WERROR = @NO_WERROR@ OBJEXT = @OBJEXT@ OPCODES_LIB = @OPCODES_LIB@ @@ -134,19 +145,20 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ -USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ XGETTEXT = @XGETTEXT@ YACC = @YACC@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ @@ -179,10 +191,10 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ install_tooldir = @install_tooldir@ -l = @l@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ obj_format = @obj_format@ @@ -212,13 +224,20 @@ POD2MAN = pod2man --center="GNU Development Tools" \ man_MANS = as.1 info_TEXINFOS = as.texinfo -AM_MAKEINFOFLAGS = -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" -TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" +as_TEXINFOS = asconfig.texi $(CPU_DOCS) +AM_MAKEINFOFLAGS = -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" \ + -I ../../bfd/doc + +TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" \ + -I ../../bfd/doc + CPU_DOCS = \ c-alpha.texi \ c-arc.texi \ c-arm.texi \ + c-avr.texi \ c-bfin.texi \ + c-cr16.texi \ c-d10v.texi \ c-cris.texi \ c-h8300.texi \ @@ -254,14 +273,19 @@ html__strip_dir = `echo $$p | sed -e 's|^.*/||'`; # This one isn't ready for prime time yet. Not even a little bit. noinst_TEXINFOS = internals.texi -MAINTAINERCLEANFILES = asconfig.texi gasver.texi +MAINTAINERCLEANFILES = asconfig.texi as.info BASEDIR = $(srcdir)/../.. BFDDIR = $(BASEDIR)/bfd CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in + +# Automake 1.9 will only build info files in the objdir if they are +# mentioned in DISTCLEANFILES. It doesn't have to be unconditional, +# though, so we use a bogus condition. +@GENINSRC_NEVER_TRUE@DISTCLEANFILES = as.info all: all-am .SUFFIXES: -.SUFFIXES: .dvi .html .info .pdf .ps .texinfo +.SUFFIXES: .dvi .ps $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -271,9 +295,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus doc/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign doc/Makefile + $(AUTOMAKE) --cygnus doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -301,42 +325,38 @@ clean-libtool: distclean-libtool: -rm -f libtool -.texinfo.info: +as.info: as.texinfo $(as_TEXINFOS) restore=: && backupdir="$(am__leading_dot)am$$$$" && \ - am__cwd=`pwd` && cd $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ - cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $@ $<; \ + -o $@ `test -f 'as.texinfo' || echo '$(srcdir)/'`as.texinfo; \ then \ rc=0; \ - cd $(srcdir); \ else \ rc=$$?; \ - cd $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc -.texinfo.dvi: +as.dvi: as.texinfo $(as_TEXINFOS) TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2DVI) $< + $(TEXI2DVI) -o $@ `test -f 'as.texinfo' || echo '$(srcdir)/'`as.texinfo -.texinfo.pdf: +as.pdf: as.texinfo $(as_TEXINFOS) TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2PDF) $< + $(TEXI2PDF) -o $@ `test -f 'as.texinfo' || echo '$(srcdir)/'`as.texinfo -.texinfo.html: +as.html: as.texinfo $(as_TEXINFOS) rm -rf $(@:.html=.htp) if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $(@:.html=.htp) $<; \ + -o $(@:.html=.htp) `test -f 'as.texinfo' || echo '$(srcdir)/'`as.texinfo; \ then \ rm -rf $@; \ if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ @@ -346,10 +366,6 @@ distclean-libtool: rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ exit 1; \ fi -$(srcdir)/as.info: as.texinfo -as.dvi: as.texinfo -as.pdf: as.texinfo -as.html: as.texinfo .dvi.ps: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ $(DVIPS) -o $@ $< @@ -481,6 +497,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -586,13 +603,6 @@ asconfig.texi: $(CONFIG).texi cp $(srcdir)/$(CONFIG).texi ./asconfig.texi chmod u+w ./asconfig.texi -gasver.texi: $(srcdir)/../../bfd/configure - rm -f $@ - eval `grep '^ *VERSION=' $(srcdir)/../../bfd/configure`; \ - echo "@set VERSION $$VERSION" > $@ - -$(srcdir)/as.info as.dvi as.html: $(srcdir)/as.texinfo asconfig.texi gasver.texi $(CPU_DOCS) - # We want install to imply install-info as per GNU standards, despite the # cygnus option. install-data-local: install-info @@ -624,7 +634,7 @@ info-local: $(MANS) # Build the man page from the texinfo file # The sed command removes the no-adjust Nroff command so that # the man output looks standard. -as.1: $(srcdir)/as.texinfo asconfig.texi gasver.texi $(CPU_DOCS) +as.1: $(srcdir)/as.texinfo asconfig.texi $(CPU_DOCS) touch $@ -$(TEXI2POD) $(MANCONF) < $(srcdir)/as.texinfo > as.pod -($(POD2MAN) as.pod | \ diff --git a/gas/doc/all.texi b/gas/doc/all.texi index 5192f5471c9..b4778bf8b28 100644 --- a/gas/doc/all.texi +++ b/gas/doc/all.texi @@ -29,7 +29,9 @@ @set ALPHA @set ARC @set ARM +@set AVR @set BFIN +@set CR16 @set CRIS @set D10V @set D30V @@ -63,7 +65,7 @@ @set Z80 @set Z8000 -@c Does this version of the assembler use the difference-table kluge? +@c Does this version of the assembler use the difference-table kludge? @set DIFF-TBL-KLUGE @c Do all machines described use IEEE floating point? diff --git a/gas/doc/as.1 b/gas/doc/as.1 deleted file mode 100644 index 89e3b4c2c7c..00000000000 --- a/gas/doc/as.1 +++ /dev/null @@ -1,1109 +0,0 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "AS 1" -.TH AS 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -AS \- the portable GNU assembler. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -as [\fB\-a\fR[\fBcdhlns\fR][=\fIfile\fR]] [\fB\-\-alternate\fR] [\fB\-D\fR] - [\fB\-\-defsym\fR \fIsym\fR=\fIval\fR] [\fB\-f\fR] [\fB\-g\fR] [\fB\-\-gstabs\fR] - [\fB\-\-gstabs+\fR] [\fB\-\-gdwarf\-2\fR] [\fB\-\-help\fR] [\fB\-I\fR \fIdir\fR] [\fB\-J\fR] - [\fB\-K\fR] [\fB\-L\fR] [\fB\-\-listing\-lhs\-width\fR=\fI\s-1NUM\s0\fR] - [\fB\-\-listing\-lhs\-width2\fR=\fI\s-1NUM\s0\fR] [\fB\-\-listing\-rhs\-width\fR=\fI\s-1NUM\s0\fR] - [\fB\-\-listing\-cont\-lines\fR=\fI\s-1NUM\s0\fR] [\fB\-\-keep\-locals\fR] [\fB\-o\fR - \fIobjfile\fR] [\fB\-R\fR] [\fB\-\-reduce\-memory\-overheads\fR] [\fB\-\-statistics\fR] - [\fB\-v\fR] [\fB\-version\fR] [\fB\-\-version\fR] [\fB\-W\fR] [\fB\-\-warn\fR] - [\fB\-\-fatal\-warnings\fR] [\fB\-w\fR] [\fB\-x\fR] [\fB\-Z\fR] [\fB@\fR\fI\s-1FILE\s0\fR] - [\fB\-\-target\-help\fR] [\fItarget-options\fR] - [\fB\-\-\fR|\fIfiles\fR ...] -.PP -\&\fITarget Alpha options:\fR - [\fB\-m\fR\fIcpu\fR] - [\fB\-mdebug\fR | \fB\-no\-mdebug\fR] - [\fB\-relax\fR] [\fB\-g\fR] [\fB\-G\fR\fIsize\fR] - [\fB\-F\fR] [\fB\-32addr\fR] -.PP -\&\fITarget \s-1ARC\s0 options:\fR - [\fB\-marc[5|6|7|8]\fR] - [\fB\-EB\fR|\fB\-EL\fR] -.PP -\&\fITarget \s-1ARM\s0 options:\fR - [\fB\-mcpu\fR=\fIprocessor\fR[+\fIextension\fR...]] - [\fB\-march\fR=\fIarchitecture\fR[+\fIextension\fR...]] - [\fB\-mfpu\fR=\fIfloating-point-format\fR] - [\fB\-mfloat\-abi\fR=\fIabi\fR] - [\fB\-meabi\fR=\fIver\fR] - [\fB\-mthumb\fR] - [\fB\-EB\fR|\fB\-EL\fR] - [\fB\-mapcs\-32\fR|\fB\-mapcs\-26\fR|\fB\-mapcs\-float\fR| - \fB\-mapcs\-reentrant\fR] - [\fB\-mthumb\-interwork\fR] [\fB\-k\fR] -.PP -\&\fITarget \s-1CRIS\s0 options:\fR - [\fB\-\-underscore\fR | \fB\-\-no\-underscore\fR] - [\fB\-\-pic\fR] [\fB\-N\fR] - [\fB\-\-emulation=criself\fR | \fB\-\-emulation=crisaout\fR] - [\fB\-\-march=v0_v10\fR | \fB\-\-march=v10\fR | \fB\-\-march=v32\fR | \fB\-\-march=common_v10_v32\fR] -.PP -\&\fITarget D10V options:\fR - [\fB\-O\fR] -.PP -\&\fITarget D30V options:\fR - [\fB\-O\fR|\fB\-n\fR|\fB\-N\fR] -.PP -\&\fITarget i386 options:\fR - [\fB\-\-32\fR|\fB\-\-64\fR] [\fB\-n\fR] -.PP -\&\fITarget i960 options:\fR - [\fB\-ACA\fR|\fB\-ACA_A\fR|\fB\-ACB\fR|\fB\-ACC\fR|\fB\-AKA\fR|\fB\-AKB\fR| - \fB\-AKC\fR|\fB\-AMC\fR] - [\fB\-b\fR] [\fB\-no\-relax\fR] -.PP -\&\fITarget \s-1IA\-64\s0 options:\fR - [\fB\-mconstant\-gp\fR|\fB\-mauto\-pic\fR] - [\fB\-milp32\fR|\fB\-milp64\fR|\fB\-mlp64\fR|\fB\-mp64\fR] - [\fB\-mle\fR|\fBmbe\fR] - [\fB\-mtune=itanium1\fR|\fB\-mtune=itanium2\fR] - [\fB\-munwind\-check=warning\fR|\fB\-munwind\-check=error\fR] - [\fB\-mhint.b=ok\fR|\fB\-mhint.b=warning\fR|\fB\-mhint.b=error\fR] - [\fB\-x\fR|\fB\-xexplicit\fR] [\fB\-xauto\fR] [\fB\-xdebug\fR] -.PP -\&\fITarget \s-1IP2K\s0 options:\fR - [\fB\-mip2022\fR|\fB\-mip2022ext\fR] -.PP -\&\fITarget M32C options:\fR - [\fB\-m32c\fR|\fB\-m16c\fR] -.PP -\&\fITarget M32R options:\fR - [\fB\-\-m32rx\fR|\fB\-\-[no\-]warn\-explicit\-parallel\-conflicts\fR| - \fB\-\-W[n]p\fR] -.PP -\&\fITarget M680X0 options:\fR - [\fB\-l\fR] [\fB\-m68000\fR|\fB\-m68010\fR|\fB\-m68020\fR|...] -.PP -\&\fITarget M68HC11 options:\fR - [\fB\-m68hc11\fR|\fB\-m68hc12\fR|\fB\-m68hcs12\fR] - [\fB\-mshort\fR|\fB\-mlong\fR] - [\fB\-mshort\-double\fR|\fB\-mlong\-double\fR] - [\fB\-\-force\-long\-branchs\fR] [\fB\-\-short\-branchs\fR] - [\fB\-\-strict\-direct\-mode\fR] [\fB\-\-print\-insn\-syntax\fR] - [\fB\-\-print\-opcodes\fR] [\fB\-\-generate\-example\fR] -.PP -\&\fITarget \s-1MCORE\s0 options:\fR - [\fB\-jsri2bsr\fR] [\fB\-sifilter\fR] [\fB\-relax\fR] - [\fB\-mcpu=[210|340]\fR] -.PP -\&\fITarget \s-1MIPS\s0 options:\fR - [\fB\-nocpp\fR] [\fB\-EL\fR] [\fB\-EB\fR] [\fB\-O\fR[\fIoptimization level\fR]] - [\fB\-g\fR[\fIdebug level\fR]] [\fB\-G\fR \fInum\fR] [\fB\-KPIC\fR] [\fB\-call_shared\fR] - [\fB\-non_shared\fR] [\fB\-xgot\fR] - [\fB\-mabi\fR=\fI\s-1ABI\s0\fR] [\fB\-32\fR] [\fB\-n32\fR] [\fB\-64\fR] [\fB\-mfp32\fR] [\fB\-mgp32\fR] - [\fB\-march\fR=\fI\s-1CPU\s0\fR] [\fB\-mtune\fR=\fI\s-1CPU\s0\fR] [\fB\-mips1\fR] [\fB\-mips2\fR] - [\fB\-mips3\fR] [\fB\-mips4\fR] [\fB\-mips5\fR] [\fB\-mips32\fR] [\fB\-mips32r2\fR] - [\fB\-mips64\fR] [\fB\-mips64r2\fR] - [\fB\-construct\-floats\fR] [\fB\-no\-construct\-floats\fR] - [\fB\-trap\fR] [\fB\-no\-break\fR] [\fB\-break\fR] [\fB\-no\-trap\fR] - [\fB\-mfix7000\fR] [\fB\-mno\-fix7000\fR] - [\fB\-mips16\fR] [\fB\-no\-mips16\fR] - [\fB\-mips3d\fR] [\fB\-no\-mips3d\fR] - [\fB\-mdmx\fR] [\fB\-no\-mdmx\fR] - [\fB\-mdsp\fR] [\fB\-mno\-dsp\fR] - [\fB\-mmt\fR] [\fB\-mno\-mt\fR] - [\fB\-mdebug\fR] [\fB\-no\-mdebug\fR] - [\fB\-mpdr\fR] [\fB\-mno\-pdr\fR] -.PP -\&\fITarget \s-1MMIX\s0 options:\fR - [\fB\-\-fixed\-special\-register\-names\fR] [\fB\-\-globalize\-symbols\fR] - [\fB\-\-gnu\-syntax\fR] [\fB\-\-relax\fR] [\fB\-\-no\-predefined\-symbols\fR] - [\fB\-\-no\-expand\fR] [\fB\-\-no\-merge\-gregs\fR] [\fB\-x\fR] - [\fB\-\-linker\-allocated\-gregs\fR] -.PP -\&\fITarget \s-1PDP11\s0 options:\fR - [\fB\-mpic\fR|\fB\-mno\-pic\fR] [\fB\-mall\fR] [\fB\-mno\-extensions\fR] - [\fB\-m\fR\fIextension\fR|\fB\-mno\-\fR\fIextension\fR] - [\fB\-m\fR\fIcpu\fR] [\fB\-m\fR\fImachine\fR] -.PP -\&\fITarget picoJava options:\fR - [\fB\-mb\fR|\fB\-me\fR] -.PP -\&\fITarget PowerPC options:\fR - [\fB\-mpwrx\fR|\fB\-mpwr2\fR|\fB\-mpwr\fR|\fB\-m601\fR|\fB\-mppc\fR|\fB\-mppc32\fR|\fB\-m603\fR|\fB\-m604\fR| - \fB\-m403\fR|\fB\-m405\fR|\fB\-mppc64\fR|\fB\-m620\fR|\fB\-mppc64bridge\fR|\fB\-mbooke\fR| - \fB\-mbooke32\fR|\fB\-mbooke64\fR] - [\fB\-mcom\fR|\fB\-many\fR|\fB\-maltivec\fR] [\fB\-memb\fR] - [\fB\-mregnames\fR|\fB\-mno\-regnames\fR] - [\fB\-mrelocatable\fR|\fB\-mrelocatable\-lib\fR] - [\fB\-mlittle\fR|\fB\-mlittle\-endian\fR|\fB\-mbig\fR|\fB\-mbig\-endian\fR] - [\fB\-msolaris\fR|\fB\-mno\-solaris\fR] -.PP -\&\fITarget \s-1SPARC\s0 options:\fR - [\fB\-Av6\fR|\fB\-Av7\fR|\fB\-Av8\fR|\fB\-Asparclet\fR|\fB\-Asparclite\fR - \fB\-Av8plus\fR|\fB\-Av8plusa\fR|\fB\-Av9\fR|\fB\-Av9a\fR] - [\fB\-xarch=v8plus\fR|\fB\-xarch=v8plusa\fR] [\fB\-bump\fR] - [\fB\-32\fR|\fB\-64\fR] -.PP -\&\fITarget \s-1TIC54X\s0 options:\fR - [\fB\-mcpu=54[123589]\fR|\fB\-mcpu=54[56]lp\fR] [\fB\-mfar\-mode\fR|\fB\-mf\fR] - [\fB\-merrors\-to\-file\fR \fI\fR|\fB\-me\fR \fI\fR] -.PP -\&\fITarget Z80 options:\fR - [\fB\-z80\fR] [\fB\-r800\fR] - [ \fB\-ignore\-undocumented\-instructions\fR] [\fB\-Wnud\fR] - [ \fB\-ignore\-unportable\-instructions\fR] [\fB\-Wnup\fR] - [ \fB\-warn\-undocumented\-instructions\fR] [\fB\-Wud\fR] - [ \fB\-warn\-unportable\-instructions\fR] [\fB\-Wup\fR] - [ \fB\-forbid\-undocumented\-instructions\fR] [\fB\-Fud\fR] - [ \fB\-forbid\-unportable\-instructions\fR] [\fB\-Fup\fR] -.PP -\&\fITarget Xtensa options:\fR - [\fB\-\-[no\-]text\-section\-literals\fR] [\fB\-\-[no\-]absolute\-literals\fR] - [\fB\-\-[no\-]target\-align\fR] [\fB\-\-[no\-]longcalls\fR] - [\fB\-\-[no\-]transform\fR] - [\fB\-\-rename\-section\fR \fIoldname\fR=\fInewname\fR] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\s-1GNU\s0 \fBas\fR is really a family of assemblers. -If you use (or have used) the \s-1GNU\s0 assembler on one architecture, you -should find a fairly similar environment when you use it on another -architecture. Each version has much in common with the others, -including object file formats, most assembler directives (often called -\&\fIpseudo-ops\fR) and assembler syntax. -.PP -\&\fBas\fR is primarily intended to assemble the output of the -\&\s-1GNU\s0 C compiler \f(CW\*(C`gcc\*(C'\fR for use by the linker -\&\f(CW\*(C`ld\*(C'\fR. Nevertheless, we've tried to make \fBas\fR -assemble correctly everything that other assemblers for the same -machine would assemble. -Any exceptions are documented explicitly. -This doesn't mean \fBas\fR always uses the same syntax as another -assembler for the same architecture; for example, we know of several -incompatible versions of 680x0 assembly language syntax. -.PP -Each time you run \fBas\fR it assembles exactly one source -program. The source program is made up of one or more files. -(The standard input is also a file.) -.PP -You give \fBas\fR a command line that has zero or more input file -names. The input files are read (from left file name to right). A -command line argument (in any position) that has no special meaning -is taken to be an input file name. -.PP -If you give \fBas\fR no file names it attempts to read one input file -from the \fBas\fR standard input, which is normally your terminal. You -may have to type \fBctl-D\fR to tell \fBas\fR there is no more program -to assemble. -.PP -Use \fB\-\-\fR if you need to explicitly name the standard input file -in your command line. -.PP -If the source is empty, \fBas\fR produces a small, empty object -file. -.PP -\&\fBas\fR may write warnings and error messages to the standard error -file (usually your terminal). This should not happen when a compiler -runs \fBas\fR automatically. Warnings report an assumption made so -that \fBas\fR could keep assembling a flawed program; errors report a -grave problem that stops the assembly. -.PP -If you are invoking \fBas\fR via the \s-1GNU\s0 C compiler, -you can use the \fB\-Wa\fR option to pass arguments through to the assembler. -The assembler arguments must be separated from each other (and the \fB\-Wa\fR) -by commas. For example: -.PP -.Vb 1 -\& gcc \-c \-g \-O \-Wa,\-alh,\-L file.c -.Ve -.PP -This passes two options to the assembler: \fB\-alh\fR (emit a listing to -standard output with high-level and assembly source) and \fB\-L\fR (retain -local symbols in the symbol table). -.PP -Usually you do not need to use this \fB\-Wa\fR mechanism, since many compiler -command-line options are automatically passed to the assembler by the compiler. -(You can call the \s-1GNU\s0 compiler driver with the \fB\-v\fR option to see -precisely what options it passes to each compilation pass, including the -assembler.) -.SH "OPTIONS" -.IX Header "OPTIONS" -.IP "\fB@\fR\fIfile\fR" 4 -.IX Item "@file" -Read command-line options from \fIfile\fR. The options read are -inserted in place of the original @\fIfile\fR option. If \fIfile\fR -does not exist, or cannot be read, then the option will be treated -literally, and not removed. -.Sp -Options in \fIfile\fR are separated by whitespace. A whitespace -character may be included in an option by surrounding the entire -option in either single or double quotes. Any character (including a -backslash) may be included by prefixing the character to be included -with a backslash. The \fIfile\fR may itself contain additional -@\fIfile\fR options; any such options will be processed recursively. -.IP "\fB\-a[cdhlmns]\fR" 4 -.IX Item "-a[cdhlmns]" -Turn on listings, in any of a variety of ways: -.RS 4 -.IP "\fB\-ac\fR" 4 -.IX Item "-ac" -omit false conditionals -.IP "\fB\-ad\fR" 4 -.IX Item "-ad" -omit debugging directives -.IP "\fB\-ah\fR" 4 -.IX Item "-ah" -include high-level source -.IP "\fB\-al\fR" 4 -.IX Item "-al" -include assembly -.IP "\fB\-am\fR" 4 -.IX Item "-am" -include macro expansions -.IP "\fB\-an\fR" 4 -.IX Item "-an" -omit forms processing -.IP "\fB\-as\fR" 4 -.IX Item "-as" -include symbols -.IP "\fB=file\fR" 4 -.IX Item "=file" -set the name of the listing file -.RE -.RS 4 -.Sp -You may combine these options; for example, use \fB\-aln\fR for assembly -listing without forms processing. The \fB=file\fR option, if used, must be -the last one. By itself, \fB\-a\fR defaults to \fB\-ahls\fR. -.RE -.IP "\fB\-\-alternate\fR" 4 -.IX Item "--alternate" -Begin in alternate macro mode, see \fBAltmacro,,\f(CB\*(C`.altmacro\*(C'\fB\fR. -.IP "\fB\-D\fR" 4 -.IX Item "-D" -Ignored. This option is accepted for script compatibility with calls to -other assemblers. -.IP "\fB\-\-defsym\fR \fIsym\fR\fB=\fR\fIvalue\fR" 4 -.IX Item "--defsym sym=value" -Define the symbol \fIsym\fR to be \fIvalue\fR before assembling the input file. -\&\fIvalue\fR must be an integer constant. As in C, a leading \fB0x\fR -indicates a hexadecimal value, and a leading \fB0\fR indicates an octal value. -.IP "\fB\-f\fR" 4 -.IX Item "-f" -\&\*(L"fast\*(R"\-\-\-skip whitespace and comment preprocessing (assume source is -compiler output). -.IP "\fB\-g\fR" 4 -.IX Item "-g" -.PD 0 -.IP "\fB\-\-gen\-debug\fR" 4 -.IX Item "--gen-debug" -.PD -Generate debugging information for each assembler source line using whichever -debug format is preferred by the target. This currently means either \s-1STABS\s0, -\&\s-1ECOFF\s0 or \s-1DWARF2\s0. -.IP "\fB\-\-gstabs\fR" 4 -.IX Item "--gstabs" -Generate stabs debugging information for each assembler line. This -may help debugging assembler code, if the debugger can handle it. -.IP "\fB\-\-gstabs+\fR" 4 -.IX Item "--gstabs+" -Generate stabs debugging information for each assembler line, with \s-1GNU\s0 -extensions that probably only gdb can handle, and that could make other -debuggers crash or refuse to read your program. This -may help debugging assembler code. Currently the only \s-1GNU\s0 extension is -the location of the current working directory at assembling time. -.IP "\fB\-\-gdwarf\-2\fR" 4 -.IX Item "--gdwarf-2" -Generate \s-1DWARF2\s0 debugging information for each assembler line. This -may help debugging assembler code, if the debugger can handle it. Note\-\-\-this -option is only supported by some targets, not all of them. -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Print a summary of the command line options and exit. -.IP "\fB\-\-target\-help\fR" 4 -.IX Item "--target-help" -Print a summary of all target specific options and exit. -.IP "\fB\-I\fR \fIdir\fR" 4 -.IX Item "-I dir" -Add directory \fIdir\fR to the search list for \f(CW\*(C`.include\*(C'\fR directives. -.IP "\fB\-J\fR" 4 -.IX Item "-J" -Don't warn about signed overflow. -.IP "\fB\-K\fR" 4 -.IX Item "-K" -Issue warnings when difference tables altered for long displacements. -.IP "\fB\-L\fR" 4 -.IX Item "-L" -.PD 0 -.IP "\fB\-\-keep\-locals\fR" 4 -.IX Item "--keep-locals" -.PD -Keep (in the symbol table) local symbols. On traditional a.out systems -these start with \fBL\fR, but different systems have different local -label prefixes. -.IP "\fB\-\-listing\-lhs\-width=\fR\fInumber\fR" 4 -.IX Item "--listing-lhs-width=number" -Set the maximum width, in words, of the output data column for an assembler -listing to \fInumber\fR. -.IP "\fB\-\-listing\-lhs\-width2=\fR\fInumber\fR" 4 -.IX Item "--listing-lhs-width2=number" -Set the maximum width, in words, of the output data column for continuation -lines in an assembler listing to \fInumber\fR. -.IP "\fB\-\-listing\-rhs\-width=\fR\fInumber\fR" 4 -.IX Item "--listing-rhs-width=number" -Set the maximum width of an input source line, as displayed in a listing, to -\&\fInumber\fR bytes. -.IP "\fB\-\-listing\-cont\-lines=\fR\fInumber\fR" 4 -.IX Item "--listing-cont-lines=number" -Set the maximum number of lines printed in a listing for a single line of input -to \fInumber\fR + 1. -.IP "\fB\-o\fR \fIobjfile\fR" 4 -.IX Item "-o objfile" -Name the object-file output from \fBas\fR \fIobjfile\fR. -.IP "\fB\-R\fR" 4 -.IX Item "-R" -Fold the data section into the text section. -.Sp -Set the default size of \s-1GAS\s0's hash tables to a prime number close to -\&\fInumber\fR. Increasing this value can reduce the length of time it takes the -assembler to perform its tasks, at the expense of increasing the assembler's -memory requirements. Similarly reducing this value can reduce the memory -requirements at the expense of speed. -.IP "\fB\-\-reduce\-memory\-overheads\fR" 4 -.IX Item "--reduce-memory-overheads" -This option reduces \s-1GAS\s0's memory requirements, at the expense of making the -assembly processes slower. Currently this switch is a synonym for -\&\fB\-\-hash\-size=4051\fR, but in the future it may have other effects as well. -.IP "\fB\-\-statistics\fR" 4 -.IX Item "--statistics" -Print the maximum space (in bytes) and total time (in seconds) used by -assembly. -.IP "\fB\-\-strip\-local\-absolute\fR" 4 -.IX Item "--strip-local-absolute" -Remove local absolute symbols from the outgoing symbol table. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-version\fR" 4 -.IX Item "-version" -.PD -Print the \fBas\fR version. -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -Print the \fBas\fR version and exit. -.IP "\fB\-W\fR" 4 -.IX Item "-W" -.PD 0 -.IP "\fB\-\-no\-warn\fR" 4 -.IX Item "--no-warn" -.PD -Suppress warning messages. -.IP "\fB\-\-fatal\-warnings\fR" 4 -.IX Item "--fatal-warnings" -Treat warnings as errors. -.IP "\fB\-\-warn\fR" 4 -.IX Item "--warn" -Don't suppress warning messages or treat them as errors. -.IP "\fB\-w\fR" 4 -.IX Item "-w" -Ignored. -.IP "\fB\-x\fR" 4 -.IX Item "-x" -Ignored. -.IP "\fB\-Z\fR" 4 -.IX Item "-Z" -Generate an object file even after errors. -.IP "\fB\-\- |\fR \fIfiles\fR \fB...\fR" 4 -.IX Item "-- | files ..." -Standard input, or source files to assemble. -.PP -The following options are available when as is configured for -an \s-1ARC\s0 processor. -.IP "\fB\-marc[5|6|7|8]\fR" 4 -.IX Item "-marc[5|6|7|8]" -This option selects the core processor variant. -.IP "\fB\-EB | \-EL\fR" 4 -.IX Item "-EB | -EL" -Select either big-endian (\-EB) or little-endian (\-EL) output. -.PP -The following options are available when as is configured for the \s-1ARM\s0 -processor family. -.IP "\fB\-mcpu=\fR\fIprocessor\fR\fB[+\fR\fIextension\fR\fB...]\fR" 4 -.IX Item "-mcpu=processor[+extension...]" -Specify which \s-1ARM\s0 processor variant is the target. -.IP "\fB\-march=\fR\fIarchitecture\fR\fB[+\fR\fIextension\fR\fB...]\fR" 4 -.IX Item "-march=architecture[+extension...]" -Specify which \s-1ARM\s0 architecture variant is used by the target. -.IP "\fB\-mfpu=\fR\fIfloating-point-format\fR" 4 -.IX Item "-mfpu=floating-point-format" -Select which Floating Point architecture is the target. -.IP "\fB\-mfloat\-abi=\fR\fIabi\fR" 4 -.IX Item "-mfloat-abi=abi" -Select which floating point \s-1ABI\s0 is in use. -.IP "\fB\-mthumb\fR" 4 -.IX Item "-mthumb" -Enable Thumb only instruction decoding. -.IP "\fB\-mapcs\-32 | \-mapcs\-26 | \-mapcs\-float | \-mapcs\-reentrant\fR" 4 -.IX Item "-mapcs-32 | -mapcs-26 | -mapcs-float | -mapcs-reentrant" -Select which procedure calling convention is in use. -.IP "\fB\-EB | \-EL\fR" 4 -.IX Item "-EB | -EL" -Select either big-endian (\-EB) or little-endian (\-EL) output. -.IP "\fB\-mthumb\-interwork\fR" 4 -.IX Item "-mthumb-interwork" -Specify that the code has been generated with interworking between Thumb and -\&\s-1ARM\s0 code in mind. -.IP "\fB\-k\fR" 4 -.IX Item "-k" -Specify that \s-1PIC\s0 code has been generated. -.PP -See the info pages for documentation of the CRIS-specific options. -.PP -The following options are available when as is configured for -a D10V processor. -.IP "\fB\-O\fR" 4 -.IX Item "-O" -Optimize output by parallelizing instructions. -.PP -The following options are available when as is configured for a D30V -processor. -.IP "\fB\-O\fR" 4 -.IX Item "-O" -Optimize output by parallelizing instructions. -.IP "\fB\-n\fR" 4 -.IX Item "-n" -Warn when nops are generated. -.IP "\fB\-N\fR" 4 -.IX Item "-N" -Warn when a nop after a 32\-bit multiply instruction is generated. -.PP -The following options are available when as is configured for the -Intel 80960 processor. -.IP "\fB\-ACA | \-ACA_A | \-ACB | \-ACC | \-AKA | \-AKB | \-AKC | \-AMC\fR" 4 -.IX Item "-ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC" -Specify which variant of the 960 architecture is the target. -.IP "\fB\-b\fR" 4 -.IX Item "-b" -Add code to collect statistics about branches taken. -.IP "\fB\-no\-relax\fR" 4 -.IX Item "-no-relax" -Do not alter compare-and-branch instructions for long displacements; -error if necessary. -.PP -The following options are available when as is configured for the -Ubicom \s-1IP2K\s0 series. -.IP "\fB\-mip2022ext\fR" 4 -.IX Item "-mip2022ext" -Specifies that the extended \s-1IP2022\s0 instructions are allowed. -.IP "\fB\-mip2022\fR" 4 -.IX Item "-mip2022" -Restores the default behaviour, which restricts the permitted instructions to -just the basic \s-1IP2022\s0 ones. -.PP -The following options are available when as is configured for the -Renesas M32C and M16C processors. -.IP "\fB\-m32c\fR" 4 -.IX Item "-m32c" -Assemble M32C instructions. -.IP "\fB\-m16c\fR" 4 -.IX Item "-m16c" -Assemble M16C instructions (the default). -.PP -The following options are available when as is configured for the -Renesas M32R (formerly Mitsubishi M32R) series. -.IP "\fB\-\-m32rx\fR" 4 -.IX Item "--m32rx" -Specify which processor in the M32R family is the target. The default -is normally the M32R, but this option changes it to the M32RX. -.IP "\fB\-\-warn\-explicit\-parallel\-conflicts or \-\-Wp\fR" 4 -.IX Item "--warn-explicit-parallel-conflicts or --Wp" -Produce warning messages when questionable parallel constructs are -encountered. -.IP "\fB\-\-no\-warn\-explicit\-parallel\-conflicts or \-\-Wnp\fR" 4 -.IX Item "--no-warn-explicit-parallel-conflicts or --Wnp" -Do not produce warning messages when questionable parallel constructs are -encountered. -.PP -The following options are available when as is configured for the -Motorola 68000 series. -.IP "\fB\-l\fR" 4 -.IX Item "-l" -Shorten references to undefined symbols, to one word instead of two. -.IP "\fB\-m68000 | \-m68008 | \-m68010 | \-m68020 | \-m68030\fR" 4 -.IX Item "-m68000 | -m68008 | -m68010 | -m68020 | -m68030" -.PD 0 -.IP "\fB| \-m68040 | \-m68060 | \-m68302 | \-m68331 | \-m68332\fR" 4 -.IX Item "| -m68040 | -m68060 | -m68302 | -m68331 | -m68332" -.IP "\fB| \-m68333 | \-m68340 | \-mcpu32 | \-m5200\fR" 4 -.IX Item "| -m68333 | -m68340 | -mcpu32 | -m5200" -.PD -Specify what processor in the 68000 family is the target. The default -is normally the 68020, but this can be changed at configuration time. -.IP "\fB\-m68881 | \-m68882 | \-mno\-68881 | \-mno\-68882\fR" 4 -.IX Item "-m68881 | -m68882 | -mno-68881 | -mno-68882" -The target machine does (or does not) have a floating-point coprocessor. -The default is to assume a coprocessor for 68020, 68030, and cpu32. Although -the basic 68000 is not compatible with the 68881, a combination of the -two can be specified, since it's possible to do emulation of the -coprocessor instructions with the main processor. -.IP "\fB\-m68851 | \-mno\-68851\fR" 4 -.IX Item "-m68851 | -mno-68851" -The target machine does (or does not) have a memory-management -unit coprocessor. The default is to assume an \s-1MMU\s0 for 68020 and up. -.PP -For details about the \s-1PDP\-11\s0 machine dependent features options, -see \fBPDP\-11\-Options\fR. -.IP "\fB\-mpic | \-mno\-pic\fR" 4 -.IX Item "-mpic | -mno-pic" -Generate position-independent (or position\-dependent) code. The -default is \fB\-mpic\fR. -.IP "\fB\-mall\fR" 4 -.IX Item "-mall" -.PD 0 -.IP "\fB\-mall\-extensions\fR" 4 -.IX Item "-mall-extensions" -.PD -Enable all instruction set extensions. This is the default. -.IP "\fB\-mno\-extensions\fR" 4 -.IX Item "-mno-extensions" -Disable all instruction set extensions. -.IP "\fB\-m\fR\fIextension\fR \fB| \-mno\-\fR\fIextension\fR" 4 -.IX Item "-mextension | -mno-extension" -Enable (or disable) a particular instruction set extension. -.IP "\fB\-m\fR\fIcpu\fR" 4 -.IX Item "-mcpu" -Enable the instruction set extensions supported by a particular \s-1CPU\s0, and -disable all other extensions. -.IP "\fB\-m\fR\fImachine\fR" 4 -.IX Item "-mmachine" -Enable the instruction set extensions supported by a particular machine -model, and disable all other extensions. -.PP -The following options are available when as is configured for -a picoJava processor. -.IP "\fB\-mb\fR" 4 -.IX Item "-mb" -Generate \*(L"big endian\*(R" format output. -.IP "\fB\-ml\fR" 4 -.IX Item "-ml" -Generate \*(L"little endian\*(R" format output. -.PP -The following options are available when as is configured for the -Motorola 68HC11 or 68HC12 series. -.IP "\fB\-m68hc11 | \-m68hc12 | \-m68hcs12\fR" 4 -.IX Item "-m68hc11 | -m68hc12 | -m68hcs12" -Specify what processor is the target. The default is -defined by the configuration option when building the assembler. -.IP "\fB\-mshort\fR" 4 -.IX Item "-mshort" -Specify to use the 16\-bit integer \s-1ABI\s0. -.IP "\fB\-mlong\fR" 4 -.IX Item "-mlong" -Specify to use the 32\-bit integer \s-1ABI\s0. -.IP "\fB\-mshort\-double\fR" 4 -.IX Item "-mshort-double" -Specify to use the 32\-bit double \s-1ABI\s0. -.IP "\fB\-mlong\-double\fR" 4 -.IX Item "-mlong-double" -Specify to use the 64\-bit double \s-1ABI\s0. -.IP "\fB\-\-force\-long\-branchs\fR" 4 -.IX Item "--force-long-branchs" -Relative branches are turned into absolute ones. This concerns -conditional branches, unconditional branches and branches to a -sub routine. -.IP "\fB\-S | \-\-short\-branchs\fR" 4 -.IX Item "-S | --short-branchs" -Do not turn relative branchs into absolute ones -when the offset is out of range. -.IP "\fB\-\-strict\-direct\-mode\fR" 4 -.IX Item "--strict-direct-mode" -Do not turn the direct addressing mode into extended addressing mode -when the instruction does not support direct addressing mode. -.IP "\fB\-\-print\-insn\-syntax\fR" 4 -.IX Item "--print-insn-syntax" -Print the syntax of instruction in case of error. -.IP "\fB\-\-print\-opcodes\fR" 4 -.IX Item "--print-opcodes" -print the list of instructions with syntax and then exit. -.IP "\fB\-\-generate\-example\fR" 4 -.IX Item "--generate-example" -print an example of instruction for each possible instruction and then exit. -This option is only useful for testing \fBas\fR. -.PP -The following options are available when \fBas\fR is configured -for the \s-1SPARC\s0 architecture: -.IP "\fB\-Av6 | \-Av7 | \-Av8 | \-Asparclet | \-Asparclite\fR" 4 -.IX Item "-Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite" -.PD 0 -.IP "\fB\-Av8plus | \-Av8plusa | \-Av9 | \-Av9a\fR" 4 -.IX Item "-Av8plus | -Av8plusa | -Av9 | -Av9a" -.PD -Explicitly select a variant of the \s-1SPARC\s0 architecture. -.Sp -\&\fB\-Av8plus\fR and \fB\-Av8plusa\fR select a 32 bit environment. -\&\fB\-Av9\fR and \fB\-Av9a\fR select a 64 bit environment. -.Sp -\&\fB\-Av8plusa\fR and \fB\-Av9a\fR enable the \s-1SPARC\s0 V9 instruction set with -UltraSPARC extensions. -.IP "\fB\-xarch=v8plus | \-xarch=v8plusa\fR" 4 -.IX Item "-xarch=v8plus | -xarch=v8plusa" -For compatibility with the Solaris v9 assembler. These options are -equivalent to \-Av8plus and \-Av8plusa, respectively. -.IP "\fB\-bump\fR" 4 -.IX Item "-bump" -Warn when the assembler switches to another architecture. -.PP -The following options are available when as is configured for the 'c54x -architecture. -.IP "\fB\-mfar\-mode\fR" 4 -.IX Item "-mfar-mode" -Enable extended addressing mode. All addresses and relocations will assume -extended addressing (usually 23 bits). -.IP "\fB\-mcpu=\fR\fI\s-1CPU_VERSION\s0\fR" 4 -.IX Item "-mcpu=CPU_VERSION" -Sets the \s-1CPU\s0 version being compiled for. -.IP "\fB\-merrors\-to\-file\fR \fI\s-1FILENAME\s0\fR" 4 -.IX Item "-merrors-to-file FILENAME" -Redirect error output to a file, for broken systems which don't support such -behaviour in the shell. -.PP -The following options are available when as is configured for -a \s-1MIPS\s0 processor. -.IP "\fB\-G\fR \fInum\fR" 4 -.IX Item "-G num" -This option sets the largest size of an object that can be referenced -implicitly with the \f(CW\*(C`gp\*(C'\fR register. It is only accepted for targets that -use \s-1ECOFF\s0 format, such as a DECstation running Ultrix. The default value is 8. -.IP "\fB\-EB\fR" 4 -.IX Item "-EB" -Generate \*(L"big endian\*(R" format output. -.IP "\fB\-EL\fR" 4 -.IX Item "-EL" -Generate \*(L"little endian\*(R" format output. -.IP "\fB\-mips1\fR" 4 -.IX Item "-mips1" -.PD 0 -.IP "\fB\-mips2\fR" 4 -.IX Item "-mips2" -.IP "\fB\-mips3\fR" 4 -.IX Item "-mips3" -.IP "\fB\-mips4\fR" 4 -.IX Item "-mips4" -.IP "\fB\-mips5\fR" 4 -.IX Item "-mips5" -.IP "\fB\-mips32\fR" 4 -.IX Item "-mips32" -.IP "\fB\-mips32r2\fR" 4 -.IX Item "-mips32r2" -.IP "\fB\-mips64\fR" 4 -.IX Item "-mips64" -.IP "\fB\-mips64r2\fR" 4 -.IX Item "-mips64r2" -.PD -Generate code for a particular \s-1MIPS\s0 Instruction Set Architecture level. -\&\fB\-mips1\fR is an alias for \fB\-march=r3000\fR, \fB\-mips2\fR is an -alias for \fB\-march=r6000\fR, \fB\-mips3\fR is an alias for -\&\fB\-march=r4000\fR and \fB\-mips4\fR is an alias for \fB\-march=r8000\fR. -\&\fB\-mips5\fR, \fB\-mips32\fR, \fB\-mips32r2\fR, \fB\-mips64\fR, and -\&\fB\-mips64r2\fR -correspond to generic -\&\fB\s-1MIPS\s0 V\fR, \fB\s-1MIPS32\s0\fR, \fB\s-1MIPS32\s0 Release 2\fR, \fB\s-1MIPS64\s0\fR, -and \fB\s-1MIPS64\s0 Release 2\fR -\&\s-1ISA\s0 processors, respectively. -.IP "\fB\-march=\fR\fI\s-1CPU\s0\fR" 4 -.IX Item "-march=CPU" -Generate code for a particular \s-1MIPS\s0 cpu. -.IP "\fB\-mtune=\fR\fIcpu\fR" 4 -.IX Item "-mtune=cpu" -Schedule and tune for a particular \s-1MIPS\s0 cpu. -.IP "\fB\-mfix7000\fR" 4 -.IX Item "-mfix7000" -.PD 0 -.IP "\fB\-mno\-fix7000\fR" 4 -.IX Item "-mno-fix7000" -.PD -Cause nops to be inserted if the read of the destination register -of an mfhi or mflo instruction occurs in the following two instructions. -.IP "\fB\-mdebug\fR" 4 -.IX Item "-mdebug" -.PD 0 -.IP "\fB\-no\-mdebug\fR" 4 -.IX Item "-no-mdebug" -.PD -Cause stabs-style debugging output to go into an ECOFF-style .mdebug -section instead of the standard \s-1ELF\s0 .stabs sections. -.IP "\fB\-mpdr\fR" 4 -.IX Item "-mpdr" -.PD 0 -.IP "\fB\-mno\-pdr\fR" 4 -.IX Item "-mno-pdr" -.PD -Control generation of \f(CW\*(C`.pdr\*(C'\fR sections. -.IP "\fB\-mgp32\fR" 4 -.IX Item "-mgp32" -.PD 0 -.IP "\fB\-mfp32\fR" 4 -.IX Item "-mfp32" -.PD -The register sizes are normally inferred from the \s-1ISA\s0 and \s-1ABI\s0, but these -flags force a certain group of registers to be treated as 32 bits wide at -all times. \fB\-mgp32\fR controls the size of general-purpose registers -and \fB\-mfp32\fR controls the size of floating-point registers. -.IP "\fB\-mips16\fR" 4 -.IX Item "-mips16" -.PD 0 -.IP "\fB\-no\-mips16\fR" 4 -.IX Item "-no-mips16" -.PD -Generate code for the \s-1MIPS\s0 16 processor. This is equivalent to putting -\&\f(CW\*(C`.set mips16\*(C'\fR at the start of the assembly file. \fB\-no\-mips16\fR -turns off this option. -.IP "\fB\-mips3d\fR" 4 -.IX Item "-mips3d" -.PD 0 -.IP "\fB\-no\-mips3d\fR" 4 -.IX Item "-no-mips3d" -.PD -Generate code for the \s-1MIPS\-3D\s0 Application Specific Extension. -This tells the assembler to accept \s-1MIPS\-3D\s0 instructions. -\&\fB\-no\-mips3d\fR turns off this option. -.IP "\fB\-mdmx\fR" 4 -.IX Item "-mdmx" -.PD 0 -.IP "\fB\-no\-mdmx\fR" 4 -.IX Item "-no-mdmx" -.PD -Generate code for the \s-1MDMX\s0 Application Specific Extension. -This tells the assembler to accept \s-1MDMX\s0 instructions. -\&\fB\-no\-mdmx\fR turns off this option. -.IP "\fB\-mdsp\fR" 4 -.IX Item "-mdsp" -.PD 0 -.IP "\fB\-mno\-dsp\fR" 4 -.IX Item "-mno-dsp" -.PD -Generate code for the \s-1DSP\s0 Application Specific Extension. -This tells the assembler to accept \s-1DSP\s0 instructions. -\&\fB\-mno\-dsp\fR turns off this option. -.IP "\fB\-mmt\fR" 4 -.IX Item "-mmt" -.PD 0 -.IP "\fB\-mno\-mt\fR" 4 -.IX Item "-mno-mt" -.PD -Generate code for the \s-1MT\s0 Application Specific Extension. -This tells the assembler to accept \s-1MT\s0 instructions. -\&\fB\-mno\-mt\fR turns off this option. -.IP "\fB\-\-construct\-floats\fR" 4 -.IX Item "--construct-floats" -.PD 0 -.IP "\fB\-\-no\-construct\-floats\fR" 4 -.IX Item "--no-construct-floats" -.PD -The \fB\-\-no\-construct\-floats\fR option disables the construction of -double width floating point constants by loading the two halves of the -value into the two single width floating point registers that make up -the double width register. By default \fB\-\-construct\-floats\fR is -selected, allowing construction of these floating point constants. -.IP "\fB\-\-emulation=\fR\fIname\fR" 4 -.IX Item "--emulation=name" -This option causes \fBas\fR to emulate \fBas\fR configured -for some other target, in all respects, including output format (choosing -between \s-1ELF\s0 and \s-1ECOFF\s0 only), handling of pseudo-opcodes which may generate -debugging information or store symbol table information, and default -endianness. The available configuration names are: \fBmipsecoff\fR, -\&\fBmipself\fR, \fBmipslecoff\fR, \fBmipsbecoff\fR, \fBmipslelf\fR, -\&\fBmipsbelf\fR. The first two do not alter the default endianness from that -of the primary target for which the assembler was configured; the others change -the default to little\- or big-endian as indicated by the \fBb\fR or \fBl\fR -in the name. Using \fB\-EB\fR or \fB\-EL\fR will override the endianness -selection in any case. -.Sp -This option is currently supported only when the primary target -\&\fBas\fR is configured for is a \s-1MIPS\s0 \s-1ELF\s0 or \s-1ECOFF\s0 target. -Furthermore, the primary target or others specified with -\&\fB\-\-enable\-targets=...\fR at configuration time must include support for -the other format, if both are to be available. For example, the Irix 5 -configuration includes support for both. -.Sp -Eventually, this option will support more configurations, with more -fine-grained control over the assembler's behavior, and will be supported for -more processors. -.IP "\fB\-nocpp\fR" 4 -.IX Item "-nocpp" -\&\fBas\fR ignores this option. It is accepted for compatibility with -the native tools. -.IP "\fB\-\-trap\fR" 4 -.IX Item "--trap" -.PD 0 -.IP "\fB\-\-no\-trap\fR" 4 -.IX Item "--no-trap" -.IP "\fB\-\-break\fR" 4 -.IX Item "--break" -.IP "\fB\-\-no\-break\fR" 4 -.IX Item "--no-break" -.PD -Control how to deal with multiplication overflow and division by zero. -\&\fB\-\-trap\fR or \fB\-\-no\-break\fR (which are synonyms) take a trap exception -(and only work for Instruction Set Architecture level 2 and higher); -\&\fB\-\-break\fR or \fB\-\-no\-trap\fR (also synonyms, and the default) take a -break exception. -.IP "\fB\-n\fR" 4 -.IX Item "-n" -When this option is used, \fBas\fR will issue a warning every -time it generates a nop instruction from a macro. -.PP -The following options are available when as is configured for -an MCore processor. -.IP "\fB\-jsri2bsr\fR" 4 -.IX Item "-jsri2bsr" -.PD 0 -.IP "\fB\-nojsri2bsr\fR" 4 -.IX Item "-nojsri2bsr" -.PD -Enable or disable the \s-1JSRI\s0 to \s-1BSR\s0 transformation. By default this is enabled. -The command line option \fB\-nojsri2bsr\fR can be used to disable it. -.IP "\fB\-sifilter\fR" 4 -.IX Item "-sifilter" -.PD 0 -.IP "\fB\-nosifilter\fR" 4 -.IX Item "-nosifilter" -.PD -Enable or disable the silicon filter behaviour. By default this is disabled. -The default can be overridden by the \fB\-sifilter\fR command line option. -.IP "\fB\-relax\fR" 4 -.IX Item "-relax" -Alter jump instructions for long displacements. -.IP "\fB\-mcpu=[210|340]\fR" 4 -.IX Item "-mcpu=[210|340]" -Select the cpu type on the target hardware. This controls which instructions -can be assembled. -.IP "\fB\-EB\fR" 4 -.IX Item "-EB" -Assemble for a big endian target. -.IP "\fB\-EL\fR" 4 -.IX Item "-EL" -Assemble for a little endian target. -.PP -See the info pages for documentation of the MMIX-specific options. -.PP -The following options are available when as is configured for -an Xtensa processor. -.IP "\fB\-\-text\-section\-literals | \-\-no\-text\-section\-literals\fR" 4 -.IX Item "--text-section-literals | --no-text-section-literals" -With \fB\-\-text\-section\-literals\fR, literal pools are interspersed -in the text section. The default is -\&\fB\-\-no\-text\-section\-literals\fR, which places literals in a -separate section in the output file. These options only affect literals -referenced via PC-relative \f(CW\*(C`L32R\*(C'\fR instructions; literals for -absolute mode \f(CW\*(C`L32R\*(C'\fR instructions are handled separately. -.IP "\fB\-\-absolute\-literals | \-\-no\-absolute\-literals\fR" 4 -.IX Item "--absolute-literals | --no-absolute-literals" -Indicate to the assembler whether \f(CW\*(C`L32R\*(C'\fR instructions use absolute -or PC-relative addressing. The default is to assume absolute addressing -if the Xtensa processor includes the absolute \f(CW\*(C`L32R\*(C'\fR addressing -option. Otherwise, only the PC-relative \f(CW\*(C`L32R\*(C'\fR mode can be used. -.IP "\fB\-\-target\-align | \-\-no\-target\-align\fR" 4 -.IX Item "--target-align | --no-target-align" -Enable or disable automatic alignment to reduce branch penalties at the -expense of some code density. The default is \fB\-\-target\-align\fR. -.IP "\fB\-\-longcalls | \-\-no\-longcalls\fR" 4 -.IX Item "--longcalls | --no-longcalls" -Enable or disable transformation of call instructions to allow calls -across a greater range of addresses. The default is -\&\fB\-\-no\-longcalls\fR. -.IP "\fB\-\-transform | \-\-no\-transform\fR" 4 -.IX Item "--transform | --no-transform" -Enable or disable all assembler transformations of Xtensa instructions. -The default is \fB\-\-transform\fR; -\&\fB\-\-no\-transform\fR should be used only in the rare cases when the -instructions must be exactly as specified in the assembly source. -.PP -The following options are available when as is configured for -a Z80 family processor. -.IP "\fB\-z80\fR" 4 -.IX Item "-z80" -Assemble for Z80 processor. -.IP "\fB\-r800\fR" 4 -.IX Item "-r800" -Assemble for R800 processor. -.IP "\fB\-ignore\-undocumented\-instructions\fR" 4 -.IX Item "-ignore-undocumented-instructions" -.PD 0 -.IP "\fB\-Wnud\fR" 4 -.IX Item "-Wnud" -.PD -Assemble undocumented Z80 instructions that also work on R800 without warning. -.IP "\fB\-ignore\-unportable\-instructions\fR" 4 -.IX Item "-ignore-unportable-instructions" -.PD 0 -.IP "\fB\-Wnup\fR" 4 -.IX Item "-Wnup" -.PD -Assemble all undocumented Z80 instructions without warning. -.IP "\fB\-warn\-undocumented\-instructions\fR" 4 -.IX Item "-warn-undocumented-instructions" -.PD 0 -.IP "\fB\-Wud\fR" 4 -.IX Item "-Wud" -.PD -Issue a warning for undocumented Z80 instructions that also work on R800. -.IP "\fB\-warn\-unportable\-instructions\fR" 4 -.IX Item "-warn-unportable-instructions" -.PD 0 -.IP "\fB\-Wup\fR" 4 -.IX Item "-Wup" -.PD -Issue a warning for undocumented Z80 instructions that do notwork on R800. -.IP "\fB\-forbid\-undocumented\-instructions\fR" 4 -.IX Item "-forbid-undocumented-instructions" -.PD 0 -.IP "\fB\-Fud\fR" 4 -.IX Item "-Fud" -.PD -Treat all undocumented instructions as errors. -.IP "\fB\-forbid\-unportable\-instructions\fR" 4 -.IX Item "-forbid-unportable-instructions" -.PD 0 -.IP "\fB\-Fup\fR" 4 -.IX Item "-Fup" -.PD -Treat undocumented Z80 intructions that do notwork on R800 as errors. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIgcc\fR\|(1), \fIld\fR\|(1), and the Info entries for \fIbinutils\fR and \fIld\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/gas/doc/as.info b/gas/doc/as.info deleted file mode 100644 index adf3ed4558b..00000000000 --- a/gas/doc/as.info +++ /dev/null @@ -1,18352 +0,0 @@ -This is ../.././gas/doc/as.info, produced by makeinfo version 4.8 from -../.././gas/doc/as.texinfo. - -START-INFO-DIR-ENTRY -* As: (as). The GNU assembler. -* Gas: (as). The GNU assembler. -END-INFO-DIR-ENTRY - - This file documents the GNU Assembler "as". - - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 -Free Software Foundation, Inc. - - Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.1 or -any later version published by the Free Software Foundation; with no -Invariant Sections, with no Front-Cover Texts, and with no Back-Cover -Texts. A copy of the license is included in the section entitled "GNU -Free Documentation License". - - -File: as.info, Node: Top, Next: Overview, Up: (dir) - -Using as -******** - -This file is a user guide to the GNU assembler `as' version 2.17. - - This document is distributed under the terms of the GNU Free -Documentation License. A copy of the license is included in the -section entitled "GNU Free Documentation License". - -* Menu: - -* Overview:: Overview -* Invoking:: Command-Line Options -* Syntax:: Syntax -* Sections:: Sections and Relocation -* Symbols:: Symbols -* Expressions:: Expressions -* Pseudo Ops:: Assembler Directives -* Machine Dependencies:: Machine Dependent Features -* Reporting Bugs:: Reporting Bugs -* Acknowledgements:: Who Did What -* GNU Free Documentation License:: GNU Free Documentation License -* Index:: Index - - -File: as.info, Node: Overview, Next: Invoking, Prev: Top, Up: Top - -1 Overview -********** - -Here is a brief summary of how to invoke `as'. For details, *note -Command-Line Options: Invoking. - - as [-a[cdhlns][=FILE]] [-alternate] [-D] - [-defsym SYM=VAL] [-f] [-g] [-gstabs] - [-gstabs+] [-gdwarf-2] [-help] [-I DIR] [-J] - [-K] [-L] [-listing-lhs-width=NUM] - [-listing-lhs-width2=NUM] [-listing-rhs-width=NUM] - [-listing-cont-lines=NUM] [-keep-locals] [-o - OBJFILE] [-R] [-reduce-memory-overheads] [-statistics] - [-v] [-version] [-version] [-W] [-warn] - [-fatal-warnings] [-w] [-x] [-Z] [@FILE] - [-target-help] [TARGET-OPTIONS] - [-|FILES ...] - - _Target Alpha options:_ - [-mCPU] - [-mdebug | -no-mdebug] - [-relax] [-g] [-GSIZE] - [-F] [-32addr] - - _Target ARC options:_ - [-marc[5|6|7|8]] - [-EB|-EL] - - _Target ARM options:_ - [-mcpu=PROCESSOR[+EXTENSION...]] - [-march=ARCHITECTURE[+EXTENSION...]] - [-mfpu=FLOATING-POINT-FORMAT] - [-mfloat-abi=ABI] - [-meabi=VER] - [-mthumb] - [-EB|-EL] - [-mapcs-32|-mapcs-26|-mapcs-float| - -mapcs-reentrant] - [-mthumb-interwork] [-k] - - _Target CRIS options:_ - [-underscore | -no-underscore] - [-pic] [-N] - [-emulation=criself | -emulation=crisaout] - [-march=v0_v10 | -march=v10 | -march=v32 | -march=common_v10_v32] - - _Target D10V options:_ - [-O] - - _Target D30V options:_ - [-O|-n|-N] - - _Target i386 options:_ - [-32|-64] [-n] - - _Target i960 options:_ - [-ACA|-ACA_A|-ACB|-ACC|-AKA|-AKB| - -AKC|-AMC] - [-b] [-no-relax] - - _Target IA-64 options:_ - [-mconstant-gp|-mauto-pic] - [-milp32|-milp64|-mlp64|-mp64] - [-mle|mbe] - [-mtune=itanium1|-mtune=itanium2] - [-munwind-check=warning|-munwind-check=error] - [-mhint.b=ok|-mhint.b=warning|-mhint.b=error] - [-x|-xexplicit] [-xauto] [-xdebug] - - _Target IP2K options:_ - [-mip2022|-mip2022ext] - - _Target M32C options:_ - [-m32c|-m16c] - - _Target M32R options:_ - [-m32rx|-[no-]warn-explicit-parallel-conflicts| - -W[n]p] - - _Target M680X0 options:_ - [-l] [-m68000|-m68010|-m68020|...] - - _Target M68HC11 options:_ - [-m68hc11|-m68hc12|-m68hcs12] - [-mshort|-mlong] - [-mshort-double|-mlong-double] - [-force-long-branchs] [-short-branchs] - [-strict-direct-mode] [-print-insn-syntax] - [-print-opcodes] [-generate-example] - - _Target MCORE options:_ - [-jsri2bsr] [-sifilter] [-relax] - [-mcpu=[210|340]] - - _Target MIPS options:_ - [-nocpp] [-EL] [-EB] [-O[OPTIMIZATION LEVEL]] - [-g[DEBUG LEVEL]] [-G NUM] [-KPIC] [-call_shared] - [-non_shared] [-xgot] - [-mabi=ABI] [-32] [-n32] [-64] [-mfp32] [-mgp32] - [-march=CPU] [-mtune=CPU] [-mips1] [-mips2] - [-mips3] [-mips4] [-mips5] [-mips32] [-mips32r2] - [-mips64] [-mips64r2] - [-construct-floats] [-no-construct-floats] - [-trap] [-no-break] [-break] [-no-trap] - [-mfix7000] [-mno-fix7000] - [-mips16] [-no-mips16] - [-mips3d] [-no-mips3d] - [-mdmx] [-no-mdmx] - [-mdsp] [-mno-dsp] - [-mmt] [-mno-mt] - [-mdebug] [-no-mdebug] - [-mpdr] [-mno-pdr] - - _Target MMIX options:_ - [-fixed-special-register-names] [-globalize-symbols] - [-gnu-syntax] [-relax] [-no-predefined-symbols] - [-no-expand] [-no-merge-gregs] [-x] - [-linker-allocated-gregs] - - _Target PDP11 options:_ - [-mpic|-mno-pic] [-mall] [-mno-extensions] - [-mEXTENSION|-mno-EXTENSION] - [-mCPU] [-mMACHINE] - - _Target picoJava options:_ - [-mb|-me] - - _Target PowerPC options:_ - [-mpwrx|-mpwr2|-mpwr|-m601|-mppc|-mppc32|-m603|-m604| - -m403|-m405|-mppc64|-m620|-mppc64bridge|-mbooke| - -mbooke32|-mbooke64] - [-mcom|-many|-maltivec] [-memb] - [-mregnames|-mno-regnames] - [-mrelocatable|-mrelocatable-lib] - [-mlittle|-mlittle-endian|-mbig|-mbig-endian] - [-msolaris|-mno-solaris] - - _Target SPARC options:_ - [-Av6|-Av7|-Av8|-Asparclet|-Asparclite - -Av8plus|-Av8plusa|-Av9|-Av9a] - [-xarch=v8plus|-xarch=v8plusa] [-bump] - [-32|-64] - - _Target TIC54X options:_ - [-mcpu=54[123589]|-mcpu=54[56]lp] [-mfar-mode|-mf] - [-merrors-to-file |-me ] - - - _Target Z80 options:_ - [-z80] [-r800] - [ -ignore-undocumented-instructions] [-Wnud] - [ -ignore-unportable-instructions] [-Wnup] - [ -warn-undocumented-instructions] [-Wud] - [ -warn-unportable-instructions] [-Wup] - [ -forbid-undocumented-instructions] [-Fud] - [ -forbid-unportable-instructions] [-Fup] - - - _Target Xtensa options:_ - [-[no-]text-section-literals] [-[no-]absolute-literals] - [-[no-]target-align] [-[no-]longcalls] - [-[no-]transform] - [-rename-section OLDNAME=NEWNAME] - -`@FILE' - Read command-line options from FILE. The options read are - inserted in place of the original @FILE option. If FILE does not - exist, or cannot be read, then the option will be treated - literally, and not removed. - - Options in FILE are separated by whitespace. A whitespace - character may be included in an option by surrounding the entire - option in either single or double quotes. Any character - (including a backslash) may be included by prefixing the character - to be included with a backslash. The FILE may itself contain - additional @FILE options; any such options will be processed - recursively. - -`-a[cdhlmns]' - Turn on listings, in any of a variety of ways: - - `-ac' - omit false conditionals - - `-ad' - omit debugging directives - - `-ah' - include high-level source - - `-al' - include assembly - - `-am' - include macro expansions - - `-an' - omit forms processing - - `-as' - include symbols - - `=file' - set the name of the listing file - - You may combine these options; for example, use `-aln' for assembly - listing without forms processing. The `=file' option, if used, - must be the last one. By itself, `-a' defaults to `-ahls'. - -`--alternate' - Begin in alternate macro mode, see *Note `.altmacro': Altmacro. - -`-D' - Ignored. This option is accepted for script compatibility with - calls to other assemblers. - -`--defsym SYM=VALUE' - Define the symbol SYM to be VALUE before assembling the input file. - VALUE must be an integer constant. As in C, a leading `0x' - indicates a hexadecimal value, and a leading `0' indicates an - octal value. - -`-f' - "fast"--skip whitespace and comment preprocessing (assume source is - compiler output). - -`-g' -`--gen-debug' - Generate debugging information for each assembler source line - using whichever debug format is preferred by the target. This - currently means either STABS, ECOFF or DWARF2. - -`--gstabs' - Generate stabs debugging information for each assembler line. This - may help debugging assembler code, if the debugger can handle it. - -`--gstabs+' - Generate stabs debugging information for each assembler line, with - GNU extensions that probably only gdb can handle, and that could - make other debuggers crash or refuse to read your program. This - may help debugging assembler code. Currently the only GNU - extension is the location of the current working directory at - assembling time. - -`--gdwarf-2' - Generate DWARF2 debugging information for each assembler line. - This may help debugging assembler code, if the debugger can handle - it. Note--this option is only supported by some targets, not all - of them. - -`--help' - Print a summary of the command line options and exit. - -`--target-help' - Print a summary of all target specific options and exit. - -`-I DIR' - Add directory DIR to the search list for `.include' directives. - -`-J' - Don't warn about signed overflow. - -`-K' - Issue warnings when difference tables altered for long - displacements. - -`-L' -`--keep-locals' - Keep (in the symbol table) local symbols. On traditional a.out - systems these start with `L', but different systems have different - local label prefixes. - -`--listing-lhs-width=NUMBER' - Set the maximum width, in words, of the output data column for an - assembler listing to NUMBER. - -`--listing-lhs-width2=NUMBER' - Set the maximum width, in words, of the output data column for - continuation lines in an assembler listing to NUMBER. - -`--listing-rhs-width=NUMBER' - Set the maximum width of an input source line, as displayed in a - listing, to NUMBER bytes. - -`--listing-cont-lines=NUMBER' - Set the maximum number of lines printed in a listing for a single - line of input to NUMBER + 1. - -`-o OBJFILE' - Name the object-file output from `as' OBJFILE. - -`-R' - Fold the data section into the text section. - - Set the default size of GAS's hash tables to a prime number close - to NUMBER. Increasing this value can reduce the length of time it - takes the assembler to perform its tasks, at the expense of - increasing the assembler's memory requirements. Similarly - reducing this value can reduce the memory requirements at the - expense of speed. - -`--reduce-memory-overheads' - This option reduces GAS's memory requirements, at the expense of - making the assembly processes slower. Currently this switch is a - synonym for `--hash-size=4051', but in the future it may have - other effects as well. - -`--statistics' - Print the maximum space (in bytes) and total time (in seconds) - used by assembly. - -`--strip-local-absolute' - Remove local absolute symbols from the outgoing symbol table. - -`-v' -`-version' - Print the `as' version. - -`--version' - Print the `as' version and exit. - -`-W' -`--no-warn' - Suppress warning messages. - -`--fatal-warnings' - Treat warnings as errors. - -`--warn' - Don't suppress warning messages or treat them as errors. - -`-w' - Ignored. - -`-x' - Ignored. - -`-Z' - Generate an object file even after errors. - -`-- | FILES ...' - Standard input, or source files to assemble. - - - The following options are available when as is configured for an ARC -processor. - -`-marc[5|6|7|8]' - This option selects the core processor variant. - -`-EB | -EL' - Select either big-endian (-EB) or little-endian (-EL) output. - - The following options are available when as is configured for the ARM -processor family. - -`-mcpu=PROCESSOR[+EXTENSION...]' - Specify which ARM processor variant is the target. - -`-march=ARCHITECTURE[+EXTENSION...]' - Specify which ARM architecture variant is used by the target. - -`-mfpu=FLOATING-POINT-FORMAT' - Select which Floating Point architecture is the target. - -`-mfloat-abi=ABI' - Select which floating point ABI is in use. - -`-mthumb' - Enable Thumb only instruction decoding. - -`-mapcs-32 | -mapcs-26 | -mapcs-float | -mapcs-reentrant' - Select which procedure calling convention is in use. - -`-EB | -EL' - Select either big-endian (-EB) or little-endian (-EL) output. - -`-mthumb-interwork' - Specify that the code has been generated with interworking between - Thumb and ARM code in mind. - -`-k' - Specify that PIC code has been generated. - - See the info pages for documentation of the CRIS-specific options. - - The following options are available when as is configured for a D10V -processor. -`-O' - Optimize output by parallelizing instructions. - - The following options are available when as is configured for a D30V -processor. -`-O' - Optimize output by parallelizing instructions. - -`-n' - Warn when nops are generated. - -`-N' - Warn when a nop after a 32-bit multiply instruction is generated. - - The following options are available when as is configured for the -Intel 80960 processor. - -`-ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC' - Specify which variant of the 960 architecture is the target. - -`-b' - Add code to collect statistics about branches taken. - -`-no-relax' - Do not alter compare-and-branch instructions for long - displacements; error if necessary. - - - The following options are available when as is configured for the -Ubicom IP2K series. - -`-mip2022ext' - Specifies that the extended IP2022 instructions are allowed. - -`-mip2022' - Restores the default behaviour, which restricts the permitted - instructions to just the basic IP2022 ones. - - - The following options are available when as is configured for the -Renesas M32C and M16C processors. - -`-m32c' - Assemble M32C instructions. - -`-m16c' - Assemble M16C instructions (the default). - - - The following options are available when as is configured for the -Renesas M32R (formerly Mitsubishi M32R) series. - -`--m32rx' - Specify which processor in the M32R family is the target. The - default is normally the M32R, but this option changes it to the - M32RX. - -`--warn-explicit-parallel-conflicts or --Wp' - Produce warning messages when questionable parallel constructs are - encountered. - -`--no-warn-explicit-parallel-conflicts or --Wnp' - Do not produce warning messages when questionable parallel - constructs are encountered. - - - The following options are available when as is configured for the -Motorola 68000 series. - -`-l' - Shorten references to undefined symbols, to one word instead of - two. - -`-m68000 | -m68008 | -m68010 | -m68020 | -m68030' -`| -m68040 | -m68060 | -m68302 | -m68331 | -m68332' -`| -m68333 | -m68340 | -mcpu32 | -m5200' - Specify what processor in the 68000 family is the target. The - default is normally the 68020, but this can be changed at - configuration time. - -`-m68881 | -m68882 | -mno-68881 | -mno-68882' - The target machine does (or does not) have a floating-point - coprocessor. The default is to assume a coprocessor for 68020, - 68030, and cpu32. Although the basic 68000 is not compatible with - the 68881, a combination of the two can be specified, since it's - possible to do emulation of the coprocessor instructions with the - main processor. - -`-m68851 | -mno-68851' - The target machine does (or does not) have a memory-management - unit coprocessor. The default is to assume an MMU for 68020 and - up. - - - For details about the PDP-11 machine dependent features options, see -*Note PDP-11-Options::. - -`-mpic | -mno-pic' - Generate position-independent (or position-dependent) code. The - default is `-mpic'. - -`-mall' -`-mall-extensions' - Enable all instruction set extensions. This is the default. - -`-mno-extensions' - Disable all instruction set extensions. - -`-mEXTENSION | -mno-EXTENSION' - Enable (or disable) a particular instruction set extension. - -`-mCPU' - Enable the instruction set extensions supported by a particular - CPU, and disable all other extensions. - -`-mMACHINE' - Enable the instruction set extensions supported by a particular - machine model, and disable all other extensions. - - The following options are available when as is configured for a -picoJava processor. - -`-mb' - Generate "big endian" format output. - -`-ml' - Generate "little endian" format output. - - - The following options are available when as is configured for the -Motorola 68HC11 or 68HC12 series. - -`-m68hc11 | -m68hc12 | -m68hcs12' - Specify what processor is the target. The default is defined by - the configuration option when building the assembler. - -`-mshort' - Specify to use the 16-bit integer ABI. - -`-mlong' - Specify to use the 32-bit integer ABI. - -`-mshort-double' - Specify to use the 32-bit double ABI. - -`-mlong-double' - Specify to use the 64-bit double ABI. - -`--force-long-branchs' - Relative branches are turned into absolute ones. This concerns - conditional branches, unconditional branches and branches to a sub - routine. - -`-S | --short-branchs' - Do not turn relative branchs into absolute ones when the offset is - out of range. - -`--strict-direct-mode' - Do not turn the direct addressing mode into extended addressing - mode when the instruction does not support direct addressing mode. - -`--print-insn-syntax' - Print the syntax of instruction in case of error. - -`--print-opcodes' - print the list of instructions with syntax and then exit. - -`--generate-example' - print an example of instruction for each possible instruction and - then exit. This option is only useful for testing `as'. - - - The following options are available when `as' is configured for the -SPARC architecture: - -`-Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite' -`-Av8plus | -Av8plusa | -Av9 | -Av9a' - Explicitly select a variant of the SPARC architecture. - - `-Av8plus' and `-Av8plusa' select a 32 bit environment. `-Av9' - and `-Av9a' select a 64 bit environment. - - `-Av8plusa' and `-Av9a' enable the SPARC V9 instruction set with - UltraSPARC extensions. - -`-xarch=v8plus | -xarch=v8plusa' - For compatibility with the Solaris v9 assembler. These options are - equivalent to -Av8plus and -Av8plusa, respectively. - -`-bump' - Warn when the assembler switches to another architecture. - - The following options are available when as is configured for the -'c54x architecture. - -`-mfar-mode' - Enable extended addressing mode. All addresses and relocations - will assume extended addressing (usually 23 bits). - -`-mcpu=CPU_VERSION' - Sets the CPU version being compiled for. - -`-merrors-to-file FILENAME' - Redirect error output to a file, for broken systems which don't - support such behaviour in the shell. - - The following options are available when as is configured for a MIPS -processor. - -`-G NUM' - This option sets the largest size of an object that can be - referenced implicitly with the `gp' register. It is only accepted - for targets that use ECOFF format, such as a DECstation running - Ultrix. The default value is 8. - -`-EB' - Generate "big endian" format output. - -`-EL' - Generate "little endian" format output. - -`-mips1' -`-mips2' -`-mips3' -`-mips4' -`-mips5' -`-mips32' -`-mips32r2' -`-mips64' -`-mips64r2' - Generate code for a particular MIPS Instruction Set Architecture - level. `-mips1' is an alias for `-march=r3000', `-mips2' is an - alias for `-march=r6000', `-mips3' is an alias for `-march=r4000' - and `-mips4' is an alias for `-march=r8000'. `-mips5', `-mips32', - `-mips32r2', `-mips64', and `-mips64r2' correspond to generic - `MIPS V', `MIPS32', `MIPS32 Release 2', `MIPS64', and `MIPS64 - Release 2' ISA processors, respectively. - -`-march=CPU' - Generate code for a particular MIPS cpu. - -`-mtune=CPU' - Schedule and tune for a particular MIPS cpu. - -`-mfix7000' -`-mno-fix7000' - Cause nops to be inserted if the read of the destination register - of an mfhi or mflo instruction occurs in the following two - instructions. - -`-mdebug' -`-no-mdebug' - Cause stabs-style debugging output to go into an ECOFF-style - .mdebug section instead of the standard ELF .stabs sections. - -`-mpdr' -`-mno-pdr' - Control generation of `.pdr' sections. - -`-mgp32' -`-mfp32' - The register sizes are normally inferred from the ISA and ABI, but - these flags force a certain group of registers to be treated as 32 - bits wide at all times. `-mgp32' controls the size of - general-purpose registers and `-mfp32' controls the size of - floating-point registers. - -`-mips16' -`-no-mips16' - Generate code for the MIPS 16 processor. This is equivalent to - putting `.set mips16' at the start of the assembly file. - `-no-mips16' turns off this option. - -`-mips3d' -`-no-mips3d' - Generate code for the MIPS-3D Application Specific Extension. - This tells the assembler to accept MIPS-3D instructions. - `-no-mips3d' turns off this option. - -`-mdmx' -`-no-mdmx' - Generate code for the MDMX Application Specific Extension. This - tells the assembler to accept MDMX instructions. `-no-mdmx' turns - off this option. - -`-mdsp' -`-mno-dsp' - Generate code for the DSP Application Specific Extension. This - tells the assembler to accept DSP instructions. `-mno-dsp' turns - off this option. - -`-mmt' -`-mno-mt' - Generate code for the MT Application Specific Extension. This - tells the assembler to accept MT instructions. `-mno-mt' turns - off this option. - -`--construct-floats' -`--no-construct-floats' - The `--no-construct-floats' option disables the construction of - double width floating point constants by loading the two halves of - the value into the two single width floating point registers that - make up the double width register. By default - `--construct-floats' is selected, allowing construction of these - floating point constants. - -`--emulation=NAME' - This option causes `as' to emulate `as' configured for some other - target, in all respects, including output format (choosing between - ELF and ECOFF only), handling of pseudo-opcodes which may generate - debugging information or store symbol table information, and - default endianness. The available configuration names are: - `mipsecoff', `mipself', `mipslecoff', `mipsbecoff', `mipslelf', - `mipsbelf'. The first two do not alter the default endianness - from that of the primary target for which the assembler was - configured; the others change the default to little- or big-endian - as indicated by the `b' or `l' in the name. Using `-EB' or `-EL' - will override the endianness selection in any case. - - This option is currently supported only when the primary target - `as' is configured for is a MIPS ELF or ECOFF target. - Furthermore, the primary target or others specified with - `--enable-targets=...' at configuration time must include support - for the other format, if both are to be available. For example, - the Irix 5 configuration includes support for both. - - Eventually, this option will support more configurations, with more - fine-grained control over the assembler's behavior, and will be - supported for more processors. - -`-nocpp' - `as' ignores this option. It is accepted for compatibility with - the native tools. - -`--trap' -`--no-trap' -`--break' -`--no-break' - Control how to deal with multiplication overflow and division by - zero. `--trap' or `--no-break' (which are synonyms) take a trap - exception (and only work for Instruction Set Architecture level 2 - and higher); `--break' or `--no-trap' (also synonyms, and the - default) take a break exception. - -`-n' - When this option is used, `as' will issue a warning every time it - generates a nop instruction from a macro. - - The following options are available when as is configured for an -MCore processor. - -`-jsri2bsr' -`-nojsri2bsr' - Enable or disable the JSRI to BSR transformation. By default this - is enabled. The command line option `-nojsri2bsr' can be used to - disable it. - -`-sifilter' -`-nosifilter' - Enable or disable the silicon filter behaviour. By default this - is disabled. The default can be overridden by the `-sifilter' - command line option. - -`-relax' - Alter jump instructions for long displacements. - -`-mcpu=[210|340]' - Select the cpu type on the target hardware. This controls which - instructions can be assembled. - -`-EB' - Assemble for a big endian target. - -`-EL' - Assemble for a little endian target. - - - See the info pages for documentation of the MMIX-specific options. - - The following options are available when as is configured for an -Xtensa processor. - -`--text-section-literals | --no-text-section-literals' - With `--text-section-literals', literal pools are interspersed in - the text section. The default is `--no-text-section-literals', - which places literals in a separate section in the output file. - These options only affect literals referenced via PC-relative - `L32R' instructions; literals for absolute mode `L32R' - instructions are handled separately. - -`--absolute-literals | --no-absolute-literals' - Indicate to the assembler whether `L32R' instructions use absolute - or PC-relative addressing. The default is to assume absolute - addressing if the Xtensa processor includes the absolute `L32R' - addressing option. Otherwise, only the PC-relative `L32R' mode - can be used. - -`--target-align | --no-target-align' - Enable or disable automatic alignment to reduce branch penalties - at the expense of some code density. The default is - `--target-align'. - -`--longcalls | --no-longcalls' - Enable or disable transformation of call instructions to allow - calls across a greater range of addresses. The default is - `--no-longcalls'. - -`--transform | --no-transform' - Enable or disable all assembler transformations of Xtensa - instructions. The default is `--transform'; `--no-transform' - should be used only in the rare cases when the instructions must - be exactly as specified in the assembly source. - - The following options are available when as is configured for a Z80 -family processor. -`-z80' - Assemble for Z80 processor. - -`-r800' - Assemble for R800 processor. - -`-ignore-undocumented-instructions' -`-Wnud' - Assemble undocumented Z80 instructions that also work on R800 - without warning. - -`-ignore-unportable-instructions' -`-Wnup' - Assemble all undocumented Z80 instructions without warning. - -`-warn-undocumented-instructions' -`-Wud' - Issue a warning for undocumented Z80 instructions that also work - on R800. - -`-warn-unportable-instructions' -`-Wup' - Issue a warning for undocumented Z80 instructions that do notwork - on R800. - -`-forbid-undocumented-instructions' -`-Fud' - Treat all undocumented instructions as errors. - -`-forbid-unportable-instructions' -`-Fup' - Treat undocumented Z80 intructions that do notwork on R800 as - errors. - -* Menu: - -* Manual:: Structure of this Manual -* GNU Assembler:: The GNU Assembler -* Object Formats:: Object File Formats -* Command Line:: Command Line -* Input Files:: Input Files -* Object:: Output (Object) File -* Errors:: Error and Warning Messages - - -File: as.info, Node: Manual, Next: GNU Assembler, Up: Overview - -1.1 Structure of this Manual -============================ - -This manual is intended to describe what you need to know to use GNU -`as'. We cover the syntax expected in source files, including notation -for symbols, constants, and expressions; the directives that `as' -understands; and of course how to invoke `as'. - - This manual also describes some of the machine-dependent features of -various flavors of the assembler. - - On the other hand, this manual is _not_ intended as an introduction -to programming in assembly language--let alone programming in general! -In a similar vein, we make no attempt to introduce the machine -architecture; we do _not_ describe the instruction set, standard -mnemonics, registers or addressing modes that are standard to a -particular architecture. You may want to consult the manufacturer's -machine architecture manual for this information. - - -File: as.info, Node: GNU Assembler, Next: Object Formats, Prev: Manual, Up: Overview - -1.2 The GNU Assembler -===================== - -GNU `as' is really a family of assemblers. If you use (or have used) -the GNU assembler on one architecture, you should find a fairly similar -environment when you use it on another architecture. Each version has -much in common with the others, including object file formats, most -assembler directives (often called "pseudo-ops") and assembler syntax. - - `as' is primarily intended to assemble the output of the GNU C -compiler `gcc' for use by the linker `ld'. Nevertheless, we've tried -to make `as' assemble correctly everything that other assemblers for -the same machine would assemble. Any exceptions are documented -explicitly (*note Machine Dependencies::). This doesn't mean `as' -always uses the same syntax as another assembler for the same -architecture; for example, we know of several incompatible versions of -680x0 assembly language syntax. - - Unlike older assemblers, `as' is designed to assemble a source -program in one pass of the source file. This has a subtle impact on the -`.org' directive (*note `.org': Org.). - - -File: as.info, Node: Object Formats, Next: Command Line, Prev: GNU Assembler, Up: Overview - -1.3 Object File Formats -======================= - -The GNU assembler can be configured to produce several alternative -object file formats. For the most part, this does not affect how you -write assembly language programs; but directives for debugging symbols -are typically different in different file formats. *Note Symbol -Attributes: Symbol Attributes. - - -File: as.info, Node: Command Line, Next: Input Files, Prev: Object Formats, Up: Overview - -1.4 Command Line -================ - -After the program name `as', the command line may contain options and -file names. Options may appear in any order, and may be before, after, -or between file names. The order of file names is significant. - - `--' (two hyphens) by itself names the standard input file -explicitly, as one of the files for `as' to assemble. - - Except for `--' any command line argument that begins with a hyphen -(`-') is an option. Each option changes the behavior of `as'. No -option changes the way another option works. An option is a `-' -followed by one or more letters; the case of the letter is important. -All options are optional. - - Some options expect exactly one file name to follow them. The file -name may either immediately follow the option's letter (compatible with -older assemblers) or it may be the next command argument (GNU -standard). These two command lines are equivalent: - - as -o my-object-file.o mumble.s - as -omy-object-file.o mumble.s - - -File: as.info, Node: Input Files, Next: Object, Prev: Command Line, Up: Overview - -1.5 Input Files -=============== - -We use the phrase "source program", abbreviated "source", to describe -the program input to one run of `as'. The program may be in one or -more files; how the source is partitioned into files doesn't change the -meaning of the source. - - The source program is a concatenation of the text in all the files, -in the order specified. - - Each time you run `as' it assembles exactly one source program. The -source program is made up of one or more files. (The standard input is -also a file.) - - You give `as' a command line that has zero or more input file names. -The input files are read (from left file name to right). A command -line argument (in any position) that has no special meaning is taken to -be an input file name. - - If you give `as' no file names it attempts to read one input file -from the `as' standard input, which is normally your terminal. You may -have to type to tell `as' there is no more program to assemble. - - Use `--' if you need to explicitly name the standard input file in -your command line. - - If the source is empty, `as' produces a small, empty object file. - -Filenames and Line-numbers --------------------------- - -There are two ways of locating a line in the input file (or files) and -either may be used in reporting error messages. One way refers to a -line number in a physical file; the other refers to a line number in a -"logical" file. *Note Error and Warning Messages: Errors. - - "Physical files" are those files named in the command line given to -`as'. - - "Logical files" are simply names declared explicitly by assembler -directives; they bear no relation to physical files. Logical file -names help error messages reflect the original source file, when `as' -source is itself synthesized from other files. `as' understands the -`#' directives emitted by the `gcc' preprocessor. See also *Note -`.file': File. - - -File: as.info, Node: Object, Next: Errors, Prev: Input Files, Up: Overview - -1.6 Output (Object) File -======================== - -Every time you run `as' it produces an output file, which is your -assembly language program translated into numbers. This file is the -object file. Its default name is `a.out'. You can give it another -name by using the `-o' option. Conventionally, object file names end -with `.o'. The default name is used for historical reasons: older -assemblers were capable of assembling self-contained programs directly -into a runnable program. (For some formats, this isn't currently -possible, but it can be done for the `a.out' format.) - - The object file is meant for input to the linker `ld'. It contains -assembled program code, information to help `ld' integrate the -assembled program into a runnable file, and (optionally) symbolic -information for the debugger. - - -File: as.info, Node: Errors, Prev: Object, Up: Overview - -1.7 Error and Warning Messages -============================== - -`as' may write warnings and error messages to the standard error file -(usually your terminal). This should not happen when a compiler runs -`as' automatically. Warnings report an assumption made so that `as' -could keep assembling a flawed program; errors report a grave problem -that stops the assembly. - - Warning messages have the format - - file_name:NNN:Warning Message Text - -(where NNN is a line number). If a logical file name has been given -(*note `.file': File.) it is used for the filename, otherwise the name -of the current input file is used. If a logical line number was given -(*note `.line': Line.) then it is used to calculate the number printed, -otherwise the actual line in the current source file is printed. The -message text is intended to be self explanatory (in the grand Unix -tradition). - - Error messages have the format - file_name:NNN:FATAL:Error Message Text - The file name and line number are derived as for warning messages. -The actual message text may be rather less explanatory because many of -them aren't supposed to happen. - - -File: as.info, Node: Invoking, Next: Syntax, Prev: Overview, Up: Top - -2 Command-Line Options -********************** - -This chapter describes command-line options available in _all_ versions -of the GNU assembler; *note Machine Dependencies::, for options specific -to particular machine architectures. - - If you are invoking `as' via the GNU C compiler, you can use the -`-Wa' option to pass arguments through to the assembler. The assembler -arguments must be separated from each other (and the `-Wa') by commas. -For example: - - gcc -c -g -O -Wa,-alh,-L file.c - -This passes two options to the assembler: `-alh' (emit a listing to -standard output with high-level and assembly source) and `-L' (retain -local symbols in the symbol table). - - Usually you do not need to use this `-Wa' mechanism, since many -compiler command-line options are automatically passed to the assembler -by the compiler. (You can call the GNU compiler driver with the `-v' -option to see precisely what options it passes to each compilation -pass, including the assembler.) - -* Menu: - -* a:: -a[cdhlns] enable listings -* alternate:: --alternate enable alternate macro syntax -* D:: -D for compatibility -* f:: -f to work faster -* I:: -I for .include search path - -* K:: -K for difference tables - -* L:: -L to retain local labels -* listing:: --listing-XXX to configure listing output -* M:: -M or --mri to assemble in MRI compatibility mode -* MD:: --MD for dependency tracking -* o:: -o to name the object file -* R:: -R to join data and text sections -* statistics:: --statistics to see statistics about assembly -* traditional-format:: --traditional-format for compatible output -* v:: -v to announce version -* W:: -W, --no-warn, --warn, --fatal-warnings to control warnings -* Z:: -Z to make object file even after errors - - -File: as.info, Node: a, Next: alternate, Up: Invoking - -2.1 Enable Listings: `-a[cdhlns]' -================================= - -These options enable listing output from the assembler. By itself, -`-a' requests high-level, assembly, and symbols listing. You can use -other letters to select specific options for the list: `-ah' requests a -high-level language listing, `-al' requests an output-program assembly -listing, and `-as' requests a symbol table listing. High-level -listings require that a compiler debugging option like `-g' be used, -and that assembly listings (`-al') be requested also. - - Use the `-ac' option to omit false conditionals from a listing. Any -lines which are not assembled because of a false `.if' (or `.ifdef', or -any other conditional), or a true `.if' followed by an `.else', will be -omitted from the listing. - - Use the `-ad' option to omit debugging directives from the listing. - - Once you have specified one of these options, you can further control -listing output and its appearance using the directives `.list', -`.nolist', `.psize', `.eject', `.title', and `.sbttl'. The `-an' -option turns off all forms processing. If you do not request listing -output with one of the `-a' options, the listing-control directives -have no effect. - - The letters after `-a' may be combined into one option, _e.g._, -`-aln'. - - Note if the assembler source is coming from the standard input (eg -because it is being created by `gcc' and the `-pipe' command line switch -is being used) then the listing will not contain any comments or -preprocessor directives. This is because the listing code buffers -input source lines from stdin only after they have been preprocessed by -the assembler. This reduces memory usage and makes the code more -efficient. - - -File: as.info, Node: alternate, Next: D, Prev: a, Up: Invoking - -2.2 `--alternate' -================= - -Begin in alternate macro mode, see *Note `.altmacro': Altmacro. - - -File: as.info, Node: D, Next: f, Prev: alternate, Up: Invoking - -2.3 `-D' -======== - -This option has no effect whatsoever, but it is accepted to make it more -likely that scripts written for other assemblers also work with `as'. - - -File: as.info, Node: f, Next: I, Prev: D, Up: Invoking - -2.4 Work Faster: `-f' -===================== - -`-f' should only be used when assembling programs written by a -(trusted) compiler. `-f' stops the assembler from doing whitespace and -comment preprocessing on the input file(s) before assembling them. -*Note Preprocessing: Preprocessing. - - _Warning:_ if you use `-f' when the files actually need to be - preprocessed (if they contain comments, for example), `as' does - not work correctly. - - -File: as.info, Node: I, Next: K, Prev: f, Up: Invoking - -2.5 `.include' Search Path: `-I' PATH -===================================== - -Use this option to add a PATH to the list of directories `as' searches -for files specified in `.include' directives (*note `.include': -Include.). You may use `-I' as many times as necessary to include a -variety of paths. The current working directory is always searched -first; after that, `as' searches any `-I' directories in the same order -as they were specified (left to right) on the command line. - - -File: as.info, Node: K, Next: L, Prev: I, Up: Invoking - -2.6 Difference Tables: `-K' -=========================== - -`as' sometimes alters the code emitted for directives of the form -`.word SYM1-SYM2'; *note `.word': Word. You can use the `-K' option if -you want a warning issued when this is done. - - -File: as.info, Node: L, Next: listing, Prev: K, Up: Invoking - -2.7 Include Local Labels: `-L' -============================== - -Labels beginning with `L' (upper case only) are called "local labels". -*Note Symbol Names::. Normally you do not see such labels when -debugging, because they are intended for the use of programs (like -compilers) that compose assembler programs, not for your notice. -Normally both `as' and `ld' discard such labels, so you do not normally -debug with them. - - This option tells `as' to retain those `L...' symbols in the object -file. Usually if you do this you also tell the linker `ld' to preserve -symbols whose names begin with `L'. - - By default, a local label is any label beginning with `L', but each -target is allowed to redefine the local label prefix. On the HPPA -local labels begin with `L$'. - - -File: as.info, Node: listing, Next: M, Prev: L, Up: Invoking - -2.8 Configuring listing output: `--listing' -=========================================== - -The listing feature of the assembler can be enabled via the command -line switch `-a' (*note a::). This feature combines the input source -file(s) with a hex dump of the corresponding locations in the output -object file, and displays them as a listing file. The format of this -listing can be controlled by pseudo ops inside the assembler source -(*note List:: *note Title:: *note Sbttl:: *note Psize:: *note Eject::) -and also by the following switches: - -`--listing-lhs-width=`number'' - Sets the maximum width, in words, of the first line of the hex - byte dump. This dump appears on the left hand side of the listing - output. - -`--listing-lhs-width2=`number'' - Sets the maximum width, in words, of any further lines of the hex - byte dump for a given input source line. If this value is not - specified, it defaults to being the same as the value specified - for `--listing-lhs-width'. If neither switch is used the default - is to one. - -`--listing-rhs-width=`number'' - Sets the maximum width, in characters, of the source line that is - displayed alongside the hex dump. The default value for this - parameter is 100. The source line is displayed on the right hand - side of the listing output. - -`--listing-cont-lines=`number'' - Sets the maximum number of continuation lines of hex dump that - will be displayed for a given single line of source input. The - default value is 4. - - -File: as.info, Node: M, Next: MD, Prev: listing, Up: Invoking - -2.9 Assemble in MRI Compatibility Mode: `-M' -============================================ - -The `-M' or `--mri' option selects MRI compatibility mode. This -changes the syntax and pseudo-op handling of `as' to make it compatible -with the `ASM68K' or the `ASM960' (depending upon the configured -target) assembler from Microtec Research. The exact nature of the MRI -syntax will not be documented here; see the MRI manuals for more -information. Note in particular that the handling of macros and macro -arguments is somewhat different. The purpose of this option is to -permit assembling existing MRI assembler code using `as'. - - The MRI compatibility is not complete. Certain operations of the -MRI assembler depend upon its object file format, and can not be -supported using other object file formats. Supporting these would -require enhancing each object file format individually. These are: - - * global symbols in common section - - The m68k MRI assembler supports common sections which are merged - by the linker. Other object file formats do not support this. - `as' handles common sections by treating them as a single common - symbol. It permits local symbols to be defined within a common - section, but it can not support global symbols, since it has no - way to describe them. - - * complex relocations - - The MRI assemblers support relocations against a negated section - address, and relocations which combine the start addresses of two - or more sections. These are not support by other object file - formats. - - * `END' pseudo-op specifying start address - - The MRI `END' pseudo-op permits the specification of a start - address. This is not supported by other object file formats. The - start address may instead be specified using the `-e' option to - the linker, or in a linker script. - - * `IDNT', `.ident' and `NAME' pseudo-ops - - The MRI `IDNT', `.ident' and `NAME' pseudo-ops assign a module - name to the output file. This is not supported by other object - file formats. - - * `ORG' pseudo-op - - The m68k MRI `ORG' pseudo-op begins an absolute section at a given - address. This differs from the usual `as' `.org' pseudo-op, which - changes the location within the current section. Absolute - sections are not supported by other object file formats. The - address of a section may be assigned within a linker script. - - There are some other features of the MRI assembler which are not -supported by `as', typically either because they are difficult or -because they seem of little consequence. Some of these may be -supported in future releases. - - * EBCDIC strings - - EBCDIC strings are not supported. - - * packed binary coded decimal - - Packed binary coded decimal is not supported. This means that the - `DC.P' and `DCB.P' pseudo-ops are not supported. - - * `FEQU' pseudo-op - - The m68k `FEQU' pseudo-op is not supported. - - * `NOOBJ' pseudo-op - - The m68k `NOOBJ' pseudo-op is not supported. - - * `OPT' branch control options - - The m68k `OPT' branch control options--`B', `BRS', `BRB', `BRL', - and `BRW'--are ignored. `as' automatically relaxes all branches, - whether forward or backward, to an appropriate size, so these - options serve no purpose. - - * `OPT' list control options - - The following m68k `OPT' list control options are ignored: `C', - `CEX', `CL', `CRE', `E', `G', `I', `M', `MEX', `MC', `MD', `X'. - - * other `OPT' options - - The following m68k `OPT' options are ignored: `NEST', `O', `OLD', - `OP', `P', `PCO', `PCR', `PCS', `R'. - - * `OPT' `D' option is default - - The m68k `OPT' `D' option is the default, unlike the MRI assembler. - `OPT NOD' may be used to turn it off. - - * `XREF' pseudo-op. - - The m68k `XREF' pseudo-op is ignored. - - * `.debug' pseudo-op - - The i960 `.debug' pseudo-op is not supported. - - * `.extended' pseudo-op - - The i960 `.extended' pseudo-op is not supported. - - * `.list' pseudo-op. - - The various options of the i960 `.list' pseudo-op are not - supported. - - * `.optimize' pseudo-op - - The i960 `.optimize' pseudo-op is not supported. - - * `.output' pseudo-op - - The i960 `.output' pseudo-op is not supported. - - * `.setreal' pseudo-op - - The i960 `.setreal' pseudo-op is not supported. - - - -File: as.info, Node: MD, Next: o, Prev: M, Up: Invoking - -2.10 Dependency Tracking: `--MD' -================================ - -`as' can generate a dependency file for the file it creates. This file -consists of a single rule suitable for `make' describing the -dependencies of the main source file. - - The rule is written to the file named in its argument. - - This feature is used in the automatic updating of makefiles. - - -File: as.info, Node: o, Next: R, Prev: MD, Up: Invoking - -2.11 Name the Object File: `-o' -=============================== - -There is always one object file output when you run `as'. By default -it has the name `a.out' (or `b.out', for Intel 960 targets only). You -use this option (which takes exactly one filename) to give the object -file a different name. - - Whatever the object file is called, `as' overwrites any existing -file of the same name. - - -File: as.info, Node: R, Next: statistics, Prev: o, Up: Invoking - -2.12 Join Data and Text Sections: `-R' -====================================== - -`-R' tells `as' to write the object file as if all data-section data -lives in the text section. This is only done at the very last moment: -your binary data are the same, but data section parts are relocated -differently. The data section part of your object file is zero bytes -long because all its bytes are appended to the text section. (*Note -Sections and Relocation: Sections.) - - When you specify `-R' it would be possible to generate shorter -address displacements (because we do not have to cross between text and -data section). We refrain from doing this simply for compatibility with -older versions of `as'. In future, `-R' may work this way. - - When `as' is configured for COFF or ELF output, this option is only -useful if you use sections named `.text' and `.data'. - - `-R' is not supported for any of the HPPA targets. Using `-R' -generates a warning from `as'. - - -File: as.info, Node: statistics, Next: traditional-format, Prev: R, Up: Invoking - -2.13 Display Assembly Statistics: `--statistics' -================================================ - -Use `--statistics' to display two statistics about the resources used by -`as': the maximum amount of space allocated during the assembly (in -bytes), and the total execution time taken for the assembly (in CPU -seconds). - - -File: as.info, Node: traditional-format, Next: v, Prev: statistics, Up: Invoking - -2.14 Compatible Output: `--traditional-format' -============================================== - -For some targets, the output of `as' is different in some ways from the -output of some existing assembler. This switch requests `as' to use -the traditional format instead. - - For example, it disables the exception frame optimizations which -`as' normally does by default on `gcc' output. - - -File: as.info, Node: v, Next: W, Prev: traditional-format, Up: Invoking - -2.15 Announce Version: `-v' -=========================== - -You can find out what version of as is running by including the option -`-v' (which you can also spell as `-version') on the command line. - - -File: as.info, Node: W, Next: Z, Prev: v, Up: Invoking - -2.16 Control Warnings: `-W', `--warn', `--no-warn', `--fatal-warnings' -====================================================================== - -`as' should never give a warning or error message when assembling -compiler output. But programs written by people often cause `as' to -give a warning that a particular assumption was made. All such -warnings are directed to the standard error file. - - If you use the `-W' and `--no-warn' options, no warnings are issued. -This only affects the warning messages: it does not change any -particular of how `as' assembles your file. Errors, which stop the -assembly, are still reported. - - If you use the `--fatal-warnings' option, `as' considers files that -generate warnings to be in error. - - You can switch these options off again by specifying `--warn', which -causes warnings to be output as usual. - - -File: as.info, Node: Z, Prev: W, Up: Invoking - -2.17 Generate Object File in Spite of Errors: `-Z' -================================================== - -After an error message, `as' normally produces no output. If for some -reason you are interested in object file output even after `as' gives -an error message on your program, use the `-Z' option. If there are -any errors, `as' continues anyways, and writes an object file after a -final warning message of the form `N errors, M warnings, generating bad -object file.' - - -File: as.info, Node: Syntax, Next: Sections, Prev: Invoking, Up: Top - -3 Syntax -******** - -This chapter describes the machine-independent syntax allowed in a -source file. `as' syntax is similar to what many other assemblers use; -it is inspired by the BSD 4.2 assembler, except that `as' does not -assemble Vax bit-fields. - -* Menu: - -* Preprocessing:: Preprocessing -* Whitespace:: Whitespace -* Comments:: Comments -* Symbol Intro:: Symbols -* Statements:: Statements -* Constants:: Constants - - -File: as.info, Node: Preprocessing, Next: Whitespace, Up: Syntax - -3.1 Preprocessing -================= - -The `as' internal preprocessor: - * adjusts and removes extra whitespace. It leaves one space or tab - before the keywords on a line, and turns any other whitespace on - the line into a single space. - - * removes all comments, replacing them with a single space, or an - appropriate number of newlines. - - * converts character constants into the appropriate numeric values. - - It does not do macro processing, include file handling, or anything -else you may get from your C compiler's preprocessor. You can do -include file processing with the `.include' directive (*note -`.include': Include.). You can use the GNU C compiler driver to get -other "CPP" style preprocessing by giving the input file a `.S' suffix. -*Note Options Controlling the Kind of Output: (gcc.info)Overall -Options. - - Excess whitespace, comments, and character constants cannot be used -in the portions of the input text that are not preprocessed. - - If the first line of an input file is `#NO_APP' or if you use the -`-f' option, whitespace and comments are not removed from the input -file. Within an input file, you can ask for whitespace and comment -removal in specific portions of the by putting a line that says `#APP' -before the text that may contain whitespace or comments, and putting a -line that says `#NO_APP' after this text. This feature is mainly -intend to support `asm' statements in compilers whose output is -otherwise free of comments and whitespace. - - -File: as.info, Node: Whitespace, Next: Comments, Prev: Preprocessing, Up: Syntax - -3.2 Whitespace -============== - -"Whitespace" is one or more blanks or tabs, in any order. Whitespace -is used to separate symbols, and to make programs neater for people to -read. Unless within character constants (*note Character Constants: -Characters.), any whitespace means the same as exactly one space. - - -File: as.info, Node: Comments, Next: Symbol Intro, Prev: Whitespace, Up: Syntax - -3.3 Comments -============ - -There are two ways of rendering comments to `as'. In both cases the -comment is equivalent to one space. - - Anything from `/*' through the next `*/' is a comment. This means -you may not nest these comments. - - /* - The only way to include a newline ('\n') in a comment - is to use this sort of comment. - */ - - /* This sort of comment does not nest. */ - - Anything from the "line comment" character to the next newline is -considered a comment and is ignored. The line comment character is `;' -on the ARC; `@' on the ARM; `;' for the H8/300 family; `;' for the HPPA; -`#' on the i386 and x86-64; `#' on the i960; `;' for the PDP-11; `;' -for picoJava; `#' for Motorola PowerPC; `!' for the Renesas / SuperH SH; -`!' on the SPARC; `#' on the ip2k; `#' on the m32c; `#' on the m32r; -`|' on the 680x0; `#' on the 68HC11 and 68HC12; `#' on the Vax; `;' for -the Z80; `!' for the Z8000; `#' on the V850; `#' for Xtensa systems; -see *Note Machine Dependencies::. - - On some machines there are two different line comment characters. -One character only begins a comment if it is the first non-whitespace -character on a line, while the other always begins a comment. - - The V850 assembler also supports a double dash as starting a comment -that extends to the end of the line. - - `--'; - - To be compatible with past assemblers, lines that begin with `#' -have a special interpretation. Following the `#' should be an absolute -expression (*note Expressions::): the logical line number of the _next_ -line. Then a string (*note Strings: Strings.) is allowed: if present -it is a new logical file name. The rest of the line, if any, should be -whitespace. - - If the first non-whitespace characters on the line are not numeric, -the line is ignored. (Just like a comment.) - - # This is an ordinary comment. - # 42-6 "new_file_name" # New logical file name - # This is logical line # 36. - This feature is deprecated, and may disappear from future versions -of `as'. - - -File: as.info, Node: Symbol Intro, Next: Statements, Prev: Comments, Up: Syntax - -3.4 Symbols -=========== - -A "symbol" is one or more characters chosen from the set of all letters -(both upper and lower case), digits and the three characters `_.$'. On -most machines, you can also use `$' in symbol names; exceptions are -noted in *Note Machine Dependencies::. No symbol may begin with a -digit. Case is significant. There is no length limit: all characters -are significant. Symbols are delimited by characters not in that set, -or by the beginning of a file (since the source program must end with a -newline, the end of a file is not a possible symbol delimiter). *Note -Symbols::. - - -File: as.info, Node: Statements, Next: Constants, Prev: Symbol Intro, Up: Syntax - -3.5 Statements -============== - -A "statement" ends at a newline character (`\n') or line separator -character. (The line separator is usually `;', unless this conflicts -with the comment character; *note Machine Dependencies::.) The newline -or separator character is considered part of the preceding statement. -Newlines and separators within character constants are an exception: -they do not end statements. - -It is an error to end any statement with end-of-file: the last -character of any input file should be a newline. - - An empty statement is allowed, and may include whitespace. It is -ignored. - - A statement begins with zero or more labels, optionally followed by a -key symbol which determines what kind of statement it is. The key -symbol determines the syntax of the rest of the statement. If the -symbol begins with a dot `.' then the statement is an assembler -directive: typically valid for any computer. If the symbol begins with -a letter the statement is an assembly language "instruction": it -assembles into a machine language instruction. Different versions of -`as' for different computers recognize different instructions. In -fact, the same symbol may represent a different instruction in a -different computer's assembly language. - - A label is a symbol immediately followed by a colon (`:'). -Whitespace before a label or after a colon is permitted, but you may not -have whitespace between a label's symbol and its colon. *Note Labels::. - - For HPPA targets, labels need not be immediately followed by a -colon, but the definition of a label must begin in column zero. This -also implies that only one label may be defined on each line. - - label: .directive followed by something - another_label: # This is an empty statement. - instruction operand_1, operand_2, ... - - -File: as.info, Node: Constants, Prev: Statements, Up: Syntax - -3.6 Constants -============= - -A constant is a number, written so that its value is known by -inspection, without knowing any context. Like this: - .byte 74, 0112, 092, 0x4A, 0X4a, 'J, '\J # All the same value. - .ascii "Ring the bell\7" # A string constant. - .octa 0x123456789abcdef0123456789ABCDEF0 # A bignum. - .float 0f-314159265358979323846264338327\ - 95028841971.693993751E-40 # - pi, a flonum. - -* Menu: - -* Characters:: Character Constants -* Numbers:: Number Constants - - -File: as.info, Node: Characters, Next: Numbers, Up: Constants - -3.6.1 Character Constants -------------------------- - -There are two kinds of character constants. A "character" stands for -one character in one byte and its value may be used in numeric -expressions. String constants (properly called string _literals_) are -potentially many bytes and their values may not be used in arithmetic -expressions. - -* Menu: - -* Strings:: Strings -* Chars:: Characters - - -File: as.info, Node: Strings, Next: Chars, Up: Characters - -3.6.1.1 Strings -............... - -A "string" is written between double-quotes. It may contain -double-quotes or null characters. The way to get special characters -into a string is to "escape" these characters: precede them with a -backslash `\' character. For example `\\' represents one backslash: -the first `\' is an escape which tells `as' to interpret the second -character literally as a backslash (which prevents `as' from -recognizing the second `\' as an escape character). The complete list -of escapes follows. - -`\b' - Mnemonic for backspace; for ASCII this is octal code 010. - -`\f' - Mnemonic for FormFeed; for ASCII this is octal code 014. - -`\n' - Mnemonic for newline; for ASCII this is octal code 012. - -`\r' - Mnemonic for carriage-Return; for ASCII this is octal code 015. - -`\t' - Mnemonic for horizontal Tab; for ASCII this is octal code 011. - -`\ DIGIT DIGIT DIGIT' - An octal character code. The numeric code is 3 octal digits. For - compatibility with other Unix systems, 8 and 9 are accepted as - digits: for example, `\008' has the value 010, and `\009' the - value 011. - -`\`x' HEX-DIGITS...' - A hex character code. All trailing hex digits are combined. - Either upper or lower case `x' works. - -`\\' - Represents one `\' character. - -`\"' - Represents one `"' character. Needed in strings to represent this - character, because an unescaped `"' would end the string. - -`\ ANYTHING-ELSE' - Any other character when escaped by `\' gives a warning, but - assembles as if the `\' was not present. The idea is that if you - used an escape sequence you clearly didn't want the literal - interpretation of the following character. However `as' has no - other interpretation, so `as' knows it is giving you the wrong - code and warns you of the fact. - - Which characters are escapable, and what those escapes represent, -varies widely among assemblers. The current set is what we think the -BSD 4.2 assembler recognizes, and is a subset of what most C compilers -recognize. If you are in doubt, do not use an escape sequence. - - -File: as.info, Node: Chars, Prev: Strings, Up: Characters - -3.6.1.2 Characters -.................. - -A single character may be written as a single quote immediately -followed by that character. The same escapes apply to characters as to -strings. So if you want to write the character backslash, you must -write `'\\' where the first `\' escapes the second `\'. As you can -see, the quote is an acute accent, not a grave accent. A newline -immediately following an acute accent is taken as a literal character -and does not count as the end of a statement. The value of a character -constant in a numeric expression is the machine's byte-wide code for -that character. `as' assumes your character code is ASCII: `'A' means -65, `'B' means 66, and so on. - - -File: as.info, Node: Numbers, Prev: Characters, Up: Constants - -3.6.2 Number Constants ----------------------- - -`as' distinguishes three kinds of numbers according to how they are -stored in the target machine. _Integers_ are numbers that would fit -into an `int' in the C language. _Bignums_ are integers, but they are -stored in more than 32 bits. _Flonums_ are floating point numbers, -described below. - -* Menu: - -* Integers:: Integers -* Bignums:: Bignums -* Flonums:: Flonums - - -File: as.info, Node: Integers, Next: Bignums, Up: Numbers - -3.6.2.1 Integers -................ - -A binary integer is `0b' or `0B' followed by zero or more of the binary -digits `01'. - - An octal integer is `0' followed by zero or more of the octal digits -(`01234567'). - - A decimal integer starts with a non-zero digit followed by zero or -more digits (`0123456789'). - - A hexadecimal integer is `0x' or `0X' followed by one or more -hexadecimal digits chosen from `0123456789abcdefABCDEF'. - - Integers have the usual values. To denote a negative integer, use -the prefix operator `-' discussed under expressions (*note Prefix -Operators: Prefix Ops.). - - -File: as.info, Node: Bignums, Next: Flonums, Prev: Integers, Up: Numbers - -3.6.2.2 Bignums -............... - -A "bignum" has the same syntax and semantics as an integer except that -the number (or its negative) takes more than 32 bits to represent in -binary. The distinction is made because in some places integers are -permitted while bignums are not. - - -File: as.info, Node: Flonums, Prev: Bignums, Up: Numbers - -3.6.2.3 Flonums -............... - -A "flonum" represents a floating point number. The translation is -indirect: a decimal floating point number from the text is converted by -`as' to a generic binary floating point number of more than sufficient -precision. This generic floating point number is converted to a -particular computer's floating point format (or formats) by a portion -of `as' specialized to that computer. - - A flonum is written by writing (in order) - * The digit `0'. (`0' is optional on the HPPA.) - - * A letter, to tell `as' the rest of the number is a flonum. `e' is - recommended. Case is not important. - - On the H8/300, Renesas / SuperH SH, and AMD 29K architectures, the - letter must be one of the letters `DFPRSX' (in upper or lower - case). - - On the ARC, the letter must be one of the letters `DFRS' (in upper - or lower case). - - On the Intel 960 architecture, the letter must be one of the - letters `DFT' (in upper or lower case). - - On the HPPA architecture, the letter must be `E' (upper case only). - - * An optional sign: either `+' or `-'. - - * An optional "integer part": zero or more decimal digits. - - * An optional "fractional part": `.' followed by zero or more - decimal digits. - - * An optional exponent, consisting of: - - * An `E' or `e'. - - * Optional sign: either `+' or `-'. - - * One or more decimal digits. - - - At least one of the integer part or the fractional part must be -present. The floating point number has the usual base-10 value. - - `as' does all processing using integers. Flonums are computed -independently of any floating point hardware in the computer running -`as'. - - -File: as.info, Node: Sections, Next: Symbols, Prev: Syntax, Up: Top - -4 Sections and Relocation -************************* - -* Menu: - -* Secs Background:: Background -* Ld Sections:: Linker Sections -* As Sections:: Assembler Internal Sections -* Sub-Sections:: Sub-Sections -* bss:: bss Section - - -File: as.info, Node: Secs Background, Next: Ld Sections, Up: Sections - -4.1 Background -============== - -Roughly, a section is a range of addresses, with no gaps; all data "in" -those addresses is treated the same for some particular purpose. For -example there may be a "read only" section. - - The linker `ld' reads many object files (partial programs) and -combines their contents to form a runnable program. When `as' emits an -object file, the partial program is assumed to start at address 0. -`ld' assigns the final addresses for the partial program, so that -different partial programs do not overlap. This is actually an -oversimplification, but it suffices to explain how `as' uses sections. - - `ld' moves blocks of bytes of your program to their run-time -addresses. These blocks slide to their run-time addresses as rigid -units; their length does not change and neither does the order of bytes -within them. Such a rigid unit is called a _section_. Assigning -run-time addresses to sections is called "relocation". It includes the -task of adjusting mentions of object-file addresses so they refer to -the proper run-time addresses. For the H8/300, and for the Renesas / -SuperH SH, `as' pads sections if needed to ensure they end on a word -(sixteen bit) boundary. - - An object file written by `as' has at least three sections, any of -which may be empty. These are named "text", "data" and "bss" sections. - - When it generates COFF or ELF output, `as' can also generate -whatever other named sections you specify using the `.section' -directive (*note `.section': Section.). If you do not use any -directives that place output in the `.text' or `.data' sections, these -sections still exist, but are empty. - - When `as' generates SOM or ELF output for the HPPA, `as' can also -generate whatever other named sections you specify using the `.space' -and `.subspace' directives. See `HP9000 Series 800 Assembly Language -Reference Manual' (HP 92432-90001) for details on the `.space' and -`.subspace' assembler directives. - - Additionally, `as' uses different names for the standard text, data, -and bss sections when generating SOM output. Program text is placed -into the `$CODE$' section, data into `$DATA$', and BSS into `$BSS$'. - - Within the object file, the text section starts at address `0', the -data section follows, and the bss section follows the data section. - - When generating either SOM or ELF output files on the HPPA, the text -section starts at address `0', the data section at address `0x4000000', -and the bss section follows the data section. - - To let `ld' know which data changes when the sections are relocated, -and how to change that data, `as' also writes to the object file -details of the relocation needed. To perform relocation `ld' must -know, each time an address in the object file is mentioned: - * Where in the object file is the beginning of this reference to an - address? - - * How long (in bytes) is this reference? - - * Which section does the address refer to? What is the numeric - value of - (ADDRESS) - (START-ADDRESS OF SECTION)? - - * Is the reference to an address "Program-Counter relative"? - - In fact, every address `as' ever uses is expressed as - (SECTION) + (OFFSET INTO SECTION) - Further, most expressions `as' computes have this section-relative -nature. (For some object formats, such as SOM for the HPPA, some -expressions are symbol-relative instead.) - - In this manual we use the notation {SECNAME N} to mean "offset N -into section SECNAME." - - Apart from text, data and bss sections you need to know about the -"absolute" section. When `ld' mixes partial programs, addresses in the -absolute section remain unchanged. For example, address `{absolute 0}' -is "relocated" to run-time address 0 by `ld'. Although the linker -never arranges two partial programs' data sections with overlapping -addresses after linking, _by definition_ their absolute sections must -overlap. Address `{absolute 239}' in one part of a program is always -the same address when the program is running as address `{absolute -239}' in any other part of the program. - - The idea of sections is extended to the "undefined" section. Any -address whose section is unknown at assembly time is by definition -rendered {undefined U}--where U is filled in later. Since numbers are -always defined, the only way to generate an undefined address is to -mention an undefined symbol. A reference to a named common block would -be such a symbol: its value is unknown at assembly time so it has -section _undefined_. - - By analogy the word _section_ is used to describe groups of sections -in the linked program. `ld' puts all partial programs' text sections -in contiguous addresses in the linked program. It is customary to -refer to the _text section_ of a program, meaning all the addresses of -all partial programs' text sections. Likewise for data and bss -sections. - - Some sections are manipulated by `ld'; others are invented for use -of `as' and have no meaning except during assembly. - - -File: as.info, Node: Ld Sections, Next: As Sections, Prev: Secs Background, Up: Sections - -4.2 Linker Sections -=================== - -`ld' deals with just four kinds of sections, summarized below. - -*named sections* -*text section* -*data section* - These sections hold your program. `as' and `ld' treat them as - separate but equal sections. Anything you can say of one section - is true of another. When the program is running, however, it is - customary for the text section to be unalterable. The text - section is often shared among processes: it contains instructions, - constants and the like. The data section of a running program is - usually alterable: for example, C variables would be stored in the - data section. - -*bss section* - This section contains zeroed bytes when your program begins - running. It is used to hold uninitialized variables or common - storage. The length of each partial program's bss section is - important, but because it starts out containing zeroed bytes there - is no need to store explicit zero bytes in the object file. The - bss section was invented to eliminate those explicit zeros from - object files. - -*absolute section* - Address 0 of this section is always "relocated" to runtime address - 0. This is useful if you want to refer to an address that `ld' - must not change when relocating. In this sense we speak of - absolute addresses being "unrelocatable": they do not change - during relocation. - -*undefined section* - This "section" is a catch-all for address references to objects - not in the preceding sections. - - An idealized example of three relocatable sections follows. The -example uses the traditional section names `.text' and `.data'. Memory -addresses are on the horizontal axis. - - +-----+----+--+ - partial program # 1: |ttttt|dddd|00| - +-----+----+--+ - - text data bss - seg. seg. seg. - - +---+---+---+ - partial program # 2: |TTT|DDD|000| - +---+---+---+ - - +--+---+-----+--+----+---+-----+~~ - linked program: | |TTT|ttttt| |dddd|DDD|00000| - +--+---+-----+--+----+---+-----+~~ - - addresses: 0 ... - - -File: as.info, Node: As Sections, Next: Sub-Sections, Prev: Ld Sections, Up: Sections - -4.3 Assembler Internal Sections -=============================== - -These sections are meant only for the internal use of `as'. They have -no meaning at run-time. You do not really need to know about these -sections for most purposes; but they can be mentioned in `as' warning -messages, so it might be helpful to have an idea of their meanings to -`as'. These sections are used to permit the value of every expression -in your assembly language program to be a section-relative address. - -ASSEMBLER-INTERNAL-LOGIC-ERROR! - An internal assembler logic error has been found. This means - there is a bug in the assembler. - -expr section - The assembler stores complex expression internally as combinations - of symbols. When it needs to represent an expression as a symbol, - it puts it in the expr section. - - -File: as.info, Node: Sub-Sections, Next: bss, Prev: As Sections, Up: Sections - -4.4 Sub-Sections -================ - -Assembled bytes conventionally fall into two sections: text and data. -You may have separate groups of data in named sections that you want to -end up near to each other in the object file, even though they are not -contiguous in the assembler source. `as' allows you to use -"subsections" for this purpose. Within each section, there can be -numbered subsections with values from 0 to 8192. Objects assembled -into the same subsection go into the object file together with other -objects in the same subsection. For example, a compiler might want to -store constants in the text section, but might not want to have them -interspersed with the program being assembled. In this case, the -compiler could issue a `.text 0' before each section of code being -output, and a `.text 1' before each group of constants being output. - -Subsections are optional. If you do not use subsections, everything -goes in subsection number zero. - - Each subsection is zero-padded up to a multiple of four bytes. -(Subsections may be padded a different amount on different flavors of -`as'.) - - Subsections appear in your object file in numeric order, lowest -numbered to highest. (All this to be compatible with other people's -assemblers.) The object file contains no representation of -subsections; `ld' and other programs that manipulate object files see -no trace of them. They just see all your text subsections as a text -section, and all your data subsections as a data section. - - To specify which subsection you want subsequent statements assembled -into, use a numeric argument to specify it, in a `.text EXPRESSION' or -a `.data EXPRESSION' statement. When generating COFF output, you can -also use an extra subsection argument with arbitrary named sections: -`.section NAME, EXPRESSION'. When generating ELF output, you can also -use the `.subsection' directive (*note SubSection::) to specify a -subsection: `.subsection EXPRESSION'. EXPRESSION should be an absolute -expression. (*Note Expressions::.) If you just say `.text' then -`.text 0' is assumed. Likewise `.data' means `.data 0'. Assembly -begins in `text 0'. For instance: - .text 0 # The default subsection is text 0 anyway. - .ascii "This lives in the first text subsection. *" - .text 1 - .ascii "But this lives in the second text subsection." - .data 0 - .ascii "This lives in the data section," - .ascii "in the first data subsection." - .text 0 - .ascii "This lives in the first text section," - .ascii "immediately following the asterisk (*)." - - Each section has a "location counter" incremented by one for every -byte assembled into that section. Because subsections are merely a -convenience restricted to `as' there is no concept of a subsection -location counter. There is no way to directly manipulate a location -counter--but the `.align' directive changes it, and any label -definition captures its current value. The location counter of the -section where statements are being assembled is said to be the "active" -location counter. - - -File: as.info, Node: bss, Prev: Sub-Sections, Up: Sections - -4.5 bss Section -=============== - -The bss section is used for local common variable storage. You may -allocate address space in the bss section, but you may not dictate data -to load into it before your program executes. When your program starts -running, all the contents of the bss section are zeroed bytes. - - The `.lcomm' pseudo-op defines a symbol in the bss section; see -*Note `.lcomm': Lcomm. - - The `.comm' pseudo-op may be used to declare a common symbol, which -is another form of uninitialized symbol; see *Note `.comm': Comm. - - When assembling for a target which supports multiple sections, such -as ELF or COFF, you may switch into the `.bss' section and define -symbols as usual; see *Note `.section': Section. You may only assemble -zero values into the section. Typically the section will only contain -symbol definitions and `.skip' directives (*note `.skip': Skip.). - - -File: as.info, Node: Symbols, Next: Expressions, Prev: Sections, Up: Top - -5 Symbols -********* - -Symbols are a central concept: the programmer uses symbols to name -things, the linker uses symbols to link, and the debugger uses symbols -to debug. - - _Warning:_ `as' does not place symbols in the object file in the - same order they were declared. This may break some debuggers. - -* Menu: - -* Labels:: Labels -* Setting Symbols:: Giving Symbols Other Values -* Symbol Names:: Symbol Names -* Dot:: The Special Dot Symbol -* Symbol Attributes:: Symbol Attributes - - -File: as.info, Node: Labels, Next: Setting Symbols, Up: Symbols - -5.1 Labels -========== - -A "label" is written as a symbol immediately followed by a colon `:'. -The symbol then represents the current value of the active location -counter, and is, for example, a suitable instruction operand. You are -warned if you use the same symbol to represent two different locations: -the first definition overrides any other definitions. - - On the HPPA, the usual form for a label need not be immediately -followed by a colon, but instead must start in column zero. Only one -label may be defined on a single line. To work around this, the HPPA -version of `as' also provides a special directive `.label' for defining -labels more flexibly. - - -File: as.info, Node: Setting Symbols, Next: Symbol Names, Prev: Labels, Up: Symbols - -5.2 Giving Symbols Other Values -=============================== - -A symbol can be given an arbitrary value by writing a symbol, followed -by an equals sign `=', followed by an expression (*note Expressions::). -This is equivalent to using the `.set' directive. *Note `.set': Set. -In the same way, using a double equals sign `='`=' here represents an -equivalent of the `.eqv' directive. *Note `.eqv': Eqv. - - -File: as.info, Node: Symbol Names, Next: Dot, Prev: Setting Symbols, Up: Symbols - -5.3 Symbol Names -================ - -Symbol names begin with a letter or with one of `._'. On most -machines, you can also use `$' in symbol names; exceptions are noted in -*Note Machine Dependencies::. That character may be followed by any -string of digits, letters, dollar signs (unless otherwise noted in -*Note Machine Dependencies::), and underscores. - -Case of letters is significant: `foo' is a different symbol name than -`Foo'. - - Each symbol has exactly one name. Each name in an assembly language -program refers to exactly one symbol. You may use that symbol name any -number of times in a program. - -Local Symbol Names ------------------- - -Local symbols help compilers and programmers use names temporarily. -They create symbols which are guaranteed to be unique over the entire -scope of the input source code and which can be referred to by a simple -notation. To define a local symbol, write a label of the form `N:' -(where N represents any positive integer). To refer to the most recent -previous definition of that symbol write `Nb', using the same number as -when you defined the label. To refer to the next definition of a local -label, write `Nf'-- The `b' stands for"backwards" and the `f' stands -for "forwards". - - There is no restriction on how you can use these labels, and you can -reuse them too. So that it is possible to repeatedly define the same -local label (using the same number `N'), although you can only refer to -the most recently defined local label of that number (for a backwards -reference) or the next definition of a specific local label for a -forward reference. It is also worth noting that the first 10 local -labels (`0:'...`9:') are implemented in a slightly more efficient -manner than the others. - - Here is an example: - - 1: branch 1f - 2: branch 1b - 1: branch 2f - 2: branch 1b - - Which is the equivalent of: - - label_1: branch label_3 - label_2: branch label_1 - label_3: branch label_4 - label_4: branch label_3 - - Local symbol names are only a notational device. They are -immediately transformed into more conventional symbol names before the -assembler uses them. The symbol names stored in the symbol table, -appearing in error messages and optionally emitted to the object file. -The names are constructed using these parts: - -`L' - All local labels begin with `L'. Normally both `as' and `ld' - forget symbols that start with `L'. These labels are used for - symbols you are never intended to see. If you use the `-L' option - then `as' retains these symbols in the object file. If you also - instruct `ld' to retain these symbols, you may use them in - debugging. - -`NUMBER' - This is the number that was used in the local label definition. - So if the label is written `55:' then the number is `55'. - -`C-B' - This unusual character is included so you do not accidentally - invent a symbol of the same name. The character has ASCII value - of `\002' (control-B). - -`_ordinal number_' - This is a serial number to keep the labels distinct. The first - definition of `0:' gets the number `1'. The 15th definition of - `0:' gets the number `15', and so on. Likewise the first - definition of `1:' gets the number `1' and its 15th defintion gets - `15' as well. - - So for example, the first `1:' is named `L1C-B1', the 44th `3:' is -named `L3C-B44'. - -Dollar Local Labels -------------------- - -`as' also supports an even more local form of local labels called -dollar labels. These labels go out of scope (ie they become undefined) -as soon as a non-local label is defined. Thus they remain valid for -only a small region of the input source code. Normal local labels, by -contrast, remain in scope for the entire file, or until they are -redefined by another occurrence of the same local label. - - Dollar labels are defined in exactly the same way as ordinary local -labels, except that instead of being terminated by a colon, they are -terminated by a dollar sign. eg `55$'. - - They can also be distinguished from ordinary local labels by their -transformed name which uses ASCII character `\001' (control-A) as the -magic character to distinguish them from ordinary labels. Thus the 5th -defintion of `6$' is named `L6C-A5'. - - -File: as.info, Node: Dot, Next: Symbol Attributes, Prev: Symbol Names, Up: Symbols - -5.4 The Special Dot Symbol -========================== - -The special symbol `.' refers to the current address that `as' is -assembling into. Thus, the expression `melvin: .long .' defines -`melvin' to contain its own address. Assigning a value to `.' is -treated the same as a `.org' directive. Thus, the expression `.=.+4' -is the same as saying `.space 4'. - - -File: as.info, Node: Symbol Attributes, Prev: Dot, Up: Symbols - -5.5 Symbol Attributes -===================== - -Every symbol has, as well as its name, the attributes "Value" and -"Type". Depending on output format, symbols can also have auxiliary -attributes. - - If you use a symbol without defining it, `as' assumes zero for all -these attributes, and probably won't warn you. This makes the symbol -an externally defined symbol, which is generally what you would want. - -* Menu: - -* Symbol Value:: Value -* Symbol Type:: Type - - -* a.out Symbols:: Symbol Attributes: `a.out' - -* COFF Symbols:: Symbol Attributes for COFF - -* SOM Symbols:: Symbol Attributes for SOM - - -File: as.info, Node: Symbol Value, Next: Symbol Type, Up: Symbol Attributes - -5.5.1 Value ------------ - -The value of a symbol is (usually) 32 bits. For a symbol which labels a -location in the text, data, bss or absolute sections the value is the -number of addresses from the start of that section to the label. -Naturally for text, data and bss sections the value of a symbol changes -as `ld' changes section base addresses during linking. Absolute -symbols' values do not change during linking: that is why they are -called absolute. - - The value of an undefined symbol is treated in a special way. If it -is 0 then the symbol is not defined in this assembler source file, and -`ld' tries to determine its value from other files linked into the same -program. You make this kind of symbol simply by mentioning a symbol -name without defining it. A non-zero value represents a `.comm' common -declaration. The value is how much common storage to reserve, in bytes -(addresses). The symbol refers to the first address of the allocated -storage. - - -File: as.info, Node: Symbol Type, Next: a.out Symbols, Prev: Symbol Value, Up: Symbol Attributes - -5.5.2 Type ----------- - -The type attribute of a symbol contains relocation (section) -information, any flag settings indicating that a symbol is external, and -(optionally), other information for linkers and debuggers. The exact -format depends on the object-code output format in use. - - -File: as.info, Node: a.out Symbols, Next: COFF Symbols, Prev: Symbol Type, Up: Symbol Attributes - -5.5.3 Symbol Attributes: `a.out' --------------------------------- - -* Menu: - -* Symbol Desc:: Descriptor -* Symbol Other:: Other - - -File: as.info, Node: Symbol Desc, Next: Symbol Other, Up: a.out Symbols - -5.5.3.1 Descriptor -.................. - -This is an arbitrary 16-bit value. You may establish a symbol's -descriptor value by using a `.desc' statement (*note `.desc': Desc.). -A descriptor value means nothing to `as'. - - -File: as.info, Node: Symbol Other, Prev: Symbol Desc, Up: a.out Symbols - -5.5.3.2 Other -............. - -This is an arbitrary 8-bit value. It means nothing to `as'. - - -File: as.info, Node: COFF Symbols, Next: SOM Symbols, Prev: a.out Symbols, Up: Symbol Attributes - -5.5.4 Symbol Attributes for COFF --------------------------------- - -The COFF format supports a multitude of auxiliary symbol attributes; -like the primary symbol attributes, they are set between `.def' and -`.endef' directives. - -5.5.4.1 Primary Attributes -.......................... - -The symbol name is set with `.def'; the value and type, respectively, -with `.val' and `.type'. - -5.5.4.2 Auxiliary Attributes -............................ - -The `as' directives `.dim', `.line', `.scl', `.size', `.tag', and -`.weak' can generate auxiliary symbol table information for COFF. - - -File: as.info, Node: SOM Symbols, Prev: COFF Symbols, Up: Symbol Attributes - -5.5.5 Symbol Attributes for SOM -------------------------------- - -The SOM format for the HPPA supports a multitude of symbol attributes -set with the `.EXPORT' and `.IMPORT' directives. - - The attributes are described in `HP9000 Series 800 Assembly Language -Reference Manual' (HP 92432-90001) under the `IMPORT' and `EXPORT' -assembler directive documentation. - - -File: as.info, Node: Expressions, Next: Pseudo Ops, Prev: Symbols, Up: Top - -6 Expressions -************* - -An "expression" specifies an address or numeric value. Whitespace may -precede and/or follow an expression. - - The result of an expression must be an absolute number, or else an -offset into a particular section. If an expression is not absolute, -and there is not enough information when `as' sees the expression to -know its section, a second pass over the source program might be -necessary to interpret the expression--but the second pass is currently -not implemented. `as' aborts with an error message in this situation. - -* Menu: - -* Empty Exprs:: Empty Expressions -* Integer Exprs:: Integer Expressions - - -File: as.info, Node: Empty Exprs, Next: Integer Exprs, Up: Expressions - -6.1 Empty Expressions -===================== - -An empty expression has no value: it is just whitespace or null. -Wherever an absolute expression is required, you may omit the -expression, and `as' assumes a value of (absolute) 0. This is -compatible with other assemblers. - - -File: as.info, Node: Integer Exprs, Prev: Empty Exprs, Up: Expressions - -6.2 Integer Expressions -======================= - -An "integer expression" is one or more _arguments_ delimited by -_operators_. - -* Menu: - -* Arguments:: Arguments -* Operators:: Operators -* Prefix Ops:: Prefix Operators -* Infix Ops:: Infix Operators - - -File: as.info, Node: Arguments, Next: Operators, Up: Integer Exprs - -6.2.1 Arguments ---------------- - -"Arguments" are symbols, numbers or subexpressions. In other contexts -arguments are sometimes called "arithmetic operands". In this manual, -to avoid confusing them with the "instruction operands" of the machine -language, we use the term "argument" to refer to parts of expressions -only, reserving the word "operand" to refer only to machine instruction -operands. - - Symbols are evaluated to yield {SECTION NNN} where SECTION is one of -text, data, bss, absolute, or undefined. NNN is a signed, 2's -complement 32 bit integer. - - Numbers are usually integers. - - A number can be a flonum or bignum. In this case, you are warned -that only the low order 32 bits are used, and `as' pretends these 32 -bits are an integer. You may write integer-manipulating instructions -that act on exotic constants, compatible with other assemblers. - - Subexpressions are a left parenthesis `(' followed by an integer -expression, followed by a right parenthesis `)'; or a prefix operator -followed by an argument. - - -File: as.info, Node: Operators, Next: Prefix Ops, Prev: Arguments, Up: Integer Exprs - -6.2.2 Operators ---------------- - -"Operators" are arithmetic functions, like `+' or `%'. Prefix -operators are followed by an argument. Infix operators appear between -their arguments. Operators may be preceded and/or followed by -whitespace. - - -File: as.info, Node: Prefix Ops, Next: Infix Ops, Prev: Operators, Up: Integer Exprs - -6.2.3 Prefix Operator ---------------------- - -`as' has the following "prefix operators". They each take one -argument, which must be absolute. - -`-' - "Negation". Two's complement negation. - -`~' - "Complementation". Bitwise not. - - -File: as.info, Node: Infix Ops, Prev: Prefix Ops, Up: Integer Exprs - -6.2.4 Infix Operators ---------------------- - -"Infix operators" take two arguments, one on either side. Operators -have precedence, but operations with equal precedence are performed left -to right. Apart from `+' or `-', both arguments must be absolute, and -the result is absolute. - - 1. Highest Precedence - - `*' - "Multiplication". - - `/' - "Division". Truncation is the same as the C operator `/' - - `%' - "Remainder". - - `<<' - "Shift Left". Same as the C operator `<<'. - - `>>' - "Shift Right". Same as the C operator `>>'. - - 2. Intermediate precedence - - `|' - "Bitwise Inclusive Or". - - `&' - "Bitwise And". - - `^' - "Bitwise Exclusive Or". - - `!' - "Bitwise Or Not". - - 3. Low Precedence - - `+' - "Addition". If either argument is absolute, the result has - the section of the other argument. You may not add together - arguments from different sections. - - `-' - "Subtraction". If the right argument is absolute, the result - has the section of the left argument. If both arguments are - in the same section, the result is absolute. You may not - subtract arguments from different sections. - - `==' - "Is Equal To" - - `<>' - `!=' - "Is Not Equal To" - - `<' - "Is Less Than" - - `>' - "Is Greater Than" - - `>=' - "Is Greater Than Or Equal To" - - `<=' - "Is Less Than Or Equal To" - - The comparison operators can be used as infix operators. A - true results has a value of -1 whereas a false result has a - value of 0. Note, these operators perform signed - comparisons. - - 4. Lowest Precedence - - `&&' - "Logical And". - - `||' - "Logical Or". - - These two logical operations can be used to combine the - results of sub expressions. Note, unlike the comparison - operators a true result returns a value of 1 but a false - results does still return 0. Also note that the logical or - operator has a slightly lower precedence than logical and. - - - In short, it's only meaningful to add or subtract the _offsets_ in an -address; you can only have a defined section in one of the two -arguments. - - -File: as.info, Node: Pseudo Ops, Next: Machine Dependencies, Prev: Expressions, Up: Top - -7 Assembler Directives -********************** - -All assembler directives have names that begin with a period (`.'). -The rest of the name is letters, usually in lower case. - - This chapter discusses directives that are available regardless of -the target machine configuration for the GNU assembler. Some machine -configurations provide additional directives. *Note Machine -Dependencies::. - -* Menu: - -* Abort:: `.abort' - -* ABORT:: `.ABORT' - -* Align:: `.align ABS-EXPR , ABS-EXPR' -* Altmacro:: `.altmacro' -* Ascii:: `.ascii "STRING"'... -* Asciz:: `.asciz "STRING"'... -* Balign:: `.balign ABS-EXPR , ABS-EXPR' -* Byte:: `.byte EXPRESSIONS' -* Comm:: `.comm SYMBOL , LENGTH ' - -* CFI directives:: `.cfi_startproc', `.cfi_endproc', etc. - -* Data:: `.data SUBSECTION' - -* Def:: `.def NAME' - -* Desc:: `.desc SYMBOL, ABS-EXPRESSION' - -* Dim:: `.dim' - -* Double:: `.double FLONUMS' -* Eject:: `.eject' -* Else:: `.else' -* Elseif:: `.elseif' -* End:: `.end' - -* Endef:: `.endef' - -* Endfunc:: `.endfunc' -* Endif:: `.endif' -* Equ:: `.equ SYMBOL, EXPRESSION' -* Equiv:: `.equiv SYMBOL, EXPRESSION' -* Eqv:: `.eqv SYMBOL, EXPRESSION' -* Err:: `.err' -* Error:: `.error STRING' -* Exitm:: `.exitm' -* Extern:: `.extern' -* Fail:: `.fail' - -* File:: `.file STRING' - -* Fill:: `.fill REPEAT , SIZE , VALUE' -* Float:: `.float FLONUMS' -* Func:: `.func' -* Global:: `.global SYMBOL', `.globl SYMBOL' - -* Hidden:: `.hidden NAMES' - -* hword:: `.hword EXPRESSIONS' -* Ident:: `.ident' -* If:: `.if ABSOLUTE EXPRESSION' -* Incbin:: `.incbin "FILE"[,SKIP[,COUNT]]' -* Include:: `.include "FILE"' -* Int:: `.int EXPRESSIONS' - -* Internal:: `.internal NAMES' - -* Irp:: `.irp SYMBOL,VALUES'... -* Irpc:: `.irpc SYMBOL,VALUES'... -* Lcomm:: `.lcomm SYMBOL , LENGTH' -* Lflags:: `.lflags' - -* Line:: `.line LINE-NUMBER' - -* Linkonce:: `.linkonce [TYPE]' -* List:: `.list' -* Ln:: `.ln LINE-NUMBER' - -* LNS directives:: `.file', `.loc', etc. - -* Long:: `.long EXPRESSIONS' - -* Macro:: `.macro NAME ARGS'... -* MRI:: `.mri VAL' -* Noaltmacro:: `.noaltmacro' -* Nolist:: `.nolist' -* Octa:: `.octa BIGNUMS' -* Org:: `.org NEW-LC , FILL' -* P2align:: `.p2align ABS-EXPR , ABS-EXPR' - -* PopSection:: `.popsection' -* Previous:: `.previous' - -* Print:: `.print STRING' - -* Protected:: `.protected NAMES' - -* Psize:: `.psize LINES, COLUMNS' -* Purgem:: `.purgem NAME' - -* PushSection:: `.pushsection NAME' - -* Quad:: `.quad BIGNUMS' -* Rept:: `.rept COUNT' -* Sbttl:: `.sbttl "SUBHEADING"' - -* Scl:: `.scl CLASS' - -* Section:: `.section NAME' - -* Set:: `.set SYMBOL, EXPRESSION' -* Short:: `.short EXPRESSIONS' -* Single:: `.single FLONUMS' - -* Size:: `.size [NAME , EXPRESSION]' - -* Skip:: `.skip SIZE , FILL' -* Sleb128:: `.sleb128 EXPRESSIONS' -* Space:: `.space SIZE , FILL' - -* Stab:: `.stabd, .stabn, .stabs' - -* String:: `.string "STR"' -* Struct:: `.struct EXPRESSION' - -* SubSection:: `.subsection' -* Symver:: `.symver NAME,NAME2@NODENAME' - - -* Tag:: `.tag STRUCTNAME' - -* Text:: `.text SUBSECTION' -* Title:: `.title "HEADING"' - -* Type:: `.type ' - -* Uleb128:: `.uleb128 EXPRESSIONS' - -* Val:: `.val ADDR' - - -* Version:: `.version "STRING"' -* VTableEntry:: `.vtable_entry TABLE, OFFSET' -* VTableInherit:: `.vtable_inherit CHILD, PARENT' - -* Warning:: `.warning STRING' -* Weak:: `.weak NAMES' -* Weakref:: `.weakref ALIAS, SYMBOL' -* Word:: `.word EXPRESSIONS' -* Deprecated:: Deprecated Directives - - -File: as.info, Node: Abort, Next: ABORT, Up: Pseudo Ops - -7.1 `.abort' -============ - -This directive stops the assembly immediately. It is for compatibility -with other assemblers. The original idea was that the assembly -language source would be piped into the assembler. If the sender of -the source quit, it could use this directive tells `as' to quit also. -One day `.abort' will not be supported. - - -File: as.info, Node: ABORT, Next: Align, Prev: Abort, Up: Pseudo Ops - -7.2 `.ABORT' -============ - -When producing COFF output, `as' accepts this directive as a synonym -for `.abort'. - - -File: as.info, Node: Align, Next: Altmacro, Prev: ABORT, Up: Pseudo Ops - -7.3 `.align ABS-EXPR, ABS-EXPR, ABS-EXPR' -========================================= - -Pad the location counter (in the current subsection) to a particular -storage boundary. The first expression (which must be absolute) is the -alignment required, as described below. - - The second expression (also absolute) gives the fill value to be -stored in the padding bytes. It (and the comma) may be omitted. If it -is omitted, the padding bytes are normally zero. However, on some -systems, if the section is marked as containing code and the fill value -is omitted, the space is filled with no-op instructions. - - The third expression is also absolute, and is also optional. If it -is present, it is the maximum number of bytes that should be skipped by -this alignment directive. If doing the alignment would require -skipping more bytes than the specified maximum, then the alignment is -not done at all. You can omit the fill value (the second argument) -entirely by simply using two commas after the required alignment; this -can be useful if you want the alignment to be filled with no-op -instructions when appropriate. - - The way the required alignment is specified varies from system to -system. For the arc, hppa, i386 using ELF, i860, iq2000, m68k, or32, -s390, sparc, tic4x, tic80 and xtensa, the first expression is the -alignment request in bytes. For example `.align 8' advances the -location counter until it is a multiple of 8. If the location counter -is already a multiple of 8, no change is needed. For the tic54x, the -first expression is the alignment request in words. - - For other systems, including the i386 using a.out format, and the -arm and strongarm, it is the number of low-order zero bits the location -counter must have after advancement. For example `.align 3' advances -the location counter until it a multiple of 8. If the location counter -is already a multiple of 8, no change is needed. - - This inconsistency is due to the different behaviors of the various -native assemblers for these systems which GAS must emulate. GAS also -provides `.balign' and `.p2align' directives, described later, which -have a consistent behavior across all architectures (but are specific -to GAS). - - -File: as.info, Node: Ascii, Next: Asciz, Prev: Altmacro, Up: Pseudo Ops - -7.4 `.ascii "STRING"'... -======================== - -`.ascii' expects zero or more string literals (*note Strings::) -separated by commas. It assembles each string (with no automatic -trailing zero byte) into consecutive addresses. - - -File: as.info, Node: Asciz, Next: Balign, Prev: Ascii, Up: Pseudo Ops - -7.5 `.asciz "STRING"'... -======================== - -`.asciz' is just like `.ascii', but each string is followed by a zero -byte. The "z" in `.asciz' stands for "zero". - - -File: as.info, Node: Balign, Next: Byte, Prev: Asciz, Up: Pseudo Ops - -7.6 `.balign[wl] ABS-EXPR, ABS-EXPR, ABS-EXPR' -============================================== - -Pad the location counter (in the current subsection) to a particular -storage boundary. The first expression (which must be absolute) is the -alignment request in bytes. For example `.balign 8' advances the -location counter until it is a multiple of 8. If the location counter -is already a multiple of 8, no change is needed. - - The second expression (also absolute) gives the fill value to be -stored in the padding bytes. It (and the comma) may be omitted. If it -is omitted, the padding bytes are normally zero. However, on some -systems, if the section is marked as containing code and the fill value -is omitted, the space is filled with no-op instructions. - - The third expression is also absolute, and is also optional. If it -is present, it is the maximum number of bytes that should be skipped by -this alignment directive. If doing the alignment would require -skipping more bytes than the specified maximum, then the alignment is -not done at all. You can omit the fill value (the second argument) -entirely by simply using two commas after the required alignment; this -can be useful if you want the alignment to be filled with no-op -instructions when appropriate. - - The `.balignw' and `.balignl' directives are variants of the -`.balign' directive. The `.balignw' directive treats the fill pattern -as a two byte word value. The `.balignl' directives treats the fill -pattern as a four byte longword value. For example, `.balignw -4,0x368d' will align to a multiple of 4. If it skips two bytes, they -will be filled in with the value 0x368d (the exact placement of the -bytes depends upon the endianness of the processor). If it skips 1 or -3 bytes, the fill value is undefined. - - -File: as.info, Node: Byte, Next: Comm, Prev: Balign, Up: Pseudo Ops - -7.7 `.byte EXPRESSIONS' -======================= - -`.byte' expects zero or more expressions, separated by commas. Each -expression is assembled into the next byte. - - -File: as.info, Node: Comm, Next: CFI directives, Prev: Byte, Up: Pseudo Ops - -7.8 `.comm SYMBOL , LENGTH ' -============================ - -`.comm' declares a common symbol named SYMBOL. When linking, a common -symbol in one object file may be merged with a defined or common symbol -of the same name in another object file. If `ld' does not see a -definition for the symbol-just one or more common symbols-then it will -allocate LENGTH bytes of uninitialized memory. LENGTH must be an -absolute expression. If `ld' sees multiple common symbols with the -same name, and they do not all have the same size, it will allocate -space using the largest size. - - When using ELF, the `.comm' directive takes an optional third -argument. This is the desired alignment of the symbol, specified as a -byte boundary (for example, an alignment of 16 means that the least -significant 4 bits of the address should be zero). The alignment must -be an absolute expression, and it must be a power of two. If `ld' -allocates uninitialized memory for the common symbol, it will use the -alignment when placing the symbol. If no alignment is specified, `as' -will set the alignment to the largest power of two less than or equal -to the size of the symbol, up to a maximum of 16. - - The syntax for `.comm' differs slightly on the HPPA. The syntax is -`SYMBOL .comm, LENGTH'; SYMBOL is optional. - - -File: as.info, Node: CFI directives, Next: Data, Prev: Comm, Up: Pseudo Ops - -7.9 `.cfi_startproc' -==================== - -`.cfi_startproc' is used at the beginning of each function that should -have an entry in `.eh_frame'. It initializes some internal data -structures and emits architecture dependent initial CFI instructions. -Don't forget to close the function by `.cfi_endproc'. - -7.10 `.cfi_endproc' -=================== - -`.cfi_endproc' is used at the end of a function where it closes its -unwind entry previously opened by `.cfi_startproc'. and emits it to -`.eh_frame'. - -7.11 `.cfi_def_cfa REGISTER, OFFSET' -==================================== - -`.cfi_def_cfa' defines a rule for computing CFA as: take address from -REGISTER and add OFFSET to it. - -7.12 `.cfi_def_cfa_register REGISTER' -===================================== - -`.cfi_def_cfa_register' modifies a rule for computing CFA. From now on -REGISTER will be used instead of the old one. Offset remains the same. - -7.13 `.cfi_def_cfa_offset OFFSET' -================================= - -`.cfi_def_cfa_offset' modifies a rule for computing CFA. Register -remains the same, but OFFSET is new. Note that it is the absolute -offset that will be added to a defined register to compute CFA address. - -7.14 `.cfi_adjust_cfa_offset OFFSET' -==================================== - -Same as `.cfi_def_cfa_offset' but OFFSET is a relative value that is -added/substracted from the previous offset. - -7.15 `.cfi_offset REGISTER, OFFSET' -=================================== - -Previous value of REGISTER is saved at offset OFFSET from CFA. - -7.16 `.cfi_rel_offset REGISTER, OFFSET' -======================================= - -Previous value of REGISTER is saved at offset OFFSET from the current -CFA register. This is transformed to `.cfi_offset' using the known -displacement of the CFA register from the CFA. This is often easier to -use, because the number will match the code it's annotating. - -7.17 `.cfi_signal_frame' -======================== - -Mark current function as signal trampoline. - -7.18 `.cfi_window_save' -======================= - -SPARC register window has been saved. - -7.19 `.cfi_escape' EXPRESSION[, ...] -==================================== - -Allows the user to add arbitrary bytes to the unwind info. One might -use this to add OS-specific CFI opcodes, or generic CFI opcodes that -GAS does not yet support. - - -File: as.info, Node: LNS directives, Next: Long, Prev: Ln, Up: Pseudo Ops - -7.20 `.file FILENO FILENAME' -============================ - -When emitting dwarf2 line number information `.file' assigns filenames -to the `.debug_line' file name table. The FILENO operand should be a -unique positive integer to use as the index of the entry in the table. -The FILENAME operand is a C string literal. - - The detail of filename indicies is exposed to the user because the -filename table is shared with the `.debug_info' section of the dwarf2 -debugging information, and thus the user must know the exact indicies -that table entries will have. - -7.21 `.loc FILENO LINENO [COLUMN] [OPTIONS]' -============================================ - -The `.loc' directive will add row to the `.debug_line' line number -matrix corresponding to the immediately following assembly instruction. -The FILENO, LINENO, and optional COLUMN arguments will be applied to -the `.debug_line' state machine before the row is added. - - The OPTIONS are a sequence of the following tokens in any order: - -`basic_block' - This option will set the `basic_block' register in the - `.debug_line' state machine to `true'. - -`prologue_end' - This option will set the `prologue_end' register in the - `.debug_line' state machine to `true'. - -`epilogue_begin' - This option will set the `epilogue_begin' register in the - `.debug_line' state machine to `true'. - -`is_stmt VALUE' - This option will set the `is_stmt' register in the `.debug_line' - state machine to `value', which must be either 0 or 1. - -`isa VALUE' - This directive will set the `isa' register in the `.debug_line' - state machine to VALUE, which must be an unsigned integer. - - -7.22 `.loc_mark_blocks ENABLE' -============================== - -The `.loc_mark_blocks' directive makes the assembler emit an entry to -the `.debug_line' line number matrix with the `basic_block' register in -the state machine set whenever a code label is seen. The ENABLE -argument should be either 1 or 0, to enable or disable this function -respectively. - - -File: as.info, Node: Data, Next: Def, Prev: CFI directives, Up: Pseudo Ops - -7.23 `.data SUBSECTION' -======================= - -`.data' tells `as' to assemble the following statements onto the end of -the data subsection numbered SUBSECTION (which is an absolute -expression). If SUBSECTION is omitted, it defaults to zero. - - -File: as.info, Node: Def, Next: Desc, Prev: Data, Up: Pseudo Ops - -7.24 `.def NAME' -================ - -Begin defining debugging information for a symbol NAME; the definition -extends until the `.endef' directive is encountered. - - -File: as.info, Node: Desc, Next: Dim, Prev: Def, Up: Pseudo Ops - -7.25 `.desc SYMBOL, ABS-EXPRESSION' -=================================== - -This directive sets the descriptor of the symbol (*note Symbol -Attributes::) to the low 16 bits of an absolute expression. - - The `.desc' directive is not available when `as' is configured for -COFF output; it is only for `a.out' or `b.out' object format. For the -sake of compatibility, `as' accepts it, but produces no output, when -configured for COFF. - - -File: as.info, Node: Dim, Next: Double, Prev: Desc, Up: Pseudo Ops - -7.26 `.dim' -=========== - -This directive is generated by compilers to include auxiliary debugging -information in the symbol table. It is only permitted inside -`.def'/`.endef' pairs. - - -File: as.info, Node: Double, Next: Eject, Prev: Dim, Up: Pseudo Ops - -7.27 `.double FLONUMS' -====================== - -`.double' expects zero or more flonums, separated by commas. It -assembles floating point numbers. The exact kind of floating point -numbers emitted depends on how `as' is configured. *Note Machine -Dependencies::. - - -File: as.info, Node: Eject, Next: Else, Prev: Double, Up: Pseudo Ops - -7.28 `.eject' -============= - -Force a page break at this point, when generating assembly listings. - - -File: as.info, Node: Else, Next: Elseif, Prev: Eject, Up: Pseudo Ops - -7.29 `.else' -============ - -`.else' is part of the `as' support for conditional assembly; *note -`.if': If. It marks the beginning of a section of code to be assembled -if the condition for the preceding `.if' was false. - - -File: as.info, Node: Elseif, Next: End, Prev: Else, Up: Pseudo Ops - -7.30 `.elseif' -============== - -`.elseif' is part of the `as' support for conditional assembly; *note -`.if': If. It is shorthand for beginning a new `.if' block that would -otherwise fill the entire `.else' section. - - -File: as.info, Node: End, Next: Endef, Prev: Elseif, Up: Pseudo Ops - -7.31 `.end' -=========== - -`.end' marks the end of the assembly file. `as' does not process -anything in the file past the `.end' directive. - - -File: as.info, Node: Endef, Next: Endfunc, Prev: End, Up: Pseudo Ops - -7.32 `.endef' -============= - -This directive flags the end of a symbol definition begun with `.def'. - - -File: as.info, Node: Endfunc, Next: Endif, Prev: Endef, Up: Pseudo Ops - -7.33 `.endfunc' -=============== - -`.endfunc' marks the end of a function specified with `.func'. - - -File: as.info, Node: Endif, Next: Equ, Prev: Endfunc, Up: Pseudo Ops - -7.34 `.endif' -============= - -`.endif' is part of the `as' support for conditional assembly; it marks -the end of a block of code that is only assembled conditionally. *Note -`.if': If. - - -File: as.info, Node: Equ, Next: Equiv, Prev: Endif, Up: Pseudo Ops - -7.35 `.equ SYMBOL, EXPRESSION' -============================== - -This directive sets the value of SYMBOL to EXPRESSION. It is -synonymous with `.set'; *note `.set': Set. - - The syntax for `equ' on the HPPA is `SYMBOL .equ EXPRESSION'. - - The syntax for `equ' on the Z80 is `SYMBOL equ EXPRESSION'. On the -Z80 it is an eror if SYMBOL is already defined, but the symbol is not -protected from later redefinition, compare *Note Equiv::. - - -File: as.info, Node: Equiv, Next: Eqv, Prev: Equ, Up: Pseudo Ops - -7.36 `.equiv SYMBOL, EXPRESSION' -================================ - -The `.equiv' directive is like `.equ' and `.set', except that the -assembler will signal an error if SYMBOL is already defined. Note a -symbol which has been referenced but not actually defined is considered -to be undefined. - - Except for the contents of the error message, this is roughly -equivalent to - .ifdef SYM - .err - .endif - .equ SYM,VAL - plus it protects the symbol from later redefinition. - - -File: as.info, Node: Eqv, Next: Err, Prev: Equiv, Up: Pseudo Ops - -7.37 `.eqv SYMBOL, EXPRESSION' -============================== - -The `.eqv' directive is like `.equiv', but no attempt is made to -evaluate the expression or any part of it immediately. Instead each -time the resulting symbol is used in an expression, a snapshot of its -current value is taken. - - -File: as.info, Node: Err, Next: Error, Prev: Eqv, Up: Pseudo Ops - -7.38 `.err' -=========== - -If `as' assembles a `.err' directive, it will print an error message -and, unless the `-Z' option was used, it will not generate an object -file. This can be used to signal an error in conditionally compiled -code. - - -File: as.info, Node: Error, Next: Exitm, Prev: Err, Up: Pseudo Ops - -7.39 `.error "STRING"' -====================== - -Similarly to `.err', this directive emits an error, but you can specify -a string that will be emitted as the error message. If you don't -specify the message, it defaults to `".error directive invoked in -source file"'. *Note Error and Warning Messages: Errors. - - .error "This code has not been assembled and tested." - - -File: as.info, Node: Exitm, Next: Extern, Prev: Error, Up: Pseudo Ops - -7.40 `.exitm' -============= - -Exit early from the current macro definition. *Note Macro::. - - -File: as.info, Node: Extern, Next: Fail, Prev: Exitm, Up: Pseudo Ops - -7.41 `.extern' -============== - -`.extern' is accepted in the source program--for compatibility with -other assemblers--but it is ignored. `as' treats all undefined symbols -as external. - - -File: as.info, Node: Fail, Next: File, Prev: Extern, Up: Pseudo Ops - -7.42 `.fail EXPRESSION' -======================= - -Generates an error or a warning. If the value of the EXPRESSION is 500 -or more, `as' will print a warning message. If the value is less than -500, `as' will print an error message. The message will include the -value of EXPRESSION. This can occasionally be useful inside complex -nested macros or conditional assembly. - - -File: as.info, Node: File, Next: Fill, Prev: Fail, Up: Pseudo Ops - -7.43 `.file STRING' -=================== - -`.file' tells `as' that we are about to start a new logical file. -STRING is the new file name. In general, the filename is recognized -whether or not it is surrounded by quotes `"'; but if you wish to -specify an empty file name, you must give the quotes-`""'. This -statement may go away in future: it is only recognized to be compatible -with old `as' programs. - - -File: as.info, Node: Fill, Next: Float, Prev: File, Up: Pseudo Ops - -7.44 `.fill REPEAT , SIZE , VALUE' -================================== - -REPEAT, SIZE and VALUE are absolute expressions. This emits REPEAT -copies of SIZE bytes. REPEAT may be zero or more. SIZE may be zero or -more, but if it is more than 8, then it is deemed to have the value 8, -compatible with other people's assemblers. The contents of each REPEAT -bytes is taken from an 8-byte number. The highest order 4 bytes are -zero. The lowest order 4 bytes are VALUE rendered in the byte-order of -an integer on the computer `as' is assembling for. Each SIZE bytes in -a repetition is taken from the lowest order SIZE bytes of this number. -Again, this bizarre behavior is compatible with other people's -assemblers. - - SIZE and VALUE are optional. If the second comma and VALUE are -absent, VALUE is assumed zero. If the first comma and following tokens -are absent, SIZE is assumed to be 1. - - -File: as.info, Node: Float, Next: Func, Prev: Fill, Up: Pseudo Ops - -7.45 `.float FLONUMS' -===================== - -This directive assembles zero or more flonums, separated by commas. It -has the same effect as `.single'. The exact kind of floating point -numbers emitted depends on how `as' is configured. *Note Machine -Dependencies::. - - -File: as.info, Node: Func, Next: Global, Prev: Float, Up: Pseudo Ops - -7.46 `.func NAME[,LABEL]' -========================= - -`.func' emits debugging information to denote function NAME, and is -ignored unless the file is assembled with debugging enabled. Only -`--gstabs[+]' is currently supported. LABEL is the entry point of the -function and if omitted NAME prepended with the `leading char' is used. -`leading char' is usually `_' or nothing, depending on the target. All -functions are currently defined to have `void' return type. The -function must be terminated with `.endfunc'. - - -File: as.info, Node: Global, Next: Hidden, Prev: Func, Up: Pseudo Ops - -7.47 `.global SYMBOL', `.globl SYMBOL' -====================================== - -`.global' makes the symbol visible to `ld'. If you define SYMBOL in -your partial program, its value is made available to other partial -programs that are linked with it. Otherwise, SYMBOL takes its -attributes from a symbol of the same name from another file linked into -the same program. - - Both spellings (`.globl' and `.global') are accepted, for -compatibility with other assemblers. - - On the HPPA, `.global' is not always enough to make it accessible to -other partial programs. You may need the HPPA-only `.EXPORT' directive -as well. *Note HPPA Assembler Directives: HPPA Directives. - - -File: as.info, Node: Hidden, Next: hword, Prev: Global, Up: Pseudo Ops - -7.48 `.hidden NAMES' -==================== - -This is one of the ELF visibility directives. The other two are -`.internal' (*note `.internal': Internal.) and `.protected' (*note -`.protected': Protected.). - - This directive overrides the named symbols default visibility (which -is set by their binding: local, global or weak). The directive sets -the visibility to `hidden' which means that the symbols are not visible -to other components. Such symbols are always considered to be -`protected' as well. - - -File: as.info, Node: hword, Next: Ident, Prev: Hidden, Up: Pseudo Ops - -7.49 `.hword EXPRESSIONS' -========================= - -This expects zero or more EXPRESSIONS, and emits a 16 bit number for -each. - - This directive is a synonym for `.short'; depending on the target -architecture, it may also be a synonym for `.word'. - - -File: as.info, Node: Ident, Next: If, Prev: hword, Up: Pseudo Ops - -7.50 `.ident' -============= - -This directive is used by some assemblers to place tags in object -files. The behavior of this directive varies depending on the target. -When using the a.out object file format, `as' simply accepts the -directive for source-file compatibility with existing assemblers, but -does not emit anything for it. When using COFF, comments are emitted -to the `.comment' or `.rdata' section, depending on the target. When -using ELF, comments are emitted to the `.comment' section. - - -File: as.info, Node: If, Next: Incbin, Prev: Ident, Up: Pseudo Ops - -7.51 `.if ABSOLUTE EXPRESSION' -============================== - -`.if' marks the beginning of a section of code which is only considered -part of the source program being assembled if the argument (which must -be an ABSOLUTE EXPRESSION) is non-zero. The end of the conditional -section of code must be marked by `.endif' (*note `.endif': Endif.); -optionally, you may include code for the alternative condition, flagged -by `.else' (*note `.else': Else.). If you have several conditions to -check, `.elseif' may be used to avoid nesting blocks if/else within -each subsequent `.else' block. - - The following variants of `.if' are also supported: -`.ifdef SYMBOL' - Assembles the following section of code if the specified SYMBOL - has been defined. Note a symbol which has been referenced but not - yet defined is considered to be undefined. - -`.ifb TEXT' - Assembles the following section of code if the operand is blank - (empty). - -`.ifc STRING1,STRING2' - Assembles the following section of code if the two strings are the - same. The strings may be optionally quoted with single quotes. - If they are not quoted, the first string stops at the first comma, - and the second string stops at the end of the line. Strings which - contain whitespace should be quoted. The string comparison is - case sensitive. - -`.ifeq ABSOLUTE EXPRESSION' - Assembles the following section of code if the argument is zero. - -`.ifeqs STRING1,STRING2' - Another form of `.ifc'. The strings must be quoted using double - quotes. - -`.ifge ABSOLUTE EXPRESSION' - Assembles the following section of code if the argument is greater - than or equal to zero. - -`.ifgt ABSOLUTE EXPRESSION' - Assembles the following section of code if the argument is greater - than zero. - -`.ifle ABSOLUTE EXPRESSION' - Assembles the following section of code if the argument is less - than or equal to zero. - -`.iflt ABSOLUTE EXPRESSION' - Assembles the following section of code if the argument is less - than zero. - -`.ifnb TEXT' - Like `.ifb', but the sense of the test is reversed: this assembles - the following section of code if the operand is non-blank - (non-empty). - -`.ifnc STRING1,STRING2.' - Like `.ifc', but the sense of the test is reversed: this assembles - the following section of code if the two strings are not the same. - -`.ifndef SYMBOL' -`.ifnotdef SYMBOL' - Assembles the following section of code if the specified SYMBOL - has not been defined. Both spelling variants are equivalent. - Note a symbol which has been referenced but not yet defined is - considered to be undefined. - -`.ifne ABSOLUTE EXPRESSION' - Assembles the following section of code if the argument is not - equal to zero (in other words, this is equivalent to `.if'). - -`.ifnes STRING1,STRING2' - Like `.ifeqs', but the sense of the test is reversed: this - assembles the following section of code if the two strings are not - the same. - - -File: as.info, Node: Incbin, Next: Include, Prev: If, Up: Pseudo Ops - -7.52 `.incbin "FILE"[,SKIP[,COUNT]]' -==================================== - -The `incbin' directive includes FILE verbatim at the current location. -You can control the search paths used with the `-I' command-line option -(*note Command-Line Options: Invoking.). Quotation marks are required -around FILE. - - The SKIP argument skips a number of bytes from the start of the -FILE. The COUNT argument indicates the maximum number of bytes to -read. Note that the data is not aligned in any way, so it is the user's -responsibility to make sure that proper alignment is provided both -before and after the `incbin' directive. - - -File: as.info, Node: Include, Next: Int, Prev: Incbin, Up: Pseudo Ops - -7.53 `.include "FILE"' -====================== - -This directive provides a way to include supporting files at specified -points in your source program. The code from FILE is assembled as if -it followed the point of the `.include'; when the end of the included -file is reached, assembly of the original file continues. You can -control the search paths used with the `-I' command-line option (*note -Command-Line Options: Invoking.). Quotation marks are required around -FILE. - - -File: as.info, Node: Int, Next: Internal, Prev: Include, Up: Pseudo Ops - -7.54 `.int EXPRESSIONS' -======================= - -Expect zero or more EXPRESSIONS, of any section, separated by commas. -For each expression, emit a number that, at run time, is the value of -that expression. The byte order and bit size of the number depends on -what kind of target the assembly is for. - - -File: as.info, Node: Internal, Next: Irp, Prev: Int, Up: Pseudo Ops - -7.55 `.internal NAMES' -====================== - -This is one of the ELF visibility directives. The other two are -`.hidden' (*note `.hidden': Hidden.) and `.protected' (*note -`.protected': Protected.). - - This directive overrides the named symbols default visibility (which -is set by their binding: local, global or weak). The directive sets -the visibility to `internal' which means that the symbols are -considered to be `hidden' (i.e., not visible to other components), and -that some extra, processor specific processing must also be performed -upon the symbols as well. - - -File: as.info, Node: Irp, Next: Irpc, Prev: Internal, Up: Pseudo Ops - -7.56 `.irp SYMBOL,VALUES'... -============================ - -Evaluate a sequence of statements assigning different values to SYMBOL. -The sequence of statements starts at the `.irp' directive, and is -terminated by an `.endr' directive. For each VALUE, SYMBOL is set to -VALUE, and the sequence of statements is assembled. If no VALUE is -listed, the sequence of statements is assembled once, with SYMBOL set -to the null string. To refer to SYMBOL within the sequence of -statements, use \SYMBOL. - - For example, assembling - - .irp param,1,2,3 - move d\param,sp@- - .endr - - is equivalent to assembling - - move d1,sp@- - move d2,sp@- - move d3,sp@- - - For some caveats with the spelling of SYMBOL, see also the discussion -at *Note Macro::. - - -File: as.info, Node: Irpc, Next: Lcomm, Prev: Irp, Up: Pseudo Ops - -7.57 `.irpc SYMBOL,VALUES'... -============================= - -Evaluate a sequence of statements assigning different values to SYMBOL. -The sequence of statements starts at the `.irpc' directive, and is -terminated by an `.endr' directive. For each character in VALUE, -SYMBOL is set to the character, and the sequence of statements is -assembled. If no VALUE is listed, the sequence of statements is -assembled once, with SYMBOL set to the null string. To refer to SYMBOL -within the sequence of statements, use \SYMBOL. - - For example, assembling - - .irpc param,123 - move d\param,sp@- - .endr - - is equivalent to assembling - - move d1,sp@- - move d2,sp@- - move d3,sp@- - - For some caveats with the spelling of SYMBOL, see also the discussion -at *Note Macro::. - - -File: as.info, Node: Lcomm, Next: Lflags, Prev: Irpc, Up: Pseudo Ops - -7.58 `.lcomm SYMBOL , LENGTH' -============================= - -Reserve LENGTH (an absolute expression) bytes for a local common -denoted by SYMBOL. The section and value of SYMBOL are those of the -new local common. The addresses are allocated in the bss section, so -that at run-time the bytes start off zeroed. SYMBOL is not declared -global (*note `.global': Global.), so is normally not visible to `ld'. - - Some targets permit a third argument to be used with `.lcomm'. This -argument specifies the desired alignment of the symbol in the bss -section. - - The syntax for `.lcomm' differs slightly on the HPPA. The syntax is -`SYMBOL .lcomm, LENGTH'; SYMBOL is optional. - - -File: as.info, Node: Lflags, Next: Line, Prev: Lcomm, Up: Pseudo Ops - -7.59 `.lflags' -============== - -`as' accepts this directive, for compatibility with other assemblers, -but ignores it. - - -File: as.info, Node: Line, Next: Linkonce, Prev: Lflags, Up: Pseudo Ops - -7.60 `.line LINE-NUMBER' -======================== - - Change the logical line number. LINE-NUMBER must be an absolute -expression. The next line has that logical line number. Therefore any -other statements on the current line (after a statement separator -character) are reported as on logical line number LINE-NUMBER - 1. One -day `as' will no longer support this directive: it is recognized only -for compatibility with existing assembler programs. - - Even though this is a directive associated with the `a.out' or -`b.out' object-code formats, `as' still recognizes it when producing -COFF output, and treats `.line' as though it were the COFF `.ln' _if_ -it is found outside a `.def'/`.endef' pair. - - Inside a `.def', `.line' is, instead, one of the directives used by -compilers to generate auxiliary symbol information for debugging. - - -File: as.info, Node: Linkonce, Next: List, Prev: Line, Up: Pseudo Ops - -7.61 `.linkonce [TYPE]' -======================= - -Mark the current section so that the linker only includes a single copy -of it. This may be used to include the same section in several -different object files, but ensure that the linker will only include it -once in the final output file. The `.linkonce' pseudo-op must be used -for each instance of the section. Duplicate sections are detected -based on the section name, so it should be unique. - - This directive is only supported by a few object file formats; as of -this writing, the only object file format which supports it is the -Portable Executable format used on Windows NT. - - The TYPE argument is optional. If specified, it must be one of the -following strings. For example: - .linkonce same_size - Not all types may be supported on all object file formats. - -`discard' - Silently discard duplicate sections. This is the default. - -`one_only' - Warn if there are duplicate sections, but still keep only one copy. - -`same_size' - Warn if any of the duplicates have different sizes. - -`same_contents' - Warn if any of the duplicates do not have exactly the same - contents. - - -File: as.info, Node: Ln, Next: LNS directives, Prev: List, Up: Pseudo Ops - -7.62 `.ln LINE-NUMBER' -====================== - -`.ln' is a synonym for `.line'. - - -File: as.info, Node: MRI, Next: Noaltmacro, Prev: Macro, Up: Pseudo Ops - -7.63 `.mri VAL' -=============== - -If VAL is non-zero, this tells `as' to enter MRI mode. If VAL is zero, -this tells `as' to exit MRI mode. This change affects code assembled -until the next `.mri' directive, or until the end of the file. *Note -MRI mode: M. - - -File: as.info, Node: List, Next: Ln, Prev: Linkonce, Up: Pseudo Ops - -7.64 `.list' -============ - -Control (in conjunction with the `.nolist' directive) whether or not -assembly listings are generated. These two directives maintain an -internal counter (which is zero initially). `.list' increments the -counter, and `.nolist' decrements it. Assembly listings are generated -whenever the counter is greater than zero. - - By default, listings are disabled. When you enable them (with the -`-a' command line option; *note Command-Line Options: Invoking.), the -initial value of the listing counter is one. - - -File: as.info, Node: Long, Next: Macro, Prev: LNS directives, Up: Pseudo Ops - -7.65 `.long EXPRESSIONS' -======================== - -`.long' is the same as `.int', *note `.int': Int. - - -File: as.info, Node: Macro, Next: MRI, Prev: Long, Up: Pseudo Ops - -7.66 `.macro' -============= - -The commands `.macro' and `.endm' allow you to define macros that -generate assembly output. For example, this definition specifies a -macro `sum' that puts a sequence of numbers into memory: - - .macro sum from=0, to=5 - .long \from - .if \to-\from - sum "(\from+1)",\to - .endif - .endm - -With that definition, `SUM 0,5' is equivalent to this assembly input: - - .long 0 - .long 1 - .long 2 - .long 3 - .long 4 - .long 5 - -`.macro MACNAME' -`.macro MACNAME MACARGS ...' - Begin the definition of a macro called MACNAME. If your macro - definition requires arguments, specify their names after the macro - name, separated by commas or spaces. You can qualify the macro - argument to indicate whether all invocations must specify a - non-blank value (through `:`req''), or whether it takes all of the - remaining arguments (through `:`vararg''). You can supply a - default value for any macro argument by following the name with - `=DEFLT'. You cannot define two macros with the same MACNAME - unless it has been subject to the `.purgem' directive (*Note - Purgem::.) between the two definitions. For example, these are - all valid `.macro' statements: - - `.macro comm' - Begin the definition of a macro called `comm', which takes no - arguments. - - `.macro plus1 p, p1' - `.macro plus1 p p1' - Either statement begins the definition of a macro called - `plus1', which takes two arguments; within the macro - definition, write `\p' or `\p1' to evaluate the arguments. - - `.macro reserve_str p1=0 p2' - Begin the definition of a macro called `reserve_str', with two - arguments. The first argument has a default value, but not - the second. After the definition is complete, you can call - the macro either as `reserve_str A,B' (with `\p1' evaluating - to A and `\p2' evaluating to B), or as `reserve_str ,B' (with - `\p1' evaluating as the default, in this case `0', and `\p2' - evaluating to B). - -`.macro m p1:req, p2=0, p3:vararg' - Begin the definition of a macro called `m', with at least three - arguments. The first argument must always have a value specified, - but not the second, which instead has a default value. The third - formal will get assigned all remaining arguments specified at - invocation time. - - When you call a macro, you can specify the argument values either - by position, or by keyword. For example, `sum 9,17' is equivalent - to `sum to=17, from=9'. - - Note that since each of the MACARGS can be an identifier exactly - as any other one permitted by the target architecture, there may be - occasional problems if the target hand-crafts special meanings to - certain characters when they occur in a special position. For - example, if colon (`:') is generally permitted to be part of a - symbol name, but the architecture specific code special-cases it - when occuring as the final character of a symbol (to denote a - label), then the macro parameter replacement code will have no way - of knowing that and consider the whole construct (including the - colon) an identifier, and check only this identifier for being the - subject to parameter substitution. In this example, besides the - potential of just separating identifier and colon by white space, - using alternate macro syntax (*Note Altmacro::.) and ampersand - (`&') as the character to separate literal text from macro - parameters (or macro parameters from one another) would provide a - way to achieve the same effect: - - .altmacro - .macro label l - l&: - .endm - - This applies identically to the identifiers used in `.irp' (*Note - Irp::.) and `.irpc' (*Note Irpc::.). - -`.endm' - Mark the end of a macro definition. - -`.exitm' - Exit early from the current macro definition. - -`\@' - `as' maintains a counter of how many macros it has executed in - this pseudo-variable; you can copy that number to your output with - `\@', but _only within a macro definition_. - -`LOCAL NAME [ , ... ]' - _Warning: `LOCAL' is only available if you select "alternate macro - syntax" with `--alternate' or `.altmacro'._ *Note `.altmacro': - Altmacro. - - -File: as.info, Node: Altmacro, Next: Ascii, Prev: Align, Up: Pseudo Ops - -7.67 `.altmacro' -================ - -Enable alternate macro mode, enabling: - -`LOCAL NAME [ , ... ]' - One additional directive, `LOCAL', is available. It is used to - generate a string replacement for each of the NAME arguments, and - replace any instances of NAME in each macro expansion. The - replacement string is unique in the assembly, and different for - each separate macro expansion. `LOCAL' allows you to write macros - that define symbols, without fear of conflict between separate - macro expansions. - -`String delimiters' - You can write strings delimited in these other ways besides - `"STRING"': - - `'STRING'' - You can delimit strings with single-quote charaters. - - `' - You can delimit strings with matching angle brackets. - -`single-character string escape' - To include any single character literally in a string (even if the - character would otherwise have some special meaning), you can - prefix the character with `!' (an exclamation mark). For example, - you can write `<4.3 !> 5.4!!>' to get the literal text `4.3 > - 5.4!'. - -`Expression results as strings' - You can write `%EXPR' to evaluate the expression EXPR and use the - result as a string. - - -File: as.info, Node: Noaltmacro, Next: Nolist, Prev: MRI, Up: Pseudo Ops - -7.68 `.noaltmacro' -================== - -Disable alternate macro mode. *Note Altmacro:: - - -File: as.info, Node: Nolist, Next: Octa, Prev: Noaltmacro, Up: Pseudo Ops - -7.69 `.nolist' -============== - -Control (in conjunction with the `.list' directive) whether or not -assembly listings are generated. These two directives maintain an -internal counter (which is zero initially). `.list' increments the -counter, and `.nolist' decrements it. Assembly listings are generated -whenever the counter is greater than zero. - - -File: as.info, Node: Octa, Next: Org, Prev: Nolist, Up: Pseudo Ops - -7.70 `.octa BIGNUMS' -==================== - -This directive expects zero or more bignums, separated by commas. For -each bignum, it emits a 16-byte integer. - - The term "octa" comes from contexts in which a "word" is two bytes; -hence _octa_-word for 16 bytes. - - -File: as.info, Node: Org, Next: P2align, Prev: Octa, Up: Pseudo Ops - -7.71 `.org NEW-LC , FILL' -========================= - -Advance the location counter of the current section to NEW-LC. NEW-LC -is either an absolute expression or an expression with the same section -as the current subsection. That is, you can't use `.org' to cross -sections: if NEW-LC has the wrong section, the `.org' directive is -ignored. To be compatible with former assemblers, if the section of -NEW-LC is absolute, `as' issues a warning, then pretends the section of -NEW-LC is the same as the current subsection. - - `.org' may only increase the location counter, or leave it -unchanged; you cannot use `.org' to move the location counter backwards. - - Because `as' tries to assemble programs in one pass, NEW-LC may not -be undefined. If you really detest this restriction we eagerly await a -chance to share your improved assembler. - - Beware that the origin is relative to the start of the section, not -to the start of the subsection. This is compatible with other people's -assemblers. - - When the location counter (of the current subsection) is advanced, -the intervening bytes are filled with FILL which should be an absolute -expression. If the comma and FILL are omitted, FILL defaults to zero. - - -File: as.info, Node: P2align, Next: PopSection, Prev: Org, Up: Pseudo Ops - -7.72 `.p2align[wl] ABS-EXPR, ABS-EXPR, ABS-EXPR' -================================================ - -Pad the location counter (in the current subsection) to a particular -storage boundary. The first expression (which must be absolute) is the -number of low-order zero bits the location counter must have after -advancement. For example `.p2align 3' advances the location counter -until it a multiple of 8. If the location counter is already a -multiple of 8, no change is needed. - - The second expression (also absolute) gives the fill value to be -stored in the padding bytes. It (and the comma) may be omitted. If it -is omitted, the padding bytes are normally zero. However, on some -systems, if the section is marked as containing code and the fill value -is omitted, the space is filled with no-op instructions. - - The third expression is also absolute, and is also optional. If it -is present, it is the maximum number of bytes that should be skipped by -this alignment directive. If doing the alignment would require -skipping more bytes than the specified maximum, then the alignment is -not done at all. You can omit the fill value (the second argument) -entirely by simply using two commas after the required alignment; this -can be useful if you want the alignment to be filled with no-op -instructions when appropriate. - - The `.p2alignw' and `.p2alignl' directives are variants of the -`.p2align' directive. The `.p2alignw' directive treats the fill -pattern as a two byte word value. The `.p2alignl' directives treats the -fill pattern as a four byte longword value. For example, `.p2alignw -2,0x368d' will align to a multiple of 4. If it skips two bytes, they -will be filled in with the value 0x368d (the exact placement of the -bytes depends upon the endianness of the processor). If it skips 1 or -3 bytes, the fill value is undefined. - - -File: as.info, Node: Previous, Next: Print, Prev: PopSection, Up: Pseudo Ops - -7.73 `.previous' -================ - -This is one of the ELF section stack manipulation directives. The -others are `.section' (*note Section::), `.subsection' (*note -SubSection::), `.pushsection' (*note PushSection::), and `.popsection' -(*note PopSection::). - - This directive swaps the current section (and subsection) with most -recently referenced section (and subsection) prior to this one. -Multiple `.previous' directives in a row will flip between two sections -(and their subsections). - - In terms of the section stack, this directive swaps the current -section with the top section on the section stack. - - -File: as.info, Node: PopSection, Next: Previous, Prev: P2align, Up: Pseudo Ops - -7.74 `.popsection' -================== - -This is one of the ELF section stack manipulation directives. The -others are `.section' (*note Section::), `.subsection' (*note -SubSection::), `.pushsection' (*note PushSection::), and `.previous' -(*note Previous::). - - This directive replaces the current section (and subsection) with -the top section (and subsection) on the section stack. This section is -popped off the stack. - - -File: as.info, Node: Print, Next: Protected, Prev: Previous, Up: Pseudo Ops - -7.75 `.print STRING' -==================== - -`as' will print STRING on the standard output during assembly. You -must put STRING in double quotes. - - -File: as.info, Node: Protected, Next: Psize, Prev: Print, Up: Pseudo Ops - -7.76 `.protected NAMES' -======================= - -This is one of the ELF visibility directives. The other two are -`.hidden' (*note Hidden::) and `.internal' (*note Internal::). - - This directive overrides the named symbols default visibility (which -is set by their binding: local, global or weak). The directive sets -the visibility to `protected' which means that any references to the -symbols from within the components that defines them must be resolved -to the definition in that component, even if a definition in another -component would normally preempt this. - - -File: as.info, Node: Psize, Next: Purgem, Prev: Protected, Up: Pseudo Ops - -7.77 `.psize LINES , COLUMNS' -============================= - -Use this directive to declare the number of lines--and, optionally, the -number of columns--to use for each page, when generating listings. - - If you do not use `.psize', listings use a default line-count of 60. -You may omit the comma and COLUMNS specification; the default width is -200 columns. - - `as' generates formfeeds whenever the specified number of lines is -exceeded (or whenever you explicitly request one, using `.eject'). - - If you specify LINES as `0', no formfeeds are generated save those -explicitly specified with `.eject'. - - -File: as.info, Node: Purgem, Next: PushSection, Prev: Psize, Up: Pseudo Ops - -7.78 `.purgem NAME' -=================== - -Undefine the macro NAME, so that later uses of the string will not be -expanded. *Note Macro::. - - -File: as.info, Node: PushSection, Next: Quad, Prev: Purgem, Up: Pseudo Ops - -7.79 `.pushsection NAME , SUBSECTION' -===================================== - -This is one of the ELF section stack manipulation directives. The -others are `.section' (*note Section::), `.subsection' (*note -SubSection::), `.popsection' (*note PopSection::), and `.previous' -(*note Previous::). - - This directive pushes the current section (and subsection) onto the -top of the section stack, and then replaces the current section and -subsection with `name' and `subsection'. - - -File: as.info, Node: Quad, Next: Rept, Prev: PushSection, Up: Pseudo Ops - -7.80 `.quad BIGNUMS' -==================== - -`.quad' expects zero or more bignums, separated by commas. For each -bignum, it emits an 8-byte integer. If the bignum won't fit in 8 -bytes, it prints a warning message; and just takes the lowest order 8 -bytes of the bignum. - - The term "quad" comes from contexts in which a "word" is two bytes; -hence _quad_-word for 8 bytes. - - -File: as.info, Node: Rept, Next: Sbttl, Prev: Quad, Up: Pseudo Ops - -7.81 `.rept COUNT' -================== - -Repeat the sequence of lines between the `.rept' directive and the next -`.endr' directive COUNT times. - - For example, assembling - - .rept 3 - .long 0 - .endr - - is equivalent to assembling - - .long 0 - .long 0 - .long 0 - - -File: as.info, Node: Sbttl, Next: Scl, Prev: Rept, Up: Pseudo Ops - -7.82 `.sbttl "SUBHEADING"' -========================== - -Use SUBHEADING as the title (third line, immediately after the title -line) when generating assembly listings. - - This directive affects subsequent pages, as well as the current page -if it appears within ten lines of the top of a page. - - -File: as.info, Node: Scl, Next: Section, Prev: Sbttl, Up: Pseudo Ops - -7.83 `.scl CLASS' -================= - -Set the storage-class value for a symbol. This directive may only be -used inside a `.def'/`.endef' pair. Storage class may flag whether a -symbol is static or external, or it may record further symbolic -debugging information. - - -File: as.info, Node: Section, Next: Set, Prev: Scl, Up: Pseudo Ops - -7.84 `.section NAME' -==================== - -Use the `.section' directive to assemble the following code into a -section named NAME. - - This directive is only supported for targets that actually support -arbitrarily named sections; on `a.out' targets, for example, it is not -accepted, even with a standard `a.out' section name. - -COFF Version ------------- - - For COFF targets, the `.section' directive is used in one of the -following ways: - - .section NAME[, "FLAGS"] - .section NAME[, SUBSEGMENT] - - If the optional argument is quoted, it is taken as flags to use for -the section. Each flag is a single character. The following flags are -recognized: -`b' - bss section (uninitialized data) - -`n' - section is not loaded - -`w' - writable section - -`d' - data section - -`r' - read-only section - -`x' - executable section - -`s' - shared section (meaningful for PE targets) - -`a' - ignored. (For compatibility with the ELF version) - - If no flags are specified, the default flags depend upon the section -name. If the section name is not recognized, the default will be for -the section to be loaded and writable. Note the `n' and `w' flags -remove attributes from the section, rather than adding them, so if they -are used on their own it will be as if no flags had been specified at -all. - - If the optional argument to the `.section' directive is not quoted, -it is taken as a subsegment number (*note Sub-Sections::). - -ELF Version ------------ - - This is one of the ELF section stack manipulation directives. The -others are `.subsection' (*note SubSection::), `.pushsection' (*note -PushSection::), `.popsection' (*note PopSection::), and `.previous' -(*note Previous::). - - For ELF targets, the `.section' directive is used like this: - - .section NAME [, "FLAGS"[, @TYPE[,FLAG_SPECIFIC_ARGUMENTS]]] - - The optional FLAGS argument is a quoted string which may contain any -combination of the following characters: -`a' - section is allocatable - -`w' - section is writable - -`x' - section is executable - -`M' - section is mergeable - -`S' - section contains zero terminated strings - -`G' - section is a member of a section group - -`T' - section is used for thread-local-storage - - The optional TYPE argument may contain one of the following -constants: -`@progbits' - section contains data - -`@nobits' - section does not contain data (i.e., section only occupies space) - -`@note' - section contains data which is used by things other than the - program - -`@init_array' - section contains an array of pointers to init functions - -`@fini_array' - section contains an array of pointers to finish functions - -`@preinit_array' - section contains an array of pointers to pre-init functions - - Many targets only support the first three section types. - - Note on targets where the `@' character is the start of a comment (eg -ARM) then another character is used instead. For example the ARM port -uses the `%' character. - - If FLAGS contains the `M' symbol then the TYPE argument must be -specified as well as an extra argument - ENTSIZE - like this: - - .section NAME , "FLAGS"M, @TYPE, ENTSIZE - - Sections with the `M' flag but not `S' flag must contain fixed size -constants, each ENTSIZE octets long. Sections with both `M' and `S' -must contain zero terminated strings where each character is ENTSIZE -bytes long. The linker may remove duplicates within sections with the -same name, same entity size and same flags. ENTSIZE must be an -absolute expression. - - If FLAGS contains the `G' symbol then the TYPE argument must be -present along with an additional field like this: - - .section NAME , "FLAGS"G, @TYPE, GROUPNAME[, LINKAGE] - - The GROUPNAME field specifies the name of the section group to which -this particular section belongs. The optional linkage field can -contain: -`comdat' - indicates that only one copy of this section should be retained - -`.gnu.linkonce' - an alias for comdat - - Note - if both the M and G flags are present then the fields for the -Merge flag should come first, like this: - - .section NAME , "FLAGS"MG, @TYPE, ENTSIZE, GROUPNAME[, LINKAGE] - - If no flags are specified, the default flags depend upon the section -name. If the section name is not recognized, the default will be for -the section to have none of the above flags: it will not be allocated -in memory, nor writable, nor executable. The section will contain data. - - For ELF targets, the assembler supports another type of `.section' -directive for compatibility with the Solaris assembler: - - .section "NAME"[, FLAGS...] - - Note that the section name is quoted. There may be a sequence of -comma separated flags: -`#alloc' - section is allocatable - -`#write' - section is writable - -`#execinstr' - section is executable - -`#tls' - section is used for thread local storage - - This directive replaces the current section and subsection. See the -contents of the gas testsuite directory `gas/testsuite/gas/elf' for -some examples of how this directive and the other section stack -directives work. - - -File: as.info, Node: Set, Next: Short, Prev: Section, Up: Pseudo Ops - -7.85 `.set SYMBOL, EXPRESSION' -============================== - -Set the value of SYMBOL to EXPRESSION. This changes SYMBOL's value and -type to conform to EXPRESSION. If SYMBOL was flagged as external, it -remains flagged (*note Symbol Attributes::). - - You may `.set' a symbol many times in the same assembly. - - If you `.set' a global symbol, the value stored in the object file -is the last value stored into it. - - The syntax for `set' on the HPPA is `SYMBOL .set EXPRESSION'. - - On Z80 `set' is a real instruction, use `SYMBOL defl EXPRESSION' -instead. - - -File: as.info, Node: Short, Next: Single, Prev: Set, Up: Pseudo Ops - -7.86 `.short EXPRESSIONS' -========================= - -`.short' is normally the same as `.word'. *Note `.word': Word. - - In some configurations, however, `.short' and `.word' generate -numbers of different lengths; *note Machine Dependencies::. - - -File: as.info, Node: Single, Next: Size, Prev: Short, Up: Pseudo Ops - -7.87 `.single FLONUMS' -====================== - -This directive assembles zero or more flonums, separated by commas. It -has the same effect as `.float'. The exact kind of floating point -numbers emitted depends on how `as' is configured. *Note Machine -Dependencies::. - - -File: as.info, Node: Size, Next: Skip, Prev: Single, Up: Pseudo Ops - -7.88 `.size' -============ - -This directive is used to set the size associated with a symbol. - -COFF Version ------------- - - For COFF targets, the `.size' directive is only permitted inside -`.def'/`.endef' pairs. It is used like this: - - .size EXPRESSION - -ELF Version ------------ - - For ELF targets, the `.size' directive is used like this: - - .size NAME , EXPRESSION - - This directive sets the size associated with a symbol NAME. The -size in bytes is computed from EXPRESSION which can make use of label -arithmetic. This directive is typically used to set the size of -function symbols. - - -File: as.info, Node: Sleb128, Next: Space, Prev: Skip, Up: Pseudo Ops - -7.89 `.sleb128 EXPRESSIONS' -=========================== - -SLEB128 stands for "signed little endian base 128." This is a compact, -variable length representation of numbers used by the DWARF symbolic -debugging format. *Note `.uleb128': Uleb128. - - -File: as.info, Node: Skip, Next: Sleb128, Prev: Size, Up: Pseudo Ops - -7.90 `.skip SIZE , FILL' -======================== - -This directive emits SIZE bytes, each of value FILL. Both SIZE and -FILL are absolute expressions. If the comma and FILL are omitted, FILL -is assumed to be zero. This is the same as `.space'. - - -File: as.info, Node: Space, Next: Stab, Prev: Sleb128, Up: Pseudo Ops - -7.91 `.space SIZE , FILL' -========================= - -This directive emits SIZE bytes, each of value FILL. Both SIZE and -FILL are absolute expressions. If the comma and FILL are omitted, FILL -is assumed to be zero. This is the same as `.skip'. - - _Warning:_ `.space' has a completely different meaning for HPPA - targets; use `.block' as a substitute. See `HP9000 Series 800 - Assembly Language Reference Manual' (HP 92432-90001) for the - meaning of the `.space' directive. *Note HPPA Assembler - Directives: HPPA Directives, for a summary. - - -File: as.info, Node: Stab, Next: String, Prev: Space, Up: Pseudo Ops - -7.92 `.stabd, .stabn, .stabs' -============================= - -There are three directives that begin `.stab'. All emit symbols (*note -Symbols::), for use by symbolic debuggers. The symbols are not entered -in the `as' hash table: they cannot be referenced elsewhere in the -source file. Up to five fields are required: - -STRING - This is the symbol's name. It may contain any character except - `\000', so is more general than ordinary symbol names. Some - debuggers used to code arbitrarily complex structures into symbol - names using this field. - -TYPE - An absolute expression. The symbol's type is set to the low 8 - bits of this expression. Any bit pattern is permitted, but `ld' - and debuggers choke on silly bit patterns. - -OTHER - An absolute expression. The symbol's "other" attribute is set to - the low 8 bits of this expression. - -DESC - An absolute expression. The symbol's descriptor is set to the low - 16 bits of this expression. - -VALUE - An absolute expression which becomes the symbol's value. - - If a warning is detected while reading a `.stabd', `.stabn', or -`.stabs' statement, the symbol has probably already been created; you -get a half-formed symbol in your object file. This is compatible with -earlier assemblers! - -`.stabd TYPE , OTHER , DESC' - The "name" of the symbol generated is not even an empty string. - It is a null pointer, for compatibility. Older assemblers used a - null pointer so they didn't waste space in object files with empty - strings. - - The symbol's value is set to the location counter, relocatably. - When your program is linked, the value of this symbol is the - address of the location counter when the `.stabd' was assembled. - -`.stabn TYPE , OTHER , DESC , VALUE' - The name of the symbol is set to the empty string `""'. - -`.stabs STRING , TYPE , OTHER , DESC , VALUE' - All five fields are specified. - - -File: as.info, Node: String, Next: Struct, Prev: Stab, Up: Pseudo Ops - -7.93 `.string' "STR" -==================== - -Copy the characters in STR to the object file. You may specify more -than one string to copy, separated by commas. Unless otherwise -specified for a particular machine, the assembler marks the end of each -string with a 0 byte. You can use any of the escape sequences -described in *Note Strings: Strings. - - -File: as.info, Node: Struct, Next: SubSection, Prev: String, Up: Pseudo Ops - -7.94 `.struct EXPRESSION' -========================= - -Switch to the absolute section, and set the section offset to -EXPRESSION, which must be an absolute expression. You might use this -as follows: - .struct 0 - field1: - .struct field1 + 4 - field2: - .struct field2 + 4 - field3: - This would define the symbol `field1' to have the value 0, the symbol -`field2' to have the value 4, and the symbol `field3' to have the value -8. Assembly would be left in the absolute section, and you would need -to use a `.section' directive of some sort to change to some other -section before further assembly. - - -File: as.info, Node: SubSection, Next: Symver, Prev: Struct, Up: Pseudo Ops - -7.95 `.subsection NAME' -======================= - -This is one of the ELF section stack manipulation directives. The -others are `.section' (*note Section::), `.pushsection' (*note -PushSection::), `.popsection' (*note PopSection::), and `.previous' -(*note Previous::). - - This directive replaces the current subsection with `name'. The -current section is not changed. The replaced subsection is put onto -the section stack in place of the then current top of stack subsection. - - -File: as.info, Node: Symver, Next: Tag, Prev: SubSection, Up: Pseudo Ops - -7.96 `.symver' -============== - -Use the `.symver' directive to bind symbols to specific version nodes -within a source file. This is only supported on ELF platforms, and is -typically used when assembling files to be linked into a shared library. -There are cases where it may make sense to use this in objects to be -bound into an application itself so as to override a versioned symbol -from a shared library. - - For ELF targets, the `.symver' directive can be used like this: - .symver NAME, NAME2@NODENAME - If the symbol NAME is defined within the file being assembled, the -`.symver' directive effectively creates a symbol alias with the name -NAME2@NODENAME, and in fact the main reason that we just don't try and -create a regular alias is that the @ character isn't permitted in -symbol names. The NAME2 part of the name is the actual name of the -symbol by which it will be externally referenced. The name NAME itself -is merely a name of convenience that is used so that it is possible to -have definitions for multiple versions of a function within a single -source file, and so that the compiler can unambiguously know which -version of a function is being mentioned. The NODENAME portion of the -alias should be the name of a node specified in the version script -supplied to the linker when building a shared library. If you are -attempting to override a versioned symbol from a shared library, then -NODENAME should correspond to the nodename of the symbol you are trying -to override. - - If the symbol NAME is not defined within the file being assembled, -all references to NAME will be changed to NAME2@NODENAME. If no -reference to NAME is made, NAME2@NODENAME will be removed from the -symbol table. - - Another usage of the `.symver' directive is: - .symver NAME, NAME2@@NODENAME - In this case, the symbol NAME must exist and be defined within the -file being assembled. It is similar to NAME2@NODENAME. The difference -is NAME2@@NODENAME will also be used to resolve references to NAME2 by -the linker. - - The third usage of the `.symver' directive is: - .symver NAME, NAME2@@@NODENAME - When NAME is not defined within the file being assembled, it is -treated as NAME2@NODENAME. When NAME is defined within the file being -assembled, the symbol name, NAME, will be changed to NAME2@@NODENAME. - - -File: as.info, Node: Tag, Next: Text, Prev: Symver, Up: Pseudo Ops - -7.97 `.tag STRUCTNAME' -====================== - -This directive is generated by compilers to include auxiliary debugging -information in the symbol table. It is only permitted inside -`.def'/`.endef' pairs. Tags are used to link structure definitions in -the symbol table with instances of those structures. - - -File: as.info, Node: Text, Next: Title, Prev: Tag, Up: Pseudo Ops - -7.98 `.text SUBSECTION' -======================= - -Tells `as' to assemble the following statements onto the end of the -text subsection numbered SUBSECTION, which is an absolute expression. -If SUBSECTION is omitted, subsection number zero is used. - - -File: as.info, Node: Title, Next: Type, Prev: Text, Up: Pseudo Ops - -7.99 `.title "HEADING"' -======================= - -Use HEADING as the title (second line, immediately after the source -file name and pagenumber) when generating assembly listings. - - This directive affects subsequent pages, as well as the current page -if it appears within ten lines of the top of a page. - - -File: as.info, Node: Type, Next: Uleb128, Prev: Title, Up: Pseudo Ops - -7.100 `.type' -============= - -This directive is used to set the type of a symbol. - -COFF Version ------------- - - For COFF targets, this directive is permitted only within -`.def'/`.endef' pairs. It is used like this: - - .type INT - - This records the integer INT as the type attribute of a symbol table -entry. - -ELF Version ------------ - - For ELF targets, the `.type' directive is used like this: - - .type NAME , TYPE DESCRIPTION - - This sets the type of symbol NAME to be either a function symbol or -an object symbol. There are five different syntaxes supported for the -TYPE DESCRIPTION field, in order to provide compatibility with various -other assemblers. The syntaxes supported are: - - .type ,#function - .type ,#object - - .type ,@function - .type ,@object - - .type ,%function - .type ,%object - - .type ,"function" - .type ,"object" - - .type STT_FUNCTION - .type STT_OBJECT - - -File: as.info, Node: Uleb128, Next: Val, Prev: Type, Up: Pseudo Ops - -7.101 `.uleb128 EXPRESSIONS' -============================ - -ULEB128 stands for "unsigned little endian base 128." This is a -compact, variable length representation of numbers used by the DWARF -symbolic debugging format. *Note `.sleb128': Sleb128. - - -File: as.info, Node: Val, Next: Version, Prev: Uleb128, Up: Pseudo Ops - -7.102 `.val ADDR' -================= - -This directive, permitted only within `.def'/`.endef' pairs, records -the address ADDR as the value attribute of a symbol table entry. - - -File: as.info, Node: Version, Next: VTableEntry, Prev: Val, Up: Pseudo Ops - -7.103 `.version "STRING"' -========================= - -This directive creates a `.note' section and places into it an ELF -formatted note of type NT_VERSION. The note's name is set to `string'. - - -File: as.info, Node: VTableEntry, Next: VTableInherit, Prev: Version, Up: Pseudo Ops - -7.104 `.vtable_entry TABLE, OFFSET' -=================================== - -This directive finds or creates a symbol `table' and creates a -`VTABLE_ENTRY' relocation for it with an addend of `offset'. - - -File: as.info, Node: VTableInherit, Next: Warning, Prev: VTableEntry, Up: Pseudo Ops - -7.105 `.vtable_inherit CHILD, PARENT' -===================================== - -This directive finds the symbol `child' and finds or creates the symbol -`parent' and then creates a `VTABLE_INHERIT' relocation for the parent -whose addend is the value of the child symbol. As a special case the -parent name of `0' is treated as refering the `*ABS*' section. - - -File: as.info, Node: Warning, Next: Weak, Prev: VTableInherit, Up: Pseudo Ops - -7.106 `.warning "STRING"' -========================= - -Similar to the directive `.error' (*note `.error "STRING"': Error.), -but just emits a warning. - - -File: as.info, Node: Weak, Next: Weakref, Prev: Warning, Up: Pseudo Ops - -7.107 `.weak NAMES' -=================== - -This directive sets the weak attribute on the comma separated list of -symbol `names'. If the symbols do not already exist, they will be -created. - - On COFF targets other than PE, weak symbols are a GNU extension. -This directive sets the weak attribute on the comma separated list of -symbol `names'. If the symbols do not already exist, they will be -created. - - On the PE target, weak symbols are supported natively as weak -aliases. When a weak symbol is created that is not an alias, GAS -creates an alternate symbol to hold the default value. - - -File: as.info, Node: Weakref, Next: Word, Prev: Weak, Up: Pseudo Ops - -7.108 `.weakref ALIAS, TARGET' -============================== - -This directive creates an alias to the target symbol that enables the -symbol to be referenced with weak-symbol semantics, but without -actually making it weak. If direct references or definitions of the -symbol are present, then the symbol will not be weak, but if all -references to it are through weak references, the symbol will be marked -as weak in the symbol table. - - The effect is equivalent to moving all references to the alias to a -separate assembly source file, renaming the alias to the symbol in it, -declaring the symbol as weak there, and running a reloadable link to -merge the object files resulting from the assembly of the new source -file and the old source file that had the references to the alias -removed. - - The alias itself never makes to the symbol table, and is entirely -handled within the assembler. - - -File: as.info, Node: Word, Next: Deprecated, Prev: Weakref, Up: Pseudo Ops - -7.109 `.word EXPRESSIONS' -========================= - -This directive expects zero or more EXPRESSIONS, of any section, -separated by commas. - - The size of the number emitted, and its byte order, depend on what -target computer the assembly is for. - - _Warning: Special Treatment to support Compilers_ - - Machines with a 32-bit address space, but that do less than 32-bit -addressing, require the following special treatment. If the machine of -interest to you does 32-bit addressing (or doesn't require it; *note -Machine Dependencies::), you can ignore this issue. - - In order to assemble compiler output into something that works, `as' -occasionally does strange things to `.word' directives. Directives of -the form `.word sym1-sym2' are often emitted by compilers as part of -jump tables. Therefore, when `as' assembles a directive of the form -`.word sym1-sym2', and the difference between `sym1' and `sym2' does -not fit in 16 bits, `as' creates a "secondary jump table", immediately -before the next label. This secondary jump table is preceded by a -short-jump to the first byte after the secondary table. This -short-jump prevents the flow of control from accidentally falling into -the new table. Inside the table is a long-jump to `sym2'. The -original `.word' contains `sym1' minus the address of the long-jump to -`sym2'. - - If there were several occurrences of `.word sym1-sym2' before the -secondary jump table, all of them are adjusted. If there was a `.word -sym3-sym4', that also did not fit in sixteen bits, a long-jump to -`sym4' is included in the secondary jump table, and the `.word' -directives are adjusted to contain `sym3' minus the address of the -long-jump to `sym4'; and so on, for as many entries in the original -jump table as necessary. - - -File: as.info, Node: Deprecated, Prev: Word, Up: Pseudo Ops - -7.110 Deprecated Directives -=========================== - -One day these directives won't work. They are included for -compatibility with older assemblers. -.abort - -.line - - -File: as.info, Node: Machine Dependencies, Next: Reporting Bugs, Prev: Pseudo Ops, Up: Top - -8 Machine Dependent Features -**************************** - -The machine instruction sets are (almost by definition) different on -each machine where `as' runs. Floating point representations vary as -well, and `as' often supports a few additional directives or -command-line options for compatibility with other assemblers on a -particular platform. Finally, some versions of `as' support special -pseudo-instructions for branch optimization. - - This chapter discusses most of these differences, though it does not -include details on any machine's instruction set. For details on that -subject, see the hardware manufacturer's manual. - -* Menu: - - -* Alpha-Dependent:: Alpha Dependent Features - -* ARC-Dependent:: ARC Dependent Features - -* ARM-Dependent:: ARM Dependent Features - -* BFIN-Dependent:: BFIN Dependent Features - -* CRIS-Dependent:: CRIS Dependent Features - -* D10V-Dependent:: D10V Dependent Features - -* D30V-Dependent:: D30V Dependent Features - -* H8/300-Dependent:: Renesas H8/300 Dependent Features - -* HPPA-Dependent:: HPPA Dependent Features - -* ESA/390-Dependent:: IBM ESA/390 Dependent Features - -* i386-Dependent:: Intel 80386 and AMD x86-64 Dependent Features - -* i860-Dependent:: Intel 80860 Dependent Features - -* i960-Dependent:: Intel 80960 Dependent Features - -* IA-64-Dependent:: Intel IA-64 Dependent Features - -* IP2K-Dependent:: IP2K Dependent Features - -* M32C-Dependent:: M32C Dependent Features - -* M32R-Dependent:: M32R Dependent Features - -* M68K-Dependent:: M680x0 Dependent Features - -* M68HC11-Dependent:: M68HC11 and 68HC12 Dependent Features - -* MIPS-Dependent:: MIPS Dependent Features - -* MMIX-Dependent:: MMIX Dependent Features - -* MSP430-Dependent:: MSP430 Dependent Features - -* SH-Dependent:: Renesas / SuperH SH Dependent Features -* SH64-Dependent:: SuperH SH64 Dependent Features - -* PDP-11-Dependent:: PDP-11 Dependent Features - -* PJ-Dependent:: picoJava Dependent Features - -* PPC-Dependent:: PowerPC Dependent Features - -* Sparc-Dependent:: SPARC Dependent Features - -* TIC54X-Dependent:: TI TMS320C54x Dependent Features - -* V850-Dependent:: V850 Dependent Features - -* Xtensa-Dependent:: Xtensa Dependent Features - -* Z80-Dependent:: Z80 Dependent Features - -* Z8000-Dependent:: Z8000 Dependent Features - -* Vax-Dependent:: VAX Dependent Features - - -File: as.info, Node: Alpha-Dependent, Next: ARC-Dependent, Up: Machine Dependencies - -8.1 Alpha Dependent Features -============================ - -* Menu: - -* Alpha Notes:: Notes -* Alpha Options:: Options -* Alpha Syntax:: Syntax -* Alpha Floating Point:: Floating Point -* Alpha Directives:: Alpha Machine Directives -* Alpha Opcodes:: Opcodes - - -File: as.info, Node: Alpha Notes, Next: Alpha Options, Up: Alpha-Dependent - -8.1.1 Notes ------------ - -The documentation here is primarily for the ELF object format. `as' -also supports the ECOFF and EVAX formats, but features specific to -these formats are not yet documented. - - -File: as.info, Node: Alpha Options, Next: Alpha Syntax, Prev: Alpha Notes, Up: Alpha-Dependent - -8.1.2 Options -------------- - -`-mCPU' - This option specifies the target processor. If an attempt is made - to assemble an instruction which will not execute on the target - processor, the assembler may either expand the instruction as a - macro or issue an error message. This option is equivalent to the - `.arch' directive. - - The following processor names are recognized: `21064', `21064a', - `21066', `21068', `21164', `21164a', `21164pc', `21264', `21264a', - `21264b', `ev4', `ev5', `lca45', `ev5', `ev56', `pca56', `ev6', - `ev67', `ev68'. The special name `all' may be used to allow the - assembler to accept instructions valid for any Alpha processor. - - In order to support existing practice in OSF/1 with respect to - `.arch', and existing practice within `MILO' (the Linux ARC - bootloader), the numbered processor names (e.g. 21064) enable the - processor-specific PALcode instructions, while the - "electro-vlasic" names (e.g. `ev4') do not. - -`-mdebug' -`-no-mdebug' - Enables or disables the generation of `.mdebug' encapsulation for - stabs directives and procedure descriptors. The default is to - automatically enable `.mdebug' when the first stabs directive is - seen. - -`-relax' - This option forces all relocations to be put into the object file, - instead of saving space and resolving some relocations at assembly - time. Note that this option does not propagate all symbol - arithmetic into the object file, because not all symbol arithmetic - can be represented. However, the option can still be useful in - specific applications. - -`-g' - This option is used when the compiler generates debug information. - When `gcc' is using `mips-tfile' to generate debug information - for ECOFF, local labels must be passed through to the object file. - Otherwise this option has no effect. - -`-GSIZE' - A local common symbol larger than SIZE is placed in `.bss', while - smaller symbols are placed in `.sbss'. - -`-F' -`-32addr' - These options are ignored for backward compatibility. - - -File: as.info, Node: Alpha Syntax, Next: Alpha Floating Point, Prev: Alpha Options, Up: Alpha-Dependent - -8.1.3 Syntax ------------- - -The assembler syntax closely follow the Alpha Reference Manual; -assembler directives and general syntax closely follow the OSF/1 and -OpenVMS syntax, with a few differences for ELF. - -* Menu: - -* Alpha-Chars:: Special Characters -* Alpha-Regs:: Register Names -* Alpha-Relocs:: Relocations - - -File: as.info, Node: Alpha-Chars, Next: Alpha-Regs, Up: Alpha Syntax - -8.1.3.1 Special Characters -.......................... - -`#' is the line comment character. - - `;' can be used instead of a newline to separate statements. - - -File: as.info, Node: Alpha-Regs, Next: Alpha-Relocs, Prev: Alpha-Chars, Up: Alpha Syntax - -8.1.3.2 Register Names -...................... - -The 32 integer registers are referred to as `$N' or `$rN'. In -addition, registers 15, 28, 29, and 30 may be referred to by the -symbols `$fp', `$at', `$gp', and `$sp' respectively. - - The 32 floating-point registers are referred to as `$fN'. - - -File: as.info, Node: Alpha-Relocs, Prev: Alpha-Regs, Up: Alpha Syntax - -8.1.3.3 Relocations -................... - -Some of these relocations are available for ECOFF, but mostly only for -ELF. They are modeled after the relocation format introduced in -Digital Unix 4.0, but there are additions. - - The format is `!TAG' or `!TAG!NUMBER' where TAG is the name of the -relocation. In some cases NUMBER is used to relate specific -instructions. - - The relocation is placed at the end of the instruction like so: - - ldah $0,a($29) !gprelhigh - lda $0,a($0) !gprellow - ldq $1,b($29) !literal!100 - ldl $2,0($1) !lituse_base!100 - -`!literal' -`!literal!N' - Used with an `ldq' instruction to load the address of a symbol - from the GOT. - - A sequence number N is optional, and if present is used to pair - `lituse' relocations with this `literal' relocation. The `lituse' - relocations are used by the linker to optimize the code based on - the final location of the symbol. - - Note that these optimizations are dependent on the data flow of the - program. Therefore, if _any_ `lituse' is paired with a `literal' - relocation, then _all_ uses of the register set by the `literal' - instruction must also be marked with `lituse' relocations. This - is because the original `literal' instruction may be deleted or - transformed into another instruction. - - Also note that there may be a one-to-many relationship between - `literal' and `lituse', but not a many-to-one. That is, if there - are two code paths that load up the same address and feed the - value to a single use, then the use may not use a `lituse' - relocation. - -`!lituse_base!N' - Used with any memory format instruction (e.g. `ldl') to indicate - that the literal is used for an address load. The offset field of - the instruction must be zero. During relaxation, the code may be - altered to use a gp-relative load. - -`!lituse_jsr!N' - Used with a register branch format instruction (e.g. `jsr') to - indicate that the literal is used for a call. During relaxation, - the code may be altered to use a direct branch (e.g. `bsr'). - -`!lituse_jsrdirect!N' - Similar to `lituse_jsr', but also that this call cannot be vectored - through a PLT entry. This is useful for functions with special - calling conventions which do not allow the normal call-clobbered - registers to be clobbered. - -`!lituse_bytoff!N' - Used with a byte mask instruction (e.g. `extbl') to indicate that - only the low 3 bits of the address are relevant. During - relaxation, the code may be altered to use an immediate instead of - a register shift. - -`!lituse_addr!N' - Used with any other instruction to indicate that the original - address is in fact used, and the original `ldq' instruction may - not be altered or deleted. This is useful in conjunction with - `lituse_jsr' to test whether a weak symbol is defined. - - ldq $27,foo($29) !literal!1 - beq $27,is_undef !lituse_addr!1 - jsr $26,($27),foo !lituse_jsr!1 - -`!lituse_tlsgd!N' - Used with a register branch format instruction to indicate that the - literal is the call to `__tls_get_addr' used to compute the - address of the thread-local storage variable whose descriptor was - loaded with `!tlsgd!N'. - -`!lituse_tlsldm!N' - Used with a register branch format instruction to indicate that the - literal is the call to `__tls_get_addr' used to compute the - address of the base of the thread-local storage block for the - current module. The descriptor for the module must have been - loaded with `!tlsldm!N'. - -`!gpdisp!N' - Used with `ldah' and `lda' to load the GP from the current - address, a-la the `ldgp' macro. The source register for the - `ldah' instruction must contain the address of the `ldah' - instruction. There must be exactly one `lda' instruction paired - with the `ldah' instruction, though it may appear anywhere in the - instruction stream. The immediate operands must be zero. - - bsr $26,foo - ldah $29,0($26) !gpdisp!1 - lda $29,0($29) !gpdisp!1 - -`!gprelhigh' - Used with an `ldah' instruction to add the high 16 bits of a - 32-bit displacement from the GP. - -`!gprellow' - Used with any memory format instruction to add the low 16 bits of a - 32-bit displacement from the GP. - -`!gprel' - Used with any memory format instruction to add a 16-bit - displacement from the GP. - -`!samegp' - Used with any branch format instruction to skip the GP load at the - target address. The referenced symbol must have the same GP as the - source object file, and it must be declared to either not use `$27' - or perform a standard GP load in the first two instructions via the - `.prologue' directive. - -`!tlsgd' -`!tlsgd!N' - Used with an `lda' instruction to load the address of a TLS - descriptor for a symbol in the GOT. - - The sequence number N is optional, and if present it used to pair - the descriptor load with both the `literal' loading the address of - the `__tls_get_addr' function and the `lituse_tlsgd' marking the - call to that function. - - For proper relaxation, both the `tlsgd', `literal' and `lituse' - relocations must be in the same extended basic block. That is, - the relocation with the lowest address must be executed first at - runtime. - -`!tlsldm' -`!tlsldm!N' - Used with an `lda' instruction to load the address of a TLS - descriptor for the current module in the GOT. - - Similar in other respects to `tlsgd'. - -`!gotdtprel' - Used with an `ldq' instruction to load the offset of the TLS - symbol within its module's thread-local storage block. Also known - as the dynamic thread pointer offset or dtp-relative offset. - -`!dtprelhi' -`!dtprello' -`!dtprel' - Like `gprel' relocations except they compute dtp-relative offsets. - -`!gottprel' - Used with an `ldq' instruction to load the offset of the TLS - symbol from the thread pointer. Also known as the tp-relative - offset. - -`!tprelhi' -`!tprello' -`!tprel' - Like `gprel' relocations except they compute tp-relative offsets. - - -File: as.info, Node: Alpha Floating Point, Next: Alpha Directives, Prev: Alpha Syntax, Up: Alpha-Dependent - -8.1.4 Floating Point --------------------- - -The Alpha family uses both IEEE and VAX floating-point numbers. - - -File: as.info, Node: Alpha Directives, Next: Alpha Opcodes, Prev: Alpha Floating Point, Up: Alpha-Dependent - -8.1.5 Alpha Assembler Directives --------------------------------- - -`as' for the Alpha supports many additional directives for -compatibility with the native assembler. This section describes them -only briefly. - - These are the additional directives in `as' for the Alpha: - -`.arch CPU' - Specifies the target processor. This is equivalent to the `-mCPU' - command-line option. *Note Options: Alpha Options, for a list of - values for CPU. - -`.ent FUNCTION[, N]' - Mark the beginning of FUNCTION. An optional number may follow for - compatibility with the OSF/1 assembler, but is ignored. When - generating `.mdebug' information, this will create a procedure - descriptor for the function. In ELF, it will mark the symbol as a - function a-la the generic `.type' directive. - -`.end FUNCTION' - Mark the end of FUNCTION. In ELF, it will set the size of the - symbol a-la the generic `.size' directive. - -`.mask MASK, OFFSET' - Indicate which of the integer registers are saved in the current - function's stack frame. MASK is interpreted a bit mask in which - bit N set indicates that register N is saved. The registers are - saved in a block located OFFSET bytes from the "canonical frame - address" (CFA) which is the value of the stack pointer on entry to - the function. The registers are saved sequentially, except that - the return address register (normally `$26') is saved first. - - This and the other directives that describe the stack frame are - currently only used when generating `.mdebug' information. They - may in the future be used to generate DWARF2 `.debug_frame' unwind - information for hand written assembly. - -`.fmask MASK, OFFSET' - Indicate which of the floating-point registers are saved in the - current stack frame. The MASK and OFFSET parameters are - interpreted as with `.mask'. - -`.frame FRAMEREG, FRAMEOFFSET, RETREG[, ARGOFFSET]' - Describes the shape of the stack frame. The frame pointer in use - is FRAMEREG; normally this is either `$fp' or `$sp'. The frame - pointer is FRAMEOFFSET bytes below the CFA. The return address is - initially located in RETREG until it is saved as indicated in - `.mask'. For compatibility with OSF/1 an optional ARGOFFSET - parameter is accepted and ignored. It is believed to indicate the - offset from the CFA to the saved argument registers. - -`.prologue N' - Indicate that the stack frame is set up and all registers have been - spilled. The argument N indicates whether and how the function - uses the incoming "procedure vector" (the address of the called - function) in `$27'. 0 indicates that `$27' is not used; 1 - indicates that the first two instructions of the function use `$27' - to perform a load of the GP register; 2 indicates that `$27' is - used in some non-standard way and so the linker cannot elide the - load of the procedure vector during relaxation. - -`.usepv FUNCTION, WHICH' - Used to indicate the use of the `$27' register, similar to - `.prologue', but without the other semantics of needing to be - inside an open `.ent'/`.end' block. - - The WHICH argument should be either `no', indicating that `$27' is - not used, or `std', indicating that the first two instructions of - the function perform a GP load. - - One might use this directive instead of `.prologue' if you are - also using dwarf2 CFI directives. - -`.gprel32 EXPRESSION' - Computes the difference between the address in EXPRESSION and the - GP for the current object file, and stores it in 4 bytes. In - addition to being smaller than a full 8 byte address, this also - does not require a dynamic relocation when used in a shared - library. - -`.t_floating EXPRESSION' - Stores EXPRESSION as an IEEE double precision value. - -`.s_floating EXPRESSION' - Stores EXPRESSION as an IEEE single precision value. - -`.f_floating EXPRESSION' - Stores EXPRESSION as a VAX F format value. - -`.g_floating EXPRESSION' - Stores EXPRESSION as a VAX G format value. - -`.d_floating EXPRESSION' - Stores EXPRESSION as a VAX D format value. - -`.set FEATURE' - Enables or disables various assembler features. Using the positive - name of the feature enables while using `noFEATURE' disables. - - `at' - Indicates that macro expansions may clobber the "assembler - temporary" (`$at' or `$28') register. Some macros may not be - expanded without this and will generate an error message if - `noat' is in effect. When `at' is in effect, a warning will - be generated if `$at' is used by the programmer. - - `macro' - Enables the expansion of macro instructions. Note that - variants of real instructions, such as `br label' vs `br - $31,label' are considered alternate forms and not macros. - - `move' - `reorder' - `volatile' - These control whether and how the assembler may re-order - instructions. Accepted for compatibility with the OSF/1 - assembler, but `as' does not do instruction scheduling, so - these features are ignored. - - The following directives are recognized for compatibility with the -OSF/1 assembler but are ignored. - - .proc .aproc - .reguse .livereg - .option .aent - .ugen .eflag - .alias .noalias - - -File: as.info, Node: Alpha Opcodes, Prev: Alpha Directives, Up: Alpha-Dependent - -8.1.6 Opcodes -------------- - -For detailed information on the Alpha machine instruction set, see the -Alpha Architecture Handbook -(ftp://ftp.digital.com/pub/Digital/info/semiconductor/literature/alphaahb.pdf). - - -File: as.info, Node: ARC-Dependent, Next: ARM-Dependent, Prev: Alpha-Dependent, Up: Machine Dependencies - -8.2 ARC Dependent Features -========================== - -* Menu: - -* ARC Options:: Options -* ARC Syntax:: Syntax -* ARC Floating Point:: Floating Point -* ARC Directives:: ARC Machine Directives -* ARC Opcodes:: Opcodes - - -File: as.info, Node: ARC Options, Next: ARC Syntax, Up: ARC-Dependent - -8.2.1 Options -------------- - -`-marc[5|6|7|8]' - This option selects the core processor variant. Using `-marc' is - the same as `-marc6', which is also the default. - - `arc5' - Base instruction set. - - `arc6' - Jump-and-link (jl) instruction. No requirement of an - instruction between setting flags and conditional jump. For - example: - - mov.f r0,r1 - beq foo - - `arc7' - Break (brk) and sleep (sleep) instructions. - - `arc8' - Software interrupt (swi) instruction. - - - Note: the `.option' directive can to be used to select a core - variant from within assembly code. - -`-EB' - This option specifies that the output generated by the assembler - should be marked as being encoded for a big-endian processor. - -`-EL' - This option specifies that the output generated by the assembler - should be marked as being encoded for a little-endian processor - - this is the default. - - - -File: as.info, Node: ARC Syntax, Next: ARC Floating Point, Prev: ARC Options, Up: ARC-Dependent - -8.2.2 Syntax ------------- - -* Menu: - -* ARC-Chars:: Special Characters -* ARC-Regs:: Register Names - - -File: as.info, Node: ARC-Chars, Next: ARC-Regs, Up: ARC Syntax - -8.2.2.1 Special Characters -.......................... - -*TODO* - - -File: as.info, Node: ARC-Regs, Prev: ARC-Chars, Up: ARC Syntax - -8.2.2.2 Register Names -...................... - -*TODO* - - -File: as.info, Node: ARC Floating Point, Next: ARC Directives, Prev: ARC Syntax, Up: ARC-Dependent - -8.2.3 Floating Point --------------------- - -The ARC core does not currently have hardware floating point support. -Software floating point support is provided by `GCC' and uses IEEE -floating-point numbers. - - -File: as.info, Node: ARC Directives, Next: ARC Opcodes, Prev: ARC Floating Point, Up: ARC-Dependent - -8.2.4 ARC Machine Directives ----------------------------- - -The ARC version of `as' supports the following additional machine -directives: - -`.2byte EXPRESSIONS' - *TODO* - -`.3byte EXPRESSIONS' - *TODO* - -`.4byte EXPRESSIONS' - *TODO* - -`.extAuxRegister NAME,ADDRESS,MODE' - The ARCtangent A4 has extensible auxiliary register space. The - auxiliary registers can be defined in the assembler source code by - using this directive. The first parameter is the NAME of the new - auxiallry register. The second parameter is the ADDRESS of the - register in the auxiliary register memory map for the variant of - the ARC. The third parameter specifies the MODE in which the - register can be operated is and it can be one of: - - `r (readonly)' - - `w (write only)' - - `r|w (read or write)' - - For example: - - .extAuxRegister mulhi,0x12,w - - This specifies an extension auxiliary register called _mulhi_ - which is at address 0x12 in the memory space and which is only - writable. - -`.extCondCode SUFFIX,VALUE' - The condition codes on the ARCtangent A4 are extensible and can be - specified by means of this assembler directive. They are specified - by the suffix and the value for the condition code. They can be - used to specify extra condition codes with any values. For - example: - - .extCondCode is_busy,0x14 - - add.is_busy r1,r2,r3 - bis_busy _main - -`.extCoreRegister NAME,REGNUM,MODE,SHORTCUT' - Specifies an extension core register NAME for the application. - This allows a register NAME with a valid REGNUM between 0 and 60, - with the following as valid values for MODE - - `_r_ (readonly)' - - `_w_ (write only)' - - `_r|w_ (read or write)' - - The other parameter gives a description of the register having a - SHORTCUT in the pipeline. The valid values are: - - `can_shortcut' - - `cannot_shortcut' - - For example: - - .extCoreRegister mlo,57,r,can_shortcut - - This defines an extension core register mlo with the value 57 which - can shortcut the pipeline. - -`.extInstruction NAME,OPCODE,SUBOPCODE,SUFFIXCLASS,SYNTAXCLASS' - The ARCtangent A4 allows the user to specify extension - instructions. The extension instructions are not macros. The - assembler creates encodings for use of these instructions - according to the specification by the user. The parameters are: - - *NAME - Name of the extension instruction - - *OPCODE - Opcode to be used. (Bits 27:31 in the encoding). Valid values - 0x10-0x1f or 0x03 - - *SUBOPCODE - Subopcode to be used. Valid values are from 0x09-0x3f. - However the correct value also depends on SYNTAXCLASS - - *SUFFIXCLASS - Determines the kinds of suffixes to be allowed. Valid values - are `SUFFIX_NONE', `SUFFIX_COND', `SUFFIX_FLAG' which - indicates the absence or presence of conditional suffixes and - flag setting by the extension instruction. It is also - possible to specify that an instruction sets the flags and is - conditional by using `SUFFIX_CODE' | `SUFFIX_FLAG'. - - *SYNTAXCLASS - Determines the syntax class for the instruction. It can have - the following values: - - ``SYNTAX_2OP':' - 2 Operand Instruction - - ``SYNTAX_3OP':' - 3 Operand Instruction - - In addition there could be modifiers for the syntax class as - described below: - - Syntax Class Modifiers are: - - - `OP1_MUST_BE_IMM': Modifies syntax class SYNTAX_3OP, - specifying that the first operand of a three-operand - instruction must be an immediate (i.e. the result is - discarded). OP1_MUST_BE_IMM is used by bitwise ORing it - with SYNTAX_3OP as given in the example below. This - could usually be used to set the flags using specific - instructions and not retain results. - - - `OP1_IMM_IMPLIED': Modifies syntax class SYNTAX_20P, it - specifies that there is an implied immediate destination - operand which does not appear in the syntax. For - example, if the source code contains an instruction like: - - inst r1,r2 - - it really means that the first argument is an implied - immediate (that is, the result is discarded). This is - the same as though the source code were: inst 0,r1,r2. - You use OP1_IMM_IMPLIED by bitwise ORing it with - SYNTAX_20P. - - - For example, defining 64-bit multiplier with immediate operands: - - .extInstruction mp64,0x14,0x0,SUFFIX_COND | SUFFIX_FLAG , - SYNTAX_3OP|OP1_MUST_BE_IMM - - The above specifies an extension instruction called mp64 which has - 3 operands, sets the flags, can be used with a condition code, for - which the first operand is an immediate. (Equivalent to - discarding the result of the operation). - - .extInstruction mul64,0x14,0x00,SUFFIX_COND, SYNTAX_2OP|OP1_IMM_IMPLIED - - This describes a 2 operand instruction with an implicit first - immediate operand. The result of this operation would be - discarded. - -`.half EXPRESSIONS' - *TODO* - -`.long EXPRESSIONS' - *TODO* - -`.option ARC|ARC5|ARC6|ARC7|ARC8' - The `.option' directive must be followed by the desired core - version. Again `arc' is an alias for `arc6'. - - Note: the `.option' directive overrides the command line option - `-marc'; a warning is emitted when the version is not consistent - between the two - even for the implicit default core version - (arc6). - -`.short EXPRESSIONS' - *TODO* - -`.word EXPRESSIONS' - *TODO* - - - -File: as.info, Node: ARC Opcodes, Prev: ARC Directives, Up: ARC-Dependent - -8.2.5 Opcodes -------------- - -For information on the ARC instruction set, see `ARC Programmers -Reference Manual', ARC International (www.arc.com) - - -File: as.info, Node: ARM-Dependent, Next: BFIN-Dependent, Prev: ARC-Dependent, Up: Machine Dependencies - -8.3 ARM Dependent Features -========================== - -* Menu: - -* ARM Options:: Options -* ARM Syntax:: Syntax -* ARM Floating Point:: Floating Point -* ARM Directives:: ARM Machine Directives -* ARM Opcodes:: Opcodes -* ARM Mapping Symbols:: Mapping Symbols - - -File: as.info, Node: ARM Options, Next: ARM Syntax, Up: ARM-Dependent - -8.3.1 Options -------------- - -`-mcpu=PROCESSOR[+EXTENSION...]' - This option specifies the target processor. The assembler will - issue an error message if an attempt is made to assemble an - instruction which will not execute on the target processor. The - following processor names are recognized: `arm1', `arm2', `arm250', - `arm3', `arm6', `arm60', `arm600', `arm610', `arm620', `arm7', - `arm7m', `arm7d', `arm7dm', `arm7di', `arm7dmi', `arm70', `arm700', - `arm700i', `arm710', `arm710t', `arm720', `arm720t', `arm740t', - `arm710c', `arm7100', `arm7500', `arm7500fe', `arm7t', `arm7tdmi', - `arm7tdmi-s', `arm8', `arm810', `strongarm', `strongarm1', - `strongarm110', `strongarm1100', `strongarm1110', `arm9', `arm920', - `arm920t', `arm922t', `arm940t', `arm9tdmi', `arm9e', `arm926e', - `arm926ej-s', `arm946e-r0', `arm946e', `arm946e-s', `arm966e-r0', - `arm966e', `arm966e-s', `arm968e-s', `arm10t', `arm10tdmi', - `arm10e', `arm1020', `arm1020t', `arm1020e', `arm1022e', - `arm1026ej-s', `arm1136j-s', `arm1136jf-s', `arm1156t2-s', - `arm1156t2f-s', `arm1176jz-s', `arm1176jzf-s', `mpcore', - `mpcorenovfp', `cortex-a8', `cortex-r4', `cortex-m3', `ep9312' - (ARM920 with Cirrus Maverick coprocessor), `i80200' (Intel XScale - processor) `iwmmxt' (Intel(r) XScale processor with Wireless - MMX(tm) technology coprocessor) and `xscale'. The special name - `all' may be used to allow the assembler to accept instructions - valid for any ARM processor. - - In addition to the basic instruction set, the assembler can be - told to accept various extension mnemonics that extend the - processor using the co-processor instruction space. For example, - `-mcpu=arm920+maverick' is equivalent to specifying - `-mcpu=ep9312'. The following extensions are currently supported: - `+maverick' `+iwmmxt' and `+xscale'. - -`-march=ARCHITECTURE[+EXTENSION...]' - This option specifies the target architecture. The assembler will - issue an error message if an attempt is made to assemble an - instruction which will not execute on the target architecture. - The following architecture names are recognized: `armv1', `armv2', - `armv2a', `armv2s', `armv3', `armv3m', `armv4', `armv4xm', - `armv4t', `armv4txm', `armv5', `armv5t', `armv5txm', `armv5te', - `armv5texp', `armv6', `armv6j', `armv6k', `armv6z', `armv6zk', - `armv7', `armv7a', `armv7r', `armv7m', `iwmmxt' and `xscale'. If - both `-mcpu' and `-march' are specified, the assembler will use - the setting for `-mcpu'. - - The architecture option can be extended with the same instruction - set extension options as the `-mcpu' option. - -`-mfpu=FLOATING-POINT-FORMAT' - This option specifies the floating point format to assemble for. - The assembler will issue an error message if an attempt is made to - assemble an instruction which will not execute on the target - floating point unit. The following format options are recognized: - `softfpa', `fpe', `fpe2', `fpe3', `fpa', `fpa10', `fpa11', - `arm7500fe', `softvfp', `softvfp+vfp', `vfp', `vfp10', `vfp10-r0', - `vfp9', `vfpxd', `arm1020t', `arm1020e', `arm1136jf-s' and - `maverick'. - - In addition to determining which instructions are assembled, this - option also affects the way in which the `.double' assembler - directive behaves when assembling little-endian code. - - The default is dependent on the processor selected. For - Architecture 5 or later, the default is to assembler for VFP - instructions; for earlier architectures the default is to assemble - for FPA instructions. - -`-mthumb' - This option specifies that the assembler should start assembling - Thumb instructions; that is, it should behave as though the file - starts with a `.code 16' directive. - -`-mthumb-interwork' - This option specifies that the output generated by the assembler - should be marked as supporting interworking. - -`-mapcs `[26|32]'' - This option specifies that the output generated by the assembler - should be marked as supporting the indicated version of the Arm - Procedure. Calling Standard. - -`-matpcs' - This option specifies that the output generated by the assembler - should be marked as supporting the Arm/Thumb Procedure Calling - Standard. If enabled this option will cause the assembler to - create an empty debugging section in the object file called - .arm.atpcs. Debuggers can use this to determine the ABI being - used by. - -`-mapcs-float' - This indicates the floating point variant of the APCS should be - used. In this variant floating point arguments are passed in FP - registers rather than integer registers. - -`-mapcs-reentrant' - This indicates that the reentrant variant of the APCS should be - used. This variant supports position independent code. - -`-mfloat-abi=ABI' - This option specifies that the output generated by the assembler - should be marked as using specified floating point ABI. The - following values are recognized: `soft', `softfp' and `hard'. - -`-meabi=VER' - This option specifies which EABI version the produced object files - should conform to. The following values are recognised: `gnu', `4' - and `5'. - -`-EB' - This option specifies that the output generated by the assembler - should be marked as being encoded for a big-endian processor. - -`-EL' - This option specifies that the output generated by the assembler - should be marked as being encoded for a little-endian processor. - -`-k' - This option specifies that the output of the assembler should be - marked as position-independent code (PIC). - - - -File: as.info, Node: ARM Syntax, Next: ARM Floating Point, Prev: ARM Options, Up: ARM-Dependent - -8.3.2 Syntax ------------- - -* Menu: - -* ARM-Chars:: Special Characters -* ARM-Regs:: Register Names - - -File: as.info, Node: ARM-Chars, Next: ARM-Regs, Up: ARM Syntax - -8.3.2.1 Special Characters -.......................... - -The presence of a `@' on a line indicates the start of a comment that -extends to the end of the current line. If a `#' appears as the first -character of a line, the whole line is treated as a comment. - - The `;' character can be used instead of a newline to separate -statements. - - Either `#' or `$' can be used to indicate immediate operands. - - *TODO* Explain about /data modifier on symbols. - - -File: as.info, Node: ARM-Regs, Prev: ARM-Chars, Up: ARM Syntax - -8.3.2.2 Register Names -...................... - -*TODO* Explain about ARM register naming, and the predefined names. - - -File: as.info, Node: ARM Floating Point, Next: ARM Directives, Prev: ARM Syntax, Up: ARM-Dependent - -8.3.3 Floating Point --------------------- - -The ARM family uses IEEE floating-point numbers. - - -File: as.info, Node: ARM Directives, Next: ARM Opcodes, Prev: ARM Floating Point, Up: ARM-Dependent - -8.3.4 ARM Machine Directives ----------------------------- - -`.align EXPRESSION [, EXPRESSION]' - This is the generic .ALIGN directive. For the ARM however if the - first argument is zero (ie no alignment is needed) the assembler - will behave as if the argument had been 2 (ie pad to the next four - byte boundary). This is for compatibility with ARM's own - assembler. - -`NAME .req REGISTER NAME' - This creates an alias for REGISTER NAME called NAME. For example: - - foo .req r0 - -`.unreq ALIAS-NAME' - This undefines a register alias which was previously defined using - the `req' directive. For example: - - foo .req r0 - .unreq foo - - An error occurs if the name is undefined. Note - this pseudo op - can be used to delete builtin in register name aliases (eg 'r0'). - This should only be done if it is really necessary. - -`.code `[16|32]'' - This directive selects the instruction set being generated. The - value 16 selects Thumb, with the value 32 selecting ARM. - -`.thumb' - This performs the same action as .CODE 16. - -`.arm' - This performs the same action as .CODE 32. - -`.force_thumb' - This directive forces the selection of Thumb instructions, even if - the target processor does not support those instructions - -`.thumb_func' - This directive specifies that the following symbol is the name of a - Thumb encoded function. This information is necessary in order to - allow the assembler and linker to generate correct code for - interworking between Arm and Thumb instructions and should be used - even if interworking is not going to be performed. The presence - of this directive also implies `.thumb' - -`.thumb_set' - This performs the equivalent of a `.set' directive in that it - creates a symbol which is an alias for another symbol (possibly - not yet defined). This directive also has the added property in - that it marks the aliased symbol as being a thumb function entry - point, in the same way that the `.thumb_func' directive does. - -`.ltorg' - This directive causes the current contents of the literal pool to - be dumped into the current section (which is assumed to be the - .text section) at the current location (aligned to a word - boundary). `GAS' maintains a separate literal pool for each - section and each sub-section. The `.ltorg' directive will only - affect the literal pool of the current section and sub-section. - At the end of assembly all remaining, un-empty literal pools will - automatically be dumped. - - Note - older versions of `GAS' would dump the current literal pool - any time a section change occurred. This is no longer done, since - it prevents accurate control of the placement of literal pools. - -`.pool' - This is a synonym for .ltorg. - -`.unwind_fnstart' - Marks the start of a function with an unwind table entry. - -`.unwind_fnend' - Marks the end of a function with an unwind table entry. The - unwind index table entry is created when this directive is - processed. - - If no personality routine has been specified then standard - personality routine 0 or 1 will be used, depending on the number - of unwind opcodes required. - -`.cantunwind' - Prevents unwinding through the current function. No personality - routine or exception table data is required or permitted. - -`.personality NAME' - Sets the personality routine for the current function to NAME. - -`.personalityindex INDEX' - Sets the personality routine for the current function to the EABI - standard routine number INDEX - -`.handlerdata' - Marks the end of the current function, and the start of the - exception table entry for that function. Anything between this - directive and the `.fnend' directive will be added to the - exception table entry. - - Must be preceded by a `.personality' or `.personalityindex' - directive. - -`.save REGLIST' - Generate unwinder annotations to restore the registers in REGLIST. - The format of REGLIST is the same as the corresponding - store-multiple instruction. - - _core registers_ - .save {r4, r5, r6, lr} - stmfd sp!, {r4, r5, r6, lr} - _FPA registers_ - .save f4, 2 - sfmfd f4, 2, [sp]! - _VFP registers_ - .save {d8, d9, d10} - fstmdf sp!, {d8, d9, d10} - _iWMMXt registers_ - .save {wr10, wr11} - wstrd wr11, [sp, #-8]! - wstrd wr10, [sp, #-8]! - or - .save wr11 - wstrd wr11, [sp, #-8]! - .save wr10 - wstrd wr10, [sp, #-8]! - -`.pad #COUNT' - Generate unwinder annotations for a stack adjustment of COUNT - bytes. A positive value indicates the function prologue allocated - stack space by decrementing the stack pointer. - -`.movsp REG' - Tell the unwinder that REG contains the current stack pointer. - -`.setfp FPREG, SPREG [, #OFFSET]' - Make all unwinder annotations relaive to a frame pointer. Without - this the unwinder will use offsets from the stack pointer. - - The syntax of this directive is the same as the `sub' or `mov' - instruction used to set the frame pointer. SPREG must be either - `sp' or mentioned in a previous `.movsp' directive. - - .movsp ip - mov ip, sp - ... - .setfp fp, ip, #4 - sub fp, ip, #4 - -`.raw OFFSET, BYTE1, ...' - Insert one of more arbitary unwind opcode bytes, which are known - to adjust the stack pointer by OFFSET bytes. - - For example `.unwind_raw 4, 0xb1, 0x01' is equivalent to `.save - {r0}' - -`.cpu NAME' - Select the target processor. Valid values for NAME are the same as - for the `-mcpu' commandline option. - -`.arch NAME' - Select the target architecture. Valid values for NAME are the - same as for the `-march' commandline option. - -`.fpu NAME' - Select the floating point unit to assemble for. Valid values for - NAME are the same as for the `-mfpu' commandline option. - -`.eabi_attribute TAG, VALUE' - Set the EABI object attribute number TAG to VALUE. The value is - either a `number', `"string"', or `number, "string"' depending on - the tag. - - - -File: as.info, Node: ARM Opcodes, Next: ARM Mapping Symbols, Prev: ARM Directives, Up: ARM-Dependent - -8.3.5 Opcodes -------------- - -`as' implements all the standard ARM opcodes. It also implements -several pseudo opcodes, including several synthetic load instructions. - -`NOP' - nop - - This pseudo op will always evaluate to a legal ARM instruction - that does nothing. Currently it will evaluate to MOV r0, r0. - -`LDR' - ldr , = - - If expression evaluates to a numeric constant then a MOV or MVN - instruction will be used in place of the LDR instruction, if the - constant can be generated by either of these instructions. - Otherwise the constant will be placed into the nearest literal - pool (if it not already there) and a PC relative LDR instruction - will be generated. - -`ADR' - adr